Log peer cfg enumeration externally for flexibility

This commit is contained in:
Martin Willi
2012-03-20 17:31:17 +01:00
parent d7376e2ab4
commit 033dfba01f
3 changed files with 7 additions and 5 deletions
-3
View File
@@ -347,9 +347,6 @@ METHOD(backend_manager_t, create_peer_cfg_enumerator, enumerator_t*,
return enumerator; return enumerator;
} }
DBG1(DBG_CFG, "looking for peer configs matching %H[%Y]...%H[%Y]",
me, my_id, other, other_id);
configs = linked_list_create(); configs = linked_list_create();
/* only once allocated helper list for sorting */ /* only once allocated helper list for sorting */
helper = linked_list_create(); helper = linked_list_create();
+2
View File
@@ -269,6 +269,8 @@ static bool load_cfg_candidates(private_ike_auth_t *this)
my_id = this->ike_sa->get_my_id(this->ike_sa); my_id = this->ike_sa->get_my_id(this->ike_sa);
other_id = this->ike_sa->get_other_id(this->ike_sa); other_id = this->ike_sa->get_other_id(this->ike_sa);
DBG1(DBG_CFG, "looking for peer configs matching %H[%Y]...%H[%Y]",
me, my_id, other, other_id);
enumerator = charon->backends->create_peer_cfg_enumerator(charon->backends, enumerator = charon->backends->create_peer_cfg_enumerator(charon->backends,
me, other, my_id, other_id); me, other, my_id, other_id);
while (enumerator->enumerate(enumerator, &peer_cfg)) while (enumerator->enumerate(enumerator, &peer_cfg))
+5 -2
View File
@@ -334,10 +334,13 @@ static peer_cfg_t *select_config(private_main_mode_t *this, identification_t *id
{ {
enumerator_t *enumerator; enumerator_t *enumerator;
peer_cfg_t *current, *found = NULL; peer_cfg_t *current, *found = NULL;
host_t *me, *other;
me = this->ike_sa->get_my_host(this->ike_sa);
other = this->ike_sa->get_other_host(this->ike_sa);
DBG1(DBG_CFG, "looking for peer configs matching %H...%H[%Y]", me, other, id);
enumerator = charon->backends->create_peer_cfg_enumerator(charon->backends, enumerator = charon->backends->create_peer_cfg_enumerator(charon->backends,
this->ike_sa->get_my_host(this->ike_sa), me, other, NULL, id);
this->ike_sa->get_other_host(this->ike_sa), NULL, id);
while (enumerator->enumerate(enumerator, &current)) while (enumerator->enumerate(enumerator, &current))
{ {
if (get_auth_method(this, current) == this->auth_method) if (get_auth_method(this, current) == this->auth_method)