diff options
author | Seth Mos <seth.mos@dds.nl> | 2010-11-15 12:46:58 +0100 |
---|---|---|
committer | Seth Mos <seth.mos@dds.nl> | 2010-11-15 12:46:58 +0100 |
commit | 172007f50c215acf458340773a32052c28556aaa (patch) | |
tree | 02fa2faa661d7ee1e431201c99da0c1cc1dea43c /etc/inc/util.inc | |
parent | 4f3768154fc8e1cf705e1c5342aef89d3a32aefc (diff) | |
parent | 64ec1ddf3503679cdf866e37ca9e99ec9974dc6b (diff) | |
download | pfsense-172007f50c215acf458340773a32052c28556aaa.zip pfsense-172007f50c215acf458340773a32052c28556aaa.tar.gz |
Merge remote branch 'upstream/master'
Conflicts:
etc/inc/filter.inc
etc/inc/system.inc
usr/local/www/interfaces.php
usr/local/www/interfaces_gif_edit.php
Diffstat (limited to 'etc/inc/util.inc')
-rw-r--r-- | etc/inc/util.inc | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/etc/inc/util.inc b/etc/inc/util.inc index 0b14b97..718a22b 100644 --- a/etc/inc/util.inc +++ b/etc/inc/util.inc @@ -633,6 +633,22 @@ function get_configured_ip_aliases_list() { } +/* comparison function for sorting by the order in which interfaces are normally created */ +function compare_interface_friendly_names($a, $b) { + if ($a == $b) + return 0; + else if ($a == 'wan') + return -1; + else if ($b == 'wan') + return 1; + else if ($a == 'lan') + return -1; + else if ($b == 'lan') + return 1; + + return strnatcmp($a, $b); +} + /* return the configured interfaces list. */ function get_configured_interface_list($only_opt = false, $withdisabled = false) { global $config; @@ -691,6 +707,21 @@ function get_configured_interface_with_descr($only_opt = false, $withdisabled = return $iflist; } +/* + * get_configured_ip_addresses() - Return a list of all configured + * interfaces IP Addresses + * + */ +function get_configured_ip_addresses() { + require_once("interfaces.inc"); + $ip_array = array(); + $interfaces = get_configured_interface_list(); + foreach($interfaces as $int) { + $ipaddr = get_interface_ip($int); + $ip_array[$int] = $ipaddr; + } + return $ip_array; +} /* * get_interface_list() - Return a list of all physical interfaces |