isis: TLV 147 is not proprietary, it's MAC Reachablity from RFC 6165

This commit is contained in:
Joerg Mayer 2021-03-26 16:43:15 +01:00 committed by Jörg Mayer
parent a60cde8eb0
commit 22b2d8e1fc
4 changed files with 72 additions and 26 deletions

View File

@ -57,7 +57,7 @@
#define ISIS_CLV_MT_PORT_CAP 143 /* rfc6165, rfc7176 */
#define ISIS_CLV_MT_CAP 144 /* rfc6329, rfc7176 */
#define ISIS_CLV_TRILL_NEIGHBOR 145 /* rfc7176 */
#define ISIS_CLV_AVAYA_MAC 147 /* Avaya/Extremenetworks proprietary: Reverse engineered */
#define ISIS_CLV_MAC_RI 147 /* rfc6165: MAC Reachability */
#define ISIS_CLV_BFD_ENABLED 148 /* rfc6213 */
#define ISIS_CLV_SID_LABEL_BINDING 149 /* draft-previdi-isis-segment-routing-extensions-05 */
#define ISIS_CLV_AVAYA_IPVPN 184 /* Avaya/Extremenetworks proprietary: Reverse engineered */

View File

@ -457,10 +457,15 @@ static int hf_isis_lsp_clv_srv6_end_sid_sid = -1;
static int hf_isis_lsp_clv_srv6_end_sid_subsubclvs_len = -1;
static int hf_isis_lsp_purge_orig_id_num = -1;
static int hf_isis_lsp_purge_orig_id_system_id = -1;
/* rfc 6165: MAC Reachability */
static int hf_isis_lsp_mac_reachability_topoid_nick = -1;
static int hf_isis_lsp_mac_reachability_confidence = -1;
static int hf_isis_lsp_mac_reachability_reserved = -1;
static int hf_isis_lsp_mac_reachability_vlan = -1;
static int hf_isis_lsp_mac_reachability_mac = -1;
static int hf_isis_lsp_mac_reachability_chassismac = -1;
static int hf_isis_lsp_mac_reachability_fanmcast = -1;
/* Avaya proprietary */
static int hf_isis_lsp_avaya_147_unknown = -1;
static int hf_isis_lsp_avaya_147_mac = -1;
static int hf_isis_lsp_avaya_147_fanmcast = -1;
static int hf_isis_lsp_avaya_ipvpn_unknown = -1;
static int hf_isis_lsp_avaya_ipvpn_system_id = -1;
static int hf_isis_lsp_avaya_ipvpn_vrfsid = -1;
@ -555,7 +560,7 @@ static gint ett_isis_lsp_clv_srv6_locator = -1;
static gint ett_isis_lsp_clv_srv6_loc_flags = -1;
static gint ett_isis_lsp_clv_srv6_loc_sub_tlv = -1;
static gint ett_isis_lsp_clv_srv6_endx_sid_flags = -1;
static gint ett_isis_lsp_clv_avaya_mac = -1;
static gint ett_isis_lsp_clv_mac_reachability = -1;
static gint ett_isis_lsp_clv_avaya_ipvpn = -1;
static gint ett_isis_lsp_clv_avaya_ipvpn_subtlv = -1;
static gint ett_isis_lsp_clv_avaya_ipvpn_mc = -1;
@ -3805,20 +3810,40 @@ dissect_lsp_purge_orig_id_clv(tvbuff_t *tvb, packet_info* pinfo, proto_tree *tre
}
}
/* rfc6165: MAC Reachability */
static void
dissect_lsp_avaya_mac(tvbuff_t *tvb, packet_info* pinfo _U_, proto_tree *tree, int offset,
dissect_lsp_mac_reachability(tvbuff_t *tvb, packet_info* pinfo _U_, proto_tree *tree, int offset,
isis_data_t *isis _U_, int length)
{
if (length != 11 && length != 17) {
int num_macs;
int count;
gboolean is_avaya = TRUE; // JMayer: FIXME Add preference or determine from other parts of packet
if ((length - 5) % 6) {
proto_tree_add_expert_format(tree, pinfo, &ei_isis_lsp_length_clv, tvb, offset, length,
"Unexpected length of Avaya MAC TLV (%d vs 11 or 17)",
"Unexpected length of MAC Reachability TLV (%d vs 5 + N*6)",
length);
return;
}
proto_tree_add_item(tree, hf_isis_lsp_avaya_147_unknown, tvb, offset, 5, ENC_NA);
proto_tree_add_item(tree, hf_isis_lsp_avaya_147_mac, tvb, offset + 5, 6, ENC_NA);
if (length == 17)
proto_tree_add_item(tree, hf_isis_lsp_avaya_147_fanmcast, tvb, offset + 11, 6, ENC_NA);
num_macs = (length -5) / 6;
proto_tree_add_item(tree, hf_isis_lsp_mac_reachability_topoid_nick, tvb, offset, 2, ENC_NA);
offset += 2;
proto_tree_add_item(tree, hf_isis_lsp_mac_reachability_confidence, tvb, offset, 1, ENC_NA);
offset += 1;
proto_tree_add_item(tree, hf_isis_lsp_mac_reachability_reserved, tvb, offset, 2, ENC_NA);
proto_tree_add_item(tree, hf_isis_lsp_mac_reachability_vlan, tvb, offset, 2, ENC_BIG_ENDIAN);
offset += 2;
for (count = 1; count <= num_macs; count++) {
if (is_avaya && count == 1 )
proto_tree_add_item(tree, hf_isis_lsp_mac_reachability_chassismac, tvb, offset, 6, ENC_NA);
else if (is_avaya && count == 2)
proto_tree_add_item(tree, hf_isis_lsp_mac_reachability_fanmcast, tvb, offset, 6, ENC_NA);
else
proto_tree_add_item(tree, hf_isis_lsp_mac_reachability_mac, tvb, offset + 5, 6, ENC_NA);
offset += 6;
}
}
static void
@ -4103,10 +4128,10 @@ static const isis_clv_handle_t clv_l1_lsp_opts[] = {
dissect_lsp_purge_orig_id_clv
},
{
ISIS_CLV_AVAYA_MAC,
"Avaya MAC",
&ett_isis_lsp_clv_avaya_mac,
dissect_lsp_avaya_mac
ISIS_CLV_MAC_RI,
"MAC Reachability",
&ett_isis_lsp_clv_mac_reachability,
dissect_lsp_mac_reachability
},
{
ISIS_CLV_AVAYA_IPVPN,
@ -6092,22 +6117,43 @@ proto_register_isis_lsp(void)
FT_UINT24, BASE_DEC, NULL, 0x0FFFFF,
NULL, HFILL }
},
/* Avaya proprietary */
{ &hf_isis_lsp_avaya_147_unknown,
{ "Unknown", "isis.lsp.avaya.147.unknown",
/* rfc 6165 */
{ &hf_isis_lsp_mac_reachability_topoid_nick,
{ "Topology-id/Nickname", "isis.lsp.mac_reachability.topoid_nick",
FT_BYTES, BASE_NONE, NULL, 0x0,
NULL, HFILL }
},
{ &hf_isis_lsp_avaya_147_mac,
{ "Chassis MAC", "isis.lsp.avaya.147.chassismac",
{ &hf_isis_lsp_mac_reachability_confidence,
{ "Confidence", "isis.lsp.mac_reachability.confidence",
FT_UINT8, BASE_DEC, NULL, 0x0,
NULL, HFILL }
},
{ &hf_isis_lsp_mac_reachability_reserved,
{ "Reserved", "isis.lsp.mac_reachability.reserved",
FT_UINT16, BASE_DEC, NULL, 0xf000,
NULL, HFILL }
},
{ &hf_isis_lsp_mac_reachability_vlan,
{ "VLAN-ID", "isis.lsp.mac_reachability.vlan",
FT_UINT16, BASE_DEC, NULL, 0x0fff,
NULL, HFILL }
},
{ &hf_isis_lsp_mac_reachability_mac,
{ "MAC Address", "isis.lsp.mac_reachability.mac",
FT_ETHER, BASE_NONE, NULL, 0x0,
NULL, HFILL }
},
{ &hf_isis_lsp_avaya_147_fanmcast,
{ "FAN Mcast", "isis.lsp.avaya.147.fanmcast",
{ &hf_isis_lsp_mac_reachability_chassismac,
{ "Chassis MAC", "isis.lsp.mac_reachability.chassismac",
FT_ETHER, BASE_NONE, NULL, 0x0,
NULL, HFILL }
},
{ &hf_isis_lsp_mac_reachability_fanmcast,
{ "FAN Mcast", "isis.lsp.mac_reachability.fanmcast",
FT_ETHER, BASE_NONE, NULL, 0x0,
NULL, HFILL }
},
/* Avaya proprietary */
{ &hf_isis_lsp_avaya_ipvpn_unknown,
{ "Unknown", "isis.lsp.avaya.ipvpn.unknown",
FT_BYTES, BASE_NONE, NULL, 0x0,
@ -6267,7 +6313,7 @@ proto_register_isis_lsp(void)
&ett_isis_lsp_sl_sub_tlv,
&ett_isis_lsp_sl_sub_tlv_flags,
&ett_isis_lsp_clv_ipv6_te_router_id, /* CLV 140, rfc6119 */
&ett_isis_lsp_clv_avaya_mac, /* Avaya/Extremenetworks proprietary */
&ett_isis_lsp_clv_mac_reachability, /* CLV 147, rfc6165 */
&ett_isis_lsp_clv_avaya_ipvpn,
&ett_isis_lsp_clv_avaya_ipvpn_subtlv,
&ett_isis_lsp_clv_avaya_ipvpn_mc,

View File

@ -403,7 +403,7 @@ const value_string nlpid_vals[] = {
{ NLPID_ISO9542_ESIS, "ESIS" },
{ NLPID_ISO10589_ISIS, "ISIS" },
{ NLPID_ISO10747_IDRP, "IDRP" },
{ NLPID_AVAYA_MAC, "Avaya MAC" },
{ NLPID_AVAYA_8F, "Avaya 0x8f" },
{ NLPID_ISO9542X25_ESIS, "ESIS (X.25)" },
{ NLPID_ISO10030, "ISO 10030" },
{ NLPID_ISO11577, "ISO 11577" },

View File

@ -34,7 +34,7 @@
#define NLPID_ISO10030 0x8c
#define NLPID_ISO11577 0x8d /* X.273 */
#define NLPID_IP6 0x8e
#define NLPID_AVAYA_MAC 0x8f
#define NLPID_AVAYA_8F 0x8f
#define NLPID_COMPRESSED 0xb0 /* "Data compression protocol" */
#define NLPID_TRILL 0xc0
#define NLPID_SNDCF 0xc1 /* "SubNetwork Dependent Convergence Function */