BGP: Update/Fix Extended Communities

Changed and updated BGP extended communities according to:

* https://www.iana.org/assignments/bgp-extended-communities/bgp-extended-communities.xhtml
* RFC 7674
* RFC 8317
* RFC 7796
* draft-ietf-bess-evpn-inter-subnet-forwarding-08

Bug: 16449
Change-Id: Idaf1026ac4e3162ba54c163782261379931803e0
Reviewed-on: https://code.wireshark.org/review/36803
Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
This commit is contained in:
Uli Heilmeier 2020-04-12 13:22:17 +02:00 committed by Alexis La Goutte
parent ac97bca592
commit bb352dc0db
1 changed files with 219 additions and 46 deletions

View File

@ -325,11 +325,12 @@ static dissector_handle_t bgp_handle;
#define BGP_EXT_COM_TYPE_HIGH_TR_QOS 0x04 /* QoS Marking [Thomas_Martin_Knoll] */
#define BGP_EXT_COM_TYPE_HIGH_TR_COS 0x05 /* CoS Capability [Thomas_Martin_Knoll] */
#define BGP_EXT_COM_TYPE_HIGH_TR_EVPN 0x06 /* EVPN (Sub-Types are defined in the "EVPN Extended Community Sub-Types" registry) */
/* 0x07 Unassigned */
#define BGP_EXT_COM_TYPE_HIGH_TR_FLOW_I 0x07 /* FlowSpec Transitive Extended Communities [draft-ietf-idr-flowspec-interfaceset] */
#define BGP_EXT_COM_TYPE_HIGH_TR_FLOW 0x08 /* Flow spec redirect/mirror to IP next-hop [draft-simpson-idr-flowspec-redirect] */
#define BGP_EXT_COM_TYPE_HIGH_TR_FLOW_R 0x09 /* FlowSpec Redirect to indirection-id Extended Community [draft-ietf-idr-flowspec-path-redirect] */
#define BGP_EXT_COM_TYPE_HIGH_TR_EXP 0x80 /* Generic Transitive Experimental Extended Community */
#define BGP_EXT_COM_TYPE_HIGH_TR_EXP_FSIP4 0x81 /* http://tools.ietf.org/html/draft-haas-idr-flowspec-redirect-rt-bis-00 */
#define BGP_EXT_COM_TYPE_HIGH_TR_EXP_FSAS4 0x82 /* http://tools.ietf.org/html/draft-haas-idr-flowspec-redirect-rt-bis-00 */
#define BGP_EXT_COM_TYPE_HIGH_TR_EXP_2 0x81 /* Generic Transitive Experimental Use Extended Community Part 2 [RFC7674] */
#define BGP_EXT_COM_TYPE_HIGH_TR_EXP_3 0x82 /* Generic Transitive Experimental Use Extended Community Part 3 [RFC7674] */
#define BGP_EXT_COM_TYPE_HIGH_TR_EXP_EIGRP 0x88 /* EIGRP attributes - http://www.cisco.com/c/en/us/td/docs/ios/12_0s/feature/guide/seipecec.html */
/* BGP non transitive extended community type high octet */
@ -348,12 +349,18 @@ static dissector_handle_t bgp_handle;
#define BGP_EXT_COM_STYPE_EVPN_MMAC 0x00 /* MAC Mobility [draft-ietf-l2vpn-pbb-evpn] */
#define BGP_EXT_COM_STYPE_EVPN_LABEL 0x01 /* ESI MPLS Label [draft-ietf-l2vpn-evpn] */
#define BGP_EXT_COM_STYPE_EVPN_IMP 0x02 /* ES Import [draft-sajassi-l2vpn-evpn-segment-route] */
#define BGP_EXT_COM_STYPE_EVPN_ROUTERMAC 0x03 /* draft-sajassi-l2vpn-evpn-inter-subnet-forwarding */
#define BGP_EXT_COM_STYPE_EVPN_L2ATTR 0x04 /* RFC 8214 */
#define BGP_EXT_COM_STYPE_EVPN_ETREE 0x05 /* RFC 8317 */
#define BGP_EXT_COM_STYPE_EVPN_DF 0x06 /* RFC 8584 */
#define BGP_EXT_COM_STYPE_EVPN_ISID 0x07 /* draft-sajassi-bess-evpn-virtual-eth-segment */
#define BGP_EXT_COM_STYPE_EVPN_ND 0x08 /* draft-snr-bess-evpn-na-flags */
#define BGP_EXT_COM_STYPE_EVPN_MCFLAGS 0x09 /* draft-ietf-bess-evpn-igmp-mld-proxy */
#define BGP_EXT_COM_STYPE_EVPN_EVIRT0 0x0a /* draft-ietf-bess-evpn-igmp-mld-proxy */
#define BGP_EXT_COM_STYPE_EVPN_EVIRT1 0x0b /* draft-ietf-bess-evpn-igmp-mld-proxy */
#define BGP_EXT_COM_STYPE_EVPN_EVIRT2 0x0c /* draft-ietf-bess-evpn-igmp-mld-proxy */
#define BGP_EXT_COM_STYPE_EVPN_EVIRT3 0x0d /* draft-ietf-bess-evpn-igmp-mld-proxy */
#define BGP_EXT_COM_STYPE_EVPN_ATTACHCIRT 0x0e /* draft-sajassi-bess-evpn-ac-aware-bundling */
/* RFC 7432 Flag single active mode */
#define BGP_EXT_COM_ESI_LABEL_FLAGS 0x01 /* bitmask: set for single active multi-homing site */
@ -370,6 +377,10 @@ static dissector_handle_t bgp_handle;
#define BGP_EXT_COM_EVPN_L2ATTR_FLAG_CI 0x10 /* CWI extended community can be included */
#define BGP_EXT_COM_EVPN_L2ATTR_FLAG_RESERVED 0xFFE0 /* Reserved */
/* RFC 8317 Flags EVPN E-Tree Attributes */
#define BGP_EXT_COM_EVPN_ETREE_FLAG_L 0x01 /* Leaf-Indication */
#define BGP_EXT_COM_EVPN_ETREE_FLAG_RESERVED 0xFE /* Reserved */
/* EPVN route AD NLRI ESI type */
#define BGP_NLRI_EVPN_ESI_VALUE 0x00 /* ESI type 0, 9 bytes interger */
#define BGP_NLRI_EVPN_ESI_LACP 0x01 /* ESI type 1, LACP 802.1AX */
@ -478,20 +489,27 @@ static dissector_handle_t bgp_handle;
#define BGP_EXT_COM_STYPE_EXP_OSPF_RT 0x00 /* OSPF Route Type, deprecated [RFC4577] */
#define BGP_EXT_COM_STYPE_EXP_OSPF_RID 0x01 /* OSPF Router ID, deprecated [RFC4577] */
#define BGP_EXT_COM_STYPE_EXP_SEC_GROUP 0x04 /* Security Group [https://github.com/Juniper/contrail-controller/wiki/BGP-Extended-Communities#security-group] */
#define BGP_EXT_COM_STYPE_EXP_OSPF_DID 0x05 /* OSPF Domain ID, deprecated [RFC4577] */
#define BGP_EXT_COM_STYPE_EXP_F_TR 0x06 /* Flow spec traffic-rate [RFC5575] */
#define BGP_EXT_COM_STYPE_EXP_F_TA 0x07 /* Flow spec traffic-action [RFC5575] */
#define BGP_EXT_COM_STYPE_EXP_F_RED 0x08 /* Flow spec redirect [RFC5575] */
#define BGP_EXT_COM_STYPE_EXP_F_RMARK 0x09 /* Flow spec traffic-remarking [RFC5575] */
#define BGP_EXT_COM_STYPE_EXP_L2 0x0a /* Layer2 Info Extended Community [RFC4761] */
#define BGP_EXT_COM_STYPE_EXP_ETREE 0x0b /* E-Tree Info [RFC7796] */
#define BGP_EXT_COM_STYPE_EXP_TAG 0x84 /* Tag [https://github.com/Juniper/contrail-controller/wiki/BGP-Extended-Communities#tag] */
#define BGP_EXT_COM_STYPE_EXP_SUB_CLUS 0x85 /* Origin Sub-Cluster [https://github.com/robric/wiki-contrail-controller/blob/master/BGP-Extended-Communities.md] */
/* BGP Generic Transitive Experimental redirect RT format IPv4:2 bytes Use Extended Community Sub-Types */
/* BGP Generic Transitive Experimental Use Extended Community Part 2 */
#define BGP_EXT_COM_STYPE_EXP_F_RED_IP4 0x08
#define BGP_EXT_COM_STYPE_EXP_2_FLOW_RED 0x08
/* BGP Generic Transitive Experimental redirect RT format AS4:2 bytes Use Extended Community Sub-Types */
/* BGP Generic Transitive Experimental Use Extended Community Part 3 */
#define BGP_EXT_COM_STYPE_EXP_F_RED_AS4 0x08
#define BGP_EXT_COM_STYPE_EXP_3_SEC_GROUP 0x04
#define BGP_EXT_COM_STYPE_EXP_3_FLOW_RED 0x08
#define BGP_EXT_COM_STYPE_EXP_3_TAG4 0x84
#define BGP_EXT_COM_STYPE_EXP_3_SUB_CLUS 0x85
/* BGP Transitive Experimental EIGRP route attribute Sub-Types */
@ -526,6 +544,12 @@ static dissector_handle_t bgp_handle;
#define BGP_EXT_COM_L2_FLAG_C 0x02
#define BGP_EXT_COM_L2_FLAG_S 0x01
/* extended community E-Tree Info flags */
#define BGP_EXT_COM_ETREE_FLAG_RESERVED 0xFFFC
#define BGP_EXT_COM_ETREE_FLAG_P 0x0002
#define BGP_EXT_COM_ETREE_FLAG_V 0x0001
/* Extended community QoS Marking technology type */
#define QOS_TECH_TYPE_DSCP 0x00 /* DiffServ enabled IP (DSCP encoding) */
#define QOS_TECH_TYPE_802_1q 0x01 /* Ethernet using 802.1q priority tag */
@ -1169,10 +1193,12 @@ static const value_string bgpext_com_type_high[] = {
{ BGP_EXT_COM_TYPE_HIGH_TR_QOS, "Transitive QoS Marking" },
{ BGP_EXT_COM_TYPE_HIGH_TR_COS, "Transitive CoS Capability" },
{ BGP_EXT_COM_TYPE_HIGH_TR_EVPN, "Transitive EVPN" },
{ BGP_EXT_COM_TYPE_HIGH_TR_FLOW_I, "FlowSpec Transitive" },
{ BGP_EXT_COM_TYPE_HIGH_TR_FLOW, "Transitive Flow spec redirect/mirror to IP next-hop" },
{ BGP_EXT_COM_TYPE_HIGH_TR_EXP, "Transitive Experimental"},
{ BGP_EXT_COM_TYPE_HIGH_TR_EXP_FSIP4, "Transitive Experimental Redirect IPv4"},
{ BGP_EXT_COM_TYPE_HIGH_TR_EXP_FSAS4, "Transitive Experimental Redirect AS4"},
{ BGP_EXT_COM_TYPE_HIGH_TR_FLOW_R, "Transitive FlowSpec Redirect to indirection-id" },
{ BGP_EXT_COM_TYPE_HIGH_TR_EXP, "Generic Transitive Experimental Use"},
{ BGP_EXT_COM_TYPE_HIGH_TR_EXP_2, "Generic Transitive Experimental Use Part 2"},
{ BGP_EXT_COM_TYPE_HIGH_TR_EXP_3, "Generic Transitive Experimental Use Part 3 "},
{ BGP_EXT_COM_TYPE_HIGH_TR_EXP_EIGRP, "Transitive Experimental EIGRP" },
{ BGP_EXT_COM_TYPE_HIGH_NTR_AS2, "Non-Transitive 2-Octet AS-Specific" },
{ BGP_EXT_COM_TYPE_HIGH_NTR_IP4, "Non-Transitive IPv4-Address-Specific" },
@ -1182,26 +1208,35 @@ static const value_string bgpext_com_type_high[] = {
{ 0, NULL}
};
static const value_string bgpext_com_stype_tr_exp_fs_ip4[] = {
{ BGP_EXT_COM_STYPE_EXP_F_RED_IP4, "Route Target"},
static const value_string bgpext_com_stype_tr_exp_2[] = {
{ BGP_EXT_COM_STYPE_EXP_2_FLOW_RED, "Flow spec redirect IPv4 format"},
{ 0, NULL}
};
static const value_string bgpext_com_stype_tr_exp_fs_as4[] = {
{ BGP_EXT_COM_STYPE_EXP_F_RED_AS4, "Route Target"},
static const value_string bgpext_com_stype_tr_exp_3[] = {
{ BGP_EXT_COM_STYPE_EXP_3_SEC_GROUP, "Security Group AS4"},
{ BGP_EXT_COM_STYPE_EXP_3_FLOW_RED, "Flow spec redirect AS-4byte format"},
{ BGP_EXT_COM_STYPE_EXP_3_TAG4, "Tag4"},
{ BGP_EXT_COM_STYPE_EXP_3_SUB_CLUS, "Origin Sub-Cluster4"},
{ 0, NULL}
};
static const value_string bgpext_com_stype_tr_evpn[] = {
{ BGP_EXT_COM_STYPE_EVPN_MMAC, "MAC Mobility" },
{ BGP_EXT_COM_STYPE_EVPN_LABEL, "ESI MPLS Label" },
{ BGP_EXT_COM_STYPE_EVPN_IMP, "ES Import" },
{ BGP_EXT_COM_STYPE_EVPN_L2ATTR, "Layer 2 Attributes" },
{ BGP_EXT_COM_STYPE_EVPN_MCFLAGS, "Multicast Flags Extended Community" },
{ BGP_EXT_COM_STYPE_EVPN_EVIRT0, "EVI-RT Type 0 Extended Community" },
{ BGP_EXT_COM_STYPE_EVPN_EVIRT1, "EVI-RT Type 1 Extended Community" },
{ BGP_EXT_COM_STYPE_EVPN_EVIRT2, "EVI-RT Type 2 Extended Community" },
{ BGP_EXT_COM_STYPE_EVPN_EVIRT3, "EVI-RT Type 3 Extended Community" },
{ BGP_EXT_COM_STYPE_EVPN_MMAC, "MAC Mobility" },
{ BGP_EXT_COM_STYPE_EVPN_LABEL, "ESI MPLS Label" },
{ BGP_EXT_COM_STYPE_EVPN_IMP, "ES Import" },
{ BGP_EXT_COM_STYPE_EVPN_ROUTERMAC, "EVPN Router MAC" },
{ BGP_EXT_COM_STYPE_EVPN_L2ATTR, "Layer 2 Attributes" },
{ BGP_EXT_COM_STYPE_EVPN_ETREE, "E-Tree" },
{ BGP_EXT_COM_STYPE_EVPN_DF, "DF Election" },
{ BGP_EXT_COM_STYPE_EVPN_ISID, "I-SID" },
{ BGP_EXT_COM_STYPE_EVPN_ND, "ND" },
{ BGP_EXT_COM_STYPE_EVPN_MCFLAGS, "Multicast Flags Extended Community" },
{ BGP_EXT_COM_STYPE_EVPN_EVIRT0, "EVI-RT Type 0 Extended Community" },
{ BGP_EXT_COM_STYPE_EVPN_EVIRT1, "EVI-RT Type 1 Extended Community" },
{ BGP_EXT_COM_STYPE_EVPN_EVIRT2, "EVI-RT Type 2 Extended Community" },
{ BGP_EXT_COM_STYPE_EVPN_EVIRT3, "EVI-RT Type 3 Extended Community" },
{ BGP_EXT_COM_STYPE_EVPN_ATTACHCIRT, "EVPN Attachment Circuit" },
{ 0, NULL}
};
@ -1304,12 +1339,16 @@ static const value_string bgpext_com_stype_ntr_opaque[] = {
static const value_string bgpext_com_stype_tr_exp[] = {
{ BGP_EXT_COM_STYPE_EXP_OSPF_RT, "OSPF Route Type" },
{ BGP_EXT_COM_STYPE_EXP_OSPF_RID, "OSPF Router ID" },
{ BGP_EXT_COM_STYPE_EXP_SEC_GROUP, "Security Group" },
{ BGP_EXT_COM_STYPE_EXP_OSPF_DID, "OSPF Domain Identifier" },
{ BGP_EXT_COM_STYPE_EXP_F_TR, "Flow spec traffic-rate" },
{ BGP_EXT_COM_STYPE_EXP_F_TA, "Flow spec traffic-action" },
{ BGP_EXT_COM_STYPE_EXP_F_RED, "Flow spec redirect AS 2 bytes" },
{ BGP_EXT_COM_STYPE_EXP_F_RMARK, "Flow spec traffic-remarking" },
{ BGP_EXT_COM_STYPE_EXP_L2, "Layer2 Info" },
{ BGP_EXT_COM_STYPE_EXP_ETREE, "E-Tree Info" },
{ BGP_EXT_COM_STYPE_EXP_TAG, "Tag" },
{ BGP_EXT_COM_STYPE_EXP_SUB_CLUS, "Origin Sub-Cluster" },
{ 0, NULL}
};
@ -2246,8 +2285,8 @@ static int hf_bgp_ext_com_stype_tr_opaque = -1;
static int hf_bgp_ext_com_stype_ntr_opaque = -1;
static int hf_bgp_ext_com_tunnel_type = -1;
static int hf_bgp_ext_com_stype_tr_exp = -1;
static int hf_bgp_ext_com_stype_tr_exp_fs_ip4 = -1;
static int hf_bgp_ext_com_stype_tr_exp_fs_as4 = -1;
static int hf_bgp_ext_com_stype_tr_exp_2 = -1;
static int hf_bgp_ext_com_stype_tr_exp_3 = -1;
static int hf_bgp_ext_com_value_as2 = -1;
static int hf_bgp_ext_com_value_as4 = -1;
@ -2303,8 +2342,18 @@ static int hf_bgp_ext_com_l2_esi_label_flag = -1;
static int hf_bgp_ext_com_evpn_mmac_flag = -1;
static int hf_bgp_ext_com_evpn_mmac_seq = -1;
static int hf_bgp_ext_com_evpn_esirt = -1;
static int hf_bgp_ext_com_evpn_routermac = -1;
static int hf_bgp_ext_com_evpn_mmac_flag_sticky = -1;
/* BGP E-Tree Info extended community RFC 7796 */
static int hf_bgp_ext_com_etree_flags = -1;
static int hf_bgp_ext_com_etree_root_vlan = -1;
static int hf_bgp_ext_com_etree_leaf_vlan = -1;
static int hf_bgp_ext_com_etree_flag_reserved = -1;
static int hf_bgp_ext_com_etree_flag_p = -1;
static int hf_bgp_ext_com_etree_flag_v = -1;
/* VPWS Support in EVPN RFC 8214 */
/* draft-yu-bess-evpn-l2-attributes-04 */
@ -2318,6 +2367,13 @@ static int hf_bgp_ext_com_evpn_l2attr_flag_b = -1;
static int hf_bgp_ext_com_evpn_l2attr_l2_mtu = -1;
static int hf_bgp_ext_com_evpn_l2attr_reserved = -1;
/* E-Tree RFC8317 */
static int hf_bgp_ext_com_evpn_etree_flags = -1;
static int hf_bgp_ext_com_evpn_etree_flag_reserved = -1;
static int hf_bgp_ext_com_evpn_etree_flag_l = -1;
static int hf_bgp_ext_com_evpn_etree_reserved = -1;
/* BGP Cost Community */
static int hf_bgp_ext_com_cost_poi = -1;
@ -2401,8 +2457,10 @@ static gint ett_bgp_ext_com_type = -1; /* Extended Community Type High tree (IA
static gint ett_bgp_extended_com_fspec_redir = -1; /* extended communities BGP flow act redirect */
static gint ett_bgp_ext_com_flags = -1; /* extended communities flags tree */
static gint ett_bgp_ext_com_l2_flags = -1; /* extended commuties tree for l2 services flags */
static gint ett_bgp_ext_com_etree_flags = -1;
static gint ett_bgp_ext_com_evpn_mmac_flags = -1;
static gint ett_bgp_ext_com_evpn_l2attr_flags = -1;
static gint ett_bgp_ext_com_evpn_etree_flags = -1;
static gint ett_bgp_ext_com_cost_cid = -1; /* Cost community CommunityID tree (replace/evaluate after bit) */
static gint ett_bgp_ext_com_ospf_rt_opt = -1; /* Tree for Options bitfield of OSPF Route Type extended community */
static gint ett_bgp_ext_com_eigrp_flags = -1; /* Tree for EIGRP route flags */
@ -7094,6 +7152,12 @@ dissect_bgp_update_ext_com(proto_tree *parent_tree, tvbuff_t *tvb, guint16 tlen,
proto_item_append_text(community_item, " RT: %s", tvb_ether_to_str(tvb, offset+2));
break;
case BGP_EXT_COM_STYPE_EVPN_ROUTERMAC:
proto_tree_add_item(community_tree, hf_bgp_ext_com_evpn_routermac, tvb, offset+2, 6, ENC_NA);
proto_item_append_text(community_item, " Router MAC: %s", tvb_ether_to_str(tvb, offset+2));
break;
case BGP_EXT_COM_STYPE_EVPN_L2ATTR:
{
static const int *l2attr_flags[] = {
@ -7115,6 +7179,24 @@ dissect_bgp_update_ext_com(proto_tree *parent_tree, tvbuff_t *tvb, guint16 tlen,
}
break;
case BGP_EXT_COM_STYPE_EVPN_ETREE:
{
static const int *etree_flags[] = {
&hf_bgp_ext_com_evpn_etree_flag_reserved,
&hf_bgp_ext_com_evpn_etree_flag_l,
NULL
};
proto_tree_add_bitmask(community_tree, tvb, offset+2, hf_bgp_ext_com_evpn_etree_flags,
ett_bgp_ext_com_evpn_etree_flags, etree_flags, ENC_BIG_ENDIAN);
proto_tree_add_item(community_tree, hf_bgp_ext_com_evpn_etree_reserved, tvb, offset+3, 2, ENC_NA);
proto_tree_add_item(community_tree, hf_bgp_update_mpls_label_value_20bits, tvb, offset+5, 3, ENC_BIG_ENDIAN);
proto_tree_add_item(community_tree, hf_bgp_update_mpls_traffic_class, tvb, offset+5, 3, ENC_BIG_ENDIAN);
proto_tree_add_item(community_tree, hf_bgp_update_mpls_bottom_stack, tvb, offset+5, 3, ENC_BIG_ENDIAN);
}
break;
default:
/* The particular EVPN subtype is unknown or the
* dissector is not written yet. We will dump the
@ -7231,6 +7313,21 @@ dissect_bgp_update_ext_com(proto_tree *parent_tree, tvbuff_t *tvb, guint16 tlen,
}
break;
case BGP_EXT_COM_STYPE_EXP_ETREE:
{
static const int * com_etree_flags[] = {
&hf_bgp_ext_com_etree_flag_reserved,
&hf_bgp_ext_com_etree_flag_p,
&hf_bgp_ext_com_etree_flag_v,
NULL
};
proto_tree_add_item(community_tree, hf_bgp_ext_com_etree_root_vlan,tvb,offset+2, 2, ENC_BIG_ENDIAN);
proto_tree_add_item(community_tree, hf_bgp_ext_com_etree_leaf_vlan,tvb,offset+4, 2, ENC_BIG_ENDIAN);
proto_tree_add_bitmask(community_tree, tvb, offset+6, hf_bgp_ext_com_etree_flags, ett_bgp_ext_com_etree_flags, com_etree_flags, ENC_BIG_ENDIAN);
}
break;
default:
/* The particular Experimental subtype is unknown or
* the dissector is not written yet. We will dump the
@ -7248,25 +7345,66 @@ dissect_bgp_update_ext_com(proto_tree *parent_tree, tvbuff_t *tvb, guint16 tlen,
}
break;
case BGP_EXT_COM_TYPE_HIGH_TR_EXP_FSIP4:
proto_tree_add_item(community_tree, hf_bgp_ext_com_stype_tr_exp_fs_ip4, tvb, offset+1, 1, ENC_BIG_ENDIAN);
proto_tree_add_item(community_tree, hf_bgp_ext_com_value_IP4, tvb, offset+2, 4, ENC_NA);
proto_tree_add_item(community_tree, hf_bgp_ext_com_value_an2, tvb, offset+6, 2, ENC_BIG_ENDIAN);
case BGP_EXT_COM_TYPE_HIGH_TR_EXP_2:
proto_tree_add_item(community_tree, hf_bgp_ext_com_stype_tr_exp_2, tvb, offset+1, 1, ENC_BIG_ENDIAN);
proto_item_set_text(community_item, "%s: %s:%u",
val_to_str(com_stype_low_byte, bgpext_com_stype_tr_exp_fs_ip4, "Unknown subtype 0x%02x"),
tvb_ip_to_str(tvb, offset+2), tvb_get_ntohs(tvb,offset+6));
proto_item_set_text(community_item, "%s:",
val_to_str(com_stype_low_byte, bgpext_com_stype_tr_exp_2, "Unknown subtype 0x%02x"));
switch (com_stype_low_byte) {
case BGP_EXT_COM_STYPE_EXP_2_FLOW_RED:
{
proto_tree_add_item(community_tree, hf_bgp_ext_com_value_IP4, tvb, offset+2, 4, ENC_NA);
proto_tree_add_item(community_tree, hf_bgp_ext_com_value_an2, tvb, offset+6, 2, ENC_BIG_ENDIAN);
}
break;
default:
/* The particular Experimental subtype is unknown or
* the dissector is not written yet. We will dump the
* entire community value in 2-byte short words.
*/
proto_tree_add_uint64_format_value(community_tree, hf_bgp_ext_com_value_raw, tvb, offset+2, 6,
tvb_get_ntoh48 (tvb, offset+2), "0x%04x 0x%04x 0x%04x",
tvb_get_ntohs(tvb,offset+2),
tvb_get_ntohs(tvb,offset+4),
tvb_get_ntohs(tvb,offset+6));
proto_item_append_text(community_item, " 0x%04x 0x%04x 0x%04x",
tvb_get_ntohs(tvb,offset+2), tvb_get_ntohs(tvb,offset+4), tvb_get_ntohs(tvb,offset+6));
break;
}
break;
case BGP_EXT_COM_TYPE_HIGH_TR_EXP_FSAS4:
proto_tree_add_item(community_tree, hf_bgp_ext_com_stype_tr_exp_fs_as4, tvb, offset+1, 1, ENC_BIG_ENDIAN);
proto_tree_add_item(community_tree, hf_bgp_ext_com_value_as4, tvb, offset+2, 4, ENC_BIG_ENDIAN);
proto_tree_add_item(community_tree, hf_bgp_ext_com_value_an2, tvb, offset+6, 2, ENC_BIG_ENDIAN);
case BGP_EXT_COM_TYPE_HIGH_TR_EXP_3:
proto_tree_add_item(community_tree, hf_bgp_ext_com_stype_tr_exp_3, tvb, offset+1, 1, ENC_BIG_ENDIAN);
proto_item_set_text(community_item, "%s: %u.%u(%u):%u",
val_to_str(com_stype_low_byte, bgpext_com_stype_tr_exp_fs_as4, "Unknown subtype 0x%02x"),
tvb_get_ntohs(tvb,offset+2), tvb_get_ntohs(tvb,offset+4), tvb_get_ntohl(tvb,offset+2),
tvb_get_ntohs(tvb,offset+6));
proto_item_set_text(community_item, "%s:",
val_to_str(com_stype_low_byte, bgpext_com_stype_tr_exp_3, "Unknown subtype 0x%02x"));
switch (com_stype_low_byte) {
case BGP_EXT_COM_STYPE_EXP_3_FLOW_RED:
{
proto_tree_add_item(community_tree, hf_bgp_ext_com_value_as4, tvb, offset+2, 4, ENC_BIG_ENDIAN);
proto_tree_add_item(community_tree, hf_bgp_ext_com_value_an2, tvb, offset+6, 2, ENC_BIG_ENDIAN);
}
break;
default:
/* The particular Experimental subtype is unknown or
* the dissector is not written yet. We will dump the
* entire community value in 2-byte short words.
*/
proto_tree_add_uint64_format_value(community_tree, hf_bgp_ext_com_value_raw, tvb, offset+2, 6,
tvb_get_ntoh48 (tvb, offset+2), "0x%04x 0x%04x 0x%04x",
tvb_get_ntohs(tvb,offset+2),
tvb_get_ntohs(tvb,offset+4),
tvb_get_ntohs(tvb,offset+6));
proto_item_append_text(community_item, " 0x%04x 0x%04x 0x%04x",
tvb_get_ntohs(tvb,offset+2), tvb_get_ntohs(tvb,offset+4), tvb_get_ntohs(tvb,offset+6));
break;
}
break;
case BGP_EXT_COM_TYPE_HIGH_TR_EXP_EIGRP:
@ -10423,12 +10561,12 @@ proto_register_bgp(void)
{ &hf_bgp_ext_com_stype_tr_exp,
{ "Subtype (Experimental)", "bgp.ext_com.stype_tr_exp", FT_UINT8, BASE_HEX,
VALS(bgpext_com_stype_tr_exp), 0x0, "Experimental Transitive Extended Community subtype", HFILL}},
{ &hf_bgp_ext_com_stype_tr_exp_fs_ip4,
{ "Subtype (Flowspec)", "bgp.ext_com.stype_tr_exp_fs_ip4", FT_UINT8, BASE_HEX,
VALS(bgpext_com_stype_tr_exp_fs_ip4), 0x0, "IPv4-Address-Specific Flowspec Experimental Extended Community subtype", HFILL}},
{ &hf_bgp_ext_com_stype_tr_exp_fs_as4,
{ "Subtype (Flowspec)", "bgp.ext_com.stype_tr_exp_fs_as4", FT_UINT8, BASE_HEX,
VALS(bgpext_com_stype_tr_exp_fs_as4), 0x0, "4-Octet AS-Specific Flowspec Experimental Extended Community subtype", HFILL}},
{ &hf_bgp_ext_com_stype_tr_exp_2,
{ "Subtype (Experimental Part 2)", "bgp.ext_com.stype_tr_exp_2", FT_UINT8, BASE_HEX,
VALS(bgpext_com_stype_tr_exp_2), 0x0, "Generic Transitive Experimental Use Extended Community Part 2 Sub-Types", HFILL}},
{ &hf_bgp_ext_com_stype_tr_exp_3,
{ "Subtype (Experimental Part 3)", "bgp.ext_com.stype_tr_exp_3", FT_UINT8, BASE_HEX,
VALS(bgpext_com_stype_tr_exp_3), 0x0, "Generic Transitive Experimental Use Extended Community Part 3 Sub-Types", HFILL}},
{ &hf_bgp_ext_com_value_as2,
{ "2-Octet AS", "bgp.ext_com.value_as2", FT_UINT16, BASE_DEC,
NULL, 0x0, "Global Administrator Field value (2B Autonomous System Number)", HFILL }},
@ -10556,6 +10694,24 @@ proto_register_bgp(void)
{ &hf_bgp_ext_com_l2_esi_label_flag,
{ "Single active bit", "bgp.ext_com_l2.esi_label_flag",FT_BOOLEAN, 8,
TFS(&tfs_esi_label_flag), BGP_EXT_COM_ESI_LABEL_FLAGS, NULL, HFILL }},
{ &hf_bgp_ext_com_etree_root_vlan,
{ "Root VLAN", "bgp.ext_com_etree.root_vlan", FT_UINT16, BASE_DEC,
NULL, 0x0FFF, NULL, HFILL }},
{ &hf_bgp_ext_com_etree_leaf_vlan,
{ "Leaf VLAN", "bgp.ext_com_etree.leaf_vlan", FT_UINT16, BASE_DEC,
NULL, 0x0FFF, NULL, HFILL }},
{ &hf_bgp_ext_com_etree_flags,
{ "Flags", "bgp.ext_com_etree.flags", FT_UINT16, BASE_HEX,
NULL, 0x0, NULL, HFILL }},
{ &hf_bgp_ext_com_etree_flag_reserved,
{ "Reserved", "bgp.ext_com_etree.flag_reserved",FT_UINT16, BASE_HEX,
NULL, BGP_EXT_COM_ETREE_FLAG_RESERVED, NULL, HFILL }},
{ &hf_bgp_ext_com_etree_flag_p,
{ "P", "bgp.ext_com_etree.flag_p",FT_BOOLEAN, 8,
TFS(&tfs_set_notset), BGP_EXT_COM_ETREE_FLAG_P, "PE is attached with leaf nodes only", HFILL }},
{ &hf_bgp_ext_com_etree_flag_v,
{ "V", "bgp.ext_com_etree.flag_v",FT_BOOLEAN, 8,
TFS(&tfs_set_notset), BGP_EXT_COM_ETREE_FLAG_V, "VLAN mapping", HFILL }},
{ &hf_bgp_ext_com_evpn_mmac_flag,
{ "Flags", "bgp.ext_com_evpn.mmac.flags", FT_UINT8, BASE_HEX,
NULL, 0x0, "MAC Mobility flags", HFILL }},
@ -10568,6 +10724,9 @@ proto_register_bgp(void)
{ &hf_bgp_ext_com_evpn_esirt,
{ "ES-Import Route Target", "bgp.ext_com_evpn.esi.rt", FT_ETHER, BASE_NONE,
NULL, 0x0, "Route Target as a MAC Address", HFILL }},
{ &hf_bgp_ext_com_evpn_routermac,
{ "Router MAC", "bgp.ext_com_evpn.esi.router_mac", FT_ETHER, BASE_NONE,
NULL, 0x0, "Router MAC Address", HFILL }},
{ &hf_bgp_ext_com_evpn_l2attr_flags,
{ "Flags", "bgp.ext_com_evpn.l2attr.flags", FT_UINT16, BASE_HEX,
NULL, 0x0, "EVPN L2 attribute flags", HFILL }},
@ -10595,6 +10754,18 @@ proto_register_bgp(void)
{ &hf_bgp_ext_com_evpn_l2attr_reserved,
{ "Reserved", "bgp.ext_com_evpn.l2attr.reserved", FT_BYTES, BASE_NONE,
NULL, 0x0, NULL, HFILL }},
{ &hf_bgp_ext_com_evpn_etree_flags,
{ "Flags", "bgp.ext_com_evpn.etree.flags", FT_UINT8, BASE_HEX,
NULL, 0x0, "EVPN E-Tree attribute flags", HFILL }},
{ &hf_bgp_ext_com_evpn_etree_flag_reserved,
{ "Reserved", "bgp.ext_com_evpn.etree.flag_reserved", FT_UINT8, BASE_HEX,
NULL, BGP_EXT_COM_EVPN_ETREE_FLAG_RESERVED, NULL, HFILL }},
{ &hf_bgp_ext_com_evpn_etree_flag_l,
{ "L flag", "bgp.ext_com_evpn.etree.flag_l", FT_BOOLEAN, 8,
TFS(&tfs_set_notset), BGP_EXT_COM_EVPN_ETREE_FLAG_L, "Leaf-Indication", HFILL }},
{ &hf_bgp_ext_com_evpn_etree_reserved,
{ "Reserved", "bgp.ext_com_evpn.etree.reserved", FT_BYTES, BASE_NONE,
NULL, 0x0, NULL, HFILL }},
/* BGP Cost Community */
{ &hf_bgp_ext_com_cost_poi,
{ "Point of insertion", "bgp.ext_com_cost.poi", FT_UINT8, BASE_DEC,
@ -11321,8 +11492,10 @@ proto_register_bgp(void)
&ett_bgp_extended_com_fspec_redir,
&ett_bgp_ext_com_flags,
&ett_bgp_ext_com_l2_flags,
&ett_bgp_ext_com_etree_flags,
&ett_bgp_ext_com_evpn_mmac_flags,
&ett_bgp_ext_com_evpn_l2attr_flags,
&ett_bgp_ext_com_evpn_etree_flags,
&ett_bgp_ext_com_cost_cid,
&ett_bgp_ext_com_ospf_rt_opt,
&ett_bgp_ext_com_eigrp_flags,