aboutsummaryrefslogtreecommitdiffstats
path: root/Source/charon/sa/states
diff options
context:
space:
mode:
Diffstat (limited to 'Source/charon/sa/states')
-rw-r--r--Source/charon/sa/states/ike_auth_requested.c14
-rw-r--r--Source/charon/sa/states/ike_sa_init_requested.c74
-rw-r--r--Source/charon/sa/states/ike_sa_init_responded.c48
-rw-r--r--Source/charon/sa/states/initiator_init.c42
-rw-r--r--Source/charon/sa/states/responder_init.c94
5 files changed, 137 insertions, 135 deletions
diff --git a/Source/charon/sa/states/ike_auth_requested.c b/Source/charon/sa/states/ike_auth_requested.c
index cbd5555eb..8b799d674 100644
--- a/Source/charon/sa/states/ike_auth_requested.c
+++ b/Source/charon/sa/states/ike_auth_requested.c
@@ -143,14 +143,14 @@ static status_t process_message(private_ike_auth_requested_t *this, message_t *i
if (ike_auth_reply->get_exchange_type(ike_auth_reply) != IKE_AUTH)
{
- this->logger->log(this->logger, ERROR | MORE, "Message of type %s not supported in state ike_auth_requested",
+ this->logger->log(this->logger, ERROR | LEVEL1, "Message of type %s not supported in state ike_auth_requested",
mapping_find(exchange_type_m,ike_auth_reply->get_exchange_type(ike_auth_reply)));
return FAILED;
}
if (ike_auth_reply->get_request(ike_auth_reply))
{
- this->logger->log(this->logger, ERROR | MORE, "Only responses of type IKE_AUTH supported in state ike_auth_requested");
+ this->logger->log(this->logger, ERROR | LEVEL1, "Only responses of type IKE_AUTH supported in state ike_auth_requested");
return FAILED;
}
@@ -162,7 +162,7 @@ static status_t process_message(private_ike_auth_requested_t *this, message_t *i
status = ike_auth_reply->parse_body(ike_auth_reply, crypter, signer);
if (status != SUCCESS)
{
- this->logger->log(this->logger, ERROR | MORE, "Could not parse body of request message");
+ this->logger->log(this->logger, ERROR | LEVEL1, "Could not parse body of request message");
return status;
}
@@ -212,13 +212,13 @@ static status_t process_message(private_ike_auth_requested_t *this, message_t *i
notify_payload_t *notify_payload = (notify_payload_t *) payload;
- this->logger->log(this->logger, CONTROL|MORE, "Process notify type %s for protocol %s",
+ this->logger->log(this->logger, CONTROL|LEVEL1, "Process notify type %s for protocol %s",
mapping_find(notify_message_type_m, notify_payload->get_notify_message_type(notify_payload)),
mapping_find(protocol_id_m, notify_payload->get_protocol_id(notify_payload)));
if (notify_payload->get_protocol_id(notify_payload) != IKE)
{
- this->logger->log(this->logger, ERROR | MORE, "Notify reply not for IKE protocol");
+ this->logger->log(this->logger, ERROR | LEVEL1, "Notify reply not for IKE protocol");
payloads->destroy(payloads);
return DELETE_ME;
}
@@ -313,7 +313,7 @@ static status_t process_message(private_ike_auth_requested_t *this, message_t *i
}
this->ike_sa->set_last_replied_message_id(this->ike_sa,ike_auth_reply->get_message_id(ike_auth_reply));
- this->logger->log(this->logger, CONTROL | MORE, "IKE_AUTH response successfully handled. IKE_SA established.");
+ this->logger->log(this->logger, CONTROL | LEVEL1, "IKE_AUTH response successfully handled. IKE_SA established.");
/* create new state */
this->ike_sa->set_new_state(this->ike_sa, (state_t*)ike_sa_established_create(this->ike_sa));
@@ -415,7 +415,7 @@ static status_t process_auth_payload(private_ike_auth_requested_t *this, auth_pa
return DELETE_ME;
}
- this->logger->log(this->logger, CONTROL | MORE, "AUTH data verified");
+ this->logger->log(this->logger, CONTROL | LEVEL1, "AUTH data verified");
return SUCCESS;
}
diff --git a/Source/charon/sa/states/ike_sa_init_requested.c b/Source/charon/sa/states/ike_sa_init_requested.c
index 9e65e9664..f86170ac8 100644
--- a/Source/charon/sa/states/ike_sa_init_requested.c
+++ b/Source/charon/sa/states/ike_sa_init_requested.c
@@ -219,14 +219,14 @@ static status_t process_message(private_ike_sa_init_requested_t *this, message_t
if (ike_sa_init_reply->get_exchange_type(ike_sa_init_reply) != IKE_SA_INIT)
{
- this->logger->log(this->logger, ERROR | MORE, "Message of type %s not supported in state ike_sa_init_requested",
+ this->logger->log(this->logger, ERROR | LEVEL1, "Message of type %s not supported in state ike_sa_init_requested",
mapping_find(exchange_type_m,ike_sa_init_reply->get_exchange_type(ike_sa_init_reply)));
return FAILED;
}
if (ike_sa_init_reply->get_request(ike_sa_init_reply))
{
- this->logger->log(this->logger, ERROR | MORE, "Only responses of type IKE_SA_INIT supported in state ike_sa_init_requested");
+ this->logger->log(this->logger, ERROR | LEVEL1, "Only responses of type IKE_SA_INIT supported in state ike_sa_init_requested");
return FAILED;
}
@@ -234,7 +234,7 @@ static status_t process_message(private_ike_sa_init_requested_t *this, message_t
status = ike_sa_init_reply->parse_body(ike_sa_init_reply, NULL, NULL);
if (status != SUCCESS)
{
- this->logger->log(this->logger, ERROR | MORE, "Parsing of body returned error: %s",mapping_find(status_m,status));
+ this->logger->log(this->logger, ERROR | LEVEL1, "Parsing of body returned error: %s",mapping_find(status_m,status));
return status;
}
@@ -243,7 +243,7 @@ static status_t process_message(private_ike_sa_init_requested_t *this, message_t
if (responder_spi == 0)
{
- this->logger->log(this->logger, ERROR | MORE, "Responder SPI still zero");
+ this->logger->log(this->logger, ERROR | LEVEL1, "Responder SPI still zero");
return FAILED;
}
ike_sa_id = this->ike_sa->public.get_id(&(this->ike_sa->public));
@@ -259,7 +259,7 @@ static status_t process_message(private_ike_sa_init_requested_t *this, message_t
payload_t *payload;
payloads->current(payloads, (void**)&payload);
- this->logger->log(this->logger, CONTROL|MORE, "Processing payload %s", mapping_find(payload_type_m, payload->get_type(payload)));
+ this->logger->log(this->logger, CONTROL|LEVEL1, "Processing payload %s", mapping_find(payload_type_m, payload->get_type(payload)));
switch (payload->get_type(payload))
{
case NOTIFY:
@@ -267,13 +267,13 @@ static status_t process_message(private_ike_sa_init_requested_t *this, message_t
notify_payload_t *notify_payload = (notify_payload_t *) payload;
- this->logger->log(this->logger, CONTROL|MORE, "Process notify type %s for protocol %s",
+ this->logger->log(this->logger, CONTROL|LEVEL1, "Process notify type %s for protocol %s",
mapping_find(notify_message_type_m, notify_payload->get_notify_message_type(notify_payload)),
mapping_find(protocol_id_m, notify_payload->get_protocol_id(notify_payload)));
if (notify_payload->get_protocol_id(notify_payload) != IKE)
{
- this->logger->log(this->logger, ERROR | MORE, "Notify reply not for IKE protocol.");
+ this->logger->log(this->logger, ERROR | LEVEL1, "Notify reply not for IKE protocol.");
payloads->destroy(payloads);
return FAILED;
}
@@ -299,7 +299,7 @@ static status_t process_message(private_ike_sa_init_requested_t *this, message_t
this->logger->log(this->logger, ERROR, "Selected DH group is not the one in the proposal selected by the responder!");
payloads->destroy(payloads);
/* Going to change state back to initiator_init_t */
- this->logger->log(this->logger, CONTROL|MOST, "Create next state object");
+ this->logger->log(this->logger, CONTROL|LEVEL2, "Create next state object");
initiator_init_state = initiator_init_create(this->ike_sa);
/* buffer of sent and received messages has to get reseted */
@@ -309,10 +309,10 @@ static status_t process_message(private_ike_sa_init_requested_t *this, message_t
this->ike_sa->set_new_state(this->ike_sa,(state_t *) initiator_init_state);
/* state has NOW changed :-) */
- this->logger->log(this->logger, CONTROL|MORE, "Changed state of IKE_SA from %s to %s", mapping_find(ike_sa_state_m,INITIATOR_INIT),mapping_find(ike_sa_state_m,IKE_SA_INIT_REQUESTED) );
+ this->logger->log(this->logger, CONTROL|LEVEL1, "Changed state of IKE_SA from %s to %s", mapping_find(ike_sa_state_m,INITIATOR_INIT),mapping_find(ike_sa_state_m,IKE_SA_INIT_REQUESTED) );
- this->logger->log(this->logger, CONTROL|MOST, "Destroy old sate object");
- this->logger->log(this->logger, CONTROL|MOST, "Going to retry initialization of connection");
+ this->logger->log(this->logger, CONTROL|LEVEL2, "Destroy old sate object");
+ this->logger->log(this->logger, CONTROL|LEVEL2, "Going to retry initialization of connection");
new_dh_group_priority = this->dh_group_priority + 1;
this->public.state_interface.destroy(&(this->public.state_interface));
@@ -388,7 +388,7 @@ static status_t process_message(private_ike_sa_init_requested_t *this, message_t
return status;
}
- this->logger->log(this->logger, CONTROL|MOST, "Going to build empty message");
+ this->logger->log(this->logger, CONTROL|LEVEL2, "Going to build empty message");
this->ike_sa->build_message(this->ike_sa, IKE_AUTH, TRUE, &request);
/* build ID payload */
@@ -445,16 +445,16 @@ static status_t process_message(private_ike_sa_init_requested_t *this, message_t
ike_sa_init_reply_data = ike_sa_init_reply->get_packet_data(ike_sa_init_reply);
/* state can now be changed */
- this->logger->log(this->logger, CONTROL|MOST, "Create next state object");
+ this->logger->log(this->logger, CONTROL|LEVEL2, "Create next state object");
next_state = ike_auth_requested_create(this->ike_sa,this->sent_nonce,this->received_nonce,ike_sa_init_reply_data);
/* state can now be changed */
this->ike_sa->set_new_state(this->ike_sa,(state_t *) next_state);
/* state has NOW changed :-) */
- this->logger->log(this->logger, CONTROL|MORE, "Changed state of IKE_SA from %s to %s", mapping_find(ike_sa_state_m,IKE_SA_INIT_REQUESTED),mapping_find(ike_sa_state_m,IKE_AUTH_REQUESTED) );
+ this->logger->log(this->logger, CONTROL|LEVEL1, "Changed state of IKE_SA from %s to %s", mapping_find(ike_sa_state_m,IKE_SA_INIT_REQUESTED),mapping_find(ike_sa_state_m,IKE_AUTH_REQUESTED) );
- this->logger->log(this->logger, CONTROL|MOST, "Destroy old sate object");
+ this->logger->log(this->logger, CONTROL|LEVEL2, "Destroy old sate object");
this->destroy_after_state_change(this);
return SUCCESS;
}
@@ -488,31 +488,31 @@ status_t process_sa_payload (private_ike_sa_init_requested_t *this, sa_payload_t
status = sa_payload->get_ike_proposals (sa_payload, &ike_proposals,&proposal_count);
if (status != SUCCESS)
{
- this->logger->log(this->logger, ERROR | MORE, "SA payload does not contain IKE proposals");
+ this->logger->log(this->logger, ERROR | LEVEL1, "SA payload does not contain IKE proposals");
return DELETE_ME;
}
/* the peer has to select only one proposal */
if (proposal_count != 1)
{
- this->logger->log(this->logger, ERROR | MORE, "More then 1 proposal (%d) selected!",proposal_count);
+ this->logger->log(this->logger, ERROR | LEVEL1, "More then 1 proposal (%d) selected!",proposal_count);
allocator_free(ike_proposals);
return DELETE_ME;
}
/* now let the configuration-manager check the selected proposals*/
- this->logger->log(this->logger, CONTROL | MOST, "Check selected proposal");
+ this->logger->log(this->logger, CONTROL | LEVEL2, "Check selected proposal");
status = init_config->select_proposal (init_config,ike_proposals,1,&selected_proposal);
allocator_free(ike_proposals);
if (status != SUCCESS)
{
- this->logger->log(this->logger, ERROR | MORE, "Selected proposal not a suggested one! Peer is trying to trick me!");
+ this->logger->log(this->logger, ERROR | LEVEL1, "Selected proposal not a suggested one! Peer is trying to trick me!");
return DELETE_ME;
}
status = this->ike_sa->create_transforms_from_proposal(this->ike_sa,&selected_proposal);
if (status != SUCCESS)
{
- this->logger->log(this->logger, ERROR | MORE, "Transform objects could not be created from selected proposal");
+ this->logger->log(this->logger, ERROR | LEVEL1, "Transform objects could not be created from selected proposal");
return DELETE_ME;
}
return SUCCESS;
@@ -531,11 +531,11 @@ status_t process_ke_payload (private_ike_sa_init_requested_t *this, ke_payload_t
/* store shared secret
* status of dh object does not have to get checked cause other key is set
*/
- this->logger->log(this->logger, CONTROL | MOST, "Retrieve shared secret and store it");
+ this->logger->log(this->logger, CONTROL | LEVEL2, "Retrieve shared secret and store it");
status = this->diffie_hellman->get_shared_secret(this->diffie_hellman, &shared_secret);
this->logger->log_chunk(this->logger, PRIVATE, "Shared secret", &shared_secret);
- this->logger->log(this->logger, CONTROL | MOST, "Going to derive all secrets from shared secret");
+ this->logger->log(this->logger, CONTROL | LEVEL2, "Going to derive all secrets from shared secret");
this->ike_sa->compute_secrets(this->ike_sa,shared_secret,this->sent_nonce, this->received_nonce);
allocator_free_chunk(&(shared_secret));
@@ -557,7 +557,7 @@ static status_t build_id_payload (private_ike_sa_init_requested_t *this,id_paylo
identification = sa_config->get_my_id(sa_config);
new_id_payload = id_payload_create_from_identification(TRUE,identification);
- this->logger->log(this->logger, CONTROL|MOST, "Add ID payload to message");
+ this->logger->log(this->logger, CONTROL|LEVEL2, "Add ID payload to message");
request->add_payload(request,(payload_t *) new_id_payload);
*id_payload = new_id_payload;
@@ -583,7 +583,7 @@ static status_t build_auth_payload (private_ike_sa_init_requested_t *this, id_pa
return DELETE_ME;
}
- this->logger->log(this->logger, CONTROL|MOST, "Add AUTH payload to message");
+ this->logger->log(this->logger, CONTROL|LEVEL2, "Add AUTH payload to message");
request->add_payload(request,(payload_t *) auth_payload);
return SUCCESS;
@@ -609,7 +609,7 @@ static status_t build_sa_payload (private_ike_sa_init_requested_t *this, message
sa_payload = sa_payload_create_from_child_proposals(proposals, proposal_count);
allocator_free(proposals);
- this->logger->log(this->logger, CONTROL|MOST, "Add SA payload to message");
+ this->logger->log(this->logger, CONTROL|LEVEL2, "Add SA payload to message");
request->add_payload(request,(payload_t *) sa_payload);
return SUCCESS;
@@ -637,7 +637,7 @@ static status_t build_tsi_payload (private_ike_sa_init_requested_t *this, messag
}
allocator_free(traffic_selectors);
- this->logger->log(this->logger, CONTROL|MOST, "Add TSi payload to message");
+ this->logger->log(this->logger, CONTROL|LEVEL2, "Add TSi payload to message");
request->add_payload(request,(payload_t *) ts_payload);
return SUCCESS;
@@ -665,7 +665,7 @@ static status_t build_tsr_payload (private_ike_sa_init_requested_t *this, messag
}
allocator_free(traffic_selectors);
- this->logger->log(this->logger, CONTROL|MOST, "Add TSr payload to message");
+ this->logger->log(this->logger, CONTROL|LEVEL2, "Add TSr payload to message");
request->add_payload(request,(payload_t *) ts_payload);
return SUCCESS;
@@ -685,13 +685,13 @@ static ike_sa_state_t get_state(private_ike_sa_init_requested_t *this)
*/
static void destroy_after_state_change (private_ike_sa_init_requested_t *this)
{
- this->logger->log(this->logger, CONTROL | MORE, "Going to destroy state of type ike_sa_init_requested_t after state change.");
+ this->logger->log(this->logger, CONTROL | LEVEL1, "Going to destroy state of type ike_sa_init_requested_t after state change.");
- this->logger->log(this->logger, CONTROL | MOST, "Destroy diffie hellman object");
+ this->logger->log(this->logger, CONTROL | LEVEL2, "Destroy diffie hellman object");
this->diffie_hellman->destroy(this->diffie_hellman);
- this->logger->log(this->logger, CONTROL | MOST, "Destroy ike_sa_init_request_data");
+ this->logger->log(this->logger, CONTROL | LEVEL2, "Destroy ike_sa_init_request_data");
allocator_free_chunk(&(this->ike_sa_init_request_data));
- this->logger->log(this->logger, CONTROL | MOST, "Destroy object itself");
+ this->logger->log(this->logger, CONTROL | LEVEL2, "Destroy object itself");
allocator_free(this);
}
@@ -700,17 +700,17 @@ static void destroy_after_state_change (private_ike_sa_init_requested_t *this)
*/
static void destroy(private_ike_sa_init_requested_t *this)
{
- this->logger->log(this->logger, CONTROL | MORE, "Going to destroy state of type ike_sa_init_requested_t");
+ this->logger->log(this->logger, CONTROL | LEVEL1, "Going to destroy state of type ike_sa_init_requested_t");
- this->logger->log(this->logger, CONTROL | MOST, "Destroy diffie hellman object");
+ this->logger->log(this->logger, CONTROL | LEVEL2, "Destroy diffie hellman object");
this->diffie_hellman->destroy(this->diffie_hellman);
- this->logger->log(this->logger, CONTROL | MOST, "Destroy sent nonce");
+ this->logger->log(this->logger, CONTROL | LEVEL2, "Destroy sent nonce");
allocator_free(this->sent_nonce.ptr);
- this->logger->log(this->logger, CONTROL | MOST, "Destroy received nonce");
+ this->logger->log(this->logger, CONTROL | LEVEL2, "Destroy received nonce");
allocator_free(this->received_nonce.ptr);
- this->logger->log(this->logger, CONTROL | MOST, "Destroy ike_sa_init_request_data");
+ this->logger->log(this->logger, CONTROL | LEVEL2, "Destroy ike_sa_init_request_data");
allocator_free_chunk(&(this->ike_sa_init_request_data));
- this->logger->log(this->logger, CONTROL | MOST, "Destroy object itself");
+ this->logger->log(this->logger, CONTROL | LEVEL2, "Destroy object itself");
allocator_free(this);
}
diff --git a/Source/charon/sa/states/ike_sa_init_responded.c b/Source/charon/sa/states/ike_sa_init_responded.c
index 109a1f10a..8c1ca880d 100644
--- a/Source/charon/sa/states/ike_sa_init_responded.c
+++ b/Source/charon/sa/states/ike_sa_init_responded.c
@@ -157,14 +157,14 @@ static status_t process_message(private_ike_sa_init_responded_t *this, message_t
if (request->get_exchange_type(request) != IKE_AUTH)
{
- this->logger->log(this->logger, ERROR | MORE, "Message of type %s not supported in state ike_sa_init_responded",
+ this->logger->log(this->logger, ERROR | LEVEL1, "Message of type %s not supported in state ike_sa_init_responded",
mapping_find(exchange_type_m,request->get_exchange_type(request)));
return FAILED;
}
if (!request->get_request(request))
{
- this->logger->log(this->logger, ERROR | MORE, "Only requests of type IKE_AUTH supported in state ike_sa_init_responded");
+ this->logger->log(this->logger, ERROR | LEVEL1, "Only requests of type IKE_AUTH supported in state ike_sa_init_responded");
return FAILED;
}
@@ -177,7 +177,7 @@ static status_t process_message(private_ike_sa_init_responded_t *this, message_t
{
if (status == NOT_SUPPORTED)
{
- this->logger->log(this->logger, ERROR | MORE, "Message contains unsupported payload with critical flag set");
+ this->logger->log(this->logger, ERROR | LEVEL1, "Message contains unsupported payload with critical flag set");
/**
* TODO send unsupported type.
*/
@@ -186,7 +186,7 @@ static status_t process_message(private_ike_sa_init_responded_t *this, message_t
}
else
{
- this->logger->log(this->logger, ERROR | MORE, "Could not parse body of request message");
+ this->logger->log(this->logger, ERROR | LEVEL1, "Could not parse body of request message");
}
return status;
}
@@ -223,13 +223,13 @@ static status_t process_message(private_ike_sa_init_responded_t *this, message_t
case CERTIFICATE:
{
/* TODO handle cert payloads */
- this->logger->log(this->logger, ERROR | MORE, "Payload type CERTIFICATE currently not supported and so not handled");
+ this->logger->log(this->logger, ERROR | LEVEL1, "Payload type CERTIFICATE currently not supported and so not handled");
break;
}
case CERTIFICATE_REQUEST:
{
/* TODO handle certrequest payloads */
- this->logger->log(this->logger, ERROR | MORE, "Payload type CERTIFICATE_REQUEST currently not supported and so not handled");
+ this->logger->log(this->logger, ERROR | LEVEL1, "Payload type CERTIFICATE_REQUEST currently not supported and so not handled");
break;
}
case TRAFFIC_SELECTOR_INITIATOR:
@@ -246,13 +246,13 @@ static status_t process_message(private_ike_sa_init_responded_t *this, message_t
{
notify_payload_t *notify_payload = (notify_payload_t *) payload;
- this->logger->log(this->logger, CONTROL|MORE, "Process notify type %s for protocol %s",
+ this->logger->log(this->logger, CONTROL|LEVEL1, "Process notify type %s for protocol %s",
mapping_find(notify_message_type_m, notify_payload->get_notify_message_type(notify_payload)),
mapping_find(protocol_id_m, notify_payload->get_protocol_id(notify_payload)));
if (notify_payload->get_protocol_id(notify_payload) != IKE)
{
- this->logger->log(this->logger, ERROR | MORE, "Notify not for IKE protocol.");
+ this->logger->log(this->logger, ERROR | LEVEL1, "Notify not for IKE protocol.");
payloads->destroy(payloads);
return DELETE_ME;
}
@@ -268,7 +268,7 @@ static status_t process_message(private_ike_sa_init_responded_t *this, message_t
*/
default:
{
- this->logger->log(this->logger, CONTROL|MORE, "Handling of notify type %s not implemented",
+ this->logger->log(this->logger, CONTROL|LEVEL1, "Handling of notify type %s not implemented",
notify_payload->get_notify_message_type(notify_payload));
}
}
@@ -326,7 +326,7 @@ static status_t process_message(private_ike_sa_init_responded_t *this, message_t
return status;
}
- this->logger->log(this->logger, CONTROL | MORE, "IKE_AUTH request successfully handled. Sending reply.");
+ this->logger->log(this->logger, CONTROL | LEVEL1, "IKE_AUTH request successfully handled. Sending reply.");
status = this->ike_sa->send_response(this->ike_sa, response);
/* message can now be sent (must not be destroyed) */
@@ -459,7 +459,7 @@ static status_t build_auth_payload(private_ike_sa_init_responded_t *this, auth_p
/*
* Send notify message of type AUTHENTICATION_FAILED
*/
- this->logger->log(this->logger, CONTROL | MORE, "Send notify message of type AUTHENTICATION_FAILED");
+ this->logger->log(this->logger, CONTROL | LEVEL1, "Send notify message of type AUTHENTICATION_FAILED");
this->send_notify_reply (this,AUTHENTICATION_FAILED,CHUNK_INITIALIZER);
return DELETE_ME;
}
@@ -535,31 +535,33 @@ static void send_notify_reply (private_ike_sa_init_responded_t *this,notify_mess
packet_t *packet;
status_t status;
- this->logger->log(this->logger, CONTROL|MOST, "Going to build message with notify payload");
+ this->logger->log(this->logger, CONTROL|LEVEL2, "Going to build message with notify payload");
/* set up the reply */
this->ike_sa->build_message(this->ike_sa, IKE_AUTH, FALSE, &response);
payload = notify_payload_create_from_protocol_and_type(IKE,type);
if ((data.ptr != NULL) && (data.len > 0))
{
- this->logger->log(this->logger, CONTROL|MOST, "Add Data to notify payload");
+ this->logger->log(this->logger, CONTROL|LEVEL2, "Add Data to notify payload");
payload->set_notification_data(payload,data);
}
- this->logger->log(this->logger, CONTROL|MOST, "Add Notify payload to message");
+ this->logger->log(this->logger, CONTROL|LEVEL2, "Add Notify payload to message");
response->add_payload(response,(payload_t *) payload);
/* generate packet */
- this->logger->log(this->logger, CONTROL|MOST, "Gnerate packet from message");
- status = response->generate(response, NULL, NULL, &packet);
+ this->logger->log(this->logger, CONTROL|LEVEL2, "Gnerate packet from message");
+ status = response->generate(response, this->ike_sa->get_crypter_responder(this->ike_sa),
+ this->ike_sa->get_signer_responder(this->ike_sa), &packet);
if (status != SUCCESS)
{
this->logger->log(this->logger, ERROR, "Could not generate packet from message");
+ response->destroy(response);
return;
}
- this->logger->log(this->logger, CONTROL|MOST, "Add packet to global send queue");
+ this->logger->log(this->logger, CONTROL|LEVEL2, "Add packet to global send queue");
charon->send_queue->add(charon->send_queue, packet);
- this->logger->log(this->logger, CONTROL|MOST, "Destroy message");
+ this->logger->log(this->logger, CONTROL|LEVEL2, "Destroy message");
response->destroy(response);
}
@@ -576,15 +578,15 @@ static ike_sa_state_t get_state(private_ike_sa_init_responded_t *this)
*/
static void destroy(private_ike_sa_init_responded_t *this)
{
- this->logger->log(this->logger, CONTROL | MORE, "Going to destroy ike_sa_init_responded_t state object");
+ this->logger->log(this->logger, CONTROL | LEVEL1, "Going to destroy ike_sa_init_responded_t state object");
- this->logger->log(this->logger, CONTROL | MOST, "Destroy received nonce");
+ this->logger->log(this->logger, CONTROL | LEVEL2, "Destroy received nonce");
allocator_free_chunk(&(this->received_nonce));
- this->logger->log(this->logger, CONTROL | MOST, "Destroy sent nonce");
+ this->logger->log(this->logger, CONTROL | LEVEL2, "Destroy sent nonce");
allocator_free_chunk(&(this->sent_nonce));
- this->logger->log(this->logger, CONTROL | MOST, "Destroy IKE_SA_INIT response octets");
+ this->logger->log(this->logger, CONTROL | LEVEL2, "Destroy IKE_SA_INIT response octets");
allocator_free_chunk(&(this->ike_sa_init_response_data));
- this->logger->log(this->logger, CONTROL | MOST, "Destroy IKE_SA_INIT request octets");
+ this->logger->log(this->logger, CONTROL | LEVEL2, "Destroy IKE_SA_INIT request octets");
allocator_free_chunk(&(this->ike_sa_init_request_data));
allocator_free(this);
diff --git a/Source/charon/sa/states/initiator_init.c b/Source/charon/sa/states/initiator_init.c
index c2a509b5d..ae23df9f3 100644
--- a/Source/charon/sa/states/initiator_init.c
+++ b/Source/charon/sa/states/initiator_init.c
@@ -131,7 +131,7 @@ static status_t initiate_connection (private_initiator_init_t *this, char *name)
status = charon->configuration_manager->get_init_config_for_name(charon->configuration_manager,name,&init_config);
if (status != SUCCESS)
{
- this->logger->log(this->logger, ERROR | MORE, "Could not retrieve INIT configuration informations for %s",name);
+ this->logger->log(this->logger, ERROR | LEVEL1, "Could not retrieve INIT configuration informations for %s",name);
return DELETE_ME;
}
@@ -141,7 +141,7 @@ static status_t initiate_connection (private_initiator_init_t *this, char *name)
if (status != SUCCESS)
{
- this->logger->log(this->logger, ERROR | MORE, "Could not retrieve SA configuration informations for %s",name);
+ this->logger->log(this->logger, ERROR | LEVEL1, "Could not retrieve SA configuration informations for %s",name);
return DELETE_ME;
}
@@ -154,7 +154,7 @@ static status_t initiate_connection (private_initiator_init_t *this, char *name)
this->dh_group_number = init_config->get_dh_group_number(init_config,this->dh_group_priority);
if (this->dh_group_number == MODP_UNDEFINED)
{
- this->logger->log(this->logger, ERROR | MORE, "Diffie hellman group could not be retrieved with priority %d", this->dh_group_priority);
+ this->logger->log(this->logger, ERROR | LEVEL1, "Diffie hellman group could not be retrieved with priority %d", this->dh_group_priority);
return DELETE_ME;
}
@@ -185,14 +185,14 @@ status_t retry_initiate_connection (private_initiator_init_t *this, int dh_group
this->dh_group_number = init_config->get_dh_group_number(init_config,dh_group_priority);
if (this->dh_group_number == MODP_UNDEFINED)
{
- this->logger->log(this->logger, ERROR | MORE, "Diffie hellman group could not be retrieved with priority %d", dh_group_priority);
+ this->logger->log(this->logger, ERROR | LEVEL1, "Diffie hellman group could not be retrieved with priority %d", dh_group_priority);
return DELETE_ME;
}
this->diffie_hellman = diffie_hellman_create(this->dh_group_number);
/* going to build message */
- this->logger->log(this->logger, CONTROL|MOST, "Going to build message");
+ this->logger->log(this->logger, CONTROL|LEVEL2, "Going to build message");
this->ike_sa->build_message(this->ike_sa, IKE_SA_INIT, TRUE, &message);
/* build SA payload */
@@ -219,16 +219,16 @@ status_t retry_initiate_connection (private_initiator_init_t *this, int dh_group
ike_sa_init_request_data = message->get_packet_data(message);
/* state can now be changed */
- this->logger->log(this->logger, CONTROL|MOST, "Create next state object");
+ this->logger->log(this->logger, CONTROL|LEVEL2, "Create next state object");
next_state = ike_sa_init_requested_create(this->ike_sa, this->dh_group_priority, this->diffie_hellman, this->sent_nonce,ike_sa_init_request_data);
/* state can now be changed */
this->ike_sa->set_new_state(this->ike_sa,(state_t *) next_state);
/* state has NOW changed :-) */
- this->logger->log(this->logger, CONTROL|MORE, "Changed state of IKE_SA from %s to %s", mapping_find(ike_sa_state_m,INITIATOR_INIT),mapping_find(ike_sa_state_m,IKE_SA_INIT_REQUESTED) );
+ this->logger->log(this->logger, CONTROL|LEVEL1, "Changed state of IKE_SA from %s to %s", mapping_find(ike_sa_state_m,INITIATOR_INIT),mapping_find(ike_sa_state_m,IKE_SA_INIT_REQUESTED) );
- this->logger->log(this->logger, CONTROL|MOST, "Destroy old sate object");
+ this->logger->log(this->logger, CONTROL|LEVEL2, "Destroy old sate object");
this->destroy_after_state_change(this);
return SUCCESS;
}
@@ -243,7 +243,7 @@ static void build_sa_payload(private_initiator_init_t *this, message_t *request)
ike_proposal_t *proposals;
init_config_t *init_config;
- this->logger->log(this->logger, CONTROL|MORE, "Building SA payload");
+ this->logger->log(this->logger, CONTROL|LEVEL1, "Building SA payload");
init_config = this->ike_sa->get_init_config(this->ike_sa);
@@ -253,7 +253,7 @@ static void build_sa_payload(private_initiator_init_t *this, message_t *request)
allocator_free(proposals);
- this->logger->log(this->logger, CONTROL|MOST, "Add SA payload to message");
+ this->logger->log(this->logger, CONTROL|LEVEL2, "Add SA payload to message");
request->add_payload(request, (payload_t *) sa_payload);
}
@@ -265,7 +265,7 @@ static void build_ke_payload(private_initiator_init_t *this, message_t *request)
ke_payload_t *ke_payload;
chunk_t key_data;
- this->logger->log(this->logger, CONTROL|MORE, "Building KE payload");
+ this->logger->log(this->logger, CONTROL|LEVEL1, "Building KE payload");
this->diffie_hellman->get_my_public_value(this->diffie_hellman,&key_data);
@@ -275,7 +275,7 @@ static void build_ke_payload(private_initiator_init_t *this, message_t *request)
allocator_free_chunk(&key_data);
- this->logger->log(this->logger, CONTROL|MOST, "Add KE payload to message");
+ this->logger->log(this->logger, CONTROL|LEVEL2, "Add KE payload to message");
request->add_payload(request, (payload_t *) ke_payload);
}
@@ -287,20 +287,20 @@ static void build_nonce_payload(private_initiator_init_t *this, message_t *reque
nonce_payload_t *nonce_payload;
randomizer_t *randomizer;
- this->logger->log(this->logger, CONTROL|MORE, "Building NONCE payload");
+ this->logger->log(this->logger, CONTROL|LEVEL1, "Building NONCE payload");
- this->logger->log(this->logger, CONTROL|MOST, "Get pseudo random bytes for NONCE");
+ this->logger->log(this->logger, CONTROL|LEVEL2, "Get pseudo random bytes for NONCE");
randomizer = this->ike_sa->get_randomizer(this->ike_sa);
randomizer->allocate_pseudo_random_bytes(randomizer, NONCE_SIZE, &(this->sent_nonce));
- this->logger->log(this->logger, RAW|MOST, "Initiator NONCE",&(this->sent_nonce));
+ this->logger->log(this->logger, RAW|LEVEL2, "Initiator NONCE",&(this->sent_nonce));
nonce_payload = nonce_payload_create();
nonce_payload->set_nonce(nonce_payload, this->sent_nonce);
- this->logger->log(this->logger, CONTROL|MOST, "Add NONCE payload to message");
+ this->logger->log(this->logger, CONTROL|LEVEL2, "Add NONCE payload to message");
request->add_payload(request, (payload_t *) nonce_payload);
}
@@ -309,7 +309,7 @@ static void build_nonce_payload(private_initiator_init_t *this, message_t *reque
*/
static status_t process_message(private_initiator_init_t *this, message_t *message)
{
- this->logger->log(this->logger, ERROR|MORE, "In state INITIATOR_INIT no message is processed");
+ this->logger->log(this->logger, ERROR|LEVEL1, "In state INITIATOR_INIT no message is processed");
return FAILED;
}
@@ -326,17 +326,17 @@ static ike_sa_state_t get_state(private_initiator_init_t *this)
*/
static void destroy(private_initiator_init_t *this)
{
- this->logger->log(this->logger, CONTROL | MORE, "Going to destroy initiator_init_t state object");
+ this->logger->log(this->logger, CONTROL | LEVEL1, "Going to destroy initiator_init_t state object");
/* destroy diffie hellman object */
if (this->diffie_hellman != NULL)
{
- this->logger->log(this->logger, CONTROL | MOST, "Destroy diffie_hellman_t object");
+ this->logger->log(this->logger, CONTROL | LEVEL2, "Destroy diffie_hellman_t object");
this->diffie_hellman->destroy(this->diffie_hellman);
}
if (this->sent_nonce.ptr != NULL)
{
- this->logger->log(this->logger, CONTROL | MOST, "Free memory of sent nonce");
+ this->logger->log(this->logger, CONTROL | LEVEL2, "Free memory of sent nonce");
allocator_free(this->sent_nonce.ptr);
}
allocator_free(this);
@@ -347,7 +347,7 @@ static void destroy(private_initiator_init_t *this)
*/
static void destroy_after_state_change (private_initiator_init_t *this)
{
- this->logger->log(this->logger, CONTROL | MORE, "Going to destroy initiator_init_t state object");
+ this->logger->log(this->logger, CONTROL | LEVEL1, "Going to destroy initiator_init_t state object");
allocator_free(this);
}
diff --git a/Source/charon/sa/states/responder_init.c b/Source/charon/sa/states/responder_init.c
index e4792d6b5..b0dcfa322 100644
--- a/Source/charon/sa/states/responder_init.c
+++ b/Source/charon/sa/states/responder_init.c
@@ -161,12 +161,12 @@ static status_t process_message(private_responder_init_t *this, message_t *messa
if (message->get_exchange_type(message) != IKE_SA_INIT)
{
- this->logger->log(this->logger, ERROR | MORE, "Message of type %s not supported in state responder_init",mapping_find(exchange_type_m,message->get_exchange_type(message)));
+ this->logger->log(this->logger, ERROR | LEVEL1, "Message of type %s not supported in state responder_init",mapping_find(exchange_type_m,message->get_exchange_type(message)));
return DELETE_ME;
}
if (!message->get_request(message))
{
- this->logger->log(this->logger, ERROR | MORE, "Only requests of type IKE_SA_INIT supported in state responder_init");
+ this->logger->log(this->logger, ERROR | LEVEL1, "Only requests of type IKE_SA_INIT supported in state responder_init");
return DELETE_ME;
}
@@ -178,7 +178,7 @@ static status_t process_message(private_responder_init_t *this, message_t *messa
if (status != SUCCESS)
{
/* no configuration matches given host */
- this->logger->log(this->logger, ERROR | MORE, "No INIT configuration found for given remote and local hosts");
+ this->logger->log(this->logger, ERROR | LEVEL1, "No INIT configuration found for given remote and local hosts");
this->send_notify_reply(this,NO_PROPOSAL_CHOSEN,CHUNK_INITIALIZER);
return DELETE_ME;
}
@@ -193,7 +193,7 @@ static status_t process_message(private_responder_init_t *this, message_t *messa
{
if (status == NOT_SUPPORTED)
{
- this->logger->log(this->logger, ERROR | MORE, "Message contains unsupported payload with critical flag set");
+ this->logger->log(this->logger, ERROR | LEVEL1, "Message contains unsupported payload with critical flag set");
/**
* TODO send unsupported type.
*/
@@ -201,7 +201,7 @@ static status_t process_message(private_responder_init_t *this, message_t *messa
}
else
{
- this->logger->log(this->logger, ERROR | MORE, "Could not parse body of request message");
+ this->logger->log(this->logger, ERROR | LEVEL1, "Could not parse body of request message");
}
return DELETE_ME;
}
@@ -233,13 +233,13 @@ static status_t process_message(private_responder_init_t *this, message_t *messa
case NOTIFY:
{
notify_payload_t *notify_payload = (notify_payload_t *) payload;
- this->logger->log(this->logger, CONTROL|MORE, "Process notify type %s for protocol %s",
+ this->logger->log(this->logger, CONTROL|LEVEL1, "Process notify type %s for protocol %s",
mapping_find(notify_message_type_m, notify_payload->get_notify_message_type(notify_payload)),
mapping_find(protocol_id_m, notify_payload->get_protocol_id(notify_payload)));
if (notify_payload->get_protocol_id(notify_payload) != IKE)
{
- this->logger->log(this->logger, ERROR | MORE, "Notify not for IKE protocol.");
+ this->logger->log(this->logger, ERROR | LEVEL1, "Notify not for IKE protocol.");
payloads->destroy(payloads);
return DELETE_ME;
}
@@ -247,7 +247,7 @@ static status_t process_message(private_responder_init_t *this, message_t *messa
{
default:
{
- this->logger->log(this->logger, CONTROL|MORE, "Processing of notify type %s not yet implemented",
+ this->logger->log(this->logger, CONTROL|LEVEL1, "Processing of notify type %s not yet implemented",
mapping_find(notify_message_type_m, notify_payload->get_notify_message_type(notify_payload)));
break;
}
@@ -255,14 +255,14 @@ static status_t process_message(private_responder_init_t *this, message_t *messa
}
default:
{
- this->logger->log(this->logger, CONTROL | MORE, "Processing of Payload with Type number %d not implemented",payload->get_type(payload));
+ this->logger->log(this->logger, CONTROL | LEVEL1, "Processing of Payload with Type number %d not implemented",payload->get_type(payload));
break;
}
}
}
payloads->destroy(payloads);
- this->logger->log(this->logger, CONTROL | MORE, "Going to process received payloads");
+ this->logger->log(this->logger, CONTROL | LEVEL1, "Going to process received payloads");
this->ike_sa->build_message(this->ike_sa, IKE_SA_INIT, FALSE, &response);
status = this->build_sa_payload(this, sa_request, response);
@@ -290,7 +290,7 @@ static status_t process_message(private_responder_init_t *this, message_t *messa
}
/* store shared secret */
- this->logger->log(this->logger, CONTROL | MOST, "Retrieve shared secret and store it");
+ this->logger->log(this->logger, CONTROL | LEVEL2, "Retrieve shared secret and store it");
status = this->diffie_hellman->get_shared_secret(this->diffie_hellman, &shared_secret);
this->logger->log_chunk(this->logger, PRIVATE, "Shared Diffie Hellman secret", &shared_secret);
@@ -309,7 +309,7 @@ static status_t process_message(private_responder_init_t *this, message_t *messa
}
/* state can now be changed */
- this->logger->log(this->logger, CONTROL|MOST, "Create next state object of type IKE_SA_INIT_RESPONDED");
+ this->logger->log(this->logger, CONTROL|LEVEL2, "Create next state object of type IKE_SA_INIT_RESPONDED");
response = this->ike_sa->get_last_responded_message(this->ike_sa);
ike_sa_init_response_data = response->get_packet_data(response);
@@ -320,9 +320,9 @@ static status_t process_message(private_responder_init_t *this, message_t *messa
/* state can now be changed */
this->ike_sa->set_new_state(this->ike_sa, (state_t *) next_state);
/* state has NOW changed :-) */
- this->logger->log(this->logger, CONTROL|MORE, "Changed state of IKE_SA from %s to %s",mapping_find(ike_sa_state_m,RESPONDER_INIT),mapping_find(ike_sa_state_m,IKE_SA_INIT_RESPONDED) );
+ this->logger->log(this->logger, CONTROL|LEVEL1, "Changed state of IKE_SA from %s to %s",mapping_find(ike_sa_state_m,RESPONDER_INIT),mapping_find(ike_sa_state_m,IKE_SA_INIT_RESPONDED) );
- this->logger->log(this->logger, CONTROL|MOST, "Destroy old sate object");
+ this->logger->log(this->logger, CONTROL|LEVEL2, "Destroy old sate object");
this->destroy_after_state_change(this);
return SUCCESS;
@@ -342,12 +342,12 @@ static status_t build_sa_payload(private_responder_init_t *this,sa_payload_t *sa
init_config = this->ike_sa->get_init_config(this->ike_sa);
- this->logger->log(this->logger, CONTROL | MOST, "Process received SA payload");
+ this->logger->log(this->logger, CONTROL | LEVEL2, "Process received SA payload");
/* get the list of suggested proposals */
status = sa_request->get_ike_proposals (sa_request, &ike_proposals,&proposal_count);
if (status != SUCCESS)
{
- this->logger->log(this->logger, ERROR | MORE, "SA payload does not contain IKE proposals");
+ this->logger->log(this->logger, ERROR | LEVEL1, "SA payload does not contain IKE proposals");
this->send_notify_reply(this,NO_PROPOSAL_CHOSEN,CHUNK_INITIALIZER);
return DELETE_ME;
}
@@ -356,7 +356,7 @@ static status_t build_sa_payload(private_responder_init_t *this,sa_payload_t *sa
allocator_free(ike_proposals);
if (status != SUCCESS)
{
- this->logger->log(this->logger, ERROR | MORE, "No proposal of suggested proposals selected");
+ this->logger->log(this->logger, ERROR | LEVEL1, "No proposal of suggested proposals selected");
this->send_notify_reply(this,NO_PROPOSAL_CHOSEN,CHUNK_INITIALIZER);
return DELETE_ME;
}
@@ -366,15 +366,15 @@ static status_t build_sa_payload(private_responder_init_t *this,sa_payload_t *sa
status = this->ike_sa->create_transforms_from_proposal(this->ike_sa,&(selected_proposal));
if (status != SUCCESS)
{
- this->logger->log(this->logger, ERROR | MORE, "Transform objects could not be created from selected proposal");
+ this->logger->log(this->logger, ERROR | LEVEL1, "Transform objects could not be created from selected proposal");
return DELETE_ME;
}
- this->logger->log(this->logger, CONTROL | MOST, "SA Payload processed");
+ this->logger->log(this->logger, CONTROL | LEVEL2, "SA Payload processed");
- this->logger->log(this->logger, CONTROL|MOST, "Building SA payload");
+ this->logger->log(this->logger, CONTROL|LEVEL2, "Building SA payload");
sa_payload = sa_payload_create_from_ike_proposals(&(selected_proposal),1);
- this->logger->log(this->logger, CONTROL|MOST, "add SA payload to message");
+ this->logger->log(this->logger, CONTROL|LEVEL2, "add SA payload to message");
response->add_payload(response,(payload_t *) sa_payload);
return SUCCESS;
@@ -390,12 +390,12 @@ static status_t build_ke_payload(private_responder_init_t *this,ke_payload_t *ke
diffie_hellman_t *dh;
chunk_t key_data;
- this->logger->log(this->logger, CONTROL | MOST, "Process received KE payload");
+ this->logger->log(this->logger, CONTROL | LEVEL2, "Process received KE payload");
group = ke_request->get_dh_group_number(ke_request);
if (group == MODP_UNDEFINED)
{
- this->logger->log(this->logger, ERROR | MORE, "Diffie hellman group set to undefined!");
+ this->logger->log(this->logger, ERROR | LEVEL1, "Diffie hellman group set to undefined!");
return DELETE_ME;
}
if (this->dh_group_number != group)
@@ -404,7 +404,7 @@ static status_t build_ke_payload(private_responder_init_t *this,ke_payload_t *ke
chunk_t accepted_group_chunk;
/* group not same as selected one
* Maybe key exchange payload is before SA payload */
- this->logger->log(this->logger, ERROR | MORE, "Diffie hellman group not as in selected proposal!");
+ this->logger->log(this->logger, ERROR | LEVEL1, "Diffie hellman group not as in selected proposal!");
accepted_group = htons(this->dh_group_number);
accepted_group_chunk.ptr = (u_int8_t*) &(accepted_group);
@@ -420,15 +420,15 @@ static status_t build_ke_payload(private_responder_init_t *this,ke_payload_t *ke
this->logger->log(this->logger, ERROR, "Could not generate DH object with group %d",mapping_find(diffie_hellman_group_m,group) );
return DELETE_ME;
}
- this->logger->log(this->logger, CONTROL | MOST, "Set other DH public value");
+ this->logger->log(this->logger, CONTROL | LEVEL2, "Set other DH public value");
dh->set_other_public_value(dh, ke_request->get_key_exchange_data(ke_request));
this->diffie_hellman = dh;
- this->logger->log(this->logger, CONTROL | MOST, "KE Payload processed.");
+ this->logger->log(this->logger, CONTROL | LEVEL2, "KE Payload processed.");
- this->logger->log(this->logger, CONTROL|MOST, "Building KE payload");
+ this->logger->log(this->logger, CONTROL|LEVEL2, "Building KE payload");
this->diffie_hellman->get_my_public_value(this->diffie_hellman,&key_data);
ke_payload = ke_payload_create();
@@ -436,7 +436,7 @@ static status_t build_ke_payload(private_responder_init_t *this,ke_payload_t *ke
ke_payload->set_dh_group_number(ke_payload, this->dh_group_number);
allocator_free_chunk(&key_data);
- this->logger->log(this->logger, CONTROL|MOST, "Add KE payload to message");
+ this->logger->log(this->logger, CONTROL|LEVEL2, "Add KE payload to message");
response->add_payload(response,(payload_t *) ke_payload);
return SUCCESS;
@@ -450,23 +450,23 @@ static status_t build_nonce_payload(private_responder_init_t *this,nonce_payload
nonce_payload_t *nonce_payload;
randomizer_t *randomizer;
- this->logger->log(this->logger, CONTROL | MOST, "Process received NONCE payload");
+ this->logger->log(this->logger, CONTROL | LEVEL2, "Process received NONCE payload");
allocator_free(this->received_nonce.ptr);
this->received_nonce = CHUNK_INITIALIZER;
- this->logger->log(this->logger, CONTROL | MOST, "Get NONCE value and store it");
+ this->logger->log(this->logger, CONTROL | LEVEL2, "Get NONCE value and store it");
this->received_nonce = nonce_request->get_nonce(nonce_request);
- this->logger->log(this->logger, CONTROL | MOST, "Create new NONCE value.");
+ this->logger->log(this->logger, CONTROL | LEVEL2, "Create new NONCE value.");
randomizer = this->ike_sa->get_randomizer(this->ike_sa);
randomizer->allocate_pseudo_random_bytes(randomizer, NONCE_SIZE, &(this->sent_nonce));
- this->logger->log(this->logger, CONTROL|MOST, "Building NONCE payload");
+ this->logger->log(this->logger, CONTROL|LEVEL2, "Building NONCE payload");
nonce_payload = nonce_payload_create();
nonce_payload->set_nonce(nonce_payload, this->sent_nonce);
- this->logger->log(this->logger, CONTROL|MOST, "Add NONCE payload to message");
+ this->logger->log(this->logger, CONTROL|LEVEL2, "Add NONCE payload to message");
response->add_payload(response,(payload_t *) nonce_payload);
return SUCCESS;
@@ -491,21 +491,21 @@ static void send_notify_reply (private_responder_init_t *this,notify_message_typ
packet_t *packet;
status_t status;
- this->logger->log(this->logger, CONTROL|MOST, "Going to build message with notify payload");
+ this->logger->log(this->logger, CONTROL|LEVEL2, "Going to build message with notify payload");
/* set up the reply */
this->ike_sa->build_message(this->ike_sa, IKE_SA_INIT, FALSE, &response);
payload = notify_payload_create_from_protocol_and_type(IKE,type);
if ((data.ptr != NULL) && (data.len > 0))
{
- this->logger->log(this->logger, CONTROL|MOST, "Add Data to notify payload");
+ this->logger->log(this->logger, CONTROL|LEVEL2, "Add Data to notify payload");
payload->set_notification_data(payload,data);
}
- this->logger->log(this->logger, CONTROL|MOST, "Add Notify payload to message");
+ this->logger->log(this->logger, CONTROL|LEVEL2, "Add Notify payload to message");
response->add_payload(response,(payload_t *) payload);
/* generate packet */
- this->logger->log(this->logger, CONTROL|MOST, "Gnerate packet from message");
+ this->logger->log(this->logger, CONTROL|LEVEL2, "Gnerate packet from message");
status = response->generate(response, NULL, NULL, &packet);
if (status != SUCCESS)
{
@@ -513,9 +513,9 @@ static void send_notify_reply (private_responder_init_t *this,notify_message_typ
return;
}
- this->logger->log(this->logger, CONTROL|MOST, "Add packet to global send queue");
+ this->logger->log(this->logger, CONTROL|LEVEL2, "Add packet to global send queue");
charon->send_queue->add(charon->send_queue, packet);
- this->logger->log(this->logger, CONTROL|MOST, "Destroy message");
+ this->logger->log(this->logger, CONTROL|LEVEL2, "Destroy message");
response->destroy(response);
}
@@ -524,19 +524,19 @@ static void send_notify_reply (private_responder_init_t *this,notify_message_typ
*/
static void destroy(private_responder_init_t *this)
{
- this->logger->log(this->logger, CONTROL | MORE, "Going to destroy responder init state object");
+ this->logger->log(this->logger, CONTROL | LEVEL1, "Going to destroy responder init state object");
- this->logger->log(this->logger, CONTROL | MOST, "Destroy sent nonce");
+ this->logger->log(this->logger, CONTROL | LEVEL2, "Destroy sent nonce");
allocator_free_chunk(&(this->sent_nonce));
- this->logger->log(this->logger, CONTROL | MOST, "Destroy received nonce");
+ this->logger->log(this->logger, CONTROL | LEVEL2, "Destroy received nonce");
allocator_free_chunk(&(this->received_nonce));
if (this->diffie_hellman != NULL)
{
- this->logger->log(this->logger, CONTROL | MOST, "Destroy diffie_hellman_t hellman object");
+ this->logger->log(this->logger, CONTROL | LEVEL2, "Destroy diffie_hellman_t hellman object");
this->diffie_hellman->destroy(this->diffie_hellman);
}
- this->logger->log(this->logger, CONTROL | MOST, "Destroy object");
+ this->logger->log(this->logger, CONTROL | LEVEL2, "Destroy object");
allocator_free(this);
}
@@ -545,16 +545,16 @@ static void destroy(private_responder_init_t *this)
*/
static void destroy_after_state_change (private_responder_init_t *this)
{
- this->logger->log(this->logger, CONTROL | MORE, "Going to destroy responder_init_t state object");
+ this->logger->log(this->logger, CONTROL | LEVEL1, "Going to destroy responder_init_t state object");
/* destroy diffie hellman object */
if (this->diffie_hellman != NULL)
{
- this->logger->log(this->logger, CONTROL | MOST, "Destroy diffie_hellman_t object");
+ this->logger->log(this->logger, CONTROL | LEVEL2, "Destroy diffie_hellman_t object");
this->diffie_hellman->destroy(this->diffie_hellman);
}
- this->logger->log(this->logger, CONTROL | MOST, "Destroy object");
+ this->logger->log(this->logger, CONTROL | LEVEL2, "Destroy object");
allocator_free(this);
}