]> The Tcpdump Group git mirrors - tcpdump/commitdiff
print the packet length for ESP packets
authorhannes <hannes>
Fri, 16 Jul 2004 14:05:59 +0000 (14:05 +0000)
committerhannes <hannes>
Fri, 16 Jul 2004 14:05:59 +0000 (14:05 +0000)
netdissect.h
print-esp.c
print-ip.c
print-ip6.c

index e471ace44b4603b2b67ca8e12efc10af61aaa717..866214725d5ec87b3f9efc32ef5c0907134bdfce 100644 (file)
@@ -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);
 
index 25303e30d4457aa71fd851f821e0238da0859a8b..08bb89152763ffd00bf147c9d289f7eac949c64f 100644 (file)
@@ -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;
index f2ff35615bdd2ce230dce7312ab22624bdb9be6d..6086ea657b12edafa002c5bf948bd8eb46c5c402 100644 (file)
@@ -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;
index d1a84985690d9cc8d8820e07c44a3e67d5d9442f..e5cb504b79868724fee3a64939fed9972af34338 100644 (file)
@@ -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;