* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
*/
+#define NETDISSECT_REWORKED
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
-#include <string.h>
-
#include <tcpdump-stdinc.h>
+#include <string.h>
#include <stdlib.h>
/* Any code in this file that depends on HAVE_LIBCRYPTO depends on
#endif
#endif
-#include <stdio.h>
-
#include "ip.h"
#ifdef INET6
#include "ip6.h"
#endif
-#include "netdissect.h"
+#include "interface.h"
#include "extract.h"
/*
*/
struct newesp {
- u_int32_t esp_spi; /* ESP */
- u_int32_t esp_seq; /* Sequence number */
+ uint32_t esp_spi; /* ESP */
+ uint32_t esp_seq; /* Sequence number */
/*variable size*/ /* (IV and) Payload data */
/*variable size*/ /* padding */
/*8bit*/ /* pad size */
struct sa_list *next;
u_int daddr_version;
union inaddr_u daddr;
- u_int32_t spi; /* if == 0, then IKEv2 */
+ uint32_t spi; /* if == 0, then IKEv2 */
int initiator;
u_char spii[8]; /* for IKEv2 */
u_char spir[8];
if (spikey) {
char *spistr, *foo;
- u_int32_t spino;
+ uint32_t spino;
spistr = strsep(&spikey, "@");
ep = ndo->ndo_snapend;
if ((u_char *)(esp + 1) >= ep) {
- fputs("[|ESP]", stdout);
+ ND_PRINT((ndo, "[|ESP]"));
goto fail;
}
- (*ndo->ndo_printf)(ndo, "ESP(spi=0x%08x", EXTRACT_32BITS(&esp->esp_spi));
- (*ndo->ndo_printf)(ndo, ",seq=0x%x)", EXTRACT_32BITS(&esp->esp_seq));
- (*ndo->ndo_printf)(ndo, ", length %u", length);
+ ND_PRINT((ndo, "ESP(spi=0x%08x", EXTRACT_32BITS(&esp->esp_spi)));
+ ND_PRINT((ndo, ",seq=0x%x)", EXTRACT_32BITS(&esp->esp_seq)));
+ ND_PRINT((ndo, ", length %u", length));
#ifndef HAVE_LIBCRYPTO
goto fail;
if (nhdr)
*nhdr = *(ep - 1);
- (ndo->ndo_printf)(ndo, ": ");
+ ND_PRINT((ndo, ": "));
return advance;
#endif