From fff4ee8a85e3685268cf6fd372ff23494f52186c Mon Sep 17 00:00:00 2001 From: Andreas Steffen Date: Mon, 25 Sep 2006 05:58:45 +0000 Subject: [PATCH] added hostaccess support --- src/charon/sa/child_sa.c | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/src/charon/sa/child_sa.c b/src/charon/sa/child_sa.c index cccea2b4d..6b462c271 100644 --- a/src/charon/sa/child_sa.c +++ b/src/charon/sa/child_sa.c @@ -38,7 +38,7 @@ mapping_t child_sa_state_m[] = { {CHILD_INSTALLED, "INSTALLED"}, {CHILD_ROUTED, "ROUTED"}, {CHILD_REKEYING, "REKEYING"}, - {CHILD_DELETING, "DELETING"}, + {CHILD_DELETING, "DELETNG"}, {MAPPING_END, NULL} }; @@ -64,7 +64,7 @@ struct sa_policy_t { typedef struct private_child_sa_t private_child_sa_t; /** - * Private data of a child_sa_t object. + * Private data of a child_sa_t bject. */ struct private_child_sa_t { /** @@ -161,6 +161,11 @@ struct private_child_sa_t { */ char *script; + /** + * Allow host access + */ + bool hostaccess; + /** * Specifies if NAT traversal is used */ @@ -305,7 +310,7 @@ static void updown(private_child_sa_t *this, bool up) "PLUTO_PEER_CLIENT_MASK='%s' " "PLUTO_PEER_PORT='%u' " "PLUTO_PEER_PROTOCOL='%u' " - "PLUTO_HOST_ACCESS='1' " + "%s" "%s", up ? "up" : "down", streq(this->me.addr->get_string(this->me.addr), @@ -326,6 +331,7 @@ static void updown(private_child_sa_t *this, bool up) other_client, other_client_mask, policy->other_ts->get_from_port(policy->other_ts), policy->other_ts->get_protocol(policy->other_ts), + this->hostaccess? "PLUTO_HOST_ACCESS='1' " : "", this->script); free(ifname); free(my_client); @@ -1112,7 +1118,7 @@ static void destroy(private_child_sa_t *this) child_sa_t * child_sa_create(u_int32_t rekey, host_t *me, host_t* other, identification_t *my_id, identification_t *other_id, u_int32_t soft_lifetime, u_int32_t hard_lifetime, - char *script, bool use_natt) + char *script, bool hostaccess, bool use_natt) { static u_int32_t reqid = REQID_START; private_child_sa_t *this = malloc_thing(private_child_sa_t); @@ -1150,6 +1156,7 @@ child_sa_t * child_sa_create(u_int32_t rekey, host_t *me, host_t* other, this->alloc_ah_spi = 0; this->alloc_esp_spi = 0; this->script = script ? strdup(script) : NULL; + this->hostaccess = hostaccess; this->use_natt = use_natt; this->soft_lifetime = soft_lifetime; this->hard_lifetime = hard_lifetime;