TODO epan/dissectors/asn1/kerberos/packet-kerberos-template.c new GSS flags
[wireshark-sm.git] / epan / dissectors / packet-isis-lsp.c
blob9af3216d35aa6a849444ac396d4c442e8152dcbb
1 /* packet-isis-lsp.c
2 * Routines for decoding isis lsp packets and their CLVs
4 * Stuart Stanley <stuarts@mxmail.net>
6 * Wireshark - Network traffic analyzer
7 * By Gerald Combs <gerald@wireshark.org>
8 * Copyright 1998 Gerald Combs
10 * SPDX-License-Identifier: GPL-2.0-or-later
13 * Copyright 2011, Malgi Nikitha Vivekananda <malgi.nikitha@ipinfusion.com>
14 * Krishnamurthy Mayya <krishnamurthy.mayya@ipinfusion.com>
15 * - Decoding for Router Capability TLV and associated subTLVs as per RFC 6326
16 * - Decoding for Group Address TLV and associated subTLVs as per RFC 6326
18 * Copyright 2019, Rohan Saini <rohan.saini@nokia.com>
19 * - Support for dissecting BIER Info Sub-TLV (RFC 8401)
22 #include "config.h"
24 #include <epan/expert.h>
25 #include <epan/packet.h>
26 #include <epan/tfs.h>
27 #include <wsutil/array.h>
29 #include "packet-osi.h"
30 #include "packet-isis.h"
31 #include "packet-isis-clv.h"
32 #include <epan/addr_resolv.h>
35 * Declarations for L1/L2 LSP base header.
38 /* P | ATT | HIPPITY | DS FIELD description */
39 #define ISIS_LSP_PARTITION_MASK 0x80
40 #define ISIS_LSP_PARTITION_SHIFT 7
41 #define ISIS_LSP_PARTITION(info) (((info) & ISIS_LSP_PARTITION_MASK) >> ISIS_LSP_PARTITION_SHIFT)
43 #define ISIS_LSP_ATT_MASK 0x78
44 #define ISIS_LSP_ATT_SHIFT 3
45 #define ISIS_LSP_ATT(info) (((info) & ISIS_LSP_ATT_MASK) >> ISIS_LSP_ATT_SHIFT)
47 #define ISIS_LSP_ATT_ERROR(info) ((info) >> 3)
48 #define ISIS_LSP_ATT_EXPENSE(info) (((info) >> 2) & 1)
49 #define ISIS_LSP_ATT_DELAY(info) (((info) >> 1) & 1)
50 #define ISIS_LSP_ATT_DEFAULT(info) ((info) & 1)
52 #define ISIS_LSP_HIPPITY_MASK 0x04
53 #define ISIS_LSP_HIPPITY_SHIFT 2
54 #define ISIS_LSP_HIPPITY(info) (((info) & ISIS_LSP_HIPPITY_MASK) >> ISIS_LSP_HIPPITY_SHIFT)
56 #define ISIS_LSP_IS_TYPE_MASK 0x03
57 #define ISIS_LSP_IS_TYPE(info) ((info) & ISIS_LSP_IS_TYPE_MASK)
59 #define ISIS_LSP_MT_MSHIP_RES_MASK 0xF000
60 #define ISIS_LSP_MT_MSHIP_ID_MASK 0x0FFF
63 #define ISIS_LSP_TYPE_UNUSED0 0
64 #define ISIS_LSP_TYPE_LEVEL_1 1
65 #define ISIS_LSP_TYPE_UNUSED2 2
66 #define ISIS_LSP_TYPE_LEVEL_2 3
68 #define ISIS_LSP_ATTACHED_NONE 0
69 #define ISIS_LSP_ATTACHED_DEFAULT 1
70 #define ISIS_LSP_ATTACHED_DELAY 2
71 #define ISIS_LSP_ATTACHED_EXPENSE 4
72 #define ISIS_LSP_ATTACHED_ERROR 8
75 * The "supported" bit in a metric is actually the "not supported" bit;
76 * if it's *clear*, the metric is supported, and if it's *set*, the
77 * metric is not supported.
79 #define ISIS_LSP_CLV_METRIC_SUPPORTED(x) (!((x)&0x80))
80 #define ISIS_LSP_CLV_METRIC_IE(x) ((x)&0x40)
81 #define ISIS_LSP_CLV_METRIC_RESERVED(x) ((x)&0x40)
82 #define ISIS_LSP_CLV_METRIC_UPDOWN(x) ((x)&0x80)
83 #define ISIS_LSP_CLV_METRIC_VALUE(x) ((x)&0x3f)
85 /* Sub-TLVs under Router Capability and MT Capability TLVs
86 As per RFC 7176 section 2.3
87 http://www.iana.org/assignments/isis-tlv-codepoints/isis-tlv-codepoints.xhtml#isis-tlv-codepoints-242
89 #define ISIS_TE_NODE_CAP_DESC 1
90 #define SEGMENT_ROUTING_CAP 2 /* draft-ietf-isis-segment-routing-extensions-03 */
91 #define NICKNAME 6
92 #define TREES 7
93 #define TREE_IDENTIFIER 8
94 #define TREES_USED_IDENTIFIER 9
95 #define INTERESTED_VLANS 10
96 #define IPV6_TE_ROUTER_ID 12
97 #define TRILL_VERSION 13
98 #define VLAN_GROUP 14
99 #define SEGMENT_ROUTING_ALG 19
100 #define SEGMENT_ROUTING_LB 22
101 #define NODE_MSD 23 /* rfc8491 */
102 #define SRV6_CAP 25 /* rfc9352 */
103 #define FLEX_ALGO_DEF 26 /* rfc9350 */
106 /*Sub-TLVs under Group Address TLV*/
107 #define GRP_MAC_ADDRESS 1
108 #define GRP_IPV4_ADDRESS 2
109 #define GRP_IPV6_ADDRESS 3
111 /* sub-TLV's under SID/Label binding TLV */
112 #define ISIS_LSP_SL_SUB_SID_LABEL 1
113 #define ISIS_LSP_SL_SUB_PREFIX_SID 3
114 #define ISIS_LSP_SL_SUB_ADJ_SID 31
115 #define ISIS_LSP_SL_SUB_LAN_ADJ_SID 32
117 /* Segment Routing Sub-TLV */
118 #define ISIS_SR_SID_LABEL 1
121 From: https://www.iana.org/assignments/igp-parameters/igp-parameters.xhtml
122 IGP Algorithm Types
124 #define ISIS_ALG_SPF 0
125 #define ISIS_ALG_SSPF 1
127 /* IGP MSD Type (rfc8491/rfc9352) */
128 #define IGP_MSD_TYPE_RESERVED 0
129 #define IGP_MSD_TYPE_MPLS 1
130 #define IGP_MSD_TYPE_SEGMENT_LEFT 41
131 #define IGP_MSD_TYPE_END_POP 42
132 #define IGP_MSD_TYPE_H_ENCAP 44
133 #define IGP_MSD_TYPE_END_D 45
135 /* Flex Algo Definition Sub-TLV (rfc9350) */
136 #define FAD_EXCLUDE_AG 1
137 #define FAD_INCLUDE_ANY_AG 2
138 #define FAD_INCLUDE_ALL_AG 3
139 #define FAD_DEF_FLAGS 4
140 #define FAD_EXCLUDE_SRLG 5
142 /* Flex Algo Definition Flags (rfc9350) */
143 #define FAD_DEF_FLAGS_M 0x80
145 /* Prefix Attribute Flags Sub-TLV (rfc7794)*/
146 #define ISIS_LSP_PFX_ATTR_FLAG_X 0x80
147 #define ISIS_LSP_PFX_ATTR_FLAG_R 0x40
148 #define ISIS_LSP_PFX_ATTR_FLAG_N 0x20
150 const range_string mtid_strings[] = {
151 { 0, 0, "Standard topology" },
152 { 1, 1, "IPv4 In-Band Management" },
153 { 2, 2, "IPv6 routing topology" },
154 { 3, 3, "IPv4 multicast routing topology" },
155 { 4, 4, "IPv6 multicast routing topology" },
156 { 5, 5, "IPv6 in-band management" },
157 { 6, 3995, "Reserved for IETF Consensus" },
158 { 3996, 4095, "Development, Experimental and Proprietary features" },
159 { 0, 0, NULL }
162 void proto_register_isis_lsp(void);
163 void proto_reg_handoff_isis_lsp(void);
165 static int proto_isis_lsp;
167 /* lsp packets */
168 static int hf_isis_lsp_pdu_length;
169 static int hf_isis_lsp_remaining_life;
170 static int hf_isis_lsp_sequence_number;
171 static int hf_isis_lsp_lsp_id;
172 static int hf_isis_lsp_hostname;
173 static int hf_isis_lsp_srlg_system_id;
174 static int hf_isis_lsp_srlg_pseudo_num;
175 static int hf_isis_lsp_srlg_flags_numbered;
176 static int hf_isis_lsp_srlg_ipv4_local;
177 static int hf_isis_lsp_srlg_ipv4_remote;
178 static int hf_isis_lsp_srlg_value;
179 static int hf_isis_lsp_appspec_srlg_system_id;
180 static int hf_isis_lsp_appspec_srlg_pseudo_num;
181 static int hf_isis_lsp_appspec_srlg_sub_tlv_length;
182 static int hf_isis_lsp_appspec_srlg_value;
183 static int hf_isis_lsp_appspec_srlg_link_local_id;
184 static int hf_isis_lsp_appspec_srlg_link_remote_id;
185 static int hf_isis_lsp_checksum;
186 static int hf_isis_lsp_checksum_status;
187 static int hf_isis_lsp_clv_ipv4_int_addr;
188 static int hf_isis_lsp_clv_ipv6_int_addr;
189 static int hf_isis_lsp_clv_te_router_id;
190 static int hf_isis_lsp_clv_mt;
191 static int hf_isis_lsp_p;
192 static int hf_isis_lsp_att;
193 static int hf_isis_lsp_hippity;
194 static int hf_isis_lsp_is_type;
195 static int hf_isis_lsp_clv_type;
196 static int hf_isis_lsp_clv_length;
197 static int hf_isis_lsp_root_id;
198 static int hf_isis_lsp_bw_ct_model;
199 static int hf_isis_lsp_bw_ct_reserved;
200 static int hf_isis_lsp_bw_ct0;
201 static int hf_isis_lsp_bw_ct1;
202 static int hf_isis_lsp_bw_ct2;
203 static int hf_isis_lsp_bw_ct3;
204 static int hf_isis_lsp_bw_ct4;
205 static int hf_isis_lsp_bw_ct5;
206 static int hf_isis_lsp_bw_ct6;
207 static int hf_isis_lsp_bw_ct7;
208 static int hf_isis_lsp_spb_link_metric;
209 static int hf_isis_lsp_spb_port_count;
210 static int hf_isis_lsp_spb_port_id;
211 static int hf_isis_lsp_adj_sid_flags;
212 static int hf_isis_lsp_adj_sid_family_flag;
213 static int hf_isis_lsp_adj_sid_backup_flag;
214 static int hf_isis_lsp_adj_sid_value_flag;
215 static int hf_isis_lsp_adj_sid_local_flag;
216 static int hf_isis_lsp_adj_sid_set_flag;
217 static int hf_isis_lsp_adj_sid_weight;
218 static int hf_isis_lsp_adj_sid_system_id;
219 static int hf_isis_lsp_sid_sli_label;
220 static int hf_isis_lsp_sid_sli_index;
221 static int hf_isis_lsp_sid_sli_ipv6;
222 static int hf_isis_lsp_spb_reserved;
223 static int hf_isis_lsp_spb_sr_bit;
224 static int hf_isis_lsp_spb_spvid;
225 static int hf_isis_lsp_spb_short_mac_address_t;
226 static int hf_isis_lsp_spb_short_mac_address_r;
227 static int hf_isis_lsp_spb_short_mac_address_reserved;
228 static int hf_isis_lsp_spb_short_mac_address;
229 /* TLV 149 items draft-previdi-isis-segment-routing-extensions */
230 static int hf_isis_lsp_sl_binding_flags;
231 static int hf_isis_lsp_sl_binding_flags_f;
232 static int hf_isis_lsp_sl_binding_flags_m;
233 static int hf_isis_lsp_sl_binding_flags_s;
234 static int hf_isis_lsp_sl_binding_flags_d;
235 static int hf_isis_lsp_sl_binding_flags_a;
236 static int hf_isis_lsp_sl_binding_flags_rsv;
237 static int hf_isis_lsp_sl_binding_weight;
238 static int hf_isis_lsp_sl_binding_range;
239 static int hf_isis_lsp_sl_binding_prefix_length;
240 static int hf_isis_lsp_sl_binding_fec_prefix_ipv4;
241 static int hf_isis_lsp_sl_binding_fec_prefix_ipv6;
242 static int hf_isis_lsp_sl_sub_tlv;
243 static int hf_isis_lsp_sl_sub_tlv_type;
244 static int hf_isis_lsp_sl_sub_tlv_length;
245 static int hf_isis_lsp_sl_sub_tlv_label_20;
246 static int hf_isis_lsp_sl_sub_tlv_label_32;
247 static int hf_isis_lsp_sl_sub_tlv_flags;
248 static int hf_isis_lsp_sl_sub_tlv_flags_r;
249 static int hf_isis_lsp_sl_sub_tlv_flags_n;
250 static int hf_isis_lsp_sl_sub_tlv_flags_p;
251 static int hf_isis_lsp_sl_sub_tlv_flags_e;
252 static int hf_isis_lsp_sl_sub_tlv_flags_v;
253 static int hf_isis_lsp_sl_sub_tlv_flags_l;
254 static int hf_isis_lsp_sl_sub_tlv_flags_rsv;
255 static int hf_isis_lsp_sl_sub_tlv_algorithm;
256 static int hf_isis_lsp_mt_cap_spb_instance_v;
257 static int hf_isis_lsp_mt_cap_spb_instance_cist_external_root_path_cost;
258 static int hf_isis_lsp_rt_capable_tree_used_id_starting_tree_no;
259 static int hf_isis_lsp_mt_cap_spb_instance_bridge_priority;
260 static int hf_isis_lsp_mt_cap_spbm_service_identifier_base_vid;
261 static int hf_isis_lsp_mt_cap_spbm_service_identifier_t;
262 static int hf_isis_lsp_mt_cap_spbm_service_identifier_r;
263 static int hf_isis_lsp_mt_cap_spbm_service_identifier_reserved;
264 static int hf_isis_lsp_mt_cap_spbm_service_identifier_i_sid;
265 static int hf_isis_lsp_64_bit_administrative_tag;
266 static int hf_isis_lsp_grp_type;
267 static int hf_isis_lsp_grp_macaddr_length;
268 static int hf_isis_lsp_grp_ipv4addr_length;
269 static int hf_isis_lsp_grp_ipv6addr_length;
270 static int hf_isis_lsp_grp_unknown_length;
271 static int hf_isis_lsp_grp_macaddr_number_of_sources;
272 static int hf_isis_lsp_grp_ipv4addr_number_of_sources;
273 static int hf_isis_lsp_grp_ipv6addr_number_of_sources;
274 static int hf_isis_lsp_ext_is_reachability_traffic_engineering_default_metric;
275 static int hf_isis_lsp_grp_macaddr_group_address;
276 static int hf_isis_lsp_grp_ipv4addr_group_address;
277 static int hf_isis_lsp_grp_ipv6addr_group_address;
278 static int hf_isis_lsp_rt_capable_tree_root_id_nickname;
279 static int hf_isis_lsp_ext_is_reachability_ipv4_interface_address;
280 static int hf_isis_lsp_ext_ip_reachability_metric;
281 static int hf_isis_lsp_ext_ip_reachability_ipv4_prefix;
282 static int hf_isis_lsp_eis_neighbors_es_neighbor_id;
283 static int hf_isis_lsp_expense_metric;
284 static int hf_isis_lsp_ext_is_reachability_link_remote_identifier;
285 static int hf_isis_lsp_rt_capable_vlan_group_secondary_vlan_id;
286 static int hf_isis_lsp_grp_macaddr_vlan_id;
287 static int hf_isis_lsp_grp_ipv4addr_vlan_id;
288 static int hf_isis_lsp_grp_ipv6addr_vlan_id;
289 static int hf_isis_lsp_rt_capable_trill_affinity_tlv;
290 static int hf_isis_lsp_rt_capable_trill_fgl_safe;
291 static int hf_isis_lsp_rt_capable_trill_caps;
292 static int hf_isis_lsp_rt_capable_trill_flags;
293 static int hf_isis_lsp_rt_capable_tree_root_id_starting_tree_no;
294 static int hf_isis_lsp_rt_capable_interested_vlans_nickname;
295 static int hf_isis_lsp_ip_reachability_ipv4_prefix;
296 static int hf_isis_lsp_grp_macaddr_topology_id;
297 static int hf_isis_lsp_grp_ipv4addr_topology_id;
298 static int hf_isis_lsp_grp_ipv6addr_topology_id;
299 static int hf_isis_lsp_ext_is_reachability_ipv4_neighbor_address;
300 static int hf_isis_lsp_ipv6_reachability_reserved_bits;
301 static int hf_isis_lsp_eis_neighbors_default_metric;
302 static int hf_isis_lsp_mt_cap_spb_instance_cist_root_identifier;
303 static int hf_isis_lsp_rt_capable_tree_used_id_nickname;
304 static int hf_isis_lsp_grp_macaddr_source_address;
305 static int hf_isis_lsp_grp_ipv4addr_source_address;
306 static int hf_isis_lsp_grp_ipv6addr_source_address;
307 static int hf_isis_lsp_delay_metric;
308 static int hf_isis_lsp_ext_is_reachability_link_local_identifier;
309 static int hf_isis_lsp_mt_cap_mtid;
310 static int hf_isis_lsp_32_bit_administrative_tag;
311 static int hf_isis_lsp_ext_is_reachability_is_neighbor_id;
312 static int hf_isis_lsp_reservable_link_bandwidth;
313 static int hf_isis_lsp_rt_capable_vlan_group_primary_vlan_id;
314 static int hf_isis_lsp_rt_capable_interested_vlans_multicast_ipv4;
315 static int hf_isis_lsp_rt_capable_interested_vlans_multicast_ipv6;
316 static int hf_isis_lsp_mt_cap_spb_instance_number_of_trees;
317 static int hf_isis_lsp_mt_cap_spb_instance_vlanid_tuple_u;
318 static int hf_isis_lsp_mt_cap_spb_instance_vlanid_tuple_m;
319 static int hf_isis_lsp_mt_cap_spb_instance_vlanid_tuple_a;
320 static int hf_isis_lsp_mt_cap_spb_instance_vlanid_tuple_reserved;
321 static int hf_isis_lsp_mt_cap_spb_instance_vlanid_tuple_ect;
322 static int hf_isis_lsp_mt_cap_spb_instance_vlanid_tuple_base_vid;
323 static int hf_isis_lsp_mt_cap_spb_instance_vlanid_tuple_spvid;
324 static int hf_isis_lsp_mt_cap_spb_opaque_algorithm;
325 static int hf_isis_lsp_mt_cap_spb_opaque_information;
326 static int hf_isis_lsp_mt_cap_spbm_service_identifier_b_mac;
327 static int hf_isis_lsp_ipv6_reachability_subclvs_len;
328 static int hf_isis_lsp_ipv6_reachability_distribution;
329 static int hf_isis_lsp_ipv6_reachability_distribution_internal;
330 static int hf_isis_lsp_ipv6_reachability_subtlv;
331 static int hf_isis_lsp_ipv6_reachability_metric;
332 static int hf_isis_lsp_ipv6_reachability_prefix_length;
333 static int hf_isis_lsp_prefix_attr_flags;
334 static int hf_isis_lsp_prefix_attr_flags_x;
335 static int hf_isis_lsp_prefix_attr_flags_r;
336 static int hf_isis_lsp_prefix_attr_flags_n;
337 static int hf_isis_lsp_rt_capable_trees_maximum_nof_trees_to_compute;
338 static int hf_isis_lsp_rt_capable_interested_vlans_vlan_start_id;
339 static int hf_isis_lsp_rt_capable_nickname_nickname_priority;
340 static int hf_isis_lsp_ext_is_reachability_metric;
341 static int hf_isis_lsp_ext_is_reachability_subclvs_len;
342 static int hf_isis_lsp_ext_is_reachability_code;
343 static int hf_isis_lsp_ext_is_reachability_len;
344 static int hf_isis_lsp_ext_is_reachability_value;
345 static int hf_isis_lsp_default_metric;
346 static int hf_isis_lsp_ext_is_reachability_unidir_link_flags;
347 static int hf_isis_lsp_ext_is_reachability_unidir_link_flags_a;
348 static int hf_isis_lsp_ext_is_reachability_unidir_link_reserved;
349 static int hf_isis_lsp_ext_is_reachability_unidir_link_delay;
350 static int hf_isis_lsp_ext_is_reachability_unidir_link_delay_min;
351 static int hf_isis_lsp_ext_is_reachability_unidir_link_delay_max;
352 static int hf_isis_lsp_ext_is_reachability_unidir_delay_variation;
353 static int hf_isis_lsp_ext_is_reachability_unidir_link_loss;
354 static int hf_isis_lsp_ext_is_reachability_unidir_residual_bandwidth;
355 static int hf_isis_lsp_ext_is_reachability_unidir_available_bandwidth;
356 static int hf_isis_lsp_ext_is_reachability_unidir_utilized_bandwidth;
357 static int hf_isis_lsp_ext_ip_reachability_distribution;
358 static int hf_isis_lsp_ext_ip_reachability_subtlv;
359 static int hf_isis_lsp_ext_ip_reachability_prefix_length;
360 static int hf_isis_lsp_ext_ip_reachability_subclvs_len;
361 static int hf_isis_lsp_ext_ip_reachability_code;
362 static int hf_isis_lsp_ext_ip_reachability_len;
363 static int hf_isis_lsp_ext_ip_reachability_prefix_flags;
364 static int hf_isis_lsp_ext_ip_reachability_prefix_re_adv_flag;
365 static int hf_isis_lsp_ext_ip_reachability_prefix_node_sid_flag;
366 static int hf_isis_lsp_ext_ip_reachability_prefix_nophp_flag;
367 static int hf_isis_lsp_ext_ip_reachability_prefix_expl_null_flag;
368 static int hf_isis_lsp_ext_ip_reachability_prefix_value_flag;
369 static int hf_isis_lsp_ext_ip_reachability_prefix_local_flag;
370 static int hf_isis_lsp_maximum_link_bandwidth;
371 static int hf_isis_lsp_rt_capable_nickname_tree_root_priority;
372 static int hf_isis_lsp_eis_neighbors_delay_metric;
373 static int hf_isis_lsp_rt_capable_trill_maximum_version;
374 static int hf_isis_lsp_rt_capable_interested_vlans_afs_lost_counter;
375 static int hf_isis_lsp_ipv6_reachability_ipv6_prefix;
376 static int hf_isis_lsp_eis_neighbors_error_metric;
377 static int hf_isis_lsp_rt_capable_interested_vlans_vlan_end_id;
378 static int hf_isis_lsp_error_metric;
379 static int hf_isis_lsp_grp_macaddr_number_of_records;
380 static int hf_isis_lsp_grp_ipv4addr_number_of_records;
381 static int hf_isis_lsp_grp_ipv6addr_number_of_records;
382 static int hf_isis_lsp_rt_capable_nickname_nickname;
383 static int hf_isis_lsp_mt_id_reserved;
384 static int hf_isis_lsp_eis_neighbors_is_neighbor_id;
385 static int hf_isis_lsp_mt_id;
386 static int hf_isis_lsp_eis_neighbors_reserved;
387 static int hf_isis_lsp_ip_reachability_error_metric;
388 static int hf_isis_lsp_ip_reachability_delay_metric;
389 static int hf_isis_lsp_ip_reachability_expense_metric;
390 static int hf_isis_lsp_rt_capable_trees_nof_trees_to_use;
391 static int hf_isis_lsp_ip_reachability_default_metric;
392 static int hf_isis_lsp_rt_capable_trees_nof_trees_to_compute;
393 static int hf_isis_lsp_eis_neighbors_expense_metric;
394 static int hf_isis_lsp_partition_designated_l2_is;
395 static int hf_isis_lsp_originating_lsp_buffer_size;
396 static int hf_isis_lsp_ip_reachability_default_metric_ie;
397 static int hf_isis_lsp_eis_neighbors_default_metric_ie;
398 static int hf_isis_lsp_eis_neighbors_error_metric_supported;
399 static int hf_isis_lsp_unrsv_bw_priority_level;
400 static int hf_isis_lsp_ip_reachability_expense_metric_support;
401 static int hf_isis_lsp_mt_cap_overload;
402 static int hf_isis_lsp_eis_neighbors_expense_metric_supported;
403 static int hf_isis_lsp_ip_reachability_delay_metric_support;
404 static int hf_isis_lsp_ip_reachability_error_metric_support;
405 static int hf_isis_lsp_mt_cap_spsourceid;
406 static int hf_isis_lsp_eis_neighbors_delay_metric_supported;
407 static int hf_isis_lsp_eis_neighbors_error_metric_ie;
408 static int hf_isis_lsp_eis_neighbors_expense_metric_ie;
409 static int hf_isis_lsp_eis_neighbors_delay_metric_ie;
410 static int hf_isis_lsp_ip_reachability_delay_metric_ie;
411 static int hf_isis_lsp_ip_reachability_distribution;
412 static int hf_isis_lsp_ip_reachability_error_metric_ie;
413 static int hf_isis_lsp_ip_reachability_expense_metric_ie;
414 static int hf_isis_lsp_rt_capable_router_id;
415 static int hf_isis_lsp_rt_capable_flag_s;
416 static int hf_isis_lsp_rt_capable_flag_d;
417 static int hf_isis_lsp_clv_te_node_cap_b_bit;
418 static int hf_isis_lsp_clv_te_node_cap_e_bit;
419 static int hf_isis_lsp_clv_te_node_cap_m_bit;
420 static int hf_isis_lsp_clv_te_node_cap_g_bit;
421 static int hf_isis_lsp_clv_te_node_cap_p_bit;
422 static int hf_isis_lsp_clv_sr_cap_i_flag;
423 static int hf_isis_lsp_clv_sr_cap_v_flag;
424 static int hf_isis_lsp_clv_sr_cap_range;
425 static int hf_isis_lsp_clv_sr_cap_sid;
426 static int hf_isis_lsp_clv_sr_cap_label;
427 static int hf_isis_lsp_clv_sr_alg;
428 static int hf_isis_lsp_clv_sr_lb_flags;
429 static int hf_isis_lsp_clv_srv6_cap_flags;
430 static int hf_isis_lsp_clv_srv6_cap_flags_o;
431 static int hf_isis_lsp_clv_srv6_cap_flags_reserved;
432 static int hf_isis_lsp_clv_igp_msd_type;
433 static int hf_isis_lsp_clv_igp_msd_value;
434 static int hf_isis_lsp_clv_ext_admin_group;
435 static int hf_isis_lsp_clv_app_sabm_legacy;
436 static int hf_isis_lsp_clv_app_sabm_length;
437 static int hf_isis_lsp_clv_app_sabm_bits;
438 static int hf_isis_lsp_clv_app_sabm_bits_r;
439 static int hf_isis_lsp_clv_app_sabm_bits_s;
440 static int hf_isis_lsp_clv_app_sabm_bits_f;
441 static int hf_isis_lsp_clv_app_sabm_bits_x;
442 static int hf_isis_lsp_clv_app_udabm_reserved;
443 static int hf_isis_lsp_clv_app_udabm_length;
444 static int hf_isis_lsp_clv_app_udabm_bits;
445 static int hf_isis_lsp_clv_flex_algo_algorithm;
446 static int hf_isis_lsp_clv_flex_algo_metric_type;
447 static int hf_isis_lsp_clv_flex_algo_calc_type;
448 static int hf_isis_lsp_clv_flex_algo_priority;
449 static int hf_isis_lsp_clv_flex_algo_def_flags;
450 static int hf_isis_lsp_clv_flex_algo_def_flags_m;
451 static int hf_isis_lsp_clv_flex_algo_srlg_value;
452 static int hf_isis_lsp_clv_flex_algo_prefix_metric;
453 static int hf_isis_lsp_clv_srv6_endx_sid_system_id;
454 static int hf_isis_lsp_clv_srv6_endx_sid_flags;
455 static int hf_isis_lsp_clv_srv6_endx_sid_flags_b;
456 static int hf_isis_lsp_clv_srv6_endx_sid_flags_s;
457 static int hf_isis_lsp_clv_srv6_endx_sid_flags_p;
458 static int hf_isis_lsp_clv_srv6_endx_sid_flags_reserved;
459 static int hf_isis_lsp_clv_srv6_endx_sid_alg;
460 static int hf_isis_lsp_clv_srv6_endx_sid_weight;
461 static int hf_isis_lsp_clv_srv6_endx_sid_endpoint_behavior;
462 static int hf_isis_lsp_clv_srv6_endx_sid_sid;
463 static int hf_isis_lsp_clv_srv6_endx_sid_subsubclvs_len;
464 static int hf_isis_lsp_area_address;
465 static int hf_isis_lsp_instance_identifier;
466 static int hf_isis_lsp_supported_itid;
467 static int hf_isis_lsp_clv_nlpid_nlpid;
468 static int hf_isis_lsp_ip_authentication;
469 static int hf_isis_lsp_authentication;
470 static int hf_isis_lsp_area_address_str;
471 static int hf_isis_lsp_is_virtual;
472 static int hf_isis_lsp_group;
473 static int hf_isis_lsp_default;
474 static int hf_isis_lsp_default_support;
475 static int hf_isis_lsp_delay;
476 static int hf_isis_lsp_delay_support;
477 static int hf_isis_lsp_expense;
478 static int hf_isis_lsp_expense_support;
479 static int hf_isis_lsp_error;
480 static int hf_isis_lsp_error_support;
481 static int hf_isis_lsp_clv_ipv6_te_router_id;
482 static int hf_isis_lsp_ext_is_reachability_ipv6_interface_address;
483 static int hf_isis_lsp_ext_is_reachability_ipv6_neighbor_address;
484 static int hf_isis_lsp_clv_bier_alg;
485 static int hf_isis_lsp_clv_bier_igp_alg;
486 static int hf_isis_lsp_clv_bier_subdomain;
487 static int hf_isis_lsp_clv_bier_bfrid;
488 static int hf_isis_lsp_clv_bier_subsub_type;
489 static int hf_isis_lsp_clv_bier_subsub_len;
490 static int hf_isis_lsp_clv_bier_subsub_mplsencap_maxsi;
491 static int hf_isis_lsp_clv_bier_subsub_mplsencap_bslen;
492 static int hf_isis_lsp_clv_bier_subsub_mplsencap_label;
493 static int hf_isis_lsp_srv6_loc_metric;
494 static int hf_isis_lsp_srv6_loc_flags;
495 static int hf_isis_lsp_srv6_loc_flags_d;
496 static int hf_isis_lsp_srv6_loc_flags_reserved;
497 static int hf_isis_lsp_srv6_loc_alg;
498 static int hf_isis_lsp_srv6_loc_size;
499 static int hf_isis_lsp_srv6_loc_locator;
500 static int hf_isis_lsp_srv6_loc_subclvs_len;
501 static int hf_isis_lsp_srv6_loc_sub_tlv_type;
502 static int hf_isis_lsp_srv6_loc_sub_tlv_length;
503 static int hf_isis_lsp_clv_srv6_end_sid_flags;
504 static int hf_isis_lsp_clv_srv6_end_sid_endpoint_behavior;
505 static int hf_isis_lsp_clv_srv6_end_sid_sid;
506 static int hf_isis_lsp_clv_srv6_end_sid_subsubclvs_len;
507 static int hf_isis_lsp_clv_srv6_sid_struct_lb_len;
508 static int hf_isis_lsp_clv_srv6_sid_struct_ln_len;
509 static int hf_isis_lsp_clv_srv6_sid_struct_fun_len;
510 static int hf_isis_lsp_clv_srv6_sid_struct_arg_len;
511 static int hf_isis_lsp_purge_orig_id_num;
512 static int hf_isis_lsp_purge_orig_id_system_id;
513 /* rfc 6165: MAC Reachability */
514 static int hf_isis_lsp_mac_reachability_topoid_nick;
515 static int hf_isis_lsp_mac_reachability_confidence;
516 static int hf_isis_lsp_mac_reachability_reserved;
517 static int hf_isis_lsp_mac_reachability_vlan;
518 static int hf_isis_lsp_mac_reachability_mac;
519 static int hf_isis_lsp_mac_reachability_chassismac;
520 static int hf_isis_lsp_mac_reachability_fanmcast;
521 /* Avaya proprietary */
522 static int hf_isis_lsp_avaya_ipvpn_unknown;
523 static int hf_isis_lsp_avaya_ipvpn_system_id;
524 static int hf_isis_lsp_avaya_ipvpn_vrfsid;
525 static int hf_isis_lsp_avaya_ipvpn_subtlvbytes;
526 static int hf_isis_lsp_avaya_ipvpn_subtlvtype;
527 static int hf_isis_lsp_avaya_ipvpn_subtlvlength;
528 static int hf_isis_lsp_avaya_ipvpn_unknown_sub;
529 static int hf_isis_lsp_avaya_ipvpn_ipv4_metric;
530 static int hf_isis_lsp_avaya_ipvpn_ipv4_metrictype;
531 static int hf_isis_lsp_avaya_ipvpn_ipv4_addr;
532 static int hf_isis_lsp_avaya_ipvpn_ipv4_mask;
533 static int hf_isis_lsp_avaya_ipvpn_ipv6_metric;
534 static int hf_isis_lsp_avaya_ipvpn_ipv6_prefixlen;
535 static int hf_isis_lsp_avaya_ipvpn_ipv6_prefix;
536 static int hf_isis_lsp_avaya_185_unknown;
537 static int hf_isis_lsp_avaya_186_unknown;
539 static int ett_isis_lsp;
540 static int ett_isis_lsp_info;
541 static int ett_isis_lsp_att;
542 static int ett_isis_lsp_cksum;
543 static int ett_isis_lsp_clv_area_addr;
544 static int ett_isis_lsp_clv_is_neighbors;
545 static int ett_isis_lsp_clv_instance_identifier;
546 static int ett_isis_lsp_clv_ext_is_reachability; /* CLV 22 */
547 static int ett_isis_lsp_part_of_clv_ext_is_reachability;
548 static int ett_isis_lsp_part_of_clv_ext_is_reachability_subtlv;
549 static int ett_isis_lsp_subclv_admin_group;
550 static int ett_isis_lsp_subclv_unrsv_bw;
551 static int ett_isis_lsp_subclv_bw_ct;
552 static int ett_isis_lsp_subclv_spb_link_metric;
553 static int ett_isis_lsp_adj_sid_flags;
554 static int ett_isis_lsp_clv_unknown;
555 static int ett_isis_lsp_clv_partition_dis;
556 static int ett_isis_lsp_clv_prefix_neighbors;
557 static int ett_isis_lsp_clv_nlpid_nlpid;
558 static int ett_isis_lsp_clv_hostname;
559 static int ett_isis_lsp_clv_srlg;
560 static int ett_isis_lsp_clv_appspec_srlg;
561 static int ett_isis_lsp_clv_appspec_srlg_subtlv;
562 static int ett_isis_lsp_clv_te_router_id;
563 static int ett_isis_lsp_clv_authentication;
564 static int ett_isis_lsp_clv_ip_authentication;
565 static int ett_isis_lsp_clv_ipv4_int_addr;
566 static int ett_isis_lsp_clv_ipv6_int_addr; /* CLV 232 */
567 static int ett_isis_lsp_clv_mt_cap;
568 static int ett_isis_lsp_clv_mt_cap_spb_instance;
569 static int ett_isis_lsp_clv_mt_cap_spbm_service_identifier;
570 static int ett_isis_lsp_clv_mt_cap_spbv_mac_address;
571 static int ett_isis_lsp_clv_sid_label_binding;
572 static int ett_isis_lsp_clv_ip_reachability;
573 static int ett_isis_lsp_clv_ip_reach_subclv;
574 static int ett_isis_lsp_clv_ext_ip_reachability; /* CLV 135 */
575 static int ett_isis_lsp_part_of_clv_ext_ip_reachability;
576 static int ett_isis_lsp_clv_ipv6_reachability; /* CLV 236 */
577 static int ett_isis_lsp_part_of_clv_ipv6_reachability;
578 static int ett_isis_lsp_prefix_sid_flags;
579 static int ett_isis_lsp_prefix_attr_flags;
580 static int ett_isis_lsp_clv_mt;
581 static int ett_isis_lsp_clv_mt_is;
582 static int ett_isis_lsp_part_of_clv_mt_is;
583 static int ett_isis_lsp_clv_mt_reachable_IPv4_prefx; /* CLV 235 */
584 static int ett_isis_lsp_clv_mt_reachable_IPv6_prefx; /* CLV 237 */
585 static int ett_isis_lsp_clv_rt_capable; /* CLV 242 */
586 static int ett_isis_lsp_clv_te_node_cap_desc;
587 static int ett_isis_lsp_clv_sr_cap;
588 static int ett_isis_lsp_clv_sr_sid_label;
589 static int ett_isis_lsp_clv_sr_alg;
590 static int ett_isis_lsp_clv_sr_lb;
591 static int ett_isis_lsp_clv_node_msd;
592 static int ett_isis_lsp_clv_srv6_cap;
593 static int ett_isis_lsp_clv_srv6_cap_flags;
594 static int ett_isis_lsp_clv_flex_algo_def;
595 static int ett_isis_lsp_clv_flex_algo_def_sub_tlv;
596 static int ett_isis_lsp_clv_app_sabm_bits;
597 static int ett_isis_lsp_clv_ipv6_te_rtrid;
598 static int ett_isis_lsp_clv_trill_version;
599 static int ett_isis_lsp_clv_trees;
600 static int ett_isis_lsp_clv_root_id;
601 static int ett_isis_lsp_clv_nickname;
602 static int ett_isis_lsp_clv_interested_vlans;
603 static int ett_isis_lsp_clv_tree_used;
604 static int ett_isis_lsp_clv_vlan_group;
605 static int ett_isis_lsp_clv_grp_address; /* CLV 142 */
606 static int ett_isis_lsp_clv_grp_macaddr;
607 static int ett_isis_lsp_clv_grp_ipv4addr;
608 static int ett_isis_lsp_clv_grp_ipv6addr;
609 static int ett_isis_lsp_clv_grp_unknown;
610 static int ett_isis_lsp_clv_purge_orig_id; /* CLV 13 */
611 static int ett_isis_lsp_clv_originating_buff_size; /* CLV 14 */
612 static int ett_isis_lsp_sl_flags;
613 static int ett_isis_lsp_sl_sub_tlv;
614 static int ett_isis_lsp_sl_sub_tlv_flags;
615 static int ett_isis_lsp_clv_ipv6_te_router_id;
616 static int ett_isis_lsp_clv_bier_subsub_tlv;
617 static int ett_isis_lsp_clv_srv6_locator;
618 static int ett_isis_lsp_clv_srv6_loc_entry;
619 static int ett_isis_lsp_clv_srv6_loc_flags;
620 static int ett_isis_lsp_clv_srv6_loc_sub_tlv;
621 static int ett_isis_lsp_clv_srv6_loc_end_sid_sub_sub_tlv;
622 static int ett_isis_lsp_clv_srv6_endx_sid_flags;
623 static int ett_isis_lsp_clv_srv6_endx_sid_sub_sub_tlv;
624 static int ett_isis_lsp_clv_unidir_link_flags;
625 static int ett_isis_lsp_clv_mac_reachability;
626 static int ett_isis_lsp_clv_avaya_ipvpn;
627 static int ett_isis_lsp_clv_avaya_ipvpn_subtlv;
628 static int ett_isis_lsp_clv_avaya_ipvpn_mc;
629 static int ett_isis_lsp_clv_avaya_ip_grt_mc;
632 static expert_field ei_isis_lsp_short_pdu;
633 static expert_field ei_isis_lsp_long_pdu;
634 static expert_field ei_isis_lsp_bad_checksum;
635 static expert_field ei_isis_lsp_subtlv;
636 static expert_field ei_isis_lsp_authentication;
637 static expert_field ei_isis_lsp_short_clv;
638 static expert_field ei_isis_lsp_long_clv;
639 static expert_field ei_isis_lsp_length_clv;
640 static expert_field ei_isis_lsp_clv_mt;
641 static expert_field ei_isis_lsp_clv_unknown;
642 static expert_field ei_isis_lsp_malformed_subtlv;
643 static expert_field ei_isis_lsp_unknown_subtlv;
644 static expert_field ei_isis_lsp_reserved_not_zero;
645 static expert_field ei_isis_lsp_length_invalid;
647 static const value_string isis_lsp_istype_vals[] = {
648 { ISIS_LSP_TYPE_UNUSED0, "Unused 0x0 (invalid)"},
649 { ISIS_LSP_TYPE_LEVEL_1, "Level 1"},
650 { ISIS_LSP_TYPE_UNUSED2, "Unused 0x2 (invalid)"},
651 { ISIS_LSP_TYPE_LEVEL_2, "Level 2"},
652 { 0, NULL } };
654 static const value_string isis_lsp_sl_sub_tlv_vals[] = {
655 { ISIS_LSP_SL_SUB_SID_LABEL, "SID/Label"},
656 { ISIS_LSP_SL_SUB_PREFIX_SID, "Prefix SID"},
657 { ISIS_LSP_SL_SUB_ADJ_SID, "Adjacency SID"},
658 { ISIS_LSP_SL_SUB_LAN_ADJ_SID,"LAN-Adjacency SID"},
659 { 0, NULL } };
661 /* rfc8986 */
662 /* draft-filsfils-spring-net-pgm-extension-srv6-usid-15 */
663 static const value_string srv6_endpoint_type_vals[] = {
664 { 1, "End" },
665 { 2, "End (PSP)" },
666 { 3, "End (USP)" },
667 { 4, "End (PSP/USP)" },
668 { 5, "End.X" },
669 { 6, "End.X (PSP)" },
670 { 7, "End.X (USP)" },
671 { 8, "End.X (PSP/USP)" },
672 { 9, "End.T" },
673 { 10, "End.T (PSP)" },
674 { 11, "End.T (USP)" },
675 { 12, "End.T (PSP/USP)" },
676 { 13, "Unassigned" },
677 { 14, "End.B6.Encaps" },
678 { 15, "End.BM" },
679 { 16, "End.DX6" },
680 { 17, "End.DX4" },
681 { 18, "End.DT6" },
682 { 19, "End.DT4" },
683 { 20, "End.DT46" },
684 { 21, "End.DX2" },
685 { 22, "End.DX2V" },
686 { 23, "End.DT2U" },
687 { 24, "End.DT2M" },
688 { 25, "Reserved" },
689 { 26, "Unassigned" },
690 { 27, "End.B6.Encaps.Red" },
691 { 28, "End (USD)" },
692 { 29, "End (PSP/USD)" },
693 { 30, "End (USP/USD)" },
694 { 31, "End (PSP/USP/USD)" },
695 { 32, "End.X (USD)" },
696 { 33, "End.X (PSP/USD)" },
697 { 34, "End.X (USP/USD)" },
698 { 35, "End.X (PSP/USP/USD)" },
699 { 36, "End.T (USD)" },
700 { 37, "End.T (PSP/USD)" },
701 { 38, "End.T (USP/USD)" },
702 { 39, "End.T (PSP/USP/USD)" },
703 { 42, "End (NEXT-ONLY-CSID)" },
704 { 43, "End (NEXT-CSID)" },
705 { 44, "End (NEXT-CSID/PSP)" },
706 { 45, "End (NEXT-CSID/USP)" },
707 { 46, "End (NEXT-CSID/PSP/USP)" },
708 { 47, "End (NEXT-CSID/USD)" },
709 { 48, "End (NEXT-CSID/PSP/USD)" },
710 { 49, "End (NEXT-CSID/USP/USD)" },
711 { 50, "End (NEXT-CSID/PSP/USP/USD)" },
712 { 51, "End.X (NEXT-ONLY-CSID)" },
713 { 52, "End.X (NEXT-CSID)" },
714 { 53, "End.X (NEXT-CSID/PSP)" },
715 { 54, "End.X (NEXT-CSID/USP)" },
716 { 55, "End.X (NEXT-CSID/PSP/USP)" },
717 { 56, "End.X (NEXT-CSID/USD)" },
718 { 57, "End.X (NEXT-CSID/PSP/USD)" },
719 { 58, "End.X (NEXT-CSID/USP/USD)" },
720 { 59, "End.X (NEXT-CSID/PSP/USP/USD)" },
721 { 60, "End.DX6 (NEXT-CSID)" },
722 { 61, "End.DX4 (NEXT-CSID)" },
723 { 62, "End.DT6 (NEXT-CSID)" },
724 { 63, "End.DT4 (NEXT-CSID)" },
725 { 64, "End.DT46 (NEXT-CSID)" },
726 { 65, "End.DX2 (NEXT-CSID)" },
727 { 66, "End.DX2V (NEXT-CSID)" },
728 { 67, "End.DT2U (NEXT-CSID)" },
729 { 68, "End.DT2M (NEXT-CSID)" },
730 { 0, NULL }
733 static const value_string isis_lsp_srv6_loc_sub_tlv_vals[] = {
734 { 4, "Prefix Attribute Flags"},
735 { 5, "SRv6 End SID"},
736 { 0, NULL } };
738 static const value_string isis_lsp_srv6_loc_end_sid_sub_sub_tlv_vals[] = {
739 { 1, "SRv6 SID Structure"},
740 { 0, NULL } };
742 static int * const adj_sid_flags[] = {
743 &hf_isis_lsp_adj_sid_family_flag,
744 &hf_isis_lsp_adj_sid_backup_flag,
745 &hf_isis_lsp_adj_sid_value_flag,
746 &hf_isis_lsp_adj_sid_local_flag,
747 &hf_isis_lsp_adj_sid_set_flag,
748 NULL,
751 static int * const srv6_cap_flags[] = {
752 &hf_isis_lsp_clv_srv6_cap_flags_o,
753 &hf_isis_lsp_clv_srv6_cap_flags_reserved,
754 NULL,
757 static int * const srv6_locator_flags[] = {
758 &hf_isis_lsp_srv6_loc_flags_d,
759 &hf_isis_lsp_srv6_loc_flags_reserved,
760 NULL,
763 static int * const srv6_endx_sid_flags[] = {
764 &hf_isis_lsp_clv_srv6_endx_sid_flags_b,
765 &hf_isis_lsp_clv_srv6_endx_sid_flags_s,
766 &hf_isis_lsp_clv_srv6_endx_sid_flags_p,
767 &hf_isis_lsp_clv_srv6_endx_sid_flags_reserved,
768 NULL,
771 static int * const prefix_sid_flags[] = {
772 &hf_isis_lsp_ext_ip_reachability_prefix_re_adv_flag,
773 &hf_isis_lsp_ext_ip_reachability_prefix_node_sid_flag,
774 &hf_isis_lsp_ext_ip_reachability_prefix_nophp_flag,
775 &hf_isis_lsp_ext_ip_reachability_prefix_expl_null_flag,
776 &hf_isis_lsp_ext_ip_reachability_prefix_value_flag,
777 &hf_isis_lsp_ext_ip_reachability_prefix_local_flag,
778 NULL,
781 static int * const prefix_attr_flags[] = {
782 &hf_isis_lsp_prefix_attr_flags_x,
783 &hf_isis_lsp_prefix_attr_flags_r,
784 &hf_isis_lsp_prefix_attr_flags_n,
785 NULL,
788 static const true_false_string tfs_ipv6_ipv4 = { "IPv6", "IPv4" };
790 static const value_string isis_igp_alg_vals[] = {
791 { ISIS_ALG_SPF, "Shortest Path First (SPF)" },
792 { ISIS_ALG_SSPF, "Strict Shortest Path First (SPF)" },
793 { 0, NULL }
796 static const value_string isis_lsp_igp_msd_types[] = {
797 { IGP_MSD_TYPE_RESERVED, "Reserved" },
798 { IGP_MSD_TYPE_MPLS, "Base MPLS Imposition" },
799 { IGP_MSD_TYPE_SEGMENT_LEFT, "Maximum Segments Left" },
800 { IGP_MSD_TYPE_END_POP, "Maximum End Pop" },
801 { IGP_MSD_TYPE_H_ENCAP, "Maximum H.Encaps" },
802 { IGP_MSD_TYPE_END_D, "Maximum End D" },
803 { 0, NULL }
806 static const value_string isis_lsp_flex_algo_metric_type_vals[] = {
807 { 0, "IGP Metric"},
808 { 1, "Min Unidirectional Link Delay"},
809 { 2, "TE Metric"},
810 { 0, NULL }
813 static const value_string isis_lsp_flex_algo_sub_tlv_vals[] = {
814 { FAD_EXCLUDE_AG, "Flexible Algorithm Exclude Admin Group"},
815 { FAD_INCLUDE_ANY_AG, "Flexible Algorithm Include-Any Admin Group"},
816 { FAD_INCLUDE_ALL_AG, "Flexible Algorithm Include-All Admin Group"},
817 { FAD_DEF_FLAGS, "Flexible Algorithm Definition Flags"},
818 { FAD_EXCLUDE_SRLG, "Flexible Algorithm Exclude SRLG"},
819 { 0, NULL } };
821 static int * const isis_lsp_app_sabm_bits[] = {
822 &hf_isis_lsp_clv_app_sabm_bits_r,
823 &hf_isis_lsp_clv_app_sabm_bits_s,
824 &hf_isis_lsp_clv_app_sabm_bits_f,
825 &hf_isis_lsp_clv_app_sabm_bits_x,
826 NULL,
829 static const value_string isis_lsp_appspec_srlg_sub_tlv_vals[] = {
830 { 4, "Link Local/Remote Identifiers" },
831 { 6, "IPv4 Interface Address" },
832 { 8, "IPv4 Neighbor Address" },
833 { 12, "IPv6 Interface Address" },
834 { 13, "IPv6 Neighbor Address" },
835 { 0, NULL } };
837 static const value_string isis_lsp_grp_types[] = {
838 { GRP_MAC_ADDRESS, "MAC address" },
839 { GRP_IPV4_ADDRESS, "IPv4 address" },
840 { GRP_IPV6_ADDRESS, "IPv6 address" },
841 { 0, NULL }
844 static int * const unidir_link_flags[] = {
845 &hf_isis_lsp_ext_is_reachability_unidir_link_flags_a,
846 NULL,
850 http://www.iana.org/assignments/isis-tlv-codepoints/isis-tlv-codepoints.xhtml#isis-tlv-codepoints-22-23-141-222-223
851 https://tools.ietf.org/html/rfc8667
853 static const value_string isis_lsp_ext_is_reachability_code_vals[] = {
854 { 3, "Administrative group (color)" },
855 { 4, "Link Local/Remote Identifiers" },
856 { 6, "IPv4 interface address" },
857 { 8, "IPv4 neighbor address" },
858 { 9, "Maximum link bandwidth" },
859 { 10, "Maximum reservable link bandwidth" },
860 { 11, "Unreserved bandwidth" },
861 { 12, "IPv6 Interface Address" },
862 { 13, "IPv6 Neighbor Address" },
863 { 14, "Extended Administrative Group" },
864 { 15, "Link Maximum SID Depth" },
865 { 16, "Application-Specific Link Attributes" },
866 { 18, "TE Default metric" },
867 { 19, "Link-attributes" },
868 { 20, "Link Protection Type" },
869 { 21, "Interface Switching Capability Descriptor" },
870 { 22, "Bandwidth Constraints" },
871 { 23, "Unconstrained TE LSP Count (sub-)TLV" },
872 { 24, "Remote AS number" },
873 { 25, "IPv4 remote ASBR Identifier" },
874 { 26, "IPv6 remote ASBR Identifier" },
875 { 27, "Interface Adjustment Capability Descriptor (IACD)" },
876 { 28, "MTU" },
877 { 29, "SPB-Metric" },
878 { 30, "SPB-A-OALG" },
879 { 31, "Adj-SID" },
880 { 32, "LAN-Adj-SID" },
881 { 33, "Unidirectional Link Delay"},
882 { 34, "Min/Max Unidirectional Link Delay"},
883 { 35, "Unidirectional Delay Variation"},
884 { 36, "Unidirectional Link Loss"},
885 { 37, "Unidirectional Residual Bandwidth"},
886 { 38, "Unidirectional Available Bandwidth"},
887 { 39, "Unidirectional Utilized Bandwidth"},
888 { 43, "SRv6 End.X SID" }, /* Suggested Value */
889 { 44, "SRv6 LAN End.X SID" }, /* Suggested Value */
890 { 250, "Reserved for Cisco-specific extensions" },
891 { 251, "Reserved for Cisco-specific extensions" },
892 { 252, "Reserved for Cisco-specific extensions" },
893 { 253, "Reserved for Cisco-specific extensions" },
894 { 254, "Reserved for Cisco-specific extensions" },
895 { 0, NULL }
899 From: https://www.iana.org/assignments/isis-tlv-codepoints/isis-tlv-codepoints.xhtml
900 Sub-TLVs for TLVs 135, 235, 236, and 237
902 #define IP_REACH_SUBTLV_32BIT_ADMIN_TAG 1
903 #define IP_REACH_SUBTLV_64BIT_ADMIN_TAG 2
904 #define IP_REACH_SUBTLV_PFX_SID 3
905 #define IP_REACH_SUBTLV_PFX_ATTRIB_FLAG 4
906 #define IP_REACH_SUBTLV_FAPM 6
907 #define IP_REACH_SUBTLV_BIER_INFO 32
909 static const value_string isis_lsp_ext_ip_reachability_code_vals[] = {
910 { IP_REACH_SUBTLV_32BIT_ADMIN_TAG, "32-bit Administrative Tag" },
911 { IP_REACH_SUBTLV_64BIT_ADMIN_TAG, "64-bit Administrative Tag" },
912 { IP_REACH_SUBTLV_PFX_SID, "Prefix-SID" },
913 { IP_REACH_SUBTLV_PFX_ATTRIB_FLAG, "Prefix Attribute Flags" },
914 { IP_REACH_SUBTLV_FAPM, "Flexible Algorithm Prefix Metric" },
915 { IP_REACH_SUBTLV_BIER_INFO, "BIER Info" },
916 { 0, NULL }
920 From: https://www.iana.org/assignments/bier/bier.xhtml
921 BIER Algorithm
923 static const range_string isis_lsp_bier_alg_vals[] = {
924 { 0, 0, "No BIER specific algorithm is used" },
925 { 240, 255, "Experimental Use" },
926 { 0, 0, NULL }
930 From: https://www.iana.org/assignments/isis-tlv-codepoints/isis-tlv-codepoints.xhtml
931 sub-sub-TLVs for BIER Info sub-TLV
933 static const value_string isis_lsp_bier_subsubtlv_type_vals[] = {
934 { 1, "BIER MPLS Encapsulation" },
935 { 0, NULL }
938 /* Avaya specific sub-TLV types */
939 static const value_string isis_lsp_avaya_ipvpn_subtlv_code_vals[] = {
940 { 1, "IPv4 Metric Type" },
941 { 135, "IPv4 Reachability" },
942 { 236, "IPv6 Reachability" },
943 { 0, NULL }
947 * Name: dissect_lsp_mt_id()
949 * Description:
950 * dissect and display the multi-topology ID value
952 * Input:
953 * tvbuff_t * : tvbuffer for packet data
954 * proto_tree * : protocol display tree to fill out. CAN'T BE NULL
955 * int : offset into packet data where we are.
957 * Output:
958 * void, but we will add to proto tree.
960 static void
961 dissect_lsp_mt_id(tvbuff_t *tvb, proto_tree *tree, int offset)
964 proto_tree_add_item(tree, hf_isis_lsp_mt_id_reserved, tvb, offset, 2, ENC_BIG_ENDIAN);
966 proto_tree_add_item(tree, hf_isis_lsp_mt_id, tvb, offset, 2, ENC_BIG_ENDIAN);
971 * Name: dissect_metric()
973 * Description:
974 * Display a metric prefix portion. ISIS has the concept of multiple
975 * metric per prefix (default, delay, expense, and error). This
976 * routine assists other dissectors by adding a single one of
977 * these to the display tree..
979 * The 8th(msbit) bit in the metric octet is the "supported" bit. The
980 * "default" support is required, so we support a "force_supported"
981 * flag that tells us that it MUST be zero (zero==supported,
982 * so it really should be a "not supported" in the boolean sense)
983 * and to display a protocol failure accordingly. Notably,
984 * Cisco IOS 12(6) blows this!
985 * The 7th bit must be zero (reserved).
987 * Input:
988 * tvbuff_t * : tvbuffer for packet data
989 * proto_tree * : protocol display tree to fill out. May be NULL
990 * int : offset into packet data where we are.
991 * int : hf of the metric.
992 * int : hf_support of the metric.
993 * int : force supported. True is the supported bit MUST be zero.
995 * Output:
996 * void, but we will add to proto tree if !NULL.
998 static void
999 dissect_metric(tvbuff_t *tvb, packet_info* pinfo, proto_tree *tree, int offset,
1000 int hf, int hf_support, int force_supported )
1002 uint8_t metric;
1003 proto_item *item, *support_item;
1005 metric = tvb_get_uint8(tvb, offset);
1006 support_item = proto_tree_add_boolean(tree, hf_support, tvb, offset, 1, metric);
1007 item = proto_tree_add_uint(tree, hf, tvb, offset, 1, metric);
1009 if (!ISIS_LSP_CLV_METRIC_SUPPORTED(metric) && force_supported)
1010 proto_item_append_text(support_item, " (but is required to be)");
1012 if (ISIS_LSP_CLV_METRIC_RESERVED(metric))
1013 expert_add_info(pinfo, item, &ei_isis_lsp_reserved_not_zero);
1017 * Name: dissect_lsp_ip_reachability_clv()
1019 * Description:
1020 * Decode an IP reachability CLV. This can be either internal or
1021 * external (the clv format does not change and which type we are
1022 * displaying is put there by the dispatcher). All of these
1023 * are a metric block followed by an IP addr and mask.
1025 * Input:
1026 * tvbuff_t * : tvbuffer for packet data
1027 * proto_tree * : proto tree to build on (may be null)
1028 * int : current offset into packet data
1029 * int : length of IDs in packet.
1030 * int : length of this clv
1032 * Output:
1033 * void, will modify proto_tree if not null.
1035 static void
1036 dissect_lsp_ip_reachability_clv(tvbuff_t *tvb, packet_info* pinfo, proto_tree *tree, int offset,
1037 isis_data_t *isis _U_, int length)
1039 proto_item *ti;
1040 proto_tree *ntree = NULL;
1041 uint32_t src, mask, bitmask;
1042 int prefix_len;
1043 bool found_mask = false;
1045 while ( length > 0 ) {
1046 if (length<12) {
1047 proto_tree_add_expert_format(tree, pinfo, &ei_isis_lsp_short_clv, tvb, offset, -1,
1048 "short IP reachability (%d vs 12)", length );
1049 return;
1052 * Gotta build a sub-tree for all our pieces
1054 if ( tree ) {
1055 src = tvb_get_ipv4(tvb, offset+4);
1056 mask = tvb_get_ntohl(tvb, offset+8);
1058 /* find out if the mask matches one of 33 possible prefix lengths */
1059 bitmask = 0xffffffff;
1060 for(prefix_len = 32; prefix_len >= 0; prefix_len--) {
1061 if (bitmask==mask) {
1062 found_mask = true;
1063 break;
1065 bitmask = bitmask << 1;
1068 /* If we have a discontiguous netmask, dump the mask, otherwise print the prefix_len */
1069 /* XXX - We should probably have some sort of netmask_to_str() routine in to_str.c that does this. */
1071 if(found_mask) {
1072 ti = proto_tree_add_ipv4_format_value( tree, hf_isis_lsp_ip_reachability_ipv4_prefix, tvb, offset, 12,
1073 src, "%s/%d", tvb_ip_to_str(pinfo->pool, tvb, offset+4), prefix_len );
1074 } else {
1075 ti = proto_tree_add_ipv4_format_value( tree, hf_isis_lsp_ip_reachability_ipv4_prefix, tvb, offset, 12,
1076 src, "%s mask %s", tvb_ip_to_str(pinfo->pool, tvb, offset+4), tvb_ip_to_str(pinfo->pool, tvb, offset+8));
1079 ntree = proto_item_add_subtree(ti, ett_isis_lsp_clv_ip_reachability);
1081 proto_tree_add_item(ntree, hf_isis_lsp_ip_reachability_default_metric, tvb, offset, 1, ENC_BIG_ENDIAN);
1082 proto_tree_add_item(ntree, hf_isis_lsp_ip_reachability_default_metric_ie, tvb, offset, 1, ENC_NA);
1083 proto_tree_add_item(ntree, hf_isis_lsp_ip_reachability_distribution, tvb, offset, 1, ENC_NA);
1085 proto_tree_add_item(ntree, hf_isis_lsp_ip_reachability_delay_metric, tvb, offset+1, 1, ENC_BIG_ENDIAN);
1086 proto_tree_add_item(ntree, hf_isis_lsp_ip_reachability_delay_metric_support, tvb, offset+1, 1, ENC_NA);
1087 proto_tree_add_item(ntree, hf_isis_lsp_ip_reachability_delay_metric_ie, tvb, offset+1, 1, ENC_NA);
1089 proto_tree_add_item(ntree, hf_isis_lsp_ip_reachability_expense_metric, tvb, offset+2, 1, ENC_BIG_ENDIAN);
1090 proto_tree_add_item(ntree, hf_isis_lsp_ip_reachability_expense_metric_support, tvb, offset+2, 1, ENC_NA);
1091 proto_tree_add_item(ntree, hf_isis_lsp_ip_reachability_expense_metric_ie, tvb, offset+2, 1, ENC_NA);
1093 proto_tree_add_item(ntree, hf_isis_lsp_ip_reachability_error_metric, tvb, offset+3, 1, ENC_BIG_ENDIAN);
1094 proto_tree_add_item(ntree, hf_isis_lsp_ip_reachability_error_metric_support, tvb, offset+3, 1, ENC_NA);
1095 proto_tree_add_item(ntree, hf_isis_lsp_ip_reachability_error_metric_ie, tvb, offset+3, 1, ENC_NA);
1097 offset += 12;
1098 length -= 12;
1104 * Name: dissect_bierinfo_subsubtlv()
1106 * Description:
1107 * Decodes a BIER Info sub-sub-TLV (RFC 8401)
1109 * Input:
1110 * tvbuff_t * : tvbuffer for packet data
1111 * proto_tree * : proto tree to build on (may be null)
1112 * int : current offset into packet data
1114 * Output:
1115 * void, will modify proto_tree if not null.
1117 static void
1118 dissect_bierinfo_subsubtlv (tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
1119 int offset, int tlv_type, int tlv_len)
1121 switch (tlv_type) {
1122 case 1:
1123 if (tlv_len != 4) {
1124 proto_tree_add_expert_format(tree, pinfo, &ei_isis_lsp_malformed_subtlv,
1125 tvb, offset, tlv_len, "TLV length (%d) != 4 bytes", tlv_len);
1126 return;
1128 proto_tree_add_item(tree, hf_isis_lsp_clv_bier_subsub_mplsencap_maxsi, tvb, offset, 1, ENC_BIG_ENDIAN);
1129 proto_tree_add_item(tree, hf_isis_lsp_clv_bier_subsub_mplsencap_bslen, tvb, offset+1, 1, ENC_BIG_ENDIAN);
1130 proto_tree_add_item(tree, hf_isis_lsp_clv_bier_subsub_mplsencap_label, tvb, offset+1, 3, ENC_BIG_ENDIAN);
1131 break;
1132 default:
1133 break;
1136 return;
1141 * Name: dissect_bierinfo_subtlv()
1143 * Description:
1144 * Decodes a BIER Info sub-TLV (RFC 8401)
1146 * Input:
1147 * tvbuff_t * : tvbuffer for packet data
1148 * proto_tree * : proto tree to build on (may be null)
1149 * int : current offset into packet data
1151 * Output:
1152 * void, will modify proto_tree if not null.
1154 static void
1155 dissect_bierinfo_subtlv (tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
1156 int offset, int tlv_len)
1158 int min_tlv_len = 5;
1159 int len = tlv_len;
1160 unsigned subsub_type, subsub_len;
1161 proto_tree *subsub_tree = NULL;
1162 proto_item *ti_subsub = NULL;
1164 if (tlv_len < min_tlv_len) {
1165 proto_tree_add_expert_format(tree, pinfo, &ei_isis_lsp_malformed_subtlv,
1166 tvb, offset-2, tlv_len+2,
1167 "Invalid length (%d) bytes for BIER Info sub-TLV: Minimum length (%d) bytes",
1168 tlv_len+2, min_tlv_len+2);
1169 return;
1171 proto_tree_add_item(tree, hf_isis_lsp_clv_bier_alg, tvb, offset, 1, ENC_BIG_ENDIAN);
1172 offset += 1;
1173 proto_tree_add_item(tree, hf_isis_lsp_clv_bier_igp_alg, tvb, offset, 1, ENC_BIG_ENDIAN);
1174 offset += 1;
1175 proto_tree_add_item(tree, hf_isis_lsp_clv_bier_subdomain, tvb, offset, 1, ENC_BIG_ENDIAN);
1176 offset += 1;
1177 proto_tree_add_item(tree, hf_isis_lsp_clv_bier_bfrid, tvb, offset, 2, ENC_BIG_ENDIAN);
1178 offset += 2;
1179 len -= 5;
1181 /* Dissect sub-sub-TLVs if present */
1182 min_tlv_len = 2;
1183 while (len > 0) {
1184 if (len < min_tlv_len) {
1185 proto_tree_add_expert_format(tree, pinfo, &ei_isis_lsp_malformed_subtlv,
1186 tvb, offset, len,
1187 "Invalid data length (%d) bytes for BIER Info sub-sub-TLV: Minimum length (%d) bytes",
1188 len, min_tlv_len);
1189 return;
1191 subsub_type = tvb_get_uint8(tvb, offset);
1192 subsub_len = tvb_get_uint8(tvb, offset+1);
1193 subsub_tree = proto_tree_add_subtree(tree, tvb, offset, subsub_len+2,
1194 ett_isis_lsp_clv_bier_subsub_tlv,
1195 &ti_subsub, "sub-subTLV");
1196 proto_tree_add_item(subsub_tree, hf_isis_lsp_clv_bier_subsub_type,
1197 tvb, offset, 1, ENC_BIG_ENDIAN);
1198 offset += 1;
1199 proto_tree_add_item(subsub_tree, hf_isis_lsp_clv_bier_subsub_len,
1200 tvb, offset, 1, ENC_BIG_ENDIAN);
1201 offset += 1;
1202 len -= 2;
1203 proto_item_append_text(ti_subsub, ": %s (t=%u, l=%u)",
1204 val_to_str_const(subsub_type, isis_lsp_bier_subsubtlv_type_vals, "Unknown"),
1205 subsub_type, subsub_len);
1206 dissect_bierinfo_subsubtlv(tvb, pinfo, subsub_tree, offset, subsub_type, subsub_len);
1207 offset += subsub_len;
1208 len -= subsub_len;
1211 return;
1215 * Name: dissect_prefix_attr_flags_subclv()
1217 * Description:
1218 * Decodes a Prefix Attribute Flags sub-TLV (RFC 7794)
1220 * Input:
1221 * tvbuff_t * : tvbuffer for packet data
1222 * packet_info * : expert error misuse reporting
1223 * proto_tree * : proto tree to build on
1224 * tree_item * : proto tree item to build on (may be null)
1225 * int : current offset into packet data
1226 * int : type of this clv
1227 * int : length of this clv
1229 * Output:
1230 * void, will modify proto_tree if not null.
1232 static void
1233 dissect_prefix_attr_flags_subclv(tvbuff_t *tvb, packet_info *pinfo,
1234 proto_tree *tree, proto_item *tree_item,
1235 int offset, int clv_code _U_, int clv_len)
1237 uint8_t flags;
1239 if (clv_len != 1) {
1240 proto_tree_add_expert_format(tree, pinfo, &ei_isis_lsp_malformed_subtlv,
1241 tvb, offset-2, 2,
1242 "Invalid Sub-TLV Length %d (should be 1)", clv_len);
1243 return;
1245 flags = tvb_get_uint8(tvb, offset);
1246 proto_tree_add_bitmask(tree, tvb, offset, hf_isis_lsp_prefix_attr_flags,
1247 ett_isis_lsp_prefix_attr_flags, prefix_attr_flags, ENC_BIG_ENDIAN);
1248 if (tree_item) {
1249 proto_item_append_text(tree_item, ": Flags:%c%c%c",
1250 ((flags & ISIS_LSP_PFX_ATTR_FLAG_X) != 0) ? 'X' : '-',
1251 ((flags & ISIS_LSP_PFX_ATTR_FLAG_R) != 0) ? 'R' : '-',
1252 ((flags & ISIS_LSP_PFX_ATTR_FLAG_N) != 0) ? 'N' : '-');
1257 * Name: dissect_flex_algo_prefix_metric_subclv()
1259 * Description:
1260 * Decodes a Flexible Algorithm Prefix Metric (FAPM) sub-TLV (RFC 9350)
1262 * Input:
1263 * tvbuff_t * : tvbuffer for packet data
1264 * packet_info * : expert error misuse reporting
1265 * proto_tree * : proto tree to build on
1266 * int : current offset into packet data
1267 * int : type of this clv
1268 * int : length of this clv
1270 * Output:
1271 * void, will modify proto_tree if not null.
1273 static void
1274 dissect_flex_algo_prefix_metric_subclv(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
1275 int offset, int clv_code _U_, int clv_len)
1277 if (clv_len != 5) {
1278 proto_tree_add_expert_format(tree, pinfo, &ei_isis_lsp_malformed_subtlv,
1279 tvb, offset-2, 2,
1280 "Invalid Sub-TLV Length %d (should be 5)", clv_len);
1281 return;
1283 proto_tree_add_item(tree, hf_isis_lsp_clv_flex_algo_algorithm, tvb, offset, 1, ENC_NA);
1284 proto_tree_add_item(tree, hf_isis_lsp_clv_flex_algo_prefix_metric, tvb, offset+1, 4, ENC_BIG_ENDIAN);
1288 * Name: dissect_ipreach_subclv ()
1290 * Description: parses IP reach subTLVs
1291 * Called by various IP Reachability dissectors.
1293 * Input:
1294 * tvbuff_t * : tvbuffer for packet data
1295 * proto_tree * : protocol display tree to fill out.
1296 * int : offset into packet data where we are (beginning of the sub_clv value).
1298 * Output:
1299 * void
1301 static void
1302 dissect_ipreach_subclv(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, proto_item *tree_item, int offset, int clv_code, int clv_len)
1304 uint8_t flags;
1306 switch (clv_code) {
1307 case IP_REACH_SUBTLV_32BIT_ADMIN_TAG:
1308 while (clv_len >= 4) {
1309 proto_tree_add_item(tree, hf_isis_lsp_32_bit_administrative_tag, tvb, offset, 4, ENC_BIG_ENDIAN);
1310 offset+=4;
1311 clv_len-=4;
1313 break;
1314 case IP_REACH_SUBTLV_64BIT_ADMIN_TAG:
1315 while (clv_len >= 8) {
1316 proto_tree_add_item(tree, hf_isis_lsp_64_bit_administrative_tag, tvb, offset, 8, ENC_BIG_ENDIAN);
1317 offset+=8;
1318 clv_len-=8;
1320 break;
1321 case IP_REACH_SUBTLV_PFX_SID:
1322 flags = tvb_get_uint8(tvb, offset);
1323 proto_tree_add_bitmask(tree, tvb, offset, hf_isis_lsp_ext_ip_reachability_prefix_flags,
1324 ett_isis_lsp_prefix_sid_flags, prefix_sid_flags, ENC_BIG_ENDIAN);
1325 offset++;
1327 proto_tree_add_item(tree, hf_isis_lsp_clv_sr_alg, tvb, offset, 1, ENC_BIG_ENDIAN);
1328 offset++;
1330 if (clv_len == 5) {
1331 if (!((flags & 0x0C) == 0x0C))
1332 proto_tree_add_expert_format(tree, pinfo, &ei_isis_lsp_malformed_subtlv, tvb,
1333 offset-2, clv_len, "V & L flags must be set");
1334 proto_tree_add_item(tree, hf_isis_lsp_sid_sli_label, tvb, offset, 3, ENC_BIG_ENDIAN);
1335 } else if (clv_len == 6) {
1336 if (flags & 0x0C)
1337 proto_tree_add_expert_format(tree, pinfo, &ei_isis_lsp_malformed_subtlv, tvb,
1338 offset-2, clv_len, "V & L flags must be unset");
1339 proto_tree_add_item(tree, hf_isis_lsp_sid_sli_index, tvb, offset, 4, ENC_BIG_ENDIAN);
1340 } else {
1341 proto_tree_add_expert_format(tree, pinfo, &ei_isis_lsp_malformed_subtlv, tvb,
1342 offset-2, clv_len, "Unknown SID/Index/Label format");
1344 break;
1345 case IP_REACH_SUBTLV_PFX_ATTRIB_FLAG:
1346 /* Prefix Attribute Flags */
1347 dissect_prefix_attr_flags_subclv(tvb, pinfo, tree, tree_item, offset, clv_code, clv_len);
1348 break;
1349 case IP_REACH_SUBTLV_FAPM:
1350 /* Flexible Algorithm Prefix Metric (FAPM) */
1351 dissect_flex_algo_prefix_metric_subclv(tvb, pinfo, tree, offset, clv_code, clv_len);
1352 break;
1353 case IP_REACH_SUBTLV_BIER_INFO:
1354 dissect_bierinfo_subtlv(tvb, pinfo, tree, offset, clv_len);
1355 break;
1356 default :
1357 break;
1363 * Name: dissect_lsp_ext_ip_reachability_clv()
1365 * Description: Decode an Extended IP Reachability CLV - code 135.
1367 * The extended IP reachability TLV is an extended version
1368 * of the IP reachability TLVs (codes 128 and 130). It encodes
1369 * the metric as a 32-bit unsigned interger and allows to add
1370 * sub-CLV(s).
1372 * CALLED BY TLV 235 DISSECTOR
1375 * Input:
1376 * tvbuff_t * : tvbuffer for packet data
1377 * proto_tree * : proto tree to build on (may be null)
1378 * int : current offset into packet data
1379 * int : length of IDs in packet.
1380 * int : length of this clv
1382 * Output:
1383 * void, will modify proto_tree if not null.
1385 static void
1386 dissect_lsp_ext_ip_reachability_clv(tvbuff_t *tvb, packet_info* pinfo, proto_tree *tree,
1387 int offset, isis_data_t *isis _U_, int length)
1389 proto_tree *subtree = NULL;
1390 proto_tree *subclv_tree = NULL;
1391 proto_item *ti_subtree = NULL;
1392 proto_item *ti_subclvs = NULL;
1393 uint8_t ctrl_info;
1394 unsigned bit_length;
1395 int byte_length;
1396 ws_in4_addr prefix;
1397 address prefix_addr;
1398 unsigned len,i;
1399 unsigned subclvs_len;
1400 unsigned clv_code, clv_len;
1401 int clv_offset;
1402 char *prefix_str;
1404 while (length > 0) {
1405 ctrl_info = tvb_get_uint8(tvb, offset+4);
1406 bit_length = ctrl_info & 0x3f;
1407 byte_length = tvb_get_ipv4_addr_with_prefix_len(tvb, offset+5, &prefix, bit_length);
1408 if (byte_length == -1) {
1409 proto_tree_add_expert_format(tree, pinfo, &ei_isis_lsp_short_clv, tvb, offset, -1,
1410 "IPv4 prefix has an invalid length: %d bits", bit_length );
1411 return;
1413 subclvs_len = 0;
1414 if ((ctrl_info & 0x40) != 0)
1415 subclvs_len = 1+tvb_get_uint8(tvb, offset+5+byte_length);
1417 /* open up a new tree per prefix */
1418 subtree = proto_tree_add_subtree(tree, tvb, offset, 5+byte_length+subclvs_len,
1419 ett_isis_lsp_part_of_clv_ext_ip_reachability, &ti_subtree, "Ext. IP Reachability");
1421 set_address(&prefix_addr, AT_IPv4, 4, &prefix);
1422 prefix_str = address_to_str(pinfo->pool, &prefix_addr);
1423 proto_item_append_text(ti_subtree, ": %s/%u", prefix_str, bit_length);
1425 proto_tree_add_item(subtree, hf_isis_lsp_ext_ip_reachability_metric, tvb, offset, 4, ENC_BIG_ENDIAN);
1426 proto_tree_add_item(subtree, hf_isis_lsp_ext_ip_reachability_distribution, tvb, offset+4, 1, ENC_NA);
1427 proto_tree_add_item(subtree, hf_isis_lsp_ext_ip_reachability_subtlv, tvb, offset+4, 1, ENC_NA);
1428 proto_tree_add_item(subtree, hf_isis_lsp_ext_ip_reachability_prefix_length, tvb, offset+4, 1, ENC_NA);
1430 proto_tree_add_ipv4(subtree, hf_isis_lsp_ext_ip_reachability_ipv4_prefix, tvb, offset + 5, byte_length, prefix);
1432 len = 5 + byte_length;
1433 if ((ctrl_info & 0x40) != 0) {
1434 subclvs_len = tvb_get_uint8(tvb, offset+len);
1435 proto_tree_add_item(subtree, hf_isis_lsp_ext_ip_reachability_subclvs_len, tvb, offset+len, 1, ENC_BIG_ENDIAN);
1436 i =0;
1437 while (i < subclvs_len) {
1438 clv_offset = offset + len + 1 + i; /* skip the total subtlv len indicator */
1439 clv_code = tvb_get_uint8(tvb, clv_offset);
1440 clv_len = tvb_get_uint8(tvb, clv_offset+1);
1441 subclv_tree = proto_tree_add_subtree(subtree, tvb, clv_offset, clv_len + 2,
1442 ett_isis_lsp_clv_ip_reach_subclv,
1443 &ti_subclvs, "subTLV");
1444 proto_tree_add_item(subclv_tree, hf_isis_lsp_ext_ip_reachability_code,
1445 tvb, clv_offset, 1, ENC_BIG_ENDIAN);
1446 proto_tree_add_item(subclv_tree, hf_isis_lsp_ext_ip_reachability_len, tvb, clv_offset+1, 1, ENC_BIG_ENDIAN);
1447 proto_item_append_text(ti_subclvs, ": %s (c=%u, l=%u)", val_to_str_const(clv_code, isis_lsp_ext_ip_reachability_code_vals, "Unknown"), clv_code, clv_len);
1450 * we pass on now the raw data to the ipreach_subtlv dissector
1451 * therefore we need to skip 3 bytes
1452 * (total subtlv len, subtlv type, subtlv len)
1454 dissect_ipreach_subclv(tvb, pinfo, subclv_tree, ti_subclvs, clv_offset+2, clv_code, clv_len);
1455 i += clv_len + 2;
1457 len += 1 + subclvs_len;
1458 } else {
1459 proto_tree_add_uint_format(subtree, hf_isis_lsp_ext_ip_reachability_subclvs_len, tvb, offset+len, 0, 0, "no sub-TLVs present");
1462 offset += len;
1463 length -= len;
1468 * Name: dissect_isis_grp_address_clv()
1470 * Description: Decode GROUP ADDRESS subTLVs
1471 * The Group Address TLV is composed of 1 octet for the type,
1472 * 1 octet that specifies the number of bytes in the value field, and a
1473 * Variable length value field that can have any or all of the subTLVs that are listed in the
1474 * - below section
1476 *Input:
1477 * tvbuff_t * : tvbuffer for packet data
1478 * proto_tree * : proto tree to build on (may be null)
1479 * int : current offset into packet data
1480 * int : length of IDs in packet.
1481 * int : length of this clv
1483 * Output:
1484 * void, will modify proto_tree if not null.
1487 static void
1488 dissect_isis_grp_address_clv(tvbuff_t *tvb, packet_info* pinfo _U_, proto_tree *tree, int offset,
1489 isis_data_t *isis _U_, int length)
1491 int source_num;
1492 uint8_t subtlv_type;
1493 int subtlv_len;
1495 proto_tree *rt_tree=NULL;
1497 while (length>0) {
1498 subtlv_type = tvb_get_uint8(tvb, offset);
1499 subtlv_len = tvb_get_uint8(tvb, offset+1);
1500 switch(subtlv_type) {
1503 case GRP_MAC_ADDRESS:
1504 rt_tree = proto_tree_add_subtree(tree, tvb, offset, subtlv_len+2,
1505 ett_isis_lsp_clv_grp_macaddr, NULL, "Group MAC Address Sub-TLV");
1507 proto_tree_add_uint(rt_tree, hf_isis_lsp_grp_type, tvb, offset, 1, subtlv_type);
1509 length--;
1510 offset++;
1512 proto_tree_add_uint(rt_tree, hf_isis_lsp_grp_macaddr_length, tvb, offset, 1, subtlv_len);
1514 if(subtlv_len < 5) {
1515 length -= subtlv_len;
1516 offset += subtlv_len;
1517 break;
1520 length--;
1521 offset++;
1523 proto_tree_add_item(rt_tree, hf_isis_lsp_grp_macaddr_topology_id, tvb, offset, 2, ENC_BIG_ENDIAN);
1525 length -= 2;
1526 offset += 2;
1527 subtlv_len -= 2;
1529 proto_tree_add_item(rt_tree, hf_isis_lsp_grp_macaddr_vlan_id, tvb, offset, 2, ENC_BIG_ENDIAN);
1531 length -= 2;
1532 offset += 2;
1533 subtlv_len -= 2;
1535 proto_tree_add_item(rt_tree, hf_isis_lsp_grp_macaddr_number_of_records, tvb, offset, 1, ENC_BIG_ENDIAN);
1537 length--;
1538 offset++;
1539 subtlv_len--;
1541 while(subtlv_len > 0) {
1543 source_num=tvb_get_uint8(tvb, offset);
1544 proto_tree_add_item(rt_tree, hf_isis_lsp_grp_macaddr_number_of_sources, tvb, offset, 1, ENC_BIG_ENDIAN);
1546 length--;
1547 offset++;
1548 subtlv_len--;
1550 proto_tree_add_item(rt_tree, hf_isis_lsp_grp_macaddr_group_address, tvb, offset, 6, ENC_NA);
1552 length -= 6;
1553 offset += 6;
1554 subtlv_len -= 6;
1557 while((subtlv_len > 0) && (source_num > 0)) {
1558 proto_tree_add_item(rt_tree, hf_isis_lsp_grp_macaddr_source_address, tvb, offset, 6, ENC_NA);
1560 length -= 6;
1561 offset += 6;
1562 subtlv_len -= 6;
1563 source_num--;
1567 break;
1569 case GRP_IPV4_ADDRESS:
1570 rt_tree = proto_tree_add_subtree(tree, tvb, offset, subtlv_len+2,
1571 ett_isis_lsp_clv_grp_ipv4addr, NULL, "Group IPv4 Address Sub-TLV");
1573 proto_tree_add_uint(rt_tree, hf_isis_lsp_grp_type, tvb, offset, 1, subtlv_type);
1575 length--;
1576 offset++;
1578 proto_tree_add_uint(rt_tree, hf_isis_lsp_grp_ipv4addr_length, tvb, offset, 1, subtlv_len);
1580 if(subtlv_len < 5) {
1581 length -= subtlv_len;
1582 offset += subtlv_len;
1583 break;
1586 length--;
1587 offset++;
1589 proto_tree_add_item(rt_tree, hf_isis_lsp_grp_ipv4addr_topology_id, tvb, offset, 2, ENC_BIG_ENDIAN);
1591 length -= 2;
1592 offset += 2;
1593 subtlv_len -= 2;
1595 proto_tree_add_item(rt_tree, hf_isis_lsp_grp_ipv4addr_vlan_id, tvb, offset, 2, ENC_BIG_ENDIAN);
1597 length -= 2;
1598 offset += 2;
1599 subtlv_len -= 2;
1601 proto_tree_add_item(rt_tree, hf_isis_lsp_grp_ipv4addr_number_of_records, tvb, offset, 1, ENC_BIG_ENDIAN);
1603 length--;
1604 offset++;
1605 subtlv_len--;
1607 while(subtlv_len > 0) {
1609 source_num=tvb_get_uint8(tvb, offset);
1610 proto_tree_add_item(rt_tree, hf_isis_lsp_grp_ipv4addr_number_of_sources, tvb, offset, 1, ENC_BIG_ENDIAN);
1612 length--;
1613 offset++;
1614 subtlv_len--;
1616 proto_tree_add_item(rt_tree, hf_isis_lsp_grp_ipv4addr_group_address, tvb, offset, 4, ENC_BIG_ENDIAN);
1618 length -= 4;
1619 offset += 4;
1620 subtlv_len -= 4;
1623 while((subtlv_len > 0) && (source_num > 0)) {
1624 proto_tree_add_item(rt_tree, hf_isis_lsp_grp_ipv4addr_source_address, tvb, offset, 4, ENC_BIG_ENDIAN);
1626 length -= 4;
1627 offset += 4;
1628 subtlv_len -= 4;
1629 source_num--;
1633 break;
1635 case GRP_IPV6_ADDRESS:
1636 rt_tree = proto_tree_add_subtree(tree, tvb, offset, subtlv_len+2,
1637 ett_isis_lsp_clv_grp_ipv6addr, NULL, "Group IPv6 Address Sub-TLV");
1639 proto_tree_add_uint(rt_tree, hf_isis_lsp_grp_type, tvb, offset, 1, subtlv_type);
1641 length--;
1642 offset++;
1644 proto_tree_add_uint(rt_tree, hf_isis_lsp_grp_ipv6addr_length, tvb, offset, 1, subtlv_len);
1646 if(subtlv_len < 5) {
1647 length -= subtlv_len;
1648 offset += subtlv_len;
1649 break;
1652 length--;
1653 offset++;
1655 proto_tree_add_item(rt_tree, hf_isis_lsp_grp_ipv6addr_topology_id, tvb, offset, 2, ENC_BIG_ENDIAN);
1657 length -= 2;
1658 offset += 2;
1659 subtlv_len -= 2;
1661 proto_tree_add_item(rt_tree, hf_isis_lsp_grp_ipv6addr_vlan_id, tvb, offset, 2, ENC_BIG_ENDIAN);
1663 length -= 2;
1664 offset += 2;
1665 subtlv_len -= 2;
1667 proto_tree_add_item(rt_tree, hf_isis_lsp_grp_ipv6addr_number_of_records, tvb, offset, 1, ENC_BIG_ENDIAN);
1669 length--;
1670 offset++;
1671 subtlv_len--;
1673 while(subtlv_len > 0) {
1675 source_num=tvb_get_uint8(tvb, offset);
1676 proto_tree_add_item(rt_tree, hf_isis_lsp_grp_ipv6addr_number_of_sources, tvb, offset, 1, ENC_BIG_ENDIAN);
1678 length--;
1679 offset++;
1680 subtlv_len--;
1682 proto_tree_add_item(rt_tree, hf_isis_lsp_grp_ipv6addr_group_address, tvb, offset, 16, ENC_NA);
1684 length -= 16;
1685 offset += 16;
1686 subtlv_len -= 16;
1689 while((subtlv_len > 0) && (source_num > 0)) {
1690 proto_tree_add_item(rt_tree, hf_isis_lsp_grp_ipv6addr_source_address, tvb, offset, 16, ENC_NA);
1692 length -= 16;
1693 offset += 16;
1694 subtlv_len -= 16;
1695 source_num--;
1699 break;
1701 default:
1702 rt_tree = proto_tree_add_subtree(tree, tvb, offset, subtlv_len+2,
1703 ett_isis_lsp_clv_grp_unknown, NULL, "Unknown Sub-TLV");
1705 proto_tree_add_uint(rt_tree, hf_isis_lsp_grp_type, tvb, offset, 1, subtlv_type);
1707 length--;
1708 offset++;
1710 proto_tree_add_uint(rt_tree, hf_isis_lsp_grp_unknown_length, tvb, offset, 1, subtlv_len);
1712 length--;
1713 offset++;
1715 length -= subtlv_len;
1716 offset += subtlv_len;
1717 break;
1723 * Decode the Segment Routing "SID/Label" Sub-TLV
1725 * This Sub-TLV is used in the Segment Routing Capability TLV (2)
1726 * It's called by the TLV 242 dissector (dissect_isis_trill_clv)
1728 * @param tvb the buffer of the current data
1729 * @param pinfo the packet info of the current data
1730 * @param tree the tree to append this item
1731 * @param offset the offset in the tvb
1732 * @param tlv_len the length of tlv
1734 static void
1735 dissect_lsp_sr_sid_label_clv(tvbuff_t *tvb, packet_info* pinfo _U_,
1736 proto_tree *tree, int offset, uint8_t tlv_len)
1738 proto_tree *subtree;
1740 subtree = proto_tree_add_subtree_format(tree, tvb, offset-2, tlv_len+2, ett_isis_lsp_clv_sr_sid_label,
1741 NULL, "SID/Label (t=1, l=%u)", tlv_len);
1743 switch (tlv_len) { /* The length determines the type of info */
1744 case 4: /* Then it's a SID */
1745 proto_tree_add_item(subtree, hf_isis_lsp_clv_sr_cap_sid, tvb, offset, tlv_len, ENC_BIG_ENDIAN);
1746 break;
1747 case 3: /* Then it's a Label */
1748 proto_tree_add_item(subtree, hf_isis_lsp_clv_sr_cap_label, tvb, offset, tlv_len, ENC_BIG_ENDIAN);
1749 break;
1750 default:
1751 proto_tree_add_expert_format(subtree, pinfo, &ei_isis_lsp_subtlv, tvb, offset, tlv_len,
1752 "SID/Label SubTlv - Bad length: Type: %d, Length: %d", ISIS_SR_SID_LABEL, tlv_len);
1753 break;
1757 static void dissect_subclv_ext_admin_group(tvbuff_t *tvb, proto_tree *tree,
1758 int offset, int subtype _U_, int sublen);
1760 static int
1761 dissect_isis_trill_clv(tvbuff_t *tvb, packet_info* pinfo _U_,
1762 proto_tree *tree, int offset, int subtype, int sublen)
1764 uint16_t rt_block;
1765 proto_tree *rt_tree, *cap_tree, *subtree;
1766 proto_item *tree_item = NULL;
1767 uint16_t root_id;
1768 uint8_t tlv_type, tlv_len;
1769 int i;
1770 int local_offset, local_len;
1771 uint8_t flags;
1773 switch (subtype) {
1775 case ISIS_TE_NODE_CAP_DESC:
1776 /* 1 TE Node Capability Descriptor [RFC5073] */
1777 cap_tree = proto_tree_add_subtree(tree, tvb, offset-2, sublen+2,
1778 ett_isis_lsp_clv_te_node_cap_desc, NULL, "TE Node Capability Descriptor");
1780 * 0 B bit: P2MP Branch LSR capability [RFC5073]
1781 * 1 E bit: P2MP Bud LSR capability [RFC5073]
1782 * 2 M bit: MPLS-TE support [RFC5073]
1783 * 3 G bit: GMPLS support [RFC5073]
1784 * 4 P bit: P2MP RSVP-TE support [RFC5073]
1785 * 5-7 Unassigned [RFC5073]
1788 proto_tree_add_item(cap_tree, hf_isis_lsp_clv_te_node_cap_b_bit, tvb, offset, 1, ENC_NA);
1789 proto_tree_add_item(cap_tree, hf_isis_lsp_clv_te_node_cap_e_bit, tvb, offset, 1, ENC_NA);
1790 proto_tree_add_item(cap_tree, hf_isis_lsp_clv_te_node_cap_m_bit, tvb, offset, 1, ENC_NA);
1791 proto_tree_add_item(cap_tree, hf_isis_lsp_clv_te_node_cap_g_bit, tvb, offset, 1, ENC_NA);
1792 proto_tree_add_item(cap_tree, hf_isis_lsp_clv_te_node_cap_p_bit, tvb, offset, 1, ENC_NA);
1793 return 0;
1795 case SEGMENT_ROUTING_CAP:
1796 rt_tree = proto_tree_add_subtree_format(tree, tvb, offset-2, sublen+2, ett_isis_lsp_clv_sr_cap,
1797 NULL, "Segment Routing - Capability (t=%u, l=%u)", subtype, sublen);
1800 * 0 I-Flag: IPv4 flag [draft-ietf-isis-segment-routing-extensions]
1801 * 1 V-Flag: IPv6 flag [draft-ietf-isis-segment-routing-extensions]
1802 * 2-7 Unassigned
1805 proto_tree_add_item(rt_tree, hf_isis_lsp_clv_sr_cap_i_flag, tvb, offset, 1, ENC_NA);
1806 proto_tree_add_item(rt_tree, hf_isis_lsp_clv_sr_cap_v_flag, tvb, offset, 1, ENC_NA);
1807 proto_tree_add_item(rt_tree, hf_isis_lsp_clv_sr_cap_range, tvb, offset+1, 3, ENC_BIG_ENDIAN);
1809 tlv_type = tvb_get_uint8(tvb, offset+4);
1810 tlv_len = tvb_get_uint8(tvb, offset+5);
1811 if (tlv_type == ISIS_SR_SID_LABEL) {
1812 dissect_lsp_sr_sid_label_clv(tvb, pinfo, rt_tree, offset+6, tlv_len);
1813 } else
1814 proto_tree_add_expert_format(rt_tree, pinfo, &ei_isis_lsp_subtlv, tvb, offset+4, tlv_len+2,
1815 "Unknown SubTlv: Type: %d, Length: %d", tlv_type, tlv_len);
1817 return 0;
1819 case IPV6_TE_ROUTER_ID:
1820 /* 12: IPv6 TE Router ID (rfc5316) */
1821 rt_tree = proto_tree_add_subtree_format(tree, tvb, offset-2, sublen+2,
1822 ett_isis_lsp_clv_ipv6_te_rtrid,
1823 NULL, "IPv6 TE Router ID (t=%u, l=%u)",
1824 subtype, sublen);
1825 proto_tree_add_item(rt_tree, hf_isis_lsp_clv_ipv6_te_router_id, tvb, offset, 16, ENC_NA);
1826 return 0;
1828 case TRILL_VERSION:
1829 rt_tree = proto_tree_add_subtree_format(tree, tvb, offset-2, sublen+2,
1830 ett_isis_lsp_clv_trill_version, NULL, "TRILL version (t=%u, l=%u)", subtype, sublen);
1832 proto_tree_add_item(rt_tree, hf_isis_lsp_rt_capable_trill_maximum_version, tvb, offset, 1, ENC_BIG_ENDIAN);
1834 if ( sublen == 5 ) {
1835 offset++;
1836 proto_tree_add_item(rt_tree, hf_isis_lsp_rt_capable_trill_affinity_tlv, tvb, offset, 4, ENC_NA);
1837 proto_tree_add_item(rt_tree, hf_isis_lsp_rt_capable_trill_fgl_safe, tvb, offset, 4, ENC_NA);
1838 proto_tree_add_item(rt_tree, hf_isis_lsp_rt_capable_trill_caps, tvb, offset, 4, ENC_NA);
1839 proto_tree_add_item(rt_tree, hf_isis_lsp_rt_capable_trill_flags, tvb, offset, 4, ENC_NA);
1842 return 0;
1844 case TREES:
1845 rt_tree = proto_tree_add_subtree_format(tree, tvb, offset-2, sublen+2,
1846 ett_isis_lsp_clv_trees, NULL, "Trees (t=%u, l=%u)", subtype, sublen);
1848 proto_tree_add_item(rt_tree, hf_isis_lsp_rt_capable_trees_nof_trees_to_compute, tvb, offset, 2, ENC_BIG_ENDIAN);
1849 proto_tree_add_item(rt_tree, hf_isis_lsp_rt_capable_trees_maximum_nof_trees_to_compute, tvb, offset+2, 2, ENC_BIG_ENDIAN);
1850 proto_tree_add_item(rt_tree, hf_isis_lsp_rt_capable_trees_nof_trees_to_use, tvb, offset+4, 2, ENC_BIG_ENDIAN);
1852 return 0;
1854 case TREE_IDENTIFIER:
1855 rt_tree = proto_tree_add_subtree_format(tree, tvb, offset-2, sublen+2,
1856 ett_isis_lsp_clv_root_id, NULL, "Tree root identifiers (t=%u, l=%u)", subtype, sublen);
1858 root_id = tvb_get_ntohs(tvb, offset);
1859 proto_tree_add_item(rt_tree, hf_isis_lsp_rt_capable_tree_root_id_starting_tree_no, tvb, offset, 2, ENC_BIG_ENDIAN);
1861 sublen -= 2;
1862 offset += 2;
1864 while (sublen>=2) {
1865 rt_block = tvb_get_ntohs(tvb, offset);
1866 proto_tree_add_uint_format(rt_tree, hf_isis_lsp_rt_capable_tree_root_id_nickname, tvb, offset, 2,
1867 rt_block, "Nickname(%dth root): 0x%04x (%d)", root_id, rt_block, rt_block);
1868 root_id++;
1869 sublen -= 2;
1870 offset += 2;
1873 return 0;
1875 case NICKNAME:
1876 rt_tree = proto_tree_add_subtree_format(tree, tvb, offset-2, sublen+2,
1877 ett_isis_lsp_clv_nickname, NULL, "Nickname (t=%u, l=%u)", subtype, sublen);
1879 while (sublen>=5) {
1880 proto_tree_add_item(rt_tree, hf_isis_lsp_rt_capable_nickname_nickname_priority, tvb, offset, 1, ENC_BIG_ENDIAN);
1881 proto_tree_add_item(rt_tree, hf_isis_lsp_rt_capable_nickname_tree_root_priority, tvb, offset+1, 2, ENC_BIG_ENDIAN);
1882 proto_tree_add_item(rt_tree, hf_isis_lsp_rt_capable_nickname_nickname, tvb, offset+3, 2, ENC_BIG_ENDIAN);
1883 sublen -= 5;
1884 offset += 5;
1887 return 0;
1889 case INTERESTED_VLANS:
1890 rt_tree = proto_tree_add_subtree_format(tree, tvb, offset-2, sublen+2,
1891 ett_isis_lsp_clv_interested_vlans, NULL, "Interested VLANs and spanning tree roots (t=%u, l=%u)", subtype, sublen);
1893 proto_tree_add_item(rt_tree, hf_isis_lsp_rt_capable_interested_vlans_nickname, tvb, offset, 2, ENC_BIG_ENDIAN);
1894 sublen -= 2;
1895 offset += 2;
1897 proto_tree_add_item(rt_tree, hf_isis_lsp_rt_capable_interested_vlans_multicast_ipv4, tvb, offset, 2, ENC_BIG_ENDIAN);
1898 proto_tree_add_item(rt_tree, hf_isis_lsp_rt_capable_interested_vlans_multicast_ipv6, tvb, offset, 2, ENC_BIG_ENDIAN);
1899 proto_tree_add_item(rt_tree, hf_isis_lsp_rt_capable_interested_vlans_vlan_start_id, tvb, offset, 2, ENC_BIG_ENDIAN);
1900 sublen -= 2;
1901 offset += 2;
1903 proto_tree_add_item(rt_tree, hf_isis_lsp_rt_capable_interested_vlans_vlan_end_id, tvb, offset, 2, ENC_BIG_ENDIAN);
1904 sublen -= 2;
1905 offset += 2;
1907 proto_tree_add_item(rt_tree, hf_isis_lsp_rt_capable_interested_vlans_afs_lost_counter, tvb, offset, 4, ENC_BIG_ENDIAN);
1908 sublen -= 4;
1909 offset += 4;
1911 while (sublen>=6) {
1912 proto_tree_add_item(rt_tree, hf_isis_lsp_root_id, tvb, offset, 6, ENC_NA);
1913 sublen -= 6;
1914 offset += 6;
1917 return 0;
1919 case TREES_USED_IDENTIFIER:
1920 rt_tree = proto_tree_add_subtree_format(tree, tvb, offset-2, sublen+2,
1921 ett_isis_lsp_clv_tree_used, NULL, "Trees used identifiers (t=%u, l=%u)", subtype, sublen);
1923 root_id = tvb_get_ntohs(tvb, offset);
1924 proto_tree_add_item(rt_tree, hf_isis_lsp_rt_capable_tree_used_id_starting_tree_no, tvb, offset, 2, ENC_BIG_ENDIAN);
1926 sublen -= 2;
1927 offset += 2;
1929 while (sublen>=2) {
1930 rt_block = tvb_get_ntohs(tvb, offset);
1931 proto_tree_add_uint_format(rt_tree, hf_isis_lsp_rt_capable_tree_used_id_nickname, tvb, offset,2,
1932 rt_block, "Nickname(%dth root): 0x%04x (%d)", root_id, rt_block, rt_block);
1933 root_id++;
1934 offset += 2;
1935 sublen -= 2;
1938 return 0;
1940 case VLAN_GROUP:
1941 rt_tree = proto_tree_add_subtree_format(tree, tvb, offset-2, sublen+2,
1942 ett_isis_lsp_clv_vlan_group, NULL, "VLAN group (t=%u, l=%u)", subtype, sublen);
1944 proto_tree_add_item(rt_tree, hf_isis_lsp_rt_capable_vlan_group_primary_vlan_id, tvb, offset, 2, ENC_BIG_ENDIAN);
1946 offset += 2;
1947 sublen -= 2;
1949 while (sublen>=2) {
1951 proto_tree_add_item(rt_tree, hf_isis_lsp_rt_capable_vlan_group_secondary_vlan_id, tvb, offset, 2, ENC_BIG_ENDIAN);
1952 sublen -= 2;
1953 offset += 2;
1956 return 0;
1958 case SEGMENT_ROUTING_ALG:
1959 rt_tree = proto_tree_add_subtree_format(tree, tvb, offset-2, sublen+2,
1960 ett_isis_lsp_clv_sr_alg, NULL, "Segment Routing - Algorithms (t=%u, l=%u)",
1961 subtype, sublen);
1962 i = 0;
1963 while (i < sublen) {
1964 proto_tree_add_item(rt_tree, hf_isis_lsp_clv_sr_alg, tvb, offset+i, 1, ENC_NA);
1965 i++;
1967 return 0;
1969 case SEGMENT_ROUTING_LB:
1970 rt_tree = proto_tree_add_subtree_format(tree, tvb, offset-2, sublen+2,
1971 ett_isis_lsp_clv_sr_lb, NULL, "Segment Routing - Local Block (t=%u, l=%u)",
1972 subtype, sublen);
1973 proto_tree_add_item(rt_tree, hf_isis_lsp_clv_sr_lb_flags, tvb, offset, 1, ENC_NA);
1974 offset += 1;
1975 sublen -= 1;
1976 i = 0;
1977 while (i < sublen) {
1978 local_offset = offset + i;
1979 proto_tree_add_item(rt_tree, hf_isis_lsp_clv_sr_cap_range, tvb, local_offset, 3, ENC_NA);
1980 tlv_type = tvb_get_uint8(tvb, local_offset+3);
1981 tlv_len = tvb_get_uint8(tvb, local_offset+4);
1982 if (tlv_type == ISIS_SR_SID_LABEL) {
1983 dissect_lsp_sr_sid_label_clv(tvb, pinfo, rt_tree, local_offset+5, tlv_len);
1984 } else {
1985 proto_tree_add_expert_format(rt_tree, pinfo, &ei_isis_lsp_subtlv, tvb, local_offset+3, tlv_len+2,
1986 "Unknown Sub-TLV: Type: %d, Length: %d", tlv_type, tlv_len);
1988 i += (5 + tlv_len);
1990 return 0;
1992 case SRV6_CAP:
1993 rt_tree = proto_tree_add_subtree_format(tree, tvb, offset-2, sublen+2,
1994 ett_isis_lsp_clv_srv6_cap,
1995 NULL, "SRv6 Capability (t=%u, l=%u)",
1996 subtype, sublen);
1997 proto_tree_add_bitmask(rt_tree, tvb, offset, hf_isis_lsp_clv_srv6_cap_flags,
1998 ett_isis_lsp_clv_srv6_cap_flags, srv6_cap_flags, ENC_NA);
1999 return 0;
2001 case NODE_MSD:
2002 rt_tree = proto_tree_add_subtree_format(tree, tvb, offset-2, sublen+2,
2003 ett_isis_lsp_clv_node_msd,
2004 NULL, "Node Maximum SID Depth (t=%u, l=%u)",
2005 subtype, sublen);
2006 while (sublen >= 2) {
2007 proto_tree_add_item(rt_tree, hf_isis_lsp_clv_igp_msd_type, tvb, offset, 1, ENC_NA);
2008 proto_tree_add_item(rt_tree, hf_isis_lsp_clv_igp_msd_value, tvb, offset+1, 1, ENC_NA);
2009 sublen -= 2;
2010 offset += 2;
2012 return 0;
2014 case FLEX_ALGO_DEF:
2015 rt_tree = proto_tree_add_subtree_format(tree, tvb, offset-2, sublen+2,
2016 ett_isis_lsp_clv_flex_algo_def,
2017 NULL, "Flexible Algorithm Definition (t=%u, l=%u)",
2018 subtype, sublen);
2019 proto_tree_add_item(rt_tree, hf_isis_lsp_clv_flex_algo_algorithm, tvb, offset, 1, ENC_NA);
2020 proto_tree_add_item(rt_tree, hf_isis_lsp_clv_flex_algo_metric_type, tvb, offset+1, 1, ENC_NA);
2021 proto_tree_add_item(rt_tree, hf_isis_lsp_clv_flex_algo_calc_type, tvb, offset+2, 1, ENC_NA);
2022 proto_tree_add_item(rt_tree, hf_isis_lsp_clv_flex_algo_priority, tvb, offset+3, 1, ENC_NA);
2023 sublen -= 4;
2024 offset += 4;
2025 while (sublen >= 2) {
2026 tlv_type = tvb_get_uint8(tvb, offset);
2027 tlv_len = tvb_get_uint8(tvb, offset+1);
2028 sublen -= 2;
2029 offset += 2;
2030 subtree = proto_tree_add_subtree_format(rt_tree, tvb, offset-2, tlv_len+2,
2031 ett_isis_lsp_clv_flex_algo_def_sub_tlv,
2032 &tree_item, "%s (t=%u, l=%u)",
2033 val_to_str_const(tlv_type, isis_lsp_flex_algo_sub_tlv_vals, "Unknown"),
2034 tlv_type, tlv_len);
2035 switch (tlv_type) {
2036 case FAD_EXCLUDE_AG:
2037 case FAD_INCLUDE_ANY_AG:
2038 case FAD_INCLUDE_ALL_AG:
2039 dissect_subclv_ext_admin_group(tvb, subtree, offset, tlv_type, tlv_len);
2040 break;
2041 case FAD_DEF_FLAGS:
2042 flags = tvb_get_uint8(tvb, offset);
2043 proto_tree_add_item(subtree, hf_isis_lsp_clv_flex_algo_def_flags_m, tvb, offset, 1, ENC_NA);
2044 if (tree_item) {
2045 proto_item_append_text(tree_item, ": Flags:%c",
2046 ((flags & FAD_DEF_FLAGS_M) != 0) ? 'M' : '-');
2048 break;
2049 case FAD_EXCLUDE_SRLG:
2050 local_offset = offset;
2051 local_len = sublen;
2052 while (local_len >= 4) {
2053 proto_tree_add_item(subtree, hf_isis_lsp_clv_flex_algo_srlg_value, tvb, local_offset, 4, ENC_BIG_ENDIAN);
2054 local_len -= 4;
2055 local_offset += 4;
2057 break;
2058 default:
2059 break;
2061 sublen -= tlv_len;
2062 offset += tlv_len;
2064 return 0;
2066 default:
2067 return -1;
2072 * Name: dissect_isis_rt_capable_clv()
2074 * Description: Decode RouterCapability subTLVs
2076 * The Router Capability TLV is composed of 1 octet for the type,
2077 * 1 octet that specifies the number of bytes in the value field, and a
2078 * variable length value field that can have any or all of the subTLVs
2079 * that are listed in the below section
2081 * Input:
2082 * tvbuff_t * : tvbuffer for packet data
2083 * proto_tree * : proto tree to build on (may be null)
2084 * int : current offset into packet data
2085 * int : length of IDs in packet.
2086 * int : length of this clv
2087 * len : local variable described to handle the length of the subTLV
2089 * Output:
2090 * void, will modify proto_tree if not null.
2093 /* As per RFC 7176 section 2.3 */
2094 static void
2095 dissect_isis_rt_capable_clv(tvbuff_t *tvb, packet_info* pinfo _U_,
2096 proto_tree *tree, int offset, isis_data_t *isis _U_, int length)
2098 uint8_t subtype, subtlvlen;
2100 proto_tree_add_item(tree, hf_isis_lsp_rt_capable_router_id, tvb, offset, 4, ENC_BIG_ENDIAN);
2101 offset += 4;
2102 length -= 4;
2103 proto_tree_add_item(tree, hf_isis_lsp_rt_capable_flag_s, tvb, offset, 1, ENC_BIG_ENDIAN);
2104 proto_tree_add_item(tree, hf_isis_lsp_rt_capable_flag_d, tvb, offset, 1, ENC_BIG_ENDIAN);
2105 length -= 1;
2106 offset += 1;
2108 while (length>=2) {
2109 subtype = tvb_get_uint8(tvb, offset);
2110 subtlvlen = tvb_get_uint8(tvb, offset+1);
2111 length -= 2;
2112 offset += 2;
2114 if (subtlvlen > length) {
2115 proto_tree_add_expert_format(tree, pinfo, &ei_isis_lsp_short_clv, tvb, offset-2, -1,
2116 "Short type %d TLV (%d vs %d)", subtype, subtlvlen, length);
2117 return;
2120 if (dissect_isis_trill_clv(tvb, pinfo, tree, offset, subtype, subtlvlen)==-1) {
2122 proto_tree_add_expert_format( tree, pinfo, &ei_isis_lsp_subtlv, tvb, offset-2, subtlvlen+2,
2123 "Unknown SubTlv: Type: %d, Length: %d", subtype, subtlvlen);
2125 length -= subtlvlen;
2126 offset += subtlvlen;
2131 * Name: dissect_lsp_ipv6_reachability_clv()
2133 * Description: Decode an IPv6 reachability CLV - code 236.
2135 * CALLED BY TLV 237 DISSECTOR
2137 * Input:
2138 * tvbuff_t * : tvbuffer for packet data
2139 * proto_tree * : proto tree to build on (may be null)
2140 * int : current offset into packet data
2141 * int : length of IDs in packet.
2142 * int : length of this clv
2144 * Output:
2145 * void, will modify proto_tree if not null.
2147 static void
2148 dissect_lsp_ipv6_reachability_clv(tvbuff_t *tvb, packet_info* pinfo, proto_tree *tree, int offset,
2149 isis_data_t *isis _U_, int length)
2151 proto_tree *subtree = NULL;
2152 proto_tree *subtree2 = NULL;
2153 proto_item *ti_subtree = NULL;
2154 proto_item *ti_subclvs = NULL;
2155 uint8_t ctrl_info;
2156 unsigned bit_length;
2157 int byte_length;
2158 ws_in6_addr prefix;
2159 address prefix_addr;
2160 unsigned len,i;
2161 unsigned subclvs_len;
2162 unsigned clv_code, clv_len;
2163 int clv_offset;
2164 char *prefix_str;
2166 if (!tree) return;
2168 while (length > 0) {
2169 ctrl_info = tvb_get_uint8(tvb, offset+4);
2170 bit_length = tvb_get_uint8(tvb, offset+5);
2171 byte_length = tvb_get_ipv6_addr_with_prefix_len(tvb, offset+6, &prefix, bit_length);
2172 if (byte_length == -1) {
2173 proto_tree_add_expert_format(tree, pinfo, &ei_isis_lsp_short_clv, tvb, offset, -1,
2174 "IPv6 prefix has an invalid length: %d bits", bit_length );
2175 return;
2177 subclvs_len = 0;
2178 if ((ctrl_info & 0x20) != 0)
2179 subclvs_len = 1+tvb_get_uint8(tvb, offset+6+byte_length);
2181 subtree = proto_tree_add_subtree(tree, tvb, offset, 6+byte_length+subclvs_len,
2182 ett_isis_lsp_part_of_clv_ipv6_reachability, &ti_subtree, "IPv6 Reachability");
2184 set_address(&prefix_addr, AT_IPv6, 16, prefix.bytes);
2185 prefix_str = address_to_str(pinfo->pool, &prefix_addr);
2186 proto_item_append_text(ti_subtree, ": %s/%u", prefix_str, bit_length);
2188 proto_tree_add_item(subtree, hf_isis_lsp_ipv6_reachability_metric, tvb, offset, 4, ENC_BIG_ENDIAN);
2189 proto_tree_add_item(subtree, hf_isis_lsp_ipv6_reachability_distribution, tvb, offset+4, 1, ENC_NA);
2190 proto_tree_add_item(subtree, hf_isis_lsp_ipv6_reachability_distribution_internal, tvb, offset+4, 1, ENC_NA);
2191 proto_tree_add_item(subtree, hf_isis_lsp_ipv6_reachability_subtlv, tvb, offset+4, 1, ENC_NA);
2193 if ((ctrl_info & 0x1f) != 0) {
2194 proto_tree_add_item(subtree, hf_isis_lsp_ipv6_reachability_reserved_bits, tvb, offset+4, 1, ENC_BIG_ENDIAN);
2196 proto_tree_add_item(subtree, hf_isis_lsp_ipv6_reachability_prefix_length, tvb, offset+5, 1, ENC_NA);
2197 proto_tree_add_ipv6_format_value(subtree, hf_isis_lsp_ipv6_reachability_ipv6_prefix, tvb, offset+6, byte_length,
2198 &prefix, "%s", prefix_str);
2200 len = 6 + byte_length;
2201 if ((ctrl_info & 0x20) != 0) {
2202 subclvs_len = tvb_get_uint8(tvb, offset+len);
2203 proto_tree_add_item(subtree, hf_isis_lsp_ipv6_reachability_subclvs_len, tvb, offset+len, 1, ENC_BIG_ENDIAN);
2205 i =0;
2206 while (i < subclvs_len) {
2207 clv_offset = offset + len + 1 + i; /* skip the total subtlv len indicator */
2208 clv_code = tvb_get_uint8(tvb, clv_offset);
2209 clv_len = tvb_get_uint8(tvb, clv_offset+ 1);
2210 subtree2 = proto_tree_add_subtree_format(subtree, tvb, clv_offset, clv_len + 2,
2211 ett_isis_lsp_clv_ip_reach_subclv,
2212 &ti_subclvs, "subTLV");
2213 proto_tree_add_item(subtree2, hf_isis_lsp_ext_ip_reachability_code,
2214 tvb, clv_offset, 1, ENC_BIG_ENDIAN);
2215 proto_tree_add_item(subtree2, hf_isis_lsp_ext_ip_reachability_len,
2216 tvb, clv_offset+1, 1, ENC_BIG_ENDIAN);
2217 proto_item_append_text(ti_subclvs, ": %s (c=%u, l=%u)",
2218 val_to_str_const(clv_code, isis_lsp_ext_ip_reachability_code_vals, "Unknown"),
2219 clv_code, clv_len);
2221 dissect_ipreach_subclv(tvb, pinfo, subtree2, ti_subclvs, clv_offset+2, clv_code, clv_len);
2222 i += clv_len + 2;
2224 len += 1 + subclvs_len;
2225 } else {
2226 proto_tree_add_uint_format(subtree, hf_isis_lsp_ext_ip_reachability_subclvs_len, tvb, offset, len, 0, "no sub-TLVs present");
2228 offset += len;
2229 length -= len;
2234 * Name: dissect_lsp_nlpid_clv()
2236 * Description:
2237 * Decode for a lsp packets NLPID clv. Calls into the
2238 * clv common one.
2240 * Input:
2241 * tvbuff_t * : tvbuffer for packet data
2242 * proto_tree * : proto tree to build on (may be null)
2243 * int : current offset into packet data
2244 * int : length of IDs in packet.
2245 * int : length of this clv
2247 * Output:
2248 * void, will modify proto_tree if not null.
2250 static void
2251 dissect_lsp_nlpid_clv(tvbuff_t *tvb, packet_info* pinfo _U_, proto_tree *tree, int offset,
2252 isis_data_t *isis _U_, int length)
2254 isis_dissect_nlpid_clv(tvb, tree, ett_isis_lsp_clv_nlpid_nlpid, hf_isis_lsp_clv_nlpid_nlpid, offset, length);
2258 * Name: dissect_lsp_mt_clv()
2260 * Description: - code 229
2261 * Decode for a lsp packets Multi Topology clv. Calls into the
2262 * clv common one.
2264 * Input:
2265 * tvbuff_t * : tvbuffer for packet data
2266 * proto_tree * : proto tree to build on (may be null)
2267 * int : current offset into packet data
2268 * unsigned : length of this clv
2269 * int : length of IDs in packet.
2271 * Output:
2272 * void, will modify proto_tree if not null.
2274 static void
2275 dissect_lsp_mt_clv(tvbuff_t *tvb, packet_info* pinfo, proto_tree *tree, int offset,
2276 isis_data_t *isis _U_, int length)
2278 isis_dissect_mt_clv(tvb, pinfo, tree, offset, length, hf_isis_lsp_clv_mt, &ei_isis_lsp_clv_mt );
2282 * Name: dissect_lsp_hostname_clv()
2284 * Description:
2285 * Decode for a lsp packets hostname clv. Calls into the
2286 * clv common one.
2288 * Input:
2289 * tvbuff_t * : tvbuffer for packet data
2290 * proto_tree * : proto tree to build on (may be null)
2291 * int : current offset into packet data
2292 * int : length of IDs in packet.
2293 * int : length of this clv
2295 * Output:
2296 * void, will modify proto_tree if not null.
2298 static void
2299 dissect_lsp_hostname_clv(tvbuff_t *tvb, packet_info* pinfo _U_, proto_tree *tree, int offset,
2300 isis_data_t *isis _U_, int length)
2302 isis_dissect_hostname_clv(tvb, tree, offset, length,
2303 hf_isis_lsp_hostname);
2307 * Name: dissect_lsp_srlg_clv()
2309 * Description:
2310 * Decode for a lsp packets Shared Risk Link Group (SRLG) clv (138). Calls into the
2311 * clv common one.
2313 * Input:
2314 * tvbuff_t * : tvbuffer for packet data
2315 * proto_tree * : proto tree to build on (may be null)
2316 * int : current offset into packet data
2317 * int : length of IDs in packet.
2318 * int : length of this clv
2320 * Output:
2321 * void, will modify proto_tree if not null.
2323 static void
2324 dissect_lsp_srlg_clv(tvbuff_t *tvb, packet_info* pinfo _U_, proto_tree *tree, int offset,
2325 isis_data_t *isis _U_, int length)
2328 proto_tree_add_item(tree, hf_isis_lsp_srlg_system_id, tvb, offset, 6, ENC_BIG_ENDIAN);
2329 offset += 6;
2331 proto_tree_add_item(tree, hf_isis_lsp_srlg_pseudo_num, tvb, offset, 1, ENC_BIG_ENDIAN);
2332 offset += 1;
2334 proto_tree_add_item(tree, hf_isis_lsp_srlg_flags_numbered, tvb, offset, 1, ENC_BIG_ENDIAN);
2335 offset += 1;
2337 proto_tree_add_item(tree, hf_isis_lsp_srlg_ipv4_local, tvb, offset, 4, ENC_BIG_ENDIAN);
2338 offset += 4;
2340 proto_tree_add_item(tree, hf_isis_lsp_srlg_ipv4_remote, tvb, offset, 4, ENC_BIG_ENDIAN);
2341 offset += 4;
2343 length -= 16;
2344 while(length){
2345 proto_tree_add_item(tree, hf_isis_lsp_srlg_value, tvb, offset, 4, ENC_BIG_ENDIAN);
2346 offset += 4;
2347 length -= 4;
2353 * Name: dissect_lsp_appspec_srlg_clv()
2355 * Description:
2356 * Decode for a lsp packets Application-Specific SRLG clv (238). Calls into the
2357 * clv common one.
2359 * Input:
2360 * tvbuff_t * : tvbuffer for packet data
2361 * proto_tree * : proto tree to build on (may be null)
2362 * int : current offset into packet data
2363 * int : length of IDs in packet.
2364 * int : length of this clv
2366 * Output:
2367 * void, will modify proto_tree if not null.
2369 static void
2370 dissect_lsp_appspec_srlg_clv(tvbuff_t *tvb, packet_info* pinfo, proto_tree *tree, int offset,
2371 isis_data_t *isis _U_, int length)
2373 proto_tree *subtree;
2374 proto_item *tree_item = NULL;
2375 uint8_t sabm_length = 0, udabm_length = 0;
2376 int sabm_length_offset, udabm_length_offset;
2377 int local_offset, local_len;
2378 uint8_t sub_tlv_len = 0;
2379 uint8_t tlv_type, tlv_len;
2381 if (length < 10) {
2382 proto_tree_add_expert_format(tree, pinfo, &ei_isis_lsp_short_clv, tvb, offset, length,
2383 "Too short Application-Specific SRLG TLV length (%d vs min 10)", length);
2384 return;
2387 proto_tree_add_item(tree, hf_isis_lsp_appspec_srlg_system_id, tvb, offset, 6, ENC_BIG_ENDIAN);
2388 offset += 6;
2389 length -= 6;
2391 proto_tree_add_item(tree, hf_isis_lsp_appspec_srlg_pseudo_num, tvb, offset, 1, ENC_BIG_ENDIAN);
2392 offset += 1;
2393 length -= 1;
2395 proto_tree_add_item(tree, hf_isis_lsp_clv_app_sabm_legacy, tvb, offset, 1, ENC_NA);
2396 sabm_length = tvb_get_uint8(tvb, offset) & 0x7f;
2397 sabm_length_offset = offset;
2398 proto_tree_add_uint(tree, hf_isis_lsp_clv_app_sabm_length, tvb, offset, 1, sabm_length);
2399 offset += 1;
2400 length -= 1;
2402 proto_tree_add_item(tree, hf_isis_lsp_clv_app_udabm_reserved, tvb, offset, 1, ENC_NA);
2403 udabm_length = tvb_get_uint8(tvb, offset) & 0x7f;
2404 udabm_length_offset = offset;
2405 proto_tree_add_uint(tree, hf_isis_lsp_clv_app_udabm_length, tvb, offset, 1, udabm_length);
2406 offset += 1;
2407 length -= 1;
2409 if (sabm_length > 0) {
2410 if (sabm_length > 8 || sabm_length > length) {
2411 proto_tree_add_expert_format(tree, pinfo, &ei_isis_lsp_short_clv, tvb, sabm_length_offset, 1,
2412 "Invalid SABM length (%u vs %d bytes left)",
2413 sabm_length, length);
2414 return;
2416 proto_tree_add_bitmask(tree, tvb, offset, hf_isis_lsp_clv_app_sabm_bits,
2417 ett_isis_lsp_clv_app_sabm_bits, isis_lsp_app_sabm_bits, ENC_NA);
2418 offset += sabm_length;
2419 length -= sabm_length;
2421 if (udabm_length > 0) {
2422 if (udabm_length > 8 || udabm_length > length) {
2423 proto_tree_add_expert_format(tree, pinfo, &ei_isis_lsp_short_clv, tvb, udabm_length_offset, 1,
2424 "Invalid UDABM length (%u vs %d bytes left)",
2425 udabm_length, length);
2426 return;
2428 proto_tree_add_item(tree, hf_isis_lsp_clv_app_udabm_bits, tvb, offset, udabm_length, ENC_NA);
2429 offset += udabm_length;
2430 length -= udabm_length;
2433 proto_tree_add_item(tree, hf_isis_lsp_appspec_srlg_sub_tlv_length, tvb, offset, 1, ENC_NA);
2434 sub_tlv_len = tvb_get_uint8(tvb, offset);
2435 if (sub_tlv_len > length) {
2436 proto_tree_add_expert_format(tree, pinfo, &ei_isis_lsp_short_clv, tvb, offset, 1,
2437 "Invalid Application-Specific SRLG sub-TLV length (%u vs %d bytes left)",
2438 sub_tlv_len, length);
2439 return;
2441 offset += 1;
2442 length -= 1;
2444 local_offset = offset;
2445 local_len = sub_tlv_len;
2446 while (local_len >= 2) {
2447 tlv_type = tvb_get_uint8(tvb, local_offset);
2448 tlv_len = tvb_get_uint8(tvb, local_offset + 1);
2449 subtree = proto_tree_add_subtree_format(tree, tvb, local_offset, tlv_len+2,
2450 ett_isis_lsp_clv_appspec_srlg_subtlv,
2451 &tree_item, "%s (t=%u, l=%u)",
2452 val_to_str_const(tlv_type, isis_lsp_appspec_srlg_sub_tlv_vals, "Unknown"),
2453 tlv_type, tlv_len);
2454 local_offset += 2;
2455 local_len -= 2;
2456 switch (tlv_type) {
2457 case 4:
2458 /* Link Local/Remote Identifiers */
2459 proto_tree_add_item(subtree, hf_isis_lsp_appspec_srlg_link_local_id, tvb, local_offset, 4, ENC_BIG_ENDIAN);
2460 proto_tree_add_item(subtree, hf_isis_lsp_appspec_srlg_link_remote_id, tvb, local_offset+4, 4, ENC_BIG_ENDIAN);
2461 break;
2462 default:
2463 proto_tree_add_expert_format(subtree, pinfo, &ei_isis_lsp_unknown_subtlv, tvb, local_offset-2, tlv_len+2,
2464 "Unknown Application-Specific SRLG subTLV (%u)", tlv_type);
2465 break;
2467 local_offset += tlv_len;
2468 local_len -= tlv_len;
2471 local_offset = offset + sub_tlv_len;
2472 local_len = length - sub_tlv_len;
2473 while (local_len >= 4) {
2474 proto_tree_add_item(tree, hf_isis_lsp_appspec_srlg_value, tvb, local_offset, 4, ENC_BIG_ENDIAN);
2475 local_offset += 4;
2476 local_len -= 4;
2482 * Name: dissect_lsp_te_router_id_clv()
2484 * Description:
2485 * Decode for a lsp packets Traffic Engineering ID clv. Calls into the
2486 * clv common one.
2488 * Input:
2489 * tvbuff_t * : tvbuffer for packet data
2490 * proto_tree * : proto tree to build on (may be null)
2491 * int : current offset into packet data
2492 * int : length of IDs in packet.
2493 * int : length of this clv
2495 * Output:
2496 * void, will modify proto_tree if not null.
2498 static void
2499 dissect_lsp_te_router_id_clv(tvbuff_t *tvb, packet_info* pinfo, proto_tree *tree, int offset,
2500 isis_data_t *isis _U_, int length)
2502 isis_dissect_te_router_id_clv(tree, pinfo, tvb, &ei_isis_lsp_short_clv, offset, length,
2503 hf_isis_lsp_clv_te_router_id );
2508 * Name: dissect_lsp_ip_int_addr_clv()
2510 * Description:
2511 * Decode for a lsp packets ip interface addr clv. Calls into the
2512 * clv common one.
2514 * Input:
2515 * tvbuff_t * : tvbuffer for packet data
2516 * proto_tree * : proto tree to build on (may be null)
2517 * int : current offset into packet data
2518 * int : length of IDs in packet.
2519 * int : length of this clv
2521 * Output:
2522 * void, will modify proto_tree if not null.
2524 static void
2525 dissect_lsp_ip_int_addr_clv(tvbuff_t *tvb, packet_info* pinfo, proto_tree *tree, int offset,
2526 isis_data_t *isis _U_, int length)
2528 isis_dissect_ip_int_clv(tree, pinfo, tvb, &ei_isis_lsp_short_clv, offset, length,
2529 hf_isis_lsp_clv_ipv4_int_addr );
2533 * Name: dissect_lsp_ipv6_int_addr_clv()
2535 * Description: Decode an IPv6 interface addr CLV - code 232.
2537 * Calls into the clv common one.
2539 * Input:
2540 * tvbuff_t * : tvbuffer for packet data
2541 * proto_tree * : proto tree to build on (may be null)
2542 * int : current offset into packet data
2543 * int : length of IDs in packet.
2544 * int : length of this clv
2546 * Output:
2547 * void, will modify proto_tree if not null.
2549 static void
2550 dissect_lsp_ipv6_int_addr_clv(tvbuff_t *tvb, packet_info* pinfo, proto_tree *tree, int offset,
2551 isis_data_t *isis _U_, int length)
2553 isis_dissect_ipv6_int_clv(tree, pinfo, tvb, &ei_isis_lsp_short_clv, offset, length,
2554 hf_isis_lsp_clv_ipv6_int_addr );
2557 static void
2558 dissect_isis_lsp_clv_mt_cap_spb_instance(tvbuff_t *tvb, packet_info *pinfo,
2559 proto_tree *tree, int offset, int subtype, int sublen)
2561 const int CIST_ROOT_ID_LEN = 8; /* CIST Root Identifier */
2562 const int CIST_EXT_ROOT_PATH_COST_LEN = 4; /* CIST External Root Path Cost */
2563 const int BRIDGE_PRI_LEN = 2; /* Bridge Priority */
2564 const int V_SPSOURCEID_LEN = 4; /* v | SPSourceID */
2565 const int NUM_TREES_LEN = 1; /* num of trees */
2567 const int CIST_ROOT_ID_OFFSET = 0;
2568 const int CIST_EXT_ROOT_PATH_COST_OFFSET = CIST_ROOT_ID_OFFSET + CIST_ROOT_ID_LEN;
2569 const int BRIDGE_PRI_OFFSET = CIST_EXT_ROOT_PATH_COST_OFFSET + CIST_EXT_ROOT_PATH_COST_LEN;
2570 const int V_SPSOURCEID_OFFSET = BRIDGE_PRI_OFFSET + BRIDGE_PRI_LEN;
2571 const int NUM_TREES_OFFSET = V_SPSOURCEID_OFFSET + V_SPSOURCEID_LEN;
2572 const int FIXED_LEN = NUM_TREES_OFFSET + NUM_TREES_LEN;
2573 const int VLAN_ID_TUPLE_LEN = 8;
2575 static int * const lsp_cap_spb_instance_vlanid_tuple[] = {
2576 &hf_isis_lsp_mt_cap_spb_instance_vlanid_tuple_u,
2577 &hf_isis_lsp_mt_cap_spb_instance_vlanid_tuple_m,
2578 &hf_isis_lsp_mt_cap_spb_instance_vlanid_tuple_a,
2579 &hf_isis_lsp_mt_cap_spb_instance_vlanid_tuple_reserved,
2580 NULL
2583 if (sublen < FIXED_LEN) {
2584 proto_tree_add_expert_format(tree, pinfo, &ei_isis_lsp_short_clv, tvb, offset, -1,
2585 "Short SPB Digest subTLV (%d vs %d)", sublen, FIXED_LEN);
2586 return;
2588 else {
2589 proto_tree *subtree, *ti;
2590 int subofs = offset;
2591 uint8_t num_trees = tvb_get_uint8(tvb, subofs + NUM_TREES_OFFSET);
2593 /*************************/
2594 subtree = proto_tree_add_subtree_format( tree, tvb, offset-2, sublen+2, ett_isis_lsp_clv_mt_cap_spb_instance, NULL,
2595 "SPB Instance: Type: 0x%02x, Length: %d", subtype, sublen);
2597 /*************************/
2598 proto_tree_add_item(subtree, hf_isis_lsp_mt_cap_spb_instance_cist_root_identifier, tvb, subofs + CIST_ROOT_ID_OFFSET, CIST_ROOT_ID_LEN, ENC_NA);
2599 proto_tree_add_item(subtree, hf_isis_lsp_mt_cap_spb_instance_cist_external_root_path_cost, tvb, subofs + CIST_EXT_ROOT_PATH_COST_OFFSET, CIST_EXT_ROOT_PATH_COST_LEN, ENC_BIG_ENDIAN);
2600 proto_tree_add_item(subtree, hf_isis_lsp_mt_cap_spb_instance_bridge_priority, tvb, subofs + BRIDGE_PRI_OFFSET, BRIDGE_PRI_LEN, ENC_BIG_ENDIAN);
2602 proto_tree_add_item(subtree, hf_isis_lsp_mt_cap_spb_instance_v, tvb, subofs + V_SPSOURCEID_OFFSET, V_SPSOURCEID_LEN, ENC_BIG_ENDIAN);
2604 proto_tree_add_item(subtree, hf_isis_lsp_mt_cap_spsourceid, tvb, subofs + V_SPSOURCEID_OFFSET, V_SPSOURCEID_LEN, ENC_BIG_ENDIAN);
2605 ti = proto_tree_add_item(subtree, hf_isis_lsp_mt_cap_spb_instance_number_of_trees, tvb, subofs + NUM_TREES_OFFSET, NUM_TREES_LEN, ENC_BIG_ENDIAN);
2606 if (num_trees == 0)
2607 proto_item_append_text(ti, " Invalid subTLV: zero trees");
2609 subofs += FIXED_LEN;
2610 sublen -= FIXED_LEN;
2612 /*************************/
2613 if (sublen != (num_trees * VLAN_ID_TUPLE_LEN)) {
2614 proto_tree_add_expert_format( subtree, pinfo, &ei_isis_lsp_short_clv, tvb, subofs, 0, "SubTLV length doesn't match number of trees");
2615 return;
2617 while (sublen > 0 && num_trees > 0) {
2618 if (sublen < VLAN_ID_TUPLE_LEN) {
2619 proto_tree_add_expert_format(subtree, pinfo, &ei_isis_lsp_short_clv, tvb, offset, -1,
2620 "Short VLAN_ID entry (%d vs %d)", sublen, VLAN_ID_TUPLE_LEN);
2621 return;
2623 else {
2624 proto_tree_add_bitmask_list(subtree, tvb, subofs, 1, lsp_cap_spb_instance_vlanid_tuple, ENC_BIG_ENDIAN);
2625 subofs += 1;
2627 proto_tree_add_item(subtree, hf_isis_lsp_mt_cap_spb_instance_vlanid_tuple_ect, tvb, subofs, 4, ENC_BIG_ENDIAN);
2628 subofs += 4;
2629 proto_tree_add_item(subtree, hf_isis_lsp_mt_cap_spb_instance_vlanid_tuple_base_vid, tvb, subofs, 3, ENC_BIG_ENDIAN);
2630 proto_tree_add_item(subtree, hf_isis_lsp_mt_cap_spb_instance_vlanid_tuple_spvid, tvb, subofs, 3, ENC_BIG_ENDIAN);
2631 subofs += 3;
2633 sublen -= VLAN_ID_TUPLE_LEN;
2634 --num_trees;
2637 if (num_trees) {
2638 proto_tree_add_expert_format(subtree, pinfo, &ei_isis_lsp_short_clv, tvb, offset, -1,
2639 "Short subTLV (%d vs %d)", sublen, num_trees * VLAN_ID_TUPLE_LEN);
2640 return;
2644 static void
2645 dissect_isis_lsp_clv_mt_cap_spb_oalg(tvbuff_t *tvb,
2646 proto_tree *tree, int offset, int subtype _U_, int sublen _U_)
2649 proto_tree_add_item(tree, hf_isis_lsp_mt_cap_spb_opaque_algorithm, tvb, offset, 4, ENC_BIG_ENDIAN);
2650 offset += 4;
2651 proto_tree_add_item(tree, hf_isis_lsp_mt_cap_spb_opaque_information, tvb, offset, -1, ENC_NA);
2654 static void
2655 dissect_isis_lsp_clv_mt_cap_spbm_service_identifier(tvbuff_t *tvb, packet_info *pinfo,
2656 proto_tree *tree, int offset, int subtype, int sublen)
2658 const int BMAC_LEN = 6; /* B-MAC Address */
2659 const int BVID_LEN = 2; /* Base-VID */
2661 const int BMAC_OFFSET = 0;
2662 const int BVID_OFFSET = BMAC_OFFSET + BMAC_LEN;
2663 const int FIXED_LEN = BVID_OFFSET + BVID_LEN;
2665 const int ISID_LEN = 4;
2667 static int * const lsp_cap_spbm_service_identifier[] = {
2668 &hf_isis_lsp_mt_cap_spbm_service_identifier_t,
2669 &hf_isis_lsp_mt_cap_spbm_service_identifier_r,
2670 &hf_isis_lsp_mt_cap_spbm_service_identifier_reserved,
2671 NULL
2674 if (sublen < FIXED_LEN) {
2675 proto_tree_add_expert_format(tree, pinfo, &ei_isis_lsp_short_clv, tvb, offset, -1,
2676 "Short SPBM Service Identifier and Unicast Address subTLV (%d vs %d)", sublen, FIXED_LEN);
2677 return;
2679 else {
2680 proto_tree *subtree;
2681 int subofs = offset;
2683 /*************************/
2684 subtree = proto_tree_add_subtree_format( tree, tvb, offset-2, sublen+2, ett_isis_lsp_clv_mt_cap_spbm_service_identifier, NULL,
2685 "SPB Service ID and Unicast Address: Type: 0x%02x, Length: %d", subtype, sublen);
2687 /*************************/
2688 proto_tree_add_item(subtree, hf_isis_lsp_mt_cap_spbm_service_identifier_b_mac, tvb, subofs + BMAC_OFFSET, BMAC_LEN, ENC_NA);
2689 proto_tree_add_item(subtree, hf_isis_lsp_mt_cap_spbm_service_identifier_base_vid, tvb, subofs + BVID_OFFSET, BVID_LEN, ENC_BIG_ENDIAN);
2691 subofs += FIXED_LEN;
2692 sublen -= FIXED_LEN;
2694 /*************************/
2695 while (sublen > 0) {
2696 if (sublen < ISID_LEN) {
2697 proto_tree_add_expert_format(subtree, pinfo, &ei_isis_lsp_short_clv, tvb, offset, -1,
2698 "Short ISID entry (%d vs %d)", sublen, 4);
2699 return;
2701 else {
2702 proto_tree_add_bitmask_list(subtree, tvb, subofs, 1, lsp_cap_spbm_service_identifier, ENC_BIG_ENDIAN);
2703 subofs += 1;
2704 sublen -= 1;
2706 proto_tree_add_item(subtree, hf_isis_lsp_mt_cap_spbm_service_identifier_i_sid, tvb, subofs, 3, ENC_BIG_ENDIAN);
2707 subofs += 3;
2708 sublen -= 3;
2713 static void
2714 dissect_isis_lsp_clv_mt_cap_spbv_mac_address(tvbuff_t *tvb, packet_info *pinfo,
2715 proto_tree *tree, int offset, int subtype, int sublen)
2718 static int * const lsp_spb_short_mac_address[] = {
2719 &hf_isis_lsp_spb_short_mac_address_t,
2720 &hf_isis_lsp_spb_short_mac_address_r,
2721 &hf_isis_lsp_spb_short_mac_address_reserved,
2722 NULL
2726 if (sublen < 2) {
2727 proto_tree_add_expert_format(tree, pinfo, &ei_isis_lsp_short_clv, tvb, offset, -1,
2728 "Short SPBV Mac Address subTLV (%d vs %d)", sublen, 2);
2729 return;
2731 else {
2732 proto_tree *subtree;
2733 int subofs = offset;
2735 /*************************/
2736 subtree = proto_tree_add_subtree_format( tree, tvb, offset-2, sublen+2, ett_isis_lsp_clv_mt_cap_spbv_mac_address, NULL,
2737 "SPBV Mac Address: Type: 0x%02x, Length: %d", subtype, sublen);
2739 /*************************/
2740 proto_tree_add_item(subtree, hf_isis_lsp_spb_reserved, tvb, subofs, 2, ENC_BIG_ENDIAN);
2741 proto_tree_add_item(subtree, hf_isis_lsp_spb_sr_bit, tvb, subofs, 2, ENC_BIG_ENDIAN);
2742 proto_tree_add_item(subtree, hf_isis_lsp_spb_spvid, tvb, subofs, 2, ENC_BIG_ENDIAN);
2744 subofs += 2;
2745 sublen -= 2;
2747 /*************************/
2748 while (sublen > 0) {
2749 if (sublen < 7) {
2750 proto_tree_add_expert_format(subtree, pinfo, &ei_isis_lsp_short_clv, tvb, offset, -1,
2751 "Short MAC Address entry (%d vs %d)", sublen, 7);
2752 return;
2754 else {
2755 proto_tree_add_bitmask_list(subtree, tvb, subofs, 1, lsp_spb_short_mac_address, ENC_BIG_ENDIAN);
2756 subofs += 1;
2757 sublen -= 1;
2759 proto_tree_add_item(subtree, hf_isis_lsp_spb_short_mac_address, tvb, subofs, 6, ENC_NA);
2761 subofs += 6;
2762 sublen -= 6;
2772 * Name: dissect_lsp_clv_mt_cap()
2774 * Description: Decode an ISIS MT-CAP CLV - code 144.
2776 * Input:
2777 * tvbuff_t * : tvbuffer for packet data
2778 * proto_tree * : proto tree to build on (may be null)
2779 * int : current offset into packet data
2780 * int : length of IDs in packet.
2781 * int : length of this clv
2783 * Output:
2784 * void, will modify proto_tree if not null.
2786 static void
2787 dissect_isis_lsp_clv_mt_cap(tvbuff_t *tvb, packet_info* pinfo, proto_tree *tree, int offset,
2788 isis_data_t *isis _U_, int length)
2790 if (length >= 2) {
2791 /* mtid */
2792 proto_tree_add_item( tree, hf_isis_lsp_mt_cap_mtid, tvb, offset, 2, ENC_BIG_ENDIAN);
2793 proto_tree_add_item(tree, hf_isis_lsp_mt_cap_overload, tvb, offset, 2, ENC_BIG_ENDIAN);
2794 length -= 2;
2795 offset += 2;
2796 while (length >= 2) {
2797 uint8_t subtype = tvb_get_uint8(tvb, offset);
2798 uint8_t subtlvlen = tvb_get_uint8(tvb, offset+1);
2799 length -= 2;
2800 offset += 2;
2801 if (subtlvlen > length) {
2802 proto_tree_add_expert_format(tree, pinfo, &ei_isis_lsp_short_clv, tvb, offset-2, -1,
2803 "Short type %d TLV (%d vs %d)", subtype, subtlvlen, length);
2804 return;
2806 if (subtype == 0x01) { /* SPB Instance */
2807 dissect_isis_lsp_clv_mt_cap_spb_instance(tvb, pinfo, tree, offset, subtype, subtlvlen);
2809 else if (subtype == 0x02) { /* OALG */
2810 dissect_isis_lsp_clv_mt_cap_spb_oalg(tvb, tree, offset, subtype, subtlvlen);
2812 else if (subtype == 0x03) { /* SPBM Service Identifier */
2813 dissect_isis_lsp_clv_mt_cap_spbm_service_identifier(tvb, pinfo, tree, offset, subtype, subtlvlen);
2815 else if (subtype == 0x04) { /* SPBV Mac Address */
2816 dissect_isis_lsp_clv_mt_cap_spbv_mac_address(tvb, pinfo, tree, offset, subtype, subtlvlen);
2818 else if (dissect_isis_trill_clv(tvb, pinfo, tree, offset, subtype, subtlvlen)==-1) {
2819 proto_tree_add_expert_format( tree, pinfo, &ei_isis_lsp_subtlv, tvb, offset-2, subtlvlen+2,
2820 "Unknown SubTlv: Type: %d, Length: %d", subtype, subtlvlen);
2822 length -= subtlvlen;
2823 offset += subtlvlen;
2831 * Name: dissect_isis_lsp_clv_sid_label_binding()
2833 * Description: Decode an ISIS SID/LABEL binding - code 149.
2835 * Input:
2836 * tvbuff_t * : tvbuffer for packet data
2837 * proto_tree * : proto tree to build on (may be null)
2838 * int : current offset into packet data
2839 * int : length of IDs in packet.
2840 * int : length of this clv
2842 * Output:
2843 * void, will modify proto_tree if not null.
2845 static void
2846 dissect_isis_lsp_clv_sid_label_binding(tvbuff_t *tvb, packet_info* pinfo, proto_tree *tree, int offset,
2847 isis_data_t *isis _U_, int length)
2849 proto_item *ti_subclvs = NULL;
2850 proto_tree *subtree = NULL;
2851 int tlv_offset = 0;
2852 int sub_tlv_len = 0;
2853 int i = 0;
2854 uint8_t clv_pref_l = 0;
2855 unsigned clv_code;
2856 unsigned clv_len;
2858 static int * const lsp_sl_flags[] = {
2859 &hf_isis_lsp_sl_binding_flags_f,
2860 &hf_isis_lsp_sl_binding_flags_m,
2861 &hf_isis_lsp_sl_binding_flags_s,
2862 &hf_isis_lsp_sl_binding_flags_d,
2863 &hf_isis_lsp_sl_binding_flags_a,
2864 &hf_isis_lsp_sl_binding_flags_rsv,
2865 NULL
2868 static int * const lsp_sl_sub_tlv_flags[] = {
2869 &hf_isis_lsp_sl_sub_tlv_flags_r,
2870 &hf_isis_lsp_sl_sub_tlv_flags_n,
2871 &hf_isis_lsp_sl_sub_tlv_flags_p,
2872 &hf_isis_lsp_sl_sub_tlv_flags_e,
2873 &hf_isis_lsp_sl_sub_tlv_flags_v,
2874 &hf_isis_lsp_sl_sub_tlv_flags_l,
2875 &hf_isis_lsp_sl_sub_tlv_flags_rsv,
2876 NULL
2879 if ( length <= 0 ) {
2880 return;
2884 tlv_offset = offset;
2886 proto_tree_add_bitmask(tree, tvb, tlv_offset,
2887 hf_isis_lsp_sl_binding_flags, ett_isis_lsp_sl_flags, lsp_sl_flags, ENC_NA);
2888 tlv_offset++;
2889 proto_tree_add_item(tree, hf_isis_lsp_sl_binding_weight, tvb, tlv_offset, 1, ENC_BIG_ENDIAN);
2890 tlv_offset++;
2891 proto_tree_add_item(tree, hf_isis_lsp_sl_binding_range, tvb, tlv_offset, 2, ENC_BIG_ENDIAN);
2892 tlv_offset = tlv_offset+2;
2893 proto_tree_add_item(tree, hf_isis_lsp_sl_binding_prefix_length, tvb, tlv_offset, 1, ENC_BIG_ENDIAN);
2894 clv_pref_l = tvb_get_uint8(tvb, tlv_offset);
2895 tlv_offset++;
2896 if (clv_pref_l == 32) {
2897 proto_tree_add_item(tree, hf_isis_lsp_sl_binding_fec_prefix_ipv4, tvb, tlv_offset, clv_pref_l/8, ENC_NA);
2899 else if (clv_pref_l == 128) {
2900 proto_tree_add_item(tree, hf_isis_lsp_sl_binding_fec_prefix_ipv6, tvb, tlv_offset, clv_pref_l/8, ENC_NA);
2902 else {
2903 proto_tree_add_expert_format(tree, pinfo, &ei_isis_lsp_malformed_subtlv, tvb, tlv_offset, -1,
2904 "Prefix address format unknown length : %d",clv_pref_l);
2906 tlv_offset = tlv_offset+(clv_pref_l/8);
2907 sub_tlv_len = length - (5+clv_pref_l/8);
2908 while (i < sub_tlv_len) {
2909 clv_code = tvb_get_uint8(tvb, i+tlv_offset);
2910 clv_len = tvb_get_uint8(tvb, i+1+tlv_offset);
2911 ti_subclvs = proto_tree_add_item(tree, hf_isis_lsp_sl_sub_tlv, tvb, tlv_offset, clv_len+2, ENC_NA);
2912 proto_item_append_text(ti_subclvs, " %s",
2913 val_to_str_const(clv_code, isis_lsp_sl_sub_tlv_vals, "Unknown capability sub-tlv type"));
2914 subtree = proto_item_add_subtree(ti_subclvs, ett_isis_lsp_sl_sub_tlv);
2915 proto_tree_add_item(subtree, hf_isis_lsp_sl_sub_tlv_type, tvb, i+tlv_offset, 1, ENC_BIG_ENDIAN);
2916 proto_tree_add_item(subtree, hf_isis_lsp_sl_sub_tlv_length, tvb, i+1+tlv_offset, 1, ENC_BIG_ENDIAN);
2917 switch (clv_code) {
2918 case ISIS_LSP_SL_SUB_SID_LABEL:
2919 switch (clv_len) {
2920 case 3 :
2921 proto_tree_add_item(subtree, hf_isis_lsp_sl_sub_tlv_label_20,
2922 tvb, i+2+tlv_offset, clv_len, ENC_BIG_ENDIAN);
2923 break;
2924 case 4 :
2925 proto_tree_add_item(subtree, hf_isis_lsp_sl_sub_tlv_label_32,
2926 tvb, i+2+tlv_offset, clv_len, ENC_BIG_ENDIAN);
2927 break;
2928 default :
2929 proto_tree_add_expert_format(tree, pinfo, &ei_isis_lsp_malformed_subtlv, tvb, i+2+tlv_offset, -1,
2930 "Label badly formatted");
2931 break;
2933 break;
2934 case ISIS_LSP_SL_SUB_PREFIX_SID: {
2935 proto_tree_add_bitmask(subtree, tvb, i+2+tlv_offset, hf_isis_lsp_sl_sub_tlv_flags,
2936 ett_isis_lsp_sl_sub_tlv_flags, lsp_sl_sub_tlv_flags, ENC_NA);
2937 proto_tree_add_item(subtree, hf_isis_lsp_sl_sub_tlv_algorithm,
2938 tvb, i+2+tlv_offset+1, 1, ENC_BIG_ENDIAN);
2939 switch (clv_len-2) {
2940 case 3 :
2941 proto_tree_add_item(subtree, hf_isis_lsp_sl_sub_tlv_label_20,
2942 tvb, i+2+tlv_offset+2, clv_len-2, ENC_BIG_ENDIAN);
2943 break;
2944 case 4 :
2945 proto_tree_add_item(subtree, hf_isis_lsp_sl_sub_tlv_label_32,
2946 tvb, i+2+tlv_offset+2, clv_len-2, ENC_BIG_ENDIAN);
2947 break;
2948 default :
2949 proto_tree_add_expert_format(tree, pinfo, &ei_isis_lsp_malformed_subtlv, tvb, i+2+tlv_offset+2, -1,
2950 "Label badly formatted");
2951 break;
2954 break;
2955 default:
2956 proto_tree_add_expert_format(tree, pinfo, &ei_isis_lsp_malformed_subtlv, tvb, i+2+tlv_offset, -1,
2957 "Sub TLV badly formatted, type unknown %d", clv_code);
2958 break;
2960 i += clv_len + 2;
2965 * Name: dissect_lsp_authentication_clv()
2967 * Description:
2968 * Decode for a lsp packets authentication clv. Calls into the
2969 * clv common one.
2971 * Input:
2972 * tvbuff_t * : tvbuffer for packet data
2973 * proto_tree * : proto tree to build on (may be null)
2974 * int : current offset into packet data
2975 * int : length of IDs in packet.
2976 * int : length of this clv
2978 * Output:
2979 * void, will modify proto_tree if not null.
2981 static void
2982 dissect_lsp_authentication_clv(tvbuff_t *tvb, packet_info* pinfo, proto_tree *tree, int offset,
2983 isis_data_t *isis _U_, int length)
2985 isis_dissect_authentication_clv(tree, pinfo, tvb, hf_isis_lsp_authentication, hf_isis_clv_key_id, &ei_isis_lsp_authentication, offset, length);
2989 * Name: dissect_lsp_ip_authentication_clv()
2991 * Description:
2992 * Decode for a lsp packets authentication clv. Calls into the
2993 * clv common one.
2995 * Input:
2996 * tvbuff_t * : tvbuffer for packet data
2997 * proto_tree * : proto tree to build on (may be null)
2998 * int : current offset into packet data
2999 * int : length of IDs in packet.
3000 * int : length of this clv
3002 * Output:
3003 * void, will modify proto_tree if not null.
3005 static void
3006 dissect_lsp_ip_authentication_clv(tvbuff_t *tvb, packet_info* pinfo _U_, proto_tree *tree, int offset,
3007 isis_data_t *isis _U_, int length)
3009 if ( length != 0 ) {
3010 proto_tree_add_item(tree, hf_isis_lsp_ip_authentication, tvb, offset, length, ENC_ASCII);
3015 * Name: dissect_lsp_area_address_clv()
3017 * Description:
3018 * Decode for a lsp packet's area address clv. Call into clv common
3019 * one.
3021 * Input:
3022 * tvbuff_t * : tvbuffer for packet data
3023 * proto_tree * : protocol display tree to fill out. May be NULL
3024 * int : offset into packet data where we are.
3025 * int : length of IDs in packet.
3026 * int : length of clv we are decoding
3028 * Output:
3029 * void, but we will add to proto tree if !NULL.
3031 static void
3032 dissect_lsp_area_address_clv(tvbuff_t *tvb, packet_info* pinfo, proto_tree *tree, int offset,
3033 isis_data_t *isis _U_, int length)
3035 isis_dissect_area_address_clv(tree, pinfo, tvb, &ei_isis_lsp_short_clv, hf_isis_lsp_area_address, offset, length);
3039 * Name: dissect_lsp_eis_neighbors_clv_inner()
3041 * Description:
3042 * Real work horse for showing neighbors. This means we decode the
3043 * first octet as either virtual/!virtual (if show_virtual param is
3044 * set), or as a must == 0 reserved value.
3046 * Once past that, we decode n neighbor elements. Each neighbor
3047 * is comprised of a metric block (is dissect_metric) and the
3048 * addresses.
3050 * Input:
3051 * tvbuff_t * : tvbuffer for packet data
3052 * proto_tree * : protocol display tree to fill out. May be NULL
3053 * int : offset into packet data where we are.
3054 * int : length of IDs in packet.
3055 * int : length of clv we are decoding
3056 * int : set to decode first octet as virtual vs reserved == 0
3057 * int : set to indicate EIS instead of IS (6 octet per addr instead of 7)
3059 * Output:
3060 * void, but we will add to proto tree if !NULL.
3062 static void
3063 dissect_lsp_eis_neighbors_clv_inner(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
3064 int offset, int length, unsigned id_length, int show_virtual, int is_eis)
3066 proto_item *ti;
3067 proto_tree *ntree = NULL;
3068 int tlen;
3070 if (!is_eis) {
3071 id_length++; /* IDs are one octet longer in IS neighbours */
3072 if ( tree ) {
3073 if ( show_virtual ) {
3074 /* virtual path flag */
3075 proto_tree_add_item( tree, hf_isis_lsp_is_virtual, tvb, offset, 1, ENC_NA);
3076 } else {
3077 proto_tree_add_item(tree, hf_isis_lsp_eis_neighbors_reserved, tvb, offset, 1, ENC_BIG_ENDIAN);
3080 offset++;
3081 length--;
3083 tlen = 4 + id_length;
3085 while ( length > 0 ) {
3086 if (length<tlen) {
3087 proto_tree_add_expert_format(tree, pinfo, &ei_isis_lsp_short_clv, tvb, offset, -1,
3088 "short E/IS reachability (%d vs %d)", length, tlen );
3089 return;
3092 * Gotta build a sub-tree for all our pieces
3094 if ( tree ) {
3095 if ( is_eis ) {
3096 ntree = proto_tree_add_subtree(tree, tvb, offset, tlen, ett_isis_lsp_clv_is_neighbors, &ti, "ES Neighbor");
3097 } else {
3098 ntree = proto_tree_add_subtree(tree, tvb, offset, tlen, ett_isis_lsp_clv_is_neighbors, &ti, "IS Neighbor");
3101 proto_tree_add_item(ntree, hf_isis_lsp_eis_neighbors_default_metric, tvb, offset, 1, ENC_BIG_ENDIAN);
3102 proto_tree_add_item(ntree, hf_isis_lsp_eis_neighbors_default_metric_ie, tvb, offset, 1, ENC_NA);
3104 proto_tree_add_item(ntree, hf_isis_lsp_eis_neighbors_delay_metric, tvb, offset, 1, ENC_BIG_ENDIAN);
3105 proto_tree_add_item(ntree, hf_isis_lsp_eis_neighbors_delay_metric_supported, tvb, offset, 1, ENC_NA);
3107 proto_tree_add_item(ntree, hf_isis_lsp_eis_neighbors_delay_metric_ie, tvb, offset+1, 1, ENC_NA);
3109 proto_tree_add_item(ntree, hf_isis_lsp_eis_neighbors_expense_metric, tvb, offset, 1, ENC_BIG_ENDIAN);
3110 proto_tree_add_item(ntree, hf_isis_lsp_eis_neighbors_expense_metric_supported, tvb, offset, 1, ENC_NA);
3111 proto_tree_add_item(ntree, hf_isis_lsp_eis_neighbors_expense_metric_ie, tvb, offset+2, 1, ENC_NA);
3113 proto_tree_add_item(ntree, hf_isis_lsp_eis_neighbors_error_metric, tvb, offset, 1, ENC_BIG_ENDIAN);
3114 proto_tree_add_item(ntree, hf_isis_lsp_eis_neighbors_error_metric_supported, tvb, offset, 1, ENC_NA);
3115 proto_tree_add_item(ntree, hf_isis_lsp_eis_neighbors_error_metric_ie, tvb, offset+3, 1, ENC_NA);
3116 proto_tree_add_item(ntree, is_eis ? hf_isis_lsp_eis_neighbors_es_neighbor_id : hf_isis_lsp_eis_neighbors_is_neighbor_id,
3117 tvb, offset+4, id_length, ENC_NA);
3118 proto_item_append_text(ti, ": %s", tvb_print_system_id(pinfo->pool, tvb, offset+4, id_length));
3120 offset += tlen;
3121 length -= tlen;
3126 * Name: dissect_lsp_l1_is_neighbors_clv()
3128 * Description:
3129 * Dispatch a l1 intermediate system neighbor by calling
3130 * the inner function with show virtual set to true and is es set to false.
3132 * Input:
3133 * tvbuff_t * : tvbuffer for packet data
3134 * proto_tree * : protocol display tree to fill out. May be NULL
3135 * int : offset into packet data where we are.
3136 * int : length of IDs in packet.
3137 * int : length of clv we are decoding
3139 * Output:
3140 * void, but we will add to proto tree if !NULL.
3142 static void
3143 dissect_lsp_l1_is_neighbors_clv(tvbuff_t *tvb, packet_info* pinfo, proto_tree *tree, int offset,
3144 isis_data_t *isis, int length)
3146 dissect_lsp_eis_neighbors_clv_inner(tvb, pinfo, tree, offset,
3147 length, isis->system_id_len, true, false);
3151 * Name: dissect_lsp_l1_es_neighbors_clv()
3153 * Description:
3154 * Dispatch a l1 end or intermediate system neighbor by calling
3155 * the inner function with show virtual set to true and es set to true.
3157 * Input:
3158 * tvbuff_t * : tvbuffer for packet data
3159 * proto_tree * : protocol display tree to fill out. May be NULL
3160 * int : offset into packet data where we are.
3161 * int : length of IDs in packet.
3162 * int : length of clv we are decoding
3164 * Output:
3165 * void, but we will add to proto tree if !NULL.
3167 static void
3168 dissect_lsp_l1_es_neighbors_clv(tvbuff_t *tvb, packet_info* pinfo, proto_tree *tree, int offset,
3169 isis_data_t *isis, int length)
3171 dissect_lsp_eis_neighbors_clv_inner(tvb, pinfo, tree, offset,
3172 length, isis->system_id_len, true, true);
3176 * Name: dissect_lsp_l2_is_neighbors_clv()
3178 * Description:
3179 * Dispatch a l2 intermediate system neighbor by calling
3180 * the inner function with show virtual set to false, and is es set
3181 * to false
3183 * Input:
3184 * tvbuff_t * : tvbuffer for packet data
3185 * proto_tree * : protocol display tree to fill out. May be NULL
3186 * int : offset into packet data where we are.
3187 * int : length of IDs in packet.
3188 * int : length of clv we are decoding
3190 * Output:
3191 * void, but we will add to proto tree if !NULL.
3193 static void
3194 dissect_lsp_l2_is_neighbors_clv(tvbuff_t *tvb, packet_info* pinfo, proto_tree *tree, int offset,
3195 isis_data_t *isis, int length)
3197 dissect_lsp_eis_neighbors_clv_inner(tvb, pinfo, tree, offset,
3198 length, isis->system_id_len, false, false);
3202 * Name: dissect_lsp_instance_identifier_clv()
3204 * Description:
3205 * Decode for a lsp packets Instance Identifier clv.
3206 * Calls into the CLV common one.
3208 * Input:
3209 * tvbuff_t * : tvbuffer for packet data
3210 * proto_tree * : proto tree to build on (may be null)
3211 * int : current offset into packet data
3212 * int : length of IDs in packet.
3213 * int : length of this clv
3215 * Output:
3216 * void, will modify proto_tree if not null.
3218 static void
3219 dissect_lsp_instance_identifier_clv(tvbuff_t *tvb, packet_info* pinfo _U_,
3220 proto_tree *tree, int offset, isis_data_t *isis _U_, int length)
3222 isis_dissect_instance_identifier_clv(tree, pinfo, tvb, &ei_isis_lsp_short_clv, hf_isis_lsp_instance_identifier, hf_isis_lsp_supported_itid, offset, length);
3226 * Name: dissect_subclv_admin_group ()
3228 * Description: Called by function dissect_lsp_ext_is_reachability_clv().
3230 * This function is called by dissect_lsp_ext_is_reachability_clv()
3231 * for dissect the administrative group sub-CLV (code 3).
3233 * Input:
3234 * tvbuff_t * : tvbuffer for packet data
3235 * proto_tree * : protocol display tree to fill out.
3236 * int : offset into packet data where we are (beginning of the sub_clv value).
3238 * Output:
3239 * void
3241 static void
3242 dissect_subclv_admin_group (tvbuff_t *tvb, proto_tree *tree, int offset) {
3243 proto_tree *ntree;
3244 uint32_t clv_value;
3245 uint32_t mask;
3246 int i;
3248 ntree = proto_tree_add_subtree(tree, tvb, offset-2, 6,
3249 ett_isis_lsp_subclv_admin_group, NULL, "Administrative group(s):");
3251 clv_value = tvb_get_ntohl(tvb, offset);
3252 mask = 1;
3253 for (i = 0 ; i < 32 ; i++) {
3254 if ( (clv_value & mask) != 0 ) {
3255 proto_tree_add_uint_format(ntree, hf_isis_lsp_group, tvb, offset, 4, clv_value & mask, "group %d", i);
3257 mask <<= 1;
3262 * Name: dissect_subclv_max_bw ()
3264 * Description: Called by function dissect_lsp_ext_is_reachability_clv().
3266 * This function is called by dissect_lsp_ext_is_reachability_clv()
3267 * for dissect the maximum link bandwidth sub-CLV (code 9).
3269 * Input:
3270 * tvbuff_t * : tvbuffer for packet data
3271 * proto_tree * : protocol display tree to fill out.
3272 * int : offset into packet data where we are (beginning of the sub_clv value).
3274 * Output:
3275 * void
3277 static void
3278 dissect_subclv_max_bw(tvbuff_t *tvb, proto_tree *tree, int offset)
3280 float bw;
3282 bw = tvb_get_ntohieee_float(tvb, offset)*8/1000000;
3283 proto_tree_add_float_format_value(tree, hf_isis_lsp_maximum_link_bandwidth, tvb, offset-2, 6,
3284 bw, "%.2f Mbps", bw);
3288 * Name: dissect_subclv_rsv_bw ()
3290 * Description: Called by function dissect_lsp_ext_is_reachability_clv().
3292 * This function is called by dissect_lsp_ext_is_reachability_clv()
3293 * for dissect the reservable link bandwidth sub-CLV (code 10).
3295 * Input:
3296 * tvbuff_t * : tvbuffer for packet data
3297 * proto_tree * : protocol display tree to fill out.
3298 * int : offset into packet data where we are (beginning of the sub_clv value).
3300 * Output:
3301 * void
3303 static void
3304 dissect_subclv_rsv_bw(tvbuff_t *tvb, proto_tree *tree, int offset)
3306 float bw;
3308 bw = tvb_get_ntohieee_float(tvb, offset)*8/1000000;
3309 proto_tree_add_float_format_value (tree, hf_isis_lsp_reservable_link_bandwidth, tvb, offset-2, 6,
3310 bw, "%.2f Mbps", bw );
3314 * Name: dissect_subclv_unrsv_bw ()
3316 * Description: Called by function dissect_lsp_ext_is_reachability_clv().
3318 * This function is called by dissect_lsp_ext_is_reachability_clv()
3319 * for dissect the unreserved bandwidth sub-CLV (code 11).
3321 * Input:
3322 * tvbuff_t * : tvbuffer for packet data
3323 * proto_tree * : protocol display tree to fill out.
3324 * int : offset into packet data where we are (beginning of the sub_clv value).
3326 * Output:
3327 * void
3329 static void
3330 dissect_subclv_unrsv_bw(tvbuff_t *tvb, proto_tree *tree, int offset)
3332 proto_tree *ntree;
3333 float bw;
3334 int i;
3336 ntree = proto_tree_add_subtree(tree, tvb, offset-2, 34,
3337 ett_isis_lsp_subclv_unrsv_bw, NULL, "Unreserved bandwidth:");
3339 for (i = 0 ; i < 8 ; i++) {
3340 bw = tvb_get_ntohieee_float(tvb, offset+4*i)*8/1000000;
3341 proto_tree_add_float_format(ntree, hf_isis_lsp_unrsv_bw_priority_level, tvb, offset+4*i, 4,
3342 bw, "priority level %d: %.2f Mbps", i, bw );
3347 * Name: dissect_subclv_bw_ct ()
3349 * Description: Called by function dissect_lsp_ext_is_reachability_clv().
3351 * This function is called by dissect_lsp_ext_is_reachability_clv()
3352 * for dissect the Bandwidth Constraints sub-CLV (code 22).
3354 * Input:
3355 * tvbuff_t * : tvbuffer for packet data
3356 * proto_tree * : protocol display tree to fill out.
3357 * int : offset into packet data where we are (beginning of the sub_clv value).
3359 * Output:
3360 * void
3362 static void
3363 dissect_subclv_bw_ct(tvbuff_t *tvb, proto_tree *tree, int offset, int sublen)
3365 proto_tree *ntree;
3366 int offset_end = offset + sublen;
3367 float bw;
3369 ntree = proto_tree_add_subtree(tree, tvb, offset-2, sublen,
3370 ett_isis_lsp_subclv_bw_ct, NULL, "Bandwidth Constraints:");
3372 proto_tree_add_item(ntree, hf_isis_lsp_bw_ct_model, tvb, offset, 1, ENC_BIG_ENDIAN);
3373 offset +=1;
3375 proto_tree_add_item(ntree, hf_isis_lsp_bw_ct_reserved, tvb, offset, 3, ENC_BIG_ENDIAN);
3376 offset +=3;
3378 if(offset < offset_end){
3379 bw = tvb_get_ntohieee_float(tvb, offset)*8/1000000;
3380 proto_tree_add_float_format_value(ntree, hf_isis_lsp_bw_ct0, tvb, offset, 4,
3381 bw, "%.2f Mbps", bw);
3382 offset += 4;
3385 if(offset < offset_end){
3386 bw = tvb_get_ntohieee_float(tvb, offset)*8/1000000;
3387 proto_tree_add_float_format_value(ntree, hf_isis_lsp_bw_ct1, tvb, offset, 4,
3388 bw, "%.2f Mbps", bw);
3389 offset += 4;
3392 if(offset < offset_end){
3393 bw = tvb_get_ntohieee_float(tvb, offset)*8/1000000;
3394 proto_tree_add_float_format_value(ntree, hf_isis_lsp_bw_ct2, tvb, offset, 4,
3395 bw, "%.2f Mbps", bw);
3396 offset += 4;
3399 if(offset < offset_end){
3400 bw = tvb_get_ntohieee_float(tvb, offset)*8/1000000;
3401 proto_tree_add_float_format_value(ntree, hf_isis_lsp_bw_ct3, tvb, offset, 4,
3402 bw, "%.2f Mbps", bw);
3403 offset += 4;
3406 if(offset < offset_end){
3407 bw = tvb_get_ntohieee_float(tvb, offset)*8/1000000;
3408 proto_tree_add_float_format_value(ntree, hf_isis_lsp_bw_ct4, tvb, offset, 4,
3409 bw, "%.2f Mbps", bw);
3410 offset += 4;
3413 if(offset < offset_end){
3414 bw = tvb_get_ntohieee_float(tvb, offset)*8/1000000;
3415 proto_tree_add_float_format_value(ntree, hf_isis_lsp_bw_ct5, tvb, offset, 4,
3416 bw, "%.2f Mbps", bw);
3417 offset += 4;
3420 if(offset < offset_end){
3421 bw = tvb_get_ntohieee_float(tvb, offset)*8/1000000;
3422 proto_tree_add_float_format_value(ntree, hf_isis_lsp_bw_ct6, tvb, offset, 4,
3423 bw, "%.2f Mbps", bw);
3424 offset += 4;
3427 if(offset < offset_end){
3428 bw = tvb_get_ntohieee_float(tvb, offset)*8/1000000;
3429 proto_tree_add_float_format_value(ntree, hf_isis_lsp_bw_ct7, tvb, offset, 4,
3430 bw, "%.2f Mbps", bw);
3431 /*offset += 4;*/
3436 * Name: dissect_subclv_spb_link_metric ()
3438 * Description: Called by function dissect_lsp_ext_is_reachability_clv().
3440 * This function is called by dissect_lsp_ext_is_reachability_clv()
3441 * for dissect the SPB link metric sub-CLV (code 29).
3443 * Input:
3444 * tvbuff_t * : tvbuffer for packet data
3445 * proto_tree * : protocol display tree to fill out.
3446 * int : offset into packet data where we are (beginning of the sub_clv value).
3447 * int : subtlv type
3448 * int : subtlv length
3450 * Output:
3451 * void
3454 static void
3455 dissect_subclv_spb_link_metric(tvbuff_t *tvb, packet_info *pinfo,
3456 proto_tree *tree, int offset, int subtype, int sublen)
3458 const int SUBLEN = 6;
3460 if (sublen != SUBLEN) {
3461 proto_tree_add_expert_format(tree, pinfo, &ei_isis_lsp_short_clv, tvb, offset, -1,
3462 "Short SPB Link Metric sub-TLV (%d vs %d)", sublen, SUBLEN);
3463 return;
3465 else {
3466 proto_tree *subtree;
3467 subtree = proto_tree_add_subtree_format( tree, tvb, offset-2, sublen+2, ett_isis_lsp_subclv_spb_link_metric, NULL,
3468 "SPB Link Metric: Type: 0x%02x (%d), Length: %d", subtype, subtype, sublen);
3470 proto_tree_add_item(subtree, hf_isis_lsp_spb_link_metric,
3471 tvb, offset, 3, ENC_BIG_ENDIAN);
3473 proto_tree_add_item(subtree, hf_isis_lsp_spb_port_count,
3474 tvb, offset+3, 1, ENC_BIG_ENDIAN);
3476 proto_tree_add_item(subtree, hf_isis_lsp_spb_port_id,
3477 tvb, offset+4, 2, ENC_BIG_ENDIAN);
3482 * Name : dissect_subclv_ext_admin_group()
3484 * Description : called by function dissect_sub_clv_tlv_22_22_23_141_222_223()
3486 * Dissects Extended Administrative Groups subclv
3488 * Input :
3489 * tvbuff_t * : tvbuffer for packet data
3490 * proto_tree * : protocol display tree to fill out.
3491 * int : offset into packet data where we are (beginning of the sub_clv value).
3492 * int : subtlv type
3493 * int : subtlv length
3495 * Output:
3496 * void
3498 static void
3499 dissect_subclv_ext_admin_group(tvbuff_t *tvb, proto_tree *tree,
3500 int offset, int subtype _U_, int sublen)
3502 int i;
3503 uint32_t admin_group;
3505 /* Number of Extended Admin Groups */
3506 for (i = 0; i < (sublen / 4); i++) {
3507 admin_group = tvb_get_uint32(tvb, offset + (i * 4), ENC_BIG_ENDIAN);
3508 proto_tree_add_uint_format(tree, hf_isis_lsp_clv_ext_admin_group,
3509 tvb, offset + (i * 4), 4, admin_group,
3510 "Extended Admin Group[%d]: 0x%08x",
3511 i, admin_group);
3516 * Name : dissect_subclv_adj_sid()
3518 * Description : called by function dissect_sub_clv_tlv_22_22_23_141_222_223()
3520 * Dissects LAN-Adj-SID & Adj-SID subclv
3522 * Input :
3523 * tvbuff_t * : tvbuffer for packet data
3524 * proto_tree * : protocol display tree to fill out.
3525 * int : offset into packet data where we are (beginning of the sub_clv value).
3526 * int : subtlv type
3527 * int : subtlv length
3529 * Output:
3530 * void
3533 static void
3534 dissect_subclv_adj_sid(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
3535 int local_offset, int subtype, int sublen)
3537 int offset = local_offset;
3538 proto_item *ti;
3539 int sli_len;
3540 uint8_t flags;
3542 flags = tvb_get_uint8(tvb, offset);
3543 proto_tree_add_bitmask(tree, tvb, offset, hf_isis_lsp_adj_sid_flags,
3544 ett_isis_lsp_adj_sid_flags, adj_sid_flags, ENC_BIG_ENDIAN);
3546 offset++;
3548 proto_tree_add_item(tree, hf_isis_lsp_adj_sid_weight, tvb, offset, 1, ENC_BIG_ENDIAN);
3549 offset++;
3551 /* Only present in LAN-Adj-SID, not Adj-SID */
3552 if (subtype == 32) {
3553 proto_tree_add_item(tree, hf_isis_lsp_adj_sid_system_id, tvb, offset, 6, ENC_NA);
3554 offset += 6;
3557 sli_len = local_offset + sublen - offset;
3558 switch(sli_len) {
3559 case 3:
3560 if (!((flags & 0x30) == 0x30))
3561 proto_tree_add_expert_format(tree, pinfo, &ei_isis_lsp_malformed_subtlv, tvb,
3562 local_offset, sublen, "V & L flags must be set");
3563 proto_tree_add_item(tree, hf_isis_lsp_sid_sli_label, tvb, offset, sli_len, ENC_BIG_ENDIAN);
3564 break;
3565 case 4:
3566 if (flags & 0x30)
3567 proto_tree_add_expert_format(tree, pinfo, &ei_isis_lsp_malformed_subtlv, tvb,
3568 local_offset, sublen, "V & L flags must be unset");
3569 proto_tree_add_item(tree, hf_isis_lsp_sid_sli_index, tvb, offset, sli_len, ENC_BIG_ENDIAN);
3570 break;
3571 case 16:
3572 if (!(flags & 0x20))
3573 proto_tree_add_expert_format(tree, pinfo, &ei_isis_lsp_malformed_subtlv, tvb,
3574 local_offset, sublen, "V flag must be set");
3575 ti = proto_tree_add_item(tree, hf_isis_lsp_sid_sli_ipv6, tvb, offset, sli_len, ENC_NA);
3576 /* L flag set */
3577 if (flags & 0x10)
3578 proto_item_append_text(ti, "Globally unique");
3579 break;
3580 default:
3581 break;
3583 /*offset += sli_len;*/
3587 * Name: dissect_srv6_sid_struct_subsubclv()
3589 * Description:
3590 * Decodes a SRv6 SID Structure sub-sub-TLV (RFC 9352)
3592 * Input:
3593 * tvbuff_t * : tvbuffer for packet data
3594 * packet_info * : expert error misuse reporting
3595 * proto_tree * : proto tree to build on
3596 * tree_item * : proto tree item to build on (may be null)
3597 * int : current offset into packet data
3598 * int : type of this clv
3599 * int : length of this clv
3601 * Output:
3602 * void, will modify proto_tree if not null.
3604 static void
3605 dissect_srv6_sid_struct_subsubclv(tvbuff_t *tvb, packet_info* pinfo,
3606 proto_tree *tree, proto_item *tree_item _U_,
3607 int offset, int clv_code _U_, int clv_len)
3609 if (clv_len != 4) {
3610 proto_tree_add_expert_format(tree, pinfo, &ei_isis_lsp_malformed_subtlv,
3611 tvb, offset-2, 2,
3612 "Invalid Sub-Sub-TLV Length %d (should be 4)", clv_len);
3613 return;
3615 proto_tree_add_item(tree, hf_isis_lsp_clv_srv6_sid_struct_lb_len, tvb, offset, 1, ENC_NA);
3616 proto_tree_add_item(tree, hf_isis_lsp_clv_srv6_sid_struct_ln_len, tvb, offset+1, 1, ENC_NA);
3617 proto_tree_add_item(tree, hf_isis_lsp_clv_srv6_sid_struct_fun_len, tvb, offset+2, 1, ENC_NA);
3618 proto_tree_add_item(tree, hf_isis_lsp_clv_srv6_sid_struct_arg_len, tvb, offset+3, 1, ENC_NA);
3622 * Name: dissect_sub_clv_tlv_22_22_23_141_222_223
3624 * Description: Decode a sub tlv's for all those tlv
3626 * CALLED BY TLV 22,23,141,222,223 DISSECTOR
3628 * Input:
3629 * tvbuff_t * : tvbuffer for packet data
3630 * packet_info * : expert error misuse reporting
3631 * proto_tree * : protocol display tree to fill out. May be NULL
3632 * int : offset into packet data where we are.
3633 * int : sub-tlv length
3634 * int : length of clv we are decoding
3636 * Output:
3637 * void
3640 static void
3641 // NOLINTNEXTLINE(misc-no-recursion)
3642 dissect_sub_clv_tlv_22_22_23_141_222_223(tvbuff_t *tvb, packet_info* pinfo, proto_tree *tree,
3643 int offset, int subclvs_len)
3645 proto_item *ti_subclvs = NULL;
3646 proto_tree *subtree = NULL;
3647 int sub_tlv_offset = 0;
3648 int i = 0;
3649 unsigned clv_code, clv_len;
3650 int local_offset, local_len;
3651 proto_item *ti;
3652 float percentage;
3653 uint8_t sabm_length = 0, udabm_length = 0;
3654 int subsubclvs_len;
3655 int ssclv_code, ssclv_len;
3656 proto_tree *subsubtree = NULL;
3657 proto_item *ti_subsubtree = NULL;
3659 increment_dissection_depth(pinfo);
3661 while (i < subclvs_len) {
3662 /* offset for each sub-TLV */
3663 sub_tlv_offset = offset + i;
3665 subtree = proto_tree_add_subtree(tree, tvb, sub_tlv_offset, 0,
3666 ett_isis_lsp_part_of_clv_ext_is_reachability_subtlv,
3667 &ti_subclvs, "subTLV");
3668 proto_tree_add_item(subtree, hf_isis_lsp_ext_is_reachability_code,
3669 tvb, sub_tlv_offset, 1, ENC_BIG_ENDIAN);
3670 proto_tree_add_item(subtree, hf_isis_lsp_ext_is_reachability_len, tvb, sub_tlv_offset+1, 1, ENC_BIG_ENDIAN);
3671 clv_code = tvb_get_uint8(tvb, sub_tlv_offset);
3672 clv_len = tvb_get_uint8(tvb, sub_tlv_offset+1);
3673 proto_item_append_text(ti_subclvs, ": %s (c=%u, l=%u)",
3674 val_to_str_const(clv_code, isis_lsp_ext_is_reachability_code_vals, "Unknown"),
3675 clv_code, clv_len);
3676 proto_item_set_len(ti_subclvs, clv_len+2);
3678 sub_tlv_offset += 2;
3680 switch (clv_code) {
3681 case 3 :
3682 dissect_subclv_admin_group(tvb, subtree, sub_tlv_offset);
3683 break;
3684 case 4 :
3685 proto_tree_add_item(subtree, hf_isis_lsp_ext_is_reachability_link_local_identifier,
3686 tvb, sub_tlv_offset, 4, ENC_BIG_ENDIAN);
3687 proto_tree_add_item(subtree, hf_isis_lsp_ext_is_reachability_link_remote_identifier,
3688 tvb, sub_tlv_offset + 4, 4, ENC_BIG_ENDIAN);
3689 break;
3690 case 6 :
3691 proto_tree_add_item(subtree, hf_isis_lsp_ext_is_reachability_ipv4_interface_address, tvb, sub_tlv_offset, 4, ENC_BIG_ENDIAN);
3692 break;
3693 case 8 :
3694 proto_tree_add_item(subtree, hf_isis_lsp_ext_is_reachability_ipv4_neighbor_address, tvb, sub_tlv_offset, 4, ENC_BIG_ENDIAN);
3695 break;
3696 case 9 :
3697 dissect_subclv_max_bw(tvb, subtree, sub_tlv_offset);
3698 break;
3699 case 10:
3700 dissect_subclv_rsv_bw(tvb, subtree, sub_tlv_offset);
3701 break;
3702 case 11:
3703 dissect_subclv_unrsv_bw(tvb, subtree, sub_tlv_offset);
3704 break;
3705 case 12:
3706 proto_tree_add_item(subtree, hf_isis_lsp_ext_is_reachability_ipv6_interface_address, tvb, sub_tlv_offset, 16, ENC_NA);
3707 break;
3708 case 13:
3709 proto_tree_add_item(subtree, hf_isis_lsp_ext_is_reachability_ipv6_neighbor_address, tvb, sub_tlv_offset, 16, ENC_NA);
3710 break;
3711 case 14:
3712 /* Extended Administrative Groups (rfc7308) */
3713 dissect_subclv_ext_admin_group(tvb, subtree, sub_tlv_offset, clv_code, clv_len);
3714 break;
3715 case 15:
3716 /* Link MSD */
3717 local_offset = sub_tlv_offset;
3718 local_len = clv_len;
3719 while (local_len >= 2) {
3720 proto_tree_add_item(subtree, hf_isis_lsp_clv_igp_msd_type, tvb, local_offset, 1, ENC_NA);
3721 proto_tree_add_item(subtree, hf_isis_lsp_clv_igp_msd_value, tvb, local_offset+1, 1, ENC_NA);
3722 local_len -= 2;
3723 local_offset += 2;
3725 break;
3726 case 16:
3727 /* Application-Specific Link Attributes (rfc8919) */
3728 local_offset = sub_tlv_offset;
3729 local_len = clv_len;
3730 proto_tree_add_item(subtree, hf_isis_lsp_clv_app_sabm_legacy, tvb, local_offset, 1, ENC_NA);
3731 sabm_length = tvb_get_uint8(tvb, local_offset) & 0x7f;
3732 proto_tree_add_uint(subtree, hf_isis_lsp_clv_app_sabm_length, tvb, local_offset, 1, sabm_length);
3733 proto_tree_add_item(subtree, hf_isis_lsp_clv_app_udabm_reserved, tvb, local_offset + 1, 1, ENC_NA);
3734 udabm_length = tvb_get_uint8(tvb, local_offset + 1) & 0x7f;
3735 proto_tree_add_uint(subtree, hf_isis_lsp_clv_app_udabm_length, tvb, local_offset + 1, 1, udabm_length);
3736 local_offset += 2;
3737 local_len -= 2;
3738 if (sabm_length > 0) {
3739 proto_tree_add_bitmask(subtree, tvb, local_offset,
3740 hf_isis_lsp_clv_app_sabm_bits,
3741 ett_isis_lsp_clv_app_sabm_bits,
3742 isis_lsp_app_sabm_bits, ENC_NA);
3743 local_offset += sabm_length;
3744 local_len -= sabm_length;
3746 if (udabm_length > 0) {
3747 proto_tree_add_item(subtree, hf_isis_lsp_clv_app_udabm_bits,
3748 tvb, local_offset, udabm_length, ENC_NA);
3749 local_offset += udabm_length;
3750 local_len -= udabm_length;
3752 if (local_len > 2) {
3753 /* Dissect Link Attribute sub-sub-TLVs */
3754 dissect_sub_clv_tlv_22_22_23_141_222_223(tvb, pinfo, subtree, local_offset, local_len);
3756 break;
3757 case 18:
3758 proto_tree_add_item(subtree, hf_isis_lsp_ext_is_reachability_traffic_engineering_default_metric,
3759 tvb, sub_tlv_offset, 3, ENC_BIG_ENDIAN);
3760 break;
3761 case 22:
3762 dissect_subclv_bw_ct(tvb, subtree, sub_tlv_offset, clv_len);
3763 break;
3764 case 29:
3765 dissect_subclv_spb_link_metric(tvb, pinfo, subtree,
3766 sub_tlv_offset, clv_code, clv_len);
3767 break;
3768 case 31:
3769 case 32:
3770 dissect_subclv_adj_sid(tvb, pinfo, subtree, sub_tlv_offset, clv_code, clv_len);
3771 break;
3772 case 33:
3773 /* Unidirectional Link Delay (rfc8570) */
3774 proto_tree_add_bitmask(subtree, tvb, sub_tlv_offset,
3775 hf_isis_lsp_ext_is_reachability_unidir_link_flags,
3776 ett_isis_lsp_clv_unidir_link_flags,
3777 unidir_link_flags, ENC_NA);
3778 proto_tree_add_item(subtree, hf_isis_lsp_ext_is_reachability_unidir_link_delay, tvb, sub_tlv_offset+1, 3, ENC_BIG_ENDIAN);
3779 break;
3780 case 34:
3781 /* Min/Max Unidirectional Link Delay (rfc8570) */
3782 proto_tree_add_bitmask(subtree, tvb, sub_tlv_offset,
3783 hf_isis_lsp_ext_is_reachability_unidir_link_flags,
3784 ett_isis_lsp_clv_unidir_link_flags,
3785 unidir_link_flags, ENC_NA);
3786 proto_tree_add_item(subtree, hf_isis_lsp_ext_is_reachability_unidir_link_delay_min, tvb, sub_tlv_offset+1, 3, ENC_BIG_ENDIAN);
3787 proto_tree_add_item(subtree, hf_isis_lsp_ext_is_reachability_unidir_link_reserved, tvb, sub_tlv_offset+4, 1, ENC_NA);
3788 proto_tree_add_item(subtree, hf_isis_lsp_ext_is_reachability_unidir_link_delay_max, tvb, sub_tlv_offset+5, 3, ENC_BIG_ENDIAN);
3789 break;
3790 case 35:
3791 /* Unidirectional Delay Variation (rfc8570) */
3792 proto_tree_add_item(subtree, hf_isis_lsp_ext_is_reachability_unidir_link_reserved, tvb, sub_tlv_offset, 1, ENC_NA);
3793 proto_tree_add_item(subtree, hf_isis_lsp_ext_is_reachability_unidir_delay_variation, tvb, sub_tlv_offset+1, 3, ENC_BIG_ENDIAN);
3794 break;
3795 case 36:
3796 /* Unidirectional Link Loss (rfc8570) */
3797 proto_tree_add_bitmask(subtree, tvb, sub_tlv_offset,
3798 hf_isis_lsp_ext_is_reachability_unidir_link_flags,
3799 ett_isis_lsp_clv_unidir_link_flags,
3800 unidir_link_flags, ENC_NA);
3801 ti = proto_tree_add_item(subtree, hf_isis_lsp_ext_is_reachability_unidir_link_loss, tvb, sub_tlv_offset+1, 3, ENC_BIG_ENDIAN);
3802 if (ti) {
3803 percentage = (float)tvb_get_uint24(tvb, sub_tlv_offset+1, ENC_BIG_ENDIAN);
3804 proto_item_append_text(ti, " (%f %%)", percentage * 0.000003);
3806 break;
3807 case 37:
3808 /* 37: Unidirectional Residual Bandwidth (rfc8570) */
3809 proto_tree_add_item(subtree, hf_isis_lsp_ext_is_reachability_unidir_residual_bandwidth, tvb, sub_tlv_offset, 4, ENC_BIG_ENDIAN);
3810 break;
3811 case 38:
3812 /* 38: Unidirectional Available Bandwidth (rfc8570) */
3813 proto_tree_add_item(subtree, hf_isis_lsp_ext_is_reachability_unidir_available_bandwidth, tvb, sub_tlv_offset, 4, ENC_BIG_ENDIAN);
3814 break;
3815 case 39:
3816 /* 39: Unidirectional Utilized Bandwidth (rfc8570) */
3817 proto_tree_add_item(subtree, hf_isis_lsp_ext_is_reachability_unidir_utilized_bandwidth, tvb, sub_tlv_offset, 4, ENC_BIG_ENDIAN);
3818 break;
3819 case 43:
3820 /* SRv6 End.X SID */
3821 proto_tree_add_bitmask(subtree, tvb, sub_tlv_offset,
3822 hf_isis_lsp_clv_srv6_endx_sid_flags,
3823 ett_isis_lsp_clv_srv6_endx_sid_flags,
3824 srv6_endx_sid_flags, ENC_BIG_ENDIAN);
3825 proto_tree_add_item(subtree, hf_isis_lsp_clv_srv6_endx_sid_alg, tvb, sub_tlv_offset+1, 1, ENC_NA);
3826 proto_tree_add_item(subtree, hf_isis_lsp_clv_srv6_endx_sid_weight, tvb, sub_tlv_offset+2, 1, ENC_BIG_ENDIAN);
3827 proto_tree_add_item(subtree, hf_isis_lsp_clv_srv6_endx_sid_endpoint_behavior, tvb, sub_tlv_offset+3, 2, ENC_NA);
3828 proto_tree_add_item(subtree, hf_isis_lsp_clv_srv6_endx_sid_sid, tvb, sub_tlv_offset+5, 16, ENC_NA);
3829 proto_tree_add_item(subtree, hf_isis_lsp_clv_srv6_endx_sid_subsubclvs_len, tvb, sub_tlv_offset+21, 1, ENC_NA);
3830 subsubclvs_len = tvb_get_uint8(tvb, sub_tlv_offset+21);
3831 local_offset = sub_tlv_offset + 22;
3832 while (subsubclvs_len >= 2) {
3833 ssclv_code = tvb_get_uint8(tvb, local_offset);
3834 ssclv_len = tvb_get_uint8(tvb, local_offset+1);
3835 subsubtree = proto_tree_add_subtree_format(subtree, tvb, local_offset, ssclv_len+2,
3836 ett_isis_lsp_clv_srv6_endx_sid_sub_sub_tlv,
3837 &ti_subsubtree, "subsubTLV: %s (c=%u, l=%u)",
3838 val_to_str_const(ssclv_code, isis_lsp_srv6_loc_end_sid_sub_sub_tlv_vals, "Unknown"),
3839 ssclv_code, ssclv_len);
3840 subsubclvs_len -= 2;
3841 local_offset += 2;
3842 if (ssclv_len > subsubclvs_len) {
3843 proto_tree_add_expert_format(subtree, pinfo,
3844 &ei_isis_lsp_short_clv,
3845 tvb, local_offset-2, 2,
3846 "Too short Sub-Sub-TLV length %u (%d bytes left)",
3847 ssclv_len, subsubclvs_len);
3848 break;
3850 switch (ssclv_code) {
3851 case 1:
3852 /* SRv6 SID Structure (rfc9352) */
3853 dissect_srv6_sid_struct_subsubclv(tvb, pinfo, subsubtree, ti_subsubtree,
3854 local_offset, ssclv_code, ssclv_len);
3855 break;
3856 default:
3857 proto_tree_add_expert_format(subsubtree, pinfo, &ei_isis_lsp_subtlv, tvb,
3858 local_offset, ssclv_len,
3859 "Unknown Sub-Sub-TLV: Type: %u, Length: %u",
3860 ssclv_code, ssclv_len);
3861 break;
3863 subsubclvs_len -= ssclv_len;
3864 local_offset += ssclv_len;
3866 break;
3867 case 44:
3868 /* SRv6 LAN End.X SID */
3869 proto_tree_add_item(subtree, hf_isis_lsp_clv_srv6_endx_sid_system_id, tvb, sub_tlv_offset, 6, ENC_NA);
3870 proto_tree_add_bitmask(subtree, tvb, sub_tlv_offset+6,
3871 hf_isis_lsp_clv_srv6_endx_sid_flags,
3872 ett_isis_lsp_clv_srv6_endx_sid_flags,
3873 srv6_endx_sid_flags, ENC_BIG_ENDIAN);
3874 proto_tree_add_item(subtree, hf_isis_lsp_clv_srv6_endx_sid_alg, tvb, sub_tlv_offset+7, 1, ENC_NA);
3875 proto_tree_add_item(subtree, hf_isis_lsp_clv_srv6_endx_sid_weight, tvb, sub_tlv_offset+8, 1, ENC_BIG_ENDIAN);
3876 proto_tree_add_item(subtree, hf_isis_lsp_clv_srv6_endx_sid_endpoint_behavior, tvb, sub_tlv_offset+9, 2, ENC_NA);
3877 proto_tree_add_item(subtree, hf_isis_lsp_clv_srv6_endx_sid_sid, tvb, sub_tlv_offset+11, 16, ENC_NA);
3878 proto_tree_add_item(subtree, hf_isis_lsp_clv_srv6_endx_sid_subsubclvs_len, tvb, sub_tlv_offset+27, 1, ENC_NA);
3879 subsubclvs_len = tvb_get_uint8(tvb, sub_tlv_offset+27);
3880 local_offset = sub_tlv_offset+28;
3881 while (subsubclvs_len >= 2) {
3882 ssclv_code = tvb_get_uint8(tvb, local_offset);
3883 ssclv_len = tvb_get_uint8(tvb, local_offset+1);
3884 subsubtree = proto_tree_add_subtree_format(subtree, tvb, local_offset, ssclv_len+2,
3885 ett_isis_lsp_clv_srv6_endx_sid_sub_sub_tlv,
3886 &ti_subsubtree, "subsubTLV: %s (c=%u, l=%u)",
3887 val_to_str_const(ssclv_code, isis_lsp_srv6_loc_end_sid_sub_sub_tlv_vals, "Unknown"),
3888 ssclv_code, ssclv_len);
3889 subsubclvs_len -= 2;
3890 local_offset += 2;
3891 if (ssclv_len > subsubclvs_len) {
3892 proto_tree_add_expert_format(subtree, pinfo,
3893 &ei_isis_lsp_short_clv,
3894 tvb, local_offset-2, 2,
3895 "Too short Sub-Sub-TLV length %u (%d bytes left)",
3896 ssclv_len, subsubclvs_len);
3897 break;
3899 switch (ssclv_code) {
3900 case 1:
3901 /* SRv6 SID Structure (rfc9352) */
3902 dissect_srv6_sid_struct_subsubclv(tvb, pinfo, subsubtree, ti_subsubtree,
3903 local_offset, ssclv_code, ssclv_len);
3904 break;
3905 default:
3906 proto_tree_add_expert_format(subsubtree, pinfo, &ei_isis_lsp_subtlv, tvb,
3907 local_offset, ssclv_len,
3908 "Unknown Sub-Sub-TLV: Type: %u, Length: %u",
3909 ssclv_code, ssclv_len);
3910 break;
3912 subsubclvs_len -= ssclv_len;
3913 local_offset += ssclv_len;
3915 break;
3916 default:
3917 proto_tree_add_item(subtree, hf_isis_lsp_ext_is_reachability_value, tvb, sub_tlv_offset, clv_len, ENC_NA);
3918 break;
3920 i += clv_len + 2;
3922 decrement_dissection_depth(pinfo);
3927 * Name: dissect_lsp_ext_is_reachability_clv()
3929 * Description: Decode a Extended IS Reachability CLV - code 22
3930 * RFC 3784
3932 * The extended IS reachability TLV is an extended version
3933 * of the IS reachability TLV (code 2). It encodes the metric
3934 * as a 24-bit unsigned integer and allows to add sub-CLV(s).
3936 * CALLED BY TLV 222 DISSECTOR
3938 * Input:
3939 * tvbuff_t * : tvbuffer for packet data
3940 * proto_tree * : protocol display tree to fill out. May be NULL
3941 * int : offset into packet data where we are.
3942 * int : length of IDs in packet.
3943 * int : length of clv we are decoding
3945 * Output:
3946 * void, but we will add to proto tree if !NULL.
3949 static void
3950 dissect_lsp_ext_is_reachability_clv(tvbuff_t *tvb, packet_info* pinfo, proto_tree *tree,
3951 int offset, isis_data_t *isis _U_, int length)
3953 proto_item *ti, *ti_subclvs_len;
3954 proto_tree *ntree = NULL;
3955 unsigned subclvs_len;
3956 unsigned len;
3958 while (length > 0) {
3959 ntree = proto_tree_add_subtree(tree, tvb, offset, -1,
3960 ett_isis_lsp_part_of_clv_ext_is_reachability, &ti, "IS Neighbor");
3962 proto_tree_add_item(ntree, hf_isis_lsp_ext_is_reachability_is_neighbor_id, tvb, offset, 7, ENC_NA);
3963 proto_item_append_text(ti, ": %s", tvb_print_system_id(pinfo->pool, tvb, offset, 7));
3965 proto_tree_add_item(ntree, hf_isis_lsp_ext_is_reachability_metric, tvb, offset+7, 3, ENC_BIG_ENDIAN);
3967 ti_subclvs_len = proto_tree_add_item(ntree, hf_isis_lsp_ext_is_reachability_subclvs_len, tvb, offset+10, 1, ENC_BIG_ENDIAN);
3969 subclvs_len = tvb_get_uint8(tvb, offset+10);
3970 if (subclvs_len == 0) {
3971 proto_item_append_text(ti_subclvs_len, " (no sub-TLVs present)");
3973 else {
3974 dissect_sub_clv_tlv_22_22_23_141_222_223(tvb, pinfo, ntree,
3975 offset + 11, subclvs_len);
3978 len = 11 + subclvs_len;
3979 proto_item_set_len (ti, len);
3980 offset += len;
3981 length -= len;
3986 * Name: dissect_lsp_mt_reachable_IPv4_prefx_clv()
3988 * Description: Decode Multi-Topology IPv4 Prefixes - code 235
3991 * Input:
3992 * tvbuff_t * : tvbuffer for packet data
3993 * proto_tree * : protocol display tree to fill out. May be NULL
3994 * int : offset into packet data where we are.
3995 * int : length of IDs in packet.
3996 * int : length of clv we are decoding
3998 * Output:
3999 * void, but we will add to proto tree if !NULL.
4001 static void
4002 dissect_lsp_mt_reachable_IPv4_prefx_clv(tvbuff_t *tvb, packet_info* pinfo,
4003 proto_tree *tree, int offset, isis_data_t *isis _U_, int length)
4005 if (length < 2) {
4006 proto_tree_add_expert_format(tree, pinfo, &ei_isis_lsp_short_clv, tvb, offset, -1,
4007 "short lsp multi-topology reachable IPv4 prefixes(%d vs %d)", length, 2 );
4008 return;
4010 dissect_lsp_mt_id(tvb, tree, offset);
4011 dissect_lsp_ext_ip_reachability_clv(tvb, pinfo, tree, offset+2, 0, length-2);
4015 * Name: dissect_lsp_mt_reachable_IPv6_prefx_clv()
4017 * Description: Decode Multi-Topology IPv6 Prefixes - code 237
4020 * Input:
4021 * tvbuff_t * : tvbuffer for packet data
4022 * proto_tree * : protocol display tree to fill out. May be NULL
4023 * int : offset into packet data where we are.
4024 * int : length of IDs in packet.
4025 * int : length of clv we are decoding
4027 * Output:
4028 * void, but we will add to proto tree if !NULL.
4030 static void
4031 dissect_lsp_mt_reachable_IPv6_prefx_clv(tvbuff_t *tvb, packet_info* pinfo,
4032 proto_tree *tree, int offset, isis_data_t *isis _U_, int length)
4034 if (length < 2) {
4035 proto_tree_add_expert_format(tree, pinfo, &ei_isis_lsp_short_clv, tvb, offset, -1,
4036 "short lsp multi-topology reachable IPv6 prefixes(%d vs %d)", length, 2 );
4037 return;
4039 dissect_lsp_mt_id(tvb, tree, offset);
4040 dissect_lsp_ipv6_reachability_clv(tvb, pinfo, tree, offset+2, 0, length-2);
4045 * Name: dissect_lsp_mt_is_reachability_clv()
4047 * Description: Decode Multi-Topology Intermediate Systems - code 222
4050 * Input:
4051 * tvbuff_t * : tvbuffer for packet data
4052 * proto_tree * : protocol display tree to fill out. May be NULL
4053 * int : offset into packet data where we are.
4054 * int : unused
4055 * int : length of clv we are decoding
4057 * Output:
4058 * void, but we will add to proto tree if !NULL.
4061 static void
4062 dissect_lsp_mt_is_reachability_clv(tvbuff_t *tvb, packet_info* pinfo, proto_tree *tree, int offset,
4063 isis_data_t *isis _U_, int length)
4065 if (length < 2) {
4066 proto_tree_add_expert_format(tree, pinfo, &ei_isis_lsp_short_clv, tvb, offset, -1,
4067 "short lsp reachability(%d vs %d)", length, 2 );
4068 return;
4072 * the MT ID value dissection is used in other LSPs so we push it
4073 * in a function
4075 dissect_lsp_mt_id(tvb, tree, offset);
4077 * fix here. No need to parse TLV 22 (with bugs) while it is
4078 * already done correctly!!
4080 dissect_lsp_ext_is_reachability_clv(tvb, pinfo, tree, offset+2, 0, length-2);
4085 * Name: dissect_lsp_ori_buffersize_clv()
4087 * Description:
4088 * This CLV is used give neighbor buffer size
4090 * Input:
4091 * tvbuff_t * : tvbuffer for packet data
4092 * proto_tree * : protocol display tree to fill out. May be NULL
4093 * int : offset into packet data where we are.
4094 * int : length of IDs in packet.
4095 * int : length of clv we are decoding
4097 * Output:
4098 * void, but we will add to proto tree if !NULL.
4100 static void
4101 dissect_lsp_ori_buffersize_clv(tvbuff_t *tvb, packet_info* pinfo, proto_tree *tree, int offset,
4102 isis_data_t *isis, int length)
4104 if ( length != 2 ) {
4105 proto_tree_add_expert_format(tree, pinfo, &ei_isis_lsp_short_clv, tvb, offset, -1,
4106 "short lsp partition DIS(%d vs %d)", length, isis->system_id_len );
4107 return;
4110 * Gotta build a sub-tree for all our pieces
4112 proto_tree_add_item(tree, hf_isis_lsp_originating_lsp_buffer_size, tvb, offset, length, ENC_BIG_ENDIAN);
4117 * Name: dissect_lsp_partition_dis_clv()
4119 * Description:
4120 * This CLV is used to indicate which system is the designated
4121 * IS for partition repair. This means just putting out the
4122 * "isis->system_id_len"-octet IS.
4124 * Input:
4125 * tvbuff_t * : tvbuffer for packet data
4126 * proto_tree * : protocol display tree to fill out. May be NULL
4127 * int : offset into packet data where we are.
4128 * int : length of IDs in packet.
4129 * int : length of clv we are decoding
4131 * Output:
4132 * void, but we will add to proto tree if !NULL.
4134 static void
4135 dissect_lsp_partition_dis_clv(tvbuff_t *tvb, packet_info* pinfo, proto_tree *tree, int offset,
4136 isis_data_t *isis, int length)
4138 if ( length < isis->system_id_len ) {
4139 proto_tree_add_expert_format(tree, pinfo, &ei_isis_lsp_short_clv, tvb, offset, -1,
4140 "short lsp partition DIS(%d vs %d)", length, isis->system_id_len );
4141 return;
4144 * Gotta build a sub-tree for all our pieces
4146 proto_tree_add_item( tree, hf_isis_lsp_partition_designated_l2_is, tvb, offset, isis->system_id_len, ENC_NA);
4148 length -= isis->system_id_len;
4149 offset += isis->system_id_len;
4150 if ( length > 0 ) {
4151 proto_tree_add_expert_format(tree, pinfo, &ei_isis_lsp_long_clv, tvb, offset, -1,
4152 "Long lsp partition DIS, %d left over", length );
4153 return;
4158 * Name: dissect_lsp_prefix_neighbors_clv()
4160 * Description:
4161 * The prefix CLV describes what other (OSI) networks we can reach
4162 * and what their cost is. It is built from a metric block
4163 * (see dissect_metric) followed by n addresses.
4165 * Input:
4166 * tvbuff_t * : tvbuffer for packet data
4167 * proto_tree * : protocol display tree to fill out. May be NULL
4168 * int : offset into packet data where we are.
4169 * int : length of IDs in packet.
4170 * int : length of clv we are decoding
4172 * Output:
4173 * void, but we will add to proto tree if !NULL.
4175 static void
4176 dissect_lsp_prefix_neighbors_clv(tvbuff_t *tvb, packet_info* pinfo, proto_tree *tree, int offset,
4177 isis_data_t *isis _U_, int length)
4179 char *sbuf;
4180 int mylen;
4182 if ( length < 4 ) {
4183 proto_tree_add_expert_format(tree, pinfo, &ei_isis_lsp_short_clv, tvb, offset, -1,
4184 "Short lsp prefix neighbors (%d vs 4)", length );
4185 return;
4187 if ( tree ) {
4188 dissect_metric (tvb, pinfo, tree, offset,
4189 hf_isis_lsp_default, hf_isis_lsp_default_support, true );
4190 dissect_metric (tvb, pinfo, tree, offset+1,
4191 hf_isis_lsp_delay, hf_isis_lsp_delay_support, false );
4192 dissect_metric (tvb, pinfo, tree, offset+2,
4193 hf_isis_lsp_expense, hf_isis_lsp_expense_support, false );
4194 dissect_metric (tvb, pinfo, tree, offset+3,
4195 hf_isis_lsp_error, hf_isis_lsp_error_support, false );
4197 offset += 4;
4198 length -= 4;
4199 while ( length > 0 ) {
4201 * This is a length in "semi-octets", i.e., in nibbles.
4203 mylen = tvb_get_uint8(tvb, offset);
4204 length--;
4205 if (length<=0) {
4206 proto_tree_add_expert_format(tree, pinfo, &ei_isis_lsp_short_clv, tvb, offset, -1,
4207 "Zero payload space after length in prefix neighbor" );
4208 return;
4210 if ( mylen > length*2) {
4211 proto_tree_add_expert_format(tree, pinfo, &ei_isis_lsp_long_clv, tvb, offset, -1,
4212 "Integral length of prefix neighbor too long (%d vs %d)", mylen, length*2 );
4213 return;
4217 * Lets turn the area address into "standard" 0000.0000.etc
4218 * format string.
4220 sbuf = print_address_prefix( pinfo->pool, tvb, offset+1, mylen );
4221 /* and spit it out */
4222 proto_tree_add_string( tree, hf_isis_lsp_area_address_str, tvb, offset, (mylen+1)/2 + 1, sbuf);
4224 offset += mylen + 1;
4225 length -= mylen; /* length already adjusted for len fld*/
4230 * Name: dissect_lsp_ipv6_te_router_id()
4232 * Description: Decode an IPv6 TE Router ID CLV - code 140.
4234 * Calls into the clv common one.
4236 * Input:
4237 * tvbuff_t * : tvbuffer for packet data
4238 * proto_tree * : proto tree to build on (may be null)
4239 * int : current offset into packet data
4240 * int : length of IDs in packet.
4241 * int : length of this clv
4243 * Output:
4244 * void, will modify proto_tree if not null.
4246 static void
4247 dissect_lsp_ipv6_te_router_id_clv(tvbuff_t *tvb, packet_info* pinfo, proto_tree *tree, int offset,
4248 isis_data_t *isis _U_, int length)
4250 isis_dissect_ipv6_int_clv(tree, pinfo, tvb, &ei_isis_lsp_short_clv, offset, length,
4251 hf_isis_lsp_clv_ipv6_te_router_id );
4255 * Name: dissect_lsp_srv6_locator_subclv ()
4257 * Description: parses IP reach subTLVs
4258 * Called by various IP Reachability dissectors.
4260 * Input:
4261 * tvbuff_t * : tvbuffer for packet data
4262 * packet_info * : expert error misuse reporting
4263 * proto_tree * : protocol display tree to fill out.
4264 * int : offset into packet data where we are (beginning of the sub_clv value).
4266 * Output:
4267 * void
4269 static void
4270 dissect_lsp_srv6_locator_subclv(tvbuff_t *tvb, packet_info *pinfo,
4271 proto_tree *subtree, proto_item *subtree_item,
4272 int offset, int length, int clv_code, int clv_len)
4274 int subsubclvs_len;
4275 int ssclv_code, ssclv_len;
4276 proto_tree *subsubtree;
4277 proto_item *ti_subsubtree = NULL;
4279 switch (clv_code) {
4280 case 4:
4281 /* Prefix Attribute Flags */
4282 dissect_prefix_attr_flags_subclv(tvb, pinfo, subtree, subtree_item, offset, clv_code, clv_len);
4283 break;
4284 case 5:
4285 /* SRv6 End SID */
4286 if (clv_len < 20) {
4287 proto_tree_add_expert_format(subtree, pinfo, &ei_isis_lsp_malformed_subtlv, tvb, offset-2, clv_len+2,
4288 "Invalid SubSub-TLV Length (%d vs min 20)", clv_len);
4289 break;
4291 proto_tree_add_item(subtree, hf_isis_lsp_clv_srv6_end_sid_flags, tvb, offset, 1, ENC_NA);
4292 proto_tree_add_item(subtree, hf_isis_lsp_clv_srv6_end_sid_endpoint_behavior, tvb, offset+1, 2, ENC_NA);
4293 proto_tree_add_item(subtree, hf_isis_lsp_clv_srv6_end_sid_sid, tvb, offset+3, 16, ENC_NA);
4294 proto_tree_add_item(subtree, hf_isis_lsp_clv_srv6_end_sid_subsubclvs_len, tvb, offset+19, 1, ENC_NA);
4295 subsubclvs_len = tvb_get_uint8(tvb, offset + 19);
4296 offset += 20;
4297 length -= 20;
4298 if (subsubclvs_len > length) {
4299 proto_tree_add_expert_format(subtree, pinfo, &ei_isis_lsp_short_clv, tvb, offset-1, 1,
4300 "Too short SRv6 End SID Sub-Sub-TLV length %u (%d bytes left)",
4301 subsubclvs_len, length);
4302 break;
4304 while (subsubclvs_len >= 2) {
4305 ssclv_code = tvb_get_uint8(tvb, offset);
4306 ssclv_len = tvb_get_uint8(tvb, offset + 1);
4307 subsubtree = proto_tree_add_subtree_format(subtree, tvb, offset, ssclv_len+2,
4308 ett_isis_lsp_clv_srv6_loc_end_sid_sub_sub_tlv,
4309 &ti_subsubtree,
4310 "subsubTLV: %s (c=%u, l=%u)",
4311 val_to_str_const(ssclv_code, isis_lsp_srv6_loc_end_sid_sub_sub_tlv_vals, "Unknown"),
4312 ssclv_code, ssclv_len);
4313 offset += 2;
4314 subsubclvs_len -= 2;
4315 if (ssclv_len > subsubclvs_len) {
4316 proto_tree_add_expert_format(subtree, pinfo, &ei_isis_lsp_short_clv, tvb, offset-2, 2,
4317 "Invalid Sub-Sub-TLV length (%u vs %d bytes left)",
4318 ssclv_len, subsubclvs_len);
4319 break;
4321 switch (ssclv_code) {
4322 case 1:
4323 /* SRv6 SID Structure (rfc9352) */
4324 dissect_srv6_sid_struct_subsubclv(tvb, pinfo, subsubtree, ti_subsubtree,
4325 offset, ssclv_code, ssclv_len);
4326 break;
4327 default:
4328 proto_tree_add_expert_format(subsubtree, pinfo, &ei_isis_lsp_subtlv, tvb,
4329 offset, ssclv_len,
4330 "Unknown Sub-Sub-TLV: Type: %u, Length: %u",
4331 ssclv_code, ssclv_len);
4332 break;
4334 offset += ssclv_len;
4335 subsubclvs_len -= ssclv_len;
4337 break;
4338 default:
4339 proto_tree_add_expert_format(subtree, pinfo, &ei_isis_lsp_subtlv, tvb,
4340 offset, clv_len,
4341 "Unknown Sub-TLV: Type: %u, Length: %u", clv_code, clv_len);
4342 break;
4347 * Name: dissect_lsp_srv6_locator_entry()
4349 * Description: Decode each SRv6 locator entry in SRv6 Locator TLV
4351 * Input:
4352 * tvbuff_t * : tvbuffer for packet data
4353 * packet_info * : expert error misuse reporting
4354 * proto_tree * : proto tree to build on (may be null)
4355 * int : current offset into packet data
4356 * isis_data_t : data given to subdissectors
4357 * int : length of clv we are decoding
4359 * Output:
4360 * int : Length of each SRv6 locator entry (-1 when it cannot dissect)
4362 static int
4363 dissect_lsp_srv6_locator_entry(tvbuff_t *tvb, packet_info* pinfo,
4364 proto_tree *tree, int offset,
4365 isis_data_t *isis _U_, int length)
4367 int locator_length;
4368 proto_tree *loctree = NULL;
4369 proto_item *ti_loctree = NULL;
4370 uint32_t bit_length;
4371 int byte_length;
4372 ws_in6_addr prefix;
4373 address prefix_addr;
4374 char *prefix_str;
4375 uint8_t algorithm;
4376 int subtlv_length;
4377 int clv_code, clv_len;
4378 proto_item *ti_subtree = NULL;
4379 proto_tree *subtree = NULL;
4381 if (length < 9) {
4382 proto_tree_add_expert_format(tree, pinfo, &ei_isis_lsp_short_clv, tvb, offset, length,
4383 "Too short SRv6 locator entry (%d vs min 9)",
4384 length);
4385 return (-1);
4388 /* (1) Determine the length of each SRv6 locator entry, first */
4389 /* Loc Size */
4390 bit_length = tvb_get_uint8(tvb, offset+6);
4391 if (bit_length <= 0 || bit_length > 128) {
4392 proto_tree_add_expert_format(tree, pinfo, &ei_isis_lsp_malformed_subtlv, tvb, offset+6, 1,
4393 "Invalid SRv6 locator size %u (should be 1-128)",
4394 bit_length);
4395 return (-1);
4397 byte_length = (bit_length + 7) / 8;
4398 if (length < 7 + byte_length + 1) {
4399 proto_tree_add_expert_format(tree, pinfo, &ei_isis_lsp_short_clv, tvb, offset, length,
4400 "Too short SRv6 locator entry (%d vs min %d)",
4401 length, 7+byte_length+1);
4402 return (-1);
4405 /* Sub-TLV Length */
4406 subtlv_length = tvb_get_uint8(tvb, offset+7+byte_length);
4408 /* Length of each SRv6 locator */
4409 locator_length = (7 + byte_length + 1) + subtlv_length;
4410 if (length < locator_length) {
4411 proto_tree_add_expert_format(tree, pinfo, &ei_isis_lsp_malformed_subtlv, tvb, offset, length,
4412 "Too short SRv6 locator entry (%d vs %d bytes left)",
4413 locator_length, length);
4414 return (-1);
4417 /* (2) Dissect each SRv6 locator entry */
4418 loctree = proto_tree_add_subtree_format(tree, tvb, offset, locator_length,
4419 ett_isis_lsp_clv_srv6_loc_entry,
4420 &ti_loctree, "SRv6 Locator");
4421 /* Metric */
4422 proto_tree_add_item(loctree, hf_isis_lsp_srv6_loc_metric, tvb, offset, 4, ENC_BIG_ENDIAN);
4423 offset += 4;
4424 length -= 4;
4426 /* Flags */
4427 proto_tree_add_bitmask(loctree, tvb, offset, hf_isis_lsp_srv6_loc_flags,
4428 ett_isis_lsp_clv_srv6_loc_flags, srv6_locator_flags, ENC_NA);
4429 offset++;
4430 length--;
4432 /* Algorithm */
4433 algorithm = tvb_get_uint8(tvb, offset);
4434 proto_tree_add_item(loctree, hf_isis_lsp_srv6_loc_alg, tvb, offset, 1, ENC_BIG_ENDIAN);
4435 offset++;
4436 length--;
4438 /* Locator Size */
4439 proto_tree_add_item(loctree, hf_isis_lsp_srv6_loc_size, tvb, offset, 1, ENC_BIG_ENDIAN);
4440 offset++;
4441 length--;
4443 /* Locator */
4444 (void)tvb_get_ipv6_addr_with_prefix_len(tvb, offset, &prefix, bit_length);
4445 proto_tree_add_ipv6(loctree, hf_isis_lsp_srv6_loc_locator, tvb, offset, byte_length, &prefix);
4446 offset += byte_length;
4447 length -= byte_length;
4449 /* Sub-TLV Length */
4450 subtlv_length = tvb_get_uint8(tvb, offset);
4451 proto_tree_add_item(loctree, hf_isis_lsp_srv6_loc_subclvs_len, tvb, offset, 1, ENC_NA);
4452 offset++;
4453 length--;
4455 set_address(&prefix_addr, AT_IPv6, 16, prefix.bytes);
4456 prefix_str = address_to_str(pinfo->pool, &prefix_addr);
4457 proto_item_append_text(ti_loctree, ": %s/%u (Algorithm: %u)", prefix_str, bit_length, algorithm);
4459 while (subtlv_length >= 2) {
4460 clv_code = tvb_get_uint8(tvb, offset);
4461 clv_len = tvb_get_uint8(tvb, offset+1);
4462 subtree = proto_tree_add_subtree_format(loctree, tvb, offset, clv_len + 2,
4463 ett_isis_lsp_clv_srv6_loc_sub_tlv,
4464 &ti_subtree, "subTLV: %s (c=%u, l=%u)",
4465 val_to_str_const(clv_code, isis_lsp_srv6_loc_sub_tlv_vals, "Unknown"),
4466 clv_code, clv_len);
4467 proto_tree_add_item(subtree, hf_isis_lsp_srv6_loc_sub_tlv_type, tvb, offset, 1, ENC_BIG_ENDIAN);
4468 proto_tree_add_item(subtree, hf_isis_lsp_srv6_loc_sub_tlv_length, tvb, offset+1, 1, ENC_BIG_ENDIAN);
4469 offset += 2;
4470 subtlv_length -= 2;
4471 if (clv_len > subtlv_length) {
4472 proto_tree_add_expert_format(subtree, pinfo, &ei_isis_lsp_malformed_subtlv, tvb, offset-1, 1,
4473 "Invalid Sub-TLV length %u (%d bytes left)",
4474 clv_len, subtlv_length);
4475 return (-1);
4477 dissect_lsp_srv6_locator_subclv(tvb, pinfo, subtree, ti_subtree, offset, subtlv_length, clv_code, clv_len);
4478 offset += clv_len;
4479 subtlv_length -= clv_len;
4482 /* Return the length of each SRv6 locator entry */
4483 return locator_length;
4487 * Name: dissect_lsp_srv6_locator_clv()
4489 * Description: Decode an SRv6 Locator CLV - code 27.
4491 * CALLED BY TLV 27 DISSECTOR
4493 * Input:
4494 * tvbuff_t * : tvbuffer for packet data
4495 * packet_info * : expert error misuse reporting
4496 * proto_tree * : proto tree to build on (may be null)
4497 * int : current offset into packet data
4498 * int : length of IDs in packet.
4499 * int : length of this clv
4501 * Output:
4502 * void, will modify proto_tree if not null.
4504 static void
4505 dissect_lsp_srv6_locator_clv(tvbuff_t *tvb, packet_info* pinfo, proto_tree *tree, int offset,
4506 isis_data_t *isis, int length)
4508 int locator_length;
4510 if (length < 11) {
4511 proto_tree_add_expert_format(tree, pinfo, &ei_isis_lsp_short_clv, tvb, offset, length,
4512 "Too short LSP SRv6 locator TLV (%d vs min 11)", length);
4513 return;
4516 /* MTID */
4517 dissect_lsp_mt_id(tvb, tree, offset);
4518 offset += 2;
4519 length -= 2;
4521 /* Dissect each SRv6 Locator */
4522 while (length > 0) {
4523 locator_length = dissect_lsp_srv6_locator_entry(tvb, pinfo, tree, offset, isis, length);
4524 if (locator_length < 0) {
4525 break;
4527 offset += locator_length;
4528 length -= locator_length;
4533 * Name: dissect_lsp_purge_orig_id_clv()
4535 * Description: Decode a Purge Originator ID CLV - code 13.
4537 * CALLED BY TLV 13 DISSECTOR
4539 * Input:
4540 * tvbuff_t * : tvbuffer for packet data
4541 * packet_info * : expert error misuse reporting
4542 * proto_tree * : proto tree to build on (may be null)
4543 * int : current offset into packet data
4544 * isis_data_t : data given to subdissectors
4545 * int : length of clv we are decoding
4547 * Output:
4548 * void, will modify proto_tree if not null.
4550 static void
4551 dissect_lsp_purge_orig_id_clv(tvbuff_t *tvb, packet_info* pinfo, proto_tree *tree, int offset,
4552 isis_data_t *isis _U_, int length)
4554 int min_tlv_len = 7;
4555 uint8_t num_of_system_ids;
4556 int i;
4558 if (length < min_tlv_len) {
4559 proto_tree_add_expert_format(tree, pinfo, &ei_isis_lsp_short_clv, tvb, offset, length,
4560 "Too short LSP Purge Originator ID (%d vs %d)",
4561 length, min_tlv_len);
4562 return;
4565 /* Number of System IDs */
4566 num_of_system_ids = tvb_get_uint8(tvb, offset);
4567 proto_tree_add_item(tree, hf_isis_lsp_purge_orig_id_num, tvb, offset, 1, ENC_NA);
4568 offset++;
4569 length--;
4571 if (num_of_system_ids != 1 && num_of_system_ids != 2) {
4572 proto_tree_add_expert_format(tree, pinfo, &ei_isis_lsp_malformed_subtlv, tvb, offset, length,
4573 "Invalid number of System IDs: %u (should be 1 or 2)",
4574 num_of_system_ids);
4575 return;
4577 if (length < num_of_system_ids * 6) {
4578 proto_tree_add_expert_format(tree, pinfo, &ei_isis_lsp_malformed_subtlv, tvb, offset, length,
4579 "Invalid Purge Originator ID TLV length: %u ",
4580 length+1);
4581 return;
4583 for (i = 0; i < num_of_system_ids; i++) {
4584 proto_tree_add_item(tree, hf_isis_lsp_purge_orig_id_system_id, tvb, offset, 6, ENC_NA);
4585 offset += 6;
4586 length -= 6;
4590 /* rfc6165: MAC Reachability */
4591 static void
4592 dissect_lsp_mac_reachability(tvbuff_t *tvb, packet_info* pinfo _U_, proto_tree *tree, int offset,
4593 isis_data_t *isis _U_, int length)
4595 int num_macs;
4596 int count;
4597 bool is_avaya = true; // JMayer: FIXME Add preference or determine from other parts of packet
4599 if ((length - 5) % 6) {
4600 proto_tree_add_expert_format(tree, pinfo, &ei_isis_lsp_length_clv, tvb, offset, length,
4601 "Unexpected length of MAC Reachability TLV (%d vs 5 + N*6)",
4602 length);
4603 return;
4605 num_macs = (length -5) / 6;
4607 proto_tree_add_item(tree, hf_isis_lsp_mac_reachability_topoid_nick, tvb, offset, 2, ENC_NA);
4608 offset += 2;
4609 proto_tree_add_item(tree, hf_isis_lsp_mac_reachability_confidence, tvb, offset, 1, ENC_NA);
4610 offset += 1;
4611 proto_tree_add_item(tree, hf_isis_lsp_mac_reachability_reserved, tvb, offset, 2, ENC_NA);
4612 proto_tree_add_item(tree, hf_isis_lsp_mac_reachability_vlan, tvb, offset, 2, ENC_BIG_ENDIAN);
4613 offset += 2;
4615 for (count = 1; count <= num_macs; count++) {
4616 if (is_avaya && count == 1 )
4617 proto_tree_add_item(tree, hf_isis_lsp_mac_reachability_chassismac, tvb, offset, 6, ENC_NA);
4618 else if (is_avaya && count == 2)
4619 proto_tree_add_item(tree, hf_isis_lsp_mac_reachability_fanmcast, tvb, offset, 6, ENC_NA);
4620 else
4621 proto_tree_add_item(tree, hf_isis_lsp_mac_reachability_mac, tvb, offset + 5, 6, ENC_NA);
4622 offset += 6;
4626 static void
4627 dissect_lsp_avaya_ipvpn(tvbuff_t *tvb, packet_info* pinfo _U_, proto_tree *tree, int offset,
4628 isis_data_t *isis _U_, int length)
4630 unsigned subtlvbytes;
4631 proto_item *ti;
4632 proto_item *ti_pfxlen, *ti_prefix;
4633 proto_tree *subtlvtree;
4634 unsigned subtype;
4635 unsigned sublength;
4637 if (length < 15) {
4638 proto_tree_add_expert_format(tree, pinfo, &ei_isis_lsp_short_clv, tvb, offset, length,
4639 "Too short LSP Avaya IPVPN (%d vs min 15)",
4640 length);
4641 return;
4643 proto_tree_add_item(tree, hf_isis_lsp_avaya_ipvpn_unknown, tvb, offset, 4, ENC_NA);
4644 offset += 4;
4645 proto_tree_add_item(tree, hf_isis_lsp_avaya_ipvpn_system_id, tvb, offset, 7, ENC_NA);
4646 offset += 7;
4647 proto_tree_add_item(tree, hf_isis_lsp_avaya_ipvpn_vrfsid, tvb, offset, 3, ENC_BIG_ENDIAN);
4648 offset += 3;
4649 proto_tree_add_item_ret_uint(tree, hf_isis_lsp_avaya_ipvpn_subtlvbytes, tvb, offset, 1, ENC_NA, &subtlvbytes);
4650 offset += 1;
4652 if ((unsigned)length != 15+subtlvbytes) {
4653 proto_tree_add_expert_format(tree, pinfo, &ei_isis_lsp_length_clv, tvb, offset, length,
4654 "Inconsistent length of LSP Avaya IPVPN with subtlvs (%d vs min %d)",
4655 length, 15 + subtlvbytes);
4656 return;
4658 while (subtlvbytes > 0) {
4659 if (subtlvbytes == 1) {
4660 proto_tree_add_expert_format(tree, pinfo, &ei_isis_lsp_malformed_subtlv, tvb, offset, length,
4661 "Too few bytes remaining for Sub-TLV header (1 vs 2)");
4662 return;
4664 subtype = tvb_get_uint8(tvb, offset);
4665 sublength = tvb_get_uint8(tvb, offset + 1);
4666 subtlvtree = proto_tree_add_subtree_format(tree, tvb, offset, sublength + 2, ett_isis_lsp_clv_avaya_ipvpn_subtlv, &ti, "%s",
4667 val_to_str_const(subtype, isis_lsp_avaya_ipvpn_subtlv_code_vals, "Unknown"));
4668 proto_tree_add_item(subtlvtree, hf_isis_lsp_avaya_ipvpn_subtlvtype, tvb, offset, 1, ENC_NA);
4669 proto_tree_add_item(subtlvtree, hf_isis_lsp_avaya_ipvpn_subtlvlength, tvb, offset + 1, 1, ENC_NA);
4670 offset += 2;
4671 switch (subtype) {
4672 case 1: /* Metric Type */
4673 if (sublength != 4) {
4674 proto_tree_add_expert_format(subtlvtree, pinfo, &ei_isis_lsp_malformed_subtlv, tvb, offset, sublength,
4675 "Unexpected Metric Type sub-TLV length (%d vs 4)", sublength);
4676 offset += sublength;
4677 } else {
4678 proto_tree_add_item(subtlvtree, hf_isis_lsp_avaya_ipvpn_ipv4_metrictype, tvb, offset, 4, ENC_BIG_ENDIAN);
4679 offset += 4;
4681 break;
4682 case 135: /* IPv4 */
4683 if (sublength != 12) {
4684 proto_tree_add_expert_format(subtlvtree, pinfo, &ei_isis_lsp_malformed_subtlv, tvb, offset, sublength,
4685 "Unexpected IPv4 Reachability sub-TLV length (%d vs 12)", sublength);
4686 offset += sublength;
4687 } else {
4688 proto_tree_add_item(subtlvtree, hf_isis_lsp_avaya_ipvpn_ipv4_metric, tvb, offset, 4, ENC_BIG_ENDIAN);
4689 offset += 4;
4690 ti_prefix = proto_tree_add_item(subtlvtree, hf_isis_lsp_avaya_ipvpn_ipv4_addr, tvb, offset, 4, ENC_BIG_ENDIAN);
4691 offset += 4;
4692 ti_pfxlen = proto_tree_add_item(subtlvtree, hf_isis_lsp_avaya_ipvpn_ipv4_mask, tvb, offset, 4, ENC_BIG_ENDIAN);
4693 offset += 4;
4694 proto_item_append_text(ti, ": %s/%s", proto_item_get_display_repr(pinfo->pool, ti_prefix),
4695 proto_item_get_display_repr(pinfo->pool, ti_pfxlen));
4697 break;
4698 case 236: /* IPv6 */
4699 if (sublength != 22) {
4700 proto_tree_add_expert_format(subtlvtree, pinfo, &ei_isis_lsp_malformed_subtlv, tvb, offset, sublength,
4701 "Unexpected IPv6 Reachability sub-TLV length (%d vs 22)", sublength);
4702 offset += sublength;
4703 } else {
4704 proto_tree_add_item(subtlvtree, hf_isis_lsp_avaya_ipvpn_ipv6_metric, tvb, offset, 4, ENC_BIG_ENDIAN);
4705 offset += 4;
4706 ti_pfxlen = proto_tree_add_item(subtlvtree, hf_isis_lsp_avaya_ipvpn_ipv6_prefixlen, tvb, offset, 2, ENC_BIG_ENDIAN);
4707 offset += 2;
4708 ti_prefix = proto_tree_add_item(subtlvtree, hf_isis_lsp_avaya_ipvpn_ipv6_prefix, tvb, offset, 16, ENC_NA);
4709 offset += 16;
4710 proto_item_append_text(ti, ": %s/%s", proto_item_get_display_repr(pinfo->pool, ti_prefix),
4711 proto_item_get_display_repr(pinfo->pool, ti_pfxlen));
4713 break;
4714 default:
4715 proto_tree_add_item(subtlvtree, hf_isis_lsp_avaya_ipvpn_unknown_sub, tvb, offset, sublength, ENC_NA);
4716 proto_tree_add_expert_format(subtlvtree, pinfo, &ei_isis_lsp_unknown_subtlv, tvb, offset, sublength,
4717 "Unknown Avaya IPVPN subTLV (%d): Please report to Wireshark developers.", subtype);
4718 offset += sublength;
4720 subtlvbytes -= (2 + sublength);
4724 static void
4725 dissect_lsp_avaya_ipvpn_mc(tvbuff_t *tvb, packet_info* pinfo _U_, proto_tree *tree, int offset,
4726 isis_data_t *isis _U_, int length)
4728 proto_tree_add_item(tree, hf_isis_lsp_avaya_185_unknown, tvb, offset, length, ENC_NA);
4731 static void
4732 dissect_lsp_avaya_ip_grt_mc(tvbuff_t *tvb, packet_info* pinfo _U_, proto_tree *tree, int offset,
4733 isis_data_t *isis _U_, int length)
4735 proto_tree_add_item(tree, hf_isis_lsp_avaya_186_unknown, tvb, offset, length, ENC_NA);
4738 static const isis_clv_handle_t clv_l1_lsp_opts[] = {
4740 ISIS_CLV_AREA_ADDRESS,
4741 "Area address(es)",
4742 &ett_isis_lsp_clv_area_addr,
4743 dissect_lsp_area_address_clv
4746 ISIS_CLV_IS_REACH,
4747 "IS Reachability",
4748 &ett_isis_lsp_clv_is_neighbors,
4749 dissect_lsp_l1_is_neighbors_clv
4752 ISIS_CLV_ES_NEIGHBORS,
4753 "ES Neighbor(s)",
4754 &ett_isis_lsp_clv_is_neighbors,
4755 dissect_lsp_l1_es_neighbors_clv
4758 ISIS_CLV_INSTANCE_IDENTIFIER,
4759 "Instance Identifier",
4760 &ett_isis_lsp_clv_instance_identifier,
4761 dissect_lsp_instance_identifier_clv
4764 ISIS_CLV_LSP_BUFFERSIZE,
4765 "Originating neighbor buffer size",
4766 &ett_isis_lsp_clv_originating_buff_size,
4767 dissect_lsp_ori_buffersize_clv
4770 ISIS_CLV_EXTD_IS_REACH,
4771 "Extended IS reachability",
4772 &ett_isis_lsp_clv_ext_is_reachability,
4773 dissect_lsp_ext_is_reachability_clv
4776 ISIS_CLV_INT_IP_REACH,
4777 "IP Internal reachability",
4778 &ett_isis_lsp_clv_ip_reachability,
4779 dissect_lsp_ip_reachability_clv
4782 ISIS_CLV_EXT_IP_REACH,
4783 "IP External reachability",
4784 &ett_isis_lsp_clv_ip_reachability,
4785 dissect_lsp_ip_reachability_clv
4788 ISIS_CLV_EXTD_IP_REACH,
4789 "Extended IP Reachability",
4790 &ett_isis_lsp_clv_ext_ip_reachability,
4791 dissect_lsp_ext_ip_reachability_clv
4794 ISIS_CLV_IP6_REACH,
4795 "IPv6 reachability",
4796 &ett_isis_lsp_clv_ipv6_reachability,
4797 dissect_lsp_ipv6_reachability_clv
4800 ISIS_CLV_PROTOCOLS_SUPPORTED,
4801 "Protocols supported",
4802 &ett_isis_lsp_clv_nlpid_nlpid,
4803 dissect_lsp_nlpid_clv
4806 ISIS_CLV_HOSTNAME,
4807 "Hostname",
4808 &ett_isis_lsp_clv_hostname,
4809 dissect_lsp_hostname_clv
4812 ISIS_CLV_SHARED_RISK_GROUP,
4813 "Shared Risk Link Group",
4814 &ett_isis_lsp_clv_srlg,
4815 dissect_lsp_srlg_clv
4818 ISIS_CLV_APPSPEC_SRLG,
4819 "Application-Specific SRLG",
4820 &ett_isis_lsp_clv_appspec_srlg,
4821 dissect_lsp_appspec_srlg_clv
4824 ISIS_CLV_TE_ROUTER_ID,
4825 "Traffic Engineering Router ID",
4826 &ett_isis_lsp_clv_te_router_id,
4827 dissect_lsp_te_router_id_clv
4830 ISIS_CLV_IP_ADDR,
4831 "IP Interface address(es)",
4832 &ett_isis_lsp_clv_ipv4_int_addr,
4833 dissect_lsp_ip_int_addr_clv
4836 ISIS_CLV_IP6_ADDR,
4837 "IPv6 Interface address(es)",
4838 &ett_isis_lsp_clv_ipv6_int_addr,
4839 dissect_lsp_ipv6_int_addr_clv
4842 ISIS_CLV_MT_CAP,
4843 "MT-Capability",
4844 &ett_isis_lsp_clv_mt_cap,
4845 dissect_isis_lsp_clv_mt_cap
4848 ISIS_CLV_SID_LABEL_BINDING,
4849 "SID/Label Binding TLV",
4850 &ett_isis_lsp_clv_sid_label_binding,
4851 dissect_isis_lsp_clv_sid_label_binding
4854 ISIS_CLV_AUTHENTICATION,
4855 "Authentication",
4856 &ett_isis_lsp_clv_authentication,
4857 dissect_lsp_authentication_clv
4860 ISIS_CLV_IP_AUTHENTICATION,
4861 "IP Authentication",
4862 &ett_isis_lsp_clv_ip_authentication,
4863 dissect_lsp_ip_authentication_clv
4866 ISIS_CLV_MT_SUPPORTED,
4867 "Multi Topology supported",
4868 &ett_isis_lsp_clv_mt,
4869 dissect_lsp_mt_clv
4872 ISIS_CLV_MT_IS_REACH,
4873 "Multi Topology IS Reachability",
4874 &ett_isis_lsp_clv_mt_is,
4875 dissect_lsp_mt_is_reachability_clv
4878 ISIS_CLV_MT_IP_REACH,
4879 "Multi Topology Reachable IPv4 Prefixes",
4880 &ett_isis_lsp_clv_mt_reachable_IPv4_prefx,
4881 dissect_lsp_mt_reachable_IPv4_prefx_clv
4884 ISIS_CLV_MT_IP6_REACH,
4885 "Multi Topology Reachable IPv6 Prefixes",
4886 &ett_isis_lsp_clv_mt_reachable_IPv6_prefx,
4887 dissect_lsp_mt_reachable_IPv6_prefx_clv
4890 ISIS_CLV_RT_CAPABLE,
4891 "Router Capability",
4892 &ett_isis_lsp_clv_rt_capable,
4893 dissect_isis_rt_capable_clv
4896 ISIS_GRP_ADDR,
4897 "Group Address",
4898 &ett_isis_lsp_clv_grp_address,
4899 dissect_isis_grp_address_clv
4902 ISIS_CLV_IPV6_TE_ROUTER_ID,
4903 "IPv6 TE Router ID",
4904 &ett_isis_lsp_clv_ipv6_te_router_id,
4905 dissect_lsp_ipv6_te_router_id_clv
4908 ISIS_CLV_SRV6_LOCATOR,
4909 "SRv6 Locator",
4910 &ett_isis_lsp_clv_srv6_locator,
4911 dissect_lsp_srv6_locator_clv
4914 ISIS_CLV_PURGE_ORIG_ID,
4915 "Purge Originator ID",
4916 &ett_isis_lsp_clv_purge_orig_id,
4917 dissect_lsp_purge_orig_id_clv
4920 ISIS_CLV_MAC_RI,
4921 "MAC Reachability",
4922 &ett_isis_lsp_clv_mac_reachability,
4923 dissect_lsp_mac_reachability
4926 ISIS_CLV_AVAYA_IPVPN,
4927 "Avaya IPVPN",
4928 &ett_isis_lsp_clv_avaya_ipvpn,
4929 dissect_lsp_avaya_ipvpn
4932 ISIS_CLV_AVAYA_IPVPN_MC,
4933 "Avaya IPVPN MCast",
4934 &ett_isis_lsp_clv_avaya_ipvpn_mc,
4935 dissect_lsp_avaya_ipvpn_mc
4938 ISIS_CLV_AVAYA_IP_GRT_MC,
4939 "Avaya IP GRT MCast",
4940 &ett_isis_lsp_clv_avaya_ip_grt_mc,
4941 dissect_lsp_avaya_ip_grt_mc
4946 NULL,
4947 NULL
4951 static const isis_clv_handle_t clv_l2_lsp_opts[] = {
4953 ISIS_CLV_AREA_ADDRESS,
4954 "Area address(es)",
4955 &ett_isis_lsp_clv_area_addr,
4956 dissect_lsp_area_address_clv
4959 ISIS_CLV_IS_REACH,
4960 "IS Reachability",
4961 &ett_isis_lsp_clv_is_neighbors,
4962 dissect_lsp_l2_is_neighbors_clv
4965 ISIS_CLV_EXTD_IS_REACH,
4966 "Extended IS reachability",
4967 &ett_isis_lsp_clv_ext_is_reachability,
4968 dissect_lsp_ext_is_reachability_clv
4971 ISIS_CLV_PARTITION_DIS,
4972 "Partition Designated Level 2 IS",
4973 &ett_isis_lsp_clv_partition_dis,
4974 dissect_lsp_partition_dis_clv
4977 ISIS_CLV_PREFIX_NEIGHBORS,
4978 "Prefix neighbors",
4979 &ett_isis_lsp_clv_prefix_neighbors,
4980 dissect_lsp_prefix_neighbors_clv
4983 ISIS_CLV_INSTANCE_IDENTIFIER,
4984 "Instance Identifier",
4985 &ett_isis_lsp_clv_instance_identifier,
4986 dissect_lsp_instance_identifier_clv
4989 ISIS_CLV_LSP_BUFFERSIZE,
4990 "Originating neighbor buffer size",
4991 &ett_isis_lsp_clv_originating_buff_size,
4992 dissect_lsp_ori_buffersize_clv
4995 ISIS_CLV_INT_IP_REACH,
4996 "IP Internal reachability",
4997 &ett_isis_lsp_clv_ip_reachability,
4998 dissect_lsp_ip_reachability_clv
5001 ISIS_CLV_EXT_IP_REACH,
5002 "IP External reachability",
5003 &ett_isis_lsp_clv_ip_reachability,
5004 dissect_lsp_ip_reachability_clv
5007 ISIS_CLV_PROTOCOLS_SUPPORTED,
5008 "Protocols supported",
5009 &ett_isis_lsp_clv_nlpid_nlpid,
5010 dissect_lsp_nlpid_clv
5013 ISIS_CLV_HOSTNAME,
5014 "Hostname",
5015 &ett_isis_lsp_clv_hostname,
5016 dissect_lsp_hostname_clv
5019 ISIS_CLV_SHARED_RISK_GROUP,
5020 "Shared Risk Link Group",
5021 &ett_isis_lsp_clv_srlg,
5022 dissect_lsp_srlg_clv
5025 ISIS_CLV_APPSPEC_SRLG,
5026 "Application-Specific SRLG",
5027 &ett_isis_lsp_clv_appspec_srlg,
5028 dissect_lsp_appspec_srlg_clv
5031 ISIS_CLV_TE_ROUTER_ID,
5032 "Traffic Engineering Router ID",
5033 &ett_isis_lsp_clv_te_router_id,
5034 dissect_lsp_te_router_id_clv
5037 ISIS_CLV_EXTD_IP_REACH,
5038 "Extended IP Reachability",
5039 &ett_isis_lsp_clv_ext_ip_reachability,
5040 dissect_lsp_ext_ip_reachability_clv
5043 ISIS_CLV_IP6_REACH,
5044 "IPv6 reachability",
5045 &ett_isis_lsp_clv_ipv6_reachability,
5046 dissect_lsp_ipv6_reachability_clv
5049 ISIS_CLV_IP_ADDR,
5050 "IP Interface address(es)",
5051 &ett_isis_lsp_clv_ipv4_int_addr,
5052 dissect_lsp_ip_int_addr_clv
5055 ISIS_CLV_IP6_ADDR,
5056 "IPv6 Interface address(es)",
5057 &ett_isis_lsp_clv_ipv6_int_addr,
5058 dissect_lsp_ipv6_int_addr_clv
5061 ISIS_CLV_MT_CAP,
5062 "MT-Capability",
5063 &ett_isis_lsp_clv_mt_cap,
5064 dissect_isis_lsp_clv_mt_cap
5067 ISIS_CLV_SID_LABEL_BINDING,
5068 "SID/Label Binding TLV",
5069 &ett_isis_lsp_clv_sid_label_binding,
5070 dissect_isis_lsp_clv_sid_label_binding
5073 ISIS_CLV_AUTHENTICATION,
5074 "Authentication",
5075 &ett_isis_lsp_clv_authentication,
5076 dissect_lsp_authentication_clv
5079 ISIS_CLV_IP_AUTHENTICATION,
5080 "IP Authentication",
5081 &ett_isis_lsp_clv_ip_authentication,
5082 dissect_lsp_ip_authentication_clv
5085 ISIS_CLV_MT_SUPPORTED,
5086 "Multi Topology",
5087 &ett_isis_lsp_clv_mt,
5088 dissect_lsp_mt_clv
5091 ISIS_CLV_MT_IS_REACH,
5092 "Multi Topology IS Reachability",
5093 &ett_isis_lsp_clv_mt_is,
5094 dissect_lsp_mt_is_reachability_clv
5097 ISIS_CLV_MT_IP_REACH,
5098 "Multi Topology Reachable IPv4 Prefixes",
5099 &ett_isis_lsp_clv_mt_reachable_IPv4_prefx,
5100 dissect_lsp_mt_reachable_IPv4_prefx_clv
5103 ISIS_CLV_MT_IP6_REACH,
5104 "Multi Topology Reachable IPv6 Prefixes",
5105 &ett_isis_lsp_clv_mt_reachable_IPv6_prefx,
5106 dissect_lsp_mt_reachable_IPv6_prefx_clv
5109 ISIS_CLV_RT_CAPABLE,
5110 "Router Capability",
5111 &ett_isis_lsp_clv_rt_capable,
5112 dissect_isis_rt_capable_clv
5115 ISIS_CLV_IPV6_TE_ROUTER_ID,
5116 "IPv6 TE Router ID",
5117 &ett_isis_lsp_clv_ipv6_te_router_id,
5118 dissect_lsp_ipv6_te_router_id_clv
5121 ISIS_CLV_SRV6_LOCATOR,
5122 "SRv6 Locator",
5123 &ett_isis_lsp_clv_srv6_locator,
5124 dissect_lsp_srv6_locator_clv
5127 ISIS_CLV_PURGE_ORIG_ID,
5128 "Purge Originator ID",
5129 &ett_isis_lsp_clv_purge_orig_id,
5130 dissect_lsp_purge_orig_id_clv
5135 NULL,
5136 NULL
5141 * Name: isis_dissect_isis_lsp()
5143 * Description:
5144 * Print out the LSP part of the main header and then call the CLV
5145 * de-mangler with the right list of valid CLVs.
5147 * Input:
5148 * tvbuff_t * : tvbuffer for packet data
5149 * proto_tree * : protocol display tree to add to. May be NULL.
5150 * int offset : our offset into packet data.
5151 * int : LSP type, a la packet-isis.h ISIS_TYPE_* values
5152 * int : header length of packet.
5153 * int : length of IDs in packet.
5155 * Output:
5156 * void, but we will add to proto tree if !NULL.
5158 static void
5159 dissect_isis_lsp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset,
5160 const isis_clv_handle_t *opts, isis_data_t *isis)
5162 proto_item *ti;
5163 proto_tree *lsp_tree, *info_tree;
5164 uint16_t pdu_length, lifetime, checksum, cacl_checksum=0;
5165 bool pdu_length_too_short = false;
5166 bool pdu_length_too_long = false;
5167 uint8_t lsp_info;
5168 int offset_checksum;
5169 char *system_id;
5172 * We are passed a tvbuff for the entire ISIS PDU, because some ISIS
5173 * PDUs may contain a checksum CLV, and that's a checksum covering
5174 * the entire PDU. Skip the part of the header that's already been
5175 * dissected.
5177 offset += 8;
5179 col_set_str(pinfo->cinfo, COL_PROTOCOL, "ISIS LSP");
5181 ti = proto_tree_add_item(tree, proto_isis_lsp, tvb, offset, -1, ENC_NA);
5182 lsp_tree = proto_item_add_subtree(ti, ett_isis_lsp);
5184 if (isis->header_length < 8 + 2) {
5185 /* Not large enough to include the part of the header that
5186 we dissect here. */
5187 expert_add_info(pinfo, isis->header_length_item, isis->ei_bad_header_length);
5188 return;
5190 pdu_length = tvb_get_ntohs(tvb, offset);
5191 ti = proto_tree_add_uint(lsp_tree, hf_isis_lsp_pdu_length, tvb,
5192 offset, 2, pdu_length);
5193 if (pdu_length < isis->header_length) {
5194 expert_add_info(pinfo, ti, &ei_isis_lsp_short_pdu);
5195 pdu_length_too_short = true;
5196 } else if (pdu_length > tvb_reported_length(tvb) + isis->header_length) {
5197 expert_add_info(pinfo, ti, &ei_isis_lsp_long_pdu);
5198 pdu_length_too_long = true;
5200 offset += 2;
5202 if (isis->header_length < 8 + 2 + 2) {
5203 /* Not large enough to include the part of the header that
5204 we dissect here. */
5205 expert_add_info(pinfo, isis->header_length_item, isis->ei_bad_header_length);
5206 return;
5208 proto_tree_add_item(lsp_tree, hf_isis_lsp_remaining_life,
5209 tvb, offset, 2, ENC_BIG_ENDIAN);
5210 lifetime = tvb_get_ntohs(tvb, offset);
5211 offset += 2;
5213 /* Checksumming starts with the LSP ID */
5214 offset_checksum = offset;
5216 if (isis->header_length < 8 + 2 + 2 + isis->system_id_len + 2) {
5217 /* Not large enough to include the part of the header that
5218 we dissect here. */
5219 expert_add_info(pinfo, isis->header_length_item, isis->ei_bad_header_length);
5220 return;
5222 proto_tree_add_item(lsp_tree, hf_isis_lsp_lsp_id, tvb, offset, isis->system_id_len + 2, ENC_NA);
5223 system_id = tvb_print_system_id( pinfo->pool, tvb, offset, isis->system_id_len+2 );
5224 col_append_fstr(pinfo->cinfo, COL_INFO, ", LSP-ID: %s", system_id);
5225 offset += (isis->system_id_len + 2);
5227 if (isis->header_length < 8 + 2 + 2 + isis->system_id_len + 2 + 4) {
5228 /* Not large enough to include the part of the header that
5229 we dissect here. */
5230 expert_add_info(pinfo, isis->header_length_item, isis->ei_bad_header_length);
5231 return;
5233 proto_tree_add_item(lsp_tree, hf_isis_lsp_sequence_number,
5234 tvb, offset, 4, ENC_BIG_ENDIAN);
5235 col_append_fstr(pinfo->cinfo, COL_INFO, ", Sequence: 0x%08x, Lifetime: %5us",
5236 tvb_get_ntohl(tvb, offset),
5237 tvb_get_ntohs(tvb, offset - (isis->system_id_len+2+2)));
5238 offset += 4;
5240 if (isis->header_length < 8 + 2 + 2 + isis->system_id_len + 2 + 4 + 2) {
5241 /* Not large enough to include the part of the header that
5242 we dissect here. */
5243 expert_add_info(pinfo, isis->header_length_item, isis->ei_bad_header_length);
5244 return;
5246 checksum = lifetime ? tvb_get_ntohs(tvb, offset) : 0;
5247 if (checksum == 0) {
5248 /* No checksum present */
5249 proto_tree_add_checksum(lsp_tree, tvb, offset, hf_isis_lsp_checksum, hf_isis_lsp_checksum_status, &ei_isis_lsp_bad_checksum, pinfo, 0, ENC_BIG_ENDIAN, PROTO_CHECKSUM_NOT_PRESENT);
5250 } else if (pdu_length_too_short || pdu_length_too_long) {
5251 /* Length bogus, so we can't check the checksum */
5252 proto_tree_add_checksum(lsp_tree, tvb, offset, hf_isis_lsp_checksum, hf_isis_lsp_checksum_status, &ei_isis_lsp_bad_checksum, pinfo, 0, ENC_BIG_ENDIAN, PROTO_CHECKSUM_NO_FLAGS);
5253 } else {
5254 if (osi_check_and_get_checksum(tvb, offset_checksum, pdu_length-12, offset, &cacl_checksum)) {
5255 /* Successfully processed checksum, verify it */
5256 proto_tree_add_checksum(lsp_tree, tvb, offset, hf_isis_lsp_checksum, hf_isis_lsp_checksum_status, &ei_isis_lsp_bad_checksum, pinfo, cacl_checksum, ENC_BIG_ENDIAN, PROTO_CHECKSUM_VERIFY);
5257 if (cacl_checksum != checksum) {
5258 col_append_str(pinfo->cinfo, COL_INFO, " [ISIS CHECKSUM INCORRECT]");
5260 } else {
5261 /* We didn't capture the entire packet, so we can't verify it */
5262 proto_tree_add_checksum(lsp_tree, tvb, offset, hf_isis_lsp_checksum, hf_isis_lsp_checksum_status, &ei_isis_lsp_bad_checksum, pinfo, 0, ENC_BIG_ENDIAN, PROTO_CHECKSUM_NO_FLAGS);
5265 offset += 2;
5267 if (isis->header_length < 8 + 2 + 2 + isis->system_id_len + 2 + 4 + 2 + 1) {
5268 /* Not large enough to include the part of the header that
5269 we dissect here. */
5270 expert_add_info(pinfo, isis->header_length_item, isis->ei_bad_header_length);
5271 return;
5273 if (tree) {
5274 static int * const attach_flags[] = {
5275 &hf_isis_lsp_error_metric,
5276 &hf_isis_lsp_expense_metric,
5277 &hf_isis_lsp_delay_metric,
5278 &hf_isis_lsp_default_metric,
5279 NULL
5283 * P | ATT | HIPPITY | IS TYPE description.
5285 lsp_info = tvb_get_uint8(tvb, offset);
5286 info_tree = proto_tree_add_subtree_format(lsp_tree, tvb, offset, 1, ett_isis_lsp_info, NULL,
5287 "Type block(0x%02x): Partition Repair:%d, Attached bits:%d, Overload bit:%d, IS type:%d",
5288 lsp_info,
5289 ISIS_LSP_PARTITION(lsp_info),
5290 ISIS_LSP_ATT(lsp_info),
5291 ISIS_LSP_HIPPITY(lsp_info),
5292 ISIS_LSP_IS_TYPE(lsp_info)
5295 proto_tree_add_boolean(info_tree, hf_isis_lsp_p, tvb, offset, 1, lsp_info);
5296 proto_tree_add_bitmask_with_flags(info_tree, tvb, offset, hf_isis_lsp_att,
5297 ett_isis_lsp_att, attach_flags, ENC_NA, BMT_NO_APPEND);
5298 proto_tree_add_boolean(info_tree, hf_isis_lsp_hippity, tvb, offset, 1, lsp_info);
5299 proto_tree_add_uint(info_tree, hf_isis_lsp_is_type, tvb, offset, 1, lsp_info);
5301 offset += 1;
5303 if (pdu_length_too_short) {
5304 return;
5307 * Now, we need to decode our CLVs. We need to pass in
5308 * our list of valid ones!
5310 isis->pdu_length = pdu_length;
5311 isis_dissect_clvs(tvb, pinfo, lsp_tree, offset,
5312 opts, &ei_isis_lsp_short_clv, isis, ett_isis_lsp_clv_unknown,
5313 hf_isis_lsp_clv_type, hf_isis_lsp_clv_length,
5314 &ei_isis_lsp_clv_unknown);
5317 static int
5318 dissect_isis_l1_lsp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data)
5320 isis_data_t* isis = (isis_data_t*)data;
5321 dissect_isis_lsp(tvb, pinfo, tree, 0, clv_l1_lsp_opts, isis);
5322 return tvb_reported_length(tvb);
5325 static int
5326 dissect_isis_l2_lsp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data)
5328 isis_data_t* isis = (isis_data_t*)data;
5329 dissect_isis_lsp(tvb, pinfo, tree, 0, clv_l2_lsp_opts, isis);
5330 return tvb_reported_length(tvb);
5334 * The "supported" bit in a metric is actually the "not supported" bit;
5335 * if it's *clear*, the metric is supported, and if it's *set*, the
5336 * metric is not supported.
5339 void
5340 proto_register_isis_lsp(void)
5342 static hf_register_info hf[] = {
5343 { &hf_isis_lsp_pdu_length,
5344 { "PDU length", "isis.lsp.pdu_length",
5345 FT_UINT16, BASE_DEC,
5346 NULL, 0x0, NULL, HFILL }
5349 { &hf_isis_lsp_remaining_life,
5350 { "Remaining lifetime", "isis.lsp.remaining_life",
5351 FT_UINT16, BASE_DEC, NULL, 0x0,
5352 NULL, HFILL }
5355 { &hf_isis_lsp_lsp_id,
5356 { "LSP-ID", "isis.lsp.lsp_id",
5357 FT_SYSTEM_ID, BASE_NONE, NULL, 0x0,
5358 NULL, HFILL }
5361 { &hf_isis_lsp_hostname,
5362 { "Hostname", "isis.lsp.hostname",
5363 FT_STRING, BASE_NONE, NULL, 0x0,
5364 NULL, HFILL }
5367 { &hf_isis_lsp_srlg_system_id,
5368 { "System ID", "isis.lsp.srlg.system_id",
5369 FT_SYSTEM_ID, BASE_NONE, NULL, 0x0,
5370 NULL, HFILL }
5373 { &hf_isis_lsp_srlg_pseudo_num,
5374 { "Pseudonode num", "isis.lsp.srlg.pseudo_num",
5375 FT_UINT8, BASE_DEC, NULL, 0x0,
5376 NULL, HFILL }
5379 { &hf_isis_lsp_srlg_flags_numbered,
5380 { "Numbered", "isis.lsp.srlg.flags_numbered",
5381 FT_BOOLEAN, 8, TFS(&tfs_yes_no), 0x01,
5382 NULL, HFILL }
5385 { &hf_isis_lsp_srlg_ipv4_local,
5386 { "IPv4 interface address/Link Local Identifier", "isis.lsp.srlg.ipv4_local",
5387 FT_IPv4, BASE_NONE, NULL, 0x0,
5388 NULL, HFILL }
5391 { &hf_isis_lsp_srlg_ipv4_remote,
5392 { "IPv4 neighbor address/Link remote Identifier", "isis.lsp.srlg.ipv4_remote",
5393 FT_IPv4, BASE_NONE, NULL, 0x0,
5394 NULL, HFILL }
5397 { &hf_isis_lsp_srlg_value,
5398 { "Shared Risk Link Group Value", "isis.lsp.srlg.value",
5399 FT_UINT32, BASE_DEC_HEX, NULL, 0x0,
5400 NULL, HFILL }
5403 /* rfc9479 */
5404 { &hf_isis_lsp_appspec_srlg_system_id,
5405 { "System ID", "isis.lsp.application_specific_srlg.system_id",
5406 FT_SYSTEM_ID, BASE_NONE, NULL, 0x0,
5407 NULL, HFILL }
5409 { &hf_isis_lsp_appspec_srlg_pseudo_num,
5410 { "Pseudonode num", "isis.lsp.application_specific_srlg.pseudo_num",
5411 FT_UINT8, BASE_DEC, NULL, 0x0,
5412 NULL, HFILL }
5414 { &hf_isis_lsp_appspec_srlg_sub_tlv_length,
5415 { "Sub-TLV length", "isis.lsp.application_specific_srlg.sub_tlv_len",
5416 FT_UINT8, BASE_DEC, NULL, 0,
5417 NULL, HFILL}
5419 { &hf_isis_lsp_appspec_srlg_value,
5420 { "Shared Risk Link Group Value", "isis.lsp.application_specific_srlg.value",
5421 FT_UINT32, BASE_DEC_HEX, NULL, 0,
5422 NULL, HFILL }
5424 { &hf_isis_lsp_appspec_srlg_link_local_id,
5425 { "Link Local Identifier", "isis.lsp.application_specific_srlg.link_local_id",
5426 FT_UINT32, BASE_DEC, NULL, 0,
5427 NULL, HFILL }
5429 { &hf_isis_lsp_appspec_srlg_link_remote_id,
5430 { "Link Remote Identifier", "isis.lsp.application_specific_srlg.link_remote_id",
5431 FT_UINT32, BASE_DEC, NULL, 0,
5432 NULL, HFILL }
5435 { &hf_isis_lsp_sequence_number,
5436 { "Sequence number", "isis.lsp.sequence_number",
5437 FT_UINT32, BASE_HEX, NULL, 0x0,
5438 NULL, HFILL }
5441 { &hf_isis_lsp_checksum,
5442 { "Checksum", "isis.lsp.checksum",
5443 FT_UINT16, BASE_HEX, NULL, 0x0,
5444 NULL, HFILL }
5447 { &hf_isis_lsp_checksum_status,
5448 { "Checksum Status", "isis.lsp.checksum.status",
5449 FT_UINT8, BASE_NONE, VALS(proto_checksum_vals), 0x0,
5450 NULL, HFILL }
5453 { &hf_isis_lsp_clv_ipv4_int_addr,
5454 { "IPv4 interface address", "isis.lsp.clv_ipv4_int_addr",
5455 FT_IPv4, BASE_NONE, NULL, 0x0,
5456 NULL, HFILL }
5459 { &hf_isis_lsp_clv_ipv6_int_addr,
5460 { "IPv6 interface address", "isis.lsp.clv_ipv6_int_addr",
5461 FT_IPv6, BASE_NONE, NULL, 0x0,
5462 NULL, HFILL }
5465 { &hf_isis_lsp_clv_te_router_id,
5466 { "Traffic Engineering Router ID", "isis.lsp.clv_te_router_id",
5467 FT_IPv4, BASE_NONE, NULL, 0x0,
5468 NULL, HFILL }
5471 { &hf_isis_lsp_clv_mt,
5472 { "MT-ID", "isis.lsp.clv_mt",
5473 FT_UINT16, BASE_HEX, NULL, 0x0,
5474 NULL, HFILL }
5477 { &hf_isis_lsp_p,
5478 { "Partition Repair", "isis.lsp.partition_repair",
5479 FT_BOOLEAN, 8, TFS(&tfs_supported_not_supported), ISIS_LSP_PARTITION_MASK,
5480 "If set, this router supports the optional Partition Repair function", HFILL }
5483 { &hf_isis_lsp_att,
5484 { "Attachment", "isis.lsp.att",
5485 FT_UINT8, BASE_DEC, NULL, ISIS_LSP_ATT_MASK,
5486 NULL, HFILL }
5489 { &hf_isis_lsp_hippity,
5490 { "Overload bit", "isis.lsp.overload",
5491 FT_BOOLEAN, 8, TFS(&tfs_set_notset), ISIS_LSP_HIPPITY_MASK,
5492 "If set, this router will not be used by any decision process to calculate routes", HFILL }
5495 { &hf_isis_lsp_root_id,
5496 { "Root Bridge ID", "isis.lsp.root.id",
5497 FT_SYSTEM_ID, BASE_NONE, NULL, 0x0,
5498 NULL, HFILL }
5501 { &hf_isis_lsp_is_type,
5502 { "Type of Intermediate System", "isis.lsp.is_type",
5503 FT_UINT8, BASE_DEC, VALS(isis_lsp_istype_vals), ISIS_LSP_IS_TYPE_MASK,
5504 NULL, HFILL }
5507 { &hf_isis_lsp_clv_type,
5508 { "Type", "isis.lsp.clv.type",
5509 FT_UINT8, BASE_DEC, NULL, 0x0,
5510 NULL, HFILL }
5513 { &hf_isis_lsp_clv_length,
5514 { "Length", "isis.lsp.clv.length",
5515 FT_UINT8, BASE_DEC, NULL, 0x0,
5516 NULL, HFILL }
5519 { &hf_isis_lsp_bw_ct_model,
5520 { "Bandwidth Constraints Model Id", "isis.lsp.bw_ct.model",
5521 FT_UINT8, BASE_DEC, NULL, 0,
5522 NULL, HFILL }
5524 { &hf_isis_lsp_bw_ct_reserved,
5525 { "Reserved", "isis.lsp.bw_ct.rsv",
5526 FT_UINT24, BASE_HEX, NULL, 0,
5527 NULL, HFILL }
5529 { &hf_isis_lsp_bw_ct0,
5530 { "Bandwidth Constraints 0", "isis.lsp.bw_ct.0",
5531 FT_FLOAT, BASE_NONE, NULL, 0,
5532 NULL, HFILL }
5534 { &hf_isis_lsp_bw_ct1,
5535 { "Bandwidth Constraints 1", "isis.lsp.bw_ct.1",
5536 FT_FLOAT, BASE_NONE, NULL, 0,
5537 NULL, HFILL }
5539 { &hf_isis_lsp_bw_ct2,
5540 { "Bandwidth Constraints 2", "isis.lsp.bw_ct.2",
5541 FT_FLOAT, BASE_NONE, NULL, 0,
5542 NULL, HFILL }
5544 { &hf_isis_lsp_bw_ct3,
5545 { "Bandwidth Constraints 3", "isis.lsp.bw_ct.3",
5546 FT_FLOAT, BASE_NONE, NULL, 0,
5547 NULL, HFILL }
5549 { &hf_isis_lsp_bw_ct4,
5550 { "Bandwidth Constraints 4", "isis.lsp.bw_ct.4",
5551 FT_FLOAT, BASE_NONE, NULL, 0,
5552 NULL, HFILL }
5554 { &hf_isis_lsp_bw_ct5,
5555 { "Bandwidth Constraints 5", "isis.lsp.bw_ct.5",
5556 FT_FLOAT, BASE_NONE, NULL, 0,
5557 NULL, HFILL }
5559 { &hf_isis_lsp_bw_ct6,
5560 { "Bandwidth Constraints 6", "isis.lsp.bw_ct.6",
5561 FT_FLOAT, BASE_NONE, NULL, 0,
5562 NULL, HFILL }
5564 { &hf_isis_lsp_bw_ct7,
5565 { "Bandwidth Constraints 7", "isis.lsp.bw_ct.7",
5566 FT_FLOAT, BASE_NONE, NULL, 0,
5567 NULL, HFILL }
5570 { &hf_isis_lsp_spb_link_metric,
5571 { "SPB Link Metric", "isis.lsp.spb.link_metric",
5572 FT_UINT24, BASE_HEX_DEC, NULL, 0,
5573 NULL, HFILL }
5576 { &hf_isis_lsp_spb_port_count,
5577 { "Number of Ports", "isis.lsp.spb.port_count",
5578 FT_UINT8, BASE_DEC, NULL, 0,
5579 NULL, HFILL }
5582 { &hf_isis_lsp_spb_port_id,
5583 { "Port Id", "isis.lsp.spb.port_id",
5584 FT_UINT16, BASE_HEX_DEC, NULL, 0,
5585 NULL, HFILL }
5588 { &hf_isis_lsp_adj_sid_flags,
5589 { "Flags", "isis.lsp.adj_sid.flags",
5590 FT_UINT8, BASE_HEX, NULL, 0x0,
5591 NULL, HFILL }
5594 { &hf_isis_lsp_adj_sid_family_flag,
5595 { "Outgoing Encapsulation", "isis.lsp.adj_sid.flags.f",
5596 FT_BOOLEAN, 8, TFS(&tfs_ipv6_ipv4), 0x80,
5597 NULL, HFILL }
5600 { &hf_isis_lsp_adj_sid_backup_flag,
5601 { "Backup", "isis.lsp.adj_sid.flags.b",
5602 FT_BOOLEAN, 8, TFS(&tfs_set_notset), 0x40,
5603 NULL, HFILL }
5606 { &hf_isis_lsp_adj_sid_value_flag,
5607 { "Value", "isis.lsp.adj_sid.flags.v",
5608 FT_BOOLEAN, 8, TFS(&tfs_set_notset), 0x20,
5609 NULL, HFILL }
5612 { &hf_isis_lsp_adj_sid_local_flag,
5613 { "Local Significance", "isis.lsp.adj_sid.flags.l",
5614 FT_BOOLEAN, 8, TFS(&tfs_yes_no), 0x10,
5615 NULL, HFILL }
5618 { &hf_isis_lsp_adj_sid_set_flag,
5619 { "Set", "isis.lsp.adj_sid.flags.s",
5620 FT_BOOLEAN, 8, TFS(&tfs_set_notset), 0x8,
5621 NULL, HFILL }
5624 { &hf_isis_lsp_adj_sid_weight,
5625 { "Weight", "isis.lsp.adj_sid.weight",
5626 FT_UINT8, BASE_HEX, NULL, 0x0,
5627 NULL, HFILL }
5630 { &hf_isis_lsp_adj_sid_system_id,
5631 { "System-ID", "isis.lsp.adj_sid.system_id",
5632 FT_SYSTEM_ID, BASE_NONE, NULL, 0x0,
5633 NULL, HFILL }
5636 { &hf_isis_lsp_sid_sli_label,
5637 { "SID/Label/Index", "isis.lsp.sid.sli_label",
5638 FT_UINT24, BASE_DEC, NULL, 0x0FFFFF,
5639 NULL, HFILL }
5642 { &hf_isis_lsp_sid_sli_index,
5643 { "SID/Label/Index", "isis.lsp.sid.sli_index",
5644 FT_UINT32, BASE_HEX, NULL, 0x0,
5645 NULL, HFILL }
5648 { &hf_isis_lsp_sid_sli_ipv6,
5649 { "SID/Label/Index", "isis.lsp.sid.sli_ipv6",
5650 FT_IPv6, BASE_NONE, NULL, 0x0,
5651 NULL, HFILL }
5654 { &hf_isis_lsp_spb_reserved,
5655 { "SR Bit", "isis.lsp.spb.reserved",
5656 FT_UINT16, BASE_DEC, NULL, 0xC000,
5657 NULL, HFILL }
5660 { &hf_isis_lsp_spb_sr_bit,
5661 { "SR Bit", "isis.lsp.spb.sr_bit",
5662 FT_UINT16, BASE_DEC, NULL, 0x3000,
5663 NULL, HFILL }
5666 { &hf_isis_lsp_spb_spvid,
5667 { "SPVID", "isis.lsp.spb.spvid",
5668 FT_UINT16, BASE_HEX_DEC, NULL, 0x0FFF,
5669 NULL, HFILL }
5671 { &hf_isis_lsp_spb_short_mac_address_t,
5672 { "T", "isis.lsp.spb.mac_address.t",
5673 FT_BOOLEAN, 8, NULL, 0x80,
5674 NULL, HFILL }
5676 { &hf_isis_lsp_spb_short_mac_address_r,
5677 { "R", "isis.lsp.spb.mac_address.r",
5678 FT_BOOLEAN, 8, NULL, 0x40,
5679 NULL, HFILL }
5681 { &hf_isis_lsp_spb_short_mac_address_reserved,
5682 { "Reserved", "isis.lsp.spb.mac_address.reserved",
5683 FT_UINT8, BASE_DEC, NULL, 0x3F,
5684 NULL, HFILL }
5686 { &hf_isis_lsp_spb_short_mac_address,
5687 { "MAC Address", "isis.lsp.spb.mac_address",
5688 FT_ETHER, BASE_NONE, NULL, 0x00,
5689 NULL, HFILL }
5691 /* TLV 149 draft-previdi-isis-segmentrouting-extensions */
5692 { &hf_isis_lsp_sl_binding_flags,
5693 { "TLV Flags", "isis.lsp.sl_binding.flags",
5694 FT_UINT8, BASE_HEX, NULL, 0,
5695 NULL, HFILL }
5697 { &hf_isis_lsp_sl_binding_flags_f,
5698 { "Flag F: Address Family", "isis.lsp.sl_binding.flags_f",
5699 FT_BOOLEAN, 8, TFS(&tfs_set_notset), 0x80,
5700 NULL, HFILL}
5702 { &hf_isis_lsp_sl_binding_flags_m,
5703 { "Flag M: Mirror Context", "isis.lsp.sl_binding.flags_m",
5704 FT_BOOLEAN, 8, TFS(&tfs_set_notset), 0x40,
5705 NULL, HFILL}
5707 { &hf_isis_lsp_sl_binding_flags_s,
5708 { "Flag S", "isis.lsp.sl_binding.flags_s",
5709 FT_BOOLEAN, 8, TFS(&tfs_set_notset), 0x20,
5710 "If set, the SID/Label Binding TLV SHOULD be flooded across the entire routing domain", HFILL}
5712 { &hf_isis_lsp_sl_binding_flags_d,
5713 { "Flag D", "isis.lsp.sl_binding.flags_d",
5714 FT_BOOLEAN, 8, TFS(&tfs_set_notset), 0x10,
5715 "when the SID/Label Binding TLV is leaked from level-2 to level-1", HFILL}
5717 { &hf_isis_lsp_sl_binding_flags_a,
5718 { "Flag A: Attached", "isis.lsp.sl_binding.flags_a",
5719 FT_BOOLEAN, 8, TFS(&tfs_set_notset), 0x08,
5720 NULL, HFILL}
5722 { &hf_isis_lsp_sl_binding_flags_rsv,
5723 { "Flag reserved", "isis.lsp.sl_binding.flags_rsv",
5724 FT_UINT8, BASE_HEX, NULL, 0x07,
5725 NULL, HFILL}
5727 { &hf_isis_lsp_sl_binding_weight,
5728 { "Weight", "isis.lsp.sl_binding.weight",
5729 FT_UINT8, BASE_DEC, NULL, 0,
5730 NULL, HFILL}
5732 { &hf_isis_lsp_sl_binding_range,
5733 { "Range", "isis.lsp.sl_binding.range",
5734 FT_UINT16, BASE_DEC, NULL, 0,
5735 NULL, HFILL}
5737 { &hf_isis_lsp_sl_binding_prefix_length,
5738 { "Prefix length", "isis.lsp.sl_binding.prefix_len",
5739 FT_UINT8, BASE_DEC, NULL, 0,
5740 NULL, HFILL}
5742 { &hf_isis_lsp_sl_binding_fec_prefix_ipv4,
5743 { "Prefix", "isis.lsp.sl_binding.prefix_ipv4",
5744 FT_IPv4, BASE_NONE, NULL, 0,
5745 NULL, HFILL}
5747 { &hf_isis_lsp_sl_binding_fec_prefix_ipv6,
5748 { "Prefix", "isis.lsp.sl_binding.prefix_ipv6",
5749 FT_IPv6, BASE_NONE, NULL, 0,
5750 NULL, HFILL}
5752 { &hf_isis_lsp_sl_sub_tlv,
5753 { "SID/Label sub-TLV :", "isis.lsp.sl_binding.subtlv",
5754 FT_NONE, BASE_NONE, NULL, 0,
5755 NULL, HFILL}
5757 { &hf_isis_lsp_sl_sub_tlv_type,
5758 { "SID/label sub-TLV type", "isis.lsp.sl_sub_tlv_type",
5759 FT_UINT8, BASE_DEC, VALS(isis_lsp_sl_sub_tlv_vals), 0,
5760 NULL, HFILL}
5762 { &hf_isis_lsp_sl_sub_tlv_length,
5763 { "Sub-TLV length", "isis.lsp.sl_binding.sub_tlv_len",
5764 FT_UINT8, BASE_DEC, NULL, 0,
5765 NULL, HFILL}
5767 { &hf_isis_lsp_sl_sub_tlv_label_20,
5768 { "SID/Label", "isis.lsp.sl_sub_tlv.label20",
5769 FT_UINT24, BASE_DEC, NULL, 0x0FFFFF,
5770 NULL, HFILL}
5772 { &hf_isis_lsp_sl_sub_tlv_label_32,
5773 { "SID/Label", "isis.lsp.sl_sub_tlv.label32",
5774 FT_UINT32, BASE_DEC, NULL, 0x0,
5775 NULL, HFILL}
5777 { &hf_isis_lsp_sl_sub_tlv_flags,
5778 { "sub-TLV Flags", "isis.lsp.sl_sub_tlv.flags",
5779 FT_UINT8, BASE_HEX, NULL, 0,
5780 NULL, HFILL }
5782 { &hf_isis_lsp_sl_sub_tlv_flags_r,
5783 { "Flag R: Re-advertisement", "isis.lsp.sl_sub_tlv.flags_r",
5784 FT_BOOLEAN, 8, TFS(&tfs_set_notset), 0x80,
5785 NULL, HFILL}
5787 { &hf_isis_lsp_sl_sub_tlv_flags_n,
5788 { "Flag N: Node-SID", "isis.lsp.sl_sub_tlv.flags_n",
5789 FT_BOOLEAN, 8, TFS(&tfs_set_notset), 0x40,
5790 NULL, HFILL}
5792 { &hf_isis_lsp_sl_sub_tlv_flags_p,
5793 { "Flag P: no-PHP", "isis.lsp.sl_sub_tlv.flags_p",
5794 FT_BOOLEAN, 8, TFS(&tfs_set_notset), 0x20,
5795 NULL, HFILL}
5797 { &hf_isis_lsp_sl_sub_tlv_flags_e,
5798 { "Flag E: Explicit-Null", "isis.lsp.sl_sub_tlv.flags_e",
5799 FT_BOOLEAN, 8, TFS(&tfs_set_notset), 0x10,
5800 NULL, HFILL}
5802 { &hf_isis_lsp_sl_sub_tlv_flags_v,
5803 { "Flag V: Value", "isis.lsp.sl_sub_tlv.flags_v",
5804 FT_BOOLEAN, 8, TFS(&tfs_set_notset), 0x08,
5805 NULL, HFILL}
5807 { &hf_isis_lsp_sl_sub_tlv_flags_l,
5808 { "Flag L: Local", "isis.lsp.sl_sub_tlv.flags_l",
5809 FT_BOOLEAN, 8, TFS(&tfs_set_notset), 0x04,
5810 NULL, HFILL}
5812 { &hf_isis_lsp_sl_sub_tlv_flags_rsv,
5813 { "Flag reserved", "isis.lsp.sl_sub_tlv.flags_rsv",
5814 FT_UINT8, BASE_HEX, NULL, 0x03,
5815 NULL, HFILL}
5817 { &hf_isis_lsp_sl_sub_tlv_algorithm,
5818 { "Algorithm", "isis.lsp.sl_sub_tlv.algorithm",
5819 FT_UINT8, BASE_DEC, NULL, 0x0,
5820 NULL, HFILL}
5823 /* Generated from convert_proto_tree_add_text.pl */
5824 { &hf_isis_lsp_mt_id_reserved,
5825 { "Reserved", "isis.lsp.reserved",
5826 FT_UINT16, BASE_HEX, NULL, ISIS_LSP_MT_MSHIP_RES_MASK,
5827 NULL, HFILL}
5829 { &hf_isis_lsp_mt_id,
5830 { "Topology ID", "isis.lsp.mtid",
5831 FT_UINT16, BASE_DEC|BASE_RANGE_STRING, RVALS(mtid_strings), 0x0fff,
5832 NULL, HFILL }
5834 { &hf_isis_lsp_ip_reachability_ipv4_prefix,
5835 { "IPv4 prefix", "isis.lsp.ip_reachability.ipv4_prefix",
5836 FT_IPv4, BASE_NONE, NULL, 0x0,
5837 NULL, HFILL }
5839 { &hf_isis_lsp_ip_reachability_default_metric,
5840 { "Default Metric", "isis.lsp.ip_reachability.default_metric",
5841 FT_UINT8, BASE_DEC, NULL, 0x3F,
5842 NULL, HFILL }
5844 { &hf_isis_lsp_ip_reachability_delay_metric,
5845 { "Delay Metric", "isis.lsp.ip_reachability.delay_metric",
5846 FT_UINT8, BASE_DEC, NULL, 0x3F,
5847 NULL, HFILL }
5849 { &hf_isis_lsp_ip_reachability_expense_metric,
5850 { "Expense Metric", "isis.lsp.ip_reachability.expense_metric",
5851 FT_UINT8, BASE_DEC, NULL, 0x3F,
5852 NULL, HFILL }
5854 { &hf_isis_lsp_ip_reachability_error_metric,
5855 { "Error Metric", "isis.lsp.ip_reachability.error_metric",
5856 FT_UINT8, BASE_DEC, NULL, 0x3F,
5857 NULL, HFILL }
5859 { &hf_isis_lsp_ext_ip_reachability_subclvs_len,
5860 { "SubCLV Length", "isis.lsp.ext_ip_reachability.subclvs_length",
5861 FT_UINT8, BASE_DEC, NULL, 0x0,
5862 NULL, HFILL }
5864 { &hf_isis_lsp_ext_ip_reachability_code,
5865 { "Code", "isis.lsp.ext_ip_reachability.code",
5866 FT_UINT8, BASE_DEC, VALS(isis_lsp_ext_ip_reachability_code_vals), 0x0,
5867 NULL, HFILL }
5869 { &hf_isis_lsp_ext_ip_reachability_len,
5870 { "Length", "isis.lsp.ext_ip_reachability.length",
5871 FT_UINT8, BASE_DEC, NULL, 0x0,
5872 NULL, HFILL }
5874 { &hf_isis_lsp_ext_ip_reachability_prefix_flags,
5875 { "Flags", "isis.lsp.ext_ip_reachability.prefix_sid.flags",
5876 FT_UINT8, BASE_HEX, NULL, 0x0,
5877 NULL, HFILL }
5879 { &hf_isis_lsp_ext_ip_reachability_prefix_re_adv_flag,
5880 { "Re-advertisement", "isis.lsp.ext_ip_reachability.prefix_sid.flags.r",
5881 FT_BOOLEAN, 8, TFS(&tfs_set_notset), 0x80,
5882 NULL, HFILL }
5884 { &hf_isis_lsp_ext_ip_reachability_prefix_node_sid_flag,
5885 { "Node-SID", "isis.lsp.ext_ip_reachability.prefix_sid.flags.n",
5886 FT_BOOLEAN, 8, TFS(&tfs_set_notset), 0x40,
5887 NULL, HFILL }
5889 { &hf_isis_lsp_ext_ip_reachability_prefix_nophp_flag,
5890 { "no-PHP", "isis.lsp.ext_ip_reachability.prefix_sid.flags.p",
5891 FT_BOOLEAN, 8, TFS(&tfs_set_notset), 0x20,
5892 NULL, HFILL }
5894 { &hf_isis_lsp_ext_ip_reachability_prefix_expl_null_flag,
5895 { "Explicit-Null", "isis.lsp.ext_ip_reachability.prefix_sid.flags.e",
5896 FT_BOOLEAN, 8, TFS(&tfs_set_notset), 0x10,
5897 NULL, HFILL }
5899 { &hf_isis_lsp_ext_ip_reachability_prefix_value_flag,
5900 { "Value", "isis.lsp.ext_ip_reachability.prefix_sid.flags.v",
5901 FT_BOOLEAN, 8, TFS(&tfs_set_notset), 0x8,
5902 NULL, HFILL }
5904 { &hf_isis_lsp_ext_ip_reachability_prefix_local_flag,
5905 { "Local", "isis.lsp.ext_ip_reachability.prefix_sid.flags.l",
5906 FT_BOOLEAN, 8, TFS(&tfs_set_notset), 0x4,
5907 NULL, HFILL }
5909 { &hf_isis_lsp_32_bit_administrative_tag,
5910 { "32-Bit Administrative tag", "isis.lsp.32_bit_administrative_tag",
5911 FT_UINT32, BASE_HEX_DEC, NULL, 0x0,
5912 NULL, HFILL }
5914 { &hf_isis_lsp_64_bit_administrative_tag,
5915 { "64-Bit Administrative tag", "isis.lsp.64_bit_administrative_tag",
5916 FT_UINT64, BASE_HEX, NULL, 0x0,
5917 NULL, HFILL }
5919 { &hf_isis_lsp_ext_ip_reachability_ipv4_prefix,
5920 { "IPv4 prefix", "isis.lsp.ext_ip_reachability.ipv4_prefix",
5921 FT_IPv4, BASE_NONE, NULL, 0x0,
5922 NULL, HFILL }
5924 { &hf_isis_lsp_ext_ip_reachability_metric,
5925 { "Metric", "isis.lsp.ext_ip_reachability.metric",
5926 FT_UINT32, BASE_DEC, NULL, 0x0,
5927 NULL, HFILL }
5929 { &hf_isis_lsp_ext_ip_reachability_distribution,
5930 { "Distribution", "isis.lsp.ext_ip_reachability.distribution",
5931 FT_BOOLEAN, 8, TFS(&tfs_down_up), 0x80,
5932 NULL, HFILL }
5934 { &hf_isis_lsp_ext_ip_reachability_subtlv,
5935 { "Sub-TLV", "isis.lsp.ext_ip_reachability.subtlv",
5936 FT_BOOLEAN, 8, TFS(&tfs_yes_no), 0x40,
5937 NULL, HFILL }
5939 { &hf_isis_lsp_ext_ip_reachability_prefix_length,
5940 { "Prefix Length", "isis.lsp.ext_ip_reachability.prefix_length",
5941 FT_UINT8, BASE_DEC, NULL, 0x3F,
5942 NULL, HFILL }
5944 { &hf_isis_lsp_grp_type,
5945 { "Type", "isis.lsp.grp.type",
5946 FT_UINT8, BASE_DEC, VALS(isis_lsp_grp_types), 0x0,
5947 NULL, HFILL }
5949 { &hf_isis_lsp_grp_macaddr_length,
5950 { "Length", "isis.lsp.grp_macaddr.length",
5951 FT_UINT8, BASE_DEC, NULL, 0x0,
5952 NULL, HFILL }
5954 { &hf_isis_lsp_grp_macaddr_topology_id,
5955 { "Topology ID", "isis.lsp.grp_macaddr.mtid",
5956 FT_UINT16, BASE_DEC|BASE_RANGE_STRING, RVALS(mtid_strings), 0x0fff,
5957 NULL, HFILL }
5959 { &hf_isis_lsp_grp_macaddr_vlan_id,
5960 { "VLAN ID", "isis.lsp.grp_macaddr.vlan_id",
5961 FT_UINT16, BASE_DEC, NULL, 0x0fff,
5962 NULL, HFILL }
5964 { &hf_isis_lsp_grp_macaddr_number_of_records,
5965 { "Number of records", "isis.lsp.grp_macaddr.number_of_records",
5966 FT_UINT8, BASE_DEC, NULL, 0x0,
5967 NULL, HFILL }
5969 { &hf_isis_lsp_grp_macaddr_number_of_sources,
5970 { "Number of sources", "isis.lsp.grp_macaddr.number_of_sources",
5971 FT_UINT8, BASE_DEC, NULL, 0x0,
5972 NULL, HFILL }
5974 { &hf_isis_lsp_grp_macaddr_group_address,
5975 { "Group Address", "isis.lsp.grp_macaddr.group_address",
5976 FT_SYSTEM_ID, BASE_NONE, NULL, 0x0,
5977 NULL, HFILL }
5979 { &hf_isis_lsp_grp_macaddr_source_address,
5980 { "Source Address", "isis.lsp.grp_macaddr.source_address",
5981 FT_SYSTEM_ID, BASE_NONE, NULL, 0x0,
5982 NULL, HFILL }
5984 { &hf_isis_lsp_grp_ipv4addr_length,
5985 { "Length", "isis.lsp.grp_ipv4addr.length",
5986 FT_UINT8, BASE_DEC, NULL, 0x0,
5987 NULL, HFILL }
5989 { &hf_isis_lsp_grp_ipv4addr_topology_id,
5990 { "Topology ID", "isis.lsp.grp_ipv4addr.mtid",
5991 FT_UINT16, BASE_DEC|BASE_RANGE_STRING, RVALS(mtid_strings), 0x0fff,
5992 NULL, HFILL }
5994 { &hf_isis_lsp_grp_ipv4addr_vlan_id,
5995 { "VLAN ID", "isis.lsp.grp_ipv4addr.vlan_id",
5996 FT_UINT16, BASE_DEC, NULL, 0x0fff,
5997 NULL, HFILL }
5999 { &hf_isis_lsp_grp_ipv4addr_number_of_records,
6000 { "Number of records", "isis.lsp.grp_ipv4addr.number_of_records",
6001 FT_UINT8, BASE_DEC, NULL, 0x0,
6002 NULL, HFILL }
6004 { &hf_isis_lsp_grp_ipv4addr_number_of_sources,
6005 { "Number of sources", "isis.lsp.grp_ipv4addr.number_of_sources",
6006 FT_UINT8, BASE_DEC, NULL, 0x0,
6007 NULL, HFILL }
6009 { &hf_isis_lsp_grp_ipv4addr_group_address,
6010 { "Group Address", "isis.lsp.grp_ipv4addr.group_address",
6011 FT_IPv4, BASE_NONE, NULL, 0x0,
6012 NULL, HFILL }
6014 { &hf_isis_lsp_grp_ipv4addr_source_address,
6015 { "Source Address", "isis.lsp.grp_ipv4addr.source_address",
6016 FT_IPv4, BASE_NONE, NULL, 0x0,
6017 NULL, HFILL }
6019 { &hf_isis_lsp_grp_ipv6addr_length,
6020 { "Length", "isis.lsp.grp_ipv6addr.length",
6021 FT_UINT8, BASE_DEC, NULL, 0x0,
6022 NULL, HFILL }
6024 { &hf_isis_lsp_grp_ipv6addr_topology_id,
6025 { "Topology ID", "isis.lsp.grp_ipv6addr.mtid",
6026 FT_UINT16, BASE_DEC|BASE_RANGE_STRING, RVALS(mtid_strings), 0x0fff,
6027 NULL, HFILL }
6029 { &hf_isis_lsp_grp_ipv6addr_vlan_id,
6030 { "VLAN ID", "isis.lsp.grp_ipv6addr.vlan_id",
6031 FT_UINT16, BASE_DEC, NULL, 0x0fff,
6032 NULL, HFILL }
6034 { &hf_isis_lsp_grp_ipv6addr_number_of_records,
6035 { "Number of records", "isis.lsp.grp_ipv6addr.number_of_records",
6036 FT_UINT8, BASE_DEC, NULL, 0x0,
6037 NULL, HFILL }
6039 { &hf_isis_lsp_grp_ipv6addr_number_of_sources,
6040 { "Number of sources", "isis.lsp.grp_ipv6addr.number_of_sources",
6041 FT_UINT8, BASE_DEC, NULL, 0x0,
6042 NULL, HFILL }
6044 { &hf_isis_lsp_grp_ipv6addr_group_address,
6045 { "Group Address", "isis.lsp.grp_ipv6addr.group_address",
6046 FT_IPv6, BASE_NONE, NULL, 0x0,
6047 NULL, HFILL }
6049 { &hf_isis_lsp_grp_ipv6addr_source_address,
6050 { "Source Address", "isis.lsp.grp_ipv6addr.source_address",
6051 FT_IPv6, BASE_NONE, NULL, 0x0,
6052 NULL, HFILL }
6054 { &hf_isis_lsp_grp_unknown_length,
6055 { "Length", "isis.lsp.grp_unknown.length",
6056 FT_UINT8, BASE_DEC, NULL, 0x0,
6057 NULL, HFILL }
6059 { &hf_isis_lsp_rt_capable_trill_affinity_tlv,
6060 { "Affinity Sub-TLV", "isis.lsp.rt_capable.trill.affinity_tlv",
6061 FT_BOOLEAN, 32 , TFS(&tfs_supported_not_supported), 0x80000000,
6062 NULL, HFILL }
6064 { &hf_isis_lsp_rt_capable_trill_fgl_safe,
6065 { "FGL-safe", "isis.lsp.rt_capable.trill.fgl_safe",
6066 FT_BOOLEAN, 32 , TFS(&tfs_yes_no), 0x40000000,
6067 NULL, HFILL }
6069 { &hf_isis_lsp_rt_capable_trill_caps,
6070 { "Other Capabilities", "isis.lsp.rt_capable.trill.caps",
6071 FT_BOOLEAN, 32 , TFS(&tfs_supported_not_supported), 0x3ffc0000,
6072 NULL, HFILL }
6074 { &hf_isis_lsp_rt_capable_trill_flags,
6075 { "Extended Header Flags", "isis.lsp.rt_capable.trill.flags",
6076 FT_BOOLEAN, 32 , TFS(&tfs_supported_not_supported), 0x0003ffff,
6077 NULL, HFILL }
6079 { &hf_isis_lsp_rt_capable_trill_maximum_version,
6080 { "Maximum version", "isis.lsp.rt_capable.trill.maximum_version",
6081 FT_UINT8, BASE_DEC, NULL, 0x0,
6082 NULL, HFILL }
6084 { &hf_isis_lsp_rt_capable_trees_nof_trees_to_compute,
6085 { "Nof. trees to compute", "isis.lsp.rt_capable.trees.nof_trees_to_compute",
6086 FT_UINT16, BASE_DEC, NULL, 0x0,
6087 NULL, HFILL }
6089 { &hf_isis_lsp_rt_capable_trees_maximum_nof_trees_to_compute,
6090 { "Maximum nof. trees to compute", "isis.lsp.rt_capable.trees.maximum_nof_trees_to_compute",
6091 FT_UINT16, BASE_DEC, NULL, 0x0,
6092 NULL, HFILL }
6094 { &hf_isis_lsp_rt_capable_trees_nof_trees_to_use,
6095 { "Nof. trees to use", "isis.lsp.rt_capable.trees.nof_trees_to_use",
6096 FT_UINT16, BASE_DEC, NULL, 0x0,
6097 NULL, HFILL }
6099 { &hf_isis_lsp_rt_capable_tree_root_id_starting_tree_no,
6100 { "Starting tree no", "isis.lsp.rt_capable.tree_root_id.starting_tree_no",
6101 FT_UINT16, BASE_DEC, NULL, 0x0,
6102 NULL, HFILL }
6104 { &hf_isis_lsp_rt_capable_tree_root_id_nickname,
6105 { "Nickname", "isis.lsp.rt_capable.tree_root_id.nickname",
6106 FT_UINT16, BASE_HEX_DEC, NULL, 0x0,
6107 NULL, HFILL }
6109 { &hf_isis_lsp_rt_capable_nickname_nickname_priority,
6110 { "Nickname priority", "isis.lsp.rt_capable.nickname.nickname_priority",
6111 FT_UINT8, BASE_DEC, NULL, 0x0,
6112 NULL, HFILL }
6114 { &hf_isis_lsp_rt_capable_nickname_tree_root_priority,
6115 { "Tree root priority", "isis.lsp.rt_capable.nickname.tree_root_priority",
6116 FT_UINT16, BASE_DEC, NULL, 0x0,
6117 NULL, HFILL }
6119 { &hf_isis_lsp_rt_capable_nickname_nickname,
6120 { "Nickname", "isis.lsp.rt_capable.nickname.nickname",
6121 FT_UINT16, BASE_HEX_DEC, NULL, 0x0,
6122 NULL, HFILL }
6124 { &hf_isis_lsp_rt_capable_interested_vlans_nickname,
6125 { "Nickname", "isis.lsp.rt_capable.interested_vlans.nickname",
6126 FT_UINT16, BASE_HEX_DEC, NULL, 0x0,
6127 NULL, HFILL }
6129 { &hf_isis_lsp_rt_capable_interested_vlans_multicast_ipv4,
6130 { "IPv4 multicast router", "isis.lsp.rt_capable.interested_vlans.multicast_ipv4",
6131 FT_BOOLEAN, 16, TFS(&tfs_set_notset), 0x8000,
6132 NULL, HFILL }
6134 { &hf_isis_lsp_rt_capable_interested_vlans_multicast_ipv6,
6135 { "IPv6 multicast router", "isis.lsp.rt_capable.interested_vlans.multicast_ipv6",
6136 FT_BOOLEAN, 16, TFS(&tfs_set_notset), 0x4000,
6137 NULL, HFILL }
6139 { &hf_isis_lsp_rt_capable_interested_vlans_vlan_start_id,
6140 { "Vlan start id", "isis.lsp.rt_capable.interested_vlans.vlan_start_id",
6141 FT_UINT16, BASE_DEC, NULL, 0x0fff,
6142 NULL, HFILL }
6144 { &hf_isis_lsp_rt_capable_interested_vlans_vlan_end_id,
6145 { "Vlan end id", "isis.lsp.rt_capable.interested_vlans.vlan_end_id",
6146 FT_UINT16, BASE_DEC, NULL, 0x0fff,
6147 NULL, HFILL }
6149 { &hf_isis_lsp_rt_capable_interested_vlans_afs_lost_counter,
6150 { "Appointed forward state lost counter", "isis.lsp.rt_capable.interested_vlans.afs_lost_counter",
6151 FT_UINT32, BASE_DEC, NULL, 0x0,
6152 NULL, HFILL }
6154 { &hf_isis_lsp_rt_capable_tree_used_id_starting_tree_no,
6155 { "Starting tree no", "isis.lsp.rt_capable.tree_used_id.starting_tree_no",
6156 FT_UINT16, BASE_DEC, NULL, 0x0,
6157 NULL, HFILL }
6159 { &hf_isis_lsp_rt_capable_tree_used_id_nickname,
6160 { "Nickname", "isis.lsp.rt_capable.tree_used_id.nickname",
6161 FT_UINT16, BASE_HEX_DEC, NULL, 0x0,
6162 NULL, HFILL }
6164 { &hf_isis_lsp_rt_capable_vlan_group_primary_vlan_id,
6165 { "Primary vlan id", "isis.lsp.rt_capable.vlan_group.primary_vlan_id",
6166 FT_UINT16, BASE_DEC, NULL, 0x0fff,
6167 NULL, HFILL }
6169 { &hf_isis_lsp_rt_capable_vlan_group_secondary_vlan_id,
6170 { "Secondary vlan id", "isis.lsp.rt_capable.vlan_group.secondary_vlan_id",
6171 FT_UINT16, BASE_DEC, NULL, 0x0fff,
6172 NULL, HFILL }
6174 { &hf_isis_lsp_ipv6_reachability_subclvs_len,
6175 { "SubCLV Length", "isis.lsp.ipv6_reachability.subclvs_length",
6176 FT_UINT8, BASE_DEC, NULL, 0x0,
6177 NULL, HFILL }
6179 { &hf_isis_lsp_ipv6_reachability_ipv6_prefix,
6180 { "IPv6 prefix", "isis.lsp.ipv6_reachability.ipv6_prefix",
6181 FT_IPv6, BASE_NONE, NULL, 0x0,
6182 NULL, HFILL }
6184 { &hf_isis_lsp_ipv6_reachability_metric,
6185 { "Metric", "isis.lsp.ipv6_reachability.metric",
6186 FT_UINT32, BASE_DEC, NULL, 0x0,
6187 NULL, HFILL }
6189 { &hf_isis_lsp_ipv6_reachability_distribution,
6190 { "Distribution", "isis.lsp.ipv6_reachability.distribution",
6191 FT_BOOLEAN, 8, TFS(&tfs_down_up), 0x80,
6192 NULL, HFILL }
6194 { &hf_isis_lsp_ipv6_reachability_distribution_internal,
6195 { "Distribution", "isis.lsp.ipv6_reachability.distribution_internal",
6196 FT_BOOLEAN, 8, TFS(&tfs_external_internal), 0x40,
6197 NULL, HFILL }
6199 { &hf_isis_lsp_ipv6_reachability_subtlv,
6200 { "Sub-TLV", "isis.lsp.ipv6_reachability.subtlv",
6201 FT_BOOLEAN, 8, TFS(&tfs_yes_no), 0x20,
6202 NULL, HFILL }
6204 { &hf_isis_lsp_ipv6_reachability_reserved_bits,
6205 { "Reserved bits", "isis.lsp.ipv6_reachability.reserved_bits",
6206 FT_UINT8, BASE_HEX, NULL, 0x1F,
6207 NULL, HFILL }
6209 { &hf_isis_lsp_ipv6_reachability_prefix_length,
6210 { "Prefix Length", "isis.lsp.ipv6_reachability.prefix_length",
6211 FT_UINT8, BASE_DEC, NULL, 0x0,
6212 NULL, HFILL }
6215 /* rfc7794 */
6216 { &hf_isis_lsp_prefix_attr_flags,
6217 { "Flags", "isis.lsp.prefix_attribute.flags",
6218 FT_UINT8, BASE_HEX, NULL, 0x0,
6219 NULL, HFILL }
6221 { &hf_isis_lsp_prefix_attr_flags_x,
6222 { "External Prefix", "isis.lsp.prefix_attribute.flags.x",
6223 FT_BOOLEAN, 8, TFS(&tfs_set_notset), ISIS_LSP_PFX_ATTR_FLAG_X,
6224 NULL, HFILL }
6226 { &hf_isis_lsp_prefix_attr_flags_r,
6227 { "Re-advertisement", "isis.lsp.prefix_attribute.flags.r",
6228 FT_BOOLEAN, 8, TFS(&tfs_set_notset), ISIS_LSP_PFX_ATTR_FLAG_R,
6229 NULL, HFILL }
6231 { &hf_isis_lsp_prefix_attr_flags_n,
6232 { "Node", "isis.lsp.prefix_attribute.flags.n",
6233 FT_BOOLEAN, 8, TFS(&tfs_set_notset), ISIS_LSP_PFX_ATTR_FLAG_N,
6234 NULL, HFILL }
6237 { &hf_isis_lsp_mt_cap_spb_instance_cist_root_identifier,
6238 { "CIST Root Identifier", "isis.lsp.mt_cap_spb_instance.cist_root_identifier",
6239 FT_BYTES, SEP_DASH, NULL, 0x0,
6240 NULL, HFILL }
6242 { &hf_isis_lsp_mt_cap_spb_instance_cist_external_root_path_cost,
6243 { "CIST External Root Path Cost", "isis.lsp.mt_cap_spb_instance.cist_external_root_path_cost",
6244 FT_UINT32, BASE_HEX_DEC, NULL, 0x0,
6245 NULL, HFILL }
6247 { &hf_isis_lsp_mt_cap_spb_instance_bridge_priority,
6248 { "Bridge Priority", "isis.lsp.mt_cap_spb_instance.bridge_priority",
6249 FT_UINT16, BASE_HEX_DEC, NULL, 0x0,
6250 NULL, HFILL }
6252 { &hf_isis_lsp_mt_cap_spb_instance_v,
6253 { "V", "isis.lsp.mt_cap_spb_instance.v",
6254 FT_BOOLEAN, 32, NULL, 0x00100000,
6255 NULL, HFILL }
6257 { &hf_isis_lsp_mt_cap_spb_instance_number_of_trees,
6258 { "Number of Trees", "isis.lsp.mt_cap_spb_instance.number_of_trees",
6259 FT_UINT16, BASE_HEX_DEC, NULL, 0x0,
6260 NULL, HFILL }
6262 { &hf_isis_lsp_mt_cap_spb_instance_vlanid_tuple_u,
6263 { "U", "isis.lsp.mt_cap_spb_instance.vlanid_tuple.u",
6264 FT_BOOLEAN, 8, NULL, 0x80,
6265 "Set if this bridge is currently using this ECT-ALGORITHM for I-SIDs it sources or sinks", HFILL }
6267 { &hf_isis_lsp_mt_cap_spb_instance_vlanid_tuple_m,
6268 { "M", "isis.lsp.mt_cap_spb_instance.vlanid_tuple.m",
6269 FT_BOOLEAN, 8, NULL, 0x40,
6270 "indicates if this is SPBM or SPBV mode", HFILL }
6272 { &hf_isis_lsp_mt_cap_spb_instance_vlanid_tuple_a,
6273 { "A", "isis.lsp.mt_cap_spb_instance.vlanid_tuple.a",
6274 FT_BOOLEAN, 8, NULL, 0x20,
6275 "When set, declares this is an SPVID with auto-allocation", HFILL }
6277 { &hf_isis_lsp_mt_cap_spb_instance_vlanid_tuple_reserved,
6278 { "Reserved", "isis.lsp.mt_cap_spb_instance.vlanid_tuple.reserved",
6279 FT_UINT8, BASE_HEX, NULL, 0x1F,
6280 NULL, HFILL }
6282 { &hf_isis_lsp_mt_cap_spb_instance_vlanid_tuple_ect,
6283 { "ECT-ALGORITHM", "isis.lsp.mt_cap_spb_instance.vlanid_tuple.ect",
6284 FT_UINT32, BASE_DEC, NULL, 0x0,
6285 NULL, HFILL }
6287 { &hf_isis_lsp_mt_cap_spb_instance_vlanid_tuple_base_vid,
6288 { "Base VID", "isis.lsp.mt_cap_spb_instance.vlanid_tuple.basevid",
6289 FT_UINT24, BASE_DEC, NULL, 0xFFF000,
6290 NULL, HFILL }
6292 { &hf_isis_lsp_mt_cap_spb_instance_vlanid_tuple_spvid,
6293 { "SPVID", "isis.lsp.mt_cap_spb_instance.vlanid_tuple.spvid",
6294 FT_UINT24, BASE_DEC, NULL, 0x000FFF,
6295 NULL, HFILL }
6297 { &hf_isis_lsp_mt_cap_spb_opaque_algorithm,
6298 { "Algorithm", "isis.lsp.mt_cap_spb_opaque.algorithm",
6299 FT_UINT32, BASE_DEC, NULL, 0x0,
6300 NULL, HFILL }
6302 { &hf_isis_lsp_mt_cap_spb_opaque_information,
6303 { "information", "isis.lsp.mt_cap_spb_opaque.information",
6304 FT_BYTES, BASE_NONE, NULL, 0x0,
6305 NULL, HFILL }
6307 { &hf_isis_lsp_mt_cap_spbm_service_identifier_b_mac,
6308 { "B-MAC", "isis.lsp.mt_cap_spbm_service_identifier.b_mac",
6309 FT_ETHER, BASE_NONE, NULL, 0x0,
6310 NULL, HFILL }
6312 { &hf_isis_lsp_mt_cap_spbm_service_identifier_base_vid,
6313 { "Base-VID", "isis.lsp.mt_cap_spbm_service_identifier.base_vid",
6314 FT_UINT16, BASE_HEX_DEC, NULL, 0x0,
6315 NULL, HFILL }
6317 { &hf_isis_lsp_mt_cap_spbm_service_identifier_t,
6318 { "T", "isis.lsp.mt_cap_spbm_service_identifier.t",
6319 FT_BOOLEAN, 8, NULL, 0x80,
6320 NULL, HFILL }
6322 { &hf_isis_lsp_mt_cap_spbm_service_identifier_r,
6323 { "R", "isis.lsp.mt_cap_spbm_service_identifier.r",
6324 FT_BOOLEAN, 8, NULL, 0x40,
6325 NULL, HFILL }
6327 { &hf_isis_lsp_mt_cap_spbm_service_identifier_reserved,
6328 { "Reserved", "isis.lsp.mt_cap_spbm_service_identifier.reserved",
6329 FT_UINT8, BASE_HEX, NULL, 0x3F,
6330 NULL, HFILL }
6332 { &hf_isis_lsp_mt_cap_spbm_service_identifier_i_sid,
6333 { "I-SID", "isis.lsp.mt_cap_spbm_service_identifier.i_sid",
6334 FT_UINT24, BASE_HEX, NULL, 0x0,
6335 NULL, HFILL }
6337 { &hf_isis_lsp_mt_cap_mtid,
6338 { "Topology ID", "isis.lsp.mt_cap.mtid",
6339 FT_UINT16, BASE_DEC|BASE_RANGE_STRING, RVALS(mtid_strings), 0x0fff,
6340 NULL, HFILL }
6342 { &hf_isis_lsp_eis_neighbors_reserved,
6343 { "Reserved", "isis.lsp.eis_neighbors_clv_inner.reserved",
6344 FT_UINT8, BASE_HEX, NULL, 0x0,
6345 NULL, HFILL }
6347 { &hf_isis_lsp_eis_neighbors_es_neighbor_id,
6348 { "ES Neighbor ID", "isis.lsp.eis_neighbors.es_neighbor_id",
6349 FT_SYSTEM_ID, BASE_NONE, NULL, 0x0,
6350 NULL, HFILL }
6352 { &hf_isis_lsp_eis_neighbors_is_neighbor_id,
6353 { "IS Neighbor", "isis.lsp.eis_neighbors.is_neighbor",
6354 FT_SYSTEM_ID, BASE_NONE, NULL, 0x0,
6355 NULL, HFILL }
6357 { &hf_isis_lsp_eis_neighbors_default_metric,
6358 { "Default Metric", "isis.lsp.eis_neighbors.default_metric",
6359 FT_UINT8, BASE_DEC, NULL, 0x3F,
6360 NULL, HFILL }
6362 { &hf_isis_lsp_eis_neighbors_delay_metric,
6363 { "Delay Metric", "isis.lsp.eis_neighbors.delay_metric",
6364 FT_UINT8, BASE_DEC, NULL, 0x3F,
6365 NULL, HFILL }
6367 { &hf_isis_lsp_eis_neighbors_expense_metric,
6368 { "Expense Metric", "isis.lsp.eis_neighbors.expense_metric",
6369 FT_UINT8, BASE_DEC, NULL, 0x3F,
6370 NULL, HFILL }
6372 { &hf_isis_lsp_eis_neighbors_error_metric,
6373 { "Error Metric", "isis.lsp.eis_neighbors.error_metric",
6374 FT_UINT8, BASE_DEC, NULL, 0x3F,
6375 NULL, HFILL }
6377 { &hf_isis_lsp_maximum_link_bandwidth,
6378 { "Maximum link bandwidth", "isis.lsp.maximum_link_bandwidth",
6379 FT_FLOAT, BASE_NONE, NULL, 0x0,
6380 NULL, HFILL }
6382 { &hf_isis_lsp_reservable_link_bandwidth,
6383 { "Reservable link bandwidth", "isis.lsp.reservable_link_bandwidth",
6384 FT_FLOAT, BASE_NONE, NULL, 0x0,
6385 NULL, HFILL }
6387 { &hf_isis_lsp_ext_is_reachability_is_neighbor_id,
6388 { "IS neighbor ID", "isis.lsp.ext_is_reachability.is_neighbor_id",
6389 FT_SYSTEM_ID, BASE_NONE, NULL, 0x0,
6390 NULL, HFILL }
6392 { &hf_isis_lsp_ext_is_reachability_metric,
6393 { "Metric", "isis.lsp.ext_is_reachability.metric",
6394 FT_UINT24, BASE_DEC, NULL, 0x0,
6395 NULL, HFILL }
6397 { &hf_isis_lsp_ext_is_reachability_subclvs_len,
6398 { "SubCLV Length", "isis.lsp.ext_is_reachability.subclvs_length",
6399 FT_UINT8, BASE_DEC, NULL, 0x0,
6400 NULL, HFILL }
6402 { &hf_isis_lsp_ext_is_reachability_code,
6403 { "Code", "isis.lsp.ext_is_reachability.code",
6404 FT_UINT8, BASE_DEC, VALS(isis_lsp_ext_is_reachability_code_vals), 0x0,
6405 NULL, HFILL }
6407 { &hf_isis_lsp_ext_is_reachability_len,
6408 { "Length", "isis.lsp.ext_is_reachability.length",
6409 FT_UINT8, BASE_DEC, NULL, 0x0,
6410 NULL, HFILL }
6412 { &hf_isis_lsp_ext_is_reachability_value,
6413 { "Value", "isis.lsp.ext_is_reachability.value",
6414 FT_BYTES, BASE_NONE, NULL, 0x0,
6415 NULL, HFILL }
6417 { &hf_isis_lsp_ext_is_reachability_link_local_identifier,
6418 { "Link Local Identifier", "isis.lsp.ext_is_reachability.link_local_identifier",
6419 FT_UINT32, BASE_DEC, NULL, 0x0,
6420 NULL, HFILL }
6422 { &hf_isis_lsp_ext_is_reachability_link_remote_identifier,
6423 { "Link Remote Identifier", "isis.lsp.ext_is_reachability.link_remote_identifier",
6424 FT_UINT32, BASE_DEC, NULL, 0x0,
6425 NULL, HFILL }
6427 { &hf_isis_lsp_ext_is_reachability_ipv4_interface_address,
6428 { "IPv4 interface address", "isis.lsp.ext_is_reachability.ipv4_interface_address",
6429 FT_IPv4, BASE_NONE, NULL, 0x0,
6430 NULL, HFILL }
6432 { &hf_isis_lsp_ext_is_reachability_ipv4_neighbor_address,
6433 { "IPv4 neighbor address", "isis.lsp.ext_is_reachability.ipv4_neighbor_address",
6434 FT_IPv4, BASE_NONE, NULL, 0x0,
6435 NULL, HFILL }
6437 { &hf_isis_lsp_ext_is_reachability_traffic_engineering_default_metric,
6438 { "Traffic engineering default metric", "isis.lsp.ext_is_reachability.traffic_engineering_default_metric",
6439 FT_UINT24, BASE_DEC, NULL, 0x0,
6440 NULL, HFILL }
6442 /* rfc8570 */
6443 { &hf_isis_lsp_ext_is_reachability_unidir_link_flags,
6444 { "Flags", "isis.lsp.ext_is_reachability.unidirectional_link_flags",
6445 FT_UINT8, BASE_HEX, NULL, 0x0,
6446 NULL, HFILL }
6448 { &hf_isis_lsp_ext_is_reachability_unidir_link_flags_a,
6449 { "Anomalous bit", "isis.lsp.ext_is_reachability.unidirectional_link_flags.a",
6450 FT_BOOLEAN, 8, TFS(&tfs_set_notset), 0x80,
6451 NULL, HFILL }
6453 { &hf_isis_lsp_ext_is_reachability_unidir_link_reserved,
6454 { "Reserved", "isis.lsp.ext_is_reachability.unidirectional_link_reserved",
6455 FT_UINT8, BASE_HEX, NULL, 0x0,
6456 NULL, HFILL }
6458 { &hf_isis_lsp_ext_is_reachability_unidir_link_delay,
6459 { "Delay", "isis.lsp.ext_is_reachability.unidirectional_link_delay",
6460 FT_UINT24, BASE_DEC, NULL, 0,
6461 NULL, HFILL }
6463 { &hf_isis_lsp_ext_is_reachability_unidir_link_delay_min,
6464 { "Min Delay", "isis.lsp.ext_is_reachability.unidirectional_link_delay_min",
6465 FT_UINT24, BASE_DEC, NULL, 0,
6466 NULL, HFILL }
6468 { &hf_isis_lsp_ext_is_reachability_unidir_link_delay_max,
6469 { "Max Delay", "isis.lsp.ext_is_reachability.unidirectional_link_delay_max",
6470 FT_UINT24, BASE_DEC, NULL, 0,
6471 NULL, HFILL }
6473 { &hf_isis_lsp_ext_is_reachability_unidir_delay_variation,
6474 { "Delay Variation", "isis.lsp.ext_is_reachability.unidirectional_delay_variation",
6475 FT_UINT24, BASE_DEC, NULL, 0,
6476 NULL, HFILL }
6478 { &hf_isis_lsp_ext_is_reachability_unidir_link_loss,
6479 { "Link Loss", "isis.lsp.ext_is_reachability.unidirectional_link_loss",
6480 FT_UINT24, BASE_DEC, NULL, 0,
6481 NULL, HFILL }
6483 { &hf_isis_lsp_ext_is_reachability_unidir_residual_bandwidth,
6484 { "Residual Bandwidth", "isis.lsp.ext_is_reachability.unidirectional_residual_bandwidth",
6485 FT_UINT32, BASE_DEC, NULL, 0,
6486 NULL, HFILL }
6488 { &hf_isis_lsp_ext_is_reachability_unidir_available_bandwidth,
6489 { "Available Bandwidth", "isis.lsp.ext_is_reachability.unidirectional_available_bandwidth",
6490 FT_UINT32, BASE_DEC, NULL, 0,
6491 NULL, HFILL }
6493 { &hf_isis_lsp_ext_is_reachability_unidir_utilized_bandwidth,
6494 { "Utilized Bandwidth", "isis.lsp.ext_is_reachability.unidirectional_utilized_bandwidth",
6495 FT_UINT32, BASE_DEC, NULL, 0,
6496 NULL, HFILL }
6499 { &hf_isis_lsp_partition_designated_l2_is,
6500 { "Partition designated L2 IS", "isis.lsp.partition_designated_l2_is",
6501 FT_SYSTEM_ID, BASE_NONE, NULL, 0x0,
6502 NULL, HFILL }
6504 { &hf_isis_lsp_originating_lsp_buffer_size,
6505 { "Neighbor originating buffer size", "isis.lsp.originating_lsp_buffer_size",
6506 FT_UINT16, BASE_DEC, NULL, 0x0,
6507 NULL, HFILL }
6509 { &hf_isis_lsp_error_metric,
6510 { "Error metric", "isis.lsp.error_metric",
6511 FT_BOOLEAN, 8, TFS(&tfs_set_notset), 0x40,
6512 NULL, HFILL }
6514 { &hf_isis_lsp_expense_metric,
6515 { "Expense metric", "isis.lsp.expense_metric",
6516 FT_BOOLEAN, 8, TFS(&tfs_set_notset), 0x20,
6517 NULL, HFILL }
6519 { &hf_isis_lsp_delay_metric,
6520 { "Delay metric", "isis.lsp.delay_metric",
6521 FT_BOOLEAN, 8, TFS(&tfs_set_notset), 0x10,
6522 NULL, HFILL }
6524 { &hf_isis_lsp_default_metric,
6525 { "Default metric", "isis.lsp.default_metric",
6526 FT_BOOLEAN, 8, TFS(&tfs_set_notset), 0x80,
6527 NULL, HFILL }
6529 { &hf_isis_lsp_ip_reachability_default_metric_ie,
6530 { "Default Metric IE", "isis.lsp.ip_reachability.default_metric_ie",
6531 FT_BOOLEAN, 8, TFS(&tfs_external_internal), 0x40,
6532 NULL, HFILL }
6534 { &hf_isis_lsp_ip_reachability_delay_metric_support,
6535 { "Delay Metric", "isis.lsp.ip_reachability.delay_metric_support",
6536 FT_BOOLEAN, 8, TFS(&tfs_not_supported_supported), 0x80,
6537 NULL, HFILL }
6539 { &hf_isis_lsp_ip_reachability_expense_metric_support,
6540 { "Expense Metric", "isis.lsp.ip_reachability.expense_metric_support",
6541 FT_BOOLEAN, 8, TFS(&tfs_not_supported_supported), 0x80,
6542 NULL, HFILL }
6544 { &hf_isis_lsp_ip_reachability_error_metric_support,
6545 { "Error Metric", "isis.lsp.ip_reachability.error_metric_support",
6546 FT_BOOLEAN, 8, TFS(&tfs_not_supported_supported), 0x80,
6547 NULL, HFILL }
6549 { &hf_isis_lsp_mt_cap_spsourceid,
6550 { "SPSourceId", "isis.lsp.mt_cap.spsourceid",
6551 FT_UINT32, BASE_HEX_DEC, NULL, 0x000fffff,
6552 NULL, HFILL }
6554 { &hf_isis_lsp_mt_cap_overload,
6555 { "Overload", "isis.lsp.overload",
6556 FT_BOOLEAN, 16, NULL, 0x8000,
6557 NULL, HFILL }
6559 { &hf_isis_lsp_eis_neighbors_default_metric_ie,
6560 { "Default Metric", "isis.lsp.eis_neighbors.default_metric_ie",
6561 FT_BOOLEAN, 8, TFS(&tfs_external_internal), 0x40,
6562 NULL, HFILL }
6564 { &hf_isis_lsp_eis_neighbors_delay_metric_supported,
6565 { "Delay Metric", "isis.lsp.eis_neighbors_delay_metric.supported",
6566 FT_BOOLEAN, 8, TFS(&tfs_not_supported_supported), 0x80,
6567 NULL, HFILL }
6569 { &hf_isis_lsp_eis_neighbors_expense_metric_supported,
6570 { "Expense Metric", "isis.lsp.eis_neighbors.expense_metric_supported",
6571 FT_BOOLEAN, 8, TFS(&tfs_not_supported_supported), 0x80,
6572 NULL, HFILL }
6574 { &hf_isis_lsp_eis_neighbors_error_metric_supported,
6575 { "Error Metric", "isis.lsp.eis_neighbors.error_metric_supported",
6576 FT_BOOLEAN, 8, TFS(&tfs_not_supported_supported), 0x80,
6577 NULL, HFILL }
6579 { &hf_isis_lsp_unrsv_bw_priority_level,
6580 { "priority level", "isis.lsp.unrsv_bw.priority_level",
6581 FT_FLOAT, BASE_NONE, NULL, 0x0,
6582 NULL, HFILL }
6584 { &hf_isis_lsp_ip_reachability_distribution,
6585 { "Distribution", "isis.lsp.ip_reachability.distribution",
6586 FT_BOOLEAN, 8, TFS(&tfs_down_up), 0x80,
6587 NULL, HFILL }
6589 { &hf_isis_lsp_ip_reachability_delay_metric_ie,
6590 { "Delay Metric", "isis.lsp.ip_reachability.delay_metric_ie",
6591 FT_BOOLEAN, 8, TFS(&tfs_external_internal), 0x40,
6592 NULL, HFILL }
6594 { &hf_isis_lsp_ip_reachability_expense_metric_ie,
6595 { "Expense Metric", "isis.lsp.ip_reachability.expense_metric_ie",
6596 FT_BOOLEAN, 8, TFS(&tfs_external_internal), 0x40,
6597 NULL, HFILL }
6599 { &hf_isis_lsp_ip_reachability_error_metric_ie,
6600 { "Error Metric", "isis.lsp.ip_reachability.error_metric_ie",
6601 FT_BOOLEAN, 8, TFS(&tfs_external_internal), 0x40,
6602 NULL, HFILL }
6604 { &hf_isis_lsp_eis_neighbors_delay_metric_ie,
6605 { "Delay Metric", "isis.lsp.eis_neighbors.delay_metric_ie",
6606 FT_BOOLEAN, 8, TFS(&tfs_external_internal), 0x40,
6607 NULL, HFILL }
6609 { &hf_isis_lsp_eis_neighbors_expense_metric_ie,
6610 { "Expense Metric", "isis.lsp.eis_neighbors.expense_metric_ie",
6611 FT_BOOLEAN, 8, TFS(&tfs_external_internal), 0x40,
6612 NULL, HFILL }
6614 { &hf_isis_lsp_eis_neighbors_error_metric_ie,
6615 { "Error Metric", "isis.lsp.eis_neighbors.error_metric_ie",
6616 FT_BOOLEAN, 8, TFS(&tfs_external_internal), 0x40,
6617 NULL, HFILL }
6619 { &hf_isis_lsp_rt_capable_router_id,
6620 { "Router ID", "isis.lsp.rt_capable.router_id",
6621 FT_UINT32, BASE_HEX, NULL, 0x0,
6622 NULL, HFILL }
6624 { &hf_isis_lsp_rt_capable_flag_s,
6625 { "S bit", "isis.lsp.rt_capable.flag_s",
6626 FT_BOOLEAN, 8, NULL, 0x01,
6627 NULL, HFILL }
6629 { &hf_isis_lsp_rt_capable_flag_d,
6630 { "D bit", "isis.lsp.rt_capable.flag_d",
6631 FT_BOOLEAN, 8, NULL, 0x02,
6632 NULL, HFILL }
6634 { &hf_isis_lsp_clv_te_node_cap_b_bit,
6635 { "B bit: P2MP Branch LSR capability", "isis.lsp.te_node_cap.b_bit",
6636 FT_BOOLEAN, 8, NULL, 0x80,
6637 NULL, HFILL }
6639 { &hf_isis_lsp_clv_te_node_cap_e_bit,
6640 { "E bit: P2MP Bud LSR capability", "isis.lsp.te_node_cap.e_bit",
6641 FT_BOOLEAN, 8, NULL, 0x40,
6642 NULL, HFILL }
6644 { &hf_isis_lsp_clv_te_node_cap_m_bit,
6645 { "M bit: MPLS-TE support", "isis.lsp.te_node_cap.m_bit",
6646 FT_BOOLEAN, 8, NULL, 0x20,
6647 NULL, HFILL }
6649 { &hf_isis_lsp_clv_te_node_cap_g_bit,
6650 { "G bit: GMPLS support", "isis.lsp.te_node_cap.g_bit",
6651 FT_BOOLEAN, 8, NULL, 0x10,
6652 NULL, HFILL }
6654 { &hf_isis_lsp_clv_te_node_cap_p_bit,
6655 { "P bit: P2MP RSVP-TE support", "isis.lsp.te_node_cap.p_bit",
6656 FT_BOOLEAN, 8, NULL, 0x08,
6657 NULL, HFILL }
6659 { &hf_isis_lsp_clv_sr_cap_i_flag,
6660 { "I flag: IPv4 support", "isis.lsp.sr_cap.i_flag",
6661 FT_BOOLEAN, 8, NULL, 0x80,
6662 NULL, HFILL }
6664 { &hf_isis_lsp_clv_sr_cap_v_flag,
6665 { "V flag: IPv6 support", "isis.lsp.sr_cap.v_flag",
6666 FT_BOOLEAN, 8, NULL, 0x40,
6667 NULL, HFILL }
6669 { &hf_isis_lsp_clv_sr_cap_range,
6670 { "Range", "isis.lsp.sr_cap.range",
6671 FT_UINT24, BASE_DEC, NULL, 0x0,
6672 NULL, HFILL }
6674 { &hf_isis_lsp_clv_sr_cap_sid,
6675 { "SID", "isis.lsp.sr_cap.sid",
6676 FT_UINT32, BASE_DEC, NULL, 0x0,
6677 NULL, HFILL }
6679 { &hf_isis_lsp_clv_sr_cap_label,
6680 { "Label", "isis.lsp.sr_cap.label",
6681 FT_UINT24, BASE_DEC, NULL, 0x0,
6682 NULL, HFILL }
6684 { &hf_isis_lsp_clv_sr_alg,
6685 { "Algorithm", "isis.lsp.sr_alg",
6686 FT_UINT8, BASE_DEC, VALS(isis_igp_alg_vals), 0x0,
6687 NULL, HFILL }
6689 { &hf_isis_lsp_clv_sr_lb_flags,
6690 { "Flags", "isis.lsp.sr_local_block.flags",
6691 FT_UINT8, BASE_HEX, NULL, 0x0,
6692 NULL, HFILL }
6694 { &hf_isis_lsp_clv_srv6_cap_flags,
6695 { "Flags", "isis.lsp.srv6_cap.flags",
6696 FT_UINT16, BASE_HEX, NULL, 0x0,
6697 NULL, HFILL }
6699 { &hf_isis_lsp_clv_srv6_cap_flags_o,
6700 { "OAM flag", "isis.lsp.srv6_cap.flags.o",
6701 FT_BOOLEAN, 16, TFS(&tfs_set_notset), 0x4000,
6702 NULL, HFILL }
6704 { &hf_isis_lsp_clv_srv6_cap_flags_reserved,
6705 { "Reserved", "isis.lsp.srv6_cap.flags.reserved",
6706 FT_UINT16, BASE_HEX, NULL, 0x3fff,
6707 NULL, HFILL }
6710 { &hf_isis_lsp_srv6_loc_metric,
6711 { "Metric", "isis.lsp.srv6_locator.metric",
6712 FT_UINT32, BASE_DEC, NULL, 0x0,
6713 NULL, HFILL }
6715 { &hf_isis_lsp_srv6_loc_flags,
6716 { "Flags", "isis.lsp.srv6_locator.flags",
6717 FT_UINT8, BASE_HEX, NULL, 0x0,
6718 NULL, HFILL }
6720 { &hf_isis_lsp_srv6_loc_flags_d,
6721 { "Down flag", "isis.lsp.srv6_locator.flags.d",
6722 FT_BOOLEAN, 8, TFS(&tfs_set_notset), 0x80,
6723 NULL, HFILL }
6725 { &hf_isis_lsp_srv6_loc_flags_reserved,
6726 { "Reserved", "isis.lsp.srv6_locator.flags.reserved",
6727 FT_UINT8, BASE_HEX, NULL, 0x7f,
6728 NULL, HFILL }
6730 { &hf_isis_lsp_srv6_loc_alg,
6731 { "Algorithm", "isis.lsp.srv6_locator.algorithm",
6732 FT_UINT8, BASE_DEC, VALS(isis_igp_alg_vals), 0x0,
6733 NULL, HFILL }
6735 { &hf_isis_lsp_srv6_loc_size,
6736 { "Locator Size", "isis.lsp.srv6_locator.locator_size",
6737 FT_UINT8, BASE_DEC, NULL, 0x0,
6738 NULL, HFILL }
6740 { &hf_isis_lsp_srv6_loc_locator,
6741 { "Locator", "isis.lsp.srv6_locator.locator",
6742 FT_IPv6, BASE_NONE, NULL, 0x0,
6743 NULL, HFILL }
6745 { &hf_isis_lsp_srv6_loc_subclvs_len,
6746 { "SubCLV Length", "isis.lsp.srv6_locator.subclvs_length",
6747 FT_UINT8, BASE_DEC, NULL, 0x0,
6748 NULL, HFILL }
6750 { &hf_isis_lsp_srv6_loc_sub_tlv_type,
6751 { "Code", "isis.lsp.srv6_locator.sub_tlv_type",
6752 FT_UINT8, BASE_DEC, VALS(isis_lsp_srv6_loc_sub_tlv_vals), 0x0,
6753 NULL, HFILL }
6755 { &hf_isis_lsp_srv6_loc_sub_tlv_length,
6756 { "Length", "isis.lsp.srv6_locator.sub_tlv_length",
6757 FT_UINT8, BASE_DEC, NULL, 0x0,
6758 NULL, HFILL }
6761 { &hf_isis_lsp_clv_srv6_end_sid_flags,
6762 { "Flags", "isis.lsp.srv6_end_sid.flags",
6763 FT_UINT8, BASE_HEX, NULL, 0x0,
6764 NULL, HFILL }
6766 { &hf_isis_lsp_clv_srv6_end_sid_endpoint_behavior,
6767 { "Endpoint Behavior", "isis.lsp.srv6_end_sid.endpoint_behavior",
6768 FT_UINT16, BASE_DEC, VALS(srv6_endpoint_type_vals), 0x0,
6769 NULL, HFILL }
6771 { &hf_isis_lsp_clv_srv6_end_sid_sid,
6772 { "SID", "isis.lsp.srv6_end_sid.sid",
6773 FT_IPv6, BASE_NONE, NULL, 0x0,
6774 NULL, HFILL }
6776 { &hf_isis_lsp_clv_srv6_end_sid_subsubclvs_len,
6777 { "SubSubCLV Length", "isis.lsp.srv6_end_sid.subsubclvs_length",
6778 FT_UINT8, BASE_DEC, NULL, 0x0,
6779 NULL, HFILL }
6782 { &hf_isis_lsp_clv_srv6_endx_sid_system_id,
6783 { "System-ID", "isis.lsp.srv6_endx_sid.system_id",
6784 FT_SYSTEM_ID, BASE_NONE, NULL, 0x0,
6785 NULL, HFILL }
6787 { &hf_isis_lsp_clv_srv6_endx_sid_flags,
6788 { "Flags", "isis.lsp.srv6_endx_sid.flags",
6789 FT_UINT8, BASE_HEX, NULL, 0x0,
6790 NULL, HFILL }
6792 { &hf_isis_lsp_clv_srv6_endx_sid_flags_b,
6793 { "Backup flag", "isis.lsp.srv6_endx_sid.flags.b",
6794 FT_BOOLEAN, 8, TFS(&tfs_set_notset), 0x80,
6795 NULL, HFILL }
6797 { &hf_isis_lsp_clv_srv6_endx_sid_flags_s,
6798 { "Set flag", "isis.lsp.srv6_endx_sid.flags.s",
6799 FT_BOOLEAN, 8, TFS(&tfs_set_notset), 0x40,
6800 NULL, HFILL }
6802 { &hf_isis_lsp_clv_srv6_endx_sid_flags_p,
6803 { "Persistent flag", "isis.lsp.srv6_endx_sid.flags.p",
6804 FT_BOOLEAN, 8, TFS(&tfs_set_notset), 0x20,
6805 NULL, HFILL }
6807 { &hf_isis_lsp_clv_srv6_endx_sid_flags_reserved,
6808 { "Reserved", "isis.lsp.srv6_endx_sid.flags.reserved",
6809 FT_UINT8, BASE_HEX, NULL, 0x1f,
6810 NULL, HFILL }
6812 { &hf_isis_lsp_clv_srv6_endx_sid_alg,
6813 { "Algorithm", "isis.lsp.srv6_endx_sid.algorithm",
6814 FT_UINT8, BASE_DEC, VALS(isis_igp_alg_vals), 0x0,
6815 NULL, HFILL }
6817 { &hf_isis_lsp_clv_srv6_endx_sid_weight,
6818 { "Weight", "isis.lsp.srv6_endx_sid.weight",
6819 FT_UINT8, BASE_DEC, NULL, 0x0,
6820 NULL, HFILL }
6822 { &hf_isis_lsp_clv_srv6_endx_sid_endpoint_behavior,
6823 { "Endpoint Behavior", "isis.lsp.srv6_endx_sid.endpoint_behavior",
6824 FT_UINT16, BASE_DEC, VALS(srv6_endpoint_type_vals), 0x0,
6825 NULL, HFILL }
6827 { &hf_isis_lsp_clv_srv6_endx_sid_sid,
6828 { "SID", "isis.lsp.srv6_endx_sid.sid",
6829 FT_IPv6, BASE_NONE, NULL, 0x0,
6830 NULL, HFILL }
6832 { &hf_isis_lsp_clv_srv6_endx_sid_subsubclvs_len,
6833 { "SubSubCLV Length", "isis.lsp.srv6_endx_sid.subsubclvs_length",
6834 FT_UINT8, BASE_DEC, NULL, 0x0,
6835 NULL, HFILL }
6838 /* rfc9352 */
6839 { &hf_isis_lsp_clv_srv6_sid_struct_lb_len,
6840 { "Locator Block Length", "isis.lsp.srv6_sid_struct.lb_length",
6841 FT_UINT8, BASE_DEC, NULL, 0x0,
6842 NULL, HFILL }
6844 { &hf_isis_lsp_clv_srv6_sid_struct_ln_len,
6845 { "Locator Node Length", "isis.lsp.srv6_sid_struct.ln_length",
6846 FT_UINT8, BASE_DEC, NULL, 0x0,
6847 NULL, HFILL }
6849 { &hf_isis_lsp_clv_srv6_sid_struct_fun_len,
6850 { "Function Length", "isis.lsp.srv6_sid_struct.fun_length",
6851 FT_UINT8, BASE_DEC, NULL, 0x0,
6852 NULL, HFILL }
6854 { &hf_isis_lsp_clv_srv6_sid_struct_arg_len,
6855 { "Arguments Length", "isis.lsp.srv6_sid_struct.arg_length",
6856 FT_UINT8, BASE_DEC, NULL, 0x0,
6857 NULL, HFILL }
6860 /* rfc8491 */
6861 { &hf_isis_lsp_clv_igp_msd_type,
6862 { "MSD Type", "isis.lsp.igp_msd_type",
6863 FT_UINT8, BASE_DEC, VALS(isis_lsp_igp_msd_types), 0x0,
6864 NULL, HFILL }
6866 { &hf_isis_lsp_clv_igp_msd_value,
6867 { "MSD Value", "isis.lsp.igp_msd_value",
6868 FT_UINT8, BASE_DEC, NULL, 0x0,
6869 NULL, HFILL }
6872 /* rfc7308 */
6873 { &hf_isis_lsp_clv_ext_admin_group,
6874 { "Extended Admin Group", "isis.lsp.extended_admin_group",
6875 FT_UINT32, BASE_HEX, NULL, 0x0,
6876 NULL, HFILL }
6879 /* rfc8919 */
6880 { &hf_isis_lsp_clv_app_sabm_legacy,
6881 { "Legacy flag (L)", "isis.lsp.application.sabm.legacy",
6882 FT_BOOLEAN, 8, TFS(&tfs_set_notset), 0x80,
6883 NULL, HFILL }
6885 { &hf_isis_lsp_clv_app_sabm_length,
6886 { "SABM Length", "isis.lsp.application.sabm.length",
6887 FT_UINT8, BASE_DEC, NULL, 0x7f,
6888 NULL, HFILL }
6890 { &hf_isis_lsp_clv_app_udabm_reserved,
6891 { "Reserved (R)", "isis.lsp.application.udabm.reserved",
6892 FT_BOOLEAN, 8, TFS(&tfs_set_notset), 0x80,
6893 NULL, HFILL }
6895 { &hf_isis_lsp_clv_app_udabm_length,
6896 { "UDABM Length", "isis.lsp.application.udabm.length",
6897 FT_UINT8, BASE_DEC, NULL, 0x7f,
6898 NULL, HFILL }
6900 { &hf_isis_lsp_clv_app_sabm_bits,
6901 { "Standard Application Identifier Bit Mask", "isis.lsp.application.sabm.bits",
6902 FT_UINT8, BASE_HEX, NULL, 0x0,
6903 NULL, HFILL }
6905 { &hf_isis_lsp_clv_app_sabm_bits_r,
6906 { "RSVP-TE bit (R)", "isis.lsp.application.sabm.bits.r",
6907 FT_BOOLEAN, 8, TFS(&tfs_set_notset), 0x80,
6908 NULL, HFILL }
6910 { &hf_isis_lsp_clv_app_sabm_bits_s,
6911 { "Segment Routing Policy bit (S)", "isis.lsp.application.sabm.bits.s",
6912 FT_BOOLEAN, 8, TFS(&tfs_set_notset), 0x40,
6913 NULL, HFILL }
6915 { &hf_isis_lsp_clv_app_sabm_bits_f,
6916 { "Loop-Free Alternate (LFA) bit (F)", "isis.lsp.application.sabm.bits.f",
6917 FT_BOOLEAN, 8, TFS(&tfs_set_notset), 0x20,
6918 NULL, HFILL }
6920 { &hf_isis_lsp_clv_app_sabm_bits_x,
6921 { "Flexible Algorithm bit (X)", "isis.lsp.application.sabm.bits.x",
6922 FT_BOOLEAN, 8, TFS(&tfs_set_notset), 0x10,
6923 NULL, HFILL }
6925 { &hf_isis_lsp_clv_app_udabm_bits,
6926 { "User-Defined Application Identifier Bit Mask", "isis.lsp.application.udabm.bits",
6927 FT_BYTES, SEP_SPACE, NULL, 0x0,
6928 NULL, HFILL }
6931 /* rfc9350 */
6932 { &hf_isis_lsp_clv_flex_algo_algorithm,
6933 { "Flex-Algorithm", "isis.lsp.flex_algorithm.algorithm",
6934 FT_UINT8, BASE_DEC, NULL, 0x0,
6935 NULL, HFILL }
6937 { &hf_isis_lsp_clv_flex_algo_metric_type,
6938 { "Metric-Type", "isis.lsp.flex_algorithm.metric_type",
6939 FT_UINT8, BASE_DEC, VALS(isis_lsp_flex_algo_metric_type_vals), 0x0,
6940 NULL, HFILL }
6942 { &hf_isis_lsp_clv_flex_algo_calc_type,
6943 { "Calculation-Type", "isis.lsp.flex_algorithm.calculation_type",
6944 FT_UINT8, BASE_DEC, VALS(isis_igp_alg_vals), 0x0,
6945 NULL, HFILL }
6947 { &hf_isis_lsp_clv_flex_algo_priority,
6948 { "Priority", "isis.lsp.flex_algorithm.priority",
6949 FT_UINT8, BASE_DEC, NULL, 0x0,
6950 NULL, HFILL }
6952 { &hf_isis_lsp_clv_flex_algo_def_flags,
6953 { "Flexible Algorithm Definition Flags", "isis.lsp.flex_algorithm.definition_flags",
6954 FT_UINT8, BASE_HEX, NULL, 0x0,
6955 NULL, HFILL }
6957 { &hf_isis_lsp_clv_flex_algo_def_flags_m,
6958 { "M-flag (M)", "isis.lsp.flex_algorithm.definition_flags.m",
6959 FT_BOOLEAN, 8, TFS(&tfs_set_notset), FAD_DEF_FLAGS_M,
6960 NULL, HFILL }
6962 { &hf_isis_lsp_clv_flex_algo_srlg_value,
6963 { "Shared Risk Link Group", "isis.lsp.flex_algorithm.srlg",
6964 FT_UINT32, BASE_DEC, NULL, 0x0,
6965 NULL, HFILL }
6967 { &hf_isis_lsp_clv_flex_algo_prefix_metric,
6968 { "Metric", "isis.lsp.flex_algorithm.prefix_metric",
6969 FT_UINT32, BASE_DEC, NULL, 0x0,
6970 NULL, HFILL }
6973 /* rfc6232 */
6974 { &hf_isis_lsp_purge_orig_id_num,
6975 { "Number of System IDs", "isis.lsp.purge_originator_id.num",
6976 FT_UINT8, BASE_DEC, NULL, 0x0,
6977 NULL, HFILL }
6979 { &hf_isis_lsp_purge_orig_id_system_id,
6980 { "System ID", "isis.lsp.purge_originator_id.system_id",
6981 FT_SYSTEM_ID, BASE_NONE, NULL, 0x0,
6982 NULL, HFILL }
6985 { &hf_isis_lsp_area_address,
6986 { "Area address", "isis.lsp.area_address",
6987 FT_BYTES, BASE_NONE, NULL, 0x0,
6988 NULL, HFILL }
6990 { &hf_isis_lsp_instance_identifier,
6991 { "Instance Identifier", "isis.lsp.iid",
6992 FT_UINT16, BASE_DEC, NULL, 0x0,
6993 NULL, HFILL }
6995 { &hf_isis_lsp_supported_itid,
6996 { "Supported ITID", "isis.lsp.supported_itid",
6997 FT_UINT16, BASE_DEC, NULL, 0x0,
6998 NULL, HFILL }
7000 { &hf_isis_lsp_clv_nlpid_nlpid,
7001 { "NLPID", "isis.lsp.clv_nlpid.nlpid",
7002 FT_UINT8, BASE_HEX, NULL, 0x0,
7003 NULL, HFILL }
7005 { &hf_isis_lsp_ip_authentication,
7006 { "IP Authentication", "isis.lsp.ip_authentication",
7007 FT_STRING, BASE_NONE, NULL, 0x0,
7008 NULL, HFILL }
7010 { &hf_isis_lsp_authentication,
7011 { "Authentication", "isis.lsp.authentication",
7012 FT_BYTES, BASE_NONE, NULL, 0x0,
7013 NULL, HFILL }
7015 { &hf_isis_lsp_area_address_str,
7016 { "Area address", "isis.lsp.area_address_str",
7017 FT_STRING, BASE_NONE, NULL, 0x0,
7018 NULL, HFILL }
7020 { &hf_isis_lsp_is_virtual,
7021 { "IsVirtual", "isis.lsp.is_virtual",
7022 FT_BOOLEAN, BASE_NONE, TFS(&tfs_yes_no), 0x0,
7023 NULL, HFILL }
7025 { &hf_isis_lsp_group,
7026 { "Group", "isis.lsp.group",
7027 FT_UINT32, BASE_DEC, NULL, 0x0,
7028 NULL, HFILL }
7030 { &hf_isis_lsp_default,
7031 { "Default metric", "isis.lsp.default",
7032 FT_UINT8, BASE_DEC, NULL, 0x3f,
7033 NULL, HFILL }
7035 { &hf_isis_lsp_default_support,
7036 { "Default metric supported", "isis.lsp.default_support",
7037 FT_BOOLEAN, 8, TFS(&tfs_no_yes), 0x80,
7038 NULL, HFILL }
7040 { &hf_isis_lsp_delay,
7041 { "Delay metric", "isis.lsp.delay",
7042 FT_UINT8, BASE_DEC, NULL, 0x3f,
7043 NULL, HFILL }
7045 { &hf_isis_lsp_delay_support,
7046 { "Delay metric supported", "isis.lsp.delay_support",
7047 FT_BOOLEAN, 8, TFS(&tfs_no_yes), 0x80,
7048 NULL, HFILL }
7050 { &hf_isis_lsp_expense,
7051 { "Expense metric", "isis.lsp.expense",
7052 FT_UINT8, BASE_DEC, NULL, 0x3f,
7053 NULL, HFILL }
7055 { &hf_isis_lsp_expense_support,
7056 { "Expense metric supported", "isis.lsp.expense_support",
7057 FT_BOOLEAN, 8, TFS(&tfs_no_yes), 0x80,
7058 NULL, HFILL }
7060 { &hf_isis_lsp_error,
7061 { "Error metric", "isis.lsp.error",
7062 FT_UINT8, BASE_DEC, NULL, 0x3F,
7063 NULL, HFILL }
7065 { &hf_isis_lsp_error_support,
7066 { "Error metric supported", "isis.lsp.error_support",
7067 FT_BOOLEAN, 8, TFS(&tfs_no_yes), 0x80,
7068 NULL, HFILL }
7071 /* rfc6119 */
7072 { &hf_isis_lsp_clv_ipv6_te_router_id,
7073 { "IPv6 TE Router ID", "isis.lsp.clv_ipv6_te_router_id",
7074 FT_IPv6, BASE_NONE, NULL, 0x0,
7075 "IPv6 Traffic Engineering Router ID", HFILL }
7077 { &hf_isis_lsp_ext_is_reachability_ipv6_interface_address,
7078 { "IPv6 interface address", "isis.lsp.ext_is_reachability.ipv6_interface_address",
7079 FT_IPv6, BASE_NONE, NULL, 0x0,
7080 NULL, HFILL }
7082 { &hf_isis_lsp_ext_is_reachability_ipv6_neighbor_address,
7083 { "IPv6 neighbor address", "isis.lsp.ext_is_reachability.ipv6_neighbor_address",
7084 FT_IPv6, BASE_NONE, NULL, 0x0,
7085 NULL, HFILL }
7087 { &hf_isis_lsp_clv_bier_alg,
7088 { "BIER Algorithm", "isis.lsp.bier_alg",
7089 FT_UINT8, BASE_DEC | BASE_RANGE_STRING, RVALS(isis_lsp_bier_alg_vals), 0x0,
7090 NULL, HFILL }
7092 { &hf_isis_lsp_clv_bier_igp_alg,
7093 { "IGP Algorithm", "isis.lsp.bier_igp_alg",
7094 FT_UINT8, BASE_DEC, VALS(isis_igp_alg_vals), 0x0,
7095 NULL, HFILL }
7097 { &hf_isis_lsp_clv_bier_subdomain,
7098 { "BIER sub-domain", "isis.lsp.bier_subdomain",
7099 FT_UINT8, BASE_DEC, NULL, 0x0,
7100 NULL, HFILL }
7102 { &hf_isis_lsp_clv_bier_bfrid,
7103 { "BFR-id", "isis.lsp.bier_bfrid",
7104 FT_UINT16, BASE_DEC, NULL, 0x0,
7105 NULL, HFILL }
7107 { &hf_isis_lsp_clv_bier_subsub_type,
7108 { "Type", "isis.lsp.bier.subsub.type",
7109 FT_UINT8, BASE_DEC, VALS(isis_lsp_bier_subsubtlv_type_vals), 0x0,
7110 NULL, HFILL }
7112 { &hf_isis_lsp_clv_bier_subsub_len,
7113 { "Length", "isis.lsp.bier.subsub.length",
7114 FT_UINT8, BASE_DEC, NULL, 0x0,
7115 NULL, HFILL }
7117 { &hf_isis_lsp_clv_bier_subsub_mplsencap_maxsi,
7118 { "Maximum Set Identifier", "isis.lsp.bier.subsub.mplsencap.maxsi",
7119 FT_UINT8, BASE_DEC, NULL, 0x0,
7120 NULL, HFILL }
7122 { &hf_isis_lsp_clv_bier_subsub_mplsencap_bslen,
7123 { "BitString Length", "isis.lsp.bier.subsub.mplsencap.bslen",
7124 FT_UINT8, BASE_DEC, NULL, 0xF0,
7125 NULL, HFILL }
7127 { &hf_isis_lsp_clv_bier_subsub_mplsencap_label,
7128 { "Label", "isis.lsp.bier.subsub.mplsencap.label",
7129 FT_UINT24, BASE_DEC, NULL, 0x0FFFFF,
7130 NULL, HFILL }
7132 /* rfc 6165 */
7133 { &hf_isis_lsp_mac_reachability_topoid_nick,
7134 { "Topology-id/Nickname", "isis.lsp.mac_reachability.topoid_nick",
7135 FT_BYTES, BASE_NONE, NULL, 0x0,
7136 NULL, HFILL }
7138 { &hf_isis_lsp_mac_reachability_confidence,
7139 { "Confidence", "isis.lsp.mac_reachability.confidence",
7140 FT_UINT8, BASE_DEC, NULL, 0x0,
7141 NULL, HFILL }
7143 { &hf_isis_lsp_mac_reachability_reserved,
7144 { "Reserved", "isis.lsp.mac_reachability.reserved",
7145 FT_UINT16, BASE_DEC, NULL, 0xf000,
7146 NULL, HFILL }
7148 { &hf_isis_lsp_mac_reachability_vlan,
7149 { "VLAN-ID", "isis.lsp.mac_reachability.vlan",
7150 FT_UINT16, BASE_DEC, NULL, 0x0fff,
7151 NULL, HFILL }
7153 { &hf_isis_lsp_mac_reachability_mac,
7154 { "MAC Address", "isis.lsp.mac_reachability.mac",
7155 FT_ETHER, BASE_NONE, NULL, 0x0,
7156 NULL, HFILL }
7158 { &hf_isis_lsp_mac_reachability_chassismac,
7159 { "Chassis MAC", "isis.lsp.mac_reachability.chassismac",
7160 FT_ETHER, BASE_NONE, NULL, 0x0,
7161 NULL, HFILL }
7163 { &hf_isis_lsp_mac_reachability_fanmcast,
7164 { "FAN Mcast", "isis.lsp.mac_reachability.fanmcast",
7165 FT_ETHER, BASE_NONE, NULL, 0x0,
7166 NULL, HFILL }
7168 /* Avaya proprietary */
7169 { &hf_isis_lsp_avaya_ipvpn_unknown,
7170 { "Unknown", "isis.lsp.avaya.ipvpn.unknown",
7171 FT_BYTES, BASE_NONE, NULL, 0x0,
7172 NULL, HFILL }
7174 { &hf_isis_lsp_avaya_ipvpn_system_id,
7175 { "System-ID", "isis.lsp.avaya.ipvpn.system_id",
7176 FT_SYSTEM_ID, BASE_NONE, NULL, 0x0,
7177 NULL, HFILL }
7179 { &hf_isis_lsp_avaya_ipvpn_vrfsid,
7180 { "Vrf I-SID", "isis.lsp.avaya.ipvpn.vrfsid",
7181 FT_UINT24, BASE_DEC, NULL, 0x0,
7182 NULL, HFILL }
7184 { &hf_isis_lsp_avaya_ipvpn_subtlvbytes,
7185 { "SubTLV Bytes", "isis.lsp.avaya.ipvpn.subtlvbytes",
7186 FT_UINT8, BASE_DEC, NULL, 0x0,
7187 NULL, HFILL }
7189 { &hf_isis_lsp_avaya_ipvpn_subtlvtype,
7190 { "SubTLV Type", "isis.lsp.avaya.ipvpn.subtlvtype",
7191 FT_UINT8, BASE_DEC, VALS(isis_lsp_avaya_ipvpn_subtlv_code_vals), 0x0,
7192 NULL, HFILL }
7194 { &hf_isis_lsp_avaya_ipvpn_subtlvlength,
7195 { "SubTLV Length", "isis.lsp.avaya.ipvpn.subtlvlength",
7196 FT_UINT8, BASE_DEC, NULL, 0x0,
7197 NULL, HFILL }
7199 { &hf_isis_lsp_avaya_ipvpn_unknown_sub,
7200 { "Unknown", "isis.lsp.avaya.ipvpn.sub.unknown",
7201 FT_BYTES, BASE_NONE, NULL, 0x0,
7202 NULL, HFILL }
7204 { &hf_isis_lsp_avaya_ipvpn_ipv4_metric,
7205 { "Metric", "isis.lsp.avaya.ipvpn.ipv4.metric",
7206 FT_UINT32, BASE_DEC, NULL, 0x0,
7207 NULL, HFILL }
7209 { &hf_isis_lsp_avaya_ipvpn_ipv4_metrictype,
7210 { "Metric Type", "isis.lsp.avaya.ipvpn.ipv4.metrictype",
7211 FT_UINT32, BASE_DEC, NULL, 0x0,
7212 NULL, HFILL }
7214 { &hf_isis_lsp_avaya_ipvpn_ipv4_addr,
7215 { "IPv4 Address", "isis.lsp.avaya.ipvpn.ipv4.address",
7216 FT_IPv4, BASE_NONE, NULL, 0x0,
7217 NULL, HFILL }
7219 { &hf_isis_lsp_avaya_ipvpn_ipv4_mask,
7220 { "IPv4 Mask", "isis.lsp.avaya.ipvpn.ipv4.mask",
7221 FT_IPv4, BASE_NONE, NULL, 0x0,
7222 NULL, HFILL }
7224 { &hf_isis_lsp_avaya_ipvpn_ipv6_metric,
7225 { "Metric", "isis.lsp.avaya.ipvpn.ipv6.metric",
7226 FT_UINT32, BASE_DEC, NULL, 0x0,
7227 NULL, HFILL }
7229 { &hf_isis_lsp_avaya_ipvpn_ipv6_prefixlen,
7230 { "Prefix length", "isis.lsp.avaya.ipvpn.ipv6.prefixlen",
7231 FT_UINT16, BASE_DEC, NULL, 0x0,
7232 NULL, HFILL }
7234 { &hf_isis_lsp_avaya_ipvpn_ipv6_prefix,
7235 { "Prefix", "isis.lsp.avaya.ipvpn.ipv6.prefix",
7236 FT_IPv6, BASE_NONE, NULL, 0x0,
7237 NULL, HFILL }
7239 { &hf_isis_lsp_avaya_185_unknown,
7240 { "Unknown", "isis.lsp.avaya.185.unknown",
7241 FT_BYTES, BASE_NONE, NULL, 0x0,
7242 NULL, HFILL }
7244 { &hf_isis_lsp_avaya_186_unknown,
7245 { "Unknown", "isis.lsp.avaya.186.unknown",
7246 FT_BYTES, BASE_NONE, NULL, 0x0,
7247 NULL, HFILL }
7250 static int *ett[] = {
7251 &ett_isis_lsp,
7252 &ett_isis_lsp_info,
7253 &ett_isis_lsp_att,
7254 &ett_isis_lsp_cksum,
7255 &ett_isis_lsp_clv_area_addr,
7256 &ett_isis_lsp_clv_is_neighbors,
7257 &ett_isis_lsp_clv_instance_identifier,
7258 &ett_isis_lsp_clv_ext_is_reachability, /* CLV 22 */
7259 &ett_isis_lsp_part_of_clv_ext_is_reachability,
7260 &ett_isis_lsp_part_of_clv_ext_is_reachability_subtlv,
7261 &ett_isis_lsp_subclv_admin_group,
7262 &ett_isis_lsp_subclv_unrsv_bw,
7263 &ett_isis_lsp_subclv_bw_ct,
7264 &ett_isis_lsp_subclv_spb_link_metric,
7265 &ett_isis_lsp_adj_sid_flags,
7266 &ett_isis_lsp_clv_unknown,
7267 &ett_isis_lsp_clv_partition_dis,
7268 &ett_isis_lsp_clv_prefix_neighbors,
7269 &ett_isis_lsp_clv_authentication,
7270 &ett_isis_lsp_clv_ip_authentication,
7271 &ett_isis_lsp_clv_nlpid_nlpid,
7272 &ett_isis_lsp_clv_hostname,
7273 &ett_isis_lsp_clv_srlg,
7274 &ett_isis_lsp_clv_appspec_srlg,
7275 &ett_isis_lsp_clv_appspec_srlg_subtlv,
7276 &ett_isis_lsp_clv_ipv4_int_addr,
7277 &ett_isis_lsp_clv_ipv6_int_addr, /* CLV 232 */
7278 &ett_isis_lsp_clv_mt_cap,
7279 &ett_isis_lsp_clv_mt_cap_spb_instance,
7280 &ett_isis_lsp_clv_mt_cap_spbm_service_identifier,
7281 &ett_isis_lsp_clv_mt_cap_spbv_mac_address,
7282 &ett_isis_lsp_clv_sid_label_binding,
7283 &ett_isis_lsp_clv_te_router_id,
7284 &ett_isis_lsp_clv_ip_reachability,
7285 &ett_isis_lsp_clv_ip_reach_subclv,
7286 &ett_isis_lsp_clv_ext_ip_reachability, /* CLV 135 */
7287 &ett_isis_lsp_part_of_clv_ext_ip_reachability,
7288 &ett_isis_lsp_prefix_sid_flags,
7289 &ett_isis_lsp_prefix_attr_flags,
7290 &ett_isis_lsp_clv_ipv6_reachability, /* CLV 236 */
7291 &ett_isis_lsp_part_of_clv_ipv6_reachability,
7292 &ett_isis_lsp_clv_mt,
7293 &ett_isis_lsp_clv_mt_is,
7294 &ett_isis_lsp_part_of_clv_mt_is,
7295 &ett_isis_lsp_clv_rt_capable, /*CLV 242*/
7296 &ett_isis_lsp_clv_te_node_cap_desc,
7297 &ett_isis_lsp_clv_trill_version,
7298 &ett_isis_lsp_clv_trees,
7299 &ett_isis_lsp_clv_root_id,
7300 &ett_isis_lsp_clv_nickname,
7301 &ett_isis_lsp_clv_interested_vlans,
7302 &ett_isis_lsp_clv_tree_used,
7303 &ett_isis_lsp_clv_vlan_group,
7304 &ett_isis_lsp_clv_grp_address, /*CLV 142*/
7305 &ett_isis_lsp_clv_grp_macaddr,
7306 &ett_isis_lsp_clv_grp_ipv4addr,
7307 &ett_isis_lsp_clv_grp_ipv6addr,
7308 &ett_isis_lsp_clv_grp_unknown,
7309 &ett_isis_lsp_clv_mt_reachable_IPv4_prefx,
7310 &ett_isis_lsp_clv_mt_reachable_IPv6_prefx,
7311 &ett_isis_lsp_clv_purge_orig_id, /* CLV 13 */
7312 &ett_isis_lsp_clv_originating_buff_size, /* CLV 14 */
7313 &ett_isis_lsp_clv_sr_cap,
7314 &ett_isis_lsp_clv_sr_sid_label,
7315 &ett_isis_lsp_clv_sr_alg,
7316 &ett_isis_lsp_clv_sr_lb,
7317 &ett_isis_lsp_clv_bier_subsub_tlv,
7318 &ett_isis_lsp_clv_node_msd,
7319 &ett_isis_lsp_clv_srv6_cap,
7320 &ett_isis_lsp_clv_srv6_cap_flags,
7321 &ett_isis_lsp_clv_ipv6_te_rtrid,
7322 &ett_isis_lsp_clv_srv6_endx_sid_flags,
7323 &ett_isis_lsp_clv_srv6_endx_sid_sub_sub_tlv,
7324 &ett_isis_lsp_clv_srv6_locator,
7325 &ett_isis_lsp_clv_srv6_loc_entry,
7326 &ett_isis_lsp_clv_srv6_loc_flags,
7327 &ett_isis_lsp_clv_srv6_loc_sub_tlv,
7328 &ett_isis_lsp_clv_srv6_loc_end_sid_sub_sub_tlv,
7329 &ett_isis_lsp_clv_flex_algo_def,
7330 &ett_isis_lsp_clv_flex_algo_def_sub_tlv,
7331 &ett_isis_lsp_clv_app_sabm_bits,
7332 &ett_isis_lsp_sl_flags,
7333 &ett_isis_lsp_sl_sub_tlv,
7334 &ett_isis_lsp_sl_sub_tlv_flags,
7335 &ett_isis_lsp_clv_ipv6_te_router_id, /* CLV 140, rfc6119 */
7336 &ett_isis_lsp_clv_mac_reachability, /* CLV 147, rfc6165 */
7337 &ett_isis_lsp_clv_avaya_ipvpn,
7338 &ett_isis_lsp_clv_avaya_ipvpn_subtlv,
7339 &ett_isis_lsp_clv_avaya_ipvpn_mc,
7340 &ett_isis_lsp_clv_avaya_ip_grt_mc,
7341 &ett_isis_lsp_clv_unidir_link_flags,
7344 static ei_register_info ei[] = {
7345 { &ei_isis_lsp_short_pdu, { "isis.lsp.short_pdu", PI_MALFORMED, PI_ERROR, "PDU length less than header length", EXPFILL }},
7346 { &ei_isis_lsp_long_pdu, { "isis.lsp.long_pdu", PI_MALFORMED, PI_ERROR, "PDU length greater than packet length", EXPFILL }},
7347 { &ei_isis_lsp_bad_checksum, { "isis.lsp.bad_checksum", PI_CHECKSUM, PI_ERROR, "Bad checksum", EXPFILL }},
7348 { &ei_isis_lsp_subtlv, { "isis.lsp.subtlv.unknown", PI_PROTOCOL, PI_WARN, "Unknown SubTLV", EXPFILL }},
7349 { &ei_isis_lsp_authentication, { "isis.lsp.authentication.unknown", PI_PROTOCOL, PI_WARN, "Unknown authentication type", EXPFILL }},
7350 { &ei_isis_lsp_short_clv, { "isis.lsp.short_clv", PI_MALFORMED, PI_ERROR, "Short CLV", EXPFILL }},
7351 { &ei_isis_lsp_long_clv, { "isis.lsp.long_clv", PI_MALFORMED, PI_ERROR, "Long CLV", EXPFILL }},
7352 { &ei_isis_lsp_length_clv, { "isis.lsp.length_clv", PI_MALFORMED, PI_ERROR, "Wrong length CLV", EXPFILL }},
7353 { &ei_isis_lsp_clv_mt, { "isis.lsp.clv_mt.malformed", PI_MALFORMED, PI_ERROR, "malformed MT-ID", EXPFILL }},
7354 { &ei_isis_lsp_clv_unknown, { "isis.lsp.clv.unknown", PI_UNDECODED, PI_NOTE, "Unknown option", EXPFILL }},
7355 { &ei_isis_lsp_malformed_subtlv, { "isis.lsp.subtlv.malformed", PI_MALFORMED, PI_ERROR, "malformed SubTLV", EXPFILL }},
7356 { &ei_isis_lsp_unknown_subtlv, { "isis.lsp.subtlv.unknown", PI_UNDECODED, PI_NOTE, "Unknown SubTLV", EXPFILL }},
7357 { &ei_isis_lsp_reserved_not_zero, { "isis.lsp.reserved_not_zero", PI_PROTOCOL, PI_WARN, "Reserve bit not 0", EXPFILL }},
7358 { &ei_isis_lsp_length_invalid, { "isis.lsp.length.invalid", PI_PROTOCOL, PI_WARN, "Invalid length", EXPFILL }},
7361 expert_module_t* expert_isis_lsp;
7363 /* Register the protocol name and description */
7364 proto_isis_lsp = proto_register_protocol(PROTO_STRING_LSP, "ISIS LSP", "isis.lsp");
7366 proto_register_field_array(proto_isis_lsp, hf, array_length(hf));
7367 proto_register_subtree_array(ett, array_length(ett));
7368 expert_isis_lsp = expert_register_protocol(proto_isis_lsp);
7369 expert_register_field_array(expert_isis_lsp, ei, array_length(ei));
7372 void
7373 proto_reg_handoff_isis_lsp(void)
7375 dissector_add_uint("isis.type", ISIS_TYPE_L1_LSP, create_dissector_handle(dissect_isis_l1_lsp, proto_isis_lsp));
7376 dissector_add_uint("isis.type", ISIS_TYPE_L2_LSP, create_dissector_handle(dissect_isis_l2_lsp, proto_isis_lsp));
7380 * Editor modelines - https://www.wireshark.org/tools/modelines.html
7382 * Local variables:
7383 * c-basic-offset: 4
7384 * tab-width: 8
7385 * indent-tabs-mode: nil
7386 * End:
7388 * vi: set shiftwidth=4 tabstop=8 expandtab:
7389 * :indentSize=4:tabSize=8:noTabs=true: