child-cfg: Allow suppressing log messages when selecting traffic selectors
Although being already logged on level 2, these messages are usually just confusing if they pop up randomly in the log when e.g. querying the configs or installing traps. So after this the log messages will only be logged when actually proposing or selecting traffic selectors during IKE.
This commit is contained in:
@@ -324,10 +324,12 @@ static void request_query_config(xmlTextReaderPtr reader, xmlTextWriterPtr write
|
||||
xmlTextWriterStartElement(writer, "childconfig");
|
||||
xmlTextWriterWriteElement(writer, "name",
|
||||
child_cfg->get_name(child_cfg));
|
||||
list = child_cfg->get_traffic_selectors(child_cfg, TRUE, NULL, NULL);
|
||||
list = child_cfg->get_traffic_selectors(child_cfg, TRUE, NULL,
|
||||
NULL, FALSE);
|
||||
write_networks(writer, "local", list);
|
||||
list->destroy_offset(list, offsetof(traffic_selector_t, destroy));
|
||||
list = child_cfg->get_traffic_selectors(child_cfg, FALSE, NULL, NULL);
|
||||
list = child_cfg->get_traffic_selectors(child_cfg, FALSE, NULL,
|
||||
NULL, FALSE);
|
||||
write_networks(writer, "remote", list);
|
||||
list->destroy_offset(list, offsetof(traffic_selector_t, destroy));
|
||||
xmlTextWriterEndElement(writer);
|
||||
|
||||
@@ -580,8 +580,10 @@ METHOD(stroke_list_t, status, void,
|
||||
children = peer_cfg->create_child_cfg_enumerator(peer_cfg);
|
||||
while (children->enumerate(children, &child_cfg))
|
||||
{
|
||||
my_ts = child_cfg->get_traffic_selectors(child_cfg, TRUE, NULL, NULL);
|
||||
other_ts = child_cfg->get_traffic_selectors(child_cfg, FALSE, NULL, NULL);
|
||||
my_ts = child_cfg->get_traffic_selectors(child_cfg, TRUE,
|
||||
NULL, NULL, FALSE);
|
||||
other_ts = child_cfg->get_traffic_selectors(child_cfg, FALSE,
|
||||
NULL, NULL, FALSE);
|
||||
fprintf(out, "%12s: child: %#R === %#R %N",
|
||||
child_cfg->get_name(child_cfg), my_ts, other_ts,
|
||||
ipsec_mode_names, child_cfg->get_mode(child_cfg));
|
||||
@@ -614,8 +616,10 @@ METHOD(stroke_list_t, status, void,
|
||||
fprintf(out, "Shunted Connections:\n");
|
||||
first = FALSE;
|
||||
}
|
||||
my_ts = child_cfg->get_traffic_selectors(child_cfg, TRUE, NULL, NULL);
|
||||
other_ts = child_cfg->get_traffic_selectors(child_cfg, FALSE, NULL, NULL);
|
||||
my_ts = child_cfg->get_traffic_selectors(child_cfg, TRUE, NULL,
|
||||
NULL, FALSE);
|
||||
other_ts = child_cfg->get_traffic_selectors(child_cfg, FALSE, NULL,
|
||||
NULL, FALSE);
|
||||
fprintf(out, "%12s: %#R === %#R %N\n",
|
||||
child_cfg->get_name(child_cfg), my_ts, other_ts,
|
||||
ipsec_mode_names, child_cfg->get_mode(child_cfg));
|
||||
|
||||
@@ -56,7 +56,7 @@ static void narrow_ts(child_cfg_t *cfg, traffic_selector_t *ts,
|
||||
|
||||
received = linked_list_create();
|
||||
received->insert_last(received, ts);
|
||||
selected = cfg->get_traffic_selectors(cfg, FALSE, received, NULL);
|
||||
selected = cfg->get_traffic_selectors(cfg, FALSE, received, NULL, FALSE);
|
||||
while (selected->remove_first(selected, (void**)&ts) == SUCCESS)
|
||||
{
|
||||
list->insert_last(list, ts);
|
||||
@@ -140,7 +140,8 @@ static void narrow_responder_post(child_cfg_t *child_cfg, linked_list_t *local)
|
||||
{
|
||||
ts->destroy(ts);
|
||||
}
|
||||
configured = child_cfg->get_traffic_selectors(child_cfg, TRUE, NULL, NULL);
|
||||
configured = child_cfg->get_traffic_selectors(child_cfg, TRUE, NULL, NULL,
|
||||
FALSE);
|
||||
|
||||
while (configured->remove_first(configured, (void**)&ts) == SUCCESS)
|
||||
{
|
||||
|
||||
@@ -160,7 +160,8 @@ METHOD(attribute_provider_t, create_attribute_enumerator, enumerator_t*,
|
||||
enumerator = peer_cfg->create_child_cfg_enumerator(peer_cfg);
|
||||
while (enumerator->enumerate(enumerator, &child_cfg))
|
||||
{
|
||||
current = child_cfg->get_traffic_selectors(child_cfg, TRUE, NULL, NULL);
|
||||
current = child_cfg->get_traffic_selectors(child_cfg, TRUE, NULL, NULL,
|
||||
FALSE);
|
||||
while (current->remove_first(current, (void**)&ts) == SUCCESS)
|
||||
{
|
||||
if (use_ts(ts))
|
||||
|
||||
@@ -570,7 +570,7 @@ static void raise_policy_cfg(private_vici_query_t *this, u_int id, char *ike,
|
||||
list_mode(b, NULL, cfg);
|
||||
|
||||
b->begin_list(b, "local-ts");
|
||||
list = cfg->get_traffic_selectors(cfg, TRUE, NULL, NULL);
|
||||
list = cfg->get_traffic_selectors(cfg, TRUE, NULL, NULL, FALSE);
|
||||
enumerator = list->create_enumerator(list);
|
||||
while (enumerator->enumerate(enumerator, &ts))
|
||||
{
|
||||
@@ -581,7 +581,7 @@ static void raise_policy_cfg(private_vici_query_t *this, u_int id, char *ike,
|
||||
b->end_list(b /* local-ts */);
|
||||
|
||||
b->begin_list(b, "remote-ts");
|
||||
list = cfg->get_traffic_selectors(cfg, FALSE, NULL, NULL);
|
||||
list = cfg->get_traffic_selectors(cfg, FALSE, NULL, NULL, FALSE);
|
||||
enumerator = list->create_enumerator(list);
|
||||
while (enumerator->enumerate(enumerator, &ts))
|
||||
{
|
||||
@@ -873,7 +873,8 @@ CALLBACK(list_conns, vici_message_t*,
|
||||
child_cfg->get_close_action(child_cfg));
|
||||
|
||||
b->begin_list(b, "local-ts");
|
||||
list = child_cfg->get_traffic_selectors(child_cfg, TRUE, NULL, NULL);
|
||||
list = child_cfg->get_traffic_selectors(child_cfg, TRUE, NULL,
|
||||
NULL, FALSE);
|
||||
selectors = list->create_enumerator(list);
|
||||
while (selectors->enumerate(selectors, &ts))
|
||||
{
|
||||
@@ -884,7 +885,8 @@ CALLBACK(list_conns, vici_message_t*,
|
||||
b->end_list(b /* local-ts */);
|
||||
|
||||
b->begin_list(b, "remote-ts");
|
||||
list = child_cfg->get_traffic_selectors(child_cfg, FALSE, NULL, NULL);
|
||||
list = child_cfg->get_traffic_selectors(child_cfg, FALSE, NULL,
|
||||
NULL, FALSE);
|
||||
selectors = list->create_enumerator(list);
|
||||
while (selectors->enumerate(selectors, &ts))
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user