diff options
author | Martin Willi <martin@revosec.ch> | 2012-08-31 12:55:56 +0200 |
---|---|---|
committer | Martin Willi <martin@revosec.ch> | 2012-08-31 12:55:56 +0200 |
commit | 1323dc1138246a6e2819bcc20b167b75d52e6d7c (patch) | |
tree | 5081fcc1d015a8cd0ec6dfe39a8df14f12d86ac5 /src/libcharon/sa/ikev1/phase1.c | |
parent | 868409139b00f24607baab2d81b873cb1a5a9e5b (diff) | |
parent | 69e056a2c13ac7da9ed4e48f846d642aa01a362b (diff) | |
download | strongswan-1323dc1138246a6e2819bcc20b167b75d52e6d7c.tar.bz2 strongswan-1323dc1138246a6e2819bcc20b167b75d52e6d7c.tar.xz |
Merge branch 'multi-vip'
Brings support for multiple virtual IPs and multiple pools in
left/rigthsourceip definitions. Also introduces the new left/rightdns
options to configure requested DNS server address family and respond
with multiple connection specific servers.
Diffstat (limited to 'src/libcharon/sa/ikev1/phase1.c')
-rw-r--r-- | src/libcharon/sa/ikev1/phase1.c | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/src/libcharon/sa/ikev1/phase1.c b/src/libcharon/sa/ikev1/phase1.c index e5a48ec49..4096141ec 100644 --- a/src/libcharon/sa/ikev1/phase1.c +++ b/src/libcharon/sa/ikev1/phase1.c @@ -609,6 +609,34 @@ METHOD(phase1_t, get_id, identification_t*, return id; } +METHOD(phase1_t, has_virtual_ip, bool, + private_phase1_t *this, peer_cfg_t *peer_cfg) +{ + enumerator_t *enumerator; + bool found = FALSE; + host_t *host; + + enumerator = peer_cfg->create_virtual_ip_enumerator(peer_cfg); + found = enumerator->enumerate(enumerator, &host); + enumerator->destroy(enumerator); + + return found; +} + +METHOD(phase1_t, has_pool, bool, + private_phase1_t *this, peer_cfg_t *peer_cfg) +{ + enumerator_t *enumerator; + bool found = FALSE; + char *pool; + + enumerator = peer_cfg->create_pool_enumerator(peer_cfg); + found = enumerator->enumerate(enumerator, &pool); + enumerator->destroy(enumerator); + + return found; +} + METHOD(phase1_t, save_sa_payload, bool, private_phase1_t *this, message_t *message) { @@ -748,6 +776,8 @@ phase1_t *phase1_create(ike_sa_t *ike_sa, bool initiator) .get_auth_method = _get_auth_method, .get_id = _get_id, .select_config = _select_config, + .has_virtual_ip = _has_virtual_ip, + .has_pool = _has_pool, .verify_auth = _verify_auth, .build_auth = _build_auth, .save_sa_payload = _save_sa_payload, |