From f2116c6de7f19e3cbc3d1a289e5045a705eeb927 Mon Sep 17 00:00:00 2001 From: Martin Willi Date: Tue, 23 Nov 2010 10:12:32 +0100 Subject: Show SPI in proposal logging hook --- src/conftest/hooks/log_proposals.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'src/conftest/hooks/log_proposals.c') diff --git a/src/conftest/hooks/log_proposals.c b/src/conftest/hooks/log_proposals.c index 521fa37b4..8c330ab3d 100644 --- a/src/conftest/hooks/log_proposals.c +++ b/src/conftest/hooks/log_proposals.c @@ -54,8 +54,14 @@ METHOD(listener_t, message, bool, proposals = list->create_enumerator(list); while (proposals->enumerate(proposals, &proposal)) { - DBG1(DBG_CFG, " %d: %P", - proposal->get_number(proposal), proposal); + u_int64_t spi = proposal->get_spi(proposal); + + if (proposal->get_protocol(proposal) != PROTO_IKE) + { + spi = htonl(spi); + } + DBG1(DBG_CFG, " %d (SPI 0x%llx): %P", + proposal->get_number(proposal), spi, proposal); } proposals->destroy(proposals); list->destroy_offset(list, offsetof(proposal_t, destroy)); -- cgit v1.2.3