X-Git-Url: https://git.tcpdump.org/tcpdump/blobdiff_plain/fb2479d733dbe8a991d11909b319341f7db62ab1..5ef0bcb5edd748de9d9af13c40da0395dfdd94e8:/print-ah.c diff --git a/print-ah.c b/print-ah.c index 2f58716b..734099cf 100644 --- a/print-ah.c +++ b/print-ah.c @@ -40,25 +40,22 @@ ah_print(netdissect_options *ndo, const u_char *bp) const struct ah *ah; u_int sumlen; + ndo->ndo_protocol = "ah"; ah = (const struct ah *)bp; ND_TCHECK_SIZE(ah); - sumlen = EXTRACT_U_1(ah->ah_len) << 2; + sumlen = GET_U_1(ah->ah_len) << 2; - ND_PRINT("AH(spi=0x%08x", EXTRACT_BE_U_4(ah->ah_spi)); + ND_PRINT("AH(spi=0x%08x", GET_BE_U_4(ah->ah_spi)); if (ndo->ndo_vflag) ND_PRINT(",sumlen=%u", sumlen); - ND_TCHECK_4(ah + 1); - ND_PRINT(",seq=0x%x", EXTRACT_BE_U_4(ah + 1)); - if (!ND_TTEST_LEN(bp, sizeof(struct ah) + sumlen)) { - ND_PRINT("[truncated]):"); - return -1; - } + ND_PRINT(",seq=0x%x", GET_BE_U_4(ah + 1)); + ND_TCHECK_LEN(bp, sizeof(struct ah) + sumlen); ND_PRINT("): "); return sizeof(struct ah) + sumlen; trunc: - ND_PRINT("[|AH]"); + nd_print_trunc(ndo); return -1; }