Revert "TODO epan/dissectors/asn1/kerberos/packet-kerberos-template.c new GSS flags"
[wireshark-sm.git] / epan / dissectors / packet-icmpv6.c
blob426a76eb003059f94d63049611e871fa605e7d22
1 /* packet-icmpv6.c
2 * Routines for ICMPv6 packet disassembly
4 * Wireshark - Network traffic analyzer
5 * By Gerald Combs <gerald@wireshark.org>
6 * Copyright 1998 Gerald Combs
8 * MobileIPv6 support added by Tomislav Borosa <tomislav.borosa@siemens.hr>
9 * Copyright 2006, Nicolas DICHTEL - 6WIND - <nicolas.dichtel@6wind.com>
11 * HMIPv6 support added by Martti Kuparinen <martti.kuparinen@iki.fi>
13 * FMIPv6 support added by Martin Andre <andre@clarinet.u-strasbg.fr>
15 * RPL support added by Colin O'Flynn & Owen Kirby.
17 * Enhance ICMPv6 dissector by Alexis La Goutte
19 * P2P-RPL support added by Cenk Gundogan <cnkgndgn@gmail.com>
21 * SPDX-License-Identifier: GPL-2.0-or-later
24 #include "config.h"
26 #include <math.h>
28 #include <epan/packet.h>
29 #include <epan/in_cksum.h>
30 #include <epan/ipproto.h>
31 #include <epan/expert.h>
32 #include <epan/conversation.h>
33 #include <epan/sequence_analysis.h>
34 #include <epan/tap.h>
35 #include <epan/capture_dissectors.h>
36 #include <epan/unit_strings.h>
37 #include <epan/proto_data.h>
38 #include <epan/strutil.h>
39 #include <epan/tfs.h>
40 #include <wsutil/array.h>
41 #include <wsutil/pow2.h>
43 #include "packet-ber.h"
44 #include "packet-dns.h"
45 #include "packet-x509af.h"
46 #include "packet-x509if.h"
47 #include "packet-icmp.h" /* same transaction_t used for both v4 and v6 */
48 #include "packet-ieee802154.h"
49 #include "packet-6lowpan.h"
50 #include "packet-ip.h"
52 void proto_register_icmpv6(void);
53 void proto_reg_handoff_icmpv6(void);
56 * The information used comes from:
57 * RFC 1885/2463/4443: Internet Control Message Protocol (ICMPv6) for the Internet Protocol Version 6 (IPv6) Specification
58 * RFC 2461/4861: Neighbor Discovery for IP Version 6 (IPv6)
59 * RFC 2491: IPv6 over Non-Broadcast Multiple Access (NBMA) networks
60 * RFC 2710: Multicast Listener Discovery for IPv6
61 * RFC 2894: Router Renumbering for IPv6
62 * RFC 3122: Extensions to IPv6 Neighbor Discovery for Inverse Discovery Specification
63 * RFC 3775/6275: Mobility Support in IPv6
64 * RFC 3810: Multicast Listener Discovery Version 2 (MLDv2) for IPv6
65 * RFC 3971: SEcure Neighbor Discovery (SEND)
66 * RFC 4065: Instructions for Seamoby and Experimental Mobility Protocol IANA Allocations
67 * RFC 4068/5268/5568: Fast Handovers for Mobile IPv6 (Mobile IPv6 Fast Handovers)
68 * RFC 4140/5380: Hierarchical Mobile IPv6 Mobility Management (HMIPv6)
69 * RFC 4191: Default Router Preferences and More-Specific Routes
70 * RFC 4286: Multicast Router Discovery
71 * RFC 4620: IPv6 Node Information Queries
72 * RFC 5006/6106: IPv6 Router Advertisement Options for DNS Configuration
73 * RFC 5075/5175: IPv6 Router Advertisement Flags Option
74 * RFC 5269: Distributing a Symmetric Fast Mobile IPv6 (FMIPv6) Handover Key Using SEcure Neighbor Discovery (SEND)
75 * RFC 5271: Mobile IPv6 Fast Handovers for 3G CDMA Networks
76 * RFC 6275: Mobility Support in IPv6
77 * RFC 6495: Subject Key Identifier (SKI) SEND Name Type fields
78 * RFC 6496: Secure Proxy ND Support for SEND
79 * RFC 6550: RPL: IPv6 Routing Protocol for Low power and Lossy Networks
80 * RFC 6554: An IPv6 Routing Header for Source Routes with RPL
81 * RFC 6743: ICMP Locator Update message for ILNPv6
82 * RFC 6775: Neighbor Discovery Optimization for Low Power and Lossy Networks (6LoWPAN)
83 * RFC 6997: Reactive Discovery of Point-to-Point Routes in Low-Power and Lossy Networks
84 * RFC 7112: Implications of Oversized IPv6 Header Chains
85 * RFC 7400: 6LoWPAN-GHC: Generic Header Compression for IPv6 over Low-Power Wireless Personal Area Networks (6LoWPANs)
86 * RFC 7731: MPL Control Message
87 * RFC 8335: PROBE: A Utility for Probing Interfaces
88 * RFC 8781: Discovering PREF64 in Router Advertisements
89 * RFC 8505: Registration Extensions for IPv6 over Low-Power Wireless Personal Area Network (6LoWPAN) Neighbor Discovery
90 * RFC 8801: Discovering Provisioning Domain Names and Data
91 * http://www.iana.org/assignments/icmpv6-parameters (last updated 2016-02-24)
94 static int proto_icmpv6;
95 static int hf_icmpv6_type;
96 static int hf_icmpv6_code;
97 static int hf_icmpv6_checksum;
98 static int hf_icmpv6_checksum_status;
99 static int hf_icmpv6_reserved;
100 static int hf_icmpv6_data;
101 static int hf_icmpv6_unknown_data;
102 static int hf_icmpv6_mtu;
103 static int hf_icmpv6_pointer;
104 static int hf_icmpv6_echo_identifier;
105 static int hf_icmpv6_echo_sequence_number;
106 static int hf_icmpv6_nonce;
107 static int hf_icmpv6_data_time;
108 static int hf_icmpv6_data_time_relative;
110 /* RFC 2461/4861 : Neighbor Discovery for IP version 6 (IPv6) */
111 static int hf_icmpv6_nd_ra_cur_hop_limit;
112 static int hf_icmpv6_nd_ra_flag;
113 static int hf_icmpv6_nd_ra_flag_m;
114 static int hf_icmpv6_nd_ra_flag_o;
115 static int hf_icmpv6_nd_ra_flag_h;
116 static int hf_icmpv6_nd_ra_flag_prf;
117 static int hf_icmpv6_nd_ra_flag_p;
118 static int hf_icmpv6_nd_ra_flag_rsv;
119 static int hf_icmpv6_nd_ra_router_lifetime;
120 static int hf_icmpv6_nd_ra_reachable_time;
121 static int hf_icmpv6_nd_ra_retrans_timer;
122 static int hf_icmpv6_nd_ns_target_address;
123 static int hf_icmpv6_nd_na_flag;
124 static int hf_icmpv6_nd_na_flag_r;
125 static int hf_icmpv6_nd_na_flag_s;
126 static int hf_icmpv6_nd_na_flag_o;
127 static int hf_icmpv6_nd_na_flag_rsv;
128 static int hf_icmpv6_nd_na_target_address;
129 static int hf_icmpv6_nd_rd_target_address;
130 static int hf_icmpv6_nd_rd_destination_address;
132 /* ND Options */
133 static int hf_icmpv6_opt;
134 static int hf_icmpv6_opt_type;
135 static int hf_icmpv6_opt_length;
136 static int hf_icmpv6_opt_linkaddr_mac;
137 static int hf_icmpv6_opt_src_linkaddr_mac;
138 static int hf_icmpv6_opt_target_linkaddr_mac;
139 static int hf_icmpv6_opt_linkaddr;
140 static int hf_icmpv6_opt_src_linkaddr;
141 static int hf_icmpv6_opt_target_linkaddr;
142 static int hf_icmpv6_opt_linkaddr_eui64;
143 static int hf_icmpv6_opt_src_linkaddr_eui64;
144 static int hf_icmpv6_opt_target_linkaddr_eui64;
145 static int hf_icmpv6_opt_prefix_len;
146 static int hf_icmpv6_opt_prefix_flag;
147 static int hf_icmpv6_opt_prefix_flag_l;
148 static int hf_icmpv6_opt_prefix_flag_a;
149 static int hf_icmpv6_opt_prefix_flag_r;
150 static int hf_icmpv6_opt_prefix_flag_p;
151 static int hf_icmpv6_opt_prefix_flag_reserved;
152 static int hf_icmpv6_opt_prefix_valid_lifetime;
153 static int hf_icmpv6_opt_prefix_preferred_lifetime;
154 static int hf_icmpv6_opt_prefix;
155 static int hf_icmpv6_opt_naack_option_code;
156 static int hf_icmpv6_opt_naack_status;
157 static int hf_icmpv6_opt_naack_supplied_ncoa;
158 static int hf_icmpv6_opt_cga_pad_len;
159 static int hf_icmpv6_opt_cga;
160 static int hf_icmpv6_opt_cga_modifier;
161 static int hf_icmpv6_opt_cga_subnet_prefix;
162 static int hf_icmpv6_opt_cga_count;
163 static int hf_icmpv6_opt_cga_subject_public_key_info;
164 static int hf_icmpv6_opt_cga_ext_type;
165 static int hf_icmpv6_opt_cga_ext_length;
166 static int hf_icmpv6_opt_cga_ext_data;
167 static int hf_icmpv6_opt_rsa_key_hash;
168 static int hf_icmpv6_opt_digital_signature_padding;
169 static int hf_icmpv6_opt_ps_key_hash;
170 static int hf_icmpv6_opt_timestamp;
171 static int hf_icmpv6_opt_nonce;
172 static int hf_icmpv6_opt_certificate_padding;
173 static int hf_icmpv6_opt_ipa_option_code;
174 static int hf_icmpv6_opt_ipa_prefix_len;
175 static int hf_icmpv6_opt_ipa_ipv6_address;
176 static int hf_icmpv6_opt_nrpi_option_code;
177 static int hf_icmpv6_opt_nrpi_prefix_len;
178 static int hf_icmpv6_opt_nrpi_prefix;
179 static int hf_icmpv6_opt_lla_option_code;
180 static int hf_icmpv6_opt_lla_bytes;
181 static int hf_icmpv6_opt_pvd_id_flags;
182 static int hf_icmpv6_opt_pvd_id_flags_h;
183 static int hf_icmpv6_opt_pvd_id_flags_l;
184 static int hf_icmpv6_opt_pvd_id_flags_r;
185 static int hf_icmpv6_opt_pvd_id_flags_reserved;
186 static int hf_icmpv6_opt_pvd_id_delay;
187 static int hf_icmpv6_opt_pvd_id_sequence_number;
188 static int hf_icmpv6_opt_pvd_id_fqdn;
189 static int hf_icmpv6_opt_map_dist;
190 static int hf_icmpv6_opt_map_pref;
191 static int hf_icmpv6_opt_map_flag;
192 static int hf_icmpv6_opt_map_flag_r;
193 static int hf_icmpv6_opt_map_flag_reserved;
194 static int hf_icmpv6_opt_map_valid_lifetime;
195 static int hf_icmpv6_opt_map_global_address;
196 static int hf_icmpv6_opt_route_info_flag;
197 static int hf_icmpv6_opt_route_info_flag_route_preference;
198 static int hf_icmpv6_opt_route_info_flag_reserved;
199 static int hf_icmpv6_opt_route_lifetime;
200 static int hf_icmpv6_opt_name_type;
201 static int hf_icmpv6_opt_name_x501;
202 static int hf_icmpv6_opt_name_fqdn;
203 static int hf_icmpv6_opt_cert_type;
204 static int hf_icmpv6_x509if_Name;
205 static int hf_icmpv6_x509af_Certificate;
206 static int hf_icmpv6_opt_redirected_packet;
207 static int hf_icmpv6_opt_mtu;
208 static int hf_icmpv6_opt_nbma_shortcut_limit;
209 static int hf_icmpv6_opt_advertisement_interval;
210 static int hf_icmpv6_opt_home_agent_preference;
211 static int hf_icmpv6_opt_home_agent_lifetime;
212 static int hf_icmpv6_opt_ipv6_address;
213 static int hf_icmpv6_opt_reserved;
214 static int hf_icmpv6_opt_padding;
215 static int hf_icmpv6_opt_rdnss_lifetime;
216 static int hf_icmpv6_opt_rdnss;
217 static int hf_icmpv6_opt_efo;
218 static int hf_icmpv6_opt_efo_m;
219 static int hf_icmpv6_opt_efo_o;
220 static int hf_icmpv6_opt_efo_h;
221 static int hf_icmpv6_opt_efo_prf;
222 static int hf_icmpv6_opt_efo_p;
223 static int hf_icmpv6_opt_efo_rsv;
224 static int hf_icmpv6_opt_hkr_pad_length;
225 static int hf_icmpv6_opt_hkr_at;
226 static int hf_icmpv6_opt_hkr_reserved;
227 static int hf_icmpv6_opt_hkr_encryption_public_key;
228 static int hf_icmpv6_opt_hkr_padding;
229 static int hf_icmpv6_opt_hkr_lifetime;
230 static int hf_icmpv6_opt_hkr_encrypted_handover_key;
231 static int hf_icmpv6_opt_hai_option_code;
232 static int hf_icmpv6_opt_hai_length;
233 static int hf_icmpv6_opt_hai_value;
234 static int hf_icmpv6_opt_mn_option_code;
235 static int hf_icmpv6_opt_mn_length;
236 static int hf_icmpv6_opt_mn_value;
237 static int hf_icmpv6_opt_dnssl_lifetime;
238 static int hf_icmpv6_opt_dnssl;
240 static int hf_icmpv6_opt_aro_status;
241 static int hf_icmpv6_opt_earo_opaque;
242 static int hf_icmpv6_opt_earo_flag;
243 static int hf_icmpv6_opt_earo_flag_p;
244 static int hf_icmpv6_opt_earo_flag_i;
245 static int hf_icmpv6_opt_earo_flag_t;
246 static int hf_icmpv6_opt_earo_flag_r;
247 static int hf_icmpv6_opt_earo_tid;
248 static int hf_icmpv6_opt_aro_registration_lifetime;
249 static int hf_icmpv6_opt_aro_eui64;
250 static int hf_icmpv6_opt_6co_context_length;
251 static int hf_icmpv6_opt_6co_flag;
252 static int hf_icmpv6_opt_6co_flag_c;
253 static int hf_icmpv6_opt_6co_flag_cid;
254 static int hf_icmpv6_opt_6co_flag_reserved;
255 static int hf_icmpv6_opt_6co_valid_lifetime;
256 static int hf_icmpv6_opt_6co_context_prefix;
257 static int hf_icmpv6_opt_abro_version_low;
258 static int hf_icmpv6_opt_abro_version_high;
259 static int hf_icmpv6_opt_abro_valid_lifetime;
260 static int hf_icmpv6_opt_abro_6lbr_address;
261 static int hf_icmpv6_opt_6cio_unassigned1;
262 static int hf_icmpv6_opt_6cio_flag_g;
263 static int hf_icmpv6_opt_6cio_unassigned2;
265 static int hf_icmpv6_opt_captive_portal;
267 static int hf_icmpv6_opt_pref64_scaled_lifetime;
268 static int hf_icmpv6_opt_pref64_plc;
269 static int hf_icmpv6_opt_pref64_prefix;
270 /* RFC 2710: Multicast Listener Discovery for IPv6 */
271 static int hf_icmpv6_mld_mrd;
272 static int hf_icmpv6_mld_multicast_address;
274 /* RFC 2894: Router Renumbering for IPv6 */
275 static int hf_icmpv6_rr_sequencenumber;
276 static int hf_icmpv6_rr_segmentnumber;
277 static int hf_icmpv6_rr_flag;
278 static int hf_icmpv6_rr_flag_t;
279 static int hf_icmpv6_rr_flag_r;
280 static int hf_icmpv6_rr_flag_a;
281 static int hf_icmpv6_rr_flag_s;
282 static int hf_icmpv6_rr_flag_p;
283 static int hf_icmpv6_rr_flag_rsv;
284 static int hf_icmpv6_rr_maxdelay;
285 static int hf_icmpv6_rr_pco_mp_part;
286 static int hf_icmpv6_rr_pco_mp_opcode;
287 static int hf_icmpv6_rr_pco_mp_oplength;
288 static int hf_icmpv6_rr_pco_mp_ordinal;
289 static int hf_icmpv6_rr_pco_mp_matchlen;
290 static int hf_icmpv6_rr_pco_mp_minlen;
291 static int hf_icmpv6_rr_pco_mp_maxlen;
292 static int hf_icmpv6_rr_pco_mp_matchprefix;
293 static int hf_icmpv6_rr_pco_up_part;
294 static int hf_icmpv6_rr_pco_up_uselen;
295 static int hf_icmpv6_rr_pco_up_keeplen;
296 static int hf_icmpv6_rr_pco_up_flagmask;
297 static int hf_icmpv6_rr_pco_up_flagmask_l;
298 static int hf_icmpv6_rr_pco_up_flagmask_a;
299 static int hf_icmpv6_rr_pco_up_flagmask_reserved;
300 static int hf_icmpv6_rr_pco_up_raflags;
301 static int hf_icmpv6_rr_pco_up_raflags_l;
302 static int hf_icmpv6_rr_pco_up_raflags_a;
303 static int hf_icmpv6_rr_pco_up_raflags_reserved;
304 static int hf_icmpv6_rr_pco_up_validlifetime;
305 static int hf_icmpv6_rr_pco_up_preferredlifetime;
306 static int hf_icmpv6_rr_pco_up_flag;
307 static int hf_icmpv6_rr_pco_up_flag_v;
308 static int hf_icmpv6_rr_pco_up_flag_p;
309 static int hf_icmpv6_rr_pco_up_flag_reserved;
310 static int hf_icmpv6_rr_pco_up_useprefix;
311 static int hf_icmpv6_rr_rm;
312 static int hf_icmpv6_rr_rm_flag;
313 static int hf_icmpv6_rr_rm_flag_b;
314 static int hf_icmpv6_rr_rm_flag_f;
315 static int hf_icmpv6_rr_rm_flag_reserved;
316 static int hf_icmpv6_rr_rm_ordinal;
317 static int hf_icmpv6_rr_rm_matchedlen;
318 static int hf_icmpv6_rr_rm_interfaceindex;
319 static int hf_icmpv6_rr_rm_matchedprefix;
321 /* RFC 3810: Multicast Listener Discovery Version 2 (MLDv2) for IPv6 */
322 static int hf_icmpv6_mld_mrc;
323 static int hf_icmpv6_mld_flag;
324 static int hf_icmpv6_mld_flag_s;
325 static int hf_icmpv6_mld_flag_qrv;
326 static int hf_icmpv6_mld_flag_rsv;
327 static int hf_icmpv6_mld_qqi;
328 static int hf_icmpv6_mld_nb_sources;
329 static int hf_icmpv6_mld_source_address;
330 static int hf_icmpv6_mldr_nb_mcast_records;
331 static int hf_icmpv6_mldr_mar;
332 static int hf_icmpv6_mldr_mar_record_type;
333 static int hf_icmpv6_mldr_mar_aux_data_len;
334 static int hf_icmpv6_mldr_mar_nb_sources;
335 static int hf_icmpv6_mldr_mar_multicast_address;
336 static int hf_icmpv6_mldr_mar_source_address;
337 static int hf_icmpv6_mldr_mar_auxiliary_data;
339 /* RFC3775/6275: Mobility Support in IPv6 */
340 static int hf_icmpv6_mip6_identifier;
341 static int hf_icmpv6_mip6_home_agent_address;
342 static int hf_icmpv6_mip6_flag;
343 static int hf_icmpv6_mip6_flag_m;
344 static int hf_icmpv6_mip6_flag_o;
345 static int hf_icmpv6_mip6_flag_rsv;
347 /* RFC3971: SEcure Neighbor Discovery (SEND) */
348 static int hf_icmpv6_send_identifier;
349 static int hf_icmpv6_send_all_components;
350 static int hf_icmpv6_send_component;
352 /* RFC 4068/5268/5568: Fast Handovers for Mobile IPv6 ( Mobile IPv6 Fast Handovers ) */
353 static int hf_icmpv6_fmip6_subtype;
354 static int hf_icmpv6_fmip6_hi_flag;
355 static int hf_icmpv6_fmip6_hi_flag_s;
356 static int hf_icmpv6_fmip6_hi_flag_u;
357 static int hf_icmpv6_fmip6_hi_flag_reserved;
358 static int hf_icmpv6_fmip6_identifier;
360 /* RFC 4286: Multicast Router Discovery */
361 static int hf_icmpv6_mcast_ra_query_interval;
362 static int hf_icmpv6_mcast_ra_robustness_variable;
364 /* RFC 4620: IPv6 Node Information Queries */
365 static int hf_icmpv6_ni_qtype;
366 static int hf_icmpv6_ni_flag;
367 static int hf_icmpv6_ni_flag_g;
368 static int hf_icmpv6_ni_flag_s;
369 static int hf_icmpv6_ni_flag_l;
370 static int hf_icmpv6_ni_flag_c;
371 static int hf_icmpv6_ni_flag_a;
372 static int hf_icmpv6_ni_flag_t;
373 static int hf_icmpv6_ni_flag_rsv;
374 static int hf_icmpv6_ni_nonce;
375 static int hf_icmpv6_ni_query_subject_ipv6;
376 static int hf_icmpv6_ni_query_subject_fqdn;
377 static int hf_icmpv6_ni_query_subject_ipv4;
378 static int hf_icmpv6_ni_reply_node_ttl;
379 static int hf_icmpv6_ni_reply_node_name;
380 static int hf_icmpv6_ni_reply_node_address;
381 static int hf_icmpv6_ni_reply_ipv4_address;
383 /* RFC 4884: Extended ICMP */
384 static int hf_icmpv6_length;
386 /* RPL: RFC 6550/6997 : Routing and Discovery of P2P Routes in Low-Power and Lossy Networks. */
387 static int hf_icmpv6_rpl_dis_flag;
388 static int hf_icmpv6_rpl_dio_instance;
389 static int hf_icmpv6_rpl_dio_version;
390 static int hf_icmpv6_rpl_dio_rank;
391 static int hf_icmpv6_rpl_dio_flag;
392 static int hf_icmpv6_rpl_dio_flag_g;
393 static int hf_icmpv6_rpl_dio_flag_0;
394 static int hf_icmpv6_rpl_dio_flag_mop;
395 static int hf_icmpv6_rpl_dio_flag_prf;
396 static int hf_icmpv6_rpl_dio_dtsn;
397 static int hf_icmpv6_rpl_dio_dagid;
398 static int hf_icmpv6_rpl_dao_instance;
399 static int hf_icmpv6_rpl_dao_flag;
400 static int hf_icmpv6_rpl_dao_flag_k;
401 static int hf_icmpv6_rpl_dao_flag_d;
402 static int hf_icmpv6_rpl_dao_flag_rsv;
403 static int hf_icmpv6_rpl_dao_sequence;
404 static int hf_icmpv6_rpl_dao_dodagid;
405 static int hf_icmpv6_rpl_daoack_instance;
406 static int hf_icmpv6_rpl_daoack_flag;
407 static int hf_icmpv6_rpl_daoack_flag_d;
408 static int hf_icmpv6_rpl_daoack_flag_rsv;
409 static int hf_icmpv6_rpl_daoack_sequence;
410 static int hf_icmpv6_rpl_daoack_status;
411 static int hf_icmpv6_rpl_daoack_dodagid;
412 static int hf_icmpv6_rpl_cc_instance;
413 static int hf_icmpv6_rpl_cc_flag;
414 static int hf_icmpv6_rpl_cc_flag_r;
415 static int hf_icmpv6_rpl_cc_flag_rsv;
416 static int hf_icmpv6_rpl_cc_nonce;
417 static int hf_icmpv6_rpl_cc_dodagid;
418 static int hf_icmpv6_rpl_cc_destination_counter;
419 static int hf_icmpv6_rpl_secure_flag;
420 static int hf_icmpv6_rpl_secure_flag_t;
421 static int hf_icmpv6_rpl_secure_flag_rsv;
422 static int hf_icmpv6_rpl_secure_algorithm;
423 static int hf_icmpv6_rpl_secure_kim;
424 static int hf_icmpv6_rpl_secure_lvl;
425 static int hf_icmpv6_rpl_secure_rsv;
426 static int hf_icmpv6_rpl_secure_counter;
427 static int hf_icmpv6_rpl_secure_key_source;
428 static int hf_icmpv6_rpl_secure_key_index;
429 static int hf_icmpv6_rpl_opt;
430 static int hf_icmpv6_rpl_opt_type;
431 static int hf_icmpv6_rpl_opt_length;
432 static int hf_icmpv6_rpl_opt_reserved;
433 static int hf_icmpv6_rpl_opt_padn;
434 static int hf_icmpv6_rpl_opt_metric_type;
435 static int hf_icmpv6_rpl_opt_metric_flags;
436 static int hf_icmpv6_rpl_opt_metric_reserved;
437 static int hf_icmpv6_rpl_opt_metric_flag_p;
438 static int hf_icmpv6_rpl_opt_metric_flag_c;
439 static int hf_icmpv6_rpl_opt_metric_flag_o;
440 static int hf_icmpv6_rpl_opt_metric_flag_r;
441 static int hf_icmpv6_rpl_opt_metric_a;
442 static int hf_icmpv6_rpl_opt_metric_prec;
443 static int hf_icmpv6_rpl_opt_metric_len;
444 static int hf_icmpv6_rpl_opt_metric_nsa_object;
445 static int hf_icmpv6_rpl_opt_metric_nsa_object_reserved;
446 static int hf_icmpv6_rpl_opt_metric_nsa_object_flags;
447 static int hf_icmpv6_rpl_opt_metric_nsa_object_flag_a;
448 static int hf_icmpv6_rpl_opt_metric_nsa_object_flag_o;
449 static int hf_icmpv6_rpl_opt_metric_nsa_object_opttlv_object;
450 static int hf_icmpv6_rpl_opt_metric_nsa_object_opttlv_object_type;
451 static int hf_icmpv6_rpl_opt_metric_nsa_object_opttlv_object_length;
452 static int hf_icmpv6_rpl_opt_metric_nsa_object_opttlv_object_data;
453 static int hf_icmpv6_rpl_opt_metric_ne_object;
454 static int hf_icmpv6_rpl_opt_metric_ne_object_flags;
455 static int hf_icmpv6_rpl_opt_metric_ne_object_flag_i;
456 static int hf_icmpv6_rpl_opt_metric_ne_object_type;
457 static int hf_icmpv6_rpl_opt_metric_ne_object_flag_e;
458 static int hf_icmpv6_rpl_opt_metric_ne_object_energy;
459 static int hf_icmpv6_rpl_opt_metric_hp_object;
460 static int hf_icmpv6_rpl_opt_metric_hp_object_reserved;
461 static int hf_icmpv6_rpl_opt_metric_hp_object_flags;
462 static int hf_icmpv6_rpl_opt_metric_hp_object_hp;
463 static int hf_icmpv6_rpl_opt_metric_lt_object_lt;
464 static int hf_icmpv6_rpl_opt_metric_ll_object_ll;
465 static int hf_icmpv6_rpl_opt_metric_lql_object;
466 static int hf_icmpv6_rpl_opt_metric_lql_object_res;
467 static int hf_icmpv6_rpl_opt_metric_lql_object_val;
468 static int hf_icmpv6_rpl_opt_metric_lql_object_counter;
469 static int hf_icmpv6_rpl_opt_metric_etx_object_etx;
470 static int hf_icmpv6_rpl_opt_metric_lc_object;
471 static int hf_icmpv6_rpl_opt_metric_lc_object_res;
472 static int hf_icmpv6_rpl_opt_metric_lc_object_lc;
473 static int hf_icmpv6_rpl_opt_metric_lc_object_counter;
474 static int hf_icmpv6_rpl_opt_metric_lc_object_reserved;
475 static int hf_icmpv6_rpl_opt_metric_lc_object_flag_i;
476 static int hf_icmpv6_rpl_opt_route_prefix_length;
477 static int hf_icmpv6_rpl_opt_route_flag;
478 static int hf_icmpv6_rpl_opt_route_pref;
479 static int hf_icmpv6_rpl_opt_route_reserved;
480 static int hf_icmpv6_rpl_opt_route_lifetime;
481 static int hf_icmpv6_rpl_opt_route_prefix;
482 static int hf_icmpv6_rpl_opt_config_flag;
483 static int hf_icmpv6_rpl_opt_config_reserved;
484 static int hf_icmpv6_rpl_opt_config_auth;
485 static int hf_icmpv6_rpl_opt_config_pcs;
486 static int hf_icmpv6_rpl_opt_config_doublings;
487 static int hf_icmpv6_rpl_opt_config_min_interval;
488 static int hf_icmpv6_rpl_opt_config_redundancy;
489 static int hf_icmpv6_rpl_opt_config_rank_incr;
490 static int hf_icmpv6_rpl_opt_config_hop_rank_inc;
491 static int hf_icmpv6_rpl_opt_config_ocp;
492 static int hf_icmpv6_rpl_opt_config_rsv;
493 static int hf_icmpv6_rpl_opt_config_def_lifetime;
494 static int hf_icmpv6_rpl_opt_config_lifetime_unit;
495 static int hf_icmpv6_rpl_opt_target_flag;
496 static int hf_icmpv6_rpl_opt_target_prefix_length;
497 static int hf_icmpv6_rpl_opt_target_prefix;
498 static int hf_icmpv6_rpl_opt_transit_flag;
499 static int hf_icmpv6_rpl_opt_transit_flag_e;
500 static int hf_icmpv6_rpl_opt_transit_flag_rsv;
501 static int hf_icmpv6_rpl_opt_transit_pathseq;
502 static int hf_icmpv6_rpl_opt_transit_pathctl;
503 static int hf_icmpv6_rpl_opt_transit_pathctl_pc1;
504 static int hf_icmpv6_rpl_opt_transit_pathctl_pc2;
505 static int hf_icmpv6_rpl_opt_transit_pathctl_pc3;
506 static int hf_icmpv6_rpl_opt_transit_pathctl_pc4;
507 static int hf_icmpv6_rpl_opt_transit_pathlifetime;
508 static int hf_icmpv6_rpl_opt_transit_parent;
509 static int hf_icmpv6_rpl_opt_solicited_instance;
510 static int hf_icmpv6_rpl_opt_solicited_flag;
511 static int hf_icmpv6_rpl_opt_solicited_flag_v;
512 static int hf_icmpv6_rpl_opt_solicited_flag_i;
513 static int hf_icmpv6_rpl_opt_solicited_flag_d;
514 static int hf_icmpv6_rpl_opt_solicited_flag_rsv;
515 static int hf_icmpv6_rpl_opt_solicited_dodagid;
516 static int hf_icmpv6_rpl_opt_solicited_version;
517 static int hf_icmpv6_rpl_opt_prefix;
518 static int hf_icmpv6_rpl_opt_prefix_flag;
519 static int hf_icmpv6_rpl_opt_prefix_flag_l;
520 static int hf_icmpv6_rpl_opt_prefix_flag_a;
521 static int hf_icmpv6_rpl_opt_prefix_flag_r;
522 static int hf_icmpv6_rpl_opt_prefix_flag_rsv;
523 static int hf_icmpv6_rpl_opt_prefix_vlifetime;
524 static int hf_icmpv6_rpl_opt_prefix_plifetime;
525 static int hf_icmpv6_rpl_opt_prefix_length;
526 static int hf_icmpv6_rpl_opt_targetdesc;
527 static int hf_icmpv6_rpl_opt_route_discovery_flag;
528 static int hf_icmpv6_rpl_opt_route_discovery_reply;
529 static int hf_icmpv6_rpl_opt_route_discovery_hop_by_hop;
530 static int hf_icmpv6_rpl_opt_route_discovery_num_of_routes;
531 static int hf_icmpv6_rpl_opt_route_discovery_compr;
532 static int hf_icmpv6_rpl_opt_route_discovery_lifetime;
533 static int hf_icmpv6_rpl_opt_route_discovery_nh;
534 static int hf_icmpv6_rpl_opt_route_discovery_maxrank;
535 static int hf_icmpv6_rpl_opt_route_discovery_target_addr;
536 static int hf_icmpv6_rpl_opt_route_discovery_addr_vec;
537 static int hf_icmpv6_rpl_opt_route_discovery_addr_vec_addr;
538 static int hf_icmpv6_rpl_p2p_dro_instance;
539 static int hf_icmpv6_rpl_p2p_dro_version;
540 static int hf_icmpv6_rpl_p2p_dro_flag;
541 static int hf_icmpv6_rpl_p2p_dro_flag_stop;
542 static int hf_icmpv6_rpl_p2p_dro_flag_ack;
543 static int hf_icmpv6_rpl_p2p_dro_flag_seq;
544 static int hf_icmpv6_rpl_p2p_dro_flag_reserved;
545 static int hf_icmpv6_rpl_p2p_dro_dagid;
546 static int hf_icmpv6_rpl_p2p_droack_flag;
547 static int hf_icmpv6_rpl_p2p_droack_flag_seq;
548 static int hf_icmpv6_rpl_p2p_droack_flag_reserved;
550 /* RFC6743 Locator Update (156) */
551 static int hf_icmpv6_ilnp_nb_locs;
552 static int hf_icmpv6_ilnp_locator;
553 static int hf_icmpv6_ilnp_preference;
554 static int hf_icmpv6_ilnp_lifetime;
556 static int hf_icmpv6_da_status;
557 static int hf_icmpv6_da_rsv;
558 static int hf_icmpv6_da_lifetime;
559 static int hf_icmpv6_da_eui64;
560 static int hf_icmpv6_da_raddr;
562 static heur_dissector_list_t icmpv6_heur_subdissector_list;
563 static int icmpv6_tap;
565 /* RFC 7731 MPL (159) */
566 static int hf_icmpv6_mpl_seed_info_min_sequence;
567 static int hf_icmpv6_mpl_seed_info_bm_len;
568 static int hf_icmpv6_mpl_seed_info_s;
569 static int hf_icmpv6_mpl_seed_info_seed_id;
570 static int hf_icmpv6_mpl_seed_info_sequence;
572 /* Extended Echo - Probe (RFC8335)*/
573 static int hf_icmpv6_ext_echo_seq_num;
574 static int hf_icmpv6_ext_echo_req_reserved;
575 static int hf_icmpv6_ext_echo_req_local;
576 static int hf_icmpv6_ext_echo_rsp_state;
577 static int hf_icmpv6_ext_echo_rsp_reserved;
578 static int hf_icmpv6_ext_echo_rsp_active;
579 static int hf_icmpv6_ext_echo_rsp_ipv4;
580 static int hf_icmpv6_ext_echo_rsp_ipv6;
582 /* Conversation related data */
583 static int hf_icmpv6_resp_in;
584 static int hf_icmpv6_resp_to;
585 static int hf_icmpv6_no_resp;
586 static int hf_icmpv6_resptime;
588 typedef struct _icmpv6_conv_info_t {
589 wmem_tree_t *unmatched_pdus;
590 wmem_tree_t *matched_pdus;
591 } icmpv6_conv_info_t;
593 static icmp_transaction_t *transaction_start(packet_info *pinfo, proto_tree *tree, uint32_t *key);
594 static icmp_transaction_t *transaction_end(packet_info *pinfo, proto_tree *tree, uint32_t *key);
596 static int ett_icmpv6;
597 static int ett_icmpv6_opt;
598 static int ett_icmpv6_mar;
599 static int ett_icmpv6_flag_prefix;
600 static int ett_icmpv6_flag_map;
601 static int ett_icmpv6_flag_pvd_id;
602 static int ett_icmpv6_flag_route_info;
603 static int ett_icmpv6_flag_6lowpan;
604 static int ett_icmpv6_flag_efo;
605 static int ett_icmpv6_flag_earo;
606 static int ett_icmpv6_rpl_opt;
607 static int ett_icmpv6_rpl_metric_type;
608 static int ett_icmpv6_rpl_metric_flags;
609 static int ett_icmpv6_rpl_metric_nsa_object;
610 static int ett_icmpv6_rpl_metric_nsa_object_tlv_type;
611 static int ett_icmpv6_rpl_metric_ne_object;
612 static int ett_icmpv6_rpl_metric_hp_object;
613 static int ett_icmpv6_rpl_metric_lql_object;
614 static int ett_icmpv6_rpl_metric_lc_object;
615 static int ett_icmpv6_rpl_flag_routing;
616 static int ett_icmpv6_rpl_flag_config;
617 static int ett_icmpv6_rpl_flag_transit;
618 static int ett_icmpv6_rpl_flag_solicited;
619 static int ett_icmpv6_rpl_flag_prefix;
620 static int ett_icmpv6_rpl_route_discovery_flag;
621 static int ett_icmpv6_rpl_route_discovery_addr_vec;
622 static int ett_icmpv6_rpl_transit_pathctl;
623 static int ett_icmpv6_rpl_p2p_dro_flag;
624 static int ett_icmpv6_rpl_p2p_droack_flag;
625 static int ett_icmpv6_flag_ni;
626 static int ett_icmpv6_flag_rr;
627 static int ett_icmpv6_rr_mp;
628 static int ett_icmpv6_rr_up;
629 static int ett_icmpv6_rr_up_flag_mask;
630 static int ett_icmpv6_rr_up_flag_ra;
631 static int ett_icmpv6_rr_up_flag;
632 static int ett_icmpv6_rr_rm;
633 static int ett_icmpv6_rr_rm_flag;
634 static int ett_icmpv6_flag_mld;
635 static int ett_icmpv6_flag_ra;
636 static int ett_icmpv6_flag_na;
637 static int ett_icmpv6_flag_mip6;
638 static int ett_icmpv6_flag_fmip6;
639 static int ett_icmpv6_flag_secure;
640 static int ett_icmpv6_flag_rpl_dio;
641 static int ett_icmpv6_flag_rpl_dao;
642 static int ett_icmpv6_flag_rpl_daoack;
643 static int ett_icmpv6_flag_rpl_cc;
644 static int ett_icmpv6_opt_name;
645 static int ett_icmpv6_cga_param_name;
646 static int ett_icmpv6_mpl_seed_info;
647 static int ett_icmpv6_mpl_seed_info_bm;
649 static expert_field ei_icmpv6_invalid_option_length;
650 static expert_field ei_icmpv6_undecoded_option;
651 static expert_field ei_icmpv6_unknown_data;
652 static expert_field ei_icmpv6_undecoded_rpl_option;
653 static expert_field ei_icmpv6_undecoded_type;
654 static expert_field ei_icmpv6_rr_pco_mp_matchlen;
655 static expert_field ei_icmpv6_rr_pco_mp_matchedlen;
656 static expert_field ei_icmpv6_checksum;
657 static expert_field ei_icmpv6_resp_not_found;
658 static expert_field ei_icmpv6_rpl_unknown_metric;
659 static expert_field ei_icmpv6_rpl_p2p_hop_by_hop;
660 static expert_field ei_icmpv6_rpl_p2p_num_of_routes;
661 static expert_field ei_icmpv6_rpl_p2p_dro_rdo_zero;
662 static expert_field ei_icmpv6_rpl_p2p_dro_zero;
664 static dissector_handle_t icmpv6_handle;
666 static dissector_handle_t ipv6_handle;
667 static dissector_handle_t icmp_extension_handle;
669 #define ICMP6_DST_UNREACH 1
670 #define ICMP6_PACKET_TOO_BIG 2
671 #define ICMP6_TIME_EXCEEDED 3
672 #define ICMP6_PARAM_PROB 4
673 #define ICMP6_ECHO_REQUEST 128
674 #define ICMP6_ECHO_REPLY 129
675 #define ICMP6_MEMBERSHIP_QUERY 130
676 #define ICMP6_MEMBERSHIP_REPORT 131
677 #define ICMP6_MEMBERSHIP_REDUCTION 132
678 #define ICMP6_ND_ROUTER_SOLICIT 133
679 #define ICMP6_ND_ROUTER_ADVERT 134
680 #define ICMP6_ND_NEIGHBOR_SOLICIT 135
681 #define ICMP6_ND_NEIGHBOR_ADVERT 136
682 #define ICMP6_ND_REDIRECT 137
683 #define ICMP6_ROUTER_RENUMBERING 138
684 #define ICMP6_NI_QUERY 139
685 #define ICMP6_NI_REPLY 140
686 #define ICMP6_IND_SOLICIT 141
687 #define ICMP6_IND_ADVERT 142
688 #define ICMP6_MLDV2_REPORT 143
689 #define ICMP6_MIP6_DHAAD_REQUEST 144
690 #define ICMP6_MIP6_DHAAD_REPLY 145
691 #define ICMP6_MIP6_MPS 146
692 #define ICMP6_MIP6_MPA 147
693 #define ICMP6_CERT_PATH_SOL 148
694 #define ICMP6_CERT_PATH_AD 149
695 #define ICMP6_EXPERIMENTAL_MOBILITY 150
696 #define ICMP6_MCAST_ROUTER_ADVERT 151
697 #define ICMP6_MCAST_ROUTER_SOLICIT 152
698 #define ICMP6_MCAST_ROUTER_TERM 153
699 #define ICMP6_FMIPV6_MESSAGES 154
700 #define ICMP6_RPL_CONTROL 155
701 #define ICMP6_ILNPV6 156
702 #define ICMP6_6LOWPANND_DAR 157
703 #define ICMP6_6LOWPANND_DAC 158
704 #define ICMP6_MPL_CONTROL 159
705 #define ICMP6_EXTECHO 160
706 #define ICMP6_EXTECHOREPLY 161
709 static const value_string icmpv6_type_val[] = {
710 { ICMP6_DST_UNREACH, "Destination Unreachable" }, /* [RFC4443] */
711 { ICMP6_PACKET_TOO_BIG, "Packet Too Big" }, /* [RFC4443] */
712 { ICMP6_TIME_EXCEEDED, "Time Exceeded" }, /* [RFC4443] */
713 { ICMP6_PARAM_PROB, "Parameter Problem" }, /* [RFC4443] */
714 { 100, "Private experimentation" }, /* [RFC4443] */
715 { 101, "Private experimentation" }, /* [RFC4443] */
716 { 127, "Reserved for expansion of ICMPv6 error messages" }, /* [RFC4443] */
717 { ICMP6_ECHO_REQUEST, "Echo (ping) request" }, /* [RFC4443] */
718 { ICMP6_ECHO_REPLY, "Echo (ping) reply" }, /* [RFC4443] */
719 { ICMP6_MEMBERSHIP_QUERY, "Multicast Listener Query" }, /* [RFC2710] */
720 { ICMP6_MEMBERSHIP_REPORT, "Multicast Listener Report" }, /* [RFC2710] */
721 { ICMP6_MEMBERSHIP_REDUCTION, "Multicast Listener Done" }, /* [RFC2710] */
722 { ICMP6_ND_ROUTER_SOLICIT, "Router Solicitation" }, /* [RFC4861] */
723 { ICMP6_ND_ROUTER_ADVERT, "Router Advertisement" }, /* [RFC4861] */
724 { ICMP6_ND_NEIGHBOR_SOLICIT, "Neighbor Solicitation" }, /* [RFC4861] */
725 { ICMP6_ND_NEIGHBOR_ADVERT, "Neighbor Advertisement" }, /* [RFC4861] */
726 { ICMP6_ND_REDIRECT, "Redirect" }, /* [RFC4861] */
727 { ICMP6_ROUTER_RENUMBERING, "Router Renumbering" }, /* [RFC2894] */
728 { ICMP6_NI_QUERY, "Node Information Query" }, /* [RFC4620] */
729 { ICMP6_NI_REPLY, "Node Information Reply" }, /* [RFC4620] */
730 { ICMP6_IND_SOLICIT, "Inverse Neighbor Discovery Solicitation" }, /* [RFC3122] */
731 { ICMP6_IND_ADVERT, "Inverse Neighbor Discovery Advertisement" }, /* [RFC3122] */
732 { ICMP6_MLDV2_REPORT, "Multicast Listener Report Message v2" }, /* [RFC3810] */
733 { ICMP6_MIP6_DHAAD_REQUEST, "Home Agent Address Discovery Request" }, /* [RFC6275] */
734 { ICMP6_MIP6_DHAAD_REPLY, "Home Agent Address Discovery Reply" }, /* [RFC6275] */
735 { ICMP6_MIP6_MPS, "Mobile Prefix Solicitation" }, /* [RFC6275] */
736 { ICMP6_MIP6_MPA, "Mobile Prefix Advertisement" }, /* [RFC6275] */
737 { ICMP6_CERT_PATH_SOL, "Certification Path Solicitation" }, /* [RFC3971] */
738 { ICMP6_CERT_PATH_AD, "Certification Path Advertisement" }, /* [RFC3971] */
739 { ICMP6_EXPERIMENTAL_MOBILITY, "Experimental Mobility" }, /* [RFC4065] */
740 { ICMP6_MCAST_ROUTER_ADVERT, "Multicast Router Advertisement" }, /* [RFC4286] */
741 { ICMP6_MCAST_ROUTER_SOLICIT, "Multicast Router Solicitation" }, /* [RFC4286] */
742 { ICMP6_MCAST_ROUTER_TERM, "Multicast Router Termination" }, /* [RFC4286] */
743 { ICMP6_FMIPV6_MESSAGES, "FMIPv6" }, /* [RFC5568] */
744 { ICMP6_RPL_CONTROL, "RPL Control" }, /* [RFC6550] */
745 { ICMP6_ILNPV6, "Locator Update"}, /* [RFC6743] */
746 { ICMP6_6LOWPANND_DAR, "Duplicate Address Request"}, /* [RFC6775] */
747 { ICMP6_6LOWPANND_DAC, "Duplicate Address Confirmation"}, /* [RFC6775] */
748 { ICMP6_MPL_CONTROL, "MPL Control Message"}, /* [RFC7731] */
749 { ICMP6_EXTECHO, "Extended Echo request"}, /* [RFC8335] */
750 { ICMP6_EXTECHOREPLY, "Extended Echo reply"}, /* [RFC8335] */
751 { 200, "Private experimentation" }, /* [RFC4443] */
752 { 201, "Private experimentation" }, /* [RFC4443] */
753 { 255, "Reserved for expansion of ICMPv6 informational messages" }, /* [RFC4443] */
754 { 0, NULL }
757 #define ICMP6_DST_UNREACH_NOROUTE 0 /* no route to destination */
758 #define ICMP6_DST_UNREACH_ADMIN 1 /* administratively prohibited */
759 #define ICMP6_DST_UNREACH_NOTNEIGHBOR 2 /* not a neighbor(obsolete) */
760 #define ICMP6_DST_UNREACH_BEYONDSCOPE 2 /* beyond scope of source address */
761 #define ICMP6_DST_UNREACH_ADDR 3 /* address unreachable */
762 #define ICMP6_DST_UNREACH_NOPORT 4 /* port unreachable */
763 #define ICMP6_DST_UNREACH_INGR_EGR 5 /* source address failed ingress/egress policy */
764 #define ICMP6_DST_UNREACH_REJECT 6 /* reject route to destination */
765 #define ICMP6_DST_UNREACH_ERROR 7 /* error in Source Routing Header */
766 #define ICMP6_DST_UNREACH_HEADERS_TOO_LONG 8 /* headers too long */
768 static const value_string icmpv6_unreach_code_val[] = {
769 { ICMP6_DST_UNREACH_NOROUTE, "No route to destination" },
770 { ICMP6_DST_UNREACH_ADMIN, "Administratively prohibited" },
771 { ICMP6_DST_UNREACH_BEYONDSCOPE, "Beyond scope of source address" },
772 { ICMP6_DST_UNREACH_ADDR, "Address unreachable" },
773 { ICMP6_DST_UNREACH_NOPORT, "Port unreachable" },
774 { ICMP6_DST_UNREACH_INGR_EGR, "Source address failed ingress/egress policy" },
775 { ICMP6_DST_UNREACH_REJECT, "Reject route to destination" },
776 { ICMP6_DST_UNREACH_ERROR, "Error in Source Routing Header" }, /* [RFC6550] [RFC6554] */
777 { ICMP6_DST_UNREACH_HEADERS_TOO_LONG, "Headers too long" }, /* [RFC8883] */
778 { 0, NULL }
781 #define ICMP6_TIME_EXCEED_TRANSIT 0 /* ttl==0 in transit */
782 #define ICMP6_TIME_EXCEED_REASSEMBLY 1 /* ttl==0 in reass */
784 static const value_string icmpv6_timeex_code_val[] = {
785 { ICMP6_TIME_EXCEED_TRANSIT, "Hop limit exceeded in transit" },
786 { ICMP6_TIME_EXCEED_REASSEMBLY, "Fragment reassembly time exceeded" },
787 { 0, NULL }
790 #define ICMP6_PARAMPROB_HEADER 0 /* erroneous header field */
791 #define ICMP6_PARAMPROB_NEXTHEADER 1 /* unrecognized next header */
792 #define ICMP6_PARAMPROB_OPTION 2 /* unrecognized option */
793 #define ICMP6_PARAMPROB_FIRSTFRAG 3 /* IPv6 First Fragment has incomplete IPv6 Header Chain [RFC 7112] */
794 #define ICMP6_PARAMPROB_HEADERERROR 4 /* SR Upper-layer Header Error [RFC8754] */
795 #define ICMP6_PARAMPROB_NEXTHEADER_INTERMEDIATE 5 /* Unrecognized Next Header type encountered by intermediate node [RFC8883] */
796 #define ICMP6_PARAMPROB_HEADER_TOO_BIG 6 /* Extension header too big [RFC8883] */
797 #define ICMP6_PARAMPROB_HEADER_CHAIN_TOO_LONG 7 /* Extension header chain too long [RFC8883] */
798 #define ICMP6_PARAMPROB_TOO_MANY_EXTENTIONS 8 /* Too many extension headers [RFC8883] */
799 #define ICMP6_PARAMPROB_TOO_MANY_OPTIONS 9 /* Too many options in extension header [RFC8883] */
800 #define ICMP6_PARAMPROB_OPTION_TOO_BIG 10 /* Option too big [RFC8883] */
802 static const value_string icmpv6_paramprob_code_val[] = {
803 { ICMP6_PARAMPROB_HEADER, "Erroneous header field encountered" },
804 { ICMP6_PARAMPROB_NEXTHEADER, "Unrecognized Next Header type encountered" },
805 { ICMP6_PARAMPROB_OPTION, "Unrecognized IPv6 option encountered" },
806 { ICMP6_PARAMPROB_FIRSTFRAG, "IPv6 First Fragment has incomplete IPv6 Header Chain" },
807 { ICMP6_PARAMPROB_HEADERERROR, "SR Upper-layer Header Error" },
808 { ICMP6_PARAMPROB_NEXTHEADER_INTERMEDIATE, "Unrecognized Next Header type encountered by intermediate node" },
809 { ICMP6_PARAMPROB_HEADER_TOO_BIG, "Extension header too big" },
810 { ICMP6_PARAMPROB_HEADER_CHAIN_TOO_LONG, "Extension header chain too long" },
811 { ICMP6_PARAMPROB_TOO_MANY_EXTENTIONS, "Too many extension headers" },
812 { ICMP6_PARAMPROB_TOO_MANY_OPTIONS, "Too many options in extension header" },
813 { ICMP6_PARAMPROB_OPTION_TOO_BIG, "Option too big" },
814 { 0, NULL }
818 /* RFC2894 - Router Renumbering for IPv6 */
820 #define ICMP6_ROUTER_RENUMBERING_COMMAND 0 /* rr command */
821 #define ICMP6_ROUTER_RENUMBERING_RESULT 1 /* rr result */
822 #define ICMP6_ROUTER_RENUMBERING_SEQNUM_RESET 255 /* rr seq num reset */
824 static const value_string icmpv6_rr_code_val[] = {
825 { ICMP6_ROUTER_RENUMBERING_COMMAND, "Command" },
826 { ICMP6_ROUTER_RENUMBERING_RESULT, "Result" },
827 { ICMP6_ROUTER_RENUMBERING_SEQNUM_RESET, "Sequence number reset" },
828 { 0, NULL }
831 #define RR_FLAG_T 0x80
832 #define RR_FLAG_R 0x40
833 #define RR_FLAG_A 0x20
834 #define RR_FLAG_S 0x10
835 #define RR_FLAG_P 0x08
836 #define RR_FLAG_RSV 0x07
838 static const value_string rr_pco_mp_opcode_val[] = {
839 { 1, "Add" },
840 { 2, "Change" },
841 { 3, "Set Global" },
842 { 0, NULL }
846 /* RFC3810 - Multicast Listener Discovery Version 2 (MLDv2) for IPv6 */
848 #define MLDV2_PACKET_MINLEN 28
850 #define MLD_FLAG_S 0x08
851 #define MLD_FLAG_QRV 0x07
852 #define MLD_FLAG_RSV 0xF0
854 static const value_string mldr_record_type_val[] = {
855 { 1, "Include" },
856 { 2, "Exclude" },
857 { 3, "Changed to include" },
858 { 4, "Changed to exclude" },
859 { 5, "Allow new sources" },
860 { 6, "Block old sources" },
861 { 0, NULL }
864 /* RFC 4068/5268/5568: Fast Handovers for Mobile IPv6 ( Mobile IPv6 Fast Handovers ) */
866 #define FMIP6_SUBTYPE_RTSOLPR 2
867 #define FMIP6_SUBTYPE_PRRTADV 3
868 #define FMIP6_SUBTYPE_HI 4
869 #define FMIP6_SUBTYPE_HACK 5
871 static const value_string fmip6_subtype_val[] = {
872 { FMIP6_SUBTYPE_RTSOLPR, "Router Solicitation for Proxy Advertisement" },
873 { FMIP6_SUBTYPE_PRRTADV, "Proxy Router Advertisement" },
874 { FMIP6_SUBTYPE_HI, "Handover Initiate" },
875 { FMIP6_SUBTYPE_HACK, "Handover Acknowledge" },
876 { 0, NULL }
879 static const value_string fmip6_prrtadv_code_val[] = {
880 { 0, "MN should use AP-ID, AR-info tuple" },
881 { 1, "Network Initiated Handover trigger" },
882 { 2, "No new router information" },
883 { 3, "Limited new router information" },
884 { 4, "Unsolicited" },
885 { 0, NULL }
888 static const value_string fmip6_hi_code_val[] = {
889 { 0, "FBU sent from previous link" },
890 { 1, "FBU sent from new link" },
891 { 0, NULL }
894 static const value_string fmip6_hack_code_val[] = {
895 { 0, "Handover Accepted, NCoA valid" },
896 { 1, "Handover Accepted, NCoA not valid" },
897 { 2, "Handover Accepted, NCoA in use" },
898 { 3, "Handover Accepted, NCoA assigned" },
899 { 4, "Handover Accepted, NCoA not assigned" },
900 { 128, "Handover Not Accepted, reason unspecified" },
901 { 129, "Administratively prohibited" },
902 { 130, "Insufficient resources" },
903 { 0, NULL }
906 #define FMIP6_HI_FLAG_S 0x80
907 #define FMIP6_HI_FLAG_U 0x40
908 #define FMIP6_HI_FLAG_RSV 0x3F
910 /* RFC 4620 - IPv6 Node Information Queries */
912 #define ICMP6_NI_SUBJ_IPV6 0 /* Query Subject is an IPv6 address */
913 #define ICMP6_NI_SUBJ_FQDN 1 /* Query Subject is a Domain name */
914 #define ICMP6_NI_SUBJ_IPV4 2 /* Query Subject is an IPv4 address */
916 #define ICMP6_NI_SUCCESS 0 /* node information successful reply */
917 #define ICMP6_NI_REFUSED 1 /* node information request is refused */
918 #define ICMP6_NI_UNKNOWN 2 /* unknown Qtype */
920 #define NI_QTYPE_NOOP 0 /* NOOP */
921 #define NI_QTYPE_SUPTYPES 1 /* Supported Qtypes (Obso) */
922 #define NI_QTYPE_NODENAME 2 /* Node Name */
923 #define NI_QTYPE_NODEADDR 3 /* Node Addresses */
924 #define NI_QTYPE_IPV4ADDR 4 /* IPv4 Addresses */
926 static const value_string ni_query_code_val[] = {
927 { ICMP6_NI_SUBJ_IPV6, "Query subject = IPv6 addresses" },
928 { ICMP6_NI_SUBJ_FQDN, "Query subject = DNS name or empty" },
929 { ICMP6_NI_SUBJ_IPV4, "Query subject = IPv4 addresses" },
930 { 0, NULL }
933 static const value_string ni_reply_code_val[] = {
934 { ICMP6_NI_SUCCESS, "Successful" },
935 { ICMP6_NI_REFUSED, "Refused" },
936 { ICMP6_NI_UNKNOWN, "Unknown query type" },
937 { 0, NULL }
939 static const value_string ni_qtype_val[] = {
940 { NI_QTYPE_NOOP, "NOOP" },
941 { NI_QTYPE_SUPTYPES, "Supported query types (Obsolete)" },
942 { NI_QTYPE_NODENAME, "Node Name" },
943 { NI_QTYPE_NODEADDR, "Node addresses" },
944 { NI_QTYPE_IPV4ADDR, "IPv4 node addresses" },
945 { 0, NULL }
948 #define NI_FLAG_G 0x0020
949 #define NI_FLAG_S 0x0010
950 #define NI_FLAG_L 0x0008
951 #define NI_FLAG_C 0x0004
952 #define NI_FLAG_A 0x0002
953 #define NI_FLAG_T 0x0001
954 #define NI_FLAG_RSV 0xFFC0
956 static const true_false_string tfs_ni_flag_a = {
957 "All unicast address",
958 "Unicast addresses on the queried interface"
961 #define ND_OPT_SOURCE_LINKADDR 1
962 #define ND_OPT_TARGET_LINKADDR 2
963 #define ND_OPT_PREFIX_INFORMATION 3
964 #define ND_OPT_REDIRECTED_HEADER 4
965 #define ND_OPT_MTU 5
966 #define ND_OPT_NBMA 6
967 #define ND_OPT_ADVINTERVAL 7
968 #define ND_OPT_HOMEAGENT_INFO 8
969 #define ND_OPT_SOURCE_ADDRLIST 9
970 #define ND_OPT_TARGET_ADDRLIST 10
971 #define ND_OPT_CGA 11
972 #define ND_OPT_RSA 12
973 #define ND_OPT_TIMESTAMP 13
974 #define ND_OPT_NONCE 14
975 #define ND_OPT_TRUST_ANCHOR 15
976 #define ND_OPT_CERTIFICATE 16
977 #define ND_OPT_IP_ADDRESS_PREFIX 17
978 #define ND_OPT_NEW_ROUTER_PREFIX_INFO 18
979 #define ND_OPT_LINK_LAYER_ADDRESS 19
980 #define ND_OPT_NEIGHBOR_ADV_ACK 20
981 #define ND_OPT_PVD_ID 21
982 #define ND_OPT_MAP 23
983 #define ND_OPT_ROUTE_INFO 24
984 #define ND_OPT_RECURSIVE_DNS_SERVER 25
985 #define ND_OPT_FLAGS_EXTENSION 26
986 #define ND_OPT_HANDOVER_KEY_REQUEST 27
987 #define ND_OPT_HANDOVER_KEY_REPLY 28
988 #define ND_OPT_HANDOVER_ASSIST_INFO 29
989 #define ND_OPT_MOBILE_NODE_ID 30
990 #define ND_OPT_DNS_SEARCH_LIST 31
991 #define ND_OPT_PROXY_SIGNATURE 32
992 #define ND_OPT_ADDR_REGISTRATION 33
993 #define ND_OPT_6LOWPAN_CONTEXT 34
994 #define ND_OPT_AUTH_BORDER_ROUTER 35
995 #define ND_OPT_6CIO 36
996 #define ND_OPT_CAPPORT 37
997 #define ND_OPT_PREF64 38
998 #define ND_OPT_CRYPTOID_PARAMETERS 39
999 #define ND_OPT_NDP_SIGNATURE 40
1000 #define ND_OPT_RESOURCE_DIR_ADDRESS 41
1001 #define ND_OPT_CONSISTENT_UPTIME 42
1003 static const value_string option_vals[] = {
1004 /* 1 */ { ND_OPT_SOURCE_LINKADDR, "Source link-layer address" },
1005 /* 2 */ { ND_OPT_TARGET_LINKADDR, "Target link-layer address" },
1006 /* 3 */ { ND_OPT_PREFIX_INFORMATION, "Prefix information" },
1007 /* 4 */ { ND_OPT_REDIRECTED_HEADER, "Redirected header" },
1008 /* 5 */ { ND_OPT_MTU, "MTU" },
1009 /* 6 */ { ND_OPT_NBMA, "NBMA Shortcut Limit Option" }, /* [RFC2491] */
1010 /* 7 */ { ND_OPT_ADVINTERVAL, "Advertisement Interval" }, /* [RFC6275] */
1011 /* 8 */ { ND_OPT_HOMEAGENT_INFO, "Home Agent Information" }, /* [RFC6275] */
1012 /* 9 */ { ND_OPT_SOURCE_ADDRLIST, "Source Address List" }, /* [RFC3122] */
1013 /* 10 */ { ND_OPT_TARGET_ADDRLIST, "Target Address List" }, /* [RFC3122] */
1014 /* 11 */ { ND_OPT_CGA, "CGA" }, /* [RFC3971] */
1015 /* 12 */ { ND_OPT_RSA, "RSA Signature" }, /* [RFC3971] */
1016 /* 13 */ { ND_OPT_TIMESTAMP, "Timestamp" }, /* [RFC3971] */
1017 /* 14 */ { ND_OPT_NONCE, "Nonce" }, /* [RFC3971] */
1018 /* 15 */ { ND_OPT_TRUST_ANCHOR, "Trust Anchor" }, /* [RFC3971] */
1019 /* 16 */ { ND_OPT_CERTIFICATE, "Certificate" }, /* [RFC3971] */
1020 /* 17 */ { ND_OPT_IP_ADDRESS_PREFIX, "IP Address/Prefix Option" }, /* [RFC5568] */
1021 /* 18 */ { ND_OPT_NEW_ROUTER_PREFIX_INFO, "New Router Prefix Information" }, /* [RFC4068] OBSO */
1022 /* 19 */ { ND_OPT_LINK_LAYER_ADDRESS, "Link-layer Address" }, /* [RFC5568] */
1023 /* 20 */ { ND_OPT_NEIGHBOR_ADV_ACK, "Neighbor Advertisement Acknowledgment" }, /* [RFC5568] */
1024 /* 21 */ { ND_OPT_PVD_ID, "PvD ID" }, /* [RFC8801] */
1025 /* 22 Unassigned */
1026 /* 23 */ { ND_OPT_MAP, "MAP" }, /* [RFC4140] */
1027 /* 24 */ { ND_OPT_ROUTE_INFO, "Route Information" }, /* [RFC4191] */
1028 /* 25 */ { ND_OPT_RECURSIVE_DNS_SERVER, "Recursive DNS Server" }, /* [RFC6106] */
1029 /* 26 */ { ND_OPT_FLAGS_EXTENSION, "RA Flags Extension" }, /* [RFC5175] */
1030 /* 27 */ { ND_OPT_HANDOVER_KEY_REQUEST, "Handover Key Request" }, /* [RFC5269] */
1031 /* 28 */ { ND_OPT_HANDOVER_KEY_REPLY, "Handover Key Reply" }, /* [RFC5269] */
1032 /* 29 */ { ND_OPT_HANDOVER_ASSIST_INFO, "Handover Assist Information" }, /* [RFC5271] */
1033 /* 30 */ { ND_OPT_MOBILE_NODE_ID, "Mobile Node Identifier Option" }, /* [RFC5271] */
1034 /* 31 */ { ND_OPT_DNS_SEARCH_LIST, "DNS Search List Option" }, /* [RFC6106] */
1035 /* 32 */ { ND_OPT_PROXY_SIGNATURE, "Proxy Signature (PS)" }, /* [RFC6496] */
1036 /* 33 */ { ND_OPT_ADDR_REGISTRATION, "Address Registration Option" }, /* [RFC6775] */
1037 /* 34 */ { ND_OPT_6LOWPAN_CONTEXT, "6LoWPAN Context Option" }, /* [RFC6775] */
1038 /* 35 */ { ND_OPT_AUTH_BORDER_ROUTER, "Authoritative Border Router" }, /* [RFC6775] */
1039 /* 36 */ { ND_OPT_6CIO, "6LoWPAN Capability Indication Option" }, /* [RFC7400] */
1040 /* 37 */ { ND_OPT_CAPPORT, "DHCP Captive-Portal" }, /* [RFC7710] */
1041 /* 38 */ { ND_OPT_PREF64, "PREF64 Option" }, /* [RFC8781] */
1042 /* 39 */ { ND_OPT_CRYPTOID_PARAMETERS, "Crypto-ID Parameters Option (CIPO)" }, /* [RFC8928] */
1043 /* 40 */ { ND_OPT_NDP_SIGNATURE, "NDP Signature Option (NDPSO)" }, /* [RFC8928] */
1044 /* 41 */ { ND_OPT_RESOURCE_DIR_ADDRESS, "Resource Directory Address Option" }, /* [RFC9176] */
1045 /* 42 */ { ND_OPT_CONSISTENT_UPTIME, "Consistent Uptime Option" }, /* [RFC-ietf-6lo-multicast-registration-19] */
1046 /* 43-137 Unassigned */
1047 { 138, "CARD Request" }, /* [RFC4065] */
1048 { 139, "CARD Reply" }, /* [RFC4065] */
1049 /* 140-143 Unassigned */
1050 { 144, "Encrypted DNS Option" }, /* [RFC9463] */
1051 /* 145-252 Unassigned */
1052 { 253, "RFC3692-style Experiment 1" }, /* [RFC4727] */
1053 { 254, "RFC3692-style Experiment 2" }, /* [RFC4727] */
1054 { 0, NULL }
1057 #define ND_RA_FLAG_M 0x80
1058 #define ND_RA_FLAG_O 0x40
1059 #define ND_RA_FLAG_H 0x20
1060 #define ND_RA_FLAG_PRF 0x18
1061 #define ND_RA_FLAG_P 0x04
1062 #define ND_RA_FLAG_RSV 0x03
1064 #define ND_NA_FLAG_R 0x80000000
1065 #define ND_NA_FLAG_S 0x40000000
1066 #define ND_NA_FLAG_O 0x20000000
1067 #define ND_NA_FLAG_RSV 0x1FFFFFFF
1069 static const value_string nd_flag_router_pref[] = {
1070 { 0, "Medium" },
1071 { 1, "High" },
1072 { 2, "Reserved" },
1073 { 3, "Low" },
1074 { 0, NULL}
1077 static const value_string nd_opt_ipa_option_code_val[] = {
1078 { 1, "Old Care-of Address" },
1079 { 2, "New Care-of Address" },
1080 { 3, "NAR's IP address" },
1081 { 4, "NAR's Prefix (sent in PrRtAdv)" },
1082 { 0, NULL }
1085 static const value_string nd_opt_lla_option_code_val[] = {
1086 { 0, "Wildcard" },
1087 { 1, "Link-layer Address of the New Access Point" },
1088 { 2, "Link-layer Address of the MN" },
1089 { 3, "Link-layer Address of the NAR" },
1090 { 4, "Link-layer Address of the source" },
1091 { 5, "The AP belongs to the current interface of the router" },
1092 { 6, "No prefix information available" },
1093 { 7, "No fast handovers support available" },
1094 { 0, NULL }
1097 static const value_string nd_opt_hai_option_code_val[] = {
1098 { 1, "Access Network Identifier (AN ID)" },
1099 { 2, "Sector ID" },
1100 { 0, NULL }
1103 static const value_string nd_opt_mn_option_code_val[] = {
1104 { 1, "NAI" },
1105 { 2, "IMSI" },
1106 { 0, NULL }
1108 static const value_string nd_opt_naack_status_val[] = {
1109 { 1, "New CoA is invalid, perform address configuration" },
1110 { 2, "New CoA is invalid, use the supplied CoA" },
1111 { 3, "NCoA is invalid, use NAR's IP address as NCoA in FBU" },
1112 { 4, "PCoA supplied, do not send FBU" },
1113 { 128, "LLA is unrecognized" },
1114 { 0, NULL }
1117 static const value_string nd_opt_earo_status_val[] = {
1118 { 0, "Success" },
1119 { 1, "Duplicate Address" },
1120 { 2, "Neighbor Cache Full" },
1121 { 3, "Moved" },
1122 { 4, "Removed" },
1123 { 5, "Validation Requested" },
1124 { 6, "Duplicate Source Address" },
1125 { 7, "Invalid Source Address" },
1126 { 8, "Registered Address Topologically Incorrect" },
1127 { 9, "6LBR Registry Saturated" },
1128 { 10, "Validation Failed" },
1129 { 11, "Registration Refresh Request" },
1130 { 12, "Invalid Registration" },
1131 { 0, NULL }
1134 #define ND_OPT_EARO_FLAG_P 0x30
1135 #define ND_OPT_EARO_FLAG_I 0x0C
1136 #define ND_OPT_EARO_FLAG_R 0x02
1137 #define ND_OPT_EARO_FLAG_T 0x01
1139 static const value_string nd_opt_earo_p_val[] = {
1140 { 0, "Unicast" },
1141 { 1, "Multicast" },
1142 { 2, "Anycast" },
1143 { 0, NULL }
1146 static const value_string nd_opt_earo_i_val[] = {
1147 { 0, "Default" },
1148 { 0, NULL }
1151 #define ND_OPT_6CO_FLAG_C 0x10
1152 #define ND_OPT_6CO_FLAG_CID 0x0F
1153 #define ND_OPT_6CO_FLAG_RESERVED 0xE0
1155 static const value_string nd_opt_da_status_val[] = {
1156 { 0, "Success" },
1157 { 1, "Duplicate Address" },
1158 { 2, "Neighbor Cache Full" },
1159 { 0, NULL }
1162 static const value_string icmpv6_option_name_type_vals[] = {
1163 { 1, "DER Encoded X.501 Name" },
1164 { 2, "FQDN" },
1165 { 3, "SHA-1 Subject Key Identifier (SKI)" },
1166 { 4, "SHA-224 Subject Key Identifier (SKI)" },
1167 { 5, "SHA-256 Subject Key Identifier (SKI)" },
1168 { 6, "SHA-384 Subject Key Identifier (SKI)" },
1169 { 7, "SHA-512 Subject Key Identifier (SKI)" },
1170 { 253, "Reserved for Experimental Use" },
1171 { 254, "Reserved for Experimental Use" },
1172 { 255, "Reserved" },
1173 { 0, NULL }
1176 static const value_string icmpv6_option_cert_type_vals[] = {
1177 { 1, "X.509v3 Certificate" },
1178 { 0, NULL }
1181 /* RFC 4191: Default Router Preferences and More-Specific Routes */
1183 #define ND_RA_FLAG_RTPREF_MASK 0x18 /* 00011000 */
1184 #define ND_RA_FLAG_RESERV_MASK 0xE7 /* 11100111 */
1186 /* RFC 5075/5175 : IPv6 Router Advertisement Flags Option */
1187 #define FLAGS_EO_M 0x8000
1188 #define FLAGS_EO_O 0x4000
1189 #define FLAGS_EO_H 0x2000
1190 #define FLAGS_EO_PRF 0x1800
1191 #define FLAGS_EO_P 0x0400
1192 #define FLAGS_EO_RSV 0x02FF
1196 /* RPL : RFC 6550 : Routing over Low-Power and Lossy Networks. */
1197 /* RPL ICMPv6 Codes */
1198 #define ICMP6_RPL_DIS 0x00 /* DODAG Information Solicitation */
1199 #define ICMP6_RPL_DIO 0x01 /* DODAG Information Object */
1200 #define ICMP6_RPL_DAO 0x02 /* Destination Advertisement Object */
1201 #define ICMP6_RPL_DAOACK 0x03 /* Destination Advertisement Object Ack */
1202 #define ICMP6_RPL_P2P_DRO 0x04 /* P2P Discovery Reply Object */
1203 #define ICMP6_RPL_P2P_DROACK 0x05 /* P2P Discovery Reply Object Acknowledgement */
1204 #define ICMP6_RPL_SDIS 0x80 /* Secure DODAG Information Solicitation */
1205 #define ICMP6_RPL_SDIO 0x81 /* Secure DODAG Information Object */
1206 #define ICMP6_RPL_SDAO 0x82 /* Secure Destination Advertisement Object */
1207 #define ICMP6_RPL_SDAOACK 0x83 /* Secure Destination Advertisement Object Ack */
1208 #define ICMP6_RPL_P2P_SDRO 0x84 /* Secure P2P Discovery Reply Object */
1209 #define ICMP6_RPL_P2P_SDROACK 0x85 /* Secure P2P Discovery Reply Object Acknowledgement */
1210 #define ICMP6_RPL_CC 0x8A /* Consistency Check */
1213 /* RPL DIO Flags */
1214 #define RPL_DIO_FLAG_G 0x80
1215 #define RPL_DIO_FLAG_0 0x40
1216 #define RPL_DIO_FLAG_MOP 0x38
1217 #define RPL_DIO_FLAG_PRF 0x07
1219 /* RPL DAO Flags */
1220 #define RPL_DAO_FLAG_K 0x80
1221 #define RPL_DAO_FLAG_D 0x40
1222 #define RPL_DAO_FLAG_RESERVED 0x3F
1224 /* RPL DAO ACK Flags */
1225 #define RPL_DAOACK_FLAG_D 0x80
1226 #define RPL_DAOACK_FLAG_RESERVED 0x7F
1228 /* RPL CC Flags */
1229 #define RPL_CC_FLAG_R 0x80
1230 #define RPL_CC_FLAG_RESERVED 0x7F
1232 /* RPL Secure */
1233 #define ICMP6_RPL_SECURE 0x80
1235 #define RPL_SECURE_FLAG_T 0x80
1236 #define RPL_SECURE_FLAG_RSV 0x7F
1238 #define RPL_SECURE_LVL 0x07
1239 #define RPL_SECURE_KIM 0xC0
1240 #define RPL_SECURE_RSV 0x38
1242 /* RPL P2P DRO Flags */
1243 #define RPL_P2P_DRO_FLAG_S 0x8000
1244 #define RPL_P2P_DRO_FLAG_A 0x4000
1245 #define RPL_P2P_DRO_FLAG_SEQ 0x3000
1246 #define RPL_P2P_DRO_FLAG_RSV 0x0FFF
1248 /* RPL P2P DROACK Flags */
1249 #define RPL_P2P_DROACK_FLAG_SEQ 0xc000
1250 #define RPL_P2P_DROACK_FLAG_RSV 0x3FFF
1252 /* RPL Option Bitfields */
1253 #define RPL_OPT_PREFIX_FLAG_L 0x80
1254 #define RPL_OPT_PREFIX_FLAG_A 0x40
1255 #define RPL_OPT_PREFIX_FLAG_R 0x20
1256 #define RPL_OPT_PREFIX_FLAG_RSV 0x1F
1257 #define RPL_OPT_ROUTE_PREFERENCE 0x18
1258 #define RPL_OPT_ROUTE_RESERVED 0xE7
1259 #define RPL_OPT_CONFIG_FLAG_AUTH 0x08
1260 #define RPL_OPT_CONFIG_FLAG_PCS 0x07
1261 #define RPL_OPT_CONFIG_FLAG_RESERVED 0xF0
1262 #define RPL_OPT_TRANSIT_FLAG_E 0x80
1263 #define RPL_OPT_TRANSIT_FLAG_RSV 0x7F
1264 #define RPL_OPT_TRANSIT_PATHCTL_PC1 0xC0
1265 #define RPL_OPT_TRANSIT_PATHCTL_PC2 0x30
1266 #define RPL_OPT_TRANSIT_PATHCTL_PC3 0x0C
1267 #define RPL_OPT_TRANSIT_PATHCTL_PC4 0x03
1268 #define RPL_OPT_SOLICITED_FLAG_V 0x80
1269 #define RPL_OPT_SOLICITED_FLAG_I 0x40
1270 #define RPL_OPT_SOLICITED_FLAG_D 0x20
1271 #define RPL_OPT_SOLICITED_FLAG_RSV 0x1F
1272 #define RPL_OPT_ROUTE_DISCOVERY_R 0x80
1273 #define RPL_OPT_ROUTE_DISCOVERY_H 0x40
1274 #define RPL_OPT_ROUTE_DISCOVERY_N 0x30
1275 #define RPL_OPT_ROUTE_DISCOVERY_COMPR 0x0F
1276 #define RPL_OPT_ROUTE_DISCOVERY_L 0xC0
1277 #define RPL_OPT_ROUTE_DISCOVERY_MR_NH 0x3F
1279 /* RPL Metric Bitfields */
1280 #define RPL_METRIC_RESERVED 0xF800
1281 #define RPL_METRIC_FLAG_P 0x0400
1282 #define RPL_METRIC_FLAG_C 0x0200
1283 #define RPL_METRIC_FLAG_O 0x0100
1284 #define RPL_METRIC_FLAG_R 0x0080
1285 #define RPL_METRIC_A 0x0070
1286 #define RPL_METRIC_PREC 0x000F
1287 #define RPL_METRIC_NSA_OBJECT_RESERVED 0xFF00
1288 #define RPL_METRIC_NSA_OBJECT_FLAGS 0x00FC
1289 #define RPL_METRIC_NSA_OBJECT_FLAG_A 0x0002
1290 #define RPL_METRIC_NSA_OBJECT_FLAG_O 0x0001
1291 #define RPL_METRIC_NE_OBJECT_FLAGS 0xF000
1292 #define RPL_METRIC_NE_OBJECT_FLAG_I 0x0800
1293 #define RPL_METRIC_NE_OBJECT_TYPE 0x0600
1294 #define RPL_METRIC_NE_OBJECT_FLAG_E 0x0100
1295 #define RPL_METRIC_NE_OBJECT_ENERGY 0x00FF
1296 #define RPL_METRIC_HP_OBJECT_RESERVED 0xF000
1297 #define RPL_METRIC_HP_OBJECT_FLAGS 0x0F00
1298 #define RPL_METRIC_HP_OBJECT_HP 0x00FF
1299 #define RPL_METRIC_LQL_OBJECT_RES 0xFF
1300 #define RPL_METRIC_LQL_OBJECT_VAL 0xE0
1301 #define RPL_METRIC_LQL_OBJECT_COUNTER 0x1F
1302 #define RPL_METRIC_LC_OBJECT_RES 0xFF
1303 #define RPL_METRIC_LC_OBJECT_LC 0xFFC0
1304 #define RPL_METRIC_LC_OBJECT_COUNTER 0x003F
1305 #define RPL_METRIC_LC_OBJECT_RESERVED 0x003E
1306 #define RPL_METRIC_LC_OBJECT_FLAG_I 0x0001
1308 static const value_string rpl_dio_map_val[] = {
1309 { 0, "No Downward routes maintained by RPL" },
1310 { 1, "Non-Storing Mode of Operation" },
1311 { 2, "Storing Mode of Operation with no multicast support" },
1312 { 3, "Storing Mode of Operation with multicast support" },
1313 { 4, "P2P Route Discovery Mode of Operation" },
1314 { 0, NULL }
1316 static const value_string rpl_code_val[] = {
1317 { ICMP6_RPL_DIS, "DODAG Information Solicitation" },
1318 { ICMP6_RPL_DIO, "DODAG Information Object" },
1319 { ICMP6_RPL_DAO, "Destination Advertisement Object" },
1320 { ICMP6_RPL_DAOACK, "Destination Advertisement Object Acknowledgment" },
1321 { ICMP6_RPL_SDIS, "Secure DODAG Information Solicitation" },
1322 { ICMP6_RPL_SDIO, "Secure DODAG Information Object" },
1323 { ICMP6_RPL_SDAO, "Secure Destination Advertisement Object" },
1324 { ICMP6_RPL_SDAOACK, "Secure Destination Advertisement Object Acknowledgment" },
1325 { ICMP6_RPL_CC, "Consistency Check" },
1326 { ICMP6_RPL_P2P_DRO, "P2P Discovery Reply Object" },
1327 { ICMP6_RPL_P2P_SDRO, "P2P Secure Discovery Reply Object" },
1328 { ICMP6_RPL_P2P_DROACK, "P2P Discovery Reply Object Acknowledgement" },
1329 { ICMP6_RPL_P2P_SDROACK,"P2P Secure Discovery Reply Object Acknowledgement" },
1330 { 0, NULL }
1333 static const value_string rpl_secure_algorithm_vals[] = {
1334 { 0, "Encryption: CCM with AES-128 / Signature: RSA with SHA-256" },
1335 { 0, NULL }
1338 /* RPL Option Types */
1339 /* Pending IANA Assignment */
1340 #define RPL_OPT_PAD1 0 /* 1-byte padding */
1341 #define RPL_OPT_PADN 1 /* n-byte padding */
1342 #define RPL_OPT_METRIC 2 /* DAG metric container */
1343 #define RPL_OPT_ROUTING 3 /* Routing Information */
1344 #define RPL_OPT_CONFIG 4 /* DAG configuration */
1345 #define RPL_OPT_TARGET 5 /* RPL Target */
1346 #define RPL_OPT_TRANSIT 6 /* Transit */
1347 #define RPL_OPT_SOLICITED 7 /* Solicited Information */
1348 #define RPL_OPT_PREFIX 8 /* Destination prefix */
1349 #define RPL_OPT_TARGETDESC 9 /* RPL Target Descriptor */
1350 #define RPL_OPT_ROUTE_DISCOVERY 10 /* P2P Route Discovery */
1352 static const value_string rpl_option_vals[] = {
1353 { RPL_OPT_PAD1, "1-byte padding" },
1354 { RPL_OPT_PADN, "n-byte padding" },
1355 { RPL_OPT_METRIC, "DAG Metric container" },
1356 { RPL_OPT_ROUTING, "Routing Information"},
1357 { RPL_OPT_CONFIG, "DODAG configuration" },
1358 { RPL_OPT_TARGET, "RPL Target" },
1359 { RPL_OPT_TRANSIT, "Transit Information" },
1360 { RPL_OPT_SOLICITED, "Solicited Information"},
1361 { RPL_OPT_PREFIX, "Prefix Information"},
1362 { RPL_OPT_TARGETDESC, "RPL Target Descriptor"},
1363 { RPL_OPT_ROUTE_DISCOVERY, "P2P Route Discovery"},
1364 { 0, NULL }
1367 /* RPL Metric Types */
1368 /* RFC 6551 */
1369 #define RPL_METRIC_NSA 1 /* Node State and Attribute */
1370 #define RPL_METRIC_NE 2 /* Node Energy */
1371 #define RPL_METRIC_HP 3 /* Hop Count */
1372 #define RPL_METRIC_LT 4 /* Link Throughput */
1373 #define RPL_METRIC_LL 5 /* Link Latency */
1374 #define RPL_METRIC_LQL 6 /* Link Quality Level */
1375 #define RPL_METRIC_ETX 7 /* Link ETX */
1376 #define RPL_METRIC_LC 8 /* Link Color */
1378 static const value_string rpl_metric_vals[] = {
1379 { RPL_METRIC_NSA, "Node State and Attribute" },
1380 { RPL_METRIC_NE, "Node Energy" },
1381 { RPL_METRIC_HP, "Hop Count" },
1382 { RPL_METRIC_LT, "Link Throughput" },
1383 { RPL_METRIC_LL, "Link Latency" },
1384 { RPL_METRIC_LQL, "Link Quality Level" },
1385 { RPL_METRIC_ETX, "Link ETX" },
1386 { RPL_METRIC_LC, "Link Color" },
1387 { 0, NULL }
1390 static const value_string rpl_ocp_vals[] = {
1391 { 0, "Objective Function Zero (OF0)" },
1392 { 1, "Minimum Rank with Hysteresis Objective Function (MRHOF)" },
1393 { 0, NULL }
1396 /* RFC 7400 */
1397 #define ND_OPT_6CIO_FLAG_G 0x0001
1398 #define ND_OPT_6CIO_FLAG_UNASSIGNED 0xFFFE
1400 /* RFC 7731 */
1401 #define MPL_SEED_INFO_BM_LEN 0xFC
1402 #define MPL_SEED_INFO_S 0x03
1403 static const value_string mpl_seed_id_lengths[] = {
1404 { 0, "0 bit, not included in MPL Seed Info" },
1405 { 1, "16 bits" },
1406 { 2, "64 bits" },
1407 { 3, "128 bits" },
1408 { 0, NULL}
1410 static const uint8_t mpl_seed_id_code_to_length[] = { 0, 2, 8, 16 }; /* bytes */
1412 #define LIFETIME_INFINITY 0xFFFFFFFF
1414 static const value_string unique_infinity[] = {
1415 { LIFETIME_INFINITY, "Infinity" },
1416 { 0, NULL}
1419 static const value_string dnssl_infinity[] = {
1420 { 0, "DNSSL domain name MUST no longer be used" },
1421 { LIFETIME_INFINITY, "Infinity" },
1422 { 0, NULL}
1425 static const value_string rdnss_infinity[] = {
1426 { 0, "RDNSS address MUST no longer be used" },
1427 { LIFETIME_INFINITY, "Infinity" },
1428 { 0, NULL}
1431 static const value_string ext_echo_req_code_str[] = {
1432 { 0, "No error"},
1433 { 0, NULL}
1436 static const value_string ext_echo_reply_code_str[] = {
1437 { 0, "No error"},
1438 { 1, "Malformed Query"},
1439 { 2, "No Such Interface"},
1440 { 3, "No Such Table Entry"},
1441 { 4, "Multiple Interfaces Satisfy Query"},
1442 { 0, NULL}
1445 static const value_string ext_echo_reply_state_str[] = {
1446 { 0, "Reserved"},
1447 { 1, "Incomplete"},
1448 { 2, "Reachable"},
1449 { 3, "Stale"},
1450 { 4, "Delay"},
1451 { 5, "Probe"},
1452 { 6, "Failed"},
1453 { 0, NULL}
1457 /* RFC 8781 */
1458 #define ND_OPT_PREF64_SL 0xFFF8
1459 #define ND_OPT_PREF64_PLC 0x0007
1461 static const value_string pref64_plc_str[] = {
1462 { 0, "96 bits prefix length"},
1463 { 1, "64 bits prefix length"},
1464 { 2, "56 bits prefix length"},
1465 { 3, "48 bits prefix length"},
1466 { 4, "40 bits prefix length"},
1467 { 5, "32 bits prefix length"},
1468 { 0, NULL}
1471 /* whenever a ICMPv6 packet is seen by the tap listener */
1472 /* Add a new frame into the graph */
1473 static tap_packet_status
1474 icmpv6_seq_analysis_packet( void *ptr, packet_info *pinfo, epan_dissect_t *edt _U_, const void *dummy _U_, tap_flags_t flags _U_)
1476 seq_analysis_info_t *sainfo = (seq_analysis_info_t *) ptr;
1477 seq_analysis_item_t *sai = sequence_analysis_create_sai_with_addresses(pinfo, sainfo);
1479 if (!sai)
1480 return TAP_PACKET_DONT_REDRAW;
1482 sai->frame_number = pinfo->num;
1484 sequence_analysis_use_color_filter(pinfo, sai);
1486 sai->port_src=pinfo->srcport;
1487 sai->port_dst=pinfo->destport;
1489 sequence_analysis_use_col_info_as_label_comment(pinfo, sai);
1491 if (pinfo->ptype == PT_NONE) {
1492 icmp_info_t *p_icmp_info = (icmp_info_t *)p_get_proto_data(wmem_file_scope(), pinfo, proto_icmpv6, 0);
1494 if (p_icmp_info != NULL) {
1495 sai->port_src = 0;
1496 sai->port_dst = p_icmp_info->type * 256 + p_icmp_info->code;
1500 sai->line_style = 1;
1501 sai->conv_num = 0;
1502 sai->display = true;
1504 g_queue_push_tail(sainfo->items, sai);
1506 return TAP_PACKET_REDRAW;
1510 static int
1511 dissect_contained_icmpv6(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
1513 bool save_in_error_pkt;
1514 int offset;
1516 /* Save the current value of the "we're inside an error packet"
1517 flag, and set that flag; subdissectors may treat packets
1518 that are the payload of error packets differently from
1519 "real" packets. */
1520 save_in_error_pkt = pinfo->flags.in_error_pkt;
1521 pinfo->flags.in_error_pkt = true;
1523 /* tiny sanity check */
1524 if ((tvb_get_uint8(tvb, 0) & 0xf0) == 0x60) {
1525 /* The contained packet is an IPv6 datagram; dissect it. */
1526 offset = call_dissector(ipv6_handle, tvb, pinfo, tree);
1527 } else {
1528 offset = call_data_dissector(tvb, pinfo, tree);
1531 /* Restore the "we're inside an error packet" flag. */
1532 pinfo->flags.in_error_pkt = save_in_error_pkt;
1534 return offset;
1538 /* ======================================================================= */
1539 static conversation_t *_find_or_create_conversation(packet_info *pinfo)
1541 conversation_t *conv = NULL;
1543 /* Have we seen this conversation before? */
1544 conv = find_conversation(pinfo->num, &pinfo->src, &pinfo->dst,
1545 conversation_pt_to_conversation_type(pinfo->ptype), 0, 0, 0);
1546 if (conv == NULL) {
1547 /* No, this is a new conversation. */
1548 conv = conversation_new(pinfo->num, &pinfo->src, &pinfo->dst,
1549 conversation_pt_to_conversation_type(pinfo->ptype), 0, 0, 0);
1551 return conv;
1554 /* ======================================================================= */
1556 Note: We are tracking conversations via these keys:
1558 0 1 2 3
1559 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
1560 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
1561 | |G| Checksum |
1562 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
1563 | Identifier | Sequence Number |
1564 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
1565 | VLAN ID |
1566 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
1568 static icmp_transaction_t *transaction_start(packet_info *pinfo, proto_tree *tree, uint32_t *key)
1570 conversation_t *conversation;
1571 icmpv6_conv_info_t *icmpv6_info;
1572 icmp_transaction_t *icmpv6_trans;
1573 wmem_tree_key_t icmpv6_key[3];
1574 proto_item *it;
1576 /* Handle the conversation tracking */
1577 conversation = _find_or_create_conversation(pinfo);
1578 icmpv6_info = (icmpv6_conv_info_t *)conversation_get_proto_data(conversation, proto_icmpv6);
1579 if (icmpv6_info == NULL) {
1580 icmpv6_info = wmem_new(wmem_file_scope(), icmpv6_conv_info_t);
1581 icmpv6_info->unmatched_pdus = wmem_tree_new(wmem_file_scope());
1582 icmpv6_info->matched_pdus = wmem_tree_new(wmem_file_scope());
1583 conversation_add_proto_data(conversation, proto_icmpv6, icmpv6_info);
1586 if (!PINFO_FD_VISITED(pinfo)) {
1588 * This is a new request, create a new transaction structure and map it
1589 * to the unmatched table.
1591 icmpv6_key[0].length = 3;
1592 icmpv6_key[0].key = key;
1593 icmpv6_key[1].length = 0;
1594 icmpv6_key[1].key = NULL;
1596 icmpv6_trans = wmem_new(wmem_file_scope(), icmp_transaction_t);
1597 icmpv6_trans->rqst_frame = pinfo->num;
1598 icmpv6_trans->resp_frame = 0;
1599 icmpv6_trans->rqst_time = pinfo->abs_ts;
1600 nstime_set_zero(&icmpv6_trans->resp_time);
1601 wmem_tree_insert32_array(icmpv6_info->unmatched_pdus, icmpv6_key, (void *)icmpv6_trans);
1602 } else {
1603 /* Already visited this frame */
1604 uint32_t frame_num = pinfo->num;
1606 icmpv6_key[0].length = 3;
1607 icmpv6_key[0].key = key;
1608 icmpv6_key[1].length = 1;
1609 icmpv6_key[1].key = &frame_num;
1610 icmpv6_key[2].length = 0;
1611 icmpv6_key[2].key = NULL;
1613 icmpv6_trans = (icmp_transaction_t *)wmem_tree_lookup32_array(icmpv6_info->matched_pdus, icmpv6_key);
1616 if (icmpv6_trans == NULL) {
1617 if (pinfo->dst.type == AT_IPv6 &&
1618 in6_addr_is_multicast((const ws_in6_addr *)pinfo->dst.data)) {
1619 /* XXX We should support multicast echo requests, but we don't currently */
1620 /* Note the multicast destination and skip transaction tracking */
1621 col_append_str(pinfo->cinfo, COL_INFO, " (multicast)");
1622 } else if (PINFO_FD_VISITED(pinfo)) {
1623 /* No response found - add field and expert info */
1624 it = proto_tree_add_item(tree, hf_icmpv6_no_resp, NULL, 0, 0,
1625 ENC_NA);
1626 proto_item_set_generated(it);
1628 col_append_str(pinfo->cinfo, COL_INFO, " (no response found!)");
1630 /* Expert info. TODO: add to _icmp_transaction_t type and sequence number
1631 so can report here (and in taps) */
1632 expert_add_info_format(pinfo, it, &ei_icmpv6_resp_not_found,
1633 "No response seen to ICMPv6 request in frame %u",
1634 pinfo->num);
1637 return NULL;
1640 /* Print state tracking in the tree */
1641 if (icmpv6_trans->resp_frame) {
1642 if (tree) {
1643 it = proto_tree_add_uint(tree, hf_icmpv6_resp_in, NULL, 0, 0,
1644 icmpv6_trans->resp_frame);
1645 proto_item_set_generated(it);
1647 col_append_frame_number(pinfo, COL_INFO, " (reply in %d)", icmpv6_trans->resp_frame);
1650 return icmpv6_trans;
1652 } /* transaction_start() */
1654 /* ======================================================================= */
1655 static icmp_transaction_t *transaction_end(packet_info *pinfo, proto_tree *tree, uint32_t *key)
1657 conversation_t *conversation;
1658 icmpv6_conv_info_t *icmpv6_info;
1659 icmp_transaction_t *icmpv6_trans;
1660 wmem_tree_key_t icmpv6_key[3];
1661 proto_item *it;
1662 nstime_t ns;
1663 double resp_time;
1665 conversation = find_conversation(pinfo->num, &pinfo->src, &pinfo->dst,
1666 conversation_pt_to_conversation_type(pinfo->ptype), 0, 0, 0);
1667 if (conversation == NULL)
1668 return NULL;
1670 icmpv6_info = (icmpv6_conv_info_t *)conversation_get_proto_data(conversation, proto_icmpv6);
1671 if (icmpv6_info == NULL)
1672 return NULL;
1674 if (!PINFO_FD_VISITED(pinfo)) {
1675 uint32_t frame_num;
1677 icmpv6_key[0].length = 3;
1678 icmpv6_key[0].key = key;
1679 icmpv6_key[1].length = 0;
1680 icmpv6_key[1].key = NULL;
1682 icmpv6_trans = (icmp_transaction_t *)wmem_tree_lookup32_array(icmpv6_info->unmatched_pdus, icmpv6_key);
1683 if (icmpv6_trans == NULL)
1684 return NULL;
1686 /* we have already seen this response, or an identical one */
1687 if (icmpv6_trans->resp_frame != 0)
1688 return NULL;
1690 icmpv6_trans->resp_frame = pinfo->num;
1693 * we found a match. Add entries to the matched table for both
1694 * request and reply frames
1696 icmpv6_key[0].length = 3;
1697 icmpv6_key[0].key = key;
1698 icmpv6_key[1].length = 1;
1699 icmpv6_key[1].key = &frame_num;
1700 icmpv6_key[2].length = 0;
1701 icmpv6_key[2].key = NULL;
1703 frame_num = icmpv6_trans->rqst_frame;
1704 wmem_tree_insert32_array(icmpv6_info->matched_pdus, icmpv6_key, (void *)icmpv6_trans);
1706 frame_num = icmpv6_trans->resp_frame;
1707 wmem_tree_insert32_array(icmpv6_info->matched_pdus, icmpv6_key, (void *)icmpv6_trans);
1708 } else {
1709 /* Already visited this frame */
1710 uint32_t frame_num = pinfo->num;
1712 icmpv6_key[0].length = 3;
1713 icmpv6_key[0].key = key;
1714 icmpv6_key[1].length = 1;
1715 icmpv6_key[1].key = &frame_num;
1716 icmpv6_key[2].length = 0;
1717 icmpv6_key[2].key = NULL;
1719 icmpv6_trans = (icmp_transaction_t *)wmem_tree_lookup32_array(icmpv6_info->matched_pdus, icmpv6_key);
1720 if (icmpv6_trans == NULL)
1721 return NULL;
1724 /* Print state tracking in the tree */
1725 if (tree) {
1726 it = proto_tree_add_uint(tree, hf_icmpv6_resp_to, NULL, 0, 0,
1727 icmpv6_trans->rqst_frame);
1728 proto_item_set_generated(it);
1731 nstime_delta(&ns, &pinfo->abs_ts, &icmpv6_trans->rqst_time);
1732 icmpv6_trans->resp_time = ns;
1733 if (tree) {
1734 resp_time = nstime_to_msec(&ns);
1735 it = proto_tree_add_double_format_value(tree, hf_icmpv6_resptime, NULL,
1736 0, 0, resp_time, "%.3f ms", resp_time);
1737 proto_item_set_generated(it);
1740 col_append_frame_number(pinfo, COL_INFO, " (request in %d)",
1741 icmpv6_trans->rqst_frame);
1743 return icmpv6_trans;
1745 } /* transaction_end() */
1747 // This is recursive, but we'll run out of PDU before we'll run out of stack.
1748 // NOLINTNEXTLINE(misc-no-recursion)
1749 static int dissect_icmpv6_nd_opt(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree)
1751 proto_tree *icmp6opt_tree;
1752 proto_item *ti, *ti_opt, *ti_opt_len;
1753 uint8_t opt_type;
1754 int opt_len;
1755 int opt_offset;
1756 tvbuff_t *opt_tvb;
1757 unsigned used_bytes;
1759 while ((int)tvb_reported_length(tvb) > offset) {
1760 /* there are more options */
1762 /* ICMPv6 Option */
1763 opt_len = tvb_get_uint8(tvb, offset + 1) * 8;
1764 ti = proto_tree_add_item(tree, hf_icmpv6_opt, tvb, offset, opt_len, ENC_NA);
1765 icmp6opt_tree = proto_item_add_subtree(ti, ett_icmpv6_opt);
1766 opt_offset = offset;
1768 /* Option type */
1769 proto_tree_add_item(icmp6opt_tree, hf_icmpv6_opt_type, tvb, opt_offset, 1, ENC_BIG_ENDIAN);
1770 opt_type = tvb_get_uint8(tvb, opt_offset);
1771 opt_offset += 1;
1773 /* Add option name to option root label */
1774 proto_item_append_text(ti, " (%s", val_to_str(opt_type, option_vals, "Unknown %d"));
1776 /* Option length */
1777 ti_opt_len = proto_tree_add_item(icmp6opt_tree, hf_icmpv6_opt_length, tvb,opt_offset, 1, ENC_BIG_ENDIAN);
1778 opt_offset += 1;
1780 /* Add length value in bytes */
1781 proto_item_append_text(ti_opt_len, " (%i bytes)", opt_len);
1783 if(opt_len == 0){
1784 expert_add_info_format(pinfo, ti_opt_len, &ei_icmpv6_invalid_option_length, "Invalid option length (Zero)");
1785 return opt_offset;
1788 /* decode... */
1789 switch (opt_type) {
1790 case ND_OPT_SOURCE_LINKADDR: /* Source Link-layer Address (1) */
1792 const char *link_str;
1793 /* if the opt len is 8, the Link Addr is MAC Address */
1794 if(opt_len == 8){
1795 proto_tree_add_item(icmp6opt_tree, hf_icmpv6_opt_linkaddr_mac, tvb, opt_offset, 6, ENC_NA);
1796 ti_opt = proto_tree_add_item(icmp6opt_tree, hf_icmpv6_opt_src_linkaddr_mac, tvb, opt_offset, 6, ENC_NA);
1797 proto_item_set_hidden(ti_opt);
1799 link_str = tvb_ether_to_str(pinfo->pool, tvb, opt_offset);
1800 col_append_fstr(pinfo->cinfo, COL_INFO, " from %s", link_str);
1801 proto_item_append_text(ti, " : %s", link_str);
1802 /* if the opt len is 16 and the 6 last bytes is 0n the Link Addr is EUI64 Address */
1803 }else if(opt_len == 16 && tvb_get_ntohl(tvb, opt_offset + 8) == 0 && tvb_get_ntohs(tvb, opt_offset + 12) == 0){
1804 proto_tree_add_item(icmp6opt_tree, hf_icmpv6_opt_linkaddr_eui64, tvb, opt_offset, 8, ENC_BIG_ENDIAN);
1805 ti_opt = proto_tree_add_item(icmp6opt_tree, hf_icmpv6_opt_src_linkaddr_eui64, tvb, opt_offset, 8, ENC_BIG_ENDIAN);
1806 proto_item_set_hidden(ti_opt);
1807 ti_opt = proto_tree_add_item(icmp6opt_tree, hf_icmpv6_opt_linkaddr, tvb, opt_offset, 8, ENC_NA);
1808 proto_item_set_hidden(ti_opt);
1809 ti_opt = proto_tree_add_item(icmp6opt_tree, hf_icmpv6_opt_src_linkaddr, tvb, opt_offset, 8, ENC_NA);
1810 proto_item_set_hidden(ti_opt);
1812 /* Padding: 6 bytes */
1813 proto_tree_add_item(icmp6opt_tree, hf_icmpv6_opt_padding, tvb, opt_offset + 8, 6, ENC_NA);
1815 link_str = tvb_eui64_to_str(pinfo->pool, tvb, opt_offset);
1816 col_append_fstr(pinfo->cinfo, COL_INFO, " from %s", link_str);
1817 proto_item_append_text(ti, " : %s", link_str);
1818 }else{
1819 proto_tree_add_item(icmp6opt_tree, hf_icmpv6_opt_linkaddr, tvb, opt_offset, opt_len-2, ENC_NA);
1820 ti_opt = proto_tree_add_item(icmp6opt_tree, hf_icmpv6_opt_src_linkaddr, tvb, opt_offset, opt_len-2, ENC_NA);
1821 proto_item_set_hidden(ti_opt);
1823 opt_offset += opt_len;
1825 break;
1827 case ND_OPT_TARGET_LINKADDR: /* Target Link-layer Address (2) */
1829 const char *link_str;
1830 /* if the opt len is 8, the Link Addr is MAC Address */
1831 if(opt_len == 8){
1832 proto_tree_add_item(icmp6opt_tree, hf_icmpv6_opt_linkaddr_mac, tvb, opt_offset, 6, ENC_NA);
1833 ti_opt = proto_tree_add_item(icmp6opt_tree, hf_icmpv6_opt_target_linkaddr_mac, tvb, opt_offset, 6, ENC_NA);
1834 proto_item_set_hidden(ti_opt);
1836 link_str = tvb_ether_to_str(pinfo->pool, tvb, opt_offset);
1837 col_append_fstr(pinfo->cinfo, COL_INFO, " is at %s", link_str);
1838 proto_item_append_text(ti, " : %s", link_str);
1840 /* if the opt len is 16 and the 6 last bytes is 0n the Link Addr is EUI64 Address */
1841 }else if(opt_len == 16 && tvb_get_ntohl(tvb, opt_offset + 8) == 0 && tvb_get_ntohs(tvb, opt_offset + 12) == 0){
1842 proto_tree_add_item(icmp6opt_tree, hf_icmpv6_opt_linkaddr_eui64, tvb, opt_offset, 8, ENC_BIG_ENDIAN);
1843 ti_opt = proto_tree_add_item(icmp6opt_tree, hf_icmpv6_opt_target_linkaddr_eui64, tvb, opt_offset, 8, ENC_BIG_ENDIAN);
1844 proto_item_set_hidden(ti_opt);
1846 /* Padding: 6 bytes */
1847 proto_tree_add_item(icmp6opt_tree, hf_icmpv6_opt_padding, tvb, opt_offset + 8, 6, ENC_NA);
1849 link_str = tvb_eui64_to_str(pinfo->pool, tvb, opt_offset);
1850 col_append_fstr(pinfo->cinfo, COL_INFO, " from %s", link_str);
1851 proto_item_append_text(ti, " : %s", link_str);
1852 }else{
1853 proto_tree_add_item(icmp6opt_tree, hf_icmpv6_opt_linkaddr, tvb, opt_offset, opt_len-2, ENC_NA);
1854 ti_opt = proto_tree_add_item(icmp6opt_tree, hf_icmpv6_opt_target_linkaddr, tvb, opt_offset, opt_len-2, ENC_NA);
1855 proto_item_set_hidden(ti_opt);
1857 opt_offset += opt_len;
1858 break;
1860 case ND_OPT_PREFIX_INFORMATION: /* Prefix Information (3) */
1862 static int * const prefix_flag[] = {
1863 &hf_icmpv6_opt_prefix_flag_l,
1864 &hf_icmpv6_opt_prefix_flag_a,
1865 &hf_icmpv6_opt_prefix_flag_r,
1866 &hf_icmpv6_opt_prefix_flag_p,
1867 &hf_icmpv6_opt_prefix_flag_reserved,
1868 NULL
1871 uint32_t lifetime;
1872 uint8_t prefix_len;
1873 /* RFC 4861 */
1875 /* Prefix Length */
1876 proto_tree_add_item(icmp6opt_tree, hf_icmpv6_opt_prefix_len, tvb, opt_offset, 1, ENC_BIG_ENDIAN);
1877 prefix_len = tvb_get_uint8(tvb, opt_offset);
1878 opt_offset += 1;
1880 /* Flags */
1881 proto_tree_add_bitmask(icmp6opt_tree, tvb, opt_offset, hf_icmpv6_opt_prefix_flag, ett_icmpv6_flag_prefix, prefix_flag, ENC_BIG_ENDIAN);
1882 opt_offset += 1;
1884 /* Prefix Valid Lifetime */
1885 ti_opt = proto_tree_add_item_ret_uint(icmp6opt_tree, hf_icmpv6_opt_prefix_valid_lifetime, tvb, opt_offset, 4, ENC_BIG_ENDIAN, &lifetime);
1886 if (lifetime != LIFETIME_INFINITY) {
1887 proto_item_append_text(ti_opt, " (%s)", unsigned_time_secs_to_str(pinfo->pool, lifetime));
1889 opt_offset += 4;
1891 /* Prefix Preferred Lifetime */
1892 ti_opt = proto_tree_add_item_ret_uint(icmp6opt_tree, hf_icmpv6_opt_prefix_preferred_lifetime, tvb, opt_offset, 4, ENC_BIG_ENDIAN, &lifetime);
1893 if (lifetime != LIFETIME_INFINITY) {
1894 proto_item_append_text(ti_opt, " (%s)", unsigned_time_secs_to_str(pinfo->pool, lifetime));
1896 opt_offset += 4;
1898 proto_tree_add_item(icmp6opt_tree, hf_icmpv6_opt_reserved, tvb, opt_offset, 4, ENC_NA);
1899 opt_offset += 4;
1901 /* Prefix */
1902 proto_tree_add_item(icmp6opt_tree, hf_icmpv6_opt_prefix, tvb, opt_offset, 16, ENC_NA);
1903 proto_item_append_text(ti, " : %s/%d", tvb_ip6_to_str(pinfo->pool, tvb, opt_offset), prefix_len);
1904 opt_offset += 16;
1906 break;
1908 case ND_OPT_REDIRECTED_HEADER: /* Redirected Header (4) */
1910 proto_tree_add_item(icmp6opt_tree, hf_icmpv6_opt_reserved, tvb, opt_offset, 6, ENC_NA);
1911 opt_offset += 6;
1913 if (opt_len > 8) {
1914 proto_tree_add_item(icmp6opt_tree, hf_icmpv6_opt_redirected_packet, tvb, opt_offset, opt_len - 8, ENC_NA);
1915 opt_tvb = tvb_new_subset_length(tvb, opt_offset, opt_len - 8);
1916 opt_offset += dissect_contained_icmpv6(opt_tvb, pinfo, icmp6opt_tree);
1918 break;
1919 case ND_OPT_MTU: /* MTU (5) */
1921 proto_tree_add_item(icmp6opt_tree, hf_icmpv6_opt_reserved, tvb, opt_offset, 2, ENC_NA);
1922 opt_offset += 2;
1924 proto_tree_add_item(icmp6opt_tree, hf_icmpv6_opt_mtu, tvb, opt_offset, 4, ENC_BIG_ENDIAN);
1925 proto_item_append_text(ti, " : %d", tvb_get_ntohl(tvb, opt_offset));
1926 opt_offset += 4;
1927 break;
1928 case ND_OPT_NBMA: /* NBMA Shortcut Limit Option (6) */
1930 proto_tree_add_item(icmp6opt_tree, hf_icmpv6_opt_nbma_shortcut_limit, tvb, opt_offset, 1, ENC_BIG_ENDIAN);
1931 proto_item_append_text(ti, " : %d", tvb_get_uint8(tvb, opt_offset));
1933 proto_tree_add_item(icmp6opt_tree, hf_icmpv6_opt_reserved, tvb, opt_offset, 1, ENC_NA);
1934 opt_offset += 1;
1936 proto_tree_add_item(icmp6opt_tree, hf_icmpv6_opt_reserved, tvb, opt_offset, 4, ENC_NA);
1937 opt_offset += 4;
1939 break;
1940 case ND_OPT_ADVINTERVAL: /* Advertisement Interval Option (7) */
1942 proto_tree_add_item(icmp6opt_tree, hf_icmpv6_opt_reserved, tvb, opt_offset, 2, ENC_NA);
1943 opt_offset += 2;
1945 proto_tree_add_item(icmp6opt_tree, hf_icmpv6_opt_advertisement_interval, tvb, opt_offset, 4, ENC_BIG_ENDIAN);
1946 proto_item_append_text(ti, " : %d", tvb_get_ntohl(tvb, opt_offset));
1947 opt_offset += 4;
1949 break;
1950 case ND_OPT_HOMEAGENT_INFO: /* Home Agent Information Option (8) */
1953 proto_tree_add_item(icmp6opt_tree, hf_icmpv6_opt_reserved, tvb, opt_offset, 2, ENC_NA);
1954 opt_offset += 2;
1956 proto_tree_add_item(icmp6opt_tree, hf_icmpv6_opt_home_agent_preference, tvb, opt_offset, 2, ENC_BIG_ENDIAN);
1957 opt_offset += 2;
1959 proto_tree_add_item(icmp6opt_tree, hf_icmpv6_opt_home_agent_lifetime, tvb, opt_offset, 2, ENC_BIG_ENDIAN);
1960 opt_offset += 2;
1961 break;
1963 case ND_OPT_SOURCE_ADDRLIST: /* Source Address List (9) */
1964 case ND_OPT_TARGET_ADDRLIST: /* Target Address List (10)*/
1966 proto_tree_add_item(icmp6opt_tree, hf_icmpv6_opt_reserved, tvb, opt_offset, 6, ENC_NA);
1967 opt_offset += 6;
1969 while(opt_offset < (offset + opt_len) ) {
1970 proto_tree_add_item(icmp6opt_tree, hf_icmpv6_opt_ipv6_address, tvb, opt_offset, 16, ENC_NA);
1971 proto_item_append_text(ti, " %s", tvb_ip6_to_str(pinfo->pool, tvb, opt_offset));
1972 opt_offset += 16;
1974 break;
1976 case ND_OPT_CGA: /* CGA Option (11) */
1978 proto_tree *cga_tree;
1979 proto_item *cga_item;
1980 uint16_t ext_data_len;
1981 uint8_t padd_length;
1982 int par_len;
1983 asn1_ctx_t asn1_ctx;
1985 /* Pad Length */
1986 proto_tree_add_item(icmp6opt_tree, hf_icmpv6_opt_cga_pad_len, tvb, opt_offset, 1, ENC_BIG_ENDIAN);
1987 padd_length = tvb_get_uint8(tvb, opt_offset);
1988 opt_offset += 1;
1990 /* Reserved 8 bits */
1992 proto_tree_add_item(icmp6opt_tree, hf_icmpv6_opt_reserved, tvb, opt_offset, 1, ENC_NA);
1993 opt_offset += 1;
1995 /* CGA Parameters A variable-length field containing the CGA Parameters data
1996 * structure described in Section 4 of
1997 * "Cryptographically Generated Addresses (CGA)", RFC3972.
1999 par_len = opt_len -4 -padd_length;
2000 cga_item = proto_tree_add_item(icmp6opt_tree, hf_icmpv6_opt_cga, tvb, opt_offset, par_len, ENC_NA);
2001 par_len += opt_offset;
2003 cga_tree = proto_item_add_subtree(cga_item, ett_icmpv6_cga_param_name);
2004 proto_tree_add_item(cga_tree, hf_icmpv6_opt_cga_modifier, tvb, opt_offset, 16, ENC_NA);
2005 opt_offset += 16;
2007 proto_tree_add_item(cga_tree, hf_icmpv6_opt_cga_subnet_prefix, tvb, opt_offset, 8, ENC_NA);
2008 opt_offset += 8;
2010 proto_tree_add_item(cga_tree, hf_icmpv6_opt_cga_count, tvb, opt_offset, 1, ENC_NA);
2011 opt_offset += 1;
2013 asn1_ctx_init(&asn1_ctx, ASN1_ENC_BER, true, pinfo);
2014 opt_offset = dissect_x509af_SubjectPublicKeyInfo(false, tvb, opt_offset, &asn1_ctx, cga_tree, hf_icmpv6_opt_cga_subject_public_key_info);
2016 /* Process RFC 4581*/
2017 while (opt_offset < par_len) {
2018 proto_tree_add_item(cga_tree, hf_icmpv6_opt_cga_ext_type, tvb, opt_offset, 2, ENC_BIG_ENDIAN);
2019 opt_offset += 2;
2021 ext_data_len = tvb_get_ntohs(tvb, opt_offset);
2022 proto_tree_add_item(cga_tree, hf_icmpv6_opt_cga_ext_length, tvb, opt_offset, 2, ENC_BIG_ENDIAN);
2023 opt_offset += 2;
2025 proto_tree_add_item(cga_tree, hf_icmpv6_opt_cga_ext_data, tvb, opt_offset, ext_data_len, ENC_NA);
2026 opt_offset += ext_data_len;
2029 /* Padding */
2030 proto_tree_add_item(icmp6opt_tree, hf_icmpv6_opt_padding, tvb, opt_offset, padd_length, ENC_NA);
2031 opt_offset += padd_length;
2032 break;
2034 case ND_OPT_RSA: /* RSA Signature Option (12) */
2036 int par_len;
2037 /*5.2. RSA Signature Option */
2038 /* Reserved, A 16-bit field reserved for future use. */
2039 proto_tree_add_item(icmp6opt_tree, hf_icmpv6_opt_reserved, tvb, opt_offset, 2, ENC_NA);
2040 opt_offset = opt_offset + 2;
2042 /* Key Hash
2043 * A 128-bit field containing the most significant (leftmost) 128
2044 * bits of a SHA-1 [14] hash of the public key used for constructing
2045 * the signature.
2047 proto_tree_add_item(icmp6opt_tree, hf_icmpv6_opt_rsa_key_hash, tvb, opt_offset, 16, ENC_NA);
2048 opt_offset = opt_offset + 16;
2050 /* Digital Signature */
2051 par_len = opt_len - 20;
2052 proto_tree_add_item(icmp6opt_tree, hf_icmpv6_opt_digital_signature_padding , tvb, opt_offset, par_len, ENC_NA);
2053 opt_offset += par_len;
2055 /* Padding */
2056 /* TODO: Calculate padding length and exclude from the signature */
2057 break;
2059 case ND_OPT_TIMESTAMP: /* Timestamp Option (13) */
2060 /* Reserved A 48-bit field reserved for future use. */
2061 proto_tree_add_item(icmp6opt_tree, hf_icmpv6_opt_reserved, tvb, opt_offset, 6, ENC_NA);
2062 opt_offset += 6;
2064 /* Timestamp
2065 * A 64-bit unsigned integer field containing a timestamp. The value
2066 * indicates the number of seconds since January 1, 1970, 00:00 UTC,
2067 * by using a fixed point format. In this format, the integer number
2068 * of seconds is contained in the first 48 bits of the field, and the
2069 * remaining 16 bits indicate the number of 1/64K fractions of a
2070 * second.
2072 proto_tree_add_item(icmp6opt_tree, hf_icmpv6_opt_timestamp, tvb, opt_offset, 8, ENC_TIME_RFC_3971|ENC_BIG_ENDIAN);
2073 opt_offset += 8;
2074 break;
2075 case ND_OPT_NONCE: /* Nonce option (14) */
2077 /* 5.3.2. Nonce Option */
2078 proto_tree_add_item(icmp6opt_tree, hf_icmpv6_opt_nonce, tvb, opt_offset, opt_len - 2, ENC_NA);
2079 opt_offset += opt_len -2;
2080 break;
2081 case ND_OPT_TRUST_ANCHOR: /* Trust Anchor Option (15) */
2083 proto_tree *name_tree;
2084 proto_item *name_item;
2085 uint8_t name_type;
2086 uint8_t padd_length;
2087 int par_len;
2088 asn1_ctx_t asn1_ctx;
2090 /* Name Type */
2091 name_type = tvb_get_uint8(tvb, opt_offset);
2092 proto_tree_add_item(icmp6opt_tree, hf_icmpv6_opt_name_type, tvb, opt_offset, 1, ENC_BIG_ENDIAN);
2093 opt_offset += 1;
2095 /* Pad Length */
2096 padd_length = tvb_get_uint8(tvb, opt_offset);
2097 proto_tree_add_item(icmp6opt_tree, hf_icmpv6_opt_cga_pad_len, tvb, opt_offset, 1, ENC_BIG_ENDIAN);
2098 opt_offset += 1;
2100 par_len = opt_len - 4 - padd_length;
2102 switch (name_type){
2103 case 1:
2104 /* DER Encoded X.501 Name */
2105 name_item = proto_tree_add_item(icmp6opt_tree, hf_icmpv6_opt_name_x501, tvb, opt_offset, par_len, ENC_NA);
2106 name_tree = proto_item_add_subtree(name_item, ett_icmpv6_opt_name);
2107 asn1_ctx_init(&asn1_ctx, ASN1_ENC_BER, true, pinfo);
2108 dissect_x509if_Name(false, tvb, opt_offset, &asn1_ctx, name_tree, hf_icmpv6_x509if_Name);
2109 break;
2110 case 2:
2111 /* FQDN */
2112 proto_tree_add_item(icmp6opt_tree, hf_icmpv6_opt_name_fqdn, tvb, opt_offset, par_len, ENC_ASCII);
2113 break;
2114 default:
2115 break;
2117 opt_offset += par_len;
2119 /* Padding */
2120 proto_tree_add_item(icmp6opt_tree, hf_icmpv6_opt_padding, tvb, opt_offset, padd_length, ENC_NA);
2121 opt_offset += padd_length;
2123 break;
2125 case ND_OPT_CERTIFICATE: /* Certificate Option (16) */
2127 uint8_t cert_type;
2128 uint8_t padd_length;
2129 asn1_ctx_t asn1_ctx;
2131 /* Cert Type */
2132 cert_type = tvb_get_uint8(tvb, opt_offset);
2133 proto_tree_add_item(icmp6opt_tree, hf_icmpv6_opt_cert_type, tvb, opt_offset, 1, ENC_BIG_ENDIAN);
2134 opt_offset += 1;
2136 /* Reserved */
2137 proto_tree_add_item(icmp6opt_tree, hf_icmpv6_opt_reserved, tvb, opt_offset, 1, ENC_NA);
2138 opt_offset += 1;
2140 /* Certificate */
2142 if(cert_type == 1){
2143 asn1_ctx_init(&asn1_ctx, ASN1_ENC_BER, true, pinfo);
2144 opt_offset = dissect_x509af_Certificate(false, tvb, opt_offset, &asn1_ctx, icmp6opt_tree, hf_icmpv6_x509af_Certificate);
2145 padd_length = opt_len - (opt_offset - offset);
2146 /* Padding */
2147 proto_tree_add_item(icmp6opt_tree, hf_icmpv6_opt_padding, tvb, opt_offset, padd_length, ENC_NA);
2148 opt_offset += padd_length;
2149 }else{
2150 padd_length = opt_len - 4;
2151 proto_tree_add_item(icmp6opt_tree, hf_icmpv6_opt_certificate_padding, tvb, opt_offset, padd_length, ENC_NA);
2152 opt_offset += padd_length;
2154 break;
2157 case ND_OPT_IP_ADDRESS_PREFIX: /* IP Address/Prefix Option (17) */
2159 uint8_t prefix_len;
2161 /* Option-code */
2162 proto_tree_add_item(icmp6opt_tree, hf_icmpv6_opt_ipa_option_code, tvb, opt_offset, 1, ENC_BIG_ENDIAN);
2163 opt_offset += 1;
2165 /* Prefix Len */
2166 proto_tree_add_item(icmp6opt_tree, hf_icmpv6_opt_ipa_prefix_len, tvb, opt_offset, 1, ENC_BIG_ENDIAN);
2167 prefix_len = tvb_get_uint8(tvb, opt_offset);
2168 opt_offset += 1;
2170 proto_tree_add_item(icmp6opt_tree, hf_icmpv6_opt_reserved, tvb, opt_offset, 4, ENC_NA);
2171 opt_offset += 4;
2173 /* IPv6 Address */
2174 proto_tree_add_item(icmp6opt_tree, hf_icmpv6_opt_ipa_ipv6_address, tvb, opt_offset, 16, ENC_NA);
2175 proto_item_append_text(ti, " %s/%d", tvb_ip6_to_str(pinfo->pool, tvb, opt_offset), prefix_len);
2176 opt_offset += 16;
2178 break;
2180 case ND_OPT_NEW_ROUTER_PREFIX_INFO: /* New Router Prefix Information Option (18) OBSO... */
2183 uint8_t prefix_len;
2185 /* Option-code */
2186 proto_tree_add_item(icmp6opt_tree, hf_icmpv6_opt_nrpi_option_code, tvb, opt_offset, 1, ENC_BIG_ENDIAN);
2187 opt_offset += 1;
2189 /* Prefix Len */
2190 proto_tree_add_item(icmp6opt_tree, hf_icmpv6_opt_nrpi_prefix_len, tvb, opt_offset, 1, ENC_BIG_ENDIAN);
2191 prefix_len = tvb_get_uint8(tvb, opt_offset);
2192 opt_offset += 1;
2194 proto_tree_add_item(icmp6opt_tree, hf_icmpv6_opt_reserved, tvb, opt_offset, 4, ENC_NA);
2195 opt_offset += 4;
2197 /* Prefix */
2198 proto_tree_add_item(icmp6opt_tree, hf_icmpv6_opt_nrpi_prefix, tvb, opt_offset, 16, ENC_NA);
2199 proto_item_append_text(ti, " %s/%d", tvb_ip6_to_str(pinfo->pool, tvb, opt_offset), prefix_len);
2200 opt_offset += 16;
2202 break;
2204 case ND_OPT_LINK_LAYER_ADDRESS: /* Link-layer Address Option (19) */
2206 /* Option-Code */
2207 proto_tree_add_item(icmp6opt_tree, hf_icmpv6_opt_lla_option_code, tvb, opt_offset, 1, ENC_BIG_ENDIAN);
2208 opt_offset += 1;
2210 /* Link Layer Address */
2211 proto_tree_add_item(icmp6opt_tree, hf_icmpv6_opt_lla_bytes, tvb, opt_offset, opt_len-3, ENC_NA);
2212 opt_offset += opt_len - 3;
2213 break;
2216 case ND_OPT_NEIGHBOR_ADV_ACK: /* Neighbor Advertisement Acknowledgment Option (20) */
2218 uint8_t status;
2220 /* Option-Code */
2221 proto_tree_add_item(icmp6opt_tree, hf_icmpv6_opt_naack_option_code, tvb, opt_offset, 1, ENC_BIG_ENDIAN);
2222 opt_offset += 1;
2224 /* Status */
2225 proto_tree_add_item(icmp6opt_tree, hf_icmpv6_opt_naack_status, tvb, opt_offset, 1, ENC_BIG_ENDIAN);
2226 status = tvb_get_uint8(tvb, opt_offset);
2227 opt_offset += 1;
2229 if(status == 2){
2230 proto_tree_add_item(icmp6opt_tree, hf_icmpv6_opt_naack_supplied_ncoa, tvb, opt_offset, 16, ENC_NA);
2231 opt_offset += 16;
2232 }else{
2233 proto_tree_add_item(icmp6opt_tree, hf_icmpv6_opt_reserved, tvb, opt_offset, opt_len - 4, ENC_NA);
2234 opt_offset += opt_len - 4;
2236 break;
2238 case ND_OPT_PVD_ID: /* PvD ID (21) */
2240 int dns_len;
2241 const char *dns_name, *name_out;
2242 uint64_t flags;
2244 static int * const pvd_id_flags[] = {
2245 &hf_icmpv6_opt_pvd_id_flags_h,
2246 &hf_icmpv6_opt_pvd_id_flags_l,
2247 &hf_icmpv6_opt_pvd_id_flags_r,
2248 &hf_icmpv6_opt_pvd_id_flags_reserved,
2249 NULL
2252 /* Flags */
2253 proto_tree_add_bitmask_with_flags_ret_uint64(icmp6opt_tree, tvb, opt_offset, hf_icmpv6_opt_pvd_id_flags,
2254 ett_icmpv6_flag_pvd_id, pvd_id_flags, ENC_BIG_ENDIAN, BMT_NO_FALSE | BMT_NO_INT, &flags);
2256 /* Delay */
2257 proto_tree_add_item(icmp6opt_tree, hf_icmpv6_opt_pvd_id_delay, tvb, opt_offset, 2, ENC_BIG_ENDIAN);
2258 opt_offset += 2;
2260 /* Sequence Number */
2261 proto_tree_add_item(icmp6opt_tree, hf_icmpv6_opt_pvd_id_sequence_number, tvb, opt_offset, 2, ENC_BIG_ENDIAN);
2262 opt_offset += 2;
2264 /* PvD ID FQDN */
2265 used_bytes = get_dns_name(tvb, opt_offset, 0, opt_offset, &dns_name, &dns_len);
2266 name_out = format_text(pinfo->pool, dns_name, dns_len);
2267 proto_tree_add_string(icmp6opt_tree, hf_icmpv6_opt_pvd_id_fqdn, tvb, opt_offset, used_bytes, name_out);
2268 proto_item_append_text(ti, " : %s", name_out);
2269 opt_offset += used_bytes;
2271 /* Padding */
2272 if (opt_offset & 0x07) {
2273 proto_tree_add_item(icmp6opt_tree, hf_icmpv6_opt_padding, tvb, opt_offset, 8 - (opt_offset & 0x07), ENC_NA);
2274 opt_offset += 8 - (opt_offset & 0x07);
2278 * When the R-flag is set, a full Router Advertisement message header as specified in [RFC4861].
2279 * The sender MUST set the Type field to 134 (the value for "Router Advertisement") and set the Code field to 0.
2280 * Receivers MUST ignore both of these fields. The Checksum field MUST be set to 0 by the sender;
2281 * non-zero checksums MUST be ignored by the receiver without causing the processing of the message to fail.
2282 * All other fields are to be set and parsed as specified in [RFC4861] or any updating documents.
2284 if(flags & 0x200) {
2285 tvbuff_t *ra_tvb;
2286 ra_tvb = tvb_new_subset_length(tvb, opt_offset, 16);
2287 call_dissector(icmpv6_handle, ra_tvb, pinfo, icmp6opt_tree);
2288 opt_offset += 16;
2291 /* Options */
2292 opt_offset = dissect_icmpv6_nd_opt(tvb, opt_offset, pinfo, icmp6opt_tree);
2294 break;
2296 case ND_OPT_MAP: /* MAP Option (23) */
2298 static int * const map_flags[] = {
2299 &hf_icmpv6_opt_map_flag_r,
2300 &hf_icmpv6_opt_map_flag_reserved,
2301 NULL
2304 uint32_t lifetime;
2306 /* Dist */
2307 proto_tree_add_item(icmp6opt_tree, hf_icmpv6_opt_map_dist, tvb, opt_offset, 1, ENC_BIG_ENDIAN);
2309 /* Pref */
2310 proto_tree_add_item(icmp6opt_tree, hf_icmpv6_opt_map_pref, tvb, opt_offset, 1, ENC_BIG_ENDIAN);
2311 opt_offset += 1;
2313 /* Flags */
2314 proto_tree_add_bitmask(icmp6opt_tree, tvb, opt_offset, hf_icmpv6_opt_map_flag, ett_icmpv6_flag_map, map_flags, ENC_BIG_ENDIAN);
2315 opt_offset += 1;
2317 /* Valid Lifetime */
2318 ti_opt = proto_tree_add_item_ret_uint(icmp6opt_tree, hf_icmpv6_opt_map_valid_lifetime, tvb, opt_offset, 4, ENC_BIG_ENDIAN, &lifetime);
2319 proto_item_append_text(ti_opt, " (%s)", unsigned_time_secs_to_str(pinfo->pool, lifetime));
2320 opt_offset += 4;
2322 /* Global Address */
2323 proto_tree_add_item(icmp6opt_tree, hf_icmpv6_opt_map_global_address, tvb, opt_offset, 16, ENC_NA);
2324 opt_offset += 16;
2325 break;
2327 case ND_OPT_ROUTE_INFO: /* Route Information Option (24) */
2329 /* RFC 4191 */
2330 uint8_t prefix_len;
2331 uint8_t route_preference;
2332 uint32_t lifetime;
2333 ws_in6_addr prefix;
2334 address prefix_addr;
2335 static int * const route_flags[] = {
2336 &hf_icmpv6_opt_route_info_flag_route_preference,
2337 &hf_icmpv6_opt_route_info_flag_reserved,
2338 NULL
2341 /* Prefix Len */
2342 proto_tree_add_item(icmp6opt_tree, hf_icmpv6_opt_prefix_len, tvb, opt_offset, 1, ENC_BIG_ENDIAN);
2343 prefix_len = tvb_get_uint8(tvb, opt_offset);
2344 opt_offset += 1;
2346 /* Flags */
2347 proto_tree_add_bitmask(icmp6opt_tree, tvb, opt_offset, hf_icmpv6_opt_route_info_flag, ett_icmpv6_flag_route_info, route_flags, ENC_BIG_ENDIAN);
2349 route_preference = tvb_get_uint8(tvb, opt_offset);
2350 route_preference = (route_preference & ND_RA_FLAG_RTPREF_MASK) >> 3;
2351 proto_item_append_text(ti, " : %s", val_to_str(route_preference, nd_flag_router_pref, "Unknown %d") );
2352 opt_offset += 1;
2354 /* Route Lifetime */
2355 ti_opt = proto_tree_add_item_ret_uint(icmp6opt_tree, hf_icmpv6_opt_route_lifetime, tvb, opt_offset, 4, ENC_BIG_ENDIAN, &lifetime);
2356 if (lifetime != LIFETIME_INFINITY) {
2357 proto_item_append_text(ti_opt, " (%s)", unsigned_time_secs_to_str(pinfo->pool, lifetime));
2359 opt_offset += 4;
2361 /* Prefix */
2362 switch(opt_len){
2363 case 8: /* Default Option Length without prefix */
2364 proto_item_append_text(ti, " ::/%d", prefix_len);
2365 break;
2366 case 16:
2367 memset(&prefix, 0, sizeof(prefix));
2368 tvb_memcpy(tvb, (uint8_t *)&prefix.bytes, opt_offset, 8);
2369 proto_tree_add_ipv6(icmp6opt_tree, hf_icmpv6_opt_prefix, tvb, opt_offset, 8, &prefix);
2370 set_address(&prefix_addr, AT_IPv6, 16, prefix.bytes);
2371 proto_item_append_text(ti, " %s/%d", address_to_str(pinfo->pool, &prefix_addr), prefix_len);
2372 opt_offset += 8;
2373 break;
2374 case 24:
2375 proto_tree_add_item(icmp6opt_tree, hf_icmpv6_opt_prefix, tvb, opt_offset, 16, ENC_NA);
2376 proto_item_append_text(ti, " %s/%d", tvb_ip6_to_str(pinfo->pool, tvb, opt_offset), prefix_len);
2377 opt_offset += 16;
2378 break;
2379 default:
2380 expert_add_info(pinfo, ti_opt_len, &ei_icmpv6_invalid_option_length);
2381 break;
2383 break;
2387 case ND_OPT_RECURSIVE_DNS_SERVER: /* Recursive DNS Server Option (25) */
2389 uint32_t lifetime;
2391 /* Reserved */
2392 proto_tree_add_item(icmp6opt_tree, hf_icmpv6_opt_reserved, tvb, opt_offset, 2, ENC_NA);
2393 opt_offset += 2;
2395 /* RDNSS Lifetime */
2396 ti_opt = proto_tree_add_item_ret_uint(icmp6opt_tree, hf_icmpv6_opt_rdnss_lifetime, tvb, opt_offset, 4, ENC_BIG_ENDIAN, &lifetime);
2397 if (lifetime != LIFETIME_INFINITY) {
2398 proto_item_append_text(ti_opt, " (%s)", unsigned_time_secs_to_str(pinfo->pool, lifetime));
2400 opt_offset += 4;
2402 while(opt_offset < (offset + opt_len) ) {
2403 proto_tree_add_item(icmp6opt_tree, hf_icmpv6_opt_rdnss, tvb, opt_offset, 16, ENC_NA);
2404 proto_item_append_text(ti, " %s", tvb_ip6_to_str(pinfo->pool, tvb, opt_offset));
2405 opt_offset += 16;
2408 break;
2410 case ND_OPT_FLAGS_EXTENSION: /* RA Flags Extension Option (26) */
2412 static int * const extension_flags[] = {
2413 &hf_icmpv6_opt_efo_m,
2414 &hf_icmpv6_opt_efo_o,
2415 &hf_icmpv6_opt_efo_h,
2416 &hf_icmpv6_opt_efo_prf,
2417 &hf_icmpv6_opt_efo_p,
2418 &hf_icmpv6_opt_efo_rsv,
2419 NULL
2422 proto_tree_add_bitmask(icmp6opt_tree, tvb, opt_offset, hf_icmpv6_opt_efo, ett_icmpv6_flag_efo, extension_flags, ENC_BIG_ENDIAN);
2423 opt_offset += 2;
2425 proto_tree_add_item(icmp6opt_tree, hf_icmpv6_opt_reserved, tvb, opt_offset, 4, ENC_NA);
2426 opt_offset += 4;
2427 break;
2429 case ND_OPT_HANDOVER_KEY_REQUEST: /* Handover Key Request Option (27) */
2431 int par_len;
2432 unsigned padd_length;
2434 /* Pad Length */
2435 proto_tree_add_item(icmp6opt_tree, hf_icmpv6_opt_hkr_pad_length, tvb, opt_offset, 1, ENC_BIG_ENDIAN);
2436 padd_length = tvb_get_uint8(tvb, opt_offset);
2437 opt_offset += 1;
2439 /* AT */
2440 proto_tree_add_item(icmp6opt_tree, hf_icmpv6_opt_hkr_at, tvb, opt_offset, 1, ENC_BIG_ENDIAN);
2442 /* Reserved */
2443 proto_tree_add_item(icmp6opt_tree, hf_icmpv6_opt_hkr_reserved, tvb, opt_offset, 1, ENC_BIG_ENDIAN);
2444 opt_offset += 1;
2446 /* Handover Key Encryption Public Key */
2447 par_len = opt_len-4-padd_length;
2448 proto_tree_add_item(icmp6opt_tree, hf_icmpv6_opt_hkr_encryption_public_key, tvb, opt_offset, par_len, ENC_NA);
2449 opt_offset += par_len;
2451 /* Padding */
2452 proto_tree_add_item(icmp6opt_tree, hf_icmpv6_opt_hkr_padding, tvb, opt_offset, padd_length, ENC_NA);
2453 opt_offset += 1;
2454 break;
2456 case ND_OPT_HANDOVER_KEY_REPLY: /* Handover Key Reply Option (28) */
2458 int par_len;
2459 unsigned padd_length;
2461 /* Pad Length */
2462 proto_tree_add_item(icmp6opt_tree, hf_icmpv6_opt_hkr_pad_length, tvb, opt_offset, 1, ENC_BIG_ENDIAN);
2463 padd_length = tvb_get_uint8(tvb, opt_offset);
2464 opt_offset += 1;
2466 /* AT */
2467 proto_tree_add_item(icmp6opt_tree, hf_icmpv6_opt_hkr_at, tvb, opt_offset, 1, ENC_BIG_ENDIAN);
2469 /* Reserved */
2470 proto_tree_add_item(icmp6opt_tree, hf_icmpv6_opt_hkr_reserved, tvb, opt_offset, 1, ENC_BIG_ENDIAN);
2471 opt_offset += 1;
2473 /* Lifetime */
2474 proto_tree_add_item(icmp6opt_tree, hf_icmpv6_opt_hkr_lifetime, tvb, opt_offset, 2, ENC_BIG_ENDIAN);
2475 opt_offset += 2;
2477 /* Encrypted Handover Key */
2478 par_len = opt_len-6-padd_length;
2479 proto_tree_add_item(icmp6opt_tree, hf_icmpv6_opt_hkr_encrypted_handover_key, tvb, opt_offset, par_len, ENC_NA);
2480 opt_offset += par_len;
2482 /* Padding */
2483 proto_tree_add_item(icmp6opt_tree, hf_icmpv6_opt_hkr_padding, tvb, opt_offset, padd_length, ENC_NA);
2484 opt_offset += 1;
2485 break;
2487 case ND_OPT_HANDOVER_ASSIST_INFO: /* Handover Assist Information Option (29) */
2489 uint8_t hai_len;
2490 int padd_length;
2491 /* Option-Code */
2492 proto_tree_add_item(icmp6opt_tree, hf_icmpv6_opt_hai_option_code, tvb, opt_offset, 1, ENC_BIG_ENDIAN);
2493 opt_offset += 1;
2495 /* HAI Length */
2496 proto_tree_add_item(icmp6opt_tree, hf_icmpv6_opt_hai_length, tvb, opt_offset, 1, ENC_BIG_ENDIAN);
2497 hai_len = tvb_get_uint8(tvb, opt_offset);
2498 opt_offset += 1;
2500 /* HAI Value */
2501 proto_tree_add_item(icmp6opt_tree, hf_icmpv6_opt_hai_value, tvb, opt_offset, hai_len, ENC_NA);
2502 opt_offset += hai_len;
2504 /* Padding... */
2505 padd_length = opt_len - opt_offset;
2506 proto_tree_add_item(icmp6opt_tree, hf_icmpv6_opt_padding, tvb, opt_offset, padd_length, ENC_NA);
2507 opt_offset += padd_length;
2509 break;
2511 case ND_OPT_MOBILE_NODE_ID: /* Mobile Node Identifier Option (30) */
2513 uint8_t mn_len;
2514 int padd_length;
2515 /* Option-Code */
2516 proto_tree_add_item(icmp6opt_tree, hf_icmpv6_opt_mn_option_code, tvb, opt_offset, 1, ENC_BIG_ENDIAN);
2517 opt_offset += 1;
2519 /* MN Length */
2520 proto_tree_add_item(icmp6opt_tree, hf_icmpv6_opt_mn_length, tvb, opt_offset, 1, ENC_BIG_ENDIAN);
2521 mn_len = tvb_get_uint8(tvb, opt_offset);
2522 opt_offset += 1;
2524 /* MN Value */
2525 proto_tree_add_item(icmp6opt_tree, hf_icmpv6_opt_mn_value, tvb, opt_offset, mn_len, ENC_NA);
2526 opt_offset += mn_len;
2528 /* Padding... */
2529 padd_length = opt_len - opt_offset;
2530 proto_tree_add_item(icmp6opt_tree, hf_icmpv6_opt_padding, tvb, opt_offset, padd_length, ENC_NA);
2531 opt_offset += padd_length;
2533 break;
2535 case ND_OPT_DNS_SEARCH_LIST: /* DNS Search List Option (31) */
2537 uint32_t lifetime;
2538 int dnssl_len;
2539 const char *dnssl_name, *name_out;
2541 /* Reserved */
2542 proto_tree_add_item(icmp6opt_tree, hf_icmpv6_opt_reserved, tvb, opt_offset, 2, ENC_NA);
2543 opt_offset += 2;
2545 /* DNSSL Lifetime */
2546 ti_opt = proto_tree_add_item_ret_uint(icmp6opt_tree, hf_icmpv6_opt_dnssl_lifetime, tvb, opt_offset, 4, ENC_BIG_ENDIAN, &lifetime);
2547 if (lifetime != LIFETIME_INFINITY) {
2548 proto_item_append_text(ti_opt, " (%s)", unsigned_time_secs_to_str(pinfo->pool, lifetime));
2550 opt_offset += 4;
2551 while(opt_offset < (offset + opt_len) ) {
2553 if(tvb_get_uint8(tvb, opt_offset) == 0){
2554 /* Padding... */
2555 int padd_length = (offset + opt_len) - opt_offset;
2556 proto_tree_add_item(icmp6opt_tree, hf_icmpv6_opt_padding, tvb, opt_offset, padd_length, ENC_NA);
2557 opt_offset += padd_length;
2558 break;
2560 used_bytes = get_dns_name(tvb, opt_offset, 0, opt_offset, &dnssl_name, &dnssl_len);
2561 name_out = format_text(pinfo->pool, dnssl_name, dnssl_len);
2562 proto_tree_add_string(icmp6opt_tree, hf_icmpv6_opt_dnssl, tvb, opt_offset, used_bytes, name_out);
2563 proto_item_append_text(ti, " %s", name_out);
2564 opt_offset += used_bytes;
2567 break;
2569 case ND_OPT_PROXY_SIGNATURE: /* Proxy Signature Option (32) */
2571 int par_len;
2573 /* Reserved */
2574 proto_tree_add_item(icmp6opt_tree, hf_icmpv6_opt_reserved, tvb, opt_offset, 2, ENC_NA);
2575 opt_offset += 2;
2577 /* Key Hash
2578 * A 128-bit field containing the most significant (leftmost) 128
2579 * bits of a SHA-1 [14] hash of the public key used for constructing
2580 * the signature.
2582 proto_tree_add_item(icmp6opt_tree, hf_icmpv6_opt_ps_key_hash, tvb, opt_offset, 16, ENC_NA);
2583 opt_offset += 16;
2585 /* Digital Signature */
2586 par_len = opt_len - 20;
2587 proto_tree_add_item(icmp6opt_tree, hf_icmpv6_opt_digital_signature_padding , tvb, opt_offset, par_len, ENC_NA);
2588 opt_offset += par_len;
2589 /* Padding */
2590 /* TODO: Calculate padding length and exclude from the signature */
2591 break;
2593 case ND_OPT_ADDR_REGISTRATION: /* Address Registration (TBD1 Pending IANA...) */
2595 /* 6lowpan-ND */
2596 uint8_t status;
2597 static int * const earo_flags[] = {
2598 &hf_icmpv6_opt_earo_flag_p,
2599 &hf_icmpv6_opt_earo_flag_i,
2600 &hf_icmpv6_opt_earo_flag_r,
2601 &hf_icmpv6_opt_earo_flag_t,
2602 NULL
2605 /* Status */
2606 proto_tree_add_item(icmp6opt_tree, hf_icmpv6_opt_aro_status, tvb, opt_offset, 1, ENC_BIG_ENDIAN);
2607 status = tvb_get_uint8(tvb, opt_offset);
2608 opt_offset += 1;
2610 /* EARO Opaque */
2611 proto_tree_add_item(icmp6opt_tree, hf_icmpv6_opt_earo_opaque, tvb, opt_offset, 1, ENC_BIG_ENDIAN);
2612 opt_offset += 1;
2614 /* EARO Flags */
2615 proto_tree_add_bitmask(icmp6opt_tree, tvb, opt_offset, hf_icmpv6_opt_earo_flag, ett_icmpv6_flag_earo, earo_flags, ENC_BIG_ENDIAN);
2616 opt_offset += 1;
2618 /* EARO Transaction ID */
2619 proto_tree_add_item(icmp6opt_tree, hf_icmpv6_opt_earo_tid, tvb, opt_offset, 1, ENC_BIG_ENDIAN);
2620 opt_offset += 1;
2622 /* Lifetime */
2623 proto_tree_add_item(icmp6opt_tree, hf_icmpv6_opt_aro_registration_lifetime, tvb, opt_offset, 2, ENC_BIG_ENDIAN);
2624 opt_offset += 2;
2626 /* EUI-64 */
2627 proto_tree_add_item(icmp6opt_tree, hf_icmpv6_opt_aro_eui64, tvb, opt_offset, 8, ENC_BIG_ENDIAN);
2628 proto_item_append_text(ti, " : Register %s %s", tvb_eui64_to_str(pinfo->pool, tvb, opt_offset), val_to_str(status, nd_opt_earo_status_val, "Unknown %d"));
2629 opt_offset += 8;
2632 break;
2633 case ND_OPT_6LOWPAN_CONTEXT: /* 6LoWPAN Context (TBD2 Pending IANA...) */
2635 ieee802154_hints_t *hints;
2636 /* 6lowpan-ND */
2637 uint8_t context_id;
2638 uint8_t context_len;
2639 ws_in6_addr context_prefix;
2640 address context_prefix_addr;
2641 static int * const _6lowpan_context_flags[] = {
2642 &hf_icmpv6_opt_6co_flag_c,
2643 &hf_icmpv6_opt_6co_flag_cid,
2644 &hf_icmpv6_opt_6co_flag_reserved,
2645 NULL
2648 /* Context Length */
2649 proto_tree_add_item(icmp6opt_tree, hf_icmpv6_opt_6co_context_length, tvb, opt_offset, 1, ENC_BIG_ENDIAN);
2650 context_len = tvb_get_uint8(tvb, opt_offset);
2651 opt_offset += 1;
2653 /* Flags & CID */
2654 context_id = tvb_get_uint8(tvb, opt_offset) & ND_OPT_6CO_FLAG_CID;
2655 proto_tree_add_bitmask(icmp6opt_tree, tvb, opt_offset, hf_icmpv6_opt_6co_flag, ett_icmpv6_flag_6lowpan, _6lowpan_context_flags, ENC_BIG_ENDIAN);
2656 opt_offset += 1;
2658 /* Reserved */
2659 proto_tree_add_item(icmp6opt_tree, hf_icmpv6_opt_reserved, tvb, opt_offset, 2, ENC_NA);
2660 opt_offset += 2;
2662 /* Lifetime */
2663 proto_tree_add_item(icmp6opt_tree, hf_icmpv6_opt_6co_valid_lifetime, tvb, opt_offset, 2, ENC_BIG_ENDIAN);
2664 opt_offset += 2;
2666 /* Context */
2667 memset(&context_prefix.bytes, 0, sizeof(context_prefix));
2668 switch(opt_len){
2669 case 8: /* Default Option Length without context prefix */
2670 proto_item_append_text(ti, " ::/%d", context_len);
2671 break;
2672 case 16:
2673 tvb_memcpy(tvb, (uint8_t *)&context_prefix.bytes, opt_offset, 8);
2674 proto_tree_add_ipv6(icmp6opt_tree, hf_icmpv6_opt_6co_context_prefix, tvb, opt_offset, 8, &context_prefix);
2675 set_address(&context_prefix_addr, AT_IPv6, 16, context_prefix.bytes);
2676 proto_item_append_text(ti, " %s/%d", address_to_str(pinfo->pool, &context_prefix_addr), context_len);
2677 opt_offset += 8;
2678 break;
2679 case 24:
2680 tvb_memcpy(tvb, (uint8_t *)&context_prefix.bytes, opt_offset, 16);
2681 proto_tree_add_item(icmp6opt_tree, hf_icmpv6_opt_6co_context_prefix, tvb, opt_offset, 16, ENC_NA);
2682 proto_item_append_text(ti, " %s/%d", tvb_ip6_to_str(pinfo->pool, tvb, opt_offset), context_len);
2683 opt_offset += 16;
2684 break;
2685 default:
2686 expert_add_info(pinfo, ti_opt_len, &ei_icmpv6_invalid_option_length);
2687 break;
2689 /* Update the 6LoWPAN dissectors with new context information. */
2690 hints = (ieee802154_hints_t *)p_get_proto_data(wmem_file_scope(), pinfo,
2691 proto_get_id_by_filter_name(IEEE802154_PROTOABBREV_WPAN), 0);
2692 if ((opt_len <= 24) && hints) {
2693 lowpan_context_insert(context_id, hints->src_pan, context_len, &context_prefix, pinfo->num);
2696 break;
2697 case ND_OPT_AUTH_BORDER_ROUTER: /* Authoritative Border Router (33) */
2699 uint32_t version_low, version_high, valid_lifetime;
2701 /* Version low*/
2702 proto_tree_add_item_ret_uint(icmp6opt_tree, hf_icmpv6_opt_abro_version_low, tvb, opt_offset, 2, ENC_BIG_ENDIAN, &version_low);
2703 opt_offset += 2;
2705 /* Version high */
2706 proto_tree_add_item_ret_uint(icmp6opt_tree, hf_icmpv6_opt_abro_version_high, tvb, opt_offset, 2, ENC_BIG_ENDIAN, &version_high);
2707 opt_offset += 2;
2709 /* Valid lifetime */
2710 proto_tree_add_item_ret_uint(icmp6opt_tree, hf_icmpv6_opt_abro_valid_lifetime, tvb, opt_offset, 2, ENC_BIG_ENDIAN, &valid_lifetime);
2711 opt_offset += 2;
2713 /* 6LBR Address */
2714 proto_tree_add_item(icmp6opt_tree, hf_icmpv6_opt_abro_6lbr_address, tvb, opt_offset, 16, ENC_NA);
2715 proto_item_append_text(ti, " : Version %d.%d, Valid Lifetime : %d, 6LBR : %s", version_high, version_low, valid_lifetime, tvb_ip6_to_str(pinfo->pool, tvb, opt_offset));
2716 opt_offset += 16;
2719 break;
2720 case ND_OPT_6CIO: /* 6LoWPAN Capability Indication Option (35) */
2723 proto_tree_add_item(icmp6opt_tree, hf_icmpv6_opt_6cio_unassigned1, tvb, opt_offset, 2, ENC_BIG_ENDIAN);
2724 proto_tree_add_item(icmp6opt_tree, hf_icmpv6_opt_6cio_flag_g, tvb, opt_offset, 2, ENC_BIG_ENDIAN);
2725 opt_offset += 2;
2727 proto_tree_add_item(icmp6opt_tree, hf_icmpv6_opt_6cio_unassigned2, tvb, opt_offset, 4, ENC_BIG_ENDIAN);
2728 opt_offset += 4;
2732 break;
2733 case ND_OPT_CAPPORT: /* DHCP Captive-Portal Option (37) */
2735 proto_item *ti_cp;
2737 ti_cp = proto_tree_add_item(icmp6opt_tree, hf_icmpv6_opt_captive_portal, tvb, opt_offset, opt_len-2, ENC_ASCII);
2738 proto_item_set_url(ti_cp);
2739 opt_offset += opt_len - 2;
2742 break;
2743 case ND_OPT_PREF64: /* PREF64 Option (38) */
2745 ws_in6_addr prefix;
2746 uint32_t plc;
2748 proto_tree_add_item(icmp6opt_tree, hf_icmpv6_opt_pref64_scaled_lifetime, tvb, opt_offset, 2, ENC_BIG_ENDIAN);
2749 proto_tree_add_item_ret_uint(icmp6opt_tree, hf_icmpv6_opt_pref64_plc, tvb, opt_offset, 2, ENC_BIG_ENDIAN, &plc);
2750 opt_offset += 2;
2752 /* Prefix */
2753 memset(&prefix.bytes, 0, sizeof(prefix));
2754 switch(plc){
2755 case 0: /* 96 bits prefix length */
2756 tvb_memcpy(tvb, (uint8_t *)&prefix.bytes, opt_offset, 12);
2757 proto_tree_add_ipv6(icmp6opt_tree, hf_icmpv6_opt_pref64_prefix, tvb, opt_offset, 12, &prefix);
2758 break;
2759 case 1: /* 64 bits prefix length */
2760 tvb_memcpy(tvb, (uint8_t *)&prefix.bytes, opt_offset, 8);
2761 proto_tree_add_ipv6(icmp6opt_tree, hf_icmpv6_opt_pref64_prefix, tvb, opt_offset, 8, &prefix);
2762 break;
2763 case 2: /* 56 bits prefix length */
2764 tvb_memcpy(tvb, (uint8_t *)&prefix.bytes, opt_offset, 7);
2765 proto_tree_add_ipv6(icmp6opt_tree, hf_icmpv6_opt_pref64_prefix, tvb, opt_offset, 7, &prefix);
2766 break;
2767 case 3: /* 48 bits prefix length */
2768 tvb_memcpy(tvb, (uint8_t *)&prefix.bytes, opt_offset, 6);
2769 proto_tree_add_ipv6(icmp6opt_tree, hf_icmpv6_opt_pref64_prefix, tvb, opt_offset, 6, &prefix);
2770 break;
2771 case 4: /* 40 bits prefix length */
2772 tvb_memcpy(tvb, (uint8_t *)&prefix.bytes, opt_offset, 5);
2773 proto_tree_add_ipv6(icmp6opt_tree, hf_icmpv6_opt_pref64_prefix, tvb, opt_offset, 5, &prefix);
2774 break;
2775 case 5: /* 32 bits prefix length */
2776 tvb_memcpy(tvb, (uint8_t *)&prefix.bytes, opt_offset, 4);
2777 proto_tree_add_ipv6(icmp6opt_tree, hf_icmpv6_opt_pref64_prefix, tvb, opt_offset, 4, &prefix);
2778 break;
2779 default:
2780 expert_add_info(pinfo, ti_opt_len, &ei_icmpv6_invalid_option_length);
2781 break;
2783 opt_offset += 12;
2785 break;
2786 default :
2787 expert_add_info_format(pinfo, ti, &ei_icmpv6_undecoded_option,
2788 "Dissector for ICMPv6 Option (%d)"
2789 " code not implemented, Contact Wireshark developers"
2790 " if you want this supported", opt_type);
2791 proto_tree_add_item(icmp6opt_tree, hf_icmpv6_data, tvb, opt_offset, opt_len-2, ENC_NA);
2792 opt_offset += opt_len - 2;
2793 break;
2795 } /* switch (opt_type) */
2797 offset += opt_len;
2799 if(offset > opt_offset){
2800 ti_opt = proto_tree_add_item(icmp6opt_tree, hf_icmpv6_unknown_data, tvb, opt_offset, offset - opt_offset, ENC_NA);
2801 expert_add_info(pinfo, ti_opt, &ei_icmpv6_unknown_data);
2803 /* Close the ) to option root label */
2804 proto_item_append_text(ti, ")");
2806 return offset;
2810 /* RPL: RFC 6550/6997 : Routing and Discovery of P2P Routes in Low-Power and Lossy Networks. */
2811 static int
2812 dissect_icmpv6_rpl_opt(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree, uint8_t icmp6_code)
2814 proto_tree *icmp6opt_tree, *flag_tree;
2815 proto_item *ti, *ti_opt, *ti_opt_len, *ti_opt_reply, *ti_opt_hop_by_hop, *ti_opt_num_of_routes,
2816 *ti_opt_lifetime, *ti_opt_mr_nh = NULL;
2817 uint8_t opt_type;
2818 int opt_len;
2819 int opt_offset;
2821 while ((int)tvb_reported_length(tvb) > offset) {
2822 /* there are more options */
2824 /* ICMPv6 RPL Option */
2825 ti = proto_tree_add_item(tree, hf_icmpv6_rpl_opt, tvb, offset, 1, ENC_NA);
2826 icmp6opt_tree = proto_item_add_subtree(ti, ett_icmpv6_rpl_opt);
2827 opt_offset = offset;
2829 /* Option type */
2830 proto_tree_add_item(icmp6opt_tree, hf_icmpv6_rpl_opt_type, tvb, opt_offset, 1, ENC_BIG_ENDIAN);
2831 opt_type = tvb_get_uint8(tvb, opt_offset);
2832 opt_offset += 1;
2834 /* Add option name to option root label */
2835 proto_item_append_text(ti, " (%s", val_to_str(opt_type, rpl_option_vals, "Unknown %d"));
2837 /* The Pad1 option is a special case, and contains no data. */
2838 if (opt_type == RPL_OPT_PAD1) {
2839 offset += 1;
2840 proto_item_append_text(ti, ")");
2841 continue;
2844 /* Option length */
2845 ti_opt_len = proto_tree_add_item(icmp6opt_tree, hf_icmpv6_rpl_opt_length, tvb, opt_offset, 1, ENC_BIG_ENDIAN);
2846 opt_len = tvb_get_uint8(tvb, opt_offset);
2847 proto_item_set_len(ti, opt_len + 2);
2848 opt_offset += 1;
2850 /* decode... */
2851 switch (opt_type) {
2852 case RPL_OPT_PADN:
2853 /* n-byte padding */
2854 ti_opt = proto_tree_add_item(icmp6opt_tree, hf_icmpv6_rpl_opt_padn, tvb, opt_offset, opt_len, ENC_NA);
2855 proto_item_append_text(ti_opt, " (Length : %i bytes)", opt_len);
2856 opt_offset += opt_len;
2857 break;
2858 case RPL_OPT_METRIC: {
2859 /* DAG metric container */
2860 /* See RFC 6551 for formatting. */
2862 proto_tree *metric_constraint_tree;
2863 proto_item *ti_metric_constraint;
2864 uint8_t metric_constraint_type;
2865 int metric_len;
2867 while (opt_offset < offset + opt_len) {
2868 static int * const rpl_metric_flags[] = {
2869 &hf_icmpv6_rpl_opt_metric_reserved,
2870 &hf_icmpv6_rpl_opt_metric_flag_p,
2871 &hf_icmpv6_rpl_opt_metric_flag_c,
2872 &hf_icmpv6_rpl_opt_metric_flag_o,
2873 &hf_icmpv6_rpl_opt_metric_flag_r,
2874 &hf_icmpv6_rpl_opt_metric_a,
2875 &hf_icmpv6_rpl_opt_metric_prec,
2876 NULL
2878 uint16_t metric_constraint_flags;
2880 /* Metric/Constraint type */
2881 metric_constraint_type = tvb_get_uint8(tvb, opt_offset);
2882 ti_metric_constraint = proto_tree_add_item(icmp6opt_tree, hf_icmpv6_rpl_opt_metric_type, tvb, opt_offset, 1, ENC_BIG_ENDIAN);
2883 metric_constraint_tree = proto_item_add_subtree(ti_metric_constraint, ett_icmpv6_rpl_metric_type);
2884 opt_offset += 1;
2886 /* Flags */
2887 proto_tree_add_bitmask(metric_constraint_tree, tvb, opt_offset, hf_icmpv6_rpl_opt_metric_flags, ett_icmpv6_rpl_metric_flags, rpl_metric_flags, ENC_BIG_ENDIAN);
2888 metric_constraint_flags = tvb_get_uint16(tvb, opt_offset, ENC_BIG_ENDIAN);
2889 opt_offset += 2;
2891 /* Metric length */
2892 metric_len = tvb_get_uint8(tvb, opt_offset);
2893 proto_tree_add_item(metric_constraint_tree, hf_icmpv6_rpl_opt_metric_len, tvb, opt_offset, 1, ENC_BIG_ENDIAN);
2894 proto_item_set_len(ti_metric_constraint, metric_len + 4);
2895 opt_offset += 1;
2897 /* Metric/Constraint Type */
2898 switch(metric_constraint_type) {
2899 case RPL_METRIC_NSA: /* Node State and Attribute Object */
2901 static int * const metric_nsa_flags[] = {
2902 &hf_icmpv6_rpl_opt_metric_nsa_object_reserved,
2903 &hf_icmpv6_rpl_opt_metric_nsa_object_flags,
2904 &hf_icmpv6_rpl_opt_metric_nsa_object_flag_a,
2905 &hf_icmpv6_rpl_opt_metric_nsa_object_flag_o,
2906 NULL
2909 proto_item *ti_metric_nsa_object = proto_tree_add_bitmask(metric_constraint_tree, tvb, opt_offset, hf_icmpv6_rpl_opt_metric_nsa_object,
2910 ett_icmpv6_rpl_metric_nsa_object, metric_nsa_flags, ENC_BIG_ENDIAN);
2911 proto_item_set_len(ti_metric_nsa_object, 2);
2912 opt_offset += 2;
2913 metric_len -= 2;
2916 while(metric_len > 0){
2917 /* TLV */
2918 tvb_get_uint8(tvb, opt_offset);
2919 proto_item *ti_metric_nsa_tlv = proto_tree_add_item(metric_constraint_tree, hf_icmpv6_rpl_opt_metric_nsa_object_opttlv_object, tvb, opt_offset, 1, ENC_BIG_ENDIAN);
2920 proto_tree * metric_nsa_tlv_tree = proto_item_add_subtree(ti_metric_nsa_tlv, ett_icmpv6_rpl_metric_nsa_object_tlv_type);
2922 /* TLV type */
2923 proto_tree_add_item(metric_nsa_tlv_tree, hf_icmpv6_rpl_opt_metric_nsa_object_opttlv_object_type, tvb, opt_offset, 1, ENC_BIG_ENDIAN);
2924 opt_offset += 1;
2925 metric_len -= 1;
2927 /* TLV length */
2928 int nsa_tlv_len = tvb_get_uint8(tvb, opt_offset);
2929 proto_tree_add_item(metric_nsa_tlv_tree, hf_icmpv6_rpl_opt_metric_nsa_object_opttlv_object_length, tvb, opt_offset, 1, ENC_BIG_ENDIAN);
2930 proto_item_set_len(ti_metric_nsa_tlv, nsa_tlv_len + 2);
2931 opt_offset += 1;
2932 metric_len -= 1;
2934 /* TLV data */
2935 proto_tree_add_item(metric_nsa_tlv_tree, hf_icmpv6_rpl_opt_metric_nsa_object_opttlv_object_data, tvb, opt_offset, nsa_tlv_len, ENC_NA);
2936 opt_offset += nsa_tlv_len;
2937 metric_len -= nsa_tlv_len;
2939 break;
2941 case RPL_METRIC_NE: /* Node Energy */
2943 static int * const metric_ne_flags[] = {
2944 &hf_icmpv6_rpl_opt_metric_ne_object_flags,
2945 &hf_icmpv6_rpl_opt_metric_ne_object_flag_i,
2946 &hf_icmpv6_rpl_opt_metric_ne_object_type,
2947 &hf_icmpv6_rpl_opt_metric_ne_object_flag_e,
2948 &hf_icmpv6_rpl_opt_metric_ne_object_energy,
2949 NULL
2952 for (; metric_len > 0; metric_len -= 2) {
2953 proto_tree_add_bitmask(metric_constraint_tree, tvb, opt_offset, hf_icmpv6_rpl_opt_metric_ne_object,
2954 ett_icmpv6_rpl_metric_ne_object, metric_ne_flags, ENC_BIG_ENDIAN);
2955 opt_offset += 2;
2957 break;
2959 case RPL_METRIC_HP: /* Hop Count Object */
2961 static int * const metric_hp_flags[] = {
2962 &hf_icmpv6_rpl_opt_metric_hp_object_reserved,
2963 &hf_icmpv6_rpl_opt_metric_hp_object_flags,
2964 &hf_icmpv6_rpl_opt_metric_hp_object_hp,
2965 NULL
2967 proto_tree_add_bitmask(metric_constraint_tree, tvb, opt_offset, hf_icmpv6_rpl_opt_metric_hp_object,
2968 ett_icmpv6_rpl_metric_hp_object, metric_hp_flags, ENC_BIG_ENDIAN);
2969 opt_offset += 2;
2970 break;
2972 case RPL_METRIC_LT: /* Link Throughput Object */
2973 for (; metric_len > 0; metric_len -= 4) {
2974 proto_tree_add_item(metric_constraint_tree, hf_icmpv6_rpl_opt_metric_lt_object_lt, tvb, opt_offset, 4, ENC_BIG_ENDIAN);
2975 opt_offset += 4;
2977 break;
2978 case RPL_METRIC_LL: /* Link Latency Object */
2979 for (; metric_len > 0; metric_len -= 4) {
2980 proto_tree_add_item(metric_constraint_tree, hf_icmpv6_rpl_opt_metric_ll_object_ll, tvb, opt_offset, 4, ENC_BIG_ENDIAN);
2981 opt_offset += 4;
2983 break;
2984 case RPL_METRIC_LQL: /* Link Quality Level Object */
2986 static int * const metric_lql_flags[] = {
2987 &hf_icmpv6_rpl_opt_metric_lql_object_val,
2988 &hf_icmpv6_rpl_opt_metric_lql_object_counter,
2989 NULL
2992 proto_tree_add_item(metric_constraint_tree, hf_icmpv6_rpl_opt_metric_lql_object_res, tvb, opt_offset, 1, ENC_BIG_ENDIAN);
2993 opt_offset += 1;
2994 metric_len -= 1;
2995 for (; metric_len > 0; metric_len -= 1) {
2996 proto_tree_add_bitmask(metric_constraint_tree, tvb, opt_offset, hf_icmpv6_rpl_opt_metric_lql_object,
2997 ett_icmpv6_rpl_metric_lql_object, metric_lql_flags, ENC_BIG_ENDIAN);
2998 opt_offset += 1;
3000 break;
3002 case RPL_METRIC_ETX: /* ETX Object */
3003 for (; metric_len > 0; metric_len -= 2) {
3004 proto_tree_add_item(metric_constraint_tree, hf_icmpv6_rpl_opt_metric_etx_object_etx, tvb, opt_offset, 2, ENC_BIG_ENDIAN);
3005 opt_offset += 2;
3007 break;
3008 case RPL_METRIC_LC: /* Link Color Object */
3009 proto_tree_add_item(metric_constraint_tree, hf_icmpv6_rpl_opt_metric_lc_object_res, tvb, opt_offset, 1, ENC_BIG_ENDIAN);
3010 opt_offset += 1;
3011 metric_len -= 1;
3012 for (; metric_len > 0; metric_len -= 2) {
3013 ti_opt = proto_tree_add_item(metric_constraint_tree, hf_icmpv6_rpl_opt_metric_lc_object, tvb, opt_offset, 2, ENC_NA);
3014 flag_tree = proto_item_add_subtree(ti_opt, ett_icmpv6_rpl_metric_lc_object);
3015 proto_tree_add_item(flag_tree, hf_icmpv6_rpl_opt_metric_lc_object_lc, tvb, opt_offset, 2, ENC_NA);
3016 if (metric_constraint_flags & RPL_METRIC_FLAG_C) {
3017 proto_tree_add_item(flag_tree, hf_icmpv6_rpl_opt_metric_lc_object_reserved, tvb, opt_offset, 2, ENC_BIG_ENDIAN);
3018 proto_tree_add_item(flag_tree, hf_icmpv6_rpl_opt_metric_lc_object_flag_i, tvb, opt_offset, 2, ENC_BIG_ENDIAN);
3019 } else if (metric_constraint_flags & RPL_METRIC_FLAG_R) {
3020 proto_tree_add_item(flag_tree, hf_icmpv6_rpl_opt_metric_lc_object_counter, tvb, opt_offset, 2, ENC_BIG_ENDIAN);
3021 } else {
3022 expert_add_info(pinfo, ti_opt, &ei_icmpv6_rpl_unknown_metric);
3024 opt_offset += 2;
3026 break;
3027 default:
3028 expert_add_info(pinfo, ti_opt_len, &ei_icmpv6_rpl_unknown_metric);
3029 break;
3032 break;
3034 case RPL_OPT_ROUTING: {
3035 uint8_t prefix_len;
3036 ws_in6_addr prefix;
3037 address prefix_addr;
3038 uint32_t lifetime;
3040 static int * const rpl_flags[] = {
3041 &hf_icmpv6_rpl_opt_route_pref,
3042 &hf_icmpv6_rpl_opt_route_reserved,
3043 NULL
3046 /* Prefix length */
3047 prefix_len = tvb_get_uint8(tvb, opt_offset);
3048 proto_tree_add_item(icmp6opt_tree, hf_icmpv6_rpl_opt_route_prefix_length, tvb, opt_offset, 1, ENC_BIG_ENDIAN);
3049 opt_offset +=1;
3051 /* Flags */
3052 proto_tree_add_bitmask(icmp6opt_tree, tvb, opt_offset, hf_icmpv6_rpl_opt_route_flag,
3053 ett_icmpv6_rpl_flag_routing, rpl_flags, ENC_BIG_ENDIAN);
3054 opt_offset +=1;
3056 /* Prefix lifetime. */
3057 ti_opt = proto_tree_add_item_ret_uint(icmp6opt_tree, hf_icmpv6_rpl_opt_route_lifetime, tvb, opt_offset, 4, ENC_BIG_ENDIAN, &lifetime);
3058 if (lifetime != LIFETIME_INFINITY) {
3059 proto_item_append_text(ti_opt, " (%s)", unsigned_time_secs_to_str(pinfo->pool, lifetime));
3061 opt_offset += 4;
3063 switch(opt_len){
3064 case 6: /* Default Option Length without prefix */
3065 proto_item_append_text(ti, " ::/%d", prefix_len);
3066 break;
3067 case 14:
3068 memset(&prefix, 0, sizeof(prefix));
3069 tvb_memcpy(tvb, (uint8_t *)&prefix.bytes, opt_offset, 8);
3070 proto_tree_add_ipv6(icmp6opt_tree, hf_icmpv6_rpl_opt_route_prefix, tvb, opt_offset, 8, &prefix);
3071 set_address(&prefix_addr, AT_IPv6, 16, prefix.bytes);
3072 proto_item_append_text(ti, " %s/%d", address_to_str(pinfo->pool, &prefix_addr), prefix_len);
3073 opt_offset += 8;
3074 break;
3075 case 22:
3076 proto_tree_add_item(icmp6opt_tree, hf_icmpv6_rpl_opt_route_prefix, tvb, opt_offset, 16, ENC_NA);
3077 proto_item_append_text(ti, " %s/%d", tvb_ip6_to_str(pinfo->pool, tvb, opt_offset), prefix_len);
3078 opt_offset += 16;
3079 break;
3080 default:
3081 expert_add_info(pinfo, ti_opt_len, &ei_icmpv6_invalid_option_length);
3082 break;
3084 break;
3086 case RPL_OPT_CONFIG: {
3087 static int * const rpl_config_flags[] = {
3088 &hf_icmpv6_rpl_opt_config_reserved,
3089 &hf_icmpv6_rpl_opt_config_auth,
3090 &hf_icmpv6_rpl_opt_config_pcs,
3091 NULL
3093 proto_item *pi;
3095 /* Flags */
3096 proto_tree_add_bitmask(icmp6opt_tree, tvb, opt_offset, hf_icmpv6_rpl_opt_config_flag,
3097 ett_icmpv6_rpl_flag_config, rpl_config_flags, ENC_BIG_ENDIAN);
3098 opt_offset += 1;
3100 /* DIOIntervalDoublings */
3101 pi = proto_tree_add_item(icmp6opt_tree, hf_icmpv6_rpl_opt_config_doublings, tvb, opt_offset, 1, ENC_BIG_ENDIAN);
3102 proto_item_append_text(pi, " (Imax=%.0fms)", pow(2, tvb_get_uint8(tvb, opt_offset + 1) + tvb_get_uint8(tvb, opt_offset)));
3103 opt_offset += 1;
3105 /* DIOIntervalMin */
3106 pi = proto_tree_add_item(icmp6opt_tree, hf_icmpv6_rpl_opt_config_min_interval, tvb, opt_offset, 1, ENC_BIG_ENDIAN);
3107 proto_item_append_text(pi, " (Imin=%.0fms)", pow(2, tvb_get_uint8(tvb, opt_offset)));
3108 opt_offset += 1;
3110 /* DIORedundancyConstant */
3111 proto_tree_add_item(icmp6opt_tree, hf_icmpv6_rpl_opt_config_redundancy, tvb, opt_offset, 1, ENC_BIG_ENDIAN);
3112 opt_offset += 1;
3114 /* MaxRankIncrease */
3115 proto_tree_add_item(icmp6opt_tree, hf_icmpv6_rpl_opt_config_rank_incr, tvb, opt_offset, 2, ENC_BIG_ENDIAN);
3116 opt_offset += 2;
3118 /* MinHopRankInc */
3119 proto_tree_add_item(icmp6opt_tree, hf_icmpv6_rpl_opt_config_hop_rank_inc, tvb, opt_offset, 2, ENC_BIG_ENDIAN);
3120 opt_offset += 2;
3122 /* OCP */
3123 proto_tree_add_item(icmp6opt_tree, hf_icmpv6_rpl_opt_config_ocp, tvb, opt_offset, 2, ENC_BIG_ENDIAN);
3124 opt_offset += 2;
3126 /* Reserved */
3127 proto_tree_add_item(icmp6opt_tree, hf_icmpv6_rpl_opt_config_rsv, tvb, opt_offset, 1, ENC_BIG_ENDIAN);
3128 opt_offset += 1;
3130 /* Default Lifetime */
3131 pi = proto_tree_add_item(icmp6opt_tree, hf_icmpv6_rpl_opt_config_def_lifetime, tvb, opt_offset, 1, ENC_BIG_ENDIAN);
3132 proto_item_append_text(pi, " (%us)", tvb_get_uint8(tvb, opt_offset) * tvb_get_ntohs(tvb, opt_offset + 1));
3133 opt_offset += 1;
3135 /* Lifetime Unit */
3136 proto_tree_add_item(icmp6opt_tree, hf_icmpv6_rpl_opt_config_lifetime_unit, tvb, opt_offset, 2, ENC_BIG_ENDIAN);
3137 opt_offset += 2;
3138 break;
3140 case RPL_OPT_TARGET: {
3141 uint8_t prefix_len;
3142 ws_in6_addr target_prefix;
3143 address target_prefix_addr;
3145 /* Flag */
3146 proto_tree_add_item(icmp6opt_tree, hf_icmpv6_rpl_opt_target_flag, tvb, opt_offset, 1, ENC_NA);
3147 opt_offset += 1;
3149 /* Prefix length */
3150 prefix_len = tvb_get_uint8(tvb, opt_offset);
3151 proto_tree_add_item(icmp6opt_tree, hf_icmpv6_rpl_opt_target_prefix_length, tvb, opt_offset, 1, ENC_BIG_ENDIAN);
3152 opt_offset += 1;
3154 /* Target Prefix */
3156 switch(opt_len){
3157 case 2: /* Default Option Length without prefix */
3158 proto_item_append_text(ti, " ::/%d", prefix_len);
3159 break;
3160 case 10:
3161 memset(&target_prefix, 0, sizeof(target_prefix));
3162 tvb_memcpy(tvb, (uint8_t *)&target_prefix.bytes, opt_offset, 8);
3163 proto_tree_add_ipv6(icmp6opt_tree, hf_icmpv6_rpl_opt_target_prefix, tvb, opt_offset, 8, &target_prefix);
3164 set_address(&target_prefix_addr, AT_IPv6, 16, target_prefix.bytes);
3165 proto_item_append_text(ti, " %s/%d", address_to_str(pinfo->pool, &target_prefix_addr), prefix_len);
3166 opt_offset += 8;
3167 break;
3168 case 18:
3169 proto_tree_add_item(icmp6opt_tree, hf_icmpv6_rpl_opt_target_prefix, tvb, opt_offset, 16, ENC_NA);
3170 proto_item_append_text(ti, " %s/%d", tvb_ip6_to_str(pinfo->pool, tvb, opt_offset), prefix_len);
3171 opt_offset += 16;
3172 break;
3173 default:
3174 expert_add_info(pinfo, ti_opt_len, &ei_icmpv6_invalid_option_length);
3175 break;
3177 break;
3179 case RPL_OPT_TRANSIT: {
3180 static int * const rpl_transit_flags[] = {
3181 &hf_icmpv6_rpl_opt_transit_flag_e,
3182 &hf_icmpv6_rpl_opt_transit_flag_rsv,
3183 NULL
3185 static int * const rpl_transit_pathctl[] = {
3186 &hf_icmpv6_rpl_opt_transit_pathctl_pc1,
3187 &hf_icmpv6_rpl_opt_transit_pathctl_pc2,
3188 &hf_icmpv6_rpl_opt_transit_pathctl_pc3,
3189 &hf_icmpv6_rpl_opt_transit_pathctl_pc4,
3190 NULL,
3193 /* Flags */
3194 proto_tree_add_bitmask(icmp6opt_tree, tvb, opt_offset, hf_icmpv6_rpl_opt_transit_flag,
3195 ett_icmpv6_rpl_flag_transit, rpl_transit_flags, ENC_BIG_ENDIAN);
3196 opt_offset += 1;
3198 /* Path Control */
3199 proto_tree_add_bitmask(icmp6opt_tree, tvb, opt_offset, hf_icmpv6_rpl_opt_transit_pathctl,
3200 ett_icmpv6_rpl_transit_pathctl, rpl_transit_pathctl, ENC_BIG_ENDIAN);
3201 opt_offset += 1;
3203 /* Path Sequence */
3204 proto_tree_add_item(icmp6opt_tree, hf_icmpv6_rpl_opt_transit_pathseq, tvb, opt_offset, 1, ENC_BIG_ENDIAN);
3205 opt_offset += 1;
3207 /* Path Lifetime */
3208 proto_tree_add_item(icmp6opt_tree, hf_icmpv6_rpl_opt_transit_pathlifetime, tvb, opt_offset, 1, ENC_BIG_ENDIAN);
3209 opt_offset += 1;
3211 /* Option contains parent */
3212 if(opt_len > 4)
3214 proto_tree_add_item(icmp6opt_tree, hf_icmpv6_rpl_opt_transit_parent, tvb, opt_offset, 16, ENC_NA);
3215 proto_item_append_text(ti, " %s", tvb_ip6_to_str(pinfo->pool, tvb, opt_offset));
3216 opt_offset += 16;
3219 break;
3221 case RPL_OPT_SOLICITED: {
3222 static int * const rpl_solicited_flags[] = {
3223 &hf_icmpv6_rpl_opt_solicited_flag_v,
3224 &hf_icmpv6_rpl_opt_solicited_flag_i,
3225 &hf_icmpv6_rpl_opt_solicited_flag_d,
3226 &hf_icmpv6_rpl_opt_solicited_flag_rsv,
3227 NULL
3230 /*Instance ID */
3231 proto_tree_add_item(icmp6opt_tree, hf_icmpv6_rpl_opt_solicited_instance, tvb, opt_offset, 1, ENC_BIG_ENDIAN);
3232 opt_offset += 1;
3234 /* Flags */
3235 proto_tree_add_bitmask(icmp6opt_tree, tvb, opt_offset, hf_icmpv6_rpl_opt_solicited_flag,
3236 ett_icmpv6_rpl_flag_solicited, rpl_solicited_flags, ENC_BIG_ENDIAN);
3237 opt_offset += 1;
3239 /* DODAG ID */
3240 proto_tree_add_item(icmp6opt_tree, hf_icmpv6_rpl_opt_solicited_dodagid, tvb, opt_offset, 16, ENC_NA);
3241 opt_offset += 16;
3243 /* Version Number */
3244 proto_tree_add_item(icmp6opt_tree, hf_icmpv6_rpl_opt_solicited_version, tvb, opt_offset, 1, ENC_BIG_ENDIAN);
3245 opt_offset += 1;
3247 break;
3249 case RPL_OPT_PREFIX: {
3250 /* Destination prefix option. */
3251 uint32_t lifetime;
3252 uint32_t prefix_len;
3253 static int * const rpl_prefix_flags[] = {
3254 &hf_icmpv6_rpl_opt_prefix_flag_l,
3255 &hf_icmpv6_rpl_opt_prefix_flag_a,
3256 &hf_icmpv6_rpl_opt_prefix_flag_r,
3257 &hf_icmpv6_rpl_opt_prefix_flag_rsv,
3258 NULL
3261 /* Prefix length */
3262 proto_tree_add_item_ret_uint(icmp6opt_tree, hf_icmpv6_rpl_opt_prefix_length, tvb, opt_offset, 1, ENC_BIG_ENDIAN, &prefix_len);
3263 opt_offset +=1;
3265 /* Flags */
3266 proto_tree_add_bitmask(icmp6opt_tree, tvb, opt_offset, hf_icmpv6_rpl_opt_prefix_flag,
3267 ett_icmpv6_rpl_flag_prefix, rpl_prefix_flags, ENC_BIG_ENDIAN);
3268 opt_offset += 1;
3270 /* Valid Lifetime */
3271 ti_opt = proto_tree_add_item_ret_uint(icmp6opt_tree, hf_icmpv6_rpl_opt_prefix_vlifetime, tvb, opt_offset, 4, ENC_BIG_ENDIAN, &lifetime);
3272 if (lifetime != LIFETIME_INFINITY) {
3273 proto_item_append_text(ti_opt, " (%s)", unsigned_time_secs_to_str(pinfo->pool, lifetime));
3275 opt_offset += 4;
3277 /* Preferred Lifetime */
3278 ti_opt = proto_tree_add_item_ret_uint(icmp6opt_tree, hf_icmpv6_rpl_opt_prefix_plifetime, tvb, opt_offset, 4, ENC_BIG_ENDIAN, &lifetime);
3279 if (lifetime != LIFETIME_INFINITY) {
3280 proto_item_append_text(ti_opt, " (%s)", unsigned_time_secs_to_str(pinfo->pool, lifetime));
3282 opt_offset += 4;
3284 /* 4 reserved bytes. */
3285 proto_tree_add_item(icmp6opt_tree, hf_icmpv6_rpl_opt_reserved, tvb, opt_offset, 4, ENC_NA);
3286 opt_offset += 4;
3288 /* Prefix */
3289 proto_tree_add_item(icmp6opt_tree, hf_icmpv6_rpl_opt_prefix, tvb, opt_offset, 16, ENC_NA);
3290 proto_item_append_text(ti, " %s/%d", tvb_ip6_to_str(pinfo->pool, tvb, opt_offset), prefix_len);
3291 opt_offset += 16;
3293 break;
3296 case RPL_OPT_TARGETDESC: {
3298 /* Descriptor */
3299 proto_tree_add_item(icmp6opt_tree, hf_icmpv6_rpl_opt_targetdesc, tvb, opt_offset, 4, ENC_BIG_ENDIAN);
3300 opt_offset += 4;
3301 break;
3304 case RPL_OPT_ROUTE_DISCOVERY: {
3305 int num_of_addr = 0;
3306 uint8_t flags = 0, compr = 0, addr_len = 0, lt_mr_nh = 0;
3307 uint8_t addr[16] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };
3309 /* Flags */
3310 ti_opt = proto_tree_add_item(icmp6opt_tree, hf_icmpv6_rpl_opt_route_discovery_flag, tvb, opt_offset, 1, ENC_NA);
3311 flag_tree = proto_item_add_subtree(ti_opt, ett_icmpv6_rpl_route_discovery_flag);
3313 flags = tvb_get_uint8(tvb, opt_offset);
3314 compr = flags & RPL_OPT_ROUTE_DISCOVERY_COMPR;
3316 /* Reply */
3317 ti_opt_reply = proto_tree_add_item(flag_tree, hf_icmpv6_rpl_opt_route_discovery_reply, tvb, opt_offset, 1, ENC_BIG_ENDIAN);
3319 /* Hop-by-Hop */
3320 ti_opt_hop_by_hop = proto_tree_add_item(flag_tree, hf_icmpv6_rpl_opt_route_discovery_hop_by_hop, tvb, opt_offset, 1, ENC_BIG_ENDIAN);
3322 /* Num of Source Routes */
3323 ti_opt_num_of_routes = proto_tree_add_item(flag_tree, hf_icmpv6_rpl_opt_route_discovery_num_of_routes, tvb, opt_offset, 1, ENC_BIG_ENDIAN);
3325 /* Compr */
3326 proto_tree_add_item(flag_tree, hf_icmpv6_rpl_opt_route_discovery_compr, tvb, opt_offset, 1, ENC_BIG_ENDIAN);
3327 opt_offset +=1;
3329 /* Lifetime / MaxRank / NH */
3330 lt_mr_nh = tvb_get_uint8(tvb, opt_offset);
3331 ti_opt_lifetime = proto_tree_add_item(icmp6opt_tree, hf_icmpv6_rpl_opt_route_discovery_lifetime, tvb, opt_offset, 1, ENC_NA);
3333 if ((icmp6_code == ICMP6_RPL_P2P_DRO) || (icmp6_code == ICMP6_RPL_P2P_SDRO)) {
3334 proto_tree_add_item(icmp6opt_tree, hf_icmpv6_rpl_opt_route_discovery_nh, tvb, opt_offset, 1, ENC_NA);
3335 } else {
3336 ti_opt_mr_nh = proto_tree_add_item(icmp6opt_tree, hf_icmpv6_rpl_opt_route_discovery_maxrank, tvb, opt_offset, 1, ENC_NA);
3339 opt_offset +=1;
3341 /* add expert and auxiliary info */
3342 switch (icmp6_code) {
3343 case ICMP6_RPL_P2P_SDRO:
3344 case ICMP6_RPL_P2P_DRO:
3346 if (flags & RPL_OPT_ROUTE_DISCOVERY_R) {
3347 expert_add_info(pinfo, ti_opt_reply, &ei_icmpv6_rpl_p2p_dro_rdo_zero);
3350 if (flags & RPL_OPT_ROUTE_DISCOVERY_N) {
3351 expert_add_info(pinfo, ti_opt_num_of_routes, &ei_icmpv6_rpl_p2p_dro_rdo_zero);
3354 if (lt_mr_nh & RPL_OPT_ROUTE_DISCOVERY_L) {
3355 expert_add_info(pinfo, ti_opt_lifetime, &ei_icmpv6_rpl_p2p_dro_rdo_zero);
3358 break;
3359 default:
3361 if (flags & RPL_OPT_ROUTE_DISCOVERY_H) {
3362 if (!(flags & RPL_OPT_ROUTE_DISCOVERY_R)) {
3363 expert_add_info(pinfo, ti_opt_hop_by_hop, &ei_icmpv6_rpl_p2p_hop_by_hop);
3366 if (flags & RPL_OPT_ROUTE_DISCOVERY_N) {
3367 expert_add_info(pinfo, ti_opt_num_of_routes, &ei_icmpv6_rpl_p2p_num_of_routes);
3371 proto_item_append_text(ti_opt_lifetime, " (%u sec)", pow4(uint32_t, (lt_mr_nh & RPL_OPT_ROUTE_DISCOVERY_L) >> 6));
3373 if (!(lt_mr_nh & RPL_OPT_ROUTE_DISCOVERY_MR_NH)) {
3374 proto_item_append_text(ti_opt_mr_nh, " (Infinity)");
3377 break;
3380 /* TargetAddr */
3381 proto_tree_add_item(icmp6opt_tree, hf_icmpv6_rpl_opt_route_discovery_target_addr, tvb, opt_offset, 16, ENC_NA);
3382 opt_offset +=16;
3384 addr_len = (16 - compr);
3385 num_of_addr = (opt_len - 18) / addr_len;
3387 /* Address Vector */
3388 ti_opt = proto_tree_add_item(icmp6opt_tree, hf_icmpv6_rpl_opt_route_discovery_addr_vec, tvb, opt_offset, (opt_len - 18), ENC_NA);
3389 flag_tree = proto_item_add_subtree(ti_opt, ett_icmpv6_rpl_route_discovery_addr_vec);
3391 proto_item_append_text(flag_tree, " (%d Address%s)", num_of_addr, num_of_addr != 1 ? "es" : "");
3393 while (num_of_addr--) {
3394 memset(addr, 0, sizeof(addr));
3395 tvb_memcpy(tvb, addr + compr, opt_offset, addr_len);
3396 proto_tree_add_ipv6(flag_tree, hf_icmpv6_rpl_opt_route_discovery_addr_vec_addr, tvb, opt_offset, addr_len, (ws_in6_addr *)addr);
3397 opt_offset += addr_len;
3400 break;
3402 default :
3403 expert_add_info_format(pinfo, ti, &ei_icmpv6_undecoded_rpl_option,
3404 "Dissector for ICMPv6 RPL Option"
3405 " (%d) code not implemented, Contact"
3406 " Wireshark developers if you want this supported", opt_type);
3407 proto_tree_add_item(icmp6opt_tree, hf_icmpv6_data, tvb, opt_offset, opt_len, ENC_NA);
3408 opt_offset += opt_len;
3409 break;
3410 } /* switch (opt_type) */
3412 offset += opt_len + 2;
3414 if(offset > opt_offset){
3415 ti_opt = proto_tree_add_item(icmp6opt_tree, hf_icmpv6_unknown_data, tvb, opt_offset, offset - opt_offset, ENC_NA);
3416 expert_add_info(pinfo, ti_opt, &ei_icmpv6_unknown_data);
3419 /* Close the ) to option root label */
3420 proto_item_append_text(ti, ")");
3421 } /* while */
3422 return offset;
3425 static int
3426 dissect_rpl_control(tvbuff_t *tvb, int rpl_offset, packet_info *pinfo _U_, proto_tree *icmp6_tree, uint8_t icmp6_type _U_, uint8_t icmp6_code)
3428 proto_item *ti;
3430 /* Secure RPL ? (ICMP Code start to 0x8x) */
3431 if(icmp6_code & ICMP6_RPL_SECURE)
3433 uint8_t kim, lvl;
3434 static int * const rpl_secure_flags[] = {
3435 &hf_icmpv6_rpl_secure_flag_t,
3436 &hf_icmpv6_rpl_secure_flag_rsv,
3437 NULL
3439 static int * const rpl_secure_flags2[] = {
3440 &hf_icmpv6_rpl_secure_kim,
3441 &hf_icmpv6_rpl_secure_lvl,
3442 &hf_icmpv6_rpl_secure_rsv,
3443 NULL
3446 /* Flags */
3447 proto_tree_add_bitmask(icmp6_tree, tvb, rpl_offset, hf_icmpv6_rpl_secure_flag,
3448 ett_icmpv6_flag_secure, rpl_secure_flags, ENC_BIG_ENDIAN);
3449 rpl_offset += 1;
3451 /* Algorithm */
3452 proto_tree_add_item(icmp6_tree, hf_icmpv6_rpl_secure_algorithm, tvb, rpl_offset, 1, ENC_BIG_ENDIAN);
3453 rpl_offset += 1;
3455 /* KIM & LVL */
3456 proto_tree_add_bitmask(icmp6_tree, tvb, rpl_offset, hf_icmpv6_rpl_secure_flag,
3457 ett_icmpv6_flag_secure, rpl_secure_flags2, ENC_BIG_ENDIAN);
3458 kim = tvb_get_uint8(tvb, rpl_offset) & RPL_SECURE_KIM >> 6;
3459 lvl = tvb_get_uint8(tvb, rpl_offset) & RPL_SECURE_LVL;
3460 rpl_offset += 1;
3462 /* Flags */
3463 proto_tree_add_item(icmp6_tree, hf_icmpv6_rpl_secure_flag, tvb, rpl_offset, 1, ENC_BIG_ENDIAN);
3464 rpl_offset += 1;
3466 /* Counter */
3467 proto_tree_add_item(icmp6_tree, hf_icmpv6_rpl_secure_counter, tvb, rpl_offset, 4, ENC_BIG_ENDIAN);
3468 rpl_offset += 4;
3470 /* Key Identifier */
3471 switch(kim){
3472 case 0:
3474 proto_tree_add_item(icmp6_tree, hf_icmpv6_rpl_secure_key_index, tvb, rpl_offset, 1, ENC_BIG_ENDIAN);
3475 rpl_offset += 1;
3476 break;
3478 case 1:
3480 /* No Key Identifier */
3481 break;
3483 case 2:
3485 proto_tree_add_item(icmp6_tree, hf_icmpv6_rpl_secure_key_source, tvb, rpl_offset, 8, ENC_NA);
3486 rpl_offset += 8;
3487 proto_tree_add_item(icmp6_tree, hf_icmpv6_rpl_secure_key_index, tvb, rpl_offset, 1, ENC_BIG_ENDIAN);
3488 rpl_offset += 1;
3489 break;
3491 case 3:
3493 if(lvl == 1 || lvl == 3)
3495 proto_tree_add_item(icmp6_tree, hf_icmpv6_rpl_secure_key_source, tvb, rpl_offset, 8, ENC_NA);
3496 rpl_offset += 8;
3497 proto_tree_add_item(icmp6_tree, hf_icmpv6_rpl_secure_key_index, tvb, rpl_offset, 1, ENC_BIG_ENDIAN);
3498 rpl_offset += 1;
3500 break;
3506 switch(icmp6_code){
3507 case ICMP6_RPL_DIS: /* DODAG Information Solicitation (0) */
3508 case ICMP6_RPL_SDIS: /* Secure DODAG Information Solicitation (128) */
3510 /* Flags */
3511 proto_tree_add_item(icmp6_tree, hf_icmpv6_rpl_dis_flag, tvb, rpl_offset, 1, ENC_BIG_ENDIAN);
3512 rpl_offset += 1;
3514 /* Reserved */
3515 proto_tree_add_item(icmp6_tree, hf_icmpv6_reserved, tvb, rpl_offset, 1, ENC_NA);
3516 rpl_offset += 1;
3518 /* RPL Options */
3519 rpl_offset = dissect_icmpv6_rpl_opt(tvb, rpl_offset, pinfo, icmp6_tree, icmp6_code);
3520 break;
3522 case ICMP6_RPL_DIO: /* DODAG Information Object (1) */
3523 case ICMP6_RPL_SDIO: /* Secure DODAG Information Object (129) */
3525 static int * const rpl_dio_flags[] = {
3526 &hf_icmpv6_rpl_dio_flag_g,
3527 &hf_icmpv6_rpl_dio_flag_0,
3528 &hf_icmpv6_rpl_dio_flag_mop,
3529 &hf_icmpv6_rpl_dio_flag_prf,
3530 NULL
3533 /* RPLInstanceID */
3534 proto_tree_add_item(icmp6_tree, hf_icmpv6_rpl_dio_instance, tvb, rpl_offset, 1, ENC_BIG_ENDIAN);
3535 rpl_offset += 1;
3537 /* Version Number */
3538 proto_tree_add_item(icmp6_tree, hf_icmpv6_rpl_dio_version, tvb, rpl_offset, 1, ENC_BIG_ENDIAN);
3539 rpl_offset += 1;
3541 /* Rank */
3542 proto_tree_add_item(icmp6_tree, hf_icmpv6_rpl_dio_rank, tvb, rpl_offset, 2, ENC_BIG_ENDIAN);
3543 rpl_offset += 2;
3545 /* Flags */
3546 proto_tree_add_bitmask(icmp6_tree, tvb, rpl_offset, hf_icmpv6_rpl_dio_flag,
3547 ett_icmpv6_flag_rpl_dio, rpl_dio_flags, ENC_BIG_ENDIAN);
3548 rpl_offset += 1;
3550 /* Destination Advertisement Trigger Sequence Number (DTSN) */
3551 proto_tree_add_item(icmp6_tree, hf_icmpv6_rpl_dio_dtsn, tvb, rpl_offset, 1, ENC_BIG_ENDIAN);
3552 rpl_offset += 1;
3554 /* Flags */
3555 proto_tree_add_item(icmp6_tree, hf_icmpv6_rpl_dio_flag, tvb, rpl_offset, 1, ENC_BIG_ENDIAN);
3556 rpl_offset += 1;
3558 /* Reserved */
3559 proto_tree_add_item(icmp6_tree, hf_icmpv6_reserved, tvb, rpl_offset, 1, ENC_NA);
3560 rpl_offset += 1;
3562 /* DODAGID */
3563 proto_tree_add_item(icmp6_tree, hf_icmpv6_rpl_dio_dagid, tvb, rpl_offset, 16, ENC_NA);
3564 rpl_offset += 16;
3566 /* RPL Options */
3567 rpl_offset = dissect_icmpv6_rpl_opt(tvb, rpl_offset, pinfo, icmp6_tree, icmp6_code);
3568 break;
3570 case ICMP6_RPL_DAO: /* Destination Advertisement Object (2) */
3571 case ICMP6_RPL_SDAO: /* Secure Destination Advertisement Object (130) */
3573 uint8_t flags;
3574 static int * const rpl_dao_flags[] = {
3575 &hf_icmpv6_rpl_dao_flag_k,
3576 &hf_icmpv6_rpl_dao_flag_d,
3577 &hf_icmpv6_rpl_dao_flag_rsv,
3578 NULL
3581 /* DAO Instance */
3582 proto_tree_add_item(icmp6_tree, hf_icmpv6_rpl_dao_instance, tvb, rpl_offset, 1, ENC_BIG_ENDIAN);
3583 rpl_offset += 1;
3585 /* Flags */
3586 proto_tree_add_bitmask(icmp6_tree, tvb, rpl_offset, hf_icmpv6_rpl_dao_flag,
3587 ett_icmpv6_flag_rpl_dao, rpl_dao_flags, ENC_BIG_ENDIAN);
3588 flags = tvb_get_uint8(tvb, rpl_offset);
3589 rpl_offset += 1;
3591 /* Reserved */
3592 proto_tree_add_item(icmp6_tree, hf_icmpv6_reserved, tvb, rpl_offset, 1, ENC_NA);
3593 rpl_offset += 1;
3595 /* Sequence */
3596 proto_tree_add_item(icmp6_tree, hf_icmpv6_rpl_dao_sequence, tvb, rpl_offset, 1, ENC_BIG_ENDIAN);
3597 rpl_offset += 1;
3599 /* DODAGID */
3600 if(flags & RPL_DAO_FLAG_D)
3602 proto_tree_add_item(icmp6_tree, hf_icmpv6_rpl_dao_dodagid, tvb, rpl_offset, 16, ENC_NA);
3603 rpl_offset += 16;
3605 /* Options */
3606 rpl_offset = dissect_icmpv6_rpl_opt(tvb, rpl_offset, pinfo, icmp6_tree, icmp6_code);
3607 break;
3609 case ICMP6_RPL_DAOACK: /* Destination Advertisement Object Acknowledgment (3) */
3610 case ICMP6_RPL_SDAOACK: /* Secure Destination Advertisement Object Acknowledgment (131) */
3612 uint8_t flags;
3613 static int * const rpl_daoack_flags[] = {
3614 &hf_icmpv6_rpl_daoack_flag_d,
3615 &hf_icmpv6_rpl_daoack_flag_rsv,
3616 NULL
3619 /* DAO Instance */
3620 proto_tree_add_item(icmp6_tree, hf_icmpv6_rpl_daoack_instance, tvb, rpl_offset, 1, ENC_BIG_ENDIAN);
3621 rpl_offset += 1;
3623 /* Flags */
3624 proto_tree_add_bitmask(icmp6_tree, tvb, rpl_offset, hf_icmpv6_rpl_daoack_flag,
3625 ett_icmpv6_flag_rpl_daoack, rpl_daoack_flags, ENC_BIG_ENDIAN);
3626 flags = tvb_get_uint8(tvb, rpl_offset);
3627 rpl_offset += 1;
3629 /* DAO Sequence */
3630 proto_tree_add_item(icmp6_tree, hf_icmpv6_rpl_daoack_sequence, tvb, rpl_offset, 1, ENC_BIG_ENDIAN);
3631 rpl_offset += 1;
3633 /* Status */
3634 proto_tree_add_item(icmp6_tree, hf_icmpv6_rpl_daoack_status, tvb, rpl_offset, 1, ENC_BIG_ENDIAN);
3635 rpl_offset += 1;
3637 /* DODAGID */
3638 if(flags & RPL_DAOACK_FLAG_D)
3640 proto_tree_add_item(icmp6_tree, hf_icmpv6_rpl_daoack_dodagid, tvb, rpl_offset, 16, ENC_NA);
3641 rpl_offset += 16;
3644 /* Options */
3645 rpl_offset = dissect_icmpv6_rpl_opt(tvb, rpl_offset, pinfo, icmp6_tree, icmp6_code);
3646 break;
3648 case ICMP6_RPL_CC:
3650 static int * const rpl_cc_flags[] = {
3651 &hf_icmpv6_rpl_cc_flag_r,
3652 &hf_icmpv6_rpl_cc_flag_rsv,
3653 NULL
3656 /* CC Instance */
3657 proto_tree_add_item(icmp6_tree, hf_icmpv6_rpl_cc_instance, tvb, rpl_offset, 1, ENC_BIG_ENDIAN);
3658 rpl_offset += 1;
3660 /* Flags */
3661 proto_tree_add_bitmask(icmp6_tree, tvb, rpl_offset, hf_icmpv6_rpl_cc_flag,
3662 ett_icmpv6_flag_rpl_cc, rpl_cc_flags, ENC_BIG_ENDIAN);
3663 rpl_offset += 1;
3665 /* CC Nonce */
3666 proto_tree_add_item(icmp6_tree, hf_icmpv6_rpl_cc_nonce, tvb, rpl_offset, 2, ENC_BIG_ENDIAN);
3667 rpl_offset += 2;
3669 /* DODAGID */
3670 proto_tree_add_item(icmp6_tree, hf_icmpv6_rpl_cc_dodagid, tvb, rpl_offset, 16, ENC_NA);
3671 rpl_offset += 16;
3673 /* Destination Counter */
3674 proto_tree_add_item(icmp6_tree, hf_icmpv6_rpl_cc_destination_counter, tvb, rpl_offset, 4, ENC_BIG_ENDIAN);
3675 rpl_offset += 4;
3677 /* Options */
3678 rpl_offset = dissect_icmpv6_rpl_opt(tvb, rpl_offset, pinfo, icmp6_tree, icmp6_code);
3679 break;
3681 case ICMP6_RPL_P2P_DRO: /* P2P Discovery Reply Object (0x4) */
3682 case ICMP6_RPL_P2P_SDRO: /* Secure P2P Discovery Reply Object (0x84) */
3684 static int * const rpl_p2p_dro_flags[] = {
3685 &hf_icmpv6_rpl_p2p_dro_flag_stop,
3686 &hf_icmpv6_rpl_p2p_dro_flag_ack,
3687 &hf_icmpv6_rpl_p2p_dro_flag_seq,
3688 &hf_icmpv6_rpl_p2p_dro_flag_reserved,
3689 NULL
3692 /* RPLInstanceID */
3693 proto_tree_add_item(icmp6_tree, hf_icmpv6_rpl_p2p_dro_instance, tvb, rpl_offset, 1, ENC_BIG_ENDIAN);
3694 rpl_offset += 1;
3696 /* Version Number */
3697 ti = proto_tree_add_item(icmp6_tree, hf_icmpv6_rpl_p2p_dro_version, tvb, rpl_offset, 1, ENC_BIG_ENDIAN);
3698 if (tvb_get_uint8(tvb, rpl_offset)) {
3699 expert_add_info(pinfo, ti, &ei_icmpv6_rpl_p2p_dro_zero);
3701 rpl_offset += 1;
3703 /* Flags */
3704 proto_tree_add_bitmask(icmp6_tree, tvb, rpl_offset, hf_icmpv6_rpl_p2p_dro_flag,
3705 ett_icmpv6_rpl_p2p_dro_flag, rpl_p2p_dro_flags, ENC_BIG_ENDIAN);
3706 rpl_offset += 2;
3708 /* DODAGID */
3709 proto_tree_add_item(icmp6_tree, hf_icmpv6_rpl_p2p_dro_dagid, tvb, rpl_offset, 16, ENC_NA);
3710 rpl_offset += 16;
3712 /* RPL Options */
3713 rpl_offset = dissect_icmpv6_rpl_opt(tvb, rpl_offset, pinfo, icmp6_tree, icmp6_code);
3714 break;
3716 case ICMP6_RPL_P2P_DROACK: /* P2P Discovery Reply Object Acknowledgement (0x5) */
3717 case ICMP6_RPL_P2P_SDROACK: /* Secure P2P Discovery Reply Object Acknowledgement (0x85) */
3719 static int * const rpl_p2p_droack_flags[] = {
3720 &hf_icmpv6_rpl_p2p_droack_flag_seq,
3721 &hf_icmpv6_rpl_p2p_droack_flag_reserved,
3722 NULL
3725 /* RPLInstanceID */
3726 proto_tree_add_item(icmp6_tree, hf_icmpv6_rpl_p2p_dro_instance, tvb, rpl_offset, 1, ENC_BIG_ENDIAN);
3727 rpl_offset += 1;
3729 /* Version Number */
3730 ti = proto_tree_add_item(icmp6_tree, hf_icmpv6_rpl_p2p_dro_version, tvb, rpl_offset, 1, ENC_BIG_ENDIAN);
3731 if (tvb_get_uint8(tvb, rpl_offset)) {
3732 expert_add_info(pinfo, ti, &ei_icmpv6_rpl_p2p_dro_zero);
3734 rpl_offset += 1;
3736 /* Flags */
3737 proto_tree_add_bitmask(icmp6_tree, tvb, rpl_offset, hf_icmpv6_rpl_p2p_droack_flag,
3738 ett_icmpv6_rpl_p2p_droack_flag, rpl_p2p_droack_flags, ENC_BIG_ENDIAN);
3739 rpl_offset += 2;
3741 /* DODAGID */
3742 proto_tree_add_item(icmp6_tree, hf_icmpv6_rpl_p2p_dro_dagid, tvb, rpl_offset, 16, ENC_NA);
3743 rpl_offset += 16;
3744 break;
3748 return rpl_offset;
3750 /* RFC 4620 - IPv6 Node Information Queries */
3752 static int
3753 dissect_nodeinfo(tvbuff_t *tvb, int ni_offset, packet_info *pinfo _U_, proto_tree *tree, uint8_t icmp6_type, uint8_t icmp6_code)
3755 uint16_t qtype;
3756 unsigned used_bytes;
3757 static int * const ni_flags[] = {
3758 &hf_icmpv6_ni_flag_g,
3759 &hf_icmpv6_ni_flag_s,
3760 &hf_icmpv6_ni_flag_l,
3761 &hf_icmpv6_ni_flag_c,
3762 &hf_icmpv6_ni_flag_a,
3763 &hf_icmpv6_ni_flag_t,
3764 &hf_icmpv6_ni_flag_rsv,
3765 NULL
3768 /* Qtype */
3769 proto_tree_add_item(tree, hf_icmpv6_ni_qtype, tvb, ni_offset, 2, ENC_BIG_ENDIAN);
3770 qtype = tvb_get_ntohs(tvb, ni_offset);
3771 ni_offset += 2;
3773 /* Flags */
3774 proto_tree_add_bitmask(tree, tvb, ni_offset, hf_icmpv6_ni_flag,
3775 ett_icmpv6_flag_ni, ni_flags, ENC_BIG_ENDIAN);
3776 ni_offset += 2;
3778 /* Nonce */
3779 proto_tree_add_item(tree, hf_icmpv6_ni_nonce, tvb, ni_offset, 8, ENC_BIG_ENDIAN);
3780 ni_offset += 8;
3782 /* Data ? */
3783 if(tvb_reported_length_remaining(tvb, ni_offset) == 0){
3784 return ni_offset;
3787 if(icmp6_type == ICMP6_NI_QUERY){
3788 switch(icmp6_code){
3789 case ICMP6_NI_SUBJ_IPV6: {
3790 proto_tree_add_item(tree, hf_icmpv6_ni_query_subject_ipv6, tvb, ni_offset, 16, ENC_NA);
3791 ni_offset += 16;
3792 break;
3794 case ICMP6_NI_SUBJ_FQDN: {
3795 int fqdn_len;
3796 const char *fqdn_name;
3797 used_bytes = get_dns_name(tvb, ni_offset, 0, ni_offset, &fqdn_name, &fqdn_len);
3798 proto_tree_add_string(tree, hf_icmpv6_ni_query_subject_fqdn, tvb, ni_offset, used_bytes,
3799 format_text(pinfo->pool, fqdn_name, fqdn_len));
3800 ni_offset += used_bytes;
3801 break;
3803 case ICMP6_NI_SUBJ_IPV4: {
3804 proto_tree_add_item(tree, hf_icmpv6_ni_query_subject_ipv4, tvb, ni_offset, 4, ENC_BIG_ENDIAN);
3805 ni_offset += 4;
3806 break;
3809 } else { /* It is ICMP6_NI_REPLY */
3810 switch(qtype){
3811 case NI_QTYPE_NOOP:
3812 break;
3813 case NI_QTYPE_NODENAME: {
3814 int node_name_len;
3815 const char *node_name;
3816 /* TTL */
3817 proto_tree_add_item(tree, hf_icmpv6_ni_reply_node_ttl, tvb, ni_offset, 4, ENC_BIG_ENDIAN);
3818 ni_offset += 4;
3819 /* Data ? */
3820 if(tvb_reported_length_remaining(tvb, ni_offset) == 0){
3821 return ni_offset;
3823 while(ni_offset < (int)tvb_reported_length(tvb) ) {
3825 if(tvb_get_uint8(tvb, ni_offset) == 0){ /* if Zero there is padding, skip the loop */
3826 break;
3828 /* Node Name */
3829 used_bytes = get_dns_name(tvb, ni_offset, 0, ni_offset, &node_name, &node_name_len);
3830 proto_tree_add_string(tree, hf_icmpv6_ni_reply_node_name, tvb, ni_offset, used_bytes,
3831 format_text(pinfo->pool, node_name, node_name_len));
3832 ni_offset += used_bytes;
3834 break;
3836 case NI_QTYPE_NODEADDR: {
3837 while(ni_offset < (int)tvb_reported_length(tvb) ) {
3838 /* TTL */
3839 proto_tree_add_item(tree, hf_icmpv6_ni_reply_node_ttl, tvb, ni_offset, 4, ENC_BIG_ENDIAN);
3840 ni_offset += 4;
3841 /* Node Addresses */
3842 proto_tree_add_item(tree, hf_icmpv6_ni_reply_node_address, tvb, ni_offset, 16, ENC_NA);
3843 ni_offset += 16;
3845 break;
3847 case NI_QTYPE_IPV4ADDR: {
3848 while(ni_offset < (int)tvb_reported_length(tvb) ) {
3849 /* TTL */
3850 proto_tree_add_item(tree, hf_icmpv6_ni_reply_node_ttl, tvb, ni_offset, 4, ENC_BIG_ENDIAN);
3851 ni_offset += 4;
3852 /* IPv4 Address */
3853 proto_tree_add_item(tree, hf_icmpv6_ni_reply_ipv4_address, tvb, ni_offset, 4, ENC_BIG_ENDIAN);
3854 ni_offset += 4;
3856 break;
3860 return ni_offset;
3862 /* RFC 2894 - Router Renumbering for IPv6 */
3864 static int
3865 dissect_rrenum(tvbuff_t *tvb, int rr_offset, packet_info *pinfo, proto_tree *tree, uint8_t icmp6_type _U_, uint8_t icmp6_code)
3867 proto_tree *mp_tree, *up_tree, *rm_tree;
3868 proto_item *ti, *ti_mp, *ti_up, *ti_rm;
3869 static int * const rr_flags[] = {
3870 &hf_icmpv6_rr_flag_t,
3871 &hf_icmpv6_rr_flag_r,
3872 &hf_icmpv6_rr_flag_a,
3873 &hf_icmpv6_rr_flag_s,
3874 &hf_icmpv6_rr_flag_p,
3875 &hf_icmpv6_rr_flag_rsv,
3876 NULL
3879 /* Sequence Number */
3880 proto_tree_add_item(tree, hf_icmpv6_rr_sequencenumber, tvb, rr_offset, 4, ENC_BIG_ENDIAN);
3881 rr_offset += 4;
3883 /* Segment Number */
3884 proto_tree_add_item(tree, hf_icmpv6_rr_segmentnumber, tvb, rr_offset, 1, ENC_BIG_ENDIAN);
3885 rr_offset += 1;
3887 /* Flags */
3888 proto_tree_add_bitmask(tree, tvb, rr_offset, hf_icmpv6_rr_flag,
3889 ett_icmpv6_flag_rr, rr_flags, ENC_BIG_ENDIAN);
3890 rr_offset += 1;
3892 /* Max Delay */
3893 proto_tree_add_item(tree, hf_icmpv6_rr_maxdelay, tvb, rr_offset, 2, ENC_BIG_ENDIAN);
3894 rr_offset += 2;
3896 /* Reserved */
3897 proto_tree_add_item(tree, hf_icmpv6_reserved, tvb, rr_offset, 4, ENC_NA);
3898 rr_offset += 4;
3900 /* Data ? */
3901 if(tvb_reported_length_remaining(tvb, rr_offset) == 0){
3902 return rr_offset;
3905 if(icmp6_code == ICMP6_ROUTER_RENUMBERING_COMMAND){
3906 /* Match-Prefix Part */
3907 uint8_t opcode, matchlen, minlen, maxlen;
3909 ti_mp = proto_tree_add_item(tree, hf_icmpv6_rr_pco_mp_part, tvb, rr_offset, 24, ENC_NA);
3910 mp_tree = proto_item_add_subtree(ti_mp, ett_icmpv6_rr_mp);
3912 /* OpCode */
3913 proto_tree_add_item(mp_tree, hf_icmpv6_rr_pco_mp_opcode, tvb, rr_offset, 1, ENC_BIG_ENDIAN);
3914 opcode = tvb_get_uint8(tvb, rr_offset);
3915 rr_offset += 1;
3917 /* OpLength */
3918 proto_tree_add_item(mp_tree, hf_icmpv6_rr_pco_mp_oplength, tvb, rr_offset, 1, ENC_BIG_ENDIAN);
3919 rr_offset += 1;
3921 /* Ordinal */
3922 proto_tree_add_item(mp_tree, hf_icmpv6_rr_pco_mp_ordinal, tvb, rr_offset, 1, ENC_BIG_ENDIAN);
3923 rr_offset += 1;
3925 /* MatchLen */
3926 ti = proto_tree_add_item(mp_tree, hf_icmpv6_rr_pco_mp_matchlen, tvb, rr_offset, 1, ENC_BIG_ENDIAN);
3927 matchlen = tvb_get_uint8(tvb, rr_offset);
3928 if (matchlen > 128) {
3929 expert_add_info(pinfo, ti, &ei_icmpv6_rr_pco_mp_matchlen);
3931 rr_offset += 1;
3933 /* MinLen */
3934 proto_tree_add_item(mp_tree, hf_icmpv6_rr_pco_mp_minlen, tvb, rr_offset, 1, ENC_BIG_ENDIAN);
3935 minlen = tvb_get_uint8(tvb, rr_offset);
3936 rr_offset += 1;
3938 /* MaxLen */
3939 proto_tree_add_item(mp_tree, hf_icmpv6_rr_pco_mp_maxlen, tvb, rr_offset, 1, ENC_BIG_ENDIAN);
3940 maxlen = tvb_get_uint8(tvb, rr_offset);
3941 rr_offset += 1;
3943 /* Reserved */
3944 proto_tree_add_item(mp_tree, hf_icmpv6_reserved, tvb, rr_offset, 2, ENC_NA);
3945 rr_offset += 2;
3947 /* Match Prefix */
3948 proto_tree_add_item(mp_tree, hf_icmpv6_rr_pco_mp_matchprefix, tvb, rr_offset, 16, ENC_NA);
3950 /* Add Info (Prefix, Length...) to Match Prefix Part label */
3951 proto_item_append_text(ti_mp, ": %s %s/%u (%u-%u)", val_to_str(opcode, rr_pco_mp_opcode_val, "Unknown %d"), tvb_ip6_to_str(pinfo->pool, tvb, rr_offset), matchlen, minlen, maxlen);
3952 rr_offset += 16;
3954 while ((int)tvb_reported_length(tvb) > rr_offset) {
3955 /* Use-Prefix Part */
3956 uint8_t uselen, keeplen;
3957 uint32_t lifetime;
3958 static int * const mask_flags[] = {
3959 &hf_icmpv6_rr_pco_up_flagmask_l,
3960 &hf_icmpv6_rr_pco_up_flagmask_a,
3961 &hf_icmpv6_rr_pco_up_flagmask_reserved,
3962 NULL
3964 static int * const ra_flags[] = {
3965 &hf_icmpv6_rr_pco_up_raflags_l,
3966 &hf_icmpv6_rr_pco_up_raflags_a,
3967 &hf_icmpv6_rr_pco_up_raflags_reserved,
3968 NULL
3970 static int * const up_flags[] = {
3971 &hf_icmpv6_rr_pco_up_flag_v,
3972 &hf_icmpv6_rr_pco_up_flag_p,
3973 &hf_icmpv6_rr_pco_up_flag_reserved,
3974 NULL
3977 ti_up = proto_tree_add_item(tree, hf_icmpv6_rr_pco_up_part, tvb, rr_offset, 32, ENC_NA);
3978 up_tree = proto_item_add_subtree(ti_up, ett_icmpv6_rr_up);
3980 /* UseLen */
3981 proto_tree_add_item(up_tree, hf_icmpv6_rr_pco_up_uselen, tvb, rr_offset, 1, ENC_BIG_ENDIAN);
3982 uselen = tvb_get_uint8(tvb, rr_offset);
3983 rr_offset += 1;
3985 /* KeepLen */
3986 proto_tree_add_item(up_tree, hf_icmpv6_rr_pco_up_keeplen, tvb, rr_offset, 1, ENC_BIG_ENDIAN);
3987 keeplen = tvb_get_uint8(tvb, rr_offset);
3988 rr_offset += 1;
3990 /* FlagMask */
3991 proto_tree_add_bitmask(up_tree, tvb, rr_offset, hf_icmpv6_rr_pco_up_flagmask, ett_icmpv6_rr_up_flag_mask, mask_flags, ENC_BIG_ENDIAN);
3992 rr_offset += 1;
3994 /* RaFlags */
3995 proto_tree_add_bitmask(up_tree, tvb, rr_offset, hf_icmpv6_rr_pco_up_raflags, ett_icmpv6_rr_up_flag_ra, ra_flags, ENC_BIG_ENDIAN);
3996 rr_offset += 1;
3998 /* Valid Lifetime */
3999 ti = proto_tree_add_item_ret_uint(up_tree, hf_icmpv6_rr_pco_up_validlifetime, tvb, rr_offset, 4, ENC_BIG_ENDIAN, &lifetime);
4000 if (lifetime != LIFETIME_INFINITY) {
4001 proto_item_append_text(ti, " (%s)", unsigned_time_secs_to_str(pinfo->pool, lifetime));
4003 rr_offset += 4;
4005 /* Preferred Lifetime */
4006 ti = proto_tree_add_item_ret_uint(up_tree, hf_icmpv6_rr_pco_up_preferredlifetime, tvb, rr_offset, 4, ENC_BIG_ENDIAN, &lifetime);
4007 if (lifetime != LIFETIME_INFINITY) {
4008 proto_item_append_text(ti, " (%s)", unsigned_time_secs_to_str(pinfo->pool, lifetime));
4010 rr_offset += 4;
4012 /* Flags */
4013 proto_tree_add_bitmask(up_tree, tvb, rr_offset, hf_icmpv6_rr_pco_up_flag, ett_icmpv6_rr_up_flag, up_flags, ENC_BIG_ENDIAN);
4014 rr_offset += 4;
4016 /* UsePrefix */
4017 proto_tree_add_item(up_tree, hf_icmpv6_rr_pco_up_useprefix, tvb, rr_offset, 16, ENC_NA);
4019 /* Add Info (Prefix, Length...) to Use Prefix Part label */
4020 proto_item_append_text(ti_up, ": %s/%u (keep %u)", tvb_ip6_to_str(pinfo->pool, tvb, rr_offset), uselen, keeplen);
4021 rr_offset += 16;
4024 }else if(icmp6_code == ICMP6_ROUTER_RENUMBERING_RESULT){
4025 while ((int)tvb_reported_length(tvb) > rr_offset) {
4026 uint8_t matchlen;
4027 uint32_t interfaceindex;
4028 static int * const rm_flags[] = {
4029 &hf_icmpv6_rr_rm_flag_reserved,
4030 &hf_icmpv6_rr_rm_flag_b,
4031 &hf_icmpv6_rr_rm_flag_f,
4032 NULL
4034 /* Result Message */
4036 ti_rm = proto_tree_add_item(tree, hf_icmpv6_rr_rm, tvb, rr_offset, 24, ENC_NA);
4037 rm_tree = proto_item_add_subtree(ti_rm, ett_icmpv6_rr_rm);
4039 /* Flags */
4040 proto_tree_add_bitmask(rm_tree, tvb, rr_offset, hf_icmpv6_rr_rm_flag, ett_icmpv6_rr_rm_flag, rm_flags, ENC_BIG_ENDIAN);
4041 rr_offset +=2;
4043 /* Ordinal */
4044 proto_tree_add_item(rm_tree, hf_icmpv6_rr_rm_ordinal, tvb, rr_offset, 1, ENC_BIG_ENDIAN);
4045 rr_offset +=1;
4047 /* MatchLen */
4048 ti = proto_tree_add_item(rm_tree, hf_icmpv6_rr_rm_matchedlen, tvb, rr_offset, 1, ENC_BIG_ENDIAN);
4049 matchlen = tvb_get_uint8(tvb, rr_offset);
4050 if (matchlen > 128) {
4051 expert_add_info(pinfo, ti, &ei_icmpv6_rr_pco_mp_matchedlen);
4053 rr_offset +=1;
4055 /* InterfaceIndex */
4056 proto_tree_add_item(rm_tree, hf_icmpv6_rr_rm_interfaceindex, tvb, rr_offset, 4, ENC_BIG_ENDIAN);
4057 interfaceindex = tvb_get_ntohl(tvb, rr_offset);
4058 rr_offset +=4;
4060 /* MatchedPrefix */
4061 proto_tree_add_item(rm_tree, hf_icmpv6_rr_rm_matchedprefix, tvb, rr_offset, 16, ENC_NA);
4063 /* Add Info (Prefix, Length...) to Use Resultant Message label */
4064 proto_item_append_text(ti_rm, ": %s/%u (interface %u)", tvb_ip6_to_str(pinfo->pool, tvb, rr_offset), matchlen, interfaceindex);
4065 rr_offset +=16;
4068 return rr_offset;
4072 static int
4073 dissect_mldrv2( tvbuff_t *tvb, uint32_t offset, packet_info *pinfo _U_, proto_tree *tree )
4075 proto_tree *mar_tree;
4076 proto_item *ti_mar;
4077 int mldr_offset = offset;
4079 /* Reserved */
4080 proto_tree_add_item(tree, hf_icmpv6_reserved, tvb, mldr_offset, 2, ENC_NA );
4081 mldr_offset += 2;
4083 /* Nr of Mcast Address Records (M) */
4084 proto_tree_add_item(tree, hf_icmpv6_mldr_nb_mcast_records, tvb, mldr_offset, 2, ENC_BIG_ENDIAN );
4085 mldr_offset += 2;
4087 /* Multicast Address Record */
4088 while(mldr_offset < (int)tvb_reported_length(tvb) ) {
4089 uint8_t aux_data_len, record_type;
4090 uint16_t i, nb_sources;
4092 ti_mar = proto_tree_add_item(tree, hf_icmpv6_mldr_mar, tvb, mldr_offset, -1, ENC_NA);
4093 mar_tree = proto_item_add_subtree(ti_mar, ett_icmpv6_mar);
4095 /* Record Type */
4096 proto_tree_add_item(mar_tree, hf_icmpv6_mldr_mar_record_type, tvb, mldr_offset, 1, ENC_BIG_ENDIAN);
4097 record_type = tvb_get_uint8(tvb, mldr_offset);
4098 mldr_offset += 1;
4100 /* Aux Data Len */
4101 proto_tree_add_item(mar_tree, hf_icmpv6_mldr_mar_aux_data_len, tvb, mldr_offset, 1, ENC_BIG_ENDIAN);
4102 aux_data_len = tvb_get_uint8(tvb, mldr_offset);
4103 mldr_offset += 1;
4105 /* Number of Sources (N) */
4106 proto_tree_add_item(mar_tree, hf_icmpv6_mldr_mar_nb_sources, tvb, mldr_offset, 2, ENC_BIG_ENDIAN);
4107 nb_sources = tvb_get_ntohs(tvb, mldr_offset);
4108 mldr_offset += 2;
4110 /* Multicast Address */
4111 proto_tree_add_item(mar_tree, hf_icmpv6_mldr_mar_multicast_address, tvb, mldr_offset, 16, ENC_NA);
4112 proto_item_append_text(ti_mar, " %s: %s", val_to_str(record_type, mldr_record_type_val,"Unknown Record Type (%d)"), tvb_ip6_to_str(pinfo->pool, tvb, mldr_offset));
4113 mldr_offset += 16;
4115 /* Source Address */
4116 for (i=0; i < nb_sources; i++){
4117 proto_tree_add_item(mar_tree, hf_icmpv6_mldr_mar_source_address, tvb, mldr_offset, 16, ENC_NA);
4118 mldr_offset += 16;
4121 /* Auxiliary Data ? */
4122 if(aux_data_len)
4124 proto_tree_add_item(mar_tree, hf_icmpv6_mldr_mar_auxiliary_data, tvb, mldr_offset, aux_data_len * 4, ENC_NA);
4125 mldr_offset += aux_data_len * 4;
4128 /* Multicast Address Record Length */
4129 proto_item_set_len(ti_mar, 4 + 16 + (16 * nb_sources) + (aux_data_len * 4));
4132 return mldr_offset;
4135 static int
4136 dissect_mpl_control(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree, uint8_t type _U_, uint8_t code)
4138 proto_tree *seed_info_tree, *bm_tree;
4139 proto_item *ti;
4140 const int length_of_fixed_part = 2;
4141 int body_offset = offset;
4142 uint8_t min_seqno, bm_len, s;
4143 int remaining, id_len = 0;
4144 uint16_t seed_info_index = 0;
4145 char *seed_id = NULL;
4146 int i, j;
4147 uint8_t b;
4149 if (code != 0) {
4150 /* code must be 0 */
4151 ti = proto_tree_add_item(tree, hf_icmpv6_unknown_data, tvb, body_offset, 1, ENC_NA);
4152 expert_add_info_format(pinfo, ti, &ei_icmpv6_unknown_data, "Code must be 0");
4153 return body_offset;
4156 remaining = tvb_captured_length_remaining(tvb, body_offset);
4157 while (remaining >= length_of_fixed_part) {
4158 seed_info_index++;
4160 seed_info_tree = proto_tree_add_subtree_format(tree, tvb, body_offset, length_of_fixed_part, ett_icmpv6_mpl_seed_info, NULL,
4161 "MPL Seed Info: [%u]", seed_info_index);
4163 min_seqno = tvb_get_uint8(tvb, body_offset);
4164 proto_tree_add_item(seed_info_tree, hf_icmpv6_mpl_seed_info_min_sequence, tvb, body_offset, 1, ENC_BIG_ENDIAN);
4165 body_offset++;
4167 bm_len = tvb_get_uint8(tvb, body_offset) >> 2;
4168 s = tvb_get_uint8(tvb, body_offset) & 0x03;
4169 proto_tree_add_item(seed_info_tree, hf_icmpv6_mpl_seed_info_bm_len, tvb, body_offset, 1, ENC_BIG_ENDIAN);
4170 proto_tree_add_item(seed_info_tree, hf_icmpv6_mpl_seed_info_s, tvb, body_offset, 1, ENC_BIG_ENDIAN);
4171 body_offset++;
4173 id_len = mpl_seed_id_code_to_length[s];
4174 if ((remaining - length_of_fixed_part) < id_len) {
4175 /* Invalid length; remaining data is too short for Seed ID */
4176 ti = proto_tree_add_item(seed_info_tree, hf_icmpv6_unknown_data, tvb, body_offset,
4177 remaining - length_of_fixed_part, ENC_NA);
4178 expert_add_info_format(pinfo, ti, &ei_icmpv6_unknown_data,
4179 "Remaining data, %u bytes, is too short for Seed ID of %u bytes",
4180 remaining - length_of_fixed_part, id_len);
4181 return remaining - length_of_fixed_part;
4183 switch (s) {
4184 case 0:
4185 seed_id = address_to_str(pinfo->pool, &pinfo->src);
4186 break;
4187 case 1:
4188 seed_id = wmem_strdup_printf(pinfo->pool, "%04x", tvb_get_ntohs(tvb, body_offset));
4189 break;
4190 case 2:
4191 seed_id = tvb_eui64_to_str(pinfo->pool, tvb, body_offset);
4192 break;
4193 case 3:
4194 seed_id = tvb_ip6_to_str(pinfo->pool, tvb, body_offset);
4195 break;
4196 default:
4197 /* not reached */
4198 break;
4200 proto_tree_add_string(seed_info_tree, hf_icmpv6_mpl_seed_info_seed_id, tvb, body_offset, id_len, seed_id);
4201 body_offset += id_len;
4203 if((remaining - length_of_fixed_part - id_len) < bm_len) {
4204 /* Invalid length; remaining data is too short for Buffered Messages */
4205 ti = proto_tree_add_item(seed_info_tree, hf_icmpv6_unknown_data, tvb, body_offset,
4206 remaining - length_of_fixed_part - id_len, ENC_NA);
4207 expert_add_info_format(pinfo, ti, &ei_icmpv6_unknown_data,
4208 "Remaining data, %u bytes, is too short for Buffered Messages of %u bytes",
4209 remaining - length_of_fixed_part - id_len, bm_len);
4210 return body_offset - length_of_fixed_part - id_len;
4213 if (bm_len > 0) {
4214 bm_tree = proto_tree_add_subtree_format(seed_info_tree, tvb, body_offset, bm_len, ett_icmpv6_mpl_seed_info_bm, NULL,
4215 "Buffered Messages");
4216 for (i = 0; i < bm_len; i++) {
4217 b = tvb_get_uint8(tvb, body_offset + i);
4218 for (j = 0; j < 8; j++) {
4219 if (b & (0x80 >> j)) {
4220 /* From RFC 1982: s' = (s + n) modulo (2 ^ SERIAL_BITS), where SERIAL_BITS is 8 */
4221 proto_tree_add_uint(bm_tree, hf_icmpv6_mpl_seed_info_sequence, tvb, body_offset + i, 1, (min_seqno + 8 * i + j) % 0x100);
4226 body_offset += bm_len;
4228 remaining = tvb_captured_length_remaining(tvb, body_offset);
4231 if (remaining != 0) {
4232 /* Invalid length; there is remaining data after dissecting MPL Control Message */
4233 ti = proto_tree_add_item(tree, hf_icmpv6_unknown_data, tvb, body_offset, body_offset - offset, ENC_NA);
4234 expert_add_info_format(pinfo, ti, &ei_icmpv6_unknown_data,
4235 "%u bytes data is left after dissecting MPL Control Message", remaining);
4238 return body_offset;
4241 static bool
4242 capture_icmpv6(const unsigned char *pd _U_, int offset _U_, int len _U_, capture_packet_info_t *cpinfo, const union wtap_pseudo_header *pseudo_header _U_)
4244 capture_dissector_increment_count(cpinfo, proto_icmpv6);
4245 return true;
4248 static int
4249 dissect_icmpv6(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data)
4251 proto_tree *icmp6_tree = NULL;
4252 proto_item *ti = NULL, *checksum_item = NULL, *code_item = NULL;
4253 const char *code_name = NULL;
4254 unsigned length = 0, reported_length;
4255 vec_t cksum_vec[4];
4256 uint32_t phdr[2];
4257 uint16_t cksum;
4258 int offset;
4259 tvbuff_t *next_tvb;
4260 uint8_t icmp6_type, icmp6_code;
4261 icmp_transaction_t *trans = NULL;
4262 ws_ip6 *iph = WS_IP6_PTR(data);
4264 col_set_str(pinfo->cinfo, COL_PROTOCOL, "ICMPv6");
4265 col_clear(pinfo->cinfo, COL_INFO);
4267 offset = 0;
4269 if (tree) {
4270 ti = proto_tree_add_item(tree, proto_icmpv6, tvb, offset, -1, ENC_NA);
4271 icmp6_tree = proto_item_add_subtree(ti, ett_icmpv6);
4273 /* Type */
4274 proto_tree_add_item(icmp6_tree, hf_icmpv6_type, tvb, offset, 1, ENC_BIG_ENDIAN);
4276 icmp6_type = tvb_get_uint8(tvb, offset);
4277 offset += 1;
4279 col_add_str(pinfo->cinfo, COL_INFO, val_to_str(icmp6_type, icmpv6_type_val, "Unknown (%d)"));
4281 if (tree)
4282 code_item = proto_tree_add_item(icmp6_tree, hf_icmpv6_code, tvb, offset, 1, ENC_BIG_ENDIAN);
4284 icmp6_code = tvb_get_uint8(tvb, offset);
4285 offset += 1;
4287 switch (icmp6_type) {
4288 case ICMP6_DST_UNREACH:
4289 code_name = val_to_str_const(icmp6_code, icmpv6_unreach_code_val, "Unknown");
4290 break;
4291 case ICMP6_TIME_EXCEEDED:
4292 code_name = val_to_str(icmp6_code, icmpv6_timeex_code_val, "Unknown (%d)");
4293 break;
4294 case ICMP6_PARAM_PROB:
4295 code_name = val_to_str(icmp6_code, icmpv6_paramprob_code_val, "Unknown (%d)");
4296 break;
4297 case ICMP6_ROUTER_RENUMBERING:
4298 code_name = val_to_str(icmp6_code, icmpv6_rr_code_val, "Unknown (%d)");
4299 break;
4300 case ICMP6_NI_QUERY:
4301 code_name = val_to_str(icmp6_code, ni_query_code_val, "Unknown (%d)");
4302 break;
4303 case ICMP6_NI_REPLY:
4304 code_name = val_to_str(icmp6_code, ni_reply_code_val, "Unknown (%d)");
4305 break;
4306 case ICMP6_RPL_CONTROL:
4307 code_name = val_to_str(icmp6_code, rpl_code_val, "Unknown (%d)");
4308 break;
4309 case ICMP6_EXTECHO:
4310 code_name = val_to_str(icmp6_code, ext_echo_req_code_str, "Unknown (%d)");
4311 break;
4312 case ICMP6_EXTECHOREPLY:
4313 code_name = val_to_str(icmp6_code, ext_echo_reply_code_str, "Unknown (%d)");
4314 break;
4317 if (code_name)
4318 col_append_fstr(pinfo->cinfo, COL_INFO, " (%s)", code_name);
4320 /* RFC 4380
4321 * 2.7. Teredo UDP Port
4322 * 5.2.9. Direct IPv6 Connectivity Test */
4323 if (pinfo->destport == 3544 && icmp6_type == ICMP6_ECHO_REQUEST) {
4324 col_set_str(pinfo->cinfo, COL_PROTOCOL, "Teredo");
4325 col_set_str(pinfo->cinfo, COL_INFO, "Direct IPv6 Connectivity Test");
4328 if (code_name)
4329 proto_item_append_text(code_item, " (%s)", code_name);
4331 cksum = tvb_get_ntohs(tvb, offset);
4332 length = tvb_captured_length(tvb);
4333 reported_length = tvb_reported_length(tvb);
4334 if (!pinfo->fragmented && length >= reported_length && !pinfo->flags.in_error_pkt) {
4335 /* The packet isn't part of a fragmented datagram, isn't truncated,
4336 * and we aren't in an ICMP error packet, so we can checksum it.
4339 /* Set up the fields of the pseudo-header. */
4340 SET_CKSUM_VEC_PTR(cksum_vec[0], (const uint8_t *)pinfo->src.data, pinfo->src.len);
4341 SET_CKSUM_VEC_PTR(cksum_vec[1], (const uint8_t *)pinfo->dst.data, pinfo->dst.len);
4342 phdr[0] = g_htonl(reported_length);
4343 phdr[1] = g_htonl(IP_PROTO_ICMPV6);
4344 SET_CKSUM_VEC_PTR(cksum_vec[2], (const uint8_t *)&phdr, 8);
4345 SET_CKSUM_VEC_TVB(cksum_vec[3], tvb, 0, reported_length);
4347 proto_tree_add_checksum(icmp6_tree, tvb, 2, hf_icmpv6_checksum, hf_icmpv6_checksum_status, &ei_icmpv6_checksum, pinfo, in_cksum(cksum_vec, 4),
4348 ENC_BIG_ENDIAN, PROTO_CHECKSUM_VERIFY|PROTO_CHECKSUM_IN_CKSUM);
4349 } else {
4350 checksum_item = proto_tree_add_checksum(icmp6_tree, tvb, 2, hf_icmpv6_checksum, hf_icmpv6_checksum_status, &ei_icmpv6_checksum, pinfo, 0,
4351 ENC_BIG_ENDIAN, PROTO_CHECKSUM_NO_FLAGS);
4352 proto_item_append_text(checksum_item, " [%s]",
4353 pinfo->flags.in_error_pkt ? "in ICMP error packet" : "fragmented datagram");
4355 offset += 2;
4357 if (icmp6_type == ICMP6_ECHO_REQUEST || icmp6_type == ICMP6_ECHO_REPLY) {
4358 uint16_t identifier, sequence;
4360 /* Identifier */
4361 proto_tree_add_item(icmp6_tree, hf_icmpv6_echo_identifier, tvb, offset, 2, ENC_BIG_ENDIAN);
4362 identifier = tvb_get_ntohs(tvb, offset);
4363 offset += 2;
4365 /* Sequence Number */
4366 if (tree)
4367 proto_tree_add_item(icmp6_tree, hf_icmpv6_echo_sequence_number, tvb, offset, 2, ENC_BIG_ENDIAN);
4368 sequence = tvb_get_ntohs(tvb, offset);
4369 offset += 2;
4371 col_append_fstr(pinfo->cinfo, COL_INFO, " id=0x%04x, seq=%u",
4372 identifier, sequence);
4373 if (iph != NULL) {
4374 col_append_fstr(pinfo->cinfo, COL_INFO, ", hop limit=%u",
4375 iph->ip6_hop);
4378 if (pinfo->destport == 3544 && icmp6_type == ICMP6_ECHO_REQUEST) {
4379 /* RFC 4380
4380 * 2.7. Teredo UDP Port
4381 * 5.2.9. Direct IPv6 Connectivity Test
4383 * TODO: Clarify the nonce: The RFC states, "(It is recommended to
4384 * use a random number [the nonce] at least 64 bits long.)"
4386 * Shouldn't the nonce be at least 8 then? Why not just use (-1),
4387 * as it could really be any length, couldn't it?
4389 proto_tree_add_item(icmp6_tree, hf_icmpv6_nonce, tvb, offset, 4, ENC_NA);
4390 offset += 4;
4391 } else {
4392 if (!pinfo->flags.in_error_pkt) {
4393 uint32_t conv_key[3];
4395 conv_key[1] = (uint32_t)((identifier << 16) | sequence);
4396 conv_key[2] = prefs.strict_conversation_tracking_heuristics ? pinfo->vlan_id : 0;
4398 if (icmp6_type == ICMP6_ECHO_REQUEST) {
4399 conv_key[0] = (uint32_t)cksum;
4400 if (conv_key[0] == 0xffff)
4401 conv_key[0] = 0;
4402 if (pinfo->flags.in_gre_pkt && prefs.strict_conversation_tracking_heuristics)
4403 conv_key[0] |= 0x00010000; /* set a bit for "in GRE" */
4404 trans = transaction_start(pinfo, icmp6_tree, conv_key);
4405 } else { /* ICMP6_ECHO_REPLY */
4406 uint16_t tmp[2];
4408 tmp[0] = ~cksum;
4409 tmp[1] = ~0x0100; /* The difference between echo request & reply */
4410 SET_CKSUM_VEC_PTR(cksum_vec[0], (uint8_t *)tmp, sizeof(tmp));
4411 conv_key[0] = in_cksum(cksum_vec, 1);
4412 if (pinfo->flags.in_gre_pkt && prefs.strict_conversation_tracking_heuristics)
4413 conv_key[0] |= 0x00010000; /* set a bit for "in GRE" */
4414 trans = transaction_end(pinfo, icmp6_tree, conv_key);
4418 /* Interpret the first 8 or 16 bytes of the Echo data as a timestamp
4419 * But only if it does look like it's a timestamp.
4422 nstime_t ts, time_relative;
4423 int len = get_best_guess_timestamp(tvb, offset, &pinfo->abs_ts, &ts);
4424 if (len) {
4425 proto_tree_add_time(icmp6_tree, hf_icmpv6_data_time, tvb, offset, len, &ts);
4426 nstime_delta(&time_relative, &pinfo->abs_ts, &ts);
4427 ti = proto_tree_add_time(icmp6_tree, hf_icmpv6_data_time_relative, tvb, offset, len, &time_relative);
4428 proto_item_set_generated(ti);
4429 offset += len;
4431 heur_dtbl_entry_t *hdtbl_entry;
4432 next_tvb = tvb_new_subset_remaining(tvb, offset);
4433 bool result = dissector_try_heuristic(icmpv6_heur_subdissector_list, next_tvb, pinfo, tree, &hdtbl_entry, NULL);
4434 if (!result) {
4435 offset += call_data_dissector(next_tvb, pinfo, icmp6_tree);
4437 else {
4438 offset += tvb_reported_length(next_tvb);
4443 if (1) { /* There are expert infos buried in here so always execute */
4444 /* decode... */
4445 /* FIXME: The following messages MUST have a TTL^WHop-Limit of 255:
4446 133-137, 141-142, 148-149. Detect this and add expert items. */
4447 switch (icmp6_type) {
4448 case ICMP6_DST_UNREACH: /* Destination Unreachable (1) */
4449 case ICMP6_TIME_EXCEEDED: /* Time Exceeded (3) */
4451 char orig_datagram_length = tvb_get_uint8(tvb, offset);
4452 if (orig_datagram_length) {
4453 /* RFC 4884 Original datagram length */
4454 proto_tree_add_item(icmp6_tree, hf_icmpv6_length, tvb, offset, 1, ENC_NA);
4455 offset += 1;
4456 proto_tree_add_item(icmp6_tree, hf_icmpv6_reserved, tvb, offset, 3, ENC_NA);
4457 offset += 3;
4458 } else {
4459 /* Reserved */
4460 proto_tree_add_item(icmp6_tree, hf_icmpv6_reserved, tvb, offset, 4, ENC_NA);
4461 offset += 4;
4464 next_tvb = tvb_new_subset_remaining(tvb, offset);
4465 int contained_len = dissect_contained_icmpv6(next_tvb, pinfo, icmp6_tree);
4466 if (orig_datagram_length) {
4467 offset += 8 * orig_datagram_length;
4468 tvbuff_t * extension_tvb = tvb_new_subset_remaining(tvb, offset);
4469 offset += call_dissector(icmp_extension_handle, extension_tvb, pinfo, icmp6_tree);
4470 } else {
4471 offset += contained_len;
4473 break;
4475 case ICMP6_PACKET_TOO_BIG: /* Packet Too Big (2) */
4476 /* MTU */
4477 proto_tree_add_item(icmp6_tree, hf_icmpv6_mtu, tvb, offset, 4, ENC_BIG_ENDIAN);
4478 offset += 4;
4480 next_tvb = tvb_new_subset_remaining(tvb, offset);
4481 offset += dissect_contained_icmpv6(next_tvb, pinfo, icmp6_tree);
4482 break;
4483 case ICMP6_PARAM_PROB: /* Parameter Problem (4) */
4484 /* MTU */
4485 proto_tree_add_item(icmp6_tree, hf_icmpv6_pointer, tvb, offset, 4, ENC_BIG_ENDIAN);
4486 offset += 4;
4488 next_tvb = tvb_new_subset_remaining(tvb, offset);
4489 offset += dissect_contained_icmpv6(next_tvb, pinfo, icmp6_tree);
4490 break;
4491 case ICMP6_ECHO_REQUEST: /* Echo Request (128) */
4492 case ICMP6_ECHO_REPLY: /* Echo Reply (129) */
4493 /* Already handled above */
4494 break;
4495 case ICMP6_MEMBERSHIP_QUERY: /* Multicast Listener Query (130) */
4496 case ICMP6_MEMBERSHIP_REPORT: /* Multicast Listener Report (131) */
4497 case ICMP6_MEMBERSHIP_REDUCTION: /* Multicast Listener Done (132) */
4499 /* It is MLDv2 packet ? (the min length for a MLDv2 packet is 28) */
4500 if ((icmp6_type == ICMP6_MEMBERSHIP_QUERY) && (length >= MLDV2_PACKET_MINLEN)) {
4501 uint32_t mrc;
4502 uint16_t qqi, i, nb_sources;
4503 static int * const mld_flags[] = {
4504 &hf_icmpv6_mld_flag_s,
4505 &hf_icmpv6_mld_flag_qrv,
4506 &hf_icmpv6_mld_flag_rsv,
4507 NULL
4510 /* Maximum Response Code */
4511 mrc = tvb_get_ntohs(tvb, offset);
4512 if (mrc >= 32768){
4513 mrc = ((mrc & 0x0fff) | 0x1000) << (((mrc & 0x7000) >> 12) + 3);
4515 proto_tree_add_uint(icmp6_tree, hf_icmpv6_mld_mrc, tvb, offset, 2, mrc);
4516 offset += 2;
4518 /* Reserved */
4519 proto_tree_add_item(icmp6_tree, hf_icmpv6_reserved, tvb, offset, 2, ENC_NA);
4520 offset += 2;
4522 /* Multicast Address */
4523 proto_tree_add_item(icmp6_tree, hf_icmpv6_mld_multicast_address, tvb, offset, 16, ENC_NA);
4524 offset += 16;
4526 /* Flag */
4527 proto_tree_add_bitmask(icmp6_tree, tvb, offset, hf_icmpv6_mld_flag, ett_icmpv6_flag_mld, mld_flags, ENC_BIG_ENDIAN);
4528 offset += 1;
4530 /* QQI */
4531 qqi = tvb_get_uint8(tvb, offset);
4532 if (qqi >= 128){
4533 qqi = ((qqi & 0x0f) | 0x10) << (((qqi & 0x70) >> 4) + 3);
4535 proto_tree_add_uint(icmp6_tree, hf_icmpv6_mld_qqi, tvb, offset, 1, qqi);
4536 offset += 1;
4538 /* Number of Sources */
4539 proto_tree_add_item(icmp6_tree, hf_icmpv6_mld_nb_sources, tvb, offset, 2, ENC_BIG_ENDIAN);
4540 nb_sources = tvb_get_ntohs(tvb, offset);
4541 offset += 2;
4543 /* Source Address */
4544 for (i=0; i < nb_sources; i++){
4545 proto_tree_add_item(icmp6_tree, hf_icmpv6_mld_source_address, tvb, offset, 16, ENC_NA);
4546 offset += 16;
4549 }else{ /* It is a MLDv1 Packet */
4551 proto_tree_add_item(icmp6_tree, hf_icmpv6_mld_mrd, tvb, offset, 2, ENC_BIG_ENDIAN);
4552 offset += 2;
4554 /* Reserved */
4555 proto_tree_add_item(icmp6_tree, hf_icmpv6_reserved, tvb, offset, 2, ENC_NA);
4556 offset += 2;
4558 /* Multicast Address */
4559 proto_tree_add_item(icmp6_tree, hf_icmpv6_mld_multicast_address, tvb, offset, 16, ENC_NA);
4560 offset += 16;
4562 break;
4564 case ICMP6_ND_ROUTER_SOLICIT: /* Router Solicitation (133) */
4566 /* Reserved */
4567 proto_tree_add_item(icmp6_tree, hf_icmpv6_reserved, tvb, offset, 4, ENC_NA);
4568 offset += 4;
4570 /* Show options */
4571 offset = dissect_icmpv6_nd_opt(tvb, offset, pinfo, icmp6_tree);
4572 break;
4574 case ICMP6_ND_ROUTER_ADVERT: /* Router Advertisement (134) */
4576 static int * const nd_ra_flags[] = {
4577 &hf_icmpv6_nd_ra_flag_m,
4578 &hf_icmpv6_nd_ra_flag_o,
4579 &hf_icmpv6_nd_ra_flag_h,
4580 &hf_icmpv6_nd_ra_flag_prf,
4581 &hf_icmpv6_nd_ra_flag_p,
4582 &hf_icmpv6_nd_ra_flag_rsv,
4583 NULL
4586 /* Current hop limit */
4587 proto_tree_add_item(icmp6_tree, hf_icmpv6_nd_ra_cur_hop_limit, tvb, offset, 1, ENC_BIG_ENDIAN);
4588 offset += 1;
4590 /* Flags */
4591 proto_tree_add_bitmask(icmp6_tree, tvb, offset, hf_icmpv6_nd_ra_flag, ett_icmpv6_flag_ra, nd_ra_flags, ENC_BIG_ENDIAN);
4592 offset += 1;
4594 /* Router lifetime */
4595 proto_tree_add_item(icmp6_tree, hf_icmpv6_nd_ra_router_lifetime, tvb, offset, 2, ENC_BIG_ENDIAN);
4596 offset += 2;
4598 /* Reachable time */
4599 proto_tree_add_item(icmp6_tree, hf_icmpv6_nd_ra_reachable_time, tvb, offset, 4, ENC_BIG_ENDIAN);
4600 offset += 4;
4602 /* Retrans timer */
4603 proto_tree_add_item(icmp6_tree, hf_icmpv6_nd_ra_retrans_timer, tvb, offset, 4, ENC_BIG_ENDIAN);
4604 offset += 4;
4606 /* Show options */
4607 offset = dissect_icmpv6_nd_opt(tvb, offset, pinfo, icmp6_tree);
4608 break;
4610 case ICMP6_ND_NEIGHBOR_SOLICIT: /* Neighbor Solicitation (135) */
4612 /* Reserved */
4613 proto_tree_add_item(icmp6_tree, hf_icmpv6_reserved, tvb, offset, 4, ENC_NA);
4614 offset += 4;
4616 /* Target Address */
4617 proto_tree_add_item(icmp6_tree, hf_icmpv6_nd_ns_target_address, tvb, offset, 16, ENC_NA);
4618 col_append_fstr(pinfo->cinfo, COL_INFO, " for %s", tvb_ip6_to_str(pinfo->pool, tvb, offset));
4620 offset += 16;
4622 /* Show options */
4623 offset = dissect_icmpv6_nd_opt(tvb, offset, pinfo, icmp6_tree);
4624 break;
4626 case ICMP6_ND_NEIGHBOR_ADVERT: /* Neighbor Advertisement (136) */
4628 uint32_t na_flags;
4629 wmem_strbuf_t *flags_strbuf = wmem_strbuf_create(pinfo->pool);
4630 static int * const nd_na_flags[] = {
4631 &hf_icmpv6_nd_na_flag_r,
4632 &hf_icmpv6_nd_na_flag_s,
4633 &hf_icmpv6_nd_na_flag_o,
4634 &hf_icmpv6_nd_na_flag_rsv,
4635 NULL
4638 /* Flags */
4639 proto_tree_add_bitmask(icmp6_tree, tvb, offset, hf_icmpv6_nd_na_flag, ett_icmpv6_flag_na, nd_na_flags, ENC_BIG_ENDIAN);
4640 na_flags = tvb_get_ntohl(tvb, offset);
4641 offset += 4;
4643 /* Target Address */
4644 proto_tree_add_item(icmp6_tree, hf_icmpv6_nd_na_target_address, tvb, offset, 16, ENC_NA);
4647 if (na_flags & ND_NA_FLAG_R) {
4648 wmem_strbuf_append(flags_strbuf, "rtr, ");
4650 if (na_flags & ND_NA_FLAG_S) {
4651 wmem_strbuf_append(flags_strbuf, "sol, ");
4653 if (na_flags & ND_NA_FLAG_O) {
4654 wmem_strbuf_append(flags_strbuf, "ovr, ");
4656 if (wmem_strbuf_get_len(flags_strbuf) > 2) {
4657 wmem_strbuf_truncate(flags_strbuf, wmem_strbuf_get_len(flags_strbuf) - 2);
4658 } else {
4659 wmem_strbuf_truncate(flags_strbuf, 0);
4660 wmem_strbuf_append(flags_strbuf, "none");
4663 col_append_fstr(pinfo->cinfo, COL_INFO, " %s (%s)", tvb_ip6_to_str(pinfo->pool, tvb, offset), wmem_strbuf_get_str(flags_strbuf));
4664 offset += 16;
4666 /* Show options */
4667 offset = dissect_icmpv6_nd_opt(tvb, offset, pinfo, icmp6_tree);
4668 break;
4670 case ICMP6_ND_REDIRECT: /* Redirect Message (137) */
4672 /* Reserved */
4673 proto_tree_add_item(icmp6_tree, hf_icmpv6_reserved, tvb, offset, 4, ENC_NA);
4674 offset += 4;
4676 /* Target Address */
4677 proto_tree_add_item(icmp6_tree, hf_icmpv6_nd_rd_target_address, tvb, offset, 16, ENC_NA);
4678 offset += 16;
4680 /* Destination Address */
4681 proto_tree_add_item(icmp6_tree, hf_icmpv6_nd_rd_destination_address, tvb, offset, 16, ENC_NA);
4682 offset += 16;
4684 /* Show options */
4685 offset = dissect_icmpv6_nd_opt(tvb, offset, pinfo, icmp6_tree);
4686 break;
4688 case ICMP6_ROUTER_RENUMBERING: /* Router Renumbering (138) */
4690 offset = dissect_rrenum(tvb, offset, pinfo, icmp6_tree, icmp6_type, icmp6_code);
4691 break;
4693 case ICMP6_NI_QUERY: /* ICMP Node Information Query (139) */
4694 case ICMP6_NI_REPLY: /* ICMP Node Information Response (140) */
4696 offset = dissect_nodeinfo(tvb, offset, pinfo, icmp6_tree, icmp6_type, icmp6_code);
4697 break;
4699 case ICMP6_IND_SOLICIT: /* Inverse Neighbor Discovery Solicitation Message (141) */
4700 case ICMP6_IND_ADVERT: /* Inverse Neighbor Discovery Advertisement Message (142) */
4702 /* Reserved */
4703 proto_tree_add_item(icmp6_tree, hf_icmpv6_reserved, tvb, offset, 4, ENC_NA);
4704 offset += 4;
4706 /* Show options */
4707 offset = dissect_icmpv6_nd_opt(tvb, offset, pinfo, icmp6_tree);
4708 break;
4710 case ICMP6_MLDV2_REPORT: /* Version 2 Multicast Listener Report (143) */
4712 offset = dissect_mldrv2( tvb, offset, pinfo, icmp6_tree );
4713 break;
4715 case ICMP6_MIP6_DHAAD_REQUEST: /* Home Agent Address Discovery Request Message (144) */
4717 /* Identifier */
4718 proto_tree_add_item(icmp6_tree, hf_icmpv6_mip6_identifier, tvb, offset, 2, ENC_BIG_ENDIAN);
4719 offset += 2;
4721 /* Reserved */
4722 proto_tree_add_item(icmp6_tree, hf_icmpv6_reserved, tvb, offset, 2, ENC_NA);
4723 offset += 2;
4725 break;
4727 case ICMP6_MIP6_DHAAD_REPLY: /* Home Agent Address Discovery Reply Message (145) */
4729 /* Identifier */
4730 proto_tree_add_item(icmp6_tree, hf_icmpv6_mip6_identifier, tvb, offset, 2, ENC_BIG_ENDIAN);
4731 offset += 2;
4733 /* Reserved */
4734 proto_tree_add_item(icmp6_tree, hf_icmpv6_reserved, tvb, offset, 2, ENC_NA);
4735 offset += 2;
4737 /* Show all Home Agent Addresses */
4738 while((int)length > offset)
4740 proto_tree_add_item(icmp6_tree, hf_icmpv6_mip6_home_agent_address, tvb, offset, 16, ENC_NA);
4741 offset += 16;
4743 break;
4745 case ICMP6_MIP6_MPS: /* Mobile Prefix Solicitation (146) */
4747 /* Identifier */
4748 proto_tree_add_item(icmp6_tree, hf_icmpv6_mip6_identifier, tvb, offset, 2, ENC_BIG_ENDIAN);
4749 offset += 2;
4751 /* Reserved */
4752 proto_tree_add_item(icmp6_tree, hf_icmpv6_reserved, tvb, offset, 2, ENC_NA);
4753 offset += 2;
4754 break;
4756 case ICMP6_MIP6_MPA: /* Mobile Prefix Advertisement (147) */
4758 static int * const mip6_flags[] = {
4759 &hf_icmpv6_mip6_flag_m,
4760 &hf_icmpv6_mip6_flag_o,
4761 &hf_icmpv6_mip6_flag_rsv,
4762 NULL
4765 /* Identifier */
4766 proto_tree_add_item(icmp6_tree, hf_icmpv6_mip6_identifier, tvb, offset, 2, ENC_BIG_ENDIAN);
4767 offset += 2;
4769 /* Flags */
4770 proto_tree_add_bitmask(icmp6_tree, tvb, offset, hf_icmpv6_mip6_flag, ett_icmpv6_flag_mip6, mip6_flags, ENC_BIG_ENDIAN);
4771 offset += 2;
4773 /* Show options */
4774 offset = dissect_icmpv6_nd_opt(tvb, offset, pinfo, icmp6_tree);
4775 break;
4777 case ICMP6_CERT_PATH_SOL: /* Certification Path Solicitation Message (148) */
4780 /* Identifier */
4781 proto_tree_add_item(icmp6_tree, hf_icmpv6_send_identifier, tvb, offset, 2, ENC_BIG_ENDIAN);
4782 offset += 2;
4784 /* Component */
4785 proto_tree_add_item(icmp6_tree, hf_icmpv6_send_component, tvb, offset, 2, ENC_BIG_ENDIAN);
4786 offset += 2;
4788 /* Show options */
4789 offset = dissect_icmpv6_nd_opt(tvb, offset, pinfo, icmp6_tree);
4790 break;
4792 case ICMP6_CERT_PATH_AD: /* Certification Path Advertisement Message (149) */
4795 /* Identifier */
4796 proto_tree_add_item(icmp6_tree, hf_icmpv6_send_identifier, tvb, offset, 2, ENC_BIG_ENDIAN);
4797 offset += 2;
4799 /* All Components */
4800 proto_tree_add_item(icmp6_tree, hf_icmpv6_send_all_components, tvb, offset, 2, ENC_BIG_ENDIAN);
4801 offset += 2;
4803 /* Component */
4804 proto_tree_add_item(icmp6_tree, hf_icmpv6_send_component, tvb, offset, 2, ENC_BIG_ENDIAN);
4805 offset += 2;
4807 /* Reserved */
4808 proto_tree_add_item(icmp6_tree, hf_icmpv6_reserved, tvb, offset, 2, ENC_NA);
4809 offset += 2;
4811 /* Show options */
4812 offset = dissect_icmpv6_nd_opt(tvb, offset, pinfo, icmp6_tree);
4813 break;
4815 case ICMP6_EXPERIMENTAL_MOBILITY: /* ICMP messages utilized by experimental mobility protocols (150) */
4816 case ICMP6_FMIPV6_MESSAGES: /* FMIPv6 Messages (154)*/
4818 uint8_t subtype;
4820 /* Subtype */
4821 proto_tree_add_item(icmp6_tree, hf_icmpv6_fmip6_subtype, tvb, offset, 1, ENC_BIG_ENDIAN);
4822 subtype = tvb_get_uint8(tvb, offset);
4823 col_append_fstr(pinfo->cinfo, COL_INFO, " (%s)", val_to_str(subtype, fmip6_subtype_val, "Unknown (%d)"));
4824 offset += 1;
4826 switch(subtype){
4827 case FMIP6_SUBTYPE_RTSOLPR:
4829 /* Reserved */
4830 proto_tree_add_item(icmp6_tree, hf_icmpv6_reserved, tvb, offset, 1, ENC_NA);
4832 break;
4833 case FMIP6_SUBTYPE_PRRTADV:
4835 proto_item_append_text(code_item, " (%s)", val_to_str(icmp6_code, fmip6_prrtadv_code_val, "Unknown %d") );
4836 /* Reserved */
4837 proto_tree_add_item(icmp6_tree, hf_icmpv6_reserved, tvb, offset, 1, ENC_NA);
4839 break;
4840 case FMIP6_SUBTYPE_HI:
4842 static int * const fmip6_hi_flags[] = {
4843 &hf_icmpv6_fmip6_hi_flag_s,
4844 &hf_icmpv6_fmip6_hi_flag_u,
4845 &hf_icmpv6_fmip6_hi_flag_reserved,
4846 NULL
4849 proto_item_append_text(code_item, " (%s)", val_to_str(icmp6_code, fmip6_hi_code_val, "Unknown %d") );
4850 /* Flags */
4851 proto_tree_add_bitmask(icmp6_tree, tvb, offset, hf_icmpv6_fmip6_hi_flag, ett_icmpv6_flag_fmip6, fmip6_hi_flags, ENC_BIG_ENDIAN);
4853 break;
4854 case FMIP6_SUBTYPE_HACK:
4856 proto_item_append_text(code_item, " (%s)", val_to_str(icmp6_code, fmip6_hack_code_val, "Unknown %d") );
4857 /* Reserved */
4858 proto_tree_add_item(icmp6_tree, hf_icmpv6_reserved, tvb, offset, 1, ENC_NA);
4860 break;
4862 offset +=1;
4864 /* Identifier */
4865 proto_tree_add_item(icmp6_tree, hf_icmpv6_fmip6_identifier, tvb, offset, 2, ENC_BIG_ENDIAN);
4866 offset += 2;
4868 /* Show options */
4869 offset = dissect_icmpv6_nd_opt(tvb, offset, pinfo, icmp6_tree);
4870 break;
4872 case ICMP6_MCAST_ROUTER_ADVERT: /* Multicast Router Advertisement (151) */
4874 /* Query Interval */
4875 proto_tree_add_item(icmp6_tree, hf_icmpv6_mcast_ra_query_interval, tvb, offset, 2, ENC_BIG_ENDIAN);
4876 offset += 2;
4878 /* Robustness Variable */
4879 proto_tree_add_item(icmp6_tree, hf_icmpv6_mcast_ra_robustness_variable, tvb, offset, 2, ENC_BIG_ENDIAN);
4880 offset += 2;
4882 case ICMP6_MCAST_ROUTER_SOLICIT: /* Multicast Router Solicitation (152) */
4883 case ICMP6_MCAST_ROUTER_TERM: /* Multicast Router Termination (153) */
4885 /* No Action... */
4886 break;
4888 case ICMP6_RPL_CONTROL: /* RPL Control (155) */
4890 /* RPL: RFC 6550 : Routing over Low-Power and Lossy Networks. */
4891 offset = dissect_rpl_control(tvb, offset, pinfo, icmp6_tree, icmp6_type, icmp6_code);
4892 break;
4894 case ICMP6_ILNPV6: /* Locator Update (156) */
4896 uint8_t nb_locs, i;
4897 /* Number of locs */
4898 proto_tree_add_item(icmp6_tree, hf_icmpv6_ilnp_nb_locs, tvb, offset, 1, ENC_BIG_ENDIAN);
4899 nb_locs = tvb_get_uint8(tvb, offset);
4900 offset += 1;
4902 /* Reserved */
4903 proto_tree_add_item(icmp6_tree, hf_icmpv6_reserved, tvb, offset, 1, ENC_NA);
4904 offset += 1;
4906 /* Reserved */
4907 proto_tree_add_item(icmp6_tree, hf_icmpv6_reserved, tvb, offset, 2, ENC_NA);
4908 offset += 2;
4910 /* Locator / Preference / Lifetime */
4911 for (i=0; i < nb_locs; i++){
4912 proto_tree_add_item(icmp6_tree, hf_icmpv6_ilnp_locator, tvb, offset, 8, ENC_NA);
4913 offset += 8;
4915 proto_tree_add_item(icmp6_tree, hf_icmpv6_ilnp_preference, tvb, offset, 2, ENC_NA);
4916 offset += 2;
4918 proto_tree_add_item(icmp6_tree, hf_icmpv6_ilnp_lifetime, tvb, offset, 2, ENC_NA);
4919 offset += 2;
4922 break;
4924 case ICMP6_6LOWPANND_DAR:
4925 case ICMP6_6LOWPANND_DAC:
4927 /* Status */
4928 proto_tree_add_item(icmp6_tree, hf_icmpv6_da_status, tvb, offset, 1, ENC_BIG_ENDIAN);
4929 offset += 1;
4931 /* Reserved */
4932 proto_tree_add_item(icmp6_tree, hf_icmpv6_da_rsv, tvb, offset, 1, ENC_BIG_ENDIAN);
4933 offset += 1;
4935 /* Lifetime */
4936 proto_tree_add_item(icmp6_tree, hf_icmpv6_da_lifetime, tvb, offset, 2, ENC_BIG_ENDIAN);
4937 offset += 2;
4939 /* EUI-64 */
4940 proto_tree_add_item(icmp6_tree, hf_icmpv6_da_eui64, tvb, offset, 8, ENC_BIG_ENDIAN);
4941 offset += 8;
4943 /* Address */
4944 proto_tree_add_item(icmp6_tree, hf_icmpv6_da_raddr, tvb, offset, 16, ENC_NA);
4945 offset += 16;
4946 break;
4948 case ICMP6_MPL_CONTROL: /* MPL Control (159) */
4950 /* RFC 7731: Multicast Protocol for Low-Power and Lossy Networks (MPL) */
4951 offset = dissect_mpl_control(tvb, offset, pinfo, icmp6_tree, icmp6_type, icmp6_code);
4952 break;
4955 case ICMP6_EXTECHO: /* Extended Echo - Probe - (RFC8335) */
4957 proto_tree_add_item(icmp6_tree, hf_icmpv6_echo_identifier, tvb, offset, 2,
4958 ENC_BIG_ENDIAN);
4959 offset += 2;
4960 proto_tree_add_item(icmp6_tree, hf_icmpv6_ext_echo_seq_num, tvb, offset, 1,
4961 ENC_BIG_ENDIAN);
4962 offset += 1;
4963 proto_tree_add_item(icmp6_tree, hf_icmpv6_ext_echo_req_reserved, tvb, offset, 1,
4964 ENC_BIG_ENDIAN);
4965 proto_tree_add_item(icmp6_tree, hf_icmpv6_ext_echo_req_local, tvb, offset, 1,
4966 ENC_BIG_ENDIAN);
4967 offset += 1;
4969 tvbuff_t * extension_tvb = tvb_new_subset_remaining(tvb, offset);
4970 offset += call_dissector(icmp_extension_handle, extension_tvb, pinfo, icmp6_tree);
4971 break;
4974 case ICMP6_EXTECHOREPLY:
4976 proto_tree_add_item(icmp6_tree, hf_icmpv6_echo_identifier, tvb, offset, 2,
4977 ENC_BIG_ENDIAN);
4978 offset += 2;
4979 proto_tree_add_item(icmp6_tree, hf_icmpv6_ext_echo_seq_num, tvb, offset, 1,
4980 ENC_BIG_ENDIAN);
4981 offset += 1;
4982 proto_tree_add_item(icmp6_tree, hf_icmpv6_ext_echo_rsp_state, tvb, offset, 1,
4983 ENC_BIG_ENDIAN);
4984 proto_tree_add_item(icmp6_tree, hf_icmpv6_ext_echo_rsp_reserved, tvb, offset, 1,
4985 ENC_BIG_ENDIAN);
4986 proto_tree_add_item(icmp6_tree, hf_icmpv6_ext_echo_rsp_active, tvb, offset, 1,
4987 ENC_BIG_ENDIAN);
4988 proto_tree_add_item(icmp6_tree, hf_icmpv6_ext_echo_rsp_ipv4, tvb, offset, 1,
4989 ENC_BIG_ENDIAN);
4990 proto_tree_add_item(icmp6_tree, hf_icmpv6_ext_echo_rsp_ipv6, tvb, offset, 1,
4991 ENC_BIG_ENDIAN);
4992 offset += 1;
4993 break;
4996 default:
4997 expert_add_info_format(pinfo, ti, &ei_icmpv6_undecoded_type,
4998 "Dissector for ICMPv6 Type (%d)"
4999 " code not implemented, Contact Wireshark"
5000 " developers if you want this supported", icmp6_type);
5001 proto_tree_add_item(icmp6_tree, hf_icmpv6_data, tvb, offset, -1, ENC_NA);
5002 break;
5003 } /* switch (icmp6_type) */
5004 } /* if (1) */
5006 if (!PINFO_FD_VISITED(pinfo)) {
5007 icmp_info_t *p_icmp_info = wmem_new(wmem_file_scope(), icmp_info_t);
5008 p_icmp_info->type = icmp6_type;
5009 p_icmp_info->code = icmp6_code;
5010 p_add_proto_data(wmem_file_scope(), pinfo, proto_icmpv6, 0, p_icmp_info);
5013 if (trans)
5014 tap_queue_packet(icmpv6_tap, pinfo, trans);
5016 return offset;
5019 void
5020 proto_register_icmpv6(void)
5022 static hf_register_info hf[] = {
5023 { &hf_icmpv6_type,
5024 { "Type", "icmpv6.type", FT_UINT8, BASE_DEC, VALS(icmpv6_type_val), 0x0,
5025 "Indicates the type of the message", HFILL }},
5026 { &hf_icmpv6_code,
5027 { "Code", "icmpv6.code", FT_UINT8, BASE_DEC, NULL, 0x0,
5028 "Depends on the message type. It is used to create an additional level of message granularity", HFILL }},
5029 { &hf_icmpv6_checksum,
5030 { "Checksum", "icmpv6.checksum", FT_UINT16, BASE_HEX, NULL, 0x0,
5031 "Used to detect data corruption in the ICMPv6 message and parts of the IPv6 header", HFILL }},
5032 { &hf_icmpv6_checksum_status,
5033 { "Checksum Status", "icmpv6.checksum.status", FT_UINT8, BASE_NONE, VALS(proto_checksum_vals), 0x0,
5034 NULL, HFILL }},
5035 { &hf_icmpv6_reserved,
5036 { "Reserved", "icmpv6.reserved", FT_BYTES, BASE_NONE, NULL, 0x0,
5037 "Must be Zero", HFILL }},
5038 { &hf_icmpv6_data,
5039 { "Data", "icmpv6.data", FT_BYTES, BASE_NONE, NULL, 0x0,
5040 NULL, HFILL }},
5041 { &hf_icmpv6_unknown_data,
5042 { "Unknown Data", "icmpv6.unknown_data", FT_BYTES, BASE_NONE, NULL, 0x0,
5043 "Not interpreted Data", HFILL }},
5044 { &hf_icmpv6_mtu,
5045 { "MTU", "icmpv6.mtu", FT_UINT32, BASE_DEC, NULL, 0x0,
5046 "The Maximum Transmission Unit of the next-hop link", HFILL }},
5047 { &hf_icmpv6_pointer,
5048 { "Pointer", "icmpv6.pointer", FT_UINT32, BASE_DEC, NULL, 0x0,
5049 "Identifies the octet offset within the invoking packet where the error was detected", HFILL }},
5050 { &hf_icmpv6_echo_identifier,
5051 { "Identifier", "icmpv6.echo.identifier", FT_UINT16, BASE_HEX, NULL, 0x0,
5052 "An identifier to aid in matching with Request and Reply", HFILL }},
5053 { &hf_icmpv6_echo_sequence_number,
5054 { "Sequence", "icmpv6.echo.sequence_number", FT_UINT16, BASE_DEC, NULL, 0x0,
5055 "A sequence number to aid in matching Echo Replies to this Echo Request", HFILL }},
5056 { &hf_icmpv6_nonce,
5057 { "Nonce", "icmpv6.nonce", FT_BYTES, BASE_NONE, NULL, 0x0,
5058 NULL, HFILL }},
5059 { &hf_icmpv6_data_time,
5060 { "Timestamp from Echo data", "icmpv6.data_time",
5061 FT_ABSOLUTE_TIME, ABSOLUTE_TIME_LOCAL, NULL, 0x0,
5062 "The timestamp in the first 8 or 16 bytes of the Echo data",
5063 HFILL }},
5064 { &hf_icmpv6_data_time_relative,
5065 { "Timestamp from Echo data (relative)", "icmpv6.data_time_relative",
5066 FT_RELATIVE_TIME, BASE_NONE, NULL, 0x0,
5067 "The timestamp of the packet, relative to the timestamp in the first 8 or 16 bytes of the Echo data",
5068 HFILL }},
5069 /* RFC 2461/4861 : Neighbor Discovery for IP version 6 (IPv6) */
5070 { &hf_icmpv6_nd_ra_cur_hop_limit,
5071 { "Cur hop limit", "icmpv6.nd.ra.cur_hop_limit", FT_UINT8, BASE_DEC, NULL, 0x0,
5072 "The default value that should be placed in the Hop Count field of the IP header for outgoing IP packets", HFILL }},
5073 { &hf_icmpv6_nd_ra_flag,
5074 { "Flags", "icmpv6.nd.ra.flag", FT_UINT8, BASE_HEX, NULL, 0x0,
5075 NULL, HFILL }},
5076 { &hf_icmpv6_nd_ra_flag_m,
5077 { "Managed address configuration", "icmpv6.nd.ra.flag.m", FT_BOOLEAN, 8, TFS(&tfs_set_notset), ND_RA_FLAG_M,
5078 "When set, it indicates that addresses are available via DHCPv6", HFILL }},
5079 { &hf_icmpv6_nd_ra_flag_o,
5080 { "Other configuration", "icmpv6.nd.ra.flag.o", FT_BOOLEAN, 8, TFS(&tfs_set_notset), ND_RA_FLAG_O,
5081 "When set, it indicates that other configuration information is available via DHCPv6", HFILL }},
5082 { &hf_icmpv6_nd_ra_flag_h,
5083 { "Home Agent", "icmpv6.nd.ra.flag.h", FT_BOOLEAN, 8, TFS(&tfs_set_notset), ND_RA_FLAG_H,
5084 "When set, it indicate that the router sending this Router Advertisement is also functioning as a Mobile IPv6 home agent on this link", HFILL }},
5085 { &hf_icmpv6_nd_ra_flag_prf,
5086 { "Prf (Default Router Preference)", "icmpv6.nd.ra.flag.prf", FT_UINT8, BASE_DEC, VALS(nd_flag_router_pref), ND_RA_FLAG_PRF,
5087 "Indicates whether to prefer this router over other default routers", HFILL }},
5088 { &hf_icmpv6_nd_ra_flag_p,
5089 { "ND Proxy", "icmpv6.nd.ra.flag.p", FT_BOOLEAN, 8, TFS(&tfs_set_notset), ND_RA_FLAG_P,
5090 "Neighbor Discovery Proxy (Experimental - RFC4389)" , HFILL }},
5091 { &hf_icmpv6_nd_ra_flag_rsv,
5092 { "Reserved", "icmpv6.nd.ra.flag.rsv", FT_UINT8, BASE_DEC, NULL, ND_RA_FLAG_RSV,
5093 "Must be Zero", HFILL }},
5094 { &hf_icmpv6_nd_ra_router_lifetime,
5095 { "Router lifetime (s)", "icmpv6.nd.ra.router_lifetime", FT_UINT16, BASE_DEC, NULL, 0x0,
5096 "The lifetime associated with the default router", HFILL }},
5097 { &hf_icmpv6_nd_ra_reachable_time,
5098 { "Reachable time (ms)", "icmpv6.nd.ra.reachable_time", FT_UINT32, BASE_DEC, NULL, 0x0,
5099 "The time that a node assumes a neighbor is reachable after having received a reachability confirmation", HFILL }},
5100 { &hf_icmpv6_nd_ra_retrans_timer,
5101 { "Retrans timer (ms)", "icmpv6.nd.ra.retrans_timer", FT_UINT32, BASE_DEC, NULL, 0x0,
5102 "The time between retransmitted Neighbor Solicitation messages", HFILL }},
5103 { &hf_icmpv6_nd_ns_target_address,
5104 { "Target Address", "icmpv6.nd.ns.target_address", FT_IPv6, BASE_NONE, NULL, 0x0,
5105 "The IP address of the target of the solicitation", HFILL }},
5106 { &hf_icmpv6_nd_na_flag,
5107 { "Flags", "icmpv6.nd.na.flag", FT_UINT32, BASE_HEX, NULL, 0x0,
5108 NULL, HFILL }},
5109 { &hf_icmpv6_nd_na_flag_r,
5110 { "Router", "icmpv6.nd.na.flag.r", FT_BOOLEAN, 32, TFS(&tfs_set_notset), ND_NA_FLAG_R,
5111 "When set, it indicates that the sender is a router", HFILL }},
5112 { &hf_icmpv6_nd_na_flag_s,
5113 { "Solicited", "icmpv6.nd.na.flag.s", FT_BOOLEAN, 32, TFS(&tfs_set_notset), ND_NA_FLAG_S,
5114 "When set, it indicates that the advertisement was sent in response to a Neighbor Solicitation from the Destination address", HFILL }},
5115 { &hf_icmpv6_nd_na_flag_o,
5116 { "Override", "icmpv6.nd.na.flag.o", FT_BOOLEAN, 32, TFS(&tfs_set_notset), ND_NA_FLAG_O,
5117 "When set, it indicates that the advertisement should override an existing cache entry and update the cached link-layer address", HFILL }},
5118 { &hf_icmpv6_nd_na_flag_rsv,
5119 { "Reserved", "icmpv6.nd.na.flag.rsv", FT_UINT32, BASE_DEC, NULL, ND_NA_FLAG_RSV,
5120 "Must be Zero", HFILL }},
5121 { &hf_icmpv6_nd_na_target_address,
5122 { "Target Address", "icmpv6.nd.na.target_address", FT_IPv6, BASE_NONE, NULL, 0x0,
5123 "the Target Address field in the Neighbor Solicitation message that prompted this advertisement", HFILL }},
5124 { &hf_icmpv6_nd_rd_target_address,
5125 { "Target Address", "icmpv6.nd.rd.target_address", FT_IPv6, BASE_NONE, NULL, 0x0,
5126 "An IP address that is a better first hop to use for the ICMP Destination Address", HFILL }},
5127 { &hf_icmpv6_nd_rd_destination_address,
5128 { "Destination Address", "icmpv6.rd.na.destination_address", FT_IPv6, BASE_NONE, NULL, 0x0,
5129 "The IP address of the destination that is redirected to the target", HFILL }},
5130 { &hf_icmpv6_opt,
5131 { "ICMPv6 Option", "icmpv6.opt", FT_NONE, BASE_NONE, NULL, 0x0,
5132 NULL, HFILL }},
5133 { &hf_icmpv6_opt_type,
5134 { "Type", "icmpv6.opt.type", FT_UINT8, BASE_DEC, VALS(option_vals), 0x0,
5135 "Options type", HFILL }},
5136 { &hf_icmpv6_opt_length,
5137 { "Length", "icmpv6.opt.length", FT_UINT8, BASE_DEC, NULL, 0x0,
5138 "The length (in units of 8 bytes) of the option (including the Type and Length fields)", HFILL }},
5139 { &hf_icmpv6_opt_reserved,
5140 { "Reserved", "icmpv6.opt.reserved", FT_NONE, BASE_NONE, NULL, 0x0,
5141 "Reserved (Must be 0)", HFILL }},
5142 { &hf_icmpv6_opt_padding,
5143 { "Padding", "icmpv6.opt.padding", FT_NONE, BASE_NONE, NULL, 0x0,
5144 "Padding (Must be 0)", HFILL }},
5145 { &hf_icmpv6_opt_linkaddr,
5146 { "Link-layer address", "icmpv6.opt.linkaddr", FT_BYTES, BASE_NONE, NULL, 0x0,
5147 NULL, HFILL }},
5148 { &hf_icmpv6_opt_src_linkaddr,
5149 { "Source Link-layer address", "icmpv6.opt.src_linkaddr", FT_BYTES, BASE_NONE, NULL, 0x0,
5150 NULL, HFILL }},
5151 { &hf_icmpv6_opt_target_linkaddr,
5152 { "Target Link-layer address", "icmpv6.opt.target_linkaddr", FT_BYTES, BASE_NONE, NULL, 0x0,
5153 NULL, HFILL }},
5154 { &hf_icmpv6_opt_linkaddr_mac,
5155 { "Link-layer address", "icmpv6.opt.linkaddr", FT_ETHER, BASE_NONE, NULL, 0x0,
5156 NULL, HFILL }},
5157 { &hf_icmpv6_opt_src_linkaddr_mac,
5158 { "Source Link-layer address", "icmpv6.opt.src_linkaddr", FT_ETHER, BASE_NONE, NULL, 0x0,
5159 NULL, HFILL }},
5160 { &hf_icmpv6_opt_target_linkaddr_mac,
5161 { "Target Link-layer address", "icmpv6.opt.target_linkaddr", FT_ETHER, BASE_NONE, NULL, 0x0,
5162 NULL, HFILL }},
5163 { &hf_icmpv6_opt_linkaddr_eui64,
5164 { "Link-layer address", "icmpv6.opt.linkaddr_eui64", FT_EUI64, BASE_NONE, NULL, 0x0,
5165 NULL, HFILL }},
5166 { &hf_icmpv6_opt_src_linkaddr_eui64,
5167 { "Source Link-layer address", "icmpv6.opt.src_linkaddr_eui64", FT_EUI64, BASE_NONE, NULL, 0x0,
5168 NULL, HFILL }},
5169 { &hf_icmpv6_opt_target_linkaddr_eui64,
5170 { "Target Link-layer address", "icmpv6.opt.target_linkaddr_eui64", FT_EUI64, BASE_NONE, NULL, 0x0,
5171 NULL, HFILL }},
5172 { &hf_icmpv6_opt_prefix_len,
5173 { "Prefix Length", "icmpv6.opt.prefix.length", FT_UINT8, BASE_DEC, NULL, 0x0,
5174 "The number of leading bits in the Prefix that are valid", HFILL }},
5175 { &hf_icmpv6_opt_prefix_flag,
5176 { "Flag", "icmpv6.opt.prefix.flag", FT_UINT8, BASE_HEX, NULL, 0x00,
5177 NULL, HFILL }},
5178 { &hf_icmpv6_opt_prefix_flag_l,
5179 { "On-link flag(L)", "icmpv6.opt.prefix.flag.l", FT_BOOLEAN, 8, TFS(&tfs_set_notset), 0x80,
5180 "When set, indicates that this prefix can be used for on-link determination, and traffic to those destinations is sent directly (not via routers)", HFILL }},
5181 { &hf_icmpv6_opt_prefix_flag_a,
5182 { "Autonomous address-configuration flag(A)", "icmpv6.opt.prefix.flag.a", FT_BOOLEAN, 8, TFS(&tfs_set_notset), 0x40,
5183 "When set, indicates that this prefix can be used for stateless address configuration", HFILL }},
5184 { &hf_icmpv6_opt_prefix_flag_r,
5185 { "Router address flag(R)", "icmpv6.opt.prefix.flag.r", FT_BOOLEAN, 8, TFS(&tfs_set_notset), 0x20,
5186 "When set, indicates that the Prefix field contains a complete IP address assigned to the sending router", HFILL }},
5187 { &hf_icmpv6_opt_prefix_flag_p,
5188 { "Prefix Delegation preferred flag (P)", "icmpv6.opt.prefix.flag.p", FT_BOOLEAN, 8, TFS(&tfs_set_notset), 0x10,
5189 "When set, indicates that the network prefers that clients use Prefix Delegation (PD) instead of acquiring individual addresses via SLAAC or DHCPv6 address assignment.", HFILL }},
5190 { &hf_icmpv6_opt_prefix_flag_reserved,
5191 { "Reserved", "icmpv6.opt.prefix.flag.reserved", FT_UINT8, BASE_DEC, NULL, 0xf,
5192 NULL, HFILL }},
5193 { &hf_icmpv6_opt_prefix_valid_lifetime,
5194 { "Valid Lifetime", "icmpv6.opt.prefix.valid_lifetime", FT_UINT32, BASE_DEC|BASE_SPECIAL_VALS, VALS(unique_infinity), 0x00,
5195 "The length of time in seconds that the prefix is valid for the purpose of on-link determination", HFILL }},
5196 { &hf_icmpv6_opt_prefix_preferred_lifetime,
5197 { "Preferred Lifetime", "icmpv6.opt.prefix.preferred_lifetime", FT_UINT32, BASE_DEC|BASE_SPECIAL_VALS, VALS(unique_infinity), 0x00,
5198 "The length of time in seconds that addresses generated from the prefix via stateless address autoconfiguration remain preferred", HFILL }},
5199 { &hf_icmpv6_opt_prefix,
5200 { "Prefix", "icmpv6.opt.prefix", FT_IPv6, BASE_NONE, NULL, 0x00,
5201 "An IP address or a prefix of an IP address", HFILL }},
5202 { &hf_icmpv6_opt_cga_pad_len,
5203 { "Pad Length", "icmpv6.opt.cga.pad_length", FT_UINT8, BASE_DEC, NULL, 0x0,
5204 "Pad Length (in bytes)", HFILL }},
5205 { &hf_icmpv6_opt_cga,
5206 { "CGA", "icmpv6.opt.cga", FT_BYTES, BASE_NONE, NULL, 0x0,
5207 NULL, HFILL }},
5208 { &hf_icmpv6_opt_cga_modifier,
5209 { "Modifier", "icmpv6.opt.cga.modifier", FT_BYTES, BASE_NONE, NULL, 0x0,
5210 NULL, HFILL }},
5211 { &hf_icmpv6_opt_cga_subnet_prefix,
5212 { "Subnet Prefix", "icmpv6.opt.cga.subnet_prefix", FT_BYTES, BASE_NONE, NULL, 0x0,
5213 NULL, HFILL }},
5214 { &hf_icmpv6_opt_cga_count,
5215 { "Count", "icmpv6.opt.cga.count", FT_BYTES, BASE_NONE, NULL, 0x0,
5216 NULL, HFILL }},
5217 { &hf_icmpv6_opt_cga_subject_public_key_info,
5218 { "Subject Public Key Info", "icmpv6.opt.cga.subject_public_key_info", FT_NONE, BASE_NONE, NULL, 0x0,
5219 NULL, HFILL }},
5220 { &hf_icmpv6_opt_cga_ext_type,
5221 { "Ext Type", "icmpv6.opt.cga.ext_type", FT_UINT16, BASE_DEC, NULL, 0x0,
5222 NULL, HFILL }},
5223 { &hf_icmpv6_opt_cga_ext_length,
5224 { "Ext Length", "icmpv6.opt.cga.ext_length", FT_UINT16, BASE_DEC, NULL, 0x0,
5225 NULL, HFILL }},
5226 { &hf_icmpv6_opt_cga_ext_data,
5227 { "Ext Data", "icmpv6.opt.cga.ext_data", FT_BYTES, BASE_NONE, NULL, 0x0,
5228 NULL, HFILL }},
5229 { &hf_icmpv6_opt_rsa_key_hash,
5230 { "Key Hash", "icmpv6.opt.rsa.key_hash", FT_BYTES, BASE_NONE, NULL, 0x0,
5231 NULL, HFILL }},
5232 { &hf_icmpv6_opt_digital_signature_padding,
5233 { "Digital Signature and Padding", "icmpv6.opt.digital_signature_padding", FT_NONE, BASE_NONE, NULL, 0x0,
5234 "TO DO FIX ME !!", HFILL }},
5235 { &hf_icmpv6_opt_ps_key_hash,
5236 { "Key Hash", "icmpv6.opt.ps.key_hash", FT_BYTES, BASE_NONE, NULL, 0x0,
5237 NULL, HFILL }},
5238 { &hf_icmpv6_opt_timestamp,
5239 { "Timestamp", "icmpv6.opt.timestamp", FT_ABSOLUTE_TIME, ABSOLUTE_TIME_LOCAL, NULL, 0x0,
5240 "The value indicates the number of seconds since January 1, 1970, 00:00 UTC", HFILL }},
5241 { &hf_icmpv6_opt_nonce,
5242 { "Nonce", "icmpv6.opt.nonce", FT_BYTES, BASE_NONE, NULL, 0x0,
5243 "A field containing a random number selected by the sender of the solicitation message", HFILL }},
5244 { &hf_icmpv6_opt_certificate_padding,
5245 { "Certificate and Padding", "icmpv6.opt.certificate_padding", FT_NONE, BASE_NONE, NULL, 0x0,
5246 NULL, HFILL }},
5247 { &hf_icmpv6_opt_ipa_option_code,
5248 { "Option-code", "icmpv6.opt.ipa.option_code", FT_UINT8, BASE_DEC, VALS(nd_opt_ipa_option_code_val), 0x00,
5249 NULL, HFILL }},
5250 { &hf_icmpv6_opt_ipa_prefix_len,
5251 { "Prefix Length", "icmpv6.opt.ipa.prefix_len", FT_UINT8, BASE_DEC, NULL, 0x00,
5252 "That indicates the length of the IPv6 Address Prefix", HFILL }},
5253 { &hf_icmpv6_opt_ipa_ipv6_address,
5254 { "IPv6 Address", "icmpv6.opt.ipa.ipv6_address", FT_IPv6, BASE_NONE, NULL, 0x00,
5255 "The IP address/prefix defined by the Option-Code field", HFILL }},
5256 { &hf_icmpv6_opt_nrpi_option_code,
5257 { "Option-code", "icmpv6.opt.nrpi.option_code", FT_UINT8, BASE_DEC, NULL, 0x00,
5258 NULL, HFILL }},
5259 { &hf_icmpv6_opt_nrpi_prefix_len,
5260 { "Prefix Length", "icmpv6.opt.nrpi.prefix_len", FT_UINT8, BASE_DEC, NULL, 0x00,
5261 "The number of leading bits in the Prefix that are valid", HFILL }},
5262 { &hf_icmpv6_opt_nrpi_prefix,
5263 { "Prefix", "icmpv6.opt.nrpi.prefix", FT_IPv6, BASE_NONE, NULL, 0x00,
5264 "An IP address or a prefix of an IP address", HFILL }},
5265 { &hf_icmpv6_opt_lla_option_code,
5266 { "Option-code", "icmpv6.opt.lla.option_code", FT_UINT8, BASE_DEC, VALS(nd_opt_lla_option_code_val), 0x00,
5267 NULL, HFILL }},
5268 { &hf_icmpv6_opt_lla_bytes,
5269 { "Link-Layer Address", "icmpv6.opt.lla.bytes", FT_BYTES, BASE_NONE, NULL, 0x00,
5270 "(in Bytes Format)", HFILL }},
5271 { &hf_icmpv6_opt_naack_option_code,
5272 { "Option-Code", "icmpv6.opt.naack.option_code", FT_UINT8, BASE_DEC, NULL, 0x00,
5273 NULL, HFILL }},
5274 { &hf_icmpv6_opt_naack_status,
5275 { "Status", "icmpv6.opt.naack.status", FT_UINT8, BASE_DEC, VALS(nd_opt_naack_status_val), 0x00,
5276 "Indicating the disposition of the Unsolicited Neighbor Advertisement message", HFILL }},
5277 { &hf_icmpv6_opt_naack_supplied_ncoa,
5278 { "Supplied NCoA", "icmpv6.opt.naack.supplied_ncoa", FT_IPv6, BASE_NONE, NULL, 0x00,
5279 NULL, HFILL }},
5281 { &hf_icmpv6_opt_pvd_id_flags,
5282 { "Flags", "icmpv6.opt.pvd_id.flags", FT_UINT16, BASE_HEX, NULL, 0xFFF0,
5283 NULL, HFILL }},
5284 { &hf_icmpv6_opt_pvd_id_flags_h,
5285 { "H Flag", "icmpv6.opt.pvd_id.flags.h", FT_BOOLEAN, 16, NULL, 0x8000,
5286 "'HTTP' flag stating whether some PvD Additional Information is made available through HTTP over TLS", HFILL }},
5287 { &hf_icmpv6_opt_pvd_id_flags_l,
5288 { "L Flag", "icmpv6.opt.pvd_id.flags.l", FT_BOOLEAN, 16, NULL, 0x4000,
5289 "'Legacy' flag stating whether the PvD is associated with IPv4 information assigned using DHCPv4", HFILL }},
5290 { &hf_icmpv6_opt_pvd_id_flags_r,
5291 { "R Flag", "icmpv6.opt.pvd_id.flags.r", FT_BOOLEAN, 16, NULL, 0x2000,
5292 "'Router Advertisement' flag stating whether the PvD Option header is followed (right after padding to the next 64-bit boundary) by a Router Advertisement message header", HFILL }},
5293 { &hf_icmpv6_opt_pvd_id_flags_reserved,
5294 { "Reserved", "icmpv6.opt.pvd_id.flags.reserved", FT_UINT16, BASE_HEX, NULL, 0x1FF0,
5295 "Must be 0", HFILL }},
5296 { &hf_icmpv6_opt_pvd_id_delay,
5297 { "Delay", "icmpv6.opt.pvd_id.delay", FT_UINT16, BASE_DEC, NULL, 0x000F,
5298 "Unsigned integer used to delay HTTP GET queries from hosts by a randomized backoff", HFILL }},
5299 { &hf_icmpv6_opt_pvd_id_sequence_number,
5300 { "Sequence Number", "icmpv6.opt.pvd_id.sequence_number", FT_UINT16, BASE_DEC, NULL, 0x0,
5301 "Sequence number for the PvD Additional Information", HFILL }},
5302 { &hf_icmpv6_opt_pvd_id_fqdn,
5303 { "PvD ID FQDN", "icmpv6.opt.pvd_id.fqdn", FT_STRING, BASE_NONE, NULL, 0x0,
5304 NULL, HFILL }},
5307 { &hf_icmpv6_opt_map_dist,
5308 { "Distance", "icmpv6.opt.map.distance", FT_UINT8, BASE_DEC, NULL, 0xF0,
5309 "Identifying the distance between MAP and the receiver of the advertisement (in the number of hops)", HFILL }},
5310 { &hf_icmpv6_opt_map_pref,
5311 { "Preference", "icmpv6.opt.map.preference", FT_UINT8, BASE_DEC, NULL, 0x0F,
5312 "Used as an indicator of operator preference (Highest is better)", HFILL }},
5313 { &hf_icmpv6_opt_map_flag,
5314 { "Flag", "icmpv6.opt.map.flag", FT_UINT8, BASE_HEX, NULL, 0x00,
5315 NULL, HFILL }},
5316 { &hf_icmpv6_opt_map_flag_r,
5317 { "RCoA Flag", "icmpv6.opt.map.flag.r", FT_BOOLEAN, 8, NULL, 0x80,
5318 "It indicates that the mobile node is allocated the RCoA by the MAP", HFILL }},
5319 { &hf_icmpv6_opt_map_flag_reserved,
5320 { "Reserved", "icmpv6.opt.map.flag.reserved", FT_UINT8, BASE_DEC, NULL, 0x7F,
5321 "Must be 0", HFILL }},
5322 { &hf_icmpv6_opt_map_valid_lifetime,
5323 { "Valid Lifetime", "icmpv6.opt.map.valid_lifetime", FT_UINT32, BASE_DEC, NULL, 0x0,
5324 "This value indicates the validity of the MAP's address and the RCoA.", HFILL }},
5325 { &hf_icmpv6_opt_map_global_address,
5326 { "Global Address", "icmpv6.opt.map.global_address", FT_IPv6, BASE_NONE, NULL, 0x0,
5327 "One of the MAP's global addresses", HFILL }},
5328 { &hf_icmpv6_opt_route_info_flag,
5329 { "Flag", "icmpv6.opt.route_info.flag", FT_UINT8, BASE_HEX, NULL, 0x00,
5330 NULL, HFILL }},
5331 { &hf_icmpv6_opt_route_info_flag_route_preference,
5332 { "Route Preference", "icmpv6.opt.route_info.flag.route_preference", FT_UINT8, BASE_DEC, VALS(nd_flag_router_pref), ND_RA_FLAG_RTPREF_MASK,
5333 "The Route Preference indicates whether to prefer the router associated with this prefix over others", HFILL }},
5334 { &hf_icmpv6_opt_route_info_flag_reserved,
5335 { "Reserved", "icmpv6.opt.route_info.flag.reserved", FT_UINT8, BASE_DEC, NULL, ND_RA_FLAG_RESERV_MASK,
5336 "Must be 0", HFILL }},
5337 { &hf_icmpv6_opt_route_lifetime,
5338 { "Route Lifetime", "icmpv6.opt.route_lifetime", FT_UINT32, BASE_DEC|BASE_SPECIAL_VALS, VALS(unique_infinity), 0x00,
5339 "The length of time in seconds that the prefix is valid for the purpose of route determination", HFILL }},
5340 { &hf_icmpv6_opt_name_type,
5341 { "Name Type", "icmpv6.opt.name_type", FT_UINT8, BASE_DEC, VALS(icmpv6_option_name_type_vals), 0x0,
5342 NULL, HFILL }},
5343 { &hf_icmpv6_opt_name_x501,
5344 { "DER Encoded X.501 Name", "icmpv6.opt.name_x501", FT_BYTES, BASE_NONE, NULL, 0x0,
5345 NULL, HFILL }},
5346 { &hf_icmpv6_opt_name_fqdn,
5347 { "FQDN", "icmpv6.opt.name_type.fqdn", FT_STRING, BASE_NONE, NULL, 0x0,
5348 NULL, HFILL }},
5349 { &hf_icmpv6_opt_cert_type,
5350 { "Cert Type", "icmpv6.opt.cert_type", FT_UINT8, BASE_DEC, VALS(icmpv6_option_cert_type_vals), 0x0,
5351 NULL, HFILL }},
5352 /* RFC3971: SEcure Neighbor Discovery (SEND) */
5353 { &hf_icmpv6_send_identifier,
5354 { "Identifier", "icmpv6.send.identifier", FT_UINT16, BASE_DEC, NULL, 0x0,
5355 "An identifier to aid in matching with Request and Reply", HFILL }},
5356 { &hf_icmpv6_send_all_components,
5357 { "All Components", "icmpv6.send.all_components", FT_UINT16, BASE_DEC, NULL, 0x0,
5358 "Inform the receiver of the number of certificates in the entire path", HFILL }},
5359 { &hf_icmpv6_send_component,
5360 { "Component", "icmpv6.send.component", FT_UINT16, BASE_DEC, NULL, 0x0,
5361 "If the field is set to 65,535 if the sender seeks to retrieve all certificates", HFILL }},
5363 { &hf_icmpv6_x509if_Name,
5364 { "Name", "icmpv6.x509_Name", FT_UINT32, BASE_DEC, VALS(x509if_Name_vals), 0x0,
5365 NULL, HFILL }},
5366 { &hf_icmpv6_x509af_Certificate,
5367 { "Certificate", "icmpv6.x509_Certificate", FT_NONE, BASE_NONE, NULL, 0x0,
5368 NULL, HFILL }},
5369 { &hf_icmpv6_opt_redirected_packet,
5370 { "Redirected Packet", "icmpv6.opt.redirected_packet", FT_NONE, BASE_NONE, NULL, 0x0,
5371 NULL, HFILL }},
5372 { &hf_icmpv6_opt_mtu,
5373 { "MTU", "icmpv6.opt.mtu", FT_UINT32, BASE_DEC, NULL, 0x0,
5374 "The recommended MTU for the link", HFILL }},
5375 { &hf_icmpv6_opt_nbma_shortcut_limit,
5376 { "Shortcut Limit", "icmpv6.opt.nbma.shortcut_limit", FT_UINT8, BASE_DEC, NULL, 0x0,
5377 "Hop limit for shortcut attempt", HFILL }},
5378 { &hf_icmpv6_opt_advertisement_interval,
5379 { "Advertisement Interval", "icmpv6.opt.advertisement_interval", FT_UINT32, BASE_DEC, NULL, 0x0,
5380 "The maximum time (in milliseconds) between successive unsolicited Router Advertisement messages sent by this router on this network interface", HFILL }},
5381 { &hf_icmpv6_opt_home_agent_preference,
5382 { "Home Agent Preference", "icmpv6.opt.home_agent_preference", FT_UINT16, BASE_DEC, NULL, 0x0,
5383 "The preference for the home agent sending this Router Advertisement", HFILL }},
5384 { &hf_icmpv6_opt_home_agent_lifetime,
5385 { "Home Agent Preference", "icmpv6.opt.home_agent_lifetime", FT_UINT16, BASE_DEC, NULL, 0x0,
5386 "The lifetime associated with the home agent in units of seconds.", HFILL }},
5387 { &hf_icmpv6_opt_ipv6_address,
5388 { "IPv6 Address", "icmpv6.opt.ipv6_address", FT_IPv6, BASE_NONE, NULL, 0x0,
5389 "IPv6 addresses of the interface", HFILL }},
5390 { &hf_icmpv6_opt_rdnss_lifetime,
5391 { "Lifetime", "icmpv6.opt.rdnss.lifetime", FT_UINT32, BASE_DEC|BASE_SPECIAL_VALS, VALS(rdnss_infinity), 0x0,
5392 NULL, HFILL }},
5393 { &hf_icmpv6_opt_rdnss,
5394 { "Recursive DNS Servers", "icmpv6.opt.rdnss", FT_IPv6, BASE_NONE, NULL, 0x0,
5395 NULL, HFILL }},
5396 { &hf_icmpv6_opt_efo,
5397 { "Flags Expansion Option", "icmpv6.opt.efo", FT_UINT16, BASE_HEX, NULL, 0x0,
5398 NULL, HFILL }},
5399 { &hf_icmpv6_opt_efo_m,
5400 { "Managed address configuration", "icmpv6.opt.efo.m", FT_BOOLEAN, 16, TFS(&tfs_set_notset), FLAGS_EO_M,
5401 "When set, it indicates that addresses are available via DHCPv6", HFILL }},
5402 { &hf_icmpv6_opt_efo_o,
5403 { "Other configuration", "icmpv6.opt.efo.o", FT_BOOLEAN, 16, TFS(&tfs_set_notset), FLAGS_EO_O,
5404 "When set, it indicates that other configuration information is available via DHCPv6", HFILL }},
5405 { &hf_icmpv6_opt_efo_h,
5406 { "Home Agent", "icmpv6.opt.efo.h", FT_BOOLEAN, 16, TFS(&tfs_set_notset), FLAGS_EO_H,
5407 "When set, it indicate that the router sending this Router Advertisement is also functioning as a Mobile IPv6 home agent on this link", HFILL }},
5408 { &hf_icmpv6_opt_efo_prf,
5409 { "Prf (Default Router Preference)", "icmpv6.opt.efo.prf", FT_UINT16, BASE_DEC, VALS(nd_flag_router_pref), FLAGS_EO_PRF,
5410 "Indicates whether to prefer this router over other default routers", HFILL }},
5411 { &hf_icmpv6_opt_efo_p,
5412 { "Proxy", "icmpv6.opt.efo.p", FT_BOOLEAN, 16, TFS(&tfs_set_notset), FLAGS_EO_P,
5413 NULL, HFILL }},
5414 { &hf_icmpv6_opt_efo_rsv,
5415 { "Reserved", "icmpv6.opt.efo.rsv", FT_UINT16, BASE_DEC, NULL, FLAGS_EO_RSV,
5416 "Must be Zero", HFILL }},
5417 { &hf_icmpv6_opt_hkr_pad_length,
5418 { "Pad Length", "icmpv6.opt.hkr.pad_length", FT_UINT8, BASE_DEC, NULL, 0x0,
5419 "The number of padding octets beyond the end of the Handover Key", HFILL }},
5420 { &hf_icmpv6_opt_hkr_at,
5421 { "AT", "icmpv6.opt.hkr.at", FT_UINT8, BASE_DEC, NULL, 0xF0,
5422 "The algorithm type field describing the algorithm used by FMIPv6 to calculate the authenticator", HFILL }},
5423 { &hf_icmpv6_opt_hkr_reserved,
5424 { "Reserved", "icmpv6.opt.hkr.reserved", FT_UINT8, BASE_DEC, NULL, 0x0F,
5425 "Reserved (Must be Zero)", HFILL }},
5426 { &hf_icmpv6_opt_hkr_encryption_public_key,
5427 { "Handover Key Encryption Public Key", "icmpv6.opt.hkr.encryption_public_key", FT_BYTES, BASE_NONE, NULL, 0x0,
5428 NULL, HFILL }},
5429 { &hf_icmpv6_opt_hkr_padding,
5430 { "Padding", "icmpv6.opt.hkr.padding", FT_BYTES, BASE_NONE, NULL, 0x0,
5431 "A variable-length field making the option length a multiple of 8", HFILL }},
5432 { &hf_icmpv6_opt_hkr_lifetime,
5433 { "Padding", "icmpv6.opt.hkr.lifetime", FT_UINT16, BASE_DEC, NULL, 0x0,
5434 "Lifetime of the handover key (in seconds)", HFILL }},
5435 { &hf_icmpv6_opt_hkr_encrypted_handover_key,
5436 { "Encrypted Handover Key", "icmpv6.opt.hkr.encrypted_handover_key", FT_BYTES, BASE_NONE, NULL, 0x0,
5437 "The shared handover key, encrypted with the MN's handover key encryption public key", HFILL }},
5438 { &hf_icmpv6_opt_hai_option_code,
5439 { "Option-Code", "icmpv6.opt.hai.option_code", FT_UINT8, BASE_DEC, VALS(nd_opt_hai_option_code_val), 0x0,
5440 NULL, HFILL }},
5441 { &hf_icmpv6_opt_hai_length,
5442 { "HAI-Length", "icmpv6.opt.hai.length", FT_UINT8, BASE_DEC, NULL, 0x0,
5443 "The size of the HAI-Value field in octets", HFILL }},
5444 { &hf_icmpv6_opt_hai_value,
5445 { "HAI-Value", "icmpv6.opt.hai.value", FT_BYTES, BASE_NONE, NULL, 0x0,
5446 "The value specified by the Option-Code", HFILL }},
5447 { &hf_icmpv6_opt_mn_option_code,
5448 { "Option-Code", "icmpv6.opt.mn.option_code", FT_UINT8, BASE_DEC, VALS(nd_opt_mn_option_code_val), 0x0,
5449 NULL, HFILL }},
5450 { &hf_icmpv6_opt_mn_length,
5451 { "MN-Length", "icmpv6.opt.mn.length", FT_UINT8, BASE_DEC, NULL, 0x0,
5452 "The size of the MN-Value field in octets", HFILL }},
5453 { &hf_icmpv6_opt_mn_value,
5454 { "MN-Value", "icmpv6.opt.mn.value", FT_BYTES, BASE_NONE, NULL, 0x0,
5455 "The value specified by the Option-Code", HFILL }},
5456 { &hf_icmpv6_opt_dnssl_lifetime,
5457 { "Lifetime", "icmpv6.opt.dnssl.lifetime", FT_UINT32, BASE_DEC|BASE_SPECIAL_VALS, VALS(dnssl_infinity), 0x0,
5458 NULL, HFILL }},
5459 { &hf_icmpv6_opt_dnssl,
5460 { "Domain Names", "icmpv6.opt.dnssl", FT_STRING, BASE_NONE, NULL, 0x0,
5461 NULL, HFILL }},
5462 { &hf_icmpv6_opt_aro_status,
5463 { "Status", "icmpv6.opt.aro.status", FT_UINT8, BASE_DEC, VALS(nd_opt_earo_status_val), 0x00,
5464 "Indicates the status of a registration in the NA response", HFILL }},
5465 { &hf_icmpv6_opt_earo_opaque,
5466 { "Opaque", "icmpv6.opt.earo.opaque", FT_UINT8, BASE_HEX, NULL, 0x00,
5467 "An opaque field whose content is dictated by flag I", HFILL }},
5468 { &hf_icmpv6_opt_earo_flag,
5469 { "Flags", "icmpv6.opt.earo.flag", FT_UINT8, BASE_HEX, NULL, 0x0,
5470 NULL, HFILL }},
5471 { &hf_icmpv6_opt_earo_flag_p,
5472 { "P", "icmpv6.opt.earo.flag.p", FT_UINT8, BASE_DEC, VALS(nd_opt_earo_p_val), ND_OPT_EARO_FLAG_P,
5473 "Registered address type", HFILL }},
5474 { &hf_icmpv6_opt_earo_flag_i,
5475 { "I", "icmpv6.opt.earo.flag.i", FT_UINT8, BASE_DEC, VALS(nd_opt_earo_i_val), ND_OPT_EARO_FLAG_I,
5476 "Indicates the contents of the Opaque field", HFILL }},
5477 { &hf_icmpv6_opt_earo_flag_r,
5478 { "R", "icmpv6.opt.earo.flag.r", FT_BOOLEAN, 8, TFS(&tfs_set_notset), ND_OPT_EARO_FLAG_R,
5479 "Request reachability services for the Registered Address from a Routing Registrar", HFILL }},
5480 { &hf_icmpv6_opt_earo_flag_t,
5481 { "T", "icmpv6.opt.earo.flag.t", FT_BOOLEAN, 8, TFS(&tfs_set_notset), ND_OPT_EARO_FLAG_T,
5482 "When 0, the Transaction ID field must be ignored", HFILL }},
5483 { &hf_icmpv6_opt_earo_tid,
5484 { "TID (Transaction ID)", "icmpv6.opt.earo.tid", FT_UINT8, BASE_DEC, NULL, 0x00,
5485 "Unsigned integer maintained by the node and incremented with each registration.", HFILL }},
5486 { &hf_icmpv6_opt_aro_registration_lifetime,
5487 { "Registration Lifetime", "icmpv6.opt.aro.registration_lifetime", FT_UINT16, BASE_DEC, NULL, 0x00,
5488 "The amount of time (in a unit of 60 seconds) that the router should retain the Neighbor Cache entry", HFILL }},
5489 { &hf_icmpv6_opt_aro_eui64,
5490 { "EUI-64", "icmpv6.opt.aro.eui64", FT_EUI64, BASE_NONE, NULL, 0x00,
5491 "This field is used to uniquely identify the interface of the registered address", HFILL }},
5492 { &hf_icmpv6_opt_6co_context_length,
5493 { "Context Length", "icmpv6.opt.6co.context_length", FT_UINT8, BASE_DEC, NULL, 0x00,
5494 "The number of leading bits in the Context Prefix field that are valid", HFILL }},
5495 { &hf_icmpv6_opt_6co_flag,
5496 { "Flag", "icmpv6.opt.6co.flag", FT_UINT8, BASE_HEX, NULL, 0x00,
5497 NULL, HFILL }},
5498 { &hf_icmpv6_opt_6co_flag_c,
5499 { "Compression Flag", "icmpv6.opt.6co.flag.c", FT_BOOLEAN, 8, TFS(&tfs_set_notset), ND_OPT_6CO_FLAG_C,
5500 "This flag indicates if the context is valid for use in compression", HFILL }},
5501 { &hf_icmpv6_opt_6co_flag_cid,
5502 { "CID", "icmpv6.opt.6co.flag.cid", FT_UINT8, BASE_DEC, NULL, ND_OPT_6CO_FLAG_CID,
5503 "Context Identifier for this prefix information", HFILL }},
5504 { &hf_icmpv6_opt_6co_flag_reserved,
5505 { "Reserved", "icmpv6.opt.6co.flag.reserved", FT_UINT8, BASE_DEC, NULL, ND_OPT_6CO_FLAG_RESERVED,
5506 "Must be zero", HFILL }},
5507 { &hf_icmpv6_opt_6co_valid_lifetime,
5508 { "Lifetime", "icmpv6.opt.6co.valid_lifetime", FT_UINT16, BASE_DEC, NULL, 0x00,
5509 "The length of time in a unit of 60 seconds that the context is valid for the purpose of header compression or decompression", HFILL }},
5510 { &hf_icmpv6_opt_6co_context_prefix,
5511 { "Context Prefix", "icmpv6.opt.6co.context_prefix", FT_IPv6, BASE_NONE, NULL, 0x00,
5512 "The IPv6 prefix or address corresponding to the Context ID (CID) field", HFILL }},
5513 { &hf_icmpv6_opt_abro_version_low,
5514 { "Version Low", "icmpv6.opt.abro.version_low", FT_UINT16, BASE_DEC, NULL, 0x00,
5515 "The version number low (the least significant 16 bits) corresponding to this set of information contained in the RA message", HFILL }},
5516 { &hf_icmpv6_opt_abro_version_high,
5517 { "Version", "icmpv6.opt.abro.version_high", FT_UINT16, BASE_DEC, NULL, 0x00,
5518 "The version number high (most significant 16 bits) corresponding to this set of information contained in the RA message", HFILL }},
5519 { &hf_icmpv6_opt_abro_valid_lifetime,
5520 { "Valid Lifetime", "icmpv6.opt.abro.valid_lifetime", FT_UINT16, BASE_DEC, NULL, 0x00,
5521 "The length of time in a unit of 60 seconds (relative to the time the packet is received) that this set of border router information is valid.", HFILL }},
5522 { &hf_icmpv6_opt_abro_6lbr_address,
5523 { "6LBR Address", "icmpv6.opt.abro.6lbr_address", FT_IPv6, BASE_NONE, NULL, 0x00,
5524 "IPv6 address of the 6LBR that is the origin of the included version number", HFILL }},
5525 { &hf_icmpv6_opt_6cio_unassigned1,
5526 { "Unassigned", "icmpv6.opt.6cio.unassigned1", FT_UINT16, BASE_HEX, NULL, ND_OPT_6CIO_FLAG_UNASSIGNED,
5527 NULL, HFILL }},
5528 { &hf_icmpv6_opt_6cio_flag_g,
5529 { "G", "icmpv6.opt.6cio.flag_g", FT_UINT16, BASE_HEX, NULL, ND_OPT_6CIO_FLAG_G,
5530 NULL, HFILL }},
5531 { &hf_icmpv6_opt_6cio_unassigned2,
5532 { "Unassigned", "icmpv6.opt.6cio.unassigned2", FT_UINT32, BASE_HEX, NULL, 0x00,
5533 NULL, HFILL }},
5535 { &hf_icmpv6_opt_captive_portal,
5536 { "Captive Portal", "icmpv6.opt.captive_portal", FT_STRING, BASE_NONE, NULL, 0x00,
5537 "The contact URI for the captive portal that the user should connect to", HFILL }},
5539 { &hf_icmpv6_opt_pref64_scaled_lifetime,
5540 { "Scaled Lifetime", "icmpv6.opt.pref64.scaled_lifetime", FT_UINT16, BASE_DEC, NULL, ND_OPT_PREF64_SL,
5541 "The maximum time in units of 8 seconds over which this NAT64 prefix MAY be used", HFILL }},
5542 { &hf_icmpv6_opt_pref64_plc,
5543 { "PLC (Prefix Length Code)", "icmpv6.opt.pref64.plc", FT_UINT16, BASE_HEX, VALS(pref64_plc_str), ND_OPT_PREF64_PLC,
5544 "This field encodes the NAT64 Prefix Length", HFILL }},
5545 { &hf_icmpv6_opt_pref64_prefix,
5546 { "Prefix", "icmpv6.opt.pref64.prefix", FT_IPv6, BASE_NONE, NULL, 0x00,
5547 "NAT64 Prefix", HFILL }},
5549 /* RFC2710: Multicast Listener Discovery for IPv6 */
5550 { &hf_icmpv6_mld_mrd,
5551 { "Maximum Response Delay [ms]", "icmpv6.mld.maximum_response_delay", FT_UINT16, BASE_DEC, NULL, 0x0,
5552 "Specifies the maximum allowed delay before sending a responding Report, in units of milliseconds", HFILL }},
5553 { &hf_icmpv6_mld_multicast_address,
5554 { "Multicast Address", "icmpv6.mld.multicast_address", FT_IPv6, BASE_NONE, NULL, 0x0,
5555 "Specific IPv6 multicast address", HFILL }},
5556 /* RFC 2894: Router Renumbering for IPv6 */
5557 { &hf_icmpv6_rr_sequencenumber,
5558 { "Sequence Number", "icmpv6.rr.sequence_number", FT_UINT32, BASE_DEC, NULL, 0x0,
5559 "The sequence number MUST be non-decreasing between Sequence Number Resets", HFILL }},
5560 { &hf_icmpv6_rr_segmentnumber,
5561 { "Segment Number", "icmpv6.rr.segment_number", FT_UINT8, BASE_DEC, NULL, 0x0,
5562 "Enumerates different valid RR messages having the same Sequence Number", HFILL }},
5563 { &hf_icmpv6_rr_flag,
5564 { "Flags", "icmpv6.rr.flag", FT_UINT8, BASE_HEX, NULL, 0x0,
5565 "Five are defined and three bits are reserved", HFILL }},
5566 { &hf_icmpv6_rr_flag_t,
5567 { "Test Command", "icmpv6.rr.flag.t", FT_BOOLEAN, 8, TFS(&tfs_set_notset), RR_FLAG_T,
5568 "Indicates a Test message: processing is to be simulated and no configuration changes are to be made", HFILL }},
5569 { &hf_icmpv6_rr_flag_r,
5570 { "Result requested", "icmpv6.rr.flag.r", FT_BOOLEAN, 8, TFS(&tfs_set_notset), RR_FLAG_R,
5571 "Indicates that the router send a Result message upon completion of processing the Command message", HFILL }},
5572 { &hf_icmpv6_rr_flag_a,
5573 { "All Interfaces", "icmpv6.rr.flag.a", FT_BOOLEAN, 8, TFS(&tfs_set_notset), RR_FLAG_A,
5574 "Indicates that the Command be applied to all interfaces regardless of administrative shutdown status", HFILL }},
5575 { &hf_icmpv6_rr_flag_s,
5576 { "Site-specific", "icmpv6.rr.flag.s", FT_BOOLEAN, 8, TFS(&tfs_set_notset), RR_FLAG_S,
5577 "Indicates that the Command be applied only to interfaces which belong to the same site as the interface to which the Command is addressed", HFILL }},
5578 { &hf_icmpv6_rr_flag_p,
5579 { "Processed previously", "icmpv6.rr.flag.p", FT_BOOLEAN, 8, TFS(&tfs_set_notset), RR_FLAG_P,
5580 "Indicates that the Command message was previously processed (and is not a Test) and the responding router is not processing it again", HFILL }},
5581 { &hf_icmpv6_rr_flag_rsv,
5582 { "Reserved", "icmpv6.rr.flag.rsv", FT_UINT8, BASE_DEC, NULL, RR_FLAG_RSV,
5583 "Must be Zero", HFILL }},
5584 { &hf_icmpv6_rr_maxdelay,
5585 { "Max Delay", "icmpv6.rr.maxdelay", FT_UINT16, BASE_DEC, NULL, 0x0,
5586 "Specifying the maximum time (in milliseconds) by which a router MUST delay sending any reply to this Command", HFILL }},
5588 { &hf_icmpv6_rr_pco_mp_part,
5589 { "Match-Prefix Part", "icmpv6.rr.pco.mp", FT_NONE, BASE_NONE, NULL, 0x0,
5590 NULL, HFILL }},
5591 { &hf_icmpv6_rr_pco_mp_opcode,
5592 { "OpCode", "icmpv6.rr.pco.mp.opcode", FT_UINT8, BASE_DEC, VALS(rr_pco_mp_opcode_val), 0x0,
5593 "Specifying the operation to be performed when the associated MatchPrefix matches an interface's prefix or address", HFILL }},
5594 { &hf_icmpv6_rr_pco_mp_oplength,
5595 { "OpLength", "icmpv6.rr.pco.mp.oplength", FT_UINT8, BASE_DEC, NULL, 0x0,
5596 "The total length of this Prefix Control Operation (in units of 8 octets)", HFILL }},
5597 { &hf_icmpv6_rr_pco_mp_ordinal,
5598 { "Ordinal", "icmpv6.rr.pco.mp.ordinal", FT_UINT8, BASE_HEX, NULL, 0x0,
5599 "The value is otherwise unconstrained", HFILL }},
5600 { &hf_icmpv6_rr_pco_mp_matchlen,
5601 { "MatchLen", "icmpv6.rr.pco.mp.matchlen", FT_UINT8, BASE_DEC, NULL, 0x0,
5602 "Between 0 and 128 inclusive specifying the number of initial bits of MatchPrefix which are significant in matching", HFILL }},
5603 { &hf_icmpv6_rr_pco_mp_minlen,
5604 { "MinLen", "icmpv6.rr.pco.mp.minlen", FT_UINT8, BASE_DEC, NULL, 0x0,
5605 "Specifying the minimum length which any configured prefix must have in order to be eligible for testing against the MatchPrefix", HFILL }},
5606 { &hf_icmpv6_rr_pco_mp_maxlen,
5607 { "MaxLen", "icmpv6.rr.pco.mp.maxlen", FT_UINT8, BASE_DEC, NULL, 0x0,
5608 "Specifying the maximum length which any configured prefix must have in order to be eligible for testing against the MatchPrefix", HFILL }},
5609 { &hf_icmpv6_rr_pco_mp_matchprefix,
5610 { "MatchPrefix", "icmpv6.rr.pco.mp.matchprefix", FT_IPv6, BASE_NONE, NULL, 0x0,
5611 "The 128-bit prefix to be compared with each interface's prefix or address", HFILL }},
5612 { &hf_icmpv6_rr_pco_up_part,
5613 { "Use-Prefix Part", "icmpv6.rr.pco.up", FT_NONE, BASE_NONE, NULL, 0x0,
5614 NULL, HFILL }},
5615 { &hf_icmpv6_rr_pco_up_uselen,
5616 { "UseLen", "icmpv6.rr.pco.up.uselen", FT_UINT8, BASE_DEC, NULL, 0x0,
5617 "specifying the number of initial bits of UsePrefix to use in creating a new prefix for an interface", HFILL }},
5618 { &hf_icmpv6_rr_pco_up_keeplen,
5619 { "KeepLen", "icmpv6.rr.pco.up.keeplen", FT_UINT8, BASE_DEC, NULL, 0x0,
5620 "Specifying the number of bits of the prefix or address which matched the associated Match-Prefix which should be retained in the new prefix", HFILL }},
5621 { &hf_icmpv6_rr_pco_up_flagmask,
5622 { "FlagMask", "icmpv6.rr.pco.up.flagmask", FT_UINT8, BASE_HEX, NULL, 0x0,
5623 "A 1 bit in any position means that the corresponding flag bit in a Router Advertisement (RA) Prefix Information Option for the New Prefix should be set from the RAFlags field in this Use-Prefix Part", HFILL }},
5625 { &hf_icmpv6_rr_pco_up_flagmask_l,
5626 { "On-link flag(L)", "icmpv6.rr.pco.up.flagmask.l", FT_BOOLEAN, 8, TFS(&tfs_set_notset), 0x80,
5627 "When set, indicates the On-link (L) flag bit in a Router Advertisement (RA) Prefix Information Option for the New Prefix should be set from the RAFlags field in this Use-Prefix Part", HFILL }},
5628 { &hf_icmpv6_rr_pco_up_flagmask_a,
5629 { "Autonomous address-configuration flag(A)", "icmpv6.rr.pco.up.flagmask.a", FT_BOOLEAN, 8, TFS(&tfs_set_notset), 0x40,
5630 "When set, indicates the Autonomous address-configuration (A) flag bit in a Router Advertisement (RA) Prefix Information Option for the New Prefix should be set from the RAFlags field in this Use-Prefix Part", HFILL }},
5631 { &hf_icmpv6_rr_pco_up_flagmask_reserved,
5632 { "Reserved", "icmpv6.rr.pco.up.flagmask.reserved", FT_UINT8, BASE_DEC, NULL, 0x3f,
5633 NULL, HFILL }},
5634 { &hf_icmpv6_rr_pco_up_raflags,
5635 { "RAFlags", "icmpv6.rr.pco.up.raflags", FT_UINT8, BASE_HEX, NULL, 0x0,
5636 "Under control of the FlagMask field, may be used to initialize the flags in Router Advertisement Prefix Information Options which advertise the New Prefix", HFILL }},
5637 { &hf_icmpv6_rr_pco_up_raflags_l,
5638 { "On-link flag(L)", "icmpv6.rr.pco.up.flagmask.l", FT_BOOLEAN, 8, TFS(&tfs_set_notset), 0x80,
5639 "When set, indicates that this prefix can be used for on-link determination", HFILL }},
5640 { &hf_icmpv6_rr_pco_up_raflags_a,
5641 { "Autonomous address-configuration flag(A)", "icmpv6.rr.pco.up.flagmask.a", FT_BOOLEAN, 8, TFS(&tfs_set_notset), 0x40,
5642 "When set indicates that this prefix can be used for stateless address configuration", HFILL }},
5643 { &hf_icmpv6_rr_pco_up_raflags_reserved,
5644 { "Reserved", "icmpv6.rr.pco.up.flagmask.reserved", FT_UINT8, BASE_DEC, NULL, 0x3f,
5645 NULL, HFILL }},
5646 { &hf_icmpv6_rr_pco_up_validlifetime,
5647 { "Valid Lifetime", "icmpv6.rr.pco.up.validlifetime", FT_UINT32, BASE_DEC|BASE_SPECIAL_VALS, VALS(unique_infinity), 0x0,
5648 "The number of seconds for which the New Prefix will be valid", HFILL }},
5649 { &hf_icmpv6_rr_pco_up_preferredlifetime,
5650 { "Preferred Lifetime", "icmpv6.rr.pco.up.preferredlifetime", FT_UINT32, BASE_DEC|BASE_SPECIAL_VALS, VALS(unique_infinity), 0x0,
5651 "The number of seconds for which the New Prefix will be preferred", HFILL }},
5652 { &hf_icmpv6_rr_pco_up_flag,
5653 { "Flags", "icmpv6.rr.pco.up.flag", FT_UINT32, BASE_HEX, NULL, 0x0,
5654 NULL, HFILL }},
5655 { &hf_icmpv6_rr_pco_up_flag_v,
5656 { "Decrement valid lifetime", "icmpv6.rr.pco.up.flag.v", FT_BOOLEAN, 32, TFS(&tfs_set_notset), 0x80000000,
5657 "When set, indicating that the valid lifetime of the New Prefix MUST be effectively decremented in real time", HFILL }},
5658 { &hf_icmpv6_rr_pco_up_flag_p,
5659 { "Decrement preferred lifetime", "icmpv6.rr.pco.up.flag.p", FT_BOOLEAN, 32, TFS(&tfs_set_notset), 0x40000000,
5660 "When set, indicating that the preferred lifetime of the New Prefix MUST be effectively decremented in real time", HFILL }},
5661 { &hf_icmpv6_rr_pco_up_flag_reserved,
5662 { "Reserved", "icmpv6.rr.pco.up.flag.reserved", FT_UINT32, BASE_DEC, NULL, 0x3FFFFFFF,
5663 NULL, HFILL }},
5664 { &hf_icmpv6_rr_pco_up_useprefix,
5665 { "UsePrefix", "icmpv6.rr.pco.up.useprefix", FT_IPv6, BASE_NONE, NULL, 0x0,
5666 "The 128-bit Use-prefix which either becomes or is used in forming (if KeepLen is nonzero) the New Prefix", HFILL }},
5667 { &hf_icmpv6_rr_rm,
5668 { "Result Message", "icmpv6.rr.rm", FT_NONE, BASE_NONE, NULL, 0x0,
5669 NULL, HFILL }},
5670 { &hf_icmpv6_rr_rm_flag,
5671 { "Flags", "icmpv6.rr.rm.flag", FT_UINT16, BASE_HEX, NULL, 0x0,
5672 NULL, HFILL }},
5673 { &hf_icmpv6_rr_rm_flag_b,
5674 { "Bounds", "icmpv6.rr.rm.flag.b", FT_BOOLEAN, 16, TFS(&tfs_set_notset), 0x0002,
5675 "When set, indicates that one or more fields in the associated PCO were out of bounds", HFILL }},
5676 { &hf_icmpv6_rr_rm_flag_f,
5677 { "Forbidden", "icmpv6.rr.rm.flag.f", FT_BOOLEAN, 16, TFS(&tfs_set_notset), 0x0001,
5678 "When set, indicates that one or more Use-Prefix parts from the associated PCO were not honored by the router because of attempted formation of a forbidden prefix format, such as a multicast or loopback address", HFILL }},
5679 { &hf_icmpv6_rr_rm_flag_reserved,
5680 { "Reserved", "icmpv6.rr.rm.flag.reserved", FT_UINT16, BASE_DEC, NULL, 0xFFFC,
5681 "Must be Zero", HFILL }},
5682 { &hf_icmpv6_rr_rm_ordinal,
5683 { "Ordinal", "icmpv6.rr.rm.ordinal", FT_UINT8, BASE_HEX, NULL, 0x0,
5684 "The value is otherwise unconstrained", HFILL }},
5685 { &hf_icmpv6_rr_rm_matchedlen,
5686 { "MatchedLen", "icmpv6.rr.rm.matchedlen", FT_UINT8, BASE_DEC, NULL, 0x0,
5687 "The length of the Matched Prefix", HFILL }},
5688 { &hf_icmpv6_rr_rm_interfaceindex,
5689 { "InterfaceIndex", "icmpv6.rr.rm.interfaceindex", FT_UINT32, BASE_DEC, NULL, 0x0,
5690 "The router's numeric designation of the interface on which the MatchedPrefix was configured", HFILL }},
5691 { &hf_icmpv6_rr_rm_matchedprefix,
5692 { "MatchedPrefix", "icmpv6.rr.rm.matchedprefix", FT_IPv6, BASE_NONE, NULL, 0x0,
5693 "The 128 Bits MatchedPrefix", HFILL }},
5695 /* RFC3775/6275: Mobility Support in IPv6 */
5696 { &hf_icmpv6_mip6_identifier,
5697 { "Identifier", "icmpv6.mip6.identifier", FT_UINT16, BASE_DEC_HEX, NULL, 0x0,
5698 "An identifier to aid in matching with Request and Reply", HFILL }},
5699 { &hf_icmpv6_mip6_home_agent_address,
5700 { "Home Agent Address", "icmpv6.mip6.home_agent_address", FT_IPv6, BASE_NONE, NULL, 0x0,
5701 "A list of addresses of home agents on the home link for the mobile node", HFILL }},
5702 { &hf_icmpv6_mip6_flag,
5703 { "Flags", "icmpv6.mip6.flag", FT_UINT16, BASE_HEX, NULL, 0x0,
5704 NULL, HFILL }},
5705 { &hf_icmpv6_mip6_flag_m,
5706 { "Managed address configuration", "icmpv6.mip6.flag.m", FT_BOOLEAN, 16, TFS(&tfs_set_notset), FLAGS_EO_M,
5707 "When set, it indicates that addresses are available via DHCPv6", HFILL }},
5708 { &hf_icmpv6_mip6_flag_o,
5709 { "Other configuration", "icmpv6.mip6.flag.o", FT_BOOLEAN, 16, TFS(&tfs_set_notset), FLAGS_EO_O,
5710 "When set, it indicates that other configuration information is available via DHCPv6", HFILL }},
5711 { &hf_icmpv6_mip6_flag_rsv,
5712 { "Reserved", "icmpv6.mip6.flag.rsv", FT_UINT16, BASE_DEC, NULL, 0x3FFF,
5713 "Must be Zero", HFILL }},
5715 /* RFC3810: Multicast Listener Discovery Version 2 (MLDv2) for IPv6 */
5716 { &hf_icmpv6_mld_mrc,
5717 { "Maximum Response Code", "icmpv6.mld.maximum_response_code", FT_UINT16, BASE_DEC, NULL, 0x0,
5718 "Specifies the maximum allowed delay before sending a responding Report", HFILL }},
5719 { &hf_icmpv6_mld_flag,
5720 { "Flags", "icmpv6.mld.flag", FT_UINT8, BASE_HEX, NULL, 0x0,
5721 NULL, HFILL }},
5722 { &hf_icmpv6_mld_flag_s,
5723 { "Suppress Router-Side Processing", "icmpv6.mld.flag.s", FT_BOOLEAN, 8, NULL, MLD_FLAG_S,
5724 "Indicates to any receiving multicast routers that they have to suppress the normal timer updates they perform upon hearing a Query", HFILL }},
5725 { &hf_icmpv6_mld_flag_qrv,
5726 { "QRV (Querier's Robustness Variable)", "icmpv6.mld.flag.qrv", FT_UINT8, BASE_DEC, NULL, MLD_FLAG_QRV,
5727 "Contains the RV (Robustness Variable) value used by the Querier", HFILL }},
5728 { &hf_icmpv6_mld_flag_rsv,
5729 { "Reserved", "icmpv6.mld.flag.reserved", FT_UINT8, BASE_DEC, NULL, MLD_FLAG_RSV,
5730 "Must Be Zero", HFILL }},
5731 { &hf_icmpv6_mld_qqi,
5732 { "QQIC (Querier's Query Interval Code)", "icmpv6.mld.qqi", FT_UINT8, BASE_DEC, NULL, 0x0,
5733 "Specifies the QI (Query Interval) used by the Querier", HFILL }},
5734 { &hf_icmpv6_mld_nb_sources,
5735 { "Number of Sources", "icmpv6.mld.nb_sources", FT_UINT16, BASE_DEC, NULL, 0x0,
5736 "Specifies how many source addresses are present in the Query", HFILL }},
5737 { &hf_icmpv6_mld_source_address,
5738 { "Source Address", "icmpv6.mld.source_address", FT_IPv6, BASE_NONE, NULL, 0x0,
5739 "The Source Address fields are a vector of unicast addresses", HFILL }},
5740 { &hf_icmpv6_mldr_nb_mcast_records,
5741 { "Number of Multicast Address Records", "icmpv6.mldr.nb_mcast_records", FT_UINT16, BASE_DEC, NULL, 0x0,
5742 "Specifies how many Multicast Address Records are present in this Report", HFILL }},
5743 { &hf_icmpv6_mldr_mar,
5744 { "Multicast Address Record", "icmpv6.mldr.mar", FT_NONE, BASE_NONE, NULL, 0x0,
5745 "Each Multicast Address Record is a block of fields that contain information on the sender listening to a single multicast address on the interface from which the Report is sent", HFILL }},
5746 { &hf_icmpv6_mldr_mar_record_type,
5747 { "Record Type", "icmpv6.mldr.mar.record_type", FT_UINT8, BASE_DEC, VALS(mldr_record_type_val), 0x0,
5748 "It specifies the type of the Multicast Address Record", HFILL }},
5749 { &hf_icmpv6_mldr_mar_aux_data_len,
5750 { "Aux Data Len", "icmpv6.mldr.mar.aux_data_len", FT_UINT8, BASE_DEC, NULL, 0x0,
5751 "The Aux Data Len field contains the length (in units of 32-bit words) of the Auxiliary Data Field in this Multicast Address Record", HFILL }},
5752 { &hf_icmpv6_mldr_mar_nb_sources,
5753 { "Number of Sources", "icmpv6.mldr.mar.nb_sources", FT_UINT16, BASE_DEC, NULL, 0x0,
5754 "The Number of Sources field specifies how many source addresses are present in this Multicast Address Record", HFILL }},
5755 { &hf_icmpv6_mldr_mar_multicast_address,
5756 { "Multicast Address", "icmpv6.mldr.mar.multicast_address", FT_IPv6, BASE_NONE, NULL, 0x0,
5757 "The Multicast Address field contains the multicast address to which this Multicast Address Record pertains", HFILL }},
5758 { &hf_icmpv6_mldr_mar_source_address,
5759 { "Source Address", "icmpv6.mldr.mar.source_address", FT_IPv6, BASE_NONE, NULL, 0x0,
5760 "The Source Address fields are a vector of unicast addresses", HFILL }},
5761 { &hf_icmpv6_mldr_mar_auxiliary_data,
5762 { "Auxiliary Data", "icmpv6.mldr.mar.auxiliary_data", FT_BYTES, BASE_NONE, NULL, 0x0,
5763 "Contains additional information that pertain to this Multicast Address Record", HFILL }},
5764 /* RFC 4068/5268/5568: Fast Handovers for Mobile IPv6 ( Mobile IPv6 Fast Handovers ) */
5765 { &hf_icmpv6_fmip6_subtype,
5766 { "Subtype", "icmpv6.fmip6.subtype", FT_UINT8, BASE_DEC, VALS(fmip6_subtype_val), 0x0,
5767 "Designates the Subtype of information", HFILL }},
5768 { &hf_icmpv6_fmip6_hi_flag,
5769 { "Flag", "icmpv6.fmip6.hi.flag", FT_UINT8, BASE_HEX, NULL, 0x00,
5770 NULL, HFILL }},
5771 { &hf_icmpv6_fmip6_hi_flag_s,
5772 { "Assigned address configuration", "icmpv6.fmip6.hi.flag.s", FT_BOOLEAN, 8, TFS(&tfs_set_notset), FMIP6_HI_FLAG_S,
5773 "When set, this message requests a new CoA to be returned by the destination", HFILL }},
5774 { &hf_icmpv6_fmip6_hi_flag_u,
5775 { "Buffer", "icmpv6.fmip6.hi.flag.a", FT_BOOLEAN, 8, TFS(&tfs_set_notset), FMIP6_HI_FLAG_U,
5776 "When set, the destination SHOULD buffer any packets toward the node indicated in the options of this message", HFILL }},
5777 { &hf_icmpv6_fmip6_hi_flag_reserved,
5778 { "Reserved", "icmpv6.fmip6.hi.flag.reserved", FT_UINT8, BASE_DEC, NULL, FMIP6_HI_FLAG_RSV,
5779 NULL, HFILL }},
5780 { &hf_icmpv6_fmip6_identifier,
5781 { "Identifier", "icmpv6.fmip6.identifier", FT_UINT16, BASE_DEC_HEX, NULL, 0x0,
5782 "An identifier to aid in matching with Request and Reply", HFILL }},
5784 /* RFC 4286: Multicast Router Discovery */
5785 { &hf_icmpv6_mcast_ra_query_interval,
5786 { "Query Interval", "icmpv6.mcast_ra.query_interval", FT_UINT16, BASE_DEC, NULL, 0x0,
5787 "The Query Interval value (in seconds) in use by MLD on the interface.", HFILL }},
5788 { &hf_icmpv6_mcast_ra_robustness_variable,
5789 { "Robustness Variable", "icmpv6.mcast_ra.robustness_variable", FT_UINT16, BASE_DEC, NULL, 0x0,
5790 "The Robustness Variable in use by MLD on the advertising interface", HFILL }},
5792 /* RFC 4620: IPv6 Node Information Queries */
5793 { &hf_icmpv6_ni_qtype,
5794 { "Qtype", "icmpv6.ni.qtype", FT_UINT16, BASE_DEC, VALS(ni_qtype_val), 0x0,
5795 "Designates the type of information", HFILL }},
5796 { &hf_icmpv6_ni_flag,
5797 { "Flags", "icmpv6.ni.flag", FT_UINT16, BASE_HEX, NULL, 0x0,
5798 "Qtype-specific flags that may be defined for certain Query types and their Replies", HFILL }},
5799 { &hf_icmpv6_ni_flag_g,
5800 { "Global-scope addresses", "icmpv6.ni.flag.g", FT_BOOLEAN, 16, TFS(&tfs_set_notset), NI_FLAG_G,
5801 "Global-scope addresses are requested", HFILL }},
5802 { &hf_icmpv6_ni_flag_s,
5803 { "Site-local addresses", "icmpv6.ni.flag.s", FT_BOOLEAN, 16, TFS(&tfs_set_notset), NI_FLAG_S,
5804 "Site-local addresses are requested", HFILL }},
5805 { &hf_icmpv6_ni_flag_l,
5806 { "Link-local addresses", "icmpv6.ni.flag.l", FT_BOOLEAN, 16, TFS(&tfs_set_notset), NI_FLAG_L,
5807 "Link-local addresses are requested", HFILL }},
5808 { &hf_icmpv6_ni_flag_c,
5809 { "Compression", "icmpv6.ni.flag.c", FT_BOOLEAN, 16, TFS(&tfs_set_notset), NI_FLAG_C,
5810 "IPv4-compatible (now deprecated) and IPv4-mapped addresses are requested", HFILL }},
5811 { &hf_icmpv6_ni_flag_a,
5812 { "Unicast Addresses", "icmpv6.ni.flag.a", FT_BOOLEAN, 16, TFS(&tfs_ni_flag_a), NI_FLAG_A,
5813 "Responder's unicast addresses", HFILL }},
5814 { &hf_icmpv6_ni_flag_t,
5815 { "Truncated", "icmpv6.ni.flag.t", FT_BOOLEAN, 16, TFS(&tfs_set_notset), NI_FLAG_T,
5816 "Defined in a Reply only, indicates that the set of addresses is incomplete for space reasons", HFILL }},
5817 { &hf_icmpv6_ni_flag_rsv,
5818 { "Reserved", "icmpv6.ni.flag.rsv", FT_UINT16, BASE_HEX, NULL, NI_FLAG_RSV,
5819 "Must be Zero", HFILL }},
5820 { &hf_icmpv6_ni_nonce,
5821 { "Nonce", "icmpv6.ni.nonce", FT_UINT64, BASE_HEX, NULL, 0x0,
5822 "An opaque 64-bit field", HFILL }},
5823 { &hf_icmpv6_ni_query_subject_ipv6,
5824 { "IPv6 subject address", "icmpv6.ni.query.subject_ipv6", FT_IPv6, BASE_NONE, NULL, 0x0,
5825 NULL, HFILL }},
5826 { &hf_icmpv6_ni_query_subject_fqdn,
5827 { "FQDN subject", "icmpv6.ni.query.subject_fqdn", FT_STRING, BASE_NONE, NULL, 0x0,
5828 NULL, HFILL }},
5829 { &hf_icmpv6_ni_query_subject_ipv4,
5830 { "IPv4 subject address", "icmpv6.ni.query.subject_ipv4", FT_IPv4, BASE_NONE, NULL, 0x0,
5831 NULL, HFILL }},
5832 { &hf_icmpv6_ni_reply_node_ttl,
5833 { "TTL", "icmpv6.ni.reply.node_ttl", FT_UINT32, BASE_DEC, NULL, 0x0,
5834 NULL, HFILL }},
5835 { &hf_icmpv6_ni_reply_node_name,
5836 { "Name Node", "icmpv6.ni.reply.node_name", FT_STRING, BASE_NONE, NULL, 0x0,
5837 NULL, HFILL }},
5838 { &hf_icmpv6_ni_reply_node_address,
5839 { "IPv6 Node address", "icmpv6.ni.reply.node_address", FT_IPv6, BASE_NONE, NULL, 0x0,
5840 NULL, HFILL }},
5841 { &hf_icmpv6_ni_reply_ipv4_address,
5842 { "IPv4 Node address", "icmpv6.ni.reply.ipv4_address", FT_IPv4, BASE_NONE, NULL, 0x0,
5843 NULL, HFILL }},
5845 /* RFC 4884: Extended ICMP */
5846 { &hf_icmpv6_length,
5847 { "Length of original datagram", "icmpv6.length", FT_UINT8, BASE_DEC, NULL, 0x0,
5848 "The length of the original datagram", HFILL }},
5850 /* RPL: RFC 6550 : Routing over Low-Power and Lossy Networks. */
5851 { &hf_icmpv6_rpl_dis_flag,
5852 { "Flags", "icmpv6.rpl.dis.flags", FT_UINT8, BASE_DEC, NULL, 0x0,
5853 "8-bit unused field reserved for flags", HFILL }},
5854 { &hf_icmpv6_rpl_dio_instance,
5855 { "RPLInstanceID", "icmpv6.rpl.dio.instance", FT_UINT8, BASE_DEC, NULL, 0x0,
5856 "Set by the DODAG root that indicates which RPL Instance the DODAG is part of", HFILL }},
5857 { &hf_icmpv6_rpl_dio_version,
5858 { "Version", "icmpv6.rpl.dio.version", FT_UINT8, BASE_DEC, NULL, 0x0,
5859 "Set by the DODAG root to the DODAGVersionNumber", HFILL }},
5860 { &hf_icmpv6_rpl_dio_rank,
5861 { "Rank", "icmpv6.rpl.dio.rank", FT_UINT16, BASE_DEC, NULL, 0x0,
5862 "Indicating the DODAG rank of the node sending the DIO message", HFILL }},
5863 { &hf_icmpv6_rpl_dio_flag,
5864 { "Flags", "icmpv6.rpl.dio.flag", FT_UINT8, BASE_HEX, NULL, 0x0,
5865 NULL, HFILL }},
5866 { &hf_icmpv6_rpl_dio_flag_g,
5867 { "Grounded (G)", "icmpv6.rpl.dio.flag.g", FT_BOOLEAN, 8, NULL, RPL_DIO_FLAG_G,
5868 "Indicates whether the DODAG advertised can satisfy the application-defined goal", HFILL }},
5869 { &hf_icmpv6_rpl_dio_flag_0,
5870 { "Zero", "icmpv6.rpl.dio.flag.0", FT_BOOLEAN, 8, NULL, RPL_DIO_FLAG_0,
5871 NULL, HFILL }},
5872 { &hf_icmpv6_rpl_dio_flag_mop,
5873 { "Mode of Operation (MOP)", "icmpv6.rpl.dio.flag.mop", FT_UINT8, BASE_HEX, VALS(rpl_dio_map_val), RPL_DIO_FLAG_MOP,
5874 "Identifies the mode of operation of the RPL Instance as administratively provisioned at and distributed by the DODAG Root", HFILL }},
5875 { &hf_icmpv6_rpl_dio_flag_prf,
5876 { "DODAG Preference", "icmpv6.rpl.dio.flag.preference", FT_UINT8, BASE_DEC, NULL, RPL_DIO_FLAG_PRF,
5877 "Defines how preferable the root of this DODAG is compared to other DODAG roots within the instance", HFILL }},
5878 { &hf_icmpv6_rpl_dio_dtsn,
5879 { "Destination Advertisement Trigger Sequence Number (DTSN)", "icmpv6.rpl.dio.dtsn", FT_UINT8, BASE_DEC, NULL, 0x0,
5880 "The DTSN is used as part of the procedure to maintain downward routes.", HFILL }},
5881 { &hf_icmpv6_rpl_dio_dagid,
5882 { "DODAGID", "icmpv6.rpl.dio.dagid", FT_IPv6, BASE_NONE, NULL, 0x0,
5883 "IPv6 address set by a DODAG root which uniquely identifies a DODAG", HFILL }},
5884 { &hf_icmpv6_rpl_dao_instance,
5885 { "RPLInstanceID", "icmpv6.rpl.dao.instance", FT_UINT8, BASE_DEC, NULL, 0x0,
5886 "Indicating the topology instance associated with the DODAG as learned from the DIO", HFILL }},
5887 { &hf_icmpv6_rpl_dao_flag,
5888 { "Flags", "icmpv6.rpl.dao.flag", FT_UINT8, BASE_HEX, NULL, 0x0,
5889 NULL, HFILL }},
5890 { &hf_icmpv6_rpl_dao_flag_k,
5891 { "DAO-ACK Request (K)", "icmpv6.rpl.dao.flag.k", FT_BOOLEAN, 8, NULL, RPL_DAO_FLAG_K,
5892 "Indicates that the recipient is expected to send a DAO-ACK back", HFILL }},
5893 { &hf_icmpv6_rpl_dao_flag_d,
5894 { "DODAGID Present (D)", "icmpv6.rpl.dao.flag.d", FT_BOOLEAN, 8, NULL, RPL_DAO_FLAG_D,
5895 "Indicates that the DODAGID field is present", HFILL }},
5896 { &hf_icmpv6_rpl_dao_flag_rsv,
5897 { "Reserved", "icmpv6.rpl.dao.flag.rsv", FT_UINT8, BASE_DEC, NULL, RPL_DAO_FLAG_RESERVED,
5898 "Must be zero", HFILL }},
5899 { &hf_icmpv6_rpl_dao_sequence,
5900 { "DAO Sequence", "icmpv6.rpl.dao.sequence", FT_UINT8, BASE_DEC, NULL, 0x0,
5901 "Incremented at each unique DAO message from a node and echoed in the DAO-ACK message", HFILL }},
5902 { &hf_icmpv6_rpl_dao_dodagid,
5903 { "DODAGID", "icmpv6.rpl.dao.dodagid", FT_IPv6, BASE_NONE, NULL, 0x0,
5904 "IPv6 address set by a DODAG root which uniquely identifies a DODAG", HFILL }},
5905 { &hf_icmpv6_rpl_daoack_instance,
5906 { "RPLInstanceID", "icmpv6.rpl.daoack.instance", FT_UINT8, BASE_DEC, NULL, 0x0,
5907 "Indicating the topology instance associated with the DODAG, as learned from the DIO", HFILL }},
5908 { &hf_icmpv6_rpl_daoack_flag,
5909 { "Flag", "icmpv6.rpl.daoack.flag", FT_UINT8, BASE_HEX, NULL, 0x0,
5910 NULL, HFILL }},
5911 { &hf_icmpv6_rpl_daoack_flag_d,
5912 { "DODAGID Present (D)", "icmpv6.rpl.daoack.flag.d", FT_BOOLEAN, 8, NULL, RPL_DAOACK_FLAG_D,
5913 "Indicates that the DODAGID field is present", HFILL }},
5914 { &hf_icmpv6_rpl_daoack_flag_rsv,
5915 { "Reserved", "icmpv6.rpl.daoack.flag.rsv", FT_UINT8, BASE_DEC, NULL, RPL_DAOACK_FLAG_RESERVED,
5916 "Must be zero", HFILL }},
5917 { &hf_icmpv6_rpl_daoack_sequence,
5918 { "DAO-ACK Sequence", "icmpv6.rpl.daoack.sequence", FT_UINT8, BASE_DEC, NULL, 0x0,
5919 "Incremented at each DAO message from a node, and echoed in the DAO-ACK by the recipient", HFILL }},
5920 { &hf_icmpv6_rpl_daoack_status,
5921 { "Status", "icmpv6.rpl.daoack.status", FT_UINT8, BASE_DEC, NULL, 0x0,
5922 "Indicates the completion", HFILL }},
5923 { &hf_icmpv6_rpl_daoack_dodagid,
5924 { "DODAGID", "icmpv6.rpl.daoack.dodagid", FT_IPv6, BASE_NONE, NULL, 0x0,
5925 "IPv6 address integer set by a DODAG root which uniquely identifies a DODAG", HFILL }},
5926 { &hf_icmpv6_rpl_cc_instance,
5927 { "RPLInstanceID", "icmpv6.rpl.cc.instance", FT_UINT8, BASE_DEC, NULL, 0x0,
5928 "Indicating the topology instance associated with the DODAG, as learned from the DIO", HFILL }},
5929 { &hf_icmpv6_rpl_cc_flag,
5930 { "Flag", "icmpv6.rpl.cc.flag", FT_UINT8, BASE_HEX, NULL, 0x0,
5931 NULL, HFILL }},
5932 { &hf_icmpv6_rpl_cc_flag_r,
5933 { "Response (R)", "icmpv6.rpl.cc.flag.r", FT_BOOLEAN, 8, NULL, RPL_CC_FLAG_R,
5934 "Indicates whether the CC message is a response", HFILL }},
5935 { &hf_icmpv6_rpl_cc_flag_rsv,
5936 { "Reserved", "icmpv6.rpl.cc.flag.rsv", FT_UINT8, BASE_DEC, NULL, RPL_CC_FLAG_RESERVED,
5937 "Must be zero", HFILL }},
5938 { &hf_icmpv6_rpl_cc_nonce,
5939 { "CC Nonce", "icmpv6.rpl.cc.nonce", FT_UINT16, BASE_HEX, NULL, 0x0,
5940 "The corresponding CC response includes the same CC nonce value as the request, as learned from the DIO", HFILL }},
5941 { &hf_icmpv6_rpl_cc_dodagid,
5942 { "DODAGID", "icmpv6.rpl.cc.dodagid", FT_IPv6, BASE_NONE, NULL, 0x0,
5943 "IPv6 address integer set by a DODAG root which uniquely identifies a DODAG", HFILL }},
5944 { &hf_icmpv6_rpl_cc_destination_counter,
5945 { "Destination Counter", "icmpv6.rpl.cc.destination_counter", FT_UINT32, BASE_DEC, NULL, 0x0,
5946 "Indicating the sender's estimate of the destination's current security Counter value", HFILL }},
5947 { &hf_icmpv6_rpl_secure_flag,
5948 { "Flags", "icmpv6.rpl.secure.flag", FT_UINT8, BASE_HEX, NULL, 0x0,
5949 NULL, HFILL }},
5950 { &hf_icmpv6_rpl_secure_flag_t,
5951 { "Counter is Time (T)", "icmpv6.rpl.secure.flag.t", FT_BOOLEAN, 8, NULL, RPL_SECURE_FLAG_T,
5952 "If it is set then the Counter field is a timestamp", HFILL }},
5953 { &hf_icmpv6_rpl_secure_flag_rsv,
5954 { "Reserved", "icmpv6.rpl.secure.flag.rsv", FT_UINT8, BASE_DEC, NULL, RPL_SECURE_FLAG_RSV,
5955 "Must be zero", HFILL }},
5956 { &hf_icmpv6_rpl_secure_algorithm,
5957 { "Algorithm", "icmpv6.rpl.secure.algorithm", FT_UINT8, BASE_DEC, VALS(rpl_secure_algorithm_vals), 0x0,
5958 "The Security Algorithm field specifies the encryption, MAC, and signature scheme the network uses", HFILL }},
5959 { &hf_icmpv6_rpl_secure_kim,
5960 { "Key Identifier Mode (KIM)", "icmpv6.rpl.secure.kim", FT_UINT8, BASE_DEC, NULL, RPL_SECURE_KIM,
5961 "That indicates whether the key used for packet protection is determined implicitly or explicitly and indicates the particular representation of the Key Identifier field", HFILL }},
5962 { &hf_icmpv6_rpl_secure_lvl,
5963 { "Security Level (LVL)", "icmpv6.rpl.secure.lvl", FT_UINT8, BASE_DEC, NULL, RPL_SECURE_LVL,
5964 "Indicates the provided packet protection", HFILL }},
5965 { &hf_icmpv6_rpl_secure_rsv,
5966 { "Reserved", "icmpv6.rpl.secure.rsv", FT_UINT8, BASE_DEC, NULL, RPL_SECURE_RSV,
5967 "Must be zero", HFILL }},
5968 { &hf_icmpv6_rpl_secure_counter,
5969 { "Counter", "icmpv6.rpl.secure.counter", FT_UINT32, BASE_DEC, NULL, 0x0,
5970 "Indicates the non-repeating 4-octet value used to construct the cryptographic mechanism that implements packet protection and allows for the provision of semantic security", HFILL }},
5971 { &hf_icmpv6_rpl_secure_key_source,
5972 { "Key Source", "icmpv6.rpl.secure.key.source", FT_BYTES, BASE_NONE, NULL, 0x0,
5973 "Indicates the logical identifier of the originator of a group key", HFILL }},
5974 { &hf_icmpv6_rpl_secure_key_index,
5975 { "Key Source", "icmpv6.rpl.secure.key.index", FT_UINT8, BASE_DEC, NULL, 0x0,
5976 "Allows unique identification of different keys with the same originator", HFILL }},
5977 { &hf_icmpv6_rpl_opt,
5978 { "ICMPv6 RPL Option", "icmpv6.opt", FT_NONE, BASE_NONE, NULL, 0x0,
5979 NULL, HFILL }},
5980 { &hf_icmpv6_rpl_opt_type,
5981 { "Type", "icmpv6.rpl.opt.type", FT_UINT8, BASE_DEC, VALS(rpl_option_vals), 0x0,
5982 "Options type", HFILL }},
5983 { &hf_icmpv6_rpl_opt_length,
5984 { "Length", "icmpv6.rpl.opt.length", FT_UINT8, BASE_DEC, NULL, 0x0,
5985 "The length of the option in octets excluding the Type and Length fields", HFILL }},
5986 { &hf_icmpv6_rpl_opt_reserved,
5987 { "Reserved", "icmpv6.rpl.opt.reserved", FT_NONE, BASE_NONE, NULL, 0x0,
5988 "Reserved (Must be 0)", HFILL }},
5989 { &hf_icmpv6_rpl_opt_padn,
5990 { "Paddn", "icmpv6.rpl.opt.padn", FT_NONE, BASE_NONE, NULL, 0x0,
5991 "Padding (Must be 0)", HFILL }},
5992 { &hf_icmpv6_rpl_opt_metric_type,
5993 { "Routing Metric/Constraint Type", "icmpv6.rpl.opt.metric.type", FT_UINT8, BASE_DEC, VALS(rpl_metric_vals), 0x0,
5994 "The Routing Metric/Constraint Type field uniquely identifies each Routing Metric/Constraint object. RFC 6551", HFILL }},
5995 { &hf_icmpv6_rpl_opt_metric_flags,
5996 { "Flags","icmpv6.rpl.opt.metric.flags", FT_UINT16, BASE_HEX, NULL, 0x0,
5997 NULL, HFILL }},
5998 { &hf_icmpv6_rpl_opt_metric_reserved,
5999 { "Reserved Flags","icmpv6.rpl.opt.metric.reserved", FT_UINT16, BASE_HEX, NULL, RPL_METRIC_RESERVED,
6000 "Reserved (Must be Zero)", HFILL }},
6001 { &hf_icmpv6_rpl_opt_metric_flag_p,
6002 { "Flag P","icmpv6.rpl.opt.metric.flag.p", FT_BOOLEAN, 16, TFS(&tfs_set_notset), RPL_METRIC_FLAG_P,
6003 "Only used for recorded metrics. When cleared, all nodes along the path successfully recorded the corresponding metric. When set, this indicates that one or several nodes along the path could not record the metric", HFILL }},
6004 { &hf_icmpv6_rpl_opt_metric_flag_c,
6005 { "Flag C","icmpv6.rpl.opt.metric.flag.c", FT_BOOLEAN, 16, TFS(&tfs_set_notset), RPL_METRIC_FLAG_C,
6006 "When set, this indicates that the object refers to a routing constraint. When cleared, the object refers to a routing metric.", HFILL }},
6007 { &hf_icmpv6_rpl_opt_metric_flag_o,
6008 { "Flag O","icmpv6.rpl.opt.metric.flag.o", FT_BOOLEAN, 16, TFS(&tfs_set_notset), RPL_METRIC_FLAG_O,
6009 "Used exclusively for routing constraints. When set, this indicates that the constraint is optional. When cleared, the constraint is mandatory.", HFILL }},
6010 { &hf_icmpv6_rpl_opt_metric_flag_r,
6011 { "Flag R","icmpv6.rpl.opt.metric.flag.r", FT_BOOLEAN, 16, TFS(&tfs_set_notset), RPL_METRIC_FLAG_R,
6012 "Only relevant for a routing metric. When set, this indicates that the routing metric is recorded along the path. When cleared, the routing metric is aggregated", HFILL }},
6013 { &hf_icmpv6_rpl_opt_metric_a,
6014 { "A Field","icmpv6.rpl.opt.metric.flag.a", FT_UINT16, BASE_HEX, NULL, RPL_METRIC_A,
6015 "Only relevant for metrics, it indicates whether the aggregated routing metric is additive, is multiplicative, reports a maximum, or reports a minimum", HFILL }},
6016 { &hf_icmpv6_rpl_opt_metric_prec,
6017 { "Precedence field","icmpv6.rpl.opt.metric.prec", FT_UINT16, BASE_HEX, NULL, RPL_METRIC_PREC,
6018 "It indicates the precedence of this Routing Metric/Constraint object relative to other objects in the container", HFILL }},
6019 { &hf_icmpv6_rpl_opt_metric_len,
6020 { "Metric Length", "icmpv6.rpl.opt.metric.length", FT_UINT8, BASE_DEC, NULL, 0x0,
6021 "The length of the object body, expressed in bytes.", HFILL }},
6022 { &hf_icmpv6_rpl_opt_metric_nsa_object,
6023 { "Node State and Attribute Object","icmpv6.rpl.opt.metric.nsa.object", FT_UINT16, BASE_HEX, NULL, 0x0,
6024 NULL, HFILL }},
6025 { &hf_icmpv6_rpl_opt_metric_nsa_object_reserved,
6026 { "Reserved field","icmpv6.rpl.opt.metric.nsa.object.reserved", FT_UINT16, BASE_HEX, NULL, RPL_METRIC_NSA_OBJECT_RESERVED,
6027 "Reserved (Must be Zero)", HFILL }},
6028 { &hf_icmpv6_rpl_opt_metric_nsa_object_flags,
6029 { "Flags","icmpv6.rpl.opt.metric.nsa.object.flags", FT_UINT16, BASE_HEX, NULL, RPL_METRIC_NSA_OBJECT_FLAGS,
6030 "Unspecified flags (Must be Zero)", HFILL }},
6031 { &hf_icmpv6_rpl_opt_metric_nsa_object_flag_a,
6032 { "Flag A", "icmpv6.rpl.opt.metric.nsa.object.flag.a", FT_BOOLEAN, 16, TFS(&tfs_set_notset), RPL_METRIC_NSA_OBJECT_FLAG_A,
6033 "When set, this indicates that the node can act as a traffic aggregator.", HFILL }},
6034 { &hf_icmpv6_rpl_opt_metric_nsa_object_flag_o,
6035 { "Flag O", "icmpv6.rpl.opt.metric.nsa.object.flag.o", FT_BOOLEAN, 16, TFS(&tfs_set_notset), RPL_METRIC_NSA_OBJECT_FLAG_O,
6036 "When set, this indicates that the node is overloaded and may not be able to process traffic.", HFILL }},
6037 { &hf_icmpv6_rpl_opt_metric_nsa_object_opttlv_object,
6038 { "Node State and Attribute Optional TLV", "icmpv6.rpl.opt.metric.nsa.object.opttlv.object", FT_UINT8, BASE_DEC, NULL, 0x0,
6039 "Optional TLV.", HFILL }},
6040 { &hf_icmpv6_rpl_opt_metric_nsa_object_opttlv_object_type,
6041 { "Node State and Attribute Optional TLV Type", "icmpv6.rpl.opt.metric.nsa.object.opttlv.object.type", FT_UINT8, BASE_DEC, NULL, 0x0,
6042 "Optional TLV type.", HFILL }},
6043 { &hf_icmpv6_rpl_opt_metric_nsa_object_opttlv_object_length,
6044 { "Node State and Attribute Optional TLV Length", "icmpv6.rpl.opt.metric.nsa.object.opttlv.object.length", FT_UINT8, BASE_DEC, NULL, 0x0,
6045 "The length of the option in octets excluding the Type and Length fields", HFILL }},
6046 { &hf_icmpv6_rpl_opt_metric_nsa_object_opttlv_object_data,
6047 { "Raw Data", "icmpv6.rpl.opt.metric.nsa.object.opttlv.object.data", FT_BYTES, BASE_NONE, NULL, 0x0,
6048 "The raw data in the TLV", HFILL }},
6049 { &hf_icmpv6_rpl_opt_metric_ne_object,
6050 { "Node Energy Object","icmpv6.rpl.opt.metric.ne.object", FT_UINT16, BASE_HEX, NULL, 0x0,
6051 NULL, HFILL }},
6052 { &hf_icmpv6_rpl_opt_metric_ne_object_flags,
6053 { "Flags field","icmpv6.rpl.opt.metric.ne.object.flags", FT_UINT16, BASE_HEX, NULL, RPL_METRIC_NE_OBJECT_FLAGS,
6054 "Unspecified flags (Must be Zero)", HFILL }},
6055 { &hf_icmpv6_rpl_opt_metric_ne_object_flag_i,
6056 { "Flag I","icmpv6.rpl.opt.metric.ne.object.flag.i", FT_BOOLEAN, 16, TFS(&tfs_set_notset), RPL_METRIC_NE_OBJECT_FLAG_I,
6057 "Only relevant when the node type is used as a constraint. When set, this indicates that nodes of the type specified in the node type field MUST be included", HFILL }},
6058 { &hf_icmpv6_rpl_opt_metric_ne_object_type,
6059 { "Type", "icmpv6.rpl.opt.metric.ne.object.type", FT_UINT16, BASE_HEX, NULL, RPL_METRIC_NE_OBJECT_TYPE,
6060 "T=0 designates a mains-powered node, T=1 a battery-powered node, and T=2 a node powered by an energy scavenger.", HFILL }},
6061 { &hf_icmpv6_rpl_opt_metric_ne_object_flag_e,
6062 { "Flag E", "icmpv6.rpl.opt.metric.ne.object.flag.e", FT_BOOLEAN, 16, TFS(&tfs_set_notset), RPL_METRIC_NE_OBJECT_FLAG_E,
6063 "When the 'E' bit is set for a metric, the estimated percentage of remaining energy on the node is indicated in the Energy 8-bit field. When cleared, the estimated percentage of remaining energy is not provided. When the 'E' bit is set for a constraint, the E_E field defines a threshold for the inclusion/exclusion: if an inclusion, nodes with values higher than the threshold are to be included; if an exclusion, nodes with values lower than the threshold are to be excluded.", HFILL }},
6064 { &hf_icmpv6_rpl_opt_metric_ne_object_energy,
6065 { "Energy", "icmpv6.rpl.opt.metric.ne.object.energy", FT_UINT16, BASE_HEX, NULL, RPL_METRIC_NE_OBJECT_ENERGY,
6066 "8-bit unsigned integer field indicating an estimated percentage of remaining energy. The Energy field is only relevant when the 'E' flag is set, and it MUST be set to 0 when the 'E' flag is cleared.", HFILL }},
6067 { &hf_icmpv6_rpl_opt_metric_hp_object,
6068 { "Hop Count Object","icmpv6.rpl.opt.metric.hp.object", FT_UINT16, BASE_HEX, NULL, 0x0,
6069 NULL, HFILL }},
6070 { &hf_icmpv6_rpl_opt_metric_hp_object_reserved,
6071 { "Reserved field","icmpv6.rpl.opt.metric.hp.object.reserved", FT_UINT16, BASE_HEX, NULL, RPL_METRIC_HP_OBJECT_RESERVED,
6072 "Reserved (Must be Zero)", HFILL }},
6073 { &hf_icmpv6_rpl_opt_metric_hp_object_flags,
6074 { "Flags","icmpv6.rpl.opt.metric.hp.object.flags", FT_UINT16, BASE_HEX, NULL, RPL_METRIC_HP_OBJECT_FLAGS,
6075 "Reserved (Must be Zero)", HFILL }},
6076 { &hf_icmpv6_rpl_opt_metric_hp_object_hp,
6077 { "Hop Count", "icmpv6.rpl.opt.metric.hp.object.hp", FT_UINT16, BASE_DEC, NULL, RPL_METRIC_HP_OBJECT_HP,
6078 "When used as a constraint, the DAG root indicates the maximum number of hops that a path may traverse. When used as a metric, each visited node simply increments the Hop Count field.", HFILL }},
6079 { &hf_icmpv6_rpl_opt_metric_lt_object_lt,
6080 { "Link Throughput", "icmpv6.rpl.opt.metric.lt.object.lt", FT_UINT32, BASE_DEC, NULL, 0x0,
6081 "The Throughput metric is the effective bit rate of a link.", HFILL }},
6082 { &hf_icmpv6_rpl_opt_metric_ll_object_ll,
6083 { "Link Latency", "icmpv6.rpl.opt.metric.ll.object.ll", FT_UINT32, BASE_DEC, NULL, 0x0,
6084 "The Latency is encoded in 32 bits in unsigned integer format, expressed in microseconds.", HFILL }},
6085 { &hf_icmpv6_rpl_opt_metric_lql_object,
6086 { "Link Quality Level Object","icmpv6.rpl.opt.metric.lql.object", FT_UINT8, BASE_HEX, NULL, 0x0,
6087 NULL, HFILL }},
6088 { &hf_icmpv6_rpl_opt_metric_lql_object_res,
6089 { "Reserved field","icmpv6.rpl.opt.metric.lql.object.res", FT_UINT8, BASE_HEX, NULL, RPL_METRIC_LQL_OBJECT_RES,
6090 "Reserved (Must be Zero)", HFILL }},
6091 { &hf_icmpv6_rpl_opt_metric_lql_object_val,
6092 { "Val(ue)","icmpv6.rpl.opt.metric.lql.object.val", FT_UINT8, BASE_HEX, NULL, RPL_METRIC_LQL_OBJECT_VAL,
6093 "LQL value from 0 to 7 where 0 means undetermined and 1 indicates the highest link quality.", HFILL }},
6094 { &hf_icmpv6_rpl_opt_metric_lql_object_counter,
6095 { "Counter", "icmpv6.rpl.opt.metric.lql.object.counter", FT_UINT8, BASE_DEC, NULL, RPL_METRIC_LQL_OBJECT_COUNTER,
6096 "The Counter represents the number of links with that value.", HFILL }},
6097 { &hf_icmpv6_rpl_opt_metric_etx_object_etx,
6098 { "ETX", "icmpv6.rpl.opt.metric.etx.object.etx", FT_UINT16, BASE_DEC, NULL, 0x0,
6099 "The ETX metric is the number of transmissions a node expects to make to a destination in order to successfully deliver a packet.", HFILL }},
6100 { &hf_icmpv6_rpl_opt_metric_lc_object,
6101 { "Link Color Object","icmpv6.rpl.opt.metric.lc.object", FT_NONE, BASE_NONE, NULL, 0x0,
6102 NULL, HFILL }},
6103 { &hf_icmpv6_rpl_opt_metric_lc_object_res,
6104 { "Reserved field","icmpv6.rpl.opt.metric.lc.object.res", FT_UINT8, BASE_HEX, NULL, RPL_METRIC_LC_OBJECT_RES,
6105 "Reserved (Must be Zero)", HFILL }},
6106 { &hf_icmpv6_rpl_opt_metric_lc_object_lc,
6107 { "Link Color","icmpv6.rpl.opt.metric.lc.object.lc", FT_UINT16, BASE_HEX, NULL, RPL_METRIC_LC_OBJECT_LC,
6108 "The Link Color (LC) object is an administrative 10-bit link constraint used to avoid or attract specific links for specific traffic types.", HFILL }},
6109 { &hf_icmpv6_rpl_opt_metric_lc_object_counter,
6110 { "Counter", "icmpv6.rpl.opt.metric.lc.object.counter", FT_UINT16, BASE_DEC, NULL, RPL_METRIC_LC_OBJECT_COUNTER,
6111 "The Counter is used to compress the information where the number of links for each Link Color is reported.", HFILL }},
6112 { &hf_icmpv6_rpl_opt_metric_lc_object_reserved,
6113 { "Reserved", "icmpv6.rpl.opt.metric.lc.object.reserved", FT_UINT16, BASE_DEC, NULL, RPL_METRIC_LC_OBJECT_RESERVED,
6114 "Reserved (Must be Zero).", HFILL }},
6115 { &hf_icmpv6_rpl_opt_metric_lc_object_flag_i,
6116 { "Flag I", "icmpv6.rpl.opt.metric.lc.object.flag.i", FT_UINT16, BASE_DEC, NULL, RPL_METRIC_LC_OBJECT_FLAG_I,
6117 "The 'I' bit is only relevant when the Link Color is used as a constraint. When set, this indicates that links with the specified color must be included.", HFILL }},
6118 { &hf_icmpv6_rpl_opt_route_prefix_length,
6119 { "Prefix Length", "icmpv6.rpl.opt.route.prefix_length", FT_UINT8, BASE_DEC, NULL, 0x0,
6120 "The number of leading bits in the Prefix that are valid", HFILL }},
6121 { &hf_icmpv6_rpl_opt_route_flag,
6122 { "Flag","icmpv6.rpl.opt.route.flag", FT_UINT8, BASE_HEX, NULL, 0x0,
6123 NULL, HFILL }},
6124 { &hf_icmpv6_rpl_opt_route_pref,
6125 { "Preference","icmpv6.rpl.opt.route.pref", FT_UINT8, BASE_DEC, VALS(nd_flag_router_pref), RPL_OPT_ROUTE_PREFERENCE,
6126 "The Route Preference indicates whether to prefer the router associated with this prefix over others, when multiple identical prefixes (for different routers) have been received", HFILL }},
6127 { &hf_icmpv6_rpl_opt_route_reserved,
6128 { "Reserved","icmpv6.rpl.opt.route.reserved", FT_UINT8, BASE_DEC, NULL, RPL_OPT_ROUTE_RESERVED,
6129 "Reserved (Must be Zero)", HFILL }},
6130 { &hf_icmpv6_rpl_opt_route_lifetime,
6131 { "Route Lifetime", "icmpv6.rpl.opt.route.lifetime", FT_UINT32, BASE_DEC|BASE_SPECIAL_VALS, VALS(unique_infinity), 0x0,
6132 "The length of time in seconds (relative to the time the packet is sent) that the prefix is valid for route determination", HFILL }},
6133 { &hf_icmpv6_rpl_opt_route_prefix,
6134 { "Prefix", "icmpv6.rpl.opt.route.prefix", FT_IPv6, BASE_NONE, NULL, 0x0,
6135 "Variable-length field containing an IP address or a prefix of an IPv6 address", HFILL }},
6136 { &hf_icmpv6_rpl_opt_config_flag,
6137 { "Flag","icmpv6.rpl.opt.config.flag", FT_UINT8, BASE_HEX, NULL, 0x0,
6138 NULL, HFILL }},
6139 { &hf_icmpv6_rpl_opt_config_reserved,
6140 { "Reserved","icmpv6.rpl.opt.config.reserved", FT_UINT8, BASE_DEC, NULL, RPL_OPT_CONFIG_FLAG_RESERVED,
6141 "Must be Zero", HFILL }},
6142 { &hf_icmpv6_rpl_opt_config_auth,
6143 { "Authentication Enabled","icmpv6.rpl.opt.config.auth", FT_BOOLEAN, 8, TFS(&tfs_set_notset), RPL_OPT_CONFIG_FLAG_AUTH,
6144 "One bit flag describing the security mode of the network", HFILL }},
6145 { &hf_icmpv6_rpl_opt_config_pcs,
6146 { "Path Control Size", "icmpv6.rpl.opt.config.pcs", FT_UINT8, BASE_DEC, NULL, RPL_OPT_CONFIG_FLAG_PCS,
6147 "Used to configure the number of bits that may be allocated to the Path Control field", HFILL }},
6148 { &hf_icmpv6_rpl_opt_config_doublings,
6149 { "DIOIntervalDoublings","icmpv6.rpl.opt.config.interval_double", FT_UINT8, BASE_DEC, NULL, 0x0,
6150 "Used to configure Imax of the DIO trickle timer", HFILL }},
6151 { &hf_icmpv6_rpl_opt_config_min_interval,
6152 { "DIOIntervalMin", "icmpv6.rpl.opt.config.interval_min", FT_UINT16, BASE_DEC, NULL, 0x0,
6153 "Used to configure Imin of the DIO trickle timer", HFILL }},
6154 { &hf_icmpv6_rpl_opt_config_redundancy,
6155 { "DIORedundancyConstant", "icmpv6.rpl.opt.config.redundancy", FT_UINT8, BASE_DEC, NULL, 0x0,
6156 "Used to configure k of the DIO trickle timer", HFILL }},
6157 { &hf_icmpv6_rpl_opt_config_rank_incr,
6158 { "MaxRankInc", "icmpv6.rpl.opt.config.max_rank_inc", FT_UINT16, BASE_DEC, NULL, 0x0,
6159 "Used to configure DAGMaxRankIncrease", HFILL }},
6160 { &hf_icmpv6_rpl_opt_config_hop_rank_inc,
6161 { "MinHopRankInc", "icmpv6.rpl.opt.config.min_hop_rank_inc", FT_UINT16, BASE_DEC, NULL, 0x0,
6162 "Used to configure MinHopRankIncrease", HFILL }},
6163 { &hf_icmpv6_rpl_opt_config_ocp,
6164 { "OCP (Objective Code Point)","icmpv6.rpl.opt.config.ocp", FT_UINT16, BASE_DEC, VALS(rpl_ocp_vals), 0x0,
6165 "The OCP field identifies the OF and is managed by the IANA", HFILL }},
6166 { &hf_icmpv6_rpl_opt_config_rsv,
6167 { "Reserved", "icmpv6.rpl.opt.config.rsv", FT_UINT8, BASE_DEC, NULL, 0x0,
6168 NULL, HFILL }},
6169 { &hf_icmpv6_rpl_opt_config_def_lifetime,
6170 { "Default Lifetime", "icmpv6.rpl.opt.config.def_lifetime", FT_UINT8, BASE_DEC, NULL, 0x0,
6171 "This is the lifetime that is used as default for all RPL routes", HFILL }},
6172 { &hf_icmpv6_rpl_opt_config_lifetime_unit,
6173 { "Lifetime Unit", "icmpv6.rpl.opt.config.lifetime_unit", FT_UINT16, BASE_DEC|BASE_UNIT_STRING, UNS(&units_seconds), 0x0,
6174 "Provides the unit in seconds that is used to express route lifetimes in RPL", HFILL }},
6175 { &hf_icmpv6_rpl_opt_target_flag,
6176 { "Reserved", "icmpv6.rpl.opt.target.flag", FT_NONE, BASE_NONE, NULL, 0x0,
6177 "Unused field reserved for flags", HFILL }},
6178 { &hf_icmpv6_rpl_opt_target_prefix_length,
6179 { "Target Length", "icmpv6.rpl.opt.target.prefix_length", FT_UINT8, BASE_DEC, NULL, 0x0,
6180 "Number of valid leading bits in the IPv6 Prefix", HFILL }},
6181 { &hf_icmpv6_rpl_opt_target_prefix,
6182 { "Target", "icmpv6.rpl.opt.target.prefix", FT_IPv6, BASE_NONE, NULL, 0x0,
6183 "Identifying an IPv6 destination address, prefix, or multicast group", HFILL }},
6184 { &hf_icmpv6_rpl_opt_transit_flag,
6185 { "Flags", "icmpv6.rpl.opt.transit.flag", FT_UINT8, BASE_HEX, NULL, 0x0,
6186 NULL, HFILL }},
6187 { &hf_icmpv6_rpl_opt_transit_flag_e,
6188 { "External", "icmpv6.rpl.opt.transit.flag.e", FT_BOOLEAN, 8, TFS(&tfs_set_notset), RPL_OPT_TRANSIT_FLAG_E,
6189 "Indicate that the parent router redistributes external targets into the RPL network", HFILL }},
6190 { &hf_icmpv6_rpl_opt_transit_flag_rsv,
6191 { "Reserved", "icmpv6.rpl.opt.transit.flag.rsv", FT_UINT8, BASE_DEC, NULL, RPL_OPT_TRANSIT_FLAG_RSV,
6192 "Must be Zero", HFILL }},
6193 { &hf_icmpv6_rpl_opt_transit_pathctl,
6194 { "Path Control", "icmpv6.rpl.opt.transit.pathctl", FT_UINT8, BASE_HEX, NULL, 0x0,
6195 "Limits the number of DAO-Parents to which a DAO message advertising connectivity", HFILL }},
6196 { &hf_icmpv6_rpl_opt_transit_pathctl_pc1,
6197 { "PC1", "icmpv6.rpl.opt.transit.pathctl.pc1", FT_UINT8, BASE_HEX, NULL, RPL_OPT_TRANSIT_PATHCTL_PC1,
6198 NULL, HFILL }},
6199 { &hf_icmpv6_rpl_opt_transit_pathctl_pc2,
6200 { "PC2", "icmpv6.rpl.opt.transit.pathctl.pc2", FT_UINT8, BASE_HEX, NULL, RPL_OPT_TRANSIT_PATHCTL_PC2,
6201 NULL, HFILL }},
6202 { &hf_icmpv6_rpl_opt_transit_pathctl_pc3,
6203 { "PC3", "icmpv6.rpl.opt.transit.pathctl.pc3", FT_UINT8, BASE_HEX, NULL, RPL_OPT_TRANSIT_PATHCTL_PC3,
6204 NULL, HFILL }},
6205 { &hf_icmpv6_rpl_opt_transit_pathctl_pc4,
6206 { "PC4", "icmpv6.rpl.opt.transit.pathctl.pc4", FT_UINT8, BASE_HEX, NULL, RPL_OPT_TRANSIT_PATHCTL_PC4,
6207 NULL, HFILL }},
6208 { &hf_icmpv6_rpl_opt_transit_pathseq,
6209 { "Path Sequence", "icmpv6.rpl.opt.transit.pathseq", FT_UINT8, BASE_DEC, NULL, 0x0,
6210 "Increments the Path Sequence each time it issues a RPL Target option with updated information", HFILL }},
6211 { &hf_icmpv6_rpl_opt_transit_pathlifetime,
6212 { "Path Lifetime", "icmpv6.rpl.opt.transit.pathlifetime", FT_UINT8, BASE_DEC, NULL, 0x0,
6213 "The length of time in Lifetime Units that the prefix is valid for route determination", HFILL }},
6214 { &hf_icmpv6_rpl_opt_transit_parent,
6215 { "Parent Address", "icmpv6.rpl.opt.transit.parent", FT_IPv6, BASE_NONE, NULL, 0x0,
6216 "IPv6 Address of the DODAG Parent of the node originally issuing the Transit Information Option", HFILL }},
6217 { &hf_icmpv6_rpl_opt_solicited_instance,
6218 { "Instance", "icmpv6.rpl.opt.solicited.instance", FT_UINT8, BASE_DEC, NULL, 0x0,
6219 "Containing the RPLInstanceID that is being solicited when valid", HFILL }},
6220 { &hf_icmpv6_rpl_opt_solicited_flag,
6221 { "Flag", "icmpv6.rpl.opt.solicited.flag", FT_UINT8, BASE_HEX, NULL, 0x0,
6222 NULL, HFILL }},
6223 { &hf_icmpv6_rpl_opt_solicited_flag_v,
6224 { "Version predicate", "icmpv6.rpl.opt.solicited.flag.v", FT_BOOLEAN, 8, NULL, RPL_OPT_SOLICITED_FLAG_V,
6225 "The Version predicate is true if the receiver's DODAGVersionNumber matches the requested Version Number", HFILL }},
6226 { &hf_icmpv6_rpl_opt_solicited_flag_i,
6227 { "InstanceID predicate","icmpv6.rpl.opt.solicited.flag.i", FT_BOOLEAN, 8, NULL, RPL_OPT_SOLICITED_FLAG_I,
6228 "The InstanceID predicate is true when the RPL node's current RPLInstanceID matches the requested RPLInstanceID", HFILL }},
6229 { &hf_icmpv6_rpl_opt_solicited_flag_d,
6230 { "DODAGID predicate", "icmpv6.rpl.opt.solicited.flag.d", FT_BOOLEAN, 8, NULL, RPL_OPT_SOLICITED_FLAG_D,
6231 "The DODAGID predicate is true if the RPL node's parent set has the same DODAGID as the DODAGID field", HFILL }},
6232 { &hf_icmpv6_rpl_opt_solicited_flag_rsv,
6233 { "Reserved", "icmpv6.rpl.opt.solicited.flag.rsv", FT_UINT8, BASE_DEC, NULL, RPL_OPT_SOLICITED_FLAG_RSV,
6234 "Must be Zero", HFILL }},
6235 { &hf_icmpv6_rpl_opt_solicited_dodagid,
6236 { "DODAGID", "icmpv6.rpl.opt.solicited.dodagid", FT_IPv6, BASE_NONE, NULL, 0x0,
6237 "the DODAGID that is being solicited when valid", HFILL }},
6238 { &hf_icmpv6_rpl_opt_solicited_version,
6239 { "Version", "icmpv6.rpl.opt.solicited.version", FT_UINT8, BASE_DEC, NULL, 0x0,
6240 "the value of DODAGVersionNumber that is being solicited when valid", HFILL }},
6242 { &hf_icmpv6_rpl_opt_prefix_length,
6243 { "Prefix Length", "icmpv6.rpl.opt.prefix.length", FT_UINT8, BASE_DEC, NULL, 0x0,
6244 "The number of leading bits in the Prefix that are valid", HFILL }},
6245 { &hf_icmpv6_rpl_opt_prefix_flag,
6246 { "Flag", "icmpv6.rpl.opt.prefix.flag", FT_UINT8, BASE_HEX, NULL, 0x0,
6247 NULL, HFILL }},
6248 { &hf_icmpv6_rpl_opt_prefix_flag_l,
6249 { "On Link", "icmpv6.rpl.opt.prefix.flag.l", FT_BOOLEAN, 8, TFS(&tfs_set_notset), RPL_OPT_PREFIX_FLAG_L,
6250 "When set, indicates that this prefix can be used for on-link determination", HFILL }},
6251 { &hf_icmpv6_rpl_opt_prefix_flag_a,
6252 { "Auto Address Config","icmpv6.rpl.opt.config.flag.a", FT_BOOLEAN, 8, TFS(&tfs_set_notset), RPL_OPT_PREFIX_FLAG_A,
6253 "When set indicates that this prefix can be used for stateless address configuration", HFILL }},
6254 { &hf_icmpv6_rpl_opt_prefix_flag_r,
6255 { "Router Address", "icmpv6.rpl.opt.config.flag.r", FT_BOOLEAN, 8, TFS(&tfs_set_notset), RPL_OPT_PREFIX_FLAG_R,
6256 "When set, indicates that the Prefix field contains a complete IPv6 address assigned to the sending router that can be used as parent in a target option", HFILL }},
6257 { &hf_icmpv6_rpl_opt_prefix_flag_rsv,
6258 { "Reserved", "icmpv6.rpl.opt.config.flag.rsv", FT_UINT8, BASE_DEC, NULL, RPL_OPT_PREFIX_FLAG_RSV,
6259 "Must Be Zero", HFILL }},
6260 { &hf_icmpv6_rpl_opt_prefix_vlifetime,
6261 { "Valid Lifetime", "icmpv6.rpl.opt.prefix.valid_lifetime", FT_UINT32, BASE_DEC|BASE_SPECIAL_VALS, VALS(unique_infinity), 0x0,
6262 "The length of time in seconds that the prefix is valid for the purpose of on-link determination", HFILL }},
6263 { &hf_icmpv6_rpl_opt_prefix_plifetime,
6264 { "Preferred Lifetime", "icmpv6.rpl.opt.prefix.preferred_lifetime", FT_UINT32, BASE_DEC|BASE_SPECIAL_VALS, VALS(unique_infinity), 0x0,
6265 "The length of time in seconds that addresses generated from the prefix via stateless address autoconfiguration remain preferred", HFILL }},
6266 { &hf_icmpv6_rpl_opt_prefix,
6267 { "Destination Prefix", "icmpv6.rpl.opt.prefix", FT_IPv6, BASE_NONE, NULL, 0x0,
6268 "An IPv6 address or a prefix of an IPv6 address", HFILL }},
6269 { &hf_icmpv6_rpl_opt_targetdesc,
6270 { "Descriptor", "icmpv6.rpl.opt.targetdesc.descriptor", FT_UINT32, BASE_HEX, NULL, 0x0,
6271 "Opaque Data", HFILL }},
6273 { &hf_icmpv6_rpl_opt_route_discovery_flag,
6274 { "Flags", "icmpv6.rpl.opt.routediscovery.flag", FT_NONE, BASE_NONE, NULL, 0x0,
6275 "NULL", HFILL }},
6276 { &hf_icmpv6_rpl_opt_route_discovery_reply,
6277 { "Reply", "icmpv6.rpl.opt.routediscovery.flag.reply", FT_BOOLEAN, 8, TFS(&tfs_yes_no), RPL_OPT_ROUTE_DISCOVERY_R,
6278 "The Origin sets this flag to one to allow the Target(s) to send P2P-DRO messages back to the Origin", HFILL }},
6279 { &hf_icmpv6_rpl_opt_route_discovery_hop_by_hop,
6280 { "Hop-by-Hop", "icmpv6.rpl.opt.routediscovery.flag.hopbyhop", FT_BOOLEAN, 8, TFS(&tfs_yes_no), RPL_OPT_ROUTE_DISCOVERY_H,
6281 "The Origin sets this flag to one if it desires Hop-by-hop Routes and to zero if it desires Source Routes.", HFILL }},
6282 { &hf_icmpv6_rpl_opt_route_discovery_num_of_routes,
6283 { "Number of Routes", "icmpv6.rpl.opt.routediscovery.flag.numofroutes", FT_UINT8, BASE_DEC, NULL, RPL_OPT_ROUTE_DISCOVERY_N,
6284 "This value plus one indicates the number of Source Routes that each Target should convey to the Origin", HFILL }},
6285 { &hf_icmpv6_rpl_opt_route_discovery_compr,
6286 { "Compr", "icmpv6.rpl.opt.routediscovery.flag.compr", FT_UINT8, BASE_DEC, NULL, RPL_OPT_ROUTE_DISCOVERY_COMPR,
6287 "Number of prefix octets that are elided from the Target field and Address vector", HFILL }},
6288 { &hf_icmpv6_rpl_opt_route_discovery_lifetime,
6289 { "Lifetime", "icmpv6.rpl.opt.routediscovery.lifetime", FT_UINT8, BASE_DEC, NULL, RPL_OPT_ROUTE_DISCOVERY_L,
6290 "Lifetime of the temporary DODAG", HFILL }},
6291 { &hf_icmpv6_rpl_opt_route_discovery_maxrank,
6292 { "MaxRank", "icmpv6.rpl.opt.routediscovery.maxrank", FT_UINT8, BASE_DEC, NULL, RPL_OPT_ROUTE_DISCOVERY_MR_NH,
6293 "Upper limit of the integer portion of the rank when used inside a DIO", HFILL }},
6294 { &hf_icmpv6_rpl_opt_route_discovery_nh,
6295 { "NH", "icmpv6.rpl.opt.routediscovery.nh", FT_UINT8, BASE_DEC, NULL, RPL_OPT_ROUTE_DISCOVERY_MR_NH,
6296 "Index of the next-hop (NH) address inside the Address vector", HFILL }},
6297 { &hf_icmpv6_rpl_opt_route_discovery_target_addr,
6298 { "Target Address", "icmpv6.rpl.opt.routediscovery.targetaddr", FT_IPv6, BASE_NONE, NULL, 0x0,
6299 "An IPv6 address of the Target after eliding Compr number of prefix octets", HFILL }},
6300 { &hf_icmpv6_rpl_opt_route_discovery_addr_vec,
6301 { "Address Vector", "icmpv6.rpl.opt.routediscovery.addr_vec", FT_NONE, BASE_NONE, NULL, 0x0,
6302 "NULL", HFILL }},
6303 { &hf_icmpv6_rpl_opt_route_discovery_addr_vec_addr,
6304 { "Address", "icmpv6.rpl.opt.routediscovery.addrvec.addr", FT_IPv6, BASE_NONE, NULL, 0x0,
6305 NULL, HFILL }},
6306 { &hf_icmpv6_rpl_p2p_dro_instance,
6307 { "RPLInstanceID", "icmpv6.rpl.p2p.dro.instance", FT_UINT8, BASE_DEC, NULL, 0x0,
6308 "Set by the DODAG root that indicates which RPL Instance the DODAG is part of", HFILL }},
6309 { &hf_icmpv6_rpl_p2p_dro_version,
6310 { "Version", "icmpv6.rpl.p2p.dro.version", FT_UINT8, BASE_DEC, NULL, 0x0,
6311 "Set by the DODAG root to the DODAGVersionNumber", HFILL }},
6312 { &hf_icmpv6_rpl_p2p_dro_flag,
6313 { "Flags", "icmpv6.rpl.p2p.dro.flag", FT_UINT16, BASE_HEX, NULL, 0x0,
6314 "NULL", HFILL }},
6315 { &hf_icmpv6_rpl_p2p_dro_flag_stop,
6316 { "Stop", "icmpv6.rpl.p2p.dro.flag.stop", FT_BOOLEAN, 16, TFS(&tfs_yes_no), RPL_P2P_DRO_FLAG_S,
6317 "Indicates that the P2P-RPL route discovery is over", HFILL }},
6318 { &hf_icmpv6_rpl_p2p_dro_flag_ack,
6319 { "Ack", "icmpv6.rpl.p2p.dro.flag.ack", FT_BOOLEAN, 16, TFS(&tfs_yes_no), RPL_P2P_DRO_FLAG_A,
6320 "Indicates that the Origin MUST unicast a P2P-DRO-ACK message to the Target", HFILL }},
6321 { &hf_icmpv6_rpl_p2p_dro_flag_seq,
6322 { "Seq", "icmpv6.rpl.p2p.dro.flag.seq", FT_UINT16, BASE_DEC, NULL, RPL_P2P_DRO_FLAG_SEQ,
6323 "Indicates the sequence number for the P2P-DRO", HFILL }},
6324 { &hf_icmpv6_rpl_p2p_dro_flag_reserved,
6325 { "Reserved", "icmpv6.rpl.p2p.dro.flag.reserved", FT_UINT16, BASE_DEC, NULL, RPL_P2P_DRO_FLAG_RSV,
6326 NULL, HFILL }},
6327 { &hf_icmpv6_rpl_p2p_dro_dagid,
6328 { "DODAGID", "icmpv6.rpl.p2p.dro.dagid", FT_IPv6, BASE_NONE, NULL, 0x0,
6329 "IPv6 address set by a DODAG root which uniquely identifies a DODAG", HFILL }},
6330 { &hf_icmpv6_rpl_p2p_droack_flag,
6331 { "Flags", "icmpv6.rpl.p2p.droack.flag", FT_UINT16, BASE_HEX, NULL, 0x0,
6332 "NULL", HFILL }},
6333 { &hf_icmpv6_rpl_p2p_droack_flag_seq,
6334 { "Seq", "icmpv6.rpl.p2p.droack.flag.seq", FT_UINT16, BASE_DEC, NULL, RPL_P2P_DROACK_FLAG_SEQ,
6335 "Indicates the sequence number for the P2P-DRO", HFILL }},
6336 { &hf_icmpv6_rpl_p2p_droack_flag_reserved,
6337 { "Reserved", "icmpv6.rpl.p2p.droack.flag.reserved", FT_UINT16, BASE_DEC, NULL, RPL_P2P_DROACK_FLAG_RSV,
6338 NULL, HFILL }},
6340 /* RFC6743 Locator Update (156) */
6342 { &hf_icmpv6_ilnp_nb_locs,
6343 { "Num of Locs", "icmpv6.ilnp.nb_locs", FT_UINT8, BASE_DEC, NULL, 0x0,
6344 "The number of 64-bit Locator values that are advertised in this message", HFILL }},
6345 { &hf_icmpv6_ilnp_locator,
6346 { "Locator", "icmpv6.ilnp.nb_locator", FT_UINT64, BASE_HEX, NULL, 0x0,
6347 "The 64-bit Locator values currently valid for the sending ILNPv6 node", HFILL }},
6348 { &hf_icmpv6_ilnp_preference,
6349 { "Preference", "icmpv6.ilnp.nb_preference", FT_UINT32, BASE_DEC, NULL, 0x0,
6350 "The preferability of each Locator relative to other valid Locator values", HFILL }},
6351 { &hf_icmpv6_ilnp_lifetime,
6352 { "Lifetime", "icmpv6.ilnp.nb_lifetime", FT_UINT32, BASE_DEC, NULL, 0x0,
6353 "The maximum number of seconds that this particular Locator may be considered valid", HFILL }},
6355 /* 6lowpan-nd: Neighbour Discovery for 6LoWPAN Networks */
6356 { &hf_icmpv6_da_status,
6357 { "Status", "icmpv6.6lowpannd.da.status", FT_UINT8, BASE_DEC, VALS(nd_opt_da_status_val), 0x0,
6358 "Indicates the status of a registration in the DAC", HFILL }},
6359 { &hf_icmpv6_da_rsv,
6360 { "Reserved", "icmpv6.6lowpannd.da.rsv", FT_UINT8, BASE_DEC, NULL, 0x0,
6361 "Must be Zero", HFILL }},
6362 { &hf_icmpv6_da_lifetime,
6363 { "Lifetime", "icmpv6.6lowpannd.da.lifetime", FT_UINT16, BASE_DEC, NULL, 0x0,
6364 "The amount of time in a unit of 60 seconds that the router should retain the Neighbor Cache entry for the sender of the NS that includes this option", HFILL }},
6365 { &hf_icmpv6_da_eui64,
6366 { "EUI-64", "icmpv6.6lowpannd.da.eui64", FT_EUI64, BASE_NONE, NULL, 0x0,
6367 "This field is used to uniquely identify the interface of the registered address by including the EUI-64 identifier", HFILL }},
6368 { &hf_icmpv6_da_raddr,
6369 { "Registered Address", "icmpv6.6lowpannd.da.reg_addr", FT_IPv6, BASE_NONE, NULL, 0x0,
6370 "Carries the host address, which was contained in the IPv6 Source field in the NS that contained the ARO option sent by the host", HFILL }},
6372 /* Extended Echo - Probe - RFC8335 */
6373 { &hf_icmpv6_ext_echo_seq_num,
6374 { "Sequence number", "icmpv6.ext.echo.seq", FT_UINT8, BASE_DEC_HEX, NULL, 0x0,
6375 NULL, HFILL}},
6376 { &hf_icmpv6_ext_echo_req_reserved,
6377 { "Reserved", "icmpv6.ext.echo.req.res", FT_UINT8, BASE_HEX, NULL, 0xFE,
6378 NULL, HFILL}},
6379 { &hf_icmpv6_ext_echo_req_local,
6380 { "Local bit", "icmpv6.ext.echo.req.local", FT_BOOLEAN, 8, TFS(&tfs_set_notset), 0x01,
6381 NULL, HFILL}},
6382 { &hf_icmpv6_ext_echo_rsp_state,
6383 { "State", "icmpv6.ext.echo.rsp.state", FT_UINT8, BASE_DEC, VALS(ext_echo_reply_state_str), 0xE0,
6384 NULL, HFILL}},
6385 { &hf_icmpv6_ext_echo_rsp_reserved,
6386 { "Reserved", "icmpv6.ext.echo.rsp.res", FT_UINT8, BASE_HEX, NULL, 0x18,
6387 NULL, HFILL}},
6388 { &hf_icmpv6_ext_echo_rsp_active,
6389 { "Active bit", "icmpv6.ext.echo.rsp.active", FT_BOOLEAN, 8, TFS(&tfs_set_notset), 0x04,
6390 NULL, HFILL}},
6391 { &hf_icmpv6_ext_echo_rsp_ipv4,
6392 { "IPv4 bit", "icmpv6.ext.echo.rsp.ipv4", FT_BOOLEAN, 8, TFS(&tfs_set_notset), 0x02,
6393 NULL, HFILL}},
6394 { &hf_icmpv6_ext_echo_rsp_ipv6,
6395 { "IPv6 bit", "icmpv6.ext.echo.rsp.ipv6", FT_BOOLEAN, 8, TFS(&tfs_set_notset), 0x01,
6396 NULL, HFILL}},
6398 /* Conversation-related [generated] header fields */
6399 { &hf_icmpv6_resp_in,
6400 { "Response In", "icmpv6.resp_in", FT_FRAMENUM, BASE_NONE, FRAMENUM_TYPE(FT_FRAMENUM_RESPONSE), 0x0,
6401 "The response to this request is in this frame", HFILL }},
6402 {&hf_icmpv6_no_resp,
6403 {"No response seen", "icmpv6.no_resp", FT_NONE, BASE_NONE, NULL, 0x0,
6404 "No corresponding response frame was seen", HFILL}},
6405 { &hf_icmpv6_resp_to,
6406 { "Response To", "icmpv6.resp_to", FT_FRAMENUM, BASE_NONE, FRAMENUM_TYPE(FT_FRAMENUM_REQUEST), 0x0,
6407 "This is the response to the request in this frame", HFILL }},
6408 { &hf_icmpv6_resptime,
6409 { "Response Time", "icmpv6.resptime", FT_DOUBLE, BASE_NONE, NULL, 0x0,
6410 "The time between the request and the response, in ms.", HFILL }},
6412 /* RFC 7731: Multicast Protocol for Low-Power and Lossy Networks (MPL) */
6413 { &hf_icmpv6_mpl_seed_info_min_sequence,
6414 { "MinSequence", "icmpv6.mpl.seed_info.min_sequence", FT_UINT8, BASE_DEC, NULL, 0x0,
6415 "The lower-bound sequence number for the MPL Seed.", HFILL }},
6416 { &hf_icmpv6_mpl_seed_info_bm_len,
6417 { "Buffered Messages Length", "icmpv6.mpl.seed_info.bm_len", FT_UINT8, BASE_DEC, NULL, MPL_SEED_INFO_BM_LEN,
6418 "The size of buffered-mpl-messages in octets.", HFILL }},
6419 { &hf_icmpv6_mpl_seed_info_s,
6420 { "Seed ID Length", "icmpv6.mpl.seed_info.s", FT_UINT8, BASE_DEC, VALS(mpl_seed_id_lengths), MPL_SEED_INFO_S,
6421 "The length of the seed-id.", HFILL }},
6422 { &hf_icmpv6_mpl_seed_info_seed_id,
6423 { "Seed ID", "icmpv6.mpl.seed_info.seed_id", FT_STRING, BASE_NONE, NULL, 0x0,
6424 NULL, HFILL }},
6425 { &hf_icmpv6_mpl_seed_info_sequence,
6426 { "Sequence", "icmpv6.mpl.seed_info.sequence", FT_UINT8, BASE_DEC, NULL, 0x0,
6427 NULL, HFILL }}
6431 static int *ett[] = {
6432 &ett_icmpv6,
6433 &ett_icmpv6_opt,
6434 &ett_icmpv6_mar,
6435 &ett_icmpv6_flag_prefix,
6436 &ett_icmpv6_flag_map,
6437 &ett_icmpv6_flag_pvd_id,
6438 &ett_icmpv6_flag_route_info,
6439 &ett_icmpv6_flag_earo,
6440 &ett_icmpv6_flag_6lowpan,
6441 &ett_icmpv6_flag_efo,
6442 &ett_icmpv6_rpl_opt,
6443 &ett_icmpv6_rpl_metric_type,
6444 &ett_icmpv6_rpl_metric_flags,
6445 &ett_icmpv6_rpl_metric_nsa_object,
6446 &ett_icmpv6_rpl_metric_nsa_object_tlv_type,
6447 &ett_icmpv6_rpl_metric_ne_object,
6448 &ett_icmpv6_rpl_metric_hp_object,
6449 &ett_icmpv6_rpl_metric_lql_object,
6450 &ett_icmpv6_rpl_metric_lc_object,
6451 &ett_icmpv6_rpl_flag_routing,
6452 &ett_icmpv6_rpl_flag_config,
6453 &ett_icmpv6_rpl_flag_transit,
6454 &ett_icmpv6_rpl_flag_solicited,
6455 &ett_icmpv6_rpl_flag_prefix,
6456 &ett_icmpv6_rpl_route_discovery_flag,
6457 &ett_icmpv6_rpl_route_discovery_addr_vec,
6458 &ett_icmpv6_rpl_transit_pathctl,
6459 &ett_icmpv6_rpl_p2p_dro_flag,
6460 &ett_icmpv6_rpl_p2p_droack_flag,
6461 &ett_icmpv6_flag_ni,
6462 &ett_icmpv6_flag_rr,
6463 &ett_icmpv6_rr_mp,
6464 &ett_icmpv6_rr_up,
6465 &ett_icmpv6_rr_up_flag_mask,
6466 &ett_icmpv6_rr_up_flag_ra,
6467 &ett_icmpv6_rr_up_flag,
6468 &ett_icmpv6_rr_rm,
6469 &ett_icmpv6_rr_rm_flag,
6470 &ett_icmpv6_flag_mld,
6471 &ett_icmpv6_flag_ra,
6472 &ett_icmpv6_flag_na,
6473 &ett_icmpv6_flag_mip6,
6474 &ett_icmpv6_flag_fmip6,
6475 &ett_icmpv6_flag_secure,
6476 &ett_icmpv6_flag_rpl_dio,
6477 &ett_icmpv6_flag_rpl_dao,
6478 &ett_icmpv6_flag_rpl_daoack,
6479 &ett_icmpv6_flag_rpl_cc,
6480 &ett_icmpv6_opt_name,
6481 &ett_icmpv6_cga_param_name,
6482 &ett_icmpv6_mpl_seed_info,
6483 &ett_icmpv6_mpl_seed_info_bm
6486 static ei_register_info ei[] = {
6487 { &ei_icmpv6_invalid_option_length, { "icmpv6.invalid_option_length", PI_MALFORMED, PI_ERROR, "Invalid Option Length", EXPFILL }},
6488 { &ei_icmpv6_undecoded_option, { "icmpv6.undecoded.option", PI_UNDECODED, PI_NOTE, "Undecoded option", EXPFILL }},
6489 { &ei_icmpv6_unknown_data, { "icmpv6.unknown_data.expert", PI_MALFORMED, PI_ERROR, "Unknown Data (not interpreted)", EXPFILL }},
6490 { &ei_icmpv6_undecoded_rpl_option, { "icmpv6.undecoded.rpl_option", PI_UNDECODED, PI_NOTE, "Undecoded RPL Option", EXPFILL }},
6491 { &ei_icmpv6_undecoded_type, { "icmpv6.undecoded.type", PI_UNDECODED, PI_NOTE, "Undecoded type", EXPFILL }},
6492 { &ei_icmpv6_rr_pco_mp_matchlen, { "icmpv6.rr.pco.mp.matchlen.gt128", PI_PROTOCOL, PI_WARN, "MatchLen is greater than 128", EXPFILL }},
6493 { &ei_icmpv6_rr_pco_mp_matchedlen, { "icmpv6.rr.pco.mp.matchedlen.gt128", PI_PROTOCOL, PI_WARN, "MatchedLen is greater than 128", EXPFILL }},
6494 { &ei_icmpv6_checksum, { "icmpv6.checksum_bad.expert", PI_CHECKSUM, PI_WARN, "Bad checksum", EXPFILL }},
6495 { &ei_icmpv6_resp_not_found, { "icmpv6.resp_not_found", PI_SEQUENCE, PI_WARN, "Response not found", EXPFILL }},
6496 { &ei_icmpv6_rpl_unknown_metric, { "icmpv6.rpl.unknown.metric", PI_UNDECODED, PI_NOTE, "Unknown RPL metric/constraint type", EXPFILL }},
6497 { &ei_icmpv6_rpl_p2p_hop_by_hop, { "icmpv6.rpl.p2p.hop_by_hop", PI_PROTOCOL, PI_WARN, "Reply MUST be set to one in order to establish a Hop-by-Hop Route", EXPFILL }},
6498 { &ei_icmpv6_rpl_p2p_num_of_routes, { "icmpv6.rpl.p2p.num_of_routes", PI_PROTOCOL, PI_WARN, "This field MUST be set to zero when Hop-by-Hop Routes are being discovered", EXPFILL }},
6499 { &ei_icmpv6_rpl_p2p_dro_rdo_zero, { "icmpv6.rpl.p2p.dro.rdo.zero", PI_PROTOCOL, PI_WARN, "This field MUST be set to zero when the P2P-RDO is included in a P2P-DRO", EXPFILL }},
6500 { &ei_icmpv6_rpl_p2p_dro_zero, { "icmpv6.rpl.p2p.dro.zero", PI_PROTOCOL, PI_WARN, "This field MUST be set to zero", EXPFILL }},
6503 expert_module_t* expert_icmpv6;
6505 proto_icmpv6 = proto_register_protocol("Internet Control Message Protocol v6",
6506 "ICMPv6", "icmpv6");
6507 proto_register_field_array(proto_icmpv6, hf, array_length(hf));
6508 proto_register_subtree_array(ett, array_length(ett));
6509 expert_icmpv6 = expert_register_protocol(proto_icmpv6);
6510 expert_register_field_array(expert_icmpv6, ei, array_length(ei));
6512 register_seq_analysis("icmpv6", "ICMPv6 Flows", proto_icmpv6, NULL, TL_REQUIRES_COLUMNS, icmpv6_seq_analysis_packet);
6513 icmpv6_handle = register_dissector("icmpv6", dissect_icmpv6, proto_icmpv6);
6514 icmpv6_heur_subdissector_list = register_heur_dissector_list_with_description("icmpv6", "ICMPv6 Echo payload", proto_icmpv6);
6515 icmpv6_tap = register_tap("icmpv6");
6518 void
6519 proto_reg_handoff_icmpv6(void)
6521 capture_dissector_handle_t icmpv6_cap_handle;
6523 dissector_add_uint("ip.proto", IP_PROTO_ICMPV6, icmpv6_handle);
6524 icmpv6_cap_handle = create_capture_dissector_handle(capture_icmpv6, proto_icmpv6);
6525 capture_dissector_add_uint("ip.proto", IP_PROTO_ICMPV6, icmpv6_cap_handle);
6528 * Get a handle for the IPv6 dissector.
6530 ipv6_handle = find_dissector_add_dependency("ipv6", proto_icmpv6);
6531 icmp_extension_handle = find_dissector("icmp_extension");
6535 * Editor modelines - https://www.wireshark.org/tools/modelines.html
6537 * Local variables:
6538 * c-basic-offset: 4
6539 * tab-width: 8
6540 * indent-tabs-mode: nil
6541 * End:
6543 * vi: set shiftwidth=4 tabstop=8 expandtab:
6544 * :indentSize=4:tabSize=8:noTabs=true: