]> The Tcpdump Group git mirrors - tcpdump/commitdiff
add isis router capability TLV
authorckishimo <[email protected]>
Thu, 22 Aug 2019 15:20:28 +0000 (17:20 +0200)
committerfxlb <[email protected]>
Wed, 4 Sep 2019 18:26:44 +0000 (20:26 +0200)
print-isoclns.c
tests/TESTLIST
tests/isis_cap_tlv.out [new file with mode: 0644]
tests/isis_cap_tlv.pcap [new file with mode: 0644]

index 4ec4d6cb6d93bc11319d27716092cf071849054e..15210afed45908d0bdf007e06d9c3507f313ac55 100644 (file)
@@ -143,6 +143,7 @@ static const struct tok isis_pdu_values[] = {
 #define ISIS_TLV_MT_IP6_REACH        237 /* draft-ietf-isis-wg-multi-topology-05 */
 #define ISIS_TLV_PTP_ADJ             240 /* rfc3373 */
 #define ISIS_TLV_IIH_SEQNR           241 /* draft-shen-isis-iih-sequence-00 */
+#define ISIS_TLV_ROUTER_CAPABILITY   242 /* rfc7981 */
 #define ISIS_TLV_VENDOR_PRIVATE      250 /* draft-ietf-isis-experimental-tlv-01 */
 #define ISIS_TLV_VENDOR_PRIVATE_MINLEN 3
 
@@ -187,6 +188,7 @@ static const struct tok isis_tlv_values[] = {
     { ISIS_TLV_MT_IP6_REACH,       "Multi-Topology IP6 Reachability"},
     { ISIS_TLV_PTP_ADJ,            "Point-to-point Adjacency State"},
     { ISIS_TLV_IIH_SEQNR,          "Hello PDU Sequence Number"},
+    { ISIS_TLV_ROUTER_CAPABILITY,  "IS-IS Router Capability"},
     { ISIS_TLV_VENDOR_PRIVATE,     "Vendor Private"},
     { 0, NULL }
 };
@@ -340,6 +342,12 @@ static const struct tok clnp_option_qos_global_values[] = {
     { 0, NULL }
 };
 
+static const struct tok isis_tlv_router_capability_flags[] = {
+    { 0x01, "S bit"},
+    { 0x02, "D bit"},
+    { 0, NULL }
+};
+
 #define ISIS_SUBTLV_EXT_IS_REACH_ADMIN_GROUP           3 /* rfc5305 */
 #define ISIS_SUBTLV_EXT_IS_REACH_LINK_LOCAL_REMOTE_ID  4 /* rfc4205 */
 #define ISIS_SUBTLV_EXT_IS_REACH_LINK_REMOTE_ID        5 /* rfc5305 */
@@ -3307,6 +3315,21 @@ isis_print(netdissect_options *ndo,
             ND_PRINT("\n\t      Sequence number: %u", GET_BE_U_4(tptr));
             break;
 
+        case ISIS_TLV_ROUTER_CAPABILITY:
+            if (tlen < 5) {
+                ND_PRINT(" [object length %u < 5]", tlen);
+                nd_print_invalid(ndo);
+                break;
+            }
+            ND_TCHECK_5(tptr); /* router-id + flags */
+            ND_PRINT("\n\t\tRouter-id: %s", ipaddr_string(ndo, tptr));
+            ND_PRINT("\n\t\tFlags: [%s]",
+                      bittok2str(isis_tlv_router_capability_flags,
+                        "none",
+                        GET_U_1(tptr+4)));
+            /* FIXME Optional set of sub-TLV */
+            break;
+
         case ISIS_TLV_VENDOR_PRIVATE:
            if (tlen < 3)
                break;
index f9b358031351746b9b557a7bccccd11a11beaf49..5843ad83ca839dc17b1d4506dd3f60a3d713542a 100644 (file)
@@ -294,6 +294,7 @@ isis_1-v    ISIS_external_lsp.pcap          isis_1-v.out    -v
 isis_2-v       ISIS_level1_adjacency.pcap      isis_2-v.out    -v
 isis_3-v       ISIS_level2_adjacency.pcap      isis_3-v.out    -v
 isis_4-v       ISIS_p2p_adjacency.pcap         isis_4-v.out    -v
+isis_cap_tlv   isis_cap_tlv.pcap               isis_cap_tlv.out        -v
 # fuzzed pcap
 # isis-seg-fault-1-v is now conditionally handled by isis-seg-fault-1-v.sh
 isis-seg-fault-2-v isis-seg-fault-2.pcapng isis-seg-fault-2-v.out -v
diff --git a/tests/isis_cap_tlv.out b/tests/isis_cap_tlv.out
new file mode 100644 (file)
index 0000000..336dc74
--- /dev/null
@@ -0,0 +1,89 @@
+    1  12:36:55.841195 IS-IS, length 495
+       L2 LSP, hlen: 27, v: 1, pdu-v: 1, sys-id-len: 6 (0), max-area: 3 (0)
+         lsp-id: 0192.0168.0001.00-00, seq: 0x0000000b, lifetime:  1196s
+         chksum: 0xc074 (correct), PDU length: 495, Flags: [ L2 IS ]
+           Area address(es) TLV #1, length: 4
+             Area address (length: 3): 49.0002
+           LSP Buffersize TLV #14, length: 2
+             LSP Buffersize: 1492
+           Protocols supported TLV #129, length: 2
+             NLPID(s): IPv4 (0xcc), IPv6 (0x8e)
+           Traffic Engineering Router ID TLV #134, length: 4
+             Traffic Engineering Router ID: 192.168.0.1
+           IPv4 Interface address(es) TLV #132, length: 4
+             IPv4 interface address: 192.168.0.1
+           Hostname TLV #137, length: 9
+             Hostname: vmx-18-r1
+           IS Reachability TLV #2, length: 34
+             IsNotVirtual
+             IS Neighbor: 0192.0168.0002.02, Default Metric: 10, Internal
+             IS Neighbor: 0192.0168.0003.02, Default Metric: 63, Internal
+             IS Neighbor: 0192.0168.0004.02, Default Metric: 63, Internal
+           Extended IS Reachability TLV #22, length: 184
+             IS Neighbor: 0192.0168.0002.02, Metric: 10, sub-TLVs present (81)
+               IPv4 interface address subTLV #6, length: 4, 10.0.12.1
+               Link Local/Remote Identifier subTLV #4, length: 8, 0x00000180, 0x00000000
+               Unreserved bandwidth subTLV #11, length: 32
+                 TE-Class 0: 1000.000 Mbps
+                 TE-Class 1: 1000.000 Mbps
+                 TE-Class 2: 1000.000 Mbps
+                 TE-Class 3: 1000.000 Mbps
+                 TE-Class 4: 1000.000 Mbps
+                 TE-Class 5: 1000.000 Mbps
+                 TE-Class 6: 1000.000 Mbps
+                 TE-Class 7: 1000.000 Mbps
+               Reservable link bandwidth subTLV #10, length: 4, 1000.000 Mbps
+               Maximum link bandwidth subTLV #9, length: 4, 1000.000 Mbps
+               Administrative groups subTLV #3, length: 4, 0x00000000
+               unknown subTLV #32, length: 11
+                   0x0000:  3000 0192 0168 0002 0000 12
+             IS Neighbor: 0192.0168.0003.02, Metric: 63, sub-TLVs present (81)
+               IPv4 interface address subTLV #6, length: 4, 10.0.13.1
+               Link Local/Remote Identifier subTLV #4, length: 8, 0x00000182, 0x00000000
+               Unreserved bandwidth subTLV #11, length: 32
+                 TE-Class 0: 1000.000 Mbps
+                 TE-Class 1: 1000.000 Mbps
+                 TE-Class 2: 1000.000 Mbps
+                 TE-Class 3: 1000.000 Mbps
+                 TE-Class 4: 1000.000 Mbps
+                 TE-Class 5: 1000.000 Mbps
+                 TE-Class 6: 1000.000 Mbps
+                 TE-Class 7: 1000.000 Mbps
+               Reservable link bandwidth subTLV #10, length: 4, 1000.000 Mbps
+               Maximum link bandwidth subTLV #9, length: 4, 1000.000 Mbps
+               Administrative groups subTLV #3, length: 4, 0x00000000
+               unknown subTLV #32, length: 11
+                   0x0000:  3000 0192 0168 0003 0000 10
+           Extended IS Reachability TLV #22, length: 92
+             IS Neighbor: 0192.0168.0004.02, Metric: 63, sub-TLVs present (81)
+               IPv4 interface address subTLV #6, length: 4, 10.0.14.1
+               Link Local/Remote Identifier subTLV #4, length: 8, 0x00000183, 0x00000000
+               Unreserved bandwidth subTLV #11, length: 32
+                 TE-Class 0: 1000.000 Mbps
+                 TE-Class 1: 1000.000 Mbps
+                 TE-Class 2: 1000.000 Mbps
+                 TE-Class 3: 1000.000 Mbps
+                 TE-Class 4: 1000.000 Mbps
+                 TE-Class 5: 1000.000 Mbps
+                 TE-Class 6: 1000.000 Mbps
+                 TE-Class 7: 1000.000 Mbps
+               Reservable link bandwidth subTLV #10, length: 4, 1000.000 Mbps
+               Maximum link bandwidth subTLV #9, length: 4, 1000.000 Mbps
+               Administrative groups subTLV #3, length: 4, 0x00000000
+               unknown subTLV #32, length: 11
+                   0x0000:  3000 0192 0168 0004 0000 11
+           IPv4 Internal Reachability TLV #128, length: 60
+             IPv4 prefix:       10.0.12.0/24, Distribution: up, Metric: 10, Internal
+             IPv4 prefix:       10.0.13.0/24, Distribution: up, Metric: 63, Internal
+             IPv4 prefix:       10.0.14.0/24, Distribution: up, Metric: 63, Internal
+             IPv4 prefix:     172.16.11.0/24, Distribution: up, Metric: 63, Internal
+             IPv4 prefix:     192.168.0.1/32, Distribution: up, Metric: 63, Internal
+           Extended IPv4 Reachability TLV #135, length: 41
+             IPv4 prefix:       10.0.12.0/24, Distribution: up, Metric: 10
+             IPv4 prefix:       10.0.13.0/24, Distribution: up, Metric: 63
+             IPv4 prefix:       10.0.14.0/24, Distribution: up, Metric: 63
+             IPv4 prefix:     172.16.11.0/24, Distribution: up, Metric: 63
+             IPv4 prefix:     192.168.0.1/32, Distribution: up, Metric: 63
+           IS-IS Router Capability TLV #242, length: 8
+               Router-id: 192.168.0.1
+               Flags: [none]
diff --git a/tests/isis_cap_tlv.pcap b/tests/isis_cap_tlv.pcap
new file mode 100644 (file)
index 0000000..ed8ae36
Binary files /dev/null and b/tests/isis_cap_tlv.pcap differ