diff options
author | Seth Mos <seth.mos@xs4all.nl> | 2007-10-19 21:17:28 +0000 |
---|---|---|
committer | Seth Mos <seth.mos@xs4all.nl> | 2007-10-19 21:17:28 +0000 |
commit | 4fca7c110018a470e6ca1fb968f202eb3ab54891 (patch) | |
tree | 5cfb6789cdbf6c5f496f70c4c7fb19a3cec4195b | |
parent | 674d0fc1db46e5caa20e4503b60cf5e30d752371 (diff) | |
download | pfsense-4fca7c110018a470e6ca1fb968f202eb3ab54891.zip pfsense-4fca7c110018a470e6ca1fb968f202eb3ab54891.tar.gz |
Add function that returns the interface which belongs with the gateway
-rw-r--r-- | etc/inc/pfsense-utils.inc | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/etc/inc/pfsense-utils.inc b/etc/inc/pfsense-utils.inc index 7b979c4..31d9cd1 100644 --- a/etc/inc/pfsense-utils.inc +++ b/etc/inc/pfsense-utils.inc @@ -3784,4 +3784,19 @@ function lookup_gateway_ip_by_name($name) { } } +function lookup_gateway_interface_by_name($name) { + global $config; + if(is_array($config['gateways'])) { + foreach($config['gateways']['gateway_item'] as $gateway) { + if($gateway['name'] == "$name") { + $gatewayip = $gateway['gateway']; + $interfacegw = $gateway['interface']; + return($interfacegw); + } + } + } else { + return(false); + } +} + ?> |