diff options
author | Martin Willi <martin@strongswan.org> | 2006-09-27 14:14:44 +0000 |
---|---|---|
committer | Martin Willi <martin@strongswan.org> | 2006-09-27 14:14:44 +0000 |
commit | 47f5027807c10d52d6122b9bba590e8ec6e02a95 (patch) | |
tree | a266c227832e46b6f60ee0c790e08b977e52ba61 /src/charon/config | |
parent | f91513e33374114b8a5c5418ab56a3545b9718ce (diff) | |
download | strongswan-47f5027807c10d52d6122b9bba590e8ec6e02a95.tar.bz2 strongswan-47f5027807c10d52d6122b9bba590e8ec6e02a95.tar.xz |
introduced printf() specifiers for:
host_t (%H)
identification_t (%D)
chunk pointers (%B)
memory pointer/length (%b)
added a signaling bus:
receives event and debug messages, sends them to its listeners
stream_logger, sys_logger, file_logger added, listen to bus
some other tweaks here and there
Diffstat (limited to 'src/charon/config')
-rw-r--r-- | src/charon/config/connections/local_connection_store.c | 21 | ||||
-rw-r--r-- | src/charon/config/credentials/local_credential_store.c | 4 | ||||
-rw-r--r-- | src/charon/config/policies/local_policy_store.c | 21 |
3 files changed, 18 insertions, 28 deletions
diff --git a/src/charon/config/connections/local_connection_store.c b/src/charon/config/connections/local_connection_store.c index 72265b5f0..af107b83b 100644 --- a/src/charon/config/connections/local_connection_store.c +++ b/src/charon/config/connections/local_connection_store.c @@ -74,8 +74,9 @@ static connection_t *get_connection_by_hosts(private_local_connection_store_t *t connection_t *candidate; connection_t *found = NULL; - this->logger->log(this->logger, CONTROL|LEVEL1, "looking for connection for host pair %s...%s", - my_host->get_string(my_host), other_host->get_string(other_host)); + this->logger->log(this->logger, CONTROL|LEVEL1, + "looking for connection for host pair %H...%H", + my_host, other_host); pthread_mutex_lock(&(this->mutex)); iterator = this->connections->create_iterator(this->connections, TRUE); @@ -106,10 +107,9 @@ static connection_t *get_connection_by_hosts(private_local_connection_store_t *t } this->logger->log(this->logger, CONTROL|LEVEL2, - "candidate connection \"%s\": %s...%s (prio=%d)", + "candidate connection \"%s\": %H...%H (prio=%d)", candidate->get_name(candidate), - candidate_my_host->get_string(candidate_my_host), - candidate_other_host->get_string(candidate_other_host), + candidate_my_host, candidate_other_host, prio); if (prio > best_prio) @@ -127,10 +127,9 @@ static connection_t *get_connection_by_hosts(private_local_connection_store_t *t host_t *found_other_host = found->get_other_host(found); this->logger->log(this->logger, CONTROL|LEVEL1, - "found matching connection \"%s\": %s...%s (prio=%d)", + "found matching connection \"%s\": %H...%H (prio=%d)", found->get_name(found), - found_my_host->get_string(found_my_host), - found_other_host->get_string(found_other_host), + found_my_host, found_other_host, best_prio); /* give out a new reference to it */ @@ -242,10 +241,8 @@ void log_connections(private_local_connection_store_t *this, logger_t *logger, c host_t *my_host = current->get_my_host(current); host_t *other_host = current->get_other_host(current); - logger->log(logger, CONTROL, " \"%s\": %s...%s", - current->get_name(current), - my_host->get_string(my_host), - other_host->get_string(other_host)); + logger->log(logger, CONTROL, " \"%s\": %H...%H", + current->get_name(current), my_host, other_host); } } iterator->destroy(iterator); diff --git a/src/charon/config/credentials/local_credential_store.c b/src/charon/config/credentials/local_credential_store.c index db29472eb..e69418639 100644 --- a/src/charon/config/credentials/local_credential_store.c +++ b/src/charon/config/credentials/local_credential_store.c @@ -504,8 +504,8 @@ static bool verify(private_local_credential_store_t *this, x509_t *cert, bool *f identification_t *subject = cert->get_subject(cert); identification_t *issuer = cert->get_issuer(cert); - this->logger->log(this->logger, CONTROL|LEVEL1, "subject: '%s'", subject->get_string(subject)); - this->logger->log(this->logger, CONTROL|LEVEL1, "issuer: '%s'", issuer->get_string(issuer)); + this->logger->log(this->logger, CONTROL|LEVEL1, "subject: '%D'", subject); + this->logger->log(this->logger, CONTROL|LEVEL1, "issuer: '%D'", issuer); ugh = cert->is_valid(cert, &until); if (ugh != NULL) diff --git a/src/charon/config/policies/local_policy_store.c b/src/charon/config/policies/local_policy_store.c index 1ad0aaa9d..5253cb3fa 100644 --- a/src/charon/config/policies/local_policy_store.c +++ b/src/charon/config/policies/local_policy_store.c @@ -116,8 +116,8 @@ static policy_t *get_policy(private_local_policy_store_t *this, policy_t *candidate; policy_t *found = NULL; - this->logger->log(this->logger, CONTROL|LEVEL1, "searching policy for ID pair %s...%s", - my_id->get_string(my_id), other_id->get_string(other_id)); + this->logger->log(this->logger, CONTROL|LEVEL1, + "searching policy for ID pair %D...%D", my_id, other_id); pthread_mutex_lock(&(this->mutex)); iterator = this->policies->create_iterator(this->policies, TRUE); @@ -151,19 +151,14 @@ static policy_t *get_policy(private_local_policy_store_t *this, { this->logger->log(this->logger, CONTROL|LEVEL2, "candidate '%s' inacceptable due traffic selector mismatch", - candidate->get_name(candidate), - candidate_my_id->get_string(candidate_my_id), - candidate_other_id->get_string(candidate_other_id), - prio); + candidate->get_name(candidate)); continue; } this->logger->log(this->logger, CONTROL|LEVEL2, - "candidate policy '%s': %s...%s (prio=%d)", + "candidate policy '%s': %D...%D (prio=%d)", candidate->get_name(candidate), - candidate_my_id->get_string(candidate_my_id), - candidate_other_id->get_string(candidate_other_id), - prio); + candidate_my_id, candidate_other_id, prio); if (prio > best_prio) { @@ -180,11 +175,9 @@ static policy_t *get_policy(private_local_policy_store_t *this, identification_t *found_other_id = found->get_other_id(found); this->logger->log(this->logger, CONTROL, - "found matching policy '%s': %s...%s (prio=%d)", + "found matching policy '%s': %D...%D (prio=%d)", found->get_name(found), - found_my_id->get_string(found_my_id), - found_other_id->get_string(found_other_id), - best_prio); + found_my_id, found_other_id, best_prio); /* give out a new reference to it */ found->get_ref(found); } |