diff options
author | Ermal Luçi <eri@pfsense.org> | 2008-11-07 19:30:45 +0000 |
---|---|---|
committer | Ermal Luçi <eri@pfsense.org> | 2008-11-07 19:30:45 +0000 |
commit | 7ec05d27c73b9fd3ffa579e18b72040ba5fdec74 (patch) | |
tree | b51ef368b0257403123b5af3287ce34eaf30316d /etc | |
parent | 1723f72d93c1e0d4c9a4ec9a56262e81a09d45b8 (diff) | |
download | pfsense-7ec05d27c73b9fd3ffa579e18b72040ba5fdec74.zip pfsense-7ec05d27c73b9fd3ffa579e18b72040ba5fdec74.tar.gz |
* Rename link_int_to_bridge_interface to link_interface_to_bridge
* Create two new function link_interface_to_{gif,gre}
Diffstat (limited to 'etc')
-rw-r--r-- | etc/inc/filter.inc | 2 | ||||
-rw-r--r-- | etc/inc/interfaces.inc | 2 | ||||
-rw-r--r-- | etc/inc/pfsense-utils.inc | 30 | ||||
-rw-r--r-- | etc/inc/services.inc | 4 |
4 files changed, 28 insertions, 10 deletions
diff --git a/etc/inc/filter.inc b/etc/inc/filter.inc index 1599a0a..be8f884 100644 --- a/etc/inc/filter.inc +++ b/etc/inc/filter.inc @@ -429,7 +429,7 @@ function generate_optcfg_array() $oic['alias-subnet'] = $oc['alias-subnet']; $oic['gateway'] = $oc['gateway']; $oic['spoofcheck'] = "yes"; - $oic['bridge'] = link_int_to_bridge_interface($if); + $oic['bridge'] = link_interface_to_bridge($if); $FilterIflist[$if] = $oic; } diff --git a/etc/inc/interfaces.inc b/etc/inc/interfaces.inc index 01a1dc9..8c2af38 100644 --- a/etc/inc/interfaces.inc +++ b/etc/inc/interfaces.inc @@ -1321,7 +1321,7 @@ function interface_configure($interface = "wan") mwexec("/sbin/ifconfig {$wancfg['if']} up"); - $bridgeif = link_int_to_bridge_interface($interface); + $bridgeif = link_interface_to_bridge($interface); if (!empty($bridgeif)) mwexec("/sbin/ifconfig {$bridgeif} addm {$realif}"); diff --git a/etc/inc/pfsense-utils.inc b/etc/inc/pfsense-utils.inc index 396372e..ddee2e1 100644 --- a/etc/inc/pfsense-utils.inc +++ b/etc/inc/pfsense-utils.inc @@ -1223,15 +1223,15 @@ function find_number_of_created_carp_interfaces($flush = false) { return $carp_interface_count_cache; } -/****f* pfsense-utils/link_int_to_bridge_interface +/****f* pfsense-utils/link_interface_to_bridge * NAME - * link_int_to_bridge_interface - Finds out a bridge group for an interface + * link_interface_to_bridge - Finds out a bridge group for an interface * INPUTS * $ip * RESULT * bridge[0-99] ******/ -function link_int_to_bridge_interface($int) { +function link_interface_to_bridge($int) { global $config; if (is_array($config['bridges']['bridged'])) @@ -1240,6 +1240,24 @@ function link_int_to_bridge_interface($int) { return "{$bridge['bridgeif']}"; } +function link_interface_to_gre($interface) { + global $config; + + if (is_array($config['gres']['gre'])) + foreach ($config['gres']['gre'] as $gre) + if($gre['if'] == $interface)) + return "{$gre['greif']}"; +} + +function link_interface_to_gif($interface) { + global $config; + + if (is_array($config['gifs']['gif'])) + foreach ($config['gifs']['gif'] as $gif) + if($gif['if'] == $interface)) + return "{$gif['gifif']}"; +} + function link_carp_interface_to_parent($interface) { global $config; if($interface == "") return; @@ -3439,9 +3457,9 @@ function is_dhcp_server_enabled() return false; foreach ($config['dhcpd'] as $dhcpif => $dhcpifconf) { - if (isset ($dhcpifconf['enable']) && (($dhcpif == "lan") || (isset ($config['interfaces'][$dhcpif]['enable']) && $config['interfaces'][$dhcpif]['if'] && (!link_int_to_bridge_interface($dhcpif))))) + if (isset ($dhcpifconf['enable']) && (($dhcpif == "lan") || (isset ($config['interfaces'][$dhcpif]['enable']) && $config['interfaces'][$dhcpif]['if'] && (!link_interface_to_bridge($dhcpif))))) $dhcpdenable = true; - if (isset ($dhcpifconf['enable']) && (($dhcpif == "wan") || (isset ($config['interfaces'][$dhcpif]['enable']) && $config['interfaces'][$dhcpif]['if'] && (!link_int_to_bridge_interface($dhcpif))))) + if (isset ($dhcpifconf['enable']) && (($dhcpif == "wan") || (isset ($config['interfaces'][$dhcpif]['enable']) && $config['interfaces'][$dhcpif]['if'] && (!link_interface_to_bridge($dhcpif))))) $dhcpdenable = true; } @@ -3658,7 +3676,7 @@ function get_interface_info($ifdescr) { } $bridge = ""; - $bridge = link_int_to_bridge_interface($ifdescr); + $bridge = link_interface_to_bridge($ifdescr); if($bridge) { $bridge_text = `/sbin/ifconfig {$bridge}`; if(stristr($bridge_text, "blocking") <> false) { diff --git a/etc/inc/services.inc b/etc/inc/services.inc index d957b0b..de3e4df 100644 --- a/etc/inc/services.inc +++ b/etc/inc/services.inc @@ -389,7 +389,7 @@ function services_dhcrelay_configure() { if (isset($dhcrelayifconf['enable']) && (($dhcrelayif == "lan") || (isset($config['interfaces'][$dhcrelayif]['enable']) && - $config['interfaces'][$dhcrelayif]['if'] && (!link_int_to_bridge_interface($dhcrelayif))))) + $config['interfaces'][$dhcrelayif]['if'] && (!link_interface_to_bridge($dhcrelayif))))) $dhcrelayenable = true; } } @@ -410,7 +410,7 @@ function services_dhcrelay_configure() { if (!isset($dhcrelayifconf['enable']) || (($dhcrelayif != "lan") && (!isset($ifcfg['enable']) || !$ifcfg['if'] || - link_int_to_bridge_interface($dhcrelayif)))) + link_interface_to_bridge($dhcrelayif)))) continue; $dhcrelayifs[] = $ifcfg['if']; |