From d799787e49e0a535acbc881b8e8944b860e25e47 Mon Sep 17 00:00:00 2001 From: Matthew Grooms Date: Tue, 26 Aug 2008 04:48:04 +0000 Subject: Rework most of the OpenVPN support. The interfaces have been updated to not use the pkg system and the configuration has been migrated to an openvpn prefix. The centralized user and certificate manager is now used to support the openvpn configurations. Most of the files removed in this commit were not being referenced. This commit also splits out the certificate management components into a new system menu item. --- etc/inc/ipsec.inc | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) (limited to 'etc/inc/ipsec.inc') diff --git a/etc/inc/ipsec.inc b/etc/inc/ipsec.inc index 76ea0f8..2328e24 100644 --- a/etc/inc/ipsec.inc +++ b/etc/inc/ipsec.inc @@ -88,6 +88,29 @@ $p2_pfskeygroups = array( '5' => '5'); /* + * ikeid management functions + */ + +function ipsec_ikeid_used($ikeid) { + global $config; + + foreach ($config['ipsec']['phase1'] as $ph1ent) + if( $ikeid == $ph1ent['ikeid'] ) + return true; + + return false; +} + +function ipsec_ikeid_next() { + + $ikeid = 1; + while(ipsec_ikeid_used($ikeid)) + $ikeid++; + + return $ikeid; +} + +/* * Return phase1 local address */ function ipsec_get_phase1_src(& $ph1ent) { -- cgit v1.1