From c8509026e1d946817b93b7231d7b58dedcc3b33e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ermal=20Lu=E7i?= Date: Wed, 3 Mar 2010 21:05:56 +0000 Subject: Fix creation of interface settings written on config. Add passive option. Allow redistribute rules to be specified. --- config/openospfd/openospfd.inc | 15 ++++++++++++++- config/openospfd/openospfd.xml | 24 ++++++++++++++++++++++-- config/openospfd/openospfd_interfaces.xml | 6 ++++++ 3 files changed, 42 insertions(+), 3 deletions(-) (limited to 'config/openospfd') diff --git a/config/openospfd/openospfd.inc b/config/openospfd/openospfd.inc index d64e8774..d38ec82f 100644 --- a/config/openospfd/openospfd.inc +++ b/config/openospfd/openospfd.inc @@ -54,13 +54,21 @@ function ospfd_install_conf() { if ($ospfd_conf['updatefib']) $conffile .= "fib-update no\n"; + if (is_array($ospfd_conf['row'])) { + foreach ($ospfd_conf['row'] as $redistr) { + if (isset($redistr['redistribute'])) + $conffile .= "no "; + $conffile .= "redistribute {$redistr['routevalue']}\n"; + } + } + if ($ospfd_conf['redistributeconnectedsubnets']) $conffile .= "redistribute connected\n"; if ($ospfd_conf['redistributedefaultroute']) $conffile .= "redistribute default\n"; - if ($ospfd_conf['resdistributestatic']) + if ($ospfd_conf['redistributestatic']) $conffile .= "redistribute static\n"; if ($ospfd_conf['spfholdtime']) @@ -78,6 +86,7 @@ function ospfd_install_conf() { foreach ($config['installedpackages']['ospfdinterfaces']['config'] as $conf) { $conffile .= "\tinterface " . $config['interfaces'][$conf['interface']]['if']; $options_present = false; + $ifconfigs = ""; if (!empty($conf['metric'])) { $options_present = true; $ifconfigs .= "\t\tmetric {$conf['metric']}\n"; @@ -108,6 +117,10 @@ function ospfd_install_conf() { $options_present = true; $ifconfigs .= "\t\trouter-dead-time {$conf['deadtimer']}\n"; } + if (!empty($conf['passive'])) { + $options_present = true; + $ifconfigs .= "\t\tpassive\n"; + } if (!empty($ifconfigs)) { $conffile .= " {\n {$ifconfigs} \n"; if ($options_present == true) diff --git a/config/openospfd/openospfd.xml b/config/openospfd/openospfd.xml index 3088084c..a5bc100c 100644 --- a/config/openospfd/openospfd.xml +++ b/config/openospfd/openospfd.xml @@ -54,7 +54,7 @@ Update FIB (Routing table) updatefib - Enables the updating of the host routing table + Disables the updating of the host routing table(turns into stub router). checkbox @@ -71,7 +71,7 @@ Redistribute static - resdistributestatic + redistributestatic Enables the redistribution of static routes checkbox @@ -93,6 +93,26 @@ If set to yes, decisions regarding AS-external routes are evaluated according to RFC 1583. The default is no. checkbox + + This rules will take precedence over any other redistribute option specified above. + none + rowhelper + + + Disable Redistribute + redistribute + Redistribute rules. + checkbox + 20 + + + Route value + routevalue + input + 25 + + + ospfd_install_conf(); diff --git a/config/openospfd/openospfd_interfaces.xml b/config/openospfd/openospfd_interfaces.xml index b8f2522e..ea4c0dfb 100644 --- a/config/openospfd/openospfd_interfaces.xml +++ b/config/openospfd/openospfd_interfaces.xml @@ -62,6 +62,12 @@ 30 input + + Interface is Passive + passive + Prevent transmission and reception of OSPF packets on this interface. The specified interface will be announced as a stub network. + checkbox + Enable MD5 password for this OSPFd interface (default no) md5password -- cgit v1.2.3