]> The Tcpdump Group git mirrors - tcpdump/commitdiff
IS-IS: Add LAN Adjacency Segment Identifier subTLV
authorckishimo <[email protected]>
Fri, 23 Aug 2019 08:46:39 +0000 (10:46 +0200)
committerFrancois-Xavier Le Bail <[email protected]>
Mon, 25 May 2020 14:43:42 +0000 (16:43 +0200)
Adapted from GitHub pull request #798.

Print " (invalid)" when combinations of V-Flag and L-Flag are invalid.

Update comments (draft -> RFC).

Remove some ND_TCHECK_LEN because GET_ use.

Update the output of isis_sid test because commit
b09710dfcdd50251efd487e800cd1b9fd01eaf96 updated the output format
of the IS-IS dissector.

print-isoclns.c
tests/TESTLIST
tests/isis_cap_tlv.out
tests/isis_sid.out [new file with mode: 0644]
tests/isis_sid.pcap [new file with mode: 0644]

index f2235d289e205d261431151abd3b8af1150da3cb..b356871475ddc9f08823228dea97ba41ff3ca0f7 100644 (file)
@@ -375,6 +375,7 @@ static const struct tok isis_router_capability_sr_flags[] = {
 #define ISIS_SUBTLV_EXT_IS_REACH_LINK_PROTECTION_TYPE 20 /* rfc4205 */
 #define ISIS_SUBTLV_EXT_IS_REACH_INTF_SW_CAP_DESCR    21 /* rfc4205 */
 #define ISIS_SUBTLV_EXT_IS_REACH_BW_CONSTRAINTS       22 /* rfc4124 */
+#define ISIS_SUBTLV_EXT_IS_REACH_LAN_ADJ_SEGMENT_ID   32 /* rfc8667 */
 
 #define ISIS_SUBTLV_SPB_METRIC                        29 /* rfc6329 */
 
@@ -393,6 +394,7 @@ static const struct tok isis_ext_is_reach_subtlv_values[] = {
     { ISIS_SUBTLV_EXT_IS_REACH_INTF_SW_CAP_DESCR,      "Interface Switching Capability" },
     { ISIS_SUBTLV_EXT_IS_REACH_BW_CONSTRAINTS_OLD,     "Bandwidth Constraints (old)" },
     { ISIS_SUBTLV_EXT_IS_REACH_BW_CONSTRAINTS,         "Bandwidth Constraints" },
+    { ISIS_SUBTLV_EXT_IS_REACH_LAN_ADJ_SEGMENT_ID,     "LAN Adjacency Segment Identifier" },
     { ISIS_SUBTLV_SPB_METRIC,                          "SPB Metric" },
     { 250,                                             "Reserved for cisco specific extensions" },
     { 251,                                             "Reserved for cisco specific extensions" },
@@ -448,6 +450,16 @@ static const struct tok isis_subtlv_link_attribute_values[] = {
     { 0, NULL }
 };
 
+static const struct tok isis_lan_adj_sid_flag_values[] = {
+    { 0x80, "Address family IPv6" },
+    { 0x40, "Backup" },
+    { 0x20, "Value" },
+    { 0x10, "Local significance" },
+    { 0x08, "Set of adjacencies" },
+    { 0x04, "Persistent" },
+    { 0, NULL }
+};
+
 #define ISIS_SUBTLV_AUTH_SIMPLE        1
 #define ISIS_SUBTLV_AUTH_GENERIC       3 /* rfc 5310 */
 #define ISIS_SUBTLV_AUTH_MD5          54
@@ -2177,6 +2189,41 @@ isis_print_ext_is_reach(netdissect_options *ndo,
                     }
                 }
                 break;
+            case ISIS_SUBTLV_EXT_IS_REACH_LAN_ADJ_SEGMENT_ID:
+                if (subtlv_len >= 8) {
+                    ND_PRINT("%s  Flags: [%s]", ident,
+                              bittok2str(isis_lan_adj_sid_flag_values,
+                                         "none",
+                                         GET_U_1(tptr)));
+                    int vflag = (GET_U_1(tptr) & 0x20) ? 1:0;
+                    int lflag = (GET_U_1(tptr) & 0x10) ? 1:0;
+                    tptr++;
+                    subtlv_len--;
+                    subtlv_sum_len--;
+                    proc_bytes++;
+                    ND_PRINT("%s  Weight: %u", ident, GET_U_1(tptr));
+                    tptr++;
+                    subtlv_len--;
+                    subtlv_sum_len--;
+                    proc_bytes++;
+                    if(subtlv_len>=SYSTEM_ID_LEN) {
+                        ND_TCHECK_LEN(tptr, SYSTEM_ID_LEN);
+                        ND_PRINT("%s  Neighbor System-ID: %s", ident,
+                            isis_print_id(ndo, tptr, SYSTEM_ID_LEN));
+                    }
+                    /* RFC 8667 section 2.2.2 */
+                    /* if V-flag is set to 1 and L-flag is set to 1 ==> 3 octet label */
+                    /* if V-flag is set to 0 and L-flag is set to 0 ==> 4 octet index */
+                    if (vflag && lflag) {
+                        ND_PRINT("%s  Label: %u",
+                                  ident, GET_BE_U_3(tptr+SYSTEM_ID_LEN));
+                    } else if ((!vflag) && (!lflag)) {
+                        ND_PRINT("%s  Index: %u",
+                                  ident, GET_BE_U_4(tptr+SYSTEM_ID_LEN));
+                    } else
+                        nd_print_invalid(ndo);
+                }
+                break;
             default:
                 if (!print_unknown_data(ndo, tptr, "\n\t\t    ", subtlv_len))
                     return(0);
index 818a0845349e84ef8f7e10760b85b948841b47d0..2cd4abb9933ed95c99591af2d0151be78e48178e 100644 (file)
@@ -319,6 +319,7 @@ isis_sr-v   isis_sr.pcapng                  isis_sr.out     -v
 # 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
 isis-seg-fault-3-v isis-seg-fault-3.pcapng isis-seg-fault-3-v.out -v
+isis_sid       isis_sid.pcap                   isis_sid.out    -v
 
 # RSVP tests
 rsvp_infloop-v rsvp-infinite-loop.pcap         rsvp_infloop-v.out      -v
index e47f28b693cf85c9f0534328d9b446be841639fb..1ffdef4c6da041d1019cc606286e2a756aab6dd2 100644 (file)
                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
+               LAN Adjacency Segment Identifier subTLV #32, length: 11
+                 Flags: [Value, Local significance]
+                 Weight: 0
+                 Neighbor System-ID: 0192.0168.0002
+                 Label: 18
              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
                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
+               LAN Adjacency Segment Identifier subTLV #32, length: 11
+                 Flags: [Value, Local significance]
+                 Weight: 0
+                 Neighbor System-ID: 0192.0168.0003
+                 Label: 16
            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
                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
+               LAN Adjacency Segment Identifier subTLV #32, length: 11
+                 Flags: [Value, Local significance]
+                 Weight: 0
+                 Neighbor System-ID: 0192.0168.0004
+                 Label: 17
            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
diff --git a/tests/isis_sid.out b/tests/isis_sid.out
new file mode 100644 (file)
index 0000000..e5799d0
--- /dev/null
@@ -0,0 +1,99 @@
+    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 (incorrect should be 0x3cf5), 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
+               LAN Adjacency Segment Identifier subTLV #32, length: 11
+                 Flags: [Value, Local significance]
+                 Weight: 0
+                 Neighbor System-ID: 0192.0168.0002
+                 Label: 18
+             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
+               LAN Adjacency Segment Identifier subTLV #32, length: 11
+                 Flags: [Value, Local significance]
+                 Weight: 0
+                 Neighbor System-ID: 0192.0168.0003
+                 Label: 16
+           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
+               LAN Adjacency Segment Identifier subTLV #32, length: 11
+                 Flags: [Value, Local significance]
+                 Weight: 0
+                 Neighbor System-ID: 0192.0168.0004
+                 Label: 17
+           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 [S bit, D bit]
+               unknown subTLV #19, length: 1
+               0x0000:  00
diff --git a/tests/isis_sid.pcap b/tests/isis_sid.pcap
new file mode 100644 (file)
index 0000000..f2c8756
Binary files /dev/null and b/tests/isis_sid.pcap differ