From: hannes Date: Fri, 16 Jul 2004 14:05:59 +0000 (+0000) Subject: print the packet length for ESP packets X-Git-Tag: tcpdump-3.9.1~306 X-Git-Url: https://git.tcpdump.org/tcpdump/commitdiff_plain/89e2e0c7bedb2d3ea19b90dea2c1d31198307961?ds=sidebyside print the packet length for ESP packets --- diff --git a/netdissect.h b/netdissect.h index e471ace4..86621472 100644 --- a/netdissect.h +++ b/netdissect.h @@ -21,7 +21,7 @@ * WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * - * @(#) $Header: /tcpdump/master/tcpdump/netdissect.h,v 1.8 2004-04-30 16:42:14 mcr Exp $ (LBL) + * @(#) $Header: /tcpdump/master/tcpdump/netdissect.h,v 1.9 2004-07-16 14:06:00 hannes Exp $ (LBL) */ #ifndef netdissect_h @@ -239,7 +239,7 @@ extern const char *dnnum_string(netdissect_options *, u_short); extern void eap_print(netdissect_options *,const u_char *, u_int); extern int esp_print(netdissect_options *, - register const u_char *bp, register const u_char *bp2, + register const u_char *bp, int len, register const u_char *bp2, int *nhdr, int *padlen); extern void arp_print(netdissect_options *,const u_char *, u_int, u_int); diff --git a/print-esp.c b/print-esp.c index 25303e30..08bb8915 100644 --- a/print-esp.c +++ b/print-esp.c @@ -23,7 +23,7 @@ #ifndef lint static const char rcsid[] _U_ = - "@(#) $Header: /tcpdump/master/tcpdump/print-esp.c,v 1.51 2004-04-10 08:41:22 guy Exp $ (LBL)"; + "@(#) $Header: /tcpdump/master/tcpdump/print-esp.c,v 1.52 2004-07-16 14:05:59 hannes Exp $ (LBL)"; #endif #ifdef HAVE_CONFIG_H @@ -330,7 +330,7 @@ static void esp_init(netdissect_options *ndo _U_) int esp_print(netdissect_options *ndo, - const u_char *bp, const u_char *bp2 + const u_char *bp, const int length, const u_char *bp2 #ifndef HAVE_LIBCRYPTO _U_ #endif @@ -392,6 +392,7 @@ esp_print(netdissect_options *ndo, } (*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); #ifndef HAVE_LIBCRYPTO goto fail; diff --git a/print-ip.c b/print-ip.c index f2ff3561..6086ea65 100644 --- a/print-ip.c +++ b/print-ip.c @@ -21,7 +21,7 @@ #ifndef lint static const char rcsid[] _U_ = - "@(#) $Header: /tcpdump/master/tcpdump/print-ip.c,v 1.141 2004-06-25 01:20:09 guy Exp $ (LBL)"; + "@(#) $Header: /tcpdump/master/tcpdump/print-ip.c,v 1.142 2004-07-16 14:05:59 hannes Exp $ (LBL)"; #endif #ifdef HAVE_CONFIG_H @@ -506,7 +506,7 @@ again: case IPPROTO_ESP: { int enh, padlen; - advance = esp_print(gndo, cp, (const u_char *)ip, &enh, &padlen); + advance = esp_print(gndo, cp, len, (const u_char *)ip, &enh, &padlen); if (advance <= 0) break; cp += advance; diff --git a/print-ip6.c b/print-ip6.c index d1a84985..e5cb504b 100644 --- a/print-ip6.c +++ b/print-ip6.c @@ -21,7 +21,7 @@ #ifndef lint static const char rcsid[] _U_ = - "@(#) $Header: /tcpdump/master/tcpdump/print-ip6.c,v 1.43 2004-05-01 10:15:33 hannes Exp $"; + "@(#) $Header: /tcpdump/master/tcpdump/print-ip6.c,v 1.44 2004-07-16 14:06:00 hannes Exp $"; #endif #ifdef HAVE_CONFIG_H @@ -176,7 +176,7 @@ ip6_print(register const u_char *bp, register u_int length) case IPPROTO_ESP: { int enh, padlen; - advance = esp_print(gndo, cp, (const u_char *)ip6, &enh, &padlen); + advance = esp_print(gndo, cp, len, (const u_char *)ip6, &enh, &padlen); nh = enh & 0xff; len -= padlen; break;