diff options
author | Martin Willi <martin@strongswan.org> | 2006-04-04 12:45:29 +0000 |
---|---|---|
committer | Martin Willi <martin@strongswan.org> | 2006-04-04 12:45:29 +0000 |
commit | f2ee13a7e844c5b107137ca21136684c610f2864 (patch) | |
tree | f90e948f8ad1f356c1d326ba8c302aace5cb6e98 /Source/charon/sa/ike_sa.c | |
parent | efadbf79e9c864578bfd1277d824e69b2989aac5 (diff) | |
download | strongswan-f2ee13a7e844c5b107137ca21136684c610f2864.tar.bz2 strongswan-f2ee13a7e844c5b107137ca21136684c610f2864.tar.xz |
- improved strokeing
- down connection
- status
- some other tweaks
Diffstat (limited to 'Source/charon/sa/ike_sa.c')
-rw-r--r-- | Source/charon/sa/ike_sa.c | 28 |
1 files changed, 26 insertions, 2 deletions
diff --git a/Source/charon/sa/ike_sa.c b/Source/charon/sa/ike_sa.c index cbdd22a84..89f3fff29 100644 --- a/Source/charon/sa/ike_sa.c +++ b/Source/charon/sa/ike_sa.c @@ -288,7 +288,7 @@ static status_t initiate_connection(private_ike_sa_t *this, connection_t *connec initiator_init_t *current_state; /* Work is done in state object of type INITIATOR_INIT. All other states are not - * initial states and so don't have a initialize_connection function */ + * initial states and so don't have a initiate_connection function */ if (this->current_state->get_state(this->current_state) != INITIATOR_INIT) { @@ -350,7 +350,7 @@ static void send_delete_ike_sa_request (private_ike_sa_t *this) } /** - * Implementation of protected_ike_sa_t.get_id. + * Implementation of ike_sa_t.get_id. */ static ike_sa_id_t* get_id(private_ike_sa_t *this) { @@ -358,6 +358,22 @@ static ike_sa_id_t* get_id(private_ike_sa_t *this) } /** + * Implementation of ike_sa_t.get_my_host. + */ +static host_t* get_my_host(private_ike_sa_t *this) +{ + return this->connection->get_my_host(this->connection);; +} + +/** + * Implementation of ike_sa_t.get_other_host. + */ +static host_t* get_other_host(private_ike_sa_t *this) +{ + return this->connection->get_other_host(this->connection);; +} + +/** * Implementation of private_ike_sa_t.resend_last_reply. */ static status_t resend_last_reply(private_ike_sa_t *this) @@ -998,6 +1014,12 @@ static void destroy (private_ike_sa_t *this) } if (this->connection) { + host_t *me, *other; + me = this->connection->get_my_host(this->connection); + other = this->connection->get_other_host(this->connection); + + this->logger->log(this->logger, AUDIT, "IKE_SA deleted between %s - %s", + me->get_address(me), other->get_address(other)); this->connection->destroy(this->connection); } if (this->policy) @@ -1030,6 +1052,8 @@ ike_sa_t * ike_sa_create(ike_sa_id_t *ike_sa_id) this->protected.public.process_message = (status_t(*)(ike_sa_t*, message_t*)) process_message; this->protected.public.initiate_connection = (status_t(*)(ike_sa_t*,connection_t*)) initiate_connection; this->protected.public.get_id = (ike_sa_id_t*(*)(ike_sa_t*)) get_id; + this->protected.public.get_my_host = (host_t*(*)(ike_sa_t*)) get_my_host; + this->protected.public.get_other_host = (host_t*(*)(ike_sa_t*)) get_other_host; this->protected.public.retransmit_request = (status_t (*) (ike_sa_t *, u_int32_t)) retransmit_request; this->protected.public.get_state = (ike_sa_state_t (*) (ike_sa_t *this)) get_state; this->protected.public.send_delete_ike_sa_request = (void (*)(ike_sa_t*)) send_delete_ike_sa_request; |