]> The Tcpdump Group git mirrors - tcpdump/blobdiff - print-isoclns.c
display the DIS lan-id of an IIH in non-verbose mode
[tcpdump] / print-isoclns.c
index d4a620389f090a357c09f214977bbb1fbdce68f9..f610fd323a28122d1a20028b9a1a092dcf3915d9 100644 (file)
@@ -26,7 +26,7 @@
 
 #ifndef lint
 static const char rcsid[] =
-    "@(#) $Header: /tcpdump/master/tcpdump/print-isoclns.c,v 1.96 2003-09-08 16:18:06 hannes Exp $ (LBL)";
+    "@(#) $Header: /tcpdump/master/tcpdump/print-isoclns.c,v 1.102 2003-10-28 19:10:15 hannes Exp $ (LBL)";
 #endif
 
 #ifdef HAVE_CONFIG_H
@@ -155,14 +155,14 @@ static struct tok isis_tlv_values[] = {
     { TLV_IS_ALIAS_ID,       "IS Alias ID"},
     { TLV_DECNET_PHASE4,     "DECnet Phase IV"},
     { TLV_LUCENT_PRIVATE,    "Lucent Proprietary"},
-    { TLV_IP_REACH,          "IPv4 Internal reachability"},
+    { TLV_IP_REACH,          "IPv4 Internal Reachability"},
     { TLV_PROTOCOLS,         "Protocols supported"},
-    { TLV_IP_REACH_EXT,      "IPv4 External reachability"},
+    { TLV_IP_REACH_EXT,      "IPv4 External Reachability"},
     { TLV_IDRP_INFO,         "Inter-Domain Information Type"},
     { TLV_IPADDR,            "IPv4 Interface address(es)"},
     { TLV_IPAUTH,            "IPv4 authentication (deprecated)"},
     { TLV_TE_ROUTER_ID,      "Traffic Engineering Router ID"},
-    { TLV_EXT_IP_REACH,      "Extended IPv4 reachability"},
+    { TLV_EXT_IP_REACH,      "Extended IPv4 Reachability"},
     { TLV_HOSTNAME,          "Hostname"},
     { TLV_SHARED_RISK_GROUP, "Shared Risk Link Group"},
     { TLV_NORTEL_PRIVATE1,   "Nortel Proprietary"},
@@ -172,9 +172,9 @@ static struct tok isis_tlv_values[] = {
     { TLV_MT_IS_REACH,       "Multi Topology IS Reachability"},
     { TLV_MT_SUPPORTED,      "Multi Topology"},
     { TLV_IP6ADDR,           "IPv6 Interface address(es)"},
-    { TLV_MT_IP_REACH,       "Multi-Topology IPv4 reachability"},
+    { TLV_MT_IP_REACH,       "Multi-Topology IPv4 Reachability"},
     { TLV_IP6_REACH,         "IPv6 reachability"},
-    { TLV_MT_IP6_REACH,      "Multi-Topology IP6 reachability"},
+    { TLV_MT_IP6_REACH,      "Multi-Topology IP6 Reachability"},
     { TLV_PTP_ADJ,           "Point-to-point Adjacency State"},
     { TLV_IIH_SEQNR,         "Hello PDU Sequence Number"},
     { TLV_VENDOR_PRIVATE,    "Vendor Private"},
@@ -694,7 +694,7 @@ static char *
 isis_print_id(const u_int8_t *cp, int id_len)
 {
     int i;
-    static char id[21];
+    static char id[sizeof("xxxx.xxxx.xxxx.yy-zz")];
     char *pos = id;
 
     for (i = 1; i <= SYSTEM_ID_LEN; i++) {
@@ -745,7 +745,7 @@ isis_print_tlv_ip_reach (const u_int8_t *cp, const char *ident, int length)
 
        while (length > 0) {
                if ((size_t)length < sizeof(*tlv_ip_reach)) {
-                       printf("short IPv4 reachability (%d vs %lu)",
+                       printf("short IPv4 Reachability (%d vs %lu)",
                                length,
                                (unsigned long)sizeof(*tlv_ip_reach));
                        return (0);
@@ -805,7 +805,7 @@ static int
 isis_print_ip_reach_subtlv (const u_int8_t *tptr,int subt,int subl,const char *ident) {
 
         /* first lets see if we know the subTLVs name*/
-       printf("%s%s (subTLV #%u), length: %u",
+       printf("%s%s subTLV #%u, length: %u",
               ident,
                tok2str(isis_ext_ip_reach_subtlv_values,
                        "unknown",
@@ -863,7 +863,7 @@ isis_print_is_reach_subtlv (const u_int8_t *tptr,int subt,int subl,const char *i
         } bw;
 
         /* first lets see if we know the subTLVs name*/
-       printf("%s%s (subTLV #%u), length: %u",
+       printf("%s%s subTLV #%u, length: %u",
               ident,
                tok2str(isis_ext_is_reach_subtlv_values,
                        "unknown",
@@ -1229,7 +1229,10 @@ static int isis_print (const u_int8_t *p, u_int length)
 
        case L1_LAN_IIH:
        case L2_LAN_IIH:
-           printf(", source-id %s", isis_print_id(header_iih_lan->source_id,SYSTEM_ID_LEN));
+           printf(", source-id %s",
+                   isis_print_id(header_iih_lan->source_id,SYSTEM_ID_LEN));
+           printf(", DIS lan-id %s",
+                   isis_print_id(header_iih_lan->lan_id,NODE_ID_LEN));
            break;
        case PTP_IIH:
            printf(", source-id %s", isis_print_id(header_iih_ptp->source_id,SYSTEM_ID_LEN));
@@ -1259,7 +1262,10 @@ static int isis_print (const u_int8_t *p, u_int length)
     /* ok they seem to want to know everything - lets fully decode it */
     printf(", IS-IS, length: %u",length);
 
-    printf("\n\thlen: %u, v: %u, pdu-v: %u, sys-id-len: %u (%u), max-area: %u (%u)",
+    printf("\n\t%s, hlen: %u, v: %u, pdu-v: %u, sys-id-len: %u (%u), max-area: %u (%u)",
+           tok2str(isis_pdu_values,
+                   "unknown, type %u",
+                   pdu_type),
            header->fixed_len,
            header->version,
            header->pdu_version,
@@ -1268,12 +1274,6 @@ static int isis_print (const u_int8_t *p, u_int length)
            max_area,
            header->max_area);
 
-    /* first lets see if we know the PDU name*/
-    printf(", pdu-type: %s",
-           tok2str(isis_pdu_values,
-                   "unknown, type %u",
-                   pdu_type));
-
     if (vflag > 1) {
         if(!print_unknown_data(optr,"\n\t",8)) /* provide the _o_riginal pointer */
             return(0);                         /* for optionally debugging the common header */
@@ -1296,14 +1296,14 @@ static int isis_print (const u_int8_t *p, u_int length)
        }
 
        TCHECK(*header_iih_lan);
-       printf("\n\t  source-id: %s,  holding time: %us, Flags: [%s]",
+       printf("\n\t  source-id:  %s,  holding time: %us, Flags: [%s]",
                isis_print_id(header_iih_lan->source_id,SYSTEM_ID_LEN),
                EXTRACT_16BITS(header_iih_lan->holding_time),
                tok2str(isis_iih_circuit_type_values,
                        "unknown circuit type 0x%02x",
                        header_iih_lan->circuit_type));
 
-       printf("\n\t  lan-id:    %s, Priority: %u, PDU length: %u",
+       printf("\n\t  DIS lan-id: %s, Priority: %u, PDU length: %u",
                isis_print_id(header_iih_lan->lan_id, NODE_ID_LEN),
                (header_iih_lan->priority) & PRIORITY_MASK,
                pdu_len);
@@ -1331,13 +1331,15 @@ static int isis_print (const u_int8_t *p, u_int length)
        }
 
        TCHECK(*header_iih_ptp);
-       printf("\n\t  source-id: %s, holding time: %us, circuit-id: 0x%02x, %s, PDU length: %u",
+       printf("\n\t  source-id: %s, holding time: %us, Flags: [%s]",
                isis_print_id(header_iih_ptp->source_id,SYSTEM_ID_LEN),
                EXTRACT_16BITS(header_iih_ptp->holding_time),
-               header_iih_ptp->circuit_id,
                tok2str(isis_iih_circuit_type_values,
                        "unknown circuit type 0x%02x",
-                       header_iih_ptp->circuit_type),
+                       header_iih_ptp->circuit_type));
+
+       printf("\n\t  circuit-id: 0x%02x, PDU length: %u",
+               header_iih_ptp->circuit_id,
                pdu_len);
 
         if (vflag > 1) {
@@ -1444,8 +1446,9 @@ static int isis_print (const u_int8_t *p, u_int length)
        }
 
        TCHECK(*header_psnp);
-       printf("\n\t  source-id:    %s",
-               isis_print_id(header_psnp->source_id, NODE_ID_LEN));
+       printf("\n\t  source-id:    %s, PDU length: %u",
+               isis_print_id(header_psnp->source_id, NODE_ID_LEN),
+               pdu_len);
 
         if (vflag > 1) {
             if(!print_unknown_data(pptr,"\n\t  ",ISIS_PSNP_HEADER_SIZE))
@@ -1516,7 +1519,7 @@ static int isis_print (const u_int8_t *p, u_int length)
            while (tmp >= ETHER_ADDR_LEN) {
                 if (!TTEST2(*tptr, ETHER_ADDR_LEN))
                     goto trunctlv;
-                printf("\n\t      IS Neighbor: %s",isis_print_id(tptr,ETHER_ADDR_LEN));
+                printf("\n\t      SNPA: %s",isis_print_id(tptr,ETHER_ADDR_LEN));
                 tmp -= ETHER_ADDR_LEN;
                 tptr += ETHER_ADDR_LEN;
            }
@@ -1798,7 +1801,7 @@ static int isis_print (const u_int8_t *p, u_int length)
 
            if (!TTEST2(*tptr, 1))
                 goto trunctlv;
-           printf(", %s", ISIS_MASK_TLV_SHARED_RISK_GROUP(*tptr++) ? "numbered" : "unnumbered");
+           printf(", Flags: [%s]", ISIS_MASK_TLV_SHARED_RISK_GROUP(*tptr++) ? "numbered" : "unnumbered");
            tmp--;
 
            if (!TTEST2(*tptr,4))