From: Martin Willi Date: Tue, 23 Nov 2010 09:12:32 +0000 (+0100) Subject: Show SPI in proposal logging hook X-Git-Tag: 4.5.1~268 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f2116c6de7f19e3cbc3d1a289e5045a705eeb927;p=thirdparty%2Fstrongswan.git Show SPI in proposal logging hook --- diff --git a/src/conftest/hooks/log_proposals.c b/src/conftest/hooks/log_proposals.c index 521fa37b4d..8c330ab3de 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));