Show SPI in proposal logging hook
authorMartin Willi <martin@revosec.ch>
Tue, 23 Nov 2010 09:12:32 +0000 (10:12 +0100)
committerMartin Willi <martin@revosec.ch>
Wed, 5 Jan 2011 15:45:48 +0000 (16:45 +0100)
src/conftest/hooks/log_proposals.c

index 521fa37..8c330ab 100644 (file)
@@ -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));