some more changes to IKE_SA and CHILD_SA logging
This commit is contained in:
@@ -645,8 +645,8 @@ static ike_sa_state_t get_state(private_ike_sa_t *this)
|
|||||||
*/
|
*/
|
||||||
static void set_state(private_ike_sa_t *this, ike_sa_state_t state)
|
static void set_state(private_ike_sa_t *this, ike_sa_state_t state)
|
||||||
{
|
{
|
||||||
DBG1(DBG_IKE, "IKE_SA '%s' state change: %N => %N",
|
DBG1(DBG_IKE, "IKE_SA %s[%d] state change: %N => %N",
|
||||||
get_name(this),
|
get_name(this), this->unique_id,
|
||||||
ike_sa_state_names, this->state,
|
ike_sa_state_names, this->state,
|
||||||
ike_sa_state_names, state);
|
ike_sa_state_names, state);
|
||||||
|
|
||||||
@@ -2037,7 +2037,7 @@ static status_t reestablish(private_ike_sa_t *this)
|
|||||||
switch (action)
|
switch (action)
|
||||||
{
|
{
|
||||||
case ACTION_RESTART:
|
case ACTION_RESTART:
|
||||||
DBG1(DBG_IKE, "restarting CHILD_SA '%s'",
|
DBG1(DBG_IKE, "restarting CHILD_SA %s",
|
||||||
child_cfg->get_name(child_cfg));
|
child_cfg->get_name(child_cfg));
|
||||||
child_cfg->get_ref(child_cfg);
|
child_cfg->get_ref(child_cfg);
|
||||||
status = new->initiate(new, child_cfg);
|
status = new->initiate(new, child_cfg);
|
||||||
|
|||||||
@@ -590,8 +590,16 @@ static status_t build_i(private_child_create_t *this, message_t *message)
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
SIG_CHD(UP_START, NULL, "establishing CHILD_SA '%s'",
|
if (this->reqid)
|
||||||
this->config->get_name(this->config));
|
{
|
||||||
|
SIG_CHD(UP_START, NULL, "establishing CHILD_SA %s{%d}",
|
||||||
|
this->config->get_name(this->config), this->reqid);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
SIG_CHD(UP_START, NULL, "establishing CHILD_SA %s{?}",
|
||||||
|
this->config->get_name(this->config));
|
||||||
|
}
|
||||||
|
|
||||||
/* reuse virtual IP if we already have one */
|
/* reuse virtual IP if we already have one */
|
||||||
me = this->ike_sa->get_virtual_ip(this->ike_sa, TRUE);
|
me = this->ike_sa->get_virtual_ip(this->ike_sa, TRUE);
|
||||||
@@ -862,10 +870,12 @@ static status_t build_r(private_child_create_t *this, message_t *message)
|
|||||||
|
|
||||||
build_payloads(this, message);
|
build_payloads(this, message);
|
||||||
|
|
||||||
SIG_CHD(UP_SUCCESS, this->child_sa, "CHILD_SA '%s{%d}' established "
|
SIG_CHD(UP_SUCCESS, this->child_sa, "CHILD_SA %s{%d} established "
|
||||||
"with ts %#R=== %#R",
|
"with SPIs %.8x_i %.8x_o and TS %#R=== %#R",
|
||||||
this->child_sa->get_name(this->child_sa),
|
this->child_sa->get_name(this->child_sa),
|
||||||
this->child_sa->get_reqid(this->child_sa),
|
this->child_sa->get_reqid(this->child_sa),
|
||||||
|
ntohl(this->child_sa->get_spi(this->child_sa, TRUE)),
|
||||||
|
ntohl(this->child_sa->get_spi(this->child_sa, FALSE)),
|
||||||
this->child_sa->get_traffic_selectors(this->child_sa, TRUE),
|
this->child_sa->get_traffic_selectors(this->child_sa, TRUE),
|
||||||
this->child_sa->get_traffic_selectors(this->child_sa, FALSE));
|
this->child_sa->get_traffic_selectors(this->child_sa, FALSE));
|
||||||
|
|
||||||
@@ -974,10 +984,12 @@ static status_t process_i(private_child_create_t *this, message_t *message)
|
|||||||
|
|
||||||
if (select_and_install(this, no_dh) == SUCCESS)
|
if (select_and_install(this, no_dh) == SUCCESS)
|
||||||
{
|
{
|
||||||
SIG_CHD(UP_SUCCESS, this->child_sa, "CHILD_SA '%s{%d}' established "
|
SIG_CHD(UP_SUCCESS, this->child_sa, "CHILD_SA %s{%d} established "
|
||||||
"with ts %#R=== %#R",
|
"with SPIs %.8x_i %.8x_o and TS %#R=== %#R",
|
||||||
this->child_sa->get_name(this->child_sa),
|
this->child_sa->get_name(this->child_sa),
|
||||||
this->child_sa->get_reqid(this->child_sa),
|
this->child_sa->get_reqid(this->child_sa),
|
||||||
|
ntohl(this->child_sa->get_spi(this->child_sa, TRUE)),
|
||||||
|
ntohl(this->child_sa->get_spi(this->child_sa, FALSE)),
|
||||||
this->child_sa->get_traffic_selectors(this->child_sa, TRUE),
|
this->child_sa->get_traffic_selectors(this->child_sa, TRUE),
|
||||||
this->child_sa->get_traffic_selectors(this->child_sa, FALSE));
|
this->child_sa->get_traffic_selectors(this->child_sa, FALSE));
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -54,16 +54,17 @@ struct private_child_delete_t {
|
|||||||
*/
|
*/
|
||||||
static void build_payloads(private_child_delete_t *this, message_t *message)
|
static void build_payloads(private_child_delete_t *this, message_t *message)
|
||||||
{
|
{
|
||||||
iterator_t *iterator;
|
|
||||||
delete_payload_t *ah = NULL, *esp = NULL;
|
delete_payload_t *ah = NULL, *esp = NULL;
|
||||||
u_int32_t spi;
|
iterator_t *iterator;
|
||||||
child_sa_t *child_sa;
|
child_sa_t *child_sa;
|
||||||
|
|
||||||
iterator = this->child_sas->create_iterator(this->child_sas, TRUE);
|
iterator = this->child_sas->create_iterator(this->child_sas, TRUE);
|
||||||
while (iterator->iterate(iterator, (void**)&child_sa))
|
while (iterator->iterate(iterator, (void**)&child_sa))
|
||||||
{
|
{
|
||||||
spi = child_sa->get_spi(child_sa, TRUE);
|
protocol_id_t protocol = child_sa->get_protocol(child_sa);
|
||||||
switch (child_sa->get_protocol(child_sa))
|
u_int32_t spi = child_sa->get_spi(child_sa, TRUE);
|
||||||
|
|
||||||
|
switch (protocol)
|
||||||
{
|
{
|
||||||
case PROTO_ESP:
|
case PROTO_ESP:
|
||||||
if (esp == NULL)
|
if (esp == NULL)
|
||||||
@@ -72,6 +73,8 @@ static void build_payloads(private_child_delete_t *this, message_t *message)
|
|||||||
message->add_payload(message, (payload_t*)esp);
|
message->add_payload(message, (payload_t*)esp);
|
||||||
}
|
}
|
||||||
esp->add_spi(esp, spi);
|
esp->add_spi(esp, spi);
|
||||||
|
DBG1(DBG_IKE, "sending DELETE for %N CHILD_SA with SPI %.8x",
|
||||||
|
protocol_id_names, protocol, ntohl(spi));
|
||||||
break;
|
break;
|
||||||
case PROTO_AH:
|
case PROTO_AH:
|
||||||
if (ah == NULL)
|
if (ah == NULL)
|
||||||
@@ -80,6 +83,8 @@ static void build_payloads(private_child_delete_t *this, message_t *message)
|
|||||||
message->add_payload(message, (payload_t*)ah);
|
message->add_payload(message, (payload_t*)ah);
|
||||||
}
|
}
|
||||||
ah->add_spi(ah, spi);
|
ah->add_spi(ah, spi);
|
||||||
|
DBG1(DBG_IKE, "sending DELETE for %N CHILD_SA with SPI %.8x",
|
||||||
|
protocol_id_names, protocol, ntohl(spi));
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
@@ -207,10 +212,12 @@ static void log_children(private_child_delete_t *this)
|
|||||||
iterator = this->child_sas->create_iterator(this->child_sas, TRUE);
|
iterator = this->child_sas->create_iterator(this->child_sas, TRUE);
|
||||||
while (iterator->iterate(iterator, (void**)&child_sa))
|
while (iterator->iterate(iterator, (void**)&child_sa))
|
||||||
{
|
{
|
||||||
SIG_CHD(DOWN_START, child_sa, "closing CHILD_SA '%s{%d}' "
|
SIG_CHD(DOWN_START, child_sa, "closing CHILD_SA %s{%d} "
|
||||||
"with ts %#R=== %#R",
|
"with SPIs %.8x_i %.8x_o and TS %#R=== %#R",
|
||||||
child_sa->get_name(child_sa),
|
child_sa->get_name(child_sa),
|
||||||
child_sa->get_reqid(child_sa),
|
child_sa->get_reqid(child_sa),
|
||||||
|
ntohl(child_sa->get_spi(child_sa, TRUE)),
|
||||||
|
ntohl(child_sa->get_spi(child_sa, FALSE)),
|
||||||
child_sa->get_traffic_selectors(child_sa, TRUE),
|
child_sa->get_traffic_selectors(child_sa, TRUE),
|
||||||
child_sa->get_traffic_selectors(child_sa, FALSE));
|
child_sa->get_traffic_selectors(child_sa, FALSE));
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -377,7 +377,7 @@ static status_t build_auth_eap(private_ike_auth_t *this, message_t *message)
|
|||||||
if (!this->initiator)
|
if (!this->initiator)
|
||||||
{
|
{
|
||||||
this->ike_sa->set_state(this->ike_sa, IKE_ESTABLISHED);
|
this->ike_sa->set_state(this->ike_sa, IKE_ESTABLISHED);
|
||||||
SIG_IKE(UP_SUCCESS, "IKE_SA '%s[%d]' established between %H[%D]...%H[%D]",
|
SIG_IKE(UP_SUCCESS, "IKE_SA %s[%d] established between %H[%D]...%H[%D]",
|
||||||
this->ike_sa->get_name(this->ike_sa),
|
this->ike_sa->get_name(this->ike_sa),
|
||||||
this->ike_sa->get_unique_id(this->ike_sa),
|
this->ike_sa->get_unique_id(this->ike_sa),
|
||||||
this->ike_sa->get_my_host(this->ike_sa),
|
this->ike_sa->get_my_host(this->ike_sa),
|
||||||
@@ -424,7 +424,7 @@ static status_t process_auth_eap(private_ike_auth_t *this, message_t *message)
|
|||||||
if (this->initiator)
|
if (this->initiator)
|
||||||
{
|
{
|
||||||
this->ike_sa->set_state(this->ike_sa, IKE_ESTABLISHED);
|
this->ike_sa->set_state(this->ike_sa, IKE_ESTABLISHED);
|
||||||
SIG_IKE(UP_SUCCESS, "IKE_SA '%s[%d]' established between %H[%D]...%H[%D]",
|
SIG_IKE(UP_SUCCESS, "IKE_SA %s[%d] established between %H[%D]...%H[%D]",
|
||||||
this->ike_sa->get_name(this->ike_sa),
|
this->ike_sa->get_name(this->ike_sa),
|
||||||
this->ike_sa->get_unique_id(this->ike_sa),
|
this->ike_sa->get_unique_id(this->ike_sa),
|
||||||
this->ike_sa->get_my_host(this->ike_sa),
|
this->ike_sa->get_my_host(this->ike_sa),
|
||||||
@@ -651,7 +651,7 @@ static status_t build_r(private_ike_auth_t *this, message_t *message)
|
|||||||
if (this->peer_authenticated)
|
if (this->peer_authenticated)
|
||||||
{
|
{
|
||||||
this->ike_sa->set_state(this->ike_sa, IKE_ESTABLISHED);
|
this->ike_sa->set_state(this->ike_sa, IKE_ESTABLISHED);
|
||||||
SIG_IKE(UP_SUCCESS, "IKE_SA '%s[%d]' established between %H[%D]...%H[%D]",
|
SIG_IKE(UP_SUCCESS, "IKE_SA %s[%d] established between %H[%D]...%H[%D]",
|
||||||
this->ike_sa->get_name(this->ike_sa),
|
this->ike_sa->get_name(this->ike_sa),
|
||||||
this->ike_sa->get_unique_id(this->ike_sa),
|
this->ike_sa->get_unique_id(this->ike_sa),
|
||||||
this->ike_sa->get_my_host(this->ike_sa),
|
this->ike_sa->get_my_host(this->ike_sa),
|
||||||
@@ -765,7 +765,7 @@ static status_t process_i(private_ike_auth_t *this, message_t *message)
|
|||||||
return FAILED;
|
return FAILED;
|
||||||
}
|
}
|
||||||
this->ike_sa->set_state(this->ike_sa, IKE_ESTABLISHED);
|
this->ike_sa->set_state(this->ike_sa, IKE_ESTABLISHED);
|
||||||
SIG_IKE(UP_SUCCESS, "IKE_SA '%s[%d]' established between %H[%D]...%H[%D]",
|
SIG_IKE(UP_SUCCESS, "IKE_SA %s[%d] established between %H[%D]...%H[%D]",
|
||||||
this->ike_sa->get_name(this->ike_sa),
|
this->ike_sa->get_name(this->ike_sa),
|
||||||
this->ike_sa->get_unique_id(this->ike_sa),
|
this->ike_sa->get_unique_id(this->ike_sa),
|
||||||
this->ike_sa->get_my_host(this->ike_sa),
|
this->ike_sa->get_my_host(this->ike_sa),
|
||||||
|
|||||||
@@ -60,7 +60,9 @@ static status_t build_i(private_ike_delete_t *this, message_t *message)
|
|||||||
message->add_payload(message, (payload_t*)delete_payload);
|
message->add_payload(message, (payload_t*)delete_payload);
|
||||||
|
|
||||||
this->ike_sa->set_state(this->ike_sa, IKE_DELETING);
|
this->ike_sa->set_state(this->ike_sa, IKE_DELETING);
|
||||||
|
DBG1(DBG_IKE, "sending DELETE for IKE_SA %s[%d]",
|
||||||
|
this->ike_sa->get_name(this->ike_sa),
|
||||||
|
this->ike_sa->get_unique_id(this->ike_sa));
|
||||||
return NEED_MORE;
|
return NEED_MORE;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -83,7 +85,9 @@ static status_t process_r(private_ike_delete_t *this, message_t *message)
|
|||||||
switch (this->ike_sa->get_state(this->ike_sa))
|
switch (this->ike_sa->get_state(this->ike_sa))
|
||||||
{
|
{
|
||||||
case IKE_ESTABLISHED:
|
case IKE_ESTABLISHED:
|
||||||
DBG1(DBG_IKE, "deleting IKE_SA on request");
|
DBG1(DBG_IKE, "received DELETE for IKE_SA %s[%d]",
|
||||||
|
this->ike_sa->get_name(this->ike_sa),
|
||||||
|
this->ike_sa->get_unique_id(this->ike_sa));
|
||||||
this->ike_sa->set_state(this->ike_sa, IKE_DELETING);
|
this->ike_sa->set_state(this->ike_sa, IKE_DELETING);
|
||||||
this->ike_sa->reestablish(this->ike_sa);
|
this->ike_sa->reestablish(this->ike_sa);
|
||||||
break;
|
break;
|
||||||
|
|||||||
@@ -230,8 +230,9 @@ static status_t build_i(private_ike_init_t *this, message_t *message)
|
|||||||
rng_t *rng;
|
rng_t *rng;
|
||||||
|
|
||||||
this->config = this->ike_sa->get_ike_cfg(this->ike_sa);
|
this->config = this->ike_sa->get_ike_cfg(this->ike_sa);
|
||||||
SIG_IKE(UP_START, "initiating IKE_SA '%s' to %H",
|
SIG_IKE(UP_START, "initiating IKE_SA %s[%d] to %H",
|
||||||
this->ike_sa->get_name(this->ike_sa),
|
this->ike_sa->get_name(this->ike_sa),
|
||||||
|
this->ike_sa->get_unique_id(this->ike_sa),
|
||||||
this->ike_sa->get_other_host(this->ike_sa));
|
this->ike_sa->get_other_host(this->ike_sa));
|
||||||
this->ike_sa->set_state(this->ike_sa, IKE_CONNECTING);
|
this->ike_sa->set_state(this->ike_sa, IKE_CONNECTING);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user