From 4fca7c110018a470e6ca1fb968f202eb3ab54891 Mon Sep 17 00:00:00 2001 From: Seth Mos Date: Fri, 19 Oct 2007 21:17:28 +0000 Subject: Add function that returns the interface which belongs with the gateway --- etc/inc/pfsense-utils.inc | 15 +++++++++++++++ 1 file changed, 15 insertions(+) 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); + } +} + ?> -- cgit v1.1