summaryrefslogtreecommitdiffstats
path: root/etc/inc/ipsec.inc
diff options
context:
space:
mode:
authorErmal Luçi <eri@pfsense.org>2009-03-30 00:37:45 +0000
committerErmal Luçi <eri@pfsense.org>2009-03-30 00:38:36 +0000
commita55e9c701c2fc8914e0aebf12e37038f59b07cf8 (patch)
tree05b5a1bc85f8742706649429ec164f576d240975 /etc/inc/ipsec.inc
parentcc460ee980e427bf4acdb8a4903e3278df59ea94 (diff)
downloadpfsense-a55e9c701c2fc8914e0aebf12e37038f59b07cf8.zip
pfsense-a55e9c701c2fc8914e0aebf12e37038f59b07cf8.tar.gz
* Hide interfaces internals to other code and use the propper interfaces.
Basically use get_interface*() functions instead of accessing fields like 'ipaddr'/'descr' etc... * Make get_interfaces_with_gateway less heavyweight by getting information from the configuration stored in config.xml * Some other missed custom interface list building and substituing with propper get_configured_interface*() NOTE: This should give indipendce on dynamic interfaces on some services that before could not be used on top of this type of interfaces.
Diffstat (limited to 'etc/inc/ipsec.inc')
-rw-r--r--etc/inc/ipsec.inc10
1 files changed, 5 insertions, 5 deletions
diff --git a/etc/inc/ipsec.inc b/etc/inc/ipsec.inc
index 44853d6..3d0c120 100644
--- a/etc/inc/ipsec.inc
+++ b/etc/inc/ipsec.inc
@@ -162,9 +162,9 @@ function ipsec_idinfo_to_cidr(& $idinfo,$addrbits = false) {
return $idinfo['address']."/".$idinfo['netbits'];
case "mobile":
return "0.0.0.0/0";
- default:
- $address = $config['interfaces']['lan']['ipaddr'];
- $netbits = $config['interfaces'][$idinfo['type']]['subnet'];
+ default:
+ $address = get_interface_ip($idinfo['type']);
+ $netbits = get_interface_subnet($idinfo['type']);
$address = gen_subnet($address,$netbits);
return $address."/".$netbits;
}
@@ -188,8 +188,8 @@ function ipsec_idinfo_to_subnet(& $idinfo,$addrbits = false) {
case "mobile":
return "0.0.0.0/0";
default:
- $address = $config['interfaces']['lan']['ipaddr'];
- $netbits = $config['interfaces'][$idinfo['type']]['subnet'];
+ $address = get_interface_ip($idinfo['type']);
+ $netbits = get_interface_subnet($idinfo['type']);
$address = gen_subnet($address,$netbits);
$netbits = gen_subnet_mask($netbits);
return $address."/".netbits;
OpenPOWER on IntegriCloud