From: hannes Date: Tue, 4 Feb 2003 06:26:59 +0000 (+0000) Subject: keep the one-line rule for vflag<1, display exp value always, indicate payload type... X-Git-Tag: tcpdump-3.8-bp~219 X-Git-Url: https://git.tcpdump.org/tcpdump/commitdiff_plain/163f717ba6b65d259149dfd0e34c8b0666cd46b3 keep the one-line rule for vflag<1, display exp value always, indicate payload type (IP,IPv6,OSI) in vflag<1 mode --- diff --git a/print-mpls.c b/print-mpls.c index 4e7b3782..34297dd0 100644 --- a/print-mpls.c +++ b/print-mpls.c @@ -28,7 +28,7 @@ #ifndef lint static const char rcsid[] = - "@(#) $Header: /tcpdump/master/tcpdump/print-mpls.c,v 1.5 2002-08-08 19:52:48 hannes Exp $ (LBL)"; + "@(#) $Header: /tcpdump/master/tcpdump/print-mpls.c,v 1.6 2003-02-04 06:26:59 hannes Exp $ (LBL)"; #endif #ifdef HAVE_CONFIG_H @@ -86,8 +86,7 @@ mpls_print(const u_char *bp, u_int length) if (vflag && MPLS_LABEL(v) < sizeof(mpls_labelname) / sizeof(mpls_labelname[0])) printf(" (%s)", mpls_labelname[MPLS_LABEL(v)]); - if (MPLS_EXP(v)) - printf(", exp %u", MPLS_EXP(v)); + printf(", exp %u", MPLS_EXP(v)); if (MPLS_STACK(v)) printf(", [S]"); printf(", ttl %u", MPLS_TTL(v)); @@ -115,7 +114,7 @@ mpls_print(const u_char *bp, u_int length) * bit is set and tries to determine the network layer protocol * 0x45-0x4f is IPv4 * 0x60-0x6f is IPv6 - * 0x83 is IS-IS + * 0x81-0x83 is OSI (CLNP,ES-IS,IS-IS) * this technique is sometimes known as NULL encapsulation * and decoding is particularly useful for control-plane traffic [BGP] * which cisco by default sends MPLS encapsulated @@ -134,8 +133,11 @@ mpls_print(const u_char *bp, u_int length) case 0x4d: case 0x4e: case 0x4f: - printf("\n\t"); - ip_print(p, length - (p - bp)); + if (vflag>0) { + printf("\n\t"); + ip_print(p, length - (p - bp)); + } + else printf(", IP, length: %u",length); break; #ifdef INET6 case 0x60: @@ -154,13 +156,21 @@ mpls_print(const u_char *bp, u_int length) case 0x6d: case 0x6e: case 0x6f: - printf("\n\t"); - ip6_print(p, length - (p - bp)); + if (vflag>0) { + printf("\n\t"); + ip6_print(p, length - (p - bp)); + } + else printf(", IPv6, length: %u",length); break; #endif + case 0x81: + case 0x82: case 0x83: - printf("\n\t"); - isoclns_print(p, length - (p - bp), length - (p - bp), NULL, NULL); + if (vflag>0) { + printf("\n\t"); + isoclns_print(p, length - (p - bp), length - (p - bp), NULL, NULL); + } + else printf(", OSI, length: %u",length); break; default: /* ok bail out - we did not figure out what it is*/