]> The Tcpdump Group git mirrors - tcpdump/blobdiff - print-enc.c
Use more the ND_TTEST_1() macro
[tcpdump] / print-enc.c
index 445bc4a97e8974f43957beaf4f87c51822df1ad4..c3fcf10c7da0d287c590282092b09bfbe82ad464 100644 (file)
  * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
  */
 
+/* \summary: OpenBSD IPsec encapsulation BPF layer printer */
+
 #ifdef HAVE_CONFIG_H
 #include "config.h"
 #endif
 
-#include <tcpdump-stdinc.h>
+#include <netdissect-stdinc.h>
 
-#include "interface.h"
+#include "netdissect.h"
 #include "extract.h"
 
 /* From $OpenBSD: if_enc.h,v 1.8 2001/06/25 05:14:00 angelos Exp $ */
@@ -85,10 +87,10 @@ struct enchdr {
 
 u_int
 enc_if_print(netdissect_options *ndo,
-             const struct pcap_pkthdr *h, register const u_char *p)
+             const struct pcap_pkthdr *h, const u_char *p)
 {
-       register u_int length = h->len;
-       register u_int caplen = h->caplen;
+       u_int length = h->len;
+       u_int caplen = h->caplen;
        int flags;
        const struct enchdr *hdr;
 
@@ -106,7 +108,7 @@ enc_if_print(netdissect_options *ndo,
        ENC_PRINT_TYPE(flags, M_AUTH, "authentic");
        ENC_PRINT_TYPE(flags, M_CONF, "confidential");
        /* ENC_PRINT_TYPE(flags, M_TUNNEL, "tunnel"); */
-       ND_PRINT((ndo, "SPI 0x%08x: ", EXTRACT_32BITS(&hdr->spi)));
+       ND_PRINT((ndo, "SPI 0x%08x: ", EXTRACT_BE_U_4(&hdr->spi)));
 
        length -= ENC_HDRLEN;
        caplen -= ENC_HDRLEN;