summaryrefslogtreecommitdiffstats
path: root/etc
diff options
context:
space:
mode:
authorSeth Mos <seth.mos@xs4all.nl>2007-10-19 20:02:42 +0000
committerSeth Mos <seth.mos@xs4all.nl>2007-10-19 20:02:42 +0000
commit402a813bd85306fa7d5e3e09449403abc679085b (patch)
tree26a191b2f051e041b6c8ff2bab5d5a6f72d0c52a /etc
parentec3cedf7aa00d928589dd00c81831026640c86aa (diff)
downloadpfsense-402a813bd85306fa7d5e3e09449403abc679085b.zip
pfsense-402a813bd85306fa7d5e3e09449403abc679085b.tar.gz
Commit function that looks up the gateway ip by name from the Gateways array
Diffstat (limited to 'etc')
-rw-r--r--etc/inc/pfsense-utils.inc15
1 files changed, 15 insertions, 0 deletions
diff --git a/etc/inc/pfsense-utils.inc b/etc/inc/pfsense-utils.inc
index 012a9b1..7b979c4 100644
--- a/etc/inc/pfsense-utils.inc
+++ b/etc/inc/pfsense-utils.inc
@@ -3769,4 +3769,19 @@ function pfsense_default_state_size() {
return $max_states;
}
+function lookup_gateway_ip_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($gatewayip);
+ }
+ }
+ } else {
+ return(false);
+ }
+}
+
?>
OpenPOWER on IntegriCloud