consistent logging of IKE and CHILD SAs

This commit is contained in:
Andreas Steffen
2008-07-21 12:47:59 +00:00
parent 0a625fde3e
commit fb34475b5c
5 changed files with 42 additions and 26 deletions
+14 -5
View File
@@ -590,7 +590,8 @@ static status_t build_i(private_child_create_t *this, message_t *message)
break;
}
SIG_CHD(UP_START, NULL, "establishing CHILD_SA");
SIG_CHD(UP_START, NULL, "establishing CHILD_SA '%s'",
this->config->get_name(this->config));
/* reuse virtual IP if we already have one */
me = this->ike_sa->get_virtual_ip(this->ike_sa, TRUE);
@@ -861,8 +862,12 @@ static status_t build_r(private_child_create_t *this, message_t *message)
build_payloads(this, message);
SIG_CHD(UP_SUCCESS, this->child_sa, "CHILD_SA '%s' established successfully",
this->child_sa->get_name(this->child_sa));
SIG_CHD(UP_SUCCESS, this->child_sa, "CHILD_SA '%s{%d}' established "
"with ts %#R=== %#R",
this->child_sa->get_name(this->child_sa),
this->child_sa->get_reqid(this->child_sa),
this->child_sa->get_traffic_selectors(this->child_sa, TRUE),
this->child_sa->get_traffic_selectors(this->child_sa, FALSE));
return SUCCESS;
}
@@ -969,8 +974,12 @@ static status_t process_i(private_child_create_t *this, message_t *message)
if (select_and_install(this, no_dh) == SUCCESS)
{
SIG_CHD(UP_SUCCESS, this->child_sa, "CHILD_SA '%s' established "
"successfully", this->child_sa->get_name(this->child_sa));
SIG_CHD(UP_SUCCESS, this->child_sa, "CHILD_SA '%s{%d}' established "
"with ts %#R=== %#R",
this->child_sa->get_name(this->child_sa),
this->child_sa->get_reqid(this->child_sa),
this->child_sa->get_traffic_selectors(this->child_sa, TRUE),
this->child_sa->get_traffic_selectors(this->child_sa, FALSE));
}
else
{
+6 -3
View File
@@ -207,9 +207,12 @@ static void log_children(private_child_delete_t *this)
iterator = this->child_sas->create_iterator(this->child_sas, TRUE);
while (iterator->iterate(iterator, (void**)&child_sa))
{
SIG_CHD(DOWN_START, child_sa, "closing CHILD_SA %#R=== %#R",
child_sa->get_traffic_selectors(child_sa, TRUE),
child_sa->get_traffic_selectors(child_sa, FALSE));
SIG_CHD(DOWN_START, child_sa, "closing CHILD_SA '%s{%d}' "
"with ts %#R=== %#R",
child_sa->get_name(child_sa),
child_sa->get_reqid(child_sa),
child_sa->get_traffic_selectors(child_sa, TRUE),
child_sa->get_traffic_selectors(child_sa, FALSE));
}
iterator->destroy(iterator);
}
+16 -12
View File
@@ -377,12 +377,13 @@ static status_t build_auth_eap(private_ike_auth_t *this, message_t *message)
if (!this->initiator)
{
this->ike_sa->set_state(this->ike_sa, IKE_ESTABLISHED);
SIG_IKE(UP_SUCCESS, "IKE_SA '%s' established between %H[%D]...[%D]%H",
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_unique_id(this->ike_sa),
this->ike_sa->get_my_host(this->ike_sa),
this->ike_sa->get_my_id(this->ike_sa),
this->ike_sa->get_other_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->get_other_id(this->ike_sa));
return SUCCESS;
}
return NEED_MORE;
@@ -423,12 +424,13 @@ static status_t process_auth_eap(private_ike_auth_t *this, message_t *message)
if (this->initiator)
{
this->ike_sa->set_state(this->ike_sa, IKE_ESTABLISHED);
SIG_IKE(UP_SUCCESS, "IKE_SA '%s' established between %H[%D]...[%D]%H",
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_unique_id(this->ike_sa),
this->ike_sa->get_my_host(this->ike_sa),
this->ike_sa->get_my_id(this->ike_sa),
this->ike_sa->get_other_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->get_other_id(this->ike_sa));
return SUCCESS;
}
return NEED_MORE;
@@ -649,12 +651,13 @@ static status_t build_r(private_ike_auth_t *this, message_t *message)
if (this->peer_authenticated)
{
this->ike_sa->set_state(this->ike_sa, IKE_ESTABLISHED);
SIG_IKE(UP_SUCCESS, "IKE_SA '%s' established between %H[%D]...[%D]%H",
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_unique_id(this->ike_sa),
this->ike_sa->get_my_host(this->ike_sa),
this->ike_sa->get_my_id(this->ike_sa),
this->ike_sa->get_other_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->get_other_id(this->ike_sa));
return SUCCESS;
}
@@ -762,12 +765,13 @@ static status_t process_i(private_ike_auth_t *this, message_t *message)
return FAILED;
}
this->ike_sa->set_state(this->ike_sa, IKE_ESTABLISHED);
SIG_IKE(UP_SUCCESS, "IKE_SA '%s' established between %H[%D]...[%D]%H",
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_unique_id(this->ike_sa),
this->ike_sa->get_my_host(this->ike_sa),
this->ike_sa->get_my_id(this->ike_sa),
this->ike_sa->get_other_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->get_other_id(this->ike_sa));
return SUCCESS;
}