aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndreas Steffen <andreas.steffen@strongswan.org>2008-07-21 12:47:59 +0000
committerAndreas Steffen <andreas.steffen@strongswan.org>2008-07-21 12:47:59 +0000
commitfb34475b5c175284b379e5616337ba0d42a25360 (patch)
tree95100dfa90a8e07c32eace9d92e6166da5602eb9
parent0a625fde3e38573f51807276bdee9f975d15b789 (diff)
downloadstrongswan-fb34475b5c175284b379e5616337ba0d42a25360.tar.bz2
strongswan-fb34475b5c175284b379e5616337ba0d42a25360.tar.xz
consistent logging of IKE and CHILD SAs
-rw-r--r--src/charon/kernel/kernel_interface.c6
-rw-r--r--src/charon/sa/ike_sa.c6
-rw-r--r--src/charon/sa/tasks/child_create.c19
-rw-r--r--src/charon/sa/tasks/child_delete.c9
-rw-r--r--src/charon/sa/tasks/ike_auth.c28
5 files changed, 42 insertions, 26 deletions
diff --git a/src/charon/kernel/kernel_interface.c b/src/charon/kernel/kernel_interface.c
index c403fb86b..ea25bd1c5 100644
--- a/src/charon/kernel/kernel_interface.c
+++ b/src/charon/kernel/kernel_interface.c
@@ -577,7 +577,7 @@ static void process_acquire(private_kernel_interface_t *this, struct nlmsghdr *h
return;
}
DBG2(DBG_KNL, "received a XFRM_MSG_ACQUIRE");
- DBG1(DBG_KNL, "creating acquire job for CHILD_SA with reqid %d", reqid);
+ DBG1(DBG_KNL, "creating acquire job for CHILD_SA with {reqid %d}", reqid);
job = (job_t*)acquire_job_create(reqid);
charon->processor->queue_job(charon->processor, job);
}
@@ -601,12 +601,12 @@ static void process_expire(private_kernel_interface_t *this, struct nlmsghdr *hd
if (protocol != PROTO_ESP && protocol != PROTO_AH)
{
- DBG2(DBG_KNL, "ignoring XFRM_MSG_EXPIRE for SA 0x%x (reqid %d) which is "
+ DBG2(DBG_KNL, "ignoring XFRM_MSG_EXPIRE for SA 0x%x {reqid %d} which is "
"not a CHILD_SA", ntohl(spi), reqid);
return;
}
- DBG1(DBG_KNL, "creating %s job for %N CHILD_SA 0x%x (reqid %d)",
+ DBG1(DBG_KNL, "creating %s job for %N CHILD_SA 0x%x {reqid %d}",
expire->hard ? "delete" : "rekey", protocol_id_names,
protocol, ntohl(spi), reqid);
if (expire->hard)
diff --git a/src/charon/sa/ike_sa.c b/src/charon/sa/ike_sa.c
index 04fb55829..21bb2f268 100644
--- a/src/charon/sa/ike_sa.c
+++ b/src/charon/sa/ike_sa.c
@@ -1176,7 +1176,7 @@ static status_t acquire(private_ike_sa_t *this, u_int32_t reqid)
if (this->state == IKE_DELETING)
{
SIG_CHD(UP_START, NULL, "acquiring CHILD_SA on kernel request");
- SIG_CHD(UP_FAILED, NULL, "acquiring CHILD_SA (reqid %d) failed: "
+ SIG_CHD(UP_FAILED, NULL, "acquiring CHILD_SA {reqid %d} failed: "
"IKE_SA is deleting", reqid);
return FAILED;
}
@@ -1195,7 +1195,7 @@ static status_t acquire(private_ike_sa_t *this, u_int32_t reqid)
if (!child_sa)
{
SIG_CHD(UP_START, NULL, "acquiring CHILD_SA on kernel request");
- SIG_CHD(UP_FAILED, NULL, "acquiring CHILD_SA (reqid %d) failed: "
+ SIG_CHD(UP_FAILED, NULL, "acquiring CHILD_SA {reqid %d} failed: "
"CHILD_SA not found", reqid);
return FAILED;
}
@@ -2037,7 +2037,7 @@ static status_t reestablish(private_ike_sa_t *this)
switch (action)
{
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_ref(child_cfg);
status = new->initiate(new, child_cfg);
diff --git a/src/charon/sa/tasks/child_create.c b/src/charon/sa/tasks/child_create.c
index 8c58b4ec8..743cf5bb8 100644
--- a/src/charon/sa/tasks/child_create.c
+++ b/src/charon/sa/tasks/child_create.c
@@ -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
{
diff --git a/src/charon/sa/tasks/child_delete.c b/src/charon/sa/tasks/child_delete.c
index 264650cda..281f17740 100644
--- a/src/charon/sa/tasks/child_delete.c
+++ b/src/charon/sa/tasks/child_delete.c
@@ -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);
}
diff --git a/src/charon/sa/tasks/ike_auth.c b/src/charon/sa/tasks/ike_auth.c
index 003fd4b8d..d45da7689 100644
--- a/src/charon/sa/tasks/ike_auth.c
+++ b/src/charon/sa/tasks/ike_auth.c
@@ -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;
}