]> The Tcpdump Group git mirrors - tcpdump/blobdiff - print-ah.c
Update from current NetBSD version of ieee80211_radiotap.h.
[tcpdump] / print-ah.c
index aab575786a86d0a0f35da46733ba0e400031ba31..ecd106b73806d48bb3d6cfedc1504626d24ff377 100644 (file)
@@ -22,8 +22,8 @@
  */
 
 #ifndef lint
-static const char rcsid[] =
-    "@(#) $Header: /tcpdump/master/tcpdump/print-ah.c,v 1.18 2002-09-05 21:25:36 guy Exp $ (LBL)";
+static const char rcsid[] _U_ =
+    "@(#) $Header: /tcpdump/master/tcpdump/print-ah.c,v 1.22 2003-11-19 00:36:06 guy Exp $ (LBL)";
 #endif
 
 #ifdef HAVE_CONFIG_H
@@ -38,6 +38,7 @@ static const char rcsid[] =
 
 #include "interface.h"
 #include "addrtoname.h"
+#include "extract.h"
 
 int
 ah_print(register const u_char *bp)
@@ -53,12 +54,12 @@ ah_print(register const u_char *bp)
        TCHECK(*ah);
 
        sumlen = ah->ah_len << 2;
-       spi = (u_int32_t)ntohl(ah->ah_spi);
+       spi = EXTRACT_32BITS(&ah->ah_spi);
 
        printf("AH(spi=0x%08x", spi);
        if (vflag)
                printf(",sumlen=%d", sumlen);
-       printf(",seq=0x%x", (u_int32_t)ntohl(*(const u_int32_t *)(ah + 1)));
+       printf(",seq=0x%x", EXTRACT_32BITS(ah + 1));
        if (bp + sizeof(struct ah) + sumlen > ep)
                fputs("[truncated]", stdout);
        fputs("): ", stdout);
@@ -66,5 +67,5 @@ ah_print(register const u_char *bp)
        return sizeof(struct ah) + sumlen;
  trunc:
        fputs("[|AH]", stdout);
-       return 65535;
+       return -1;
 }