]> The Tcpdump Group git mirrors - tcpdump/blobdiff - print-ip.c
remove the old lspping sample
[tcpdump] / print-ip.c
index e0e9d2db490e8ac3973921a3dbb405b773a5270a..c1c1fda7a966bab4ca91d78972976d1ddb0f3755 100644 (file)
@@ -21,7 +21,7 @@
 
 #ifndef lint
 static const char rcsid[] _U_ =
-    "@(#) $Header: /tcpdump/master/tcpdump/print-ip.c,v 1.136 2004-04-05 00:15:51 mcr Exp $ (LBL)";
+    "@(#) $Header: /tcpdump/master/tcpdump/print-ip.c,v 1.140 2004-05-01 10:15:33 hannes Exp $ (LBL)";
 #endif
 
 #ifdef HAVE_CONFIG_H
@@ -388,7 +388,7 @@ ip_print(register const u_char *bp, register u_int length)
            if (IP_V(ip) == 6)
                printf(", wrong link-layer encapsulation");
        }
-        else
+        else if (!eflag)
            printf("IP ");
 
        if ((u_char *)(ip + 1) > snapend) {
@@ -451,11 +451,12 @@ ip_print(register const u_char *bp, register u_int length)
             * For unfragmented datagrams, note the don't fragment flag.
             */
 
-           (void)printf(", id %u, offset %u, flags [%s], proto %u",
-                            EXTRACT_16BITS(&ip->ip_id),
-                            (off & 0x1fff) * 8,
-                            bittok2str(ip_frag_values, "none", off & 0xe000 ),
-                             ip->ip_p);
+           (void)printf(", id %u, offset %u, flags [%s], proto: %s (%u)",
+                         EXTRACT_16BITS(&ip->ip_id),
+                         (off & 0x1fff) * 8,
+                         bittok2str(ip_frag_values, "none", off & 0xe000 ),
+                         tok2str(ipproto_values,"unknown",ip->ip_p),
+                         ip->ip_p);
 
             (void)printf(", length: %u", EXTRACT_16BITS(&ip->ip_len));
 
@@ -543,10 +544,27 @@ again:
                        icmp_print(cp, len, (const u_char *)ip, (off & 0x3fff));
                        break;
 
-               case IPPROTO_IGRP:
+               case IPPROTO_PIGP:
+                       /*
+                        * XXX - the current IANA protocol number assignments
+                        * page lists 9 as "any private interior gateway
+                        * (used by Cisco for their IGRP)" and 88 as
+                        * "EIGRP" from Cisco.
+                        *
+                        * Recent BSD <netinet/in.h> headers define
+                        * IP_PROTO_PIGP as 9 and IP_PROTO_IGRP as 88.
+                        * We define IP_PROTO_PIGP as 9 and
+                        * IP_PROTO_EIGRP as 88; those names better
+                        * match was the current protocol number
+                        * assignments say.
+                        */
                        igrp_print(cp, len, (const u_char *)ip);
                        break;
 
+               case IPPROTO_EIGRP:
+                       eigrp_print(cp, len);
+                       break;
+
                case IPPROTO_ND:
                        (void)printf(" nd %d", len);
                        break;