summaryrefslogtreecommitdiffstats
path: root/etc
diff options
context:
space:
mode:
authorSeth Mos <seth.mos@xs4all.nl>2008-11-13 17:14:47 +0000
committerSeth Mos <seth.mos@xs4all.nl>2008-11-13 17:14:47 +0000
commit5b48d1299837790ce0a9b68586cc594256d69b17 (patch)
tree14a22dccedc6bb0098ecb2b5c2e3782517a9692c /etc
parent54d5e16f09a753d8f0c1c5fde4ab780b9f1aa9b4 (diff)
downloadpfsense-5b48d1299837790ce0a9b68586cc594256d69b17.zip
pfsense-5b48d1299837790ce0a9b68586cc594256d69b17.tar.gz
Include more information in the array including a attribute flag.
The attribute is either "system" or the gateway array id.
Diffstat (limited to 'etc')
-rw-r--r--etc/inc/gwlb.inc18
1 files changed, 9 insertions, 9 deletions
diff --git a/etc/inc/gwlb.inc b/etc/inc/gwlb.inc
index 2185307..ab27d8b 100644
--- a/etc/inc/gwlb.inc
+++ b/etc/inc/gwlb.inc
@@ -225,7 +225,7 @@ function return_gateways_array() {
foreach($iflist as $ifname => $if ) {
if(interface_has_gateway($ifname)) {
$gateway = array();
- $friendly = convert_real_interface_to_friendly_interface_name($friendly);
+ $friendly = convert_real_interface_to_friendly_interface_name($ifname);
$gateway['gateway'] = get_interface_gateway($ifname);
/* Loopback for dynamic interfaces without a IP */
if(!is_ipaddr($gateway['gateway'])) {
@@ -241,27 +241,27 @@ function return_gateways_array() {
$gateway['interface'] = $ifname;
$descr = convert_friendly_interface_to_friendly_descr($friendly);
- /* dynamic interfaces fetch the monitor IP from the Interface config section */
- if(is_ipaddr($config['interfaces'][$friendly]['monitorip'])) {
- $gateway['monitor'] = $config['interfaces'][$friendly]['monitorip'];
- } else {
- $gateway['monitor'] = $gateway['gateway'];
- }
+ /* FIXME: somehow retrieve a proper monitor IP? */
+ $gateway['monitor'] = $gateway['gateway'];
$gateway['name'] = "{$friendly}";
$gateway['descr'] = "Interface {$descr} Gateway";
- $gateway['modifier'] = "readonly";
+ $gateway['attribute'] = "system";
+ $gateway['interface'] = "$friendly";
$gateways_arr[] = $gateway;
}
}
/* tack on all the hard defined gateways as well */
if(is_array($config['gateways']['gateway_item'])) {
+ $i = 0;
foreach($config['gateways']['gateway_item'] as $gateway) {
if($gateway['monitor'] == "") {
$gateway['monitor'] = $gateway['gateway'];
}
- $gateway['modifier'] = "writeable";
+ /* include the gateway index as the attribute */
+ $gateway['attribute'] = "$i";
$gateways_arr[] = $gateway;
+ $i++;
}
}
return($gateways_arr);
OpenPOWER on IntegriCloud