diff options
author | Ermal Luçi <eri@pfsense.org> | 2008-06-18 17:58:03 +0000 |
---|---|---|
committer | Ermal Luçi <eri@pfsense.org> | 2008-06-18 17:58:03 +0000 |
commit | c8abe1d44e4c8641abcde32d0a45d3d3add59b98 (patch) | |
tree | bf2d21386156df20a1c9d000d65356ad32bbc98c /etc/inc/util.inc | |
parent | 43b864430288fc316c73355058c983dc38ab19e4 (diff) | |
download | pfsense-c8abe1d44e4c8641abcde32d0a45d3d3add59b98.zip pfsense-c8abe1d44e4c8641abcde32d0a45d3d3add59b98.tar.gz |
Begin the work of correcting the interfaces mess all around the code.
Diffstat (limited to 'etc/inc/util.inc')
-rw-r--r-- | etc/inc/util.inc | 33 |
1 files changed, 32 insertions, 1 deletions
diff --git a/etc/inc/util.inc b/etc/inc/util.inc index 35d3600..8f29a3f 100644 --- a/etc/inc/util.inc +++ b/etc/inc/util.inc @@ -272,6 +272,37 @@ function is_valid_shaperbw($val) { return (preg_match("/^(\d+(?:\.\d+)?)([MKG]?b|%)$/", $val)); } +/* return the configured interfaces list. */ +function get_configured_interface_list() { + global $config; + + $iflist = array(); + + /* if list */ + foreach($config['interfaces'] as $if => $ifdetail) + 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() { + global $config; + + $iflist = array(); + + /* if list */ + foreach($config['interfaces'] as $if => $ifdetail) + if ($if == "wan" || $if == "lan" || $ifdetail['enabled']) + $iflist[$if] = $ifidetail['descr']; + + return $iflist; + +} + + /* * get_interface_list() - Return a list of all physical interfaces * along with MAC and status. @@ -616,4 +647,4 @@ function resolve_retry($hostname, $retries = 5) { return false; } -?>
\ No newline at end of file +?> |