diff options
author | Ermal Luçi <eri@pfsense.org> | 2008-06-18 20:46:03 +0000 |
---|---|---|
committer | Ermal Luçi <eri@pfsense.org> | 2008-06-18 20:46:03 +0000 |
commit | 42c9d20e91dd2dbdff6c00d034ba68121039f2a2 (patch) | |
tree | dabe6a205d21e2f2612f017c839d51ee0a327af5 | |
parent | 917d87a72ba59893364058b4d16f1264495cb145 (diff) | |
download | pfsense-42c9d20e91dd2dbdff6c00d034ba68121039f2a2.zip pfsense-42c9d20e91dd2dbdff6c00d034ba68121039f2a2.tar.gz |
Add option to return only the optional interface list, some code needs only that.
-rw-r--r-- | etc/inc/util.inc | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/etc/inc/util.inc b/etc/inc/util.inc index 8f29a3f..0bcceea 100644 --- a/etc/inc/util.inc +++ b/etc/inc/util.inc @@ -273,30 +273,36 @@ function is_valid_shaperbw($val) { } /* return the configured interfaces list. */ -function get_configured_interface_list() { +function get_configured_interface_list($only_opt = false) { global $config; $iflist = array(); /* if list */ - foreach($config['interfaces'] as $if => $ifdetail) + foreach($config['interfaces'] as $if => $ifdetail) { + if ($only_opt == true && $if == "wan" || $if == "lan") + continue; if ($if == "wan" || $if == "lan" || $ifdetail['enabled']) $iflist[$if] = $if; + } return $iflist; } /* return the configured interfaces list with their description. */ -function get_configured_interface_with_descr() { +function get_configured_interface_with_descr($only_opt = false) { global $config; $iflist = array(); /* if list */ - foreach($config['interfaces'] as $if => $ifdetail) + foreach($config['interfaces'] as $if => $ifdetail) { + if ($only_opt == true && $if == "wan" || $if == "lan") + continue; if ($if == "wan" || $if == "lan" || $ifdetail['enabled']) $iflist[$if] = $ifidetail['descr']; + } return $iflist; |