mirror of
https://github.com/the-tcpdump-group/tcpdump.git
synced 2024-11-27 12:03:44 +08:00
print the packet length for ESP packets
This commit is contained in:
parent
ce83684fe7
commit
89e2e0c7be
@ -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);
|
||||
|
||||
|
@ -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;
|
||||
|
@ -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;
|
||||
|
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user