summaryrefslogtreecommitdiffstats
path: root/etc/inc/util.inc
diff options
context:
space:
mode:
authorErmal Luçi <eri@pfsense.org>2009-03-26 01:19:12 +0000
committerErmal Luçi <eri@pfsense.org>2009-03-26 01:19:32 +0000
commitbb34737fbae53d57bd0bbcfc846bb09330e8e985 (patch)
treefd002986974e85ba6628d12073453bb76ea39d54 /etc/inc/util.inc
parent89ee8c555983aaa54318ce6d888224119b79f977 (diff)
downloadpfsense-bb34737fbae53d57bd0bbcfc846bb09330e8e985.zip
pfsense-bb34737fbae53d57bd0bbcfc846bb09330e8e985.tar.gz
Add function which returns the list of interfaces by realif index.
Diffstat (limited to 'etc/inc/util.inc')
-rw-r--r--etc/inc/util.inc33
1 files changed, 33 insertions, 0 deletions
diff --git a/etc/inc/util.inc b/etc/inc/util.inc
index c7f0293..7c31ca5 100644
--- a/etc/inc/util.inc
+++ b/etc/inc/util.inc
@@ -301,6 +301,39 @@ function get_configured_interface_list($only_opt = false, $withdisabled = false)
return $iflist;
}
+/* return the configured interfaces list. */
+function get_configured_interface_list_by_realif($only_opt = false, $withdisabled = false) {
+ global $config;
+
+ $iflist = array();
+
+ if (!$only_opt) {
+ if (isset($config['interfaces']['wan'])) {
+ $tmpif = get_real_interface("wan");
+ if (!empty($tmpif))
+ $iflist[$tmpif] = "wan";
+ }
+ if (isset($config['interfaces']['lan'])) {
+ $tmpif = get_real_interface("lan");
+ if (!empty($tmpif))
+ $iflist[$tmpif] = "lan";
+ }
+ }
+
+ /* if list */
+ foreach($config['interfaces'] as $if => $ifdetail) {
+ if ($if == "wan" || $if == "lan")
+ continue;
+ if (isset($ifdetail['enable']) || $withdisabled == true) {
+ $tmpif = get_real_interface($if);
+ if (!empty($tmpif))
+ $iflist[$tmpif] = $if;
+ }
+ }
+
+ return $iflist;
+}
+
/* return the configured interfaces list with their description. */
function get_configured_interface_with_descr($only_opt = false, $withdisabled = false) {
global $config;
OpenPOWER on IntegriCloud