summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorErmal Luçi <eri@pfsense.org>2008-11-07 19:30:45 +0000
committerErmal Luçi <eri@pfsense.org>2008-11-07 19:30:45 +0000
commit7ec05d27c73b9fd3ffa579e18b72040ba5fdec74 (patch)
treeb51ef368b0257403123b5af3287ce34eaf30316d
parent1723f72d93c1e0d4c9a4ec9a56262e81a09d45b8 (diff)
downloadpfsense-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}
-rw-r--r--etc/inc/filter.inc2
-rw-r--r--etc/inc/interfaces.inc2
-rw-r--r--etc/inc/pfsense-utils.inc30
-rw-r--r--etc/inc/services.inc4
-rw-r--r--usr/local/www/diag_packet_capture.php2
-rwxr-xr-xusr/local/www/diag_ping.php2
-rwxr-xr-xusr/local/www/interfaces_assign.php2
-rwxr-xr-xusr/local/www/services_captiveportal.php2
-rwxr-xr-xusr/local/www/services_dhcp.php2
-rwxr-xr-xusr/local/www/services_wol.php2
-rwxr-xr-xusr/local/www/services_wol_edit.php2
-rwxr-xr-xusr/local/www/status_services.php2
-rw-r--r--usr/local/www/widgets/widgets/services_status.widget.php2
13 files changed, 37 insertions, 19 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'];
diff --git a/usr/local/www/diag_packet_capture.php b/usr/local/www/diag_packet_capture.php
index fa972ff..ab5c83c 100644
--- a/usr/local/www/diag_packet_capture.php
+++ b/usr/local/www/diag_packet_capture.php
@@ -117,7 +117,7 @@ include("head.inc"); ?>
<select name="interface">
<?php $interfaces = get_configured_interface_with_descr();
foreach ($interfaces as $iface => $ifacename): ?>
- <option value="<?=$iface;?>" <?php if (!link_int_to_bridge_interface($iface) && $selectedif == $iface) echo "selected"; ?>>
+ <option value="<?=$iface;?>" <?php if (!link_interface_to_bridge($iface) && $selectedif == $iface) echo "selected"; ?>>
<?php echo $ifacename;?>
</option>
<?php endforeach;?>
diff --git a/usr/local/www/diag_ping.php b/usr/local/www/diag_ping.php
index 9d2e44c..8a71f0c 100755
--- a/usr/local/www/diag_ping.php
+++ b/usr/local/www/diag_ping.php
@@ -91,7 +91,7 @@ include("head.inc"); ?>
<select name="interface" class="formfld">
<?php $interfaces = get_configured_interface_with_descr();
foreach ($interfaces as $iface => $ifacename): ?>
- <option value="<?=$iface;?>" <?php if (!link_int_to_bridge_interface($iface) && $iface == $interface) echo "selected"; ?>>
+ <option value="<?=$iface;?>" <?php if (!link_interface_to_bridge($iface) && $iface == $interface) echo "selected"; ?>>
<?=htmlspecialchars($ifacename);?>
</option>
<?php endforeach; ?>
diff --git a/usr/local/www/interfaces_assign.php b/usr/local/www/interfaces_assign.php
index 835da63..97fe493 100755
--- a/usr/local/www/interfaces_assign.php
+++ b/usr/local/www/interfaces_assign.php
@@ -196,7 +196,7 @@ if ($_POST['apply']) {
if ($_GET['act'] == "del") {
$id = $_GET['id'];
- if (link_int_to_bridge_interface($id))
+ if (link_interface_to_bridge($id))
$input_errors[] = "The interface is part of a bridge. Please remove it from the bridge to continue";
else {
unset($config['interfaces'][$id]['enable']);
diff --git a/usr/local/www/services_captiveportal.php b/usr/local/www/services_captiveportal.php
index 8fa01f9..e68bd4f 100755
--- a/usr/local/www/services_captiveportal.php
+++ b/usr/local/www/services_captiveportal.php
@@ -100,7 +100,7 @@ if ($_POST) {
do_input_validation($_POST, $reqdfields, $reqdfieldsn, &$input_errors);
/* make sure no interfaces are bridged */
- if (link_int_to_bridge_interface($pconfig['cinterface']))
+ if (link_interface_to_bridge($pconfig['cinterface']))
$input_errors[] = "The captive portal cannot be used when one or more interfaces are bridged.";
if ($_POST['httpslogin_enable']) {
diff --git a/usr/local/www/services_dhcp.php b/usr/local/www/services_dhcp.php
index da7a2d7..6ddced7 100755
--- a/usr/local/www/services_dhcp.php
+++ b/usr/local/www/services_dhcp.php
@@ -117,7 +117,7 @@ if(is_array($dhcrelaycfg)) {
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)))))
$dhcrelay_enabled = true;
}
}
diff --git a/usr/local/www/services_wol.php b/usr/local/www/services_wol.php
index b7f3ab8..ee40cbb 100755
--- a/usr/local/www/services_wol.php
+++ b/usr/local/www/services_wol.php
@@ -116,7 +116,7 @@ include("head.inc");
<?php
$interfaces = get_configured_interface_with_descr();
foreach ($interfaces as $iface => $ifacename): ?>
- <option value="<?=$iface;?>" <?php if (!link_int_to_bridge_interface($iface) && $iface == $if) echo "selected"; ?>>
+ <option value="<?=$iface;?>" <?php if (!link_interface_to_bridge($iface) && $iface == $if) echo "selected"; ?>>
<?=htmlspecialchars($ifacename);?>
</option>
<?php endforeach; ?>
diff --git a/usr/local/www/services_wol_edit.php b/usr/local/www/services_wol_edit.php
index de3d271..de0b3cd 100755
--- a/usr/local/www/services_wol_edit.php
+++ b/usr/local/www/services_wol_edit.php
@@ -117,7 +117,7 @@ include("head.inc");
<?php
$interfaces = get_configured_interface_with_descr();
foreach ($interfaces as $iface => $ifacename): ?>
- <option value="<?=$iface;?>" <?php if (!link_int_to_bridge_interface($iface) && $iface == $pconfig['interface']) echo "selected"; ?>>
+ <option value="<?=$iface;?>" <?php if (!link_interface_to_bridge($iface) && $iface == $pconfig['interface']) echo "selected"; ?>>
<?=htmlspecialchars($ifacename);?>
</option>
<?php endforeach; ?>
diff --git a/usr/local/www/status_services.php b/usr/local/www/status_services.php
index 27b40ef..dff0f05 100755
--- a/usr/local/www/status_services.php
+++ b/usr/local/www/status_services.php
@@ -235,7 +235,7 @@ $iflist = array();
$ifdescrs = get_configured_interface_list();
foreach ($ifdescrs as $if) {
$oc = $config['interfaces'][$if];
- if ($oc['if'] && (!link_int_to_bridge_interface($if)))
+ if ($oc['if'] && (!link_interface_to_bridge($if)))
$iflist[$if] = $if;
}
$show_dhcprelay = false;
diff --git a/usr/local/www/widgets/widgets/services_status.widget.php b/usr/local/www/widgets/widgets/services_status.widget.php
index 79f890a..4d310cb 100644
--- a/usr/local/www/widgets/widgets/services_status.widget.php
+++ b/usr/local/www/widgets/widgets/services_status.widget.php
@@ -73,7 +73,7 @@ $iflist = array("lan" => "LAN");
$ifdescrs = get_configured_interface_list(true);
foreach ($ifdescrs as $if) {
$oc = $config['interfaces'][$if];
- if ($oc['if'] && (!link_int_to_bridge_interface($if)))
+ if ($oc['if'] && (!link_interface_to_bridge($if)))
$iflist[$if] = $if;
}
$show_dhcprelay = false;
OpenPOWER on IntegriCloud