summaryrefslogtreecommitdiff
path: root/src/conftest/hooks
diff options
context:
space:
mode:
authorRené Mayrhofer <rene@mayrhofer.eu.org>2011-05-19 13:37:29 +0200
committerRené Mayrhofer <rene@mayrhofer.eu.org>2011-05-19 13:37:29 +0200
commit0a9d51a49042a68daa15b0c74a2b7f152f52606b (patch)
tree451888dcb17d00e52114f734e846821373fbbd44 /src/conftest/hooks
parent568905f488e63e28778f87ac0e38d845f45bae79 (diff)
downloadvyos-strongswan-0a9d51a49042a68daa15b0c74a2b7f152f52606b.tar.gz
vyos-strongswan-0a9d51a49042a68daa15b0c74a2b7f152f52606b.zip
Imported Upstream version 4.5.2
Diffstat (limited to 'src/conftest/hooks')
-rw-r--r--src/conftest/hooks/log_ts.c24
1 files changed, 21 insertions, 3 deletions
diff --git a/src/conftest/hooks/log_ts.c b/src/conftest/hooks/log_ts.c
index dacc7a58c..fb7c89a0a 100644
--- a/src/conftest/hooks/log_ts.c
+++ b/src/conftest/hooks/log_ts.c
@@ -38,7 +38,6 @@ METHOD(listener_t, message, bool,
{
enumerator_t *enumerator;
payload_t *payload;
- linked_list_t *list;
ts_payload_t *ts;
enumerator = message->create_payload_enumerator(message);
@@ -48,10 +47,29 @@ METHOD(listener_t, message, bool,
payload->get_type(payload) == TRAFFIC_SELECTOR_RESPONDER)
{
ts = (ts_payload_t*)payload;
+ host_t *from, *to;
+ linked_list_t *list;
+ enumerator_t *tsenum;
+ traffic_selector_t *selector;
+
list = ts->get_traffic_selectors(ts);
+ tsenum = list->create_enumerator(list);
+ while (tsenum->enumerate(tsenum, &selector))
+ {
+ from = host_create_from_chunk(AF_UNSPEC,
+ selector->get_from_address(selector), 0);
+ to = host_create_from_chunk(AF_UNSPEC,
+ selector->get_to_address(selector), 0);
+
+ DBG1(DBG_CFG, "received %N: %N %H-%H proto %u port %u-%u",
+ payload_type_short_names, payload->get_type(payload),
+ ts_type_name, selector->get_type(selector),
+ from, to, selector->get_protocol(selector),
+ selector->get_from_port(selector),
+ selector->get_to_port(selector));
+ }
+ tsenum->destroy(tsenum);
- DBG1(DBG_CFG, "received %N: %#R",
- payload_type_short_names, payload->get_type(payload), list);
list->destroy_offset(list, offsetof(traffic_selector_t, destroy));
}
}