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_ADJ_SID 1099
975 #define BGP_LS_SR_TLV_LAN_ADJ_SID 1100
976 #define BGP_LS_SR_TLV_PEER_NODE_SID 1101
977 #define BGP_LS_SR_TLV_PEER_ADJ_SID 1102
978 #define BGP_LS_SR_TLV_PEER_SET_SID 1103
979 #define BGP_LS_SR_TLV_SRV6_END_X_SID 1106
980 #define BGP_LS_SR_TLV_SRV6_LAN_END_X_SID 1107
981 #define BGP_LS_SR_TLV_PREFIX_SID 1158
982 #define BGP_LS_SR_TLV_RANGE 1159
983 #define BGP_LS_SR_TLV_SRV6_LOCATOR 1162
984 #define BGP_LS_SR_TLV_PREFIX_ATTR_FLAGS 1170
985 #define BGP_LS_SR_TLV_SOURCE_ROUTER_ID 1171
986 #define BGP_LS_SR_TLV_SRV6_ENDPOINT_BEHAVIOR 1250
987 #define BGP_LS_SR_TLV_SRV6_SID_STRUCT 1252
989 /* RFC8571 BGP-LS Advertisement of IGP TE Metric Extensions */
990 #define BGP_LS_IGP_TE_METRIC_DELAY 1114
991 #define BGP_LS_IGP_TE_METRIC_DELAY_MIN_MAX 1115
992 #define BGP_LS_IGP_TE_METRIC_DELAY_VARIATION 1116
993 #define BGP_LS_IGP_TE_METRIC_LOSS 1117
994 #define BGP_LS_IGP_TE_METRIC_BANDWIDTH_RESIDUAL 1118
995 #define BGP_LS_IGP_TE_METRIC_BANDWIDTH_AVAILABLE 1119
996 #define BGP_LS_IGP_TE_METRIC_BANDWIDTH_UTILIZED 1120
998 #define BGP_LS_IGP_TE_METRIC_FLAG_A 0x80
999 #define BGP_LS_IGP_TE_METRIC_FLAG_RESERVED 0x7F
1001 /* draft-ietf-idr-bgp-ls-app-specific-attr-07 */
1002 #define BGP_LS_APP_SPEC_LINK_ATTR 1122
1004 /* Prefix-SID TLV flags, draft-gredler-idr-bgp-ls-segment-routing-ext, RFC 8665-8667:
1007 +--+--+--+--+--+--+--+--+
1008 if Protocol-ID is IS-IS |R |N |P |E |V |L | | |
1009 +--+--+--+--+--+--+--+--+
1012 +--+--+--+--+--+--+--+--+
1013 if Protocol-ID is OSPF | |NP|M |E |V |L | | |
1014 +--+--+--+--+--+--+--+--+
1016 #define BGP_LS_SR_PREFIX_SID_FLAG_R 0x80
1017 #define BGP_LS_SR_PREFIX_SID_FLAG_N 0x40
1018 #define BGP_LS_SR_PREFIX_SID_FLAG_NP 0x40
1019 #define BGP_LS_SR_PREFIX_SID_FLAG_P 0x20
1020 #define BGP_LS_SR_PREFIX_SID_FLAG_M 0x20
1021 #define BGP_LS_SR_PREFIX_SID_FLAG_E 0x10
1022 #define BGP_LS_SR_PREFIX_SID_FLAG_V 0x08
1023 #define BGP_LS_SR_PREFIX_SID_FLAG_L 0x04
1025 /* Adjacency-SID TLV flags, draft-gredler-idr-bgp-ls-segment-routing-ext, RFC 8665-8667:
1028 +--+--+--+--+--+--+--+--+
1029 if Protocol-ID is IS-IS |F |B |V |L |S |P | | |
1030 +--+--+--+--+--+--+--+--+
1033 +--+--+--+--+--+--+--+--+
1034 if Protocol-ID is OSPF |B |V |L |G |P | | | |
1035 +--+--+--+--+--+--+--+--+
1037 #define BGP_LS_SR_ADJACENCY_SID_FLAG_FI 0x80
1038 #define BGP_LS_SR_ADJACENCY_SID_FLAG_BO 0x80
1039 #define BGP_LS_SR_ADJACENCY_SID_FLAG_BI 0x40
1040 #define BGP_LS_SR_ADJACENCY_SID_FLAG_VO 0x40
1041 #define BGP_LS_SR_ADJACENCY_SID_FLAG_VI 0x20
1042 #define BGP_LS_SR_ADJACENCY_SID_FLAG_LO 0x20
1043 #define BGP_LS_SR_ADJACENCY_SID_FLAG_LI 0x10
1044 #define BGP_LS_SR_ADJACENCY_SID_FLAG_GO 0x10
1045 #define BGP_LS_SR_ADJACENCY_SID_FLAG_SI 0x08
1046 #define BGP_LS_SR_ADJACENCY_SID_FLAG_PO 0x08
1047 #define BGP_LS_SR_ADJACENCY_SID_FLAG_PI 0x04
1049 /* BGP Peering SIDs TLV flags, rfc9086:
1052 +--+--+--+--+--+--+--+--+
1053 |V |L |B |P | | | | | rfc9086
1054 +--+--+--+--+--+--+--+--+
1056 #define BGP_LS_SR_PEER_SID_FLAG_V 0x80
1057 #define BGP_LS_SR_PEER_SID_FLAG_L 0x40
1058 #define BGP_LS_SR_PEER_SID_FLAG_B 0x20
1059 #define BGP_LS_SR_PEER_SID_FLAG_P 0x10
1061 /* SR-Capabilities TLV flags, draft-gredler-idr-bgp-ls-segment-routing-ext-01:
1064 +--+--+--+--+--+--+--+--+
1065 if Protocol-ID is IS-IS |I |V |H | | | | | |
1066 +--+--+--+--+--+--+--+--+
1068 #define BGP_LS_SR_CAPABILITY_FLAG_I 0x80
1069 #define BGP_LS_SR_CAPABILITY_FLAG_V 0x40
1070 #define BGP_LS_SR_CAPABILITY_FLAG_H 0x20
1072 /* Prefix Attribute Flags TLV flags, rfc9085:
1075 +--+--+--+--+--+--+--+--+
1076 if Protocol-ID is IS-IS |X |R |N |E | | | | | rfc7794,rfc9088
1077 +--+--+--+--+--+--+--+--+
1080 +--+--+--+--+--+--+--+--+
1081 if Protocol-ID is OSPF |A |N |E | | | | | | rfc7684,rfc9089
1082 +--+--+--+--+--+--+--+--+
1084 #define BGP_LS_SR_PREFIX_ATTR_FLAGS_FLAG_XI 0x80
1085 #define BGP_LS_SR_PREFIX_ATTR_FLAGS_FLAG_RI 0x40
1086 #define BGP_LS_SR_PREFIX_ATTR_FLAGS_FLAG_NI 0x20
1087 #define BGP_LS_SR_PREFIX_ATTR_FLAGS_FLAG_EI 0x10
1088 #define BGP_LS_SR_PREFIX_ATTR_FLAGS_FLAG_AO 0x80
1089 #define BGP_LS_SR_PREFIX_ATTR_FLAGS_FLAG_NO 0x40
1090 #define BGP_LS_SR_PREFIX_ATTR_FLAGS_FLAG_EO 0x20
1092 /* Link Attribute Application Identifiers, https://www.iana.org/assignments/igp-parameters/igp-parameters.xhtml:
1095 +--+--+--+--+--+--+--+--+
1096 |R |S |F |X | | | | | rfc8919,rfc8920
1097 +--+--+--+--+--+--+--+--+
1099 #define BGP_LS_APP_SPEC_LINK_ATTRS_SABM_R 0x80000000
1100 #define BGP_LS_APP_SPEC_LINK_ATTRS_SABM_S 0x40000000
1101 #define BGP_LS_APP_SPEC_LINK_ATTRS_SABM_F 0x20000000
1102 #define BGP_LS_APP_SPEC_LINK_ATTRS_SABM_X 0x10000000
1104 /* SRv6 Capabilities TLV flags, draft-ietf-idr-bgpls-srv6-ext-14
1106 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
1107 +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+
1108 if Protocol-ID is IS-IS | |O | Reserved | rfc9352
1109 +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+
1111 #define BGP_LS_SRV6_CAP_FLAG_O 0x4000
1112 #define BGP_LS_SRV6_CAP_FLAG_RESERVED 0x3fff
1114 /* SRv6 End.X SID TLV flags, draft-ietf-idr-bgpls-srv6-ext-14
1117 +--+--+--+--+--+--+--+--+
1118 if Protocol-ID is IS-IS |B |S |P | | | | | | rfc9352
1119 +--+--+--+--+--+--+--+--+
1121 #define BGP_LS_SRV6_ENDX_SID_FLAG_B 0x80
1122 #define BGP_LS_SRV6_ENDX_SID_FLAG_S 0x40
1123 #define BGP_LS_SRV6_ENDX_SID_FLAG_P 0x20
1124 #define BGP_LS_SRV6_ENDX_SID_FLAG_RESERVED 0x1f
1126 /* SRv6 Locator TLV flags, draft-ietf-idr-bgpls-srv6-ext-14
1129 +--+--+--+--+--+--+--+--+
1130 if Protocol-ID is IS-IS |D | Reserved | rfc9352
1131 +--+--+--+--+--+--+--+--+
1133 #define BGP_LS_SRV6_LOC_FLAG_D 0x80
1134 #define BGP_LS_SRV6_LOC_FLAG_RESERVED 0x7f
1136 /* BGP Prefix-SID TLV type */
1137 #define BGP_PREFIX_SID_TLV_LABEL_INDEX 1 /* Label-Index [RFC8669] */
1138 #define BGP_PREFIX_SID_TLV_2 2 /* Deprecated [RFC8669] */
1139 #define BGP_PREFIX_SID_TLV_ORIGINATOR_SRGB 3 /* Originator SRGB [RFC8669] */
1140 #define BGP_PREFIX_SID_TLV_4 4 /* Deprecated [draft-ietf-bess-srv6-services] */
1141 #define BGP_PREFIX_SID_TLV_SRV6_L3_SERVICE 5 /* SRv6 L3 Service [draft-ietf-bess-srv6-services] */
1142 #define BGP_PREFIX_SID_TLV_SRV6_L2_SERVICE 6 /* SRv6 L2 Service [draft-ietf-bess-srv6-services] */
1144 /* BGP_PREFIX_SID TLV lengths */
1145 #define BGP_PREFIX_SID_TLV_LEN_LABEL_INDEX 7
1147 /* BGP SRv6 Service Sub-TLV */
1148 #define SRV6_SERVICE_SRV6_SID_INFORMATION 1
1150 /* BGP SRv6 Service Data Sub-Sub-TLV */
1151 #define SRV6_SERVICE_DATA_SRV6_SID_STRUCTURE 1
1153 /* SRv6 Endpoint behavior */
1154 #define SRV6_ENDPOINT_BEHAVIOR_END 0x0001 /* End [RFC8986] */
1155 #define SRV6_ENDPOINT_BEHAVIOR_END_PSP 0x0002 /* End with PSP [RFC8986] */
1156 #define SRV6_ENDPOINT_BEHAVIOR_END_USP 0x0003 /* End with USP [RFC8986] */
1157 #define SRV6_ENDPOINT_BEHAVIOR_END_PSP_USP 0x0004 /* End with PSP & USP [RFC8986] */
1158 #define SRV6_ENDPOINT_BEHAVIOR_END_X 0x0005 /* End.X [RFC8986] */
1159 #define SRV6_ENDPOINT_BEHAVIOR_END_X_PSP 0x0006 /* End.X with PSP [RFC8986] */
1160 #define SRV6_ENDPOINT_BEHAVIOR_END_X_USP 0x0007 /* End.X with UPS [RFC8986] */
1161 #define SRV6_ENDPOINT_BEHAVIOR_END_X_PSP_USP 0x0008 /* End.X with PSP & USP [RFC8986] */
1162 #define SRV6_ENDPOINT_BEHAVIOR_END_T 0x0009 /* End.T [RFC8986] */
1163 #define SRV6_ENDPOINT_BEHAVIOR_END_T_PSP 0x000A /* End.T with PSP [RFC8986] */
1164 #define SRV6_ENDPOINT_BEHAVIOR_END_T_USP 0x000B /* End.T with USP [RFC8986] */
1165 #define SRV6_ENDPOINT_BEHAVIOR_END_T_PSP_USP 0x000C /* End.T with PSP & USP [RFC8986] */
1166 #define SRV6_ENDPOINT_BEHAVIOR_END_B6_INSERT 0x000D /* End.B6.Insert [draft-filsfils-spring-srv6-net-pgm-insertion-04] */
1167 #define SRV6_ENDPOINT_BEHAVIOR_END_B6_ENCAPS 0x000E /* End.B6.Encaps [RFC8986] */
1168 #define SRV6_ENDPOINT_BEHAVIOR_END_BM 0x000F /* End.BM [RFC8986] */
1169 #define SRV6_ENDPOINT_BEHAVIOR_END_DX6 0x0010 /* End.DX6 [RFC8986] */
1170 #define SRV6_ENDPOINT_BEHAVIOR_END_DX4 0x0011 /* End.DX4 [RFC8986] */
1171 #define SRV6_ENDPOINT_BEHAVIOR_END_DT6 0x0012 /* End.DT6 [RFC8986] */
1172 #define SRV6_ENDPOINT_BEHAVIOR_END_DT4 0x0013 /* End.DT4 [RFC8986] */
1173 #define SRV6_ENDPOINT_BEHAVIOR_END_DT46 0x0014 /* End.DT46 [RFC8986] */
1174 #define SRV6_ENDPOINT_BEHAVIOR_END_DX2 0x0015 /* End.DX2 [RFC8986] */
1175 #define SRV6_ENDPOINT_BEHAVIOR_END_DX2V 0x0016 /* End.DX2V [RFC8986] */
1176 #define SRV6_ENDPOINT_BEHAVIOR_END_DT2U 0x0017 /* End.DX2U [RFC8986] */
1177 #define SRV6_ENDPOINT_BEHAVIOR_END_DT2M 0x0018 /* End.DT2M [RFC8986] */
1178 #define SRV6_ENDPOINT_BEHAVIOR_END_B6_INSERT_RED 0x001A /* End.B6.Insert.Red [draft-filsfils-spring-srv6-net-pgm-insertion-04] */
1179 #define SRV6_ENDPOINT_BEHAVIOR_END_B6_ENCAPS_RED 0x001B /* End.B6.Encaps.Red [RFC8986] */
1180 #define SRV6_ENDPOINT_BEHAVIOR_END_USD 0x001C /* End with USD [RFC8986] */
1181 #define SRV6_ENDPOINT_BEHAVIOR_END_PSP_USD 0x001D /* End with PSP & USD [RFC8986] */
1182 #define SRV6_ENDPOINT_BEHAVIOR_END_USP_USD 0x001E /* End with USP & USD [RFC8986] */
1183 #define SRV6_ENDPOINT_BEHAVIOR_END_PSP_USP_USD 0x001F /* End with PSP, USP & USD [RFC8986] */
1184 #define SRV6_ENDPOINT_BEHAVIOR_END_X_USD 0x0020 /* End.X with USD [RFC8986] */
1185 #define SRV6_ENDPOINT_BEHAVIOR_END_X_PSP_USD 0x0021 /* End.X with PSP & USD [RFC8986] */
1186 #define SRV6_ENDPOINT_BEHAVIOR_END_X_USP_USD 0x0022 /* End.X with USP & USD [RFC8986] */
1187 #define SRV6_ENDPOINT_BEHAVIOR_END_X_PSP_USP_USD 0x0023 /* End.X with PSP, USP & USD [RFC8986] */
1188 #define SRV6_ENDPOINT_BEHAVIOR_END_T_USD 0x0024 /* End.T with USD [RFC8986] */
1189 #define SRV6_ENDPOINT_BEHAVIOR_END_T_PSP_USD 0x0025 /* End.T with PSP & USD [RFC8986] */
1190 #define SRV6_ENDPOINT_BEHAVIOR_END_T_USP_USD 0x0026 /* End.T with USP & USD [RFC8986] */
1191 #define SRV6_ENDPOINT_BEHAVIOR_END_T_PSP_USP_USD 0x0027 /* End.T with PSP, USP & USD [RFC8986] */
1192 #define SRV6_ENDPOINT_BEHAVIOR_END_MAP 0x0028 /* End.MAP */
1193 #define SRV6_ENDPOINT_BEHAVIOR_END_LIMIT 0x0029 /* End.Limit */
1194 #define SRV6_ENDPOINT_BEHAVIOR_END_ONLY_CSID 0x002A /* End with NEXT-ONLY-CSID [draft-filsfils-spring-net-pgm-extension-srv6-usid] */
1195 #define SRV6_ENDPOINT_BEHAVIOR_END_CSID 0x002B /* End with NEXT-CSID [draft-ietf-spring-srv6-srh-compression] */
1196 #define SRV6_ENDPOINT_BEHAVIOR_END_CSID_PSP 0x002C /* End with NEXT-CSID & PSP [draft-ietf-spring-srv6-srh-compression] */
1197 #define SRV6_ENDPOINT_BEHAVIOR_END_CSID_USP 0x002D /* End with NEXT-CSID & USP [draft-ietf-spring-srv6-srh-compression] */
1198 #define SRV6_ENDPOINT_BEHAVIOR_END_CSID_PSP_USP 0x002E /* End with NEXT-CSID, PSP & USP [draft-ietf-spring-srv6-srh-compression] */
1199 #define SRV6_ENDPOINT_BEHAVIOR_END_CSID_USD 0x002F /* End with NEXT-CSID & USD [draft-ietf-spring-srv6-srh-compression] */
1200 #define SRV6_ENDPOINT_BEHAVIOR_END_CSID_PSP_USD 0x0030 /* End with NEXT-CSID, PSP & USD [draft-ietf-spring-srv6-srh-compression] */
1201 #define SRV6_ENDPOINT_BEHAVIOR_END_CSID_USP_USD 0x0031 /* End with NEXT-CSID, USP & USD [draft-ietf-spring-srv6-srh-compression] */
1202 #define SRV6_ENDPOINT_BEHAVIOR_END_CSID_PSP_USP_USD 0x0032 /* End with NEXT-CSID, PSP, USP & USD [draft-ietf-spring-srv6-srh-compression] */
1203 #define SRV6_ENDPOINT_BEHAVIOR_END_X_ONLY_CSID 0x0033 /* End.X with NEXT-ONLY-CSID [draft-filsfils-spring-net-pgm-extension-srv6-usid] */
1204 #define SRV6_ENDPOINT_BEHAVIOR_END_X_CSID 0x0034 /* End.X with NEXT-CSID [draft-ietf-spring-srv6-srh-compression] */
1205 #define SRV6_ENDPOINT_BEHAVIOR_END_X_CSID_PSP 0x0035 /* End.X with NEXT-CSID & PSP [draft-ietf-spring-srv6-srh-compression] */
1206 #define SRV6_ENDPOINT_BEHAVIOR_END_X_CSID_USP 0x0036 /* End.X with NEXT-CSID & USP [draft-ietf-spring-srv6-srh-compression] */
1207 #define SRV6_ENDPOINT_BEHAVIOR_END_X_CSID_PSP_USP 0x0037 /* End.X with NEXT-CSID, PSP & USP [draft-ietf-spring-srv6-srh-compression] */
1208 #define SRV6_ENDPOINT_BEHAVIOR_END_X_CSID_USD 0x0038 /* End.X with NEXT-CSID & USD [draft-ietf-spring-srv6-srh-compression] */
1209 #define SRV6_ENDPOINT_BEHAVIOR_END_X_CSID_PSP_USD 0x0039 /* End.X with NEXT-CSID, PSP & USD [draft-ietf-spring-srv6-srh-compression] */
1210 #define SRV6_ENDPOINT_BEHAVIOR_END_X_CSID_USP_USD 0x003A /* End.X with NEXT-CSID, USP & USD [draft-ietf-spring-srv6-srh-compression] */
1211 #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] */
1212 #define SRV6_ENDPOINT_BEHAVIOR_END_DX6_CSID 0x003C /* End.DX6 with NEXT-CSID [draft-filsfils-spring-net-pgm-extension-srv6-usid] */
1213 #define SRV6_ENDPOINT_BEHAVIOR_END_DX4_CSID 0x003D /* End.DX4 with NEXT-CSID [draft-filsfils-spring-net-pgm-extension-srv6-usid] */
1214 #define SRV6_ENDPOINT_BEHAVIOR_END_DT6_CSID 0x003E /* End.DT6 with NEXT-CSID [draft-filsfils-spring-net-pgm-extension-srv6-usid] */
1215 #define SRV6_ENDPOINT_BEHAVIOR_END_DT4_CSID 0x003F /* End.DT4 with NEXT-CSID [draft-filsfils-spring-net-pgm-extension-srv6-usid] */
1216 #define SRV6_ENDPOINT_BEHAVIOR_END_DT46_CSID 0x0040 /* End.DT46 with NEXT-CSID [draft-filsfils-spring-net-pgm-extension-srv6-usid] */
1217 #define SRV6_ENDPOINT_BEHAVIOR_END_DX2_CSID 0x0041 /* End.DX2 with NEXT-CSID [draft-filsfils-spring-net-pgm-extension-srv6-usid] */
1218 #define SRV6_ENDPOINT_BEHAVIOR_END_DX2V_CSID 0x0042 /* End.DX2V with NEXT-CSID [draft-filsfils-spring-net-pgm-extension-srv6-usid] */
1219 #define SRV6_ENDPOINT_BEHAVIOR_END_DT2U_CSID 0x0043 /* End.DT2U with NEXT-CSID [draft-filsfils-spring-net-pgm-extension-srv6-usid] */
1220 #define SRV6_ENDPOINT_BEHAVIOR_END_DT2M_CSID 0x0044 /* End.DT2M with NEXT-CSID [draft-filsfils-spring-net-pgm-extension-srv6-usid] */
1221 #define SRV6_ENDPOINT_BEHAVIOR_END_M_GTP6D 0x0045 /* End.M.GTP6.D [RFC9433] */
1222 #define SRV6_ENDPOINT_BEHAVIOR_END_M_GTP6DI 0x0046 /* End.M.GTP6.Di [RFC9433] */
1223 #define SRV6_ENDPOINT_BEHAVIOR_END_M_GTP6E 0x0047 /* End.M.GTP6.E [RFC9433] */
1224 #define SRV6_ENDPOINT_BEHAVIOR_END_M_GTP4E 0x0048 /* End.M.GTP4.E [RFC9433] */
1225 #define SRV6_ENDPOINT_BEHAVIOR_END_M 0x004A /* End.M (Mirror SID) [draft-ietf-rtgwg-srv6-egress-protection-02] */
1226 #define SRV6_ENDPOINT_BEHAVIOR_END_REPLICATE 0x004B /* End.Replicate [RFC9524] */
1227 #define SRV6_ENDPOINT_BEHAVIOR_END_NSH 0x0054 /* End.NSH - NSH Segment [RFC9491] */
1228 #define SRV6_ENDPOINT_BEHAVIOR_END_DX1 0x009E /* End.DX1 [draft-ietf-pals-ple-02] */
1229 #define SRV6_ENDPOINT_BEHAVIOR_END_DX1_NEXT_CSID 0x009F /* End.DX1 with NEXT-CSID [draft-ietf-pals-ple-02] */
1230 #define SRV6_ENDPOINT_BEHAVIOR_END_DX1_REPL_CSID 0x00A0 /* End.DX1 with REPLACE-CSID [draft-ietf-pals-ple-02] */
1231 #define SRV6_ENDPOINT_BEHAVIOR_OPAQUE 0xFFFF /* Opaque [RFC8986] */
1233 static const value_string bgptypevals
[] = {
1234 { BGP_OPEN
, "OPEN Message" },
1235 { BGP_UPDATE
, "UPDATE Message" },
1236 { BGP_NOTIFICATION
, "NOTIFICATION Message" },
1237 { BGP_KEEPALIVE
, "KEEPALIVE Message" },
1238 { BGP_ROUTE_REFRESH
, "ROUTE-REFRESH Message" },
1239 { BGP_CAPABILITY
, "CAPABILITY Message" },
1240 { BGP_ROUTE_REFRESH_CISCO
, "Cisco ROUTE-REFRESH Message" },
1244 static const value_string evpnrtypevals
[] = {
1245 { EVPN_AD_ROUTE
, "Ethernet AD Route" },
1246 { EVPN_MAC_ROUTE
, "MAC Advertisement Route" },
1247 { EVPN_INC_MCAST_TREE
, "Inclusive Multicast Route" },
1248 { EVPN_ETH_SEGMENT_ROUTE
, "Ethernet Segment Route" },
1249 { EVPN_IP_PREFIX_ROUTE
, "IP Prefix route" },
1250 { EVPN_MC_ETHER_TAG_ROUTE
, "Selective Multicast Ethernet Tag Route" },
1251 { EVPN_IGMP_JOIN_ROUTE
, "IGMP Join Synch Route" },
1252 { EVPN_IGMP_LEAVE_ROUTE
, "IGMP Leave Synch Route" },
1253 { EVPN_PER_REG_I_PMSI_A_D_ROUTE
, "Per-Region I-PMSI A-D route" },
1254 { EVPN_S_PMSI_A_D_ROUTE
, "S-PMSI A-D Route" },
1255 { EVPN_LEAF_A_D_ROUTE
, "Leaf A-D route" },
1259 static const value_string evpn_nlri_esi_type
[] = {
1260 { BGP_NLRI_EVPN_ESI_VALUE
, "ESI 9 bytes value" },
1261 { BGP_NLRI_EVPN_ESI_LACP
, "ESI LACP 802.1AX defined" },
1262 { BGP_NLRI_EVPN_ESI_MSTP
, "ESI MSTP defined" },
1263 { BGP_NLRI_EVPN_ESI_MAC
, "ESI MAC address defined" },
1264 { BGP_NLRI_EVPN_ESI_RID
, "ESI Router ID" },
1265 { BGP_NLRI_EVPN_ESI_ASN
, "ESI Autonomous System" },
1266 { BGP_NLRI_EVPN_ESI_RES
, "ESI reserved" },
1270 #define BGP_MAJOR_ERROR_MSG_HDR 1
1271 #define BGP_MAJOR_ERROR_OPEN_MSG 2
1272 #define BGP_MAJOR_ERROR_UPDATE_MSG 3
1273 #define BGP_MAJOR_ERROR_HT_EXPIRED 4
1274 #define BGP_MAJOR_ERROR_STATE_MACHINE 5
1275 #define BGP_MAJOR_ERROR_CEASE 6
1276 #define BGP_MAJOR_ERROR_ROUTE_REFRESH 7
1277 #define BGP_MAJOR_ERROR_SH_T_EXPIRED 8
1279 static const value_string bgpnotify_major
[] = {
1280 { BGP_MAJOR_ERROR_MSG_HDR
, "Message Header Error" },
1281 { BGP_MAJOR_ERROR_OPEN_MSG
, "OPEN Message Error" },
1282 { BGP_MAJOR_ERROR_UPDATE_MSG
, "UPDATE Message Error" },
1283 { BGP_MAJOR_ERROR_HT_EXPIRED
, "Hold Timer Expired" },
1284 { BGP_MAJOR_ERROR_STATE_MACHINE
, "Finite State Machine Error" },
1285 { BGP_MAJOR_ERROR_CEASE
, "Cease" },
1286 { BGP_MAJOR_ERROR_ROUTE_REFRESH
, "ROUTE-REFRESH Message Error" }, /* RFC 7313 - Enhanced Route Refresh Capability for BGP-4 */
1287 { BGP_MAJOR_ERROR_SH_T_EXPIRED
, "Send Hold Timer Expired" },
1291 static const value_string bgpnotify_minor_msg_hdr
[] = {
1292 { 1, "Connection Not Synchronized" },
1293 { 2, "Bad Message Length" },
1294 { 3, "Bad Message Type" },
1298 static const value_string bgpnotify_minor_open_msg
[] = {
1299 { 1, "Unsupported Version Number" },
1300 { 2, "Bad Peer AS" },
1301 { 3, "Bad BGP Identifier" },
1302 { 4, "Unsupported Optional Parameter" },
1303 { 5, "Authentication Failure [Deprecated]" },
1304 { 6, "Unacceptable Hold Time" },
1305 { 7, "Unsupported Capability" },
1306 { 8, "No supported AFI/SAFI (Cisco)" },
1307 { 11, "Role Mismatch" },
1311 static const value_string bgpnotify_minor_update_msg
[] = {
1312 { 1, "Malformed Attribute List" },
1313 { 2, "Unrecognized Well-known Attribute" },
1314 { 3, "Missing Well-known Attribute" },
1315 { 4, "Attribute Flags Error" },
1316 { 5, "Attribute Length Error" },
1317 { 6, "Invalid ORIGIN Attribute" },
1318 { 7, "AS Routing Loop [Deprecated]" },
1319 { 8, "Invalid NEXT_HOP Attribute" },
1320 { 9, "Optional Attribute Error" },
1321 { 10, "Invalid Network Field" },
1322 { 11, "Malformed AS_PATH" },
1325 /* RFC6608 Subcodes for BGP Finite State Machine Error */
1326 static const value_string bgpnotify_minor_state_machine
[] = {
1327 { 1, "Receive Unexpected Message in OpenSent State" },
1328 { 2, "Receive Unexpected Message in OpenConfirm State" },
1329 { 3, "Receive Unexpected Message in Established State" },
1333 #define BGP_CEASE_MINOR_MAX_REACHED 1
1334 #define BGP_CEASE_MINOR_ADMIN_SHUTDOWN 2
1335 #define BGP_CEASE_MINOR_PEER_DE_CONF 3
1336 #define BGP_CEASE_MINOR_ADMIN_RESET 4
1337 #define BGP_CEASE_MINOR_CONN_RESET 5
1338 #define BGP_CEASE_MINOR_OTHER_CONF_CHANGE 6
1339 #define BGP_CEASE_MINOR_CONN_COLLISION 7
1340 #define BGP_CEASE_MINOR_OUT_RESOURCES 8
1341 #define BGP_CEASE_MINOR_HARD_RESET 9
1342 #define BGP_CEASE_MINOR_BFD_DOWN 10
1344 /* RFC4486 Subcodes for BGP Cease Notification Message */
1345 static const value_string bgpnotify_minor_cease
[] = {
1346 { BGP_CEASE_MINOR_MAX_REACHED
, "Maximum Number of Prefixes Reached"},
1347 { BGP_CEASE_MINOR_ADMIN_SHUTDOWN
, "Administratively Shutdown"},
1348 { BGP_CEASE_MINOR_PEER_DE_CONF
, "Peer De-configured"},
1349 { BGP_CEASE_MINOR_ADMIN_RESET
, "Administratively Reset"},
1350 { BGP_CEASE_MINOR_CONN_RESET
, "Connection Rejected"},
1351 { BGP_CEASE_MINOR_OTHER_CONF_CHANGE
, "Other Configuration Change"},
1352 { BGP_CEASE_MINOR_CONN_COLLISION
, "Connection Collision Resolution"},
1353 { BGP_CEASE_MINOR_OUT_RESOURCES
, "Out of Resources"},
1354 { BGP_CEASE_MINOR_HARD_RESET
, "Hard Reset"},
1355 { BGP_CEASE_MINOR_BFD_DOWN
, "BFD Down"},
1359 /* RFC7313 - Enhanced Route Refresh Capability for BGP-4 */
1360 static const value_string bgpnotify_minor_rr_msg
[] = {
1361 { 1, "Invalid Message Length" },
1365 static const value_string bgpattr_origin
[] = {
1368 { 2, "INCOMPLETE" },
1372 static const value_string bgp_open_opt_vals
[] = {
1373 { BGP_OPTION_AUTHENTICATION
, "Authentication" },
1374 { BGP_OPTION_CAPABILITY
, "Capability" },
1375 { BGP_OPTION_EXTENDED_LEN
, "Extended Length"},
1379 static const value_string as_segment_type
[] = {
1381 { 2, "AS_SEQUENCE" },
1382 /* RFC1965 has the wrong values, corrected in */
1383 /* draft-ietf-idr-bgp-confed-rfc1965bis-01.txt */
1384 { 4, "AS_CONFED_SET" },
1385 { 3, "AS_CONFED_SEQUENCE" },
1389 static const value_string bgpattr_type
[] = {
1390 { BGPTYPE_ORIGIN
, "ORIGIN" },
1391 { BGPTYPE_AS_PATH
, "AS_PATH" },
1392 { BGPTYPE_NEXT_HOP
, "NEXT_HOP" },
1393 { BGPTYPE_MULTI_EXIT_DISC
, "MULTI_EXIT_DISC" },
1394 { BGPTYPE_LOCAL_PREF
, "LOCAL_PREF" },
1395 { BGPTYPE_ATOMIC_AGGREGATE
, "ATOMIC_AGGREGATE" },
1396 { BGPTYPE_AGGREGATOR
, "AGGREGATOR" },
1397 { BGPTYPE_COMMUNITIES
, "COMMUNITIES" },
1398 { BGPTYPE_ORIGINATOR_ID
, "ORIGINATOR_ID" },
1399 { BGPTYPE_CLUSTER_LIST
, "CLUSTER_LIST" },
1400 { BGPTYPE_DPA
, "DPA" },
1401 { BGPTYPE_ADVERTISER
, "ADVERTISER" },
1402 { BGPTYPE_RCID_PATH
, "RCID_PATH / CLUSTER_ID" },
1403 { BGPTYPE_MP_REACH_NLRI
, "MP_REACH_NLRI" },
1404 { BGPTYPE_MP_UNREACH_NLRI
, "MP_UNREACH_NLRI" },
1405 { BGPTYPE_EXTENDED_COMMUNITY
, "EXTENDED_COMMUNITIES" },
1406 { BGPTYPE_AS4_PATH
, "AS4_PATH" },
1407 { BGPTYPE_AS4_AGGREGATOR
, "AS4_AGGREGATOR" },
1408 { BGPTYPE_SAFI_SPECIFIC_ATTR
, "SAFI_SPECIFIC_ATTRIBUTE" },
1409 { BGPTYPE_CONNECTOR_ATTRIBUTE
, "Connector Attribute" },
1410 { BGPTYPE_AS_PATHLIMIT
, "AS_PATHLIMIT "},
1411 { BGPTYPE_TUNNEL_ENCAPS_ATTR
, "TUNNEL_ENCAPSULATION_ATTRIBUTE" },
1412 { BGPTYPE_PMSI_TUNNEL_ATTR
, "PMSI_TUNNEL_ATTRIBUTE" },
1413 { BGPTYPE_TRAFFIC_ENGINEERING
, "Traffic Engineering" },
1414 { BGPTYPE_IPV6_ADDR_SPEC_EC
, "IPv6 Address Specific Extended Community" },
1415 { BGPTYPE_AIGP
, "AIGP" },
1416 { BGPTYPE_PE_DISTING_LABLES
, "PE Distinguisher Labels" },
1417 { BGPTYPE_BGP_ENTROPY_LABEL
, "BGP Entropy Label Capability Attribute" },
1418 { BGPTYPE_LINK_STATE_ATTR
, "BGP-LS Attribute" },
1419 { BGPTYPE_30
, "Deprecated" },
1420 { BGPTYPE_31
, "Deprecated" },
1421 { BGPTYPE_LARGE_COMMUNITY
, "LARGE_COMMUNITY" },
1422 { BGPTYPE_BGPSEC_PATH
, "BGPsec_PATH" },
1423 { BGPTYPE_OTC
, "OTC" },
1424 { BGPTYPE_D_PATH
, "D_PATH" },
1425 { BGPTYPE_SFP_ATTRIBUTE
, "SFP Attribute" },
1426 { BGPTYPE_BFD_DISCRIMINATOR
, "BFD Discriminator" },
1427 { BGPTYPE_NEXT_HOP_DEP_CAP
, "BGP Next Hop Dependent Capabilities" },
1428 { BGPTYPE_BGP_PREFIX_SID
, "BGP Prefix-SID" },
1429 { BGPTYPE_LINK_STATE_OLD_ATTR
, "LINK_STATE (unofficial code point)" },
1430 { BGPTYPE_ATTR_SET
, "ATTR_SET" },
1431 { BGPTYPE_129
, "Deprecated" },
1432 { BGPTYPE_241
, "Deprecated" },
1433 { BGPTYPE_242
, "Deprecated" },
1434 { BGPTYPE_243
, "Deprecated" },
1438 static const value_string pmsi_tunnel_type
[] = {
1439 { PMSI_TUNNEL_NOPRESENT
, "Type is not present" },
1440 { PMSI_TUNNEL_RSVPTE_P2MP
, "RSVP-TE P2MP LSP" },
1441 { PMSI_TUNNEL_MLDP_P2MP
, "mLDP P2MP LSP" },
1442 { PMSI_TUNNEL_PIMSSM
, "PIM SSM Tree" },
1443 { PMSI_TUNNEL_PIMSM
, "PIM SM Tree" },
1444 { PMSI_TUNNEL_BIDIR_PIM
, "BIDIR-PIM Tree" },
1445 { PMSI_TUNNEL_INGRESS
, "Ingress Replication" },
1446 { PMSI_TUNNEL_MLDP_MP2MP
, "mLDP MP2MP LSP" },
1447 { PMSI_TUNNEL_TRANPORT
, "Transport Tunnel" },
1448 { PMSI_TUNNEL_ASS_REPLIC
, "Assisted Replication Tunnel" },
1449 { PMSI_TUNNEL_BIER
, "BIER" },
1450 { PMSI_TUNNEL_SR_MPLS_P2MP
, "SR-MPLS P2MP Tree" },
1454 static const value_string aigp_tlv_type
[] = {
1455 { AIGP_TLV_TYPE
, "Type AIGP TLV" },
1459 static const value_string pmsi_mldp_fec_opaque_value_type
[] = {
1460 { PMSI_MLDP_FEC_TYPE_RSVD
, "Reserved" },
1461 { PMSI_MLDP_FEC_TYPE_GEN_LSP
, "Generic LSP Identifier" },
1462 { PMSI_MLDP_FEC_TYPE_TRANSIT_IPV4_SRC
, "Transit IPv4 Source" },
1463 { PMSI_MLDP_FEC_TYPE_TRANSIT_IPV6_SRC
, "Transit IPv6 Source" },
1464 { PMSI_MLDP_FEC_TYPE_TRANSIT_IPV4_BIDIR
, "Transit IPv4 Bidir" },
1465 { PMSI_MLDP_FEC_TYPE_TRANSIT_IPV6_BIDIR
, "Transit IPv6 Bidir" },
1466 { PMSI_MLDP_FEC_TYPE_RECURSE_OPAQUE_VALUE
, "Recursive Opaque Value" },
1467 { PMSI_MLDP_FEC_TYPE_VPN_RECURSE_OPAQUE_VALUE
, "VPN-Recursive Opaque Value" },
1468 { PMSI_MLDP_FEC_TYPE_TRANSIT_VPNV4_BIDIR
, "Transit VPNv4 Bidir" },
1469 { PMSI_MLDP_FEC_TYPE_TRANSIT_VPNV6_BIDIR
, "Transit VPNv6 Bidir" },
1470 { PMSI_MLDP_FEC_TYPE_TRANSIT_IPV4_SHARED_TREE
, "Transit IPv4 Shared Tree" },
1471 { PMSI_MLDP_FEC_TYPE_TRANSIT_IPV6_SHARED_TREE
, "Transit IPv6 Shared Tree" },
1472 { PMSI_MLDP_FEC_TYPE_L2VPN_MCAST
, "L2VPN-MCAST application" },
1473 { PMSI_MLDP_FEC_TYPE_TRANSIT_VPNV4_SRC
, "Transit VPNv4 Source" },
1474 { PMSI_MLDP_FEC_TYPE_TRANSIT_VPNV6_SRC
, "Transit VPNv6 Source" },
1475 { PMSI_MLDP_FEC_TYPE_EXT_TYPE
, "Extended Type field in the following two bytes" },
1479 static const value_string pmsi_mldp_fec_opa_extented_type
[] = {
1480 { PMSI_MLDP_FEC_ETYPE_RSVD
, "Reserved" },
1484 static const value_string bgp_attr_tunnel_type
[] = {
1485 { TUNNEL_TYPE_L2TP_OVER_IP
, "L2TPv2 over IP" },
1486 { TUNNEL_TYPE_GRE
, "GRE" },
1487 { TUNNEL_TYPE_TTE
, "Transmit tunnel endpoint" },
1488 { TUNNEL_TYPE_IPSEC_IN_TM
, "IPsec in Tunnel-mode" },
1489 { TUNNEL_TYPE_IP_IN_IP_IPSEC
, "IP in IP tunnel with IPsec Transport Mode" },
1490 { TUNNEL_TYPE_MPLS_IN_IP_IPSEC
, "MPLS-in-IP tunnel with IPsec Transport Mode" },
1491 { TUNNEL_TYPE_IP_IN_IP
, "IP in IP" },
1492 { TUNNEL_TYPE_VXLAN
, "VXLAN Encapsulation" },
1493 { TUNNEL_TYPE_NVGRE
, "NVGRE Encapsulation" },
1494 { TUNNEL_TYPE_MPLS
, "MPLS Encapsulation" },
1495 { TUNNEL_TYPE_MPLS_IN_GRE
, "MPLS in GRE Encapsulation" },
1496 { TUNNEL_TYPE_VXLAN_GPE
, "VXLAN GPE Encapsulation" },
1497 { TUNNEL_TYPE_MPLS_IN_UDP
, "MPLS in UDP Encapsulation" },
1498 { TUNNEL_TYPE_IPV6_TUNNEL
, "IPv6 Tunnel" },
1499 { TUNNEL_TYPE_SR_TE_POLICY
, "SR TE Policy Type" },
1500 { TUNNEL_TYPE_BARE
, "Bare" },
1501 { TUNNEL_TYPE_SR_TUNNEL
, "SR Tunnel" },
1502 { TUNNEL_TYPE_CLOUD_SECURITY
, "Cloud Security" },
1503 { TUNNEL_TYPE_GENEVE_ENCAP
, "Geneve Encapsulation" },
1504 { TUNNEL_TYPE_ANY_ENCAP
, "Any Encapsulation" },
1505 { TUNNEL_TYPE_GTP_TUNNEL_TYPE
, "GTP Tunnel Type" },
1506 { TUNNEL_TYPE_DPS_TUNNEL_ENCAP
, "Dynamic Path Selection Tunnel Encapsulation" },
1507 { TUNNEL_TYPE_ORIGINATING_PE
, "Originating PE" },
1508 { TUNNEL_TYPE_DPS_POLICY
, "Dynamic Path Selection Policy" },
1509 { TUNNEL_TYPE_SDWAN_HYBRID
, "SDWAN Hybrid" },
1510 { TUNNEL_TYPE_X_OVER_UDP
, "X-over-UDP" },
1511 { TUNNEL_TYPE_DES_TUNNEL_ENCAP
, "Distributed Ehterlink Switch Tunnel Encapsulation" },
1515 static const value_string subtlv_type
[] = {
1516 { TUNNEL_SUBTLV_ENCAPSULATION
, "Encapsulation" },
1517 { TUNNEL_SUBTLV_PROTO_TYPE
, "Protocol Type" },
1518 { TUNNEL_SUBTLV_IPSEC_TA
, "IPsec Tunnel Authenticator" },
1519 { TUNNEL_SUBTLV_COLOR
, "Color" },
1520 { TUNNEL_SUBTLV_LOAD_BALANCE
, "Load-Balancing Block" },
1521 { TUNNEL_SUBTLV_REMOTE_ENDPOINT
,"Tunnel Egress Endpoint" },
1522 { TUNNEL_SUBTLV_IPV4_DS_FIELD
, "IPv4 DS Field" },
1523 { TUNNEL_SUBTLV_UDP_DST_PORT
, "UDP Destination Port" },
1524 { TUNNEL_SUBTLV_EMBEDDED_LABEL
, "Embedded Label Handling" },
1525 { TUNNEL_SUBTLV_MPLS_LABEL
, "MPLS Label Stack" },
1526 { TUNNEL_SUBTLV_PREFIX_SID
, "Prefix SID" },
1527 { TUNNEL_SUBTLV_PREFERENCE
, "Preference" },
1528 { TUNNEL_SUBTLV_BINDING_SID
, "Binding SID" },
1529 { TUNNEL_SUBTLV_ENLP
, "ENLP" },
1530 { TUNNEL_SUBTLV_PRIORITY
, "Priority" },
1531 { TUNNEL_SUBTLV_SPI_SI_REP
, "SPI/SI Representation" },
1532 { TUNNEL_SUBTLV_SRV6_BINDING_SID
, "SRv6 Binding SID" },
1533 { TUNNEL_SUBTLV_IPSEC_SA_ID
, "IPSEC-SA-ID" },
1534 { TUNNEL_SUBTLV_EXT_PORT_PROP
, "Extended Port Property" },
1535 { TUNNEL_SUBTLV_UNDERLAY_ISP_PROP
, "Underlay ISP Properties" },
1536 { TUNNEL_SUBTLV_IPSEC_SA_NONCE
, "IPsec SA Nonce" },
1537 { TUNNEL_SUBTLV_IPSEC_PUBLIC_KEY
, "IPsec Public Key" },
1538 { TUNNEL_SUBTLV_IPSEC_SA_PROPOSAL
, "IPsec SA Proposal" },
1539 { TUNNEL_SUBTLV_SIMPL_IPSEC_SA
, "Simplified IPsec SA" },
1540 { TUNNEL_SUBTLV_NRP
, "NRP" },
1541 { TUNNEL_SUBTLV_RPF
, "RPF" },
1542 { TUNNEL_SUBTLV_TREE_LABEL_STACK
, "Tree Label Stack" },
1543 { TUNNEL_SUBTLV_SEGMENT_LIST
, "Segment List" },
1544 { TUNNEL_SUBTLV_POLICY_CP_NAME
, "Policy CP Name" },
1545 { TUNNEL_SUBTLV_POLICY_NAME
, "Policy Name" },
1546 { TUNNEL_SUBTLV_WAN_ID
, "The WAN ID" },
1547 { TUNNEL_SUBTLV_BYTES
, "The Bytes" },
1548 { TUNNEL_SUBTLV_IPSEC_DIM
, "IPSEC DIM" },
1549 { TUNNEL_SUBTLV_IPSEC_KEY_EXCH
, "IPSEC Key Exchange" },
1550 { TUNNEL_SUBTLV_IPSEC_SA_PROPS
, "IPSEC SA Proposals" },
1551 { TUNNEL_SUBTLV_SRV_SEGMENT_LIST
, "Service Segment List" },
1552 { TUNNEL_SUBTLV_SRV_VTEP
, "Service Vtep" },
1553 { TUNNEL_SUBTLV_DES_ADJACENCY
, "Distributed Etherlink Switch (DES) Adjacency" },
1557 static const value_string bgp_enlp_type
[] = {
1559 { 1 , "Push IPv4, do not push IPv6" },
1560 { 2 , "Push IPv6, do not push IPv4" },
1561 { 3 , "Push IPv4, push IPv6" },
1562 { 4 , "Do not push" },
1566 static const value_string bgp_sr_policy_list_type
[] = {
1567 { TUNNEL_SUBTLV_SEGMENT_LIST_SUB_TYPE_A
, "Type A MPLS SID sub-TLV" },
1568 { TUNNEL_SUBTLV_SEGMENT_LIST_SUB_TYPE_B
, "Type B SRv6 SID sub-TLV" },
1569 { TUNNEL_SUBTLV_SEGMENT_LIST_SUB_TYPE_C
, "Type C IPv4 Node and SID sub-TLV" },
1570 { TUNNEL_SUBTLV_SEGMENT_LIST_SUB_TYPE_D
, "Type D IPv6 Node and SID for SR-MPLS sub-TLV" },
1571 { TUNNEL_SUBTLV_SEGMENT_LIST_SUB_TYPE_E
, "Type E IPv4 Node, index and SID sub-TLV" },
1572 { TUNNEL_SUBTLV_SEGMENT_LIST_SUB_TYPE_F
, "Type F IPv4 Local/Remote addresses and SID sub-TLV" },
1573 { TUNNEL_SUBTLV_SEGMENT_LIST_SUB_TYPE_G
, "Type G IPv6 Node, index for remote and local pair and SID for SR-MPLS sub-TLV" },
1574 { TUNNEL_SUBTLV_SEGMENT_LIST_SUB_TYPE_H
, "Type H IPv6 Local/Remote addresses and SID sub-TLV" },
1575 { TUNNEL_SUBTLV_SEGMENT_LIST_SUB_TYPE_WEIGHT
, "Weight sub-TLV" },
1576 { TUNNEL_SUBTLV_SEGMENT_LIST_SUB_TYPE_I
, "Type I IPv6 Node and SID for SRv6 sub-TLV" },
1577 { TUNNEL_SUBTLV_SEGMENT_LIST_SUB_TYPE_J
, "Type J IPv6 Node, index for remote and local pair and SID for SRv6 sub-TLV" },
1578 { TUNNEL_SUBTLV_SEGMENT_LIST_SUB_TYPE_K
, "Type K IPv6 Local/Remote addresses and SID for SRv6 sub-TLV" },
1582 static const true_false_string tfs_bgpext_com_type_auth
= {
1583 "Allocated on Standard Action, Early Allocation or Experimental Basis",
1584 "Allocated on First Come First Serve Basis"
1587 static const value_string bgpext_com_type_high
[] = {
1588 { BGP_EXT_COM_TYPE_HIGH_TR_AS2
, "Transitive 2-Octet AS-Specific" },
1589 { BGP_EXT_COM_TYPE_HIGH_TR_IP4
, "Transitive IPv4-Address-Specific" },
1590 { BGP_EXT_COM_TYPE_HIGH_TR_AS4
, "Transitive 4-Octet AS-Specific" },
1591 { BGP_EXT_COM_TYPE_HIGH_TR_OPAQUE
, "Transitive Opaque" },
1592 { BGP_EXT_COM_TYPE_HIGH_TR_QOS
, "Transitive QoS Marking" },
1593 { BGP_EXT_COM_TYPE_HIGH_TR_COS
, "Transitive CoS Capability" },
1594 { BGP_EXT_COM_TYPE_HIGH_TR_EVPN
, "Transitive EVPN" },
1595 { BGP_EXT_COM_TYPE_HIGH_TR_FLOW_I
, "FlowSpec Transitive" },
1596 { BGP_EXT_COM_TYPE_HIGH_TR_FLOW
, "Transitive Flow spec redirect/mirror to IP next-hop" },
1597 { BGP_EXT_COM_TYPE_HIGH_TR_FLOW_R
, "Transitive FlowSpec Redirect to indirection-id" },
1598 { BGP_EXT_COM_TYPE_HIGH_TR_TP_CLASS
, "Transitive Transport Class" },
1599 { BGP_EXT_COM_TYPE_HIGH_TR_SFC
, "Transitive SFC" },
1600 { BGP_EXT_COM_TYPE_HIGH_TR_MUP
, "Transitive MUP" },
1601 { BGP_EXT_COM_TYPE_HIGH_TR_EXT
, "Generic Transitive Extended Community"},
1602 { BGP_EXT_COM_TYPE_HIGH_TR_EXT_2
, "Generic Transitive Extended Community Part 2"},
1603 { BGP_EXT_COM_TYPE_HIGH_TR_EXT_3
, "Generic Transitive Extended Community Part 3 "},
1604 { BGP_EXT_COM_TYPE_HIGH_TR_EXP_EIGRP
, "Transitive Experimental EIGRP" },
1605 { BGP_EXT_COM_TYPE_HIGH_NTR_AS2
, "Non-Transitive 2-Octet AS-Specific" },
1606 { BGP_EXT_COM_TYPE_HIGH_NTR_IP4
, "Non-Transitive IPv4-Address-Specific" },
1607 { BGP_EXT_COM_TYPE_HIGH_NTR_AS4
, "Non-Transitive 4-Octet AS-Specific" },
1608 { BGP_EXT_COM_TYPE_HIGH_NTR_OPAQUE
, "Non-Transitive Opaque" },
1609 { BGP_EXT_COM_TYPE_HIGH_NTR_QOS
, "Non-Transitive QoS Marking" },
1610 { BGP_EXT_COM_TYPE_HIGH_NTR_FLOWSPEC
, "FlowSpec Non-Transitive Extended Communities" },
1611 { BGP_EXT_COM_TYPE_HIGH_NTR_TRANSPORT
, "Non-Transitive Transport Class" },
1615 static const value_string bgpext_com_stype_tr_exp_2
[] = {
1616 { BGP_EXT_COM_STYPE_EXP_2_FLOW_RED
, "Flow spec redirect IPv4 format"},
1620 static const value_string bgpext_com_stype_tr_exp_3
[] = {
1621 { BGP_EXT_COM_STYPE_EXP_3_SEC_GROUP
, "Security Group AS4"},
1622 { BGP_EXT_COM_STYPE_EXP_3_FLOW_RED
, "Flow spec redirect AS-4byte format"},
1623 { BGP_EXT_COM_STYPE_EXP_3_TAG4
, "Tag4"},
1624 { BGP_EXT_COM_STYPE_EXP_3_SUB_CLUS
, "Origin Sub-Cluster4"},
1628 static const value_string bgpext_com_stype_tr_evpn
[] = {
1629 { BGP_EXT_COM_STYPE_EVPN_MMAC
, "MAC Mobility" },
1630 { BGP_EXT_COM_STYPE_EVPN_LABEL
, "ESI MPLS Label" },
1631 { BGP_EXT_COM_STYPE_EVPN_IMP
, "ES Import" },
1632 { BGP_EXT_COM_STYPE_EVPN_ROUTERMAC
, "EVPN Router's MAC" },
1633 { BGP_EXT_COM_STYPE_EVPN_L2ATTR
, "Layer 2 Attributes" },
1634 { BGP_EXT_COM_STYPE_EVPN_ETREE
, "E-Tree" },
1635 { BGP_EXT_COM_STYPE_EVPN_DF
, "DF Election" },
1636 { BGP_EXT_COM_STYPE_EVPN_ISID
, "I-SID" },
1637 { BGP_EXT_COM_STYPE_EVPN_ND
, "ND" },
1638 { BGP_EXT_COM_STYPE_EVPN_MCFLAGS
, "Multicast Flags Extended Community" },
1639 { BGP_EXT_COM_STYPE_EVPN_EVIRT0
, "EVI-RT Type 0 Extended Community" },
1640 { BGP_EXT_COM_STYPE_EVPN_EVIRT1
, "EVI-RT Type 1 Extended Community" },
1641 { BGP_EXT_COM_STYPE_EVPN_EVIRT2
, "EVI-RT Type 2 Extended Community" },
1642 { BGP_EXT_COM_STYPE_EVPN_EVIRT3
, "EVI-RT Type 3 Extended Community" },
1643 { BGP_EXT_COM_STYPE_EVPN_ATTACHCIRT
, "EVPN Attachment Circuit" },
1644 { BGP_EXT_COM_STYPE_EVPN_SVC_CARV_TS
, "Service Carving Timestamp" },
1645 { BGP_EXT_COM_STYPE_EVPN_LINK_BW
, "EVPN Link Bandwidth Extended Community" },
1646 { BGP_EXT_COM_STYPE_EVPN_RT_EC
, "RT-derived-EC" },
1650 static const value_string bgpext_com_stype_tr_as2
[] = {
1651 { BGP_EXT_COM_STYPE_AS2_RT
, "Route Target" },
1652 { BGP_EXT_COM_STYPE_AS2_RO
, "Route Origin" },
1653 { BGP_EXT_COM_STYPE_AS2_LBW
, "Link Bandwidth" },
1654 { BGP_EXT_COM_STYPE_AS2_OSPF_DID
, "OSPF Domain Identifier" },
1655 { BGP_EXT_COM_STYPE_AS2_RT_AGG_P
, "Route Aggregation Parameter" },
1656 { BGP_EXT_COM_STYPE_AS2_DCOLL
, "BGP Data Collection" },
1657 { BGP_EXT_COM_STYPE_AS2_SRC_AS
, "Source AS" },
1658 { BGP_EXT_COM_STYPE_AS2_L2VPN
, "L2VPN Identifier" },
1659 { BGP_EXT_COM_STYPE_AS2_CVPND
, "Cisco VPN-Distinguisher" },
1660 { BGP_EXT_COM_STYPE_AS2_RT_REC
, "Route Target Record" },
1661 { BGP_EXT_COM_STYPE_AS2_RT_EC
, "RT-derived-EC" },
1662 { BGP_EXT_COM_STYPE_AS2_VNI
, "Virtual-Network Identifier" },
1666 static const value_string bgpext_com_stype_ntr_as2
[] = {
1667 { BGP_EXT_COM_STYPE_AS2_LBW
, "Link Bandwidth" },
1668 { BGP_EXT_COM_STYPE_AS2_VNI
, "Virtual-Network Identifier" },
1672 static const value_string bgpext_com_stype_tr_as4
[] = {
1673 { BGP_EXT_COM_STYPE_AS4_RT
, "Route Target" },
1674 { BGP_EXT_COM_STYPE_AS4_RO
, "Route Origin" },
1675 { BGP_EXT_COM_STYPE_AS4_GEN
, "Generic" },
1676 { BGP_EXT_COM_STYPE_AS4_BGP_DC
, "BGP Data Collection"},
1677 { BGP_EXT_COM_STYPE_AS4_OSPF_DID
, "OSPF Domain Identifier" },
1678 { BGP_EXT_COM_STYPE_AS4_S_AS
, "Source AS" },
1679 { BGP_EXT_COM_STYPE_AS4_CIS_V
, "Cisco VPN Identifier" },
1680 { BGP_EXT_COM_STYPE_AS4_RT_REC
, "Route-Target Record"},
1681 { BGP_EXT_COM_STYPE_AS4_RT_EC
, "RT-derived-EC" },
1685 static const value_string bgpext_com_stype_ntr_as4
[] = {
1686 { BGP_EXT_COM_STYPE_AS4_GEN
, "Generic" },
1690 static const value_string bgpext_com_stype_tr_IP4
[] = {
1691 { BGP_EXT_COM_STYPE_IP4_RT
, "Route Target" },
1692 { BGP_EXT_COM_STYPE_IP4_RO
, "Route Origin" },
1693 { BGP_EXT_COM_STYPE_IP4_IFIT_TAIL
,"IPv4-Address-Specific IFIT Tail Community" },
1694 { BGP_EXT_COM_STYPE_IP4_OSPF_DID
, "OSPF Domain Identifier" },
1695 { BGP_EXT_COM_STYPE_IP4_OSPF_RID
, "OSPF Router ID" },
1696 { BGP_EXT_COM_STYPE_IP4_NODE_TGT
, "Node Target Extended Community" },
1697 { BGP_EXT_COM_STYPE_IP4_L2VPN
, "L2VPN Identifier" },
1698 { BGP_EXT_COM_STYPE_IP4_VRF_I
, "VRF Route Import" },
1699 { BGP_EXT_COM_STYPE_IP4_FLOW_RDR
, "Flow-spec Redirect to IPv4" },
1700 { BGP_EXT_COM_STYPE_IP4_CIS_D
, "Cisco VPN-Distinguisher" },
1701 { BGP_EXT_COM_STYPE_IP4_SEG_NH
, "Inter-area P2MP Segmented Next-Hop" },
1702 { BGP_EXT_COM_STYPE_IP4_RT_REC
, "Route-Target Record" },
1703 { BGP_EXT_COM_STYPE_IP4_VRF_RNH
, "VRF-Recursive-Next-Hop-Extended-Community" },
1704 { BGP_EXT_COM_STYPE_IP4_RT_EC
, "RT-derived-EC" },
1705 { BGP_EXT_COM_STYPE_IP4_MVPN_RP
, "MVPN SA RP-address Extended Community" },
1709 static const value_string bgpext_com_stype_ntr_IP4
[] = {
1710 { BGP_EXT_COM_STYPE_IP4_NODE_TGT
, "Node Target Extended Community" },
1714 static const value_string bgpext_com_stype_tr_opaque
[] = {
1715 { BGP_EXT_COM_STYPE_OPA_COST
, "Cost" },
1716 { BGP_EXT_COM_STYPE_OPA_CP_OSPF
, "CP-ORF" },
1717 { BGP_EXT_COM_STYPE_OPA_EXTN_SRC
, "Extranet Source Extended Community" },
1718 { BGP_EXT_COM_STYPE_OPA_EXTN_SEP
, "Extranet Separation Extended Community" },
1719 { BGP_EXT_COM_STYPE_OPA_OSPF_RT
, "OSPF Route Type" },
1720 { BGP_EXT_COM_STYPE_OPA_PMSI_ATTR
, "Additional PMSI Tunnel Attribute Flags" },
1721 { BGP_EXT_COM_STYPE_OPA_CTX_LBL
, "Context-Specific Label Space ID Extended Community" },
1722 { BGP_EXT_COM_STYPE_OPA_COLOR
, "Color" },
1723 { BGP_EXT_COM_STYPE_OPA_ENCAP
, "Encapsulation" },
1724 { BGP_EXT_COM_STYPE_OPA_DGTW
, "Default Gateway" },
1725 { BGP_EXT_COM_STYPE_OPA_PPMP_LBL
, "Point-to-Point-to-Multipoint (PPMP) Label" },
1726 { BGP_EXT_COM_STYPE_OPA_GRP_TAG
, "BGP Group Policy Class Tag Extended Community" },
1727 { BGP_EXT_COM_STYPE_OPA_HSH_SRT
, "Consistent Hash Sort Order" },
1728 { BGP_EXT_COM_STYPE_OPA_GRP_PID
, "Group Policy ID Extended Community" },
1729 { BGP_EXT_COM_STYPE_OPA_LCM
, "Local Color Mapping (LCM)" },
1730 { BGP_EXT_COM_STYPE_OPA_LOADBAL
, "LoadBalance" },
1734 static const value_string bgpext_com_cost_poi_type
[] = {
1735 { BGP_EXT_COM_COST_POI_ORIGIN
, "\"Lowest Origin code\" step" },
1736 { BGP_EXT_COM_COST_POI_ASPATH
, "\"Shortest AS_PATH\" step" },
1737 { BGP_EXT_COM_COST_POI_MED
, "\"Lowest MED\" step" },
1738 { BGP_EXT_COM_COST_POI_LP
, "\"Highest Local Preference\" step" },
1739 { BGP_EXT_COM_COST_POI_AIGP
, "\"Lowest Accumulated IGP Cost\" step" },
1740 { BGP_EXT_COM_COST_POI_ABS
, "Before BGP Best Path algorithm" },
1741 { BGP_EXT_COM_COST_POI_IGP
, "\"Smallest IGP Metric\" step" },
1742 { BGP_EXT_COM_COST_POI_EI
, "\"Prefer eBGP to iBGP\" step" },
1743 { BGP_EXT_COM_COST_POI_RID
, "\"Smallest BGP RID\" step" },
1747 static const value_string bgpext_com_tunnel_type
[] = {
1748 { BGP_EXT_COM_TUNNEL_RESERVED
, "Reserved" },
1749 { BGP_EXT_COM_TUNNEL_L2TPV3
, "L2TPv3 over IP" },
1750 { BGP_EXT_COM_TUNNEL_GRE
, "GRE" },
1751 { BGP_EXT_COM_TUNNEL_ENDP
, "Transmit tunnel endpoint" },
1752 { BGP_EXT_COM_TUNNEL_IPSEC
, "IPsec in Tunnel-mode" },
1753 { BGP_EXT_COM_TUNNEL_IPIPSEC
, "IP in IP tunnel with IPsec Transport Mode" },
1754 { BGP_EXT_COM_TUNNEL_MPLSIP
, "MPLS-in-IP tunnel with IPsec Transport Mode" },
1755 { BGP_EXT_COM_TUNNEL_IPIP
, "IP in IP" },
1756 { BGP_EXT_COM_TUNNEL_VXLAN
, "VXLAN Encapsulation" },
1757 { BGP_EXT_COM_TUNNEL_NVGRE
, "NVGRE Encapsulation" },
1758 { BGP_EXT_COM_TUNNEL_MPLS
, "MPLS Encapsulation" },
1759 { BGP_EXT_COM_TUNNEL_MPLSGRE
, "MPLS in GRE Encapsulation" },
1760 { BGP_EXT_COM_TUNNEL_VXLANGPE
, "VxLAN GPE Encapsulation" },
1761 { BGP_EXT_COM_TUNNEL_MPLSUDP
, "MPLS in UDP Encapsulation" },
1762 { BGP_EXT_COM_TUNNEL_IPV6_TUNNEL
, "IPv6 Tunnel" },
1763 { BGP_EXT_COM_TUNNEL_SE_TE_POLICY
, "SR TE Policy Type" },
1764 { BGP_EXT_COM_TUNNEL_BARE
, "Bare" },
1765 { BGP_EXT_COM_TUNNEL_SR_TUNNEL
, "SR Tunnel" },
1766 { BGP_EXT_COM_TUNNEL_CLOUD_SEC
, "Cloud Security" },
1767 { BGP_EXT_COM_TUNNEL_GENEVE_ENCAP
, "Geneve Encapsulation" },
1768 { BGP_EXT_COM_TUNNEL_ANY_ENCAP
, "Any Encapsulation" },
1769 { BGP_EXT_COM_TUNNEL_GTP_TUNNEL
, "GTP Tunnel Type" },
1770 { BGP_EXT_COM_TUNNEL_DPS_TUNNEL
, "Dynamic Path Selection (DPS) Tunnel Encapsulation" },
1771 { BGP_EXT_COM_TUNNEL_OPE
, "Originating PE (OPE)" },
1772 { BGP_EXT_COM_TUNNEL_DYN_DPS_POL
, "Dynamic Path Selection (DPS) Policy" },
1773 { BGP_EXT_COM_TUNNEL_SDWAN_HYB
, "SDWAN-Hybrid" },
1774 { BGP_EXT_COM_TUNNEL_X_OVER_UDP
, "X-over-UDP" },
1775 { BGP_EXT_COM_TUNNEL_DES_ENCAP
, "Distributed Etherlink Switch (DES) Tunnel Encapsulation" },
1779 static const value_string bgpext_com_stype_ntr_opaque
[] = {
1780 { BGP_EXT_COM_STYPE_OPA_OR_VAL_ST
, "BGP Origin Validation state" },
1781 { BGP_EXT_COM_STYPE_OPA_COST
, "Cost Community" },
1782 { BGP_EXT_COM_STYPE_OPA_RT
, "Route Target" },
1783 { BGP_EXT_COM_STYPE_OPA_RT_EC
, "RT-derived-EC" },
1787 static const value_string bgpext_com_stype_tr_exp
[] = {
1788 { BGP_EXT_COM_STYPE_EXP_OSPF_RT
, "OSPF Route Type" },
1789 { BGP_EXT_COM_STYPE_EXP_OSPF_RID
, "OSPF Router ID" },
1790 { BGP_EXT_COM_STYPE_EXP_SEC_GROUP
, "Security Group" },
1791 { BGP_EXT_COM_STYPE_EXP_OSPF_DID
, "OSPF Domain Identifier" },
1792 { BGP_EXT_COM_STYPE_EXP_F_TR
, "Flow spec traffic-rate" },
1793 { BGP_EXT_COM_STYPE_EXP_F_TA
, "Flow spec traffic-action" },
1794 { BGP_EXT_COM_STYPE_EXP_F_RED
, "Flow spec redirect AS 2 bytes" },
1795 { BGP_EXT_COM_STYPE_EXP_F_RMARK
, "Flow spec traffic-remarking" },
1796 { BGP_EXT_COM_STYPE_EXP_L2
, "Layer2 Info" },
1797 { BGP_EXT_COM_STYPE_EXP_ETREE
, "E-Tree Info" },
1798 { BGP_EXT_COM_STYPE_EXP_FLOW_RATE
, "Flow spec traffic-rate-packets" },
1799 { BGP_EXT_COM_STYPE_EXP_FLOW_SFC
, "Flow Specification for SFC Classifiers" },
1800 { BGP_EXT_COM_STYPE_EXP_TAG
, "Tag" },
1801 { BGP_EXT_COM_STYPE_EXP_SUB_CLUS
, "Origin Sub-Cluster" },
1805 static const value_string bgpext_com_stype_tr_eigrp
[] = {
1806 { BGP_EXT_COM_STYPE_EXP_EIGRP_FT
, "EIGRP Route Flags, Route Tag" },
1807 { BGP_EXT_COM_STYPE_EXP_EIGRP_AD
, "EIGRP AS Number, Delay" },
1808 { BGP_EXT_COM_STYPE_EXP_EIGRP_RHB
, "EIGRP Reliability, Hop Count, Bandwidth" },
1809 { BGP_EXT_COM_STYPE_EXP_EIGRP_LM
, "EIGRP Load, MTU" },
1810 { BGP_EXT_COM_STYPE_EXP_EIGRP_EAR
, "EIGRP External AS Number, Router ID" },
1811 { BGP_EXT_COM_STYPE_EXP_EIGRP_EPM
, "EIGRP External Protocol, Metric" },
1812 { BGP_EXT_COM_STYPE_EXP_EIGRP_RID
, "EIGRP Originating Router ID" },
1816 static const value_string bgpext_com_stype_tr_mup
[] = {
1817 { BGP_EXT_COM_STYPE_MUP_DIRECT_SEG
, "MUP Direct-Type Segment Identifier"},
1821 static const value_string flow_spec_op_len_val
[] = {
1822 { 0, "1 byte: 1 <<" },
1823 { 1, "2 bytes: 1 <<" },
1824 { 2, "4 bytes: 1 <<" },
1825 { 3, "8 bytes: 1 <<" },
1829 static const value_string qos_tech_type
[] = {
1830 { QOS_TECH_TYPE_DSCP
, "DiffServ enabled IP (DSCP encoding)" },
1831 { QOS_TECH_TYPE_802_1q
, "Ethernet using 802.1q priority tag" },
1832 { QOS_TECH_TYPE_E_LSP
, "MPLS using E-LSP" },
1833 { QOS_TECH_TYPE_VC
, "Virtual Channel (VC) encoding" },
1834 { QOS_TECH_TYPE_GMPLS_TIME
, "GMPLS - time slot encoding" },
1835 { QOS_TECH_TYPE_GMPLS_LAMBDA
, "GMPLS - lambda encoding" },
1836 { QOS_TECH_TYPE_GMPLS_FIBRE
, "GMPLS - fibre encoding" },
1840 static const value_string bgp_ssa_type
[] = {
1841 { BGP_SSA_L2TPv3
, "L2TPv3 Tunnel" },
1842 { BGP_SSA_mGRE
, "mGRE Tunnel" },
1843 { BGP_SSA_IPSec
, "IPSec Tunnel" },
1844 { BGP_SSA_MPLS
, "MPLS Tunnel" },
1845 { BGP_SSA_L2TPv3_IN_IPSec
, "L2TPv3 in IPSec Tunnel" },
1846 { BGP_SSA_mGRE_IN_IPSec
, "mGRE in IPSec Tunnel" },
1851 * BGP Layer 2 Encapsulation Types
1855 * http://www.iana.org/assignments/bgp-parameters/bgp-parameters.xhtml#bgp-l2-encapsulation-types-registry
1857 static const value_string bgp_l2vpn_encaps
[] = {
1859 { 1, "Frame Relay"},
1860 { 2, "ATM AAL5 SDU VCC transport"},
1861 { 3, "ATM transparent cell transport"},
1862 { 4, "Ethernet (VLAN) Tagged mode"},
1863 { 5, "Ethernet raw mode"},
1866 { 8, "SONET/SDH CES"},
1867 { 9, "ATM n-to-one VCC cell transport"},
1868 { 10, "ATM n-to-one VPC cell transport"},
1869 { 11, "IP layer 2 transport"},
1870 { 15, "Frame relay port mode"},
1871 { 17, "Structure agnostic E1 over packet"},
1872 { 18, "Structure agnostic T1 over packet"},
1874 { 20, "Structure agnostic T3 over packet"},
1875 { 21, "Nx64kbit/s Basic Service using Structure-aware"},
1876 { 25, "Frame Relay DLCI"},
1877 { 40, "Structure agnostic E3 over packet"},
1878 { 41, "Octet-aligned playload for structure-agnostic DS1 circuits"},
1879 { 42, "E1 Nx64kbit/s with CAS using Structure-aware"},
1880 { 43, "DS1 (ESF) Nx64kbit/s with CAS using Structure-aware"},
1881 { 44, "DS1 (SF) Nx64kbit/s with CAS using Structure-aware"},
1882 { 64, "IP-interworking"},
1886 static const value_string bgpext_com_ospf_rtype
[] = {
1887 { BGP_OSPF_RTYPE_RTR
, "Router" },
1888 { BGP_OSPF_RTYPE_NET
, "Network" },
1889 { BGP_OSPF_RTYPE_SUM
, "Summary" },
1890 { BGP_OSPF_RTYPE_EXT
, "External" },
1891 { BGP_OSPF_RTYPE_NSSA
,"NSSA External" },
1892 { BGP_OSPF_RTYPE_SHAM
,"MPLS-VPN Sham" },
1896 /* Subsequent address family identifier, RFC4760 */
1897 static const value_string bgpattr_nlri_safi
[] = {
1899 { SAFNUM_UNICAST
, "Unicast" },
1900 { SAFNUM_MULCAST
, "Multicast" },
1901 { SAFNUM_UNIMULC
, "Unicast+Multicast (Deprecated)" },
1902 { SAFNUM_MPLS_LABEL
, "Labeled Unicast" },
1903 { SAFNUM_MCAST_VPN
, "MCAST-VPN" },
1904 { SAFNUM_MULTISEG_PW
, "Multi-Segment Pseudowires" },
1905 { SAFNUM_ENCAPSULATION
, "Encapsulation (Deprecated)" },
1906 { SAFNUM_MCAST_VPLS
, "MCAST-VPLS" },
1907 { SAFNUM_TUNNEL
, "Tunnel (Deprecated)" },
1908 { SAFNUM_VPLS
, "VPLS" },
1909 { SAFNUM_MDT
, "Cisco MDT" },
1910 { SAFNUM_4OVER6
, "4over6" },
1911 { SAFNUM_6OVER4
, "6over4" },
1912 { SAFNUM_L1VPN
, "Layer-1 VPN" },
1913 { SAFNUM_EVPN
, "EVPN" },
1914 { SAFNUM_BGP_LS
, "BGP-LS" },
1915 { SAFNUM_BGP_LS_VPN
, "BGP-LS-VPN" },
1916 { SAFNUM_SR_POLICY
, "SR Policy" },
1917 { SAFNUM_SD_WAN
, "SD-WAN" },
1918 { SAFNUM_RPD
, "Routing Policy Distribution" },
1919 { SAFNUM_CT
, "Classful Transport Planes" },
1920 { SAFNUM_FLOWSPEC
, "Tunneled Traffic Flowspec" },
1921 { SAFNUM_MCAST_TREE
, "MCAST-TREE" },
1922 { SAFNUM_BGP_DPS
, "Dynamic Path Selection" },
1923 { SAFNUM_BGP_LS_SPF
, "BGP-LS-SPF" },
1924 { SAFNUM_BGP_CAR
, "BGP-CAR" },
1925 { SAFNUM_BGP_VPN_CAR
, "BGP-VPN-CAR" },
1926 { SAFNUM_BGP_MUP
, "BGP-MUP" },
1927 { SAFNUM_LAB_VPNUNICAST
, "Labeled VPN Unicast" },
1928 { SAFNUM_LAB_VPNMULCAST
, "Labeled VPN Multicast" },
1929 { SAFNUM_LAB_VPNUNIMULC
, "Labeled VPN Unicast+Multicast (Deprecated)" },
1930 { SAFNUM_ROUTE_TARGET
, "Route Target Filter" },
1931 { SAFNUM_FSPEC_RULE
, "Flow Spec Filter" },
1932 { SAFNUM_FSPEC_VPN_RULE
, "Flow Spec Filter VPN" },
1933 { SAFNUM_L3VPN
, "Layer-3 VPN (Deprecated)" },
1937 /* ORF Type, RFC5291 */
1938 static const value_string orf_type_vals
[] = {
1939 { 2, "Communities ORF-Type" },
1940 { 3, "Extended Communities ORF-Type" },
1941 { 128, "Cisco PrefixList ORF-Type" },
1942 { 129, "Cisco CommunityList ORF-Type" },
1943 { 130, "Cisco Extended CommunityList ORF-Type" },
1944 { 131, "Cisco AsPathList ORF-Type" },
1948 /* ORF Send/Receive, RFC5291 */
1949 static const value_string orf_send_recv_vals
[] = {
1956 /* ORF Send/Receive, RFC5291 */
1957 static const value_string orf_when_vals
[] = {
1963 static const value_string orf_entry_action_vals
[] = {
1964 { BGP_ORF_ADD
, "Add" },
1965 { BGP_ORF_REMOVE
, "Remove" },
1966 { BGP_ORF_REMOVEALL
, "RemoveAll" },
1970 static const value_string orf_entry_match_vals
[] = {
1971 { BGP_ORF_PERMIT
, "Permit" },
1972 { BGP_ORF_DENY
, "Deny" },
1976 /* BGPsec Send/Receive, RFC8205 */
1977 static const value_string bgpsec_send_receive_vals
[] = {
1983 /* BGP Role, RFC9234 */
1984 static const value_string bgprole_vals
[] = {
1993 static const value_string capability_vals
[] = {
1994 { BGP_CAPABILITY_RESERVED
, "Reserved capability" },
1995 { BGP_CAPABILITY_MULTIPROTOCOL
, "Multiprotocol extensions capability" },
1996 { BGP_CAPABILITY_ROUTE_REFRESH
, "Route refresh capability" },
1997 { BGP_CAPABILITY_COOPERATIVE_ROUTE_FILTERING
, "Cooperative route filtering capability" },
1998 { BGP_CAPABILITY_MULTIPLE_ROUTE_DEST
, "Multiple routes to a destination capability" },
1999 { BGP_CAPABILITY_EXTENDED_NEXT_HOP
, "Extended Next Hop Encoding" },
2000 { BGP_CAPABILITY_EXTENDED_MESSAGE
, "BGP-Extended Message" },
2001 { BGP_CAPABILITY_BGPSEC
, "BGPsec capability" },
2002 { BGP_CAPABILITY_MULTIPLE_LABELS
, "Multiple Labels capability" },
2003 { BGP_CAPABILITY_BGP_ROLE
, "BGP Role" },
2004 { BGP_CAPABILITY_GRACEFUL_RESTART
, "Graceful Restart capability" },
2005 { BGP_CAPABILITY_4_OCTET_AS_NUMBER
, "Support for 4-octet AS number capability" },
2006 { BGP_CAPABILITY_DYNAMIC_CAPABILITY_CISCO
, "Deprecated Dynamic Capability (Cisco)" },
2007 { BGP_CAPABILITY_DYNAMIC_CAPABILITY
, "Support for Dynamic capability" },
2008 { BGP_CAPABILITY_MULTISESSION
, "Multisession BGP Capability" },
2009 { BGP_CAPABILITY_ADDITIONAL_PATHS
, "Support for Additional Paths" },
2010 { BGP_CAPABILITY_ENHANCED_ROUTE_REFRESH
, "Enhanced route refresh capability" },
2011 { BGP_CAPABILITY_LONG_LIVED_GRACEFUL_RESTART
, "Long-Lived Graceful Restart (LLGR) Capability" },
2012 { BGP_CAPABILITY_CP_ORF
, "CP-ORF Capability" },
2013 { BGP_CAPABILITY_FQDN
, "FQDN Capability" },
2014 { BGP_CAPABILITY_BFD_STRICT
, "BFD Strict-Mode capability" },
2015 { BGP_CAPABILITY_SOFT_VERSION
, "Software Version Capability" },
2016 { BGP_CAPABILITY_PATHS_LIMIT
, "PATHS-LIMIT Capability" },
2017 { BGP_CAPABILITY_ROUTE_REFRESH_CISCO
, "Route Refresh Capability (Cisco)" },
2018 { BGP_CAPABILITY_RPD_CISCO
, "Routing Policy Distribution (Cisco)" },
2019 { BGP_CAPABILITY_ORF_CISCO
, "Outbound Route Filtering (Cisco)" },
2020 { BGP_CAPABILITY_MULTISESSION_CISCO
, "Multisession (Cisco)" },
2021 { BGP_CAPABILITY_FQDN_CISCO
, "FQDN (Cisco)" },
2022 { BGP_CAPABILITY_OPERATIONAL_MSG_CISCO
, "OPERATIONAL message (Cisco)" },
2026 static const value_string community_vals
[] = {
2027 { BGP_COMM_GRACEFUL_SHUTDOWN
, "GRACEFUL_SHUTDOWN" },
2028 { BGP_COMM_ACCEPT_OWN
, "ACCEPT_OWN" },
2029 { BGP_COMM_RT_FLTR_XLTD_V4
, "ROUTE_FILTER_TRANSLATED_v4" },
2030 { BGP_COMM_RT_FLTR_V4
, "ROUTE_FILTER_v4" },
2031 { BGP_COMM_RT_FLTR_XLTD_V6
, "ROUTE_FILTER_TRANSLATED_v6" },
2032 { BGP_COMM_RT_FLTR_V6
, "ROUTE_FILTER_v6" },
2033 { BGP_COMM_LLGR_STALE
, "LLGR_STALE" },
2034 { BGP_COMM_NO_LLGR
, "NO_LLGR" },
2035 { BGP_COMM_ACCEPT_OWN_HOP
, "accept-own-nexthop" },
2036 { BGP_COMM_STANDBY_PE
, "Standby PE" },
2037 { BGP_COMM_BLACKHOLE
, "BLACKHOLE" },
2038 { BGP_COMM_NO_EXPORT
, "NO_EXPORT" },
2039 { BGP_COMM_NO_ADVERTISE
, "NO_ADVERTISE" },
2040 { BGP_COMM_NO_EXPORT_SUBCONFED
, "NO_EXPORT_SUBCONFED" },
2041 { BGP_COMM_NOPEER
, "NOPEER" },
2045 /* Capability Message action code */
2046 static const value_string bgpcap_action
[] = {
2047 { 0, "advertising a capability" },
2048 { 1, "removing a capability" },
2052 static const value_string mcast_vpn_route_type
[] = {
2053 { MCAST_VPN_RTYPE_INTRA_AS_IPMSI_AD
, "Intra-AS I-PMSI A-D route" },
2054 { MCAST_VPN_RTYPE_INTER_AS_IPMSI_AD
, "Inter-AS I-PMSI A-D route" },
2055 { MCAST_VPN_RTYPE_SPMSI_AD
, "S-PMSI A-D route" },
2056 { MCAST_VPN_RTYPE_LEAF_AD
, "Leaf A-D route" },
2057 { MCAST_VPN_RTYPE_SOURCE_ACTIVE_AD
, "Source Active A-D route" },
2058 { MCAST_VPN_RTYPE_SHARED_TREE_JOIN
, "Shared Tree Join route" },
2059 { MCAST_VPN_RTYPE_SOURCE_TREE_JOIN
, "Source Tree Join route" },
2063 /* NLRI type value_string as defined in idr-ls */
2064 static const value_string bgp_ls_nlri_type_vals
[] = {
2065 { LINK_STATE_LINK_NLRI
, "Link NLRI" },
2066 { LINK_STATE_NODE_NLRI
, "Node NLRI" },
2067 { LINK_STATE_IPV4_TOPOLOGY_PREFIX_NLRI
, "IPv4 Topology Prefix NLRI" },
2068 { LINK_STATE_IPV6_TOPOLOGY_PREFIX_NLRI
, "IPv6 Topology Prefix NLRI" },
2069 { LINK_STATE_SRV6_SID_NLRI
, "SRv6 SID NLRI" },
2073 /* Link-State NLRI Protocol-ID value strings */
2074 static const value_string link_state_nlri_protocol_id_values
[] = {
2075 {BGP_LS_NLRI_PROTO_ID_UNKNOWN
, "Unknown" },
2076 {BGP_LS_NLRI_PROTO_ID_IS_IS_LEVEL_1
, "IS-IS Level 1"},
2077 {BGP_LS_NLRI_PROTO_ID_IS_IS_LEVEL_2
, "IS-IS Level 2"},
2078 {BGP_LS_NLRI_PROTO_ID_OSPF_V2
, "OSPFv2"},
2079 {BGP_LS_NLRI_PROTO_ID_DIRECT
, "Direct"},
2080 {BGP_LS_NLRI_PROTO_ID_STATIC
, "Static"},
2081 {BGP_LS_NLRI_PROTO_ID_OSPF_V3
, "OSPFv3"},
2082 {BGP_LS_NLRI_PROTO_ID_BGP
, "BGP"},
2083 {BGP_LS_NLRI_PROTO_ID_RSVP_TE
, "RSVP-TE" },
2084 {BGP_LS_NLRI_PROTO_ID_SEGMENT_ROUTING
, "Segment Routing" },
2088 /* Link-State routing universes */
2089 static const val64_string link_state_nlri_routing_universe_values
[] = {
2090 {BGP_LS_NLRI_ROUTING_UNIVERSE_LEVEL_3
, "L3 packet topology" },
2091 {BGP_LS_NLRI_ROUTING_UNIVERSE_LEVEL_1
, "L1 optical topology"},
2095 /* Link state prefix NLRI OSPF Route Type */
2096 static const value_string link_state_prefix_descriptors_ospf_route_type
[] = {
2097 {BGP_LS_PREFIX_OSPF_ROUTE_TYPE_UNKNOWN
, "Unknown" },
2098 {BGP_LS_PREFIX_OSPF_ROUTE_TYPE_INTRA_AREA
, "Intra-Area"},
2099 {BGP_LS_PREFIX_OSPF_ROUTE_TYPE_INTER_AREA
, "Inter Area"},
2100 {BGP_LS_PREFIX_OSPF_ROUTE_TYPE_EXTERNAL_1
, "External 1"},
2101 {BGP_LS_PREFIX_OSPF_ROUTE_TYPE_EXTERNAL_2
, "External 2"},
2102 {BGP_LS_PREFIX_OSPF_ROUTE_TYPE_NSSA_1
, "NSSA 1"},
2103 {BGP_LS_PREFIX_OSPF_ROUTE_TYPE_NSSA_2
, "NSSA 2"},
2107 /* Link state Flex Algo Metric Type: draft-ietf-lsr-flex-algo-17 */
2108 static const value_string flex_algo_metric_types
[] = {
2110 { 1, "Min Unidirectional Link Delay"},
2115 /* Link state IGP Algorithm Type: https://www.iana.org/assignments/igp-parameters/igp-parameters.xhtml */
2116 static const value_string igp_algo_types
[] = {
2117 { 0, "Shortest Path First (SPF)" },
2118 { 1, "Strict Shortest Path First (Strict SPF)" },
2122 /* Link state IGP MSD Type: https://www.iana.org/assignments/igp-parameters/igp-parameters.xhtml */
2123 static const value_string igp_msd_types
[] = {
2125 { 1, "Base MPLS Imposition MSD" },
2127 { 41, "SRH Max SL" },
2128 { 42, "SRH Max End Pop" },
2129 { 44, "SRH Max H.Encaps" },
2130 { 45, "SRH Max End D" },
2134 /* NLRI type value_string as define in BGP flow spec RFC */
2136 static const value_string flowspec_nlri_opvaluepair_type
[] = {
2137 { BGPNLRI_FSPEC_DST_PFIX
, "Destination prefix filter" },
2138 { BGPNLRI_FSPEC_SRC_PFIX
, "Source prefix filter" },
2139 { BGPNLRI_FSPEC_IP_PROTO
, "Protocol / Next Header filter" },
2140 { BGPNLRI_FSPEC_PORT
, "Port filter" },
2141 { BGPNLRI_FSPEC_DST_PORT
, "Destination port filter" },
2142 { BGPNLRI_FSPEC_SRC_PORT
, "Source port filter" },
2143 { BGPNLRI_FSPEC_ICMP_TP
, "ICMP type filter" },
2144 { BGPNLRI_FSPEC_ICMP_CD
, "ICMP code filter" },
2145 { BGPNLRI_FSPEC_TCP_FLAGS
,"TCP flags filter" },
2146 { BGPNLRI_FSPEC_PCK_LEN
, "Packet Length filter" },
2147 { BGPNLRI_FSPEC_DSCP
, "DSCP marking filter" },
2148 { BGPNLRI_FSPEC_FRAGMENT
, "IP fragment filter" },
2152 /* Subtype Route Refresh, draft-ietf-idr-bgp-enhanced-route-refresh-02 */
2153 static const value_string route_refresh_subtype_vals
[] = {
2154 { 0, "Normal route refresh request [RFC2918] with/without ORF [RFC5291]" },
2155 { 1, "Demarcation of the beginning of a route refresh" },
2156 { 2, "Demarcation of the ending of a route refresh" },
2160 static const value_string bgp_prefix_sid_type
[] = {
2161 { BGP_PREFIX_SID_TLV_LABEL_INDEX
, "Label-Index" },
2162 { BGP_PREFIX_SID_TLV_2
, "Deprecated" },
2163 { BGP_PREFIX_SID_TLV_ORIGINATOR_SRGB
, "Originator SRGB" },
2164 { BGP_PREFIX_SID_TLV_4
, "Deprecated" },
2165 { BGP_PREFIX_SID_TLV_SRV6_L3_SERVICE
, "SRv6 L3 Service" },
2166 { BGP_PREFIX_SID_TLV_SRV6_L2_SERVICE
, "SRv6 L2 Service" },
2170 static const value_string srv6_service_sub_tlv_type
[] = {
2171 { SRV6_SERVICE_SRV6_SID_INFORMATION
, "SRv6 SID Information" },
2175 static const value_string srv6_service_data_sub_sub_tlv_type
[] = {
2176 { SRV6_SERVICE_DATA_SRV6_SID_STRUCTURE
, "SRv6 SID Structure" },
2180 /* SRv6 Endpoint behavior value_string [RFC 8986]. */
2181 static const value_string srv6_endpoint_behavior
[] = {
2182 { SRV6_ENDPOINT_BEHAVIOR_END
, "End" },
2183 { SRV6_ENDPOINT_BEHAVIOR_END_PSP
, "End with PSP" },
2184 { SRV6_ENDPOINT_BEHAVIOR_END_USP
, "End with USP" },
2185 { SRV6_ENDPOINT_BEHAVIOR_END_PSP_USP
, "End with PSP & USP" },
2186 { SRV6_ENDPOINT_BEHAVIOR_END_X
, "End.X" },
2187 { SRV6_ENDPOINT_BEHAVIOR_END_X_PSP
, "End.X with PSP" },
2188 { SRV6_ENDPOINT_BEHAVIOR_END_X_USP
, "End.X with USP" },
2189 { SRV6_ENDPOINT_BEHAVIOR_END_X_PSP_USP
, "End.X with PSP & USP" },
2190 { SRV6_ENDPOINT_BEHAVIOR_END_T
, "End.T" },
2191 { SRV6_ENDPOINT_BEHAVIOR_END_T_PSP
, "End.T with PSP" },
2192 { SRV6_ENDPOINT_BEHAVIOR_END_T_USP
, "End.T with USP" },
2193 { SRV6_ENDPOINT_BEHAVIOR_END_T_PSP_USP
, "End.T with PSP & USP" },
2194 { SRV6_ENDPOINT_BEHAVIOR_END_B6_INSERT
, "End.B6.Insert" },
2195 { SRV6_ENDPOINT_BEHAVIOR_END_B6_ENCAPS
, "End.B6.Encaps" },
2196 { SRV6_ENDPOINT_BEHAVIOR_END_BM
, "End.BM" },
2197 { SRV6_ENDPOINT_BEHAVIOR_END_DX6
, "End.DX6" },
2198 { SRV6_ENDPOINT_BEHAVIOR_END_DX4
, "End.DX4" },
2199 { SRV6_ENDPOINT_BEHAVIOR_END_DT6
, "End.DT6" },
2200 { SRV6_ENDPOINT_BEHAVIOR_END_DT4
, "End.DT4" },
2201 { SRV6_ENDPOINT_BEHAVIOR_END_DT46
, "End.DT46" },
2202 { SRV6_ENDPOINT_BEHAVIOR_END_DX2
, "End.DX2" },
2203 { SRV6_ENDPOINT_BEHAVIOR_END_DX2V
, "End.DX2V" },
2204 { SRV6_ENDPOINT_BEHAVIOR_END_DT2U
, "End.DT2U" },
2205 { SRV6_ENDPOINT_BEHAVIOR_END_DT2M
, "End.DT2M" },
2206 { SRV6_ENDPOINT_BEHAVIOR_END_B6_INSERT_RED
, "End.B6.Insert.Red" },
2207 { SRV6_ENDPOINT_BEHAVIOR_END_B6_ENCAPS_RED
, "End.B6.Encaps.Red" },
2208 { SRV6_ENDPOINT_BEHAVIOR_END_USD
, "End with USD" },
2209 { SRV6_ENDPOINT_BEHAVIOR_END_PSP_USD
, "End with PSP & USD" },
2210 { SRV6_ENDPOINT_BEHAVIOR_END_USP_USD
, "End with USP & USD" },
2211 { SRV6_ENDPOINT_BEHAVIOR_END_PSP_USP_USD
, "End with PSP, USP & USD" },
2212 { SRV6_ENDPOINT_BEHAVIOR_END_X_USD
, "End.X with USD" },
2213 { SRV6_ENDPOINT_BEHAVIOR_END_X_PSP_USD
, "End.X with PSP & USD" },
2214 { SRV6_ENDPOINT_BEHAVIOR_END_X_USP_USD
, "End.X with USP & USD" },
2215 { SRV6_ENDPOINT_BEHAVIOR_END_X_PSP_USP_USD
, "End.X with PSP, USP & USD" },
2216 { SRV6_ENDPOINT_BEHAVIOR_END_T_USD
, "End.T with USD" },
2217 { SRV6_ENDPOINT_BEHAVIOR_END_T_PSP_USD
, "End.T with PSP & USD" },
2218 { SRV6_ENDPOINT_BEHAVIOR_END_T_USP_USD
, "End.T with USP & USD" },
2219 { SRV6_ENDPOINT_BEHAVIOR_END_T_PSP_USP_USD
, "End.T with PSP, USP & USD" },
2220 { SRV6_ENDPOINT_BEHAVIOR_END_MAP
, "End.MAP" },
2221 { SRV6_ENDPOINT_BEHAVIOR_END_LIMIT
, "End.Limit" },
2222 { SRV6_ENDPOINT_BEHAVIOR_END_ONLY_CSID
, "End with NEXT-ONLY-CSID" },
2223 { SRV6_ENDPOINT_BEHAVIOR_END_CSID
, "End with NEXT-CSID" },
2224 { SRV6_ENDPOINT_BEHAVIOR_END_CSID_PSP
, "End with NEXT-CSID & PSP" },
2225 { SRV6_ENDPOINT_BEHAVIOR_END_CSID_USP
, "End with NEXT-CSID & USP" },
2226 { SRV6_ENDPOINT_BEHAVIOR_END_CSID_PSP_USP
, "End with NEXT-CSID, PSP & USP" },
2227 { SRV6_ENDPOINT_BEHAVIOR_END_CSID_USD
, "End with NEXT-CSID & USD" },
2228 { SRV6_ENDPOINT_BEHAVIOR_END_CSID_PSP_USD
, "End with NEXT-CSID, PSP & USD" },
2229 { SRV6_ENDPOINT_BEHAVIOR_END_CSID_USP_USD
, "End with NEXT-CSID, USP & USD" },
2230 { SRV6_ENDPOINT_BEHAVIOR_END_CSID_PSP_USP_USD
, "End with NEXT-CSID, PSP, USP & USD" },
2231 { SRV6_ENDPOINT_BEHAVIOR_END_X_ONLY_CSID
, "End.X with NEXT-ONLY-CSID" },
2232 { SRV6_ENDPOINT_BEHAVIOR_END_X_CSID
, "End.X with NEXT-CSID" },
2233 { SRV6_ENDPOINT_BEHAVIOR_END_X_CSID_PSP
, "End.X with NEXT-CSID & PSP" },
2234 { SRV6_ENDPOINT_BEHAVIOR_END_X_CSID_USP
, "End.X with NEXT-CSID & USP" },
2235 { SRV6_ENDPOINT_BEHAVIOR_END_X_CSID_PSP_USP
, "End.X with NEXT-CSID, PSP & USP" },
2236 { SRV6_ENDPOINT_BEHAVIOR_END_X_CSID_USD
, "End.X with NEXT-CSID & USD" },
2237 { SRV6_ENDPOINT_BEHAVIOR_END_X_CSID_PSP_USD
, "End.X with NEXT-CSID, PSP & USD" },
2238 { SRV6_ENDPOINT_BEHAVIOR_END_X_CSID_USP_USD
, "End.X with NEXT-CSID, USP & USD" },
2239 { SRV6_ENDPOINT_BEHAVIOR_END_X_CSID_PSP_USP_USD
, "End.X with NEXT-CSID, PSP, USP & USD" },
2240 { SRV6_ENDPOINT_BEHAVIOR_END_DX6_CSID
, "End.DX6 with NEXT-CSID" },
2241 { SRV6_ENDPOINT_BEHAVIOR_END_DX4_CSID
, "End.DX4 with NEXT-CSID" },
2242 { SRV6_ENDPOINT_BEHAVIOR_END_DT6_CSID
, "End.DT6 with NEXT-CSID" },
2243 { SRV6_ENDPOINT_BEHAVIOR_END_DT4_CSID
, "End.DT4 with NEXT-CSID" },
2244 { SRV6_ENDPOINT_BEHAVIOR_END_DT46_CSID
, "End.DT46 with NEXT-CSID" },
2245 { SRV6_ENDPOINT_BEHAVIOR_END_DX2_CSID
, "End.DX2 with NEXT-CSID" },
2246 { SRV6_ENDPOINT_BEHAVIOR_END_DX2V_CSID
, "End.DX2V with NEXT-CSID" },
2247 { SRV6_ENDPOINT_BEHAVIOR_END_DT2U_CSID
, "End.DT2U with NEXT-CSID" },
2248 { SRV6_ENDPOINT_BEHAVIOR_END_DT2M_CSID
, "End.DT2M with NEXT-CSID" },
2249 { SRV6_ENDPOINT_BEHAVIOR_END_M_GTP6D
, "End.M.GTP6.D" },
2250 { SRV6_ENDPOINT_BEHAVIOR_END_M_GTP6DI
, "End.M.GTP6.Di" },
2251 { SRV6_ENDPOINT_BEHAVIOR_END_M_GTP6E
, "End.M.GTP6.E" },
2252 { SRV6_ENDPOINT_BEHAVIOR_END_M_GTP4E
, "End.M.GTP4.E" },
2253 { SRV6_ENDPOINT_BEHAVIOR_END_M
, "End.M" },
2254 { SRV6_ENDPOINT_BEHAVIOR_END_REPLICATE
, "End.Replicate" },
2255 { SRV6_ENDPOINT_BEHAVIOR_END_NSH
, "End.NSH - NSH Segment" },
2256 { SRV6_ENDPOINT_BEHAVIOR_END_DX1
, "End.DX1" },
2257 { SRV6_ENDPOINT_BEHAVIOR_END_DX1_NEXT_CSID
, "End.DX1 with NEXT-CSID" },
2258 { SRV6_ENDPOINT_BEHAVIOR_END_DX1_REPL_CSID
, "End.DX1 with REPLACE-CSID" },
2259 { SRV6_ENDPOINT_BEHAVIOR_OPAQUE
, "Opaque" },
2263 #define BGP_MUP_AT_3GPP_5G 1
2264 #define BGP_MUP_RT_INTERWORK_SEGMENT_DISCOVERY 1
2265 #define BGP_MUP_RT_DIRECT_SEGMENT_DISCOVERY 2
2266 #define BGP_MUP_RT_TYPE_1_SESSION_TRANSFORMED 3
2267 #define BGP_MUP_RT_TYPE_2_SESSION_TRANSFORMED 4
2269 static const value_string bgp_mup_architecture_types
[] = {
2270 { BGP_MUP_AT_3GPP_5G
, "3gpp-5g" },
2274 static const value_string bgp_mup_route_types
[] = {
2275 { BGP_MUP_RT_INTERWORK_SEGMENT_DISCOVERY
, "Interwork Segment Discovery route" },
2276 { BGP_MUP_RT_DIRECT_SEGMENT_DISCOVERY
, "Direct Segment Discovery route" },
2277 { BGP_MUP_RT_TYPE_1_SESSION_TRANSFORMED
, "Type 1 Session Transformed (ST) route" },
2278 { BGP_MUP_RT_TYPE_2_SESSION_TRANSFORMED
, "Type 2 Session Transformed (ST) route" },
2282 static const value_string bgp_ext_com_local_admin_types
[] = {
2283 { 0, "VID (802.1Q VLAN ID)" },
2288 { 5, "dual-VID (QinQ VLAN ID)" },
2292 static const true_false_string tfs_non_transitive_transitive
= { "Non-transitive", "Transitive" };
2293 static const true_false_string tfs_esi_label_flag
= { "Single-Active redundancy", "All-Active redundancy" };
2294 static const true_false_string tfs_ospf_rt_mt
= { "Type-2", "Type-1" };
2295 static const true_false_string tfs_eigrp_rtype
= { "Internal" , "External" };
2296 static const true_false_string tfs_cost_replace
= { "Replaces the original attribute value", "Evaluated after the original attribute value" };
2297 static const true_false_string tfs_exclude_include
= { "Exclude", "Include" };
2298 static const true_false_string tfs_manually_auto_derived
= { "manually derived", "auto-derived"};
2300 /* Maximal size of an IP address string */
2301 #define MAX_SIZE_OF_IP_ADDR_STRING 16
2303 static const uint8_t rd_zero
[BGP_ROUTE_DISTINGUISHER_SIZE
] = {0};
2305 static int proto_bgp
;
2307 /* BGP header field initialisation */
2309 /* global BGP header field */
2311 static int hf_bgp_marker
;
2312 static int hf_bgp_length
;
2313 static int hf_bgp_prefix_length
;
2314 static int hf_bgp_rd
;
2315 static int hf_bgp_continuation
;
2316 static int hf_bgp_originating_as
;
2317 static int hf_bgp_community_prefix
;
2318 static int hf_bgp_endpoint_address
;
2319 static int hf_bgp_endpoint_address_ipv6
;
2320 static int hf_bgp_label_stack
;
2321 static int hf_bgp_large_communities
;
2322 static int hf_bgp_large_communities_ga
;
2323 static int hf_bgp_large_communities_ldp1
;
2324 static int hf_bgp_large_communities_ldp2
;
2325 static int hf_bgp_vplsad_length
;
2326 static int hf_bgp_vplsad_rd
;
2327 static int hf_bgp_bgpad_pe_addr
;
2328 static int hf_bgp_vplsbgp_ce_id
;
2329 static int hf_bgp_vplsbgp_labelblock_offset
;
2330 static int hf_bgp_vplsbgp_labelblock_size
;
2331 static int hf_bgp_vplsbgp_labelblock_base
;
2332 static int hf_bgp_wildcard_route_target
;
2333 static int hf_bgp_type
;
2335 /* BGP open message header field */
2337 static int hf_bgp_open_version
;
2338 static int hf_bgp_open_myas
;
2339 static int hf_bgp_open_holdtime
;
2340 static int hf_bgp_open_identifier
;
2341 static int hf_bgp_open_opt_len
;
2342 static int hf_bgp_open_opt_extension
;
2343 static int hf_bgp_open_opt_extension_mark
;
2344 static int hf_bgp_open_opt_extension_len
;
2345 static int hf_bgp_open_opt_params
;
2346 static int hf_bgp_open_opt_param
;
2347 static int hf_bgp_open_opt_param_type
;
2348 static int hf_bgp_open_opt_param_len
;
2349 static int hf_bgp_open_opt_param_auth
;
2350 static int hf_bgp_open_opt_param_unknown
;
2352 /* BGP notify header field */
2354 static int hf_bgp_notify_major_error
;
2355 static int hf_bgp_notify_minor_msg_hdr
;
2356 static int hf_bgp_notify_minor_open_msg
;
2357 static int hf_bgp_notify_minor_update_msg
;
2358 static int hf_bgp_notify_minor_ht_expired
;
2359 static int hf_bgp_notify_minor_state_machine
;
2360 static int hf_bgp_notify_minor_cease
;
2361 static int hf_bgp_notify_minor_rr_msg
;
2362 static int hf_bgp_notify_minor_unknown
;
2363 static int hf_bgp_notify_data
;
2364 static int hf_bgp_notify_error_open_bad_peer_as
;
2365 static int hf_bgp_notify_communication_length
;
2366 static int hf_bgp_notify_communication
;
2368 /* BGP route refresh header field */
2370 static int hf_bgp_route_refresh_afi
;
2371 static int hf_bgp_route_refresh_subtype
;
2372 static int hf_bgp_route_refresh_safi
;
2373 static int hf_bgp_route_refresh_orf
;
2374 static int hf_bgp_route_refresh_orf_flag
;
2375 static int hf_bgp_route_refresh_orf_type
;
2376 static int hf_bgp_route_refresh_orf_length
;
2377 static int hf_bgp_route_refresh_orf_entry_prefixlist
;
2378 static int hf_bgp_route_refresh_orf_entry_action
;
2379 static int hf_bgp_route_refresh_orf_entry_match
;
2380 static int hf_bgp_route_refresh_orf_entry_sequence
;
2381 static int hf_bgp_route_refresh_orf_entry_prefixmask_lower
;
2382 static int hf_bgp_route_refresh_orf_entry_prefixmask_upper
;
2383 static int hf_bgp_route_refresh_orf_entry_ip
;
2385 /* BGP capabilities header field */
2387 static int hf_bgp_cap
;
2388 static int hf_bgp_cap_type
;
2389 static int hf_bgp_cap_length
;
2390 static int hf_bgp_cap_action
;
2391 static int hf_bgp_cap_unknown
;
2392 static int hf_bgp_cap_reserved
;
2393 static int hf_bgp_cap_mp_afi
;
2394 static int hf_bgp_cap_mp_safi
;
2395 static int hf_bgp_cap_enh_afi
;
2396 static int hf_bgp_cap_enh_safi
;
2397 static int hf_bgp_cap_enh_nhafi
;
2398 static int hf_bgp_cap_role
;
2399 static int hf_bgp_cap_gr_timers
;
2400 static int hf_bgp_cap_gr_timers_restart_flag
;
2401 static int hf_bgp_cap_gr_timers_notification_flag
;
2402 static int hf_bgp_cap_gr_timers_restart_time
;
2403 static int hf_bgp_cap_gr_afi
;
2404 static int hf_bgp_cap_gr_safi
;
2405 static int hf_bgp_cap_gr_flag
;
2406 static int hf_bgp_cap_gr_flag_pfs
;
2407 static int hf_bgp_cap_4as
;
2408 static int hf_bgp_cap_dc
;
2409 static int hf_bgp_cap_ap_afi
;
2410 static int hf_bgp_cap_ap_safi
;
2411 static int hf_bgp_cap_ap_sendreceive
;
2412 static int hf_bgp_cap_orf_afi
;
2413 static int hf_bgp_cap_orf_safi
;
2414 static int hf_bgp_cap_orf_number
;
2415 static int hf_bgp_cap_orf_type
;
2416 static int hf_bgp_cap_orf_sendreceive
;
2417 static int hf_bgp_cap_fqdn_hostname_len
;
2418 static int hf_bgp_cap_fqdn_hostname
;
2419 static int hf_bgp_cap_fqdn_domain_name_len
;
2420 static int hf_bgp_cap_fqdn_domain_name
;
2421 static int hf_bgp_cap_multisession_flags
;
2422 static int hf_bgp_cap_bgpsec_flags
;
2423 static int hf_bgp_cap_bgpsec_version
;
2424 static int hf_bgp_cap_bgpsec_sendreceive
;
2425 static int hf_bgp_cap_bgpsec_reserved
;
2426 static int hf_bgp_cap_bgpsec_afi
;
2427 static int hf_bgp_cap_soft_version
;
2428 static int hf_bgp_cap_soft_version_len
;
2430 /* BGP update global header field */
2431 static int hf_bgp_update_withdrawn_routes_length
;
2432 static int hf_bgp_update_withdrawn_routes
;
2435 /* BGP update path attribute header field */
2436 static int hf_bgp_update_total_path_attribute_length
;
2437 static int hf_bgp_update_path_attributes
;
2438 static int hf_bgp_update_path_attributes_unknown
;
2439 static int hf_bgp_update_path_attribute_communities
;
2440 static int hf_bgp_update_path_attribute_community_well_known
;
2441 static int hf_bgp_update_path_attribute_community
;
2442 static int hf_bgp_update_path_attribute_community_as
;
2443 static int hf_bgp_update_path_attribute_community_value
;
2444 static int hf_bgp_update_path_attribute
;
2445 static int hf_bgp_update_path_attribute_flags
;
2446 static int hf_bgp_update_path_attribute_flags_optional
;
2447 static int hf_bgp_update_path_attribute_flags_transitive
;
2448 static int hf_bgp_update_path_attribute_flags_partial
;
2449 static int hf_bgp_update_path_attribute_flags_extended_length
;
2450 static int hf_bgp_update_path_attribute_flags_unused
;
2451 static int hf_bgp_update_path_attribute_type_code
;
2452 static int hf_bgp_update_path_attribute_length
;
2453 static int hf_bgp_update_path_attribute_next_hop
;
2454 static int hf_bgp_update_path_attribute_as_path_segment
;
2455 static int hf_bgp_update_path_attribute_as_path_segment_type
;
2456 static int hf_bgp_update_path_attribute_as_path_segment_length
;
2457 static int hf_bgp_update_path_attribute_as_path_segment_as2
;
2458 static int hf_bgp_update_path_attribute_as_path_segment_as4
;
2459 static int hf_bgp_update_path_attribute_origin
;
2460 static int hf_bgp_update_path_attribute_cluster_list
;
2461 static int hf_bgp_update_path_attribute_cluster_id
;
2462 static int hf_bgp_update_path_attribute_originator_id
;
2463 static int hf_bgp_update_path_attribute_local_pref
;
2464 static int hf_bgp_update_path_attribute_attrset_origin_as
;
2465 static int hf_bgp_update_path_attribute_multi_exit_disc
;
2466 static int hf_bgp_update_path_attribute_aggregator_as
;
2467 static int hf_bgp_update_path_attribute_aggregator_origin
;
2468 static int hf_bgp_update_path_attribute_link_state
;
2469 static int hf_bgp_update_path_attribute_mp_reach_nlri_address_family
;
2470 static int hf_bgp_update_path_attribute_mp_reach_nlri_safi
;
2471 static int hf_bgp_update_path_attribute_mp_reach_nlri_next_hop
;
2472 static int hf_bgp_update_path_attribute_mp_reach_nlri_next_hop_rd
;
2473 static int hf_bgp_update_path_attribute_mp_reach_nlri_next_hop_ipv4
;
2474 static int hf_bgp_update_path_attribute_mp_reach_nlri_next_hop_ipv6
;
2475 static int hf_bgp_update_path_attribute_mp_reach_nlri_next_hop_ipv6_link_local
;
2476 static int hf_bgp_update_path_attribute_mp_reach_nlri_nbr_snpa
;
2477 static int hf_bgp_update_path_attribute_mp_reach_nlri_snpa_length
;
2478 static int hf_bgp_update_path_attribute_mp_reach_nlri_snpa
;
2479 static int hf_bgp_update_path_attribute_mp_reach_nlri
;
2480 static int hf_bgp_update_path_attribute_mp_unreach_nlri_address_family
;
2481 static int hf_bgp_update_path_attribute_mp_unreach_nlri_safi
;
2482 static int hf_bgp_update_path_attribute_mp_unreach_nlri
;
2483 static int hf_bgp_update_path_attribute_aigp
;
2484 static int hf_bgp_update_path_attribute_bgpsec_sb_len
;
2485 static int hf_bgp_update_path_attribute_bgpsec_algo_id
;
2486 static int hf_bgp_update_path_attribute_bgpsec_sps_pcount
;
2487 static int hf_bgp_update_path_attribute_bgpsec_sps_flags
;
2488 static int hf_bgp_update_path_attribute_bgpsec_sps_as
;
2489 static int hf_bgp_update_path_attribute_bgpsec_sp_len
;
2490 static int hf_bgp_update_path_attribute_bgpsec_ski
;
2491 static int hf_bgp_update_path_attribute_bgpsec_sig_len
;
2492 static int hf_bgp_update_path_attribute_bgpsec_sig
;
2493 static int hf_bgp_update_path_attribute_otc
;
2494 static int hf_bgp_update_path_attribute_d_path
;
2495 static int hf_bgp_d_path_ga
;
2496 static int hf_bgp_d_path_la
;
2497 static int hf_bgp_d_path_length
;
2498 static int hf_bgp_d_path_isf_safi
;
2499 static int hf_bgp_evpn_nlri
;
2500 static int hf_bgp_evpn_nlri_rt
;
2501 static int hf_bgp_evpn_nlri_len
;
2502 static int hf_bgp_evpn_nlri_rd
;
2503 static int hf_bgp_evpn_nlri_esi
;
2504 static int hf_bgp_evpn_nlri_esi_type
;
2505 static int hf_bgp_evpn_nlri_esi_lacp_mac
;
2506 static int hf_bgp_evpn_nlri_esi_portk
;
2507 static int hf_bgp_evpn_nlri_esi_remain
;
2508 static int hf_bgp_evpn_nlri_esi_value
;
2509 static int hf_bgp_evpn_nlri_esi_value_type0
;
2510 static int hf_bgp_evpn_nlri_esi_rb_mac
;
2511 static int hf_bgp_evpn_nlri_esi_rbprio
;
2512 static int hf_bgp_evpn_nlri_esi_sys_mac
;
2513 static int hf_bgp_evpn_nlri_esi_mac_discr
;
2514 static int hf_bgp_evpn_nlri_esi_router_id
;
2515 static int hf_bgp_evpn_nlri_esi_router_discr
;
2516 static int hf_bgp_evpn_nlri_esi_asn
;
2517 static int hf_bgp_evpn_nlri_esi_asn_discr
;
2518 static int hf_bgp_evpn_nlri_esi_reserved
;
2519 static int hf_bgp_evpn_nlri_etag
;
2520 static int hf_bgp_evpn_nlri_mpls_ls1
;
2521 static int hf_bgp_evpn_nlri_mpls_ls2
;
2522 static int hf_bgp_evpn_nlri_vni
;
2523 static int hf_bgp_evpn_nlri_maclen
;
2524 static int hf_bgp_evpn_nlri_mac_addr
;
2525 static int hf_bgp_evpn_nlri_iplen
;
2526 static int hf_bgp_evpn_nlri_prefix_len
;
2527 static int hf_bgp_evpn_nlri_ip_addr
;
2528 static int hf_bgp_evpn_nlri_ipv6_addr
;
2529 static int hf_bgp_evpn_nlri_ipv4_gtw
;
2530 static int hf_bgp_evpn_nlri_ipv6_gtw
;
2531 static int hf_bgp_evpn_nlri_igmp_mc_or_length
;
2532 static int hf_bgp_evpn_nlri_igmp_mc_or_addr_ipv4
;
2533 static int hf_bgp_evpn_nlri_igmp_mc_or_addr_ipv6
;
2534 static int hf_bgp_evpn_nlri_igmp_mc_flags
;
2535 static int hf_bgp_evpn_nlri_igmp_mc_flags_v1
;
2536 static int hf_bgp_evpn_nlri_igmp_mc_flags_v2
;
2537 static int hf_bgp_evpn_nlri_igmp_mc_flags_v3
;
2538 static int hf_bgp_evpn_nlri_igmp_mc_flags_ie
;
2539 static int hf_bgp_evpn_nlri_igmp_mc_flags_reserved
;
2541 static int * const evpn_nlri_igmp_mc_flags
[] = {
2542 &hf_bgp_evpn_nlri_igmp_mc_flags_v1
,
2543 &hf_bgp_evpn_nlri_igmp_mc_flags_v2
,
2544 &hf_bgp_evpn_nlri_igmp_mc_flags_v3
,
2545 &hf_bgp_evpn_nlri_igmp_mc_flags_ie
,
2546 &hf_bgp_evpn_nlri_igmp_mc_flags_reserved
,
2550 /* BGP update tunnel encaps attribute RFC 5512 */
2552 static int hf_bgp_update_encaps_tunnel_tlv_len
;
2553 static int hf_bgp_update_encaps_tunnel_tlv_type
;
2554 static int hf_bgp_update_encaps_tunnel_subtlv_len
;
2555 static int hf_bgp_update_encaps_tunnel_subtlv_type
;
2556 static int hf_bgp_update_encaps_tunnel_subtlv_session_id
;
2557 static int hf_bgp_update_encaps_tunnel_subtlv_cookie
;
2558 static int hf_bgp_update_encaps_tunnel_subtlv_gre_key
;
2559 static int hf_bgp_update_encaps_tunnel_subtlv_color_value
;
2560 static int hf_bgp_update_encaps_tunnel_subtlv_lb_block_length
;
2561 static int hf_bgp_update_encaps_tunnel_subtlv_value
;
2563 /* draft-ietf-idr-tunnel-encaps */
2564 static int hf_bgp_update_encaps_tunnel_subtlv_vxlan_flags
;
2565 static int hf_bgp_update_encaps_tunnel_subtlv_vxlan_flags_valid_vnid
;
2566 static int hf_bgp_update_encaps_tunnel_subtlv_vxlan_flags_valid_mac
;
2567 static int hf_bgp_update_encaps_tunnel_subtlv_vxlan_flags_reserved
;
2568 static int hf_bgp_update_encaps_tunnel_subtlv_vxlan_vnid
;
2569 static int hf_bgp_update_encaps_tunnel_subtlv_vxlan_mac
;
2570 static int hf_bgp_update_encaps_tunnel_subtlv_vxlan_reserved
;
2571 static int hf_bgp_update_encaps_tunnel_subtlv_vxlan_gpe_flags
;
2572 static int hf_bgp_update_encaps_tunnel_subtlv_vxlan_gpe_flags_version
;
2573 static int hf_bgp_update_encaps_tunnel_subtlv_vxlan_gpe_flags_valid_vnid
;
2574 static int hf_bgp_update_encaps_tunnel_subtlv_vxlan_gpe_flags_reserved
;
2575 static int hf_bgp_update_encaps_tunnel_subtlv_vxlan_gpe_vnid
;
2576 static int hf_bgp_update_encaps_tunnel_subtlv_vxlan_gpe_reserved
;
2577 static int hf_bgp_update_encaps_tunnel_subtlv_nvgre_flags
;
2578 static int hf_bgp_update_encaps_tunnel_subtlv_nvgre_flags_valid_vnid
;
2579 static int hf_bgp_update_encaps_tunnel_subtlv_nvgre_flags_valid_mac
;
2580 static int hf_bgp_update_encaps_tunnel_subtlv_nvgre_flags_reserved
;
2581 static int hf_bgp_update_encaps_tunnel_subtlv_nvgre_vnid
;
2582 static int hf_bgp_update_encaps_tunnel_subtlv_nvgre_mac
;
2583 static int hf_bgp_update_encaps_tunnel_subtlv_nvgre_reserved
;
2585 /* draft-ietf-idr-segment-routing-te-policy */
2586 static int hf_bgp_update_encaps_tunnel_subtlv_pref_flags
;
2587 static int hf_bgp_update_encaps_tunnel_subtlv_pref_reserved
;
2588 static int hf_bgp_update_encaps_tunnel_subtlv_pref_preference
;
2589 static int hf_bgp_update_encaps_tunnel_subtlv_binding_sid_flags
;
2590 static int hf_bgp_update_encaps_tunnel_subtlv_binding_sid_flags_specified
;
2591 static int hf_bgp_update_encaps_tunnel_subtlv_binding_sid_flags_invalid
;
2592 static int hf_bgp_update_encaps_tunnel_subtlv_binding_sid_flags_reserved
;
2593 static int hf_bgp_update_encaps_tunnel_subtlv_binding_sid_reserved
;
2594 static int hf_bgp_update_encaps_tunnel_subtlv_binding_sid_sid
;
2595 static int hf_bgp_update_encaps_tunnel_subtlv_enlp_flags
;
2596 static int hf_bgp_update_encaps_tunnel_subtlv_enlp_reserved
;
2597 static int hf_bgp_update_encaps_tunnel_subtlv_enlp_enlp
;
2598 static int hf_bgp_update_encaps_tunnel_subtlv_priority_priority
;
2599 static int hf_bgp_update_encaps_tunnel_subtlv_priority_reserved
;
2600 static int hf_bgp_update_encaps_tunnel_subtlv_segment_list_reserved
;
2601 static int hf_bgp_update_encaps_tunnel_subtlv_segment_list_subtlv
;
2602 static int hf_bgp_update_encaps_tunnel_subtlv_segment_list_subtlv_type
;
2603 static int hf_bgp_update_encaps_tunnel_subtlv_segment_list_subtlv_length
;
2604 static int hf_bgp_update_encaps_tunnel_subtlv_segment_list_subtlv_data
;
2605 static int hf_bgp_update_encaps_tunnel_subtlv_segment_list_subtlv_flags
;
2606 static int hf_bgp_update_encaps_tunnel_subtlv_segment_list_subtlv_flags_verification
;
2607 static int hf_bgp_update_encaps_tunnel_subtlv_segment_list_subtlv_flags_algorithm
;
2608 static int hf_bgp_update_encaps_tunnel_subtlv_segment_list_subtlv_flags_reserved
;
2609 static int hf_bgp_update_encaps_tunnel_subtlv_segment_list_subtlv_reserved
;
2610 static int hf_bgp_update_encaps_tunnel_subtlv_segment_list_subtlv_mpls_label
;
2611 static int hf_bgp_update_encaps_tunnel_subtlv_segment_list_subtlv_traffic_class
;
2612 static int hf_bgp_update_encaps_tunnel_subtlv_segment_list_subtlv_bottom_stack
;
2613 static int hf_bgp_update_encaps_tunnel_subtlv_segment_list_subtlv_ttl
;
2614 static int hf_bgp_update_encaps_tunnel_subtlv_policy_name_reserved
;
2615 static int hf_bgp_update_encaps_tunnel_subtlv_policy_name_name
;
2617 /* RFC 6514 PMSI Tunnel Attribute */
2618 static int hf_bgp_pmsi_tunnel_flags
;
2619 static int hf_bgp_pmsi_tunnel_type
;
2620 static int hf_bgp_pmsi_tunnel_id
;
2621 static int hf_bgp_pmsi_tunnel_not_present
;
2622 static int hf_bgp_pmsi_tunnel_rsvp_p2mp_id
; /* RFC4875 section 19 */
2623 static int hf_bgp_pmsi_tunnel_rsvp_p2mp_tunnel_id
;
2624 static int hf_bgp_pmsi_tunnel_rsvp_p2mp_ext_tunnel_idv4
;
2625 static int hf_bgp_pmsi_tunnel_mldp_fec_el_type
; /* RFC 6388 section 2.3 */
2626 static int hf_bgp_pmsi_tunnel_mldp_fec_el_afi
;
2627 static int hf_bgp_pmsi_tunnel_mldp_fec_el_adr_len
;
2628 static int hf_bgp_pmsi_tunnel_mldp_fec_el_root_nodev4
;
2629 static int hf_bgp_pmsi_tunnel_mldp_fec_el_root_nodev6
;
2630 static int hf_bgp_pmsi_tunnel_mldp_fec_el_opa_len
;
2631 static int hf_bgp_pmsi_tunnel_mldp_fec_el_opa_val_type
;
2632 static int hf_bgp_pmsi_tunnel_mldp_fec_el_opa_val_len
;
2633 static int hf_bgp_pmsi_tunnel_mldp_fec_el_opa_value_rn
;
2634 static int hf_bgp_pmsi_tunnel_mldp_fec_el_opa_value_str
;
2635 static int hf_bgp_pmsi_tunnel_mldp_fec_el_opa_val_ext_type
;
2636 static int hf_bgp_pmsi_tunnel_mldp_fec_el_opa_val_ext_len
;
2637 static int hf_bgp_pmsi_tunnel_pimsm_sender
;
2638 static int hf_bgp_pmsi_tunnel_pimsm_pmc_group
;
2639 static int hf_bgp_pmsi_tunnel_pimssm_root_node
;
2640 static int hf_bgp_pmsi_tunnel_pimssm_pmc_group
;
2641 static int hf_bgp_pmsi_tunnel_pimbidir_sender
;
2642 static int hf_bgp_pmsi_tunnel_pimbidir_pmc_group
;
2643 static int hf_bgp_pmsi_tunnel_ingress_rep_addr
;
2644 static int hf_bgp_pmsi_tunnel_ingress_rep_addr6
;
2646 /* RFC 7311 attribute */
2647 static int hf_bgp_aigp_type
;
2648 static int hf_bgp_aigp_tlv_length
;
2649 static int hf_bgp_aigp_accu_igp_metric
;
2652 /* MPLS labels decoding */
2653 static int hf_bgp_update_mpls_label
;
2654 static int hf_bgp_update_mpls_label_value
;
2655 static int hf_bgp_update_mpls_label_value_20bits
;
2656 static int hf_bgp_update_mpls_traffic_class
;
2657 static int hf_bgp_update_mpls_bottom_stack
;
2659 /* BGP update path attribute SSA SAFI Specific attribute (deprecated should we keep it ?) */
2661 static int hf_bgp_ssa_t
;
2662 static int hf_bgp_ssa_type
;
2663 static int hf_bgp_ssa_len
;
2664 static int hf_bgp_ssa_value
;
2665 static int hf_bgp_ssa_l2tpv3_pref
;
2666 static int hf_bgp_ssa_l2tpv3_s
;
2667 static int hf_bgp_ssa_l2tpv3_unused
;
2668 static int hf_bgp_ssa_l2tpv3_cookie_len
;
2669 static int hf_bgp_ssa_l2tpv3_session_id
;
2670 static int hf_bgp_ssa_l2tpv3_cookie
;
2672 /* BGP NLRI head field */
2673 static int hf_bgp_update_nlri
;
2675 static int hf_bgp_mp_reach_nlri_ipv4_prefix
;
2676 static int hf_bgp_mp_unreach_nlri_ipv4_prefix
;
2677 static int hf_bgp_mp_reach_nlri_ipv6_prefix
;
2678 static int hf_bgp_mp_unreach_nlri_ipv6_prefix
;
2679 static int hf_bgp_mp_nlri_tnl_id
;
2680 static int hf_bgp_withdrawn_prefix
;
2681 static int hf_bgp_nlri_prefix
;
2682 static int hf_bgp_nlri_path_id
;
2684 /* BGP mcast IP VPN nlri header field */
2686 static int hf_bgp_mcast_vpn_nlri_t
;
2687 static int hf_bgp_mcast_vpn_nlri_route_type
;
2688 static int hf_bgp_mcast_vpn_nlri_length
;
2689 static int hf_bgp_mcast_vpn_nlri_rd
;
2690 static int hf_bgp_mcast_vpn_nlri_origin_router_ipv4
;
2691 static int hf_bgp_mcast_vpn_nlri_origin_router_ipv6
;
2692 static int hf_bgp_mcast_vpn_nlri_source_as
;
2693 static int hf_bgp_mcast_vpn_nlri_source_length
;
2694 static int hf_bgp_mcast_vpn_nlri_group_length
;
2695 static int hf_bgp_mcast_vpn_nlri_source_addr_ipv4
;
2696 static int hf_bgp_mcast_vpn_nlri_source_addr_ipv6
;
2697 static int hf_bgp_mcast_vpn_nlri_group_addr_ipv4
;
2698 static int hf_bgp_mcast_vpn_nlri_group_addr_ipv6
;
2699 static int hf_bgp_mcast_vpn_nlri_route_key
;
2701 /* BGP SR policy nlri field */
2702 static int hf_bgp_sr_policy_nlri_length
;
2703 static int hf_bgp_sr_policy_nlri_distinguisher
;
2704 static int hf_bgp_sr_policy_nlri_policy_color
;
2705 static int hf_bgp_sr_policy_nlri_endpoint_v4
;
2706 static int hf_bgp_sr_policy_nlri_endpoint_v6
;
2710 static int hf_bgp_ls_type
;
2711 static int hf_bgp_ls_length
;
2713 static int hf_bgp_ls_nlri
;
2714 static int hf_bgp_ls_safi128_nlri
;
2715 static int hf_bgp_ls_safi128_nlri_route_distinguisher
;
2716 static int hf_bgp_ls_safi128_nlri_route_distinguisher_type
;
2717 static int hf_bgp_ls_safi128_nlri_route_dist_admin_asnum_2
;
2718 static int hf_bgp_ls_safi128_nlri_route_dist_admin_ipv4
;
2719 static int hf_bgp_ls_safi128_nlri_route_dist_admin_asnum_4
;
2720 static int hf_bgp_ls_safi128_nlri_route_dist_asnum_2
;
2721 static int hf_bgp_ls_safi128_nlri_route_dist_asnum_4
;
2722 static int hf_bgp_ls_nlri_type
;
2723 static int hf_bgp_ls_nlri_length
;
2724 static int hf_bgp_ls_nlri_link_nlri_type
;
2725 static int hf_bgp_ls_nlri_link_descriptors_tlv
;
2726 static int hf_bgp_ls_nlri_prefix_descriptors_tlv
;
2727 static int hf_bgp_ls_nlri_srv6_sid_descriptors_tlv
;
2728 static int hf_bgp_ls_nlri_link_local_identifier
;
2729 static int hf_bgp_ls_nlri_link_remote_identifier
;
2730 static int hf_bgp_ls_nlri_ipv4_interface_address
;
2731 static int hf_bgp_ls_nlri_ipv4_neighbor_address
;
2732 static int hf_bgp_ls_nlri_ipv6_interface_address
;
2733 static int hf_bgp_ls_nlri_ipv6_neighbor_address
;
2734 static int hf_bgp_ls_nlri_multi_topology_id
;
2735 static int hf_bgp_ls_nlri_ospf_route_type
;
2736 static int hf_bgp_ls_nlri_ip_reachability_prefix_ip
;
2737 static int hf_bgp_ls_nlri_ip_reachability_prefix_ip6
;
2738 static int hf_bgp_ls_nlri_node_nlri_type
;
2739 static int hf_bgp_ls_nlri_node_protocol_id
;
2740 static int hf_bgp_ls_nlri_node_identifier
;
2741 static int hf_bgp_ls_ipv4_topology_prefix_nlri_type
;
2742 static int hf_bgp_ls_ipv6_topology_prefix_nlri_type
;
2743 static int hf_bgp_ls_nlri_srv6_sid_nlri_type
;
2746 static int hf_bgp_ls_sr_tlv_capabilities
;
2747 static int hf_bgp_ls_sr_tlv_capabilities_range_size
;
2748 static int hf_bgp_ls_sr_tlv_capabilities_flags
;
2749 static int hf_bgp_ls_sr_tlv_capabilities_flags_i
;
2750 static int hf_bgp_ls_sr_tlv_capabilities_flags_v
;
2751 static int hf_bgp_ls_sr_tlv_capabilities_flags_h
;
2752 static int hf_bgp_ls_sr_tlv_capabilities_flags_reserved
;
2753 static int hf_bgp_ls_sr_tlv_capabilities_sid_label
;
2754 static int hf_bgp_ls_sr_tlv_capabilities_sid_index
;
2755 static int hf_bgp_ls_sr_tlv_algorithm
;
2756 static int hf_bgp_ls_sr_tlv_algorithm_value
;
2757 static int hf_bgp_ls_sr_tlv_local_block
; /* 1036 */
2758 static int hf_bgp_ls_sr_tlv_local_block_flags
;
2759 static int hf_bgp_ls_sr_tlv_local_block_range_size
;
2760 static int hf_bgp_ls_sr_tlv_local_block_sid_label
;
2761 static int hf_bgp_ls_sr_tlv_local_block_sid_index
;
2762 static int hf_bgp_ls_sr_tlv_srv6_cap
; /* 1037 */
2763 static int hf_bgp_ls_sr_tlv_srv6_cap_flags
;
2764 static int hf_bgp_ls_sr_tlv_srv6_cap_flags_o
;
2765 static int hf_bgp_ls_sr_tlv_srv6_cap_flags_reserved
;
2766 static int hf_bgp_ls_sr_tlv_srv6_cap_reserved
;
2767 static int hf_bgp_ls_sr_tlv_flex_algo_def
; /* 1039 */
2768 static int hf_bgp_ls_sr_tlv_flex_algo_algorithm
;
2769 static int hf_bgp_ls_sr_tlv_flex_algo_metric_type
;
2770 static int hf_bgp_ls_sr_tlv_flex_algo_calc_type
;
2771 static int hf_bgp_ls_sr_tlv_flex_algo_priority
;
2772 static int hf_bgp_ls_sr_tlv_flex_algo_exc_any_affinity
; /* 1040 */
2773 static int hf_bgp_ls_sr_tlv_flex_algo_inc_any_affinity
; /* 1041 */
2774 static int hf_bgp_ls_sr_tlv_flex_algo_inc_all_affinity
; /* 1042 */
2775 static int hf_bgp_ls_sr_tlv_prefix_sid
;
2776 static int hf_bgp_ls_sr_tlv_prefix_sid_flags
;
2777 static int hf_bgp_ls_sr_tlv_prefix_sid_flags_r
;
2778 static int hf_bgp_ls_sr_tlv_prefix_sid_flags_n
;
2779 static int hf_bgp_ls_sr_tlv_prefix_sid_flags_np
;
2780 static int hf_bgp_ls_sr_tlv_prefix_sid_flags_p
;
2781 static int hf_bgp_ls_sr_tlv_prefix_sid_flags_m
;
2782 static int hf_bgp_ls_sr_tlv_prefix_sid_flags_e
;
2783 static int hf_bgp_ls_sr_tlv_prefix_sid_flags_v
;
2784 static int hf_bgp_ls_sr_tlv_prefix_sid_flags_l
;
2785 static int hf_bgp_ls_sr_tlv_prefix_sid_algo
;
2786 static int hf_bgp_ls_sr_tlv_prefix_sid_label
;
2787 static int hf_bgp_ls_sr_tlv_prefix_sid_index
;
2788 static int hf_bgp_ls_sr_tlv_adjacency_sid
;
2789 static int hf_bgp_ls_sr_tlv_adjacency_sid_flags
;
2790 static int hf_bgp_ls_sr_tlv_adjacency_sid_flags_fi
;
2791 static int hf_bgp_ls_sr_tlv_adjacency_sid_flags_bi
;
2792 static int hf_bgp_ls_sr_tlv_adjacency_sid_flags_bo
;
2793 static int hf_bgp_ls_sr_tlv_adjacency_sid_flags_vi
;
2794 static int hf_bgp_ls_sr_tlv_adjacency_sid_flags_vo
;
2795 static int hf_bgp_ls_sr_tlv_adjacency_sid_flags_li
;
2796 static int hf_bgp_ls_sr_tlv_adjacency_sid_flags_lo
;
2797 static int hf_bgp_ls_sr_tlv_adjacency_sid_flags_si
;
2798 static int hf_bgp_ls_sr_tlv_adjacency_sid_flags_go
;
2799 static int hf_bgp_ls_sr_tlv_adjacency_sid_flags_pi
;
2800 static int hf_bgp_ls_sr_tlv_adjacency_sid_flags_po
;
2801 static int hf_bgp_ls_sr_tlv_adjacency_sid_weight
;
2802 static int hf_bgp_ls_sr_tlv_adjacency_sid_label
;
2803 static int hf_bgp_ls_sr_tlv_adjacency_sid_index
;
2804 static int hf_bgp_ls_sr_tlv_peer_node_sid
; /* 1101 */
2805 static int hf_bgp_ls_sr_tlv_peer_adj_sid
; /* 1102 */
2806 static int hf_bgp_ls_sr_tlv_peer_set_sid
; /* 1103 */
2807 static int hf_bgp_ls_sr_tlv_peer_sid_flags
;
2808 static int hf_bgp_ls_sr_tlv_peer_sid_flags_v
;
2809 static int hf_bgp_ls_sr_tlv_peer_sid_flags_l
;
2810 static int hf_bgp_ls_sr_tlv_peer_sid_flags_b
;
2811 static int hf_bgp_ls_sr_tlv_peer_sid_flags_p
;
2812 static int hf_bgp_ls_sr_tlv_peer_sid_weight
;
2813 static int hf_bgp_ls_sr_tlv_peer_sid_label
;
2814 static int hf_bgp_ls_sr_tlv_peer_sid_index
;
2815 static int hf_bgp_ls_sr_tlv_srv6_endx_sid
; /* 1106 */
2816 static int hf_bgp_ls_sr_tlv_srv6_lan_endx_sid
; /* 1107 */
2817 static int hf_bgp_ls_sr_tlv_srv6_endx_sid_endpoint_behavior
;
2818 static int hf_bgp_ls_sr_tlv_srv6_endx_sid_flags
;
2819 static int hf_bgp_ls_sr_tlv_srv6_endx_sid_flags_b
;
2820 static int hf_bgp_ls_sr_tlv_srv6_endx_sid_flags_s
;
2821 static int hf_bgp_ls_sr_tlv_srv6_endx_sid_flags_p
;
2822 static int hf_bgp_ls_sr_tlv_srv6_endx_sid_flags_reserved
;
2823 static int hf_bgp_ls_sr_tlv_srv6_endx_sid_algo
;
2824 static int hf_bgp_ls_sr_tlv_srv6_endx_sid_weight
;
2825 static int hf_bgp_ls_sr_tlv_srv6_endx_sid_reserved
;
2826 static int hf_bgp_ls_sr_tlv_srv6_endx_sid_neighbor_isis
;
2827 static int hf_bgp_ls_sr_tlv_srv6_endx_sid_neighbor_ospf
;
2828 static int hf_bgp_ls_sr_tlv_srv6_endx_sid_sid
;
2829 static int hf_bgp_ls_sr_tlv_srv6_locator
; /* 1162 */
2830 static int hf_bgp_ls_sr_tlv_srv6_locator_flags
;
2831 static int hf_bgp_ls_sr_tlv_srv6_locator_flags_d
;
2832 static int hf_bgp_ls_sr_tlv_srv6_locator_flags_reserved
;
2833 static int hf_bgp_ls_sr_tlv_srv6_locator_algo
;
2834 static int hf_bgp_ls_sr_tlv_srv6_locator_reserved
;
2835 static int hf_bgp_ls_sr_tlv_srv6_locator_metric
;
2836 static int hf_bgp_ls_sr_tlv_prefix_attr_flags
; /* 1170 */
2837 static int hf_bgp_ls_sr_tlv_prefix_attr_flags_flags
;
2838 static int hf_bgp_ls_sr_tlv_prefix_attr_flags_flags_unknown
;
2839 static int hf_bgp_ls_sr_tlv_prefix_attr_flags_flags_ao
;
2840 static int hf_bgp_ls_sr_tlv_prefix_attr_flags_flags_no
;
2841 static int hf_bgp_ls_sr_tlv_prefix_attr_flags_flags_eo
;
2842 static int hf_bgp_ls_sr_tlv_prefix_attr_flags_flags_xi
;
2843 static int hf_bgp_ls_sr_tlv_prefix_attr_flags_flags_ri
;
2844 static int hf_bgp_ls_sr_tlv_prefix_attr_flags_flags_ni
;
2845 static int hf_bgp_ls_sr_tlv_prefix_attr_flags_flags_ei
;
2846 static int hf_bgp_ls_sr_tlv_source_router_id
; /* 1171 */
2847 static int hf_bgp_ls_sr_tlv_srv6_endpoint_behavior
; /* 1250 */
2848 static int hf_bgp_ls_sr_tlv_srv6_endpoint_behavior_endpoint_behavior
;
2849 static int hf_bgp_ls_sr_tlv_srv6_endpoint_behavior_flags
;
2850 static int hf_bgp_ls_sr_tlv_srv6_endpoint_behavior_algo
;
2851 static int hf_bgp_ls_sr_tlv_srv6_sid_struct
; /* 1252 */
2852 static int hf_bgp_ls_sr_tlv_srv6_sid_struct_lb_len
;
2853 static int hf_bgp_ls_sr_tlv_srv6_sid_struct_ln_len
;
2854 static int hf_bgp_ls_sr_tlv_srv6_sid_struct_fun_len
;
2855 static int hf_bgp_ls_sr_tlv_srv6_sid_struct_arg_len
;
2857 static int * const srv6_endx_sid_flags
[] = {
2858 &hf_bgp_ls_sr_tlv_srv6_endx_sid_flags_b
,
2859 &hf_bgp_ls_sr_tlv_srv6_endx_sid_flags_s
,
2860 &hf_bgp_ls_sr_tlv_srv6_endx_sid_flags_p
,
2861 &hf_bgp_ls_sr_tlv_srv6_endx_sid_flags_reserved
,
2866 static int hf_bgp_ls_tlv_local_node_descriptors
; /* 256 */
2867 static int hf_bgp_ls_tlv_remote_node_descriptors
; /* 257 */
2868 static int hf_bgp_ls_tlv_link_local_remote_identifiers
; /* 258 */
2869 static int hf_bgp_ls_tlv_ipv4_interface_address
; /* 259 */
2870 static int hf_bgp_ls_tlv_ipv4_neighbor_address
; /* 260 */
2871 static int hf_bgp_ls_tlv_ipv6_interface_address
; /* 261 */
2872 static int hf_bgp_ls_tlv_ipv6_neighbor_address
; /* 262 */
2873 static int hf_bgp_ls_tlv_multi_topology_id
; /* 263 */
2874 static int hf_bgp_ls_tlv_ospf_route_type
; /* 264 */
2875 static int hf_bgp_ls_tlv_ip_reachability_information
; /* 265 */
2876 static int hf_bgp_ls_tlv_node_msd
; /* 266 */
2877 static int hf_bgp_ls_tlv_link_msd
; /* 267 */
2878 static int hf_bgp_ls_tlv_igp_msd_type
;
2879 static int hf_bgp_ls_tlv_igp_msd_value
;
2881 static int hf_bgp_ls_tlv_autonomous_system
; /* 512 */
2882 static int hf_bgp_ls_tlv_autonomous_system_id
;
2883 static int hf_bgp_ls_tlv_bgp_ls_identifier
; /* 513 */
2884 static int hf_bgp_ls_tlv_bgp_ls_identifier_id
;
2885 static int hf_bgp_ls_tlv_area_id
; /* 514 */
2886 static int hf_bgp_ls_tlv_area_id_id
;
2887 static int hf_bgp_ls_tlv_igp_router
; /* 515 */
2888 static int hf_bgp_ls_tlv_igp_router_id
;
2889 static int hf_bgp_ls_tlv_bgp_router_id
; /* 516 */
2890 static int hf_bgp_ls_tlv_bgp_router_id_id
;
2891 static int hf_bgp_ls_tlv_srv6_sid_info
; /* 518 */
2892 static int hf_bgp_ls_tlv_srv6_sid_info_sid
;
2894 static int hf_bgp_ls_tlv_node_flags_bits
; /* 1024 */
2895 static int hf_bgp_ls_tlv_opaque_node_properties
; /* 1025 */
2896 static int hf_bgp_ls_tlv_opaque_node_properties_value
;
2897 static int hf_bgp_ls_tlv_node_name
; /* 1026 */
2898 static int hf_bgp_ls_tlv_node_name_value
;
2899 static int hf_bgp_ls_tlv_is_is_area_identifier
; /* 1027 */
2900 static int hf_bgp_ls_tlv_is_is_area_identifier_value
;
2901 static int hf_bgp_ls_tlv_ipv4_router_id_of_local_node
; /* 1028 */
2902 static int hf_bgp_ls_tlv_ipv4_router_id_value
;
2903 static int hf_bgp_ls_tlv_ipv6_router_id_value
;
2904 static int hf_bgp_ls_tlv_ipv6_router_id_of_local_node
; /* 1029 */
2905 static int hf_bgp_ls_tlv_ipv4_router_id_of_remote_node
; /* 1030 */
2906 static int hf_bgp_ls_tlv_ipv6_router_id_of_remote_node
; /* 1031 */
2908 static int hf_bgp_ls_tlv_administrative_group_color
; /* 1088 */
2909 static int hf_bgp_ls_tlv_administrative_group_color_value
;
2910 static int hf_bgp_ls_tlv_administrative_group
;
2911 static int hf_bgp_ls_tlv_max_link_bandwidth
; /* 1089 */
2912 static int hf_bgp_ls_tlv_max_reservable_link_bandwidth
; /* 1090 */
2913 static int hf_bgp_ls_tlv_unreserved_bandwidth
; /* 1091 */
2914 static int hf_bgp_ls_bandwidth_value
;
2915 static int hf_bgp_ls_tlv_te_default_metric
; /* 1092 */
2916 static int hf_bgp_ls_tlv_te_default_metric_value_old
;
2917 static int hf_bgp_ls_tlv_te_default_metric_value
;
2918 static int hf_bgp_ls_tlv_link_protection_type
; /* 1093 */
2919 static int hf_bgp_ls_tlv_link_protection_type_value
;
2920 static int hf_bgp_ls_tlv_mpls_protocol_mask
; /* 1094 */
2921 static int hf_bgp_ls_tlv_metric
; /* 1095 */
2922 static int hf_bgp_ls_tlv_metric_value1
;
2923 static int hf_bgp_ls_tlv_metric_value2
;
2924 static int hf_bgp_ls_tlv_metric_value3
;
2925 static int hf_bgp_ls_tlv_shared_risk_link_group
; /* 1096 */
2926 static int hf_bgp_ls_tlv_shared_risk_link_group_value
;
2927 static int hf_bgp_ls_tlv_opaque_link_attribute
; /* 1097 */
2928 static int hf_bgp_ls_tlv_opaque_link_attribute_value
;
2929 static int hf_bgp_ls_tlv_link_name_attribute
; /* 1098 */
2930 static int hf_bgp_ls_tlv_link_name_attribute_value
;
2931 static int hf_bgp_ls_tlv_app_spec_link_attrs
; /* 1122 */
2932 static int hf_bgp_ls_tlv_app_spec_link_attrs_sabm_len
;
2933 static int hf_bgp_ls_tlv_app_spec_link_attrs_udabm_len
;
2934 static int hf_bgp_ls_tlv_app_spec_link_attrs_reserved
;
2935 static int hf_bgp_ls_tlv_app_spec_link_attrs_sabm
;
2936 static int hf_bgp_ls_tlv_app_spec_link_attrs_sabm_r
;
2937 static int hf_bgp_ls_tlv_app_spec_link_attrs_sabm_s
;
2938 static int hf_bgp_ls_tlv_app_spec_link_attrs_sabm_f
;
2939 static int hf_bgp_ls_tlv_app_spec_link_attrs_sabm_x
;
2940 static int hf_bgp_ls_tlv_app_spec_link_attrs_udabm
;
2942 static int hf_bgp_ls_tlv_igp_flags
; /* 1152 */
2943 static int hf_bgp_ls_tlv_route_tag
; /* 1153 */
2944 static int hf_bgp_ls_tlv_route_tag_value
;
2945 static int hf_bgp_ls_tlv_route_extended_tag
; /* 1154 */
2946 static int hf_bgp_ls_tlv_route_extended_tag_value
;
2947 static int hf_bgp_ls_tlv_prefix_metric
; /* 1155 */
2948 static int hf_bgp_ls_tlv_prefix_metric_value
;
2949 static int hf_bgp_ls_ospf_forwarding_address
; /* 1156 */
2950 static int hf_bgp_ls_ospf_forwarding_address_ipv4_address
;
2951 static int hf_bgp_ls_ospf_forwarding_address_ipv6_address
;
2952 static int hf_bgp_ls_opaque_prefix_attribute
; /* 1157 */
2953 static int hf_bgp_ls_opaque_prefix_attribute_value
;
2954 static int hf_bgp_ls_extended_administrative_group
; /* 1173 */
2955 static int hf_bgp_ls_extended_administrative_group_value
;
2958 /* Link Protection Types */
2959 static int hf_bgp_ls_link_protection_type_extra_traffic
;
2960 static int hf_bgp_ls_link_protection_type_unprotected
;
2961 static int hf_bgp_ls_link_protection_type_shared
;
2962 static int hf_bgp_ls_link_protection_type_dedicated_1to1
;
2963 static int hf_bgp_ls_link_protection_type_dedicated_1plus1
;
2964 static int hf_bgp_ls_link_protection_type_enhanced
;
2965 /* MPLS Protocol Mask flags */
2966 static int hf_bgp_ls_mpls_protocol_mask_flag_l
;
2967 static int hf_bgp_ls_mpls_protocol_mask_flag_r
;
2968 /* BGP-LS IGP Flags */
2969 static int hf_bgp_ls_igp_flags_flag_d
;
2970 /* Node Flag Bits TLV's flags */
2971 static int hf_bgp_ls_node_flag_bits_overload
;
2972 static int hf_bgp_ls_node_flag_bits_attached
;
2973 static int hf_bgp_ls_node_flag_bits_external
;
2974 static int hf_bgp_ls_node_flag_bits_abr
;
2976 /* RFC8669 BGP Prefix-SID header field */
2977 static int hf_bgp_prefix_sid_unknown
;
2978 static int hf_bgp_prefix_sid_label_index
;
2979 static int hf_bgp_prefix_sid_label_index_value
;
2980 static int hf_bgp_prefix_sid_label_index_flags
;
2981 static int hf_bgp_prefix_sid_originator_srgb
;
2982 static int hf_bgp_prefix_sid_originator_srgb_blocks
;
2983 static int hf_bgp_prefix_sid_originator_srgb_block
;
2984 static int hf_bgp_prefix_sid_originator_srgb_flags
;
2985 static int hf_bgp_prefix_sid_originator_srgb_base
;
2986 static int hf_bgp_prefix_sid_originator_srgb_range
;
2987 static int hf_bgp_prefix_sid_type
;
2988 static int hf_bgp_prefix_sid_length
;
2989 static int hf_bgp_prefix_sid_value
;
2990 static int hf_bgp_prefix_sid_reserved
;
2992 /* draft-ietf-bess-srv6-services-05 header field */
2993 static int hf_bgp_prefix_sid_srv6_l3vpn
;
2994 static int hf_bgp_prefix_sid_srv6_l3vpn_sub_tlvs
;
2995 static int hf_bgp_prefix_sid_srv6_l3vpn_sub_tlv
;
2996 static int hf_bgp_prefix_sid_srv6_l3vpn_sub_tlv_type
;
2997 static int hf_bgp_prefix_sid_srv6_l3vpn_sub_tlv_length
;
2998 static int hf_bgp_prefix_sid_srv6_l3vpn_sub_tlv_value
;
2999 static int hf_bgp_prefix_sid_srv6_l3vpn_sub_tlv_reserved
;
3000 static int hf_bgp_prefix_sid_srv6_l3vpn_sid_value
;
3001 static int hf_bgp_prefix_sid_srv6_l3vpn_sid_flags
;
3002 static int hf_bgp_prefix_sid_srv6_l3vpn_srv6_endpoint_behavior
;
3003 static int hf_bgp_prefix_sid_srv6_l3vpn_reserved
;
3004 static int hf_bgp_prefix_sid_srv6_l3vpn_sub_sub_tlvs
;
3005 static int hf_bgp_prefix_sid_srv6_l3vpn_sub_sub_tlv
;
3006 static int hf_bgp_prefix_sid_srv6_l3vpn_sub_sub_tlv_type
;
3007 static int hf_bgp_prefix_sid_srv6_l3vpn_sub_sub_tlv_length
;
3008 static int hf_bgp_prefix_sid_srv6_l3vpn_sub_sub_tlv_value
;
3009 static int hf_bgp_prefix_sid_srv6_l3vpn_sid_locator_block_len
;
3010 static int hf_bgp_prefix_sid_srv6_l3vpn_sid_locator_node_len
;
3011 static int hf_bgp_prefix_sid_srv6_l3vpn_sid_func_len
;
3012 static int hf_bgp_prefix_sid_srv6_l3vpn_sid_arg_len
;
3013 static int hf_bgp_prefix_sid_srv6_l3vpn_sid_trans_len
;
3014 static int hf_bgp_prefix_sid_srv6_l3vpn_sid_trans_offset
;
3015 static int hf_bgp_prefix_sid_srv6_l2vpn
;
3016 static int hf_bgp_prefix_sid_srv6_l2vpn_sub_tlvs
;
3017 static int hf_bgp_prefix_sid_srv6_l2vpn_sub_tlv
;
3018 static int hf_bgp_prefix_sid_srv6_l2vpn_sub_tlv_type
;
3019 static int hf_bgp_prefix_sid_srv6_l2vpn_sub_tlv_length
;
3020 static int hf_bgp_prefix_sid_srv6_l2vpn_sub_tlv_value
;
3021 static int hf_bgp_prefix_sid_srv6_l2vpn_sub_tlv_reserved
;
3022 static int hf_bgp_prefix_sid_srv6_l2vpn_sid_value
;
3023 static int hf_bgp_prefix_sid_srv6_l2vpn_sid_flags
;
3024 static int hf_bgp_prefix_sid_srv6_l2vpn_srv6_endpoint_behavior
;
3025 static int hf_bgp_prefix_sid_srv6_l2vpn_reserved
;
3026 static int hf_bgp_prefix_sid_srv6_l2vpn_sub_sub_tlvs
;
3027 static int hf_bgp_prefix_sid_srv6_l2vpn_sub_sub_tlv
;
3028 static int hf_bgp_prefix_sid_srv6_l2vpn_sub_sub_tlv_type
;
3029 static int hf_bgp_prefix_sid_srv6_l2vpn_sub_sub_tlv_length
;
3030 static int hf_bgp_prefix_sid_srv6_l2vpn_sub_sub_tlv_value
;
3031 static int hf_bgp_prefix_sid_srv6_l2vpn_sid_locator_block_len
;
3032 static int hf_bgp_prefix_sid_srv6_l2vpn_sid_locator_node_len
;
3033 static int hf_bgp_prefix_sid_srv6_l2vpn_sid_func_len
;
3034 static int hf_bgp_prefix_sid_srv6_l2vpn_sid_arg_len
;
3035 static int hf_bgp_prefix_sid_srv6_l2vpn_sid_trans_len
;
3036 static int hf_bgp_prefix_sid_srv6_l2vpn_sid_trans_offset
;
3038 /* BGP flow spec nlri header field */
3040 static int hf_bgp_flowspec_nlri_t
;
3041 static int hf_bgp_flowspec_nlri_route_distinguisher
;
3042 static int hf_bgp_flowspec_nlri_route_distinguisher_type
;
3043 static int hf_bgp_flowspec_nlri_route_dist_admin_asnum_2
;
3044 static int hf_bgp_flowspec_nlri_route_dist_admin_ipv4
;
3045 static int hf_bgp_flowspec_nlri_route_dist_admin_asnum_4
;
3046 static int hf_bgp_flowspec_nlri_route_dist_asnum_2
;
3047 static int hf_bgp_flowspec_nlri_route_dist_asnum_4
;
3048 static int hf_bgp_flowspec_nlri_filter
;
3049 static int hf_bgp_flowspec_nlri_filter_type
;
3050 static int hf_bgp_flowspec_nlri_length
;
3051 static int hf_bgp_flowspec_nlri_dst_pref_ipv4
;
3052 static int hf_bgp_flowspec_nlri_src_pref_ipv4
;
3053 static int hf_bgp_flowspec_nlri_op_flags
;
3054 static int hf_bgp_flowspec_nlri_op_eol
;
3055 static int hf_bgp_flowspec_nlri_op_and
;
3056 static int hf_bgp_flowspec_nlri_op_val_len
;
3057 static int hf_bgp_flowspec_nlri_op_un_bit4
;
3058 static int hf_bgp_flowspec_nlri_op_un_bit5
;
3059 static int hf_bgp_flowspec_nlri_op_lt
;
3060 static int hf_bgp_flowspec_nlri_op_gt
;
3061 static int hf_bgp_flowspec_nlri_op_eq
;
3062 static int hf_bgp_flowspec_nlri_dec_val_8
;
3063 static int hf_bgp_flowspec_nlri_dec_val_16
;
3064 static int hf_bgp_flowspec_nlri_dec_val_32
;
3065 static int hf_bgp_flowspec_nlri_dec_val_64
;
3066 static int hf_bgp_flowspec_nlri_op_flg_not
;
3067 static int hf_bgp_flowspec_nlri_op_flg_match
;
3068 static int hf_bgp_flowspec_nlri_tcp_flags
;
3069 static int hf_bgp_flowspec_nlri_tcp_flags_cwr
;
3070 static int hf_bgp_flowspec_nlri_tcp_flags_ecn
;
3071 static int hf_bgp_flowspec_nlri_tcp_flags_urg
;
3072 static int hf_bgp_flowspec_nlri_tcp_flags_ack
;
3073 static int hf_bgp_flowspec_nlri_tcp_flags_push
;
3074 static int hf_bgp_flowspec_nlri_tcp_flags_reset
;
3075 static int hf_bgp_flowspec_nlri_tcp_flags_syn
;
3076 static int hf_bgp_flowspec_nlri_tcp_flags_fin
;
3077 static int hf_bgp_flowspec_nlri_fflag
;
3078 static int hf_bgp_flowspec_nlri_fflag_lf
;
3079 static int hf_bgp_flowspec_nlri_fflag_ff
;
3080 static int hf_bgp_flowspec_nlri_fflag_isf
;
3081 static int hf_bgp_flowspec_nlri_fflag_df
;
3082 static int hf_bgp_flowspec_nlri_dscp
;
3083 static int hf_bgp_flowspec_nlri_src_ipv6_pref
;
3084 static int hf_bgp_flowspec_nlri_dst_ipv6_pref
;
3085 static int hf_bgp_flowspec_nlri_ipv6_pref_len
;
3086 static int hf_bgp_flowspec_nlri_ipv6_pref_offset
;
3088 /* BGP update safi ndt nlri draft-nalawade-idr-mdt-safi-03 */
3090 static int hf_bgp_mdt_nlri_safi_rd
;
3091 static int hf_bgp_mdt_nlri_safi_ipv4_addr
;
3092 static int hf_bgp_mdt_nlri_safi_group_addr
;
3094 /* BGP update extended community header field */
3096 static int hf_bgp_ext_communities
;
3097 static int hf_bgp_ext_community
;
3098 static int hf_bgp_ext_com_type_auth
;
3099 static int hf_bgp_ext_com_type_tran
;
3101 static int hf_bgp_ext_com_type_high
;
3102 static int hf_bgp_ext_com_stype_low_unknown
;
3103 static int hf_bgp_ext_com_stype_tr_evpn
;
3104 static int hf_bgp_ext_com_stype_tr_as2
;
3105 static int hf_bgp_ext_com_stype_ntr_as2
;
3106 static int hf_bgp_ext_com_stype_tr_as4
;
3107 static int hf_bgp_ext_com_stype_ntr_as4
;
3108 static int hf_bgp_ext_com_stype_tr_IP4
;
3109 static int hf_bgp_ext_com_stype_ntr_IP4
;
3110 static int hf_bgp_ext_com_stype_tr_opaque
;
3111 static int hf_bgp_ext_com_stype_ntr_opaque
;
3112 static int hf_bgp_ext_com_tunnel_type
;
3113 static int hf_bgp_ext_com_stype_tr_mup
;
3114 static int hf_bgp_ext_com_stype_tr_exp
;
3115 static int hf_bgp_ext_com_stype_tr_exp_2
;
3116 static int hf_bgp_ext_com_stype_tr_exp_3
;
3118 static int hf_bgp_ext_com_value_as2
;
3119 static int hf_bgp_ext_com_value_as4
;
3120 static int hf_bgp_ext_com_value_IP4
;
3121 static int hf_bgp_ext_com_value_an2
;
3122 static int hf_bgp_ext_com_value_an4
;
3123 static int hf_bgp_ext_com_value_raw
;
3124 static int hf_bgp_ext_com_value_link_bw
;
3125 static int hf_bgp_ext_com_value_ospf_rt_area
;
3126 static int hf_bgp_ext_com_value_ospf_rt_type
;
3127 static int hf_bgp_ext_com_value_ospf_rt_options
;
3128 static int hf_bgp_ext_com_value_ospf_rt_options_mt
;
3129 static int hf_bgp_ext_com_value_ospf_rid
;
3130 static int hf_bgp_ext_com_value_fs_remark
;
3131 static int hf_bgp_ext_com_local_admin_flags
;
3132 static int hf_bgp_ext_com_local_admin_auto_derived_flag
;
3133 static int hf_bgp_ext_com_local_admin_type
;
3134 static int hf_bgp_ext_com_local_admin_domain_id
;
3135 static int hf_bgp_ext_com_local_admin_service_id
;
3137 /* BGP QoS propagation draft-knoll-idr-qos-attribute */
3139 static int hf_bgp_ext_com_qos_flags
;
3140 static int hf_bgp_ext_com_qos_flags_remarking
;
3141 static int hf_bgp_ext_com_qos_flags_ignore_remarking
;
3142 static int hf_bgp_ext_com_qos_flags_agg_marking
;
3143 static int hf_bgp_ext_com_cos_flags
;
3144 static int hf_bgp_ext_com_cos_flags_be
;
3145 static int hf_bgp_ext_com_cos_flags_ef
;
3146 static int hf_bgp_ext_com_cos_flags_af
;
3147 static int hf_bgp_ext_com_cos_flags_le
;
3148 static int hf_bgp_ext_com_qos_set_number
;
3149 static int hf_bgp_ext_com_qos_tech_type
;
3150 static int hf_bgp_ext_com_qos_marking_o
;
3151 static int hf_bgp_ext_com_qos_marking_a
;
3152 static int hf_bgp_ext_com_qos_default_to_zero
;
3154 /* BGP Flow spec extended community RFC 5575 */
3156 static int hf_bgp_ext_com_flow_rate_float
;
3157 static int hf_bgp_ext_com_flow_act_allset
;
3158 static int hf_bgp_ext_com_flow_act_term_act
;
3159 static int hf_bgp_ext_com_flow_act_samp_act
;
3161 /* BGP L2 extended community RFC 4761, RFC 6624 */
3162 /* draft-ietf-l2vpn-vpls-multihoming */
3164 static int hf_bgp_ext_com_l2_encaps
;
3165 static int hf_bgp_ext_com_l2_c_flags
;
3166 static int hf_bgp_ext_com_l2_mtu
;
3167 static int hf_bgp_ext_com_l2_flag_d
;
3168 static int hf_bgp_ext_com_l2_flag_z1
;
3169 static int hf_bgp_ext_com_l2_flag_f
;
3170 static int hf_bgp_ext_com_l2_flag_z345
;
3171 static int hf_bgp_ext_com_l2_flag_c
;
3172 static int hf_bgp_ext_com_l2_flag_s
;
3173 static int hf_bgp_ext_com_l2_esi_label_flag
;
3174 static int hf_bgp_ext_com_evpn_mmac_flag
;
3175 static int hf_bgp_ext_com_evpn_mmac_seq
;
3176 static int hf_bgp_ext_com_evpn_esirt
;
3177 static int hf_bgp_ext_com_evpn_routermac
;
3178 static int hf_bgp_ext_com_evpn_mmac_flag_sticky
;
3180 /* BGP E-Tree Info extended community RFC 7796 */
3182 static int hf_bgp_ext_com_etree_flags
;
3183 static int hf_bgp_ext_com_etree_root_vlan
;
3184 static int hf_bgp_ext_com_etree_leaf_vlan
;
3185 static int hf_bgp_ext_com_etree_flag_reserved
;
3186 static int hf_bgp_ext_com_etree_flag_p
;
3187 static int hf_bgp_ext_com_etree_flag_v
;
3189 /* VPWS Support in EVPN RFC 8214 */
3190 /* draft-yu-bess-evpn-l2-attributes-04 */
3192 static int hf_bgp_ext_com_evpn_l2attr_flags
;
3193 static int hf_bgp_ext_com_evpn_l2attr_flag_reserved
;
3194 static int hf_bgp_ext_com_evpn_l2attr_flag_ci
;
3195 static int hf_bgp_ext_com_evpn_l2attr_flag_f
;
3196 static int hf_bgp_ext_com_evpn_l2attr_flag_c
;
3197 static int hf_bgp_ext_com_evpn_l2attr_flag_p
;
3198 static int hf_bgp_ext_com_evpn_l2attr_flag_b
;
3199 static int hf_bgp_ext_com_evpn_l2attr_l2_mtu
;
3200 static int hf_bgp_ext_com_evpn_l2attr_reserved
;
3202 /* E-Tree RFC8317 */
3204 static int hf_bgp_ext_com_evpn_etree_flags
;
3205 static int hf_bgp_ext_com_evpn_etree_flag_reserved
;
3206 static int hf_bgp_ext_com_evpn_etree_flag_l
;
3207 static int hf_bgp_ext_com_evpn_etree_reserved
;
3209 /* BGP Cost Community */
3211 static int hf_bgp_ext_com_cost_poi
;
3212 static int hf_bgp_ext_com_cost_cid
;
3213 static int hf_bgp_ext_com_cost_cost
;
3214 static int hf_bgp_ext_com_cost_cid_rep
;
3216 /* EIGRP route attributes extended communities */
3218 static int hf_bgp_ext_com_stype_tr_exp_eigrp
;
3219 static int hf_bgp_ext_com_eigrp_flags
;
3220 static int hf_bgp_ext_com_eigrp_flags_rt
;
3221 static int hf_bgp_ext_com_eigrp_rtag
;
3222 static int hf_bgp_ext_com_eigrp_asn
;
3223 static int hf_bgp_ext_com_eigrp_delay
;
3224 static int hf_bgp_ext_com_eigrp_rly
;
3225 static int hf_bgp_ext_com_eigrp_hops
;
3226 static int hf_bgp_ext_com_eigrp_bw
;
3227 static int hf_bgp_ext_com_eigrp_load
;
3228 static int hf_bgp_ext_com_eigrp_mtu
;
3229 static int hf_bgp_ext_com_eigrp_rid
;
3230 static int hf_bgp_ext_com_eigrp_e_asn
;
3231 static int hf_bgp_ext_com_eigrp_e_rid
;
3232 static int hf_bgp_ext_com_eigrp_e_pid
;
3233 static int hf_bgp_ext_com_eigrp_e_m
;
3235 /* MUP extended community */
3237 static int hf_bgp_ext_com_mup_segment_id2
;
3238 static int hf_bgp_ext_com_mup_segment_id4
;
3240 /* RFC8571 BGP-LS Advertisement of IGP TE Metric Extensions */
3241 static int hf_bgp_ls_igp_te_metric_flags
;
3242 static int hf_bgp_ls_igp_te_metric_flags_a
;
3243 static int hf_bgp_ls_igp_te_metric_flags_reserved
;
3244 static int hf_bgp_ls_igp_te_metric_delay
;
3245 static int hf_bgp_ls_igp_te_metric_delay_value
;
3246 static int hf_bgp_ls_igp_te_metric_delay_min_max
;
3247 static int hf_bgp_ls_igp_te_metric_delay_min
;
3248 static int hf_bgp_ls_igp_te_metric_delay_max
;
3249 static int hf_bgp_ls_igp_te_metric_delay_variation
;
3250 static int hf_bgp_ls_igp_te_metric_delay_variation_value
;
3251 static int hf_bgp_ls_igp_te_metric_link_loss
;
3252 static int hf_bgp_ls_igp_te_metric_link_loss_value
;
3253 static int hf_bgp_ls_igp_te_metric_bandwidth_residual
;
3254 static int hf_bgp_ls_igp_te_metric_bandwidth_residual_value
;
3255 static int hf_bgp_ls_igp_te_metric_bandwidth_available
;
3256 static int hf_bgp_ls_igp_te_metric_bandwidth_available_value
;
3257 static int hf_bgp_ls_igp_te_metric_bandwidth_utilized
;
3258 static int hf_bgp_ls_igp_te_metric_bandwidth_utilized_value
;
3259 static int hf_bgp_ls_igp_te_metric_reserved
;
3261 /* draft-mpmz-bess-mup-safi-03 */
3262 static int hf_bgp_mup_nlri
;
3263 static int hf_bgp_mup_nlri_at
;
3264 static int hf_bgp_mup_nlri_rt
;
3265 static int hf_bgp_mup_nlri_len
;
3266 static int hf_bgp_mup_nlri_rd
;
3267 static int hf_bgp_mup_nlri_prefixlen
;
3268 static int hf_bgp_mup_nlri_ip_prefix
;
3269 static int hf_bgp_mup_nlri_ipv6_prefix
;
3270 static int hf_bgp_mup_nlri_ip_addr
;
3271 static int hf_bgp_mup_nlri_ipv6_addr
;
3272 static int hf_bgp_mup_nlri_3gpp_5g_type1_st_route
;
3273 static int hf_bgp_mup_nlri_3gpp_5g_teid
;
3274 static int hf_bgp_mup_nlri_3gpp_5g_qfi
;
3275 static int hf_bgp_mup_nlri_3gpp_5g_ep_addr_len
;
3276 static int hf_bgp_mup_nlri_3gpp_5g_ep_ip_addr
;
3277 static int hf_bgp_mup_nlri_3gpp_5g_ep_ipv6_addr
;
3278 static int hf_bgp_mup_nlri_3gpp_5g_source_addr_len
;
3279 static int hf_bgp_mup_nlri_3gpp_5g_source_ip_addr
;
3280 static int hf_bgp_mup_nlri_3gpp_5g_source_ipv6_addr
;
3281 static int hf_bgp_mup_nlri_3gpp_5g_type2_st_route
;
3282 static int hf_bgp_mup_nlri_ep_len
;
3283 static int hf_bgp_mup_nlri_ep_ip_addr
;
3284 static int hf_bgp_mup_nlri_ep_ipv6_addr
;
3285 static int hf_bgp_mup_nlri_3gpp_5g_ep_teid
;
3286 static int hf_bgp_mup_nlri_unknown_data
;
3288 static int * const ls_igp_te_metric_flags
[] = {
3289 &hf_bgp_ls_igp_te_metric_flags_a
,
3290 &hf_bgp_ls_igp_te_metric_flags_reserved
,
3295 static int ett_bgp_prefix
;
3296 static int ett_bgp_unfeas
;
3297 static int ett_bgp_attrs
;
3298 static int ett_bgp_attr
;
3299 static int ett_bgp_attr_flags
;
3300 static int ett_bgp_mp_nhna
;
3301 static int ett_bgp_mp_reach_nlri
;
3302 static int ett_bgp_mp_unreach_nlri
;
3303 static int ett_bgp_mp_snpa
;
3304 static int ett_bgp_nlri
;
3305 static int ett_bgp_open
;
3306 static int ett_bgp_update
;
3307 static int ett_bgp_notification
;
3308 static int ett_bgp_route_refresh
; /* ROUTE-REFRESH message tree */
3309 static int ett_bgp_capability
;
3310 static int ett_bgp_as_path_segment
;
3311 static int ett_bgp_as_path_segment_asn
;
3312 static int ett_bgp_communities
;
3313 static int ett_bgp_community
;
3314 static int ett_bgp_cluster_list
; /* cluster list tree */
3315 static int ett_bgp_options
; /* optional parameters tree */
3316 static int ett_bgp_option
; /* an optional parameter tree */
3317 static int ett_bgp_options_ext
;
3318 static int ett_bgp_cap
; /* an cap parameter tree */
3319 static int ett_bgp_extended_communities
; /* extended communities list tree */
3320 static int ett_bgp_extended_community
; /* extended community tree for each community of BGP update */
3321 static int ett_bgp_ext_com_type
; /* Extended Community Type High tree (IANA, Transitive bits) */
3322 static int ett_bgp_extended_com_fspec_redir
; /* extended communities BGP flow act redirect */
3323 static int ett_bgp_ext_com_flags
; /* extended communities flags tree */
3324 static int ett_bgp_ext_com_l2_flags
; /* extended communities tree for l2 services flags */
3325 static int ett_bgp_ext_com_etree_flags
;
3326 static int ett_bgp_ext_com_evpn_mmac_flags
;
3327 static int ett_bgp_ext_com_evpn_l2attr_flags
;
3328 static int ett_bgp_ext_com_evpn_etree_flags
;
3329 static int ett_bgp_ext_com_cost_cid
; /* Cost community CommunityID tree (replace/evaluate after bit) */
3330 static int ett_bgp_ext_com_ospf_rt_opt
; /* Tree for Options bitfield of OSPF Route Type extended community */
3331 static int ett_bgp_ext_com_eigrp_flags
; /* Tree for EIGRP route flags */
3332 static int ett_bgp_ssa
; /* safi specific attribute */
3333 static int ett_bgp_ssa_subtree
; /* safi specific attribute Subtrees */
3334 static int ett_bgp_orf
; /* orf (outbound route filter) tree */
3335 static int ett_bgp_orf_entry
; /* orf entry tree */
3336 static int ett_bgp_mcast_vpn_nlri
;
3337 static int ett_bgp_flow_spec_nlri
;
3338 static int ett_bgp_flow_spec_nlri_filter
; /* tree decoding multiple op and value pairs */
3339 static int ett_bgp_flow_spec_nlri_op_flags
; /* tree decoding each op and val pair within the op and value set */
3340 static int ett_bgp_flow_spec_nlri_tcp
;
3341 static int ett_bgp_flow_spec_nlri_ff
;
3342 static int ett_bgp_tunnel_tlv
;
3343 static int ett_bgp_tunnel_tlv_subtree
;
3344 static int ett_bgp_tunnel_subtlv
;
3345 static int ett_bgp_tunnel_subtlv_subtree
;
3346 static int ett_bgp_link_state
;
3347 static int ett_bgp_evpn_nlri
;
3348 static int ett_bgp_evpn_nlri_esi
;
3349 static int ett_bgp_evpn_nlri_mc
;
3350 static int ett_bgp_mpls_labels
;
3351 static int ett_bgp_pmsi_tunnel_id
;
3352 static int ett_bgp_aigp_attr
;
3353 static int ett_bgp_large_communities
;
3354 static int ett_bgp_dpath
;
3355 static int ett_bgp_prefix_sid_originator_srgb
;
3356 static int ett_bgp_prefix_sid_originator_srgb_block
;
3357 static int ett_bgp_prefix_sid_originator_srgb_blocks
;
3358 static int ett_bgp_prefix_sid_label_index
;
3359 static int ett_bgp_prefix_sid_ipv6
;
3360 static int ett_bgp_bgpsec_secure_path
;
3361 static int ett_bgp_bgpsec_secure_path_segment
;
3362 static int ett_bgp_bgpsec_signature_block
;
3363 static int ett_bgp_bgpsec_signature_segment
;
3364 static int ett_bgp_vxlan
;
3365 static int ett_bgp_binding_sid
;
3366 static int ett_bgp_segment_list
;
3367 static int ett_bgp_prefix_sid_unknown
;
3368 static int ett_bgp_prefix_sid_srv6_l3vpn
;
3369 static int ett_bgp_prefix_sid_srv6_l3vpn_sub_tlvs
;
3370 static int ett_bgp_prefix_sid_srv6_l3vpn_sid_information
;
3371 static int ett_bgp_prefix_sid_srv6_l3vpn_sub_sub_tlvs
;
3372 static int ett_bgp_prefix_sid_srv6_l3vpn_sid_structure
;
3373 static int ett_bgp_prefix_sid_srv6_l3vpn_sid_unknown
;
3374 static int ett_bgp_prefix_sid_srv6_l3vpn_unknown
;
3375 static int ett_bgp_prefix_sid_srv6_l2vpn
;
3376 static int ett_bgp_prefix_sid_srv6_l2vpn_sub_tlvs
;
3377 static int ett_bgp_prefix_sid_srv6_l2vpn_sid_information
;
3378 static int ett_bgp_prefix_sid_srv6_l2vpn_sub_sub_tlvs
;
3379 static int ett_bgp_prefix_sid_srv6_l2vpn_sid_structure
;
3380 static int ett_bgp_prefix_sid_srv6_l2vpn_sid_unknown
;
3381 static int ett_bgp_prefix_sid_srv6_l2vpn_unknown
;
3382 static int ett_bgp_mup_nlri
;
3383 static int ett_bgp_mup_nlri_3gpp_5g_type1_st_route
;
3384 static int ett_bgp_mup_nlri_3gpp_5g_type2_st_route
;
3386 static expert_field ei_bgp_marker_invalid
;
3387 static expert_field ei_bgp_cap_len_bad
;
3388 static expert_field ei_bgp_cap_gr_helper_mode_only
;
3389 static expert_field ei_bgp_notify_minor_unknown
;
3390 static expert_field ei_bgp_route_refresh_orf_type_unknown
;
3391 static expert_field ei_bgp_length_invalid
;
3392 static expert_field ei_bgp_prefix_length_invalid
;
3393 static expert_field ei_bgp_afi_type_not_supported
;
3394 static expert_field ei_bgp_unknown_afi
;
3395 static expert_field ei_bgp_unknown_safi
;
3396 static expert_field ei_bgp_unknown_label_vpn
;
3397 static expert_field ei_bgp_ls_error
;
3398 static expert_field ei_bgp_ls_warn
;
3399 static expert_field ei_bgp_ext_com_len_bad
;
3400 static expert_field ei_bgp_attr_pmsi_opaque_type
;
3401 static expert_field ei_bgp_attr_pmsi_tunnel_type
;
3402 static expert_field ei_bgp_prefix_length_err
;
3403 static expert_field ei_bgp_attr_aigp_type
;
3404 static expert_field ei_bgp_attr_as_path_as_len_err
;
3405 static expert_field ei_bgp_next_hop_ipv6_scope
;
3406 static expert_field ei_bgp_next_hop_rd_nonzero
;
3408 static expert_field ei_bgp_evpn_nlri_rt_type_err
;
3409 static expert_field ei_bgp_evpn_nlri_rt_len_err
;
3410 static expert_field ei_bgp_evpn_nlri_esi_type_err
;
3411 static expert_field ei_bgp_evpn_nlri_rt4_no_ip
;
3413 static expert_field ei_bgp_mup_unknown_at
;
3414 static expert_field ei_bgp_mup_unknown_rt
;
3415 static expert_field ei_bgp_mup_nlri_addr_len_err
;
3417 /* desegmentation */
3418 static bool bgp_desegment
= true;
3420 static int bgp_asn_len
;
3422 /* FF: BGP-LS is just a collector of IGP link state information. Some
3423 fields are encoded "as-is" from the IGP, hence in order to dissect
3424 them properly we must be aware of their origin, e.g. IS-IS or OSPF.
3425 So, *before* dissecting LINK_STATE attributes we must get the
3426 'Protocol-ID' field that is present in the MP_[UN]REACH_NLRI
3427 attribute. The tricky thing is that there is no strict order
3428 for path attributes on the wire, hence we have to keep track
3429 of 1) the 'Protocol-ID' from the MP_[UN]REACH_NLRI and 2)
3430 the offset/len of the LINK_STATE attribute. We store them in
3431 per-packet proto_data and once we got both we are ready for the
3432 LINK_STATE attribute dissection.
3434 typedef struct _link_state_data
{
3435 /* Link/Node NLRI Protocol-ID (e.g. OSPF or IS-IS) */
3436 uint8_t protocol_id
;
3437 /* LINK_STATE attribute coordinates */
3438 int ostart
; /* offset at which the LINK_STATE path attribute starts */
3439 int oend
; /* offset at which the LINK_STATE path attribute ends */
3440 uint16_t tlen
; /* length of the LINK_STATE path attribute */
3442 bool link_state_attr_present
;
3443 /* tree where add LINK_STATE items */
3444 proto_tree
*subtree2
;
3447 #define LINK_STATE_DATA_KEY 0
3450 save_link_state_protocol_id(packet_info
*pinfo
, uint8_t protocol_id
) {
3451 link_state_data
*data
=
3452 (link_state_data
*)p_get_proto_data(pinfo
->pool
, pinfo
, proto_bgp
, LINK_STATE_DATA_KEY
);
3454 data
= wmem_new0(pinfo
->pool
, link_state_data
);
3458 data
->link_state_attr_present
= false;
3459 data
->subtree2
= NULL
;
3461 data
->protocol_id
= protocol_id
;
3462 p_add_proto_data(pinfo
->pool
, pinfo
, proto_bgp
, LINK_STATE_DATA_KEY
, data
);
3467 save_link_state_attr_position(packet_info
*pinfo
, int ostart
, int oend
, uint16_t tlen
, proto_tree
*subtree2
) {
3468 link_state_data
*data
=
3469 (link_state_data
*)p_get_proto_data(pinfo
->pool
, pinfo
, proto_bgp
, LINK_STATE_DATA_KEY
);
3471 data
= wmem_new0(pinfo
->pool
, link_state_data
);
3472 data
->protocol_id
= BGP_LS_NLRI_PROTO_ID_UNKNOWN
;
3474 data
->ostart
= ostart
;
3477 data
->link_state_attr_present
= true;
3478 data
->subtree2
= subtree2
;
3479 p_add_proto_data(pinfo
->pool
, pinfo
, proto_bgp
, LINK_STATE_DATA_KEY
, data
);
3483 static link_state_data
*
3484 load_link_state_data(packet_info
*pinfo
) {
3485 link_state_data
*data
=
3486 (link_state_data
*)p_get_proto_data(pinfo
->pool
, pinfo
, proto_bgp
, LINK_STATE_DATA_KEY
);
3490 typedef struct _path_attr_data
{
3491 bool encaps_community_present
;
3492 uint16_t encaps_tunnel_type
;
3495 #define PATH_ATTR_DATA_KEY 1
3498 save_path_attr_encaps_tunnel_type(packet_info
*pinfo
, uint32_t encaps_tunnel_type
) {
3499 path_attr_data
*data
=
3500 (path_attr_data
*)p_get_proto_data(wmem_file_scope(), pinfo
, proto_bgp
, PATH_ATTR_DATA_KEY
);
3502 data
= wmem_new0(wmem_file_scope(), path_attr_data
);
3504 data
->encaps_community_present
= true;
3505 data
->encaps_tunnel_type
= encaps_tunnel_type
;
3506 p_add_proto_data(wmem_file_scope(), pinfo
, proto_bgp
, PATH_ATTR_DATA_KEY
, data
);
3510 static path_attr_data
*
3511 load_path_attr_data(packet_info
*pinfo
) {
3512 path_attr_data
*data
=
3513 (path_attr_data
*)p_get_proto_data(wmem_file_scope(), pinfo
, proto_bgp
, PATH_ATTR_DATA_KEY
);
3517 typedef struct _afi_safi_data
{
3519 uint8_t safi
; /* offset at which the LINK_STATE path attribute starts */
3522 #define AFI_SAFI_DATA_KEY 2
3525 save_afi_safi_data(packet_info
*pinfo
, uint16_t afi
, uint8_t safi
) {
3526 afi_safi_data
*data
=
3527 (afi_safi_data
*)p_get_proto_data(wmem_file_scope(), pinfo
, proto_bgp
, AFI_SAFI_DATA_KEY
);
3529 data
= wmem_new0(wmem_file_scope(), afi_safi_data
);
3533 p_add_proto_data(wmem_file_scope(), pinfo
, proto_bgp
, AFI_SAFI_DATA_KEY
, data
);
3537 static afi_safi_data
*
3538 load_afi_safi_data(packet_info
*pinfo
) {
3539 afi_safi_data
*data
=
3540 (afi_safi_data
*)p_get_proto_data(wmem_file_scope(), pinfo
, proto_bgp
, AFI_SAFI_DATA_KEY
);
3545 * Detect IPv4/IPv6 prefixes conform to BGP Additional Path but NOT conform to standard BGP
3547 * A real BGP speaker would rely on the BGP Additional Path in the BGP Open messages.
3548 * But it is not suitable for a packet analyse because the BGP sessions are not supposed to
3549 * restart very often, and Open messages from both sides of the session would be needed
3550 * to determine the result of the capability negotiation.
3551 * Code inspired from the decode_prefix4 function
3554 detect_add_path_prefix46(tvbuff_t
*tvb
, int offset
, int end
, int max_bit_length
) {
3558 /* Must be compatible with BGP Additional Path */
3559 for (o
= offset
+ 4; o
< end
; o
+= 4) {
3560 prefix_len
= tvb_get_uint8(tvb
, o
);
3561 if( prefix_len
> max_bit_length
) {
3562 return 0; /* invalid prefix length - not BGP add-path */
3564 addr_len
= (prefix_len
+ 7) / 8;
3567 return 0; /* invalid offset - not BGP add-path */
3569 if (prefix_len
% 8) {
3570 /* detect bits set after the end of the prefix */
3571 if( tvb_get_uint8(tvb
, o
- 1 ) & (0xFF >> (prefix_len
% 8)) ) {
3572 return 0; /* invalid prefix content - not BGP add-path */
3576 /* Must NOT be compatible with standard BGP */
3577 for (o
= offset
; o
< end
; ) {
3578 prefix_len
= tvb_get_uint8(tvb
, o
);
3579 if( prefix_len
== 0 && end
- offset
> 1 ) {
3580 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 */
3582 if( prefix_len
> max_bit_length
) {
3583 return 1; /* invalid prefix length - may be BGP add-path */
3585 addr_len
= (prefix_len
+ 7) / 8;
3588 return 1; /* invalid offset - may be BGP add-path */
3590 if (prefix_len
% 8) {
3591 /* detect bits set after the end of the prefix */
3592 if( tvb_get_uint8(tvb
, o
- 1 ) & (0xFF >> (prefix_len
% 8)) ) {
3593 return 1; /* invalid prefix content - may be BGP add-path (or a bug) */
3597 return 0; /* valid - do not assume Additional Path */
3600 detect_add_path_prefix4(tvbuff_t
*tvb
, int offset
, int end
) {
3601 return detect_add_path_prefix46(tvb
, offset
, end
, 32);
3604 detect_add_path_prefix6(tvbuff_t
*tvb
, int offset
, int end
) {
3605 return detect_add_path_prefix46(tvb
, offset
, end
, 128);
3608 * Decode an IPv4 prefix with Path Identifier
3609 * Code inspired from the decode_prefix4 function
3612 decode_path_prefix4(proto_tree
*tree
, packet_info
*pinfo
, int hf_path_id
, int hf_addr
, tvbuff_t
*tvb
, int offset
,
3615 proto_tree
*prefix_tree
;
3616 ws_in4_addr ip_addr
; /* IP address */
3617 uint8_t plen
; /* prefix length */
3618 int length
; /* number of octets needed for prefix */
3619 uint32_t path_identifier
;
3622 /* snarf path identifier length and prefix */
3623 path_identifier
= tvb_get_ntohl(tvb
, offset
);
3624 plen
= tvb_get_uint8(tvb
, offset
+ 4);
3625 length
= tvb_get_ipv4_addr_with_prefix_len(tvb
, offset
+ 4 + 1, &ip_addr
, plen
);
3627 proto_tree_add_expert_format(tree
, pinfo
, &ei_bgp_length_invalid
, tvb
, offset
+ 4 , 1, "%s length %u invalid (> 32)",
3631 /* put prefix into protocol tree */
3632 set_address(&addr
, AT_IPv4
, 4, &ip_addr
);
3633 prefix_tree
= proto_tree_add_subtree_format(tree
, tvb
, offset
, 4 + 1 + length
,
3634 ett_bgp_prefix
, NULL
, "%s/%u PathId %u ",
3635 address_to_str(pinfo
->pool
, &addr
), plen
, path_identifier
);
3636 proto_tree_add_item(prefix_tree
, hf_path_id
, tvb
, offset
, 4, ENC_BIG_ENDIAN
);
3637 proto_tree_add_item(prefix_tree
, hf_bgp_prefix_length
, tvb
, offset
+ 4, 1, ENC_BIG_ENDIAN
);
3638 proto_tree_add_ipv4(prefix_tree
, hf_addr
, tvb
, offset
+ 4 + 1, length
, ip_addr
);
3639 return 4 + 1 + length
;
3643 * Decode an IPv4 prefix.
3646 decode_prefix4(proto_tree
*tree
, packet_info
*pinfo
, proto_item
*parent_item
, 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 */
3655 /* snarf length and prefix */
3656 plen
= tvb_get_uint8(tvb
, offset
);
3657 length
= tvb_get_ipv4_addr_with_prefix_len(tvb
, offset
+ 1, &ip_addr
, plen
);
3659 proto_tree_add_expert_format(tree
, pinfo
, &ei_bgp_length_invalid
, tvb
, offset
, 1, "%s length %u invalid (> 32)",
3664 /* put prefix into protocol tree */
3665 set_address(&addr
, AT_IPv4
, 4, &ip_addr
);
3666 prefix_tree
= proto_tree_add_subtree_format(tree
, tvb
, offset
,
3667 1 + length
, ett_bgp_prefix
, NULL
,
3668 "%s/%u", address_to_str(pinfo
->pool
, &addr
), plen
);
3670 proto_item_append_text(parent_item
, " (%s/%u)",
3671 address_to_str(pinfo
->pool
, &addr
), plen
);
3673 proto_tree_add_uint_format(prefix_tree
, hf_bgp_prefix_length
, tvb
, offset
, 1, plen
, "%s prefix length: %u",
3675 proto_tree_add_ipv4(prefix_tree
, hf_addr
, tvb
, offset
+ 1, length
, ip_addr
);
3680 * Decode an IPv6 prefix with path ID.
3683 decode_path_prefix6(proto_tree
*tree
, packet_info
*pinfo
, int hf_path_id
, int hf_addr
, tvbuff_t
*tvb
, int offset
,
3686 proto_tree
*prefix_tree
;
3687 uint32_t path_identifier
;
3688 ws_in6_addr addr
; /* IPv6 address */
3690 int plen
; /* prefix length */
3691 int length
; /* number of octets needed for prefix */
3693 /* snarf length and prefix */
3694 path_identifier
= tvb_get_ntohl(tvb
, offset
);
3695 plen
= tvb_get_uint8(tvb
, offset
+ 4);
3696 length
= tvb_get_ipv6_addr_with_prefix_len(tvb
, offset
+ 4 + 1, &addr
, plen
);
3698 proto_tree_add_expert_format(tree
, pinfo
, &ei_bgp_length_invalid
, tvb
, offset
+ 4, 1, "%s length %u invalid",
3703 /* put prefix into protocol tree */
3704 set_address(&addr_str
, AT_IPv6
, 16, addr
.bytes
);
3705 prefix_tree
= proto_tree_add_subtree_format(tree
, tvb
, offset
, 4 + 1 + length
,
3706 ett_bgp_prefix
, NULL
, "%s/%u PathId %u ",
3707 address_to_str(pinfo
->pool
, &addr_str
), plen
, path_identifier
);
3709 proto_tree_add_item(prefix_tree
, hf_path_id
, tvb
, offset
, 4, ENC_BIG_ENDIAN
);
3710 proto_tree_add_uint_format(prefix_tree
, hf_bgp_prefix_length
, tvb
, offset
+ 4, 1, plen
, "%s prefix length: %u",
3712 proto_tree_add_ipv6(prefix_tree
, hf_addr
, tvb
, offset
+ 4 + 1, length
, &addr
);
3714 return 4 + 1 + length
;
3718 * Decode an IPv6 prefix.
3721 decode_prefix6(proto_tree
*tree
, packet_info
*pinfo
, int hf_addr
, tvbuff_t
*tvb
, int offset
,
3722 uint16_t tlen
, const char *tag
)
3724 proto_tree
*prefix_tree
;
3725 ws_in6_addr addr
; /* IPv6 address */
3727 int plen
; /* prefix length */
3728 int length
; /* number of octets needed for prefix */
3730 /* snarf length and prefix */
3731 plen
= tvb_get_uint8(tvb
, offset
);
3732 length
= tvb_get_ipv6_addr_with_prefix_len(tvb
, offset
+ 1, &addr
, plen
);
3734 proto_tree_add_expert_format(tree
, pinfo
, &ei_bgp_length_invalid
, tvb
, offset
, 1, "%s length %u invalid",
3739 /* put prefix into protocol tree */
3740 set_address(&addr_str
, AT_IPv6
, 16, addr
.bytes
);
3741 prefix_tree
= proto_tree_add_subtree_format(tree
, tvb
, offset
,
3742 tlen
!= 0 ? tlen
: 1 + length
, ett_bgp_prefix
, NULL
, "%s/%u",
3743 address_to_str(pinfo
->pool
, &addr_str
), plen
);
3744 proto_tree_add_uint_format(prefix_tree
, hf_bgp_prefix_length
, tvb
, offset
, 1, plen
, "%s prefix length: %u",
3746 proto_tree_add_ipv6(prefix_tree
, hf_addr
, tvb
, offset
+ 1, length
, &addr
);
3751 decode_fspec_match_prefix6(proto_tree
*tree
, proto_item
*parent_item
, int hf_addr
,
3752 tvbuff_t
*tvb
, int offset
, uint16_t tlen
, packet_info
*pinfo
)
3754 proto_tree
*prefix_tree
;
3755 ws_in6_addr addr
; /* IPv6 address */
3757 int plen
; /* prefix length */
3758 int length
; /* number of octets needed for prefix */
3759 int poffset_place
= 1;
3760 int plength_place
= 0;
3762 /* snarf length and prefix */
3763 plen
= tvb_get_uint8(tvb
, offset
);
3764 if (plen
== 0) /* I should be facing a draft 04 version where the prefix offset is switched with length */
3766 plen
= tvb_get_uint8(tvb
, offset
+1);
3770 length
= tvb_get_ipv6_addr_with_prefix_len(tvb
, offset
+ 2, &addr
, plen
);
3772 expert_add_info_format(pinfo
, parent_item
, &ei_bgp_prefix_length_err
, "Length is invalid %u", plen
);
3776 /* put prefix into protocol tree */
3777 set_address(&addr_str
, AT_IPv6
, 16, addr
.bytes
);
3778 prefix_tree
= proto_tree_add_subtree_format(tree
, tvb
, offset
,
3779 tlen
!= 0 ? tlen
: 1 + length
, ett_bgp_prefix
, NULL
, "%s/%u",
3780 address_to_str(pinfo
->pool
, &addr_str
), plen
);
3781 proto_tree_add_item(prefix_tree
, hf_bgp_flowspec_nlri_ipv6_pref_len
, tvb
, offset
+ plength_place
, 1, ENC_BIG_ENDIAN
);
3782 proto_tree_add_item(prefix_tree
, hf_bgp_flowspec_nlri_ipv6_pref_offset
, tvb
, offset
+ poffset_place
, 1, ENC_BIG_ENDIAN
);
3783 proto_tree_add_ipv6(prefix_tree
, hf_addr
, tvb
, offset
+ 2, length
, &addr
);
3784 if (parent_item
!= NULL
)
3785 proto_item_append_text(parent_item
, " (%s/%u)",
3786 address_to_str(pinfo
->pool
, &addr_str
), plen
);
3791 decode_bgp_rd(wmem_allocator_t
*pool
, tvbuff_t
*tvb
, int offset
)
3794 wmem_strbuf_t
*strbuf
;
3796 rd_type
= tvb_get_ntohs(tvb
,offset
);
3797 strbuf
= wmem_strbuf_create(pool
);
3800 case FORMAT_AS2_LOC
:
3801 wmem_strbuf_append_printf(strbuf
, "%u:%u", tvb_get_ntohs(tvb
, offset
+ 2),
3802 tvb_get_ntohl(tvb
, offset
+ 4));
3805 wmem_strbuf_append_printf(strbuf
, "%s:%u", tvb_ip_to_str(pool
, tvb
, offset
+ 2),
3806 tvb_get_ntohs(tvb
, offset
+ 6));
3808 case FORMAT_AS4_LOC
:
3809 wmem_strbuf_append_printf(strbuf
, "%u:%u", tvb_get_ntohl(tvb
, offset
+ 2),
3810 tvb_get_ntohs(tvb
, offset
+ 6));
3813 wmem_strbuf_append_printf(strbuf
, "Unknown (0x%04x) RD type",rd_type
);
3815 } /* switch (rd_type) */
3817 return wmem_strbuf_get_str(strbuf
);
3821 decode_mcast_vpn_nlri_addresses(proto_tree
*tree
, tvbuff_t
*tvb
,
3826 /* Multicast Source Address */
3827 proto_tree_add_item(tree
, hf_bgp_mcast_vpn_nlri_source_length
, tvb
, offset
,
3829 addr_len
= tvb_get_uint8(tvb
, offset
);
3830 if (addr_len
!= 0 && addr_len
!= 32 && addr_len
!= 128)
3835 proto_tree_add_item(tree
, hf_bgp_mcast_vpn_nlri_source_addr_ipv4
, tvb
,
3836 offset
, 4, ENC_BIG_ENDIAN
);
3840 proto_tree_add_item(tree
, hf_bgp_mcast_vpn_nlri_source_addr_ipv6
, tvb
,
3841 offset
, 16, ENC_NA
);
3846 /* Multicast Group Address */
3847 proto_tree_add_item(tree
, hf_bgp_mcast_vpn_nlri_group_length
, tvb
, offset
,
3849 addr_len
= tvb_get_uint8(tvb
, offset
);
3850 if (addr_len
!= 0 && addr_len
!= 32 && addr_len
!= 128)
3855 proto_tree_add_item(tree
, hf_bgp_mcast_vpn_nlri_group_addr_ipv4
, tvb
,
3856 offset
, 4, ENC_BIG_ENDIAN
);
3860 proto_tree_add_item(tree
, hf_bgp_mcast_vpn_nlri_group_addr_ipv6
, tvb
,
3861 offset
, 16, ENC_NA
);
3870 * function to decode operator in BGP flow spec NLRI when it address decimal values (TCP ports, UDP ports, ports, ...)
3874 decode_bgp_flow_spec_dec_operator(proto_tree
*tree
, tvbuff_t
*tvb
, int offset
)
3876 static int * const flags
[] = {
3877 &hf_bgp_flowspec_nlri_op_eol
,
3878 &hf_bgp_flowspec_nlri_op_and
,
3879 &hf_bgp_flowspec_nlri_op_val_len
,
3880 &hf_bgp_flowspec_nlri_op_un_bit4
,
3881 &hf_bgp_flowspec_nlri_op_lt
,
3882 &hf_bgp_flowspec_nlri_op_gt
,
3883 &hf_bgp_flowspec_nlri_op_eq
,
3887 proto_tree_add_bitmask(tree
, tvb
, offset
, hf_bgp_flowspec_nlri_op_flags
, ett_bgp_flow_spec_nlri_op_flags
, flags
, ENC_NA
);
3891 * Decode an operator and decimal values of BGP flow spec NLRI
3894 decode_bgp_nlri_op_dec_value(proto_tree
*parent_tree
, proto_item
*parent_item
, tvbuff_t
*tvb
, int offset
)
3896 uint8_t nlri_operator
;
3897 unsigned cursor_op_val
=0;
3898 uint8_t value_len
=0;
3900 uint8_t shift_amount
=0;
3901 unsigned first_loop
=0;
3903 proto_item_append_text(parent_item
," (");
3906 nlri_operator
= tvb_get_uint8(tvb
, offset
+cursor_op_val
);
3907 shift_amount
= nlri_operator
&0x30;
3908 shift_amount
= shift_amount
>> 4;
3909 value_len
= 1 << shift_amount
; /* as written in RFC 5575 section 4 */
3910 /* call to a operator decode function */
3911 decode_bgp_flow_spec_dec_operator(parent_tree
, tvb
, offset
+cursor_op_val
);
3912 if (first_loop
== 0)
3914 /* If first operator we remove a white space and or (||) is not relevant */
3915 /* BGP flow spec NLRI operator bitmask */
3916 proto_item_append_text(parent_item
,"%s%s%s%s",
3917 ((nlri_operator
& BGPNLRI_FSPEC_AND_BIT
) == 0) ? "" : "&& ",
3918 ((nlri_operator
& BGPNLRI_FSPEC_GREATER_THAN
) == 0) ? "" : ">",
3919 ((nlri_operator
& BGPNLRI_FSPEC_LESS_THAN
) == 0) ? "" : "<",
3920 ((nlri_operator
& BGPNLRI_FSPEC_EQUAL
) == 0) ? "" : "=");
3925 proto_item_append_text(parent_item
," %s%s%s%s",
3926 ((nlri_operator
& BGPNLRI_FSPEC_AND_BIT
) == 0) ? "|| " : "&& ",
3927 ((nlri_operator
& BGPNLRI_FSPEC_GREATER_THAN
) == 0) ? "" : ">",
3928 ((nlri_operator
& BGPNLRI_FSPEC_LESS_THAN
) == 0) ? "" : "<",
3929 ((nlri_operator
& BGPNLRI_FSPEC_EQUAL
) == 0) ? "" : "=");
3931 cursor_op_val
++; /* we manage this operator we move to the value */
3932 switch (value_len
) {
3934 proto_tree_add_item(parent_tree
, hf_bgp_flowspec_nlri_dec_val_8
, tvb
, offset
+cursor_op_val
, 1,ENC_BIG_ENDIAN
);
3935 value
= tvb_get_uint8(tvb
,offset
+cursor_op_val
);
3938 proto_tree_add_item(parent_tree
, hf_bgp_flowspec_nlri_dec_val_16
, tvb
, offset
+cursor_op_val
, 2,ENC_BIG_ENDIAN
);
3939 value
= tvb_get_ntohs(tvb
,offset
+cursor_op_val
);
3942 proto_tree_add_item(parent_tree
, hf_bgp_flowspec_nlri_dec_val_32
, tvb
, offset
+cursor_op_val
, 4, ENC_BIG_ENDIAN
);
3943 value
= tvb_get_ntohl(tvb
,offset
+cursor_op_val
);
3946 proto_tree_add_item(parent_tree
, hf_bgp_flowspec_nlri_dec_val_64
, tvb
, offset
+cursor_op_val
, 8, ENC_BIG_ENDIAN
);
3951 cursor_op_val
= cursor_op_val
+ value_len
;
3952 proto_item_append_text(parent_item
,"%u", value
);
3953 } while ((nlri_operator
&BGPNLRI_FSPEC_END_OF_LST
) == 0);
3954 proto_item_append_text(parent_item
,")");
3955 return (cursor_op_val
);
3960 * function to decode operator in BGP flow spec NLRI when it address a bitmask values (TCP flags, fragmentation flags,...)
3964 decode_bgp_flow_spec_bitmask_operator(proto_tree
*tree
, tvbuff_t
*tvb
, int offset
)
3966 static int * const flags
[] = {
3967 &hf_bgp_flowspec_nlri_op_eol
,
3968 &hf_bgp_flowspec_nlri_op_and
,
3969 &hf_bgp_flowspec_nlri_op_val_len
,
3970 &hf_bgp_flowspec_nlri_op_un_bit4
,
3971 &hf_bgp_flowspec_nlri_op_un_bit5
,
3972 &hf_bgp_flowspec_nlri_op_flg_not
,
3973 &hf_bgp_flowspec_nlri_op_flg_match
,
3977 proto_tree_add_bitmask(tree
, tvb
, offset
, hf_bgp_flowspec_nlri_op_flags
, ett_bgp_flow_spec_nlri_op_flags
, flags
, ENC_NA
);
3981 * Decode an operator and tcp flags bitmask of BGP flow spec NLRI
3984 decode_bgp_nlri_op_tcpf_value(proto_tree
*parent_tree
, proto_item
*parent_item
, tvbuff_t
*tvb
, int offset
)
3986 uint8_t nlri_operator
;
3988 unsigned cursor_op_val
=0;
3989 uint8_t value_len
=0;
3990 uint8_t shift_amount
=0;
3991 unsigned first_loop
=0;
3993 static int * const nlri_tcp_flags
[] = {
3994 &hf_bgp_flowspec_nlri_tcp_flags_cwr
,
3995 &hf_bgp_flowspec_nlri_tcp_flags_ecn
,
3996 &hf_bgp_flowspec_nlri_tcp_flags_urg
,
3997 &hf_bgp_flowspec_nlri_tcp_flags_ack
,
3998 &hf_bgp_flowspec_nlri_tcp_flags_push
,
3999 &hf_bgp_flowspec_nlri_tcp_flags_reset
,
4000 &hf_bgp_flowspec_nlri_tcp_flags_syn
,
4001 &hf_bgp_flowspec_nlri_tcp_flags_fin
,
4005 proto_item_append_text(parent_item
," (");
4008 nlri_operator
= tvb_get_uint8(tvb
, offset
+cursor_op_val
);
4009 shift_amount
= nlri_operator
&0x30;
4010 shift_amount
= shift_amount
>> 4;
4011 value_len
= 1 << shift_amount
; /* as written in RFC 5575 section 4 */
4012 decode_bgp_flow_spec_bitmask_operator(parent_tree
, tvb
, offset
+cursor_op_val
); /* call to a operator decode function */
4013 if (first_loop
== 0)
4015 /* If first operator we remove a white space and or (||) is not relevant */
4016 proto_item_append_text(parent_item
,"%s%s%s%s",
4017 ((nlri_operator
& BGPNLRI_FSPEC_AND_BIT
) == 0) ? "" : "&& ",
4018 ((nlri_operator
& BGPNLRI_FSPEC_GREATER_THAN
) == 0) ? "" : ">",
4019 ((nlri_operator
& BGPNLRI_FSPEC_LESS_THAN
) == 0) ? "" : "<",
4020 ((nlri_operator
& BGPNLRI_FSPEC_EQUAL
) == 0) ? "" : "=");
4025 proto_item_append_text(parent_item
," %s%s%s%s",
4026 ((nlri_operator
& BGPNLRI_FSPEC_AND_BIT
) == 0) ? "|| " : "&& ",
4027 ((nlri_operator
& BGPNLRI_FSPEC_GREATER_THAN
) == 0) ? "" : ">",
4028 ((nlri_operator
& BGPNLRI_FSPEC_LESS_THAN
) == 0) ? "" : "<",
4029 ((nlri_operator
& BGPNLRI_FSPEC_EQUAL
) == 0) ? "" : "=");
4031 cursor_op_val
++; /* we manage this operator we move to the value */
4032 if (value_len
== 2) {
4033 cursor_op_val
++; /* tcp flags are coded over 2 bytes only the second one is significant, we move to second byte */
4036 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
);
4037 tcp_flags
= tvb_get_uint8(tvb
,offset
+cursor_op_val
);
4039 proto_item_append_text(parent_item
," %s%s%s%s%s%s",
4040 ((tcp_flags
& BGPNLRI_FSPEC_TH_URG
) == 0) ? "" : "U",
4041 ((tcp_flags
& BGPNLRI_FSPEC_TH_ACK
) == 0) ? "" : "A",
4042 ((tcp_flags
& BGPNLRI_FSPEC_TH_PUSH
) == 0) ? "" : "P",
4043 ((tcp_flags
& BGPNLRI_FSPEC_TH_RST
) == 0) ? "" : "R",
4044 ((tcp_flags
& BGPNLRI_FSPEC_TH_SYN
) == 0) ? "" : "S",
4045 ((tcp_flags
& BGPNLRI_FSPEC_TH_FIN
) == 0) ? "" : "F");
4046 cursor_op_val
= cursor_op_val
+ value_len
;
4047 } while ((nlri_operator
&BGPNLRI_FSPEC_END_OF_LST
) == 0);
4048 proto_item_append_text(parent_item
,")");
4049 return (cursor_op_val
);
4054 * Decode an operator and fragmentation bitmask of BGP flow spec NLRI
4057 decode_bgp_nlri_op_fflag_value(proto_tree
*parent_tree
, proto_item
*parent_item
, tvbuff_t
*tvb
, int offset
)
4059 uint8_t nlri_operator
;
4060 uint8_t fragment_flags
;
4061 unsigned cursor_op_val
=0;
4062 uint8_t value_len
=0;
4063 uint8_t shift_amount
=0;
4064 unsigned first_loop
=0;
4066 static int * const nlri_flags
[] = {
4067 &hf_bgp_flowspec_nlri_fflag_lf
,
4068 &hf_bgp_flowspec_nlri_fflag_ff
,
4069 &hf_bgp_flowspec_nlri_fflag_isf
,
4070 &hf_bgp_flowspec_nlri_fflag_df
,
4074 proto_item_append_text(parent_item
," (");
4077 nlri_operator
= tvb_get_uint8(tvb
, offset
+cursor_op_val
);
4078 shift_amount
= nlri_operator
&0x30;
4079 shift_amount
= shift_amount
>> 4;
4080 value_len
= 1 << shift_amount
; /* as written in RFC 5575 section 4 */
4081 /* call a function to decode operator addressing bitmaks */
4082 decode_bgp_flow_spec_bitmask_operator(parent_tree
, tvb
, offset
+cursor_op_val
);
4083 if (first_loop
== 0)
4085 /* If first operator we remove a white space and or (||) is not relevant */
4086 proto_item_append_text(parent_item
,"%s%s%s%s",
4087 ((nlri_operator
& BGPNLRI_FSPEC_AND_BIT
) == 0) ? "" : "&& ",
4088 ((nlri_operator
& BGPNLRI_FSPEC_GREATER_THAN
) == 0) ? "" : ">",
4089 ((nlri_operator
& BGPNLRI_FSPEC_LESS_THAN
) == 0) ? "" : "<",
4090 ((nlri_operator
& BGPNLRI_FSPEC_EQUAL
) == 0) ? "" : "=");
4095 proto_item_append_text(parent_item
," %s%s%s%s",
4096 ((nlri_operator
& BGPNLRI_FSPEC_AND_BIT
) == 0) ? "|| " : "&& ",
4097 ((nlri_operator
& BGPNLRI_FSPEC_GREATER_THAN
) == 0) ? "" : ">",
4098 ((nlri_operator
& BGPNLRI_FSPEC_LESS_THAN
) == 0) ? "" : "<",
4099 ((nlri_operator
& BGPNLRI_FSPEC_EQUAL
) == 0) ? "" : "=");
4101 cursor_op_val
++; /* we manage this operator we move to the value */
4102 if (value_len
!= 1) {
4103 return -1; /* frag flags have to be coded in 1 byte */
4105 fragment_flags
= tvb_get_uint8(tvb
,offset
+cursor_op_val
);
4107 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
);
4109 proto_item_append_text(parent_item
," %s%s%s%s",
4110 ((fragment_flags
& BGPNLRI_FSPEC_FG_DF
) == 0) ? "" : "DF",
4111 ((fragment_flags
& BGPNLRI_FSPEC_FG_ISF
) == 0) ? "" : "IsF",
4112 ((fragment_flags
& BGPNLRI_FSPEC_FG_FF
) == 0) ? "" : "FF",
4113 ((fragment_flags
& BGPNLRI_FSPEC_FG_LF
) == 0) ? "" : "LF");
4114 cursor_op_val
= cursor_op_val
+ value_len
;
4115 } while ((nlri_operator
&BGPNLRI_FSPEC_END_OF_LST
) == 0);
4116 proto_item_append_text(parent_item
,")");
4117 return (cursor_op_val
);
4121 * Decode an operator and DSCP value of BGP flow spec NLRI
4124 decode_bgp_nlri_op_dscp_value(proto_tree
*parent_tree
, proto_item
*parent_item
, tvbuff_t
*tvb
, int offset
)
4126 uint8_t nlri_operator
;
4128 unsigned cursor_op_val
=0;
4129 uint8_t value_len
=0;
4130 uint8_t shift_amount
=0;
4131 unsigned first_loop
=0;
4133 proto_item_append_text(parent_item
," (");
4136 nlri_operator
= tvb_get_uint8(tvb
, offset
+cursor_op_val
);
4137 shift_amount
= nlri_operator
&0x30;
4138 shift_amount
= shift_amount
>> 4;
4139 value_len
= 1 << shift_amount
; /* as written in RFC 5575 section 4 */
4140 /* call a function to decode operator addressing bitmaks */
4141 decode_bgp_flow_spec_bitmask_operator(parent_tree
, tvb
, offset
+cursor_op_val
);
4142 if (first_loop
== 0)
4144 /* If first operator we remove a white space and or (||) is not relevant */
4145 proto_item_append_text(parent_item
,"%s%s%s%s",
4146 ((nlri_operator
& BGPNLRI_FSPEC_AND_BIT
) == 0) ? "" : "&& ",
4147 ((nlri_operator
& BGPNLRI_FSPEC_GREATER_THAN
) == 0) ? "" : ">",
4148 ((nlri_operator
& BGPNLRI_FSPEC_LESS_THAN
) == 0) ? "" : "<",
4149 ((nlri_operator
& BGPNLRI_FSPEC_EQUAL
) == 0) ? "" : "=");
4154 proto_item_append_text(parent_item
," %s%s%s%s",
4155 ((nlri_operator
& BGPNLRI_FSPEC_AND_BIT
) == 0) ? "|| " : "&& ",
4156 ((nlri_operator
& BGPNLRI_FSPEC_GREATER_THAN
) == 0) ? "" : ">",
4157 ((nlri_operator
& BGPNLRI_FSPEC_LESS_THAN
) == 0) ? "" : "<",
4158 ((nlri_operator
& BGPNLRI_FSPEC_EQUAL
) == 0) ? "" : "=");
4160 cursor_op_val
++; /* we manage this operator we move to the value */
4161 if (value_len
!= 1) {
4162 return -1; /* frag flags have to be coded in 1 byte */
4164 dscp_flags
= tvb_get_uint8(tvb
,offset
+cursor_op_val
);
4165 proto_tree_add_item(parent_tree
, hf_bgp_flowspec_nlri_dscp
, tvb
, offset
+cursor_op_val
, 1, ENC_BIG_ENDIAN
);
4166 proto_item_append_text(parent_item
,"%s",val_to_str_ext_const(dscp_flags
,&dscp_vals_ext
, "Unknown DSCP"));
4167 cursor_op_val
= cursor_op_val
+ value_len
;
4168 } while ((nlri_operator
&BGPNLRI_FSPEC_END_OF_LST
) == 0);
4169 proto_item_append_text(parent_item
,")");
4170 return (cursor_op_val
);
4176 * Decode an FLOWSPEC nlri as define in RFC 5575
4179 decode_flowspec_nlri(proto_tree
*tree
, tvbuff_t
*tvb
, int offset
, uint16_t afi
, uint8_t safi
, packet_info
*pinfo
)
4181 unsigned tot_flow_len
; /* total length of the flow spec NLRI */
4182 unsigned offset_len
; /* offset of the flow spec NLRI itself could be 1 or 2 bytes */
4183 unsigned cursor_fspec
; /* cursor to move into flow spec nlri */
4184 int filter_len
= -1;
4188 proto_item
*filter_item
;
4189 proto_item
*disting_item
;
4190 proto_tree
*nlri_tree
;
4191 proto_tree
*disting_tree
;
4192 proto_tree
*filter_tree
;
4195 if (afi
!= AFNUM_INET
&& afi
!= AFNUM_INET6
)
4197 expert_add_info(pinfo
, NULL
, &ei_bgp_afi_type_not_supported
);
4201 tot_flow_len
= tvb_get_uint8(tvb
, offset
);
4202 /* if nlri length is greater than 240 bytes, it is encoded over 2 bytes */
4203 /* with most significant nibble all in one. 240 is encoded 0xf0f0, 241 0xf0f1 */
4204 /* max possible value value is 4095 Oxffff */
4206 if (tot_flow_len
>= 240)
4208 len_16
= tvb_get_ntohs(tvb
, offset
);
4209 tot_flow_len
= len_16
& 0x0FFF; /* remove most significant nibble */
4215 item
= proto_tree_add_item(tree
, hf_bgp_flowspec_nlri_t
, tvb
, offset
,
4216 tot_flow_len
+offset_len
, ENC_NA
);
4217 proto_item_set_text(item
, "FLOW_SPEC_NLRI (%u byte%s)",
4218 tot_flow_len
+offset_len
, plurality(tot_flow_len
+offset_len
, "", "s"));
4220 nlri_tree
= proto_item_add_subtree(item
, ett_bgp_flow_spec_nlri
);
4222 proto_tree_add_uint(nlri_tree
, hf_bgp_flowspec_nlri_length
, tvb
, offset
,
4223 offset_len
, tot_flow_len
);
4225 offset
= offset
+ offset_len
;
4228 /* when SAFI is VPN Flow Spec, then write route distinguisher */
4229 if (safi
== SAFNUM_FSPEC_VPN_RULE
)
4231 disting_item
= proto_tree_add_item(nlri_tree
, hf_bgp_flowspec_nlri_route_distinguisher
,
4232 tvb
, offset
, BGP_ROUTE_DISTINGUISHER_SIZE
, ENC_NA
);
4233 disting_tree
= proto_item_add_subtree(disting_item
, ett_bgp_flow_spec_nlri
);
4234 proto_tree_add_item_ret_uint(disting_tree
, hf_bgp_flowspec_nlri_route_distinguisher_type
,
4235 tvb
, offset
, 2, ENC_BIG_ENDIAN
, &rd_type
);
4236 /* Route Distinguisher Type */
4238 case FORMAT_AS2_LOC
:
4239 proto_tree_add_item(disting_tree
, hf_bgp_flowspec_nlri_route_dist_admin_asnum_2
,
4240 tvb
, offset
+ 2, 2, ENC_BIG_ENDIAN
);
4241 proto_tree_add_item(disting_tree
, hf_bgp_flowspec_nlri_route_dist_asnum_4
,
4242 tvb
, offset
+ 4, 4, ENC_BIG_ENDIAN
);
4246 proto_tree_add_item(disting_tree
, hf_bgp_flowspec_nlri_route_dist_admin_ipv4
,
4247 tvb
, offset
+ 2, 4, ENC_BIG_ENDIAN
);
4248 proto_tree_add_item(disting_tree
, hf_bgp_flowspec_nlri_route_dist_asnum_2
,
4249 tvb
, offset
+ 6, 2, ENC_BIG_ENDIAN
);
4252 case FORMAT_AS4_LOC
:
4253 proto_tree_add_item(disting_tree
, hf_bgp_flowspec_nlri_route_dist_admin_asnum_4
,
4254 tvb
, offset
+ 2, 4, ENC_BIG_ENDIAN
);
4255 proto_tree_add_item(disting_tree
, hf_bgp_flowspec_nlri_route_dist_asnum_2
,
4256 tvb
, offset
+ 6, 2, ENC_BIG_ENDIAN
);
4260 expert_add_info_format(pinfo
, disting_tree
, &ei_bgp_length_invalid
,
4261 "Unknown Route Distinguisher type (%u)", rd_type
);
4263 cursor_fspec
+= BGP_ROUTE_DISTINGUISHER_SIZE
;
4266 while (cursor_fspec
< tot_flow_len
)
4268 filter_item
= proto_tree_add_item(nlri_tree
, hf_bgp_flowspec_nlri_filter
, tvb
, offset
+cursor_fspec
, 1, ENC_NA
);
4269 filter_tree
= proto_item_add_subtree(filter_item
, ett_bgp_flow_spec_nlri_filter
);
4270 proto_tree_add_item(filter_tree
, hf_bgp_flowspec_nlri_filter_type
, tvb
, offset
+cursor_fspec
, 1, ENC_BIG_ENDIAN
);
4271 proto_item_append_text(filter_item
, ": %s", val_to_str(tvb_get_uint8(tvb
,offset
+cursor_fspec
), flowspec_nlri_opvaluepair_type
, "Unknown filter %d"));
4272 switch (tvb_get_uint8(tvb
,offset
+cursor_fspec
)) {
4273 case BGPNLRI_FSPEC_DST_PFIX
:
4275 if (afi
== AFNUM_INET
)
4276 filter_len
= decode_prefix4(filter_tree
, pinfo
, filter_item
, hf_bgp_flowspec_nlri_dst_pref_ipv4
,
4277 tvb
, offset
+cursor_fspec
, "Destination IP filter");
4278 else /* AFNUM_INET6 */
4279 filter_len
= decode_fspec_match_prefix6(filter_tree
, filter_item
, hf_bgp_flowspec_nlri_dst_ipv6_pref
,
4280 tvb
, offset
+cursor_fspec
, 0, pinfo
);
4281 if (filter_len
== -1)
4282 cursor_fspec
= tot_flow_len
;
4284 case BGPNLRI_FSPEC_SRC_PFIX
:
4286 if (afi
== AFNUM_INET
)
4287 filter_len
= decode_prefix4(filter_tree
, pinfo
, filter_item
, hf_bgp_flowspec_nlri_src_pref_ipv4
,
4288 tvb
, offset
+cursor_fspec
, "Source IP filter");
4289 else /* AFNUM_INET6 */
4290 filter_len
= decode_fspec_match_prefix6(filter_tree
, filter_item
, hf_bgp_flowspec_nlri_src_ipv6_pref
,
4291 tvb
, offset
+cursor_fspec
, 0, pinfo
);
4292 if (filter_len
== -1)
4293 cursor_fspec
= tot_flow_len
;
4295 case BGPNLRI_FSPEC_IP_PROTO
:
4297 filter_len
= decode_bgp_nlri_op_dec_value(filter_tree
, filter_item
, tvb
, offset
+cursor_fspec
);
4299 case BGPNLRI_FSPEC_PORT
:
4301 filter_len
= decode_bgp_nlri_op_dec_value(filter_tree
, filter_item
, tvb
, offset
+cursor_fspec
);
4303 case BGPNLRI_FSPEC_DST_PORT
:
4305 filter_len
= decode_bgp_nlri_op_dec_value(filter_tree
, filter_item
, tvb
, offset
+cursor_fspec
);
4307 case BGPNLRI_FSPEC_SRC_PORT
:
4309 filter_len
= decode_bgp_nlri_op_dec_value(filter_tree
, filter_item
, tvb
, offset
+cursor_fspec
);
4311 case BGPNLRI_FSPEC_ICMP_TP
:
4313 filter_len
= decode_bgp_nlri_op_dec_value(filter_tree
, filter_item
, tvb
, offset
+cursor_fspec
);
4315 case BGPNLRI_FSPEC_ICMP_CD
:
4317 filter_len
= decode_bgp_nlri_op_dec_value(filter_tree
, filter_item
, tvb
, offset
+cursor_fspec
);
4319 case BGPNLRI_FSPEC_TCP_FLAGS
:
4321 filter_len
= decode_bgp_nlri_op_tcpf_value(filter_tree
, filter_item
, tvb
, offset
+cursor_fspec
);
4323 case BGPNLRI_FSPEC_PCK_LEN
:
4325 filter_len
= decode_bgp_nlri_op_dec_value(filter_tree
, filter_item
, tvb
, offset
+cursor_fspec
);
4327 case BGPNLRI_FSPEC_DSCP
:
4329 filter_len
= decode_bgp_nlri_op_dscp_value(filter_tree
, filter_item
, tvb
, offset
+cursor_fspec
);
4331 case BGPNLRI_FSPEC_FRAGMENT
:
4333 filter_len
= decode_bgp_nlri_op_fflag_value(filter_tree
, filter_item
, tvb
, offset
+cursor_fspec
);
4339 cursor_fspec
+= filter_len
;
4342 proto_item_set_len(filter_item
,filter_len
+1);
4344 return tot_flow_len
+offset_len
-1;
4348 * Decode an MCAST-VPN nlri as defined in draft-ietf-l3vpn-2547bis-mcast-bgp-08.txt .
4351 decode_mcast_vpn_nlri(proto_tree
*tree
, tvbuff_t
*tvb
, int offset
, uint16_t afi
, packet_info
*pinfo
)
4353 uint8_t route_type
, length
, ip_length
;
4355 proto_tree
*nlri_tree
;
4356 uint32_t route_key_length
;
4359 ip_length
= (afi
== AFNUM_INET
) ? 4 : 16;
4361 route_type
= tvb_get_uint8(tvb
, offset
);
4362 proto_tree_add_item(tree
, hf_bgp_mcast_vpn_nlri_route_type
, tvb
,
4363 offset
, 1, ENC_BIG_ENDIAN
);
4366 length
= tvb_get_uint8(tvb
, offset
);
4367 proto_tree_add_item(tree
, hf_bgp_mcast_vpn_nlri_length
, tvb
, offset
,
4371 if (length
> tvb_reported_length_remaining(tvb
, offset
))
4374 item
= proto_tree_add_item(tree
, hf_bgp_mcast_vpn_nlri_t
, tvb
, offset
,
4376 proto_item_set_text(item
, "%s (%u byte%s)",
4377 val_to_str_const(route_type
, mcast_vpn_route_type
, "Unknown"),
4378 length
, plurality(length
, "", "s"));
4380 nlri_tree
= proto_item_add_subtree(item
, ett_bgp_mcast_vpn_nlri
);
4382 switch (route_type
) {
4383 case MCAST_VPN_RTYPE_INTRA_AS_IPMSI_AD
:
4384 item
= proto_tree_add_item(nlri_tree
, hf_bgp_mcast_vpn_nlri_rd
, tvb
,
4385 offset
, BGP_ROUTE_DISTINGUISHER_SIZE
,
4387 proto_item_set_text(item
, "Route Distinguisher: %s",
4388 decode_bgp_rd(pinfo
->pool
, tvb
, offset
));
4389 offset
+= BGP_ROUTE_DISTINGUISHER_SIZE
;
4391 if (afi
== AFNUM_INET
)
4392 proto_tree_add_item(nlri_tree
,
4393 hf_bgp_mcast_vpn_nlri_origin_router_ipv4
,
4394 tvb
, offset
, ip_length
, ENC_BIG_ENDIAN
);
4396 proto_tree_add_item(nlri_tree
,
4397 hf_bgp_mcast_vpn_nlri_origin_router_ipv6
,
4398 tvb
, offset
, ip_length
, ENC_NA
);
4401 case MCAST_VPN_RTYPE_INTER_AS_IPMSI_AD
:
4402 item
= proto_tree_add_item(nlri_tree
, hf_bgp_mcast_vpn_nlri_rd
, tvb
,
4403 offset
, BGP_ROUTE_DISTINGUISHER_SIZE
,
4405 proto_item_set_text(item
, "Route Distinguisher: %s",
4406 decode_bgp_rd(pinfo
->pool
, tvb
, offset
));
4407 offset
+= BGP_ROUTE_DISTINGUISHER_SIZE
;
4409 proto_tree_add_item(nlri_tree
, hf_bgp_mcast_vpn_nlri_source_as
, tvb
,
4410 offset
, 4, ENC_BIG_ENDIAN
);
4413 case MCAST_VPN_RTYPE_SPMSI_AD
:
4414 item
= proto_tree_add_item(nlri_tree
, hf_bgp_mcast_vpn_nlri_rd
, tvb
,
4415 offset
, BGP_ROUTE_DISTINGUISHER_SIZE
,
4417 proto_item_set_text(item
, "Route Distinguisher: %s",
4418 decode_bgp_rd(pinfo
->pool
, tvb
, offset
));
4419 offset
+= BGP_ROUTE_DISTINGUISHER_SIZE
;
4421 ret
= decode_mcast_vpn_nlri_addresses(nlri_tree
, tvb
, offset
);
4427 if (afi
== AFNUM_INET
)
4428 proto_tree_add_item(nlri_tree
,
4429 hf_bgp_mcast_vpn_nlri_origin_router_ipv4
,
4430 tvb
, offset
, ip_length
, ENC_BIG_ENDIAN
);
4432 proto_tree_add_item(nlri_tree
,
4433 hf_bgp_mcast_vpn_nlri_origin_router_ipv6
,
4434 tvb
, offset
, ip_length
, ENC_NA
);
4437 case MCAST_VPN_RTYPE_LEAF_AD
:
4438 route_key_length
= length
- ip_length
;
4439 item
= proto_tree_add_item(nlri_tree
,
4440 hf_bgp_mcast_vpn_nlri_route_key
, tvb
,
4441 offset
, route_key_length
, ENC_NA
);
4442 proto_item_set_text(item
, "Route Key (%u byte%s)", route_key_length
,
4443 plurality(route_key_length
, "", "s"));
4444 offset
+= route_key_length
;
4446 if (afi
== AFNUM_INET
)
4447 proto_tree_add_item(nlri_tree
,
4448 hf_bgp_mcast_vpn_nlri_origin_router_ipv4
,
4449 tvb
, offset
, ip_length
, ENC_BIG_ENDIAN
);
4451 proto_tree_add_item(nlri_tree
,
4452 hf_bgp_mcast_vpn_nlri_origin_router_ipv6
,
4453 tvb
, offset
, ip_length
, ENC_NA
);
4456 case MCAST_VPN_RTYPE_SOURCE_ACTIVE_AD
:
4457 item
= proto_tree_add_item(nlri_tree
, hf_bgp_mcast_vpn_nlri_rd
, tvb
,
4458 offset
, BGP_ROUTE_DISTINGUISHER_SIZE
,
4460 proto_item_set_text(item
, "Route Distinguisher: %s",
4461 decode_bgp_rd(pinfo
->pool
, tvb
, offset
));
4462 offset
+= BGP_ROUTE_DISTINGUISHER_SIZE
;
4464 ret
= decode_mcast_vpn_nlri_addresses(nlri_tree
, tvb
, offset
);
4469 case MCAST_VPN_RTYPE_SHARED_TREE_JOIN
:
4470 case MCAST_VPN_RTYPE_SOURCE_TREE_JOIN
:
4471 item
= proto_tree_add_item(nlri_tree
, hf_bgp_mcast_vpn_nlri_rd
, tvb
,
4472 offset
, BGP_ROUTE_DISTINGUISHER_SIZE
,
4474 proto_item_set_text(item
, "Route Distinguisher: %s",
4475 decode_bgp_rd(pinfo
->pool
, tvb
, offset
));
4476 offset
+= BGP_ROUTE_DISTINGUISHER_SIZE
;
4478 proto_tree_add_item(nlri_tree
, hf_bgp_mcast_vpn_nlri_source_as
, tvb
,
4479 offset
, 4, ENC_BIG_ENDIAN
);
4482 ret
= decode_mcast_vpn_nlri_addresses(nlri_tree
, tvb
, offset
);
4488 /* route type field (1 byte) + length field (1 byte) + length */
4493 * Decode an SR Policy SAFI as defined in draft-ietf-idr-segment-routing-te-policy-08
4496 decode_sr_policy_nlri(proto_tree
*tree
, tvbuff_t
*tvb
, int offset
, uint16_t afi
)
4498 proto_tree_add_item(tree
, hf_bgp_sr_policy_nlri_length
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
4500 proto_tree_add_item(tree
, hf_bgp_sr_policy_nlri_distinguisher
, tvb
, offset
, 4, ENC_NA
);
4502 proto_tree_add_item(tree
, hf_bgp_sr_policy_nlri_policy_color
, tvb
, offset
, 4, ENC_NA
);
4504 if (afi
== AFNUM_INET
) {
4505 proto_tree_add_item(tree
, hf_bgp_sr_policy_nlri_endpoint_v4
, tvb
, offset
, 4, ENC_BIG_ENDIAN
);
4508 proto_tree_add_item(tree
, hf_bgp_sr_policy_nlri_endpoint_v6
, tvb
, offset
, 4, ENC_NA
);
4514 * Decodes an MDT-SAFI message.
4517 decode_mdt_safi(packet_info
*pinfo
, proto_tree
*tree
, tvbuff_t
*tvb
, int offset
)
4519 const unsigned ip_length
= 4;
4520 const unsigned mdt_safi_nlri_length_bits
= 128;
4521 unsigned length
; /* length in bits */
4522 int orig_offset
= offset
;
4525 length
= tvb_get_uint8(tvb
, offset
);
4526 if (length
!= mdt_safi_nlri_length_bits
)
4530 item
= proto_tree_add_item(tree
, hf_bgp_mdt_nlri_safi_rd
, tvb
,
4531 offset
, BGP_ROUTE_DISTINGUISHER_SIZE
, ENC_NA
);
4532 proto_item_set_text(item
, "Route Distinguisher: %s",
4533 decode_bgp_rd(pinfo
->pool
, tvb
, offset
));
4534 offset
+= BGP_ROUTE_DISTINGUISHER_SIZE
;
4536 proto_tree_add_item(tree
, hf_bgp_mdt_nlri_safi_ipv4_addr
, tvb
,
4537 offset
, ip_length
, ENC_BIG_ENDIAN
);
4538 offset
+= ip_length
;
4540 proto_tree_add_item(tree
, hf_bgp_mdt_nlri_safi_group_addr
, tvb
,
4541 offset
, ip_length
, ENC_BIG_ENDIAN
);
4542 offset
+= ip_length
;
4544 return offset
- orig_offset
;
4548 * Decode an MPLS label stack
4549 * XXX - We should change *buf to **buf, use wmem_alloc() and drop the buflen
4553 decode_MPLS_stack(tvbuff_t
*tvb
, int offset
, wmem_strbuf_t
*stack_strbuf
)
4555 uint32_t label_entry
; /* an MPLS label entry (label + COS field + stack bit */
4556 int indx
; /* index for the label stack */
4559 label_entry
= 0x000000 ;
4561 wmem_strbuf_truncate(stack_strbuf
, 0);
4563 while ((label_entry
& BGP_MPLS_BOTTOM_L_STACK
) == 0) {
4565 label_entry
= tvb_get_ntoh24(tvb
, indx
) ;
4567 /* withdrawn routes may contain 0 or 0x800000 in the first label */
4568 if((indx
== offset
)&&(label_entry
==0||label_entry
==0x800000)) {
4569 wmem_strbuf_append(stack_strbuf
, "0 (withdrawn)");
4573 wmem_strbuf_append_printf(stack_strbuf
, "%u%s", label_entry
>> 4,
4574 ((label_entry
& BGP_MPLS_BOTTOM_L_STACK
) == 0) ? "," : " (bottom)");
4579 return (indx
- offset
) / 3;
4583 decode_MPLS_stack_tree(tvbuff_t
*tvb
, int offset
, proto_tree
*parent_tree
)
4585 uint32_t label_entry
=0; /* an MPLS label entry (label + COS field + stack bit) */
4586 int indx
; /* index for the label stack */
4587 proto_tree
*labels_tree
=NULL
;
4588 proto_item
*labels_item
=NULL
;
4589 proto_item
*label_item
=NULL
;
4591 label_entry
= 0x000000 ;
4593 labels_item
= proto_tree_add_item(parent_tree
, hf_bgp_update_mpls_label
, tvb
, offset
, 3, ENC_NA
);
4594 proto_item_append_text(labels_item
, ": ");
4595 labels_tree
= proto_item_add_subtree(labels_item
, ett_bgp_mpls_labels
);
4596 while ((label_entry
& BGP_MPLS_BOTTOM_L_STACK
) == 0) {
4598 label_entry
= tvb_get_ntoh24(tvb
, indx
);
4599 label_item
= proto_tree_add_item(labels_tree
, hf_bgp_update_mpls_label_value
, tvb
, indx
, 3, ENC_BIG_ENDIAN
);
4600 /* withdrawn routes may contain 0 or 0x800000 in the first label */
4601 if((indx
== offset
)&&(label_entry
==0||label_entry
==0x800000)) {
4602 proto_item_append_text(labels_item
, " (withdrawn)");
4603 proto_item_append_text(label_item
, " (withdrawn)");
4607 proto_item_append_text(labels_item
, "%u%s", label_entry
>> 4,
4608 ((label_entry
& BGP_MPLS_BOTTOM_L_STACK
) == 0) ? "," : " (bottom)");
4609 proto_item_append_text(label_item
, "%u%s", label_entry
>> 4,
4610 ((label_entry
& BGP_MPLS_BOTTOM_L_STACK
) == 0) ? "," : " (bottom)");
4613 if ((label_entry
& BGP_MPLS_BOTTOM_L_STACK
) == 0) {
4614 /* real MPLS multi-label stack in BGP? - maybe later; for now, it must be a bogus packet */
4615 proto_item_append_text(labels_item
, " (BOGUS: Bottom of Stack NOT set!)");
4619 proto_item_set_len(labels_item
, (indx
- offset
));
4620 return (indx
- offset
) / 3;
4624 * Decode a multiprotocol next hop address that expected to be IPv4.
4625 * Returns 0 on failure (invalid length).
4628 decode_mp_next_hop_ipv4(tvbuff_t
*tvb
, proto_tree
*tree
, int offset
, packet_info
*pinfo _U_
, wmem_strbuf_t
*strbuf
, int nhlen
)
4632 proto_tree_add_item(tree
, hf_bgp_update_path_attribute_mp_reach_nlri_next_hop_ipv4
, tvb
, offset
, FT_IPv4_LEN
, ENC_BIG_ENDIAN
);
4633 wmem_strbuf_append(strbuf
, tvb_ip_to_str(pinfo
->pool
, tvb
, offset
));
4642 * Decode a multiprotocol next hop address expected to be VPN-IPv4.
4643 * Note that the Route Distinguisher is always 0. Returns 0 on failure
4647 decode_mp_next_hop_vpn_ipv4(tvbuff_t
*tvb
, proto_tree
*tree
, int offset
, packet_info
*pinfo
, wmem_strbuf_t
*strbuf
, int nhlen
)
4650 const char *rd_string
;
4653 case (BGP_ROUTE_DISTINGUISHER_SIZE
+ FT_IPv4_LEN
):
4654 rd_string
= decode_bgp_rd(pinfo
->pool
, tvb
, offset
);
4655 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
);
4656 if (tvb_memeql(tvb
, offset
, rd_zero
, BGP_ROUTE_DISTINGUISHER_SIZE
) != 0) {
4657 expert_add_info(pinfo
, ti
, &ei_bgp_next_hop_rd_nonzero
);
4659 wmem_strbuf_append_printf(strbuf
, " RD=%s", rd_string
);
4660 offset
+= BGP_ROUTE_DISTINGUISHER_SIZE
;
4661 proto_tree_add_item(tree
, hf_bgp_update_path_attribute_mp_reach_nlri_next_hop_ipv4
, tvb
, offset
, FT_IPv4_LEN
, ENC_BIG_ENDIAN
);
4662 wmem_strbuf_append_printf(strbuf
, " IPv4=%s", tvb_ip_to_str(pinfo
->pool
, tvb
, offset
));
4671 * Decode a multiprotocol next hop address that is expected to be IPv6,
4672 * optionally including a second, link-local, address, differentiating by
4673 * length. Returns 0 on failure (invalid length).
4676 decode_mp_next_hop_ipv6(tvbuff_t
*tvb
, proto_tree
*tree
, int offset
, packet_info
*pinfo
, wmem_strbuf_t
*strbuf
, int nhlen
)
4679 ws_in6_addr ipv6_addr
;
4680 char ipv6_buffer
[WS_INET6_ADDRSTRLEN
];
4684 proto_tree_add_item(tree
, hf_bgp_update_path_attribute_mp_reach_nlri_next_hop_ipv6
, tvb
, offset
, FT_IPv6_LEN
, ENC_NA
);
4685 wmem_strbuf_append(strbuf
, tvb_ip6_to_str(pinfo
->pool
, tvb
, offset
));
4687 case (2*FT_IPv6_LEN
):
4688 /* global address followed by link-local */
4689 proto_tree_add_item(tree
, hf_bgp_update_path_attribute_mp_reach_nlri_next_hop_ipv6
, tvb
, offset
, FT_IPv6_LEN
, ENC_NA
);
4690 wmem_strbuf_append_printf(strbuf
, "IPv6=%s", tvb_ip6_to_str(pinfo
->pool
, tvb
, offset
));
4691 offset
+= FT_IPv6_LEN
;
4692 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
);
4693 tvb_get_ipv6(tvb
, offset
, &ipv6_addr
);
4694 if (!in6_addr_is_linklocal(&ipv6_addr
)) {
4695 expert_add_info_format(pinfo
, ti
, &ei_bgp_next_hop_ipv6_scope
, "Invalid IPv6 address scope; should be link-local");
4697 ip6_to_str_buf(&ipv6_addr
, ipv6_buffer
, WS_INET6_ADDRSTRLEN
);
4698 wmem_strbuf_append_printf(strbuf
, " Link-local=%s", ipv6_buffer
);
4707 * Decode a multiprotocol next hop address that is expected to be VPN-IPv6,
4708 * optionally including a second, link-local, address. Note that the Route
4709 * Distinguisher is always 0. Returns 0 on failure (invalid length).
4712 decode_mp_next_hop_vpn_ipv6(tvbuff_t
*tvb
, proto_tree
*tree
, int offset
, packet_info
*pinfo
, wmem_strbuf_t
*strbuf
, int nhlen
)
4715 const char *rd_string
;
4716 ws_in6_addr ipv6_addr
;
4717 char ipv6_buffer
[WS_INET6_ADDRSTRLEN
];
4720 case (BGP_ROUTE_DISTINGUISHER_SIZE
+ FT_IPv6_LEN
):
4721 rd_string
= decode_bgp_rd(pinfo
->pool
, tvb
, offset
);
4722 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
);
4723 if (tvb_memeql(tvb
, offset
, rd_zero
, BGP_ROUTE_DISTINGUISHER_SIZE
) != 0) {
4724 expert_add_info(pinfo
, ti
, &ei_bgp_next_hop_rd_nonzero
);
4726 wmem_strbuf_append_printf(strbuf
, " RD=%s", rd_string
);
4727 offset
+= BGP_ROUTE_DISTINGUISHER_SIZE
;
4728 proto_tree_add_item(tree
, hf_bgp_update_path_attribute_mp_reach_nlri_next_hop_ipv6
, tvb
, offset
, FT_IPv6_LEN
, ENC_NA
);
4729 wmem_strbuf_append_printf(strbuf
, " IPv6=%s", tvb_ip6_to_str(pinfo
->pool
, tvb
, offset
));
4731 case (2*(BGP_ROUTE_DISTINGUISHER_SIZE
+ FT_IPv6_LEN
)):
4732 rd_string
= decode_bgp_rd(pinfo
->pool
, tvb
, offset
);
4733 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
);
4734 if (tvb_memeql(tvb
, offset
, rd_zero
, BGP_ROUTE_DISTINGUISHER_SIZE
) != 0) {
4735 expert_add_info(pinfo
, ti
, &ei_bgp_next_hop_rd_nonzero
);
4737 wmem_strbuf_append_printf(strbuf
, " RD=%s", rd_string
);
4738 offset
+= BGP_ROUTE_DISTINGUISHER_SIZE
;
4739 proto_tree_add_item(tree
, hf_bgp_update_path_attribute_mp_reach_nlri_next_hop_ipv6
, tvb
, offset
, FT_IPv6_LEN
, ENC_NA
);
4740 wmem_strbuf_append_printf(strbuf
, " IPv6=%s", tvb_ip6_to_str(pinfo
->pool
, tvb
, offset
));
4741 offset
+= FT_IPv6_LEN
;
4742 rd_string
= decode_bgp_rd(pinfo
->pool
, tvb
, offset
);
4743 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
);
4744 if (tvb_memeql(tvb
, offset
, rd_zero
, BGP_ROUTE_DISTINGUISHER_SIZE
) != 0) {
4745 expert_add_info(pinfo
, ti
, &ei_bgp_next_hop_rd_nonzero
);
4747 wmem_strbuf_append_printf(strbuf
, " RD=%s", rd_string
);
4748 offset
+= BGP_ROUTE_DISTINGUISHER_SIZE
;
4749 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
);
4750 tvb_get_ipv6(tvb
, offset
, &ipv6_addr
);
4751 if (!in6_addr_is_linklocal(&ipv6_addr
)) {
4752 expert_add_info_format(pinfo
, ti
, &ei_bgp_next_hop_ipv6_scope
, "Invalid IPv6 address scope; should be link-local");
4754 ip6_to_str_buf(&ipv6_addr
, ipv6_buffer
, WS_INET6_ADDRSTRLEN
);
4755 wmem_strbuf_append_printf(strbuf
, " Link-local=%s", ipv6_buffer
);
4764 * Decode a multiprotocol next hop address
4767 decode_mp_next_hop(tvbuff_t
*tvb
, proto_tree
*tree
, packet_info
*pinfo
, uint16_t afi
, uint8_t safi
, int nhlen
)
4770 proto_tree
*next_hop_t
;
4771 int length
, offset
= 0;
4772 wmem_strbuf_t
*strbuf
;
4774 strbuf
= wmem_strbuf_create(pinfo
->pool
);
4776 /* BGP Multiprotocol Next Hop Principles
4778 * BGP Multiprotocol support is specified over a large variety of
4779 * RFCs for different <AFI, SAFI> pairs, which leaves some theoretical
4780 * pairings undefined (e.g., the Abstract of RFC 4760 contemplates
4781 * supporting the IPX address family) as well as leading to some
4782 * omissions, contradictions, and inconsistencies. However, some general
4783 * principles that apply across (nearly) all extant pairs exist.
4785 * 1. Global IPv6 addresses can be followed by a link-local IPv6 address
4787 * RFC 2545 specifies in section 3, "Constructing the Next Hop field,"
4788 * that when the next hop address type is IPv6, the address given should
4789 * be in global (or site-local) unicast address scope, and it shall be
4790 * followed by the link-local address if and only if the BGP speaker shares
4791 * a common subnet with the address and the peer the route is being
4794 * The wording implies that this holds for any <AFI, SAFI> pair where
4795 * a IPv6 address is used, and RFCs 5549, 7752, and 8950 demonstrate that
4796 * this explicitly holds for the most common ones, including for VPN-IPv6
4797 * addresses (where the route distinguisher field also appears, see
4798 * RFC 4659). Sometimes the possibility is elided where it is known to
4799 * exist e.g. RFC 7606 7.11 MP_REACH_NLRI "For example, if RFC5549 is in
4800 * use, then the next hop would have to have a length of 4 or 16." Thus
4801 * it is possible that its omission in other RFCs covering new <AFI, SAFI>
4802 * pairs is an oversight.
4804 * 2. [VPN-]IPv4 NLRI can have [VPN-]IPv6 Next Hop addresses
4806 * RFCs 5549 and 8950 declare that the next hop address may not necessarily
4807 * belong to the address family specified by the AFI, updating RFC 2858,
4808 * specifically addressing the case of IPv6 islands across a IPv4 core
4811 * IPv4 addresses can easily be mapped into IPv6 addresses, and that
4812 * is the solution for one case, but in the other the Next Hop must be an
4813 * IPv6 (or VPN-IPv6) address even though the NLRI is IPv4.
4815 * The wording of RFC 8950 strongly implies that the intent is to allow
4816 * IPv6 Net Hop addresses for any case of IPv4 or VPN-IPv4 NLRI, providing
4817 * a BGP Capability to declare that the BGP speakers supports a different
4818 * Next Hop AFI for <AFI, SAFI> pairs defined without this capability,
4819 * and noting those (like <1, 132>, SAFNUM_ROUTE_TARGET, RFC 4684) that
4820 * consider the possibility from the start.
4822 * 3. Next Hop Route Distinguisher (RD) is 0 or omitted
4824 * RDs do not have a meaning in the Next Hop network address. However, when
4825 * RFC 2547 introduced the VPN-IPv4 address family, at that point the Next
4826 * Hop address family had to be the same as the NLRI address family, so the
4827 * RD was set to all 0. Later defined <AFI, SAFI> pairs with RDs in their
4828 * NLRI have either used this custom of a 0 RD, or else omitted it and
4829 * only had the IP address in the Next Hop.
4832 ti
= proto_tree_add_item(tree
, hf_bgp_update_path_attribute_mp_reach_nlri_next_hop
, tvb
, offset
, nhlen
+ 1, ENC_NA
);
4833 next_hop_t
= proto_item_add_subtree(ti
, ett_bgp_mp_nhna
);
4839 case SAFNUM_UNICAST
: /* RFC 8950 */
4840 case SAFNUM_MULCAST
: /* RFC 8950 */
4841 case SAFNUM_UNIMULC
: /* Deprecated, but as above */
4842 case SAFNUM_MPLS_LABEL
: /* RFC 8277 */
4843 case SAFNUM_MCAST_VPN
: /* RFC 6514 */
4844 case SAFNUM_ENCAPSULATION
: /* RFC 5512, but "never been used"
4846 * draft-ietf-idr-tunnel-encaps-22
4848 case SAFNUM_ROUTE_TARGET
: /* RFC 4684 */
4849 case SAFNUM_BGP_MUP
: /* draft-mpmz-bess-mup-safi-00 */
4850 /* IPv4 or IPv6, differentiated by field length, according
4851 * to the RFCs cited above. RFC 8950 explicitly addresses
4852 * the possible link-local IPv6 address. RFC 6514 depending
4853 * on the situation either the Next Hop MUST be the same
4854 * as in the IP Address field lower in the network stack,
4855 * or simply SHOULD be "a routeable address" of the ASBR/
4857 if ((length
= decode_mp_next_hop_ipv4(tvb
, next_hop_t
, offset
, pinfo
, strbuf
, nhlen
)) == 0) {
4858 length
= decode_mp_next_hop_ipv6(tvb
, next_hop_t
, offset
, pinfo
, strbuf
, nhlen
);
4862 /* Internet Draft draft-nalawade-kapoor-tunnel-safi-05
4863 * long expired, but "[NLRI] network address... SHOULD be
4864 * the same as the [Next Hop] network address."
4866 length
= decode_mp_next_hop_ipv4(tvb
, next_hop_t
, offset
, pinfo
, strbuf
, nhlen
);
4868 case SAFNUM_LAB_VPNUNICAST
: /* RFC 8950 */
4869 case SAFNUM_LAB_VPNMULCAST
: /* RFC 8950 */
4870 case SAFNUM_LAB_VPNUNIMULC
: /* Deprecated, but as above */
4871 /* RFC 8950 indicates that the next hop can be VPN-IPv4 or
4872 * VPN-IPv6 (with RD all 0), and in the latter case the
4873 * link-local IPv6 address can be included. Note that RFC
4874 * 5549 incorrectly did not include the RD in the Next Hop
4875 * for VPN-IPv6 (see Erratum ID 5253), but according to
4876 * RFC 8950 2. "Changes Compared to RFC 5549":
4877 * "As all known and deployed implementations are
4878 * interoperable today and use the new proposed encoding,
4879 * the change does not break existing interoperability,"
4880 * and thus we need not test for a missing RD.
4882 if ((length
= decode_mp_next_hop_vpn_ipv4(tvb
, next_hop_t
, offset
, pinfo
, strbuf
, nhlen
)) == 0) {
4883 length
= decode_mp_next_hop_vpn_ipv6(tvb
, next_hop_t
, offset
, pinfo
, strbuf
, nhlen
);
4886 case SAFNUM_FSPEC_RULE
:
4887 case SAFNUM_FSPEC_VPN_RULE
:
4889 /* When advertising Flow Specifications, the Length of the
4890 * Next-Hop Address MUST be set 0. The Network Address of
4891 * the Next-Hop field MUST be ignored.
4894 expert_add_info_format(pinfo
, ti
, &ei_bgp_length_invalid
,
4895 "The length (%d) of Next Hop (FlowSpec) is not zero", nhlen
);
4902 expert_add_info_format(pinfo
, ti
, &ei_bgp_unknown_safi
,
4903 "Unknown SAFI (%u) for AFI %u", safi
, afi
);
4905 } /* switch (safi) */
4909 case SAFNUM_UNICAST
: /* RFC 8950 */
4910 case SAFNUM_MULCAST
: /* RFC 8950 */
4911 case SAFNUM_UNIMULC
: /* Deprecated, but as above */
4912 case SAFNUM_MPLS_LABEL
: /* RFC 8277 */
4913 case SAFNUM_MCAST_VPN
: /* RFC 6514 */
4914 case SAFNUM_ENCAPSULATION
: /* RFC 5512, but "never been used" */
4915 case SAFNUM_TUNNEL
: /* Expired Internet Draft */
4916 case SAFNUM_BGP_MUP
: /* draft-mpmz-bess-mup-safi-00 */
4917 /* IPv6 address, possibly followed by link-local address */
4918 length
= decode_mp_next_hop_ipv6(tvb
, next_hop_t
, offset
, pinfo
, strbuf
, nhlen
);
4920 case SAFNUM_LAB_VPNUNICAST
: /* RFC 8950 */
4921 case SAFNUM_LAB_VPNMULCAST
: /* RFC 8950 */
4922 case SAFNUM_LAB_VPNUNIMULC
: /* Deprecated, but as above */
4923 /* VPN-IPv6 address, possibly followed by link-local addr */
4924 length
= decode_mp_next_hop_vpn_ipv6(tvb
, next_hop_t
, offset
, pinfo
, strbuf
, nhlen
);
4926 case SAFNUM_FSPEC_RULE
:
4927 case SAFNUM_FSPEC_VPN_RULE
:
4929 /* When advertising Flow Specifications, the Length of the
4930 * Next-Hop Address MUST be set 0. The Network Address of
4931 * the Next-Hop field MUST be ignored.
4934 expert_add_info_format(pinfo
, ti
, &ei_bgp_length_invalid
,
4935 "The length (%d) of Next Hop (FlowSpec) is not zero", nhlen
);
4942 expert_add_info_format(pinfo
, ti
, &ei_bgp_unknown_safi
,
4943 "Unknown SAFI (%u) for AFI %u", safi
, afi
);
4945 } /* switch (safi) */
4948 case AFNUM_L2VPN_OLD
:
4950 /* XXX: Do these first three really appear with L2VPN AFI? */
4951 case SAFNUM_LAB_VPNUNICAST
:
4952 case SAFNUM_LAB_VPNMULCAST
:
4953 case SAFNUM_LAB_VPNUNIMULC
:
4954 case SAFNUM_VPLS
: /* RFC 4761 (VPLS) and RFC 6074 (BGP-AD) */
4955 case SAFNUM_EVPN
: /* RFC 7432 */
4956 /* The RFCs above specify that the next-hop is simply the
4957 * address of the PE (loopback address in some cases for
4958 * BGP-AD), either IPv4 or IPv6, differentiated by length.
4959 * A RD is included in the NLRI in these cases, but not in
4960 * the Next Hop address unlike in AFI 1 or 2.
4962 if ((length
= decode_mp_next_hop_ipv4(tvb
, next_hop_t
, offset
, pinfo
, strbuf
, nhlen
)) == 0) {
4963 length
= decode_mp_next_hop_ipv6(tvb
, next_hop_t
, offset
, pinfo
, strbuf
, nhlen
);
4968 expert_add_info_format(pinfo
, ti
, &ei_bgp_unknown_safi
,
4969 "Unknown SAFI (%u) for AFI %u", safi
, afi
);
4971 } /* switch (safi) */
4974 /* RFC 7752 section 3.4 "BGP Next-Hop Information" explains that
4975 * the next-hop address length field specifes the next-hop address
4976 * family. "If the next-hop length is 4, then the next hop is an
4977 * IPv4 address; if the next-hop length is 16, then it is a global
4978 * IPv6 address; and if the next-hop length is 32, then there is
4979 * one global IPv6 address followed by a link-local IPv6 address"
4983 if ((length
= decode_mp_next_hop_ipv4(tvb
, next_hop_t
, offset
, pinfo
, strbuf
, nhlen
)) == 0) {
4984 length
= decode_mp_next_hop_ipv6(tvb
, next_hop_t
, offset
, pinfo
, strbuf
, nhlen
);
4987 case SAFNUM_BGP_LS_VPN
:
4988 /* RFC 7752 3.4: "For VPN SAFI, as per custom, an 8-byte
4989 * Route Distinguisher set to all zero is prepended to the
4992 if ((length
= decode_mp_next_hop_vpn_ipv4(tvb
, next_hop_t
, offset
, pinfo
, strbuf
, nhlen
)) == 0) {
4993 length
= decode_mp_next_hop_vpn_ipv6(tvb
, next_hop_t
, offset
, pinfo
, strbuf
, nhlen
);
4998 expert_add_info_format(pinfo
, ti
, &ei_bgp_unknown_safi
,
4999 "Unknown SAFI (%u) for AFI %u", safi
, afi
);
5001 } /* switch (safi) */
5005 expert_add_info(pinfo
, ti
, &ei_bgp_unknown_afi
);
5010 proto_item_append_text(ti
, ": %s", wmem_strbuf_get_str(strbuf
));
5012 expert_add_info_format(pinfo
, ti
, &ei_bgp_length_invalid
, "Unknown Next Hop length (%u byte%s)", nhlen
, plurality(nhlen
, "", "s"));
5014 proto_item_append_text(ti
, ": %s", tvb_bytes_to_str(pinfo
->pool
, tvb
, offset
, nhlen
));
5021 static int decode_bgp_link_node_descriptor(tvbuff_t
*tvb
, proto_tree
*tree
, int offset
, packet_info
*pinfo
, int length
)
5023 uint16_t sub_length
;
5025 uint16_t diss_length
;
5027 proto_item
* tlv_item
;
5028 proto_tree
* tlv_tree
;
5032 while (length
> 0 ) {
5034 expert_add_info_format(pinfo
, tree
, &ei_bgp_ls_error
,
5035 "Unknown data in Link-State Link NLRI!");
5036 diss_length
+= length
;
5039 type
= tvb_get_ntohs(tvb
, offset
);
5040 sub_length
= tvb_get_ntohs(tvb
, offset
+ 2);
5043 case BGP_NLRI_TLV_AUTONOMOUS_SYSTEM
:
5044 tlv_item
= proto_tree_add_item(tree
, hf_bgp_ls_tlv_autonomous_system
, tvb
, offset
, sub_length
+4, ENC_NA
);
5045 tlv_tree
= proto_item_add_subtree(tlv_item
, ett_bgp_mp_reach_nlri
);
5046 proto_tree_add_item(tlv_tree
, hf_bgp_ls_type
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
5047 proto_tree_add_item(tlv_tree
, hf_bgp_ls_length
, tvb
, offset
+ 2, 2, ENC_BIG_ENDIAN
);
5048 if (sub_length
!= BGP_NLRI_TLV_LEN_AUTONOMOUS_SYSTEM
) {
5049 expert_add_info_format(pinfo
, tree
, &ei_bgp_ls_error
,
5050 "Autonomous system TLV length should be %u bytes! (%u)",
5051 BGP_NLRI_TLV_LEN_AUTONOMOUS_SYSTEM
, sub_length
);
5054 proto_tree_add_item(tlv_tree
, hf_bgp_ls_tlv_autonomous_system_id
, tvb
, offset
+ 4, 4, ENC_BIG_ENDIAN
);
5056 case BGP_NLRI_TLV_BGP_LS_IDENTIFIER
:
5057 tlv_item
= proto_tree_add_item(tree
, hf_bgp_ls_tlv_bgp_ls_identifier
, tvb
, offset
, sub_length
+4, ENC_NA
);
5058 tlv_tree
= proto_item_add_subtree(tlv_item
, ett_bgp_mp_reach_nlri
);
5059 proto_tree_add_item(tlv_tree
, hf_bgp_ls_type
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
5060 proto_tree_add_item(tlv_tree
, hf_bgp_ls_length
, tvb
, offset
+ 2, 2, ENC_BIG_ENDIAN
);
5061 if (sub_length
!= BGP_NLRI_TLV_LEN_BGP_LS_IDENTIFIER
) {
5062 expert_add_info_format(pinfo
, tree
, &ei_bgp_ls_error
,
5063 "BGP-LS TLV length should be %u bytes! (%u)",
5064 BGP_NLRI_TLV_LEN_BGP_LS_IDENTIFIER
, sub_length
);
5067 proto_tree_add_item(tlv_tree
, hf_bgp_ls_tlv_bgp_ls_identifier_id
, tvb
, offset
+ 4, 4, ENC_BIG_ENDIAN
);
5069 case BGP_NLRI_TLV_AREA_ID
:
5070 tlv_item
= proto_tree_add_item(tree
, hf_bgp_ls_tlv_area_id
, tvb
, offset
, sub_length
+4, ENC_NA
);
5071 tlv_tree
= proto_item_add_subtree(tlv_item
, ett_bgp_mp_reach_nlri
);
5072 proto_tree_add_item(tlv_tree
, hf_bgp_ls_type
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
5073 proto_tree_add_item(tlv_tree
, hf_bgp_ls_length
, tvb
, offset
+ 2, 2, ENC_BIG_ENDIAN
);
5074 if (sub_length
!= BGP_NLRI_TLV_LEN_AREA_ID
) {
5075 expert_add_info_format(pinfo
, tree
, &ei_bgp_ls_error
,
5076 "Area ID TLV length should be %u bytes! (%u)",
5077 BGP_NLRI_TLV_LEN_AREA_ID
, sub_length
);
5080 proto_tree_add_item(tlv_tree
, hf_bgp_ls_tlv_area_id_id
, tvb
, offset
+ 4, 4, ENC_BIG_ENDIAN
);
5082 case BGP_NLRI_TLV_IGP_ROUTER_ID
:
5083 tlv_item
= proto_tree_add_item(tree
, hf_bgp_ls_tlv_igp_router
, tvb
, offset
, sub_length
+4, ENC_NA
);
5084 tlv_tree
= proto_item_add_subtree(tlv_item
, ett_bgp_mp_reach_nlri
);
5085 proto_tree_add_item(tlv_tree
, hf_bgp_ls_type
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
5086 proto_tree_add_item(tlv_tree
, hf_bgp_ls_length
, tvb
, offset
+ 2, 2, ENC_BIG_ENDIAN
);
5087 proto_tree_add_item(tlv_tree
, hf_bgp_ls_tlv_igp_router_id
, tvb
, offset
+ 4, sub_length
, ENC_NA
);
5089 case BGP_NLRI_TLV_BGP_ROUTER_ID
:
5090 tlv_item
= proto_tree_add_item(tree
, hf_bgp_ls_tlv_bgp_router_id
, tvb
, offset
, sub_length
+4, ENC_NA
);
5091 tlv_tree
= proto_item_add_subtree(tlv_item
, ett_bgp_mp_reach_nlri
);
5092 proto_tree_add_item(tlv_tree
, hf_bgp_ls_type
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
5093 proto_tree_add_item(tlv_tree
, hf_bgp_ls_length
, tvb
, offset
+ 2, 2, ENC_BIG_ENDIAN
);
5094 proto_tree_add_item(tlv_tree
, hf_bgp_ls_tlv_bgp_router_id_id
, tvb
, offset
+ 4, sub_length
, ENC_NA
);
5097 expert_add_info_format(pinfo
, tree
, &ei_bgp_ls_warn
, "Undefined node Descriptor Sub-TLV type (%u)!", type
);
5100 length
-= 4 + sub_length
;
5101 offset
+= 4 + sub_length
;
5102 diss_length
+= 4 + sub_length
;
5109 * Decode BGP Link State Local and Remote NODE Descriptors
5111 static int decode_bgp_link_node_nlri_tlvs(tvbuff_t
*tvb
, proto_tree
*tree
, int offset
, packet_info
*pinfo
, uint16_t expected_sub_tlv
)
5115 proto_tree
* tlv_tree
;
5116 proto_item
* tlv_item
;
5118 type
= tvb_get_ntohs(tvb
, offset
);
5119 length
= tvb_get_ntohs(tvb
, offset
+ 2);
5121 if (expected_sub_tlv
!= type
) {
5122 expert_add_info_format(pinfo
, tree
, &ei_bgp_ls_error
, "Expected/actual tlv mismatch, expected: %u, actual: %u", expected_sub_tlv
, type
);
5127 /*local and remote node descriptors */
5128 case BGP_NLRI_TLV_LOCAL_NODE_DESCRIPTORS
:
5129 tlv_item
= proto_tree_add_item(tree
, hf_bgp_ls_tlv_local_node_descriptors
, tvb
, offset
, length
+4, ENC_NA
);
5130 tlv_tree
= proto_item_add_subtree(tlv_item
, ett_bgp_mp_reach_nlri
);
5131 proto_tree_add_item(tlv_tree
, hf_bgp_ls_type
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
5132 proto_tree_add_item(tlv_tree
, hf_bgp_ls_length
, tvb
, offset
+ 2, 2, ENC_BIG_ENDIAN
);
5133 decode_bgp_link_node_descriptor(tvb
, tlv_tree
, offset
+ 4, pinfo
, length
);
5136 case BGP_NLRI_TLV_REMOTE_NODE_DESCRIPTORS
:
5137 tlv_item
= proto_tree_add_item(tree
, hf_bgp_ls_tlv_remote_node_descriptors
, tvb
, offset
, length
+4, ENC_NA
);
5138 tlv_tree
= proto_item_add_subtree(tlv_item
, ett_bgp_mp_reach_nlri
);
5139 proto_tree_add_item(tlv_tree
, hf_bgp_ls_type
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
5140 proto_tree_add_item(tlv_tree
, hf_bgp_ls_length
, tvb
, offset
+ 2, 2, ENC_BIG_ENDIAN
);
5141 decode_bgp_link_node_descriptor(tvb
, tlv_tree
, offset
+ 4, pinfo
, length
);
5149 * Dissect Link and Node NLRI common fields (Protocol-ID, Identifier, Local Node Desc.)
5151 static int decode_bgp_link_node_nlri_common_fields(tvbuff_t
*tvb
,
5152 proto_tree
*tree
, int offset
, packet_info
*pinfo
, int length
) {
5153 int dissected_length
;
5156 /* dissect Link NLRI header */
5158 expert_add_info_format(pinfo
, tree
, &ei_bgp_ls_error
,
5159 "Link State NLRI length is lower than 12 bytes! (%d)", length
);
5163 proto_tree_add_item(tree
, hf_bgp_ls_nlri_node_protocol_id
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
5164 save_link_state_protocol_id(pinfo
, tvb_get_uint8(tvb
, offset
));
5165 proto_tree_add_item(tree
, hf_bgp_ls_nlri_node_identifier
, tvb
, offset
+ 1, 8, ENC_BIG_ENDIAN
);
5167 dissected_length
= 9;
5168 offset
+= dissected_length
;
5169 length
-= dissected_length
;
5171 /* dissect Local Node Descriptors TLV */
5173 expert_add_info_format(pinfo
, tree
, &ei_bgp_ls_error
,
5174 "Unknown data in Link-State Link NLRI! length = %d bytes", length
);
5175 return dissected_length
;
5178 tmp_length
= decode_bgp_link_node_nlri_tlvs(tvb
, tree
, offset
, pinfo
,
5179 BGP_NLRI_TLV_LOCAL_NODE_DESCRIPTORS
);
5180 if (tmp_length
< 0) {
5183 dissected_length
+= tmp_length
;
5185 return dissected_length
;
5190 * Decode Link Descriptors
5192 static int decode_bgp_link_nlri_link_descriptors(tvbuff_t
*tvb
,
5193 proto_tree
*tree
, int offset
, packet_info
*pinfo
, int length
) {
5195 uint16_t sub_length
;
5197 uint16_t diss_length
;
5200 proto_item
* tlv_item
;
5201 proto_tree
* tlv_tree
;
5202 proto_item
* tlv_sub_item
;
5203 proto_tree
* tlv_sub_tree
;
5205 tlv_item
= proto_tree_add_item(tree
, hf_bgp_ls_nlri_link_descriptors_tlv
, tvb
, offset
, length
+ 4, ENC_NA
);
5206 tlv_tree
= proto_item_add_subtree(tlv_item
, ett_bgp_mp_reach_nlri
);
5209 while (length
> 0) {
5211 expert_add_info_format(pinfo
, tree
, &ei_bgp_ls_error
,
5212 "Unknown data in Link-State Link NLRI!");
5213 diss_length
+= length
;
5217 type
= tvb_get_ntohs(tvb
, offset
);
5218 sub_length
= tvb_get_ntohs(tvb
, offset
+ 2);
5220 case BGP_NLRI_TLV_LINK_LOCAL_REMOTE_IDENTIFIERS
:
5221 if(sub_length
!= BGP_NLRI_TLV_LEN_LINK_LOCAL_REMOTE_IDENTIFIERS
){
5222 expert_add_info_format(pinfo
, tlv_tree
, &ei_bgp_ls_error
,
5223 "Unexpected Link Local/Remote Identifiers TLV's length (%u), it must be %u bytes!",
5224 sub_length
, BGP_NLRI_TLV_LEN_LINK_LOCAL_REMOTE_IDENTIFIERS
);
5227 tlv_sub_item
= proto_tree_add_item(tlv_tree
,
5228 hf_bgp_ls_tlv_link_local_remote_identifiers
, tvb
, offset
,
5229 sub_length
+ 4, ENC_NA
);
5230 tlv_sub_tree
= proto_item_add_subtree(tlv_sub_item
, ett_bgp_mp_reach_nlri
);
5233 case BGP_NLRI_TLV_IPV4_INTERFACE_ADDRESS
:
5234 if(sub_length
!= BGP_NLRI_TLV_LEN_IPV4_INTERFACE_ADDRESS
){
5235 expert_add_info_format(pinfo
, tlv_tree
, &ei_bgp_ls_error
,
5236 "Unexpected IPv4 Interface Address TLV's length (%u), it must be %u bytes!",
5237 sub_length
, BGP_NLRI_TLV_LEN_IPV4_INTERFACE_ADDRESS
);
5240 tlv_sub_item
= proto_tree_add_item(tlv_tree
,
5241 hf_bgp_ls_tlv_ipv4_interface_address
, tvb
, offset
,
5242 sub_length
+ 4, ENC_NA
);
5243 tlv_sub_tree
= proto_item_add_subtree(tlv_sub_item
, ett_bgp_mp_reach_nlri
);
5246 case BGP_NLRI_TLV_IPV4_NEIGHBOR_ADDRESS
:
5247 if(sub_length
!= BGP_NLRI_TLV_LEN_IPV4_NEIGHBOR_ADDRESS
){
5248 expert_add_info_format(pinfo
, tlv_tree
, &ei_bgp_ls_error
,
5249 "Unexpected IPv4 Neighbor Address TLV's length (%u), it must be %u bytes!",
5250 sub_length
, BGP_NLRI_TLV_LEN_IPV4_NEIGHBOR_ADDRESS
);
5253 tlv_sub_item
= proto_tree_add_item(tlv_tree
,
5254 hf_bgp_ls_tlv_ipv4_neighbor_address
, tvb
, offset
,
5255 sub_length
+ 4, ENC_NA
);
5256 tlv_sub_tree
= proto_item_add_subtree(tlv_sub_item
, ett_bgp_mp_reach_nlri
);
5259 case BGP_NLRI_TLV_IPV6_INTERFACE_ADDRESS
:
5260 if(sub_length
!= BGP_NLRI_TLV_LEN_IPV6_INTERFACE_ADDRESS
){
5261 expert_add_info_format(pinfo
, tlv_tree
, &ei_bgp_ls_error
,
5262 "Unexpected IPv6 Interface Address TLV's length (%u), it must be %u bytes!",
5263 sub_length
, BGP_NLRI_TLV_LEN_IPV6_INTERFACE_ADDRESS
);
5266 tlv_sub_item
= proto_tree_add_item(tlv_tree
,
5267 hf_bgp_ls_tlv_ipv6_interface_address
, tvb
, offset
,
5268 sub_length
+ 4, ENC_NA
);
5269 tlv_sub_tree
= proto_item_add_subtree(tlv_sub_item
, ett_bgp_mp_reach_nlri
);
5272 case BGP_NLRI_TLV_IPV6_NEIGHBOR_ADDRESS
:
5273 if(sub_length
!= BGP_NLRI_TLV_LEN_IPV6_NEIGHBOR_ADDRESS
){
5274 expert_add_info_format(pinfo
, tlv_tree
, &ei_bgp_ls_error
,
5275 "Unexpected IPv6 Neighbor Address TLV's length (%u), it must be %u bytes!",
5276 sub_length
, BGP_NLRI_TLV_LEN_IPV6_NEIGHBOR_ADDRESS
);
5279 tlv_sub_item
= proto_tree_add_item(tlv_tree
,
5280 hf_bgp_ls_tlv_ipv6_neighbor_address
, tvb
, offset
,
5281 sub_length
+ 4, ENC_NA
);
5282 tlv_sub_tree
= proto_item_add_subtree(tlv_sub_item
, ett_bgp_mp_reach_nlri
);
5285 case BGP_NLRI_TLV_MULTI_TOPOLOGY_ID
:
5286 if(sub_length
!= BGP_NLRI_TLV_LEN_MULTI_TOPOLOGY_ID
){
5287 expert_add_info_format(pinfo
, tlv_tree
, &ei_bgp_ls_error
,
5288 "Unexpected Multi Topology ID TLV's length (%u), it must be %u bytes!",
5289 sub_length
, BGP_NLRI_TLV_LEN_MULTI_TOPOLOGY_ID
);
5292 tlv_sub_item
= proto_tree_add_item(tlv_tree
,
5293 hf_bgp_ls_tlv_multi_topology_id
, tvb
, offset
, sub_length
+ 4,
5295 tlv_sub_tree
= proto_item_add_subtree(tlv_sub_item
, ett_bgp_mp_reach_nlri
);
5299 expert_add_info_format(pinfo
, tlv_tree
, &ei_bgp_ls_error
,
5300 "Unknown Link Descriptor TLV Code (%u)!", type
);
5304 proto_tree_add_item(tlv_sub_tree
, hf_bgp_ls_type
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
5305 proto_tree_add_item(tlv_sub_tree
, hf_bgp_ls_length
, tvb
, offset
+ 2, 2, ENC_BIG_ENDIAN
);
5308 case BGP_NLRI_TLV_LINK_LOCAL_REMOTE_IDENTIFIERS
:
5309 proto_tree_add_item(tlv_sub_tree
, hf_bgp_ls_nlri_link_local_identifier
, tvb
, offset
+ 4, 4, ENC_BIG_ENDIAN
);
5310 proto_tree_add_item(tlv_sub_tree
, hf_bgp_ls_nlri_link_remote_identifier
, tvb
, offset
+ 8, 4, ENC_BIG_ENDIAN
);
5313 case BGP_NLRI_TLV_IPV4_INTERFACE_ADDRESS
:
5314 proto_tree_add_item(tlv_sub_tree
, hf_bgp_ls_nlri_ipv4_interface_address
, tvb
, offset
+ 4,
5315 BGP_NLRI_TLV_LEN_IPV4_INTERFACE_ADDRESS
, ENC_BIG_ENDIAN
);
5318 case BGP_NLRI_TLV_IPV4_NEIGHBOR_ADDRESS
:
5319 proto_tree_add_item(tlv_sub_tree
, hf_bgp_ls_nlri_ipv4_neighbor_address
, tvb
, offset
+ 4,
5320 BGP_NLRI_TLV_LEN_IPV4_INTERFACE_ADDRESS
, ENC_BIG_ENDIAN
);
5323 case BGP_NLRI_TLV_IPV6_INTERFACE_ADDRESS
:
5324 proto_tree_add_item(tlv_sub_tree
, hf_bgp_ls_nlri_ipv6_interface_address
, tvb
, offset
+ 4,
5325 BGP_NLRI_TLV_LEN_IPV6_INTERFACE_ADDRESS
, ENC_NA
);
5328 case BGP_NLRI_TLV_IPV6_NEIGHBOR_ADDRESS
:
5329 proto_tree_add_item(tlv_sub_tree
, hf_bgp_ls_nlri_ipv6_neighbor_address
, tvb
, offset
+ 4,
5330 BGP_NLRI_TLV_LEN_IPV6_INTERFACE_ADDRESS
, ENC_NA
);
5333 case BGP_NLRI_TLV_MULTI_TOPOLOGY_ID
:
5334 tmp16
= tvb_get_ntohs(tvb
, offset
+ 4);
5337 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
);
5339 proto_tree_add_item(tlv_sub_tree
, hf_bgp_ls_nlri_multi_topology_id
, tvb
, offset
+ 4,
5340 BGP_NLRI_TLV_LEN_MULTI_TOPOLOGY_ID
, ENC_BIG_ENDIAN
);
5344 length
-= 4 + sub_length
;
5345 offset
+= 4 + sub_length
;
5346 diss_length
+= 4 + sub_length
;
5352 * Decode Prefix Descriptors
5354 static int decode_bgp_link_nlri_prefix_descriptors(tvbuff_t
*tvb
,
5355 proto_tree
*tree
, int offset
, packet_info
*pinfo
, int length
, int proto
) {
5357 uint16_t sub_length
;
5359 uint16_t diss_length
;
5362 proto_item
* tlv_item
;
5363 proto_tree
* tlv_tree
;
5364 proto_item
* tlv_sub_item
;
5365 proto_tree
* tlv_sub_tree
;
5367 tlv_item
= proto_tree_add_item(tree
, hf_bgp_ls_nlri_prefix_descriptors_tlv
, tvb
, offset
, length
+ 4, ENC_NA
);
5368 tlv_tree
= proto_item_add_subtree(tlv_item
, ett_bgp_mp_reach_nlri
);
5371 while (length
> 0) {
5373 expert_add_info_format(pinfo
, tree
, &ei_bgp_ls_error
,
5374 "Unknown data in Link-State Link NLRI!");
5375 diss_length
+= length
;
5379 type
= tvb_get_ntohs(tvb
, offset
);
5380 sub_length
= tvb_get_ntohs(tvb
, offset
+ 2);
5382 case BGP_NLRI_TLV_MULTI_TOPOLOGY_ID
:
5383 if(sub_length
!= BGP_NLRI_TLV_LEN_MULTI_TOPOLOGY_ID
){
5384 expert_add_info_format(pinfo
, tlv_tree
, &ei_bgp_ls_error
,
5385 "Unexpected Multi Topology ID TLV's length (%u), it must be %u bytes!",
5386 sub_length
, BGP_NLRI_TLV_LEN_MULTI_TOPOLOGY_ID
);
5389 tlv_sub_item
= proto_tree_add_item(tlv_tree
,
5390 hf_bgp_ls_tlv_multi_topology_id
, tvb
, offset
, sub_length
+ 4,
5392 tlv_sub_tree
= proto_item_add_subtree(tlv_sub_item
, ett_bgp_mp_reach_nlri
);
5395 case BGP_NLRI_TLV_OSPF_ROUTE_TYPE
:
5396 tlv_sub_item
= proto_tree_add_item(tlv_tree
,
5397 hf_bgp_ls_tlv_ospf_route_type
, tvb
, offset
, sub_length
+ 4,
5399 tlv_sub_tree
= proto_item_add_subtree(tlv_sub_item
, ett_bgp_mp_reach_nlri
);
5401 case BGP_NLRI_TLV_IP_REACHABILITY_INFORMATION
:
5402 tlv_sub_item
= proto_tree_add_item(tlv_tree
,
5403 hf_bgp_ls_tlv_ip_reachability_information
, tvb
, offset
, sub_length
+ 4,
5405 tlv_sub_tree
= proto_item_add_subtree(tlv_sub_item
, ett_bgp_mp_reach_nlri
);
5409 expert_add_info_format(pinfo
, tlv_tree
, &ei_bgp_ls_error
,
5410 "Unknown Prefix Descriptor TLV Code (%u)!", type
);
5414 proto_tree_add_item(tlv_sub_tree
, hf_bgp_ls_type
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
5415 proto_tree_add_item(tlv_sub_tree
, hf_bgp_ls_length
, tvb
, offset
+ 2, 2, ENC_BIG_ENDIAN
);
5418 case BGP_NLRI_TLV_MULTI_TOPOLOGY_ID
:
5419 tmp16
= tvb_get_ntohs(tvb
, offset
+ 4);
5422 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
);
5424 proto_tree_add_item(tlv_sub_tree
, hf_bgp_ls_nlri_multi_topology_id
, tvb
, offset
+ 4,
5425 BGP_NLRI_TLV_LEN_MULTI_TOPOLOGY_ID
, ENC_BIG_ENDIAN
);
5428 case BGP_NLRI_TLV_OSPF_ROUTE_TYPE
:
5430 if (sub_length
!= 1) {
5431 expert_add_info_format(pinfo
, tlv_sub_tree
, &ei_bgp_ls_error
, "OSPF Route Type length must be \"1\"");
5434 proto_tree_add_item(tlv_sub_tree
, hf_bgp_ls_nlri_ospf_route_type
, tvb
, offset
+ 4, 1, ENC_BIG_ENDIAN
);
5437 case BGP_NLRI_TLV_IP_REACHABILITY_INFORMATION
:
5438 if (( proto
== IP_PROTO_IPV4
) && (decode_prefix4(tlv_sub_tree
, pinfo
, tlv_sub_item
, hf_bgp_ls_nlri_ip_reachability_prefix_ip
,
5439 tvb
, offset
+ 4, "Reachability") == -1))
5441 if (( proto
== IP_PROTO_IPV6
) && (decode_prefix6(tlv_sub_tree
, pinfo
, hf_bgp_ls_nlri_ip_reachability_prefix_ip6
,
5442 tvb
, offset
+ 4, 0, "Reachability") == -1))
5447 length
-= 4 + sub_length
;
5448 offset
+= 4 + sub_length
;
5449 diss_length
+= 4 + sub_length
;
5455 * Decode SRv6 SID Descriptors
5457 static int decode_bgp_link_nlri_srv6_sid_descriptors(tvbuff_t
*tvb
,
5458 proto_tree
*tree
, int offset
, packet_info
*pinfo
, int length
) {
5460 uint16_t sub_length
;
5462 uint16_t diss_length
;
5465 proto_item
* tlv_item
;
5466 proto_tree
* tlv_tree
;
5467 proto_item
* tlv_sub_item
;
5468 proto_tree
* tlv_sub_tree
;
5470 tlv_item
= proto_tree_add_item(tree
, hf_bgp_ls_nlri_srv6_sid_descriptors_tlv
, tvb
, offset
, length
+ 4, ENC_NA
);
5471 tlv_tree
= proto_item_add_subtree(tlv_item
, ett_bgp_mp_reach_nlri
);
5474 while (length
> 0) {
5476 expert_add_info_format(pinfo
, tree
, &ei_bgp_ls_error
,
5477 "Unknown data in Link-State SRv6 SID NLRI!");
5478 diss_length
+= length
;
5482 type
= tvb_get_ntohs(tvb
, offset
);
5483 sub_length
= tvb_get_ntohs(tvb
, offset
+ 2);
5485 case BGP_NLRI_TLV_MULTI_TOPOLOGY_ID
:
5486 if(sub_length
!= BGP_NLRI_TLV_LEN_MULTI_TOPOLOGY_ID
){
5487 expert_add_info_format(pinfo
, tlv_tree
, &ei_bgp_ls_error
,
5488 "Unexpected Multi Topology ID TLV's length (%u), it must be %u bytes!",
5489 sub_length
, BGP_NLRI_TLV_LEN_MULTI_TOPOLOGY_ID
);
5492 tlv_sub_item
= proto_tree_add_item(tlv_tree
,
5493 hf_bgp_ls_tlv_multi_topology_id
, tvb
, offset
, sub_length
+ 4,
5495 tlv_sub_tree
= proto_item_add_subtree(tlv_sub_item
, ett_bgp_mp_reach_nlri
);
5498 case BGP_NLRI_TLV_SRV6_SID_INFO
:
5499 if (sub_length
!= 16) {
5500 expert_add_info_format(pinfo
, tlv_tree
, &ei_bgp_ls_error
,
5501 "Unexpected SRv6 SID Information TLV's length (%u), it must be 16 bytes!",
5505 tlv_sub_item
= proto_tree_add_item(tlv_tree
,
5506 hf_bgp_ls_tlv_srv6_sid_info
, tvb
, offset
, sub_length
+ 4,
5508 tlv_sub_tree
= proto_item_add_subtree(tlv_sub_item
, ett_bgp_mp_reach_nlri
);
5512 expert_add_info_format(pinfo
, tlv_tree
, &ei_bgp_ls_error
,
5513 "Unknown SRv6 SID Descriptor TLV Code (%u)!", type
);
5517 proto_tree_add_item(tlv_sub_tree
, hf_bgp_ls_type
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
5518 proto_tree_add_item(tlv_sub_tree
, hf_bgp_ls_length
, tvb
, offset
+ 2, 2, ENC_BIG_ENDIAN
);
5521 case BGP_NLRI_TLV_MULTI_TOPOLOGY_ID
:
5522 tmp16
= tvb_get_ntohs(tvb
, offset
+ 4);
5525 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
);
5527 proto_tree_add_item(tlv_sub_tree
, hf_bgp_ls_nlri_multi_topology_id
,
5528 tvb
, offset
+ 4, BGP_NLRI_TLV_LEN_MULTI_TOPOLOGY_ID
, ENC_BIG_ENDIAN
);
5531 case BGP_NLRI_TLV_SRV6_SID_INFO
:
5532 proto_tree_add_item(tlv_sub_tree
, hf_bgp_ls_tlv_srv6_sid_info_sid
,
5533 tvb
, offset
+ 4, 16, ENC_NA
);
5537 length
-= 4 + sub_length
;
5538 offset
+= 4 + sub_length
;
5539 diss_length
+= 4 + sub_length
;
5545 * Decode Flex Algo sub-TLVs in BGP-LS attributes
5548 decode_link_state_attribute_flex_algo_subtlv(proto_tree
*tree
, tvbuff_t
*tvb
, int offset
, packet_info
*pinfo
, uint8_t _U_ protocol_id
)
5554 proto_item
* tlv_item
;
5555 proto_tree
* tlv_tree
;
5557 type
= tvb_get_ntohs(tvb
, offset
);
5558 length
= tvb_get_ntohs(tvb
, offset
+ 2);
5561 case BGP_LS_SR_TLV_FLEX_ALGO_EXC_ANY_AFFINITY
:
5562 case BGP_LS_SR_TLV_FLEX_ALGO_INC_ANY_AFFINITY
:
5563 case BGP_LS_SR_TLV_FLEX_ALGO_INC_ALL_AFFINITY
:
5564 tlv_item
= proto_tree_add_item(tree
,
5565 (type
== BGP_LS_SR_TLV_FLEX_ALGO_EXC_ANY_AFFINITY
) ?
5566 hf_bgp_ls_sr_tlv_flex_algo_exc_any_affinity
:
5567 ((type
== BGP_LS_SR_TLV_FLEX_ALGO_INC_ANY_AFFINITY
) ?
5568 hf_bgp_ls_sr_tlv_flex_algo_inc_any_affinity
:
5569 hf_bgp_ls_sr_tlv_flex_algo_inc_all_affinity
),
5570 tvb
, offset
, length
+ 4, ENC_NA
);
5571 tlv_tree
= proto_item_add_subtree(tlv_item
, ett_bgp_link_state
);
5572 proto_tree_add_item(tlv_tree
, hf_bgp_ls_type
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
5573 proto_tree_add_item(tlv_tree
, hf_bgp_ls_length
, tvb
, offset
+ 2, 2, ENC_BIG_ENDIAN
);
5574 if (length
% 4 != 0) {
5575 expert_add_info_format(pinfo
, tlv_tree
, &ei_bgp_ls_error
, "Unexpected Extended Administrative Group TLV's length (%u mod 4 != 0)",
5581 proto_tree_add_item(tlv_tree
, hf_bgp_ls_extended_administrative_group_value
, tvb
, offset
+ 4 + (length
- tmp16
), 4, ENC_NA
);
5587 expert_add_info_format(pinfo
, tree
, &ei_bgp_ls_warn
,
5588 "Unknown BGP-LS Flex-Algo sub-TLV Code (%u)!", type
);
5596 * Decode a multiprotocol prefix
5599 // NOLINTNEXTLINE(misc-no-recursion)
5600 decode_link_state_attribute_tlv(proto_tree
*tree
, tvbuff_t
*tvb
, int offset
, packet_info
*pinfo
, uint8_t protocol_id
)
5609 int local_offset
, local_length
;
5611 uint8_t sabm_len
, udabm_len
;
5614 proto_item
* tlv_item
;
5615 proto_tree
* tlv_tree
;
5616 proto_item
* tlv_sub_item
;
5617 proto_tree
* tlv_sub_tree
;
5620 type
= tvb_get_ntohs(tvb
, offset
);
5621 length
= tvb_get_ntohs(tvb
, offset
+ 2);
5623 increment_dissection_depth(pinfo
);
5626 /* NODE ATTRIBUTE TLVs */
5627 case BGP_NLRI_TLV_MULTI_TOPOLOGY_ID
:
5628 tlv_item
= proto_tree_add_item(tree
, hf_bgp_ls_tlv_multi_topology_id
, tvb
, offset
, length
+ 4, ENC_NA
);
5629 tlv_tree
= proto_item_add_subtree(tlv_item
, ett_bgp_link_state
);
5631 for (n
= 0; n
< (length
/ BGP_NLRI_TLV_LEN_MULTI_TOPOLOGY_ID
); n
++) {
5632 tmp16
= tvb_get_ntohs(tvb
, offset
+ 4 + (n
* BGP_NLRI_TLV_LEN_MULTI_TOPOLOGY_ID
));
5635 expert_add_info_format(pinfo
, tlv_tree
, &ei_bgp_ls_error
, "Reserved bits of Multi Topology ID must be set to zero! (%u)", tmp16
);
5637 proto_tree_add_item(tlv_tree
, hf_bgp_ls_nlri_multi_topology_id
, tvb
, offset
+ 4 + (n
* BGP_NLRI_TLV_LEN_MULTI_TOPOLOGY_ID
),
5638 BGP_NLRI_TLV_LEN_MULTI_TOPOLOGY_ID
, ENC_BIG_ENDIAN
);
5642 case BGP_NLRI_TLV_NODE_FLAG_BITS
:
5644 static int * const flags
[] = {
5645 &hf_bgp_ls_node_flag_bits_overload
,
5646 &hf_bgp_ls_node_flag_bits_attached
,
5647 &hf_bgp_ls_node_flag_bits_external
,
5648 &hf_bgp_ls_node_flag_bits_abr
,
5652 tlv_item
= proto_tree_add_item(tree
, hf_bgp_ls_tlv_node_flags_bits
, tvb
, offset
, length
+4, ENC_NA
);
5653 tlv_tree
= proto_item_add_subtree(tlv_item
, ett_bgp_link_state
);
5654 if(length
!= BGP_NLRI_TLV_LEN_NODE_FLAG_BITS
){
5655 expert_add_info_format(pinfo
, tlv_tree
, &ei_bgp_ls_error
, "Unexpected Node Flags Bits TLV's length (%u), it must be %u bytes!",
5656 length
, BGP_NLRI_TLV_LEN_NODE_FLAG_BITS
);
5659 proto_tree_add_item(tlv_tree
, hf_bgp_ls_type
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
5660 proto_tree_add_item(tlv_tree
, hf_bgp_ls_length
, tvb
, offset
+ 2, 2, ENC_BIG_ENDIAN
);
5661 proto_tree_add_bitmask_list(tlv_tree
, tvb
, offset
+4, 1, flags
, ENC_NA
);
5662 tmp8
= tvb_get_uint8(tvb
, offset
+4) & 0x0f;
5664 expert_add_info_format(pinfo
, tlv_tree
, &ei_bgp_ls_error
, "Reserved flag bits are not set to zero (%u).", tmp8
);
5669 case BGP_NLRI_TLV_OPAQUE_NODE_PROPERTIES
:
5670 tlv_item
= proto_tree_add_item(tree
, hf_bgp_ls_tlv_opaque_node_properties
, tvb
, offset
, length
+4, ENC_NA
);
5671 tlv_tree
= proto_item_add_subtree(tlv_item
, ett_bgp_link_state
);
5672 proto_tree_add_item(tlv_tree
, hf_bgp_ls_type
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
5673 proto_tree_add_item(tlv_tree
, hf_bgp_ls_length
, tvb
, offset
+ 2, 2, ENC_BIG_ENDIAN
);
5674 proto_tree_add_item(tlv_tree
, hf_bgp_ls_tlv_opaque_node_properties_value
, tvb
, offset
+ 4, length
, ENC_NA
);
5677 case BGP_NLRI_TLV_NODE_NAME
:
5678 tlv_item
= proto_tree_add_item(tree
, hf_bgp_ls_tlv_node_name
, tvb
, offset
, length
+4, ENC_NA
);
5679 tlv_tree
= proto_item_add_subtree(tlv_item
, ett_bgp_link_state
);
5680 proto_tree_add_item(tlv_tree
, hf_bgp_ls_type
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
5681 proto_tree_add_item(tlv_tree
, hf_bgp_ls_length
, tvb
, offset
+ 2, 2, ENC_BIG_ENDIAN
);
5682 proto_tree_add_item(tlv_tree
, hf_bgp_ls_tlv_node_name_value
, tvb
, offset
+ 4, length
, ENC_ASCII
);
5685 case BGP_NLRI_TLV_IS_IS_AREA_IDENTIFIER
:
5686 tlv_item
= proto_tree_add_item(tree
, hf_bgp_ls_tlv_is_is_area_identifier
, tvb
, offset
, length
+4, ENC_NA
);
5687 tlv_tree
= proto_item_add_subtree(tlv_item
, ett_bgp_link_state
);
5688 proto_tree_add_item(tlv_tree
, hf_bgp_ls_type
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
5689 proto_tree_add_item(tlv_tree
, hf_bgp_ls_length
, tvb
, offset
+ 2, 2, ENC_BIG_ENDIAN
);
5690 proto_tree_add_item(tlv_tree
, hf_bgp_ls_tlv_is_is_area_identifier_value
, tvb
, offset
+ 4, length
, ENC_NA
);
5693 case BGP_LS_SR_TLV_SR_CAPABILITY
:
5697 +--+--+--+--+--+--+--+--+
5698 |I |V |H | | | | | |
5699 +--+--+--+--+--+--+--+--+
5701 static int * const sr_capabilities_flags
[] = {
5702 &hf_bgp_ls_sr_tlv_capabilities_flags_i
,
5703 &hf_bgp_ls_sr_tlv_capabilities_flags_v
,
5704 &hf_bgp_ls_sr_tlv_capabilities_flags_h
,
5705 &hf_bgp_ls_sr_tlv_capabilities_flags_reserved
,
5710 tlv_item
= proto_tree_add_item(tree
, hf_bgp_ls_sr_tlv_capabilities
, tvb
, offset
, length
+ 4, ENC_NA
);
5711 tlv_tree
= proto_item_add_subtree(tlv_item
, ett_bgp_link_state
);
5712 proto_tree_add_item(tlv_tree
, hf_bgp_ls_type
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
5713 proto_tree_add_item(tlv_tree
, hf_bgp_ls_length
, tvb
, offset
+ 2, 2, ENC_BIG_ENDIAN
);
5714 proto_tree_add_bitmask(tlv_tree
, tvb
, offset
+ 4, hf_bgp_ls_sr_tlv_capabilities_flags
,
5715 ett_bgp_link_state
, sr_capabilities_flags
, ENC_BIG_ENDIAN
);
5716 /* past flags and reserved byte, we got one or more range + SID/Label Sub-TLV entries */
5717 offset2
= offset
+ 4 + 2;
5718 remaining_data
= length
- 2;
5719 while (remaining_data
> 0) {
5720 uint16_t sid_len
= 0;
5721 /* parse and consume the range field */
5722 proto_tree_add_item(tlv_tree
, hf_bgp_ls_sr_tlv_capabilities_range_size
, tvb
, offset2
, 3, ENC_BIG_ENDIAN
);
5724 /* parse and consume type/len fields */
5725 proto_tree_add_item(tlv_tree
, hf_bgp_ls_type
, tvb
, offset2
, 2, ENC_BIG_ENDIAN
);
5727 proto_tree_add_item(tlv_tree
, hf_bgp_ls_length
, tvb
, offset2
, 2, ENC_BIG_ENDIAN
);
5728 sid_len
= tvb_get_ntohs(tvb
, offset2
);
5731 /* parse and consume the SID/Label field */
5732 proto_tree_add_item(tlv_tree
, hf_bgp_ls_sr_tlv_capabilities_sid_label
, tvb
, offset2
, 3, ENC_BIG_ENDIAN
);
5734 remaining_data
-= 10;
5736 /* parse and consume the SID/Index field */
5737 proto_tree_add_item(tlv_tree
, hf_bgp_ls_sr_tlv_capabilities_sid_index
, tvb
, offset2
, 4, ENC_BIG_ENDIAN
);
5739 remaining_data
-= 11;
5745 case BGP_LS_SR_TLV_SR_LOCAL_BLOCK
:
5749 tlv_item
= proto_tree_add_item(tree
, hf_bgp_ls_sr_tlv_local_block
, tvb
, offset
, length
+ 4, ENC_NA
);
5750 tlv_tree
= proto_item_add_subtree(tlv_item
, ett_bgp_link_state
);
5751 proto_tree_add_item(tlv_tree
, hf_bgp_ls_type
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
5752 proto_tree_add_item(tlv_tree
, hf_bgp_ls_length
, tvb
, offset
+ 2, 2, ENC_BIG_ENDIAN
);
5753 proto_tree_add_item(tlv_tree
, hf_bgp_ls_sr_tlv_local_block_flags
, tvb
, offset
+ 4, 1, ENC_NA
);
5754 /* past flags and reserved byte, we got one or more range + SID/Label Sub-TLV entries */
5755 offset2
= offset
+ 4 + 2;
5756 remaining_data
= length
- 2;
5757 while (remaining_data
> 0) {
5758 uint16_t sid_len
= 0;
5759 /* parse and consume the range field */
5760 proto_tree_add_item(tlv_tree
, hf_bgp_ls_sr_tlv_local_block_range_size
, tvb
, offset2
, 3, ENC_BIG_ENDIAN
);
5762 /* parse and consume type/len fields */
5763 proto_tree_add_item(tlv_tree
, hf_bgp_ls_type
, tvb
, offset2
, 2, ENC_BIG_ENDIAN
);
5765 proto_tree_add_item(tlv_tree
, hf_bgp_ls_length
, tvb
, offset2
, 2, ENC_BIG_ENDIAN
);
5766 sid_len
= tvb_get_ntohs(tvb
, offset2
);
5769 /* parse and consume the SID/Label field */
5770 proto_tree_add_item(tlv_tree
, hf_bgp_ls_sr_tlv_local_block_sid_label
, tvb
, offset2
, 3, ENC_BIG_ENDIAN
);
5772 remaining_data
-= 10;
5774 /* parse and consume the SID/Index field */
5775 proto_tree_add_item(tlv_tree
, hf_bgp_ls_sr_tlv_local_block_sid_index
, tvb
, offset2
, 4, ENC_BIG_ENDIAN
);
5777 remaining_data
-= 11;
5783 case BGP_LS_SR_TLV_SR_ALGORITHM
:
5787 tlv_item
= proto_tree_add_item(tree
, hf_bgp_ls_sr_tlv_algorithm
, tvb
, offset
, length
+4, ENC_NA
);
5788 tlv_tree
= proto_item_add_subtree(tlv_item
, ett_bgp_link_state
);
5789 proto_tree_add_item(tlv_tree
, hf_bgp_ls_type
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
5790 proto_tree_add_item(tlv_tree
, hf_bgp_ls_length
, tvb
, offset
+ 2, 2, ENC_BIG_ENDIAN
);
5791 /* past type-length fields, we got one or more 'Algorithm N' value */
5792 offset2
= offset
+ 4;
5793 remaining_data
= length
;
5794 while (remaining_data
> 0) {
5795 proto_tree_add_item(tlv_tree
, hf_bgp_ls_sr_tlv_algorithm_value
, tvb
, offset2
, 1, ENC_NA
);
5797 remaining_data
-= 1;
5802 case BGP_LS_SR_TLV_SRV6_CAPABILITY
:
5804 static int * const srv6_cap_flags
[] = {
5805 &hf_bgp_ls_sr_tlv_srv6_cap_flags_o
,
5806 &hf_bgp_ls_sr_tlv_srv6_cap_flags_reserved
,
5809 tlv_item
= proto_tree_add_item(tree
, hf_bgp_ls_sr_tlv_srv6_cap
, tvb
, offset
, length
+ 4, ENC_NA
);
5810 tlv_tree
= proto_item_add_subtree(tlv_item
, ett_bgp_link_state
);
5811 proto_tree_add_item(tlv_tree
, hf_bgp_ls_type
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
5812 ti
= proto_tree_add_item(tlv_tree
, hf_bgp_ls_length
, tvb
, offset
+ 2, 2, ENC_BIG_ENDIAN
);
5814 expert_add_info_format(pinfo
, ti
, &ei_bgp_ls_error
,
5815 "Unexpected TLV Length (%u) in BGP-LS %s TLV, it must be %u bytes!",
5816 length
, "SRv6 Capabilities", 4);
5819 proto_tree_add_bitmask(tlv_tree
, tvb
, offset
+ 4, hf_bgp_ls_sr_tlv_srv6_cap_flags
,
5820 ett_bgp_link_state
, srv6_cap_flags
, ENC_BIG_ENDIAN
);
5821 proto_tree_add_item(tlv_tree
, hf_bgp_ls_sr_tlv_srv6_cap_reserved
, tvb
, offset
+ 6, 2, ENC_BIG_ENDIAN
);
5825 case BGP_LS_SR_TLV_FLEX_ALGO_DEF
:
5826 tlv_item
= proto_tree_add_item(tree
, hf_bgp_ls_sr_tlv_flex_algo_def
, tvb
, offset
, length
+4, ENC_NA
);
5827 tlv_tree
= proto_item_add_subtree(tlv_item
, ett_bgp_link_state
);
5828 proto_tree_add_item(tlv_tree
, hf_bgp_ls_type
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
5829 proto_tree_add_item(tlv_tree
, hf_bgp_ls_length
, tvb
, offset
+ 2, 2, ENC_BIG_ENDIAN
);
5830 proto_tree_add_item(tlv_tree
, hf_bgp_ls_sr_tlv_flex_algo_algorithm
, tvb
, offset
+ 4, 1, ENC_NA
);
5831 proto_tree_add_item(tlv_tree
, hf_bgp_ls_sr_tlv_flex_algo_metric_type
, tvb
, offset
+ 5, 1, ENC_NA
);
5832 proto_tree_add_item(tlv_tree
, hf_bgp_ls_sr_tlv_flex_algo_calc_type
, tvb
, offset
+ 6, 1, ENC_NA
);
5833 proto_tree_add_item(tlv_tree
, hf_bgp_ls_sr_tlv_flex_algo_priority
, tvb
, offset
+ 7, 1, ENC_NA
);
5834 local_offset
= offset
+ 8;
5835 while (local_offset
< offset
+ length
) {
5836 advance
= decode_link_state_attribute_flex_algo_subtlv(tlv_tree
, tvb
, local_offset
, pinfo
, protocol_id
);
5840 local_offset
+= advance
;
5844 /* NODE & LINK ATTRIBUTE TLVs */
5845 case BGP_NLRI_TLV_NODE_MSD
:
5846 case BGP_NLRI_TLV_LINK_MSD
:
5847 tlv_item
= proto_tree_add_item(tree
,
5848 (type
== BGP_NLRI_TLV_NODE_MSD
?
5849 hf_bgp_ls_tlv_node_msd
: hf_bgp_ls_tlv_link_msd
),
5850 tvb
, offset
, length
+ 4, ENC_NA
);
5851 tlv_tree
= proto_item_add_subtree(tlv_item
, ett_bgp_mp_reach_nlri
);
5852 proto_tree_add_item(tlv_tree
, hf_bgp_ls_type
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
5853 proto_tree_add_item(tlv_tree
, hf_bgp_ls_length
, tvb
, offset
+ 2, 2, ENC_BIG_ENDIAN
);
5854 local_offset
= offset
+ 4;
5855 local_length
= length
;
5856 while (local_length
>= 2) {
5857 proto_tree_add_item(tlv_tree
, hf_bgp_ls_tlv_igp_msd_type
, tvb
, local_offset
, 1, ENC_NA
);
5858 proto_tree_add_item(tlv_tree
, hf_bgp_ls_tlv_igp_msd_value
, tvb
, local_offset
+1, 1, ENC_NA
);
5864 case BGP_NLRI_TLV_IPV4_ROUTER_ID_OF_LOCAL_NODE
:
5865 tlv_item
= proto_tree_add_item(tree
, hf_bgp_ls_tlv_ipv4_router_id_of_local_node
, tvb
, offset
, length
+4, ENC_NA
);
5866 tlv_tree
= proto_item_add_subtree(tlv_item
, ett_bgp_link_state
);
5867 proto_tree_add_item(tlv_tree
, hf_bgp_ls_type
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
5868 proto_tree_add_item(tlv_tree
, hf_bgp_ls_length
, tvb
, offset
+ 2, 2, ENC_BIG_ENDIAN
);
5869 if(length
!= BGP_NLRI_TLV_LEN_IPV4_ROUTER_ID_OF_LOCAL_NODE
){
5870 expert_add_info_format(pinfo
, tlv_tree
, &ei_bgp_ls_error
, "Unexpected IPv4 Router-ID TLV's length (%u), it must be %u bytes!",
5871 length
, BGP_NLRI_TLV_LEN_IPV4_ROUTER_ID_OF_LOCAL_NODE
);
5874 proto_tree_add_item(tlv_tree
, hf_bgp_ls_tlv_ipv4_router_id_value
, tvb
, offset
+ 4, 4, ENC_BIG_ENDIAN
);
5876 case BGP_NLRI_TLV_IPV6_ROUTER_ID_OF_LOCAL_NODE
:
5877 tlv_item
= proto_tree_add_item(tree
, hf_bgp_ls_tlv_ipv6_router_id_of_local_node
, tvb
, offset
, length
+4, ENC_NA
);
5878 tlv_tree
= proto_item_add_subtree(tlv_item
, ett_bgp_link_state
);
5879 proto_tree_add_item(tlv_tree
, hf_bgp_ls_type
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
5880 proto_tree_add_item(tlv_tree
, hf_bgp_ls_length
, tvb
, offset
+ 2, 2, ENC_BIG_ENDIAN
);
5881 if(length
!= BGP_NLRI_TLV_LEN_IPV6_ROUTER_ID_OF_LOCAL_NODE
){
5882 expert_add_info_format(pinfo
, tlv_tree
, &ei_bgp_ls_error
, "Unexpected IPv6 Router-ID TLV's length (%u), it must be %u bytes!",
5883 length
, BGP_NLRI_TLV_LEN_IPV6_ROUTER_ID_OF_LOCAL_NODE
);
5886 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
);
5889 /* Link Attribute TLVs */
5890 case BGP_NLRI_TLV_LINK_LOCAL_REMOTE_IDENTIFIERS
:
5891 if (length
!= BGP_NLRI_TLV_LEN_LINK_LOCAL_REMOTE_IDENTIFIERS
) {
5892 expert_add_info_format(pinfo
, tree
, &ei_bgp_ls_error
,
5893 "Unexpected Link Local/Remote Identifiers TLV's length (%u), it must be %u bytes!",
5894 length
, BGP_NLRI_TLV_LEN_LINK_LOCAL_REMOTE_IDENTIFIERS
);
5897 tlv_item
= proto_tree_add_item(tree
,
5898 hf_bgp_ls_tlv_link_local_remote_identifiers
, tvb
, offset
,
5899 length
+ 4, ENC_NA
);
5900 tlv_tree
= proto_item_add_subtree(tlv_item
, ett_bgp_mp_reach_nlri
);
5901 proto_tree_add_item(tlv_tree
, hf_bgp_ls_type
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
5902 proto_tree_add_item(tlv_tree
, hf_bgp_ls_length
, tvb
, offset
+ 2, 2, ENC_BIG_ENDIAN
);
5903 proto_tree_add_item(tlv_tree
, hf_bgp_ls_nlri_link_local_identifier
, tvb
, offset
+ 4, 4, ENC_BIG_ENDIAN
);
5904 proto_tree_add_item(tlv_tree
, hf_bgp_ls_nlri_link_remote_identifier
, tvb
, offset
+ 8, 4, ENC_BIG_ENDIAN
);
5907 case BGP_NLRI_TLV_IPV4_ROUTER_ID_OF_REMOTE_NODE
:
5908 tlv_item
= proto_tree_add_item(tree
, hf_bgp_ls_tlv_ipv4_router_id_of_remote_node
, tvb
, offset
, length
+4, ENC_NA
);
5909 tlv_tree
= proto_item_add_subtree(tlv_item
, ett_bgp_link_state
);
5910 proto_tree_add_item(tlv_tree
, hf_bgp_ls_type
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
5911 proto_tree_add_item(tlv_tree
, hf_bgp_ls_length
, tvb
, offset
+ 2, 2, ENC_BIG_ENDIAN
);
5912 if(length
!= BGP_NLRI_TLV_LEN_IPV4_ROUTER_ID_OF_REMOTE_NODE
){
5913 expert_add_info_format(pinfo
, tlv_tree
, &ei_bgp_ls_error
, "Unexpected IPv4 Router-ID TLV's length (%u), it must be %u bytes!",
5914 length
, BGP_NLRI_TLV_LEN_IPV4_ROUTER_ID_OF_REMOTE_NODE
);
5917 proto_tree_add_item(tlv_tree
, hf_bgp_ls_tlv_ipv4_router_id_value
, tvb
, offset
+ 4, 4, ENC_BIG_ENDIAN
);
5920 case BGP_NLRI_TLV_IPV6_ROUTER_ID_OF_REMOTE_NODE
:
5921 tlv_item
= proto_tree_add_item(tree
, hf_bgp_ls_tlv_ipv6_router_id_of_remote_node
, tvb
, offset
, length
+4, ENC_NA
);
5922 tlv_tree
= proto_item_add_subtree(tlv_item
, ett_bgp_link_state
);
5923 proto_tree_add_item(tlv_tree
, hf_bgp_ls_type
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
5924 proto_tree_add_item(tlv_tree
, hf_bgp_ls_length
, tvb
, offset
+ 2, 2, ENC_BIG_ENDIAN
);
5925 if(length
!= BGP_NLRI_TLV_LEN_IPV6_ROUTER_ID_OF_REMOTE_NODE
){
5926 expert_add_info_format(pinfo
, tlv_tree
, &ei_bgp_ls_error
, "Unexpected IPv6 Router-ID TLV's length (%u), it must be %u bytes!",
5927 length
, BGP_NLRI_TLV_LEN_IPV6_ROUTER_ID_OF_REMOTE_NODE
);
5930 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
);
5933 case BGP_NLRI_TLV_ADMINISTRATIVE_GROUP_COLOR
:
5934 tlv_item
= proto_tree_add_item(tree
, hf_bgp_ls_tlv_administrative_group_color
, tvb
, offset
, length
+4, ENC_NA
);
5935 tlv_tree
= proto_item_add_subtree(tlv_item
, ett_bgp_link_state
);
5936 if(length
!= BGP_NLRI_TLV_LEN_ADMINISTRATIVE_GROUP_COLOR
){
5937 expert_add_info_format(pinfo
, tlv_tree
, &ei_bgp_ls_error
, "Unexpected Administrative group (color) TLV's length (%u), it must be %u bytes!",
5938 length
, BGP_NLRI_TLV_LEN_ADMINISTRATIVE_GROUP_COLOR
);
5941 proto_tree_add_item(tlv_tree
, hf_bgp_ls_type
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
5942 proto_tree_add_item(tlv_tree
, hf_bgp_ls_length
, tvb
, offset
+ 2, 2, ENC_BIG_ENDIAN
);
5943 tmp32
= tvb_get_ntohl(tvb
, offset
+ 4);
5944 tlv_sub_item
= proto_tree_add_item(tlv_tree
, hf_bgp_ls_tlv_administrative_group_color_value
, tvb
, offset
+ 4, 4, ENC_BIG_ENDIAN
);
5945 tlv_sub_tree
= proto_item_add_subtree(tlv_sub_item
, ett_bgp_prefix
);
5947 for(n
= 0; n
<32; n
++){
5948 if( tmp32
& mask
) proto_tree_add_uint(tlv_sub_tree
, hf_bgp_ls_tlv_administrative_group
, tvb
, offset
+ 4, 4, n
);
5953 case BGP_NLRI_TLV_MAX_LINK_BANDWIDTH
:
5954 tlv_item
= proto_tree_add_item(tree
, hf_bgp_ls_tlv_max_link_bandwidth
, tvb
, offset
, length
+4, ENC_NA
);
5955 tlv_tree
= proto_item_add_subtree(tlv_item
, ett_bgp_link_state
);
5956 if(length
!= BGP_NLRI_TLV_LEN_MAX_LINK_BANDWIDTH
){
5957 expert_add_info_format(pinfo
, tlv_tree
, &ei_bgp_ls_error
, "Unexpected Maximum link bandwidth TLV's length (%u), it must be %u bytes!",
5958 length
, BGP_NLRI_TLV_LEN_MAX_LINK_BANDWIDTH
);
5961 proto_tree_add_item(tlv_tree
, hf_bgp_ls_type
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
5962 proto_tree_add_item(tlv_tree
, hf_bgp_ls_length
, tvb
, offset
+ 2, 2, ENC_BIG_ENDIAN
);
5963 tmp_float
= tvb_get_ntohieee_float(tvb
, offset
+ 4)*8/1000000;
5964 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
);
5967 case BGP_NLRI_TLV_MAX_RESERVABLE_LINK_BANDWIDTH
:
5968 tlv_item
= proto_tree_add_item(tree
, hf_bgp_ls_tlv_max_reservable_link_bandwidth
, tvb
, offset
, length
+4, ENC_NA
);
5969 tlv_tree
= proto_item_add_subtree(tlv_item
, ett_bgp_link_state
);
5970 if(length
!= BGP_NLRI_TLV_LEN_MAX_RESERVABLE_LINK_BANDWIDTH
){
5971 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!",
5972 length
, BGP_NLRI_TLV_LEN_MAX_RESERVABLE_LINK_BANDWIDTH
);
5975 proto_tree_add_item(tlv_tree
, hf_bgp_ls_type
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
5976 proto_tree_add_item(tlv_tree
, hf_bgp_ls_length
, tvb
, offset
+ 2, 2, ENC_BIG_ENDIAN
);
5977 tmp_float
= tvb_get_ntohieee_float(tvb
, offset
+ 4)*8/1000000;
5978 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
);
5981 case BGP_NLRI_TLV_UNRESERVED_BANDWIDTH
:
5982 tlv_item
= proto_tree_add_item(tree
, hf_bgp_ls_tlv_unreserved_bandwidth
, tvb
, offset
, length
+4, ENC_NA
);
5983 tlv_tree
= proto_item_add_subtree(tlv_item
, ett_bgp_link_state
);
5984 if(length
!= BGP_NLRI_TLV_LEN_UNRESERVED_BANDWIDTH
){
5985 expert_add_info_format(pinfo
, tlv_tree
, &ei_bgp_ls_error
, "Unexpected Unreserved bandwidth TLV's length (%u), it must be %u bytes!",
5986 length
, BGP_NLRI_TLV_LEN_UNRESERVED_BANDWIDTH
);
5989 proto_tree_add_item(tlv_tree
, hf_bgp_ls_type
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
5990 proto_tree_add_item(tlv_tree
, hf_bgp_ls_length
, tvb
, offset
+ 2, 2, ENC_BIG_ENDIAN
);
5991 for(n
= 0; n
<8; n
++){
5992 tmp_float
= tvb_get_ntohieee_float(tvb
, offset
+ 4 + (4 * n
))*8/1000000;
5993 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
);
5994 proto_item_prepend_text(tlv_sub_item
, "Priority %u, ", n
);
5998 case BGP_NLRI_TLV_TE_DEFAULT_METRIC
:
5999 tlv_item
= proto_tree_add_item(tree
, hf_bgp_ls_tlv_te_default_metric
, tvb
, offset
, length
+4, ENC_NA
);
6000 tlv_tree
= proto_item_add_subtree(tlv_item
, ett_bgp_link_state
);
6001 /* FF: The 'TE Default Metric TLV's length changed. From draft-ietf-idr-ls-distribution-00 to 04
6002 was 3 bytes as per RFC5305/3.7, since version 05 is 4 bytes. Here we try to parse both formats
6003 without complain because there are real implementations out there based on the 3 bytes size. At
6004 the same time we clearly highlight that 3 is "old" and 4 is correct via expert info. */
6005 if (length
== BGP_NLRI_TLV_LEN_TE_DEFAULT_METRIC_OLD
) {
6006 expert_add_info_format(pinfo
, tlv_tree
, &ei_bgp_ls_warn
,
6007 "Old TE Default Metric TLV's length (%u), it should be %u bytes!",
6009 BGP_NLRI_TLV_LEN_TE_DEFAULT_METRIC_NEW
);
6010 /* just a warning do not give up dissection */
6012 if (length
!= BGP_NLRI_TLV_LEN_TE_DEFAULT_METRIC_OLD
&& length
!= BGP_NLRI_TLV_LEN_TE_DEFAULT_METRIC_NEW
) {
6013 expert_add_info_format(pinfo
, tlv_tree
, &ei_bgp_ls_error
,
6014 "Unexpected TE Default Metric TLV's length (%u), it must be %u or %u bytes!",
6016 BGP_NLRI_TLV_LEN_TE_DEFAULT_METRIC_OLD
,
6017 BGP_NLRI_TLV_LEN_TE_DEFAULT_METRIC_NEW
);
6018 /* major error give up dissection */
6021 proto_tree_add_item(tlv_tree
, hf_bgp_ls_type
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
6022 proto_tree_add_item(tlv_tree
, hf_bgp_ls_length
, tvb
, offset
+ 2, 2, ENC_BIG_ENDIAN
);
6023 if (length
== BGP_NLRI_TLV_LEN_TE_DEFAULT_METRIC_OLD
) {
6024 proto_tree_add_item(tlv_tree
, hf_bgp_ls_tlv_te_default_metric_value_old
, tvb
, offset
+ 4, 3, ENC_BIG_ENDIAN
);
6025 } else if (length
== BGP_NLRI_TLV_LEN_TE_DEFAULT_METRIC_NEW
) {
6026 proto_tree_add_item(tlv_tree
, hf_bgp_ls_tlv_te_default_metric_value
, tvb
, offset
+ 4, 4, ENC_BIG_ENDIAN
);
6030 case BGP_NLRI_TLV_LINK_PROTECTION_TYPE
:
6031 tlv_item
= proto_tree_add_item(tree
, hf_bgp_ls_tlv_link_protection_type
, tvb
, offset
, length
+4, ENC_NA
);
6032 tlv_tree
= proto_item_add_subtree(tlv_item
, ett_bgp_link_state
);
6033 if(length
!= BGP_NLRI_TLV_LEN_LINK_PROTECTION_TYPE
){
6034 expert_add_info_format(pinfo
, tlv_tree
, &ei_bgp_ls_error
, "Unexpected Link Protection Type TLV's length (%u), it must be %u bytes!",
6035 length
, BGP_NLRI_TLV_LEN_LINK_PROTECTION_TYPE
);
6039 static int * const nlri_flags
[] = {
6040 &hf_bgp_ls_link_protection_type_extra_traffic
,
6041 &hf_bgp_ls_link_protection_type_unprotected
,
6042 &hf_bgp_ls_link_protection_type_shared
,
6043 &hf_bgp_ls_link_protection_type_dedicated_1to1
,
6044 &hf_bgp_ls_link_protection_type_dedicated_1plus1
,
6045 &hf_bgp_ls_link_protection_type_enhanced
,
6049 proto_tree_add_item(tlv_tree
, hf_bgp_ls_type
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
6050 proto_tree_add_item(tlv_tree
, hf_bgp_ls_length
, tvb
, offset
+ 2, 2, ENC_BIG_ENDIAN
);
6051 tmp8
= tvb_get_uint8(tvb
, offset
+ 4);
6053 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
);
6056 expert_add_info_format(pinfo
, tlv_sub_item
, &ei_bgp_ls_error
, "Reserved Protection Capabilities bits are not set to zero (%u).", tmp8
);
6058 tmp8
= tvb_get_uint8(tvb
, offset
+ 4 + 1);
6060 expert_add_info_format(pinfo
, tlv_tree
, &ei_bgp_ls_error
, "Reserved field is not set to zero. (%u)", tmp8
);
6064 case BGP_NLRI_TLV_MPLS_PROTOCOL_MASK
:
6066 static int * const flags
[] = {
6067 &hf_bgp_ls_mpls_protocol_mask_flag_l
,
6068 &hf_bgp_ls_mpls_protocol_mask_flag_r
,
6072 tlv_item
= proto_tree_add_item(tree
, hf_bgp_ls_tlv_mpls_protocol_mask
, tvb
, offset
, length
+4, ENC_NA
);
6073 tlv_tree
= proto_item_add_subtree(tlv_item
, ett_bgp_link_state
);
6074 if(length
!= BGP_NLRI_TLV_LEN_MPLS_PROTOCOL_MASK
){
6075 expert_add_info_format(pinfo
, tlv_tree
, &ei_bgp_ls_error
, "Unexpected MPLS Protocol Mask TLV's length (%u), it must be %u bytes!",
6076 length
, BGP_NLRI_TLV_LEN_MPLS_PROTOCOL_MASK
);
6079 proto_tree_add_item(tlv_tree
, hf_bgp_ls_type
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
6080 proto_tree_add_item(tlv_tree
, hf_bgp_ls_length
, tvb
, offset
+ 2, 2, ENC_BIG_ENDIAN
);
6081 proto_tree_add_bitmask_list(tlv_tree
, tvb
, offset
+4, 1, flags
, ENC_NA
);
6082 tmp8
= tvb_get_uint8(tvb
, offset
+ 4) & 0x3f;
6084 proto_tree_add_expert_format(tlv_tree
, pinfo
, &ei_bgp_ls_error
, tvb
, offset
+ 4, 1,
6085 "Reserved flags are not set to zero (%u).", tmp8
);
6089 case BGP_NLRI_TLV_METRIC
:
6090 /* FF: The IGP 'Metric TLV's length changed. From draft-ietf-idr-ls-distribution-00 to 02
6091 was fixed at 3 bytes, since version 03 is variable 1/2/3 bytes. We cannot complain if
6092 length is not fixed at 3. */
6093 tlv_item
= proto_tree_add_item(tree
, hf_bgp_ls_tlv_metric
, tvb
, offset
, length
+ 4, ENC_NA
);
6094 tlv_tree
= proto_item_add_subtree(tlv_item
, ett_bgp_link_state
);
6095 if (length
> BGP_NLRI_TLV_LEN_MAX_METRIC
) {
6096 expert_add_info_format(pinfo
, tlv_tree
, &ei_bgp_ls_error
,
6097 "Unexpected Metric TLV's length (%u), it must be less than %u bytes!",
6098 length
, BGP_NLRI_TLV_LEN_MAX_METRIC
);
6101 proto_tree_add_item(tlv_tree
, hf_bgp_ls_type
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
6102 proto_tree_add_item(tlv_tree
, hf_bgp_ls_length
, tvb
, offset
+ 2, 2, ENC_BIG_ENDIAN
);
6104 proto_tree_add_item(tlv_tree
, hf_bgp_ls_tlv_metric_value1
, tvb
, offset
+ 4, 1, ENC_BIG_ENDIAN
);
6105 } else if (length
== 2) {
6106 proto_tree_add_item(tlv_tree
, hf_bgp_ls_tlv_metric_value2
, tvb
, offset
+ 4, 2, ENC_BIG_ENDIAN
);
6107 } else if (length
== 3) {
6108 proto_tree_add_item(tlv_tree
, hf_bgp_ls_tlv_metric_value3
, tvb
, offset
+ 4, 3, ENC_BIG_ENDIAN
);
6111 case BGP_NLRI_TLV_SHARED_RISK_LINK_GROUP
:
6112 tlv_item
= proto_tree_add_item(tree
, hf_bgp_ls_tlv_shared_risk_link_group
, tvb
, offset
, length
+4, ENC_NA
);
6113 tlv_tree
= proto_item_add_subtree(tlv_item
, ett_bgp_link_state
);
6114 proto_tree_add_item(tlv_tree
, hf_bgp_ls_type
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
6115 proto_tree_add_item(tlv_tree
, hf_bgp_ls_length
, tvb
, offset
+ 2, 2, ENC_BIG_ENDIAN
);
6120 proto_tree_add_expert_format(tlv_tree
, pinfo
, &ei_bgp_ls_error
,
6121 tvb
, offset
+ 4 + (n
* 4), tmp16
,
6122 "Shared Risk Link Group Value must be 4 bytes long (%u).", tmp16
);
6125 proto_tree_add_item(tlv_tree
, hf_bgp_ls_tlv_shared_risk_link_group_value
, tvb
, offset
+ 4 + (n
* 4), 4, ENC_BIG_ENDIAN
);
6131 case BGP_NLRI_TLV_OPAQUE_LINK_ATTRIBUTE
:
6132 tlv_item
= proto_tree_add_item(tree
, hf_bgp_ls_tlv_opaque_link_attribute
, tvb
, offset
, length
+4, ENC_NA
);
6133 tlv_tree
= proto_item_add_subtree(tlv_item
, ett_bgp_link_state
);
6134 proto_tree_add_item(tlv_tree
, hf_bgp_ls_type
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
6135 proto_tree_add_item(tlv_tree
, hf_bgp_ls_length
, tvb
, offset
+ 2, 2, ENC_BIG_ENDIAN
);
6136 proto_tree_add_item(tlv_tree
, hf_bgp_ls_tlv_opaque_link_attribute_value
, tvb
, offset
+ 4, length
, ENC_NA
);
6139 case BGP_NLRI_TLV_LINK_NAME_ATTRIBUTE
:
6140 tlv_item
= proto_tree_add_item(tree
, hf_bgp_ls_tlv_link_name_attribute
, tvb
, offset
, length
+4, ENC_NA
);
6141 tlv_tree
= proto_item_add_subtree(tlv_item
, ett_bgp_link_state
);
6142 proto_tree_add_item(tlv_tree
, hf_bgp_ls_type
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
6143 proto_tree_add_item(tlv_tree
, hf_bgp_ls_length
, tvb
, offset
+ 2, 2, ENC_BIG_ENDIAN
);
6144 proto_tree_add_item(tlv_tree
, hf_bgp_ls_tlv_link_name_attribute_value
, tvb
, offset
+ 4, length
, ENC_ASCII
);
6147 case BGP_LS_SR_TLV_ADJ_SID
:
6151 +--+--+--+--+--+--+--+--+
6152 |F |B |V |L |S |P | | |
6153 +--+--+--+--+--+--+--+--+
6155 static int * const adj_sid_isis_flags
[] = {
6156 &hf_bgp_ls_sr_tlv_adjacency_sid_flags_fi
,
6157 &hf_bgp_ls_sr_tlv_adjacency_sid_flags_bi
,
6158 &hf_bgp_ls_sr_tlv_adjacency_sid_flags_vi
,
6159 &hf_bgp_ls_sr_tlv_adjacency_sid_flags_li
,
6160 &hf_bgp_ls_sr_tlv_adjacency_sid_flags_si
,
6161 &hf_bgp_ls_sr_tlv_adjacency_sid_flags_pi
,
6166 +--+--+--+--+--+--+--+--+
6167 |B |V |L |G |P | | | |
6168 +--+--+--+--+--+--+--+--+
6170 static int * const adj_sid_ospf_flags
[] = {
6171 &hf_bgp_ls_sr_tlv_adjacency_sid_flags_bo
,
6172 &hf_bgp_ls_sr_tlv_adjacency_sid_flags_vo
,
6173 &hf_bgp_ls_sr_tlv_adjacency_sid_flags_lo
,
6174 &hf_bgp_ls_sr_tlv_adjacency_sid_flags_go
,
6175 &hf_bgp_ls_sr_tlv_adjacency_sid_flags_po
,
6179 tlv_item
= proto_tree_add_item(tree
, hf_bgp_ls_sr_tlv_adjacency_sid
, tvb
, offset
, length
+ 4, ENC_NA
);
6180 tlv_tree
= proto_item_add_subtree(tlv_item
, ett_bgp_link_state
);
6181 proto_tree_add_item(tlv_tree
, hf_bgp_ls_type
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
6182 proto_tree_add_item(tlv_tree
, hf_bgp_ls_length
, tvb
, offset
+ 2, 2, ENC_BIG_ENDIAN
);
6183 if ((protocol_id
== BGP_LS_NLRI_PROTO_ID_OSPF_V2
) || (protocol_id
== BGP_LS_NLRI_PROTO_ID_OSPF_V3
)) {
6184 proto_tree_add_bitmask(tlv_tree
, tvb
, offset
+ 4, hf_bgp_ls_sr_tlv_adjacency_sid_flags
,
6185 ett_bgp_link_state
, adj_sid_ospf_flags
, ENC_BIG_ENDIAN
);
6187 /* FF: most common case is IS-IS, so if it is not OSPF we go that way */
6188 proto_tree_add_bitmask(tlv_tree
, tvb
, offset
+ 4, hf_bgp_ls_sr_tlv_adjacency_sid_flags
,
6189 ett_bgp_link_state
, adj_sid_isis_flags
, ENC_BIG_ENDIAN
);
6191 proto_tree_add_item(tlv_tree
, hf_bgp_ls_sr_tlv_adjacency_sid_weight
, tvb
, offset
+ 5, 1, ENC_BIG_ENDIAN
);
6193 proto_tree_add_item(tlv_tree
, hf_bgp_ls_sr_tlv_adjacency_sid_label
, tvb
, offset
+ 8, 3, ENC_BIG_ENDIAN
);
6195 proto_tree_add_item(tlv_tree
, hf_bgp_ls_sr_tlv_adjacency_sid_index
, tvb
, offset
+ 8, 4, ENC_BIG_ENDIAN
);
6200 case BGP_LS_SR_TLV_LAN_ADJ_SID
:
6203 case BGP_LS_SR_TLV_PEER_NODE_SID
:
6204 case BGP_LS_SR_TLV_PEER_ADJ_SID
:
6205 case BGP_LS_SR_TLV_PEER_SET_SID
:
6209 +--+--+--+--+--+--+--+--+
6210 |V |L |B |P | | | | | rfc9086
6211 +--+--+--+--+--+--+--+--+
6213 static int * const peer_sid_flags
[] = {
6214 &hf_bgp_ls_sr_tlv_peer_sid_flags_v
,
6215 &hf_bgp_ls_sr_tlv_peer_sid_flags_l
,
6216 &hf_bgp_ls_sr_tlv_peer_sid_flags_b
,
6217 &hf_bgp_ls_sr_tlv_peer_sid_flags_p
,
6221 tlv_item
= proto_tree_add_item(tree
,
6222 (type
== BGP_LS_SR_TLV_PEER_NODE_SID
?
6223 hf_bgp_ls_sr_tlv_peer_node_sid
:
6224 (type
== BGP_LS_SR_TLV_PEER_ADJ_SID
?
6225 hf_bgp_ls_sr_tlv_peer_adj_sid
:
6226 hf_bgp_ls_sr_tlv_peer_set_sid
)),
6227 tvb
, offset
, length
+ 4, ENC_NA
);
6228 tlv_tree
= proto_item_add_subtree(tlv_item
, ett_bgp_link_state
);
6229 proto_tree_add_item(tlv_tree
, hf_bgp_ls_type
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
6230 ti
= proto_tree_add_item(tlv_tree
, hf_bgp_ls_length
, tvb
, offset
+ 2, 2, ENC_BIG_ENDIAN
);
6231 if (length
!= 7 && length
!= 8) {
6232 expert_add_info_format(pinfo
, ti
, &ei_bgp_ls_error
,
6233 "Unexpected TLV Length (%u) in BGP-LS Peer SID TLV, it must be either 7 or 8 bytes!",
6237 proto_tree_add_bitmask(tlv_tree
, tvb
, offset
+ 4, hf_bgp_ls_sr_tlv_peer_sid_flags
,
6238 ett_bgp_link_state
, peer_sid_flags
, ENC_BIG_ENDIAN
);
6239 proto_tree_add_item(tlv_tree
, hf_bgp_ls_sr_tlv_peer_sid_weight
, tvb
, offset
+ 5, 1, ENC_BIG_ENDIAN
);
6241 proto_tree_add_item(tlv_tree
, hf_bgp_ls_sr_tlv_peer_sid_label
, tvb
, offset
+ 8, 3, ENC_BIG_ENDIAN
);
6243 proto_tree_add_item(tlv_tree
, hf_bgp_ls_sr_tlv_peer_sid_index
, tvb
, offset
+ 8, 4, ENC_BIG_ENDIAN
);
6248 case BGP_LS_SR_TLV_SRV6_END_X_SID
:
6249 tlv_item
= proto_tree_add_item(tree
, hf_bgp_ls_sr_tlv_srv6_endx_sid
,
6250 tvb
, offset
, length
+ 4, ENC_NA
);
6251 tlv_tree
= proto_item_add_subtree(tlv_item
, ett_bgp_link_state
);
6252 proto_tree_add_item(tlv_tree
, hf_bgp_ls_type
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
6253 ti
= proto_tree_add_item(tlv_tree
, hf_bgp_ls_length
, tvb
, offset
+ 2, 2, ENC_BIG_ENDIAN
);
6255 expert_add_info_format(pinfo
, ti
, &ei_bgp_ls_error
,
6256 "Unexpected TLV Length (%u) in BGP-LS %s TLV, it must be %u bytes or more!",
6257 length
, "SRv6 End.X SID", 20);
6260 proto_tree_add_item(tlv_tree
, hf_bgp_ls_sr_tlv_srv6_endx_sid_endpoint_behavior
, tvb
, offset
+ 4, 2, ENC_NA
);
6261 proto_tree_add_bitmask(tlv_tree
, tvb
, offset
+ 6,
6262 hf_bgp_ls_sr_tlv_srv6_endx_sid_flags
,
6263 ett_bgp_link_state
, srv6_endx_sid_flags
, ENC_BIG_ENDIAN
);
6264 proto_tree_add_item(tlv_tree
, hf_bgp_ls_sr_tlv_srv6_endx_sid_algo
, tvb
, offset
+ 7, 1, ENC_NA
);
6265 proto_tree_add_item(tlv_tree
, hf_bgp_ls_sr_tlv_srv6_endx_sid_weight
, tvb
, offset
+ 8, 1, ENC_BIG_ENDIAN
);
6266 proto_tree_add_item(tlv_tree
, hf_bgp_ls_sr_tlv_srv6_endx_sid_reserved
, tvb
, offset
+ 9, 1, ENC_BIG_ENDIAN
);
6267 proto_tree_add_item(tlv_tree
, hf_bgp_ls_sr_tlv_srv6_endx_sid_sid
, tvb
, offset
+ 10, 16, ENC_NA
);
6268 local_offset
= offset
+ 26;
6269 while (local_offset
< offset
+ length
) {
6270 advance
= decode_link_state_attribute_tlv(tlv_tree
, tvb
, local_offset
, pinfo
, protocol_id
);
6274 local_offset
+= advance
;
6278 case BGP_LS_SR_TLV_SRV6_LAN_END_X_SID
:
6279 tlv_item
= proto_tree_add_item(tree
, hf_bgp_ls_sr_tlv_srv6_lan_endx_sid
,
6280 tvb
, offset
, length
+4, ENC_NA
);
6281 tlv_tree
= proto_item_add_subtree(tlv_item
, ett_bgp_link_state
);
6282 proto_tree_add_item(tlv_tree
, hf_bgp_ls_type
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
6283 ti
= proto_tree_add_item(tlv_tree
, hf_bgp_ls_length
, tvb
, offset
+ 2, 2, ENC_BIG_ENDIAN
);
6284 if ((((protocol_id
== BGP_LS_NLRI_PROTO_ID_OSPF_V2
) || (protocol_id
== BGP_LS_NLRI_PROTO_ID_OSPF_V3
)) && length
< 26) ||
6285 ((protocol_id
== BGP_LS_NLRI_PROTO_ID_IS_IS_LEVEL_1
||
6286 protocol_id
== BGP_LS_NLRI_PROTO_ID_IS_IS_LEVEL_2
) && length
< 28)) {
6287 expert_add_info_format(pinfo
, ti
, &ei_bgp_ls_error
,
6288 "Unexpected TLV Length (%u) in BGP-LS %s TLV, it must be %u bytes or more!",
6289 length
, "SRv6 LAN End.X SID",
6290 ((protocol_id
== BGP_LS_NLRI_PROTO_ID_OSPF_V2
) || (protocol_id
== BGP_LS_NLRI_PROTO_ID_OSPF_V3
)) ? 26 : 28);
6293 proto_tree_add_item(tlv_tree
, hf_bgp_ls_sr_tlv_srv6_endx_sid_endpoint_behavior
, tvb
, offset
+ 4, 2, ENC_NA
);
6294 proto_tree_add_bitmask(tlv_tree
, tvb
, offset
+ 6,
6295 hf_bgp_ls_sr_tlv_srv6_endx_sid_flags
,
6296 ett_bgp_link_state
, srv6_endx_sid_flags
, ENC_BIG_ENDIAN
);
6297 proto_tree_add_item(tlv_tree
, hf_bgp_ls_sr_tlv_srv6_endx_sid_algo
, tvb
, offset
+ 7, 1, ENC_NA
);
6298 proto_tree_add_item(tlv_tree
, hf_bgp_ls_sr_tlv_srv6_endx_sid_weight
, tvb
, offset
+ 8, 1, ENC_BIG_ENDIAN
);
6299 proto_tree_add_item(tlv_tree
, hf_bgp_ls_sr_tlv_srv6_endx_sid_reserved
, tvb
, offset
+ 9, 1, ENC_BIG_ENDIAN
);
6300 local_offset
= offset
+ 10;
6301 if ((protocol_id
== BGP_LS_NLRI_PROTO_ID_OSPF_V2
) || (protocol_id
== BGP_LS_NLRI_PROTO_ID_OSPF_V3
)) {
6302 proto_tree_add_item(tlv_tree
, hf_bgp_ls_sr_tlv_srv6_endx_sid_neighbor_ospf
, tvb
, local_offset
, 4, ENC_BIG_ENDIAN
);
6305 /* FF: most common case is IS-IS, so if it is not OSPF we go that way */
6306 proto_tree_add_item(tlv_tree
, hf_bgp_ls_sr_tlv_srv6_endx_sid_neighbor_isis
, tvb
, local_offset
, 6, ENC_BIG_ENDIAN
);
6309 proto_tree_add_item(tlv_tree
, hf_bgp_ls_sr_tlv_srv6_endx_sid_sid
, tvb
, local_offset
, 16, ENC_NA
);
6311 while (local_offset
< offset
+ length
) {
6312 advance
= decode_link_state_attribute_tlv(tlv_tree
, tvb
, local_offset
, pinfo
, protocol_id
);
6316 local_offset
+= advance
;
6320 case BGP_LS_APP_SPEC_LINK_ATTR
:
6321 tlv_item
= proto_tree_add_item(tree
, hf_bgp_ls_tlv_app_spec_link_attrs
, tvb
, offset
, length
+ 4, ENC_NA
);
6322 tlv_tree
= proto_item_add_subtree(tlv_item
, ett_bgp_link_state
);
6323 proto_tree_add_item(tlv_tree
, hf_bgp_ls_type
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
6324 proto_tree_add_item(tlv_tree
, hf_bgp_ls_length
, tvb
, offset
+ 2, 2, ENC_BIG_ENDIAN
);
6325 sabm_len
= tvb_get_uint8(tvb
, offset
+ 4);
6326 ti
= proto_tree_add_item(tlv_tree
, hf_bgp_ls_tlv_app_spec_link_attrs_sabm_len
, tvb
, offset
+ 4, 1, ENC_NA
);
6327 if (sabm_len
!= 0 && sabm_len
!= 4 && sabm_len
!= 8) {
6328 expert_add_info_format(pinfo
, ti
, &ei_bgp_ls_error
,
6329 "Unexpected SABM Length (%u) in BGP-LS Application-Specific Link Attributes TLV, it must be 0/4/8 bytes!",
6333 udabm_len
= tvb_get_uint8(tvb
, offset
+ 5);
6334 ti
= proto_tree_add_item(tlv_tree
, hf_bgp_ls_tlv_app_spec_link_attrs_udabm_len
, tvb
, offset
+ 5, 1, ENC_NA
);
6335 if (udabm_len
!= 0 && udabm_len
!= 4 && udabm_len
!= 8) {
6336 expert_add_info_format(pinfo
, ti
, &ei_bgp_ls_error
,
6337 "Unexpected UDABM Length (%u) in BGP-LS Application Specific Link Attributes TLV, it must be 0/4/8 bytes!",
6341 tmp16
= tvb_get_uint16(tvb
, offset
+ 6, ENC_BIG_ENDIAN
);
6342 ti
= proto_tree_add_item(tlv_tree
, hf_bgp_ls_tlv_app_spec_link_attrs_reserved
, tvb
, offset
+ 6, 2, ENC_BIG_ENDIAN
);
6344 expert_add_info_format(pinfo
, ti
, &ei_bgp_ls_warn
,
6345 "Reserved field must be 0 in BGP-LS Application-Specific Link Attributes TLV");
6348 static int * const app_spec_link_attrs_sabm
[] = {
6349 &hf_bgp_ls_tlv_app_spec_link_attrs_sabm_r
,
6350 &hf_bgp_ls_tlv_app_spec_link_attrs_sabm_s
,
6351 &hf_bgp_ls_tlv_app_spec_link_attrs_sabm_f
,
6352 &hf_bgp_ls_tlv_app_spec_link_attrs_sabm_x
,
6355 proto_tree_add_bitmask(tlv_tree
, tvb
, offset
+ 8, hf_bgp_ls_tlv_app_spec_link_attrs_sabm
,
6356 ett_bgp_link_state
, app_spec_link_attrs_sabm
, ENC_BIG_ENDIAN
);
6358 if (udabm_len
> 0) {
6359 proto_tree_add_item(tlv_tree
, hf_bgp_ls_tlv_app_spec_link_attrs_udabm
,
6360 tvb
, offset
+ 8 + sabm_len
, udabm_len
, ENC_NA
);
6362 /* Decode Link Attribute sub-TLVs */
6363 local_offset
= offset
+ 8 + sabm_len
+ udabm_len
;
6364 while (local_offset
< offset
+ length
) {
6365 advance
= decode_link_state_attribute_tlv(tlv_tree
, tvb
, local_offset
, pinfo
, protocol_id
);
6369 local_offset
+= advance
;
6373 /* Prefix Attribute TLVs */
6374 case BGP_NLRI_TLV_IGP_FLAGS
:
6375 tlv_item
= proto_tree_add_item(tree
, hf_bgp_ls_tlv_igp_flags
, tvb
, offset
, length
+4, ENC_NA
);
6376 tlv_tree
= proto_item_add_subtree(tlv_item
, ett_bgp_link_state
);
6377 if(length
!= BGP_NLRI_TLV_LEN_IGP_FLAGS
){
6378 expert_add_info_format(pinfo
, tlv_tree
, &ei_bgp_ls_error
, "Unexpected IGP Flags TLV's length (%u), it must be %u bytes!",
6379 length
, BGP_NLRI_TLV_IGP_FLAGS
);
6382 proto_tree_add_item(tlv_tree
, hf_bgp_ls_type
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
6383 proto_tree_add_item(tlv_tree
, hf_bgp_ls_length
, tvb
, offset
+ 2, 2, ENC_BIG_ENDIAN
);
6384 proto_tree_add_item(tlv_tree
, hf_bgp_ls_igp_flags_flag_d
, tvb
, offset
+ 4, 1, ENC_NA
);
6385 tmp8
= tvb_get_uint8(tvb
, offset
+ 4) & 0x7F;
6387 expert_add_info_format(pinfo
, tlv_tree
, &ei_bgp_ls_error
, "Reserved flags are not set to zero (%u).", tmp8
);
6391 case BGP_NLRI_TLV_ROUTE_TAG
:
6392 tlv_item
= proto_tree_add_item(tree
, hf_bgp_ls_tlv_route_tag
, tvb
, offset
, length
+4, ENC_NA
);
6393 tlv_tree
= proto_item_add_subtree(tlv_item
, ett_bgp_link_state
);
6394 if(length
% 4 != 0) {
6395 expert_add_info_format(pinfo
, tlv_tree
, &ei_bgp_ls_error
, "Unexpected Route Tag TLV's length (%u mod 4 != 0) ",
6399 proto_tree_add_item(tlv_tree
, hf_bgp_ls_type
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
6400 proto_tree_add_item(tlv_tree
, hf_bgp_ls_length
, tvb
, offset
+ 2, 2, ENC_BIG_ENDIAN
);
6405 expert_add_info_format(pinfo
, tlv_tree
, &ei_bgp_ls_error
, "Route Tag must be 4 bytes long (%u).", tmp16
);
6408 proto_tree_add_item(tlv_tree
, hf_bgp_ls_tlv_route_tag_value
, tvb
, offset
+ 4 + (n
* 4), 4, ENC_BIG_ENDIAN
);
6414 case BGP_NLRI_TLV_EXTENDED_TAG
:
6415 tlv_item
= proto_tree_add_item(tree
, hf_bgp_ls_tlv_route_extended_tag
, tvb
, offset
, length
+4, ENC_NA
);
6416 tlv_tree
= proto_item_add_subtree(tlv_item
, ett_bgp_link_state
);
6417 if(length
% 8 != 0) {
6418 expert_add_info_format(pinfo
, tlv_tree
, &ei_bgp_ls_error
, "Unexpected Route Extended Tag TLV's length (%u mod 8 != 0) ",
6422 proto_tree_add_item(tlv_tree
, hf_bgp_ls_type
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
6423 proto_tree_add_item(tlv_tree
, hf_bgp_ls_length
, tvb
, offset
+ 2, 2, ENC_BIG_ENDIAN
);
6428 expert_add_info_format(pinfo
, tlv_tree
, &ei_bgp_ls_error
, "Route Extended Tag must be 8 bytes long (%u).", tmp16
);
6431 proto_tree_add_item(tlv_tree
, hf_bgp_ls_tlv_route_extended_tag_value
, tvb
, offset
+ 4 + (n
* 8), 8, ENC_BIG_ENDIAN
);
6437 case BGP_NLRI_TLV_PREFIX_METRIC
:
6438 tlv_item
= proto_tree_add_item(tree
, hf_bgp_ls_tlv_prefix_metric
, tvb
, offset
, length
+4, ENC_NA
);
6439 tlv_tree
= proto_item_add_subtree(tlv_item
, ett_bgp_link_state
);
6440 if(length
!= BGP_NLRI_TLV_LEN_PREFIX_METRIC
){
6441 expert_add_info_format(pinfo
, tlv_tree
, &ei_bgp_ls_error
, "Unexpected Prefix Metric TLV's length (%u), it must be %u bytes!",
6442 length
, BGP_NLRI_TLV_LEN_PREFIX_METRIC
);
6445 proto_tree_add_item(tlv_tree
, hf_bgp_ls_type
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
6446 proto_tree_add_item(tlv_tree
, hf_bgp_ls_length
, tvb
, offset
+ 2, 2, ENC_BIG_ENDIAN
);
6447 proto_tree_add_item(tlv_tree
, hf_bgp_ls_tlv_prefix_metric_value
, tvb
, offset
+ 4, 4, ENC_BIG_ENDIAN
);
6450 case BGP_NLRI_TLV_OSPF_FORWARDING_ADDRESS
:
6451 tlv_item
= proto_tree_add_item(tree
, hf_bgp_ls_ospf_forwarding_address
, tvb
, offset
, length
+4, ENC_NA
);
6452 tlv_tree
= proto_item_add_subtree(tlv_item
, ett_bgp_link_state
);
6453 proto_tree_add_item(tlv_tree
, hf_bgp_ls_type
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
6454 proto_tree_add_item(tlv_tree
, hf_bgp_ls_length
, tvb
, offset
+ 2, 2, ENC_BIG_ENDIAN
);
6456 proto_tree_add_item(tlv_tree
, hf_bgp_ls_ospf_forwarding_address_ipv4_address
, tvb
, offset
+ 4, length
, ENC_BIG_ENDIAN
);
6458 else if (length
== 16) {
6459 proto_tree_add_item(tlv_tree
, hf_bgp_ls_ospf_forwarding_address_ipv6_address
, tvb
, offset
+ 4, length
, ENC_NA
);
6462 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
);
6467 case BGP_NLRI_TLV_OPAQUE_PREFIX_ATTRIBUTE
:
6468 tlv_item
= proto_tree_add_item(tree
, hf_bgp_ls_opaque_prefix_attribute
, tvb
, offset
, length
+4, ENC_NA
);
6469 tlv_tree
= proto_item_add_subtree(tlv_item
, ett_bgp_link_state
);
6470 proto_tree_add_item(tlv_tree
, hf_bgp_ls_type
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
6471 proto_tree_add_item(tlv_tree
, hf_bgp_ls_length
, tvb
, offset
+ 2, 2, ENC_BIG_ENDIAN
);
6472 proto_tree_add_item(tlv_tree
, hf_bgp_ls_opaque_prefix_attribute_value
, tvb
, offset
+ 4, length
, ENC_NA
);
6475 case BGP_NLRI_TLV_EXTENDED_ADMINISTRATIVE_GROUP
:
6476 tlv_item
= proto_tree_add_item(tree
, hf_bgp_ls_extended_administrative_group
, tvb
, offset
, length
+4, ENC_NA
);
6477 tlv_tree
= proto_item_add_subtree(tlv_item
, ett_bgp_link_state
);
6478 proto_tree_add_item(tlv_tree
, hf_bgp_ls_type
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
6479 proto_tree_add_item(tlv_tree
, hf_bgp_ls_length
, tvb
, offset
+ 2, 2, ENC_BIG_ENDIAN
);
6480 if(length
% 4 != 0) {
6481 expert_add_info_format(pinfo
, tlv_tree
, &ei_bgp_ls_error
, "Unexpected Extended Administrative Group TLV's length (%u mod 4 != 0)",
6487 proto_tree_add_item(tlv_tree
, hf_bgp_ls_extended_administrative_group_value
, tvb
, offset
+ 4 + (length
- tmp16
), 4, ENC_NA
);
6492 case BGP_LS_SR_TLV_PREFIX_SID
:
6496 +--+--+--+--+--+--+--+--+
6497 |R |N |P |E |V |L | | |
6498 +--+--+--+--+--+--+--+--+
6500 static int * const prefix_sid_isis_flags
[] = {
6501 &hf_bgp_ls_sr_tlv_prefix_sid_flags_r
,
6502 &hf_bgp_ls_sr_tlv_prefix_sid_flags_n
,
6503 &hf_bgp_ls_sr_tlv_prefix_sid_flags_p
,
6504 &hf_bgp_ls_sr_tlv_prefix_sid_flags_e
,
6505 &hf_bgp_ls_sr_tlv_prefix_sid_flags_v
,
6506 &hf_bgp_ls_sr_tlv_prefix_sid_flags_l
,
6511 +--+--+--+--+--+--+--+--+
6512 | |NP|M |E |V |L | | |
6513 +--+--+--+--+--+--+--+--+
6515 static int * const prefix_sid_ospf_flags
[] = {
6516 &hf_bgp_ls_sr_tlv_prefix_sid_flags_np
,
6517 &hf_bgp_ls_sr_tlv_prefix_sid_flags_m
,
6518 &hf_bgp_ls_sr_tlv_prefix_sid_flags_e
,
6519 &hf_bgp_ls_sr_tlv_prefix_sid_flags_v
,
6520 &hf_bgp_ls_sr_tlv_prefix_sid_flags_l
,
6524 tlv_item
= proto_tree_add_item(tree
, hf_bgp_ls_sr_tlv_prefix_sid
, tvb
, offset
, length
+ 4, ENC_NA
);
6525 tlv_tree
= proto_item_add_subtree(tlv_item
, ett_bgp_link_state
);
6526 proto_tree_add_item(tlv_tree
, hf_bgp_ls_type
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
6527 proto_tree_add_item(tlv_tree
, hf_bgp_ls_length
, tvb
, offset
+ 2, 2, ENC_BIG_ENDIAN
);
6528 if ((protocol_id
== BGP_LS_NLRI_PROTO_ID_OSPF_V2
) || (protocol_id
== BGP_LS_NLRI_PROTO_ID_OSPF_V3
)) {
6529 proto_tree_add_bitmask(tlv_tree
, tvb
, offset
+ 4, hf_bgp_ls_sr_tlv_prefix_sid_flags
,
6530 ett_bgp_link_state
, prefix_sid_ospf_flags
, ENC_BIG_ENDIAN
);
6532 /* FF: most common case is IS-IS, so if it is not OSPF we go that way */
6533 proto_tree_add_bitmask(tlv_tree
, tvb
, offset
+ 4, hf_bgp_ls_sr_tlv_prefix_sid_flags
,
6534 ett_bgp_link_state
, prefix_sid_isis_flags
, ENC_BIG_ENDIAN
);
6536 proto_tree_add_item(tlv_tree
, hf_bgp_ls_sr_tlv_prefix_sid_algo
, tvb
, offset
+ 5, 1, ENC_BIG_ENDIAN
);
6538 proto_tree_add_item(tlv_tree
, hf_bgp_ls_sr_tlv_prefix_sid_label
, tvb
, offset
+ 8, 3, ENC_BIG_ENDIAN
);
6540 proto_tree_add_item(tlv_tree
, hf_bgp_ls_sr_tlv_prefix_sid_index
, tvb
, offset
+ 8, 4, ENC_BIG_ENDIAN
);
6545 case BGP_LS_SR_TLV_RANGE
:
6548 case BGP_LS_SR_TLV_SRV6_LOCATOR
:
6550 static int * const srv6_locator_flags
[] = {
6551 &hf_bgp_ls_sr_tlv_srv6_locator_flags_d
,
6552 &hf_bgp_ls_sr_tlv_srv6_locator_flags_reserved
,
6555 tlv_item
= proto_tree_add_item(tree
, hf_bgp_ls_sr_tlv_srv6_locator
, tvb
, offset
, length
+4, ENC_NA
);
6556 tlv_tree
= proto_item_add_subtree(tlv_item
, ett_bgp_link_state
);
6557 proto_tree_add_item(tlv_tree
, hf_bgp_ls_type
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
6558 ti
= proto_tree_add_item(tlv_tree
, hf_bgp_ls_length
, tvb
, offset
+ 2, 2, ENC_BIG_ENDIAN
);
6560 expert_add_info_format(pinfo
, ti
, &ei_bgp_ls_error
,
6561 "Unexpected TLV Length (%u) in BGP-LS %s TLV, it must be %u bytes or more!",
6562 length
, "SRv6 Locator", 8);
6565 proto_tree_add_bitmask(tlv_tree
, tvb
, offset
+ 4, hf_bgp_ls_sr_tlv_srv6_locator_flags
,
6566 ett_bgp_link_state
, srv6_locator_flags
, ENC_NA
);
6567 proto_tree_add_item(tlv_tree
, hf_bgp_ls_sr_tlv_srv6_locator_algo
, tvb
, offset
+ 5, 1, ENC_BIG_ENDIAN
);
6568 proto_tree_add_item(tlv_tree
, hf_bgp_ls_sr_tlv_srv6_locator_reserved
, tvb
, offset
+ 6, 2, ENC_BIG_ENDIAN
);
6569 proto_tree_add_item(tlv_tree
, hf_bgp_ls_sr_tlv_srv6_locator_metric
, tvb
, offset
+ 8, 4, ENC_BIG_ENDIAN
);
6573 case BGP_LS_SR_TLV_PREFIX_ATTR_FLAGS
:
6574 tlv_item
= proto_tree_add_item(tree
, hf_bgp_ls_sr_tlv_prefix_attr_flags
, tvb
, offset
, length
+4, ENC_NA
);
6575 tlv_tree
= proto_item_add_subtree(tlv_item
, ett_bgp_link_state
);
6576 proto_tree_add_item(tlv_tree
, hf_bgp_ls_type
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
6577 proto_tree_add_item(tlv_tree
, hf_bgp_ls_length
, tvb
, offset
+ 2, 2, ENC_BIG_ENDIAN
);
6578 if ((protocol_id
== BGP_LS_NLRI_PROTO_ID_OSPF_V2
) || (protocol_id
== BGP_LS_NLRI_PROTO_ID_OSPF_V3
)) {
6579 /* rfc7684, rfc9089 */
6580 static int * const prefix_attr_ospf_flags
[] = {
6581 &hf_bgp_ls_sr_tlv_prefix_attr_flags_flags_ao
,
6582 &hf_bgp_ls_sr_tlv_prefix_attr_flags_flags_no
,
6583 &hf_bgp_ls_sr_tlv_prefix_attr_flags_flags_eo
,
6586 proto_tree_add_bitmask(tlv_tree
, tvb
, offset
+ 4, hf_bgp_ls_sr_tlv_prefix_attr_flags_flags
,
6587 ett_bgp_link_state
, prefix_attr_ospf_flags
, ENC_BIG_ENDIAN
);
6588 } else if (protocol_id
== BGP_LS_NLRI_PROTO_ID_IS_IS_LEVEL_1
||
6589 protocol_id
== BGP_LS_NLRI_PROTO_ID_IS_IS_LEVEL_2
) {
6590 /* rfc7794, rfc9088 */
6591 static int * const prefix_attr_isis_flags
[] = {
6592 &hf_bgp_ls_sr_tlv_prefix_attr_flags_flags_xi
,
6593 &hf_bgp_ls_sr_tlv_prefix_attr_flags_flags_ri
,
6594 &hf_bgp_ls_sr_tlv_prefix_attr_flags_flags_ni
,
6595 &hf_bgp_ls_sr_tlv_prefix_attr_flags_flags_ei
,
6598 proto_tree_add_bitmask(tlv_tree
, tvb
, offset
+ 4, hf_bgp_ls_sr_tlv_prefix_attr_flags_flags
,
6599 ett_bgp_link_state
, prefix_attr_isis_flags
, ENC_BIG_ENDIAN
);
6601 proto_tree_add_item(tlv_tree
, hf_bgp_ls_sr_tlv_prefix_attr_flags_flags_unknown
,
6602 tvb
, offset
+ 4, tvb_get_uint16(tvb
, offset
+ 2, ENC_BIG_ENDIAN
), ENC_NA
);
6603 expert_add_info_format(pinfo
, tlv_tree
, &ei_bgp_ls_warn
,
6604 "Unknown Protocol-ID (%u) for Prefix Attribute Flags TLV",
6609 case BGP_LS_SR_TLV_SOURCE_ROUTER_ID
:
6610 tlv_item
= proto_tree_add_item(tree
, hf_bgp_ls_sr_tlv_source_router_id
, tvb
, offset
, length
+4, ENC_NA
);
6611 tlv_tree
= proto_item_add_subtree(tlv_item
, ett_bgp_link_state
);
6612 proto_tree_add_item(tlv_tree
, hf_bgp_ls_type
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
6613 ti
= proto_tree_add_item(tlv_tree
, hf_bgp_ls_length
, tvb
, offset
+ 2, 2, ENC_BIG_ENDIAN
);
6614 if (length
== BGP_NLRI_TLV_LEN_IPV4_ROUTER_ID
) {
6615 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
);
6616 } else if (length
== BGP_NLRI_TLV_LEN_IPV6_ROUTER_ID
) {
6617 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
);
6619 expert_add_info_format(pinfo
, ti
, &ei_bgp_ls_error
,
6620 "Unexpected TLV Length (%u) in BGP-LS %s TLV, it must be either %u or %u bytes!",
6621 length
, "Source Router-ID",
6622 BGP_NLRI_TLV_LEN_IPV4_ROUTER_ID
,
6623 BGP_NLRI_TLV_LEN_IPV6_ROUTER_ID
);
6627 /* SID Attribute TLVs */
6628 case BGP_LS_SR_TLV_SRV6_ENDPOINT_BEHAVIOR
:
6629 tlv_item
= proto_tree_add_item(tree
, hf_bgp_ls_sr_tlv_srv6_endpoint_behavior
, tvb
, offset
, length
+4, ENC_NA
);
6630 tlv_tree
= proto_item_add_subtree(tlv_item
, ett_bgp_link_state
);
6631 proto_tree_add_item(tlv_tree
, hf_bgp_ls_type
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
6632 ti
= proto_tree_add_item(tlv_tree
, hf_bgp_ls_length
, tvb
, offset
+ 2, 2, ENC_BIG_ENDIAN
);
6634 expert_add_info_format(pinfo
, ti
, &ei_bgp_ls_error
,
6635 "Unexpected TLV Length (%u) in BGP-LS %s TLV, it must be %u bytes!",
6636 length
, "SRv6 Endpoint Behavior", 4);
6639 proto_tree_add_item(tlv_tree
, hf_bgp_ls_sr_tlv_srv6_endpoint_behavior_endpoint_behavior
, tvb
, offset
+ 4, 2, ENC_BIG_ENDIAN
);
6640 proto_tree_add_item(tlv_tree
, hf_bgp_ls_sr_tlv_srv6_endpoint_behavior_flags
, tvb
, offset
+ 6, 1, ENC_BIG_ENDIAN
);
6641 proto_tree_add_item(tlv_tree
, hf_bgp_ls_sr_tlv_srv6_endpoint_behavior_algo
, tvb
, offset
+ 7, 1, ENC_BIG_ENDIAN
);
6644 case BGP_LS_SR_TLV_SRV6_SID_STRUCT
:
6645 tlv_item
= proto_tree_add_item(tree
, hf_bgp_ls_sr_tlv_srv6_sid_struct
, tvb
, offset
, length
+ 4, ENC_NA
);
6646 tlv_tree
= proto_item_add_subtree(tlv_item
, ett_bgp_link_state
);
6647 proto_tree_add_item(tlv_tree
, hf_bgp_ls_type
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
6648 ti
= proto_tree_add_item(tlv_tree
, hf_bgp_ls_length
, tvb
, offset
+ 2, 2, ENC_BIG_ENDIAN
);
6650 expert_add_info_format(pinfo
, ti
, &ei_bgp_ls_error
,
6651 "Unexpected TLV Length (%u) in BGP-LS %s TLV, it must be %u bytes!",
6652 length
, "SRv6 SID Structure", 4);
6655 proto_tree_add_item(tlv_tree
, hf_bgp_ls_sr_tlv_srv6_sid_struct_lb_len
, tvb
, offset
+ 4, 1, ENC_NA
);
6656 proto_tree_add_item(tlv_tree
, hf_bgp_ls_sr_tlv_srv6_sid_struct_ln_len
, tvb
, offset
+ 5, 1, ENC_NA
);
6657 proto_tree_add_item(tlv_tree
, hf_bgp_ls_sr_tlv_srv6_sid_struct_fun_len
, tvb
, offset
+ 6, 1, ENC_NA
);
6658 proto_tree_add_item(tlv_tree
, hf_bgp_ls_sr_tlv_srv6_sid_struct_arg_len
, tvb
, offset
+ 7, 1, ENC_NA
);
6661 case BGP_LS_IGP_TE_METRIC_DELAY
:
6662 tlv_item
= proto_tree_add_item(tree
, hf_bgp_ls_igp_te_metric_delay
, tvb
, offset
, length
+4, ENC_NA
);
6663 tlv_tree
= proto_item_add_subtree(tlv_item
, ett_bgp_link_state
);
6664 proto_tree_add_item(tlv_tree
, hf_bgp_ls_type
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
6665 proto_tree_add_item(tlv_tree
, hf_bgp_ls_length
, tvb
, offset
+ 2, 2, ENC_BIG_ENDIAN
);
6666 proto_tree_add_bitmask(tlv_tree
, tvb
, offset
+ 4, hf_bgp_ls_igp_te_metric_flags
,
6667 ett_bgp_link_state
, ls_igp_te_metric_flags
, ENC_BIG_ENDIAN
);
6668 proto_tree_add_item(tlv_tree
, hf_bgp_ls_igp_te_metric_delay_value
, tvb
, offset
+ 5, 3, ENC_BIG_ENDIAN
);
6670 case BGP_LS_IGP_TE_METRIC_DELAY_MIN_MAX
:
6671 tlv_item
= proto_tree_add_item(tree
, hf_bgp_ls_igp_te_metric_delay_min_max
, tvb
, offset
, length
+4, ENC_NA
);
6672 tlv_tree
= proto_item_add_subtree(tlv_item
, ett_bgp_link_state
);
6673 proto_tree_add_item(tlv_tree
, hf_bgp_ls_type
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
6674 proto_tree_add_item(tlv_tree
, hf_bgp_ls_length
, tvb
, offset
+ 2, 2, ENC_BIG_ENDIAN
);
6675 proto_tree_add_bitmask(tlv_tree
, tvb
, offset
+ 4, hf_bgp_ls_igp_te_metric_flags
,
6676 ett_bgp_link_state
, ls_igp_te_metric_flags
, ENC_BIG_ENDIAN
);
6677 proto_tree_add_item(tlv_tree
, hf_bgp_ls_igp_te_metric_delay_min
, tvb
, offset
+ 5, 3, ENC_BIG_ENDIAN
);
6678 proto_tree_add_item(tlv_tree
, hf_bgp_ls_igp_te_metric_reserved
, tvb
, offset
+ 8, 1, ENC_BIG_ENDIAN
);
6679 proto_tree_add_item(tlv_tree
, hf_bgp_ls_igp_te_metric_delay_max
, tvb
, offset
+ 9, 3, ENC_BIG_ENDIAN
);
6681 case BGP_LS_IGP_TE_METRIC_DELAY_VARIATION
:
6682 tlv_item
= proto_tree_add_item(tree
, hf_bgp_ls_igp_te_metric_delay_variation
, tvb
, offset
, length
+4, ENC_NA
);
6683 tlv_tree
= proto_item_add_subtree(tlv_item
, ett_bgp_link_state
);
6684 proto_tree_add_item(tlv_tree
, hf_bgp_ls_type
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
6685 proto_tree_add_item(tlv_tree
, hf_bgp_ls_length
, tvb
, offset
+ 2, 2, ENC_BIG_ENDIAN
);
6686 proto_tree_add_item(tlv_tree
, hf_bgp_ls_igp_te_metric_reserved
, tvb
, offset
+ 4, 1, ENC_BIG_ENDIAN
);
6687 proto_tree_add_item(tlv_tree
, hf_bgp_ls_igp_te_metric_delay_variation_value
, tvb
, offset
+ 5, 3, ENC_BIG_ENDIAN
);
6689 case BGP_LS_IGP_TE_METRIC_LOSS
:
6690 tlv_item
= proto_tree_add_item(tree
, hf_bgp_ls_igp_te_metric_link_loss
, tvb
, offset
, length
+4, ENC_NA
);
6691 tlv_tree
= proto_item_add_subtree(tlv_item
, ett_bgp_link_state
);
6692 proto_tree_add_item(tlv_tree
, hf_bgp_ls_type
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
6693 proto_tree_add_item(tlv_tree
, hf_bgp_ls_length
, tvb
, offset
+ 2, 2, ENC_BIG_ENDIAN
);
6694 proto_tree_add_bitmask(tlv_tree
, tvb
, offset
+ 4, hf_bgp_ls_igp_te_metric_flags
,
6695 ett_bgp_link_state
, ls_igp_te_metric_flags
, ENC_BIG_ENDIAN
);
6696 proto_tree_add_item(tlv_tree
, hf_bgp_ls_igp_te_metric_link_loss_value
, tvb
, offset
+ 5, 3, ENC_BIG_ENDIAN
);
6698 case BGP_LS_IGP_TE_METRIC_BANDWIDTH_RESIDUAL
:
6699 tlv_item
= proto_tree_add_item(tree
, hf_bgp_ls_igp_te_metric_bandwidth_residual
, tvb
, offset
, length
+4, ENC_NA
);
6700 tlv_tree
= proto_item_add_subtree(tlv_item
, ett_bgp_link_state
);
6701 proto_tree_add_item(tlv_tree
, hf_bgp_ls_type
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
6702 proto_tree_add_item(tlv_tree
, hf_bgp_ls_length
, tvb
, offset
+ 2, 2, ENC_BIG_ENDIAN
);
6703 proto_tree_add_item(tlv_tree
, hf_bgp_ls_igp_te_metric_bandwidth_residual_value
, tvb
, offset
+ 4, 4, ENC_BIG_ENDIAN
);
6705 case BGP_LS_IGP_TE_METRIC_BANDWIDTH_AVAILABLE
:
6706 tlv_item
= proto_tree_add_item(tree
, hf_bgp_ls_igp_te_metric_bandwidth_available
, tvb
, offset
, length
+4, ENC_NA
);
6707 tlv_tree
= proto_item_add_subtree(tlv_item
, ett_bgp_link_state
);
6708 proto_tree_add_item(tlv_tree
, hf_bgp_ls_type
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
6709 proto_tree_add_item(tlv_tree
, hf_bgp_ls_length
, tvb
, offset
+ 2, 2, ENC_BIG_ENDIAN
);
6710 proto_tree_add_item(tlv_tree
, hf_bgp_ls_igp_te_metric_bandwidth_available_value
, tvb
, offset
+ 4, 4, ENC_BIG_ENDIAN
);
6712 case BGP_LS_IGP_TE_METRIC_BANDWIDTH_UTILIZED
:
6713 tlv_item
= proto_tree_add_item(tree
, hf_bgp_ls_igp_te_metric_bandwidth_utilized
, tvb
, offset
, length
+4, ENC_NA
);
6714 tlv_tree
= proto_item_add_subtree(tlv_item
, ett_bgp_link_state
);
6715 proto_tree_add_item(tlv_tree
, hf_bgp_ls_type
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
6716 proto_tree_add_item(tlv_tree
, hf_bgp_ls_length
, tvb
, offset
+ 2, 2, ENC_BIG_ENDIAN
);
6717 proto_tree_add_item(tlv_tree
, hf_bgp_ls_igp_te_metric_bandwidth_utilized_value
, tvb
, offset
+ 4, 4, ENC_BIG_ENDIAN
);
6721 expert_add_info_format(pinfo
, tree
, &ei_bgp_ls_warn
,
6722 "Unknown BGP-LS Attribute TLV Code (%u)!", type
);
6725 decrement_dissection_depth(pinfo
);
6729 static int decode_evpn_nlri_esi(proto_tree
*tree
, tvbuff_t
*tvb
, int offset
, packet_info
*pinfo
) {
6730 uint8_t esi_type
= 0;
6731 proto_tree
*esi_tree
;
6734 ti
= proto_tree_add_item(tree
, hf_bgp_evpn_nlri_esi
, tvb
, offset
, 10, ENC_NA
);
6735 esi_tree
= proto_item_add_subtree(ti
, ett_bgp_evpn_nlri_esi
);
6736 proto_tree_add_item(esi_tree
, hf_bgp_evpn_nlri_esi_type
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
6737 esi_type
= tvb_get_uint8(tvb
, offset
);
6738 proto_tree_add_item(esi_tree
, hf_bgp_evpn_nlri_esi_value
, tvb
, offset
+1, 9, ENC_NA
);
6740 case BGP_NLRI_EVPN_ESI_VALUE
:
6741 proto_tree_add_item(esi_tree
, hf_bgp_evpn_nlri_esi_value_type0
, tvb
,
6742 offset
+1, 9, ENC_NA
);
6744 case BGP_NLRI_EVPN_ESI_LACP
:
6745 proto_tree_add_item(esi_tree
, hf_bgp_evpn_nlri_esi_lacp_mac
, tvb
,
6746 offset
+1, 6, ENC_NA
);
6747 proto_tree_add_item(esi_tree
, hf_bgp_evpn_nlri_esi_portk
, tvb
,
6748 offset
+7, 2, ENC_NA
);
6749 proto_tree_add_item(esi_tree
, hf_bgp_evpn_nlri_esi_remain
, tvb
,
6750 offset
+9, 1, ENC_NA
);
6752 case BGP_NLRI_EVPN_ESI_MSTP
:
6753 proto_tree_add_item(esi_tree
, hf_bgp_evpn_nlri_esi_rb_mac
, tvb
,
6754 offset
+1, 6, ENC_NA
);
6755 proto_tree_add_item(esi_tree
, hf_bgp_evpn_nlri_esi_rbprio
, tvb
,
6756 offset
+7, 2, ENC_NA
);
6757 proto_tree_add_item(esi_tree
, hf_bgp_evpn_nlri_esi_remain
, tvb
,
6758 offset
+9, 1, ENC_NA
);
6760 case BGP_NLRI_EVPN_ESI_MAC
:
6761 proto_tree_add_item(esi_tree
, hf_bgp_evpn_nlri_esi_sys_mac
, tvb
,
6762 offset
+1, 6, ENC_NA
);
6763 proto_tree_add_item(esi_tree
, hf_bgp_evpn_nlri_esi_mac_discr
, tvb
,
6764 offset
+7, 2, ENC_NA
);
6765 proto_tree_add_item(esi_tree
, hf_bgp_evpn_nlri_esi_remain
, tvb
,
6766 offset
+9, 1, ENC_NA
);
6768 case BGP_NLRI_EVPN_ESI_RID
:
6769 proto_tree_add_item(esi_tree
, hf_bgp_evpn_nlri_esi_router_id
, tvb
,
6770 offset
+1, 4, ENC_BIG_ENDIAN
);
6771 proto_tree_add_item(esi_tree
, hf_bgp_evpn_nlri_esi_router_discr
, tvb
,
6772 offset
+5, 4, ENC_NA
);
6773 proto_tree_add_item(esi_tree
, hf_bgp_evpn_nlri_esi_remain
, tvb
,
6774 offset
+9, 1, ENC_NA
);
6776 case BGP_NLRI_EVPN_ESI_ASN
:
6777 proto_tree_add_item(esi_tree
, hf_bgp_evpn_nlri_esi_asn
, tvb
,
6778 offset
+1, 4, ENC_BIG_ENDIAN
);
6779 proto_tree_add_item(esi_tree
, hf_bgp_evpn_nlri_esi_asn_discr
, tvb
,
6780 offset
+5, 4, ENC_NA
);
6781 proto_tree_add_item(esi_tree
, hf_bgp_evpn_nlri_esi_remain
, tvb
,
6782 offset
+9, 1, ENC_NA
);
6784 case BGP_NLRI_EVPN_ESI_RES
:
6785 proto_tree_add_item(esi_tree
, hf_bgp_evpn_nlri_esi_reserved
, tvb
,
6786 offset
+1, 9, ENC_NA
);
6789 expert_add_info_format(pinfo
, tree
, &ei_bgp_evpn_nlri_esi_type_err
,
6790 "Invalid EVPN ESI (%u)!", esi_type
);
6797 * Decode EVPN NLRI, RFC 7432 section 7.7
6799 static int decode_evpn_nlri(proto_tree
*tree
, tvbuff_t
*tvb
, int offset
, packet_info
*pinfo
) {
6800 int reader_offset
= offset
;
6801 int start_offset
= offset
+2;
6802 proto_tree
*prefix_tree
;
6807 uint32_t total_length
= 0;
6809 path_attr_data
*data
= NULL
;
6813 route_type
= tvb_get_uint8(tvb
, offset
);
6815 nlri_len
= tvb_get_uint8(tvb
, offset
+ 1);
6817 ti
= proto_tree_add_item(tree
, hf_bgp_evpn_nlri
, tvb
, reader_offset
,
6818 nlri_len
+2, ENC_NA
);
6820 prefix_tree
= proto_item_add_subtree(ti
, ett_bgp_evpn_nlri
);
6822 proto_tree_add_item(prefix_tree
, hf_bgp_evpn_nlri_rt
, tvb
, reader_offset
,
6824 proto_item_append_text(ti
, ": %s", val_to_str(tvb_get_uint8(tvb
, offset
), evpnrtypevals
, "Unknown capability %d"));
6825 /* moving to next field */
6828 proto_tree_add_item(prefix_tree
, hf_bgp_evpn_nlri_len
, tvb
, reader_offset
,
6832 switch (route_type
) {
6835 +---------------------------------------+
6837 +---------------------------------------+
6838 |Ethernet Segment Identifier (10 octets)|
6839 +---------------------------------------+
6840 | Ethernet Tag ID (4 octets) |
6841 +---------------------------------------+
6842 | MPLS Label (3 octets) |
6843 +---------------------------------------+
6846 if (nlri_len
< 25) {
6847 expert_add_info_format(pinfo
, prefix_tree
, &ei_bgp_evpn_nlri_rt_len_err
,
6848 "Invalid length (%u) of EVPN NLRI Route Type 1 (Ethernet Auto-discovery Route)", nlri_len
);
6851 item
= proto_tree_add_item(prefix_tree
, hf_bgp_evpn_nlri_rd
, tvb
, reader_offset
,
6853 proto_item_append_text(item
, " (%s)", decode_bgp_rd(pinfo
->pool
, tvb
, reader_offset
));
6856 decode_evpn_nlri_esi(prefix_tree
, tvb
, reader_offset
, pinfo
);
6857 reader_offset
+= 10;
6858 proto_tree_add_item(prefix_tree
, hf_bgp_evpn_nlri_etag
, tvb
, reader_offset
,
6861 data
= load_path_attr_data(pinfo
);
6862 if (data
&& data
->encaps_community_present
&&
6863 (data
->encaps_tunnel_type
== BGP_EXT_COM_TUNNEL_VXLAN
|| data
->encaps_tunnel_type
== BGP_EXT_COM_TUNNEL_VXLANGPE
)) {
6864 proto_tree_add_item(prefix_tree
, hf_bgp_evpn_nlri_vni
, tvb
, reader_offset
, 3, ENC_BIG_ENDIAN
);
6867 proto_tree_add_item(prefix_tree
, hf_bgp_evpn_nlri_mpls_ls1
, tvb
, reader_offset
, 3, ENC_BIG_ENDIAN
);
6870 total_length
= reader_offset
- offset
;
6873 case EVPN_MAC_ROUTE
:
6875 +---------------------------------------+
6877 +---------------------------------------+
6878 |Ethernet Segment Identifier (10 octets)|
6879 +---------------------------------------+
6880 | Ethernet Tag ID (4 octets) |
6881 +---------------------------------------+
6882 | MAC Address Length (1 octet) |
6883 +---------------------------------------+
6884 | MAC Address (6 octets) |
6885 +---------------------------------------+
6886 | IP Address Length (1 octet) |
6887 +---------------------------------------+
6888 | IP Address (0 or 4 or 16 octets) |
6889 +---------------------------------------+
6890 | MPLS Label1 (3 octets) |
6891 +---------------------------------------+
6892 | MPLS Label2 (0 or 3 octets) |
6893 +---------------------------------------+
6897 if (nlri_len
< 33) {
6898 expert_add_info_format(pinfo
, prefix_tree
, &ei_bgp_evpn_nlri_rt_len_err
,
6899 "Invalid length (%u) of EVPN NLRI Route Type 2 (MAC/IP Advertisement Route)", nlri_len
);
6902 item
= proto_tree_add_item(prefix_tree
, hf_bgp_evpn_nlri_rd
, tvb
, reader_offset
,
6904 proto_item_append_text(item
, " (%s)", decode_bgp_rd(pinfo
->pool
, tvb
, reader_offset
));
6907 decode_evpn_nlri_esi(prefix_tree
, tvb
, reader_offset
, pinfo
);
6908 reader_offset
+= 10;
6910 proto_tree_add_item(prefix_tree
, hf_bgp_evpn_nlri_etag
, tvb
, reader_offset
,
6914 proto_tree_add_item(prefix_tree
, hf_bgp_evpn_nlri_maclen
, tvb
, reader_offset
,
6918 proto_tree_add_item(prefix_tree
, hf_bgp_evpn_nlri_mac_addr
, tvb
, reader_offset
,
6922 ip_len
= tvb_get_uint8(tvb
, reader_offset
) / 8;
6923 proto_tree_add_item(prefix_tree
, hf_bgp_evpn_nlri_iplen
, tvb
, reader_offset
,
6929 if (nlri_len
< 37) {
6930 expert_add_info_format(pinfo
, prefix_tree
, &ei_bgp_evpn_nlri_rt_len_err
,
6931 "Invalid length (%u) of EVPN NLRI Route Type 2 (MAC/IP Advertisement Route)", nlri_len
);
6934 proto_tree_add_item(prefix_tree
, hf_bgp_evpn_nlri_ip_addr
, tvb
, reader_offset
,
6937 } else if (ip_len
== 16) {
6939 if (nlri_len
< 49) {
6940 expert_add_info_format(pinfo
, prefix_tree
, &ei_bgp_evpn_nlri_rt_len_err
,
6941 "Invalid length (%u) of EVPN NLRI Route Type 2 (MAC/IP Advertisement Route)", nlri_len
);
6944 proto_tree_add_item(prefix_tree
, hf_bgp_evpn_nlri_ipv6_addr
, tvb
, reader_offset
,
6946 reader_offset
+= 16;
6947 } else if (ip_len
== 0) {
6949 proto_tree_add_expert(prefix_tree
, pinfo
, &ei_bgp_evpn_nlri_rt4_no_ip
, tvb
, reader_offset
-1, 1);
6953 data
= load_path_attr_data(pinfo
);
6954 if (data
&& data
->encaps_community_present
&&
6955 (data
->encaps_tunnel_type
== BGP_EXT_COM_TUNNEL_VXLAN
|| data
->encaps_tunnel_type
== BGP_EXT_COM_TUNNEL_VXLANGPE
)) {
6956 proto_tree_add_item(prefix_tree
, hf_bgp_evpn_nlri_vni
, tvb
, reader_offset
, 3, ENC_BIG_ENDIAN
);
6958 if (reader_offset
- start_offset
< nlri_len
) {
6959 proto_tree_add_item(prefix_tree
, hf_bgp_evpn_nlri_vni
, tvb
, reader_offset
, 3, ENC_BIG_ENDIAN
);
6963 proto_tree_add_item(prefix_tree
, hf_bgp_evpn_nlri_mpls_ls1
, tvb
, reader_offset
, 3, ENC_BIG_ENDIAN
);
6965 /* we check if we reached the end of the nlri reading fields one by one */
6966 /* if not, the second optional label is in the payload */
6967 if (reader_offset
- start_offset
< nlri_len
) {
6968 proto_tree_add_item(prefix_tree
, hf_bgp_evpn_nlri_mpls_ls2
, tvb
, reader_offset
, 3, ENC_BIG_ENDIAN
);
6972 total_length
= reader_offset
- offset
;
6975 case EVPN_INC_MCAST_TREE
:
6977 +---------------------------------------+
6979 +---------------------------------------+
6980 | Ethernet Tag ID (4 octets) |
6981 +---------------------------------------+
6982 | IP Address Length (1 octet) |
6983 +---------------------------------------+
6984 | Originating Router's IP Addr |
6985 | (4 or 16 octets) |
6986 +---------------------------------------+
6989 if (nlri_len
< 13) {
6990 expert_add_info_format(pinfo
, prefix_tree
, &ei_bgp_evpn_nlri_rt_len_err
,
6991 "Invalid length (%u) of EVPN NLRI Route Type 3 (Inclusive Multicast Ethernet Tag Route)", nlri_len
);
6994 item
= proto_tree_add_item(prefix_tree
, hf_bgp_evpn_nlri_rd
, tvb
, reader_offset
,
6996 proto_item_append_text(item
, " (%s)", decode_bgp_rd(pinfo
->pool
, tvb
, reader_offset
));
6999 proto_tree_add_item(prefix_tree
, hf_bgp_evpn_nlri_etag
, tvb
, reader_offset
,
7001 /* move to next field */
7003 ip_len
= tvb_get_uint8(tvb
, reader_offset
) / 8;
7004 proto_tree_add_item(prefix_tree
, hf_bgp_evpn_nlri_iplen
, tvb
, reader_offset
,
7010 if (nlri_len
< 17) {
7011 expert_add_info_format(pinfo
, prefix_tree
, &ei_bgp_evpn_nlri_rt_len_err
,
7012 "Invalid length (%u) of EVPN NLRI Route Type 3 (Inclusive Multicast Ethernet Tag Route)", nlri_len
);
7015 proto_tree_add_item(prefix_tree
, hf_bgp_evpn_nlri_ip_addr
, tvb
, reader_offset
,
7018 } else if (ip_len
== 16) {
7020 if (nlri_len
< 29) {
7021 expert_add_info_format(pinfo
, prefix_tree
, &ei_bgp_evpn_nlri_rt_len_err
,
7022 "Invalid length (%u) of EVPN NLRI Route Type 3 (Inclusive Multicast Ethernet Tag Route)", nlri_len
);
7025 proto_tree_add_item(prefix_tree
, hf_bgp_evpn_nlri_ipv6_addr
, tvb
, reader_offset
,
7027 reader_offset
+= 16;
7028 } else if (ip_len
== 0) {
7030 proto_tree_add_expert(prefix_tree
, pinfo
, &ei_bgp_evpn_nlri_rt4_no_ip
, tvb
, reader_offset
, 1);
7034 total_length
= reader_offset
- offset
;
7037 case EVPN_ETH_SEGMENT_ROUTE
:
7039 +---------------------------------------+
7041 +---------------------------------------+
7042 |Ethernet Segment Identifier (10 octets)|
7043 +---------------------------------------+
7044 | IP Address Length (1 octet) |
7045 +---------------------------------------+
7046 | Originating Router's IP Addr |
7047 | (4 or 16 octets) |
7048 +---------------------------------------+
7051 if (nlri_len
< 19) {
7052 expert_add_info_format(pinfo
, prefix_tree
, &ei_bgp_evpn_nlri_rt_len_err
,
7053 "Invalid length (%u) of EVPN NLRI Route Type 4 (Ethernet Segment Route)", nlri_len
);
7056 item
= proto_tree_add_item(prefix_tree
, hf_bgp_evpn_nlri_rd
, tvb
, reader_offset
,
7058 proto_item_append_text(item
, " (%s)", decode_bgp_rd(pinfo
->pool
, tvb
, reader_offset
));
7061 decode_evpn_nlri_esi(prefix_tree
, tvb
, reader_offset
, pinfo
);
7062 /* move to next field */
7063 reader_offset
+= 10;
7065 ip_len
= tvb_get_uint8(tvb
, reader_offset
) / 8;
7066 proto_tree_add_item(prefix_tree
, hf_bgp_evpn_nlri_iplen
, tvb
, reader_offset
,
7072 if (nlri_len
< 23) {
7073 expert_add_info_format(pinfo
, prefix_tree
, &ei_bgp_evpn_nlri_rt_len_err
,
7074 "Invalid length (%u) of EVPN NLRI Route Type 4 (Ethernet Segment Route)", nlri_len
);
7077 proto_tree_add_item(prefix_tree
, hf_bgp_evpn_nlri_ip_addr
, tvb
, reader_offset
,
7080 } else if (ip_len
== 16) {
7082 if (nlri_len
< 35) {
7083 expert_add_info_format(pinfo
, prefix_tree
, &ei_bgp_evpn_nlri_rt_len_err
,
7084 "Invalid length (%u) of EVPN NLRI Route Type 4 (Ethernet Segment Route)", nlri_len
);
7087 proto_tree_add_item(prefix_tree
, hf_bgp_evpn_nlri_ipv6_addr
, tvb
, reader_offset
,
7089 reader_offset
+= 16;
7090 } else if (ip_len
== 0) {
7092 proto_tree_add_expert(prefix_tree
, pinfo
, &ei_bgp_evpn_nlri_rt4_no_ip
, tvb
, reader_offset
, 1);
7096 total_length
= reader_offset
- offset
;
7098 case EVPN_IP_PREFIX_ROUTE
:
7101 +---------------------------------------+
7103 +---------------------------------------+
7104 |Ethernet Segment Identifier (10 octets)|
7105 +---------------------------------------+
7106 | Ethernet Tag ID (4 octets) |
7107 +---------------------------------------+
7108 | IP Prefix Length (1 octet) |
7109 +---------------------------------------+
7110 | IP Prefix (4 or 16 octets) |
7111 +---------------------------------------+
7112 | GW IP Address (4 or 16 octets) |
7113 +---------------------------------------+
7114 | MPLS Label (3 octets) |
7115 +---------------------------------------+
7118 if (nlri_len
< 26) {
7119 expert_add_info_format(pinfo
, prefix_tree
, &ei_bgp_evpn_nlri_rt_len_err
,
7120 "Invalid length (%u) of EVPN NLRI Route Type 4 (Ethernet Segment Route)", nlri_len
);
7123 item
= proto_tree_add_item(prefix_tree
, hf_bgp_evpn_nlri_rd
, tvb
, reader_offset
,
7125 proto_item_append_text(item
, " (%s)", decode_bgp_rd(pinfo
->pool
, tvb
, reader_offset
));
7128 decode_evpn_nlri_esi(prefix_tree
, tvb
, reader_offset
, pinfo
);
7129 reader_offset
+= 10;
7131 proto_tree_add_item(prefix_tree
, hf_bgp_evpn_nlri_etag
, tvb
, reader_offset
,
7135 proto_tree_add_item(prefix_tree
, hf_bgp_evpn_nlri_prefix_len
, tvb
, reader_offset
,
7142 proto_tree_add_item(prefix_tree
, hf_bgp_evpn_nlri_ip_addr
, tvb
, reader_offset
,
7146 proto_tree_add_item(prefix_tree
, hf_bgp_evpn_nlri_ipv4_gtw
, tvb
, reader_offset
,
7150 data
= load_path_attr_data(pinfo
);
7151 if (data
&& data
->encaps_community_present
&&
7152 (data
->encaps_tunnel_type
== BGP_EXT_COM_TUNNEL_VXLAN
|| data
->encaps_tunnel_type
== BGP_EXT_COM_TUNNEL_VXLANGPE
)) {
7153 proto_tree_add_item(prefix_tree
, hf_bgp_evpn_nlri_vni
, tvb
, reader_offset
, 3, ENC_BIG_ENDIAN
);
7155 decode_MPLS_stack_tree(tvb
, reader_offset
, prefix_tree
);
7161 proto_tree_add_item(prefix_tree
, hf_bgp_evpn_nlri_ipv6_addr
, tvb
, reader_offset
,
7163 reader_offset
+= 16;
7165 proto_tree_add_item(prefix_tree
, hf_bgp_evpn_nlri_ipv6_gtw
, tvb
, reader_offset
,
7167 reader_offset
+= 16;
7169 data
= load_path_attr_data(pinfo
);
7170 if (data
&& data
->encaps_community_present
&&
7171 (data
->encaps_tunnel_type
== BGP_EXT_COM_TUNNEL_VXLAN
|| data
->encaps_tunnel_type
== BGP_EXT_COM_TUNNEL_VXLANGPE
)) {
7172 proto_tree_add_item(prefix_tree
, hf_bgp_evpn_nlri_vni
, tvb
, reader_offset
, 3, ENC_BIG_ENDIAN
);
7174 decode_MPLS_stack_tree(tvb
, reader_offset
, prefix_tree
);
7179 expert_add_info_format(pinfo
, prefix_tree
, &ei_bgp_evpn_nlri_rt_len_err
,
7180 "Invalid length (%u) of EVPN NLRI Route Type 5 (IP Prefix Route)", nlri_len
);
7185 case EVPN_MC_ETHER_TAG_ROUTE
:
7186 case EVPN_IGMP_JOIN_ROUTE
:
7187 case EVPN_IGMP_LEAVE_ROUTE
:
7188 case EVPN_S_PMSI_A_D_ROUTE
:
7190 +---------------------------------------+
7192 +---------------------------------------+
7193 | Ethernet Tag ID (4 octets) |
7194 +---------------------------------------+
7195 | Multicast Source Length (1 octet) |
7196 +---------------------------------------+
7197 | Multicast Source Address (variable) |
7198 +---------------------------------------+
7199 | Multicast Group Length (1 octet) |
7200 +---------------------------------------+
7201 | Multicast Group Address (Variable) |
7202 +---------------------------------------+
7203 | Originator Router Length (1 octet) |
7204 +---------------------------------------+
7205 | Originator Router Address (variable) |
7206 +---------------------------------------+
7207 | Flags (1 octets) (optional) |
7208 +---------------------------------------+
7210 +--------------------------------------------------+
7212 +--------------------------------------------------+
7213 | Ethernet Segment Identifier (10 octets) |
7214 +--------------------------------------------------+
7215 | Ethernet Tag ID (4 octets) |
7216 +--------------------------------------------------+
7217 | Multicast Source Length (1 octet) |
7218 +--------------------------------------------------+
7219 | Multicast Source Address (variable) |
7220 +--------------------------------------------------+
7221 | Multicast Group Length (1 octet) |
7222 +--------------------------------------------------+
7223 | Multicast Group Address (Variable) |
7224 +--------------------------------------------------+
7225 | Originator Router Length (1 octet) |
7226 +--------------------------------------------------+
7227 | Originator Router Address (variable) |
7228 +--------------------------------------------------+
7230 +--------------------------------------------------+
7233 if (nlri_len
< 15) {
7234 expert_add_info_format(pinfo
, prefix_tree
, &ei_bgp_evpn_nlri_rt_len_err
,
7235 "Invalid length (%u) of EVPN NLRI Route Type %u", nlri_len
, route_type
);
7238 item
= proto_tree_add_item(prefix_tree
, hf_bgp_evpn_nlri_rd
, tvb
, reader_offset
,
7240 proto_item_append_text(item
, " (%s)", decode_bgp_rd(pinfo
->pool
, tvb
, reader_offset
));
7243 if (route_type
== EVPN_IGMP_JOIN_ROUTE
|| route_type
== EVPN_IGMP_LEAVE_ROUTE
) {
7244 decode_evpn_nlri_esi(prefix_tree
, tvb
, reader_offset
, pinfo
);
7245 reader_offset
+= 10;
7248 proto_tree_add_item(prefix_tree
, hf_bgp_evpn_nlri_etag
, tvb
, reader_offset
,
7252 ret
= decode_mcast_vpn_nlri_addresses(prefix_tree
, tvb
, reader_offset
);
7256 reader_offset
= ret
;
7257 proto_tree_add_item_ret_uint(prefix_tree
, hf_bgp_evpn_nlri_igmp_mc_or_length
, tvb
,
7258 reader_offset
, 1, ENC_BIG_ENDIAN
, &or_length
);
7262 proto_tree_add_item(prefix_tree
, hf_bgp_evpn_nlri_igmp_mc_or_addr_ipv4
, tvb
,
7263 reader_offset
, 4, ENC_BIG_ENDIAN
);
7267 proto_tree_add_item(prefix_tree
, hf_bgp_evpn_nlri_igmp_mc_or_addr_ipv6
, tvb
,
7268 reader_offset
, 16, ENC_NA
);
7269 reader_offset
+= 16;
7272 if (reader_offset
- start_offset
< nlri_len
) {
7273 proto_tree_add_bitmask(prefix_tree
, tvb
, reader_offset
, hf_bgp_evpn_nlri_igmp_mc_flags
,
7274 ett_bgp_evpn_nlri_mc
, evpn_nlri_igmp_mc_flags
, ENC_BIG_ENDIAN
);
7277 total_length
= reader_offset
- offset
;
7281 expert_add_info_format(pinfo
, tree
, &ei_bgp_evpn_nlri_rt_type_err
,
7282 "Invalid EVPN Route Type (%u)", route_type
);
7286 return total_length
;
7289 static int decode_bgp_mup_nlri_variable_prefix(proto_tree
*tree
, tvbuff_t
*tvb
, int offset
, packet_info
*pinfo
, uint16_t afi
) {
7291 int reader_offset
= offset
;
7292 uint32_t total_length
= 0;
7295 ws_in4_addr ipv4_prefix
;
7296 address ipv4_prefix_addr
;
7297 ws_in6_addr ipv6_prefix
;
7298 address ipv6_prefix_addr
;
7300 uint8_t prefix_length
;
7302 prefix_length
= tvb_get_uint8(tvb
, reader_offset
);
7303 proto_tree_add_item(tree
, hf_bgp_mup_nlri_prefixlen
, tvb
, reader_offset
, 1, ENC_BIG_ENDIAN
);
7308 byte_length
= tvb_get_ipv4_addr_with_prefix_len(tvb
, reader_offset
, &ipv4_prefix
, prefix_length
);
7309 if (byte_length
== -1) {
7310 proto_tree_add_expert_format(tree
, pinfo
, &ei_bgp_prefix_length_invalid
, tvb
, reader_offset
, -1,
7311 "IPv4 prefix has an invalid length: %d bits", prefix_length
);
7314 set_address(&ipv4_prefix_addr
, AT_IPv4
, 4, &ipv4_prefix
);
7315 prefix_str
= address_to_str(pinfo
->pool
, &ipv4_prefix_addr
);
7316 proto_tree_add_ipv4_format_value(tree
, hf_bgp_mup_nlri_ip_prefix
, tvb
, reader_offset
, byte_length
,
7317 ipv4_prefix
, "%s/%d", prefix_str
, prefix_length
);
7318 reader_offset
+= byte_length
;
7322 byte_length
= tvb_get_ipv6_addr_with_prefix_len(tvb
, reader_offset
, &ipv6_prefix
, prefix_length
);
7323 if (byte_length
== -1) {
7324 proto_tree_add_expert_format(tree
, pinfo
, &ei_bgp_prefix_length_invalid
, tvb
, reader_offset
, -1,
7325 "IPv6 prefix has an invalid length: %d bits", prefix_length
);
7328 set_address(&ipv6_prefix_addr
, AT_IPv6
, 16, ipv6_prefix
.bytes
);
7329 prefix_str
= address_to_str(pinfo
->pool
, &ipv6_prefix_addr
);
7330 proto_tree_add_ipv6_format_value(tree
, hf_bgp_mup_nlri_ipv6_prefix
, tvb
, reader_offset
, byte_length
,
7331 &ipv6_prefix
, "%s/%d", prefix_str
, prefix_length
);
7332 reader_offset
+= byte_length
;
7335 total_length
= reader_offset
- offset
;
7336 return total_length
;
7340 static int decode_bgp_mup_nlri_type1_st_route(proto_tree
*tree
, tvbuff_t
*tvb
, int offset
, packet_info
*pinfo
,
7341 uint16_t afi
, uint8_t architecture_type
) {
7343 +-----------------------------------+
7345 +-----------------------------------+
7346 | Prefix Length (1 octet) |
7347 +-----------------------------------+
7348 | Prefix (variable) |
7349 +-----------------------------------+
7350 | Architecture specific (variable) |
7351 +-----------------------------------+
7353 int reader_offset
= offset
;
7354 uint32_t total_length
= 0;
7357 uint8_t endpoint_address_length
;
7358 uint8_t source_address_length
;
7359 proto_item
*arch_spec_item
;
7360 proto_tree
*arch_spec_tree
;
7363 item
= proto_tree_add_item(tree
, hf_bgp_mup_nlri_rd
, tvb
, reader_offset
, 8, ENC_NA
);
7364 proto_item_append_text(item
, " (%s)", decode_bgp_rd(pinfo
->pool
, tvb
, reader_offset
));
7367 reader_offset
+= decode_bgp_mup_nlri_variable_prefix(tree
, tvb
, reader_offset
, pinfo
, afi
);
7369 switch (architecture_type
) {
7370 case BGP_MUP_AT_3GPP_5G
:
7372 +-----------------------------------1
7374 +-----------------------------------+
7376 +-----------------------------------+
7377 | Endpoint Address Length (1 octet) |
7378 +-----------------------------------+
7379 | Endpoint Address (variable) |
7380 +-----------------------------------+
7381 | Source Address Length (1 octet) |
7382 +-----------------------------------+
7383 | Source Address (variable) |
7384 +-----------------------------------+
7386 endpoint_address_length
= tvb_get_uint8(tvb
, reader_offset
+5); // should be multiple of 8
7387 arch_spec_byte
= 7 + endpoint_address_length
/8;
7389 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
);
7390 arch_spec_tree
= proto_item_add_subtree(arch_spec_item
, ett_bgp_mup_nlri_3gpp_5g_type1_st_route
);
7392 proto_tree_add_item(arch_spec_tree
, hf_bgp_mup_nlri_3gpp_5g_teid
, tvb
, reader_offset
, 4, ENC_BIG_ENDIAN
);
7395 proto_tree_add_item(arch_spec_tree
, hf_bgp_mup_nlri_3gpp_5g_qfi
, tvb
, reader_offset
, 1, ENC_BIG_ENDIAN
);
7398 proto_tree_add_item(arch_spec_tree
, hf_bgp_mup_nlri_3gpp_5g_ep_addr_len
, tvb
, reader_offset
, 1, ENC_BIG_ENDIAN
);
7401 if (endpoint_address_length
==32) {
7402 proto_tree_add_item(arch_spec_tree
, hf_bgp_mup_nlri_3gpp_5g_ep_ip_addr
, tvb
, reader_offset
, 4, ENC_NA
);
7404 } else if (endpoint_address_length
==128) {
7405 proto_tree_add_item(arch_spec_tree
, hf_bgp_mup_nlri_3gpp_5g_ep_ipv6_addr
, tvb
, reader_offset
, 16, ENC_NA
);
7406 reader_offset
+= 16;
7408 expert_add_info_format(pinfo
, arch_spec_tree
, &ei_bgp_mup_nlri_addr_len_err
,
7409 "Invalid length (%u) of Endpoint Address Length", endpoint_address_length
);
7412 source_address_length
= tvb_get_uint8(tvb
, reader_offset
); // should be zero or multiple of 8
7413 if (source_address_length
==0) {
7415 } else if (source_address_length
==32) {
7416 proto_tree_add_item(arch_spec_tree
, hf_bgp_mup_nlri_3gpp_5g_source_ip_addr
, tvb
, reader_offset
, 4, ENC_NA
);
7418 } else if (source_address_length
==128) {
7419 proto_tree_add_item(arch_spec_tree
, hf_bgp_mup_nlri_3gpp_5g_source_ipv6_addr
, tvb
, reader_offset
, 16, ENC_NA
);
7420 reader_offset
+= 16;
7422 expert_add_info_format(pinfo
, arch_spec_tree
, &ei_bgp_mup_nlri_addr_len_err
,
7423 "Invalid length (%u) of Source Address Length", source_address_length
);
7428 /* return error because the length is unknown */
7429 proto_tree_add_expert_format(tree
, pinfo
, &ei_bgp_mup_unknown_at
, tvb
, reader_offset
, -1,
7430 "Architecture specific type 1 ST route for unknown architecture type: %d", architecture_type
);
7434 total_length
= reader_offset
- offset
;
7435 return total_length
;
7438 static int decode_bgp_mup_nlri_type2_st_route(proto_tree
*tree
, tvbuff_t
*tvb
, int offset
, packet_info
*pinfo
,
7439 uint16_t afi
, uint8_t architecture_type
) {
7441 +-----------------------------------+
7443 +-----------------------------------+
7444 | Endpoint Length (1 octet) |
7445 +-----------------------------------+
7446 | Endpoint Address (variable) |
7447 +-----------------------------------+
7448 | Architecture specific Endpoint |
7449 | Identifier (variable) |
7450 +-----------------------------------+
7452 int reader_offset
= offset
;
7453 uint32_t total_length
= 0;
7456 int byte_length
= 0;
7457 ws_in4_addr ipv4_prefix
;
7458 address ipv4_prefix_addr
;
7459 ws_in6_addr ipv6_prefix
;
7460 address ipv6_prefix_addr
;
7462 uint8_t prefix_length
= 0;
7463 uint8_t endpoint_length
= 0;
7465 uint8_t arch_spec_endpoint_length
= 0;
7466 proto_item
*arch_spec_item
;
7467 proto_tree
*arch_spec_tree
;
7468 uint32_t arch_spec_3gpp_5g_teid
;
7470 rd_pi
= proto_tree_add_item(tree
, hf_bgp_mup_nlri_rd
, tvb
, reader_offset
, 8, ENC_NA
);
7471 proto_item_append_text(rd_pi
, " (%s)", decode_bgp_rd(pinfo
->pool
, tvb
, reader_offset
));
7474 endpoint_length
= tvb_get_uint8(tvb
, reader_offset
);
7475 proto_tree_add_item(tree
, hf_bgp_mup_nlri_ep_len
, tvb
, reader_offset
, 1, ENC_BIG_ENDIAN
);
7480 prefix_length
= endpoint_length
>32 ? 32 : endpoint_length
;
7481 byte_length
= tvb_get_ipv4_addr_with_prefix_len(tvb
, reader_offset
, &ipv4_prefix
, prefix_length
);
7482 set_address(&ipv4_prefix_addr
, AT_IPv4
, 4, &ipv4_prefix
);
7483 prefix_str
= address_to_str(pinfo
->pool
, &ipv4_prefix_addr
);
7485 proto_tree_add_ipv4_format_value(tree
, hf_bgp_mup_nlri_ep_ip_addr
, tvb
, reader_offset
, byte_length
,
7486 ipv4_prefix
, "%s/%d", prefix_str
, prefix_length
);
7487 reader_offset
+= byte_length
;
7489 if (endpoint_length
>32) {
7490 arch_spec_endpoint_length
= endpoint_length
- 32;
7494 prefix_length
= endpoint_length
>128 ? 128 : endpoint_length
;
7495 byte_length
= tvb_get_ipv6_addr_with_prefix_len(tvb
, reader_offset
, &ipv6_prefix
, prefix_length
);
7496 set_address(&ipv6_prefix_addr
, AT_IPv6
, 16, ipv6_prefix
.bytes
);
7497 prefix_str
= address_to_str(pinfo
->pool
, &ipv6_prefix_addr
);
7499 proto_tree_add_ipv6_format_value(tree
, hf_bgp_mup_nlri_ep_ipv6_addr
, tvb
, reader_offset
, byte_length
,
7500 &ipv6_prefix
, "%s/%d", prefix_str
, prefix_length
);
7501 reader_offset
+= byte_length
;
7503 if (endpoint_length
>128) {
7504 arch_spec_endpoint_length
= endpoint_length
- 128;
7508 if (arch_spec_endpoint_length
>0) {
7509 switch (architecture_type
) {
7510 case BGP_MUP_AT_3GPP_5G
:
7512 +-----------------------------------+
7513 | TEID (0-4 octets) |
7514 +-----------------------------------+
7516 byte_length
= tvb_get_ipv4_addr_with_prefix_len(tvb
, reader_offset
, &arch_spec_3gpp_5g_teid
, arch_spec_endpoint_length
);
7518 arch_spec_item
= proto_tree_add_item(tree
, hf_bgp_mup_nlri_3gpp_5g_type2_st_route
, tvb
, reader_offset
, byte_length
, ENC_NA
);
7519 arch_spec_tree
= proto_item_add_subtree(arch_spec_item
, ett_bgp_mup_nlri_3gpp_5g_type2_st_route
);
7520 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
,
7521 "0x%08x/%d", g_ntohl(arch_spec_3gpp_5g_teid
), arch_spec_endpoint_length
);
7522 reader_offset
+= byte_length
;
7525 /* for unknown architecture types, just decode as binary */
7526 byte_length
= (arch_spec_endpoint_length
-1)/8 + 1;
7527 proto_tree_add_item(tree
, hf_bgp_mup_nlri_unknown_data
, tvb
, reader_offset
, byte_length
, ENC_NA
);
7528 reader_offset
+= byte_length
;
7530 proto_tree_add_expert_format(tree
, pinfo
, &ei_bgp_mup_unknown_at
, tvb
, reader_offset
, -1,
7531 "Architecture specific type 2 ST route for unknown architecture type: %d", architecture_type
);
7536 total_length
= reader_offset
- offset
;
7537 return total_length
;
7540 /* draft-mpmz-bess-mup-safi-00 */
7541 static int decode_bgp_mup_nlri(proto_tree
*tree
, tvbuff_t
*tvb
, int offset
, packet_info
*pinfo
, uint16_t afi
) {
7543 int reader_offset
= offset
;
7545 proto_tree
*prefix_tree
;
7546 proto_item
*nlri_pi
;
7548 uint8_t architecture_type
;
7549 uint16_t route_type
;
7552 int decoded_length
= 0;
7554 architecture_type
= tvb_get_uint8(tvb
, offset
);
7555 route_type
= tvb_get_uint16(tvb
, offset
+ 1, ENC_BIG_ENDIAN
);
7556 nlri_len
= tvb_get_uint8(tvb
, offset
+ 3);
7558 nlri_pi
= proto_tree_add_item(tree
, hf_bgp_mup_nlri
, tvb
, reader_offset
, nlri_len
+4, ENC_NA
);
7560 prefix_tree
= proto_item_add_subtree(nlri_pi
, ett_bgp_mup_nlri
);
7562 proto_tree_add_item(prefix_tree
, hf_bgp_mup_nlri_at
, tvb
, reader_offset
, 1, ENC_BIG_ENDIAN
);
7563 proto_item_append_text(nlri_pi
, ": %s", val_to_str(architecture_type
, bgp_mup_architecture_types
,
7564 "Unknown architecture type %d"));
7567 proto_tree_add_item(prefix_tree
, hf_bgp_mup_nlri_rt
, tvb
, reader_offset
, 2, ENC_BIG_ENDIAN
);
7568 proto_item_append_text(nlri_pi
, ": %s", val_to_str(route_type
, bgp_mup_route_types
,
7569 "Unknown route type %d"));
7572 proto_tree_add_item(prefix_tree
, hf_bgp_mup_nlri_len
, tvb
, reader_offset
, 1, ENC_BIG_ENDIAN
);
7575 switch (route_type
) {
7576 case BGP_MUP_RT_INTERWORK_SEGMENT_DISCOVERY
:
7578 +-----------------------------------+
7580 +-----------------------------------+
7581 | Prefix Length (1 octet) |
7582 +-----------------------------------+
7583 | Prefix (variable) |
7584 +-----------------------------------+
7586 rd_pi
= proto_tree_add_item(prefix_tree
, hf_bgp_mup_nlri_rd
, tvb
, reader_offset
, 8, ENC_NA
);
7587 proto_item_append_text(rd_pi
, " (%s)", decode_bgp_rd(pinfo
->pool
, tvb
, reader_offset
));
7590 decoded_length
= decode_bgp_mup_nlri_variable_prefix(prefix_tree
, tvb
, reader_offset
, pinfo
, afi
);
7591 if (decoded_length
< 0) {
7596 case BGP_MUP_RT_DIRECT_SEGMENT_DISCOVERY
:
7598 +-----------------------------------+
7600 +-----------------------------------+
7601 | Address (4 or 16 octets) |
7602 +-----------------------------------+
7604 rd_pi
= proto_tree_add_item(prefix_tree
, hf_bgp_mup_nlri_rd
, tvb
, reader_offset
, 8, ENC_NA
);
7605 proto_item_append_text(rd_pi
, " (%s)", decode_bgp_rd(pinfo
->pool
, tvb
, reader_offset
));
7609 proto_tree_add_item(prefix_tree
, hf_bgp_mup_nlri_ip_addr
, tvb
, reader_offset
, 4, ENC_NA
);
7612 proto_tree_add_item(prefix_tree
, hf_bgp_mup_nlri_ipv6_addr
, tvb
, reader_offset
, 16, ENC_NA
);
7617 case BGP_MUP_RT_TYPE_1_SESSION_TRANSFORMED
:
7618 decoded_length
= decode_bgp_mup_nlri_type1_st_route(prefix_tree
, tvb
, reader_offset
, pinfo
, afi
, architecture_type
);
7619 if (decoded_length
< 0) {
7624 case BGP_MUP_RT_TYPE_2_SESSION_TRANSFORMED
:
7625 decoded_length
= decode_bgp_mup_nlri_type2_st_route(prefix_tree
, tvb
, reader_offset
, pinfo
, afi
, architecture_type
);
7626 if (decoded_length
< 0) {
7632 /* for unknown route types, just decode as binary */
7633 proto_tree_add_item(prefix_tree
, hf_bgp_mup_nlri_unknown_data
, tvb
, reader_offset
, nlri_len
, ENC_NA
);
7634 reader_offset
+= nlri_len
;
7635 proto_tree_add_expert_format(prefix_tree
, pinfo
, &ei_bgp_mup_unknown_rt
, tvb
, reader_offset
, -1,
7636 "Unknown route type: %d", route_type
);
7645 * Decode a multiprotocol prefix
7648 decode_prefix_MP(proto_tree
*tree
, int hf_path_id
, int hf_addr4
, int hf_addr6
,
7649 uint16_t afi
, uint8_t safi
, int tlen
, tvbuff_t
*tvb
, int offset
,
7650 const char *tag
, packet_info
*pinfo
)
7652 int start_offset
= offset
;
7654 proto_tree
*prefix_tree
;
7655 proto_item
*nlri_ti
;
7656 proto_tree
*nlri_tree
;
7657 proto_item
*disting_item
;
7658 proto_tree
*disting_tree
;
7660 int total_length
=0; /* length of the entire item */
7661 int length
; /* length of the prefix address, in bytes */
7663 unsigned plen
; /* length of the prefix address, in bits */
7664 unsigned labnum
; /* number of labels */
7665 uint16_t tnl_id
; /* Tunnel Identifier */
7666 ws_in4_addr ip4addr
; /* IPv4 address */
7668 ws_in6_addr ip6addr
; /* IPv6 address */
7669 uint16_t nlri_type
; /* NLRI Type */
7671 uint32_t path_identifier
=0;
7672 int end
=0; /* Message End */
7674 wmem_strbuf_t
*stack_strbuf
; /* label stack */
7675 wmem_strbuf_t
*comm_strbuf
;
7682 case SAFNUM_UNICAST
:
7683 case SAFNUM_MULCAST
:
7684 case SAFNUM_UNIMULC
:
7685 /* parse each prefix */
7687 end
= offset
+ tlen
;
7689 /* Heuristic to detect if IPv4 prefix are using Path Identifiers */
7690 if( detect_add_path_prefix4(tvb
, offset
, end
) ) {
7691 /* IPv4 prefixes with Path Id */
7692 total_length
= decode_path_prefix4(tree
, pinfo
, hf_path_id
, hf_addr4
, tvb
, offset
, tag
);
7694 total_length
= decode_prefix4(tree
, pinfo
, NULL
,hf_addr4
, tvb
, offset
, tag
);
7696 if (total_length
< 0)
7700 case SAFNUM_MPLS_LABEL
:
7701 end
= offset
+ tlen
;
7702 /* Heuristic to detect if IPv4 prefix are using Path Identifiers */
7703 if( detect_add_path_prefix46(tvb
, offset
, end
, 255) ) {
7704 /* snarf path identifier */
7705 path_identifier
= tvb_get_ntohl(tvb
, offset
);
7710 plen
= tvb_get_uint8(tvb
, offset
);
7711 stack_strbuf
= wmem_strbuf_create(pinfo
->pool
);
7712 labnum
= decode_MPLS_stack(tvb
, offset
+ 1, stack_strbuf
);
7714 offset
+= (1 + labnum
* 3);
7715 if (plen
< (labnum
* 3*8)) {
7716 proto_tree_add_expert_format(tree
, pinfo
, &ei_bgp_prefix_length_invalid
, tvb
, start_offset
, 1,
7717 "%s Labeled IPv4 prefix length %u invalid",
7721 plen
-= (labnum
* 3*8);
7722 length
= tvb_get_ipv4_addr_with_prefix_len(tvb
, offset
, &ip4addr
, plen
);
7724 proto_tree_add_expert_format(tree
, pinfo
, &ei_bgp_prefix_length_invalid
, tvb
, start_offset
, 1,
7725 "%s Labeled IPv4 prefix length %u invalid",
7726 tag
, plen
+ (labnum
* 3*8));
7730 set_address(&addr
, AT_IPv4
, 4, &ip4addr
);
7731 if (total_length
> 0) {
7732 prefix_tree
= proto_tree_add_subtree_format(tree
, tvb
, start_offset
,
7733 (offset
+ length
) - start_offset
,
7734 ett_bgp_prefix
, NULL
,
7735 "Label Stack=%s IPv4=%s/%u PathID %u",
7736 wmem_strbuf_get_str(stack_strbuf
),
7737 address_to_str(pinfo
->pool
, &addr
), plen
, path_identifier
);
7738 proto_tree_add_item(prefix_tree
, hf_path_id
, tvb
, start_offset
, 4, ENC_BIG_ENDIAN
);
7741 prefix_tree
= proto_tree_add_subtree_format(tree
, tvb
, start_offset
,
7742 (offset
+ length
) - start_offset
,
7743 ett_bgp_prefix
, NULL
,
7744 "Label Stack=%s IPv4=%s/%u",
7745 wmem_strbuf_get_str(stack_strbuf
),
7746 address_to_str(pinfo
->pool
, &addr
), plen
);
7748 proto_tree_add_uint_format(prefix_tree
, hf_bgp_prefix_length
, tvb
, start_offset
, 1, plen
+ labnum
* 3 * 8,
7749 "%s Prefix length: %u", tag
, plen
+ labnum
* 3 * 8);
7750 proto_tree_add_string_format(prefix_tree
, hf_bgp_label_stack
, tvb
, start_offset
+ 1, 3 * labnum
, wmem_strbuf_get_str(stack_strbuf
),
7751 "%s Label Stack: %s", tag
, wmem_strbuf_get_str(stack_strbuf
));
7752 total_length
+= (1 + labnum
*3) + length
;
7753 proto_tree_add_ipv4(prefix_tree
, hf_addr4
, tvb
, offset
, length
, ip4addr
);
7755 case SAFNUM_MCAST_VPN
:
7756 total_length
= decode_mcast_vpn_nlri(tree
, tvb
, offset
, afi
, pinfo
);
7757 if (total_length
< 0)
7761 total_length
= decode_mdt_safi(pinfo
, tree
, tvb
, offset
);
7762 if (total_length
< 0)
7765 case SAFNUM_ROUTE_TARGET
:
7766 plen
= tvb_get_uint8(tvb
, offset
);
7769 proto_tree_add_string(tree
, hf_bgp_wildcard_route_target
, tvb
, offset
, 1, tag
);
7774 if ((plen
< 32) || (plen
> 96)) {
7775 proto_tree_add_expert_format(tree
, pinfo
, &ei_bgp_length_invalid
, tvb
, offset
, 1,
7776 "%s Route target length %u invalid",
7781 length
= (plen
+ 7)/8;
7782 comm_strbuf
= wmem_strbuf_create(pinfo
->pool
);
7784 switch (tvb_get_ntohs(tvb
, offset
+ 1 + 4)) {
7785 case BGP_EXT_COM_RT_AS2
:
7786 wmem_strbuf_append_printf(comm_strbuf
, "%u:%u",
7787 tvb_get_ntohs(tvb
, offset
+ 1 + 6),
7788 tvb_get_ntohl(tvb
, offset
+ 1 + 8));
7790 case BGP_EXT_COM_RT_IP4
:
7791 wmem_strbuf_append_printf(comm_strbuf
, "%s:%u",
7792 tvb_ip_to_str(pinfo
->pool
, tvb
, offset
+ 1 + 6),
7793 tvb_get_ntohs(tvb
, offset
+ 1 + 10));
7795 case BGP_EXT_COM_RT_AS4
:
7796 wmem_strbuf_append_printf(comm_strbuf
, "%u:%u",
7797 tvb_get_ntohl(tvb
, 6),
7798 tvb_get_ntohs(tvb
, offset
+ 1 + 10));
7801 wmem_strbuf_append_printf(comm_strbuf
, "Invalid RT type");
7804 prefix_tree
= proto_tree_add_subtree_format(tree
, tvb
, offset
+ 1, length
,
7805 ett_bgp_prefix
, NULL
, "%s %u:%s/%u",
7806 tag
, tvb_get_ntohl(tvb
, offset
+ 1 + 0),
7807 wmem_strbuf_get_str(comm_strbuf
),
7809 proto_tree_add_item(prefix_tree
, hf_bgp_prefix_length
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
7810 proto_tree_add_item(prefix_tree
, hf_bgp_originating_as
, tvb
, offset
+ 1, 4, ENC_BIG_ENDIAN
);
7811 proto_tree_add_string(prefix_tree
, hf_bgp_community_prefix
, tvb
, offset
+ 1 + 4, length
- 4, wmem_strbuf_get_str(comm_strbuf
));
7812 total_length
= 1 + length
;
7814 case SAFNUM_ENCAPSULATION
:
7815 plen
= tvb_get_uint8(tvb
, offset
);
7817 proto_tree_add_expert_format(tree
, pinfo
, &ei_bgp_length_invalid
, tvb
, offset
, 1,
7818 "%s IPv4 address length %u invalid",
7824 proto_tree_add_item(tree
, hf_bgp_endpoint_address
, tvb
, offset
, 4, ENC_NA
);
7826 total_length
= 5; /* length(1 octet) + address(4 octets) */
7829 plen
= tvb_get_uint8(tvb
, offset
);
7831 proto_tree_add_expert_format(tree
, pinfo
, &ei_bgp_prefix_length_invalid
, tvb
, start_offset
, 1,
7832 "%s Tunnel IPv4 prefix length %u invalid",
7836 tnl_id
= tvb_get_ntohs(tvb
, offset
+ 1);
7837 offset
+= 3; /* Length + Tunnel Id */
7838 plen
-= 16; /* 2-octet Identifier */
7839 length
= tvb_get_ipv4_addr_with_prefix_len(tvb
, offset
, &ip4addr
, plen
);
7841 proto_tree_add_expert_format(tree
, pinfo
, &ei_bgp_prefix_length_invalid
, tvb
, start_offset
, 1,
7842 "%s Tunnel IPv4 prefix length %u invalid",
7846 set_address(&addr
, AT_IPv4
, 4, &ip4addr
);
7847 prefix_tree
= proto_tree_add_subtree_format(tree
, tvb
, start_offset
,
7848 (offset
+ length
) - start_offset
,
7849 ett_bgp_prefix
, NULL
,
7850 "Tunnel Identifier=0x%x IPv4=%s/%u",
7851 tnl_id
, address_to_str(pinfo
->pool
, &addr
), plen
);
7853 proto_tree_add_item(prefix_tree
, hf_bgp_prefix_length
, tvb
, start_offset
, 1, ENC_BIG_ENDIAN
);
7855 proto_tree_add_item(prefix_tree
, hf_bgp_mp_nlri_tnl_id
, tvb
,
7856 start_offset
+ 1, 2, ENC_BIG_ENDIAN
);
7857 proto_tree_add_ipv4(prefix_tree
, hf_addr4
, tvb
, offset
, length
, ip4addr
);
7858 total_length
= 1 + 2 + length
; /* length field + Tunnel Id + IPv4 len */
7860 case SAFNUM_SR_POLICY
:
7861 total_length
= decode_sr_policy_nlri(tree
, tvb
, offset
, afi
);
7862 if (total_length
< 0)
7865 case SAFNUM_LAB_VPNUNICAST
:
7866 case SAFNUM_LAB_VPNMULCAST
:
7867 case SAFNUM_LAB_VPNUNIMULC
:
7868 end
= offset
+ tlen
;
7869 /* Heuristic to detect if IPv4 prefix are using Path Identifiers */
7870 if (detect_add_path_prefix46(tvb
, offset
, end
, 255)) {
7871 /* snarf path identifier */
7875 plen
= tvb_get_uint8(tvb
, offset
);
7876 stack_strbuf
= wmem_strbuf_create(pinfo
->pool
);
7877 labnum
= decode_MPLS_stack(tvb
, offset
+ 1, stack_strbuf
);
7879 offset
+= (1 + labnum
* 3);
7880 if (plen
< (labnum
* 3*8 + 8*8)) {
7881 proto_tree_add_expert_format(tree
, pinfo
, &ei_bgp_prefix_length_invalid
, tvb
, start_offset
, 1,
7882 "%s Labeled VPN IPv4 prefix length %u invalid",
7886 plen
-= (labnum
* 3*8 + 8*8);
7888 length
= tvb_get_ipv4_addr_with_prefix_len(tvb
, offset
+ 8, &ip4addr
, plen
);
7890 proto_tree_add_expert_format(tree
, pinfo
, &ei_bgp_prefix_length_invalid
, tvb
, start_offset
, 1,
7891 "%s Labeled VPN IPv4 prefix length %u invalid",
7892 tag
, plen
+ (labnum
* 3*8) + 8*8);
7895 set_address(&addr
, AT_IPv4
, 4, &ip4addr
);
7896 prefix_tree
= proto_tree_add_subtree_format(tree
, tvb
, start_offset
,
7897 (offset
+ 8 + length
) - start_offset
,
7898 ett_bgp_prefix
, NULL
, "BGP Prefix");
7900 if (total_length
> 0) {
7901 proto_tree_add_item(prefix_tree
, hf_path_id
, tvb
, start_offset
, 4, ENC_BIG_ENDIAN
);
7904 proto_tree_add_item(prefix_tree
, hf_bgp_prefix_length
, tvb
, start_offset
, 1, ENC_NA
);
7905 proto_tree_add_string(prefix_tree
, hf_bgp_label_stack
, tvb
, start_offset
+ 1, 3 * labnum
, wmem_strbuf_get_str(stack_strbuf
));
7906 proto_tree_add_string(prefix_tree
, hf_bgp_rd
, tvb
, start_offset
+ 1 + 3 * labnum
, 8, decode_bgp_rd(pinfo
->pool
, tvb
, offset
));
7908 proto_tree_add_ipv4(prefix_tree
, hf_addr4
, tvb
, offset
+ 8, length
, ip4addr
);
7910 total_length
+= (1 + labnum
* 3 + 8) + length
;
7913 case SAFNUM_FSPEC_RULE
:
7914 case SAFNUM_FSPEC_VPN_RULE
:
7915 total_length
= decode_flowspec_nlri(tree
, tvb
, offset
, afi
, safi
, pinfo
);
7916 if(total_length
< 0)
7920 case SAFNUM_BGP_MUP
:
7921 total_length
= decode_bgp_mup_nlri(tree
, tvb
, offset
, pinfo
, afi
);
7924 proto_tree_add_expert_format(tree
, pinfo
, &ei_bgp_unknown_safi
, tvb
, start_offset
, 0,
7925 "Unknown SAFI (%u) for AFI %u", safi
, afi
);
7927 } /* switch (safi) */
7933 case SAFNUM_UNICAST
:
7934 case SAFNUM_MULCAST
:
7935 case SAFNUM_UNIMULC
:
7936 /* parse each prefix */
7938 end
= offset
+ tlen
;
7940 /* Heuristic to detect if IPv6 prefix are using Path Identifiers */
7941 if( detect_add_path_prefix6(tvb
, offset
, end
) ) {
7942 /* IPv6 prefixes with Path Id */
7943 total_length
= decode_path_prefix6(tree
, pinfo
, hf_path_id
, hf_addr6
, tvb
, offset
, tag
);
7945 total_length
= decode_prefix6(tree
, pinfo
, hf_addr6
, tvb
, offset
, 0, tag
);
7947 if (total_length
< 0)
7951 case SAFNUM_MPLS_LABEL
:
7952 end
= offset
+ tlen
;
7953 /* Heuristic to detect if IPv6 prefix are using Path Identifiers */
7954 if( detect_add_path_prefix46(tvb
, offset
, end
, 255) ) {
7955 /* snarf path identifier */
7956 path_identifier
= tvb_get_ntohl(tvb
, offset
);
7961 plen
= tvb_get_uint8(tvb
, offset
);
7962 stack_strbuf
= wmem_strbuf_create(pinfo
->pool
);
7963 labnum
= decode_MPLS_stack(tvb
, offset
+ 1, stack_strbuf
);
7965 offset
+= (1 + labnum
* 3);
7966 if (plen
< (labnum
* 3*8)) {
7967 proto_tree_add_expert_format(tree
, pinfo
, &ei_bgp_prefix_length_invalid
, tvb
, start_offset
, 1,
7968 "%s Labeled IPv6 prefix length %u invalid", tag
, plen
);
7971 plen
-= (labnum
* 3*8);
7973 length
= tvb_get_ipv6_addr_with_prefix_len(tvb
, offset
, &ip6addr
, plen
);
7975 proto_tree_add_expert_format(tree
, pinfo
, &ei_bgp_prefix_length_invalid
, tvb
, start_offset
, 1,
7976 "%s Labeled IPv6 prefix length %u invalid",
7977 tag
, plen
+ (labnum
* 3*8));
7981 set_address(&addr
, AT_IPv6
, 16, ip6addr
.bytes
);
7982 if (total_length
> 0) {
7983 prefix_tree
= proto_tree_add_subtree_format(tree
, tvb
, start_offset
,
7984 (offset
+ length
) - start_offset
,
7985 ett_bgp_prefix
, NULL
,
7986 "Label Stack=%s, IPv6=%s/%u PathId %u",
7987 wmem_strbuf_get_str(stack_strbuf
),
7988 address_to_str(pinfo
->pool
, &addr
), plen
, path_identifier
);
7989 proto_tree_add_item(prefix_tree
, hf_path_id
, tvb
, start_offset
, 4, ENC_BIG_ENDIAN
);
7992 prefix_tree
= proto_tree_add_subtree_format(tree
, tvb
, start_offset
,
7993 (offset
+ length
) - start_offset
,
7994 ett_bgp_prefix
, NULL
,
7995 "Label Stack=%s, IPv6=%s/%u",
7996 wmem_strbuf_get_str(stack_strbuf
),
7997 address_to_str(pinfo
->pool
, &addr
), plen
);
7999 proto_tree_add_uint_format(prefix_tree
, hf_bgp_prefix_length
, tvb
, start_offset
, 1, plen
+ labnum
* 3 * 8,
8000 "%s Prefix length: %u", tag
, plen
+ labnum
* 3 * 8);
8001 proto_tree_add_string_format(prefix_tree
, hf_bgp_label_stack
, tvb
, start_offset
+ 1, 3 * labnum
, wmem_strbuf_get_str(stack_strbuf
),
8002 "%s Label Stack: %s", tag
, wmem_strbuf_get_str(stack_strbuf
));
8003 total_length
+= (1 + labnum
*3) + length
;
8004 proto_tree_add_ipv6(prefix_tree
, hf_addr6
, tvb
, offset
, length
, &ip6addr
);
8006 case SAFNUM_MCAST_VPN
:
8007 total_length
= decode_mcast_vpn_nlri(tree
, tvb
, offset
, afi
, pinfo
);
8008 if (total_length
< 0)
8011 case SAFNUM_ENCAPSULATION
:
8012 plen
= tvb_get_uint8(tvb
, offset
);
8014 proto_tree_add_expert_format(tree
, pinfo
, &ei_bgp_length_invalid
, tvb
, offset
, 1,
8015 "%s IPv6 address length %u invalid",
8021 proto_tree_add_item(tree
, hf_bgp_endpoint_address_ipv6
, tvb
, offset
, 16, ENC_NA
);
8023 total_length
= 17; /* length(1 octet) + address(16 octets) */
8026 plen
= tvb_get_uint8(tvb
, offset
);
8028 proto_tree_add_expert_format(tree
, pinfo
, &ei_bgp_prefix_length_invalid
, tvb
, start_offset
, 1,
8029 "%s Tunnel IPv6 prefix length %u invalid",
8033 tnl_id
= tvb_get_ntohs(tvb
, offset
+ 1);
8034 offset
+= 3; /* Length + Tunnel Id */
8035 plen
-= 16; /* 2-octet Identifier */
8036 length
= tvb_get_ipv6_addr_with_prefix_len(tvb
, offset
, &ip6addr
, plen
);
8038 proto_tree_add_expert_format(tree
, pinfo
, &ei_bgp_prefix_length_invalid
, tvb
, start_offset
, 1,
8039 "%s Tunnel IPv6 prefix length %u invalid",
8043 set_address(&addr
, AT_IPv6
, 16, ip6addr
.bytes
);
8044 prefix_tree
= proto_tree_add_subtree_format(tree
, tvb
, start_offset
,
8045 (offset
+ length
) - start_offset
,
8046 ett_bgp_prefix
, NULL
,
8047 "Tunnel Identifier=0x%x IPv6=%s/%u",
8048 tnl_id
, address_to_str(pinfo
->pool
, &addr
), plen
);
8049 proto_tree_add_item(prefix_tree
, hf_bgp_prefix_length
, tvb
, start_offset
, 1, ENC_BIG_ENDIAN
);
8051 proto_tree_add_item(prefix_tree
, hf_bgp_mp_nlri_tnl_id
, tvb
,
8052 start_offset
+ 1, 2, ENC_BIG_ENDIAN
);
8053 proto_tree_add_ipv6(prefix_tree
, hf_addr6
, tvb
, offset
, length
, &ip6addr
);
8055 total_length
= (1 + 2) + length
; /* length field + Tunnel Id + IPv4 len */
8058 case SAFNUM_SR_POLICY
:
8059 total_length
= decode_sr_policy_nlri(tree
, tvb
, offset
, afi
);
8060 if (total_length
< 0)
8064 case SAFNUM_BGP_MUP
:
8065 total_length
= decode_bgp_mup_nlri(tree
, tvb
, offset
, pinfo
, afi
);
8067 case SAFNUM_LAB_VPNUNICAST
:
8068 case SAFNUM_LAB_VPNMULCAST
:
8069 case SAFNUM_LAB_VPNUNIMULC
:
8070 end
= offset
+ tlen
;
8071 /* Heuristic to detect if IPv6 prefix are using Path Identifiers */
8072 if (detect_add_path_prefix46(tvb
, offset
, end
, 255)) {
8073 /* snarf path identifier */
8077 plen
= tvb_get_uint8(tvb
, offset
);
8078 stack_strbuf
= wmem_strbuf_create(pinfo
->pool
);
8079 labnum
= decode_MPLS_stack(tvb
, offset
+ 1, stack_strbuf
);
8081 offset
+= (1 + labnum
* 3);
8082 if (plen
< (labnum
* 3*8 + 8*8)) {
8083 proto_tree_add_expert_format(tree
, pinfo
, &ei_bgp_prefix_length_invalid
, tvb
, start_offset
, 1,
8084 "%s Labeled VPN IPv6 prefix length %u invalid", tag
, plen
);
8087 plen
-= (labnum
* 3*8 + 8*8);
8089 length
= tvb_get_ipv6_addr_with_prefix_len(tvb
, offset
+ 8, &ip6addr
, plen
);
8091 proto_tree_add_expert_format(tree
, pinfo
, &ei_bgp_prefix_length_invalid
, tvb
, start_offset
, 1,
8092 "%s Labeled VPN IPv6 prefix length %u invalid",
8093 tag
, plen
+ (labnum
* 3*8) + 8*8);
8097 if (total_length
> 0) {
8098 proto_tree_add_item(tree
, hf_path_id
, tvb
, start_offset
, 4, ENC_BIG_ENDIAN
);
8101 proto_tree_add_item(tree
, hf_bgp_prefix_length
, tvb
, start_offset
, 1, ENC_NA
);
8102 proto_tree_add_string(tree
, hf_bgp_label_stack
, tvb
, start_offset
+ 1, labnum
* 3, wmem_strbuf_get_str(stack_strbuf
));
8103 proto_tree_add_string(tree
, hf_bgp_rd
, tvb
, offset
, 8, decode_bgp_rd(pinfo
->pool
, tvb
, offset
));
8106 set_address(&addr
, AT_IPv6
, 16, ip6addr
.bytes
);
8107 proto_tree_add_ipv6_format_value(tree
, hf_addr6
, tvb
, offset
+ 8, length
,
8108 &ip6addr
, "%s/%u", address_to_str(pinfo
->pool
, &addr
), plen
);
8110 total_length
+= (1 + labnum
* 3 + 8) + length
;
8113 case SAFNUM_FSPEC_RULE
:
8114 case SAFNUM_FSPEC_VPN_RULE
:
8115 total_length
= decode_flowspec_nlri(tree
, tvb
, offset
, afi
, safi
, pinfo
);
8116 if(total_length
< 0)
8121 proto_tree_add_expert_format(tree
, pinfo
, &ei_bgp_unknown_safi
, tvb
, start_offset
, 0,
8122 "Unknown SAFI (%u) for AFI %u", safi
, afi
);
8124 } /* switch (safi) */
8128 case AFNUM_L2VPN_OLD
:
8131 case SAFNUM_LAB_VPNUNICAST
:
8132 case SAFNUM_LAB_VPNMULCAST
:
8133 case SAFNUM_LAB_VPNUNIMULC
:
8135 plen
= tvb_get_ntohs(tvb
,offset
);
8136 proto_tree_add_item(tree
, hf_bgp_vplsad_length
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
8138 proto_tree_add_string(tree
, hf_bgp_vplsad_rd
, tvb
, offset
+2, 8, decode_bgp_rd(pinfo
->pool
, tvb
, offset
+2));
8139 /* RFC6074 Section 7 BGP-AD and VPLS-BGP Interoperability
8140 Both BGP-AD and VPLS-BGP [RFC4761] use the same AFI/SAFI. In order
8141 for both BGP-AD and VPLS-BGP to co-exist, the NLRI length must be
8142 used as a demultiplexer.
8144 The BGP-AD NLRI has an NLRI length of 12 bytes, containing only an
8145 8-byte RD and a 4-byte VSI-ID. VPLS-BGP [RFC4761] uses a 17-byte
8146 NLRI length. Therefore, implementations of BGP-AD must ignore NLRI
8147 that are greater than 12 bytes.
8149 if(plen
== 12) /* BGP-AD */
8151 proto_tree_add_item(tree
, hf_bgp_bgpad_pe_addr
, tvb
, offset
+10, 4, ENC_NA
);
8152 }else{ /* VPLS-BGP */
8154 proto_tree_add_item(tree
, hf_bgp_vplsbgp_ce_id
, tvb
, offset
+10, 2, ENC_BIG_ENDIAN
);
8156 proto_tree_add_item(tree
, hf_bgp_vplsbgp_labelblock_offset
, tvb
, offset
+12, 2, ENC_BIG_ENDIAN
);
8157 proto_tree_add_item(tree
, hf_bgp_vplsbgp_labelblock_size
, tvb
, offset
+14, 2, ENC_BIG_ENDIAN
);
8158 stack_strbuf
= wmem_strbuf_create(pinfo
->pool
);
8159 decode_MPLS_stack(tvb
, offset
+ 16, stack_strbuf
);
8160 proto_tree_add_string(tree
, hf_bgp_vplsbgp_labelblock_base
, tvb
, offset
+16, plen
-14, wmem_strbuf_get_str(stack_strbuf
));
8163 /* FIXME there are subTLVs left to decode ... for now lets omit them */
8164 total_length
= plen
+2;
8168 /* Check for Add Path */
8169 if (tvb_get_uint8(tvb
, offset
+ 4 ) <= EVPN_S_PMSI_A_D_ROUTE
&& tvb_get_uint8(tvb
, offset
) == 0) {
8170 proto_tree_add_item(tree
, hf_path_id
, tvb
, offset
, 4, ENC_BIG_ENDIAN
);
8172 total_length
= decode_evpn_nlri(tree
, tvb
, offset
, pinfo
) + 4;
8174 total_length
= decode_evpn_nlri(tree
, tvb
, offset
, pinfo
);
8179 proto_tree_add_expert_format(tree
, pinfo
, &ei_bgp_unknown_safi
, tvb
, start_offset
, 0,
8180 "Unknown SAFI (%u) for AFI %u", safi
, afi
);
8182 } /* switch (safi) */
8185 nlri_type
= tvb_get_ntohs(tvb
, offset
);
8186 total_length
= tvb_get_ntohs(tvb
, offset
+ 2);
8187 length
= total_length
;
8190 if (safi
== SAFNUM_BGP_LS
|| safi
== SAFNUM_BGP_LS_VPN
) {
8191 ti
= proto_tree_add_item(tree
, hf_bgp_ls_nlri
, tvb
, offset
, total_length
, ENC_NA
);
8192 } else if (safi
== SAFNUM_LAB_VPNUNICAST
) {
8193 ti
= proto_tree_add_item(tree
, hf_bgp_ls_safi128_nlri
, tvb
, offset
, total_length
, ENC_NA
);
8197 prefix_tree
= proto_item_add_subtree(ti
, ett_bgp_mp_reach_nlri
);
8198 proto_tree_add_item(prefix_tree
, hf_bgp_ls_nlri_type
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
8199 proto_tree_add_item(prefix_tree
, hf_bgp_ls_nlri_length
, tvb
, offset
+ 2, 2, ENC_BIG_ENDIAN
);
8202 /* when SAFI 128, then write route distinguisher */
8203 if (safi
== SAFNUM_LAB_VPNUNICAST
) {
8204 if (length
< BGP_ROUTE_DISTINGUISHER_SIZE
) {
8206 expert_add_info_format(pinfo
, prefix_tree
, &ei_bgp_ls_error
,
8207 "Unexpected end of SAFI 128 NLRI, Route Distinguisher field is required!");
8210 expert_add_info_format(pinfo
, prefix_tree
, &ei_bgp_ls_error
,
8211 "Unexpected Route Distinguisher length (%u)!",
8216 disting_item
= proto_tree_add_item(prefix_tree
, hf_bgp_ls_safi128_nlri_route_distinguisher
,
8217 tvb
, offset
, BGP_ROUTE_DISTINGUISHER_SIZE
, ENC_NA
);
8218 disting_tree
= proto_item_add_subtree(disting_item
, ett_bgp_mp_reach_nlri
);
8219 tmp16
= tvb_get_ntohs(tvb
, offset
);
8220 proto_tree_add_item(disting_tree
, hf_bgp_ls_safi128_nlri_route_distinguisher_type
,
8221 tvb
, offset
, 2, ENC_BIG_ENDIAN
);
8222 /* Route Distinguisher Type */
8225 proto_tree_add_item(disting_tree
, hf_bgp_ls_safi128_nlri_route_dist_admin_asnum_2
,
8226 tvb
, offset
+ 2, 2, ENC_BIG_ENDIAN
);
8227 proto_tree_add_item(disting_tree
, hf_bgp_ls_safi128_nlri_route_dist_asnum_4
,
8228 tvb
, offset
+ 4, 4, ENC_BIG_ENDIAN
);
8232 proto_tree_add_item(disting_tree
, hf_bgp_ls_safi128_nlri_route_dist_admin_ipv4
,
8233 tvb
, offset
+ 2, 4, ENC_BIG_ENDIAN
);
8234 proto_tree_add_item(disting_tree
, hf_bgp_ls_safi128_nlri_route_dist_asnum_2
,
8235 tvb
, offset
+ 6, 2, ENC_BIG_ENDIAN
);
8239 proto_tree_add_item(disting_tree
, hf_bgp_ls_safi128_nlri_route_dist_admin_asnum_4
,
8240 tvb
, offset
+ 2, 4, ENC_BIG_ENDIAN
);
8241 proto_tree_add_item(disting_tree
, hf_bgp_ls_safi128_nlri_route_dist_asnum_2
,
8242 tvb
, offset
+ 6, 2, ENC_BIG_ENDIAN
);
8246 expert_add_info_format(pinfo
, disting_tree
, &ei_bgp_ls_error
,
8247 "Unknown Route Distinguisher type (%u)", tmp16
);
8249 offset
+= BGP_ROUTE_DISTINGUISHER_SIZE
;
8250 length
-= BGP_ROUTE_DISTINGUISHER_SIZE
;
8253 switch (nlri_type
) {
8254 case LINK_STATE_LINK_NLRI
:
8256 nlri_ti
= proto_tree_add_item(prefix_tree
,
8257 hf_bgp_ls_nlri_link_nlri_type
, tvb
, offset
, length
,
8259 nlri_tree
= proto_item_add_subtree(nlri_ti
, ett_bgp_mp_reach_nlri
);
8260 tmp_length
= decode_bgp_link_node_nlri_common_fields(tvb
, nlri_tree
,
8261 offset
, pinfo
, length
);
8265 offset
+= tmp_length
;
8266 length
-= tmp_length
;
8268 /* dissect Remote Node descriptors TLV */
8269 if (length
> 0 && length
< 4) {
8270 expert_add_info_format(pinfo
, nlri_tree
, &ei_bgp_ls_error
,
8271 "Unknown data in Link-State Link NLRI!");
8277 tmp_length
= decode_bgp_link_node_nlri_tlvs(tvb
, nlri_tree
, offset
,
8278 pinfo
, BGP_NLRI_TLV_REMOTE_NODE_DESCRIPTORS
);
8282 offset
+= tmp_length
;
8283 length
-= tmp_length
;
8285 /* dissect Link Descriptor NLRI */
8286 if (length
> 0 && length
< 4) {
8287 expert_add_info_format(pinfo
, nlri_tree
, &ei_bgp_ls_error
,
8288 "Unknown data in Link-State Link NLRI, length = %d bytes.", length
);
8294 tmp_length
= decode_bgp_link_nlri_link_descriptors(tvb
, nlri_tree
,
8295 offset
, pinfo
, length
);
8301 case LINK_STATE_NODE_NLRI
:
8302 nlri_ti
= proto_tree_add_item(prefix_tree
,
8303 hf_bgp_ls_nlri_node_nlri_type
, tvb
, offset
, length
,
8305 nlri_tree
= proto_item_add_subtree(nlri_ti
, ett_bgp_mp_reach_nlri
);
8306 tmp_length
= decode_bgp_link_node_nlri_common_fields(tvb
, nlri_tree
,
8307 offset
, pinfo
, length
);
8313 case LINK_STATE_IPV4_TOPOLOGY_PREFIX_NLRI
:
8314 nlri_ti
= proto_tree_add_item(prefix_tree
,
8315 hf_bgp_ls_ipv4_topology_prefix_nlri_type
, tvb
, offset
, length
,
8317 nlri_tree
= proto_item_add_subtree(nlri_ti
, ett_bgp_mp_reach_nlri
);
8318 tmp_length
= decode_bgp_link_node_nlri_common_fields(tvb
, nlri_tree
,
8319 offset
, pinfo
, length
);
8323 offset
+= tmp_length
;
8324 length
-= tmp_length
;
8326 /* dissect Prefix Descriptors NLRI */
8327 if (length
> 0 && length
< 4) {
8328 expert_add_info_format(pinfo
, nlri_tree
, &ei_bgp_ls_error
,
8329 "Unknown data in Link-State Link NLRI, length = %d bytes.", length
);
8335 tmp_length
= decode_bgp_link_nlri_prefix_descriptors(tvb
, nlri_tree
,
8336 offset
, pinfo
, length
, IP_PROTO_IPV4
);
8342 case LINK_STATE_IPV6_TOPOLOGY_PREFIX_NLRI
:
8343 nlri_ti
= proto_tree_add_item(prefix_tree
,
8344 hf_bgp_ls_ipv6_topology_prefix_nlri_type
, tvb
, offset
, length
,
8346 nlri_tree
= proto_item_add_subtree(nlri_ti
, ett_bgp_mp_reach_nlri
);
8347 tmp_length
= decode_bgp_link_node_nlri_common_fields(tvb
, nlri_tree
,
8348 offset
, pinfo
, length
);
8352 offset
+= tmp_length
;
8353 length
-= tmp_length
;
8355 /* dissect Prefix Descriptors NLRI */
8356 if (length
> 0 && length
< 4) {
8357 expert_add_info_format(pinfo
, nlri_tree
, &ei_bgp_ls_error
,
8358 "Unknown data in Link-State Link NLRI!");
8364 tmp_length
= decode_bgp_link_nlri_prefix_descriptors(tvb
, nlri_tree
,
8365 offset
, pinfo
, length
, IP_PROTO_IPV6
);
8371 case LINK_STATE_SRV6_SID_NLRI
:
8372 nlri_ti
= proto_tree_add_item(prefix_tree
,
8373 hf_bgp_ls_nlri_srv6_sid_nlri_type
, tvb
, offset
, length
,
8375 nlri_tree
= proto_item_add_subtree(nlri_ti
, ett_bgp_mp_reach_nlri
);
8376 tmp_length
= decode_bgp_link_node_nlri_common_fields(tvb
, nlri_tree
,
8377 offset
, pinfo
, length
);
8381 offset
+= tmp_length
;
8382 length
-= tmp_length
;
8384 /* dissect SRv6 SID Descriptors NLRI */
8385 if (length
> 0 && length
< 4) {
8386 expert_add_info_format(pinfo
, nlri_tree
, &ei_bgp_ls_error
,
8387 "Unknown data in Link-State SRv6 SID NLRI!");
8393 tmp_length
= decode_bgp_link_nlri_srv6_sid_descriptors(tvb
, nlri_tree
,
8394 offset
, pinfo
, length
);
8401 proto_tree_add_expert_format(tree
, pinfo
, &ei_bgp_ls_error
, tvb
, start_offset
, 0,
8402 "Unknown Link-State NLRI type (%u)", afi
);
8408 proto_tree_add_expert_format(tree
, pinfo
, &ei_bgp_unknown_afi
, tvb
, start_offset
, 0,
8409 "Unknown AFI (%u) value", afi
);
8411 } /* switch (afi) */
8412 return total_length
;
8416 * Dissect a BGP capability.
8419 dissect_bgp_capability_item(tvbuff_t
*tvb
, proto_tree
*tree
, packet_info
*pinfo
, int offset
, bool action
)
8421 proto_tree
*cap_tree
;
8427 ti
= proto_tree_add_item(tree
, hf_bgp_cap
, tvb
, offset
, -1, ENC_NA
);
8428 cap_tree
= proto_item_add_subtree(ti
, ett_bgp_cap
);
8430 proto_tree_add_item(cap_tree
, hf_bgp_cap_type
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
8431 ctype
= tvb_get_uint8(tvb
, offset
);
8432 proto_item_append_text(ti
, ": %s", val_to_str(ctype
, capability_vals
, "Unknown capability %d"));
8435 ti_len
= proto_tree_add_item(cap_tree
, hf_bgp_cap_length
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
8436 clen
= tvb_get_uint8(tvb
, offset
);
8437 proto_item_set_len(ti
, clen
+2);
8441 proto_tree_add_item(cap_tree
, hf_bgp_cap_action
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
8442 proto_item_set_len(ti
, clen
+3);
8446 /* check the capability type */
8448 case BGP_CAPABILITY_RESERVED
:
8450 expert_add_info_format(pinfo
, ti_len
, &ei_bgp_cap_len_bad
, "Capability length %u wrong, must be = 0", clen
);
8451 proto_tree_add_item(cap_tree
, hf_bgp_cap_unknown
, tvb
, offset
, clen
, ENC_NA
);
8455 case BGP_CAPABILITY_MULTIPROTOCOL
:
8457 expert_add_info_format(pinfo
, ti_len
, &ei_bgp_cap_len_bad
, "Capability length %u is wrong, must be = 4", clen
);
8458 proto_tree_add_item(cap_tree
, hf_bgp_cap_unknown
, tvb
, offset
, clen
, ENC_NA
);
8463 proto_tree_add_item(cap_tree
, hf_bgp_cap_mp_afi
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
8467 proto_tree_add_item(cap_tree
, hf_bgp_cap_reserved
, tvb
, offset
, 1, ENC_NA
);
8471 proto_tree_add_item(cap_tree
, hf_bgp_cap_mp_safi
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
8475 case BGP_CAPABILITY_EXTENDED_NEXT_HOP
: {
8476 int eclen
= offset
+ clen
;
8477 while (offset
<= eclen
- 6) {
8479 proto_tree_add_item(cap_tree
, hf_bgp_cap_enh_afi
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
8483 proto_tree_add_item(cap_tree
, hf_bgp_cap_enh_safi
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
8487 proto_tree_add_item(cap_tree
, hf_bgp_cap_enh_nhafi
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
8490 if (offset
!= eclen
) {
8491 expert_add_info_format(pinfo
, ti_len
, &ei_bgp_cap_len_bad
, "Capability length %u is wrong, must be multiple of 6", clen
);
8492 proto_tree_add_item(cap_tree
, hf_bgp_cap_unknown
, tvb
, offset
, eclen
- offset
, ENC_NA
);
8497 case BGP_CAPABILITY_BGP_ROLE
:
8499 expert_add_info_format(pinfo
, ti_len
, &ei_bgp_cap_len_bad
, "Capability length %u is wrong, must be = 1", clen
);
8500 proto_tree_add_item(cap_tree
, hf_bgp_cap_unknown
, tvb
, offset
, clen
, ENC_NA
);
8504 proto_tree_add_item(cap_tree
, hf_bgp_cap_role
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
8508 case BGP_CAPABILITY_GRACEFUL_RESTART
:
8509 if ((clen
< 6) && (clen
!= 2)) {
8510 expert_add_info_format(pinfo
, ti_len
, &ei_bgp_cap_len_bad
, "Capability length %u too short, must be greater than 6", clen
);
8511 proto_tree_add_item(cap_tree
, hf_bgp_cap_unknown
, tvb
, offset
, clen
, ENC_NA
);
8515 int eclen
= offset
+ clen
;
8517 static int * const timer_flags
[] = {
8518 &hf_bgp_cap_gr_timers_restart_flag
,
8519 &hf_bgp_cap_gr_timers_notification_flag
,
8520 &hf_bgp_cap_gr_timers_restart_time
,
8525 expert_add_info(pinfo
, ti_len
, &ei_bgp_cap_gr_helper_mode_only
);
8529 proto_tree_add_bitmask(cap_tree
, tvb
, offset
, hf_bgp_cap_gr_timers
, ett_bgp_cap
, timer_flags
, ENC_BIG_ENDIAN
);
8533 * what follows is alist of AFI/SAFI/flag triplets
8534 * read it until the TLV ends
8536 while (offset
< eclen
) {
8537 static int * const flags
[] = {
8538 &hf_bgp_cap_gr_flag_pfs
,
8543 proto_tree_add_item(cap_tree
, hf_bgp_cap_gr_afi
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
8547 proto_tree_add_item(cap_tree
, hf_bgp_cap_gr_safi
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
8551 proto_tree_add_bitmask(cap_tree
, tvb
, offset
, hf_bgp_cap_gr_flag
, ett_bgp_cap
, flags
, ENC_BIG_ENDIAN
);
8556 case BGP_CAPABILITY_4_OCTET_AS_NUMBER
:
8558 expert_add_info_format(pinfo
, ti_len
, &ei_bgp_cap_len_bad
, "Capability length %u is wrong, must be = 4", clen
);
8559 proto_tree_add_item(cap_tree
, hf_bgp_cap_unknown
, tvb
, offset
, clen
, ENC_NA
);
8563 proto_tree_add_item(cap_tree
, hf_bgp_cap_4as
, tvb
, offset
, 4, ENC_BIG_ENDIAN
);
8567 case BGP_CAPABILITY_DYNAMIC_CAPABILITY
:
8569 int eclen
= offset
+ clen
;
8571 while (offset
< eclen
) {
8572 proto_tree_add_item(cap_tree
, hf_bgp_cap_dc
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
8577 case BGP_CAPABILITY_ADDITIONAL_PATHS
:
8578 if (clen
% 4 != 0) {
8579 expert_add_info_format(pinfo
, ti_len
, &ei_bgp_cap_len_bad
, "Capability length %u is wrong, must be multiple of 4", clen
);
8580 proto_tree_add_item(cap_tree
, hf_bgp_cap_unknown
, tvb
, offset
, clen
, ENC_NA
);
8583 else { /* AFI SAFI Send-receive*/
8584 int eclen
= offset
+ clen
;
8586 while (offset
< eclen
){
8588 proto_tree_add_item(cap_tree
, hf_bgp_cap_ap_afi
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
8592 proto_tree_add_item(cap_tree
, hf_bgp_cap_ap_safi
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
8596 proto_tree_add_item(cap_tree
, hf_bgp_cap_ap_sendreceive
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
8602 case BGP_CAPABILITY_FQDN
:{
8603 uint8_t hostname_len
, domain_name_len
;
8605 proto_tree_add_item(cap_tree
, hf_bgp_cap_fqdn_hostname_len
, tvb
, offset
, 1, ENC_NA
);
8606 hostname_len
= tvb_get_uint8(tvb
, offset
);
8609 proto_tree_add_item(cap_tree
, hf_bgp_cap_fqdn_hostname
, tvb
, offset
, hostname_len
, ENC_ASCII
);
8610 offset
+= hostname_len
;
8612 proto_tree_add_item(cap_tree
, hf_bgp_cap_fqdn_domain_name_len
, tvb
, offset
, 1, ENC_NA
);
8613 domain_name_len
= tvb_get_uint8(tvb
, offset
);
8616 proto_tree_add_item(cap_tree
, hf_bgp_cap_fqdn_domain_name
, tvb
, offset
, domain_name_len
, ENC_ASCII
);
8617 offset
+= domain_name_len
;
8622 case BGP_CAPABILITY_ENHANCED_ROUTE_REFRESH
:
8623 case BGP_CAPABILITY_ROUTE_REFRESH_CISCO
:
8624 case BGP_CAPABILITY_ROUTE_REFRESH
:
8625 case BGP_CAPABILITY_CP_ORF
:
8627 expert_add_info_format(pinfo
, ti_len
, &ei_bgp_cap_len_bad
, "Capability length %u wrong, must be = 0", clen
);
8628 proto_tree_add_item(cap_tree
, hf_bgp_cap_unknown
, tvb
, offset
, clen
, ENC_NA
);
8632 case BGP_CAPABILITY_ORF_CISCO
:
8633 case BGP_CAPABILITY_COOPERATIVE_ROUTE_FILTERING
:
8635 expert_add_info_format(pinfo
, ti_len
, &ei_bgp_cap_len_bad
, "Capability length %u too short, must be greater than 6", clen
);
8636 proto_tree_add_item(cap_tree
, hf_bgp_cap_unknown
, tvb
, offset
, clen
, ENC_NA
);
8640 uint8_t orfnum
; /* number of ORFs */
8643 proto_tree_add_item(cap_tree
, hf_bgp_cap_orf_afi
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
8647 proto_tree_add_item(cap_tree
, hf_bgp_cap_reserved
, tvb
, offset
, 1, ENC_NA
);
8651 proto_tree_add_item(cap_tree
, hf_bgp_cap_orf_safi
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
8654 /* Number of ORFs */
8655 orfnum
= tvb_get_uint8(tvb
, offset
);
8656 proto_tree_add_item(cap_tree
, hf_bgp_cap_orf_number
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
8658 for (i
=0; i
<orfnum
; i
++) {
8660 proto_tree_add_item(cap_tree
, hf_bgp_cap_orf_type
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
8664 proto_tree_add_item(cap_tree
, hf_bgp_cap_orf_sendreceive
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
8670 case BGP_CAPABILITY_MULTISESSION_CISCO
:
8672 expert_add_info_format(pinfo
, ti_len
, &ei_bgp_cap_len_bad
, "Capability length %u too short, must be greater than 1", clen
);
8673 proto_tree_add_item(cap_tree
, hf_bgp_cap_unknown
, tvb
, offset
, clen
, ENC_NA
);
8677 proto_tree_add_item(cap_tree
, hf_bgp_cap_multisession_flags
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
8682 case BGP_CAPABILITY_BGPSEC
:
8684 expert_add_info_format(pinfo
, ti_len
, &ei_bgp_cap_len_bad
, "Capability length %u is wrong, must be = 3", clen
);
8685 proto_tree_add_item(cap_tree
, hf_bgp_cap_unknown
, tvb
, offset
, clen
, ENC_NA
);
8689 static int * const bgpsec_flags
[] = {
8690 &hf_bgp_cap_bgpsec_version
,
8691 &hf_bgp_cap_bgpsec_sendreceive
,
8692 &hf_bgp_cap_bgpsec_reserved
,
8697 proto_tree_add_bitmask(cap_tree
, tvb
, offset
, hf_bgp_cap_bgpsec_flags
, ett_bgp_cap
, bgpsec_flags
, ENC_BIG_ENDIAN
);
8701 proto_tree_add_item(cap_tree
, hf_bgp_cap_bgpsec_afi
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
8707 case BGP_CAPABILITY_BFD_STRICT
:
8709 expert_add_info_format(pinfo
, ti_len
, &ei_bgp_cap_len_bad
, "Capability length %u wrong, must be = 0", clen
);
8710 proto_tree_add_item(cap_tree
, hf_bgp_cap_unknown
, tvb
, offset
, clen
, ENC_NA
);
8714 case BGP_CAPABILITY_SOFT_VERSION
:{
8715 uint8_t soft_version_len
;
8717 proto_tree_add_item(cap_tree
, hf_bgp_cap_soft_version_len
, tvb
, offset
, 1, ENC_NA
);
8718 soft_version_len
= tvb_get_uint8(tvb
, offset
);
8721 proto_tree_add_item(cap_tree
, hf_bgp_cap_soft_version
, tvb
, offset
, soft_version_len
, ENC_ASCII
);
8722 offset
+= soft_version_len
;
8725 /* unknown capability */
8728 proto_tree_add_item(cap_tree
, hf_bgp_cap_unknown
, tvb
, offset
, clen
, ENC_NA
);
8732 } /* switch (ctype) */
8737 * Dissect a BGP OPEN message.
8741 dissect_bgp_open(tvbuff_t
*tvb
, proto_tree
*tree
, packet_info
*pinfo
)
8743 uint16_t optlen
; /* Option Length */
8744 int ptype
; /* parameter type */
8745 int plen
; /* parameter length */
8746 int cend
; /* capabilities end */
8747 int oend
; /* options end */
8748 int offset
; /* tvb offset counter */
8749 uint32_t as_num
; /* AS Number */
8750 proto_item
*ti
; /* tree item */
8751 proto_tree
*opt_tree
; /* subtree for options */
8752 proto_tree
*par_tree
; /* subtree for par options */
8753 proto_tree
*opt_extension_tree
; /* subtree for par options */
8755 offset
= BGP_MARKER_SIZE
+ 2 + 1;
8757 proto_tree_add_item(tree
, hf_bgp_open_version
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
8760 ti
= proto_tree_add_item_ret_uint(tree
, hf_bgp_open_myas
, tvb
, offset
, 2, ENC_BIG_ENDIAN
, &as_num
);
8761 if (as_num
== BGP_AS_TRANS
) {
8762 proto_item_append_text(ti
, " (AS_TRANS)");
8766 proto_tree_add_item(tree
, hf_bgp_open_holdtime
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
8769 proto_tree_add_item(tree
, hf_bgp_open_identifier
, tvb
, offset
, 4, ENC_NA
);
8772 proto_tree_add_item(tree
, hf_bgp_open_opt_len
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
8773 optlen
= tvb_get_uint8(tvb
, offset
);
8776 /* optional parameters */
8778 ptype
= tvb_get_uint8(tvb
, offset
);
8779 if (ptype
== BGP_OPTION_EXTENDED_LEN
) { /* Extended Length covered by RFC9072 */
8780 optlen
= tvb_get_uint16(tvb
, offset
+1, ENC_BIG_ENDIAN
);
8782 ti
= proto_tree_add_item(tree
, hf_bgp_open_opt_extension
, tvb
, offset
, 3, ENC_NA
);
8783 opt_extension_tree
= proto_item_add_subtree(ti
, ett_bgp_options_ext
);
8784 proto_tree_add_item(opt_extension_tree
, hf_bgp_open_opt_extension_mark
, tvb
, offset
, 1, ENC_NA
);
8785 proto_tree_add_item(opt_extension_tree
, hf_bgp_open_opt_extension_len
, tvb
, offset
+1, 2, ENC_BIG_ENDIAN
);
8787 oend
= offset
+ 3 + optlen
;
8790 oend
= offset
+ optlen
;
8794 ti
= proto_tree_add_item(tree
, hf_bgp_open_opt_params
, tvb
, offset
, optlen
, ENC_NA
);
8795 opt_tree
= proto_item_add_subtree(ti
, ett_bgp_options
);
8797 /* step through all of the optional parameters */
8798 while (offset
< oend
) {
8801 ti
= proto_tree_add_item(opt_tree
, hf_bgp_open_opt_param
, tvb
, offset
, -1, ENC_NA
);
8802 par_tree
= proto_item_add_subtree(ti
, ett_bgp_options
);
8804 /* display and grab the type ... */
8805 proto_tree_add_item(par_tree
, hf_bgp_open_opt_param_type
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
8806 ptype
= tvb_get_uint8(tvb
, offset
);
8807 proto_item_append_text(ti
, ": %s", val_to_str(ptype
, bgp_open_opt_vals
, "Unknown Parameter %d"));
8810 /* ... and length */
8811 proto_tree_add_item(par_tree
, hf_bgp_open_opt_param_len
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
8812 plen
= tvb_get_uint8(tvb
, offset
);
8813 proto_item_set_len(ti
, plen
+2);
8816 /* check the type */
8818 case BGP_OPTION_AUTHENTICATION
:
8819 proto_tree_add_item(par_tree
, hf_bgp_open_opt_param_auth
, tvb
, offset
, plen
, ENC_NA
);
8822 case BGP_OPTION_CAPABILITY
:
8823 /* grab the capability code */
8824 cend
= offset
+ plen
;
8826 /* step through all of the capabilities */
8827 while (offset
< cend
) {
8828 offset
= dissect_bgp_capability_item(tvb
, par_tree
, pinfo
, offset
, false);
8832 proto_tree_add_item(opt_tree
, hf_bgp_open_opt_param_unknown
, tvb
, offset
, plen
, ENC_NA
);
8834 } /* switch (ptype) */
8840 * Heuristic for auto-detection of ASN length 2 or 4 bytes
8844 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
)
8846 int counter_as_segment
=0;
8848 uint8_t assumed_as_len
=0;
8853 uint8_t next_type
=0;
8855 /* Heuristic is done in two phases
8856 * First we try to identify the as length (2 or 4 bytes)
8857 * then we do check that our assumption is ok
8858 * recalculating the offset and checking we end up with the right result
8859 * k is used to navigate into the AS_PATH */
8861 /* case of AS_PATH type being explicitly 4 bytes ASN */
8862 if (bgpa_type
== BGPTYPE_AS4_PATH
) {
8863 /* We calculate numbers of segments and return the as length */
8865 while (k
< end_attr_offset
)
8867 /* we skip segment type and point to length */
8869 length
= tvb_get_uint8(tvb
, k
);
8870 /* length read let's move to first ASN */
8872 /* we move to the next segment */
8873 k
= k
+ (length
*assumed_as_len
);
8874 counter_as_segment
++;
8876 *number_as_segment
= counter_as_segment
;
8879 /* case of user specified ASN length */
8880 if (bgp_asn_len
!= 0) {
8881 /* We calculate numbers of segments and return the as length */
8882 assumed_as_len
= bgp_asn_len
;
8883 while (k
< end_attr_offset
)
8885 /* we skip segment type and point to length */
8887 length
= tvb_get_uint8(tvb
, k
);
8888 /* length read let's move to first ASN */
8890 /* we move to the next segment */
8891 k
= k
+ (length
*assumed_as_len
);
8892 /* if I am not facing the last segment k need to point to next length */
8893 counter_as_segment
++;
8895 *number_as_segment
= counter_as_segment
;
8898 /* case of a empty path attribute */
8899 if (as_path_offset
== end_attr_offset
)
8901 *number_as_segment
= 0;
8904 /* case of we run the heuristic to find the as length */
8906 /* we do run the heuristic on first segment and look at next segment if it exists */
8908 length
= tvb_get_uint8(tvb
, k
++);
8909 /* let's do some checking with an as length 2 bytes */
8910 offset_check
= k
+ 2*length
;
8911 next_type
= tvb_get_uint8(tvb
, offset_check
);
8912 /* we do have one segment made of 2 bytes ASN we do reach the end of the attribute taking
8913 * 2 bytes ASN for our calculation */
8914 if (offset_check
== end_attr_offset
)
8916 /* else we do check if we see a valid AS segment type after (length * AS 2 bytes) */
8917 else if (next_type
== AS_SET
||
8918 next_type
== AS_SEQUENCE
||
8919 next_type
== AS_CONFED_SEQUENCE
||
8920 next_type
== AS_CONFED_SET
) {
8921 /* 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 */
8922 for (j
=0; j
< length
&& !asn_is_null
; j
++) {
8923 if(tvb_get_ntohs(tvb
, k
+(2*j
)) == 0) {
8927 if (asn_is_null
== 0)
8933 /* we didn't find a valid AS segment type in the next coming segment assuming 2 bytes ASN */
8935 /* now that we have our assumed as length let's check we can calculate the attribute length properly */
8937 while (k
< end_attr_offset
)
8939 /* we skip the AS type */
8941 /* we get the length of the AS segment */
8942 length
= tvb_get_uint8(tvb
, k
);
8943 /* let's point to the fist byte of the AS segment */
8945 /* we move to the next segment */
8946 k
= k
+ (length
*assumed_as_len
);
8947 counter_as_segment
++;
8949 if (k
== end_attr_offset
) {
8951 *number_as_segment
= counter_as_segment
;
8952 return assumed_as_len
;
8954 /* we are in trouble */
8959 * Dissect BGP update extended communities
8963 dissect_bgp_update_ext_com(proto_tree
*parent_tree
, tvbuff_t
*tvb
, uint16_t tlen
, unsigned tvb_off
, packet_info
*pinfo
)
8967 uint8_t com_type_high_byte
;
8968 uint8_t com_stype_low_byte
;
8969 proto_tree
*communities_tree
;
8970 proto_tree
*community_tree
;
8971 proto_tree
*community_type_tree
;
8972 proto_item
*communities_item
=NULL
;
8973 proto_item
*community_item
=NULL
;
8974 proto_item
*community_type_item
=NULL
;
8975 uint32_t encaps_tunnel_type
;
8976 afi_safi_data
*data
= NULL
;
8979 end
= tvb_off
+ tlen
;
8980 communities_item
= proto_tree_add_item(parent_tree
, hf_bgp_ext_communities
, tvb
, offset
, tlen
, ENC_NA
);
8981 communities_tree
= proto_item_add_subtree(communities_item
, ett_bgp_extended_communities
);
8982 proto_item_append_text(communities_item
, ": (%u communit%s)", tlen
/8, plurality(tlen
/8, "y", "ies"));
8983 while (offset
< end
) {
8984 com_type_high_byte
= tvb_get_uint8(tvb
,offset
); /* high community type octet */
8985 com_stype_low_byte
= tvb_get_uint8(tvb
,offset
+1); /* sub type low community type octet */
8986 community_item
= proto_tree_add_item(communities_tree
, hf_bgp_ext_community
, tvb
, offset
, 8, ENC_NA
);
8987 community_tree
= proto_item_add_subtree(community_item
,ett_bgp_extended_community
);
8989 /* Add the Type octet as a decoded item to the community_tree right away,
8990 * and also dissect its two top bits in a subtree.
8993 community_type_item
= proto_tree_add_item(community_tree
, hf_bgp_ext_com_type_high
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
8994 community_type_tree
= proto_item_add_subtree(community_type_item
, ett_bgp_ext_com_type
);
8995 proto_tree_add_item(community_type_tree
, hf_bgp_ext_com_type_auth
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
8996 proto_tree_add_item(community_type_tree
, hf_bgp_ext_com_type_tran
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
8998 /* In the switch(), handlers of individual types and subtypes should
8999 * add and dissect the remaining 7 octets. Dissectors should use the
9000 * proto_item_set_text() on the community_item to set the community
9001 * name in the displayed label as specifically as possible, and
9002 * proto_item_append_text() to add reasonable details.
9004 * The intended text label of the community_item for each extended
9005 * community attribute is:
9007 * Community Name: Values [General Community Type Name]
9010 * Route Target: 1:1 [Transitive 2-Octet AS-Specific]
9011 * Unknown subtype 0x01: 0x8081 0x0000 0x2800 [Non-Transitive Opaque]
9012 * Unknown type 0x88 subtype 0x00: 0x0000 0x0000 0x0000 [Unknown community]
9014 * The [] part with general community name is added at the end
9017 * The first option (Route Target) shows a fully recognized and
9018 * dissected extended community. Note that the line immediately calls
9019 * the community by its most specific known type (Route Target), while
9020 * the general type is shown in the brackets. The second option shows a
9021 * community whose Type is recognized (Non-Transitive Opaque) but whose
9022 * Subtype is not known. The third option shows an unrecognized
9023 * extended community.
9025 * Printing out the community raw value as 3 short ints is intentional:
9026 * With an unknown community, we cannot assume any particular internal
9027 * value format, and dumping the value in short ints provides for easy
9031 switch (com_type_high_byte
) {
9032 case BGP_EXT_COM_TYPE_HIGH_TR_AS2
: /* Transitive Two-Octet AS-Specific Extended Community */
9034 proto_tree_add_item(community_tree
, hf_bgp_ext_com_stype_tr_as2
, tvb
, offset
+1, 1, ENC_BIG_ENDIAN
);
9035 proto_tree_add_item(community_tree
, hf_bgp_ext_com_value_as2
, tvb
, offset
+2, 2, ENC_BIG_ENDIAN
);
9036 data
= load_afi_safi_data(pinfo
);
9038 if(data
&& data
->afi
== AFNUM_L2VPN
&& data
->safi
== SAFNUM_EVPN
) {
9039 static int * const local_admin_flags
[] = {
9040 &hf_bgp_ext_com_local_admin_auto_derived_flag
,
9041 &hf_bgp_ext_com_local_admin_type
,
9042 &hf_bgp_ext_com_local_admin_domain_id
,
9045 proto_tree_add_bitmask(community_tree
, tvb
, offset
+4, hf_bgp_ext_com_local_admin_flags
,
9046 ett_bgp_vxlan
, local_admin_flags
, ENC_BIG_ENDIAN
);
9047 proto_tree_add_item(community_tree
, hf_bgp_ext_com_local_admin_service_id
, tvb
, offset
+5, 3, ENC_BIG_ENDIAN
);
9049 proto_tree_add_item(community_tree
, hf_bgp_ext_com_value_an4
, tvb
, offset
+4, 4, ENC_BIG_ENDIAN
);
9052 proto_item_set_text(community_item
, "%s: %u:%u",
9053 val_to_str(com_stype_low_byte
, bgpext_com_stype_tr_as2
, "Unknown subtype 0x%02x"),
9054 tvb_get_ntohs(tvb
,offset
+2), tvb_get_ntohl(tvb
, offset
+4));
9057 case BGP_EXT_COM_TYPE_HIGH_NTR_AS2
: /* Non-Transitive Two-Octet AS-Specific Extended Community */
9058 proto_tree_add_item(community_tree
, hf_bgp_ext_com_stype_ntr_as2
, tvb
, offset
+1, 1, ENC_BIG_ENDIAN
);
9059 proto_tree_add_item(community_tree
, hf_bgp_ext_com_value_as2
, tvb
, offset
+2, 2, ENC_BIG_ENDIAN
);
9061 proto_item_set_text(community_item
, "%s:",
9062 val_to_str(com_stype_low_byte
, bgpext_com_stype_ntr_as2
, "Unknown subtype 0x%02x"));
9064 switch (com_stype_low_byte
) {
9065 case BGP_EXT_COM_STYPE_AS2_LBW
:
9066 proto_tree_add_item(community_tree
, hf_bgp_ext_com_value_link_bw
, tvb
, offset
+4, 4, ENC_BIG_ENDIAN
);
9068 proto_item_append_text(community_item
, " ASN %u, %.3f Mbps",
9069 tvb_get_ntohs(tvb
,offset
+2),
9070 tvb_get_ntohieee_float(tvb
,offset
+4)*8/1000000);
9074 proto_tree_add_item(community_tree
, hf_bgp_ext_com_value_an4
, tvb
, offset
+4, 4, ENC_BIG_ENDIAN
);
9076 proto_item_append_text(community_item
, " %u:%u",
9077 tvb_get_ntohs(tvb
,offset
+2), tvb_get_ntohl(tvb
,offset
+4));
9082 case BGP_EXT_COM_TYPE_HIGH_TR_IP4
: /* Transitive IPv4-Address-specific Extended Community */
9083 proto_tree_add_item(community_tree
, hf_bgp_ext_com_stype_tr_IP4
, tvb
, offset
+1, 1, ENC_BIG_ENDIAN
);
9085 proto_item_set_text(community_item
, "%s: %s:%u",
9086 val_to_str(com_stype_low_byte
, bgpext_com_stype_tr_IP4
, "Unknown subtype 0x%02x"),
9087 tvb_ip_to_str(pinfo
->pool
, tvb
, offset
+2), tvb_get_ntohs(tvb
,offset
+6));
9089 switch(com_stype_low_byte
) {
9090 case BGP_EXT_COM_STYPE_IP4_OSPF_RID
:
9091 proto_tree_add_item(community_tree
, hf_bgp_ext_com_value_ospf_rid
, tvb
, offset
+2, 4, ENC_BIG_ENDIAN
);
9095 proto_tree_add_item(community_tree
, hf_bgp_ext_com_value_IP4
, tvb
, offset
+2, 4, ENC_BIG_ENDIAN
);
9096 proto_tree_add_item(community_tree
, hf_bgp_ext_com_value_an2
, tvb
, offset
+6, 2, ENC_BIG_ENDIAN
);
9101 case BGP_EXT_COM_TYPE_HIGH_NTR_IP4
: /* Non-Transitive IPv4-Address-specific Extended Community */
9102 proto_tree_add_item(community_tree
, hf_bgp_ext_com_stype_ntr_IP4
, tvb
, offset
+1, 1, ENC_BIG_ENDIAN
);
9103 proto_tree_add_item(community_tree
, hf_bgp_ext_com_value_IP4
, tvb
, offset
+2, 4, ENC_BIG_ENDIAN
);
9104 proto_tree_add_item(community_tree
, hf_bgp_ext_com_value_an2
, tvb
, offset
+6, 2, ENC_BIG_ENDIAN
);
9106 proto_item_set_text(community_item
, "%s: %s:%u",
9107 val_to_str(com_stype_low_byte
, bgpext_com_stype_ntr_IP4
, "Unknown subtype 0x%02x"),
9108 tvb_ip_to_str(pinfo
->pool
, tvb
, offset
+2), tvb_get_ntohs(tvb
,offset
+6));
9111 case BGP_EXT_COM_TYPE_HIGH_TR_AS4
: /* Transitive Four-Octet AS-Specific Extended Community */
9112 proto_tree_add_item(community_tree
, hf_bgp_ext_com_stype_tr_as4
, tvb
, offset
+1, 1, ENC_BIG_ENDIAN
);
9113 proto_tree_add_item(community_tree
, hf_bgp_ext_com_value_as4
, tvb
, offset
+2, 4, ENC_BIG_ENDIAN
);
9114 proto_tree_add_item(community_tree
, hf_bgp_ext_com_value_an2
, tvb
, offset
+6, 2, ENC_BIG_ENDIAN
);
9116 proto_item_set_text(community_item
, "%s: %u.%u(%u):%u",
9117 val_to_str(com_stype_low_byte
, bgpext_com_stype_tr_as4
, "Unknown subtype 0x%02x"),
9118 tvb_get_ntohs(tvb
,offset
+2), tvb_get_ntohs(tvb
,offset
+4), tvb_get_ntohl(tvb
,offset
+2),
9119 tvb_get_ntohs(tvb
,offset
+6));
9122 case BGP_EXT_COM_TYPE_HIGH_NTR_AS4
: /* Non-Transitive Four-Octet AS-Specific Extended Community */
9123 proto_tree_add_item(community_tree
, hf_bgp_ext_com_stype_ntr_as4
, tvb
, offset
+1, 1, ENC_BIG_ENDIAN
);
9124 proto_tree_add_item(community_tree
, hf_bgp_ext_com_value_as4
, tvb
, offset
+2, 4, ENC_BIG_ENDIAN
);
9125 proto_tree_add_item(community_tree
, hf_bgp_ext_com_value_an2
, tvb
, offset
+6, 2, ENC_BIG_ENDIAN
);
9127 proto_item_set_text(community_item
, "%s: %u.%u(%u):%u",
9128 val_to_str(com_stype_low_byte
, bgpext_com_stype_ntr_as4
, "Unknown subtype 0x%02x"),
9129 tvb_get_ntohs(tvb
,offset
+2), tvb_get_ntohs(tvb
,offset
+4), tvb_get_ntohl(tvb
,offset
+2),
9130 tvb_get_ntohs(tvb
,offset
+6));
9133 case BGP_EXT_COM_TYPE_HIGH_TR_OPAQUE
: /* Transitive Opaque Extended Community */
9134 proto_tree_add_item(community_tree
, hf_bgp_ext_com_stype_tr_opaque
, tvb
, offset
+1, 1, ENC_BIG_ENDIAN
);
9136 proto_item_set_text(community_item
, "%s:",
9137 val_to_str(com_stype_low_byte
, bgpext_com_stype_tr_opaque
, "Unknown subtype 0x%02x"));
9139 switch(com_stype_low_byte
) {
9140 case BGP_EXT_COM_STYPE_OPA_COST
:
9142 proto_item
*cost_com_item
;
9143 proto_tree
*cost_com_cid_tree
;
9145 proto_tree_add_item(community_tree
, hf_bgp_ext_com_cost_poi
, tvb
, offset
+2, 1, ENC_BIG_ENDIAN
);
9146 cost_com_item
= proto_tree_add_item(community_tree
, hf_bgp_ext_com_cost_cid
, tvb
, offset
+3, 1, ENC_BIG_ENDIAN
);
9147 cost_com_cid_tree
= proto_item_add_subtree(cost_com_item
, ett_bgp_ext_com_cost_cid
);
9148 proto_tree_add_item(cost_com_cid_tree
, hf_bgp_ext_com_cost_cid_rep
, tvb
, offset
+3, 1, ENC_BIG_ENDIAN
);
9149 cost_com_item
= proto_tree_add_item(community_tree
, hf_bgp_ext_com_cost_cost
, tvb
,
9150 offset
+4, 4, ENC_BIG_ENDIAN
);
9151 proto_item_append_text(cost_com_item
, " (%s)",
9152 tfs_get_string(tvb_get_uint8(tvb
, offset
+3) & BGP_EXT_COM_COST_CID_REP
, &tfs_cost_replace
));
9154 proto_item_append_text(community_item
, " %u, POI: %s (%s)",
9155 tvb_get_ntohl(tvb
, offset
+4),
9156 val_to_str(tvb_get_uint8(tvb
, offset
+2), bgpext_com_cost_poi_type
, "Unknown subtype 0x%02x"),
9157 (tvb_get_uint8(tvb
, offset
+3) & BGP_EXT_COM_COST_CID_REP
) ? "Replaces attribute value" : "Evaluated after");
9161 case BGP_EXT_COM_STYPE_OPA_OSPF_RT
:
9163 proto_item
*ospf_rt_opt_item
;
9164 proto_tree
*ospf_rt_opt_tree
;
9166 proto_tree_add_item(community_tree
, hf_bgp_ext_com_value_ospf_rt_area
, tvb
, offset
+2, 4, ENC_BIG_ENDIAN
);
9167 proto_tree_add_item(community_tree
, hf_bgp_ext_com_value_ospf_rt_type
, tvb
, offset
+6, 1, ENC_BIG_ENDIAN
);
9168 ospf_rt_opt_item
= proto_tree_add_item(community_tree
,
9169 hf_bgp_ext_com_value_ospf_rt_options
, tvb
, offset
+7, 1, ENC_BIG_ENDIAN
);
9170 ospf_rt_opt_tree
= proto_item_add_subtree(ospf_rt_opt_item
, ett_bgp_ext_com_ospf_rt_opt
);
9171 proto_tree_add_item(ospf_rt_opt_tree
, hf_bgp_ext_com_value_ospf_rt_options_mt
,
9172 tvb
, offset
+7, 1, ENC_BIG_ENDIAN
);
9173 proto_item_append_text(ospf_rt_opt_item
, " (Metric: %s)",
9174 tfs_get_string(tvb_get_uint8(tvb
,offset
+7) & BGP_OSPF_RTYPE_METRIC_TYPE
, &tfs_ospf_rt_mt
));
9176 proto_item_append_text(community_item
, " Area: %s, Type: %s",
9177 tvb_ip_to_str(pinfo
->pool
, tvb
,offset
+2),
9178 val_to_str_const(tvb_get_uint8(tvb
,offset
+6), bgpext_com_ospf_rtype
, "Unknown"));
9182 case BGP_EXT_COM_STYPE_OPA_ENCAP
:
9183 /* Community octets 2 through 5 are reserved and carry no useful value according to RFC 5512. */
9184 proto_tree_add_item_ret_uint(community_tree
, hf_bgp_ext_com_tunnel_type
, tvb
, offset
+6, 2, ENC_BIG_ENDIAN
, &encaps_tunnel_type
);
9185 save_path_attr_encaps_tunnel_type(pinfo
, encaps_tunnel_type
);
9187 proto_item_append_text(community_item
, " %s",
9188 val_to_str_const(tvb_get_ntohs(tvb
,offset
+6), bgpext_com_tunnel_type
, "Unknown"));
9191 case BGP_EXT_COM_STYPE_OPA_COLOR
:
9192 case BGP_EXT_COM_STYPE_OPA_DGTW
:
9194 /* The particular Opaque subtype is unknown or the
9195 * dissector is not written yet. We will dump the
9196 * entire community value in 2-byte short words.
9198 proto_tree_add_uint64_format_value(community_tree
, hf_bgp_ext_com_value_raw
, tvb
, offset
+2, 6,
9199 tvb_get_ntoh48 (tvb
, offset
+2), "0x%04x 0x%04x 0x%04x",
9200 tvb_get_ntohs(tvb
,offset
+2),
9201 tvb_get_ntohs(tvb
,offset
+4),
9202 tvb_get_ntohs(tvb
,offset
+6));
9204 proto_item_append_text(community_item
, " 0x%04x 0x%04x 0x%04x",
9205 tvb_get_ntohs(tvb
,offset
+2), tvb_get_ntohs(tvb
,offset
+4), tvb_get_ntohs(tvb
,offset
+6));
9210 case BGP_EXT_COM_TYPE_HIGH_NTR_OPAQUE
: /* Non-Transitive Opaque Extended Community */
9211 proto_tree_add_item(community_tree
, hf_bgp_ext_com_stype_ntr_opaque
, tvb
, offset
+1, 1, ENC_BIG_ENDIAN
);
9213 proto_item_set_text(community_item
, "%s:",
9214 val_to_str(com_stype_low_byte
, bgpext_com_stype_ntr_opaque
, "Unknown subtype 0x%02x"));
9216 switch(com_stype_low_byte
) {
9217 case BGP_EXT_COM_STYPE_OPA_COST
:
9219 proto_item
*cost_com_item
;
9220 proto_tree
*cost_com_cid_tree
;
9222 proto_tree_add_item(community_tree
, hf_bgp_ext_com_cost_poi
, tvb
, offset
+2, 1, ENC_BIG_ENDIAN
);
9223 cost_com_item
= proto_tree_add_item(community_tree
, hf_bgp_ext_com_cost_cid
, tvb
, offset
+3, 1, ENC_BIG_ENDIAN
);
9224 cost_com_cid_tree
= proto_item_add_subtree(cost_com_item
, ett_bgp_ext_com_cost_cid
);
9225 proto_tree_add_item(cost_com_cid_tree
, hf_bgp_ext_com_cost_cid_rep
, tvb
, offset
+3, 1, ENC_BIG_ENDIAN
);
9226 cost_com_item
= proto_tree_add_item(community_tree
, hf_bgp_ext_com_cost_cost
, tvb
,
9227 offset
+4, 4, ENC_BIG_ENDIAN
);
9228 proto_item_append_text(cost_com_item
, " (%s)",
9229 tfs_get_string(tvb_get_uint8(tvb
, offset
+3) & BGP_EXT_COM_COST_CID_REP
, &tfs_cost_replace
));
9231 proto_item_append_text(community_item
, " %u, POI: %s (%s)",
9232 tvb_get_ntohl(tvb
, offset
+4),
9233 val_to_str(tvb_get_uint8(tvb
, offset
+2), bgpext_com_cost_poi_type
, "Unknown subtype 0x%02x"),
9234 (tvb_get_uint8(tvb
, offset
+3) & BGP_EXT_COM_COST_CID_REP
) ? "Replaces attribute value" : "Evaluated after");
9239 /* The particular Opaque subtype is unknown or the
9240 * dissector is not written yet. We will dump the
9241 * entire community value in 2-byte short words.
9243 proto_tree_add_uint64_format_value(community_tree
, hf_bgp_ext_com_value_raw
, tvb
, offset
+2, 6,
9244 tvb_get_ntoh48 (tvb
, offset
+2), "0x%04x 0x%04x 0x%04x",
9245 tvb_get_ntohs(tvb
,offset
+2),
9246 tvb_get_ntohs(tvb
,offset
+4),
9247 tvb_get_ntohs(tvb
,offset
+6));
9249 proto_item_append_text(community_item
, " 0x%04x 0x%04x 0x%04x",
9250 tvb_get_ntohs(tvb
,offset
+2), tvb_get_ntohs(tvb
,offset
+4), tvb_get_ntohs(tvb
,offset
+6));
9255 case BGP_EXT_COM_TYPE_HIGH_TR_QOS
: /* QoS Marking [Thomas_Martin_Knoll] */
9256 case BGP_EXT_COM_TYPE_HIGH_NTR_QOS
: /* QoS Marking [Thomas_Martin_Knoll] */
9258 static int * const qos_flags
[] = {
9259 &hf_bgp_ext_com_qos_flags_remarking
,
9260 &hf_bgp_ext_com_qos_flags_ignore_remarking
,
9261 &hf_bgp_ext_com_qos_flags_agg_marking
,
9265 proto_item_set_text(community_item
, "QoS Marking");
9267 proto_tree_add_bitmask(community_tree
, tvb
, offset
, hf_bgp_ext_com_qos_flags
,
9268 ett_bgp_ext_com_flags
, qos_flags
, ENC_BIG_ENDIAN
);
9270 proto_tree_add_item(community_tree
, hf_bgp_ext_com_qos_set_number
, tvb
, offset
+2, 1, ENC_BIG_ENDIAN
);
9271 proto_tree_add_item(community_tree
, hf_bgp_ext_com_qos_tech_type
, tvb
, offset
+3, 1, ENC_BIG_ENDIAN
);
9272 proto_tree_add_item(community_tree
, hf_bgp_ext_com_qos_marking_o
, tvb
, offset
+4, 2, ENC_BIG_ENDIAN
);
9273 proto_tree_add_item(community_tree
, hf_bgp_ext_com_qos_marking_a
, tvb
, offset
+6, 1, ENC_BIG_ENDIAN
);
9274 proto_tree_add_item(community_tree
, hf_bgp_ext_com_qos_default_to_zero
, tvb
, offset
+7, 1, ENC_BIG_ENDIAN
);
9278 case BGP_EXT_COM_TYPE_HIGH_TR_COS
: /* CoS Capability [Thomas_Martin_Knoll] */
9282 proto_item_set_text(community_item
, "CoS Capability");
9284 for (i
=1; i
< 8; i
++) {
9285 static int * const cos_flags
[] = {
9286 &hf_bgp_ext_com_cos_flags_be
,
9287 &hf_bgp_ext_com_cos_flags_ef
,
9288 &hf_bgp_ext_com_cos_flags_af
,
9289 &hf_bgp_ext_com_cos_flags_le
,
9293 proto_tree_add_bitmask(community_tree
, tvb
, offset
+i
, hf_bgp_ext_com_cos_flags
,
9294 ett_bgp_ext_com_flags
, cos_flags
, ENC_BIG_ENDIAN
);
9299 case BGP_EXT_COM_TYPE_HIGH_TR_EVPN
: /* EVPN (Sub-Types are defined in the "EVPN Extended Community Sub-Types" registry) */
9300 proto_tree_add_item(community_tree
, hf_bgp_ext_com_stype_tr_evpn
, tvb
, offset
+1, 1, ENC_BIG_ENDIAN
);
9302 proto_item_set_text(community_item
, "%s:",
9303 val_to_str(com_stype_low_byte
, bgpext_com_stype_tr_evpn
, "Unknown subtype 0x%02x"));
9305 switch (com_stype_low_byte
) {
9306 case BGP_EXT_COM_STYPE_EVPN_MMAC
:
9308 proto_tree
*evpn_mmac_flag_tree
;
9309 proto_item
*evpn_mmac_flag_item
;
9311 evpn_mmac_flag_item
= proto_tree_add_item(community_tree
, hf_bgp_ext_com_evpn_mmac_flag
, tvb
, offset
+2, 1, ENC_BIG_ENDIAN
);
9312 evpn_mmac_flag_tree
= proto_item_add_subtree(evpn_mmac_flag_item
, ett_bgp_ext_com_evpn_mmac_flags
);
9313 proto_tree_add_item (evpn_mmac_flag_tree
, hf_bgp_ext_com_evpn_mmac_flag_sticky
, tvb
, offset
+2, 1, ENC_BIG_ENDIAN
);
9314 /* Octet at offset 3 is reserved per RFC 7432 Section 7.7 */
9315 proto_tree_add_item(community_tree
, hf_bgp_ext_com_evpn_mmac_seq
, tvb
, offset
+4, 4, ENC_BIG_ENDIAN
);
9317 proto_item_append_text(community_item
, " %s MAC",
9318 (tvb_get_uint8(tvb
,offset
+2) & BGP_EXT_COM_EVPN_MMAC_STICKY
) ? "Sticky" : "Movable");
9322 case BGP_EXT_COM_STYPE_EVPN_LABEL
:
9326 proto_tree_add_item(community_tree
, hf_bgp_ext_com_l2_esi_label_flag
, tvb
, offset
+2, 1, ENC_BIG_ENDIAN
);
9327 /* Octets at offsets 3 and 4 are reserved perf RFC 7432 Section 7.5 */
9328 proto_tree_add_item(community_tree
, hf_bgp_update_mpls_label_value
, tvb
, offset
+5, 3, ENC_BIG_ENDIAN
);
9329 ti
= proto_tree_add_item(community_tree
, hf_bgp_update_mpls_label_value_20bits
, tvb
, offset
+5, 3, ENC_BIG_ENDIAN
);
9330 proto_item_set_generated(ti
);
9331 ti
= proto_tree_add_item(community_tree
, hf_bgp_update_mpls_traffic_class
, tvb
, offset
+5, 3, ENC_BIG_ENDIAN
);
9332 proto_item_set_generated(ti
);
9333 ti
= proto_tree_add_item(community_tree
, hf_bgp_update_mpls_bottom_stack
, tvb
, offset
+5, 3, ENC_BIG_ENDIAN
);
9334 proto_item_set_generated(ti
);
9336 proto_item_append_text(community_item
, " %s, Label: %u",
9337 tfs_get_string(tvb_get_uint8(tvb
, offset
+2) & BGP_EXT_COM_ESI_LABEL_FLAGS
, &tfs_esi_label_flag
),
9338 tvb_get_ntoh24(tvb
,offset
+5) >> 4);
9342 case BGP_EXT_COM_STYPE_EVPN_IMP
:
9343 proto_tree_add_item(community_tree
, hf_bgp_ext_com_evpn_esirt
, tvb
, offset
+2, 6, ENC_NA
);
9345 proto_item_append_text(community_item
, " RT: %s", tvb_ether_to_str(pinfo
->pool
, tvb
, offset
+2));
9348 case BGP_EXT_COM_STYPE_EVPN_ROUTERMAC
:
9349 proto_tree_add_item(community_tree
, hf_bgp_ext_com_evpn_routermac
, tvb
, offset
+2, 6, ENC_NA
);
9351 proto_item_append_text(community_item
, " Router's MAC: %s", tvb_ether_to_str(pinfo
->pool
, tvb
, offset
+2));
9354 case BGP_EXT_COM_STYPE_EVPN_L2ATTR
:
9356 static int * const l2attr_flags
[] = {
9357 &hf_bgp_ext_com_evpn_l2attr_flag_reserved
,
9358 &hf_bgp_ext_com_evpn_l2attr_flag_ci
,
9359 &hf_bgp_ext_com_evpn_l2attr_flag_f
,
9360 &hf_bgp_ext_com_evpn_l2attr_flag_c
,
9361 &hf_bgp_ext_com_evpn_l2attr_flag_p
,
9362 &hf_bgp_ext_com_evpn_l2attr_flag_b
,
9366 proto_tree_add_bitmask(community_tree
, tvb
, offset
+2, hf_bgp_ext_com_evpn_l2attr_flags
,
9367 ett_bgp_ext_com_evpn_l2attr_flags
, l2attr_flags
, ENC_BIG_ENDIAN
);
9368 proto_tree_add_item(community_tree
, hf_bgp_ext_com_evpn_l2attr_l2_mtu
, tvb
, offset
+4, 2, ENC_BIG_ENDIAN
);
9369 proto_tree_add_item(community_tree
, hf_bgp_ext_com_evpn_l2attr_reserved
, tvb
, offset
+6, 2, ENC_NA
);
9371 proto_item_append_text(community_item
, " flags: 0x%04x, L2 MTU: %u", tvb_get_ntohs(tvb
, offset
+2), tvb_get_ntohs(tvb
, offset
+4));
9375 case BGP_EXT_COM_STYPE_EVPN_ETREE
:
9377 static int * const etree_flags
[] = {
9378 &hf_bgp_ext_com_evpn_etree_flag_reserved
,
9379 &hf_bgp_ext_com_evpn_etree_flag_l
,
9383 proto_tree_add_bitmask(community_tree
, tvb
, offset
+2, hf_bgp_ext_com_evpn_etree_flags
,
9384 ett_bgp_ext_com_evpn_etree_flags
, etree_flags
, ENC_BIG_ENDIAN
);
9385 proto_tree_add_item(community_tree
, hf_bgp_ext_com_evpn_etree_reserved
, tvb
, offset
+3, 2, ENC_NA
);
9387 proto_tree_add_item(community_tree
, hf_bgp_update_mpls_label_value_20bits
, tvb
, offset
+5, 3, ENC_BIG_ENDIAN
);
9388 proto_tree_add_item(community_tree
, hf_bgp_update_mpls_traffic_class
, tvb
, offset
+5, 3, ENC_BIG_ENDIAN
);
9389 proto_tree_add_item(community_tree
, hf_bgp_update_mpls_bottom_stack
, tvb
, offset
+5, 3, ENC_BIG_ENDIAN
);
9394 /* The particular EVPN subtype is unknown or the
9395 * dissector is not written yet. We will dump the
9396 * entire community value in 2-byte short words.
9398 proto_tree_add_uint64_format_value(community_tree
, hf_bgp_ext_com_value_raw
, tvb
, offset
+2, 6,
9399 tvb_get_ntoh48 (tvb
, offset
+2), "0x%04x 0x%04x 0x%04x",
9400 tvb_get_ntohs(tvb
,offset
+2),
9401 tvb_get_ntohs(tvb
,offset
+4),
9402 tvb_get_ntohs(tvb
,offset
+6));
9404 proto_item_append_text(community_item
, " 0x%04x 0x%04x 0x%04x",
9405 tvb_get_ntohs(tvb
,offset
+2), tvb_get_ntohs(tvb
,offset
+4), tvb_get_ntohs(tvb
,offset
+6));
9410 case BGP_EXT_COM_TYPE_HIGH_TR_MUP
:
9411 proto_tree_add_item(community_tree
, hf_bgp_ext_com_stype_tr_mup
, tvb
, offset
+1, 1, ENC_BIG_ENDIAN
);
9413 proto_item_set_text(community_item
, "%s:",
9414 val_to_str(com_stype_low_byte
, bgpext_com_stype_tr_mup
, "Unknown subtype 0x%02x"));
9415 switch (com_stype_low_byte
) {
9416 case BGP_EXT_COM_STYPE_MUP_DIRECT_SEG
:
9417 /* format of this community is open, then display it in 2-byte:4-byte decimal format like route target */
9418 proto_tree_add_item(community_tree
, hf_bgp_ext_com_mup_segment_id2
, tvb
, offset
+2, 2, ENC_BIG_ENDIAN
);
9419 proto_tree_add_item(community_tree
, hf_bgp_ext_com_mup_segment_id4
, tvb
, offset
+4, 4, ENC_BIG_ENDIAN
);
9420 proto_item_append_text(community_item
, " %u:%u", tvb_get_ntohs(tvb
,offset
+2), tvb_get_ntohl(tvb
, offset
+4));
9423 proto_tree_add_uint64_format_value(community_tree
, hf_bgp_ext_com_value_raw
, tvb
, offset
+2, 6,
9424 tvb_get_ntoh48 (tvb
, offset
+2), "0x%04x 0x%04x 0x%04x",
9425 tvb_get_ntohs(tvb
,offset
+2),
9426 tvb_get_ntohs(tvb
,offset
+4),
9427 tvb_get_ntohs(tvb
,offset
+6));
9429 proto_item_append_text(community_item
, " 0x%04x 0x%04x 0x%04x",
9430 tvb_get_ntohs(tvb
,offset
+2), tvb_get_ntohs(tvb
,offset
+4), tvb_get_ntohs(tvb
,offset
+6));
9434 case BGP_EXT_COM_TYPE_HIGH_TR_EXT
: /* Generic Transitive Extended Community */
9435 proto_tree_add_item(community_tree
, hf_bgp_ext_com_stype_tr_exp
, tvb
, offset
+1, 1, ENC_BIG_ENDIAN
);
9437 proto_item_set_text(community_item
, "%s:",
9438 val_to_str(com_stype_low_byte
, bgpext_com_stype_tr_exp
, "Unknown subtype 0x%02x"));
9440 switch (com_stype_low_byte
) {
9441 case BGP_EXT_COM_STYPE_EXP_OSPF_RT
:
9443 proto_item
*ospf_rt_opt_item
;
9444 proto_tree
*ospf_rt_opt_tree
;
9446 proto_tree_add_item(community_tree
, hf_bgp_ext_com_value_ospf_rt_area
, tvb
, offset
+2, 4, ENC_BIG_ENDIAN
);
9447 proto_tree_add_item(community_tree
, hf_bgp_ext_com_value_ospf_rt_type
, tvb
, offset
+6, 1, ENC_BIG_ENDIAN
);
9448 ospf_rt_opt_item
= proto_tree_add_item(community_tree
,
9449 hf_bgp_ext_com_value_ospf_rt_options
, tvb
, offset
+7, 1, ENC_BIG_ENDIAN
);
9450 ospf_rt_opt_tree
= proto_item_add_subtree(ospf_rt_opt_item
, ett_bgp_ext_com_ospf_rt_opt
);
9451 proto_tree_add_item(ospf_rt_opt_tree
, hf_bgp_ext_com_value_ospf_rt_options_mt
,
9452 tvb
, offset
+7, 1, ENC_BIG_ENDIAN
);
9453 proto_item_append_text(ospf_rt_opt_item
, " (Metric: %s)",
9454 tfs_get_string(tvb_get_uint8(tvb
,offset
+7) & BGP_OSPF_RTYPE_METRIC_TYPE
, &tfs_ospf_rt_mt
));
9456 proto_item_append_text(community_item
, " Area: %s, Type: %s",
9457 tvb_ip_to_str(pinfo
->pool
, tvb
,offset
+2),
9458 val_to_str_const(tvb_get_uint8(tvb
,offset
+6), bgpext_com_ospf_rtype
, "Unknown"));
9462 case BGP_EXT_COM_STYPE_EXP_OSPF_RID
:
9463 proto_tree_add_item(community_tree
, hf_bgp_ext_com_value_ospf_rid
, tvb
, offset
+2, 4, ENC_BIG_ENDIAN
);
9465 proto_item_append_text(community_item
, " %s", tvb_ip_to_str(pinfo
->pool
, tvb
, offset
+2));
9468 case BGP_EXT_COM_STYPE_EXP_OSPF_DID
:
9469 proto_tree_add_item(community_tree
, hf_bgp_ext_com_stype_tr_as2
, tvb
, offset
+1, 1, ENC_BIG_ENDIAN
);
9470 proto_tree_add_item(community_tree
, hf_bgp_ext_com_value_as2
, tvb
, offset
+2, 2, ENC_BIG_ENDIAN
);
9471 proto_tree_add_item(community_tree
, hf_bgp_ext_com_value_an4
, tvb
, offset
+4, 4, ENC_BIG_ENDIAN
);
9473 proto_item_set_text(community_item
, "%s: %u:%u",
9474 val_to_str(com_stype_low_byte
, bgpext_com_stype_tr_exp
, "Unknown subtype 0x%02x"),
9475 tvb_get_ntohs(tvb
,offset
+2), tvb_get_ntohl(tvb
, offset
+4));
9478 case BGP_EXT_COM_STYPE_EXP_F_TR
: /* Flow spec traffic-rate [RFC5575] */
9479 proto_tree_add_item(community_tree
, hf_bgp_ext_com_value_as2
,
9480 tvb
, offset
+2, 2, ENC_BIG_ENDIAN
);
9481 /* remaining 4 bytes gives traffic rate in IEEE floating point */
9482 proto_tree_add_item(community_tree
, hf_bgp_ext_com_flow_rate_float
, tvb
, offset
+4, 4, ENC_BIG_ENDIAN
);
9484 proto_item_append_text(community_item
, " ASN %u, %.3f Mbps",
9485 tvb_get_ntohs(tvb
,offset
+2),
9486 tvb_get_ntohieee_float(tvb
,offset
+4)*8/1000000);
9489 case BGP_EXT_COM_STYPE_EXP_F_TA
: /* Flow spec traffic-action [RFC5575] */
9490 proto_tree_add_item(community_tree
, hf_bgp_ext_com_flow_act_allset
, tvb
, offset
+2, 5, ENC_NA
);
9491 proto_tree_add_item(community_tree
, hf_bgp_ext_com_flow_act_samp_act
, tvb
, offset
+7, 1, ENC_BIG_ENDIAN
);
9492 proto_tree_add_item(community_tree
, hf_bgp_ext_com_flow_act_term_act
, tvb
, offset
+7, 1, ENC_BIG_ENDIAN
);
9494 proto_item_append_text(community_item
, " Sample: %s, Terminal: %s",
9495 tfs_get_string(tvb_get_uint8(tvb
,offset
+7) & BGP_EXT_COM_FSPEC_ACT_S
, &tfs_yes_no
),
9496 tfs_get_string(tvb_get_uint8(tvb
,offset
+7) & BGP_EXT_COM_FSPEC_ACT_T
, &tfs_yes_no
));
9499 case BGP_EXT_COM_STYPE_EXP_F_RED
: /* Flow spec redirect [RFC5575] */
9500 proto_tree_add_item(community_tree
, hf_bgp_ext_com_value_as2
, tvb
, offset
+2, 2, ENC_BIG_ENDIAN
);
9501 proto_tree_add_item(community_tree
, hf_bgp_ext_com_value_an4
, tvb
, offset
+4, 4, ENC_BIG_ENDIAN
);
9503 proto_item_append_text(community_item
, " RT %u:%u",
9504 tvb_get_ntohs(tvb
,offset
+2), tvb_get_ntohl(tvb
,offset
+4));
9507 case BGP_EXT_COM_STYPE_EXP_F_RMARK
: /* Flow spec traffic-remarking [RFC5575] */
9508 proto_tree_add_item(community_tree
, hf_bgp_ext_com_value_fs_remark
, tvb
, offset
+7, 1, ENC_BIG_ENDIAN
);
9510 proto_item_append_text(community_item
, " %s",
9511 val_to_str_ext_const(tvb_get_uint8(tvb
,offset
+7), &dscp_vals_ext
, "Unknown DSCP"));
9514 case BGP_EXT_COM_STYPE_EXP_L2
:
9516 static int * const com_l2_flags
[] = {
9517 &hf_bgp_ext_com_l2_flag_d
,
9518 &hf_bgp_ext_com_l2_flag_z1
,
9519 &hf_bgp_ext_com_l2_flag_f
,
9520 &hf_bgp_ext_com_l2_flag_z345
,
9521 &hf_bgp_ext_com_l2_flag_c
,
9522 &hf_bgp_ext_com_l2_flag_s
,
9526 proto_tree_add_item(community_tree
, hf_bgp_ext_com_l2_encaps
,tvb
,offset
+2, 1, ENC_BIG_ENDIAN
);
9528 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
);
9529 proto_tree_add_item(community_tree
, hf_bgp_ext_com_l2_mtu
, tvb
, offset
+4, 2, ENC_BIG_ENDIAN
);
9533 case BGP_EXT_COM_STYPE_EXP_ETREE
:
9535 static int * const com_etree_flags
[] = {
9536 &hf_bgp_ext_com_etree_flag_reserved
,
9537 &hf_bgp_ext_com_etree_flag_p
,
9538 &hf_bgp_ext_com_etree_flag_v
,
9542 proto_tree_add_item(community_tree
, hf_bgp_ext_com_etree_root_vlan
,tvb
,offset
+2, 2, ENC_BIG_ENDIAN
);
9543 proto_tree_add_item(community_tree
, hf_bgp_ext_com_etree_leaf_vlan
,tvb
,offset
+4, 2, ENC_BIG_ENDIAN
);
9544 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
);
9549 /* The particular Experimental subtype is unknown or
9550 * the dissector is not written yet. We will dump the
9551 * entire community value in 2-byte short words.
9553 proto_tree_add_uint64_format_value(community_tree
, hf_bgp_ext_com_value_raw
, tvb
, offset
+2, 6,
9554 tvb_get_ntoh48 (tvb
, offset
+2), "0x%04x 0x%04x 0x%04x",
9555 tvb_get_ntohs(tvb
,offset
+2),
9556 tvb_get_ntohs(tvb
,offset
+4),
9557 tvb_get_ntohs(tvb
,offset
+6));
9559 proto_item_append_text(community_item
, " 0x%04x 0x%04x 0x%04x",
9560 tvb_get_ntohs(tvb
,offset
+2), tvb_get_ntohs(tvb
,offset
+4), tvb_get_ntohs(tvb
,offset
+6));
9565 case BGP_EXT_COM_TYPE_HIGH_TR_EXT_2
:
9566 proto_tree_add_item(community_tree
, hf_bgp_ext_com_stype_tr_exp_2
, tvb
, offset
+1, 1, ENC_BIG_ENDIAN
);
9568 proto_item_set_text(community_item
, "%s:",
9569 val_to_str(com_stype_low_byte
, bgpext_com_stype_tr_exp_2
, "Unknown subtype 0x%02x"));
9571 switch (com_stype_low_byte
) {
9572 case BGP_EXT_COM_STYPE_EXP_2_FLOW_RED
:
9574 proto_tree_add_item(community_tree
, hf_bgp_ext_com_value_IP4
, tvb
, offset
+2, 4, ENC_NA
);
9575 proto_tree_add_item(community_tree
, hf_bgp_ext_com_value_an2
, tvb
, offset
+6, 2, ENC_BIG_ENDIAN
);
9580 /* The particular Experimental subtype is unknown or
9581 * the dissector is not written yet. We will dump the
9582 * entire community value in 2-byte short words.
9584 proto_tree_add_uint64_format_value(community_tree
, hf_bgp_ext_com_value_raw
, tvb
, offset
+2, 6,
9585 tvb_get_ntoh48 (tvb
, offset
+2), "0x%04x 0x%04x 0x%04x",
9586 tvb_get_ntohs(tvb
,offset
+2),
9587 tvb_get_ntohs(tvb
,offset
+4),
9588 tvb_get_ntohs(tvb
,offset
+6));
9590 proto_item_append_text(community_item
, " 0x%04x 0x%04x 0x%04x",
9591 tvb_get_ntohs(tvb
,offset
+2), tvb_get_ntohs(tvb
,offset
+4), tvb_get_ntohs(tvb
,offset
+6));
9596 case BGP_EXT_COM_TYPE_HIGH_TR_EXT_3
:
9597 proto_tree_add_item(community_tree
, hf_bgp_ext_com_stype_tr_exp_3
, tvb
, offset
+1, 1, ENC_BIG_ENDIAN
);
9599 proto_item_set_text(community_item
, "%s:",
9600 val_to_str(com_stype_low_byte
, bgpext_com_stype_tr_exp_3
, "Unknown subtype 0x%02x"));
9602 switch (com_stype_low_byte
) {
9603 case BGP_EXT_COM_STYPE_EXP_3_FLOW_RED
:
9605 proto_tree_add_item(community_tree
, hf_bgp_ext_com_value_as4
, tvb
, offset
+2, 4, ENC_BIG_ENDIAN
);
9606 proto_tree_add_item(community_tree
, hf_bgp_ext_com_value_an2
, tvb
, offset
+6, 2, ENC_BIG_ENDIAN
);
9611 /* The particular Experimental subtype is unknown or
9612 * the dissector is not written yet. We will dump the
9613 * entire community value in 2-byte short words.
9615 proto_tree_add_uint64_format_value(community_tree
, hf_bgp_ext_com_value_raw
, tvb
, offset
+2, 6,
9616 tvb_get_ntoh48 (tvb
, offset
+2), "0x%04x 0x%04x 0x%04x",
9617 tvb_get_ntohs(tvb
,offset
+2),
9618 tvb_get_ntohs(tvb
,offset
+4),
9619 tvb_get_ntohs(tvb
,offset
+6));
9621 proto_item_append_text(community_item
, " 0x%04x 0x%04x 0x%04x",
9622 tvb_get_ntohs(tvb
,offset
+2), tvb_get_ntohs(tvb
,offset
+4), tvb_get_ntohs(tvb
,offset
+6));
9627 case BGP_EXT_COM_TYPE_HIGH_TR_EXP_EIGRP
:
9628 proto_tree_add_item(community_tree
, hf_bgp_ext_com_stype_tr_exp_eigrp
, tvb
, offset
+1, 1, ENC_BIG_ENDIAN
);
9630 proto_item_set_text(community_item
, "%s:",
9631 val_to_str(com_stype_low_byte
, bgpext_com_stype_tr_eigrp
, "Unknown subtype 0x%02x"));
9633 switch(com_stype_low_byte
) {
9634 case BGP_EXT_COM_STYPE_EXP_EIGRP_FT
:
9636 proto_item
*eigrp_flags_item
;
9637 proto_tree
*eigrp_flags_tree
;
9639 eigrp_flags_item
= proto_tree_add_item(community_tree
, hf_bgp_ext_com_eigrp_flags
, tvb
, offset
+2, 2, ENC_BIG_ENDIAN
);
9640 eigrp_flags_tree
= proto_item_add_subtree(eigrp_flags_item
, ett_bgp_ext_com_eigrp_flags
);
9642 proto_tree_add_item(eigrp_flags_tree
, hf_bgp_ext_com_eigrp_flags_rt
, tvb
, offset
+2, 2, ENC_BIG_ENDIAN
);
9643 proto_item_append_text(eigrp_flags_tree
, " (%s)",
9644 tfs_get_string(tvb_get_ntohs(tvb
, offset
+2) & BGP_EXT_COM_EXP_EIGRP_FLAG_RT
, &tfs_eigrp_rtype
));
9645 proto_item_append_text(community_tree
, " %s route",
9646 tfs_get_string(tvb_get_ntohs(tvb
, offset
+2) & BGP_EXT_COM_EXP_EIGRP_FLAG_RT
, &tfs_eigrp_rtype
));
9648 proto_tree_add_item(community_tree
, hf_bgp_ext_com_eigrp_rtag
, tvb
, offset
+4, 4, ENC_BIG_ENDIAN
);
9649 proto_item_append_text(community_tree
, ", Tag: %u", tvb_get_ntohl(tvb
, offset
+4));
9653 case BGP_EXT_COM_STYPE_EXP_EIGRP_AD
:
9657 proto_tree_add_item(community_tree
, hf_bgp_ext_com_eigrp_asn
, tvb
, offset
+2, 2, ENC_BIG_ENDIAN
);
9659 raw_value
= tvb_get_ntohl(tvb
, offset
+4);
9660 proto_tree_add_uint_format_value(community_tree
, hf_bgp_ext_com_eigrp_delay
,
9661 tvb
, offset
+4, 4, raw_value
, "%u (%u usec)", raw_value
, raw_value
* 10 / 256);
9663 proto_item_append_text(community_item
, " ASN: %u, D: %u",
9664 tvb_get_ntohs(tvb
, offset
+2), raw_value
);
9668 case BGP_EXT_COM_STYPE_EXP_EIGRP_RHB
:
9672 raw_value
= tvb_get_uint8(tvb
, offset
+2);
9673 proto_tree_add_uint_format_value(community_tree
, hf_bgp_ext_com_eigrp_rly
,
9674 tvb
, offset
+2, 1, raw_value
, "%u (%u%%)", raw_value
, (raw_value
* 100) / 255);
9675 proto_item_append_text(community_item
, " R: %u", raw_value
);
9677 proto_tree_add_item(community_tree
, hf_bgp_ext_com_eigrp_hops
, tvb
, offset
+3, 1, ENC_BIG_ENDIAN
);
9678 proto_item_append_text(community_tree
, ", H: %u", tvb_get_uint8(tvb
, offset
+3));
9680 raw_value
= tvb_get_ntohl(tvb
, offset
+4);
9681 proto_tree_add_uint_format_value(community_tree
, hf_bgp_ext_com_eigrp_bw
,
9682 tvb
, offset
+4, 4, raw_value
, "%u (%u Kbps)", raw_value
, raw_value
? (2560000000U / raw_value
) : 0);
9683 proto_item_append_text(community_tree
, ", B: %u", raw_value
);
9687 case BGP_EXT_COM_STYPE_EXP_EIGRP_LM
:
9691 raw_value
= tvb_get_uint8(tvb
, offset
+3);
9692 proto_tree_add_uint_format_value(community_tree
, hf_bgp_ext_com_eigrp_load
,
9693 tvb
, offset
+3, 1, raw_value
, "%u (%u%%)", raw_value
, (raw_value
* 100) / 255);
9694 proto_item_append_text(community_tree
, " L: %u", raw_value
);
9696 proto_tree_add_item(community_tree
, hf_bgp_ext_com_eigrp_mtu
, tvb
, offset
+4, 4, ENC_BIG_ENDIAN
);
9697 proto_item_append_text(community_tree
, ", M: %u", tvb_get_ntohl(tvb
, offset
+4));
9701 case BGP_EXT_COM_STYPE_EXP_EIGRP_EAR
:
9702 proto_tree_add_item(community_tree
, hf_bgp_ext_com_eigrp_e_asn
, tvb
, offset
+2, 2, ENC_BIG_ENDIAN
);
9703 proto_tree_add_item(community_tree
, hf_bgp_ext_com_eigrp_e_rid
, tvb
, offset
+4, 4, ENC_BIG_ENDIAN
);
9705 proto_item_append_text(community_tree
, " ASN: %u, RID: %s",
9706 tvb_get_ntohs(tvb
, offset
+2), tvb_ip_to_str(pinfo
->pool
, tvb
, offset
+4));
9709 case BGP_EXT_COM_STYPE_EXP_EIGRP_EPM
:
9710 proto_tree_add_item(community_tree
, hf_bgp_ext_com_eigrp_e_pid
, tvb
, offset
+2, 2, ENC_BIG_ENDIAN
);
9711 proto_tree_add_item(community_tree
, hf_bgp_ext_com_eigrp_e_m
, tvb
, offset
+4, 4, ENC_BIG_ENDIAN
);
9713 proto_item_append_text(community_tree
, " %s, Metric: %u",
9714 val_to_str(tvb_get_ntohs(tvb
, offset
+2), eigrp_proto2string
, "Unknown protocol %u"),
9715 tvb_get_ntohl(tvb
, offset
+4));
9718 case BGP_EXT_COM_STYPE_EXP_EIGRP_RID
:
9719 proto_tree_add_item(community_tree
, hf_bgp_ext_com_eigrp_rid
, tvb
, offset
+4, 4, ENC_NA
);
9720 proto_item_append_text(community_tree
, " %s", tvb_ip_to_str(pinfo
->pool
, tvb
, offset
+4));
9725 case BGP_EXT_COM_TYPE_HIGH_TR_FLOW
: /* Flow spec redirect/mirror to IP next-hop [draft-simpson-idr-flowspec-redirect] */
9727 proto_tree_add_item(community_tree
, hf_bgp_ext_com_stype_low_unknown
, tvb
, offset
+1, 1, ENC_BIG_ENDIAN
);
9729 proto_tree_add_uint64_format_value(community_tree
, hf_bgp_ext_com_value_raw
, tvb
, offset
+2, 6,
9730 tvb_get_ntoh48 (tvb
, offset
+2), "0x%04x 0x%04x 0x%04x",
9731 tvb_get_ntohs(tvb
,offset
+2),
9732 tvb_get_ntohs(tvb
,offset
+4),
9733 tvb_get_ntohs(tvb
,offset
+6));
9735 proto_item_set_text(community_item
, "Unknown type 0x%02x subtype 0x%02x: 0x%04x 0x%04x 0x%04x",
9736 com_type_high_byte
, com_stype_low_byte
,
9737 tvb_get_ntohs(tvb
,offset
+2), tvb_get_ntohs(tvb
,offset
+4), tvb_get_ntohs(tvb
,offset
+6));
9740 proto_item_append_text (community_item
, " [%s]", val_to_str_const(com_type_high_byte
, bgpext_com_type_high
, "Unknown community"));
9741 offset
= offset
+ 8;
9747 dissect_bgp_update_pmsi_attr(packet_info
*pinfo
, proto_tree
*parent_tree
, tvbuff_t
*tvb
, uint16_t tlen
, unsigned tvb_off
)
9750 uint8_t tunnel_type
=0;
9751 uint8_t opaque_value_type
=0;
9752 uint8_t rn_addr_length
=0;
9753 uint16_t tunnel_id_len
=0;
9754 uint16_t opaque_value_length
=0;
9755 proto_item
*tunnel_id_item
=NULL
;
9756 proto_item
*opaque_value_type_item
=NULL
;
9757 proto_item
*pmsi_tunnel_type_item
=NULL
;
9758 proto_tree
*tunnel_id_tree
=NULL
;
9759 path_attr_data
*data
= NULL
;
9762 tunnel_id_len
= tlen
- 5;
9764 proto_tree_add_item(parent_tree
, hf_bgp_pmsi_tunnel_flags
, tvb
, offset
,
9767 pmsi_tunnel_type_item
= proto_tree_add_item(parent_tree
, hf_bgp_pmsi_tunnel_type
, tvb
, offset
+1,
9770 data
= load_path_attr_data(pinfo
);
9771 if (data
&& data
->encaps_community_present
&&
9772 (data
->encaps_tunnel_type
== BGP_EXT_COM_TUNNEL_VXLAN
|| data
->encaps_tunnel_type
== BGP_EXT_COM_TUNNEL_VXLANGPE
)) {
9773 proto_tree_add_item(parent_tree
, hf_bgp_evpn_nlri_vni
, tvb
, offset
+2, 3, ENC_BIG_ENDIAN
);
9775 proto_tree_add_item(parent_tree
, hf_bgp_update_mpls_label_value_20bits
, tvb
, offset
+2, 3, ENC_BIG_ENDIAN
);
9778 tunnel_id_item
= proto_tree_add_item(parent_tree
, hf_bgp_pmsi_tunnel_id
, tvb
, offset
+5,
9779 tunnel_id_len
, ENC_NA
);
9780 tunnel_id_tree
= proto_item_add_subtree(tunnel_id_item
, ett_bgp_pmsi_tunnel_id
);
9782 tunnel_type
= tvb_get_uint8(tvb
, offset
+1);
9783 switch(tunnel_type
) {
9784 case PMSI_TUNNEL_NOPRESENT
:
9785 proto_tree_add_item(tunnel_id_tree
, hf_bgp_pmsi_tunnel_not_present
, tvb
, offset
+1, 1, ENC_NA
);
9787 case PMSI_TUNNEL_RSVPTE_P2MP
:
9788 proto_tree_add_item(tunnel_id_tree
, hf_bgp_pmsi_tunnel_rsvp_p2mp_id
, tvb
, offset
+5, 4, ENC_NA
);
9789 proto_tree_add_item(tunnel_id_tree
, hf_bgp_pmsi_tunnel_rsvp_p2mp_tunnel_id
, tvb
, offset
+11, 2, ENC_BIG_ENDIAN
);
9790 proto_tree_add_item(tunnel_id_tree
, hf_bgp_pmsi_tunnel_rsvp_p2mp_ext_tunnel_idv4
, tvb
, offset
+13, 4, ENC_NA
);
9791 proto_item_append_text(tunnel_id_item
, ": Id %u, Ext Id %s",
9792 tvb_get_ntohs(tvb
, offset
+11), tvb_ip_to_str(pinfo
->pool
, tvb
, offset
+13));
9794 case PMSI_TUNNEL_MLDP_P2MP
:
9795 case PMSI_TUNNEL_MLDP_MP2MP
:
9796 proto_tree_add_item(tunnel_id_tree
, hf_bgp_pmsi_tunnel_mldp_fec_el_type
, tvb
, offset
+5, 1, ENC_BIG_ENDIAN
);
9797 proto_tree_add_item(tunnel_id_tree
, hf_bgp_pmsi_tunnel_mldp_fec_el_afi
, tvb
, offset
+6, 2, ENC_BIG_ENDIAN
);
9798 proto_tree_add_item(tunnel_id_tree
, hf_bgp_pmsi_tunnel_mldp_fec_el_adr_len
, tvb
, offset
+8, 1, ENC_BIG_ENDIAN
);
9799 rn_addr_length
= tvb_get_uint8(tvb
, offset
+8);
9800 if(rn_addr_length
== 4)
9801 proto_tree_add_item(tunnel_id_tree
, hf_bgp_pmsi_tunnel_mldp_fec_el_root_nodev4
, tvb
, offset
+9, 4, ENC_BIG_ENDIAN
);
9803 proto_tree_add_item(tunnel_id_tree
, hf_bgp_pmsi_tunnel_mldp_fec_el_root_nodev6
, tvb
, offset
+9, 16, ENC_NA
);
9805 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
);
9806 opaque_value_type_item
= proto_tree_add_item(tunnel_id_tree
, hf_bgp_pmsi_tunnel_mldp_fec_el_opa_val_type
,
9807 tvb
, offset
+11+rn_addr_length
, 1, ENC_BIG_ENDIAN
);
9808 opaque_value_type
= tvb_get_uint8(tvb
, offset
+11+rn_addr_length
);
9809 if(opaque_value_type
== PMSI_MLDP_FEC_TYPE_GEN_LSP
) {
9810 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
);
9811 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
);
9812 proto_item_append_text(tunnel_id_item
, ": Type: %s root node: %s Id: %u",
9813 val_to_str_const(tvb_get_uint8(tvb
, offset
+5), fec_types_vals
, "Unknown"),
9814 tvb_ip_to_str(pinfo
->pool
, tvb
, offset
+9),
9815 tvb_get_ntohl(tvb
, offset
+14+rn_addr_length
));
9816 } else if (opaque_value_type
== PMSI_MLDP_FEC_TYPE_EXT_TYPE
) {
9817 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
);
9818 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
);
9819 opaque_value_length
= tvb_get_ntohs(tvb
, offset
+14+rn_addr_length
);
9820 proto_tree_add_item(tunnel_id_tree
, hf_bgp_pmsi_tunnel_mldp_fec_el_opa_value_str
, tvb
, offset
+16+rn_addr_length
,
9821 opaque_value_length
, ENC_ASCII
);
9824 /* This covers situation when opaque id is 0 (reserved) or any other value */
9825 expert_add_info_format(pinfo
, opaque_value_type_item
, &ei_bgp_attr_pmsi_opaque_type
,
9826 "Opaque Value type %u wrong, must be modulo 1 or 255", opaque_value_type
);
9829 case PMSI_TUNNEL_PIMSSM
:
9830 proto_tree_add_item(tunnel_id_tree
, hf_bgp_pmsi_tunnel_pimssm_root_node
, tvb
, offset
+5, 4, ENC_BIG_ENDIAN
);
9831 proto_tree_add_item(tunnel_id_tree
, hf_bgp_pmsi_tunnel_pimssm_pmc_group
, tvb
, offset
+9, 4, ENC_BIG_ENDIAN
);
9832 proto_item_append_text(tunnel_id_item
, ": < %s, %s >",
9833 tvb_ip_to_str(pinfo
->pool
, tvb
, offset
+5),
9834 tvb_ip_to_str(pinfo
->pool
, tvb
, offset
+9));
9836 case PMSI_TUNNEL_PIMSM
:
9837 proto_tree_add_item(tunnel_id_tree
, hf_bgp_pmsi_tunnel_pimsm_sender
, tvb
, offset
+5, 4, ENC_BIG_ENDIAN
);
9838 proto_tree_add_item(tunnel_id_tree
, hf_bgp_pmsi_tunnel_pimsm_pmc_group
, tvb
, offset
+9, 4, ENC_BIG_ENDIAN
);
9839 proto_item_append_text(tunnel_id_item
, ": < %s, %s >",
9840 tvb_ip_to_str(pinfo
->pool
, tvb
, offset
+5),
9841 tvb_ip_to_str(pinfo
->pool
, tvb
, offset
+9));
9843 case PMSI_TUNNEL_BIDIR_PIM
:
9844 proto_tree_add_item(tunnel_id_tree
, hf_bgp_pmsi_tunnel_pimbidir_sender
, tvb
, offset
+5, 4, ENC_BIG_ENDIAN
);
9845 proto_tree_add_item(tunnel_id_tree
, hf_bgp_pmsi_tunnel_pimbidir_pmc_group
, tvb
, offset
+9, 4, ENC_BIG_ENDIAN
);
9846 proto_item_append_text(tunnel_id_item
, ": < %s, %s >",
9847 tvb_ip_to_str(pinfo
->pool
, tvb
, offset
+5),
9848 tvb_ip_to_str(pinfo
->pool
, tvb
, offset
+9));
9850 case PMSI_TUNNEL_INGRESS
:
9851 if(tunnel_id_len
== 4){
9852 proto_tree_add_item(tunnel_id_tree
, hf_bgp_pmsi_tunnel_ingress_rep_addr
, tvb
, offset
+5, 4, ENC_BIG_ENDIAN
);
9853 proto_item_append_text(tunnel_id_item
, ": tunnel end point -> %s",
9854 tvb_ip_to_str(pinfo
->pool
, tvb
, offset
+5));
9856 proto_tree_add_item(tunnel_id_tree
, hf_bgp_pmsi_tunnel_ingress_rep_addr6
, tvb
, offset
+5, 16, ENC_NA
);
9857 proto_item_append_text(tunnel_id_item
, ": tunnel end point -> %s",
9858 tvb_ip6_to_str(pinfo
->pool
, tvb
, offset
+5));
9862 expert_add_info_format(pinfo
, pmsi_tunnel_type_item
, &ei_bgp_attr_pmsi_tunnel_type
,
9863 "Tunnel type %u wrong", tunnel_type
);
9872 * Dissect BGP path attributes
9876 // NOLINTNEXTLINE(misc-no-recursion)
9877 dissect_bgp_path_attr(proto_tree
*subtree
, tvbuff_t
*tvb
, uint16_t path_attr_len
, unsigned tvb_off
, packet_info
*pinfo
)
9879 uint8_t bgpa_flags
; /* path attributes */
9881 int o
; /* packet offset */
9883 int end
=0; /* message end */
9884 int advance
; /* tmp */
9885 proto_item
*ti
; /* tree item */
9886 proto_item
*ti_communities
; /* tree communities */
9887 proto_item
*ti_community
; /* tree for each community */
9888 proto_item
*ti_as
; /* tree for each as */
9889 proto_item
*attr_len_item
;
9890 proto_item
*aigp_type_item
;
9891 proto_tree
*subtree2
; /* path attribute subtree */
9892 proto_tree
*subtree3
; /* subtree for attributes */
9893 proto_tree
*subtree4
; /* subtree for attributes */
9894 proto_tree
*subtree5
; /* subtree for attributes */
9895 proto_tree
*subtree6
; /* subtree for attributes */
9896 proto_tree
*subtree7
; /* subtree for attributes */
9897 proto_tree
*subtree8
; /* subtree for attributes */
9898 proto_tree
*attr_set_subtree
; /* subtree for attr_set */
9899 proto_tree
*as_path_segment_tree
; /* subtree for AS_PATH segments */
9900 int number_as_segment
=0; /* Number As segment */
9901 proto_tree
*communities_tree
; /* subtree for COMMUNITIES */
9902 proto_tree
*community_tree
; /* subtree for a community */
9903 proto_tree
*cluster_list_tree
; /* subtree for CLUSTER_LIST */
9904 int i
=0, j
, k
; /* tmp */
9905 uint8_t type
=0; /* AS_PATH segment type */
9906 uint8_t length
=0; /* AS_PATH segment length */
9907 uint32_t aggregator_as
;
9908 uint16_t ssa_type
; /* SSA T + Type */
9909 uint16_t ssa_len
; /* SSA TLV Length */
9910 uint8_t ssa_v3_len
; /* SSA L2TPv3 Cookie Length */
9911 uint16_t encaps_tunnel_type
; /* Encapsulation Tunnel Type */
9912 uint16_t encaps_tunnel_len
; /* Encapsulation TLV Length */
9913 uint8_t encaps_tunnel_subtype
; /* Encapsulation Tunnel Sub-TLV Type */
9914 uint16_t encaps_tunnel_sublen
; /* Encapsulation TLV Sub-TLV Length */
9915 uint16_t encaps_tunnel_sub_totallen
; /* Encapsulation TLV Sub-TLV Length + Type + Length field */
9916 uint8_t aigp_type
; /* AIGP TLV type from AIGP attribute */
9917 uint8_t prefix_sid_subtype
; /* BGP Prefix-SID TLV Type */
9918 uint16_t prefix_sid_sublen
; /* BGP Prefix-SID TLV Length */
9919 int prefix_sid_sub_tlv_offset
; /* BGP Prefix-SID SRGB Length */
9920 int check_srgb
; /* BGP Prefix-SID SRGB counter */
9921 uint16_t secpathlen
; /* BGPsec Secure Path length */
9922 uint16_t sigblocklen
; /* BGPsec Signature Block length */
9923 uint8_t secpathcount
; /* Number of Secure Path Segments */
9924 uint16_t sig_len
; /* Length of BGPsec Signature */
9925 uint32_t segment_subtlv_type
; /* Segment List SubTLV Type */
9926 uint32_t segment_subtlv_length
; /* Segment List SubTLV Length */
9927 uint8_t srv6_service_subtlv_type
; /* SRv6 Service Sub-TLV type */
9928 uint16_t srv6_service_subtlv_len
; /* SRv6 Service Sub-TLV length */
9929 uint8_t srv6_service_data_subsubtlv_type
; /* SRv6 Service Data Sub-Sub-TLV type */
9930 uint16_t srv6_service_data_subsubtlv_len
; /* SRv6 Service Data Sub-Sub-TLV length */
9934 increment_dissection_depth(pinfo
);
9935 while (i
< path_attr_len
) {
9936 proto_item
*ti_pa
, *ti_flags
;
9938 int alen
, aoff
, tlen
, aoff_save
;
9940 uint8_t nexthop_len
;
9941 uint8_t asn_len
= 0;
9942 uint32_t af
, saf
, as_num
;
9944 static int * const path_flags
[] = {
9945 &hf_bgp_update_path_attribute_flags_optional
,
9946 &hf_bgp_update_path_attribute_flags_transitive
,
9947 &hf_bgp_update_path_attribute_flags_partial
,
9948 &hf_bgp_update_path_attribute_flags_extended_length
,
9949 &hf_bgp_update_path_attribute_flags_unused
,
9953 bgpa_flags
= tvb_get_uint8(tvb
, o
+ i
);
9954 bgpa_type
= tvb_get_uint8(tvb
, o
+ i
+1);
9956 /* check for the Extended Length bit */
9957 if (bgpa_flags
& BGP_ATTR_FLAG_EXTENDED_LENGTH
) {
9958 alen
= tvb_get_ntohs(tvb
, o
+ i
+ BGP_SIZE_OF_PATH_ATTRIBUTE
);
9959 aoff
= BGP_SIZE_OF_PATH_ATTRIBUTE
+2;
9961 alen
= tvb_get_uint8(tvb
, o
+ i
+ BGP_SIZE_OF_PATH_ATTRIBUTE
);
9962 aoff
= BGP_SIZE_OF_PATH_ATTRIBUTE
+1;
9966 ti_pa
= proto_tree_add_item(subtree
, hf_bgp_update_path_attribute
, tvb
, o
+ i
, tlen
+ aoff
, ENC_NA
);
9967 proto_item_append_text(ti_pa
, " - %s", val_to_str(bgpa_type
, bgpattr_type
, "Unknown (%u)"));
9969 subtree2
= proto_item_add_subtree(ti_pa
, ett_bgp_attr
);
9971 ti_flags
= proto_tree_add_bitmask(subtree2
, tvb
, o
+ i
, hf_bgp_update_path_attribute_flags
, ett_bgp_attr_flags
, path_flags
, ENC_NA
);
9973 if ((bgpa_flags
& BGP_ATTR_FLAG_OPTIONAL
) == 0)
9974 proto_item_append_text(ti_flags
, "%s", ", Well-known");
9975 if ((bgpa_flags
& BGP_ATTR_FLAG_TRANSITIVE
) == 0)
9976 proto_item_append_text(ti_flags
, "%s", ", Non-transitive");
9977 if ((bgpa_flags
& BGP_ATTR_FLAG_PARTIAL
) == 0)
9978 proto_item_append_text(ti_flags
, "%s", ", Complete");
9980 proto_tree_add_item(subtree2
, hf_bgp_update_path_attribute_type_code
, tvb
, o
+ i
+ 1, 1, ENC_BIG_ENDIAN
);
9982 attr_len_item
= proto_tree_add_item(subtree2
, hf_bgp_update_path_attribute_length
, tvb
, o
+ i
+ BGP_SIZE_OF_PATH_ATTRIBUTE
,
9983 aoff
- BGP_SIZE_OF_PATH_ATTRIBUTE
, ENC_BIG_ENDIAN
);
9984 if (aoff
+ tlen
> path_attr_len
- i
) {
9985 proto_tree_add_expert_format(subtree2
, pinfo
, &ei_bgp_length_invalid
, tvb
, o
+ i
+ aoff
, tlen
,
9986 "Path attribute length is invalid: %u byte%s", tlen
,
9987 plurality(tlen
, "", "s"));
9991 /* Path Attribute Type */
9992 switch (bgpa_type
) {
9993 case BGPTYPE_ORIGIN
:
9995 proto_tree_add_expert_format(subtree2
, pinfo
, &ei_bgp_length_invalid
, tvb
, o
+ i
+ aoff
, tlen
,
9996 "Origin (invalid): %u byte%s", tlen
,
9997 plurality(tlen
, "", "s"));
9999 proto_tree_add_item(subtree2
, hf_bgp_update_path_attribute_origin
, tvb
,
10000 o
+ i
+ aoff
, 1, ENC_BIG_ENDIAN
);
10001 proto_item_append_text(ti_pa
, ": %s", val_to_str_const(tvb_get_uint8(tvb
, o
+ i
+ aoff
), bgpattr_origin
, "Unknown"));
10004 case BGPTYPE_AS_PATH
:
10005 case BGPTYPE_AS4_PATH
:
10006 /* Apply heuristic to guess if we are facing 2 or 4 bytes ASN
10008 (o + current attribute + aoff bytes to first tuple)
10009 heuristic also tell us how many AS segments we have */
10010 asn_len
= heuristic_as2_or_4_from_as_path(tvb
, o
+i
+aoff
, o
+i
+aoff
+tlen
,
10011 bgpa_type
, &number_as_segment
);
10012 if (asn_len
== 255)
10014 expert_add_info_format(pinfo
, ti_pa
, &ei_bgp_attr_as_path_as_len_err
,
10015 "ASN length uncalculated by heuristic : %u", asn_len
);
10018 proto_item_append_text(ti_pa
,": ");
10020 proto_item_append_text(ti_pa
,"empty");
10023 for (k
=0; k
< number_as_segment
; k
++)
10025 type
= tvb_get_uint8(tvb
, q
);
10026 length
= tvb_get_uint8(tvb
, q
+1);
10027 ti
= proto_tree_add_item(subtree2
, hf_bgp_update_path_attribute_as_path_segment
, tvb
,
10028 q
, length
* asn_len
+ 2, ENC_NA
);
10029 proto_item_append_text(ti
,": ");
10030 as_path_segment_tree
= proto_item_add_subtree(ti
, ett_bgp_as_path_segment
);
10031 proto_tree_add_item(as_path_segment_tree
, hf_bgp_update_path_attribute_as_path_segment_type
, tvb
,
10032 q
, 1, ENC_BIG_ENDIAN
);
10033 proto_tree_add_item(as_path_segment_tree
, hf_bgp_update_path_attribute_as_path_segment_length
, tvb
,
10034 q
+1, 1, ENC_BIG_ENDIAN
);
10038 proto_item_append_text(ti_pa
, "{");
10039 proto_item_append_text(ti
, "{");
10041 case AS_CONFED_SET
:
10042 proto_item_append_text(ti_pa
, "[");
10043 proto_item_append_text(ti
, "[");
10045 case AS_CONFED_SEQUENCE
:
10046 proto_item_append_text(ti_pa
, "(");
10047 proto_item_append_text(ti
, "(");
10052 for (j
= 0; j
< length
; j
++)
10055 ti_as
= proto_tree_add_item_ret_uint(as_path_segment_tree
,
10056 hf_bgp_update_path_attribute_as_path_segment_as2
,
10057 tvb
, q
, 2, ENC_BIG_ENDIAN
, &as_num
);
10058 if (as_num
== BGP_AS_TRANS
) {
10059 proto_item_append_text(ti_as
, " (AS_TRANS)");
10061 proto_item_append_text(ti_pa
, "%u",
10062 tvb_get_ntohs(tvb
, q
));
10063 proto_item_append_text(ti
, "%u",
10064 tvb_get_ntohs(tvb
, q
));
10066 else if (asn_len
== 4) {
10067 proto_tree_add_item(as_path_segment_tree
,
10068 hf_bgp_update_path_attribute_as_path_segment_as4
,
10069 tvb
, q
, 4, ENC_BIG_ENDIAN
);
10070 proto_item_append_text(ti_pa
, "%u",
10071 tvb_get_ntohl(tvb
, q
));
10072 proto_item_append_text(ti
, "%u",
10073 tvb_get_ntohl(tvb
, q
));
10077 proto_item_append_text(ti_pa
, "%s",
10078 (type
== AS_SET
|| type
== AS_CONFED_SET
) ?
10080 proto_item_append_text(ti
, "%s",
10081 (type
== AS_SET
|| type
== AS_CONFED_SET
) ?
10089 proto_item_append_text(ti_pa
, "} ");
10090 proto_item_append_text(ti
, "}");
10092 case AS_CONFED_SET
:
10093 proto_item_append_text(ti_pa
, "] ");
10094 proto_item_append_text(ti
, "]");
10096 case AS_CONFED_SEQUENCE
:
10097 proto_item_append_text(ti_pa
, ") ");
10098 proto_item_append_text(ti
, ")");
10101 proto_item_append_text(ti_pa
, " ");
10107 case BGPTYPE_NEXT_HOP
:
10109 proto_tree_add_expert_format(subtree2
, pinfo
, &ei_bgp_length_invalid
, tvb
, o
+ i
+ aoff
, tlen
,
10110 "Next hop (invalid): %u byte%s", tlen
,
10111 plurality(tlen
, "", "s"));
10113 proto_tree_add_item(subtree2
, hf_bgp_update_path_attribute_next_hop
, tvb
,
10114 o
+ i
+ aoff
, 4, ENC_BIG_ENDIAN
);
10115 proto_item_append_text(ti_pa
, ": %s ", tvb_ip_to_str(pinfo
->pool
, tvb
, o
+ i
+ aoff
));
10118 case BGPTYPE_MULTI_EXIT_DISC
:
10120 proto_tree_add_expert_format(subtree2
, pinfo
, &ei_bgp_length_invalid
, tvb
, o
+ i
+ aoff
, tlen
,
10121 "Multiple exit discriminator (invalid): %u byte%s",
10122 tlen
, plurality(tlen
, "", "s"));
10124 proto_tree_add_item(subtree2
, hf_bgp_update_path_attribute_multi_exit_disc
, tvb
,
10125 o
+ i
+ aoff
, tlen
, ENC_BIG_ENDIAN
);
10126 proto_item_append_text(ti_pa
,": %u", tvb_get_ntohl(tvb
, o
+ i
+ aoff
));
10129 case BGPTYPE_LOCAL_PREF
:
10131 proto_tree_add_expert_format(subtree2
, pinfo
, &ei_bgp_length_invalid
, tvb
, o
+ i
+ aoff
, tlen
,
10132 "Local preference (invalid): %u byte%s", tlen
,
10133 plurality(tlen
, "", "s"));
10135 proto_tree_add_item(subtree2
, hf_bgp_update_path_attribute_local_pref
, tvb
,
10136 o
+ i
+ aoff
, tlen
, ENC_BIG_ENDIAN
);
10137 proto_item_append_text(ti_pa
, ": %u", tvb_get_ntohl(tvb
, o
+ i
+ aoff
));
10140 case BGPTYPE_ATOMIC_AGGREGATE
:
10142 proto_tree_add_expert_format(subtree2
, pinfo
, &ei_bgp_length_invalid
, tvb
, o
+ i
+ aoff
, tlen
,
10143 "Atomic aggregate (invalid): %u byte%s", tlen
,
10144 plurality(tlen
, "", "s"));
10147 case BGPTYPE_AGGREGATOR
:
10148 if (tlen
!= 6 && tlen
!= 8) {
10149 proto_tree_add_expert_format(subtree2
, pinfo
, &ei_bgp_length_invalid
, tvb
, o
+ i
+ aoff
, tlen
,
10150 "Aggregator (invalid): %u byte%s", tlen
,
10151 plurality(tlen
, "", "s"));
10155 case BGPTYPE_AS4_AGGREGATOR
:
10156 if (bgpa_type
== BGPTYPE_AS4_AGGREGATOR
&& tlen
!= 8)
10157 proto_tree_add_expert_format(subtree2
, pinfo
, &ei_bgp_length_invalid
, tvb
, o
+ i
+ aoff
, tlen
,
10158 "Aggregator (invalid): %u byte%s", tlen
,
10159 plurality(tlen
, "", "s"));
10161 asn_len
= tlen
- 4;
10162 aggregator_as
= (asn_len
== 2) ?
10163 tvb_get_ntohs(tvb
, o
+ i
+ aoff
) :
10164 tvb_get_ntohl(tvb
, o
+ i
+ aoff
);
10165 proto_tree_add_uint(subtree2
, hf_bgp_update_path_attribute_aggregator_as
, tvb
,
10166 o
+ i
+ aoff
, asn_len
, aggregator_as
);
10167 proto_tree_add_item(subtree2
, hf_bgp_update_path_attribute_aggregator_origin
, tvb
,
10168 o
+ i
+ aoff
+ asn_len
, 4, ENC_BIG_ENDIAN
);
10170 proto_item_append_text(ti_pa
, ": AS: %u origin: %s", aggregator_as
,
10171 tvb_ip_to_str(pinfo
->pool
, tvb
, o
+ i
+ aoff
+ asn_len
));
10174 case BGPTYPE_COMMUNITIES
:
10175 if (tlen
% 4 != 0) {
10176 proto_tree_add_expert_format(subtree2
, pinfo
, &ei_bgp_length_invalid
, tvb
, o
+ i
+ aoff
, tlen
,
10177 "Communities (invalid): %u byte%s", tlen
,
10178 plurality(tlen
, "", "s"));
10182 proto_item_append_text(ti_pa
, ": ");
10184 ti_communities
= proto_tree_add_item(subtree2
, hf_bgp_update_path_attribute_communities
,
10185 tvb
, o
+ i
+ aoff
, tlen
, ENC_NA
);
10187 communities_tree
= proto_item_add_subtree(ti_communities
,
10188 ett_bgp_communities
);
10189 proto_item_append_text(ti_communities
, ": ");
10190 /* (o + i + aoff) =
10191 (o + current attribute + aoff bytes to first tuple) */
10195 /* snarf each community */
10197 /* check for reserved values */
10198 uint32_t community
= tvb_get_ntohl(tvb
, q
);
10199 if ((community
& 0xFFFF0000) == FOURHEX0
||
10200 (community
& 0xFFFF0000) == FOURHEXF
) {
10201 proto_tree_add_item(communities_tree
, hf_bgp_update_path_attribute_community_well_known
,
10202 tvb
, q
, 4, ENC_BIG_ENDIAN
);
10203 proto_item_append_text(ti_pa
, "%s ", val_to_str_const(community
, community_vals
, "Reserved"));
10204 proto_item_append_text(ti_communities
, "%s ", val_to_str_const(community
, community_vals
, "Reserved"));
10207 ti_community
= proto_tree_add_item(communities_tree
, hf_bgp_update_path_attribute_community
, tvb
,
10209 community_tree
= proto_item_add_subtree(ti_community
,
10210 ett_bgp_community
);
10211 proto_tree_add_item(community_tree
, hf_bgp_update_path_attribute_community_as
,
10212 tvb
, q
, 2, ENC_BIG_ENDIAN
);
10213 proto_tree_add_item(community_tree
, hf_bgp_update_path_attribute_community_value
,
10214 tvb
, q
+2, 2, ENC_BIG_ENDIAN
);
10215 proto_item_append_text(ti_pa
, "%u:%u ",tvb_get_ntohs(tvb
, q
),
10216 tvb_get_ntohs(tvb
, q
+2));
10217 proto_item_append_text(ti_communities
, "%u:%u ",tvb_get_ntohs(tvb
, q
),
10218 tvb_get_ntohs(tvb
, q
+2));
10219 proto_item_append_text(ti_community
, ": %u:%u ",tvb_get_ntohs(tvb
, q
),
10220 tvb_get_ntohs(tvb
, q
+2));
10228 case BGPTYPE_ORIGINATOR_ID
:
10230 proto_tree_add_expert_format(subtree2
, pinfo
, &ei_bgp_length_invalid
, tvb
, o
+ i
+ aoff
, tlen
,
10231 "Originator identifier (invalid): %u byte%s", tlen
,
10232 plurality(tlen
, "", "s"));
10234 proto_tree_add_item(subtree2
, hf_bgp_update_path_attribute_originator_id
, tvb
,
10235 o
+ i
+ aoff
, tlen
, ENC_BIG_ENDIAN
);
10236 proto_item_append_text(ti_pa
, ": %s ", tvb_ip_to_str(pinfo
->pool
, tvb
, o
+ i
+ aoff
));
10239 case BGPTYPE_MP_REACH_NLRI
:
10240 /* RFC 2283 says that a MP_[UN]REACH_NLRI path attribute can
10241 * have more than one <AFI, SAFI, Next Hop, ..., NLRI> tuple.
10242 * However, that doesn't work because the NLRI is also a
10243 * variable number of <length, prefix> fields without a field
10244 * for the overall length of the NLRI. Thus one would have to
10245 * guess whether a particular byte were the length of the next
10246 * prefix or a new AFI. So no one ever implemented that, and
10247 * RFC 2858, obsoleting 2283, says you can't do that.
10249 proto_tree_add_item_ret_uint(subtree2
, hf_bgp_update_path_attribute_mp_reach_nlri_address_family
, tvb
,
10250 o
+ i
+ aoff
, 2, ENC_BIG_ENDIAN
, &af
);
10251 proto_tree_add_item_ret_uint(subtree2
, hf_bgp_update_path_attribute_mp_reach_nlri_safi
, tvb
,
10252 o
+ i
+ aoff
+ 2, 1, ENC_BIG_ENDIAN
, &saf
);
10253 nexthop_len
= tvb_get_uint8(tvb
, o
+ i
+ aoff
+ 3);
10254 save_afi_safi_data(pinfo
, (uint16_t)af
, (uint8_t)saf
);
10256 decode_mp_next_hop(tvb_new_subset_length(tvb
, o
+ i
+ aoff
+ 3, nexthop_len
+ 1), subtree2
, pinfo
, af
, saf
, nexthop_len
);
10259 tlen
-= nexthop_len
+ 4;
10260 aoff
+= nexthop_len
+ 4;
10263 snpa
= tvb_get_uint8(tvb
, o
+ i
+ aoff
);
10264 ti
= proto_tree_add_item(subtree2
, hf_bgp_update_path_attribute_mp_reach_nlri_nbr_snpa
, tvb
,
10265 o
+ i
+ aoff
, 1, ENC_BIG_ENDIAN
);
10268 subtree3
= proto_item_add_subtree(ti
, ett_bgp_mp_snpa
);
10269 for (/*nothing*/; snpa
> 0; snpa
--) {
10270 uint8_t snpa_length
= tvb_get_uint8(tvb
, o
+ i
+ aoff
+ off
);
10271 proto_tree_add_item(subtree3
, hf_bgp_update_path_attribute_mp_reach_nlri_snpa_length
, tvb
,
10272 o
+ i
+ aoff
+ off
, 1, ENC_BIG_ENDIAN
);
10274 proto_tree_add_item(subtree3
, hf_bgp_update_path_attribute_mp_reach_nlri_snpa
, tvb
,
10275 o
+ i
+ aoff
+ off
, snpa_length
, ENC_NA
);
10276 off
+= snpa_length
;
10282 ti
= proto_tree_add_item(subtree2
, hf_bgp_update_path_attribute_mp_reach_nlri
, tvb
, o
+ i
+ aoff
, tlen
, ENC_NA
);
10283 subtree3
= proto_item_add_subtree(ti
, ett_bgp_mp_reach_nlri
);
10286 if (af
!= AFNUM_INET
&& af
!= AFNUM_INET6
&& af
!= AFNUM_L2VPN
&& af
!= AFNUM_BGP_LS
) {
10287 proto_tree_add_expert(subtree3
, pinfo
, &ei_bgp_unknown_afi
, tvb
, o
+ i
+ aoff
, tlen
);
10290 advance
= decode_prefix_MP(subtree3
,
10291 hf_bgp_nlri_path_id
,
10292 hf_bgp_mp_reach_nlri_ipv4_prefix
,
10293 hf_bgp_mp_reach_nlri_ipv6_prefix
,
10295 tvb
, o
+ i
+ aoff
, "MP Reach NLRI", pinfo
);
10305 case BGPTYPE_MP_UNREACH_NLRI
:
10306 af
= tvb_get_ntohs(tvb
, o
+ i
+ aoff
);
10307 proto_tree_add_item(subtree2
, hf_bgp_update_path_attribute_mp_unreach_nlri_address_family
, tvb
,
10308 o
+ i
+ aoff
, 2, ENC_BIG_ENDIAN
);
10309 saf
= tvb_get_uint8(tvb
, o
+ i
+ aoff
+ 2) ;
10310 proto_tree_add_item(subtree2
, hf_bgp_update_path_attribute_mp_unreach_nlri_safi
, tvb
,
10311 o
+ i
+ aoff
+2, 1, ENC_BIG_ENDIAN
);
10312 save_afi_safi_data(pinfo
, (uint16_t)af
, (uint8_t)saf
);
10314 ti
= proto_tree_add_item(subtree2
, hf_bgp_update_path_attribute_mp_unreach_nlri
, tvb
, o
+ i
+ aoff
+ 3, tlen
- 3, ENC_NA
);
10315 subtree3
= proto_item_add_subtree(ti
, ett_bgp_mp_unreach_nlri
);
10323 advance
= decode_prefix_MP(subtree3
,
10324 hf_bgp_nlri_path_id
,
10325 hf_bgp_mp_unreach_nlri_ipv4_prefix
,
10326 hf_bgp_mp_unreach_nlri_ipv6_prefix
,
10328 tvb
, o
+ i
+ aoff
, "MP Unreach NLRI", pinfo
);
10337 case BGPTYPE_CLUSTER_LIST
:
10338 if (tlen
% 4 != 0) {
10339 proto_tree_add_expert_format(subtree2
, pinfo
, &ei_bgp_length_invalid
, tvb
, o
+ i
+ aoff
, tlen
,
10340 "Cluster list (invalid): %u byte%s", tlen
,
10341 plurality(tlen
, "", "s"));
10345 ti
= proto_tree_add_item(subtree2
, hf_bgp_update_path_attribute_cluster_list
,
10346 tvb
, o
+ i
+ aoff
, tlen
, ENC_NA
);
10347 cluster_list_tree
= proto_item_add_subtree(ti
,
10348 ett_bgp_cluster_list
);
10350 /* (o + i + aoff) =
10351 (o + current attribute + aoff bytes to first tuple) */
10354 proto_item_append_text(ti
, ":");
10355 proto_item_append_text(ti_pa
, ":");
10356 /* snarf each cluster identifier */
10358 proto_tree_add_item(cluster_list_tree
, hf_bgp_update_path_attribute_cluster_id
,
10359 tvb
, q
- 3 + aoff
, 4, ENC_NA
);
10360 proto_item_append_text(ti
, " %s", tvb_ip_to_str(pinfo
->pool
, tvb
, q
-3+aoff
));
10361 proto_item_append_text(ti_pa
, " %s", tvb_ip_to_str(pinfo
->pool
, tvb
, q
-3+aoff
));
10366 case BGPTYPE_EXTENDED_COMMUNITY
:
10367 if (tlen
%8 != 0) {
10368 expert_add_info_format(pinfo
, attr_len_item
, &ei_bgp_ext_com_len_bad
,
10369 "Community length %u wrong, must be modulo 8", tlen
);
10371 dissect_bgp_update_ext_com(subtree2
, tvb
, tlen
, o
+i
+aoff
, pinfo
);
10374 case BGPTYPE_SAFI_SPECIFIC_ATTR
:
10376 end
= o
+ i
+ aoff
+ tlen
;
10379 ssa_type
= tvb_get_ntohs(tvb
, q
) & BGP_SSA_TYPE
;
10380 ssa_len
= tvb_get_ntohs(tvb
, q
+ 2);
10382 subtree3
= proto_tree_add_subtree_format(subtree2
, tvb
, q
, MIN(ssa_len
+ 4, end
- q
),
10383 ett_bgp_ssa
, NULL
, "%s Information",
10384 val_to_str_const(ssa_type
, bgp_ssa_type
, "Unknown SSA"));
10386 proto_tree_add_item(subtree3
, hf_bgp_ssa_t
, tvb
,
10387 q
, 1, ENC_BIG_ENDIAN
);
10388 proto_tree_add_item(subtree3
, hf_bgp_ssa_type
, tvb
, q
, 2, ENC_BIG_ENDIAN
);
10390 proto_tree_add_item(subtree3
, hf_bgp_ssa_len
, tvb
, q
+ 2, 2, ENC_BIG_ENDIAN
);
10392 if ((ssa_len
== 0) || (q
+ ssa_len
> end
)) {
10393 proto_tree_add_expert_format(subtree3
, pinfo
, &ei_bgp_length_invalid
, tvb
, q
+ 2,
10394 end
- q
- 2, "Invalid Length of %u", ssa_len
);
10398 switch (ssa_type
) {
10399 case BGP_SSA_L2TPv3
:
10400 proto_tree_add_item(subtree3
, hf_bgp_ssa_l2tpv3_pref
, tvb
,
10401 q
+ 4, 2, ENC_BIG_ENDIAN
);
10403 subtree4
= proto_tree_add_subtree(subtree3
, tvb
, q
+ 6, 1, ett_bgp_ssa_subtree
, NULL
, "Flags");
10404 proto_tree_add_item(subtree4
, hf_bgp_ssa_l2tpv3_s
, tvb
,
10405 q
+ 6, 1, ENC_BIG_ENDIAN
);
10406 proto_tree_add_item(subtree4
, hf_bgp_ssa_l2tpv3_unused
, tvb
,
10407 q
+ 6, 1, ENC_BIG_ENDIAN
);
10409 ssa_v3_len
= tvb_get_uint8(tvb
, q
+ 7);
10410 if (ssa_v3_len
+ 8 == ssa_len
){
10411 proto_tree_add_item(subtree3
, hf_bgp_ssa_l2tpv3_cookie_len
, tvb
,
10412 q
+ 7, 1, ENC_BIG_ENDIAN
);
10414 proto_tree_add_expert_format(subtree3
, pinfo
, &ei_bgp_length_invalid
, tvb
, q
+ 7, 1,
10415 "Invalid Cookie Length of %u", ssa_v3_len
);
10416 q
+= ssa_len
+ 4; /* 4 from type and length */
10419 proto_tree_add_item(subtree3
, hf_bgp_ssa_l2tpv3_session_id
, tvb
,
10420 q
+ 8, 4, ENC_BIG_ENDIAN
);
10422 proto_tree_add_item(subtree3
, hf_bgp_ssa_l2tpv3_cookie
, tvb
,
10423 q
+ 12, ssa_v3_len
, ENC_NA
);
10424 q
+= ssa_len
+ 4; /* 4 from type and length */
10427 case BGP_SSA_IPSec
:
10430 proto_tree_add_item(subtree3
, hf_bgp_ssa_value
, tvb
,
10431 q
+ 4, ssa_len
, ENC_NA
);
10432 q
+= ssa_len
+ 4; /* 4 from type and length */
10434 case BGP_SSA_L2TPv3_IN_IPSec
:
10435 case BGP_SSA_mGRE_IN_IPSec
:
10436 /* These contain BGP_SSA_IPSec and BGP_SSA_L2TPv3/BGP_SSA_mGRE */
10437 q
+= 4; /* 4 from type and length */
10439 } /* switch (bgpa.bgpa_type) */
10442 case BGPTYPE_TUNNEL_ENCAPS_ATTR
:
10444 end
= o
+ i
+ aoff
+ tlen
;
10446 subtree3
= proto_tree_add_subtree(subtree2
, tvb
, q
, tlen
, ett_bgp_tunnel_tlv
, NULL
, "TLV Encodings");
10449 encaps_tunnel_type
= tvb_get_ntohs(tvb
, q
);
10450 encaps_tunnel_len
= tvb_get_ntohs(tvb
, q
+ 2);
10452 subtree4
= proto_tree_add_subtree_format(subtree3
, tvb
, q
, encaps_tunnel_len
+ 4,
10453 ett_bgp_tunnel_tlv_subtree
, NULL
, "%s (%u bytes)",
10454 val_to_str_const(encaps_tunnel_type
, bgp_attr_tunnel_type
, "Unknown"), encaps_tunnel_len
+ 4);
10456 proto_tree_add_item(subtree4
, hf_bgp_update_encaps_tunnel_tlv_type
, tvb
, q
, 2, ENC_BIG_ENDIAN
);
10457 proto_tree_add_item(subtree4
, hf_bgp_update_encaps_tunnel_tlv_len
, tvb
, q
+ 2, 2, ENC_BIG_ENDIAN
);
10459 subtree5
= proto_tree_add_subtree(subtree4
, tvb
, q
+ 4, encaps_tunnel_len
, ett_bgp_tunnel_subtlv
, NULL
, "Sub-TLV Encodings");
10462 j
= q
+ encaps_tunnel_len
;
10464 encaps_tunnel_subtype
= tvb_get_uint8(tvb
, q
);
10465 if (encaps_tunnel_subtype
< 128) {
10466 encaps_tunnel_sublen
= tvb_get_uint8(tvb
, q
+ 1);
10467 encaps_tunnel_sub_totallen
= encaps_tunnel_sublen
+ 2;
10469 encaps_tunnel_sublen
= tvb_get_ntohs(tvb
, q
+ 1);
10470 encaps_tunnel_sub_totallen
= encaps_tunnel_sublen
+ 3;
10472 subtree6
= proto_tree_add_subtree_format(subtree5
, tvb
, q
, encaps_tunnel_sub_totallen
,
10473 ett_bgp_tunnel_tlv_subtree
, NULL
, "%s (%u bytes)",
10474 val_to_str_const(encaps_tunnel_subtype
, subtlv_type
, "Unknown"), encaps_tunnel_sub_totallen
);
10475 proto_tree_add_item(subtree6
, hf_bgp_update_encaps_tunnel_subtlv_type
, tvb
, q
, 1, ENC_BIG_ENDIAN
);
10477 if (encaps_tunnel_subtype
< 128) {
10478 proto_tree_add_item(subtree6
, hf_bgp_update_encaps_tunnel_subtlv_len
, tvb
, q
, 1, ENC_BIG_ENDIAN
);
10481 proto_tree_add_item(subtree6
, hf_bgp_update_encaps_tunnel_subtlv_len
, tvb
, q
, 2, ENC_BIG_ENDIAN
);
10485 switch (encaps_tunnel_subtype
) {
10486 case TUNNEL_SUBTLV_ENCAPSULATION
:
10488 static int * const vxlan_flags
[] = {
10489 &hf_bgp_update_encaps_tunnel_subtlv_vxlan_flags_valid_vnid
,
10490 &hf_bgp_update_encaps_tunnel_subtlv_vxlan_flags_valid_mac
,
10491 &hf_bgp_update_encaps_tunnel_subtlv_vxlan_flags_reserved
,
10494 static int * const vxlan_gpe_flags
[] = {
10495 &hf_bgp_update_encaps_tunnel_subtlv_vxlan_gpe_flags_version
,
10496 &hf_bgp_update_encaps_tunnel_subtlv_vxlan_gpe_flags_valid_vnid
,
10497 &hf_bgp_update_encaps_tunnel_subtlv_vxlan_gpe_flags_reserved
,
10500 static int * const nvgre_flags
[] = {
10501 &hf_bgp_update_encaps_tunnel_subtlv_nvgre_flags_valid_vnid
,
10502 &hf_bgp_update_encaps_tunnel_subtlv_nvgre_flags_valid_mac
,
10503 &hf_bgp_update_encaps_tunnel_subtlv_nvgre_flags_reserved
,
10506 if (encaps_tunnel_type
== TUNNEL_TYPE_L2TP_OVER_IP
) {
10507 proto_tree_add_item(subtree6
, hf_bgp_update_encaps_tunnel_subtlv_session_id
, tvb
, q
, 4, ENC_BIG_ENDIAN
);
10509 proto_tree_add_item(subtree6
, hf_bgp_update_encaps_tunnel_subtlv_cookie
, tvb
, q
, encaps_tunnel_sublen
- 4, ENC_NA
);
10510 q
+= (encaps_tunnel_sublen
- 4);
10511 } else if (encaps_tunnel_type
== TUNNEL_TYPE_GRE
|| encaps_tunnel_type
== TUNNEL_TYPE_MPLS_IN_GRE
) {
10512 proto_tree_add_item(subtree6
, hf_bgp_update_encaps_tunnel_subtlv_gre_key
, tvb
, q
, 4, ENC_BIG_ENDIAN
);
10514 } else if (encaps_tunnel_type
== TUNNEL_TYPE_VXLAN
) {
10515 proto_tree_add_bitmask(subtree6
, tvb
, q
, hf_bgp_update_encaps_tunnel_subtlv_vxlan_flags
,
10516 ett_bgp_vxlan
, vxlan_flags
, ENC_BIG_ENDIAN
);
10518 proto_tree_add_item(subtree6
, hf_bgp_update_encaps_tunnel_subtlv_vxlan_vnid
, tvb
, q
, 3, ENC_BIG_ENDIAN
);
10520 proto_tree_add_item(subtree6
, hf_bgp_update_encaps_tunnel_subtlv_vxlan_mac
, tvb
, q
, 6, ENC_NA
);
10522 proto_tree_add_item(subtree6
, hf_bgp_update_encaps_tunnel_subtlv_vxlan_reserved
, tvb
, q
, 2, ENC_BIG_ENDIAN
);
10524 } else if (encaps_tunnel_type
== TUNNEL_TYPE_VXLAN_GPE
) {
10525 proto_tree_add_bitmask(subtree6
, tvb
, q
, hf_bgp_update_encaps_tunnel_subtlv_vxlan_gpe_flags
,
10526 ett_bgp_vxlan
, vxlan_gpe_flags
, ENC_BIG_ENDIAN
);
10528 proto_tree_add_item(subtree6
, hf_bgp_update_encaps_tunnel_subtlv_vxlan_gpe_reserved
, tvb
, q
, 2, ENC_BIG_ENDIAN
);
10530 proto_tree_add_item(subtree6
, hf_bgp_update_encaps_tunnel_subtlv_vxlan_gpe_vnid
, tvb
, q
, 3, ENC_BIG_ENDIAN
);
10532 proto_tree_add_item(subtree6
, hf_bgp_update_encaps_tunnel_subtlv_vxlan_gpe_reserved
, tvb
, q
, 1, ENC_BIG_ENDIAN
);
10534 } else if (encaps_tunnel_type
== TUNNEL_TYPE_NVGRE
) {
10535 proto_tree_add_bitmask(subtree6
, tvb
, q
, hf_bgp_update_encaps_tunnel_subtlv_nvgre_flags
,
10536 ett_bgp_vxlan
, nvgre_flags
, ENC_BIG_ENDIAN
);
10538 proto_tree_add_item(subtree6
, hf_bgp_update_encaps_tunnel_subtlv_nvgre_vnid
, tvb
, q
, 3, ENC_BIG_ENDIAN
);
10540 proto_tree_add_item(subtree6
, hf_bgp_update_encaps_tunnel_subtlv_nvgre_mac
, tvb
, q
, 6, ENC_NA
);
10542 proto_tree_add_item(subtree6
, hf_bgp_update_encaps_tunnel_subtlv_nvgre_reserved
, tvb
, q
, 2, ENC_BIG_ENDIAN
);
10547 case TUNNEL_SUBTLV_PROTO_TYPE
:
10548 proto_tree_add_item(subtree6
, hf_bgp_update_encaps_tunnel_subtlv_gre_key
, tvb
, q
, 2, ENC_BIG_ENDIAN
);
10551 case TUNNEL_SUBTLV_COLOR
:
10552 proto_tree_add_item(subtree6
, hf_bgp_update_encaps_tunnel_subtlv_color_value
, tvb
, q
, 4, ENC_BIG_ENDIAN
);
10555 case TUNNEL_SUBTLV_LOAD_BALANCE
:
10556 if (encaps_tunnel_type
== TUNNEL_TYPE_L2TP_OVER_IP
|| encaps_tunnel_type
== TUNNEL_TYPE_GRE
) {
10557 proto_tree_add_item(subtree6
, hf_bgp_update_encaps_tunnel_subtlv_lb_block_length
, tvb
, q
, 4, ENC_BIG_ENDIAN
);
10561 case TUNNEL_SUBTLV_PREFERENCE
:
10562 proto_tree_add_item(subtree6
, hf_bgp_update_encaps_tunnel_subtlv_pref_flags
, tvb
, q
, 1, ENC_BIG_ENDIAN
);
10564 proto_tree_add_item(subtree6
, hf_bgp_update_encaps_tunnel_subtlv_pref_reserved
, tvb
, q
, 1, ENC_BIG_ENDIAN
);
10566 proto_tree_add_item(subtree6
, hf_bgp_update_encaps_tunnel_subtlv_pref_preference
, tvb
, q
, 4, ENC_NA
);
10569 case TUNNEL_SUBTLV_BINDING_SID
:
10571 static int * const flags
[] = {
10572 &hf_bgp_update_encaps_tunnel_subtlv_binding_sid_flags_specified
,
10573 &hf_bgp_update_encaps_tunnel_subtlv_binding_sid_flags_invalid
,
10574 &hf_bgp_update_encaps_tunnel_subtlv_binding_sid_flags_reserved
,
10578 proto_tree_add_bitmask(subtree6
, tvb
, q
, hf_bgp_update_encaps_tunnel_subtlv_binding_sid_flags
,
10579 ett_bgp_binding_sid
, flags
, ENC_BIG_ENDIAN
);
10581 proto_tree_add_item(subtree6
, hf_bgp_update_encaps_tunnel_subtlv_binding_sid_reserved
,
10582 tvb
, q
, 1, ENC_BIG_ENDIAN
);
10584 if (encaps_tunnel_sublen
> 2) {
10585 proto_tree_add_item(subtree6
, hf_bgp_update_encaps_tunnel_subtlv_binding_sid_sid
, tvb
, q
,
10586 encaps_tunnel_sublen
- 2, ENC_NA
);
10587 q
+= (encaps_tunnel_sublen
- 2);
10591 case TUNNEL_SUBTLV_ENLP
:
10592 proto_tree_add_item(subtree6
, hf_bgp_update_encaps_tunnel_subtlv_enlp_flags
, tvb
, q
, 1, ENC_BIG_ENDIAN
);
10594 proto_tree_add_item(subtree6
, hf_bgp_update_encaps_tunnel_subtlv_enlp_reserved
, tvb
, q
, 1, ENC_BIG_ENDIAN
);
10596 proto_tree_add_item(subtree6
, hf_bgp_update_encaps_tunnel_subtlv_enlp_enlp
, tvb
, q
, 1, ENC_BIG_ENDIAN
);
10599 case TUNNEL_SUBTLV_PRIORITY
:
10600 proto_tree_add_item(subtree6
, hf_bgp_update_encaps_tunnel_subtlv_priority_priority
, tvb
, q
, 1, ENC_BIG_ENDIAN
);
10602 proto_tree_add_item(subtree6
, hf_bgp_update_encaps_tunnel_subtlv_priority_reserved
, tvb
, q
, 1, ENC_BIG_ENDIAN
);
10605 case TUNNEL_SUBTLV_SEGMENT_LIST
:
10607 static int * const flags
[] = {
10608 &hf_bgp_update_encaps_tunnel_subtlv_segment_list_subtlv_flags_verification
,
10609 &hf_bgp_update_encaps_tunnel_subtlv_segment_list_subtlv_flags_algorithm
,
10610 &hf_bgp_update_encaps_tunnel_subtlv_segment_list_subtlv_flags_reserved
,
10614 proto_tree_add_item(subtree6
, hf_bgp_update_encaps_tunnel_subtlv_segment_list_reserved
, tvb
, q
, 1, ENC_BIG_ENDIAN
);
10616 ti
= proto_tree_add_item(subtree6
, hf_bgp_update_encaps_tunnel_subtlv_segment_list_subtlv
, tvb
, q
,
10617 encaps_tunnel_sublen
- 1, ENC_NA
);
10618 encaps_tunnel_sublen
-= 1;
10619 subtree7
= proto_item_add_subtree(ti
, ett_bgp_segment_list
);
10620 while (encaps_tunnel_sublen
> 2) {
10621 segment_subtlv_type
= tvb_get_uint8(tvb
, q
);
10622 segment_subtlv_length
= tvb_get_uint8(tvb
, q
+ 1);
10623 subtree8
= proto_tree_add_subtree_format(subtree7
, tvb
, q
, segment_subtlv_length
+ 2,
10624 ett_bgp_segment_list
, NULL
, "SubTLV: %s", val_to_str_const(segment_subtlv_type
,
10625 bgp_sr_policy_list_type
, "Unknown"));
10626 proto_tree_add_item(subtree8
, hf_bgp_update_encaps_tunnel_subtlv_segment_list_subtlv_type
, tvb
, q
, 1, ENC_BIG_ENDIAN
);
10628 proto_tree_add_item(subtree8
, hf_bgp_update_encaps_tunnel_subtlv_segment_list_subtlv_length
, tvb
, q
, 1, ENC_BIG_ENDIAN
);
10630 if (segment_subtlv_length
> 0) {
10631 switch(segment_subtlv_type
) {
10632 /* TODO: Dissect further subTLVs data as defined in draft-ietf-idr-segment-routing-te-policy-08 section 2.4.3.2 */
10633 case TUNNEL_SUBTLV_SEGMENT_LIST_SUB_TYPE_A
:
10634 proto_tree_add_bitmask(subtree8
, tvb
, q
, hf_bgp_update_encaps_tunnel_subtlv_segment_list_subtlv_flags
,
10635 ett_bgp_segment_list
, flags
, ENC_BIG_ENDIAN
);
10637 proto_tree_add_item(subtree8
, hf_bgp_update_encaps_tunnel_subtlv_segment_list_subtlv_reserved
,
10638 tvb
, q
, 1, ENC_NA
);
10640 proto_tree_add_item(subtree8
, hf_bgp_update_encaps_tunnel_subtlv_segment_list_subtlv_mpls_label
,
10641 tvb
, q
, 3, ENC_BIG_ENDIAN
);
10642 proto_tree_add_item(subtree8
, hf_bgp_update_encaps_tunnel_subtlv_segment_list_subtlv_traffic_class
,
10643 tvb
, q
, 3, ENC_BIG_ENDIAN
);
10644 proto_tree_add_item(subtree8
, hf_bgp_update_encaps_tunnel_subtlv_segment_list_subtlv_bottom_stack
,
10645 tvb
, q
, 3, ENC_BIG_ENDIAN
);
10647 proto_tree_add_item(subtree8
, hf_bgp_update_encaps_tunnel_subtlv_segment_list_subtlv_ttl
,
10648 tvb
, q
, 1, ENC_BIG_ENDIAN
);
10652 proto_tree_add_item(subtree8
, hf_bgp_update_encaps_tunnel_subtlv_segment_list_subtlv_data
,
10653 tvb
, q
, segment_subtlv_length
, ENC_NA
);
10654 q
+= segment_subtlv_length
;
10658 encaps_tunnel_sublen
-= (segment_subtlv_length
+ 2);
10662 case TUNNEL_SUBTLV_POLICY_NAME
:
10663 proto_tree_add_item(subtree6
, hf_bgp_update_encaps_tunnel_subtlv_policy_name_reserved
, tvb
, q
, 1, ENC_BIG_ENDIAN
);
10665 proto_tree_add_item(subtree6
, hf_bgp_update_encaps_tunnel_subtlv_policy_name_name
, tvb
, q
,
10666 encaps_tunnel_sublen
- 1, ENC_ASCII
);
10667 q
+= (encaps_tunnel_sublen
- 1);
10670 proto_tree_add_item(subtree6
, hf_bgp_update_encaps_tunnel_subtlv_value
, tvb
, q
, encaps_tunnel_sublen
, ENC_NA
);
10671 q
+= encaps_tunnel_sublen
;
10673 } /* switch (encaps_tunnel_subtype) */
10679 ti
= proto_tree_add_item(subtree2
, hf_bgp_update_path_attribute_aigp
, tvb
, q
, tlen
, ENC_NA
);
10680 subtree3
= proto_item_add_subtree(ti
, ett_bgp_aigp_attr
);
10681 aigp_type_item
= proto_tree_add_item(subtree3
, hf_bgp_aigp_type
, tvb
, q
, 1, ENC_BIG_ENDIAN
);
10682 aigp_type
= tvb_get_uint8(tvb
,q
);
10683 switch (aigp_type
) {
10684 case AIGP_TLV_TYPE
:
10685 proto_tree_add_item(subtree3
, hf_bgp_aigp_tlv_length
, tvb
, q
+1, 2, ENC_BIG_ENDIAN
);
10686 proto_tree_add_item(subtree3
, hf_bgp_aigp_accu_igp_metric
, tvb
, q
+3, 8, ENC_BIG_ENDIAN
);
10687 proto_item_append_text(ti
, ": %" PRIu64
, tvb_get_ntoh64(tvb
, q
+3));
10688 proto_item_append_text(ti_pa
, ": %" PRIu64
, tvb_get_ntoh64(tvb
, q
+3));
10691 expert_add_info_format(pinfo
, aigp_type_item
, &ei_bgp_attr_aigp_type
,
10692 "AIGP type %u unknown", aigp_type
);
10695 case BGPTYPE_LINK_STATE_ATTR
:
10696 case BGPTYPE_LINK_STATE_OLD_ATTR
:
10698 end
= o
+ i
+ aoff
+ tlen
;
10699 /* FF: BGPTYPE_LINK_STATE_ATTR body dissection is moved after the while.
10700 Here we just save the TLV coordinates and the subtree. */
10701 save_link_state_attr_position(pinfo
, q
, end
, tlen
, subtree2
);
10704 case BGPTYPE_LARGE_COMMUNITY
:
10705 if(tlen
== 0 || tlen
% 12){
10710 wmem_strbuf_t
*comm_strbuf
;
10711 comm_strbuf
= wmem_strbuf_create(pinfo
->pool
);
10713 uint32_t ga
, ldp1
, ldp2
;
10714 ga
= tvb_get_ntohl(tvb
, q
);
10715 ldp1
= tvb_get_ntohl(tvb
, q
+4);
10716 ldp2
= tvb_get_ntohl(tvb
, q
+8);
10717 ti
= proto_tree_add_string_format(subtree2
, hf_bgp_large_communities
, tvb
, q
, 12, NULL
, "Large communities: %u:%u:%u", ga
, ldp1
, ldp2
);
10718 subtree3
= proto_item_add_subtree(ti
, ett_bgp_large_communities
);
10719 proto_tree_add_item(subtree3
, hf_bgp_large_communities_ga
, tvb
,
10720 q
, 4, ENC_BIG_ENDIAN
);
10721 proto_tree_add_item(subtree3
, hf_bgp_large_communities_ldp1
, tvb
,
10722 q
+ 4, 4, ENC_BIG_ENDIAN
);
10723 proto_tree_add_item(subtree3
, hf_bgp_large_communities_ldp2
, tvb
,
10724 q
+ 8, 4, ENC_BIG_ENDIAN
);
10725 wmem_strbuf_append_printf(comm_strbuf
, " %u:%u:%u", ga
, ldp1
, ldp2
);
10729 proto_item_append_text(ti_pa
, ":%s", wmem_strbuf_get_str(comm_strbuf
));
10732 case BGPTYPE_BGPSEC_PATH
:
10735 secpathlen
= tvb_get_ntohs(tvb
, q
); /* Secure Path Length */
10737 if (((secpathlen
- 2) % SEC_PATH_SEG_SIZE
) != 0) { /* SEC_PATH_SEG_SIZE = 6 */
10738 proto_tree_add_expert_format(subtree2
, pinfo
, &ei_bgp_length_invalid
, tvb
, o
+ i
+ aoff
, alen
,
10739 "Invalid BGPsec Secure Path length: %u bytes", secpathlen
);
10742 subtree3
= proto_tree_add_subtree_format(subtree2
, tvb
, q
, secpathlen
,
10743 ett_bgp_bgpsec_secure_path
,
10745 "Secure Path (%d byte%s)",
10747 plurality(secpathlen
, "", "s"));
10749 /* Secure Path Length */
10750 proto_tree_add_item(subtree3
, hf_bgp_update_path_attribute_bgpsec_sp_len
, tvb
, q
, 2, ENC_BIG_ENDIAN
);
10753 secpathcount
= (secpathlen
- 2) / SEC_PATH_SEG_SIZE
; /* Amount of Secure Path Segments */
10755 while (j
< secpathcount
) {
10756 subtree4
= proto_tree_add_subtree_format(subtree3
, tvb
, q
, SEC_PATH_SEG_SIZE
,
10757 ett_bgp_bgpsec_secure_path_segment
,
10759 "Secure Path Segment (%d byte%s)",
10761 plurality(SEC_PATH_SEG_SIZE
, "", "s"));
10764 proto_tree_add_item(subtree4
, hf_bgp_update_path_attribute_bgpsec_sps_pcount
, tvb
,
10765 q
, 1, ENC_BIG_ENDIAN
);
10769 proto_tree_add_item(subtree4
, hf_bgp_update_path_attribute_bgpsec_sps_flags
, tvb
,
10770 q
, 1, ENC_BIG_ENDIAN
);
10774 proto_tree_add_item(subtree4
, hf_bgp_update_path_attribute_bgpsec_sps_as
, tvb
,
10775 q
, 4, ENC_BIG_ENDIAN
);
10780 sigblocklen
= tvb_get_ntohs(tvb
, q
); /* Signature Block Length */
10782 subtree3
= proto_tree_add_subtree_format(subtree2
, tvb
, q
, sigblocklen
,
10783 ett_bgp_bgpsec_signature_block
,
10785 "Signature Block (%d byte%s)",
10787 plurality(sigblocklen
, "", "s"));
10789 /* Signature Block Length */
10790 proto_tree_add_item(subtree3
, hf_bgp_update_path_attribute_bgpsec_sb_len
, tvb
, q
, 2, ENC_BIG_ENDIAN
);
10793 /* Algorithm Suite ID */
10794 proto_tree_add_item(subtree3
, hf_bgp_update_path_attribute_bgpsec_algo_id
, tvb
, q
, 1, ENC_BIG_ENDIAN
);
10798 sig_len
= tvb_get_ntohs(tvb
, q
+20); /* Signature Length of current Segment */
10800 subtree4
= proto_tree_add_subtree_format(subtree3
, tvb
, q
, 22+sig_len
,
10801 ett_bgp_bgpsec_signature_segment
,
10803 "Signature Segment (%d byte%s)",
10805 plurality(22+sig_len
, "", "s"));
10807 /* Subject Key Identifier */
10808 proto_tree_add_item(subtree4
, hf_bgp_update_path_attribute_bgpsec_ski
, tvb
,
10812 /* Signature Length */
10813 proto_tree_add_item(subtree4
, hf_bgp_update_path_attribute_bgpsec_sig_len
, tvb
,
10814 q
, 2, ENC_BIG_ENDIAN
);
10818 proto_tree_add_item(subtree4
, hf_bgp_update_path_attribute_bgpsec_sig
, tvb
,
10819 q
, sig_len
, ENC_NA
);
10824 case BGPTYPE_BGP_PREFIX_SID
:
10827 proto_item
*tlv_item
, *stlv_item
, *sstlv_item
;
10828 proto_tree
*tlv_tree
, *stlv_tree
, *sstlv_tree
;
10829 proto_item
*srgb_tlv_item
;
10830 proto_tree
*srgb_tlv_tree
;
10831 proto_item
*srv6_stlv_item
;
10832 proto_tree
*srv6_stlv_tree
;
10833 proto_item
*srv6_data_sstlv_item
;
10834 proto_tree
*srv6_data_sstlv_tree
;
10835 int sub_pnt
, sub_end
;
10836 int sub_sub_pnt
, sub_sub_end
;
10838 prefix_sid_subtype
= tvb_get_uint8(tvb
, q
);
10839 prefix_sid_sublen
= tvb_get_ntohs(tvb
, q
+ 1);
10840 switch (prefix_sid_subtype
) {
10841 case BGP_PREFIX_SID_TLV_LABEL_INDEX
:
10842 tlv_item
= proto_tree_add_item(subtree2
, hf_bgp_prefix_sid_label_index
, tvb
, q
, prefix_sid_sublen
+ 3, ENC_NA
);
10843 tlv_tree
= proto_item_add_subtree(tlv_item
, ett_bgp_prefix_sid_label_index
);
10844 proto_tree_add_item(tlv_tree
, hf_bgp_prefix_sid_type
, tvb
, q
, 1, ENC_BIG_ENDIAN
);
10845 proto_tree_add_item(tlv_tree
, hf_bgp_prefix_sid_length
, tvb
, q
+ 1, 2, ENC_BIG_ENDIAN
);
10846 if (prefix_sid_sublen
!= BGP_PREFIX_SID_TLV_LEN_LABEL_INDEX
){
10847 proto_tree_add_expert_format(subtree2
, pinfo
, &ei_bgp_length_invalid
, tvb
, o
+ i
+ aoff
, alen
,
10848 "Invalid BGP Prefix-SID Label Index length: %u bytes", prefix_sid_sublen
);
10849 q
+= 3 + prefix_sid_sublen
;
10852 proto_tree_add_item(tlv_tree
, hf_bgp_prefix_sid_reserved
, tvb
, q
+ 3, 1, ENC_NA
);
10853 proto_tree_add_item(tlv_tree
, hf_bgp_prefix_sid_label_index_flags
, tvb
, q
+ 4, 2, ENC_BIG_ENDIAN
);
10854 proto_tree_add_item(tlv_tree
, hf_bgp_prefix_sid_label_index_value
, tvb
, q
+ 6, 4, ENC_BIG_ENDIAN
);
10855 proto_item_append_text(tlv_tree
, ": %u ", tvb_get_ntohl(tvb
, q
+ 6));
10858 case BGP_PREFIX_SID_TLV_ORIGINATOR_SRGB
:
10859 check_srgb
= prefix_sid_sublen
- 2;
10860 prefix_sid_sub_tlv_offset
= 0;
10861 tlv_item
= proto_tree_add_item(subtree2
, hf_bgp_prefix_sid_originator_srgb
, tvb
, q
, prefix_sid_sublen
+ 3, ENC_NA
);
10862 tlv_tree
= proto_item_add_subtree(tlv_item
, ett_bgp_prefix_sid_originator_srgb
);
10863 proto_tree_add_item(tlv_tree
, hf_bgp_prefix_sid_type
, tvb
, q
, 1, ENC_BIG_ENDIAN
);
10864 proto_tree_add_item(tlv_tree
, hf_bgp_prefix_sid_length
, tvb
, q
+ 1, 2, ENC_BIG_ENDIAN
);
10865 if(check_srgb
% 3 || check_srgb
% 2){
10866 proto_tree_add_expert_format(subtree2
, pinfo
, &ei_bgp_length_invalid
, tvb
, o
+ i
+ aoff
, alen
,
10867 "Invalid BGP Prefix-SID SRGB Originator length: %u bytes", prefix_sid_sublen
);
10868 q
+= 3 + prefix_sid_sublen
;
10871 proto_tree_add_item(tlv_tree
, hf_bgp_prefix_sid_originator_srgb_flags
, tvb
, q
+ 3, 2, ENC_BIG_ENDIAN
);
10873 tlv_item
= proto_tree_add_item(tlv_tree
, hf_bgp_prefix_sid_originator_srgb_blocks
, tvb
, q
, prefix_sid_sublen
- 2, ENC_NA
);
10874 tlv_tree
= proto_item_add_subtree(tlv_item
, ett_bgp_prefix_sid_originator_srgb_blocks
);
10875 while (prefix_sid_sublen
> prefix_sid_sub_tlv_offset
+ 2) {
10876 srgb_tlv_item
= proto_tree_add_item(tlv_tree
, hf_bgp_prefix_sid_originator_srgb_block
, tvb
, q
, prefix_sid_sublen
- 2, ENC_NA
);
10877 srgb_tlv_tree
= proto_item_add_subtree(srgb_tlv_item
, ett_bgp_prefix_sid_originator_srgb_block
);
10878 prefix_sid_sub_tlv_offset
+= 3;
10879 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
);
10880 prefix_sid_sub_tlv_offset
+= 3;
10881 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
);
10882 proto_item_append_text(srgb_tlv_tree
, "(%u:%u)", tvb_get_ntoh24(tvb
, q
+ prefix_sid_sub_tlv_offset
- 3),
10883 tvb_get_ntoh24(tvb
, q
+ prefix_sid_sub_tlv_offset
));
10885 q
+= 3 + prefix_sid_sublen
;
10887 case BGP_PREFIX_SID_TLV_SRV6_L3_SERVICE
:
10888 tlv_item
= proto_tree_add_item(subtree2
, hf_bgp_prefix_sid_srv6_l3vpn
, tvb
, q
, prefix_sid_sublen
+ 3, ENC_NA
);
10889 tlv_tree
= proto_item_add_subtree(tlv_item
, ett_bgp_prefix_sid_srv6_l3vpn
);
10890 proto_tree_add_item(tlv_tree
, hf_bgp_prefix_sid_type
, tvb
, q
, 1, ENC_BIG_ENDIAN
);
10891 proto_tree_add_item(tlv_tree
, hf_bgp_prefix_sid_length
, tvb
, q
+ 1, 2, ENC_BIG_ENDIAN
);
10892 proto_tree_add_item(tlv_tree
, hf_bgp_prefix_sid_reserved
, tvb
, q
+ 3, 1, ENC_NA
);
10894 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
);
10895 srv6_stlv_tree
= proto_item_add_subtree(srv6_stlv_item
, ett_bgp_prefix_sid_srv6_l3vpn_sub_tlvs
);
10898 sub_end
= q
+ 3 + prefix_sid_sublen
;
10899 while (sub_pnt
< sub_end
) {
10900 srv6_service_subtlv_type
= tvb_get_uint8(tvb
, sub_pnt
);
10901 srv6_service_subtlv_len
= tvb_get_ntohs(tvb
, sub_pnt
+ 1);
10903 switch (srv6_service_subtlv_type
) {
10904 case SRV6_SERVICE_SRV6_SID_INFORMATION
:
10905 stlv_item
= proto_tree_add_item(srv6_stlv_tree
,
10906 hf_bgp_prefix_sid_srv6_l3vpn_sub_tlv
,
10907 tvb
, sub_pnt
, srv6_service_subtlv_len
+ 3, ENC_NA
);
10908 proto_item_append_text(stlv_item
, " - %s",
10909 val_to_str(srv6_service_subtlv_type
, srv6_service_sub_tlv_type
, "Unknown (%u)"));
10910 stlv_tree
= proto_item_add_subtree(stlv_item
, ett_bgp_prefix_sid_srv6_l3vpn_sid_information
);
10912 proto_tree_add_item(stlv_tree
, hf_bgp_prefix_sid_srv6_l3vpn_sub_tlv_type
, tvb
, sub_pnt
, 1, ENC_BIG_ENDIAN
);
10913 proto_tree_add_item(stlv_tree
, hf_bgp_prefix_sid_srv6_l3vpn_sub_tlv_length
, tvb
, sub_pnt
+ 1, 2, ENC_BIG_ENDIAN
);
10914 proto_tree_add_item(stlv_tree
, hf_bgp_prefix_sid_srv6_l3vpn_sub_tlv_reserved
, tvb
, sub_pnt
+ 3, 1, ENC_NA
);
10915 proto_tree_add_item(stlv_tree
, hf_bgp_prefix_sid_srv6_l3vpn_sid_value
, tvb
, sub_pnt
+ 4, 16, ENC_NA
);
10916 proto_tree_add_item(stlv_tree
, hf_bgp_prefix_sid_srv6_l3vpn_sid_flags
, tvb
, sub_pnt
+ 20, 1, ENC_NA
);
10917 proto_tree_add_item(stlv_tree
, hf_bgp_prefix_sid_srv6_l3vpn_srv6_endpoint_behavior
, tvb
, sub_pnt
+ 21, 2, ENC_NA
);
10918 proto_tree_add_item(stlv_tree
, hf_bgp_prefix_sid_srv6_l3vpn_reserved
, tvb
, sub_pnt
+ 23, 1, ENC_NA
);
10920 srv6_data_sstlv_item
= proto_tree_add_item(stlv_tree
,
10921 hf_bgp_prefix_sid_srv6_l3vpn_sub_sub_tlvs
,
10922 tvb
, sub_pnt
+ 24, srv6_service_subtlv_len
- 21, ENC_NA
);
10923 srv6_data_sstlv_tree
= proto_item_add_subtree(srv6_data_sstlv_item
, ett_bgp_prefix_sid_srv6_l3vpn_sub_sub_tlvs
);
10925 sub_sub_pnt
= sub_pnt
+ 24;
10926 sub_sub_end
= sub_pnt
+ 3 + srv6_service_subtlv_len
;
10927 while (sub_sub_pnt
< sub_sub_end
) {
10928 srv6_service_data_subsubtlv_type
= tvb_get_uint8(tvb
, sub_sub_pnt
);
10929 srv6_service_data_subsubtlv_len
= tvb_get_ntohs(tvb
, sub_sub_pnt
+ 1);
10931 switch (srv6_service_data_subsubtlv_type
) {
10932 case SRV6_SERVICE_DATA_SRV6_SID_STRUCTURE
:
10933 sstlv_item
= proto_tree_add_item(srv6_data_sstlv_tree
,
10934 hf_bgp_prefix_sid_srv6_l3vpn_sub_sub_tlv
,
10935 tvb
, sub_sub_pnt
, srv6_service_data_subsubtlv_len
+ 3, ENC_NA
);
10936 proto_item_append_text(sstlv_item
, " - %s",
10937 val_to_str(srv6_service_data_subsubtlv_type
, srv6_service_data_sub_sub_tlv_type
, "Unknown (%u)"));
10938 sstlv_tree
= proto_item_add_subtree(sstlv_item
, ett_bgp_prefix_sid_srv6_l3vpn_sid_structure
);
10940 proto_tree_add_item(sstlv_tree
, hf_bgp_prefix_sid_srv6_l3vpn_sub_sub_tlv_type
, tvb
, sub_sub_pnt
, 1, ENC_BIG_ENDIAN
);
10941 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
);
10942 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
);
10943 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
);
10944 proto_tree_add_item(sstlv_tree
, hf_bgp_prefix_sid_srv6_l3vpn_sid_func_len
, tvb
, sub_sub_pnt
+ 5, 1, ENC_BIG_ENDIAN
);
10945 proto_tree_add_item(sstlv_tree
, hf_bgp_prefix_sid_srv6_l3vpn_sid_arg_len
, tvb
, sub_sub_pnt
+ 6, 1, ENC_BIG_ENDIAN
);
10946 proto_tree_add_item(sstlv_tree
, hf_bgp_prefix_sid_srv6_l3vpn_sid_trans_len
, tvb
, sub_sub_pnt
+ 7, 1, ENC_BIG_ENDIAN
);
10947 proto_tree_add_item(sstlv_tree
, hf_bgp_prefix_sid_srv6_l3vpn_sid_trans_offset
, tvb
, sub_sub_pnt
+ 8, 1, ENC_BIG_ENDIAN
);
10950 sstlv_item
= proto_tree_add_item(srv6_data_sstlv_tree
,
10951 hf_bgp_prefix_sid_srv6_l3vpn_sub_sub_tlv
,
10952 tvb
, sub_sub_pnt
, srv6_service_data_subsubtlv_len
+ 3, ENC_NA
);
10953 proto_item_append_text(sstlv_item
, " - %s",
10954 val_to_str(srv6_service_data_subsubtlv_type
, srv6_service_data_sub_sub_tlv_type
, "Unknown (%u)"));
10955 sstlv_tree
= proto_item_add_subtree(sstlv_item
, ett_bgp_prefix_sid_srv6_l3vpn_sid_unknown
);
10957 proto_tree_add_item(sstlv_tree
, hf_bgp_prefix_sid_srv6_l3vpn_sub_sub_tlv_type
, tvb
, sub_sub_pnt
, 1, ENC_BIG_ENDIAN
);
10958 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
);
10959 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
);
10962 sub_sub_pnt
+= 3 + srv6_service_data_subsubtlv_len
;
10966 stlv_item
= proto_tree_add_item(srv6_stlv_tree
,
10967 hf_bgp_prefix_sid_srv6_l3vpn_sub_tlv
,
10968 tvb
, sub_pnt
, srv6_service_subtlv_len
+ 3, ENC_NA
);
10969 proto_item_append_text(stlv_item
, " - %s", val_to_str(srv6_service_subtlv_type
, srv6_service_sub_tlv_type
, "Unknown (%u)"));
10970 stlv_tree
= proto_item_add_subtree(stlv_item
, ett_bgp_prefix_sid_srv6_l3vpn_unknown
);
10972 proto_tree_add_item(stlv_tree
, hf_bgp_prefix_sid_srv6_l3vpn_sub_tlv_type
, tvb
, sub_pnt
, 1, ENC_BIG_ENDIAN
);
10973 proto_tree_add_item(stlv_tree
, hf_bgp_prefix_sid_srv6_l3vpn_sub_tlv_length
, tvb
, sub_pnt
+ 1, 2, ENC_BIG_ENDIAN
);
10974 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
);
10977 sub_pnt
+= 3 + srv6_service_subtlv_len
;
10979 q
+= (3 + prefix_sid_sublen
);
10981 case BGP_PREFIX_SID_TLV_SRV6_L2_SERVICE
:
10982 tlv_item
= proto_tree_add_item(subtree2
, hf_bgp_prefix_sid_srv6_l2vpn
, tvb
, q
, prefix_sid_sublen
+ 3, ENC_NA
);
10983 tlv_tree
= proto_item_add_subtree(tlv_item
, ett_bgp_prefix_sid_srv6_l2vpn
);
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_l2vpn_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_l2vpn_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_l2vpn_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_l2vpn_sid_information
);
11006 proto_tree_add_item(stlv_tree
, hf_bgp_prefix_sid_srv6_l2vpn_sub_tlv_type
, tvb
, sub_pnt
, 1, ENC_BIG_ENDIAN
);
11007 proto_tree_add_item(stlv_tree
, hf_bgp_prefix_sid_srv6_l2vpn_sub_tlv_length
, tvb
, sub_pnt
+ 1, 2, ENC_BIG_ENDIAN
);
11008 proto_tree_add_item(stlv_tree
, hf_bgp_prefix_sid_srv6_l2vpn_sub_tlv_reserved
, tvb
, sub_pnt
+ 3, 1, ENC_NA
);
11009 proto_tree_add_item(stlv_tree
, hf_bgp_prefix_sid_srv6_l2vpn_sid_value
, tvb
, sub_pnt
+ 4, 16, ENC_NA
);
11010 proto_tree_add_item(stlv_tree
, hf_bgp_prefix_sid_srv6_l2vpn_sid_flags
, tvb
, sub_pnt
+ 20, 1, ENC_NA
);
11011 proto_tree_add_item(stlv_tree
, hf_bgp_prefix_sid_srv6_l2vpn_srv6_endpoint_behavior
, tvb
, sub_pnt
+ 21, 2, ENC_NA
);
11012 proto_tree_add_item(stlv_tree
, hf_bgp_prefix_sid_srv6_l2vpn_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_l2vpn_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_l2vpn_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_l2vpn_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_l2vpn_sid_structure
);
11034 proto_tree_add_item(sstlv_tree
, hf_bgp_prefix_sid_srv6_l2vpn_sub_sub_tlv_type
, tvb
, sub_sub_pnt
, 1, ENC_BIG_ENDIAN
);
11035 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
);
11036 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
);
11037 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
);
11038 proto_tree_add_item(sstlv_tree
, hf_bgp_prefix_sid_srv6_l2vpn_sid_func_len
, tvb
, sub_sub_pnt
+ 5, 1, ENC_BIG_ENDIAN
);
11039 proto_tree_add_item(sstlv_tree
, hf_bgp_prefix_sid_srv6_l2vpn_sid_arg_len
, tvb
, sub_sub_pnt
+ 6, 1, ENC_BIG_ENDIAN
);
11040 proto_tree_add_item(sstlv_tree
, hf_bgp_prefix_sid_srv6_l2vpn_sid_trans_len
, tvb
, sub_sub_pnt
+ 7, 1, ENC_BIG_ENDIAN
);
11041 proto_tree_add_item(sstlv_tree
, hf_bgp_prefix_sid_srv6_l2vpn_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_l2vpn_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_l2vpn_sid_unknown
);
11051 proto_tree_add_item(sstlv_tree
, hf_bgp_prefix_sid_srv6_l2vpn_sub_sub_tlv_type
, tvb
, sub_sub_pnt
, 1, ENC_BIG_ENDIAN
);
11052 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
);
11053 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
);
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_l2vpn_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_l2vpn_unknown
);
11066 proto_tree_add_item(stlv_tree
, hf_bgp_prefix_sid_srv6_l2vpn_sub_tlv_type
, tvb
, sub_pnt
, 1, ENC_BIG_ENDIAN
);
11067 proto_tree_add_item(stlv_tree
, hf_bgp_prefix_sid_srv6_l2vpn_sub_tlv_length
, tvb
, sub_pnt
+ 1, 2, ENC_BIG_ENDIAN
);
11068 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
);
11071 sub_pnt
+= 3 + srv6_service_subtlv_len
;
11073 q
+= (3 + prefix_sid_sublen
);
11076 tlv_item
= proto_tree_add_item(subtree2
, hf_bgp_prefix_sid_unknown
, tvb
, q
, prefix_sid_sublen
+ 3, ENC_NA
);
11077 proto_item_append_text(tlv_item
, " (%s)", val_to_str(prefix_sid_subtype
, bgp_prefix_sid_type
, "%u"));
11078 tlv_tree
= proto_item_add_subtree(tlv_item
, ett_bgp_prefix_sid_unknown
);
11079 proto_tree_add_item(tlv_tree
, hf_bgp_prefix_sid_type
, tvb
, q
, 1, ENC_BIG_ENDIAN
);
11080 proto_tree_add_item(tlv_tree
, hf_bgp_prefix_sid_length
, tvb
, q
+ 1, 2, ENC_BIG_ENDIAN
);
11081 proto_tree_add_item(tlv_tree
, hf_bgp_prefix_sid_value
, tvb
, q
+ 3, prefix_sid_sublen
- 3, ENC_NA
);
11082 q
+= (3 + prefix_sid_sublen
);
11087 case BGPTYPE_PMSI_TUNNEL_ATTR
:
11088 dissect_bgp_update_pmsi_attr(pinfo
, subtree2
, tvb
, tlen
, o
+i
+aoff
);
11091 case BGPTYPE_ATTR_SET
:
11093 proto_tree_add_item(subtree2
, hf_bgp_update_path_attribute_attrset_origin_as
, tvb
,
11094 o
+ i
+ aoff
, 4, ENC_BIG_ENDIAN
);
11096 ti
= proto_tree_add_item(subtree2
, hf_bgp_update_path_attributes
, tvb
, o
+i
+aoff
+4, alen
-4, ENC_NA
);
11097 attr_set_subtree
= proto_item_add_subtree(ti
, ett_bgp_attrs
);
11098 dissect_bgp_path_attr(attr_set_subtree
, tvb
, alen
-4, o
+i
+aoff
+4, pinfo
);
11101 proto_tree_add_expert_format(subtree2
, pinfo
, &ei_bgp_length_invalid
, tvb
, o
+ i
+ aoff
, alen
,
11102 "Attribute set (invalid): %u byte%s",
11103 alen
, plurality(alen
, "", "s"));
11108 proto_tree_add_expert_format(subtree2
, pinfo
, &ei_bgp_length_invalid
, tvb
, o
+ i
+ aoff
, tlen
,
11109 "Only to Customer (invalid): %u byte%s", tlen
,
11110 plurality(tlen
, "", "s"));
11112 proto_tree_add_item(subtree2
, hf_bgp_update_path_attribute_otc
, tvb
,
11113 o
+ i
+ aoff
, tlen
, ENC_BIG_ENDIAN
);
11114 proto_item_append_text(ti_pa
, ": %u", tvb_get_ntohl(tvb
, o
+ i
+ aoff
));
11117 case BGPTYPE_D_PATH
:
11119 proto_tree_add_expert_format(subtree2
, pinfo
, &ei_bgp_length_invalid
, tvb
, o
+ i
+ aoff
, tlen
,
11120 "D-PATH attribute has invalid length (invalid): %u byte%s", tlen
,
11121 plurality(tlen
, "", "s"));
11126 wmem_strbuf_t
*dpath_strbuf
;
11127 dpath_strbuf
= wmem_strbuf_create(pinfo
->pool
);
11129 dpath_len
= tvb_get_uint8(tvb
, q
);
11130 proto_tree_add_item(subtree2
, hf_bgp_d_path_length
, tvb
,
11131 q
, 1, ENC_BIG_ENDIAN
);
11133 while (dpath_len
> 0 && q
< end
) {
11136 ad
= tvb_get_ntohl(tvb
, q
);
11137 ld
= tvb_get_ntohs(tvb
, q
+4);
11138 ti
= proto_tree_add_string_format(subtree2
, hf_bgp_update_path_attribute_d_path
, tvb
, q
, 6, NULL
, "Domain ID: %u:%u", ad
, ld
);
11139 subtree3
= proto_item_add_subtree(ti
, ett_bgp_dpath
);
11140 proto_tree_add_item(subtree3
, hf_bgp_d_path_ga
, tvb
,
11141 q
, 4, ENC_BIG_ENDIAN
);
11142 proto_tree_add_item(subtree3
, hf_bgp_d_path_la
, tvb
,
11143 q
+ 4, 2, ENC_BIG_ENDIAN
);
11144 wmem_strbuf_append_printf(dpath_strbuf
, " %u:%u", ad
, ld
);
11148 if (dpath_len
!= 0 || q
>= end
) {
11149 proto_tree_add_expert_format(subtree2
, pinfo
, &ei_bgp_length_invalid
, tvb
, o
+ i
+ aoff
, tlen
,
11150 "D-PATH list (invalid): %u byte%s", tlen
,
11151 plurality(tlen
, "", "s"));
11154 proto_item_append_text(ti_pa
, ":%s", wmem_strbuf_get_str(dpath_strbuf
));
11156 proto_tree_add_item(subtree2
, hf_bgp_d_path_isf_safi
, tvb
,
11157 q
, 1, ENC_BIG_ENDIAN
);
11160 proto_tree_add_item(subtree2
, hf_bgp_update_path_attributes_unknown
, tvb
, o
+ i
+ aoff
, tlen
, ENC_NA
);
11162 } /* switch (bgpa.bgpa_type) */ /* end of second switch */
11166 decrement_dissection_depth(pinfo
);
11168 /* FF: postponed BGPTYPE_LINK_STATE_ATTR dissection */
11169 link_state_data
*data
= load_link_state_data(pinfo
);
11170 if (data
&& data
->link_state_attr_present
) {
11171 ti
= proto_tree_add_item(data
->subtree2
, hf_bgp_update_path_attribute_link_state
, tvb
, data
->ostart
, data
->tlen
, ENC_NA
);
11172 subtree3
= proto_item_add_subtree(ti
, ett_bgp_link_state
);
11173 while (data
->ostart
< data
->oend
) {
11174 advance
= decode_link_state_attribute_tlv(subtree3
, tvb
, data
->ostart
, pinfo
, data
->protocol_id
);
11178 data
->ostart
+= advance
;
11184 * Dissect a BGP UPDATE message.
11187 dissect_bgp_update(tvbuff_t
*tvb
, proto_tree
*tree
, packet_info
*pinfo
)
11189 uint16_t hlen
; /* message length */
11190 int o
; /* packet offset */
11191 int end
=0; /* message end */
11192 uint16_t len
; /* tmp */
11193 proto_item
*ti
; /* tree item */
11194 proto_tree
*subtree
; /* subtree for attributes */
11197 hlen
= tvb_get_ntohs(tvb
, BGP_MARKER_SIZE
);
11198 o
= BGP_HEADER_SIZE
;
11201 /* check for withdrawals */
11202 len
= tvb_get_ntohs(tvb
, o
);
11203 proto_tree_add_item(tree
, hf_bgp_update_withdrawn_routes_length
, tvb
, o
, 2, ENC_BIG_ENDIAN
);
11206 /* parse unfeasible prefixes */
11208 ti
= proto_tree_add_item(tree
, hf_bgp_update_withdrawn_routes
, tvb
, o
, len
, ENC_NA
);
11209 subtree
= proto_item_add_subtree(ti
, ett_bgp_unfeas
);
11211 /* parse each prefix */
11214 /* Heuristic to detect if IPv4 prefix are using Path Identifiers */
11215 if( detect_add_path_prefix4(tvb
, o
, end
) ) {
11216 /* IPv4 prefixes with Path Id */
11218 i
= decode_path_prefix4(subtree
, pinfo
, hf_bgp_nlri_path_id
, hf_bgp_withdrawn_prefix
, tvb
, o
,
11219 "Withdrawn route");
11226 i
= decode_prefix4(subtree
, pinfo
, NULL
, hf_bgp_withdrawn_prefix
, tvb
, o
,
11227 "Withdrawn route");
11235 /* check for advertisements */
11236 len
= tvb_get_ntohs(tvb
, o
);
11237 proto_tree_add_item(tree
, hf_bgp_update_total_path_attribute_length
, tvb
, o
, 2, ENC_BIG_ENDIAN
);
11239 /* path attributes */
11241 ti
= proto_tree_add_item(tree
, hf_bgp_update_path_attributes
, tvb
, o
+2, len
, ENC_NA
);
11242 subtree
= proto_item_add_subtree(ti
, ett_bgp_attrs
);
11244 dissect_bgp_path_attr(subtree
, tvb
, len
, o
+2, pinfo
);
11251 /* parse prefixes */
11253 ti
= proto_tree_add_item(tree
, hf_bgp_update_nlri
, tvb
, o
, len
, ENC_NA
);
11254 subtree
= proto_item_add_subtree(ti
, ett_bgp_nlri
);
11257 * Heuristic to detect if IPv4 prefix are using Path Identifiers
11258 * we need at least 5 bytes for Add-path prefixes
11260 if( len
> 4 && detect_add_path_prefix4(tvb
, o
, end
) ) {
11261 /* IPv4 prefixes with Path Id */
11263 i
= decode_path_prefix4(subtree
, pinfo
, hf_bgp_nlri_path_id
, hf_bgp_nlri_prefix
, tvb
, o
,
11270 /* Standard prefixes */
11272 i
= decode_prefix4(subtree
, pinfo
, NULL
, hf_bgp_nlri_prefix
, tvb
, o
, "NLRI");
11283 * Dissect a BGP CAPABILITY message.
11286 dissect_bgp_capability(tvbuff_t
*tvb
, proto_tree
*tree
, packet_info
*pinfo
)
11291 mend
= offset
+ tvb_get_ntohs(tvb
, offset
+ BGP_MARKER_SIZE
);
11292 offset
+= BGP_HEADER_SIZE
;
11293 /* step through all of the capabilities */
11294 while (offset
< mend
) {
11295 offset
= dissect_bgp_capability_item(tvb
, tree
, pinfo
, offset
, true);
11300 * Dissect a BGP NOTIFICATION message.
11303 dissect_bgp_notification(tvbuff_t
*tvb
, proto_tree
*tree
, packet_info
*pinfo
)
11305 int hlen
; /* message length */
11307 unsigned major_error
;
11310 uint8_t minor_cease
;
11313 hlen
= tvb_get_ntohs(tvb
, BGP_MARKER_SIZE
);
11314 offset
= BGP_MARKER_SIZE
+ 2 + 1;
11317 /* print error code */
11318 proto_tree_add_item(tree
, hf_bgp_notify_major_error
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
11319 major_error
= tvb_get_uint8(tvb
, offset
);
11322 switch(major_error
){
11323 case BGP_MAJOR_ERROR_MSG_HDR
:
11324 proto_tree_add_item(tree
, hf_bgp_notify_minor_msg_hdr
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
11326 case BGP_MAJOR_ERROR_OPEN_MSG
:
11327 proto_tree_add_item(tree
, hf_bgp_notify_minor_open_msg
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
11329 case BGP_MAJOR_ERROR_UPDATE_MSG
:
11330 proto_tree_add_item(tree
,hf_bgp_notify_minor_update_msg
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
11332 case BGP_MAJOR_ERROR_HT_EXPIRED
:
11333 proto_tree_add_item(tree
, hf_bgp_notify_minor_ht_expired
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
11335 case BGP_MAJOR_ERROR_STATE_MACHINE
:
11336 proto_tree_add_item(tree
, hf_bgp_notify_minor_state_machine
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
11338 case BGP_MAJOR_ERROR_CEASE
:
11339 proto_tree_add_item(tree
, hf_bgp_notify_minor_cease
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
11341 case BGP_MAJOR_ERROR_ROUTE_REFRESH
:
11342 proto_tree_add_item(tree
, hf_bgp_notify_minor_rr_msg
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
11345 ti
= proto_tree_add_item(tree
, hf_bgp_notify_minor_unknown
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
11346 expert_add_info_format(pinfo
, ti
, &ei_bgp_notify_minor_unknown
, "Unknown notification error (%d)",major_error
);
11351 /* only print if there is optional data */
11352 if (hlen
> BGP_MIN_NOTIFICATION_MSG_SIZE
) {
11353 minor_cease
= tvb_get_uint8(tvb
, offset
- 1);
11354 clen
= tvb_get_uint8(tvb
, offset
);
11355 /* Might be a idr-shutdown communication, first byte is length */
11356 if (hlen
- BGP_MIN_NOTIFICATION_MSG_SIZE
- 1 == clen
&& major_error
== BGP_MAJOR_ERROR_CEASE
&&
11357 (minor_cease
== BGP_CEASE_MINOR_ADMIN_SHUTDOWN
|| minor_cease
== BGP_CEASE_MINOR_ADMIN_RESET
) ) {
11358 proto_tree_add_item(tree
, hf_bgp_notify_communication_length
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
11360 proto_tree_add_item(tree
, hf_bgp_notify_communication
, tvb
, offset
, clen
, ENC_UTF_8
);
11361 /* otherwise just dump the hex data */
11362 } else if ( major_error
== BGP_MAJOR_ERROR_OPEN_MSG
&& minor_cease
== 7 ) {
11363 while (offset
< hlen
) {
11364 offset
= dissect_bgp_capability_item(tvb
, tree
, pinfo
, offset
, false);
11366 } else if (major_error
== BGP_MAJOR_ERROR_OPEN_MSG
&& minor_cease
== 2 ) { /* Display Bad Peer AS Number */
11367 proto_tree_add_item(tree
, hf_bgp_notify_error_open_bad_peer_as
, tvb
, offset
, hlen
- BGP_MIN_NOTIFICATION_MSG_SIZE
, ENC_NA
);
11369 proto_tree_add_item(tree
, hf_bgp_notify_data
, tvb
, offset
, hlen
- BGP_MIN_NOTIFICATION_MSG_SIZE
, ENC_NA
);
11375 * Dissect a BGP ROUTE-REFRESH message.
11378 dissect_bgp_route_refresh(tvbuff_t
*tvb
, proto_tree
*tree
, packet_info
*pinfo
)
11380 int p
; /* tvb offset counter */
11381 int pend
; /* end of list of entries for one orf type */
11382 uint16_t hlen
; /* tvb RR msg length */
11383 proto_item
*ti
; /* tree item */
11384 proto_item
*ti1
; /* tree item */
11385 proto_tree
*subtree
; /* tree for orf */
11386 proto_tree
*subtree1
; /* tree for orf entry */
11387 uint8_t orftype
; /* ORF Type */
11388 uint16_t orflen
; /* ORF len */
11389 uint8_t entryflag
; /* ORF Entry flag: action(add,del,delall) match(permit,deny) */
11390 int entrylen
; /* ORF Entry length */
11391 int advance
; /* tmp */
11399 00 01 00 01 afi,safi= ipv4-unicast
11400 02 80 00 01 defer, prefix-orf, len=1
11404 00 01 00 01 afi,saif= ipv4-unicast
11405 01 80 00 0a immediate, prefix-orf, len=10
11407 00 00 00 05 seqno = 5
11410 10 07 02 prefix = 7.2.0.0/16
11415 hlen
= tvb_get_ntohs(tvb
, BGP_MARKER_SIZE
);
11416 p
= BGP_HEADER_SIZE
;
11419 proto_tree_add_item_ret_uint(tree
, hf_bgp_route_refresh_afi
, tvb
, p
, 2, ENC_BIG_ENDIAN
, &afi
);
11422 /* Subtype in draft-ietf-idr-bgp-enhanced-route-refresh-02 (for Enhanced Route Refresh Capability) before Reserved*/
11423 proto_tree_add_item(tree
, hf_bgp_route_refresh_subtype
, tvb
, p
, 1, ENC_BIG_ENDIAN
);
11427 proto_tree_add_item_ret_uint(tree
, hf_bgp_route_refresh_safi
, tvb
, p
, 1, ENC_BIG_ENDIAN
, &safi
);
11429 save_afi_safi_data(pinfo
, (uint16_t)afi
, (uint8_t)safi
);
11431 if ( hlen
== BGP_HEADER_SIZE
+ 4 )
11436 ti
= proto_tree_add_item(tree
, hf_bgp_route_refresh_orf
, tvb
, p
, 4, ENC_NA
);
11437 subtree
= proto_item_add_subtree(ti
, ett_bgp_orf
);
11439 proto_tree_add_item(subtree
, hf_bgp_route_refresh_orf_flag
, tvb
, p
, 1, ENC_BIG_ENDIAN
);
11442 ti1
= proto_tree_add_item(subtree
, hf_bgp_route_refresh_orf_type
, tvb
, p
, 1, ENC_BIG_ENDIAN
);
11443 orftype
= tvb_get_uint8(tvb
, p
);
11446 proto_tree_add_item(subtree
, hf_bgp_route_refresh_orf_length
, tvb
, p
, 2, ENC_BIG_ENDIAN
);
11447 orflen
= tvb_get_ntohs(tvb
, p
);
11448 proto_item_set_len(ti
, orflen
+ 4);
11451 if (orftype
!= BGP_ORF_PREFIX_CISCO
) {
11452 expert_add_info_format(pinfo
, ti1
, &ei_bgp_route_refresh_orf_type_unknown
, "ORFEntry-Unknown (type %u)", orftype
);
11459 ti1
= proto_tree_add_item(subtree
, hf_bgp_route_refresh_orf_entry_prefixlist
, tvb
, p
, 1, ENC_NA
);
11460 subtree1
= proto_item_add_subtree(ti1
, ett_bgp_orf_entry
);
11461 proto_tree_add_item(subtree1
, hf_bgp_route_refresh_orf_entry_action
, tvb
, p
, 1, ENC_BIG_ENDIAN
);
11462 entryflag
= tvb_get_uint8(tvb
, p
);
11463 if (((entryflag
& BGP_ORF_ACTION
) >> 6) == BGP_ORF_REMOVEALL
) {
11467 proto_tree_add_item(subtree1
, hf_bgp_route_refresh_orf_entry_match
, tvb
, p
, 1, ENC_BIG_ENDIAN
);
11470 proto_tree_add_item(subtree1
, hf_bgp_route_refresh_orf_entry_sequence
, tvb
, p
, 4, ENC_BIG_ENDIAN
);
11473 proto_tree_add_item(subtree1
, hf_bgp_route_refresh_orf_entry_prefixmask_lower
, tvb
, p
, 1, ENC_BIG_ENDIAN
);
11476 proto_tree_add_item(subtree1
, hf_bgp_route_refresh_orf_entry_prefixmask_upper
, tvb
, p
, 1, ENC_BIG_ENDIAN
);
11479 advance
= decode_prefix4(subtree1
, pinfo
, NULL
, hf_bgp_route_refresh_orf_entry_ip
, tvb
, p
, "ORF");
11482 entrylen
= 7 + 1 + advance
;
11484 proto_item_set_len(ti1
, entrylen
);
11492 dissect_bgp_pdu(tvbuff_t
*tvb
, packet_info
*pinfo
, proto_tree
*tree
,
11495 uint16_t bgp_len
; /* Message length */
11496 uint8_t bgp_type
; /* Message type */
11497 const char *typ
; /* Message type (string) */
11498 proto_item
*ti
= NULL
;
11499 proto_item
*ti_marker
= NULL
;/* marker item */
11500 proto_item
*ti_len
= NULL
; /* length item */
11501 proto_tree
*bgp_tree
= NULL
; /* BGP packet tree */
11502 static const uint8_t valid_marker
[BGP_MARKER_SIZE
] = {
11503 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
11504 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF
11507 bgp_len
= tvb_get_ntohs(tvb
, BGP_MARKER_SIZE
);
11508 bgp_type
= tvb_get_uint8(tvb
, BGP_MARKER_SIZE
+ 2);
11509 typ
= val_to_str(bgp_type
, bgptypevals
, "Unknown message type (0x%02x)");
11511 col_set_str(pinfo
->cinfo
, COL_PROTOCOL
, "BGP");
11512 col_append_sep_str(pinfo
->cinfo
, COL_INFO
, NULL
, typ
);
11515 ti
= proto_tree_add_item(tree
, proto_bgp
, tvb
, 0, -1, ENC_NA
);
11516 proto_item_append_text(ti
, " - %s", typ
);
11518 /* add a different tree for each message type */
11519 switch (bgp_type
) {
11521 bgp_tree
= proto_item_add_subtree(ti
, ett_bgp_open
);
11524 bgp_tree
= proto_item_add_subtree(ti
, ett_bgp_update
);
11526 case BGP_NOTIFICATION
:
11527 bgp_tree
= proto_item_add_subtree(ti
, ett_bgp_notification
);
11529 case BGP_KEEPALIVE
:
11530 bgp_tree
= proto_item_add_subtree(ti
, ett_bgp
);
11532 case BGP_ROUTE_REFRESH_CISCO
:
11533 case BGP_ROUTE_REFRESH
:
11534 bgp_tree
= proto_item_add_subtree(ti
, ett_bgp_route_refresh
);
11536 case BGP_CAPABILITY
:
11537 bgp_tree
= proto_item_add_subtree(ti
, ett_bgp_capability
);
11540 bgp_tree
= proto_item_add_subtree(ti
, ett_bgp
);
11544 ti_marker
= proto_tree_add_item(bgp_tree
, hf_bgp_marker
, tvb
, 0,
11545 BGP_MARKER_SIZE
, ENC_NA
);
11546 if (tvb_memeql(tvb
, 0, valid_marker
, BGP_MARKER_SIZE
) != 0) {
11547 expert_add_info(pinfo
, ti_marker
, &ei_bgp_marker_invalid
);
11550 ti_len
= proto_tree_add_item(bgp_tree
, hf_bgp_length
, tvb
, 16, 2, ENC_BIG_ENDIAN
);
11553 if (bgp_len
< BGP_HEADER_SIZE
|| bgp_len
> BGP_MAX_PACKET_SIZE
) {
11554 expert_add_info_format(pinfo
, ti_len
, &ei_bgp_length_invalid
, "Length is invalid %u", bgp_len
);
11555 return tvb_captured_length(tvb
);
11559 proto_item_set_len(ti
, bgp_len
);
11562 proto_tree_add_item(bgp_tree
, hf_bgp_type
, tvb
, 16 + 2, 1, ENC_BIG_ENDIAN
);
11564 switch (bgp_type
) {
11566 dissect_bgp_open(tvb
, bgp_tree
, pinfo
);
11569 dissect_bgp_update(tvb
, bgp_tree
, pinfo
);
11571 case BGP_NOTIFICATION
:
11572 dissect_bgp_notification(tvb
, bgp_tree
, pinfo
);
11574 case BGP_KEEPALIVE
:
11575 /* no data in KEEPALIVE messages */
11577 case BGP_ROUTE_REFRESH_CISCO
:
11578 case BGP_ROUTE_REFRESH
:
11579 dissect_bgp_route_refresh(tvb
, bgp_tree
, pinfo
);
11581 case BGP_CAPABILITY
:
11582 dissect_bgp_capability(tvb
, bgp_tree
, pinfo
);
11591 get_bgp_len(packet_info
*pinfo _U_
, tvbuff_t
*tvb
, int offset
, void *data _U_
)
11593 return tvb_get_ntohs(tvb
, offset
+ BGP_MARKER_SIZE
);
11597 * Dissect a BGP packet.
11600 dissect_bgp(tvbuff_t
*tvb
, packet_info
*pinfo
, proto_tree
*tree
, void* data _U_
)
11602 volatile int offset
= 0; /* offset into the tvbuff */
11603 static unsigned char marker
[] = { /* BGP message marker */
11604 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
11605 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
11607 proto_item
*ti
; /* tree item */
11608 proto_tree
*bgp_tree
; /* BGP packet tree */
11609 tvbuff_t
*volatile this_tvb
; /* for tcp_dissect_pdus() */
11612 * Scan through the TCP payload looking for a BGP marker.
11614 while (tvb_reported_length_remaining(tvb
, offset
) > 0) {
11616 * Start with a quick search for 0xFFFF, then do the heavier
11617 * tvb_memeql() once we find it.
11619 offset
= tvb_find_uint16(tvb
, offset
, -1, 0xFFFF);
11621 /* Didn't find even the start of a marker */
11624 else if (0 == tvb_memeql(tvb
, offset
, marker
, BGP_MARKER_SIZE
)) {
11625 /* Found the marker - stop scanning and start processing BGP packets. */
11629 /* Keep scanning through the tvbuff to try to find a marker. */
11634 col_clear(pinfo
->cinfo
, COL_INFO
);
11637 * If we skipped any bytes, mark it as a BGP continuation.
11640 ti
= proto_tree_add_item(tree
, proto_bgp
, tvb
, 0, offset
, ENC_NA
);
11641 bgp_tree
= proto_item_add_subtree(ti
, ett_bgp
);
11642 proto_item_append_text(bgp_tree
, " - Continuation");
11643 proto_tree_add_item(bgp_tree
, hf_bgp_continuation
, tvb
, 0, offset
, ENC_NA
);
11645 /* Don't include the continuation in PDU reassembly */
11646 this_tvb
= tvb_new_subset_remaining(tvb
, offset
);
11653 * Now process the BGP packets in the TCP payload.
11655 tcp_dissect_pdus(this_tvb
, pinfo
, tree
, bgp_desegment
, BGP_HEADER_SIZE
,
11656 get_bgp_len
, dissect_bgp_pdu
, NULL
);
11657 return tvb_captured_length(tvb
);
11661 * Register ourselves.
11664 proto_register_bgp(void)
11667 static hf_register_info hf
[] = {
11670 { "Marker", "bgp.marker", FT_BYTES
, BASE_NONE
,
11671 NULL
, 0x0, "Must be set to all ones (16 Bytes)", HFILL
}},
11673 { "Length", "bgp.length", FT_UINT16
, BASE_DEC
,
11674 NULL
, 0x0, "The total length of the message, including the header in octets", HFILL
}},
11675 { &hf_bgp_prefix_length
,
11676 { "Prefix Length", "bgp.prefix_length", FT_UINT8
, BASE_DEC
,
11677 NULL
, 0x0, NULL
, HFILL
}},
11679 { "Route Distinguisher", "bgp.rd", FT_STRING
, BASE_NONE
,
11680 NULL
, 0x0, NULL
, HFILL
}},
11681 { &hf_bgp_continuation
,
11682 { "Continuation", "bgp.continuation", FT_NONE
, BASE_NONE
,
11683 NULL
, 0x0, NULL
, HFILL
}},
11684 { &hf_bgp_originating_as
,
11685 { "Originating AS", "bgp.originating_as", FT_UINT32
, BASE_DEC
,
11686 NULL
, 0x0, NULL
, HFILL
}},
11687 { &hf_bgp_community_prefix
,
11688 { "Community Prefix", "bgp.community_prefix", FT_STRING
, BASE_NONE
,
11689 NULL
, 0x0, NULL
, HFILL
}},
11690 { &hf_bgp_endpoint_address
,
11691 { "Endpoint Address", "bgp.endpoint_address", FT_IPv4
, BASE_NONE
,
11692 NULL
, 0x0, NULL
, HFILL
}},
11693 { &hf_bgp_endpoint_address_ipv6
,
11694 { "Endpoint Address", "bgp.endpoint_address_ipv6", FT_IPv6
, BASE_NONE
,
11695 NULL
, 0x0, NULL
, HFILL
}},
11696 { &hf_bgp_label_stack
,
11697 { "Label Stack", "bgp.label_stack", FT_STRING
, BASE_NONE
,
11698 NULL
, 0x0, NULL
, HFILL
}},
11699 { &hf_bgp_vplsad_length
,
11700 { "Length", "bgp.vplsad.length", FT_UINT16
, BASE_DEC
,
11701 NULL
, 0x0, NULL
, HFILL
}},
11702 { &hf_bgp_vplsad_rd
,
11703 { "RD", "bgp.vplsad.rd", FT_STRING
, BASE_NONE
,
11704 NULL
, 0x0, NULL
, HFILL
}},
11705 { &hf_bgp_bgpad_pe_addr
,
11706 { "PE Addr", "bgp.ad.pe_addr", FT_IPv4
, BASE_NONE
,
11707 NULL
, 0x0, NULL
, HFILL
}},
11708 { &hf_bgp_vplsbgp_ce_id
,
11709 { "CE-ID", "bgp.vplsbgp.ce_id", FT_UINT16
, BASE_DEC
,
11710 NULL
, 0x0, NULL
, HFILL
}},
11711 { &hf_bgp_vplsbgp_labelblock_offset
,
11712 { "Label Block Offset", "bgp.vplsbgp.labelblock.offset", FT_UINT16
, BASE_DEC
,
11713 NULL
, 0x0, NULL
, HFILL
}},
11714 { &hf_bgp_vplsbgp_labelblock_size
,
11715 { "Label Block Size", "bgp.vplsbgp.labelblock.size", FT_UINT16
, BASE_DEC
,
11716 NULL
, 0x0, NULL
, HFILL
}},
11717 { &hf_bgp_vplsbgp_labelblock_base
,
11718 { "Label Block Base", "bgp.vplsbgp.labelblock.base", FT_STRING
, BASE_NONE
,
11719 NULL
, 0x0, NULL
, HFILL
}},
11720 { &hf_bgp_wildcard_route_target
,
11721 { "Wildcard route target", "bgp.wildcard_route_target", FT_STRING
, BASE_NONE
,
11722 NULL
, 0x0, NULL
, HFILL
}},
11724 { "Type", "bgp.type", FT_UINT8
, BASE_DEC
,
11725 VALS(bgptypevals
), 0x0, "BGP message type", HFILL
}},
11727 { &hf_bgp_open_version
,
11728 { "Version", "bgp.open.version", FT_UINT8
, BASE_DEC
,
11729 NULL
, 0x0, "The protocol version number", HFILL
}},
11730 { &hf_bgp_open_myas
,
11731 { "My AS", "bgp.open.myas", FT_UINT16
, BASE_DEC
,
11732 NULL
, 0x0, "The Autonomous System number of the sender", HFILL
}},
11733 { &hf_bgp_open_holdtime
,
11734 { "Hold Time", "bgp.open.holdtime", FT_UINT16
, BASE_DEC
,
11735 NULL
, 0x0, "The number of seconds the sender proposes for Hold Time", HFILL
}},
11736 { &hf_bgp_open_identifier
,
11737 { "BGP Identifier", "bgp.open.identifier", FT_IPv4
, BASE_NONE
,
11738 NULL
, 0x0, "The BGP Identifier of the sender", HFILL
}},
11739 { &hf_bgp_open_opt_len
,
11740 { "Optional Parameters Length", "bgp.open.opt.len", FT_UINT8
, BASE_DEC
,
11741 NULL
, 0x0, "The total length of the Optional Parameters field in octets", HFILL
}},
11742 { &hf_bgp_open_opt_extension
,
11743 { "Optional Parameter Extension", "bgp.open.opt.extension", FT_NONE
, BASE_NONE
,
11744 NULL
, 0x0, "Optional Parameters Extension detected", HFILL
}},
11745 { &hf_bgp_open_opt_extension_mark
,
11746 { "Extension Mark", "bgp.open.opt.extension.mark", FT_UINT8
, BASE_DEC
,
11747 NULL
, 0x0, "Optional Parameters Extension detected", HFILL
}},
11748 { &hf_bgp_open_opt_extension_len
,
11749 { "Extended Length", "bgp.open.opt.extension_len", FT_UINT16
, BASE_DEC
,
11750 NULL
, 0x0, "The total extended length of the Optional Parameters field in octets", HFILL
}},
11751 { &hf_bgp_open_opt_params
,
11752 { "Optional Parameters", "bgp.open.opt", FT_NONE
, BASE_NONE
,
11753 NULL
, 0x0, "List of optional parameters", HFILL
}},
11754 { &hf_bgp_open_opt_param
,
11755 { "Optional Parameter", "bgp.open.opt.param", FT_NONE
, BASE_NONE
,
11756 NULL
, 0x0, NULL
, HFILL
}},
11757 { &hf_bgp_open_opt_param_type
,
11758 { "Parameter Type", "bgp.open.opt.param.type", FT_UINT8
, BASE_DEC
,
11759 VALS(bgp_open_opt_vals
), 0x0, "Unambiguously identifies individual parameters", HFILL
}},
11760 { &hf_bgp_open_opt_param_len
,
11761 { "Parameter Length", "bgp.open.opt.param.len", FT_UINT8
, BASE_DEC
,
11762 NULL
, 0x0, "Length of the Parameter Value", HFILL
}},
11763 { &hf_bgp_open_opt_param_auth
,
11764 { "Authentication Data", "bgp.open.opt.param.auth", FT_BYTES
, BASE_NONE
,
11765 NULL
, 0x0, "Deprecated", HFILL
}},
11766 { &hf_bgp_open_opt_param_unknown
,
11767 { "Unknown", "bgp.open.opt.param.unknown", FT_BYTES
, BASE_NONE
,
11768 NULL
, 0x0, "Unknown Parameter", HFILL
}},
11769 /* Notification error */
11770 { &hf_bgp_notify_major_error
,
11771 { "Major error Code", "bgp.notify.major_error", FT_UINT8
, BASE_DEC
,
11772 VALS(bgpnotify_major
), 0x0, NULL
, HFILL
}},
11773 { &hf_bgp_notify_minor_msg_hdr
,
11774 { "Minor error Code (Message Header)", "bgp.notify.minor_error", FT_UINT8
, BASE_DEC
,
11775 VALS(bgpnotify_minor_msg_hdr
), 0x0, NULL
, HFILL
}},
11776 { &hf_bgp_notify_minor_open_msg
,
11777 { "Minor error Code (Open Message)", "bgp.notify.minor_error_open", FT_UINT8
, BASE_DEC
,
11778 VALS(bgpnotify_minor_open_msg
), 0x0, NULL
, HFILL
}},
11779 { &hf_bgp_notify_minor_update_msg
,
11780 { "Minor error Code (Update Message)", "bgp.notify.minor_error_update", FT_UINT8
, BASE_DEC
,
11781 VALS(bgpnotify_minor_update_msg
), 0x0, NULL
, HFILL
}},
11782 { &hf_bgp_notify_minor_ht_expired
,
11783 { "Minor error Code (Hold Timer Expired)", "bgp.notify.minor_error_expired", FT_UINT8
, BASE_DEC
,
11784 NULL
, 0x0, NULL
, HFILL
}},
11785 { &hf_bgp_notify_minor_state_machine
,
11786 { "Minor error Code (State Machine)", "bgp.notify.minor_error_state", FT_UINT8
, BASE_DEC
,
11787 VALS(bgpnotify_minor_state_machine
), 0x0, NULL
, HFILL
}},
11788 { &hf_bgp_notify_minor_cease
,
11789 { "Minor error Code (Cease)", "bgp.notify.minor_error_cease", FT_UINT8
, BASE_DEC
,
11790 VALS(bgpnotify_minor_cease
), 0x0, NULL
, HFILL
}},
11791 { &hf_bgp_notify_minor_rr_msg
,
11792 { "Minor error Code (Route-Refresh message)", "bgp.notify.minor_error_route_refresh", FT_UINT8
, BASE_DEC
,
11793 VALS(bgpnotify_minor_rr_msg
), 0x0, NULL
, HFILL
}},
11794 { &hf_bgp_notify_minor_unknown
,
11795 { "Minor error Code (Unknown)", "bgp.notify.minor_error_unknown", FT_UINT8
, BASE_DEC
,
11796 NULL
, 0x0, NULL
, HFILL
}},
11797 { &hf_bgp_notify_data
,
11798 { "Data", "bgp.notify.minor_data", FT_BYTES
, BASE_NONE
,
11799 NULL
, 0x0, NULL
, HFILL
}},
11800 { &hf_bgp_notify_error_open_bad_peer_as
,
11801 { "Bad Peer AS", "bgp.notify.error_open.bad_peer_as", FT_UINT32
, BASE_DEC
,
11802 NULL
, 0x0, NULL
, HFILL
}},
11803 { &hf_bgp_notify_communication_length
,
11804 { "BGP Shutdown Communication Length", "bgp.notify.communication_length", FT_UINT8
, BASE_DEC
,
11805 NULL
, 0x0, NULL
, HFILL
}},
11806 { &hf_bgp_notify_communication
,
11807 { "Shutdown Communication", "bgp.notify.communication", FT_STRING
, BASE_NONE
,
11808 NULL
, 0x0, NULL
, HFILL
}},
11810 /* Route Refresh */
11811 { &hf_bgp_route_refresh_afi
,
11812 { "Address family identifier (AFI)", "bgp.route_refresh.afi", FT_UINT16
, BASE_DEC
,
11813 VALS(afn_vals
), 0x0, NULL
, HFILL
}},
11814 { &hf_bgp_route_refresh_subtype
,
11815 { "Subtype", "bgp.route_refresh.subtype", FT_UINT8
, BASE_DEC
,
11816 VALS(route_refresh_subtype_vals
), 0x0, NULL
, HFILL
}},
11817 { &hf_bgp_route_refresh_safi
,
11818 { "Subsequent address family identifier (SAFI)", "bgp.route_refresh.safi", FT_UINT8
, BASE_DEC
,
11819 VALS(bgpattr_nlri_safi
), 0x0, NULL
, HFILL
}},
11820 { &hf_bgp_route_refresh_orf
,
11821 { "ORF information", "bgp.route_refresh.orf", FT_NONE
, BASE_NONE
,
11822 NULL
, 0x0, NULL
, HFILL
}},
11823 { &hf_bgp_route_refresh_orf_flag
,
11824 { "ORF flag", "bgp.route_refresh.orf.flag", FT_UINT8
, BASE_DEC
,
11825 VALS(orf_when_vals
), 0x0, NULL
, HFILL
}},
11826 { &hf_bgp_route_refresh_orf_type
,
11827 { "ORF type", "bgp.route_refresh.orf.type", FT_UINT8
, BASE_DEC
,
11828 VALS(orf_type_vals
), 0x0, NULL
, HFILL
}},
11829 { &hf_bgp_route_refresh_orf_length
,
11830 { "ORF length", "bgp.route_refresh.orf.length", FT_UINT16
, BASE_DEC
,
11831 NULL
, 0x0, NULL
, HFILL
}},
11832 { &hf_bgp_route_refresh_orf_entry_prefixlist
,
11833 { "ORFEntry PrefixList", "bgp.route_refresh.orf.entry", FT_NONE
, BASE_NONE
,
11834 NULL
, 0x0, NULL
, HFILL
}},
11835 { &hf_bgp_route_refresh_orf_entry_action
,
11836 { "ORFEntry Action", "bgp.route_refresh.orf.entry.action", FT_UINT8
, BASE_DEC
,
11837 VALS(orf_entry_action_vals
), BGP_ORF_ACTION
, NULL
, HFILL
}},
11838 { &hf_bgp_route_refresh_orf_entry_match
,
11839 { "ORFEntry Match", "bgp.route_refresh.orf.entry.match", FT_UINT8
, BASE_DEC
,
11840 VALS(orf_entry_match_vals
), BGP_ORF_MATCH
, NULL
, HFILL
}},
11841 { &hf_bgp_route_refresh_orf_entry_sequence
,
11842 { "ORFEntry Sequence", "bgp.route_refresh.orf.entry.sequence", FT_UINT32
, BASE_DEC
,
11843 NULL
, 0x0, NULL
, HFILL
}},
11844 { &hf_bgp_route_refresh_orf_entry_prefixmask_lower
,
11845 { "ORFEntry PrefixMask length lower bound", "bgp.route_refresh.orf.entry.prefixmask_lower", FT_UINT8
, BASE_DEC
,
11846 NULL
, 0x0, NULL
, HFILL
}},
11847 { &hf_bgp_route_refresh_orf_entry_prefixmask_upper
,
11848 { "ORFEntry PrefixMask length upper bound", "bgp.route_refresh.orf.entry.prefixmask_upper", FT_UINT8
, BASE_DEC
,
11849 NULL
, 0x0, NULL
, HFILL
}},
11850 { &hf_bgp_route_refresh_orf_entry_ip
,
11851 { "ORFEntry IP address", "bgp.route_refresh.orf.entry.ip", FT_IPv4
, BASE_NONE
,
11852 NULL
, 0x0, NULL
, HFILL
}},
11856 { "Capability", "bgp.cap", FT_NONE
, BASE_NONE
,
11857 NULL
, 0x0, NULL
, HFILL
}},
11858 { &hf_bgp_cap_type
,
11859 { "Type", "bgp.cap.type", FT_UINT8
, BASE_DEC
,
11860 VALS(capability_vals
), 0x0, NULL
, HFILL
}},
11861 { &hf_bgp_cap_length
,
11862 { "Length", "bgp.cap.length", FT_UINT8
, BASE_DEC
,
11863 NULL
, 0x0, NULL
, HFILL
}},
11864 { &hf_bgp_cap_action
,
11865 { "Action", "bgp.cap.action", FT_UINT8
, BASE_DEC
,
11866 VALS(bgpcap_action
), 0x0, NULL
, HFILL
}},
11867 { &hf_bgp_cap_unknown
,
11868 { "Unknown", "bgp.cap.unknown", FT_BYTES
, BASE_NONE
,
11869 NULL
, 0x0, NULL
, HFILL
}},
11870 { &hf_bgp_cap_reserved
,
11871 { "Reserved", "bgp.cap.reserved", FT_BYTES
, BASE_NONE
,
11872 NULL
, 0x0, "Must be Zero", HFILL
}},
11873 { &hf_bgp_cap_mp_afi
,
11874 { "AFI", "bgp.cap.mp.afi", FT_UINT16
, BASE_DEC
,
11875 VALS(afn_vals
), 0x0, NULL
, HFILL
}},
11876 { &hf_bgp_cap_mp_safi
,
11877 { "SAFI", "bgp.cap.mp.safi", FT_UINT8
, BASE_DEC
,
11878 VALS(bgpattr_nlri_safi
), 0x0, NULL
, HFILL
}},
11879 { &hf_bgp_cap_enh_afi
,
11880 { "AFI", "bgp.cap.enh.afi", FT_UINT16
, BASE_DEC
,
11881 VALS(afn_vals
), 0x0, NULL
, HFILL
}},
11882 { &hf_bgp_cap_enh_safi
,
11883 { "SAFI", "bgp.cap.enh.safi", FT_UINT16
, BASE_DEC
,
11884 VALS(bgpattr_nlri_safi
), 0x0, NULL
, HFILL
}},
11885 { &hf_bgp_cap_enh_nhafi
,
11886 { "Next hop AFI", "bgp.cap.enh.nhafi", FT_UINT16
, BASE_DEC
,
11887 VALS(afn_vals
), 0x0, NULL
, HFILL
}},
11888 { &hf_bgp_cap_role
,
11889 { "BGP Role", "bgp.cap.role", FT_UINT8
, BASE_DEC
,
11890 VALS(bgprole_vals
), 0x0, NULL
, HFILL
}},
11891 { &hf_bgp_cap_gr_timers
,
11892 { "Restart Timers", "bgp.cap.gr.timers", FT_UINT16
, BASE_HEX
,
11893 NULL
, 0x0, NULL
, HFILL
}},
11894 { &hf_bgp_cap_gr_timers_restart_flag
,
11895 { "Restart state", "bgp.cap.gr.timers.restart_flag", FT_BOOLEAN
, 16,
11896 TFS(&tfs_yes_no
), 0x8000, NULL
, HFILL
}},
11897 { &hf_bgp_cap_gr_timers_notification_flag
,
11898 { "Graceful notification", "bgp.cap.gr.timers.notification_flag", FT_BOOLEAN
, 16,
11899 TFS(&tfs_yes_no
), 0x4000, NULL
, HFILL
}},
11900 { &hf_bgp_cap_gr_timers_restart_time
,
11901 { "Time", "bgp.cap.gr.timers.restart_time", FT_UINT16
, BASE_DEC
,
11902 NULL
, 0x0FFF, "in us", HFILL
}},
11903 { &hf_bgp_cap_gr_afi
,
11904 { "AFI", "bgp.cap.gr.afi", FT_UINT16
, BASE_DEC
,
11905 VALS(afn_vals
), 0x0, NULL
, HFILL
}},
11906 { &hf_bgp_cap_gr_safi
,
11907 { "SAFI", "bgp.cap.gr.safi", FT_UINT8
, BASE_DEC
,
11908 VALS(bgpattr_nlri_safi
), 0x0, NULL
, HFILL
}},
11909 { &hf_bgp_cap_gr_flag
,
11910 { "Flag", "bgp.cap.gr.flag", FT_UINT8
, BASE_HEX
,
11911 NULL
, 0x0, NULL
, HFILL
}},
11912 { &hf_bgp_cap_gr_flag_pfs
,
11913 { "Preserve forwarding state", "bgp.cap.gr.flag.pfs", FT_BOOLEAN
, 8,
11914 TFS(&tfs_yes_no
), 0x80, NULL
, HFILL
}},
11916 { "AS Number", "bgp.cap.4as", FT_UINT32
, BASE_DEC
,
11917 NULL
, 0x0, NULL
, HFILL
}},
11919 { "Capability Dynamic", "bgp.cap.dc", FT_UINT8
, BASE_DEC
,
11920 VALS(capability_vals
), 0x0, NULL
, HFILL
}},
11921 { &hf_bgp_cap_ap_afi
,
11922 { "AFI", "bgp.cap.ap.afi", FT_UINT16
, BASE_DEC
,
11923 VALS(afn_vals
), 0x0, NULL
, HFILL
}},
11924 { &hf_bgp_cap_ap_safi
,
11925 { "SAFI", "bgp.cap.ap.safi", FT_UINT8
, BASE_DEC
,
11926 VALS(bgpattr_nlri_safi
), 0x0, NULL
, HFILL
}},
11927 { &hf_bgp_cap_ap_sendreceive
,
11928 { "Send/Receive", "bgp.cap.ap.sendreceive", FT_UINT8
, BASE_DEC
,
11929 VALS(orf_send_recv_vals
), 0x0, NULL
, HFILL
}},
11930 { &hf_bgp_cap_orf_afi
,
11931 { "AFI", "bgp.cap.orf.afi", FT_UINT16
, BASE_DEC
,
11932 VALS(afn_vals
), 0x0, NULL
, HFILL
}},
11933 { &hf_bgp_cap_orf_safi
,
11934 { "SAFI", "bgp.cap.orf.safi", FT_UINT8
, BASE_DEC
,
11935 VALS(bgpattr_nlri_safi
), 0x0, NULL
, HFILL
}},
11936 { &hf_bgp_cap_orf_number
,
11937 { "Number", "bgp.cap.orf.number", FT_UINT8
, BASE_DEC
,
11938 NULL
, 0x0, NULL
, HFILL
}},
11939 { &hf_bgp_cap_orf_type
,
11940 { "Type", "bgp.cap.orf.type", FT_UINT8
, BASE_DEC
,
11941 VALS(orf_type_vals
), 0x0, NULL
, HFILL
}},
11942 { &hf_bgp_cap_orf_sendreceive
,
11943 { "Send Receive", "bgp.cap.orf.sendreceive", FT_UINT8
, BASE_DEC
,
11944 VALS(orf_send_recv_vals
), 0x0, NULL
, HFILL
}},
11945 { &hf_bgp_cap_fqdn_hostname_len
,
11946 { "Hostname Length", "bgp.cap.orf.fqdn.hostname.len", FT_UINT8
, BASE_DEC
,
11947 NULL
, 0x0, NULL
, HFILL
}},
11948 { &hf_bgp_cap_fqdn_hostname
,
11949 { "Hostname", "bgp.cap.orf.fqdn.hostname", FT_STRING
, BASE_NONE
,
11950 NULL
, 0x0, NULL
, HFILL
}},
11951 { &hf_bgp_cap_fqdn_domain_name_len
,
11952 { "Domain Name Length", "bgp.cap.orf.fqdn.domain_name.len", FT_UINT8
, BASE_DEC
,
11953 NULL
, 0x0, NULL
, HFILL
}},
11954 { &hf_bgp_cap_fqdn_domain_name
,
11955 { "Domain Name", "bgp.cap.orf.fqdn.domain_name", FT_STRING
, BASE_NONE
,
11956 NULL
, 0x0, NULL
, HFILL
}},
11957 { &hf_bgp_cap_multisession_flags
,
11958 { "Flag", "bgp.cap.multisession.flags", FT_UINT8
, BASE_HEX
,
11959 NULL
, 0x0, NULL
, HFILL
}},
11960 { &hf_bgp_cap_bgpsec_flags
,
11961 { "Flag", "bgp.cap.bgpsec.flags", FT_UINT8
, BASE_HEX
,
11962 NULL
, 0x0, NULL
, HFILL
}},
11963 { &hf_bgp_cap_bgpsec_version
,
11964 { "Version", "bgp.cap.bgpsec.version", FT_UINT8
, BASE_DEC
,
11965 NULL
, 0xF0, NULL
, HFILL
}},
11966 { &hf_bgp_cap_bgpsec_sendreceive
,
11967 { "Send/Receive", "bgp.cap.bgpsec.sendreceive", FT_UINT8
, BASE_DEC
,
11968 VALS(bgpsec_send_receive_vals
), 0x8, NULL
, HFILL
}},
11969 { &hf_bgp_cap_bgpsec_reserved
,
11970 { "Reserved", "bgp.cap.bgpsec.reserved", FT_UINT8
, BASE_HEX
,
11971 NULL
, 0x7, "Must be Zero", HFILL
}},
11972 { &hf_bgp_cap_bgpsec_afi
,
11973 { "AFI", "bgp.cap.bgpsec.afi", FT_UINT16
, BASE_DEC
,
11974 VALS(afn_vals
), 0x0, NULL
, HFILL
}},
11975 { &hf_bgp_cap_soft_version_len
,
11976 { "Software Version Length", "bgp.cap.software_version.len", FT_UINT8
, BASE_DEC
,
11977 NULL
, 0x0, NULL
, HFILL
}},
11978 { &hf_bgp_cap_soft_version
,
11979 { "Software Version", "bgp.cap.software_version", FT_STRING
, BASE_NONE
,
11980 NULL
, 0x0, NULL
, HFILL
}},
11983 { &hf_bgp_update_withdrawn_routes_length
,
11984 { "Withdrawn Routes Length", "bgp.update.withdrawn_routes.length", FT_UINT16
, BASE_DEC
,
11985 NULL
, 0x0, NULL
, HFILL
}},
11986 { &hf_bgp_update_withdrawn_routes
,
11987 { "Withdrawn Routes", "bgp.update.withdrawn_routes", FT_NONE
, BASE_NONE
,
11988 NULL
, 0x0, NULL
, HFILL
}},
11990 { &hf_bgp_update_path_attribute_aggregator_as
,
11991 { "Aggregator AS", "bgp.update.path_attribute.aggregator_as", FT_UINT32
, BASE_DEC
,
11992 NULL
, 0x0, NULL
, HFILL
}},
11993 /* BGP update path attributes */
11994 { &hf_bgp_update_path_attributes
,
11995 { "Path attributes", "bgp.update.path_attributes", FT_NONE
, BASE_NONE
,
11996 NULL
, 0x0, NULL
, HFILL
}},
11997 { &hf_bgp_update_path_attributes_unknown
,
11998 { "Unknown Path attributes", "bgp.update.path_attributes.unknown", FT_NONE
, BASE_NONE
,
11999 NULL
, 0x0, NULL
, HFILL
}},
12000 { &hf_bgp_update_total_path_attribute_length
,
12001 { "Total Path Attribute Length", "bgp.update.path_attributes.length", FT_UINT16
, BASE_DEC
,
12002 NULL
, 0x0, NULL
, HFILL
}},
12003 { &hf_bgp_update_path_attribute_aggregator_origin
,
12004 { "Aggregator origin", "bgp.update.path_attribute.aggregator_origin", FT_IPv4
, BASE_NONE
,
12005 NULL
, 0x0, NULL
, HFILL
}},
12006 { &hf_bgp_update_path_attribute_as_path_segment
,
12007 { "AS Path segment", "bgp.update.path_attribute.as_path_segment", FT_NONE
, BASE_NONE
,
12008 NULL
, 0x0, NULL
, HFILL
}},
12009 { &hf_bgp_update_path_attribute_as_path_segment_type
,
12010 { "Segment type", "bgp.update.path_attribute.as_path_segment.type", FT_UINT8
, BASE_DEC
,
12011 VALS(as_segment_type
), 0x0, NULL
, HFILL
}},
12012 { &hf_bgp_update_path_attribute_as_path_segment_length
,
12013 { "Segment length (number of ASN)", "bgp.update.path_attribute.as_path_segment.length", FT_UINT8
, BASE_DEC
,
12014 NULL
, 0x0, NULL
, HFILL
}},
12015 { &hf_bgp_update_path_attribute_as_path_segment_as2
,
12016 { "AS2", "bgp.update.path_attribute.as_path_segment.as2", FT_UINT16
, BASE_DEC
,
12017 NULL
, 0x0, NULL
, HFILL
}},
12018 { &hf_bgp_update_path_attribute_as_path_segment_as4
,
12019 { "AS4", "bgp.update.path_attribute.as_path_segment.as4", FT_UINT32
, BASE_DEC
,
12020 NULL
, 0x0, NULL
, HFILL
}},
12021 { &hf_bgp_update_path_attribute_communities
,
12022 { "Communities", "bgp.update.path_attribute.communities", FT_NONE
, BASE_NONE
,
12023 NULL
, 0x0, NULL
, HFILL
}},
12024 { &hf_bgp_update_path_attribute_community
,
12025 { "Community", "bgp.update.path_attribute.community", FT_NONE
, BASE_NONE
,
12026 NULL
, 0x0, NULL
, HFILL
}},
12027 { &hf_bgp_update_path_attribute_community_well_known
,
12028 { "Community Well-known", "bgp.update.path_attribute.community_wellknown", FT_UINT32
, BASE_HEX
,
12029 VALS(community_vals
), 0x0, "Reserved", HFILL
}},
12030 { &hf_bgp_update_path_attribute_community_as
,
12031 { "Community AS", "bgp.update.path_attribute.community_as", FT_UINT16
, BASE_DEC
,
12032 NULL
, 0x0, NULL
, HFILL
}},
12033 { &hf_bgp_update_path_attribute_community_value
,
12034 { "Community value", "bgp.update.path_attribute.community_value", FT_UINT16
, BASE_DEC
,
12035 NULL
, 0x0, NULL
, HFILL
}},
12036 { &hf_bgp_update_path_attribute_local_pref
,
12037 { "Local preference", "bgp.update.path_attribute.local_pref", FT_UINT32
, BASE_DEC
,
12038 NULL
, 0x0, NULL
, HFILL
}},
12039 { &hf_bgp_update_path_attribute_attrset_origin_as
,
12040 { "Origin AS", "bgp.update.path_attribute.attr_set.origin_as", FT_UINT32
, BASE_DEC
,
12041 NULL
, 0x0, NULL
, HFILL
}},
12042 { &hf_bgp_update_path_attribute_multi_exit_disc
,
12043 { "Multiple exit discriminator", "bgp.update.path_attribute.multi_exit_disc", FT_UINT32
, BASE_DEC
,
12044 NULL
, 0x0, NULL
, HFILL
}},
12045 { &hf_bgp_update_path_attribute_next_hop
,
12046 { "Next hop", "bgp.update.path_attribute.next_hop", FT_IPv4
, BASE_NONE
,
12047 NULL
, 0x0, NULL
, HFILL
}},
12048 { &hf_bgp_update_path_attribute_origin
,
12049 { "Origin", "bgp.update.path_attribute.origin", FT_UINT8
, BASE_DEC
,
12050 VALS(bgpattr_origin
), 0x0, NULL
, HFILL
}},
12051 { &hf_bgp_update_path_attribute
,
12052 { "Path Attribute", "bgp.update.path_attribute", FT_NONE
, BASE_NONE
,
12053 NULL
, 0x0, NULL
, HFILL
}},
12054 { &hf_bgp_update_path_attribute_flags
,
12055 { "Flags", "bgp.update.path_attribute.flags", FT_UINT8
, BASE_HEX
,
12056 NULL
, 0x0, NULL
, HFILL
}},
12057 { &hf_bgp_update_path_attribute_flags_optional
,
12058 { "Optional", "bgp.update.path_attribute.flags.optional", FT_BOOLEAN
, 8,
12059 TFS(&tfs_set_notset
), BGP_ATTR_FLAG_OPTIONAL
, NULL
, HFILL
}},
12060 { &hf_bgp_update_path_attribute_flags_transitive
,
12061 { "Transitive", "bgp.update.path_attribute.flags.transitive", FT_BOOLEAN
, 8,
12062 TFS(&tfs_set_notset
), BGP_ATTR_FLAG_TRANSITIVE
, NULL
, HFILL
}},
12063 { &hf_bgp_update_path_attribute_flags_partial
,
12064 { "Partial", "bgp.update.path_attribute.flags.partial", FT_BOOLEAN
, 8,
12065 TFS(&tfs_set_notset
), BGP_ATTR_FLAG_PARTIAL
, NULL
, HFILL
}},
12066 { &hf_bgp_update_path_attribute_flags_extended_length
,
12067 { "Extended-Length", "bgp.update.path_attribute.flags.extended_length", FT_BOOLEAN
, 8,
12068 TFS(&tfs_set_notset
), BGP_ATTR_FLAG_EXTENDED_LENGTH
, NULL
, HFILL
}},
12069 { &hf_bgp_update_path_attribute_flags_unused
,
12070 { "Unused", "bgp.update.path_attribute.flags.unused", FT_UINT8
, BASE_HEX
,
12071 NULL
, BGP_ATTR_FLAG_UNUSED
, NULL
, HFILL
}},
12072 { &hf_bgp_update_path_attribute_type_code
,
12073 { "Type Code", "bgp.update.path_attribute.type_code", FT_UINT8
, BASE_DEC
,
12074 VALS(bgpattr_type
), 0x0, NULL
, HFILL
}},
12075 { &hf_bgp_update_path_attribute_length
,
12076 { "Length", "bgp.update.path_attribute.length", FT_UINT16
, BASE_DEC
,
12077 NULL
, 0x0, NULL
, HFILL
}},
12078 { &hf_bgp_update_path_attribute_link_state
,
12079 { "Link State", "bgp.update.path_attribute.link_state", FT_NONE
, BASE_NONE
,
12080 NULL
, 0x0, NULL
, HFILL
}},
12082 /* BGPsec Path Attributes, RFC8205*/
12083 { &hf_bgp_update_path_attribute_bgpsec_sp_len
,
12084 { "Length", "bgp.update.path_attribute.bgpsec.sp.length", FT_UINT16
, BASE_DEC
,
12085 NULL
, 0x0, NULL
, HFILL
}},
12086 { &hf_bgp_update_path_attribute_bgpsec_sps_pcount
,
12087 { "pCount", "bgp.update.path_attribute.bgpsec.sps.pcount", FT_UINT8
, BASE_DEC
,
12088 NULL
, 0x0, NULL
, HFILL
}},
12089 { &hf_bgp_update_path_attribute_bgpsec_sps_flags
,
12090 { "Flags", "bgp.update.path_attribute.bgpsec.sps.flags", FT_UINT8
, BASE_DEC
,
12091 NULL
, 0x0, NULL
, HFILL
}},
12092 { &hf_bgp_update_path_attribute_bgpsec_sps_as
,
12093 { "AS Number", "bgp.update.path_attribute.bgpsec.sps.as", FT_UINT32
, BASE_DEC
,
12094 NULL
, 0x0, NULL
, HFILL
}},
12095 { &hf_bgp_update_path_attribute_bgpsec_sb_len
,
12096 { "Length", "bgp.update.path_attribute.bgpsec.sb.length", FT_UINT16
, BASE_DEC
,
12097 NULL
, 0x0, NULL
, HFILL
}},
12098 { &hf_bgp_update_path_attribute_bgpsec_algo_id
,
12099 { "Algo ID", "bgp.update.path_attribute.bgpsec.sb.algo_id", FT_UINT8
, BASE_DEC
,
12100 NULL
, 0x0, NULL
, HFILL
}},
12101 { &hf_bgp_update_path_attribute_bgpsec_ski
,
12102 { "SKI", "bgp.update.path_attribute.bgpsec.ss.ski", FT_BYTES
, SEP_SPACE
,
12103 NULL
, 0x0, NULL
, HFILL
}},
12104 { &hf_bgp_update_path_attribute_bgpsec_sig_len
,
12105 { "Length", "bgp.update.path_attribute.bgpsec.ss.length", FT_UINT16
, BASE_DEC
,
12106 NULL
, 0x0, NULL
, HFILL
}},
12107 { &hf_bgp_update_path_attribute_bgpsec_sig
,
12108 { "Signature", "bgp.update.path_attribute.bgpsec.ss.sig", FT_BYTES
, SEP_SPACE
,
12109 NULL
, 0x0, NULL
, HFILL
}},
12111 { &hf_bgp_update_path_attribute_mp_reach_nlri_address_family
,
12112 { "Address family identifier (AFI)", "bgp.update.path_attribute.mp_reach_nlri.afi", FT_UINT16
, BASE_DEC
,
12113 VALS(afn_vals
), 0x0, NULL
, HFILL
}},
12114 { &hf_bgp_update_path_attribute_mp_reach_nlri_safi
,
12115 { "Subsequent address family identifier (SAFI)", "bgp.update.path_attribute.mp_reach_nlri.safi", FT_UINT8
, BASE_DEC
,
12116 VALS(bgpattr_nlri_safi
), 0x0, NULL
, HFILL
}},
12117 { &hf_bgp_update_path_attribute_mp_reach_nlri_next_hop
,
12118 { "Next hop", "bgp.update.path_attribute.mp_reach_nlri.next_hop", FT_BYTES
, BASE_NO_DISPLAY_VALUE
,
12119 NULL
, 0x0, NULL
, HFILL
}},
12120 { &hf_bgp_update_path_attribute_mp_reach_nlri_next_hop_rd
,
12121 { "Route Distinguisher", "bgp.update.path_attribute.mp_reach_nlri.next_hop.rd", FT_STRING
, BASE_NONE
,
12122 NULL
, 0x0, "RD is always zero in the Next Hop", HFILL
}},
12123 { &hf_bgp_update_path_attribute_mp_reach_nlri_next_hop_ipv4
,
12124 { "IPv4 Address", "bgp.update.path_attribute.mp_reach_nlri.next_hop.ipv4", FT_IPv4
, BASE_NONE
,
12125 NULL
, 0x0, NULL
, HFILL
}},
12126 { &hf_bgp_update_path_attribute_mp_reach_nlri_next_hop_ipv6
,
12127 { "IPv6 Address", "bgp.update.path_attribute.mp_reach_nlri.next_hop.ipv6", FT_IPv6
, BASE_NONE
,
12128 NULL
, 0x0, NULL
, HFILL
}},
12129 { &hf_bgp_update_path_attribute_mp_reach_nlri_next_hop_ipv6_link_local
,
12130 { "Link-local Address", "bgp.update.path_attribute.mp_reach_nlri.next_hop.ipv6.link_local", FT_IPv6
, BASE_NONE
,
12131 NULL
, 0x0, NULL
, HFILL
}},
12132 { &hf_bgp_update_path_attribute_mp_reach_nlri_nbr_snpa
,
12133 { "Number of Subnetwork points of attachment (SNPA)", "bgp.update.path_attribute.mp_reach_nlri.nbr_snpa", FT_UINT8
, BASE_DEC
,
12134 NULL
, 0x0, NULL
, HFILL
}},
12135 { &hf_bgp_update_path_attribute_mp_reach_nlri_snpa_length
,
12136 { "SNPA Length", "bgp.update.path_attribute.mp_reach_nlri.snpa_length", FT_UINT8
, BASE_DEC
,
12137 NULL
, 0x0, NULL
, HFILL
}},
12138 { &hf_bgp_update_path_attribute_mp_reach_nlri_snpa
,
12139 { "SNPA", "bgp.update.path_attribute.mp_reach_nlri.snpa", FT_BYTES
, BASE_NONE
,
12140 NULL
, 0x0, NULL
, HFILL
}},
12141 { &hf_bgp_update_path_attribute_mp_reach_nlri
,
12142 { "Network Layer Reachability Information (NLRI)", "bgp.update.path_attribute.mp_reach_nlri", FT_NONE
, BASE_NONE
,
12143 NULL
, 0x0, NULL
, HFILL
}},
12145 { &hf_bgp_update_path_attribute_mp_unreach_nlri_address_family
,
12146 { "Address family identifier (AFI)", "bgp.update.path_attribute.mp_unreach_nlri.afi", FT_UINT16
, BASE_DEC
,
12147 VALS(afn_vals
), 0x0, NULL
, HFILL
}},
12148 { &hf_bgp_update_path_attribute_mp_unreach_nlri_safi
,
12149 { "Subsequent address family identifier (SAFI)", "bgp.update.path_attribute.mp_unreach_nlri.safi", FT_UINT8
, BASE_DEC
,
12150 VALS(bgpattr_nlri_safi
), 0x0, NULL
, HFILL
}},
12151 { &hf_bgp_update_path_attribute_mp_unreach_nlri
,
12152 { "Withdrawn Routes", "bgp.update.path_attribute.mp_unreach_nlri", FT_NONE
, BASE_NONE
,
12153 NULL
, 0x0, NULL
, HFILL
}},
12155 { &hf_bgp_pmsi_tunnel_flags
,
12156 { "Flags", "bgp.update.path_attribute.pmsi.tunnel.flags", FT_UINT8
, BASE_DEC
,
12157 NULL
, 0x0, NULL
, HFILL
}},
12158 { &hf_bgp_pmsi_tunnel_type
,
12159 { "Tunnel Type", "bgp.update.path_attribute.pmsi.tunnel.type", FT_UINT8
, BASE_DEC
,
12160 VALS(pmsi_tunnel_type
), 0x0, NULL
, HFILL
}},
12161 { &hf_bgp_pmsi_tunnel_id
,
12162 { "Tunnel ID", "bgp.update.path_attribute.pmsi.tunnel.id", FT_NONE
, BASE_NONE
,
12163 NULL
, 0x0, NULL
, HFILL
}},
12164 { &hf_bgp_pmsi_tunnel_not_present
,
12165 { "Tunnel ID not present", "bgp.update.path_attribute.pmsi.tunnel_id.not_present", FT_NONE
, BASE_NONE
,
12166 NULL
, 0x0, NULL
, HFILL
}},
12167 { &hf_bgp_update_mpls_label
,
12168 { "MPLS Label Stack", "bgp.update.path_attribute.mpls_label", FT_NONE
,
12169 BASE_NONE
, NULL
, 0x0, NULL
, HFILL
}},
12170 { &hf_bgp_update_mpls_label_value_20bits
,
12171 { "MPLS Label", "bgp.update.path_attribute.mpls_label_value_20bits", FT_UINT24
,
12172 BASE_DEC
, NULL
, BGP_MPLS_LABEL
, NULL
, HFILL
}},
12173 { &hf_bgp_update_mpls_label_value
,
12174 { "MPLS Label", "bgp.update.path_attribute.mpls_label_value", FT_UINT24
,
12175 BASE_DEC
, NULL
, 0x0, NULL
, HFILL
}},
12176 { &hf_bgp_update_mpls_traffic_class
,
12177 { "Traffic Class", "bgp.update.path_attribute.mpls_traffic_class", FT_UINT24
,
12178 BASE_HEX
, NULL
, BGP_MPLS_TRAFFIC_CLASS
, NULL
, HFILL
}},
12179 { &hf_bgp_update_mpls_bottom_stack
,
12180 { "Bottom-of-Stack", "bgp.update.path_attribute.mpls_bottom_stack", FT_BOOLEAN
,
12181 24, NULL
, BGP_MPLS_BOTTOM_L_STACK
, NULL
, HFILL
}},
12182 { &hf_bgp_pmsi_tunnel_rsvp_p2mp_id
, /* RFC4875 section 19 */
12183 { "RSVP P2MP id", "bgp.update.path_attribute.pmsi.rsvp.id", FT_IPv4
, BASE_NONE
,
12184 NULL
, 0x0, NULL
, HFILL
}},
12185 { &hf_bgp_pmsi_tunnel_rsvp_p2mp_tunnel_id
,
12186 { "RSVP P2MP tunnel id", "bgp.update.path_attribute.pmsi.rsvp.tunnel_id", FT_UINT16
, BASE_DEC
,
12187 NULL
, 0x0, NULL
, HFILL
}},
12188 { &hf_bgp_pmsi_tunnel_rsvp_p2mp_ext_tunnel_idv4
,
12189 { "RSVP P2MP extended tunnel id", "bgp.update.path_attribute.pmsi.rsvp.ext_tunnel_idv4", FT_IPv4
, BASE_NONE
,
12190 NULL
, 0x0, NULL
, HFILL
}},
12191 { &hf_bgp_pmsi_tunnel_mldp_fec_el_type
,
12192 { "mLDP P2MP FEC element type", "bgp.update.path_attribute.pmsi.mldp.fec.type", FT_UINT8
, BASE_DEC
,
12193 VALS(fec_types_vals
), 0x0, NULL
, HFILL
}},
12194 { &hf_bgp_pmsi_tunnel_mldp_fec_el_afi
,
12195 {"mLDP P2MP FEC element address family", "bgp.update.path_attribute.pmsi.mldp.fec.address_family", FT_UINT16
, BASE_DEC
,
12196 VALS(afn_vals
), 0x0, NULL
, HFILL
}},
12197 { &hf_bgp_pmsi_tunnel_mldp_fec_el_adr_len
,
12198 {"mLDP P2MP FEC element address length", "bgp.update.path_attribute.pmsi.mldp.fec.address_length", FT_UINT8
, BASE_DEC
,
12199 NULL
, 0x0, NULL
, HFILL
}},
12200 { &hf_bgp_pmsi_tunnel_mldp_fec_el_root_nodev4
,
12201 {"mLDP P2MP FEC element root node address", "bgp.update.path_attribute.pmsi.mldp.fec.root_nodev4", FT_IPv4
, BASE_NONE
,
12202 NULL
, 0x0, NULL
, HFILL
}},
12203 { &hf_bgp_pmsi_tunnel_mldp_fec_el_root_nodev6
,
12204 {"mLDP P2MP FEC element root node address", "bgp.update.path_attribute.pmsi.mldp.fec.root_nodev6", FT_IPv6
, BASE_NONE
,
12205 NULL
, 0x0, NULL
, HFILL
}},
12206 { &hf_bgp_pmsi_tunnel_mldp_fec_el_opa_len
,
12207 {"mLDP P2MP FEC element opaque length", "bgp.update.path_attribute.pmsi.mldp.fec.opaque_length", FT_UINT16
, BASE_DEC
,
12208 NULL
, 0x0, NULL
, HFILL
}},
12209 { &hf_bgp_pmsi_tunnel_mldp_fec_el_opa_val_type
,
12210 {"mLDP P2MP FEC element opaque value type", "bgp.update.path_attribute.pmsi.mldp.fec.opaque_value_type", FT_UINT8
, BASE_DEC
,
12211 VALS(pmsi_mldp_fec_opaque_value_type
), 0x0, NULL
, HFILL
}},
12212 { &hf_bgp_pmsi_tunnel_mldp_fec_el_opa_val_len
,
12213 {"mLDP P2MP FEC element opaque value length", "bgp.update.path_attribute.pmsi.mldp.fec.opaque_value_length", FT_UINT16
, BASE_DEC
,
12214 NULL
, 0x0, NULL
, HFILL
}},
12215 { &hf_bgp_pmsi_tunnel_mldp_fec_el_opa_value_rn
,
12216 {"mLDP P2MP FEC element opaque value unique Id", "bgp.update.path_attribute.pmsi.mldp.fec.opaque_value_unique_id_rn", FT_UINT32
, BASE_DEC
,
12217 NULL
, 0x0, NULL
, HFILL
}},
12218 { &hf_bgp_pmsi_tunnel_mldp_fec_el_opa_value_str
,
12219 {"mLDP P2MP FEC element opaque value unique Id", "bgp.update.path_attribute.pmsi.mldp.fec.opaque_value_unique_id_str", FT_STRING
, BASE_NONE
,
12220 NULL
, 0x0, NULL
, HFILL
}},
12221 { &hf_bgp_pmsi_tunnel_mldp_fec_el_opa_val_ext_type
,
12222 {"mLDP P2MP FEC element opaque extended value type", "bgp.update.path_attribute.pmsi.mldp.fec.opaque_ext_value_type", FT_UINT16
, BASE_DEC
,
12223 VALS(pmsi_mldp_fec_opa_extented_type
), 0x0, NULL
, HFILL
}},
12224 { &hf_bgp_pmsi_tunnel_mldp_fec_el_opa_val_ext_len
,
12225 {"mLDP P2MP FEC element opaque extended length", "bgp.update.path_attribute.pmsi.mldp.fec.opaque_ext_length", FT_UINT16
, BASE_DEC
,
12226 NULL
, 0x0, NULL
, HFILL
}},
12227 { &hf_bgp_pmsi_tunnel_pimsm_sender
,
12228 {"PIM-SM Tree tunnel sender address", "bgp.update.path_attribute.pmsi.pimsm.sender_address", FT_IPv4
, BASE_NONE
,
12229 NULL
, 0x0, NULL
, HFILL
}},
12230 { &hf_bgp_pmsi_tunnel_pimsm_pmc_group
,
12231 {"PIM-SM Tree tunnel P-multicast group", "bgp.update.path_attribute.pmsi.pimsm.pmulticast_group", FT_IPv4
, BASE_NONE
,
12232 NULL
, 0x0, NULL
, HFILL
}},
12233 { &hf_bgp_pmsi_tunnel_pimssm_root_node
,
12234 {"PIM-SSM Tree tunnel Root Node", "bgp.update.path_attribute.pmsi.pimssm.root_node", FT_IPv4
, BASE_NONE
,
12235 NULL
, 0x0, NULL
, HFILL
}},
12236 { &hf_bgp_pmsi_tunnel_pimssm_pmc_group
,
12237 {"PIM-SSM Tree tunnel P-multicast group", "bgp.update.path_attribute.pmsi.pimssm.pmulticast_group", FT_IPv4
, BASE_NONE
,
12238 NULL
, 0x0, NULL
, HFILL
}},
12239 { &hf_bgp_pmsi_tunnel_pimbidir_sender
,
12240 {"BIDIR-PIM Tree Tunnel sender address", "bgp.update.path_attribute.pmsi.bidir_pim_tree.sender", FT_IPv4
, BASE_NONE
,
12241 NULL
, 0x0, NULL
, HFILL
}},
12242 { &hf_bgp_pmsi_tunnel_pimbidir_pmc_group
,
12243 {"BIDIR-PIM Tree Tunnel P-multicast group", "bgp.update.path_attribute.pmsi.bidir_pim_tree.pmulticast_group", FT_IPv4
, BASE_NONE
,
12244 NULL
, 0x0, NULL
, HFILL
}},
12245 { &hf_bgp_pmsi_tunnel_ingress_rep_addr
,
12246 {"Tunnel type ingress replication IP end point", "bgp.update.path_attribute.pmsi.ingress_rep_ip", FT_IPv4
, BASE_NONE
,
12247 NULL
, 0x0, NULL
, HFILL
}},
12248 { &hf_bgp_pmsi_tunnel_ingress_rep_addr6
,
12249 {"Tunnel type ingress replication IP end point", "bgp.update.path_attribute.pmsi.ingress_rep_ip6", FT_IPv6
, BASE_NONE
,
12250 NULL
, 0x0, NULL
, HFILL
}},
12252 /* BGP Only to Customer (OTC) Attribute, RFC9234 */
12253 { &hf_bgp_update_path_attribute_otc
,
12254 { "Only to Customer", "bgp.update.path_attribute.otc", FT_UINT32
, BASE_DEC
,
12255 NULL
, 0x0, NULL
, HFILL
}},
12257 /* https://tools.ietf.org/html/draft-rabadan-sajassi-bess-evpn-ipvpn-interworking-02 */
12258 { &hf_bgp_update_path_attribute_d_path
,
12259 { "Domain Path Attribute", "bgp.update.path_attribute.dpath", FT_STRING
, BASE_NONE
,
12260 NULL
, 0x0, NULL
, HFILL
}},
12261 { &hf_bgp_d_path_length
,
12262 {"Domain Path Attribute length", "bgp.update.attribute.dpath.length", FT_UINT16
, BASE_DEC
,
12263 NULL
, 0x0, NULL
, HFILL
}},
12264 { &hf_bgp_d_path_ga
,
12265 { "Global Administrator", "bgp.update.attribute.dpath.ga", FT_UINT32
, BASE_DEC
,
12266 NULL
, 0x0, "A four-octet namespace identifier. This SHOULD be an Autonomous System Number", HFILL
}},
12267 { &hf_bgp_d_path_la
,
12268 { "Local Administrator", "bgp.update.attribute.dpath.la", FT_UINT16
, BASE_DEC
,
12269 NULL
, 0x0, "A two-octet operator-defined value", HFILL
}},
12270 { &hf_bgp_d_path_isf_safi
,
12271 { "Inter-Subnet Forwarding SAFI type", "bgp.update.attribute.dpath.isf.safi", FT_UINT8
, BASE_DEC
,
12272 NULL
, 0x0, NULL
, HFILL
}},
12275 { &hf_bgp_update_path_attribute_aigp
,
12276 { "AIGP Attribute", "bgp.update.path_attribute.aigp", FT_NONE
, BASE_NONE
,
12277 NULL
, 0x0, NULL
, HFILL
}},
12278 { &hf_bgp_aigp_type
,
12279 {"AIGP attribute type", "bgp.update.attribute.aigp.type", FT_UINT8
, BASE_DEC
,
12280 VALS(aigp_tlv_type
), 0x0, NULL
, HFILL
}},
12281 { &hf_bgp_aigp_tlv_length
,
12282 {"AIGP TLV length", "bgp.update.attribute.aigp.length", FT_UINT16
, BASE_DEC
,
12283 NULL
, 0x0, NULL
, HFILL
}},
12284 { &hf_bgp_aigp_accu_igp_metric
,
12285 {"AIGP Accumulated IGP Metric", "bgp.update.attribute.aigp.accu_igp_metric", FT_UINT64
, BASE_DEC
,
12286 NULL
, 0x0, NULL
, HFILL
}},
12289 { &hf_bgp_large_communities
,
12290 { "Large Communities", "bgp.large_communities", FT_STRING
, BASE_NONE
,
12291 NULL
, 0x0, NULL
, HFILL
}},
12292 { &hf_bgp_large_communities_ga
,
12293 { "Global Administrator", "bgp.large_communities.ga", FT_UINT32
, BASE_DEC
,
12294 NULL
, 0x0, "A four-octet namespace identifier. This SHOULD be an Autonomous System Number", HFILL
}},
12295 { &hf_bgp_large_communities_ldp1
,
12296 { "Local Data Part 1", "bgp.large_communities.ldp1", FT_UINT32
, BASE_DEC
,
12297 NULL
, 0x0, "A four-octet operator-defined value", HFILL
}},
12298 { &hf_bgp_large_communities_ldp2
,
12299 { "Local Data Part 2", "bgp.large_communities.ldp2", FT_UINT32
, BASE_DEC
,
12300 NULL
, 0x0, "A four-octet operator-defined value", HFILL
}},
12303 { &hf_bgp_update_path_attribute_originator_id
,
12304 { "Originator identifier", "bgp.update.path_attribute.originator_id", FT_IPv4
, BASE_NONE
,
12305 NULL
, 0x0, NULL
, HFILL
}},
12306 { &hf_bgp_update_path_attribute_cluster_list
,
12307 { "Cluster List", "bgp.path_attribute.cluster_list", FT_NONE
, BASE_NONE
,
12308 NULL
, 0x0, NULL
, HFILL
}},
12309 { &hf_bgp_update_path_attribute_cluster_id
,
12310 { "Cluster ID", "bgp.path_attribute.cluster_id", FT_IPv4
, BASE_NONE
,
12311 NULL
, 0x0, NULL
, HFILL
}},
12314 { &hf_bgp_prefix_sid_unknown
,
12315 { "Unknown TLV", "bgp.prefix_sid.unknown", FT_NONE
, BASE_NONE
,
12316 NULL
, 0x0, NULL
, HFILL
}},
12317 { &hf_bgp_prefix_sid_label_index
,
12318 { "Label-Index", "bgp.prefix_sid.label_index", FT_NONE
, BASE_NONE
,
12319 NULL
, 0x0, NULL
, HFILL
}},
12320 { &hf_bgp_prefix_sid_label_index_value
,
12321 { "Label-Index Value", "bgp.prefix_sid.label_index.value", FT_UINT32
, BASE_DEC
,
12322 NULL
, 0x0, "4-octet label index value", HFILL
}},
12323 { &hf_bgp_prefix_sid_label_index_flags
,
12324 { "Label-Index Flags", "bgp.prefix_sid.label_index.flags", FT_UINT16
, BASE_HEX
,
12325 NULL
, 0x0, "2-octet flags, None is defined", HFILL
}},
12326 { &hf_bgp_prefix_sid_originator_srgb_flags
,
12327 { "Originator SRGB Flags", "bgp.prefix_sid.originator_srgb.flags", FT_UINT16
, BASE_HEX
,
12328 NULL
, 0x0, "2-octet flags, None is defined", HFILL
}},
12329 { &hf_bgp_prefix_sid_originator_srgb
,
12330 { "Originator SRGB", "bgp.prefix_sid.originator_srgb", FT_NONE
, BASE_NONE
,
12331 NULL
, 0x0, NULL
, HFILL
}},
12332 { &hf_bgp_prefix_sid_originator_srgb_blocks
,
12333 { "SRGB Blocks", "bgp.prefix_sid.originator_srgb_blocks", FT_NONE
, BASE_NONE
,
12334 NULL
, 0x0, NULL
, HFILL
}},
12335 { &hf_bgp_prefix_sid_originator_srgb_block
,
12336 { "SRGB Block", "bgp.prefix_sid.originator_srgb_block", FT_NONE
, BASE_NONE
,
12337 NULL
, 0x0, NULL
, HFILL
}},
12338 { &hf_bgp_prefix_sid_originator_srgb_base
,
12339 { "SRGB Base", "bgp.prefix_sid.originator_srgb_base", FT_UINT24
, BASE_DEC
,
12340 NULL
, 0x0, "A three-octet value", HFILL
}},
12341 { &hf_bgp_prefix_sid_originator_srgb_range
,
12342 { "SRGB Range", "bgp.prefix_sid.originator_srgb_range", FT_UINT24
, BASE_DEC
,
12343 NULL
, 0x0, "A three-octet value", HFILL
}},
12344 { &hf_bgp_prefix_sid_type
,
12345 { "Type", "bgp.prefix_sid.type", FT_UINT8
, BASE_DEC
,
12346 VALS(bgp_prefix_sid_type
), 0x0, "BGP Prefix-SID message type", HFILL
}},
12347 { &hf_bgp_prefix_sid_length
,
12348 { "Length", "bgp.prefix_sid.length", FT_UINT16
, BASE_DEC
,
12349 NULL
, 0x0, "BGP Prefix-SID message payload", HFILL
}},
12350 { &hf_bgp_prefix_sid_value
,
12351 { "Value", "bgp.prefix_sid.value", FT_BYTES
, BASE_NONE
,
12352 NULL
, 0x0, "BGP Prefix-SID message value", HFILL
}},
12353 { &hf_bgp_prefix_sid_reserved
,
12354 { "Reserved", "bgp.prefix_sid.reserved", FT_BYTES
,
12355 BASE_NONE
, NULL
, 0x0, "Unused (must be clear)", HFILL
}},
12357 /* draft-ietf-bess-srv6-services-05 */
12358 { &hf_bgp_prefix_sid_srv6_l3vpn
,
12359 { "SRv6 L3 Service", "bgp.prefix_sid.srv6_l3vpn", FT_NONE
, BASE_NONE
,
12360 NULL
, 0x0, NULL
, HFILL
}},
12361 { &hf_bgp_prefix_sid_srv6_l3vpn_sub_tlvs
,
12362 { "SRv6 Service Sub-TLVs", "bgp.prefix_sid.srv6_l3vpn.sub_tlvs", FT_NONE
, BASE_NONE
,
12363 NULL
, 0x0, NULL
, HFILL
}},
12364 { &hf_bgp_prefix_sid_srv6_l3vpn_sub_tlv
,
12365 { "SRv6 Service Sub-TLV", "bgp.prefix_sid.srv6_l3vpn.sub_tlv", FT_NONE
, BASE_NONE
,
12366 NULL
, 0x0, NULL
, HFILL
}},
12367 { &hf_bgp_prefix_sid_srv6_l3vpn_sub_tlv_type
,
12368 { "Type", "bgp.prefix_sid.srv6_l3vpn.sub_tlv.type", FT_UINT8
, BASE_DEC
,
12369 VALS(srv6_service_sub_tlv_type
), 0x0, "SRv6 Service Sub-TLV type", HFILL
}},
12370 { &hf_bgp_prefix_sid_srv6_l3vpn_sub_tlv_length
,
12371 { "Length", "bgp.prefix_sid.srv6_l3vpn.sub_tlv.length", FT_UINT16
, BASE_DEC
,
12372 NULL
, 0x0, "SRv6 Service Sub-TLV length", HFILL
}},
12373 { &hf_bgp_prefix_sid_srv6_l3vpn_sub_tlv_value
,
12374 { "Value", "bgp.prefix_sid.srv6_l3vpn.sub_tlv.value", FT_BYTES
, BASE_NONE
,
12375 NULL
, 0x0, "SRv6 Service Sub-TLV value", HFILL
}},
12376 { &hf_bgp_prefix_sid_srv6_l3vpn_sub_tlv_reserved
,
12377 { "Reserved", "bgp.prefix_sid.srv6_l3vpn.sub_tlv.reserved", FT_BYTES
,
12378 BASE_NONE
, NULL
, 0x0, "Unused (must be clear)", HFILL
}},
12379 { &hf_bgp_prefix_sid_srv6_l3vpn_sid_value
,
12380 { "SRv6 SID Value", "bgp.prefix_sid.srv6_l3vpn.sid_value", FT_IPv6
, BASE_NONE
,
12381 NULL
, 0x0, NULL
, HFILL
}},
12382 { &hf_bgp_prefix_sid_srv6_l3vpn_sid_flags
,
12383 { "SRv6 SID Flags", "bgp.prefix_sid.srv6_l3vpn.sid_flags", FT_UINT8
, BASE_HEX
,
12384 NULL
, 0x0, NULL
, HFILL
}},
12385 { &hf_bgp_prefix_sid_srv6_l3vpn_srv6_endpoint_behavior
,
12386 { "SRv6 Endpoint Behavior", "bgp.prefix_sid.srv6_l3vpn.srv6_endpoint_behavior", FT_UINT16
, BASE_HEX
,
12387 VALS(srv6_endpoint_behavior
), 0x0, NULL
, HFILL
}},
12388 { &hf_bgp_prefix_sid_srv6_l3vpn_reserved
,
12389 { "Reserved", "bgp.prefix_sid.srv6_l3vpn.reserved", FT_BYTES
,
12390 BASE_NONE
, NULL
, 0x0, "Unused (must be clear)", HFILL
}},
12391 { &hf_bgp_prefix_sid_srv6_l3vpn_sub_sub_tlvs
,
12392 { "SRv6 Service Data Sub-Sub-TLVs", "bgp.prefix_sid.srv6_l3vpn.sub_sub_tlvs", FT_NONE
, BASE_NONE
,
12393 NULL
, 0x0, NULL
, HFILL
}},
12394 { &hf_bgp_prefix_sid_srv6_l3vpn_sub_sub_tlv
,
12395 { "SRv6 Service Data Sub-Sub-TLV", "bgp.prefix_sid.srv6_l3vpn.sub_sub_tlv", FT_NONE
, BASE_NONE
,
12396 NULL
, 0x0, NULL
, HFILL
}},
12397 { &hf_bgp_prefix_sid_srv6_l3vpn_sub_sub_tlv_type
,
12398 { "Type", "bgp.prefix_sid.srv6_l3vpn.sub_sub_tlv.type", FT_UINT8
, BASE_DEC
,
12399 VALS(srv6_service_data_sub_sub_tlv_type
), 0x0, "SRv6 Service Data Sub-Sub-TLV type", HFILL
}},
12400 { &hf_bgp_prefix_sid_srv6_l3vpn_sub_sub_tlv_length
,
12401 { "Length", "bgp.prefix_sid.srv6_l3vpn.sub_sub_tlv.length", FT_UINT16
, BASE_DEC
,
12402 NULL
, 0x0, "SRv6 Service Data Sub-Sub-TLV length", HFILL
}},
12403 { &hf_bgp_prefix_sid_srv6_l3vpn_sub_sub_tlv_value
,
12404 { "Value", "bgp.prefix_sid.srv6_l3vpn.sub_sub_tlv.value", FT_BYTES
, BASE_NONE
,
12405 NULL
, 0x0, "SRv6 Service Data Sub-Sub-TLV value", HFILL
}},
12406 { &hf_bgp_prefix_sid_srv6_l3vpn_sid_locator_block_len
,
12407 { "Locator Block Length", "bgp.prefix_sid.srv6_l3vpn.sid.locator_block_len", FT_UINT8
, BASE_DEC
,
12408 NULL
, 0x0, NULL
, HFILL
}},
12409 { &hf_bgp_prefix_sid_srv6_l3vpn_sid_locator_node_len
,
12410 { "Locator Node Length", "bgp.prefix_sid.srv6_l3vpn.sid.locator_node_len", FT_UINT8
, BASE_DEC
,
12411 NULL
, 0x0, NULL
, HFILL
}},
12412 { &hf_bgp_prefix_sid_srv6_l3vpn_sid_func_len
,
12413 { "Function Length", "bgp.prefix_sid.srv6_l3vpn.sid.func_len", FT_UINT8
, BASE_DEC
,
12414 NULL
, 0x0, NULL
, HFILL
}},
12415 { &hf_bgp_prefix_sid_srv6_l3vpn_sid_arg_len
,
12416 { "Argument Length", "bgp.prefix_sid.srv6_l3vpn.sid.arg_len", FT_UINT8
, BASE_DEC
,
12417 NULL
, 0x0, NULL
, HFILL
}},
12418 { &hf_bgp_prefix_sid_srv6_l3vpn_sid_trans_len
,
12419 { "Transposition Length", "bgp.prefix_sid.srv6_l3vpn.sid.trans_len", FT_UINT8
, BASE_DEC
,
12420 NULL
, 0x0, NULL
, HFILL
}},
12421 { &hf_bgp_prefix_sid_srv6_l3vpn_sid_trans_offset
,
12422 { "Transposition Offset", "bgp.prefix_sid.srv6_l3vpn.sid.trans_offset", FT_UINT8
, BASE_DEC
,
12423 NULL
, 0x0, NULL
, HFILL
}},
12424 { &hf_bgp_prefix_sid_srv6_l2vpn
,
12425 { "SRv6 L2 Service", "bgp.prefix_sid.srv6_l2vpn", FT_NONE
, BASE_NONE
,
12426 NULL
, 0x0, NULL
, HFILL
}},
12427 { &hf_bgp_prefix_sid_srv6_l2vpn_sub_tlvs
,
12428 { "SRv6 Service Sub-TLVs", "bgp.prefix_sid.srv6_l2vpn.sub_tlvs", FT_NONE
, BASE_NONE
,
12429 NULL
, 0x0, NULL
, HFILL
}},
12430 { &hf_bgp_prefix_sid_srv6_l2vpn_sub_tlv
,
12431 { "SRv6 Service Sub-TLV", "bgp.prefix_sid.srv6_l2vpn.sub_tlv", FT_NONE
, BASE_NONE
,
12432 NULL
, 0x0, NULL
, HFILL
}},
12433 { &hf_bgp_prefix_sid_srv6_l2vpn_sub_tlv_type
,
12434 { "Type", "bgp.prefix_sid.srv6_l2vpn.sub_tlv.type", FT_UINT8
, BASE_DEC
,
12435 VALS(srv6_service_sub_tlv_type
), 0x0, "SRv6 Service Sub-TLV type", HFILL
}},
12436 { &hf_bgp_prefix_sid_srv6_l2vpn_sub_tlv_length
,
12437 { "Length", "bgp.prefix_sid.srv6_l2vpn.sub_tlv.length", FT_UINT16
, BASE_DEC
,
12438 NULL
, 0x0, "SRv6 Service Sub-TLV length", HFILL
}},
12439 { &hf_bgp_prefix_sid_srv6_l2vpn_sub_tlv_value
,
12440 { "Value", "bgp.prefix_sid.srv6_l2vpn.sub_tlv.value", FT_BYTES
, BASE_NONE
,
12441 NULL
, 0x0, "SRv6 Service Sub-TLV value", HFILL
}},
12442 { &hf_bgp_prefix_sid_srv6_l2vpn_sub_tlv_reserved
,
12443 { "Reserved", "bgp.prefix_sid.srv6_l2vpn.sub_tlv.reserved", FT_BYTES
,
12444 BASE_NONE
, NULL
, 0x0, "Unused (must be clear)", HFILL
}},
12445 { &hf_bgp_prefix_sid_srv6_l2vpn_sid_value
,
12446 { "SRv6 SID Value", "bgp.prefix_sid.srv6_l2vpn.sid_value", FT_IPv6
, BASE_NONE
,
12447 NULL
, 0x0, NULL
, HFILL
}},
12448 { &hf_bgp_prefix_sid_srv6_l2vpn_sid_flags
,
12449 { "SRv6 SID Flags", "bgp.prefix_sid.srv6_l2vpn.sid_flags", FT_UINT8
, BASE_HEX
,
12450 NULL
, 0x0, NULL
, HFILL
}},
12451 { &hf_bgp_prefix_sid_srv6_l2vpn_srv6_endpoint_behavior
,
12452 { "SRv6 Endpoint Behavior", "bgp.prefix_sid.srv6_l2vpn.srv6_endpoint_behavior", FT_UINT16
, BASE_HEX
,
12453 VALS(srv6_endpoint_behavior
), 0x0, NULL
, HFILL
}},
12454 { &hf_bgp_prefix_sid_srv6_l2vpn_reserved
,
12455 { "Reserved", "bgp.prefix_sid.srv6_l2vpn.reserved", FT_BYTES
,
12456 BASE_NONE
, NULL
, 0x0, "Unused (must be clear)", HFILL
}},
12457 { &hf_bgp_prefix_sid_srv6_l2vpn_sub_sub_tlvs
,
12458 { "SRv6 Service Data Sub-Sub-TLVs", "bgp.prefix_sid.srv6_l2vpn.sub_sub_tlvs", FT_NONE
, BASE_NONE
,
12459 NULL
, 0x0, NULL
, HFILL
}},
12460 { &hf_bgp_prefix_sid_srv6_l2vpn_sub_sub_tlv
,
12461 { "SRv6 Service Data Sub-Sub-TLV", "bgp.prefix_sid.srv6_l2vpn.sub_sub_tlv", FT_NONE
, BASE_NONE
,
12462 NULL
, 0x0, NULL
, HFILL
}},
12463 { &hf_bgp_prefix_sid_srv6_l2vpn_sub_sub_tlv_type
,
12464 { "Type", "bgp.prefix_sid.srv6_l2vpn.sub_sub_tlv.type", FT_UINT8
, BASE_DEC
,
12465 VALS(srv6_service_data_sub_sub_tlv_type
), 0x0, "SRv6 Service Data Sub-Sub-TLV type", HFILL
}},
12466 { &hf_bgp_prefix_sid_srv6_l2vpn_sub_sub_tlv_length
,
12467 { "Length", "bgp.prefix_sid.srv6_l2vpn.sub_sub_tlv.length", FT_UINT16
, BASE_DEC
,
12468 NULL
, 0x0, "SRv6 Service Data Sub-Sub-TLV length", HFILL
}},
12469 { &hf_bgp_prefix_sid_srv6_l2vpn_sub_sub_tlv_value
,
12470 { "Value", "bgp.prefix_sid.srv6_l2vpn.sub_sub_tlv.value", FT_BYTES
, BASE_NONE
,
12471 NULL
, 0x0, "SRv6 Service Data Sub-Sub-TLV value", HFILL
}},
12472 { &hf_bgp_prefix_sid_srv6_l2vpn_sid_locator_block_len
,
12473 { "Locator Block Length", "bgp.prefix_sid.srv6_l2vpn.sid.locator_block_len", FT_UINT8
, BASE_DEC
,
12474 NULL
, 0x0, NULL
, HFILL
}},
12475 { &hf_bgp_prefix_sid_srv6_l2vpn_sid_locator_node_len
,
12476 { "Locator Node Length", "bgp.prefix_sid.srv6_l2vpn.sid.locator_node_len", FT_UINT8
, BASE_DEC
,
12477 NULL
, 0x0, NULL
, HFILL
}},
12478 { &hf_bgp_prefix_sid_srv6_l2vpn_sid_func_len
,
12479 { "Function Length", "bgp.prefix_sid.srv6_l2vpn.sid.func_len", FT_UINT8
, BASE_DEC
,
12480 NULL
, 0x0, NULL
, HFILL
}},
12481 { &hf_bgp_prefix_sid_srv6_l2vpn_sid_arg_len
,
12482 { "Argument Length", "bgp.prefix_sid.srv6_l2vpn.sid.arg_len", FT_UINT8
, BASE_DEC
,
12483 NULL
, 0x0, NULL
, HFILL
}},
12484 { &hf_bgp_prefix_sid_srv6_l2vpn_sid_trans_len
,
12485 { "Transposition Length", "bgp.prefix_sid.srv6_l2vpn.sid.trans_len", FT_UINT8
, BASE_DEC
,
12486 NULL
, 0x0, NULL
, HFILL
}},
12487 { &hf_bgp_prefix_sid_srv6_l2vpn_sid_trans_offset
,
12488 { "Transposition Offset", "bgp.prefix_sid.srv6_l2vpn.sid.trans_offset", FT_UINT8
, BASE_DEC
,
12489 NULL
, 0x0, NULL
, HFILL
}},
12491 /* RFC5512 : BGP Encapsulation SAFI and the BGP Tunnel Encapsulation Attribute */
12492 { &hf_bgp_update_encaps_tunnel_tlv_len
,
12493 { "length", "bgp.update.encaps_tunnel_tlv_len", FT_UINT16
,
12494 BASE_DEC
, NULL
, 0x0, NULL
, HFILL
}},
12495 { &hf_bgp_update_encaps_tunnel_tlv_type
,
12496 { "Type code", "bgp.update.encaps_tunnel_tlv_type", FT_UINT16
, BASE_DEC
,
12497 VALS(bgp_attr_tunnel_type
), 0x0, NULL
, HFILL
}},
12498 { &hf_bgp_update_encaps_tunnel_subtlv_len
,
12499 { "length", "bgp.update.encaps_tunnel_tlv_sublen", FT_UINT16
,
12500 BASE_DEC
, NULL
, 0x0, NULL
, HFILL
}},
12501 { &hf_bgp_update_encaps_tunnel_subtlv_type
,
12502 { "Type code", "bgp.update.encaps_tunnel_subtlv_type", FT_UINT8
, BASE_DEC
,
12503 VALS(subtlv_type
), 0x0, NULL
, HFILL
}},
12504 { &hf_bgp_update_encaps_tunnel_subtlv_session_id
,
12505 { "Session ID", "bgp.update.encaps_tunnel_tlv_subtlv_session_id", FT_UINT32
,
12506 BASE_DEC
, NULL
, 0x0, NULL
, HFILL
}},
12507 { &hf_bgp_update_encaps_tunnel_subtlv_cookie
,
12508 { "Cookie", "bgp.update.encaps_tunnel_tlv_subtlv_cookie", FT_BYTES
,
12509 BASE_NONE
, NULL
, 0x0, NULL
, HFILL
}},
12510 { &hf_bgp_update_encaps_tunnel_subtlv_gre_key
,
12511 { "GRE Key", "bgp.update.encaps_tunnel_tlv_subtlv_gre_key", FT_UINT32
,
12512 BASE_DEC
, NULL
, 0x0, NULL
, HFILL
}},
12513 { &hf_bgp_update_encaps_tunnel_subtlv_color_value
,
12514 { "Color Value", "bgp.update.encaps_tunnel_tlv_subtlv_color_value", FT_UINT32
,
12515 BASE_DEC
, NULL
, 0x0, NULL
, HFILL
}},
12516 { &hf_bgp_update_encaps_tunnel_subtlv_lb_block_length
,
12517 { "Load-balancing block length", "bgp.update.encaps_tunnel_tlv_subtlv_lb_block_length", FT_UINT32
,
12518 BASE_DEC
, NULL
, 0x0, NULL
, HFILL
}},
12519 { &hf_bgp_update_encaps_tunnel_subtlv_vxlan_flags
,
12520 { "Flags", "bgp.update.encaps_tunnel_tlv_subtlv.vxlan.flags", FT_UINT8
,
12521 BASE_HEX
, NULL
, 0x0, NULL
, HFILL
}},
12522 { &hf_bgp_update_encaps_tunnel_subtlv_vxlan_flags_valid_vnid
,
12523 { "Valid VN-ID", "bgp.update.encaps_tunnel_tlv_subtlv.vxlan.flags.valid_vnid", FT_BOOLEAN
,
12524 8, TFS(&tfs_set_notset
), TUNNEL_SUBTLV_VXLAN_VALID_VNID
, NULL
, HFILL
}},
12525 { &hf_bgp_update_encaps_tunnel_subtlv_vxlan_flags_valid_mac
,
12526 { "Valid MAC address", "bgp.update.encaps_tunnel_tlv_subtlv.vxlan.flags.valid_mac", FT_BOOLEAN
,
12527 8, TFS(&tfs_set_notset
), TUNNEL_SUBTLV_VXLAN_VALID_MAC
, NULL
, HFILL
}},
12528 { &hf_bgp_update_encaps_tunnel_subtlv_vxlan_flags_reserved
,
12529 { "Reserved", "bgp.update.encaps_tunnel_tlv_subtlv.vxlan.flags.reserved", FT_UINT8
,
12530 BASE_HEX
, NULL
, TUNNEL_SUBTLV_VXLAN_RESERVED
, NULL
, HFILL
}},
12531 { &hf_bgp_update_encaps_tunnel_subtlv_vxlan_vnid
,
12532 { "VN-ID", "bgp.update.encaps_tunnel_tlv_subtlv.vxlan.vnid", FT_UINT24
,
12533 BASE_HEX
, NULL
, 0x0, NULL
, HFILL
}},
12534 { &hf_bgp_update_encaps_tunnel_subtlv_vxlan_mac
,
12535 { "MAC", "bgp.update.encaps_tunnel_tlv_subtlv.vxlan.mac", FT_ETHER
,
12536 BASE_NONE
, NULL
, 0x0, NULL
, HFILL
}},
12537 { &hf_bgp_update_encaps_tunnel_subtlv_vxlan_reserved
,
12538 { "Reserved", "bgp.update.encaps_tunnel_tlv_subtlv.vxlan.reserved", FT_UINT16
,
12539 BASE_HEX
, NULL
, 0x0, NULL
, HFILL
}},
12540 { &hf_bgp_update_encaps_tunnel_subtlv_vxlan_gpe_flags
,
12541 { "Flags", "bgp.update.encaps_tunnel_tlv_subtlv.vxlan_gpe.flags", FT_UINT8
,
12542 BASE_HEX
, NULL
, 0x0, NULL
, HFILL
}},
12543 { &hf_bgp_update_encaps_tunnel_subtlv_vxlan_gpe_flags_version
,
12544 { "Version", "bgp.update.encaps_tunnel_tlv_subtlv.vxlan_gpe.flags.version", FT_UINT8
,
12545 BASE_DEC
, NULL
, TUNNEL_SUBTLV_VXLAN_GPE_VERSION
, NULL
, HFILL
}},
12546 { &hf_bgp_update_encaps_tunnel_subtlv_vxlan_gpe_flags_valid_vnid
,
12547 { "Valid VN-ID", "bgp.update.encaps_tunnel_tlv_subtlv.vxlan_gpe.flags.valid_vnid", FT_BOOLEAN
,
12548 8, TFS(&tfs_set_notset
), TUNNEL_SUBTLV_VXLAN_GPE_VALID_VNID
, NULL
, HFILL
}},
12549 { &hf_bgp_update_encaps_tunnel_subtlv_vxlan_gpe_flags_reserved
,
12550 { "Reserved", "bgp.update.encaps_tunnel_tlv_subtlv.vxlan_gpe.flags.reserved", FT_UINT8
,
12551 BASE_HEX
, NULL
, TUNNEL_SUBTLV_VXLAN_GPE_RESERVED
, NULL
, HFILL
}},
12552 { &hf_bgp_update_encaps_tunnel_subtlv_vxlan_gpe_vnid
,
12553 { "VN-ID", "bgp.update.encaps_tunnel_tlv_subtlv.vxlan_gpe.vnid", FT_UINT24
,
12554 BASE_HEX
, NULL
, 0x0, NULL
, HFILL
}},
12555 { &hf_bgp_update_encaps_tunnel_subtlv_vxlan_gpe_reserved
,
12556 { "Reserved", "bgp.update.encaps_tunnel_tlv_subtlv.vxlan_gpe.reserved", FT_UINT16
,
12557 BASE_HEX
, NULL
, 0x0, NULL
, HFILL
}},
12558 { &hf_bgp_update_encaps_tunnel_subtlv_nvgre_flags
,
12559 { "Flags", "bgp.update.encaps_tunnel_tlv_subtlv.nvgre.flags", FT_UINT8
,
12560 BASE_HEX
, NULL
, 0x0, NULL
, HFILL
}},
12561 { &hf_bgp_update_encaps_tunnel_subtlv_nvgre_flags_valid_vnid
,
12562 { "Valid VN-ID", "bgp.update.encaps_tunnel_tlv_subtlv.nvgre.flags.valid_vnid", FT_BOOLEAN
,
12563 8, TFS(&tfs_set_notset
), TUNNEL_SUBTLV_NVGRE_VALID_VNID
, NULL
, HFILL
}},
12564 { &hf_bgp_update_encaps_tunnel_subtlv_nvgre_flags_valid_mac
,
12565 { "Valid MAC address", "bgp.update.encaps_tunnel_tlv_subtlv.nvgre.flags.valid_mac", FT_BOOLEAN
,
12566 8, TFS(&tfs_set_notset
), TUNNEL_SUBTLV_NVGRE_VALID_MAC
, NULL
, HFILL
}},
12567 { &hf_bgp_update_encaps_tunnel_subtlv_nvgre_flags_reserved
,
12568 { "Reserved", "bgp.update.encaps_tunnel_tlv_subtlv.nvgre.flags.reserved", FT_UINT8
,
12569 BASE_HEX
, NULL
, TUNNEL_SUBTLV_NVGRE_RESERVED
, NULL
, HFILL
}},
12570 { &hf_bgp_update_encaps_tunnel_subtlv_nvgre_vnid
,
12571 { "VN-ID", "bgp.update.encaps_tunnel_tlv_subtlv.nvgre.vnid", FT_UINT24
,
12572 BASE_HEX
, NULL
, 0x0, NULL
, HFILL
}},
12573 { &hf_bgp_update_encaps_tunnel_subtlv_nvgre_mac
,
12574 { "MAC", "bgp.update.encaps_tunnel_tlv_subtlv.nvgre.mac", FT_ETHER
,
12575 BASE_NONE
, NULL
, 0x0, NULL
, HFILL
}},
12576 { &hf_bgp_update_encaps_tunnel_subtlv_nvgre_reserved
,
12577 { "Reserved", "bgp.update.encaps_tunnel_tlv_subtlv.nvgre.reserved", FT_UINT16
,
12578 BASE_HEX
, NULL
, 0x0, NULL
, HFILL
}},
12579 { &hf_bgp_update_encaps_tunnel_subtlv_value
,
12580 { "Value", "bgp.update.encaps_tunnel_tlv_subtlv.value", FT_BYTES
,
12581 BASE_NONE
, NULL
, 0x0, NULL
, HFILL
}},
12582 { &hf_bgp_update_encaps_tunnel_subtlv_pref_flags
,
12583 { "Flags", "bgp.update.encaps_tunnel_tlv_subtlv.pref.flags", FT_UINT8
,
12584 BASE_HEX
, NULL
, 0x0, NULL
, HFILL
}},
12585 { &hf_bgp_update_encaps_tunnel_subtlv_pref_reserved
,
12586 { "Reserved", "bgp.update.encaps_tunnel_tlv_subtlv.pref.reserved", FT_UINT8
,
12587 BASE_HEX
, NULL
, 0x0, NULL
, HFILL
}},
12588 { &hf_bgp_update_encaps_tunnel_subtlv_pref_preference
,
12589 { "Preference", "bgp.update.encaps_tunnel_tlv_subtlv.pref.preference", FT_BYTES
,
12590 BASE_NONE
, NULL
, 0x0, NULL
, HFILL
}},
12591 { &hf_bgp_update_encaps_tunnel_subtlv_binding_sid_flags
,
12592 { "Flags", "bgp.update.encaps_tunnel_tlv_subtlv.binding_sid.flags", FT_UINT8
,
12593 BASE_HEX
, NULL
, 0x0, NULL
, HFILL
}},
12594 { &hf_bgp_update_encaps_tunnel_subtlv_binding_sid_flags_specified
,
12595 { "Specified-BSID-only", "bgp.update.encaps_tunnel_tlv_subtlv.binding_sid.flags.specified", FT_BOOLEAN
,
12596 8, TFS(&tfs_set_notset
), TUNNEL_SUBTLV_BINDING_SPECIFIED
, NULL
, HFILL
}},
12597 { &hf_bgp_update_encaps_tunnel_subtlv_binding_sid_flags_invalid
,
12598 { "Drop Upon Invalid", "bgp.update.encaps_tunnel_tlv_subtlv.binding_sid.flags.invalid", FT_BOOLEAN
,
12599 8, TFS(&tfs_set_notset
), TUNNEL_SUBTLV_BINDING_INVALID
, NULL
, HFILL
}},
12600 { &hf_bgp_update_encaps_tunnel_subtlv_binding_sid_flags_reserved
,
12601 { "Reserved", "bgp.update.encaps_tunnel_tlv_subtlv.binding_sid.flags.reserved", FT_UINT8
,
12602 BASE_HEX
, NULL
, TUNNEL_SUBTLV_BINDING_RESERVED
, NULL
, HFILL
}},
12603 { &hf_bgp_update_encaps_tunnel_subtlv_binding_sid_reserved
,
12604 { "Reserved", "bgp.update.encaps_tunnel_tlv_subtlv.binding_sid.reserved", FT_UINT8
,
12605 BASE_HEX
, NULL
, 0x0, NULL
, HFILL
}},
12606 { &hf_bgp_update_encaps_tunnel_subtlv_binding_sid_sid
,
12607 { "Binding SID", "bgp.update.encaps_tunnel_tlv_subtlv.binding_sid.sid", FT_BYTES
,
12608 BASE_NONE
, NULL
, 0x0, NULL
, HFILL
}},
12609 { &hf_bgp_update_encaps_tunnel_subtlv_enlp_flags
,
12610 { "Flags", "bgp.update.encaps_tunnel_tlv_subtlv.enlp.flags", FT_UINT8
,
12611 BASE_HEX
, NULL
, 0x0, NULL
, HFILL
}},
12612 { &hf_bgp_update_encaps_tunnel_subtlv_enlp_reserved
,
12613 { "Reserved", "bgp.update.encaps_tunnel_tlv_subtlv.enlp.reserved", FT_UINT8
,
12614 BASE_HEX
, NULL
, 0x0, NULL
, HFILL
}},
12615 { &hf_bgp_update_encaps_tunnel_subtlv_enlp_enlp
,
12616 { "ENLP", "bgp.update.encaps_tunnel_tlv_subtlv.enlp.preference", FT_UINT8
,
12617 BASE_DEC
, VALS(bgp_enlp_type
), 0x0, NULL
, HFILL
}},
12618 { &hf_bgp_update_encaps_tunnel_subtlv_priority_priority
,
12619 { "Priority", "bgp.update.encaps_tunnel_tlv_subtlv.priority.priority", FT_UINT8
,
12620 BASE_DEC
, NULL
, 0x0, NULL
, HFILL
}},
12621 { &hf_bgp_update_encaps_tunnel_subtlv_priority_reserved
,
12622 { "Reserved", "bgp.update.encaps_tunnel_tlv_subtlv.priority.reserved", FT_UINT8
,
12623 BASE_HEX
, NULL
, 0x0, NULL
, HFILL
}},
12624 { &hf_bgp_update_encaps_tunnel_subtlv_segment_list_reserved
,
12625 { "Reserved", "bgp.update.encaps_tunnel_tlv_subtlv.segment_list.reserved", FT_UINT8
,
12626 BASE_HEX
, NULL
, 0x0, NULL
, HFILL
}},
12627 { &hf_bgp_update_encaps_tunnel_subtlv_segment_list_subtlv
,
12628 { "sub-TLVs", "bgp.update.encaps_tunnel_tlv_subtlv.segment_list.subtlv", FT_BYTES
,
12629 BASE_NONE
, NULL
, 0x0, NULL
, HFILL
}},
12630 { &hf_bgp_update_encaps_tunnel_subtlv_segment_list_subtlv_type
,
12631 { "Type", "bgp.update.encaps_tunnel_tlv_subtlv.segment_list.subtlv.type", FT_UINT8
,
12632 BASE_DEC
, VALS(bgp_sr_policy_list_type
), 0x0, NULL
, HFILL
}},
12633 { &hf_bgp_update_encaps_tunnel_subtlv_segment_list_subtlv_length
,
12634 { "Length", "bgp.update.encaps_tunnel_tlv_subtlv.segment_list.subtlv.length", FT_UINT8
,
12635 BASE_DEC
, NULL
, 0x0, NULL
, HFILL
}},
12636 { &hf_bgp_update_encaps_tunnel_subtlv_segment_list_subtlv_flags
,
12637 { "Flags", "bgp.update.encaps_tunnel_tlv_subtlv.segment_list_subtlv.flags", FT_UINT8
,
12638 BASE_HEX
, NULL
, 0x0, NULL
, HFILL
}},
12639 { &hf_bgp_update_encaps_tunnel_subtlv_segment_list_subtlv_flags_verification
,
12640 { "SID verification", "bgp.update.encaps_tunnel_tlv_subtlv.segment_list_subtlv.flags.verification", FT_BOOLEAN
,
12641 8, TFS(&tfs_set_notset
), TUNNEL_SUBTLV_SEGMENT_LIST_SUB_VERIFICATION
, NULL
, HFILL
}},
12642 { &hf_bgp_update_encaps_tunnel_subtlv_segment_list_subtlv_flags_algorithm
,
12643 { "SR Algorithm id", "bgp.update.encaps_tunnel_tlv_subtlv.segment_list_subtlv.flags.algorithm", FT_BOOLEAN
,
12644 8, TFS(&tfs_set_notset
), TUNNEL_SUBTLV_SEGMENT_LIST_SUB_ALGORITHM
, NULL
, HFILL
}},
12645 { &hf_bgp_update_encaps_tunnel_subtlv_segment_list_subtlv_flags_reserved
,
12646 { "Reserved", "bgp.update.encaps_tunnel_tlv_subtlv.segment_list_subtlv.flags.reserved", FT_UINT8
,
12647 BASE_HEX
, NULL
, TUNNEL_SUBTLV_SEGMENT_LIST_SUB_RESERVED
, NULL
, HFILL
}},
12648 { &hf_bgp_update_encaps_tunnel_subtlv_segment_list_subtlv_reserved
,
12649 { "Reserved", "bgp.update.encaps_tunnel_tlv_subtlv.segment_list_subtlv.reserved", FT_BYTES
,
12650 BASE_NONE
, NULL
, 0x0, NULL
, HFILL
}},
12651 { &hf_bgp_update_encaps_tunnel_subtlv_segment_list_subtlv_mpls_label
,
12652 { "MPLS Label", "bgp.update.encaps_tunnel_tlv_subtlv.segment_list_subtlv.mpls_label", FT_UINT24
,
12653 BASE_HEX
, NULL
, BGP_MPLS_LABEL
, NULL
, HFILL
}},
12654 { &hf_bgp_update_encaps_tunnel_subtlv_segment_list_subtlv_traffic_class
,
12655 { "Traffic Class", "bgp.update.encaps_tunnel_tlv_subtlv.segment_list_subtlv.traffic_class", FT_UINT24
,
12656 BASE_HEX
, NULL
, BGP_MPLS_TRAFFIC_CLASS
, NULL
, HFILL
}},
12657 { &hf_bgp_update_encaps_tunnel_subtlv_segment_list_subtlv_bottom_stack
,
12658 { "Bottom-of-Stack", "bgp.update.encaps_tunnel_tlv_subtlv.segment_list_subtlv.bottom_stack", FT_BOOLEAN
,
12659 24, NULL
, BGP_MPLS_BOTTOM_L_STACK
, NULL
, HFILL
}},
12660 { &hf_bgp_update_encaps_tunnel_subtlv_segment_list_subtlv_ttl
,
12661 { "TTL", "bgp.update.encaps_tunnel_tlv_subtlv.segment_list_subtlv.ttl", FT_UINT8
,
12662 BASE_DEC
, NULL
, 0x0, NULL
, HFILL
}},
12663 { &hf_bgp_update_encaps_tunnel_subtlv_segment_list_subtlv_data
,
12664 { "Data", "bgp.update.encaps_tunnel_tlv_subtlv.segment_list.subtlv.data", FT_BYTES
,
12665 BASE_NONE
, NULL
, 0x0, NULL
, HFILL
}},
12666 { &hf_bgp_update_encaps_tunnel_subtlv_policy_name_reserved
,
12667 { "Reserved", "bgp.update.encaps_tunnel_tlv_subtlv.policy_name.reserved", FT_UINT8
,
12668 BASE_HEX
, NULL
, 0x0, NULL
, HFILL
}},
12669 { &hf_bgp_update_encaps_tunnel_subtlv_policy_name_name
,
12670 { "Policy name", "bgp.update.encaps_tunnel_tlv_subtlv.policy_name.name", FT_STRING
,
12671 BASE_NONE
, NULL
, 0x0, NULL
, HFILL
}},
12673 /* BGP update path attribute SSA SAFI (deprecated IETF draft) */
12675 { "Transitive bit", "bgp.ssa_t", FT_BOOLEAN
, 8,
12676 NULL
, 0x80, "SSA Transitive bit", HFILL
}},
12677 { &hf_bgp_ssa_type
,
12678 { "SSA Type", "bgp.ssa_type", FT_UINT16
, BASE_DEC
,
12679 VALS(bgp_ssa_type
), 0x7FFF, NULL
, HFILL
}},
12681 { "Length", "bgp.ssa_len", FT_UINT16
, BASE_DEC
,
12682 NULL
, 0x0, "SSA Length", HFILL
}},
12683 { &hf_bgp_ssa_value
,
12684 { "Value", "bgp.ssa_value", FT_BYTES
, BASE_NONE
,
12685 NULL
, 0x0, "SSA Value", HFILL
}},
12686 { &hf_bgp_ssa_l2tpv3_pref
,
12687 { "Preference", "bgp.ssa_l2tpv3_pref", FT_UINT16
, BASE_DEC
,
12688 NULL
, 0x0, NULL
, HFILL
}},
12689 { &hf_bgp_ssa_l2tpv3_s
,
12690 { "Sequencing bit", "bgp.ssa_l2tpv3_s", FT_BOOLEAN
, 8,
12691 NULL
, 0x80, "Sequencing S-bit", HFILL
}},
12692 { &hf_bgp_ssa_l2tpv3_unused
,
12693 { "Unused", "bgp.ssa_l2tpv3_Unused", FT_BOOLEAN
, 8,
12694 NULL
, 0x7F, "Unused Flags", HFILL
}},
12695 { &hf_bgp_ssa_l2tpv3_cookie_len
,
12696 { "Cookie Length", "bgp.ssa_l2tpv3_cookie_len", FT_UINT8
, BASE_DEC
,
12697 NULL
, 0x0, NULL
, HFILL
}},
12698 { &hf_bgp_ssa_l2tpv3_session_id
,
12699 { "Session ID", "bgp.ssa_l2tpv3_session_id", FT_UINT32
, BASE_DEC
,
12700 NULL
, 0x0, NULL
, HFILL
}},
12701 { &hf_bgp_ssa_l2tpv3_cookie
,
12702 { "Cookie", "bgp.ssa_l2tpv3_cookie", FT_BYTES
, BASE_NONE
,
12703 NULL
, 0x0, NULL
, HFILL
}},
12704 { &hf_bgp_withdrawn_prefix
,
12705 { "Withdrawn prefix", "bgp.withdrawn_prefix", FT_IPv4
, BASE_NONE
,
12706 NULL
, 0x0, NULL
, HFILL
}},
12708 /* NLRI header description */
12709 { &hf_bgp_update_nlri
,
12710 { "Network Layer Reachability Information (NLRI)", "bgp.update.nlri", FT_NONE
, BASE_NONE
,
12711 NULL
, 0x0, NULL
, HFILL
}},
12712 /* Global NLRI description */
12713 { &hf_bgp_mp_reach_nlri_ipv4_prefix
,
12714 { "MP Reach NLRI IPv4 prefix", "bgp.mp_reach_nlri_ipv4_prefix", FT_IPv4
, BASE_NONE
,
12715 NULL
, 0x0, NULL
, HFILL
}},
12716 { &hf_bgp_mp_unreach_nlri_ipv4_prefix
,
12717 { "MP Unreach NLRI IPv4 prefix", "bgp.mp_unreach_nlri_ipv4_prefix", FT_IPv4
, BASE_NONE
,
12718 NULL
, 0x0, NULL
, HFILL
}},
12719 { &hf_bgp_mp_reach_nlri_ipv6_prefix
,
12720 { "MP Reach NLRI IPv6 prefix", "bgp.mp_reach_nlri_ipv6_prefix", FT_IPv6
, BASE_NONE
,
12721 NULL
, 0x0, NULL
, HFILL
}},
12722 { &hf_bgp_mp_unreach_nlri_ipv6_prefix
,
12723 { "MP Unreach NLRI IPv6 prefix", "bgp.mp_unreach_nlri_ipv6_prefix", FT_IPv6
, BASE_NONE
,
12724 NULL
, 0x0, NULL
, HFILL
}},
12725 { &hf_bgp_mp_nlri_tnl_id
,
12726 { "MP Reach NLRI Tunnel Identifier", "bgp.mp_nlri_tnl_id", FT_UINT16
, BASE_HEX
,
12727 NULL
, 0x0, NULL
, HFILL
}},
12728 { &hf_bgp_nlri_prefix
,
12729 { "NLRI prefix", "bgp.nlri_prefix", FT_IPv4
, BASE_NONE
,
12730 NULL
, 0x0, NULL
, HFILL
}},
12731 { &hf_bgp_nlri_path_id
,
12732 { "NLRI path id", "bgp.nlri_path_id", FT_UINT32
, BASE_DEC
,
12733 NULL
, 0x0, NULL
, HFILL
}},
12735 /* mcast vpn nlri and capability */
12736 { &hf_bgp_mcast_vpn_nlri_t
,
12737 { "MCAST-VPN nlri", "bgp.mcast_vpn_nlri", FT_BYTES
, BASE_NONE
,
12738 NULL
, 0x0, NULL
, HFILL
}},
12739 { &hf_bgp_mcast_vpn_nlri_route_type
,
12740 { "Route Type", "bgp.mcast_vpn_nlri_route_type", FT_UINT8
,
12741 BASE_DEC
, VALS(mcast_vpn_route_type
), 0x0, NULL
, HFILL
}},
12742 { &hf_bgp_mcast_vpn_nlri_length
,
12743 { "Length", "bgp.mcast_vpn_nlri_length", FT_UINT8
,
12744 BASE_DEC
, NULL
, 0x0, NULL
, HFILL
}},
12745 { &hf_bgp_mcast_vpn_nlri_rd
,
12746 { "Route Distinguisher", "bgp.mcast_vpn_nlri_rd", FT_BYTES
,
12747 BASE_NONE
, NULL
, 0x0, NULL
, HFILL
}},
12748 { &hf_bgp_mcast_vpn_nlri_origin_router_ipv4
,
12749 { "Originating Router", "bgp.mcast_vpn_nlri_origin_router_ipv4", FT_IPv4
,
12750 BASE_NONE
, NULL
, 0x0, NULL
, HFILL
}},
12751 { &hf_bgp_mcast_vpn_nlri_origin_router_ipv6
,
12752 { "Originating Router", "bgp.mcast_vpn_nlri_origin_router_ipv6", FT_IPv6
,
12753 BASE_NONE
, NULL
, 0x0, NULL
, HFILL
}},
12754 { &hf_bgp_mcast_vpn_nlri_source_as
,
12755 { "Source AS", "bgp.mcast_vpn_nlri_source_as", FT_UINT32
,
12756 BASE_DEC
, NULL
, 0x0, NULL
, HFILL
}},
12757 { &hf_bgp_mcast_vpn_nlri_source_length
,
12758 { "Multicast Source Length", "bgp.mcast_vpn_nlri_source_length", FT_UINT8
,
12759 BASE_DEC
, NULL
, 0x0, NULL
, HFILL
}},
12760 { &hf_bgp_mcast_vpn_nlri_group_length
,
12761 { "Multicast Group Length", "bgp.mcast_vpn_nlri_group_length", FT_UINT8
,
12762 BASE_DEC
, NULL
, 0x0, NULL
, HFILL
}},
12763 { &hf_bgp_mcast_vpn_nlri_source_addr_ipv4
,
12764 { "Multicast Source Address", "bgp.mcast_vpn_nlri_source_addr_ipv4", FT_IPv4
,
12765 BASE_NONE
, NULL
, 0x0, NULL
, HFILL
}},
12766 { &hf_bgp_mcast_vpn_nlri_source_addr_ipv6
,
12767 { "Multicast Source Address", "bgp.mcast_vpn_nlri_source_addr_ipv6", FT_IPv6
,
12768 BASE_NONE
, NULL
, 0x0, NULL
, HFILL
}},
12769 { &hf_bgp_mcast_vpn_nlri_group_addr_ipv4
,
12770 { "Multicast Group Address", "bgp.mcast_vpn_nlri_group_addr_ipv4", FT_IPv4
,
12771 BASE_NONE
, NULL
, 0x0, NULL
, HFILL
}},
12772 { &hf_bgp_mcast_vpn_nlri_group_addr_ipv6
,
12773 { "Group Address", "bgp.mcast_vpn_nlri_group_addr_ipv6", FT_IPv6
,
12774 BASE_NONE
, NULL
, 0x0, NULL
, HFILL
}},
12775 { &hf_bgp_mcast_vpn_nlri_route_key
,
12776 { "Route Key", "bgp.mcast_vpn_nlri_route_key", FT_BYTES
,
12777 BASE_NONE
, NULL
, 0x0, NULL
, HFILL
}},
12778 /* sr policy nlri*/
12779 { &hf_bgp_sr_policy_nlri_length
,
12780 { "NLRI length", "bgp.sr_policy_nlri_length", FT_UINT8
,
12781 BASE_DEC
, NULL
, 0x0, "NLRI length in bits", HFILL
}},
12782 { &hf_bgp_sr_policy_nlri_distinguisher
,
12783 { "Distinguisher", "bgp.sr_policy_nlri_distinguisher", FT_BYTES
,
12784 BASE_NONE
, NULL
, 0x0, NULL
, HFILL
}},
12785 { &hf_bgp_sr_policy_nlri_policy_color
,
12786 { "Policy color", "bgp.sr_policy_nlri_policy_color", FT_BYTES
,
12787 BASE_NONE
, NULL
, 0x0, NULL
, HFILL
}},
12788 { &hf_bgp_sr_policy_nlri_endpoint_v4
,
12789 { "Endpoint", "bgp.sr_policy_nlri_endpoint_ipv4", FT_IPv4
,
12790 BASE_NONE
, NULL
, 0x0, NULL
, HFILL
}},
12791 { &hf_bgp_sr_policy_nlri_endpoint_v6
,
12792 { "Endpoint", "bgp.sr_policy_nlri_endpoint_ipv6", FT_IPv6
,
12793 BASE_NONE
, NULL
, 0x0, NULL
, HFILL
}},
12794 /* Bgp flow spec nlri and capability */
12795 { &hf_bgp_flowspec_nlri_t
,
12796 { "FLOW-SPEC nlri", "bgp.flowspec_nlri", FT_BYTES
, BASE_NONE
,
12797 NULL
, 0x0, NULL
, HFILL
}},
12798 { &hf_bgp_flowspec_nlri_route_distinguisher
,
12799 { "Route Distinguisher", "bgp.flowspec_route_distinguisher", FT_NONE
,
12800 BASE_NONE
, NULL
, 0x0, NULL
, HFILL
}},
12801 { &hf_bgp_flowspec_nlri_route_distinguisher_type
,
12802 { "Route Distinguisher Type", "bgp.flowspec_route_distinguisher_type", FT_UINT16
,
12803 BASE_DEC
, NULL
, 0x0, NULL
, HFILL
}},
12804 { &hf_bgp_flowspec_nlri_route_dist_admin_asnum_2
,
12805 { "Administrator Subfield", "bgp.flowspec_route_distinguisher_admin_as_num_2", FT_UINT16
,
12806 BASE_DEC
, NULL
, 0x0, NULL
, HFILL
}},
12807 { &hf_bgp_flowspec_nlri_route_dist_admin_ipv4
,
12808 { "Administrator Subfield", "bgp.flowspec_route_distinguisher_admin_ipv4", FT_IPv4
,
12809 BASE_NONE
, NULL
, 0x0, NULL
, HFILL
}},
12810 { &hf_bgp_flowspec_nlri_route_dist_admin_asnum_4
,
12811 { "Administrator Subfield", "bgp.flowspec_route_distinguisher_admin_as_num_4", FT_UINT32
,
12812 BASE_HEX_DEC
, NULL
, 0x0, NULL
, HFILL
}},
12813 { &hf_bgp_flowspec_nlri_route_dist_asnum_2
,
12814 { "Assigned Number Subfield", "bgp.flowspec_route_distinguisher_asnum_2", FT_UINT16
,
12815 BASE_DEC
, NULL
, 0x0, NULL
, HFILL
}},
12816 { &hf_bgp_flowspec_nlri_route_dist_asnum_4
,
12817 { "Assigned Number Subfield", "bgp.flowspec_route_distinguisher_asnum_4", FT_UINT32
,
12818 BASE_HEX_DEC
, NULL
, 0x0, NULL
, HFILL
}},
12819 { &hf_bgp_flowspec_nlri_filter
,
12820 { "Filter", "bgp.flowspec_nlri.filter", FT_NONE
, BASE_NONE
,
12821 NULL
, 0x0, NULL
, HFILL
}},
12822 { &hf_bgp_flowspec_nlri_filter_type
,
12823 { "Filter type", "bgp.flowspec_nlri.filter_type", FT_UINT8
, BASE_DEC
,
12824 VALS(flowspec_nlri_opvaluepair_type
), 0x0, NULL
, HFILL
}},
12825 { &hf_bgp_flowspec_nlri_length
,
12826 { "NRLI length", "bgp.flowspec_nlri.length", FT_UINT16
, BASE_DEC
,
12827 NULL
, 0x0, NULL
, HFILL
}},
12828 { &hf_bgp_flowspec_nlri_op_flags
,
12829 { "Operator flags", "bgp.flowspec_nlri.opflags", FT_UINT8
, BASE_HEX
,
12830 NULL
, 0x0, NULL
, HFILL
}},
12831 { &hf_bgp_flowspec_nlri_dst_pref_ipv4
,
12832 { "Destination IP filter", "bgp.flowspec_nlri.dst_prefix_filter", FT_IPv4
,
12833 BASE_NONE
, NULL
, 0x0, NULL
, HFILL
}},
12834 { &hf_bgp_flowspec_nlri_src_pref_ipv4
,
12835 { "Source IP filter", "bgp.flowspec_nlri.src_prefix_filter", FT_IPv4
,
12836 BASE_NONE
, NULL
, 0x0, NULL
, HFILL
}},
12837 { &hf_bgp_flowspec_nlri_op_eol
,
12838 { "end-of-list", "bgp.flowspec_nlri.op.eol", FT_BOOLEAN
, 8,
12839 TFS(&tfs_set_notset
), BGPNLRI_FSPEC_END_OF_LST
, NULL
, HFILL
}},
12840 { &hf_bgp_flowspec_nlri_op_and
,
12841 { "and", "bgp.flowspec_nlri.op.and", FT_BOOLEAN
, 8,
12842 TFS(&tfs_set_notset
), BGPNLRI_FSPEC_AND_BIT
, NULL
, HFILL
}},
12843 { &hf_bgp_flowspec_nlri_op_val_len
,
12844 { "Value length", "bgp.flowspec_nlri.op.val_len", FT_UINT8
, BASE_DEC
,
12845 VALS(flow_spec_op_len_val
), BGPNLRI_FSPEC_VAL_LEN
, NULL
, HFILL
}},
12846 { &hf_bgp_flowspec_nlri_op_un_bit4
,
12847 { "Reserved", "bgp.flowspec_nlri.op.un_bit4", FT_BOOLEAN
, 8,
12848 TFS(&tfs_set_notset
), BGPNLRI_FSPEC_UNUSED_BIT4
, "Unused (must be zero)",HFILL
}},
12849 { &hf_bgp_flowspec_nlri_op_un_bit5
,
12850 { "Reserved", "bgp.flowspec_nlri.op.un_bit5", FT_BOOLEAN
, 8,
12851 TFS(&tfs_set_notset
), BGPNLRI_FSPEC_UNUSED_BIT5
, "Unused (must be zero)", HFILL
}},
12852 { &hf_bgp_flowspec_nlri_dec_val_8
,
12853 { "Decimal value", "bgp.flowspec_nlri.dec_val_8", FT_UINT8
, BASE_DEC
,
12854 NULL
, 0x0, NULL
, HFILL
}},
12855 { &hf_bgp_flowspec_nlri_dec_val_16
,
12856 { "Decimal value", "bgp.flowspec_nlri.dec_val_16", FT_UINT16
, BASE_DEC
,
12857 NULL
, 0x0, NULL
, HFILL
}},
12858 { &hf_bgp_flowspec_nlri_dec_val_32
,
12859 { "Decimal value", "bgp.flowspec_nlri.dec_val_32", FT_UINT32
, BASE_DEC
,
12860 NULL
, 0x0, NULL
, HFILL
}},
12861 { &hf_bgp_flowspec_nlri_dec_val_64
,
12862 { "Decimal value", "bgp.flowspec_nlri.dec_val_64", FT_UINT64
, BASE_DEC
,
12863 NULL
, 0x0, NULL
, HFILL
}},
12864 { &hf_bgp_flowspec_nlri_op_lt
,
12865 { "less than", "bgp.flowspec_nlri.op.lt", FT_BOOLEAN
, 8,
12866 TFS(&tfs_set_notset
), BGPNLRI_FSPEC_LESS_THAN
, NULL
, HFILL
}},
12867 { &hf_bgp_flowspec_nlri_op_gt
,
12868 { "greater than", "bgp.flowspec_nlri.op.gt", FT_BOOLEAN
, 8,
12869 TFS(&tfs_set_notset
), BGPNLRI_FSPEC_GREATER_THAN
, NULL
, HFILL
}},
12870 { &hf_bgp_flowspec_nlri_op_eq
,
12871 { "equal", "bgp.flowspec_nlri.op.equal", FT_BOOLEAN
, 8,
12872 TFS(&tfs_set_notset
), BGPNLRI_FSPEC_EQUAL
, NULL
, HFILL
}},
12873 { &hf_bgp_flowspec_nlri_op_flg_not
,
12874 { "logical negation", "bgp.flowspec_nlri.op.flg_not", FT_BOOLEAN
, 8,
12875 TFS(&tfs_set_notset
), BGPNLRI_FSPEC_TCPF_NOTBIT
, NULL
, HFILL
}},
12876 { &hf_bgp_flowspec_nlri_op_flg_match
,
12877 { "Match bit", "bgp.flowspec_nlri.op.flg_match", FT_BOOLEAN
, 8,
12878 TFS(&tfs_set_notset
), BGPNLRI_FSPEC_TCPF_MATCHBIT
, NULL
, HFILL
}},
12879 { &hf_bgp_flowspec_nlri_tcp_flags
,
12880 { "TCP flags", "bgp.flowspec_nlri.val_tcp.flags", FT_UINT8
, BASE_HEX
,
12881 NULL
, 0x0, NULL
, HFILL
}},
12882 { &hf_bgp_flowspec_nlri_tcp_flags_cwr
,
12883 { "Congestion Window Reduced (CWR)", "bgp.flowspec_nlri.val_tcp.flags.cwr", FT_BOOLEAN
, 8,
12884 TFS(&tfs_set_notset
), BGPNLRI_FSPEC_TH_CWR
, NULL
, HFILL
}},
12885 { &hf_bgp_flowspec_nlri_tcp_flags_ecn
,
12886 { "ECN-Echo", "bgp.flowspec_nlri.val_tcp.flags.ecn", FT_BOOLEAN
, 8,
12887 TFS(&tfs_set_notset
), BGPNLRI_FSPEC_TH_ECN
, NULL
, HFILL
}},
12888 { &hf_bgp_flowspec_nlri_tcp_flags_urg
,
12889 { "Urgent", "bgp.flowspec_nlri.val_tcp.flags.urg", FT_BOOLEAN
, 8,
12890 TFS(&tfs_set_notset
), BGPNLRI_FSPEC_TH_URG
, NULL
, HFILL
}},
12891 { &hf_bgp_flowspec_nlri_tcp_flags_ack
,
12892 { "Acknowledgment", "bgp.flowspec_nlri.val_tcp.flags.ack", FT_BOOLEAN
, 8,
12893 TFS(&tfs_set_notset
), BGPNLRI_FSPEC_TH_ACK
, NULL
, HFILL
}},
12894 { &hf_bgp_flowspec_nlri_tcp_flags_push
,
12895 { "Push", "bgp.flowspec_nlri.val_tcp.flags.push", FT_BOOLEAN
, 8,
12896 TFS(&tfs_set_notset
), BGPNLRI_FSPEC_TH_PUSH
, NULL
, HFILL
}},
12897 { &hf_bgp_flowspec_nlri_tcp_flags_reset
,
12898 { "Reset", "bgp.flowspec_nlri.val_tcp.flags.reset", FT_BOOLEAN
, 8,
12899 TFS(&tfs_set_notset
), BGPNLRI_FSPEC_TH_RST
, NULL
, HFILL
}},
12900 { &hf_bgp_flowspec_nlri_tcp_flags_syn
,
12901 { "Syn", "bgp.flowspec_nlri.val_tcp.flags.syn", FT_BOOLEAN
, 8,
12902 TFS(&tfs_set_notset
), BGPNLRI_FSPEC_TH_SYN
, NULL
, HFILL
}},
12903 { &hf_bgp_flowspec_nlri_tcp_flags_fin
,
12904 { "Fin", "bgp.flowspec_nlri.val_tcp.flags.fin", FT_BOOLEAN
, 8,
12905 TFS(&tfs_set_notset
), BGPNLRI_FSPEC_TH_FIN
, NULL
, HFILL
}},
12906 { &hf_bgp_flowspec_nlri_fflag
,
12907 { "Fragment Flag", "bgp.flowspec_nlri.val_frag", FT_UINT8
, BASE_HEX
,
12908 NULL
, 0x0, NULL
, HFILL
}},
12909 { &hf_bgp_flowspec_nlri_fflag_lf
,
12910 { "Last fragment", "bgp.flowspec_nlri.val_frag_lf", FT_BOOLEAN
, 8,
12911 TFS(&tfs_set_notset
), BGPNLRI_FSPEC_FG_LF
, NULL
, HFILL
}},
12912 { &hf_bgp_flowspec_nlri_fflag_ff
,
12913 { "First fragment", "bgp.flowspec_nlri.val_frag_ff", FT_BOOLEAN
, 8,
12914 TFS(&tfs_set_notset
), BGPNLRI_FSPEC_FG_FF
, NULL
, HFILL
}},
12915 { &hf_bgp_flowspec_nlri_fflag_isf
,
12916 { "Is a fragment", "bgp.flowspec_nlri.val_frag_isf", FT_BOOLEAN
, 8,
12917 TFS(&tfs_set_notset
), BGPNLRI_FSPEC_FG_ISF
, NULL
, HFILL
}},
12918 { &hf_bgp_flowspec_nlri_fflag_df
,
12919 { "Don't fragment", "bgp.flowspec_nlri.val_frag_df", FT_BOOLEAN
, 8,
12920 TFS(&tfs_set_notset
), BGPNLRI_FSPEC_FG_DF
, NULL
, HFILL
}},
12921 { &hf_bgp_flowspec_nlri_dscp
,
12922 { "Differentiated Services Codepoint", "bgp.flowspec_nlri.val_dsfield", FT_UINT8
, BASE_HEX
| BASE_EXT_STRING
,
12923 &dscp_vals_ext
, BGPNLRI_FSPEC_DSCP_BITMASK
, NULL
, HFILL
}},
12924 { &hf_bgp_flowspec_nlri_src_ipv6_pref
,
12925 { "Source IPv6 prefix", "bgp.flowspec_nlri.src_ipv6_pref", FT_IPv6
, BASE_NONE
,
12926 NULL
, 0x0, NULL
, HFILL
}},
12927 { &hf_bgp_flowspec_nlri_dst_ipv6_pref
,
12928 { "Destination IPv6 prefix", "bgp.flowspec_nlri.dst_ipv6_pref", FT_IPv6
, BASE_NONE
,
12929 NULL
, 0x0, NULL
, HFILL
}},
12930 { &hf_bgp_flowspec_nlri_ipv6_pref_len
,
12931 { "IPv6 prefix length", "bgp.flowspec_nlri.ipv6_pref_length", FT_UINT8
, BASE_DEC
,
12932 NULL
, 0x0, NULL
, HFILL
}},
12933 { &hf_bgp_flowspec_nlri_ipv6_pref_offset
,
12934 { "IPv6 prefix offset", "bgp.flowspec_nlri.ipv6_pref_offset", FT_UINT8
, BASE_DEC
,
12935 NULL
, 0x0, NULL
, HFILL
}},
12936 /* end of bgp flow spec */
12937 /* BGP update safi ndt nlri draft-nalawade-idr-mdt-safi-03 */
12938 { &hf_bgp_mdt_nlri_safi_rd
,
12939 { "Route Distinguisher", "bgp.mdt_safi_rd", FT_BYTES
,
12940 BASE_NONE
, NULL
, 0x0, NULL
, HFILL
}},
12941 { &hf_bgp_mdt_nlri_safi_ipv4_addr
,
12942 { "IPv4 Address", "bgp.mdt_safi_ipv4_addr", FT_IPv4
,
12943 BASE_NONE
, NULL
, 0x0, NULL
, HFILL
}},
12944 { &hf_bgp_mdt_nlri_safi_group_addr
,
12945 { "Group Address", "bgp.mdt_safi_group_addr", FT_IPv4
,
12946 BASE_NONE
, NULL
, 0x0, NULL
, HFILL
}},
12947 /* BGP update extended community header field */
12948 { &hf_bgp_ext_communities
,
12949 { "Carried extended communities", "bgp.ext_communities", FT_NONE
, BASE_NONE
,
12950 NULL
, 0x0, NULL
, HFILL
}},
12951 { &hf_bgp_ext_community
,
12952 { "Community", "bgp.ext_community", FT_NONE
, BASE_NONE
,
12953 NULL
, 0x0, "Extended Community attribute", HFILL
}},
12954 { &hf_bgp_ext_com_type_high
,
12955 { "Type", "bgp.ext_com.type", FT_UINT8
, BASE_HEX
,
12956 VALS(bgpext_com_type_high
), 0x0, "Extended Community type", HFILL
}},
12957 { &hf_bgp_ext_com_type_auth
,
12958 { "IANA Authority", "bgp.ext_com.type.auth", FT_BOOLEAN
, 8,
12959 TFS(&tfs_bgpext_com_type_auth
), BGP_EXT_COM_TYPE_AUTH
, "IANA Type Allocation Policy", HFILL
}},
12960 {&hf_bgp_ext_com_type_tran
,
12961 { "Transitive across ASes", "bgp.ext_com.type.tran", FT_BOOLEAN
, 8,
12962 TFS(&tfs_non_transitive_transitive
), BGP_EXT_COM_TYPE_TRAN
, "Transitivity of the attribute across autonomous systems", HFILL
}},
12963 { &hf_bgp_ext_com_stype_low_unknown
,
12964 { "Subtype", "bgp.ext_com.stype_unknown", FT_UINT8
, BASE_HEX
,
12965 NULL
, 0x0, "Extended Community subtype", HFILL
}},
12966 { &hf_bgp_ext_com_stype_tr_evpn
,
12967 { "Subtype (EVPN)", "bgp.ext_com.stype_tr_evpn", FT_UINT8
, BASE_HEX
,
12968 VALS(bgpext_com_stype_tr_evpn
), 0x0, "EVPN Extended Community subtype", HFILL
}},
12969 { &hf_bgp_ext_com_stype_tr_as2
,
12970 { "Subtype (AS2)", "bgp.ext_com.stype_tr_as2", FT_UINT8
, BASE_HEX
,
12971 VALS(bgpext_com_stype_tr_as2
), 0x0, "2-Octet AS-Specific Transitive Extended Community subtype", HFILL
}},
12972 { &hf_bgp_ext_com_stype_ntr_as2
,
12973 { "Subtype (Non-transitive AS2)", "bgp.ext_com.stype_ntr_as2", FT_UINT8
, BASE_HEX
,
12974 VALS(bgpext_com_stype_ntr_as2
), 0x0, "2-Octet AS-Specific Non-transitive Extended Community subtype", HFILL
}},
12975 { &hf_bgp_ext_com_stype_tr_as4
,
12976 { "Subtype (AS4)", "bgp.ext_com.stype_tr_as4", FT_UINT8
, BASE_HEX
,
12977 VALS(bgpext_com_stype_tr_as4
), 0x0, "4-Octet AS-Specific Transitive Extended Community subtype", HFILL
}},
12978 { &hf_bgp_ext_com_stype_ntr_as4
,
12979 { "Subtype (Non-transitive AS4)", "bgp.ext_com.stype_ntr_as4", FT_UINT8
, BASE_HEX
,
12980 VALS(bgpext_com_stype_ntr_as4
), 0x0, "4-Octet AS-Specific Non-transitive Extended Community subtype", HFILL
}},
12981 { &hf_bgp_ext_com_stype_tr_IP4
,
12982 { "Subtype (IPv4)", "bgp.ext_com.stype_tr_IP4", FT_UINT8
, BASE_HEX
,
12983 VALS(bgpext_com_stype_tr_IP4
), 0x0, "IPv4-Address-Specific Transitive Extended Community subtype", HFILL
}},
12984 { &hf_bgp_ext_com_stype_ntr_IP4
,
12985 { "Subtype (Non-transitive IPv4)", "bgp.ext_com.stype_ntr_IP4", FT_UINT8
, BASE_HEX
,
12986 VALS(bgpext_com_stype_ntr_IP4
), 0x0, "IPv4-Address-Specific Non-transitive Extended Community subtype", HFILL
}},
12987 { &hf_bgp_ext_com_stype_tr_opaque
,
12988 { "Subtype (Opaque)", "bgp.ext_com.stype_tr_opaque", FT_UINT8
, BASE_HEX
,
12989 VALS(bgpext_com_stype_tr_opaque
), 0x0, "Opaque Transitive Extended Community subtype", HFILL
}},
12990 { &hf_bgp_ext_com_stype_ntr_opaque
,
12991 { "Subtype (Non-transitive Opaque)", "bgp.ext_com.stype_ntr_opaque", FT_UINT8
, BASE_HEX
,
12992 VALS(bgpext_com_stype_ntr_opaque
), 0x0, "Opaque Non-transitive Extended Community subtype", HFILL
}},
12993 { &hf_bgp_ext_com_tunnel_type
,
12994 { "Tunnel type", "bgp.ext_com.tunnel_type", FT_UINT16
, BASE_DEC
,
12995 VALS(bgpext_com_tunnel_type
), 0x0, "Tunnel encapsulation type", HFILL
}},
12996 { &hf_bgp_ext_com_stype_tr_mup
,
12997 { "Subtype (MUP)", "bgp.ext_com.stype_tr_mup", FT_UINT8
, BASE_HEX
,
12998 VALS(bgpext_com_stype_tr_mup
), 0x0, "MUP Extended Community subtype", HFILL
}},
12999 { &hf_bgp_ext_com_stype_tr_exp
,
13000 { "Subtype (Experimental)", "bgp.ext_com.stype_tr_exp", FT_UINT8
, BASE_HEX
,
13001 VALS(bgpext_com_stype_tr_exp
), 0x0, "Experimental Transitive Extended Community subtype", HFILL
}},
13002 { &hf_bgp_ext_com_stype_tr_exp_2
,
13003 { "Subtype (Experimental Part 2)", "bgp.ext_com.stype_tr_exp_2", FT_UINT8
, BASE_HEX
,
13004 VALS(bgpext_com_stype_tr_exp_2
), 0x0, "Generic Transitive Experimental Use Extended Community Part 2 Sub-Types", HFILL
}},
13005 { &hf_bgp_ext_com_stype_tr_exp_3
,
13006 { "Subtype (Experimental Part 3)", "bgp.ext_com.stype_tr_exp_3", FT_UINT8
, BASE_HEX
,
13007 VALS(bgpext_com_stype_tr_exp_3
), 0x0, "Generic Transitive Experimental Use Extended Community Part 3 Sub-Types", HFILL
}},
13008 { &hf_bgp_ext_com_value_as2
,
13009 { "2-Octet AS", "bgp.ext_com.value_as2", FT_UINT16
, BASE_DEC
,
13010 NULL
, 0x0, "Global Administrator Field value (2B Autonomous System Number)", HFILL
}},
13011 { &hf_bgp_ext_com_value_as4
,
13012 { "4-Octet AS", "bgp.ext_com.value_as4", FT_UINT32
, BASE_DEC
,
13013 NULL
, 0x0, "Global Administrator Field value (4B Autonomous System Number)", HFILL
}},
13014 { &hf_bgp_ext_com_value_IP4
,
13015 { "IPv4 address", "bgp.ext_com.value_IP4", FT_IPv4
, BASE_NONE
,
13016 NULL
, 0x0, "Global Administrator Field value (IPv4 Address)", HFILL
}},
13017 { &hf_bgp_ext_com_value_an2
,
13018 { "2-Octet AN", "bgp.ext_com.value_an2", FT_UINT16
, BASE_DEC
,
13019 NULL
, 0x0, "Local Administrator Field value (2B Assigned Number)", HFILL
}},
13020 { &hf_bgp_ext_com_value_an4
,
13021 { "4-Octet AN", "bgp.ext_com.value_an4", FT_UINT32
, BASE_DEC
,
13022 NULL
, 0x0, "Local Administrator Field value (4B Assigned Number)", HFILL
}},
13023 { &hf_bgp_ext_com_value_link_bw
,
13024 { "Link bandwidth", "bgp.ext_com.value_link_bw", FT_FLOAT
, BASE_NONE
,
13025 NULL
, 0x0, NULL
, HFILL
}},
13026 { &hf_bgp_ext_com_value_ospf_rt_area
,
13027 { "Area ID", "bgp.ext_com.value_ospf_rtype.area", FT_IPv4
, BASE_NONE
,
13028 NULL
, 0x0, "Original OSPF Area ID this route comes from", HFILL
}},
13029 { &hf_bgp_ext_com_value_ospf_rt_type
,
13030 { "Route type", "bgp.ext_com.value_ospf_rtype.type", FT_UINT8
, BASE_DEC
,
13031 VALS(bgpext_com_ospf_rtype
), 0x0, "Original OSPF LSA Type that carried this route", HFILL
}},
13032 { &hf_bgp_ext_com_value_ospf_rt_options
,
13033 { "Options", "bgp.ext_com.value_ospf_rtype.options", FT_UINT8
, BASE_HEX
,
13034 NULL
, 0x0, "OSPF Route Type Options bitfield", HFILL
}},
13035 { &hf_bgp_ext_com_value_ospf_rt_options_mt
,
13036 { "Metric type", "bgp.ext_com.value_ospf_rtype.options.mt", FT_BOOLEAN
, 8,
13037 TFS(&tfs_ospf_rt_mt
), BGP_OSPF_RTYPE_METRIC_TYPE
, "OSPF metric type (Type-1 or Type-2) of the original route", HFILL
}},
13038 { &hf_bgp_ext_com_value_ospf_rid
,
13039 { "Router ID", "bgp.ext_com.value_ospf_rid", FT_IPv4
, BASE_NONE
,
13040 NULL
, 0x0, "OSPF Router ID of the redistributing PE router", HFILL
}},
13041 { &hf_bgp_ext_com_value_fs_remark
,
13042 { "Remarking value", "bgp.ext_com.value_fs_dscp", FT_UINT8
, BASE_HEX
| BASE_EXT_STRING
,
13043 &dscp_vals_ext
, BGPNLRI_FSPEC_DSCP_BITMASK
, NULL
, HFILL
}},
13044 { &hf_bgp_ext_com_local_admin_flags
,
13045 { "Local Administrator", "bgp.ext_com.local_admin", FT_UINT8
, BASE_HEX
,
13046 NULL
, 0x0, NULL
, HFILL
}},
13047 { &hf_bgp_ext_com_local_admin_auto_derived_flag
,
13048 { "A-Bit", "bgp.ext_com.local_admin.auto_derived", FT_BOOLEAN
, 8,
13049 TFS(&tfs_manually_auto_derived
), 0x80, NULL
, HFILL
}},
13050 { &hf_bgp_ext_com_local_admin_type
,
13051 { "Type", "bgp.ext_com.local_admin.type", FT_UINT8
, BASE_DEC
,
13052 VALS(bgp_ext_com_local_admin_types
), 0x70, NULL
, HFILL
}},
13053 { &hf_bgp_ext_com_local_admin_domain_id
,
13054 { "Domain Id", "bgp.ext_com.local_admin.domain_id", FT_UINT8
, BASE_DEC
,
13055 NULL
, 0x0F, NULL
, HFILL
}},
13056 { &hf_bgp_ext_com_local_admin_service_id
,
13057 { "Service Id", "bgp.ext_com.local_admin.service_id", FT_UINT24
, BASE_DEC
,
13058 NULL
, 0x00, NULL
, HFILL
}},
13059 { &hf_bgp_ext_com_value_raw
,
13060 { "Raw Value", "bgp.ext_com.value_raw", FT_UINT48
, BASE_HEX
,
13061 NULL
, 0x0, "Raw value of the lowmost 6 octets of the Extended Community attribute", HFILL
}},
13062 /* BGP update extended community flow spec RFC 5575 */
13063 { &hf_bgp_ext_com_flow_act_samp_act
,
13064 { "Sample", "bgp.ext_com_flow.sample", FT_BOOLEAN
, 8,
13065 TFS(&tfs_set_notset
), BGP_EXT_COM_FSPEC_ACT_S
, NULL
, HFILL
}},
13066 { &hf_bgp_ext_com_flow_act_term_act
,
13067 { "Terminal action", "bgp.ext_com_flow.traff_act", FT_BOOLEAN
, 8,
13068 TFS(&tfs_set_notset
),BGP_EXT_COM_FSPEC_ACT_T
,NULL
, HFILL
}},
13069 { &hf_bgp_ext_com_flow_rate_float
,
13070 { "Rate shaper", "bgp.ext_com_flow.rate_limit", FT_FLOAT
, BASE_NONE
,
13071 NULL
, 0x0, NULL
, HFILL
}},
13072 { &hf_bgp_ext_com_flow_act_allset
,
13073 { "5 Bytes", "bgp.flowspec_ext_com.emptybytes", FT_BYTES
, BASE_NONE
,
13074 NULL
, 0x0, "Must be set to all 0", HFILL
}},
13075 /* BGP QoS propagation draft-knoll-idr-qos-attribute */
13076 { &hf_bgp_ext_com_qos_flags
,
13077 { "Flags", "bgp.ext_com_qos.flags", FT_UINT8
, BASE_HEX
,
13078 NULL
, 0, NULL
, HFILL
}},
13079 { &hf_bgp_ext_com_qos_flags_remarking
,
13080 { "Remarking", "bgp.ext_com_qos.flags.remarking", FT_BOOLEAN
, 8,
13081 TFS(&tfs_yes_no
), 0x10, NULL
, HFILL
}},
13082 { &hf_bgp_ext_com_qos_flags_ignore_remarking
,
13083 { "Ignore remarking", "bgp.ext_com_qos.flags.ignore_remarking", FT_BOOLEAN
, 8,
13084 TFS(&tfs_yes_no
), 0x08, NULL
, HFILL
}},
13085 { &hf_bgp_ext_com_qos_flags_agg_marking
,
13086 { "Aggregation of markins", "bgp.ext_com_qos.flags.agg_marking", FT_BOOLEAN
, 8,
13087 TFS(&tfs_yes_no
), 0x04, NULL
, HFILL
}},
13088 { &hf_bgp_ext_com_cos_flags
,
13089 { "Flags byte", "bgp.ext_com_cos.flags", FT_UINT8
, BASE_HEX
,
13090 NULL
, 0, NULL
, HFILL
}},
13091 { &hf_bgp_ext_com_cos_flags_be
,
13092 { "BE class", "bgp.ext_com_cos.flags.be", FT_BOOLEAN
, 8,
13093 TFS(&tfs_supported_not_supported
), 0x80, NULL
, HFILL
}},
13094 { &hf_bgp_ext_com_cos_flags_ef
,
13095 { "EF class", "bgp.ext_com_cos.flags.ef", FT_BOOLEAN
, 8,
13096 TFS(&tfs_supported_not_supported
), 0x40, NULL
, HFILL
}},
13097 { &hf_bgp_ext_com_cos_flags_af
,
13098 { "AF class", "bgp.ext_com_cos.flags.af", FT_BOOLEAN
, 8,
13099 TFS(&tfs_supported_not_supported
), 0x20, NULL
, HFILL
}},
13100 { &hf_bgp_ext_com_cos_flags_le
,
13101 { "LE class", "bgp.ext_com_cos.flags.le", FT_BOOLEAN
, 8,
13102 TFS(&tfs_supported_not_supported
), 0x10, NULL
, HFILL
}},
13103 { &hf_bgp_ext_com_qos_set_number
,
13104 { "QoS Set Number", "bgp.ext_com_qos.set_number", FT_UINT8
, BASE_HEX
,
13105 NULL
, 0, NULL
, HFILL
}},
13106 { &hf_bgp_ext_com_qos_tech_type
,
13107 { "Technology Type", "bgp.ext_com_qos.tech_type", FT_UINT8
, BASE_HEX
,
13108 VALS(qos_tech_type
), 0, NULL
, HFILL
}},
13109 { &hf_bgp_ext_com_qos_marking_o
,
13110 { "QoS Marking O", "bgp.ext_com_qos.marking_o", FT_UINT16
, BASE_HEX
,
13111 NULL
, 0, NULL
, HFILL
}},
13112 { &hf_bgp_ext_com_qos_marking_a
,
13113 { "QoS Marking A", "bgp.ext_com_qos.marking_a", FT_UINT8
, BASE_HEX_DEC
,
13114 NULL
, 0, NULL
, HFILL
}},
13115 { &hf_bgp_ext_com_qos_default_to_zero
,
13116 { "Defaults to zero", "bgp.ext_com_qos.default_to_zero", FT_UINT8
, BASE_HEX
,
13117 NULL
, 0, NULL
, HFILL
}},
13118 /* BGP L2 extended community RFC 4761, RFC 6624 */
13119 /* draft-ietf-l2vpn-vpls-multihoming */
13120 { &hf_bgp_ext_com_l2_encaps
,
13121 { "Encaps Type", "bgp.ext_com_l2.encaps_type", FT_UINT8
, BASE_DEC
,
13122 VALS(bgp_l2vpn_encaps
), 0, NULL
, HFILL
}},
13123 { &hf_bgp_ext_com_l2_c_flags
,
13124 { "Control Flags", "bgp.ext_com_l2.c_flags", FT_UINT8
, BASE_HEX
,
13125 NULL
, 0x0, NULL
, HFILL
}},
13126 { &hf_bgp_ext_com_l2_flag_d
,
13127 { "Down flag", "bgp.ext_com_l2.flag_d",FT_BOOLEAN
, 8,
13128 TFS(&tfs_set_notset
), BGP_EXT_COM_L2_FLAG_D
, NULL
, HFILL
}},
13129 { &hf_bgp_ext_com_l2_flag_z1
,
13130 { "Unassigned", "bgp.ext_com_l2.flag_z1",FT_UINT8
, BASE_DEC
,
13131 NULL
, BGP_EXT_COM_L2_FLAG_Z1
, "Must be Zero", HFILL
}},
13132 { &hf_bgp_ext_com_l2_flag_f
,
13133 { "Flush flag", "bgp.ext_com_l2.flag_f",FT_BOOLEAN
, 8,
13134 TFS(&tfs_set_notset
), BGP_EXT_COM_L2_FLAG_F
, NULL
, HFILL
}},
13135 { &hf_bgp_ext_com_l2_flag_z345
,
13136 { "Unassigned", "bgp.ext_com_l2.flag_z345",FT_UINT8
, BASE_DEC
,
13137 NULL
, BGP_EXT_COM_L2_FLAG_Z345
, "Must be Zero", HFILL
}},
13138 { &hf_bgp_ext_com_l2_flag_c
,
13139 { "C flag", "bgp.ext_com_l2.flag_c",FT_BOOLEAN
, 8,
13140 TFS(&tfs_set_notset
), BGP_EXT_COM_L2_FLAG_C
, NULL
, HFILL
}},
13141 { &hf_bgp_ext_com_l2_flag_s
,
13142 { "S flag", "bgp.ext_com_l2.flag_s",FT_BOOLEAN
, 8,
13143 TFS(&tfs_set_notset
), BGP_EXT_COM_L2_FLAG_S
, NULL
, HFILL
}},
13144 { &hf_bgp_ext_com_l2_mtu
,
13145 { "Layer-2 MTU", "bgp.ext_com_l2.l2_mtu", FT_UINT16
, BASE_DEC
,
13146 NULL
, 0x0, NULL
, HFILL
}},
13147 { &hf_bgp_ext_com_l2_esi_label_flag
,
13148 { "Single active bit", "bgp.ext_com_l2.esi_label_flag",FT_BOOLEAN
, 8,
13149 TFS(&tfs_esi_label_flag
), BGP_EXT_COM_ESI_LABEL_FLAGS
, NULL
, HFILL
}},
13150 { &hf_bgp_ext_com_etree_root_vlan
,
13151 { "Root VLAN", "bgp.ext_com_etree.root_vlan", FT_UINT16
, BASE_DEC
,
13152 NULL
, 0x0FFF, NULL
, HFILL
}},
13153 { &hf_bgp_ext_com_etree_leaf_vlan
,
13154 { "Leaf VLAN", "bgp.ext_com_etree.leaf_vlan", FT_UINT16
, BASE_DEC
,
13155 NULL
, 0x0FFF, NULL
, HFILL
}},
13156 { &hf_bgp_ext_com_etree_flags
,
13157 { "Flags", "bgp.ext_com_etree.flags", FT_UINT16
, BASE_HEX
,
13158 NULL
, 0x0, NULL
, HFILL
}},
13159 { &hf_bgp_ext_com_etree_flag_reserved
,
13160 { "Reserved", "bgp.ext_com_etree.flag_reserved",FT_UINT16
, BASE_HEX
,
13161 NULL
, BGP_EXT_COM_ETREE_FLAG_RESERVED
, NULL
, HFILL
}},
13162 { &hf_bgp_ext_com_etree_flag_p
,
13163 { "P", "bgp.ext_com_etree.flag_p",FT_BOOLEAN
, 16,
13164 TFS(&tfs_set_notset
), BGP_EXT_COM_ETREE_FLAG_P
, "PE is attached with leaf nodes only", HFILL
}},
13165 { &hf_bgp_ext_com_etree_flag_v
,
13166 { "V", "bgp.ext_com_etree.flag_v",FT_BOOLEAN
, 16,
13167 TFS(&tfs_set_notset
), BGP_EXT_COM_ETREE_FLAG_V
, "VLAN mapping", HFILL
}},
13168 { &hf_bgp_ext_com_evpn_mmac_flag
,
13169 { "Flags", "bgp.ext_com_evpn.mmac.flags", FT_UINT8
, BASE_HEX
,
13170 NULL
, 0x0, "MAC Mobility flags", HFILL
}},
13171 { &hf_bgp_ext_com_evpn_mmac_flag_sticky
,
13172 { "Sticky/Static MAC", "bgp.ext_com_evpn.mmac.flags.sticky", FT_BOOLEAN
, 8,
13173 TFS(&tfs_yes_no
), BGP_EXT_COM_EVPN_MMAC_STICKY
, "Indicates whether the MAC address is fixed or movable", HFILL
}},
13174 { &hf_bgp_ext_com_evpn_mmac_seq
,
13175 { "Sequence number", "bgp.ext_com_evpn.mmac.seq", FT_UINT32
, BASE_DEC
,
13176 NULL
, 0x0, "MAC Mobility Update Sequence number", HFILL
}},
13177 { &hf_bgp_ext_com_evpn_esirt
,
13178 { "ES-Import Route Target", "bgp.ext_com_evpn.esi.rt", FT_ETHER
, BASE_NONE
,
13179 NULL
, 0x0, "Route Target as a MAC Address", HFILL
}},
13180 { &hf_bgp_ext_com_evpn_routermac
,
13181 { "Router's MAC", "bgp.ext_com_evpn.esi.router_mac", FT_ETHER
, BASE_NONE
,
13182 NULL
, 0x0, "Router's MAC Address", HFILL
}},
13183 { &hf_bgp_ext_com_evpn_l2attr_flags
,
13184 { "Flags", "bgp.ext_com_evpn.l2attr.flags", FT_UINT16
, BASE_HEX
,
13185 NULL
, 0x0, "EVPN L2 attribute flags", HFILL
}},
13186 { &hf_bgp_ext_com_evpn_l2attr_flag_reserved
,
13187 { "Reserved", "bgp.ext_com_evpn.l2attr.flag_reserved", FT_UINT16
, BASE_HEX
,
13188 NULL
, BGP_EXT_COM_EVPN_L2ATTR_FLAG_RESERVED
, NULL
, HFILL
}},
13189 { &hf_bgp_ext_com_evpn_l2attr_flag_ci
,
13190 { "CI flag", "bgp.ext_com_evpn.l2attr.flag_ci", FT_BOOLEAN
, 16,
13191 TFS(&tfs_set_notset
), BGP_EXT_COM_EVPN_L2ATTR_FLAG_CI
, "Control Word Indicator Extended Community can be advertised", HFILL
}},
13192 { &hf_bgp_ext_com_evpn_l2attr_flag_f
,
13193 { "F flag", "bgp.ext_com_evpn.l2attr.flag_f", FT_BOOLEAN
, 16,
13194 TFS(&tfs_set_notset
), BGP_EXT_COM_EVPN_L2ATTR_FLAG_F
, "PE is capable to send and receive flow label", HFILL
}},
13195 { &hf_bgp_ext_com_evpn_l2attr_flag_c
,
13196 { "C flag", "bgp.ext_com_evpn.l2attr.flag_c", FT_BOOLEAN
, 16,
13197 TFS(&tfs_set_notset
), BGP_EXT_COM_EVPN_L2ATTR_FLAG_C
, "Control word must be present when sending EVPN packets to this PE", HFILL
}},
13198 { &hf_bgp_ext_com_evpn_l2attr_flag_p
,
13199 { "P flag", "bgp.ext_com_evpn.l2attr.flag_p", FT_BOOLEAN
, 16,
13200 TFS(&tfs_set_notset
), BGP_EXT_COM_EVPN_L2ATTR_FLAG_P
, "Primary PE", HFILL
}},
13201 { &hf_bgp_ext_com_evpn_l2attr_flag_b
,
13202 { "B flag", "bgp.ext_com_evpn.l2attr.flag_b", FT_BOOLEAN
, 16,
13203 TFS(&tfs_set_notset
), BGP_EXT_COM_EVPN_L2ATTR_FLAG_B
, "Backup PE", HFILL
}},
13204 { &hf_bgp_ext_com_evpn_l2attr_l2_mtu
,
13205 { "L2 MTU", "bgp.ext_com_evpn.l2attr.l2_mtu", FT_UINT16
, BASE_DEC
,
13206 NULL
, 0x0, NULL
, HFILL
}},
13207 { &hf_bgp_ext_com_evpn_l2attr_reserved
,
13208 { "Reserved", "bgp.ext_com_evpn.l2attr.reserved", FT_BYTES
, BASE_NONE
,
13209 NULL
, 0x0, NULL
, HFILL
}},
13210 { &hf_bgp_ext_com_evpn_etree_flags
,
13211 { "Flags", "bgp.ext_com_evpn.etree.flags", FT_UINT8
, BASE_HEX
,
13212 NULL
, 0x0, "EVPN E-Tree attribute flags", HFILL
}},
13213 { &hf_bgp_ext_com_evpn_etree_flag_reserved
,
13214 { "Reserved", "bgp.ext_com_evpn.etree.flag_reserved", FT_UINT8
, BASE_HEX
,
13215 NULL
, BGP_EXT_COM_EVPN_ETREE_FLAG_RESERVED
, NULL
, HFILL
}},
13216 { &hf_bgp_ext_com_evpn_etree_flag_l
,
13217 { "L flag", "bgp.ext_com_evpn.etree.flag_l", FT_BOOLEAN
, 8,
13218 TFS(&tfs_set_notset
), BGP_EXT_COM_EVPN_ETREE_FLAG_L
, "Leaf-Indication", HFILL
}},
13219 { &hf_bgp_ext_com_evpn_etree_reserved
,
13220 { "Reserved", "bgp.ext_com_evpn.etree.reserved", FT_BYTES
, BASE_NONE
,
13221 NULL
, 0x0, NULL
, HFILL
}},
13222 /* BGP Cost Community */
13223 { &hf_bgp_ext_com_cost_poi
,
13224 { "Point of insertion", "bgp.ext_com_cost.poi", FT_UINT8
, BASE_DEC
,
13225 VALS(bgpext_com_cost_poi_type
), 0x0, "Placement of the Cost value in the BGP Best Path algorithm", HFILL
}},
13226 { &hf_bgp_ext_com_cost_cid
,
13227 { "Community ID", "bgp.ext_com_cost.cid", FT_UINT8
, BASE_DEC
,
13228 NULL
, 0x0, "Community instance ID to distinguish between multiple Cost communities", HFILL
}},
13229 { &hf_bgp_ext_com_cost_cost
,
13230 { "Cost", "bgp.ext_com_cost.cost", FT_UINT32
, BASE_DEC
,
13231 NULL
, 0x0, "Cost value", HFILL
}},
13232 { &hf_bgp_ext_com_cost_cid_rep
,
13233 { "Cost use", "bgp.ext_com_cost.cid.use", FT_BOOLEAN
, 8,
13234 TFS(&tfs_cost_replace
), BGP_EXT_COM_COST_CID_REP
, "Indicates whether the Cost value will replace the original attribute value", HFILL
}},
13235 /* EIGRP Route Metrics Extended Communities */
13236 { &hf_bgp_ext_com_stype_tr_exp_eigrp
,
13237 { "Route Attributes", "bgp.ext_com_eigrp", FT_UINT8
, BASE_DEC
,
13238 VALS(bgpext_com_stype_tr_eigrp
), 0x0, "Original EIGRP route attributes", HFILL
}},
13239 { &hf_bgp_ext_com_eigrp_flags
,
13240 { "Route flags", "bgp.ext_com_eigrp.flags", FT_UINT16
, BASE_HEX
,
13241 NULL
, 0x0, "EIGRP Route flags bitfield", HFILL
}},
13242 { &hf_bgp_ext_com_eigrp_flags_rt
,
13243 { "Route type", "bgp.ext_com_eigrp.flags.rt", FT_BOOLEAN
, 16,
13244 TFS(&tfs_eigrp_rtype
), BGP_EXT_COM_EXP_EIGRP_FLAG_RT
, "Original EIGRP route type (internal/external)", HFILL
}},
13245 { &hf_bgp_ext_com_eigrp_rtag
,
13246 { "Route tag", "bgp.ext_com_eigrp.rtag", FT_UINT32
, BASE_DEC
,
13247 NULL
, 0x0, "Original EIGRP route tag", HFILL
}},
13248 { &hf_bgp_ext_com_eigrp_asn
,
13249 { "AS Number", "bgp.ext_com_eigrp.asn", FT_UINT16
, BASE_DEC
,
13250 NULL
, 0x0, "Original EIGRP Autonomous System Number this route comes from", HFILL
}},
13251 { &hf_bgp_ext_com_eigrp_delay
,
13252 { "Delay", "bgp.ext_com_eigrp.dly", FT_UINT32
, BASE_DEC
,
13253 NULL
, 0x0, "Original EIGRP route delay metric", HFILL
}},
13254 { &hf_bgp_ext_com_eigrp_rly
,
13255 { "Reliability", "bgp.ext_com_eigrp.rly", FT_UINT8
, BASE_DEC
,
13256 NULL
, 0x0, "Original EIGRP route reliability metric", HFILL
}},
13257 { &hf_bgp_ext_com_eigrp_hops
,
13258 { "Hop count", "bgp.ext_com_eigrp.hops", FT_UINT8
, BASE_DEC
,
13259 NULL
, 0x0, "Original EIGRP route hop count", HFILL
}},
13260 { &hf_bgp_ext_com_eigrp_bw
,
13261 { "Bandwidth", "bgp.ext_com_eigrp.bw", FT_UINT32
, BASE_DEC
,
13262 NULL
, 0x0, "Original EIGRP route bandwidth metric", HFILL
}},
13263 { &hf_bgp_ext_com_eigrp_load
,
13264 { "Load", "bgp.ext_com_eigrp.load", FT_UINT8
, BASE_DEC
,
13265 NULL
, 0x0, "Original EIGRP route load metric", HFILL
}},
13266 { &hf_bgp_ext_com_eigrp_mtu
,
13267 { "MTU", "bgp.ext_com_eigrp.mtu", FT_UINT32
, BASE_DEC
,
13268 NULL
, 0x0, "Original EIGRP route path MTU", HFILL
}},
13269 { &hf_bgp_ext_com_eigrp_rid
,
13270 { "Router ID", "bgp.ext_com_eigrp.rid", FT_IPv4
, BASE_NONE
,
13271 NULL
, 0x0, "EIGRP Router ID of the router that originated the route", HFILL
}},
13272 { &hf_bgp_ext_com_eigrp_e_asn
,
13273 { "External AS Number", "bgp.ext_com_eigrp.e_asn", FT_UINT16
, BASE_DEC
,
13274 NULL
, 0x0, "Original AS Number of the route before its redistribution into EIGRP", HFILL
}},
13275 { &hf_bgp_ext_com_eigrp_e_rid
,
13276 { "External Router ID", "bgp.ext_com_eigrp.e_rid", FT_IPv4
, BASE_NONE
,
13277 NULL
, 0x0, "EIGRP Router ID of the router that redistributed this route into EIGRP", HFILL
}},
13278 { &hf_bgp_ext_com_eigrp_e_pid
,
13279 { "External protocol", "bgp.ext_com_eigrp.e_pid", FT_UINT16
, BASE_DEC
,
13280 VALS(eigrp_proto2string
), 0x0, "Original routing protocol from which this route was redistributed into EIGRP", HFILL
}},
13281 { &hf_bgp_ext_com_eigrp_e_m
,
13282 { "External metric", "bgp.ext_com_eigrp.e_metric", FT_UINT32
, BASE_DEC
,
13283 NULL
, 0x0, "Original metric of the route before its redistribution into EIGRP", HFILL
}},
13284 { &hf_bgp_ext_com_mup_segment_id2
,
13285 { "Segment Identifier 2-byte", "bgp.ext_com_mup.segment_id2", FT_UINT16
, BASE_DEC
,
13286 NULL
, 0x0, "Configurable segment identifier value 2-byte", HFILL
}},
13287 { &hf_bgp_ext_com_mup_segment_id4
,
13288 { "Segment Identifier 4-byte", "bgp.ext_com_mup.segment_id4", FT_UINT32
, BASE_DEC
,
13289 NULL
, 0x0, "Configurable segment identifier value 4-byte", HFILL
}},
13293 { "Type", "bgp.ls.type", FT_UINT16
, BASE_DEC
,
13294 NULL
, 0x0, "BGP-LS message type", HFILL
}},
13295 { &hf_bgp_ls_length
,
13296 { "Length", "bgp.ls.length", FT_UINT16
, BASE_DEC
,
13297 NULL
, 0x0, "The total length of the message payload in octets", HFILL
}},
13299 { "BGP-LS NLRI", "bgp.ls.nlri", FT_NONE
,
13300 BASE_NONE
, NULL
, 0x0, NULL
, HFILL
}},
13301 { &hf_bgp_ls_safi128_nlri
,
13302 { "Link State SAFI 128 NLRI", "bgp.ls.nlri_safi128", FT_NONE
,
13303 BASE_NONE
, NULL
, 0x0, NULL
, HFILL
}},
13304 { &hf_bgp_ls_safi128_nlri_route_distinguisher
,
13305 { "Route Distinguisher", "bgp.ls.nlri_safi128_route_distinguisher", FT_NONE
,
13306 BASE_NONE
, NULL
, 0x0, NULL
, HFILL
}},
13307 { &hf_bgp_ls_safi128_nlri_route_distinguisher_type
,
13308 { "Route Distinguisher Type", "bgp.ls.nlri_safi128_route_distinguisher_type", FT_UINT16
,
13309 BASE_DEC
, NULL
, 0x0, NULL
, HFILL
}},
13310 { &hf_bgp_ls_safi128_nlri_route_dist_admin_asnum_2
,
13311 { "Administrator Subfield", "bgp.ls.nlri_safi128_route_distinguisher_admin_as_num_2", FT_UINT16
,
13312 BASE_DEC
, NULL
, 0x0, NULL
, HFILL
}},
13313 { &hf_bgp_ls_safi128_nlri_route_dist_admin_ipv4
,
13314 { "Administrator Subfield", "bgp.ls.nlri_safi128_route_distinguisher_admin_ipv4", FT_IPv4
,
13315 BASE_NONE
, NULL
, 0x0, NULL
, HFILL
}},
13316 { &hf_bgp_ls_safi128_nlri_route_dist_admin_asnum_4
,
13317 { "Administrator Subfield", "bgp.ls.nlri_safi128_route_distinguisher_admin_as_num_4", FT_UINT32
,
13318 BASE_HEX_DEC
, NULL
, 0x0, NULL
, HFILL
}},
13319 { &hf_bgp_ls_safi128_nlri_route_dist_asnum_2
,
13320 { "Assigned Number Subfield", "bgp.ls.nlri_safi128_route_distinguisher_asnum_2", FT_UINT16
,
13321 BASE_DEC
, NULL
, 0x0, NULL
, HFILL
}},
13322 { &hf_bgp_ls_safi128_nlri_route_dist_asnum_4
,
13323 { "Assigned Number Subfield", "bgp.ls.nlri_safi128_route_distinguisher_asnum_4", FT_UINT32
,
13324 BASE_HEX_DEC
, NULL
, 0x0, NULL
, HFILL
}},
13325 { &hf_bgp_ls_nlri_type
,
13326 { "NLRI Type", "bgp.ls.nlri_type", FT_UINT16
,
13327 BASE_DEC
, VALS(bgp_ls_nlri_type_vals
), 0x0, NULL
, HFILL
}},
13328 { &hf_bgp_ls_nlri_length
,
13329 { "NLRI Length", "bgp.ls.nlri_length", FT_UINT16
,
13330 BASE_DEC
, NULL
, 0x0, NULL
, HFILL
}},
13331 { &hf_bgp_ls_nlri_link_nlri_type
,
13332 { "Link-State NLRI Link NLRI", "bgp.ls.nlri_link", FT_NONE
,
13333 BASE_NONE
, NULL
, 0x0, NULL
, HFILL
}},
13334 { &hf_bgp_ls_nlri_link_descriptors_tlv
,
13335 { "Link Descriptors TLV", "bgp.ls.nlri_link_descriptors_tlv", FT_NONE
,
13336 BASE_NONE
, NULL
, 0x0, NULL
, HFILL
}},
13337 { &hf_bgp_ls_nlri_prefix_descriptors_tlv
,
13338 { "Prefix Descriptors TLV", "bgp.ls.nlri_prefix_descriptors_tlv", FT_NONE
,
13339 BASE_NONE
, NULL
, 0x0, NULL
, HFILL
}},
13340 { &hf_bgp_ls_nlri_srv6_sid_descriptors_tlv
,
13341 { "SRv6 SID Descriptors TLV", "bgp.ls.nlri_srv6_sid_descriptors_tlv", FT_NONE
,
13342 BASE_NONE
, NULL
, 0x0, NULL
, HFILL
}},
13343 { &hf_bgp_ls_nlri_link_local_identifier
,
13344 { "Link Local Identifier", "bgp.ls.nlri_link_local_identifier", FT_UINT32
,
13345 BASE_HEX_DEC
, NULL
, 0x0, NULL
, HFILL
}},
13346 { &hf_bgp_ls_nlri_link_remote_identifier
,
13347 { "Link Remote Identifier", "bgp.ls.nlri_link_remote_identifier", FT_UINT32
,
13348 BASE_HEX_DEC
, NULL
, 0x0, NULL
, HFILL
}},
13349 { &hf_bgp_ls_nlri_ipv4_interface_address
,
13350 { "IPv4 Interface Address", "bgp.ls.nlri_ipv4_interface_address", FT_IPv4
,
13351 BASE_NONE
, NULL
, 0x0, NULL
, HFILL
}},
13352 { &hf_bgp_ls_nlri_ipv4_neighbor_address
,
13353 { "IPv4 Neighbor Address", "bgp.ls.nlri_ipv4_neighbor_address", FT_IPv4
,
13354 BASE_NONE
, NULL
, 0x0, NULL
, HFILL
}},
13355 { &hf_bgp_ls_nlri_ipv6_interface_address
,
13356 { "IPv6 Interface Address", "bgp.ls.nlri_ipv6_interface_address", FT_IPv6
,
13357 BASE_NONE
, NULL
, 0x0, NULL
, HFILL
}},
13358 { &hf_bgp_ls_nlri_ipv6_neighbor_address
,
13359 { "IPv6 Neighbor Address", "bgp.ls.nlri_ipv6_neighbor_address", FT_IPv6
,
13360 BASE_NONE
, NULL
, 0x0, NULL
, HFILL
}},
13361 { &hf_bgp_ls_nlri_multi_topology_id
,
13362 { "Multi Topology ID", "bgp.ls.nlri_multi_topology_id", FT_UINT16
,
13363 BASE_DEC_HEX
, NULL
, 0x0fff, NULL
, HFILL
}},
13364 { &hf_bgp_ls_nlri_ospf_route_type
,
13365 { "OSPF Route Type", "bgp.ls.nlri_ospf_route_type", FT_UINT8
,
13366 BASE_DEC
, VALS(link_state_prefix_descriptors_ospf_route_type
), 0x0, NULL
, HFILL
}},
13367 { &hf_bgp_ls_nlri_ip_reachability_prefix_ip
,
13368 { "Reachability prefix", "bgp.ls.nlri_ip_reachability_prefix_ip", FT_IPv4
,
13369 BASE_NONE
, NULL
, 0x0, NULL
, HFILL
}},
13370 { &hf_bgp_ls_nlri_ip_reachability_prefix_ip6
,
13371 { "Reachability prefix", "bgp.ls.nlri_ip_reachability_prefix_ip6", FT_IPv6
,
13372 BASE_NONE
, NULL
, 0x0, NULL
, HFILL
}},
13373 { &hf_bgp_ls_nlri_node_nlri_type
,
13374 { "Link-State NLRI Node NLRI", "bgp.ls.nlri_node", FT_NONE
,
13375 BASE_NONE
, NULL
, 0x0, NULL
, HFILL
}},
13376 { &hf_bgp_ls_nlri_node_protocol_id
,
13377 { "Protocol ID", "bgp.ls.nlri_node.protocol_id", FT_UINT8
,
13378 BASE_DEC
, VALS(link_state_nlri_protocol_id_values
), 0x0, NULL
, HFILL
}},
13379 { &hf_bgp_ls_nlri_node_identifier
,
13380 { "Identifier", "bgp.ls.nlri_node.identifier", FT_UINT64
,
13381 BASE_DEC
| BASE_VAL64_STRING
, VALS64(link_state_nlri_routing_universe_values
), 0x0, NULL
, HFILL
}},
13382 { &hf_bgp_ls_ipv4_topology_prefix_nlri_type
,
13383 { "Link-State NLRI IPv4 Topology Prefix", "bgp.ls.ipv4_topology_prefix", FT_NONE
,
13384 BASE_NONE
, NULL
, 0x0, NULL
, HFILL
}},
13385 { &hf_bgp_ls_ipv6_topology_prefix_nlri_type
,
13386 { "Link-State NLRI IPv6 Topology Prefix", "bgp.ls.ipv6_topology_prefix", FT_NONE
,
13387 BASE_NONE
, NULL
, 0x0, NULL
, HFILL
}},
13388 { &hf_bgp_ls_nlri_srv6_sid_nlri_type
,
13389 { "Link-State NLRI SRv6 SID NLRI", "bgp.ls.nlri_srv6_sid", FT_NONE
,
13390 BASE_NONE
, NULL
, 0x0, NULL
, HFILL
}},
13392 { &hf_bgp_ls_tlv_local_node_descriptors
,
13393 { "Local Node Descriptors TLV", "bgp.ls.tlv.local_node_descriptors", FT_NONE
,
13394 BASE_NONE
, NULL
, 0x0, NULL
, HFILL
}},
13395 { &hf_bgp_ls_tlv_remote_node_descriptors
,
13396 { "Remote Node Descriptors TLV", "bgp.ls.tlv.remote_node_descriptors", FT_NONE
,
13397 BASE_NONE
, NULL
, 0x0, NULL
, HFILL
}},
13398 { &hf_bgp_ls_tlv_autonomous_system
,
13399 { "Autonomous System TLV", "bgp.ls.tlv.autonomous_system", FT_NONE
,
13400 BASE_NONE
, NULL
, 0x0, NULL
, HFILL
}},
13401 { &hf_bgp_ls_tlv_autonomous_system_id
,
13402 { "AS ID", "bgp.ls.tlv.autonomous_system.id", FT_UINT32
,
13403 BASE_DEC_HEX
, NULL
, 0x0, NULL
, HFILL
}},
13404 { &hf_bgp_ls_tlv_bgp_ls_identifier
,
13405 { "BGP-LS Identifier TLV", "bgp.ls.tlv.bgp_ls_identifier", FT_NONE
,
13406 BASE_NONE
, NULL
, 0x0, NULL
, HFILL
}},
13407 { &hf_bgp_ls_tlv_bgp_ls_identifier_id
,
13408 { "BGP-LS ID", "bgp.ls.tlv.bgp_ls_identifier_id", FT_UINT32
,
13409 BASE_DEC_HEX
, NULL
, 0x0, NULL
, HFILL
}},
13410 { &hf_bgp_ls_tlv_area_id
,
13411 { "Area ID TLV", "bgp.ls.tlv.area_id", FT_NONE
,
13412 BASE_NONE
, NULL
, 0x0, NULL
, HFILL
}},
13413 { &hf_bgp_ls_tlv_area_id_id
,
13414 { "Area ID", "bgp.ls.tlv.area_id.id", FT_UINT32
,
13415 BASE_DEC_HEX
, NULL
, 0x0, NULL
, HFILL
}},
13416 { &hf_bgp_ls_tlv_ipv4_router_id_of_local_node
,
13417 { "IPv4 Router-ID of Local Node TLV", "bgp.ls.tlv.ipv4_router_id_of_local_node", FT_NONE
,
13418 BASE_NONE
, NULL
, 0x0, NULL
, HFILL
}},
13419 { &hf_bgp_ls_tlv_ipv4_router_id_value
,
13420 { "IPv4 Router-ID", "bgp.ls.tlv.ipv4_router_id_value", FT_IPv4
,
13421 BASE_NONE
, NULL
, 0x0, NULL
, HFILL
}},
13422 { &hf_bgp_ls_tlv_ipv6_router_id_of_local_node
,
13423 { "IPv6 Router-ID of Local Node TLV", "bgp.ls.tlv.ipv6_router_id_of_local_node", FT_NONE
,
13424 BASE_NONE
, NULL
, 0x0, NULL
, HFILL
}},
13425 { &hf_bgp_ls_tlv_ipv6_router_id_value
,
13426 { "IPv6 Router-ID", "bgp.ls.tlv.ipv6_router_id_value", FT_IPv6
,
13427 BASE_NONE
, NULL
, 0x0, NULL
, HFILL
}},
13428 { &hf_bgp_ls_tlv_ipv4_router_id_of_remote_node
,
13429 { "IPv4 Router-ID of Remote Node TLV", "bgp.ls.tlv.ipv4_router_id_of_remote_node", FT_NONE
,
13430 BASE_NONE
, NULL
, 0x0, NULL
, HFILL
}},
13431 { &hf_bgp_ls_tlv_ipv6_router_id_of_remote_node
,
13432 { "IPv6 Router-ID of Remote Node TLV", "bgp.ls.tlv.ipv6_router_id_of_remote_node", FT_NONE
,
13433 BASE_NONE
, NULL
, 0x0, NULL
, HFILL
}},
13434 { &hf_bgp_ls_tlv_link_local_remote_identifiers
,
13435 { "Link Local/Remote Identifiers TLV", "bgp.ls.tlv.link_local_remote_identifiers", FT_NONE
,
13436 BASE_NONE
, NULL
, 0x0, NULL
, HFILL
}},
13437 { &hf_bgp_ls_tlv_ipv4_interface_address
,
13438 { "IPv4 interface address TLV", "bgp.ls.tlv.ipv4_interface_address", FT_NONE
,
13439 BASE_NONE
, NULL
, 0x0, NULL
, HFILL
}},
13440 { &hf_bgp_ls_tlv_ipv4_neighbor_address
,
13441 { "IPv4 neighbor address TLV", "bgp.ls.tlv.ipv4_neighbor_address", FT_NONE
,
13442 BASE_NONE
, NULL
, 0x0, NULL
, HFILL
}},
13443 { &hf_bgp_ls_tlv_ipv6_interface_address
,
13444 { "IPv6 interface address TLV", "bgp.ls.tlv.ipv6_interface_address", FT_NONE
,
13445 BASE_NONE
, NULL
, 0x0, NULL
, HFILL
}},
13446 { &hf_bgp_ls_tlv_ipv6_neighbor_address
,
13447 { "IPv6 neighbor address TLV", "bgp.ls.tlv.ipv6_neighbor_address", FT_NONE
,
13448 BASE_NONE
, NULL
, 0x0, NULL
, HFILL
}},
13449 { &hf_bgp_ls_tlv_node_msd
,
13450 { "Node MSD TLV", "bgp.ls.tlv.node_msd", FT_NONE
,
13451 BASE_NONE
, NULL
, 0x0, NULL
, HFILL
}},
13452 { &hf_bgp_ls_tlv_link_msd
,
13453 { "Link MSD TLV", "bgp.ls.tlv.link_msd", FT_NONE
,
13454 BASE_NONE
, NULL
, 0x0, NULL
, HFILL
}},
13455 { &hf_bgp_ls_tlv_igp_msd_type
,
13456 { "MSD Type", "bgp.ls.tlv.igp_msd_type", FT_UINT8
,
13457 BASE_DEC
, VALS(igp_msd_types
), 0x0, NULL
, HFILL
}},
13458 { &hf_bgp_ls_tlv_igp_msd_value
,
13459 { "MSD Value", "bgp.ls.tlv.igp_msd_value", FT_UINT8
,
13460 BASE_DEC
, NULL
, 0x0, NULL
, HFILL
}},
13461 { &hf_bgp_ls_tlv_multi_topology_id
,
13462 { "Multi Topology ID TLV", "bgp.ls.tlv.multi_topology_id", FT_NONE
,
13463 BASE_NONE
, NULL
, 0x0, NULL
, HFILL
}},
13464 { &hf_bgp_ls_tlv_ospf_route_type
,
13465 { "OSPF Route Type TLV", "bgp.ls.tlv.ospf_route_type", FT_NONE
,
13466 BASE_NONE
, NULL
, 0x0, NULL
, HFILL
}},
13467 { &hf_bgp_ls_tlv_ip_reachability_information
,
13468 { "IP Reachability Information TLV", "bgp.ls.tlv.ip_reachability_information", FT_NONE
,
13469 BASE_NONE
, NULL
, 0x0, NULL
, HFILL
}},
13470 { &hf_bgp_ls_tlv_administrative_group_color
,
13471 { "Administrative group (color) TLV", "bgp.ls.tlv.administrative_group_color", FT_NONE
,
13472 BASE_NONE
, NULL
, 0x0, NULL
, HFILL
}},
13473 { &hf_bgp_ls_tlv_administrative_group_color_value
,
13474 { "Group Mask", "bgp.ls.tlv.administrative_group_color_value", FT_UINT32
,
13475 BASE_DEC
, NULL
, 0xffff, NULL
, HFILL
}},
13476 { &hf_bgp_ls_tlv_administrative_group
,
13477 { "Group", "bgp.ls.tlv.administrative_group", FT_UINT32
,
13478 BASE_DEC
, NULL
, 0xffff, NULL
, HFILL
}},
13479 { &hf_bgp_ls_tlv_max_link_bandwidth
,
13480 { "Maximum link bandwidth TLV", "bgp.ls.tlv.maximum_link_bandwidth", FT_NONE
,
13481 BASE_NONE
, NULL
, 0x0, NULL
, HFILL
}},
13482 { &hf_bgp_ls_tlv_max_reservable_link_bandwidth
,
13483 { "Maximum reservable link bandwidth TLV", "bgp.ls.tlv.maximum_reservable_link_bandwidth", FT_NONE
,
13484 BASE_NONE
, NULL
, 0x0, NULL
, HFILL
}},
13485 { &hf_bgp_ls_tlv_unreserved_bandwidth
,
13486 { "Unreserved bandwidth TLV", "bgp.ls.tlv.unreserved_bandwidth", FT_NONE
,
13487 BASE_NONE
, NULL
, 0x0, NULL
, HFILL
}},
13488 { &hf_bgp_ls_bandwidth_value
,
13489 {"Bandwidth", "bgp.ls.bandwidth_value", FT_FLOAT
,
13490 BASE_NONE
, NULL
, 0x0, NULL
, HFILL
}},
13491 { &hf_bgp_ls_tlv_te_default_metric
,
13492 { "TE Default Metric TLV", "bgp.ls.tlv.te_default_metric", FT_NONE
,
13493 BASE_NONE
, NULL
, 0x0, NULL
, HFILL
}},
13494 { &hf_bgp_ls_tlv_te_default_metric_value_old
,
13495 { "TE Default Metric (old format)", "bgp.ls.tlv.te_default_metric_value.old", FT_UINT24
,
13496 BASE_HEX_DEC
, NULL
, 0x0, NULL
, HFILL
}},
13497 { &hf_bgp_ls_tlv_te_default_metric_value
,
13498 { "TE Default Metric", "bgp.ls.tlv.te_default_metric_value", FT_UINT32
,
13499 BASE_HEX_DEC
, NULL
, 0x0, NULL
, HFILL
}},
13500 { &hf_bgp_ls_tlv_link_protection_type
,
13501 { "Link Protection Type TLV", "bgp.ls.tlv.link_protection_type", FT_NONE
,
13502 BASE_NONE
, NULL
, 0x0, NULL
, HFILL
}},
13503 { &hf_bgp_ls_tlv_link_protection_type_value
,
13504 { "Protection Capabilities", "bgp.ls.tlv.link_protection_type_value", FT_UINT8
,
13505 BASE_HEX
, NULL
, 0x0, NULL
, HFILL
}},
13506 { &hf_bgp_ls_tlv_mpls_protocol_mask
,
13507 { "MPLS Protocol Mask TLV", "bgp.ls.tlv.mpls_protocol_mask", FT_NONE
,
13508 BASE_NONE
, NULL
, 0x0, NULL
, HFILL
}},
13509 { &hf_bgp_ls_tlv_metric
,
13510 { "Metric TLV", "bgp.ls.tlv.metric", FT_NONE
,
13511 BASE_NONE
, NULL
, 0x0, NULL
, HFILL
}},
13512 { &hf_bgp_ls_tlv_metric_value1
,
13513 { "IGP Metric", "bgp.ls.tlv.metric_value", FT_UINT8
,
13514 BASE_HEX_DEC
, NULL
, 0x0, NULL
, HFILL
}},
13515 { &hf_bgp_ls_tlv_metric_value2
,
13516 { "IGP Metric", "bgp.ls.tlv.metric_value", FT_UINT16
,
13517 BASE_HEX_DEC
, NULL
, 0x0, NULL
, HFILL
}},
13518 { &hf_bgp_ls_tlv_metric_value3
,
13519 { "IGP Metric", "bgp.ls.tlv.metric_value", FT_UINT24
,
13520 BASE_HEX_DEC
, NULL
, 0x0, NULL
, HFILL
}},
13521 { &hf_bgp_ls_tlv_shared_risk_link_group
,
13522 { "Shared Risk Link Group TLV", "bgp.ls.tlv.shared_risk_link_group", FT_NONE
,
13523 BASE_NONE
, NULL
, 0x0, NULL
, HFILL
}},
13524 { &hf_bgp_ls_tlv_shared_risk_link_group_value
,
13525 { "Shared Risk Link Group Value", "bgp.ls.tlv.shared_risk_link_group_value", FT_UINT32
,
13526 BASE_HEX_DEC
, NULL
, 0x0, NULL
, HFILL
}},
13527 { &hf_bgp_ls_tlv_opaque_link_attribute
,
13528 { "Opaque Link Attribute TLV", "bgp.ls.tlv.opaque_link_attribute", FT_NONE
,
13529 BASE_NONE
, NULL
, 0x0, NULL
, HFILL
}},
13530 { &hf_bgp_ls_tlv_opaque_link_attribute_value
,
13531 { "Opaque link attributes", "bgp.ls.tlv.opaque_link_attribute_value", FT_NONE
,
13532 BASE_NONE
, NULL
, 0x0, NULL
, HFILL
}},
13533 { &hf_bgp_ls_tlv_link_name_attribute
,
13534 { "Opaque Link Attribute TLV", "bgp.ls.tlv.link_name_attribute", FT_NONE
,
13535 BASE_NONE
, NULL
, 0x0, NULL
, HFILL
}},
13536 { &hf_bgp_ls_tlv_link_name_attribute_value
,
13537 {"Link Name", "bgp.ls.tlv.link_name_attribute_value", FT_STRING
,
13538 BASE_NONE
, NULL
, 0, NULL
, HFILL
}},
13539 { &hf_bgp_ls_tlv_igp_flags
,
13540 { "IGP Flags TLV", "bgp.ls.tlv.igp_flags", FT_NONE
,
13541 BASE_NONE
, NULL
, 0x0, NULL
, HFILL
}},
13542 { &hf_bgp_ls_tlv_route_tag
,
13543 { "Route Tag TLV", "bgp.ls.tlv.route_tag", FT_NONE
,
13544 BASE_NONE
, NULL
, 0x0, NULL
, HFILL
}},
13545 { &hf_bgp_ls_tlv_route_tag_value
,
13546 { "Route Tag Value", "bgp.ls.tlv.route_tag_value", FT_UINT32
,
13547 BASE_HEX_DEC
, NULL
, 0x0, NULL
, HFILL
}},
13548 { &hf_bgp_ls_tlv_route_extended_tag
,
13549 { "Extended Route Tag TLV", "bgp.ls.tlv.route_extended_tag", FT_NONE
,
13550 BASE_NONE
, NULL
, 0x0, NULL
, HFILL
}},
13551 { &hf_bgp_ls_tlv_route_extended_tag_value
,
13552 {"Extended Route Tag", "bgp.ls.tlv.extended_route_tag_value", FT_UINT64
,
13553 BASE_HEX_DEC
, NULL
, 0x0, NULL
, HFILL
}},
13554 { &hf_bgp_ls_tlv_prefix_metric
,
13555 { "Prefix Metric TLV", "bgp.ls.tlv.prefix_metric", FT_NONE
,
13556 BASE_NONE
, NULL
, 0x0, NULL
, HFILL
}},
13557 { &hf_bgp_ls_tlv_prefix_metric_value
,
13558 { "Prefix Metric", "bgp.ls.tlv.prefix_metric_value", FT_UINT32
,
13559 BASE_HEX_DEC
, NULL
, 0x0, NULL
, HFILL
}},
13560 { &hf_bgp_ls_ospf_forwarding_address
,
13561 { "OSPF Forwarding Address TLV", "bgp.ls.tlv.ospf_forwarding_address", FT_NONE
,
13562 BASE_NONE
, NULL
, 0x0, NULL
, HFILL
}},
13563 { &hf_bgp_ls_ospf_forwarding_address_ipv4_address
,
13564 { "OSPF forwarding IPv4 address", "bgp.ls.tlv.ospf_forwarding_address_ipv4", FT_IPv4
,
13565 BASE_NONE
, NULL
, 0x0, NULL
, HFILL
}},
13566 { &hf_bgp_ls_ospf_forwarding_address_ipv6_address
,
13567 { "OSPF forwarding IPv6 address", "bgp.ls.tlv.ospf_forwarding_address_ipv6", FT_IPv6
,
13568 BASE_NONE
, NULL
, 0x0, NULL
, HFILL
}},
13569 { &hf_bgp_ls_opaque_prefix_attribute
,
13570 { "Opaque Prefix Attribute TLV", "bgp.ls.tlv.opaque_prefix_attribute", FT_NONE
,
13571 BASE_NONE
, NULL
, 0x0, NULL
, HFILL
}},
13572 { &hf_bgp_ls_opaque_prefix_attribute_value
,
13573 { "Opaque prefix attributes", "bgp.ls.tlv.opaque_prefix_attribute_value", FT_NONE
,
13574 BASE_NONE
, NULL
, 0x0, NULL
, HFILL
}},
13575 { &hf_bgp_ls_extended_administrative_group
,
13576 { "Extended Administrative Group TLV", "bgp.ls.tlv.extended_administrative_group", FT_NONE
,
13577 BASE_NONE
, NULL
, 0x0, NULL
, HFILL
}},
13578 { &hf_bgp_ls_extended_administrative_group_value
,
13579 { "Extended Administrative Group", "bgp.ls.tlv.extended_administrative_group_value", FT_BYTES
,
13580 BASE_NONE
, NULL
, 0x0, NULL
, HFILL
}},
13581 { &hf_bgp_ls_tlv_igp_router
,
13582 { "IGP Router-ID", "bgp.ls.tlv.igp_router", FT_NONE
,
13583 BASE_NONE
, NULL
, 0x0, NULL
, HFILL
}},
13584 { &hf_bgp_ls_tlv_igp_router_id
,
13585 { "IGP ID", "bgp.ls.tlv.igp_router_id", FT_BYTES
,
13586 BASE_NONE
, NULL
, 0x0, NULL
, HFILL
}},
13587 { &hf_bgp_ls_tlv_bgp_router_id
,
13588 { "BGP Router-ID TLV", "bgp.ls.tlv.bgp_router_id", FT_NONE
,
13589 BASE_NONE
, NULL
, 0x0, NULL
, HFILL
}},
13590 { &hf_bgp_ls_tlv_bgp_router_id_id
,
13591 { "BGP Router-ID", "bgp.ls.tlv.bgp_router_id.id", FT_IPv4
,
13592 BASE_NONE
, NULL
, 0x0, NULL
, HFILL
}},
13593 { &hf_bgp_ls_tlv_srv6_sid_info
,
13594 { "SRv6 SID Information TLV", "bgp.ls.tlv.srv6_sid_info", FT_NONE
,
13595 BASE_NONE
, NULL
, 0x0, NULL
, HFILL
}},
13596 { &hf_bgp_ls_tlv_srv6_sid_info_sid
,
13597 { "SID", "bgp.ls.tlv.srv6_sid_info.sid", FT_IPv6
,
13598 BASE_NONE
, NULL
, 0x0, NULL
, HFILL
}},
13599 { &hf_bgp_ls_tlv_node_flags_bits
,
13600 { "Node Flags Bits TLV", "bgp.ls.tlv.node_flags_bits", FT_NONE
,
13601 BASE_NONE
, NULL
, 0x0, NULL
, HFILL
}},
13602 { &hf_bgp_ls_tlv_opaque_node_properties
,
13603 { "Opaque Node Properties TLV", "bgp.ls.tlv.opaque_node_properties", FT_NONE
,
13604 BASE_NONE
, NULL
, 0x0, NULL
, HFILL
}},
13605 { &hf_bgp_ls_tlv_opaque_node_properties_value
,
13606 { "Opaque Node Properties", "bgp.ls.tlv.opaque_node_properties_value", FT_NONE
,
13607 BASE_NONE
, NULL
, 0x0, NULL
, HFILL
}},
13608 { &hf_bgp_ls_tlv_node_name
,
13609 { "Node Name TLV", "bgp.ls.tlv.node_name", FT_NONE
,
13610 BASE_NONE
, NULL
, 0x0, NULL
, HFILL
}},
13611 { &hf_bgp_ls_tlv_node_name_value
,
13612 {"Node name", "bgp.ls.tlv.node_name_value", FT_STRING
,
13613 BASE_NONE
, NULL
, 0, NULL
, HFILL
}},
13614 { &hf_bgp_ls_tlv_is_is_area_identifier
,
13615 { "IS-IS Area Identifier TLV", "bgp.ls.tlv.is_is_area_identifier", FT_NONE
,
13616 BASE_NONE
, NULL
, 0x0, NULL
, HFILL
}},
13617 { &hf_bgp_ls_tlv_is_is_area_identifier_value
,
13618 { "IS-IS Area Identifier", "bgp.ls.tlv.is_is_area_identifier_value", FT_BYTES
,
13619 BASE_NONE
, NULL
, 0x0, NULL
, HFILL
}},
13620 /* Link Protection Types */
13621 { &hf_bgp_ls_link_protection_type_enhanced
,
13622 { "Enhanced", "bgp.ls.link_protection_type.enhanced", FT_BOOLEAN
, 8,
13623 TFS(&tfs_capable_not_capable
), 0x20, NULL
, HFILL
}},
13624 { &hf_bgp_ls_link_protection_type_dedicated_1plus1
,
13625 { "Dedicated 1+1", "bgp.ls.link_protection_type.dedicated_1plus1", FT_BOOLEAN
, 8,
13626 TFS(&tfs_capable_not_capable
), 0x10, NULL
, HFILL
}},
13627 { &hf_bgp_ls_link_protection_type_dedicated_1to1
,
13628 { "Dedicated 1:1", "bgp.ls.link_protection_type.dedicated_1colon1", FT_BOOLEAN
, 8,
13629 TFS(&tfs_capable_not_capable
), 0x08, NULL
, HFILL
}},
13630 { &hf_bgp_ls_link_protection_type_shared
,
13631 { "Shared", "bgp.ls.link_protection_type.shared", FT_BOOLEAN
, 8,
13632 TFS(&tfs_capable_not_capable
), 0x04, NULL
, HFILL
}},
13633 { &hf_bgp_ls_link_protection_type_unprotected
,
13634 { "Unprotected", "bgp.ls.link_protection_type.unprotected", FT_BOOLEAN
, 8,
13635 TFS(&tfs_capable_not_capable
), 0x02, NULL
, HFILL
}},
13636 { &hf_bgp_ls_link_protection_type_extra_traffic
,
13637 { "Extra Traffic", "bgp.ls.link_protection_type.extra_traffic", FT_BOOLEAN
, 8,
13638 TFS(&tfs_capable_not_capable
), 0x01, NULL
, HFILL
}},
13639 /* MPLS Protocol Mask flags */
13640 { &hf_bgp_ls_mpls_protocol_mask_flag_l
,
13641 { "Label Distribution Protocol (LDP)", "bgp.ls.protocol_mask_tlv.mpls_protocol.l", FT_BOOLEAN
, 8,
13642 TFS(&tfs_set_notset
), 0x80, NULL
, HFILL
}},
13643 { &hf_bgp_ls_mpls_protocol_mask_flag_r
,
13644 { "Extension to RSVP for LSP Tunnels (RSVP-TE)", "bgp.ls.protocol_mask_tlv.mpls_protocol.r", FT_BOOLEAN
, 8,
13645 TFS(&tfs_set_notset
), 0x40, NULL
, HFILL
}},
13646 /* IGP Flags TLV */
13647 { &hf_bgp_ls_igp_flags_flag_d
,
13648 { "IS-IS Up/Down Bit", "bgp.ls.protocol_mask_tlv.igp_flags_flag_d.d", FT_BOOLEAN
, 8,
13649 TFS(&tfs_set_notset
), 0x80, NULL
, HFILL
}},
13650 /* Node Flag Bits TLV flags */
13651 { &hf_bgp_ls_node_flag_bits_overload
,
13652 { "Overload Bit", "bgp.ls.node_flag_bits.overload", FT_BOOLEAN
, 8,
13653 TFS(&tfs_set_notset
), 0x80, NULL
, HFILL
}},
13654 { &hf_bgp_ls_node_flag_bits_attached
,
13655 { "Attached Bit", "bgp.ls.node_flag_bits.attached", FT_BOOLEAN
, 8,
13656 TFS(&tfs_set_notset
), 0x40, NULL
, HFILL
}},
13657 { &hf_bgp_ls_node_flag_bits_external
,
13658 { "External Bit", "bgp.ls.node_flag_bits.external", FT_BOOLEAN
, 8,
13659 TFS(&tfs_set_notset
), 0x20, NULL
, HFILL
}},
13660 { &hf_bgp_ls_node_flag_bits_abr
,
13661 { "ABR Bit", "bgp.ls.node_flag_bits.abr", FT_BOOLEAN
, 8,
13662 TFS(&tfs_set_notset
), 0x10, NULL
, HFILL
}},
13663 { &hf_bgp_evpn_nlri
,
13664 { "EVPN NLRI", "bgp.evpn.nlri", FT_NONE
,
13665 BASE_NONE
, NULL
, 0x0, NULL
, HFILL
}},
13666 { &hf_bgp_evpn_nlri_rt
,
13667 { "Route Type", "bgp.evpn.nlri.rt", FT_UINT8
, BASE_DEC
,
13668 VALS(evpnrtypevals
), 0x0, NULL
, HFILL
}},
13669 { &hf_bgp_evpn_nlri_len
,
13670 { "Length", "bgp.evpn.nlri.len", FT_UINT8
,
13671 BASE_DEC
, NULL
, 0x0, NULL
, HFILL
}},
13672 { &hf_bgp_evpn_nlri_rd
,
13673 { "Route Distinguisher", "bgp.evpn.nlri.rd", FT_BYTES
,
13674 BASE_NONE
, NULL
, 0x0, NULL
, HFILL
}},
13675 { &hf_bgp_evpn_nlri_esi
,
13676 { "ESI", "bgp.evpn.nlri.esi", FT_BYTES
,
13677 SEP_COLON
, NULL
, 0x0, NULL
, HFILL
}},
13678 { &hf_bgp_evpn_nlri_esi_type
,
13679 { "ESI Type", "bgp.evpn.nlri.esi.type", FT_UINT8
,
13680 BASE_DEC
, VALS(evpn_nlri_esi_type
), 0x0, "EVPN ESI type", HFILL
}},
13681 { &hf_bgp_evpn_nlri_esi_lacp_mac
,
13682 { "CE LACP system MAC", "bgp.evpn.nlri.esi.lacp_mac", FT_ETHER
,
13683 BASE_NONE
, NULL
, 0x0, NULL
, HFILL
}},
13684 { &hf_bgp_evpn_nlri_esi_portk
,
13685 { "LACP port key", "bgp.evpn.nlri.esi.lacp_portkey", FT_UINT16
,
13686 BASE_DEC_HEX
, NULL
, 0x0, NULL
, HFILL
}},
13687 { &hf_bgp_evpn_nlri_esi_remain
,
13688 { "Remaining bytes", "bgp.evpn.nlri.esi.remaining", FT_BYTES
,
13689 BASE_NONE
, NULL
, 0x0, NULL
, HFILL
}},
13690 { &hf_bgp_evpn_nlri_esi_reserved
,
13691 { "Reserved value all 0xff", "bgp.evpn.nlri.esi.reserved", FT_BYTES
,
13692 BASE_NONE
, NULL
, 0x0, NULL
, HFILL
}},
13693 { &hf_bgp_evpn_nlri_esi_value
,
13694 { "ESI Value", "bgp.evpn.nlri.esi.value", FT_BYTES
,
13695 SEP_SPACE
, NULL
, 0x0, NULL
, HFILL
}},
13696 { &hf_bgp_evpn_nlri_esi_value_type0
,
13697 { "ESI 9 bytes value", "bgp.evpn.nlri.esi.type0", FT_BYTES
,
13698 SEP_SPACE
, NULL
, 0x0, NULL
, HFILL
}},
13699 { &hf_bgp_evpn_nlri_esi_rb_mac
,
13700 { "ESI root bridge MAC", "bgp.evpn.nlri.esi.root_bridge", FT_ETHER
,
13701 BASE_NONE
, NULL
, 0x0, NULL
, HFILL
}},
13702 { &hf_bgp_evpn_nlri_esi_rbprio
,
13703 { "ESI root bridge priority", "bgp.evpn.nlri.esi.rb_prio", FT_UINT16
,
13704 BASE_DEC_HEX
, NULL
, 0x0, NULL
, HFILL
}},
13705 { &hf_bgp_evpn_nlri_esi_sys_mac
,
13706 { "ESI system MAC", "bgp.evpn.nlri.esi.system_mac", FT_ETHER
,
13707 BASE_NONE
, NULL
, 0x0, NULL
, HFILL
}},
13708 { &hf_bgp_evpn_nlri_esi_mac_discr
,
13709 { "ESI system mac discriminator", "bgp.evpn.nlri.esi.system_mac_discr", FT_BYTES
,
13710 SEP_SPACE
, NULL
, 0x0, NULL
, HFILL
}},
13711 { &hf_bgp_evpn_nlri_esi_router_id
,
13712 { "ESI router ID", "bgp.evpn.nlri.esi.router_id", FT_IPv4
,
13713 BASE_NONE
, NULL
, 0x0, NULL
, HFILL
}},
13714 { &hf_bgp_evpn_nlri_esi_router_discr
,
13715 { "ESI router discriminator", "bgp.evpn.nlri.esi.router_discr", FT_BYTES
,
13716 SEP_SPACE
, NULL
, 0x0, NULL
, HFILL
}},
13717 { &hf_bgp_evpn_nlri_esi_asn
,
13718 { "ESI ASN", "bgp.evpn.nlri.esi.asn", FT_UINT32
,
13719 BASE_DEC
, NULL
, 0x0, NULL
, HFILL
}},
13720 { &hf_bgp_evpn_nlri_esi_asn_discr
,
13721 { "ESI ASN discriminator", "bgp.evpn.nlri.esi.asn_discr", FT_BYTES
,
13722 SEP_SPACE
, NULL
, 0x0, NULL
, HFILL
}},
13723 { &hf_bgp_evpn_nlri_etag
,
13724 { "Ethernet Tag ID", "bgp.evpn.nlri.etag", FT_UINT32
,
13725 BASE_DEC
, NULL
, 0x0, NULL
, HFILL
}},
13726 { &hf_bgp_evpn_nlri_mpls_ls1
,
13727 { "MPLS Label 1", "bgp.evpn.nlri.mpls_ls1", FT_UINT24
,
13728 BASE_DEC
, NULL
, BGP_MPLS_LABEL
, NULL
, HFILL
}},
13729 { &hf_bgp_evpn_nlri_mpls_ls2
,
13730 { "MPLS Label 2", "bgp.evpn.nlri.mpls_ls2", FT_UINT24
,
13731 BASE_DEC
, NULL
, BGP_MPLS_LABEL
, NULL
, HFILL
}},
13732 { &hf_bgp_evpn_nlri_vni
,
13733 { "VNI", "bgp.evpn.nlri.vni", FT_UINT24
,
13734 BASE_DEC
, NULL
, 0x0, NULL
, HFILL
}},
13735 { &hf_bgp_evpn_nlri_maclen
,
13736 { "MAC Address Length", "bgp.evpn.nlri.maclen", FT_UINT8
,
13737 BASE_DEC
, NULL
, 0x0, NULL
, HFILL
}},
13738 { &hf_bgp_evpn_nlri_mac_addr
,
13739 { "MAC Address", "bgp.evpn.nlri.mac_addr", FT_ETHER
,
13740 BASE_NONE
, NULL
, 0x0, NULL
, HFILL
}},
13741 { &hf_bgp_evpn_nlri_iplen
,
13742 { "IP Address Length", "bgp.evpn.nlri.iplen", FT_UINT8
,
13743 BASE_DEC
, NULL
, 0x0, NULL
, HFILL
}},
13744 { &hf_bgp_evpn_nlri_prefix_len
,
13745 { "IP prefix length", "bgp.evpn.nlri.prefix_len", FT_UINT8
,
13746 BASE_DEC
, NULL
, 0x0, NULL
, HFILL
}},
13747 { &hf_bgp_evpn_nlri_ip_addr
,
13748 { "IPv4 address", "bgp.evpn.nlri.ip.addr", FT_IPv4
,
13749 BASE_NONE
, NULL
, 0x0, NULL
, HFILL
}},
13750 { &hf_bgp_evpn_nlri_ipv6_addr
,
13751 { "IPv6 address", "bgp.evpn.nlri.ipv6.addr", FT_IPv6
,
13752 BASE_NONE
, NULL
, 0x0, NULL
, HFILL
}},
13753 { &hf_bgp_evpn_nlri_ipv4_gtw
,
13754 { "IPv4 Gateway address", "bgp.evpn.nlri.ipv4.gtw_addr", FT_IPv4
,
13755 BASE_NONE
, NULL
, 0x0, NULL
, HFILL
}},
13756 { &hf_bgp_evpn_nlri_ipv6_gtw
,
13757 { "IPv6 Gateway address", "bgp.evpn.nlri.ipv6.gtw_addr", FT_IPv6
,
13758 BASE_NONE
, NULL
, 0x0, NULL
, HFILL
}},
13759 /* segment routing extensions to link state */
13760 /* Node Attributes TLVs */
13761 { &hf_bgp_ls_sr_tlv_capabilities
,
13762 { "SR Capabilities", "bgp.ls.sr.tlv.capabilities", FT_NONE
,
13763 BASE_NONE
, NULL
, 0x0, NULL
, HFILL
}},
13764 { &hf_bgp_ls_sr_tlv_capabilities_flags
,
13765 { "Flags", "bgp.ls.sr.tlv.capabilities.flags", FT_UINT8
,
13766 BASE_HEX
, NULL
, 0x0, NULL
, HFILL
}},
13767 { &hf_bgp_ls_sr_tlv_capabilities_flags_i
,
13768 { "MPLS IPv4 flag (I)", "bgp.ls.sr.tlv.capabilities.flags.i", FT_BOOLEAN
,
13769 8, TFS(&tfs_set_notset
), BGP_LS_SR_CAPABILITY_FLAG_I
, NULL
, HFILL
}},
13770 { &hf_bgp_ls_sr_tlv_capabilities_flags_v
,
13771 { "MPLS IPv6 flag (V)", "bgp.ls.sr.tlv.capabilities.flags.v", FT_BOOLEAN
,
13772 8, TFS(&tfs_set_notset
), BGP_LS_SR_CAPABILITY_FLAG_V
, NULL
, HFILL
}},
13773 { &hf_bgp_ls_sr_tlv_capabilities_flags_h
,
13774 { "SR-IPv6 flag (H)", "bgp.ls.sr.tlv.capabilities.flags.h", FT_BOOLEAN
,
13775 8, TFS(&tfs_set_notset
), BGP_LS_SR_CAPABILITY_FLAG_H
, NULL
, HFILL
}},
13776 { &hf_bgp_ls_sr_tlv_capabilities_flags_reserved
,
13777 { "Reserved", "bgp.ls.sr.tlv.capabilities.flags.reserved", FT_UINT8
,
13778 BASE_HEX
, NULL
, 0x1F, NULL
, HFILL
}},
13779 { &hf_bgp_ls_sr_tlv_capabilities_range_size
,
13780 { "Range Size", "bgp.ls.sr.tlv.capabilities.range_size", FT_UINT24
,
13781 BASE_DEC
, NULL
, 0x0, NULL
, HFILL
}},
13782 { &hf_bgp_ls_sr_tlv_capabilities_sid_label
,
13783 { "From Label", "bgp.ls.sr.tlv.capabilities.sid.label", FT_UINT24
,
13784 BASE_DEC
, NULL
, 0x0FFFFF, NULL
, HFILL
}},
13785 { &hf_bgp_ls_sr_tlv_capabilities_sid_index
,
13786 { "From Index", "bgp.ls.sr.tlv.capabilities.sid.index", FT_UINT32
,
13787 BASE_DEC
, NULL
, 0x0, NULL
, HFILL
}},
13788 { &hf_bgp_ls_sr_tlv_algorithm
,
13789 { "SR Algorithm TLV", "bgp.ls.sr.tlv.algorithm", FT_NONE
,
13790 BASE_NONE
, NULL
, 0x0, NULL
, HFILL
}},
13791 { &hf_bgp_ls_sr_tlv_algorithm_value
,
13792 { "SR Algorithm", "bgp.ls.sr.tlv.algorithm.value", FT_UINT8
,
13793 BASE_DEC
, NULL
, 0x0, NULL
, HFILL
}},
13794 { &hf_bgp_ls_sr_tlv_local_block
,
13795 { "SR Local Block", "bgp.ls.sr.tlv.local_block", FT_NONE
,
13796 BASE_NONE
, NULL
, 0x0, NULL
, HFILL
}},
13797 { &hf_bgp_ls_sr_tlv_srv6_cap
,
13798 { "SRv6 Capabilities TLV", "bgp.ls.sr.tlv.srv6_capabilities", FT_NONE
,
13799 BASE_NONE
, NULL
, 0x0, NULL
, HFILL
}},
13800 { &hf_bgp_ls_sr_tlv_srv6_cap_flags
,
13801 { "Flags", "bgp.ls.sr.tlv.srv6_capabilities.flags", FT_UINT16
,
13802 BASE_HEX
, NULL
, 0x0, NULL
, HFILL
}},
13803 { &hf_bgp_ls_sr_tlv_srv6_cap_flags_o
,
13804 { "OAM flag (O)", "bgp.ls.sr.tlv.srv6_capabilities.flags.o", FT_BOOLEAN
,
13805 16, TFS(&tfs_set_notset
), BGP_LS_SRV6_CAP_FLAG_O
, NULL
, HFILL
}},
13806 { &hf_bgp_ls_sr_tlv_srv6_cap_flags_reserved
,
13807 { "Reserved", "bgp.ls.sr.tlv.srv6_capabilities.flags.reserved", FT_UINT16
,
13808 BASE_HEX
, NULL
, 0x3fff, NULL
, HFILL
}},
13809 { &hf_bgp_ls_sr_tlv_srv6_cap_reserved
,
13810 { "Reserved", "bgp.ls.sr.tlv.srv6_capabilities.reserved", FT_UINT16
,
13811 BASE_HEX
, NULL
, 0x0, NULL
, HFILL
}},
13812 { &hf_bgp_ls_sr_tlv_local_block_flags
,
13813 { "Flags", "bgp.ls.sr.tlv.local_block.flags", FT_UINT8
,
13814 BASE_HEX
, NULL
, 0x0, NULL
, HFILL
}},
13815 { &hf_bgp_ls_sr_tlv_local_block_range_size
,
13816 { "Range Size", "bgp.ls.sr.tlv.local_block.range_size", FT_UINT24
,
13817 BASE_DEC
, NULL
, 0x0, NULL
, HFILL
}},
13818 { &hf_bgp_ls_sr_tlv_local_block_sid_label
,
13819 { "From Label", "bgp.ls.sr.tlv.local_block.sid.label", FT_UINT24
,
13820 BASE_DEC
, NULL
, 0x0FFFFF, NULL
, HFILL
}},
13821 { &hf_bgp_ls_sr_tlv_local_block_sid_index
,
13822 { "From Index", "bgp.ls.sr.tlv.local_block.sid.index", FT_UINT32
,
13823 BASE_DEC
, NULL
, 0x0, NULL
, HFILL
}},
13824 { &hf_bgp_ls_sr_tlv_flex_algo_def
,
13825 { "Flexible Algorithm Definition TLV", "bgp.ls.sr.tlv.flex_algo", FT_NONE
,
13826 BASE_NONE
, NULL
, 0x0, NULL
, HFILL
}},
13827 { &hf_bgp_ls_sr_tlv_flex_algo_algorithm
,
13828 { "Flex-Algorithm", "bgp.ls.sr.tlv.flex_algo.flex_algorithm", FT_UINT8
,
13829 BASE_DEC
, NULL
, 0x0, NULL
, HFILL
}},
13830 { &hf_bgp_ls_sr_tlv_flex_algo_metric_type
,
13831 { "Metric-Type", "bgp.ls.sr.tlv.flex_algo.metric_type", FT_UINT8
,
13832 BASE_DEC
, VALS(flex_algo_metric_types
), 0x0, NULL
, HFILL
}},
13833 { &hf_bgp_ls_sr_tlv_flex_algo_calc_type
,
13834 { "Calculation-Type", "bgp.ls.sr.tlv.flex_algo.calculation_type", FT_UINT8
,
13835 BASE_DEC
, VALS(igp_algo_types
), 0x0, NULL
, HFILL
}},
13836 { &hf_bgp_ls_sr_tlv_flex_algo_priority
,
13837 { "Priority", "bgp.ls.sr.tlv.flex_algo.priority", FT_UINT8
,
13838 BASE_DEC
, NULL
, 0x0, NULL
, HFILL
}},
13839 { &hf_bgp_ls_sr_tlv_flex_algo_exc_any_affinity
,
13840 { "Flex Algo Exclude Any Affinity TLV", "bgp.ls.sr.tlv.flex_algo.exclude_any_affinity", FT_NONE
,
13841 BASE_NONE
, NULL
, 0x0, NULL
, HFILL
}},
13842 { &hf_bgp_ls_sr_tlv_flex_algo_inc_any_affinity
,
13843 { "Flex Algo Include Any Affinity TLV", "bgp.ls.sr.tlv.flex_algo.include_any_affinity", FT_NONE
,
13844 BASE_NONE
, NULL
, 0x0, NULL
, HFILL
}},
13845 { &hf_bgp_ls_sr_tlv_flex_algo_inc_all_affinity
,
13846 { "Flex Algo Include All Affinity TLV", "bgp.ls.sr.tlv.flex_algo.include_all_affinity", FT_NONE
,
13847 BASE_NONE
, NULL
, 0x0, NULL
, HFILL
}},
13848 /* Prefix Attribute TLVs */
13849 { &hf_bgp_ls_sr_tlv_prefix_sid
,
13850 { "Prefix SID TLV", "bgp.ls.sr.tlv.prefix.sid", FT_NONE
,
13851 BASE_NONE
, NULL
, 0x0, NULL
, HFILL
}},
13852 { &hf_bgp_ls_sr_tlv_prefix_sid_flags
,
13853 { "Flags", "bgp.ls.sr.tlv.prefix.sid.flags", FT_UINT8
,
13854 BASE_HEX
, NULL
, 0x0, NULL
, HFILL
}},
13855 { &hf_bgp_ls_sr_tlv_prefix_sid_flags_r
,
13856 { "Re-advertisement (R)", "bgp.ls.sr.tlv.prefix.sid.flags.r", FT_BOOLEAN
,
13857 8, TFS(&tfs_set_notset
), BGP_LS_SR_PREFIX_SID_FLAG_R
, NULL
, HFILL
}},
13858 { &hf_bgp_ls_sr_tlv_prefix_sid_flags_n
,
13859 { "Node-SID (N)", "bgp.ls.sr.tlv.prefix.sid.flags.n", FT_BOOLEAN
,
13860 8, TFS(&tfs_set_notset
), BGP_LS_SR_PREFIX_SID_FLAG_N
, NULL
, HFILL
}},
13861 { &hf_bgp_ls_sr_tlv_prefix_sid_flags_np
,
13862 { "No-PHP (NP)", "bgp.ls.sr.tlv.prefix.sid.flags.np", FT_BOOLEAN
,
13863 8, TFS(&tfs_set_notset
), BGP_LS_SR_PREFIX_SID_FLAG_NP
, NULL
, HFILL
}},
13864 { &hf_bgp_ls_sr_tlv_prefix_sid_flags_p
,
13865 { "No-PHP (P)", "bgp.ls.sr.tlv.prefix.sid.flags.p", FT_BOOLEAN
,
13866 8, TFS(&tfs_set_notset
), BGP_LS_SR_PREFIX_SID_FLAG_P
, NULL
, HFILL
}},
13867 { &hf_bgp_ls_sr_tlv_prefix_sid_flags_m
,
13868 { "Mapping Server Flag (M)", "bgp.ls.sr.tlv.prefix.sid.flags.m", FT_BOOLEAN
,
13869 8, TFS(&tfs_set_notset
), BGP_LS_SR_PREFIX_SID_FLAG_M
, NULL
, HFILL
}},
13870 { &hf_bgp_ls_sr_tlv_prefix_sid_flags_e
,
13871 { "Explicit-Null (E)", "bgp.ls.sr.tlv.prefix.sid.flags.e", FT_BOOLEAN
,
13872 8, TFS(&tfs_set_notset
), BGP_LS_SR_PREFIX_SID_FLAG_E
, NULL
, HFILL
}},
13873 { &hf_bgp_ls_sr_tlv_prefix_sid_flags_v
,
13874 { "Value (V)", "bgp.ls.sr.tlv.prefix.sid.flags.v", FT_BOOLEAN
,
13875 8, TFS(&tfs_set_notset
), BGP_LS_SR_PREFIX_SID_FLAG_V
, NULL
, HFILL
}},
13876 { &hf_bgp_ls_sr_tlv_prefix_sid_flags_l
,
13877 { "Local (L)", "bgp.ls.sr.tlv.prefix.sid.flags.l", FT_BOOLEAN
,
13878 8, TFS(&tfs_set_notset
), BGP_LS_SR_PREFIX_SID_FLAG_L
, NULL
, HFILL
}},
13879 { &hf_bgp_ls_sr_tlv_prefix_sid_algo
,
13880 { "Algorithm", "bgp.ls.sr.tlv.prefix.sid.algo", FT_UINT8
,
13881 BASE_DEC
, NULL
, 0x0, NULL
, HFILL
}},
13882 { &hf_bgp_ls_sr_tlv_prefix_sid_label
,
13883 { "SID/Label", "bgp.ls.sr.tlv.prefix.sid.label", FT_UINT24
,
13884 BASE_DEC
, NULL
, 0x0FFFFF, NULL
, HFILL
}},
13885 { &hf_bgp_ls_sr_tlv_prefix_sid_index
,
13886 { "SID/Index", "bgp.ls.sr.tlv.prefix.sid.index", FT_UINT32
,
13887 BASE_DEC
, NULL
, 0x0, NULL
, HFILL
}},
13888 { &hf_bgp_ls_sr_tlv_srv6_locator
,
13889 { "SRv6 Locator TLV", "bgp.ls.sr.tlv.srv6_locator", FT_NONE
,
13890 BASE_NONE
, NULL
, 0x0, NULL
, HFILL
}},
13891 { &hf_bgp_ls_sr_tlv_srv6_locator_flags
,
13892 { "Flags", "bgp.ls.sr.tlv.srv6_locator.flags", FT_UINT8
,
13893 BASE_HEX
, NULL
, 0x0, NULL
, HFILL
}},
13894 { &hf_bgp_ls_sr_tlv_srv6_locator_flags_d
,
13895 { "Down flag (D)", "bgp.ls.sr.tlv.srv6_locator.flags.d", FT_BOOLEAN
,
13896 8, TFS(&tfs_set_notset
), BGP_LS_SRV6_LOC_FLAG_D
, NULL
, HFILL
}},
13897 { &hf_bgp_ls_sr_tlv_srv6_locator_flags_reserved
,
13898 { "Reserved", "bgp.ls.sr.tlv.srv6_locator.flags.reserved", FT_UINT8
,
13899 BASE_HEX
, NULL
, BGP_LS_SRV6_LOC_FLAG_RESERVED
, NULL
, HFILL
}},
13900 { &hf_bgp_ls_sr_tlv_srv6_locator_algo
,
13901 { "Algorithm", "bgp.ls.sr.tlv.srv6_locator.algorithm",
13902 FT_UINT8
, BASE_DEC
, VALS(igp_algo_types
), 0x0, NULL
, HFILL
}},
13903 { &hf_bgp_ls_sr_tlv_srv6_locator_reserved
,
13904 { "Reserved", "bgp.ls.sr.tlv.srv6_locator.reserved", FT_UINT16
,
13905 BASE_HEX
, NULL
, 0, NULL
, HFILL
}},
13906 { &hf_bgp_ls_sr_tlv_srv6_locator_metric
,
13907 { "Metric", "bgp.ls.sr.tlv.srv6_locator.metric", FT_UINT32
,
13908 BASE_DEC
, NULL
, 0x0, NULL
, HFILL
}},
13909 { &hf_bgp_ls_sr_tlv_prefix_attr_flags
,
13910 { "Prefix Attribute Flags TLV", "bgp.ls.sr.tlv.prefix.attribute_flags", FT_NONE
,
13911 BASE_NONE
, NULL
, 0x0, NULL
, HFILL
}},
13912 { &hf_bgp_ls_sr_tlv_prefix_attr_flags_flags
,
13913 { "Flags", "bgp.ls.sr.tlv.prefix.attribute_flags.flags", FT_UINT8
,
13914 BASE_HEX
, NULL
, 0x0, NULL
, HFILL
}},
13915 { &hf_bgp_ls_sr_tlv_prefix_attr_flags_flags_unknown
,
13916 { "Flags", "bgp.ls.sr.tlv_prefix.attribute_flags.flags.unknown", FT_BYTES
,
13917 SEP_SPACE
, NULL
, 0x0,NULL
, HFILL
}},
13918 { &hf_bgp_ls_sr_tlv_prefix_attr_flags_flags_ao
,
13919 { "Attach (A)", "bgp.ls.sr.tlv.prefix.attribute_flags.flags.a", FT_BOOLEAN
,
13920 8, TFS(&tfs_set_notset
), BGP_LS_SR_PREFIX_ATTR_FLAGS_FLAG_AO
, NULL
, HFILL
}},
13921 { &hf_bgp_ls_sr_tlv_prefix_attr_flags_flags_no
,
13922 { "Node (N)", "bgp.ls.sr.tlv.prefix.attribute_flags.flags.n", FT_BOOLEAN
,
13923 8, TFS(&tfs_set_notset
), BGP_LS_SR_PREFIX_ATTR_FLAGS_FLAG_NO
, NULL
, HFILL
}},
13924 { &hf_bgp_ls_sr_tlv_prefix_attr_flags_flags_eo
,
13925 { "ELC (E)", "bgp.ls.sr.tlv.prefix.attribute_flags.flags.e", FT_BOOLEAN
,
13926 8, TFS(&tfs_set_notset
), BGP_LS_SR_PREFIX_ATTR_FLAGS_FLAG_EO
, NULL
, HFILL
}},
13927 { &hf_bgp_ls_sr_tlv_prefix_attr_flags_flags_xi
,
13928 { "External Prefix (X)", "bgp.ls.sr.tlv.prefix.attribute_flags.flags.x", FT_BOOLEAN
,
13929 8, TFS(&tfs_set_notset
), BGP_LS_SR_PREFIX_ATTR_FLAGS_FLAG_XI
, NULL
, HFILL
}},
13930 { &hf_bgp_ls_sr_tlv_prefix_attr_flags_flags_ri
,
13931 { "Re-advertisement (X)", "bgp.ls.sr.tlv.prefix.attribute_flags.flags.r", FT_BOOLEAN
,
13932 8, TFS(&tfs_set_notset
), BGP_LS_SR_PREFIX_ATTR_FLAGS_FLAG_RI
, NULL
, HFILL
}},
13933 { &hf_bgp_ls_sr_tlv_prefix_attr_flags_flags_ni
,
13934 { "Node (N)", "bgp.ls.sr.tlv.prefix.attribute_flags.flags.n", FT_BOOLEAN
,
13935 8, TFS(&tfs_set_notset
), BGP_LS_SR_PREFIX_ATTR_FLAGS_FLAG_NI
, NULL
, HFILL
}},
13936 { &hf_bgp_ls_sr_tlv_prefix_attr_flags_flags_ei
,
13937 { "ELC (E)", "bgp.ls.sr.tlv.prefix.attribute_flags.flags.e", FT_BOOLEAN
,
13938 8, TFS(&tfs_set_notset
), BGP_LS_SR_PREFIX_ATTR_FLAGS_FLAG_EI
, NULL
, HFILL
}},
13939 { &hf_bgp_ls_sr_tlv_source_router_id
,
13940 { "Source Router-ID TLV", "bgp.ls.sr.tlv.source_router_id", FT_NONE
,
13941 BASE_NONE
, NULL
, 0x0, NULL
, HFILL
}},
13942 /* SID Attribute TLVs */
13943 { &hf_bgp_ls_sr_tlv_srv6_endpoint_behavior
,
13944 { "SRv6 Endpoint Behavior TLV", "bgp.ls.sr.tlv.srv6_endpoint_behavior", FT_NONE
,
13945 BASE_NONE
, NULL
, 0x0, NULL
, HFILL
}},
13946 { &hf_bgp_ls_sr_tlv_srv6_endpoint_behavior_endpoint_behavior
,
13947 { "Endpoint Behavior", "bgp.ls.sr.tlv.srv6_endpoint_behavior.endpoint_behavior", FT_UINT16
,
13948 BASE_HEX
, VALS(srv6_endpoint_behavior
), 0x0, NULL
, HFILL
}},
13949 { &hf_bgp_ls_sr_tlv_srv6_endpoint_behavior_flags
,
13950 { "Flags", "bgp.ls.sr.tlv.srv6_endpoint_behavior.flags", FT_UINT8
,
13951 BASE_HEX
, NULL
, 0x0, NULL
, HFILL
}},
13952 { &hf_bgp_ls_sr_tlv_srv6_endpoint_behavior_algo
,
13953 { "Algorithm", "bgp.ls.sr.tlv.srv6_endpoint_behavior.algorithm",
13954 FT_UINT8
, BASE_DEC
, VALS(igp_algo_types
), 0x0, NULL
, HFILL
}},
13955 /* Adjacency Attribute TLVs */
13956 { &hf_bgp_ls_sr_tlv_adjacency_sid
,
13957 { "Adjacency SID TLV", "bgp.ls.sr.tlv.adjacency.sid", FT_NONE
,
13958 BASE_NONE
, NULL
, 0x0, NULL
, HFILL
}},
13959 { &hf_bgp_ls_sr_tlv_adjacency_sid_flags
,
13960 { "Flags", "bgp.ls.sr.tlv.adjacency.sid.flags", FT_UINT8
,
13961 BASE_HEX
, NULL
, 0x0, NULL
, HFILL
}},
13962 { &hf_bgp_ls_sr_tlv_adjacency_sid_flags_fi
,
13963 { "Address-Family flag (F)", "bgp.ls.sr.tlv.adjacency.sid.flags.f", FT_BOOLEAN
,
13964 8, TFS(&tfs_set_notset
), BGP_LS_SR_ADJACENCY_SID_FLAG_FI
, NULL
, HFILL
}},
13965 { &hf_bgp_ls_sr_tlv_adjacency_sid_flags_bo
,
13966 { "Backup Flag (B)", "bgp.ls.sr.tlv.adjacency.sid.flags.b", FT_BOOLEAN
,
13967 8, TFS(&tfs_set_notset
), BGP_LS_SR_ADJACENCY_SID_FLAG_BO
, NULL
, HFILL
}},
13968 { &hf_bgp_ls_sr_tlv_adjacency_sid_flags_bi
,
13969 { "Backup Flag (B)", "bgp.ls.sr.tlv.adjacency.sid.flags.b", FT_BOOLEAN
,
13970 8, TFS(&tfs_set_notset
), BGP_LS_SR_ADJACENCY_SID_FLAG_BI
, NULL
, HFILL
}},
13971 { &hf_bgp_ls_sr_tlv_adjacency_sid_flags_vo
,
13972 { "Value Flag (V)", "bgp.ls.sr.tlv.adjacency.sid.flags.v", FT_BOOLEAN
,
13973 8, TFS(&tfs_set_notset
), BGP_LS_SR_ADJACENCY_SID_FLAG_VO
, NULL
, HFILL
}},
13974 { &hf_bgp_ls_sr_tlv_adjacency_sid_flags_vi
,
13975 { "Value Flag (V)", "bgp.ls.sr.tlv.adjacency.sid.flags.v", FT_BOOLEAN
,
13976 8, TFS(&tfs_set_notset
), BGP_LS_SR_ADJACENCY_SID_FLAG_VI
, NULL
, HFILL
}},
13977 { &hf_bgp_ls_sr_tlv_adjacency_sid_flags_lo
,
13978 { "Local Flag (L)", "bgp.ls.sr.tlv.adjacency.sid.flags.l", FT_BOOLEAN
,
13979 8, TFS(&tfs_set_notset
), BGP_LS_SR_ADJACENCY_SID_FLAG_LO
, NULL
, HFILL
}},
13980 { &hf_bgp_ls_sr_tlv_adjacency_sid_flags_li
,
13981 { "Local Flag (L)", "bgp.ls.sr.tlv.adjacency.sid.flags.l", FT_BOOLEAN
,
13982 8, TFS(&tfs_set_notset
), BGP_LS_SR_ADJACENCY_SID_FLAG_LI
, NULL
, HFILL
}},
13983 { &hf_bgp_ls_sr_tlv_adjacency_sid_flags_go
,
13984 { "Group Flag (S)", "bgp.ls.sr.tlv.adjacency.sid.flags.g", FT_BOOLEAN
,
13985 8, TFS(&tfs_set_notset
), BGP_LS_SR_ADJACENCY_SID_FLAG_GO
, NULL
, HFILL
}},
13986 { &hf_bgp_ls_sr_tlv_adjacency_sid_flags_si
,
13987 { "Set Flag (S)", "bgp.ls.sr.tlv.adjacency.sid.flags.s", FT_BOOLEAN
,
13988 8, TFS(&tfs_set_notset
), BGP_LS_SR_ADJACENCY_SID_FLAG_SI
, NULL
, HFILL
}},
13989 { &hf_bgp_ls_sr_tlv_adjacency_sid_flags_po
,
13990 { "Persistent Flag (P)", "bgp.ls.sr.tlv.adjacency.sid.flags.p", FT_BOOLEAN
,
13991 8, TFS(&tfs_set_notset
), BGP_LS_SR_ADJACENCY_SID_FLAG_PO
, NULL
, HFILL
}},
13992 { &hf_bgp_ls_sr_tlv_adjacency_sid_flags_pi
,
13993 { "Persistent Flag (P)", "bgp.ls.sr.tlv.adjacency.sid.flags.p", FT_BOOLEAN
,
13994 8, TFS(&tfs_set_notset
), BGP_LS_SR_ADJACENCY_SID_FLAG_PI
, NULL
, HFILL
}},
13995 { &hf_bgp_ls_sr_tlv_adjacency_sid_weight
,
13996 { "Weight", "bgp.ls.sr.tlv.adjacency.sid.weight", FT_UINT8
,
13997 BASE_DEC
, NULL
, 0x0, NULL
, HFILL
}},
13998 { &hf_bgp_ls_sr_tlv_adjacency_sid_label
,
13999 { "SID/Label", "bgp.ls.sr.tlv.adjacency.sid.label", FT_UINT24
,
14000 BASE_DEC
, NULL
, 0x0FFFFF, NULL
, HFILL
}},
14001 { &hf_bgp_ls_sr_tlv_adjacency_sid_index
,
14002 { "SID/Index", "bgp.ls.sr.tlv.adjacency.sid.index", FT_UINT32
,
14003 BASE_DEC
, NULL
, 0x0, NULL
, HFILL
}},
14004 { &hf_bgp_ls_sr_tlv_peer_node_sid
,
14005 { "PeerNode SID TLV", "bgp.ls.sr.tlv.peer_node.sid", FT_NONE
,
14006 BASE_NONE
, NULL
, 0x0, NULL
, HFILL
}},
14007 { &hf_bgp_ls_sr_tlv_peer_adj_sid
,
14008 { "PeerAdj SID TLV", "bgp.ls.sr.tlv.peer_adj.sid", FT_NONE
,
14009 BASE_NONE
, NULL
, 0x0, NULL
, HFILL
}},
14010 { &hf_bgp_ls_sr_tlv_peer_set_sid
,
14011 { "PeerSet SID TLV", "bgp.ls.sr.tlv.peer_set.sid", FT_NONE
,
14012 BASE_NONE
, NULL
, 0x0, NULL
, HFILL
}},
14013 { &hf_bgp_ls_sr_tlv_peer_sid_flags
,
14014 { "Flags", "bgp.ls.sr.tlv.peer.sid.flags", FT_UINT8
,
14015 BASE_HEX
, NULL
, 0x0, NULL
, HFILL
}},
14016 { &hf_bgp_ls_sr_tlv_peer_sid_flags_v
,
14017 { "Value flag (V)", "bgp.ls.sr.tlv.peer.sid.flags.v", FT_BOOLEAN
,
14018 8, TFS(&tfs_set_notset
), BGP_LS_SR_PEER_SID_FLAG_V
, NULL
, HFILL
}},
14019 { &hf_bgp_ls_sr_tlv_peer_sid_flags_l
,
14020 { "Local flag (L)", "bgp.ls.sr.tlv.peer.sid.flags.l", FT_BOOLEAN
,
14021 8, TFS(&tfs_set_notset
), BGP_LS_SR_PEER_SID_FLAG_L
, NULL
, HFILL
}},
14022 { &hf_bgp_ls_sr_tlv_peer_sid_flags_b
,
14023 { "Backup flag (B)", "bgp.ls.sr.tlv.peer.sid.flags.b", FT_BOOLEAN
,
14024 8, TFS(&tfs_set_notset
), BGP_LS_SR_PEER_SID_FLAG_B
, NULL
, HFILL
}},
14025 { &hf_bgp_ls_sr_tlv_peer_sid_flags_p
,
14026 { "Persistent flag (P)", "bgp.ls.sr.tlv.peer.sid.flags.p", FT_BOOLEAN
,
14027 8, TFS(&tfs_set_notset
), BGP_LS_SR_PEER_SID_FLAG_P
, NULL
, HFILL
}},
14028 { &hf_bgp_ls_sr_tlv_peer_sid_weight
,
14029 { "Weight", "bgp.ls.sr.tlv.peer.sid.weight", FT_UINT8
,
14030 BASE_DEC
, NULL
, 0x0, NULL
, HFILL
}},
14031 { &hf_bgp_ls_sr_tlv_peer_sid_label
,
14032 { "SID/Label", "bgp.ls.sr.tlv.peer.sid.label", FT_UINT24
,
14033 BASE_DEC
, NULL
, 0x0FFFFF, NULL
, HFILL
}},
14034 { &hf_bgp_ls_sr_tlv_peer_sid_index
,
14035 { "SID/Index", "bgp.ls.sr.tlv.peer.sid.index", FT_UINT32
,
14036 BASE_DEC
, NULL
, 0x0, NULL
, HFILL
}},
14037 { &hf_bgp_ls_sr_tlv_srv6_endx_sid
,
14038 { "SRv6 End.X SID TLV", "bgp.ls.sr.tlv.srv6_endx_sid", FT_NONE
,
14039 BASE_NONE
, NULL
, 0x0, NULL
, HFILL
}},
14040 { &hf_bgp_ls_sr_tlv_srv6_lan_endx_sid
,
14041 { "SRv6 LAN End.X SID TLV", "bgp.ls.sr.tlv.srv6_lan_endx_sid", FT_NONE
,
14042 BASE_NONE
, NULL
, 0x0, NULL
, HFILL
}},
14043 { &hf_bgp_ls_sr_tlv_srv6_endx_sid_endpoint_behavior
,
14044 { "Endpoint Behavior", "bgp.ls.sr.tlv.srv6_endx_sid.endpoint_behavior",
14045 FT_UINT16
, BASE_DEC
, VALS(srv6_endpoint_behavior
), 0x0, NULL
, HFILL
}},
14046 { &hf_bgp_ls_sr_tlv_srv6_endx_sid_flags
,
14047 { "Flags", "bgp.ls.sr.tlv.srv6_endx_sid.flags", FT_UINT8
,
14048 BASE_HEX
, NULL
, 0x0, NULL
, HFILL
}},
14049 { &hf_bgp_ls_sr_tlv_srv6_endx_sid_flags_b
,
14050 { "Backup flag", "bgp.ls.sr.tlv.srv6_endx_sid.flags.b",
14051 FT_BOOLEAN
, 8, TFS(&tfs_set_notset
), BGP_LS_SRV6_ENDX_SID_FLAG_B
, NULL
, HFILL
}},
14052 { &hf_bgp_ls_sr_tlv_srv6_endx_sid_flags_s
,
14053 { "Set flag", "bgp.ls.sr.tlv.srv6_endx_sid.flags.s",
14054 FT_BOOLEAN
, 8, TFS(&tfs_set_notset
), BGP_LS_SRV6_ENDX_SID_FLAG_S
, NULL
, HFILL
}},
14055 { &hf_bgp_ls_sr_tlv_srv6_endx_sid_flags_p
,
14056 { "Persistent flag", "bgp.ls.sr.tlv.srv6_endx_sid.flags.p",
14057 FT_BOOLEAN
, 8, TFS(&tfs_set_notset
), BGP_LS_SRV6_ENDX_SID_FLAG_P
, NULL
, HFILL
}},
14058 { &hf_bgp_ls_sr_tlv_srv6_endx_sid_flags_reserved
,
14059 { "Reserved", "bgp.ls.sr.tlv.srv6_endx_sid.flags.reserved",
14060 FT_UINT8
, BASE_HEX
, NULL
, BGP_LS_SRV6_ENDX_SID_FLAG_RESERVED
, NULL
, HFILL
}},
14061 { &hf_bgp_ls_sr_tlv_srv6_endx_sid_algo
,
14062 { "Algorithm", "bgp.ls.sr.tlv.srv6_endx_sid.algorithm",
14063 FT_UINT8
, BASE_DEC
, VALS(igp_algo_types
), 0x0, NULL
, HFILL
}},
14064 { &hf_bgp_ls_sr_tlv_srv6_endx_sid_weight
,
14065 { "Weight", "bgp.ls.sr.tlv.srv6_endx_sid.weight",
14066 FT_UINT8
, BASE_DEC
, NULL
, 0x0, NULL
, HFILL
}},
14067 { &hf_bgp_ls_sr_tlv_srv6_endx_sid_reserved
,
14068 { "Reserved", "bgp.ls.sr.tlv.srv6_endx_sid.reserved",
14069 FT_UINT8
, BASE_HEX
, NULL
, 0x0, NULL
, HFILL
}},
14070 { &hf_bgp_ls_sr_tlv_srv6_endx_sid_neighbor_ospf
,
14071 { "Neighbor-ID", "bgp.ls.tlv.srv6_endx_sid.neighbor_id_ospf", FT_IPv4
,
14072 BASE_NONE
, NULL
, 0x0, NULL
, HFILL
}},
14073 { &hf_bgp_ls_sr_tlv_srv6_endx_sid_neighbor_isis
,
14074 { "Neighbor-ID", "bgp.ls.tlv.srv6_endx_sid.neighbor_id_isis", FT_SYSTEM_ID
,
14075 BASE_NONE
, NULL
, 0x0, NULL
, HFILL
}},
14076 { &hf_bgp_ls_sr_tlv_srv6_endx_sid_sid
,
14077 { "SID", "bgp.ls.sr.tlv.srv6_endx_sid.sid",
14078 FT_IPv6
, BASE_NONE
, NULL
, 0x0, NULL
, HFILL
}},
14079 { &hf_bgp_ls_sr_tlv_srv6_sid_struct
,
14080 { "SRv6 SID Structure TLV", "bgp.ls.sr.tlv.srv6_sid_structure", FT_NONE
,
14081 BASE_NONE
, NULL
, 0x0, NULL
, HFILL
}},
14082 { &hf_bgp_ls_sr_tlv_srv6_sid_struct_lb_len
,
14083 { "Locator Block Length", "bgp.ls.sr.tlv.srv6_sid_structure.locator_block_len",
14084 FT_UINT8
, BASE_DEC
, NULL
, 0x0, NULL
, HFILL
}},
14085 { &hf_bgp_ls_sr_tlv_srv6_sid_struct_ln_len
,
14086 { "Locator Node Length", "bgp.ls.sr.tlv.srv6_sid_structure.locator_node_len",
14087 FT_UINT8
, BASE_DEC
, NULL
, 0x0, NULL
, HFILL
}},
14088 { &hf_bgp_ls_sr_tlv_srv6_sid_struct_fun_len
,
14089 { "Function Length", "bgp.ls.sr.tlv.srv6_sid_structure.fun_len",
14090 FT_UINT8
, BASE_DEC
, NULL
, 0x0, NULL
, HFILL
}},
14091 { &hf_bgp_ls_sr_tlv_srv6_sid_struct_arg_len
,
14092 { "Arguments Length", "bgp.ls.sr.tlv.srv6_sid_structure.arg_len",
14093 FT_UINT8
, BASE_DEC
, NULL
, 0x0,NULL
, HFILL
}},
14094 { &hf_bgp_ls_igp_te_metric_flags
,
14095 { "TE Metric Flags", "bgp.ls.igp_te_metric.flags", FT_UINT8
,
14096 BASE_HEX
, NULL
, 0x0, NULL
, HFILL
}},
14097 { &hf_bgp_ls_igp_te_metric_flags_a
,
14098 { "Anomalous (A) bit", "bgp.ls.igp_te_metric.flags.a", FT_BOOLEAN
,
14099 8, TFS(&tfs_set_notset
), BGP_LS_IGP_TE_METRIC_FLAG_A
, NULL
, HFILL
}},
14100 { &hf_bgp_ls_igp_te_metric_flags_reserved
,
14101 { "Reserved", "bgp.ls.igp_te_metric.flags.reserved", FT_UINT8
,
14102 BASE_HEX
, NULL
, BGP_LS_IGP_TE_METRIC_FLAG_RESERVED
, NULL
, HFILL
}},
14103 { &hf_bgp_ls_igp_te_metric_delay
,
14104 { "Unidirectional Link Delay TLV", "bgp.ls.igp_te_metric.delay", FT_NONE
,
14105 BASE_NONE
, NULL
, 0x0, NULL
, HFILL
}},
14106 { &hf_bgp_ls_igp_te_metric_delay_value
,
14107 { "Delay", "bgp.ls.igp_te_metric.delay_value", FT_UINT24
,
14108 BASE_DEC
, NULL
, 0x0, NULL
, HFILL
}},
14109 { &hf_bgp_ls_igp_te_metric_delay_min_max
,
14110 { "Min/Max Unidirectional Link Delay TLV", "bgp.ls.igp_te_metric.delay_min_max", FT_NONE
,
14111 BASE_NONE
, NULL
, 0x0, NULL
, HFILL
}},
14112 { &hf_bgp_ls_igp_te_metric_delay_min
,
14113 { "Min Delay", "bgp.ls.igp_te_metric.delay_min", FT_UINT24
,
14114 BASE_DEC
, NULL
, 0x0, NULL
, HFILL
}},
14115 { &hf_bgp_ls_igp_te_metric_delay_max
,
14116 { "Max Delay", "bgp.ls.igp_te_metric.delay_max", FT_UINT24
,
14117 BASE_DEC
, NULL
, 0x0, NULL
, HFILL
}},
14118 { &hf_bgp_ls_igp_te_metric_delay_variation
,
14119 { "Unidirectional Delay Variation TLV", "bgp.ls.igp_te_metric.delay_variation", FT_NONE
,
14120 BASE_NONE
, NULL
, 0x0, NULL
, HFILL
}},
14121 { &hf_bgp_ls_igp_te_metric_delay_variation_value
,
14122 { "Delay Variation", "bgp.ls.igp_te_metric.delay_variation_value", FT_UINT24
,
14123 BASE_DEC
, NULL
, 0x0, NULL
, HFILL
}},
14124 { &hf_bgp_ls_igp_te_metric_link_loss
,
14125 { "Unidirectional Link Loss TLV", "bgp.ls.igp_te_metric.link_loss", FT_NONE
,
14126 BASE_NONE
, NULL
, 0x0, NULL
, HFILL
}},
14127 { &hf_bgp_ls_igp_te_metric_link_loss_value
,
14128 { "Link Loss", "bgp.ls.igp_te_metric.link_loss_value", FT_UINT24
,
14129 BASE_DEC
, NULL
, 0x0, NULL
, HFILL
}},
14130 { &hf_bgp_ls_igp_te_metric_bandwidth_residual
,
14131 { "Unidirectional Residual Bandwidth TLV", "bgp.ls.igp_te_metric.residual_bandwidth", FT_NONE
,
14132 BASE_NONE
, NULL
, 0x0, NULL
, HFILL
}},
14133 { &hf_bgp_ls_igp_te_metric_bandwidth_residual_value
,
14134 { "Residual Bandwidth", "bgp.ls.igp_te_metric.residual_bandwidth_value", FT_UINT32
,
14135 BASE_DEC
, NULL
, 0x0, NULL
, HFILL
}},
14136 { &hf_bgp_ls_igp_te_metric_bandwidth_available
,
14137 { "Unidirectional Available Bandwidth TLV", "bgp.ls.igp_te_metric.available_bandwidth", FT_NONE
,
14138 BASE_NONE
, NULL
, 0x0, NULL
, HFILL
}},
14139 { &hf_bgp_ls_igp_te_metric_bandwidth_available_value
,
14140 { "Residual Bandwidth", "bgp.ls.igp_te_metric.available_bandwidth_value", FT_UINT32
,
14141 BASE_DEC
, NULL
, 0x0, NULL
, HFILL
}},
14142 { &hf_bgp_ls_igp_te_metric_bandwidth_utilized
,
14143 { "Unidirectional Utilized Bandwidth TLV", "bgp.ls.igp_te_metric.utilized_bandwidth", FT_NONE
,
14144 BASE_NONE
, NULL
, 0x0, NULL
, HFILL
}},
14145 { &hf_bgp_ls_igp_te_metric_bandwidth_utilized_value
,
14146 { "Utilized Bandwidth", "bgp.ls.igp_te_metric.utilized_bandwidth_value", FT_UINT32
,
14147 BASE_DEC
, NULL
, 0x0, NULL
, HFILL
}},
14148 { &hf_bgp_ls_igp_te_metric_reserved
,
14149 { "Reserved", "bgp.ls.igp_te_metric.reserved", FT_UINT8
,
14150 BASE_HEX
, NULL
, 0x0, NULL
, HFILL
}},
14151 { &hf_bgp_ls_tlv_app_spec_link_attrs
,
14152 { "Application-Specific Link Attributes TLV", "bgp.ls.tlv.application_specific_link_attributes", FT_NONE
,
14153 BASE_NONE
, NULL
, 0x0, NULL
, HFILL
}},
14154 { &hf_bgp_ls_tlv_app_spec_link_attrs_sabm_len
,
14155 { "SABM Length", "bgp.ls.tlv.application_specific_link_attributes.sabm_length", FT_UINT8
,
14156 BASE_DEC
, NULL
, 0x0, NULL
, HFILL
}},
14157 { &hf_bgp_ls_tlv_app_spec_link_attrs_udabm_len
,
14158 { "UDABM Length", "bgp.ls.tlv.application_specific_link_attributes.udabm_length", FT_UINT8
,
14159 BASE_DEC
, NULL
, 0x0, NULL
, HFILL
}},
14160 { &hf_bgp_ls_tlv_app_spec_link_attrs_reserved
,
14161 { "Reserved", "bgp.ls.tlv.application_specific_link_attributes.reserved", FT_UINT16
,
14162 BASE_HEX
, NULL
, 0x0, NULL
, HFILL
}},
14163 { &hf_bgp_ls_tlv_app_spec_link_attrs_sabm
,
14164 { "Standard Application Identifier Bit Mask", "bgp.ls.tlv.application_specific_link_attributes.sabm", FT_UINT32
,
14165 BASE_HEX
, NULL
, 0x0, NULL
, HFILL
}},
14166 { &hf_bgp_ls_tlv_app_spec_link_attrs_sabm_r
,
14167 { "RSVP-TE (R)", "bgp.ls.tlv.application_specific_link_attributes.sabm.r", FT_BOOLEAN
,
14168 32, TFS(&tfs_set_notset
), BGP_LS_APP_SPEC_LINK_ATTRS_SABM_R
, NULL
, HFILL
}},
14169 { &hf_bgp_ls_tlv_app_spec_link_attrs_sabm_s
,
14170 { "Segment Routing Policy (S)", "bgp.ls.tlv.application_specific_link_attributes.sabm.s", FT_BOOLEAN
,
14171 32, TFS(&tfs_set_notset
), BGP_LS_APP_SPEC_LINK_ATTRS_SABM_S
, NULL
, HFILL
}},
14172 { &hf_bgp_ls_tlv_app_spec_link_attrs_sabm_f
,
14173 { "Loop Free Alternate (F)", "bgp.ls.tlv.application_specific_link_attributes.sabm.f", FT_BOOLEAN
,
14174 32, TFS(&tfs_set_notset
), BGP_LS_APP_SPEC_LINK_ATTRS_SABM_F
, NULL
, HFILL
}},
14175 { &hf_bgp_ls_tlv_app_spec_link_attrs_sabm_x
,
14176 { "Flexible Algorithm (X)", "bgp.ls.tlv.application_specific_link_attributes.sabm.x", FT_BOOLEAN
,
14177 32, TFS(&tfs_set_notset
), BGP_LS_APP_SPEC_LINK_ATTRS_SABM_X
, NULL
, HFILL
}},
14178 { &hf_bgp_ls_tlv_app_spec_link_attrs_udabm
,
14179 { "User-Defined Application Identifier Bit Mask", "bgp.ls.tlv.application_specific_link_attributes.udabm", FT_BYTES
,
14180 SEP_SPACE
, NULL
, 0x0,NULL
, HFILL
}},
14182 { &hf_bgp_evpn_nlri_igmp_mc_or_length
,
14183 { "Originator Router Length", "bgp.evpn.nlri.or_length", FT_UINT8
,
14184 BASE_DEC
, NULL
, 0x0, NULL
, HFILL
}},
14185 { &hf_bgp_evpn_nlri_igmp_mc_or_addr_ipv4
,
14186 { "Originator Router Address IPv4", "bgp.evpn.nlri.or_addr_ipv4", FT_IPv4
,
14187 BASE_NONE
, NULL
, 0x0, NULL
, HFILL
}},
14188 { &hf_bgp_evpn_nlri_igmp_mc_or_addr_ipv6
,
14189 { "Originator Router Address IPv6", "bgp.evpn.nlri.or_addr_ipv6", FT_IPv6
,
14190 BASE_NONE
, NULL
, 0x0, NULL
, HFILL
}},
14191 { &hf_bgp_evpn_nlri_igmp_mc_flags
,
14192 { "Flags", "bgp.evpn.nlri.igmp_mc_flags", FT_UINT8
,
14193 BASE_HEX
, NULL
, 0x0, NULL
, HFILL
}},
14194 { &hf_bgp_evpn_nlri_igmp_mc_flags_v1
,
14195 { "IGMP Version 1", "bgp.evpn.nlri.igmp_mc_flags.v1", FT_BOOLEAN
,
14196 8, TFS(&tfs_set_notset
), EVPN_IGMP_MC_FLAG_V1
, NULL
, HFILL
}},
14197 { &hf_bgp_evpn_nlri_igmp_mc_flags_v2
,
14198 { "IGMP Version 2", "bgp.evpn.nlri.igmp_mc_flags.v2", FT_BOOLEAN
,
14199 8, TFS(&tfs_set_notset
), EVPN_IGMP_MC_FLAG_V2
, NULL
, HFILL
}},
14200 { &hf_bgp_evpn_nlri_igmp_mc_flags_v3
,
14201 { "IGMP Version 3", "bgp.evpn.nlri.igmp_mc_flags.v3", FT_BOOLEAN
,
14202 8, TFS(&tfs_set_notset
), EVPN_IGMP_MC_FLAG_V3
, NULL
, HFILL
}},
14203 { &hf_bgp_evpn_nlri_igmp_mc_flags_ie
,
14204 { "Group Type (IE Flag)", "bgp.evpn.nlri.igmp_mc_flags.ie", FT_BOOLEAN
,
14205 8, TFS(&tfs_exclude_include
), EVPN_IGMP_MC_FLAG_IE
, "Group Type (Include/Exclude Flag)", HFILL
}},
14206 { &hf_bgp_evpn_nlri_igmp_mc_flags_reserved
,
14207 { "Reserved", "bgp.evpn.nlri.igmp_mc_flags.reserved", FT_UINT8
,
14208 BASE_HEX
, NULL
, EVPN_IGMP_MC_FLAG_RESERVED
, NULL
, HFILL
}},
14210 /* draft-mpmz-bess-mup-safi-00 */
14211 { &hf_bgp_mup_nlri
,
14212 { "BGP-MUP NLRI", "bgp.mup.nlri", FT_NONE
,
14213 BASE_NONE
, NULL
, 0x0, NULL
, HFILL
}},
14214 { &hf_bgp_mup_nlri_at
,
14215 { "Architecture Type", "bgp.mup.nlri.at", FT_UINT8
, BASE_DEC
,
14216 VALS(bgp_mup_architecture_types
), 0x0, NULL
, HFILL
}},
14217 { &hf_bgp_mup_nlri_rt
,
14218 { "Route Type", "bgp.mup.nlri.rt", FT_UINT16
, BASE_DEC
,
14219 VALS(bgp_mup_route_types
), 0x0, NULL
, HFILL
}},
14220 { &hf_bgp_mup_nlri_len
,
14221 { "Length", "bgp.mup.nlri.len", FT_UINT8
,
14222 BASE_DEC
, NULL
, 0x0, NULL
, HFILL
}},
14223 { &hf_bgp_mup_nlri_rd
,
14224 { "Route Distinguisher", "bgp.mup.nlri.rd", FT_BYTES
,
14225 BASE_NONE
, NULL
, 0x0, NULL
, HFILL
}},
14226 { &hf_bgp_mup_nlri_prefixlen
,
14227 { "Prefix Length", "bgp.mup.nlri.prefixlen", FT_UINT8
,
14228 BASE_DEC
, NULL
, 0x0, NULL
, HFILL
}},
14229 { &hf_bgp_mup_nlri_ip_prefix
,
14230 { "IPv4 Prefix", "bgp.mup.nlri.ip_prefix", FT_IPv4
,
14231 BASE_NONE
, NULL
, 0x0, NULL
, HFILL
}},
14232 { &hf_bgp_mup_nlri_ipv6_prefix
,
14233 { "IPv6 Prefix", "bgp.mup.nlri.ipv6_prefix", FT_IPv6
,
14234 BASE_NONE
, NULL
, 0x0, NULL
, HFILL
}},
14235 { &hf_bgp_mup_nlri_ip_addr
,
14236 { "IPv4 Address", "bgp.mup.nlri.ip_addr", FT_IPv4
,
14237 BASE_NONE
, NULL
, 0x0, NULL
, HFILL
}},
14238 { &hf_bgp_mup_nlri_ipv6_addr
,
14239 { "IPv6 Address", "bgp.mup.nlri.ipv6_addr", FT_IPv6
,
14240 BASE_NONE
, NULL
, 0x0, NULL
, HFILL
}},
14241 { &hf_bgp_mup_nlri_3gpp_5g_teid
,
14242 { "TEID", "bgp.mup.nlri.3gpp_5g.teid", FT_UINT32
,
14243 BASE_HEX
, NULL
, 0x0, NULL
, HFILL
}},
14244 { &hf_bgp_mup_nlri_3gpp_5g_qfi
,
14245 { "QFI", "bgp.mup.nlri.3gpp_5g.qfi", FT_UINT8
,
14246 BASE_HEX
, NULL
, 0x0, NULL
, HFILL
}},
14247 { &hf_bgp_mup_nlri_3gpp_5g_ep_addr_len
,
14248 { "Endpoint Length", "bgp.mup.nlri.3gpp_5g.ep.len", FT_UINT8
,
14249 BASE_DEC
, NULL
, 0x0, NULL
, HFILL
}},
14250 { &hf_bgp_mup_nlri_3gpp_5g_ep_ip_addr
,
14251 { "Endpoint Address", "bgp.mup.nlri.3gpp_5g.ep.ip_addr", FT_IPv4
,
14252 BASE_NONE
, NULL
, 0x0, NULL
, HFILL
}},
14253 { &hf_bgp_mup_nlri_3gpp_5g_ep_ipv6_addr
,
14254 { "Endpoint Address", "bgp.mup.nlri.3gpp_5g.ep.ipv6_addr", FT_IPv6
,
14255 BASE_NONE
, NULL
, 0x0, NULL
, HFILL
}},
14256 { &hf_bgp_mup_nlri_3gpp_5g_source_addr_len
,
14257 { "Source Address Length", "bgp.mup.nlri.3gpp_5g.source.len", FT_UINT8
,
14258 BASE_DEC
, NULL
, 0x0, NULL
, HFILL
}},
14259 { &hf_bgp_mup_nlri_3gpp_5g_source_ip_addr
,
14260 { "Source Address", "bgp.mup.nlri.3gpp_5g.source.ip_addr", FT_IPv4
,
14261 BASE_NONE
, NULL
, 0x0, NULL
, HFILL
}},
14262 { &hf_bgp_mup_nlri_3gpp_5g_source_ipv6_addr
,
14263 { "Source Address", "bgp.mup.nlri.3gpp_5g.source.ipv6_addr", FT_IPv6
,
14264 BASE_NONE
, NULL
, 0x0, NULL
, HFILL
}},
14265 { &hf_bgp_mup_nlri_ep_len
,
14266 { "Endpoint Length", "bgp.mup.nlri.ep.len", FT_UINT8
,
14267 BASE_DEC
, NULL
, 0x0, NULL
, HFILL
}},
14268 { &hf_bgp_mup_nlri_ep_ip_addr
,
14269 { "Endpoint Address", "bgp.mup.nlri.ep.ip_addr", FT_IPv4
,
14270 BASE_NONE
, NULL
, 0x0, NULL
, HFILL
}},
14271 { &hf_bgp_mup_nlri_ep_ipv6_addr
,
14272 { "Endpoint Address", "bgp.mup.nlri.ep.ipv6_addr", FT_IPv6
,
14273 BASE_NONE
, NULL
, 0x0, NULL
, HFILL
}},
14274 { &hf_bgp_mup_nlri_3gpp_5g_ep_teid
,
14275 { "Endpoint TEID", "bgp.mup.nlri.3gpp_5g.ep.teid", FT_UINT32
,
14276 BASE_DEC
, NULL
, 0x0, NULL
, HFILL
}},
14277 { &hf_bgp_mup_nlri_3gpp_5g_type1_st_route
,
14278 { "3gpp-5g specific Type 1 ST route", "bgp.mup.nlri.3gpp_5g.type1_st_route", FT_NONE
,
14279 BASE_NONE
, NULL
, 0x0, NULL
, HFILL
}},
14280 { &hf_bgp_mup_nlri_3gpp_5g_type2_st_route
,
14281 { "3gpp-5g specific Type 2 ST route", "bgp.mup.nlri.3gpp_5g.type2_st_route", FT_NONE
,
14282 BASE_NONE
, NULL
, 0x0, NULL
, HFILL
}},
14283 { &hf_bgp_mup_nlri_unknown_data
,
14284 { "Unknown Data", "bgp.mup.nlri.unknown_data", FT_BYTES
,
14285 BASE_NONE
, NULL
, 0x0, NULL
, HFILL
}},
14288 static int *ett
[] = {
14294 &ett_bgp_attr_flags
,
14296 &ett_bgp_mp_reach_nlri
,
14297 &ett_bgp_mp_unreach_nlri
,
14302 &ett_bgp_notification
,
14303 &ett_bgp_route_refresh
,
14304 &ett_bgp_capability
,
14305 &ett_bgp_as_path_segment
,
14306 &ett_bgp_as_path_segment_asn
,
14307 &ett_bgp_communities
,
14308 &ett_bgp_community
,
14309 &ett_bgp_cluster_list
,
14312 &ett_bgp_options_ext
,
14314 &ett_bgp_extended_communities
,
14315 &ett_bgp_extended_community
,
14316 &ett_bgp_ext_com_type
,
14317 &ett_bgp_extended_com_fspec_redir
,
14318 &ett_bgp_ext_com_flags
,
14319 &ett_bgp_ext_com_l2_flags
,
14320 &ett_bgp_ext_com_etree_flags
,
14321 &ett_bgp_ext_com_evpn_mmac_flags
,
14322 &ett_bgp_ext_com_evpn_l2attr_flags
,
14323 &ett_bgp_ext_com_evpn_etree_flags
,
14324 &ett_bgp_ext_com_cost_cid
,
14325 &ett_bgp_ext_com_ospf_rt_opt
,
14326 &ett_bgp_ext_com_eigrp_flags
,
14328 &ett_bgp_ssa_subtree
,
14330 &ett_bgp_orf_entry
,
14331 &ett_bgp_mcast_vpn_nlri
,
14332 &ett_bgp_flow_spec_nlri
,
14333 &ett_bgp_flow_spec_nlri_filter
,
14334 &ett_bgp_flow_spec_nlri_op_flags
,
14335 &ett_bgp_flow_spec_nlri_tcp
,
14336 &ett_bgp_flow_spec_nlri_ff
,
14337 &ett_bgp_tunnel_tlv
,
14338 &ett_bgp_tunnel_tlv_subtree
,
14339 &ett_bgp_tunnel_subtlv
,
14340 &ett_bgp_tunnel_subtlv_subtree
,
14341 &ett_bgp_link_state
,
14342 &ett_bgp_evpn_nlri
,
14343 &ett_bgp_evpn_nlri_esi
,
14344 &ett_bgp_evpn_nlri_mc
,
14345 &ett_bgp_mpls_labels
,
14346 &ett_bgp_pmsi_tunnel_id
,
14347 &ett_bgp_aigp_attr
,
14348 &ett_bgp_large_communities
,
14350 &ett_bgp_prefix_sid_label_index
,
14351 &ett_bgp_prefix_sid_ipv6
,
14352 &ett_bgp_prefix_sid_originator_srgb
,
14353 &ett_bgp_prefix_sid_originator_srgb_block
,
14354 &ett_bgp_prefix_sid_originator_srgb_blocks
,
14355 &ett_bgp_bgpsec_secure_path
,
14356 &ett_bgp_bgpsec_secure_path_segment
,
14357 &ett_bgp_bgpsec_signature_block
,
14358 &ett_bgp_bgpsec_signature_segment
,
14360 &ett_bgp_binding_sid
,
14361 &ett_bgp_segment_list
,
14362 &ett_bgp_prefix_sid_unknown
,
14363 &ett_bgp_prefix_sid_srv6_l3vpn
,
14364 &ett_bgp_prefix_sid_srv6_l3vpn_sub_tlvs
,
14365 &ett_bgp_prefix_sid_srv6_l3vpn_sid_information
,
14366 &ett_bgp_prefix_sid_srv6_l3vpn_sub_sub_tlvs
,
14367 &ett_bgp_prefix_sid_srv6_l3vpn_sid_structure
,
14368 &ett_bgp_prefix_sid_srv6_l3vpn_sid_unknown
,
14369 &ett_bgp_prefix_sid_srv6_l3vpn_unknown
,
14370 &ett_bgp_prefix_sid_srv6_l2vpn
,
14371 &ett_bgp_prefix_sid_srv6_l2vpn_sub_tlvs
,
14372 &ett_bgp_prefix_sid_srv6_l2vpn_sid_information
,
14373 &ett_bgp_prefix_sid_srv6_l2vpn_sub_sub_tlvs
,
14374 &ett_bgp_prefix_sid_srv6_l2vpn_sid_structure
,
14375 &ett_bgp_prefix_sid_srv6_l2vpn_sid_unknown
,
14376 &ett_bgp_prefix_sid_srv6_l2vpn_unknown
,
14378 &ett_bgp_mup_nlri_3gpp_5g_type1_st_route
,
14379 &ett_bgp_mup_nlri_3gpp_5g_type2_st_route
,
14381 static ei_register_info ei
[] = {
14382 { &ei_bgp_marker_invalid
, { "bgp.marker_invalid", PI_MALFORMED
, PI_ERROR
, "Marker is not all ones", EXPFILL
}},
14383 { &ei_bgp_cap_len_bad
, { "bgp.cap.length.bad", PI_MALFORMED
, PI_ERROR
, "Capability length is wrong", EXPFILL
}},
14384 { &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
}},
14385 { &ei_bgp_notify_minor_unknown
, { "bgp.notify.minor_error.unknown", PI_UNDECODED
, PI_NOTE
, "Unknown notification error", EXPFILL
}},
14386 { &ei_bgp_route_refresh_orf_type_unknown
, { "bgp.route_refresh.orf.type.unknown", PI_MALFORMED
, PI_ERROR
, "ORFEntry-Unknown", EXPFILL
}},
14387 { &ei_bgp_length_invalid
, { "bgp.length.invalid", PI_MALFORMED
, PI_ERROR
, "Length is invalid", EXPFILL
}},
14388 { &ei_bgp_prefix_length_invalid
, { "bgp.prefix_length.invalid", PI_MALFORMED
, PI_ERROR
, "Prefix length is invalid", EXPFILL
}},
14389 { &ei_bgp_afi_type_not_supported
, { "bgp.afi_type_not_supported", PI_PROTOCOL
, PI_ERROR
, "AFI Type not supported", EXPFILL
}},
14390 { &ei_bgp_unknown_afi
, { "bgp.unknown_afi", PI_PROTOCOL
, PI_ERROR
, "Unknown Address Family", EXPFILL
}},
14391 { &ei_bgp_unknown_safi
, { "bgp.unknown_safi", PI_PROTOCOL
, PI_ERROR
, "Unknown SAFI", EXPFILL
}},
14392 { &ei_bgp_unknown_label_vpn
, { "bgp.unknown_label", PI_PROTOCOL
, PI_ERROR
, "Unknown Label VPN", EXPFILL
}},
14393 { &ei_bgp_ls_error
, { "bgp.ls.error", PI_PROTOCOL
, PI_ERROR
, "Link State error", EXPFILL
}},
14394 { &ei_bgp_ls_warn
, { "bgp.ls.warn", PI_PROTOCOL
, PI_WARN
, "Link State warning", EXPFILL
}},
14395 { &ei_bgp_ext_com_len_bad
, { "bgp.ext_com.length.bad", PI_PROTOCOL
, PI_ERROR
, "Extended community length is wrong", EXPFILL
}},
14396 { &ei_bgp_evpn_nlri_rt_type_err
, { "bgp.evpn.type", PI_MALFORMED
, PI_ERROR
, "EVPN Route Type is invalid", EXPFILL
}},
14397 { &ei_bgp_evpn_nlri_rt_len_err
, { "bgp.evpn.len", PI_MALFORMED
, PI_ERROR
, "EVPN Length is invalid", EXPFILL
}},
14398 { &ei_bgp_evpn_nlri_esi_type_err
, { "bgp.evpn.esi_type", PI_MALFORMED
, PI_ERROR
, "EVPN ESI Type is invalid", EXPFILL
}},
14399 { &ei_bgp_evpn_nlri_rt4_no_ip
, { "bgp.evpn.no_ip", PI_PROTOCOL
, PI_NOTE
, "IP Address: NOT INCLUDED", EXPFILL
}},
14400 { &ei_bgp_attr_pmsi_tunnel_type
, { "bgp.attr.pmsi.tunnel_type", PI_PROTOCOL
, PI_ERROR
, "Unknown Tunnel type", EXPFILL
}},
14401 { &ei_bgp_attr_pmsi_opaque_type
, { "bgp.attr.pmsi.opaque_type", PI_PROTOCOL
, PI_ERROR
, "Invalid pmsi opaque type", EXPFILL
}},
14402 { &ei_bgp_attr_aigp_type
, { "bgp.attr.aigp.type", PI_MALFORMED
, PI_NOTE
, "Unknown AIGP attribute type", EXPFILL
}},
14403 { &ei_bgp_prefix_length_err
, { "bgp.prefix.length", PI_MALFORMED
, PI_ERROR
, "Invalid IPv6 prefix length", EXPFILL
}},
14404 { &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
}},
14405 { &ei_bgp_next_hop_ipv6_scope
, { "bgp.next_hop.ipv6.scope", PI_PROTOCOL
, PI_WARN
, "Invalid IPv6 address scope", EXPFILL
}},
14406 { &ei_bgp_next_hop_rd_nonzero
, { "bgp.next_hop.rd.nonzero", PI_PROTOCOL
, PI_WARN
, "Route Distinguisher in Next Hop Network Address nonzero", EXPFILL
}},
14407 { &ei_bgp_mup_unknown_at
, { "bgp.mup.unknown_at", PI_PROTOCOL
, PI_ERROR
, "Unknown architecture type", EXPFILL
}},
14408 { &ei_bgp_mup_unknown_rt
, { "bgp.mup.unknown_rt", PI_PROTOCOL
, PI_ERROR
, "Unknown route type", EXPFILL
}},
14409 { &ei_bgp_mup_nlri_addr_len_err
, { "bgp.mup.nlri.addr_len_err", PI_PROTOCOL
, PI_ERROR
, "Address length invalid", EXPFILL
}},
14412 module_t
*bgp_module
;
14413 expert_module_t
* expert_bgp
;
14415 static const enum_val_t asn_len
[] = {
14416 {"auto-detect", "Auto-detect", 0},
14417 {"2", "2 octet", 2},
14418 {"4", "4 octet", 4},
14422 proto_bgp
= proto_register_protocol("Border Gateway Protocol", "BGP", "bgp");
14423 proto_register_field_array(proto_bgp
, hf
, array_length(hf
));
14424 proto_register_subtree_array(ett
, array_length(ett
));
14425 expert_bgp
= expert_register_protocol(proto_bgp
);
14426 expert_register_field_array(expert_bgp
, ei
, array_length(ei
));
14428 bgp_module
= prefs_register_protocol(proto_bgp
, NULL
);
14429 prefs_register_bool_preference(bgp_module
, "desegment",
14430 "Reassemble BGP messages spanning multiple TCP segments",
14431 "Whether the BGP dissector should reassemble messages spanning multiple TCP segments."
14432 " To use this option, you must also enable \"Allow subdissectors to reassemble TCP streams\" in the TCP protocol settings.",
14434 prefs_register_enum_preference(bgp_module
, "asn_len",
14435 "Length of the AS number",
14436 "BGP dissector detect the length of the AS number in AS_PATH attributes automatically or manually (NOTE: Automatic detection is not 100% accurate)",
14437 &bgp_asn_len
, asn_len
, false);
14439 bgp_handle
= register_dissector("bgp", dissect_bgp
, proto_bgp
);
14440 register_dissector("bgp.pdu", dissect_bgp_pdu
, proto_bgp
);
14444 proto_reg_handoff_bgp(void)
14446 dissector_add_uint_with_preference("tcp.port", BGP_TCP_PORT
, bgp_handle
);
14449 * Editor modelines - https://www.wireshark.org/tools/modelines.html
14452 * c-basic-offset: 4
14454 * indent-tabs-mode: nil
14457 * ex: set shiftwidth=4 tabstop=8 expandtab:
14458 * :indentSize=4:tabSize=8:noTabs=true: