{ 0, NULL }
};
+#define ISIS_SUBTLV_ROUTER_CAP_SR 2 /* rfc 8667 */
+
+static const struct tok isis_router_capability_subtlv_values[] = {
+ { ISIS_SUBTLV_ROUTER_CAP_SR, "SR-Capabilities"},
+ { 0, NULL }
+};
+
+static const struct tok isis_router_capability_sr_flags[] = {
+ { 0x80, "ipv4"},
+ { 0x40, "ipv6"},
+ { 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 */
#define ISIS_SUBTLV_EXTD_IP_REACH_ADMIN_TAG32 1 /* draft-ietf-isis-admin-tags-01 */
#define ISIS_SUBTLV_EXTD_IP_REACH_ADMIN_TAG64 2 /* draft-ietf-isis-admin-tags-01 */
+#define ISIS_SUBTLV_EXTD_IP_REACH_PREFIX_SID 3 /* rfc8667 */
#define ISIS_SUBTLV_EXTD_IP_REACH_MGMT_PREFIX_COLOR 117 /* draft-ietf-isis-wg-multi-topology-05 */
static const struct tok isis_ext_ip_reach_subtlv_values[] = {
{ ISIS_SUBTLV_EXTD_IP_REACH_ADMIN_TAG32, "32-Bit Administrative tag" },
{ ISIS_SUBTLV_EXTD_IP_REACH_ADMIN_TAG64, "64-Bit Administrative tag" },
+ { ISIS_SUBTLV_EXTD_IP_REACH_PREFIX_SID, "Prefix SID" },
{ ISIS_SUBTLV_EXTD_IP_REACH_MGMT_PREFIX_COLOR, "Management Prefix Color" },
{ 0, NULL }
};
+#define ISIS_PREFIX_SID_FLAG_R 0x80 /* rfc 8667 */
+#define ISIS_PREFIX_SID_FLAG_N 0x40 /* rfc 8667 */
+#define ISIS_PREFIX_SID_FLAG_P 0x20 /* rfc 8667 */
+#define ISIS_PREFIX_SID_FLAG_E 0x10 /* rfc 8667 */
+#define ISIS_PREFIX_SID_FLAG_V 0x08 /* rfc 8667 */
+#define ISIS_PREFIX_SID_FLAG_L 0x04 /* rfc 8667 */
+
+static const struct tok prefix_sid_flag_values[] = {
+ { ISIS_PREFIX_SID_FLAG_R, "Readvertisement"},
+ { ISIS_PREFIX_SID_FLAG_N, "Node"},
+ { ISIS_PREFIX_SID_FLAG_P, "No-PHP"},
+ { ISIS_PREFIX_SID_FLAG_E, "Explicit NULL"},
+ { ISIS_PREFIX_SID_FLAG_V, "Value"},
+ { ISIS_PREFIX_SID_FLAG_L, "Local"},
+ { 0, NULL}
+};
+
+
+/* rfc 8667 */
+static const struct tok prefix_sid_algo_values[] = {
+ { 0, "SPF"},
+ { 1, "strict-SPF"},
+ { 0, NULL}
+};
+
static const struct tok isis_subtlv_link_attribute_values[] = {
{ 0x01, "Local Protection Available" },
{ 0x02, "Link excluded from local protection path" },
subl-=8;
}
break;
+ case ISIS_SUBTLV_EXTD_IP_REACH_PREFIX_SID:
+ {
+ uint8_t algo, flags;
+ uint32_t sid;
+
+ flags = GET_U_1(tptr);
+ algo = GET_U_1(tptr+1);
+
+ if (flags & ISIS_PREFIX_SID_FLAG_V) {
+ sid = GET_BE_U_3(tptr+2);
+ tptr+=5;
+ subl-=5;
+ } else {
+ sid = GET_BE_U_4(tptr+2);
+ tptr+=6;
+ subl-=6;
+ }
+
+ ND_PRINT(", Flags [%s], Algo %s (%u), %s %u",
+ bittok2str(prefix_sid_flag_values, "None", flags),
+ tok2str(prefix_sid_algo_values, "Unknown", algo), algo,
+ flags & ISIS_PREFIX_SID_FLAG_V ? "label" : "index",
+ sid);
+ }
+ break;
default:
if (!print_unknown_data(ndo, tptr, "\n\t\t ", subl))
return(0);
return 0;
}
+static void
+isis_print_router_cap_subtlv(netdissect_options *ndo, const uint8_t *tptr, uint8_t tlen)
+{
+ uint8_t subt, subl;
+
+ while (tlen >= 2) {
+ ND_TCHECK_LEN(tptr, 2);
+ subt = GET_U_1(tptr);
+ subl = GET_U_1(tptr+1);
+ tlen -= 2;
+ tptr += 2;
+
+ /* first lets see if we know the subTLVs name*/
+ ND_PRINT("\n\t\t%s subTLV #%u, length: %u",
+ tok2str(isis_router_capability_subtlv_values, "unknown", subt),
+ subt, subl);
+
+ /*
+ * Boundary check.
+ */
+ if (subl > tlen) {
+ break;
+ }
+ ND_TCHECK_LEN(tptr, subl);
+
+ switch (subt) {
+ case ISIS_SUBTLV_ROUTER_CAP_SR:
+ {
+ uint8_t flags, sid_tlen, sid_type, sid_len;
+ uint32_t range;
+ const uint8_t *sid_ptr;
+
+ flags = GET_U_1(tptr);
+ range = GET_BE_U_3(tptr+1);
+ ND_PRINT(", Flags [%s], Range %u",
+ bittok2str(isis_router_capability_sr_flags, "None", flags),
+ range);
+ sid_ptr = tptr + 4;
+ sid_tlen = subl - 4;
+
+ while (sid_tlen >= 5) {
+ sid_type = GET_U_1(sid_ptr);
+ sid_len = GET_U_1(sid_ptr+1);
+ sid_tlen -= 2;
+ sid_ptr += 2;
+
+ /*
+ * Boundary check.
+ */
+ if (sid_len > sid_tlen) {
+ break;
+ }
+
+ switch (sid_type) {
+ case 1:
+ if (sid_len == 3) {
+ ND_PRINT(", SID value %u", GET_BE_U_3(sid_ptr));
+ } else if (sid_len == 4) {
+ ND_PRINT(", SID value %u", GET_BE_U_4(sid_ptr));
+ } else {
+ ND_PRINT(", Unknown SID length%u", sid_len);
+ }
+ break;
+ default:
+ print_unknown_data(ndo, sid_ptr, "\n\t\t ", sid_len);
+ }
+
+ sid_ptr += sid_len;
+ sid_tlen -= sid_len;
+ }
+ }
+ break;
+ default:
+ print_unknown_data(ndo, tptr, "\n\t\t", subl);
+ break;
+ }
+
+ tlen -= subl;
+ tptr += subl;
+ }
+ trunc:
+ return;
+}
+
/*
* Clear checksum and lifetime prior to signature verification.
*/
break;
}
ND_TCHECK_5(tptr); /* router-id + flags */
- ND_PRINT("\n\t\tRouter-id: %s", GET_IPADDR_STRING(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 */
+ ND_PRINT("\n\t Router-ID %s", GET_IPADDR_STRING(tptr));
+ ND_PRINT(", Flags [%s]",
+ bittok2str(isis_tlv_router_capability_flags, "none", GET_U_1(tptr+4)));
+
+ /* Optional set of sub-TLV */
+ if (tlen > 5) {
+ isis_print_router_cap_subtlv(ndo, tptr+5, tlen-5);
+ }
break;
case ISIS_TLV_VENDOR_PRIVATE:
isis_4-v ISIS_p2p_adjacency.pcap isis_4-v.out -v
isis_cap_tlv isis_cap_tlv.pcap isis_cap_tlv.out -v
isis_iid-v isis_iid_tlv.pcap isis_iid_tlv.out -v
+isis_sr-v isis_sr.pcap isis_sr.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
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]
+ Router-ID 192.168.0.1, Flags [none]
+ unknown subTLV #19, length: 1
+ 0x0000: 00
Extended IS Reachability TLV #22, length: 11
IS Neighbor: 2222.2222.2222.00, Metric: 10, no sub-TLVs present
IS-IS Router Capability TLV #242, length: 9
- Router-id: 1.1.1.1
- Flags: [none]
+ Router-ID 1.1.1.1, Flags [none]
+ unknown subTLV #27, length: 2
+ 0x0000: fa00
IPv4 Interface address(es) TLV #132, length: 8
IPv4 interface address: 2.2.2.1
IPv4 interface address: 1.1.1.1
Extended IS Reachability TLV #22, length: 11
IS Neighbor: 2222.2222.2222.00, Metric: 10, no sub-TLVs present
IS-IS Router Capability TLV #242, length: 9
- Router-id: 1.1.1.1
- Flags: [none]
+ Router-ID 1.1.1.1, Flags [none]
+ unknown subTLV #27, length: 2
+ 0x0000: fa00
IPv4 Interface address(es) TLV #132, length: 8
IPv4 interface address: 2.2.2.1
IPv4 interface address: 1.1.1.1
Extended IS Reachability TLV #22, length: 11
IS Neighbor: 2222.2222.2222.00, Metric: 10, no sub-TLVs present
IS-IS Router Capability TLV #242, length: 9
- Router-id: 1.1.1.1
- Flags: [none]
+ Router-ID 1.1.1.1, Flags [none]
+ unknown subTLV #27, length: 2
+ 0x0000: fa00
IPv4 Interface address(es) TLV #132, length: 8
IPv4 interface address: 2.2.2.1
IPv4 interface address: 1.1.1.1
Extended IS Reachability TLV #22, length: 11
IS Neighbor: 2222.2222.2222.00, Metric: 10, no sub-TLVs present
IS-IS Router Capability TLV #242, length: 9
- Router-id: 1.1.1.1
- Flags: [none]
+ Router-ID 1.1.1.1, Flags [none]
+ unknown subTLV #27, length: 2
+ 0x0000: fa00
IPv4 Interface address(es) TLV #132, length: 8
IPv4 interface address: 2.2.2.1
IPv4 interface address: 1.1.1.1
Extended IS Reachability TLV #22, length: 11
IS Neighbor: 1111.1111.1111.00, Metric: 10, no sub-TLVs present
IS-IS Router Capability TLV #242, length: 9
- Router-id: 1.1.1.2
- Flags: [none]
+ Router-ID 1.1.1.2, Flags [none]
+ unknown subTLV #27, length: 2
+ 0x0000: fa00
IPv4 Interface address(es) TLV #132, length: 8
IPv4 interface address: 2.2.2.2
IPv4 interface address: 1.1.1.2
Extended IS Reachability TLV #22, length: 11
IS Neighbor: 1111.1111.1111.00, Metric: 10, no sub-TLVs present
IS-IS Router Capability TLV #242, length: 9
- Router-id: 1.1.1.2
- Flags: [none]
+ Router-ID 1.1.1.2, Flags [none]
+ unknown subTLV #27, length: 2
+ 0x0000: fa00
IPv4 Interface address(es) TLV #132, length: 8
IPv4 interface address: 2.2.2.2
IPv4 interface address: 1.1.1.2
Extended IS Reachability TLV #22, length: 11
IS Neighbor: 1111.1111.1111.00, Metric: 10, no sub-TLVs present
IS-IS Router Capability TLV #242, length: 9
- Router-id: 1.1.1.2
- Flags: [none]
+ Router-ID 1.1.1.2, Flags [none]
+ unknown subTLV #27, length: 2
+ 0x0000: fa00
Extended IPv4 Reachability TLV #135, length: 9
IPv4 prefix: 2.2.2.1/32, Distribution: up, Metric: 20
IPv4 Interface address(es) TLV #132, length: 8
Extended IS Reachability TLV #22, length: 11
IS Neighbor: 2222.2222.2222.00, Metric: 10, no sub-TLVs present
IS-IS Router Capability TLV #242, length: 9
- Router-id: 1.1.1.1
- Flags: [none]
+ Router-ID 1.1.1.1, Flags [none]
+ unknown subTLV #27, length: 2
+ 0x0000: fa00
Extended IPv4 Reachability TLV #135, length: 9
IPv4 prefix: 2.2.2.2/32, Distribution: up, Metric: 20
IPv4 Interface address(es) TLV #132, length: 8
--- /dev/null
+ 1 18:42:19.016934 IS-IS, length 97
+ L1 LSP, hlen: 27, v: 1, pdu-v: 1, sys-id-len: 6 (0), max-area: 3 (0)
+ lsp-id: 1920.0000.0008.00-00, seq: 0x00000031, lifetime: 65534s
+ chksum: 0xc3ad (correct), PDU length: 97, Flags: [ L2 IS ]
+ Area address(es) TLV #1, length: 4
+ Area address (length: 3): 49.0002
+ Protocols supported TLV #129, length: 2
+ NLPID(s): IPv6 (0x8e), IPv4 (0xcc)
+ Extended IPv4 Reachability TLV #135, length: 27
+ IPv4 prefix: 10.0.27.0/31, Distribution: up, Metric: 1000000
+ IPv4 prefix: 7.7.7.1/32, Distribution: up, Metric: 1000000, sub-TLVs present (8)
+ Prefix SID subTLV #3, length: 6, Flags [Node], Algo SPF (0), index 40
+ Extended IS Reachability TLV #22, length: 11
+ IS Neighbor: 1921.6800.1003.00, Metric: 1000000, no sub-TLVs present
+ IS-IS Router Capability TLV #242, length: 16
+ Router-ID 7.7.7.1, Flags [none]
+ SR-Capabilities subTLV #2, length: 9, Flags [ipv4, ipv6], Range 1000, SID value 4000