diff options
Diffstat (limited to 'etc/inc/util.inc')
-rw-r--r-- | etc/inc/util.inc | 64 |
1 files changed, 4 insertions, 60 deletions
diff --git a/etc/inc/util.inc b/etc/inc/util.inc index 4304801..c289d62 100644 --- a/etc/inc/util.inc +++ b/etc/inc/util.inc @@ -1,7 +1,9 @@ -<?php /* $Id$ */ /* +<?php +/* util.inc - part of m0n0wall (http://m0n0.ch/wall) + part of the pfSense project (http://www.pfsense.com) + originally part of m0n0wall (http://m0n0.ch/wall) Copyright (C) 2003-2004 Manuel Kasper <mk@neon1.net>. All rights reserved. @@ -648,34 +650,6 @@ function is_alias($name) { return isset($aliastable[$name]); } -function alias_expand_value($name) { - - global $aliastable, $config; - $newaddress = ""; - $firstentry = true; - if($config['aliases']['alias']) - foreach($config['aliases']['alias'] as $alias) { - if($alias['name'] == $name) { - if($alias['type'] == "openvpn") { - $vpn_address_split = split(" ", $alias['address']); - foreach($vpn_address_split as $vpnsplit) { - foreach($config['openvpn']['user'] as $openvpn) { - if($openvpn['name'] == $vpnsplit) { - if($firstentry == false) - $newaddress .= " "; - $newaddress .= $openvpn['ip']; - $firstentry = false; - } - } - } - } else { - $newaddress = $alias['address']; - } - } - } - return $newaddress; -} - /* expand a host or network alias, if necessary */ function alias_expand($name) { @@ -689,36 +663,6 @@ function alias_expand($name) { return null; } -/* expand a host alias, if necessary */ -function alias_expand_host($name) { - global $aliastable; - - if (isset($aliastable[$name])) { - $ip_arr = explode(" ", $aliastable[$name]); - foreach($ip_arr as $ip) { - if (!is_ipaddr($ip)) - return null; - } - return $aliastable[$name]; - } else if (is_ipaddr($name)) - return $name; - else - return null; -} - -/* expand a network alias, if necessary */ -function alias_expand_net($name) { - - global $aliastable; - - if (isset($aliastable[$name]) && is_subnet($aliastable[$name])) - return $aliastable[$name]; - else if (is_subnet($name)) - return $name; - else - return null; -} - /* find out whether two subnets overlap */ function check_subnets_overlap($subnet1, $bits1, $subnet2, $bits2) { |