]> The Tcpdump Group git mirrors - tcpdump/commitdiff
complete the tunnel-type printer inside the PMSI attribute printer
authorhannes <hannes>
Wed, 16 May 2007 14:35:35 +0000 (14:35 +0000)
committerhannes <hannes>
Wed, 16 May 2007 14:35:35 +0000 (14:35 +0000)
print-bgp.c

index 3eb85aa426a9f86c64b4d3336f82d545175471f9..33e9013d38629668b417f2dd8f1f85b2131db7d4 100644 (file)
@@ -36,7 +36,7 @@
 
 #ifndef lint
 static const char rcsid[] _U_ =
-     "@(#) $Header: /tcpdump/master/tcpdump/print-bgp.c,v 1.105 2007-05-16 14:02:51 hannes Exp $";
+     "@(#) $Header: /tcpdump/master/tcpdump/print-bgp.c,v 1.106 2007-05-16 14:35:35 hannes Exp $";
 #endif
 
 #include <tcpdump-stdinc.h>
@@ -1640,23 +1640,38 @@ bgp_attr_print(const struct bgp_attr *attr, const u_char *pptr, int len)
                 tlen -= 5;
 
                 switch (tunnel_type) {
-                case BGP_PMSI_TUNNEL_PIM_SSM:
+                case BGP_PMSI_TUNNEL_PIM_SM: /* fall through */
+                case BGP_PMSI_TUNNEL_PIM_BIDIR:
                     TCHECK2(tptr[0], 8);
-                    printf("\n\t      P-Root-Node %s, P-Group %s",
+                    printf("\n\t      Sender %s, P-Group %s",
                            ipaddr_string(tptr),
                            ipaddr_string(tptr+4));
                     break;
 
-                    /*
-                     * no Tunnel-ID printing, just hexdumping for now
-                     * you are welcome to contribute code ;-)
-                     */
-                case BGP_PMSI_TUNNEL_RSVP_P2MP:
-                case BGP_PMSI_TUNNEL_LDP_P2MP:
-                case BGP_PMSI_TUNNEL_PIM_SM:
-                case BGP_PMSI_TUNNEL_PIM_BIDIR:
+                case BGP_PMSI_TUNNEL_PIM_SSM:
+                    TCHECK2(tptr[0], 8);
+                    printf("\n\t      Root-Node %s, P-Group %s",
+                           ipaddr_string(tptr),
+                           ipaddr_string(tptr+4));
+                    break;
                 case BGP_PMSI_TUNNEL_INGRESS:
+                    TCHECK2(tptr[0], 4);
+                    printf("\n\t      Tunnel-Endpoint %s",
+                           ipaddr_string(tptr));
+                    break;
+                case BGP_PMSI_TUNNEL_LDP_P2MP: /* fall through */
                 case BGP_PMSI_TUNNEL_LDP_MP2MP:
+                    TCHECK2(tptr[0], 8);
+                    printf("\n\t      Root-Node %s, LSP-ID 0x%08x",
+                           ipaddr_string(tptr),
+                           EXTRACT_32BITS(tptr+4));
+                    break;
+                case BGP_PMSI_TUNNEL_RSVP_P2MP:
+                    TCHECK2(tptr[0], 8);
+                    printf("\n\t      Extended-Tunnel-ID %s, P2MP-ID 0x%08x",
+                           ipaddr_string(tptr),
+                           EXTRACT_32BITS(tptr+4));
+                    break;
                 default:
                     if (vflag <= 1) {
                         print_unknown_data(tptr,"\n\t      ",tlen);