aboutsummaryrefslogtreecommitdiffstats
path: root/config/quagga_ospfd/quagga_ospfd.inc
diff options
context:
space:
mode:
authorJohn Grange <john@sd-networks.net>2012-05-28 18:45:05 -0700
committerJohn Grange <john@sd-networks.net>2012-05-28 18:45:05 -0700
commit0098b559c1dff219f982690c15b365c814c5d787 (patch)
tree1435d09fd16fead2967ae558856ba95ae60e6ea9 /config/quagga_ospfd/quagga_ospfd.inc
parent3864c8951c23d691101b18911bb5e76d603e4d1b (diff)
downloadpfsense-packages-0098b559c1dff219f982690c15b365c814c5d787.tar.gz
pfsense-packages-0098b559c1dff219f982690c15b365c814c5d787.tar.bz2
pfsense-packages-0098b559c1dff219f982690c15b365c814c5d787.zip
Multiple Areas in networks and interfaces
Added ability to change areas for selected interfaces and networks that are shared. Signed-off-by: John Grange <john@sd-networks.net>
Diffstat (limited to 'config/quagga_ospfd/quagga_ospfd.inc')
-rw-r--r--config/quagga_ospfd/quagga_ospfd.inc43
1 files changed, 33 insertions, 10 deletions
diff --git a/config/quagga_ospfd/quagga_ospfd.inc b/config/quagga_ospfd/quagga_ospfd.inc
index 54d4ef3f..4b7e007e 100644
--- a/config/quagga_ospfd/quagga_ospfd.inc
+++ b/config/quagga_ospfd/quagga_ospfd.inc
@@ -82,6 +82,7 @@ function quagga_ospfd_install_conf() {
/* Interface Settings */
$passive_interfaces = array();
$interface_networks = array();
+
if ($config['installedpackages']['quaggaospfdinterfaces']['config']) {
foreach ($config['installedpackages']['quaggaospfdinterfaces']['config'] as $conf) {
$realif = get_real_interface($conf['interface']);
@@ -116,9 +117,18 @@ function quagga_ospfd_install_conf() {
if ($interface_subnet == 32)
$interface_subnet = 30;
$subnet = gen_subnet($interface_ip, $interface_subnet);
- $interface_networks[] = "{$subnet}/{$interface_subnet}";
- }
+ if (!empty($conf['interfacearea'])) {
+ $interface_networks[] = array( "subnet" => "{$subnet}/{$interface_subnet}", "area" => $conf['interfacearea']);
+ }
+ else {
+ $interface_networks[] = array( "subnet" => "{$subnet}/{$interface_subnet}", "area" => $ospfd_conf['area']);
+ }
+
+
+
+ }
}
+
/* OSPF Settings */
@@ -153,24 +163,37 @@ function quagga_ospfd_install_conf() {
if ($ospfd_conf['rfc1583'])
$conffile .= " ospf rfc1583compatibility\n";
- if (is_array($passive_interfaces))
+ if (is_array($passive_interfaces)) {
foreach ($passive_interfaces as $pint)
$conffile .= " passive-interface {$pint}\n";
+ }
+
- if (is_array($interface_networks))
- foreach ($interface_networks as $ifn)
- if (is_subnet($ifn))
- $conffile .= " network {$ifn} area {$ospfd_conf['area']}\n";
+ if (is_array($interface_networks)) {
+ foreach ($interface_networks as $ifn) {
+
+ if (is_subnet($ifn['subnet'])) {
+ $conffile .= " network {$ifn['subnet']} area {$ifn['area']}\n";
+ }
+
+ }
+ }
if (is_array($ospfd_conf['row'])) {
foreach ($ospfd_conf['row'] as $redistr) {
- if (isset($redistr['redistribute']))
+
+ if (isset($redistr['redistribute'])) {
$conffile .= " no ";
- $conffile .= " network {$redistr['routevalue']} area {$ospfd_conf['area']}\n";
+ }
+ if ($redistr['routearea'] == "") {
+ $conffile .= " network {$redistr['routevalue']} area {$ospfd_conf['area']}\n";
+ }
+ else {
+ $conffile .= " network {$redistr['routevalue']} area {$redistr['routearea']}\n";
+ }
}
}
}
-
$fd = fopen("/usr/local/etc/quagga/ospfd.conf", "w");
// Write out the configuration file