- some logging improvements and cosmetics

This commit is contained in:
Martin Willi
2006-05-24 11:59:58 +00:00
parent 3a13a78084
commit 65996a534d
5 changed files with 63 additions and 19 deletions
+4 -3
View File
@@ -559,8 +559,9 @@ static status_t generate(private_message_t *this, crypter_t *crypter, signer_t*
status_t status;
chunk_t packet_data;
this->logger->log(this->logger, CONTROL, "Generating message of type %s, contains %d payloads",
this->logger->log(this->logger, CONTROL, "Generating %s %s, contains %d payloads",
mapping_find(exchange_type_m,this->exchange_type),
this->is_request ? "request" : "response",
this->payloads->get_count(this->payloads));
if (this->exchange_type == EXCHANGE_TYPE_UNDEFINED)
@@ -717,7 +718,7 @@ static status_t parse_header(private_message_t *this)
this->minor_version = ike_header->get_min_version(ike_header);
this->first_payload = ike_header->payload_interface.get_next_type(&(ike_header->payload_interface));
this->logger->log(this->logger, CONTROL, "Parsed a %s %s",
this->logger->log(this->logger, CONTROL|LEVEL1, "Parsed a %s %s",
mapping_find(exchange_type_m, this->exchange_type),
this->is_request ? "request" : "response");
@@ -810,7 +811,7 @@ static status_t parse_body(private_message_t *this, crypter_t *crypter, signer_t
this->logger->log(this->logger, ERROR, "Verification of message failed");
}
this->logger->log(this->logger, CONTROL, "Message %s %s contains %d payloads",
this->logger->log(this->logger, CONTROL, "Parsed %s %s, contains %d payloads",
mapping_find(exchange_type_m, this->exchange_type),
this->is_request ? "request" : "response",
this->payloads->get_count(this->payloads));
+3 -1
View File
@@ -974,6 +974,7 @@ static status_t delete_(private_ike_sa_t *this)
delete_payload_t *delete_payload;
u_int32_t timeout;
delete_half_open_ike_sa_job_t *job;
state_t *old_state;
if (get_state(this) != IKE_SA_ESTABLISHED)
{
@@ -995,8 +996,9 @@ static status_t delete_(private_ike_sa_t *this)
}
/* transit to state delete_requested */
this->current_state->destroy(this->current_state);
old_state = this->current_state;
set_new_state(this, (state_t*)delete_requested_create(this));
old_state->destroy(old_state);
/* there is no guarantee that the other peer will acknowledge the delete,
* so we have to set a timeout where we destroy the SA... This is done with
+6 -2
View File
@@ -184,6 +184,7 @@ static status_t process_message(private_ike_auth_requested_t *this, message_t *i
signer_t *signer = NULL;
status_t status;
host_t *my_host, *other_host;
identification_t *my_id, *other_id;
chunk_t seed;
prf_plus_t *prf_plus;
connection_t *connection;
@@ -361,8 +362,11 @@ static status_t process_message(private_ike_auth_requested_t *this, message_t *i
connection = this->ike_sa->get_connection(this->ike_sa);
my_host = connection->get_my_host(connection);
other_host = connection->get_other_host(connection);
this->logger->log(this->logger, AUDIT, "IKE_SA established between %s - %s",
my_host->get_address(my_host), other_host->get_address(other_host));
my_id = connection->get_my_id(connection);
other_id = connection->get_other_id(connection);
this->logger->log(this->logger, AUDIT, "IKE_SA established %s[%s]...%s[%s]",
my_host->get_address(my_host), my_id->get_string(my_id),
other_host->get_address(other_host), other_id->get_string(other_id));
return SUCCESS;
}
+6 -2
View File
@@ -183,6 +183,7 @@ static status_t process_message(private_ike_sa_init_responded_t *this, message_t
signer_t *signer;
status_t status;
host_t *my_host, *other_host;
identification_t *my_id, *other_id;
connection_t *connection;
if (request->get_exchange_type(request) != IKE_AUTH)
@@ -367,8 +368,11 @@ static status_t process_message(private_ike_sa_init_responded_t *this, message_t
connection = this->ike_sa->get_connection(this->ike_sa);
my_host = connection->get_my_host(connection);
other_host = connection->get_other_host(connection);
this->logger->log(this->logger, AUDIT, "IKE_SA established between %s - %s",
my_host->get_address(my_host), other_host->get_address(other_host));
my_id = connection->get_my_id(connection);
other_id = connection->get_other_id(connection);
this->logger->log(this->logger, AUDIT, "IKE_SA established %s[%s]...%s[%s]",
my_host->get_address(my_host), my_id->get_string(my_id),
other_host->get_address(other_host), other_id->get_string(other_id));
return SUCCESS;
}