]> The Tcpdump Group git mirrors - tcpdump/blobdiff - print-cdp.c
provide multiline output for PIM Joins/Grafts/Graft-Acks
[tcpdump] / print-cdp.c
index 2e605fd3096201fca78774213e4abc6b0d182544..b65d48eb4974bc096ca5377050f82c6a16cc911e 100644 (file)
  *    http://www.cisco.com/univercd/cc/td/doc/product/lan/trsrb/frames.htm
  */
 
+#ifndef lint
+static const char rcsid[] _U_ =
+    "@(#) $Header: /tcpdump/master/tcpdump/print-cdp.c,v 1.22 2003-12-29 19:26:28 hannes Exp $";
+#endif
 
 #ifdef HAVE_CONFIG_H
 #include "config.h"
 #include "addrtoname.h"
 #include "extract.h"                   /* must come after interface.h */
 
-#ifndef lint
-static const char rcsid[] _U_ =
-    "@(#) $Header: /tcpdump/master/tcpdump/print-cdp.c,v 1.20 2003-11-15 00:39:17 guy Exp $";
-#endif
 #define CDP_HEADER_LEN  4
 
 static struct tok cdp_tlv_values[] = {
@@ -99,9 +99,9 @@ cdp_print(const u_char *pptr, u_int length, u_int caplen)
 
         if (!TTEST2(*tptr, CDP_HEADER_LEN))
                 goto trunc;
-       printf("CDP v%u, ttl: %us", *tptr, *(tptr+1));
+       printf("CDPv%u, ttl: %us", *tptr, *(tptr+1));
         if (vflag)
-                printf(", checksum: %u (unverified)", EXTRACT_16BITS(tptr));
+                printf(", checksum: %u (unverified), length %u", EXTRACT_16BITS(tptr), length);
        tptr += CDP_HEADER_LEN;
 
        while (tptr < (pptr+length)) {
@@ -213,6 +213,9 @@ cdp_print(const u_char *pptr, u_int length, u_int caplen)
                        break;
                tptr = tptr+len;
        }
+        if (vflag < 1)
+            printf(", length %u",caplen);
+
        return;
 trunc:
        printf("[|cdp]");