X-Git-Url: https://git.tcpdump.org/tcpdump/blobdiff_plain/6bb10ee1e5d9beca128f30b75003052a853a87eb..4fefee3da046c1555c3c6beea43b57754c7da032:/print-ip.c?ds=sidebyside diff --git a/print-ip.c b/print-ip.c index e0e9d2db..c1c1fda7 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.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 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;