2 * Routines for BGP packet dissection.
3 * Copyright 1999, Jun-ichiro itojun Hagino <itojun@itojun.org>
5 * Wireshark - Network traffic analyzer
6 * By Gerald Combs <gerald@wireshark.org>
7 * Copyright 1998 Gerald Combs
9 * SPDX-License-Identifier: GPL-2.0-or-later
12 * RFC1771 A Border Gateway Protocol 4 (BGP-4)
13 * RFC1965 Autonomous System Confederations for BGP
14 * RFC1997 BGP Communities Attribute
15 * RFC2547 BGP/MPLS VPNs
16 * RFC2796 BGP Route Reflection An alternative to full mesh IBGP
17 * RFC2842 Capabilities Advertisement with BGP-4
18 * RFC2858 Multiprotocol Extensions for BGP-4
19 * RFC2918 Route Refresh Capability for BGP-4
20 * RFC3107 Carrying Label Information in BGP-4
21 * RFC4360 BGP Extended Communities Attribute
22 * RFC4486 Subcodes for BGP Cease Notification Message
23 * RFC4724 Graceful Restart Mechanism for BGP
24 * RFC5512 The BGP Encapsulation Subsequent Address Family Identifier (SAFI)
25 * RFC5575 Dissemination of flow specification rules
26 * RFC5640 Load-Balancing for Mesh Softwires
27 * RFC6368 Internal BGP as the Provider/Customer Edge Protocol for
28 BGP/MPLS IP Virtual Private Networks (VPNs)
29 * RFC6608 Subcodes for BGP Finite State Machine Error
30 * RFC6793 BGP Support for Four-Octet Autonomous System (AS) Number Space
31 * RFC7311 The Accumulated IGP Metric Attribute for BGP
32 * RFC7432 BGP MPLS-Based Ethernet VPN
33 * RFC7752 North-Bound Distribution of Link-State and Traffic Engineering (TE)
35 * RFC8092 BGP Large Communities Attribute
36 * RFC8214 Virtual Private Wire Service Support in Ethernet VPN
37 * RFC9234 Route Leak Prevention and Detection Using Roles in UPDATE and OPEN Messages
38 * draft-ietf-idr-dynamic-cap
39 * draft-ietf-idr-bgp-enhanced-route-refresh-02
40 * draft-knoll-idr-qos-attribute-03
41 * draft-nalawade-kapoor-tunnel-safi-05
42 * draft-ietf-idr-add-paths-04 Additional-Path for BGP-4
43 * RFC9085 Border Gateway Protocol - Link State (BGP-LS) Extensions for Segment Routing
44 * draft-ietf-idr-custom-decision-07 BGP Custom Decision Process
45 * draft-rabadan-l2vpn-evpn-prefix-advertisement IP Prefix Advertisement
47 * RFC8669 Segment Routing Prefix Segment Identifier Extensions for BGP
48 * http://www.iana.org/assignments/bgp-parameters/ (last updated 2012-04-26)
49 * RFC8538 Notification Message Support for BGP Graceful Restart
50 * draft-ietf-bess-evpn-igmp-mld-proxy-03
51 * draft-ietf-idr-tunnel-encaps-15
52 * draft-ietf-idr-segment-routing-te-policy-08
53 * draft-yu-bess-evpn-l2-attributes-04
54 * draft-ietf-bess-srv6-services-05
55 * RFC9104 Distribution of Traffic Engineering Extended Administrative Groups
56 Using the Border Gateway Protocol - Link State
57 * RFC8365 A Network Virtualization Overlay Solution Using Ethernet VPN (EVPN)
58 * draft-abraitis-bgp-version-capability-13
59 * draft-ietf-idr-bgp-bfd-strict-mode
62 * Destination Preference Attribute for BGP (work in progress)
63 * RFC1863 A BGP/IDRP Route Server alternative to a full mesh routing
65 /* (c) Copyright 2015, Pratik Yeole <pyeole@ncsu.edu>
66 - Fixed incorrect decoding of Network Layer Reachability Information (NLRI) in BGP UPDATE message with add-path support
71 #include <epan/packet.h>
73 #include <epan/prefs.h>
74 #include <epan/expert.h>
75 #include <epan/to_str.h>
76 #include <epan/proto_data.h>
77 #include <epan/ipproto.h>
79 #include <wsutil/str_util.h>
80 #include "packet-ip.h"
81 #include "packet-tcp.h"
82 #include "packet-ldp.h"
83 #include "packet-bgp.h"
84 #include "packet-eigrp.h"
86 void proto_register_bgp(void);
87 void proto_reg_handoff_bgp(void);
89 static dissector_handle_t bgp_handle
;
91 /* #define MAX_STR_LEN 256 */
93 /* some handy things to know */
94 #define BGP_MAX_PACKET_SIZE 4096
95 #define BGP_MARKER_SIZE 16 /* size of BGP marker */
96 #define BGP_HEADER_SIZE 19 /* size of BGP header, including marker */
97 #define BGP_MIN_OPEN_MSG_SIZE 29
98 #define BGP_MIN_UPDATE_MSG_SIZE 23
99 #define BGP_MIN_NOTIFICATION_MSG_SIZE 21
100 #define BGP_MIN_KEEPALVE_MSG_SIZE BGP_HEADER_SIZE
101 #define BGP_TCP_PORT 179
102 #define BGP_ROUTE_DISTINGUISHER_SIZE 8
104 /* BGP message types */
107 #define BGP_NOTIFICATION 3
108 #define BGP_KEEPALIVE 4
109 #define BGP_ROUTE_REFRESH 5
110 #define BGP_CAPABILITY 6
111 #define BGP_ROUTE_REFRESH_CISCO 0x80
113 #define BGP_SIZE_OF_PATH_ATTRIBUTE 2
116 /* attribute flags, from RFC1771 */
117 #define BGP_ATTR_FLAG_OPTIONAL 0x80
118 #define BGP_ATTR_FLAG_TRANSITIVE 0x40
119 #define BGP_ATTR_FLAG_PARTIAL 0x20
120 #define BGP_ATTR_FLAG_EXTENDED_LENGTH 0x10
121 #define BGP_ATTR_FLAG_UNUSED 0x0F
125 #define BGP_SSA_TRANSITIVE 0x8000
126 #define BGP_SSA_TYPE 0x7FFF
129 #define BGP_SSA_L2TPv3 1
130 #define BGP_SSA_mGRE 2
131 #define BGP_SSA_IPSec 3
132 #define BGP_SSA_MPLS 4
133 #define BGP_SSA_L2TPv3_IN_IPSec 5
134 #define BGP_SSA_mGRE_IN_IPSec 6
136 /* BGP MPLS information */
137 #define BGP_MPLS_BOTTOM_L_STACK 0x000001
138 #define BGP_MPLS_TRAFFIC_CLASS 0x00000E
139 #define BGP_MPLS_LABEL 0xFFFFF0
141 /* AS_PATH segment types */
142 #define AS_SET 1 /* RFC1771 */
143 #define AS_SEQUENCE 2 /* RFC1771 */
144 #define AS_CONFED_SET 4 /* RFC1965 has the wrong values, corrected in */
145 #define AS_CONFED_SEQUENCE 3 /* draft-ietf-idr-bgp-confed-rfc1965bis-01.txt */
147 /* BGPsec_PATH attributes */
148 #define SEC_PATH_SEG_SIZE 6
150 /* OPEN message Optional Parameter types */
151 #define BGP_OPTION_AUTHENTICATION 1 /* RFC1771 */
152 #define BGP_OPTION_CAPABILITY 2 /* RFC2842 */
153 #define BGP_OPTION_EXTENDED_LEN 255 /* RFC9072 */
155 /* https://www.iana.org/assignments/capability-codes/capability-codes.xhtml (last updated 2024-01-23) */
156 /* BGP capability code */
157 #define BGP_CAPABILITY_RESERVED 0 /* RFC5492 */
158 #define BGP_CAPABILITY_MULTIPROTOCOL 1 /* RFC2858 */
159 #define BGP_CAPABILITY_ROUTE_REFRESH 2 /* RFC2918 */
160 #define BGP_CAPABILITY_COOPERATIVE_ROUTE_FILTERING 3 /* RFC5291 */
161 #define BGP_CAPABILITY_MULTIPLE_ROUTE_DEST 4 /* RFC8277 Deprecated */
162 #define BGP_CAPABILITY_EXTENDED_NEXT_HOP 5 /* RFC5549 */
163 #define BGP_CAPABILITY_EXTENDED_MESSAGE 6 /* draft-ietf-idr-bgp-extended-messages */
164 #define BGP_CAPABILITY_BGPSEC 7 /* RFC8205 */
165 #define BGP_CAPABILITY_MULTIPLE_LABELS 8 /* RFC8277 */
166 #define BGP_CAPABILITY_BGP_ROLE 9 /* RFC9234 */
167 #define BGP_CAPABILITY_GRACEFUL_RESTART 64 /* RFC4724 */
168 #define BGP_CAPABILITY_4_OCTET_AS_NUMBER 65 /* RFC6793 */
169 #define BGP_CAPABILITY_DYNAMIC_CAPABILITY_CISCO 66 /* Cisco Dynamic capability*/
170 #define BGP_CAPABILITY_DYNAMIC_CAPABILITY 67 /* draft-ietf-idr-dynamic-cap */
171 #define BGP_CAPABILITY_MULTISESSION 68 /* draft-ietf-idr-bgp-multisession */
172 #define BGP_CAPABILITY_ADDITIONAL_PATHS 69 /* [RFC7911] */
173 #define BGP_CAPABILITY_ENHANCED_ROUTE_REFRESH 70 /* [RFC7313] */
174 #define BGP_CAPABILITY_LONG_LIVED_GRACEFUL_RESTART 71 /* draft-uttaro-idr-bgp-persistence */
175 #define BGP_CAPABILITY_CP_ORF 72 /* [RFC7543] */
176 #define BGP_CAPABILITY_FQDN 73 /* draft-walton-bgp-hostname-capability */
177 #define BGP_CAPABILITY_BFD_STRICT 74 /* draft-ietf-idr-bgp-bfd-strict-mode */
178 #define BGP_CAPABILITY_SOFT_VERSION 75 /* draft-abraitis-bgp-version-capability */
179 #define BGP_CAPABILITY_PATHS_LIMIT 76 /* draft-abraitis-idr-addpath-paths-limit */
180 #define BGP_CAPABILITY_ROUTE_REFRESH_CISCO 128 /* Cisco, RFC8810 */
181 #define BGP_CAPABILITY_RPD_CISCO 129 /* Cisco, RFC8810 */
182 #define BGP_CAPABILITY_ORF_CISCO 130 /* Cisco, RFC8810 */
183 #define BGP_CAPABILITY_MULTISESSION_CISCO 131 /* Cisco, RFC8810 */
184 #define BGP_CAPABILITY_FQDN_CISCO 184 /* Cisco, RFC8810 */
185 #define BGP_CAPABILITY_OPERATIONAL_MSG_CISCO 185 /* Cisco, RFC8810 */
187 #define BGP_ORF_PREFIX_CISCO 0x80 /* Cisco */
188 #define BGP_ORF_COMM_CISCO 0x81 /* Cisco */
189 #define BGP_ORF_EXTCOMM_CISCO 0x82 /* Cisco */
190 #define BGP_ORF_ASPATH_CISCO 0x83 /* Cisco */
192 #define BGP_ORF_COMM 0x02 /* RFC5291 */
193 #define BGP_ORF_EXTCOMM 0x03 /* RFC5291 */
194 #define BGP_ORF_ASPATH 0x04 /* draft-ietf-idr-aspath-orf-02.txt */
196 #define BGP_ORF_ACTION 0xc0
197 #define BGP_ORF_ADD 0x00
198 #define BGP_ORF_REMOVE 0x01
199 #define BGP_ORF_REMOVEALL 0x02
201 #define BGP_ORF_MATCH 0x20
202 #define BGP_ORF_PERMIT 0x00
203 #define BGP_ORF_DENY 0x01
205 /* well-known communities, as defined by IANA */
206 /* https://www.iana.org/assignments/bgp-well-known-communities/bgp-well-known-communities.xhtml */
207 #define BGP_COMM_GRACEFUL_SHUTDOWN 0xFFFF0000
208 #define BGP_COMM_ACCEPT_OWN 0xFFFF0001
209 #define BGP_COMM_RT_FLTR_XLTD_V4 0xFFFF0002
210 #define BGP_COMM_RT_FLTR_V4 0xFFFF0003
211 #define BGP_COMM_RT_FLTR_XLTD_V6 0xFFFF0004
212 #define BGP_COMM_RT_FLTR_V6 0xFFFF0005
213 #define BGP_COMM_LLGR_STALE 0xFFFF0006
214 #define BGP_COMM_NO_LLGR 0xFFFF0007
215 #define BGP_COMM_ACCEPT_OWN_HOP 0xFFFF0008
216 #define BGP_COMM_STANDBY_PE 0xFFFF0009
217 #define BGP_COMM_BLACKHOLE 0xFFFF029A
218 #define BGP_COMM_NO_EXPORT 0xFFFFFF01
219 #define BGP_COMM_NO_ADVERTISE 0xFFFFFF02
220 #define BGP_COMM_NO_EXPORT_SUBCONFED 0xFFFFFF03
221 #define BGP_COMM_NOPEER 0xFFFFFF04
222 #define FOURHEX0 0x00000000
223 #define FOURHEXF 0xFFFF0000
225 /* IANA assigned AS */
226 #define BGP_AS_TRANS 23456
228 /* attribute types */
229 #define BGPTYPE_ORIGIN 1 /* RFC4271 */
230 #define BGPTYPE_AS_PATH 2 /* RFC4271 */
231 #define BGPTYPE_NEXT_HOP 3 /* RFC4271 */
232 #define BGPTYPE_MULTI_EXIT_DISC 4 /* RFC4271 */
233 #define BGPTYPE_LOCAL_PREF 5 /* RFC4271 */
234 #define BGPTYPE_ATOMIC_AGGREGATE 6 /* RFC4271 */
235 #define BGPTYPE_AGGREGATOR 7 /* RFC4271 */
236 #define BGPTYPE_COMMUNITIES 8 /* RFC1997 */
237 #define BGPTYPE_ORIGINATOR_ID 9 /* RFC4456 */
238 #define BGPTYPE_CLUSTER_LIST 10 /* RFC4456 */
239 #define BGPTYPE_DPA 11 /* DPA (deprecated) [RFC6938] */
240 #define BGPTYPE_ADVERTISER 12 /* ADVERTISER (historic) (deprecated) [RFC1863][RFC4223][RFC6938] */
241 #define BGPTYPE_RCID_PATH 13 /* RCID_PATH / CLUSTER_ID (historic) (deprecated) [RFC1863][RFC4223][RFC6938] */
242 #define BGPTYPE_MP_REACH_NLRI 14 /* RFC4760 */
243 #define BGPTYPE_MP_UNREACH_NLRI 15 /* RFC4760 */
244 #define BGPTYPE_EXTENDED_COMMUNITY 16 /* RFC4360 */
245 #define BGPTYPE_AS4_PATH 17 /* RFC 6793 */
246 #define BGPTYPE_AS4_AGGREGATOR 18 /* RFC 6793 */
247 #define BGPTYPE_SAFI_SPECIFIC_ATTR 19 /* SAFI Specific Attribute (SSA) (deprecated) draft-kapoor-nalawade-idr-bgp-ssa-00.txt */
248 #define BGPTYPE_CONNECTOR_ATTRIBUTE 20 /* Connector Attribute (deprecated) [RFC6037] */
249 #define BGPTYPE_AS_PATHLIMIT 21 /* AS_PATHLIMIT (deprecated) [draft-ietf-idr-as-pathlimit] */
250 #define BGPTYPE_PMSI_TUNNEL_ATTR 22 /* RFC6514 */
251 #define BGPTYPE_TUNNEL_ENCAPS_ATTR 23 /* RFC5512 */
252 #define BGPTYPE_TRAFFIC_ENGINEERING 24 /* Traffic Engineering [RFC5543] */
253 #define BGPTYPE_IPV6_ADDR_SPEC_EC 25 /* IPv6 Address Specific Extended Community [RFC5701] */
254 #define BGPTYPE_AIGP 26 /* RFC7311 */
255 #define BGPTYPE_PE_DISTING_LABLES 27 /* PE Distinguisher Labels [RFC6514] */
256 #define BGPTYPE_BGP_ENTROPY_LABEL 28 /* BGP Entropy Label Capability Attribute (deprecated) [RFC6790][RFC7447] */
257 #define BGPTYPE_LINK_STATE_ATTR 29 /* RFC7752 */
258 #define BGPTYPE_30 30 /* Deprecated [RFC8093] */
259 #define BGPTYPE_31 31 /* Deprecated [RFC8093] */
260 #define BGPTYPE_LARGE_COMMUNITY 32 /* RFC8092 */
261 #define BGPTYPE_BGPSEC_PATH 33 /* BGPsec_PATH [RFC8205] */
262 #define BGPTYPE_OTC 35 /* BGP Only to Customer [RFC9234] */
263 #define BGPTYPE_D_PATH 36 /* https://tools.ietf.org/html/draft-rabadan-sajassi-bess-evpn-ipvpn-interworking-02 */
264 #define BGPTYPE_SFP_ATTRIBUTE 37 /* SFP Attribute [RFC9015] */
265 #define BGPTYPE_BFD_DISCRIMINATOR 38 /* BFD Discriminator [RFC9026] */
266 #define BGPTYPE_NEXT_HOP_DEP_CAP 39 /* BGP Next Hop Dependent Capabilities draft-ietf-idr-entropy-label-13 */
267 #define BGPTYPE_BGP_PREFIX_SID 40 /* BGP Prefix-SID [RFC8669] */
268 #define BGPTYPE_LINK_STATE_OLD_ATTR 99 /* squatted value used by at least 2
269 implementations before IANA assignment */
270 #define BGPTYPE_ATTR_SET 128 /* RFC6368 */
271 #define BGPTYPE_129 129 /* Deprecated [RFC8093] */
272 #define BGPTYPE_241 241 /* Deprecated [RFC8093] */
273 #define BGPTYPE_242 242 /* Deprecated [RFC8093] */
274 #define BGPTYPE_243 243 /* Deprecated [RFC8093] */
276 /*EVPN Route Types */
277 #define EVPN_AD_ROUTE 1
278 #define EVPN_MAC_ROUTE 2
279 #define EVPN_INC_MCAST_TREE 3
280 #define EVPN_ETH_SEGMENT_ROUTE 4
281 #define EVPN_IP_PREFIX_ROUTE 5 /* draft-rabadan-l2vpn-evpn-prefix-advertisement */
282 #define EVPN_MC_ETHER_TAG_ROUTE 6 /* draft-ietf-bess-evpn-igmp-mld-proxy-03 */
283 #define EVPN_IGMP_JOIN_ROUTE 7 /* draft-ietf-bess-evpn-igmp-mld-proxy-03 */
284 #define EVPN_IGMP_LEAVE_ROUTE 8 /* draft-ietf-bess-evpn-igmp-mld-proxy-03 */
285 #define EVPN_PER_REG_I_PMSI_A_D_ROUTE 9 /* draft-ietf-bess-evpn-bum-procedure-updates-7 */
286 #define EVPN_S_PMSI_A_D_ROUTE 10 /* draft-ietf-bess-evpn-bum-procedure-updates-7 */
287 #define EVPN_LEAF_A_D_ROUTE 11 /* draft-ietf-bess-evpn-bum-procedure-updates-7 */
289 #define EVPN_IGMP_MC_FLAG_V1 0x01
290 #define EVPN_IGMP_MC_FLAG_V2 0x02
291 #define EVPN_IGMP_MC_FLAG_V3 0x04
292 #define EVPN_IGMP_MC_FLAG_IE 0x08
293 #define EVPN_IGMP_MC_FLAG_RESERVED 0xF0
295 /* NLRI type as define in BGP flow spec RFC */
296 #define BGPNLRI_FSPEC_DST_PFIX 1 /* RFC 5575 */
297 #define BGPNLRI_FSPEC_SRC_PFIX 2 /* RFC 5575 */
298 #define BGPNLRI_FSPEC_IP_PROTO 3 /* RFC 5575 */
299 #define BGPNLRI_FSPEC_PORT 4 /* RFC 5575 */
300 #define BGPNLRI_FSPEC_DST_PORT 5 /* RFC 5575 */
301 #define BGPNLRI_FSPEC_SRC_PORT 6 /* RFC 5575 */
302 #define BGPNLRI_FSPEC_ICMP_TP 7 /* RFC 5575 */
303 #define BGPNLRI_FSPEC_ICMP_CD 8 /* RFC 5575 */
304 #define BGPNLRI_FSPEC_TCP_FLAGS 9 /* RFC 5575 */
305 #define BGPNLRI_FSPEC_PCK_LEN 10 /* RFC 5575 */
306 #define BGPNLRI_FSPEC_DSCP 11 /* RFC 5575 */
307 #define BGPNLRI_FSPEC_FRAGMENT 12 /* RFC 5575 */
309 /* BGP flow spec NLRI operator bitmask */
310 #define BGPNLRI_FSPEC_END_OF_LST 0x80
311 #define BGPNLRI_FSPEC_AND_BIT 0x40
312 #define BGPNLRI_FSPEC_VAL_LEN 0x30
313 #define BGPNLRI_FSPEC_UNUSED_BIT4 0x08
314 #define BGPNLRI_FSPEC_UNUSED_BIT5 0x04
315 #define BGPNLRI_FSPEC_LESS_THAN 0x04
316 #define BGPNLRI_FSPEC_GREATER_THAN 0x02
317 #define BGPNLRI_FSPEC_EQUAL 0x01
318 #define BGPNLRI_FSPEC_TCPF_NOTBIT 0x02
319 #define BGPNLRI_FSPEC_TCPF_MATCHBIT 0x01
320 #define BGPNLRI_FSPEC_DSCP_BITMASK 0x3F
322 /* BGP flow spec specific filter value: TCP flags, Packet fragment ... */
323 #define BGPNLRI_FSPEC_TH_FIN 0x01
324 #define BGPNLRI_FSPEC_TH_SYN 0x02
325 #define BGPNLRI_FSPEC_TH_RST 0x04
326 #define BGPNLRI_FSPEC_TH_PUSH 0x08
327 #define BGPNLRI_FSPEC_TH_ACK 0x10
328 #define BGPNLRI_FSPEC_TH_URG 0x20
329 #define BGPNLRI_FSPEC_TH_ECN 0x40
330 #define BGPNLRI_FSPEC_TH_CWR 0x80
332 #define BGPNLRI_FSPEC_FG_DF 0x01
333 #define BGPNLRI_FSPEC_FG_ISF 0x02
334 #define BGPNLRI_FSPEC_FG_FF 0x04
335 #define BGPNLRI_FSPEC_FG_LF 0x08
337 /* Extended community type */
338 /* according to IANA's number assignment at: http://www.iana.org/assignments/bgp-extended-communities */
339 /* BGP transitive extended community type high octet */
340 /* Range 0x00-0x3f First Come First Served */
341 /* Range 0x80-0x8f Reserved for Experimental */
342 /* Range 0x90-0xbf Standards Action */
344 #define BGP_EXT_COM_TYPE_AUTH 0x80 /* FCFS or Standard/Early/Experimental allocated */
345 #define BGP_EXT_COM_TYPE_TRAN 0x40 /* Non-transitive or Transitive */
347 #define BGP_EXT_COM_TYPE_HIGH_TR_AS2 0x00 /* Transitive Two-Octet AS-Specific Extended Community */
348 #define BGP_EXT_COM_TYPE_HIGH_TR_IP4 0x01 /* Transitive IPv4-Address-specific Extended Community */
349 #define BGP_EXT_COM_TYPE_HIGH_TR_AS4 0x02 /* Transitive Four-Octet AS-Specific Extended Community */
350 #define BGP_EXT_COM_TYPE_HIGH_TR_OPAQUE 0x03 /* Transitive Opaque Extended Community */
351 #define BGP_EXT_COM_TYPE_HIGH_TR_QOS 0x04 /* QoS Marking [Thomas_Martin_Knoll] */
352 #define BGP_EXT_COM_TYPE_HIGH_TR_COS 0x05 /* CoS Capability [Thomas_Martin_Knoll] */
353 #define BGP_EXT_COM_TYPE_HIGH_TR_EVPN 0x06 /* EVPN (Sub-Types are defined in the "EVPN Extended Community Sub-Types" registry) */
354 #define BGP_EXT_COM_TYPE_HIGH_TR_FLOW_I 0x07 /* FlowSpec Transitive Extended Communities [draft-ietf-idr-flowspec-interfaceset] */
355 #define BGP_EXT_COM_TYPE_HIGH_TR_FLOW 0x08 /* Flow spec redirect/mirror to IP next-hop [draft-simpson-idr-flowspec-redirect] */
356 #define BGP_EXT_COM_TYPE_HIGH_TR_FLOW_R 0x09 /* FlowSpec Redirect to indirection-id Extended Community [draft-ietf-idr-flowspec-path-redirect] */
357 #define BGP_EXT_COM_TYPE_HIGH_TR_TP_CLASS 0x0a /* Transitive Transport Class [draft-ietf-idr-bgp-ct-30] */
358 #define BGP_EXT_COM_TYPE_HIGH_TR_SFC 0x0b /* Transitive SFC [RFC9015] */
359 #define BGP_EXT_COM_TYPE_HIGH_TR_MUP 0x0c /* Transitive MUP Extended Community */
360 #define BGP_EXT_COM_TYPE_HIGH_TR_EXT 0x80 /* Generic Transitive Extended Community [RFC7153][RFC9184] */
361 #define BGP_EXT_COM_TYPE_HIGH_TR_EXT_2 0x81 /* Generic Transitive Extended Community Part 2 [RFC8955][RFC9184] */
362 #define BGP_EXT_COM_TYPE_HIGH_TR_EXT_3 0x82 /* Generic Transitive Extended Community Part 3 [RFC8955][RFC9184] */
363 #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 */
365 /* BGP non transitive extended community type high octet */
366 /* 0x40-0x7f First Come First Served */
367 /* 0xc0-0xcf Reserved for Experimental Use (see [RFC4360]) */
368 /* 0xd0-0xff Standards Action */
369 /* 0x45-0x7f Unassigned */
370 #define BGP_EXT_COM_TYPE_HIGH_NTR_AS2 0x40 /* Non-Transitive Two-Octet AS-Specific Extended Community [RFC7153] */
371 #define BGP_EXT_COM_TYPE_HIGH_NTR_IP4 0x41 /* Non-Transitive IPv4-Address-specific Extended Community [RFC7153] */
372 #define BGP_EXT_COM_TYPE_HIGH_NTR_AS4 0x42 /* Non-Transitive Four-Octet AS-Specific Extended Community [RFC7153] */
373 #define BGP_EXT_COM_TYPE_HIGH_NTR_OPAQUE 0x43 /* Non-Transitive Opaque Extended Community [RFC7153] */
374 #define BGP_EXT_COM_TYPE_HIGH_NTR_QOS 0x44 /* QoS Marking [Thomas_Martin_Knoll] */
375 #define BGP_EXT_COM_TYPE_HIGH_NTR_FLOWSPEC 0x47 /* FlowSpec Non-Transitive Extended Communities [draft-ietf-idr-flowspec-interfaceset] */
376 #define BGP_EXT_COM_TYPE_HIGH_NTR_TRANSPORT 0x4a /* Non-Transitive Transport Class [draft-ietf-idr-bgp-ct-30] */
378 /* EVPN Extended Community Sub-Types */
379 #define BGP_EXT_COM_STYPE_EVPN_MMAC 0x00 /* MAC Mobility [draft-ietf-l2vpn-pbb-evpn] */
380 #define BGP_EXT_COM_STYPE_EVPN_LABEL 0x01 /* ESI MPLS Label [draft-ietf-l2vpn-evpn] */
381 #define BGP_EXT_COM_STYPE_EVPN_IMP 0x02 /* ES Import [draft-sajassi-l2vpn-evpn-segment-route] */
382 #define BGP_EXT_COM_STYPE_EVPN_ROUTERMAC 0x03 /* draft-sajassi-l2vpn-evpn-inter-subnet-forwarding */
383 #define BGP_EXT_COM_STYPE_EVPN_L2ATTR 0x04 /* RFC 8214 */
384 #define BGP_EXT_COM_STYPE_EVPN_ETREE 0x05 /* RFC 8317 */
385 #define BGP_EXT_COM_STYPE_EVPN_DF 0x06 /* RFC 8584 */
386 #define BGP_EXT_COM_STYPE_EVPN_ISID 0x07 /* draft-sajassi-bess-evpn-virtual-eth-segment */
387 #define BGP_EXT_COM_STYPE_EVPN_ND 0x08 /* draft-snr-bess-evpn-na-flags */
388 #define BGP_EXT_COM_STYPE_EVPN_MCFLAGS 0x09 /* draft-ietf-bess-evpn-igmp-mld-proxy */
389 #define BGP_EXT_COM_STYPE_EVPN_EVIRT0 0x0a /* draft-ietf-bess-evpn-igmp-mld-proxy */
390 #define BGP_EXT_COM_STYPE_EVPN_EVIRT1 0x0b /* draft-ietf-bess-evpn-igmp-mld-proxy */
391 #define BGP_EXT_COM_STYPE_EVPN_EVIRT2 0x0c /* draft-ietf-bess-evpn-igmp-mld-proxy */
392 #define BGP_EXT_COM_STYPE_EVPN_EVIRT3 0x0d /* draft-ietf-bess-evpn-igmp-mld-proxy */
393 #define BGP_EXT_COM_STYPE_EVPN_ATTACHCIRT 0x0e /* draft-sajassi-bess-evpn-ac-aware-bundling */
394 #define BGP_EXT_COM_STYPE_EVPN_SVC_CARV_TS 0x0f /* draft-ietf-bess-evpn-fast-df-recovery */
395 #define BGP_EXT_COM_STYPE_EVPN_LINK_BW 0x10 /* draft-ietf-bess-evpn-unequal-lb */
396 #define BGP_EXT_COM_STYPE_EVPN_RT_EC 0x15 /* draft-zzhang-idr-rt-derived-community */
398 /* RFC 7432 Flag single active mode */
399 #define BGP_EXT_COM_ESI_LABEL_FLAGS 0x01 /* bitmask: set for single active multi-homing site */
401 /* RFC 7432 Flag Sticky/Static MAC */
402 #define BGP_EXT_COM_EVPN_MMAC_STICKY 0x01 /* Bitmask: Set for sticky/static MAC address */
404 /* RFC 8214 Flags EVPN L2 Attributes */
405 #define BGP_EXT_COM_EVPN_L2ATTR_FLAG_B 0x0001 /* Backup PE */
406 #define BGP_EXT_COM_EVPN_L2ATTR_FLAG_P 0x0002 /* Primary PE */
407 #define BGP_EXT_COM_EVPN_L2ATTR_FLAG_C 0x0004 /* Control word required */
408 /* draft-yu-bess-evpn-l2-attributes-04 */
409 #define BGP_EXT_COM_EVPN_L2ATTR_FLAG_F 0x0008 /* Send and receive flow label */
410 #define BGP_EXT_COM_EVPN_L2ATTR_FLAG_CI 0x0010 /* CWI extended community can be included */
411 #define BGP_EXT_COM_EVPN_L2ATTR_FLAG_RESERVED 0xFFE0 /* Reserved */
413 /* RFC 8317 Flags EVPN E-Tree Attributes */
414 #define BGP_EXT_COM_EVPN_ETREE_FLAG_L 0x01 /* Leaf-Indication */
415 #define BGP_EXT_COM_EVPN_ETREE_FLAG_RESERVED 0xFE /* Reserved */
417 /* EPVN route AD NLRI ESI type */
418 #define BGP_NLRI_EVPN_ESI_VALUE 0x00 /* ESI type 0, 9 bytes integer */
419 #define BGP_NLRI_EVPN_ESI_LACP 0x01 /* ESI type 1, LACP 802.1AX */
420 #define BGP_NLRI_EVPN_ESI_MSTP 0x02 /* ESI type 2, MSTP defined ESI */
421 #define BGP_NLRI_EVPN_ESI_MAC 0x03 /* ESI type 3, MAC allocated value */
422 #define BGP_NLRI_EVPN_ESI_RID 0x04 /* ESI type 4, Router ID as ESI */
423 #define BGP_NLRI_EVPN_ESI_ASN 0x05 /* ESI type 5, ASN as ESI */
424 #define BGP_NLRI_EVPN_ESI_RES 0xFF /* ESI 0xFF reserved */
427 /* Transitive Two-Octet AS-Specific Extended Community Sub-Types */
428 #define BGP_EXT_COM_STYPE_AS2_RT 0x02 /* Route Target [RFC4360] */
429 #define BGP_EXT_COM_STYPE_AS2_RO 0x03 /* Route Origin [RFC4360] */
430 //#define BGP_EXT_COM_STYPE_AS2_LBW 0x04 /* Juniper Transitive Link Bandwidth */
431 #define BGP_EXT_COM_STYPE_AS2_OSPF_DID 0x05 /* OSPF Domain Identifier [RFC4577] */
432 #define BGP_EXT_COM_STYPE_AS2_RT_AGG_P 0x06 /* Route Aggregation Parameter */
433 #define BGP_EXT_COM_STYPE_AS2_DCOLL 0x08 /* BGP Data Collection [RFC4384] */
434 #define BGP_EXT_COM_STYPE_AS2_SRC_AS 0x09 /* Source AS [RFC6514] */
435 #define BGP_EXT_COM_STYPE_AS2_L2VPN 0x0a /* L2VPN Identifier [RFC6074] */
436 #define BGP_EXT_COM_STYPE_AS2_CVPND 0x10 /* Cisco VPN-Distinguisher [Eric_Rosen] */
437 #define BGP_EXT_COM_STYPE_AS2_RT_REC 0x13 /* Route-Target Record [draft-ietf-bess-service-chaining] */
438 #define BGP_EXT_COM_STYPE_AS2_RT_EC 0x15 /* RT-derived-EC [draft-zzhang-idr-rt-derived-community] */
439 //#define BGP_EXT_COM_STYPE_AS2_VNI 0x80 /* Virtual-Network Identifier Extended Community */
441 /* Non-Transitive Two-Octet AS-Specific Extended Community Sub-Types */
442 #define BGP_EXT_COM_STYPE_AS2_LBW 0x04 /* Link Bandwidth Extended Community [draft-ietf-idr-link-bandwidth-00] */
443 #define BGP_EXT_COM_STYPE_AS2_VNI 0x80 /* Virtual-Network Identifier Extended Community [draft-drao-bgp-l3vpn-virtual-network-overlays] */
445 /* Transitive Four-Octet AS-Specific Extended Community Sub-Types */
446 #define BGP_EXT_COM_STYPE_AS4_RT 0x02 /* Route Target [RFC5668] */
447 #define BGP_EXT_COM_STYPE_AS4_RO 0x03 /* Route Origin [RFC5668] */
448 #define BGP_EXT_COM_STYPE_AS4_GEN 0x04 /* Generic (deprecated) [draft-ietf-idr-as4octet-extcomm-generic-subtype] */
449 #define BGP_EXT_COM_STYPE_AS4_OSPF_DID 0x05 /* OSPF Domain Identifier [RFC4577] */
450 #define BGP_EXT_COM_STYPE_AS4_BGP_DC 0x08 /* BGP Data Collection [RFC4384] */
451 #define BGP_EXT_COM_STYPE_AS4_S_AS 0x09 /* Source AS [RFC6514] */
452 #define BGP_EXT_COM_STYPE_AS4_CIS_V 0x10 /* Cisco VPN Identifier [Eric_Rosen] */
453 #define BGP_EXT_COM_STYPE_AS4_RT_REC 0x13 /* Route-Target Record [draft-ietf-bess-service-chaining] */
454 #define BGP_EXT_COM_STYPE_AS4_RT_EC 0x15 /* RT-derived-EC [draft-zzhang-idr-rt-derived-community] */
456 /* Non-Transitive Four-Octet AS-Specific Extended Community Sub-Types */
459 * #define BGP_EXT_COM_STYPE_AS4_GEN 0x04
460 * Generic (deprecated) [draft-ietf-idr-as4octet-extcomm-generic-subtype]
463 /* Transitive IPv4-Address-Specific Extended Community Sub-Types */
465 #define BGP_EXT_COM_STYPE_IP4_RT 0x02 /* Route Target [RFC4360] */
466 #define BGP_EXT_COM_STYPE_IP4_RO 0x03 /* Route Origin [RFC4360] */
467 #define BGP_EXT_COM_STYPE_IP4_IFIT_TAIL 0x04 /* IPv4-Address-Specific IFIT Tail Community [draft-wang-idr-bgp-ifit-capabilities] */
468 #define BGP_EXT_COM_STYPE_IP4_OSPF_DID 0x05 /* OSPF Domain Identifier [RFC4577] */
469 #define BGP_EXT_COM_STYPE_IP4_OSPF_RID 0x07 /* OSPF Router ID [RFC4577] */
470 #define BGP_EXT_COM_STYPE_IP4_NODE_TGT 0x09 /* Node Target Extended Community [draft-ietf-idr-node-target-ext-comm] */
471 #define BGP_EXT_COM_STYPE_IP4_L2VPN 0x0a /* L2VPN Identifier [RFC6074] */
472 #define BGP_EXT_COM_STYPE_IP4_VRF_I 0x0b /* VRF Route Import [RFC6514] */
473 #define BGP_EXT_COM_STYPE_IP4_FLOW_RDR 0x0c /* Flow-spec Redirect to IPv4 [draft-ietf-idr-flowspec-redirect] */
474 #define BGP_EXT_COM_STYPE_IP4_CIS_D 0x10 /* Cisco VPN-Distinguisher [Eric_Rosen] */
475 #define BGP_EXT_COM_STYPE_IP4_SEG_NH 0x12 /* Inter-area P2MP Segmented Next-Hop [RFC7524] */
476 #define BGP_EXT_COM_STYPE_IP4_RT_REC 0x13 /* Route-Target Record [draft-ietf-bess-service-chaining] */
477 #define BGP_EXT_COM_STYPE_IP4_VRF_RNH 0x14 /* VRF-Recursive-Next-Hop-Extended-Community */
478 #define BGP_EXT_COM_STYPE_IP4_RT_EC 0x15 /* RT-derived-EC [draft-zzhang-idr-rt-derived-community-00] */
479 #define BGP_EXT_COM_STYPE_IP4_MVPN_RP 0x20 /* MVPN SA RP-address Extended Community [RFC9081] */
481 /* Transitive Opaque Extended Community Sub-Types */
483 #define BGP_EXT_COM_STYPE_OPA_COST 0x01 /* Cost Community [draft-ietf-idr-custom-decision] */
484 #define BGP_EXT_COM_STYPE_OPA_CP_OSPF 0x03 /* CP-ORF [RFC7543] */
485 #define BGP_EXT_COM_STYPE_OPA_EXTN_SRC 0x04 /* Extranet Source Extended Community [RFC7900] */
486 #define BGP_EXT_COM_STYPE_OPA_EXTN_SEP 0x05 /* Extranet Separation Extended Community [RFC7900] */
487 #define BGP_EXT_COM_STYPE_OPA_OSPF_RT 0x06 /* OSPF Route Type [RFC4577] */
488 #define BGP_EXT_COM_STYPE_OPA_PMSI_ATTR 0x07 /* Additional PMSI Tunnel Attribute Flags [RFC7902] */
489 #define BGP_EXT_COM_STYPE_OPA_CTX_LBL 0x08 /* Context-Specific Label Space ID Extended Community [RFC9573] */
490 #define BGP_EXT_COM_STYPE_OPA_COLOR 0x0b /* Color Extended Community [RFC5512] */
491 #define BGP_EXT_COM_STYPE_OPA_ENCAP 0x0c /* Encapsulation Extended Community [RFC5512] */
492 #define BGP_EXT_COM_STYPE_OPA_DGTW 0x0d /* Default Gateway [Yakov_Rekhter] */
493 #define BGP_EXT_COM_STYPE_OPA_PPMP_LBL 0x0e /* Point-to-Point-to-Multipoint (PPMP) Label [Rishabh_Parekh] */
494 #define BGP_EXT_COM_STYPE_OPA_GRP_TAG 0x0f /* BGP Group Policy Class Tag Extended Community [Dhananjaya_Rao] */
495 #define BGP_EXT_COM_STYPE_OPA_HSH_SRT 0x14 /* Consistent Hash Sort Order [draft-ietf-bess-service-chaining] */
496 #define BGP_EXT_COM_STYPE_OPA_GRP_PID 0x17 /* Group Policy ID Extended Community [draft-wlin-bess-group-policy-id-extended-community] */
497 #define BGP_EXT_COM_STYPE_OPA_LCM 0x1b /* Local Color Mapping (LCM) [draft-ietf-idr-bgp-car-05] */
498 #define BGP_EXT_COM_STYPE_OPA_LOADBAL 0xaa /* LoadBalance [draft-ietf-bess-service-chaining] */
500 /* BGP Cost Community Point of Insertion Types */
502 #define BGP_EXT_COM_COST_POI_ORIGIN 1 /* Evaluate after "Prefer lowest Origin" step */
503 #define BGP_EXT_COM_COST_POI_ASPATH 2 /* Evaluate after "Prefer shortest AS_PATH" step */
504 #define BGP_EXT_COM_COST_POI_MED 4 /* Evaluate after "Prefer lowest MED" step */
505 #define BGP_EXT_COM_COST_POI_LP 5 /* Evaluate after "Prefer highest Local Preference" step */
506 #define BGP_EXT_COM_COST_POI_AIGP 26 /* Evaluate after "Prefer lowest Accumulated IGP Cost" step */
507 #define BGP_EXT_COM_COST_POI_ABS 128 /* Pre-bestpath POI */
508 #define BGP_EXT_COM_COST_POI_IGP 129 /* Evaluate after "Prefer smallest IGP metric to next-hop" step */
509 #define BGP_EXT_COM_COST_POI_EI 130 /* Evaluate after "Prefer eBGP to iBGP" step */
510 #define BGP_EXT_COM_COST_POI_RID 131 /* Evaluate after "Prefer lowest BGP RID" step */
512 #define BGP_EXT_COM_COST_CID_REP 0x80 /* Bitmask - value replace/evaluate after bit */
514 /* BGP Tunnel Encapsulation Attribute Tunnel Types */
516 #define BGP_EXT_COM_TUNNEL_RESERVED 0 /* Reserved [RFC5512] */
517 #define BGP_EXT_COM_TUNNEL_L2TPV3 1 /* L2TPv3 over IP [RFC5512] */
518 #define BGP_EXT_COM_TUNNEL_GRE 2 /* GRE [RFC5512] */
519 #define BGP_EXT_COM_TUNNEL_ENDP 3 /* Transmit tunnel endpoint [RFC5566] */
520 #define BGP_EXT_COM_TUNNEL_IPSEC 4 /* IPsec in Tunnel-mode [RFC5566] */
521 #define BGP_EXT_COM_TUNNEL_IPIPSEC 5 /* IP in IP tunnel with IPsec Transport Mode [RFC5566] */
522 #define BGP_EXT_COM_TUNNEL_MPLSIP 6 /* MPLS-in-IP tunnel with IPsec Transport Mode [RFC5566] */
523 #define BGP_EXT_COM_TUNNEL_IPIP 7 /* IP in IP [RFC5512] */
524 #define BGP_EXT_COM_TUNNEL_VXLAN 8 /* VXLAN Encapsulation [draft-sd-l2vpn-evpn-overlay] */
525 #define BGP_EXT_COM_TUNNEL_NVGRE 9 /* NVGRE Encapsulation [draft-sd-l2vpn-evpn-overlay] */
526 #define BGP_EXT_COM_TUNNEL_MPLS 10 /* MPLS Encapsulation [draft-sd-l2vpn-evpn-overlay] */
527 #define BGP_EXT_COM_TUNNEL_MPLSGRE 11 /* MPLS in GRE Encapsulation [draft-sd-l2vpn-evpn-overlay] */
528 #define BGP_EXT_COM_TUNNEL_VXLANGPE 12 /* VxLAN GPE Encapsulation [draft-sd-l2vpn-evpn-overlay] */
529 #define BGP_EXT_COM_TUNNEL_MPLSUDP 13 /* MPLS in UDP Encapsulation [draft-ietf-l3vpn-end-system] */
530 #define BGP_EXT_COM_TUNNEL_IPV6_TUNNEL 14 /* IPv6 Tunnel [Martin_Djernaes] */
531 #define BGP_EXT_COM_TUNNEL_SE_TE_POLICY 15 /* SR TE Policy Type [draft-ietf-idr-sr-policy-safi-04] */
532 #define BGP_EXT_COM_TUNNEL_BARE 16 /* Bare [Nischal_Sheth] */
533 #define BGP_EXT_COM_TUNNEL_SR_TUNNEL 17 /* SR Tunnel [RFC9125] */
534 #define BGP_EXT_COM_TUNNEL_CLOUD_SEC 18 /* Cloud Security [Ramesh_Babu_Yakkala] */
535 #define BGP_EXT_COM_TUNNEL_GENEVE_ENCAP 19 /* Geneve Encapsulation [RFC8926] */
536 #define BGP_EXT_COM_TUNNEL_ANY_ENCAP 20 /* Any Encapsulation [draft-ietf-bess-bgp-multicast-controller-06] */
537 #define BGP_EXT_COM_TUNNEL_GTP_TUNNEL 21 /* GTP Tunnel Type [Keyur_Patel][Tetsuya_Murakami] */
538 #define BGP_EXT_COM_TUNNEL_DPS_TUNNEL 22 /* Dynamic Path Selection (DPS) Tunnel Encapsulation [Venkit_Kasiviswanathan] */
539 #define BGP_EXT_COM_TUNNEL_OPE 23 /* Originating PE (OPE) [draft-heitz-bess-evpn-option-b-01] */
540 #define BGP_EXT_COM_TUNNEL_DYN_DPS_POL 24 /* Dynamic Path Selection (DPS) Policy [Sarah_Chen] */
541 #define BGP_EXT_COM_TUNNEL_SDWAN_HYB 25 /* SDWAN-Hybrid [draft-ietf-idr-sdwan-edge-discovery-04] */
542 #define BGP_EXT_COM_TUNNEL_X_OVER_UDP 26 /* X-over-UDP [Jeffrey_Haas] */
543 #define BGP_EXT_COM_TUNNEL_DES_ENCAP 27 /* Distributed Etherlink Switch (DES) Tunnel Encapsulation [David_Cronin] */
545 /* Non-Transitive Opaque Extended Community Sub-Types */
547 #define BGP_EXT_COM_STYPE_OPA_OR_VAL_ST 0x00 /* BGP Origin Validation State [draft-ietf-sidr-origin-validation-signaling] */
548 #define BGP_EXT_COM_STYPE_OPA_COST 0x01 /* Cost Community [draft-ietf-idr-custom-decision] */
549 #define BGP_EXT_COM_STYPE_OPA_RT 0x02 /* Route Target [Nischal_Sheth] */
550 #define BGP_EXT_COM_STYPE_OPA_RT_EC 0x15 /* RT-derived-EC [draft-zzhang-idr-rt-derived-community-00] */
552 /* Transitive MUP Extended Community Sub-Types */
553 #define BGP_EXT_COM_STYPE_MUP_DIRECT_SEG 0x00
555 /* BGP Generic Transitive Experimental Use Extended Community Sub-Types */
557 #define BGP_EXT_COM_STYPE_EXP_OSPF_RT 0x00 /* OSPF Route Type, deprecated [RFC4577] */
558 #define BGP_EXT_COM_STYPE_EXP_OSPF_RID 0x01 /* OSPF Router ID, deprecated [RFC4577] */
559 #define BGP_EXT_COM_STYPE_EXP_SEC_GROUP 0x04 /* Security Group [https://github.com/Juniper/contrail-controller/wiki/BGP-Extended-Communities#security-group] */
560 #define BGP_EXT_COM_STYPE_EXP_OSPF_DID 0x05 /* OSPF Domain ID, deprecated [RFC4577] */
561 #define BGP_EXT_COM_STYPE_EXP_F_TR 0x06 /* Flow spec traffic-rate [RFC5575] */
562 #define BGP_EXT_COM_STYPE_EXP_F_TA 0x07 /* Flow spec traffic-action [RFC5575] */
563 #define BGP_EXT_COM_STYPE_EXP_F_RED 0x08 /* Flow spec redirect [RFC5575] */
564 #define BGP_EXT_COM_STYPE_EXP_F_RMARK 0x09 /* Flow spec traffic-remarking [RFC5575] */
565 #define BGP_EXT_COM_STYPE_EXP_L2 0x0a /* Layer2 Info Extended Community [RFC4761] */
566 #define BGP_EXT_COM_STYPE_EXP_ETREE 0x0b /* E-Tree Info [RFC7796] */
567 #define BGP_EXT_COM_STYPE_EXP_FLOW_RATE 0x0c /* Flow spec traffic-rate-packets [RFC8955] */
568 #define BGP_EXT_COM_STYPE_EXP_FLOW_SFC 0x0d /* Flow Specification for SFC Classifiers [RFC9015] */
569 #define BGP_EXT_COM_STYPE_EXP_TAG 0x84 /* Tag [https://github.com/Juniper/contrail-controller/wiki/BGP-Extended-Communities#tag] */
570 #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] */
572 /* BGP Generic Transitive Experimental Use Extended Community Part 2 */
574 #define BGP_EXT_COM_STYPE_EXP_2_FLOW_RED 0x08
576 /* BGP Generic Transitive Experimental Use Extended Community Part 3 */
578 #define BGP_EXT_COM_STYPE_EXP_3_SEC_GROUP 0x04
579 #define BGP_EXT_COM_STYPE_EXP_3_FLOW_RED 0x08
580 #define BGP_EXT_COM_STYPE_EXP_3_TAG4 0x84
581 #define BGP_EXT_COM_STYPE_EXP_3_SUB_CLUS 0x85
583 /* BGP Transitive Experimental EIGRP route attribute Sub-Types */
585 #define BGP_EXT_COM_STYPE_EXP_EIGRP_FT 0x00 /* Route Flags, Route Tag */
586 #define BGP_EXT_COM_STYPE_EXP_EIGRP_AD 0x01 /* ASN, Delay */
587 #define BGP_EXT_COM_STYPE_EXP_EIGRP_RHB 0x02 /* Reliability, Hop Count, Bandwidth */
588 #define BGP_EXT_COM_STYPE_EXP_EIGRP_LM 0x03 /* Load, MTU */
589 #define BGP_EXT_COM_STYPE_EXP_EIGRP_EAR 0x04 /* External ASN, RID of the redistributing router */
590 #define BGP_EXT_COM_STYPE_EXP_EIGRP_EPM 0x05 /* External Protocol ID, metric */
591 #define BGP_EXT_COM_STYPE_EXP_EIGRP_RID 0x06 /* Originating EIGRP Router ID of the route */
593 #define BGP_EXT_COM_EXP_EIGRP_FLAG_RT 0x8000 /* Route flag - Internal/External */
596 /* according to IANA's number assignment at: http://www.iana.org/assignments/bgp-extended-communities */
599 #define BGP_EXT_COM_RT_AS2 0x0002 /* Route Target,Format AS(2bytes):AN(4bytes) */
600 #define BGP_EXT_COM_RT_IP4 0x0102 /* Route Target,Format IP address:AN(2bytes) */
601 #define BGP_EXT_COM_RT_AS4 0x0202 /* Route Target,Format AS(4bytes):AN(2bytes) */
603 /* extended community option flow flec action bit S and T */
604 #define BGP_EXT_COM_FSPEC_ACT_S 0x02
605 #define BGP_EXT_COM_FSPEC_ACT_T 0x01
607 /* extended community l2vpn flags */
609 #define BGP_EXT_COM_L2_FLAG_D 0x80
610 #define BGP_EXT_COM_L2_FLAG_Z1 0x40
611 #define BGP_EXT_COM_L2_FLAG_F 0x20
612 #define BGP_EXT_COM_L2_FLAG_Z345 0x1c
613 #define BGP_EXT_COM_L2_FLAG_C 0x02
614 #define BGP_EXT_COM_L2_FLAG_S 0x01
616 /* extended community E-Tree Info flags */
618 #define BGP_EXT_COM_ETREE_FLAG_RESERVED 0xFFFC
619 #define BGP_EXT_COM_ETREE_FLAG_P 0x0002
620 #define BGP_EXT_COM_ETREE_FLAG_V 0x0001
622 /* Extended community QoS Marking technology type */
623 #define QOS_TECH_TYPE_DSCP 0x00 /* DiffServ enabled IP (DSCP encoding) */
624 #define QOS_TECH_TYPE_802_1q 0x01 /* Ethernet using 802.1q priority tag */
625 #define QOS_TECH_TYPE_E_LSP 0x02 /* MPLS using E-LSP */
626 #define QOS_TECH_TYPE_VC 0x03 /* Virtual Channel (VC) encoding using separate channels for */
627 /* QoS forwarding / one channel per class (e.g. ATM VCs, FR */
628 /* VCs, MPLS L-LSPs) */
629 #define QOS_TECH_TYPE_GMPLS_TIME 0x04 /* GMPLS - time slot encoding */
630 #define QOS_TECH_TYPE_GMPLS_LAMBDA 0x05 /* GMPLS - lambda encoding */
631 #define QOS_TECH_TYPE_GMPLS_FIBRE 0x06 /* GMPLS - fibre encoding */
633 /* OSPF codes for BGP_EXT_COM_OSPF_RTYPE draft-rosen-vpns-ospf-bgp-mpls */
634 #define BGP_OSPF_RTYPE_RTR 1 /* OSPF Router LSA */
635 #define BGP_OSPF_RTYPE_NET 2 /* OSPF Network LSA */
636 #define BGP_OSPF_RTYPE_SUM 3 /* OSPF Summary LSA */
637 #define BGP_OSPF_RTYPE_EXT 5 /* OSPF External LSA, note that ASBR doesn't apply to MPLS-VPN */
638 #define BGP_OSPF_RTYPE_NSSA 7 /* OSPF NSSA External*/
639 #define BGP_OSPF_RTYPE_SHAM 129 /* OSPF-MPLS-VPN Sham link */
640 #define BGP_OSPF_RTYPE_METRIC_TYPE 0x1 /* Type-1 (clear) or Type-2 (set) external metric */
642 /* Extended community & Route distinguisher formats */
643 #define FORMAT_AS2_LOC 0x00 /* Format AS(2bytes):AN(4bytes) */
644 #define FORMAT_IP_LOC 0x01 /* Format IP address:AN(2bytes) */
645 #define FORMAT_AS4_LOC 0x02 /* Format AS(4bytes):AN(2bytes) */
647 /* RFC 4760 subsequent address family numbers (last updated 2024-03-19)
648 * https://www.iana.org/assignments/safi-namespace/safi-namespace.xhtml
650 #define SAFNUM_UNICAST 1 /* RFC4760 */
651 #define SAFNUM_MULCAST 2 /* RFC4760 */
652 #define SAFNUM_UNIMULC 3 /* Deprecated, see RFC4760 */
653 #define SAFNUM_MPLS_LABEL 4 /* RFC8277 */
654 #define SAFNUM_MCAST_VPN 5 /* RFC6514 */
655 #define SAFNUM_MULTISEG_PW 6 /* RFC7267 */
656 #define SAFNUM_ENCAPSULATION 7 /* RFC5512, obsolete and never deployed, see draft-ietf-idr-tunnel-encaps-22 */
657 #define SAFNUM_MCAST_VPLS 8 /* RFC7117 */
658 #define SAFNUM_BGP_SFC 9 /* RFC9015 */
659 #define SAFNUM_TUNNEL 64 /* draft-nalawade-kapoor-tunnel-safi-05.txt (Expired) */
660 #define SAFNUM_VPLS 65 /* RFC4761, RFC6074 */
661 #define SAFNUM_MDT 66 /* RFC6037 */
662 #define SAFNUM_4OVER6 67 /* RFC5747 */
663 #define SAFNUM_6OVER4 68 /* Never specified? Cf. RFC5747 */
664 #define SAFNUM_L1VPN 69 /* RFC5195 */
665 #define SAFNUM_EVPN 70 /* RFC7432 */
666 #define SAFNUM_BGP_LS 71 /* RFC7752 */
667 #define SAFNUM_BGP_LS_VPN 72 /* RFC7752 */
668 #define SAFNUM_SR_POLICY 73 /* draft-ietf-idr-segment-routing-te-policy-11 */
669 #define SAFNUM_SD_WAN 74 /* draft-dunbar-idr-sdwan-port-safi-06, expired */
670 #define SAFNUM_RPD 75 /* draft-ietf-idr-rpd-10 */
671 #define SAFNUM_CT 76 /* draft-kaliraj-idr-bgp-classful-transport-planes-07 */
672 #define SAFNUM_FLOWSPEC 77 /* draft-ietf-idr-flowspec-nvo3-13 */
673 #define SAFNUM_MCAST_TREE 78 /* draft-ietf-bess-bgp-multicast-03 */
674 #define SAFNUM_BGP_DPS 79 /* https://www.arista.com/en/cg-veos-router/veos-router-dynamic-path-selection */
675 #define SAFNUM_BGP_LS_SPF 80 /* draft-ietf-lsvr-bgp-spf-15 */
676 #define SAFNUM_BGP_CAR 83 /* draft-ietf-idr-bgp-car-05 */
677 #define SAFNUM_BGP_VPN_CAR 84 /* draft-ietf-idr-bgp-car-05 */
678 #define SAFNUM_BGP_MUP 85 /* draft-mpmz-bess-mup-safi-03 */
679 #define SAFNUM_LAB_VPNUNICAST 128 /* RFC4364, RFC8277 */
680 #define SAFNUM_LAB_VPNMULCAST 129 /* RFC6513, RFC6514 */
681 #define SAFNUM_LAB_VPNUNIMULC 130 /* Obsolete and reserved, see RFC4760 */
682 #define SAFNUM_ROUTE_TARGET 132 /* RFC 4684 Constrained Route Distribution for BGP/MPLS IP VPN */
683 #define SAFNUM_FSPEC_RULE 133 /* RFC 8955 BGP flow spec SAFI */
684 #define SAFNUM_FSPEC_VPN_RULE 134 /* RFC 8955 BGP flow spec SAFI VPN */
685 #define SAFNUM_L3VPN 140 /* Withdrawn, draft-ietf-l3vpn-bgpvpn-auto-09 */
687 /* BGP Additional Paths Capability */
688 #define BGP_ADDPATH_RECEIVE 0x01
689 #define BGP_ADDPATH_SEND 0x02
691 /* mcast-vpn route types RFC 6514 */
692 #define MCAST_VPN_RTYPE_INTRA_AS_IPMSI_AD 1
693 #define MCAST_VPN_RTYPE_INTER_AS_IPMSI_AD 2
694 #define MCAST_VPN_RTYPE_SPMSI_AD 3
695 #define MCAST_VPN_RTYPE_LEAF_AD 4
696 #define MCAST_VPN_RTYPE_SOURCE_ACTIVE_AD 5
697 #define MCAST_VPN_RTYPE_SHARED_TREE_JOIN 6
698 #define MCAST_VPN_RTYPE_SOURCE_TREE_JOIN 7
700 /* RFC 5512 Tunnel Types */
701 #define TUNNEL_TYPE_L2TP_OVER_IP 1
702 #define TUNNEL_TYPE_GRE 2
703 #define TUNNEL_TYPE_TTE 3
704 #define TUNNEL_TYPE_IPSEC_IN_TM 4
705 #define TUNNEL_TYPE_IP_IN_IP_IPSEC 5
706 #define TUNNEL_TYPE_MPLS_IN_IP_IPSEC 6
707 #define TUNNEL_TYPE_IP_IN_IP 7
708 #define TUNNEL_TYPE_VXLAN 8
709 #define TUNNEL_TYPE_NVGRE 9
710 #define TUNNEL_TYPE_MPLS 10
711 #define TUNNEL_TYPE_MPLS_IN_GRE 11
712 #define TUNNEL_TYPE_VXLAN_GPE 12
713 #define TUNNEL_TYPE_MPLS_IN_UDP 13
714 #define TUNNEL_TYPE_IPV6_TUNNEL 14
715 #define TUNNEL_TYPE_SR_TE_POLICY 15
716 #define TUNNEL_TYPE_BARE 16
717 #define TUNNEL_TYPE_SR_TUNNEL 17
718 #define TUNNEL_TYPE_CLOUD_SECURITY 18
719 #define TUNNEL_TYPE_GENEVE_ENCAP 19
720 #define TUNNEL_TYPE_ANY_ENCAP 20
721 #define TUNNEL_TYPE_GTP_TUNNEL_TYPE 21
722 #define TUNNEL_TYPE_DPS_TUNNEL_ENCAP 22
723 #define TUNNEL_TYPE_ORIGINATING_PE 23
724 #define TUNNEL_TYPE_DPS_POLICY 24
725 #define TUNNEL_TYPE_SDWAN_HYBRID 25
726 #define TUNNEL_TYPE_X_OVER_UDP 26
727 #define TUNNEL_TYPE_DES_TUNNEL_ENCAP 27
730 /*RFC 6514 PMSI Tunnel Types */
731 #define PMSI_TUNNEL_NOPRESENT 0
732 #define PMSI_TUNNEL_RSVPTE_P2MP 1
733 #define PMSI_TUNNEL_MLDP_P2MP 2
734 #define PMSI_TUNNEL_PIMSSM 3
735 #define PMSI_TUNNEL_PIMSM 4
736 #define PMSI_TUNNEL_BIDIR_PIM 5
737 #define PMSI_TUNNEL_INGRESS 6
738 #define PMSI_TUNNEL_MLDP_MP2MP 7
739 #define PMSI_TUNNEL_TRANPORT 8
740 #define PMSI_TUNNEL_ASS_REPLIC 9
741 #define PMSI_TUNNEL_BIER 11
742 #define PMSI_TUNNEL_SR_MPLS_P2MP 12
744 /* RFC 6388, RFC 6826, RFC 6512, RFC 7246, RFC 7442, RFC 8338 */
745 #define PMSI_MLDP_FEC_TYPE_RSVD 0
746 #define PMSI_MLDP_FEC_TYPE_GEN_LSP 1
747 #define PMSI_MLDP_FEC_TYPE_TRANSIT_IPV4_SRC 3
748 #define PMSI_MLDP_FEC_TYPE_TRANSIT_IPV6_SRC 4
749 #define PMSI_MLDP_FEC_TYPE_TRANSIT_IPV4_BIDIR 5
750 #define PMSI_MLDP_FEC_TYPE_TRANSIT_IPV6_BIDIR 6
751 #define PMSI_MLDP_FEC_TYPE_RECURSE_OPAQUE_VALUE 7
752 #define PMSI_MLDP_FEC_TYPE_VPN_RECURSE_OPAQUE_VALUE 8
753 #define PMSI_MLDP_FEC_TYPE_TRANSIT_VPNV4_BIDIR 9
754 #define PMSI_MLDP_FEC_TYPE_TRANSIT_VPNV6_BIDIR 10
755 #define PMSI_MLDP_FEC_TYPE_TRANSIT_IPV4_SHARED_TREE 11
756 #define PMSI_MLDP_FEC_TYPE_TRANSIT_IPV6_SHARED_TREE 12
757 #define PMSI_MLDP_FEC_TYPE_L2VPN_MCAST 13
758 #define PMSI_MLDP_FEC_TYPE_TRANSIT_VPNV4_SRC 250
759 #define PMSI_MLDP_FEC_TYPE_TRANSIT_VPNV6_SRC 251
760 #define PMSI_MLDP_FEC_TYPE_EXT_TYPE 255
762 #define PMSI_MLDP_FEC_ETYPE_RSVD 0
764 /* RFC 7311 AIGP types */
765 #define AIGP_TLV_TYPE 1
767 /* RFC 9012 (RFC 5512/5640) Sub-TLV Types */
768 #define TUNNEL_SUBTLV_ENCAPSULATION 1
769 #define TUNNEL_SUBTLV_PROTO_TYPE 2
770 #define TUNNEL_SUBTLV_IPSEC_TA 3
771 #define TUNNEL_SUBTLV_COLOR 4
772 #define TUNNEL_SUBTLV_LOAD_BALANCE 5
773 #define TUNNEL_SUBTLV_REMOTE_ENDPOINT 6
774 #define TUNNEL_SUBTLV_IPV4_DS_FIELD 7
775 #define TUNNEL_SUBTLV_UDP_DST_PORT 8
776 #define TUNNEL_SUBTLV_EMBEDDED_LABEL 9
777 #define TUNNEL_SUBTLV_MPLS_LABEL 10
778 #define TUNNEL_SUBTLV_PREFIX_SID 11
779 #define TUNNEL_SUBTLV_PREFERENCE 12
780 #define TUNNEL_SUBTLV_BINDING_SID 13
781 #define TUNNEL_SUBTLV_ENLP 14
782 #define TUNNEL_SUBTLV_PRIORITY 15
784 #define TUNNEL_SUBTLV_SPI_SI_REP 16
786 #define TUNNEL_SUBTLV_SRV6_BINDING_SID 20
788 #define TUNNEL_SUBTLV_IPSEC_SA_ID 64
789 #define TUNNEL_SUBTLV_EXT_PORT_PROP 65
790 #define TUNNEL_SUBTLV_UNDERLAY_ISP_PROP 66
791 #define TUNNEL_SUBTLV_IPSEC_SA_NONCE 67
792 #define TUNNEL_SUBTLV_IPSEC_PUBLIC_KEY 68
793 #define TUNNEL_SUBTLV_IPSEC_SA_PROPOSAL 69
794 #define TUNNEL_SUBTLV_SIMPL_IPSEC_SA 70
796 #define TUNNEL_SUBTLV_NRP 123
797 #define TUNNEL_SUBTLV_RPF 124
798 #define TUNNEL_SUBTLV_TREE_LABEL_STACK 125
800 #define TUNNEL_SUBTLV_SEGMENT_LIST 128
801 #define TUNNEL_SUBTLV_POLICY_CP_NAME 129
802 #define TUNNEL_SUBTLV_POLICY_NAME 130
804 #define TUNNEL_SUBTLV_WAN_ID 192
805 #define TUNNEL_SUBTLV_BYTES 193
806 #define TUNNEL_SUBTLV_IPSEC_DIM 194
807 #define TUNNEL_SUBTLV_IPSEC_KEY_EXCH 195
808 #define TUNNEL_SUBTLV_IPSEC_SA_PROPS 196
809 #define TUNNEL_SUBTLV_SRV_SEGMENT_LIST 197
810 #define TUNNEL_SUBTLV_SRV_VTEP 198
811 #define TUNNEL_SUBTLV_DES_ADJACENCY 199
814 /* BGP Tunnel SubTLV VXLAN Flags bitmask */
815 #define TUNNEL_SUBTLV_VXLAN_VALID_VNID 0x80
816 #define TUNNEL_SUBTLV_VXLAN_VALID_MAC 0x40
817 #define TUNNEL_SUBTLV_VXLAN_RESERVED 0x3F
819 /* BGP Tunnel SubTLV VXLAN GPE Flags bitmask */
820 #define TUNNEL_SUBTLV_VXLAN_GPE_VERSION 0xC0
821 #define TUNNEL_SUBTLV_VXLAN_GPE_VALID_VNID 0x20
822 #define TUNNEL_SUBTLV_VXLAN_GPE_RESERVED 0x1F
824 /* BGP Tunnel SubTLV NVGRE Flags bitmask */
825 #define TUNNEL_SUBTLV_NVGRE_VALID_VNID 0x80
826 #define TUNNEL_SUBTLV_NVGRE_VALID_MAC 0x40
827 #define TUNNEL_SUBTLV_NVGRE_RESERVED 0x3F
829 /* BGP Tunnel SubTLV Binding SID Flags bitmask */
830 #define TUNNEL_SUBTLV_BINDING_SPECIFIED 0x80
831 #define TUNNEL_SUBTLV_BINDING_INVALID 0x40
832 #define TUNNEL_SUBTLV_BINDING_RESERVED 0x3F
834 /* BGP Segment List SubTLV Types */
835 #define TUNNEL_SUBTLV_SEGMENT_LIST_SUB_TYPE_A 1
836 #define TUNNEL_SUBTLV_SEGMENT_LIST_SUB_TYPE_B 2
837 #define TUNNEL_SUBTLV_SEGMENT_LIST_SUB_TYPE_C 3
838 #define TUNNEL_SUBTLV_SEGMENT_LIST_SUB_TYPE_D 4
839 #define TUNNEL_SUBTLV_SEGMENT_LIST_SUB_TYPE_E 5
840 #define TUNNEL_SUBTLV_SEGMENT_LIST_SUB_TYPE_F 6
841 #define TUNNEL_SUBTLV_SEGMENT_LIST_SUB_TYPE_G 7
842 #define TUNNEL_SUBTLV_SEGMENT_LIST_SUB_TYPE_H 8
843 #define TUNNEL_SUBTLV_SEGMENT_LIST_SUB_TYPE_WEIGHT 9
844 #define TUNNEL_SUBTLV_SEGMENT_LIST_SUB_TYPE_I 10
845 #define TUNNEL_SUBTLV_SEGMENT_LIST_SUB_TYPE_J 11
846 #define TUNNEL_SUBTLV_SEGMENT_LIST_SUB_TYPE_K 12
848 /* BGP Tunnel SubTLV Segment List SubTLV Flags bitmask */
849 #define TUNNEL_SUBTLV_SEGMENT_LIST_SUB_VERIFICATION 0x80
850 #define TUNNEL_SUBTLV_SEGMENT_LIST_SUB_ALGORITHM 0x40
851 #define TUNNEL_SUBTLV_SEGMENT_LIST_SUB_RESERVED 0x3F
853 /* Link-State NLRI types */
854 #define LINK_STATE_NODE_NLRI 1
855 #define LINK_STATE_LINK_NLRI 2
856 #define LINK_STATE_IPV4_TOPOLOGY_PREFIX_NLRI 3
857 #define LINK_STATE_IPV6_TOPOLOGY_PREFIX_NLRI 4
858 #define LINK_STATE_SRV6_SID_NLRI 6
860 /* Link-State NLRI Protocol-ID values */
861 #define BGP_LS_NLRI_PROTO_ID_UNKNOWN 0
862 #define BGP_LS_NLRI_PROTO_ID_IS_IS_LEVEL_1 1
863 #define BGP_LS_NLRI_PROTO_ID_IS_IS_LEVEL_2 2
864 #define BGP_LS_NLRI_PROTO_ID_OSPF_V2 3
865 #define BGP_LS_NLRI_PROTO_ID_DIRECT 4
866 #define BGP_LS_NLRI_PROTO_ID_STATIC 5
867 #define BGP_LS_NLRI_PROTO_ID_OSPF_V3 6
868 #define BGP_LS_NLRI_PROTO_ID_BGP 7
869 #define BGP_LS_NLRI_PROTO_ID_RSVP_TE 8
870 #define BGP_LS_NLRI_PROTO_ID_SEGMENT_ROUTING 9
872 /* Link-State routing universes */
873 #define BGP_LS_NLRI_ROUTING_UNIVERSE_LEVEL_3 0
874 #define BGP_LS_NLRI_ROUTING_UNIVERSE_LEVEL_1 1
876 #define BGP_LS_PREFIX_OSPF_ROUTE_TYPE_UNKNOWN 0
877 #define BGP_LS_PREFIX_OSPF_ROUTE_TYPE_INTRA_AREA 1
878 #define BGP_LS_PREFIX_OSPF_ROUTE_TYPE_INTER_AREA 2
879 #define BGP_LS_PREFIX_OSPF_ROUTE_TYPE_EXTERNAL_1 3
880 #define BGP_LS_PREFIX_OSPF_ROUTE_TYPE_EXTERNAL_2 4
881 #define BGP_LS_PREFIX_OSPF_ROUTE_TYPE_NSSA_1 5
882 #define BGP_LS_PREFIX_OSPF_ROUTE_TYPE_NSSA_2 6
885 #define BGP_NLRI_TLV_LOCAL_NODE_DESCRIPTORS 256
886 #define BGP_NLRI_TLV_REMOTE_NODE_DESCRIPTORS 257
887 #define BGP_NLRI_TLV_LINK_LOCAL_REMOTE_IDENTIFIERS 258
888 #define BGP_NLRI_TLV_IPV4_INTERFACE_ADDRESS 259
889 #define BGP_NLRI_TLV_IPV4_NEIGHBOR_ADDRESS 260
890 #define BGP_NLRI_TLV_IPV6_INTERFACE_ADDRESS 261
891 #define BGP_NLRI_TLV_IPV6_NEIGHBOR_ADDRESS 262
892 #define BGP_NLRI_TLV_MULTI_TOPOLOGY_ID 263
893 #define BGP_NLRI_TLV_OSPF_ROUTE_TYPE 264
894 #define BGP_NLRI_TLV_IP_REACHABILITY_INFORMATION 265
895 #define BGP_NLRI_TLV_NODE_MSD 266
896 #define BGP_NLRI_TLV_LINK_MSD 267
898 #define BGP_NLRI_TLV_AUTONOMOUS_SYSTEM 512
899 #define BGP_NLRI_TLV_BGP_LS_IDENTIFIER 513
900 #define BGP_NLRI_TLV_AREA_ID 514
901 #define BGP_NLRI_TLV_IGP_ROUTER_ID 515
902 #define BGP_NLRI_TLV_BGP_ROUTER_ID 516
903 #define BGP_NLRI_TLV_SRV6_SID_INFO 518
905 #define BGP_NLRI_TLV_NODE_FLAG_BITS 1024
906 #define BGP_NLRI_TLV_OPAQUE_NODE_PROPERTIES 1025
907 #define BGP_NLRI_TLV_NODE_NAME 1026
908 #define BGP_NLRI_TLV_IS_IS_AREA_IDENTIFIER 1027
909 #define BGP_NLRI_TLV_IPV4_ROUTER_ID_OF_LOCAL_NODE 1028
910 #define BGP_NLRI_TLV_IPV6_ROUTER_ID_OF_LOCAL_NODE 1029
911 #define BGP_NLRI_TLV_IPV4_ROUTER_ID_OF_REMOTE_NODE 1030
912 #define BGP_NLRI_TLV_IPV6_ROUTER_ID_OF_REMOTE_NODE 1031
914 #define BGP_NLRI_TLV_ADMINISTRATIVE_GROUP_COLOR 1088
915 #define BGP_NLRI_TLV_MAX_LINK_BANDWIDTH 1089
916 #define BGP_NLRI_TLV_MAX_RESERVABLE_LINK_BANDWIDTH 1090
917 #define BGP_NLRI_TLV_UNRESERVED_BANDWIDTH 1091
918 #define BGP_NLRI_TLV_TE_DEFAULT_METRIC 1092
919 #define BGP_NLRI_TLV_LINK_PROTECTION_TYPE 1093
920 #define BGP_NLRI_TLV_MPLS_PROTOCOL_MASK 1094
921 #define BGP_NLRI_TLV_METRIC 1095
922 #define BGP_NLRI_TLV_SHARED_RISK_LINK_GROUP 1096
923 #define BGP_NLRI_TLV_OPAQUE_LINK_ATTRIBUTE 1097
924 #define BGP_NLRI_TLV_LINK_NAME_ATTRIBUTE 1098
926 #define BGP_NLRI_TLV_IGP_FLAGS 1152
927 #define BGP_NLRI_TLV_ROUTE_TAG 1153
928 #define BGP_NLRI_TLV_EXTENDED_TAG 1154
929 #define BGP_NLRI_TLV_PREFIX_METRIC 1155
930 #define BGP_NLRI_TLV_OSPF_FORWARDING_ADDRESS 1156
931 #define BGP_NLRI_TLV_OPAQUE_PREFIX_ATTRIBUTE 1157
932 #define BGP_NLRI_TLV_EXTENDED_ADMINISTRATIVE_GROUP 1173
935 /* Link-State NLRI TLV lengths */
936 #define BGP_NLRI_TLV_LEN_AUTONOMOUS_SYSTEM 4
937 #define BGP_NLRI_TLV_LEN_BGP_LS_IDENTIFIER 4
938 #define BGP_NLRI_TLV_LEN_AREA_ID 4
939 #define BGP_NLRI_TLV_LEN_IPV4_ROUTER_ID 4
940 #define BGP_NLRI_TLV_LEN_IPV6_ROUTER_ID 16
941 #define BGP_NLRI_TLV_LEN_IPV4_ROUTER_ID_OF_LOCAL_NODE BGP_NLRI_TLV_LEN_IPV4_ROUTER_ID
942 #define BGP_NLRI_TLV_LEN_IPV6_ROUTER_ID_OF_LOCAL_NODE BGP_NLRI_TLV_LEN_IPV6_ROUTER_ID
943 #define BGP_NLRI_TLV_LEN_IPV4_ROUTER_ID_OF_REMOTE_NODE BGP_NLRI_TLV_LEN_IPV4_ROUTER_ID
944 #define BGP_NLRI_TLV_LEN_IPV6_ROUTER_ID_OF_REMOTE_NODE BGP_NLRI_TLV_LEN_IPV6_ROUTER_ID
945 #define BGP_NLRI_TLV_LEN_LINK_LOCAL_REMOTE_IDENTIFIERS 8
946 #define BGP_NLRI_TLV_LEN_IPV4_INTERFACE_ADDRESS 4
947 #define BGP_NLRI_TLV_LEN_IPV4_NEIGHBOR_ADDRESS 4
948 #define BGP_NLRI_TLV_LEN_IPV6_INTERFACE_ADDRESS 16
949 #define BGP_NLRI_TLV_LEN_IPV6_NEIGHBOR_ADDRESS 16
950 #define BGP_NLRI_TLV_LEN_MULTI_TOPOLOGY_ID 2
951 #define BGP_NLRI_TLV_LEN_ADMINISTRATIVE_GROUP_COLOR 4
952 #define BGP_NLRI_TLV_LEN_MAX_LINK_BANDWIDTH 4
953 #define BGP_NLRI_TLV_LEN_MAX_RESERVABLE_LINK_BANDWIDTH 4
954 #define BGP_NLRI_TLV_LEN_UNRESERVED_BANDWIDTH 32
955 #define BGP_NLRI_TLV_LEN_TE_DEFAULT_METRIC_OLD 3
956 #define BGP_NLRI_TLV_LEN_TE_DEFAULT_METRIC_NEW 4
957 #define BGP_NLRI_TLV_LEN_LINK_PROTECTION_TYPE 2
958 #define BGP_NLRI_TLV_LEN_MPLS_PROTOCOL_MASK 1
959 #define BGP_NLRI_TLV_LEN_MAX_METRIC 3
960 #define BGP_NLRI_TLV_LEN_IGP_FLAGS 1
961 #define BGP_NLRI_TLV_LEN_PREFIX_METRIC 4
962 #define BGP_NLRI_TLV_LEN_NODE_FLAG_BITS 1
965 /* draft-ietf-idr-bgpls-srv6-ext-14 */
966 #define BGP_LS_SR_TLV_SR_CAPABILITY 1034
967 #define BGP_LS_SR_TLV_SR_ALGORITHM 1035
968 #define BGP_LS_SR_TLV_SR_LOCAL_BLOCK 1036
969 #define BGP_LS_SR_TLV_SRV6_CAPABILITY 1038
970 #define BGP_LS_SR_TLV_FLEX_ALGO_DEF 1039
971 #define BGP_LS_SR_TLV_FLEX_ALGO_EXC_ANY_AFFINITY 1040
972 #define BGP_LS_SR_TLV_FLEX_ALGO_INC_ANY_AFFINITY 1041
973 #define BGP_LS_SR_TLV_FLEX_ALGO_INC_ALL_AFFINITY 1042
974 #define BGP_LS_SR_TLV_FLEX_ALGO_DEF_FLAGS 1043
975 #define BGP_LS_SR_TLV_FLEX_ALGO_PREFIX_METRIC 1044
976 #define BGP_LS_SR_TLV_FLEX_ALGO_EXC_SRLG 1045
977 #define BGP_LS_SR_TLV_ADJ_SID 1099
978 #define BGP_LS_SR_TLV_LAN_ADJ_SID 1100
979 #define BGP_LS_SR_TLV_PEER_NODE_SID 1101
980 #define BGP_LS_SR_TLV_PEER_ADJ_SID 1102
981 #define BGP_LS_SR_TLV_PEER_SET_SID 1103
982 #define BGP_LS_SR_TLV_SRV6_END_X_SID 1106
983 #define BGP_LS_SR_TLV_SRV6_LAN_END_X_SID 1107
984 #define BGP_LS_SR_TLV_PREFIX_SID 1158
985 #define BGP_LS_SR_TLV_RANGE 1159
986 #define BGP_LS_SR_TLV_SRV6_LOCATOR 1162
987 #define BGP_LS_SR_TLV_PREFIX_ATTR_FLAGS 1170
988 #define BGP_LS_SR_TLV_SOURCE_ROUTER_ID 1171
989 #define BGP_LS_SR_TLV_SRV6_ENDPOINT_BEHAVIOR 1250
990 #define BGP_LS_SR_TLV_SRV6_SID_STRUCT 1252
992 /* RFC8571 BGP-LS Advertisement of IGP TE Metric Extensions */
993 #define BGP_LS_IGP_TE_METRIC_DELAY 1114
994 #define BGP_LS_IGP_TE_METRIC_DELAY_MIN_MAX 1115
995 #define BGP_LS_IGP_TE_METRIC_DELAY_VARIATION 1116
996 #define BGP_LS_IGP_TE_METRIC_LOSS 1117
997 #define BGP_LS_IGP_TE_METRIC_BANDWIDTH_RESIDUAL 1118
998 #define BGP_LS_IGP_TE_METRIC_BANDWIDTH_AVAILABLE 1119
999 #define BGP_LS_IGP_TE_METRIC_BANDWIDTH_UTILIZED 1120
1001 #define BGP_LS_IGP_TE_METRIC_FLAG_A 0x80
1002 #define BGP_LS_IGP_TE_METRIC_FLAG_RESERVED 0x7F
1004 /* draft-ietf-idr-bgp-ls-app-specific-attr-07 */
1005 #define BGP_LS_APP_SPEC_LINK_ATTR 1122
1007 /* Prefix-SID TLV flags, draft-gredler-idr-bgp-ls-segment-routing-ext, RFC 8665-8667:
1010 +--+--+--+--+--+--+--+--+
1011 if Protocol-ID is IS-IS |R |N |P |E |V |L | | |
1012 +--+--+--+--+--+--+--+--+
1015 +--+--+--+--+--+--+--+--+
1016 if Protocol-ID is OSPF | |NP|M |E |V |L | | |
1017 +--+--+--+--+--+--+--+--+
1019 #define BGP_LS_SR_PREFIX_SID_FLAG_R 0x80
1020 #define BGP_LS_SR_PREFIX_SID_FLAG_N 0x40
1021 #define BGP_LS_SR_PREFIX_SID_FLAG_NP 0x40
1022 #define BGP_LS_SR_PREFIX_SID_FLAG_P 0x20
1023 #define BGP_LS_SR_PREFIX_SID_FLAG_M 0x20
1024 #define BGP_LS_SR_PREFIX_SID_FLAG_E 0x10
1025 #define BGP_LS_SR_PREFIX_SID_FLAG_V 0x08
1026 #define BGP_LS_SR_PREFIX_SID_FLAG_L 0x04
1028 /* Adjacency-SID TLV flags, draft-gredler-idr-bgp-ls-segment-routing-ext, RFC 8665-8667:
1031 +--+--+--+--+--+--+--+--+
1032 if Protocol-ID is IS-IS |F |B |V |L |S |P | | |
1033 +--+--+--+--+--+--+--+--+
1036 +--+--+--+--+--+--+--+--+
1037 if Protocol-ID is OSPF |B |V |L |G |P | | | |
1038 +--+--+--+--+--+--+--+--+
1040 #define BGP_LS_SR_ADJACENCY_SID_FLAG_FI 0x80
1041 #define BGP_LS_SR_ADJACENCY_SID_FLAG_BO 0x80
1042 #define BGP_LS_SR_ADJACENCY_SID_FLAG_BI 0x40
1043 #define BGP_LS_SR_ADJACENCY_SID_FLAG_VO 0x40
1044 #define BGP_LS_SR_ADJACENCY_SID_FLAG_VI 0x20
1045 #define BGP_LS_SR_ADJACENCY_SID_FLAG_LO 0x20
1046 #define BGP_LS_SR_ADJACENCY_SID_FLAG_LI 0x10
1047 #define BGP_LS_SR_ADJACENCY_SID_FLAG_GO 0x10
1048 #define BGP_LS_SR_ADJACENCY_SID_FLAG_SI 0x08
1049 #define BGP_LS_SR_ADJACENCY_SID_FLAG_PO 0x08
1050 #define BGP_LS_SR_ADJACENCY_SID_FLAG_PI 0x04
1052 /* BGP Peering SIDs TLV flags, rfc9086:
1055 +--+--+--+--+--+--+--+--+
1056 |V |L |B |P | | | | | rfc9086
1057 +--+--+--+--+--+--+--+--+
1059 #define BGP_LS_SR_PEER_SID_FLAG_V 0x80
1060 #define BGP_LS_SR_PEER_SID_FLAG_L 0x40
1061 #define BGP_LS_SR_PEER_SID_FLAG_B 0x20
1062 #define BGP_LS_SR_PEER_SID_FLAG_P 0x10
1064 /* SR-Capabilities TLV flags, draft-gredler-idr-bgp-ls-segment-routing-ext-01:
1067 +--+--+--+--+--+--+--+--+
1068 if Protocol-ID is IS-IS |I |V |H | | | | | |
1069 +--+--+--+--+--+--+--+--+
1071 #define BGP_LS_SR_CAPABILITY_FLAG_I 0x80
1072 #define BGP_LS_SR_CAPABILITY_FLAG_V 0x40
1073 #define BGP_LS_SR_CAPABILITY_FLAG_H 0x20
1075 /* Flexible Algorithm Definition Flags Sub-TLV flags, rfc9350:
1078 +--+--+--+--+--+--+--+--+
1079 if Protocol-ID is IS-IS |M | | | | | | | |
1080 +--+--+--+--+--+--+--+--+
1082 +--+--+--+--+--+--+--+--+
1083 if Protocol-ID is OSPF |M | | | | | | | |
1084 +--+--+--+--+--+--+--+--+
1086 #define BGP_LS_FLEX_ALGO_DEF_FLAGS_M 0x80000000
1088 /* OSPF Flexible Algorithm Prefix Metric Sub-TLV flags, rfc9350:
1091 +--+--+--+--+--+--+--+--+
1092 if Protocol-ID is OSPF |E | | | | | | | |
1093 +--+--+--+--+--+--+--+--+
1095 #define BGP_LS_FLEX_ALGO_PREFIX_METRIC_FLAGS_E 0x80
1097 /* Prefix Attribute Flags TLV flags, rfc9085:
1100 +--+--+--+--+--+--+--+--+
1101 if Protocol-ID is IS-IS |X |R |N |E | | | | | rfc7794,rfc9088
1102 +--+--+--+--+--+--+--+--+
1105 +--+--+--+--+--+--+--+--+
1106 if Protocol-ID is OSPF |A |N |E | | | | | | rfc7684,rfc9089
1107 +--+--+--+--+--+--+--+--+
1109 #define BGP_LS_SR_PREFIX_ATTR_FLAGS_FLAG_XI 0x80
1110 #define BGP_LS_SR_PREFIX_ATTR_FLAGS_FLAG_RI 0x40
1111 #define BGP_LS_SR_PREFIX_ATTR_FLAGS_FLAG_NI 0x20
1112 #define BGP_LS_SR_PREFIX_ATTR_FLAGS_FLAG_EI 0x10
1113 #define BGP_LS_SR_PREFIX_ATTR_FLAGS_FLAG_AO 0x80
1114 #define BGP_LS_SR_PREFIX_ATTR_FLAGS_FLAG_NO 0x40
1115 #define BGP_LS_SR_PREFIX_ATTR_FLAGS_FLAG_EO 0x20
1117 /* Link Attribute Application Identifiers, https://www.iana.org/assignments/igp-parameters/igp-parameters.xhtml:
1120 +--+--+--+--+--+--+--+--+
1121 |R |S |F |X | | | | | rfc8919,rfc8920
1122 +--+--+--+--+--+--+--+--+
1124 #define BGP_LS_APP_SPEC_LINK_ATTRS_SABM_R 0x80000000
1125 #define BGP_LS_APP_SPEC_LINK_ATTRS_SABM_S 0x40000000
1126 #define BGP_LS_APP_SPEC_LINK_ATTRS_SABM_F 0x20000000
1127 #define BGP_LS_APP_SPEC_LINK_ATTRS_SABM_X 0x10000000
1129 /* SRv6 Capabilities TLV flags, draft-ietf-idr-bgpls-srv6-ext-14
1131 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
1132 +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+
1133 if Protocol-ID is IS-IS | |O | Reserved | rfc9352
1134 +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+
1136 #define BGP_LS_SRV6_CAP_FLAG_O 0x4000
1137 #define BGP_LS_SRV6_CAP_FLAG_RESERVED 0x3fff
1139 /* SRv6 End.X SID TLV flags, draft-ietf-idr-bgpls-srv6-ext-14
1142 +--+--+--+--+--+--+--+--+
1143 if Protocol-ID is IS-IS |B |S |P | | | | | | rfc9352
1144 +--+--+--+--+--+--+--+--+
1146 #define BGP_LS_SRV6_ENDX_SID_FLAG_B 0x80
1147 #define BGP_LS_SRV6_ENDX_SID_FLAG_S 0x40
1148 #define BGP_LS_SRV6_ENDX_SID_FLAG_P 0x20
1149 #define BGP_LS_SRV6_ENDX_SID_FLAG_RESERVED 0x1f
1151 /* SRv6 Locator TLV flags, draft-ietf-idr-bgpls-srv6-ext-14
1154 +--+--+--+--+--+--+--+--+
1155 if Protocol-ID is IS-IS |D | Reserved | rfc9352
1156 +--+--+--+--+--+--+--+--+
1158 #define BGP_LS_SRV6_LOC_FLAG_D 0x80
1159 #define BGP_LS_SRV6_LOC_FLAG_RESERVED 0x7f
1161 /* BGP Prefix-SID TLV type */
1162 #define BGP_PREFIX_SID_TLV_LABEL_INDEX 1 /* Label-Index [RFC8669] */
1163 #define BGP_PREFIX_SID_TLV_2 2 /* Deprecated [RFC8669] */
1164 #define BGP_PREFIX_SID_TLV_ORIGINATOR_SRGB 3 /* Originator SRGB [RFC8669] */
1165 #define BGP_PREFIX_SID_TLV_4 4 /* Deprecated [draft-ietf-bess-srv6-services] */
1166 #define BGP_PREFIX_SID_TLV_SRV6_L3_SERVICE 5 /* SRv6 L3 Service [draft-ietf-bess-srv6-services] */
1167 #define BGP_PREFIX_SID_TLV_SRV6_L2_SERVICE 6 /* SRv6 L2 Service [draft-ietf-bess-srv6-services] */
1169 /* BGP_PREFIX_SID TLV lengths */
1170 #define BGP_PREFIX_SID_TLV_LEN_LABEL_INDEX 7
1172 /* BGP SRv6 Service Sub-TLV */
1173 #define SRV6_SERVICE_SRV6_SID_INFORMATION 1
1175 /* BGP SRv6 Service Data Sub-Sub-TLV */
1176 #define SRV6_SERVICE_DATA_SRV6_SID_STRUCTURE 1
1178 /* SRv6 Endpoint behavior */
1179 #define SRV6_ENDPOINT_BEHAVIOR_END 0x0001 /* End [RFC8986] */
1180 #define SRV6_ENDPOINT_BEHAVIOR_END_PSP 0x0002 /* End with PSP [RFC8986] */
1181 #define SRV6_ENDPOINT_BEHAVIOR_END_USP 0x0003 /* End with USP [RFC8986] */
1182 #define SRV6_ENDPOINT_BEHAVIOR_END_PSP_USP 0x0004 /* End with PSP & USP [RFC8986] */
1183 #define SRV6_ENDPOINT_BEHAVIOR_END_X 0x0005 /* End.X [RFC8986] */
1184 #define SRV6_ENDPOINT_BEHAVIOR_END_X_PSP 0x0006 /* End.X with PSP [RFC8986] */
1185 #define SRV6_ENDPOINT_BEHAVIOR_END_X_USP 0x0007 /* End.X with UPS [RFC8986] */
1186 #define SRV6_ENDPOINT_BEHAVIOR_END_X_PSP_USP 0x0008 /* End.X with PSP & USP [RFC8986] */
1187 #define SRV6_ENDPOINT_BEHAVIOR_END_T 0x0009 /* End.T [RFC8986] */
1188 #define SRV6_ENDPOINT_BEHAVIOR_END_T_PSP 0x000A /* End.T with PSP [RFC8986] */
1189 #define SRV6_ENDPOINT_BEHAVIOR_END_T_USP 0x000B /* End.T with USP [RFC8986] */
1190 #define SRV6_ENDPOINT_BEHAVIOR_END_T_PSP_USP 0x000C /* End.T with PSP & USP [RFC8986] */
1191 #define SRV6_ENDPOINT_BEHAVIOR_END_B6_INSERT 0x000D /* End.B6.Insert [draft-filsfils-spring-srv6-net-pgm-insertion-04] */
1192 #define SRV6_ENDPOINT_BEHAVIOR_END_B6_ENCAPS 0x000E /* End.B6.Encaps [RFC8986] */
1193 #define SRV6_ENDPOINT_BEHAVIOR_END_BM 0x000F /* End.BM [RFC8986] */
1194 #define SRV6_ENDPOINT_BEHAVIOR_END_DX6 0x0010 /* End.DX6 [RFC8986] */
1195 #define SRV6_ENDPOINT_BEHAVIOR_END_DX4 0x0011 /* End.DX4 [RFC8986] */
1196 #define SRV6_ENDPOINT_BEHAVIOR_END_DT6 0x0012 /* End.DT6 [RFC8986] */
1197 #define SRV6_ENDPOINT_BEHAVIOR_END_DT4 0x0013 /* End.DT4 [RFC8986] */
1198 #define SRV6_ENDPOINT_BEHAVIOR_END_DT46 0x0014 /* End.DT46 [RFC8986] */
1199 #define SRV6_ENDPOINT_BEHAVIOR_END_DX2 0x0015 /* End.DX2 [RFC8986] */
1200 #define SRV6_ENDPOINT_BEHAVIOR_END_DX2V 0x0016 /* End.DX2V [RFC8986] */
1201 #define SRV6_ENDPOINT_BEHAVIOR_END_DT2U 0x0017 /* End.DX2U [RFC8986] */
1202 #define SRV6_ENDPOINT_BEHAVIOR_END_DT2M 0x0018 /* End.DT2M [RFC8986] */
1203 #define SRV6_ENDPOINT_BEHAVIOR_END_B6_INSERT_RED 0x001A /* End.B6.Insert.Red [draft-filsfils-spring-srv6-net-pgm-insertion-04] */
1204 #define SRV6_ENDPOINT_BEHAVIOR_END_B6_ENCAPS_RED 0x001B /* End.B6.Encaps.Red [RFC8986] */
1205 #define SRV6_ENDPOINT_BEHAVIOR_END_USD 0x001C /* End with USD [RFC8986] */
1206 #define SRV6_ENDPOINT_BEHAVIOR_END_PSP_USD 0x001D /* End with PSP & USD [RFC8986] */
1207 #define SRV6_ENDPOINT_BEHAVIOR_END_USP_USD 0x001E /* End with USP & USD [RFC8986] */
1208 #define SRV6_ENDPOINT_BEHAVIOR_END_PSP_USP_USD 0x001F /* End with PSP, USP & USD [RFC8986] */
1209 #define SRV6_ENDPOINT_BEHAVIOR_END_X_USD 0x0020 /* End.X with USD [RFC8986] */
1210 #define SRV6_ENDPOINT_BEHAVIOR_END_X_PSP_USD 0x0021 /* End.X with PSP & USD [RFC8986] */
1211 #define SRV6_ENDPOINT_BEHAVIOR_END_X_USP_USD 0x0022 /* End.X with USP & USD [RFC8986] */
1212 #define SRV6_ENDPOINT_BEHAVIOR_END_X_PSP_USP_USD 0x0023 /* End.X with PSP, USP & USD [RFC8986] */
1213 #define SRV6_ENDPOINT_BEHAVIOR_END_T_USD 0x0024 /* End.T with USD [RFC8986] */
1214 #define SRV6_ENDPOINT_BEHAVIOR_END_T_PSP_USD 0x0025 /* End.T with PSP & USD [RFC8986] */
1215 #define SRV6_ENDPOINT_BEHAVIOR_END_T_USP_USD 0x0026 /* End.T with USP & USD [RFC8986] */
1216 #define SRV6_ENDPOINT_BEHAVIOR_END_T_PSP_USP_USD 0x0027 /* End.T with PSP, USP & USD [RFC8986] */
1217 #define SRV6_ENDPOINT_BEHAVIOR_END_MAP 0x0028 /* End.MAP */
1218 #define SRV6_ENDPOINT_BEHAVIOR_END_LIMIT 0x0029 /* End.Limit */
1219 #define SRV6_ENDPOINT_BEHAVIOR_END_ONLY_CSID 0x002A /* End with NEXT-ONLY-CSID [draft-filsfils-spring-net-pgm-extension-srv6-usid] */
1220 #define SRV6_ENDPOINT_BEHAVIOR_END_CSID 0x002B /* End with NEXT-CSID [draft-ietf-spring-srv6-srh-compression] */
1221 #define SRV6_ENDPOINT_BEHAVIOR_END_CSID_PSP 0x002C /* End with NEXT-CSID & PSP [draft-ietf-spring-srv6-srh-compression] */
1222 #define SRV6_ENDPOINT_BEHAVIOR_END_CSID_USP 0x002D /* End with NEXT-CSID & USP [draft-ietf-spring-srv6-srh-compression] */
1223 #define SRV6_ENDPOINT_BEHAVIOR_END_CSID_PSP_USP 0x002E /* End with NEXT-CSID, PSP & USP [draft-ietf-spring-srv6-srh-compression] */
1224 #define SRV6_ENDPOINT_BEHAVIOR_END_CSID_USD 0x002F /* End with NEXT-CSID & USD [draft-ietf-spring-srv6-srh-compression] */
1225 #define SRV6_ENDPOINT_BEHAVIOR_END_CSID_PSP_USD 0x0030 /* End with NEXT-CSID, PSP & USD [draft-ietf-spring-srv6-srh-compression] */
1226 #define SRV6_ENDPOINT_BEHAVIOR_END_CSID_USP_USD 0x0031 /* End with NEXT-CSID, USP & USD [draft-ietf-spring-srv6-srh-compression] */
1227 #define SRV6_ENDPOINT_BEHAVIOR_END_CSID_PSP_USP_USD 0x0032 /* End with NEXT-CSID, PSP, USP & USD [draft-ietf-spring-srv6-srh-compression] */
1228 #define SRV6_ENDPOINT_BEHAVIOR_END_X_ONLY_CSID 0x0033 /* End.X with NEXT-ONLY-CSID [draft-filsfils-spring-net-pgm-extension-srv6-usid] */
1229 #define SRV6_ENDPOINT_BEHAVIOR_END_X_CSID 0x0034 /* End.X with NEXT-CSID [draft-ietf-spring-srv6-srh-compression] */
1230 #define SRV6_ENDPOINT_BEHAVIOR_END_X_CSID_PSP 0x0035 /* End.X with NEXT-CSID & PSP [draft-ietf-spring-srv6-srh-compression] */
1231 #define SRV6_ENDPOINT_BEHAVIOR_END_X_CSID_USP 0x0036 /* End.X with NEXT-CSID & USP [draft-ietf-spring-srv6-srh-compression] */
1232 #define SRV6_ENDPOINT_BEHAVIOR_END_X_CSID_PSP_USP 0x0037 /* End.X with NEXT-CSID, PSP & USP [draft-ietf-spring-srv6-srh-compression] */
1233 #define SRV6_ENDPOINT_BEHAVIOR_END_X_CSID_USD 0x0038 /* End.X with NEXT-CSID & USD [draft-ietf-spring-srv6-srh-compression] */
1234 #define SRV6_ENDPOINT_BEHAVIOR_END_X_CSID_PSP_USD 0x0039 /* End.X with NEXT-CSID, PSP & USD [draft-ietf-spring-srv6-srh-compression] */
1235 #define SRV6_ENDPOINT_BEHAVIOR_END_X_CSID_USP_USD 0x003A /* End.X with NEXT-CSID, USP & USD [draft-ietf-spring-srv6-srh-compression] */
1236 #define SRV6_ENDPOINT_BEHAVIOR_END_X_CSID_PSP_USP_USD 0x003B /* End.X with NEXT-CSID, PSP, USP & USD [draft-ietf-spring-srv6-srh-compression] */
1237 #define SRV6_ENDPOINT_BEHAVIOR_END_DX6_CSID 0x003C /* End.DX6 with NEXT-CSID [draft-filsfils-spring-net-pgm-extension-srv6-usid] */
1238 #define SRV6_ENDPOINT_BEHAVIOR_END_DX4_CSID 0x003D /* End.DX4 with NEXT-CSID [draft-filsfils-spring-net-pgm-extension-srv6-usid] */
1239 #define SRV6_ENDPOINT_BEHAVIOR_END_DT6_CSID 0x003E /* End.DT6 with NEXT-CSID [draft-filsfils-spring-net-pgm-extension-srv6-usid] */
1240 #define SRV6_ENDPOINT_BEHAVIOR_END_DT4_CSID 0x003F /* End.DT4 with NEXT-CSID [draft-filsfils-spring-net-pgm-extension-srv6-usid] */
1241 #define SRV6_ENDPOINT_BEHAVIOR_END_DT46_CSID 0x0040 /* End.DT46 with NEXT-CSID [draft-filsfils-spring-net-pgm-extension-srv6-usid] */
1242 #define SRV6_ENDPOINT_BEHAVIOR_END_DX2_CSID 0x0041 /* End.DX2 with NEXT-CSID [draft-filsfils-spring-net-pgm-extension-srv6-usid] */
1243 #define SRV6_ENDPOINT_BEHAVIOR_END_DX2V_CSID 0x0042 /* End.DX2V with NEXT-CSID [draft-filsfils-spring-net-pgm-extension-srv6-usid] */
1244 #define SRV6_ENDPOINT_BEHAVIOR_END_DT2U_CSID 0x0043 /* End.DT2U with NEXT-CSID [draft-filsfils-spring-net-pgm-extension-srv6-usid] */
1245 #define SRV6_ENDPOINT_BEHAVIOR_END_DT2M_CSID 0x0044 /* End.DT2M with NEXT-CSID [draft-filsfils-spring-net-pgm-extension-srv6-usid] */
1246 #define SRV6_ENDPOINT_BEHAVIOR_END_M_GTP6D 0x0045 /* End.M.GTP6.D [RFC9433] */
1247 #define SRV6_ENDPOINT_BEHAVIOR_END_M_GTP6DI 0x0046 /* End.M.GTP6.Di [RFC9433] */
1248 #define SRV6_ENDPOINT_BEHAVIOR_END_M_GTP6E 0x0047 /* End.M.GTP6.E [RFC9433] */
1249 #define SRV6_ENDPOINT_BEHAVIOR_END_M_GTP4E 0x0048 /* End.M.GTP4.E [RFC9433] */
1250 #define SRV6_ENDPOINT_BEHAVIOR_END_M 0x004A /* End.M (Mirror SID) [draft-ietf-rtgwg-srv6-egress-protection-02] */
1251 #define SRV6_ENDPOINT_BEHAVIOR_END_REPLICATE 0x004B /* End.Replicate [RFC9524] */
1252 #define SRV6_ENDPOINT_BEHAVIOR_END_NSH 0x0054 /* End.NSH - NSH Segment [RFC9491] */
1253 #define SRV6_ENDPOINT_BEHAVIOR_END_DX1 0x009E /* End.DX1 [draft-ietf-pals-ple-02] */
1254 #define SRV6_ENDPOINT_BEHAVIOR_END_DX1_NEXT_CSID 0x009F /* End.DX1 with NEXT-CSID [draft-ietf-pals-ple-02] */
1255 #define SRV6_ENDPOINT_BEHAVIOR_END_DX1_REPL_CSID 0x00A0 /* End.DX1 with REPLACE-CSID [draft-ietf-pals-ple-02] */
1256 #define SRV6_ENDPOINT_BEHAVIOR_OPAQUE 0xFFFF /* Opaque [RFC8986] */
1258 static const value_string bgptypevals
[] = {
1259 { BGP_OPEN
, "OPEN Message" },
1260 { BGP_UPDATE
, "UPDATE Message" },
1261 { BGP_NOTIFICATION
, "NOTIFICATION Message" },
1262 { BGP_KEEPALIVE
, "KEEPALIVE Message" },
1263 { BGP_ROUTE_REFRESH
, "ROUTE-REFRESH Message" },
1264 { BGP_CAPABILITY
, "CAPABILITY Message" },
1265 { BGP_ROUTE_REFRESH_CISCO
, "Cisco ROUTE-REFRESH Message" },
1269 static const value_string evpnrtypevals
[] = {
1270 { EVPN_AD_ROUTE
, "Ethernet AD Route" },
1271 { EVPN_MAC_ROUTE
, "MAC Advertisement Route" },
1272 { EVPN_INC_MCAST_TREE
, "Inclusive Multicast Route" },
1273 { EVPN_ETH_SEGMENT_ROUTE
, "Ethernet Segment Route" },
1274 { EVPN_IP_PREFIX_ROUTE
, "IP Prefix route" },
1275 { EVPN_MC_ETHER_TAG_ROUTE
, "Selective Multicast Ethernet Tag Route" },
1276 { EVPN_IGMP_JOIN_ROUTE
, "IGMP Join Synch Route" },
1277 { EVPN_IGMP_LEAVE_ROUTE
, "IGMP Leave Synch Route" },
1278 { EVPN_PER_REG_I_PMSI_A_D_ROUTE
, "Per-Region I-PMSI A-D route" },
1279 { EVPN_S_PMSI_A_D_ROUTE
, "S-PMSI A-D Route" },
1280 { EVPN_LEAF_A_D_ROUTE
, "Leaf A-D route" },
1284 static const value_string evpn_nlri_esi_type
[] = {
1285 { BGP_NLRI_EVPN_ESI_VALUE
, "ESI 9 bytes value" },
1286 { BGP_NLRI_EVPN_ESI_LACP
, "ESI LACP 802.1AX defined" },
1287 { BGP_NLRI_EVPN_ESI_MSTP
, "ESI MSTP defined" },
1288 { BGP_NLRI_EVPN_ESI_MAC
, "ESI MAC address defined" },
1289 { BGP_NLRI_EVPN_ESI_RID
, "ESI Router ID" },
1290 { BGP_NLRI_EVPN_ESI_ASN
, "ESI Autonomous System" },
1291 { BGP_NLRI_EVPN_ESI_RES
, "ESI reserved" },
1295 #define BGP_MAJOR_ERROR_MSG_HDR 1
1296 #define BGP_MAJOR_ERROR_OPEN_MSG 2
1297 #define BGP_MAJOR_ERROR_UPDATE_MSG 3
1298 #define BGP_MAJOR_ERROR_HT_EXPIRED 4
1299 #define BGP_MAJOR_ERROR_STATE_MACHINE 5
1300 #define BGP_MAJOR_ERROR_CEASE 6
1301 #define BGP_MAJOR_ERROR_ROUTE_REFRESH 7
1302 #define BGP_MAJOR_ERROR_SH_T_EXPIRED 8
1304 static const value_string bgpnotify_major
[] = {
1305 { BGP_MAJOR_ERROR_MSG_HDR
, "Message Header Error" },
1306 { BGP_MAJOR_ERROR_OPEN_MSG
, "OPEN Message Error" },
1307 { BGP_MAJOR_ERROR_UPDATE_MSG
, "UPDATE Message Error" },
1308 { BGP_MAJOR_ERROR_HT_EXPIRED
, "Hold Timer Expired" },
1309 { BGP_MAJOR_ERROR_STATE_MACHINE
, "Finite State Machine Error" },
1310 { BGP_MAJOR_ERROR_CEASE
, "Cease" },
1311 { BGP_MAJOR_ERROR_ROUTE_REFRESH
, "ROUTE-REFRESH Message Error" }, /* RFC 7313 - Enhanced Route Refresh Capability for BGP-4 */
1312 { BGP_MAJOR_ERROR_SH_T_EXPIRED
, "Send Hold Timer Expired" },
1316 static const value_string bgpnotify_minor_msg_hdr
[] = {
1317 { 1, "Connection Not Synchronized" },
1318 { 2, "Bad Message Length" },
1319 { 3, "Bad Message Type" },
1323 static const value_string bgpnotify_minor_open_msg
[] = {
1324 { 1, "Unsupported Version Number" },
1325 { 2, "Bad Peer AS" },
1326 { 3, "Bad BGP Identifier" },
1327 { 4, "Unsupported Optional Parameter" },
1328 { 5, "Authentication Failure [Deprecated]" },
1329 { 6, "Unacceptable Hold Time" },
1330 { 7, "Unsupported Capability" },
1331 { 8, "No supported AFI/SAFI (Cisco)" },
1332 { 11, "Role Mismatch" },
1336 static const value_string bgpnotify_minor_update_msg
[] = {
1337 { 1, "Malformed Attribute List" },
1338 { 2, "Unrecognized Well-known Attribute" },
1339 { 3, "Missing Well-known Attribute" },
1340 { 4, "Attribute Flags Error" },
1341 { 5, "Attribute Length Error" },
1342 { 6, "Invalid ORIGIN Attribute" },
1343 { 7, "AS Routing Loop [Deprecated]" },
1344 { 8, "Invalid NEXT_HOP Attribute" },
1345 { 9, "Optional Attribute Error" },
1346 { 10, "Invalid Network Field" },
1347 { 11, "Malformed AS_PATH" },
1350 /* RFC6608 Subcodes for BGP Finite State Machine Error */
1351 static const value_string bgpnotify_minor_state_machine
[] = {
1352 { 1, "Receive Unexpected Message in OpenSent State" },
1353 { 2, "Receive Unexpected Message in OpenConfirm State" },
1354 { 3, "Receive Unexpected Message in Established State" },
1358 #define BGP_CEASE_MINOR_MAX_REACHED 1
1359 #define BGP_CEASE_MINOR_ADMIN_SHUTDOWN 2
1360 #define BGP_CEASE_MINOR_PEER_DE_CONF 3
1361 #define BGP_CEASE_MINOR_ADMIN_RESET 4
1362 #define BGP_CEASE_MINOR_CONN_RESET 5
1363 #define BGP_CEASE_MINOR_OTHER_CONF_CHANGE 6
1364 #define BGP_CEASE_MINOR_CONN_COLLISION 7
1365 #define BGP_CEASE_MINOR_OUT_RESOURCES 8
1366 #define BGP_CEASE_MINOR_HARD_RESET 9
1367 #define BGP_CEASE_MINOR_BFD_DOWN 10
1369 /* RFC4486 Subcodes for BGP Cease Notification Message */
1370 static const value_string bgpnotify_minor_cease
[] = {
1371 { BGP_CEASE_MINOR_MAX_REACHED
, "Maximum Number of Prefixes Reached"},
1372 { BGP_CEASE_MINOR_ADMIN_SHUTDOWN
, "Administratively Shutdown"},
1373 { BGP_CEASE_MINOR_PEER_DE_CONF
, "Peer De-configured"},
1374 { BGP_CEASE_MINOR_ADMIN_RESET
, "Administratively Reset"},
1375 { BGP_CEASE_MINOR_CONN_RESET
, "Connection Rejected"},
1376 { BGP_CEASE_MINOR_OTHER_CONF_CHANGE
, "Other Configuration Change"},
1377 { BGP_CEASE_MINOR_CONN_COLLISION
, "Connection Collision Resolution"},
1378 { BGP_CEASE_MINOR_OUT_RESOURCES
, "Out of Resources"},
1379 { BGP_CEASE_MINOR_HARD_RESET
, "Hard Reset"},
1380 { BGP_CEASE_MINOR_BFD_DOWN
, "BFD Down"},
1384 /* RFC7313 - Enhanced Route Refresh Capability for BGP-4 */
1385 static const value_string bgpnotify_minor_rr_msg
[] = {
1386 { 1, "Invalid Message Length" },
1390 static const value_string bgpattr_origin
[] = {
1393 { 2, "INCOMPLETE" },
1397 static const value_string bgp_open_opt_vals
[] = {
1398 { BGP_OPTION_AUTHENTICATION
, "Authentication" },
1399 { BGP_OPTION_CAPABILITY
, "Capability" },
1400 { BGP_OPTION_EXTENDED_LEN
, "Extended Length"},
1404 static const value_string as_segment_type
[] = {
1406 { 2, "AS_SEQUENCE" },
1407 /* RFC1965 has the wrong values, corrected in */
1408 /* draft-ietf-idr-bgp-confed-rfc1965bis-01.txt */
1409 { 4, "AS_CONFED_SET" },
1410 { 3, "AS_CONFED_SEQUENCE" },
1414 static const value_string bgpattr_type
[] = {
1415 { BGPTYPE_ORIGIN
, "ORIGIN" },
1416 { BGPTYPE_AS_PATH
, "AS_PATH" },
1417 { BGPTYPE_NEXT_HOP
, "NEXT_HOP" },
1418 { BGPTYPE_MULTI_EXIT_DISC
, "MULTI_EXIT_DISC" },
1419 { BGPTYPE_LOCAL_PREF
, "LOCAL_PREF" },
1420 { BGPTYPE_ATOMIC_AGGREGATE
, "ATOMIC_AGGREGATE" },
1421 { BGPTYPE_AGGREGATOR
, "AGGREGATOR" },
1422 { BGPTYPE_COMMUNITIES
, "COMMUNITIES" },
1423 { BGPTYPE_ORIGINATOR_ID
, "ORIGINATOR_ID" },
1424 { BGPTYPE_CLUSTER_LIST
, "CLUSTER_LIST" },
1425 { BGPTYPE_DPA
, "DPA" },
1426 { BGPTYPE_ADVERTISER
, "ADVERTISER" },
1427 { BGPTYPE_RCID_PATH
, "RCID_PATH / CLUSTER_ID" },
1428 { BGPTYPE_MP_REACH_NLRI
, "MP_REACH_NLRI" },
1429 { BGPTYPE_MP_UNREACH_NLRI
, "MP_UNREACH_NLRI" },
1430 { BGPTYPE_EXTENDED_COMMUNITY
, "EXTENDED_COMMUNITIES" },
1431 { BGPTYPE_AS4_PATH
, "AS4_PATH" },
1432 { BGPTYPE_AS4_AGGREGATOR
, "AS4_AGGREGATOR" },
1433 { BGPTYPE_SAFI_SPECIFIC_ATTR
, "SAFI_SPECIFIC_ATTRIBUTE" },
1434 { BGPTYPE_CONNECTOR_ATTRIBUTE
, "Connector Attribute" },
1435 { BGPTYPE_AS_PATHLIMIT
, "AS_PATHLIMIT "},
1436 { BGPTYPE_TUNNEL_ENCAPS_ATTR
, "TUNNEL_ENCAPSULATION_ATTRIBUTE" },
1437 { BGPTYPE_PMSI_TUNNEL_ATTR
, "PMSI_TUNNEL_ATTRIBUTE" },
1438 { BGPTYPE_TRAFFIC_ENGINEERING
, "Traffic Engineering" },
1439 { BGPTYPE_IPV6_ADDR_SPEC_EC
, "IPv6 Address Specific Extended Community" },
1440 { BGPTYPE_AIGP
, "AIGP" },
1441 { BGPTYPE_PE_DISTING_LABLES
, "PE Distinguisher Labels" },
1442 { BGPTYPE_BGP_ENTROPY_LABEL
, "BGP Entropy Label Capability Attribute" },
1443 { BGPTYPE_LINK_STATE_ATTR
, "BGP-LS Attribute" },
1444 { BGPTYPE_30
, "Deprecated" },
1445 { BGPTYPE_31
, "Deprecated" },
1446 { BGPTYPE_LARGE_COMMUNITY
, "LARGE_COMMUNITY" },
1447 { BGPTYPE_BGPSEC_PATH
, "BGPsec_PATH" },
1448 { BGPTYPE_OTC
, "OTC" },
1449 { BGPTYPE_D_PATH
, "D_PATH" },
1450 { BGPTYPE_SFP_ATTRIBUTE
, "SFP Attribute" },
1451 { BGPTYPE_BFD_DISCRIMINATOR
, "BFD Discriminator" },
1452 { BGPTYPE_NEXT_HOP_DEP_CAP
, "BGP Next Hop Dependent Capabilities" },
1453 { BGPTYPE_BGP_PREFIX_SID
, "BGP Prefix-SID" },
1454 { BGPTYPE_LINK_STATE_OLD_ATTR
, "LINK_STATE (unofficial code point)" },
1455 { BGPTYPE_ATTR_SET
, "ATTR_SET" },
1456 { BGPTYPE_129
, "Deprecated" },
1457 { BGPTYPE_241
, "Deprecated" },
1458 { BGPTYPE_242
, "Deprecated" },
1459 { BGPTYPE_243
, "Deprecated" },
1463 static const value_string pmsi_tunnel_type
[] = {
1464 { PMSI_TUNNEL_NOPRESENT
, "Type is not present" },
1465 { PMSI_TUNNEL_RSVPTE_P2MP
, "RSVP-TE P2MP LSP" },
1466 { PMSI_TUNNEL_MLDP_P2MP
, "mLDP P2MP LSP" },
1467 { PMSI_TUNNEL_PIMSSM
, "PIM SSM Tree" },
1468 { PMSI_TUNNEL_PIMSM
, "PIM SM Tree" },
1469 { PMSI_TUNNEL_BIDIR_PIM
, "BIDIR-PIM Tree" },
1470 { PMSI_TUNNEL_INGRESS
, "Ingress Replication" },
1471 { PMSI_TUNNEL_MLDP_MP2MP
, "mLDP MP2MP LSP" },
1472 { PMSI_TUNNEL_TRANPORT
, "Transport Tunnel" },
1473 { PMSI_TUNNEL_ASS_REPLIC
, "Assisted Replication Tunnel" },
1474 { PMSI_TUNNEL_BIER
, "BIER" },
1475 { PMSI_TUNNEL_SR_MPLS_P2MP
, "SR-MPLS P2MP Tree" },
1479 static const value_string aigp_tlv_type
[] = {
1480 { AIGP_TLV_TYPE
, "Type AIGP TLV" },
1484 static const value_string pmsi_mldp_fec_opaque_value_type
[] = {
1485 { PMSI_MLDP_FEC_TYPE_RSVD
, "Reserved" },
1486 { PMSI_MLDP_FEC_TYPE_GEN_LSP
, "Generic LSP Identifier" },
1487 { PMSI_MLDP_FEC_TYPE_TRANSIT_IPV4_SRC
, "Transit IPv4 Source" },
1488 { PMSI_MLDP_FEC_TYPE_TRANSIT_IPV6_SRC
, "Transit IPv6 Source" },
1489 { PMSI_MLDP_FEC_TYPE_TRANSIT_IPV4_BIDIR
, "Transit IPv4 Bidir" },
1490 { PMSI_MLDP_FEC_TYPE_TRANSIT_IPV6_BIDIR
, "Transit IPv6 Bidir" },
1491 { PMSI_MLDP_FEC_TYPE_RECURSE_OPAQUE_VALUE
, "Recursive Opaque Value" },
1492 { PMSI_MLDP_FEC_TYPE_VPN_RECURSE_OPAQUE_VALUE
, "VPN-Recursive Opaque Value" },
1493 { PMSI_MLDP_FEC_TYPE_TRANSIT_VPNV4_BIDIR
, "Transit VPNv4 Bidir" },
1494 { PMSI_MLDP_FEC_TYPE_TRANSIT_VPNV6_BIDIR
, "Transit VPNv6 Bidir" },
1495 { PMSI_MLDP_FEC_TYPE_TRANSIT_IPV4_SHARED_TREE
, "Transit IPv4 Shared Tree" },
1496 { PMSI_MLDP_FEC_TYPE_TRANSIT_IPV6_SHARED_TREE
, "Transit IPv6 Shared Tree" },
1497 { PMSI_MLDP_FEC_TYPE_L2VPN_MCAST
, "L2VPN-MCAST application" },
1498 { PMSI_MLDP_FEC_TYPE_TRANSIT_VPNV4_SRC
, "Transit VPNv4 Source" },
1499 { PMSI_MLDP_FEC_TYPE_TRANSIT_VPNV6_SRC
, "Transit VPNv6 Source" },
1500 { PMSI_MLDP_FEC_TYPE_EXT_TYPE
, "Extended Type field in the following two bytes" },
1504 static const value_string pmsi_mldp_fec_opa_extented_type
[] = {
1505 { PMSI_MLDP_FEC_ETYPE_RSVD
, "Reserved" },
1509 static const value_string bgp_attr_tunnel_type
[] = {
1510 { TUNNEL_TYPE_L2TP_OVER_IP
, "L2TPv2 over IP" },
1511 { TUNNEL_TYPE_GRE
, "GRE" },
1512 { TUNNEL_TYPE_TTE
, "Transmit tunnel endpoint" },
1513 { TUNNEL_TYPE_IPSEC_IN_TM
, "IPsec in Tunnel-mode" },
1514 { TUNNEL_TYPE_IP_IN_IP_IPSEC
, "IP in IP tunnel with IPsec Transport Mode" },
1515 { TUNNEL_TYPE_MPLS_IN_IP_IPSEC
, "MPLS-in-IP tunnel with IPsec Transport Mode" },
1516 { TUNNEL_TYPE_IP_IN_IP
, "IP in IP" },
1517 { TUNNEL_TYPE_VXLAN
, "VXLAN Encapsulation" },
1518 { TUNNEL_TYPE_NVGRE
, "NVGRE Encapsulation" },
1519 { TUNNEL_TYPE_MPLS
, "MPLS Encapsulation" },
1520 { TUNNEL_TYPE_MPLS_IN_GRE
, "MPLS in GRE Encapsulation" },
1521 { TUNNEL_TYPE_VXLAN_GPE
, "VXLAN GPE Encapsulation" },
1522 { TUNNEL_TYPE_MPLS_IN_UDP
, "MPLS in UDP Encapsulation" },
1523 { TUNNEL_TYPE_IPV6_TUNNEL
, "IPv6 Tunnel" },
1524 { TUNNEL_TYPE_SR_TE_POLICY
, "SR TE Policy Type" },
1525 { TUNNEL_TYPE_BARE
, "Bare" },
1526 { TUNNEL_TYPE_SR_TUNNEL
, "SR Tunnel" },
1527 { TUNNEL_TYPE_CLOUD_SECURITY
, "Cloud Security" },
1528 { TUNNEL_TYPE_GENEVE_ENCAP
, "Geneve Encapsulation" },
1529 { TUNNEL_TYPE_ANY_ENCAP
, "Any Encapsulation" },
1530 { TUNNEL_TYPE_GTP_TUNNEL_TYPE
, "GTP Tunnel Type" },
1531 { TUNNEL_TYPE_DPS_TUNNEL_ENCAP
, "Dynamic Path Selection Tunnel Encapsulation" },
1532 { TUNNEL_TYPE_ORIGINATING_PE
, "Originating PE" },
1533 { TUNNEL_TYPE_DPS_POLICY
, "Dynamic Path Selection Policy" },
1534 { TUNNEL_TYPE_SDWAN_HYBRID
, "SDWAN Hybrid" },
1535 { TUNNEL_TYPE_X_OVER_UDP
, "X-over-UDP" },
1536 { TUNNEL_TYPE_DES_TUNNEL_ENCAP
, "Distributed Etherlink Switch Tunnel Encapsulation" },
1540 static const value_string subtlv_type
[] = {
1541 { TUNNEL_SUBTLV_ENCAPSULATION
, "Encapsulation" },
1542 { TUNNEL_SUBTLV_PROTO_TYPE
, "Protocol Type" },
1543 { TUNNEL_SUBTLV_IPSEC_TA
, "IPsec Tunnel Authenticator" },
1544 { TUNNEL_SUBTLV_COLOR
, "Color" },
1545 { TUNNEL_SUBTLV_LOAD_BALANCE
, "Load-Balancing Block" },
1546 { TUNNEL_SUBTLV_REMOTE_ENDPOINT
,"Tunnel Egress Endpoint" },
1547 { TUNNEL_SUBTLV_IPV4_DS_FIELD
, "IPv4 DS Field" },
1548 { TUNNEL_SUBTLV_UDP_DST_PORT
, "UDP Destination Port" },
1549 { TUNNEL_SUBTLV_EMBEDDED_LABEL
, "Embedded Label Handling" },
1550 { TUNNEL_SUBTLV_MPLS_LABEL
, "MPLS Label Stack" },
1551 { TUNNEL_SUBTLV_PREFIX_SID
, "Prefix SID" },
1552 { TUNNEL_SUBTLV_PREFERENCE
, "Preference" },
1553 { TUNNEL_SUBTLV_BINDING_SID
, "Binding SID" },
1554 { TUNNEL_SUBTLV_ENLP
, "ENLP" },
1555 { TUNNEL_SUBTLV_PRIORITY
, "Priority" },
1556 { TUNNEL_SUBTLV_SPI_SI_REP
, "SPI/SI Representation" },
1557 { TUNNEL_SUBTLV_SRV6_BINDING_SID
, "SRv6 Binding SID" },
1558 { TUNNEL_SUBTLV_IPSEC_SA_ID
, "IPSEC-SA-ID" },
1559 { TUNNEL_SUBTLV_EXT_PORT_PROP
, "Extended Port Property" },
1560 { TUNNEL_SUBTLV_UNDERLAY_ISP_PROP
, "Underlay ISP Properties" },
1561 { TUNNEL_SUBTLV_IPSEC_SA_NONCE
, "IPsec SA Nonce" },
1562 { TUNNEL_SUBTLV_IPSEC_PUBLIC_KEY
, "IPsec Public Key" },
1563 { TUNNEL_SUBTLV_IPSEC_SA_PROPOSAL
, "IPsec SA Proposal" },
1564 { TUNNEL_SUBTLV_SIMPL_IPSEC_SA
, "Simplified IPsec SA" },
1565 { TUNNEL_SUBTLV_NRP
, "NRP" },
1566 { TUNNEL_SUBTLV_RPF
, "RPF" },
1567 { TUNNEL_SUBTLV_TREE_LABEL_STACK
, "Tree Label Stack" },
1568 { TUNNEL_SUBTLV_SEGMENT_LIST
, "Segment List" },
1569 { TUNNEL_SUBTLV_POLICY_CP_NAME
, "Policy CP Name" },
1570 { TUNNEL_SUBTLV_POLICY_NAME
, "Policy Name" },
1571 { TUNNEL_SUBTLV_WAN_ID
, "The WAN ID" },
1572 { TUNNEL_SUBTLV_BYTES
, "The Bytes" },
1573 { TUNNEL_SUBTLV_IPSEC_DIM
, "IPSEC DIM" },
1574 { TUNNEL_SUBTLV_IPSEC_KEY_EXCH
, "IPSEC Key Exchange" },
1575 { TUNNEL_SUBTLV_IPSEC_SA_PROPS
, "IPSEC SA Proposals" },
1576 { TUNNEL_SUBTLV_SRV_SEGMENT_LIST
, "Service Segment List" },
1577 { TUNNEL_SUBTLV_SRV_VTEP
, "Service Vtep" },
1578 { TUNNEL_SUBTLV_DES_ADJACENCY
, "Distributed Etherlink Switch (DES) Adjacency" },
1582 static const value_string bgp_enlp_type
[] = {
1584 { 1 , "Push IPv4, do not push IPv6" },
1585 { 2 , "Push IPv6, do not push IPv4" },
1586 { 3 , "Push IPv4, push IPv6" },
1587 { 4 , "Do not push" },
1591 static const value_string bgp_sr_policy_list_type
[] = {
1592 { TUNNEL_SUBTLV_SEGMENT_LIST_SUB_TYPE_A
, "Type A MPLS SID sub-TLV" },
1593 { TUNNEL_SUBTLV_SEGMENT_LIST_SUB_TYPE_B
, "Type B SRv6 SID sub-TLV" },
1594 { TUNNEL_SUBTLV_SEGMENT_LIST_SUB_TYPE_C
, "Type C IPv4 Node and SID sub-TLV" },
1595 { TUNNEL_SUBTLV_SEGMENT_LIST_SUB_TYPE_D
, "Type D IPv6 Node and SID for SR-MPLS sub-TLV" },
1596 { TUNNEL_SUBTLV_SEGMENT_LIST_SUB_TYPE_E
, "Type E IPv4 Node, index and SID sub-TLV" },
1597 { TUNNEL_SUBTLV_SEGMENT_LIST_SUB_TYPE_F
, "Type F IPv4 Local/Remote addresses and SID sub-TLV" },
1598 { TUNNEL_SUBTLV_SEGMENT_LIST_SUB_TYPE_G
, "Type G IPv6 Node, index for remote and local pair and SID for SR-MPLS sub-TLV" },
1599 { TUNNEL_SUBTLV_SEGMENT_LIST_SUB_TYPE_H
, "Type H IPv6 Local/Remote addresses and SID sub-TLV" },
1600 { TUNNEL_SUBTLV_SEGMENT_LIST_SUB_TYPE_WEIGHT
, "Weight sub-TLV" },
1601 { TUNNEL_SUBTLV_SEGMENT_LIST_SUB_TYPE_I
, "Type I IPv6 Node and SID for SRv6 sub-TLV" },
1602 { TUNNEL_SUBTLV_SEGMENT_LIST_SUB_TYPE_J
, "Type J IPv6 Node, index for remote and local pair and SID for SRv6 sub-TLV" },
1603 { TUNNEL_SUBTLV_SEGMENT_LIST_SUB_TYPE_K
, "Type K IPv6 Local/Remote addresses and SID for SRv6 sub-TLV" },
1607 static const true_false_string tfs_bgpext_com_type_auth
= {
1608 "Allocated on Standard Action, Early Allocation or Experimental Basis",
1609 "Allocated on First Come First Serve Basis"
1612 static const value_string bgpext_com_type_high
[] = {
1613 { BGP_EXT_COM_TYPE_HIGH_TR_AS2
, "Transitive 2-Octet AS-Specific" },
1614 { BGP_EXT_COM_TYPE_HIGH_TR_IP4
, "Transitive IPv4-Address-Specific" },
1615 { BGP_EXT_COM_TYPE_HIGH_TR_AS4
, "Transitive 4-Octet AS-Specific" },
1616 { BGP_EXT_COM_TYPE_HIGH_TR_OPAQUE
, "Transitive Opaque" },
1617 { BGP_EXT_COM_TYPE_HIGH_TR_QOS
, "Transitive QoS Marking" },
1618 { BGP_EXT_COM_TYPE_HIGH_TR_COS
, "Transitive CoS Capability" },
1619 { BGP_EXT_COM_TYPE_HIGH_TR_EVPN
, "Transitive EVPN" },
1620 { BGP_EXT_COM_TYPE_HIGH_TR_FLOW_I
, "FlowSpec Transitive" },
1621 { BGP_EXT_COM_TYPE_HIGH_TR_FLOW
, "Transitive Flow spec redirect/mirror to IP next-hop" },
1622 { BGP_EXT_COM_TYPE_HIGH_TR_FLOW_R
, "Transitive FlowSpec Redirect to indirection-id" },
1623 { BGP_EXT_COM_TYPE_HIGH_TR_TP_CLASS
, "Transitive Transport Class" },
1624 { BGP_EXT_COM_TYPE_HIGH_TR_SFC
, "Transitive SFC" },
1625 { BGP_EXT_COM_TYPE_HIGH_TR_MUP
, "Transitive MUP" },
1626 { BGP_EXT_COM_TYPE_HIGH_TR_EXT
, "Generic Transitive Extended Community"},
1627 { BGP_EXT_COM_TYPE_HIGH_TR_EXT_2
, "Generic Transitive Extended Community Part 2"},
1628 { BGP_EXT_COM_TYPE_HIGH_TR_EXT_3
, "Generic Transitive Extended Community Part 3 "},
1629 { BGP_EXT_COM_TYPE_HIGH_TR_EXP_EIGRP
, "Transitive Experimental EIGRP" },
1630 { BGP_EXT_COM_TYPE_HIGH_NTR_AS2
, "Non-Transitive 2-Octet AS-Specific" },
1631 { BGP_EXT_COM_TYPE_HIGH_NTR_IP4
, "Non-Transitive IPv4-Address-Specific" },
1632 { BGP_EXT_COM_TYPE_HIGH_NTR_AS4
, "Non-Transitive 4-Octet AS-Specific" },
1633 { BGP_EXT_COM_TYPE_HIGH_NTR_OPAQUE
, "Non-Transitive Opaque" },
1634 { BGP_EXT_COM_TYPE_HIGH_NTR_QOS
, "Non-Transitive QoS Marking" },
1635 { BGP_EXT_COM_TYPE_HIGH_NTR_FLOWSPEC
, "FlowSpec Non-Transitive Extended Communities" },
1636 { BGP_EXT_COM_TYPE_HIGH_NTR_TRANSPORT
, "Non-Transitive Transport Class" },
1640 static const value_string bgpext_com_stype_tr_exp_2
[] = {
1641 { BGP_EXT_COM_STYPE_EXP_2_FLOW_RED
, "Flow spec redirect IPv4 format"},
1645 static const value_string bgpext_com_stype_tr_exp_3
[] = {
1646 { BGP_EXT_COM_STYPE_EXP_3_SEC_GROUP
, "Security Group AS4"},
1647 { BGP_EXT_COM_STYPE_EXP_3_FLOW_RED
, "Flow spec redirect AS-4byte format"},
1648 { BGP_EXT_COM_STYPE_EXP_3_TAG4
, "Tag4"},
1649 { BGP_EXT_COM_STYPE_EXP_3_SUB_CLUS
, "Origin Sub-Cluster4"},
1653 static const value_string bgpext_com_stype_tr_evpn
[] = {
1654 { BGP_EXT_COM_STYPE_EVPN_MMAC
, "MAC Mobility" },
1655 { BGP_EXT_COM_STYPE_EVPN_LABEL
, "ESI MPLS Label" },
1656 { BGP_EXT_COM_STYPE_EVPN_IMP
, "ES Import" },
1657 { BGP_EXT_COM_STYPE_EVPN_ROUTERMAC
, "EVPN Router's MAC" },
1658 { BGP_EXT_COM_STYPE_EVPN_L2ATTR
, "Layer 2 Attributes" },
1659 { BGP_EXT_COM_STYPE_EVPN_ETREE
, "E-Tree" },
1660 { BGP_EXT_COM_STYPE_EVPN_DF
, "DF Election" },
1661 { BGP_EXT_COM_STYPE_EVPN_ISID
, "I-SID" },
1662 { BGP_EXT_COM_STYPE_EVPN_ND
, "ND" },
1663 { BGP_EXT_COM_STYPE_EVPN_MCFLAGS
, "Multicast Flags Extended Community" },
1664 { BGP_EXT_COM_STYPE_EVPN_EVIRT0
, "EVI-RT Type 0 Extended Community" },
1665 { BGP_EXT_COM_STYPE_EVPN_EVIRT1
, "EVI-RT Type 1 Extended Community" },
1666 { BGP_EXT_COM_STYPE_EVPN_EVIRT2
, "EVI-RT Type 2 Extended Community" },
1667 { BGP_EXT_COM_STYPE_EVPN_EVIRT3
, "EVI-RT Type 3 Extended Community" },
1668 { BGP_EXT_COM_STYPE_EVPN_ATTACHCIRT
, "EVPN Attachment Circuit" },
1669 { BGP_EXT_COM_STYPE_EVPN_SVC_CARV_TS
, "Service Carving Timestamp" },
1670 { BGP_EXT_COM_STYPE_EVPN_LINK_BW
, "EVPN Link Bandwidth Extended Community" },
1671 { BGP_EXT_COM_STYPE_EVPN_RT_EC
, "RT-derived-EC" },
1675 static const value_string bgpext_com_stype_tr_as2
[] = {
1676 { BGP_EXT_COM_STYPE_AS2_RT
, "Route Target" },
1677 { BGP_EXT_COM_STYPE_AS2_RO
, "Route Origin" },
1678 { BGP_EXT_COM_STYPE_AS2_LBW
, "Link Bandwidth" },
1679 { BGP_EXT_COM_STYPE_AS2_OSPF_DID
, "OSPF Domain Identifier" },
1680 { BGP_EXT_COM_STYPE_AS2_RT_AGG_P
, "Route Aggregation Parameter" },
1681 { BGP_EXT_COM_STYPE_AS2_DCOLL
, "BGP Data Collection" },
1682 { BGP_EXT_COM_STYPE_AS2_SRC_AS
, "Source AS" },
1683 { BGP_EXT_COM_STYPE_AS2_L2VPN
, "L2VPN Identifier" },
1684 { BGP_EXT_COM_STYPE_AS2_CVPND
, "Cisco VPN-Distinguisher" },
1685 { BGP_EXT_COM_STYPE_AS2_RT_REC
, "Route Target Record" },
1686 { BGP_EXT_COM_STYPE_AS2_RT_EC
, "RT-derived-EC" },
1687 { BGP_EXT_COM_STYPE_AS2_VNI
, "Virtual-Network Identifier" },
1691 static const value_string bgpext_com_stype_ntr_as2
[] = {
1692 { BGP_EXT_COM_STYPE_AS2_LBW
, "Link Bandwidth" },
1693 { BGP_EXT_COM_STYPE_AS2_VNI
, "Virtual-Network Identifier" },
1697 static const value_string bgpext_com_stype_tr_as4
[] = {
1698 { BGP_EXT_COM_STYPE_AS4_RT
, "Route Target" },
1699 { BGP_EXT_COM_STYPE_AS4_RO
, "Route Origin" },
1700 { BGP_EXT_COM_STYPE_AS4_GEN
, "Generic" },
1701 { BGP_EXT_COM_STYPE_AS4_BGP_DC
, "BGP Data Collection"},
1702 { BGP_EXT_COM_STYPE_AS4_OSPF_DID
, "OSPF Domain Identifier" },
1703 { BGP_EXT_COM_STYPE_AS4_S_AS
, "Source AS" },
1704 { BGP_EXT_COM_STYPE_AS4_CIS_V
, "Cisco VPN Identifier" },
1705 { BGP_EXT_COM_STYPE_AS4_RT_REC
, "Route-Target Record"},
1706 { BGP_EXT_COM_STYPE_AS4_RT_EC
, "RT-derived-EC" },
1710 static const value_string bgpext_com_stype_ntr_as4
[] = {
1711 { BGP_EXT_COM_STYPE_AS4_GEN
, "Generic" },
1715 static const value_string bgpext_com_stype_tr_IP4
[] = {
1716 { BGP_EXT_COM_STYPE_IP4_RT
, "Route Target" },
1717 { BGP_EXT_COM_STYPE_IP4_RO
, "Route Origin" },
1718 { BGP_EXT_COM_STYPE_IP4_IFIT_TAIL
,"IPv4-Address-Specific IFIT Tail Community" },
1719 { BGP_EXT_COM_STYPE_IP4_OSPF_DID
, "OSPF Domain Identifier" },
1720 { BGP_EXT_COM_STYPE_IP4_OSPF_RID
, "OSPF Router ID" },
1721 { BGP_EXT_COM_STYPE_IP4_NODE_TGT
, "Node Target Extended Community" },
1722 { BGP_EXT_COM_STYPE_IP4_L2VPN
, "L2VPN Identifier" },
1723 { BGP_EXT_COM_STYPE_IP4_VRF_I
, "VRF Route Import" },
1724 { BGP_EXT_COM_STYPE_IP4_FLOW_RDR
, "Flow-spec Redirect to IPv4" },
1725 { BGP_EXT_COM_STYPE_IP4_CIS_D
, "Cisco VPN-Distinguisher" },
1726 { BGP_EXT_COM_STYPE_IP4_SEG_NH
, "Inter-area P2MP Segmented Next-Hop" },
1727 { BGP_EXT_COM_STYPE_IP4_RT_REC
, "Route-Target Record" },
1728 { BGP_EXT_COM_STYPE_IP4_VRF_RNH
, "VRF-Recursive-Next-Hop-Extended-Community" },
1729 { BGP_EXT_COM_STYPE_IP4_RT_EC
, "RT-derived-EC" },
1730 { BGP_EXT_COM_STYPE_IP4_MVPN_RP
, "MVPN SA RP-address Extended Community" },
1734 static const value_string bgpext_com_stype_ntr_IP4
[] = {
1735 { BGP_EXT_COM_STYPE_IP4_NODE_TGT
, "Node Target Extended Community" },
1739 static const value_string bgpext_com_stype_tr_opaque
[] = {
1740 { BGP_EXT_COM_STYPE_OPA_COST
, "Cost" },
1741 { BGP_EXT_COM_STYPE_OPA_CP_OSPF
, "CP-ORF" },
1742 { BGP_EXT_COM_STYPE_OPA_EXTN_SRC
, "Extranet Source Extended Community" },
1743 { BGP_EXT_COM_STYPE_OPA_EXTN_SEP
, "Extranet Separation Extended Community" },
1744 { BGP_EXT_COM_STYPE_OPA_OSPF_RT
, "OSPF Route Type" },
1745 { BGP_EXT_COM_STYPE_OPA_PMSI_ATTR
, "Additional PMSI Tunnel Attribute Flags" },
1746 { BGP_EXT_COM_STYPE_OPA_CTX_LBL
, "Context-Specific Label Space ID Extended Community" },
1747 { BGP_EXT_COM_STYPE_OPA_COLOR
, "Color" },
1748 { BGP_EXT_COM_STYPE_OPA_ENCAP
, "Encapsulation" },
1749 { BGP_EXT_COM_STYPE_OPA_DGTW
, "Default Gateway" },
1750 { BGP_EXT_COM_STYPE_OPA_PPMP_LBL
, "Point-to-Point-to-Multipoint (PPMP) Label" },
1751 { BGP_EXT_COM_STYPE_OPA_GRP_TAG
, "BGP Group Policy Class Tag Extended Community" },
1752 { BGP_EXT_COM_STYPE_OPA_HSH_SRT
, "Consistent Hash Sort Order" },
1753 { BGP_EXT_COM_STYPE_OPA_GRP_PID
, "Group Policy ID Extended Community" },
1754 { BGP_EXT_COM_STYPE_OPA_LCM
, "Local Color Mapping (LCM)" },
1755 { BGP_EXT_COM_STYPE_OPA_LOADBAL
, "LoadBalance" },
1759 static const value_string bgpext_com_cost_poi_type
[] = {
1760 { BGP_EXT_COM_COST_POI_ORIGIN
, "\"Lowest Origin code\" step" },
1761 { BGP_EXT_COM_COST_POI_ASPATH
, "\"Shortest AS_PATH\" step" },
1762 { BGP_EXT_COM_COST_POI_MED
, "\"Lowest MED\" step" },
1763 { BGP_EXT_COM_COST_POI_LP
, "\"Highest Local Preference\" step" },
1764 { BGP_EXT_COM_COST_POI_AIGP
, "\"Lowest Accumulated IGP Cost\" step" },
1765 { BGP_EXT_COM_COST_POI_ABS
, "Before BGP Best Path algorithm" },
1766 { BGP_EXT_COM_COST_POI_IGP
, "\"Smallest IGP Metric\" step" },
1767 { BGP_EXT_COM_COST_POI_EI
, "\"Prefer eBGP to iBGP\" step" },
1768 { BGP_EXT_COM_COST_POI_RID
, "\"Smallest BGP RID\" step" },
1772 static const value_string bgpext_com_tunnel_type
[] = {
1773 { BGP_EXT_COM_TUNNEL_RESERVED
, "Reserved" },
1774 { BGP_EXT_COM_TUNNEL_L2TPV3
, "L2TPv3 over IP" },
1775 { BGP_EXT_COM_TUNNEL_GRE
, "GRE" },
1776 { BGP_EXT_COM_TUNNEL_ENDP
, "Transmit tunnel endpoint" },
1777 { BGP_EXT_COM_TUNNEL_IPSEC
, "IPsec in Tunnel-mode" },
1778 { BGP_EXT_COM_TUNNEL_IPIPSEC
, "IP in IP tunnel with IPsec Transport Mode" },
1779 { BGP_EXT_COM_TUNNEL_MPLSIP
, "MPLS-in-IP tunnel with IPsec Transport Mode" },
1780 { BGP_EXT_COM_TUNNEL_IPIP
, "IP in IP" },
1781 { BGP_EXT_COM_TUNNEL_VXLAN
, "VXLAN Encapsulation" },
1782 { BGP_EXT_COM_TUNNEL_NVGRE
, "NVGRE Encapsulation" },
1783 { BGP_EXT_COM_TUNNEL_MPLS
, "MPLS Encapsulation" },
1784 { BGP_EXT_COM_TUNNEL_MPLSGRE
, "MPLS in GRE Encapsulation" },
1785 { BGP_EXT_COM_TUNNEL_VXLANGPE
, "VxLAN GPE Encapsulation" },
1786 { BGP_EXT_COM_TUNNEL_MPLSUDP
, "MPLS in UDP Encapsulation" },
1787 { BGP_EXT_COM_TUNNEL_IPV6_TUNNEL
, "IPv6 Tunnel" },
1788 { BGP_EXT_COM_TUNNEL_SE_TE_POLICY
, "SR TE Policy Type" },
1789 { BGP_EXT_COM_TUNNEL_BARE
, "Bare" },
1790 { BGP_EXT_COM_TUNNEL_SR_TUNNEL
, "SR Tunnel" },
1791 { BGP_EXT_COM_TUNNEL_CLOUD_SEC
, "Cloud Security" },
1792 { BGP_EXT_COM_TUNNEL_GENEVE_ENCAP
, "Geneve Encapsulation" },
1793 { BGP_EXT_COM_TUNNEL_ANY_ENCAP
, "Any Encapsulation" },
1794 { BGP_EXT_COM_TUNNEL_GTP_TUNNEL
, "GTP Tunnel Type" },
1795 { BGP_EXT_COM_TUNNEL_DPS_TUNNEL
, "Dynamic Path Selection (DPS) Tunnel Encapsulation" },
1796 { BGP_EXT_COM_TUNNEL_OPE
, "Originating PE (OPE)" },
1797 { BGP_EXT_COM_TUNNEL_DYN_DPS_POL
, "Dynamic Path Selection (DPS) Policy" },
1798 { BGP_EXT_COM_TUNNEL_SDWAN_HYB
, "SDWAN-Hybrid" },
1799 { BGP_EXT_COM_TUNNEL_X_OVER_UDP
, "X-over-UDP" },
1800 { BGP_EXT_COM_TUNNEL_DES_ENCAP
, "Distributed Etherlink Switch (DES) Tunnel Encapsulation" },
1804 static const value_string bgpext_com_stype_ntr_opaque
[] = {
1805 { BGP_EXT_COM_STYPE_OPA_OR_VAL_ST
, "BGP Origin Validation state" },
1806 { BGP_EXT_COM_STYPE_OPA_COST
, "Cost Community" },
1807 { BGP_EXT_COM_STYPE_OPA_RT
, "Route Target" },
1808 { BGP_EXT_COM_STYPE_OPA_RT_EC
, "RT-derived-EC" },
1812 static const value_string bgpext_com_stype_tr_exp
[] = {
1813 { BGP_EXT_COM_STYPE_EXP_OSPF_RT
, "OSPF Route Type" },
1814 { BGP_EXT_COM_STYPE_EXP_OSPF_RID
, "OSPF Router ID" },
1815 { BGP_EXT_COM_STYPE_EXP_SEC_GROUP
, "Security Group" },
1816 { BGP_EXT_COM_STYPE_EXP_OSPF_DID
, "OSPF Domain Identifier" },
1817 { BGP_EXT_COM_STYPE_EXP_F_TR
, "Flow spec traffic-rate" },
1818 { BGP_EXT_COM_STYPE_EXP_F_TA
, "Flow spec traffic-action" },
1819 { BGP_EXT_COM_STYPE_EXP_F_RED
, "Flow spec redirect AS 2 bytes" },
1820 { BGP_EXT_COM_STYPE_EXP_F_RMARK
, "Flow spec traffic-remarking" },
1821 { BGP_EXT_COM_STYPE_EXP_L2
, "Layer2 Info" },
1822 { BGP_EXT_COM_STYPE_EXP_ETREE
, "E-Tree Info" },
1823 { BGP_EXT_COM_STYPE_EXP_FLOW_RATE
, "Flow spec traffic-rate-packets" },
1824 { BGP_EXT_COM_STYPE_EXP_FLOW_SFC
, "Flow Specification for SFC Classifiers" },
1825 { BGP_EXT_COM_STYPE_EXP_TAG
, "Tag" },
1826 { BGP_EXT_COM_STYPE_EXP_SUB_CLUS
, "Origin Sub-Cluster" },
1830 static const value_string bgpext_com_stype_tr_eigrp
[] = {
1831 { BGP_EXT_COM_STYPE_EXP_EIGRP_FT
, "EIGRP Route Flags, Route Tag" },
1832 { BGP_EXT_COM_STYPE_EXP_EIGRP_AD
, "EIGRP AS Number, Delay" },
1833 { BGP_EXT_COM_STYPE_EXP_EIGRP_RHB
, "EIGRP Reliability, Hop Count, Bandwidth" },
1834 { BGP_EXT_COM_STYPE_EXP_EIGRP_LM
, "EIGRP Load, MTU" },
1835 { BGP_EXT_COM_STYPE_EXP_EIGRP_EAR
, "EIGRP External AS Number, Router ID" },
1836 { BGP_EXT_COM_STYPE_EXP_EIGRP_EPM
, "EIGRP External Protocol, Metric" },
1837 { BGP_EXT_COM_STYPE_EXP_EIGRP_RID
, "EIGRP Originating Router ID" },
1841 static const value_string bgpext_com_stype_tr_mup
[] = {
1842 { BGP_EXT_COM_STYPE_MUP_DIRECT_SEG
, "MUP Direct-Type Segment Identifier"},
1846 static const value_string flow_spec_op_len_val
[] = {
1847 { 0, "1 byte: 1 <<" },
1848 { 1, "2 bytes: 1 <<" },
1849 { 2, "4 bytes: 1 <<" },
1850 { 3, "8 bytes: 1 <<" },
1854 static const value_string qos_tech_type
[] = {
1855 { QOS_TECH_TYPE_DSCP
, "DiffServ enabled IP (DSCP encoding)" },
1856 { QOS_TECH_TYPE_802_1q
, "Ethernet using 802.1q priority tag" },
1857 { QOS_TECH_TYPE_E_LSP
, "MPLS using E-LSP" },
1858 { QOS_TECH_TYPE_VC
, "Virtual Channel (VC) encoding" },
1859 { QOS_TECH_TYPE_GMPLS_TIME
, "GMPLS - time slot encoding" },
1860 { QOS_TECH_TYPE_GMPLS_LAMBDA
, "GMPLS - lambda encoding" },
1861 { QOS_TECH_TYPE_GMPLS_FIBRE
, "GMPLS - fibre encoding" },
1865 static const value_string bgp_ssa_type
[] = {
1866 { BGP_SSA_L2TPv3
, "L2TPv3 Tunnel" },
1867 { BGP_SSA_mGRE
, "mGRE Tunnel" },
1868 { BGP_SSA_IPSec
, "IPSec Tunnel" },
1869 { BGP_SSA_MPLS
, "MPLS Tunnel" },
1870 { BGP_SSA_L2TPv3_IN_IPSec
, "L2TPv3 in IPSec Tunnel" },
1871 { BGP_SSA_mGRE_IN_IPSec
, "mGRE in IPSec Tunnel" },
1876 * BGP Layer 2 Encapsulation Types
1880 * http://www.iana.org/assignments/bgp-parameters/bgp-parameters.xhtml#bgp-l2-encapsulation-types-registry
1882 static const value_string bgp_l2vpn_encaps
[] = {
1884 { 1, "Frame Relay"},
1885 { 2, "ATM AAL5 SDU VCC transport"},
1886 { 3, "ATM transparent cell transport"},
1887 { 4, "Ethernet (VLAN) Tagged mode"},
1888 { 5, "Ethernet raw mode"},
1891 { 8, "SONET/SDH CES"},
1892 { 9, "ATM n-to-one VCC cell transport"},
1893 { 10, "ATM n-to-one VPC cell transport"},
1894 { 11, "IP layer 2 transport"},
1895 { 15, "Frame relay port mode"},
1896 { 17, "Structure agnostic E1 over packet"},
1897 { 18, "Structure agnostic T1 over packet"},
1899 { 20, "Structure agnostic T3 over packet"},
1900 { 21, "Nx64kbit/s Basic Service using Structure-aware"},
1901 { 25, "Frame Relay DLCI"},
1902 { 40, "Structure agnostic E3 over packet"},
1903 { 41, "Octet-aligned playload for structure-agnostic DS1 circuits"},
1904 { 42, "E1 Nx64kbit/s with CAS using Structure-aware"},
1905 { 43, "DS1 (ESF) Nx64kbit/s with CAS using Structure-aware"},
1906 { 44, "DS1 (SF) Nx64kbit/s with CAS using Structure-aware"},
1907 { 64, "IP-interworking"},
1911 static const value_string bgpext_com_ospf_rtype
[] = {
1912 { BGP_OSPF_RTYPE_RTR
, "Router" },
1913 { BGP_OSPF_RTYPE_NET
, "Network" },
1914 { BGP_OSPF_RTYPE_SUM
, "Summary" },
1915 { BGP_OSPF_RTYPE_EXT
, "External" },
1916 { BGP_OSPF_RTYPE_NSSA
,"NSSA External" },
1917 { BGP_OSPF_RTYPE_SHAM
,"MPLS-VPN Sham" },
1921 /* Subsequent address family identifier, RFC4760 */
1922 static const value_string bgpattr_nlri_safi
[] = {
1924 { SAFNUM_UNICAST
, "Unicast" },
1925 { SAFNUM_MULCAST
, "Multicast" },
1926 { SAFNUM_UNIMULC
, "Unicast+Multicast (Deprecated)" },
1927 { SAFNUM_MPLS_LABEL
, "Labeled Unicast" },
1928 { SAFNUM_MCAST_VPN
, "MCAST-VPN" },
1929 { SAFNUM_MULTISEG_PW
, "Multi-Segment Pseudowires" },
1930 { SAFNUM_ENCAPSULATION
, "Encapsulation (Deprecated)" },
1931 { SAFNUM_MCAST_VPLS
, "MCAST-VPLS" },
1932 { SAFNUM_TUNNEL
, "Tunnel (Deprecated)" },
1933 { SAFNUM_VPLS
, "VPLS" },
1934 { SAFNUM_MDT
, "Cisco MDT" },
1935 { SAFNUM_4OVER6
, "4over6" },
1936 { SAFNUM_6OVER4
, "6over4" },
1937 { SAFNUM_L1VPN
, "Layer-1 VPN" },
1938 { SAFNUM_EVPN
, "EVPN" },
1939 { SAFNUM_BGP_LS
, "BGP-LS" },
1940 { SAFNUM_BGP_LS_VPN
, "BGP-LS-VPN" },
1941 { SAFNUM_SR_POLICY
, "SR Policy" },
1942 { SAFNUM_SD_WAN
, "SD-WAN" },
1943 { SAFNUM_RPD
, "Routing Policy Distribution" },
1944 { SAFNUM_CT
, "Classful Transport Planes" },
1945 { SAFNUM_FLOWSPEC
, "Tunneled Traffic Flowspec" },
1946 { SAFNUM_MCAST_TREE
, "MCAST-TREE" },
1947 { SAFNUM_BGP_DPS
, "Dynamic Path Selection" },
1948 { SAFNUM_BGP_LS_SPF
, "BGP-LS-SPF" },
1949 { SAFNUM_BGP_CAR
, "BGP-CAR" },
1950 { SAFNUM_BGP_VPN_CAR
, "BGP-VPN-CAR" },
1951 { SAFNUM_BGP_MUP
, "BGP-MUP" },
1952 { SAFNUM_LAB_VPNUNICAST
, "Labeled VPN Unicast" },
1953 { SAFNUM_LAB_VPNMULCAST
, "Labeled VPN Multicast" },
1954 { SAFNUM_LAB_VPNUNIMULC
, "Labeled VPN Unicast+Multicast (Deprecated)" },
1955 { SAFNUM_ROUTE_TARGET
, "Route Target Filter" },
1956 { SAFNUM_FSPEC_RULE
, "Flow Spec Filter" },
1957 { SAFNUM_FSPEC_VPN_RULE
, "Flow Spec Filter VPN" },
1958 { SAFNUM_L3VPN
, "Layer-3 VPN (Deprecated)" },
1962 /* ORF Type, RFC5291 */
1963 static const value_string orf_type_vals
[] = {
1964 { 2, "Communities ORF-Type" },
1965 { 3, "Extended Communities ORF-Type" },
1966 { 128, "Cisco PrefixList ORF-Type" },
1967 { 129, "Cisco CommunityList ORF-Type" },
1968 { 130, "Cisco Extended CommunityList ORF-Type" },
1969 { 131, "Cisco AsPathList ORF-Type" },
1973 /* ORF Send/Receive, RFC5291 */
1974 static const value_string orf_send_recv_vals
[] = {
1981 /* ORF Send/Receive, RFC5291 */
1982 static const value_string orf_when_vals
[] = {
1988 static const value_string orf_entry_action_vals
[] = {
1989 { BGP_ORF_ADD
, "Add" },
1990 { BGP_ORF_REMOVE
, "Remove" },
1991 { BGP_ORF_REMOVEALL
, "RemoveAll" },
1995 static const value_string orf_entry_match_vals
[] = {
1996 { BGP_ORF_PERMIT
, "Permit" },
1997 { BGP_ORF_DENY
, "Deny" },
2001 /* BGPsec Send/Receive, RFC8205 */
2002 static const value_string bgpsec_send_receive_vals
[] = {
2008 /* BGP Role, RFC9234 */
2009 static const value_string bgprole_vals
[] = {
2018 static const value_string capability_vals
[] = {
2019 { BGP_CAPABILITY_RESERVED
, "Reserved capability" },
2020 { BGP_CAPABILITY_MULTIPROTOCOL
, "Multiprotocol extensions capability" },
2021 { BGP_CAPABILITY_ROUTE_REFRESH
, "Route refresh capability" },
2022 { BGP_CAPABILITY_COOPERATIVE_ROUTE_FILTERING
, "Cooperative route filtering capability" },
2023 { BGP_CAPABILITY_MULTIPLE_ROUTE_DEST
, "Multiple routes to a destination capability" },
2024 { BGP_CAPABILITY_EXTENDED_NEXT_HOP
, "Extended Next Hop Encoding" },
2025 { BGP_CAPABILITY_EXTENDED_MESSAGE
, "BGP-Extended Message" },
2026 { BGP_CAPABILITY_BGPSEC
, "BGPsec capability" },
2027 { BGP_CAPABILITY_MULTIPLE_LABELS
, "Multiple Labels capability" },
2028 { BGP_CAPABILITY_BGP_ROLE
, "BGP Role" },
2029 { BGP_CAPABILITY_GRACEFUL_RESTART
, "Graceful Restart capability" },
2030 { BGP_CAPABILITY_4_OCTET_AS_NUMBER
, "Support for 4-octet AS number capability" },
2031 { BGP_CAPABILITY_DYNAMIC_CAPABILITY_CISCO
, "Deprecated Dynamic Capability (Cisco)" },
2032 { BGP_CAPABILITY_DYNAMIC_CAPABILITY
, "Support for Dynamic capability" },
2033 { BGP_CAPABILITY_MULTISESSION
, "Multisession BGP Capability" },
2034 { BGP_CAPABILITY_ADDITIONAL_PATHS
, "Support for Additional Paths" },
2035 { BGP_CAPABILITY_ENHANCED_ROUTE_REFRESH
, "Enhanced route refresh capability" },
2036 { BGP_CAPABILITY_LONG_LIVED_GRACEFUL_RESTART
, "Long-Lived Graceful Restart (LLGR) Capability" },
2037 { BGP_CAPABILITY_CP_ORF
, "CP-ORF Capability" },
2038 { BGP_CAPABILITY_FQDN
, "FQDN Capability" },
2039 { BGP_CAPABILITY_BFD_STRICT
, "BFD Strict-Mode capability" },
2040 { BGP_CAPABILITY_SOFT_VERSION
, "Software Version Capability" },
2041 { BGP_CAPABILITY_PATHS_LIMIT
, "PATHS-LIMIT Capability" },
2042 { BGP_CAPABILITY_ROUTE_REFRESH_CISCO
, "Route Refresh Capability (Cisco)" },
2043 { BGP_CAPABILITY_RPD_CISCO
, "Routing Policy Distribution (Cisco)" },
2044 { BGP_CAPABILITY_ORF_CISCO
, "Outbound Route Filtering (Cisco)" },
2045 { BGP_CAPABILITY_MULTISESSION_CISCO
, "Multisession (Cisco)" },
2046 { BGP_CAPABILITY_FQDN_CISCO
, "FQDN (Cisco)" },
2047 { BGP_CAPABILITY_OPERATIONAL_MSG_CISCO
, "OPERATIONAL message (Cisco)" },
2051 static const value_string community_vals
[] = {
2052 { BGP_COMM_GRACEFUL_SHUTDOWN
, "GRACEFUL_SHUTDOWN" },
2053 { BGP_COMM_ACCEPT_OWN
, "ACCEPT_OWN" },
2054 { BGP_COMM_RT_FLTR_XLTD_V4
, "ROUTE_FILTER_TRANSLATED_v4" },
2055 { BGP_COMM_RT_FLTR_V4
, "ROUTE_FILTER_v4" },
2056 { BGP_COMM_RT_FLTR_XLTD_V6
, "ROUTE_FILTER_TRANSLATED_v6" },
2057 { BGP_COMM_RT_FLTR_V6
, "ROUTE_FILTER_v6" },
2058 { BGP_COMM_LLGR_STALE
, "LLGR_STALE" },
2059 { BGP_COMM_NO_LLGR
, "NO_LLGR" },
2060 { BGP_COMM_ACCEPT_OWN_HOP
, "accept-own-nexthop" },
2061 { BGP_COMM_STANDBY_PE
, "Standby PE" },
2062 { BGP_COMM_BLACKHOLE
, "BLACKHOLE" },
2063 { BGP_COMM_NO_EXPORT
, "NO_EXPORT" },
2064 { BGP_COMM_NO_ADVERTISE
, "NO_ADVERTISE" },
2065 { BGP_COMM_NO_EXPORT_SUBCONFED
, "NO_EXPORT_SUBCONFED" },
2066 { BGP_COMM_NOPEER
, "NOPEER" },
2070 /* Capability Message action code */
2071 static const value_string bgpcap_action
[] = {
2072 { 0, "advertising a capability" },
2073 { 1, "removing a capability" },
2077 static const value_string mcast_vpn_route_type
[] = {
2078 { MCAST_VPN_RTYPE_INTRA_AS_IPMSI_AD
, "Intra-AS I-PMSI A-D route" },
2079 { MCAST_VPN_RTYPE_INTER_AS_IPMSI_AD
, "Inter-AS I-PMSI A-D route" },
2080 { MCAST_VPN_RTYPE_SPMSI_AD
, "S-PMSI A-D route" },
2081 { MCAST_VPN_RTYPE_LEAF_AD
, "Leaf A-D route" },
2082 { MCAST_VPN_RTYPE_SOURCE_ACTIVE_AD
, "Source Active A-D route" },
2083 { MCAST_VPN_RTYPE_SHARED_TREE_JOIN
, "Shared Tree Join route" },
2084 { MCAST_VPN_RTYPE_SOURCE_TREE_JOIN
, "Source Tree Join route" },
2088 /* NLRI type value_string as defined in idr-ls */
2089 static const value_string bgp_ls_nlri_type_vals
[] = {
2090 { LINK_STATE_LINK_NLRI
, "Link NLRI" },
2091 { LINK_STATE_NODE_NLRI
, "Node NLRI" },
2092 { LINK_STATE_IPV4_TOPOLOGY_PREFIX_NLRI
, "IPv4 Topology Prefix NLRI" },
2093 { LINK_STATE_IPV6_TOPOLOGY_PREFIX_NLRI
, "IPv6 Topology Prefix NLRI" },
2094 { LINK_STATE_SRV6_SID_NLRI
, "SRv6 SID NLRI" },
2098 /* Link-State NLRI Protocol-ID value strings */
2099 static const value_string link_state_nlri_protocol_id_values
[] = {
2100 {BGP_LS_NLRI_PROTO_ID_UNKNOWN
, "Unknown" },
2101 {BGP_LS_NLRI_PROTO_ID_IS_IS_LEVEL_1
, "IS-IS Level 1"},
2102 {BGP_LS_NLRI_PROTO_ID_IS_IS_LEVEL_2
, "IS-IS Level 2"},
2103 {BGP_LS_NLRI_PROTO_ID_OSPF_V2
, "OSPFv2"},
2104 {BGP_LS_NLRI_PROTO_ID_DIRECT
, "Direct"},
2105 {BGP_LS_NLRI_PROTO_ID_STATIC
, "Static"},
2106 {BGP_LS_NLRI_PROTO_ID_OSPF_V3
, "OSPFv3"},
2107 {BGP_LS_NLRI_PROTO_ID_BGP
, "BGP"},
2108 {BGP_LS_NLRI_PROTO_ID_RSVP_TE
, "RSVP-TE" },
2109 {BGP_LS_NLRI_PROTO_ID_SEGMENT_ROUTING
, "Segment Routing" },
2113 /* Link-State routing universes */
2114 static const val64_string link_state_nlri_routing_universe_values
[] = {
2115 {BGP_LS_NLRI_ROUTING_UNIVERSE_LEVEL_3
, "L3 packet topology" },
2116 {BGP_LS_NLRI_ROUTING_UNIVERSE_LEVEL_1
, "L1 optical topology"},
2120 /* Link state prefix NLRI OSPF Route Type */
2121 static const value_string link_state_prefix_descriptors_ospf_route_type
[] = {
2122 {BGP_LS_PREFIX_OSPF_ROUTE_TYPE_UNKNOWN
, "Unknown" },
2123 {BGP_LS_PREFIX_OSPF_ROUTE_TYPE_INTRA_AREA
, "Intra-Area"},
2124 {BGP_LS_PREFIX_OSPF_ROUTE_TYPE_INTER_AREA
, "Inter Area"},
2125 {BGP_LS_PREFIX_OSPF_ROUTE_TYPE_EXTERNAL_1
, "External 1"},
2126 {BGP_LS_PREFIX_OSPF_ROUTE_TYPE_EXTERNAL_2
, "External 2"},
2127 {BGP_LS_PREFIX_OSPF_ROUTE_TYPE_NSSA_1
, "NSSA 1"},
2128 {BGP_LS_PREFIX_OSPF_ROUTE_TYPE_NSSA_2
, "NSSA 2"},
2132 /* Link state Flex Algo Metric Type: draft-ietf-lsr-flex-algo-17 */
2133 static const value_string flex_algo_metric_types
[] = {
2135 { 1, "Min Unidirectional Link Delay"},
2140 /* Link state IGP Algorithm Type: https://www.iana.org/assignments/igp-parameters/igp-parameters.xhtml */
2141 static const value_string igp_algo_types
[] = {
2142 { 0, "Shortest Path First (SPF)" },
2143 { 1, "Strict Shortest Path First (Strict SPF)" },
2147 /* Link state IGP MSD Type: https://www.iana.org/assignments/igp-parameters/igp-parameters.xhtml */
2148 static const value_string igp_msd_types
[] = {
2150 { 1, "Base MPLS Imposition MSD" },
2152 { 41, "SRH Max SL" },
2153 { 42, "SRH Max End Pop" },
2154 { 44, "SRH Max H.Encaps" },
2155 { 45, "SRH Max End D" },
2159 /* NLRI type value_string as define in BGP flow spec RFC */
2161 static const value_string flowspec_nlri_opvaluepair_type
[] = {
2162 { BGPNLRI_FSPEC_DST_PFIX
, "Destination prefix filter" },
2163 { BGPNLRI_FSPEC_SRC_PFIX
, "Source prefix filter" },
2164 { BGPNLRI_FSPEC_IP_PROTO
, "Protocol / Next Header filter" },
2165 { BGPNLRI_FSPEC_PORT
, "Port filter" },
2166 { BGPNLRI_FSPEC_DST_PORT
, "Destination port filter" },
2167 { BGPNLRI_FSPEC_SRC_PORT
, "Source port filter" },
2168 { BGPNLRI_FSPEC_ICMP_TP
, "ICMP type filter" },
2169 { BGPNLRI_FSPEC_ICMP_CD
, "ICMP code filter" },
2170 { BGPNLRI_FSPEC_TCP_FLAGS
,"TCP flags filter" },
2171 { BGPNLRI_FSPEC_PCK_LEN
, "Packet Length filter" },
2172 { BGPNLRI_FSPEC_DSCP
, "DSCP marking filter" },
2173 { BGPNLRI_FSPEC_FRAGMENT
, "IP fragment filter" },
2177 /* Subtype Route Refresh, draft-ietf-idr-bgp-enhanced-route-refresh-02 */
2178 static const value_string route_refresh_subtype_vals
[] = {
2179 { 0, "Normal route refresh request [RFC2918] with/without ORF [RFC5291]" },
2180 { 1, "Demarcation of the beginning of a route refresh" },
2181 { 2, "Demarcation of the ending of a route refresh" },
2185 static const value_string bgp_prefix_sid_type
[] = {
2186 { BGP_PREFIX_SID_TLV_LABEL_INDEX
, "Label-Index" },
2187 { BGP_PREFIX_SID_TLV_2
, "Deprecated" },
2188 { BGP_PREFIX_SID_TLV_ORIGINATOR_SRGB
, "Originator SRGB" },
2189 { BGP_PREFIX_SID_TLV_4
, "Deprecated" },
2190 { BGP_PREFIX_SID_TLV_SRV6_L3_SERVICE
, "SRv6 L3 Service" },
2191 { BGP_PREFIX_SID_TLV_SRV6_L2_SERVICE
, "SRv6 L2 Service" },
2195 static const value_string srv6_service_sub_tlv_type
[] = {
2196 { SRV6_SERVICE_SRV6_SID_INFORMATION
, "SRv6 SID Information" },
2200 static const value_string srv6_service_data_sub_sub_tlv_type
[] = {
2201 { SRV6_SERVICE_DATA_SRV6_SID_STRUCTURE
, "SRv6 SID Structure" },
2205 /* SRv6 Endpoint behavior value_string [RFC 8986]. */
2206 static const value_string srv6_endpoint_behavior
[] = {
2207 { SRV6_ENDPOINT_BEHAVIOR_END
, "End" },
2208 { SRV6_ENDPOINT_BEHAVIOR_END_PSP
, "End with PSP" },
2209 { SRV6_ENDPOINT_BEHAVIOR_END_USP
, "End with USP" },
2210 { SRV6_ENDPOINT_BEHAVIOR_END_PSP_USP
, "End with PSP & USP" },
2211 { SRV6_ENDPOINT_BEHAVIOR_END_X
, "End.X" },
2212 { SRV6_ENDPOINT_BEHAVIOR_END_X_PSP
, "End.X with PSP" },
2213 { SRV6_ENDPOINT_BEHAVIOR_END_X_USP
, "End.X with USP" },
2214 { SRV6_ENDPOINT_BEHAVIOR_END_X_PSP_USP
, "End.X with PSP & USP" },
2215 { SRV6_ENDPOINT_BEHAVIOR_END_T
, "End.T" },
2216 { SRV6_ENDPOINT_BEHAVIOR_END_T_PSP
, "End.T with PSP" },
2217 { SRV6_ENDPOINT_BEHAVIOR_END_T_USP
, "End.T with USP" },
2218 { SRV6_ENDPOINT_BEHAVIOR_END_T_PSP_USP
, "End.T with PSP & USP" },
2219 { SRV6_ENDPOINT_BEHAVIOR_END_B6_INSERT
, "End.B6.Insert" },
2220 { SRV6_ENDPOINT_BEHAVIOR_END_B6_ENCAPS
, "End.B6.Encaps" },
2221 { SRV6_ENDPOINT_BEHAVIOR_END_BM
, "End.BM" },
2222 { SRV6_ENDPOINT_BEHAVIOR_END_DX6
, "End.DX6" },
2223 { SRV6_ENDPOINT_BEHAVIOR_END_DX4
, "End.DX4" },
2224 { SRV6_ENDPOINT_BEHAVIOR_END_DT6
, "End.DT6" },
2225 { SRV6_ENDPOINT_BEHAVIOR_END_DT4
, "End.DT4" },
2226 { SRV6_ENDPOINT_BEHAVIOR_END_DT46
, "End.DT46" },
2227 { SRV6_ENDPOINT_BEHAVIOR_END_DX2
, "End.DX2" },
2228 { SRV6_ENDPOINT_BEHAVIOR_END_DX2V
, "End.DX2V" },
2229 { SRV6_ENDPOINT_BEHAVIOR_END_DT2U
, "End.DT2U" },
2230 { SRV6_ENDPOINT_BEHAVIOR_END_DT2M
, "End.DT2M" },
2231 { SRV6_ENDPOINT_BEHAVIOR_END_B6_INSERT_RED
, "End.B6.Insert.Red" },
2232 { SRV6_ENDPOINT_BEHAVIOR_END_B6_ENCAPS_RED
, "End.B6.Encaps.Red" },
2233 { SRV6_ENDPOINT_BEHAVIOR_END_USD
, "End with USD" },
2234 { SRV6_ENDPOINT_BEHAVIOR_END_PSP_USD
, "End with PSP & USD" },
2235 { SRV6_ENDPOINT_BEHAVIOR_END_USP_USD
, "End with USP & USD" },
2236 { SRV6_ENDPOINT_BEHAVIOR_END_PSP_USP_USD
, "End with PSP, USP & USD" },
2237 { SRV6_ENDPOINT_BEHAVIOR_END_X_USD
, "End.X with USD" },
2238 { SRV6_ENDPOINT_BEHAVIOR_END_X_PSP_USD
, "End.X with PSP & USD" },
2239 { SRV6_ENDPOINT_BEHAVIOR_END_X_USP_USD
, "End.X with USP & USD" },
2240 { SRV6_ENDPOINT_BEHAVIOR_END_X_PSP_USP_USD
, "End.X with PSP, USP & USD" },
2241 { SRV6_ENDPOINT_BEHAVIOR_END_T_USD
, "End.T with USD" },
2242 { SRV6_ENDPOINT_BEHAVIOR_END_T_PSP_USD
, "End.T with PSP & USD" },
2243 { SRV6_ENDPOINT_BEHAVIOR_END_T_USP_USD
, "End.T with USP & USD" },
2244 { SRV6_ENDPOINT_BEHAVIOR_END_T_PSP_USP_USD
, "End.T with PSP, USP & USD" },
2245 { SRV6_ENDPOINT_BEHAVIOR_END_MAP
, "End.MAP" },
2246 { SRV6_ENDPOINT_BEHAVIOR_END_LIMIT
, "End.Limit" },
2247 { SRV6_ENDPOINT_BEHAVIOR_END_ONLY_CSID
, "End with NEXT-ONLY-CSID" },
2248 { SRV6_ENDPOINT_BEHAVIOR_END_CSID
, "End with NEXT-CSID" },
2249 { SRV6_ENDPOINT_BEHAVIOR_END_CSID_PSP
, "End with NEXT-CSID & PSP" },
2250 { SRV6_ENDPOINT_BEHAVIOR_END_CSID_USP
, "End with NEXT-CSID & USP" },
2251 { SRV6_ENDPOINT_BEHAVIOR_END_CSID_PSP_USP
, "End with NEXT-CSID, PSP & USP" },
2252 { SRV6_ENDPOINT_BEHAVIOR_END_CSID_USD
, "End with NEXT-CSID & USD" },
2253 { SRV6_ENDPOINT_BEHAVIOR_END_CSID_PSP_USD
, "End with NEXT-CSID, PSP & USD" },
2254 { SRV6_ENDPOINT_BEHAVIOR_END_CSID_USP_USD
, "End with NEXT-CSID, USP & USD" },
2255 { SRV6_ENDPOINT_BEHAVIOR_END_CSID_PSP_USP_USD
, "End with NEXT-CSID, PSP, USP & USD" },
2256 { SRV6_ENDPOINT_BEHAVIOR_END_X_ONLY_CSID
, "End.X with NEXT-ONLY-CSID" },
2257 { SRV6_ENDPOINT_BEHAVIOR_END_X_CSID
, "End.X with NEXT-CSID" },
2258 { SRV6_ENDPOINT_BEHAVIOR_END_X_CSID_PSP
, "End.X with NEXT-CSID & PSP" },
2259 { SRV6_ENDPOINT_BEHAVIOR_END_X_CSID_USP
, "End.X with NEXT-CSID & USP" },
2260 { SRV6_ENDPOINT_BEHAVIOR_END_X_CSID_PSP_USP
, "End.X with NEXT-CSID, PSP & USP" },
2261 { SRV6_ENDPOINT_BEHAVIOR_END_X_CSID_USD
, "End.X with NEXT-CSID & USD" },
2262 { SRV6_ENDPOINT_BEHAVIOR_END_X_CSID_PSP_USD
, "End.X with NEXT-CSID, PSP & USD" },
2263 { SRV6_ENDPOINT_BEHAVIOR_END_X_CSID_USP_USD
, "End.X with NEXT-CSID, USP & USD" },
2264 { SRV6_ENDPOINT_BEHAVIOR_END_X_CSID_PSP_USP_USD
, "End.X with NEXT-CSID, PSP, USP & USD" },
2265 { SRV6_ENDPOINT_BEHAVIOR_END_DX6_CSID
, "End.DX6 with NEXT-CSID" },
2266 { SRV6_ENDPOINT_BEHAVIOR_END_DX4_CSID
, "End.DX4 with NEXT-CSID" },
2267 { SRV6_ENDPOINT_BEHAVIOR_END_DT6_CSID
, "End.DT6 with NEXT-CSID" },
2268 { SRV6_ENDPOINT_BEHAVIOR_END_DT4_CSID
, "End.DT4 with NEXT-CSID" },
2269 { SRV6_ENDPOINT_BEHAVIOR_END_DT46_CSID
, "End.DT46 with NEXT-CSID" },
2270 { SRV6_ENDPOINT_BEHAVIOR_END_DX2_CSID
, "End.DX2 with NEXT-CSID" },
2271 { SRV6_ENDPOINT_BEHAVIOR_END_DX2V_CSID
, "End.DX2V with NEXT-CSID" },
2272 { SRV6_ENDPOINT_BEHAVIOR_END_DT2U_CSID
, "End.DT2U with NEXT-CSID" },
2273 { SRV6_ENDPOINT_BEHAVIOR_END_DT2M_CSID
, "End.DT2M with NEXT-CSID" },
2274 { SRV6_ENDPOINT_BEHAVIOR_END_M_GTP6D
, "End.M.GTP6.D" },
2275 { SRV6_ENDPOINT_BEHAVIOR_END_M_GTP6DI
, "End.M.GTP6.Di" },
2276 { SRV6_ENDPOINT_BEHAVIOR_END_M_GTP6E
, "End.M.GTP6.E" },
2277 { SRV6_ENDPOINT_BEHAVIOR_END_M_GTP4E
, "End.M.GTP4.E" },
2278 { SRV6_ENDPOINT_BEHAVIOR_END_M
, "End.M" },
2279 { SRV6_ENDPOINT_BEHAVIOR_END_REPLICATE
, "End.Replicate" },
2280 { SRV6_ENDPOINT_BEHAVIOR_END_NSH
, "End.NSH - NSH Segment" },
2281 { SRV6_ENDPOINT_BEHAVIOR_END_DX1
, "End.DX1" },
2282 { SRV6_ENDPOINT_BEHAVIOR_END_DX1_NEXT_CSID
, "End.DX1 with NEXT-CSID" },
2283 { SRV6_ENDPOINT_BEHAVIOR_END_DX1_REPL_CSID
, "End.DX1 with REPLACE-CSID" },
2284 { SRV6_ENDPOINT_BEHAVIOR_OPAQUE
, "Opaque" },
2288 #define BGP_MUP_AT_3GPP_5G 1
2289 #define BGP_MUP_RT_INTERWORK_SEGMENT_DISCOVERY 1
2290 #define BGP_MUP_RT_DIRECT_SEGMENT_DISCOVERY 2
2291 #define BGP_MUP_RT_TYPE_1_SESSION_TRANSFORMED 3
2292 #define BGP_MUP_RT_TYPE_2_SESSION_TRANSFORMED 4
2294 static const value_string bgp_mup_architecture_types
[] = {
2295 { BGP_MUP_AT_3GPP_5G
, "3gpp-5g" },
2299 static const value_string bgp_mup_route_types
[] = {
2300 { BGP_MUP_RT_INTERWORK_SEGMENT_DISCOVERY
, "Interwork Segment Discovery route" },
2301 { BGP_MUP_RT_DIRECT_SEGMENT_DISCOVERY
, "Direct Segment Discovery route" },
2302 { BGP_MUP_RT_TYPE_1_SESSION_TRANSFORMED
, "Type 1 Session Transformed (ST) route" },
2303 { BGP_MUP_RT_TYPE_2_SESSION_TRANSFORMED
, "Type 2 Session Transformed (ST) route" },
2307 static const value_string bgp_ext_com_local_admin_types
[] = {
2308 { 0, "VID (802.1Q VLAN ID)" },
2313 { 5, "dual-VID (QinQ VLAN ID)" },
2317 static const true_false_string tfs_non_transitive_transitive
= { "Non-transitive", "Transitive" };
2318 static const true_false_string tfs_esi_label_flag
= { "Single-Active redundancy", "All-Active redundancy" };
2319 static const true_false_string tfs_ospf_rt_mt
= { "Type-2", "Type-1" };
2320 static const true_false_string tfs_eigrp_rtype
= { "Internal" , "External" };
2321 static const true_false_string tfs_cost_replace
= { "Replaces the original attribute value", "Evaluated after the original attribute value" };
2322 static const true_false_string tfs_exclude_include
= { "Exclude", "Include" };
2323 static const true_false_string tfs_manually_auto_derived
= { "manually derived", "auto-derived"};
2325 /* Maximal size of an IP address string */
2326 #define MAX_SIZE_OF_IP_ADDR_STRING 16
2328 static const uint8_t rd_zero
[BGP_ROUTE_DISTINGUISHER_SIZE
] = {0};
2330 static int proto_bgp
;
2332 /* BGP header field initialisation */
2334 /* global BGP header field */
2336 static int hf_bgp_marker
;
2337 static int hf_bgp_length
;
2338 static int hf_bgp_prefix_length
;
2339 static int hf_bgp_rd
;
2340 static int hf_bgp_continuation
;
2341 static int hf_bgp_originating_as
;
2342 static int hf_bgp_community_prefix
;
2343 static int hf_bgp_endpoint_address
;
2344 static int hf_bgp_endpoint_address_ipv6
;
2345 static int hf_bgp_label_stack
;
2346 static int hf_bgp_large_communities
;
2347 static int hf_bgp_large_communities_ga
;
2348 static int hf_bgp_large_communities_ldp1
;
2349 static int hf_bgp_large_communities_ldp2
;
2350 static int hf_bgp_vplsad_length
;
2351 static int hf_bgp_vplsad_rd
;
2352 static int hf_bgp_bgpad_pe_addr
;
2353 static int hf_bgp_vplsbgp_ce_id
;
2354 static int hf_bgp_vplsbgp_labelblock_offset
;
2355 static int hf_bgp_vplsbgp_labelblock_size
;
2356 static int hf_bgp_vplsbgp_labelblock_base
;
2357 static int hf_bgp_wildcard_route_target
;
2358 static int hf_bgp_type
;
2360 /* BGP open message header field */
2362 static int hf_bgp_open_version
;
2363 static int hf_bgp_open_myas
;
2364 static int hf_bgp_open_holdtime
;
2365 static int hf_bgp_open_identifier
;
2366 static int hf_bgp_open_opt_len
;
2367 static int hf_bgp_open_opt_extension
;
2368 static int hf_bgp_open_opt_extension_mark
;
2369 static int hf_bgp_open_opt_extension_len
;
2370 static int hf_bgp_open_opt_params
;
2371 static int hf_bgp_open_opt_param
;
2372 static int hf_bgp_open_opt_param_type
;
2373 static int hf_bgp_open_opt_param_len
;
2374 static int hf_bgp_open_opt_param_auth
;
2375 static int hf_bgp_open_opt_param_unknown
;
2377 /* BGP notify header field */
2379 static int hf_bgp_notify_major_error
;
2380 static int hf_bgp_notify_minor_msg_hdr
;
2381 static int hf_bgp_notify_minor_open_msg
;
2382 static int hf_bgp_notify_minor_update_msg
;
2383 static int hf_bgp_notify_minor_ht_expired
;
2384 static int hf_bgp_notify_minor_state_machine
;
2385 static int hf_bgp_notify_minor_cease
;
2386 static int hf_bgp_notify_minor_rr_msg
;
2387 static int hf_bgp_notify_minor_unknown
;
2388 static int hf_bgp_notify_data
;
2389 static int hf_bgp_notify_error_open_bad_peer_as
;
2390 static int hf_bgp_notify_communication_length
;
2391 static int hf_bgp_notify_communication
;
2393 /* BGP route refresh header field */
2395 static int hf_bgp_route_refresh_afi
;
2396 static int hf_bgp_route_refresh_subtype
;
2397 static int hf_bgp_route_refresh_safi
;
2398 static int hf_bgp_route_refresh_orf
;
2399 static int hf_bgp_route_refresh_orf_flag
;
2400 static int hf_bgp_route_refresh_orf_type
;
2401 static int hf_bgp_route_refresh_orf_length
;
2402 static int hf_bgp_route_refresh_orf_entry_prefixlist
;
2403 static int hf_bgp_route_refresh_orf_entry_action
;
2404 static int hf_bgp_route_refresh_orf_entry_match
;
2405 static int hf_bgp_route_refresh_orf_entry_sequence
;
2406 static int hf_bgp_route_refresh_orf_entry_prefixmask_lower
;
2407 static int hf_bgp_route_refresh_orf_entry_prefixmask_upper
;
2408 static int hf_bgp_route_refresh_orf_entry_ip
;
2410 /* BGP capabilities header field */
2412 static int hf_bgp_cap
;
2413 static int hf_bgp_cap_type
;
2414 static int hf_bgp_cap_length
;
2415 static int hf_bgp_cap_action
;
2416 static int hf_bgp_cap_unknown
;
2417 static int hf_bgp_cap_reserved
;
2418 static int hf_bgp_cap_mp_afi
;
2419 static int hf_bgp_cap_mp_safi
;
2420 static int hf_bgp_cap_enh_afi
;
2421 static int hf_bgp_cap_enh_safi
;
2422 static int hf_bgp_cap_enh_nhafi
;
2423 static int hf_bgp_cap_role
;
2424 static int hf_bgp_cap_gr_timers
;
2425 static int hf_bgp_cap_gr_timers_restart_flag
;
2426 static int hf_bgp_cap_gr_timers_notification_flag
;
2427 static int hf_bgp_cap_gr_timers_restart_time
;
2428 static int hf_bgp_cap_gr_afi
;
2429 static int hf_bgp_cap_gr_safi
;
2430 static int hf_bgp_cap_gr_flag
;
2431 static int hf_bgp_cap_gr_flag_pfs
;
2432 static int hf_bgp_cap_4as
;
2433 static int hf_bgp_cap_dc
;
2434 static int hf_bgp_cap_ap_afi
;
2435 static int hf_bgp_cap_ap_safi
;
2436 static int hf_bgp_cap_ap_sendreceive
;
2437 static int hf_bgp_cap_orf_afi
;
2438 static int hf_bgp_cap_orf_safi
;
2439 static int hf_bgp_cap_orf_number
;
2440 static int hf_bgp_cap_orf_type
;
2441 static int hf_bgp_cap_orf_sendreceive
;
2442 static int hf_bgp_cap_fqdn_hostname_len
;
2443 static int hf_bgp_cap_fqdn_hostname
;
2444 static int hf_bgp_cap_fqdn_domain_name_len
;
2445 static int hf_bgp_cap_fqdn_domain_name
;
2446 static int hf_bgp_cap_multisession_flags
;
2447 static int hf_bgp_cap_bgpsec_flags
;
2448 static int hf_bgp_cap_bgpsec_version
;
2449 static int hf_bgp_cap_bgpsec_sendreceive
;
2450 static int hf_bgp_cap_bgpsec_reserved
;
2451 static int hf_bgp_cap_bgpsec_afi
;
2452 static int hf_bgp_cap_soft_version
;
2453 static int hf_bgp_cap_soft_version_len
;
2455 /* BGP update global header field */
2456 static int hf_bgp_update_withdrawn_routes_length
;
2457 static int hf_bgp_update_withdrawn_routes
;
2460 /* BGP update path attribute header field */
2461 static int hf_bgp_update_total_path_attribute_length
;
2462 static int hf_bgp_update_path_attributes
;
2463 static int hf_bgp_update_path_attributes_unknown
;
2464 static int hf_bgp_update_path_attribute_communities
;
2465 static int hf_bgp_update_path_attribute_community_well_known
;
2466 static int hf_bgp_update_path_attribute_community
;
2467 static int hf_bgp_update_path_attribute_community_as
;
2468 static int hf_bgp_update_path_attribute_community_value
;
2469 static int hf_bgp_update_path_attribute
;
2470 static int hf_bgp_update_path_attribute_flags
;
2471 static int hf_bgp_update_path_attribute_flags_optional
;
2472 static int hf_bgp_update_path_attribute_flags_transitive
;
2473 static int hf_bgp_update_path_attribute_flags_partial
;
2474 static int hf_bgp_update_path_attribute_flags_extended_length
;
2475 static int hf_bgp_update_path_attribute_flags_unused
;
2476 static int hf_bgp_update_path_attribute_type_code
;
2477 static int hf_bgp_update_path_attribute_length
;
2478 static int hf_bgp_update_path_attribute_next_hop
;
2479 static int hf_bgp_update_path_attribute_as_path_segment
;
2480 static int hf_bgp_update_path_attribute_as_path_segment_type
;
2481 static int hf_bgp_update_path_attribute_as_path_segment_length
;
2482 static int hf_bgp_update_path_attribute_as_path_segment_as2
;
2483 static int hf_bgp_update_path_attribute_as_path_segment_as4
;
2484 static int hf_bgp_update_path_attribute_origin
;
2485 static int hf_bgp_update_path_attribute_cluster_list
;
2486 static int hf_bgp_update_path_attribute_cluster_id
;
2487 static int hf_bgp_update_path_attribute_originator_id
;
2488 static int hf_bgp_update_path_attribute_local_pref
;
2489 static int hf_bgp_update_path_attribute_attrset_origin_as
;
2490 static int hf_bgp_update_path_attribute_multi_exit_disc
;
2491 static int hf_bgp_update_path_attribute_aggregator_as
;
2492 static int hf_bgp_update_path_attribute_aggregator_origin
;
2493 static int hf_bgp_update_path_attribute_link_state
;
2494 static int hf_bgp_update_path_attribute_mp_reach_nlri_address_family
;
2495 static int hf_bgp_update_path_attribute_mp_reach_nlri_safi
;
2496 static int hf_bgp_update_path_attribute_mp_reach_nlri_next_hop
;
2497 static int hf_bgp_update_path_attribute_mp_reach_nlri_next_hop_rd
;
2498 static int hf_bgp_update_path_attribute_mp_reach_nlri_next_hop_ipv4
;
2499 static int hf_bgp_update_path_attribute_mp_reach_nlri_next_hop_ipv6
;
2500 static int hf_bgp_update_path_attribute_mp_reach_nlri_next_hop_ipv6_link_local
;
2501 static int hf_bgp_update_path_attribute_mp_reach_nlri_nbr_snpa
;
2502 static int hf_bgp_update_path_attribute_mp_reach_nlri_snpa_length
;
2503 static int hf_bgp_update_path_attribute_mp_reach_nlri_snpa
;
2504 static int hf_bgp_update_path_attribute_mp_reach_nlri
;
2505 static int hf_bgp_update_path_attribute_mp_unreach_nlri_address_family
;
2506 static int hf_bgp_update_path_attribute_mp_unreach_nlri_safi
;
2507 static int hf_bgp_update_path_attribute_mp_unreach_nlri
;
2508 static int hf_bgp_update_path_attribute_aigp
;
2509 static int hf_bgp_update_path_attribute_bgpsec_sb_len
;
2510 static int hf_bgp_update_path_attribute_bgpsec_algo_id
;
2511 static int hf_bgp_update_path_attribute_bgpsec_sps_pcount
;
2512 static int hf_bgp_update_path_attribute_bgpsec_sps_flags
;
2513 static int hf_bgp_update_path_attribute_bgpsec_sps_as
;
2514 static int hf_bgp_update_path_attribute_bgpsec_sp_len
;
2515 static int hf_bgp_update_path_attribute_bgpsec_ski
;
2516 static int hf_bgp_update_path_attribute_bgpsec_sig_len
;
2517 static int hf_bgp_update_path_attribute_bgpsec_sig
;
2518 static int hf_bgp_update_path_attribute_otc
;
2519 static int hf_bgp_update_path_attribute_d_path
;
2520 static int hf_bgp_d_path_ga
;
2521 static int hf_bgp_d_path_la
;
2522 static int hf_bgp_d_path_length
;
2523 static int hf_bgp_d_path_isf_safi
;
2524 static int hf_bgp_evpn_nlri
;
2525 static int hf_bgp_evpn_nlri_rt
;
2526 static int hf_bgp_evpn_nlri_len
;
2527 static int hf_bgp_evpn_nlri_rd
;
2528 static int hf_bgp_evpn_nlri_esi
;
2529 static int hf_bgp_evpn_nlri_esi_type
;
2530 static int hf_bgp_evpn_nlri_esi_lacp_mac
;
2531 static int hf_bgp_evpn_nlri_esi_portk
;
2532 static int hf_bgp_evpn_nlri_esi_remain
;
2533 static int hf_bgp_evpn_nlri_esi_value
;
2534 static int hf_bgp_evpn_nlri_esi_value_type0
;
2535 static int hf_bgp_evpn_nlri_esi_rb_mac
;
2536 static int hf_bgp_evpn_nlri_esi_rbprio
;
2537 static int hf_bgp_evpn_nlri_esi_sys_mac
;
2538 static int hf_bgp_evpn_nlri_esi_mac_discr
;
2539 static int hf_bgp_evpn_nlri_esi_router_id
;
2540 static int hf_bgp_evpn_nlri_esi_router_discr
;
2541 static int hf_bgp_evpn_nlri_esi_asn
;
2542 static int hf_bgp_evpn_nlri_esi_asn_discr
;
2543 static int hf_bgp_evpn_nlri_esi_reserved
;
2544 static int hf_bgp_evpn_nlri_etag
;
2545 static int hf_bgp_evpn_nlri_mpls_ls1
;
2546 static int hf_bgp_evpn_nlri_mpls_ls2
;
2547 static int hf_bgp_evpn_nlri_vni
;
2548 static int hf_bgp_evpn_nlri_maclen
;
2549 static int hf_bgp_evpn_nlri_mac_addr
;
2550 static int hf_bgp_evpn_nlri_iplen
;
2551 static int hf_bgp_evpn_nlri_prefix_len
;
2552 static int hf_bgp_evpn_nlri_ip_addr
;
2553 static int hf_bgp_evpn_nlri_ipv6_addr
;
2554 static int hf_bgp_evpn_nlri_ipv4_gtw
;
2555 static int hf_bgp_evpn_nlri_ipv6_gtw
;
2556 static int hf_bgp_evpn_nlri_igmp_mc_or_length
;
2557 static int hf_bgp_evpn_nlri_igmp_mc_or_addr_ipv4
;
2558 static int hf_bgp_evpn_nlri_igmp_mc_or_addr_ipv6
;
2559 static int hf_bgp_evpn_nlri_igmp_mc_flags
;
2560 static int hf_bgp_evpn_nlri_igmp_mc_flags_v1
;
2561 static int hf_bgp_evpn_nlri_igmp_mc_flags_v2
;
2562 static int hf_bgp_evpn_nlri_igmp_mc_flags_v3
;
2563 static int hf_bgp_evpn_nlri_igmp_mc_flags_ie
;
2564 static int hf_bgp_evpn_nlri_igmp_mc_flags_reserved
;
2566 static int * const evpn_nlri_igmp_mc_flags
[] = {
2567 &hf_bgp_evpn_nlri_igmp_mc_flags_v1
,
2568 &hf_bgp_evpn_nlri_igmp_mc_flags_v2
,
2569 &hf_bgp_evpn_nlri_igmp_mc_flags_v3
,
2570 &hf_bgp_evpn_nlri_igmp_mc_flags_ie
,
2571 &hf_bgp_evpn_nlri_igmp_mc_flags_reserved
,
2575 /* BGP update tunnel encaps attribute RFC 5512 */
2577 static int hf_bgp_update_encaps_tunnel_tlv_len
;
2578 static int hf_bgp_update_encaps_tunnel_tlv_type
;
2579 static int hf_bgp_update_encaps_tunnel_subtlv_len
;
2580 static int hf_bgp_update_encaps_tunnel_subtlv_type
;
2581 static int hf_bgp_update_encaps_tunnel_subtlv_session_id
;
2582 static int hf_bgp_update_encaps_tunnel_subtlv_cookie
;
2583 static int hf_bgp_update_encaps_tunnel_subtlv_gre_key
;
2584 static int hf_bgp_update_encaps_tunnel_subtlv_color_value
;
2585 static int hf_bgp_update_encaps_tunnel_subtlv_lb_block_length
;
2586 static int hf_bgp_update_encaps_tunnel_subtlv_value
;
2588 /* draft-ietf-idr-tunnel-encaps */
2589 static int hf_bgp_update_encaps_tunnel_subtlv_vxlan_flags
;
2590 static int hf_bgp_update_encaps_tunnel_subtlv_vxlan_flags_valid_vnid
;
2591 static int hf_bgp_update_encaps_tunnel_subtlv_vxlan_flags_valid_mac
;
2592 static int hf_bgp_update_encaps_tunnel_subtlv_vxlan_flags_reserved
;
2593 static int hf_bgp_update_encaps_tunnel_subtlv_vxlan_vnid
;
2594 static int hf_bgp_update_encaps_tunnel_subtlv_vxlan_mac
;
2595 static int hf_bgp_update_encaps_tunnel_subtlv_vxlan_reserved
;
2596 static int hf_bgp_update_encaps_tunnel_subtlv_vxlan_gpe_flags
;
2597 static int hf_bgp_update_encaps_tunnel_subtlv_vxlan_gpe_flags_version
;
2598 static int hf_bgp_update_encaps_tunnel_subtlv_vxlan_gpe_flags_valid_vnid
;
2599 static int hf_bgp_update_encaps_tunnel_subtlv_vxlan_gpe_flags_reserved
;
2600 static int hf_bgp_update_encaps_tunnel_subtlv_vxlan_gpe_vnid
;
2601 static int hf_bgp_update_encaps_tunnel_subtlv_vxlan_gpe_reserved
;
2602 static int hf_bgp_update_encaps_tunnel_subtlv_nvgre_flags
;
2603 static int hf_bgp_update_encaps_tunnel_subtlv_nvgre_flags_valid_vnid
;
2604 static int hf_bgp_update_encaps_tunnel_subtlv_nvgre_flags_valid_mac
;
2605 static int hf_bgp_update_encaps_tunnel_subtlv_nvgre_flags_reserved
;
2606 static int hf_bgp_update_encaps_tunnel_subtlv_nvgre_vnid
;
2607 static int hf_bgp_update_encaps_tunnel_subtlv_nvgre_mac
;
2608 static int hf_bgp_update_encaps_tunnel_subtlv_nvgre_reserved
;
2610 /* draft-ietf-idr-segment-routing-te-policy */
2611 static int hf_bgp_update_encaps_tunnel_subtlv_pref_flags
;
2612 static int hf_bgp_update_encaps_tunnel_subtlv_pref_reserved
;
2613 static int hf_bgp_update_encaps_tunnel_subtlv_pref_preference
;
2614 static int hf_bgp_update_encaps_tunnel_subtlv_binding_sid_flags
;
2615 static int hf_bgp_update_encaps_tunnel_subtlv_binding_sid_flags_specified
;
2616 static int hf_bgp_update_encaps_tunnel_subtlv_binding_sid_flags_invalid
;
2617 static int hf_bgp_update_encaps_tunnel_subtlv_binding_sid_flags_reserved
;
2618 static int hf_bgp_update_encaps_tunnel_subtlv_binding_sid_reserved
;
2619 static int hf_bgp_update_encaps_tunnel_subtlv_binding_sid_sid
;
2620 static int hf_bgp_update_encaps_tunnel_subtlv_enlp_flags
;
2621 static int hf_bgp_update_encaps_tunnel_subtlv_enlp_reserved
;
2622 static int hf_bgp_update_encaps_tunnel_subtlv_enlp_enlp
;
2623 static int hf_bgp_update_encaps_tunnel_subtlv_priority_priority
;
2624 static int hf_bgp_update_encaps_tunnel_subtlv_priority_reserved
;
2625 static int hf_bgp_update_encaps_tunnel_subtlv_segment_list_reserved
;
2626 static int hf_bgp_update_encaps_tunnel_subtlv_segment_list_subtlv
;
2627 static int hf_bgp_update_encaps_tunnel_subtlv_segment_list_subtlv_type
;
2628 static int hf_bgp_update_encaps_tunnel_subtlv_segment_list_subtlv_length
;
2629 static int hf_bgp_update_encaps_tunnel_subtlv_segment_list_subtlv_data
;
2630 static int hf_bgp_update_encaps_tunnel_subtlv_segment_list_subtlv_flags
;
2631 static int hf_bgp_update_encaps_tunnel_subtlv_segment_list_subtlv_flags_verification
;
2632 static int hf_bgp_update_encaps_tunnel_subtlv_segment_list_subtlv_flags_algorithm
;
2633 static int hf_bgp_update_encaps_tunnel_subtlv_segment_list_subtlv_flags_reserved
;
2634 static int hf_bgp_update_encaps_tunnel_subtlv_segment_list_subtlv_reserved
;
2635 static int hf_bgp_update_encaps_tunnel_subtlv_segment_list_subtlv_mpls_label
;
2636 static int hf_bgp_update_encaps_tunnel_subtlv_segment_list_subtlv_traffic_class
;
2637 static int hf_bgp_update_encaps_tunnel_subtlv_segment_list_subtlv_bottom_stack
;
2638 static int hf_bgp_update_encaps_tunnel_subtlv_segment_list_subtlv_ttl
;
2639 static int hf_bgp_update_encaps_tunnel_subtlv_policy_name_reserved
;
2640 static int hf_bgp_update_encaps_tunnel_subtlv_policy_name_name
;
2642 /* RFC 6514 PMSI Tunnel Attribute */
2643 static int hf_bgp_pmsi_tunnel_flags
;
2644 static int hf_bgp_pmsi_tunnel_type
;
2645 static int hf_bgp_pmsi_tunnel_id
;
2646 static int hf_bgp_pmsi_tunnel_not_present
;
2647 static int hf_bgp_pmsi_tunnel_rsvp_p2mp_id
; /* RFC4875 section 19 */
2648 static int hf_bgp_pmsi_tunnel_rsvp_p2mp_tunnel_id
;
2649 static int hf_bgp_pmsi_tunnel_rsvp_p2mp_ext_tunnel_idv4
;
2650 static int hf_bgp_pmsi_tunnel_mldp_fec_el_type
; /* RFC 6388 section 2.3 */
2651 static int hf_bgp_pmsi_tunnel_mldp_fec_el_afi
;
2652 static int hf_bgp_pmsi_tunnel_mldp_fec_el_adr_len
;
2653 static int hf_bgp_pmsi_tunnel_mldp_fec_el_root_nodev4
;
2654 static int hf_bgp_pmsi_tunnel_mldp_fec_el_root_nodev6
;
2655 static int hf_bgp_pmsi_tunnel_mldp_fec_el_opa_len
;
2656 static int hf_bgp_pmsi_tunnel_mldp_fec_el_opa_val_type
;
2657 static int hf_bgp_pmsi_tunnel_mldp_fec_el_opa_val_len
;
2658 static int hf_bgp_pmsi_tunnel_mldp_fec_el_opa_value_rn
;
2659 static int hf_bgp_pmsi_tunnel_mldp_fec_el_opa_value_str
;
2660 static int hf_bgp_pmsi_tunnel_mldp_fec_el_opa_val_ext_type
;
2661 static int hf_bgp_pmsi_tunnel_mldp_fec_el_opa_val_ext_len
;
2662 static int hf_bgp_pmsi_tunnel_pimsm_sender
;
2663 static int hf_bgp_pmsi_tunnel_pimsm_pmc_group
;
2664 static int hf_bgp_pmsi_tunnel_pimssm_root_node
;
2665 static int hf_bgp_pmsi_tunnel_pimssm_pmc_group
;
2666 static int hf_bgp_pmsi_tunnel_pimbidir_sender
;
2667 static int hf_bgp_pmsi_tunnel_pimbidir_pmc_group
;
2668 static int hf_bgp_pmsi_tunnel_ingress_rep_addr
;
2669 static int hf_bgp_pmsi_tunnel_ingress_rep_addr6
;
2671 /* RFC 7311 attribute */
2672 static int hf_bgp_aigp_type
;
2673 static int hf_bgp_aigp_tlv_length
;
2674 static int hf_bgp_aigp_accu_igp_metric
;
2677 /* MPLS labels decoding */
2678 static int hf_bgp_update_mpls_label
;
2679 static int hf_bgp_update_mpls_label_value
;
2680 static int hf_bgp_update_mpls_label_value_20bits
;
2681 static int hf_bgp_update_mpls_traffic_class
;
2682 static int hf_bgp_update_mpls_bottom_stack
;
2684 /* BGP update path attribute SSA SAFI Specific attribute (deprecated should we keep it ?) */
2686 static int hf_bgp_ssa_t
;
2687 static int hf_bgp_ssa_type
;
2688 static int hf_bgp_ssa_len
;
2689 static int hf_bgp_ssa_value
;
2690 static int hf_bgp_ssa_l2tpv3_pref
;
2691 static int hf_bgp_ssa_l2tpv3_s
;
2692 static int hf_bgp_ssa_l2tpv3_unused
;
2693 static int hf_bgp_ssa_l2tpv3_cookie_len
;
2694 static int hf_bgp_ssa_l2tpv3_session_id
;
2695 static int hf_bgp_ssa_l2tpv3_cookie
;
2697 /* BGP NLRI head field */
2698 static int hf_bgp_update_nlri
;
2700 static int hf_bgp_mp_reach_nlri_ipv4_prefix
;
2701 static int hf_bgp_mp_unreach_nlri_ipv4_prefix
;
2702 static int hf_bgp_mp_reach_nlri_ipv6_prefix
;
2703 static int hf_bgp_mp_unreach_nlri_ipv6_prefix
;
2704 static int hf_bgp_mp_nlri_tnl_id
;
2705 static int hf_bgp_withdrawn_prefix
;
2706 static int hf_bgp_nlri_prefix
;
2707 static int hf_bgp_nlri_path_id
;
2709 /* BGP mcast IP VPN nlri header field */
2711 static int hf_bgp_mcast_vpn_nlri_t
;
2712 static int hf_bgp_mcast_vpn_nlri_route_type
;
2713 static int hf_bgp_mcast_vpn_nlri_length
;
2714 static int hf_bgp_mcast_vpn_nlri_rd
;
2715 static int hf_bgp_mcast_vpn_nlri_origin_router_ipv4
;
2716 static int hf_bgp_mcast_vpn_nlri_origin_router_ipv6
;
2717 static int hf_bgp_mcast_vpn_nlri_source_as
;
2718 static int hf_bgp_mcast_vpn_nlri_source_length
;
2719 static int hf_bgp_mcast_vpn_nlri_group_length
;
2720 static int hf_bgp_mcast_vpn_nlri_source_addr_ipv4
;
2721 static int hf_bgp_mcast_vpn_nlri_source_addr_ipv6
;
2722 static int hf_bgp_mcast_vpn_nlri_group_addr_ipv4
;
2723 static int hf_bgp_mcast_vpn_nlri_group_addr_ipv6
;
2724 static int hf_bgp_mcast_vpn_nlri_route_key
;
2726 /* BGP SR policy nlri field */
2727 static int hf_bgp_sr_policy_nlri_length
;
2728 static int hf_bgp_sr_policy_nlri_distinguisher
;
2729 static int hf_bgp_sr_policy_nlri_policy_color
;
2730 static int hf_bgp_sr_policy_nlri_endpoint_v4
;
2731 static int hf_bgp_sr_policy_nlri_endpoint_v6
;
2735 static int hf_bgp_ls_type
;
2736 static int hf_bgp_ls_length
;
2738 static int hf_bgp_ls_nlri
;
2739 static int hf_bgp_ls_safi128_nlri
;
2740 static int hf_bgp_ls_safi128_nlri_route_distinguisher
;
2741 static int hf_bgp_ls_safi128_nlri_route_distinguisher_type
;
2742 static int hf_bgp_ls_safi128_nlri_route_dist_admin_asnum_2
;
2743 static int hf_bgp_ls_safi128_nlri_route_dist_admin_ipv4
;
2744 static int hf_bgp_ls_safi128_nlri_route_dist_admin_asnum_4
;
2745 static int hf_bgp_ls_safi128_nlri_route_dist_asnum_2
;
2746 static int hf_bgp_ls_safi128_nlri_route_dist_asnum_4
;
2747 static int hf_bgp_ls_nlri_type
;
2748 static int hf_bgp_ls_nlri_length
;
2749 static int hf_bgp_ls_nlri_link_nlri_type
;
2750 static int hf_bgp_ls_nlri_link_descriptors_tlv
;
2751 static int hf_bgp_ls_nlri_prefix_descriptors_tlv
;
2752 static int hf_bgp_ls_nlri_srv6_sid_descriptors_tlv
;
2753 static int hf_bgp_ls_nlri_link_local_identifier
;
2754 static int hf_bgp_ls_nlri_link_remote_identifier
;
2755 static int hf_bgp_ls_nlri_ipv4_interface_address
;
2756 static int hf_bgp_ls_nlri_ipv4_neighbor_address
;
2757 static int hf_bgp_ls_nlri_ipv6_interface_address
;
2758 static int hf_bgp_ls_nlri_ipv6_neighbor_address
;
2759 static int hf_bgp_ls_nlri_multi_topology_id
;
2760 static int hf_bgp_ls_nlri_ospf_route_type
;
2761 static int hf_bgp_ls_nlri_ip_reachability_prefix_ip
;
2762 static int hf_bgp_ls_nlri_ip_reachability_prefix_ip6
;
2763 static int hf_bgp_ls_nlri_node_nlri_type
;
2764 static int hf_bgp_ls_nlri_node_protocol_id
;
2765 static int hf_bgp_ls_nlri_node_identifier
;
2766 static int hf_bgp_ls_ipv4_topology_prefix_nlri_type
;
2767 static int hf_bgp_ls_ipv6_topology_prefix_nlri_type
;
2768 static int hf_bgp_ls_nlri_srv6_sid_nlri_type
;
2771 static int hf_bgp_ls_sr_tlv_capabilities
;
2772 static int hf_bgp_ls_sr_tlv_capabilities_range_size
;
2773 static int hf_bgp_ls_sr_tlv_capabilities_flags
;
2774 static int hf_bgp_ls_sr_tlv_capabilities_flags_i
;
2775 static int hf_bgp_ls_sr_tlv_capabilities_flags_v
;
2776 static int hf_bgp_ls_sr_tlv_capabilities_flags_h
;
2777 static int hf_bgp_ls_sr_tlv_capabilities_flags_reserved
;
2778 static int hf_bgp_ls_sr_tlv_capabilities_sid_label
;
2779 static int hf_bgp_ls_sr_tlv_capabilities_sid_index
;
2780 static int hf_bgp_ls_sr_tlv_algorithm
;
2781 static int hf_bgp_ls_sr_tlv_algorithm_value
;
2782 static int hf_bgp_ls_sr_tlv_local_block
; /* 1036 */
2783 static int hf_bgp_ls_sr_tlv_local_block_flags
;
2784 static int hf_bgp_ls_sr_tlv_local_block_range_size
;
2785 static int hf_bgp_ls_sr_tlv_local_block_sid_label
;
2786 static int hf_bgp_ls_sr_tlv_local_block_sid_index
;
2787 static int hf_bgp_ls_sr_tlv_srv6_cap
; /* 1037 */
2788 static int hf_bgp_ls_sr_tlv_srv6_cap_flags
;
2789 static int hf_bgp_ls_sr_tlv_srv6_cap_flags_o
;
2790 static int hf_bgp_ls_sr_tlv_srv6_cap_flags_reserved
;
2791 static int hf_bgp_ls_sr_tlv_srv6_cap_reserved
;
2792 static int hf_bgp_ls_sr_tlv_flex_algo_def
; /* 1039 */
2793 static int hf_bgp_ls_sr_tlv_flex_algo_algorithm
;
2794 static int hf_bgp_ls_sr_tlv_flex_algo_metric_type
;
2795 static int hf_bgp_ls_sr_tlv_flex_algo_calc_type
;
2796 static int hf_bgp_ls_sr_tlv_flex_algo_priority
;
2797 static int hf_bgp_ls_sr_tlv_flex_algo_exc_any_affinity
; /* 1040 */
2798 static int hf_bgp_ls_sr_tlv_flex_algo_inc_any_affinity
; /* 1041 */
2799 static int hf_bgp_ls_sr_tlv_flex_algo_inc_all_affinity
; /* 1042 */
2800 static int hf_bgp_ls_sr_tlv_flex_algo_def_flags
; /* 1043 */
2801 static int hf_bgp_ls_sr_tlv_flex_algo_def_flags_flags
;
2802 static int hf_bgp_ls_sr_tlv_flex_algo_def_flags_flags_m
;
2803 static int hf_bgp_ls_sr_tlv_flex_algo_prefix_metric
; /* 1044 */
2804 static int hf_bgp_ls_sr_tlv_flex_algo_prefix_metric_flags
;
2805 static int hf_bgp_ls_sr_tlv_flex_algo_prefix_metric_flags_e
;
2806 static int hf_bgp_ls_sr_tlv_flex_algo_prefix_metric_reserved
;
2807 static int hf_bgp_ls_sr_tlv_flex_algo_prefix_metric_metric
;
2808 static int hf_bgp_ls_sr_tlv_flex_algo_exc_srlg
; /* 1045 */
2809 static int hf_bgp_ls_sr_tlv_prefix_sid
;
2810 static int hf_bgp_ls_sr_tlv_prefix_sid_flags
;
2811 static int hf_bgp_ls_sr_tlv_prefix_sid_flags_r
;
2812 static int hf_bgp_ls_sr_tlv_prefix_sid_flags_n
;
2813 static int hf_bgp_ls_sr_tlv_prefix_sid_flags_np
;
2814 static int hf_bgp_ls_sr_tlv_prefix_sid_flags_p
;
2815 static int hf_bgp_ls_sr_tlv_prefix_sid_flags_m
;
2816 static int hf_bgp_ls_sr_tlv_prefix_sid_flags_e
;
2817 static int hf_bgp_ls_sr_tlv_prefix_sid_flags_v
;
2818 static int hf_bgp_ls_sr_tlv_prefix_sid_flags_l
;
2819 static int hf_bgp_ls_sr_tlv_prefix_sid_algo
;
2820 static int hf_bgp_ls_sr_tlv_prefix_sid_label
;
2821 static int hf_bgp_ls_sr_tlv_prefix_sid_index
;
2822 static int hf_bgp_ls_sr_tlv_adjacency_sid
;
2823 static int hf_bgp_ls_sr_tlv_adjacency_sid_flags
;
2824 static int hf_bgp_ls_sr_tlv_adjacency_sid_flags_fi
;
2825 static int hf_bgp_ls_sr_tlv_adjacency_sid_flags_bi
;
2826 static int hf_bgp_ls_sr_tlv_adjacency_sid_flags_bo
;
2827 static int hf_bgp_ls_sr_tlv_adjacency_sid_flags_vi
;
2828 static int hf_bgp_ls_sr_tlv_adjacency_sid_flags_vo
;
2829 static int hf_bgp_ls_sr_tlv_adjacency_sid_flags_li
;
2830 static int hf_bgp_ls_sr_tlv_adjacency_sid_flags_lo
;
2831 static int hf_bgp_ls_sr_tlv_adjacency_sid_flags_si
;
2832 static int hf_bgp_ls_sr_tlv_adjacency_sid_flags_go
;
2833 static int hf_bgp_ls_sr_tlv_adjacency_sid_flags_pi
;
2834 static int hf_bgp_ls_sr_tlv_adjacency_sid_flags_po
;
2835 static int hf_bgp_ls_sr_tlv_adjacency_sid_weight
;
2836 static int hf_bgp_ls_sr_tlv_adjacency_sid_label
;
2837 static int hf_bgp_ls_sr_tlv_adjacency_sid_index
;
2838 static int hf_bgp_ls_sr_tlv_peer_node_sid
; /* 1101 */
2839 static int hf_bgp_ls_sr_tlv_peer_adj_sid
; /* 1102 */
2840 static int hf_bgp_ls_sr_tlv_peer_set_sid
; /* 1103 */
2841 static int hf_bgp_ls_sr_tlv_peer_sid_flags
;
2842 static int hf_bgp_ls_sr_tlv_peer_sid_flags_v
;
2843 static int hf_bgp_ls_sr_tlv_peer_sid_flags_l
;
2844 static int hf_bgp_ls_sr_tlv_peer_sid_flags_b
;
2845 static int hf_bgp_ls_sr_tlv_peer_sid_flags_p
;
2846 static int hf_bgp_ls_sr_tlv_peer_sid_weight
;
2847 static int hf_bgp_ls_sr_tlv_peer_sid_label
;
2848 static int hf_bgp_ls_sr_tlv_peer_sid_index
;
2849 static int hf_bgp_ls_sr_tlv_srv6_endx_sid
; /* 1106 */
2850 static int hf_bgp_ls_sr_tlv_srv6_lan_endx_sid
; /* 1107 */
2851 static int hf_bgp_ls_sr_tlv_srv6_endx_sid_endpoint_behavior
;
2852 static int hf_bgp_ls_sr_tlv_srv6_endx_sid_flags
;
2853 static int hf_bgp_ls_sr_tlv_srv6_endx_sid_flags_b
;
2854 static int hf_bgp_ls_sr_tlv_srv6_endx_sid_flags_s
;
2855 static int hf_bgp_ls_sr_tlv_srv6_endx_sid_flags_p
;
2856 static int hf_bgp_ls_sr_tlv_srv6_endx_sid_flags_reserved
;
2857 static int hf_bgp_ls_sr_tlv_srv6_endx_sid_algo
;
2858 static int hf_bgp_ls_sr_tlv_srv6_endx_sid_weight
;
2859 static int hf_bgp_ls_sr_tlv_srv6_endx_sid_reserved
;
2860 static int hf_bgp_ls_sr_tlv_srv6_endx_sid_neighbor_isis
;
2861 static int hf_bgp_ls_sr_tlv_srv6_endx_sid_neighbor_ospf
;
2862 static int hf_bgp_ls_sr_tlv_srv6_endx_sid_sid
;
2863 static int hf_bgp_ls_sr_tlv_srv6_locator
; /* 1162 */
2864 static int hf_bgp_ls_sr_tlv_srv6_locator_flags
;
2865 static int hf_bgp_ls_sr_tlv_srv6_locator_flags_d
;
2866 static int hf_bgp_ls_sr_tlv_srv6_locator_flags_reserved
;
2867 static int hf_bgp_ls_sr_tlv_srv6_locator_algo
;
2868 static int hf_bgp_ls_sr_tlv_srv6_locator_reserved
;
2869 static int hf_bgp_ls_sr_tlv_srv6_locator_metric
;
2870 static int hf_bgp_ls_sr_tlv_prefix_attr_flags
; /* 1170 */
2871 static int hf_bgp_ls_sr_tlv_prefix_attr_flags_flags
;
2872 static int hf_bgp_ls_sr_tlv_prefix_attr_flags_flags_unknown
;
2873 static int hf_bgp_ls_sr_tlv_prefix_attr_flags_flags_ao
;
2874 static int hf_bgp_ls_sr_tlv_prefix_attr_flags_flags_no
;
2875 static int hf_bgp_ls_sr_tlv_prefix_attr_flags_flags_eo
;
2876 static int hf_bgp_ls_sr_tlv_prefix_attr_flags_flags_xi
;
2877 static int hf_bgp_ls_sr_tlv_prefix_attr_flags_flags_ri
;
2878 static int hf_bgp_ls_sr_tlv_prefix_attr_flags_flags_ni
;
2879 static int hf_bgp_ls_sr_tlv_prefix_attr_flags_flags_ei
;
2880 static int hf_bgp_ls_sr_tlv_source_router_id
; /* 1171 */
2881 static int hf_bgp_ls_sr_tlv_srv6_endpoint_behavior
; /* 1250 */
2882 static int hf_bgp_ls_sr_tlv_srv6_endpoint_behavior_endpoint_behavior
;
2883 static int hf_bgp_ls_sr_tlv_srv6_endpoint_behavior_flags
;
2884 static int hf_bgp_ls_sr_tlv_srv6_endpoint_behavior_algo
;
2885 static int hf_bgp_ls_sr_tlv_srv6_sid_struct
; /* 1252 */
2886 static int hf_bgp_ls_sr_tlv_srv6_sid_struct_lb_len
;
2887 static int hf_bgp_ls_sr_tlv_srv6_sid_struct_ln_len
;
2888 static int hf_bgp_ls_sr_tlv_srv6_sid_struct_fun_len
;
2889 static int hf_bgp_ls_sr_tlv_srv6_sid_struct_arg_len
;
2891 static int * const srv6_endx_sid_flags
[] = {
2892 &hf_bgp_ls_sr_tlv_srv6_endx_sid_flags_b
,
2893 &hf_bgp_ls_sr_tlv_srv6_endx_sid_flags_s
,
2894 &hf_bgp_ls_sr_tlv_srv6_endx_sid_flags_p
,
2895 &hf_bgp_ls_sr_tlv_srv6_endx_sid_flags_reserved
,
2900 static int hf_bgp_ls_tlv_local_node_descriptors
; /* 256 */
2901 static int hf_bgp_ls_tlv_remote_node_descriptors
; /* 257 */
2902 static int hf_bgp_ls_tlv_link_local_remote_identifiers
; /* 258 */
2903 static int hf_bgp_ls_tlv_ipv4_interface_address
; /* 259 */
2904 static int hf_bgp_ls_tlv_ipv4_neighbor_address
; /* 260 */
2905 static int hf_bgp_ls_tlv_ipv6_interface_address
; /* 261 */
2906 static int hf_bgp_ls_tlv_ipv6_neighbor_address
; /* 262 */
2907 static int hf_bgp_ls_tlv_multi_topology_id
; /* 263 */
2908 static int hf_bgp_ls_tlv_ospf_route_type
; /* 264 */
2909 static int hf_bgp_ls_tlv_ip_reachability_information
; /* 265 */
2910 static int hf_bgp_ls_tlv_node_msd
; /* 266 */
2911 static int hf_bgp_ls_tlv_link_msd
; /* 267 */
2912 static int hf_bgp_ls_tlv_igp_msd_type
;
2913 static int hf_bgp_ls_tlv_igp_msd_value
;
2915 static int hf_bgp_ls_tlv_autonomous_system
; /* 512 */
2916 static int hf_bgp_ls_tlv_autonomous_system_id
;
2917 static int hf_bgp_ls_tlv_bgp_ls_identifier
; /* 513 */
2918 static int hf_bgp_ls_tlv_bgp_ls_identifier_id
;
2919 static int hf_bgp_ls_tlv_area_id
; /* 514 */
2920 static int hf_bgp_ls_tlv_area_id_id
;
2921 static int hf_bgp_ls_tlv_igp_router
; /* 515 */
2922 static int hf_bgp_ls_tlv_igp_router_id
;
2923 static int hf_bgp_ls_tlv_bgp_router_id
; /* 516 */
2924 static int hf_bgp_ls_tlv_bgp_router_id_id
;
2925 static int hf_bgp_ls_tlv_srv6_sid_info
; /* 518 */
2926 static int hf_bgp_ls_tlv_srv6_sid_info_sid
;
2928 static int hf_bgp_ls_tlv_node_flags_bits
; /* 1024 */
2929 static int hf_bgp_ls_tlv_opaque_node_properties
; /* 1025 */
2930 static int hf_bgp_ls_tlv_opaque_node_properties_value
;
2931 static int hf_bgp_ls_tlv_node_name
; /* 1026 */
2932 static int hf_bgp_ls_tlv_node_name_value
;
2933 static int hf_bgp_ls_tlv_is_is_area_identifier
; /* 1027 */
2934 static int hf_bgp_ls_tlv_is_is_area_identifier_value
;
2935 static int hf_bgp_ls_tlv_ipv4_router_id_of_local_node
; /* 1028 */
2936 static int hf_bgp_ls_tlv_ipv4_router_id_value
;
2937 static int hf_bgp_ls_tlv_ipv6_router_id_value
;
2938 static int hf_bgp_ls_tlv_ipv6_router_id_of_local_node
; /* 1029 */
2939 static int hf_bgp_ls_tlv_ipv4_router_id_of_remote_node
; /* 1030 */
2940 static int hf_bgp_ls_tlv_ipv6_router_id_of_remote_node
; /* 1031 */
2942 static int hf_bgp_ls_tlv_administrative_group_color
; /* 1088 */
2943 static int hf_bgp_ls_tlv_administrative_group_color_value
;
2944 static int hf_bgp_ls_tlv_administrative_group
;
2945 static int hf_bgp_ls_tlv_max_link_bandwidth
; /* 1089 */
2946 static int hf_bgp_ls_tlv_max_reservable_link_bandwidth
; /* 1090 */
2947 static int hf_bgp_ls_tlv_unreserved_bandwidth
; /* 1091 */
2948 static int hf_bgp_ls_bandwidth_value
;
2949 static int hf_bgp_ls_tlv_te_default_metric
; /* 1092 */
2950 static int hf_bgp_ls_tlv_te_default_metric_value_old
;
2951 static int hf_bgp_ls_tlv_te_default_metric_value
;
2952 static int hf_bgp_ls_tlv_link_protection_type
; /* 1093 */
2953 static int hf_bgp_ls_tlv_link_protection_type_value
;
2954 static int hf_bgp_ls_tlv_mpls_protocol_mask
; /* 1094 */
2955 static int hf_bgp_ls_tlv_metric
; /* 1095 */
2956 static int hf_bgp_ls_tlv_metric_value1
;
2957 static int hf_bgp_ls_tlv_metric_value2
;
2958 static int hf_bgp_ls_tlv_metric_value3
;
2959 static int hf_bgp_ls_tlv_shared_risk_link_group
; /* 1096 */
2960 static int hf_bgp_ls_tlv_shared_risk_link_group_value
;
2961 static int hf_bgp_ls_tlv_opaque_link_attribute
; /* 1097 */
2962 static int hf_bgp_ls_tlv_opaque_link_attribute_value
;
2963 static int hf_bgp_ls_tlv_link_name_attribute
; /* 1098 */
2964 static int hf_bgp_ls_tlv_link_name_attribute_value
;
2965 static int hf_bgp_ls_tlv_app_spec_link_attrs
; /* 1122 */
2966 static int hf_bgp_ls_tlv_app_spec_link_attrs_sabm_len
;
2967 static int hf_bgp_ls_tlv_app_spec_link_attrs_udabm_len
;
2968 static int hf_bgp_ls_tlv_app_spec_link_attrs_reserved
;
2969 static int hf_bgp_ls_tlv_app_spec_link_attrs_sabm
;
2970 static int hf_bgp_ls_tlv_app_spec_link_attrs_sabm_r
;
2971 static int hf_bgp_ls_tlv_app_spec_link_attrs_sabm_s
;
2972 static int hf_bgp_ls_tlv_app_spec_link_attrs_sabm_f
;
2973 static int hf_bgp_ls_tlv_app_spec_link_attrs_sabm_x
;
2974 static int hf_bgp_ls_tlv_app_spec_link_attrs_udabm
;
2976 static int hf_bgp_ls_tlv_igp_flags
; /* 1152 */
2977 static int hf_bgp_ls_tlv_route_tag
; /* 1153 */
2978 static int hf_bgp_ls_tlv_route_tag_value
;
2979 static int hf_bgp_ls_tlv_route_extended_tag
; /* 1154 */
2980 static int hf_bgp_ls_tlv_route_extended_tag_value
;
2981 static int hf_bgp_ls_tlv_prefix_metric
; /* 1155 */
2982 static int hf_bgp_ls_tlv_prefix_metric_value
;
2983 static int hf_bgp_ls_ospf_forwarding_address
; /* 1156 */
2984 static int hf_bgp_ls_ospf_forwarding_address_ipv4_address
;
2985 static int hf_bgp_ls_ospf_forwarding_address_ipv6_address
;
2986 static int hf_bgp_ls_opaque_prefix_attribute
; /* 1157 */
2987 static int hf_bgp_ls_opaque_prefix_attribute_value
;
2988 static int hf_bgp_ls_extended_administrative_group
; /* 1173 */
2989 static int hf_bgp_ls_extended_administrative_group_value
;
2992 /* Link Protection Types */
2993 static int hf_bgp_ls_link_protection_type_extra_traffic
;
2994 static int hf_bgp_ls_link_protection_type_unprotected
;
2995 static int hf_bgp_ls_link_protection_type_shared
;
2996 static int hf_bgp_ls_link_protection_type_dedicated_1to1
;
2997 static int hf_bgp_ls_link_protection_type_dedicated_1plus1
;
2998 static int hf_bgp_ls_link_protection_type_enhanced
;
2999 /* MPLS Protocol Mask flags */
3000 static int hf_bgp_ls_mpls_protocol_mask_flag_l
;
3001 static int hf_bgp_ls_mpls_protocol_mask_flag_r
;
3002 /* BGP-LS IGP Flags */
3003 static int hf_bgp_ls_igp_flags_flag_d
;
3004 /* Node Flag Bits TLV's flags */
3005 static int hf_bgp_ls_node_flag_bits_overload
;
3006 static int hf_bgp_ls_node_flag_bits_attached
;
3007 static int hf_bgp_ls_node_flag_bits_external
;
3008 static int hf_bgp_ls_node_flag_bits_abr
;
3010 /* RFC8669 BGP Prefix-SID header field */
3011 static int hf_bgp_prefix_sid_unknown
;
3012 static int hf_bgp_prefix_sid_label_index
;
3013 static int hf_bgp_prefix_sid_label_index_value
;
3014 static int hf_bgp_prefix_sid_label_index_flags
;
3015 static int hf_bgp_prefix_sid_originator_srgb
;
3016 static int hf_bgp_prefix_sid_originator_srgb_blocks
;
3017 static int hf_bgp_prefix_sid_originator_srgb_block
;
3018 static int hf_bgp_prefix_sid_originator_srgb_flags
;
3019 static int hf_bgp_prefix_sid_originator_srgb_base
;
3020 static int hf_bgp_prefix_sid_originator_srgb_range
;
3021 static int hf_bgp_prefix_sid_type
;
3022 static int hf_bgp_prefix_sid_length
;
3023 static int hf_bgp_prefix_sid_value
;
3024 static int hf_bgp_prefix_sid_reserved
;
3026 /* draft-ietf-bess-srv6-services-05 header field */
3027 static int hf_bgp_prefix_sid_srv6_l3vpn
;
3028 static int hf_bgp_prefix_sid_srv6_l3vpn_sub_tlvs
;
3029 static int hf_bgp_prefix_sid_srv6_l3vpn_sub_tlv
;
3030 static int hf_bgp_prefix_sid_srv6_l3vpn_sub_tlv_type
;
3031 static int hf_bgp_prefix_sid_srv6_l3vpn_sub_tlv_length
;
3032 static int hf_bgp_prefix_sid_srv6_l3vpn_sub_tlv_value
;
3033 static int hf_bgp_prefix_sid_srv6_l3vpn_sub_tlv_reserved
;
3034 static int hf_bgp_prefix_sid_srv6_l3vpn_sid_value
;
3035 static int hf_bgp_prefix_sid_srv6_l3vpn_sid_flags
;
3036 static int hf_bgp_prefix_sid_srv6_l3vpn_srv6_endpoint_behavior
;
3037 static int hf_bgp_prefix_sid_srv6_l3vpn_reserved
;
3038 static int hf_bgp_prefix_sid_srv6_l3vpn_sub_sub_tlvs
;
3039 static int hf_bgp_prefix_sid_srv6_l3vpn_sub_sub_tlv
;
3040 static int hf_bgp_prefix_sid_srv6_l3vpn_sub_sub_tlv_type
;
3041 static int hf_bgp_prefix_sid_srv6_l3vpn_sub_sub_tlv_length
;
3042 static int hf_bgp_prefix_sid_srv6_l3vpn_sub_sub_tlv_value
;
3043 static int hf_bgp_prefix_sid_srv6_l3vpn_sid_locator_block_len
;
3044 static int hf_bgp_prefix_sid_srv6_l3vpn_sid_locator_node_len
;
3045 static int hf_bgp_prefix_sid_srv6_l3vpn_sid_func_len
;
3046 static int hf_bgp_prefix_sid_srv6_l3vpn_sid_arg_len
;
3047 static int hf_bgp_prefix_sid_srv6_l3vpn_sid_trans_len
;
3048 static int hf_bgp_prefix_sid_srv6_l3vpn_sid_trans_offset
;
3049 static int hf_bgp_prefix_sid_srv6_l2vpn
;
3050 static int hf_bgp_prefix_sid_srv6_l2vpn_sub_tlvs
;
3051 static int hf_bgp_prefix_sid_srv6_l2vpn_sub_tlv
;
3052 static int hf_bgp_prefix_sid_srv6_l2vpn_sub_tlv_type
;
3053 static int hf_bgp_prefix_sid_srv6_l2vpn_sub_tlv_length
;
3054 static int hf_bgp_prefix_sid_srv6_l2vpn_sub_tlv_value
;
3055 static int hf_bgp_prefix_sid_srv6_l2vpn_sub_tlv_reserved
;
3056 static int hf_bgp_prefix_sid_srv6_l2vpn_sid_value
;
3057 static int hf_bgp_prefix_sid_srv6_l2vpn_sid_flags
;
3058 static int hf_bgp_prefix_sid_srv6_l2vpn_srv6_endpoint_behavior
;
3059 static int hf_bgp_prefix_sid_srv6_l2vpn_reserved
;
3060 static int hf_bgp_prefix_sid_srv6_l2vpn_sub_sub_tlvs
;
3061 static int hf_bgp_prefix_sid_srv6_l2vpn_sub_sub_tlv
;
3062 static int hf_bgp_prefix_sid_srv6_l2vpn_sub_sub_tlv_type
;
3063 static int hf_bgp_prefix_sid_srv6_l2vpn_sub_sub_tlv_length
;
3064 static int hf_bgp_prefix_sid_srv6_l2vpn_sub_sub_tlv_value
;
3065 static int hf_bgp_prefix_sid_srv6_l2vpn_sid_locator_block_len
;
3066 static int hf_bgp_prefix_sid_srv6_l2vpn_sid_locator_node_len
;
3067 static int hf_bgp_prefix_sid_srv6_l2vpn_sid_func_len
;
3068 static int hf_bgp_prefix_sid_srv6_l2vpn_sid_arg_len
;
3069 static int hf_bgp_prefix_sid_srv6_l2vpn_sid_trans_len
;
3070 static int hf_bgp_prefix_sid_srv6_l2vpn_sid_trans_offset
;
3072 /* BGP flow spec nlri header field */
3074 static int hf_bgp_flowspec_nlri_t
;
3075 static int hf_bgp_flowspec_nlri_route_distinguisher
;
3076 static int hf_bgp_flowspec_nlri_route_distinguisher_type
;
3077 static int hf_bgp_flowspec_nlri_route_dist_admin_asnum_2
;
3078 static int hf_bgp_flowspec_nlri_route_dist_admin_ipv4
;
3079 static int hf_bgp_flowspec_nlri_route_dist_admin_asnum_4
;
3080 static int hf_bgp_flowspec_nlri_route_dist_asnum_2
;
3081 static int hf_bgp_flowspec_nlri_route_dist_asnum_4
;
3082 static int hf_bgp_flowspec_nlri_filter
;
3083 static int hf_bgp_flowspec_nlri_filter_type
;
3084 static int hf_bgp_flowspec_nlri_length
;
3085 static int hf_bgp_flowspec_nlri_dst_pref_ipv4
;
3086 static int hf_bgp_flowspec_nlri_src_pref_ipv4
;
3087 static int hf_bgp_flowspec_nlri_op_flags
;
3088 static int hf_bgp_flowspec_nlri_op_eol
;
3089 static int hf_bgp_flowspec_nlri_op_and
;
3090 static int hf_bgp_flowspec_nlri_op_val_len
;
3091 static int hf_bgp_flowspec_nlri_op_un_bit4
;
3092 static int hf_bgp_flowspec_nlri_op_un_bit5
;
3093 static int hf_bgp_flowspec_nlri_op_lt
;
3094 static int hf_bgp_flowspec_nlri_op_gt
;
3095 static int hf_bgp_flowspec_nlri_op_eq
;
3096 static int hf_bgp_flowspec_nlri_dec_val_8
;
3097 static int hf_bgp_flowspec_nlri_dec_val_16
;
3098 static int hf_bgp_flowspec_nlri_dec_val_32
;
3099 static int hf_bgp_flowspec_nlri_dec_val_64
;
3100 static int hf_bgp_flowspec_nlri_op_flg_not
;
3101 static int hf_bgp_flowspec_nlri_op_flg_match
;
3102 static int hf_bgp_flowspec_nlri_tcp_flags
;
3103 static int hf_bgp_flowspec_nlri_tcp_flags_cwr
;
3104 static int hf_bgp_flowspec_nlri_tcp_flags_ecn
;
3105 static int hf_bgp_flowspec_nlri_tcp_flags_urg
;
3106 static int hf_bgp_flowspec_nlri_tcp_flags_ack
;
3107 static int hf_bgp_flowspec_nlri_tcp_flags_push
;
3108 static int hf_bgp_flowspec_nlri_tcp_flags_reset
;
3109 static int hf_bgp_flowspec_nlri_tcp_flags_syn
;
3110 static int hf_bgp_flowspec_nlri_tcp_flags_fin
;
3111 static int hf_bgp_flowspec_nlri_fflag
;
3112 static int hf_bgp_flowspec_nlri_fflag_lf
;
3113 static int hf_bgp_flowspec_nlri_fflag_ff
;
3114 static int hf_bgp_flowspec_nlri_fflag_isf
;
3115 static int hf_bgp_flowspec_nlri_fflag_df
;
3116 static int hf_bgp_flowspec_nlri_dscp
;
3117 static int hf_bgp_flowspec_nlri_src_ipv6_pref
;
3118 static int hf_bgp_flowspec_nlri_dst_ipv6_pref
;
3119 static int hf_bgp_flowspec_nlri_ipv6_pref_len
;
3120 static int hf_bgp_flowspec_nlri_ipv6_pref_offset
;
3122 /* BGP update safi ndt nlri draft-nalawade-idr-mdt-safi-03 */
3124 static int hf_bgp_mdt_nlri_safi_rd
;
3125 static int hf_bgp_mdt_nlri_safi_ipv4_addr
;
3126 static int hf_bgp_mdt_nlri_safi_group_addr
;
3128 /* BGP update extended community header field */
3130 static int hf_bgp_ext_communities
;
3131 static int hf_bgp_ext_community
;
3132 static int hf_bgp_ext_com_type_auth
;
3133 static int hf_bgp_ext_com_type_tran
;
3135 static int hf_bgp_ext_com_type_high
;
3136 static int hf_bgp_ext_com_stype_low_unknown
;
3137 static int hf_bgp_ext_com_stype_tr_evpn
;
3138 static int hf_bgp_ext_com_stype_tr_as2
;
3139 static int hf_bgp_ext_com_stype_ntr_as2
;
3140 static int hf_bgp_ext_com_stype_tr_as4
;
3141 static int hf_bgp_ext_com_stype_ntr_as4
;
3142 static int hf_bgp_ext_com_stype_tr_IP4
;
3143 static int hf_bgp_ext_com_stype_ntr_IP4
;
3144 static int hf_bgp_ext_com_stype_tr_opaque
;
3145 static int hf_bgp_ext_com_stype_ntr_opaque
;
3146 static int hf_bgp_ext_com_tunnel_type
;
3147 static int hf_bgp_ext_com_stype_tr_mup
;
3148 static int hf_bgp_ext_com_stype_tr_exp
;
3149 static int hf_bgp_ext_com_stype_tr_exp_2
;
3150 static int hf_bgp_ext_com_stype_tr_exp_3
;
3152 static int hf_bgp_ext_com_value_as2
;
3153 static int hf_bgp_ext_com_value_as4
;
3154 static int hf_bgp_ext_com_value_IP4
;
3155 static int hf_bgp_ext_com_value_an2
;
3156 static int hf_bgp_ext_com_value_an4
;
3157 static int hf_bgp_ext_com_value_raw
;
3158 static int hf_bgp_ext_com_value_link_bw
;
3159 static int hf_bgp_ext_com_value_ospf_rt_area
;
3160 static int hf_bgp_ext_com_value_ospf_rt_type
;
3161 static int hf_bgp_ext_com_value_ospf_rt_options
;
3162 static int hf_bgp_ext_com_value_ospf_rt_options_mt
;
3163 static int hf_bgp_ext_com_value_ospf_rid
;
3164 static int hf_bgp_ext_com_value_fs_remark
;
3165 static int hf_bgp_ext_com_local_admin_flags
;
3166 static int hf_bgp_ext_com_local_admin_auto_derived_flag
;
3167 static int hf_bgp_ext_com_local_admin_type
;
3168 static int hf_bgp_ext_com_local_admin_domain_id
;
3169 static int hf_bgp_ext_com_local_admin_service_id
;
3171 /* BGP QoS propagation draft-knoll-idr-qos-attribute */
3173 static int hf_bgp_ext_com_qos_flags
;
3174 static int hf_bgp_ext_com_qos_flags_remarking
;
3175 static int hf_bgp_ext_com_qos_flags_ignore_remarking
;
3176 static int hf_bgp_ext_com_qos_flags_agg_marking
;
3177 static int hf_bgp_ext_com_cos_flags
;
3178 static int hf_bgp_ext_com_cos_flags_be
;
3179 static int hf_bgp_ext_com_cos_flags_ef
;
3180 static int hf_bgp_ext_com_cos_flags_af
;
3181 static int hf_bgp_ext_com_cos_flags_le
;
3182 static int hf_bgp_ext_com_qos_set_number
;
3183 static int hf_bgp_ext_com_qos_tech_type
;
3184 static int hf_bgp_ext_com_qos_marking_o
;
3185 static int hf_bgp_ext_com_qos_marking_a
;
3186 static int hf_bgp_ext_com_qos_default_to_zero
;
3188 /* BGP Flow spec extended community RFC 5575 */
3190 static int hf_bgp_ext_com_flow_rate_float
;
3191 static int hf_bgp_ext_com_flow_act_allset
;
3192 static int hf_bgp_ext_com_flow_act_term_act
;
3193 static int hf_bgp_ext_com_flow_act_samp_act
;
3195 /* BGP L2 extended community RFC 4761, RFC 6624 */
3196 /* draft-ietf-l2vpn-vpls-multihoming */
3198 static int hf_bgp_ext_com_l2_encaps
;
3199 static int hf_bgp_ext_com_l2_c_flags
;
3200 static int hf_bgp_ext_com_l2_mtu
;
3201 static int hf_bgp_ext_com_l2_flag_d
;
3202 static int hf_bgp_ext_com_l2_flag_z1
;
3203 static int hf_bgp_ext_com_l2_flag_f
;
3204 static int hf_bgp_ext_com_l2_flag_z345
;
3205 static int hf_bgp_ext_com_l2_flag_c
;
3206 static int hf_bgp_ext_com_l2_flag_s
;
3207 static int hf_bgp_ext_com_l2_esi_label_flag
;
3208 static int hf_bgp_ext_com_evpn_mmac_flag
;
3209 static int hf_bgp_ext_com_evpn_mmac_seq
;
3210 static int hf_bgp_ext_com_evpn_esirt
;
3211 static int hf_bgp_ext_com_evpn_routermac
;
3212 static int hf_bgp_ext_com_evpn_mmac_flag_sticky
;
3214 /* BGP E-Tree Info extended community RFC 7796 */
3216 static int hf_bgp_ext_com_etree_flags
;
3217 static int hf_bgp_ext_com_etree_root_vlan
;
3218 static int hf_bgp_ext_com_etree_leaf_vlan
;
3219 static int hf_bgp_ext_com_etree_flag_reserved
;
3220 static int hf_bgp_ext_com_etree_flag_p
;
3221 static int hf_bgp_ext_com_etree_flag_v
;
3223 /* VPWS Support in EVPN RFC 8214 */
3224 /* draft-yu-bess-evpn-l2-attributes-04 */
3226 static int hf_bgp_ext_com_evpn_l2attr_flags
;
3227 static int hf_bgp_ext_com_evpn_l2attr_flag_reserved
;
3228 static int hf_bgp_ext_com_evpn_l2attr_flag_ci
;
3229 static int hf_bgp_ext_com_evpn_l2attr_flag_f
;
3230 static int hf_bgp_ext_com_evpn_l2attr_flag_c
;
3231 static int hf_bgp_ext_com_evpn_l2attr_flag_p
;
3232 static int hf_bgp_ext_com_evpn_l2attr_flag_b
;
3233 static int hf_bgp_ext_com_evpn_l2attr_l2_mtu
;
3234 static int hf_bgp_ext_com_evpn_l2attr_reserved
;
3236 /* E-Tree RFC8317 */
3238 static int hf_bgp_ext_com_evpn_etree_flags
;
3239 static int hf_bgp_ext_com_evpn_etree_flag_reserved
;
3240 static int hf_bgp_ext_com_evpn_etree_flag_l
;
3241 static int hf_bgp_ext_com_evpn_etree_reserved
;
3243 /* BGP Cost Community */
3245 static int hf_bgp_ext_com_cost_poi
;
3246 static int hf_bgp_ext_com_cost_cid
;
3247 static int hf_bgp_ext_com_cost_cost
;
3248 static int hf_bgp_ext_com_cost_cid_rep
;
3250 /* EIGRP route attributes extended communities */
3252 static int hf_bgp_ext_com_stype_tr_exp_eigrp
;
3253 static int hf_bgp_ext_com_eigrp_flags
;
3254 static int hf_bgp_ext_com_eigrp_flags_rt
;
3255 static int hf_bgp_ext_com_eigrp_rtag
;
3256 static int hf_bgp_ext_com_eigrp_asn
;
3257 static int hf_bgp_ext_com_eigrp_delay
;
3258 static int hf_bgp_ext_com_eigrp_rly
;
3259 static int hf_bgp_ext_com_eigrp_hops
;
3260 static int hf_bgp_ext_com_eigrp_bw
;
3261 static int hf_bgp_ext_com_eigrp_load
;
3262 static int hf_bgp_ext_com_eigrp_mtu
;
3263 static int hf_bgp_ext_com_eigrp_rid
;
3264 static int hf_bgp_ext_com_eigrp_e_asn
;
3265 static int hf_bgp_ext_com_eigrp_e_rid
;
3266 static int hf_bgp_ext_com_eigrp_e_pid
;
3267 static int hf_bgp_ext_com_eigrp_e_m
;
3269 /* MUP extended community */
3271 static int hf_bgp_ext_com_mup_segment_id2
;
3272 static int hf_bgp_ext_com_mup_segment_id4
;
3274 /* RFC8571 BGP-LS Advertisement of IGP TE Metric Extensions */
3275 static int hf_bgp_ls_igp_te_metric_flags
;
3276 static int hf_bgp_ls_igp_te_metric_flags_a
;
3277 static int hf_bgp_ls_igp_te_metric_flags_reserved
;
3278 static int hf_bgp_ls_igp_te_metric_delay
;
3279 static int hf_bgp_ls_igp_te_metric_delay_value
;
3280 static int hf_bgp_ls_igp_te_metric_delay_min_max
;
3281 static int hf_bgp_ls_igp_te_metric_delay_min
;
3282 static int hf_bgp_ls_igp_te_metric_delay_max
;
3283 static int hf_bgp_ls_igp_te_metric_delay_variation
;
3284 static int hf_bgp_ls_igp_te_metric_delay_variation_value
;
3285 static int hf_bgp_ls_igp_te_metric_link_loss
;
3286 static int hf_bgp_ls_igp_te_metric_link_loss_value
;
3287 static int hf_bgp_ls_igp_te_metric_bandwidth_residual
;
3288 static int hf_bgp_ls_igp_te_metric_bandwidth_residual_value
;
3289 static int hf_bgp_ls_igp_te_metric_bandwidth_available
;
3290 static int hf_bgp_ls_igp_te_metric_bandwidth_available_value
;
3291 static int hf_bgp_ls_igp_te_metric_bandwidth_utilized
;
3292 static int hf_bgp_ls_igp_te_metric_bandwidth_utilized_value
;
3293 static int hf_bgp_ls_igp_te_metric_reserved
;
3295 /* draft-mpmz-bess-mup-safi-03 */
3296 static int hf_bgp_mup_nlri
;
3297 static int hf_bgp_mup_nlri_at
;
3298 static int hf_bgp_mup_nlri_rt
;
3299 static int hf_bgp_mup_nlri_len
;
3300 static int hf_bgp_mup_nlri_rd
;
3301 static int hf_bgp_mup_nlri_prefixlen
;
3302 static int hf_bgp_mup_nlri_ip_prefix
;
3303 static int hf_bgp_mup_nlri_ipv6_prefix
;
3304 static int hf_bgp_mup_nlri_ip_addr
;
3305 static int hf_bgp_mup_nlri_ipv6_addr
;
3306 static int hf_bgp_mup_nlri_3gpp_5g_type1_st_route
;
3307 static int hf_bgp_mup_nlri_3gpp_5g_teid
;
3308 static int hf_bgp_mup_nlri_3gpp_5g_qfi
;
3309 static int hf_bgp_mup_nlri_3gpp_5g_ep_addr_len
;
3310 static int hf_bgp_mup_nlri_3gpp_5g_ep_ip_addr
;
3311 static int hf_bgp_mup_nlri_3gpp_5g_ep_ipv6_addr
;
3312 static int hf_bgp_mup_nlri_3gpp_5g_source_addr_len
;
3313 static int hf_bgp_mup_nlri_3gpp_5g_source_ip_addr
;
3314 static int hf_bgp_mup_nlri_3gpp_5g_source_ipv6_addr
;
3315 static int hf_bgp_mup_nlri_3gpp_5g_type2_st_route
;
3316 static int hf_bgp_mup_nlri_ep_len
;
3317 static int hf_bgp_mup_nlri_ep_ip_addr
;
3318 static int hf_bgp_mup_nlri_ep_ipv6_addr
;
3319 static int hf_bgp_mup_nlri_3gpp_5g_ep_teid
;
3320 static int hf_bgp_mup_nlri_unknown_data
;
3322 static int * const ls_igp_te_metric_flags
[] = {
3323 &hf_bgp_ls_igp_te_metric_flags_a
,
3324 &hf_bgp_ls_igp_te_metric_flags_reserved
,
3329 static int ett_bgp_prefix
;
3330 static int ett_bgp_unfeas
;
3331 static int ett_bgp_attrs
;
3332 static int ett_bgp_attr
;
3333 static int ett_bgp_attr_flags
;
3334 static int ett_bgp_mp_nhna
;
3335 static int ett_bgp_mp_reach_nlri
;
3336 static int ett_bgp_mp_unreach_nlri
;
3337 static int ett_bgp_mp_snpa
;
3338 static int ett_bgp_nlri
;
3339 static int ett_bgp_open
;
3340 static int ett_bgp_update
;
3341 static int ett_bgp_notification
;
3342 static int ett_bgp_route_refresh
; /* ROUTE-REFRESH message tree */
3343 static int ett_bgp_capability
;
3344 static int ett_bgp_as_path_segment
;
3345 static int ett_bgp_as_path_segment_asn
;
3346 static int ett_bgp_communities
;
3347 static int ett_bgp_community
;
3348 static int ett_bgp_cluster_list
; /* cluster list tree */
3349 static int ett_bgp_options
; /* optional parameters tree */
3350 static int ett_bgp_option
; /* an optional parameter tree */
3351 static int ett_bgp_options_ext
;
3352 static int ett_bgp_cap
; /* an cap parameter tree */
3353 static int ett_bgp_extended_communities
; /* extended communities list tree */
3354 static int ett_bgp_extended_community
; /* extended community tree for each community of BGP update */
3355 static int ett_bgp_ext_com_type
; /* Extended Community Type High tree (IANA, Transitive bits) */
3356 static int ett_bgp_extended_com_fspec_redir
; /* extended communities BGP flow act redirect */
3357 static int ett_bgp_ext_com_flags
; /* extended communities flags tree */
3358 static int ett_bgp_ext_com_l2_flags
; /* extended communities tree for l2 services flags */
3359 static int ett_bgp_ext_com_etree_flags
;
3360 static int ett_bgp_ext_com_evpn_mmac_flags
;
3361 static int ett_bgp_ext_com_evpn_l2attr_flags
;
3362 static int ett_bgp_ext_com_evpn_etree_flags
;
3363 static int ett_bgp_ext_com_cost_cid
; /* Cost community CommunityID tree (replace/evaluate after bit) */
3364 static int ett_bgp_ext_com_ospf_rt_opt
; /* Tree for Options bitfield of OSPF Route Type extended community */
3365 static int ett_bgp_ext_com_eigrp_flags
; /* Tree for EIGRP route flags */
3366 static int ett_bgp_ssa
; /* safi specific attribute */
3367 static int ett_bgp_ssa_subtree
; /* safi specific attribute Subtrees */
3368 static int ett_bgp_orf
; /* orf (outbound route filter) tree */
3369 static int ett_bgp_orf_entry
; /* orf entry tree */
3370 static int ett_bgp_mcast_vpn_nlri
;
3371 static int ett_bgp_flow_spec_nlri
;
3372 static int ett_bgp_flow_spec_nlri_filter
; /* tree decoding multiple op and value pairs */
3373 static int ett_bgp_flow_spec_nlri_op_flags
; /* tree decoding each op and val pair within the op and value set */
3374 static int ett_bgp_flow_spec_nlri_tcp
;
3375 static int ett_bgp_flow_spec_nlri_ff
;
3376 static int ett_bgp_tunnel_tlv
;
3377 static int ett_bgp_tunnel_tlv_subtree
;
3378 static int ett_bgp_tunnel_subtlv
;
3379 static int ett_bgp_tunnel_subtlv_subtree
;
3380 static int ett_bgp_link_state
;
3381 static int ett_bgp_evpn_nlri
;
3382 static int ett_bgp_evpn_nlri_esi
;
3383 static int ett_bgp_evpn_nlri_mc
;
3384 static int ett_bgp_mpls_labels
;
3385 static int ett_bgp_pmsi_tunnel_id
;
3386 static int ett_bgp_aigp_attr
;
3387 static int ett_bgp_large_communities
;
3388 static int ett_bgp_dpath
;
3389 static int ett_bgp_prefix_sid_originator_srgb
;
3390 static int ett_bgp_prefix_sid_originator_srgb_block
;
3391 static int ett_bgp_prefix_sid_originator_srgb_blocks
;
3392 static int ett_bgp_prefix_sid_label_index
;
3393 static int ett_bgp_prefix_sid_ipv6
;
3394 static int ett_bgp_bgpsec_secure_path
;
3395 static int ett_bgp_bgpsec_secure_path_segment
;
3396 static int ett_bgp_bgpsec_signature_block
;
3397 static int ett_bgp_bgpsec_signature_segment
;
3398 static int ett_bgp_vxlan
;
3399 static int ett_bgp_binding_sid
;
3400 static int ett_bgp_segment_list
;
3401 static int ett_bgp_prefix_sid_unknown
;
3402 static int ett_bgp_prefix_sid_srv6_l3vpn
;
3403 static int ett_bgp_prefix_sid_srv6_l3vpn_sub_tlvs
;
3404 static int ett_bgp_prefix_sid_srv6_l3vpn_sid_information
;
3405 static int ett_bgp_prefix_sid_srv6_l3vpn_sub_sub_tlvs
;
3406 static int ett_bgp_prefix_sid_srv6_l3vpn_sid_structure
;
3407 static int ett_bgp_prefix_sid_srv6_l3vpn_sid_unknown
;
3408 static int ett_bgp_prefix_sid_srv6_l3vpn_unknown
;
3409 static int ett_bgp_prefix_sid_srv6_l2vpn
;
3410 static int ett_bgp_prefix_sid_srv6_l2vpn_sub_tlvs
;
3411 static int ett_bgp_prefix_sid_srv6_l2vpn_sid_information
;
3412 static int ett_bgp_prefix_sid_srv6_l2vpn_sub_sub_tlvs
;
3413 static int ett_bgp_prefix_sid_srv6_l2vpn_sid_structure
;
3414 static int ett_bgp_prefix_sid_srv6_l2vpn_sid_unknown
;
3415 static int ett_bgp_prefix_sid_srv6_l2vpn_unknown
;
3416 static int ett_bgp_mup_nlri
;
3417 static int ett_bgp_mup_nlri_3gpp_5g_type1_st_route
;
3418 static int ett_bgp_mup_nlri_3gpp_5g_type2_st_route
;
3420 static expert_field ei_bgp_marker_invalid
;
3421 static expert_field ei_bgp_cap_len_bad
;
3422 static expert_field ei_bgp_cap_gr_helper_mode_only
;
3423 static expert_field ei_bgp_notify_minor_unknown
;
3424 static expert_field ei_bgp_route_refresh_orf_type_unknown
;
3425 static expert_field ei_bgp_length_invalid
;
3426 static expert_field ei_bgp_prefix_length_invalid
;
3427 static expert_field ei_bgp_afi_type_not_supported
;
3428 static expert_field ei_bgp_unknown_afi
;
3429 static expert_field ei_bgp_unknown_safi
;
3430 static expert_field ei_bgp_unknown_label_vpn
;
3431 static expert_field ei_bgp_ls_error
;
3432 static expert_field ei_bgp_ls_warn
;
3433 static expert_field ei_bgp_ext_com_len_bad
;
3434 static expert_field ei_bgp_attr_pmsi_opaque_type
;
3435 static expert_field ei_bgp_attr_pmsi_tunnel_type
;
3436 static expert_field ei_bgp_prefix_length_err
;
3437 static expert_field ei_bgp_attr_aigp_type
;
3438 static expert_field ei_bgp_attr_as_path_as_len_err
;
3439 static expert_field ei_bgp_next_hop_ipv6_scope
;
3440 static expert_field ei_bgp_next_hop_rd_nonzero
;
3442 static expert_field ei_bgp_evpn_nlri_rt_type_err
;
3443 static expert_field ei_bgp_evpn_nlri_rt_len_err
;
3444 static expert_field ei_bgp_evpn_nlri_esi_type_err
;
3445 static expert_field ei_bgp_evpn_nlri_rt4_no_ip
;
3447 static expert_field ei_bgp_mup_unknown_at
;
3448 static expert_field ei_bgp_mup_unknown_rt
;
3449 static expert_field ei_bgp_mup_nlri_addr_len_err
;
3451 /* desegmentation */
3452 static bool bgp_desegment
= true;
3454 static int bgp_asn_len
;
3456 /* FF: BGP-LS is just a collector of IGP link state information. Some
3457 fields are encoded "as-is" from the IGP, hence in order to dissect
3458 them properly we must be aware of their origin, e.g. IS-IS or OSPF.
3459 So, *before* dissecting LINK_STATE attributes we must get the
3460 'Protocol-ID' field that is present in the MP_[UN]REACH_NLRI
3461 attribute. The tricky thing is that there is no strict order
3462 for path attributes on the wire, hence we have to keep track
3463 of 1) the 'Protocol-ID' from the MP_[UN]REACH_NLRI and 2)
3464 the offset/len of the LINK_STATE attribute. We store them in
3465 per-packet proto_data and once we got both we are ready for the
3466 LINK_STATE attribute dissection.
3468 typedef struct _link_state_data
{
3469 /* Link/Node NLRI Protocol-ID (e.g. OSPF or IS-IS) */
3470 uint8_t protocol_id
;
3471 /* LINK_STATE attribute coordinates */
3472 int ostart
; /* offset at which the LINK_STATE path attribute starts */
3473 int oend
; /* offset at which the LINK_STATE path attribute ends */
3474 uint16_t tlen
; /* length of the LINK_STATE path attribute */
3476 bool link_state_attr_present
;
3477 /* tree where add LINK_STATE items */
3478 proto_tree
*subtree2
;
3481 #define LINK_STATE_DATA_KEY 0
3484 save_link_state_protocol_id(packet_info
*pinfo
, uint8_t protocol_id
) {
3485 link_state_data
*data
=
3486 (link_state_data
*)p_get_proto_data(pinfo
->pool
, pinfo
, proto_bgp
, LINK_STATE_DATA_KEY
);
3488 data
= wmem_new0(pinfo
->pool
, link_state_data
);
3492 data
->link_state_attr_present
= false;
3493 data
->subtree2
= NULL
;
3495 data
->protocol_id
= protocol_id
;
3496 p_add_proto_data(pinfo
->pool
, pinfo
, proto_bgp
, LINK_STATE_DATA_KEY
, data
);
3501 save_link_state_attr_position(packet_info
*pinfo
, int ostart
, int oend
, uint16_t tlen
, proto_tree
*subtree2
) {
3502 link_state_data
*data
=
3503 (link_state_data
*)p_get_proto_data(pinfo
->pool
, pinfo
, proto_bgp
, LINK_STATE_DATA_KEY
);
3505 data
= wmem_new0(pinfo
->pool
, link_state_data
);
3506 data
->protocol_id
= BGP_LS_NLRI_PROTO_ID_UNKNOWN
;
3508 data
->ostart
= ostart
;
3511 data
->link_state_attr_present
= true;
3512 data
->subtree2
= subtree2
;
3513 p_add_proto_data(pinfo
->pool
, pinfo
, proto_bgp
, LINK_STATE_DATA_KEY
, data
);
3517 static link_state_data
*
3518 load_link_state_data(packet_info
*pinfo
) {
3519 link_state_data
*data
=
3520 (link_state_data
*)p_get_proto_data(pinfo
->pool
, pinfo
, proto_bgp
, LINK_STATE_DATA_KEY
);
3524 typedef struct _path_attr_data
{
3525 bool encaps_community_present
;
3526 uint16_t encaps_tunnel_type
;
3529 #define PATH_ATTR_DATA_KEY 1
3532 save_path_attr_encaps_tunnel_type(packet_info
*pinfo
, uint32_t encaps_tunnel_type
) {
3533 path_attr_data
*data
=
3534 (path_attr_data
*)p_get_proto_data(wmem_file_scope(), pinfo
, proto_bgp
, PATH_ATTR_DATA_KEY
);
3536 data
= wmem_new0(wmem_file_scope(), path_attr_data
);
3538 data
->encaps_community_present
= true;
3539 data
->encaps_tunnel_type
= encaps_tunnel_type
;
3540 p_add_proto_data(wmem_file_scope(), pinfo
, proto_bgp
, PATH_ATTR_DATA_KEY
, data
);
3544 static path_attr_data
*
3545 load_path_attr_data(packet_info
*pinfo
) {
3546 path_attr_data
*data
=
3547 (path_attr_data
*)p_get_proto_data(wmem_file_scope(), pinfo
, proto_bgp
, PATH_ATTR_DATA_KEY
);
3551 typedef struct _afi_safi_data
{
3553 uint8_t safi
; /* offset at which the LINK_STATE path attribute starts */
3556 #define AFI_SAFI_DATA_KEY 2
3559 save_afi_safi_data(packet_info
*pinfo
, uint16_t afi
, uint8_t safi
) {
3560 afi_safi_data
*data
=
3561 (afi_safi_data
*)p_get_proto_data(wmem_file_scope(), pinfo
, proto_bgp
, AFI_SAFI_DATA_KEY
);
3563 data
= wmem_new0(wmem_file_scope(), afi_safi_data
);
3567 p_add_proto_data(wmem_file_scope(), pinfo
, proto_bgp
, AFI_SAFI_DATA_KEY
, data
);
3571 static afi_safi_data
*
3572 load_afi_safi_data(packet_info
*pinfo
) {
3573 afi_safi_data
*data
=
3574 (afi_safi_data
*)p_get_proto_data(wmem_file_scope(), pinfo
, proto_bgp
, AFI_SAFI_DATA_KEY
);
3579 * Detect IPv4/IPv6 prefixes conform to BGP Additional Path but NOT conform to standard BGP
3581 * A real BGP speaker would rely on the BGP Additional Path in the BGP Open messages.
3582 * But it is not suitable for a packet analyse because the BGP sessions are not supposed to
3583 * restart very often, and Open messages from both sides of the session would be needed
3584 * to determine the result of the capability negotiation.
3585 * Code inspired from the decode_prefix4 function
3588 detect_add_path_prefix46(tvbuff_t
*tvb
, int offset
, int end
, int max_bit_length
) {
3592 /* Must be compatible with BGP Additional Path */
3593 for (o
= offset
+ 4; o
< end
; o
+= 4) {
3594 prefix_len
= tvb_get_uint8(tvb
, o
);
3595 if( prefix_len
> max_bit_length
) {
3596 return 0; /* invalid prefix length - not BGP add-path */
3598 addr_len
= (prefix_len
+ 7) / 8;
3601 return 0; /* invalid offset - not BGP add-path */
3603 if (prefix_len
% 8) {
3604 /* detect bits set after the end of the prefix */
3605 if( tvb_get_uint8(tvb
, o
- 1 ) & (0xFF >> (prefix_len
% 8)) ) {
3606 return 0; /* invalid prefix content - not BGP add-path */
3610 /* Must NOT be compatible with standard BGP */
3611 for (o
= offset
; o
< end
; ) {
3612 prefix_len
= tvb_get_uint8(tvb
, o
);
3613 if( prefix_len
== 0 && end
- offset
> 1 ) {
3614 return 1; /* prefix length is zero (i.e. matching all IP prefixes) and remaining bytes within the NLRI is greater than or equal to 1 - may be BGP add-path */
3616 if( prefix_len
> max_bit_length
) {
3617 return 1; /* invalid prefix length - may be BGP add-path */
3619 addr_len
= (prefix_len
+ 7) / 8;
3622 return 1; /* invalid offset - may be BGP add-path */
3624 if (prefix_len
% 8) {
3625 /* detect bits set after the end of the prefix */
3626 if( tvb_get_uint8(tvb
, o
- 1 ) & (0xFF >> (prefix_len
% 8)) ) {
3627 return 1; /* invalid prefix content - may be BGP add-path (or a bug) */
3631 return 0; /* valid - do not assume Additional Path */
3634 detect_add_path_prefix4(tvbuff_t
*tvb
, int offset
, int end
) {
3635 return detect_add_path_prefix46(tvb
, offset
, end
, 32);
3638 detect_add_path_prefix6(tvbuff_t
*tvb
, int offset
, int end
) {
3639 return detect_add_path_prefix46(tvb
, offset
, end
, 128);
3642 * Decode an IPv4 prefix with Path Identifier
3643 * Code inspired from the decode_prefix4 function
3646 decode_path_prefix4(proto_tree
*tree
, packet_info
*pinfo
, int hf_path_id
, int hf_addr
, tvbuff_t
*tvb
, int offset
,
3649 proto_tree
*prefix_tree
;
3650 ws_in4_addr ip_addr
; /* IP address */
3651 uint8_t plen
; /* prefix length */
3652 int length
; /* number of octets needed for prefix */
3653 uint32_t path_identifier
;
3656 /* snarf path identifier length and prefix */
3657 path_identifier
= tvb_get_ntohl(tvb
, offset
);
3658 plen
= tvb_get_uint8(tvb
, offset
+ 4);
3659 length
= tvb_get_ipv4_addr_with_prefix_len(tvb
, offset
+ 4 + 1, &ip_addr
, plen
);
3661 proto_tree_add_expert_format(tree
, pinfo
, &ei_bgp_length_invalid
, tvb
, offset
+ 4 , 1, "%s length %u invalid (> 32)",
3665 /* put prefix into protocol tree */
3666 set_address(&addr
, AT_IPv4
, 4, &ip_addr
);
3667 prefix_tree
= proto_tree_add_subtree_format(tree
, tvb
, offset
, 4 + 1 + length
,
3668 ett_bgp_prefix
, NULL
, "%s/%u PathId %u ",
3669 address_to_str(pinfo
->pool
, &addr
), plen
, path_identifier
);
3670 proto_tree_add_item(prefix_tree
, hf_path_id
, tvb
, offset
, 4, ENC_BIG_ENDIAN
);
3671 proto_tree_add_item(prefix_tree
, hf_bgp_prefix_length
, tvb
, offset
+ 4, 1, ENC_BIG_ENDIAN
);
3672 proto_tree_add_ipv4(prefix_tree
, hf_addr
, tvb
, offset
+ 4 + 1, length
, ip_addr
);
3673 return 4 + 1 + length
;
3677 * Decode an IPv4 prefix.
3680 decode_prefix4(proto_tree
*tree
, packet_info
*pinfo
, proto_item
*parent_item
, int hf_addr
, tvbuff_t
*tvb
, int offset
,
3683 proto_tree
*prefix_tree
;
3684 ws_in4_addr ip_addr
; /* IP address */
3685 uint8_t plen
; /* prefix length */
3686 int length
; /* number of octets needed for prefix */
3689 /* snarf length and prefix */
3690 plen
= tvb_get_uint8(tvb
, offset
);
3691 length
= tvb_get_ipv4_addr_with_prefix_len(tvb
, offset
+ 1, &ip_addr
, plen
);
3693 proto_tree_add_expert_format(tree
, pinfo
, &ei_bgp_length_invalid
, tvb
, offset
, 1, "%s length %u invalid (> 32)",
3698 /* put prefix into protocol tree */
3699 set_address(&addr
, AT_IPv4
, 4, &ip_addr
);
3700 prefix_tree
= proto_tree_add_subtree_format(tree
, tvb
, offset
,
3701 1 + length
, ett_bgp_prefix
, NULL
,
3702 "%s/%u", address_to_str(pinfo
->pool
, &addr
), plen
);
3704 proto_item_append_text(parent_item
, " (%s/%u)",
3705 address_to_str(pinfo
->pool
, &addr
), plen
);
3707 proto_tree_add_uint_format(prefix_tree
, hf_bgp_prefix_length
, tvb
, offset
, 1, plen
, "%s prefix length: %u",
3709 proto_tree_add_ipv4(prefix_tree
, hf_addr
, tvb
, offset
+ 1, length
, ip_addr
);
3714 * Decode an IPv6 prefix with path ID.
3717 decode_path_prefix6(proto_tree
*tree
, packet_info
*pinfo
, int hf_path_id
, int hf_addr
, tvbuff_t
*tvb
, int offset
,
3720 proto_tree
*prefix_tree
;
3721 uint32_t path_identifier
;
3722 ws_in6_addr addr
; /* IPv6 address */
3724 int plen
; /* prefix length */
3725 int length
; /* number of octets needed for prefix */
3727 /* snarf length and prefix */
3728 path_identifier
= tvb_get_ntohl(tvb
, offset
);
3729 plen
= tvb_get_uint8(tvb
, offset
+ 4);
3730 length
= tvb_get_ipv6_addr_with_prefix_len(tvb
, offset
+ 4 + 1, &addr
, plen
);
3732 proto_tree_add_expert_format(tree
, pinfo
, &ei_bgp_length_invalid
, tvb
, offset
+ 4, 1, "%s length %u invalid",
3737 /* put prefix into protocol tree */
3738 set_address(&addr_str
, AT_IPv6
, 16, addr
.bytes
);
3739 prefix_tree
= proto_tree_add_subtree_format(tree
, tvb
, offset
, 4 + 1 + length
,
3740 ett_bgp_prefix
, NULL
, "%s/%u PathId %u ",
3741 address_to_str(pinfo
->pool
, &addr_str
), plen
, path_identifier
);
3743 proto_tree_add_item(prefix_tree
, hf_path_id
, tvb
, offset
, 4, ENC_BIG_ENDIAN
);
3744 proto_tree_add_uint_format(prefix_tree
, hf_bgp_prefix_length
, tvb
, offset
+ 4, 1, plen
, "%s prefix length: %u",
3746 proto_tree_add_ipv6(prefix_tree
, hf_addr
, tvb
, offset
+ 4 + 1, length
, &addr
);
3748 return 4 + 1 + length
;
3752 * Decode an IPv6 prefix.
3755 decode_prefix6(proto_tree
*tree
, packet_info
*pinfo
, int hf_addr
, tvbuff_t
*tvb
, int offset
,
3756 uint16_t tlen
, const char *tag
)
3758 proto_tree
*prefix_tree
;
3759 ws_in6_addr addr
; /* IPv6 address */
3761 int plen
; /* prefix length */
3762 int length
; /* number of octets needed for prefix */
3764 /* snarf length and prefix */
3765 plen
= tvb_get_uint8(tvb
, offset
);
3766 length
= tvb_get_ipv6_addr_with_prefix_len(tvb
, offset
+ 1, &addr
, plen
);
3768 proto_tree_add_expert_format(tree
, pinfo
, &ei_bgp_length_invalid
, tvb
, offset
, 1, "%s length %u invalid",
3773 /* put prefix into protocol tree */
3774 set_address(&addr_str
, AT_IPv6
, 16, addr
.bytes
);
3775 prefix_tree
= proto_tree_add_subtree_format(tree
, tvb
, offset
,
3776 tlen
!= 0 ? tlen
: 1 + length
, ett_bgp_prefix
, NULL
, "%s/%u",
3777 address_to_str(pinfo
->pool
, &addr_str
), plen
);
3778 proto_tree_add_uint_format(prefix_tree
, hf_bgp_prefix_length
, tvb
, offset
, 1, plen
, "%s prefix length: %u",
3780 proto_tree_add_ipv6(prefix_tree
, hf_addr
, tvb
, offset
+ 1, length
, &addr
);
3785 decode_fspec_match_prefix6(proto_tree
*tree
, proto_item
*parent_item
, int hf_addr
,
3786 tvbuff_t
*tvb
, int offset
, uint16_t tlen
, packet_info
*pinfo
)
3788 proto_tree
*prefix_tree
;
3789 ws_in6_addr addr
; /* IPv6 address */
3791 int plen
; /* prefix length */
3792 int length
; /* number of octets needed for prefix */
3793 int poffset_place
= 1;
3794 int plength_place
= 0;
3796 /* snarf length and prefix */
3797 plen
= tvb_get_uint8(tvb
, offset
);
3798 if (plen
== 0) /* I should be facing a draft 04 version where the prefix offset is switched with length */
3800 plen
= tvb_get_uint8(tvb
, offset
+1);
3804 length
= tvb_get_ipv6_addr_with_prefix_len(tvb
, offset
+ 2, &addr
, plen
);
3806 expert_add_info_format(pinfo
, parent_item
, &ei_bgp_prefix_length_err
, "Length is invalid %u", plen
);
3810 /* put prefix into protocol tree */
3811 set_address(&addr_str
, AT_IPv6
, 16, addr
.bytes
);
3812 prefix_tree
= proto_tree_add_subtree_format(tree
, tvb
, offset
,
3813 tlen
!= 0 ? tlen
: 1 + length
, ett_bgp_prefix
, NULL
, "%s/%u",
3814 address_to_str(pinfo
->pool
, &addr_str
), plen
);
3815 proto_tree_add_item(prefix_tree
, hf_bgp_flowspec_nlri_ipv6_pref_len
, tvb
, offset
+ plength_place
, 1, ENC_BIG_ENDIAN
);
3816 proto_tree_add_item(prefix_tree
, hf_bgp_flowspec_nlri_ipv6_pref_offset
, tvb
, offset
+ poffset_place
, 1, ENC_BIG_ENDIAN
);
3817 proto_tree_add_ipv6(prefix_tree
, hf_addr
, tvb
, offset
+ 2, length
, &addr
);
3818 if (parent_item
!= NULL
)
3819 proto_item_append_text(parent_item
, " (%s/%u)",
3820 address_to_str(pinfo
->pool
, &addr_str
), plen
);
3825 decode_bgp_rd(wmem_allocator_t
*pool
, tvbuff_t
*tvb
, int offset
)
3828 wmem_strbuf_t
*strbuf
;
3830 rd_type
= tvb_get_ntohs(tvb
,offset
);
3831 strbuf
= wmem_strbuf_create(pool
);
3834 case FORMAT_AS2_LOC
:
3835 wmem_strbuf_append_printf(strbuf
, "%u:%u", tvb_get_ntohs(tvb
, offset
+ 2),
3836 tvb_get_ntohl(tvb
, offset
+ 4));
3839 wmem_strbuf_append_printf(strbuf
, "%s:%u", tvb_ip_to_str(pool
, tvb
, offset
+ 2),
3840 tvb_get_ntohs(tvb
, offset
+ 6));
3842 case FORMAT_AS4_LOC
:
3843 wmem_strbuf_append_printf(strbuf
, "%u:%u", tvb_get_ntohl(tvb
, offset
+ 2),
3844 tvb_get_ntohs(tvb
, offset
+ 6));
3847 wmem_strbuf_append_printf(strbuf
, "Unknown (0x%04x) RD type",rd_type
);
3849 } /* switch (rd_type) */
3851 return wmem_strbuf_get_str(strbuf
);
3855 decode_mcast_vpn_nlri_addresses(proto_tree
*tree
, tvbuff_t
*tvb
,
3860 /* Multicast Source Address */
3861 proto_tree_add_item(tree
, hf_bgp_mcast_vpn_nlri_source_length
, tvb
, offset
,
3863 addr_len
= tvb_get_uint8(tvb
, offset
);
3864 if (addr_len
!= 0 && addr_len
!= 32 && addr_len
!= 128)
3869 proto_tree_add_item(tree
, hf_bgp_mcast_vpn_nlri_source_addr_ipv4
, tvb
,
3870 offset
, 4, ENC_BIG_ENDIAN
);
3874 proto_tree_add_item(tree
, hf_bgp_mcast_vpn_nlri_source_addr_ipv6
, tvb
,
3875 offset
, 16, ENC_NA
);
3880 /* Multicast Group Address */
3881 proto_tree_add_item(tree
, hf_bgp_mcast_vpn_nlri_group_length
, tvb
, offset
,
3883 addr_len
= tvb_get_uint8(tvb
, offset
);
3884 if (addr_len
!= 0 && addr_len
!= 32 && addr_len
!= 128)
3889 proto_tree_add_item(tree
, hf_bgp_mcast_vpn_nlri_group_addr_ipv4
, tvb
,
3890 offset
, 4, ENC_BIG_ENDIAN
);
3894 proto_tree_add_item(tree
, hf_bgp_mcast_vpn_nlri_group_addr_ipv6
, tvb
,
3895 offset
, 16, ENC_NA
);
3904 * function to decode operator in BGP flow spec NLRI when it address decimal values (TCP ports, UDP ports, ports, ...)
3908 decode_bgp_flow_spec_dec_operator(proto_tree
*tree
, tvbuff_t
*tvb
, int offset
)
3910 static int * const flags
[] = {
3911 &hf_bgp_flowspec_nlri_op_eol
,
3912 &hf_bgp_flowspec_nlri_op_and
,
3913 &hf_bgp_flowspec_nlri_op_val_len
,
3914 &hf_bgp_flowspec_nlri_op_un_bit4
,
3915 &hf_bgp_flowspec_nlri_op_lt
,
3916 &hf_bgp_flowspec_nlri_op_gt
,
3917 &hf_bgp_flowspec_nlri_op_eq
,
3921 proto_tree_add_bitmask(tree
, tvb
, offset
, hf_bgp_flowspec_nlri_op_flags
, ett_bgp_flow_spec_nlri_op_flags
, flags
, ENC_NA
);
3925 * Decode an operator and decimal values of BGP flow spec NLRI
3928 decode_bgp_nlri_op_dec_value(proto_tree
*parent_tree
, proto_item
*parent_item
, tvbuff_t
*tvb
, int offset
)
3930 uint8_t nlri_operator
;
3931 unsigned cursor_op_val
=0;
3932 uint8_t value_len
=0;
3934 uint8_t shift_amount
=0;
3935 unsigned first_loop
=0;
3937 proto_item_append_text(parent_item
," (");
3940 nlri_operator
= tvb_get_uint8(tvb
, offset
+cursor_op_val
);
3941 shift_amount
= nlri_operator
&0x30;
3942 shift_amount
= shift_amount
>> 4;
3943 value_len
= 1 << shift_amount
; /* as written in RFC 5575 section 4 */
3944 /* call to a operator decode function */
3945 decode_bgp_flow_spec_dec_operator(parent_tree
, tvb
, offset
+cursor_op_val
);
3946 if (first_loop
== 0)
3948 /* If first operator we remove a white space and or (||) is not relevant */
3949 /* BGP flow spec NLRI operator bitmask */
3950 proto_item_append_text(parent_item
,"%s%s%s%s",
3951 ((nlri_operator
& BGPNLRI_FSPEC_AND_BIT
) == 0) ? "" : "&& ",
3952 ((nlri_operator
& BGPNLRI_FSPEC_GREATER_THAN
) == 0) ? "" : ">",
3953 ((nlri_operator
& BGPNLRI_FSPEC_LESS_THAN
) == 0) ? "" : "<",
3954 ((nlri_operator
& BGPNLRI_FSPEC_EQUAL
) == 0) ? "" : "=");
3959 proto_item_append_text(parent_item
," %s%s%s%s",
3960 ((nlri_operator
& BGPNLRI_FSPEC_AND_BIT
) == 0) ? "|| " : "&& ",
3961 ((nlri_operator
& BGPNLRI_FSPEC_GREATER_THAN
) == 0) ? "" : ">",
3962 ((nlri_operator
& BGPNLRI_FSPEC_LESS_THAN
) == 0) ? "" : "<",
3963 ((nlri_operator
& BGPNLRI_FSPEC_EQUAL
) == 0) ? "" : "=");
3965 cursor_op_val
++; /* we manage this operator we move to the value */
3966 switch (value_len
) {
3968 proto_tree_add_item(parent_tree
, hf_bgp_flowspec_nlri_dec_val_8
, tvb
, offset
+cursor_op_val
, 1,ENC_BIG_ENDIAN
);
3969 value
= tvb_get_uint8(tvb
,offset
+cursor_op_val
);
3972 proto_tree_add_item(parent_tree
, hf_bgp_flowspec_nlri_dec_val_16
, tvb
, offset
+cursor_op_val
, 2,ENC_BIG_ENDIAN
);
3973 value
= tvb_get_ntohs(tvb
,offset
+cursor_op_val
);
3976 proto_tree_add_item(parent_tree
, hf_bgp_flowspec_nlri_dec_val_32
, tvb
, offset
+cursor_op_val
, 4, ENC_BIG_ENDIAN
);
3977 value
= tvb_get_ntohl(tvb
,offset
+cursor_op_val
);
3980 proto_tree_add_item(parent_tree
, hf_bgp_flowspec_nlri_dec_val_64
, tvb
, offset
+cursor_op_val
, 8, ENC_BIG_ENDIAN
);
3985 cursor_op_val
= cursor_op_val
+ value_len
;
3986 proto_item_append_text(parent_item
,"%u", value
);
3987 } while ((nlri_operator
&BGPNLRI_FSPEC_END_OF_LST
) == 0);
3988 proto_item_append_text(parent_item
,")");
3989 return (cursor_op_val
);
3994 * function to decode operator in BGP flow spec NLRI when it address a bitmask values (TCP flags, fragmentation flags,...)
3998 decode_bgp_flow_spec_bitmask_operator(proto_tree
*tree
, tvbuff_t
*tvb
, int offset
)
4000 static int * const flags
[] = {
4001 &hf_bgp_flowspec_nlri_op_eol
,
4002 &hf_bgp_flowspec_nlri_op_and
,
4003 &hf_bgp_flowspec_nlri_op_val_len
,
4004 &hf_bgp_flowspec_nlri_op_un_bit4
,
4005 &hf_bgp_flowspec_nlri_op_un_bit5
,
4006 &hf_bgp_flowspec_nlri_op_flg_not
,
4007 &hf_bgp_flowspec_nlri_op_flg_match
,
4011 proto_tree_add_bitmask(tree
, tvb
, offset
, hf_bgp_flowspec_nlri_op_flags
, ett_bgp_flow_spec_nlri_op_flags
, flags
, ENC_NA
);
4015 * Decode an operator and tcp flags bitmask of BGP flow spec NLRI
4018 decode_bgp_nlri_op_tcpf_value(proto_tree
*parent_tree
, proto_item
*parent_item
, tvbuff_t
*tvb
, int offset
)
4020 uint8_t nlri_operator
;
4022 unsigned cursor_op_val
=0;
4023 uint8_t value_len
=0;
4024 uint8_t shift_amount
=0;
4025 unsigned first_loop
=0;
4027 static int * const nlri_tcp_flags
[] = {
4028 &hf_bgp_flowspec_nlri_tcp_flags_cwr
,
4029 &hf_bgp_flowspec_nlri_tcp_flags_ecn
,
4030 &hf_bgp_flowspec_nlri_tcp_flags_urg
,
4031 &hf_bgp_flowspec_nlri_tcp_flags_ack
,
4032 &hf_bgp_flowspec_nlri_tcp_flags_push
,
4033 &hf_bgp_flowspec_nlri_tcp_flags_reset
,
4034 &hf_bgp_flowspec_nlri_tcp_flags_syn
,
4035 &hf_bgp_flowspec_nlri_tcp_flags_fin
,
4039 proto_item_append_text(parent_item
," (");
4042 nlri_operator
= tvb_get_uint8(tvb
, offset
+cursor_op_val
);
4043 shift_amount
= nlri_operator
&0x30;
4044 shift_amount
= shift_amount
>> 4;
4045 value_len
= 1 << shift_amount
; /* as written in RFC 5575 section 4 */
4046 decode_bgp_flow_spec_bitmask_operator(parent_tree
, tvb
, offset
+cursor_op_val
); /* call to a operator decode function */
4047 if (first_loop
== 0)
4049 /* If first operator we remove a white space and or (||) is not relevant */
4050 proto_item_append_text(parent_item
,"%s%s%s%s",
4051 ((nlri_operator
& BGPNLRI_FSPEC_AND_BIT
) == 0) ? "" : "&& ",
4052 ((nlri_operator
& BGPNLRI_FSPEC_GREATER_THAN
) == 0) ? "" : ">",
4053 ((nlri_operator
& BGPNLRI_FSPEC_LESS_THAN
) == 0) ? "" : "<",
4054 ((nlri_operator
& BGPNLRI_FSPEC_EQUAL
) == 0) ? "" : "=");
4059 proto_item_append_text(parent_item
," %s%s%s%s",
4060 ((nlri_operator
& BGPNLRI_FSPEC_AND_BIT
) == 0) ? "|| " : "&& ",
4061 ((nlri_operator
& BGPNLRI_FSPEC_GREATER_THAN
) == 0) ? "" : ">",
4062 ((nlri_operator
& BGPNLRI_FSPEC_LESS_THAN
) == 0) ? "" : "<",
4063 ((nlri_operator
& BGPNLRI_FSPEC_EQUAL
) == 0) ? "" : "=");
4065 cursor_op_val
++; /* we manage this operator we move to the value */
4066 if (value_len
== 2) {
4067 cursor_op_val
++; /* tcp flags are coded over 2 bytes only the second one is significant, we move to second byte */
4070 proto_tree_add_bitmask(parent_tree
, tvb
, offset
+cursor_op_val
, hf_bgp_flowspec_nlri_tcp_flags
, ett_bgp_flow_spec_nlri_tcp
, nlri_tcp_flags
, ENC_NA
);
4071 tcp_flags
= tvb_get_uint8(tvb
,offset
+cursor_op_val
);
4073 proto_item_append_text(parent_item
," %s%s%s%s%s%s",
4074 ((tcp_flags
& BGPNLRI_FSPEC_TH_URG
) == 0) ? "" : "U",
4075 ((tcp_flags
& BGPNLRI_FSPEC_TH_ACK
) == 0) ? "" : "A",
4076 ((tcp_flags
& BGPNLRI_FSPEC_TH_PUSH
) == 0) ? "" : "P",
4077 ((tcp_flags
& BGPNLRI_FSPEC_TH_RST
) == 0) ? "" : "R",
4078 ((tcp_flags
& BGPNLRI_FSPEC_TH_SYN
) == 0) ? "" : "S",
4079 ((tcp_flags
& BGPNLRI_FSPEC_TH_FIN
) == 0) ? "" : "F");
4080 cursor_op_val
= cursor_op_val
+ value_len
;
4081 } while ((nlri_operator
&BGPNLRI_FSPEC_END_OF_LST
) == 0);
4082 proto_item_append_text(parent_item
,")");
4083 return (cursor_op_val
);
4088 * Decode an operator and fragmentation bitmask of BGP flow spec NLRI
4091 decode_bgp_nlri_op_fflag_value(proto_tree
*parent_tree
, proto_item
*parent_item
, tvbuff_t
*tvb
, int offset
)
4093 uint8_t nlri_operator
;
4094 uint8_t fragment_flags
;
4095 unsigned cursor_op_val
=0;
4096 uint8_t value_len
=0;
4097 uint8_t shift_amount
=0;
4098 unsigned first_loop
=0;
4100 static int * const nlri_flags
[] = {
4101 &hf_bgp_flowspec_nlri_fflag_lf
,
4102 &hf_bgp_flowspec_nlri_fflag_ff
,
4103 &hf_bgp_flowspec_nlri_fflag_isf
,
4104 &hf_bgp_flowspec_nlri_fflag_df
,
4108 proto_item_append_text(parent_item
," (");
4111 nlri_operator
= tvb_get_uint8(tvb
, offset
+cursor_op_val
);
4112 shift_amount
= nlri_operator
&0x30;
4113 shift_amount
= shift_amount
>> 4;
4114 value_len
= 1 << shift_amount
; /* as written in RFC 5575 section 4 */
4115 /* call a function to decode operator addressing bitmask */
4116 decode_bgp_flow_spec_bitmask_operator(parent_tree
, tvb
, offset
+cursor_op_val
);
4117 if (first_loop
== 0)
4119 /* If first operator we remove a white space and or (||) is not relevant */
4120 proto_item_append_text(parent_item
,"%s%s%s%s",
4121 ((nlri_operator
& BGPNLRI_FSPEC_AND_BIT
) == 0) ? "" : "&& ",
4122 ((nlri_operator
& BGPNLRI_FSPEC_GREATER_THAN
) == 0) ? "" : ">",
4123 ((nlri_operator
& BGPNLRI_FSPEC_LESS_THAN
) == 0) ? "" : "<",
4124 ((nlri_operator
& BGPNLRI_FSPEC_EQUAL
) == 0) ? "" : "=");
4129 proto_item_append_text(parent_item
," %s%s%s%s",
4130 ((nlri_operator
& BGPNLRI_FSPEC_AND_BIT
) == 0) ? "|| " : "&& ",
4131 ((nlri_operator
& BGPNLRI_FSPEC_GREATER_THAN
) == 0) ? "" : ">",
4132 ((nlri_operator
& BGPNLRI_FSPEC_LESS_THAN
) == 0) ? "" : "<",
4133 ((nlri_operator
& BGPNLRI_FSPEC_EQUAL
) == 0) ? "" : "=");
4135 cursor_op_val
++; /* we manage this operator we move to the value */
4136 if (value_len
!= 1) {
4137 return -1; /* frag flags have to be coded in 1 byte */
4139 fragment_flags
= tvb_get_uint8(tvb
,offset
+cursor_op_val
);
4141 proto_tree_add_bitmask(parent_tree
, tvb
, offset
+cursor_op_val
, hf_bgp_flowspec_nlri_fflag
, ett_bgp_flow_spec_nlri_ff
, nlri_flags
, ENC_NA
);
4143 proto_item_append_text(parent_item
," %s%s%s%s",
4144 ((fragment_flags
& BGPNLRI_FSPEC_FG_DF
) == 0) ? "" : "DF",
4145 ((fragment_flags
& BGPNLRI_FSPEC_FG_ISF
) == 0) ? "" : "IsF",
4146 ((fragment_flags
& BGPNLRI_FSPEC_FG_FF
) == 0) ? "" : "FF",
4147 ((fragment_flags
& BGPNLRI_FSPEC_FG_LF
) == 0) ? "" : "LF");
4148 cursor_op_val
= cursor_op_val
+ value_len
;
4149 } while ((nlri_operator
&BGPNLRI_FSPEC_END_OF_LST
) == 0);
4150 proto_item_append_text(parent_item
,")");
4151 return (cursor_op_val
);
4155 * Decode an operator and DSCP value of BGP flow spec NLRI
4158 decode_bgp_nlri_op_dscp_value(proto_tree
*parent_tree
, proto_item
*parent_item
, tvbuff_t
*tvb
, int offset
)
4160 uint8_t nlri_operator
;
4162 unsigned cursor_op_val
=0;
4163 uint8_t value_len
=0;
4164 uint8_t shift_amount
=0;
4165 unsigned first_loop
=0;
4167 proto_item_append_text(parent_item
," (");
4170 nlri_operator
= tvb_get_uint8(tvb
, offset
+cursor_op_val
);
4171 shift_amount
= nlri_operator
&0x30;
4172 shift_amount
= shift_amount
>> 4;
4173 value_len
= 1 << shift_amount
; /* as written in RFC 5575 section 4 */
4174 /* call a function to decode operator addressing bitmask */
4175 decode_bgp_flow_spec_bitmask_operator(parent_tree
, tvb
, offset
+cursor_op_val
);
4176 if (first_loop
== 0)
4178 /* If first operator we remove a white space and or (||) is not relevant */
4179 proto_item_append_text(parent_item
,"%s%s%s%s",
4180 ((nlri_operator
& BGPNLRI_FSPEC_AND_BIT
) == 0) ? "" : "&& ",
4181 ((nlri_operator
& BGPNLRI_FSPEC_GREATER_THAN
) == 0) ? "" : ">",
4182 ((nlri_operator
& BGPNLRI_FSPEC_LESS_THAN
) == 0) ? "" : "<",
4183 ((nlri_operator
& BGPNLRI_FSPEC_EQUAL
) == 0) ? "" : "=");
4188 proto_item_append_text(parent_item
," %s%s%s%s",
4189 ((nlri_operator
& BGPNLRI_FSPEC_AND_BIT
) == 0) ? "|| " : "&& ",
4190 ((nlri_operator
& BGPNLRI_FSPEC_GREATER_THAN
) == 0) ? "" : ">",
4191 ((nlri_operator
& BGPNLRI_FSPEC_LESS_THAN
) == 0) ? "" : "<",
4192 ((nlri_operator
& BGPNLRI_FSPEC_EQUAL
) == 0) ? "" : "=");
4194 cursor_op_val
++; /* we manage this operator we move to the value */
4195 if (value_len
!= 1) {
4196 return -1; /* frag flags have to be coded in 1 byte */
4198 dscp_flags
= tvb_get_uint8(tvb
,offset
+cursor_op_val
);
4199 proto_tree_add_item(parent_tree
, hf_bgp_flowspec_nlri_dscp
, tvb
, offset
+cursor_op_val
, 1, ENC_BIG_ENDIAN
);
4200 proto_item_append_text(parent_item
,"%s",val_to_str_ext_const(dscp_flags
,&dscp_vals_ext
, "Unknown DSCP"));
4201 cursor_op_val
= cursor_op_val
+ value_len
;
4202 } while ((nlri_operator
&BGPNLRI_FSPEC_END_OF_LST
) == 0);
4203 proto_item_append_text(parent_item
,")");
4204 return (cursor_op_val
);
4210 * Decode an FLOWSPEC nlri as define in RFC 5575
4213 decode_flowspec_nlri(proto_tree
*tree
, tvbuff_t
*tvb
, int offset
, uint16_t afi
, uint8_t safi
, packet_info
*pinfo
)
4215 unsigned tot_flow_len
; /* total length of the flow spec NLRI */
4216 unsigned offset_len
; /* offset of the flow spec NLRI itself could be 1 or 2 bytes */
4217 unsigned cursor_fspec
; /* cursor to move into flow spec nlri */
4218 int filter_len
= -1;
4222 proto_item
*filter_item
;
4223 proto_item
*disting_item
;
4224 proto_tree
*nlri_tree
;
4225 proto_tree
*disting_tree
;
4226 proto_tree
*filter_tree
;
4229 if (afi
!= AFNUM_INET
&& afi
!= AFNUM_INET6
)
4231 expert_add_info(pinfo
, NULL
, &ei_bgp_afi_type_not_supported
);
4235 tot_flow_len
= tvb_get_uint8(tvb
, offset
);
4236 /* if nlri length is greater than 240 bytes, it is encoded over 2 bytes */
4237 /* with most significant nibble all in one. 240 is encoded 0xf0f0, 241 0xf0f1 */
4238 /* max possible value value is 4095 Oxffff */
4240 if (tot_flow_len
>= 240)
4242 len_16
= tvb_get_ntohs(tvb
, offset
);
4243 tot_flow_len
= len_16
& 0x0FFF; /* remove most significant nibble */
4249 item
= proto_tree_add_item(tree
, hf_bgp_flowspec_nlri_t
, tvb
, offset
,
4250 tot_flow_len
+offset_len
, ENC_NA
);
4251 proto_item_set_text(item
, "FLOW_SPEC_NLRI (%u byte%s)",
4252 tot_flow_len
+offset_len
, plurality(tot_flow_len
+offset_len
, "", "s"));
4254 nlri_tree
= proto_item_add_subtree(item
, ett_bgp_flow_spec_nlri
);
4256 proto_tree_add_uint(nlri_tree
, hf_bgp_flowspec_nlri_length
, tvb
, offset
,
4257 offset_len
, tot_flow_len
);
4259 offset
= offset
+ offset_len
;
4262 /* when SAFI is VPN Flow Spec, then write route distinguisher */
4263 if (safi
== SAFNUM_FSPEC_VPN_RULE
)
4265 disting_item
= proto_tree_add_item(nlri_tree
, hf_bgp_flowspec_nlri_route_distinguisher
,
4266 tvb
, offset
, BGP_ROUTE_DISTINGUISHER_SIZE
, ENC_NA
);
4267 disting_tree
= proto_item_add_subtree(disting_item
, ett_bgp_flow_spec_nlri
);
4268 proto_tree_add_item_ret_uint(disting_tree
, hf_bgp_flowspec_nlri_route_distinguisher_type
,
4269 tvb
, offset
, 2, ENC_BIG_ENDIAN
, &rd_type
);
4270 /* Route Distinguisher Type */
4272 case FORMAT_AS2_LOC
:
4273 proto_tree_add_item(disting_tree
, hf_bgp_flowspec_nlri_route_dist_admin_asnum_2
,
4274 tvb
, offset
+ 2, 2, ENC_BIG_ENDIAN
);
4275 proto_tree_add_item(disting_tree
, hf_bgp_flowspec_nlri_route_dist_asnum_4
,
4276 tvb
, offset
+ 4, 4, ENC_BIG_ENDIAN
);
4280 proto_tree_add_item(disting_tree
, hf_bgp_flowspec_nlri_route_dist_admin_ipv4
,
4281 tvb
, offset
+ 2, 4, ENC_BIG_ENDIAN
);
4282 proto_tree_add_item(disting_tree
, hf_bgp_flowspec_nlri_route_dist_asnum_2
,
4283 tvb
, offset
+ 6, 2, ENC_BIG_ENDIAN
);
4286 case FORMAT_AS4_LOC
:
4287 proto_tree_add_item(disting_tree
, hf_bgp_flowspec_nlri_route_dist_admin_asnum_4
,
4288 tvb
, offset
+ 2, 4, ENC_BIG_ENDIAN
);
4289 proto_tree_add_item(disting_tree
, hf_bgp_flowspec_nlri_route_dist_asnum_2
,
4290 tvb
, offset
+ 6, 2, ENC_BIG_ENDIAN
);
4294 expert_add_info_format(pinfo
, disting_tree
, &ei_bgp_length_invalid
,
4295 "Unknown Route Distinguisher type (%u)", rd_type
);
4297 cursor_fspec
+= BGP_ROUTE_DISTINGUISHER_SIZE
;
4300 while (cursor_fspec
< tot_flow_len
)
4302 filter_item
= proto_tree_add_item(nlri_tree
, hf_bgp_flowspec_nlri_filter
, tvb
, offset
+cursor_fspec
, 1, ENC_NA
);
4303 filter_tree
= proto_item_add_subtree(filter_item
, ett_bgp_flow_spec_nlri_filter
);
4304 proto_tree_add_item(filter_tree
, hf_bgp_flowspec_nlri_filter_type
, tvb
, offset
+cursor_fspec
, 1, ENC_BIG_ENDIAN
);
4305 proto_item_append_text(filter_item
, ": %s", val_to_str(tvb_get_uint8(tvb
,offset
+cursor_fspec
), flowspec_nlri_opvaluepair_type
, "Unknown filter %d"));
4306 switch (tvb_get_uint8(tvb
,offset
+cursor_fspec
)) {
4307 case BGPNLRI_FSPEC_DST_PFIX
:
4309 if (afi
== AFNUM_INET
)
4310 filter_len
= decode_prefix4(filter_tree
, pinfo
, filter_item
, hf_bgp_flowspec_nlri_dst_pref_ipv4
,
4311 tvb
, offset
+cursor_fspec
, "Destination IP filter");
4312 else /* AFNUM_INET6 */
4313 filter_len
= decode_fspec_match_prefix6(filter_tree
, filter_item
, hf_bgp_flowspec_nlri_dst_ipv6_pref
,
4314 tvb
, offset
+cursor_fspec
, 0, pinfo
);
4315 if (filter_len
== -1)
4316 cursor_fspec
= tot_flow_len
;
4318 case BGPNLRI_FSPEC_SRC_PFIX
:
4320 if (afi
== AFNUM_INET
)
4321 filter_len
= decode_prefix4(filter_tree
, pinfo
, filter_item
, hf_bgp_flowspec_nlri_src_pref_ipv4
,
4322 tvb
, offset
+cursor_fspec
, "Source IP filter");
4323 else /* AFNUM_INET6 */
4324 filter_len
= decode_fspec_match_prefix6(filter_tree
, filter_item
, hf_bgp_flowspec_nlri_src_ipv6_pref
,
4325 tvb
, offset
+cursor_fspec
, 0, pinfo
);
4326 if (filter_len
== -1)
4327 cursor_fspec
= tot_flow_len
;
4329 case BGPNLRI_FSPEC_IP_PROTO
:
4331 filter_len
= decode_bgp_nlri_op_dec_value(filter_tree
, filter_item
, tvb
, offset
+cursor_fspec
);
4333 case BGPNLRI_FSPEC_PORT
:
4335 filter_len
= decode_bgp_nlri_op_dec_value(filter_tree
, filter_item
, tvb
, offset
+cursor_fspec
);
4337 case BGPNLRI_FSPEC_DST_PORT
:
4339 filter_len
= decode_bgp_nlri_op_dec_value(filter_tree
, filter_item
, tvb
, offset
+cursor_fspec
);
4341 case BGPNLRI_FSPEC_SRC_PORT
:
4343 filter_len
= decode_bgp_nlri_op_dec_value(filter_tree
, filter_item
, tvb
, offset
+cursor_fspec
);
4345 case BGPNLRI_FSPEC_ICMP_TP
:
4347 filter_len
= decode_bgp_nlri_op_dec_value(filter_tree
, filter_item
, tvb
, offset
+cursor_fspec
);
4349 case BGPNLRI_FSPEC_ICMP_CD
:
4351 filter_len
= decode_bgp_nlri_op_dec_value(filter_tree
, filter_item
, tvb
, offset
+cursor_fspec
);
4353 case BGPNLRI_FSPEC_TCP_FLAGS
:
4355 filter_len
= decode_bgp_nlri_op_tcpf_value(filter_tree
, filter_item
, tvb
, offset
+cursor_fspec
);
4357 case BGPNLRI_FSPEC_PCK_LEN
:
4359 filter_len
= decode_bgp_nlri_op_dec_value(filter_tree
, filter_item
, tvb
, offset
+cursor_fspec
);
4361 case BGPNLRI_FSPEC_DSCP
:
4363 filter_len
= decode_bgp_nlri_op_dscp_value(filter_tree
, filter_item
, tvb
, offset
+cursor_fspec
);
4365 case BGPNLRI_FSPEC_FRAGMENT
:
4367 filter_len
= decode_bgp_nlri_op_fflag_value(filter_tree
, filter_item
, tvb
, offset
+cursor_fspec
);
4373 cursor_fspec
+= filter_len
;
4376 proto_item_set_len(filter_item
,filter_len
+1);
4378 return tot_flow_len
+offset_len
-1;
4382 * Decode an MCAST-VPN nlri as defined in draft-ietf-l3vpn-2547bis-mcast-bgp-08.txt .
4385 decode_mcast_vpn_nlri(proto_tree
*tree
, tvbuff_t
*tvb
, int offset
, uint16_t afi
, packet_info
*pinfo
)
4387 uint8_t route_type
, length
, ip_length
;
4389 proto_tree
*nlri_tree
;
4390 uint32_t route_key_length
;
4393 ip_length
= (afi
== AFNUM_INET
) ? 4 : 16;
4395 route_type
= tvb_get_uint8(tvb
, offset
);
4396 proto_tree_add_item(tree
, hf_bgp_mcast_vpn_nlri_route_type
, tvb
,
4397 offset
, 1, ENC_BIG_ENDIAN
);
4400 length
= tvb_get_uint8(tvb
, offset
);
4401 proto_tree_add_item(tree
, hf_bgp_mcast_vpn_nlri_length
, tvb
, offset
,
4405 if (length
> tvb_reported_length_remaining(tvb
, offset
))
4408 item
= proto_tree_add_item(tree
, hf_bgp_mcast_vpn_nlri_t
, tvb
, offset
,
4410 proto_item_set_text(item
, "%s (%u byte%s)",
4411 val_to_str_const(route_type
, mcast_vpn_route_type
, "Unknown"),
4412 length
, plurality(length
, "", "s"));
4414 nlri_tree
= proto_item_add_subtree(item
, ett_bgp_mcast_vpn_nlri
);
4416 switch (route_type
) {
4417 case MCAST_VPN_RTYPE_INTRA_AS_IPMSI_AD
:
4418 item
= proto_tree_add_item(nlri_tree
, hf_bgp_mcast_vpn_nlri_rd
, tvb
,
4419 offset
, BGP_ROUTE_DISTINGUISHER_SIZE
,
4421 proto_item_set_text(item
, "Route Distinguisher: %s",
4422 decode_bgp_rd(pinfo
->pool
, tvb
, offset
));
4423 offset
+= BGP_ROUTE_DISTINGUISHER_SIZE
;
4425 if (afi
== AFNUM_INET
)
4426 proto_tree_add_item(nlri_tree
,
4427 hf_bgp_mcast_vpn_nlri_origin_router_ipv4
,
4428 tvb
, offset
, ip_length
, ENC_BIG_ENDIAN
);
4430 proto_tree_add_item(nlri_tree
,
4431 hf_bgp_mcast_vpn_nlri_origin_router_ipv6
,
4432 tvb
, offset
, ip_length
, ENC_NA
);
4435 case MCAST_VPN_RTYPE_INTER_AS_IPMSI_AD
:
4436 item
= proto_tree_add_item(nlri_tree
, hf_bgp_mcast_vpn_nlri_rd
, tvb
,
4437 offset
, BGP_ROUTE_DISTINGUISHER_SIZE
,
4439 proto_item_set_text(item
, "Route Distinguisher: %s",
4440 decode_bgp_rd(pinfo
->pool
, tvb
, offset
));
4441 offset
+= BGP_ROUTE_DISTINGUISHER_SIZE
;
4443 proto_tree_add_item(nlri_tree
, hf_bgp_mcast_vpn_nlri_source_as
, tvb
,
4444 offset
, 4, ENC_BIG_ENDIAN
);
4447 case MCAST_VPN_RTYPE_SPMSI_AD
:
4448 item
= proto_tree_add_item(nlri_tree
, hf_bgp_mcast_vpn_nlri_rd
, tvb
,
4449 offset
, BGP_ROUTE_DISTINGUISHER_SIZE
,
4451 proto_item_set_text(item
, "Route Distinguisher: %s",
4452 decode_bgp_rd(pinfo
->pool
, tvb
, offset
));
4453 offset
+= BGP_ROUTE_DISTINGUISHER_SIZE
;
4455 ret
= decode_mcast_vpn_nlri_addresses(nlri_tree
, tvb
, offset
);
4461 if (afi
== AFNUM_INET
)
4462 proto_tree_add_item(nlri_tree
,
4463 hf_bgp_mcast_vpn_nlri_origin_router_ipv4
,
4464 tvb
, offset
, ip_length
, ENC_BIG_ENDIAN
);
4466 proto_tree_add_item(nlri_tree
,
4467 hf_bgp_mcast_vpn_nlri_origin_router_ipv6
,
4468 tvb
, offset
, ip_length
, ENC_NA
);
4471 case MCAST_VPN_RTYPE_LEAF_AD
:
4472 route_key_length
= length
- ip_length
;
4473 item
= proto_tree_add_item(nlri_tree
,
4474 hf_bgp_mcast_vpn_nlri_route_key
, tvb
,
4475 offset
, route_key_length
, ENC_NA
);
4476 proto_item_set_text(item
, "Route Key (%u byte%s)", route_key_length
,
4477 plurality(route_key_length
, "", "s"));
4478 offset
+= route_key_length
;
4480 if (afi
== AFNUM_INET
)
4481 proto_tree_add_item(nlri_tree
,
4482 hf_bgp_mcast_vpn_nlri_origin_router_ipv4
,
4483 tvb
, offset
, ip_length
, ENC_BIG_ENDIAN
);
4485 proto_tree_add_item(nlri_tree
,
4486 hf_bgp_mcast_vpn_nlri_origin_router_ipv6
,
4487 tvb
, offset
, ip_length
, ENC_NA
);
4490 case MCAST_VPN_RTYPE_SOURCE_ACTIVE_AD
:
4491 item
= proto_tree_add_item(nlri_tree
, hf_bgp_mcast_vpn_nlri_rd
, tvb
,
4492 offset
, BGP_ROUTE_DISTINGUISHER_SIZE
,
4494 proto_item_set_text(item
, "Route Distinguisher: %s",
4495 decode_bgp_rd(pinfo
->pool
, tvb
, offset
));
4496 offset
+= BGP_ROUTE_DISTINGUISHER_SIZE
;
4498 ret
= decode_mcast_vpn_nlri_addresses(nlri_tree
, tvb
, offset
);
4503 case MCAST_VPN_RTYPE_SHARED_TREE_JOIN
:
4504 case MCAST_VPN_RTYPE_SOURCE_TREE_JOIN
:
4505 item
= proto_tree_add_item(nlri_tree
, hf_bgp_mcast_vpn_nlri_rd
, tvb
,
4506 offset
, BGP_ROUTE_DISTINGUISHER_SIZE
,
4508 proto_item_set_text(item
, "Route Distinguisher: %s",
4509 decode_bgp_rd(pinfo
->pool
, tvb
, offset
));
4510 offset
+= BGP_ROUTE_DISTINGUISHER_SIZE
;
4512 proto_tree_add_item(nlri_tree
, hf_bgp_mcast_vpn_nlri_source_as
, tvb
,
4513 offset
, 4, ENC_BIG_ENDIAN
);
4516 ret
= decode_mcast_vpn_nlri_addresses(nlri_tree
, tvb
, offset
);
4522 /* route type field (1 byte) + length field (1 byte) + length */
4527 * Decode an SR Policy SAFI as defined in draft-ietf-idr-segment-routing-te-policy-08
4530 decode_sr_policy_nlri(proto_tree
*tree
, tvbuff_t
*tvb
, int offset
, uint16_t afi
)
4532 proto_tree_add_item(tree
, hf_bgp_sr_policy_nlri_length
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
4534 proto_tree_add_item(tree
, hf_bgp_sr_policy_nlri_distinguisher
, tvb
, offset
, 4, ENC_NA
);
4536 proto_tree_add_item(tree
, hf_bgp_sr_policy_nlri_policy_color
, tvb
, offset
, 4, ENC_NA
);
4538 if (afi
== AFNUM_INET
) {
4539 proto_tree_add_item(tree
, hf_bgp_sr_policy_nlri_endpoint_v4
, tvb
, offset
, 4, ENC_BIG_ENDIAN
);
4542 proto_tree_add_item(tree
, hf_bgp_sr_policy_nlri_endpoint_v6
, tvb
, offset
, 4, ENC_NA
);
4548 * Decodes an MDT-SAFI message.
4551 decode_mdt_safi(packet_info
*pinfo
, proto_tree
*tree
, tvbuff_t
*tvb
, int offset
)
4553 const unsigned ip_length
= 4;
4554 const unsigned mdt_safi_nlri_length_bits
= 128;
4555 unsigned length
; /* length in bits */
4556 int orig_offset
= offset
;
4559 length
= tvb_get_uint8(tvb
, offset
);
4560 if (length
!= mdt_safi_nlri_length_bits
)
4564 item
= proto_tree_add_item(tree
, hf_bgp_mdt_nlri_safi_rd
, tvb
,
4565 offset
, BGP_ROUTE_DISTINGUISHER_SIZE
, ENC_NA
);
4566 proto_item_set_text(item
, "Route Distinguisher: %s",
4567 decode_bgp_rd(pinfo
->pool
, tvb
, offset
));
4568 offset
+= BGP_ROUTE_DISTINGUISHER_SIZE
;
4570 proto_tree_add_item(tree
, hf_bgp_mdt_nlri_safi_ipv4_addr
, tvb
,
4571 offset
, ip_length
, ENC_BIG_ENDIAN
);
4572 offset
+= ip_length
;
4574 proto_tree_add_item(tree
, hf_bgp_mdt_nlri_safi_group_addr
, tvb
,
4575 offset
, ip_length
, ENC_BIG_ENDIAN
);
4576 offset
+= ip_length
;
4578 return offset
- orig_offset
;
4582 * Decode an MPLS label stack
4583 * XXX - We should change *buf to **buf, use wmem_alloc() and drop the buflen
4587 decode_MPLS_stack(tvbuff_t
*tvb
, int offset
, wmem_strbuf_t
*stack_strbuf
)
4589 uint32_t label_entry
; /* an MPLS label entry (label + COS field + stack bit */
4590 int indx
; /* index for the label stack */
4593 label_entry
= 0x000000 ;
4595 wmem_strbuf_truncate(stack_strbuf
, 0);
4597 while ((label_entry
& BGP_MPLS_BOTTOM_L_STACK
) == 0) {
4599 label_entry
= tvb_get_ntoh24(tvb
, indx
) ;
4601 /* withdrawn routes may contain 0 or 0x800000 in the first label */
4602 if((indx
== offset
)&&(label_entry
==0||label_entry
==0x800000)) {
4603 wmem_strbuf_append(stack_strbuf
, "0 (withdrawn)");
4607 wmem_strbuf_append_printf(stack_strbuf
, "%u%s", label_entry
>> 4,
4608 ((label_entry
& BGP_MPLS_BOTTOM_L_STACK
) == 0) ? "," : " (bottom)");
4613 return (indx
- offset
) / 3;
4617 decode_MPLS_stack_tree(tvbuff_t
*tvb
, int offset
, proto_tree
*parent_tree
)
4619 uint32_t label_entry
=0; /* an MPLS label entry (label + COS field + stack bit) */
4620 int indx
; /* index for the label stack */
4621 proto_tree
*labels_tree
=NULL
;
4622 proto_item
*labels_item
=NULL
;
4623 proto_item
*label_item
=NULL
;
4625 label_entry
= 0x000000 ;
4627 labels_item
= proto_tree_add_item(parent_tree
, hf_bgp_update_mpls_label
, tvb
, offset
, 3, ENC_NA
);
4628 proto_item_append_text(labels_item
, ": ");
4629 labels_tree
= proto_item_add_subtree(labels_item
, ett_bgp_mpls_labels
);
4630 while ((label_entry
& BGP_MPLS_BOTTOM_L_STACK
) == 0) {
4632 label_entry
= tvb_get_ntoh24(tvb
, indx
);
4633 label_item
= proto_tree_add_item(labels_tree
, hf_bgp_update_mpls_label_value
, tvb
, indx
, 3, ENC_BIG_ENDIAN
);
4634 /* withdrawn routes may contain 0 or 0x800000 in the first label */
4635 if((indx
== offset
)&&(label_entry
==0||label_entry
==0x800000)) {
4636 proto_item_append_text(labels_item
, " (withdrawn)");
4637 proto_item_append_text(label_item
, " (withdrawn)");
4641 proto_item_append_text(labels_item
, "%u%s", label_entry
>> 4,
4642 ((label_entry
& BGP_MPLS_BOTTOM_L_STACK
) == 0) ? "," : " (bottom)");
4643 proto_item_append_text(label_item
, "%u%s", label_entry
>> 4,
4644 ((label_entry
& BGP_MPLS_BOTTOM_L_STACK
) == 0) ? "," : " (bottom)");
4647 if ((label_entry
& BGP_MPLS_BOTTOM_L_STACK
) == 0) {
4648 /* real MPLS multi-label stack in BGP? - maybe later; for now, it must be a bogus packet */
4649 proto_item_append_text(labels_item
, " (BOGUS: Bottom of Stack NOT set!)");
4653 proto_item_set_len(labels_item
, (indx
- offset
));
4654 return (indx
- offset
) / 3;
4658 * Decode a multiprotocol next hop address that expected to be IPv4.
4659 * Returns 0 on failure (invalid length).
4662 decode_mp_next_hop_ipv4(tvbuff_t
*tvb
, proto_tree
*tree
, int offset
, packet_info
*pinfo _U_
, wmem_strbuf_t
*strbuf
, int nhlen
)
4666 proto_tree_add_item(tree
, hf_bgp_update_path_attribute_mp_reach_nlri_next_hop_ipv4
, tvb
, offset
, FT_IPv4_LEN
, ENC_BIG_ENDIAN
);
4667 wmem_strbuf_append(strbuf
, tvb_ip_to_str(pinfo
->pool
, tvb
, offset
));
4676 * Decode a multiprotocol next hop address expected to be VPN-IPv4.
4677 * Note that the Route Distinguisher is always 0. Returns 0 on failure
4681 decode_mp_next_hop_vpn_ipv4(tvbuff_t
*tvb
, proto_tree
*tree
, int offset
, packet_info
*pinfo
, wmem_strbuf_t
*strbuf
, int nhlen
)
4684 const char *rd_string
;
4687 case (BGP_ROUTE_DISTINGUISHER_SIZE
+ FT_IPv4_LEN
):
4688 rd_string
= decode_bgp_rd(pinfo
->pool
, tvb
, offset
);
4689 ti
= proto_tree_add_string(tree
, hf_bgp_update_path_attribute_mp_reach_nlri_next_hop_rd
, tvb
, offset
, BGP_ROUTE_DISTINGUISHER_SIZE
, rd_string
);
4690 if (tvb_memeql(tvb
, offset
, rd_zero
, BGP_ROUTE_DISTINGUISHER_SIZE
) != 0) {
4691 expert_add_info(pinfo
, ti
, &ei_bgp_next_hop_rd_nonzero
);
4693 wmem_strbuf_append_printf(strbuf
, " RD=%s", rd_string
);
4694 offset
+= BGP_ROUTE_DISTINGUISHER_SIZE
;
4695 proto_tree_add_item(tree
, hf_bgp_update_path_attribute_mp_reach_nlri_next_hop_ipv4
, tvb
, offset
, FT_IPv4_LEN
, ENC_BIG_ENDIAN
);
4696 wmem_strbuf_append_printf(strbuf
, " IPv4=%s", tvb_ip_to_str(pinfo
->pool
, tvb
, offset
));
4705 * Decode a multiprotocol next hop address that is expected to be IPv6,
4706 * optionally including a second, link-local, address, differentiating by
4707 * length. Returns 0 on failure (invalid length).
4710 decode_mp_next_hop_ipv6(tvbuff_t
*tvb
, proto_tree
*tree
, int offset
, packet_info
*pinfo
, wmem_strbuf_t
*strbuf
, int nhlen
)
4713 ws_in6_addr ipv6_addr
;
4714 char ipv6_buffer
[WS_INET6_ADDRSTRLEN
];
4718 proto_tree_add_item(tree
, hf_bgp_update_path_attribute_mp_reach_nlri_next_hop_ipv6
, tvb
, offset
, FT_IPv6_LEN
, ENC_NA
);
4719 wmem_strbuf_append(strbuf
, tvb_ip6_to_str(pinfo
->pool
, tvb
, offset
));
4721 case (2*FT_IPv6_LEN
):
4722 /* global address followed by link-local */
4723 proto_tree_add_item(tree
, hf_bgp_update_path_attribute_mp_reach_nlri_next_hop_ipv6
, tvb
, offset
, FT_IPv6_LEN
, ENC_NA
);
4724 wmem_strbuf_append_printf(strbuf
, "IPv6=%s", tvb_ip6_to_str(pinfo
->pool
, tvb
, offset
));
4725 offset
+= FT_IPv6_LEN
;
4726 ti
= proto_tree_add_item(tree
, hf_bgp_update_path_attribute_mp_reach_nlri_next_hop_ipv6_link_local
, tvb
, offset
, FT_IPv6_LEN
, ENC_NA
);
4727 tvb_get_ipv6(tvb
, offset
, &ipv6_addr
);
4728 if (!in6_addr_is_linklocal(&ipv6_addr
)) {
4729 expert_add_info_format(pinfo
, ti
, &ei_bgp_next_hop_ipv6_scope
, "Invalid IPv6 address scope; should be link-local");
4731 ip6_to_str_buf(&ipv6_addr
, ipv6_buffer
, WS_INET6_ADDRSTRLEN
);
4732 wmem_strbuf_append_printf(strbuf
, " Link-local=%s", ipv6_buffer
);
4741 * Decode a multiprotocol next hop address that is expected to be VPN-IPv6,
4742 * optionally including a second, link-local, address. Note that the Route
4743 * Distinguisher is always 0. Returns 0 on failure (invalid length).
4746 decode_mp_next_hop_vpn_ipv6(tvbuff_t
*tvb
, proto_tree
*tree
, int offset
, packet_info
*pinfo
, wmem_strbuf_t
*strbuf
, int nhlen
)
4749 const char *rd_string
;
4750 ws_in6_addr ipv6_addr
;
4751 char ipv6_buffer
[WS_INET6_ADDRSTRLEN
];
4754 case (BGP_ROUTE_DISTINGUISHER_SIZE
+ FT_IPv6_LEN
):
4755 rd_string
= decode_bgp_rd(pinfo
->pool
, tvb
, offset
);
4756 ti
= proto_tree_add_string(tree
, hf_bgp_update_path_attribute_mp_reach_nlri_next_hop_rd
, tvb
, offset
, BGP_ROUTE_DISTINGUISHER_SIZE
, rd_string
);
4757 if (tvb_memeql(tvb
, offset
, rd_zero
, BGP_ROUTE_DISTINGUISHER_SIZE
) != 0) {
4758 expert_add_info(pinfo
, ti
, &ei_bgp_next_hop_rd_nonzero
);
4760 wmem_strbuf_append_printf(strbuf
, " RD=%s", rd_string
);
4761 offset
+= BGP_ROUTE_DISTINGUISHER_SIZE
;
4762 proto_tree_add_item(tree
, hf_bgp_update_path_attribute_mp_reach_nlri_next_hop_ipv6
, tvb
, offset
, FT_IPv6_LEN
, ENC_NA
);
4763 wmem_strbuf_append_printf(strbuf
, " IPv6=%s", tvb_ip6_to_str(pinfo
->pool
, tvb
, offset
));
4765 case (2*(BGP_ROUTE_DISTINGUISHER_SIZE
+ FT_IPv6_LEN
)):
4766 rd_string
= decode_bgp_rd(pinfo
->pool
, tvb
, offset
);
4767 ti
= proto_tree_add_string(tree
, hf_bgp_update_path_attribute_mp_reach_nlri_next_hop_rd
, tvb
, offset
, BGP_ROUTE_DISTINGUISHER_SIZE
, rd_string
);
4768 if (tvb_memeql(tvb
, offset
, rd_zero
, BGP_ROUTE_DISTINGUISHER_SIZE
) != 0) {
4769 expert_add_info(pinfo
, ti
, &ei_bgp_next_hop_rd_nonzero
);
4771 wmem_strbuf_append_printf(strbuf
, " RD=%s", rd_string
);
4772 offset
+= BGP_ROUTE_DISTINGUISHER_SIZE
;
4773 proto_tree_add_item(tree
, hf_bgp_update_path_attribute_mp_reach_nlri_next_hop_ipv6
, tvb
, offset
, FT_IPv6_LEN
, ENC_NA
);
4774 wmem_strbuf_append_printf(strbuf
, " IPv6=%s", tvb_ip6_to_str(pinfo
->pool
, tvb
, offset
));
4775 offset
+= FT_IPv6_LEN
;
4776 rd_string
= decode_bgp_rd(pinfo
->pool
, tvb
, offset
);
4777 ti
= proto_tree_add_string(tree
, hf_bgp_update_path_attribute_mp_reach_nlri_next_hop_rd
, tvb
, offset
, BGP_ROUTE_DISTINGUISHER_SIZE
, rd_string
);
4778 if (tvb_memeql(tvb
, offset
, rd_zero
, BGP_ROUTE_DISTINGUISHER_SIZE
) != 0) {
4779 expert_add_info(pinfo
, ti
, &ei_bgp_next_hop_rd_nonzero
);
4781 wmem_strbuf_append_printf(strbuf
, " RD=%s", rd_string
);
4782 offset
+= BGP_ROUTE_DISTINGUISHER_SIZE
;
4783 ti
= proto_tree_add_item(tree
, hf_bgp_update_path_attribute_mp_reach_nlri_next_hop_ipv6_link_local
, tvb
, offset
, FT_IPv6_LEN
, ENC_NA
);
4784 tvb_get_ipv6(tvb
, offset
, &ipv6_addr
);
4785 if (!in6_addr_is_linklocal(&ipv6_addr
)) {
4786 expert_add_info_format(pinfo
, ti
, &ei_bgp_next_hop_ipv6_scope
, "Invalid IPv6 address scope; should be link-local");
4788 ip6_to_str_buf(&ipv6_addr
, ipv6_buffer
, WS_INET6_ADDRSTRLEN
);
4789 wmem_strbuf_append_printf(strbuf
, " Link-local=%s", ipv6_buffer
);
4798 * Decode a multiprotocol next hop address
4801 decode_mp_next_hop(tvbuff_t
*tvb
, proto_tree
*tree
, packet_info
*pinfo
, uint16_t afi
, uint8_t safi
, int nhlen
)
4804 proto_tree
*next_hop_t
;
4805 int length
, offset
= 0;
4806 wmem_strbuf_t
*strbuf
;
4808 strbuf
= wmem_strbuf_create(pinfo
->pool
);
4810 /* BGP Multiprotocol Next Hop Principles
4812 * BGP Multiprotocol support is specified over a large variety of
4813 * RFCs for different <AFI, SAFI> pairs, which leaves some theoretical
4814 * pairings undefined (e.g., the Abstract of RFC 4760 contemplates
4815 * supporting the IPX address family) as well as leading to some
4816 * omissions, contradictions, and inconsistencies. However, some general
4817 * principles that apply across (nearly) all extant pairs exist.
4819 * 1. Global IPv6 addresses can be followed by a link-local IPv6 address
4821 * RFC 2545 specifies in section 3, "Constructing the Next Hop field,"
4822 * that when the next hop address type is IPv6, the address given should
4823 * be in global (or site-local) unicast address scope, and it shall be
4824 * followed by the link-local address if and only if the BGP speaker shares
4825 * a common subnet with the address and the peer the route is being
4828 * The wording implies that this holds for any <AFI, SAFI> pair where
4829 * a IPv6 address is used, and RFCs 5549, 7752, and 8950 demonstrate that
4830 * this explicitly holds for the most common ones, including for VPN-IPv6
4831 * addresses (where the route distinguisher field also appears, see
4832 * RFC 4659). Sometimes the possibility is elided where it is known to
4833 * exist e.g. RFC 7606 7.11 MP_REACH_NLRI "For example, if RFC5549 is in
4834 * use, then the next hop would have to have a length of 4 or 16." Thus
4835 * it is possible that its omission in other RFCs covering new <AFI, SAFI>
4836 * pairs is an oversight.
4838 * 2. [VPN-]IPv4 NLRI can have [VPN-]IPv6 Next Hop addresses
4840 * RFCs 5549 and 8950 declare that the next hop address may not necessarily
4841 * belong to the address family specified by the AFI, updating RFC 2858,
4842 * specifically addressing the case of IPv6 islands across a IPv4 core
4845 * IPv4 addresses can easily be mapped into IPv6 addresses, and that
4846 * is the solution for one case, but in the other the Next Hop must be an
4847 * IPv6 (or VPN-IPv6) address even though the NLRI is IPv4.
4849 * The wording of RFC 8950 strongly implies that the intent is to allow
4850 * IPv6 Net Hop addresses for any case of IPv4 or VPN-IPv4 NLRI, providing
4851 * a BGP Capability to declare that the BGP speakers supports a different
4852 * Next Hop AFI for <AFI, SAFI> pairs defined without this capability,
4853 * and noting those (like <1, 132>, SAFNUM_ROUTE_TARGET, RFC 4684) that
4854 * consider the possibility from the start.
4856 * 3. Next Hop Route Distinguisher (RD) is 0 or omitted
4858 * RDs do not have a meaning in the Next Hop network address. However, when
4859 * RFC 2547 introduced the VPN-IPv4 address family, at that point the Next
4860 * Hop address family had to be the same as the NLRI address family, so the
4861 * RD was set to all 0. Later defined <AFI, SAFI> pairs with RDs in their
4862 * NLRI have either used this custom of a 0 RD, or else omitted it and
4863 * only had the IP address in the Next Hop.
4866 ti
= proto_tree_add_item(tree
, hf_bgp_update_path_attribute_mp_reach_nlri_next_hop
, tvb
, offset
, nhlen
+ 1, ENC_NA
);
4867 next_hop_t
= proto_item_add_subtree(ti
, ett_bgp_mp_nhna
);
4873 case SAFNUM_UNICAST
: /* RFC 8950 */
4874 case SAFNUM_MULCAST
: /* RFC 8950 */
4875 case SAFNUM_UNIMULC
: /* Deprecated, but as above */
4876 case SAFNUM_MPLS_LABEL
: /* RFC 8277 */
4877 case SAFNUM_MCAST_VPN
: /* RFC 6514 */
4878 case SAFNUM_ENCAPSULATION
: /* RFC 5512, but "never been used"
4880 * draft-ietf-idr-tunnel-encaps-22
4882 case SAFNUM_ROUTE_TARGET
: /* RFC 4684 */
4883 case SAFNUM_BGP_MUP
: /* draft-mpmz-bess-mup-safi-00 */
4884 /* IPv4 or IPv6, differentiated by field length, according
4885 * to the RFCs cited above. RFC 8950 explicitly addresses
4886 * the possible link-local IPv6 address. RFC 6514 depending
4887 * on the situation either the Next Hop MUST be the same
4888 * as in the IP Address field lower in the network stack,
4889 * or simply SHOULD be "a routeable address" of the ASBR/
4891 if ((length
= decode_mp_next_hop_ipv4(tvb
, next_hop_t
, offset
, pinfo
, strbuf
, nhlen
)) == 0) {
4892 length
= decode_mp_next_hop_ipv6(tvb
, next_hop_t
, offset
, pinfo
, strbuf
, nhlen
);
4896 /* Internet Draft draft-nalawade-kapoor-tunnel-safi-05
4897 * long expired, but "[NLRI] network address... SHOULD be
4898 * the same as the [Next Hop] network address."
4900 length
= decode_mp_next_hop_ipv4(tvb
, next_hop_t
, offset
, pinfo
, strbuf
, nhlen
);
4902 case SAFNUM_LAB_VPNUNICAST
: /* RFC 8950 */
4903 case SAFNUM_LAB_VPNMULCAST
: /* RFC 8950 */
4904 case SAFNUM_LAB_VPNUNIMULC
: /* Deprecated, but as above */
4905 /* RFC 8950 indicates that the next hop can be VPN-IPv4 or
4906 * VPN-IPv6 (with RD all 0), and in the latter case the
4907 * link-local IPv6 address can be included. Note that RFC
4908 * 5549 incorrectly did not include the RD in the Next Hop
4909 * for VPN-IPv6 (see Erratum ID 5253), but according to
4910 * RFC 8950 2. "Changes Compared to RFC 5549":
4911 * "As all known and deployed implementations are
4912 * interoperable today and use the new proposed encoding,
4913 * the change does not break existing interoperability,"
4914 * and thus we need not test for a missing RD.
4916 if ((length
= decode_mp_next_hop_vpn_ipv4(tvb
, next_hop_t
, offset
, pinfo
, strbuf
, nhlen
)) == 0) {
4917 length
= decode_mp_next_hop_vpn_ipv6(tvb
, next_hop_t
, offset
, pinfo
, strbuf
, nhlen
);
4920 case SAFNUM_FSPEC_RULE
:
4921 case SAFNUM_FSPEC_VPN_RULE
:
4923 /* When advertising Flow Specifications, the Length of the
4924 * Next-Hop Address MUST be set 0. The Network Address of
4925 * the Next-Hop field MUST be ignored.
4928 expert_add_info_format(pinfo
, ti
, &ei_bgp_length_invalid
,
4929 "The length (%d) of Next Hop (FlowSpec) is not zero", nhlen
);
4936 expert_add_info_format(pinfo
, ti
, &ei_bgp_unknown_safi
,
4937 "Unknown SAFI (%u) for AFI %u", safi
, afi
);
4939 } /* switch (safi) */
4943 case SAFNUM_UNICAST
: /* RFC 8950 */
4944 case SAFNUM_MULCAST
: /* RFC 8950 */
4945 case SAFNUM_UNIMULC
: /* Deprecated, but as above */
4946 case SAFNUM_MPLS_LABEL
: /* RFC 8277 */
4947 case SAFNUM_MCAST_VPN
: /* RFC 6514 */
4948 case SAFNUM_ENCAPSULATION
: /* RFC 5512, but "never been used" */
4949 case SAFNUM_TUNNEL
: /* Expired Internet Draft */
4950 case SAFNUM_BGP_MUP
: /* draft-mpmz-bess-mup-safi-00 */
4951 /* IPv6 address, possibly followed by link-local address */
4952 length
= decode_mp_next_hop_ipv6(tvb
, next_hop_t
, offset
, pinfo
, strbuf
, nhlen
);
4954 case SAFNUM_LAB_VPNUNICAST
: /* RFC 8950 */
4955 case SAFNUM_LAB_VPNMULCAST
: /* RFC 8950 */
4956 case SAFNUM_LAB_VPNUNIMULC
: /* Deprecated, but as above */
4957 /* VPN-IPv6 address, possibly followed by link-local addr */
4958 length
= decode_mp_next_hop_vpn_ipv6(tvb
, next_hop_t
, offset
, pinfo
, strbuf
, nhlen
);
4960 case SAFNUM_FSPEC_RULE
:
4961 case SAFNUM_FSPEC_VPN_RULE
:
4963 /* When advertising Flow Specifications, the Length of the
4964 * Next-Hop Address MUST be set 0. The Network Address of
4965 * the Next-Hop field MUST be ignored.
4968 expert_add_info_format(pinfo
, ti
, &ei_bgp_length_invalid
,
4969 "The length (%d) of Next Hop (FlowSpec) is not zero", nhlen
);
4976 expert_add_info_format(pinfo
, ti
, &ei_bgp_unknown_safi
,
4977 "Unknown SAFI (%u) for AFI %u", safi
, afi
);
4979 } /* switch (safi) */
4982 case AFNUM_L2VPN_OLD
:
4984 /* XXX: Do these first three really appear with L2VPN AFI? */
4985 case SAFNUM_LAB_VPNUNICAST
:
4986 case SAFNUM_LAB_VPNMULCAST
:
4987 case SAFNUM_LAB_VPNUNIMULC
:
4988 case SAFNUM_VPLS
: /* RFC 4761 (VPLS) and RFC 6074 (BGP-AD) */
4989 case SAFNUM_EVPN
: /* RFC 7432 */
4990 /* The RFCs above specify that the next-hop is simply the
4991 * address of the PE (loopback address in some cases for
4992 * BGP-AD), either IPv4 or IPv6, differentiated by length.
4993 * A RD is included in the NLRI in these cases, but not in
4994 * the Next Hop address unlike in AFI 1 or 2.
4996 if ((length
= decode_mp_next_hop_ipv4(tvb
, next_hop_t
, offset
, pinfo
, strbuf
, nhlen
)) == 0) {
4997 length
= decode_mp_next_hop_ipv6(tvb
, next_hop_t
, offset
, pinfo
, strbuf
, nhlen
);
5002 expert_add_info_format(pinfo
, ti
, &ei_bgp_unknown_safi
,
5003 "Unknown SAFI (%u) for AFI %u", safi
, afi
);
5005 } /* switch (safi) */
5008 /* RFC 7752 section 3.4 "BGP Next-Hop Information" explains that
5009 * the next-hop address length field specifes the next-hop address
5010 * family. "If the next-hop length is 4, then the next hop is an
5011 * IPv4 address; if the next-hop length is 16, then it is a global
5012 * IPv6 address; and if the next-hop length is 32, then there is
5013 * one global IPv6 address followed by a link-local IPv6 address"
5017 if ((length
= decode_mp_next_hop_ipv4(tvb
, next_hop_t
, offset
, pinfo
, strbuf
, nhlen
)) == 0) {
5018 length
= decode_mp_next_hop_ipv6(tvb
, next_hop_t
, offset
, pinfo
, strbuf
, nhlen
);
5021 case SAFNUM_BGP_LS_VPN
:
5022 /* RFC 7752 3.4: "For VPN SAFI, as per custom, an 8-byte
5023 * Route Distinguisher set to all zero is prepended to the
5026 if ((length
= decode_mp_next_hop_vpn_ipv4(tvb
, next_hop_t
, offset
, pinfo
, strbuf
, nhlen
)) == 0) {
5027 length
= decode_mp_next_hop_vpn_ipv6(tvb
, next_hop_t
, offset
, pinfo
, strbuf
, nhlen
);
5032 expert_add_info_format(pinfo
, ti
, &ei_bgp_unknown_safi
,
5033 "Unknown SAFI (%u) for AFI %u", safi
, afi
);
5035 } /* switch (safi) */
5039 expert_add_info(pinfo
, ti
, &ei_bgp_unknown_afi
);
5044 proto_item_append_text(ti
, ": %s", wmem_strbuf_get_str(strbuf
));
5046 expert_add_info_format(pinfo
, ti
, &ei_bgp_length_invalid
, "Unknown Next Hop length (%u byte%s)", nhlen
, plurality(nhlen
, "", "s"));
5048 proto_item_append_text(ti
, ": %s", tvb_bytes_to_str(pinfo
->pool
, tvb
, offset
, nhlen
));
5055 static int decode_bgp_link_node_descriptor(tvbuff_t
*tvb
, proto_tree
*tree
, int offset
, packet_info
*pinfo
, int length
)
5057 uint16_t sub_length
;
5059 uint16_t diss_length
;
5061 proto_item
* tlv_item
;
5062 proto_tree
* tlv_tree
;
5066 while (length
> 0 ) {
5068 expert_add_info_format(pinfo
, tree
, &ei_bgp_ls_error
,
5069 "Unknown data in Link-State Link NLRI!");
5070 diss_length
+= length
;
5073 type
= tvb_get_ntohs(tvb
, offset
);
5074 sub_length
= tvb_get_ntohs(tvb
, offset
+ 2);
5077 case BGP_NLRI_TLV_AUTONOMOUS_SYSTEM
:
5078 tlv_item
= proto_tree_add_item(tree
, hf_bgp_ls_tlv_autonomous_system
, tvb
, offset
, sub_length
+4, ENC_NA
);
5079 tlv_tree
= proto_item_add_subtree(tlv_item
, ett_bgp_mp_reach_nlri
);
5080 proto_tree_add_item(tlv_tree
, hf_bgp_ls_type
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
5081 proto_tree_add_item(tlv_tree
, hf_bgp_ls_length
, tvb
, offset
+ 2, 2, ENC_BIG_ENDIAN
);
5082 if (sub_length
!= BGP_NLRI_TLV_LEN_AUTONOMOUS_SYSTEM
) {
5083 expert_add_info_format(pinfo
, tree
, &ei_bgp_ls_error
,
5084 "Autonomous system TLV length should be %u bytes! (%u)",
5085 BGP_NLRI_TLV_LEN_AUTONOMOUS_SYSTEM
, sub_length
);
5088 proto_tree_add_item(tlv_tree
, hf_bgp_ls_tlv_autonomous_system_id
, tvb
, offset
+ 4, 4, ENC_BIG_ENDIAN
);
5090 case BGP_NLRI_TLV_BGP_LS_IDENTIFIER
:
5091 tlv_item
= proto_tree_add_item(tree
, hf_bgp_ls_tlv_bgp_ls_identifier
, tvb
, offset
, sub_length
+4, ENC_NA
);
5092 tlv_tree
= proto_item_add_subtree(tlv_item
, ett_bgp_mp_reach_nlri
);
5093 proto_tree_add_item(tlv_tree
, hf_bgp_ls_type
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
5094 proto_tree_add_item(tlv_tree
, hf_bgp_ls_length
, tvb
, offset
+ 2, 2, ENC_BIG_ENDIAN
);
5095 if (sub_length
!= BGP_NLRI_TLV_LEN_BGP_LS_IDENTIFIER
) {
5096 expert_add_info_format(pinfo
, tree
, &ei_bgp_ls_error
,
5097 "BGP-LS TLV length should be %u bytes! (%u)",
5098 BGP_NLRI_TLV_LEN_BGP_LS_IDENTIFIER
, sub_length
);
5101 proto_tree_add_item(tlv_tree
, hf_bgp_ls_tlv_bgp_ls_identifier_id
, tvb
, offset
+ 4, 4, ENC_BIG_ENDIAN
);
5103 case BGP_NLRI_TLV_AREA_ID
:
5104 tlv_item
= proto_tree_add_item(tree
, hf_bgp_ls_tlv_area_id
, tvb
, offset
, sub_length
+4, ENC_NA
);
5105 tlv_tree
= proto_item_add_subtree(tlv_item
, ett_bgp_mp_reach_nlri
);
5106 proto_tree_add_item(tlv_tree
, hf_bgp_ls_type
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
5107 proto_tree_add_item(tlv_tree
, hf_bgp_ls_length
, tvb
, offset
+ 2, 2, ENC_BIG_ENDIAN
);
5108 if (sub_length
!= BGP_NLRI_TLV_LEN_AREA_ID
) {
5109 expert_add_info_format(pinfo
, tree
, &ei_bgp_ls_error
,
5110 "Area ID TLV length should be %u bytes! (%u)",
5111 BGP_NLRI_TLV_LEN_AREA_ID
, sub_length
);
5114 proto_tree_add_item(tlv_tree
, hf_bgp_ls_tlv_area_id_id
, tvb
, offset
+ 4, 4, ENC_BIG_ENDIAN
);
5116 case BGP_NLRI_TLV_IGP_ROUTER_ID
:
5117 tlv_item
= proto_tree_add_item(tree
, hf_bgp_ls_tlv_igp_router
, tvb
, offset
, sub_length
+4, ENC_NA
);
5118 tlv_tree
= proto_item_add_subtree(tlv_item
, ett_bgp_mp_reach_nlri
);
5119 proto_tree_add_item(tlv_tree
, hf_bgp_ls_type
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
5120 proto_tree_add_item(tlv_tree
, hf_bgp_ls_length
, tvb
, offset
+ 2, 2, ENC_BIG_ENDIAN
);
5121 proto_tree_add_item(tlv_tree
, hf_bgp_ls_tlv_igp_router_id
, tvb
, offset
+ 4, sub_length
, ENC_NA
);
5123 case BGP_NLRI_TLV_BGP_ROUTER_ID
:
5124 tlv_item
= proto_tree_add_item(tree
, hf_bgp_ls_tlv_bgp_router_id
, tvb
, offset
, sub_length
+4, ENC_NA
);
5125 tlv_tree
= proto_item_add_subtree(tlv_item
, ett_bgp_mp_reach_nlri
);
5126 proto_tree_add_item(tlv_tree
, hf_bgp_ls_type
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
5127 proto_tree_add_item(tlv_tree
, hf_bgp_ls_length
, tvb
, offset
+ 2, 2, ENC_BIG_ENDIAN
);
5128 proto_tree_add_item(tlv_tree
, hf_bgp_ls_tlv_bgp_router_id_id
, tvb
, offset
+ 4, sub_length
, ENC_NA
);
5131 expert_add_info_format(pinfo
, tree
, &ei_bgp_ls_warn
, "Undefined node Descriptor Sub-TLV type (%u)!", type
);
5134 length
-= 4 + sub_length
;
5135 offset
+= 4 + sub_length
;
5136 diss_length
+= 4 + sub_length
;
5143 * Decode BGP Link State Local and Remote NODE Descriptors
5145 static int decode_bgp_link_node_nlri_tlvs(tvbuff_t
*tvb
, proto_tree
*tree
, int offset
, packet_info
*pinfo
, uint16_t expected_sub_tlv
)
5149 proto_tree
* tlv_tree
;
5150 proto_item
* tlv_item
;
5152 type
= tvb_get_ntohs(tvb
, offset
);
5153 length
= tvb_get_ntohs(tvb
, offset
+ 2);
5155 if (expected_sub_tlv
!= type
) {
5156 expert_add_info_format(pinfo
, tree
, &ei_bgp_ls_error
, "Expected/actual tlv mismatch, expected: %u, actual: %u", expected_sub_tlv
, type
);
5161 /*local and remote node descriptors */
5162 case BGP_NLRI_TLV_LOCAL_NODE_DESCRIPTORS
:
5163 tlv_item
= proto_tree_add_item(tree
, hf_bgp_ls_tlv_local_node_descriptors
, tvb
, offset
, length
+4, ENC_NA
);
5164 tlv_tree
= proto_item_add_subtree(tlv_item
, ett_bgp_mp_reach_nlri
);
5165 proto_tree_add_item(tlv_tree
, hf_bgp_ls_type
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
5166 proto_tree_add_item(tlv_tree
, hf_bgp_ls_length
, tvb
, offset
+ 2, 2, ENC_BIG_ENDIAN
);
5167 decode_bgp_link_node_descriptor(tvb
, tlv_tree
, offset
+ 4, pinfo
, length
);
5170 case BGP_NLRI_TLV_REMOTE_NODE_DESCRIPTORS
:
5171 tlv_item
= proto_tree_add_item(tree
, hf_bgp_ls_tlv_remote_node_descriptors
, tvb
, offset
, length
+4, ENC_NA
);
5172 tlv_tree
= proto_item_add_subtree(tlv_item
, ett_bgp_mp_reach_nlri
);
5173 proto_tree_add_item(tlv_tree
, hf_bgp_ls_type
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
5174 proto_tree_add_item(tlv_tree
, hf_bgp_ls_length
, tvb
, offset
+ 2, 2, ENC_BIG_ENDIAN
);
5175 decode_bgp_link_node_descriptor(tvb
, tlv_tree
, offset
+ 4, pinfo
, length
);
5183 * Dissect Link and Node NLRI common fields (Protocol-ID, Identifier, Local Node Desc.)
5185 static int decode_bgp_link_node_nlri_common_fields(tvbuff_t
*tvb
,
5186 proto_tree
*tree
, int offset
, packet_info
*pinfo
, int length
) {
5187 int dissected_length
;
5190 /* dissect Link NLRI header */
5192 expert_add_info_format(pinfo
, tree
, &ei_bgp_ls_error
,
5193 "Link State NLRI length is lower than 12 bytes! (%d)", length
);
5197 proto_tree_add_item(tree
, hf_bgp_ls_nlri_node_protocol_id
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
5198 save_link_state_protocol_id(pinfo
, tvb_get_uint8(tvb
, offset
));
5199 proto_tree_add_item(tree
, hf_bgp_ls_nlri_node_identifier
, tvb
, offset
+ 1, 8, ENC_BIG_ENDIAN
);
5201 dissected_length
= 9;
5202 offset
+= dissected_length
;
5203 length
-= dissected_length
;
5205 /* dissect Local Node Descriptors TLV */
5207 expert_add_info_format(pinfo
, tree
, &ei_bgp_ls_error
,
5208 "Unknown data in Link-State Link NLRI! length = %d bytes", length
);
5209 return dissected_length
;
5212 tmp_length
= decode_bgp_link_node_nlri_tlvs(tvb
, tree
, offset
, pinfo
,
5213 BGP_NLRI_TLV_LOCAL_NODE_DESCRIPTORS
);
5214 if (tmp_length
< 0) {
5217 dissected_length
+= tmp_length
;
5219 return dissected_length
;
5224 * Decode Link Descriptors
5226 static int decode_bgp_link_nlri_link_descriptors(tvbuff_t
*tvb
,
5227 proto_tree
*tree
, int offset
, packet_info
*pinfo
, int length
) {
5229 uint16_t sub_length
;
5231 uint16_t diss_length
;
5234 proto_item
* tlv_item
;
5235 proto_tree
* tlv_tree
;
5236 proto_item
* tlv_sub_item
;
5237 proto_tree
* tlv_sub_tree
;
5239 tlv_item
= proto_tree_add_item(tree
, hf_bgp_ls_nlri_link_descriptors_tlv
, tvb
, offset
, length
+ 4, ENC_NA
);
5240 tlv_tree
= proto_item_add_subtree(tlv_item
, ett_bgp_mp_reach_nlri
);
5243 while (length
> 0) {
5245 expert_add_info_format(pinfo
, tree
, &ei_bgp_ls_error
,
5246 "Unknown data in Link-State Link NLRI!");
5247 diss_length
+= length
;
5251 type
= tvb_get_ntohs(tvb
, offset
);
5252 sub_length
= tvb_get_ntohs(tvb
, offset
+ 2);
5254 case BGP_NLRI_TLV_LINK_LOCAL_REMOTE_IDENTIFIERS
:
5255 if(sub_length
!= BGP_NLRI_TLV_LEN_LINK_LOCAL_REMOTE_IDENTIFIERS
){
5256 expert_add_info_format(pinfo
, tlv_tree
, &ei_bgp_ls_error
,
5257 "Unexpected Link Local/Remote Identifiers TLV's length (%u), it must be %u bytes!",
5258 sub_length
, BGP_NLRI_TLV_LEN_LINK_LOCAL_REMOTE_IDENTIFIERS
);
5261 tlv_sub_item
= proto_tree_add_item(tlv_tree
,
5262 hf_bgp_ls_tlv_link_local_remote_identifiers
, tvb
, offset
,
5263 sub_length
+ 4, ENC_NA
);
5264 tlv_sub_tree
= proto_item_add_subtree(tlv_sub_item
, ett_bgp_mp_reach_nlri
);
5267 case BGP_NLRI_TLV_IPV4_INTERFACE_ADDRESS
:
5268 if(sub_length
!= BGP_NLRI_TLV_LEN_IPV4_INTERFACE_ADDRESS
){
5269 expert_add_info_format(pinfo
, tlv_tree
, &ei_bgp_ls_error
,
5270 "Unexpected IPv4 Interface Address TLV's length (%u), it must be %u bytes!",
5271 sub_length
, BGP_NLRI_TLV_LEN_IPV4_INTERFACE_ADDRESS
);
5274 tlv_sub_item
= proto_tree_add_item(tlv_tree
,
5275 hf_bgp_ls_tlv_ipv4_interface_address
, tvb
, offset
,
5276 sub_length
+ 4, ENC_NA
);
5277 tlv_sub_tree
= proto_item_add_subtree(tlv_sub_item
, ett_bgp_mp_reach_nlri
);
5280 case BGP_NLRI_TLV_IPV4_NEIGHBOR_ADDRESS
:
5281 if(sub_length
!= BGP_NLRI_TLV_LEN_IPV4_NEIGHBOR_ADDRESS
){
5282 expert_add_info_format(pinfo
, tlv_tree
, &ei_bgp_ls_error
,
5283 "Unexpected IPv4 Neighbor Address TLV's length (%u), it must be %u bytes!",
5284 sub_length
, BGP_NLRI_TLV_LEN_IPV4_NEIGHBOR_ADDRESS
);
5287 tlv_sub_item
= proto_tree_add_item(tlv_tree
,
5288 hf_bgp_ls_tlv_ipv4_neighbor_address
, tvb
, offset
,
5289 sub_length
+ 4, ENC_NA
);
5290 tlv_sub_tree
= proto_item_add_subtree(tlv_sub_item
, ett_bgp_mp_reach_nlri
);
5293 case BGP_NLRI_TLV_IPV6_INTERFACE_ADDRESS
:
5294 if(sub_length
!= BGP_NLRI_TLV_LEN_IPV6_INTERFACE_ADDRESS
){
5295 expert_add_info_format(pinfo
, tlv_tree
, &ei_bgp_ls_error
,
5296 "Unexpected IPv6 Interface Address TLV's length (%u), it must be %u bytes!",
5297 sub_length
, BGP_NLRI_TLV_LEN_IPV6_INTERFACE_ADDRESS
);
5300 tlv_sub_item
= proto_tree_add_item(tlv_tree
,
5301 hf_bgp_ls_tlv_ipv6_interface_address
, tvb
, offset
,
5302 sub_length
+ 4, ENC_NA
);
5303 tlv_sub_tree
= proto_item_add_subtree(tlv_sub_item
, ett_bgp_mp_reach_nlri
);
5306 case BGP_NLRI_TLV_IPV6_NEIGHBOR_ADDRESS
:
5307 if(sub_length
!= BGP_NLRI_TLV_LEN_IPV6_NEIGHBOR_ADDRESS
){
5308 expert_add_info_format(pinfo
, tlv_tree
, &ei_bgp_ls_error
,
5309 "Unexpected IPv6 Neighbor Address TLV's length (%u), it must be %u bytes!",
5310 sub_length
, BGP_NLRI_TLV_LEN_IPV6_NEIGHBOR_ADDRESS
);
5313 tlv_sub_item
= proto_tree_add_item(tlv_tree
,
5314 hf_bgp_ls_tlv_ipv6_neighbor_address
, tvb
, offset
,
5315 sub_length
+ 4, ENC_NA
);
5316 tlv_sub_tree
= proto_item_add_subtree(tlv_sub_item
, ett_bgp_mp_reach_nlri
);
5319 case BGP_NLRI_TLV_MULTI_TOPOLOGY_ID
:
5320 if(sub_length
!= BGP_NLRI_TLV_LEN_MULTI_TOPOLOGY_ID
){
5321 expert_add_info_format(pinfo
, tlv_tree
, &ei_bgp_ls_error
,
5322 "Unexpected Multi Topology ID TLV's length (%u), it must be %u bytes!",
5323 sub_length
, BGP_NLRI_TLV_LEN_MULTI_TOPOLOGY_ID
);
5326 tlv_sub_item
= proto_tree_add_item(tlv_tree
,
5327 hf_bgp_ls_tlv_multi_topology_id
, tvb
, offset
, sub_length
+ 4,
5329 tlv_sub_tree
= proto_item_add_subtree(tlv_sub_item
, ett_bgp_mp_reach_nlri
);
5333 expert_add_info_format(pinfo
, tlv_tree
, &ei_bgp_ls_error
,
5334 "Unknown Link Descriptor TLV Code (%u)!", type
);
5338 proto_tree_add_item(tlv_sub_tree
, hf_bgp_ls_type
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
5339 proto_tree_add_item(tlv_sub_tree
, hf_bgp_ls_length
, tvb
, offset
+ 2, 2, ENC_BIG_ENDIAN
);
5342 case BGP_NLRI_TLV_LINK_LOCAL_REMOTE_IDENTIFIERS
:
5343 proto_tree_add_item(tlv_sub_tree
, hf_bgp_ls_nlri_link_local_identifier
, tvb
, offset
+ 4, 4, ENC_BIG_ENDIAN
);
5344 proto_tree_add_item(tlv_sub_tree
, hf_bgp_ls_nlri_link_remote_identifier
, tvb
, offset
+ 8, 4, ENC_BIG_ENDIAN
);
5347 case BGP_NLRI_TLV_IPV4_INTERFACE_ADDRESS
:
5348 proto_tree_add_item(tlv_sub_tree
, hf_bgp_ls_nlri_ipv4_interface_address
, tvb
, offset
+ 4,
5349 BGP_NLRI_TLV_LEN_IPV4_INTERFACE_ADDRESS
, ENC_BIG_ENDIAN
);
5352 case BGP_NLRI_TLV_IPV4_NEIGHBOR_ADDRESS
:
5353 proto_tree_add_item(tlv_sub_tree
, hf_bgp_ls_nlri_ipv4_neighbor_address
, tvb
, offset
+ 4,
5354 BGP_NLRI_TLV_LEN_IPV4_INTERFACE_ADDRESS
, ENC_BIG_ENDIAN
);
5357 case BGP_NLRI_TLV_IPV6_INTERFACE_ADDRESS
:
5358 proto_tree_add_item(tlv_sub_tree
, hf_bgp_ls_nlri_ipv6_interface_address
, tvb
, offset
+ 4,
5359 BGP_NLRI_TLV_LEN_IPV6_INTERFACE_ADDRESS
, ENC_NA
);
5362 case BGP_NLRI_TLV_IPV6_NEIGHBOR_ADDRESS
:
5363 proto_tree_add_item(tlv_sub_tree
, hf_bgp_ls_nlri_ipv6_neighbor_address
, tvb
, offset
+ 4,
5364 BGP_NLRI_TLV_LEN_IPV6_INTERFACE_ADDRESS
, ENC_NA
);
5367 case BGP_NLRI_TLV_MULTI_TOPOLOGY_ID
:
5368 tmp16
= tvb_get_ntohs(tvb
, offset
+ 4);
5371 expert_add_info_format(pinfo
, tlv_sub_tree
, &ei_bgp_ls_error
, "Reserved bits of Multi Topology ID must be set to zero! (%u)", tmp16
);
5373 proto_tree_add_item(tlv_sub_tree
, hf_bgp_ls_nlri_multi_topology_id
, tvb
, offset
+ 4,
5374 BGP_NLRI_TLV_LEN_MULTI_TOPOLOGY_ID
, ENC_BIG_ENDIAN
);
5378 length
-= 4 + sub_length
;
5379 offset
+= 4 + sub_length
;
5380 diss_length
+= 4 + sub_length
;
5386 * Decode Prefix Descriptors
5388 static int decode_bgp_link_nlri_prefix_descriptors(tvbuff_t
*tvb
,
5389 proto_tree
*tree
, int offset
, packet_info
*pinfo
, int length
, int proto
) {
5391 uint16_t sub_length
;
5393 uint16_t diss_length
;
5396 proto_item
* tlv_item
;
5397 proto_tree
* tlv_tree
;
5398 proto_item
* tlv_sub_item
;
5399 proto_tree
* tlv_sub_tree
;
5401 tlv_item
= proto_tree_add_item(tree
, hf_bgp_ls_nlri_prefix_descriptors_tlv
, tvb
, offset
, length
+ 4, ENC_NA
);
5402 tlv_tree
= proto_item_add_subtree(tlv_item
, ett_bgp_mp_reach_nlri
);
5405 while (length
> 0) {
5407 expert_add_info_format(pinfo
, tree
, &ei_bgp_ls_error
,
5408 "Unknown data in Link-State Link NLRI!");
5409 diss_length
+= length
;
5413 type
= tvb_get_ntohs(tvb
, offset
);
5414 sub_length
= tvb_get_ntohs(tvb
, offset
+ 2);
5416 case BGP_NLRI_TLV_MULTI_TOPOLOGY_ID
:
5417 if(sub_length
!= BGP_NLRI_TLV_LEN_MULTI_TOPOLOGY_ID
){
5418 expert_add_info_format(pinfo
, tlv_tree
, &ei_bgp_ls_error
,
5419 "Unexpected Multi Topology ID TLV's length (%u), it must be %u bytes!",
5420 sub_length
, BGP_NLRI_TLV_LEN_MULTI_TOPOLOGY_ID
);
5423 tlv_sub_item
= proto_tree_add_item(tlv_tree
,
5424 hf_bgp_ls_tlv_multi_topology_id
, tvb
, offset
, sub_length
+ 4,
5426 tlv_sub_tree
= proto_item_add_subtree(tlv_sub_item
, ett_bgp_mp_reach_nlri
);
5429 case BGP_NLRI_TLV_OSPF_ROUTE_TYPE
:
5430 tlv_sub_item
= proto_tree_add_item(tlv_tree
,
5431 hf_bgp_ls_tlv_ospf_route_type
, tvb
, offset
, sub_length
+ 4,
5433 tlv_sub_tree
= proto_item_add_subtree(tlv_sub_item
, ett_bgp_mp_reach_nlri
);
5435 case BGP_NLRI_TLV_IP_REACHABILITY_INFORMATION
:
5436 tlv_sub_item
= proto_tree_add_item(tlv_tree
,
5437 hf_bgp_ls_tlv_ip_reachability_information
, tvb
, offset
, sub_length
+ 4,
5439 tlv_sub_tree
= proto_item_add_subtree(tlv_sub_item
, ett_bgp_mp_reach_nlri
);
5443 expert_add_info_format(pinfo
, tlv_tree
, &ei_bgp_ls_error
,
5444 "Unknown Prefix Descriptor TLV Code (%u)!", type
);
5448 proto_tree_add_item(tlv_sub_tree
, hf_bgp_ls_type
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
5449 proto_tree_add_item(tlv_sub_tree
, hf_bgp_ls_length
, tvb
, offset
+ 2, 2, ENC_BIG_ENDIAN
);
5452 case BGP_NLRI_TLV_MULTI_TOPOLOGY_ID
:
5453 tmp16
= tvb_get_ntohs(tvb
, offset
+ 4);
5456 expert_add_info_format(pinfo
, tlv_sub_tree
, &ei_bgp_ls_error
, "Reserved bits of Multi Topology ID must be set to zero! (%u)", tmp16
);
5458 proto_tree_add_item(tlv_sub_tree
, hf_bgp_ls_nlri_multi_topology_id
, tvb
, offset
+ 4,
5459 BGP_NLRI_TLV_LEN_MULTI_TOPOLOGY_ID
, ENC_BIG_ENDIAN
);
5462 case BGP_NLRI_TLV_OSPF_ROUTE_TYPE
:
5464 if (sub_length
!= 1) {
5465 expert_add_info_format(pinfo
, tlv_sub_tree
, &ei_bgp_ls_error
, "OSPF Route Type length must be \"1\"");
5468 proto_tree_add_item(tlv_sub_tree
, hf_bgp_ls_nlri_ospf_route_type
, tvb
, offset
+ 4, 1, ENC_BIG_ENDIAN
);
5471 case BGP_NLRI_TLV_IP_REACHABILITY_INFORMATION
:
5472 if (( proto
== IP_PROTO_IPV4
) && (decode_prefix4(tlv_sub_tree
, pinfo
, tlv_sub_item
, hf_bgp_ls_nlri_ip_reachability_prefix_ip
,
5473 tvb
, offset
+ 4, "Reachability") == -1))
5475 if (( proto
== IP_PROTO_IPV6
) && (decode_prefix6(tlv_sub_tree
, pinfo
, hf_bgp_ls_nlri_ip_reachability_prefix_ip6
,
5476 tvb
, offset
+ 4, 0, "Reachability") == -1))
5481 length
-= 4 + sub_length
;
5482 offset
+= 4 + sub_length
;
5483 diss_length
+= 4 + sub_length
;
5489 * Decode SRv6 SID Descriptors
5491 static int decode_bgp_link_nlri_srv6_sid_descriptors(tvbuff_t
*tvb
,
5492 proto_tree
*tree
, int offset
, packet_info
*pinfo
, int length
) {
5494 uint16_t sub_length
;
5496 uint16_t diss_length
;
5499 proto_item
* tlv_item
;
5500 proto_tree
* tlv_tree
;
5501 proto_item
* tlv_sub_item
;
5502 proto_tree
* tlv_sub_tree
;
5504 tlv_item
= proto_tree_add_item(tree
, hf_bgp_ls_nlri_srv6_sid_descriptors_tlv
, tvb
, offset
, length
+ 4, ENC_NA
);
5505 tlv_tree
= proto_item_add_subtree(tlv_item
, ett_bgp_mp_reach_nlri
);
5508 while (length
> 0) {
5510 expert_add_info_format(pinfo
, tree
, &ei_bgp_ls_error
,
5511 "Unknown data in Link-State SRv6 SID NLRI!");
5512 diss_length
+= length
;
5516 type
= tvb_get_ntohs(tvb
, offset
);
5517 sub_length
= tvb_get_ntohs(tvb
, offset
+ 2);
5519 case BGP_NLRI_TLV_MULTI_TOPOLOGY_ID
:
5520 if(sub_length
!= BGP_NLRI_TLV_LEN_MULTI_TOPOLOGY_ID
){
5521 expert_add_info_format(pinfo
, tlv_tree
, &ei_bgp_ls_error
,
5522 "Unexpected Multi Topology ID TLV's length (%u), it must be %u bytes!",
5523 sub_length
, BGP_NLRI_TLV_LEN_MULTI_TOPOLOGY_ID
);
5526 tlv_sub_item
= proto_tree_add_item(tlv_tree
,
5527 hf_bgp_ls_tlv_multi_topology_id
, tvb
, offset
, sub_length
+ 4,
5529 tlv_sub_tree
= proto_item_add_subtree(tlv_sub_item
, ett_bgp_mp_reach_nlri
);
5532 case BGP_NLRI_TLV_SRV6_SID_INFO
:
5533 if (sub_length
!= 16) {
5534 expert_add_info_format(pinfo
, tlv_tree
, &ei_bgp_ls_error
,
5535 "Unexpected SRv6 SID Information TLV's length (%u), it must be 16 bytes!",
5539 tlv_sub_item
= proto_tree_add_item(tlv_tree
,
5540 hf_bgp_ls_tlv_srv6_sid_info
, tvb
, offset
, sub_length
+ 4,
5542 tlv_sub_tree
= proto_item_add_subtree(tlv_sub_item
, ett_bgp_mp_reach_nlri
);
5546 expert_add_info_format(pinfo
, tlv_tree
, &ei_bgp_ls_error
,
5547 "Unknown SRv6 SID Descriptor TLV Code (%u)!", type
);
5551 proto_tree_add_item(tlv_sub_tree
, hf_bgp_ls_type
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
5552 proto_tree_add_item(tlv_sub_tree
, hf_bgp_ls_length
, tvb
, offset
+ 2, 2, ENC_BIG_ENDIAN
);
5555 case BGP_NLRI_TLV_MULTI_TOPOLOGY_ID
:
5556 tmp16
= tvb_get_ntohs(tvb
, offset
+ 4);
5559 expert_add_info_format(pinfo
, tlv_sub_tree
, &ei_bgp_ls_error
, "Reserved bits of Multi Topology ID must be set to zero! (%u)", tmp16
);
5561 proto_tree_add_item(tlv_sub_tree
, hf_bgp_ls_nlri_multi_topology_id
,
5562 tvb
, offset
+ 4, BGP_NLRI_TLV_LEN_MULTI_TOPOLOGY_ID
, ENC_BIG_ENDIAN
);
5565 case BGP_NLRI_TLV_SRV6_SID_INFO
:
5566 proto_tree_add_item(tlv_sub_tree
, hf_bgp_ls_tlv_srv6_sid_info_sid
,
5567 tvb
, offset
+ 4, 16, ENC_NA
);
5571 length
-= 4 + sub_length
;
5572 offset
+= 4 + sub_length
;
5573 diss_length
+= 4 + sub_length
;
5579 * Decode Flex Algo sub-TLVs in BGP-LS attributes
5582 decode_link_state_attribute_flex_algo_subtlv(proto_tree
*tree
, tvbuff_t
*tvb
, int offset
, packet_info
*pinfo
, uint8_t _U_ protocol_id
)
5588 proto_item
* tlv_item
;
5589 proto_tree
* tlv_tree
;
5592 type
= tvb_get_ntohs(tvb
, offset
);
5593 length
= tvb_get_ntohs(tvb
, offset
+ 2);
5596 case BGP_LS_SR_TLV_FLEX_ALGO_EXC_ANY_AFFINITY
:
5597 case BGP_LS_SR_TLV_FLEX_ALGO_INC_ANY_AFFINITY
:
5598 case BGP_LS_SR_TLV_FLEX_ALGO_INC_ALL_AFFINITY
:
5599 tlv_item
= proto_tree_add_item(tree
,
5600 (type
== BGP_LS_SR_TLV_FLEX_ALGO_EXC_ANY_AFFINITY
) ?
5601 hf_bgp_ls_sr_tlv_flex_algo_exc_any_affinity
:
5602 ((type
== BGP_LS_SR_TLV_FLEX_ALGO_INC_ANY_AFFINITY
) ?
5603 hf_bgp_ls_sr_tlv_flex_algo_inc_any_affinity
:
5604 hf_bgp_ls_sr_tlv_flex_algo_inc_all_affinity
),
5605 tvb
, offset
, length
+ 4, ENC_NA
);
5606 tlv_tree
= proto_item_add_subtree(tlv_item
, ett_bgp_link_state
);
5607 proto_tree_add_item(tlv_tree
, hf_bgp_ls_type
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
5608 ti
= proto_tree_add_item(tlv_tree
, hf_bgp_ls_length
, tvb
, offset
+ 2, 2, ENC_BIG_ENDIAN
);
5609 if (length
% 4 != 0) {
5610 expert_add_info_format(pinfo
, ti
, &ei_bgp_ls_error
, "Unexpected %s TLV's length (%u mod 4 != 0)",
5611 "Extended Administrative Group", length
);
5616 proto_tree_add_item(tlv_tree
, hf_bgp_ls_extended_administrative_group_value
, tvb
, offset
+ 4 + (length
- tmp16
), 4, ENC_NA
);
5621 case BGP_LS_SR_TLV_FLEX_ALGO_DEF_FLAGS
:
5623 static int * const flex_algo_def_flags
[] = {
5624 &hf_bgp_ls_sr_tlv_flex_algo_def_flags_flags_m
,
5627 tlv_item
= proto_tree_add_item(tree
, hf_bgp_ls_sr_tlv_flex_algo_def_flags
, tvb
, offset
, length
+ 4, ENC_NA
);
5628 tlv_tree
= proto_item_add_subtree(tlv_item
, ett_bgp_link_state
);
5629 proto_tree_add_item(tlv_tree
, hf_bgp_ls_type
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
5630 ti
= proto_tree_add_item(tlv_tree
, hf_bgp_ls_length
, tvb
, offset
+ 2, 2, ENC_BIG_ENDIAN
);
5632 expert_add_info_format(pinfo
, ti
, &ei_bgp_ls_error
, "Unexpected %s TLV's length (%u != 4)",
5633 "Flexible Algorithm Definition Flags", length
);
5636 proto_tree_add_bitmask(tlv_tree
, tvb
, offset
+ 4, hf_bgp_ls_sr_tlv_flex_algo_def_flags_flags
, ett_bgp_link_state
, flex_algo_def_flags
, ENC_NA
);
5640 case BGP_LS_SR_TLV_FLEX_ALGO_EXC_SRLG
:
5641 tlv_item
= proto_tree_add_item(tree
, hf_bgp_ls_sr_tlv_flex_algo_exc_srlg
, tvb
, offset
, length
+ 4, ENC_NA
);
5642 tlv_tree
= proto_item_add_subtree(tlv_item
, ett_bgp_link_state
);
5643 proto_tree_add_item(tlv_tree
, hf_bgp_ls_type
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
5644 ti
= proto_tree_add_item(tlv_tree
, hf_bgp_ls_length
, tvb
, offset
+ 2, 2, ENC_BIG_ENDIAN
);
5645 if (length
% 4 != 0) {
5646 expert_add_info_format(pinfo
, ti
, &ei_bgp_ls_error
, "Unexpected %s TLV's length (%u mod 4 != 0)",
5647 "Flexible Algorithm Exclude SRLG", length
);
5650 for (i
= 0; i
< length
; i
+= 4) {
5651 proto_tree_add_item(tlv_tree
, hf_bgp_ls_tlv_shared_risk_link_group_value
, tvb
, offset
+ 4 + i
, 4, ENC_BIG_ENDIAN
);
5656 expert_add_info_format(pinfo
, tree
, &ei_bgp_ls_warn
,
5657 "Unknown BGP-LS Flex-Algo sub-TLV Code (%u)!", type
);
5665 * Decode a multiprotocol prefix
5668 // NOLINTNEXTLINE(misc-no-recursion)
5669 decode_link_state_attribute_tlv(proto_tree
*tree
, tvbuff_t
*tvb
, int offset
, packet_info
*pinfo
, uint8_t protocol_id
)
5678 int local_offset
, local_length
;
5680 uint8_t sabm_len
, udabm_len
;
5683 proto_item
* tlv_item
;
5684 proto_tree
* tlv_tree
;
5685 proto_item
* tlv_sub_item
;
5686 proto_tree
* tlv_sub_tree
;
5689 type
= tvb_get_ntohs(tvb
, offset
);
5690 length
= tvb_get_ntohs(tvb
, offset
+ 2);
5692 increment_dissection_depth(pinfo
);
5695 /* NODE ATTRIBUTE TLVs */
5696 case BGP_NLRI_TLV_MULTI_TOPOLOGY_ID
:
5697 tlv_item
= proto_tree_add_item(tree
, hf_bgp_ls_tlv_multi_topology_id
, tvb
, offset
, length
+ 4, ENC_NA
);
5698 tlv_tree
= proto_item_add_subtree(tlv_item
, ett_bgp_link_state
);
5700 for (n
= 0; n
< (length
/ BGP_NLRI_TLV_LEN_MULTI_TOPOLOGY_ID
); n
++) {
5701 tmp16
= tvb_get_ntohs(tvb
, offset
+ 4 + (n
* BGP_NLRI_TLV_LEN_MULTI_TOPOLOGY_ID
));
5704 expert_add_info_format(pinfo
, tlv_tree
, &ei_bgp_ls_error
, "Reserved bits of Multi Topology ID must be set to zero! (%u)", tmp16
);
5706 proto_tree_add_item(tlv_tree
, hf_bgp_ls_nlri_multi_topology_id
, tvb
, offset
+ 4 + (n
* BGP_NLRI_TLV_LEN_MULTI_TOPOLOGY_ID
),
5707 BGP_NLRI_TLV_LEN_MULTI_TOPOLOGY_ID
, ENC_BIG_ENDIAN
);
5711 case BGP_NLRI_TLV_NODE_FLAG_BITS
:
5713 static int * const flags
[] = {
5714 &hf_bgp_ls_node_flag_bits_overload
,
5715 &hf_bgp_ls_node_flag_bits_attached
,
5716 &hf_bgp_ls_node_flag_bits_external
,
5717 &hf_bgp_ls_node_flag_bits_abr
,
5721 tlv_item
= proto_tree_add_item(tree
, hf_bgp_ls_tlv_node_flags_bits
, tvb
, offset
, length
+4, ENC_NA
);
5722 tlv_tree
= proto_item_add_subtree(tlv_item
, ett_bgp_link_state
);
5723 if(length
!= BGP_NLRI_TLV_LEN_NODE_FLAG_BITS
){
5724 expert_add_info_format(pinfo
, tlv_tree
, &ei_bgp_ls_error
, "Unexpected Node Flags Bits TLV's length (%u), it must be %u bytes!",
5725 length
, BGP_NLRI_TLV_LEN_NODE_FLAG_BITS
);
5728 proto_tree_add_item(tlv_tree
, hf_bgp_ls_type
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
5729 proto_tree_add_item(tlv_tree
, hf_bgp_ls_length
, tvb
, offset
+ 2, 2, ENC_BIG_ENDIAN
);
5730 proto_tree_add_bitmask_list(tlv_tree
, tvb
, offset
+4, 1, flags
, ENC_NA
);
5731 tmp8
= tvb_get_uint8(tvb
, offset
+4) & 0x0f;
5733 expert_add_info_format(pinfo
, tlv_tree
, &ei_bgp_ls_error
, "Reserved flag bits are not set to zero (%u).", tmp8
);
5738 case BGP_NLRI_TLV_OPAQUE_NODE_PROPERTIES
:
5739 tlv_item
= proto_tree_add_item(tree
, hf_bgp_ls_tlv_opaque_node_properties
, tvb
, offset
, length
+4, ENC_NA
);
5740 tlv_tree
= proto_item_add_subtree(tlv_item
, ett_bgp_link_state
);
5741 proto_tree_add_item(tlv_tree
, hf_bgp_ls_type
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
5742 proto_tree_add_item(tlv_tree
, hf_bgp_ls_length
, tvb
, offset
+ 2, 2, ENC_BIG_ENDIAN
);
5743 proto_tree_add_item(tlv_tree
, hf_bgp_ls_tlv_opaque_node_properties_value
, tvb
, offset
+ 4, length
, ENC_NA
);
5746 case BGP_NLRI_TLV_NODE_NAME
:
5747 tlv_item
= proto_tree_add_item(tree
, hf_bgp_ls_tlv_node_name
, tvb
, offset
, length
+4, ENC_NA
);
5748 tlv_tree
= proto_item_add_subtree(tlv_item
, ett_bgp_link_state
);
5749 proto_tree_add_item(tlv_tree
, hf_bgp_ls_type
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
5750 proto_tree_add_item(tlv_tree
, hf_bgp_ls_length
, tvb
, offset
+ 2, 2, ENC_BIG_ENDIAN
);
5751 proto_tree_add_item(tlv_tree
, hf_bgp_ls_tlv_node_name_value
, tvb
, offset
+ 4, length
, ENC_ASCII
);
5754 case BGP_NLRI_TLV_IS_IS_AREA_IDENTIFIER
:
5755 tlv_item
= proto_tree_add_item(tree
, hf_bgp_ls_tlv_is_is_area_identifier
, tvb
, offset
, length
+4, ENC_NA
);
5756 tlv_tree
= proto_item_add_subtree(tlv_item
, ett_bgp_link_state
);
5757 proto_tree_add_item(tlv_tree
, hf_bgp_ls_type
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
5758 proto_tree_add_item(tlv_tree
, hf_bgp_ls_length
, tvb
, offset
+ 2, 2, ENC_BIG_ENDIAN
);
5759 proto_tree_add_item(tlv_tree
, hf_bgp_ls_tlv_is_is_area_identifier_value
, tvb
, offset
+ 4, length
, ENC_NA
);
5762 case BGP_LS_SR_TLV_SR_CAPABILITY
:
5766 +--+--+--+--+--+--+--+--+
5767 |I |V |H | | | | | |
5768 +--+--+--+--+--+--+--+--+
5770 static int * const sr_capabilities_flags
[] = {
5771 &hf_bgp_ls_sr_tlv_capabilities_flags_i
,
5772 &hf_bgp_ls_sr_tlv_capabilities_flags_v
,
5773 &hf_bgp_ls_sr_tlv_capabilities_flags_h
,
5774 &hf_bgp_ls_sr_tlv_capabilities_flags_reserved
,
5779 tlv_item
= proto_tree_add_item(tree
, hf_bgp_ls_sr_tlv_capabilities
, tvb
, offset
, length
+ 4, ENC_NA
);
5780 tlv_tree
= proto_item_add_subtree(tlv_item
, ett_bgp_link_state
);
5781 proto_tree_add_item(tlv_tree
, hf_bgp_ls_type
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
5782 proto_tree_add_item(tlv_tree
, hf_bgp_ls_length
, tvb
, offset
+ 2, 2, ENC_BIG_ENDIAN
);
5783 proto_tree_add_bitmask(tlv_tree
, tvb
, offset
+ 4, hf_bgp_ls_sr_tlv_capabilities_flags
,
5784 ett_bgp_link_state
, sr_capabilities_flags
, ENC_BIG_ENDIAN
);
5785 /* past flags and reserved byte, we got one or more range + SID/Label Sub-TLV entries */
5786 offset2
= offset
+ 4 + 2;
5787 remaining_data
= length
- 2;
5788 while (remaining_data
> 0) {
5789 uint16_t sid_len
= 0;
5790 /* parse and consume the range field */
5791 proto_tree_add_item(tlv_tree
, hf_bgp_ls_sr_tlv_capabilities_range_size
, tvb
, offset2
, 3, ENC_BIG_ENDIAN
);
5793 /* parse and consume type/len fields */
5794 proto_tree_add_item(tlv_tree
, hf_bgp_ls_type
, tvb
, offset2
, 2, ENC_BIG_ENDIAN
);
5796 proto_tree_add_item(tlv_tree
, hf_bgp_ls_length
, tvb
, offset2
, 2, ENC_BIG_ENDIAN
);
5797 sid_len
= tvb_get_ntohs(tvb
, offset2
);
5800 /* parse and consume the SID/Label field */
5801 proto_tree_add_item(tlv_tree
, hf_bgp_ls_sr_tlv_capabilities_sid_label
, tvb
, offset2
, 3, ENC_BIG_ENDIAN
);
5803 remaining_data
-= 10;
5805 /* parse and consume the SID/Index field */
5806 proto_tree_add_item(tlv_tree
, hf_bgp_ls_sr_tlv_capabilities_sid_index
, tvb
, offset2
, 4, ENC_BIG_ENDIAN
);
5808 remaining_data
-= 11;
5814 case BGP_LS_SR_TLV_SR_LOCAL_BLOCK
:
5818 tlv_item
= proto_tree_add_item(tree
, hf_bgp_ls_sr_tlv_local_block
, tvb
, offset
, length
+ 4, ENC_NA
);
5819 tlv_tree
= proto_item_add_subtree(tlv_item
, ett_bgp_link_state
);
5820 proto_tree_add_item(tlv_tree
, hf_bgp_ls_type
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
5821 proto_tree_add_item(tlv_tree
, hf_bgp_ls_length
, tvb
, offset
+ 2, 2, ENC_BIG_ENDIAN
);
5822 proto_tree_add_item(tlv_tree
, hf_bgp_ls_sr_tlv_local_block_flags
, tvb
, offset
+ 4, 1, ENC_NA
);
5823 /* past flags and reserved byte, we got one or more range + SID/Label Sub-TLV entries */
5824 offset2
= offset
+ 4 + 2;
5825 remaining_data
= length
- 2;
5826 while (remaining_data
> 0) {
5827 uint16_t sid_len
= 0;
5828 /* parse and consume the range field */
5829 proto_tree_add_item(tlv_tree
, hf_bgp_ls_sr_tlv_local_block_range_size
, tvb
, offset2
, 3, ENC_BIG_ENDIAN
);
5831 /* parse and consume type/len fields */
5832 proto_tree_add_item(tlv_tree
, hf_bgp_ls_type
, tvb
, offset2
, 2, ENC_BIG_ENDIAN
);
5834 proto_tree_add_item(tlv_tree
, hf_bgp_ls_length
, tvb
, offset2
, 2, ENC_BIG_ENDIAN
);
5835 sid_len
= tvb_get_ntohs(tvb
, offset2
);
5838 /* parse and consume the SID/Label field */
5839 proto_tree_add_item(tlv_tree
, hf_bgp_ls_sr_tlv_local_block_sid_label
, tvb
, offset2
, 3, ENC_BIG_ENDIAN
);
5841 remaining_data
-= 10;
5843 /* parse and consume the SID/Index field */
5844 proto_tree_add_item(tlv_tree
, hf_bgp_ls_sr_tlv_local_block_sid_index
, tvb
, offset2
, 4, ENC_BIG_ENDIAN
);
5846 remaining_data
-= 11;
5852 case BGP_LS_SR_TLV_SR_ALGORITHM
:
5856 tlv_item
= proto_tree_add_item(tree
, hf_bgp_ls_sr_tlv_algorithm
, tvb
, offset
, length
+4, ENC_NA
);
5857 tlv_tree
= proto_item_add_subtree(tlv_item
, ett_bgp_link_state
);
5858 proto_tree_add_item(tlv_tree
, hf_bgp_ls_type
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
5859 proto_tree_add_item(tlv_tree
, hf_bgp_ls_length
, tvb
, offset
+ 2, 2, ENC_BIG_ENDIAN
);
5860 /* past type-length fields, we got one or more 'Algorithm N' value */
5861 offset2
= offset
+ 4;
5862 remaining_data
= length
;
5863 while (remaining_data
> 0) {
5864 proto_tree_add_item(tlv_tree
, hf_bgp_ls_sr_tlv_algorithm_value
, tvb
, offset2
, 1, ENC_NA
);
5866 remaining_data
-= 1;
5871 case BGP_LS_SR_TLV_SRV6_CAPABILITY
:
5873 static int * const srv6_cap_flags
[] = {
5874 &hf_bgp_ls_sr_tlv_srv6_cap_flags_o
,
5875 &hf_bgp_ls_sr_tlv_srv6_cap_flags_reserved
,
5878 tlv_item
= proto_tree_add_item(tree
, hf_bgp_ls_sr_tlv_srv6_cap
, tvb
, offset
, length
+ 4, ENC_NA
);
5879 tlv_tree
= proto_item_add_subtree(tlv_item
, ett_bgp_link_state
);
5880 proto_tree_add_item(tlv_tree
, hf_bgp_ls_type
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
5881 ti
= proto_tree_add_item(tlv_tree
, hf_bgp_ls_length
, tvb
, offset
+ 2, 2, ENC_BIG_ENDIAN
);
5883 expert_add_info_format(pinfo
, ti
, &ei_bgp_ls_error
,
5884 "Unexpected TLV Length (%u) in BGP-LS %s TLV, it must be %u bytes!",
5885 length
, "SRv6 Capabilities", 4);
5888 proto_tree_add_bitmask(tlv_tree
, tvb
, offset
+ 4, hf_bgp_ls_sr_tlv_srv6_cap_flags
,
5889 ett_bgp_link_state
, srv6_cap_flags
, ENC_BIG_ENDIAN
);
5890 proto_tree_add_item(tlv_tree
, hf_bgp_ls_sr_tlv_srv6_cap_reserved
, tvb
, offset
+ 6, 2, ENC_BIG_ENDIAN
);
5894 case BGP_LS_SR_TLV_FLEX_ALGO_DEF
:
5895 tlv_item
= proto_tree_add_item(tree
, hf_bgp_ls_sr_tlv_flex_algo_def
, tvb
, offset
, length
+4, ENC_NA
);
5896 tlv_tree
= proto_item_add_subtree(tlv_item
, ett_bgp_link_state
);
5897 proto_tree_add_item(tlv_tree
, hf_bgp_ls_type
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
5898 proto_tree_add_item(tlv_tree
, hf_bgp_ls_length
, tvb
, offset
+ 2, 2, ENC_BIG_ENDIAN
);
5899 proto_tree_add_item(tlv_tree
, hf_bgp_ls_sr_tlv_flex_algo_algorithm
, tvb
, offset
+ 4, 1, ENC_NA
);
5900 proto_tree_add_item(tlv_tree
, hf_bgp_ls_sr_tlv_flex_algo_metric_type
, tvb
, offset
+ 5, 1, ENC_NA
);
5901 proto_tree_add_item(tlv_tree
, hf_bgp_ls_sr_tlv_flex_algo_calc_type
, tvb
, offset
+ 6, 1, ENC_NA
);
5902 proto_tree_add_item(tlv_tree
, hf_bgp_ls_sr_tlv_flex_algo_priority
, tvb
, offset
+ 7, 1, ENC_NA
);
5903 local_offset
= offset
+ 8;
5904 while (local_offset
< offset
+ length
) {
5905 advance
= decode_link_state_attribute_flex_algo_subtlv(tlv_tree
, tvb
, local_offset
, pinfo
, protocol_id
);
5909 local_offset
+= advance
;
5913 /* NODE & LINK ATTRIBUTE TLVs */
5914 case BGP_NLRI_TLV_NODE_MSD
:
5915 case BGP_NLRI_TLV_LINK_MSD
:
5916 tlv_item
= proto_tree_add_item(tree
,
5917 (type
== BGP_NLRI_TLV_NODE_MSD
?
5918 hf_bgp_ls_tlv_node_msd
: hf_bgp_ls_tlv_link_msd
),
5919 tvb
, offset
, length
+ 4, ENC_NA
);
5920 tlv_tree
= proto_item_add_subtree(tlv_item
, ett_bgp_mp_reach_nlri
);
5921 proto_tree_add_item(tlv_tree
, hf_bgp_ls_type
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
5922 proto_tree_add_item(tlv_tree
, hf_bgp_ls_length
, tvb
, offset
+ 2, 2, ENC_BIG_ENDIAN
);
5923 local_offset
= offset
+ 4;
5924 local_length
= length
;
5925 while (local_length
>= 2) {
5926 proto_tree_add_item(tlv_tree
, hf_bgp_ls_tlv_igp_msd_type
, tvb
, local_offset
, 1, ENC_NA
);
5927 proto_tree_add_item(tlv_tree
, hf_bgp_ls_tlv_igp_msd_value
, tvb
, local_offset
+1, 1, ENC_NA
);
5933 case BGP_NLRI_TLV_IPV4_ROUTER_ID_OF_LOCAL_NODE
:
5934 tlv_item
= proto_tree_add_item(tree
, hf_bgp_ls_tlv_ipv4_router_id_of_local_node
, tvb
, offset
, length
+4, ENC_NA
);
5935 tlv_tree
= proto_item_add_subtree(tlv_item
, ett_bgp_link_state
);
5936 proto_tree_add_item(tlv_tree
, hf_bgp_ls_type
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
5937 proto_tree_add_item(tlv_tree
, hf_bgp_ls_length
, tvb
, offset
+ 2, 2, ENC_BIG_ENDIAN
);
5938 if(length
!= BGP_NLRI_TLV_LEN_IPV4_ROUTER_ID_OF_LOCAL_NODE
){
5939 expert_add_info_format(pinfo
, tlv_tree
, &ei_bgp_ls_error
, "Unexpected IPv4 Router-ID TLV's length (%u), it must be %u bytes!",
5940 length
, BGP_NLRI_TLV_LEN_IPV4_ROUTER_ID_OF_LOCAL_NODE
);
5943 proto_tree_add_item(tlv_tree
, hf_bgp_ls_tlv_ipv4_router_id_value
, tvb
, offset
+ 4, 4, ENC_BIG_ENDIAN
);
5945 case BGP_NLRI_TLV_IPV6_ROUTER_ID_OF_LOCAL_NODE
:
5946 tlv_item
= proto_tree_add_item(tree
, hf_bgp_ls_tlv_ipv6_router_id_of_local_node
, tvb
, offset
, length
+4, ENC_NA
);
5947 tlv_tree
= proto_item_add_subtree(tlv_item
, ett_bgp_link_state
);
5948 proto_tree_add_item(tlv_tree
, hf_bgp_ls_type
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
5949 proto_tree_add_item(tlv_tree
, hf_bgp_ls_length
, tvb
, offset
+ 2, 2, ENC_BIG_ENDIAN
);
5950 if(length
!= BGP_NLRI_TLV_LEN_IPV6_ROUTER_ID_OF_LOCAL_NODE
){
5951 expert_add_info_format(pinfo
, tlv_tree
, &ei_bgp_ls_error
, "Unexpected IPv6 Router-ID TLV's length (%u), it must be %u bytes!",
5952 length
, BGP_NLRI_TLV_LEN_IPV6_ROUTER_ID_OF_LOCAL_NODE
);
5955 proto_tree_add_item(tlv_tree
, hf_bgp_ls_tlv_ipv6_router_id_value
, tvb
, offset
+ 4, BGP_NLRI_TLV_LEN_IPV6_ROUTER_ID_OF_LOCAL_NODE
, ENC_NA
);
5958 /* Link Attribute TLVs */
5959 case BGP_NLRI_TLV_LINK_LOCAL_REMOTE_IDENTIFIERS
:
5960 if (length
!= BGP_NLRI_TLV_LEN_LINK_LOCAL_REMOTE_IDENTIFIERS
) {
5961 expert_add_info_format(pinfo
, tree
, &ei_bgp_ls_error
,
5962 "Unexpected Link Local/Remote Identifiers TLV's length (%u), it must be %u bytes!",
5963 length
, BGP_NLRI_TLV_LEN_LINK_LOCAL_REMOTE_IDENTIFIERS
);
5966 tlv_item
= proto_tree_add_item(tree
,
5967 hf_bgp_ls_tlv_link_local_remote_identifiers
, tvb
, offset
,
5968 length
+ 4, ENC_NA
);
5969 tlv_tree
= proto_item_add_subtree(tlv_item
, ett_bgp_mp_reach_nlri
);
5970 proto_tree_add_item(tlv_tree
, hf_bgp_ls_type
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
5971 proto_tree_add_item(tlv_tree
, hf_bgp_ls_length
, tvb
, offset
+ 2, 2, ENC_BIG_ENDIAN
);
5972 proto_tree_add_item(tlv_tree
, hf_bgp_ls_nlri_link_local_identifier
, tvb
, offset
+ 4, 4, ENC_BIG_ENDIAN
);
5973 proto_tree_add_item(tlv_tree
, hf_bgp_ls_nlri_link_remote_identifier
, tvb
, offset
+ 8, 4, ENC_BIG_ENDIAN
);
5976 case BGP_NLRI_TLV_IPV4_ROUTER_ID_OF_REMOTE_NODE
:
5977 tlv_item
= proto_tree_add_item(tree
, hf_bgp_ls_tlv_ipv4_router_id_of_remote_node
, tvb
, offset
, length
+4, ENC_NA
);
5978 tlv_tree
= proto_item_add_subtree(tlv_item
, ett_bgp_link_state
);
5979 proto_tree_add_item(tlv_tree
, hf_bgp_ls_type
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
5980 proto_tree_add_item(tlv_tree
, hf_bgp_ls_length
, tvb
, offset
+ 2, 2, ENC_BIG_ENDIAN
);
5981 if(length
!= BGP_NLRI_TLV_LEN_IPV4_ROUTER_ID_OF_REMOTE_NODE
){
5982 expert_add_info_format(pinfo
, tlv_tree
, &ei_bgp_ls_error
, "Unexpected IPv4 Router-ID TLV's length (%u), it must be %u bytes!",
5983 length
, BGP_NLRI_TLV_LEN_IPV4_ROUTER_ID_OF_REMOTE_NODE
);
5986 proto_tree_add_item(tlv_tree
, hf_bgp_ls_tlv_ipv4_router_id_value
, tvb
, offset
+ 4, 4, ENC_BIG_ENDIAN
);
5989 case BGP_NLRI_TLV_IPV6_ROUTER_ID_OF_REMOTE_NODE
:
5990 tlv_item
= proto_tree_add_item(tree
, hf_bgp_ls_tlv_ipv6_router_id_of_remote_node
, tvb
, offset
, length
+4, ENC_NA
);
5991 tlv_tree
= proto_item_add_subtree(tlv_item
, ett_bgp_link_state
);
5992 proto_tree_add_item(tlv_tree
, hf_bgp_ls_type
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
5993 proto_tree_add_item(tlv_tree
, hf_bgp_ls_length
, tvb
, offset
+ 2, 2, ENC_BIG_ENDIAN
);
5994 if(length
!= BGP_NLRI_TLV_LEN_IPV6_ROUTER_ID_OF_REMOTE_NODE
){
5995 expert_add_info_format(pinfo
, tlv_tree
, &ei_bgp_ls_error
, "Unexpected IPv6 Router-ID TLV's length (%u), it must be %u bytes!",
5996 length
, BGP_NLRI_TLV_LEN_IPV6_ROUTER_ID_OF_REMOTE_NODE
);
5999 proto_tree_add_item(tlv_tree
, hf_bgp_ls_tlv_ipv6_router_id_value
, tvb
, offset
+ 4, BGP_NLRI_TLV_LEN_IPV6_ROUTER_ID_OF_REMOTE_NODE
, ENC_NA
);
6002 case BGP_NLRI_TLV_ADMINISTRATIVE_GROUP_COLOR
:
6003 tlv_item
= proto_tree_add_item(tree
, hf_bgp_ls_tlv_administrative_group_color
, tvb
, offset
, length
+4, ENC_NA
);
6004 tlv_tree
= proto_item_add_subtree(tlv_item
, ett_bgp_link_state
);
6005 if(length
!= BGP_NLRI_TLV_LEN_ADMINISTRATIVE_GROUP_COLOR
){
6006 expert_add_info_format(pinfo
, tlv_tree
, &ei_bgp_ls_error
, "Unexpected Administrative group (color) TLV's length (%u), it must be %u bytes!",
6007 length
, BGP_NLRI_TLV_LEN_ADMINISTRATIVE_GROUP_COLOR
);
6010 proto_tree_add_item(tlv_tree
, hf_bgp_ls_type
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
6011 proto_tree_add_item(tlv_tree
, hf_bgp_ls_length
, tvb
, offset
+ 2, 2, ENC_BIG_ENDIAN
);
6012 tmp32
= tvb_get_ntohl(tvb
, offset
+ 4);
6013 tlv_sub_item
= proto_tree_add_item(tlv_tree
, hf_bgp_ls_tlv_administrative_group_color_value
, tvb
, offset
+ 4, 4, ENC_BIG_ENDIAN
);
6014 tlv_sub_tree
= proto_item_add_subtree(tlv_sub_item
, ett_bgp_prefix
);
6016 for(n
= 0; n
<32; n
++){
6017 if( tmp32
& mask
) proto_tree_add_uint(tlv_sub_tree
, hf_bgp_ls_tlv_administrative_group
, tvb
, offset
+ 4, 4, n
);
6022 case BGP_NLRI_TLV_MAX_LINK_BANDWIDTH
:
6023 tlv_item
= proto_tree_add_item(tree
, hf_bgp_ls_tlv_max_link_bandwidth
, tvb
, offset
, length
+4, ENC_NA
);
6024 tlv_tree
= proto_item_add_subtree(tlv_item
, ett_bgp_link_state
);
6025 if(length
!= BGP_NLRI_TLV_LEN_MAX_LINK_BANDWIDTH
){
6026 expert_add_info_format(pinfo
, tlv_tree
, &ei_bgp_ls_error
, "Unexpected Maximum link bandwidth TLV's length (%u), it must be %u bytes!",
6027 length
, BGP_NLRI_TLV_LEN_MAX_LINK_BANDWIDTH
);
6030 proto_tree_add_item(tlv_tree
, hf_bgp_ls_type
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
6031 proto_tree_add_item(tlv_tree
, hf_bgp_ls_length
, tvb
, offset
+ 2, 2, ENC_BIG_ENDIAN
);
6032 tmp_float
= tvb_get_ntohieee_float(tvb
, offset
+ 4)*8/1000000;
6033 proto_tree_add_float_format(tlv_tree
, hf_bgp_ls_bandwidth_value
, tvb
, offset
+ 4, 4, tmp_float
, "Maximum link bandwidth: %.2f Mbps", tmp_float
);
6036 case BGP_NLRI_TLV_MAX_RESERVABLE_LINK_BANDWIDTH
:
6037 tlv_item
= proto_tree_add_item(tree
, hf_bgp_ls_tlv_max_reservable_link_bandwidth
, tvb
, offset
, length
+4, ENC_NA
);
6038 tlv_tree
= proto_item_add_subtree(tlv_item
, ett_bgp_link_state
);
6039 if(length
!= BGP_NLRI_TLV_LEN_MAX_RESERVABLE_LINK_BANDWIDTH
){
6040 expert_add_info_format(pinfo
, tlv_tree
, &ei_bgp_ls_error
, "Unexpected Maximum reservable link bandwidth TLV's length (%u), it must be %u bytes!",
6041 length
, BGP_NLRI_TLV_LEN_MAX_RESERVABLE_LINK_BANDWIDTH
);
6044 proto_tree_add_item(tlv_tree
, hf_bgp_ls_type
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
6045 proto_tree_add_item(tlv_tree
, hf_bgp_ls_length
, tvb
, offset
+ 2, 2, ENC_BIG_ENDIAN
);
6046 tmp_float
= tvb_get_ntohieee_float(tvb
, offset
+ 4)*8/1000000;
6047 proto_tree_add_float_format(tlv_tree
, hf_bgp_ls_bandwidth_value
, tvb
, offset
+ 4, 4, tmp_float
, "Maximum reservable link bandwidth: %.2f Mbps", tmp_float
);
6050 case BGP_NLRI_TLV_UNRESERVED_BANDWIDTH
:
6051 tlv_item
= proto_tree_add_item(tree
, hf_bgp_ls_tlv_unreserved_bandwidth
, tvb
, offset
, length
+4, ENC_NA
);
6052 tlv_tree
= proto_item_add_subtree(tlv_item
, ett_bgp_link_state
);
6053 if(length
!= BGP_NLRI_TLV_LEN_UNRESERVED_BANDWIDTH
){
6054 expert_add_info_format(pinfo
, tlv_tree
, &ei_bgp_ls_error
, "Unexpected Unreserved bandwidth TLV's length (%u), it must be %u bytes!",
6055 length
, BGP_NLRI_TLV_LEN_UNRESERVED_BANDWIDTH
);
6058 proto_tree_add_item(tlv_tree
, hf_bgp_ls_type
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
6059 proto_tree_add_item(tlv_tree
, hf_bgp_ls_length
, tvb
, offset
+ 2, 2, ENC_BIG_ENDIAN
);
6060 for(n
= 0; n
<8; n
++){
6061 tmp_float
= tvb_get_ntohieee_float(tvb
, offset
+ 4 + (4 * n
))*8/1000000;
6062 tlv_sub_item
= proto_tree_add_float_format(tlv_tree
, hf_bgp_ls_bandwidth_value
, tvb
, offset
+ 4 + (4 * n
), 4, tmp_float
, "Unreserved Bandwidth: %.2f Mbps", tmp_float
);
6063 proto_item_prepend_text(tlv_sub_item
, "Priority %u, ", n
);
6067 case BGP_NLRI_TLV_TE_DEFAULT_METRIC
:
6068 tlv_item
= proto_tree_add_item(tree
, hf_bgp_ls_tlv_te_default_metric
, tvb
, offset
, length
+4, ENC_NA
);
6069 tlv_tree
= proto_item_add_subtree(tlv_item
, ett_bgp_link_state
);
6070 /* FF: The 'TE Default Metric TLV's length changed. From draft-ietf-idr-ls-distribution-00 to 04
6071 was 3 bytes as per RFC5305/3.7, since version 05 is 4 bytes. Here we try to parse both formats
6072 without complain because there are real implementations out there based on the 3 bytes size. At
6073 the same time we clearly highlight that 3 is "old" and 4 is correct via expert info. */
6074 if (length
== BGP_NLRI_TLV_LEN_TE_DEFAULT_METRIC_OLD
) {
6075 expert_add_info_format(pinfo
, tlv_tree
, &ei_bgp_ls_warn
,
6076 "Old TE Default Metric TLV's length (%u), it should be %u bytes!",
6078 BGP_NLRI_TLV_LEN_TE_DEFAULT_METRIC_NEW
);
6079 /* just a warning do not give up dissection */
6081 if (length
!= BGP_NLRI_TLV_LEN_TE_DEFAULT_METRIC_OLD
&& length
!= BGP_NLRI_TLV_LEN_TE_DEFAULT_METRIC_NEW
) {
6082 expert_add_info_format(pinfo
, tlv_tree
, &ei_bgp_ls_error
,
6083 "Unexpected TE Default Metric TLV's length (%u), it must be %u or %u bytes!",
6085 BGP_NLRI_TLV_LEN_TE_DEFAULT_METRIC_OLD
,
6086 BGP_NLRI_TLV_LEN_TE_DEFAULT_METRIC_NEW
);
6087 /* major error give up dissection */
6090 proto_tree_add_item(tlv_tree
, hf_bgp_ls_type
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
6091 proto_tree_add_item(tlv_tree
, hf_bgp_ls_length
, tvb
, offset
+ 2, 2, ENC_BIG_ENDIAN
);
6092 if (length
== BGP_NLRI_TLV_LEN_TE_DEFAULT_METRIC_OLD
) {
6093 proto_tree_add_item(tlv_tree
, hf_bgp_ls_tlv_te_default_metric_value_old
, tvb
, offset
+ 4, 3, ENC_BIG_ENDIAN
);
6094 } else if (length
== BGP_NLRI_TLV_LEN_TE_DEFAULT_METRIC_NEW
) {
6095 proto_tree_add_item(tlv_tree
, hf_bgp_ls_tlv_te_default_metric_value
, tvb
, offset
+ 4, 4, ENC_BIG_ENDIAN
);
6099 case BGP_NLRI_TLV_LINK_PROTECTION_TYPE
:
6100 tlv_item
= proto_tree_add_item(tree
, hf_bgp_ls_tlv_link_protection_type
, tvb
, offset
, length
+4, ENC_NA
);
6101 tlv_tree
= proto_item_add_subtree(tlv_item
, ett_bgp_link_state
);
6102 if(length
!= BGP_NLRI_TLV_LEN_LINK_PROTECTION_TYPE
){
6103 expert_add_info_format(pinfo
, tlv_tree
, &ei_bgp_ls_error
, "Unexpected Link Protection Type TLV's length (%u), it must be %u bytes!",
6104 length
, BGP_NLRI_TLV_LEN_LINK_PROTECTION_TYPE
);
6108 static int * const nlri_flags
[] = {
6109 &hf_bgp_ls_link_protection_type_extra_traffic
,
6110 &hf_bgp_ls_link_protection_type_unprotected
,
6111 &hf_bgp_ls_link_protection_type_shared
,
6112 &hf_bgp_ls_link_protection_type_dedicated_1to1
,
6113 &hf_bgp_ls_link_protection_type_dedicated_1plus1
,
6114 &hf_bgp_ls_link_protection_type_enhanced
,
6118 proto_tree_add_item(tlv_tree
, hf_bgp_ls_type
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
6119 proto_tree_add_item(tlv_tree
, hf_bgp_ls_length
, tvb
, offset
+ 2, 2, ENC_BIG_ENDIAN
);
6120 tmp8
= tvb_get_uint8(tvb
, offset
+ 4);
6122 tlv_sub_item
= proto_tree_add_bitmask(tlv_tree
, tvb
, offset
+ 4, hf_bgp_ls_tlv_link_protection_type_value
, ett_bgp_mp_reach_nlri
, nlri_flags
, ENC_NA
);
6125 expert_add_info_format(pinfo
, tlv_sub_item
, &ei_bgp_ls_error
, "Reserved Protection Capabilities bits are not set to zero (%u).", tmp8
);
6127 tmp8
= tvb_get_uint8(tvb
, offset
+ 4 + 1);
6129 expert_add_info_format(pinfo
, tlv_tree
, &ei_bgp_ls_error
, "Reserved field is not set to zero. (%u)", tmp8
);
6133 case BGP_NLRI_TLV_MPLS_PROTOCOL_MASK
:
6135 static int * const flags
[] = {
6136 &hf_bgp_ls_mpls_protocol_mask_flag_l
,
6137 &hf_bgp_ls_mpls_protocol_mask_flag_r
,
6141 tlv_item
= proto_tree_add_item(tree
, hf_bgp_ls_tlv_mpls_protocol_mask
, tvb
, offset
, length
+4, ENC_NA
);
6142 tlv_tree
= proto_item_add_subtree(tlv_item
, ett_bgp_link_state
);
6143 if(length
!= BGP_NLRI_TLV_LEN_MPLS_PROTOCOL_MASK
){
6144 expert_add_info_format(pinfo
, tlv_tree
, &ei_bgp_ls_error
, "Unexpected MPLS Protocol Mask TLV's length (%u), it must be %u bytes!",
6145 length
, BGP_NLRI_TLV_LEN_MPLS_PROTOCOL_MASK
);
6148 proto_tree_add_item(tlv_tree
, hf_bgp_ls_type
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
6149 proto_tree_add_item(tlv_tree
, hf_bgp_ls_length
, tvb
, offset
+ 2, 2, ENC_BIG_ENDIAN
);
6150 proto_tree_add_bitmask_list(tlv_tree
, tvb
, offset
+4, 1, flags
, ENC_NA
);
6151 tmp8
= tvb_get_uint8(tvb
, offset
+ 4) & 0x3f;
6153 proto_tree_add_expert_format(tlv_tree
, pinfo
, &ei_bgp_ls_error
, tvb
, offset
+ 4, 1,
6154 "Reserved flags are not set to zero (%u).", tmp8
);
6158 case BGP_NLRI_TLV_METRIC
:
6159 /* FF: The IGP 'Metric TLV's length changed. From draft-ietf-idr-ls-distribution-00 to 02
6160 was fixed at 3 bytes, since version 03 is variable 1/2/3 bytes. We cannot complain if
6161 length is not fixed at 3. */
6162 tlv_item
= proto_tree_add_item(tree
, hf_bgp_ls_tlv_metric
, tvb
, offset
, length
+ 4, ENC_NA
);
6163 tlv_tree
= proto_item_add_subtree(tlv_item
, ett_bgp_link_state
);
6164 if (length
> BGP_NLRI_TLV_LEN_MAX_METRIC
) {
6165 expert_add_info_format(pinfo
, tlv_tree
, &ei_bgp_ls_error
,
6166 "Unexpected Metric TLV's length (%u), it must be less than %u bytes!",
6167 length
, BGP_NLRI_TLV_LEN_MAX_METRIC
);
6170 proto_tree_add_item(tlv_tree
, hf_bgp_ls_type
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
6171 proto_tree_add_item(tlv_tree
, hf_bgp_ls_length
, tvb
, offset
+ 2, 2, ENC_BIG_ENDIAN
);
6173 proto_tree_add_item(tlv_tree
, hf_bgp_ls_tlv_metric_value1
, tvb
, offset
+ 4, 1, ENC_BIG_ENDIAN
);
6174 } else if (length
== 2) {
6175 proto_tree_add_item(tlv_tree
, hf_bgp_ls_tlv_metric_value2
, tvb
, offset
+ 4, 2, ENC_BIG_ENDIAN
);
6176 } else if (length
== 3) {
6177 proto_tree_add_item(tlv_tree
, hf_bgp_ls_tlv_metric_value3
, tvb
, offset
+ 4, 3, ENC_BIG_ENDIAN
);
6180 case BGP_NLRI_TLV_SHARED_RISK_LINK_GROUP
:
6181 tlv_item
= proto_tree_add_item(tree
, hf_bgp_ls_tlv_shared_risk_link_group
, tvb
, offset
, length
+4, ENC_NA
);
6182 tlv_tree
= proto_item_add_subtree(tlv_item
, ett_bgp_link_state
);
6183 proto_tree_add_item(tlv_tree
, hf_bgp_ls_type
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
6184 proto_tree_add_item(tlv_tree
, hf_bgp_ls_length
, tvb
, offset
+ 2, 2, ENC_BIG_ENDIAN
);
6189 proto_tree_add_expert_format(tlv_tree
, pinfo
, &ei_bgp_ls_error
,
6190 tvb
, offset
+ 4 + (n
* 4), tmp16
,
6191 "Shared Risk Link Group Value must be 4 bytes long (%u).", tmp16
);
6194 proto_tree_add_item(tlv_tree
, hf_bgp_ls_tlv_shared_risk_link_group_value
, tvb
, offset
+ 4 + (n
* 4), 4, ENC_BIG_ENDIAN
);
6200 case BGP_NLRI_TLV_OPAQUE_LINK_ATTRIBUTE
:
6201 tlv_item
= proto_tree_add_item(tree
, hf_bgp_ls_tlv_opaque_link_attribute
, tvb
, offset
, length
+4, ENC_NA
);
6202 tlv_tree
= proto_item_add_subtree(tlv_item
, ett_bgp_link_state
);
6203 proto_tree_add_item(tlv_tree
, hf_bgp_ls_type
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
6204 proto_tree_add_item(tlv_tree
, hf_bgp_ls_length
, tvb
, offset
+ 2, 2, ENC_BIG_ENDIAN
);
6205 proto_tree_add_item(tlv_tree
, hf_bgp_ls_tlv_opaque_link_attribute_value
, tvb
, offset
+ 4, length
, ENC_NA
);
6208 case BGP_NLRI_TLV_LINK_NAME_ATTRIBUTE
:
6209 tlv_item
= proto_tree_add_item(tree
, hf_bgp_ls_tlv_link_name_attribute
, tvb
, offset
, length
+4, ENC_NA
);
6210 tlv_tree
= proto_item_add_subtree(tlv_item
, ett_bgp_link_state
);
6211 proto_tree_add_item(tlv_tree
, hf_bgp_ls_type
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
6212 proto_tree_add_item(tlv_tree
, hf_bgp_ls_length
, tvb
, offset
+ 2, 2, ENC_BIG_ENDIAN
);
6213 proto_tree_add_item(tlv_tree
, hf_bgp_ls_tlv_link_name_attribute_value
, tvb
, offset
+ 4, length
, ENC_ASCII
);
6216 case BGP_LS_SR_TLV_ADJ_SID
:
6220 +--+--+--+--+--+--+--+--+
6221 |F |B |V |L |S |P | | |
6222 +--+--+--+--+--+--+--+--+
6224 static int * const adj_sid_isis_flags
[] = {
6225 &hf_bgp_ls_sr_tlv_adjacency_sid_flags_fi
,
6226 &hf_bgp_ls_sr_tlv_adjacency_sid_flags_bi
,
6227 &hf_bgp_ls_sr_tlv_adjacency_sid_flags_vi
,
6228 &hf_bgp_ls_sr_tlv_adjacency_sid_flags_li
,
6229 &hf_bgp_ls_sr_tlv_adjacency_sid_flags_si
,
6230 &hf_bgp_ls_sr_tlv_adjacency_sid_flags_pi
,
6235 +--+--+--+--+--+--+--+--+
6236 |B |V |L |G |P | | | |
6237 +--+--+--+--+--+--+--+--+
6239 static int * const adj_sid_ospf_flags
[] = {
6240 &hf_bgp_ls_sr_tlv_adjacency_sid_flags_bo
,
6241 &hf_bgp_ls_sr_tlv_adjacency_sid_flags_vo
,
6242 &hf_bgp_ls_sr_tlv_adjacency_sid_flags_lo
,
6243 &hf_bgp_ls_sr_tlv_adjacency_sid_flags_go
,
6244 &hf_bgp_ls_sr_tlv_adjacency_sid_flags_po
,
6248 tlv_item
= proto_tree_add_item(tree
, hf_bgp_ls_sr_tlv_adjacency_sid
, tvb
, offset
, length
+ 4, ENC_NA
);
6249 tlv_tree
= proto_item_add_subtree(tlv_item
, ett_bgp_link_state
);
6250 proto_tree_add_item(tlv_tree
, hf_bgp_ls_type
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
6251 proto_tree_add_item(tlv_tree
, hf_bgp_ls_length
, tvb
, offset
+ 2, 2, ENC_BIG_ENDIAN
);
6252 if ((protocol_id
== BGP_LS_NLRI_PROTO_ID_OSPF_V2
) || (protocol_id
== BGP_LS_NLRI_PROTO_ID_OSPF_V3
)) {
6253 proto_tree_add_bitmask(tlv_tree
, tvb
, offset
+ 4, hf_bgp_ls_sr_tlv_adjacency_sid_flags
,
6254 ett_bgp_link_state
, adj_sid_ospf_flags
, ENC_BIG_ENDIAN
);
6256 /* FF: most common case is IS-IS, so if it is not OSPF we go that way */
6257 proto_tree_add_bitmask(tlv_tree
, tvb
, offset
+ 4, hf_bgp_ls_sr_tlv_adjacency_sid_flags
,
6258 ett_bgp_link_state
, adj_sid_isis_flags
, ENC_BIG_ENDIAN
);
6260 proto_tree_add_item(tlv_tree
, hf_bgp_ls_sr_tlv_adjacency_sid_weight
, tvb
, offset
+ 5, 1, ENC_BIG_ENDIAN
);
6262 proto_tree_add_item(tlv_tree
, hf_bgp_ls_sr_tlv_adjacency_sid_label
, tvb
, offset
+ 8, 3, ENC_BIG_ENDIAN
);
6264 proto_tree_add_item(tlv_tree
, hf_bgp_ls_sr_tlv_adjacency_sid_index
, tvb
, offset
+ 8, 4, ENC_BIG_ENDIAN
);
6269 case BGP_LS_SR_TLV_LAN_ADJ_SID
:
6272 case BGP_LS_SR_TLV_PEER_NODE_SID
:
6273 case BGP_LS_SR_TLV_PEER_ADJ_SID
:
6274 case BGP_LS_SR_TLV_PEER_SET_SID
:
6278 +--+--+--+--+--+--+--+--+
6279 |V |L |B |P | | | | | rfc9086
6280 +--+--+--+--+--+--+--+--+
6282 static int * const peer_sid_flags
[] = {
6283 &hf_bgp_ls_sr_tlv_peer_sid_flags_v
,
6284 &hf_bgp_ls_sr_tlv_peer_sid_flags_l
,
6285 &hf_bgp_ls_sr_tlv_peer_sid_flags_b
,
6286 &hf_bgp_ls_sr_tlv_peer_sid_flags_p
,
6290 tlv_item
= proto_tree_add_item(tree
,
6291 (type
== BGP_LS_SR_TLV_PEER_NODE_SID
?
6292 hf_bgp_ls_sr_tlv_peer_node_sid
:
6293 (type
== BGP_LS_SR_TLV_PEER_ADJ_SID
?
6294 hf_bgp_ls_sr_tlv_peer_adj_sid
:
6295 hf_bgp_ls_sr_tlv_peer_set_sid
)),
6296 tvb
, offset
, length
+ 4, ENC_NA
);
6297 tlv_tree
= proto_item_add_subtree(tlv_item
, ett_bgp_link_state
);
6298 proto_tree_add_item(tlv_tree
, hf_bgp_ls_type
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
6299 ti
= proto_tree_add_item(tlv_tree
, hf_bgp_ls_length
, tvb
, offset
+ 2, 2, ENC_BIG_ENDIAN
);
6300 if (length
!= 7 && length
!= 8) {
6301 expert_add_info_format(pinfo
, ti
, &ei_bgp_ls_error
,
6302 "Unexpected TLV Length (%u) in BGP-LS Peer SID TLV, it must be either 7 or 8 bytes!",
6306 proto_tree_add_bitmask(tlv_tree
, tvb
, offset
+ 4, hf_bgp_ls_sr_tlv_peer_sid_flags
,
6307 ett_bgp_link_state
, peer_sid_flags
, ENC_BIG_ENDIAN
);
6308 proto_tree_add_item(tlv_tree
, hf_bgp_ls_sr_tlv_peer_sid_weight
, tvb
, offset
+ 5, 1, ENC_BIG_ENDIAN
);
6310 proto_tree_add_item(tlv_tree
, hf_bgp_ls_sr_tlv_peer_sid_label
, tvb
, offset
+ 8, 3, ENC_BIG_ENDIAN
);
6312 proto_tree_add_item(tlv_tree
, hf_bgp_ls_sr_tlv_peer_sid_index
, tvb
, offset
+ 8, 4, ENC_BIG_ENDIAN
);
6317 case BGP_LS_SR_TLV_SRV6_END_X_SID
:
6318 tlv_item
= proto_tree_add_item(tree
, hf_bgp_ls_sr_tlv_srv6_endx_sid
,
6319 tvb
, offset
, length
+ 4, ENC_NA
);
6320 tlv_tree
= proto_item_add_subtree(tlv_item
, ett_bgp_link_state
);
6321 proto_tree_add_item(tlv_tree
, hf_bgp_ls_type
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
6322 ti
= proto_tree_add_item(tlv_tree
, hf_bgp_ls_length
, tvb
, offset
+ 2, 2, ENC_BIG_ENDIAN
);
6324 expert_add_info_format(pinfo
, ti
, &ei_bgp_ls_error
,
6325 "Unexpected TLV Length (%u) in BGP-LS %s TLV, it must be %u bytes or more!",
6326 length
, "SRv6 End.X SID", 20);
6329 proto_tree_add_item(tlv_tree
, hf_bgp_ls_sr_tlv_srv6_endx_sid_endpoint_behavior
, tvb
, offset
+ 4, 2, ENC_NA
);
6330 proto_tree_add_bitmask(tlv_tree
, tvb
, offset
+ 6,
6331 hf_bgp_ls_sr_tlv_srv6_endx_sid_flags
,
6332 ett_bgp_link_state
, srv6_endx_sid_flags
, ENC_BIG_ENDIAN
);
6333 proto_tree_add_item(tlv_tree
, hf_bgp_ls_sr_tlv_srv6_endx_sid_algo
, tvb
, offset
+ 7, 1, ENC_NA
);
6334 proto_tree_add_item(tlv_tree
, hf_bgp_ls_sr_tlv_srv6_endx_sid_weight
, tvb
, offset
+ 8, 1, ENC_BIG_ENDIAN
);
6335 proto_tree_add_item(tlv_tree
, hf_bgp_ls_sr_tlv_srv6_endx_sid_reserved
, tvb
, offset
+ 9, 1, ENC_BIG_ENDIAN
);
6336 proto_tree_add_item(tlv_tree
, hf_bgp_ls_sr_tlv_srv6_endx_sid_sid
, tvb
, offset
+ 10, 16, ENC_NA
);
6337 local_offset
= offset
+ 26;
6338 while (local_offset
< offset
+ length
) {
6339 advance
= decode_link_state_attribute_tlv(tlv_tree
, tvb
, local_offset
, pinfo
, protocol_id
);
6343 local_offset
+= advance
;
6347 case BGP_LS_SR_TLV_SRV6_LAN_END_X_SID
:
6348 tlv_item
= proto_tree_add_item(tree
, hf_bgp_ls_sr_tlv_srv6_lan_endx_sid
,
6349 tvb
, offset
, length
+4, ENC_NA
);
6350 tlv_tree
= proto_item_add_subtree(tlv_item
, ett_bgp_link_state
);
6351 proto_tree_add_item(tlv_tree
, hf_bgp_ls_type
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
6352 ti
= proto_tree_add_item(tlv_tree
, hf_bgp_ls_length
, tvb
, offset
+ 2, 2, ENC_BIG_ENDIAN
);
6353 if ((((protocol_id
== BGP_LS_NLRI_PROTO_ID_OSPF_V2
) || (protocol_id
== BGP_LS_NLRI_PROTO_ID_OSPF_V3
)) && length
< 26) ||
6354 ((protocol_id
== BGP_LS_NLRI_PROTO_ID_IS_IS_LEVEL_1
||
6355 protocol_id
== BGP_LS_NLRI_PROTO_ID_IS_IS_LEVEL_2
) && length
< 28)) {
6356 expert_add_info_format(pinfo
, ti
, &ei_bgp_ls_error
,
6357 "Unexpected TLV Length (%u) in BGP-LS %s TLV, it must be %u bytes or more!",
6358 length
, "SRv6 LAN End.X SID",
6359 ((protocol_id
== BGP_LS_NLRI_PROTO_ID_OSPF_V2
) || (protocol_id
== BGP_LS_NLRI_PROTO_ID_OSPF_V3
)) ? 26 : 28);
6362 proto_tree_add_item(tlv_tree
, hf_bgp_ls_sr_tlv_srv6_endx_sid_endpoint_behavior
, tvb
, offset
+ 4, 2, ENC_NA
);
6363 proto_tree_add_bitmask(tlv_tree
, tvb
, offset
+ 6,
6364 hf_bgp_ls_sr_tlv_srv6_endx_sid_flags
,
6365 ett_bgp_link_state
, srv6_endx_sid_flags
, ENC_BIG_ENDIAN
);
6366 proto_tree_add_item(tlv_tree
, hf_bgp_ls_sr_tlv_srv6_endx_sid_algo
, tvb
, offset
+ 7, 1, ENC_NA
);
6367 proto_tree_add_item(tlv_tree
, hf_bgp_ls_sr_tlv_srv6_endx_sid_weight
, tvb
, offset
+ 8, 1, ENC_BIG_ENDIAN
);
6368 proto_tree_add_item(tlv_tree
, hf_bgp_ls_sr_tlv_srv6_endx_sid_reserved
, tvb
, offset
+ 9, 1, ENC_BIG_ENDIAN
);
6369 local_offset
= offset
+ 10;
6370 if ((protocol_id
== BGP_LS_NLRI_PROTO_ID_OSPF_V2
) || (protocol_id
== BGP_LS_NLRI_PROTO_ID_OSPF_V3
)) {
6371 proto_tree_add_item(tlv_tree
, hf_bgp_ls_sr_tlv_srv6_endx_sid_neighbor_ospf
, tvb
, local_offset
, 4, ENC_BIG_ENDIAN
);
6374 /* FF: most common case is IS-IS, so if it is not OSPF we go that way */
6375 proto_tree_add_item(tlv_tree
, hf_bgp_ls_sr_tlv_srv6_endx_sid_neighbor_isis
, tvb
, local_offset
, 6, ENC_BIG_ENDIAN
);
6378 proto_tree_add_item(tlv_tree
, hf_bgp_ls_sr_tlv_srv6_endx_sid_sid
, tvb
, local_offset
, 16, ENC_NA
);
6380 while (local_offset
< offset
+ length
) {
6381 advance
= decode_link_state_attribute_tlv(tlv_tree
, tvb
, local_offset
, pinfo
, protocol_id
);
6385 local_offset
+= advance
;
6389 case BGP_LS_APP_SPEC_LINK_ATTR
:
6390 tlv_item
= proto_tree_add_item(tree
, hf_bgp_ls_tlv_app_spec_link_attrs
, tvb
, offset
, length
+ 4, ENC_NA
);
6391 tlv_tree
= proto_item_add_subtree(tlv_item
, ett_bgp_link_state
);
6392 proto_tree_add_item(tlv_tree
, hf_bgp_ls_type
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
6393 proto_tree_add_item(tlv_tree
, hf_bgp_ls_length
, tvb
, offset
+ 2, 2, ENC_BIG_ENDIAN
);
6394 sabm_len
= tvb_get_uint8(tvb
, offset
+ 4);
6395 ti
= proto_tree_add_item(tlv_tree
, hf_bgp_ls_tlv_app_spec_link_attrs_sabm_len
, tvb
, offset
+ 4, 1, ENC_NA
);
6396 if (sabm_len
!= 0 && sabm_len
!= 4 && sabm_len
!= 8) {
6397 expert_add_info_format(pinfo
, ti
, &ei_bgp_ls_error
,
6398 "Unexpected SABM Length (%u) in BGP-LS Application-Specific Link Attributes TLV, it must be 0/4/8 bytes!",
6402 udabm_len
= tvb_get_uint8(tvb
, offset
+ 5);
6403 ti
= proto_tree_add_item(tlv_tree
, hf_bgp_ls_tlv_app_spec_link_attrs_udabm_len
, tvb
, offset
+ 5, 1, ENC_NA
);
6404 if (udabm_len
!= 0 && udabm_len
!= 4 && udabm_len
!= 8) {
6405 expert_add_info_format(pinfo
, ti
, &ei_bgp_ls_error
,
6406 "Unexpected UDABM Length (%u) in BGP-LS Application Specific Link Attributes TLV, it must be 0/4/8 bytes!",
6410 tmp16
= tvb_get_uint16(tvb
, offset
+ 6, ENC_BIG_ENDIAN
);
6411 ti
= proto_tree_add_item(tlv_tree
, hf_bgp_ls_tlv_app_spec_link_attrs_reserved
, tvb
, offset
+ 6, 2, ENC_BIG_ENDIAN
);
6413 expert_add_info_format(pinfo
, ti
, &ei_bgp_ls_warn
,
6414 "Reserved field must be 0 in BGP-LS Application-Specific Link Attributes TLV");
6417 static int * const app_spec_link_attrs_sabm
[] = {
6418 &hf_bgp_ls_tlv_app_spec_link_attrs_sabm_r
,
6419 &hf_bgp_ls_tlv_app_spec_link_attrs_sabm_s
,
6420 &hf_bgp_ls_tlv_app_spec_link_attrs_sabm_f
,
6421 &hf_bgp_ls_tlv_app_spec_link_attrs_sabm_x
,
6424 proto_tree_add_bitmask(tlv_tree
, tvb
, offset
+ 8, hf_bgp_ls_tlv_app_spec_link_attrs_sabm
,
6425 ett_bgp_link_state
, app_spec_link_attrs_sabm
, ENC_BIG_ENDIAN
);
6427 if (udabm_len
> 0) {
6428 proto_tree_add_item(tlv_tree
, hf_bgp_ls_tlv_app_spec_link_attrs_udabm
,
6429 tvb
, offset
+ 8 + sabm_len
, udabm_len
, ENC_NA
);
6431 /* Decode Link Attribute sub-TLVs */
6432 local_offset
= offset
+ 8 + sabm_len
+ udabm_len
;
6433 while (local_offset
< offset
+ length
) {
6434 advance
= decode_link_state_attribute_tlv(tlv_tree
, tvb
, local_offset
, pinfo
, protocol_id
);
6438 local_offset
+= advance
;
6442 /* Prefix Attribute TLVs */
6443 case BGP_NLRI_TLV_IGP_FLAGS
:
6444 tlv_item
= proto_tree_add_item(tree
, hf_bgp_ls_tlv_igp_flags
, tvb
, offset
, length
+4, ENC_NA
);
6445 tlv_tree
= proto_item_add_subtree(tlv_item
, ett_bgp_link_state
);
6446 if(length
!= BGP_NLRI_TLV_LEN_IGP_FLAGS
){
6447 expert_add_info_format(pinfo
, tlv_tree
, &ei_bgp_ls_error
, "Unexpected IGP Flags TLV's length (%u), it must be %u bytes!",
6448 length
, BGP_NLRI_TLV_IGP_FLAGS
);
6451 proto_tree_add_item(tlv_tree
, hf_bgp_ls_type
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
6452 proto_tree_add_item(tlv_tree
, hf_bgp_ls_length
, tvb
, offset
+ 2, 2, ENC_BIG_ENDIAN
);
6453 proto_tree_add_item(tlv_tree
, hf_bgp_ls_igp_flags_flag_d
, tvb
, offset
+ 4, 1, ENC_NA
);
6454 tmp8
= tvb_get_uint8(tvb
, offset
+ 4) & 0x7F;
6456 expert_add_info_format(pinfo
, tlv_tree
, &ei_bgp_ls_error
, "Reserved flags are not set to zero (%u).", tmp8
);
6460 case BGP_NLRI_TLV_ROUTE_TAG
:
6461 tlv_item
= proto_tree_add_item(tree
, hf_bgp_ls_tlv_route_tag
, tvb
, offset
, length
+4, ENC_NA
);
6462 tlv_tree
= proto_item_add_subtree(tlv_item
, ett_bgp_link_state
);
6463 if(length
% 4 != 0) {
6464 expert_add_info_format(pinfo
, tlv_tree
, &ei_bgp_ls_error
, "Unexpected Route Tag TLV's length (%u mod 4 != 0) ",
6468 proto_tree_add_item(tlv_tree
, hf_bgp_ls_type
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
6469 proto_tree_add_item(tlv_tree
, hf_bgp_ls_length
, tvb
, offset
+ 2, 2, ENC_BIG_ENDIAN
);
6474 expert_add_info_format(pinfo
, tlv_tree
, &ei_bgp_ls_error
, "Route Tag must be 4 bytes long (%u).", tmp16
);
6477 proto_tree_add_item(tlv_tree
, hf_bgp_ls_tlv_route_tag_value
, tvb
, offset
+ 4 + (n
* 4), 4, ENC_BIG_ENDIAN
);
6483 case BGP_NLRI_TLV_EXTENDED_TAG
:
6484 tlv_item
= proto_tree_add_item(tree
, hf_bgp_ls_tlv_route_extended_tag
, tvb
, offset
, length
+4, ENC_NA
);
6485 tlv_tree
= proto_item_add_subtree(tlv_item
, ett_bgp_link_state
);
6486 if(length
% 8 != 0) {
6487 expert_add_info_format(pinfo
, tlv_tree
, &ei_bgp_ls_error
, "Unexpected Route Extended Tag TLV's length (%u mod 8 != 0) ",
6491 proto_tree_add_item(tlv_tree
, hf_bgp_ls_type
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
6492 proto_tree_add_item(tlv_tree
, hf_bgp_ls_length
, tvb
, offset
+ 2, 2, ENC_BIG_ENDIAN
);
6497 expert_add_info_format(pinfo
, tlv_tree
, &ei_bgp_ls_error
, "Route Extended Tag must be 8 bytes long (%u).", tmp16
);
6500 proto_tree_add_item(tlv_tree
, hf_bgp_ls_tlv_route_extended_tag_value
, tvb
, offset
+ 4 + (n
* 8), 8, ENC_BIG_ENDIAN
);
6506 case BGP_NLRI_TLV_PREFIX_METRIC
:
6507 tlv_item
= proto_tree_add_item(tree
, hf_bgp_ls_tlv_prefix_metric
, tvb
, offset
, length
+4, ENC_NA
);
6508 tlv_tree
= proto_item_add_subtree(tlv_item
, ett_bgp_link_state
);
6509 if(length
!= BGP_NLRI_TLV_LEN_PREFIX_METRIC
){
6510 expert_add_info_format(pinfo
, tlv_tree
, &ei_bgp_ls_error
, "Unexpected Prefix Metric TLV's length (%u), it must be %u bytes!",
6511 length
, BGP_NLRI_TLV_LEN_PREFIX_METRIC
);
6514 proto_tree_add_item(tlv_tree
, hf_bgp_ls_type
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
6515 proto_tree_add_item(tlv_tree
, hf_bgp_ls_length
, tvb
, offset
+ 2, 2, ENC_BIG_ENDIAN
);
6516 proto_tree_add_item(tlv_tree
, hf_bgp_ls_tlv_prefix_metric_value
, tvb
, offset
+ 4, 4, ENC_BIG_ENDIAN
);
6519 case BGP_NLRI_TLV_OSPF_FORWARDING_ADDRESS
:
6520 tlv_item
= proto_tree_add_item(tree
, hf_bgp_ls_ospf_forwarding_address
, tvb
, offset
, length
+4, ENC_NA
);
6521 tlv_tree
= proto_item_add_subtree(tlv_item
, ett_bgp_link_state
);
6522 proto_tree_add_item(tlv_tree
, hf_bgp_ls_type
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
6523 proto_tree_add_item(tlv_tree
, hf_bgp_ls_length
, tvb
, offset
+ 2, 2, ENC_BIG_ENDIAN
);
6525 proto_tree_add_item(tlv_tree
, hf_bgp_ls_ospf_forwarding_address_ipv4_address
, tvb
, offset
+ 4, length
, ENC_BIG_ENDIAN
);
6527 else if (length
== 16) {
6528 proto_tree_add_item(tlv_tree
, hf_bgp_ls_ospf_forwarding_address_ipv6_address
, tvb
, offset
+ 4, length
, ENC_NA
);
6531 expert_add_info_format(pinfo
, tlv_tree
, &ei_bgp_ls_error
, "Unexpected Prefix Metric TLV's length (%u), it must be 4 or 16 bytes!", length
);
6536 case BGP_NLRI_TLV_OPAQUE_PREFIX_ATTRIBUTE
:
6537 tlv_item
= proto_tree_add_item(tree
, hf_bgp_ls_opaque_prefix_attribute
, tvb
, offset
, length
+4, ENC_NA
);
6538 tlv_tree
= proto_item_add_subtree(tlv_item
, ett_bgp_link_state
);
6539 proto_tree_add_item(tlv_tree
, hf_bgp_ls_type
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
6540 proto_tree_add_item(tlv_tree
, hf_bgp_ls_length
, tvb
, offset
+ 2, 2, ENC_BIG_ENDIAN
);
6541 proto_tree_add_item(tlv_tree
, hf_bgp_ls_opaque_prefix_attribute_value
, tvb
, offset
+ 4, length
, ENC_NA
);
6544 case BGP_NLRI_TLV_EXTENDED_ADMINISTRATIVE_GROUP
:
6545 tlv_item
= proto_tree_add_item(tree
, hf_bgp_ls_extended_administrative_group
, tvb
, offset
, length
+4, ENC_NA
);
6546 tlv_tree
= proto_item_add_subtree(tlv_item
, ett_bgp_link_state
);
6547 proto_tree_add_item(tlv_tree
, hf_bgp_ls_type
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
6548 proto_tree_add_item(tlv_tree
, hf_bgp_ls_length
, tvb
, offset
+ 2, 2, ENC_BIG_ENDIAN
);
6549 if(length
% 4 != 0) {
6550 expert_add_info_format(pinfo
, tlv_tree
, &ei_bgp_ls_error
, "Unexpected Extended Administrative Group TLV's length (%u mod 4 != 0)",
6556 proto_tree_add_item(tlv_tree
, hf_bgp_ls_extended_administrative_group_value
, tvb
, offset
+ 4 + (length
- tmp16
), 4, ENC_NA
);
6561 case BGP_LS_SR_TLV_PREFIX_SID
:
6565 +--+--+--+--+--+--+--+--+
6566 |R |N |P |E |V |L | | |
6567 +--+--+--+--+--+--+--+--+
6569 static int * const prefix_sid_isis_flags
[] = {
6570 &hf_bgp_ls_sr_tlv_prefix_sid_flags_r
,
6571 &hf_bgp_ls_sr_tlv_prefix_sid_flags_n
,
6572 &hf_bgp_ls_sr_tlv_prefix_sid_flags_p
,
6573 &hf_bgp_ls_sr_tlv_prefix_sid_flags_e
,
6574 &hf_bgp_ls_sr_tlv_prefix_sid_flags_v
,
6575 &hf_bgp_ls_sr_tlv_prefix_sid_flags_l
,
6580 +--+--+--+--+--+--+--+--+
6581 | |NP|M |E |V |L | | |
6582 +--+--+--+--+--+--+--+--+
6584 static int * const prefix_sid_ospf_flags
[] = {
6585 &hf_bgp_ls_sr_tlv_prefix_sid_flags_np
,
6586 &hf_bgp_ls_sr_tlv_prefix_sid_flags_m
,
6587 &hf_bgp_ls_sr_tlv_prefix_sid_flags_e
,
6588 &hf_bgp_ls_sr_tlv_prefix_sid_flags_v
,
6589 &hf_bgp_ls_sr_tlv_prefix_sid_flags_l
,
6593 tlv_item
= proto_tree_add_item(tree
, hf_bgp_ls_sr_tlv_prefix_sid
, tvb
, offset
, length
+ 4, ENC_NA
);
6594 tlv_tree
= proto_item_add_subtree(tlv_item
, ett_bgp_link_state
);
6595 proto_tree_add_item(tlv_tree
, hf_bgp_ls_type
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
6596 proto_tree_add_item(tlv_tree
, hf_bgp_ls_length
, tvb
, offset
+ 2, 2, ENC_BIG_ENDIAN
);
6597 if ((protocol_id
== BGP_LS_NLRI_PROTO_ID_OSPF_V2
) || (protocol_id
== BGP_LS_NLRI_PROTO_ID_OSPF_V3
)) {
6598 proto_tree_add_bitmask(tlv_tree
, tvb
, offset
+ 4, hf_bgp_ls_sr_tlv_prefix_sid_flags
,
6599 ett_bgp_link_state
, prefix_sid_ospf_flags
, ENC_BIG_ENDIAN
);
6601 /* FF: most common case is IS-IS, so if it is not OSPF we go that way */
6602 proto_tree_add_bitmask(tlv_tree
, tvb
, offset
+ 4, hf_bgp_ls_sr_tlv_prefix_sid_flags
,
6603 ett_bgp_link_state
, prefix_sid_isis_flags
, ENC_BIG_ENDIAN
);
6605 proto_tree_add_item(tlv_tree
, hf_bgp_ls_sr_tlv_prefix_sid_algo
, tvb
, offset
+ 5, 1, ENC_BIG_ENDIAN
);
6607 proto_tree_add_item(tlv_tree
, hf_bgp_ls_sr_tlv_prefix_sid_label
, tvb
, offset
+ 8, 3, ENC_BIG_ENDIAN
);
6609 proto_tree_add_item(tlv_tree
, hf_bgp_ls_sr_tlv_prefix_sid_index
, tvb
, offset
+ 8, 4, ENC_BIG_ENDIAN
);
6614 case BGP_LS_SR_TLV_RANGE
:
6617 case BGP_LS_SR_TLV_SRV6_LOCATOR
:
6619 static int * const srv6_locator_flags
[] = {
6620 &hf_bgp_ls_sr_tlv_srv6_locator_flags_d
,
6621 &hf_bgp_ls_sr_tlv_srv6_locator_flags_reserved
,
6624 tlv_item
= proto_tree_add_item(tree
, hf_bgp_ls_sr_tlv_srv6_locator
, tvb
, offset
, length
+4, ENC_NA
);
6625 tlv_tree
= proto_item_add_subtree(tlv_item
, ett_bgp_link_state
);
6626 proto_tree_add_item(tlv_tree
, hf_bgp_ls_type
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
6627 ti
= proto_tree_add_item(tlv_tree
, hf_bgp_ls_length
, tvb
, offset
+ 2, 2, ENC_BIG_ENDIAN
);
6629 expert_add_info_format(pinfo
, ti
, &ei_bgp_ls_error
,
6630 "Unexpected TLV Length (%u) in BGP-LS %s TLV, it must be %u bytes or more!",
6631 length
, "SRv6 Locator", 8);
6634 proto_tree_add_bitmask(tlv_tree
, tvb
, offset
+ 4, hf_bgp_ls_sr_tlv_srv6_locator_flags
,
6635 ett_bgp_link_state
, srv6_locator_flags
, ENC_NA
);
6636 proto_tree_add_item(tlv_tree
, hf_bgp_ls_sr_tlv_srv6_locator_algo
, tvb
, offset
+ 5, 1, ENC_BIG_ENDIAN
);
6637 proto_tree_add_item(tlv_tree
, hf_bgp_ls_sr_tlv_srv6_locator_reserved
, tvb
, offset
+ 6, 2, ENC_BIG_ENDIAN
);
6638 proto_tree_add_item(tlv_tree
, hf_bgp_ls_sr_tlv_srv6_locator_metric
, tvb
, offset
+ 8, 4, ENC_BIG_ENDIAN
);
6642 case BGP_LS_SR_TLV_PREFIX_ATTR_FLAGS
:
6643 tlv_item
= proto_tree_add_item(tree
, hf_bgp_ls_sr_tlv_prefix_attr_flags
, tvb
, offset
, length
+4, ENC_NA
);
6644 tlv_tree
= proto_item_add_subtree(tlv_item
, ett_bgp_link_state
);
6645 proto_tree_add_item(tlv_tree
, hf_bgp_ls_type
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
6646 proto_tree_add_item(tlv_tree
, hf_bgp_ls_length
, tvb
, offset
+ 2, 2, ENC_BIG_ENDIAN
);
6647 if ((protocol_id
== BGP_LS_NLRI_PROTO_ID_OSPF_V2
) || (protocol_id
== BGP_LS_NLRI_PROTO_ID_OSPF_V3
)) {
6648 /* rfc7684, rfc9089 */
6649 static int * const prefix_attr_ospf_flags
[] = {
6650 &hf_bgp_ls_sr_tlv_prefix_attr_flags_flags_ao
,
6651 &hf_bgp_ls_sr_tlv_prefix_attr_flags_flags_no
,
6652 &hf_bgp_ls_sr_tlv_prefix_attr_flags_flags_eo
,
6655 proto_tree_add_bitmask(tlv_tree
, tvb
, offset
+ 4, hf_bgp_ls_sr_tlv_prefix_attr_flags_flags
,
6656 ett_bgp_link_state
, prefix_attr_ospf_flags
, ENC_BIG_ENDIAN
);
6657 } else if (protocol_id
== BGP_LS_NLRI_PROTO_ID_IS_IS_LEVEL_1
||
6658 protocol_id
== BGP_LS_NLRI_PROTO_ID_IS_IS_LEVEL_2
) {
6659 /* rfc7794, rfc9088 */
6660 static int * const prefix_attr_isis_flags
[] = {
6661 &hf_bgp_ls_sr_tlv_prefix_attr_flags_flags_xi
,
6662 &hf_bgp_ls_sr_tlv_prefix_attr_flags_flags_ri
,
6663 &hf_bgp_ls_sr_tlv_prefix_attr_flags_flags_ni
,
6664 &hf_bgp_ls_sr_tlv_prefix_attr_flags_flags_ei
,
6667 proto_tree_add_bitmask(tlv_tree
, tvb
, offset
+ 4, hf_bgp_ls_sr_tlv_prefix_attr_flags_flags
,
6668 ett_bgp_link_state
, prefix_attr_isis_flags
, ENC_BIG_ENDIAN
);
6670 proto_tree_add_item(tlv_tree
, hf_bgp_ls_sr_tlv_prefix_attr_flags_flags_unknown
,
6671 tvb
, offset
+ 4, tvb_get_uint16(tvb
, offset
+ 2, ENC_BIG_ENDIAN
), ENC_NA
);
6672 expert_add_info_format(pinfo
, tlv_tree
, &ei_bgp_ls_warn
,
6673 "Unknown Protocol-ID (%u) for Prefix Attribute Flags TLV",
6678 case BGP_LS_SR_TLV_SOURCE_ROUTER_ID
:
6679 tlv_item
= proto_tree_add_item(tree
, hf_bgp_ls_sr_tlv_source_router_id
, tvb
, offset
, length
+4, ENC_NA
);
6680 tlv_tree
= proto_item_add_subtree(tlv_item
, ett_bgp_link_state
);
6681 proto_tree_add_item(tlv_tree
, hf_bgp_ls_type
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
6682 ti
= proto_tree_add_item(tlv_tree
, hf_bgp_ls_length
, tvb
, offset
+ 2, 2, ENC_BIG_ENDIAN
);
6683 if (length
== BGP_NLRI_TLV_LEN_IPV4_ROUTER_ID
) {
6684 proto_tree_add_item(tlv_tree
, hf_bgp_ls_tlv_ipv4_router_id_value
, tvb
, offset
+ 4, BGP_NLRI_TLV_LEN_IPV4_ROUTER_ID
, ENC_NA
);
6685 } else if (length
== BGP_NLRI_TLV_LEN_IPV6_ROUTER_ID
) {
6686 proto_tree_add_item(tlv_tree
, hf_bgp_ls_tlv_ipv6_router_id_value
, tvb
, offset
+ 4, BGP_NLRI_TLV_LEN_IPV6_ROUTER_ID
, ENC_NA
);
6688 expert_add_info_format(pinfo
, ti
, &ei_bgp_ls_error
,
6689 "Unexpected TLV Length (%u) in BGP-LS %s TLV, it must be either %u or %u bytes!",
6690 length
, "Source Router-ID",
6691 BGP_NLRI_TLV_LEN_IPV4_ROUTER_ID
,
6692 BGP_NLRI_TLV_LEN_IPV6_ROUTER_ID
);
6696 case BGP_LS_SR_TLV_FLEX_ALGO_PREFIX_METRIC
:
6698 /* rfc9351, rfc9350 */
6699 static int * const fapm_flags
[] = {
6700 &hf_bgp_ls_sr_tlv_flex_algo_prefix_metric_flags_e
,
6703 tlv_item
= proto_tree_add_item(tree
, hf_bgp_ls_sr_tlv_flex_algo_prefix_metric
, tvb
, offset
, length
+ 4, ENC_NA
);
6704 tlv_tree
= proto_item_add_subtree(tlv_item
, ett_bgp_link_state
);
6705 proto_tree_add_item(tlv_tree
, hf_bgp_ls_type
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
6706 ti
= proto_tree_add_item(tlv_tree
, hf_bgp_ls_length
, tvb
, offset
+ 2, 2, ENC_BIG_ENDIAN
);
6708 expert_add_info_format(pinfo
, ti
, &ei_bgp_ls_error
,
6709 "Unexpected TLV Length (%u) in BGP-LS %s TLV, it must be 8 bytes!",
6710 length
, "Flexible Algorithm Prefix Metric");
6713 proto_tree_add_item(tlv_tree
, hf_bgp_ls_sr_tlv_flex_algo_algorithm
, tvb
, offset
+ 4, 1, ENC_NA
);
6714 proto_tree_add_bitmask(tlv_tree
, tvb
, offset
+ 5, hf_bgp_ls_sr_tlv_flex_algo_prefix_metric_flags
,
6715 ett_bgp_link_state
, fapm_flags
, ENC_NA
);
6716 proto_tree_add_item(tlv_tree
, hf_bgp_ls_sr_tlv_flex_algo_prefix_metric_reserved
, tvb
, offset
+ 6, 2, ENC_BIG_ENDIAN
);
6717 proto_tree_add_item(tlv_tree
, hf_bgp_ls_sr_tlv_flex_algo_prefix_metric_metric
, tvb
, offset
+ 8, 4, ENC_BIG_ENDIAN
);
6721 /* SID Attribute TLVs */
6722 case BGP_LS_SR_TLV_SRV6_ENDPOINT_BEHAVIOR
:
6723 tlv_item
= proto_tree_add_item(tree
, hf_bgp_ls_sr_tlv_srv6_endpoint_behavior
, tvb
, offset
, length
+4, ENC_NA
);
6724 tlv_tree
= proto_item_add_subtree(tlv_item
, ett_bgp_link_state
);
6725 proto_tree_add_item(tlv_tree
, hf_bgp_ls_type
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
6726 ti
= proto_tree_add_item(tlv_tree
, hf_bgp_ls_length
, tvb
, offset
+ 2, 2, ENC_BIG_ENDIAN
);
6728 expert_add_info_format(pinfo
, ti
, &ei_bgp_ls_error
,
6729 "Unexpected TLV Length (%u) in BGP-LS %s TLV, it must be %u bytes!",
6730 length
, "SRv6 Endpoint Behavior", 4);
6733 proto_tree_add_item(tlv_tree
, hf_bgp_ls_sr_tlv_srv6_endpoint_behavior_endpoint_behavior
, tvb
, offset
+ 4, 2, ENC_BIG_ENDIAN
);
6734 proto_tree_add_item(tlv_tree
, hf_bgp_ls_sr_tlv_srv6_endpoint_behavior_flags
, tvb
, offset
+ 6, 1, ENC_BIG_ENDIAN
);
6735 proto_tree_add_item(tlv_tree
, hf_bgp_ls_sr_tlv_srv6_endpoint_behavior_algo
, tvb
, offset
+ 7, 1, ENC_BIG_ENDIAN
);
6738 case BGP_LS_SR_TLV_SRV6_SID_STRUCT
:
6739 tlv_item
= proto_tree_add_item(tree
, hf_bgp_ls_sr_tlv_srv6_sid_struct
, tvb
, offset
, length
+ 4, ENC_NA
);
6740 tlv_tree
= proto_item_add_subtree(tlv_item
, ett_bgp_link_state
);
6741 proto_tree_add_item(tlv_tree
, hf_bgp_ls_type
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
6742 ti
= proto_tree_add_item(tlv_tree
, hf_bgp_ls_length
, tvb
, offset
+ 2, 2, ENC_BIG_ENDIAN
);
6744 expert_add_info_format(pinfo
, ti
, &ei_bgp_ls_error
,
6745 "Unexpected TLV Length (%u) in BGP-LS %s TLV, it must be %u bytes!",
6746 length
, "SRv6 SID Structure", 4);
6749 proto_tree_add_item(tlv_tree
, hf_bgp_ls_sr_tlv_srv6_sid_struct_lb_len
, tvb
, offset
+ 4, 1, ENC_NA
);
6750 proto_tree_add_item(tlv_tree
, hf_bgp_ls_sr_tlv_srv6_sid_struct_ln_len
, tvb
, offset
+ 5, 1, ENC_NA
);
6751 proto_tree_add_item(tlv_tree
, hf_bgp_ls_sr_tlv_srv6_sid_struct_fun_len
, tvb
, offset
+ 6, 1, ENC_NA
);
6752 proto_tree_add_item(tlv_tree
, hf_bgp_ls_sr_tlv_srv6_sid_struct_arg_len
, tvb
, offset
+ 7, 1, ENC_NA
);
6755 case BGP_LS_IGP_TE_METRIC_DELAY
:
6756 tlv_item
= proto_tree_add_item(tree
, hf_bgp_ls_igp_te_metric_delay
, tvb
, offset
, length
+4, ENC_NA
);
6757 tlv_tree
= proto_item_add_subtree(tlv_item
, ett_bgp_link_state
);
6758 proto_tree_add_item(tlv_tree
, hf_bgp_ls_type
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
6759 proto_tree_add_item(tlv_tree
, hf_bgp_ls_length
, tvb
, offset
+ 2, 2, ENC_BIG_ENDIAN
);
6760 proto_tree_add_bitmask(tlv_tree
, tvb
, offset
+ 4, hf_bgp_ls_igp_te_metric_flags
,
6761 ett_bgp_link_state
, ls_igp_te_metric_flags
, ENC_BIG_ENDIAN
);
6762 proto_tree_add_item(tlv_tree
, hf_bgp_ls_igp_te_metric_delay_value
, tvb
, offset
+ 5, 3, ENC_BIG_ENDIAN
);
6764 case BGP_LS_IGP_TE_METRIC_DELAY_MIN_MAX
:
6765 tlv_item
= proto_tree_add_item(tree
, hf_bgp_ls_igp_te_metric_delay_min_max
, tvb
, offset
, length
+4, ENC_NA
);
6766 tlv_tree
= proto_item_add_subtree(tlv_item
, ett_bgp_link_state
);
6767 proto_tree_add_item(tlv_tree
, hf_bgp_ls_type
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
6768 proto_tree_add_item(tlv_tree
, hf_bgp_ls_length
, tvb
, offset
+ 2, 2, ENC_BIG_ENDIAN
);
6769 proto_tree_add_bitmask(tlv_tree
, tvb
, offset
+ 4, hf_bgp_ls_igp_te_metric_flags
,
6770 ett_bgp_link_state
, ls_igp_te_metric_flags
, ENC_BIG_ENDIAN
);
6771 proto_tree_add_item(tlv_tree
, hf_bgp_ls_igp_te_metric_delay_min
, tvb
, offset
+ 5, 3, ENC_BIG_ENDIAN
);
6772 proto_tree_add_item(tlv_tree
, hf_bgp_ls_igp_te_metric_reserved
, tvb
, offset
+ 8, 1, ENC_BIG_ENDIAN
);
6773 proto_tree_add_item(tlv_tree
, hf_bgp_ls_igp_te_metric_delay_max
, tvb
, offset
+ 9, 3, ENC_BIG_ENDIAN
);
6775 case BGP_LS_IGP_TE_METRIC_DELAY_VARIATION
:
6776 tlv_item
= proto_tree_add_item(tree
, hf_bgp_ls_igp_te_metric_delay_variation
, tvb
, offset
, length
+4, ENC_NA
);
6777 tlv_tree
= proto_item_add_subtree(tlv_item
, ett_bgp_link_state
);
6778 proto_tree_add_item(tlv_tree
, hf_bgp_ls_type
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
6779 proto_tree_add_item(tlv_tree
, hf_bgp_ls_length
, tvb
, offset
+ 2, 2, ENC_BIG_ENDIAN
);
6780 proto_tree_add_item(tlv_tree
, hf_bgp_ls_igp_te_metric_reserved
, tvb
, offset
+ 4, 1, ENC_BIG_ENDIAN
);
6781 proto_tree_add_item(tlv_tree
, hf_bgp_ls_igp_te_metric_delay_variation_value
, tvb
, offset
+ 5, 3, ENC_BIG_ENDIAN
);
6783 case BGP_LS_IGP_TE_METRIC_LOSS
:
6784 tlv_item
= proto_tree_add_item(tree
, hf_bgp_ls_igp_te_metric_link_loss
, tvb
, offset
, length
+4, ENC_NA
);
6785 tlv_tree
= proto_item_add_subtree(tlv_item
, ett_bgp_link_state
);
6786 proto_tree_add_item(tlv_tree
, hf_bgp_ls_type
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
6787 proto_tree_add_item(tlv_tree
, hf_bgp_ls_length
, tvb
, offset
+ 2, 2, ENC_BIG_ENDIAN
);
6788 proto_tree_add_bitmask(tlv_tree
, tvb
, offset
+ 4, hf_bgp_ls_igp_te_metric_flags
,
6789 ett_bgp_link_state
, ls_igp_te_metric_flags
, ENC_BIG_ENDIAN
);
6790 proto_tree_add_item(tlv_tree
, hf_bgp_ls_igp_te_metric_link_loss_value
, tvb
, offset
+ 5, 3, ENC_BIG_ENDIAN
);
6792 case BGP_LS_IGP_TE_METRIC_BANDWIDTH_RESIDUAL
:
6793 tlv_item
= proto_tree_add_item(tree
, hf_bgp_ls_igp_te_metric_bandwidth_residual
, tvb
, offset
, length
+4, ENC_NA
);
6794 tlv_tree
= proto_item_add_subtree(tlv_item
, ett_bgp_link_state
);
6795 proto_tree_add_item(tlv_tree
, hf_bgp_ls_type
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
6796 proto_tree_add_item(tlv_tree
, hf_bgp_ls_length
, tvb
, offset
+ 2, 2, ENC_BIG_ENDIAN
);
6797 proto_tree_add_item(tlv_tree
, hf_bgp_ls_igp_te_metric_bandwidth_residual_value
, tvb
, offset
+ 4, 4, ENC_BIG_ENDIAN
);
6799 case BGP_LS_IGP_TE_METRIC_BANDWIDTH_AVAILABLE
:
6800 tlv_item
= proto_tree_add_item(tree
, hf_bgp_ls_igp_te_metric_bandwidth_available
, tvb
, offset
, length
+4, ENC_NA
);
6801 tlv_tree
= proto_item_add_subtree(tlv_item
, ett_bgp_link_state
);
6802 proto_tree_add_item(tlv_tree
, hf_bgp_ls_type
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
6803 proto_tree_add_item(tlv_tree
, hf_bgp_ls_length
, tvb
, offset
+ 2, 2, ENC_BIG_ENDIAN
);
6804 proto_tree_add_item(tlv_tree
, hf_bgp_ls_igp_te_metric_bandwidth_available_value
, tvb
, offset
+ 4, 4, ENC_BIG_ENDIAN
);
6806 case BGP_LS_IGP_TE_METRIC_BANDWIDTH_UTILIZED
:
6807 tlv_item
= proto_tree_add_item(tree
, hf_bgp_ls_igp_te_metric_bandwidth_utilized
, tvb
, offset
, length
+4, ENC_NA
);
6808 tlv_tree
= proto_item_add_subtree(tlv_item
, ett_bgp_link_state
);
6809 proto_tree_add_item(tlv_tree
, hf_bgp_ls_type
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
6810 proto_tree_add_item(tlv_tree
, hf_bgp_ls_length
, tvb
, offset
+ 2, 2, ENC_BIG_ENDIAN
);
6811 proto_tree_add_item(tlv_tree
, hf_bgp_ls_igp_te_metric_bandwidth_utilized_value
, tvb
, offset
+ 4, 4, ENC_BIG_ENDIAN
);
6815 expert_add_info_format(pinfo
, tree
, &ei_bgp_ls_warn
,
6816 "Unknown BGP-LS Attribute TLV Code (%u)!", type
);
6819 decrement_dissection_depth(pinfo
);
6823 static int decode_evpn_nlri_esi(proto_tree
*tree
, tvbuff_t
*tvb
, int offset
, packet_info
*pinfo
) {
6824 uint8_t esi_type
= 0;
6825 proto_tree
*esi_tree
;
6828 ti
= proto_tree_add_item(tree
, hf_bgp_evpn_nlri_esi
, tvb
, offset
, 10, ENC_NA
);
6829 esi_tree
= proto_item_add_subtree(ti
, ett_bgp_evpn_nlri_esi
);
6830 proto_tree_add_item(esi_tree
, hf_bgp_evpn_nlri_esi_type
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
6831 esi_type
= tvb_get_uint8(tvb
, offset
);
6832 proto_tree_add_item(esi_tree
, hf_bgp_evpn_nlri_esi_value
, tvb
, offset
+1, 9, ENC_NA
);
6834 case BGP_NLRI_EVPN_ESI_VALUE
:
6835 proto_tree_add_item(esi_tree
, hf_bgp_evpn_nlri_esi_value_type0
, tvb
,
6836 offset
+1, 9, ENC_NA
);
6838 case BGP_NLRI_EVPN_ESI_LACP
:
6839 proto_tree_add_item(esi_tree
, hf_bgp_evpn_nlri_esi_lacp_mac
, tvb
,
6840 offset
+1, 6, ENC_NA
);
6841 proto_tree_add_item(esi_tree
, hf_bgp_evpn_nlri_esi_portk
, tvb
,
6842 offset
+7, 2, ENC_NA
);
6843 proto_tree_add_item(esi_tree
, hf_bgp_evpn_nlri_esi_remain
, tvb
,
6844 offset
+9, 1, ENC_NA
);
6846 case BGP_NLRI_EVPN_ESI_MSTP
:
6847 proto_tree_add_item(esi_tree
, hf_bgp_evpn_nlri_esi_rb_mac
, tvb
,
6848 offset
+1, 6, ENC_NA
);
6849 proto_tree_add_item(esi_tree
, hf_bgp_evpn_nlri_esi_rbprio
, tvb
,
6850 offset
+7, 2, ENC_NA
);
6851 proto_tree_add_item(esi_tree
, hf_bgp_evpn_nlri_esi_remain
, tvb
,
6852 offset
+9, 1, ENC_NA
);
6854 case BGP_NLRI_EVPN_ESI_MAC
:
6855 proto_tree_add_item(esi_tree
, hf_bgp_evpn_nlri_esi_sys_mac
, tvb
,
6856 offset
+1, 6, ENC_NA
);
6857 proto_tree_add_item(esi_tree
, hf_bgp_evpn_nlri_esi_mac_discr
, tvb
,
6858 offset
+7, 2, ENC_NA
);
6859 proto_tree_add_item(esi_tree
, hf_bgp_evpn_nlri_esi_remain
, tvb
,
6860 offset
+9, 1, ENC_NA
);
6862 case BGP_NLRI_EVPN_ESI_RID
:
6863 proto_tree_add_item(esi_tree
, hf_bgp_evpn_nlri_esi_router_id
, tvb
,
6864 offset
+1, 4, ENC_BIG_ENDIAN
);
6865 proto_tree_add_item(esi_tree
, hf_bgp_evpn_nlri_esi_router_discr
, tvb
,
6866 offset
+5, 4, ENC_NA
);
6867 proto_tree_add_item(esi_tree
, hf_bgp_evpn_nlri_esi_remain
, tvb
,
6868 offset
+9, 1, ENC_NA
);
6870 case BGP_NLRI_EVPN_ESI_ASN
:
6871 proto_tree_add_item(esi_tree
, hf_bgp_evpn_nlri_esi_asn
, tvb
,
6872 offset
+1, 4, ENC_BIG_ENDIAN
);
6873 proto_tree_add_item(esi_tree
, hf_bgp_evpn_nlri_esi_asn_discr
, tvb
,
6874 offset
+5, 4, ENC_NA
);
6875 proto_tree_add_item(esi_tree
, hf_bgp_evpn_nlri_esi_remain
, tvb
,
6876 offset
+9, 1, ENC_NA
);
6878 case BGP_NLRI_EVPN_ESI_RES
:
6879 proto_tree_add_item(esi_tree
, hf_bgp_evpn_nlri_esi_reserved
, tvb
,
6880 offset
+1, 9, ENC_NA
);
6883 expert_add_info_format(pinfo
, tree
, &ei_bgp_evpn_nlri_esi_type_err
,
6884 "Invalid EVPN ESI (%u)!", esi_type
);
6891 * Decode EVPN NLRI, RFC 7432 section 7.7
6893 static int decode_evpn_nlri(proto_tree
*tree
, tvbuff_t
*tvb
, int offset
, packet_info
*pinfo
) {
6894 int reader_offset
= offset
;
6895 int start_offset
= offset
+2;
6896 proto_tree
*prefix_tree
;
6901 uint32_t total_length
= 0;
6903 path_attr_data
*data
= NULL
;
6907 route_type
= tvb_get_uint8(tvb
, offset
);
6909 nlri_len
= tvb_get_uint8(tvb
, offset
+ 1);
6911 ti
= proto_tree_add_item(tree
, hf_bgp_evpn_nlri
, tvb
, reader_offset
,
6912 nlri_len
+2, ENC_NA
);
6914 prefix_tree
= proto_item_add_subtree(ti
, ett_bgp_evpn_nlri
);
6916 proto_tree_add_item(prefix_tree
, hf_bgp_evpn_nlri_rt
, tvb
, reader_offset
,
6918 proto_item_append_text(ti
, ": %s", val_to_str(tvb_get_uint8(tvb
, offset
), evpnrtypevals
, "Unknown capability %d"));
6919 /* moving to next field */
6922 proto_tree_add_item(prefix_tree
, hf_bgp_evpn_nlri_len
, tvb
, reader_offset
,
6926 switch (route_type
) {
6929 +---------------------------------------+
6931 +---------------------------------------+
6932 |Ethernet Segment Identifier (10 octets)|
6933 +---------------------------------------+
6934 | Ethernet Tag ID (4 octets) |
6935 +---------------------------------------+
6936 | MPLS Label (3 octets) |
6937 +---------------------------------------+
6940 if (nlri_len
< 25) {
6941 expert_add_info_format(pinfo
, prefix_tree
, &ei_bgp_evpn_nlri_rt_len_err
,
6942 "Invalid length (%u) of EVPN NLRI Route Type 1 (Ethernet Auto-discovery Route)", nlri_len
);
6945 item
= proto_tree_add_item(prefix_tree
, hf_bgp_evpn_nlri_rd
, tvb
, reader_offset
,
6947 proto_item_append_text(item
, " (%s)", decode_bgp_rd(pinfo
->pool
, tvb
, reader_offset
));
6950 decode_evpn_nlri_esi(prefix_tree
, tvb
, reader_offset
, pinfo
);
6951 reader_offset
+= 10;
6952 proto_tree_add_item(prefix_tree
, hf_bgp_evpn_nlri_etag
, tvb
, reader_offset
,
6955 data
= load_path_attr_data(pinfo
);
6956 if (data
&& data
->encaps_community_present
&&
6957 (data
->encaps_tunnel_type
== BGP_EXT_COM_TUNNEL_VXLAN
|| data
->encaps_tunnel_type
== BGP_EXT_COM_TUNNEL_VXLANGPE
)) {
6958 proto_tree_add_item(prefix_tree
, hf_bgp_evpn_nlri_vni
, tvb
, reader_offset
, 3, ENC_BIG_ENDIAN
);
6961 proto_tree_add_item(prefix_tree
, hf_bgp_evpn_nlri_mpls_ls1
, tvb
, reader_offset
, 3, ENC_BIG_ENDIAN
);
6964 total_length
= reader_offset
- offset
;
6967 case EVPN_MAC_ROUTE
:
6969 +---------------------------------------+
6971 +---------------------------------------+
6972 |Ethernet Segment Identifier (10 octets)|
6973 +---------------------------------------+
6974 | Ethernet Tag ID (4 octets) |
6975 +---------------------------------------+
6976 | MAC Address Length (1 octet) |
6977 +---------------------------------------+
6978 | MAC Address (6 octets) |
6979 +---------------------------------------+
6980 | IP Address Length (1 octet) |
6981 +---------------------------------------+
6982 | IP Address (0 or 4 or 16 octets) |
6983 +---------------------------------------+
6984 | MPLS Label1 (3 octets) |
6985 +---------------------------------------+
6986 | MPLS Label2 (0 or 3 octets) |
6987 +---------------------------------------+
6991 if (nlri_len
< 33) {
6992 expert_add_info_format(pinfo
, prefix_tree
, &ei_bgp_evpn_nlri_rt_len_err
,
6993 "Invalid length (%u) of EVPN NLRI Route Type 2 (MAC/IP Advertisement Route)", nlri_len
);
6996 item
= proto_tree_add_item(prefix_tree
, hf_bgp_evpn_nlri_rd
, tvb
, reader_offset
,
6998 proto_item_append_text(item
, " (%s)", decode_bgp_rd(pinfo
->pool
, tvb
, reader_offset
));
7001 decode_evpn_nlri_esi(prefix_tree
, tvb
, reader_offset
, pinfo
);
7002 reader_offset
+= 10;
7004 proto_tree_add_item(prefix_tree
, hf_bgp_evpn_nlri_etag
, tvb
, reader_offset
,
7008 proto_tree_add_item(prefix_tree
, hf_bgp_evpn_nlri_maclen
, tvb
, reader_offset
,
7012 proto_tree_add_item(prefix_tree
, hf_bgp_evpn_nlri_mac_addr
, tvb
, reader_offset
,
7016 ip_len
= tvb_get_uint8(tvb
, reader_offset
) / 8;
7017 proto_tree_add_item(prefix_tree
, hf_bgp_evpn_nlri_iplen
, tvb
, reader_offset
,
7023 if (nlri_len
< 37) {
7024 expert_add_info_format(pinfo
, prefix_tree
, &ei_bgp_evpn_nlri_rt_len_err
,
7025 "Invalid length (%u) of EVPN NLRI Route Type 2 (MAC/IP Advertisement Route)", nlri_len
);
7028 proto_tree_add_item(prefix_tree
, hf_bgp_evpn_nlri_ip_addr
, tvb
, reader_offset
,
7031 } else if (ip_len
== 16) {
7033 if (nlri_len
< 49) {
7034 expert_add_info_format(pinfo
, prefix_tree
, &ei_bgp_evpn_nlri_rt_len_err
,
7035 "Invalid length (%u) of EVPN NLRI Route Type 2 (MAC/IP Advertisement Route)", nlri_len
);
7038 proto_tree_add_item(prefix_tree
, hf_bgp_evpn_nlri_ipv6_addr
, tvb
, reader_offset
,
7040 reader_offset
+= 16;
7041 } else if (ip_len
== 0) {
7043 proto_tree_add_expert(prefix_tree
, pinfo
, &ei_bgp_evpn_nlri_rt4_no_ip
, tvb
, reader_offset
-1, 1);
7047 data
= load_path_attr_data(pinfo
);
7048 if (data
&& data
->encaps_community_present
&&
7049 (data
->encaps_tunnel_type
== BGP_EXT_COM_TUNNEL_VXLAN
|| data
->encaps_tunnel_type
== BGP_EXT_COM_TUNNEL_VXLANGPE
)) {
7050 proto_tree_add_item(prefix_tree
, hf_bgp_evpn_nlri_vni
, tvb
, reader_offset
, 3, ENC_BIG_ENDIAN
);
7052 if (reader_offset
- start_offset
< nlri_len
) {
7053 proto_tree_add_item(prefix_tree
, hf_bgp_evpn_nlri_vni
, tvb
, reader_offset
, 3, ENC_BIG_ENDIAN
);
7057 proto_tree_add_item(prefix_tree
, hf_bgp_evpn_nlri_mpls_ls1
, tvb
, reader_offset
, 3, ENC_BIG_ENDIAN
);
7059 /* we check if we reached the end of the nlri reading fields one by one */
7060 /* if not, the second optional label is in the payload */
7061 if (reader_offset
- start_offset
< nlri_len
) {
7062 proto_tree_add_item(prefix_tree
, hf_bgp_evpn_nlri_mpls_ls2
, tvb
, reader_offset
, 3, ENC_BIG_ENDIAN
);
7066 total_length
= reader_offset
- offset
;
7069 case EVPN_INC_MCAST_TREE
:
7071 +---------------------------------------+
7073 +---------------------------------------+
7074 | Ethernet Tag ID (4 octets) |
7075 +---------------------------------------+
7076 | IP Address Length (1 octet) |
7077 +---------------------------------------+
7078 | Originating Router's IP Addr |
7079 | (4 or 16 octets) |
7080 +---------------------------------------+
7083 if (nlri_len
< 13) {
7084 expert_add_info_format(pinfo
, prefix_tree
, &ei_bgp_evpn_nlri_rt_len_err
,
7085 "Invalid length (%u) of EVPN NLRI Route Type 3 (Inclusive Multicast Ethernet Tag Route)", nlri_len
);
7088 item
= proto_tree_add_item(prefix_tree
, hf_bgp_evpn_nlri_rd
, tvb
, reader_offset
,
7090 proto_item_append_text(item
, " (%s)", decode_bgp_rd(pinfo
->pool
, tvb
, reader_offset
));
7093 proto_tree_add_item(prefix_tree
, hf_bgp_evpn_nlri_etag
, tvb
, reader_offset
,
7095 /* move to next field */
7097 ip_len
= tvb_get_uint8(tvb
, reader_offset
) / 8;
7098 proto_tree_add_item(prefix_tree
, hf_bgp_evpn_nlri_iplen
, tvb
, reader_offset
,
7104 if (nlri_len
< 17) {
7105 expert_add_info_format(pinfo
, prefix_tree
, &ei_bgp_evpn_nlri_rt_len_err
,
7106 "Invalid length (%u) of EVPN NLRI Route Type 3 (Inclusive Multicast Ethernet Tag Route)", nlri_len
);
7109 proto_tree_add_item(prefix_tree
, hf_bgp_evpn_nlri_ip_addr
, tvb
, reader_offset
,
7112 } else if (ip_len
== 16) {
7114 if (nlri_len
< 29) {
7115 expert_add_info_format(pinfo
, prefix_tree
, &ei_bgp_evpn_nlri_rt_len_err
,
7116 "Invalid length (%u) of EVPN NLRI Route Type 3 (Inclusive Multicast Ethernet Tag Route)", nlri_len
);
7119 proto_tree_add_item(prefix_tree
, hf_bgp_evpn_nlri_ipv6_addr
, tvb
, reader_offset
,
7121 reader_offset
+= 16;
7122 } else if (ip_len
== 0) {
7124 proto_tree_add_expert(prefix_tree
, pinfo
, &ei_bgp_evpn_nlri_rt4_no_ip
, tvb
, reader_offset
, 1);
7128 total_length
= reader_offset
- offset
;
7131 case EVPN_ETH_SEGMENT_ROUTE
:
7133 +---------------------------------------+
7135 +---------------------------------------+
7136 |Ethernet Segment Identifier (10 octets)|
7137 +---------------------------------------+
7138 | IP Address Length (1 octet) |
7139 +---------------------------------------+
7140 | Originating Router's IP Addr |
7141 | (4 or 16 octets) |
7142 +---------------------------------------+
7145 if (nlri_len
< 19) {
7146 expert_add_info_format(pinfo
, prefix_tree
, &ei_bgp_evpn_nlri_rt_len_err
,
7147 "Invalid length (%u) of EVPN NLRI Route Type 4 (Ethernet Segment Route)", nlri_len
);
7150 item
= proto_tree_add_item(prefix_tree
, hf_bgp_evpn_nlri_rd
, tvb
, reader_offset
,
7152 proto_item_append_text(item
, " (%s)", decode_bgp_rd(pinfo
->pool
, tvb
, reader_offset
));
7155 decode_evpn_nlri_esi(prefix_tree
, tvb
, reader_offset
, pinfo
);
7156 /* move to next field */
7157 reader_offset
+= 10;
7159 ip_len
= tvb_get_uint8(tvb
, reader_offset
) / 8;
7160 proto_tree_add_item(prefix_tree
, hf_bgp_evpn_nlri_iplen
, tvb
, reader_offset
,
7166 if (nlri_len
< 23) {
7167 expert_add_info_format(pinfo
, prefix_tree
, &ei_bgp_evpn_nlri_rt_len_err
,
7168 "Invalid length (%u) of EVPN NLRI Route Type 4 (Ethernet Segment Route)", nlri_len
);
7171 proto_tree_add_item(prefix_tree
, hf_bgp_evpn_nlri_ip_addr
, tvb
, reader_offset
,
7174 } else if (ip_len
== 16) {
7176 if (nlri_len
< 35) {
7177 expert_add_info_format(pinfo
, prefix_tree
, &ei_bgp_evpn_nlri_rt_len_err
,
7178 "Invalid length (%u) of EVPN NLRI Route Type 4 (Ethernet Segment Route)", nlri_len
);
7181 proto_tree_add_item(prefix_tree
, hf_bgp_evpn_nlri_ipv6_addr
, tvb
, reader_offset
,
7183 reader_offset
+= 16;
7184 } else if (ip_len
== 0) {
7186 proto_tree_add_expert(prefix_tree
, pinfo
, &ei_bgp_evpn_nlri_rt4_no_ip
, tvb
, reader_offset
, 1);
7190 total_length
= reader_offset
- offset
;
7192 case EVPN_IP_PREFIX_ROUTE
:
7195 +---------------------------------------+
7197 +---------------------------------------+
7198 |Ethernet Segment Identifier (10 octets)|
7199 +---------------------------------------+
7200 | Ethernet Tag ID (4 octets) |
7201 +---------------------------------------+
7202 | IP Prefix Length (1 octet) |
7203 +---------------------------------------+
7204 | IP Prefix (4 or 16 octets) |
7205 +---------------------------------------+
7206 | GW IP Address (4 or 16 octets) |
7207 +---------------------------------------+
7208 | MPLS Label (3 octets) |
7209 +---------------------------------------+
7212 if (nlri_len
< 26) {
7213 expert_add_info_format(pinfo
, prefix_tree
, &ei_bgp_evpn_nlri_rt_len_err
,
7214 "Invalid length (%u) of EVPN NLRI Route Type 4 (Ethernet Segment Route)", nlri_len
);
7217 item
= proto_tree_add_item(prefix_tree
, hf_bgp_evpn_nlri_rd
, tvb
, reader_offset
,
7219 proto_item_append_text(item
, " (%s)", decode_bgp_rd(pinfo
->pool
, tvb
, reader_offset
));
7222 decode_evpn_nlri_esi(prefix_tree
, tvb
, reader_offset
, pinfo
);
7223 reader_offset
+= 10;
7225 proto_tree_add_item(prefix_tree
, hf_bgp_evpn_nlri_etag
, tvb
, reader_offset
,
7229 proto_tree_add_item(prefix_tree
, hf_bgp_evpn_nlri_prefix_len
, tvb
, reader_offset
,
7236 proto_tree_add_item(prefix_tree
, hf_bgp_evpn_nlri_ip_addr
, tvb
, reader_offset
,
7240 proto_tree_add_item(prefix_tree
, hf_bgp_evpn_nlri_ipv4_gtw
, tvb
, reader_offset
,
7244 data
= load_path_attr_data(pinfo
);
7245 if (data
&& data
->encaps_community_present
&&
7246 (data
->encaps_tunnel_type
== BGP_EXT_COM_TUNNEL_VXLAN
|| data
->encaps_tunnel_type
== BGP_EXT_COM_TUNNEL_VXLANGPE
)) {
7247 proto_tree_add_item(prefix_tree
, hf_bgp_evpn_nlri_vni
, tvb
, reader_offset
, 3, ENC_BIG_ENDIAN
);
7249 decode_MPLS_stack_tree(tvb
, reader_offset
, prefix_tree
);
7255 proto_tree_add_item(prefix_tree
, hf_bgp_evpn_nlri_ipv6_addr
, tvb
, reader_offset
,
7257 reader_offset
+= 16;
7259 proto_tree_add_item(prefix_tree
, hf_bgp_evpn_nlri_ipv6_gtw
, tvb
, reader_offset
,
7261 reader_offset
+= 16;
7263 data
= load_path_attr_data(pinfo
);
7264 if (data
&& data
->encaps_community_present
&&
7265 (data
->encaps_tunnel_type
== BGP_EXT_COM_TUNNEL_VXLAN
|| data
->encaps_tunnel_type
== BGP_EXT_COM_TUNNEL_VXLANGPE
)) {
7266 proto_tree_add_item(prefix_tree
, hf_bgp_evpn_nlri_vni
, tvb
, reader_offset
, 3, ENC_BIG_ENDIAN
);
7268 decode_MPLS_stack_tree(tvb
, reader_offset
, prefix_tree
);
7273 expert_add_info_format(pinfo
, prefix_tree
, &ei_bgp_evpn_nlri_rt_len_err
,
7274 "Invalid length (%u) of EVPN NLRI Route Type 5 (IP Prefix Route)", nlri_len
);
7279 case EVPN_MC_ETHER_TAG_ROUTE
:
7280 case EVPN_IGMP_JOIN_ROUTE
:
7281 case EVPN_IGMP_LEAVE_ROUTE
:
7282 case EVPN_S_PMSI_A_D_ROUTE
:
7284 +---------------------------------------+
7286 +---------------------------------------+
7287 | Ethernet Tag ID (4 octets) |
7288 +---------------------------------------+
7289 | Multicast Source Length (1 octet) |
7290 +---------------------------------------+
7291 | Multicast Source Address (variable) |
7292 +---------------------------------------+
7293 | Multicast Group Length (1 octet) |
7294 +---------------------------------------+
7295 | Multicast Group Address (Variable) |
7296 +---------------------------------------+
7297 | Originator Router Length (1 octet) |
7298 +---------------------------------------+
7299 | Originator Router Address (variable) |
7300 +---------------------------------------+
7301 | Flags (1 octets) (optional) |
7302 +---------------------------------------+
7304 +--------------------------------------------------+
7306 +--------------------------------------------------+
7307 | Ethernet Segment Identifier (10 octets) |
7308 +--------------------------------------------------+
7309 | Ethernet Tag ID (4 octets) |
7310 +--------------------------------------------------+
7311 | Multicast Source Length (1 octet) |
7312 +--------------------------------------------------+
7313 | Multicast Source Address (variable) |
7314 +--------------------------------------------------+
7315 | Multicast Group Length (1 octet) |
7316 +--------------------------------------------------+
7317 | Multicast Group Address (Variable) |
7318 +--------------------------------------------------+
7319 | Originator Router Length (1 octet) |
7320 +--------------------------------------------------+
7321 | Originator Router Address (variable) |
7322 +--------------------------------------------------+
7324 +--------------------------------------------------+
7327 if (nlri_len
< 15) {
7328 expert_add_info_format(pinfo
, prefix_tree
, &ei_bgp_evpn_nlri_rt_len_err
,
7329 "Invalid length (%u) of EVPN NLRI Route Type %u", nlri_len
, route_type
);
7332 item
= proto_tree_add_item(prefix_tree
, hf_bgp_evpn_nlri_rd
, tvb
, reader_offset
,
7334 proto_item_append_text(item
, " (%s)", decode_bgp_rd(pinfo
->pool
, tvb
, reader_offset
));
7337 if (route_type
== EVPN_IGMP_JOIN_ROUTE
|| route_type
== EVPN_IGMP_LEAVE_ROUTE
) {
7338 decode_evpn_nlri_esi(prefix_tree
, tvb
, reader_offset
, pinfo
);
7339 reader_offset
+= 10;
7342 proto_tree_add_item(prefix_tree
, hf_bgp_evpn_nlri_etag
, tvb
, reader_offset
,
7346 ret
= decode_mcast_vpn_nlri_addresses(prefix_tree
, tvb
, reader_offset
);
7350 reader_offset
= ret
;
7351 proto_tree_add_item_ret_uint(prefix_tree
, hf_bgp_evpn_nlri_igmp_mc_or_length
, tvb
,
7352 reader_offset
, 1, ENC_BIG_ENDIAN
, &or_length
);
7356 proto_tree_add_item(prefix_tree
, hf_bgp_evpn_nlri_igmp_mc_or_addr_ipv4
, tvb
,
7357 reader_offset
, 4, ENC_BIG_ENDIAN
);
7361 proto_tree_add_item(prefix_tree
, hf_bgp_evpn_nlri_igmp_mc_or_addr_ipv6
, tvb
,
7362 reader_offset
, 16, ENC_NA
);
7363 reader_offset
+= 16;
7366 if (reader_offset
- start_offset
< nlri_len
) {
7367 proto_tree_add_bitmask(prefix_tree
, tvb
, reader_offset
, hf_bgp_evpn_nlri_igmp_mc_flags
,
7368 ett_bgp_evpn_nlri_mc
, evpn_nlri_igmp_mc_flags
, ENC_BIG_ENDIAN
);
7371 total_length
= reader_offset
- offset
;
7375 expert_add_info_format(pinfo
, tree
, &ei_bgp_evpn_nlri_rt_type_err
,
7376 "Invalid EVPN Route Type (%u)", route_type
);
7380 return total_length
;
7383 static int decode_bgp_mup_nlri_variable_prefix(proto_tree
*tree
, tvbuff_t
*tvb
, int offset
, packet_info
*pinfo
, uint16_t afi
) {
7385 int reader_offset
= offset
;
7386 uint32_t total_length
= 0;
7389 ws_in4_addr ipv4_prefix
;
7390 address ipv4_prefix_addr
;
7391 ws_in6_addr ipv6_prefix
;
7392 address ipv6_prefix_addr
;
7394 uint8_t prefix_length
;
7396 prefix_length
= tvb_get_uint8(tvb
, reader_offset
);
7397 proto_tree_add_item(tree
, hf_bgp_mup_nlri_prefixlen
, tvb
, reader_offset
, 1, ENC_BIG_ENDIAN
);
7402 byte_length
= tvb_get_ipv4_addr_with_prefix_len(tvb
, reader_offset
, &ipv4_prefix
, prefix_length
);
7403 if (byte_length
== -1) {
7404 proto_tree_add_expert_format(tree
, pinfo
, &ei_bgp_prefix_length_invalid
, tvb
, reader_offset
, -1,
7405 "IPv4 prefix has an invalid length: %d bits", prefix_length
);
7408 set_address(&ipv4_prefix_addr
, AT_IPv4
, 4, &ipv4_prefix
);
7409 prefix_str
= address_to_str(pinfo
->pool
, &ipv4_prefix_addr
);
7410 proto_tree_add_ipv4_format_value(tree
, hf_bgp_mup_nlri_ip_prefix
, tvb
, reader_offset
, byte_length
,
7411 ipv4_prefix
, "%s/%d", prefix_str
, prefix_length
);
7412 reader_offset
+= byte_length
;
7416 byte_length
= tvb_get_ipv6_addr_with_prefix_len(tvb
, reader_offset
, &ipv6_prefix
, prefix_length
);
7417 if (byte_length
== -1) {
7418 proto_tree_add_expert_format(tree
, pinfo
, &ei_bgp_prefix_length_invalid
, tvb
, reader_offset
, -1,
7419 "IPv6 prefix has an invalid length: %d bits", prefix_length
);
7422 set_address(&ipv6_prefix_addr
, AT_IPv6
, 16, ipv6_prefix
.bytes
);
7423 prefix_str
= address_to_str(pinfo
->pool
, &ipv6_prefix_addr
);
7424 proto_tree_add_ipv6_format_value(tree
, hf_bgp_mup_nlri_ipv6_prefix
, tvb
, reader_offset
, byte_length
,
7425 &ipv6_prefix
, "%s/%d", prefix_str
, prefix_length
);
7426 reader_offset
+= byte_length
;
7429 total_length
= reader_offset
- offset
;
7430 return total_length
;
7434 static int decode_bgp_mup_nlri_type1_st_route(proto_tree
*tree
, tvbuff_t
*tvb
, int offset
, packet_info
*pinfo
,
7435 uint16_t afi
, uint8_t architecture_type
) {
7437 +-----------------------------------+
7439 +-----------------------------------+
7440 | Prefix Length (1 octet) |
7441 +-----------------------------------+
7442 | Prefix (variable) |
7443 +-----------------------------------+
7444 | Architecture specific (variable) |
7445 +-----------------------------------+
7447 int reader_offset
= offset
;
7448 uint32_t total_length
= 0;
7451 uint8_t endpoint_address_length
;
7452 uint8_t source_address_length
;
7453 proto_item
*arch_spec_item
;
7454 proto_tree
*arch_spec_tree
;
7457 item
= proto_tree_add_item(tree
, hf_bgp_mup_nlri_rd
, tvb
, reader_offset
, 8, ENC_NA
);
7458 proto_item_append_text(item
, " (%s)", decode_bgp_rd(pinfo
->pool
, tvb
, reader_offset
));
7461 reader_offset
+= decode_bgp_mup_nlri_variable_prefix(tree
, tvb
, reader_offset
, pinfo
, afi
);
7463 switch (architecture_type
) {
7464 case BGP_MUP_AT_3GPP_5G
:
7466 +-----------------------------------1
7468 +-----------------------------------+
7470 +-----------------------------------+
7471 | Endpoint Address Length (1 octet) |
7472 +-----------------------------------+
7473 | Endpoint Address (variable) |
7474 +-----------------------------------+
7475 | Source Address Length (1 octet) |
7476 +-----------------------------------+
7477 | Source Address (variable) |
7478 +-----------------------------------+
7480 endpoint_address_length
= tvb_get_uint8(tvb
, reader_offset
+5); // should be multiple of 8
7481 arch_spec_byte
= 7 + endpoint_address_length
/8;
7483 arch_spec_item
= proto_tree_add_item(tree
, hf_bgp_mup_nlri_3gpp_5g_type1_st_route
, tvb
, reader_offset
, arch_spec_byte
, ENC_NA
);
7484 arch_spec_tree
= proto_item_add_subtree(arch_spec_item
, ett_bgp_mup_nlri_3gpp_5g_type1_st_route
);
7486 proto_tree_add_item(arch_spec_tree
, hf_bgp_mup_nlri_3gpp_5g_teid
, tvb
, reader_offset
, 4, ENC_BIG_ENDIAN
);
7489 proto_tree_add_item(arch_spec_tree
, hf_bgp_mup_nlri_3gpp_5g_qfi
, tvb
, reader_offset
, 1, ENC_BIG_ENDIAN
);
7492 proto_tree_add_item(arch_spec_tree
, hf_bgp_mup_nlri_3gpp_5g_ep_addr_len
, tvb
, reader_offset
, 1, ENC_BIG_ENDIAN
);
7495 if (endpoint_address_length
==32) {
7496 proto_tree_add_item(arch_spec_tree
, hf_bgp_mup_nlri_3gpp_5g_ep_ip_addr
, tvb
, reader_offset
, 4, ENC_NA
);
7498 } else if (endpoint_address_length
==128) {
7499 proto_tree_add_item(arch_spec_tree
, hf_bgp_mup_nlri_3gpp_5g_ep_ipv6_addr
, tvb
, reader_offset
, 16, ENC_NA
);
7500 reader_offset
+= 16;
7502 expert_add_info_format(pinfo
, arch_spec_tree
, &ei_bgp_mup_nlri_addr_len_err
,
7503 "Invalid length (%u) of Endpoint Address Length", endpoint_address_length
);
7506 source_address_length
= tvb_get_uint8(tvb
, reader_offset
); // should be zero or multiple of 8
7507 if (source_address_length
==0) {
7509 } else if (source_address_length
==32) {
7510 proto_tree_add_item(arch_spec_tree
, hf_bgp_mup_nlri_3gpp_5g_source_ip_addr
, tvb
, reader_offset
, 4, ENC_NA
);
7512 } else if (source_address_length
==128) {
7513 proto_tree_add_item(arch_spec_tree
, hf_bgp_mup_nlri_3gpp_5g_source_ipv6_addr
, tvb
, reader_offset
, 16, ENC_NA
);
7514 reader_offset
+= 16;
7516 expert_add_info_format(pinfo
, arch_spec_tree
, &ei_bgp_mup_nlri_addr_len_err
,
7517 "Invalid length (%u) of Source Address Length", source_address_length
);
7522 /* return error because the length is unknown */
7523 proto_tree_add_expert_format(tree
, pinfo
, &ei_bgp_mup_unknown_at
, tvb
, reader_offset
, -1,
7524 "Architecture specific type 1 ST route for unknown architecture type: %d", architecture_type
);
7528 total_length
= reader_offset
- offset
;
7529 return total_length
;
7532 static int decode_bgp_mup_nlri_type2_st_route(proto_tree
*tree
, tvbuff_t
*tvb
, int offset
, packet_info
*pinfo
,
7533 uint16_t afi
, uint8_t architecture_type
) {
7535 +-----------------------------------+
7537 +-----------------------------------+
7538 | Endpoint Length (1 octet) |
7539 +-----------------------------------+
7540 | Endpoint Address (variable) |
7541 +-----------------------------------+
7542 | Architecture specific Endpoint |
7543 | Identifier (variable) |
7544 +-----------------------------------+
7546 int reader_offset
= offset
;
7547 uint32_t total_length
= 0;
7550 int byte_length
= 0;
7551 ws_in4_addr ipv4_prefix
;
7552 address ipv4_prefix_addr
;
7553 ws_in6_addr ipv6_prefix
;
7554 address ipv6_prefix_addr
;
7556 uint8_t prefix_length
= 0;
7557 uint8_t endpoint_length
= 0;
7559 uint8_t arch_spec_endpoint_length
= 0;
7560 proto_item
*arch_spec_item
;
7561 proto_tree
*arch_spec_tree
;
7562 uint32_t arch_spec_3gpp_5g_teid
;
7564 rd_pi
= proto_tree_add_item(tree
, hf_bgp_mup_nlri_rd
, tvb
, reader_offset
, 8, ENC_NA
);
7565 proto_item_append_text(rd_pi
, " (%s)", decode_bgp_rd(pinfo
->pool
, tvb
, reader_offset
));
7568 endpoint_length
= tvb_get_uint8(tvb
, reader_offset
);
7569 proto_tree_add_item(tree
, hf_bgp_mup_nlri_ep_len
, tvb
, reader_offset
, 1, ENC_BIG_ENDIAN
);
7574 prefix_length
= endpoint_length
>32 ? 32 : endpoint_length
;
7575 byte_length
= tvb_get_ipv4_addr_with_prefix_len(tvb
, reader_offset
, &ipv4_prefix
, prefix_length
);
7576 set_address(&ipv4_prefix_addr
, AT_IPv4
, 4, &ipv4_prefix
);
7577 prefix_str
= address_to_str(pinfo
->pool
, &ipv4_prefix_addr
);
7579 proto_tree_add_ipv4_format_value(tree
, hf_bgp_mup_nlri_ep_ip_addr
, tvb
, reader_offset
, byte_length
,
7580 ipv4_prefix
, "%s/%d", prefix_str
, prefix_length
);
7581 reader_offset
+= byte_length
;
7583 if (endpoint_length
>32) {
7584 arch_spec_endpoint_length
= endpoint_length
- 32;
7588 prefix_length
= endpoint_length
>128 ? 128 : endpoint_length
;
7589 byte_length
= tvb_get_ipv6_addr_with_prefix_len(tvb
, reader_offset
, &ipv6_prefix
, prefix_length
);
7590 set_address(&ipv6_prefix_addr
, AT_IPv6
, 16, ipv6_prefix
.bytes
);
7591 prefix_str
= address_to_str(pinfo
->pool
, &ipv6_prefix_addr
);
7593 proto_tree_add_ipv6_format_value(tree
, hf_bgp_mup_nlri_ep_ipv6_addr
, tvb
, reader_offset
, byte_length
,
7594 &ipv6_prefix
, "%s/%d", prefix_str
, prefix_length
);
7595 reader_offset
+= byte_length
;
7597 if (endpoint_length
>128) {
7598 arch_spec_endpoint_length
= endpoint_length
- 128;
7602 if (arch_spec_endpoint_length
>0) {
7603 switch (architecture_type
) {
7604 case BGP_MUP_AT_3GPP_5G
:
7606 +-----------------------------------+
7607 | TEID (0-4 octets) |
7608 +-----------------------------------+
7610 byte_length
= tvb_get_ipv4_addr_with_prefix_len(tvb
, reader_offset
, &arch_spec_3gpp_5g_teid
, arch_spec_endpoint_length
);
7612 arch_spec_item
= proto_tree_add_item(tree
, hf_bgp_mup_nlri_3gpp_5g_type2_st_route
, tvb
, reader_offset
, byte_length
, ENC_NA
);
7613 arch_spec_tree
= proto_item_add_subtree(arch_spec_item
, ett_bgp_mup_nlri_3gpp_5g_type2_st_route
);
7614 proto_tree_add_uint_format_value(arch_spec_tree
, hf_bgp_mup_nlri_3gpp_5g_ep_teid
, tvb
, reader_offset
, byte_length
, arch_spec_3gpp_5g_teid
,
7615 "0x%08x/%d", g_ntohl(arch_spec_3gpp_5g_teid
), arch_spec_endpoint_length
);
7616 reader_offset
+= byte_length
;
7619 /* for unknown architecture types, just decode as binary */
7620 byte_length
= (arch_spec_endpoint_length
-1)/8 + 1;
7621 proto_tree_add_item(tree
, hf_bgp_mup_nlri_unknown_data
, tvb
, reader_offset
, byte_length
, ENC_NA
);
7622 reader_offset
+= byte_length
;
7624 proto_tree_add_expert_format(tree
, pinfo
, &ei_bgp_mup_unknown_at
, tvb
, reader_offset
, -1,
7625 "Architecture specific type 2 ST route for unknown architecture type: %d", architecture_type
);
7630 total_length
= reader_offset
- offset
;
7631 return total_length
;
7634 /* draft-mpmz-bess-mup-safi-00 */
7635 static int decode_bgp_mup_nlri(proto_tree
*tree
, tvbuff_t
*tvb
, int offset
, packet_info
*pinfo
, uint16_t afi
) {
7637 int reader_offset
= offset
;
7639 proto_tree
*prefix_tree
;
7640 proto_item
*nlri_pi
;
7642 uint8_t architecture_type
;
7643 uint16_t route_type
;
7646 int decoded_length
= 0;
7648 architecture_type
= tvb_get_uint8(tvb
, offset
);
7649 route_type
= tvb_get_uint16(tvb
, offset
+ 1, ENC_BIG_ENDIAN
);
7650 nlri_len
= tvb_get_uint8(tvb
, offset
+ 3);
7652 nlri_pi
= proto_tree_add_item(tree
, hf_bgp_mup_nlri
, tvb
, reader_offset
, nlri_len
+4, ENC_NA
);
7654 prefix_tree
= proto_item_add_subtree(nlri_pi
, ett_bgp_mup_nlri
);
7656 proto_tree_add_item(prefix_tree
, hf_bgp_mup_nlri_at
, tvb
, reader_offset
, 1, ENC_BIG_ENDIAN
);
7657 proto_item_append_text(nlri_pi
, ": %s", val_to_str(architecture_type
, bgp_mup_architecture_types
,
7658 "Unknown architecture type %d"));
7661 proto_tree_add_item(prefix_tree
, hf_bgp_mup_nlri_rt
, tvb
, reader_offset
, 2, ENC_BIG_ENDIAN
);
7662 proto_item_append_text(nlri_pi
, ": %s", val_to_str(route_type
, bgp_mup_route_types
,
7663 "Unknown route type %d"));
7666 proto_tree_add_item(prefix_tree
, hf_bgp_mup_nlri_len
, tvb
, reader_offset
, 1, ENC_BIG_ENDIAN
);
7669 switch (route_type
) {
7670 case BGP_MUP_RT_INTERWORK_SEGMENT_DISCOVERY
:
7672 +-----------------------------------+
7674 +-----------------------------------+
7675 | Prefix Length (1 octet) |
7676 +-----------------------------------+
7677 | Prefix (variable) |
7678 +-----------------------------------+
7680 rd_pi
= proto_tree_add_item(prefix_tree
, hf_bgp_mup_nlri_rd
, tvb
, reader_offset
, 8, ENC_NA
);
7681 proto_item_append_text(rd_pi
, " (%s)", decode_bgp_rd(pinfo
->pool
, tvb
, reader_offset
));
7684 decoded_length
= decode_bgp_mup_nlri_variable_prefix(prefix_tree
, tvb
, reader_offset
, pinfo
, afi
);
7685 if (decoded_length
< 0) {
7690 case BGP_MUP_RT_DIRECT_SEGMENT_DISCOVERY
:
7692 +-----------------------------------+
7694 +-----------------------------------+
7695 | Address (4 or 16 octets) |
7696 +-----------------------------------+
7698 rd_pi
= proto_tree_add_item(prefix_tree
, hf_bgp_mup_nlri_rd
, tvb
, reader_offset
, 8, ENC_NA
);
7699 proto_item_append_text(rd_pi
, " (%s)", decode_bgp_rd(pinfo
->pool
, tvb
, reader_offset
));
7703 proto_tree_add_item(prefix_tree
, hf_bgp_mup_nlri_ip_addr
, tvb
, reader_offset
, 4, ENC_NA
);
7706 proto_tree_add_item(prefix_tree
, hf_bgp_mup_nlri_ipv6_addr
, tvb
, reader_offset
, 16, ENC_NA
);
7711 case BGP_MUP_RT_TYPE_1_SESSION_TRANSFORMED
:
7712 decoded_length
= decode_bgp_mup_nlri_type1_st_route(prefix_tree
, tvb
, reader_offset
, pinfo
, afi
, architecture_type
);
7713 if (decoded_length
< 0) {
7718 case BGP_MUP_RT_TYPE_2_SESSION_TRANSFORMED
:
7719 decoded_length
= decode_bgp_mup_nlri_type2_st_route(prefix_tree
, tvb
, reader_offset
, pinfo
, afi
, architecture_type
);
7720 if (decoded_length
< 0) {
7726 /* for unknown route types, just decode as binary */
7727 proto_tree_add_item(prefix_tree
, hf_bgp_mup_nlri_unknown_data
, tvb
, reader_offset
, nlri_len
, ENC_NA
);
7728 reader_offset
+= nlri_len
;
7729 proto_tree_add_expert_format(prefix_tree
, pinfo
, &ei_bgp_mup_unknown_rt
, tvb
, reader_offset
, -1,
7730 "Unknown route type: %d", route_type
);
7739 * Decode a multiprotocol prefix
7742 decode_prefix_MP(proto_tree
*tree
, int hf_path_id
, int hf_addr4
, int hf_addr6
,
7743 uint16_t afi
, uint8_t safi
, int tlen
, tvbuff_t
*tvb
, int offset
,
7744 const char *tag
, packet_info
*pinfo
)
7746 int start_offset
= offset
;
7748 proto_tree
*prefix_tree
;
7749 proto_item
*nlri_ti
;
7750 proto_tree
*nlri_tree
;
7751 proto_item
*disting_item
;
7752 proto_tree
*disting_tree
;
7754 int total_length
=0; /* length of the entire item */
7755 int length
; /* length of the prefix address, in bytes */
7757 unsigned plen
; /* length of the prefix address, in bits */
7758 unsigned labnum
; /* number of labels */
7759 uint16_t tnl_id
; /* Tunnel Identifier */
7760 ws_in4_addr ip4addr
; /* IPv4 address */
7762 ws_in6_addr ip6addr
; /* IPv6 address */
7763 uint16_t nlri_type
; /* NLRI Type */
7765 uint32_t path_identifier
=0;
7766 int end
=0; /* Message End */
7768 wmem_strbuf_t
*stack_strbuf
; /* label stack */
7769 wmem_strbuf_t
*comm_strbuf
;
7776 case SAFNUM_UNICAST
:
7777 case SAFNUM_MULCAST
:
7778 case SAFNUM_UNIMULC
:
7779 /* parse each prefix */
7781 end
= offset
+ tlen
;
7783 /* Heuristic to detect if IPv4 prefix are using Path Identifiers */
7784 if( detect_add_path_prefix4(tvb
, offset
, end
) ) {
7785 /* IPv4 prefixes with Path Id */
7786 total_length
= decode_path_prefix4(tree
, pinfo
, hf_path_id
, hf_addr4
, tvb
, offset
, tag
);
7788 total_length
= decode_prefix4(tree
, pinfo
, NULL
,hf_addr4
, tvb
, offset
, tag
);
7790 if (total_length
< 0)
7794 case SAFNUM_MPLS_LABEL
:
7795 end
= offset
+ tlen
;
7796 /* Heuristic to detect if IPv4 prefix are using Path Identifiers */
7797 if( detect_add_path_prefix46(tvb
, offset
, end
, 255) ) {
7798 /* snarf path identifier */
7799 path_identifier
= tvb_get_ntohl(tvb
, offset
);
7804 plen
= tvb_get_uint8(tvb
, offset
);
7805 stack_strbuf
= wmem_strbuf_create(pinfo
->pool
);
7806 labnum
= decode_MPLS_stack(tvb
, offset
+ 1, stack_strbuf
);
7808 offset
+= (1 + labnum
* 3);
7809 if (plen
< (labnum
* 3*8)) {
7810 proto_tree_add_expert_format(tree
, pinfo
, &ei_bgp_prefix_length_invalid
, tvb
, start_offset
, 1,
7811 "%s Labeled IPv4 prefix length %u invalid",
7815 plen
-= (labnum
* 3*8);
7816 length
= tvb_get_ipv4_addr_with_prefix_len(tvb
, offset
, &ip4addr
, plen
);
7818 proto_tree_add_expert_format(tree
, pinfo
, &ei_bgp_prefix_length_invalid
, tvb
, start_offset
, 1,
7819 "%s Labeled IPv4 prefix length %u invalid",
7820 tag
, plen
+ (labnum
* 3*8));
7824 set_address(&addr
, AT_IPv4
, 4, &ip4addr
);
7825 if (total_length
> 0) {
7826 prefix_tree
= proto_tree_add_subtree_format(tree
, tvb
, start_offset
,
7827 (offset
+ length
) - start_offset
,
7828 ett_bgp_prefix
, NULL
,
7829 "Label Stack=%s IPv4=%s/%u PathID %u",
7830 wmem_strbuf_get_str(stack_strbuf
),
7831 address_to_str(pinfo
->pool
, &addr
), plen
, path_identifier
);
7832 proto_tree_add_item(prefix_tree
, hf_path_id
, tvb
, start_offset
, 4, ENC_BIG_ENDIAN
);
7835 prefix_tree
= proto_tree_add_subtree_format(tree
, tvb
, start_offset
,
7836 (offset
+ length
) - start_offset
,
7837 ett_bgp_prefix
, NULL
,
7838 "Label Stack=%s IPv4=%s/%u",
7839 wmem_strbuf_get_str(stack_strbuf
),
7840 address_to_str(pinfo
->pool
, &addr
), plen
);
7842 proto_tree_add_uint_format(prefix_tree
, hf_bgp_prefix_length
, tvb
, start_offset
, 1, plen
+ labnum
* 3 * 8,
7843 "%s Prefix length: %u", tag
, plen
+ labnum
* 3 * 8);
7844 proto_tree_add_string_format(prefix_tree
, hf_bgp_label_stack
, tvb
, start_offset
+ 1, 3 * labnum
, wmem_strbuf_get_str(stack_strbuf
),
7845 "%s Label Stack: %s", tag
, wmem_strbuf_get_str(stack_strbuf
));
7846 total_length
+= (1 + labnum
*3) + length
;
7847 proto_tree_add_ipv4(prefix_tree
, hf_addr4
, tvb
, offset
, length
, ip4addr
);
7849 case SAFNUM_MCAST_VPN
:
7850 total_length
= decode_mcast_vpn_nlri(tree
, tvb
, offset
, afi
, pinfo
);
7851 if (total_length
< 0)
7855 total_length
= decode_mdt_safi(pinfo
, tree
, tvb
, offset
);
7856 if (total_length
< 0)
7859 case SAFNUM_ROUTE_TARGET
:
7860 plen
= tvb_get_uint8(tvb
, offset
);
7863 proto_tree_add_string(tree
, hf_bgp_wildcard_route_target
, tvb
, offset
, 1, tag
);
7868 if ((plen
< 32) || (plen
> 96)) {
7869 proto_tree_add_expert_format(tree
, pinfo
, &ei_bgp_length_invalid
, tvb
, offset
, 1,
7870 "%s Route target length %u invalid",
7875 length
= (plen
+ 7)/8;
7876 comm_strbuf
= wmem_strbuf_create(pinfo
->pool
);
7878 switch (tvb_get_ntohs(tvb
, offset
+ 1 + 4)) {
7879 case BGP_EXT_COM_RT_AS2
:
7880 wmem_strbuf_append_printf(comm_strbuf
, "%u:%u",
7881 tvb_get_ntohs(tvb
, offset
+ 1 + 6),
7882 tvb_get_ntohl(tvb
, offset
+ 1 + 8));
7884 case BGP_EXT_COM_RT_IP4
:
7885 wmem_strbuf_append_printf(comm_strbuf
, "%s:%u",
7886 tvb_ip_to_str(pinfo
->pool
, tvb
, offset
+ 1 + 6),
7887 tvb_get_ntohs(tvb
, offset
+ 1 + 10));
7889 case BGP_EXT_COM_RT_AS4
:
7890 wmem_strbuf_append_printf(comm_strbuf
, "%u:%u",
7891 tvb_get_ntohl(tvb
, 6),
7892 tvb_get_ntohs(tvb
, offset
+ 1 + 10));
7895 wmem_strbuf_append_printf(comm_strbuf
, "Invalid RT type");
7898 prefix_tree
= proto_tree_add_subtree_format(tree
, tvb
, offset
+ 1, length
,
7899 ett_bgp_prefix
, NULL
, "%s %u:%s/%u",
7900 tag
, tvb_get_ntohl(tvb
, offset
+ 1 + 0),
7901 wmem_strbuf_get_str(comm_strbuf
),
7903 proto_tree_add_item(prefix_tree
, hf_bgp_prefix_length
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
7904 proto_tree_add_item(prefix_tree
, hf_bgp_originating_as
, tvb
, offset
+ 1, 4, ENC_BIG_ENDIAN
);
7905 proto_tree_add_string(prefix_tree
, hf_bgp_community_prefix
, tvb
, offset
+ 1 + 4, length
- 4, wmem_strbuf_get_str(comm_strbuf
));
7906 total_length
= 1 + length
;
7908 case SAFNUM_ENCAPSULATION
:
7909 plen
= tvb_get_uint8(tvb
, offset
);
7911 proto_tree_add_expert_format(tree
, pinfo
, &ei_bgp_length_invalid
, tvb
, offset
, 1,
7912 "%s IPv4 address length %u invalid",
7918 proto_tree_add_item(tree
, hf_bgp_endpoint_address
, tvb
, offset
, 4, ENC_NA
);
7920 total_length
= 5; /* length(1 octet) + address(4 octets) */
7923 plen
= tvb_get_uint8(tvb
, offset
);
7925 proto_tree_add_expert_format(tree
, pinfo
, &ei_bgp_prefix_length_invalid
, tvb
, start_offset
, 1,
7926 "%s Tunnel IPv4 prefix length %u invalid",
7930 tnl_id
= tvb_get_ntohs(tvb
, offset
+ 1);
7931 offset
+= 3; /* Length + Tunnel Id */
7932 plen
-= 16; /* 2-octet Identifier */
7933 length
= tvb_get_ipv4_addr_with_prefix_len(tvb
, offset
, &ip4addr
, plen
);
7935 proto_tree_add_expert_format(tree
, pinfo
, &ei_bgp_prefix_length_invalid
, tvb
, start_offset
, 1,
7936 "%s Tunnel IPv4 prefix length %u invalid",
7940 set_address(&addr
, AT_IPv4
, 4, &ip4addr
);
7941 prefix_tree
= proto_tree_add_subtree_format(tree
, tvb
, start_offset
,
7942 (offset
+ length
) - start_offset
,
7943 ett_bgp_prefix
, NULL
,
7944 "Tunnel Identifier=0x%x IPv4=%s/%u",
7945 tnl_id
, address_to_str(pinfo
->pool
, &addr
), plen
);
7947 proto_tree_add_item(prefix_tree
, hf_bgp_prefix_length
, tvb
, start_offset
, 1, ENC_BIG_ENDIAN
);
7949 proto_tree_add_item(prefix_tree
, hf_bgp_mp_nlri_tnl_id
, tvb
,
7950 start_offset
+ 1, 2, ENC_BIG_ENDIAN
);
7951 proto_tree_add_ipv4(prefix_tree
, hf_addr4
, tvb
, offset
, length
, ip4addr
);
7952 total_length
= 1 + 2 + length
; /* length field + Tunnel Id + IPv4 len */
7954 case SAFNUM_SR_POLICY
:
7955 total_length
= decode_sr_policy_nlri(tree
, tvb
, offset
, afi
);
7956 if (total_length
< 0)
7959 case SAFNUM_LAB_VPNUNICAST
:
7960 case SAFNUM_LAB_VPNMULCAST
:
7961 case SAFNUM_LAB_VPNUNIMULC
:
7962 end
= offset
+ tlen
;
7963 /* Heuristic to detect if IPv4 prefix are using Path Identifiers */
7964 if (detect_add_path_prefix46(tvb
, offset
, end
, 255)) {
7965 /* snarf path identifier */
7969 plen
= tvb_get_uint8(tvb
, offset
);
7970 stack_strbuf
= wmem_strbuf_create(pinfo
->pool
);
7971 labnum
= decode_MPLS_stack(tvb
, offset
+ 1, stack_strbuf
);
7973 offset
+= (1 + labnum
* 3);
7974 if (plen
< (labnum
* 3*8 + 8*8)) {
7975 proto_tree_add_expert_format(tree
, pinfo
, &ei_bgp_prefix_length_invalid
, tvb
, start_offset
, 1,
7976 "%s Labeled VPN IPv4 prefix length %u invalid",
7980 plen
-= (labnum
* 3*8 + 8*8);
7982 length
= tvb_get_ipv4_addr_with_prefix_len(tvb
, offset
+ 8, &ip4addr
, plen
);
7984 proto_tree_add_expert_format(tree
, pinfo
, &ei_bgp_prefix_length_invalid
, tvb
, start_offset
, 1,
7985 "%s Labeled VPN IPv4 prefix length %u invalid",
7986 tag
, plen
+ (labnum
* 3*8) + 8*8);
7989 set_address(&addr
, AT_IPv4
, 4, &ip4addr
);
7990 prefix_tree
= proto_tree_add_subtree_format(tree
, tvb
, start_offset
,
7991 (offset
+ 8 + length
) - start_offset
,
7992 ett_bgp_prefix
, NULL
, "BGP Prefix");
7994 if (total_length
> 0) {
7995 proto_tree_add_item(prefix_tree
, hf_path_id
, tvb
, start_offset
, 4, ENC_BIG_ENDIAN
);
7998 proto_tree_add_item(prefix_tree
, hf_bgp_prefix_length
, tvb
, start_offset
, 1, ENC_NA
);
7999 proto_tree_add_string(prefix_tree
, hf_bgp_label_stack
, tvb
, start_offset
+ 1, 3 * labnum
, wmem_strbuf_get_str(stack_strbuf
));
8000 proto_tree_add_string(prefix_tree
, hf_bgp_rd
, tvb
, start_offset
+ 1 + 3 * labnum
, 8, decode_bgp_rd(pinfo
->pool
, tvb
, offset
));
8002 proto_tree_add_ipv4(prefix_tree
, hf_addr4
, tvb
, offset
+ 8, length
, ip4addr
);
8004 total_length
+= (1 + labnum
* 3 + 8) + length
;
8007 case SAFNUM_FSPEC_RULE
:
8008 case SAFNUM_FSPEC_VPN_RULE
:
8009 total_length
= decode_flowspec_nlri(tree
, tvb
, offset
, afi
, safi
, pinfo
);
8010 if(total_length
< 0)
8014 case SAFNUM_BGP_MUP
:
8015 total_length
= decode_bgp_mup_nlri(tree
, tvb
, offset
, pinfo
, afi
);
8018 proto_tree_add_expert_format(tree
, pinfo
, &ei_bgp_unknown_safi
, tvb
, start_offset
, 0,
8019 "Unknown SAFI (%u) for AFI %u", safi
, afi
);
8021 } /* switch (safi) */
8027 case SAFNUM_UNICAST
:
8028 case SAFNUM_MULCAST
:
8029 case SAFNUM_UNIMULC
:
8030 /* parse each prefix */
8032 end
= offset
+ tlen
;
8034 /* Heuristic to detect if IPv6 prefix are using Path Identifiers */
8035 if( detect_add_path_prefix6(tvb
, offset
, end
) ) {
8036 /* IPv6 prefixes with Path Id */
8037 total_length
= decode_path_prefix6(tree
, pinfo
, hf_path_id
, hf_addr6
, tvb
, offset
, tag
);
8039 total_length
= decode_prefix6(tree
, pinfo
, hf_addr6
, tvb
, offset
, 0, tag
);
8041 if (total_length
< 0)
8045 case SAFNUM_MPLS_LABEL
:
8046 end
= offset
+ tlen
;
8047 /* Heuristic to detect if IPv6 prefix are using Path Identifiers */
8048 if( detect_add_path_prefix46(tvb
, offset
, end
, 255) ) {
8049 /* snarf path identifier */
8050 path_identifier
= tvb_get_ntohl(tvb
, offset
);
8055 plen
= tvb_get_uint8(tvb
, offset
);
8056 stack_strbuf
= wmem_strbuf_create(pinfo
->pool
);
8057 labnum
= decode_MPLS_stack(tvb
, offset
+ 1, stack_strbuf
);
8059 offset
+= (1 + labnum
* 3);
8060 if (plen
< (labnum
* 3*8)) {
8061 proto_tree_add_expert_format(tree
, pinfo
, &ei_bgp_prefix_length_invalid
, tvb
, start_offset
, 1,
8062 "%s Labeled IPv6 prefix length %u invalid", tag
, plen
);
8065 plen
-= (labnum
* 3*8);
8067 length
= tvb_get_ipv6_addr_with_prefix_len(tvb
, offset
, &ip6addr
, plen
);
8069 proto_tree_add_expert_format(tree
, pinfo
, &ei_bgp_prefix_length_invalid
, tvb
, start_offset
, 1,
8070 "%s Labeled IPv6 prefix length %u invalid",
8071 tag
, plen
+ (labnum
* 3*8));
8075 set_address(&addr
, AT_IPv6
, 16, ip6addr
.bytes
);
8076 if (total_length
> 0) {
8077 prefix_tree
= proto_tree_add_subtree_format(tree
, tvb
, start_offset
,
8078 (offset
+ length
) - start_offset
,
8079 ett_bgp_prefix
, NULL
,
8080 "Label Stack=%s, IPv6=%s/%u PathId %u",
8081 wmem_strbuf_get_str(stack_strbuf
),
8082 address_to_str(pinfo
->pool
, &addr
), plen
, path_identifier
);
8083 proto_tree_add_item(prefix_tree
, hf_path_id
, tvb
, start_offset
, 4, ENC_BIG_ENDIAN
);
8086 prefix_tree
= proto_tree_add_subtree_format(tree
, tvb
, start_offset
,
8087 (offset
+ length
) - start_offset
,
8088 ett_bgp_prefix
, NULL
,
8089 "Label Stack=%s, IPv6=%s/%u",
8090 wmem_strbuf_get_str(stack_strbuf
),
8091 address_to_str(pinfo
->pool
, &addr
), plen
);
8093 proto_tree_add_uint_format(prefix_tree
, hf_bgp_prefix_length
, tvb
, start_offset
, 1, plen
+ labnum
* 3 * 8,
8094 "%s Prefix length: %u", tag
, plen
+ labnum
* 3 * 8);
8095 proto_tree_add_string_format(prefix_tree
, hf_bgp_label_stack
, tvb
, start_offset
+ 1, 3 * labnum
, wmem_strbuf_get_str(stack_strbuf
),
8096 "%s Label Stack: %s", tag
, wmem_strbuf_get_str(stack_strbuf
));
8097 total_length
+= (1 + labnum
*3) + length
;
8098 proto_tree_add_ipv6(prefix_tree
, hf_addr6
, tvb
, offset
, length
, &ip6addr
);
8100 case SAFNUM_MCAST_VPN
:
8101 total_length
= decode_mcast_vpn_nlri(tree
, tvb
, offset
, afi
, pinfo
);
8102 if (total_length
< 0)
8105 case SAFNUM_ENCAPSULATION
:
8106 plen
= tvb_get_uint8(tvb
, offset
);
8108 proto_tree_add_expert_format(tree
, pinfo
, &ei_bgp_length_invalid
, tvb
, offset
, 1,
8109 "%s IPv6 address length %u invalid",
8115 proto_tree_add_item(tree
, hf_bgp_endpoint_address_ipv6
, tvb
, offset
, 16, ENC_NA
);
8117 total_length
= 17; /* length(1 octet) + address(16 octets) */
8120 plen
= tvb_get_uint8(tvb
, offset
);
8122 proto_tree_add_expert_format(tree
, pinfo
, &ei_bgp_prefix_length_invalid
, tvb
, start_offset
, 1,
8123 "%s Tunnel IPv6 prefix length %u invalid",
8127 tnl_id
= tvb_get_ntohs(tvb
, offset
+ 1);
8128 offset
+= 3; /* Length + Tunnel Id */
8129 plen
-= 16; /* 2-octet Identifier */
8130 length
= tvb_get_ipv6_addr_with_prefix_len(tvb
, offset
, &ip6addr
, plen
);
8132 proto_tree_add_expert_format(tree
, pinfo
, &ei_bgp_prefix_length_invalid
, tvb
, start_offset
, 1,
8133 "%s Tunnel IPv6 prefix length %u invalid",
8137 set_address(&addr
, AT_IPv6
, 16, ip6addr
.bytes
);
8138 prefix_tree
= proto_tree_add_subtree_format(tree
, tvb
, start_offset
,
8139 (offset
+ length
) - start_offset
,
8140 ett_bgp_prefix
, NULL
,
8141 "Tunnel Identifier=0x%x IPv6=%s/%u",
8142 tnl_id
, address_to_str(pinfo
->pool
, &addr
), plen
);
8143 proto_tree_add_item(prefix_tree
, hf_bgp_prefix_length
, tvb
, start_offset
, 1, ENC_BIG_ENDIAN
);
8145 proto_tree_add_item(prefix_tree
, hf_bgp_mp_nlri_tnl_id
, tvb
,
8146 start_offset
+ 1, 2, ENC_BIG_ENDIAN
);
8147 proto_tree_add_ipv6(prefix_tree
, hf_addr6
, tvb
, offset
, length
, &ip6addr
);
8149 total_length
= (1 + 2) + length
; /* length field + Tunnel Id + IPv4 len */
8152 case SAFNUM_SR_POLICY
:
8153 total_length
= decode_sr_policy_nlri(tree
, tvb
, offset
, afi
);
8154 if (total_length
< 0)
8158 case SAFNUM_BGP_MUP
:
8159 total_length
= decode_bgp_mup_nlri(tree
, tvb
, offset
, pinfo
, afi
);
8161 case SAFNUM_LAB_VPNUNICAST
:
8162 case SAFNUM_LAB_VPNMULCAST
:
8163 case SAFNUM_LAB_VPNUNIMULC
:
8164 end
= offset
+ tlen
;
8165 /* Heuristic to detect if IPv6 prefix are using Path Identifiers */
8166 if (detect_add_path_prefix46(tvb
, offset
, end
, 255)) {
8167 /* snarf path identifier */
8171 plen
= tvb_get_uint8(tvb
, offset
);
8172 stack_strbuf
= wmem_strbuf_create(pinfo
->pool
);
8173 labnum
= decode_MPLS_stack(tvb
, offset
+ 1, stack_strbuf
);
8175 offset
+= (1 + labnum
* 3);
8176 if (plen
< (labnum
* 3*8 + 8*8)) {
8177 proto_tree_add_expert_format(tree
, pinfo
, &ei_bgp_prefix_length_invalid
, tvb
, start_offset
, 1,
8178 "%s Labeled VPN IPv6 prefix length %u invalid", tag
, plen
);
8181 plen
-= (labnum
* 3*8 + 8*8);
8183 length
= tvb_get_ipv6_addr_with_prefix_len(tvb
, offset
+ 8, &ip6addr
, plen
);
8185 proto_tree_add_expert_format(tree
, pinfo
, &ei_bgp_prefix_length_invalid
, tvb
, start_offset
, 1,
8186 "%s Labeled VPN IPv6 prefix length %u invalid",
8187 tag
, plen
+ (labnum
* 3*8) + 8*8);
8191 if (total_length
> 0) {
8192 proto_tree_add_item(tree
, hf_path_id
, tvb
, start_offset
, 4, ENC_BIG_ENDIAN
);
8195 proto_tree_add_item(tree
, hf_bgp_prefix_length
, tvb
, start_offset
, 1, ENC_NA
);
8196 proto_tree_add_string(tree
, hf_bgp_label_stack
, tvb
, start_offset
+ 1, labnum
* 3, wmem_strbuf_get_str(stack_strbuf
));
8197 proto_tree_add_string(tree
, hf_bgp_rd
, tvb
, offset
, 8, decode_bgp_rd(pinfo
->pool
, tvb
, offset
));
8200 set_address(&addr
, AT_IPv6
, 16, ip6addr
.bytes
);
8201 proto_tree_add_ipv6_format_value(tree
, hf_addr6
, tvb
, offset
+ 8, length
,
8202 &ip6addr
, "%s/%u", address_to_str(pinfo
->pool
, &addr
), plen
);
8204 total_length
+= (1 + labnum
* 3 + 8) + length
;
8207 case SAFNUM_FSPEC_RULE
:
8208 case SAFNUM_FSPEC_VPN_RULE
:
8209 total_length
= decode_flowspec_nlri(tree
, tvb
, offset
, afi
, safi
, pinfo
);
8210 if(total_length
< 0)
8215 proto_tree_add_expert_format(tree
, pinfo
, &ei_bgp_unknown_safi
, tvb
, start_offset
, 0,
8216 "Unknown SAFI (%u) for AFI %u", safi
, afi
);
8218 } /* switch (safi) */
8222 case AFNUM_L2VPN_OLD
:
8225 case SAFNUM_LAB_VPNUNICAST
:
8226 case SAFNUM_LAB_VPNMULCAST
:
8227 case SAFNUM_LAB_VPNUNIMULC
:
8229 plen
= tvb_get_ntohs(tvb
,offset
);
8230 proto_tree_add_item(tree
, hf_bgp_vplsad_length
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
8232 proto_tree_add_string(tree
, hf_bgp_vplsad_rd
, tvb
, offset
+2, 8, decode_bgp_rd(pinfo
->pool
, tvb
, offset
+2));
8233 /* RFC6074 Section 7 BGP-AD and VPLS-BGP Interoperability
8234 Both BGP-AD and VPLS-BGP [RFC4761] use the same AFI/SAFI. In order
8235 for both BGP-AD and VPLS-BGP to co-exist, the NLRI length must be
8236 used as a demultiplexer.
8238 The BGP-AD NLRI has an NLRI length of 12 bytes, containing only an
8239 8-byte RD and a 4-byte VSI-ID. VPLS-BGP [RFC4761] uses a 17-byte
8240 NLRI length. Therefore, implementations of BGP-AD must ignore NLRI
8241 that are greater than 12 bytes.
8243 if(plen
== 12) /* BGP-AD */
8245 proto_tree_add_item(tree
, hf_bgp_bgpad_pe_addr
, tvb
, offset
+10, 4, ENC_NA
);
8246 }else{ /* VPLS-BGP */
8248 proto_tree_add_item(tree
, hf_bgp_vplsbgp_ce_id
, tvb
, offset
+10, 2, ENC_BIG_ENDIAN
);
8250 proto_tree_add_item(tree
, hf_bgp_vplsbgp_labelblock_offset
, tvb
, offset
+12, 2, ENC_BIG_ENDIAN
);
8251 proto_tree_add_item(tree
, hf_bgp_vplsbgp_labelblock_size
, tvb
, offset
+14, 2, ENC_BIG_ENDIAN
);
8252 stack_strbuf
= wmem_strbuf_create(pinfo
->pool
);
8253 decode_MPLS_stack(tvb
, offset
+ 16, stack_strbuf
);
8254 proto_tree_add_string(tree
, hf_bgp_vplsbgp_labelblock_base
, tvb
, offset
+16, plen
-14, wmem_strbuf_get_str(stack_strbuf
));
8257 /* FIXME there are subTLVs left to decode ... for now lets omit them */
8258 total_length
= plen
+2;
8262 /* Check for Add Path */
8263 if (tvb_get_uint8(tvb
, offset
+ 4 ) <= EVPN_S_PMSI_A_D_ROUTE
&& tvb_get_uint8(tvb
, offset
) == 0) {
8264 proto_tree_add_item(tree
, hf_path_id
, tvb
, offset
, 4, ENC_BIG_ENDIAN
);
8266 total_length
= decode_evpn_nlri(tree
, tvb
, offset
, pinfo
) + 4;
8268 total_length
= decode_evpn_nlri(tree
, tvb
, offset
, pinfo
);
8273 proto_tree_add_expert_format(tree
, pinfo
, &ei_bgp_unknown_safi
, tvb
, start_offset
, 0,
8274 "Unknown SAFI (%u) for AFI %u", safi
, afi
);
8276 } /* switch (safi) */
8279 nlri_type
= tvb_get_ntohs(tvb
, offset
);
8280 total_length
= tvb_get_ntohs(tvb
, offset
+ 2);
8281 length
= total_length
;
8284 if (safi
== SAFNUM_BGP_LS
|| safi
== SAFNUM_BGP_LS_VPN
) {
8285 ti
= proto_tree_add_item(tree
, hf_bgp_ls_nlri
, tvb
, offset
, total_length
, ENC_NA
);
8286 } else if (safi
== SAFNUM_LAB_VPNUNICAST
) {
8287 ti
= proto_tree_add_item(tree
, hf_bgp_ls_safi128_nlri
, tvb
, offset
, total_length
, ENC_NA
);
8291 prefix_tree
= proto_item_add_subtree(ti
, ett_bgp_mp_reach_nlri
);
8292 proto_tree_add_item(prefix_tree
, hf_bgp_ls_nlri_type
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
8293 proto_tree_add_item(prefix_tree
, hf_bgp_ls_nlri_length
, tvb
, offset
+ 2, 2, ENC_BIG_ENDIAN
);
8296 /* when SAFI 128, then write route distinguisher */
8297 if (safi
== SAFNUM_LAB_VPNUNICAST
) {
8298 if (length
< BGP_ROUTE_DISTINGUISHER_SIZE
) {
8300 expert_add_info_format(pinfo
, prefix_tree
, &ei_bgp_ls_error
,
8301 "Unexpected end of SAFI 128 NLRI, Route Distinguisher field is required!");
8304 expert_add_info_format(pinfo
, prefix_tree
, &ei_bgp_ls_error
,
8305 "Unexpected Route Distinguisher length (%u)!",
8310 disting_item
= proto_tree_add_item(prefix_tree
, hf_bgp_ls_safi128_nlri_route_distinguisher
,
8311 tvb
, offset
, BGP_ROUTE_DISTINGUISHER_SIZE
, ENC_NA
);
8312 disting_tree
= proto_item_add_subtree(disting_item
, ett_bgp_mp_reach_nlri
);
8313 tmp16
= tvb_get_ntohs(tvb
, offset
);
8314 proto_tree_add_item(disting_tree
, hf_bgp_ls_safi128_nlri_route_distinguisher_type
,
8315 tvb
, offset
, 2, ENC_BIG_ENDIAN
);
8316 /* Route Distinguisher Type */
8319 proto_tree_add_item(disting_tree
, hf_bgp_ls_safi128_nlri_route_dist_admin_asnum_2
,
8320 tvb
, offset
+ 2, 2, ENC_BIG_ENDIAN
);
8321 proto_tree_add_item(disting_tree
, hf_bgp_ls_safi128_nlri_route_dist_asnum_4
,
8322 tvb
, offset
+ 4, 4, ENC_BIG_ENDIAN
);
8326 proto_tree_add_item(disting_tree
, hf_bgp_ls_safi128_nlri_route_dist_admin_ipv4
,
8327 tvb
, offset
+ 2, 4, ENC_BIG_ENDIAN
);
8328 proto_tree_add_item(disting_tree
, hf_bgp_ls_safi128_nlri_route_dist_asnum_2
,
8329 tvb
, offset
+ 6, 2, ENC_BIG_ENDIAN
);
8333 proto_tree_add_item(disting_tree
, hf_bgp_ls_safi128_nlri_route_dist_admin_asnum_4
,
8334 tvb
, offset
+ 2, 4, ENC_BIG_ENDIAN
);
8335 proto_tree_add_item(disting_tree
, hf_bgp_ls_safi128_nlri_route_dist_asnum_2
,
8336 tvb
, offset
+ 6, 2, ENC_BIG_ENDIAN
);
8340 expert_add_info_format(pinfo
, disting_tree
, &ei_bgp_ls_error
,
8341 "Unknown Route Distinguisher type (%u)", tmp16
);
8343 offset
+= BGP_ROUTE_DISTINGUISHER_SIZE
;
8344 length
-= BGP_ROUTE_DISTINGUISHER_SIZE
;
8347 switch (nlri_type
) {
8348 case LINK_STATE_LINK_NLRI
:
8350 nlri_ti
= proto_tree_add_item(prefix_tree
,
8351 hf_bgp_ls_nlri_link_nlri_type
, tvb
, offset
, length
,
8353 nlri_tree
= proto_item_add_subtree(nlri_ti
, ett_bgp_mp_reach_nlri
);
8354 tmp_length
= decode_bgp_link_node_nlri_common_fields(tvb
, nlri_tree
,
8355 offset
, pinfo
, length
);
8359 offset
+= tmp_length
;
8360 length
-= tmp_length
;
8362 /* dissect Remote Node descriptors TLV */
8363 if (length
> 0 && length
< 4) {
8364 expert_add_info_format(pinfo
, nlri_tree
, &ei_bgp_ls_error
,
8365 "Unknown data in Link-State Link NLRI!");
8371 tmp_length
= decode_bgp_link_node_nlri_tlvs(tvb
, nlri_tree
, offset
,
8372 pinfo
, BGP_NLRI_TLV_REMOTE_NODE_DESCRIPTORS
);
8376 offset
+= tmp_length
;
8377 length
-= tmp_length
;
8379 /* dissect Link Descriptor NLRI */
8380 if (length
> 0 && length
< 4) {
8381 expert_add_info_format(pinfo
, nlri_tree
, &ei_bgp_ls_error
,
8382 "Unknown data in Link-State Link NLRI, length = %d bytes.", length
);
8388 tmp_length
= decode_bgp_link_nlri_link_descriptors(tvb
, nlri_tree
,
8389 offset
, pinfo
, length
);
8395 case LINK_STATE_NODE_NLRI
:
8396 nlri_ti
= proto_tree_add_item(prefix_tree
,
8397 hf_bgp_ls_nlri_node_nlri_type
, tvb
, offset
, length
,
8399 nlri_tree
= proto_item_add_subtree(nlri_ti
, ett_bgp_mp_reach_nlri
);
8400 tmp_length
= decode_bgp_link_node_nlri_common_fields(tvb
, nlri_tree
,
8401 offset
, pinfo
, length
);
8407 case LINK_STATE_IPV4_TOPOLOGY_PREFIX_NLRI
:
8408 nlri_ti
= proto_tree_add_item(prefix_tree
,
8409 hf_bgp_ls_ipv4_topology_prefix_nlri_type
, tvb
, offset
, length
,
8411 nlri_tree
= proto_item_add_subtree(nlri_ti
, ett_bgp_mp_reach_nlri
);
8412 tmp_length
= decode_bgp_link_node_nlri_common_fields(tvb
, nlri_tree
,
8413 offset
, pinfo
, length
);
8417 offset
+= tmp_length
;
8418 length
-= tmp_length
;
8420 /* dissect Prefix Descriptors NLRI */
8421 if (length
> 0 && length
< 4) {
8422 expert_add_info_format(pinfo
, nlri_tree
, &ei_bgp_ls_error
,
8423 "Unknown data in Link-State Link NLRI, length = %d bytes.", length
);
8429 tmp_length
= decode_bgp_link_nlri_prefix_descriptors(tvb
, nlri_tree
,
8430 offset
, pinfo
, length
, IP_PROTO_IPV4
);
8436 case LINK_STATE_IPV6_TOPOLOGY_PREFIX_NLRI
:
8437 nlri_ti
= proto_tree_add_item(prefix_tree
,
8438 hf_bgp_ls_ipv6_topology_prefix_nlri_type
, tvb
, offset
, length
,
8440 nlri_tree
= proto_item_add_subtree(nlri_ti
, ett_bgp_mp_reach_nlri
);
8441 tmp_length
= decode_bgp_link_node_nlri_common_fields(tvb
, nlri_tree
,
8442 offset
, pinfo
, length
);
8446 offset
+= tmp_length
;
8447 length
-= tmp_length
;
8449 /* dissect Prefix Descriptors NLRI */
8450 if (length
> 0 && length
< 4) {
8451 expert_add_info_format(pinfo
, nlri_tree
, &ei_bgp_ls_error
,
8452 "Unknown data in Link-State Link NLRI!");
8458 tmp_length
= decode_bgp_link_nlri_prefix_descriptors(tvb
, nlri_tree
,
8459 offset
, pinfo
, length
, IP_PROTO_IPV6
);
8465 case LINK_STATE_SRV6_SID_NLRI
:
8466 nlri_ti
= proto_tree_add_item(prefix_tree
,
8467 hf_bgp_ls_nlri_srv6_sid_nlri_type
, tvb
, offset
, length
,
8469 nlri_tree
= proto_item_add_subtree(nlri_ti
, ett_bgp_mp_reach_nlri
);
8470 tmp_length
= decode_bgp_link_node_nlri_common_fields(tvb
, nlri_tree
,
8471 offset
, pinfo
, length
);
8475 offset
+= tmp_length
;
8476 length
-= tmp_length
;
8478 /* dissect SRv6 SID Descriptors NLRI */
8479 if (length
> 0 && length
< 4) {
8480 expert_add_info_format(pinfo
, nlri_tree
, &ei_bgp_ls_error
,
8481 "Unknown data in Link-State SRv6 SID NLRI!");
8487 tmp_length
= decode_bgp_link_nlri_srv6_sid_descriptors(tvb
, nlri_tree
,
8488 offset
, pinfo
, length
);
8495 proto_tree_add_expert_format(tree
, pinfo
, &ei_bgp_ls_error
, tvb
, start_offset
, 0,
8496 "Unknown Link-State NLRI type (%u)", afi
);
8502 proto_tree_add_expert_format(tree
, pinfo
, &ei_bgp_unknown_afi
, tvb
, start_offset
, 0,
8503 "Unknown AFI (%u) value", afi
);
8505 } /* switch (afi) */
8506 return total_length
;
8510 * Dissect a BGP capability.
8513 dissect_bgp_capability_item(tvbuff_t
*tvb
, proto_tree
*tree
, packet_info
*pinfo
, int offset
, bool action
)
8515 proto_tree
*cap_tree
;
8521 ti
= proto_tree_add_item(tree
, hf_bgp_cap
, tvb
, offset
, -1, ENC_NA
);
8522 cap_tree
= proto_item_add_subtree(ti
, ett_bgp_cap
);
8524 proto_tree_add_item(cap_tree
, hf_bgp_cap_type
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
8525 ctype
= tvb_get_uint8(tvb
, offset
);
8526 proto_item_append_text(ti
, ": %s", val_to_str(ctype
, capability_vals
, "Unknown capability %d"));
8529 ti_len
= proto_tree_add_item(cap_tree
, hf_bgp_cap_length
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
8530 clen
= tvb_get_uint8(tvb
, offset
);
8531 proto_item_set_len(ti
, clen
+2);
8535 proto_tree_add_item(cap_tree
, hf_bgp_cap_action
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
8536 proto_item_set_len(ti
, clen
+3);
8540 /* check the capability type */
8542 case BGP_CAPABILITY_RESERVED
:
8544 expert_add_info_format(pinfo
, ti_len
, &ei_bgp_cap_len_bad
, "Capability length %u wrong, must be = 0", clen
);
8545 proto_tree_add_item(cap_tree
, hf_bgp_cap_unknown
, tvb
, offset
, clen
, ENC_NA
);
8549 case BGP_CAPABILITY_MULTIPROTOCOL
:
8551 expert_add_info_format(pinfo
, ti_len
, &ei_bgp_cap_len_bad
, "Capability length %u is wrong, must be = 4", clen
);
8552 proto_tree_add_item(cap_tree
, hf_bgp_cap_unknown
, tvb
, offset
, clen
, ENC_NA
);
8557 proto_tree_add_item(cap_tree
, hf_bgp_cap_mp_afi
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
8561 proto_tree_add_item(cap_tree
, hf_bgp_cap_reserved
, tvb
, offset
, 1, ENC_NA
);
8565 proto_tree_add_item(cap_tree
, hf_bgp_cap_mp_safi
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
8569 case BGP_CAPABILITY_EXTENDED_NEXT_HOP
: {
8570 int eclen
= offset
+ clen
;
8571 while (offset
<= eclen
- 6) {
8573 proto_tree_add_item(cap_tree
, hf_bgp_cap_enh_afi
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
8577 proto_tree_add_item(cap_tree
, hf_bgp_cap_enh_safi
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
8581 proto_tree_add_item(cap_tree
, hf_bgp_cap_enh_nhafi
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
8584 if (offset
!= eclen
) {
8585 expert_add_info_format(pinfo
, ti_len
, &ei_bgp_cap_len_bad
, "Capability length %u is wrong, must be multiple of 6", clen
);
8586 proto_tree_add_item(cap_tree
, hf_bgp_cap_unknown
, tvb
, offset
, eclen
- offset
, ENC_NA
);
8591 case BGP_CAPABILITY_BGP_ROLE
:
8593 expert_add_info_format(pinfo
, ti_len
, &ei_bgp_cap_len_bad
, "Capability length %u is wrong, must be = 1", clen
);
8594 proto_tree_add_item(cap_tree
, hf_bgp_cap_unknown
, tvb
, offset
, clen
, ENC_NA
);
8598 proto_tree_add_item(cap_tree
, hf_bgp_cap_role
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
8602 case BGP_CAPABILITY_GRACEFUL_RESTART
:
8603 if ((clen
< 6) && (clen
!= 2)) {
8604 expert_add_info_format(pinfo
, ti_len
, &ei_bgp_cap_len_bad
, "Capability length %u too short, must be greater than 6", clen
);
8605 proto_tree_add_item(cap_tree
, hf_bgp_cap_unknown
, tvb
, offset
, clen
, ENC_NA
);
8609 int eclen
= offset
+ clen
;
8611 static int * const timer_flags
[] = {
8612 &hf_bgp_cap_gr_timers_restart_flag
,
8613 &hf_bgp_cap_gr_timers_notification_flag
,
8614 &hf_bgp_cap_gr_timers_restart_time
,
8619 expert_add_info(pinfo
, ti_len
, &ei_bgp_cap_gr_helper_mode_only
);
8623 proto_tree_add_bitmask(cap_tree
, tvb
, offset
, hf_bgp_cap_gr_timers
, ett_bgp_cap
, timer_flags
, ENC_BIG_ENDIAN
);
8627 * what follows is alist of AFI/SAFI/flag triplets
8628 * read it until the TLV ends
8630 while (offset
< eclen
) {
8631 static int * const flags
[] = {
8632 &hf_bgp_cap_gr_flag_pfs
,
8637 proto_tree_add_item(cap_tree
, hf_bgp_cap_gr_afi
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
8641 proto_tree_add_item(cap_tree
, hf_bgp_cap_gr_safi
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
8645 proto_tree_add_bitmask(cap_tree
, tvb
, offset
, hf_bgp_cap_gr_flag
, ett_bgp_cap
, flags
, ENC_BIG_ENDIAN
);
8650 case BGP_CAPABILITY_4_OCTET_AS_NUMBER
:
8652 expert_add_info_format(pinfo
, ti_len
, &ei_bgp_cap_len_bad
, "Capability length %u is wrong, must be = 4", clen
);
8653 proto_tree_add_item(cap_tree
, hf_bgp_cap_unknown
, tvb
, offset
, clen
, ENC_NA
);
8657 proto_tree_add_item(cap_tree
, hf_bgp_cap_4as
, tvb
, offset
, 4, ENC_BIG_ENDIAN
);
8661 case BGP_CAPABILITY_DYNAMIC_CAPABILITY
:
8663 int eclen
= offset
+ clen
;
8665 while (offset
< eclen
) {
8666 proto_tree_add_item(cap_tree
, hf_bgp_cap_dc
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
8671 case BGP_CAPABILITY_ADDITIONAL_PATHS
:
8672 if (clen
% 4 != 0) {
8673 expert_add_info_format(pinfo
, ti_len
, &ei_bgp_cap_len_bad
, "Capability length %u is wrong, must be multiple of 4", clen
);
8674 proto_tree_add_item(cap_tree
, hf_bgp_cap_unknown
, tvb
, offset
, clen
, ENC_NA
);
8677 else { /* AFI SAFI Send-receive*/
8678 int eclen
= offset
+ clen
;
8680 while (offset
< eclen
){
8682 proto_tree_add_item(cap_tree
, hf_bgp_cap_ap_afi
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
8686 proto_tree_add_item(cap_tree
, hf_bgp_cap_ap_safi
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
8690 proto_tree_add_item(cap_tree
, hf_bgp_cap_ap_sendreceive
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
8696 case BGP_CAPABILITY_FQDN
:{
8697 uint8_t hostname_len
, domain_name_len
;
8699 proto_tree_add_item(cap_tree
, hf_bgp_cap_fqdn_hostname_len
, tvb
, offset
, 1, ENC_NA
);
8700 hostname_len
= tvb_get_uint8(tvb
, offset
);
8703 proto_tree_add_item(cap_tree
, hf_bgp_cap_fqdn_hostname
, tvb
, offset
, hostname_len
, ENC_ASCII
);
8704 offset
+= hostname_len
;
8706 proto_tree_add_item(cap_tree
, hf_bgp_cap_fqdn_domain_name_len
, tvb
, offset
, 1, ENC_NA
);
8707 domain_name_len
= tvb_get_uint8(tvb
, offset
);
8710 proto_tree_add_item(cap_tree
, hf_bgp_cap_fqdn_domain_name
, tvb
, offset
, domain_name_len
, ENC_ASCII
);
8711 offset
+= domain_name_len
;
8716 case BGP_CAPABILITY_ENHANCED_ROUTE_REFRESH
:
8717 case BGP_CAPABILITY_ROUTE_REFRESH_CISCO
:
8718 case BGP_CAPABILITY_ROUTE_REFRESH
:
8719 case BGP_CAPABILITY_CP_ORF
:
8721 expert_add_info_format(pinfo
, ti_len
, &ei_bgp_cap_len_bad
, "Capability length %u wrong, must be = 0", clen
);
8722 proto_tree_add_item(cap_tree
, hf_bgp_cap_unknown
, tvb
, offset
, clen
, ENC_NA
);
8726 case BGP_CAPABILITY_ORF_CISCO
:
8727 case BGP_CAPABILITY_COOPERATIVE_ROUTE_FILTERING
:
8729 expert_add_info_format(pinfo
, ti_len
, &ei_bgp_cap_len_bad
, "Capability length %u too short, must be greater than 6", clen
);
8730 proto_tree_add_item(cap_tree
, hf_bgp_cap_unknown
, tvb
, offset
, clen
, ENC_NA
);
8734 uint8_t orfnum
; /* number of ORFs */
8737 proto_tree_add_item(cap_tree
, hf_bgp_cap_orf_afi
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
8741 proto_tree_add_item(cap_tree
, hf_bgp_cap_reserved
, tvb
, offset
, 1, ENC_NA
);
8745 proto_tree_add_item(cap_tree
, hf_bgp_cap_orf_safi
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
8748 /* Number of ORFs */
8749 orfnum
= tvb_get_uint8(tvb
, offset
);
8750 proto_tree_add_item(cap_tree
, hf_bgp_cap_orf_number
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
8752 for (i
=0; i
<orfnum
; i
++) {
8754 proto_tree_add_item(cap_tree
, hf_bgp_cap_orf_type
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
8758 proto_tree_add_item(cap_tree
, hf_bgp_cap_orf_sendreceive
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
8764 case BGP_CAPABILITY_MULTISESSION_CISCO
:
8766 expert_add_info_format(pinfo
, ti_len
, &ei_bgp_cap_len_bad
, "Capability length %u too short, must be greater than 1", clen
);
8767 proto_tree_add_item(cap_tree
, hf_bgp_cap_unknown
, tvb
, offset
, clen
, ENC_NA
);
8771 proto_tree_add_item(cap_tree
, hf_bgp_cap_multisession_flags
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
8776 case BGP_CAPABILITY_BGPSEC
:
8778 expert_add_info_format(pinfo
, ti_len
, &ei_bgp_cap_len_bad
, "Capability length %u is wrong, must be = 3", clen
);
8779 proto_tree_add_item(cap_tree
, hf_bgp_cap_unknown
, tvb
, offset
, clen
, ENC_NA
);
8783 static int * const bgpsec_flags
[] = {
8784 &hf_bgp_cap_bgpsec_version
,
8785 &hf_bgp_cap_bgpsec_sendreceive
,
8786 &hf_bgp_cap_bgpsec_reserved
,
8791 proto_tree_add_bitmask(cap_tree
, tvb
, offset
, hf_bgp_cap_bgpsec_flags
, ett_bgp_cap
, bgpsec_flags
, ENC_BIG_ENDIAN
);
8795 proto_tree_add_item(cap_tree
, hf_bgp_cap_bgpsec_afi
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
8801 case BGP_CAPABILITY_BFD_STRICT
:
8803 expert_add_info_format(pinfo
, ti_len
, &ei_bgp_cap_len_bad
, "Capability length %u wrong, must be = 0", clen
);
8804 proto_tree_add_item(cap_tree
, hf_bgp_cap_unknown
, tvb
, offset
, clen
, ENC_NA
);
8808 case BGP_CAPABILITY_SOFT_VERSION
:{
8809 uint8_t soft_version_len
;
8811 proto_tree_add_item(cap_tree
, hf_bgp_cap_soft_version_len
, tvb
, offset
, 1, ENC_NA
);
8812 soft_version_len
= tvb_get_uint8(tvb
, offset
);
8815 proto_tree_add_item(cap_tree
, hf_bgp_cap_soft_version
, tvb
, offset
, soft_version_len
, ENC_ASCII
);
8816 offset
+= soft_version_len
;
8819 /* unknown capability */
8822 proto_tree_add_item(cap_tree
, hf_bgp_cap_unknown
, tvb
, offset
, clen
, ENC_NA
);
8826 } /* switch (ctype) */
8831 * Dissect a BGP OPEN message.
8835 dissect_bgp_open(tvbuff_t
*tvb
, proto_tree
*tree
, packet_info
*pinfo
)
8837 uint16_t optlen
; /* Option Length */
8838 int ptype
; /* parameter type */
8839 int plen
; /* parameter length */
8840 int cend
; /* capabilities end */
8841 int oend
; /* options end */
8842 int offset
; /* tvb offset counter */
8843 uint32_t as_num
; /* AS Number */
8844 proto_item
*ti
; /* tree item */
8845 proto_tree
*opt_tree
; /* subtree for options */
8846 proto_tree
*par_tree
; /* subtree for par options */
8847 proto_tree
*opt_extension_tree
; /* subtree for par options */
8849 offset
= BGP_MARKER_SIZE
+ 2 + 1;
8851 proto_tree_add_item(tree
, hf_bgp_open_version
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
8854 ti
= proto_tree_add_item_ret_uint(tree
, hf_bgp_open_myas
, tvb
, offset
, 2, ENC_BIG_ENDIAN
, &as_num
);
8855 if (as_num
== BGP_AS_TRANS
) {
8856 proto_item_append_text(ti
, " (AS_TRANS)");
8860 proto_tree_add_item(tree
, hf_bgp_open_holdtime
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
8863 proto_tree_add_item(tree
, hf_bgp_open_identifier
, tvb
, offset
, 4, ENC_NA
);
8866 proto_tree_add_item(tree
, hf_bgp_open_opt_len
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
8867 optlen
= tvb_get_uint8(tvb
, offset
);
8870 /* optional parameters */
8872 ptype
= tvb_get_uint8(tvb
, offset
);
8873 if (ptype
== BGP_OPTION_EXTENDED_LEN
) { /* Extended Length covered by RFC9072 */
8874 optlen
= tvb_get_uint16(tvb
, offset
+1, ENC_BIG_ENDIAN
);
8876 ti
= proto_tree_add_item(tree
, hf_bgp_open_opt_extension
, tvb
, offset
, 3, ENC_NA
);
8877 opt_extension_tree
= proto_item_add_subtree(ti
, ett_bgp_options_ext
);
8878 proto_tree_add_item(opt_extension_tree
, hf_bgp_open_opt_extension_mark
, tvb
, offset
, 1, ENC_NA
);
8879 proto_tree_add_item(opt_extension_tree
, hf_bgp_open_opt_extension_len
, tvb
, offset
+1, 2, ENC_BIG_ENDIAN
);
8881 oend
= offset
+ 3 + optlen
;
8884 oend
= offset
+ optlen
;
8888 ti
= proto_tree_add_item(tree
, hf_bgp_open_opt_params
, tvb
, offset
, optlen
, ENC_NA
);
8889 opt_tree
= proto_item_add_subtree(ti
, ett_bgp_options
);
8891 /* step through all of the optional parameters */
8892 while (offset
< oend
) {
8895 ti
= proto_tree_add_item(opt_tree
, hf_bgp_open_opt_param
, tvb
, offset
, -1, ENC_NA
);
8896 par_tree
= proto_item_add_subtree(ti
, ett_bgp_options
);
8898 /* display and grab the type ... */
8899 proto_tree_add_item(par_tree
, hf_bgp_open_opt_param_type
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
8900 ptype
= tvb_get_uint8(tvb
, offset
);
8901 proto_item_append_text(ti
, ": %s", val_to_str(ptype
, bgp_open_opt_vals
, "Unknown Parameter %d"));
8904 /* ... and length */
8905 proto_tree_add_item(par_tree
, hf_bgp_open_opt_param_len
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
8906 plen
= tvb_get_uint8(tvb
, offset
);
8907 proto_item_set_len(ti
, plen
+2);
8910 /* check the type */
8912 case BGP_OPTION_AUTHENTICATION
:
8913 proto_tree_add_item(par_tree
, hf_bgp_open_opt_param_auth
, tvb
, offset
, plen
, ENC_NA
);
8916 case BGP_OPTION_CAPABILITY
:
8917 /* grab the capability code */
8918 cend
= offset
+ plen
;
8920 /* step through all of the capabilities */
8921 while (offset
< cend
) {
8922 offset
= dissect_bgp_capability_item(tvb
, par_tree
, pinfo
, offset
, false);
8926 proto_tree_add_item(opt_tree
, hf_bgp_open_opt_param_unknown
, tvb
, offset
, plen
, ENC_NA
);
8928 } /* switch (ptype) */
8934 * Heuristic for auto-detection of ASN length 2 or 4 bytes
8938 heuristic_as2_or_4_from_as_path(tvbuff_t
*tvb
, int as_path_offset
, int end_attr_offset
, uint8_t bgpa_type
, int *number_as_segment
)
8940 int counter_as_segment
=0;
8942 uint8_t assumed_as_len
=0;
8947 uint8_t next_type
=0;
8949 /* Heuristic is done in two phases
8950 * First we try to identify the as length (2 or 4 bytes)
8951 * then we do check that our assumption is ok
8952 * recalculating the offset and checking we end up with the right result
8953 * k is used to navigate into the AS_PATH */
8955 /* case of AS_PATH type being explicitly 4 bytes ASN */
8956 if (bgpa_type
== BGPTYPE_AS4_PATH
) {
8957 /* We calculate numbers of segments and return the as length */
8959 while (k
< end_attr_offset
)
8961 /* we skip segment type and point to length */
8963 length
= tvb_get_uint8(tvb
, k
);
8964 /* length read let's move to first ASN */
8966 /* we move to the next segment */
8967 k
= k
+ (length
*assumed_as_len
);
8968 counter_as_segment
++;
8970 *number_as_segment
= counter_as_segment
;
8973 /* case of user specified ASN length */
8974 if (bgp_asn_len
!= 0) {
8975 /* We calculate numbers of segments and return the as length */
8976 assumed_as_len
= bgp_asn_len
;
8977 while (k
< end_attr_offset
)
8979 /* we skip segment type and point to length */
8981 length
= tvb_get_uint8(tvb
, k
);
8982 /* length read let's move to first ASN */
8984 /* we move to the next segment */
8985 k
= k
+ (length
*assumed_as_len
);
8986 /* if I am not facing the last segment k need to point to next length */
8987 counter_as_segment
++;
8989 *number_as_segment
= counter_as_segment
;
8992 /* case of a empty path attribute */
8993 if (as_path_offset
== end_attr_offset
)
8995 *number_as_segment
= 0;
8998 /* case of we run the heuristic to find the as length */
9000 /* we do run the heuristic on first segment and look at next segment if it exists */
9002 length
= tvb_get_uint8(tvb
, k
++);
9003 /* let's do some checking with an as length 2 bytes */
9004 offset_check
= k
+ 2*length
;
9005 next_type
= tvb_get_uint8(tvb
, offset_check
);
9006 /* we do have one segment made of 2 bytes ASN we do reach the end of the attribute taking
9007 * 2 bytes ASN for our calculation */
9008 if (offset_check
== end_attr_offset
)
9010 /* else we do check if we see a valid AS segment type after (length * AS 2 bytes) */
9011 else if (next_type
== AS_SET
||
9012 next_type
== AS_SEQUENCE
||
9013 next_type
== AS_CONFED_SEQUENCE
||
9014 next_type
== AS_CONFED_SET
) {
9015 /* that's a good sign to assume ASN 2 bytes let's check that 2 first bytes of each ASN doesn't eq 0 to confirm */
9016 for (j
=0; j
< length
&& !asn_is_null
; j
++) {
9017 if(tvb_get_ntohs(tvb
, k
+(2*j
)) == 0) {
9021 if (asn_is_null
== 0)
9027 /* we didn't find a valid AS segment type in the next coming segment assuming 2 bytes ASN */
9029 /* now that we have our assumed as length let's check we can calculate the attribute length properly */
9031 while (k
< end_attr_offset
)
9033 /* we skip the AS type */
9035 /* we get the length of the AS segment */
9036 length
= tvb_get_uint8(tvb
, k
);
9037 /* let's point to the fist byte of the AS segment */
9039 /* we move to the next segment */
9040 k
= k
+ (length
*assumed_as_len
);
9041 counter_as_segment
++;
9043 if (k
== end_attr_offset
) {
9045 *number_as_segment
= counter_as_segment
;
9046 return assumed_as_len
;
9048 /* we are in trouble */
9053 * Dissect BGP update extended communities
9057 dissect_bgp_update_ext_com(proto_tree
*parent_tree
, tvbuff_t
*tvb
, uint16_t tlen
, unsigned tvb_off
, packet_info
*pinfo
)
9061 uint8_t com_type_high_byte
;
9062 uint8_t com_stype_low_byte
;
9063 proto_tree
*communities_tree
;
9064 proto_tree
*community_tree
;
9065 proto_tree
*community_type_tree
;
9066 proto_item
*communities_item
=NULL
;
9067 proto_item
*community_item
=NULL
;
9068 proto_item
*community_type_item
=NULL
;
9069 uint32_t encaps_tunnel_type
;
9070 afi_safi_data
*data
= NULL
;
9073 end
= tvb_off
+ tlen
;
9074 communities_item
= proto_tree_add_item(parent_tree
, hf_bgp_ext_communities
, tvb
, offset
, tlen
, ENC_NA
);
9075 communities_tree
= proto_item_add_subtree(communities_item
, ett_bgp_extended_communities
);
9076 proto_item_append_text(communities_item
, ": (%u communit%s)", tlen
/8, plurality(tlen
/8, "y", "ies"));
9077 while (offset
< end
) {
9078 com_type_high_byte
= tvb_get_uint8(tvb
,offset
); /* high community type octet */
9079 com_stype_low_byte
= tvb_get_uint8(tvb
,offset
+1); /* sub type low community type octet */
9080 community_item
= proto_tree_add_item(communities_tree
, hf_bgp_ext_community
, tvb
, offset
, 8, ENC_NA
);
9081 community_tree
= proto_item_add_subtree(community_item
,ett_bgp_extended_community
);
9083 /* Add the Type octet as a decoded item to the community_tree right away,
9084 * and also dissect its two top bits in a subtree.
9087 community_type_item
= proto_tree_add_item(community_tree
, hf_bgp_ext_com_type_high
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
9088 community_type_tree
= proto_item_add_subtree(community_type_item
, ett_bgp_ext_com_type
);
9089 proto_tree_add_item(community_type_tree
, hf_bgp_ext_com_type_auth
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
9090 proto_tree_add_item(community_type_tree
, hf_bgp_ext_com_type_tran
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
9092 /* In the switch(), handlers of individual types and subtypes should
9093 * add and dissect the remaining 7 octets. Dissectors should use the
9094 * proto_item_set_text() on the community_item to set the community
9095 * name in the displayed label as specifically as possible, and
9096 * proto_item_append_text() to add reasonable details.
9098 * The intended text label of the community_item for each extended
9099 * community attribute is:
9101 * Community Name: Values [General Community Type Name]
9104 * Route Target: 1:1 [Transitive 2-Octet AS-Specific]
9105 * Unknown subtype 0x01: 0x8081 0x0000 0x2800 [Non-Transitive Opaque]
9106 * Unknown type 0x88 subtype 0x00: 0x0000 0x0000 0x0000 [Unknown community]
9108 * The [] part with general community name is added at the end
9111 * The first option (Route Target) shows a fully recognized and
9112 * dissected extended community. Note that the line immediately calls
9113 * the community by its most specific known type (Route Target), while
9114 * the general type is shown in the brackets. The second option shows a
9115 * community whose Type is recognized (Non-Transitive Opaque) but whose
9116 * Subtype is not known. The third option shows an unrecognized
9117 * extended community.
9119 * Printing out the community raw value as 3 short ints is intentional:
9120 * With an unknown community, we cannot assume any particular internal
9121 * value format, and dumping the value in short ints provides for easy
9125 switch (com_type_high_byte
) {
9126 case BGP_EXT_COM_TYPE_HIGH_TR_AS2
: /* Transitive Two-Octet AS-Specific Extended Community */
9128 proto_tree_add_item(community_tree
, hf_bgp_ext_com_stype_tr_as2
, tvb
, offset
+1, 1, ENC_BIG_ENDIAN
);
9129 proto_tree_add_item(community_tree
, hf_bgp_ext_com_value_as2
, tvb
, offset
+2, 2, ENC_BIG_ENDIAN
);
9130 data
= load_afi_safi_data(pinfo
);
9132 if(data
&& data
->afi
== AFNUM_L2VPN
&& data
->safi
== SAFNUM_EVPN
) {
9133 static int * const local_admin_flags
[] = {
9134 &hf_bgp_ext_com_local_admin_auto_derived_flag
,
9135 &hf_bgp_ext_com_local_admin_type
,
9136 &hf_bgp_ext_com_local_admin_domain_id
,
9139 proto_tree_add_bitmask(community_tree
, tvb
, offset
+4, hf_bgp_ext_com_local_admin_flags
,
9140 ett_bgp_vxlan
, local_admin_flags
, ENC_BIG_ENDIAN
);
9141 proto_tree_add_item(community_tree
, hf_bgp_ext_com_local_admin_service_id
, tvb
, offset
+5, 3, ENC_BIG_ENDIAN
);
9143 proto_tree_add_item(community_tree
, hf_bgp_ext_com_value_an4
, tvb
, offset
+4, 4, ENC_BIG_ENDIAN
);
9146 proto_item_set_text(community_item
, "%s: %u:%u",
9147 val_to_str(com_stype_low_byte
, bgpext_com_stype_tr_as2
, "Unknown subtype 0x%02x"),
9148 tvb_get_ntohs(tvb
,offset
+2), tvb_get_ntohl(tvb
, offset
+4));
9151 case BGP_EXT_COM_TYPE_HIGH_NTR_AS2
: /* Non-Transitive Two-Octet AS-Specific Extended Community */
9152 proto_tree_add_item(community_tree
, hf_bgp_ext_com_stype_ntr_as2
, tvb
, offset
+1, 1, ENC_BIG_ENDIAN
);
9153 proto_tree_add_item(community_tree
, hf_bgp_ext_com_value_as2
, tvb
, offset
+2, 2, ENC_BIG_ENDIAN
);
9155 proto_item_set_text(community_item
, "%s:",
9156 val_to_str(com_stype_low_byte
, bgpext_com_stype_ntr_as2
, "Unknown subtype 0x%02x"));
9158 switch (com_stype_low_byte
) {
9159 case BGP_EXT_COM_STYPE_AS2_LBW
:
9160 proto_tree_add_item(community_tree
, hf_bgp_ext_com_value_link_bw
, tvb
, offset
+4, 4, ENC_BIG_ENDIAN
);
9162 proto_item_append_text(community_item
, " ASN %u, %.3f Mbps",
9163 tvb_get_ntohs(tvb
,offset
+2),
9164 tvb_get_ntohieee_float(tvb
,offset
+4)*8/1000000);
9168 proto_tree_add_item(community_tree
, hf_bgp_ext_com_value_an4
, tvb
, offset
+4, 4, ENC_BIG_ENDIAN
);
9170 proto_item_append_text(community_item
, " %u:%u",
9171 tvb_get_ntohs(tvb
,offset
+2), tvb_get_ntohl(tvb
,offset
+4));
9176 case BGP_EXT_COM_TYPE_HIGH_TR_IP4
: /* Transitive IPv4-Address-specific Extended Community */
9177 proto_tree_add_item(community_tree
, hf_bgp_ext_com_stype_tr_IP4
, tvb
, offset
+1, 1, ENC_BIG_ENDIAN
);
9179 proto_item_set_text(community_item
, "%s: %s:%u",
9180 val_to_str(com_stype_low_byte
, bgpext_com_stype_tr_IP4
, "Unknown subtype 0x%02x"),
9181 tvb_ip_to_str(pinfo
->pool
, tvb
, offset
+2), tvb_get_ntohs(tvb
,offset
+6));
9183 switch(com_stype_low_byte
) {
9184 case BGP_EXT_COM_STYPE_IP4_OSPF_RID
:
9185 proto_tree_add_item(community_tree
, hf_bgp_ext_com_value_ospf_rid
, tvb
, offset
+2, 4, ENC_BIG_ENDIAN
);
9189 proto_tree_add_item(community_tree
, hf_bgp_ext_com_value_IP4
, tvb
, offset
+2, 4, ENC_BIG_ENDIAN
);
9190 proto_tree_add_item(community_tree
, hf_bgp_ext_com_value_an2
, tvb
, offset
+6, 2, ENC_BIG_ENDIAN
);
9195 case BGP_EXT_COM_TYPE_HIGH_NTR_IP4
: /* Non-Transitive IPv4-Address-specific Extended Community */
9196 proto_tree_add_item(community_tree
, hf_bgp_ext_com_stype_ntr_IP4
, tvb
, offset
+1, 1, ENC_BIG_ENDIAN
);
9197 proto_tree_add_item(community_tree
, hf_bgp_ext_com_value_IP4
, tvb
, offset
+2, 4, ENC_BIG_ENDIAN
);
9198 proto_tree_add_item(community_tree
, hf_bgp_ext_com_value_an2
, tvb
, offset
+6, 2, ENC_BIG_ENDIAN
);
9200 proto_item_set_text(community_item
, "%s: %s:%u",
9201 val_to_str(com_stype_low_byte
, bgpext_com_stype_ntr_IP4
, "Unknown subtype 0x%02x"),
9202 tvb_ip_to_str(pinfo
->pool
, tvb
, offset
+2), tvb_get_ntohs(tvb
,offset
+6));
9205 case BGP_EXT_COM_TYPE_HIGH_TR_AS4
: /* Transitive Four-Octet AS-Specific Extended Community */
9206 proto_tree_add_item(community_tree
, hf_bgp_ext_com_stype_tr_as4
, tvb
, offset
+1, 1, ENC_BIG_ENDIAN
);
9207 proto_tree_add_item(community_tree
, hf_bgp_ext_com_value_as4
, tvb
, offset
+2, 4, ENC_BIG_ENDIAN
);
9208 proto_tree_add_item(community_tree
, hf_bgp_ext_com_value_an2
, tvb
, offset
+6, 2, ENC_BIG_ENDIAN
);
9210 proto_item_set_text(community_item
, "%s: %u.%u(%u):%u",
9211 val_to_str(com_stype_low_byte
, bgpext_com_stype_tr_as4
, "Unknown subtype 0x%02x"),
9212 tvb_get_ntohs(tvb
,offset
+2), tvb_get_ntohs(tvb
,offset
+4), tvb_get_ntohl(tvb
,offset
+2),
9213 tvb_get_ntohs(tvb
,offset
+6));
9216 case BGP_EXT_COM_TYPE_HIGH_NTR_AS4
: /* Non-Transitive Four-Octet AS-Specific Extended Community */
9217 proto_tree_add_item(community_tree
, hf_bgp_ext_com_stype_ntr_as4
, tvb
, offset
+1, 1, ENC_BIG_ENDIAN
);
9218 proto_tree_add_item(community_tree
, hf_bgp_ext_com_value_as4
, tvb
, offset
+2, 4, ENC_BIG_ENDIAN
);
9219 proto_tree_add_item(community_tree
, hf_bgp_ext_com_value_an2
, tvb
, offset
+6, 2, ENC_BIG_ENDIAN
);
9221 proto_item_set_text(community_item
, "%s: %u.%u(%u):%u",
9222 val_to_str(com_stype_low_byte
, bgpext_com_stype_ntr_as4
, "Unknown subtype 0x%02x"),
9223 tvb_get_ntohs(tvb
,offset
+2), tvb_get_ntohs(tvb
,offset
+4), tvb_get_ntohl(tvb
,offset
+2),
9224 tvb_get_ntohs(tvb
,offset
+6));
9227 case BGP_EXT_COM_TYPE_HIGH_TR_OPAQUE
: /* Transitive Opaque Extended Community */
9228 proto_tree_add_item(community_tree
, hf_bgp_ext_com_stype_tr_opaque
, tvb
, offset
+1, 1, ENC_BIG_ENDIAN
);
9230 proto_item_set_text(community_item
, "%s:",
9231 val_to_str(com_stype_low_byte
, bgpext_com_stype_tr_opaque
, "Unknown subtype 0x%02x"));
9233 switch(com_stype_low_byte
) {
9234 case BGP_EXT_COM_STYPE_OPA_COST
:
9236 proto_item
*cost_com_item
;
9237 proto_tree
*cost_com_cid_tree
;
9239 proto_tree_add_item(community_tree
, hf_bgp_ext_com_cost_poi
, tvb
, offset
+2, 1, ENC_BIG_ENDIAN
);
9240 cost_com_item
= proto_tree_add_item(community_tree
, hf_bgp_ext_com_cost_cid
, tvb
, offset
+3, 1, ENC_BIG_ENDIAN
);
9241 cost_com_cid_tree
= proto_item_add_subtree(cost_com_item
, ett_bgp_ext_com_cost_cid
);
9242 proto_tree_add_item(cost_com_cid_tree
, hf_bgp_ext_com_cost_cid_rep
, tvb
, offset
+3, 1, ENC_BIG_ENDIAN
);
9243 cost_com_item
= proto_tree_add_item(community_tree
, hf_bgp_ext_com_cost_cost
, tvb
,
9244 offset
+4, 4, ENC_BIG_ENDIAN
);
9245 proto_item_append_text(cost_com_item
, " (%s)",
9246 tfs_get_string(tvb_get_uint8(tvb
, offset
+3) & BGP_EXT_COM_COST_CID_REP
, &tfs_cost_replace
));
9248 proto_item_append_text(community_item
, " %u, POI: %s (%s)",
9249 tvb_get_ntohl(tvb
, offset
+4),
9250 val_to_str(tvb_get_uint8(tvb
, offset
+2), bgpext_com_cost_poi_type
, "Unknown subtype 0x%02x"),
9251 (tvb_get_uint8(tvb
, offset
+3) & BGP_EXT_COM_COST_CID_REP
) ? "Replaces attribute value" : "Evaluated after");
9255 case BGP_EXT_COM_STYPE_OPA_OSPF_RT
:
9257 proto_item
*ospf_rt_opt_item
;
9258 proto_tree
*ospf_rt_opt_tree
;
9260 proto_tree_add_item(community_tree
, hf_bgp_ext_com_value_ospf_rt_area
, tvb
, offset
+2, 4, ENC_BIG_ENDIAN
);
9261 proto_tree_add_item(community_tree
, hf_bgp_ext_com_value_ospf_rt_type
, tvb
, offset
+6, 1, ENC_BIG_ENDIAN
);
9262 ospf_rt_opt_item
= proto_tree_add_item(community_tree
,
9263 hf_bgp_ext_com_value_ospf_rt_options
, tvb
, offset
+7, 1, ENC_BIG_ENDIAN
);
9264 ospf_rt_opt_tree
= proto_item_add_subtree(ospf_rt_opt_item
, ett_bgp_ext_com_ospf_rt_opt
);
9265 proto_tree_add_item(ospf_rt_opt_tree
, hf_bgp_ext_com_value_ospf_rt_options_mt
,
9266 tvb
, offset
+7, 1, ENC_BIG_ENDIAN
);
9267 proto_item_append_text(ospf_rt_opt_item
, " (Metric: %s)",
9268 tfs_get_string(tvb_get_uint8(tvb
,offset
+7) & BGP_OSPF_RTYPE_METRIC_TYPE
, &tfs_ospf_rt_mt
));
9270 proto_item_append_text(community_item
, " Area: %s, Type: %s",
9271 tvb_ip_to_str(pinfo
->pool
, tvb
,offset
+2),
9272 val_to_str_const(tvb_get_uint8(tvb
,offset
+6), bgpext_com_ospf_rtype
, "Unknown"));
9276 case BGP_EXT_COM_STYPE_OPA_ENCAP
:
9277 /* Community octets 2 through 5 are reserved and carry no useful value according to RFC 5512. */
9278 proto_tree_add_item_ret_uint(community_tree
, hf_bgp_ext_com_tunnel_type
, tvb
, offset
+6, 2, ENC_BIG_ENDIAN
, &encaps_tunnel_type
);
9279 save_path_attr_encaps_tunnel_type(pinfo
, encaps_tunnel_type
);
9281 proto_item_append_text(community_item
, " %s",
9282 val_to_str_const(tvb_get_ntohs(tvb
,offset
+6), bgpext_com_tunnel_type
, "Unknown"));
9285 case BGP_EXT_COM_STYPE_OPA_COLOR
:
9286 case BGP_EXT_COM_STYPE_OPA_DGTW
:
9288 /* The particular Opaque subtype is unknown or the
9289 * dissector is not written yet. We will dump the
9290 * entire community value in 2-byte short words.
9292 proto_tree_add_uint64_format_value(community_tree
, hf_bgp_ext_com_value_raw
, tvb
, offset
+2, 6,
9293 tvb_get_ntoh48 (tvb
, offset
+2), "0x%04x 0x%04x 0x%04x",
9294 tvb_get_ntohs(tvb
,offset
+2),
9295 tvb_get_ntohs(tvb
,offset
+4),
9296 tvb_get_ntohs(tvb
,offset
+6));
9298 proto_item_append_text(community_item
, " 0x%04x 0x%04x 0x%04x",
9299 tvb_get_ntohs(tvb
,offset
+2), tvb_get_ntohs(tvb
,offset
+4), tvb_get_ntohs(tvb
,offset
+6));
9304 case BGP_EXT_COM_TYPE_HIGH_NTR_OPAQUE
: /* Non-Transitive Opaque Extended Community */
9305 proto_tree_add_item(community_tree
, hf_bgp_ext_com_stype_ntr_opaque
, tvb
, offset
+1, 1, ENC_BIG_ENDIAN
);
9307 proto_item_set_text(community_item
, "%s:",
9308 val_to_str(com_stype_low_byte
, bgpext_com_stype_ntr_opaque
, "Unknown subtype 0x%02x"));
9310 switch(com_stype_low_byte
) {
9311 case BGP_EXT_COM_STYPE_OPA_COST
:
9313 proto_item
*cost_com_item
;
9314 proto_tree
*cost_com_cid_tree
;
9316 proto_tree_add_item(community_tree
, hf_bgp_ext_com_cost_poi
, tvb
, offset
+2, 1, ENC_BIG_ENDIAN
);
9317 cost_com_item
= proto_tree_add_item(community_tree
, hf_bgp_ext_com_cost_cid
, tvb
, offset
+3, 1, ENC_BIG_ENDIAN
);
9318 cost_com_cid_tree
= proto_item_add_subtree(cost_com_item
, ett_bgp_ext_com_cost_cid
);
9319 proto_tree_add_item(cost_com_cid_tree
, hf_bgp_ext_com_cost_cid_rep
, tvb
, offset
+3, 1, ENC_BIG_ENDIAN
);
9320 cost_com_item
= proto_tree_add_item(community_tree
, hf_bgp_ext_com_cost_cost
, tvb
,
9321 offset
+4, 4, ENC_BIG_ENDIAN
);
9322 proto_item_append_text(cost_com_item
, " (%s)",
9323 tfs_get_string(tvb_get_uint8(tvb
, offset
+3) & BGP_EXT_COM_COST_CID_REP
, &tfs_cost_replace
));
9325 proto_item_append_text(community_item
, " %u, POI: %s (%s)",
9326 tvb_get_ntohl(tvb
, offset
+4),
9327 val_to_str(tvb_get_uint8(tvb
, offset
+2), bgpext_com_cost_poi_type
, "Unknown subtype 0x%02x"),
9328 (tvb_get_uint8(tvb
, offset
+3) & BGP_EXT_COM_COST_CID_REP
) ? "Replaces attribute value" : "Evaluated after");
9333 /* The particular Opaque subtype is unknown or the
9334 * dissector is not written yet. We will dump the
9335 * entire community value in 2-byte short words.
9337 proto_tree_add_uint64_format_value(community_tree
, hf_bgp_ext_com_value_raw
, tvb
, offset
+2, 6,
9338 tvb_get_ntoh48 (tvb
, offset
+2), "0x%04x 0x%04x 0x%04x",
9339 tvb_get_ntohs(tvb
,offset
+2),
9340 tvb_get_ntohs(tvb
,offset
+4),
9341 tvb_get_ntohs(tvb
,offset
+6));
9343 proto_item_append_text(community_item
, " 0x%04x 0x%04x 0x%04x",
9344 tvb_get_ntohs(tvb
,offset
+2), tvb_get_ntohs(tvb
,offset
+4), tvb_get_ntohs(tvb
,offset
+6));
9349 case BGP_EXT_COM_TYPE_HIGH_TR_QOS
: /* QoS Marking [Thomas_Martin_Knoll] */
9350 case BGP_EXT_COM_TYPE_HIGH_NTR_QOS
: /* QoS Marking [Thomas_Martin_Knoll] */
9352 static int * const qos_flags
[] = {
9353 &hf_bgp_ext_com_qos_flags_remarking
,
9354 &hf_bgp_ext_com_qos_flags_ignore_remarking
,
9355 &hf_bgp_ext_com_qos_flags_agg_marking
,
9359 proto_item_set_text(community_item
, "QoS Marking");
9361 proto_tree_add_bitmask(community_tree
, tvb
, offset
, hf_bgp_ext_com_qos_flags
,
9362 ett_bgp_ext_com_flags
, qos_flags
, ENC_BIG_ENDIAN
);
9364 proto_tree_add_item(community_tree
, hf_bgp_ext_com_qos_set_number
, tvb
, offset
+2, 1, ENC_BIG_ENDIAN
);
9365 proto_tree_add_item(community_tree
, hf_bgp_ext_com_qos_tech_type
, tvb
, offset
+3, 1, ENC_BIG_ENDIAN
);
9366 proto_tree_add_item(community_tree
, hf_bgp_ext_com_qos_marking_o
, tvb
, offset
+4, 2, ENC_BIG_ENDIAN
);
9367 proto_tree_add_item(community_tree
, hf_bgp_ext_com_qos_marking_a
, tvb
, offset
+6, 1, ENC_BIG_ENDIAN
);
9368 proto_tree_add_item(community_tree
, hf_bgp_ext_com_qos_default_to_zero
, tvb
, offset
+7, 1, ENC_BIG_ENDIAN
);
9372 case BGP_EXT_COM_TYPE_HIGH_TR_COS
: /* CoS Capability [Thomas_Martin_Knoll] */
9376 proto_item_set_text(community_item
, "CoS Capability");
9378 for (i
=1; i
< 8; i
++) {
9379 static int * const cos_flags
[] = {
9380 &hf_bgp_ext_com_cos_flags_be
,
9381 &hf_bgp_ext_com_cos_flags_ef
,
9382 &hf_bgp_ext_com_cos_flags_af
,
9383 &hf_bgp_ext_com_cos_flags_le
,
9387 proto_tree_add_bitmask(community_tree
, tvb
, offset
+i
, hf_bgp_ext_com_cos_flags
,
9388 ett_bgp_ext_com_flags
, cos_flags
, ENC_BIG_ENDIAN
);
9393 case BGP_EXT_COM_TYPE_HIGH_TR_EVPN
: /* EVPN (Sub-Types are defined in the "EVPN Extended Community Sub-Types" registry) */
9394 proto_tree_add_item(community_tree
, hf_bgp_ext_com_stype_tr_evpn
, tvb
, offset
+1, 1, ENC_BIG_ENDIAN
);
9396 proto_item_set_text(community_item
, "%s:",
9397 val_to_str(com_stype_low_byte
, bgpext_com_stype_tr_evpn
, "Unknown subtype 0x%02x"));
9399 switch (com_stype_low_byte
) {
9400 case BGP_EXT_COM_STYPE_EVPN_MMAC
:
9402 proto_tree
*evpn_mmac_flag_tree
;
9403 proto_item
*evpn_mmac_flag_item
;
9405 evpn_mmac_flag_item
= proto_tree_add_item(community_tree
, hf_bgp_ext_com_evpn_mmac_flag
, tvb
, offset
+2, 1, ENC_BIG_ENDIAN
);
9406 evpn_mmac_flag_tree
= proto_item_add_subtree(evpn_mmac_flag_item
, ett_bgp_ext_com_evpn_mmac_flags
);
9407 proto_tree_add_item (evpn_mmac_flag_tree
, hf_bgp_ext_com_evpn_mmac_flag_sticky
, tvb
, offset
+2, 1, ENC_BIG_ENDIAN
);
9408 /* Octet at offset 3 is reserved per RFC 7432 Section 7.7 */
9409 proto_tree_add_item(community_tree
, hf_bgp_ext_com_evpn_mmac_seq
, tvb
, offset
+4, 4, ENC_BIG_ENDIAN
);
9411 proto_item_append_text(community_item
, " %s MAC",
9412 (tvb_get_uint8(tvb
,offset
+2) & BGP_EXT_COM_EVPN_MMAC_STICKY
) ? "Sticky" : "Movable");
9416 case BGP_EXT_COM_STYPE_EVPN_LABEL
:
9420 proto_tree_add_item(community_tree
, hf_bgp_ext_com_l2_esi_label_flag
, tvb
, offset
+2, 1, ENC_BIG_ENDIAN
);
9421 /* Octets at offsets 3 and 4 are reserved perf RFC 7432 Section 7.5 */
9422 proto_tree_add_item(community_tree
, hf_bgp_update_mpls_label_value
, tvb
, offset
+5, 3, ENC_BIG_ENDIAN
);
9423 ti
= proto_tree_add_item(community_tree
, hf_bgp_update_mpls_label_value_20bits
, tvb
, offset
+5, 3, ENC_BIG_ENDIAN
);
9424 proto_item_set_generated(ti
);
9425 ti
= proto_tree_add_item(community_tree
, hf_bgp_update_mpls_traffic_class
, tvb
, offset
+5, 3, ENC_BIG_ENDIAN
);
9426 proto_item_set_generated(ti
);
9427 ti
= proto_tree_add_item(community_tree
, hf_bgp_update_mpls_bottom_stack
, tvb
, offset
+5, 3, ENC_BIG_ENDIAN
);
9428 proto_item_set_generated(ti
);
9430 proto_item_append_text(community_item
, " %s, Label: %u",
9431 tfs_get_string(tvb_get_uint8(tvb
, offset
+2) & BGP_EXT_COM_ESI_LABEL_FLAGS
, &tfs_esi_label_flag
),
9432 tvb_get_ntoh24(tvb
,offset
+5) >> 4);
9436 case BGP_EXT_COM_STYPE_EVPN_IMP
:
9437 proto_tree_add_item(community_tree
, hf_bgp_ext_com_evpn_esirt
, tvb
, offset
+2, 6, ENC_NA
);
9439 proto_item_append_text(community_item
, " RT: %s", tvb_ether_to_str(pinfo
->pool
, tvb
, offset
+2));
9442 case BGP_EXT_COM_STYPE_EVPN_ROUTERMAC
:
9443 proto_tree_add_item(community_tree
, hf_bgp_ext_com_evpn_routermac
, tvb
, offset
+2, 6, ENC_NA
);
9445 proto_item_append_text(community_item
, " Router's MAC: %s", tvb_ether_to_str(pinfo
->pool
, tvb
, offset
+2));
9448 case BGP_EXT_COM_STYPE_EVPN_L2ATTR
:
9450 static int * const l2attr_flags
[] = {
9451 &hf_bgp_ext_com_evpn_l2attr_flag_reserved
,
9452 &hf_bgp_ext_com_evpn_l2attr_flag_ci
,
9453 &hf_bgp_ext_com_evpn_l2attr_flag_f
,
9454 &hf_bgp_ext_com_evpn_l2attr_flag_c
,
9455 &hf_bgp_ext_com_evpn_l2attr_flag_p
,
9456 &hf_bgp_ext_com_evpn_l2attr_flag_b
,
9460 proto_tree_add_bitmask(community_tree
, tvb
, offset
+2, hf_bgp_ext_com_evpn_l2attr_flags
,
9461 ett_bgp_ext_com_evpn_l2attr_flags
, l2attr_flags
, ENC_BIG_ENDIAN
);
9462 proto_tree_add_item(community_tree
, hf_bgp_ext_com_evpn_l2attr_l2_mtu
, tvb
, offset
+4, 2, ENC_BIG_ENDIAN
);
9463 proto_tree_add_item(community_tree
, hf_bgp_ext_com_evpn_l2attr_reserved
, tvb
, offset
+6, 2, ENC_NA
);
9465 proto_item_append_text(community_item
, " flags: 0x%04x, L2 MTU: %u", tvb_get_ntohs(tvb
, offset
+2), tvb_get_ntohs(tvb
, offset
+4));
9469 case BGP_EXT_COM_STYPE_EVPN_ETREE
:
9471 static int * const etree_flags
[] = {
9472 &hf_bgp_ext_com_evpn_etree_flag_reserved
,
9473 &hf_bgp_ext_com_evpn_etree_flag_l
,
9477 proto_tree_add_bitmask(community_tree
, tvb
, offset
+2, hf_bgp_ext_com_evpn_etree_flags
,
9478 ett_bgp_ext_com_evpn_etree_flags
, etree_flags
, ENC_BIG_ENDIAN
);
9479 proto_tree_add_item(community_tree
, hf_bgp_ext_com_evpn_etree_reserved
, tvb
, offset
+3, 2, ENC_NA
);
9481 proto_tree_add_item(community_tree
, hf_bgp_update_mpls_label_value_20bits
, tvb
, offset
+5, 3, ENC_BIG_ENDIAN
);
9482 proto_tree_add_item(community_tree
, hf_bgp_update_mpls_traffic_class
, tvb
, offset
+5, 3, ENC_BIG_ENDIAN
);
9483 proto_tree_add_item(community_tree
, hf_bgp_update_mpls_bottom_stack
, tvb
, offset
+5, 3, ENC_BIG_ENDIAN
);
9488 /* The particular EVPN subtype is unknown or the
9489 * dissector is not written yet. We will dump the
9490 * entire community value in 2-byte short words.
9492 proto_tree_add_uint64_format_value(community_tree
, hf_bgp_ext_com_value_raw
, tvb
, offset
+2, 6,
9493 tvb_get_ntoh48 (tvb
, offset
+2), "0x%04x 0x%04x 0x%04x",
9494 tvb_get_ntohs(tvb
,offset
+2),
9495 tvb_get_ntohs(tvb
,offset
+4),
9496 tvb_get_ntohs(tvb
,offset
+6));
9498 proto_item_append_text(community_item
, " 0x%04x 0x%04x 0x%04x",
9499 tvb_get_ntohs(tvb
,offset
+2), tvb_get_ntohs(tvb
,offset
+4), tvb_get_ntohs(tvb
,offset
+6));
9504 case BGP_EXT_COM_TYPE_HIGH_TR_MUP
:
9505 proto_tree_add_item(community_tree
, hf_bgp_ext_com_stype_tr_mup
, tvb
, offset
+1, 1, ENC_BIG_ENDIAN
);
9507 proto_item_set_text(community_item
, "%s:",
9508 val_to_str(com_stype_low_byte
, bgpext_com_stype_tr_mup
, "Unknown subtype 0x%02x"));
9509 switch (com_stype_low_byte
) {
9510 case BGP_EXT_COM_STYPE_MUP_DIRECT_SEG
:
9511 /* format of this community is open, then display it in 2-byte:4-byte decimal format like route target */
9512 proto_tree_add_item(community_tree
, hf_bgp_ext_com_mup_segment_id2
, tvb
, offset
+2, 2, ENC_BIG_ENDIAN
);
9513 proto_tree_add_item(community_tree
, hf_bgp_ext_com_mup_segment_id4
, tvb
, offset
+4, 4, ENC_BIG_ENDIAN
);
9514 proto_item_append_text(community_item
, " %u:%u", tvb_get_ntohs(tvb
,offset
+2), tvb_get_ntohl(tvb
, offset
+4));
9517 proto_tree_add_uint64_format_value(community_tree
, hf_bgp_ext_com_value_raw
, tvb
, offset
+2, 6,
9518 tvb_get_ntoh48 (tvb
, offset
+2), "0x%04x 0x%04x 0x%04x",
9519 tvb_get_ntohs(tvb
,offset
+2),
9520 tvb_get_ntohs(tvb
,offset
+4),
9521 tvb_get_ntohs(tvb
,offset
+6));
9523 proto_item_append_text(community_item
, " 0x%04x 0x%04x 0x%04x",
9524 tvb_get_ntohs(tvb
,offset
+2), tvb_get_ntohs(tvb
,offset
+4), tvb_get_ntohs(tvb
,offset
+6));
9528 case BGP_EXT_COM_TYPE_HIGH_TR_EXT
: /* Generic Transitive Extended Community */
9529 proto_tree_add_item(community_tree
, hf_bgp_ext_com_stype_tr_exp
, tvb
, offset
+1, 1, ENC_BIG_ENDIAN
);
9531 proto_item_set_text(community_item
, "%s:",
9532 val_to_str(com_stype_low_byte
, bgpext_com_stype_tr_exp
, "Unknown subtype 0x%02x"));
9534 switch (com_stype_low_byte
) {
9535 case BGP_EXT_COM_STYPE_EXP_OSPF_RT
:
9537 proto_item
*ospf_rt_opt_item
;
9538 proto_tree
*ospf_rt_opt_tree
;
9540 proto_tree_add_item(community_tree
, hf_bgp_ext_com_value_ospf_rt_area
, tvb
, offset
+2, 4, ENC_BIG_ENDIAN
);
9541 proto_tree_add_item(community_tree
, hf_bgp_ext_com_value_ospf_rt_type
, tvb
, offset
+6, 1, ENC_BIG_ENDIAN
);
9542 ospf_rt_opt_item
= proto_tree_add_item(community_tree
,
9543 hf_bgp_ext_com_value_ospf_rt_options
, tvb
, offset
+7, 1, ENC_BIG_ENDIAN
);
9544 ospf_rt_opt_tree
= proto_item_add_subtree(ospf_rt_opt_item
, ett_bgp_ext_com_ospf_rt_opt
);
9545 proto_tree_add_item(ospf_rt_opt_tree
, hf_bgp_ext_com_value_ospf_rt_options_mt
,
9546 tvb
, offset
+7, 1, ENC_BIG_ENDIAN
);
9547 proto_item_append_text(ospf_rt_opt_item
, " (Metric: %s)",
9548 tfs_get_string(tvb_get_uint8(tvb
,offset
+7) & BGP_OSPF_RTYPE_METRIC_TYPE
, &tfs_ospf_rt_mt
));
9550 proto_item_append_text(community_item
, " Area: %s, Type: %s",
9551 tvb_ip_to_str(pinfo
->pool
, tvb
,offset
+2),
9552 val_to_str_const(tvb_get_uint8(tvb
,offset
+6), bgpext_com_ospf_rtype
, "Unknown"));
9556 case BGP_EXT_COM_STYPE_EXP_OSPF_RID
:
9557 proto_tree_add_item(community_tree
, hf_bgp_ext_com_value_ospf_rid
, tvb
, offset
+2, 4, ENC_BIG_ENDIAN
);
9559 proto_item_append_text(community_item
, " %s", tvb_ip_to_str(pinfo
->pool
, tvb
, offset
+2));
9562 case BGP_EXT_COM_STYPE_EXP_OSPF_DID
:
9563 proto_tree_add_item(community_tree
, hf_bgp_ext_com_stype_tr_as2
, tvb
, offset
+1, 1, ENC_BIG_ENDIAN
);
9564 proto_tree_add_item(community_tree
, hf_bgp_ext_com_value_as2
, tvb
, offset
+2, 2, ENC_BIG_ENDIAN
);
9565 proto_tree_add_item(community_tree
, hf_bgp_ext_com_value_an4
, tvb
, offset
+4, 4, ENC_BIG_ENDIAN
);
9567 proto_item_set_text(community_item
, "%s: %u:%u",
9568 val_to_str(com_stype_low_byte
, bgpext_com_stype_tr_exp
, "Unknown subtype 0x%02x"),
9569 tvb_get_ntohs(tvb
,offset
+2), tvb_get_ntohl(tvb
, offset
+4));
9572 case BGP_EXT_COM_STYPE_EXP_F_TR
: /* Flow spec traffic-rate [RFC5575] */
9573 proto_tree_add_item(community_tree
, hf_bgp_ext_com_value_as2
,
9574 tvb
, offset
+2, 2, ENC_BIG_ENDIAN
);
9575 /* remaining 4 bytes gives traffic rate in IEEE floating point */
9576 proto_tree_add_item(community_tree
, hf_bgp_ext_com_flow_rate_float
, tvb
, offset
+4, 4, ENC_BIG_ENDIAN
);
9578 proto_item_append_text(community_item
, " ASN %u, %.3f Mbps",
9579 tvb_get_ntohs(tvb
,offset
+2),
9580 tvb_get_ntohieee_float(tvb
,offset
+4)*8/1000000);
9583 case BGP_EXT_COM_STYPE_EXP_F_TA
: /* Flow spec traffic-action [RFC5575] */
9584 proto_tree_add_item(community_tree
, hf_bgp_ext_com_flow_act_allset
, tvb
, offset
+2, 5, ENC_NA
);
9585 proto_tree_add_item(community_tree
, hf_bgp_ext_com_flow_act_samp_act
, tvb
, offset
+7, 1, ENC_BIG_ENDIAN
);
9586 proto_tree_add_item(community_tree
, hf_bgp_ext_com_flow_act_term_act
, tvb
, offset
+7, 1, ENC_BIG_ENDIAN
);
9588 proto_item_append_text(community_item
, " Sample: %s, Terminal: %s",
9589 tfs_get_string(tvb_get_uint8(tvb
,offset
+7) & BGP_EXT_COM_FSPEC_ACT_S
, &tfs_yes_no
),
9590 tfs_get_string(tvb_get_uint8(tvb
,offset
+7) & BGP_EXT_COM_FSPEC_ACT_T
, &tfs_yes_no
));
9593 case BGP_EXT_COM_STYPE_EXP_F_RED
: /* Flow spec redirect [RFC5575] */
9594 proto_tree_add_item(community_tree
, hf_bgp_ext_com_value_as2
, tvb
, offset
+2, 2, ENC_BIG_ENDIAN
);
9595 proto_tree_add_item(community_tree
, hf_bgp_ext_com_value_an4
, tvb
, offset
+4, 4, ENC_BIG_ENDIAN
);
9597 proto_item_append_text(community_item
, " RT %u:%u",
9598 tvb_get_ntohs(tvb
,offset
+2), tvb_get_ntohl(tvb
,offset
+4));
9601 case BGP_EXT_COM_STYPE_EXP_F_RMARK
: /* Flow spec traffic-remarking [RFC5575] */
9602 proto_tree_add_item(community_tree
, hf_bgp_ext_com_value_fs_remark
, tvb
, offset
+7, 1, ENC_BIG_ENDIAN
);
9604 proto_item_append_text(community_item
, " %s",
9605 val_to_str_ext_const(tvb_get_uint8(tvb
,offset
+7), &dscp_vals_ext
, "Unknown DSCP"));
9608 case BGP_EXT_COM_STYPE_EXP_L2
:
9610 static int * const com_l2_flags
[] = {
9611 &hf_bgp_ext_com_l2_flag_d
,
9612 &hf_bgp_ext_com_l2_flag_z1
,
9613 &hf_bgp_ext_com_l2_flag_f
,
9614 &hf_bgp_ext_com_l2_flag_z345
,
9615 &hf_bgp_ext_com_l2_flag_c
,
9616 &hf_bgp_ext_com_l2_flag_s
,
9620 proto_tree_add_item(community_tree
, hf_bgp_ext_com_l2_encaps
,tvb
,offset
+2, 1, ENC_BIG_ENDIAN
);
9622 proto_tree_add_bitmask(community_tree
, tvb
, offset
+3, hf_bgp_ext_com_l2_c_flags
, ett_bgp_ext_com_l2_flags
, com_l2_flags
, ENC_BIG_ENDIAN
);
9623 proto_tree_add_item(community_tree
, hf_bgp_ext_com_l2_mtu
, tvb
, offset
+4, 2, ENC_BIG_ENDIAN
);
9627 case BGP_EXT_COM_STYPE_EXP_ETREE
:
9629 static int * const com_etree_flags
[] = {
9630 &hf_bgp_ext_com_etree_flag_reserved
,
9631 &hf_bgp_ext_com_etree_flag_p
,
9632 &hf_bgp_ext_com_etree_flag_v
,
9636 proto_tree_add_item(community_tree
, hf_bgp_ext_com_etree_root_vlan
,tvb
,offset
+2, 2, ENC_BIG_ENDIAN
);
9637 proto_tree_add_item(community_tree
, hf_bgp_ext_com_etree_leaf_vlan
,tvb
,offset
+4, 2, ENC_BIG_ENDIAN
);
9638 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
);
9643 /* The particular Experimental subtype is unknown or
9644 * the dissector is not written yet. We will dump the
9645 * entire community value in 2-byte short words.
9647 proto_tree_add_uint64_format_value(community_tree
, hf_bgp_ext_com_value_raw
, tvb
, offset
+2, 6,
9648 tvb_get_ntoh48 (tvb
, offset
+2), "0x%04x 0x%04x 0x%04x",
9649 tvb_get_ntohs(tvb
,offset
+2),
9650 tvb_get_ntohs(tvb
,offset
+4),
9651 tvb_get_ntohs(tvb
,offset
+6));
9653 proto_item_append_text(community_item
, " 0x%04x 0x%04x 0x%04x",
9654 tvb_get_ntohs(tvb
,offset
+2), tvb_get_ntohs(tvb
,offset
+4), tvb_get_ntohs(tvb
,offset
+6));
9659 case BGP_EXT_COM_TYPE_HIGH_TR_EXT_2
:
9660 proto_tree_add_item(community_tree
, hf_bgp_ext_com_stype_tr_exp_2
, tvb
, offset
+1, 1, ENC_BIG_ENDIAN
);
9662 proto_item_set_text(community_item
, "%s:",
9663 val_to_str(com_stype_low_byte
, bgpext_com_stype_tr_exp_2
, "Unknown subtype 0x%02x"));
9665 switch (com_stype_low_byte
) {
9666 case BGP_EXT_COM_STYPE_EXP_2_FLOW_RED
:
9668 proto_tree_add_item(community_tree
, hf_bgp_ext_com_value_IP4
, tvb
, offset
+2, 4, ENC_NA
);
9669 proto_tree_add_item(community_tree
, hf_bgp_ext_com_value_an2
, tvb
, offset
+6, 2, ENC_BIG_ENDIAN
);
9674 /* The particular Experimental subtype is unknown or
9675 * the dissector is not written yet. We will dump the
9676 * entire community value in 2-byte short words.
9678 proto_tree_add_uint64_format_value(community_tree
, hf_bgp_ext_com_value_raw
, tvb
, offset
+2, 6,
9679 tvb_get_ntoh48 (tvb
, offset
+2), "0x%04x 0x%04x 0x%04x",
9680 tvb_get_ntohs(tvb
,offset
+2),
9681 tvb_get_ntohs(tvb
,offset
+4),
9682 tvb_get_ntohs(tvb
,offset
+6));
9684 proto_item_append_text(community_item
, " 0x%04x 0x%04x 0x%04x",
9685 tvb_get_ntohs(tvb
,offset
+2), tvb_get_ntohs(tvb
,offset
+4), tvb_get_ntohs(tvb
,offset
+6));
9690 case BGP_EXT_COM_TYPE_HIGH_TR_EXT_3
:
9691 proto_tree_add_item(community_tree
, hf_bgp_ext_com_stype_tr_exp_3
, tvb
, offset
+1, 1, ENC_BIG_ENDIAN
);
9693 proto_item_set_text(community_item
, "%s:",
9694 val_to_str(com_stype_low_byte
, bgpext_com_stype_tr_exp_3
, "Unknown subtype 0x%02x"));
9696 switch (com_stype_low_byte
) {
9697 case BGP_EXT_COM_STYPE_EXP_3_FLOW_RED
:
9699 proto_tree_add_item(community_tree
, hf_bgp_ext_com_value_as4
, tvb
, offset
+2, 4, ENC_BIG_ENDIAN
);
9700 proto_tree_add_item(community_tree
, hf_bgp_ext_com_value_an2
, tvb
, offset
+6, 2, ENC_BIG_ENDIAN
);
9705 /* The particular Experimental subtype is unknown or
9706 * the dissector is not written yet. We will dump the
9707 * entire community value in 2-byte short words.
9709 proto_tree_add_uint64_format_value(community_tree
, hf_bgp_ext_com_value_raw
, tvb
, offset
+2, 6,
9710 tvb_get_ntoh48 (tvb
, offset
+2), "0x%04x 0x%04x 0x%04x",
9711 tvb_get_ntohs(tvb
,offset
+2),
9712 tvb_get_ntohs(tvb
,offset
+4),
9713 tvb_get_ntohs(tvb
,offset
+6));
9715 proto_item_append_text(community_item
, " 0x%04x 0x%04x 0x%04x",
9716 tvb_get_ntohs(tvb
,offset
+2), tvb_get_ntohs(tvb
,offset
+4), tvb_get_ntohs(tvb
,offset
+6));
9721 case BGP_EXT_COM_TYPE_HIGH_TR_EXP_EIGRP
:
9722 proto_tree_add_item(community_tree
, hf_bgp_ext_com_stype_tr_exp_eigrp
, tvb
, offset
+1, 1, ENC_BIG_ENDIAN
);
9724 proto_item_set_text(community_item
, "%s:",
9725 val_to_str(com_stype_low_byte
, bgpext_com_stype_tr_eigrp
, "Unknown subtype 0x%02x"));
9727 switch(com_stype_low_byte
) {
9728 case BGP_EXT_COM_STYPE_EXP_EIGRP_FT
:
9730 proto_item
*eigrp_flags_item
;
9731 proto_tree
*eigrp_flags_tree
;
9733 eigrp_flags_item
= proto_tree_add_item(community_tree
, hf_bgp_ext_com_eigrp_flags
, tvb
, offset
+2, 2, ENC_BIG_ENDIAN
);
9734 eigrp_flags_tree
= proto_item_add_subtree(eigrp_flags_item
, ett_bgp_ext_com_eigrp_flags
);
9736 proto_tree_add_item(eigrp_flags_tree
, hf_bgp_ext_com_eigrp_flags_rt
, tvb
, offset
+2, 2, ENC_BIG_ENDIAN
);
9737 proto_item_append_text(eigrp_flags_tree
, " (%s)",
9738 tfs_get_string(tvb_get_ntohs(tvb
, offset
+2) & BGP_EXT_COM_EXP_EIGRP_FLAG_RT
, &tfs_eigrp_rtype
));
9739 proto_item_append_text(community_tree
, " %s route",
9740 tfs_get_string(tvb_get_ntohs(tvb
, offset
+2) & BGP_EXT_COM_EXP_EIGRP_FLAG_RT
, &tfs_eigrp_rtype
));
9742 proto_tree_add_item(community_tree
, hf_bgp_ext_com_eigrp_rtag
, tvb
, offset
+4, 4, ENC_BIG_ENDIAN
);
9743 proto_item_append_text(community_tree
, ", Tag: %u", tvb_get_ntohl(tvb
, offset
+4));
9747 case BGP_EXT_COM_STYPE_EXP_EIGRP_AD
:
9751 proto_tree_add_item(community_tree
, hf_bgp_ext_com_eigrp_asn
, tvb
, offset
+2, 2, ENC_BIG_ENDIAN
);
9753 raw_value
= tvb_get_ntohl(tvb
, offset
+4);
9754 proto_tree_add_uint_format_value(community_tree
, hf_bgp_ext_com_eigrp_delay
,
9755 tvb
, offset
+4, 4, raw_value
, "%u (%u usec)", raw_value
, raw_value
* 10 / 256);
9757 proto_item_append_text(community_item
, " ASN: %u, D: %u",
9758 tvb_get_ntohs(tvb
, offset
+2), raw_value
);
9762 case BGP_EXT_COM_STYPE_EXP_EIGRP_RHB
:
9766 raw_value
= tvb_get_uint8(tvb
, offset
+2);
9767 proto_tree_add_uint_format_value(community_tree
, hf_bgp_ext_com_eigrp_rly
,
9768 tvb
, offset
+2, 1, raw_value
, "%u (%u%%)", raw_value
, (raw_value
* 100) / 255);
9769 proto_item_append_text(community_item
, " R: %u", raw_value
);
9771 proto_tree_add_item(community_tree
, hf_bgp_ext_com_eigrp_hops
, tvb
, offset
+3, 1, ENC_BIG_ENDIAN
);
9772 proto_item_append_text(community_tree
, ", H: %u", tvb_get_uint8(tvb
, offset
+3));
9774 raw_value
= tvb_get_ntohl(tvb
, offset
+4);
9775 proto_tree_add_uint_format_value(community_tree
, hf_bgp_ext_com_eigrp_bw
,
9776 tvb
, offset
+4, 4, raw_value
, "%u (%u Kbps)", raw_value
, raw_value
? (2560000000U / raw_value
) : 0);
9777 proto_item_append_text(community_tree
, ", B: %u", raw_value
);
9781 case BGP_EXT_COM_STYPE_EXP_EIGRP_LM
:
9785 raw_value
= tvb_get_uint8(tvb
, offset
+3);
9786 proto_tree_add_uint_format_value(community_tree
, hf_bgp_ext_com_eigrp_load
,
9787 tvb
, offset
+3, 1, raw_value
, "%u (%u%%)", raw_value
, (raw_value
* 100) / 255);
9788 proto_item_append_text(community_tree
, " L: %u", raw_value
);
9790 proto_tree_add_item(community_tree
, hf_bgp_ext_com_eigrp_mtu
, tvb
, offset
+4, 4, ENC_BIG_ENDIAN
);
9791 proto_item_append_text(community_tree
, ", M: %u", tvb_get_ntohl(tvb
, offset
+4));
9795 case BGP_EXT_COM_STYPE_EXP_EIGRP_EAR
:
9796 proto_tree_add_item(community_tree
, hf_bgp_ext_com_eigrp_e_asn
, tvb
, offset
+2, 2, ENC_BIG_ENDIAN
);
9797 proto_tree_add_item(community_tree
, hf_bgp_ext_com_eigrp_e_rid
, tvb
, offset
+4, 4, ENC_BIG_ENDIAN
);
9799 proto_item_append_text(community_tree
, " ASN: %u, RID: %s",
9800 tvb_get_ntohs(tvb
, offset
+2), tvb_ip_to_str(pinfo
->pool
, tvb
, offset
+4));
9803 case BGP_EXT_COM_STYPE_EXP_EIGRP_EPM
:
9804 proto_tree_add_item(community_tree
, hf_bgp_ext_com_eigrp_e_pid
, tvb
, offset
+2, 2, ENC_BIG_ENDIAN
);
9805 proto_tree_add_item(community_tree
, hf_bgp_ext_com_eigrp_e_m
, tvb
, offset
+4, 4, ENC_BIG_ENDIAN
);
9807 proto_item_append_text(community_tree
, " %s, Metric: %u",
9808 val_to_str(tvb_get_ntohs(tvb
, offset
+2), eigrp_proto2string
, "Unknown protocol %u"),
9809 tvb_get_ntohl(tvb
, offset
+4));
9812 case BGP_EXT_COM_STYPE_EXP_EIGRP_RID
:
9813 proto_tree_add_item(community_tree
, hf_bgp_ext_com_eigrp_rid
, tvb
, offset
+4, 4, ENC_NA
);
9814 proto_item_append_text(community_tree
, " %s", tvb_ip_to_str(pinfo
->pool
, tvb
, offset
+4));
9819 case BGP_EXT_COM_TYPE_HIGH_TR_FLOW
: /* Flow spec redirect/mirror to IP next-hop [draft-simpson-idr-flowspec-redirect] */
9821 proto_tree_add_item(community_tree
, hf_bgp_ext_com_stype_low_unknown
, tvb
, offset
+1, 1, ENC_BIG_ENDIAN
);
9823 proto_tree_add_uint64_format_value(community_tree
, hf_bgp_ext_com_value_raw
, tvb
, offset
+2, 6,
9824 tvb_get_ntoh48 (tvb
, offset
+2), "0x%04x 0x%04x 0x%04x",
9825 tvb_get_ntohs(tvb
,offset
+2),
9826 tvb_get_ntohs(tvb
,offset
+4),
9827 tvb_get_ntohs(tvb
,offset
+6));
9829 proto_item_set_text(community_item
, "Unknown type 0x%02x subtype 0x%02x: 0x%04x 0x%04x 0x%04x",
9830 com_type_high_byte
, com_stype_low_byte
,
9831 tvb_get_ntohs(tvb
,offset
+2), tvb_get_ntohs(tvb
,offset
+4), tvb_get_ntohs(tvb
,offset
+6));
9834 proto_item_append_text (community_item
, " [%s]", val_to_str_const(com_type_high_byte
, bgpext_com_type_high
, "Unknown community"));
9835 offset
= offset
+ 8;
9841 dissect_bgp_update_pmsi_attr(packet_info
*pinfo
, proto_tree
*parent_tree
, tvbuff_t
*tvb
, uint16_t tlen
, unsigned tvb_off
)
9844 uint8_t tunnel_type
=0;
9845 uint8_t opaque_value_type
=0;
9846 uint8_t rn_addr_length
=0;
9847 uint16_t tunnel_id_len
=0;
9848 uint16_t opaque_value_length
=0;
9849 proto_item
*tunnel_id_item
=NULL
;
9850 proto_item
*opaque_value_type_item
=NULL
;
9851 proto_item
*pmsi_tunnel_type_item
=NULL
;
9852 proto_tree
*tunnel_id_tree
=NULL
;
9853 path_attr_data
*data
= NULL
;
9856 tunnel_id_len
= tlen
- 5;
9858 proto_tree_add_item(parent_tree
, hf_bgp_pmsi_tunnel_flags
, tvb
, offset
,
9861 pmsi_tunnel_type_item
= proto_tree_add_item(parent_tree
, hf_bgp_pmsi_tunnel_type
, tvb
, offset
+1,
9864 data
= load_path_attr_data(pinfo
);
9865 if (data
&& data
->encaps_community_present
&&
9866 (data
->encaps_tunnel_type
== BGP_EXT_COM_TUNNEL_VXLAN
|| data
->encaps_tunnel_type
== BGP_EXT_COM_TUNNEL_VXLANGPE
)) {
9867 proto_tree_add_item(parent_tree
, hf_bgp_evpn_nlri_vni
, tvb
, offset
+2, 3, ENC_BIG_ENDIAN
);
9869 proto_tree_add_item(parent_tree
, hf_bgp_update_mpls_label_value_20bits
, tvb
, offset
+2, 3, ENC_BIG_ENDIAN
);
9872 tunnel_id_item
= proto_tree_add_item(parent_tree
, hf_bgp_pmsi_tunnel_id
, tvb
, offset
+5,
9873 tunnel_id_len
, ENC_NA
);
9874 tunnel_id_tree
= proto_item_add_subtree(tunnel_id_item
, ett_bgp_pmsi_tunnel_id
);
9876 tunnel_type
= tvb_get_uint8(tvb
, offset
+1);
9877 switch(tunnel_type
) {
9878 case PMSI_TUNNEL_NOPRESENT
:
9879 proto_tree_add_item(tunnel_id_tree
, hf_bgp_pmsi_tunnel_not_present
, tvb
, offset
+1, 1, ENC_NA
);
9881 case PMSI_TUNNEL_RSVPTE_P2MP
:
9882 proto_tree_add_item(tunnel_id_tree
, hf_bgp_pmsi_tunnel_rsvp_p2mp_id
, tvb
, offset
+5, 4, ENC_NA
);
9883 proto_tree_add_item(tunnel_id_tree
, hf_bgp_pmsi_tunnel_rsvp_p2mp_tunnel_id
, tvb
, offset
+11, 2, ENC_BIG_ENDIAN
);
9884 proto_tree_add_item(tunnel_id_tree
, hf_bgp_pmsi_tunnel_rsvp_p2mp_ext_tunnel_idv4
, tvb
, offset
+13, 4, ENC_NA
);
9885 proto_item_append_text(tunnel_id_item
, ": Id %u, Ext Id %s",
9886 tvb_get_ntohs(tvb
, offset
+11), tvb_ip_to_str(pinfo
->pool
, tvb
, offset
+13));
9888 case PMSI_TUNNEL_MLDP_P2MP
:
9889 case PMSI_TUNNEL_MLDP_MP2MP
:
9890 proto_tree_add_item(tunnel_id_tree
, hf_bgp_pmsi_tunnel_mldp_fec_el_type
, tvb
, offset
+5, 1, ENC_BIG_ENDIAN
);
9891 proto_tree_add_item(tunnel_id_tree
, hf_bgp_pmsi_tunnel_mldp_fec_el_afi
, tvb
, offset
+6, 2, ENC_BIG_ENDIAN
);
9892 proto_tree_add_item(tunnel_id_tree
, hf_bgp_pmsi_tunnel_mldp_fec_el_adr_len
, tvb
, offset
+8, 1, ENC_BIG_ENDIAN
);
9893 rn_addr_length
= tvb_get_uint8(tvb
, offset
+8);
9894 if(rn_addr_length
== 4)
9895 proto_tree_add_item(tunnel_id_tree
, hf_bgp_pmsi_tunnel_mldp_fec_el_root_nodev4
, tvb
, offset
+9, 4, ENC_BIG_ENDIAN
);
9897 proto_tree_add_item(tunnel_id_tree
, hf_bgp_pmsi_tunnel_mldp_fec_el_root_nodev6
, tvb
, offset
+9, 16, ENC_NA
);
9899 proto_tree_add_item(tunnel_id_tree
, hf_bgp_pmsi_tunnel_mldp_fec_el_opa_len
, tvb
, offset
+9+rn_addr_length
, 2, ENC_BIG_ENDIAN
);
9900 opaque_value_type_item
= proto_tree_add_item(tunnel_id_tree
, hf_bgp_pmsi_tunnel_mldp_fec_el_opa_val_type
,
9901 tvb
, offset
+11+rn_addr_length
, 1, ENC_BIG_ENDIAN
);
9902 opaque_value_type
= tvb_get_uint8(tvb
, offset
+11+rn_addr_length
);
9903 if(opaque_value_type
== PMSI_MLDP_FEC_TYPE_GEN_LSP
) {
9904 proto_tree_add_item(tunnel_id_tree
, hf_bgp_pmsi_tunnel_mldp_fec_el_opa_val_len
, tvb
, offset
+12+rn_addr_length
, 2, ENC_BIG_ENDIAN
);
9905 proto_tree_add_item(tunnel_id_tree
, hf_bgp_pmsi_tunnel_mldp_fec_el_opa_value_rn
, tvb
, offset
+14+rn_addr_length
, 4, ENC_BIG_ENDIAN
);
9906 proto_item_append_text(tunnel_id_item
, ": Type: %s root node: %s Id: %u",
9907 val_to_str_const(tvb_get_uint8(tvb
, offset
+5), fec_types_vals
, "Unknown"),
9908 tvb_ip_to_str(pinfo
->pool
, tvb
, offset
+9),
9909 tvb_get_ntohl(tvb
, offset
+14+rn_addr_length
));
9910 } else if (opaque_value_type
== PMSI_MLDP_FEC_TYPE_EXT_TYPE
) {
9911 proto_tree_add_item(tunnel_id_tree
, hf_bgp_pmsi_tunnel_mldp_fec_el_opa_val_ext_type
, tvb
, offset
+12+rn_addr_length
, 2, ENC_BIG_ENDIAN
);
9912 proto_tree_add_item(tunnel_id_tree
, hf_bgp_pmsi_tunnel_mldp_fec_el_opa_val_ext_len
, tvb
, offset
+14+rn_addr_length
, 2, ENC_BIG_ENDIAN
);
9913 opaque_value_length
= tvb_get_ntohs(tvb
, offset
+14+rn_addr_length
);
9914 proto_tree_add_item(tunnel_id_tree
, hf_bgp_pmsi_tunnel_mldp_fec_el_opa_value_str
, tvb
, offset
+16+rn_addr_length
,
9915 opaque_value_length
, ENC_ASCII
);
9918 /* This covers situation when opaque id is 0 (reserved) or any other value */
9919 expert_add_info_format(pinfo
, opaque_value_type_item
, &ei_bgp_attr_pmsi_opaque_type
,
9920 "Opaque Value type %u wrong, must be modulo 1 or 255", opaque_value_type
);
9923 case PMSI_TUNNEL_PIMSSM
:
9924 proto_tree_add_item(tunnel_id_tree
, hf_bgp_pmsi_tunnel_pimssm_root_node
, tvb
, offset
+5, 4, ENC_BIG_ENDIAN
);
9925 proto_tree_add_item(tunnel_id_tree
, hf_bgp_pmsi_tunnel_pimssm_pmc_group
, tvb
, offset
+9, 4, ENC_BIG_ENDIAN
);
9926 proto_item_append_text(tunnel_id_item
, ": < %s, %s >",
9927 tvb_ip_to_str(pinfo
->pool
, tvb
, offset
+5),
9928 tvb_ip_to_str(pinfo
->pool
, tvb
, offset
+9));
9930 case PMSI_TUNNEL_PIMSM
:
9931 proto_tree_add_item(tunnel_id_tree
, hf_bgp_pmsi_tunnel_pimsm_sender
, tvb
, offset
+5, 4, ENC_BIG_ENDIAN
);
9932 proto_tree_add_item(tunnel_id_tree
, hf_bgp_pmsi_tunnel_pimsm_pmc_group
, tvb
, offset
+9, 4, ENC_BIG_ENDIAN
);
9933 proto_item_append_text(tunnel_id_item
, ": < %s, %s >",
9934 tvb_ip_to_str(pinfo
->pool
, tvb
, offset
+5),
9935 tvb_ip_to_str(pinfo
->pool
, tvb
, offset
+9));
9937 case PMSI_TUNNEL_BIDIR_PIM
:
9938 proto_tree_add_item(tunnel_id_tree
, hf_bgp_pmsi_tunnel_pimbidir_sender
, tvb
, offset
+5, 4, ENC_BIG_ENDIAN
);
9939 proto_tree_add_item(tunnel_id_tree
, hf_bgp_pmsi_tunnel_pimbidir_pmc_group
, tvb
, offset
+9, 4, ENC_BIG_ENDIAN
);
9940 proto_item_append_text(tunnel_id_item
, ": < %s, %s >",
9941 tvb_ip_to_str(pinfo
->pool
, tvb
, offset
+5),
9942 tvb_ip_to_str(pinfo
->pool
, tvb
, offset
+9));
9944 case PMSI_TUNNEL_INGRESS
:
9945 if(tunnel_id_len
== 4){
9946 proto_tree_add_item(tunnel_id_tree
, hf_bgp_pmsi_tunnel_ingress_rep_addr
, tvb
, offset
+5, 4, ENC_BIG_ENDIAN
);
9947 proto_item_append_text(tunnel_id_item
, ": tunnel end point -> %s",
9948 tvb_ip_to_str(pinfo
->pool
, tvb
, offset
+5));
9950 proto_tree_add_item(tunnel_id_tree
, hf_bgp_pmsi_tunnel_ingress_rep_addr6
, tvb
, offset
+5, 16, ENC_NA
);
9951 proto_item_append_text(tunnel_id_item
, ": tunnel end point -> %s",
9952 tvb_ip6_to_str(pinfo
->pool
, tvb
, offset
+5));
9956 expert_add_info_format(pinfo
, pmsi_tunnel_type_item
, &ei_bgp_attr_pmsi_tunnel_type
,
9957 "Tunnel type %u wrong", tunnel_type
);
9966 * Dissect BGP path attributes
9970 // NOLINTNEXTLINE(misc-no-recursion)
9971 dissect_bgp_path_attr(proto_tree
*subtree
, tvbuff_t
*tvb
, uint16_t path_attr_len
, unsigned tvb_off
, packet_info
*pinfo
)
9973 uint8_t bgpa_flags
; /* path attributes */
9975 int o
; /* packet offset */
9977 int end
=0; /* message end */
9978 int advance
; /* tmp */
9979 proto_item
*ti
; /* tree item */
9980 proto_item
*ti_communities
; /* tree communities */
9981 proto_item
*ti_community
; /* tree for each community */
9982 proto_item
*ti_as
; /* tree for each as */
9983 proto_item
*attr_len_item
;
9984 proto_item
*aigp_type_item
;
9985 proto_tree
*subtree2
; /* path attribute subtree */
9986 proto_tree
*subtree3
; /* subtree for attributes */
9987 proto_tree
*subtree4
; /* subtree for attributes */
9988 proto_tree
*subtree5
; /* subtree for attributes */
9989 proto_tree
*subtree6
; /* subtree for attributes */
9990 proto_tree
*subtree7
; /* subtree for attributes */
9991 proto_tree
*subtree8
; /* subtree for attributes */
9992 proto_tree
*attr_set_subtree
; /* subtree for attr_set */
9993 proto_tree
*as_path_segment_tree
; /* subtree for AS_PATH segments */
9994 int number_as_segment
=0; /* Number As segment */
9995 proto_tree
*communities_tree
; /* subtree for COMMUNITIES */
9996 proto_tree
*community_tree
; /* subtree for a community */
9997 proto_tree
*cluster_list_tree
; /* subtree for CLUSTER_LIST */
9998 int i
=0, j
, k
; /* tmp */
9999 uint8_t type
=0; /* AS_PATH segment type */
10000 uint8_t length
=0; /* AS_PATH segment length */
10001 uint32_t aggregator_as
;
10002 uint16_t ssa_type
; /* SSA T + Type */
10003 uint16_t ssa_len
; /* SSA TLV Length */
10004 uint8_t ssa_v3_len
; /* SSA L2TPv3 Cookie Length */
10005 uint16_t encaps_tunnel_type
; /* Encapsulation Tunnel Type */
10006 uint16_t encaps_tunnel_len
; /* Encapsulation TLV Length */
10007 uint8_t encaps_tunnel_subtype
; /* Encapsulation Tunnel Sub-TLV Type */
10008 uint16_t encaps_tunnel_sublen
; /* Encapsulation TLV Sub-TLV Length */
10009 uint16_t encaps_tunnel_sub_totallen
; /* Encapsulation TLV Sub-TLV Length + Type + Length field */
10010 uint8_t aigp_type
; /* AIGP TLV type from AIGP attribute */
10011 uint8_t prefix_sid_subtype
; /* BGP Prefix-SID TLV Type */
10012 uint16_t prefix_sid_sublen
; /* BGP Prefix-SID TLV Length */
10013 int prefix_sid_sub_tlv_offset
; /* BGP Prefix-SID SRGB Length */
10014 int check_srgb
; /* BGP Prefix-SID SRGB counter */
10015 uint16_t secpathlen
; /* BGPsec Secure Path length */
10016 uint16_t sigblocklen
; /* BGPsec Signature Block length */
10017 uint8_t secpathcount
; /* Number of Secure Path Segments */
10018 uint16_t sig_len
; /* Length of BGPsec Signature */
10019 uint32_t segment_subtlv_type
; /* Segment List SubTLV Type */
10020 uint32_t segment_subtlv_length
; /* Segment List SubTLV Length */
10021 uint8_t srv6_service_subtlv_type
; /* SRv6 Service Sub-TLV type */
10022 uint16_t srv6_service_subtlv_len
; /* SRv6 Service Sub-TLV length */
10023 uint8_t srv6_service_data_subsubtlv_type
; /* SRv6 Service Data Sub-Sub-TLV type */
10024 uint16_t srv6_service_data_subsubtlv_len
; /* SRv6 Service Data Sub-Sub-TLV length */
10028 increment_dissection_depth(pinfo
);
10029 while (i
< path_attr_len
) {
10030 proto_item
*ti_pa
, *ti_flags
;
10032 int alen
, aoff
, tlen
, aoff_save
;
10034 uint8_t nexthop_len
;
10035 uint8_t asn_len
= 0;
10036 uint32_t af
, saf
, as_num
;
10038 static int * const path_flags
[] = {
10039 &hf_bgp_update_path_attribute_flags_optional
,
10040 &hf_bgp_update_path_attribute_flags_transitive
,
10041 &hf_bgp_update_path_attribute_flags_partial
,
10042 &hf_bgp_update_path_attribute_flags_extended_length
,
10043 &hf_bgp_update_path_attribute_flags_unused
,
10047 bgpa_flags
= tvb_get_uint8(tvb
, o
+ i
);
10048 bgpa_type
= tvb_get_uint8(tvb
, o
+ i
+1);
10050 /* check for the Extended Length bit */
10051 if (bgpa_flags
& BGP_ATTR_FLAG_EXTENDED_LENGTH
) {
10052 alen
= tvb_get_ntohs(tvb
, o
+ i
+ BGP_SIZE_OF_PATH_ATTRIBUTE
);
10053 aoff
= BGP_SIZE_OF_PATH_ATTRIBUTE
+2;
10055 alen
= tvb_get_uint8(tvb
, o
+ i
+ BGP_SIZE_OF_PATH_ATTRIBUTE
);
10056 aoff
= BGP_SIZE_OF_PATH_ATTRIBUTE
+1;
10060 ti_pa
= proto_tree_add_item(subtree
, hf_bgp_update_path_attribute
, tvb
, o
+ i
, tlen
+ aoff
, ENC_NA
);
10061 proto_item_append_text(ti_pa
, " - %s", val_to_str(bgpa_type
, bgpattr_type
, "Unknown (%u)"));
10063 subtree2
= proto_item_add_subtree(ti_pa
, ett_bgp_attr
);
10065 ti_flags
= proto_tree_add_bitmask(subtree2
, tvb
, o
+ i
, hf_bgp_update_path_attribute_flags
, ett_bgp_attr_flags
, path_flags
, ENC_NA
);
10067 if ((bgpa_flags
& BGP_ATTR_FLAG_OPTIONAL
) == 0)
10068 proto_item_append_text(ti_flags
, "%s", ", Well-known");
10069 if ((bgpa_flags
& BGP_ATTR_FLAG_TRANSITIVE
) == 0)
10070 proto_item_append_text(ti_flags
, "%s", ", Non-transitive");
10071 if ((bgpa_flags
& BGP_ATTR_FLAG_PARTIAL
) == 0)
10072 proto_item_append_text(ti_flags
, "%s", ", Complete");
10074 proto_tree_add_item(subtree2
, hf_bgp_update_path_attribute_type_code
, tvb
, o
+ i
+ 1, 1, ENC_BIG_ENDIAN
);
10076 attr_len_item
= proto_tree_add_item(subtree2
, hf_bgp_update_path_attribute_length
, tvb
, o
+ i
+ BGP_SIZE_OF_PATH_ATTRIBUTE
,
10077 aoff
- BGP_SIZE_OF_PATH_ATTRIBUTE
, ENC_BIG_ENDIAN
);
10078 if (aoff
+ tlen
> path_attr_len
- i
) {
10079 proto_tree_add_expert_format(subtree2
, pinfo
, &ei_bgp_length_invalid
, tvb
, o
+ i
+ aoff
, tlen
,
10080 "Path attribute length is invalid: %u byte%s", tlen
,
10081 plurality(tlen
, "", "s"));
10085 /* Path Attribute Type */
10086 switch (bgpa_type
) {
10087 case BGPTYPE_ORIGIN
:
10089 proto_tree_add_expert_format(subtree2
, pinfo
, &ei_bgp_length_invalid
, tvb
, o
+ i
+ aoff
, tlen
,
10090 "Origin (invalid): %u byte%s", tlen
,
10091 plurality(tlen
, "", "s"));
10093 proto_tree_add_item(subtree2
, hf_bgp_update_path_attribute_origin
, tvb
,
10094 o
+ i
+ aoff
, 1, ENC_BIG_ENDIAN
);
10095 proto_item_append_text(ti_pa
, ": %s", val_to_str_const(tvb_get_uint8(tvb
, o
+ i
+ aoff
), bgpattr_origin
, "Unknown"));
10098 case BGPTYPE_AS_PATH
:
10099 case BGPTYPE_AS4_PATH
:
10100 /* Apply heuristic to guess if we are facing 2 or 4 bytes ASN
10102 (o + current attribute + aoff bytes to first tuple)
10103 heuristic also tell us how many AS segments we have */
10104 asn_len
= heuristic_as2_or_4_from_as_path(tvb
, o
+i
+aoff
, o
+i
+aoff
+tlen
,
10105 bgpa_type
, &number_as_segment
);
10106 if (asn_len
== 255)
10108 expert_add_info_format(pinfo
, ti_pa
, &ei_bgp_attr_as_path_as_len_err
,
10109 "ASN length uncalculated by heuristic : %u", asn_len
);
10112 proto_item_append_text(ti_pa
,": ");
10114 proto_item_append_text(ti_pa
,"empty");
10117 for (k
=0; k
< number_as_segment
; k
++)
10119 type
= tvb_get_uint8(tvb
, q
);
10120 length
= tvb_get_uint8(tvb
, q
+1);
10121 ti
= proto_tree_add_item(subtree2
, hf_bgp_update_path_attribute_as_path_segment
, tvb
,
10122 q
, length
* asn_len
+ 2, ENC_NA
);
10123 proto_item_append_text(ti
,": ");
10124 as_path_segment_tree
= proto_item_add_subtree(ti
, ett_bgp_as_path_segment
);
10125 proto_tree_add_item(as_path_segment_tree
, hf_bgp_update_path_attribute_as_path_segment_type
, tvb
,
10126 q
, 1, ENC_BIG_ENDIAN
);
10127 proto_tree_add_item(as_path_segment_tree
, hf_bgp_update_path_attribute_as_path_segment_length
, tvb
,
10128 q
+1, 1, ENC_BIG_ENDIAN
);
10132 proto_item_append_text(ti_pa
, "{");
10133 proto_item_append_text(ti
, "{");
10135 case AS_CONFED_SET
:
10136 proto_item_append_text(ti_pa
, "[");
10137 proto_item_append_text(ti
, "[");
10139 case AS_CONFED_SEQUENCE
:
10140 proto_item_append_text(ti_pa
, "(");
10141 proto_item_append_text(ti
, "(");
10146 for (j
= 0; j
< length
; j
++)
10149 ti_as
= proto_tree_add_item_ret_uint(as_path_segment_tree
,
10150 hf_bgp_update_path_attribute_as_path_segment_as2
,
10151 tvb
, q
, 2, ENC_BIG_ENDIAN
, &as_num
);
10152 if (as_num
== BGP_AS_TRANS
) {
10153 proto_item_append_text(ti_as
, " (AS_TRANS)");
10155 proto_item_append_text(ti_pa
, "%u",
10156 tvb_get_ntohs(tvb
, q
));
10157 proto_item_append_text(ti
, "%u",
10158 tvb_get_ntohs(tvb
, q
));
10160 else if (asn_len
== 4) {
10161 proto_tree_add_item(as_path_segment_tree
,
10162 hf_bgp_update_path_attribute_as_path_segment_as4
,
10163 tvb
, q
, 4, ENC_BIG_ENDIAN
);
10164 proto_item_append_text(ti_pa
, "%u",
10165 tvb_get_ntohl(tvb
, q
));
10166 proto_item_append_text(ti
, "%u",
10167 tvb_get_ntohl(tvb
, q
));
10171 proto_item_append_text(ti_pa
, "%s",
10172 (type
== AS_SET
|| type
== AS_CONFED_SET
) ?
10174 proto_item_append_text(ti
, "%s",
10175 (type
== AS_SET
|| type
== AS_CONFED_SET
) ?
10183 proto_item_append_text(ti_pa
, "} ");
10184 proto_item_append_text(ti
, "}");
10186 case AS_CONFED_SET
:
10187 proto_item_append_text(ti_pa
, "] ");
10188 proto_item_append_text(ti
, "]");
10190 case AS_CONFED_SEQUENCE
:
10191 proto_item_append_text(ti_pa
, ") ");
10192 proto_item_append_text(ti
, ")");
10195 proto_item_append_text(ti_pa
, " ");
10201 case BGPTYPE_NEXT_HOP
:
10203 proto_tree_add_expert_format(subtree2
, pinfo
, &ei_bgp_length_invalid
, tvb
, o
+ i
+ aoff
, tlen
,
10204 "Next hop (invalid): %u byte%s", tlen
,
10205 plurality(tlen
, "", "s"));
10207 proto_tree_add_item(subtree2
, hf_bgp_update_path_attribute_next_hop
, tvb
,
10208 o
+ i
+ aoff
, 4, ENC_BIG_ENDIAN
);
10209 proto_item_append_text(ti_pa
, ": %s ", tvb_ip_to_str(pinfo
->pool
, tvb
, o
+ i
+ aoff
));
10212 case BGPTYPE_MULTI_EXIT_DISC
:
10214 proto_tree_add_expert_format(subtree2
, pinfo
, &ei_bgp_length_invalid
, tvb
, o
+ i
+ aoff
, tlen
,
10215 "Multiple exit discriminator (invalid): %u byte%s",
10216 tlen
, plurality(tlen
, "", "s"));
10218 proto_tree_add_item(subtree2
, hf_bgp_update_path_attribute_multi_exit_disc
, tvb
,
10219 o
+ i
+ aoff
, tlen
, ENC_BIG_ENDIAN
);
10220 proto_item_append_text(ti_pa
,": %u", tvb_get_ntohl(tvb
, o
+ i
+ aoff
));
10223 case BGPTYPE_LOCAL_PREF
:
10225 proto_tree_add_expert_format(subtree2
, pinfo
, &ei_bgp_length_invalid
, tvb
, o
+ i
+ aoff
, tlen
,
10226 "Local preference (invalid): %u byte%s", tlen
,
10227 plurality(tlen
, "", "s"));
10229 proto_tree_add_item(subtree2
, hf_bgp_update_path_attribute_local_pref
, tvb
,
10230 o
+ i
+ aoff
, tlen
, ENC_BIG_ENDIAN
);
10231 proto_item_append_text(ti_pa
, ": %u", tvb_get_ntohl(tvb
, o
+ i
+ aoff
));
10234 case BGPTYPE_ATOMIC_AGGREGATE
:
10236 proto_tree_add_expert_format(subtree2
, pinfo
, &ei_bgp_length_invalid
, tvb
, o
+ i
+ aoff
, tlen
,
10237 "Atomic aggregate (invalid): %u byte%s", tlen
,
10238 plurality(tlen
, "", "s"));
10241 case BGPTYPE_AGGREGATOR
:
10242 if (tlen
!= 6 && tlen
!= 8) {
10243 proto_tree_add_expert_format(subtree2
, pinfo
, &ei_bgp_length_invalid
, tvb
, o
+ i
+ aoff
, tlen
,
10244 "Aggregator (invalid): %u byte%s", tlen
,
10245 plurality(tlen
, "", "s"));
10249 case BGPTYPE_AS4_AGGREGATOR
:
10250 if (bgpa_type
== BGPTYPE_AS4_AGGREGATOR
&& tlen
!= 8)
10251 proto_tree_add_expert_format(subtree2
, pinfo
, &ei_bgp_length_invalid
, tvb
, o
+ i
+ aoff
, tlen
,
10252 "Aggregator (invalid): %u byte%s", tlen
,
10253 plurality(tlen
, "", "s"));
10255 asn_len
= tlen
- 4;
10256 aggregator_as
= (asn_len
== 2) ?
10257 tvb_get_ntohs(tvb
, o
+ i
+ aoff
) :
10258 tvb_get_ntohl(tvb
, o
+ i
+ aoff
);
10259 proto_tree_add_uint(subtree2
, hf_bgp_update_path_attribute_aggregator_as
, tvb
,
10260 o
+ i
+ aoff
, asn_len
, aggregator_as
);
10261 proto_tree_add_item(subtree2
, hf_bgp_update_path_attribute_aggregator_origin
, tvb
,
10262 o
+ i
+ aoff
+ asn_len
, 4, ENC_BIG_ENDIAN
);
10264 proto_item_append_text(ti_pa
, ": AS: %u origin: %s", aggregator_as
,
10265 tvb_ip_to_str(pinfo
->pool
, tvb
, o
+ i
+ aoff
+ asn_len
));
10268 case BGPTYPE_COMMUNITIES
:
10269 if (tlen
% 4 != 0) {
10270 proto_tree_add_expert_format(subtree2
, pinfo
, &ei_bgp_length_invalid
, tvb
, o
+ i
+ aoff
, tlen
,
10271 "Communities (invalid): %u byte%s", tlen
,
10272 plurality(tlen
, "", "s"));
10276 proto_item_append_text(ti_pa
, ": ");
10278 ti_communities
= proto_tree_add_item(subtree2
, hf_bgp_update_path_attribute_communities
,
10279 tvb
, o
+ i
+ aoff
, tlen
, ENC_NA
);
10281 communities_tree
= proto_item_add_subtree(ti_communities
,
10282 ett_bgp_communities
);
10283 proto_item_append_text(ti_communities
, ": ");
10284 /* (o + i + aoff) =
10285 (o + current attribute + aoff bytes to first tuple) */
10289 /* snarf each community */
10291 /* check for reserved values */
10292 uint32_t community
= tvb_get_ntohl(tvb
, q
);
10293 if ((community
& 0xFFFF0000) == FOURHEX0
||
10294 (community
& 0xFFFF0000) == FOURHEXF
) {
10295 proto_tree_add_item(communities_tree
, hf_bgp_update_path_attribute_community_well_known
,
10296 tvb
, q
, 4, ENC_BIG_ENDIAN
);
10297 proto_item_append_text(ti_pa
, "%s ", val_to_str_const(community
, community_vals
, "Reserved"));
10298 proto_item_append_text(ti_communities
, "%s ", val_to_str_const(community
, community_vals
, "Reserved"));
10301 ti_community
= proto_tree_add_item(communities_tree
, hf_bgp_update_path_attribute_community
, tvb
,
10303 community_tree
= proto_item_add_subtree(ti_community
,
10304 ett_bgp_community
);
10305 proto_tree_add_item(community_tree
, hf_bgp_update_path_attribute_community_as
,
10306 tvb
, q
, 2, ENC_BIG_ENDIAN
);
10307 proto_tree_add_item(community_tree
, hf_bgp_update_path_attribute_community_value
,
10308 tvb
, q
+2, 2, ENC_BIG_ENDIAN
);
10309 proto_item_append_text(ti_pa
, "%u:%u ",tvb_get_ntohs(tvb
, q
),
10310 tvb_get_ntohs(tvb
, q
+2));
10311 proto_item_append_text(ti_communities
, "%u:%u ",tvb_get_ntohs(tvb
, q
),
10312 tvb_get_ntohs(tvb
, q
+2));
10313 proto_item_append_text(ti_community
, ": %u:%u ",tvb_get_ntohs(tvb
, q
),
10314 tvb_get_ntohs(tvb
, q
+2));
10322 case BGPTYPE_ORIGINATOR_ID
:
10324 proto_tree_add_expert_format(subtree2
, pinfo
, &ei_bgp_length_invalid
, tvb
, o
+ i
+ aoff
, tlen
,
10325 "Originator identifier (invalid): %u byte%s", tlen
,
10326 plurality(tlen
, "", "s"));
10328 proto_tree_add_item(subtree2
, hf_bgp_update_path_attribute_originator_id
, tvb
,
10329 o
+ i
+ aoff
, tlen
, ENC_BIG_ENDIAN
);
10330 proto_item_append_text(ti_pa
, ": %s ", tvb_ip_to_str(pinfo
->pool
, tvb
, o
+ i
+ aoff
));
10333 case BGPTYPE_MP_REACH_NLRI
:
10334 /* RFC 2283 says that a MP_[UN]REACH_NLRI path attribute can
10335 * have more than one <AFI, SAFI, Next Hop, ..., NLRI> tuple.
10336 * However, that doesn't work because the NLRI is also a
10337 * variable number of <length, prefix> fields without a field
10338 * for the overall length of the NLRI. Thus one would have to
10339 * guess whether a particular byte were the length of the next
10340 * prefix or a new AFI. So no one ever implemented that, and
10341 * RFC 2858, obsoleting 2283, says you can't do that.
10343 proto_tree_add_item_ret_uint(subtree2
, hf_bgp_update_path_attribute_mp_reach_nlri_address_family
, tvb
,
10344 o
+ i
+ aoff
, 2, ENC_BIG_ENDIAN
, &af
);
10345 proto_tree_add_item_ret_uint(subtree2
, hf_bgp_update_path_attribute_mp_reach_nlri_safi
, tvb
,
10346 o
+ i
+ aoff
+ 2, 1, ENC_BIG_ENDIAN
, &saf
);
10347 nexthop_len
= tvb_get_uint8(tvb
, o
+ i
+ aoff
+ 3);
10348 save_afi_safi_data(pinfo
, (uint16_t)af
, (uint8_t)saf
);
10350 decode_mp_next_hop(tvb_new_subset_length(tvb
, o
+ i
+ aoff
+ 3, nexthop_len
+ 1), subtree2
, pinfo
, af
, saf
, nexthop_len
);
10353 tlen
-= nexthop_len
+ 4;
10354 aoff
+= nexthop_len
+ 4;
10357 snpa
= tvb_get_uint8(tvb
, o
+ i
+ aoff
);
10358 ti
= proto_tree_add_item(subtree2
, hf_bgp_update_path_attribute_mp_reach_nlri_nbr_snpa
, tvb
,
10359 o
+ i
+ aoff
, 1, ENC_BIG_ENDIAN
);
10362 subtree3
= proto_item_add_subtree(ti
, ett_bgp_mp_snpa
);
10363 for (/*nothing*/; snpa
> 0; snpa
--) {
10364 uint8_t snpa_length
= tvb_get_uint8(tvb
, o
+ i
+ aoff
+ off
);
10365 proto_tree_add_item(subtree3
, hf_bgp_update_path_attribute_mp_reach_nlri_snpa_length
, tvb
,
10366 o
+ i
+ aoff
+ off
, 1, ENC_BIG_ENDIAN
);
10368 proto_tree_add_item(subtree3
, hf_bgp_update_path_attribute_mp_reach_nlri_snpa
, tvb
,
10369 o
+ i
+ aoff
+ off
, snpa_length
, ENC_NA
);
10370 off
+= snpa_length
;
10376 ti
= proto_tree_add_item(subtree2
, hf_bgp_update_path_attribute_mp_reach_nlri
, tvb
, o
+ i
+ aoff
, tlen
, ENC_NA
);
10377 subtree3
= proto_item_add_subtree(ti
, ett_bgp_mp_reach_nlri
);
10380 if (af
!= AFNUM_INET
&& af
!= AFNUM_INET6
&& af
!= AFNUM_L2VPN
&& af
!= AFNUM_BGP_LS
) {
10381 proto_tree_add_expert(subtree3
, pinfo
, &ei_bgp_unknown_afi
, tvb
, o
+ i
+ aoff
, tlen
);
10384 advance
= decode_prefix_MP(subtree3
,
10385 hf_bgp_nlri_path_id
,
10386 hf_bgp_mp_reach_nlri_ipv4_prefix
,
10387 hf_bgp_mp_reach_nlri_ipv6_prefix
,
10389 tvb
, o
+ i
+ aoff
, "MP Reach NLRI", pinfo
);
10399 case BGPTYPE_MP_UNREACH_NLRI
:
10400 af
= tvb_get_ntohs(tvb
, o
+ i
+ aoff
);
10401 proto_tree_add_item(subtree2
, hf_bgp_update_path_attribute_mp_unreach_nlri_address_family
, tvb
,
10402 o
+ i
+ aoff
, 2, ENC_BIG_ENDIAN
);
10403 saf
= tvb_get_uint8(tvb
, o
+ i
+ aoff
+ 2) ;
10404 proto_tree_add_item(subtree2
, hf_bgp_update_path_attribute_mp_unreach_nlri_safi
, tvb
,
10405 o
+ i
+ aoff
+2, 1, ENC_BIG_ENDIAN
);
10406 save_afi_safi_data(pinfo
, (uint16_t)af
, (uint8_t)saf
);
10408 ti
= proto_tree_add_item(subtree2
, hf_bgp_update_path_attribute_mp_unreach_nlri
, tvb
, o
+ i
+ aoff
+ 3, tlen
- 3, ENC_NA
);
10409 subtree3
= proto_item_add_subtree(ti
, ett_bgp_mp_unreach_nlri
);
10417 advance
= decode_prefix_MP(subtree3
,
10418 hf_bgp_nlri_path_id
,
10419 hf_bgp_mp_unreach_nlri_ipv4_prefix
,
10420 hf_bgp_mp_unreach_nlri_ipv6_prefix
,
10422 tvb
, o
+ i
+ aoff
, "MP Unreach NLRI", pinfo
);
10431 case BGPTYPE_CLUSTER_LIST
:
10432 if (tlen
% 4 != 0) {
10433 proto_tree_add_expert_format(subtree2
, pinfo
, &ei_bgp_length_invalid
, tvb
, o
+ i
+ aoff
, tlen
,
10434 "Cluster list (invalid): %u byte%s", tlen
,
10435 plurality(tlen
, "", "s"));
10439 ti
= proto_tree_add_item(subtree2
, hf_bgp_update_path_attribute_cluster_list
,
10440 tvb
, o
+ i
+ aoff
, tlen
, ENC_NA
);
10441 cluster_list_tree
= proto_item_add_subtree(ti
,
10442 ett_bgp_cluster_list
);
10444 /* (o + i + aoff) =
10445 (o + current attribute + aoff bytes to first tuple) */
10448 proto_item_append_text(ti
, ":");
10449 proto_item_append_text(ti_pa
, ":");
10450 /* snarf each cluster identifier */
10452 proto_tree_add_item(cluster_list_tree
, hf_bgp_update_path_attribute_cluster_id
,
10453 tvb
, q
- 3 + aoff
, 4, ENC_NA
);
10454 proto_item_append_text(ti
, " %s", tvb_ip_to_str(pinfo
->pool
, tvb
, q
-3+aoff
));
10455 proto_item_append_text(ti_pa
, " %s", tvb_ip_to_str(pinfo
->pool
, tvb
, q
-3+aoff
));
10460 case BGPTYPE_EXTENDED_COMMUNITY
:
10461 if (tlen
%8 != 0) {
10462 expert_add_info_format(pinfo
, attr_len_item
, &ei_bgp_ext_com_len_bad
,
10463 "Community length %u wrong, must be modulo 8", tlen
);
10465 dissect_bgp_update_ext_com(subtree2
, tvb
, tlen
, o
+i
+aoff
, pinfo
);
10468 case BGPTYPE_SAFI_SPECIFIC_ATTR
:
10470 end
= o
+ i
+ aoff
+ tlen
;
10473 ssa_type
= tvb_get_ntohs(tvb
, q
) & BGP_SSA_TYPE
;
10474 ssa_len
= tvb_get_ntohs(tvb
, q
+ 2);
10476 subtree3
= proto_tree_add_subtree_format(subtree2
, tvb
, q
, MIN(ssa_len
+ 4, end
- q
),
10477 ett_bgp_ssa
, NULL
, "%s Information",
10478 val_to_str_const(ssa_type
, bgp_ssa_type
, "Unknown SSA"));
10480 proto_tree_add_item(subtree3
, hf_bgp_ssa_t
, tvb
,
10481 q
, 1, ENC_BIG_ENDIAN
);
10482 proto_tree_add_item(subtree3
, hf_bgp_ssa_type
, tvb
, q
, 2, ENC_BIG_ENDIAN
);
10484 proto_tree_add_item(subtree3
, hf_bgp_ssa_len
, tvb
, q
+ 2, 2, ENC_BIG_ENDIAN
);
10486 if ((ssa_len
== 0) || (q
+ ssa_len
> end
)) {
10487 proto_tree_add_expert_format(subtree3
, pinfo
, &ei_bgp_length_invalid
, tvb
, q
+ 2,
10488 end
- q
- 2, "Invalid Length of %u", ssa_len
);
10492 switch (ssa_type
) {
10493 case BGP_SSA_L2TPv3
:
10494 proto_tree_add_item(subtree3
, hf_bgp_ssa_l2tpv3_pref
, tvb
,
10495 q
+ 4, 2, ENC_BIG_ENDIAN
);
10497 subtree4
= proto_tree_add_subtree(subtree3
, tvb
, q
+ 6, 1, ett_bgp_ssa_subtree
, NULL
, "Flags");
10498 proto_tree_add_item(subtree4
, hf_bgp_ssa_l2tpv3_s
, tvb
,
10499 q
+ 6, 1, ENC_BIG_ENDIAN
);
10500 proto_tree_add_item(subtree4
, hf_bgp_ssa_l2tpv3_unused
, tvb
,
10501 q
+ 6, 1, ENC_BIG_ENDIAN
);
10503 ssa_v3_len
= tvb_get_uint8(tvb
, q
+ 7);
10504 if (ssa_v3_len
+ 8 == ssa_len
){
10505 proto_tree_add_item(subtree3
, hf_bgp_ssa_l2tpv3_cookie_len
, tvb
,
10506 q
+ 7, 1, ENC_BIG_ENDIAN
);
10508 proto_tree_add_expert_format(subtree3
, pinfo
, &ei_bgp_length_invalid
, tvb
, q
+ 7, 1,
10509 "Invalid Cookie Length of %u", ssa_v3_len
);
10510 q
+= ssa_len
+ 4; /* 4 from type and length */
10513 proto_tree_add_item(subtree3
, hf_bgp_ssa_l2tpv3_session_id
, tvb
,
10514 q
+ 8, 4, ENC_BIG_ENDIAN
);
10516 proto_tree_add_item(subtree3
, hf_bgp_ssa_l2tpv3_cookie
, tvb
,
10517 q
+ 12, ssa_v3_len
, ENC_NA
);
10518 q
+= ssa_len
+ 4; /* 4 from type and length */
10521 case BGP_SSA_IPSec
:
10524 proto_tree_add_item(subtree3
, hf_bgp_ssa_value
, tvb
,
10525 q
+ 4, ssa_len
, ENC_NA
);
10526 q
+= ssa_len
+ 4; /* 4 from type and length */
10528 case BGP_SSA_L2TPv3_IN_IPSec
:
10529 case BGP_SSA_mGRE_IN_IPSec
:
10530 /* These contain BGP_SSA_IPSec and BGP_SSA_L2TPv3/BGP_SSA_mGRE */
10531 q
+= 4; /* 4 from type and length */
10533 } /* switch (bgpa.bgpa_type) */
10536 case BGPTYPE_TUNNEL_ENCAPS_ATTR
:
10538 end
= o
+ i
+ aoff
+ tlen
;
10540 subtree3
= proto_tree_add_subtree(subtree2
, tvb
, q
, tlen
, ett_bgp_tunnel_tlv
, NULL
, "TLV Encodings");
10543 encaps_tunnel_type
= tvb_get_ntohs(tvb
, q
);
10544 encaps_tunnel_len
= tvb_get_ntohs(tvb
, q
+ 2);
10546 subtree4
= proto_tree_add_subtree_format(subtree3
, tvb
, q
, encaps_tunnel_len
+ 4,
10547 ett_bgp_tunnel_tlv_subtree
, NULL
, "%s (%u bytes)",
10548 val_to_str_const(encaps_tunnel_type
, bgp_attr_tunnel_type
, "Unknown"), encaps_tunnel_len
+ 4);
10550 proto_tree_add_item(subtree4
, hf_bgp_update_encaps_tunnel_tlv_type
, tvb
, q
, 2, ENC_BIG_ENDIAN
);
10551 proto_tree_add_item(subtree4
, hf_bgp_update_encaps_tunnel_tlv_len
, tvb
, q
+ 2, 2, ENC_BIG_ENDIAN
);
10553 subtree5
= proto_tree_add_subtree(subtree4
, tvb
, q
+ 4, encaps_tunnel_len
, ett_bgp_tunnel_subtlv
, NULL
, "Sub-TLV Encodings");
10556 j
= q
+ encaps_tunnel_len
;
10558 encaps_tunnel_subtype
= tvb_get_uint8(tvb
, q
);
10559 if (encaps_tunnel_subtype
< 128) {
10560 encaps_tunnel_sublen
= tvb_get_uint8(tvb
, q
+ 1);
10561 encaps_tunnel_sub_totallen
= encaps_tunnel_sublen
+ 2;
10563 encaps_tunnel_sublen
= tvb_get_ntohs(tvb
, q
+ 1);
10564 encaps_tunnel_sub_totallen
= encaps_tunnel_sublen
+ 3;
10566 subtree6
= proto_tree_add_subtree_format(subtree5
, tvb
, q
, encaps_tunnel_sub_totallen
,
10567 ett_bgp_tunnel_tlv_subtree
, NULL
, "%s (%u bytes)",
10568 val_to_str_const(encaps_tunnel_subtype
, subtlv_type
, "Unknown"), encaps_tunnel_sub_totallen
);
10569 proto_tree_add_item(subtree6
, hf_bgp_update_encaps_tunnel_subtlv_type
, tvb
, q
, 1, ENC_BIG_ENDIAN
);
10571 if (encaps_tunnel_subtype
< 128) {
10572 proto_tree_add_item(subtree6
, hf_bgp_update_encaps_tunnel_subtlv_len
, tvb
, q
, 1, ENC_BIG_ENDIAN
);
10575 proto_tree_add_item(subtree6
, hf_bgp_update_encaps_tunnel_subtlv_len
, tvb
, q
, 2, ENC_BIG_ENDIAN
);
10579 switch (encaps_tunnel_subtype
) {
10580 case TUNNEL_SUBTLV_ENCAPSULATION
:
10582 static int * const vxlan_flags
[] = {
10583 &hf_bgp_update_encaps_tunnel_subtlv_vxlan_flags_valid_vnid
,
10584 &hf_bgp_update_encaps_tunnel_subtlv_vxlan_flags_valid_mac
,
10585 &hf_bgp_update_encaps_tunnel_subtlv_vxlan_flags_reserved
,
10588 static int * const vxlan_gpe_flags
[] = {
10589 &hf_bgp_update_encaps_tunnel_subtlv_vxlan_gpe_flags_version
,
10590 &hf_bgp_update_encaps_tunnel_subtlv_vxlan_gpe_flags_valid_vnid
,
10591 &hf_bgp_update_encaps_tunnel_subtlv_vxlan_gpe_flags_reserved
,
10594 static int * const nvgre_flags
[] = {
10595 &hf_bgp_update_encaps_tunnel_subtlv_nvgre_flags_valid_vnid
,
10596 &hf_bgp_update_encaps_tunnel_subtlv_nvgre_flags_valid_mac
,
10597 &hf_bgp_update_encaps_tunnel_subtlv_nvgre_flags_reserved
,
10600 if (encaps_tunnel_type
== TUNNEL_TYPE_L2TP_OVER_IP
) {
10601 proto_tree_add_item(subtree6
, hf_bgp_update_encaps_tunnel_subtlv_session_id
, tvb
, q
, 4, ENC_BIG_ENDIAN
);
10603 proto_tree_add_item(subtree6
, hf_bgp_update_encaps_tunnel_subtlv_cookie
, tvb
, q
, encaps_tunnel_sublen
- 4, ENC_NA
);
10604 q
+= (encaps_tunnel_sublen
- 4);
10605 } else if (encaps_tunnel_type
== TUNNEL_TYPE_GRE
|| encaps_tunnel_type
== TUNNEL_TYPE_MPLS_IN_GRE
) {
10606 proto_tree_add_item(subtree6
, hf_bgp_update_encaps_tunnel_subtlv_gre_key
, tvb
, q
, 4, ENC_BIG_ENDIAN
);
10608 } else if (encaps_tunnel_type
== TUNNEL_TYPE_VXLAN
) {
10609 proto_tree_add_bitmask(subtree6
, tvb
, q
, hf_bgp_update_encaps_tunnel_subtlv_vxlan_flags
,
10610 ett_bgp_vxlan
, vxlan_flags
, ENC_BIG_ENDIAN
);
10612 proto_tree_add_item(subtree6
, hf_bgp_update_encaps_tunnel_subtlv_vxlan_vnid
, tvb
, q
, 3, ENC_BIG_ENDIAN
);
10614 proto_tree_add_item(subtree6
, hf_bgp_update_encaps_tunnel_subtlv_vxlan_mac
, tvb
, q
, 6, ENC_NA
);
10616 proto_tree_add_item(subtree6
, hf_bgp_update_encaps_tunnel_subtlv_vxlan_reserved
, tvb
, q
, 2, ENC_BIG_ENDIAN
);
10618 } else if (encaps_tunnel_type
== TUNNEL_TYPE_VXLAN_GPE
) {
10619 proto_tree_add_bitmask(subtree6
, tvb
, q
, hf_bgp_update_encaps_tunnel_subtlv_vxlan_gpe_flags
,
10620 ett_bgp_vxlan
, vxlan_gpe_flags
, ENC_BIG_ENDIAN
);
10622 proto_tree_add_item(subtree6
, hf_bgp_update_encaps_tunnel_subtlv_vxlan_gpe_reserved
, tvb
, q
, 2, ENC_BIG_ENDIAN
);
10624 proto_tree_add_item(subtree6
, hf_bgp_update_encaps_tunnel_subtlv_vxlan_gpe_vnid
, tvb
, q
, 3, ENC_BIG_ENDIAN
);
10626 proto_tree_add_item(subtree6
, hf_bgp_update_encaps_tunnel_subtlv_vxlan_gpe_reserved
, tvb
, q
, 1, ENC_BIG_ENDIAN
);
10628 } else if (encaps_tunnel_type
== TUNNEL_TYPE_NVGRE
) {
10629 proto_tree_add_bitmask(subtree6
, tvb
, q
, hf_bgp_update_encaps_tunnel_subtlv_nvgre_flags
,
10630 ett_bgp_vxlan
, nvgre_flags
, ENC_BIG_ENDIAN
);
10632 proto_tree_add_item(subtree6
, hf_bgp_update_encaps_tunnel_subtlv_nvgre_vnid
, tvb
, q
, 3, ENC_BIG_ENDIAN
);
10634 proto_tree_add_item(subtree6
, hf_bgp_update_encaps_tunnel_subtlv_nvgre_mac
, tvb
, q
, 6, ENC_NA
);
10636 proto_tree_add_item(subtree6
, hf_bgp_update_encaps_tunnel_subtlv_nvgre_reserved
, tvb
, q
, 2, ENC_BIG_ENDIAN
);
10641 case TUNNEL_SUBTLV_PROTO_TYPE
:
10642 proto_tree_add_item(subtree6
, hf_bgp_update_encaps_tunnel_subtlv_gre_key
, tvb
, q
, 2, ENC_BIG_ENDIAN
);
10645 case TUNNEL_SUBTLV_COLOR
:
10646 proto_tree_add_item(subtree6
, hf_bgp_update_encaps_tunnel_subtlv_color_value
, tvb
, q
, 4, ENC_BIG_ENDIAN
);
10649 case TUNNEL_SUBTLV_LOAD_BALANCE
:
10650 if (encaps_tunnel_type
== TUNNEL_TYPE_L2TP_OVER_IP
|| encaps_tunnel_type
== TUNNEL_TYPE_GRE
) {
10651 proto_tree_add_item(subtree6
, hf_bgp_update_encaps_tunnel_subtlv_lb_block_length
, tvb
, q
, 4, ENC_BIG_ENDIAN
);
10655 case TUNNEL_SUBTLV_PREFERENCE
:
10656 proto_tree_add_item(subtree6
, hf_bgp_update_encaps_tunnel_subtlv_pref_flags
, tvb
, q
, 1, ENC_BIG_ENDIAN
);
10658 proto_tree_add_item(subtree6
, hf_bgp_update_encaps_tunnel_subtlv_pref_reserved
, tvb
, q
, 1, ENC_BIG_ENDIAN
);
10660 proto_tree_add_item(subtree6
, hf_bgp_update_encaps_tunnel_subtlv_pref_preference
, tvb
, q
, 4, ENC_NA
);
10663 case TUNNEL_SUBTLV_BINDING_SID
:
10665 static int * const flags
[] = {
10666 &hf_bgp_update_encaps_tunnel_subtlv_binding_sid_flags_specified
,
10667 &hf_bgp_update_encaps_tunnel_subtlv_binding_sid_flags_invalid
,
10668 &hf_bgp_update_encaps_tunnel_subtlv_binding_sid_flags_reserved
,
10672 proto_tree_add_bitmask(subtree6
, tvb
, q
, hf_bgp_update_encaps_tunnel_subtlv_binding_sid_flags
,
10673 ett_bgp_binding_sid
, flags
, ENC_BIG_ENDIAN
);
10675 proto_tree_add_item(subtree6
, hf_bgp_update_encaps_tunnel_subtlv_binding_sid_reserved
,
10676 tvb
, q
, 1, ENC_BIG_ENDIAN
);
10678 if (encaps_tunnel_sublen
> 2) {
10679 proto_tree_add_item(subtree6
, hf_bgp_update_encaps_tunnel_subtlv_binding_sid_sid
, tvb
, q
,
10680 encaps_tunnel_sublen
- 2, ENC_NA
);
10681 q
+= (encaps_tunnel_sublen
- 2);
10685 case TUNNEL_SUBTLV_ENLP
:
10686 proto_tree_add_item(subtree6
, hf_bgp_update_encaps_tunnel_subtlv_enlp_flags
, tvb
, q
, 1, ENC_BIG_ENDIAN
);
10688 proto_tree_add_item(subtree6
, hf_bgp_update_encaps_tunnel_subtlv_enlp_reserved
, tvb
, q
, 1, ENC_BIG_ENDIAN
);
10690 proto_tree_add_item(subtree6
, hf_bgp_update_encaps_tunnel_subtlv_enlp_enlp
, tvb
, q
, 1, ENC_BIG_ENDIAN
);
10693 case TUNNEL_SUBTLV_PRIORITY
:
10694 proto_tree_add_item(subtree6
, hf_bgp_update_encaps_tunnel_subtlv_priority_priority
, tvb
, q
, 1, ENC_BIG_ENDIAN
);
10696 proto_tree_add_item(subtree6
, hf_bgp_update_encaps_tunnel_subtlv_priority_reserved
, tvb
, q
, 1, ENC_BIG_ENDIAN
);
10699 case TUNNEL_SUBTLV_SEGMENT_LIST
:
10701 static int * const flags
[] = {
10702 &hf_bgp_update_encaps_tunnel_subtlv_segment_list_subtlv_flags_verification
,
10703 &hf_bgp_update_encaps_tunnel_subtlv_segment_list_subtlv_flags_algorithm
,
10704 &hf_bgp_update_encaps_tunnel_subtlv_segment_list_subtlv_flags_reserved
,
10708 proto_tree_add_item(subtree6
, hf_bgp_update_encaps_tunnel_subtlv_segment_list_reserved
, tvb
, q
, 1, ENC_BIG_ENDIAN
);
10710 ti
= proto_tree_add_item(subtree6
, hf_bgp_update_encaps_tunnel_subtlv_segment_list_subtlv
, tvb
, q
,
10711 encaps_tunnel_sublen
- 1, ENC_NA
);
10712 encaps_tunnel_sublen
-= 1;
10713 subtree7
= proto_item_add_subtree(ti
, ett_bgp_segment_list
);
10714 while (encaps_tunnel_sublen
> 2) {
10715 segment_subtlv_type
= tvb_get_uint8(tvb
, q
);
10716 segment_subtlv_length
= tvb_get_uint8(tvb
, q
+ 1);
10717 subtree8
= proto_tree_add_subtree_format(subtree7
, tvb
, q
, segment_subtlv_length
+ 2,
10718 ett_bgp_segment_list
, NULL
, "SubTLV: %s", val_to_str_const(segment_subtlv_type
,
10719 bgp_sr_policy_list_type
, "Unknown"));
10720 proto_tree_add_item(subtree8
, hf_bgp_update_encaps_tunnel_subtlv_segment_list_subtlv_type
, tvb
, q
, 1, ENC_BIG_ENDIAN
);
10722 proto_tree_add_item(subtree8
, hf_bgp_update_encaps_tunnel_subtlv_segment_list_subtlv_length
, tvb
, q
, 1, ENC_BIG_ENDIAN
);
10724 if (segment_subtlv_length
> 0) {
10725 switch(segment_subtlv_type
) {
10726 /* TODO: Dissect further subTLVs data as defined in draft-ietf-idr-segment-routing-te-policy-08 section 2.4.3.2 */
10727 case TUNNEL_SUBTLV_SEGMENT_LIST_SUB_TYPE_A
:
10728 proto_tree_add_bitmask(subtree8
, tvb
, q
, hf_bgp_update_encaps_tunnel_subtlv_segment_list_subtlv_flags
,
10729 ett_bgp_segment_list
, flags
, ENC_BIG_ENDIAN
);
10731 proto_tree_add_item(subtree8
, hf_bgp_update_encaps_tunnel_subtlv_segment_list_subtlv_reserved
,
10732 tvb
, q
, 1, ENC_NA
);
10734 proto_tree_add_item(subtree8
, hf_bgp_update_encaps_tunnel_subtlv_segment_list_subtlv_mpls_label
,
10735 tvb
, q
, 3, ENC_BIG_ENDIAN
);
10736 proto_tree_add_item(subtree8
, hf_bgp_update_encaps_tunnel_subtlv_segment_list_subtlv_traffic_class
,
10737 tvb
, q
, 3, ENC_BIG_ENDIAN
);
10738 proto_tree_add_item(subtree8
, hf_bgp_update_encaps_tunnel_subtlv_segment_list_subtlv_bottom_stack
,
10739 tvb
, q
, 3, ENC_BIG_ENDIAN
);
10741 proto_tree_add_item(subtree8
, hf_bgp_update_encaps_tunnel_subtlv_segment_list_subtlv_ttl
,
10742 tvb
, q
, 1, ENC_BIG_ENDIAN
);
10746 proto_tree_add_item(subtree8
, hf_bgp_update_encaps_tunnel_subtlv_segment_list_subtlv_data
,
10747 tvb
, q
, segment_subtlv_length
, ENC_NA
);
10748 q
+= segment_subtlv_length
;
10752 encaps_tunnel_sublen
-= (segment_subtlv_length
+ 2);
10756 case TUNNEL_SUBTLV_POLICY_NAME
:
10757 proto_tree_add_item(subtree6
, hf_bgp_update_encaps_tunnel_subtlv_policy_name_reserved
, tvb
, q
, 1, ENC_BIG_ENDIAN
);
10759 proto_tree_add_item(subtree6
, hf_bgp_update_encaps_tunnel_subtlv_policy_name_name
, tvb
, q
,
10760 encaps_tunnel_sublen
- 1, ENC_ASCII
);
10761 q
+= (encaps_tunnel_sublen
- 1);
10764 proto_tree_add_item(subtree6
, hf_bgp_update_encaps_tunnel_subtlv_value
, tvb
, q
, encaps_tunnel_sublen
, ENC_NA
);
10765 q
+= encaps_tunnel_sublen
;
10767 } /* switch (encaps_tunnel_subtype) */
10773 ti
= proto_tree_add_item(subtree2
, hf_bgp_update_path_attribute_aigp
, tvb
, q
, tlen
, ENC_NA
);
10774 subtree3
= proto_item_add_subtree(ti
, ett_bgp_aigp_attr
);
10775 aigp_type_item
= proto_tree_add_item(subtree3
, hf_bgp_aigp_type
, tvb
, q
, 1, ENC_BIG_ENDIAN
);
10776 aigp_type
= tvb_get_uint8(tvb
,q
);
10777 switch (aigp_type
) {
10778 case AIGP_TLV_TYPE
:
10779 proto_tree_add_item(subtree3
, hf_bgp_aigp_tlv_length
, tvb
, q
+1, 2, ENC_BIG_ENDIAN
);
10780 proto_tree_add_item(subtree3
, hf_bgp_aigp_accu_igp_metric
, tvb
, q
+3, 8, ENC_BIG_ENDIAN
);
10781 proto_item_append_text(ti
, ": %" PRIu64
, tvb_get_ntoh64(tvb
, q
+3));
10782 proto_item_append_text(ti_pa
, ": %" PRIu64
, tvb_get_ntoh64(tvb
, q
+3));
10785 expert_add_info_format(pinfo
, aigp_type_item
, &ei_bgp_attr_aigp_type
,
10786 "AIGP type %u unknown", aigp_type
);
10789 case BGPTYPE_LINK_STATE_ATTR
:
10790 case BGPTYPE_LINK_STATE_OLD_ATTR
:
10792 end
= o
+ i
+ aoff
+ tlen
;
10793 /* FF: BGPTYPE_LINK_STATE_ATTR body dissection is moved after the while.
10794 Here we just save the TLV coordinates and the subtree. */
10795 save_link_state_attr_position(pinfo
, q
, end
, tlen
, subtree2
);
10798 case BGPTYPE_LARGE_COMMUNITY
:
10799 if(tlen
== 0 || tlen
% 12){
10804 wmem_strbuf_t
*comm_strbuf
;
10805 comm_strbuf
= wmem_strbuf_create(pinfo
->pool
);
10807 uint32_t ga
, ldp1
, ldp2
;
10808 ga
= tvb_get_ntohl(tvb
, q
);
10809 ldp1
= tvb_get_ntohl(tvb
, q
+4);
10810 ldp2
= tvb_get_ntohl(tvb
, q
+8);
10811 ti
= proto_tree_add_string_format(subtree2
, hf_bgp_large_communities
, tvb
, q
, 12, NULL
, "Large communities: %u:%u:%u", ga
, ldp1
, ldp2
);
10812 subtree3
= proto_item_add_subtree(ti
, ett_bgp_large_communities
);
10813 proto_tree_add_item(subtree3
, hf_bgp_large_communities_ga
, tvb
,
10814 q
, 4, ENC_BIG_ENDIAN
);
10815 proto_tree_add_item(subtree3
, hf_bgp_large_communities_ldp1
, tvb
,
10816 q
+ 4, 4, ENC_BIG_ENDIAN
);
10817 proto_tree_add_item(subtree3
, hf_bgp_large_communities_ldp2
, tvb
,
10818 q
+ 8, 4, ENC_BIG_ENDIAN
);
10819 wmem_strbuf_append_printf(comm_strbuf
, " %u:%u:%u", ga
, ldp1
, ldp2
);
10823 proto_item_append_text(ti_pa
, ":%s", wmem_strbuf_get_str(comm_strbuf
));
10826 case BGPTYPE_BGPSEC_PATH
:
10829 secpathlen
= tvb_get_ntohs(tvb
, q
); /* Secure Path Length */
10831 if (((secpathlen
- 2) % SEC_PATH_SEG_SIZE
) != 0) { /* SEC_PATH_SEG_SIZE = 6 */
10832 proto_tree_add_expert_format(subtree2
, pinfo
, &ei_bgp_length_invalid
, tvb
, o
+ i
+ aoff
, alen
,
10833 "Invalid BGPsec Secure Path length: %u bytes", secpathlen
);
10836 subtree3
= proto_tree_add_subtree_format(subtree2
, tvb
, q
, secpathlen
,
10837 ett_bgp_bgpsec_secure_path
,
10839 "Secure Path (%d byte%s)",
10841 plurality(secpathlen
, "", "s"));
10843 /* Secure Path Length */
10844 proto_tree_add_item(subtree3
, hf_bgp_update_path_attribute_bgpsec_sp_len
, tvb
, q
, 2, ENC_BIG_ENDIAN
);
10847 secpathcount
= (secpathlen
- 2) / SEC_PATH_SEG_SIZE
; /* Amount of Secure Path Segments */
10849 while (j
< secpathcount
) {
10850 subtree4
= proto_tree_add_subtree_format(subtree3
, tvb
, q
, SEC_PATH_SEG_SIZE
,
10851 ett_bgp_bgpsec_secure_path_segment
,
10853 "Secure Path Segment (%d byte%s)",
10855 plurality(SEC_PATH_SEG_SIZE
, "", "s"));
10858 proto_tree_add_item(subtree4
, hf_bgp_update_path_attribute_bgpsec_sps_pcount
, tvb
,
10859 q
, 1, ENC_BIG_ENDIAN
);
10863 proto_tree_add_item(subtree4
, hf_bgp_update_path_attribute_bgpsec_sps_flags
, tvb
,
10864 q
, 1, ENC_BIG_ENDIAN
);
10868 proto_tree_add_item(subtree4
, hf_bgp_update_path_attribute_bgpsec_sps_as
, tvb
,
10869 q
, 4, ENC_BIG_ENDIAN
);
10874 sigblocklen
= tvb_get_ntohs(tvb
, q
); /* Signature Block Length */
10876 subtree3
= proto_tree_add_subtree_format(subtree2
, tvb
, q
, sigblocklen
,
10877 ett_bgp_bgpsec_signature_block
,
10879 "Signature Block (%d byte%s)",
10881 plurality(sigblocklen
, "", "s"));
10883 /* Signature Block Length */
10884 proto_tree_add_item(subtree3
, hf_bgp_update_path_attribute_bgpsec_sb_len
, tvb
, q
, 2, ENC_BIG_ENDIAN
);
10887 /* Algorithm Suite ID */
10888 proto_tree_add_item(subtree3
, hf_bgp_update_path_attribute_bgpsec_algo_id
, tvb
, q
, 1, ENC_BIG_ENDIAN
);
10892 sig_len
= tvb_get_ntohs(tvb
, q
+20); /* Signature Length of current Segment */
10894 subtree4
= proto_tree_add_subtree_format(subtree3
, tvb
, q
, 22+sig_len
,
10895 ett_bgp_bgpsec_signature_segment
,
10897 "Signature Segment (%d byte%s)",
10899 plurality(22+sig_len
, "", "s"));
10901 /* Subject Key Identifier */
10902 proto_tree_add_item(subtree4
, hf_bgp_update_path_attribute_bgpsec_ski
, tvb
,
10906 /* Signature Length */
10907 proto_tree_add_item(subtree4
, hf_bgp_update_path_attribute_bgpsec_sig_len
, tvb
,
10908 q
, 2, ENC_BIG_ENDIAN
);
10912 proto_tree_add_item(subtree4
, hf_bgp_update_path_attribute_bgpsec_sig
, tvb
,
10913 q
, sig_len
, ENC_NA
);
10918 case BGPTYPE_BGP_PREFIX_SID
:
10921 proto_item
*tlv_item
, *stlv_item
, *sstlv_item
;
10922 proto_tree
*tlv_tree
, *stlv_tree
, *sstlv_tree
;
10923 proto_item
*srgb_tlv_item
;
10924 proto_tree
*srgb_tlv_tree
;
10925 proto_item
*srv6_stlv_item
;
10926 proto_tree
*srv6_stlv_tree
;
10927 proto_item
*srv6_data_sstlv_item
;
10928 proto_tree
*srv6_data_sstlv_tree
;
10929 int sub_pnt
, sub_end
;
10930 int sub_sub_pnt
, sub_sub_end
;
10932 prefix_sid_subtype
= tvb_get_uint8(tvb
, q
);
10933 prefix_sid_sublen
= tvb_get_ntohs(tvb
, q
+ 1);
10934 switch (prefix_sid_subtype
) {
10935 case BGP_PREFIX_SID_TLV_LABEL_INDEX
:
10936 tlv_item
= proto_tree_add_item(subtree2
, hf_bgp_prefix_sid_label_index
, tvb
, q
, prefix_sid_sublen
+ 3, ENC_NA
);
10937 tlv_tree
= proto_item_add_subtree(tlv_item
, ett_bgp_prefix_sid_label_index
);
10938 proto_tree_add_item(tlv_tree
, hf_bgp_prefix_sid_type
, tvb
, q
, 1, ENC_BIG_ENDIAN
);
10939 proto_tree_add_item(tlv_tree
, hf_bgp_prefix_sid_length
, tvb
, q
+ 1, 2, ENC_BIG_ENDIAN
);
10940 if (prefix_sid_sublen
!= BGP_PREFIX_SID_TLV_LEN_LABEL_INDEX
){
10941 proto_tree_add_expert_format(subtree2
, pinfo
, &ei_bgp_length_invalid
, tvb
, o
+ i
+ aoff
, alen
,
10942 "Invalid BGP Prefix-SID Label Index length: %u bytes", prefix_sid_sublen
);
10943 q
+= 3 + prefix_sid_sublen
;
10946 proto_tree_add_item(tlv_tree
, hf_bgp_prefix_sid_reserved
, tvb
, q
+ 3, 1, ENC_NA
);
10947 proto_tree_add_item(tlv_tree
, hf_bgp_prefix_sid_label_index_flags
, tvb
, q
+ 4, 2, ENC_BIG_ENDIAN
);
10948 proto_tree_add_item(tlv_tree
, hf_bgp_prefix_sid_label_index_value
, tvb
, q
+ 6, 4, ENC_BIG_ENDIAN
);
10949 proto_item_append_text(tlv_tree
, ": %u ", tvb_get_ntohl(tvb
, q
+ 6));
10952 case BGP_PREFIX_SID_TLV_ORIGINATOR_SRGB
:
10953 check_srgb
= prefix_sid_sublen
- 2;
10954 prefix_sid_sub_tlv_offset
= 0;
10955 tlv_item
= proto_tree_add_item(subtree2
, hf_bgp_prefix_sid_originator_srgb
, tvb
, q
, prefix_sid_sublen
+ 3, ENC_NA
);
10956 tlv_tree
= proto_item_add_subtree(tlv_item
, ett_bgp_prefix_sid_originator_srgb
);
10957 proto_tree_add_item(tlv_tree
, hf_bgp_prefix_sid_type
, tvb
, q
, 1, ENC_BIG_ENDIAN
);
10958 proto_tree_add_item(tlv_tree
, hf_bgp_prefix_sid_length
, tvb
, q
+ 1, 2, ENC_BIG_ENDIAN
);
10959 if(check_srgb
% 3 || check_srgb
% 2){
10960 proto_tree_add_expert_format(subtree2
, pinfo
, &ei_bgp_length_invalid
, tvb
, o
+ i
+ aoff
, alen
,
10961 "Invalid BGP Prefix-SID SRGB Originator length: %u bytes", prefix_sid_sublen
);
10962 q
+= 3 + prefix_sid_sublen
;
10965 proto_tree_add_item(tlv_tree
, hf_bgp_prefix_sid_originator_srgb_flags
, tvb
, q
+ 3, 2, ENC_BIG_ENDIAN
);
10967 tlv_item
= proto_tree_add_item(tlv_tree
, hf_bgp_prefix_sid_originator_srgb_blocks
, tvb
, q
, prefix_sid_sublen
- 2, ENC_NA
);
10968 tlv_tree
= proto_item_add_subtree(tlv_item
, ett_bgp_prefix_sid_originator_srgb_blocks
);
10969 while (prefix_sid_sublen
> prefix_sid_sub_tlv_offset
+ 2) {
10970 srgb_tlv_item
= proto_tree_add_item(tlv_tree
, hf_bgp_prefix_sid_originator_srgb_block
, tvb
, q
, prefix_sid_sublen
- 2, ENC_NA
);
10971 srgb_tlv_tree
= proto_item_add_subtree(srgb_tlv_item
, ett_bgp_prefix_sid_originator_srgb_block
);
10972 prefix_sid_sub_tlv_offset
+= 3;
10973 proto_tree_add_item(srgb_tlv_tree
, hf_bgp_prefix_sid_originator_srgb_base
, tvb
, q
+ prefix_sid_sub_tlv_offset
, 3, ENC_BIG_ENDIAN
);
10974 prefix_sid_sub_tlv_offset
+= 3;
10975 proto_tree_add_item(srgb_tlv_tree
, hf_bgp_prefix_sid_originator_srgb_range
, tvb
, q
+ prefix_sid_sub_tlv_offset
, 3, ENC_BIG_ENDIAN
);
10976 proto_item_append_text(srgb_tlv_tree
, "(%u:%u)", tvb_get_ntoh24(tvb
, q
+ prefix_sid_sub_tlv_offset
- 3),
10977 tvb_get_ntoh24(tvb
, q
+ prefix_sid_sub_tlv_offset
));
10979 q
+= 3 + prefix_sid_sublen
;
10981 case BGP_PREFIX_SID_TLV_SRV6_L3_SERVICE
:
10982 tlv_item
= proto_tree_add_item(subtree2
, hf_bgp_prefix_sid_srv6_l3vpn
, tvb
, q
, prefix_sid_sublen
+ 3, ENC_NA
);
10983 tlv_tree
= proto_item_add_subtree(tlv_item
, ett_bgp_prefix_sid_srv6_l3vpn
);
10984 proto_tree_add_item(tlv_tree
, hf_bgp_prefix_sid_type
, tvb
, q
, 1, ENC_BIG_ENDIAN
);
10985 proto_tree_add_item(tlv_tree
, hf_bgp_prefix_sid_length
, tvb
, q
+ 1, 2, ENC_BIG_ENDIAN
);
10986 proto_tree_add_item(tlv_tree
, hf_bgp_prefix_sid_reserved
, tvb
, q
+ 3, 1, ENC_NA
);
10988 srv6_stlv_item
= proto_tree_add_item(tlv_tree
, hf_bgp_prefix_sid_srv6_l3vpn_sub_tlvs
, tvb
, q
+ 4, prefix_sid_sublen
- 1, ENC_NA
);
10989 srv6_stlv_tree
= proto_item_add_subtree(srv6_stlv_item
, ett_bgp_prefix_sid_srv6_l3vpn_sub_tlvs
);
10992 sub_end
= q
+ 3 + prefix_sid_sublen
;
10993 while (sub_pnt
< sub_end
) {
10994 srv6_service_subtlv_type
= tvb_get_uint8(tvb
, sub_pnt
);
10995 srv6_service_subtlv_len
= tvb_get_ntohs(tvb
, sub_pnt
+ 1);
10997 switch (srv6_service_subtlv_type
) {
10998 case SRV6_SERVICE_SRV6_SID_INFORMATION
:
10999 stlv_item
= proto_tree_add_item(srv6_stlv_tree
,
11000 hf_bgp_prefix_sid_srv6_l3vpn_sub_tlv
,
11001 tvb
, sub_pnt
, srv6_service_subtlv_len
+ 3, ENC_NA
);
11002 proto_item_append_text(stlv_item
, " - %s",
11003 val_to_str(srv6_service_subtlv_type
, srv6_service_sub_tlv_type
, "Unknown (%u)"));
11004 stlv_tree
= proto_item_add_subtree(stlv_item
, ett_bgp_prefix_sid_srv6_l3vpn_sid_information
);
11006 proto_tree_add_item(stlv_tree
, hf_bgp_prefix_sid_srv6_l3vpn_sub_tlv_type
, tvb
, sub_pnt
, 1, ENC_BIG_ENDIAN
);
11007 proto_tree_add_item(stlv_tree
, hf_bgp_prefix_sid_srv6_l3vpn_sub_tlv_length
, tvb
, sub_pnt
+ 1, 2, ENC_BIG_ENDIAN
);
11008 proto_tree_add_item(stlv_tree
, hf_bgp_prefix_sid_srv6_l3vpn_sub_tlv_reserved
, tvb
, sub_pnt
+ 3, 1, ENC_NA
);
11009 proto_tree_add_item(stlv_tree
, hf_bgp_prefix_sid_srv6_l3vpn_sid_value
, tvb
, sub_pnt
+ 4, 16, ENC_NA
);
11010 proto_tree_add_item(stlv_tree
, hf_bgp_prefix_sid_srv6_l3vpn_sid_flags
, tvb
, sub_pnt
+ 20, 1, ENC_NA
);
11011 proto_tree_add_item(stlv_tree
, hf_bgp_prefix_sid_srv6_l3vpn_srv6_endpoint_behavior
, tvb
, sub_pnt
+ 21, 2, ENC_NA
);
11012 proto_tree_add_item(stlv_tree
, hf_bgp_prefix_sid_srv6_l3vpn_reserved
, tvb
, sub_pnt
+ 23, 1, ENC_NA
);
11014 srv6_data_sstlv_item
= proto_tree_add_item(stlv_tree
,
11015 hf_bgp_prefix_sid_srv6_l3vpn_sub_sub_tlvs
,
11016 tvb
, sub_pnt
+ 24, srv6_service_subtlv_len
- 21, ENC_NA
);
11017 srv6_data_sstlv_tree
= proto_item_add_subtree(srv6_data_sstlv_item
, ett_bgp_prefix_sid_srv6_l3vpn_sub_sub_tlvs
);
11019 sub_sub_pnt
= sub_pnt
+ 24;
11020 sub_sub_end
= sub_pnt
+ 3 + srv6_service_subtlv_len
;
11021 while (sub_sub_pnt
< sub_sub_end
) {
11022 srv6_service_data_subsubtlv_type
= tvb_get_uint8(tvb
, sub_sub_pnt
);
11023 srv6_service_data_subsubtlv_len
= tvb_get_ntohs(tvb
, sub_sub_pnt
+ 1);
11025 switch (srv6_service_data_subsubtlv_type
) {
11026 case SRV6_SERVICE_DATA_SRV6_SID_STRUCTURE
:
11027 sstlv_item
= proto_tree_add_item(srv6_data_sstlv_tree
,
11028 hf_bgp_prefix_sid_srv6_l3vpn_sub_sub_tlv
,
11029 tvb
, sub_sub_pnt
, srv6_service_data_subsubtlv_len
+ 3, ENC_NA
);
11030 proto_item_append_text(sstlv_item
, " - %s",
11031 val_to_str(srv6_service_data_subsubtlv_type
, srv6_service_data_sub_sub_tlv_type
, "Unknown (%u)"));
11032 sstlv_tree
= proto_item_add_subtree(sstlv_item
, ett_bgp_prefix_sid_srv6_l3vpn_sid_structure
);
11034 proto_tree_add_item(sstlv_tree
, hf_bgp_prefix_sid_srv6_l3vpn_sub_sub_tlv_type
, tvb
, sub_sub_pnt
, 1, ENC_BIG_ENDIAN
);
11035 proto_tree_add_item(sstlv_tree
, hf_bgp_prefix_sid_srv6_l3vpn_sub_sub_tlv_length
, tvb
, sub_sub_pnt
+ 1, 2, ENC_BIG_ENDIAN
);
11036 proto_tree_add_item(sstlv_tree
, hf_bgp_prefix_sid_srv6_l3vpn_sid_locator_block_len
, tvb
, sub_sub_pnt
+ 3, 1, ENC_BIG_ENDIAN
);
11037 proto_tree_add_item(sstlv_tree
, hf_bgp_prefix_sid_srv6_l3vpn_sid_locator_node_len
, tvb
, sub_sub_pnt
+ 4, 1, ENC_BIG_ENDIAN
);
11038 proto_tree_add_item(sstlv_tree
, hf_bgp_prefix_sid_srv6_l3vpn_sid_func_len
, tvb
, sub_sub_pnt
+ 5, 1, ENC_BIG_ENDIAN
);
11039 proto_tree_add_item(sstlv_tree
, hf_bgp_prefix_sid_srv6_l3vpn_sid_arg_len
, tvb
, sub_sub_pnt
+ 6, 1, ENC_BIG_ENDIAN
);
11040 proto_tree_add_item(sstlv_tree
, hf_bgp_prefix_sid_srv6_l3vpn_sid_trans_len
, tvb
, sub_sub_pnt
+ 7, 1, ENC_BIG_ENDIAN
);
11041 proto_tree_add_item(sstlv_tree
, hf_bgp_prefix_sid_srv6_l3vpn_sid_trans_offset
, tvb
, sub_sub_pnt
+ 8, 1, ENC_BIG_ENDIAN
);
11044 sstlv_item
= proto_tree_add_item(srv6_data_sstlv_tree
,
11045 hf_bgp_prefix_sid_srv6_l3vpn_sub_sub_tlv
,
11046 tvb
, sub_sub_pnt
, srv6_service_data_subsubtlv_len
+ 3, ENC_NA
);
11047 proto_item_append_text(sstlv_item
, " - %s",
11048 val_to_str(srv6_service_data_subsubtlv_type
, srv6_service_data_sub_sub_tlv_type
, "Unknown (%u)"));
11049 sstlv_tree
= proto_item_add_subtree(sstlv_item
, ett_bgp_prefix_sid_srv6_l3vpn_sid_unknown
);
11051 proto_tree_add_item(sstlv_tree
, hf_bgp_prefix_sid_srv6_l3vpn_sub_sub_tlv_type
, tvb
, sub_sub_pnt
, 1, ENC_BIG_ENDIAN
);
11052 proto_tree_add_item(sstlv_tree
, hf_bgp_prefix_sid_srv6_l3vpn_sub_sub_tlv_length
, tvb
, sub_sub_pnt
+ 1, 2, ENC_BIG_ENDIAN
);
11053 proto_tree_add_item(sstlv_tree
, hf_bgp_prefix_sid_srv6_l3vpn_sub_sub_tlv_value
, tvb
, sub_sub_pnt
+ 3, srv6_service_data_subsubtlv_len
, ENC_NA
);
11056 sub_sub_pnt
+= 3 + srv6_service_data_subsubtlv_len
;
11060 stlv_item
= proto_tree_add_item(srv6_stlv_tree
,
11061 hf_bgp_prefix_sid_srv6_l3vpn_sub_tlv
,
11062 tvb
, sub_pnt
, srv6_service_subtlv_len
+ 3, ENC_NA
);
11063 proto_item_append_text(stlv_item
, " - %s", val_to_str(srv6_service_subtlv_type
, srv6_service_sub_tlv_type
, "Unknown (%u)"));
11064 stlv_tree
= proto_item_add_subtree(stlv_item
, ett_bgp_prefix_sid_srv6_l3vpn_unknown
);
11066 proto_tree_add_item(stlv_tree
, hf_bgp_prefix_sid_srv6_l3vpn_sub_tlv_type
, tvb
, sub_pnt
, 1, ENC_BIG_ENDIAN
);
11067 proto_tree_add_item(stlv_tree
, hf_bgp_prefix_sid_srv6_l3vpn_sub_tlv_length
, tvb
, sub_pnt
+ 1, 2, ENC_BIG_ENDIAN
);
11068 proto_tree_add_item(stlv_tree
, hf_bgp_prefix_sid_srv6_l3vpn_sub_tlv_value
, tvb
, sub_pnt
+ 3, srv6_service_subtlv_len
, ENC_NA
);
11071 sub_pnt
+= 3 + srv6_service_subtlv_len
;
11073 q
+= (3 + prefix_sid_sublen
);
11075 case BGP_PREFIX_SID_TLV_SRV6_L2_SERVICE
:
11076 tlv_item
= proto_tree_add_item(subtree2
, hf_bgp_prefix_sid_srv6_l2vpn
, tvb
, q
, prefix_sid_sublen
+ 3, ENC_NA
);
11077 tlv_tree
= proto_item_add_subtree(tlv_item
, ett_bgp_prefix_sid_srv6_l2vpn
);
11078 proto_tree_add_item(tlv_tree
, hf_bgp_prefix_sid_type
, tvb
, q
, 1, ENC_BIG_ENDIAN
);
11079 proto_tree_add_item(tlv_tree
, hf_bgp_prefix_sid_length
, tvb
, q
+ 1, 2, ENC_BIG_ENDIAN
);
11080 proto_tree_add_item(tlv_tree
, hf_bgp_prefix_sid_reserved
, tvb
, q
+ 3, 1, ENC_NA
);
11082 srv6_stlv_item
= proto_tree_add_item(tlv_tree
, hf_bgp_prefix_sid_srv6_l2vpn_sub_tlvs
, tvb
, q
+ 4, prefix_sid_sublen
- 1, ENC_NA
);
11083 srv6_stlv_tree
= proto_item_add_subtree(srv6_stlv_item
, ett_bgp_prefix_sid_srv6_l2vpn_sub_tlvs
);
11086 sub_end
= q
+ 3 + prefix_sid_sublen
;
11087 while (sub_pnt
< sub_end
) {
11088 srv6_service_subtlv_type
= tvb_get_uint8(tvb
, sub_pnt
);
11089 srv6_service_subtlv_len
= tvb_get_ntohs(tvb
, sub_pnt
+ 1);
11091 switch (srv6_service_subtlv_type
) {
11092 case SRV6_SERVICE_SRV6_SID_INFORMATION
:
11093 stlv_item
= proto_tree_add_item(srv6_stlv_tree
,
11094 hf_bgp_prefix_sid_srv6_l2vpn_sub_tlv
,
11095 tvb
, sub_pnt
, srv6_service_subtlv_len
+ 3, ENC_NA
);
11096 proto_item_append_text(stlv_item
, " - %s",
11097 val_to_str(srv6_service_subtlv_type
, srv6_service_sub_tlv_type
, "Unknown (%u)"));
11098 stlv_tree
= proto_item_add_subtree(stlv_item
, ett_bgp_prefix_sid_srv6_l2vpn_sid_information
);
11100 proto_tree_add_item(stlv_tree
, hf_bgp_prefix_sid_srv6_l2vpn_sub_tlv_type
, tvb
, sub_pnt
, 1, ENC_BIG_ENDIAN
);
11101 proto_tree_add_item(stlv_tree
, hf_bgp_prefix_sid_srv6_l2vpn_sub_tlv_length
, tvb
, sub_pnt
+ 1, 2, ENC_BIG_ENDIAN
);
11102 proto_tree_add_item(stlv_tree
, hf_bgp_prefix_sid_srv6_l2vpn_sub_tlv_reserved
, tvb
, sub_pnt
+ 3, 1, ENC_NA
);
11103 proto_tree_add_item(stlv_tree
, hf_bgp_prefix_sid_srv6_l2vpn_sid_value
, tvb
, sub_pnt
+ 4, 16, ENC_NA
);
11104 proto_tree_add_item(stlv_tree
, hf_bgp_prefix_sid_srv6_l2vpn_sid_flags
, tvb
, sub_pnt
+ 20, 1, ENC_NA
);
11105 proto_tree_add_item(stlv_tree
, hf_bgp_prefix_sid_srv6_l2vpn_srv6_endpoint_behavior
, tvb
, sub_pnt
+ 21, 2, ENC_NA
);
11106 proto_tree_add_item(stlv_tree
, hf_bgp_prefix_sid_srv6_l2vpn_reserved
, tvb
, sub_pnt
+ 23, 1, ENC_NA
);
11108 srv6_data_sstlv_item
= proto_tree_add_item(stlv_tree
,
11109 hf_bgp_prefix_sid_srv6_l2vpn_sub_sub_tlvs
,
11110 tvb
, sub_pnt
+ 24, srv6_service_subtlv_len
- 21, ENC_NA
);
11111 srv6_data_sstlv_tree
= proto_item_add_subtree(srv6_data_sstlv_item
, ett_bgp_prefix_sid_srv6_l2vpn_sub_sub_tlvs
);
11113 sub_sub_pnt
= sub_pnt
+ 24;
11114 sub_sub_end
= sub_pnt
+ 3 + srv6_service_subtlv_len
;
11115 while (sub_sub_pnt
< sub_sub_end
) {
11116 srv6_service_data_subsubtlv_type
= tvb_get_uint8(tvb
, sub_sub_pnt
);
11117 srv6_service_data_subsubtlv_len
= tvb_get_ntohs(tvb
, sub_sub_pnt
+ 1);
11119 switch (srv6_service_data_subsubtlv_type
) {
11120 case SRV6_SERVICE_DATA_SRV6_SID_STRUCTURE
:
11121 sstlv_item
= proto_tree_add_item(srv6_data_sstlv_tree
,
11122 hf_bgp_prefix_sid_srv6_l2vpn_sub_sub_tlv
,
11123 tvb
, sub_sub_pnt
, srv6_service_data_subsubtlv_len
+ 3, ENC_NA
);
11124 proto_item_append_text(sstlv_item
, " - %s",
11125 val_to_str(srv6_service_data_subsubtlv_type
, srv6_service_data_sub_sub_tlv_type
, "Unknown (%u)"));
11126 sstlv_tree
= proto_item_add_subtree(sstlv_item
, ett_bgp_prefix_sid_srv6_l2vpn_sid_structure
);
11128 proto_tree_add_item(sstlv_tree
, hf_bgp_prefix_sid_srv6_l2vpn_sub_sub_tlv_type
, tvb
, sub_sub_pnt
, 1, ENC_BIG_ENDIAN
);
11129 proto_tree_add_item(sstlv_tree
, hf_bgp_prefix_sid_srv6_l2vpn_sub_sub_tlv_length
, tvb
, sub_sub_pnt
+ 1, 2, ENC_BIG_ENDIAN
);
11130 proto_tree_add_item(sstlv_tree
, hf_bgp_prefix_sid_srv6_l2vpn_sid_locator_block_len
, tvb
, sub_sub_pnt
+ 3, 1, ENC_BIG_ENDIAN
);
11131 proto_tree_add_item(sstlv_tree
, hf_bgp_prefix_sid_srv6_l2vpn_sid_locator_node_len
, tvb
, sub_sub_pnt
+ 4, 1, ENC_BIG_ENDIAN
);
11132 proto_tree_add_item(sstlv_tree
, hf_bgp_prefix_sid_srv6_l2vpn_sid_func_len
, tvb
, sub_sub_pnt
+ 5, 1, ENC_BIG_ENDIAN
);
11133 proto_tree_add_item(sstlv_tree
, hf_bgp_prefix_sid_srv6_l2vpn_sid_arg_len
, tvb
, sub_sub_pnt
+ 6, 1, ENC_BIG_ENDIAN
);
11134 proto_tree_add_item(sstlv_tree
, hf_bgp_prefix_sid_srv6_l2vpn_sid_trans_len
, tvb
, sub_sub_pnt
+ 7, 1, ENC_BIG_ENDIAN
);
11135 proto_tree_add_item(sstlv_tree
, hf_bgp_prefix_sid_srv6_l2vpn_sid_trans_offset
, tvb
, sub_sub_pnt
+ 8, 1, ENC_BIG_ENDIAN
);
11138 sstlv_item
= proto_tree_add_item(srv6_data_sstlv_tree
,
11139 hf_bgp_prefix_sid_srv6_l2vpn_sub_sub_tlv
,
11140 tvb
, sub_sub_pnt
, srv6_service_data_subsubtlv_len
+ 3, ENC_NA
);
11141 proto_item_append_text(sstlv_item
, " - %s",
11142 val_to_str(srv6_service_data_subsubtlv_type
, srv6_service_data_sub_sub_tlv_type
, "Unknown (%u)"));
11143 sstlv_tree
= proto_item_add_subtree(sstlv_item
, ett_bgp_prefix_sid_srv6_l2vpn_sid_unknown
);
11145 proto_tree_add_item(sstlv_tree
, hf_bgp_prefix_sid_srv6_l2vpn_sub_sub_tlv_type
, tvb
, sub_sub_pnt
, 1, ENC_BIG_ENDIAN
);
11146 proto_tree_add_item(sstlv_tree
, hf_bgp_prefix_sid_srv6_l2vpn_sub_sub_tlv_length
, tvb
, sub_sub_pnt
+ 1, 2, ENC_BIG_ENDIAN
);
11147 proto_tree_add_item(sstlv_tree
, hf_bgp_prefix_sid_srv6_l2vpn_sub_sub_tlv_value
, tvb
, sub_sub_pnt
+ 3, srv6_service_data_subsubtlv_len
, ENC_NA
);
11150 sub_sub_pnt
+= 3 + srv6_service_data_subsubtlv_len
;
11154 stlv_item
= proto_tree_add_item(srv6_stlv_tree
,
11155 hf_bgp_prefix_sid_srv6_l2vpn_sub_tlv
,
11156 tvb
, sub_pnt
, srv6_service_subtlv_len
+ 3, ENC_NA
);
11157 proto_item_append_text(stlv_item
, " - %s", val_to_str(srv6_service_subtlv_type
, srv6_service_sub_tlv_type
, "Unknown (%u)"));
11158 stlv_tree
= proto_item_add_subtree(stlv_item
, ett_bgp_prefix_sid_srv6_l2vpn_unknown
);
11160 proto_tree_add_item(stlv_tree
, hf_bgp_prefix_sid_srv6_l2vpn_sub_tlv_type
, tvb
, sub_pnt
, 1, ENC_BIG_ENDIAN
);
11161 proto_tree_add_item(stlv_tree
, hf_bgp_prefix_sid_srv6_l2vpn_sub_tlv_length
, tvb
, sub_pnt
+ 1, 2, ENC_BIG_ENDIAN
);
11162 proto_tree_add_item(stlv_tree
, hf_bgp_prefix_sid_srv6_l2vpn_sub_tlv_value
, tvb
, sub_pnt
+ 3, srv6_service_subtlv_len
, ENC_NA
);
11165 sub_pnt
+= 3 + srv6_service_subtlv_len
;
11167 q
+= (3 + prefix_sid_sublen
);
11170 tlv_item
= proto_tree_add_item(subtree2
, hf_bgp_prefix_sid_unknown
, tvb
, q
, prefix_sid_sublen
+ 3, ENC_NA
);
11171 proto_item_append_text(tlv_item
, " (%s)", val_to_str(prefix_sid_subtype
, bgp_prefix_sid_type
, "%u"));
11172 tlv_tree
= proto_item_add_subtree(tlv_item
, ett_bgp_prefix_sid_unknown
);
11173 proto_tree_add_item(tlv_tree
, hf_bgp_prefix_sid_type
, tvb
, q
, 1, ENC_BIG_ENDIAN
);
11174 proto_tree_add_item(tlv_tree
, hf_bgp_prefix_sid_length
, tvb
, q
+ 1, 2, ENC_BIG_ENDIAN
);
11175 proto_tree_add_item(tlv_tree
, hf_bgp_prefix_sid_value
, tvb
, q
+ 3, prefix_sid_sublen
- 3, ENC_NA
);
11176 q
+= (3 + prefix_sid_sublen
);
11181 case BGPTYPE_PMSI_TUNNEL_ATTR
:
11182 dissect_bgp_update_pmsi_attr(pinfo
, subtree2
, tvb
, tlen
, o
+i
+aoff
);
11185 case BGPTYPE_ATTR_SET
:
11187 proto_tree_add_item(subtree2
, hf_bgp_update_path_attribute_attrset_origin_as
, tvb
,
11188 o
+ i
+ aoff
, 4, ENC_BIG_ENDIAN
);
11190 ti
= proto_tree_add_item(subtree2
, hf_bgp_update_path_attributes
, tvb
, o
+i
+aoff
+4, alen
-4, ENC_NA
);
11191 attr_set_subtree
= proto_item_add_subtree(ti
, ett_bgp_attrs
);
11192 dissect_bgp_path_attr(attr_set_subtree
, tvb
, alen
-4, o
+i
+aoff
+4, pinfo
);
11195 proto_tree_add_expert_format(subtree2
, pinfo
, &ei_bgp_length_invalid
, tvb
, o
+ i
+ aoff
, alen
,
11196 "Attribute set (invalid): %u byte%s",
11197 alen
, plurality(alen
, "", "s"));
11202 proto_tree_add_expert_format(subtree2
, pinfo
, &ei_bgp_length_invalid
, tvb
, o
+ i
+ aoff
, tlen
,
11203 "Only to Customer (invalid): %u byte%s", tlen
,
11204 plurality(tlen
, "", "s"));
11206 proto_tree_add_item(subtree2
, hf_bgp_update_path_attribute_otc
, tvb
,
11207 o
+ i
+ aoff
, tlen
, ENC_BIG_ENDIAN
);
11208 proto_item_append_text(ti_pa
, ": %u", tvb_get_ntohl(tvb
, o
+ i
+ aoff
));
11211 case BGPTYPE_D_PATH
:
11213 proto_tree_add_expert_format(subtree2
, pinfo
, &ei_bgp_length_invalid
, tvb
, o
+ i
+ aoff
, tlen
,
11214 "D-PATH attribute has invalid length (invalid): %u byte%s", tlen
,
11215 plurality(tlen
, "", "s"));
11220 wmem_strbuf_t
*dpath_strbuf
;
11221 dpath_strbuf
= wmem_strbuf_create(pinfo
->pool
);
11223 dpath_len
= tvb_get_uint8(tvb
, q
);
11224 proto_tree_add_item(subtree2
, hf_bgp_d_path_length
, tvb
,
11225 q
, 1, ENC_BIG_ENDIAN
);
11227 while (dpath_len
> 0 && q
< end
) {
11230 ad
= tvb_get_ntohl(tvb
, q
);
11231 ld
= tvb_get_ntohs(tvb
, q
+4);
11232 ti
= proto_tree_add_string_format(subtree2
, hf_bgp_update_path_attribute_d_path
, tvb
, q
, 6, NULL
, "Domain ID: %u:%u", ad
, ld
);
11233 subtree3
= proto_item_add_subtree(ti
, ett_bgp_dpath
);
11234 proto_tree_add_item(subtree3
, hf_bgp_d_path_ga
, tvb
,
11235 q
, 4, ENC_BIG_ENDIAN
);
11236 proto_tree_add_item(subtree3
, hf_bgp_d_path_la
, tvb
,
11237 q
+ 4, 2, ENC_BIG_ENDIAN
);
11238 wmem_strbuf_append_printf(dpath_strbuf
, " %u:%u", ad
, ld
);
11242 if (dpath_len
!= 0 || q
>= end
) {
11243 proto_tree_add_expert_format(subtree2
, pinfo
, &ei_bgp_length_invalid
, tvb
, o
+ i
+ aoff
, tlen
,
11244 "D-PATH list (invalid): %u byte%s", tlen
,
11245 plurality(tlen
, "", "s"));
11248 proto_item_append_text(ti_pa
, ":%s", wmem_strbuf_get_str(dpath_strbuf
));
11250 proto_tree_add_item(subtree2
, hf_bgp_d_path_isf_safi
, tvb
,
11251 q
, 1, ENC_BIG_ENDIAN
);
11254 proto_tree_add_item(subtree2
, hf_bgp_update_path_attributes_unknown
, tvb
, o
+ i
+ aoff
, tlen
, ENC_NA
);
11256 } /* switch (bgpa.bgpa_type) */ /* end of second switch */
11260 decrement_dissection_depth(pinfo
);
11262 /* FF: postponed BGPTYPE_LINK_STATE_ATTR dissection */
11263 link_state_data
*data
= load_link_state_data(pinfo
);
11264 if (data
&& data
->link_state_attr_present
) {
11265 ti
= proto_tree_add_item(data
->subtree2
, hf_bgp_update_path_attribute_link_state
, tvb
, data
->ostart
, data
->tlen
, ENC_NA
);
11266 subtree3
= proto_item_add_subtree(ti
, ett_bgp_link_state
);
11267 while (data
->ostart
< data
->oend
) {
11268 advance
= decode_link_state_attribute_tlv(subtree3
, tvb
, data
->ostart
, pinfo
, data
->protocol_id
);
11272 data
->ostart
+= advance
;
11278 * Dissect a BGP UPDATE message.
11281 dissect_bgp_update(tvbuff_t
*tvb
, proto_tree
*tree
, packet_info
*pinfo
)
11283 uint16_t hlen
; /* message length */
11284 int o
; /* packet offset */
11285 int end
=0; /* message end */
11286 uint16_t len
; /* tmp */
11287 proto_item
*ti
; /* tree item */
11288 proto_tree
*subtree
; /* subtree for attributes */
11291 hlen
= tvb_get_ntohs(tvb
, BGP_MARKER_SIZE
);
11292 o
= BGP_HEADER_SIZE
;
11295 /* check for withdrawals */
11296 len
= tvb_get_ntohs(tvb
, o
);
11297 proto_tree_add_item(tree
, hf_bgp_update_withdrawn_routes_length
, tvb
, o
, 2, ENC_BIG_ENDIAN
);
11300 /* parse unfeasible prefixes */
11302 ti
= proto_tree_add_item(tree
, hf_bgp_update_withdrawn_routes
, tvb
, o
, len
, ENC_NA
);
11303 subtree
= proto_item_add_subtree(ti
, ett_bgp_unfeas
);
11305 /* parse each prefix */
11308 /* Heuristic to detect if IPv4 prefix are using Path Identifiers */
11309 if( detect_add_path_prefix4(tvb
, o
, end
) ) {
11310 /* IPv4 prefixes with Path Id */
11312 i
= decode_path_prefix4(subtree
, pinfo
, hf_bgp_nlri_path_id
, hf_bgp_withdrawn_prefix
, tvb
, o
,
11313 "Withdrawn route");
11320 i
= decode_prefix4(subtree
, pinfo
, NULL
, hf_bgp_withdrawn_prefix
, tvb
, o
,
11321 "Withdrawn route");
11329 /* check for advertisements */
11330 len
= tvb_get_ntohs(tvb
, o
);
11331 proto_tree_add_item(tree
, hf_bgp_update_total_path_attribute_length
, tvb
, o
, 2, ENC_BIG_ENDIAN
);
11333 /* path attributes */
11335 ti
= proto_tree_add_item(tree
, hf_bgp_update_path_attributes
, tvb
, o
+2, len
, ENC_NA
);
11336 subtree
= proto_item_add_subtree(ti
, ett_bgp_attrs
);
11338 dissect_bgp_path_attr(subtree
, tvb
, len
, o
+2, pinfo
);
11345 /* parse prefixes */
11347 ti
= proto_tree_add_item(tree
, hf_bgp_update_nlri
, tvb
, o
, len
, ENC_NA
);
11348 subtree
= proto_item_add_subtree(ti
, ett_bgp_nlri
);
11351 * Heuristic to detect if IPv4 prefix are using Path Identifiers
11352 * we need at least 5 bytes for Add-path prefixes
11354 if( len
> 4 && detect_add_path_prefix4(tvb
, o
, end
) ) {
11355 /* IPv4 prefixes with Path Id */
11357 i
= decode_path_prefix4(subtree
, pinfo
, hf_bgp_nlri_path_id
, hf_bgp_nlri_prefix
, tvb
, o
,
11364 /* Standard prefixes */
11366 i
= decode_prefix4(subtree
, pinfo
, NULL
, hf_bgp_nlri_prefix
, tvb
, o
, "NLRI");
11377 * Dissect a BGP CAPABILITY message.
11380 dissect_bgp_capability(tvbuff_t
*tvb
, proto_tree
*tree
, packet_info
*pinfo
)
11385 mend
= offset
+ tvb_get_ntohs(tvb
, offset
+ BGP_MARKER_SIZE
);
11386 offset
+= BGP_HEADER_SIZE
;
11387 /* step through all of the capabilities */
11388 while (offset
< mend
) {
11389 offset
= dissect_bgp_capability_item(tvb
, tree
, pinfo
, offset
, true);
11394 * Dissect a BGP NOTIFICATION message.
11397 dissect_bgp_notification(tvbuff_t
*tvb
, proto_tree
*tree
, packet_info
*pinfo
)
11399 int hlen
; /* message length */
11401 unsigned major_error
;
11404 uint8_t minor_cease
;
11407 hlen
= tvb_get_ntohs(tvb
, BGP_MARKER_SIZE
);
11408 offset
= BGP_MARKER_SIZE
+ 2 + 1;
11411 /* print error code */
11412 proto_tree_add_item(tree
, hf_bgp_notify_major_error
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
11413 major_error
= tvb_get_uint8(tvb
, offset
);
11416 switch(major_error
){
11417 case BGP_MAJOR_ERROR_MSG_HDR
:
11418 proto_tree_add_item(tree
, hf_bgp_notify_minor_msg_hdr
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
11420 case BGP_MAJOR_ERROR_OPEN_MSG
:
11421 proto_tree_add_item(tree
, hf_bgp_notify_minor_open_msg
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
11423 case BGP_MAJOR_ERROR_UPDATE_MSG
:
11424 proto_tree_add_item(tree
,hf_bgp_notify_minor_update_msg
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
11426 case BGP_MAJOR_ERROR_HT_EXPIRED
:
11427 proto_tree_add_item(tree
, hf_bgp_notify_minor_ht_expired
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
11429 case BGP_MAJOR_ERROR_STATE_MACHINE
:
11430 proto_tree_add_item(tree
, hf_bgp_notify_minor_state_machine
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
11432 case BGP_MAJOR_ERROR_CEASE
:
11433 proto_tree_add_item(tree
, hf_bgp_notify_minor_cease
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
11435 case BGP_MAJOR_ERROR_ROUTE_REFRESH
:
11436 proto_tree_add_item(tree
, hf_bgp_notify_minor_rr_msg
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
11439 ti
= proto_tree_add_item(tree
, hf_bgp_notify_minor_unknown
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
11440 expert_add_info_format(pinfo
, ti
, &ei_bgp_notify_minor_unknown
, "Unknown notification error (%d)",major_error
);
11445 /* only print if there is optional data */
11446 if (hlen
> BGP_MIN_NOTIFICATION_MSG_SIZE
) {
11447 minor_cease
= tvb_get_uint8(tvb
, offset
- 1);
11448 clen
= tvb_get_uint8(tvb
, offset
);
11449 /* Might be a idr-shutdown communication, first byte is length */
11450 if (hlen
- BGP_MIN_NOTIFICATION_MSG_SIZE
- 1 == clen
&& major_error
== BGP_MAJOR_ERROR_CEASE
&&
11451 (minor_cease
== BGP_CEASE_MINOR_ADMIN_SHUTDOWN
|| minor_cease
== BGP_CEASE_MINOR_ADMIN_RESET
) ) {
11452 proto_tree_add_item(tree
, hf_bgp_notify_communication_length
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
11454 proto_tree_add_item(tree
, hf_bgp_notify_communication
, tvb
, offset
, clen
, ENC_UTF_8
);
11455 /* otherwise just dump the hex data */
11456 } else if ( major_error
== BGP_MAJOR_ERROR_OPEN_MSG
&& minor_cease
== 7 ) {
11457 while (offset
< hlen
) {
11458 offset
= dissect_bgp_capability_item(tvb
, tree
, pinfo
, offset
, false);
11460 } else if (major_error
== BGP_MAJOR_ERROR_OPEN_MSG
&& minor_cease
== 2 ) { /* Display Bad Peer AS Number */
11461 proto_tree_add_item(tree
, hf_bgp_notify_error_open_bad_peer_as
, tvb
, offset
, hlen
- BGP_MIN_NOTIFICATION_MSG_SIZE
, ENC_NA
);
11463 proto_tree_add_item(tree
, hf_bgp_notify_data
, tvb
, offset
, hlen
- BGP_MIN_NOTIFICATION_MSG_SIZE
, ENC_NA
);
11469 * Dissect a BGP ROUTE-REFRESH message.
11472 dissect_bgp_route_refresh(tvbuff_t
*tvb
, proto_tree
*tree
, packet_info
*pinfo
)
11474 int p
; /* tvb offset counter */
11475 int pend
; /* end of list of entries for one orf type */
11476 uint16_t hlen
; /* tvb RR msg length */
11477 proto_item
*ti
; /* tree item */
11478 proto_item
*ti1
; /* tree item */
11479 proto_tree
*subtree
; /* tree for orf */
11480 proto_tree
*subtree1
; /* tree for orf entry */
11481 uint8_t orftype
; /* ORF Type */
11482 uint16_t orflen
; /* ORF len */
11483 uint8_t entryflag
; /* ORF Entry flag: action(add,del,delall) match(permit,deny) */
11484 int entrylen
; /* ORF Entry length */
11485 int advance
; /* tmp */
11493 00 01 00 01 afi,safi= ipv4-unicast
11494 02 80 00 01 defer, prefix-orf, len=1
11498 00 01 00 01 afi,saif= ipv4-unicast
11499 01 80 00 0a immediate, prefix-orf, len=10
11501 00 00 00 05 seqno = 5
11504 10 07 02 prefix = 7.2.0.0/16
11509 hlen
= tvb_get_ntohs(tvb
, BGP_MARKER_SIZE
);
11510 p
= BGP_HEADER_SIZE
;
11513 proto_tree_add_item_ret_uint(tree
, hf_bgp_route_refresh_afi
, tvb
, p
, 2, ENC_BIG_ENDIAN
, &afi
);
11516 /* Subtype in draft-ietf-idr-bgp-enhanced-route-refresh-02 (for Enhanced Route Refresh Capability) before Reserved*/
11517 proto_tree_add_item(tree
, hf_bgp_route_refresh_subtype
, tvb
, p
, 1, ENC_BIG_ENDIAN
);
11521 proto_tree_add_item_ret_uint(tree
, hf_bgp_route_refresh_safi
, tvb
, p
, 1, ENC_BIG_ENDIAN
, &safi
);
11523 save_afi_safi_data(pinfo
, (uint16_t)afi
, (uint8_t)safi
);
11525 if ( hlen
== BGP_HEADER_SIZE
+ 4 )
11530 ti
= proto_tree_add_item(tree
, hf_bgp_route_refresh_orf
, tvb
, p
, 4, ENC_NA
);
11531 subtree
= proto_item_add_subtree(ti
, ett_bgp_orf
);
11533 proto_tree_add_item(subtree
, hf_bgp_route_refresh_orf_flag
, tvb
, p
, 1, ENC_BIG_ENDIAN
);
11536 ti1
= proto_tree_add_item(subtree
, hf_bgp_route_refresh_orf_type
, tvb
, p
, 1, ENC_BIG_ENDIAN
);
11537 orftype
= tvb_get_uint8(tvb
, p
);
11540 proto_tree_add_item(subtree
, hf_bgp_route_refresh_orf_length
, tvb
, p
, 2, ENC_BIG_ENDIAN
);
11541 orflen
= tvb_get_ntohs(tvb
, p
);
11542 proto_item_set_len(ti
, orflen
+ 4);
11545 if (orftype
!= BGP_ORF_PREFIX_CISCO
) {
11546 expert_add_info_format(pinfo
, ti1
, &ei_bgp_route_refresh_orf_type_unknown
, "ORFEntry-Unknown (type %u)", orftype
);
11553 ti1
= proto_tree_add_item(subtree
, hf_bgp_route_refresh_orf_entry_prefixlist
, tvb
, p
, 1, ENC_NA
);
11554 subtree1
= proto_item_add_subtree(ti1
, ett_bgp_orf_entry
);
11555 proto_tree_add_item(subtree1
, hf_bgp_route_refresh_orf_entry_action
, tvb
, p
, 1, ENC_BIG_ENDIAN
);
11556 entryflag
= tvb_get_uint8(tvb
, p
);
11557 if (((entryflag
& BGP_ORF_ACTION
) >> 6) == BGP_ORF_REMOVEALL
) {
11561 proto_tree_add_item(subtree1
, hf_bgp_route_refresh_orf_entry_match
, tvb
, p
, 1, ENC_BIG_ENDIAN
);
11564 proto_tree_add_item(subtree1
, hf_bgp_route_refresh_orf_entry_sequence
, tvb
, p
, 4, ENC_BIG_ENDIAN
);
11567 proto_tree_add_item(subtree1
, hf_bgp_route_refresh_orf_entry_prefixmask_lower
, tvb
, p
, 1, ENC_BIG_ENDIAN
);
11570 proto_tree_add_item(subtree1
, hf_bgp_route_refresh_orf_entry_prefixmask_upper
, tvb
, p
, 1, ENC_BIG_ENDIAN
);
11573 advance
= decode_prefix4(subtree1
, pinfo
, NULL
, hf_bgp_route_refresh_orf_entry_ip
, tvb
, p
, "ORF");
11576 entrylen
= 7 + 1 + advance
;
11578 proto_item_set_len(ti1
, entrylen
);
11586 dissect_bgp_pdu(tvbuff_t
*tvb
, packet_info
*pinfo
, proto_tree
*tree
,
11589 uint16_t bgp_len
; /* Message length */
11590 uint8_t bgp_type
; /* Message type */
11591 const char *typ
; /* Message type (string) */
11592 proto_item
*ti
= NULL
;
11593 proto_item
*ti_marker
= NULL
;/* marker item */
11594 proto_item
*ti_len
= NULL
; /* length item */
11595 proto_tree
*bgp_tree
= NULL
; /* BGP packet tree */
11596 static const uint8_t valid_marker
[BGP_MARKER_SIZE
] = {
11597 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
11598 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF
11601 bgp_len
= tvb_get_ntohs(tvb
, BGP_MARKER_SIZE
);
11602 bgp_type
= tvb_get_uint8(tvb
, BGP_MARKER_SIZE
+ 2);
11603 typ
= val_to_str(bgp_type
, bgptypevals
, "Unknown message type (0x%02x)");
11605 col_set_str(pinfo
->cinfo
, COL_PROTOCOL
, "BGP");
11606 col_append_sep_str(pinfo
->cinfo
, COL_INFO
, NULL
, typ
);
11609 ti
= proto_tree_add_item(tree
, proto_bgp
, tvb
, 0, -1, ENC_NA
);
11610 proto_item_append_text(ti
, " - %s", typ
);
11612 /* add a different tree for each message type */
11613 switch (bgp_type
) {
11615 bgp_tree
= proto_item_add_subtree(ti
, ett_bgp_open
);
11618 bgp_tree
= proto_item_add_subtree(ti
, ett_bgp_update
);
11620 case BGP_NOTIFICATION
:
11621 bgp_tree
= proto_item_add_subtree(ti
, ett_bgp_notification
);
11623 case BGP_KEEPALIVE
:
11624 bgp_tree
= proto_item_add_subtree(ti
, ett_bgp
);
11626 case BGP_ROUTE_REFRESH_CISCO
:
11627 case BGP_ROUTE_REFRESH
:
11628 bgp_tree
= proto_item_add_subtree(ti
, ett_bgp_route_refresh
);
11630 case BGP_CAPABILITY
:
11631 bgp_tree
= proto_item_add_subtree(ti
, ett_bgp_capability
);
11634 bgp_tree
= proto_item_add_subtree(ti
, ett_bgp
);
11638 ti_marker
= proto_tree_add_item(bgp_tree
, hf_bgp_marker
, tvb
, 0,
11639 BGP_MARKER_SIZE
, ENC_NA
);
11640 if (tvb_memeql(tvb
, 0, valid_marker
, BGP_MARKER_SIZE
) != 0) {
11641 expert_add_info(pinfo
, ti_marker
, &ei_bgp_marker_invalid
);
11644 ti_len
= proto_tree_add_item(bgp_tree
, hf_bgp_length
, tvb
, 16, 2, ENC_BIG_ENDIAN
);
11647 if (bgp_len
< BGP_HEADER_SIZE
|| bgp_len
> BGP_MAX_PACKET_SIZE
) {
11648 expert_add_info_format(pinfo
, ti_len
, &ei_bgp_length_invalid
, "Length is invalid %u", bgp_len
);
11649 return tvb_captured_length(tvb
);
11653 proto_item_set_len(ti
, bgp_len
);
11656 proto_tree_add_item(bgp_tree
, hf_bgp_type
, tvb
, 16 + 2, 1, ENC_BIG_ENDIAN
);
11658 switch (bgp_type
) {
11660 dissect_bgp_open(tvb
, bgp_tree
, pinfo
);
11663 dissect_bgp_update(tvb
, bgp_tree
, pinfo
);
11665 case BGP_NOTIFICATION
:
11666 dissect_bgp_notification(tvb
, bgp_tree
, pinfo
);
11668 case BGP_KEEPALIVE
:
11669 /* no data in KEEPALIVE messages */
11671 case BGP_ROUTE_REFRESH_CISCO
:
11672 case BGP_ROUTE_REFRESH
:
11673 dissect_bgp_route_refresh(tvb
, bgp_tree
, pinfo
);
11675 case BGP_CAPABILITY
:
11676 dissect_bgp_capability(tvb
, bgp_tree
, pinfo
);
11685 get_bgp_len(packet_info
*pinfo _U_
, tvbuff_t
*tvb
, int offset
, void *data _U_
)
11687 return tvb_get_ntohs(tvb
, offset
+ BGP_MARKER_SIZE
);
11691 * Dissect a BGP packet.
11694 dissect_bgp(tvbuff_t
*tvb
, packet_info
*pinfo
, proto_tree
*tree
, void* data _U_
)
11696 volatile int offset
= 0; /* offset into the tvbuff */
11697 static unsigned char marker
[] = { /* BGP message marker */
11698 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
11699 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
11701 proto_item
*ti
; /* tree item */
11702 proto_tree
*bgp_tree
; /* BGP packet tree */
11703 tvbuff_t
*volatile this_tvb
; /* for tcp_dissect_pdus() */
11706 * Scan through the TCP payload looking for a BGP marker.
11708 while (tvb_reported_length_remaining(tvb
, offset
) > 0) {
11710 * Start with a quick search for 0xFFFF, then do the heavier
11711 * tvb_memeql() once we find it.
11713 offset
= tvb_find_uint16(tvb
, offset
, -1, 0xFFFF);
11715 /* Didn't find even the start of a marker */
11718 else if (0 == tvb_memeql(tvb
, offset
, marker
, BGP_MARKER_SIZE
)) {
11719 /* Found the marker - stop scanning and start processing BGP packets. */
11723 /* Keep scanning through the tvbuff to try to find a marker. */
11728 col_clear(pinfo
->cinfo
, COL_INFO
);
11731 * If we skipped any bytes, mark it as a BGP continuation.
11734 ti
= proto_tree_add_item(tree
, proto_bgp
, tvb
, 0, offset
, ENC_NA
);
11735 bgp_tree
= proto_item_add_subtree(ti
, ett_bgp
);
11736 proto_item_append_text(bgp_tree
, " - Continuation");
11737 proto_tree_add_item(bgp_tree
, hf_bgp_continuation
, tvb
, 0, offset
, ENC_NA
);
11739 /* Don't include the continuation in PDU reassembly */
11740 this_tvb
= tvb_new_subset_remaining(tvb
, offset
);
11747 * Now process the BGP packets in the TCP payload.
11749 tcp_dissect_pdus(this_tvb
, pinfo
, tree
, bgp_desegment
, BGP_HEADER_SIZE
,
11750 get_bgp_len
, dissect_bgp_pdu
, NULL
);
11751 return tvb_captured_length(tvb
);
11755 * Register ourselves.
11758 proto_register_bgp(void)
11761 static hf_register_info hf
[] = {
11764 { "Marker", "bgp.marker", FT_BYTES
, BASE_NONE
,
11765 NULL
, 0x0, "Must be set to all ones (16 Bytes)", HFILL
}},
11767 { "Length", "bgp.length", FT_UINT16
, BASE_DEC
,
11768 NULL
, 0x0, "The total length of the message, including the header in octets", HFILL
}},
11769 { &hf_bgp_prefix_length
,
11770 { "Prefix Length", "bgp.prefix_length", FT_UINT8
, BASE_DEC
,
11771 NULL
, 0x0, NULL
, HFILL
}},
11773 { "Route Distinguisher", "bgp.rd", FT_STRING
, BASE_NONE
,
11774 NULL
, 0x0, NULL
, HFILL
}},
11775 { &hf_bgp_continuation
,
11776 { "Continuation", "bgp.continuation", FT_NONE
, BASE_NONE
,
11777 NULL
, 0x0, NULL
, HFILL
}},
11778 { &hf_bgp_originating_as
,
11779 { "Originating AS", "bgp.originating_as", FT_UINT32
, BASE_DEC
,
11780 NULL
, 0x0, NULL
, HFILL
}},
11781 { &hf_bgp_community_prefix
,
11782 { "Community Prefix", "bgp.community_prefix", FT_STRING
, BASE_NONE
,
11783 NULL
, 0x0, NULL
, HFILL
}},
11784 { &hf_bgp_endpoint_address
,
11785 { "Endpoint Address", "bgp.endpoint_address", FT_IPv4
, BASE_NONE
,
11786 NULL
, 0x0, NULL
, HFILL
}},
11787 { &hf_bgp_endpoint_address_ipv6
,
11788 { "Endpoint Address", "bgp.endpoint_address_ipv6", FT_IPv6
, BASE_NONE
,
11789 NULL
, 0x0, NULL
, HFILL
}},
11790 { &hf_bgp_label_stack
,
11791 { "Label Stack", "bgp.label_stack", FT_STRING
, BASE_NONE
,
11792 NULL
, 0x0, NULL
, HFILL
}},
11793 { &hf_bgp_vplsad_length
,
11794 { "Length", "bgp.vplsad.length", FT_UINT16
, BASE_DEC
,
11795 NULL
, 0x0, NULL
, HFILL
}},
11796 { &hf_bgp_vplsad_rd
,
11797 { "RD", "bgp.vplsad.rd", FT_STRING
, BASE_NONE
,
11798 NULL
, 0x0, NULL
, HFILL
}},
11799 { &hf_bgp_bgpad_pe_addr
,
11800 { "PE Addr", "bgp.ad.pe_addr", FT_IPv4
, BASE_NONE
,
11801 NULL
, 0x0, NULL
, HFILL
}},
11802 { &hf_bgp_vplsbgp_ce_id
,
11803 { "CE-ID", "bgp.vplsbgp.ce_id", FT_UINT16
, BASE_DEC
,
11804 NULL
, 0x0, NULL
, HFILL
}},
11805 { &hf_bgp_vplsbgp_labelblock_offset
,
11806 { "Label Block Offset", "bgp.vplsbgp.labelblock.offset", FT_UINT16
, BASE_DEC
,
11807 NULL
, 0x0, NULL
, HFILL
}},
11808 { &hf_bgp_vplsbgp_labelblock_size
,
11809 { "Label Block Size", "bgp.vplsbgp.labelblock.size", FT_UINT16
, BASE_DEC
,
11810 NULL
, 0x0, NULL
, HFILL
}},
11811 { &hf_bgp_vplsbgp_labelblock_base
,
11812 { "Label Block Base", "bgp.vplsbgp.labelblock.base", FT_STRING
, BASE_NONE
,
11813 NULL
, 0x0, NULL
, HFILL
}},
11814 { &hf_bgp_wildcard_route_target
,
11815 { "Wildcard route target", "bgp.wildcard_route_target", FT_STRING
, BASE_NONE
,
11816 NULL
, 0x0, NULL
, HFILL
}},
11818 { "Type", "bgp.type", FT_UINT8
, BASE_DEC
,
11819 VALS(bgptypevals
), 0x0, "BGP message type", HFILL
}},
11821 { &hf_bgp_open_version
,
11822 { "Version", "bgp.open.version", FT_UINT8
, BASE_DEC
,
11823 NULL
, 0x0, "The protocol version number", HFILL
}},
11824 { &hf_bgp_open_myas
,
11825 { "My AS", "bgp.open.myas", FT_UINT16
, BASE_DEC
,
11826 NULL
, 0x0, "The Autonomous System number of the sender", HFILL
}},
11827 { &hf_bgp_open_holdtime
,
11828 { "Hold Time", "bgp.open.holdtime", FT_UINT16
, BASE_DEC
,
11829 NULL
, 0x0, "The number of seconds the sender proposes for Hold Time", HFILL
}},
11830 { &hf_bgp_open_identifier
,
11831 { "BGP Identifier", "bgp.open.identifier", FT_IPv4
, BASE_NONE
,
11832 NULL
, 0x0, "The BGP Identifier of the sender", HFILL
}},
11833 { &hf_bgp_open_opt_len
,
11834 { "Optional Parameters Length", "bgp.open.opt.len", FT_UINT8
, BASE_DEC
,
11835 NULL
, 0x0, "The total length of the Optional Parameters field in octets", HFILL
}},
11836 { &hf_bgp_open_opt_extension
,
11837 { "Optional Parameter Extension", "bgp.open.opt.extension", FT_NONE
, BASE_NONE
,
11838 NULL
, 0x0, "Optional Parameters Extension detected", HFILL
}},
11839 { &hf_bgp_open_opt_extension_mark
,
11840 { "Extension Mark", "bgp.open.opt.extension.mark", FT_UINT8
, BASE_DEC
,
11841 NULL
, 0x0, "Optional Parameters Extension detected", HFILL
}},
11842 { &hf_bgp_open_opt_extension_len
,
11843 { "Extended Length", "bgp.open.opt.extension_len", FT_UINT16
, BASE_DEC
,
11844 NULL
, 0x0, "The total extended length of the Optional Parameters field in octets", HFILL
}},
11845 { &hf_bgp_open_opt_params
,
11846 { "Optional Parameters", "bgp.open.opt", FT_NONE
, BASE_NONE
,
11847 NULL
, 0x0, "List of optional parameters", HFILL
}},
11848 { &hf_bgp_open_opt_param
,
11849 { "Optional Parameter", "bgp.open.opt.param", FT_NONE
, BASE_NONE
,
11850 NULL
, 0x0, NULL
, HFILL
}},
11851 { &hf_bgp_open_opt_param_type
,
11852 { "Parameter Type", "bgp.open.opt.param.type", FT_UINT8
, BASE_DEC
,
11853 VALS(bgp_open_opt_vals
), 0x0, "Unambiguously identifies individual parameters", HFILL
}},
11854 { &hf_bgp_open_opt_param_len
,
11855 { "Parameter Length", "bgp.open.opt.param.len", FT_UINT8
, BASE_DEC
,
11856 NULL
, 0x0, "Length of the Parameter Value", HFILL
}},
11857 { &hf_bgp_open_opt_param_auth
,
11858 { "Authentication Data", "bgp.open.opt.param.auth", FT_BYTES
, BASE_NONE
,
11859 NULL
, 0x0, "Deprecated", HFILL
}},
11860 { &hf_bgp_open_opt_param_unknown
,
11861 { "Unknown", "bgp.open.opt.param.unknown", FT_BYTES
, BASE_NONE
,
11862 NULL
, 0x0, "Unknown Parameter", HFILL
}},
11863 /* Notification error */
11864 { &hf_bgp_notify_major_error
,
11865 { "Major error Code", "bgp.notify.major_error", FT_UINT8
, BASE_DEC
,
11866 VALS(bgpnotify_major
), 0x0, NULL
, HFILL
}},
11867 { &hf_bgp_notify_minor_msg_hdr
,
11868 { "Minor error Code (Message Header)", "bgp.notify.minor_error", FT_UINT8
, BASE_DEC
,
11869 VALS(bgpnotify_minor_msg_hdr
), 0x0, NULL
, HFILL
}},
11870 { &hf_bgp_notify_minor_open_msg
,
11871 { "Minor error Code (Open Message)", "bgp.notify.minor_error_open", FT_UINT8
, BASE_DEC
,
11872 VALS(bgpnotify_minor_open_msg
), 0x0, NULL
, HFILL
}},
11873 { &hf_bgp_notify_minor_update_msg
,
11874 { "Minor error Code (Update Message)", "bgp.notify.minor_error_update", FT_UINT8
, BASE_DEC
,
11875 VALS(bgpnotify_minor_update_msg
), 0x0, NULL
, HFILL
}},
11876 { &hf_bgp_notify_minor_ht_expired
,
11877 { "Minor error Code (Hold Timer Expired)", "bgp.notify.minor_error_expired", FT_UINT8
, BASE_DEC
,
11878 NULL
, 0x0, NULL
, HFILL
}},
11879 { &hf_bgp_notify_minor_state_machine
,
11880 { "Minor error Code (State Machine)", "bgp.notify.minor_error_state", FT_UINT8
, BASE_DEC
,
11881 VALS(bgpnotify_minor_state_machine
), 0x0, NULL
, HFILL
}},
11882 { &hf_bgp_notify_minor_cease
,
11883 { "Minor error Code (Cease)", "bgp.notify.minor_error_cease", FT_UINT8
, BASE_DEC
,
11884 VALS(bgpnotify_minor_cease
), 0x0, NULL
, HFILL
}},
11885 { &hf_bgp_notify_minor_rr_msg
,
11886 { "Minor error Code (Route-Refresh message)", "bgp.notify.minor_error_route_refresh", FT_UINT8
, BASE_DEC
,
11887 VALS(bgpnotify_minor_rr_msg
), 0x0, NULL
, HFILL
}},
11888 { &hf_bgp_notify_minor_unknown
,
11889 { "Minor error Code (Unknown)", "bgp.notify.minor_error_unknown", FT_UINT8
, BASE_DEC
,
11890 NULL
, 0x0, NULL
, HFILL
}},
11891 { &hf_bgp_notify_data
,
11892 { "Data", "bgp.notify.minor_data", FT_BYTES
, BASE_NONE
,
11893 NULL
, 0x0, NULL
, HFILL
}},
11894 { &hf_bgp_notify_error_open_bad_peer_as
,
11895 { "Bad Peer AS", "bgp.notify.error_open.bad_peer_as", FT_UINT32
, BASE_DEC
,
11896 NULL
, 0x0, NULL
, HFILL
}},
11897 { &hf_bgp_notify_communication_length
,
11898 { "BGP Shutdown Communication Length", "bgp.notify.communication_length", FT_UINT8
, BASE_DEC
,
11899 NULL
, 0x0, NULL
, HFILL
}},
11900 { &hf_bgp_notify_communication
,
11901 { "Shutdown Communication", "bgp.notify.communication", FT_STRING
, BASE_NONE
,
11902 NULL
, 0x0, NULL
, HFILL
}},
11904 /* Route Refresh */
11905 { &hf_bgp_route_refresh_afi
,
11906 { "Address family identifier (AFI)", "bgp.route_refresh.afi", FT_UINT16
, BASE_DEC
,
11907 VALS(afn_vals
), 0x0, NULL
, HFILL
}},
11908 { &hf_bgp_route_refresh_subtype
,
11909 { "Subtype", "bgp.route_refresh.subtype", FT_UINT8
, BASE_DEC
,
11910 VALS(route_refresh_subtype_vals
), 0x0, NULL
, HFILL
}},
11911 { &hf_bgp_route_refresh_safi
,
11912 { "Subsequent address family identifier (SAFI)", "bgp.route_refresh.safi", FT_UINT8
, BASE_DEC
,
11913 VALS(bgpattr_nlri_safi
), 0x0, NULL
, HFILL
}},
11914 { &hf_bgp_route_refresh_orf
,
11915 { "ORF information", "bgp.route_refresh.orf", FT_NONE
, BASE_NONE
,
11916 NULL
, 0x0, NULL
, HFILL
}},
11917 { &hf_bgp_route_refresh_orf_flag
,
11918 { "ORF flag", "bgp.route_refresh.orf.flag", FT_UINT8
, BASE_DEC
,
11919 VALS(orf_when_vals
), 0x0, NULL
, HFILL
}},
11920 { &hf_bgp_route_refresh_orf_type
,
11921 { "ORF type", "bgp.route_refresh.orf.type", FT_UINT8
, BASE_DEC
,
11922 VALS(orf_type_vals
), 0x0, NULL
, HFILL
}},
11923 { &hf_bgp_route_refresh_orf_length
,
11924 { "ORF length", "bgp.route_refresh.orf.length", FT_UINT16
, BASE_DEC
,
11925 NULL
, 0x0, NULL
, HFILL
}},
11926 { &hf_bgp_route_refresh_orf_entry_prefixlist
,
11927 { "ORFEntry PrefixList", "bgp.route_refresh.orf.entry", FT_NONE
, BASE_NONE
,
11928 NULL
, 0x0, NULL
, HFILL
}},
11929 { &hf_bgp_route_refresh_orf_entry_action
,
11930 { "ORFEntry Action", "bgp.route_refresh.orf.entry.action", FT_UINT8
, BASE_DEC
,
11931 VALS(orf_entry_action_vals
), BGP_ORF_ACTION
, NULL
, HFILL
}},
11932 { &hf_bgp_route_refresh_orf_entry_match
,
11933 { "ORFEntry Match", "bgp.route_refresh.orf.entry.match", FT_UINT8
, BASE_DEC
,
11934 VALS(orf_entry_match_vals
), BGP_ORF_MATCH
, NULL
, HFILL
}},
11935 { &hf_bgp_route_refresh_orf_entry_sequence
,
11936 { "ORFEntry Sequence", "bgp.route_refresh.orf.entry.sequence", FT_UINT32
, BASE_DEC
,
11937 NULL
, 0x0, NULL
, HFILL
}},
11938 { &hf_bgp_route_refresh_orf_entry_prefixmask_lower
,
11939 { "ORFEntry PrefixMask length lower bound", "bgp.route_refresh.orf.entry.prefixmask_lower", FT_UINT8
, BASE_DEC
,
11940 NULL
, 0x0, NULL
, HFILL
}},
11941 { &hf_bgp_route_refresh_orf_entry_prefixmask_upper
,
11942 { "ORFEntry PrefixMask length upper bound", "bgp.route_refresh.orf.entry.prefixmask_upper", FT_UINT8
, BASE_DEC
,
11943 NULL
, 0x0, NULL
, HFILL
}},
11944 { &hf_bgp_route_refresh_orf_entry_ip
,
11945 { "ORFEntry IP address", "bgp.route_refresh.orf.entry.ip", FT_IPv4
, BASE_NONE
,
11946 NULL
, 0x0, NULL
, HFILL
}},
11950 { "Capability", "bgp.cap", FT_NONE
, BASE_NONE
,
11951 NULL
, 0x0, NULL
, HFILL
}},
11952 { &hf_bgp_cap_type
,
11953 { "Type", "bgp.cap.type", FT_UINT8
, BASE_DEC
,
11954 VALS(capability_vals
), 0x0, NULL
, HFILL
}},
11955 { &hf_bgp_cap_length
,
11956 { "Length", "bgp.cap.length", FT_UINT8
, BASE_DEC
,
11957 NULL
, 0x0, NULL
, HFILL
}},
11958 { &hf_bgp_cap_action
,
11959 { "Action", "bgp.cap.action", FT_UINT8
, BASE_DEC
,
11960 VALS(bgpcap_action
), 0x0, NULL
, HFILL
}},
11961 { &hf_bgp_cap_unknown
,
11962 { "Unknown", "bgp.cap.unknown", FT_BYTES
, BASE_NONE
,
11963 NULL
, 0x0, NULL
, HFILL
}},
11964 { &hf_bgp_cap_reserved
,
11965 { "Reserved", "bgp.cap.reserved", FT_BYTES
, BASE_NONE
,
11966 NULL
, 0x0, "Must be Zero", HFILL
}},
11967 { &hf_bgp_cap_mp_afi
,
11968 { "AFI", "bgp.cap.mp.afi", FT_UINT16
, BASE_DEC
,
11969 VALS(afn_vals
), 0x0, NULL
, HFILL
}},
11970 { &hf_bgp_cap_mp_safi
,
11971 { "SAFI", "bgp.cap.mp.safi", FT_UINT8
, BASE_DEC
,
11972 VALS(bgpattr_nlri_safi
), 0x0, NULL
, HFILL
}},
11973 { &hf_bgp_cap_enh_afi
,
11974 { "AFI", "bgp.cap.enh.afi", FT_UINT16
, BASE_DEC
,
11975 VALS(afn_vals
), 0x0, NULL
, HFILL
}},
11976 { &hf_bgp_cap_enh_safi
,
11977 { "SAFI", "bgp.cap.enh.safi", FT_UINT16
, BASE_DEC
,
11978 VALS(bgpattr_nlri_safi
), 0x0, NULL
, HFILL
}},
11979 { &hf_bgp_cap_enh_nhafi
,
11980 { "Next hop AFI", "bgp.cap.enh.nhafi", FT_UINT16
, BASE_DEC
,
11981 VALS(afn_vals
), 0x0, NULL
, HFILL
}},
11982 { &hf_bgp_cap_role
,
11983 { "BGP Role", "bgp.cap.role", FT_UINT8
, BASE_DEC
,
11984 VALS(bgprole_vals
), 0x0, NULL
, HFILL
}},
11985 { &hf_bgp_cap_gr_timers
,
11986 { "Restart Timers", "bgp.cap.gr.timers", FT_UINT16
, BASE_HEX
,
11987 NULL
, 0x0, NULL
, HFILL
}},
11988 { &hf_bgp_cap_gr_timers_restart_flag
,
11989 { "Restart state", "bgp.cap.gr.timers.restart_flag", FT_BOOLEAN
, 16,
11990 TFS(&tfs_yes_no
), 0x8000, NULL
, HFILL
}},
11991 { &hf_bgp_cap_gr_timers_notification_flag
,
11992 { "Graceful notification", "bgp.cap.gr.timers.notification_flag", FT_BOOLEAN
, 16,
11993 TFS(&tfs_yes_no
), 0x4000, NULL
, HFILL
}},
11994 { &hf_bgp_cap_gr_timers_restart_time
,
11995 { "Time", "bgp.cap.gr.timers.restart_time", FT_UINT16
, BASE_DEC
,
11996 NULL
, 0x0FFF, "in us", HFILL
}},
11997 { &hf_bgp_cap_gr_afi
,
11998 { "AFI", "bgp.cap.gr.afi", FT_UINT16
, BASE_DEC
,
11999 VALS(afn_vals
), 0x0, NULL
, HFILL
}},
12000 { &hf_bgp_cap_gr_safi
,
12001 { "SAFI", "bgp.cap.gr.safi", FT_UINT8
, BASE_DEC
,
12002 VALS(bgpattr_nlri_safi
), 0x0, NULL
, HFILL
}},
12003 { &hf_bgp_cap_gr_flag
,
12004 { "Flag", "bgp.cap.gr.flag", FT_UINT8
, BASE_HEX
,
12005 NULL
, 0x0, NULL
, HFILL
}},
12006 { &hf_bgp_cap_gr_flag_pfs
,
12007 { "Preserve forwarding state", "bgp.cap.gr.flag.pfs", FT_BOOLEAN
, 8,
12008 TFS(&tfs_yes_no
), 0x80, NULL
, HFILL
}},
12010 { "AS Number", "bgp.cap.4as", FT_UINT32
, BASE_DEC
,
12011 NULL
, 0x0, NULL
, HFILL
}},
12013 { "Capability Dynamic", "bgp.cap.dc", FT_UINT8
, BASE_DEC
,
12014 VALS(capability_vals
), 0x0, NULL
, HFILL
}},
12015 { &hf_bgp_cap_ap_afi
,
12016 { "AFI", "bgp.cap.ap.afi", FT_UINT16
, BASE_DEC
,
12017 VALS(afn_vals
), 0x0, NULL
, HFILL
}},
12018 { &hf_bgp_cap_ap_safi
,
12019 { "SAFI", "bgp.cap.ap.safi", FT_UINT8
, BASE_DEC
,
12020 VALS(bgpattr_nlri_safi
), 0x0, NULL
, HFILL
}},
12021 { &hf_bgp_cap_ap_sendreceive
,
12022 { "Send/Receive", "bgp.cap.ap.sendreceive", FT_UINT8
, BASE_DEC
,
12023 VALS(orf_send_recv_vals
), 0x0, NULL
, HFILL
}},
12024 { &hf_bgp_cap_orf_afi
,
12025 { "AFI", "bgp.cap.orf.afi", FT_UINT16
, BASE_DEC
,
12026 VALS(afn_vals
), 0x0, NULL
, HFILL
}},
12027 { &hf_bgp_cap_orf_safi
,
12028 { "SAFI", "bgp.cap.orf.safi", FT_UINT8
, BASE_DEC
,
12029 VALS(bgpattr_nlri_safi
), 0x0, NULL
, HFILL
}},
12030 { &hf_bgp_cap_orf_number
,
12031 { "Number", "bgp.cap.orf.number", FT_UINT8
, BASE_DEC
,
12032 NULL
, 0x0, NULL
, HFILL
}},
12033 { &hf_bgp_cap_orf_type
,
12034 { "Type", "bgp.cap.orf.type", FT_UINT8
, BASE_DEC
,
12035 VALS(orf_type_vals
), 0x0, NULL
, HFILL
}},
12036 { &hf_bgp_cap_orf_sendreceive
,
12037 { "Send Receive", "bgp.cap.orf.sendreceive", FT_UINT8
, BASE_DEC
,
12038 VALS(orf_send_recv_vals
), 0x0, NULL
, HFILL
}},
12039 { &hf_bgp_cap_fqdn_hostname_len
,
12040 { "Hostname Length", "bgp.cap.orf.fqdn.hostname.len", FT_UINT8
, BASE_DEC
,
12041 NULL
, 0x0, NULL
, HFILL
}},
12042 { &hf_bgp_cap_fqdn_hostname
,
12043 { "Hostname", "bgp.cap.orf.fqdn.hostname", FT_STRING
, BASE_NONE
,
12044 NULL
, 0x0, NULL
, HFILL
}},
12045 { &hf_bgp_cap_fqdn_domain_name_len
,
12046 { "Domain Name Length", "bgp.cap.orf.fqdn.domain_name.len", FT_UINT8
, BASE_DEC
,
12047 NULL
, 0x0, NULL
, HFILL
}},
12048 { &hf_bgp_cap_fqdn_domain_name
,
12049 { "Domain Name", "bgp.cap.orf.fqdn.domain_name", FT_STRING
, BASE_NONE
,
12050 NULL
, 0x0, NULL
, HFILL
}},
12051 { &hf_bgp_cap_multisession_flags
,
12052 { "Flag", "bgp.cap.multisession.flags", FT_UINT8
, BASE_HEX
,
12053 NULL
, 0x0, NULL
, HFILL
}},
12054 { &hf_bgp_cap_bgpsec_flags
,
12055 { "Flag", "bgp.cap.bgpsec.flags", FT_UINT8
, BASE_HEX
,
12056 NULL
, 0x0, NULL
, HFILL
}},
12057 { &hf_bgp_cap_bgpsec_version
,
12058 { "Version", "bgp.cap.bgpsec.version", FT_UINT8
, BASE_DEC
,
12059 NULL
, 0xF0, NULL
, HFILL
}},
12060 { &hf_bgp_cap_bgpsec_sendreceive
,
12061 { "Send/Receive", "bgp.cap.bgpsec.sendreceive", FT_UINT8
, BASE_DEC
,
12062 VALS(bgpsec_send_receive_vals
), 0x8, NULL
, HFILL
}},
12063 { &hf_bgp_cap_bgpsec_reserved
,
12064 { "Reserved", "bgp.cap.bgpsec.reserved", FT_UINT8
, BASE_HEX
,
12065 NULL
, 0x7, "Must be Zero", HFILL
}},
12066 { &hf_bgp_cap_bgpsec_afi
,
12067 { "AFI", "bgp.cap.bgpsec.afi", FT_UINT16
, BASE_DEC
,
12068 VALS(afn_vals
), 0x0, NULL
, HFILL
}},
12069 { &hf_bgp_cap_soft_version_len
,
12070 { "Software Version Length", "bgp.cap.software_version.len", FT_UINT8
, BASE_DEC
,
12071 NULL
, 0x0, NULL
, HFILL
}},
12072 { &hf_bgp_cap_soft_version
,
12073 { "Software Version", "bgp.cap.software_version", FT_STRING
, BASE_NONE
,
12074 NULL
, 0x0, NULL
, HFILL
}},
12077 { &hf_bgp_update_withdrawn_routes_length
,
12078 { "Withdrawn Routes Length", "bgp.update.withdrawn_routes.length", FT_UINT16
, BASE_DEC
,
12079 NULL
, 0x0, NULL
, HFILL
}},
12080 { &hf_bgp_update_withdrawn_routes
,
12081 { "Withdrawn Routes", "bgp.update.withdrawn_routes", FT_NONE
, BASE_NONE
,
12082 NULL
, 0x0, NULL
, HFILL
}},
12084 { &hf_bgp_update_path_attribute_aggregator_as
,
12085 { "Aggregator AS", "bgp.update.path_attribute.aggregator_as", FT_UINT32
, BASE_DEC
,
12086 NULL
, 0x0, NULL
, HFILL
}},
12087 /* BGP update path attributes */
12088 { &hf_bgp_update_path_attributes
,
12089 { "Path attributes", "bgp.update.path_attributes", FT_NONE
, BASE_NONE
,
12090 NULL
, 0x0, NULL
, HFILL
}},
12091 { &hf_bgp_update_path_attributes_unknown
,
12092 { "Unknown Path attributes", "bgp.update.path_attributes.unknown", FT_NONE
, BASE_NONE
,
12093 NULL
, 0x0, NULL
, HFILL
}},
12094 { &hf_bgp_update_total_path_attribute_length
,
12095 { "Total Path Attribute Length", "bgp.update.path_attributes.length", FT_UINT16
, BASE_DEC
,
12096 NULL
, 0x0, NULL
, HFILL
}},
12097 { &hf_bgp_update_path_attribute_aggregator_origin
,
12098 { "Aggregator origin", "bgp.update.path_attribute.aggregator_origin", FT_IPv4
, BASE_NONE
,
12099 NULL
, 0x0, NULL
, HFILL
}},
12100 { &hf_bgp_update_path_attribute_as_path_segment
,
12101 { "AS Path segment", "bgp.update.path_attribute.as_path_segment", FT_NONE
, BASE_NONE
,
12102 NULL
, 0x0, NULL
, HFILL
}},
12103 { &hf_bgp_update_path_attribute_as_path_segment_type
,
12104 { "Segment type", "bgp.update.path_attribute.as_path_segment.type", FT_UINT8
, BASE_DEC
,
12105 VALS(as_segment_type
), 0x0, NULL
, HFILL
}},
12106 { &hf_bgp_update_path_attribute_as_path_segment_length
,
12107 { "Segment length (number of ASN)", "bgp.update.path_attribute.as_path_segment.length", FT_UINT8
, BASE_DEC
,
12108 NULL
, 0x0, NULL
, HFILL
}},
12109 { &hf_bgp_update_path_attribute_as_path_segment_as2
,
12110 { "AS2", "bgp.update.path_attribute.as_path_segment.as2", FT_UINT16
, BASE_DEC
,
12111 NULL
, 0x0, NULL
, HFILL
}},
12112 { &hf_bgp_update_path_attribute_as_path_segment_as4
,
12113 { "AS4", "bgp.update.path_attribute.as_path_segment.as4", FT_UINT32
, BASE_DEC
,
12114 NULL
, 0x0, NULL
, HFILL
}},
12115 { &hf_bgp_update_path_attribute_communities
,
12116 { "Communities", "bgp.update.path_attribute.communities", FT_NONE
, BASE_NONE
,
12117 NULL
, 0x0, NULL
, HFILL
}},
12118 { &hf_bgp_update_path_attribute_community
,
12119 { "Community", "bgp.update.path_attribute.community", FT_NONE
, BASE_NONE
,
12120 NULL
, 0x0, NULL
, HFILL
}},
12121 { &hf_bgp_update_path_attribute_community_well_known
,
12122 { "Community Well-known", "bgp.update.path_attribute.community_wellknown", FT_UINT32
, BASE_HEX
,
12123 VALS(community_vals
), 0x0, "Reserved", HFILL
}},
12124 { &hf_bgp_update_path_attribute_community_as
,
12125 { "Community AS", "bgp.update.path_attribute.community_as", FT_UINT16
, BASE_DEC
,
12126 NULL
, 0x0, NULL
, HFILL
}},
12127 { &hf_bgp_update_path_attribute_community_value
,
12128 { "Community value", "bgp.update.path_attribute.community_value", FT_UINT16
, BASE_DEC
,
12129 NULL
, 0x0, NULL
, HFILL
}},
12130 { &hf_bgp_update_path_attribute_local_pref
,
12131 { "Local preference", "bgp.update.path_attribute.local_pref", FT_UINT32
, BASE_DEC
,
12132 NULL
, 0x0, NULL
, HFILL
}},
12133 { &hf_bgp_update_path_attribute_attrset_origin_as
,
12134 { "Origin AS", "bgp.update.path_attribute.attr_set.origin_as", FT_UINT32
, BASE_DEC
,
12135 NULL
, 0x0, NULL
, HFILL
}},
12136 { &hf_bgp_update_path_attribute_multi_exit_disc
,
12137 { "Multiple exit discriminator", "bgp.update.path_attribute.multi_exit_disc", FT_UINT32
, BASE_DEC
,
12138 NULL
, 0x0, NULL
, HFILL
}},
12139 { &hf_bgp_update_path_attribute_next_hop
,
12140 { "Next hop", "bgp.update.path_attribute.next_hop", FT_IPv4
, BASE_NONE
,
12141 NULL
, 0x0, NULL
, HFILL
}},
12142 { &hf_bgp_update_path_attribute_origin
,
12143 { "Origin", "bgp.update.path_attribute.origin", FT_UINT8
, BASE_DEC
,
12144 VALS(bgpattr_origin
), 0x0, NULL
, HFILL
}},
12145 { &hf_bgp_update_path_attribute
,
12146 { "Path Attribute", "bgp.update.path_attribute", FT_NONE
, BASE_NONE
,
12147 NULL
, 0x0, NULL
, HFILL
}},
12148 { &hf_bgp_update_path_attribute_flags
,
12149 { "Flags", "bgp.update.path_attribute.flags", FT_UINT8
, BASE_HEX
,
12150 NULL
, 0x0, NULL
, HFILL
}},
12151 { &hf_bgp_update_path_attribute_flags_optional
,
12152 { "Optional", "bgp.update.path_attribute.flags.optional", FT_BOOLEAN
, 8,
12153 TFS(&tfs_set_notset
), BGP_ATTR_FLAG_OPTIONAL
, NULL
, HFILL
}},
12154 { &hf_bgp_update_path_attribute_flags_transitive
,
12155 { "Transitive", "bgp.update.path_attribute.flags.transitive", FT_BOOLEAN
, 8,
12156 TFS(&tfs_set_notset
), BGP_ATTR_FLAG_TRANSITIVE
, NULL
, HFILL
}},
12157 { &hf_bgp_update_path_attribute_flags_partial
,
12158 { "Partial", "bgp.update.path_attribute.flags.partial", FT_BOOLEAN
, 8,
12159 TFS(&tfs_set_notset
), BGP_ATTR_FLAG_PARTIAL
, NULL
, HFILL
}},
12160 { &hf_bgp_update_path_attribute_flags_extended_length
,
12161 { "Extended-Length", "bgp.update.path_attribute.flags.extended_length", FT_BOOLEAN
, 8,
12162 TFS(&tfs_set_notset
), BGP_ATTR_FLAG_EXTENDED_LENGTH
, NULL
, HFILL
}},
12163 { &hf_bgp_update_path_attribute_flags_unused
,
12164 { "Unused", "bgp.update.path_attribute.flags.unused", FT_UINT8
, BASE_HEX
,
12165 NULL
, BGP_ATTR_FLAG_UNUSED
, NULL
, HFILL
}},
12166 { &hf_bgp_update_path_attribute_type_code
,
12167 { "Type Code", "bgp.update.path_attribute.type_code", FT_UINT8
, BASE_DEC
,
12168 VALS(bgpattr_type
), 0x0, NULL
, HFILL
}},
12169 { &hf_bgp_update_path_attribute_length
,
12170 { "Length", "bgp.update.path_attribute.length", FT_UINT16
, BASE_DEC
,
12171 NULL
, 0x0, NULL
, HFILL
}},
12172 { &hf_bgp_update_path_attribute_link_state
,
12173 { "Link State", "bgp.update.path_attribute.link_state", FT_NONE
, BASE_NONE
,
12174 NULL
, 0x0, NULL
, HFILL
}},
12176 /* BGPsec Path Attributes, RFC8205*/
12177 { &hf_bgp_update_path_attribute_bgpsec_sp_len
,
12178 { "Length", "bgp.update.path_attribute.bgpsec.sp.length", FT_UINT16
, BASE_DEC
,
12179 NULL
, 0x0, NULL
, HFILL
}},
12180 { &hf_bgp_update_path_attribute_bgpsec_sps_pcount
,
12181 { "pCount", "bgp.update.path_attribute.bgpsec.sps.pcount", FT_UINT8
, BASE_DEC
,
12182 NULL
, 0x0, NULL
, HFILL
}},
12183 { &hf_bgp_update_path_attribute_bgpsec_sps_flags
,
12184 { "Flags", "bgp.update.path_attribute.bgpsec.sps.flags", FT_UINT8
, BASE_DEC
,
12185 NULL
, 0x0, NULL
, HFILL
}},
12186 { &hf_bgp_update_path_attribute_bgpsec_sps_as
,
12187 { "AS Number", "bgp.update.path_attribute.bgpsec.sps.as", FT_UINT32
, BASE_DEC
,
12188 NULL
, 0x0, NULL
, HFILL
}},
12189 { &hf_bgp_update_path_attribute_bgpsec_sb_len
,
12190 { "Length", "bgp.update.path_attribute.bgpsec.sb.length", FT_UINT16
, BASE_DEC
,
12191 NULL
, 0x0, NULL
, HFILL
}},
12192 { &hf_bgp_update_path_attribute_bgpsec_algo_id
,
12193 { "Algo ID", "bgp.update.path_attribute.bgpsec.sb.algo_id", FT_UINT8
, BASE_DEC
,
12194 NULL
, 0x0, NULL
, HFILL
}},
12195 { &hf_bgp_update_path_attribute_bgpsec_ski
,
12196 { "SKI", "bgp.update.path_attribute.bgpsec.ss.ski", FT_BYTES
, SEP_SPACE
,
12197 NULL
, 0x0, NULL
, HFILL
}},
12198 { &hf_bgp_update_path_attribute_bgpsec_sig_len
,
12199 { "Length", "bgp.update.path_attribute.bgpsec.ss.length", FT_UINT16
, BASE_DEC
,
12200 NULL
, 0x0, NULL
, HFILL
}},
12201 { &hf_bgp_update_path_attribute_bgpsec_sig
,
12202 { "Signature", "bgp.update.path_attribute.bgpsec.ss.sig", FT_BYTES
, SEP_SPACE
,
12203 NULL
, 0x0, NULL
, HFILL
}},
12205 { &hf_bgp_update_path_attribute_mp_reach_nlri_address_family
,
12206 { "Address family identifier (AFI)", "bgp.update.path_attribute.mp_reach_nlri.afi", FT_UINT16
, BASE_DEC
,
12207 VALS(afn_vals
), 0x0, NULL
, HFILL
}},
12208 { &hf_bgp_update_path_attribute_mp_reach_nlri_safi
,
12209 { "Subsequent address family identifier (SAFI)", "bgp.update.path_attribute.mp_reach_nlri.safi", FT_UINT8
, BASE_DEC
,
12210 VALS(bgpattr_nlri_safi
), 0x0, NULL
, HFILL
}},
12211 { &hf_bgp_update_path_attribute_mp_reach_nlri_next_hop
,
12212 { "Next hop", "bgp.update.path_attribute.mp_reach_nlri.next_hop", FT_BYTES
, BASE_NO_DISPLAY_VALUE
,
12213 NULL
, 0x0, NULL
, HFILL
}},
12214 { &hf_bgp_update_path_attribute_mp_reach_nlri_next_hop_rd
,
12215 { "Route Distinguisher", "bgp.update.path_attribute.mp_reach_nlri.next_hop.rd", FT_STRING
, BASE_NONE
,
12216 NULL
, 0x0, "RD is always zero in the Next Hop", HFILL
}},
12217 { &hf_bgp_update_path_attribute_mp_reach_nlri_next_hop_ipv4
,
12218 { "IPv4 Address", "bgp.update.path_attribute.mp_reach_nlri.next_hop.ipv4", FT_IPv4
, BASE_NONE
,
12219 NULL
, 0x0, NULL
, HFILL
}},
12220 { &hf_bgp_update_path_attribute_mp_reach_nlri_next_hop_ipv6
,
12221 { "IPv6 Address", "bgp.update.path_attribute.mp_reach_nlri.next_hop.ipv6", FT_IPv6
, BASE_NONE
,
12222 NULL
, 0x0, NULL
, HFILL
}},
12223 { &hf_bgp_update_path_attribute_mp_reach_nlri_next_hop_ipv6_link_local
,
12224 { "Link-local Address", "bgp.update.path_attribute.mp_reach_nlri.next_hop.ipv6.link_local", FT_IPv6
, BASE_NONE
,
12225 NULL
, 0x0, NULL
, HFILL
}},
12226 { &hf_bgp_update_path_attribute_mp_reach_nlri_nbr_snpa
,
12227 { "Number of Subnetwork points of attachment (SNPA)", "bgp.update.path_attribute.mp_reach_nlri.nbr_snpa", FT_UINT8
, BASE_DEC
,
12228 NULL
, 0x0, NULL
, HFILL
}},
12229 { &hf_bgp_update_path_attribute_mp_reach_nlri_snpa_length
,
12230 { "SNPA Length", "bgp.update.path_attribute.mp_reach_nlri.snpa_length", FT_UINT8
, BASE_DEC
,
12231 NULL
, 0x0, NULL
, HFILL
}},
12232 { &hf_bgp_update_path_attribute_mp_reach_nlri_snpa
,
12233 { "SNPA", "bgp.update.path_attribute.mp_reach_nlri.snpa", FT_BYTES
, BASE_NONE
,
12234 NULL
, 0x0, NULL
, HFILL
}},
12235 { &hf_bgp_update_path_attribute_mp_reach_nlri
,
12236 { "Network Layer Reachability Information (NLRI)", "bgp.update.path_attribute.mp_reach_nlri", FT_NONE
, BASE_NONE
,
12237 NULL
, 0x0, NULL
, HFILL
}},
12239 { &hf_bgp_update_path_attribute_mp_unreach_nlri_address_family
,
12240 { "Address family identifier (AFI)", "bgp.update.path_attribute.mp_unreach_nlri.afi", FT_UINT16
, BASE_DEC
,
12241 VALS(afn_vals
), 0x0, NULL
, HFILL
}},
12242 { &hf_bgp_update_path_attribute_mp_unreach_nlri_safi
,
12243 { "Subsequent address family identifier (SAFI)", "bgp.update.path_attribute.mp_unreach_nlri.safi", FT_UINT8
, BASE_DEC
,
12244 VALS(bgpattr_nlri_safi
), 0x0, NULL
, HFILL
}},
12245 { &hf_bgp_update_path_attribute_mp_unreach_nlri
,
12246 { "Withdrawn Routes", "bgp.update.path_attribute.mp_unreach_nlri", FT_NONE
, BASE_NONE
,
12247 NULL
, 0x0, NULL
, HFILL
}},
12249 { &hf_bgp_pmsi_tunnel_flags
,
12250 { "Flags", "bgp.update.path_attribute.pmsi.tunnel.flags", FT_UINT8
, BASE_DEC
,
12251 NULL
, 0x0, NULL
, HFILL
}},
12252 { &hf_bgp_pmsi_tunnel_type
,
12253 { "Tunnel Type", "bgp.update.path_attribute.pmsi.tunnel.type", FT_UINT8
, BASE_DEC
,
12254 VALS(pmsi_tunnel_type
), 0x0, NULL
, HFILL
}},
12255 { &hf_bgp_pmsi_tunnel_id
,
12256 { "Tunnel ID", "bgp.update.path_attribute.pmsi.tunnel.id", FT_NONE
, BASE_NONE
,
12257 NULL
, 0x0, NULL
, HFILL
}},
12258 { &hf_bgp_pmsi_tunnel_not_present
,
12259 { "Tunnel ID not present", "bgp.update.path_attribute.pmsi.tunnel_id.not_present", FT_NONE
, BASE_NONE
,
12260 NULL
, 0x0, NULL
, HFILL
}},
12261 { &hf_bgp_update_mpls_label
,
12262 { "MPLS Label Stack", "bgp.update.path_attribute.mpls_label", FT_NONE
,
12263 BASE_NONE
, NULL
, 0x0, NULL
, HFILL
}},
12264 { &hf_bgp_update_mpls_label_value_20bits
,
12265 { "MPLS Label", "bgp.update.path_attribute.mpls_label_value_20bits", FT_UINT24
,
12266 BASE_DEC
, NULL
, BGP_MPLS_LABEL
, NULL
, HFILL
}},
12267 { &hf_bgp_update_mpls_label_value
,
12268 { "MPLS Label", "bgp.update.path_attribute.mpls_label_value", FT_UINT24
,
12269 BASE_DEC
, NULL
, 0x0, NULL
, HFILL
}},
12270 { &hf_bgp_update_mpls_traffic_class
,
12271 { "Traffic Class", "bgp.update.path_attribute.mpls_traffic_class", FT_UINT24
,
12272 BASE_HEX
, NULL
, BGP_MPLS_TRAFFIC_CLASS
, NULL
, HFILL
}},
12273 { &hf_bgp_update_mpls_bottom_stack
,
12274 { "Bottom-of-Stack", "bgp.update.path_attribute.mpls_bottom_stack", FT_BOOLEAN
,
12275 24, NULL
, BGP_MPLS_BOTTOM_L_STACK
, NULL
, HFILL
}},
12276 { &hf_bgp_pmsi_tunnel_rsvp_p2mp_id
, /* RFC4875 section 19 */
12277 { "RSVP P2MP id", "bgp.update.path_attribute.pmsi.rsvp.id", FT_IPv4
, BASE_NONE
,
12278 NULL
, 0x0, NULL
, HFILL
}},
12279 { &hf_bgp_pmsi_tunnel_rsvp_p2mp_tunnel_id
,
12280 { "RSVP P2MP tunnel id", "bgp.update.path_attribute.pmsi.rsvp.tunnel_id", FT_UINT16
, BASE_DEC
,
12281 NULL
, 0x0, NULL
, HFILL
}},
12282 { &hf_bgp_pmsi_tunnel_rsvp_p2mp_ext_tunnel_idv4
,
12283 { "RSVP P2MP extended tunnel id", "bgp.update.path_attribute.pmsi.rsvp.ext_tunnel_idv4", FT_IPv4
, BASE_NONE
,
12284 NULL
, 0x0, NULL
, HFILL
}},
12285 { &hf_bgp_pmsi_tunnel_mldp_fec_el_type
,
12286 { "mLDP P2MP FEC element type", "bgp.update.path_attribute.pmsi.mldp.fec.type", FT_UINT8
, BASE_DEC
,
12287 VALS(fec_types_vals
), 0x0, NULL
, HFILL
}},
12288 { &hf_bgp_pmsi_tunnel_mldp_fec_el_afi
,
12289 {"mLDP P2MP FEC element address family", "bgp.update.path_attribute.pmsi.mldp.fec.address_family", FT_UINT16
, BASE_DEC
,
12290 VALS(afn_vals
), 0x0, NULL
, HFILL
}},
12291 { &hf_bgp_pmsi_tunnel_mldp_fec_el_adr_len
,
12292 {"mLDP P2MP FEC element address length", "bgp.update.path_attribute.pmsi.mldp.fec.address_length", FT_UINT8
, BASE_DEC
,
12293 NULL
, 0x0, NULL
, HFILL
}},
12294 { &hf_bgp_pmsi_tunnel_mldp_fec_el_root_nodev4
,
12295 {"mLDP P2MP FEC element root node address", "bgp.update.path_attribute.pmsi.mldp.fec.root_nodev4", FT_IPv4
, BASE_NONE
,
12296 NULL
, 0x0, NULL
, HFILL
}},
12297 { &hf_bgp_pmsi_tunnel_mldp_fec_el_root_nodev6
,
12298 {"mLDP P2MP FEC element root node address", "bgp.update.path_attribute.pmsi.mldp.fec.root_nodev6", FT_IPv6
, BASE_NONE
,
12299 NULL
, 0x0, NULL
, HFILL
}},
12300 { &hf_bgp_pmsi_tunnel_mldp_fec_el_opa_len
,
12301 {"mLDP P2MP FEC element opaque length", "bgp.update.path_attribute.pmsi.mldp.fec.opaque_length", FT_UINT16
, BASE_DEC
,
12302 NULL
, 0x0, NULL
, HFILL
}},
12303 { &hf_bgp_pmsi_tunnel_mldp_fec_el_opa_val_type
,
12304 {"mLDP P2MP FEC element opaque value type", "bgp.update.path_attribute.pmsi.mldp.fec.opaque_value_type", FT_UINT8
, BASE_DEC
,
12305 VALS(pmsi_mldp_fec_opaque_value_type
), 0x0, NULL
, HFILL
}},
12306 { &hf_bgp_pmsi_tunnel_mldp_fec_el_opa_val_len
,
12307 {"mLDP P2MP FEC element opaque value length", "bgp.update.path_attribute.pmsi.mldp.fec.opaque_value_length", FT_UINT16
, BASE_DEC
,
12308 NULL
, 0x0, NULL
, HFILL
}},
12309 { &hf_bgp_pmsi_tunnel_mldp_fec_el_opa_value_rn
,
12310 {"mLDP P2MP FEC element opaque value unique Id", "bgp.update.path_attribute.pmsi.mldp.fec.opaque_value_unique_id_rn", FT_UINT32
, BASE_DEC
,
12311 NULL
, 0x0, NULL
, HFILL
}},
12312 { &hf_bgp_pmsi_tunnel_mldp_fec_el_opa_value_str
,
12313 {"mLDP P2MP FEC element opaque value unique Id", "bgp.update.path_attribute.pmsi.mldp.fec.opaque_value_unique_id_str", FT_STRING
, BASE_NONE
,
12314 NULL
, 0x0, NULL
, HFILL
}},
12315 { &hf_bgp_pmsi_tunnel_mldp_fec_el_opa_val_ext_type
,
12316 {"mLDP P2MP FEC element opaque extended value type", "bgp.update.path_attribute.pmsi.mldp.fec.opaque_ext_value_type", FT_UINT16
, BASE_DEC
,
12317 VALS(pmsi_mldp_fec_opa_extented_type
), 0x0, NULL
, HFILL
}},
12318 { &hf_bgp_pmsi_tunnel_mldp_fec_el_opa_val_ext_len
,
12319 {"mLDP P2MP FEC element opaque extended length", "bgp.update.path_attribute.pmsi.mldp.fec.opaque_ext_length", FT_UINT16
, BASE_DEC
,
12320 NULL
, 0x0, NULL
, HFILL
}},
12321 { &hf_bgp_pmsi_tunnel_pimsm_sender
,
12322 {"PIM-SM Tree tunnel sender address", "bgp.update.path_attribute.pmsi.pimsm.sender_address", FT_IPv4
, BASE_NONE
,
12323 NULL
, 0x0, NULL
, HFILL
}},
12324 { &hf_bgp_pmsi_tunnel_pimsm_pmc_group
,
12325 {"PIM-SM Tree tunnel P-multicast group", "bgp.update.path_attribute.pmsi.pimsm.pmulticast_group", FT_IPv4
, BASE_NONE
,
12326 NULL
, 0x0, NULL
, HFILL
}},
12327 { &hf_bgp_pmsi_tunnel_pimssm_root_node
,
12328 {"PIM-SSM Tree tunnel Root Node", "bgp.update.path_attribute.pmsi.pimssm.root_node", FT_IPv4
, BASE_NONE
,
12329 NULL
, 0x0, NULL
, HFILL
}},
12330 { &hf_bgp_pmsi_tunnel_pimssm_pmc_group
,
12331 {"PIM-SSM Tree tunnel P-multicast group", "bgp.update.path_attribute.pmsi.pimssm.pmulticast_group", FT_IPv4
, BASE_NONE
,
12332 NULL
, 0x0, NULL
, HFILL
}},
12333 { &hf_bgp_pmsi_tunnel_pimbidir_sender
,
12334 {"BIDIR-PIM Tree Tunnel sender address", "bgp.update.path_attribute.pmsi.bidir_pim_tree.sender", FT_IPv4
, BASE_NONE
,
12335 NULL
, 0x0, NULL
, HFILL
}},
12336 { &hf_bgp_pmsi_tunnel_pimbidir_pmc_group
,
12337 {"BIDIR-PIM Tree Tunnel P-multicast group", "bgp.update.path_attribute.pmsi.bidir_pim_tree.pmulticast_group", FT_IPv4
, BASE_NONE
,
12338 NULL
, 0x0, NULL
, HFILL
}},
12339 { &hf_bgp_pmsi_tunnel_ingress_rep_addr
,
12340 {"Tunnel type ingress replication IP end point", "bgp.update.path_attribute.pmsi.ingress_rep_ip", FT_IPv4
, BASE_NONE
,
12341 NULL
, 0x0, NULL
, HFILL
}},
12342 { &hf_bgp_pmsi_tunnel_ingress_rep_addr6
,
12343 {"Tunnel type ingress replication IP end point", "bgp.update.path_attribute.pmsi.ingress_rep_ip6", FT_IPv6
, BASE_NONE
,
12344 NULL
, 0x0, NULL
, HFILL
}},
12346 /* BGP Only to Customer (OTC) Attribute, RFC9234 */
12347 { &hf_bgp_update_path_attribute_otc
,
12348 { "Only to Customer", "bgp.update.path_attribute.otc", FT_UINT32
, BASE_DEC
,
12349 NULL
, 0x0, NULL
, HFILL
}},
12351 /* https://tools.ietf.org/html/draft-rabadan-sajassi-bess-evpn-ipvpn-interworking-02 */
12352 { &hf_bgp_update_path_attribute_d_path
,
12353 { "Domain Path Attribute", "bgp.update.path_attribute.dpath", FT_STRING
, BASE_NONE
,
12354 NULL
, 0x0, NULL
, HFILL
}},
12355 { &hf_bgp_d_path_length
,
12356 {"Domain Path Attribute length", "bgp.update.attribute.dpath.length", FT_UINT16
, BASE_DEC
,
12357 NULL
, 0x0, NULL
, HFILL
}},
12358 { &hf_bgp_d_path_ga
,
12359 { "Global Administrator", "bgp.update.attribute.dpath.ga", FT_UINT32
, BASE_DEC
,
12360 NULL
, 0x0, "A four-octet namespace identifier. This SHOULD be an Autonomous System Number", HFILL
}},
12361 { &hf_bgp_d_path_la
,
12362 { "Local Administrator", "bgp.update.attribute.dpath.la", FT_UINT16
, BASE_DEC
,
12363 NULL
, 0x0, "A two-octet operator-defined value", HFILL
}},
12364 { &hf_bgp_d_path_isf_safi
,
12365 { "Inter-Subnet Forwarding SAFI type", "bgp.update.attribute.dpath.isf.safi", FT_UINT8
, BASE_DEC
,
12366 NULL
, 0x0, NULL
, HFILL
}},
12369 { &hf_bgp_update_path_attribute_aigp
,
12370 { "AIGP Attribute", "bgp.update.path_attribute.aigp", FT_NONE
, BASE_NONE
,
12371 NULL
, 0x0, NULL
, HFILL
}},
12372 { &hf_bgp_aigp_type
,
12373 {"AIGP attribute type", "bgp.update.attribute.aigp.type", FT_UINT8
, BASE_DEC
,
12374 VALS(aigp_tlv_type
), 0x0, NULL
, HFILL
}},
12375 { &hf_bgp_aigp_tlv_length
,
12376 {"AIGP TLV length", "bgp.update.attribute.aigp.length", FT_UINT16
, BASE_DEC
,
12377 NULL
, 0x0, NULL
, HFILL
}},
12378 { &hf_bgp_aigp_accu_igp_metric
,
12379 {"AIGP Accumulated IGP Metric", "bgp.update.attribute.aigp.accu_igp_metric", FT_UINT64
, BASE_DEC
,
12380 NULL
, 0x0, NULL
, HFILL
}},
12383 { &hf_bgp_large_communities
,
12384 { "Large Communities", "bgp.large_communities", FT_STRING
, BASE_NONE
,
12385 NULL
, 0x0, NULL
, HFILL
}},
12386 { &hf_bgp_large_communities_ga
,
12387 { "Global Administrator", "bgp.large_communities.ga", FT_UINT32
, BASE_DEC
,
12388 NULL
, 0x0, "A four-octet namespace identifier. This SHOULD be an Autonomous System Number", HFILL
}},
12389 { &hf_bgp_large_communities_ldp1
,
12390 { "Local Data Part 1", "bgp.large_communities.ldp1", FT_UINT32
, BASE_DEC
,
12391 NULL
, 0x0, "A four-octet operator-defined value", HFILL
}},
12392 { &hf_bgp_large_communities_ldp2
,
12393 { "Local Data Part 2", "bgp.large_communities.ldp2", FT_UINT32
, BASE_DEC
,
12394 NULL
, 0x0, "A four-octet operator-defined value", HFILL
}},
12397 { &hf_bgp_update_path_attribute_originator_id
,
12398 { "Originator identifier", "bgp.update.path_attribute.originator_id", FT_IPv4
, BASE_NONE
,
12399 NULL
, 0x0, NULL
, HFILL
}},
12400 { &hf_bgp_update_path_attribute_cluster_list
,
12401 { "Cluster List", "bgp.path_attribute.cluster_list", FT_NONE
, BASE_NONE
,
12402 NULL
, 0x0, NULL
, HFILL
}},
12403 { &hf_bgp_update_path_attribute_cluster_id
,
12404 { "Cluster ID", "bgp.path_attribute.cluster_id", FT_IPv4
, BASE_NONE
,
12405 NULL
, 0x0, NULL
, HFILL
}},
12408 { &hf_bgp_prefix_sid_unknown
,
12409 { "Unknown TLV", "bgp.prefix_sid.unknown", FT_NONE
, BASE_NONE
,
12410 NULL
, 0x0, NULL
, HFILL
}},
12411 { &hf_bgp_prefix_sid_label_index
,
12412 { "Label-Index", "bgp.prefix_sid.label_index", FT_NONE
, BASE_NONE
,
12413 NULL
, 0x0, NULL
, HFILL
}},
12414 { &hf_bgp_prefix_sid_label_index_value
,
12415 { "Label-Index Value", "bgp.prefix_sid.label_index.value", FT_UINT32
, BASE_DEC
,
12416 NULL
, 0x0, "4-octet label index value", HFILL
}},
12417 { &hf_bgp_prefix_sid_label_index_flags
,
12418 { "Label-Index Flags", "bgp.prefix_sid.label_index.flags", FT_UINT16
, BASE_HEX
,
12419 NULL
, 0x0, "2-octet flags, None is defined", HFILL
}},
12420 { &hf_bgp_prefix_sid_originator_srgb_flags
,
12421 { "Originator SRGB Flags", "bgp.prefix_sid.originator_srgb.flags", FT_UINT16
, BASE_HEX
,
12422 NULL
, 0x0, "2-octet flags, None is defined", HFILL
}},
12423 { &hf_bgp_prefix_sid_originator_srgb
,
12424 { "Originator SRGB", "bgp.prefix_sid.originator_srgb", FT_NONE
, BASE_NONE
,
12425 NULL
, 0x0, NULL
, HFILL
}},
12426 { &hf_bgp_prefix_sid_originator_srgb_blocks
,
12427 { "SRGB Blocks", "bgp.prefix_sid.originator_srgb_blocks", FT_NONE
, BASE_NONE
,
12428 NULL
, 0x0, NULL
, HFILL
}},
12429 { &hf_bgp_prefix_sid_originator_srgb_block
,
12430 { "SRGB Block", "bgp.prefix_sid.originator_srgb_block", FT_NONE
, BASE_NONE
,
12431 NULL
, 0x0, NULL
, HFILL
}},
12432 { &hf_bgp_prefix_sid_originator_srgb_base
,
12433 { "SRGB Base", "bgp.prefix_sid.originator_srgb_base", FT_UINT24
, BASE_DEC
,
12434 NULL
, 0x0, "A three-octet value", HFILL
}},
12435 { &hf_bgp_prefix_sid_originator_srgb_range
,
12436 { "SRGB Range", "bgp.prefix_sid.originator_srgb_range", FT_UINT24
, BASE_DEC
,
12437 NULL
, 0x0, "A three-octet value", HFILL
}},
12438 { &hf_bgp_prefix_sid_type
,
12439 { "Type", "bgp.prefix_sid.type", FT_UINT8
, BASE_DEC
,
12440 VALS(bgp_prefix_sid_type
), 0x0, "BGP Prefix-SID message type", HFILL
}},
12441 { &hf_bgp_prefix_sid_length
,
12442 { "Length", "bgp.prefix_sid.length", FT_UINT16
, BASE_DEC
,
12443 NULL
, 0x0, "BGP Prefix-SID message payload", HFILL
}},
12444 { &hf_bgp_prefix_sid_value
,
12445 { "Value", "bgp.prefix_sid.value", FT_BYTES
, BASE_NONE
,
12446 NULL
, 0x0, "BGP Prefix-SID message value", HFILL
}},
12447 { &hf_bgp_prefix_sid_reserved
,
12448 { "Reserved", "bgp.prefix_sid.reserved", FT_BYTES
,
12449 BASE_NONE
, NULL
, 0x0, "Unused (must be clear)", HFILL
}},
12451 /* draft-ietf-bess-srv6-services-05 */
12452 { &hf_bgp_prefix_sid_srv6_l3vpn
,
12453 { "SRv6 L3 Service", "bgp.prefix_sid.srv6_l3vpn", FT_NONE
, BASE_NONE
,
12454 NULL
, 0x0, NULL
, HFILL
}},
12455 { &hf_bgp_prefix_sid_srv6_l3vpn_sub_tlvs
,
12456 { "SRv6 Service Sub-TLVs", "bgp.prefix_sid.srv6_l3vpn.sub_tlvs", FT_NONE
, BASE_NONE
,
12457 NULL
, 0x0, NULL
, HFILL
}},
12458 { &hf_bgp_prefix_sid_srv6_l3vpn_sub_tlv
,
12459 { "SRv6 Service Sub-TLV", "bgp.prefix_sid.srv6_l3vpn.sub_tlv", FT_NONE
, BASE_NONE
,
12460 NULL
, 0x0, NULL
, HFILL
}},
12461 { &hf_bgp_prefix_sid_srv6_l3vpn_sub_tlv_type
,
12462 { "Type", "bgp.prefix_sid.srv6_l3vpn.sub_tlv.type", FT_UINT8
, BASE_DEC
,
12463 VALS(srv6_service_sub_tlv_type
), 0x0, "SRv6 Service Sub-TLV type", HFILL
}},
12464 { &hf_bgp_prefix_sid_srv6_l3vpn_sub_tlv_length
,
12465 { "Length", "bgp.prefix_sid.srv6_l3vpn.sub_tlv.length", FT_UINT16
, BASE_DEC
,
12466 NULL
, 0x0, "SRv6 Service Sub-TLV length", HFILL
}},
12467 { &hf_bgp_prefix_sid_srv6_l3vpn_sub_tlv_value
,
12468 { "Value", "bgp.prefix_sid.srv6_l3vpn.sub_tlv.value", FT_BYTES
, BASE_NONE
,
12469 NULL
, 0x0, "SRv6 Service Sub-TLV value", HFILL
}},
12470 { &hf_bgp_prefix_sid_srv6_l3vpn_sub_tlv_reserved
,
12471 { "Reserved", "bgp.prefix_sid.srv6_l3vpn.sub_tlv.reserved", FT_BYTES
,
12472 BASE_NONE
, NULL
, 0x0, "Unused (must be clear)", HFILL
}},
12473 { &hf_bgp_prefix_sid_srv6_l3vpn_sid_value
,
12474 { "SRv6 SID Value", "bgp.prefix_sid.srv6_l3vpn.sid_value", FT_IPv6
, BASE_NONE
,
12475 NULL
, 0x0, NULL
, HFILL
}},
12476 { &hf_bgp_prefix_sid_srv6_l3vpn_sid_flags
,
12477 { "SRv6 SID Flags", "bgp.prefix_sid.srv6_l3vpn.sid_flags", FT_UINT8
, BASE_HEX
,
12478 NULL
, 0x0, NULL
, HFILL
}},
12479 { &hf_bgp_prefix_sid_srv6_l3vpn_srv6_endpoint_behavior
,
12480 { "SRv6 Endpoint Behavior", "bgp.prefix_sid.srv6_l3vpn.srv6_endpoint_behavior", FT_UINT16
, BASE_HEX
,
12481 VALS(srv6_endpoint_behavior
), 0x0, NULL
, HFILL
}},
12482 { &hf_bgp_prefix_sid_srv6_l3vpn_reserved
,
12483 { "Reserved", "bgp.prefix_sid.srv6_l3vpn.reserved", FT_BYTES
,
12484 BASE_NONE
, NULL
, 0x0, "Unused (must be clear)", HFILL
}},
12485 { &hf_bgp_prefix_sid_srv6_l3vpn_sub_sub_tlvs
,
12486 { "SRv6 Service Data Sub-Sub-TLVs", "bgp.prefix_sid.srv6_l3vpn.sub_sub_tlvs", FT_NONE
, BASE_NONE
,
12487 NULL
, 0x0, NULL
, HFILL
}},
12488 { &hf_bgp_prefix_sid_srv6_l3vpn_sub_sub_tlv
,
12489 { "SRv6 Service Data Sub-Sub-TLV", "bgp.prefix_sid.srv6_l3vpn.sub_sub_tlv", FT_NONE
, BASE_NONE
,
12490 NULL
, 0x0, NULL
, HFILL
}},
12491 { &hf_bgp_prefix_sid_srv6_l3vpn_sub_sub_tlv_type
,
12492 { "Type", "bgp.prefix_sid.srv6_l3vpn.sub_sub_tlv.type", FT_UINT8
, BASE_DEC
,
12493 VALS(srv6_service_data_sub_sub_tlv_type
), 0x0, "SRv6 Service Data Sub-Sub-TLV type", HFILL
}},
12494 { &hf_bgp_prefix_sid_srv6_l3vpn_sub_sub_tlv_length
,
12495 { "Length", "bgp.prefix_sid.srv6_l3vpn.sub_sub_tlv.length", FT_UINT16
, BASE_DEC
,
12496 NULL
, 0x0, "SRv6 Service Data Sub-Sub-TLV length", HFILL
}},
12497 { &hf_bgp_prefix_sid_srv6_l3vpn_sub_sub_tlv_value
,
12498 { "Value", "bgp.prefix_sid.srv6_l3vpn.sub_sub_tlv.value", FT_BYTES
, BASE_NONE
,
12499 NULL
, 0x0, "SRv6 Service Data Sub-Sub-TLV value", HFILL
}},
12500 { &hf_bgp_prefix_sid_srv6_l3vpn_sid_locator_block_len
,
12501 { "Locator Block Length", "bgp.prefix_sid.srv6_l3vpn.sid.locator_block_len", FT_UINT8
, BASE_DEC
,
12502 NULL
, 0x0, NULL
, HFILL
}},
12503 { &hf_bgp_prefix_sid_srv6_l3vpn_sid_locator_node_len
,
12504 { "Locator Node Length", "bgp.prefix_sid.srv6_l3vpn.sid.locator_node_len", FT_UINT8
, BASE_DEC
,
12505 NULL
, 0x0, NULL
, HFILL
}},
12506 { &hf_bgp_prefix_sid_srv6_l3vpn_sid_func_len
,
12507 { "Function Length", "bgp.prefix_sid.srv6_l3vpn.sid.func_len", FT_UINT8
, BASE_DEC
,
12508 NULL
, 0x0, NULL
, HFILL
}},
12509 { &hf_bgp_prefix_sid_srv6_l3vpn_sid_arg_len
,
12510 { "Argument Length", "bgp.prefix_sid.srv6_l3vpn.sid.arg_len", FT_UINT8
, BASE_DEC
,
12511 NULL
, 0x0, NULL
, HFILL
}},
12512 { &hf_bgp_prefix_sid_srv6_l3vpn_sid_trans_len
,
12513 { "Transposition Length", "bgp.prefix_sid.srv6_l3vpn.sid.trans_len", FT_UINT8
, BASE_DEC
,
12514 NULL
, 0x0, NULL
, HFILL
}},
12515 { &hf_bgp_prefix_sid_srv6_l3vpn_sid_trans_offset
,
12516 { "Transposition Offset", "bgp.prefix_sid.srv6_l3vpn.sid.trans_offset", FT_UINT8
, BASE_DEC
,
12517 NULL
, 0x0, NULL
, HFILL
}},
12518 { &hf_bgp_prefix_sid_srv6_l2vpn
,
12519 { "SRv6 L2 Service", "bgp.prefix_sid.srv6_l2vpn", FT_NONE
, BASE_NONE
,
12520 NULL
, 0x0, NULL
, HFILL
}},
12521 { &hf_bgp_prefix_sid_srv6_l2vpn_sub_tlvs
,
12522 { "SRv6 Service Sub-TLVs", "bgp.prefix_sid.srv6_l2vpn.sub_tlvs", FT_NONE
, BASE_NONE
,
12523 NULL
, 0x0, NULL
, HFILL
}},
12524 { &hf_bgp_prefix_sid_srv6_l2vpn_sub_tlv
,
12525 { "SRv6 Service Sub-TLV", "bgp.prefix_sid.srv6_l2vpn.sub_tlv", FT_NONE
, BASE_NONE
,
12526 NULL
, 0x0, NULL
, HFILL
}},
12527 { &hf_bgp_prefix_sid_srv6_l2vpn_sub_tlv_type
,
12528 { "Type", "bgp.prefix_sid.srv6_l2vpn.sub_tlv.type", FT_UINT8
, BASE_DEC
,
12529 VALS(srv6_service_sub_tlv_type
), 0x0, "SRv6 Service Sub-TLV type", HFILL
}},
12530 { &hf_bgp_prefix_sid_srv6_l2vpn_sub_tlv_length
,
12531 { "Length", "bgp.prefix_sid.srv6_l2vpn.sub_tlv.length", FT_UINT16
, BASE_DEC
,
12532 NULL
, 0x0, "SRv6 Service Sub-TLV length", HFILL
}},
12533 { &hf_bgp_prefix_sid_srv6_l2vpn_sub_tlv_value
,
12534 { "Value", "bgp.prefix_sid.srv6_l2vpn.sub_tlv.value", FT_BYTES
, BASE_NONE
,
12535 NULL
, 0x0, "SRv6 Service Sub-TLV value", HFILL
}},
12536 { &hf_bgp_prefix_sid_srv6_l2vpn_sub_tlv_reserved
,
12537 { "Reserved", "bgp.prefix_sid.srv6_l2vpn.sub_tlv.reserved", FT_BYTES
,
12538 BASE_NONE
, NULL
, 0x0, "Unused (must be clear)", HFILL
}},
12539 { &hf_bgp_prefix_sid_srv6_l2vpn_sid_value
,
12540 { "SRv6 SID Value", "bgp.prefix_sid.srv6_l2vpn.sid_value", FT_IPv6
, BASE_NONE
,
12541 NULL
, 0x0, NULL
, HFILL
}},
12542 { &hf_bgp_prefix_sid_srv6_l2vpn_sid_flags
,
12543 { "SRv6 SID Flags", "bgp.prefix_sid.srv6_l2vpn.sid_flags", FT_UINT8
, BASE_HEX
,
12544 NULL
, 0x0, NULL
, HFILL
}},
12545 { &hf_bgp_prefix_sid_srv6_l2vpn_srv6_endpoint_behavior
,
12546 { "SRv6 Endpoint Behavior", "bgp.prefix_sid.srv6_l2vpn.srv6_endpoint_behavior", FT_UINT16
, BASE_HEX
,
12547 VALS(srv6_endpoint_behavior
), 0x0, NULL
, HFILL
}},
12548 { &hf_bgp_prefix_sid_srv6_l2vpn_reserved
,
12549 { "Reserved", "bgp.prefix_sid.srv6_l2vpn.reserved", FT_BYTES
,
12550 BASE_NONE
, NULL
, 0x0, "Unused (must be clear)", HFILL
}},
12551 { &hf_bgp_prefix_sid_srv6_l2vpn_sub_sub_tlvs
,
12552 { "SRv6 Service Data Sub-Sub-TLVs", "bgp.prefix_sid.srv6_l2vpn.sub_sub_tlvs", FT_NONE
, BASE_NONE
,
12553 NULL
, 0x0, NULL
, HFILL
}},
12554 { &hf_bgp_prefix_sid_srv6_l2vpn_sub_sub_tlv
,
12555 { "SRv6 Service Data Sub-Sub-TLV", "bgp.prefix_sid.srv6_l2vpn.sub_sub_tlv", FT_NONE
, BASE_NONE
,
12556 NULL
, 0x0, NULL
, HFILL
}},
12557 { &hf_bgp_prefix_sid_srv6_l2vpn_sub_sub_tlv_type
,
12558 { "Type", "bgp.prefix_sid.srv6_l2vpn.sub_sub_tlv.type", FT_UINT8
, BASE_DEC
,
12559 VALS(srv6_service_data_sub_sub_tlv_type
), 0x0, "SRv6 Service Data Sub-Sub-TLV type", HFILL
}},
12560 { &hf_bgp_prefix_sid_srv6_l2vpn_sub_sub_tlv_length
,
12561 { "Length", "bgp.prefix_sid.srv6_l2vpn.sub_sub_tlv.length", FT_UINT16
, BASE_DEC
,
12562 NULL
, 0x0, "SRv6 Service Data Sub-Sub-TLV length", HFILL
}},
12563 { &hf_bgp_prefix_sid_srv6_l2vpn_sub_sub_tlv_value
,
12564 { "Value", "bgp.prefix_sid.srv6_l2vpn.sub_sub_tlv.value", FT_BYTES
, BASE_NONE
,
12565 NULL
, 0x0, "SRv6 Service Data Sub-Sub-TLV value", HFILL
}},
12566 { &hf_bgp_prefix_sid_srv6_l2vpn_sid_locator_block_len
,
12567 { "Locator Block Length", "bgp.prefix_sid.srv6_l2vpn.sid.locator_block_len", FT_UINT8
, BASE_DEC
,
12568 NULL
, 0x0, NULL
, HFILL
}},
12569 { &hf_bgp_prefix_sid_srv6_l2vpn_sid_locator_node_len
,
12570 { "Locator Node Length", "bgp.prefix_sid.srv6_l2vpn.sid.locator_node_len", FT_UINT8
, BASE_DEC
,
12571 NULL
, 0x0, NULL
, HFILL
}},
12572 { &hf_bgp_prefix_sid_srv6_l2vpn_sid_func_len
,
12573 { "Function Length", "bgp.prefix_sid.srv6_l2vpn.sid.func_len", FT_UINT8
, BASE_DEC
,
12574 NULL
, 0x0, NULL
, HFILL
}},
12575 { &hf_bgp_prefix_sid_srv6_l2vpn_sid_arg_len
,
12576 { "Argument Length", "bgp.prefix_sid.srv6_l2vpn.sid.arg_len", FT_UINT8
, BASE_DEC
,
12577 NULL
, 0x0, NULL
, HFILL
}},
12578 { &hf_bgp_prefix_sid_srv6_l2vpn_sid_trans_len
,
12579 { "Transposition Length", "bgp.prefix_sid.srv6_l2vpn.sid.trans_len", FT_UINT8
, BASE_DEC
,
12580 NULL
, 0x0, NULL
, HFILL
}},
12581 { &hf_bgp_prefix_sid_srv6_l2vpn_sid_trans_offset
,
12582 { "Transposition Offset", "bgp.prefix_sid.srv6_l2vpn.sid.trans_offset", FT_UINT8
, BASE_DEC
,
12583 NULL
, 0x0, NULL
, HFILL
}},
12585 /* RFC5512 : BGP Encapsulation SAFI and the BGP Tunnel Encapsulation Attribute */
12586 { &hf_bgp_update_encaps_tunnel_tlv_len
,
12587 { "length", "bgp.update.encaps_tunnel_tlv_len", FT_UINT16
,
12588 BASE_DEC
, NULL
, 0x0, NULL
, HFILL
}},
12589 { &hf_bgp_update_encaps_tunnel_tlv_type
,
12590 { "Type code", "bgp.update.encaps_tunnel_tlv_type", FT_UINT16
, BASE_DEC
,
12591 VALS(bgp_attr_tunnel_type
), 0x0, NULL
, HFILL
}},
12592 { &hf_bgp_update_encaps_tunnel_subtlv_len
,
12593 { "length", "bgp.update.encaps_tunnel_tlv_sublen", FT_UINT16
,
12594 BASE_DEC
, NULL
, 0x0, NULL
, HFILL
}},
12595 { &hf_bgp_update_encaps_tunnel_subtlv_type
,
12596 { "Type code", "bgp.update.encaps_tunnel_subtlv_type", FT_UINT8
, BASE_DEC
,
12597 VALS(subtlv_type
), 0x0, NULL
, HFILL
}},
12598 { &hf_bgp_update_encaps_tunnel_subtlv_session_id
,
12599 { "Session ID", "bgp.update.encaps_tunnel_tlv_subtlv_session_id", FT_UINT32
,
12600 BASE_DEC
, NULL
, 0x0, NULL
, HFILL
}},
12601 { &hf_bgp_update_encaps_tunnel_subtlv_cookie
,
12602 { "Cookie", "bgp.update.encaps_tunnel_tlv_subtlv_cookie", FT_BYTES
,
12603 BASE_NONE
, NULL
, 0x0, NULL
, HFILL
}},
12604 { &hf_bgp_update_encaps_tunnel_subtlv_gre_key
,
12605 { "GRE Key", "bgp.update.encaps_tunnel_tlv_subtlv_gre_key", FT_UINT32
,
12606 BASE_DEC
, NULL
, 0x0, NULL
, HFILL
}},
12607 { &hf_bgp_update_encaps_tunnel_subtlv_color_value
,
12608 { "Color Value", "bgp.update.encaps_tunnel_tlv_subtlv_color_value", FT_UINT32
,
12609 BASE_DEC
, NULL
, 0x0, NULL
, HFILL
}},
12610 { &hf_bgp_update_encaps_tunnel_subtlv_lb_block_length
,
12611 { "Load-balancing block length", "bgp.update.encaps_tunnel_tlv_subtlv_lb_block_length", FT_UINT32
,
12612 BASE_DEC
, NULL
, 0x0, NULL
, HFILL
}},
12613 { &hf_bgp_update_encaps_tunnel_subtlv_vxlan_flags
,
12614 { "Flags", "bgp.update.encaps_tunnel_tlv_subtlv.vxlan.flags", FT_UINT8
,
12615 BASE_HEX
, NULL
, 0x0, NULL
, HFILL
}},
12616 { &hf_bgp_update_encaps_tunnel_subtlv_vxlan_flags_valid_vnid
,
12617 { "Valid VN-ID", "bgp.update.encaps_tunnel_tlv_subtlv.vxlan.flags.valid_vnid", FT_BOOLEAN
,
12618 8, TFS(&tfs_set_notset
), TUNNEL_SUBTLV_VXLAN_VALID_VNID
, NULL
, HFILL
}},
12619 { &hf_bgp_update_encaps_tunnel_subtlv_vxlan_flags_valid_mac
,
12620 { "Valid MAC address", "bgp.update.encaps_tunnel_tlv_subtlv.vxlan.flags.valid_mac", FT_BOOLEAN
,
12621 8, TFS(&tfs_set_notset
), TUNNEL_SUBTLV_VXLAN_VALID_MAC
, NULL
, HFILL
}},
12622 { &hf_bgp_update_encaps_tunnel_subtlv_vxlan_flags_reserved
,
12623 { "Reserved", "bgp.update.encaps_tunnel_tlv_subtlv.vxlan.flags.reserved", FT_UINT8
,
12624 BASE_HEX
, NULL
, TUNNEL_SUBTLV_VXLAN_RESERVED
, NULL
, HFILL
}},
12625 { &hf_bgp_update_encaps_tunnel_subtlv_vxlan_vnid
,
12626 { "VN-ID", "bgp.update.encaps_tunnel_tlv_subtlv.vxlan.vnid", FT_UINT24
,
12627 BASE_HEX
, NULL
, 0x0, NULL
, HFILL
}},
12628 { &hf_bgp_update_encaps_tunnel_subtlv_vxlan_mac
,
12629 { "MAC", "bgp.update.encaps_tunnel_tlv_subtlv.vxlan.mac", FT_ETHER
,
12630 BASE_NONE
, NULL
, 0x0, NULL
, HFILL
}},
12631 { &hf_bgp_update_encaps_tunnel_subtlv_vxlan_reserved
,
12632 { "Reserved", "bgp.update.encaps_tunnel_tlv_subtlv.vxlan.reserved", FT_UINT16
,
12633 BASE_HEX
, NULL
, 0x0, NULL
, HFILL
}},
12634 { &hf_bgp_update_encaps_tunnel_subtlv_vxlan_gpe_flags
,
12635 { "Flags", "bgp.update.encaps_tunnel_tlv_subtlv.vxlan_gpe.flags", FT_UINT8
,
12636 BASE_HEX
, NULL
, 0x0, NULL
, HFILL
}},
12637 { &hf_bgp_update_encaps_tunnel_subtlv_vxlan_gpe_flags_version
,
12638 { "Version", "bgp.update.encaps_tunnel_tlv_subtlv.vxlan_gpe.flags.version", FT_UINT8
,
12639 BASE_DEC
, NULL
, TUNNEL_SUBTLV_VXLAN_GPE_VERSION
, NULL
, HFILL
}},
12640 { &hf_bgp_update_encaps_tunnel_subtlv_vxlan_gpe_flags_valid_vnid
,
12641 { "Valid VN-ID", "bgp.update.encaps_tunnel_tlv_subtlv.vxlan_gpe.flags.valid_vnid", FT_BOOLEAN
,
12642 8, TFS(&tfs_set_notset
), TUNNEL_SUBTLV_VXLAN_GPE_VALID_VNID
, NULL
, HFILL
}},
12643 { &hf_bgp_update_encaps_tunnel_subtlv_vxlan_gpe_flags_reserved
,
12644 { "Reserved", "bgp.update.encaps_tunnel_tlv_subtlv.vxlan_gpe.flags.reserved", FT_UINT8
,
12645 BASE_HEX
, NULL
, TUNNEL_SUBTLV_VXLAN_GPE_RESERVED
, NULL
, HFILL
}},
12646 { &hf_bgp_update_encaps_tunnel_subtlv_vxlan_gpe_vnid
,
12647 { "VN-ID", "bgp.update.encaps_tunnel_tlv_subtlv.vxlan_gpe.vnid", FT_UINT24
,
12648 BASE_HEX
, NULL
, 0x0, NULL
, HFILL
}},
12649 { &hf_bgp_update_encaps_tunnel_subtlv_vxlan_gpe_reserved
,
12650 { "Reserved", "bgp.update.encaps_tunnel_tlv_subtlv.vxlan_gpe.reserved", FT_UINT16
,
12651 BASE_HEX
, NULL
, 0x0, NULL
, HFILL
}},
12652 { &hf_bgp_update_encaps_tunnel_subtlv_nvgre_flags
,
12653 { "Flags", "bgp.update.encaps_tunnel_tlv_subtlv.nvgre.flags", FT_UINT8
,
12654 BASE_HEX
, NULL
, 0x0, NULL
, HFILL
}},
12655 { &hf_bgp_update_encaps_tunnel_subtlv_nvgre_flags_valid_vnid
,
12656 { "Valid VN-ID", "bgp.update.encaps_tunnel_tlv_subtlv.nvgre.flags.valid_vnid", FT_BOOLEAN
,
12657 8, TFS(&tfs_set_notset
), TUNNEL_SUBTLV_NVGRE_VALID_VNID
, NULL
, HFILL
}},
12658 { &hf_bgp_update_encaps_tunnel_subtlv_nvgre_flags_valid_mac
,
12659 { "Valid MAC address", "bgp.update.encaps_tunnel_tlv_subtlv.nvgre.flags.valid_mac", FT_BOOLEAN
,
12660 8, TFS(&tfs_set_notset
), TUNNEL_SUBTLV_NVGRE_VALID_MAC
, NULL
, HFILL
}},
12661 { &hf_bgp_update_encaps_tunnel_subtlv_nvgre_flags_reserved
,
12662 { "Reserved", "bgp.update.encaps_tunnel_tlv_subtlv.nvgre.flags.reserved", FT_UINT8
,
12663 BASE_HEX
, NULL
, TUNNEL_SUBTLV_NVGRE_RESERVED
, NULL
, HFILL
}},
12664 { &hf_bgp_update_encaps_tunnel_subtlv_nvgre_vnid
,
12665 { "VN-ID", "bgp.update.encaps_tunnel_tlv_subtlv.nvgre.vnid", FT_UINT24
,
12666 BASE_HEX
, NULL
, 0x0, NULL
, HFILL
}},
12667 { &hf_bgp_update_encaps_tunnel_subtlv_nvgre_mac
,
12668 { "MAC", "bgp.update.encaps_tunnel_tlv_subtlv.nvgre.mac", FT_ETHER
,
12669 BASE_NONE
, NULL
, 0x0, NULL
, HFILL
}},
12670 { &hf_bgp_update_encaps_tunnel_subtlv_nvgre_reserved
,
12671 { "Reserved", "bgp.update.encaps_tunnel_tlv_subtlv.nvgre.reserved", FT_UINT16
,
12672 BASE_HEX
, NULL
, 0x0, NULL
, HFILL
}},
12673 { &hf_bgp_update_encaps_tunnel_subtlv_value
,
12674 { "Value", "bgp.update.encaps_tunnel_tlv_subtlv.value", FT_BYTES
,
12675 BASE_NONE
, NULL
, 0x0, NULL
, HFILL
}},
12676 { &hf_bgp_update_encaps_tunnel_subtlv_pref_flags
,
12677 { "Flags", "bgp.update.encaps_tunnel_tlv_subtlv.pref.flags", FT_UINT8
,
12678 BASE_HEX
, NULL
, 0x0, NULL
, HFILL
}},
12679 { &hf_bgp_update_encaps_tunnel_subtlv_pref_reserved
,
12680 { "Reserved", "bgp.update.encaps_tunnel_tlv_subtlv.pref.reserved", FT_UINT8
,
12681 BASE_HEX
, NULL
, 0x0, NULL
, HFILL
}},
12682 { &hf_bgp_update_encaps_tunnel_subtlv_pref_preference
,
12683 { "Preference", "bgp.update.encaps_tunnel_tlv_subtlv.pref.preference", FT_BYTES
,
12684 BASE_NONE
, NULL
, 0x0, NULL
, HFILL
}},
12685 { &hf_bgp_update_encaps_tunnel_subtlv_binding_sid_flags
,
12686 { "Flags", "bgp.update.encaps_tunnel_tlv_subtlv.binding_sid.flags", FT_UINT8
,
12687 BASE_HEX
, NULL
, 0x0, NULL
, HFILL
}},
12688 { &hf_bgp_update_encaps_tunnel_subtlv_binding_sid_flags_specified
,
12689 { "Specified-BSID-only", "bgp.update.encaps_tunnel_tlv_subtlv.binding_sid.flags.specified", FT_BOOLEAN
,
12690 8, TFS(&tfs_set_notset
), TUNNEL_SUBTLV_BINDING_SPECIFIED
, NULL
, HFILL
}},
12691 { &hf_bgp_update_encaps_tunnel_subtlv_binding_sid_flags_invalid
,
12692 { "Drop Upon Invalid", "bgp.update.encaps_tunnel_tlv_subtlv.binding_sid.flags.invalid", FT_BOOLEAN
,
12693 8, TFS(&tfs_set_notset
), TUNNEL_SUBTLV_BINDING_INVALID
, NULL
, HFILL
}},
12694 { &hf_bgp_update_encaps_tunnel_subtlv_binding_sid_flags_reserved
,
12695 { "Reserved", "bgp.update.encaps_tunnel_tlv_subtlv.binding_sid.flags.reserved", FT_UINT8
,
12696 BASE_HEX
, NULL
, TUNNEL_SUBTLV_BINDING_RESERVED
, NULL
, HFILL
}},
12697 { &hf_bgp_update_encaps_tunnel_subtlv_binding_sid_reserved
,
12698 { "Reserved", "bgp.update.encaps_tunnel_tlv_subtlv.binding_sid.reserved", FT_UINT8
,
12699 BASE_HEX
, NULL
, 0x0, NULL
, HFILL
}},
12700 { &hf_bgp_update_encaps_tunnel_subtlv_binding_sid_sid
,
12701 { "Binding SID", "bgp.update.encaps_tunnel_tlv_subtlv.binding_sid.sid", FT_BYTES
,
12702 BASE_NONE
, NULL
, 0x0, NULL
, HFILL
}},
12703 { &hf_bgp_update_encaps_tunnel_subtlv_enlp_flags
,
12704 { "Flags", "bgp.update.encaps_tunnel_tlv_subtlv.enlp.flags", FT_UINT8
,
12705 BASE_HEX
, NULL
, 0x0, NULL
, HFILL
}},
12706 { &hf_bgp_update_encaps_tunnel_subtlv_enlp_reserved
,
12707 { "Reserved", "bgp.update.encaps_tunnel_tlv_subtlv.enlp.reserved", FT_UINT8
,
12708 BASE_HEX
, NULL
, 0x0, NULL
, HFILL
}},
12709 { &hf_bgp_update_encaps_tunnel_subtlv_enlp_enlp
,
12710 { "ENLP", "bgp.update.encaps_tunnel_tlv_subtlv.enlp.preference", FT_UINT8
,
12711 BASE_DEC
, VALS(bgp_enlp_type
), 0x0, NULL
, HFILL
}},
12712 { &hf_bgp_update_encaps_tunnel_subtlv_priority_priority
,
12713 { "Priority", "bgp.update.encaps_tunnel_tlv_subtlv.priority.priority", FT_UINT8
,
12714 BASE_DEC
, NULL
, 0x0, NULL
, HFILL
}},
12715 { &hf_bgp_update_encaps_tunnel_subtlv_priority_reserved
,
12716 { "Reserved", "bgp.update.encaps_tunnel_tlv_subtlv.priority.reserved", FT_UINT8
,
12717 BASE_HEX
, NULL
, 0x0, NULL
, HFILL
}},
12718 { &hf_bgp_update_encaps_tunnel_subtlv_segment_list_reserved
,
12719 { "Reserved", "bgp.update.encaps_tunnel_tlv_subtlv.segment_list.reserved", FT_UINT8
,
12720 BASE_HEX
, NULL
, 0x0, NULL
, HFILL
}},
12721 { &hf_bgp_update_encaps_tunnel_subtlv_segment_list_subtlv
,
12722 { "sub-TLVs", "bgp.update.encaps_tunnel_tlv_subtlv.segment_list.subtlv", FT_BYTES
,
12723 BASE_NONE
, NULL
, 0x0, NULL
, HFILL
}},
12724 { &hf_bgp_update_encaps_tunnel_subtlv_segment_list_subtlv_type
,
12725 { "Type", "bgp.update.encaps_tunnel_tlv_subtlv.segment_list.subtlv.type", FT_UINT8
,
12726 BASE_DEC
, VALS(bgp_sr_policy_list_type
), 0x0, NULL
, HFILL
}},
12727 { &hf_bgp_update_encaps_tunnel_subtlv_segment_list_subtlv_length
,
12728 { "Length", "bgp.update.encaps_tunnel_tlv_subtlv.segment_list.subtlv.length", FT_UINT8
,
12729 BASE_DEC
, NULL
, 0x0, NULL
, HFILL
}},
12730 { &hf_bgp_update_encaps_tunnel_subtlv_segment_list_subtlv_flags
,
12731 { "Flags", "bgp.update.encaps_tunnel_tlv_subtlv.segment_list_subtlv.flags", FT_UINT8
,
12732 BASE_HEX
, NULL
, 0x0, NULL
, HFILL
}},
12733 { &hf_bgp_update_encaps_tunnel_subtlv_segment_list_subtlv_flags_verification
,
12734 { "SID verification", "bgp.update.encaps_tunnel_tlv_subtlv.segment_list_subtlv.flags.verification", FT_BOOLEAN
,
12735 8, TFS(&tfs_set_notset
), TUNNEL_SUBTLV_SEGMENT_LIST_SUB_VERIFICATION
, NULL
, HFILL
}},
12736 { &hf_bgp_update_encaps_tunnel_subtlv_segment_list_subtlv_flags_algorithm
,
12737 { "SR Algorithm id", "bgp.update.encaps_tunnel_tlv_subtlv.segment_list_subtlv.flags.algorithm", FT_BOOLEAN
,
12738 8, TFS(&tfs_set_notset
), TUNNEL_SUBTLV_SEGMENT_LIST_SUB_ALGORITHM
, NULL
, HFILL
}},
12739 { &hf_bgp_update_encaps_tunnel_subtlv_segment_list_subtlv_flags_reserved
,
12740 { "Reserved", "bgp.update.encaps_tunnel_tlv_subtlv.segment_list_subtlv.flags.reserved", FT_UINT8
,
12741 BASE_HEX
, NULL
, TUNNEL_SUBTLV_SEGMENT_LIST_SUB_RESERVED
, NULL
, HFILL
}},
12742 { &hf_bgp_update_encaps_tunnel_subtlv_segment_list_subtlv_reserved
,
12743 { "Reserved", "bgp.update.encaps_tunnel_tlv_subtlv.segment_list_subtlv.reserved", FT_BYTES
,
12744 BASE_NONE
, NULL
, 0x0, NULL
, HFILL
}},
12745 { &hf_bgp_update_encaps_tunnel_subtlv_segment_list_subtlv_mpls_label
,
12746 { "MPLS Label", "bgp.update.encaps_tunnel_tlv_subtlv.segment_list_subtlv.mpls_label", FT_UINT24
,
12747 BASE_HEX
, NULL
, BGP_MPLS_LABEL
, NULL
, HFILL
}},
12748 { &hf_bgp_update_encaps_tunnel_subtlv_segment_list_subtlv_traffic_class
,
12749 { "Traffic Class", "bgp.update.encaps_tunnel_tlv_subtlv.segment_list_subtlv.traffic_class", FT_UINT24
,
12750 BASE_HEX
, NULL
, BGP_MPLS_TRAFFIC_CLASS
, NULL
, HFILL
}},
12751 { &hf_bgp_update_encaps_tunnel_subtlv_segment_list_subtlv_bottom_stack
,
12752 { "Bottom-of-Stack", "bgp.update.encaps_tunnel_tlv_subtlv.segment_list_subtlv.bottom_stack", FT_BOOLEAN
,
12753 24, NULL
, BGP_MPLS_BOTTOM_L_STACK
, NULL
, HFILL
}},
12754 { &hf_bgp_update_encaps_tunnel_subtlv_segment_list_subtlv_ttl
,
12755 { "TTL", "bgp.update.encaps_tunnel_tlv_subtlv.segment_list_subtlv.ttl", FT_UINT8
,
12756 BASE_DEC
, NULL
, 0x0, NULL
, HFILL
}},
12757 { &hf_bgp_update_encaps_tunnel_subtlv_segment_list_subtlv_data
,
12758 { "Data", "bgp.update.encaps_tunnel_tlv_subtlv.segment_list.subtlv.data", FT_BYTES
,
12759 BASE_NONE
, NULL
, 0x0, NULL
, HFILL
}},
12760 { &hf_bgp_update_encaps_tunnel_subtlv_policy_name_reserved
,
12761 { "Reserved", "bgp.update.encaps_tunnel_tlv_subtlv.policy_name.reserved", FT_UINT8
,
12762 BASE_HEX
, NULL
, 0x0, NULL
, HFILL
}},
12763 { &hf_bgp_update_encaps_tunnel_subtlv_policy_name_name
,
12764 { "Policy name", "bgp.update.encaps_tunnel_tlv_subtlv.policy_name.name", FT_STRING
,
12765 BASE_NONE
, NULL
, 0x0, NULL
, HFILL
}},
12767 /* BGP update path attribute SSA SAFI (deprecated IETF draft) */
12769 { "Transitive bit", "bgp.ssa_t", FT_BOOLEAN
, 8,
12770 NULL
, 0x80, "SSA Transitive bit", HFILL
}},
12771 { &hf_bgp_ssa_type
,
12772 { "SSA Type", "bgp.ssa_type", FT_UINT16
, BASE_DEC
,
12773 VALS(bgp_ssa_type
), 0x7FFF, NULL
, HFILL
}},
12775 { "Length", "bgp.ssa_len", FT_UINT16
, BASE_DEC
,
12776 NULL
, 0x0, "SSA Length", HFILL
}},
12777 { &hf_bgp_ssa_value
,
12778 { "Value", "bgp.ssa_value", FT_BYTES
, BASE_NONE
,
12779 NULL
, 0x0, "SSA Value", HFILL
}},
12780 { &hf_bgp_ssa_l2tpv3_pref
,
12781 { "Preference", "bgp.ssa_l2tpv3_pref", FT_UINT16
, BASE_DEC
,
12782 NULL
, 0x0, NULL
, HFILL
}},
12783 { &hf_bgp_ssa_l2tpv3_s
,
12784 { "Sequencing bit", "bgp.ssa_l2tpv3_s", FT_BOOLEAN
, 8,
12785 NULL
, 0x80, "Sequencing S-bit", HFILL
}},
12786 { &hf_bgp_ssa_l2tpv3_unused
,
12787 { "Unused", "bgp.ssa_l2tpv3_Unused", FT_BOOLEAN
, 8,
12788 NULL
, 0x7F, "Unused Flags", HFILL
}},
12789 { &hf_bgp_ssa_l2tpv3_cookie_len
,
12790 { "Cookie Length", "bgp.ssa_l2tpv3_cookie_len", FT_UINT8
, BASE_DEC
,
12791 NULL
, 0x0, NULL
, HFILL
}},
12792 { &hf_bgp_ssa_l2tpv3_session_id
,
12793 { "Session ID", "bgp.ssa_l2tpv3_session_id", FT_UINT32
, BASE_DEC
,
12794 NULL
, 0x0, NULL
, HFILL
}},
12795 { &hf_bgp_ssa_l2tpv3_cookie
,
12796 { "Cookie", "bgp.ssa_l2tpv3_cookie", FT_BYTES
, BASE_NONE
,
12797 NULL
, 0x0, NULL
, HFILL
}},
12798 { &hf_bgp_withdrawn_prefix
,
12799 { "Withdrawn prefix", "bgp.withdrawn_prefix", FT_IPv4
, BASE_NONE
,
12800 NULL
, 0x0, NULL
, HFILL
}},
12802 /* NLRI header description */
12803 { &hf_bgp_update_nlri
,
12804 { "Network Layer Reachability Information (NLRI)", "bgp.update.nlri", FT_NONE
, BASE_NONE
,
12805 NULL
, 0x0, NULL
, HFILL
}},
12806 /* Global NLRI description */
12807 { &hf_bgp_mp_reach_nlri_ipv4_prefix
,
12808 { "MP Reach NLRI IPv4 prefix", "bgp.mp_reach_nlri_ipv4_prefix", FT_IPv4
, BASE_NONE
,
12809 NULL
, 0x0, NULL
, HFILL
}},
12810 { &hf_bgp_mp_unreach_nlri_ipv4_prefix
,
12811 { "MP Unreach NLRI IPv4 prefix", "bgp.mp_unreach_nlri_ipv4_prefix", FT_IPv4
, BASE_NONE
,
12812 NULL
, 0x0, NULL
, HFILL
}},
12813 { &hf_bgp_mp_reach_nlri_ipv6_prefix
,
12814 { "MP Reach NLRI IPv6 prefix", "bgp.mp_reach_nlri_ipv6_prefix", FT_IPv6
, BASE_NONE
,
12815 NULL
, 0x0, NULL
, HFILL
}},
12816 { &hf_bgp_mp_unreach_nlri_ipv6_prefix
,
12817 { "MP Unreach NLRI IPv6 prefix", "bgp.mp_unreach_nlri_ipv6_prefix", FT_IPv6
, BASE_NONE
,
12818 NULL
, 0x0, NULL
, HFILL
}},
12819 { &hf_bgp_mp_nlri_tnl_id
,
12820 { "MP Reach NLRI Tunnel Identifier", "bgp.mp_nlri_tnl_id", FT_UINT16
, BASE_HEX
,
12821 NULL
, 0x0, NULL
, HFILL
}},
12822 { &hf_bgp_nlri_prefix
,
12823 { "NLRI prefix", "bgp.nlri_prefix", FT_IPv4
, BASE_NONE
,
12824 NULL
, 0x0, NULL
, HFILL
}},
12825 { &hf_bgp_nlri_path_id
,
12826 { "NLRI path id", "bgp.nlri_path_id", FT_UINT32
, BASE_DEC
,
12827 NULL
, 0x0, NULL
, HFILL
}},
12829 /* mcast vpn nlri and capability */
12830 { &hf_bgp_mcast_vpn_nlri_t
,
12831 { "MCAST-VPN nlri", "bgp.mcast_vpn_nlri", FT_BYTES
, BASE_NONE
,
12832 NULL
, 0x0, NULL
, HFILL
}},
12833 { &hf_bgp_mcast_vpn_nlri_route_type
,
12834 { "Route Type", "bgp.mcast_vpn_nlri_route_type", FT_UINT8
,
12835 BASE_DEC
, VALS(mcast_vpn_route_type
), 0x0, NULL
, HFILL
}},
12836 { &hf_bgp_mcast_vpn_nlri_length
,
12837 { "Length", "bgp.mcast_vpn_nlri_length", FT_UINT8
,
12838 BASE_DEC
, NULL
, 0x0, NULL
, HFILL
}},
12839 { &hf_bgp_mcast_vpn_nlri_rd
,
12840 { "Route Distinguisher", "bgp.mcast_vpn_nlri_rd", FT_BYTES
,
12841 BASE_NONE
, NULL
, 0x0, NULL
, HFILL
}},
12842 { &hf_bgp_mcast_vpn_nlri_origin_router_ipv4
,
12843 { "Originating Router", "bgp.mcast_vpn_nlri_origin_router_ipv4", FT_IPv4
,
12844 BASE_NONE
, NULL
, 0x0, NULL
, HFILL
}},
12845 { &hf_bgp_mcast_vpn_nlri_origin_router_ipv6
,
12846 { "Originating Router", "bgp.mcast_vpn_nlri_origin_router_ipv6", FT_IPv6
,
12847 BASE_NONE
, NULL
, 0x0, NULL
, HFILL
}},
12848 { &hf_bgp_mcast_vpn_nlri_source_as
,
12849 { "Source AS", "bgp.mcast_vpn_nlri_source_as", FT_UINT32
,
12850 BASE_DEC
, NULL
, 0x0, NULL
, HFILL
}},
12851 { &hf_bgp_mcast_vpn_nlri_source_length
,
12852 { "Multicast Source Length", "bgp.mcast_vpn_nlri_source_length", FT_UINT8
,
12853 BASE_DEC
, NULL
, 0x0, NULL
, HFILL
}},
12854 { &hf_bgp_mcast_vpn_nlri_group_length
,
12855 { "Multicast Group Length", "bgp.mcast_vpn_nlri_group_length", FT_UINT8
,
12856 BASE_DEC
, NULL
, 0x0, NULL
, HFILL
}},
12857 { &hf_bgp_mcast_vpn_nlri_source_addr_ipv4
,
12858 { "Multicast Source Address", "bgp.mcast_vpn_nlri_source_addr_ipv4", FT_IPv4
,
12859 BASE_NONE
, NULL
, 0x0, NULL
, HFILL
}},
12860 { &hf_bgp_mcast_vpn_nlri_source_addr_ipv6
,
12861 { "Multicast Source Address", "bgp.mcast_vpn_nlri_source_addr_ipv6", FT_IPv6
,
12862 BASE_NONE
, NULL
, 0x0, NULL
, HFILL
}},
12863 { &hf_bgp_mcast_vpn_nlri_group_addr_ipv4
,
12864 { "Multicast Group Address", "bgp.mcast_vpn_nlri_group_addr_ipv4", FT_IPv4
,
12865 BASE_NONE
, NULL
, 0x0, NULL
, HFILL
}},
12866 { &hf_bgp_mcast_vpn_nlri_group_addr_ipv6
,
12867 { "Group Address", "bgp.mcast_vpn_nlri_group_addr_ipv6", FT_IPv6
,
12868 BASE_NONE
, NULL
, 0x0, NULL
, HFILL
}},
12869 { &hf_bgp_mcast_vpn_nlri_route_key
,
12870 { "Route Key", "bgp.mcast_vpn_nlri_route_key", FT_BYTES
,
12871 BASE_NONE
, NULL
, 0x0, NULL
, HFILL
}},
12872 /* sr policy nlri*/
12873 { &hf_bgp_sr_policy_nlri_length
,
12874 { "NLRI length", "bgp.sr_policy_nlri_length", FT_UINT8
,
12875 BASE_DEC
, NULL
, 0x0, "NLRI length in bits", HFILL
}},
12876 { &hf_bgp_sr_policy_nlri_distinguisher
,
12877 { "Distinguisher", "bgp.sr_policy_nlri_distinguisher", FT_BYTES
,
12878 BASE_NONE
, NULL
, 0x0, NULL
, HFILL
}},
12879 { &hf_bgp_sr_policy_nlri_policy_color
,
12880 { "Policy color", "bgp.sr_policy_nlri_policy_color", FT_BYTES
,
12881 BASE_NONE
, NULL
, 0x0, NULL
, HFILL
}},
12882 { &hf_bgp_sr_policy_nlri_endpoint_v4
,
12883 { "Endpoint", "bgp.sr_policy_nlri_endpoint_ipv4", FT_IPv4
,
12884 BASE_NONE
, NULL
, 0x0, NULL
, HFILL
}},
12885 { &hf_bgp_sr_policy_nlri_endpoint_v6
,
12886 { "Endpoint", "bgp.sr_policy_nlri_endpoint_ipv6", FT_IPv6
,
12887 BASE_NONE
, NULL
, 0x0, NULL
, HFILL
}},
12888 /* Bgp flow spec nlri and capability */
12889 { &hf_bgp_flowspec_nlri_t
,
12890 { "FLOW-SPEC nlri", "bgp.flowspec_nlri", FT_BYTES
, BASE_NONE
,
12891 NULL
, 0x0, NULL
, HFILL
}},
12892 { &hf_bgp_flowspec_nlri_route_distinguisher
,
12893 { "Route Distinguisher", "bgp.flowspec_route_distinguisher", FT_NONE
,
12894 BASE_NONE
, NULL
, 0x0, NULL
, HFILL
}},
12895 { &hf_bgp_flowspec_nlri_route_distinguisher_type
,
12896 { "Route Distinguisher Type", "bgp.flowspec_route_distinguisher_type", FT_UINT16
,
12897 BASE_DEC
, NULL
, 0x0, NULL
, HFILL
}},
12898 { &hf_bgp_flowspec_nlri_route_dist_admin_asnum_2
,
12899 { "Administrator Subfield", "bgp.flowspec_route_distinguisher_admin_as_num_2", FT_UINT16
,
12900 BASE_DEC
, NULL
, 0x0, NULL
, HFILL
}},
12901 { &hf_bgp_flowspec_nlri_route_dist_admin_ipv4
,
12902 { "Administrator Subfield", "bgp.flowspec_route_distinguisher_admin_ipv4", FT_IPv4
,
12903 BASE_NONE
, NULL
, 0x0, NULL
, HFILL
}},
12904 { &hf_bgp_flowspec_nlri_route_dist_admin_asnum_4
,
12905 { "Administrator Subfield", "bgp.flowspec_route_distinguisher_admin_as_num_4", FT_UINT32
,
12906 BASE_HEX_DEC
, NULL
, 0x0, NULL
, HFILL
}},
12907 { &hf_bgp_flowspec_nlri_route_dist_asnum_2
,
12908 { "Assigned Number Subfield", "bgp.flowspec_route_distinguisher_asnum_2", FT_UINT16
,
12909 BASE_DEC
, NULL
, 0x0, NULL
, HFILL
}},
12910 { &hf_bgp_flowspec_nlri_route_dist_asnum_4
,
12911 { "Assigned Number Subfield", "bgp.flowspec_route_distinguisher_asnum_4", FT_UINT32
,
12912 BASE_HEX_DEC
, NULL
, 0x0, NULL
, HFILL
}},
12913 { &hf_bgp_flowspec_nlri_filter
,
12914 { "Filter", "bgp.flowspec_nlri.filter", FT_NONE
, BASE_NONE
,
12915 NULL
, 0x0, NULL
, HFILL
}},
12916 { &hf_bgp_flowspec_nlri_filter_type
,
12917 { "Filter type", "bgp.flowspec_nlri.filter_type", FT_UINT8
, BASE_DEC
,
12918 VALS(flowspec_nlri_opvaluepair_type
), 0x0, NULL
, HFILL
}},
12919 { &hf_bgp_flowspec_nlri_length
,
12920 { "NRLI length", "bgp.flowspec_nlri.length", FT_UINT16
, BASE_DEC
,
12921 NULL
, 0x0, NULL
, HFILL
}},
12922 { &hf_bgp_flowspec_nlri_op_flags
,
12923 { "Operator flags", "bgp.flowspec_nlri.opflags", FT_UINT8
, BASE_HEX
,
12924 NULL
, 0x0, NULL
, HFILL
}},
12925 { &hf_bgp_flowspec_nlri_dst_pref_ipv4
,
12926 { "Destination IP filter", "bgp.flowspec_nlri.dst_prefix_filter", FT_IPv4
,
12927 BASE_NONE
, NULL
, 0x0, NULL
, HFILL
}},
12928 { &hf_bgp_flowspec_nlri_src_pref_ipv4
,
12929 { "Source IP filter", "bgp.flowspec_nlri.src_prefix_filter", FT_IPv4
,
12930 BASE_NONE
, NULL
, 0x0, NULL
, HFILL
}},
12931 { &hf_bgp_flowspec_nlri_op_eol
,
12932 { "end-of-list", "bgp.flowspec_nlri.op.eol", FT_BOOLEAN
, 8,
12933 TFS(&tfs_set_notset
), BGPNLRI_FSPEC_END_OF_LST
, NULL
, HFILL
}},
12934 { &hf_bgp_flowspec_nlri_op_and
,
12935 { "and", "bgp.flowspec_nlri.op.and", FT_BOOLEAN
, 8,
12936 TFS(&tfs_set_notset
), BGPNLRI_FSPEC_AND_BIT
, NULL
, HFILL
}},
12937 { &hf_bgp_flowspec_nlri_op_val_len
,
12938 { "Value length", "bgp.flowspec_nlri.op.val_len", FT_UINT8
, BASE_DEC
,
12939 VALS(flow_spec_op_len_val
), BGPNLRI_FSPEC_VAL_LEN
, NULL
, HFILL
}},
12940 { &hf_bgp_flowspec_nlri_op_un_bit4
,
12941 { "Reserved", "bgp.flowspec_nlri.op.un_bit4", FT_BOOLEAN
, 8,
12942 TFS(&tfs_set_notset
), BGPNLRI_FSPEC_UNUSED_BIT4
, "Unused (must be zero)",HFILL
}},
12943 { &hf_bgp_flowspec_nlri_op_un_bit5
,
12944 { "Reserved", "bgp.flowspec_nlri.op.un_bit5", FT_BOOLEAN
, 8,
12945 TFS(&tfs_set_notset
), BGPNLRI_FSPEC_UNUSED_BIT5
, "Unused (must be zero)", HFILL
}},
12946 { &hf_bgp_flowspec_nlri_dec_val_8
,
12947 { "Decimal value", "bgp.flowspec_nlri.dec_val_8", FT_UINT8
, BASE_DEC
,
12948 NULL
, 0x0, NULL
, HFILL
}},
12949 { &hf_bgp_flowspec_nlri_dec_val_16
,
12950 { "Decimal value", "bgp.flowspec_nlri.dec_val_16", FT_UINT16
, BASE_DEC
,
12951 NULL
, 0x0, NULL
, HFILL
}},
12952 { &hf_bgp_flowspec_nlri_dec_val_32
,
12953 { "Decimal value", "bgp.flowspec_nlri.dec_val_32", FT_UINT32
, BASE_DEC
,
12954 NULL
, 0x0, NULL
, HFILL
}},
12955 { &hf_bgp_flowspec_nlri_dec_val_64
,
12956 { "Decimal value", "bgp.flowspec_nlri.dec_val_64", FT_UINT64
, BASE_DEC
,
12957 NULL
, 0x0, NULL
, HFILL
}},
12958 { &hf_bgp_flowspec_nlri_op_lt
,
12959 { "less than", "bgp.flowspec_nlri.op.lt", FT_BOOLEAN
, 8,
12960 TFS(&tfs_set_notset
), BGPNLRI_FSPEC_LESS_THAN
, NULL
, HFILL
}},
12961 { &hf_bgp_flowspec_nlri_op_gt
,
12962 { "greater than", "bgp.flowspec_nlri.op.gt", FT_BOOLEAN
, 8,
12963 TFS(&tfs_set_notset
), BGPNLRI_FSPEC_GREATER_THAN
, NULL
, HFILL
}},
12964 { &hf_bgp_flowspec_nlri_op_eq
,
12965 { "equal", "bgp.flowspec_nlri.op.equal", FT_BOOLEAN
, 8,
12966 TFS(&tfs_set_notset
), BGPNLRI_FSPEC_EQUAL
, NULL
, HFILL
}},
12967 { &hf_bgp_flowspec_nlri_op_flg_not
,
12968 { "logical negation", "bgp.flowspec_nlri.op.flg_not", FT_BOOLEAN
, 8,
12969 TFS(&tfs_set_notset
), BGPNLRI_FSPEC_TCPF_NOTBIT
, NULL
, HFILL
}},
12970 { &hf_bgp_flowspec_nlri_op_flg_match
,
12971 { "Match bit", "bgp.flowspec_nlri.op.flg_match", FT_BOOLEAN
, 8,
12972 TFS(&tfs_set_notset
), BGPNLRI_FSPEC_TCPF_MATCHBIT
, NULL
, HFILL
}},
12973 { &hf_bgp_flowspec_nlri_tcp_flags
,
12974 { "TCP flags", "bgp.flowspec_nlri.val_tcp.flags", FT_UINT8
, BASE_HEX
,
12975 NULL
, 0x0, NULL
, HFILL
}},
12976 { &hf_bgp_flowspec_nlri_tcp_flags_cwr
,
12977 { "Congestion Window Reduced (CWR)", "bgp.flowspec_nlri.val_tcp.flags.cwr", FT_BOOLEAN
, 8,
12978 TFS(&tfs_set_notset
), BGPNLRI_FSPEC_TH_CWR
, NULL
, HFILL
}},
12979 { &hf_bgp_flowspec_nlri_tcp_flags_ecn
,
12980 { "ECN-Echo", "bgp.flowspec_nlri.val_tcp.flags.ecn", FT_BOOLEAN
, 8,
12981 TFS(&tfs_set_notset
), BGPNLRI_FSPEC_TH_ECN
, NULL
, HFILL
}},
12982 { &hf_bgp_flowspec_nlri_tcp_flags_urg
,
12983 { "Urgent", "bgp.flowspec_nlri.val_tcp.flags.urg", FT_BOOLEAN
, 8,
12984 TFS(&tfs_set_notset
), BGPNLRI_FSPEC_TH_URG
, NULL
, HFILL
}},
12985 { &hf_bgp_flowspec_nlri_tcp_flags_ack
,
12986 { "Acknowledgment", "bgp.flowspec_nlri.val_tcp.flags.ack", FT_BOOLEAN
, 8,
12987 TFS(&tfs_set_notset
), BGPNLRI_FSPEC_TH_ACK
, NULL
, HFILL
}},
12988 { &hf_bgp_flowspec_nlri_tcp_flags_push
,
12989 { "Push", "bgp.flowspec_nlri.val_tcp.flags.push", FT_BOOLEAN
, 8,
12990 TFS(&tfs_set_notset
), BGPNLRI_FSPEC_TH_PUSH
, NULL
, HFILL
}},
12991 { &hf_bgp_flowspec_nlri_tcp_flags_reset
,
12992 { "Reset", "bgp.flowspec_nlri.val_tcp.flags.reset", FT_BOOLEAN
, 8,
12993 TFS(&tfs_set_notset
), BGPNLRI_FSPEC_TH_RST
, NULL
, HFILL
}},
12994 { &hf_bgp_flowspec_nlri_tcp_flags_syn
,
12995 { "Syn", "bgp.flowspec_nlri.val_tcp.flags.syn", FT_BOOLEAN
, 8,
12996 TFS(&tfs_set_notset
), BGPNLRI_FSPEC_TH_SYN
, NULL
, HFILL
}},
12997 { &hf_bgp_flowspec_nlri_tcp_flags_fin
,
12998 { "Fin", "bgp.flowspec_nlri.val_tcp.flags.fin", FT_BOOLEAN
, 8,
12999 TFS(&tfs_set_notset
), BGPNLRI_FSPEC_TH_FIN
, NULL
, HFILL
}},
13000 { &hf_bgp_flowspec_nlri_fflag
,
13001 { "Fragment Flag", "bgp.flowspec_nlri.val_frag", FT_UINT8
, BASE_HEX
,
13002 NULL
, 0x0, NULL
, HFILL
}},
13003 { &hf_bgp_flowspec_nlri_fflag_lf
,
13004 { "Last fragment", "bgp.flowspec_nlri.val_frag_lf", FT_BOOLEAN
, 8,
13005 TFS(&tfs_set_notset
), BGPNLRI_FSPEC_FG_LF
, NULL
, HFILL
}},
13006 { &hf_bgp_flowspec_nlri_fflag_ff
,
13007 { "First fragment", "bgp.flowspec_nlri.val_frag_ff", FT_BOOLEAN
, 8,
13008 TFS(&tfs_set_notset
), BGPNLRI_FSPEC_FG_FF
, NULL
, HFILL
}},
13009 { &hf_bgp_flowspec_nlri_fflag_isf
,
13010 { "Is a fragment", "bgp.flowspec_nlri.val_frag_isf", FT_BOOLEAN
, 8,
13011 TFS(&tfs_set_notset
), BGPNLRI_FSPEC_FG_ISF
, NULL
, HFILL
}},
13012 { &hf_bgp_flowspec_nlri_fflag_df
,
13013 { "Don't fragment", "bgp.flowspec_nlri.val_frag_df", FT_BOOLEAN
, 8,
13014 TFS(&tfs_set_notset
), BGPNLRI_FSPEC_FG_DF
, NULL
, HFILL
}},
13015 { &hf_bgp_flowspec_nlri_dscp
,
13016 { "Differentiated Services Codepoint", "bgp.flowspec_nlri.val_dsfield", FT_UINT8
, BASE_HEX
| BASE_EXT_STRING
,
13017 &dscp_vals_ext
, BGPNLRI_FSPEC_DSCP_BITMASK
, NULL
, HFILL
}},
13018 { &hf_bgp_flowspec_nlri_src_ipv6_pref
,
13019 { "Source IPv6 prefix", "bgp.flowspec_nlri.src_ipv6_pref", FT_IPv6
, BASE_NONE
,
13020 NULL
, 0x0, NULL
, HFILL
}},
13021 { &hf_bgp_flowspec_nlri_dst_ipv6_pref
,
13022 { "Destination IPv6 prefix", "bgp.flowspec_nlri.dst_ipv6_pref", FT_IPv6
, BASE_NONE
,
13023 NULL
, 0x0, NULL
, HFILL
}},
13024 { &hf_bgp_flowspec_nlri_ipv6_pref_len
,
13025 { "IPv6 prefix length", "bgp.flowspec_nlri.ipv6_pref_length", FT_UINT8
, BASE_DEC
,
13026 NULL
, 0x0, NULL
, HFILL
}},
13027 { &hf_bgp_flowspec_nlri_ipv6_pref_offset
,
13028 { "IPv6 prefix offset", "bgp.flowspec_nlri.ipv6_pref_offset", FT_UINT8
, BASE_DEC
,
13029 NULL
, 0x0, NULL
, HFILL
}},
13030 /* end of bgp flow spec */
13031 /* BGP update safi ndt nlri draft-nalawade-idr-mdt-safi-03 */
13032 { &hf_bgp_mdt_nlri_safi_rd
,
13033 { "Route Distinguisher", "bgp.mdt_safi_rd", FT_BYTES
,
13034 BASE_NONE
, NULL
, 0x0, NULL
, HFILL
}},
13035 { &hf_bgp_mdt_nlri_safi_ipv4_addr
,
13036 { "IPv4 Address", "bgp.mdt_safi_ipv4_addr", FT_IPv4
,
13037 BASE_NONE
, NULL
, 0x0, NULL
, HFILL
}},
13038 { &hf_bgp_mdt_nlri_safi_group_addr
,
13039 { "Group Address", "bgp.mdt_safi_group_addr", FT_IPv4
,
13040 BASE_NONE
, NULL
, 0x0, NULL
, HFILL
}},
13041 /* BGP update extended community header field */
13042 { &hf_bgp_ext_communities
,
13043 { "Carried extended communities", "bgp.ext_communities", FT_NONE
, BASE_NONE
,
13044 NULL
, 0x0, NULL
, HFILL
}},
13045 { &hf_bgp_ext_community
,
13046 { "Community", "bgp.ext_community", FT_NONE
, BASE_NONE
,
13047 NULL
, 0x0, "Extended Community attribute", HFILL
}},
13048 { &hf_bgp_ext_com_type_high
,
13049 { "Type", "bgp.ext_com.type", FT_UINT8
, BASE_HEX
,
13050 VALS(bgpext_com_type_high
), 0x0, "Extended Community type", HFILL
}},
13051 { &hf_bgp_ext_com_type_auth
,
13052 { "IANA Authority", "bgp.ext_com.type.auth", FT_BOOLEAN
, 8,
13053 TFS(&tfs_bgpext_com_type_auth
), BGP_EXT_COM_TYPE_AUTH
, "IANA Type Allocation Policy", HFILL
}},
13054 {&hf_bgp_ext_com_type_tran
,
13055 { "Transitive across ASes", "bgp.ext_com.type.tran", FT_BOOLEAN
, 8,
13056 TFS(&tfs_non_transitive_transitive
), BGP_EXT_COM_TYPE_TRAN
, "Transitivity of the attribute across autonomous systems", HFILL
}},
13057 { &hf_bgp_ext_com_stype_low_unknown
,
13058 { "Subtype", "bgp.ext_com.stype_unknown", FT_UINT8
, BASE_HEX
,
13059 NULL
, 0x0, "Extended Community subtype", HFILL
}},
13060 { &hf_bgp_ext_com_stype_tr_evpn
,
13061 { "Subtype (EVPN)", "bgp.ext_com.stype_tr_evpn", FT_UINT8
, BASE_HEX
,
13062 VALS(bgpext_com_stype_tr_evpn
), 0x0, "EVPN Extended Community subtype", HFILL
}},
13063 { &hf_bgp_ext_com_stype_tr_as2
,
13064 { "Subtype (AS2)", "bgp.ext_com.stype_tr_as2", FT_UINT8
, BASE_HEX
,
13065 VALS(bgpext_com_stype_tr_as2
), 0x0, "2-Octet AS-Specific Transitive Extended Community subtype", HFILL
}},
13066 { &hf_bgp_ext_com_stype_ntr_as2
,
13067 { "Subtype (Non-transitive AS2)", "bgp.ext_com.stype_ntr_as2", FT_UINT8
, BASE_HEX
,
13068 VALS(bgpext_com_stype_ntr_as2
), 0x0, "2-Octet AS-Specific Non-transitive Extended Community subtype", HFILL
}},
13069 { &hf_bgp_ext_com_stype_tr_as4
,
13070 { "Subtype (AS4)", "bgp.ext_com.stype_tr_as4", FT_UINT8
, BASE_HEX
,
13071 VALS(bgpext_com_stype_tr_as4
), 0x0, "4-Octet AS-Specific Transitive Extended Community subtype", HFILL
}},
13072 { &hf_bgp_ext_com_stype_ntr_as4
,
13073 { "Subtype (Non-transitive AS4)", "bgp.ext_com.stype_ntr_as4", FT_UINT8
, BASE_HEX
,
13074 VALS(bgpext_com_stype_ntr_as4
), 0x0, "4-Octet AS-Specific Non-transitive Extended Community subtype", HFILL
}},
13075 { &hf_bgp_ext_com_stype_tr_IP4
,
13076 { "Subtype (IPv4)", "bgp.ext_com.stype_tr_IP4", FT_UINT8
, BASE_HEX
,
13077 VALS(bgpext_com_stype_tr_IP4
), 0x0, "IPv4-Address-Specific Transitive Extended Community subtype", HFILL
}},
13078 { &hf_bgp_ext_com_stype_ntr_IP4
,
13079 { "Subtype (Non-transitive IPv4)", "bgp.ext_com.stype_ntr_IP4", FT_UINT8
, BASE_HEX
,
13080 VALS(bgpext_com_stype_ntr_IP4
), 0x0, "IPv4-Address-Specific Non-transitive Extended Community subtype", HFILL
}},
13081 { &hf_bgp_ext_com_stype_tr_opaque
,
13082 { "Subtype (Opaque)", "bgp.ext_com.stype_tr_opaque", FT_UINT8
, BASE_HEX
,
13083 VALS(bgpext_com_stype_tr_opaque
), 0x0, "Opaque Transitive Extended Community subtype", HFILL
}},
13084 { &hf_bgp_ext_com_stype_ntr_opaque
,
13085 { "Subtype (Non-transitive Opaque)", "bgp.ext_com.stype_ntr_opaque", FT_UINT8
, BASE_HEX
,
13086 VALS(bgpext_com_stype_ntr_opaque
), 0x0, "Opaque Non-transitive Extended Community subtype", HFILL
}},
13087 { &hf_bgp_ext_com_tunnel_type
,
13088 { "Tunnel type", "bgp.ext_com.tunnel_type", FT_UINT16
, BASE_DEC
,
13089 VALS(bgpext_com_tunnel_type
), 0x0, "Tunnel encapsulation type", HFILL
}},
13090 { &hf_bgp_ext_com_stype_tr_mup
,
13091 { "Subtype (MUP)", "bgp.ext_com.stype_tr_mup", FT_UINT8
, BASE_HEX
,
13092 VALS(bgpext_com_stype_tr_mup
), 0x0, "MUP Extended Community subtype", HFILL
}},
13093 { &hf_bgp_ext_com_stype_tr_exp
,
13094 { "Subtype (Experimental)", "bgp.ext_com.stype_tr_exp", FT_UINT8
, BASE_HEX
,
13095 VALS(bgpext_com_stype_tr_exp
), 0x0, "Experimental Transitive Extended Community subtype", HFILL
}},
13096 { &hf_bgp_ext_com_stype_tr_exp_2
,
13097 { "Subtype (Experimental Part 2)", "bgp.ext_com.stype_tr_exp_2", FT_UINT8
, BASE_HEX
,
13098 VALS(bgpext_com_stype_tr_exp_2
), 0x0, "Generic Transitive Experimental Use Extended Community Part 2 Sub-Types", HFILL
}},
13099 { &hf_bgp_ext_com_stype_tr_exp_3
,
13100 { "Subtype (Experimental Part 3)", "bgp.ext_com.stype_tr_exp_3", FT_UINT8
, BASE_HEX
,
13101 VALS(bgpext_com_stype_tr_exp_3
), 0x0, "Generic Transitive Experimental Use Extended Community Part 3 Sub-Types", HFILL
}},
13102 { &hf_bgp_ext_com_value_as2
,
13103 { "2-Octet AS", "bgp.ext_com.value_as2", FT_UINT16
, BASE_DEC
,
13104 NULL
, 0x0, "Global Administrator Field value (2B Autonomous System Number)", HFILL
}},
13105 { &hf_bgp_ext_com_value_as4
,
13106 { "4-Octet AS", "bgp.ext_com.value_as4", FT_UINT32
, BASE_DEC
,
13107 NULL
, 0x0, "Global Administrator Field value (4B Autonomous System Number)", HFILL
}},
13108 { &hf_bgp_ext_com_value_IP4
,
13109 { "IPv4 address", "bgp.ext_com.value_IP4", FT_IPv4
, BASE_NONE
,
13110 NULL
, 0x0, "Global Administrator Field value (IPv4 Address)", HFILL
}},
13111 { &hf_bgp_ext_com_value_an2
,
13112 { "2-Octet AN", "bgp.ext_com.value_an2", FT_UINT16
, BASE_DEC
,
13113 NULL
, 0x0, "Local Administrator Field value (2B Assigned Number)", HFILL
}},
13114 { &hf_bgp_ext_com_value_an4
,
13115 { "4-Octet AN", "bgp.ext_com.value_an4", FT_UINT32
, BASE_DEC
,
13116 NULL
, 0x0, "Local Administrator Field value (4B Assigned Number)", HFILL
}},
13117 { &hf_bgp_ext_com_value_link_bw
,
13118 { "Link bandwidth", "bgp.ext_com.value_link_bw", FT_FLOAT
, BASE_NONE
,
13119 NULL
, 0x0, NULL
, HFILL
}},
13120 { &hf_bgp_ext_com_value_ospf_rt_area
,
13121 { "Area ID", "bgp.ext_com.value_ospf_rtype.area", FT_IPv4
, BASE_NONE
,
13122 NULL
, 0x0, "Original OSPF Area ID this route comes from", HFILL
}},
13123 { &hf_bgp_ext_com_value_ospf_rt_type
,
13124 { "Route type", "bgp.ext_com.value_ospf_rtype.type", FT_UINT8
, BASE_DEC
,
13125 VALS(bgpext_com_ospf_rtype
), 0x0, "Original OSPF LSA Type that carried this route", HFILL
}},
13126 { &hf_bgp_ext_com_value_ospf_rt_options
,
13127 { "Options", "bgp.ext_com.value_ospf_rtype.options", FT_UINT8
, BASE_HEX
,
13128 NULL
, 0x0, "OSPF Route Type Options bitfield", HFILL
}},
13129 { &hf_bgp_ext_com_value_ospf_rt_options_mt
,
13130 { "Metric type", "bgp.ext_com.value_ospf_rtype.options.mt", FT_BOOLEAN
, 8,
13131 TFS(&tfs_ospf_rt_mt
), BGP_OSPF_RTYPE_METRIC_TYPE
, "OSPF metric type (Type-1 or Type-2) of the original route", HFILL
}},
13132 { &hf_bgp_ext_com_value_ospf_rid
,
13133 { "Router ID", "bgp.ext_com.value_ospf_rid", FT_IPv4
, BASE_NONE
,
13134 NULL
, 0x0, "OSPF Router ID of the redistributing PE router", HFILL
}},
13135 { &hf_bgp_ext_com_value_fs_remark
,
13136 { "Remarking value", "bgp.ext_com.value_fs_dscp", FT_UINT8
, BASE_HEX
| BASE_EXT_STRING
,
13137 &dscp_vals_ext
, BGPNLRI_FSPEC_DSCP_BITMASK
, NULL
, HFILL
}},
13138 { &hf_bgp_ext_com_local_admin_flags
,
13139 { "Local Administrator", "bgp.ext_com.local_admin", FT_UINT8
, BASE_HEX
,
13140 NULL
, 0x0, NULL
, HFILL
}},
13141 { &hf_bgp_ext_com_local_admin_auto_derived_flag
,
13142 { "A-Bit", "bgp.ext_com.local_admin.auto_derived", FT_BOOLEAN
, 8,
13143 TFS(&tfs_manually_auto_derived
), 0x80, NULL
, HFILL
}},
13144 { &hf_bgp_ext_com_local_admin_type
,
13145 { "Type", "bgp.ext_com.local_admin.type", FT_UINT8
, BASE_DEC
,
13146 VALS(bgp_ext_com_local_admin_types
), 0x70, NULL
, HFILL
}},
13147 { &hf_bgp_ext_com_local_admin_domain_id
,
13148 { "Domain Id", "bgp.ext_com.local_admin.domain_id", FT_UINT8
, BASE_DEC
,
13149 NULL
, 0x0F, NULL
, HFILL
}},
13150 { &hf_bgp_ext_com_local_admin_service_id
,
13151 { "Service Id", "bgp.ext_com.local_admin.service_id", FT_UINT24
, BASE_DEC
,
13152 NULL
, 0x00, NULL
, HFILL
}},
13153 { &hf_bgp_ext_com_value_raw
,
13154 { "Raw Value", "bgp.ext_com.value_raw", FT_UINT48
, BASE_HEX
,
13155 NULL
, 0x0, "Raw value of the lowmost 6 octets of the Extended Community attribute", HFILL
}},
13156 /* BGP update extended community flow spec RFC 5575 */
13157 { &hf_bgp_ext_com_flow_act_samp_act
,
13158 { "Sample", "bgp.ext_com_flow.sample", FT_BOOLEAN
, 8,
13159 TFS(&tfs_set_notset
), BGP_EXT_COM_FSPEC_ACT_S
, NULL
, HFILL
}},
13160 { &hf_bgp_ext_com_flow_act_term_act
,
13161 { "Terminal action", "bgp.ext_com_flow.traff_act", FT_BOOLEAN
, 8,
13162 TFS(&tfs_set_notset
),BGP_EXT_COM_FSPEC_ACT_T
,NULL
, HFILL
}},
13163 { &hf_bgp_ext_com_flow_rate_float
,
13164 { "Rate shaper", "bgp.ext_com_flow.rate_limit", FT_FLOAT
, BASE_NONE
,
13165 NULL
, 0x0, NULL
, HFILL
}},
13166 { &hf_bgp_ext_com_flow_act_allset
,
13167 { "5 Bytes", "bgp.flowspec_ext_com.emptybytes", FT_BYTES
, BASE_NONE
,
13168 NULL
, 0x0, "Must be set to all 0", HFILL
}},
13169 /* BGP QoS propagation draft-knoll-idr-qos-attribute */
13170 { &hf_bgp_ext_com_qos_flags
,
13171 { "Flags", "bgp.ext_com_qos.flags", FT_UINT8
, BASE_HEX
,
13172 NULL
, 0, NULL
, HFILL
}},
13173 { &hf_bgp_ext_com_qos_flags_remarking
,
13174 { "Remarking", "bgp.ext_com_qos.flags.remarking", FT_BOOLEAN
, 8,
13175 TFS(&tfs_yes_no
), 0x10, NULL
, HFILL
}},
13176 { &hf_bgp_ext_com_qos_flags_ignore_remarking
,
13177 { "Ignore remarking", "bgp.ext_com_qos.flags.ignore_remarking", FT_BOOLEAN
, 8,
13178 TFS(&tfs_yes_no
), 0x08, NULL
, HFILL
}},
13179 { &hf_bgp_ext_com_qos_flags_agg_marking
,
13180 { "Aggregation of markins", "bgp.ext_com_qos.flags.agg_marking", FT_BOOLEAN
, 8,
13181 TFS(&tfs_yes_no
), 0x04, NULL
, HFILL
}},
13182 { &hf_bgp_ext_com_cos_flags
,
13183 { "Flags byte", "bgp.ext_com_cos.flags", FT_UINT8
, BASE_HEX
,
13184 NULL
, 0, NULL
, HFILL
}},
13185 { &hf_bgp_ext_com_cos_flags_be
,
13186 { "BE class", "bgp.ext_com_cos.flags.be", FT_BOOLEAN
, 8,
13187 TFS(&tfs_supported_not_supported
), 0x80, NULL
, HFILL
}},
13188 { &hf_bgp_ext_com_cos_flags_ef
,
13189 { "EF class", "bgp.ext_com_cos.flags.ef", FT_BOOLEAN
, 8,
13190 TFS(&tfs_supported_not_supported
), 0x40, NULL
, HFILL
}},
13191 { &hf_bgp_ext_com_cos_flags_af
,
13192 { "AF class", "bgp.ext_com_cos.flags.af", FT_BOOLEAN
, 8,
13193 TFS(&tfs_supported_not_supported
), 0x20, NULL
, HFILL
}},
13194 { &hf_bgp_ext_com_cos_flags_le
,
13195 { "LE class", "bgp.ext_com_cos.flags.le", FT_BOOLEAN
, 8,
13196 TFS(&tfs_supported_not_supported
), 0x10, NULL
, HFILL
}},
13197 { &hf_bgp_ext_com_qos_set_number
,
13198 { "QoS Set Number", "bgp.ext_com_qos.set_number", FT_UINT8
, BASE_HEX
,
13199 NULL
, 0, NULL
, HFILL
}},
13200 { &hf_bgp_ext_com_qos_tech_type
,
13201 { "Technology Type", "bgp.ext_com_qos.tech_type", FT_UINT8
, BASE_HEX
,
13202 VALS(qos_tech_type
), 0, NULL
, HFILL
}},
13203 { &hf_bgp_ext_com_qos_marking_o
,
13204 { "QoS Marking O", "bgp.ext_com_qos.marking_o", FT_UINT16
, BASE_HEX
,
13205 NULL
, 0, NULL
, HFILL
}},
13206 { &hf_bgp_ext_com_qos_marking_a
,
13207 { "QoS Marking A", "bgp.ext_com_qos.marking_a", FT_UINT8
, BASE_HEX_DEC
,
13208 NULL
, 0, NULL
, HFILL
}},
13209 { &hf_bgp_ext_com_qos_default_to_zero
,
13210 { "Defaults to zero", "bgp.ext_com_qos.default_to_zero", FT_UINT8
, BASE_HEX
,
13211 NULL
, 0, NULL
, HFILL
}},
13212 /* BGP L2 extended community RFC 4761, RFC 6624 */
13213 /* draft-ietf-l2vpn-vpls-multihoming */
13214 { &hf_bgp_ext_com_l2_encaps
,
13215 { "Encaps Type", "bgp.ext_com_l2.encaps_type", FT_UINT8
, BASE_DEC
,
13216 VALS(bgp_l2vpn_encaps
), 0, NULL
, HFILL
}},
13217 { &hf_bgp_ext_com_l2_c_flags
,
13218 { "Control Flags", "bgp.ext_com_l2.c_flags", FT_UINT8
, BASE_HEX
,
13219 NULL
, 0x0, NULL
, HFILL
}},
13220 { &hf_bgp_ext_com_l2_flag_d
,
13221 { "Down flag", "bgp.ext_com_l2.flag_d",FT_BOOLEAN
, 8,
13222 TFS(&tfs_set_notset
), BGP_EXT_COM_L2_FLAG_D
, NULL
, HFILL
}},
13223 { &hf_bgp_ext_com_l2_flag_z1
,
13224 { "Unassigned", "bgp.ext_com_l2.flag_z1",FT_UINT8
, BASE_DEC
,
13225 NULL
, BGP_EXT_COM_L2_FLAG_Z1
, "Must be Zero", HFILL
}},
13226 { &hf_bgp_ext_com_l2_flag_f
,
13227 { "Flush flag", "bgp.ext_com_l2.flag_f",FT_BOOLEAN
, 8,
13228 TFS(&tfs_set_notset
), BGP_EXT_COM_L2_FLAG_F
, NULL
, HFILL
}},
13229 { &hf_bgp_ext_com_l2_flag_z345
,
13230 { "Unassigned", "bgp.ext_com_l2.flag_z345",FT_UINT8
, BASE_DEC
,
13231 NULL
, BGP_EXT_COM_L2_FLAG_Z345
, "Must be Zero", HFILL
}},
13232 { &hf_bgp_ext_com_l2_flag_c
,
13233 { "C flag", "bgp.ext_com_l2.flag_c",FT_BOOLEAN
, 8,
13234 TFS(&tfs_set_notset
), BGP_EXT_COM_L2_FLAG_C
, NULL
, HFILL
}},
13235 { &hf_bgp_ext_com_l2_flag_s
,
13236 { "S flag", "bgp.ext_com_l2.flag_s",FT_BOOLEAN
, 8,
13237 TFS(&tfs_set_notset
), BGP_EXT_COM_L2_FLAG_S
, NULL
, HFILL
}},
13238 { &hf_bgp_ext_com_l2_mtu
,
13239 { "Layer-2 MTU", "bgp.ext_com_l2.l2_mtu", FT_UINT16
, BASE_DEC
,
13240 NULL
, 0x0, NULL
, HFILL
}},
13241 { &hf_bgp_ext_com_l2_esi_label_flag
,
13242 { "Single active bit", "bgp.ext_com_l2.esi_label_flag",FT_BOOLEAN
, 8,
13243 TFS(&tfs_esi_label_flag
), BGP_EXT_COM_ESI_LABEL_FLAGS
, NULL
, HFILL
}},
13244 { &hf_bgp_ext_com_etree_root_vlan
,
13245 { "Root VLAN", "bgp.ext_com_etree.root_vlan", FT_UINT16
, BASE_DEC
,
13246 NULL
, 0x0FFF, NULL
, HFILL
}},
13247 { &hf_bgp_ext_com_etree_leaf_vlan
,
13248 { "Leaf VLAN", "bgp.ext_com_etree.leaf_vlan", FT_UINT16
, BASE_DEC
,
13249 NULL
, 0x0FFF, NULL
, HFILL
}},
13250 { &hf_bgp_ext_com_etree_flags
,
13251 { "Flags", "bgp.ext_com_etree.flags", FT_UINT16
, BASE_HEX
,
13252 NULL
, 0x0, NULL
, HFILL
}},
13253 { &hf_bgp_ext_com_etree_flag_reserved
,
13254 { "Reserved", "bgp.ext_com_etree.flag_reserved",FT_UINT16
, BASE_HEX
,
13255 NULL
, BGP_EXT_COM_ETREE_FLAG_RESERVED
, NULL
, HFILL
}},
13256 { &hf_bgp_ext_com_etree_flag_p
,
13257 { "P", "bgp.ext_com_etree.flag_p",FT_BOOLEAN
, 16,
13258 TFS(&tfs_set_notset
), BGP_EXT_COM_ETREE_FLAG_P
, "PE is attached with leaf nodes only", HFILL
}},
13259 { &hf_bgp_ext_com_etree_flag_v
,
13260 { "V", "bgp.ext_com_etree.flag_v",FT_BOOLEAN
, 16,
13261 TFS(&tfs_set_notset
), BGP_EXT_COM_ETREE_FLAG_V
, "VLAN mapping", HFILL
}},
13262 { &hf_bgp_ext_com_evpn_mmac_flag
,
13263 { "Flags", "bgp.ext_com_evpn.mmac.flags", FT_UINT8
, BASE_HEX
,
13264 NULL
, 0x0, "MAC Mobility flags", HFILL
}},
13265 { &hf_bgp_ext_com_evpn_mmac_flag_sticky
,
13266 { "Sticky/Static MAC", "bgp.ext_com_evpn.mmac.flags.sticky", FT_BOOLEAN
, 8,
13267 TFS(&tfs_yes_no
), BGP_EXT_COM_EVPN_MMAC_STICKY
, "Indicates whether the MAC address is fixed or movable", HFILL
}},
13268 { &hf_bgp_ext_com_evpn_mmac_seq
,
13269 { "Sequence number", "bgp.ext_com_evpn.mmac.seq", FT_UINT32
, BASE_DEC
,
13270 NULL
, 0x0, "MAC Mobility Update Sequence number", HFILL
}},
13271 { &hf_bgp_ext_com_evpn_esirt
,
13272 { "ES-Import Route Target", "bgp.ext_com_evpn.esi.rt", FT_ETHER
, BASE_NONE
,
13273 NULL
, 0x0, "Route Target as a MAC Address", HFILL
}},
13274 { &hf_bgp_ext_com_evpn_routermac
,
13275 { "Router's MAC", "bgp.ext_com_evpn.esi.router_mac", FT_ETHER
, BASE_NONE
,
13276 NULL
, 0x0, "Router's MAC Address", HFILL
}},
13277 { &hf_bgp_ext_com_evpn_l2attr_flags
,
13278 { "Flags", "bgp.ext_com_evpn.l2attr.flags", FT_UINT16
, BASE_HEX
,
13279 NULL
, 0x0, "EVPN L2 attribute flags", HFILL
}},
13280 { &hf_bgp_ext_com_evpn_l2attr_flag_reserved
,
13281 { "Reserved", "bgp.ext_com_evpn.l2attr.flag_reserved", FT_UINT16
, BASE_HEX
,
13282 NULL
, BGP_EXT_COM_EVPN_L2ATTR_FLAG_RESERVED
, NULL
, HFILL
}},
13283 { &hf_bgp_ext_com_evpn_l2attr_flag_ci
,
13284 { "CI flag", "bgp.ext_com_evpn.l2attr.flag_ci", FT_BOOLEAN
, 16,
13285 TFS(&tfs_set_notset
), BGP_EXT_COM_EVPN_L2ATTR_FLAG_CI
, "Control Word Indicator Extended Community can be advertised", HFILL
}},
13286 { &hf_bgp_ext_com_evpn_l2attr_flag_f
,
13287 { "F flag", "bgp.ext_com_evpn.l2attr.flag_f", FT_BOOLEAN
, 16,
13288 TFS(&tfs_set_notset
), BGP_EXT_COM_EVPN_L2ATTR_FLAG_F
, "PE is capable to send and receive flow label", HFILL
}},
13289 { &hf_bgp_ext_com_evpn_l2attr_flag_c
,
13290 { "C flag", "bgp.ext_com_evpn.l2attr.flag_c", FT_BOOLEAN
, 16,
13291 TFS(&tfs_set_notset
), BGP_EXT_COM_EVPN_L2ATTR_FLAG_C
, "Control word must be present when sending EVPN packets to this PE", HFILL
}},
13292 { &hf_bgp_ext_com_evpn_l2attr_flag_p
,
13293 { "P flag", "bgp.ext_com_evpn.l2attr.flag_p", FT_BOOLEAN
, 16,
13294 TFS(&tfs_set_notset
), BGP_EXT_COM_EVPN_L2ATTR_FLAG_P
, "Primary PE", HFILL
}},
13295 { &hf_bgp_ext_com_evpn_l2attr_flag_b
,
13296 { "B flag", "bgp.ext_com_evpn.l2attr.flag_b", FT_BOOLEAN
, 16,
13297 TFS(&tfs_set_notset
), BGP_EXT_COM_EVPN_L2ATTR_FLAG_B
, "Backup PE", HFILL
}},
13298 { &hf_bgp_ext_com_evpn_l2attr_l2_mtu
,
13299 { "L2 MTU", "bgp.ext_com_evpn.l2attr.l2_mtu", FT_UINT16
, BASE_DEC
,
13300 NULL
, 0x0, NULL
, HFILL
}},
13301 { &hf_bgp_ext_com_evpn_l2attr_reserved
,
13302 { "Reserved", "bgp.ext_com_evpn.l2attr.reserved", FT_BYTES
, BASE_NONE
,
13303 NULL
, 0x0, NULL
, HFILL
}},
13304 { &hf_bgp_ext_com_evpn_etree_flags
,
13305 { "Flags", "bgp.ext_com_evpn.etree.flags", FT_UINT8
, BASE_HEX
,
13306 NULL
, 0x0, "EVPN E-Tree attribute flags", HFILL
}},
13307 { &hf_bgp_ext_com_evpn_etree_flag_reserved
,
13308 { "Reserved", "bgp.ext_com_evpn.etree.flag_reserved", FT_UINT8
, BASE_HEX
,
13309 NULL
, BGP_EXT_COM_EVPN_ETREE_FLAG_RESERVED
, NULL
, HFILL
}},
13310 { &hf_bgp_ext_com_evpn_etree_flag_l
,
13311 { "L flag", "bgp.ext_com_evpn.etree.flag_l", FT_BOOLEAN
, 8,
13312 TFS(&tfs_set_notset
), BGP_EXT_COM_EVPN_ETREE_FLAG_L
, "Leaf-Indication", HFILL
}},
13313 { &hf_bgp_ext_com_evpn_etree_reserved
,
13314 { "Reserved", "bgp.ext_com_evpn.etree.reserved", FT_BYTES
, BASE_NONE
,
13315 NULL
, 0x0, NULL
, HFILL
}},
13316 /* BGP Cost Community */
13317 { &hf_bgp_ext_com_cost_poi
,
13318 { "Point of insertion", "bgp.ext_com_cost.poi", FT_UINT8
, BASE_DEC
,
13319 VALS(bgpext_com_cost_poi_type
), 0x0, "Placement of the Cost value in the BGP Best Path algorithm", HFILL
}},
13320 { &hf_bgp_ext_com_cost_cid
,
13321 { "Community ID", "bgp.ext_com_cost.cid", FT_UINT8
, BASE_DEC
,
13322 NULL
, 0x0, "Community instance ID to distinguish between multiple Cost communities", HFILL
}},
13323 { &hf_bgp_ext_com_cost_cost
,
13324 { "Cost", "bgp.ext_com_cost.cost", FT_UINT32
, BASE_DEC
,
13325 NULL
, 0x0, "Cost value", HFILL
}},
13326 { &hf_bgp_ext_com_cost_cid_rep
,
13327 { "Cost use", "bgp.ext_com_cost.cid.use", FT_BOOLEAN
, 8,
13328 TFS(&tfs_cost_replace
), BGP_EXT_COM_COST_CID_REP
, "Indicates whether the Cost value will replace the original attribute value", HFILL
}},
13329 /* EIGRP Route Metrics Extended Communities */
13330 { &hf_bgp_ext_com_stype_tr_exp_eigrp
,
13331 { "Route Attributes", "bgp.ext_com_eigrp", FT_UINT8
, BASE_DEC
,
13332 VALS(bgpext_com_stype_tr_eigrp
), 0x0, "Original EIGRP route attributes", HFILL
}},
13333 { &hf_bgp_ext_com_eigrp_flags
,
13334 { "Route flags", "bgp.ext_com_eigrp.flags", FT_UINT16
, BASE_HEX
,
13335 NULL
, 0x0, "EIGRP Route flags bitfield", HFILL
}},
13336 { &hf_bgp_ext_com_eigrp_flags_rt
,
13337 { "Route type", "bgp.ext_com_eigrp.flags.rt", FT_BOOLEAN
, 16,
13338 TFS(&tfs_eigrp_rtype
), BGP_EXT_COM_EXP_EIGRP_FLAG_RT
, "Original EIGRP route type (internal/external)", HFILL
}},
13339 { &hf_bgp_ext_com_eigrp_rtag
,
13340 { "Route tag", "bgp.ext_com_eigrp.rtag", FT_UINT32
, BASE_DEC
,
13341 NULL
, 0x0, "Original EIGRP route tag", HFILL
}},
13342 { &hf_bgp_ext_com_eigrp_asn
,
13343 { "AS Number", "bgp.ext_com_eigrp.asn", FT_UINT16
, BASE_DEC
,
13344 NULL
, 0x0, "Original EIGRP Autonomous System Number this route comes from", HFILL
}},
13345 { &hf_bgp_ext_com_eigrp_delay
,
13346 { "Delay", "bgp.ext_com_eigrp.dly", FT_UINT32
, BASE_DEC
,
13347 NULL
, 0x0, "Original EIGRP route delay metric", HFILL
}},
13348 { &hf_bgp_ext_com_eigrp_rly
,
13349 { "Reliability", "bgp.ext_com_eigrp.rly", FT_UINT8
, BASE_DEC
,
13350 NULL
, 0x0, "Original EIGRP route reliability metric", HFILL
}},
13351 { &hf_bgp_ext_com_eigrp_hops
,
13352 { "Hop count", "bgp.ext_com_eigrp.hops", FT_UINT8
, BASE_DEC
,
13353 NULL
, 0x0, "Original EIGRP route hop count", HFILL
}},
13354 { &hf_bgp_ext_com_eigrp_bw
,
13355 { "Bandwidth", "bgp.ext_com_eigrp.bw", FT_UINT32
, BASE_DEC
,
13356 NULL
, 0x0, "Original EIGRP route bandwidth metric", HFILL
}},
13357 { &hf_bgp_ext_com_eigrp_load
,
13358 { "Load", "bgp.ext_com_eigrp.load", FT_UINT8
, BASE_DEC
,
13359 NULL
, 0x0, "Original EIGRP route load metric", HFILL
}},
13360 { &hf_bgp_ext_com_eigrp_mtu
,
13361 { "MTU", "bgp.ext_com_eigrp.mtu", FT_UINT32
, BASE_DEC
,
13362 NULL
, 0x0, "Original EIGRP route path MTU", HFILL
}},
13363 { &hf_bgp_ext_com_eigrp_rid
,
13364 { "Router ID", "bgp.ext_com_eigrp.rid", FT_IPv4
, BASE_NONE
,
13365 NULL
, 0x0, "EIGRP Router ID of the router that originated the route", HFILL
}},
13366 { &hf_bgp_ext_com_eigrp_e_asn
,
13367 { "External AS Number", "bgp.ext_com_eigrp.e_asn", FT_UINT16
, BASE_DEC
,
13368 NULL
, 0x0, "Original AS Number of the route before its redistribution into EIGRP", HFILL
}},
13369 { &hf_bgp_ext_com_eigrp_e_rid
,
13370 { "External Router ID", "bgp.ext_com_eigrp.e_rid", FT_IPv4
, BASE_NONE
,
13371 NULL
, 0x0, "EIGRP Router ID of the router that redistributed this route into EIGRP", HFILL
}},
13372 { &hf_bgp_ext_com_eigrp_e_pid
,
13373 { "External protocol", "bgp.ext_com_eigrp.e_pid", FT_UINT16
, BASE_DEC
,
13374 VALS(eigrp_proto2string
), 0x0, "Original routing protocol from which this route was redistributed into EIGRP", HFILL
}},
13375 { &hf_bgp_ext_com_eigrp_e_m
,
13376 { "External metric", "bgp.ext_com_eigrp.e_metric", FT_UINT32
, BASE_DEC
,
13377 NULL
, 0x0, "Original metric of the route before its redistribution into EIGRP", HFILL
}},
13378 { &hf_bgp_ext_com_mup_segment_id2
,
13379 { "Segment Identifier 2-byte", "bgp.ext_com_mup.segment_id2", FT_UINT16
, BASE_DEC
,
13380 NULL
, 0x0, "Configurable segment identifier value 2-byte", HFILL
}},
13381 { &hf_bgp_ext_com_mup_segment_id4
,
13382 { "Segment Identifier 4-byte", "bgp.ext_com_mup.segment_id4", FT_UINT32
, BASE_DEC
,
13383 NULL
, 0x0, "Configurable segment identifier value 4-byte", HFILL
}},
13387 { "Type", "bgp.ls.type", FT_UINT16
, BASE_DEC
,
13388 NULL
, 0x0, "BGP-LS message type", HFILL
}},
13389 { &hf_bgp_ls_length
,
13390 { "Length", "bgp.ls.length", FT_UINT16
, BASE_DEC
,
13391 NULL
, 0x0, "The total length of the message payload in octets", HFILL
}},
13393 { "BGP-LS NLRI", "bgp.ls.nlri", FT_NONE
,
13394 BASE_NONE
, NULL
, 0x0, NULL
, HFILL
}},
13395 { &hf_bgp_ls_safi128_nlri
,
13396 { "Link State SAFI 128 NLRI", "bgp.ls.nlri_safi128", FT_NONE
,
13397 BASE_NONE
, NULL
, 0x0, NULL
, HFILL
}},
13398 { &hf_bgp_ls_safi128_nlri_route_distinguisher
,
13399 { "Route Distinguisher", "bgp.ls.nlri_safi128_route_distinguisher", FT_NONE
,
13400 BASE_NONE
, NULL
, 0x0, NULL
, HFILL
}},
13401 { &hf_bgp_ls_safi128_nlri_route_distinguisher_type
,
13402 { "Route Distinguisher Type", "bgp.ls.nlri_safi128_route_distinguisher_type", FT_UINT16
,
13403 BASE_DEC
, NULL
, 0x0, NULL
, HFILL
}},
13404 { &hf_bgp_ls_safi128_nlri_route_dist_admin_asnum_2
,
13405 { "Administrator Subfield", "bgp.ls.nlri_safi128_route_distinguisher_admin_as_num_2", FT_UINT16
,
13406 BASE_DEC
, NULL
, 0x0, NULL
, HFILL
}},
13407 { &hf_bgp_ls_safi128_nlri_route_dist_admin_ipv4
,
13408 { "Administrator Subfield", "bgp.ls.nlri_safi128_route_distinguisher_admin_ipv4", FT_IPv4
,
13409 BASE_NONE
, NULL
, 0x0, NULL
, HFILL
}},
13410 { &hf_bgp_ls_safi128_nlri_route_dist_admin_asnum_4
,
13411 { "Administrator Subfield", "bgp.ls.nlri_safi128_route_distinguisher_admin_as_num_4", FT_UINT32
,
13412 BASE_HEX_DEC
, NULL
, 0x0, NULL
, HFILL
}},
13413 { &hf_bgp_ls_safi128_nlri_route_dist_asnum_2
,
13414 { "Assigned Number Subfield", "bgp.ls.nlri_safi128_route_distinguisher_asnum_2", FT_UINT16
,
13415 BASE_DEC
, NULL
, 0x0, NULL
, HFILL
}},
13416 { &hf_bgp_ls_safi128_nlri_route_dist_asnum_4
,
13417 { "Assigned Number Subfield", "bgp.ls.nlri_safi128_route_distinguisher_asnum_4", FT_UINT32
,
13418 BASE_HEX_DEC
, NULL
, 0x0, NULL
, HFILL
}},
13419 { &hf_bgp_ls_nlri_type
,
13420 { "NLRI Type", "bgp.ls.nlri_type", FT_UINT16
,
13421 BASE_DEC
, VALS(bgp_ls_nlri_type_vals
), 0x0, NULL
, HFILL
}},
13422 { &hf_bgp_ls_nlri_length
,
13423 { "NLRI Length", "bgp.ls.nlri_length", FT_UINT16
,
13424 BASE_DEC
, NULL
, 0x0, NULL
, HFILL
}},
13425 { &hf_bgp_ls_nlri_link_nlri_type
,
13426 { "Link-State NLRI Link NLRI", "bgp.ls.nlri_link", FT_NONE
,
13427 BASE_NONE
, NULL
, 0x0, NULL
, HFILL
}},
13428 { &hf_bgp_ls_nlri_link_descriptors_tlv
,
13429 { "Link Descriptors TLV", "bgp.ls.nlri_link_descriptors_tlv", FT_NONE
,
13430 BASE_NONE
, NULL
, 0x0, NULL
, HFILL
}},
13431 { &hf_bgp_ls_nlri_prefix_descriptors_tlv
,
13432 { "Prefix Descriptors TLV", "bgp.ls.nlri_prefix_descriptors_tlv", FT_NONE
,
13433 BASE_NONE
, NULL
, 0x0, NULL
, HFILL
}},
13434 { &hf_bgp_ls_nlri_srv6_sid_descriptors_tlv
,
13435 { "SRv6 SID Descriptors TLV", "bgp.ls.nlri_srv6_sid_descriptors_tlv", FT_NONE
,
13436 BASE_NONE
, NULL
, 0x0, NULL
, HFILL
}},
13437 { &hf_bgp_ls_nlri_link_local_identifier
,
13438 { "Link Local Identifier", "bgp.ls.nlri_link_local_identifier", FT_UINT32
,
13439 BASE_HEX_DEC
, NULL
, 0x0, NULL
, HFILL
}},
13440 { &hf_bgp_ls_nlri_link_remote_identifier
,
13441 { "Link Remote Identifier", "bgp.ls.nlri_link_remote_identifier", FT_UINT32
,
13442 BASE_HEX_DEC
, NULL
, 0x0, NULL
, HFILL
}},
13443 { &hf_bgp_ls_nlri_ipv4_interface_address
,
13444 { "IPv4 Interface Address", "bgp.ls.nlri_ipv4_interface_address", FT_IPv4
,
13445 BASE_NONE
, NULL
, 0x0, NULL
, HFILL
}},
13446 { &hf_bgp_ls_nlri_ipv4_neighbor_address
,
13447 { "IPv4 Neighbor Address", "bgp.ls.nlri_ipv4_neighbor_address", FT_IPv4
,
13448 BASE_NONE
, NULL
, 0x0, NULL
, HFILL
}},
13449 { &hf_bgp_ls_nlri_ipv6_interface_address
,
13450 { "IPv6 Interface Address", "bgp.ls.nlri_ipv6_interface_address", FT_IPv6
,
13451 BASE_NONE
, NULL
, 0x0, NULL
, HFILL
}},
13452 { &hf_bgp_ls_nlri_ipv6_neighbor_address
,
13453 { "IPv6 Neighbor Address", "bgp.ls.nlri_ipv6_neighbor_address", FT_IPv6
,
13454 BASE_NONE
, NULL
, 0x0, NULL
, HFILL
}},
13455 { &hf_bgp_ls_nlri_multi_topology_id
,
13456 { "Multi Topology ID", "bgp.ls.nlri_multi_topology_id", FT_UINT16
,
13457 BASE_DEC_HEX
, NULL
, 0x0fff, NULL
, HFILL
}},
13458 { &hf_bgp_ls_nlri_ospf_route_type
,
13459 { "OSPF Route Type", "bgp.ls.nlri_ospf_route_type", FT_UINT8
,
13460 BASE_DEC
, VALS(link_state_prefix_descriptors_ospf_route_type
), 0x0, NULL
, HFILL
}},
13461 { &hf_bgp_ls_nlri_ip_reachability_prefix_ip
,
13462 { "Reachability prefix", "bgp.ls.nlri_ip_reachability_prefix_ip", FT_IPv4
,
13463 BASE_NONE
, NULL
, 0x0, NULL
, HFILL
}},
13464 { &hf_bgp_ls_nlri_ip_reachability_prefix_ip6
,
13465 { "Reachability prefix", "bgp.ls.nlri_ip_reachability_prefix_ip6", FT_IPv6
,
13466 BASE_NONE
, NULL
, 0x0, NULL
, HFILL
}},
13467 { &hf_bgp_ls_nlri_node_nlri_type
,
13468 { "Link-State NLRI Node NLRI", "bgp.ls.nlri_node", FT_NONE
,
13469 BASE_NONE
, NULL
, 0x0, NULL
, HFILL
}},
13470 { &hf_bgp_ls_nlri_node_protocol_id
,
13471 { "Protocol ID", "bgp.ls.nlri_node.protocol_id", FT_UINT8
,
13472 BASE_DEC
, VALS(link_state_nlri_protocol_id_values
), 0x0, NULL
, HFILL
}},
13473 { &hf_bgp_ls_nlri_node_identifier
,
13474 { "Identifier", "bgp.ls.nlri_node.identifier", FT_UINT64
,
13475 BASE_DEC
| BASE_VAL64_STRING
, VALS64(link_state_nlri_routing_universe_values
), 0x0, NULL
, HFILL
}},
13476 { &hf_bgp_ls_ipv4_topology_prefix_nlri_type
,
13477 { "Link-State NLRI IPv4 Topology Prefix", "bgp.ls.ipv4_topology_prefix", FT_NONE
,
13478 BASE_NONE
, NULL
, 0x0, NULL
, HFILL
}},
13479 { &hf_bgp_ls_ipv6_topology_prefix_nlri_type
,
13480 { "Link-State NLRI IPv6 Topology Prefix", "bgp.ls.ipv6_topology_prefix", FT_NONE
,
13481 BASE_NONE
, NULL
, 0x0, NULL
, HFILL
}},
13482 { &hf_bgp_ls_nlri_srv6_sid_nlri_type
,
13483 { "Link-State NLRI SRv6 SID NLRI", "bgp.ls.nlri_srv6_sid", FT_NONE
,
13484 BASE_NONE
, NULL
, 0x0, NULL
, HFILL
}},
13486 { &hf_bgp_ls_tlv_local_node_descriptors
,
13487 { "Local Node Descriptors TLV", "bgp.ls.tlv.local_node_descriptors", FT_NONE
,
13488 BASE_NONE
, NULL
, 0x0, NULL
, HFILL
}},
13489 { &hf_bgp_ls_tlv_remote_node_descriptors
,
13490 { "Remote Node Descriptors TLV", "bgp.ls.tlv.remote_node_descriptors", FT_NONE
,
13491 BASE_NONE
, NULL
, 0x0, NULL
, HFILL
}},
13492 { &hf_bgp_ls_tlv_autonomous_system
,
13493 { "Autonomous System TLV", "bgp.ls.tlv.autonomous_system", FT_NONE
,
13494 BASE_NONE
, NULL
, 0x0, NULL
, HFILL
}},
13495 { &hf_bgp_ls_tlv_autonomous_system_id
,
13496 { "AS ID", "bgp.ls.tlv.autonomous_system.id", FT_UINT32
,
13497 BASE_DEC_HEX
, NULL
, 0x0, NULL
, HFILL
}},
13498 { &hf_bgp_ls_tlv_bgp_ls_identifier
,
13499 { "BGP-LS Identifier TLV", "bgp.ls.tlv.bgp_ls_identifier", FT_NONE
,
13500 BASE_NONE
, NULL
, 0x0, NULL
, HFILL
}},
13501 { &hf_bgp_ls_tlv_bgp_ls_identifier_id
,
13502 { "BGP-LS ID", "bgp.ls.tlv.bgp_ls_identifier_id", FT_UINT32
,
13503 BASE_DEC_HEX
, NULL
, 0x0, NULL
, HFILL
}},
13504 { &hf_bgp_ls_tlv_area_id
,
13505 { "Area ID TLV", "bgp.ls.tlv.area_id", FT_NONE
,
13506 BASE_NONE
, NULL
, 0x0, NULL
, HFILL
}},
13507 { &hf_bgp_ls_tlv_area_id_id
,
13508 { "Area ID", "bgp.ls.tlv.area_id.id", FT_UINT32
,
13509 BASE_DEC_HEX
, NULL
, 0x0, NULL
, HFILL
}},
13510 { &hf_bgp_ls_tlv_ipv4_router_id_of_local_node
,
13511 { "IPv4 Router-ID of Local Node TLV", "bgp.ls.tlv.ipv4_router_id_of_local_node", FT_NONE
,
13512 BASE_NONE
, NULL
, 0x0, NULL
, HFILL
}},
13513 { &hf_bgp_ls_tlv_ipv4_router_id_value
,
13514 { "IPv4 Router-ID", "bgp.ls.tlv.ipv4_router_id_value", FT_IPv4
,
13515 BASE_NONE
, NULL
, 0x0, NULL
, HFILL
}},
13516 { &hf_bgp_ls_tlv_ipv6_router_id_of_local_node
,
13517 { "IPv6 Router-ID of Local Node TLV", "bgp.ls.tlv.ipv6_router_id_of_local_node", FT_NONE
,
13518 BASE_NONE
, NULL
, 0x0, NULL
, HFILL
}},
13519 { &hf_bgp_ls_tlv_ipv6_router_id_value
,
13520 { "IPv6 Router-ID", "bgp.ls.tlv.ipv6_router_id_value", FT_IPv6
,
13521 BASE_NONE
, NULL
, 0x0, NULL
, HFILL
}},
13522 { &hf_bgp_ls_tlv_ipv4_router_id_of_remote_node
,
13523 { "IPv4 Router-ID of Remote Node TLV", "bgp.ls.tlv.ipv4_router_id_of_remote_node", FT_NONE
,
13524 BASE_NONE
, NULL
, 0x0, NULL
, HFILL
}},
13525 { &hf_bgp_ls_tlv_ipv6_router_id_of_remote_node
,
13526 { "IPv6 Router-ID of Remote Node TLV", "bgp.ls.tlv.ipv6_router_id_of_remote_node", FT_NONE
,
13527 BASE_NONE
, NULL
, 0x0, NULL
, HFILL
}},
13528 { &hf_bgp_ls_tlv_link_local_remote_identifiers
,
13529 { "Link Local/Remote Identifiers TLV", "bgp.ls.tlv.link_local_remote_identifiers", FT_NONE
,
13530 BASE_NONE
, NULL
, 0x0, NULL
, HFILL
}},
13531 { &hf_bgp_ls_tlv_ipv4_interface_address
,
13532 { "IPv4 interface address TLV", "bgp.ls.tlv.ipv4_interface_address", FT_NONE
,
13533 BASE_NONE
, NULL
, 0x0, NULL
, HFILL
}},
13534 { &hf_bgp_ls_tlv_ipv4_neighbor_address
,
13535 { "IPv4 neighbor address TLV", "bgp.ls.tlv.ipv4_neighbor_address", FT_NONE
,
13536 BASE_NONE
, NULL
, 0x0, NULL
, HFILL
}},
13537 { &hf_bgp_ls_tlv_ipv6_interface_address
,
13538 { "IPv6 interface address TLV", "bgp.ls.tlv.ipv6_interface_address", FT_NONE
,
13539 BASE_NONE
, NULL
, 0x0, NULL
, HFILL
}},
13540 { &hf_bgp_ls_tlv_ipv6_neighbor_address
,
13541 { "IPv6 neighbor address TLV", "bgp.ls.tlv.ipv6_neighbor_address", FT_NONE
,
13542 BASE_NONE
, NULL
, 0x0, NULL
, HFILL
}},
13543 { &hf_bgp_ls_tlv_node_msd
,
13544 { "Node MSD TLV", "bgp.ls.tlv.node_msd", FT_NONE
,
13545 BASE_NONE
, NULL
, 0x0, NULL
, HFILL
}},
13546 { &hf_bgp_ls_tlv_link_msd
,
13547 { "Link MSD TLV", "bgp.ls.tlv.link_msd", FT_NONE
,
13548 BASE_NONE
, NULL
, 0x0, NULL
, HFILL
}},
13549 { &hf_bgp_ls_tlv_igp_msd_type
,
13550 { "MSD Type", "bgp.ls.tlv.igp_msd_type", FT_UINT8
,
13551 BASE_DEC
, VALS(igp_msd_types
), 0x0, NULL
, HFILL
}},
13552 { &hf_bgp_ls_tlv_igp_msd_value
,
13553 { "MSD Value", "bgp.ls.tlv.igp_msd_value", FT_UINT8
,
13554 BASE_DEC
, NULL
, 0x0, NULL
, HFILL
}},
13555 { &hf_bgp_ls_tlv_multi_topology_id
,
13556 { "Multi Topology ID TLV", "bgp.ls.tlv.multi_topology_id", FT_NONE
,
13557 BASE_NONE
, NULL
, 0x0, NULL
, HFILL
}},
13558 { &hf_bgp_ls_tlv_ospf_route_type
,
13559 { "OSPF Route Type TLV", "bgp.ls.tlv.ospf_route_type", FT_NONE
,
13560 BASE_NONE
, NULL
, 0x0, NULL
, HFILL
}},
13561 { &hf_bgp_ls_tlv_ip_reachability_information
,
13562 { "IP Reachability Information TLV", "bgp.ls.tlv.ip_reachability_information", FT_NONE
,
13563 BASE_NONE
, NULL
, 0x0, NULL
, HFILL
}},
13564 { &hf_bgp_ls_tlv_administrative_group_color
,
13565 { "Administrative group (color) TLV", "bgp.ls.tlv.administrative_group_color", FT_NONE
,
13566 BASE_NONE
, NULL
, 0x0, NULL
, HFILL
}},
13567 { &hf_bgp_ls_tlv_administrative_group_color_value
,
13568 { "Group Mask", "bgp.ls.tlv.administrative_group_color_value", FT_UINT32
,
13569 BASE_DEC
, NULL
, 0xffff, NULL
, HFILL
}},
13570 { &hf_bgp_ls_tlv_administrative_group
,
13571 { "Group", "bgp.ls.tlv.administrative_group", FT_UINT32
,
13572 BASE_DEC
, NULL
, 0xffff, NULL
, HFILL
}},
13573 { &hf_bgp_ls_tlv_max_link_bandwidth
,
13574 { "Maximum link bandwidth TLV", "bgp.ls.tlv.maximum_link_bandwidth", FT_NONE
,
13575 BASE_NONE
, NULL
, 0x0, NULL
, HFILL
}},
13576 { &hf_bgp_ls_tlv_max_reservable_link_bandwidth
,
13577 { "Maximum reservable link bandwidth TLV", "bgp.ls.tlv.maximum_reservable_link_bandwidth", FT_NONE
,
13578 BASE_NONE
, NULL
, 0x0, NULL
, HFILL
}},
13579 { &hf_bgp_ls_tlv_unreserved_bandwidth
,
13580 { "Unreserved bandwidth TLV", "bgp.ls.tlv.unreserved_bandwidth", FT_NONE
,
13581 BASE_NONE
, NULL
, 0x0, NULL
, HFILL
}},
13582 { &hf_bgp_ls_bandwidth_value
,
13583 {"Bandwidth", "bgp.ls.bandwidth_value", FT_FLOAT
,
13584 BASE_NONE
, NULL
, 0x0, NULL
, HFILL
}},
13585 { &hf_bgp_ls_tlv_te_default_metric
,
13586 { "TE Default Metric TLV", "bgp.ls.tlv.te_default_metric", FT_NONE
,
13587 BASE_NONE
, NULL
, 0x0, NULL
, HFILL
}},
13588 { &hf_bgp_ls_tlv_te_default_metric_value_old
,
13589 { "TE Default Metric (old format)", "bgp.ls.tlv.te_default_metric_value.old", FT_UINT24
,
13590 BASE_HEX_DEC
, NULL
, 0x0, NULL
, HFILL
}},
13591 { &hf_bgp_ls_tlv_te_default_metric_value
,
13592 { "TE Default Metric", "bgp.ls.tlv.te_default_metric_value", FT_UINT32
,
13593 BASE_HEX_DEC
, NULL
, 0x0, NULL
, HFILL
}},
13594 { &hf_bgp_ls_tlv_link_protection_type
,
13595 { "Link Protection Type TLV", "bgp.ls.tlv.link_protection_type", FT_NONE
,
13596 BASE_NONE
, NULL
, 0x0, NULL
, HFILL
}},
13597 { &hf_bgp_ls_tlv_link_protection_type_value
,
13598 { "Protection Capabilities", "bgp.ls.tlv.link_protection_type_value", FT_UINT8
,
13599 BASE_HEX
, NULL
, 0x0, NULL
, HFILL
}},
13600 { &hf_bgp_ls_tlv_mpls_protocol_mask
,
13601 { "MPLS Protocol Mask TLV", "bgp.ls.tlv.mpls_protocol_mask", FT_NONE
,
13602 BASE_NONE
, NULL
, 0x0, NULL
, HFILL
}},
13603 { &hf_bgp_ls_tlv_metric
,
13604 { "Metric TLV", "bgp.ls.tlv.metric", FT_NONE
,
13605 BASE_NONE
, NULL
, 0x0, NULL
, HFILL
}},
13606 { &hf_bgp_ls_tlv_metric_value1
,
13607 { "IGP Metric", "bgp.ls.tlv.metric_value", FT_UINT8
,
13608 BASE_HEX_DEC
, NULL
, 0x0, NULL
, HFILL
}},
13609 { &hf_bgp_ls_tlv_metric_value2
,
13610 { "IGP Metric", "bgp.ls.tlv.metric_value", FT_UINT16
,
13611 BASE_HEX_DEC
, NULL
, 0x0, NULL
, HFILL
}},
13612 { &hf_bgp_ls_tlv_metric_value3
,
13613 { "IGP Metric", "bgp.ls.tlv.metric_value", FT_UINT24
,
13614 BASE_HEX_DEC
, NULL
, 0x0, NULL
, HFILL
}},
13615 { &hf_bgp_ls_tlv_shared_risk_link_group
,
13616 { "Shared Risk Link Group TLV", "bgp.ls.tlv.shared_risk_link_group", FT_NONE
,
13617 BASE_NONE
, NULL
, 0x0, NULL
, HFILL
}},
13618 { &hf_bgp_ls_tlv_shared_risk_link_group_value
,
13619 { "Shared Risk Link Group Value", "bgp.ls.tlv.shared_risk_link_group_value", FT_UINT32
,
13620 BASE_HEX_DEC
, NULL
, 0x0, NULL
, HFILL
}},
13621 { &hf_bgp_ls_tlv_opaque_link_attribute
,
13622 { "Opaque Link Attribute TLV", "bgp.ls.tlv.opaque_link_attribute", FT_NONE
,
13623 BASE_NONE
, NULL
, 0x0, NULL
, HFILL
}},
13624 { &hf_bgp_ls_tlv_opaque_link_attribute_value
,
13625 { "Opaque link attributes", "bgp.ls.tlv.opaque_link_attribute_value", FT_NONE
,
13626 BASE_NONE
, NULL
, 0x0, NULL
, HFILL
}},
13627 { &hf_bgp_ls_tlv_link_name_attribute
,
13628 { "Opaque Link Attribute TLV", "bgp.ls.tlv.link_name_attribute", FT_NONE
,
13629 BASE_NONE
, NULL
, 0x0, NULL
, HFILL
}},
13630 { &hf_bgp_ls_tlv_link_name_attribute_value
,
13631 {"Link Name", "bgp.ls.tlv.link_name_attribute_value", FT_STRING
,
13632 BASE_NONE
, NULL
, 0, NULL
, HFILL
}},
13633 { &hf_bgp_ls_tlv_igp_flags
,
13634 { "IGP Flags TLV", "bgp.ls.tlv.igp_flags", FT_NONE
,
13635 BASE_NONE
, NULL
, 0x0, NULL
, HFILL
}},
13636 { &hf_bgp_ls_tlv_route_tag
,
13637 { "Route Tag TLV", "bgp.ls.tlv.route_tag", FT_NONE
,
13638 BASE_NONE
, NULL
, 0x0, NULL
, HFILL
}},
13639 { &hf_bgp_ls_tlv_route_tag_value
,
13640 { "Route Tag Value", "bgp.ls.tlv.route_tag_value", FT_UINT32
,
13641 BASE_HEX_DEC
, NULL
, 0x0, NULL
, HFILL
}},
13642 { &hf_bgp_ls_tlv_route_extended_tag
,
13643 { "Extended Route Tag TLV", "bgp.ls.tlv.route_extended_tag", FT_NONE
,
13644 BASE_NONE
, NULL
, 0x0, NULL
, HFILL
}},
13645 { &hf_bgp_ls_tlv_route_extended_tag_value
,
13646 {"Extended Route Tag", "bgp.ls.tlv.extended_route_tag_value", FT_UINT64
,
13647 BASE_HEX_DEC
, NULL
, 0x0, NULL
, HFILL
}},
13648 { &hf_bgp_ls_tlv_prefix_metric
,
13649 { "Prefix Metric TLV", "bgp.ls.tlv.prefix_metric", FT_NONE
,
13650 BASE_NONE
, NULL
, 0x0, NULL
, HFILL
}},
13651 { &hf_bgp_ls_tlv_prefix_metric_value
,
13652 { "Prefix Metric", "bgp.ls.tlv.prefix_metric_value", FT_UINT32
,
13653 BASE_HEX_DEC
, NULL
, 0x0, NULL
, HFILL
}},
13654 { &hf_bgp_ls_ospf_forwarding_address
,
13655 { "OSPF Forwarding Address TLV", "bgp.ls.tlv.ospf_forwarding_address", FT_NONE
,
13656 BASE_NONE
, NULL
, 0x0, NULL
, HFILL
}},
13657 { &hf_bgp_ls_ospf_forwarding_address_ipv4_address
,
13658 { "OSPF forwarding IPv4 address", "bgp.ls.tlv.ospf_forwarding_address_ipv4", FT_IPv4
,
13659 BASE_NONE
, NULL
, 0x0, NULL
, HFILL
}},
13660 { &hf_bgp_ls_ospf_forwarding_address_ipv6_address
,
13661 { "OSPF forwarding IPv6 address", "bgp.ls.tlv.ospf_forwarding_address_ipv6", FT_IPv6
,
13662 BASE_NONE
, NULL
, 0x0, NULL
, HFILL
}},
13663 { &hf_bgp_ls_opaque_prefix_attribute
,
13664 { "Opaque Prefix Attribute TLV", "bgp.ls.tlv.opaque_prefix_attribute", FT_NONE
,
13665 BASE_NONE
, NULL
, 0x0, NULL
, HFILL
}},
13666 { &hf_bgp_ls_opaque_prefix_attribute_value
,
13667 { "Opaque prefix attributes", "bgp.ls.tlv.opaque_prefix_attribute_value", FT_NONE
,
13668 BASE_NONE
, NULL
, 0x0, NULL
, HFILL
}},
13669 { &hf_bgp_ls_extended_administrative_group
,
13670 { "Extended Administrative Group TLV", "bgp.ls.tlv.extended_administrative_group", FT_NONE
,
13671 BASE_NONE
, NULL
, 0x0, NULL
, HFILL
}},
13672 { &hf_bgp_ls_extended_administrative_group_value
,
13673 { "Extended Administrative Group", "bgp.ls.tlv.extended_administrative_group_value", FT_BYTES
,
13674 BASE_NONE
, NULL
, 0x0, NULL
, HFILL
}},
13675 { &hf_bgp_ls_tlv_igp_router
,
13676 { "IGP Router-ID", "bgp.ls.tlv.igp_router", FT_NONE
,
13677 BASE_NONE
, NULL
, 0x0, NULL
, HFILL
}},
13678 { &hf_bgp_ls_tlv_igp_router_id
,
13679 { "IGP ID", "bgp.ls.tlv.igp_router_id", FT_BYTES
,
13680 BASE_NONE
, NULL
, 0x0, NULL
, HFILL
}},
13681 { &hf_bgp_ls_tlv_bgp_router_id
,
13682 { "BGP Router-ID TLV", "bgp.ls.tlv.bgp_router_id", FT_NONE
,
13683 BASE_NONE
, NULL
, 0x0, NULL
, HFILL
}},
13684 { &hf_bgp_ls_tlv_bgp_router_id_id
,
13685 { "BGP Router-ID", "bgp.ls.tlv.bgp_router_id.id", FT_IPv4
,
13686 BASE_NONE
, NULL
, 0x0, NULL
, HFILL
}},
13687 { &hf_bgp_ls_tlv_srv6_sid_info
,
13688 { "SRv6 SID Information TLV", "bgp.ls.tlv.srv6_sid_info", FT_NONE
,
13689 BASE_NONE
, NULL
, 0x0, NULL
, HFILL
}},
13690 { &hf_bgp_ls_tlv_srv6_sid_info_sid
,
13691 { "SID", "bgp.ls.tlv.srv6_sid_info.sid", FT_IPv6
,
13692 BASE_NONE
, NULL
, 0x0, NULL
, HFILL
}},
13693 { &hf_bgp_ls_tlv_node_flags_bits
,
13694 { "Node Flags Bits TLV", "bgp.ls.tlv.node_flags_bits", FT_NONE
,
13695 BASE_NONE
, NULL
, 0x0, NULL
, HFILL
}},
13696 { &hf_bgp_ls_tlv_opaque_node_properties
,
13697 { "Opaque Node Properties TLV", "bgp.ls.tlv.opaque_node_properties", FT_NONE
,
13698 BASE_NONE
, NULL
, 0x0, NULL
, HFILL
}},
13699 { &hf_bgp_ls_tlv_opaque_node_properties_value
,
13700 { "Opaque Node Properties", "bgp.ls.tlv.opaque_node_properties_value", FT_NONE
,
13701 BASE_NONE
, NULL
, 0x0, NULL
, HFILL
}},
13702 { &hf_bgp_ls_tlv_node_name
,
13703 { "Node Name TLV", "bgp.ls.tlv.node_name", FT_NONE
,
13704 BASE_NONE
, NULL
, 0x0, NULL
, HFILL
}},
13705 { &hf_bgp_ls_tlv_node_name_value
,
13706 {"Node name", "bgp.ls.tlv.node_name_value", FT_STRING
,
13707 BASE_NONE
, NULL
, 0, NULL
, HFILL
}},
13708 { &hf_bgp_ls_tlv_is_is_area_identifier
,
13709 { "IS-IS Area Identifier TLV", "bgp.ls.tlv.is_is_area_identifier", FT_NONE
,
13710 BASE_NONE
, NULL
, 0x0, NULL
, HFILL
}},
13711 { &hf_bgp_ls_tlv_is_is_area_identifier_value
,
13712 { "IS-IS Area Identifier", "bgp.ls.tlv.is_is_area_identifier_value", FT_BYTES
,
13713 BASE_NONE
, NULL
, 0x0, NULL
, HFILL
}},
13714 /* Link Protection Types */
13715 { &hf_bgp_ls_link_protection_type_enhanced
,
13716 { "Enhanced", "bgp.ls.link_protection_type.enhanced", FT_BOOLEAN
, 8,
13717 TFS(&tfs_capable_not_capable
), 0x20, NULL
, HFILL
}},
13718 { &hf_bgp_ls_link_protection_type_dedicated_1plus1
,
13719 { "Dedicated 1+1", "bgp.ls.link_protection_type.dedicated_1plus1", FT_BOOLEAN
, 8,
13720 TFS(&tfs_capable_not_capable
), 0x10, NULL
, HFILL
}},
13721 { &hf_bgp_ls_link_protection_type_dedicated_1to1
,
13722 { "Dedicated 1:1", "bgp.ls.link_protection_type.dedicated_1colon1", FT_BOOLEAN
, 8,
13723 TFS(&tfs_capable_not_capable
), 0x08, NULL
, HFILL
}},
13724 { &hf_bgp_ls_link_protection_type_shared
,
13725 { "Shared", "bgp.ls.link_protection_type.shared", FT_BOOLEAN
, 8,
13726 TFS(&tfs_capable_not_capable
), 0x04, NULL
, HFILL
}},
13727 { &hf_bgp_ls_link_protection_type_unprotected
,
13728 { "Unprotected", "bgp.ls.link_protection_type.unprotected", FT_BOOLEAN
, 8,
13729 TFS(&tfs_capable_not_capable
), 0x02, NULL
, HFILL
}},
13730 { &hf_bgp_ls_link_protection_type_extra_traffic
,
13731 { "Extra Traffic", "bgp.ls.link_protection_type.extra_traffic", FT_BOOLEAN
, 8,
13732 TFS(&tfs_capable_not_capable
), 0x01, NULL
, HFILL
}},
13733 /* MPLS Protocol Mask flags */
13734 { &hf_bgp_ls_mpls_protocol_mask_flag_l
,
13735 { "Label Distribution Protocol (LDP)", "bgp.ls.protocol_mask_tlv.mpls_protocol.l", FT_BOOLEAN
, 8,
13736 TFS(&tfs_set_notset
), 0x80, NULL
, HFILL
}},
13737 { &hf_bgp_ls_mpls_protocol_mask_flag_r
,
13738 { "Extension to RSVP for LSP Tunnels (RSVP-TE)", "bgp.ls.protocol_mask_tlv.mpls_protocol.r", FT_BOOLEAN
, 8,
13739 TFS(&tfs_set_notset
), 0x40, NULL
, HFILL
}},
13740 /* IGP Flags TLV */
13741 { &hf_bgp_ls_igp_flags_flag_d
,
13742 { "IS-IS Up/Down Bit", "bgp.ls.protocol_mask_tlv.igp_flags_flag_d.d", FT_BOOLEAN
, 8,
13743 TFS(&tfs_set_notset
), 0x80, NULL
, HFILL
}},
13744 /* Node Flag Bits TLV flags */
13745 { &hf_bgp_ls_node_flag_bits_overload
,
13746 { "Overload Bit", "bgp.ls.node_flag_bits.overload", FT_BOOLEAN
, 8,
13747 TFS(&tfs_set_notset
), 0x80, NULL
, HFILL
}},
13748 { &hf_bgp_ls_node_flag_bits_attached
,
13749 { "Attached Bit", "bgp.ls.node_flag_bits.attached", FT_BOOLEAN
, 8,
13750 TFS(&tfs_set_notset
), 0x40, NULL
, HFILL
}},
13751 { &hf_bgp_ls_node_flag_bits_external
,
13752 { "External Bit", "bgp.ls.node_flag_bits.external", FT_BOOLEAN
, 8,
13753 TFS(&tfs_set_notset
), 0x20, NULL
, HFILL
}},
13754 { &hf_bgp_ls_node_flag_bits_abr
,
13755 { "ABR Bit", "bgp.ls.node_flag_bits.abr", FT_BOOLEAN
, 8,
13756 TFS(&tfs_set_notset
), 0x10, NULL
, HFILL
}},
13757 { &hf_bgp_evpn_nlri
,
13758 { "EVPN NLRI", "bgp.evpn.nlri", FT_NONE
,
13759 BASE_NONE
, NULL
, 0x0, NULL
, HFILL
}},
13760 { &hf_bgp_evpn_nlri_rt
,
13761 { "Route Type", "bgp.evpn.nlri.rt", FT_UINT8
, BASE_DEC
,
13762 VALS(evpnrtypevals
), 0x0, NULL
, HFILL
}},
13763 { &hf_bgp_evpn_nlri_len
,
13764 { "Length", "bgp.evpn.nlri.len", FT_UINT8
,
13765 BASE_DEC
, NULL
, 0x0, NULL
, HFILL
}},
13766 { &hf_bgp_evpn_nlri_rd
,
13767 { "Route Distinguisher", "bgp.evpn.nlri.rd", FT_BYTES
,
13768 BASE_NONE
, NULL
, 0x0, NULL
, HFILL
}},
13769 { &hf_bgp_evpn_nlri_esi
,
13770 { "ESI", "bgp.evpn.nlri.esi", FT_BYTES
,
13771 SEP_COLON
, NULL
, 0x0, NULL
, HFILL
}},
13772 { &hf_bgp_evpn_nlri_esi_type
,
13773 { "ESI Type", "bgp.evpn.nlri.esi.type", FT_UINT8
,
13774 BASE_DEC
, VALS(evpn_nlri_esi_type
), 0x0, "EVPN ESI type", HFILL
}},
13775 { &hf_bgp_evpn_nlri_esi_lacp_mac
,
13776 { "CE LACP system MAC", "bgp.evpn.nlri.esi.lacp_mac", FT_ETHER
,
13777 BASE_NONE
, NULL
, 0x0, NULL
, HFILL
}},
13778 { &hf_bgp_evpn_nlri_esi_portk
,
13779 { "LACP port key", "bgp.evpn.nlri.esi.lacp_portkey", FT_UINT16
,
13780 BASE_DEC_HEX
, NULL
, 0x0, NULL
, HFILL
}},
13781 { &hf_bgp_evpn_nlri_esi_remain
,
13782 { "Remaining bytes", "bgp.evpn.nlri.esi.remaining", FT_BYTES
,
13783 BASE_NONE
, NULL
, 0x0, NULL
, HFILL
}},
13784 { &hf_bgp_evpn_nlri_esi_reserved
,
13785 { "Reserved value all 0xff", "bgp.evpn.nlri.esi.reserved", FT_BYTES
,
13786 BASE_NONE
, NULL
, 0x0, NULL
, HFILL
}},
13787 { &hf_bgp_evpn_nlri_esi_value
,
13788 { "ESI Value", "bgp.evpn.nlri.esi.value", FT_BYTES
,
13789 SEP_SPACE
, NULL
, 0x0, NULL
, HFILL
}},
13790 { &hf_bgp_evpn_nlri_esi_value_type0
,
13791 { "ESI 9 bytes value", "bgp.evpn.nlri.esi.type0", FT_BYTES
,
13792 SEP_SPACE
, NULL
, 0x0, NULL
, HFILL
}},
13793 { &hf_bgp_evpn_nlri_esi_rb_mac
,
13794 { "ESI root bridge MAC", "bgp.evpn.nlri.esi.root_bridge", FT_ETHER
,
13795 BASE_NONE
, NULL
, 0x0, NULL
, HFILL
}},
13796 { &hf_bgp_evpn_nlri_esi_rbprio
,
13797 { "ESI root bridge priority", "bgp.evpn.nlri.esi.rb_prio", FT_UINT16
,
13798 BASE_DEC_HEX
, NULL
, 0x0, NULL
, HFILL
}},
13799 { &hf_bgp_evpn_nlri_esi_sys_mac
,
13800 { "ESI system MAC", "bgp.evpn.nlri.esi.system_mac", FT_ETHER
,
13801 BASE_NONE
, NULL
, 0x0, NULL
, HFILL
}},
13802 { &hf_bgp_evpn_nlri_esi_mac_discr
,
13803 { "ESI system mac discriminator", "bgp.evpn.nlri.esi.system_mac_discr", FT_BYTES
,
13804 SEP_SPACE
, NULL
, 0x0, NULL
, HFILL
}},
13805 { &hf_bgp_evpn_nlri_esi_router_id
,
13806 { "ESI router ID", "bgp.evpn.nlri.esi.router_id", FT_IPv4
,
13807 BASE_NONE
, NULL
, 0x0, NULL
, HFILL
}},
13808 { &hf_bgp_evpn_nlri_esi_router_discr
,
13809 { "ESI router discriminator", "bgp.evpn.nlri.esi.router_discr", FT_BYTES
,
13810 SEP_SPACE
, NULL
, 0x0, NULL
, HFILL
}},
13811 { &hf_bgp_evpn_nlri_esi_asn
,
13812 { "ESI ASN", "bgp.evpn.nlri.esi.asn", FT_UINT32
,
13813 BASE_DEC
, NULL
, 0x0, NULL
, HFILL
}},
13814 { &hf_bgp_evpn_nlri_esi_asn_discr
,
13815 { "ESI ASN discriminator", "bgp.evpn.nlri.esi.asn_discr", FT_BYTES
,
13816 SEP_SPACE
, NULL
, 0x0, NULL
, HFILL
}},
13817 { &hf_bgp_evpn_nlri_etag
,
13818 { "Ethernet Tag ID", "bgp.evpn.nlri.etag", FT_UINT32
,
13819 BASE_DEC
, NULL
, 0x0, NULL
, HFILL
}},
13820 { &hf_bgp_evpn_nlri_mpls_ls1
,
13821 { "MPLS Label 1", "bgp.evpn.nlri.mpls_ls1", FT_UINT24
,
13822 BASE_DEC
, NULL
, BGP_MPLS_LABEL
, NULL
, HFILL
}},
13823 { &hf_bgp_evpn_nlri_mpls_ls2
,
13824 { "MPLS Label 2", "bgp.evpn.nlri.mpls_ls2", FT_UINT24
,
13825 BASE_DEC
, NULL
, BGP_MPLS_LABEL
, NULL
, HFILL
}},
13826 { &hf_bgp_evpn_nlri_vni
,
13827 { "VNI", "bgp.evpn.nlri.vni", FT_UINT24
,
13828 BASE_DEC
, NULL
, 0x0, NULL
, HFILL
}},
13829 { &hf_bgp_evpn_nlri_maclen
,
13830 { "MAC Address Length", "bgp.evpn.nlri.maclen", FT_UINT8
,
13831 BASE_DEC
, NULL
, 0x0, NULL
, HFILL
}},
13832 { &hf_bgp_evpn_nlri_mac_addr
,
13833 { "MAC Address", "bgp.evpn.nlri.mac_addr", FT_ETHER
,
13834 BASE_NONE
, NULL
, 0x0, NULL
, HFILL
}},
13835 { &hf_bgp_evpn_nlri_iplen
,
13836 { "IP Address Length", "bgp.evpn.nlri.iplen", FT_UINT8
,
13837 BASE_DEC
, NULL
, 0x0, NULL
, HFILL
}},
13838 { &hf_bgp_evpn_nlri_prefix_len
,
13839 { "IP prefix length", "bgp.evpn.nlri.prefix_len", FT_UINT8
,
13840 BASE_DEC
, NULL
, 0x0, NULL
, HFILL
}},
13841 { &hf_bgp_evpn_nlri_ip_addr
,
13842 { "IPv4 address", "bgp.evpn.nlri.ip.addr", FT_IPv4
,
13843 BASE_NONE
, NULL
, 0x0, NULL
, HFILL
}},
13844 { &hf_bgp_evpn_nlri_ipv6_addr
,
13845 { "IPv6 address", "bgp.evpn.nlri.ipv6.addr", FT_IPv6
,
13846 BASE_NONE
, NULL
, 0x0, NULL
, HFILL
}},
13847 { &hf_bgp_evpn_nlri_ipv4_gtw
,
13848 { "IPv4 Gateway address", "bgp.evpn.nlri.ipv4.gtw_addr", FT_IPv4
,
13849 BASE_NONE
, NULL
, 0x0, NULL
, HFILL
}},
13850 { &hf_bgp_evpn_nlri_ipv6_gtw
,
13851 { "IPv6 Gateway address", "bgp.evpn.nlri.ipv6.gtw_addr", FT_IPv6
,
13852 BASE_NONE
, NULL
, 0x0, NULL
, HFILL
}},
13853 /* segment routing extensions to link state */
13854 /* Node Attributes TLVs */
13855 { &hf_bgp_ls_sr_tlv_capabilities
,
13856 { "SR Capabilities", "bgp.ls.sr.tlv.capabilities", FT_NONE
,
13857 BASE_NONE
, NULL
, 0x0, NULL
, HFILL
}},
13858 { &hf_bgp_ls_sr_tlv_capabilities_flags
,
13859 { "Flags", "bgp.ls.sr.tlv.capabilities.flags", FT_UINT8
,
13860 BASE_HEX
, NULL
, 0x0, NULL
, HFILL
}},
13861 { &hf_bgp_ls_sr_tlv_capabilities_flags_i
,
13862 { "MPLS IPv4 flag (I)", "bgp.ls.sr.tlv.capabilities.flags.i", FT_BOOLEAN
,
13863 8, TFS(&tfs_set_notset
), BGP_LS_SR_CAPABILITY_FLAG_I
, NULL
, HFILL
}},
13864 { &hf_bgp_ls_sr_tlv_capabilities_flags_v
,
13865 { "MPLS IPv6 flag (V)", "bgp.ls.sr.tlv.capabilities.flags.v", FT_BOOLEAN
,
13866 8, TFS(&tfs_set_notset
), BGP_LS_SR_CAPABILITY_FLAG_V
, NULL
, HFILL
}},
13867 { &hf_bgp_ls_sr_tlv_capabilities_flags_h
,
13868 { "SR-IPv6 flag (H)", "bgp.ls.sr.tlv.capabilities.flags.h", FT_BOOLEAN
,
13869 8, TFS(&tfs_set_notset
), BGP_LS_SR_CAPABILITY_FLAG_H
, NULL
, HFILL
}},
13870 { &hf_bgp_ls_sr_tlv_capabilities_flags_reserved
,
13871 { "Reserved", "bgp.ls.sr.tlv.capabilities.flags.reserved", FT_UINT8
,
13872 BASE_HEX
, NULL
, 0x1F, NULL
, HFILL
}},
13873 { &hf_bgp_ls_sr_tlv_capabilities_range_size
,
13874 { "Range Size", "bgp.ls.sr.tlv.capabilities.range_size", FT_UINT24
,
13875 BASE_DEC
, NULL
, 0x0, NULL
, HFILL
}},
13876 { &hf_bgp_ls_sr_tlv_capabilities_sid_label
,
13877 { "From Label", "bgp.ls.sr.tlv.capabilities.sid.label", FT_UINT24
,
13878 BASE_DEC
, NULL
, 0x0FFFFF, NULL
, HFILL
}},
13879 { &hf_bgp_ls_sr_tlv_capabilities_sid_index
,
13880 { "From Index", "bgp.ls.sr.tlv.capabilities.sid.index", FT_UINT32
,
13881 BASE_DEC
, NULL
, 0x0, NULL
, HFILL
}},
13882 { &hf_bgp_ls_sr_tlv_algorithm
,
13883 { "SR Algorithm TLV", "bgp.ls.sr.tlv.algorithm", FT_NONE
,
13884 BASE_NONE
, NULL
, 0x0, NULL
, HFILL
}},
13885 { &hf_bgp_ls_sr_tlv_algorithm_value
,
13886 { "SR Algorithm", "bgp.ls.sr.tlv.algorithm.value", FT_UINT8
,
13887 BASE_DEC
, NULL
, 0x0, NULL
, HFILL
}},
13888 { &hf_bgp_ls_sr_tlv_local_block
,
13889 { "SR Local Block", "bgp.ls.sr.tlv.local_block", FT_NONE
,
13890 BASE_NONE
, NULL
, 0x0, NULL
, HFILL
}},
13891 { &hf_bgp_ls_sr_tlv_srv6_cap
,
13892 { "SRv6 Capabilities TLV", "bgp.ls.sr.tlv.srv6_capabilities", FT_NONE
,
13893 BASE_NONE
, NULL
, 0x0, NULL
, HFILL
}},
13894 { &hf_bgp_ls_sr_tlv_srv6_cap_flags
,
13895 { "Flags", "bgp.ls.sr.tlv.srv6_capabilities.flags", FT_UINT16
,
13896 BASE_HEX
, NULL
, 0x0, NULL
, HFILL
}},
13897 { &hf_bgp_ls_sr_tlv_srv6_cap_flags_o
,
13898 { "OAM flag (O)", "bgp.ls.sr.tlv.srv6_capabilities.flags.o", FT_BOOLEAN
,
13899 16, TFS(&tfs_set_notset
), BGP_LS_SRV6_CAP_FLAG_O
, NULL
, HFILL
}},
13900 { &hf_bgp_ls_sr_tlv_srv6_cap_flags_reserved
,
13901 { "Reserved", "bgp.ls.sr.tlv.srv6_capabilities.flags.reserved", FT_UINT16
,
13902 BASE_HEX
, NULL
, 0x3fff, NULL
, HFILL
}},
13903 { &hf_bgp_ls_sr_tlv_srv6_cap_reserved
,
13904 { "Reserved", "bgp.ls.sr.tlv.srv6_capabilities.reserved", FT_UINT16
,
13905 BASE_HEX
, NULL
, 0x0, NULL
, HFILL
}},
13906 { &hf_bgp_ls_sr_tlv_local_block_flags
,
13907 { "Flags", "bgp.ls.sr.tlv.local_block.flags", FT_UINT8
,
13908 BASE_HEX
, NULL
, 0x0, NULL
, HFILL
}},
13909 { &hf_bgp_ls_sr_tlv_local_block_range_size
,
13910 { "Range Size", "bgp.ls.sr.tlv.local_block.range_size", FT_UINT24
,
13911 BASE_DEC
, NULL
, 0x0, NULL
, HFILL
}},
13912 { &hf_bgp_ls_sr_tlv_local_block_sid_label
,
13913 { "From Label", "bgp.ls.sr.tlv.local_block.sid.label", FT_UINT24
,
13914 BASE_DEC
, NULL
, 0x0FFFFF, NULL
, HFILL
}},
13915 { &hf_bgp_ls_sr_tlv_local_block_sid_index
,
13916 { "From Index", "bgp.ls.sr.tlv.local_block.sid.index", FT_UINT32
,
13917 BASE_DEC
, NULL
, 0x0, NULL
, HFILL
}},
13918 { &hf_bgp_ls_sr_tlv_flex_algo_def
,
13919 { "Flexible Algorithm Definition TLV", "bgp.ls.sr.tlv.flex_algo", FT_NONE
,
13920 BASE_NONE
, NULL
, 0x0, NULL
, HFILL
}},
13921 { &hf_bgp_ls_sr_tlv_flex_algo_algorithm
,
13922 { "Flex-Algorithm", "bgp.ls.sr.tlv.flex_algo.flex_algorithm", FT_UINT8
,
13923 BASE_DEC
, NULL
, 0x0, NULL
, HFILL
}},
13924 { &hf_bgp_ls_sr_tlv_flex_algo_metric_type
,
13925 { "Metric-Type", "bgp.ls.sr.tlv.flex_algo.metric_type", FT_UINT8
,
13926 BASE_DEC
, VALS(flex_algo_metric_types
), 0x0, NULL
, HFILL
}},
13927 { &hf_bgp_ls_sr_tlv_flex_algo_calc_type
,
13928 { "Calculation-Type", "bgp.ls.sr.tlv.flex_algo.calculation_type", FT_UINT8
,
13929 BASE_DEC
, VALS(igp_algo_types
), 0x0, NULL
, HFILL
}},
13930 { &hf_bgp_ls_sr_tlv_flex_algo_priority
,
13931 { "Priority", "bgp.ls.sr.tlv.flex_algo.priority", FT_UINT8
,
13932 BASE_DEC
, NULL
, 0x0, NULL
, HFILL
}},
13933 { &hf_bgp_ls_sr_tlv_flex_algo_exc_any_affinity
,
13934 { "Flexible Algorithm Exclude-Any Affinity TLV", "bgp.ls.sr.tlv.flex_algo.exclude_any_affinity", FT_NONE
,
13935 BASE_NONE
, NULL
, 0x0, NULL
, HFILL
}},
13936 { &hf_bgp_ls_sr_tlv_flex_algo_inc_any_affinity
,
13937 { "Flexible Algorithm Include-Any Affinity TLV", "bgp.ls.sr.tlv.flex_algo.include_any_affinity", FT_NONE
,
13938 BASE_NONE
, NULL
, 0x0, NULL
, HFILL
}},
13939 { &hf_bgp_ls_sr_tlv_flex_algo_inc_all_affinity
,
13940 { "Flexible Algorithm Include-All Affinity TLV", "bgp.ls.sr.tlv.flex_algo.include_all_affinity", FT_NONE
,
13941 BASE_NONE
, NULL
, 0x0, NULL
, HFILL
}},
13942 { &hf_bgp_ls_sr_tlv_flex_algo_def_flags
,
13943 { "Flexible Algorithm Definition Flags TLV", "bgp.ls.sr.tlv.flex_algo.definition_flags", FT_NONE
,
13944 BASE_NONE
, NULL
, 0x0, NULL
, HFILL
}},
13945 { &hf_bgp_ls_sr_tlv_flex_algo_def_flags_flags
,
13946 { "Flags", "bgp.ls.sr.tlv.flex_algo.definition_flags.flags", FT_UINT32
,
13947 BASE_HEX
, NULL
, 0x0, NULL
, HFILL
}},
13948 { &hf_bgp_ls_sr_tlv_flex_algo_def_flags_flags_m
,
13949 { "M-flag (M)", "bgp.ls.sr.tlv.flex_algo.definition_flags.flags.m", FT_BOOLEAN
,
13950 32, TFS(&tfs_set_notset
), BGP_LS_FLEX_ALGO_DEF_FLAGS_M
, NULL
, HFILL
}},
13951 { &hf_bgp_ls_sr_tlv_flex_algo_exc_srlg
,
13952 { "Flexible Algorithm Exclude SRLG TLV", "bgp.ls.sr.tlv.flex_algo.exclude_srlg", FT_NONE
,
13953 BASE_NONE
, NULL
, 0x0, NULL
, HFILL
}},
13954 /* Prefix Attribute TLVs */
13955 { &hf_bgp_ls_sr_tlv_prefix_sid
,
13956 { "Prefix SID TLV", "bgp.ls.sr.tlv.prefix.sid", FT_NONE
,
13957 BASE_NONE
, NULL
, 0x0, NULL
, HFILL
}},
13958 { &hf_bgp_ls_sr_tlv_prefix_sid_flags
,
13959 { "Flags", "bgp.ls.sr.tlv.prefix.sid.flags", FT_UINT8
,
13960 BASE_HEX
, NULL
, 0x0, NULL
, HFILL
}},
13961 { &hf_bgp_ls_sr_tlv_prefix_sid_flags_r
,
13962 { "Re-advertisement (R)", "bgp.ls.sr.tlv.prefix.sid.flags.r", FT_BOOLEAN
,
13963 8, TFS(&tfs_set_notset
), BGP_LS_SR_PREFIX_SID_FLAG_R
, NULL
, HFILL
}},
13964 { &hf_bgp_ls_sr_tlv_prefix_sid_flags_n
,
13965 { "Node-SID (N)", "bgp.ls.sr.tlv.prefix.sid.flags.n", FT_BOOLEAN
,
13966 8, TFS(&tfs_set_notset
), BGP_LS_SR_PREFIX_SID_FLAG_N
, NULL
, HFILL
}},
13967 { &hf_bgp_ls_sr_tlv_prefix_sid_flags_np
,
13968 { "No-PHP (NP)", "bgp.ls.sr.tlv.prefix.sid.flags.np", FT_BOOLEAN
,
13969 8, TFS(&tfs_set_notset
), BGP_LS_SR_PREFIX_SID_FLAG_NP
, NULL
, HFILL
}},
13970 { &hf_bgp_ls_sr_tlv_prefix_sid_flags_p
,
13971 { "No-PHP (P)", "bgp.ls.sr.tlv.prefix.sid.flags.p", FT_BOOLEAN
,
13972 8, TFS(&tfs_set_notset
), BGP_LS_SR_PREFIX_SID_FLAG_P
, NULL
, HFILL
}},
13973 { &hf_bgp_ls_sr_tlv_prefix_sid_flags_m
,
13974 { "Mapping Server Flag (M)", "bgp.ls.sr.tlv.prefix.sid.flags.m", FT_BOOLEAN
,
13975 8, TFS(&tfs_set_notset
), BGP_LS_SR_PREFIX_SID_FLAG_M
, NULL
, HFILL
}},
13976 { &hf_bgp_ls_sr_tlv_prefix_sid_flags_e
,
13977 { "Explicit-Null (E)", "bgp.ls.sr.tlv.prefix.sid.flags.e", FT_BOOLEAN
,
13978 8, TFS(&tfs_set_notset
), BGP_LS_SR_PREFIX_SID_FLAG_E
, NULL
, HFILL
}},
13979 { &hf_bgp_ls_sr_tlv_prefix_sid_flags_v
,
13980 { "Value (V)", "bgp.ls.sr.tlv.prefix.sid.flags.v", FT_BOOLEAN
,
13981 8, TFS(&tfs_set_notset
), BGP_LS_SR_PREFIX_SID_FLAG_V
, NULL
, HFILL
}},
13982 { &hf_bgp_ls_sr_tlv_prefix_sid_flags_l
,
13983 { "Local (L)", "bgp.ls.sr.tlv.prefix.sid.flags.l", FT_BOOLEAN
,
13984 8, TFS(&tfs_set_notset
), BGP_LS_SR_PREFIX_SID_FLAG_L
, NULL
, HFILL
}},
13985 { &hf_bgp_ls_sr_tlv_prefix_sid_algo
,
13986 { "Algorithm", "bgp.ls.sr.tlv.prefix.sid.algo", FT_UINT8
,
13987 BASE_DEC
, NULL
, 0x0, NULL
, HFILL
}},
13988 { &hf_bgp_ls_sr_tlv_prefix_sid_label
,
13989 { "SID/Label", "bgp.ls.sr.tlv.prefix.sid.label", FT_UINT24
,
13990 BASE_DEC
, NULL
, 0x0FFFFF, NULL
, HFILL
}},
13991 { &hf_bgp_ls_sr_tlv_prefix_sid_index
,
13992 { "SID/Index", "bgp.ls.sr.tlv.prefix.sid.index", FT_UINT32
,
13993 BASE_DEC
, NULL
, 0x0, NULL
, HFILL
}},
13994 { &hf_bgp_ls_sr_tlv_srv6_locator
,
13995 { "SRv6 Locator TLV", "bgp.ls.sr.tlv.srv6_locator", FT_NONE
,
13996 BASE_NONE
, NULL
, 0x0, NULL
, HFILL
}},
13997 { &hf_bgp_ls_sr_tlv_srv6_locator_flags
,
13998 { "Flags", "bgp.ls.sr.tlv.srv6_locator.flags", FT_UINT8
,
13999 BASE_HEX
, NULL
, 0x0, NULL
, HFILL
}},
14000 { &hf_bgp_ls_sr_tlv_srv6_locator_flags_d
,
14001 { "Down flag (D)", "bgp.ls.sr.tlv.srv6_locator.flags.d", FT_BOOLEAN
,
14002 8, TFS(&tfs_set_notset
), BGP_LS_SRV6_LOC_FLAG_D
, NULL
, HFILL
}},
14003 { &hf_bgp_ls_sr_tlv_srv6_locator_flags_reserved
,
14004 { "Reserved", "bgp.ls.sr.tlv.srv6_locator.flags.reserved", FT_UINT8
,
14005 BASE_HEX
, NULL
, BGP_LS_SRV6_LOC_FLAG_RESERVED
, NULL
, HFILL
}},
14006 { &hf_bgp_ls_sr_tlv_srv6_locator_algo
,
14007 { "Algorithm", "bgp.ls.sr.tlv.srv6_locator.algorithm",
14008 FT_UINT8
, BASE_DEC
, VALS(igp_algo_types
), 0x0, NULL
, HFILL
}},
14009 { &hf_bgp_ls_sr_tlv_srv6_locator_reserved
,
14010 { "Reserved", "bgp.ls.sr.tlv.srv6_locator.reserved", FT_UINT16
,
14011 BASE_HEX
, NULL
, 0, NULL
, HFILL
}},
14012 { &hf_bgp_ls_sr_tlv_srv6_locator_metric
,
14013 { "Metric", "bgp.ls.sr.tlv.srv6_locator.metric", FT_UINT32
,
14014 BASE_HEX_DEC
, NULL
, 0x0, NULL
, HFILL
}},
14015 { &hf_bgp_ls_sr_tlv_prefix_attr_flags
,
14016 { "Prefix Attribute Flags TLV", "bgp.ls.sr.tlv.prefix.attribute_flags", FT_NONE
,
14017 BASE_NONE
, NULL
, 0x0, NULL
, HFILL
}},
14018 { &hf_bgp_ls_sr_tlv_prefix_attr_flags_flags
,
14019 { "Flags", "bgp.ls.sr.tlv.prefix.attribute_flags.flags", FT_UINT8
,
14020 BASE_HEX
, NULL
, 0x0, NULL
, HFILL
}},
14021 { &hf_bgp_ls_sr_tlv_prefix_attr_flags_flags_unknown
,
14022 { "Flags", "bgp.ls.sr.tlv.prefix.attribute_flags.flags.unknown", FT_BYTES
,
14023 SEP_SPACE
, NULL
, 0x0,NULL
, HFILL
}},
14024 { &hf_bgp_ls_sr_tlv_prefix_attr_flags_flags_ao
,
14025 { "Attach (A)", "bgp.ls.sr.tlv.prefix.attribute_flags.flags.a", FT_BOOLEAN
,
14026 8, TFS(&tfs_set_notset
), BGP_LS_SR_PREFIX_ATTR_FLAGS_FLAG_AO
, NULL
, HFILL
}},
14027 { &hf_bgp_ls_sr_tlv_prefix_attr_flags_flags_no
,
14028 { "Node (N)", "bgp.ls.sr.tlv.prefix.attribute_flags.flags.n", FT_BOOLEAN
,
14029 8, TFS(&tfs_set_notset
), BGP_LS_SR_PREFIX_ATTR_FLAGS_FLAG_NO
, NULL
, HFILL
}},
14030 { &hf_bgp_ls_sr_tlv_prefix_attr_flags_flags_eo
,
14031 { "ELC (E)", "bgp.ls.sr.tlv.prefix.attribute_flags.flags.e", FT_BOOLEAN
,
14032 8, TFS(&tfs_set_notset
), BGP_LS_SR_PREFIX_ATTR_FLAGS_FLAG_EO
, NULL
, HFILL
}},
14033 { &hf_bgp_ls_sr_tlv_prefix_attr_flags_flags_xi
,
14034 { "External Prefix (X)", "bgp.ls.sr.tlv.prefix.attribute_flags.flags.x", FT_BOOLEAN
,
14035 8, TFS(&tfs_set_notset
), BGP_LS_SR_PREFIX_ATTR_FLAGS_FLAG_XI
, NULL
, HFILL
}},
14036 { &hf_bgp_ls_sr_tlv_prefix_attr_flags_flags_ri
,
14037 { "Re-advertisement (X)", "bgp.ls.sr.tlv.prefix.attribute_flags.flags.r", FT_BOOLEAN
,
14038 8, TFS(&tfs_set_notset
), BGP_LS_SR_PREFIX_ATTR_FLAGS_FLAG_RI
, NULL
, HFILL
}},
14039 { &hf_bgp_ls_sr_tlv_prefix_attr_flags_flags_ni
,
14040 { "Node (N)", "bgp.ls.sr.tlv.prefix.attribute_flags.flags.n", FT_BOOLEAN
,
14041 8, TFS(&tfs_set_notset
), BGP_LS_SR_PREFIX_ATTR_FLAGS_FLAG_NI
, NULL
, HFILL
}},
14042 { &hf_bgp_ls_sr_tlv_prefix_attr_flags_flags_ei
,
14043 { "ELC (E)", "bgp.ls.sr.tlv.prefix.attribute_flags.flags.e", FT_BOOLEAN
,
14044 8, TFS(&tfs_set_notset
), BGP_LS_SR_PREFIX_ATTR_FLAGS_FLAG_EI
, NULL
, HFILL
}},
14045 { &hf_bgp_ls_sr_tlv_source_router_id
,
14046 { "Source Router-ID TLV", "bgp.ls.sr.tlv.source_router_id", FT_NONE
,
14047 BASE_NONE
, NULL
, 0x0, NULL
, HFILL
}},
14048 { &hf_bgp_ls_sr_tlv_flex_algo_prefix_metric
,
14049 { "Flexible Algorithm Prefix Metric TLV", "bgp.ls.sr.tlv.flex_algo.prefix_metric", FT_NONE
,
14050 BASE_NONE
, NULL
, 0x0, NULL
, HFILL
}},
14051 { &hf_bgp_ls_sr_tlv_flex_algo_prefix_metric_flags
,
14052 { "Flags", "bgp.ls.sr.tlv.flex_algo.prefix_metric.flags", FT_UINT8
,
14053 BASE_HEX
, NULL
, 0x0, NULL
, HFILL
}},
14054 { &hf_bgp_ls_sr_tlv_flex_algo_prefix_metric_flags_e
,
14055 { "E bit (E)", "bgp.ls.sr.tlv.flex_algo.prefix_metric.flags.e", FT_BOOLEAN
,
14056 8, TFS(&tfs_set_notset
), BGP_LS_FLEX_ALGO_PREFIX_METRIC_FLAGS_E
, NULL
, HFILL
}},
14057 { &hf_bgp_ls_sr_tlv_flex_algo_prefix_metric_reserved
,
14058 { "Reserved", "bgp.ls.sr.tlv.flex_algo.prefix_metric.reserved", FT_UINT16
,
14059 BASE_HEX
, NULL
, 0x0, NULL
, HFILL
}},
14060 { &hf_bgp_ls_sr_tlv_flex_algo_prefix_metric_metric
,
14061 { "Metric", "bgp.ls.sr.tlv.flex_algo.prefix_metric.metric", FT_UINT32
,
14062 BASE_HEX_DEC
, NULL
, 0x0, NULL
, HFILL
}},
14063 /* SID Attribute TLVs */
14064 { &hf_bgp_ls_sr_tlv_srv6_endpoint_behavior
,
14065 { "SRv6 Endpoint Behavior TLV", "bgp.ls.sr.tlv.srv6_endpoint_behavior", FT_NONE
,
14066 BASE_NONE
, NULL
, 0x0, NULL
, HFILL
}},
14067 { &hf_bgp_ls_sr_tlv_srv6_endpoint_behavior_endpoint_behavior
,
14068 { "Endpoint Behavior", "bgp.ls.sr.tlv.srv6_endpoint_behavior.endpoint_behavior", FT_UINT16
,
14069 BASE_HEX
, VALS(srv6_endpoint_behavior
), 0x0, NULL
, HFILL
}},
14070 { &hf_bgp_ls_sr_tlv_srv6_endpoint_behavior_flags
,
14071 { "Flags", "bgp.ls.sr.tlv.srv6_endpoint_behavior.flags", FT_UINT8
,
14072 BASE_HEX
, NULL
, 0x0, NULL
, HFILL
}},
14073 { &hf_bgp_ls_sr_tlv_srv6_endpoint_behavior_algo
,
14074 { "Algorithm", "bgp.ls.sr.tlv.srv6_endpoint_behavior.algorithm",
14075 FT_UINT8
, BASE_DEC
, VALS(igp_algo_types
), 0x0, NULL
, HFILL
}},
14076 /* Adjacency Attribute TLVs */
14077 { &hf_bgp_ls_sr_tlv_adjacency_sid
,
14078 { "Adjacency SID TLV", "bgp.ls.sr.tlv.adjacency.sid", FT_NONE
,
14079 BASE_NONE
, NULL
, 0x0, NULL
, HFILL
}},
14080 { &hf_bgp_ls_sr_tlv_adjacency_sid_flags
,
14081 { "Flags", "bgp.ls.sr.tlv.adjacency.sid.flags", FT_UINT8
,
14082 BASE_HEX
, NULL
, 0x0, NULL
, HFILL
}},
14083 { &hf_bgp_ls_sr_tlv_adjacency_sid_flags_fi
,
14084 { "Address-Family flag (F)", "bgp.ls.sr.tlv.adjacency.sid.flags.f", FT_BOOLEAN
,
14085 8, TFS(&tfs_set_notset
), BGP_LS_SR_ADJACENCY_SID_FLAG_FI
, NULL
, HFILL
}},
14086 { &hf_bgp_ls_sr_tlv_adjacency_sid_flags_bo
,
14087 { "Backup Flag (B)", "bgp.ls.sr.tlv.adjacency.sid.flags.b", FT_BOOLEAN
,
14088 8, TFS(&tfs_set_notset
), BGP_LS_SR_ADJACENCY_SID_FLAG_BO
, NULL
, HFILL
}},
14089 { &hf_bgp_ls_sr_tlv_adjacency_sid_flags_bi
,
14090 { "Backup Flag (B)", "bgp.ls.sr.tlv.adjacency.sid.flags.b", FT_BOOLEAN
,
14091 8, TFS(&tfs_set_notset
), BGP_LS_SR_ADJACENCY_SID_FLAG_BI
, NULL
, HFILL
}},
14092 { &hf_bgp_ls_sr_tlv_adjacency_sid_flags_vo
,
14093 { "Value Flag (V)", "bgp.ls.sr.tlv.adjacency.sid.flags.v", FT_BOOLEAN
,
14094 8, TFS(&tfs_set_notset
), BGP_LS_SR_ADJACENCY_SID_FLAG_VO
, NULL
, HFILL
}},
14095 { &hf_bgp_ls_sr_tlv_adjacency_sid_flags_vi
,
14096 { "Value Flag (V)", "bgp.ls.sr.tlv.adjacency.sid.flags.v", FT_BOOLEAN
,
14097 8, TFS(&tfs_set_notset
), BGP_LS_SR_ADJACENCY_SID_FLAG_VI
, NULL
, HFILL
}},
14098 { &hf_bgp_ls_sr_tlv_adjacency_sid_flags_lo
,
14099 { "Local Flag (L)", "bgp.ls.sr.tlv.adjacency.sid.flags.l", FT_BOOLEAN
,
14100 8, TFS(&tfs_set_notset
), BGP_LS_SR_ADJACENCY_SID_FLAG_LO
, NULL
, HFILL
}},
14101 { &hf_bgp_ls_sr_tlv_adjacency_sid_flags_li
,
14102 { "Local Flag (L)", "bgp.ls.sr.tlv.adjacency.sid.flags.l", FT_BOOLEAN
,
14103 8, TFS(&tfs_set_notset
), BGP_LS_SR_ADJACENCY_SID_FLAG_LI
, NULL
, HFILL
}},
14104 { &hf_bgp_ls_sr_tlv_adjacency_sid_flags_go
,
14105 { "Group Flag (S)", "bgp.ls.sr.tlv.adjacency.sid.flags.g", FT_BOOLEAN
,
14106 8, TFS(&tfs_set_notset
), BGP_LS_SR_ADJACENCY_SID_FLAG_GO
, NULL
, HFILL
}},
14107 { &hf_bgp_ls_sr_tlv_adjacency_sid_flags_si
,
14108 { "Set Flag (S)", "bgp.ls.sr.tlv.adjacency.sid.flags.s", FT_BOOLEAN
,
14109 8, TFS(&tfs_set_notset
), BGP_LS_SR_ADJACENCY_SID_FLAG_SI
, NULL
, HFILL
}},
14110 { &hf_bgp_ls_sr_tlv_adjacency_sid_flags_po
,
14111 { "Persistent Flag (P)", "bgp.ls.sr.tlv.adjacency.sid.flags.p", FT_BOOLEAN
,
14112 8, TFS(&tfs_set_notset
), BGP_LS_SR_ADJACENCY_SID_FLAG_PO
, NULL
, HFILL
}},
14113 { &hf_bgp_ls_sr_tlv_adjacency_sid_flags_pi
,
14114 { "Persistent Flag (P)", "bgp.ls.sr.tlv.adjacency.sid.flags.p", FT_BOOLEAN
,
14115 8, TFS(&tfs_set_notset
), BGP_LS_SR_ADJACENCY_SID_FLAG_PI
, NULL
, HFILL
}},
14116 { &hf_bgp_ls_sr_tlv_adjacency_sid_weight
,
14117 { "Weight", "bgp.ls.sr.tlv.adjacency.sid.weight", FT_UINT8
,
14118 BASE_DEC
, NULL
, 0x0, NULL
, HFILL
}},
14119 { &hf_bgp_ls_sr_tlv_adjacency_sid_label
,
14120 { "SID/Label", "bgp.ls.sr.tlv.adjacency.sid.label", FT_UINT24
,
14121 BASE_DEC
, NULL
, 0x0FFFFF, NULL
, HFILL
}},
14122 { &hf_bgp_ls_sr_tlv_adjacency_sid_index
,
14123 { "SID/Index", "bgp.ls.sr.tlv.adjacency.sid.index", FT_UINT32
,
14124 BASE_DEC
, NULL
, 0x0, NULL
, HFILL
}},
14125 { &hf_bgp_ls_sr_tlv_peer_node_sid
,
14126 { "PeerNode SID TLV", "bgp.ls.sr.tlv.peer_node.sid", FT_NONE
,
14127 BASE_NONE
, NULL
, 0x0, NULL
, HFILL
}},
14128 { &hf_bgp_ls_sr_tlv_peer_adj_sid
,
14129 { "PeerAdj SID TLV", "bgp.ls.sr.tlv.peer_adj.sid", FT_NONE
,
14130 BASE_NONE
, NULL
, 0x0, NULL
, HFILL
}},
14131 { &hf_bgp_ls_sr_tlv_peer_set_sid
,
14132 { "PeerSet SID TLV", "bgp.ls.sr.tlv.peer_set.sid", FT_NONE
,
14133 BASE_NONE
, NULL
, 0x0, NULL
, HFILL
}},
14134 { &hf_bgp_ls_sr_tlv_peer_sid_flags
,
14135 { "Flags", "bgp.ls.sr.tlv.peer.sid.flags", FT_UINT8
,
14136 BASE_HEX
, NULL
, 0x0, NULL
, HFILL
}},
14137 { &hf_bgp_ls_sr_tlv_peer_sid_flags_v
,
14138 { "Value flag (V)", "bgp.ls.sr.tlv.peer.sid.flags.v", FT_BOOLEAN
,
14139 8, TFS(&tfs_set_notset
), BGP_LS_SR_PEER_SID_FLAG_V
, NULL
, HFILL
}},
14140 { &hf_bgp_ls_sr_tlv_peer_sid_flags_l
,
14141 { "Local flag (L)", "bgp.ls.sr.tlv.peer.sid.flags.l", FT_BOOLEAN
,
14142 8, TFS(&tfs_set_notset
), BGP_LS_SR_PEER_SID_FLAG_L
, NULL
, HFILL
}},
14143 { &hf_bgp_ls_sr_tlv_peer_sid_flags_b
,
14144 { "Backup flag (B)", "bgp.ls.sr.tlv.peer.sid.flags.b", FT_BOOLEAN
,
14145 8, TFS(&tfs_set_notset
), BGP_LS_SR_PEER_SID_FLAG_B
, NULL
, HFILL
}},
14146 { &hf_bgp_ls_sr_tlv_peer_sid_flags_p
,
14147 { "Persistent flag (P)", "bgp.ls.sr.tlv.peer.sid.flags.p", FT_BOOLEAN
,
14148 8, TFS(&tfs_set_notset
), BGP_LS_SR_PEER_SID_FLAG_P
, NULL
, HFILL
}},
14149 { &hf_bgp_ls_sr_tlv_peer_sid_weight
,
14150 { "Weight", "bgp.ls.sr.tlv.peer.sid.weight", FT_UINT8
,
14151 BASE_DEC
, NULL
, 0x0, NULL
, HFILL
}},
14152 { &hf_bgp_ls_sr_tlv_peer_sid_label
,
14153 { "SID/Label", "bgp.ls.sr.tlv.peer.sid.label", FT_UINT24
,
14154 BASE_DEC
, NULL
, 0x0FFFFF, NULL
, HFILL
}},
14155 { &hf_bgp_ls_sr_tlv_peer_sid_index
,
14156 { "SID/Index", "bgp.ls.sr.tlv.peer.sid.index", FT_UINT32
,
14157 BASE_DEC
, NULL
, 0x0, NULL
, HFILL
}},
14158 { &hf_bgp_ls_sr_tlv_srv6_endx_sid
,
14159 { "SRv6 End.X SID TLV", "bgp.ls.sr.tlv.srv6_endx_sid", FT_NONE
,
14160 BASE_NONE
, NULL
, 0x0, NULL
, HFILL
}},
14161 { &hf_bgp_ls_sr_tlv_srv6_lan_endx_sid
,
14162 { "SRv6 LAN End.X SID TLV", "bgp.ls.sr.tlv.srv6_lan_endx_sid", FT_NONE
,
14163 BASE_NONE
, NULL
, 0x0, NULL
, HFILL
}},
14164 { &hf_bgp_ls_sr_tlv_srv6_endx_sid_endpoint_behavior
,
14165 { "Endpoint Behavior", "bgp.ls.sr.tlv.srv6_endx_sid.endpoint_behavior",
14166 FT_UINT16
, BASE_DEC
, VALS(srv6_endpoint_behavior
), 0x0, NULL
, HFILL
}},
14167 { &hf_bgp_ls_sr_tlv_srv6_endx_sid_flags
,
14168 { "Flags", "bgp.ls.sr.tlv.srv6_endx_sid.flags", FT_UINT8
,
14169 BASE_HEX
, NULL
, 0x0, NULL
, HFILL
}},
14170 { &hf_bgp_ls_sr_tlv_srv6_endx_sid_flags_b
,
14171 { "Backup flag", "bgp.ls.sr.tlv.srv6_endx_sid.flags.b",
14172 FT_BOOLEAN
, 8, TFS(&tfs_set_notset
), BGP_LS_SRV6_ENDX_SID_FLAG_B
, NULL
, HFILL
}},
14173 { &hf_bgp_ls_sr_tlv_srv6_endx_sid_flags_s
,
14174 { "Set flag", "bgp.ls.sr.tlv.srv6_endx_sid.flags.s",
14175 FT_BOOLEAN
, 8, TFS(&tfs_set_notset
), BGP_LS_SRV6_ENDX_SID_FLAG_S
, NULL
, HFILL
}},
14176 { &hf_bgp_ls_sr_tlv_srv6_endx_sid_flags_p
,
14177 { "Persistent flag", "bgp.ls.sr.tlv.srv6_endx_sid.flags.p",
14178 FT_BOOLEAN
, 8, TFS(&tfs_set_notset
), BGP_LS_SRV6_ENDX_SID_FLAG_P
, NULL
, HFILL
}},
14179 { &hf_bgp_ls_sr_tlv_srv6_endx_sid_flags_reserved
,
14180 { "Reserved", "bgp.ls.sr.tlv.srv6_endx_sid.flags.reserved",
14181 FT_UINT8
, BASE_HEX
, NULL
, BGP_LS_SRV6_ENDX_SID_FLAG_RESERVED
, NULL
, HFILL
}},
14182 { &hf_bgp_ls_sr_tlv_srv6_endx_sid_algo
,
14183 { "Algorithm", "bgp.ls.sr.tlv.srv6_endx_sid.algorithm",
14184 FT_UINT8
, BASE_DEC
, VALS(igp_algo_types
), 0x0, NULL
, HFILL
}},
14185 { &hf_bgp_ls_sr_tlv_srv6_endx_sid_weight
,
14186 { "Weight", "bgp.ls.sr.tlv.srv6_endx_sid.weight",
14187 FT_UINT8
, BASE_DEC
, NULL
, 0x0, NULL
, HFILL
}},
14188 { &hf_bgp_ls_sr_tlv_srv6_endx_sid_reserved
,
14189 { "Reserved", "bgp.ls.sr.tlv.srv6_endx_sid.reserved",
14190 FT_UINT8
, BASE_HEX
, NULL
, 0x0, NULL
, HFILL
}},
14191 { &hf_bgp_ls_sr_tlv_srv6_endx_sid_neighbor_ospf
,
14192 { "Neighbor-ID", "bgp.ls.tlv.srv6_endx_sid.neighbor_id_ospf", FT_IPv4
,
14193 BASE_NONE
, NULL
, 0x0, NULL
, HFILL
}},
14194 { &hf_bgp_ls_sr_tlv_srv6_endx_sid_neighbor_isis
,
14195 { "Neighbor-ID", "bgp.ls.tlv.srv6_endx_sid.neighbor_id_isis", FT_SYSTEM_ID
,
14196 BASE_NONE
, NULL
, 0x0, NULL
, HFILL
}},
14197 { &hf_bgp_ls_sr_tlv_srv6_endx_sid_sid
,
14198 { "SID", "bgp.ls.sr.tlv.srv6_endx_sid.sid",
14199 FT_IPv6
, BASE_NONE
, NULL
, 0x0, NULL
, HFILL
}},
14200 { &hf_bgp_ls_sr_tlv_srv6_sid_struct
,
14201 { "SRv6 SID Structure TLV", "bgp.ls.sr.tlv.srv6_sid_structure", FT_NONE
,
14202 BASE_NONE
, NULL
, 0x0, NULL
, HFILL
}},
14203 { &hf_bgp_ls_sr_tlv_srv6_sid_struct_lb_len
,
14204 { "Locator Block Length", "bgp.ls.sr.tlv.srv6_sid_structure.locator_block_len",
14205 FT_UINT8
, BASE_DEC
, NULL
, 0x0, NULL
, HFILL
}},
14206 { &hf_bgp_ls_sr_tlv_srv6_sid_struct_ln_len
,
14207 { "Locator Node Length", "bgp.ls.sr.tlv.srv6_sid_structure.locator_node_len",
14208 FT_UINT8
, BASE_DEC
, NULL
, 0x0, NULL
, HFILL
}},
14209 { &hf_bgp_ls_sr_tlv_srv6_sid_struct_fun_len
,
14210 { "Function Length", "bgp.ls.sr.tlv.srv6_sid_structure.fun_len",
14211 FT_UINT8
, BASE_DEC
, NULL
, 0x0, NULL
, HFILL
}},
14212 { &hf_bgp_ls_sr_tlv_srv6_sid_struct_arg_len
,
14213 { "Arguments Length", "bgp.ls.sr.tlv.srv6_sid_structure.arg_len",
14214 FT_UINT8
, BASE_DEC
, NULL
, 0x0,NULL
, HFILL
}},
14215 { &hf_bgp_ls_igp_te_metric_flags
,
14216 { "TE Metric Flags", "bgp.ls.igp_te_metric.flags", FT_UINT8
,
14217 BASE_HEX
, NULL
, 0x0, NULL
, HFILL
}},
14218 { &hf_bgp_ls_igp_te_metric_flags_a
,
14219 { "Anomalous (A) bit", "bgp.ls.igp_te_metric.flags.a", FT_BOOLEAN
,
14220 8, TFS(&tfs_set_notset
), BGP_LS_IGP_TE_METRIC_FLAG_A
, NULL
, HFILL
}},
14221 { &hf_bgp_ls_igp_te_metric_flags_reserved
,
14222 { "Reserved", "bgp.ls.igp_te_metric.flags.reserved", FT_UINT8
,
14223 BASE_HEX
, NULL
, BGP_LS_IGP_TE_METRIC_FLAG_RESERVED
, NULL
, HFILL
}},
14224 { &hf_bgp_ls_igp_te_metric_delay
,
14225 { "Unidirectional Link Delay TLV", "bgp.ls.igp_te_metric.delay", FT_NONE
,
14226 BASE_NONE
, NULL
, 0x0, NULL
, HFILL
}},
14227 { &hf_bgp_ls_igp_te_metric_delay_value
,
14228 { "Delay", "bgp.ls.igp_te_metric.delay_value", FT_UINT24
,
14229 BASE_DEC
, NULL
, 0x0, NULL
, HFILL
}},
14230 { &hf_bgp_ls_igp_te_metric_delay_min_max
,
14231 { "Min/Max Unidirectional Link Delay TLV", "bgp.ls.igp_te_metric.delay_min_max", FT_NONE
,
14232 BASE_NONE
, NULL
, 0x0, NULL
, HFILL
}},
14233 { &hf_bgp_ls_igp_te_metric_delay_min
,
14234 { "Min Delay", "bgp.ls.igp_te_metric.delay_min", FT_UINT24
,
14235 BASE_DEC
, NULL
, 0x0, NULL
, HFILL
}},
14236 { &hf_bgp_ls_igp_te_metric_delay_max
,
14237 { "Max Delay", "bgp.ls.igp_te_metric.delay_max", FT_UINT24
,
14238 BASE_DEC
, NULL
, 0x0, NULL
, HFILL
}},
14239 { &hf_bgp_ls_igp_te_metric_delay_variation
,
14240 { "Unidirectional Delay Variation TLV", "bgp.ls.igp_te_metric.delay_variation", FT_NONE
,
14241 BASE_NONE
, NULL
, 0x0, NULL
, HFILL
}},
14242 { &hf_bgp_ls_igp_te_metric_delay_variation_value
,
14243 { "Delay Variation", "bgp.ls.igp_te_metric.delay_variation_value", FT_UINT24
,
14244 BASE_DEC
, NULL
, 0x0, NULL
, HFILL
}},
14245 { &hf_bgp_ls_igp_te_metric_link_loss
,
14246 { "Unidirectional Link Loss TLV", "bgp.ls.igp_te_metric.link_loss", FT_NONE
,
14247 BASE_NONE
, NULL
, 0x0, NULL
, HFILL
}},
14248 { &hf_bgp_ls_igp_te_metric_link_loss_value
,
14249 { "Link Loss", "bgp.ls.igp_te_metric.link_loss_value", FT_UINT24
,
14250 BASE_DEC
, NULL
, 0x0, NULL
, HFILL
}},
14251 { &hf_bgp_ls_igp_te_metric_bandwidth_residual
,
14252 { "Unidirectional Residual Bandwidth TLV", "bgp.ls.igp_te_metric.residual_bandwidth", FT_NONE
,
14253 BASE_NONE
, NULL
, 0x0, NULL
, HFILL
}},
14254 { &hf_bgp_ls_igp_te_metric_bandwidth_residual_value
,
14255 { "Residual Bandwidth", "bgp.ls.igp_te_metric.residual_bandwidth_value", FT_UINT32
,
14256 BASE_DEC
, NULL
, 0x0, NULL
, HFILL
}},
14257 { &hf_bgp_ls_igp_te_metric_bandwidth_available
,
14258 { "Unidirectional Available Bandwidth TLV", "bgp.ls.igp_te_metric.available_bandwidth", FT_NONE
,
14259 BASE_NONE
, NULL
, 0x0, NULL
, HFILL
}},
14260 { &hf_bgp_ls_igp_te_metric_bandwidth_available_value
,
14261 { "Residual Bandwidth", "bgp.ls.igp_te_metric.available_bandwidth_value", FT_UINT32
,
14262 BASE_DEC
, NULL
, 0x0, NULL
, HFILL
}},
14263 { &hf_bgp_ls_igp_te_metric_bandwidth_utilized
,
14264 { "Unidirectional Utilized Bandwidth TLV", "bgp.ls.igp_te_metric.utilized_bandwidth", FT_NONE
,
14265 BASE_NONE
, NULL
, 0x0, NULL
, HFILL
}},
14266 { &hf_bgp_ls_igp_te_metric_bandwidth_utilized_value
,
14267 { "Utilized Bandwidth", "bgp.ls.igp_te_metric.utilized_bandwidth_value", FT_UINT32
,
14268 BASE_DEC
, NULL
, 0x0, NULL
, HFILL
}},
14269 { &hf_bgp_ls_igp_te_metric_reserved
,
14270 { "Reserved", "bgp.ls.igp_te_metric.reserved", FT_UINT8
,
14271 BASE_HEX
, NULL
, 0x0, NULL
, HFILL
}},
14272 { &hf_bgp_ls_tlv_app_spec_link_attrs
,
14273 { "Application-Specific Link Attributes TLV", "bgp.ls.tlv.application_specific_link_attributes", FT_NONE
,
14274 BASE_NONE
, NULL
, 0x0, NULL
, HFILL
}},
14275 { &hf_bgp_ls_tlv_app_spec_link_attrs_sabm_len
,
14276 { "SABM Length", "bgp.ls.tlv.application_specific_link_attributes.sabm_length", FT_UINT8
,
14277 BASE_DEC
, NULL
, 0x0, NULL
, HFILL
}},
14278 { &hf_bgp_ls_tlv_app_spec_link_attrs_udabm_len
,
14279 { "UDABM Length", "bgp.ls.tlv.application_specific_link_attributes.udabm_length", FT_UINT8
,
14280 BASE_DEC
, NULL
, 0x0, NULL
, HFILL
}},
14281 { &hf_bgp_ls_tlv_app_spec_link_attrs_reserved
,
14282 { "Reserved", "bgp.ls.tlv.application_specific_link_attributes.reserved", FT_UINT16
,
14283 BASE_HEX
, NULL
, 0x0, NULL
, HFILL
}},
14284 { &hf_bgp_ls_tlv_app_spec_link_attrs_sabm
,
14285 { "Standard Application Identifier Bit Mask", "bgp.ls.tlv.application_specific_link_attributes.sabm", FT_UINT32
,
14286 BASE_HEX
, NULL
, 0x0, NULL
, HFILL
}},
14287 { &hf_bgp_ls_tlv_app_spec_link_attrs_sabm_r
,
14288 { "RSVP-TE (R)", "bgp.ls.tlv.application_specific_link_attributes.sabm.r", FT_BOOLEAN
,
14289 32, TFS(&tfs_set_notset
), BGP_LS_APP_SPEC_LINK_ATTRS_SABM_R
, NULL
, HFILL
}},
14290 { &hf_bgp_ls_tlv_app_spec_link_attrs_sabm_s
,
14291 { "Segment Routing Policy (S)", "bgp.ls.tlv.application_specific_link_attributes.sabm.s", FT_BOOLEAN
,
14292 32, TFS(&tfs_set_notset
), BGP_LS_APP_SPEC_LINK_ATTRS_SABM_S
, NULL
, HFILL
}},
14293 { &hf_bgp_ls_tlv_app_spec_link_attrs_sabm_f
,
14294 { "Loop Free Alternate (F)", "bgp.ls.tlv.application_specific_link_attributes.sabm.f", FT_BOOLEAN
,
14295 32, TFS(&tfs_set_notset
), BGP_LS_APP_SPEC_LINK_ATTRS_SABM_F
, NULL
, HFILL
}},
14296 { &hf_bgp_ls_tlv_app_spec_link_attrs_sabm_x
,
14297 { "Flexible Algorithm (X)", "bgp.ls.tlv.application_specific_link_attributes.sabm.x", FT_BOOLEAN
,
14298 32, TFS(&tfs_set_notset
), BGP_LS_APP_SPEC_LINK_ATTRS_SABM_X
, NULL
, HFILL
}},
14299 { &hf_bgp_ls_tlv_app_spec_link_attrs_udabm
,
14300 { "User-Defined Application Identifier Bit Mask", "bgp.ls.tlv.application_specific_link_attributes.udabm", FT_BYTES
,
14301 SEP_SPACE
, NULL
, 0x0,NULL
, HFILL
}},
14303 { &hf_bgp_evpn_nlri_igmp_mc_or_length
,
14304 { "Originator Router Length", "bgp.evpn.nlri.or_length", FT_UINT8
,
14305 BASE_DEC
, NULL
, 0x0, NULL
, HFILL
}},
14306 { &hf_bgp_evpn_nlri_igmp_mc_or_addr_ipv4
,
14307 { "Originator Router Address IPv4", "bgp.evpn.nlri.or_addr_ipv4", FT_IPv4
,
14308 BASE_NONE
, NULL
, 0x0, NULL
, HFILL
}},
14309 { &hf_bgp_evpn_nlri_igmp_mc_or_addr_ipv6
,
14310 { "Originator Router Address IPv6", "bgp.evpn.nlri.or_addr_ipv6", FT_IPv6
,
14311 BASE_NONE
, NULL
, 0x0, NULL
, HFILL
}},
14312 { &hf_bgp_evpn_nlri_igmp_mc_flags
,
14313 { "Flags", "bgp.evpn.nlri.igmp_mc_flags", FT_UINT8
,
14314 BASE_HEX
, NULL
, 0x0, NULL
, HFILL
}},
14315 { &hf_bgp_evpn_nlri_igmp_mc_flags_v1
,
14316 { "IGMP Version 1", "bgp.evpn.nlri.igmp_mc_flags.v1", FT_BOOLEAN
,
14317 8, TFS(&tfs_set_notset
), EVPN_IGMP_MC_FLAG_V1
, NULL
, HFILL
}},
14318 { &hf_bgp_evpn_nlri_igmp_mc_flags_v2
,
14319 { "IGMP Version 2", "bgp.evpn.nlri.igmp_mc_flags.v2", FT_BOOLEAN
,
14320 8, TFS(&tfs_set_notset
), EVPN_IGMP_MC_FLAG_V2
, NULL
, HFILL
}},
14321 { &hf_bgp_evpn_nlri_igmp_mc_flags_v3
,
14322 { "IGMP Version 3", "bgp.evpn.nlri.igmp_mc_flags.v3", FT_BOOLEAN
,
14323 8, TFS(&tfs_set_notset
), EVPN_IGMP_MC_FLAG_V3
, NULL
, HFILL
}},
14324 { &hf_bgp_evpn_nlri_igmp_mc_flags_ie
,
14325 { "Group Type (IE Flag)", "bgp.evpn.nlri.igmp_mc_flags.ie", FT_BOOLEAN
,
14326 8, TFS(&tfs_exclude_include
), EVPN_IGMP_MC_FLAG_IE
, "Group Type (Include/Exclude Flag)", HFILL
}},
14327 { &hf_bgp_evpn_nlri_igmp_mc_flags_reserved
,
14328 { "Reserved", "bgp.evpn.nlri.igmp_mc_flags.reserved", FT_UINT8
,
14329 BASE_HEX
, NULL
, EVPN_IGMP_MC_FLAG_RESERVED
, NULL
, HFILL
}},
14331 /* draft-mpmz-bess-mup-safi-00 */
14332 { &hf_bgp_mup_nlri
,
14333 { "BGP-MUP NLRI", "bgp.mup.nlri", FT_NONE
,
14334 BASE_NONE
, NULL
, 0x0, NULL
, HFILL
}},
14335 { &hf_bgp_mup_nlri_at
,
14336 { "Architecture Type", "bgp.mup.nlri.at", FT_UINT8
, BASE_DEC
,
14337 VALS(bgp_mup_architecture_types
), 0x0, NULL
, HFILL
}},
14338 { &hf_bgp_mup_nlri_rt
,
14339 { "Route Type", "bgp.mup.nlri.rt", FT_UINT16
, BASE_DEC
,
14340 VALS(bgp_mup_route_types
), 0x0, NULL
, HFILL
}},
14341 { &hf_bgp_mup_nlri_len
,
14342 { "Length", "bgp.mup.nlri.len", FT_UINT8
,
14343 BASE_DEC
, NULL
, 0x0, NULL
, HFILL
}},
14344 { &hf_bgp_mup_nlri_rd
,
14345 { "Route Distinguisher", "bgp.mup.nlri.rd", FT_BYTES
,
14346 BASE_NONE
, NULL
, 0x0, NULL
, HFILL
}},
14347 { &hf_bgp_mup_nlri_prefixlen
,
14348 { "Prefix Length", "bgp.mup.nlri.prefixlen", FT_UINT8
,
14349 BASE_DEC
, NULL
, 0x0, NULL
, HFILL
}},
14350 { &hf_bgp_mup_nlri_ip_prefix
,
14351 { "IPv4 Prefix", "bgp.mup.nlri.ip_prefix", FT_IPv4
,
14352 BASE_NONE
, NULL
, 0x0, NULL
, HFILL
}},
14353 { &hf_bgp_mup_nlri_ipv6_prefix
,
14354 { "IPv6 Prefix", "bgp.mup.nlri.ipv6_prefix", FT_IPv6
,
14355 BASE_NONE
, NULL
, 0x0, NULL
, HFILL
}},
14356 { &hf_bgp_mup_nlri_ip_addr
,
14357 { "IPv4 Address", "bgp.mup.nlri.ip_addr", FT_IPv4
,
14358 BASE_NONE
, NULL
, 0x0, NULL
, HFILL
}},
14359 { &hf_bgp_mup_nlri_ipv6_addr
,
14360 { "IPv6 Address", "bgp.mup.nlri.ipv6_addr", FT_IPv6
,
14361 BASE_NONE
, NULL
, 0x0, NULL
, HFILL
}},
14362 { &hf_bgp_mup_nlri_3gpp_5g_teid
,
14363 { "TEID", "bgp.mup.nlri.3gpp_5g.teid", FT_UINT32
,
14364 BASE_HEX
, NULL
, 0x0, NULL
, HFILL
}},
14365 { &hf_bgp_mup_nlri_3gpp_5g_qfi
,
14366 { "QFI", "bgp.mup.nlri.3gpp_5g.qfi", FT_UINT8
,
14367 BASE_HEX
, NULL
, 0x0, NULL
, HFILL
}},
14368 { &hf_bgp_mup_nlri_3gpp_5g_ep_addr_len
,
14369 { "Endpoint Length", "bgp.mup.nlri.3gpp_5g.ep.len", FT_UINT8
,
14370 BASE_DEC
, NULL
, 0x0, NULL
, HFILL
}},
14371 { &hf_bgp_mup_nlri_3gpp_5g_ep_ip_addr
,
14372 { "Endpoint Address", "bgp.mup.nlri.3gpp_5g.ep.ip_addr", FT_IPv4
,
14373 BASE_NONE
, NULL
, 0x0, NULL
, HFILL
}},
14374 { &hf_bgp_mup_nlri_3gpp_5g_ep_ipv6_addr
,
14375 { "Endpoint Address", "bgp.mup.nlri.3gpp_5g.ep.ipv6_addr", FT_IPv6
,
14376 BASE_NONE
, NULL
, 0x0, NULL
, HFILL
}},
14377 { &hf_bgp_mup_nlri_3gpp_5g_source_addr_len
,
14378 { "Source Address Length", "bgp.mup.nlri.3gpp_5g.source.len", FT_UINT8
,
14379 BASE_DEC
, NULL
, 0x0, NULL
, HFILL
}},
14380 { &hf_bgp_mup_nlri_3gpp_5g_source_ip_addr
,
14381 { "Source Address", "bgp.mup.nlri.3gpp_5g.source.ip_addr", FT_IPv4
,
14382 BASE_NONE
, NULL
, 0x0, NULL
, HFILL
}},
14383 { &hf_bgp_mup_nlri_3gpp_5g_source_ipv6_addr
,
14384 { "Source Address", "bgp.mup.nlri.3gpp_5g.source.ipv6_addr", FT_IPv6
,
14385 BASE_NONE
, NULL
, 0x0, NULL
, HFILL
}},
14386 { &hf_bgp_mup_nlri_ep_len
,
14387 { "Endpoint Length", "bgp.mup.nlri.ep.len", FT_UINT8
,
14388 BASE_DEC
, NULL
, 0x0, NULL
, HFILL
}},
14389 { &hf_bgp_mup_nlri_ep_ip_addr
,
14390 { "Endpoint Address", "bgp.mup.nlri.ep.ip_addr", FT_IPv4
,
14391 BASE_NONE
, NULL
, 0x0, NULL
, HFILL
}},
14392 { &hf_bgp_mup_nlri_ep_ipv6_addr
,
14393 { "Endpoint Address", "bgp.mup.nlri.ep.ipv6_addr", FT_IPv6
,
14394 BASE_NONE
, NULL
, 0x0, NULL
, HFILL
}},
14395 { &hf_bgp_mup_nlri_3gpp_5g_ep_teid
,
14396 { "Endpoint TEID", "bgp.mup.nlri.3gpp_5g.ep.teid", FT_UINT32
,
14397 BASE_DEC
, NULL
, 0x0, NULL
, HFILL
}},
14398 { &hf_bgp_mup_nlri_3gpp_5g_type1_st_route
,
14399 { "3gpp-5g specific Type 1 ST route", "bgp.mup.nlri.3gpp_5g.type1_st_route", FT_NONE
,
14400 BASE_NONE
, NULL
, 0x0, NULL
, HFILL
}},
14401 { &hf_bgp_mup_nlri_3gpp_5g_type2_st_route
,
14402 { "3gpp-5g specific Type 2 ST route", "bgp.mup.nlri.3gpp_5g.type2_st_route", FT_NONE
,
14403 BASE_NONE
, NULL
, 0x0, NULL
, HFILL
}},
14404 { &hf_bgp_mup_nlri_unknown_data
,
14405 { "Unknown Data", "bgp.mup.nlri.unknown_data", FT_BYTES
,
14406 BASE_NONE
, NULL
, 0x0, NULL
, HFILL
}},
14409 static int *ett
[] = {
14415 &ett_bgp_attr_flags
,
14417 &ett_bgp_mp_reach_nlri
,
14418 &ett_bgp_mp_unreach_nlri
,
14423 &ett_bgp_notification
,
14424 &ett_bgp_route_refresh
,
14425 &ett_bgp_capability
,
14426 &ett_bgp_as_path_segment
,
14427 &ett_bgp_as_path_segment_asn
,
14428 &ett_bgp_communities
,
14429 &ett_bgp_community
,
14430 &ett_bgp_cluster_list
,
14433 &ett_bgp_options_ext
,
14435 &ett_bgp_extended_communities
,
14436 &ett_bgp_extended_community
,
14437 &ett_bgp_ext_com_type
,
14438 &ett_bgp_extended_com_fspec_redir
,
14439 &ett_bgp_ext_com_flags
,
14440 &ett_bgp_ext_com_l2_flags
,
14441 &ett_bgp_ext_com_etree_flags
,
14442 &ett_bgp_ext_com_evpn_mmac_flags
,
14443 &ett_bgp_ext_com_evpn_l2attr_flags
,
14444 &ett_bgp_ext_com_evpn_etree_flags
,
14445 &ett_bgp_ext_com_cost_cid
,
14446 &ett_bgp_ext_com_ospf_rt_opt
,
14447 &ett_bgp_ext_com_eigrp_flags
,
14449 &ett_bgp_ssa_subtree
,
14451 &ett_bgp_orf_entry
,
14452 &ett_bgp_mcast_vpn_nlri
,
14453 &ett_bgp_flow_spec_nlri
,
14454 &ett_bgp_flow_spec_nlri_filter
,
14455 &ett_bgp_flow_spec_nlri_op_flags
,
14456 &ett_bgp_flow_spec_nlri_tcp
,
14457 &ett_bgp_flow_spec_nlri_ff
,
14458 &ett_bgp_tunnel_tlv
,
14459 &ett_bgp_tunnel_tlv_subtree
,
14460 &ett_bgp_tunnel_subtlv
,
14461 &ett_bgp_tunnel_subtlv_subtree
,
14462 &ett_bgp_link_state
,
14463 &ett_bgp_evpn_nlri
,
14464 &ett_bgp_evpn_nlri_esi
,
14465 &ett_bgp_evpn_nlri_mc
,
14466 &ett_bgp_mpls_labels
,
14467 &ett_bgp_pmsi_tunnel_id
,
14468 &ett_bgp_aigp_attr
,
14469 &ett_bgp_large_communities
,
14471 &ett_bgp_prefix_sid_label_index
,
14472 &ett_bgp_prefix_sid_ipv6
,
14473 &ett_bgp_prefix_sid_originator_srgb
,
14474 &ett_bgp_prefix_sid_originator_srgb_block
,
14475 &ett_bgp_prefix_sid_originator_srgb_blocks
,
14476 &ett_bgp_bgpsec_secure_path
,
14477 &ett_bgp_bgpsec_secure_path_segment
,
14478 &ett_bgp_bgpsec_signature_block
,
14479 &ett_bgp_bgpsec_signature_segment
,
14481 &ett_bgp_binding_sid
,
14482 &ett_bgp_segment_list
,
14483 &ett_bgp_prefix_sid_unknown
,
14484 &ett_bgp_prefix_sid_srv6_l3vpn
,
14485 &ett_bgp_prefix_sid_srv6_l3vpn_sub_tlvs
,
14486 &ett_bgp_prefix_sid_srv6_l3vpn_sid_information
,
14487 &ett_bgp_prefix_sid_srv6_l3vpn_sub_sub_tlvs
,
14488 &ett_bgp_prefix_sid_srv6_l3vpn_sid_structure
,
14489 &ett_bgp_prefix_sid_srv6_l3vpn_sid_unknown
,
14490 &ett_bgp_prefix_sid_srv6_l3vpn_unknown
,
14491 &ett_bgp_prefix_sid_srv6_l2vpn
,
14492 &ett_bgp_prefix_sid_srv6_l2vpn_sub_tlvs
,
14493 &ett_bgp_prefix_sid_srv6_l2vpn_sid_information
,
14494 &ett_bgp_prefix_sid_srv6_l2vpn_sub_sub_tlvs
,
14495 &ett_bgp_prefix_sid_srv6_l2vpn_sid_structure
,
14496 &ett_bgp_prefix_sid_srv6_l2vpn_sid_unknown
,
14497 &ett_bgp_prefix_sid_srv6_l2vpn_unknown
,
14499 &ett_bgp_mup_nlri_3gpp_5g_type1_st_route
,
14500 &ett_bgp_mup_nlri_3gpp_5g_type2_st_route
,
14502 static ei_register_info ei
[] = {
14503 { &ei_bgp_marker_invalid
, { "bgp.marker_invalid", PI_MALFORMED
, PI_ERROR
, "Marker is not all ones", EXPFILL
}},
14504 { &ei_bgp_cap_len_bad
, { "bgp.cap.length.bad", PI_MALFORMED
, PI_ERROR
, "Capability length is wrong", EXPFILL
}},
14505 { &ei_bgp_cap_gr_helper_mode_only
, { "bgp.cap.gr.helper_mode_only", PI_REQUEST_CODE
, PI_CHAT
, "Graceful Restart Capability supported in Helper mode only", EXPFILL
}},
14506 { &ei_bgp_notify_minor_unknown
, { "bgp.notify.minor_error.unknown", PI_UNDECODED
, PI_NOTE
, "Unknown notification error", EXPFILL
}},
14507 { &ei_bgp_route_refresh_orf_type_unknown
, { "bgp.route_refresh.orf.type.unknown", PI_MALFORMED
, PI_ERROR
, "ORFEntry-Unknown", EXPFILL
}},
14508 { &ei_bgp_length_invalid
, { "bgp.length.invalid", PI_MALFORMED
, PI_ERROR
, "Length is invalid", EXPFILL
}},
14509 { &ei_bgp_prefix_length_invalid
, { "bgp.prefix_length.invalid", PI_MALFORMED
, PI_ERROR
, "Prefix length is invalid", EXPFILL
}},
14510 { &ei_bgp_afi_type_not_supported
, { "bgp.afi_type_not_supported", PI_PROTOCOL
, PI_ERROR
, "AFI Type not supported", EXPFILL
}},
14511 { &ei_bgp_unknown_afi
, { "bgp.unknown_afi", PI_PROTOCOL
, PI_ERROR
, "Unknown Address Family", EXPFILL
}},
14512 { &ei_bgp_unknown_safi
, { "bgp.unknown_safi", PI_PROTOCOL
, PI_ERROR
, "Unknown SAFI", EXPFILL
}},
14513 { &ei_bgp_unknown_label_vpn
, { "bgp.unknown_label", PI_PROTOCOL
, PI_ERROR
, "Unknown Label VPN", EXPFILL
}},
14514 { &ei_bgp_ls_error
, { "bgp.ls.error", PI_PROTOCOL
, PI_ERROR
, "Link State error", EXPFILL
}},
14515 { &ei_bgp_ls_warn
, { "bgp.ls.warn", PI_PROTOCOL
, PI_WARN
, "Link State warning", EXPFILL
}},
14516 { &ei_bgp_ext_com_len_bad
, { "bgp.ext_com.length.bad", PI_PROTOCOL
, PI_ERROR
, "Extended community length is wrong", EXPFILL
}},
14517 { &ei_bgp_evpn_nlri_rt_type_err
, { "bgp.evpn.type", PI_MALFORMED
, PI_ERROR
, "EVPN Route Type is invalid", EXPFILL
}},
14518 { &ei_bgp_evpn_nlri_rt_len_err
, { "bgp.evpn.len", PI_MALFORMED
, PI_ERROR
, "EVPN Length is invalid", EXPFILL
}},
14519 { &ei_bgp_evpn_nlri_esi_type_err
, { "bgp.evpn.esi_type", PI_MALFORMED
, PI_ERROR
, "EVPN ESI Type is invalid", EXPFILL
}},
14520 { &ei_bgp_evpn_nlri_rt4_no_ip
, { "bgp.evpn.no_ip", PI_PROTOCOL
, PI_NOTE
, "IP Address: NOT INCLUDED", EXPFILL
}},
14521 { &ei_bgp_attr_pmsi_tunnel_type
, { "bgp.attr.pmsi.tunnel_type", PI_PROTOCOL
, PI_ERROR
, "Unknown Tunnel type", EXPFILL
}},
14522 { &ei_bgp_attr_pmsi_opaque_type
, { "bgp.attr.pmsi.opaque_type", PI_PROTOCOL
, PI_ERROR
, "Invalid pmsi opaque type", EXPFILL
}},
14523 { &ei_bgp_attr_aigp_type
, { "bgp.attr.aigp.type", PI_MALFORMED
, PI_NOTE
, "Unknown AIGP attribute type", EXPFILL
}},
14524 { &ei_bgp_prefix_length_err
, { "bgp.prefix.length", PI_MALFORMED
, PI_ERROR
, "Invalid IPv6 prefix length", EXPFILL
}},
14525 { &ei_bgp_attr_as_path_as_len_err
, { "bgp.attr.as_path.as_len", PI_UNDECODED
, PI_ERROR
, "unable to determine 4 or 2 bytes ASN", EXPFILL
}},
14526 { &ei_bgp_next_hop_ipv6_scope
, { "bgp.next_hop.ipv6.scope", PI_PROTOCOL
, PI_WARN
, "Invalid IPv6 address scope", EXPFILL
}},
14527 { &ei_bgp_next_hop_rd_nonzero
, { "bgp.next_hop.rd.nonzero", PI_PROTOCOL
, PI_WARN
, "Route Distinguisher in Next Hop Network Address nonzero", EXPFILL
}},
14528 { &ei_bgp_mup_unknown_at
, { "bgp.mup.unknown_at", PI_PROTOCOL
, PI_ERROR
, "Unknown architecture type", EXPFILL
}},
14529 { &ei_bgp_mup_unknown_rt
, { "bgp.mup.unknown_rt", PI_PROTOCOL
, PI_ERROR
, "Unknown route type", EXPFILL
}},
14530 { &ei_bgp_mup_nlri_addr_len_err
, { "bgp.mup.nlri.addr_len_err", PI_PROTOCOL
, PI_ERROR
, "Address length invalid", EXPFILL
}},
14533 module_t
*bgp_module
;
14534 expert_module_t
* expert_bgp
;
14536 static const enum_val_t asn_len
[] = {
14537 {"auto-detect", "Auto-detect", 0},
14538 {"2", "2 octet", 2},
14539 {"4", "4 octet", 4},
14543 proto_bgp
= proto_register_protocol("Border Gateway Protocol", "BGP", "bgp");
14544 proto_register_field_array(proto_bgp
, hf
, array_length(hf
));
14545 proto_register_subtree_array(ett
, array_length(ett
));
14546 expert_bgp
= expert_register_protocol(proto_bgp
);
14547 expert_register_field_array(expert_bgp
, ei
, array_length(ei
));
14549 bgp_module
= prefs_register_protocol(proto_bgp
, NULL
);
14550 prefs_register_bool_preference(bgp_module
, "desegment",
14551 "Reassemble BGP messages spanning multiple TCP segments",
14552 "Whether the BGP dissector should reassemble messages spanning multiple TCP segments."
14553 " To use this option, you must also enable \"Allow subdissectors to reassemble TCP streams\" in the TCP protocol settings.",
14555 prefs_register_enum_preference(bgp_module
, "asn_len",
14556 "Length of the AS number",
14557 "BGP dissector detect the length of the AS number in AS_PATH attributes automatically or manually (NOTE: Automatic detection is not 100% accurate)",
14558 &bgp_asn_len
, asn_len
, false);
14560 bgp_handle
= register_dissector("bgp", dissect_bgp
, proto_bgp
);
14561 register_dissector("bgp.pdu", dissect_bgp_pdu
, proto_bgp
);
14565 proto_reg_handoff_bgp(void)
14567 dissector_add_uint_with_preference("tcp.port", BGP_TCP_PORT
, bgp_handle
);
14570 * Editor modelines - https://www.wireshark.org/tools/modelines.html
14573 * c-basic-offset: 4
14575 * indent-tabs-mode: nil
14578 * ex: set shiftwidth=4 tabstop=8 expandtab:
14579 * :indentSize=4:tabSize=8:noTabs=true: