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 * This program is free software; you can redistribute it and/or
22 * modify it under the terms of the GNU General Public License
23 * as published by the Free Software Foundation; either version 2
24 * of the License, or (at your option) any later version.
26 * This program is distributed in the hope that it will be useful,
27 * but WITHOUT ANY WARRANTY; without even the implied warranty of
28 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
29 * GNU General Public License for more details.
31 * You should have received a copy of the GNU General Public License
32 * along with this program; if not, write to the Free Software
33 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
40 #include <epan/packet.h>
41 #include <epan/in_cksum.h>
42 #include <epan/ipproto.h>
43 #include <epan/expert.h>
44 #include <epan/conversation.h>
47 #include "packet-ber.h"
48 #include "packet-dns.h"
49 #include "packet-x509af.h"
50 #include "packet-x509if.h"
51 #include "packet-icmp.h" /* same transaction_t used both both v4 and v6 */
52 #include "packet-ieee802154.h"
53 #include "packet-6lowpan.h"
54 #include "packet-ip.h"
56 void proto_register_icmpv6(void);
57 void proto_reg_handoff_icmpv6(void);
60 * The information used comes from:
61 * RFC 1885/2463/4443: Internet Control Message Protocol (ICMPv6) for the Internet Protocol Version 6 (IPv6) Specification
62 * RFC 2461/4861: Neighbor Discovery for IP Version 6 (IPv6)
63 * RFC 2491: IPv6 over Non-Broadcast Multiple Access (NBMA) networks
64 * RFC 2710: Multicast Listener Discovery for IPv6
65 * RFC 2894: Router Renumbering for IPv6
66 * RFC 3122: Extensions to IPv6 Neighbor Discovery for Inverse Discovery Specification
67 * RFC 3775/6275: Mobility Support in IPv6
68 * RFC 3810: Multicast Listener Discovery Version 2 (MLDv2) for IPv6
69 * RFC 3971: SEcure Neighbor Discovery (SEND)
70 * RFC 4065: Instructions for Seamoby and Experimental Mobility Protocol IANA Allocations
71 * RFC 4068/5268/5568: Fast Handovers for Mobile IPv6 (Mobile IPv6 Fast Handovers)
72 * RFC 4140/5380: Hierarchical Mobile IPv6 Mobility Management (HMIPv6)
73 * RFC 4191: Default Router Preferences and More-Specific Routes
74 * RFC 4286: Multicast Router Discovery
75 * RFC 4620: IPv6 Node Information Queries
76 * RFC 5006/6106: IPv6 Router Advertisement Options for DNS Configuration
77 * RFC 5075/5175: IPv6 Router Advertisement Flags Option
78 * RFC 5269: Distributing a Symmetric Fast Mobile IPv6 (FMIPv6) Handover Key Using SEcure Neighbor Discovery (SEND)
79 * RFC 5271: Mobile IPv6 Fast Handovers for 3G CDMA Networks
80 * RFC 6275: Mobility Support in IPv6
81 * RFC 6495: Subject Key Identifier (SKI) SEND Name Type fields
82 * RFC 6496: Secure Proxy ND Support for SEND
83 * RFC 6550: RPL: IPv6 Routing Protocol for Low power and Lossy Networks
84 * RFC 6554: An IPv6 Routing Header for Source Routes with RPL
85 * RFC 6743: ICMP Locator Update message for ILNPv6
86 * RFC 6775: Neighbor Discovery Optimization for Low Power and Lossy Networks (6LoWPAN)
87 * RFC 6997: Reactive Discovery of Point-to-Point Routes in Low-Power and Lossy Networks
88 * RFC 7112: Implications of Oversized IPv6 Header Chains
89 * RFC 7400: 6LoWPAN-GHC: Generic Header Compression for IPv6 over Low-Power Wireless Personal Area Networks (6LoWPANs)
90 * http://www.iana.org/assignments/icmpv6-parameters (last updated 2015-01-22)
93 static int proto_icmpv6 = -1;
94 static int hf_icmpv6_type = -1;
95 static int hf_icmpv6_code = -1;
96 static int hf_icmpv6_checksum = -1;
97 static int hf_icmpv6_checksum_bad = -1;
98 static int hf_icmpv6_reserved = -1;
99 static int hf_icmpv6_data = -1;
100 static int hf_icmpv6_unknown_data = -1;
101 static int hf_icmpv6_mtu = -1;
102 static int hf_icmpv6_pointer = -1;
103 static int hf_icmpv6_echo_identifier = -1;
104 static int hf_icmpv6_echo_sequence_number = -1;
105 static int hf_icmpv6_nonce = -1;
107 /* RFC 2461/4861 : Neighbor Discovery for IP version 6 (IPv6) */
108 static int hf_icmpv6_nd_ra_cur_hop_limit = -1;
109 static int hf_icmpv6_nd_ra_flag = -1;
110 static int hf_icmpv6_nd_ra_flag_m = -1;
111 static int hf_icmpv6_nd_ra_flag_o = -1;
112 static int hf_icmpv6_nd_ra_flag_h = -1;
113 static int hf_icmpv6_nd_ra_flag_prf = -1;
114 static int hf_icmpv6_nd_ra_flag_p = -1;
115 static int hf_icmpv6_nd_ra_flag_rsv = -1;
116 static int hf_icmpv6_nd_ra_router_lifetime = -1;
117 static int hf_icmpv6_nd_ra_reachable_time = -1;
118 static int hf_icmpv6_nd_ra_retrans_timer = -1;
119 static int hf_icmpv6_nd_ns_target_address = -1;
120 static int hf_icmpv6_nd_na_flag = -1;
121 static int hf_icmpv6_nd_na_flag_r = -1;
122 static int hf_icmpv6_nd_na_flag_s = -1;
123 static int hf_icmpv6_nd_na_flag_o = -1;
124 static int hf_icmpv6_nd_na_flag_rsv = -1;
125 static int hf_icmpv6_nd_na_target_address = -1;
126 static int hf_icmpv6_nd_rd_target_address = -1;
127 static int hf_icmpv6_nd_rd_destination_address = -1;
130 static int hf_icmpv6_opt = -1;
131 static int hf_icmpv6_opt_type = -1;
132 static int hf_icmpv6_opt_length = -1;
133 static int hf_icmpv6_opt_linkaddr_mac = -1;
134 static int hf_icmpv6_opt_src_linkaddr_mac = -1;
135 static int hf_icmpv6_opt_target_linkaddr_mac = -1;
136 static int hf_icmpv6_opt_linkaddr = -1;
137 static int hf_icmpv6_opt_src_linkaddr = -1;
138 static int hf_icmpv6_opt_target_linkaddr = -1;
139 static int hf_icmpv6_opt_linkaddr_eui64 = -1;
140 static int hf_icmpv6_opt_src_linkaddr_eui64 = -1;
141 static int hf_icmpv6_opt_target_linkaddr_eui64 = -1;
142 static int hf_icmpv6_opt_prefix_len = -1;
143 static int hf_icmpv6_opt_prefix_flag = -1;
144 static int hf_icmpv6_opt_prefix_flag_l = -1;
145 static int hf_icmpv6_opt_prefix_flag_a = -1;
146 static int hf_icmpv6_opt_prefix_flag_r = -1;
147 static int hf_icmpv6_opt_prefix_flag_reserved = -1;
148 static int hf_icmpv6_opt_prefix_valid_lifetime = -1;
149 static int hf_icmpv6_opt_prefix_preferred_lifetime = -1;
150 static int hf_icmpv6_opt_prefix = -1;
151 static int hf_icmpv6_opt_naack_option_code = -1;
152 static int hf_icmpv6_opt_naack_status = -1;
153 static int hf_icmpv6_opt_naack_supplied_ncoa = -1;
154 static int hf_icmpv6_opt_cga_pad_len = -1;
155 static int hf_icmpv6_opt_cga = -1;
156 static int hf_icmpv6_opt_cga_modifier = -1;
157 static int hf_icmpv6_opt_cga_subnet_prefix = -1;
158 static int hf_icmpv6_opt_cga_count = -1;
159 static int hf_icmpv6_opt_cga_ext_type = -1;
160 static int hf_icmpv6_opt_cga_ext_length = -1;
161 static int hf_icmpv6_opt_cga_ext_data = -1;
162 static int hf_icmpv6_opt_rsa_key_hash = -1;
163 static int hf_icmpv6_opt_digital_signature_padding = -1;
164 static int hf_icmpv6_opt_ps_key_hash = -1;
165 static int hf_icmpv6_opt_timestamp = -1;
166 static int hf_icmpv6_opt_nonce = -1;
167 static int hf_icmpv6_opt_certificate_padding = -1;
168 static int hf_icmpv6_opt_ipa_option_code = -1;
169 static int hf_icmpv6_opt_ipa_prefix_len = -1;
170 static int hf_icmpv6_opt_ipa_ipv6_address = -1;
171 static int hf_icmpv6_opt_nrpi_option_code = -1;
172 static int hf_icmpv6_opt_nrpi_prefix_len = -1;
173 static int hf_icmpv6_opt_nrpi_prefix = -1;
174 static int hf_icmpv6_opt_lla_option_code = -1;
175 static int hf_icmpv6_opt_lla_bytes = -1;
176 static int hf_icmpv6_opt_map_dist = -1;
177 static int hf_icmpv6_opt_map_pref = -1;
178 static int hf_icmpv6_opt_map_flag = -1;
179 static int hf_icmpv6_opt_map_flag_r = -1;
180 static int hf_icmpv6_opt_map_flag_reserved = -1;
181 static int hf_icmpv6_opt_map_valid_lifetime = -1;
182 static int hf_icmpv6_opt_map_global_address = -1;
183 static int hf_icmpv6_opt_route_info_flag = -1;
184 static int hf_icmpv6_opt_route_info_flag_route_preference = -1;
185 static int hf_icmpv6_opt_route_info_flag_reserved = -1;
186 static int hf_icmpv6_opt_route_lifetime = -1;
187 static int hf_icmpv6_opt_name_type = -1;
188 static int hf_icmpv6_opt_name_x501 = -1;
189 static int hf_icmpv6_opt_name_fqdn = -1;
190 static int hf_icmpv6_opt_cert_type = -1;
191 static int hf_icmpv6_x509if_Name = -1;
192 static int hf_icmpv6_x509af_Certificate = -1;
193 static int hf_icmpv6_opt_redirected_packet = -1;
194 static int hf_icmpv6_opt_mtu = -1;
195 static int hf_icmpv6_opt_nbma_shortcut_limit = -1;
196 static int hf_icmpv6_opt_advertisement_interval = -1;
197 static int hf_icmpv6_opt_home_agent_preference = -1;
198 static int hf_icmpv6_opt_home_agent_lifetime = -1;
199 static int hf_icmpv6_opt_ipv6_address = -1;
200 static int hf_icmpv6_opt_reserved = -1;
201 static int hf_icmpv6_opt_padding = -1;
202 static int hf_icmpv6_opt_rdnss_lifetime = -1;
203 static int hf_icmpv6_opt_rdnss = -1;
204 static int hf_icmpv6_opt_efo = -1;
205 static int hf_icmpv6_opt_efo_m = -1;
206 static int hf_icmpv6_opt_efo_o = -1;
207 static int hf_icmpv6_opt_efo_h = -1;
208 static int hf_icmpv6_opt_efo_prf = -1;
209 static int hf_icmpv6_opt_efo_p = -1;
210 static int hf_icmpv6_opt_efo_rsv = -1;
211 static int hf_icmpv6_opt_hkr_pad_length = -1;
212 static int hf_icmpv6_opt_hkr_at = -1;
213 static int hf_icmpv6_opt_hkr_reserved = -1;
214 static int hf_icmpv6_opt_hkr_encryption_public_key = -1;
215 static int hf_icmpv6_opt_hkr_padding = -1;
216 static int hf_icmpv6_opt_hkr_lifetime = -1;
217 static int hf_icmpv6_opt_hkr_encrypted_handover_key = -1;
218 static int hf_icmpv6_opt_hai_option_code = -1;
219 static int hf_icmpv6_opt_hai_length = -1;
220 static int hf_icmpv6_opt_hai_value = -1;
221 static int hf_icmpv6_opt_mn_option_code = -1;
222 static int hf_icmpv6_opt_mn_length = -1;
223 static int hf_icmpv6_opt_mn_value = -1;
224 static int hf_icmpv6_opt_dnssl_lifetime = -1;
225 static int hf_icmpv6_opt_dnssl = -1;
227 static int hf_icmpv6_opt_aro_status = -1;
228 static int hf_icmpv6_opt_aro_registration_lifetime = -1;
229 static int hf_icmpv6_opt_aro_eui64 = -1;
230 static int hf_icmpv6_opt_6co_context_length = -1;
231 static int hf_icmpv6_opt_6co_flag = -1;
232 static int hf_icmpv6_opt_6co_flag_c = -1;
233 static int hf_icmpv6_opt_6co_flag_cid = -1;
234 static int hf_icmpv6_opt_6co_flag_reserved = -1;
235 static int hf_icmpv6_opt_6co_valid_lifetime = -1;
236 static int hf_icmpv6_opt_6co_context_prefix = -1;
237 static int hf_icmpv6_opt_abro_version_low = -1;
238 static int hf_icmpv6_opt_abro_version_high = -1;
239 static int hf_icmpv6_opt_abro_valid_lifetime = -1;
240 static int hf_icmpv6_opt_abro_6lbr_address = -1;
241 static int hf_icmpv6_opt_6cio_unassigned1 = -1;
242 static int hf_icmpv6_opt_6cio_flag_g = -1;
243 static int hf_icmpv6_opt_6cio_unassigned2 = -1;
245 /* RFC 2710: Multicast Listener Discovery for IPv6 */
246 static int hf_icmpv6_mld_mrd = -1;
247 static int hf_icmpv6_mld_multicast_address = -1;
249 /* RFC 2894: Router Renumbering for IPv6 */
250 static int hf_icmpv6_rr_sequencenumber = -1;
251 static int hf_icmpv6_rr_segmentnumber = -1;
252 static int hf_icmpv6_rr_flag = -1;
253 static int hf_icmpv6_rr_flag_t = -1;
254 static int hf_icmpv6_rr_flag_r = -1;
255 static int hf_icmpv6_rr_flag_a = -1;
256 static int hf_icmpv6_rr_flag_s = -1;
257 static int hf_icmpv6_rr_flag_p = -1;
258 static int hf_icmpv6_rr_flag_rsv = -1;
259 static int hf_icmpv6_rr_maxdelay = -1;
260 static int hf_icmpv6_rr_pco_mp_part = -1;
261 static int hf_icmpv6_rr_pco_mp_opcode = -1;
262 static int hf_icmpv6_rr_pco_mp_oplength = -1;
263 static int hf_icmpv6_rr_pco_mp_ordinal = -1;
264 static int hf_icmpv6_rr_pco_mp_matchlen = -1;
265 static int hf_icmpv6_rr_pco_mp_minlen = -1;
266 static int hf_icmpv6_rr_pco_mp_maxlen = -1;
267 static int hf_icmpv6_rr_pco_mp_matchprefix = -1;
268 static int hf_icmpv6_rr_pco_up_part = -1;
269 static int hf_icmpv6_rr_pco_up_uselen = -1;
270 static int hf_icmpv6_rr_pco_up_keeplen = -1;
271 static int hf_icmpv6_rr_pco_up_flagmask = -1;
272 static int hf_icmpv6_rr_pco_up_flagmask_l = -1;
273 static int hf_icmpv6_rr_pco_up_flagmask_a = -1;
274 static int hf_icmpv6_rr_pco_up_flagmask_reserved = -1;
275 static int hf_icmpv6_rr_pco_up_raflags = -1;
276 static int hf_icmpv6_rr_pco_up_raflags_l = -1;
277 static int hf_icmpv6_rr_pco_up_raflags_a = -1;
278 static int hf_icmpv6_rr_pco_up_raflags_reserved = -1;
279 static int hf_icmpv6_rr_pco_up_validlifetime = -1;
280 static int hf_icmpv6_rr_pco_up_preferredlifetime = -1;
281 static int hf_icmpv6_rr_pco_up_flag = -1;
282 static int hf_icmpv6_rr_pco_up_flag_v = -1;
283 static int hf_icmpv6_rr_pco_up_flag_p = -1;
284 static int hf_icmpv6_rr_pco_up_flag_reserved = -1;
285 static int hf_icmpv6_rr_pco_up_useprefix = -1;
286 static int hf_icmpv6_rr_rm = -1;
287 static int hf_icmpv6_rr_rm_flag = -1;
288 static int hf_icmpv6_rr_rm_flag_b = -1;
289 static int hf_icmpv6_rr_rm_flag_f = -1;
290 static int hf_icmpv6_rr_rm_flag_reserved = -1;
291 static int hf_icmpv6_rr_rm_ordinal = -1;
292 static int hf_icmpv6_rr_rm_matchedlen = -1;
293 static int hf_icmpv6_rr_rm_interfaceindex = -1;
294 static int hf_icmpv6_rr_rm_matchedprefix = -1;
296 /* RFC 3810: Multicast Listener Discovery Version 2 (MLDv2) for IPv6 */
297 static int hf_icmpv6_mld_mrc = -1;
298 static int hf_icmpv6_mld_flag = -1;
299 static int hf_icmpv6_mld_flag_s = -1;
300 static int hf_icmpv6_mld_flag_qrv = -1;
301 static int hf_icmpv6_mld_flag_rsv = -1;
302 static int hf_icmpv6_mld_qqi = -1;
303 static int hf_icmpv6_mld_nb_sources = -1;
304 static int hf_icmpv6_mld_source_address = -1;
305 static int hf_icmpv6_mldr_nb_mcast_records = -1;
306 static int hf_icmpv6_mldr_mar = -1;
307 static int hf_icmpv6_mldr_mar_record_type = -1;
308 static int hf_icmpv6_mldr_mar_aux_data_len = -1;
309 static int hf_icmpv6_mldr_mar_nb_sources = -1;
310 static int hf_icmpv6_mldr_mar_multicast_address = -1;
311 static int hf_icmpv6_mldr_mar_source_address = -1;
312 static int hf_icmpv6_mldr_mar_auxiliary_data = -1;
314 /* RFC3775/6275: Mobility Support in IPv6 */
315 static int hf_icmpv6_mip6_identifier = -1;
316 static int hf_icmpv6_mip6_home_agent_address = -1;
317 static int hf_icmpv6_mip6_flag = -1;
318 static int hf_icmpv6_mip6_flag_m = -1;
319 static int hf_icmpv6_mip6_flag_o = -1;
320 static int hf_icmpv6_mip6_flag_rsv = -1;
322 /* RFC3971: SEcure Neighbor Discovery (SEND) */
323 static int hf_icmpv6_send_identifier = -1;
324 static int hf_icmpv6_send_all_components = -1;
325 static int hf_icmpv6_send_component = -1;
327 /* RFC 4068/5268/5568: Fast Handovers for Mobile IPv6 ( Mobile IPv6 Fast Handovers ) */
328 static int hf_icmpv6_fmip6_subtype = -1;
329 static int hf_icmpv6_fmip6_hi_flag = -1;
330 static int hf_icmpv6_fmip6_hi_flag_s = -1;
331 static int hf_icmpv6_fmip6_hi_flag_u = -1;
332 static int hf_icmpv6_fmip6_hi_flag_reserved = -1;
333 static int hf_icmpv6_fmip6_identifier = -1;
335 /* RFC 4286: Multicast Router Discovery */
336 static int hf_icmpv6_mcast_ra_query_interval = -1;
337 static int hf_icmpv6_mcast_ra_robustness_variable = -1;
339 /* RFC 4620: IPv6 Node Information Queries */
340 static int hf_icmpv6_ni_qtype = -1;
341 static int hf_icmpv6_ni_flag = -1;
342 static int hf_icmpv6_ni_flag_g = -1;
343 static int hf_icmpv6_ni_flag_s = -1;
344 static int hf_icmpv6_ni_flag_l = -1;
345 static int hf_icmpv6_ni_flag_c = -1;
346 static int hf_icmpv6_ni_flag_a = -1;
347 static int hf_icmpv6_ni_flag_t = -1;
348 static int hf_icmpv6_ni_flag_rsv = -1;
349 static int hf_icmpv6_ni_nonce = -1;
350 static int hf_icmpv6_ni_query_subject_ipv6 = -1;
351 static int hf_icmpv6_ni_query_subject_fqdn = -1;
352 static int hf_icmpv6_ni_query_subject_ipv4 = -1;
353 static int hf_icmpv6_ni_reply_node_ttl = -1;
354 static int hf_icmpv6_ni_reply_node_name = -1;
355 static int hf_icmpv6_ni_reply_node_address = -1;
356 static int hf_icmpv6_ni_reply_ipv4_address = -1;
358 /* RPL: RFC 6550/6997 : Routing and Discovery of P2P Routes in Low-Power and Lossy Networks. */
359 static int hf_icmpv6_rpl_dis_flag = -1;
360 static int hf_icmpv6_rpl_dio_instance = -1;
361 static int hf_icmpv6_rpl_dio_version = -1;
362 static int hf_icmpv6_rpl_dio_rank = -1;
363 static int hf_icmpv6_rpl_dio_flag = -1;
364 static int hf_icmpv6_rpl_dio_flag_g = -1;
365 static int hf_icmpv6_rpl_dio_flag_0 = -1;
366 static int hf_icmpv6_rpl_dio_flag_mop = -1;
367 static int hf_icmpv6_rpl_dio_flag_prf = -1;
368 static int hf_icmpv6_rpl_dio_dtsn = -1;
369 static int hf_icmpv6_rpl_dio_dagid = -1;
370 static int hf_icmpv6_rpl_dao_instance = -1;
371 static int hf_icmpv6_rpl_dao_flag = -1;
372 static int hf_icmpv6_rpl_dao_flag_k = -1;
373 static int hf_icmpv6_rpl_dao_flag_d = -1;
374 static int hf_icmpv6_rpl_dao_flag_rsv = -1;
375 static int hf_icmpv6_rpl_dao_sequence = -1;
376 static int hf_icmpv6_rpl_dao_dodagid = -1;
377 static int hf_icmpv6_rpl_daoack_instance = -1;
378 static int hf_icmpv6_rpl_daoack_flag = -1;
379 static int hf_icmpv6_rpl_daoack_flag_d = -1;
380 static int hf_icmpv6_rpl_daoack_flag_rsv = -1;
381 static int hf_icmpv6_rpl_daoack_sequence = -1;
382 static int hf_icmpv6_rpl_daoack_status = -1;
383 static int hf_icmpv6_rpl_daoack_dodagid = -1;
384 static int hf_icmpv6_rpl_cc_instance = -1;
385 static int hf_icmpv6_rpl_cc_flag = -1;
386 static int hf_icmpv6_rpl_cc_flag_r = -1;
387 static int hf_icmpv6_rpl_cc_flag_rsv = -1;
388 static int hf_icmpv6_rpl_cc_nonce = -1;
389 static int hf_icmpv6_rpl_cc_dodagid = -1;
390 static int hf_icmpv6_rpl_cc_destination_counter = -1;
391 static int hf_icmpv6_rpl_secure_flag = -1;
392 static int hf_icmpv6_rpl_secure_flag_t = -1;
393 static int hf_icmpv6_rpl_secure_flag_rsv = -1;
394 static int hf_icmpv6_rpl_secure_algorithm = -1;
395 static int hf_icmpv6_rpl_secure_algorithm_encryption = -1;
396 static int hf_icmpv6_rpl_secure_algorithm_signature = -1;
397 static int hf_icmpv6_rpl_secure_kim = -1;
398 static int hf_icmpv6_rpl_secure_lvl = -1;
399 static int hf_icmpv6_rpl_secure_rsv = -1;
400 static int hf_icmpv6_rpl_secure_counter = -1;
401 static int hf_icmpv6_rpl_secure_key_source = -1;
402 static int hf_icmpv6_rpl_secure_key_index = -1;
403 static int hf_icmpv6_rpl_opt = -1;
404 static int hf_icmpv6_rpl_opt_type = -1;
405 static int hf_icmpv6_rpl_opt_length = -1;
406 static int hf_icmpv6_rpl_opt_reserved = -1;
407 static int hf_icmpv6_rpl_opt_padn = -1;
408 static int hf_icmpv6_rpl_opt_route_prefix_length = -1;
409 static int hf_icmpv6_rpl_opt_route_flag = -1;
410 static int hf_icmpv6_rpl_opt_route_pref = -1;
411 static int hf_icmpv6_rpl_opt_route_reserved = -1;
412 static int hf_icmpv6_rpl_opt_route_lifetime = -1;
413 static int hf_icmpv6_rpl_opt_route_prefix = -1;
414 static int hf_icmpv6_rpl_opt_config_flag = -1;
415 static int hf_icmpv6_rpl_opt_config_reserved = -1;
416 static int hf_icmpv6_rpl_opt_config_auth = -1;
417 static int hf_icmpv6_rpl_opt_config_pcs = -1;
418 static int hf_icmpv6_rpl_opt_config_doublings = -1;
419 static int hf_icmpv6_rpl_opt_config_min_interval = -1;
420 static int hf_icmpv6_rpl_opt_config_redundancy = -1;
421 static int hf_icmpv6_rpl_opt_config_rank_incr = -1;
422 static int hf_icmpv6_rpl_opt_config_hop_rank_inc = -1;
423 static int hf_icmpv6_rpl_opt_config_ocp = -1;
424 static int hf_icmpv6_rpl_opt_config_rsv = -1;
425 static int hf_icmpv6_rpl_opt_config_def_lifetime = -1;
426 static int hf_icmpv6_rpl_opt_config_lifetime_unit = -1;
427 static int hf_icmpv6_rpl_opt_target_flag = -1;
428 static int hf_icmpv6_rpl_opt_target_prefix_length = -1;
429 static int hf_icmpv6_rpl_opt_target_prefix = -1;
430 static int hf_icmpv6_rpl_opt_transit_flag = -1;
431 static int hf_icmpv6_rpl_opt_transit_flag_e = -1;
432 static int hf_icmpv6_rpl_opt_transit_flag_rsv = -1;
433 static int hf_icmpv6_rpl_opt_transit_pathseq = -1;
434 static int hf_icmpv6_rpl_opt_transit_pathctl = -1;
435 static int hf_icmpv6_rpl_opt_transit_pathlifetime = -1;
436 static int hf_icmpv6_rpl_opt_transit_parent = -1;
437 static int hf_icmpv6_rpl_opt_solicited_instance = -1;
438 static int hf_icmpv6_rpl_opt_solicited_flag = -1;
439 static int hf_icmpv6_rpl_opt_solicited_flag_v = -1;
440 static int hf_icmpv6_rpl_opt_solicited_flag_i = -1;
441 static int hf_icmpv6_rpl_opt_solicited_flag_d = -1;
442 static int hf_icmpv6_rpl_opt_solicited_flag_rsv = -1;
443 static int hf_icmpv6_rpl_opt_solicited_dodagid = -1;
444 static int hf_icmpv6_rpl_opt_solicited_version = -1;
445 static int hf_icmpv6_rpl_opt_prefix = -1;
446 static int hf_icmpv6_rpl_opt_prefix_flag = -1;
447 static int hf_icmpv6_rpl_opt_prefix_flag_l = -1;
448 static int hf_icmpv6_rpl_opt_prefix_flag_a = -1;
449 static int hf_icmpv6_rpl_opt_prefix_flag_r = -1;
450 static int hf_icmpv6_rpl_opt_prefix_flag_rsv = -1;
451 static int hf_icmpv6_rpl_opt_prefix_vlifetime = -1;
452 static int hf_icmpv6_rpl_opt_prefix_plifetime = -1;
453 static int hf_icmpv6_rpl_opt_prefix_length = -1;
454 static int hf_icmpv6_rpl_opt_targetdesc = -1;
455 static int hf_icmpv6_rpl_opt_route_discovery_flag = -1;
456 static int hf_icmpv6_rpl_opt_route_discovery_reply = -1;
457 static int hf_icmpv6_rpl_opt_route_discovery_hop_by_hop = -1;
458 static int hf_icmpv6_rpl_opt_route_discovery_num_of_routes = -1;
459 static int hf_icmpv6_rpl_opt_route_discovery_compr = -1;
460 static int hf_icmpv6_rpl_opt_route_discovery_lifetime = -1;
461 static int hf_icmpv6_rpl_opt_route_discovery_nh = -1;
462 static int hf_icmpv6_rpl_opt_route_discovery_maxrank = -1;
463 static int hf_icmpv6_rpl_opt_route_discovery_target_addr = -1;
464 static int hf_icmpv6_rpl_opt_route_discovery_addr_vec = -1;
465 static int hf_icmpv6_rpl_opt_route_discovery_addr_vec_addr = -1;
466 static int hf_icmpv6_rpl_p2p_dro_instance = -1;
467 static int hf_icmpv6_rpl_p2p_dro_version = -1;
468 static int hf_icmpv6_rpl_p2p_dro_flag = -1;
469 static int hf_icmpv6_rpl_p2p_dro_flag_stop = -1;
470 static int hf_icmpv6_rpl_p2p_dro_flag_ack = -1;
471 static int hf_icmpv6_rpl_p2p_dro_flag_seq = -1;
472 static int hf_icmpv6_rpl_p2p_dro_flag_reserved = -1;
473 static int hf_icmpv6_rpl_p2p_dro_dagid = -1;
474 static int hf_icmpv6_rpl_p2p_droack_flag = -1;
475 static int hf_icmpv6_rpl_p2p_droack_flag_seq = -1;
476 static int hf_icmpv6_rpl_p2p_droack_flag_reserved = -1;
478 /* RFC6743 Locator Update (156) */
479 static int hf_icmpv6_ilnp_nb_locs = -1;
480 static int hf_icmpv6_ilnp_locator = -1;
481 static int hf_icmpv6_ilnp_preference = -1;
482 static int hf_icmpv6_ilnp_lifetime = -1;
484 static int hf_icmpv6_da_status = -1;
485 static int hf_icmpv6_da_rsv = -1;
486 static int hf_icmpv6_da_lifetime = -1;
487 static int hf_icmpv6_da_eui64 = -1;
488 static int hf_icmpv6_da_raddr = -1;
490 static int icmpv6_tap = -1;
492 /* Conversation related data */
493 static int hf_icmpv6_resp_in = -1;
494 static int hf_icmpv6_resp_to = -1;
495 static int hf_icmpv6_no_resp = -1;
496 static int hf_icmpv6_resptime = -1;
498 typedef struct _icmpv6_conv_info_t {
499 wmem_tree_t *unmatched_pdus;
500 wmem_tree_t *matched_pdus;
501 } icmpv6_conv_info_t;
503 static icmp_transaction_t *transaction_start(packet_info *pinfo, proto_tree *tree, guint32 *key);
504 static icmp_transaction_t *transaction_end(packet_info *pinfo, proto_tree *tree, guint32 *key);
506 static gint ett_icmpv6 = -1;
507 static gint ett_icmpv6_opt = -1;
508 static gint ett_icmpv6_mar = -1;
509 static gint ett_icmpv6_flag_prefix = -1;
510 static gint ett_icmpv6_flag_map = -1;
511 static gint ett_icmpv6_flag_route_info = -1;
512 static gint ett_icmpv6_flag_6lowpan = -1;
513 static gint ett_icmpv6_flag_efo = -1;
514 static gint ett_icmpv6_rpl_opt = -1;
515 static gint ett_icmpv6_rpl_flag_routing = -1;
516 static gint ett_icmpv6_rpl_flag_config = -1;
517 static gint ett_icmpv6_rpl_flag_transit = -1;
518 static gint ett_icmpv6_rpl_flag_solicited = -1;
519 static gint ett_icmpv6_rpl_flag_prefix = -1;
520 static gint ett_icmpv6_rpl_route_discovery_flag = -1;
521 static gint ett_icmpv6_rpl_route_discovery_addr_vec = -1;
522 static gint ett_icmpv6_rpl_p2p_dro_flag = -1;
523 static gint ett_icmpv6_rpl_p2p_droack_flag = -1;
524 static gint ett_icmpv6_flag_ni = -1;
525 static gint ett_icmpv6_flag_rr = -1;
526 static gint ett_icmpv6_rr_mp = -1;
527 static gint ett_icmpv6_rr_up = -1;
528 static gint ett_icmpv6_rr_up_flag_mask = -1;
529 static gint ett_icmpv6_rr_up_flag_ra = -1;
530 static gint ett_icmpv6_rr_up_flag = -1;
531 static gint ett_icmpv6_rr_rm = -1;
532 static gint ett_icmpv6_rr_rm_flag = -1;
533 static gint ett_icmpv6_flag_mld = -1;
534 static gint ett_icmpv6_flag_ra = -1;
535 static gint ett_icmpv6_flag_na = -1;
536 static gint ett_icmpv6_flag_mip6 = -1;
537 static gint ett_icmpv6_flag_fmip6 = -1;
538 static gint ett_icmpv6_flag_secure = -1;
539 static gint ett_icmpv6_flag_rpl_dio = -1;
540 static gint ett_icmpv6_flag_rpl_dao = -1;
541 static gint ett_icmpv6_flag_rpl_daoack = -1;
542 static gint ett_icmpv6_flag_rpl_cc = -1;
543 static gint ett_icmpv6_opt_name = -1;
544 static gint ett_icmpv6_cga_param_name = -1;
546 static expert_field ei_icmpv6_invalid_option_length = EI_INIT;
547 static expert_field ei_icmpv6_undecoded_option = EI_INIT;
548 static expert_field ei_icmpv6_unknown_data = EI_INIT;
549 static expert_field ei_icmpv6_undecoded_rpl_option = EI_INIT;
550 static expert_field ei_icmpv6_undecoded_type = EI_INIT;
551 static expert_field ei_icmpv6_rr_pco_mp_matchlen = EI_INIT;
552 static expert_field ei_icmpv6_rr_pco_mp_matchedlen = EI_INIT;
553 static expert_field ei_icmpv6_checksum = EI_INIT;
554 static expert_field ei_icmpv6_resp_not_found = EI_INIT;
555 static expert_field ei_icmpv6_rpl_p2p_hop_by_hop = EI_INIT;
556 static expert_field ei_icmpv6_rpl_p2p_num_of_routes = EI_INIT;
557 static expert_field ei_icmpv6_rpl_p2p_dro_rdo_zero = EI_INIT;
558 static expert_field ei_icmpv6_rpl_p2p_dro_zero = EI_INIT;
560 static dissector_handle_t icmpv6_handle;
562 static dissector_handle_t ipv6_handle;
563 static dissector_handle_t data_handle;
565 #define ICMP6_DST_UNREACH 1
566 #define ICMP6_PACKET_TOO_BIG 2
567 #define ICMP6_TIME_EXCEEDED 3
568 #define ICMP6_PARAM_PROB 4
569 #define ICMP6_ECHO_REQUEST 128
570 #define ICMP6_ECHO_REPLY 129
571 #define ICMP6_MEMBERSHIP_QUERY 130
572 #define ICMP6_MEMBERSHIP_REPORT 131
573 #define ICMP6_MEMBERSHIP_REDUCTION 132
574 #define ICMP6_ND_ROUTER_SOLICIT 133
575 #define ICMP6_ND_ROUTER_ADVERT 134
576 #define ICMP6_ND_NEIGHBOR_SOLICIT 135
577 #define ICMP6_ND_NEIGHBOR_ADVERT 136
578 #define ICMP6_ND_REDIRECT 137
579 #define ICMP6_ROUTER_RENUMBERING 138
580 #define ICMP6_NI_QUERY 139
581 #define ICMP6_NI_REPLY 140
582 #define ICMP6_IND_SOLICIT 141
583 #define ICMP6_IND_ADVERT 142
584 #define ICMP6_MLDV2_REPORT 143
585 #define ICMP6_MIP6_DHAAD_REQUEST 144
586 #define ICMP6_MIP6_DHAAD_REPLY 145
587 #define ICMP6_MIP6_MPS 146
588 #define ICMP6_MIP6_MPA 147
589 #define ICMP6_CERT_PATH_SOL 148
590 #define ICMP6_CERT_PATH_AD 149
591 #define ICMP6_EXPERIMENTAL_MOBILITY 150
592 #define ICMP6_MCAST_ROUTER_ADVERT 151
593 #define ICMP6_MCAST_ROUTER_SOLICIT 152
594 #define ICMP6_MCAST_ROUTER_TERM 153
595 #define ICMP6_FMIPV6_MESSAGES 154
596 #define ICMP6_RPL_CONTROL 155
597 #define ICMP6_ILNPV6 156
598 #define ICMP6_6LOWPANND_DAR 157
599 #define ICMP6_6LOWPANND_DAC 158
602 static const value_string icmpv6_type_val[] = {
603 { ICMP6_DST_UNREACH, "Destination Unreachable" }, /* [RFC4443] */
604 { ICMP6_PACKET_TOO_BIG, "Packet Too Big" }, /* [RFC4443] */
605 { ICMP6_TIME_EXCEEDED, "Time Exceeded" }, /* [RFC4443] */
606 { ICMP6_PARAM_PROB, "Parameter Problem" }, /* [RFC4443] */
607 { 100, "Private experimentation" }, /* [RFC4443] */
608 { 101, "Private experimentation" }, /* [RFC4443] */
609 { 127, "Reserved for expansion of ICMPv6 error messages" }, /* [RFC4443] */
610 { ICMP6_ECHO_REQUEST, "Echo (ping) request" }, /* [RFC4443] */
611 { ICMP6_ECHO_REPLY, "Echo (ping) reply" }, /* [RFC4443] */
612 { ICMP6_MEMBERSHIP_QUERY, "Multicast Listener Query" }, /* [RFC2710] */
613 { ICMP6_MEMBERSHIP_REPORT, "Multicast Listener Report" }, /* [RFC2710] */
614 { ICMP6_MEMBERSHIP_REDUCTION, "Multicast Listener Done" }, /* [RFC2710] */
615 { ICMP6_ND_ROUTER_SOLICIT, "Router Solicitation" }, /* [RFC4861] */
616 { ICMP6_ND_ROUTER_ADVERT, "Router Advertisement" }, /* [RFC4861] */
617 { ICMP6_ND_NEIGHBOR_SOLICIT, "Neighbor Solicitation" }, /* [RFC4861] */
618 { ICMP6_ND_NEIGHBOR_ADVERT, "Neighbor Advertisement" }, /* [RFC4861] */
619 { ICMP6_ND_REDIRECT, "Redirect" }, /* [RFC4861] */
620 { ICMP6_ROUTER_RENUMBERING, "Router Renumbering" }, /* [RFC2894] */
621 { ICMP6_NI_QUERY, "Node Information Query" }, /* [RFC4620] */
622 { ICMP6_NI_REPLY, "Node Information Reply" }, /* [RFC4620] */
623 { ICMP6_IND_SOLICIT, "Inverse Neighbor Discovery Solicitation" }, /* [RFC3122] */
624 { ICMP6_IND_ADVERT, "Inverse Neighbor Discovery Advertisement" }, /* [RFC3122] */
625 { ICMP6_MLDV2_REPORT, "Multicast Listener Report Message v2" }, /* [RFC3810] */
626 { ICMP6_MIP6_DHAAD_REQUEST, "Home Agent Address Discovery Request" }, /* [RFC6275] */
627 { ICMP6_MIP6_DHAAD_REPLY, "Home Agent Address Discovery Reply" }, /* [RFC6275] */
628 { ICMP6_MIP6_MPS, "Mobile Prefix Solicitation" }, /* [RFC6275] */
629 { ICMP6_MIP6_MPA, "Mobile Prefix Advertisement" }, /* [RFC6275] */
630 { ICMP6_CERT_PATH_SOL, "Certification Path Solicitation" }, /* [RFC3971] */
631 { ICMP6_CERT_PATH_AD, "Certification Path Advertisement" }, /* [RFC3971] */
632 { ICMP6_EXPERIMENTAL_MOBILITY, "Experimental Mobility" }, /* [RFC4065] */
633 { ICMP6_MCAST_ROUTER_ADVERT, "Multicast Router Advertisement" }, /* [RFC4286] */
634 { ICMP6_MCAST_ROUTER_SOLICIT, "Multicast Router Solicitation" }, /* [RFC4286] */
635 { ICMP6_MCAST_ROUTER_TERM, "Multicast Router Termination" }, /* [RFC4286] */
636 { ICMP6_FMIPV6_MESSAGES, "FMIPv6" }, /* [RFC5568] */
637 { ICMP6_RPL_CONTROL, "RPL Control" }, /* [RFC6550] */
638 { ICMP6_ILNPV6, "Locator Update"}, /* [RFC6743] */
639 { ICMP6_6LOWPANND_DAR, "Duplicate Address Request"}, /* [RFC6775] */
640 { ICMP6_6LOWPANND_DAC, "Duplicate Address Confirmation"}, /* [RFC6775] */
641 { 200, "Private experimentation" }, /* [RFC4443] */
642 { 201, "Private experimentation" }, /* [RFC4443] */
643 { 255, "Reserved for expansion of ICMPv6 informational messages" }, /* [RFC4443] */
647 #define ICMP6_DST_UNREACH_NOROUTE 0 /* no route to destination */
648 #define ICMP6_DST_UNREACH_ADMIN 1 /* administratively prohibited */
649 #define ICMP6_DST_UNREACH_NOTNEIGHBOR 2 /* not a neighbor(obsolete) */
650 #define ICMP6_DST_UNREACH_BEYONDSCOPE 2 /* beyond scope of source address */
651 #define ICMP6_DST_UNREACH_ADDR 3 /* address unreachable */
652 #define ICMP6_DST_UNREACH_NOPORT 4 /* port unreachable */
653 #define ICMP6_DST_UNREACH_INGR_EGR 5 /* source address failed ingress/egress policy */
654 #define ICMP6_DST_UNREACH_REJECT 6 /* reject route to destination */
655 #define ICMP6_DST_UNREACH_ERROR 7 /* error in Source Routing Header */
657 static const value_string icmpv6_unreach_code_val[] = {
658 { ICMP6_DST_UNREACH_NOROUTE, "no route to destination" },
659 { ICMP6_DST_UNREACH_ADMIN, "Administratively prohibited" },
660 { ICMP6_DST_UNREACH_BEYONDSCOPE, "Beyond scope of source address" },
661 { ICMP6_DST_UNREACH_ADDR, "Address unreachable" },
662 { ICMP6_DST_UNREACH_NOPORT, "Port unreachable" },
663 { ICMP6_DST_UNREACH_INGR_EGR, "Source address failed ingress/egress policy" },
664 { ICMP6_DST_UNREACH_REJECT, "Reject route to destination" },
665 { ICMP6_DST_UNREACH_ERROR, "Error in Source Routing Header" }, /* [RFC6550] [RFC6554] */
669 #define ICMP6_TIME_EXCEED_TRANSIT 0 /* ttl==0 in transit */
670 #define ICMP6_TIME_EXCEED_REASSEMBLY 1 /* ttl==0 in reass */
672 static const value_string icmpv6_timeex_code_val[] = {
673 { ICMP6_TIME_EXCEED_TRANSIT, "hop limit exceeded in transit" },
674 { ICMP6_TIME_EXCEED_REASSEMBLY, "fragment reassembly time exceeded" },
678 #define ICMP6_PARAMPROB_HEADER 0 /* erroneous header field */
679 #define ICMP6_PARAMPROB_NEXTHEADER 1 /* unrecognized next header */
680 #define ICMP6_PARAMPROB_OPTION 2 /* unrecognized option */
681 #define ICMP6_PARAMPROB_FIRSTFRAG 3 /* IPv6 First Fragment has incomplete IPv6 Header Chain [RFC 7112] */
683 static const value_string icmpv6_paramprob_code_val[] = {
684 { ICMP6_PARAMPROB_HEADER, "erroneous header field encountered" },
685 { ICMP6_PARAMPROB_NEXTHEADER, "unrecognized Next Header type encountered" },
686 { ICMP6_PARAMPROB_OPTION, "unrecognized IPv6 option encountered" },
687 { ICMP6_PARAMPROB_FIRSTFRAG, "IPv6 First Fragment has incomplete IPv6 Header Chain" },
692 /* RFC2894 - Router Renumbering for IPv6 */
694 #define ICMP6_ROUTER_RENUMBERING_COMMAND 0 /* rr command */
695 #define ICMP6_ROUTER_RENUMBERING_RESULT 1 /* rr result */
696 #define ICMP6_ROUTER_RENUMBERING_SEQNUM_RESET 255 /* rr seq num reset */
698 static const value_string icmpv6_rr_code_val[] = {
699 { ICMP6_ROUTER_RENUMBERING_COMMAND, "Command" },
700 { ICMP6_ROUTER_RENUMBERING_RESULT, "Result" },
701 { ICMP6_ROUTER_RENUMBERING_SEQNUM_RESET, "Sequence number reset" },
705 #define RR_FLAG_T 0x80
706 #define RR_FLAG_R 0x40
707 #define RR_FLAG_A 0x20
708 #define RR_FLAG_S 0x10
709 #define RR_FLAG_P 0x08
710 #define RR_FLAG_RSV 0x07
712 static const value_string rr_pco_mp_opcode_val[] = {
720 /* RFC3810 - Multicast Listener Discovery Version 2 (MLDv2) for IPv6 */
722 #define MLDV2_PACKET_MINLEN 28
724 #define MLD_FLAG_S 0x08
725 #define MLD_FLAG_QRV 0x07
726 #define MLD_FLAG_RSV 0xF0
728 static const value_string mldr_record_type_val[] = {
731 { 3, "Changed to include" },
732 { 4, "Changed to exclude" },
733 { 5, "Allow new sources" },
734 { 6, "Block old sources" },
738 /* RFC 4068/5268/5568: Fast Handovers for Mobile IPv6 ( Mobile IPv6 Fast Handovers ) */
740 #define FMIP6_SUBTYPE_RTSOLPR 2
741 #define FMIP6_SUBTYPE_PRRTADV 3
742 #define FMIP6_SUBTYPE_HI 4
743 #define FMIP6_SUBTYPE_HACK 5
745 static const value_string fmip6_subtype_val[] = {
746 { FMIP6_SUBTYPE_RTSOLPR, "Router Solicitation for Proxy Advertisement" },
747 { FMIP6_SUBTYPE_PRRTADV, "Proxy Router Advertisement" },
748 { FMIP6_SUBTYPE_HI, "Handover Initiate" },
749 { FMIP6_SUBTYPE_HACK, "Handover Acknowledge" },
753 static const value_string fmip6_prrtadv_code_val[] = {
754 { 0, "MN should use AP-ID, AR-info tuple" },
755 { 1, "Network Initiated Handover trigger" },
756 { 2, "No new router information" },
757 { 3, "Limited new router information" },
758 { 4, "Unsolicited" },
762 static const value_string fmip6_hi_code_val[] = {
763 { 0, "FBU sent from previous link" },
764 { 1, "FBU sent from new link" },
768 static const value_string fmip6_hack_code_val[] = {
769 { 0, "Handover Accepted, NCoA valid" },
770 { 1, "Handover Accepted, NCoA not valid" },
771 { 2, "Handover Accepted, NCoA in use" },
772 { 3, "Handover Accepted, NCoA assigned" },
773 { 4, "Handover Accepted, NCoA not assigned" },
774 { 128, "Handover Not Accepted, reason unspecified" },
775 { 129, "Administratively prohibited" },
776 { 130, "Insufficient resources" },
780 #define FMIP6_HI_FLAG_S 0x80
781 #define FMIP6_HI_FLAG_U 0x40
782 #define FMIP6_HI_FLAG_RSV 0x3F
784 /* RFC 4620 - IPv6 Node Information Queries */
786 #define ICMP6_NI_SUBJ_IPV6 0 /* Query Subject is an IPv6 address */
787 #define ICMP6_NI_SUBJ_FQDN 1 /* Query Subject is a Domain name */
788 #define ICMP6_NI_SUBJ_IPV4 2 /* Query Subject is an IPv4 address */
790 #define ICMP6_NI_SUCCESS 0 /* node information successful reply */
791 #define ICMP6_NI_REFUSED 1 /* node information request is refused */
792 #define ICMP6_NI_UNKNOWN 2 /* unknown Qtype */
794 #define NI_QTYPE_NOOP 0 /* NOOP */
795 #define NI_QTYPE_SUPTYPES 1 /* Supported Qtypes (Obso) */
796 #define NI_QTYPE_NODENAME 2 /* Node Name */
797 #define NI_QTYPE_NODEADDR 3 /* Node Addresses */
798 #define NI_QTYPE_IPV4ADDR 4 /* IPv4 Addresses */
800 static const value_string ni_query_code_val[] = {
801 { ICMP6_NI_SUBJ_IPV6, "Query subject = IPv6 addresses" },
802 { ICMP6_NI_SUBJ_FQDN, "Query subject = DNS name or empty" },
803 { ICMP6_NI_SUBJ_IPV4, "Query subject = IPv4 addresses" },
807 static const value_string ni_reply_code_val[] = {
808 { ICMP6_NI_SUCCESS, "Successful" },
809 { ICMP6_NI_REFUSED, "Refused" },
810 { ICMP6_NI_UNKNOWN, "Unknown query type" },
813 static const value_string ni_qtype_val[] = {
814 { NI_QTYPE_NOOP, "NOOP" },
815 { NI_QTYPE_SUPTYPES, "Supported query types (Obsolete)" },
816 { NI_QTYPE_NODENAME, "Node Name" },
817 { NI_QTYPE_NODEADDR, "Node addresses" },
818 { NI_QTYPE_IPV4ADDR, "IPv4 node addresses" },
822 #define NI_FLAG_G 0x0020
823 #define NI_FLAG_S 0x0010
824 #define NI_FLAG_L 0x0008
825 #define NI_FLAG_C 0x0004
826 #define NI_FLAG_A 0x0002
827 #define NI_FLAG_T 0x0001
828 #define NI_FLAG_RSV 0xFFC0
830 static const true_false_string tfs_ni_flag_a = {
831 "All unicast address",
832 "Unicast addresses on the queried interface"
835 #define ND_OPT_SOURCE_LINKADDR 1
836 #define ND_OPT_TARGET_LINKADDR 2
837 #define ND_OPT_PREFIX_INFORMATION 3
838 #define ND_OPT_REDIRECTED_HEADER 4
840 #define ND_OPT_NBMA 6
841 #define ND_OPT_ADVINTERVAL 7
842 #define ND_OPT_HOMEAGENT_INFO 8
843 #define ND_OPT_SOURCE_ADDRLIST 9
844 #define ND_OPT_TARGET_ADDRLIST 10
845 #define ND_OPT_CGA 11
846 #define ND_OPT_RSA 12
847 #define ND_OPT_TIMESTAMP 13
848 #define ND_OPT_NONCE 14
849 #define ND_OPT_TRUST_ANCHOR 15
850 #define ND_OPT_CERTIFICATE 16
851 #define ND_OPT_IP_ADDRESS_PREFIX 17
852 #define ND_OPT_NEW_ROUTER_PREFIX_INFO 18
853 #define ND_OPT_LINK_LAYER_ADDRESS 19
854 #define ND_OPT_NEIGHBOR_ADV_ACK 20
855 #define ND_OPT_MAP 23
856 #define ND_OPT_ROUTE_INFO 24
857 #define ND_OPT_RECURSIVE_DNS_SERVER 25
858 #define ND_OPT_FLAGS_EXTENSION 26
859 #define ND_OPT_HANDOVER_KEY_REQUEST 27
860 #define ND_OPT_HANDOVER_KEY_REPLY 28
861 #define ND_OPT_HANDOVER_ASSIST_INFO 29
862 #define ND_OPT_MOBILE_NODE_ID 30
863 #define ND_OPT_DNS_SEARCH_LIST 31
864 #define ND_OPT_PROXY_SIGNATURE 32
865 #define ND_OPT_ADDR_REGISTRATION 33
866 #define ND_OPT_6LOWPAN_CONTEXT 34
867 #define ND_OPT_AUTH_BORDER_ROUTER 35
868 #define ND_OPT_6CIO 36
870 static const value_string option_vals[] = {
871 /* 1 */ { ND_OPT_SOURCE_LINKADDR, "Source link-layer address" },
872 /* 2 */ { ND_OPT_TARGET_LINKADDR, "Target link-layer address" },
873 /* 3 */ { ND_OPT_PREFIX_INFORMATION, "Prefix information" },
874 /* 4 */ { ND_OPT_REDIRECTED_HEADER, "Redirected header" },
875 /* 5 */ { ND_OPT_MTU, "MTU" },
876 /* 6 */ { ND_OPT_NBMA, "NBMA Shortcut Limit Option" }, /* [RFC2491] */
877 /* 7 */ { ND_OPT_ADVINTERVAL, "Advertisement Interval" }, /* [RFC6275] */
878 /* 8 */ { ND_OPT_HOMEAGENT_INFO, "Home Agent Information" }, /* [RFC6275] */
879 /* 9 */ { ND_OPT_SOURCE_ADDRLIST, "Source Address List" }, /* [RFC3122] */
880 /* 10 */ { ND_OPT_TARGET_ADDRLIST, "Target Address List" }, /* [RFC3122] */
881 /* 11 */ { ND_OPT_CGA, "CGA" }, /* [RFC3971] */
882 /* 12 */ { ND_OPT_RSA, "RSA Signature" }, /* [RFC3971] */
883 /* 13 */ { ND_OPT_TIMESTAMP, "Timestamp" }, /* [RFC3971] */
884 /* 14 */ { ND_OPT_NONCE, "Nonce" }, /* [RFC3971] */
885 /* 15 */ { ND_OPT_TRUST_ANCHOR, "Trust Anchor" }, /* [RFC3971] */
886 /* 16 */ { ND_OPT_CERTIFICATE, "Certificate" }, /* [RFC3971] */
887 /* 17 */ { ND_OPT_IP_ADDRESS_PREFIX, "IP Address/Prefix Option" }, /* [RFC5568] */
888 /* 18 */ { ND_OPT_NEW_ROUTER_PREFIX_INFO, "New Router Prefix Information" }, /* [RFC4068] OBSO */
889 /* 19 */ { ND_OPT_LINK_LAYER_ADDRESS, "Link-layer Address" }, /* [RFC5568] */
890 /* 20 */ { ND_OPT_NEIGHBOR_ADV_ACK, "Neighbor Advertisement Acknowledgment" }, /* [RFC5568] */
891 /* 21-22 Unassigned */
892 /* 23 */ { ND_OPT_MAP, "MAP" }, /* [RFC4140] */
893 /* 24 */ { ND_OPT_ROUTE_INFO, "Route Information" }, /* [RFC4191] */
894 /* 25 */ { ND_OPT_RECURSIVE_DNS_SERVER, "Recursive DNS Server" }, /* [RFC6106] */
895 /* 26 */ { ND_OPT_FLAGS_EXTENSION, "RA Flags Extension" }, /* [RFC5175] */
896 /* 27 */ { ND_OPT_HANDOVER_KEY_REQUEST, "Handover Key Request" }, /* [RFC5269] */
897 /* 28 */ { ND_OPT_HANDOVER_KEY_REPLY, "Handover Key Reply" }, /* [RFC5269] */
898 /* 29 */ { ND_OPT_HANDOVER_ASSIST_INFO, "Handover Assist Information" }, /* [RFC5271] */
899 /* 30 */ { ND_OPT_MOBILE_NODE_ID, "Mobile Node Identifier Option" }, /* [RFC5271] */
900 /* 31 */ { ND_OPT_DNS_SEARCH_LIST, "DNS Search List Option" }, /* [RFC6106] */
901 /* 32 */ { ND_OPT_PROXY_SIGNATURE, "Proxy Signature (PS)" }, /* [RFC6496] */
902 /* 33 */ { ND_OPT_ADDR_REGISTRATION, "Address Registration Option" }, /* [RFC6775] */
903 /* 34 */ { ND_OPT_6LOWPAN_CONTEXT, "6LoWPAN Context Option" }, /* [RFC6775] */
904 /* 35 */ { ND_OPT_AUTH_BORDER_ROUTER, "Authoritative Border Router" }, /* [RFC6775] */
905 /* 36 */ { ND_OPT_6CIO, "6LoWPAN Capability Indication Option" }, /* [RFC7400] */
906 /* 37-137 Unassigned */
907 { 138, "CARD Request" }, /* [RFC4065] */
908 { 139, "CARD Reply" }, /* [RFC4065] */
909 /* 140-252 Unassigned */
910 { 253, "RFC3692-style Experiment 1" }, /* [RFC4727] */
911 { 254, "RFC3692-style Experiment 2" }, /* [RFC4727] */
915 #define ND_RA_FLAG_M 0x80
916 #define ND_RA_FLAG_O 0x40
917 #define ND_RA_FLAG_H 0x20
918 #define ND_RA_FLAG_PRF 0x18
919 #define ND_RA_FLAG_P 0x04
920 #define ND_RA_FLAG_RSV 0x02
922 #define ND_NA_FLAG_R 0x80000000
923 #define ND_NA_FLAG_S 0x40000000
924 #define ND_NA_FLAG_O 0x20000000
925 #define ND_NA_FLAG_RSV 0x1FFFFFFF
927 static const value_string nd_flag_router_pref[] = {
935 static const value_string nd_opt_ipa_option_code_val[] = {
936 { 1, "Old Care-of Address" },
937 { 2, "New Care-of Address" },
938 { 3, "NAR's IP address" },
939 { 4, "NAR's Prefix (sent in PrRtAdv)" },
943 static const value_string nd_opt_lla_option_code_val[] = {
945 { 1, "Link-layer Address of the New Access Point" },
946 { 2, "Link-layer Address of the MN" },
947 { 3, "Link-layer Address of the NAR" },
948 { 4, "Link-layer Address of the source" },
949 { 5, "The AP belongs to the current interface of the router" },
950 { 6, "No prefix information available" },
951 { 7, "No fast handovers support available" },
955 static const value_string nd_opt_hai_option_code_val[] = {
956 { 1, "Access Network Identifier (AN ID)" },
961 static const value_string nd_opt_mn_option_code_val[] = {
966 static const value_string nd_opt_naack_status_val[] = {
967 { 1, "New CoA is invalid, perform address configuration" },
968 { 2, "New CoA is invalid, use the supplied CoA" },
969 { 3, "NCoA is invalid, use NAR's IP address as NCoA in FBU" },
970 { 4, "PCoA supplied, do not send FBU" },
971 { 128, "LLA is unrecognized" },
975 #define ND_OPT_6CO_FLAG_C 0x10
976 #define ND_OPT_6CO_FLAG_CID 0x0F
977 #define ND_OPT_6CO_FLAG_RESERVED 0xE0
979 static const value_string nd_opt_6lowpannd_status_val[] = {
981 { 1, "Duplicate Exists" },
982 { 2, "Neighbor Cache Full" },
986 static const value_string icmpv6_option_name_type_vals[] = {
987 { 1, "DER Encoded X.501 Name" },
989 { 3, "SHA-1 Subject Key Identifier (SKI)" },
990 { 4, "SHA-224 Subject Key Identifier (SKI)" },
991 { 5, "SHA-256 Subject Key Identifier (SKI)" },
992 { 6, "SHA-384 Subject Key Identifier (SKI)" },
993 { 7, "SHA-512 Subject Key Identifier (SKI)" },
994 { 253, "Reserved for Experimental Use" },
995 { 254, "Reserved for Experimental Use" },
1000 static const value_string icmpv6_option_cert_type_vals[] = {
1001 { 1, "X.509v3 Certificate" },
1005 /* RFC 4191: Default Router Preferences and More-Specific Routes */
1007 #define ND_RA_FLAG_RTPREF_MASK 0x18 /* 00011000 */
1008 #define ND_RA_FLAG_RESERV_MASK 0xE7 /* 11100111 */
1010 /* RFC 5075/5175 : IPv6 Router Advertisement Flags Option */
1011 #define FLAGS_EO_M 0x8000
1012 #define FLAGS_EO_O 0x4000
1013 #define FLAGS_EO_H 0x2000
1014 #define FLAGS_EO_PRF 0x1800
1015 #define FLAGS_EO_P 0x0400
1016 #define FLAGS_EO_RSV 0x02FF
1020 /* RPL : RFC 6550 : Routing over Low-Power and Lossy Networks. */
1021 /* RPL ICMPv6 Codes */
1022 #define ICMP6_RPL_DIS 0x00 /* DODAG Information Solicitation */
1023 #define ICMP6_RPL_DIO 0x01 /* DODAG Information Object */
1024 #define ICMP6_RPL_DAO 0x02 /* Destination Advertisement Object */
1025 #define ICMP6_RPL_DAOACK 0x03 /* Destination Advertisement Object Ack */
1026 #define ICMP6_RPL_P2P_DRO 0x04 /* P2P Discovery Reply Object */
1027 #define ICMP6_RPL_P2P_DROACK 0x05 /* P2P Discovery Reply Object Acknowledgement */
1028 #define ICMP6_RPL_SDIS 0x80 /* Secure DODAG Information Solicitation */
1029 #define ICMP6_RPL_SDIO 0x81 /* Secure DODAG Information Object */
1030 #define ICMP6_RPL_SDAO 0x82 /* Secure Destination Advertisement Object */
1031 #define ICMP6_RPL_SDAOACK 0x83 /* Secure Destination Advertisement Object Ack */
1032 #define ICMP6_RPL_P2P_SDRO 0x84 /* Secure P2P Discovery Reply Object */
1033 #define ICMP6_RPL_P2P_SDROACK 0x85 /* Secure P2P Discovery Reply Object Acknowledgement */
1034 #define ICMP6_RPL_CC 0x8A /* Consistency Check */
1038 #define RPL_DIO_FLAG_G 0x80
1039 #define RPL_DIO_FLAG_0 0x40
1040 #define RPL_DIO_FLAG_MOP 0x38
1041 #define RPL_DIO_FLAG_PRF 0x07
1044 #define RPL_DAO_FLAG_K 0x80
1045 #define RPL_DAO_FLAG_D 0x40
1046 #define RPL_DAO_FLAG_RESERVED 0x3F
1048 /* RPL DAO ACK Flags */
1049 #define RPL_DAOACK_FLAG_D 0x80
1050 #define RPL_DAOACK_FLAG_RESERVED 0x7F
1053 #define RPL_CC_FLAG_R 0x80
1054 #define RPL_CC_FLAG_RESERVED 0x7F
1057 #define ICMP6_RPL_SECURE 0x80
1059 #define RPL_SECURE_FLAG_T 0x80
1060 #define RPL_SECURE_FLAG_RSV 0x7F
1062 #define RPL_SECURE_LVL 0x07
1063 #define RPL_SECURE_KIM 0xC0
1064 #define RPL_SECURE_RSV 0x38
1066 /* RPL P2P DRO Flags */
1067 #define RPL_P2P_DRO_FLAG_S 0x8000
1068 #define RPL_P2P_DRO_FLAG_A 0x4000
1069 #define RPL_P2P_DRO_FLAG_SEQ 0x3000
1070 #define RPL_P2P_DRO_FLAG_RSV 0x0FFF
1072 /* RPL P2P DROACK Flags */
1073 #define RPL_P2P_DROACK_FLAG_SEQ 0xc000
1074 #define RPL_P2P_DROACK_FLAG_RSV 0x3FFF
1076 /* RPL Option Bitfields */
1077 #define RPL_OPT_PREFIX_FLAG_L 0x80
1078 #define RPL_OPT_PREFIX_FLAG_A 0x40
1079 #define RPL_OPT_PREFIX_FLAG_R 0x20
1080 #define RPL_OPT_PREFIX_FLAG_RSV 0x1F
1081 #define RPL_OPT_ROUTE_PREFERENCE 0x18
1082 #define RPL_OPT_ROUTE_RESERVED 0xE7
1083 #define RPL_OPT_CONFIG_FLAG_AUTH 0x08
1084 #define RPL_OPT_CONFIG_FLAG_PCS 0x07
1085 #define RPL_OPT_CONFIG_FLAG_RESERVED 0xF0
1086 #define RPL_OPT_TRANSIT_FLAG_E 0x80
1087 #define RPL_OPT_TRANSIT_FLAG_RSV 0x7F
1088 #define RPL_OPT_SOLICITED_FLAG_V 0x80
1089 #define RPL_OPT_SOLICITED_FLAG_I 0x40
1090 #define RPL_OPT_SOLICITED_FLAG_D 0x20
1091 #define RPL_OPT_SOLICITED_FLAG_RSV 0x1F
1092 #define RPL_OPT_ROUTE_DISCOVERY_R 0x80
1093 #define RPL_OPT_ROUTE_DISCOVERY_H 0x40
1094 #define RPL_OPT_ROUTE_DISCOVERY_N 0x30
1095 #define RPL_OPT_ROUTE_DISCOVERY_COMPR 0x0F
1096 #define RPL_OPT_ROUTE_DISCOVERY_L 0xC0
1097 #define RPL_OPT_ROUTE_DISCOVERY_MR_NH 0x3F
1099 static const value_string rpl_dio_map_val[] = {
1100 { 0, "No Downward routes maintained by RPL" },
1101 { 1, "Non-Storing Mode of Operation" },
1102 { 2, "Storing Mode of Operation with no multicast support" },
1103 { 3, "Storing Mode of Operation with multicast support" },
1104 { 4, "P2P Route Discovery Mode of Operation" },
1107 static const value_string rpl_code_val[] = {
1108 { ICMP6_RPL_DIS, "DODAG Information Solicitation" },
1109 { ICMP6_RPL_DIO, "DODAG Information Object" },
1110 { ICMP6_RPL_DAO, "Destination Advertisement Object" },
1111 { ICMP6_RPL_DAOACK, "Destination Advertisement Object Acknowledgment" },
1112 { ICMP6_RPL_SDIS, "Secure DODAG Information Solicitation" },
1113 { ICMP6_RPL_SDIO, "Secure DODAG Information Object" },
1114 { ICMP6_RPL_SDAO, "Secure Destination Advertisement Object" },
1115 { ICMP6_RPL_SDAOACK, "Secure Destination Advertisement Object Acknowledgment" },
1116 { ICMP6_RPL_CC, "Consistency Check" },
1117 { ICMP6_RPL_P2P_DRO, "P2P Discovery Reply Object" },
1118 { ICMP6_RPL_P2P_SDRO, "P2P Secure Discovery Reply Object" },
1119 { ICMP6_RPL_P2P_DROACK, "P2P Discovery Reply Object Acknowledgement" },
1120 { ICMP6_RPL_P2P_SDROACK,"P2P Secure Discovery Reply Object Acknowledgement" },
1124 static const value_string rpl_secure_algorithm_encryption_val[] = {
1125 { 0, "CCM with AES-128" },
1129 static const value_string rpl_secure_algorithm_signature_val[] = {
1130 { 0, "RSA with SHA-256" },
1133 /* RPL Option Types */
1134 /* Pending IANA Assignment */
1135 #define RPL_OPT_PAD1 0 /* 1-byte padding */
1136 #define RPL_OPT_PADN 1 /* n-byte padding */
1137 #define RPL_OPT_METRIC 2 /* DAG metric container */
1138 #define RPL_OPT_ROUTING 3 /* Routing Information */
1139 #define RPL_OPT_CONFIG 4 /* DAG configuration */
1140 #define RPL_OPT_TARGET 5 /* RPL Target */
1141 #define RPL_OPT_TRANSIT 6 /* Transit */
1142 #define RPL_OPT_SOLICITED 7 /* Solicited Information */
1143 #define RPL_OPT_PREFIX 8 /* Destination prefix */
1144 #define RPL_OPT_TARGETDESC 9 /* RPL Target Descriptor */
1145 #define RPL_OPT_ROUTE_DISCOVERY 10 /* P2P Route Discovery */
1147 static const value_string rpl_option_vals[] = {
1148 { RPL_OPT_PAD1, "1-byte padding" },
1149 { RPL_OPT_PADN, "n-byte padding" },
1150 { RPL_OPT_METRIC, "DAG Metric container" },
1151 { RPL_OPT_ROUTING, "Routing Information"},
1152 { RPL_OPT_CONFIG, "DODAG configuration" },
1153 { RPL_OPT_TARGET, "RPL Target" },
1154 { RPL_OPT_TRANSIT, "Transit Information" },
1155 { RPL_OPT_SOLICITED, "Solicited Information"},
1156 { RPL_OPT_PREFIX, "Prefix Information"},
1157 { RPL_OPT_TARGETDESC, "RPL Target Descriptor"},
1158 { RPL_OPT_ROUTE_DISCOVERY, "P2P Route Discovery"},
1163 #define ND_OPT_6CIO_FLAG_G 0x0001
1164 #define ND_OPT_6CIO_FLAG_UNASSIGNED 0xFFFE
1167 dissect_contained_icmpv6(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree)
1169 gboolean save_in_error_pkt;
1172 /* Save the current value of the "we're inside an error packet"
1173 flag, and set that flag; subdissectors may treat packets
1174 that are the payload of error packets differently from
1176 save_in_error_pkt = pinfo->flags.in_error_pkt;
1177 pinfo->flags.in_error_pkt = TRUE;
1179 next_tvb = tvb_new_subset_remaining(tvb, offset);
1181 /* tiny sanity check */
1182 if ((tvb_get_guint8(tvb, offset) & 0xf0) == 0x60) {
1183 /* The contained packet is an IPv6 datagram; dissect it. */
1184 offset += call_dissector(ipv6_handle, next_tvb, pinfo, tree);
1186 offset += call_dissector(data_handle, next_tvb, pinfo, tree);
1188 /* Restore the "we're inside an error packet" flag. */
1189 pinfo->flags.in_error_pkt = save_in_error_pkt;
1195 /* ======================================================================= */
1196 static conversation_t *_find_or_create_conversation(packet_info *pinfo)
1198 conversation_t *conv = NULL;
1200 /* Have we seen this conversation before? */
1201 conv = find_conversation(pinfo->fd->num, &pinfo->src, &pinfo->dst,
1202 pinfo->ptype, 0, 0, 0);
1204 /* No, this is a new conversation. */
1205 conv = conversation_new(pinfo->fd->num, &pinfo->src, &pinfo->dst,
1206 pinfo->ptype, 0, 0, 0);
1211 /* ======================================================================= */
1212 static icmp_transaction_t *transaction_start(packet_info *pinfo, proto_tree *tree, guint32 *key)
1214 conversation_t *conversation;
1215 icmpv6_conv_info_t *icmpv6_info;
1216 icmp_transaction_t *icmpv6_trans;
1217 wmem_tree_key_t icmpv6_key[3];
1220 /* Handle the conversation tracking */
1221 conversation = _find_or_create_conversation(pinfo);
1222 icmpv6_info = (icmpv6_conv_info_t *)conversation_get_proto_data(conversation, proto_icmpv6);
1223 if (icmpv6_info == NULL) {
1224 icmpv6_info = wmem_new(wmem_file_scope(), icmpv6_conv_info_t);
1225 icmpv6_info->unmatched_pdus = wmem_tree_new(wmem_file_scope());
1226 icmpv6_info->matched_pdus = wmem_tree_new(wmem_file_scope());
1227 conversation_add_proto_data(conversation, proto_icmpv6, icmpv6_info);
1230 if (!PINFO_FD_VISITED(pinfo)) {
1232 * This is a new request, create a new transaction structure and map it
1233 * to the unmatched table.
1235 icmpv6_key[0].length = 2;
1236 icmpv6_key[0].key = key;
1237 icmpv6_key[1].length = 0;
1238 icmpv6_key[1].key = NULL;
1240 icmpv6_trans = wmem_new(wmem_file_scope(), icmp_transaction_t);
1241 icmpv6_trans->rqst_frame = PINFO_FD_NUM(pinfo);
1242 icmpv6_trans->resp_frame = 0;
1243 icmpv6_trans->rqst_time = pinfo->fd->abs_ts;
1244 nstime_set_zero(&icmpv6_trans->resp_time);
1245 wmem_tree_insert32_array(icmpv6_info->unmatched_pdus, icmpv6_key, (void *)icmpv6_trans);
1247 /* Already visited this frame */
1248 guint32 frame_num = pinfo->fd->num;
1250 icmpv6_key[0].length = 2;
1251 icmpv6_key[0].key = key;
1252 icmpv6_key[1].length = 1;
1253 icmpv6_key[1].key = &frame_num;
1254 icmpv6_key[2].length = 0;
1255 icmpv6_key[2].key = NULL;
1257 icmpv6_trans = (icmp_transaction_t *)wmem_tree_lookup32_array(icmpv6_info->matched_pdus, icmpv6_key);
1260 if (icmpv6_trans == NULL) {
1261 if (PINFO_FD_VISITED(pinfo)) {
1262 /* No response found - add field and expert info */
1263 it = proto_tree_add_item(tree, hf_icmpv6_no_resp, NULL, 0, 0,
1265 PROTO_ITEM_SET_GENERATED(it);
1267 col_append_fstr(pinfo->cinfo, COL_INFO, " (no response found!)");
1269 /* Expert info. TODO: add to _icmp_transaction_t type and sequence number
1270 so can report here (and in taps) */
1271 expert_add_info_format(pinfo, it, &ei_icmpv6_resp_not_found,
1272 "No response seen to ICMPv6 request in frame %u",
1279 /* Print state tracking in the tree */
1280 if (icmpv6_trans->resp_frame) {
1282 it = proto_tree_add_uint(tree, hf_icmpv6_resp_in, NULL, 0, 0,
1283 icmpv6_trans->resp_frame);
1284 PROTO_ITEM_SET_GENERATED(it);
1286 col_append_fstr(pinfo->cinfo, COL_INFO, " (reply in %d)", icmpv6_trans->resp_frame);
1289 return icmpv6_trans;
1291 } /* transaction_start() */
1293 /* ======================================================================= */
1294 static icmp_transaction_t *transaction_end(packet_info *pinfo, proto_tree *tree, guint32 *key)
1296 conversation_t *conversation;
1297 icmpv6_conv_info_t *icmpv6_info;
1298 icmp_transaction_t *icmpv6_trans;
1299 wmem_tree_key_t icmpv6_key[3];
1304 conversation = find_conversation(pinfo->fd->num, &pinfo->src, &pinfo->dst,
1305 pinfo->ptype, 0, 0, 0);
1306 if (conversation == NULL)
1309 icmpv6_info = (icmpv6_conv_info_t *)conversation_get_proto_data(conversation, proto_icmpv6);
1310 if (icmpv6_info == NULL)
1313 if (!PINFO_FD_VISITED(pinfo)) {
1316 icmpv6_key[0].length = 2;
1317 icmpv6_key[0].key = key;
1318 icmpv6_key[1].length = 0;
1319 icmpv6_key[1].key = NULL;
1321 icmpv6_trans = (icmp_transaction_t *)wmem_tree_lookup32_array(icmpv6_info->unmatched_pdus, icmpv6_key);
1322 if (icmpv6_trans == NULL)
1325 /* we have already seen this response, or an identical one */
1326 if (icmpv6_trans->resp_frame != 0)
1329 icmpv6_trans->resp_frame = PINFO_FD_NUM(pinfo);
1332 * we found a match. Add entries to the matched table for both
1333 * request and reply frames
1335 icmpv6_key[0].length = 2;
1336 icmpv6_key[0].key = key;
1337 icmpv6_key[1].length = 1;
1338 icmpv6_key[1].key = &frame_num;
1339 icmpv6_key[2].length = 0;
1340 icmpv6_key[2].key = NULL;
1342 frame_num = icmpv6_trans->rqst_frame;
1343 wmem_tree_insert32_array(icmpv6_info->matched_pdus, icmpv6_key, (void *)icmpv6_trans);
1345 frame_num = icmpv6_trans->resp_frame;
1346 wmem_tree_insert32_array(icmpv6_info->matched_pdus, icmpv6_key, (void *)icmpv6_trans);
1348 /* Already visited this frame */
1349 guint32 frame_num = pinfo->fd->num;
1351 icmpv6_key[0].length = 2;
1352 icmpv6_key[0].key = key;
1353 icmpv6_key[1].length = 1;
1354 icmpv6_key[1].key = &frame_num;
1355 icmpv6_key[2].length = 0;
1356 icmpv6_key[2].key = NULL;
1358 icmpv6_trans = (icmp_transaction_t *)wmem_tree_lookup32_array(icmpv6_info->matched_pdus, icmpv6_key);
1359 if (icmpv6_trans == NULL)
1363 /* Print state tracking in the tree */
1365 it = proto_tree_add_uint(tree, hf_icmpv6_resp_to, NULL, 0, 0,
1366 icmpv6_trans->rqst_frame);
1367 PROTO_ITEM_SET_GENERATED(it);
1370 nstime_delta(&ns, &pinfo->fd->abs_ts, &icmpv6_trans->rqst_time);
1371 icmpv6_trans->resp_time = ns;
1373 resp_time = nstime_to_msec(&ns);
1374 it = proto_tree_add_double_format_value(tree, hf_icmpv6_resptime, NULL,
1375 0, 0, resp_time, "%.3f ms", resp_time);
1376 PROTO_ITEM_SET_GENERATED(it);
1379 col_append_fstr(pinfo->cinfo, COL_INFO, " (request in %d)",
1380 icmpv6_trans->rqst_frame);
1382 return icmpv6_trans;
1384 } /* transaction_end() */
1387 dissect_icmpv6_nd_opt(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree)
1389 proto_tree *icmp6opt_tree, *flag_tree;
1390 proto_item *ti, *ti_opt, *ti_opt_len;
1395 while ((int)tvb_reported_length(tvb) > offset) {
1396 /* there are more options */
1399 opt_len = tvb_get_guint8(tvb, offset + 1) * 8;
1400 ti = proto_tree_add_item(tree, hf_icmpv6_opt, tvb, offset, opt_len, ENC_NA);
1401 icmp6opt_tree = proto_item_add_subtree(ti, ett_icmpv6_opt);
1402 opt_offset = offset;
1405 proto_tree_add_item(icmp6opt_tree, hf_icmpv6_opt_type, tvb, opt_offset, 1, ENC_BIG_ENDIAN);
1406 opt_type = tvb_get_guint8(tvb, opt_offset);
1409 /* Add option name to option root label */
1410 proto_item_append_text(ti, " (%s", val_to_str(opt_type, option_vals, "Unknown %d"));
1413 ti_opt_len = proto_tree_add_item(icmp6opt_tree, hf_icmpv6_opt_length, tvb,opt_offset, 1, ENC_BIG_ENDIAN);
1416 /* Add length value in bytes */
1417 proto_item_append_text(ti_opt_len, " (%i bytes)", opt_len);
1420 expert_add_info_format(pinfo, ti_opt_len, &ei_icmpv6_invalid_option_length, "Invalid option length (Zero)");
1426 case ND_OPT_SOURCE_LINKADDR: /* Source Link-layer Address (1) */
1428 const gchar *link_str;
1429 /* if the opt len is 8, the Link Addr is MAC Address */
1431 proto_tree_add_item(icmp6opt_tree, hf_icmpv6_opt_linkaddr_mac, tvb, opt_offset, 6, ENC_NA);
1432 ti_opt = proto_tree_add_item(icmp6opt_tree, hf_icmpv6_opt_src_linkaddr_mac, tvb, opt_offset, 6, ENC_NA);
1433 PROTO_ITEM_SET_HIDDEN(ti_opt);
1435 link_str = tvb_ether_to_str(tvb, opt_offset);
1436 col_append_fstr(pinfo->cinfo, COL_INFO, " from %s", link_str);
1437 proto_item_append_text(ti, " : %s", link_str);
1438 /* if the opt len is 16 and the 6 last bytes is 0n the Link Addr is EUI64 Address */
1439 }else if(opt_len == 16 && tvb_get_ntohl(tvb, opt_offset + 8) == 0 && tvb_get_ntohs(tvb, opt_offset + 12) == 0){
1440 proto_tree_add_item(icmp6opt_tree, hf_icmpv6_opt_linkaddr_eui64, tvb, opt_offset, 8, ENC_BIG_ENDIAN);
1441 ti_opt = proto_tree_add_item(icmp6opt_tree, hf_icmpv6_opt_src_linkaddr_eui64, tvb, opt_offset, 8, ENC_BIG_ENDIAN);
1442 PROTO_ITEM_SET_HIDDEN(ti_opt);
1443 ti_opt = proto_tree_add_item(icmp6opt_tree, hf_icmpv6_opt_linkaddr, tvb, opt_offset, 8, ENC_NA);
1444 PROTO_ITEM_SET_HIDDEN(ti_opt);
1445 ti_opt = proto_tree_add_item(icmp6opt_tree, hf_icmpv6_opt_src_linkaddr, tvb, opt_offset, 8, ENC_NA);
1446 PROTO_ITEM_SET_HIDDEN(ti_opt);
1448 /* Padding: 6 bytes */
1449 proto_tree_add_item(icmp6opt_tree, hf_icmpv6_opt_padding, tvb, opt_offset + 8, 6, ENC_NA);
1451 link_str = tvb_eui64_to_str(tvb, opt_offset);
1452 col_append_fstr(pinfo->cinfo, COL_INFO, " from %s", link_str);
1453 proto_item_append_text(ti, " : %s", link_str);
1455 proto_tree_add_item(icmp6opt_tree, hf_icmpv6_opt_linkaddr, tvb, opt_offset, opt_len-2, ENC_NA);
1456 ti_opt = proto_tree_add_item(icmp6opt_tree, hf_icmpv6_opt_src_linkaddr, tvb, opt_offset, opt_len-2, ENC_NA);
1457 PROTO_ITEM_SET_HIDDEN(ti_opt);
1459 opt_offset += opt_len;
1463 case ND_OPT_TARGET_LINKADDR: /* Target Link-layer Address (2) */
1465 const gchar *link_str;
1466 /* if the opt len is 8, the Link Addr is MAC Address */
1468 proto_tree_add_item(icmp6opt_tree, hf_icmpv6_opt_linkaddr_mac, tvb, opt_offset, 6, ENC_NA);
1469 ti_opt = proto_tree_add_item(icmp6opt_tree, hf_icmpv6_opt_target_linkaddr_mac, tvb, opt_offset, 6, ENC_NA);
1470 PROTO_ITEM_SET_HIDDEN(ti_opt);
1472 link_str = tvb_ether_to_str(tvb, opt_offset);
1473 col_append_fstr(pinfo->cinfo, COL_INFO, " is at %s", link_str);
1474 proto_item_append_text(ti, " : %s", link_str);
1476 /* if the opt len is 16 and the 6 last bytes is 0n the Link Addr is EUI64 Address */
1477 }else if(opt_len == 16 && tvb_get_ntohl(tvb, opt_offset + 8) == 0 && tvb_get_ntohs(tvb, opt_offset + 12) == 0){
1478 proto_tree_add_item(icmp6opt_tree, hf_icmpv6_opt_linkaddr_eui64, tvb, opt_offset, 8, ENC_BIG_ENDIAN);
1479 ti_opt = proto_tree_add_item(icmp6opt_tree, hf_icmpv6_opt_target_linkaddr_eui64, tvb, opt_offset, 8, ENC_BIG_ENDIAN);
1480 PROTO_ITEM_SET_HIDDEN(ti_opt);
1482 /* Padding: 6 bytes */
1483 proto_tree_add_item(icmp6opt_tree, hf_icmpv6_opt_padding, tvb, opt_offset + 8, 6, ENC_NA);
1485 link_str = tvb_eui64_to_str(tvb, opt_offset);
1486 col_append_fstr(pinfo->cinfo, COL_INFO, " from %s", link_str);
1487 proto_item_append_text(ti, " : %s", link_str);
1489 proto_tree_add_item(icmp6opt_tree, hf_icmpv6_opt_linkaddr, tvb, opt_offset, opt_len-2, ENC_NA);
1490 ti_opt = proto_tree_add_item(icmp6opt_tree, hf_icmpv6_opt_target_linkaddr, tvb, opt_offset, opt_len-2, ENC_NA);
1491 PROTO_ITEM_SET_HIDDEN(ti_opt);
1493 opt_offset += opt_len;
1496 case ND_OPT_PREFIX_INFORMATION: /* Prefix Information (3) */
1502 proto_tree_add_item(icmp6opt_tree, hf_icmpv6_opt_prefix_len, tvb, opt_offset, 1, ENC_BIG_ENDIAN);
1503 prefix_len = tvb_get_guint8(tvb, opt_offset);
1507 ti_opt = proto_tree_add_item(icmp6opt_tree, hf_icmpv6_opt_prefix_flag, tvb, opt_offset, 1, ENC_BIG_ENDIAN);
1508 flag_tree = proto_item_add_subtree(ti_opt, ett_icmpv6_flag_prefix);
1510 proto_tree_add_item(flag_tree, hf_icmpv6_opt_prefix_flag_l, tvb, opt_offset, 1, ENC_BIG_ENDIAN);
1511 proto_tree_add_item(flag_tree, hf_icmpv6_opt_prefix_flag_a, tvb, opt_offset, 1, ENC_BIG_ENDIAN);
1512 proto_tree_add_item(flag_tree, hf_icmpv6_opt_prefix_flag_r, tvb, opt_offset, 1, ENC_BIG_ENDIAN);
1513 proto_tree_add_item(flag_tree, hf_icmpv6_opt_prefix_flag_reserved, tvb, opt_offset, 1, ENC_BIG_ENDIAN);
1516 /* Prefix Valid Lifetime */
1517 ti_opt = proto_tree_add_item(icmp6opt_tree, hf_icmpv6_opt_prefix_valid_lifetime, tvb, opt_offset, 4, ENC_BIG_ENDIAN);
1519 switch(tvb_get_ntohl(tvb, opt_offset)){
1521 proto_item_append_text(ti_opt, " (Infinity)");
1528 /* Prefix Preferred Lifetime */
1529 ti_opt = proto_tree_add_item(icmp6opt_tree, hf_icmpv6_opt_prefix_preferred_lifetime, tvb, opt_offset, 4, ENC_BIG_ENDIAN);
1531 switch(tvb_get_ntohl(tvb, opt_offset)){
1533 proto_item_append_text(ti_opt, " (Infinity)");
1540 proto_tree_add_item(icmp6opt_tree, hf_icmpv6_opt_reserved, tvb, opt_offset, 4, ENC_NA);
1544 proto_tree_add_item(icmp6opt_tree, hf_icmpv6_opt_prefix, tvb, opt_offset, 16, ENC_NA);
1545 proto_item_append_text(ti, " : %s/%d", tvb_ip6_to_str(tvb, opt_offset), prefix_len);
1550 case ND_OPT_REDIRECTED_HEADER: /* Redirected Header (4) */
1552 proto_tree_add_item(icmp6opt_tree, hf_icmpv6_opt_reserved, tvb, opt_offset, 6, ENC_NA);
1555 proto_tree_add_item(icmp6opt_tree, hf_icmpv6_opt_redirected_packet, tvb, opt_offset, -1, ENC_NA);
1557 opt_offset = dissect_contained_icmpv6(tvb, opt_offset, pinfo, icmp6opt_tree);
1559 case ND_OPT_MTU: /* MTU (5) */
1561 proto_tree_add_item(icmp6opt_tree, hf_icmpv6_opt_reserved, tvb, opt_offset, 2, ENC_NA);
1564 proto_tree_add_item(icmp6opt_tree, hf_icmpv6_opt_mtu, tvb, opt_offset, 4, ENC_BIG_ENDIAN);
1565 proto_item_append_text(ti, " : %d", tvb_get_ntohl(tvb, opt_offset));
1568 case ND_OPT_NBMA: /* NBMA Shortcut Limit Option (6) */
1570 proto_tree_add_item(icmp6opt_tree, hf_icmpv6_opt_nbma_shortcut_limit, tvb, opt_offset, 1, ENC_BIG_ENDIAN);
1571 proto_item_append_text(ti, " : %d", tvb_get_guint8(tvb, opt_offset));
1573 proto_tree_add_item(icmp6opt_tree, hf_icmpv6_opt_reserved, tvb, opt_offset, 1, ENC_NA);
1576 proto_tree_add_item(icmp6opt_tree, hf_icmpv6_opt_reserved, tvb, opt_offset, 4, ENC_NA);
1580 case ND_OPT_ADVINTERVAL: /* Advertisement Interval Option (7) */
1582 proto_tree_add_item(icmp6opt_tree, hf_icmpv6_opt_reserved, tvb, opt_offset, 2, ENC_NA);
1585 proto_tree_add_item(icmp6opt_tree, hf_icmpv6_opt_advertisement_interval, tvb, opt_offset, 4, ENC_BIG_ENDIAN);
1586 proto_item_append_text(ti, " : %d", tvb_get_ntohl(tvb, opt_offset));
1590 case ND_OPT_HOMEAGENT_INFO: /* Home Agent Information Option (8) */
1593 proto_tree_add_item(icmp6opt_tree, hf_icmpv6_opt_reserved, tvb, opt_offset, 2, ENC_NA);
1596 proto_tree_add_item(icmp6opt_tree, hf_icmpv6_opt_home_agent_preference, tvb, opt_offset, 2, ENC_BIG_ENDIAN);
1599 proto_tree_add_item(icmp6opt_tree, hf_icmpv6_opt_home_agent_lifetime, tvb, opt_offset, 2, ENC_BIG_ENDIAN);
1603 case ND_OPT_SOURCE_ADDRLIST: /* Source Address List (9) */
1604 case ND_OPT_TARGET_ADDRLIST: /* Target Address List (10)*/
1606 proto_tree_add_item(icmp6opt_tree, hf_icmpv6_opt_reserved, tvb, opt_offset, 6, ENC_NA);
1609 while(opt_offset < (offset + opt_len) ) {
1610 proto_tree_add_item(icmp6opt_tree, hf_icmpv6_opt_ipv6_address, tvb, opt_offset, 16, ENC_NA);
1611 proto_item_append_text(ti, " %s", tvb_ip6_to_str(tvb, opt_offset));
1616 case ND_OPT_CGA: /* CGA Option (11) */
1618 proto_tree *cga_tree;
1619 proto_item *cga_item;
1620 guint16 ext_data_len;
1623 asn1_ctx_t asn1_ctx;
1626 proto_tree_add_item(icmp6opt_tree, hf_icmpv6_opt_cga_pad_len, tvb, opt_offset, 1, ENC_BIG_ENDIAN);
1627 padd_length = tvb_get_guint8(tvb, opt_offset);
1630 /* Reserved 8 bits */
1632 proto_tree_add_item(icmp6opt_tree, hf_icmpv6_opt_reserved, tvb, opt_offset, 1, ENC_NA);
1635 /* CGA Parameters A variable-length field containing the CGA Parameters data
1636 * structure described in Section 4 of
1637 * "Cryptographically Generated Addresses (CGA)", RFC3972.
1639 par_len = opt_len -4 -padd_length;
1640 cga_item = proto_tree_add_item(icmp6opt_tree, hf_icmpv6_opt_cga, tvb, opt_offset, par_len, ENC_NA);
1641 par_len += opt_offset;
1643 cga_tree = proto_item_add_subtree(cga_item, ett_icmpv6_cga_param_name);
1644 proto_tree_add_item(cga_tree, hf_icmpv6_opt_cga_modifier, tvb, opt_offset, 16, ENC_NA);
1647 proto_tree_add_item(cga_tree, hf_icmpv6_opt_cga_subnet_prefix, tvb, opt_offset, 8, ENC_NA);
1650 proto_tree_add_item(cga_tree ,hf_icmpv6_opt_cga_count, tvb, opt_offset, 1, ENC_NA);
1653 asn1_ctx_init(&asn1_ctx, ASN1_ENC_BER, TRUE, pinfo);
1654 opt_offset = dissect_x509af_SubjectPublicKeyInfo(FALSE, tvb, opt_offset, &asn1_ctx, cga_tree, -1);
1656 /* Process RFC 4581*/
1657 while (opt_offset < par_len) {
1658 proto_tree_add_item(cga_tree, hf_icmpv6_opt_cga_ext_type, tvb, opt_offset, 2, ENC_BIG_ENDIAN);
1661 ext_data_len = tvb_get_ntohs(tvb, opt_offset);
1662 proto_tree_add_item(cga_tree, hf_icmpv6_opt_cga_ext_length, tvb, opt_offset, 2, ENC_BIG_ENDIAN);
1665 proto_tree_add_item(cga_tree, hf_icmpv6_opt_cga_ext_data, tvb, opt_offset, ext_data_len, ENC_NA);
1666 opt_offset += ext_data_len;
1670 proto_tree_add_item(icmp6opt_tree, hf_icmpv6_opt_padding, tvb, opt_offset, padd_length, ENC_NA);
1671 opt_offset += padd_length;
1674 case ND_OPT_RSA: /* RSA Signature Option (12) */
1677 /*5.2. RSA Signature Option */
1678 /* Reserved, A 16-bit field reserved for future use. */
1679 proto_tree_add_item(icmp6opt_tree, hf_icmpv6_opt_reserved, tvb, opt_offset, 2, ENC_NA);
1680 opt_offset = opt_offset + 2;
1683 * A 128-bit field containing the most significant (leftmost) 128
1684 * bits of a SHA-1 [14] hash of the public key used for constructing
1687 proto_tree_add_item(icmp6opt_tree, hf_icmpv6_opt_rsa_key_hash, tvb, opt_offset, 16, ENC_NA);
1688 opt_offset = opt_offset + 16;
1690 /* Digital Signature */
1691 par_len = opt_len - 20;
1692 proto_tree_add_item(icmp6opt_tree, hf_icmpv6_opt_digital_signature_padding , tvb, opt_offset, par_len, ENC_NA);
1693 opt_offset += par_len;
1696 /* TODO: Calculate padding length and exclude from the signature */
1699 case ND_OPT_TIMESTAMP: /* Timestamp Option (13) */
1700 /* Reserved A 48-bit field reserved for future use. */
1701 proto_tree_add_item(icmp6opt_tree, hf_icmpv6_opt_reserved, tvb, opt_offset, 6, ENC_NA);
1705 * A 64-bit unsigned integer field containing a timestamp. The value
1706 * indicates the number of seconds since January 1, 1970, 00:00 UTC,
1707 * by using a fixed point format. In this format, the integer number
1708 * of seconds is contained in the first 48 bits of the field, and the
1709 * remaining 16 bits indicate the number of 1/64K fractions of a
1712 proto_tree_add_item(icmp6opt_tree, hf_icmpv6_opt_timestamp, tvb, opt_offset + 2, 4, ENC_TIME_TIMESPEC|ENC_BIG_ENDIAN);
1715 case ND_OPT_NONCE: /* Nonce option (14) */
1717 /* 5.3.2. Nonce Option */
1718 proto_tree_add_item(icmp6opt_tree, hf_icmpv6_opt_nonce, tvb, opt_offset, opt_len - 2, ENC_NA);
1719 opt_offset += opt_len -2;
1721 case ND_OPT_TRUST_ANCHOR: /* Trust Anchor Option (15) */
1723 proto_tree *name_tree;
1724 proto_item *name_item;
1728 asn1_ctx_t asn1_ctx;
1731 name_type = tvb_get_guint8(tvb, opt_offset);
1732 proto_tree_add_item(icmp6opt_tree, hf_icmpv6_opt_name_type, tvb, opt_offset, 1, ENC_BIG_ENDIAN);
1736 padd_length = tvb_get_guint8(tvb, opt_offset);
1737 proto_tree_add_item(icmp6opt_tree, hf_icmpv6_opt_cga_pad_len, tvb, opt_offset, 1, ENC_BIG_ENDIAN);
1740 par_len = opt_len - 4 - padd_length;
1744 /* DER Encoded X.501 Name */
1745 name_item = proto_tree_add_item(icmp6opt_tree, hf_icmpv6_opt_name_x501, tvb, opt_offset, par_len, ENC_NA);
1746 name_tree = proto_item_add_subtree(name_item, ett_icmpv6_opt_name);
1747 asn1_ctx_init(&asn1_ctx, ASN1_ENC_BER, TRUE, pinfo);
1748 dissect_x509if_Name(FALSE, tvb, opt_offset, &asn1_ctx, name_tree, hf_icmpv6_x509if_Name);
1752 proto_tree_add_item(icmp6opt_tree, hf_icmpv6_opt_name_fqdn, tvb, opt_offset, par_len, ENC_ASCII|ENC_NA);
1757 opt_offset += par_len;
1760 proto_tree_add_item(icmp6opt_tree, hf_icmpv6_opt_padding, tvb, opt_offset, padd_length, ENC_NA);
1761 opt_offset += padd_length;
1765 case ND_OPT_CERTIFICATE: /* Certificate Option (16) */
1769 asn1_ctx_t asn1_ctx;
1772 cert_type = tvb_get_guint8(tvb, opt_offset);
1773 proto_tree_add_item(icmp6opt_tree, hf_icmpv6_opt_cert_type, tvb, opt_offset, 1, ENC_BIG_ENDIAN);
1777 proto_tree_add_item(icmp6opt_tree, hf_icmpv6_opt_reserved, tvb, opt_offset, 1, ENC_NA);
1783 asn1_ctx_init(&asn1_ctx, ASN1_ENC_BER, TRUE, pinfo);
1784 opt_offset = dissect_x509af_Certificate(FALSE, tvb, opt_offset, &asn1_ctx, icmp6opt_tree, hf_icmpv6_x509af_Certificate);
1785 padd_length = opt_len - (opt_offset - offset);
1787 proto_tree_add_item(icmp6opt_tree, hf_icmpv6_opt_padding, tvb, opt_offset, padd_length, ENC_NA);
1788 opt_offset += padd_length;
1790 padd_length = opt_len - 4;
1791 proto_tree_add_item(icmp6opt_tree, hf_icmpv6_opt_certificate_padding, tvb, opt_offset, padd_length, ENC_NA);
1792 opt_offset += padd_length;
1797 case ND_OPT_IP_ADDRESS_PREFIX: /* IP Address/Prefix Option (17) */
1802 proto_tree_add_item(icmp6opt_tree, hf_icmpv6_opt_ipa_option_code, tvb, opt_offset, 1, ENC_BIG_ENDIAN);
1806 proto_tree_add_item(icmp6opt_tree, hf_icmpv6_opt_ipa_prefix_len, tvb, opt_offset, 1, ENC_BIG_ENDIAN);
1807 prefix_len = tvb_get_guint8(tvb, opt_offset);
1810 proto_tree_add_item(icmp6opt_tree, hf_icmpv6_opt_reserved, tvb, opt_offset, 4, ENC_NA);
1814 proto_tree_add_item(icmp6opt_tree, hf_icmpv6_opt_ipa_ipv6_address, tvb, opt_offset, 16, ENC_NA);
1815 proto_item_append_text(ti, " %s/%d", tvb_ip6_to_str(tvb, opt_offset), prefix_len);
1820 case ND_OPT_NEW_ROUTER_PREFIX_INFO: /* New Router Prefix Information Option (18) OBSO... */
1826 proto_tree_add_item(icmp6opt_tree, hf_icmpv6_opt_nrpi_option_code, tvb, opt_offset, 1, ENC_BIG_ENDIAN);
1830 proto_tree_add_item(icmp6opt_tree, hf_icmpv6_opt_nrpi_prefix_len, tvb, opt_offset, 1, ENC_BIG_ENDIAN);
1831 prefix_len = tvb_get_guint8(tvb, opt_offset);
1834 proto_tree_add_item(icmp6opt_tree, hf_icmpv6_opt_reserved, tvb, opt_offset, 4, ENC_NA);
1838 proto_tree_add_item(icmp6opt_tree, hf_icmpv6_opt_nrpi_prefix, tvb, opt_offset, 16, ENC_NA);
1839 proto_item_append_text(ti, " %s/%d", tvb_ip6_to_str(tvb, opt_offset), prefix_len);
1844 case ND_OPT_LINK_LAYER_ADDRESS: /* Link-layer Address Option (19) */
1847 proto_tree_add_item(icmp6opt_tree, hf_icmpv6_opt_lla_option_code, tvb, opt_offset, 1, ENC_BIG_ENDIAN);
1850 /* Link Layer Address */
1851 proto_tree_add_item(icmp6opt_tree, hf_icmpv6_opt_lla_bytes, tvb, opt_offset, opt_len-3, ENC_NA);
1852 opt_offset += opt_len - 3;
1856 case ND_OPT_NEIGHBOR_ADV_ACK: /* Neighbor Advertisement Acknowledgment Option (20) */
1861 proto_tree_add_item(icmp6opt_tree, hf_icmpv6_opt_naack_option_code, tvb, opt_offset, 1, ENC_BIG_ENDIAN);
1865 proto_tree_add_item(icmp6opt_tree, hf_icmpv6_opt_naack_status, tvb, opt_offset, 1, ENC_BIG_ENDIAN);
1866 status = tvb_get_guint8(tvb, opt_offset);
1870 proto_tree_add_item(icmp6opt_tree, hf_icmpv6_opt_naack_supplied_ncoa, tvb, opt_offset, 16, ENC_NA);
1873 proto_tree_add_item(icmp6opt_tree, hf_icmpv6_opt_reserved, tvb, opt_offset, opt_len - 4, ENC_NA);
1874 opt_offset += opt_len - 4;
1878 case ND_OPT_MAP: /* MAP Option (23) */
1882 proto_tree_add_item(icmp6opt_tree, hf_icmpv6_opt_map_dist, tvb, opt_offset, 1, ENC_BIG_ENDIAN);
1885 proto_tree_add_item(icmp6opt_tree, hf_icmpv6_opt_map_pref, tvb, opt_offset, 1, ENC_BIG_ENDIAN);
1889 ti_opt = proto_tree_add_item(icmp6opt_tree, hf_icmpv6_opt_map_flag, tvb, opt_offset, 1, ENC_BIG_ENDIAN);
1890 flag_tree = proto_item_add_subtree(ti_opt, ett_icmpv6_flag_map);
1892 proto_tree_add_item(flag_tree, hf_icmpv6_opt_map_flag_r, tvb, opt_offset, 1, ENC_BIG_ENDIAN);
1893 proto_tree_add_item(flag_tree, hf_icmpv6_opt_map_flag_reserved, tvb, opt_offset, 1, ENC_BIG_ENDIAN);
1896 /* Valid Lifetime */
1897 proto_tree_add_item(icmp6opt_tree, hf_icmpv6_opt_map_valid_lifetime, tvb, opt_offset, 4, ENC_BIG_ENDIAN);
1900 /* Global Address */
1901 proto_tree_add_item(icmp6opt_tree, hf_icmpv6_opt_map_global_address, tvb, opt_offset, 16, ENC_NA);
1905 case ND_OPT_ROUTE_INFO: /* Route Information Option (24) */
1909 guint8 route_preference;
1910 struct e_in6_addr prefix;
1911 address prefix_addr;
1914 proto_tree_add_item(icmp6opt_tree, hf_icmpv6_opt_prefix_len, tvb, opt_offset, 1, ENC_BIG_ENDIAN);
1915 prefix_len = tvb_get_guint8(tvb, opt_offset);
1919 ti_opt = proto_tree_add_item(icmp6opt_tree, hf_icmpv6_opt_route_info_flag, tvb, opt_offset, 1, ENC_BIG_ENDIAN);
1920 flag_tree = proto_item_add_subtree(ti_opt, ett_icmpv6_flag_route_info);
1922 proto_tree_add_item(flag_tree, hf_icmpv6_opt_route_info_flag_route_preference, tvb, opt_offset, 1, ENC_BIG_ENDIAN);
1923 proto_tree_add_item(flag_tree, hf_icmpv6_opt_route_info_flag_reserved, tvb, opt_offset, 1, ENC_BIG_ENDIAN);
1925 route_preference = tvb_get_guint8(tvb, opt_offset);
1926 route_preference = (route_preference & ND_RA_FLAG_RTPREF_MASK) >> 3;
1927 proto_item_append_text(ti, " : %s", val_to_str(route_preference, nd_flag_router_pref, "Unknown %d") );
1930 /* Route Lifetime */
1931 ti_opt = proto_tree_add_item(icmp6opt_tree, hf_icmpv6_opt_route_lifetime, tvb, opt_offset, 4, ENC_BIG_ENDIAN);
1933 switch(tvb_get_ntohl(tvb, opt_offset)){
1935 proto_item_append_text(ti_opt, " (Infinity)");
1944 case 8: /* Default Option Length without prefix */
1945 proto_item_append_text(ti, " ::/%d", prefix_len);
1948 memset(&prefix, 0, sizeof(prefix));
1949 tvb_memcpy(tvb, (guint8 *)&prefix.bytes, opt_offset, 8);
1950 proto_tree_add_ipv6(icmp6opt_tree, hf_icmpv6_opt_prefix, tvb, opt_offset, 8, prefix.bytes);
1951 SET_ADDRESS(&prefix_addr, AT_IPv6, 16, prefix.bytes);
1952 proto_item_append_text(ti, " %s/%d", address_to_str(wmem_packet_scope(), &prefix_addr), prefix_len);
1956 proto_tree_add_item(icmp6opt_tree, hf_icmpv6_opt_prefix, tvb, opt_offset, 16, ENC_NA);
1957 proto_item_append_text(ti, " %s/%d", tvb_ip6_to_str(tvb, opt_offset), prefix_len);
1961 expert_add_info(pinfo, ti_opt_len, &ei_icmpv6_invalid_option_length);
1968 case ND_OPT_RECURSIVE_DNS_SERVER: /* Recursive DNS Server Option (25) */
1971 proto_tree_add_item(icmp6opt_tree, hf_icmpv6_opt_reserved, tvb, opt_offset, 2, ENC_NA);
1974 /* RDNSS Lifetime */
1975 ti_opt = proto_tree_add_item(icmp6opt_tree, hf_icmpv6_opt_rdnss_lifetime, tvb, opt_offset, 4, ENC_BIG_ENDIAN);
1976 /* A value of all one bits (0xffffffff) represents infinity. A value of
1977 * zero means that the RDNSS address MUST no longer be used.
1979 switch(tvb_get_ntohl(tvb, opt_offset)){
1981 proto_item_append_text(ti_opt, " (RDNSS address MUST no longer be used)");
1984 proto_item_append_text(ti_opt, " (Infinity)");
1991 while(opt_offset < (offset + opt_len) ) {
1992 proto_tree_add_item(icmp6opt_tree, hf_icmpv6_opt_rdnss, tvb, opt_offset, 16, ENC_NA);
1993 proto_item_append_text(ti, " %s", tvb_ip6_to_str(tvb, opt_offset));
1999 case ND_OPT_FLAGS_EXTENSION: /* RA Flags Extension Option (26) */
2001 ti_opt = proto_tree_add_item(icmp6opt_tree, hf_icmpv6_opt_efo, tvb, opt_offset, 6, ENC_NA);
2002 flag_tree = proto_item_add_subtree(ti_opt, ett_icmpv6_flag_efo);
2004 proto_tree_add_item(flag_tree, hf_icmpv6_opt_efo_m, tvb, opt_offset, 2, ENC_BIG_ENDIAN);
2005 proto_tree_add_item(flag_tree, hf_icmpv6_opt_efo_o, tvb, opt_offset, 2, ENC_BIG_ENDIAN);
2006 proto_tree_add_item(flag_tree, hf_icmpv6_opt_efo_h, tvb, opt_offset, 2, ENC_BIG_ENDIAN);
2007 proto_tree_add_item(flag_tree, hf_icmpv6_opt_efo_prf, tvb, opt_offset, 2, ENC_BIG_ENDIAN);
2008 proto_tree_add_item(flag_tree, hf_icmpv6_opt_efo_p, tvb, opt_offset, 2, ENC_BIG_ENDIAN);
2009 proto_tree_add_item(flag_tree, hf_icmpv6_opt_efo_rsv, tvb, opt_offset, 2, ENC_BIG_ENDIAN);
2012 proto_tree_add_item(flag_tree, hf_icmpv6_opt_reserved, tvb, opt_offset, 4, ENC_NA);
2016 case ND_OPT_HANDOVER_KEY_REQUEST: /* Handover Key Request Option (27) */
2022 proto_tree_add_item(icmp6opt_tree, hf_icmpv6_opt_hkr_pad_length, tvb, opt_offset, 1, ENC_BIG_ENDIAN);
2023 padd_length = tvb_get_guint8(tvb, opt_offset);
2027 proto_tree_add_item(icmp6opt_tree, hf_icmpv6_opt_hkr_at, tvb, opt_offset, 1, ENC_BIG_ENDIAN);
2030 proto_tree_add_item(icmp6opt_tree, hf_icmpv6_opt_hkr_reserved, tvb, opt_offset, 1, ENC_BIG_ENDIAN);
2033 /* Handover Key Encryption Public Key */
2034 par_len = opt_len-4-padd_length;
2035 proto_tree_add_item(icmp6opt_tree, hf_icmpv6_opt_hkr_encryption_public_key, tvb, opt_offset, par_len, ENC_NA);
2036 opt_offset += par_len;
2039 proto_tree_add_item(icmp6opt_tree, hf_icmpv6_opt_hkr_padding, tvb, opt_offset, padd_length, ENC_NA);
2043 case ND_OPT_HANDOVER_KEY_REPLY: /* Handover Key Reply Option (28) */
2049 proto_tree_add_item(icmp6opt_tree, hf_icmpv6_opt_hkr_pad_length, tvb, opt_offset, 1, ENC_BIG_ENDIAN);
2050 padd_length = tvb_get_guint8(tvb, opt_offset);
2054 proto_tree_add_item(icmp6opt_tree, hf_icmpv6_opt_hkr_at, tvb, opt_offset, 1, ENC_BIG_ENDIAN);
2057 proto_tree_add_item(icmp6opt_tree, hf_icmpv6_opt_hkr_reserved, tvb, opt_offset, 1, ENC_BIG_ENDIAN);
2061 proto_tree_add_item(icmp6opt_tree, hf_icmpv6_opt_hkr_lifetime, tvb, opt_offset, 2, ENC_BIG_ENDIAN);
2064 /* Encrypted Handover Key */
2065 par_len = opt_len-6-padd_length;
2066 proto_tree_add_item(icmp6opt_tree, hf_icmpv6_opt_hkr_encrypted_handover_key, tvb, opt_offset, par_len, ENC_NA);
2067 opt_offset += par_len;
2070 proto_tree_add_item(icmp6opt_tree, hf_icmpv6_opt_hkr_padding, tvb, opt_offset, padd_length, ENC_NA);
2074 case ND_OPT_HANDOVER_ASSIST_INFO: /* Handover Assist Information Option (29) */
2079 proto_tree_add_item(icmp6opt_tree, hf_icmpv6_opt_hai_option_code, tvb, opt_offset, 1, ENC_BIG_ENDIAN);
2083 proto_tree_add_item(icmp6opt_tree, hf_icmpv6_opt_hai_length, tvb, opt_offset, 1, ENC_BIG_ENDIAN);
2084 hai_len = tvb_get_guint8(tvb, opt_offset);
2088 proto_tree_add_item(icmp6opt_tree, hf_icmpv6_opt_hai_value, tvb, opt_offset, hai_len, ENC_NA);
2089 opt_offset += hai_len;
2092 padd_length = opt_len - opt_offset;
2093 proto_tree_add_item(icmp6opt_tree, hf_icmpv6_opt_padding, tvb, opt_offset, padd_length, ENC_NA);
2094 opt_offset += padd_length;
2098 case ND_OPT_MOBILE_NODE_ID: /* Mobile Node Identifier Option (30) */
2103 proto_tree_add_item(icmp6opt_tree, hf_icmpv6_opt_mn_option_code, tvb, opt_offset, 1, ENC_BIG_ENDIAN);
2107 proto_tree_add_item(icmp6opt_tree, hf_icmpv6_opt_mn_length, tvb, opt_offset, 1, ENC_BIG_ENDIAN);
2108 mn_len = tvb_get_guint8(tvb, opt_offset);
2112 proto_tree_add_item(icmp6opt_tree, hf_icmpv6_opt_mn_value, tvb, opt_offset, mn_len, ENC_NA);
2113 opt_offset += mn_len;
2116 padd_length = opt_len - opt_offset;
2117 proto_tree_add_item(icmp6opt_tree, hf_icmpv6_opt_padding, tvb, opt_offset, padd_length, ENC_NA);
2118 opt_offset += padd_length;
2122 case ND_OPT_DNS_SEARCH_LIST: /* DNS Search List Option (31) */
2125 const guchar *dnssl_name;
2128 proto_tree_add_item(icmp6opt_tree, hf_icmpv6_opt_reserved, tvb, opt_offset, 2, ENC_NA);
2131 /* DNSSL Lifetime */
2132 ti_opt = proto_tree_add_item(icmp6opt_tree, hf_icmpv6_opt_dnssl_lifetime, tvb, opt_offset, 4, ENC_BIG_ENDIAN);
2133 switch(tvb_get_ntohl(tvb, opt_offset)){
2135 proto_item_append_text(ti_opt, " (DNSSL domain name MUST no longer be used)");
2138 proto_item_append_text(ti_opt, " (Infinity)");
2144 while(opt_offset < (offset + opt_len) ) {
2146 if(tvb_get_guint8(tvb, opt_offset) == 0){
2148 int padd_length = (offset + opt_len) - opt_offset;
2149 proto_tree_add_item(icmp6opt_tree, hf_icmpv6_opt_padding, tvb, opt_offset, padd_length, ENC_NA);
2150 opt_offset += padd_length;
2153 dnssl_len = get_dns_name(tvb, opt_offset, 0, opt_offset, &dnssl_name);
2154 proto_tree_add_string(icmp6opt_tree, hf_icmpv6_opt_dnssl, tvb, opt_offset, dnssl_len, dnssl_name);
2155 proto_item_append_text(ti, " %s", dnssl_name);
2156 opt_offset += dnssl_len;
2161 case ND_OPT_PROXY_SIGNATURE: /* Proxy Signature Option (32) */
2166 proto_tree_add_item(icmp6opt_tree, hf_icmpv6_opt_reserved, tvb, opt_offset, 2, ENC_NA);
2170 * A 128-bit field containing the most significant (leftmost) 128
2171 * bits of a SHA-1 [14] hash of the public key used for constructing
2174 proto_tree_add_item(icmp6opt_tree, hf_icmpv6_opt_ps_key_hash, tvb, opt_offset, 16, ENC_NA);
2177 /* Digital Signature */
2178 par_len = opt_len - 20;
2179 proto_tree_add_item(icmp6opt_tree, hf_icmpv6_opt_digital_signature_padding , tvb, opt_offset, par_len, ENC_NA);
2180 opt_offset += par_len;
2182 /* TODO: Calculate padding length and exclude from the signature */
2185 case ND_OPT_ADDR_REGISTRATION: /* Address Registration (TBD1 Pending IANA...) */
2191 proto_tree_add_item(icmp6opt_tree, hf_icmpv6_opt_aro_status, tvb, opt_offset, 1, ENC_BIG_ENDIAN);
2192 status = tvb_get_guint8(tvb, opt_offset);
2196 proto_tree_add_item(icmp6opt_tree, hf_icmpv6_opt_reserved, tvb, opt_offset, 3, ENC_NA);
2200 proto_tree_add_item(icmp6opt_tree, hf_icmpv6_opt_aro_registration_lifetime, tvb, opt_offset, 2, ENC_BIG_ENDIAN);
2204 proto_tree_add_item(icmp6opt_tree, hf_icmpv6_opt_aro_eui64, tvb, opt_offset, 8, ENC_BIG_ENDIAN);
2205 proto_item_append_text(ti, " : Register %s %s", tvb_eui64_to_str(tvb, opt_offset), val_to_str(status, nd_opt_6lowpannd_status_val, "Unknown %d"));
2210 case ND_OPT_6LOWPAN_CONTEXT: /* 6LoWPAN Context (TBD2 Pending IANA...) */
2212 ieee802154_hints_t *hints;
2216 struct e_in6_addr context_prefix;
2217 address context_prefix_addr;
2219 /* Context Length */
2220 proto_tree_add_item(icmp6opt_tree, hf_icmpv6_opt_6co_context_length, tvb, opt_offset, 1, ENC_BIG_ENDIAN);
2221 context_len = tvb_get_guint8(tvb, opt_offset);
2225 context_id = tvb_get_guint8(tvb, opt_offset) & ND_OPT_6CO_FLAG_CID;
2226 ti_opt = proto_tree_add_item(icmp6opt_tree, hf_icmpv6_opt_6co_flag, tvb, opt_offset, 1, ENC_BIG_ENDIAN);
2227 flag_tree = proto_item_add_subtree(ti_opt, ett_icmpv6_flag_6lowpan);
2228 proto_tree_add_item(flag_tree, hf_icmpv6_opt_6co_flag_c, tvb, opt_offset, 1, ENC_BIG_ENDIAN);
2229 proto_tree_add_item(flag_tree, hf_icmpv6_opt_6co_flag_cid, tvb, opt_offset, 1, ENC_BIG_ENDIAN);
2230 proto_tree_add_item(flag_tree, hf_icmpv6_opt_6co_flag_reserved, tvb, opt_offset, 1, ENC_BIG_ENDIAN);
2234 proto_tree_add_item(icmp6opt_tree, hf_icmpv6_opt_reserved, tvb, opt_offset, 2, ENC_NA);
2238 proto_tree_add_item(icmp6opt_tree, hf_icmpv6_opt_6co_valid_lifetime, tvb, opt_offset, 2, ENC_BIG_ENDIAN);
2242 memset(&context_prefix.bytes, 0, sizeof(context_prefix));
2244 case 8: /* Default Option Length without context prefix */
2245 proto_item_append_text(ti, " ::/%d", context_len);
2248 tvb_memcpy(tvb, (guint8 *)&context_prefix.bytes, opt_offset, 8);
2249 proto_tree_add_ipv6(icmp6opt_tree, hf_icmpv6_opt_6co_context_prefix, tvb, opt_offset, 8, context_prefix.bytes);
2250 SET_ADDRESS(&context_prefix_addr, AT_IPv6, 16, context_prefix.bytes);
2251 proto_item_append_text(ti, " %s/%d", address_to_str(wmem_packet_scope(), &context_prefix_addr), context_len);
2255 tvb_memcpy(tvb, (guint8 *)&context_prefix.bytes, opt_offset, 16);
2256 proto_tree_add_item(icmp6opt_tree, hf_icmpv6_opt_6co_context_prefix, tvb, opt_offset, 16, ENC_NA);
2257 proto_item_append_text(ti, " %s/%d", tvb_ip6_to_str(tvb, opt_offset), context_len);
2261 expert_add_info(pinfo, ti_opt_len, &ei_icmpv6_invalid_option_length);
2264 /* Update the 6LoWPAN dissectors with new context information. */
2265 hints = (ieee802154_hints_t *)p_get_proto_data(wmem_file_scope(), pinfo,
2266 proto_get_id_by_filter_name(IEEE802154_PROTOABBREV_WPAN), 0);
2267 if ((opt_len <= 24) && hints) {
2268 lowpan_context_insert(context_id, hints->src_pan, context_len, &context_prefix, pinfo->fd->num);
2272 case ND_OPT_AUTH_BORDER_ROUTER: /* Authoritative Border Router (33) */
2274 guint16 version_low, version_high, valid_lifetime;
2277 proto_tree_add_item(icmp6opt_tree, hf_icmpv6_opt_abro_version_low, tvb, opt_offset, 2, ENC_BIG_ENDIAN);
2278 version_low = tvb_get_ntohs(tvb, opt_offset);
2282 proto_tree_add_item(icmp6opt_tree, hf_icmpv6_opt_abro_version_high, tvb, opt_offset, 2, ENC_BIG_ENDIAN);
2283 version_high = tvb_get_ntohs(tvb, opt_offset);
2286 /* Valid lifetime */
2287 proto_tree_add_item(icmp6opt_tree, hf_icmpv6_opt_abro_valid_lifetime, tvb, opt_offset, 2, ENC_BIG_ENDIAN);
2288 valid_lifetime = tvb_get_ntohs(tvb, opt_offset);
2292 proto_tree_add_item(icmp6opt_tree, hf_icmpv6_opt_abro_6lbr_address, tvb, opt_offset, 16, ENC_NA);
2293 proto_item_append_text(ti, " : Version %d.%d, Valid Lifetime : %d, 6LBR : %s", version_high, version_low, valid_lifetime, tvb_ip6_to_str(tvb, opt_offset));
2298 case ND_OPT_6CIO: /* 6LoWPAN Capability Indication Option (35) */
2301 proto_tree_add_item(icmp6opt_tree, hf_icmpv6_opt_6cio_unassigned1, tvb, opt_offset, 2, ENC_BIG_ENDIAN);
2302 proto_tree_add_item(icmp6opt_tree, hf_icmpv6_opt_6cio_flag_g, tvb, opt_offset, 2, ENC_BIG_ENDIAN);
2305 proto_tree_add_item(icmp6opt_tree, hf_icmpv6_opt_6cio_unassigned2, tvb, opt_offset, 4, ENC_BIG_ENDIAN);
2312 expert_add_info_format(pinfo, ti, &ei_icmpv6_undecoded_option,
2313 "Dissector for ICMPv6 Option (%d)"
2314 " code not implemented, Contact Wireshark developers"
2315 " if you want this supported", opt_type);
2316 proto_tree_add_item(icmp6opt_tree, hf_icmpv6_data, tvb, opt_offset, opt_len, ENC_NA);
2317 opt_offset += opt_len;
2320 } /* switch (opt_type) */
2324 if(offset > opt_offset){
2325 ti_opt = proto_tree_add_item(icmp6opt_tree, hf_icmpv6_unknown_data, tvb, opt_offset, offset - opt_offset, ENC_NA);
2326 expert_add_info(pinfo, ti_opt, &ei_icmpv6_unknown_data);
2328 /* Close the ) to option root label */
2329 proto_item_append_text(ti, ")");
2335 /* RPL: RFC 6550/6997 : Routing and Discovery of P2P Routes in Low-Power and Lossy Networks. */
2337 dissect_icmpv6_rpl_opt(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree, guint8 icmp6_code)
2339 proto_tree *icmp6opt_tree, *flag_tree;
2340 proto_item *ti, *ti_opt, *ti_opt_len, *ti_opt_reply, *ti_opt_hop_by_hop, *ti_opt_num_of_routes,
2341 *ti_opt_lifetime, *ti_opt_mr_nh = NULL;
2346 while ((int)tvb_reported_length(tvb) > offset) {
2347 /* there are more options */
2349 /* ICMPv6 RPL Option */
2350 ti = proto_tree_add_item(tree, hf_icmpv6_rpl_opt, tvb, offset, 1, ENC_NA);
2351 icmp6opt_tree = proto_item_add_subtree(ti, ett_icmpv6_rpl_opt);
2352 opt_offset = offset;
2355 proto_tree_add_item(icmp6opt_tree, hf_icmpv6_rpl_opt_type, tvb, opt_offset, 1, ENC_BIG_ENDIAN);
2356 opt_type = tvb_get_guint8(tvb, opt_offset);
2359 /* Add option name to option root label */
2360 proto_item_append_text(ti, " (%s", val_to_str(opt_type, rpl_option_vals, "Unknown %d"));
2362 /* The Pad1 option is a special case, and contains no data. */
2363 if (opt_type == RPL_OPT_PAD1) {
2365 proto_item_append_text(ti, ")");
2370 ti_opt_len = proto_tree_add_item(icmp6opt_tree, hf_icmpv6_rpl_opt_length, tvb, opt_offset, 1, ENC_BIG_ENDIAN);
2371 opt_len = tvb_get_guint8(tvb, opt_offset);
2372 proto_item_set_len(ti, opt_len + 2);
2378 /* n-byte padding */
2379 ti_opt = proto_tree_add_item(icmp6opt_tree, hf_icmpv6_rpl_opt_padn, tvb, opt_offset, opt_len, ENC_NA);
2380 proto_item_append_text(ti_opt, " (Length : %i bytes)", opt_len);
2381 opt_offset += opt_len;
2384 case RPL_OPT_METRIC:
2385 /* DAG metric container */
2386 /* See draft-ietf-roll-routing-metrics for formatting. */
2388 case RPL_OPT_ROUTING: {
2390 struct e_in6_addr prefix;
2391 address prefix_addr;
2394 prefix_len = tvb_get_guint8(tvb, opt_offset);
2395 proto_tree_add_item(icmp6opt_tree, hf_icmpv6_rpl_opt_route_prefix_length, tvb, opt_offset, 1, ENC_BIG_ENDIAN);
2399 ti_opt = proto_tree_add_item(icmp6opt_tree, hf_icmpv6_rpl_opt_route_flag, tvb, opt_offset, 1, ENC_NA);
2400 flag_tree = proto_item_add_subtree(ti_opt, ett_icmpv6_rpl_flag_routing);
2402 proto_tree_add_item(flag_tree, hf_icmpv6_rpl_opt_route_pref, tvb, opt_offset, 1, ENC_BIG_ENDIAN);
2403 proto_tree_add_item(flag_tree, hf_icmpv6_rpl_opt_route_reserved, tvb, opt_offset, 1, ENC_BIG_ENDIAN);
2406 /* Prefix lifetime. */
2407 ti_opt = proto_tree_add_item(icmp6opt_tree, hf_icmpv6_rpl_opt_route_lifetime, tvb, opt_offset, 4, ENC_BIG_ENDIAN);
2409 switch(tvb_get_ntohl(tvb, opt_offset)){
2411 proto_item_append_text(ti_opt, " (Infinity)");
2419 case 6: /* Default Option Length without prefix */
2420 proto_item_append_text(ti, " ::/%d", prefix_len);
2423 memset(&prefix, 0, sizeof(prefix));
2424 tvb_memcpy(tvb, (guint8 *)&prefix.bytes, opt_offset, 8);
2425 proto_tree_add_ipv6(icmp6opt_tree, hf_icmpv6_rpl_opt_route_prefix, tvb, opt_offset, 8, prefix.bytes);
2426 SET_ADDRESS(&prefix_addr, AT_IPv6, 16, prefix.bytes);
2427 proto_item_append_text(ti, " %s/%d", address_to_str(wmem_packet_scope(), &prefix_addr), prefix_len);
2431 proto_tree_add_item(icmp6opt_tree, hf_icmpv6_rpl_opt_route_prefix, tvb, opt_offset, 16, ENC_NA);
2432 proto_item_append_text(ti, " %s/%d", tvb_ip6_to_str(tvb, opt_offset), prefix_len);
2436 expert_add_info(pinfo, ti_opt_len, &ei_icmpv6_invalid_option_length);
2441 case RPL_OPT_CONFIG: {
2444 ti_opt = proto_tree_add_item(icmp6opt_tree, hf_icmpv6_rpl_opt_config_flag, tvb, opt_offset, 1, ENC_NA);
2445 flag_tree = proto_item_add_subtree(ti_opt, ett_icmpv6_rpl_flag_config);
2447 proto_tree_add_item(flag_tree, hf_icmpv6_rpl_opt_config_reserved, tvb, opt_offset, 1, ENC_BIG_ENDIAN);
2448 proto_tree_add_item(flag_tree, hf_icmpv6_rpl_opt_config_auth, tvb, opt_offset, 1, ENC_BIG_ENDIAN);
2449 proto_tree_add_item(flag_tree, hf_icmpv6_rpl_opt_config_pcs, tvb, opt_offset, 1, ENC_BIG_ENDIAN);
2452 /* DIOIntervalDoublings */
2453 proto_tree_add_item(icmp6opt_tree, hf_icmpv6_rpl_opt_config_doublings, tvb, opt_offset, 1, ENC_BIG_ENDIAN);
2456 /* DIOIntervalMin */
2457 proto_tree_add_item(icmp6opt_tree, hf_icmpv6_rpl_opt_config_min_interval, tvb, opt_offset, 1, ENC_BIG_ENDIAN);
2460 /* DIORedundancyConstant */
2461 proto_tree_add_item(icmp6opt_tree, hf_icmpv6_rpl_opt_config_redundancy, tvb, opt_offset, 1, ENC_BIG_ENDIAN);
2464 /* MaxRankIncrease */
2465 proto_tree_add_item(icmp6opt_tree, hf_icmpv6_rpl_opt_config_rank_incr, tvb, opt_offset, 2, ENC_BIG_ENDIAN);
2469 proto_tree_add_item(icmp6opt_tree, hf_icmpv6_rpl_opt_config_hop_rank_inc, tvb, opt_offset, 2, ENC_BIG_ENDIAN);
2473 proto_tree_add_item(icmp6opt_tree, hf_icmpv6_rpl_opt_config_ocp, tvb, opt_offset, 2, ENC_BIG_ENDIAN);
2477 proto_tree_add_item(icmp6opt_tree, hf_icmpv6_rpl_opt_config_rsv, tvb, opt_offset, 1, ENC_BIG_ENDIAN);
2480 /* Default Lifetime */
2481 proto_tree_add_item(icmp6opt_tree, hf_icmpv6_rpl_opt_config_def_lifetime, tvb, opt_offset, 1, ENC_BIG_ENDIAN);
2485 proto_tree_add_item(icmp6opt_tree, hf_icmpv6_rpl_opt_config_lifetime_unit, tvb, opt_offset, 2, ENC_BIG_ENDIAN);
2489 case RPL_OPT_TARGET: {
2491 struct e_in6_addr target_prefix;
2492 address target_prefix_addr;
2495 proto_tree_add_item(icmp6opt_tree, hf_icmpv6_rpl_opt_target_flag, tvb, opt_offset, 1, ENC_NA);
2499 prefix_len = tvb_get_guint8(tvb, opt_offset);
2500 proto_tree_add_item(icmp6opt_tree, hf_icmpv6_rpl_opt_target_prefix_length, tvb, opt_offset, 1, ENC_BIG_ENDIAN);
2506 case 2: /* Default Option Length without prefix */
2507 proto_item_append_text(ti, " ::/%d", prefix_len);
2510 memset(&target_prefix, 0, sizeof(target_prefix));
2511 tvb_memcpy(tvb, (guint8 *)&target_prefix.bytes, opt_offset, 8);
2512 proto_tree_add_ipv6(icmp6opt_tree, hf_icmpv6_rpl_opt_target_prefix, tvb, opt_offset, 8, target_prefix.bytes);
2513 SET_ADDRESS(&target_prefix_addr, AT_IPv6, 16, target_prefix.bytes);
2514 proto_item_append_text(ti, " %s/%d", address_to_str(wmem_packet_scope(), &target_prefix_addr), prefix_len);
2518 proto_tree_add_item(icmp6opt_tree, hf_icmpv6_rpl_opt_target_prefix, tvb, opt_offset, 16, ENC_NA);
2519 proto_item_append_text(ti, " %s/%d", tvb_ip6_to_str(tvb, opt_offset), prefix_len);
2523 expert_add_info(pinfo, ti_opt_len, &ei_icmpv6_invalid_option_length);
2528 case RPL_OPT_TRANSIT: {
2530 ti_opt = proto_tree_add_item(icmp6opt_tree, hf_icmpv6_rpl_opt_transit_flag, tvb, opt_offset, 1, ENC_BIG_ENDIAN);
2531 flag_tree = proto_item_add_subtree(ti_opt, ett_icmpv6_rpl_flag_transit);
2533 proto_tree_add_item(flag_tree, hf_icmpv6_rpl_opt_transit_flag_e, tvb, opt_offset, 1, ENC_BIG_ENDIAN);
2534 proto_tree_add_item(flag_tree, hf_icmpv6_rpl_opt_transit_flag_rsv, tvb, opt_offset, 1, ENC_BIG_ENDIAN);
2538 proto_tree_add_item(icmp6opt_tree, hf_icmpv6_rpl_opt_transit_pathctl, tvb, opt_offset, 1, ENC_BIG_ENDIAN);
2542 proto_tree_add_item(icmp6opt_tree, hf_icmpv6_rpl_opt_transit_pathseq, tvb, opt_offset, 1, ENC_BIG_ENDIAN);
2546 proto_tree_add_item(icmp6opt_tree, hf_icmpv6_rpl_opt_transit_pathlifetime, tvb, opt_offset, 1, ENC_BIG_ENDIAN);
2549 /* Option contains parent */
2552 proto_tree_add_item(icmp6opt_tree, hf_icmpv6_rpl_opt_transit_parent, tvb, opt_offset, 16, ENC_NA);
2553 proto_item_append_text(ti, " %s", tvb_ip6_to_str(tvb, opt_offset));
2559 case RPL_OPT_SOLICITED: {
2562 proto_tree_add_item(icmp6opt_tree, hf_icmpv6_rpl_opt_solicited_instance, tvb, opt_offset, 1, ENC_BIG_ENDIAN);
2566 ti_opt = proto_tree_add_item(icmp6opt_tree, hf_icmpv6_rpl_opt_solicited_flag, tvb, opt_offset, 1, ENC_BIG_ENDIAN);
2567 flag_tree = proto_item_add_subtree(ti_opt, ett_icmpv6_rpl_flag_solicited);
2569 proto_tree_add_item(flag_tree, hf_icmpv6_rpl_opt_solicited_flag_v, tvb, opt_offset, 1, ENC_BIG_ENDIAN);
2570 proto_tree_add_item(flag_tree, hf_icmpv6_rpl_opt_solicited_flag_i, tvb, opt_offset, 1, ENC_BIG_ENDIAN);
2571 proto_tree_add_item(flag_tree, hf_icmpv6_rpl_opt_solicited_flag_d, tvb, opt_offset, 1, ENC_BIG_ENDIAN);
2572 proto_tree_add_item(flag_tree, hf_icmpv6_rpl_opt_solicited_flag_rsv, tvb, opt_offset, 1, ENC_BIG_ENDIAN);
2576 proto_tree_add_item(icmp6opt_tree, hf_icmpv6_rpl_opt_solicited_dodagid, tvb, opt_offset, 16, ENC_NA);
2579 /* Version Number */
2580 proto_tree_add_item(icmp6opt_tree, hf_icmpv6_rpl_opt_solicited_version, tvb, opt_offset, 1, ENC_BIG_ENDIAN);
2585 case RPL_OPT_PREFIX: {
2586 /* Destination prefix option. */
2590 prefix_len = tvb_get_guint8(tvb, opt_offset);
2591 proto_tree_add_item(icmp6opt_tree, hf_icmpv6_rpl_opt_prefix_length, tvb, opt_offset, 1, ENC_BIG_ENDIAN);
2595 ti_opt = proto_tree_add_item(icmp6opt_tree, hf_icmpv6_rpl_opt_prefix_flag, tvb, opt_offset, 1, ENC_BIG_ENDIAN);
2596 flag_tree = proto_item_add_subtree(ti_opt, ett_icmpv6_rpl_flag_prefix);
2598 proto_tree_add_item(flag_tree, hf_icmpv6_rpl_opt_prefix_flag_l, tvb, opt_offset, 1, ENC_BIG_ENDIAN);
2599 proto_tree_add_item(flag_tree, hf_icmpv6_rpl_opt_prefix_flag_a, tvb, opt_offset, 1, ENC_BIG_ENDIAN);
2600 proto_tree_add_item(flag_tree, hf_icmpv6_rpl_opt_prefix_flag_r, tvb, opt_offset, 1, ENC_BIG_ENDIAN);
2601 proto_tree_add_item(flag_tree, hf_icmpv6_rpl_opt_prefix_flag_rsv, tvb, opt_offset, 1, ENC_BIG_ENDIAN);
2604 /* Valid lifetime. */
2605 ti_opt = proto_tree_add_item(icmp6opt_tree, hf_icmpv6_rpl_opt_prefix_vlifetime, tvb, opt_offset, 4, ENC_BIG_ENDIAN);
2606 switch(tvb_get_ntohl(tvb, opt_offset)){
2608 proto_item_append_text(ti_opt, " (Infinity)");
2615 /* Preferred Lifetime */
2616 ti_opt = proto_tree_add_item(icmp6opt_tree, hf_icmpv6_rpl_opt_prefix_plifetime, tvb, opt_offset, 4, ENC_BIG_ENDIAN);
2617 switch(tvb_get_ntohl(tvb, opt_offset)){
2619 proto_item_append_text(ti_opt, " (Infinity)");
2626 /* 4 reserved bytes. */
2627 proto_tree_add_item(icmp6opt_tree, hf_icmpv6_rpl_opt_reserved, tvb, opt_offset, 4, ENC_NA);
2631 proto_tree_add_item(icmp6opt_tree, hf_icmpv6_rpl_opt_prefix, tvb, opt_offset, 16, ENC_NA);
2632 proto_item_append_text(ti, " %s/%d", tvb_ip6_to_str(tvb, opt_offset), prefix_len);
2638 case RPL_OPT_TARGETDESC: {
2641 proto_tree_add_item(icmp6opt_tree, hf_icmpv6_rpl_opt_targetdesc, tvb, opt_offset, 4, ENC_BIG_ENDIAN);
2646 case RPL_OPT_ROUTE_DISCOVERY: {
2647 int num_of_addr = 0;
2648 guint8 flags = 0, compr = 0, addr_len = 0, lt_mr_nh = 0;
2649 guint8 addr[16] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };
2652 ti_opt = proto_tree_add_item(icmp6opt_tree, hf_icmpv6_rpl_opt_route_discovery_flag, tvb, opt_offset, 1, ENC_NA);
2653 flag_tree = proto_item_add_subtree(ti_opt, ett_icmpv6_rpl_route_discovery_flag);
2655 flags = tvb_get_guint8(tvb, opt_offset);
2656 compr = flags & RPL_OPT_ROUTE_DISCOVERY_COMPR;
2659 ti_opt_reply = proto_tree_add_item(flag_tree, hf_icmpv6_rpl_opt_route_discovery_reply, tvb, opt_offset, 1, ENC_BIG_ENDIAN);
2662 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);
2664 /* Num of Source Routes */
2665 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);
2668 proto_tree_add_item(flag_tree, hf_icmpv6_rpl_opt_route_discovery_compr, tvb, opt_offset, 1, ENC_BIG_ENDIAN);
2671 /* Lifetime / MaxRank / NH */
2672 lt_mr_nh = tvb_get_guint8(tvb, opt_offset);
2673 ti_opt_lifetime = proto_tree_add_item(icmp6opt_tree, hf_icmpv6_rpl_opt_route_discovery_lifetime, tvb, opt_offset, 1, ENC_NA);
2675 if ((icmp6_code == ICMP6_RPL_P2P_DRO) || (icmp6_code == ICMP6_RPL_P2P_SDRO)) {
2676 proto_tree_add_item(icmp6opt_tree, hf_icmpv6_rpl_opt_route_discovery_nh, tvb, opt_offset, 1, ENC_NA);
2678 ti_opt_mr_nh = proto_tree_add_item(icmp6opt_tree, hf_icmpv6_rpl_opt_route_discovery_maxrank, tvb, opt_offset, 1, ENC_NA);
2683 /* add expert and auxiliary info */
2684 switch (icmp6_code) {
2685 case ICMP6_RPL_P2P_SDRO:
2686 case ICMP6_RPL_P2P_DRO:
2688 if (flags & RPL_OPT_ROUTE_DISCOVERY_R) {
2689 expert_add_info(pinfo, ti_opt_reply, &ei_icmpv6_rpl_p2p_dro_rdo_zero);
2692 if (flags & RPL_OPT_ROUTE_DISCOVERY_N) {
2693 expert_add_info(pinfo, ti_opt_num_of_routes, &ei_icmpv6_rpl_p2p_dro_rdo_zero);
2696 if (lt_mr_nh & RPL_OPT_ROUTE_DISCOVERY_L) {
2697 expert_add_info(pinfo, ti_opt_lifetime, &ei_icmpv6_rpl_p2p_dro_rdo_zero);
2703 if (flags & RPL_OPT_ROUTE_DISCOVERY_H) {
2704 if (!(flags & RPL_OPT_ROUTE_DISCOVERY_R)) {
2705 expert_add_info(pinfo, ti_opt_hop_by_hop, &ei_icmpv6_rpl_p2p_hop_by_hop);
2708 if (flags & RPL_OPT_ROUTE_DISCOVERY_N) {
2709 expert_add_info(pinfo, ti_opt_num_of_routes, &ei_icmpv6_rpl_p2p_num_of_routes);
2713 proto_item_append_text(ti_opt_lifetime, " (%d sec)", (int) pow(4.0, (lt_mr_nh & RPL_OPT_ROUTE_DISCOVERY_L) >> 6));
2715 if (!(lt_mr_nh & RPL_OPT_ROUTE_DISCOVERY_MR_NH)) {
2716 proto_item_append_text(ti_opt_mr_nh, " (Infinity)");
2723 proto_tree_add_item(icmp6opt_tree, hf_icmpv6_rpl_opt_route_discovery_target_addr, tvb, opt_offset, 16, ENC_NA);
2726 addr_len = (16 - compr);
2727 num_of_addr = (opt_len - 18) / addr_len;
2729 /* Address Vector */
2730 ti_opt = proto_tree_add_item(icmp6opt_tree, hf_icmpv6_rpl_opt_route_discovery_addr_vec, tvb, opt_offset, (opt_len - 18), ENC_NA);
2731 flag_tree = proto_item_add_subtree(ti_opt, ett_icmpv6_rpl_route_discovery_addr_vec);
2733 proto_item_append_text(flag_tree, " (%d Address%s)", num_of_addr, num_of_addr != 1 ? "es" : "");
2735 while (num_of_addr--) {
2736 memset(addr, 0, sizeof(addr));
2737 memcpy(addr + compr, tvb_get_ptr(tvb, opt_offset, addr_len), addr_len);
2738 proto_tree_add_ipv6(flag_tree, hf_icmpv6_rpl_opt_route_discovery_addr_vec_addr, tvb, opt_offset, addr_len, addr);
2739 opt_offset += addr_len;
2745 expert_add_info_format(pinfo, ti, &ei_icmpv6_undecoded_rpl_option,
2746 "Dissector for ICMPv6 RPL Option"
2747 " (%d) code not implemented, Contact"
2748 " Wireshark developers if you want this supported", opt_type);
2749 proto_tree_add_item(icmp6opt_tree, hf_icmpv6_data, tvb, opt_offset, opt_len, ENC_NA);
2750 opt_offset += opt_len;
2752 } /* switch (opt_type) */
2754 offset += opt_len + 2;
2756 if(offset > opt_offset){
2757 ti_opt = proto_tree_add_item(icmp6opt_tree, hf_icmpv6_unknown_data, tvb, opt_offset, offset - opt_offset, ENC_NA);
2758 expert_add_info(pinfo, ti_opt, &ei_icmpv6_unknown_data);
2761 /* Close the ) to option root label */
2762 proto_item_append_text(ti, ")");
2768 dissect_rpl_control(tvbuff_t *tvb, int rpl_offset, packet_info *pinfo _U_, proto_tree *icmp6_tree, guint8 icmp6_type _U_, guint8 icmp6_code)
2770 proto_tree *flag_tree;
2773 /* Secure RPL ? (ICMP Code start to 0x8x) */
2774 if(icmp6_code & ICMP6_RPL_SECURE)
2779 ti = proto_tree_add_item(icmp6_tree, hf_icmpv6_rpl_secure_flag, tvb, rpl_offset, 1, ENC_BIG_ENDIAN);
2780 flag_tree = proto_item_add_subtree(ti, ett_icmpv6_flag_secure);
2781 proto_tree_add_item(flag_tree, hf_icmpv6_rpl_secure_flag_t, tvb, rpl_offset, 1, ENC_BIG_ENDIAN);
2782 proto_tree_add_item(flag_tree, hf_icmpv6_rpl_secure_flag_rsv, tvb, rpl_offset, 1, ENC_BIG_ENDIAN);
2786 ti = proto_tree_add_item(icmp6_tree, hf_icmpv6_rpl_secure_algorithm, tvb, rpl_offset, 1, ENC_BIG_ENDIAN);
2787 flag_tree = proto_item_add_subtree(ti, ett_icmpv6_flag_secure);
2788 proto_tree_add_item(flag_tree, hf_icmpv6_rpl_secure_algorithm_encryption, tvb, rpl_offset, 1, ENC_BIG_ENDIAN);
2789 proto_tree_add_item(flag_tree, hf_icmpv6_rpl_secure_algorithm_signature, tvb, rpl_offset, 1, ENC_BIG_ENDIAN);
2793 ti = proto_tree_add_item(icmp6_tree, hf_icmpv6_rpl_secure_flag, tvb, rpl_offset, 1, ENC_BIG_ENDIAN);
2794 flag_tree = proto_item_add_subtree(ti, ett_icmpv6_flag_secure);
2795 proto_tree_add_item(flag_tree, hf_icmpv6_rpl_secure_kim, tvb, rpl_offset, 1, ENC_BIG_ENDIAN);
2796 proto_tree_add_item(flag_tree, hf_icmpv6_rpl_secure_lvl, tvb, rpl_offset, 1, ENC_BIG_ENDIAN);
2797 proto_tree_add_item(flag_tree, hf_icmpv6_rpl_secure_rsv, tvb, rpl_offset, 1, ENC_BIG_ENDIAN);
2798 kim = tvb_get_guint8(tvb, rpl_offset) & RPL_SECURE_KIM >> 6;
2799 lvl = tvb_get_guint8(tvb, rpl_offset) & RPL_SECURE_LVL;
2803 proto_tree_add_item(icmp6_tree, hf_icmpv6_rpl_secure_flag, tvb, rpl_offset, 1, ENC_BIG_ENDIAN);
2807 proto_tree_add_item(icmp6_tree, hf_icmpv6_rpl_secure_counter, tvb, rpl_offset, 4, ENC_BIG_ENDIAN);
2810 /* Key Identifier */
2814 proto_tree_add_item(icmp6_tree, hf_icmpv6_rpl_secure_key_index, tvb, rpl_offset, 1, ENC_BIG_ENDIAN);
2820 /* No Key Identifier */
2825 proto_tree_add_item(icmp6_tree, hf_icmpv6_rpl_secure_key_source, tvb, rpl_offset, 8, ENC_NA);
2827 proto_tree_add_item(icmp6_tree, hf_icmpv6_rpl_secure_key_index, tvb, rpl_offset, 1, ENC_BIG_ENDIAN);
2833 if(lvl == 1 || lvl == 3)
2835 proto_tree_add_item(icmp6_tree, hf_icmpv6_rpl_secure_key_source, tvb, rpl_offset, 8, ENC_NA);
2837 proto_tree_add_item(icmp6_tree, hf_icmpv6_rpl_secure_key_index, tvb, rpl_offset, 1, ENC_BIG_ENDIAN);
2847 case ICMP6_RPL_DIS: /* DODAG Information Solicitation (0) */
2848 case ICMP6_RPL_SDIS: /* Secure DODAG Information Solicitation (128) */
2851 proto_tree_add_item(icmp6_tree, hf_icmpv6_rpl_dis_flag, tvb, rpl_offset, 1, ENC_BIG_ENDIAN);
2855 proto_tree_add_item(icmp6_tree, hf_icmpv6_reserved, tvb, rpl_offset, 1, ENC_NA);
2859 rpl_offset = dissect_icmpv6_rpl_opt(tvb, rpl_offset, pinfo, icmp6_tree, icmp6_code);
2862 case ICMP6_RPL_DIO: /* DODAG Information Object (1) */
2863 case ICMP6_RPL_SDIO: /* Secure DODAG Information Object (129) */
2866 proto_tree_add_item(icmp6_tree, hf_icmpv6_rpl_dio_instance, tvb, rpl_offset, 1, ENC_BIG_ENDIAN);
2869 /* Version Number */
2870 proto_tree_add_item(icmp6_tree, hf_icmpv6_rpl_dio_version, tvb, rpl_offset, 1, ENC_BIG_ENDIAN);
2874 proto_tree_add_item(icmp6_tree, hf_icmpv6_rpl_dio_rank, tvb, rpl_offset, 2, ENC_BIG_ENDIAN);
2878 ti = proto_tree_add_item(icmp6_tree, hf_icmpv6_rpl_dio_flag, tvb, rpl_offset, 1, ENC_BIG_ENDIAN);
2879 flag_tree = proto_item_add_subtree(ti, ett_icmpv6_flag_rpl_dio);
2880 proto_tree_add_item(flag_tree, hf_icmpv6_rpl_dio_flag_g, tvb, rpl_offset, 1, ENC_BIG_ENDIAN);
2881 proto_tree_add_item(flag_tree, hf_icmpv6_rpl_dio_flag_0, tvb, rpl_offset, 1, ENC_BIG_ENDIAN);
2882 proto_tree_add_item(flag_tree, hf_icmpv6_rpl_dio_flag_mop, tvb, rpl_offset, 1, ENC_BIG_ENDIAN);
2883 proto_tree_add_item(flag_tree, hf_icmpv6_rpl_dio_flag_prf, tvb, rpl_offset, 1, ENC_BIG_ENDIAN);
2886 /* Destination Advertisement Trigger Sequence Number (DTSN) */
2887 proto_tree_add_item(icmp6_tree, hf_icmpv6_rpl_dio_dtsn, tvb, rpl_offset, 1, ENC_BIG_ENDIAN);
2891 proto_tree_add_item(icmp6_tree, hf_icmpv6_rpl_dio_flag, tvb, rpl_offset, 1, ENC_BIG_ENDIAN);
2895 proto_tree_add_item(icmp6_tree, hf_icmpv6_reserved, tvb, rpl_offset, 1, ENC_NA);
2899 proto_tree_add_item(icmp6_tree, hf_icmpv6_rpl_dio_dagid, tvb, rpl_offset, 16, ENC_NA);
2903 rpl_offset = dissect_icmpv6_rpl_opt(tvb, rpl_offset, pinfo, icmp6_tree, icmp6_code);
2906 case ICMP6_RPL_DAO: /* Destination Advertisement Object (2) */
2907 case ICMP6_RPL_SDAO: /* Secure Destination Advertisement Object (130) */
2912 proto_tree_add_item(icmp6_tree, hf_icmpv6_rpl_dao_instance, tvb, rpl_offset, 1, ENC_BIG_ENDIAN);
2916 ti = proto_tree_add_item(icmp6_tree, hf_icmpv6_rpl_dao_flag, tvb, rpl_offset, 1, ENC_BIG_ENDIAN);
2917 flag_tree = proto_item_add_subtree(ti, ett_icmpv6_flag_rpl_dao);
2918 proto_tree_add_item(flag_tree, hf_icmpv6_rpl_dao_flag_k, tvb, rpl_offset, 1, ENC_BIG_ENDIAN);
2919 proto_tree_add_item(flag_tree, hf_icmpv6_rpl_dao_flag_d, tvb, rpl_offset, 1, ENC_BIG_ENDIAN);
2920 proto_tree_add_item(flag_tree, hf_icmpv6_rpl_dao_flag_rsv, tvb, rpl_offset, 1, ENC_BIG_ENDIAN);
2921 flags = tvb_get_guint8(tvb, rpl_offset);
2925 proto_tree_add_item(icmp6_tree, hf_icmpv6_reserved, tvb, rpl_offset, 1, ENC_NA);
2929 proto_tree_add_item(icmp6_tree, hf_icmpv6_rpl_dao_sequence, tvb, rpl_offset, 1, ENC_BIG_ENDIAN);
2933 if(flags & RPL_DAO_FLAG_D)
2935 proto_tree_add_item(icmp6_tree, hf_icmpv6_rpl_dao_dodagid, tvb, rpl_offset, 16, ENC_NA);
2939 rpl_offset = dissect_icmpv6_rpl_opt(tvb, rpl_offset, pinfo, icmp6_tree, icmp6_code);
2942 case ICMP6_RPL_DAOACK: /* Destination Advertisement Object Acknowledgment (3) */
2943 case ICMP6_RPL_SDAOACK: /* Secure Destination Advertisement Object Acknowledgment (131) */
2948 proto_tree_add_item(icmp6_tree, hf_icmpv6_rpl_daoack_instance, tvb, rpl_offset, 1, ENC_BIG_ENDIAN);
2952 ti = proto_tree_add_item(icmp6_tree, hf_icmpv6_rpl_daoack_flag, tvb, rpl_offset, 1, ENC_BIG_ENDIAN);
2953 flag_tree = proto_item_add_subtree(ti, ett_icmpv6_flag_rpl_daoack);
2954 proto_tree_add_item(flag_tree, hf_icmpv6_rpl_daoack_flag_d, tvb, rpl_offset, 1, ENC_BIG_ENDIAN);
2955 proto_tree_add_item(flag_tree, hf_icmpv6_rpl_daoack_flag_rsv, tvb, rpl_offset, 1, ENC_BIG_ENDIAN);
2956 flags = tvb_get_guint8(tvb, rpl_offset);
2960 proto_tree_add_item(icmp6_tree, hf_icmpv6_rpl_daoack_sequence, tvb, rpl_offset, 1, ENC_BIG_ENDIAN);
2964 proto_tree_add_item(icmp6_tree, hf_icmpv6_rpl_daoack_status, tvb, rpl_offset, 1, ENC_BIG_ENDIAN);
2968 if(flags & RPL_DAOACK_FLAG_D)
2970 proto_tree_add_item(icmp6_tree, hf_icmpv6_rpl_daoack_dodagid, tvb, rpl_offset, 16, ENC_NA);
2975 rpl_offset = dissect_icmpv6_rpl_opt(tvb, rpl_offset, pinfo, icmp6_tree, icmp6_code);
2981 proto_tree_add_item(icmp6_tree, hf_icmpv6_rpl_cc_instance, tvb, rpl_offset, 1, ENC_BIG_ENDIAN);
2985 ti = proto_tree_add_item(icmp6_tree, hf_icmpv6_rpl_cc_flag, tvb, rpl_offset, 1, ENC_BIG_ENDIAN);
2986 flag_tree = proto_item_add_subtree(ti, ett_icmpv6_flag_rpl_cc);
2987 proto_tree_add_item(flag_tree, hf_icmpv6_rpl_cc_flag_r, tvb, rpl_offset, 1, ENC_BIG_ENDIAN);
2988 proto_tree_add_item(flag_tree, hf_icmpv6_rpl_cc_flag_rsv, tvb, rpl_offset, 1, ENC_BIG_ENDIAN);
2992 proto_tree_add_item(icmp6_tree, hf_icmpv6_rpl_cc_nonce, tvb, rpl_offset, 2, ENC_BIG_ENDIAN);
2996 proto_tree_add_item(icmp6_tree, hf_icmpv6_rpl_cc_dodagid, tvb, rpl_offset, 16, ENC_NA);
2999 /* Destination Counter */
3000 proto_tree_add_item(icmp6_tree, hf_icmpv6_rpl_cc_destination_counter, tvb, rpl_offset, 4, ENC_BIG_ENDIAN);
3004 rpl_offset = dissect_icmpv6_rpl_opt(tvb, rpl_offset, pinfo, icmp6_tree, icmp6_code);
3007 case ICMP6_RPL_P2P_DRO: /* P2P Discovery Reply Object (0x4) */
3008 case ICMP6_RPL_P2P_SDRO: /* Secure P2P Discovery Reply Object (0x84) */
3011 proto_tree_add_item(icmp6_tree, hf_icmpv6_rpl_p2p_dro_instance, tvb, rpl_offset, 1, ENC_BIG_ENDIAN);
3014 /* Version Number */
3015 ti = proto_tree_add_item(icmp6_tree, hf_icmpv6_rpl_p2p_dro_version, tvb, rpl_offset, 1, ENC_BIG_ENDIAN);
3016 if (tvb_get_guint8(tvb, rpl_offset)) {
3017 expert_add_info(pinfo, ti, &ei_icmpv6_rpl_p2p_dro_zero);
3022 ti = proto_tree_add_item(icmp6_tree, hf_icmpv6_rpl_p2p_dro_flag, tvb, rpl_offset, 2, ENC_NA);
3023 flag_tree = proto_item_add_subtree(ti, ett_icmpv6_rpl_p2p_dro_flag);
3026 proto_tree_add_item(flag_tree, hf_icmpv6_rpl_p2p_dro_flag_stop, tvb, rpl_offset, 2, ENC_BIG_ENDIAN);
3028 proto_tree_add_item(flag_tree, hf_icmpv6_rpl_p2p_dro_flag_ack, tvb, rpl_offset, 2, ENC_BIG_ENDIAN);
3030 proto_tree_add_item(flag_tree, hf_icmpv6_rpl_p2p_dro_flag_seq, tvb, rpl_offset, 2, ENC_BIG_ENDIAN);
3032 proto_tree_add_item(flag_tree, hf_icmpv6_rpl_p2p_dro_flag_reserved, tvb, rpl_offset, 2, ENC_BIG_ENDIAN);
3036 proto_tree_add_item(icmp6_tree, hf_icmpv6_rpl_p2p_dro_dagid, tvb, rpl_offset, 16, ENC_NA);
3040 rpl_offset = dissect_icmpv6_rpl_opt(tvb, rpl_offset, pinfo, icmp6_tree, icmp6_code);
3043 case ICMP6_RPL_P2P_DROACK: /* P2P Discovery Reply Object Acknowledgement (0x5) */
3044 case ICMP6_RPL_P2P_SDROACK: /* Secure P2P Discovery Reply Object Acknowledgement (0x85) */
3047 proto_tree_add_item(icmp6_tree, hf_icmpv6_rpl_p2p_dro_instance, tvb, rpl_offset, 1, ENC_BIG_ENDIAN);
3050 /* Version Number */
3051 ti = proto_tree_add_item(icmp6_tree, hf_icmpv6_rpl_p2p_dro_version, tvb, rpl_offset, 1, ENC_BIG_ENDIAN);
3052 if (tvb_get_guint8(tvb, rpl_offset)) {
3053 expert_add_info(pinfo, ti, &ei_icmpv6_rpl_p2p_dro_zero);
3058 ti = proto_tree_add_item(icmp6_tree, hf_icmpv6_rpl_p2p_droack_flag, tvb, rpl_offset, 2, ENC_NA);
3059 flag_tree = proto_item_add_subtree(ti, ett_icmpv6_rpl_p2p_droack_flag);
3062 proto_tree_add_item(flag_tree, hf_icmpv6_rpl_p2p_droack_flag_seq, tvb, rpl_offset, 2, ENC_BIG_ENDIAN);
3064 proto_tree_add_item(flag_tree, hf_icmpv6_rpl_p2p_dro_flag_reserved, tvb, rpl_offset, 2, ENC_BIG_ENDIAN);
3068 proto_tree_add_item(icmp6_tree, hf_icmpv6_rpl_p2p_dro_dagid, tvb, rpl_offset, 16, ENC_NA);
3076 /* RFC 4620 - IPv6 Node Information Queries */
3079 dissect_nodeinfo(tvbuff_t *tvb, int ni_offset, packet_info *pinfo _U_, proto_tree *tree, guint8 icmp6_type, guint8 icmp6_code)
3081 proto_tree *flag_tree;
3086 proto_tree_add_item(tree, hf_icmpv6_ni_qtype, tvb, ni_offset, 2, ENC_BIG_ENDIAN);
3087 qtype = tvb_get_ntohs(tvb, ni_offset);
3091 ti = proto_tree_add_item(tree, hf_icmpv6_ni_flag, tvb, ni_offset, 2, ENC_BIG_ENDIAN);
3092 flag_tree = proto_item_add_subtree(ti, ett_icmpv6_flag_ni);
3093 proto_tree_add_item(flag_tree, hf_icmpv6_ni_flag_g, tvb, ni_offset, 2, ENC_BIG_ENDIAN);
3094 proto_tree_add_item(flag_tree, hf_icmpv6_ni_flag_s, tvb, ni_offset, 2, ENC_BIG_ENDIAN);
3095 proto_tree_add_item(flag_tree, hf_icmpv6_ni_flag_l, tvb, ni_offset, 2, ENC_BIG_ENDIAN);
3096 proto_tree_add_item(flag_tree, hf_icmpv6_ni_flag_c, tvb, ni_offset, 2, ENC_BIG_ENDIAN);
3097 proto_tree_add_item(flag_tree, hf_icmpv6_ni_flag_a, tvb, ni_offset, 2, ENC_BIG_ENDIAN);
3098 proto_tree_add_item(flag_tree, hf_icmpv6_ni_flag_t, tvb, ni_offset, 2, ENC_BIG_ENDIAN);
3099 proto_tree_add_item(flag_tree, hf_icmpv6_ni_flag_rsv, tvb, ni_offset, 2, ENC_BIG_ENDIAN);
3103 proto_tree_add_item(tree, hf_icmpv6_ni_nonce, tvb, ni_offset, 8, ENC_BIG_ENDIAN);
3107 if(tvb_reported_length_remaining(tvb, ni_offset) == 0){
3111 if(icmp6_type == ICMP6_NI_QUERY){
3113 case ICMP6_NI_SUBJ_IPV6: {
3114 proto_tree_add_item(tree, hf_icmpv6_ni_query_subject_ipv6, tvb, ni_offset, 16, ENC_NA);
3118 case ICMP6_NI_SUBJ_FQDN: {
3120 const guchar *fqdn_name;
3121 fqdn_len = get_dns_name(tvb, ni_offset, 0, ni_offset, &fqdn_name);
3122 proto_tree_add_string(tree, hf_icmpv6_ni_query_subject_fqdn, tvb, ni_offset, fqdn_len, fqdn_name);
3123 ni_offset += fqdn_len;
3126 case ICMP6_NI_SUBJ_IPV4: {
3127 proto_tree_add_item(tree, hf_icmpv6_ni_query_subject_ipv4, tvb, ni_offset, 4, ENC_BIG_ENDIAN);
3132 } else { /* It is ICMP6_NI_REPLY */
3136 case NI_QTYPE_NODENAME: {
3138 const guchar *node_name;
3140 proto_tree_add_item(tree, hf_icmpv6_ni_reply_node_ttl, tvb, ni_offset, 4, ENC_BIG_ENDIAN);
3143 if(tvb_reported_length_remaining(tvb, ni_offset) == 0){
3146 while(ni_offset < (int)tvb_reported_length(tvb) ) {
3148 if(tvb_get_guint8(tvb, ni_offset) == 0){ /* if Zero there is padding, skip the loop */
3152 node_len = get_dns_name(tvb, ni_offset, 0, ni_offset, &node_name);
3153 proto_tree_add_string(tree, hf_icmpv6_ni_reply_node_name, tvb, ni_offset, node_len, node_name);
3154 ni_offset += node_len;
3158 case NI_QTYPE_NODEADDR: {
3159 while(ni_offset < (int)tvb_reported_length(tvb) ) {
3161 proto_tree_add_item(tree, hf_icmpv6_ni_reply_node_ttl, tvb, ni_offset, 4, ENC_BIG_ENDIAN);
3163 /* Node Addresses */
3164 proto_tree_add_item(tree, hf_icmpv6_ni_reply_node_address, tvb, ni_offset, 16, ENC_NA);
3169 case NI_QTYPE_IPV4ADDR: {
3170 while(ni_offset < (int)tvb_reported_length(tvb) ) {
3172 proto_tree_add_item(tree, hf_icmpv6_ni_reply_node_ttl, tvb, ni_offset, 4, ENC_BIG_ENDIAN);
3175 proto_tree_add_item(tree, hf_icmpv6_ni_reply_ipv4_address, tvb, ni_offset, 4, ENC_BIG_ENDIAN);
3184 /* RFC 2894 - Router Renumbering for IPv6 */
3187 dissect_rrenum(tvbuff_t *tvb, int rr_offset, packet_info *pinfo _U_, proto_tree *tree, guint8 icmp6_type _U_, guint8 icmp6_code)
3189 proto_tree *flag_tree, *mp_tree, *up_tree, *rm_tree;
3190 proto_item *ti, *ti_mp, *ti_up, *ti_rm;
3192 /* Sequence Number */
3193 proto_tree_add_item(tree, hf_icmpv6_rr_sequencenumber, tvb, rr_offset, 4, ENC_BIG_ENDIAN);
3196 /* Segment Number */
3197 proto_tree_add_item(tree, hf_icmpv6_rr_segmentnumber, tvb, rr_offset, 1, ENC_BIG_ENDIAN);
3201 ti = proto_tree_add_item(tree, hf_icmpv6_rr_flag, tvb, rr_offset, 1, ENC_BIG_ENDIAN);
3202 flag_tree = proto_item_add_subtree(ti, ett_icmpv6_flag_rr);
3203 proto_tree_add_item(flag_tree, hf_icmpv6_rr_flag_t, tvb, rr_offset, 1, ENC_BIG_ENDIAN);
3204 proto_tree_add_item(flag_tree, hf_icmpv6_rr_flag_r, tvb, rr_offset, 1, ENC_BIG_ENDIAN);
3205 proto_tree_add_item(flag_tree, hf_icmpv6_rr_flag_a, tvb, rr_offset, 1, ENC_BIG_ENDIAN);
3206 proto_tree_add_item(flag_tree, hf_icmpv6_rr_flag_s, tvb, rr_offset, 1, ENC_BIG_ENDIAN);
3207 proto_tree_add_item(flag_tree, hf_icmpv6_rr_flag_p, tvb, rr_offset, 1, ENC_BIG_ENDIAN);
3208 proto_tree_add_item(flag_tree, hf_icmpv6_rr_flag_rsv, tvb, rr_offset, 1, ENC_BIG_ENDIAN);
3212 proto_tree_add_item(tree, hf_icmpv6_rr_maxdelay, tvb, rr_offset, 2, ENC_BIG_ENDIAN);
3216 proto_tree_add_item(tree, hf_icmpv6_reserved, tvb, rr_offset, 4, ENC_NA);
3220 if(tvb_reported_length_remaining(tvb, rr_offset) == 0){
3224 if(icmp6_code == ICMP6_ROUTER_RENUMBERING_COMMAND){
3225 /* Match-Prefix Part */
3226 guint8 opcode, matchlen, minlen, maxlen;
3228 ti_mp = proto_tree_add_item(tree, hf_icmpv6_rr_pco_mp_part, tvb, rr_offset, 24, ENC_NA);
3229 mp_tree = proto_item_add_subtree(ti_mp, ett_icmpv6_rr_mp);
3232 proto_tree_add_item(mp_tree, hf_icmpv6_rr_pco_mp_opcode, tvb, rr_offset, 1, ENC_BIG_ENDIAN);
3233 opcode = tvb_get_guint8(tvb, rr_offset);
3237 proto_tree_add_item(mp_tree, hf_icmpv6_rr_pco_mp_oplength, tvb, rr_offset, 1, ENC_BIG_ENDIAN);
3241 proto_tree_add_item(mp_tree, hf_icmpv6_rr_pco_mp_ordinal, tvb, rr_offset, 1, ENC_BIG_ENDIAN);
3245 proto_tree_add_item(mp_tree, hf_icmpv6_rr_pco_mp_matchlen, tvb, rr_offset, 1, ENC_BIG_ENDIAN);
3246 matchlen = tvb_get_guint8(tvb, rr_offset);
3247 if (matchlen > 128) {
3248 expert_add_info(pinfo, ti, &ei_icmpv6_rr_pco_mp_matchlen);
3253 proto_tree_add_item(mp_tree, hf_icmpv6_rr_pco_mp_minlen, tvb, rr_offset, 1, ENC_BIG_ENDIAN);
3254 minlen = tvb_get_guint8(tvb, rr_offset);
3258 proto_tree_add_item(mp_tree, hf_icmpv6_rr_pco_mp_maxlen, tvb, rr_offset, 1, ENC_BIG_ENDIAN);
3259 maxlen = tvb_get_guint8(tvb, rr_offset);
3263 proto_tree_add_item(mp_tree, hf_icmpv6_reserved, tvb, rr_offset, 2, ENC_NA);
3267 proto_tree_add_item(mp_tree, hf_icmpv6_rr_pco_mp_matchprefix, tvb, rr_offset, 16, ENC_NA);
3269 /* Add Info (Prefix, Length...) to Match Prefix Part label */
3270 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(tvb, rr_offset), matchlen, minlen, maxlen);
3273 while ((int)tvb_reported_length(tvb) > rr_offset) {
3274 /* Use-Prefix Part */
3275 guint8 uselen, keeplen;
3277 ti_up = proto_tree_add_item(tree, hf_icmpv6_rr_pco_up_part, tvb, rr_offset, 32, ENC_NA);
3278 up_tree = proto_item_add_subtree(ti_up, ett_icmpv6_rr_up);
3281 proto_tree_add_item(up_tree, hf_icmpv6_rr_pco_up_uselen, tvb, rr_offset, 1, ENC_BIG_ENDIAN);
3282 uselen = tvb_get_guint8(tvb, rr_offset);
3286 proto_tree_add_item(up_tree, hf_icmpv6_rr_pco_up_keeplen, tvb, rr_offset, 1, ENC_BIG_ENDIAN);
3287 keeplen = tvb_get_guint8(tvb, rr_offset);
3291 ti = proto_tree_add_item(up_tree, hf_icmpv6_rr_pco_up_flagmask, tvb, rr_offset, 1, ENC_BIG_ENDIAN);
3292 flag_tree = proto_item_add_subtree(ti, ett_icmpv6_rr_up_flag_mask);
3293 proto_tree_add_item(flag_tree, hf_icmpv6_rr_pco_up_flagmask_l, tvb, rr_offset, 1, ENC_BIG_ENDIAN);
3294 proto_tree_add_item(flag_tree, hf_icmpv6_rr_pco_up_flagmask_a, tvb, rr_offset, 1, ENC_BIG_ENDIAN);
3295 proto_tree_add_item(flag_tree, hf_icmpv6_rr_pco_up_flagmask_reserved, tvb, rr_offset, 1, ENC_BIG_ENDIAN);
3299 ti = proto_tree_add_item(up_tree, hf_icmpv6_rr_pco_up_raflags, tvb, rr_offset, 1, ENC_BIG_ENDIAN);
3300 flag_tree = proto_item_add_subtree(ti, ett_icmpv6_rr_up_flag_ra);
3301 proto_tree_add_item(flag_tree, hf_icmpv6_rr_pco_up_raflags_l, tvb, rr_offset, 1, ENC_BIG_ENDIAN);
3302 proto_tree_add_item(flag_tree, hf_icmpv6_rr_pco_up_raflags_a, tvb, rr_offset, 1, ENC_BIG_ENDIAN);
3303 proto_tree_add_item(flag_tree, hf_icmpv6_rr_pco_up_raflags_reserved, tvb, rr_offset, 1, ENC_BIG_ENDIAN);
3306 /* Valid Lifetime */
3307 ti = proto_tree_add_item(up_tree, hf_icmpv6_rr_pco_up_validlifetime, tvb, rr_offset, 4, ENC_BIG_ENDIAN);
3308 switch(tvb_get_ntohl(tvb, rr_offset)){
3310 proto_item_append_text(ti, " (Infinity)");
3317 /* Preferred Lifetime */
3318 ti = proto_tree_add_item(up_tree, hf_icmpv6_rr_pco_up_preferredlifetime, tvb, rr_offset, 4, ENC_BIG_ENDIAN);
3319 switch(tvb_get_ntohl(tvb, rr_offset)){
3321 proto_item_append_text(ti, " (Infinity)");
3329 ti = proto_tree_add_item(up_tree, hf_icmpv6_rr_pco_up_flag, tvb, rr_offset, 4, ENC_BIG_ENDIAN);
3330 flag_tree = proto_item_add_subtree(ti, ett_icmpv6_rr_up_flag);
3331 proto_tree_add_item(flag_tree, hf_icmpv6_rr_pco_up_flag_v, tvb, rr_offset, 4, ENC_BIG_ENDIAN);
3332 proto_tree_add_item(flag_tree, hf_icmpv6_rr_pco_up_flag_p, tvb, rr_offset, 4, ENC_BIG_ENDIAN);
3333 proto_tree_add_item(flag_tree, hf_icmpv6_rr_pco_up_flag_reserved, tvb, rr_offset, 4, ENC_BIG_ENDIAN);
3337 proto_tree_add_item(up_tree, hf_icmpv6_rr_pco_up_useprefix, tvb, rr_offset, 16, ENC_NA);
3340 /* Add Info (Prefix, Length...) to Use Prefix Part label */
3341 proto_item_append_text(ti_up, ": %s/%u (keep %u)", tvb_ip6_to_str(tvb, rr_offset), uselen, keeplen);
3344 }else if(icmp6_code == ICMP6_ROUTER_RENUMBERING_RESULT){
3345 while ((int)tvb_reported_length(tvb) > rr_offset) {
3347 guint32 interfaceindex;
3348 /* Result Message */
3350 ti_rm = proto_tree_add_item(tree, hf_icmpv6_rr_rm, tvb, rr_offset, 24, ENC_NA);
3351 rm_tree = proto_item_add_subtree(ti_rm, ett_icmpv6_rr_rm);
3354 ti = proto_tree_add_item(rm_tree, hf_icmpv6_rr_rm_flag, tvb, rr_offset, 2, ENC_BIG_ENDIAN);
3355 flag_tree = proto_item_add_subtree(ti, ett_icmpv6_rr_rm_flag);
3356 proto_tree_add_item(flag_tree, hf_icmpv6_rr_rm_flag_reserved, tvb, rr_offset, 2, ENC_BIG_ENDIAN);
3357 proto_tree_add_item(flag_tree, hf_icmpv6_rr_rm_flag_b, tvb, rr_offset, 2, ENC_BIG_ENDIAN);
3358 proto_tree_add_item(flag_tree, hf_icmpv6_rr_rm_flag_f, tvb, rr_offset, 2, ENC_BIG_ENDIAN);
3362 proto_tree_add_item(rm_tree, hf_icmpv6_rr_rm_ordinal, tvb, rr_offset, 1, ENC_BIG_ENDIAN);
3366 ti = proto_tree_add_item(rm_tree, hf_icmpv6_rr_rm_matchedlen, tvb, rr_offset, 1, ENC_BIG_ENDIAN);
3367 matchlen = tvb_get_guint8(tvb, rr_offset);
3368 if (matchlen > 128) {
3369 expert_add_info(pinfo, ti, &ei_icmpv6_rr_pco_mp_matchedlen);
3373 /* InterfaceIndex */
3374 proto_tree_add_item(rm_tree, hf_icmpv6_rr_rm_interfaceindex, tvb, rr_offset, 4, ENC_BIG_ENDIAN);
3375 interfaceindex = tvb_get_ntohl(tvb, rr_offset);
3379 proto_tree_add_item(rm_tree, hf_icmpv6_rr_rm_matchedprefix, tvb, rr_offset, 16, ENC_NA);
3381 /* Add Info (Prefix, Length...) to Use Resultant Message label */
3382 proto_item_append_text(ti_rm, ": %s/%u (interface %u)", tvb_ip6_to_str(tvb, rr_offset), matchlen, interfaceindex);
3391 dissect_mldrv2( tvbuff_t *tvb, guint32 offset, packet_info *pinfo _U_, proto_tree *tree )
3393 proto_tree *mar_tree;
3395 int mldr_offset = offset;
3398 proto_tree_add_item(tree, hf_icmpv6_reserved, tvb, mldr_offset, 2, ENC_NA );
3401 /* Nr of Mcast Address Records (M) */
3402 proto_tree_add_item(tree, hf_icmpv6_mldr_nb_mcast_records, tvb, mldr_offset, 2, ENC_BIG_ENDIAN );
3405 /* Multicast Address Record */
3406 while(mldr_offset < (int)tvb_reported_length(tvb) ) {
3407 guint8 aux_data_len, record_type;
3408 guint16 i, nb_sources;
3410 ti_mar = proto_tree_add_item(tree, hf_icmpv6_mldr_mar, tvb, mldr_offset, -1, ENC_NA);
3411 mar_tree = proto_item_add_subtree(ti_mar, ett_icmpv6_mar);
3414 proto_tree_add_item(mar_tree, hf_icmpv6_mldr_mar_record_type, tvb, mldr_offset, 1, ENC_BIG_ENDIAN);
3415 record_type = tvb_get_guint8(tvb, mldr_offset);
3419 proto_tree_add_item(mar_tree, hf_icmpv6_mldr_mar_aux_data_len, tvb, mldr_offset, 1, ENC_BIG_ENDIAN);
3420 aux_data_len = tvb_get_guint8(tvb, mldr_offset);
3423 /* Number of Sources (N) */
3424 proto_tree_add_item(mar_tree, hf_icmpv6_mldr_mar_nb_sources, tvb, mldr_offset, 2, ENC_BIG_ENDIAN);
3425 nb_sources = tvb_get_ntohs(tvb, mldr_offset);
3428 /* Multicast Address */
3429 proto_tree_add_item(mar_tree, hf_icmpv6_mldr_mar_multicast_address, tvb, mldr_offset, 16, ENC_NA);
3430 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(tvb, mldr_offset));
3433 /* Source Address */
3434 for (i=0; i < nb_sources; i++){
3435 proto_tree_add_item(mar_tree, hf_icmpv6_mldr_mar_source_address, tvb, mldr_offset, 16, ENC_NA);
3439 /* Auxiliary Data ? */
3442 proto_tree_add_item(mar_tree, hf_icmpv6_mldr_mar_auxiliary_data, tvb, mldr_offset, aux_data_len * 4, ENC_NA);
3443 mldr_offset += aux_data_len * 4;
3446 /* Multicast Address Record Length */
3447 proto_item_set_len(ti_mar, 4 + 16 + (16 * nb_sources) + (aux_data_len * 4));
3455 dissect_icmpv6(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data)
3457 proto_tree *icmp6_tree = NULL, *flag_tree = NULL;
3458 proto_item *ti = NULL, *hidden_item, *checksum_item = NULL, *code_item = NULL, *ti_flag = NULL;
3459 const char *code_name = NULL;
3460 guint length = 0, reported_length;
3463 guint16 cksum, computed_cksum;
3466 guint8 icmp6_type, icmp6_code;
3467 icmp_transaction_t *trans = NULL;
3468 ws_ip *iph = (ws_ip*)data;
3470 col_set_str(pinfo->cinfo, COL_PROTOCOL, "ICMPv6");
3471 col_clear(pinfo->cinfo, COL_INFO);
3476 ti = proto_tree_add_item(tree, proto_icmpv6, tvb, offset, -1, ENC_NA);
3477 icmp6_tree = proto_item_add_subtree(ti, ett_icmpv6);
3480 proto_tree_add_item(icmp6_tree, hf_icmpv6_type, tvb, offset, 1, ENC_BIG_ENDIAN);
3482 icmp6_type = tvb_get_guint8(tvb, offset);
3485 col_add_str(pinfo->cinfo, COL_INFO, val_to_str(icmp6_type, icmpv6_type_val, "Unknown (%d)"));
3488 code_item = proto_tree_add_item(icmp6_tree, hf_icmpv6_code, tvb, offset, 1, ENC_BIG_ENDIAN);
3490 icmp6_code = tvb_get_guint8(tvb, offset);
3493 switch (icmp6_type) {
3494 case ICMP6_DST_UNREACH:
3495 code_name = val_to_str_const(icmp6_code, icmpv6_unreach_code_val, "Unknown");
3497 case ICMP6_TIME_EXCEEDED:
3498 code_name = val_to_str(icmp6_code, icmpv6_timeex_code_val, "Unknown (%d)");
3500 case ICMP6_PARAM_PROB:
3501 code_name = val_to_str(icmp6_code, icmpv6_paramprob_code_val, "Unknown (%d)");
3503 case ICMP6_ROUTER_RENUMBERING:
3504 code_name = val_to_str(icmp6_code, icmpv6_rr_code_val, "Unknown (%d)");
3506 case ICMP6_NI_QUERY:
3507 code_name = val_to_str(icmp6_code, ni_query_code_val, "Unknown (%d)");
3509 case ICMP6_NI_REPLY:
3510 code_name = val_to_str(icmp6_code, ni_reply_code_val, "Unknown (%d)");
3512 case ICMP6_RPL_CONTROL:
3513 code_name = val_to_str(icmp6_code, rpl_code_val, "Unknown (%d)");
3518 col_append_fstr(pinfo->cinfo, COL_INFO, " (%s)", code_name);
3521 * 2.7. Teredo UDP Port
3522 * 5.2.9. Direct IPv6 Connectivity Test */
3523 if (pinfo->destport == 3544 && icmp6_type == ICMP6_ECHO_REQUEST) {
3524 col_set_str(pinfo->cinfo, COL_PROTOCOL, "Teredo");
3525 col_set_str(pinfo->cinfo, COL_INFO, "Direct IPv6 Connectivity Test");
3530 proto_item_append_text(code_item, " (%s)", code_name);
3531 checksum_item = proto_tree_add_item(icmp6_tree, hf_icmpv6_checksum, tvb, offset, 2, ENC_BIG_ENDIAN);
3534 cksum = tvb_get_ntohs(tvb, offset);
3536 if (1) { /* There's an expert info in here so always execute */
3537 length = tvb_captured_length(tvb);
3538 reported_length = tvb_reported_length(tvb);
3539 if (!pinfo->fragmented && length >= reported_length && !pinfo->flags.in_error_pkt) {
3540 /* The packet isn't part of a fragmented datagram, isn't truncated,
3541 * and we aren't in an ICMP error packet, so we can checksum it.
3544 /* Set up the fields of the pseudo-header. */
3545 SET_CKSUM_VEC_PTR(cksum_vec[0], (const guint8 *)pinfo->src.data, pinfo->src.len);
3546 SET_CKSUM_VEC_PTR(cksum_vec[1], (const guint8 *)pinfo->dst.data, pinfo->dst.len);
3547 phdr[0] = g_htonl(reported_length);
3548 phdr[1] = g_htonl(IP_PROTO_ICMPV6);
3549 SET_CKSUM_VEC_PTR(cksum_vec[2], (const guint8 *)&phdr, 8);
3550 SET_CKSUM_VEC_TVB(cksum_vec[3], tvb, 0, reported_length);
3551 computed_cksum = in_cksum(cksum_vec, 4);
3553 if (computed_cksum == 0) {
3554 hidden_item = proto_tree_add_boolean(icmp6_tree, hf_icmpv6_checksum_bad, tvb, offset, 2, FALSE);
3555 PROTO_ITEM_SET_HIDDEN(hidden_item);
3556 proto_item_append_text(checksum_item, " [correct]");
3558 hidden_item = proto_tree_add_boolean(icmp6_tree, hf_icmpv6_checksum_bad, tvb, offset, 2, TRUE);
3559 PROTO_ITEM_SET_HIDDEN(hidden_item);
3560 proto_item_append_text(checksum_item, " [incorrect, should be 0x%04x]", in_cksum_shouldbe(cksum, computed_cksum));
3561 expert_add_info_format(pinfo, checksum_item, &ei_icmpv6_checksum,
3562 "ICMPv6 Checksum Incorrect, should be 0x%04x", in_cksum_shouldbe(cksum, computed_cksum));
3565 proto_item_append_text(checksum_item, " [%s]",
3566 pinfo->flags.in_error_pkt ? "in ICMP error packet" : "fragmented datagram");
3571 if (icmp6_type == ICMP6_ECHO_REQUEST || icmp6_type == ICMP6_ECHO_REPLY) {
3572 guint16 identifier, sequence;
3576 proto_tree_add_item(icmp6_tree, hf_icmpv6_echo_identifier, tvb, offset, 2, ENC_BIG_ENDIAN);
3577 identifier = tvb_get_ntohs(tvb, offset);
3580 /* Sequence Number */
3582 proto_tree_add_item(icmp6_tree, hf_icmpv6_echo_sequence_number, tvb, offset, 2, ENC_BIG_ENDIAN);
3583 sequence = tvb_get_ntohs(tvb, offset);
3586 col_append_fstr(pinfo->cinfo, COL_INFO, " id=0x%04x, seq=%u, hop limit=%u",
3587 identifier, sequence, (iph != NULL) ? iph->ip_ttl : 0);
3589 if (pinfo->destport == 3544 && icmp6_type == ICMP6_ECHO_REQUEST) {
3591 * 2.7. Teredo UDP Port
3592 * 5.2.9. Direct IPv6 Connectivity Test
3594 * TODO: Clarify the nonce: The RFC states, "(It is recommended to
3595 * use a random number [the nonce] at least 64 bits long.)"
3597 * Shouldn't the nonce be at least 8 then? Why not just use (-1),
3598 * as it could really be any length, couldn't it?
3601 proto_tree_add_item(icmp6_tree, hf_icmpv6_nonce, tvb, offset, 4, ENC_NA);
3604 if (!pinfo->flags.in_error_pkt) {
3605 guint32 conv_key[2];
3607 conv_key[1] = (guint32)((identifier << 16) | sequence);
3609 if (icmp6_type == ICMP6_ECHO_REQUEST) {
3610 conv_key[0] = (guint32)cksum;
3611 if (pinfo->flags.in_gre_pkt)
3612 conv_key[0] |= 0x00010000; /* set a bit for "in GRE" */
3613 trans = transaction_start(pinfo, icmp6_tree, conv_key);
3614 } else { /* ICMP6_ECHO_REPLY */
3618 tmp[1] = ~0x0100; /* The difference between echo request & reply */
3619 SET_CKSUM_VEC_PTR(cksum_vec[0], (guint8 *)tmp, sizeof(tmp));
3620 conv_key[0] = in_cksum(cksum_vec, 1);
3621 if (conv_key[0] == 0)
3622 conv_key[0] = 0xffff;
3623 if (pinfo->flags.in_gre_pkt)
3624 conv_key[0] |= 0x00010000; /* set a bit for "in GRE" */
3625 trans = transaction_end(pinfo, icmp6_tree, conv_key);
3628 next_tvb = tvb_new_subset_remaining(tvb, offset);
3629 offset += call_dissector(data_handle, next_tvb, pinfo, icmp6_tree);
3633 if (1) { /* There are expert infos buried in here so always execute */
3635 /* FIXME: The following messages MUST have a TTL^WHop-Limit of 255:
3636 133-137, 141-142, 148-149. Detect this and add expert items. */
3637 switch (icmp6_type) {
3638 case ICMP6_DST_UNREACH: /* Destination Unreachable (1) */
3639 case ICMP6_TIME_EXCEEDED: /* Time Exceeded (3) */
3641 proto_tree_add_item(icmp6_tree, hf_icmpv6_reserved, tvb, offset, 4, ENC_NA);
3644 offset = dissect_contained_icmpv6(tvb, offset, pinfo, icmp6_tree);
3646 case ICMP6_PACKET_TOO_BIG: /* Packet Too Big (2) */
3648 proto_tree_add_item(icmp6_tree, hf_icmpv6_mtu, tvb, offset, 4, ENC_BIG_ENDIAN);
3651 offset = dissect_contained_icmpv6(tvb, offset, pinfo, icmp6_tree);
3653 case ICMP6_PARAM_PROB: /* Parameter Problem (4) */
3655 proto_tree_add_item(icmp6_tree, hf_icmpv6_pointer, tvb, offset, 4, ENC_BIG_ENDIAN);
3658 offset = dissect_contained_icmpv6(tvb, offset, pinfo, icmp6_tree);
3660 case ICMP6_ECHO_REQUEST: /* Echo Request (128) */
3661 case ICMP6_ECHO_REPLY: /* Echo Reply (129) */
3662 /* Already handled above */
3664 case ICMP6_MEMBERSHIP_QUERY: /* Multicast Listener Query (130) */
3665 case ICMP6_MEMBERSHIP_REPORT: /* Multicast Listener Report (131) */
3666 case ICMP6_MEMBERSHIP_REDUCTION: /* Multicast Listener Done (132) */
3668 /* It is MLDv2 packet ? (the min length for a MLDv2 packet is 28) */
3669 if ((icmp6_type == ICMP6_MEMBERSHIP_QUERY) && (length >= MLDV2_PACKET_MINLEN)) {
3671 guint16 qqi, i, nb_sources;
3673 /* Maximum Response Code */
3674 mrc = tvb_get_ntohs(tvb, offset);
3676 mrc = ((mrc & 0x0fff) | 0x1000) << (((mrc & 0x7000) >> 12) + 3);
3678 proto_tree_add_uint(icmp6_tree, hf_icmpv6_mld_mrc, tvb, offset, 2, mrc);
3682 proto_tree_add_item(icmp6_tree, hf_icmpv6_reserved, tvb, offset, 2, ENC_NA);
3685 /* Multicast Address */
3686 proto_tree_add_item(icmp6_tree, hf_icmpv6_mld_multicast_address, tvb, offset, 16, ENC_NA);
3690 ti_flag = proto_tree_add_item(icmp6_tree, hf_icmpv6_mld_flag, tvb, offset, 1, ENC_BIG_ENDIAN);
3691 flag_tree = proto_item_add_subtree(ti_flag, ett_icmpv6_flag_mld);
3692 proto_tree_add_item(flag_tree, hf_icmpv6_mld_flag_s, tvb, offset, 1, ENC_BIG_ENDIAN);
3693 proto_tree_add_item(flag_tree, hf_icmpv6_mld_flag_qrv, tvb, offset, 1, ENC_BIG_ENDIAN);
3694 proto_tree_add_item(flag_tree, hf_icmpv6_mld_flag_rsv, tvb, offset, 1, ENC_BIG_ENDIAN);
3698 qqi = tvb_get_guint8(tvb, offset);
3700 qqi = ((qqi & 0x0f) | 0x10) << (((qqi & 0x70) >> 4) + 3);
3702 proto_tree_add_uint(icmp6_tree, hf_icmpv6_mld_qqi, tvb, offset, 1, qqi);
3705 /* Number of Sources */
3706 proto_tree_add_item(icmp6_tree, hf_icmpv6_mld_nb_sources, tvb, offset, 2, ENC_BIG_ENDIAN);
3707 nb_sources = tvb_get_ntohs(tvb, offset);
3710 /* Source Address */
3711 for (i=0; i < nb_sources; i++){
3712 proto_tree_add_item(icmp6_tree, hf_icmpv6_mld_source_address, tvb, offset, 16, ENC_NA);
3716 }else{ /* It is a MLDv1 Packet */
3718 proto_tree_add_item(icmp6_tree, hf_icmpv6_mld_mrd, tvb, offset, 2, ENC_BIG_ENDIAN);
3722 proto_tree_add_item(icmp6_tree, hf_icmpv6_reserved, tvb, offset, 2, ENC_NA);
3725 /* Multicast Address */
3726 proto_tree_add_item(icmp6_tree, hf_icmpv6_mld_multicast_address, tvb, offset, 16, ENC_NA);
3731 case ICMP6_ND_ROUTER_SOLICIT: /* Router Solicitation (133) */
3734 proto_tree_add_item(icmp6_tree, hf_icmpv6_reserved, tvb, offset, 4, ENC_NA);
3738 offset = dissect_icmpv6_nd_opt(tvb, offset, pinfo, icmp6_tree);
3741 case ICMP6_ND_ROUTER_ADVERT: /* Router Advertisement (134) */
3744 /* Current hop limit */
3745 proto_tree_add_item(icmp6_tree, hf_icmpv6_nd_ra_cur_hop_limit, tvb, offset, 1, ENC_BIG_ENDIAN);
3749 ti_flag = proto_tree_add_item(icmp6_tree, hf_icmpv6_nd_ra_flag, tvb, offset, 1, ENC_BIG_ENDIAN);
3750 flag_tree = proto_item_add_subtree(ti_flag, ett_icmpv6_flag_ra);
3752 proto_tree_add_item(flag_tree, hf_icmpv6_nd_ra_flag_m, tvb, offset, 1, ENC_BIG_ENDIAN);
3753 proto_tree_add_item(flag_tree, hf_icmpv6_nd_ra_flag_o, tvb, offset, 1, ENC_BIG_ENDIAN);
3754 proto_tree_add_item(flag_tree, hf_icmpv6_nd_ra_flag_h, tvb, offset, 1, ENC_BIG_ENDIAN);
3755 proto_tree_add_item(flag_tree, hf_icmpv6_nd_ra_flag_prf, tvb, offset, 1, ENC_BIG_ENDIAN);
3756 proto_tree_add_item(flag_tree, hf_icmpv6_nd_ra_flag_p, tvb, offset, 1, ENC_BIG_ENDIAN);
3757 proto_tree_add_item(flag_tree, hf_icmpv6_nd_ra_flag_rsv, tvb, offset, 1, ENC_BIG_ENDIAN);
3760 /* Router lifetime */
3761 proto_tree_add_item(icmp6_tree, hf_icmpv6_nd_ra_router_lifetime, tvb, offset, 2, ENC_BIG_ENDIAN);
3764 /* Reachable time */
3765 proto_tree_add_item(icmp6_tree, hf_icmpv6_nd_ra_reachable_time, tvb, offset, 4, ENC_BIG_ENDIAN);
3769 proto_tree_add_item(icmp6_tree, hf_icmpv6_nd_ra_retrans_timer, tvb, offset, 4, ENC_BIG_ENDIAN);
3773 offset = dissect_icmpv6_nd_opt(tvb, offset, pinfo, icmp6_tree);
3776 case ICMP6_ND_NEIGHBOR_SOLICIT: /* Neighbor Solicitation (135) */
3779 proto_tree_add_item(icmp6_tree, hf_icmpv6_reserved, tvb, offset, 4, ENC_NA);
3782 /* Target Address */
3783 proto_tree_add_item(icmp6_tree, hf_icmpv6_nd_ns_target_address, tvb, offset, 16, ENC_NA);
3784 col_append_fstr(pinfo->cinfo, COL_INFO, " for %s", tvb_ip6_to_str(tvb, offset));
3789 offset = dissect_icmpv6_nd_opt(tvb, offset, pinfo, icmp6_tree);
3792 case ICMP6_ND_NEIGHBOR_ADVERT: /* Neighbor Advertisement (136) */
3795 wmem_strbuf_t *flags_strbuf = wmem_strbuf_new_label(wmem_packet_scope());
3798 ti_flag = proto_tree_add_item(icmp6_tree, hf_icmpv6_nd_na_flag, tvb, offset, 4, ENC_BIG_ENDIAN);
3799 flag_tree = proto_item_add_subtree(ti_flag, ett_icmpv6_flag_na);
3800 proto_tree_add_item(flag_tree, hf_icmpv6_nd_na_flag_r, tvb, offset, 4, ENC_BIG_ENDIAN);
3801 proto_tree_add_item(flag_tree, hf_icmpv6_nd_na_flag_s, tvb, offset, 4, ENC_BIG_ENDIAN);
3802 proto_tree_add_item(flag_tree, hf_icmpv6_nd_na_flag_o, tvb, offset, 4, ENC_BIG_ENDIAN);
3803 proto_tree_add_item(flag_tree, hf_icmpv6_nd_na_flag_rsv, tvb, offset, 4, ENC_BIG_ENDIAN);
3804 na_flags = tvb_get_ntohl(tvb, offset);
3807 /* Target Address */
3808 proto_tree_add_item(icmp6_tree, hf_icmpv6_nd_na_target_address, tvb, offset, 16, ENC_NA);
3811 if (na_flags & ND_NA_FLAG_R) {
3812 wmem_strbuf_append(flags_strbuf, "rtr, ");
3814 if (na_flags & ND_NA_FLAG_S) {
3815 wmem_strbuf_append(flags_strbuf, "sol, ");
3817 if (na_flags & ND_NA_FLAG_O) {
3818 wmem_strbuf_append(flags_strbuf, "ovr, ");
3820 if (wmem_strbuf_get_len(flags_strbuf) > 2) {
3821 wmem_strbuf_truncate(flags_strbuf, wmem_strbuf_get_len(flags_strbuf) - 2);
3823 wmem_strbuf_truncate(flags_strbuf, 0);
3824 wmem_strbuf_append(flags_strbuf, "none");
3827 col_append_fstr(pinfo->cinfo, COL_INFO, " %s (%s)", tvb_ip6_to_str(tvb, offset), wmem_strbuf_get_str(flags_strbuf));
3831 offset = dissect_icmpv6_nd_opt(tvb, offset, pinfo, icmp6_tree);
3834 case ICMP6_ND_REDIRECT: /* Redirect Message (137) */
3837 proto_tree_add_item(icmp6_tree, hf_icmpv6_reserved, tvb, offset, 4, ENC_NA);
3840 /* Target Address */
3841 proto_tree_add_item(icmp6_tree, hf_icmpv6_nd_rd_target_address, tvb, offset, 16, ENC_NA);
3844 /* Destination Address */
3845 proto_tree_add_item(icmp6_tree, hf_icmpv6_nd_rd_destination_address, tvb, offset, 16, ENC_NA);
3849 offset = dissect_icmpv6_nd_opt(tvb, offset, pinfo, icmp6_tree);
3852 case ICMP6_ROUTER_RENUMBERING: /* Router Renumbering (138) */
3854 offset = dissect_rrenum(tvb, offset, pinfo, icmp6_tree, icmp6_type, icmp6_code);
3857 case ICMP6_NI_QUERY: /* ICMP Node Information Query (139) */
3858 case ICMP6_NI_REPLY: /* ICMP Node Information Response (140) */
3860 offset = dissect_nodeinfo(tvb, offset, pinfo, icmp6_tree, icmp6_type, icmp6_code);
3863 case ICMP6_IND_SOLICIT: /* Inverse Neighbor Discovery Solicitation Message (141) */
3864 case ICMP6_IND_ADVERT: /* Inverse Neighbor Discovery Advertisement Message (142) */
3867 proto_tree_add_item(icmp6_tree, hf_icmpv6_reserved, tvb, offset, 4, ENC_NA);
3871 offset = dissect_icmpv6_nd_opt(tvb, offset, pinfo, icmp6_tree);
3874 case ICMP6_MLDV2_REPORT: /* Version 2 Multicast Listener Report (143) */
3876 offset = dissect_mldrv2( tvb, offset, pinfo, icmp6_tree );
3879 case ICMP6_MIP6_DHAAD_REQUEST: /* Home Agent Address Discovery Request Message (144) */
3882 proto_tree_add_item(icmp6_tree, hf_icmpv6_mip6_identifier, tvb, offset, 2, ENC_BIG_ENDIAN);
3886 proto_tree_add_item(icmp6_tree, hf_icmpv6_reserved, tvb, offset, 2, ENC_NA);
3891 case ICMP6_MIP6_DHAAD_REPLY: /* Home Agent Address Discovery Reply Message (145) */
3894 proto_tree_add_item(icmp6_tree, hf_icmpv6_mip6_identifier, tvb, offset, 2, ENC_BIG_ENDIAN);
3898 proto_tree_add_item(icmp6_tree, hf_icmpv6_reserved, tvb, offset, 2, ENC_NA);
3901 /* Show all Home Agent Addresses */
3902 while((int)length > offset)
3904 proto_tree_add_item(icmp6_tree, hf_icmpv6_mip6_home_agent_address, tvb, offset, 16, ENC_NA);
3909 case ICMP6_MIP6_MPS: /* Mobile Prefix Solicitation (146) */
3912 proto_tree_add_item(icmp6_tree, hf_icmpv6_mip6_identifier, tvb, offset, 2, ENC_BIG_ENDIAN);
3916 proto_tree_add_item(icmp6_tree, hf_icmpv6_reserved, tvb, offset, 2, ENC_NA);
3920 case ICMP6_MIP6_MPA: /* Mobile Prefix Advertisement (147) */
3923 proto_tree_add_item(icmp6_tree, hf_icmpv6_mip6_identifier, tvb, offset, 2, ENC_BIG_ENDIAN);
3927 ti_flag = proto_tree_add_item(icmp6_tree, hf_icmpv6_mip6_flag, tvb,offset, 6, ENC_NA);
3928 flag_tree = proto_item_add_subtree(ti_flag, ett_icmpv6_flag_mip6);
3929 proto_tree_add_item(flag_tree, hf_icmpv6_mip6_flag_m, tvb, offset, 2, ENC_BIG_ENDIAN);
3930 proto_tree_add_item(flag_tree, hf_icmpv6_mip6_flag_o, tvb, offset, 2, ENC_BIG_ENDIAN);
3931 proto_tree_add_item(flag_tree, hf_icmpv6_mip6_flag_rsv, tvb, offset, 2, ENC_BIG_ENDIAN);
3935 offset = dissect_icmpv6_nd_opt(tvb, offset, pinfo, icmp6_tree);
3938 case ICMP6_CERT_PATH_SOL: /* Certification Path Solicitation Message (148) */
3942 proto_tree_add_item(icmp6_tree, hf_icmpv6_send_identifier, tvb, offset, 2, ENC_BIG_ENDIAN);
3946 proto_tree_add_item(icmp6_tree, hf_icmpv6_send_component, tvb, offset, 2, ENC_BIG_ENDIAN);
3950 offset = dissect_icmpv6_nd_opt(tvb, offset, pinfo, icmp6_tree);
3953 case ICMP6_CERT_PATH_AD: /* Certification Path Advertisement Message (149) */
3957 proto_tree_add_item(icmp6_tree, hf_icmpv6_send_identifier, tvb, offset, 2, ENC_BIG_ENDIAN);
3960 /* All Components */
3961 proto_tree_add_item(icmp6_tree, hf_icmpv6_send_all_components, tvb, offset, 2, ENC_BIG_ENDIAN);
3965 proto_tree_add_item(icmp6_tree, hf_icmpv6_send_component, tvb, offset, 2, ENC_BIG_ENDIAN);
3969 proto_tree_add_item(icmp6_tree, hf_icmpv6_reserved, tvb, offset, 2, ENC_NA);
3973 offset = dissect_icmpv6_nd_opt(tvb, offset, pinfo, icmp6_tree);
3976 case ICMP6_EXPERIMENTAL_MOBILITY: /* ICMP messages utilized by experimental mobility protocols (150) */
3977 case ICMP6_FMIPV6_MESSAGES: /* FMIPv6 Messages (154)*/
3982 proto_tree_add_item(icmp6_tree, hf_icmpv6_fmip6_subtype, tvb, offset, 1, ENC_BIG_ENDIAN);
3983 subtype = tvb_get_guint8(tvb, offset);
3984 col_append_fstr(pinfo->cinfo, COL_INFO, " (%s)", val_to_str(subtype, fmip6_subtype_val, "Unknown (%d)"));
3988 case FMIP6_SUBTYPE_RTSOLPR:
3991 proto_tree_add_item(icmp6_tree, hf_icmpv6_reserved, tvb, offset, 1, ENC_NA);
3994 case FMIP6_SUBTYPE_PRRTADV:
3996 proto_item_append_text(code_item, " (%s)", val_to_str(icmp6_code, fmip6_prrtadv_code_val, "Unknown %d") );
3998 proto_tree_add_item(icmp6_tree, hf_icmpv6_reserved, tvb, offset, 1, ENC_NA);
4001 case FMIP6_SUBTYPE_HI:
4003 proto_item_append_text(code_item, " (%s)", val_to_str(icmp6_code, fmip6_hi_code_val, "Unknown %d") );
4005 ti_flag = proto_tree_add_item(icmp6_tree, hf_icmpv6_fmip6_hi_flag, tvb, offset, 1, ENC_BIG_ENDIAN);
4006 flag_tree = proto_item_add_subtree(ti_flag, ett_icmpv6_flag_fmip6);
4008 proto_tree_add_item(flag_tree, hf_icmpv6_fmip6_hi_flag_s, tvb, offset, 1, ENC_BIG_ENDIAN);
4009 proto_tree_add_item(flag_tree, hf_icmpv6_fmip6_hi_flag_u, tvb, offset, 1, ENC_BIG_ENDIAN);
4010 proto_tree_add_item(flag_tree, hf_icmpv6_fmip6_hi_flag_reserved, tvb, offset, 1, ENC_BIG_ENDIAN);
4013 case FMIP6_SUBTYPE_HACK:
4015 proto_item_append_text(code_item, " (%s)", val_to_str(icmp6_code, fmip6_hack_code_val, "Unknown %d") );
4017 proto_tree_add_item(icmp6_tree, hf_icmpv6_reserved, tvb, offset, 1, ENC_NA);
4024 proto_tree_add_item(icmp6_tree, hf_icmpv6_fmip6_identifier, tvb, offset, 2, ENC_BIG_ENDIAN);
4028 offset = dissect_icmpv6_nd_opt(tvb, offset, pinfo, icmp6_tree);
4031 case ICMP6_MCAST_ROUTER_ADVERT: /* Multicast Router Advertisement (151) */
4033 /* Query Interval */
4034 proto_tree_add_item(icmp6_tree, hf_icmpv6_mcast_ra_query_interval, tvb, offset, 2, ENC_BIG_ENDIAN);
4037 /* Robustness Variable */
4038 proto_tree_add_item(icmp6_tree, hf_icmpv6_mcast_ra_robustness_variable, tvb, offset, 2, ENC_BIG_ENDIAN);
4041 case ICMP6_MCAST_ROUTER_SOLICIT: /* Multicast Router Solicitation (152) */
4042 case ICMP6_MCAST_ROUTER_TERM: /* Multicast Router Termination (153) */
4047 case ICMP6_RPL_CONTROL: /* RPL Control (155) */
4049 /* RPL: RFC 6550 : Routing over Low-Power and Lossy Networks. */
4050 offset = dissect_rpl_control(tvb, offset, pinfo, icmp6_tree, icmp6_type, icmp6_code);
4053 case ICMP6_ILNPV6: /* Locator Update (156) */
4056 /* Number of locs */
4057 proto_tree_add_item(icmp6_tree, hf_icmpv6_ilnp_nb_locs, tvb, offset, 1, ENC_BIG_ENDIAN);
4058 nb_locs = tvb_get_guint8(tvb, offset);
4062 proto_tree_add_item(icmp6_tree, hf_icmpv6_reserved, tvb, offset, 1, ENC_NA);
4066 proto_tree_add_item(icmp6_tree, hf_icmpv6_reserved, tvb, offset, 2, ENC_NA);
4069 /* Locator / Preference / Lifetime */
4070 for (i=0; i < nb_locs; i++){
4071 proto_tree_add_item(icmp6_tree, hf_icmpv6_ilnp_locator, tvb, offset, 8, ENC_NA);
4074 proto_tree_add_item(icmp6_tree, hf_icmpv6_ilnp_preference, tvb, offset, 2, ENC_NA);
4077 proto_tree_add_item(icmp6_tree, hf_icmpv6_ilnp_lifetime, tvb, offset, 2, ENC_NA);
4083 case ICMP6_6LOWPANND_DAR:
4084 case ICMP6_6LOWPANND_DAC:
4087 proto_tree_add_item(icmp6_tree, hf_icmpv6_da_status, tvb, offset, 1, ENC_BIG_ENDIAN);
4091 proto_tree_add_item(icmp6_tree, hf_icmpv6_da_rsv, tvb, offset, 1, ENC_BIG_ENDIAN);
4095 proto_tree_add_item(icmp6_tree, hf_icmpv6_da_lifetime, tvb, offset, 2, ENC_BIG_ENDIAN);
4099 proto_tree_add_item(icmp6_tree, hf_icmpv6_da_eui64, tvb, offset, 8, ENC_BIG_ENDIAN);
4103 proto_tree_add_item(icmp6_tree, hf_icmpv6_da_raddr, tvb, offset, 16, ENC_NA);
4108 expert_add_info_format(pinfo, ti, &ei_icmpv6_undecoded_type,
4109 "Dissector for ICMPv6 Type (%d)"
4110 " code not implemented, Contact Wireshark"
4111 " developers if you want this supported", icmp6_type);
4112 proto_tree_add_item(icmp6_tree, hf_icmpv6_data, tvb, offset, -1, ENC_NA);
4114 } /* switch (icmp6_type) */
4118 tap_queue_packet(icmpv6_tap, pinfo, trans);
4120 col_append_fstr(pinfo->cinfo, COL_INFO, ", Type=%d, Code=%d", icmp6_type, icmp6_code);
4125 proto_register_icmpv6(void)
4127 static hf_register_info hf[] = {
4129 { "Type", "icmpv6.type", FT_UINT8, BASE_DEC, VALS(icmpv6_type_val), 0x0,
4130 "Indicates the type of the message", HFILL }},
4132 { "Code", "icmpv6.code", FT_UINT8, BASE_DEC, NULL, 0x0,
4133 "Depends on the message type. It is used to create an additional level of message granularity", HFILL }},
4134 { &hf_icmpv6_checksum,
4135 { "Checksum", "icmpv6.checksum", FT_UINT16, BASE_HEX, NULL, 0x0,
4136 "Used to detect data corruption in the ICMPv6 message and parts of the IPv6 header", HFILL }},
4137 { &hf_icmpv6_checksum_bad,
4138 { "Bad Checksum", "icmpv6.checksum_bad", FT_BOOLEAN, BASE_NONE, NULL, 0x0,
4140 { &hf_icmpv6_reserved,
4141 { "Reserved", "icmpv6.reserved", FT_BYTES, BASE_NONE, NULL, 0x0,
4142 "Must be Zero", HFILL }},
4144 { "Data", "icmpv6.data", FT_BYTES, BASE_NONE, NULL, 0x0,
4146 { &hf_icmpv6_unknown_data,
4147 { "Unknown Data", "icmpv6.unknown_data", FT_BYTES, BASE_NONE, NULL, 0x0,
4148 "Not interpreted Data", HFILL }},
4150 { "MTU", "icmpv6.mtu", FT_UINT32, BASE_DEC, NULL, 0x0,
4151 "The Maximum Transmission Unit of the next-hop link", HFILL }},
4152 { &hf_icmpv6_pointer,
4153 { "Pointer", "icmpv6.pointer", FT_UINT32, BASE_DEC, NULL, 0x0,
4154 "Identifies the octet offset within the invoking packet where the error was detected", HFILL }},
4155 { &hf_icmpv6_echo_identifier,
4156 { "Identifier", "icmpv6.echo.identifier", FT_UINT16, BASE_HEX, NULL, 0x0,
4157 "An identifier to aid in matching with Request and Reply", HFILL }},
4158 { &hf_icmpv6_echo_sequence_number,
4159 { "Sequence", "icmpv6.echo.sequence_number", FT_UINT16, BASE_DEC, NULL, 0x0,
4160 "A sequence number to aid in matching Echo Replies to this Echo Request", HFILL }},
4162 { "Nonce", "icmpv6.nonce", FT_BYTES, BASE_NONE, NULL, 0x0,
4164 /* RFC 2461/4861 : Neighbor Discovery for IP version 6 (IPv6) */
4165 { &hf_icmpv6_nd_ra_cur_hop_limit,
4166 { "Cur hop limit", "icmpv6.nd.ra.cur_hop_limit", FT_UINT8, BASE_DEC, NULL, 0x0,
4167 "The default value that should be placed in the Hop Count field of the IP header for outgoing IP packets", HFILL }},
4168 { &hf_icmpv6_nd_ra_flag,
4169 { "Flags", "icmpv6.nd.ra.flag", FT_UINT8, BASE_HEX, NULL, 0x0,
4171 { &hf_icmpv6_nd_ra_flag_m,
4172 { "Managed address configuration", "icmpv6.nd.ra.flag.m", FT_BOOLEAN, 8, TFS(&tfs_set_notset), ND_RA_FLAG_M,
4173 "When set, it indicates that addresses are available via DHCPv6", HFILL }},
4174 { &hf_icmpv6_nd_ra_flag_o,
4175 { "Other configuration", "icmpv6.nd.ra.flag.o", FT_BOOLEAN, 8, TFS(&tfs_set_notset), ND_RA_FLAG_O,
4176 "When set, it indicates that other configuration information is available via DHCPv6", HFILL }},
4177 { &hf_icmpv6_nd_ra_flag_h,
4178 { "Home Agent", "icmpv6.nd.ra.flag.h", FT_BOOLEAN, 8, TFS(&tfs_set_notset), ND_RA_FLAG_H,
4179 "When set, it indicate that the router sending this Router Advertisement is also functioning as a Mobile IPv6 home agent on this link", HFILL }},
4180 { &hf_icmpv6_nd_ra_flag_prf,
4181 { "Prf (Default Router Preference)", "icmpv6.nd.ra.flag.prf", FT_UINT8, BASE_DEC, VALS(nd_flag_router_pref), ND_RA_FLAG_PRF,
4182 "Indicates whether to prefer this router over other default routers", HFILL }},
4183 { &hf_icmpv6_nd_ra_flag_p,
4184 { "Proxy", "icmpv6.nd.ra.flag.p", FT_BOOLEAN, 8, TFS(&tfs_set_notset), ND_RA_FLAG_P,
4186 { &hf_icmpv6_nd_ra_flag_rsv,
4187 { "Reserved", "icmpv6.nd.ra.flag.rsv", FT_UINT8, BASE_DEC, NULL, ND_RA_FLAG_RSV,
4188 "Must be Zero", HFILL }},
4189 { &hf_icmpv6_nd_ra_router_lifetime,
4190 { "Router lifetime (s)", "icmpv6.nd.ra.router_lifetime", FT_UINT16, BASE_DEC, NULL, 0x0,
4191 "The lifetime associated with the default router", HFILL }},
4192 { &hf_icmpv6_nd_ra_reachable_time,
4193 { "Reachable time (ms)", "icmpv6.nd.ra.reachable_time", FT_UINT32, BASE_DEC, NULL, 0x0,
4194 "The time that a node assumes a neighbor is reachable after having received a reachability confirmation", HFILL }},
4195 { &hf_icmpv6_nd_ra_retrans_timer,
4196 { "Retrans timer (ms)", "icmpv6.nd.ra.retrans_timer", FT_UINT32, BASE_DEC, NULL, 0x0,
4197 "The time between retransmitted Neighbor Solicitation messages", HFILL }},
4198 { &hf_icmpv6_nd_ns_target_address,
4199 { "Target Address", "icmpv6.nd.ns.target_address", FT_IPv6, BASE_NONE, NULL, 0x0,
4200 "The IP address of the target of the solicitation", HFILL }},
4201 { &hf_icmpv6_nd_na_flag,
4202 { "Flags", "icmpv6.nd.na.flag", FT_UINT32, BASE_HEX, NULL, 0x0,
4204 { &hf_icmpv6_nd_na_flag_r,
4205 { "Router", "icmpv6.nd.na.flag.r", FT_BOOLEAN, 32, TFS(&tfs_set_notset), ND_NA_FLAG_R,
4206 "When set, it indicates that the sender is a router", HFILL }},
4207 { &hf_icmpv6_nd_na_flag_s,
4208 { "Solicited", "icmpv6.nd.na.flag.s", FT_BOOLEAN, 32, TFS(&tfs_set_notset), ND_NA_FLAG_S,
4209 "When set, it indicates that the advertisement was sent in response to a Neighbor Solicitation from the Destination address", HFILL }},
4210 { &hf_icmpv6_nd_na_flag_o,
4211 { "Override", "icmpv6.nd.na.flag.o", FT_BOOLEAN, 32, TFS(&tfs_set_notset), ND_NA_FLAG_O,
4212 "When set, it indicates that the advertisement should override an existing cache entry and update the cached link-layer address", HFILL }},
4213 { &hf_icmpv6_nd_na_flag_rsv,
4214 { "Reserved", "icmpv6.nd.na.flag.rsv", FT_UINT32, BASE_DEC, NULL, ND_NA_FLAG_RSV,
4215 "Must be Zero", HFILL }},
4216 { &hf_icmpv6_nd_na_target_address,
4217 { "Target Address", "icmpv6.nd.na.target_address", FT_IPv6, BASE_NONE, NULL, 0x0,
4218 "the Target Address field in the Neighbor Solicitation message that prompted this advertisement", HFILL }},
4219 { &hf_icmpv6_nd_rd_target_address,
4220 { "Target Address", "icmpv6.nd.rd.target_address", FT_IPv6, BASE_NONE, NULL, 0x0,
4221 "An IP address that is a better first hop to use for the ICMP Destination Address", HFILL }},
4222 { &hf_icmpv6_nd_rd_destination_address,
4223 { "Destination Address", "icmpv6.rd.na.destination_address", FT_IPv6, BASE_NONE, NULL, 0x0,
4224 "The IP address of the destination that is redirected to the target", HFILL }},
4226 { "ICMPv6 Option", "icmpv6.opt", FT_NONE, BASE_NONE, NULL, 0x0,
4228 { &hf_icmpv6_opt_type,
4229 { "Type", "icmpv6.opt.type", FT_UINT8, BASE_DEC, VALS(option_vals), 0x0,
4230 "Options type", HFILL }},
4231 { &hf_icmpv6_opt_length,
4232 { "Length", "icmpv6.opt.length", FT_UINT8, BASE_DEC, NULL, 0x0,
4233 "The length (in units of 8 bytes) of the option (including the Type and Length fields)", HFILL }},
4234 { &hf_icmpv6_opt_reserved,
4235 { "Reserved", "icmpv6.opt.reserved", FT_NONE, BASE_NONE, NULL, 0x0,
4236 "Reserved (Must be 0)", HFILL }},
4237 { &hf_icmpv6_opt_padding,
4238 { "Padding", "icmpv6.opt.padding", FT_NONE, BASE_NONE, NULL, 0x0,
4239 "Padding (Must be 0)", HFILL }},
4240 { &hf_icmpv6_opt_linkaddr,
4241 { "Link-layer address", "icmpv6.opt.linkaddr", FT_BYTES, BASE_NONE, NULL, 0x0,
4243 { &hf_icmpv6_opt_src_linkaddr,
4244 { "Source Link-layer address", "icmpv6.opt.src_linkaddr", FT_BYTES, BASE_NONE, NULL, 0x0,
4246 { &hf_icmpv6_opt_target_linkaddr,
4247 { "Target Link-layer address", "icmpv6.opt.target_linkaddr", FT_BYTES, BASE_NONE, NULL, 0x0,
4249 { &hf_icmpv6_opt_linkaddr_mac,
4250 { "Link-layer address", "icmpv6.opt.linkaddr", FT_ETHER, BASE_NONE, NULL, 0x0,
4252 { &hf_icmpv6_opt_src_linkaddr_mac,
4253 { "Source Link-layer address", "icmpv6.opt.src_linkaddr", FT_ETHER, BASE_NONE, NULL, 0x0,
4255 { &hf_icmpv6_opt_target_linkaddr_mac,
4256 { "Target Link-layer address", "icmpv6.opt.target_linkaddr", FT_ETHER, BASE_NONE, NULL, 0x0,
4258 { &hf_icmpv6_opt_linkaddr_eui64,
4259 { "Link-layer address", "icmpv6.opt.linkaddr_eui64", FT_EUI64, BASE_NONE, NULL, 0x0,
4261 { &hf_icmpv6_opt_src_linkaddr_eui64,
4262 { "Source Link-layer address", "icmpv6.opt.src_linkaddr_eui64", FT_EUI64, BASE_NONE, NULL, 0x0,
4264 { &hf_icmpv6_opt_target_linkaddr_eui64,
4265 { "Target Link-layer address", "icmpv6.opt.target_linkaddr_eui64", FT_EUI64, BASE_NONE, NULL, 0x0,
4267 { &hf_icmpv6_opt_prefix_len,
4268 { "Prefix Length", "icmpv6.opt.prefix.length", FT_UINT8, BASE_DEC, NULL, 0x0,
4269 "The number of leading bits in the Prefix that are valid", HFILL }},
4270 { &hf_icmpv6_opt_prefix_flag,
4271 { "Flag", "icmpv6.opt.prefix.flag", FT_UINT8, BASE_HEX, NULL, 0x00,
4273 { &hf_icmpv6_opt_prefix_flag_l,
4274 { "On-link flag(L)", "icmpv6.opt.prefix.flag.l", FT_BOOLEAN, 8, TFS(&tfs_set_notset), 0x80,
4275 "When set, indicates that this prefix can be used for on-link determination", HFILL }},
4276 { &hf_icmpv6_opt_prefix_flag_a,
4277 { "Autonomous address-configuration flag(A)", "icmpv6.opt.prefix.flag.a", FT_BOOLEAN, 8, TFS(&tfs_set_notset), 0x40,
4278 "When set indicates that this prefix can be used for stateless address configuration", HFILL }},
4279 { &hf_icmpv6_opt_prefix_flag_r,
4280 { "Router address flag(R)", "icmpv6.opt.prefix.flag.r", FT_BOOLEAN, 8, TFS(&tfs_set_notset), 0x20,
4281 "When set indicates that the Prefix field contains a complete IP address assigned to the sending router", HFILL }},
4282 { &hf_icmpv6_opt_prefix_flag_reserved,
4283 { "Reserved", "icmpv6.opt.prefix.flag.reserved", FT_UINT8, BASE_DEC, NULL, 0x1f,
4285 { &hf_icmpv6_opt_prefix_valid_lifetime,
4286 { "Valid Lifetime", "icmpv6.opt.prefix.valid_lifetime", FT_UINT32, BASE_DEC, NULL, 0x00,
4287 "The length of time in seconds that the prefix is valid for the purpose of on-link determination", HFILL }},
4288 { &hf_icmpv6_opt_prefix_preferred_lifetime,
4289 { "Preferred Lifetime", "icmpv6.opt.prefix.preferred_lifetime", FT_UINT32, BASE_DEC, NULL, 0x00,
4290 "The length of time in seconds that addresses generated from the prefix via stateless address autoconfiguration remain preferred", HFILL }},
4291 { &hf_icmpv6_opt_prefix,
4292 { "Prefix", "icmpv6.opt.prefix", FT_IPv6, BASE_NONE, NULL, 0x00,
4293 "An IP address or a prefix of an IP address", HFILL }},
4294 { &hf_icmpv6_opt_cga_pad_len,
4295 { "Pad Length", "icmpv6.opt.cga.pad_length", FT_UINT8, BASE_DEC, NULL, 0x0,
4296 "Pad Length (in bytes)", HFILL }},
4297 { &hf_icmpv6_opt_cga,
4298 { "CGA", "icmpv6.opt.cga", FT_BYTES, BASE_NONE, NULL, 0x0,
4300 { &hf_icmpv6_opt_cga_modifier,
4301 { "Modifier", "icmpv6.opt.cga.modifier", FT_BYTES, BASE_NONE, NULL, 0x0,
4303 { &hf_icmpv6_opt_cga_subnet_prefix,
4304 { "Subnet Prefix", "icmpv6.opt.cga.subnet_prefix", FT_BYTES, BASE_NONE, NULL, 0x0,
4306 { &hf_icmpv6_opt_cga_count,
4307 { "Count", "icmpv6.opt.cga.count", FT_BYTES, BASE_NONE, NULL, 0x0,
4309 { &hf_icmpv6_opt_cga_ext_type,
4310 { "Ext Type", "icmpv6.opt.cga.ext_type", FT_UINT16, BASE_DEC, NULL, 0x0,
4312 { &hf_icmpv6_opt_cga_ext_length,
4313 { "Ext Length", "icmpv6.opt.cga.ext_length", FT_UINT16, BASE_DEC, NULL, 0x0,
4315 { &hf_icmpv6_opt_cga_ext_data,
4316 { "Ext Data", "icmpv6.opt.cga.ext_data", FT_BYTES, BASE_NONE, NULL, 0x0,
4318 { &hf_icmpv6_opt_rsa_key_hash,
4319 { "Key Hash", "icmpv6.opt.rsa.key_hash", FT_BYTES, BASE_NONE, NULL, 0x0,
4321 { &hf_icmpv6_opt_digital_signature_padding,
4322 { "Digital Signature and Padding", "icmpv6.opt.digital_signature_padding", FT_NONE, BASE_NONE, NULL, 0x0,
4323 "TO DO FIX ME !!", HFILL }},
4324 { &hf_icmpv6_opt_ps_key_hash,
4325 { "Key Hash", "icmpv6.opt.ps.key_hash", FT_BYTES, BASE_NONE, NULL, 0x0,
4327 { &hf_icmpv6_opt_timestamp,
4328 { "Timestamp", "icmpv6.opt.timestamp", FT_ABSOLUTE_TIME, ABSOLUTE_TIME_LOCAL, NULL, 0x0,
4329 "The value indicates the number of seconds since January 1, 1970, 00:00 UTC", HFILL }},
4330 { &hf_icmpv6_opt_nonce,
4331 { "Nonce", "icmpv6.opt.nonce", FT_BYTES, BASE_NONE, NULL, 0x0,
4332 "A field containing a random number selected by the sender of the solicitation message", HFILL }},
4333 { &hf_icmpv6_opt_certificate_padding,
4334 { "Certificate and Padding", "icmpv6.opt.certificate_padding", FT_NONE, BASE_NONE, NULL, 0x0,
4336 { &hf_icmpv6_opt_ipa_option_code,
4337 { "Option-code", "icmpv6.opt.ipa.option_code", FT_UINT8, BASE_DEC, VALS(nd_opt_ipa_option_code_val), 0x00,
4339 { &hf_icmpv6_opt_ipa_prefix_len,
4340 { "Prefix Length", "icmpv6.opt.ipa.prefix_len", FT_UINT8, BASE_DEC, NULL, 0x00,
4341 "That indicates the length of the IPv6 Address Prefix", HFILL }},
4342 { &hf_icmpv6_opt_ipa_ipv6_address,
4343 { "IPv6 Address", "icmpv6.opt.ipa.ipv6_address", FT_IPv6, BASE_NONE, NULL, 0x00,
4344 "The IP address/prefix defined by the Option-Code field", HFILL }},
4345 { &hf_icmpv6_opt_nrpi_option_code,
4346 { "Option-code", "icmpv6.opt.nrpi.option_code", FT_UINT8, BASE_DEC, NULL, 0x00,
4348 { &hf_icmpv6_opt_nrpi_prefix_len,
4349 { "Prefix Length", "icmpv6.opt.nrpi.prefix_len", FT_UINT8, BASE_DEC, NULL, 0x00,
4350 "The number of leading bits in the Prefix that are valid", HFILL }},
4351 { &hf_icmpv6_opt_nrpi_prefix,
4352 { "Prefix", "icmpv6.opt.nrpi.prefix", FT_IPv6, BASE_NONE, NULL, 0x00,
4353 "An IP address or a prefix of an IP address", HFILL }},
4354 { &hf_icmpv6_opt_lla_option_code,
4355 { "Option-code", "icmpv6.opt.lla.option_code", FT_UINT8, BASE_DEC, VALS(nd_opt_lla_option_code_val), 0x00,
4357 { &hf_icmpv6_opt_lla_bytes,
4358 { "Link-Layer Address", "icmpv6.opt.lla.bytes", FT_BYTES, BASE_NONE, NULL, 0x00,
4359 "(in Bytes Format)", HFILL }},
4360 { &hf_icmpv6_opt_naack_option_code,
4361 { "Option-Code", "icmpv6.opt.naack.option_code", FT_UINT8, BASE_DEC, NULL, 0x00,
4363 { &hf_icmpv6_opt_naack_status,
4364 { "Status", "icmpv6.opt.naack.status", FT_UINT8, BASE_DEC, VALS(nd_opt_naack_status_val), 0x00,
4365 "Indicating the disposition of the Unsolicited Neighbor Advertisement message", HFILL }},
4366 { &hf_icmpv6_opt_naack_supplied_ncoa,
4367 { "Supplied NCoA", "icmpv6.opt.naack.supplied_ncoa", FT_IPv6, BASE_NONE, NULL, 0x00,
4369 { &hf_icmpv6_opt_map_dist,
4370 { "Distance", "icmpv6.opt.map.distance", FT_UINT8, BASE_DEC, NULL, 0xF0,
4371 "Identifying the distance between MAP and the receiver of the advertisement (in the number of hops)", HFILL }},
4372 { &hf_icmpv6_opt_map_pref,
4373 { "Preference", "icmpv6.opt.map.preference", FT_UINT8, BASE_DEC, NULL, 0x0F,
4374 "Used as an indicator of operator preference (Highest is better)", HFILL }},
4375 { &hf_icmpv6_opt_map_flag,
4376 { "Flag", "icmpv6.opt.map.flag", FT_UINT8, BASE_HEX, NULL, 0x00,
4378 { &hf_icmpv6_opt_map_flag_r,
4379 { "RCoA Flag", "icmpv6.opt.map.flag.r", FT_BOOLEAN, 8, NULL, 0x80,
4380 "It indicates that the mobile node is allocated the RCoA by the MAP", HFILL }},
4381 { &hf_icmpv6_opt_map_flag_reserved,
4382 { "Reserved", "icmpv6.opt.map.flag.reserved", FT_UINT8, BASE_DEC, NULL, 0x7F,
4383 "Must be 0", HFILL }},
4384 { &hf_icmpv6_opt_map_valid_lifetime,
4385 { "Valid Lifetime", "icmpv6.opt.map.valid_lifetime", FT_UINT32, BASE_DEC, NULL, 0x0,
4386 "This value indicates the validity of the MAP's address and the RCoA.", HFILL }},
4387 { &hf_icmpv6_opt_map_global_address,
4388 { "Global Address", "icmpv6.opt.map.global_address", FT_IPv6, BASE_NONE, NULL, 0x0,
4389 "One of the MAP's global addresses", HFILL }},
4390 { &hf_icmpv6_opt_route_info_flag,
4391 { "Flag", "icmpv6.opt.route_info.flag", FT_UINT8, BASE_HEX, NULL, 0x00,
4393 { &hf_icmpv6_opt_route_info_flag_route_preference,
4394 { "Route Preference", "icmpv6.opt.route_info.flag.route_preference", FT_UINT8, BASE_DEC, VALS(nd_flag_router_pref), ND_RA_FLAG_RTPREF_MASK,
4395 "The Route Preference indicates whether to prefer the router associated with this prefix over others", HFILL }},
4396 { &hf_icmpv6_opt_route_info_flag_reserved,
4397 { "Reserved", "icmpv6.opt.route_info.flag.reserved", FT_UINT8, BASE_DEC, NULL, ND_RA_FLAG_RESERV_MASK,
4398 "Must be 0", HFILL }},
4399 { &hf_icmpv6_opt_route_lifetime,
4400 { "Route Lifetime", "icmpv6.opt.route_lifetime", FT_UINT32, BASE_DEC, NULL, 0x00,
4401 "The length of time in seconds that the prefix is valid for the purpose of route determination", HFILL }},
4402 { &hf_icmpv6_opt_name_type,
4403 { "Name Type", "icmpv6.opt.name_type", FT_UINT8, BASE_DEC, VALS(icmpv6_option_name_type_vals), 0x0,
4405 { &hf_icmpv6_opt_name_x501,
4406 { "DER Encoded X.501 Name", "icmpv6.opt.name_x501", FT_BYTES, BASE_NONE, NULL, 0x0,
4408 { &hf_icmpv6_opt_name_fqdn,
4409 { "FQDN", "icmpv6.opt.name_type.fqdn", FT_STRING, BASE_NONE, NULL, 0x0,
4411 { &hf_icmpv6_opt_cert_type,
4412 { "Cert Type", "icmpv6.opt.name_type", FT_UINT8, BASE_DEC, VALS(icmpv6_option_cert_type_vals), 0x0,
4414 /* RFC3971: SEcure Neighbor Discovery (SEND) */
4415 { &hf_icmpv6_send_identifier,
4416 { "Identifier", "icmpv6.send.identifier", FT_UINT16, BASE_DEC, NULL, 0x0,
4417 "An identifier to aid in matching with Request and Reply", HFILL }},
4418 { &hf_icmpv6_send_all_components,
4419 { "All Components", "icmpv6.send.all_components", FT_UINT16, BASE_DEC, NULL, 0x0,
4420 "Inform the receiver of the number of certificates in the entire path", HFILL }},
4421 { &hf_icmpv6_send_component,
4422 { "Component", "icmpv6.send.component", FT_UINT16, BASE_DEC, NULL, 0x0,
4423 "If the field is set to 65,535 if the sender seeks to retrieve all certificates", HFILL }},
4425 { &hf_icmpv6_x509if_Name,
4426 { "Name", "icmpv6.x509_Name", FT_UINT32, BASE_DEC, VALS(x509if_Name_vals), 0x0,
4428 { &hf_icmpv6_x509af_Certificate,
4429 { "Certificate", "icmpv6.x509_Certificate", FT_NONE, BASE_NONE, NULL, 0x0,
4431 { &hf_icmpv6_opt_redirected_packet,
4432 { "Redirected Packet", "icmpv6.opt.redirected_packet", FT_NONE, BASE_NONE, NULL, 0x0,
4434 { &hf_icmpv6_opt_mtu,
4435 { "MTU", "icmpv6.opt.mtu", FT_UINT32, BASE_DEC, NULL, 0x0,
4436 "The recommended MTU for the link", HFILL }},
4437 { &hf_icmpv6_opt_nbma_shortcut_limit,
4438 { "Shortcut Limit", "icmpv6.opt.nbma.shortcut_limit", FT_UINT8, BASE_DEC, NULL, 0x0,
4439 "Hop limit for shortcut attempt", HFILL }},
4440 { &hf_icmpv6_opt_advertisement_interval,
4441 { "Advertisement Interval", "icmpv6.opt.advertisement_interval", FT_UINT32, BASE_DEC, NULL, 0x0,
4442 "The maximum time (in milliseconds) between successive unsolicited Router Advertisement messages sent by this router on this network interface", HFILL }},
4443 { &hf_icmpv6_opt_home_agent_preference,
4444 { "Home Agent Preference", "icmpv6.opt.home_agent_preference", FT_UINT16, BASE_DEC, NULL, 0x0,
4445 "The preference for the home agent sending this Router Advertisement", HFILL }},
4446 { &hf_icmpv6_opt_home_agent_lifetime,
4447 { "Home Agent Preference", "icmpv6.opt.home_agent_lifetime", FT_UINT16, BASE_DEC, NULL, 0x0,
4448 "The lifetime associated with the home agent in units of seconds.", HFILL }},
4449 { &hf_icmpv6_opt_ipv6_address,
4450 { "IPv6 Address", "icmpv6.opt.ipv6_address", FT_IPv6, BASE_NONE, NULL, 0x0,
4451 "IPv6 addresses of the interface", HFILL }},
4452 { &hf_icmpv6_opt_rdnss_lifetime,
4453 { "Lifetime", "icmpv6.opt.rdnss.lifetime", FT_UINT32, BASE_DEC, NULL, 0x0,
4455 { &hf_icmpv6_opt_rdnss,
4456 { "Recursive DNS Servers", "icmpv6.opt.rdnss", FT_IPv6, BASE_NONE, NULL, 0x0,
4458 { &hf_icmpv6_opt_efo,
4459 { "Flags Expansion Option", "icmpv6.opt.efo", FT_NONE, BASE_NONE, NULL, 0x0,
4461 { &hf_icmpv6_opt_efo_m,
4462 { "Managed address configuration", "icmpv6.opt.efo.m", FT_BOOLEAN, 16, TFS(&tfs_set_notset), FLAGS_EO_M,
4463 "When set, it indicates that addresses are available via DHCPv6", HFILL }},
4464 { &hf_icmpv6_opt_efo_o,
4465 { "Other configuration", "icmpv6.opt.efo.o", FT_BOOLEAN, 16, TFS(&tfs_set_notset), FLAGS_EO_O,
4466 "When set, it indicates that other configuration information is available via DHCPv6", HFILL }},
4467 { &hf_icmpv6_opt_efo_h,
4468 { "Home Agent", "icmpv6.opt.efo.h", FT_BOOLEAN, 16, TFS(&tfs_set_notset), FLAGS_EO_H,
4469 "When set, it indicate that the router sending this Router Advertisement is also functioning as a Mobile IPv6 home agent on this link", HFILL }},
4470 { &hf_icmpv6_opt_efo_prf,
4471 { "Prf (Default Router Preference)", "icmpv6.opt.efo.prf", FT_UINT16, BASE_DEC, VALS(nd_flag_router_pref), FLAGS_EO_PRF,
4472 "Indicates whether to prefer this router over other default routers", HFILL }},
4473 { &hf_icmpv6_opt_efo_p,
4474 { "Proxy", "icmpv6.opt.efo.p", FT_BOOLEAN, 16, TFS(&tfs_set_notset), FLAGS_EO_P,
4476 { &hf_icmpv6_opt_efo_rsv,
4477 { "Reserved", "icmpv6.opt.efo.rsv", FT_UINT16, BASE_DEC, NULL, FLAGS_EO_RSV,
4478 "Must be Zero", HFILL }},
4479 { &hf_icmpv6_opt_hkr_pad_length,
4480 { "Pad Length", "icmpv6.opt.hkr.pad_length", FT_UINT8, BASE_DEC, NULL, 0x0,
4481 "The number of padding octets beyond the end of the Handover Key", HFILL }},
4482 { &hf_icmpv6_opt_hkr_at,
4483 { "AT", "icmpv6.opt.hkr.at", FT_UINT8, BASE_DEC, NULL, 0xF0,
4484 "The algorithm type field describing the algorithm used by FMIPv6 to calculate the authenticator", HFILL }},
4485 { &hf_icmpv6_opt_hkr_reserved,
4486 { "Reserved", "icmpv6.opt.hkr.reserved", FT_UINT8, BASE_DEC, NULL, 0x0F,
4487 "Reserved (Must be Zero)", HFILL }},
4488 { &hf_icmpv6_opt_hkr_encryption_public_key,
4489 { "Handover Key Encryption Public Key", "icmpv6.opt.hkr.encryption_public_key", FT_BYTES, BASE_NONE, NULL, 0x0,
4491 { &hf_icmpv6_opt_hkr_padding,
4492 { "Padding", "icmpv6.opt.hkr.padding", FT_BYTES, BASE_NONE, NULL, 0x0,
4493 "A variable-length field making the option length a multiple of 8", HFILL }},
4494 { &hf_icmpv6_opt_hkr_lifetime,
4495 { "Padding", "icmpv6.opt.hkr.lifetime", FT_UINT16, BASE_DEC, NULL, 0x0,
4496 "Lifetime of the handover key (in seconds)", HFILL }},
4497 { &hf_icmpv6_opt_hkr_encrypted_handover_key,
4498 { "Encrypted Handover Key", "icmpv6.opt.hkr.encrypted_handover_key", FT_BYTES, BASE_NONE, NULL, 0x0,
4499 "The shared handover key, encrypted with the MN's handover key encryption public key", HFILL }},
4500 { &hf_icmpv6_opt_hai_option_code,
4501 { "Option-Code", "icmpv6.opt.hai.option_code", FT_UINT8, BASE_DEC, VALS(nd_opt_hai_option_code_val), 0x0,
4503 { &hf_icmpv6_opt_hai_length,
4504 { "HAI-Length", "icmpv6.opt.hai.length", FT_UINT8, BASE_DEC, NULL, 0x0,
4505 "The size of the HAI-Value field in octets", HFILL }},
4506 { &hf_icmpv6_opt_hai_value,
4507 { "HAI-Value", "icmpv6.opt.hai.value", FT_BYTES, BASE_NONE, NULL, 0x0,
4508 "The value specified by the Option-Code", HFILL }},
4509 { &hf_icmpv6_opt_mn_option_code,
4510 { "Option-Code", "icmpv6.opt.mn.option_code", FT_UINT8, BASE_DEC, VALS(nd_opt_mn_option_code_val), 0x0,
4512 { &hf_icmpv6_opt_mn_length,
4513 { "MN-Length", "icmpv6.opt.mn.length", FT_UINT8, BASE_DEC, NULL, 0x0,
4514 "The size of the MN-Value field in octets", HFILL }},
4515 { &hf_icmpv6_opt_mn_value,
4516 { "MN-Value", "icmpv6.opt.mn.value", FT_BYTES, BASE_NONE, NULL, 0x0,
4517 "The value specified by the Option-Code", HFILL }},
4518 { &hf_icmpv6_opt_dnssl_lifetime,
4519 { "Lifetime", "icmpv6.opt.dnssl.lifetime", FT_UINT32, BASE_DEC, NULL, 0x0,
4521 { &hf_icmpv6_opt_dnssl,
4522 { "Domain Names", "icmpv6.opt.dnssl", FT_STRING, BASE_NONE, NULL, 0x0,
4524 { &hf_icmpv6_opt_aro_status,
4525 { "Status", "icmpv6.opt.aro.status", FT_UINT8, BASE_DEC, VALS(nd_opt_6lowpannd_status_val), 0x00,
4526 "Indicates the status of a registration in the NA response", HFILL }},
4527 { &hf_icmpv6_opt_aro_registration_lifetime,
4528 { "Registration Lifetime", "icmpv6.opt.aro.registration_lifetime", FT_UINT16, BASE_DEC, NULL, 0x00,
4529 "The amount of time (in a unit of 60 seconds) that the router should retain the Neighbor Cache entry", HFILL }},
4530 { &hf_icmpv6_opt_aro_eui64,
4531 { "EUI-64", "icmpv6.opt.aro.eui64", FT_EUI64, BASE_NONE, NULL, 0x00,
4532 "This field is used to uniquely identify the interface of the registered address", HFILL }},
4533 { &hf_icmpv6_opt_6co_context_length,
4534 { "Context Length", "icmpv6.opt.6co.context_length", FT_UINT8, BASE_DEC, NULL, 0x00,
4535 "The number of leading bits in the Context Prefix field that are valid", HFILL }},
4536 { &hf_icmpv6_opt_6co_flag,
4537 { "Flag", "icmpv6.opt.6co.flag", FT_UINT8, BASE_HEX, NULL, 0x00,
4539 { &hf_icmpv6_opt_6co_flag_c,
4540 { "Compression Flag", "icmpv6.opt.6co.flag.c", FT_BOOLEAN, 8, TFS(&tfs_set_notset), ND_OPT_6CO_FLAG_C,
4541 "This flag indicates if the context is valid for use in compression", HFILL }},
4542 { &hf_icmpv6_opt_6co_flag_cid,
4543 { "CID", "icmpv6.opt.6co.flag.cid", FT_UINT8, BASE_DEC, NULL, ND_OPT_6CO_FLAG_CID,
4544 "Context Identifier for this prefix information", HFILL }},
4545 { &hf_icmpv6_opt_6co_flag_reserved,
4546 { "Reserved", "icmpv6.opt.6co.flag.reserved", FT_UINT8, BASE_DEC, NULL, ND_OPT_6CO_FLAG_RESERVED,
4547 "Must be zero", HFILL }},
4548 { &hf_icmpv6_opt_6co_valid_lifetime,
4549 { "Lifetime", "icmpv6.opt.6co.valid_lifetime", FT_UINT16, BASE_DEC, NULL, 0x00,
4550 "The length of time in a unit of 60 seconds that the context is valid for the purpose of header compression or decompression", HFILL }},
4551 { &hf_icmpv6_opt_6co_context_prefix,
4552 { "Context Prefix", "icmpv6.opt.6co.context_prefix", FT_IPv6, BASE_NONE, NULL, 0x00,
4553 "The IPv6 prefix or address corresponding to the Context ID (CID) field", HFILL }},
4554 { &hf_icmpv6_opt_abro_version_low,
4555 { "Version Low", "icmpv6.opt.abro.version_low", FT_UINT16, BASE_DEC, NULL, 0x00,
4556 "The version number low (the least significant 16 bits) corresponding to this set of information contained in the RA message", HFILL }},
4557 { &hf_icmpv6_opt_abro_version_high,
4558 { "Version", "icmpv6.opt.abro.version_high", FT_UINT16, BASE_DEC, NULL, 0x00,
4559 "The version number high (most significant 16 bits) corresponding to this set of information contained in the RA message", HFILL }},
4560 { &hf_icmpv6_opt_abro_valid_lifetime,
4561 { "Valid Lifetime", "icmpv6.opt.abro.valid_lifetime", FT_UINT16, BASE_DEC, NULL, 0x00,
4562 "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 }},
4563 { &hf_icmpv6_opt_abro_6lbr_address,
4564 { "6LBR Address", "icmpv6.opt.abro.6lbr_address", FT_IPv6, BASE_NONE, NULL, 0x00,
4565 "IPv6 address of the 6LBR that is the origin of the included version number", HFILL }},
4566 { &hf_icmpv6_opt_6cio_unassigned1,
4567 { "Unassigned", "icmpv6.opt.6cio.unassigned1", FT_UINT16, BASE_HEX, NULL, ND_OPT_6CIO_FLAG_UNASSIGNED,
4569 { &hf_icmpv6_opt_6cio_flag_g,
4570 { "G", "icmpv6.opt.6cio.flag_g", FT_UINT16, BASE_HEX, NULL, ND_OPT_6CIO_FLAG_G,
4572 { &hf_icmpv6_opt_6cio_unassigned2,
4573 { "Unassigned", "icmpv6.opt.6cio.unassigned2", FT_UINT32, BASE_HEX, NULL, 0x00,
4576 /* RFC2710: Multicast Listener Discovery for IPv6 */
4577 { &hf_icmpv6_mld_mrd,
4578 { "Maximum Response Delay [ms]", "icmpv6.mld.maximum_response_delay", FT_UINT16, BASE_DEC, NULL, 0x0,
4579 "Specifies the maximum allowed delay before sending a responding Report, in units of milliseconds", HFILL }},
4580 { &hf_icmpv6_mld_multicast_address,
4581 { "Multicast Address", "icmpv6.mld.multicast_address", FT_IPv6, BASE_NONE, NULL, 0x0,
4582 "Specific IPv6 multicast address", HFILL }},
4583 /* RFC 2894: Router Renumbering for IPv6 */
4584 { &hf_icmpv6_rr_sequencenumber,
4585 { "Sequence Number", "icmpv6.rr.sequence_number", FT_UINT32, BASE_DEC, NULL, 0x0,
4586 "The sequence number MUST be non-decreasing between Sequence Number Resets", HFILL }},
4587 { &hf_icmpv6_rr_segmentnumber,
4588 { "Segment Number", "icmpv6.rr.segment_number", FT_UINT8, BASE_DEC, NULL, 0x0,
4589 "Enumerates different valid RR messages having the same Sequence Number", HFILL }},
4590 { &hf_icmpv6_rr_flag,
4591 { "Flags", "icmpv6.rr.flag", FT_UINT8, BASE_HEX, NULL, 0x0,
4592 "Five are defined and three bits are reserved", HFILL }},
4593 { &hf_icmpv6_rr_flag_t,
4594 { "Test Command", "icmpv6.rr.flag.t", FT_BOOLEAN, 8, TFS(&tfs_set_notset), RR_FLAG_T,
4595 "Indicates a Test message: processing is to be simulated and no configuration changes are to be made", HFILL }},
4596 { &hf_icmpv6_rr_flag_r,
4597 { "Result requested", "icmpv6.rr.flag.r", FT_BOOLEAN, 8, TFS(&tfs_set_notset), RR_FLAG_R,
4598 "Indicates that the router send a Result message upon completion of processing the Command message", HFILL }},
4599 { &hf_icmpv6_rr_flag_a,
4600 { "All Interfaces", "icmpv6.rr.flag.a", FT_BOOLEAN, 8, TFS(&tfs_set_notset), RR_FLAG_A,
4601 "Indicates that the Command be applied to all interfaces regardless of administrative shutdown status", HFILL }},
4602 { &hf_icmpv6_rr_flag_s,
4603 { "Site-specific", "icmpv6.rr.flag.s", FT_BOOLEAN, 8, TFS(&tfs_set_notset), RR_FLAG_S,
4604 "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 }},
4605 { &hf_icmpv6_rr_flag_p,
4606 { "Processed previously", "icmpv6.rr.flag.p", FT_BOOLEAN, 8, TFS(&tfs_set_notset), RR_FLAG_P,
4607 "Indicates that the Command message was previously processed (and is not a Test) and the responding router is not processing it again", HFILL }},
4608 { &hf_icmpv6_rr_flag_rsv,
4609 { "Reserved", "icmpv6.rr.flag.rsv", FT_UINT8, BASE_DEC, NULL, RR_FLAG_RSV,
4610 "Must be Zero", HFILL }},
4611 { &hf_icmpv6_rr_maxdelay,
4612 { "Max Delay", "icmpv6.rr.maxdelay", FT_UINT16, BASE_DEC, NULL, 0x0,
4613 "Specifying the maximum time (in milliseconds) by which a router MUST delay sending any reply to this Command", HFILL }},
4615 { &hf_icmpv6_rr_pco_mp_part,
4616 { "Match-Prefix Part", "icmpv6.rr.pco.mp", FT_NONE, BASE_NONE, NULL, 0x0,
4618 { &hf_icmpv6_rr_pco_mp_opcode,
4619 { "OpCode", "icmpv6.rr.pco.mp.opcode", FT_UINT8, BASE_DEC, VALS(rr_pco_mp_opcode_val), 0x0,
4620 "Specifying the operation to be performed when the associated MatchPrefix matches an interface's prefix or address", HFILL }},
4621 { &hf_icmpv6_rr_pco_mp_oplength,
4622 { "OpLength", "icmpv6.rr.pco.mp.oplength", FT_UINT8, BASE_DEC, NULL, 0x0,
4623 "The total length of this Prefix Control Operation (in units of 8 octets)", HFILL }},
4624 { &hf_icmpv6_rr_pco_mp_ordinal,
4625 { "Ordinal", "icmpv6.rr.pco.mp.ordinal", FT_UINT8, BASE_HEX, NULL, 0x0,
4626 "The value is otherwise unconstrained", HFILL }},
4627 { &hf_icmpv6_rr_pco_mp_matchlen,
4628 { "MatchLen", "icmpv6.rr.pco.mp.matchlen", FT_UINT8, BASE_DEC, NULL, 0x0,
4629 "Between 0 and 128 inclusive specifying the number of initial bits of MatchPrefix which are significant in matching", HFILL }},
4630 { &hf_icmpv6_rr_pco_mp_minlen,
4631 { "MinLen", "icmpv6.rr.pco.mp.minlen", FT_UINT8, BASE_DEC, NULL, 0x0,
4632 "Specifying the minimum length which any configured prefix must have in order to be eligible for testing against the MatchPrefix", HFILL }},
4633 { &hf_icmpv6_rr_pco_mp_maxlen,
4634 { "MaxLen", "icmpv6.rr.pco.mp.maxlen", FT_UINT8, BASE_DEC, NULL, 0x0,
4635 "Specifying the maximum length which any configured prefix must have in order to be eligible for testing against the MatchPrefix", HFILL }},
4636 { &hf_icmpv6_rr_pco_mp_matchprefix,
4637 { "MatchPrefix", "icmpv6.rr.pco.mp.matchprefix", FT_IPv6, BASE_NONE, NULL, 0x0,
4638 "The 128-bit prefix to be compared with each interface's prefix or address", HFILL }},
4639 { &hf_icmpv6_rr_pco_up_part,
4640 { "Use-Prefix Part", "icmpv6.rr.pco.up", FT_NONE, BASE_NONE, NULL, 0x0,
4642 { &hf_icmpv6_rr_pco_up_uselen,
4643 { "UseLen", "icmpv6.rr.pco.up.uselen", FT_UINT8, BASE_DEC, NULL, 0x0,
4644 "specifying the number of initial bits of UsePrefix to use in creating a new prefix for an interface", HFILL }},
4645 { &hf_icmpv6_rr_pco_up_keeplen,
4646 { "KeepLen", "icmpv6.rr.pco.up.keeplen", FT_UINT8, BASE_DEC, NULL, 0x0,
4647 "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 }},
4648 { &hf_icmpv6_rr_pco_up_flagmask,
4649 { "FlagMask", "icmpv6.rr.pco.up.flagmask", FT_UINT8, BASE_HEX, NULL, 0x0,
4650 "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 }},
4652 { &hf_icmpv6_rr_pco_up_flagmask_l,
4653 { "On-link flag(L)", "icmpv6.rr.pco.up.flagmask.l", FT_BOOLEAN, 8, TFS(&tfs_set_notset), 0x80,
4654 "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 }},
4655 { &hf_icmpv6_rr_pco_up_flagmask_a,
4656 { "Autonomous address-configuration flag(A)", "icmpv6.rr.pco.up.flagmask.a", FT_BOOLEAN, 8, TFS(&tfs_set_notset), 0x40,
4657 "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 }},
4658 { &hf_icmpv6_rr_pco_up_flagmask_reserved,
4659 { "Reserved", "icmpv6.rr.pco.up.flagmask.reserved", FT_UINT8, BASE_DEC, NULL, 0x3f,
4661 { &hf_icmpv6_rr_pco_up_raflags,
4662 { "RAFlags", "icmpv6.rr.pco.up.raflags", FT_UINT8, BASE_HEX, NULL, 0x0,
4663 "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 }},
4664 { &hf_icmpv6_rr_pco_up_raflags_l,
4665 { "On-link flag(L)", "icmpv6.rr.pco.up.flagmask.l", FT_BOOLEAN, 8, TFS(&tfs_set_notset), 0x80,
4666 "When set, indicates that this prefix can be used for on-link determination", HFILL }},
4667 { &hf_icmpv6_rr_pco_up_raflags_a,
4668 { "Autonomous address-configuration flag(A)", "icmpv6.rr.pco.up.flagmask.a", FT_BOOLEAN, 8, TFS(&tfs_set_notset), 0x40,
4669 "When set indicates that this prefix can be used for stateless address configuration", HFILL }},
4670 { &hf_icmpv6_rr_pco_up_raflags_reserved,
4671 { "Reserved", "icmpv6.rr.pco.up.flagmask.reserved", FT_UINT8, BASE_DEC, NULL, 0x3f,
4673 { &hf_icmpv6_rr_pco_up_validlifetime,
4674 { "Valid Lifetime", "icmpv6.rr.pco.up.validlifetime", FT_UINT32, BASE_DEC, NULL, 0x0,
4675 "The number of seconds for which the New Prefix will be valid", HFILL }},
4676 { &hf_icmpv6_rr_pco_up_preferredlifetime,
4677 { "Preferred Lifetime", "icmpv6.rr.pco.up.preferredlifetime", FT_UINT32, BASE_DEC, NULL, 0x0,
4678 "The number of seconds for which the New Prefix will be preferred", HFILL }},
4679 { &hf_icmpv6_rr_pco_up_flag,
4680 { "Flags", "icmpv6.rr.pco.up.flag", FT_UINT32, BASE_HEX, NULL, 0x0,
4682 { &hf_icmpv6_rr_pco_up_flag_v,
4683 { "Decrement valid lifetime", "icmpv6.rr.pco.up.flag.v", FT_BOOLEAN, 32, TFS(&tfs_set_notset), 0x80000000,
4684 "When set, indicating that the valid lifetime of the New Prefix MUST be effectively decremented in real time", HFILL }},
4685 { &hf_icmpv6_rr_pco_up_flag_p,
4686 { "Decrement preferred lifetime", "icmpv6.rr.pco.up.flag.p", FT_BOOLEAN, 32, TFS(&tfs_set_notset), 0x40000000,
4687 "When set, indicating that the preferred lifetime of the New Prefix MUST be effectively decremented in real time", HFILL }},
4688 { &hf_icmpv6_rr_pco_up_flag_reserved,
4689 { "Reserved", "icmpv6.rr.pco.up.flag.reserved", FT_UINT32, BASE_DEC, NULL, 0x3FFFFFFF,
4691 { &hf_icmpv6_rr_pco_up_useprefix,
4692 { "UsePrefix", "icmpv6.rr.pco.up.useprefix", FT_IPv6, BASE_NONE, NULL, 0x0,
4693 "The 128-bit Use-prefix which either becomes or is used in forming (if KeepLen is nonzero) the New Prefix", HFILL }},
4695 { "Result Message", "icmpv6.rr.rm", FT_NONE, BASE_NONE, NULL, 0x0,
4697 { &hf_icmpv6_rr_rm_flag,
4698 { "Flags", "icmpv6.rr.rm.flag", FT_UINT16, BASE_HEX, NULL, 0x0,
4700 { &hf_icmpv6_rr_rm_flag_b,
4701 { "Bounds", "icmpv6.rr.rm.flag.b", FT_BOOLEAN, 16, TFS(&tfs_set_notset), 0x0002,
4702 "When set, indicates that one or more fields in the associated PCO were out of bounds", HFILL }},
4703 { &hf_icmpv6_rr_rm_flag_f,
4704 { "Forbidden", "icmpv6.rr.rm.flag.f", FT_BOOLEAN, 16, TFS(&tfs_set_notset), 0x0001,
4705 "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 }},
4706 { &hf_icmpv6_rr_rm_flag_reserved,
4707 { "Reserved", "icmpv6.rr.rm.flag.reserved", FT_UINT16, BASE_DEC, NULL, 0xFFFC,
4708 "Must be Zero", HFILL }},
4709 { &hf_icmpv6_rr_rm_ordinal,
4710 { "Ordinal", "icmpv6.rr.rm.ordinal", FT_UINT8, BASE_HEX, NULL, 0x0,
4711 "The value is otherwise unconstrained", HFILL }},
4712 { &hf_icmpv6_rr_rm_matchedlen,
4713 { "MatchedLen", "icmpv6.rr.rm.matchedlen", FT_UINT8, BASE_DEC, NULL, 0x0,
4714 "The length of the Matched Prefix", HFILL }},
4715 { &hf_icmpv6_rr_rm_interfaceindex,
4716 { "InterfaceIndex", "icmpv6.rr.rm.interfaceindex", FT_UINT32, BASE_DEC, NULL, 0x0,
4717 "The router's numeric designation of the interface on which the MatchedPrefix was configured", HFILL }},
4718 { &hf_icmpv6_rr_rm_matchedprefix,
4719 { "MatchedPrefix", "icmpv6.rr.rm.matchedprefix", FT_IPv6, BASE_NONE, NULL, 0x0,
4720 "The 128 Bits MatchedPrefix", HFILL }},
4722 /* RFC3775/6275: Mobility Support in IPv6 */
4723 { &hf_icmpv6_mip6_identifier,
4724 { "Identifier", "icmpv6.mip6.identifier", FT_UINT16, BASE_DEC_HEX, NULL, 0x0,
4725 "An identifier to aid in matching with Request and Reply", HFILL }},
4726 { &hf_icmpv6_mip6_home_agent_address,
4727 { "Home Agent Address", "icmpv6.mip6.home_agent_address", FT_IPv6, BASE_NONE, NULL, 0x0,
4728 "A list of addresses of home agents on the home link for the mobile node", HFILL }},
4729 { &hf_icmpv6_mip6_flag,
4730 { "Flags", "icmpv6.mip6.flag", FT_NONE, BASE_NONE, NULL, 0x0,
4732 { &hf_icmpv6_mip6_flag_m,
4733 { "Managed address configuration", "icmpv6.mip6.flag.m", FT_BOOLEAN, 16, TFS(&tfs_set_notset), FLAGS_EO_M,
4734 "When set, it indicates that addresses are available via DHCPv6", HFILL }},
4735 { &hf_icmpv6_mip6_flag_o,
4736 { "Other configuration", "icmpv6.mip6.flag.o", FT_BOOLEAN, 16, TFS(&tfs_set_notset), FLAGS_EO_O,
4737 "When set, it indicates that other configuration information is available via DHCPv6", HFILL }},
4738 { &hf_icmpv6_mip6_flag_rsv,
4739 { "Reserved", "icmpv6.mip6.flag.rsv", FT_UINT16, BASE_DEC, NULL, 0x2FFF,
4740 "Must be Zero", HFILL }},
4742 /* RFC3810: Multicast Listener Discovery Version 2 (MLDv2) for IPv6 */
4743 { &hf_icmpv6_mld_mrc,
4744 { "Maximum Response Code", "icmpv6.mld.maximum_response_code", FT_UINT16, BASE_DEC, NULL, 0x0,
4745 "Specifies the maximum allowed delay before sending a responding Report", HFILL }},
4746 { &hf_icmpv6_mld_flag,
4747 { "Flags", "icmpv6.mld.flag", FT_UINT8, BASE_HEX, NULL, 0x0,
4749 { &hf_icmpv6_mld_flag_s,
4750 { "Suppress Router-Side Processing", "icmpv6.mld.flag.s", FT_BOOLEAN, 8, NULL, MLD_FLAG_S,
4751 "Indicates to any receiving multicast routers that they have to suppress the normal timer updates they perform upon hearing a Query", HFILL }},
4752 { &hf_icmpv6_mld_flag_qrv,
4753 { "QRV (Querier's Robustness Variable)", "icmpv6.mld.flag.qrv", FT_UINT8, BASE_DEC, NULL, MLD_FLAG_QRV,
4754 "Contains the RV (Robustness Variable) value used by the Querier", HFILL }},
4755 { &hf_icmpv6_mld_flag_rsv,
4756 { "Reserved", "icmpv6.mld.flag.reserved", FT_UINT8, BASE_DEC, NULL, MLD_FLAG_RSV,
4757 "Must Be Zero", HFILL }},
4758 { &hf_icmpv6_mld_qqi,
4759 { "QQIC (Querier's Query Interval Code)", "icmpv6.mld.qqi", FT_UINT8, BASE_DEC, NULL, 0x0,
4760 "Specifies the QI (Query Interval) used by the Querier", HFILL }},
4761 { &hf_icmpv6_mld_nb_sources,
4762 { "Number of Sources", "icmpv6.mld.nb_sources", FT_UINT16, BASE_DEC, NULL, 0x0,
4763 "Specifies how many source addresses are present in the Query", HFILL }},
4764 { &hf_icmpv6_mld_source_address,
4765 { "Source Address", "icmpv6.mld.source_address", FT_IPv6, BASE_NONE, NULL, 0x0,
4766 "The Source Address fields are a vector of unicast addresses", HFILL }},
4767 { &hf_icmpv6_mldr_nb_mcast_records,
4768 { "Number of Multicast Address Records", "icmpv6.mldr.nb_mcast_records", FT_UINT16, BASE_DEC, NULL, 0x0,
4769 "Specifies how many Multicast Address Records are present in this Report", HFILL }},
4770 { &hf_icmpv6_mldr_mar,
4771 { "Multicast Address Record", "icmpv6.mldr.mar", FT_NONE, BASE_NONE, NULL, 0x0,
4772 "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 }},
4773 { &hf_icmpv6_mldr_mar_record_type,
4774 { "Record Type", "icmpv6.mldr.mar.record_type", FT_UINT8, BASE_DEC, VALS(mldr_record_type_val), 0x0,
4775 "It specifies the type of the Multicast Address Record", HFILL }},
4776 { &hf_icmpv6_mldr_mar_aux_data_len,
4777 { "Aux Data Len", "icmpv6.mldr.mar.aux_data_len", FT_UINT8, BASE_DEC, NULL, 0x0,
4778 "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 }},
4779 { &hf_icmpv6_mldr_mar_nb_sources,
4780 { "Number of Sources", "icmpv6.mldr.mar.nb_sources", FT_UINT16, BASE_DEC, NULL, 0x0,
4781 "The Number of Sources field specifies how many source addresses are present in this Multicast Address Record", HFILL }},
4782 { &hf_icmpv6_mldr_mar_multicast_address,
4783 { "Multicast Address", "icmpv6.mldr.mar.multicast_address", FT_IPv6, BASE_NONE, NULL, 0x0,
4784 "The Multicast Address field contains the multicast address to which this Multicast Address Record pertains", HFILL }},
4785 { &hf_icmpv6_mldr_mar_source_address,
4786 { "Source Address", "icmpv6.mldr.mar.source_address", FT_IPv6, BASE_NONE, NULL, 0x0,
4787 "The Source Address fields are a vector of unicast addresses", HFILL }},
4788 { &hf_icmpv6_mldr_mar_auxiliary_data,
4789 { "Auxiliary Data", "icmpv6.mldr.mar.auxiliary_data", FT_BYTES, BASE_NONE, NULL, 0x0,
4790 "Contains additional information that pertain to this Multicast Address Record", HFILL }},
4791 /* RFC 4068/5268/5568: Fast Handovers for Mobile IPv6 ( Mobile IPv6 Fast Handovers ) */
4792 { &hf_icmpv6_fmip6_subtype,
4793 { "Subtype", "icmpv6.fmip6.subtype", FT_UINT8, BASE_DEC, VALS(fmip6_subtype_val), 0x0,
4794 "Designates the Subtype of information", HFILL }},
4795 { &hf_icmpv6_fmip6_hi_flag,
4796 { "Flag", "icmpv6.fmip6.hi.flag", FT_UINT8, BASE_HEX, NULL, 0x00,
4798 { &hf_icmpv6_fmip6_hi_flag_s,
4799 { "Assigned address configuration", "icmpv6.fmip6.hi.flag.s", FT_BOOLEAN, 8, TFS(&tfs_set_notset), FMIP6_HI_FLAG_S,
4800 "When set, this message requests a new CoA to be returned by the destination", HFILL }},
4801 { &hf_icmpv6_fmip6_hi_flag_u,
4802 { "Buffer", "icmpv6.fmip6.hi.flag.a", FT_BOOLEAN, 8, TFS(&tfs_set_notset), FMIP6_HI_FLAG_U,
4803 "When set, the destination SHOULD buffer any packets toward the node indicated in the options of this message", HFILL }},
4804 { &hf_icmpv6_fmip6_hi_flag_reserved,
4805 { "Reserved", "icmpv6.fmip6.hi.flag.reserved", FT_UINT8, BASE_DEC, NULL, FMIP6_HI_FLAG_RSV,
4807 { &hf_icmpv6_fmip6_identifier,
4808 { "Identifier", "icmpv6.fmip6.identifier", FT_UINT16, BASE_DEC_HEX, NULL, 0x0,
4809 "An identifier to aid in matching with Request and Reply", HFILL }},
4811 /* RFC 4286: Multicast Router Discovery */
4812 { &hf_icmpv6_mcast_ra_query_interval,
4813 { "Query Interval", "icmpv6.mcast_ra.query_interval", FT_UINT16, BASE_DEC, NULL, 0x0,
4814 "The Query Interval value (in seconds) in use by MLD on the interface.", HFILL }},
4815 { &hf_icmpv6_mcast_ra_robustness_variable,
4816 { "Robustness Variable", "icmpv6.mcast_ra.robustness_variable", FT_UINT16, BASE_DEC, NULL, 0x0,
4817 "The Robustness Variable in use by MLD on the advertising interface", HFILL }},
4819 /* RFC 4620: IPv6 Node Information Queries */
4820 { &hf_icmpv6_ni_qtype,
4821 { "Qtype", "icmpv6.ni.qtype", FT_UINT16, BASE_DEC, VALS(ni_qtype_val), 0x0,
4822 "Designates the type of information", HFILL }},
4823 { &hf_icmpv6_ni_flag,
4824 { "Flags", "icmpv6.ni.flag", FT_UINT16, BASE_HEX, NULL, 0x0,
4825 "Qtype-specific flags that may be defined for certain Query types and their Replies", HFILL }},
4826 { &hf_icmpv6_ni_flag_g,
4827 { "Global-scope addresses", "icmpv6.ni.flag.g", FT_BOOLEAN, 16, TFS(&tfs_set_notset), NI_FLAG_G,
4828 "Global-scope addresses are requested", HFILL }},
4829 { &hf_icmpv6_ni_flag_s,
4830 { "Site-local addresses", "icmpv6.ni.flag.s", FT_BOOLEAN, 16, TFS(&tfs_set_notset), NI_FLAG_S,
4831 "Site-local addresses are requested", HFILL }},
4832 { &hf_icmpv6_ni_flag_l,
4833 { "Link-local addresses", "icmpv6.ni.flag.l", FT_BOOLEAN, 16, TFS(&tfs_set_notset), NI_FLAG_L,
4834 "Link-local addresses are requested", HFILL }},
4835 { &hf_icmpv6_ni_flag_c,
4836 { "Compression", "icmpv6.ni.flag.c", FT_BOOLEAN, 16, TFS(&tfs_set_notset), NI_FLAG_C,
4837 "IPv4-compatible (now deprecated) and IPv4-mapped addresses are requested", HFILL }},
4838 { &hf_icmpv6_ni_flag_a,
4839 { "Unicast Addresses", "icmpv6.ni.flag.a", FT_BOOLEAN, 16, TFS(&tfs_ni_flag_a), NI_FLAG_A,
4840 "Responder's unicast addresses", HFILL }},
4841 { &hf_icmpv6_ni_flag_t,
4842 { "Truncated", "icmpv6.ni.flag.t", FT_BOOLEAN, 16, TFS(&tfs_set_notset), NI_FLAG_T,
4843 "Defined in a Reply only, indicates that the set of addresses is incomplete for space reasons", HFILL }},
4844 { &hf_icmpv6_ni_flag_rsv,
4845 { "Reserved", "icmpv6.ni.flag.rsv", FT_UINT16, BASE_HEX, NULL, NI_FLAG_RSV,
4846 "Must be Zero", HFILL }},
4847 { &hf_icmpv6_ni_nonce,
4848 { "Nonce", "icmpv6.ni.nonce", FT_UINT64, BASE_HEX, NULL, 0x0,
4849 "An opaque 64-bit field", HFILL }},
4850 { &hf_icmpv6_ni_query_subject_ipv6,
4851 { "IPv6 subject address", "icmpv6.ni.query.subject_ipv6", FT_IPv6, BASE_NONE, NULL, 0x0,
4853 { &hf_icmpv6_ni_query_subject_fqdn,
4854 { "FQDN subject", "icmpv6.ni.query.subject_fqdn", FT_STRING, BASE_NONE, NULL, 0x0,
4856 { &hf_icmpv6_ni_query_subject_ipv4,
4857 { "IPv4 subject address", "icmpv6.ni.query.subject_ipv4", FT_IPv4, BASE_NONE, NULL, 0x0,
4859 { &hf_icmpv6_ni_reply_node_ttl,
4860 { "TTL", "icmpv6.ni.reply.node_ttl", FT_UINT32, BASE_DEC, NULL, 0x0,
4862 { &hf_icmpv6_ni_reply_node_name,
4863 { "Name Node", "icmpv6.ni.reply.node_name", FT_STRING, BASE_NONE, NULL, 0x0,
4865 { &hf_icmpv6_ni_reply_node_address,
4866 { "IPv6 Node address", "icmpv6.ni.reply.node_address", FT_IPv6, BASE_NONE, NULL, 0x0,
4868 { &hf_icmpv6_ni_reply_ipv4_address,
4869 { "IPv4 Node address", "icmpv6.ni.reply.ipv4_address", FT_IPv4, BASE_NONE, NULL, 0x0,
4872 /* RPL: RFC 6550 : Routing over Low-Power and Lossy Networks. */
4873 { &hf_icmpv6_rpl_dis_flag,
4874 { "Flags", "icmpv6.rpl.dis.flags", FT_UINT8, BASE_DEC, NULL, 0x0,
4875 "8-bit unused field reserved for flags", HFILL }},
4876 { &hf_icmpv6_rpl_dio_instance,
4877 { "RPLInstanceID", "icmpv6.rpl.dio.instance", FT_UINT8, BASE_DEC, NULL, 0x0,
4878 "Set by the DODAG root that indicates which RPL Instance the DODAG is part of", HFILL }},
4879 { &hf_icmpv6_rpl_dio_version,
4880 { "Version", "icmpv6.rpl.dio.version", FT_UINT8, BASE_DEC, NULL, 0x0,
4881 "Set by the DODAG root to the DODAGVersionNumber", HFILL }},
4882 { &hf_icmpv6_rpl_dio_rank,
4883 { "Rank", "icmpv6.rpl.dio.rank", FT_UINT16, BASE_DEC, NULL, 0x0,
4884 "Indicating the DODAG rank of the node sending the DIO message", HFILL }},
4885 { &hf_icmpv6_rpl_dio_flag,
4886 { "Flags", "icmpv6.rpl.dio.flag", FT_UINT8, BASE_HEX, NULL, 0x0,
4888 { &hf_icmpv6_rpl_dio_flag_g,
4889 { "Grounded (G)", "icmpv6.rpl.dio.flag.g", FT_BOOLEAN, 8, NULL, RPL_DIO_FLAG_G,
4890 "Indicates whether the DODAG advertised can satisfy the application-defined goal", HFILL }},
4891 { &hf_icmpv6_rpl_dio_flag_0,
4892 { "Zero", "icmpv6.rpl.dio.flag.0", FT_BOOLEAN, 8, NULL, RPL_DIO_FLAG_0,
4894 { &hf_icmpv6_rpl_dio_flag_mop,
4895 { "Mode of Operation (MOP)", "icmpv6.rpl.dio.flag.mop", FT_UINT8, BASE_HEX, VALS(rpl_dio_map_val), RPL_DIO_FLAG_MOP,
4896 "Identifies the mode of operation of the RPL Instance as administratively provisioned at and distributed by the DODAG Root", HFILL }},
4897 { &hf_icmpv6_rpl_dio_flag_prf,
4898 { "DODAG Preference", "icmpv6.rpl.dio.flag.preference", FT_UINT8, BASE_DEC, NULL, RPL_DIO_FLAG_PRF,
4899 "Defines how preferable the root of this DODAG is compared to other DODAG roots within the instance", HFILL }},
4900 { &hf_icmpv6_rpl_dio_dtsn,
4901 { "Destination Advertisement Trigger Sequence Number (DTSN)", "icmpv6.rpl.dio.dtsn", FT_UINT8, BASE_DEC, NULL, 0x0,
4902 "The DTSN is used as part of the procedure to maintain downward routes.", HFILL }},
4903 { &hf_icmpv6_rpl_dio_dagid,
4904 { "DODAGID", "icmpv6.rpl.dio.dagid", FT_IPv6, BASE_NONE, NULL, 0x0,
4905 "IPv6 address set by a DODAG root which uniquely identifies a DODAG", HFILL }},
4906 { &hf_icmpv6_rpl_dao_instance,
4907 { "RPLInstanceID", "icmpv6.rpl.dao.instance", FT_UINT8, BASE_DEC, NULL, 0x0,
4908 "Indicating the topology instance associated with the DODAG as learned from the DIO", HFILL }},
4909 { &hf_icmpv6_rpl_dao_flag,
4910 { "Flags", "icmpv6.rpl.dao.flag", FT_UINT8, BASE_HEX, NULL, 0x0,
4912 { &hf_icmpv6_rpl_dao_flag_k,
4913 { "DAO-ACK Request (K)", "icmpv6.rpl.dao.flag.k", FT_BOOLEAN, 8, NULL, RPL_DAO_FLAG_K,
4914 "Indicates that the recipient is expected to send a DAO-ACK back", HFILL }},
4915 { &hf_icmpv6_rpl_dao_flag_d,
4916 { "DODAGID Present (D)", "icmpv6.rpl.dao.flag.d", FT_BOOLEAN, 8, NULL, RPL_DAO_FLAG_D,
4917 "Indicates that the DODAGID field is present", HFILL }},
4918 { &hf_icmpv6_rpl_dao_flag_rsv,
4919 { "Reserved", "icmpv6.rpl.dao.flag.rsv", FT_UINT8, BASE_DEC, NULL, RPL_DAO_FLAG_RESERVED,
4920 "Must be zero", HFILL }},
4921 { &hf_icmpv6_rpl_dao_sequence,
4922 { "DAO Sequence", "icmpv6.rpl.dao.sequence", FT_UINT8, BASE_DEC, NULL, 0x0,
4923 "Incremented at each unique DAO message from a node and echoed in the DAO-ACK message", HFILL }},
4924 { &hf_icmpv6_rpl_dao_dodagid,
4925 { "DODAGID", "icmpv6.rpl.dao.dodagid", FT_IPv6, BASE_NONE, NULL, 0x0,
4926 "IPv6 address set by a DODAG root which uniquely identifies a DODAG", HFILL }},
4927 { &hf_icmpv6_rpl_daoack_instance,
4928 { "RPLInstanceID", "icmpv6.rpl.daoack.instance", FT_UINT8, BASE_DEC, NULL, 0x0,
4929 "Indicating the topology instance associated with the DODAG, as learned from the DIO", HFILL }},
4930 { &hf_icmpv6_rpl_daoack_flag,
4931 { "Flag", "icmpv6.rpl.daoack.flag", FT_UINT8, BASE_HEX, NULL, 0x0,
4933 { &hf_icmpv6_rpl_daoack_flag_d,
4934 { "DODAGID Present (D)", "icmpv6.rpl.daoack.flag.d", FT_BOOLEAN, 8, NULL, RPL_DAOACK_FLAG_D,
4935 "Indicates that the DODAGID field is present", HFILL }},
4936 { &hf_icmpv6_rpl_daoack_flag_rsv,
4937 { "Reserved", "icmpv6.rpl.daoack.flag.rsv", FT_UINT8, BASE_DEC, NULL, RPL_DAOACK_FLAG_RESERVED,
4938 "Must be zero", HFILL }},
4939 { &hf_icmpv6_rpl_daoack_sequence,
4940 { "DAO-ACK Sequence", "icmpv6.rpl.daoack.sequence", FT_UINT8, BASE_DEC, NULL, 0x0,
4941 "Incremented at each DAO message from a node, and echoed in the DAO-ACK by the recipient", HFILL }},
4942 { &hf_icmpv6_rpl_daoack_status,
4943 { "Status", "icmpv6.rpl.daoack.status", FT_UINT8, BASE_DEC, NULL, 0x0,
4944 "Indicates the completion", HFILL }},
4945 { &hf_icmpv6_rpl_daoack_dodagid,
4946 { "DODAGID", "icmpv6.rpl.daoack.dodagid", FT_IPv6, BASE_NONE, NULL, 0x0,
4947 "IPv6 address integer set by a DODAG root which uniquely identifies a DODAG", HFILL }},
4948 { &hf_icmpv6_rpl_cc_instance,
4949 { "RPLInstanceID", "icmpv6.rpl.cc.instance", FT_UINT8, BASE_DEC, NULL, 0x0,
4950 "Indicating the topology instance associated with the DODAG, as learned from the DIO", HFILL }},
4951 { &hf_icmpv6_rpl_cc_flag,
4952 { "Flag", "icmpv6.rpl.cc.flag", FT_UINT8, BASE_HEX, NULL, 0x0,
4954 { &hf_icmpv6_rpl_cc_flag_r,
4955 { "Response (R)", "icmpv6.rpl.cc.flag.r", FT_BOOLEAN, 8, NULL, RPL_CC_FLAG_R,
4956 "Indicates whether the CC message is a response", HFILL }},
4957 { &hf_icmpv6_rpl_cc_flag_rsv,
4958 { "Reserved", "icmpv6.rpl.cc.flag.rsv", FT_UINT8, BASE_DEC, NULL, RPL_CC_FLAG_RESERVED,
4959 "Must be zero", HFILL }},
4960 { &hf_icmpv6_rpl_cc_nonce,
4961 { "CC Nonce", "icmpv6.rpl.cc.nonce", FT_UINT16, BASE_HEX, NULL, 0x0,
4962 "The corresponding CC response includes the same CC nonce value as the request, as learned from the DIO", HFILL }},
4963 { &hf_icmpv6_rpl_cc_dodagid,
4964 { "DODAGID", "icmpv6.rpl.cc.dodagid", FT_IPv6, BASE_NONE, NULL, 0x0,
4965 "IPv6 address integer set by a DODAG root which uniquely identifies a DODAG", HFILL }},
4966 { &hf_icmpv6_rpl_cc_destination_counter,
4967 { "Destination Counter", "icmpv6.rpl.cc.destination_counter", FT_UINT32, BASE_DEC, NULL, 0x0,
4968 "Indicating the sender's estimate of the destination's current security Counter value", HFILL }},
4969 { &hf_icmpv6_rpl_secure_flag,
4970 { "Flags", "icmpv6.rpl.secure.flag", FT_UINT8, BASE_HEX, NULL, 0x0,
4972 { &hf_icmpv6_rpl_secure_flag_t,
4973 { "Counter is Time (T)", "icmpv6.rpl.secure.flag.t", FT_BOOLEAN, 8, NULL, RPL_SECURE_FLAG_T,
4974 "If it is set then the Counter field is a timestamp", HFILL }},
4975 { &hf_icmpv6_rpl_secure_flag_rsv,
4976 { "Reserved", "icmpv6.rpl.secure.flag.rsv", FT_UINT8, BASE_DEC, NULL, RPL_SECURE_FLAG_RSV,
4977 "Must be zero", HFILL }},
4978 { &hf_icmpv6_rpl_secure_algorithm,
4979 { "Algorithm", "icmpv6.rpl.secure.algorithm", FT_UINT8, BASE_DEC, NULL, 0x0,
4980 "The Security Algorithm field specifies the encryption, MAC, and signature scheme the network uses", HFILL }},
4981 { &hf_icmpv6_rpl_secure_algorithm_encryption,
4982 { "Algorithm (Encryption)", "icmpv6.rpl.secure.algorithm.encryption", FT_UINT8, BASE_DEC, VALS(rpl_secure_algorithm_encryption_val), 0x0,
4984 { &hf_icmpv6_rpl_secure_algorithm_signature,
4985 { "Algorithm (Signature)", "icmpv6.rpl.secure.algorithm.signature", FT_UINT8, BASE_DEC, VALS(rpl_secure_algorithm_signature_val), 0x0,
4987 { &hf_icmpv6_rpl_secure_kim,
4988 { "Key Identifier Mode (KIM)", "icmpv6.rpl.secure.kim", FT_UINT8, BASE_DEC, NULL, RPL_SECURE_KIM,
4989 "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 }},
4990 { &hf_icmpv6_rpl_secure_lvl,
4991 { "Security Level (LVL)", "icmpv6.rpl.secure.lvl", FT_UINT8, BASE_DEC, NULL, RPL_SECURE_LVL,
4992 "Indicates the provided packet protection", HFILL }},
4993 { &hf_icmpv6_rpl_secure_rsv,
4994 { "Reserved", "icmpv6.rpl.secure.rsv", FT_UINT8, BASE_DEC, NULL, RPL_SECURE_RSV,
4995 "Must be zero", HFILL }},
4996 { &hf_icmpv6_rpl_secure_counter,
4997 { "Counter", "icmpv6.rpl.secure.counter", FT_UINT32, BASE_DEC, NULL, 0x0,
4998 "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 }},
4999 { &hf_icmpv6_rpl_secure_key_source,
5000 { "Key Source", "icmpv6.rpl.secure.key.source", FT_BYTES, BASE_NONE, NULL, 0x0,
5001 "Indicates the logical identifier of the originator of a group key", HFILL }},
5002 { &hf_icmpv6_rpl_secure_key_index,
5003 { "Key Source", "icmpv6.rpl.secure.key.index", FT_UINT8, BASE_DEC, NULL, 0x0,
5004 "Allows unique identification of different keys with the same originator", HFILL }},
5005 { &hf_icmpv6_rpl_opt,
5006 { "ICMPv6 RPL Option", "icmpv6.opt", FT_NONE, BASE_NONE, NULL, 0x0,
5008 { &hf_icmpv6_rpl_opt_type,
5009 { "Type", "icmpv6.rpl.opt.type", FT_UINT8, BASE_DEC, VALS(rpl_option_vals), 0x0,
5010 "Options type", HFILL }},
5011 { &hf_icmpv6_rpl_opt_length,
5012 { "Length", "icmpv6.rpl.opt.length", FT_UINT8, BASE_DEC, NULL, 0x0,
5013 "The length of the option in octets excluding the Type and Length fields", HFILL }},
5014 { &hf_icmpv6_rpl_opt_reserved,
5015 { "Reserved", "icmpv6.rpl.opt.reserved", FT_NONE, BASE_NONE, NULL, 0x0,
5016 "Reserved (Must be 0)", HFILL }},
5017 { &hf_icmpv6_rpl_opt_padn,
5018 { "Paddn", "icmpv6.rpl.opt.padn", FT_NONE, BASE_NONE, NULL, 0x0,
5019 "Padding (Must be 0)", HFILL }},
5020 { &hf_icmpv6_rpl_opt_route_prefix_length,
5021 { "Prefix Length", "icmpv6.rpl.opt.route.prefix_length", FT_UINT8, BASE_DEC, NULL, 0x0,
5022 "The number of leading bits in the Prefix that are valid", HFILL }},
5023 { &hf_icmpv6_rpl_opt_route_flag,
5024 { "Flag","icmpv6.rpl.opt.route.flag", FT_NONE, BASE_NONE, NULL, 0x0,
5026 { &hf_icmpv6_rpl_opt_route_pref,
5027 { "Preference","icmpv6.rpl.opt.route.pref", FT_UINT8, BASE_DEC, VALS(nd_flag_router_pref), RPL_OPT_ROUTE_PREFERENCE,
5028 "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 }},
5029 { &hf_icmpv6_rpl_opt_route_reserved,
5030 { "Reserved","icmpv6.rpl.opt.route.reserved", FT_UINT8, BASE_DEC, NULL, RPL_OPT_ROUTE_RESERVED,
5031 "Reserved (Must be Zero)", HFILL }},
5032 { &hf_icmpv6_rpl_opt_route_lifetime,
5033 { "Route Lifetime", "icmpv6.rpl.opt.route.lifetime", FT_UINT32, BASE_DEC, NULL, 0x0,
5034 "The length of time in seconds (relative to the time the packet is sent) that the prefix is valid for route determination", HFILL }},
5035 { &hf_icmpv6_rpl_opt_route_prefix,
5036 { "Prefix", "icmpv6.rpl.opt.route.prefix", FT_IPv6, BASE_NONE, NULL, 0x0,
5037 "Variable-length field containing an IP address or a prefix of an IPv6 address", HFILL }},
5038 { &hf_icmpv6_rpl_opt_config_flag,
5039 { "Flag","icmpv6.rpl.opt.config.flag", FT_NONE, BASE_NONE, NULL, 0x0,
5041 { &hf_icmpv6_rpl_opt_config_reserved,
5042 { "Reserved","icmpv6.rpl.opt.config.reserved", FT_UINT8, BASE_DEC, NULL, RPL_OPT_CONFIG_FLAG_RESERVED,
5043 "Must be Zero", HFILL }},
5044 { &hf_icmpv6_rpl_opt_config_auth,
5045 { "Authentication Enabled","icmpv6.rpl.opt.config.auth", FT_BOOLEAN, 8, TFS(&tfs_set_notset), RPL_OPT_CONFIG_FLAG_AUTH,
5046 "One bit flag describing the security mode of the network", HFILL }},
5047 { &hf_icmpv6_rpl_opt_config_pcs,
5048 { "Path Control Size", "icmpv6.rpl.opt.config.pcs", FT_UINT8, BASE_DEC, NULL, RPL_OPT_CONFIG_FLAG_PCS,
5049 "Used to configure the number of bits that may be allocated to the Path Control field", HFILL }},
5050 { &hf_icmpv6_rpl_opt_config_doublings,
5051 { "DIOIntervalDoublings","icmpv6.rpl.opt.config.interval_double", FT_UINT8, BASE_DEC, NULL, 0x0,
5052 "Used to configure Imax of the DIO trickle timer", HFILL }},
5053 { &hf_icmpv6_rpl_opt_config_min_interval,
5054 { "DIOIntervalMin", "icmpv6.rpl.opt.config.interval_min", FT_UINT16, BASE_DEC, NULL, 0x0,
5055 "Used to configure Imin of the DIO trickle timer", HFILL }},
5056 { &hf_icmpv6_rpl_opt_config_redundancy,
5057 { "DIORedundancyConstant", "icmpv6.rpl.opt.config.redundancy", FT_UINT8, BASE_DEC, NULL, 0x0,
5058 "Used to configure k of the DIO trickle timer", HFILL }},
5059 { &hf_icmpv6_rpl_opt_config_rank_incr,
5060 { "MaxRankInc", "icmpv6.rpl.opt.config.max_rank_inc", FT_UINT16, BASE_DEC, NULL, 0x0,
5061 "Used to configure DAGMaxRankIncrease", HFILL }},
5062 { &hf_icmpv6_rpl_opt_config_hop_rank_inc,
5063 { "MinHopRankInc", "icmpv6.rpl.opt.config.min_hop_rank_inc", FT_UINT16, BASE_DEC, NULL, 0x0,
5064 "Used to configure MinHopRankIncrease", HFILL }},
5065 { &hf_icmpv6_rpl_opt_config_ocp,
5066 { "OCP (Objective Code Point)","icmpv6.rpl.opt.config.ocp", FT_UINT16, BASE_DEC, NULL, 0x0,
5067 "The OCP field identifies the OF and is managed by the IANA", HFILL }},
5068 { &hf_icmpv6_rpl_opt_config_rsv,
5069 { "Reserved", "icmpv6.rpl.opt.config.rsv", FT_UINT8, BASE_DEC, NULL, 0x0,
5071 { &hf_icmpv6_rpl_opt_config_def_lifetime,
5072 { "Default Lifetime", "icmpv6.rpl.opt.config.def_lifetime", FT_UINT8, BASE_DEC, NULL, 0x0,
5073 "This is the lifetime that is used as default for all RPL routes", HFILL }},
5074 { &hf_icmpv6_rpl_opt_config_lifetime_unit,
5075 { "Lifetime Unit", "icmpv6.rpl.opt.config.lifetime_unit", FT_UINT16, BASE_DEC, NULL, 0x0,
5076 "Provides the unit in seconds that is used to express route lifetimes in RPL", HFILL }},
5077 { &hf_icmpv6_rpl_opt_target_flag,
5078 { "Reserved", "icmpv6.rpl.opt.target.flag", FT_NONE, BASE_NONE, NULL, 0x0,
5079 "Unused field reserved for flags", HFILL }},
5080 { &hf_icmpv6_rpl_opt_target_prefix_length,
5081 { "Target Length", "icmpv6.rpl.opt.target.prefix_length", FT_UINT8, BASE_DEC, NULL, 0x0,
5082 "Number of valid leading bits in the IPv6 Prefix", HFILL }},
5083 { &hf_icmpv6_rpl_opt_target_prefix,
5084 { "Target", "icmpv6.rpl.opt.target.prefix", FT_IPv6, BASE_NONE, NULL, 0x0,
5085 "Identifying an IPv6 destination address, prefix, or multicast group", HFILL }},
5086 { &hf_icmpv6_rpl_opt_transit_flag,
5087 { "Flags", "icmpv6.rpl.opt.transit.flag", FT_UINT8, BASE_HEX, NULL, 0x0,
5089 { &hf_icmpv6_rpl_opt_transit_flag_e,
5090 { "External", "icmpv6.rpl.opt.transit.flag.e", FT_BOOLEAN, 8, TFS(&tfs_set_notset), RPL_OPT_TRANSIT_FLAG_E,
5091 "Indicate that the parent router redistributes external targets into the RPL network", HFILL }},
5092 { &hf_icmpv6_rpl_opt_transit_flag_rsv,
5093 { "Reserved", "icmpv6.rpl.opt.transit.flag.rsv", FT_UINT8, BASE_DEC, NULL, RPL_OPT_TRANSIT_FLAG_RSV,
5094 "Must be Zero", HFILL }},
5095 { &hf_icmpv6_rpl_opt_transit_pathctl,
5096 { "Path Control", "icmpv6.rpl.opt.transit.pathctl", FT_UINT8, BASE_DEC, NULL, 0x0,
5097 "Limits the number of DAO-Parents to which a DAO message advertising connectivity", HFILL }},
5098 { &hf_icmpv6_rpl_opt_transit_pathseq,
5099 { "Path Sequence", "icmpv6.rpl.opt.transit.pathseq", FT_UINT8, BASE_DEC, NULL, 0x0,
5100 "Increments the Path Sequence each time it issues a RPL Target option with updated information", HFILL }},
5101 { &hf_icmpv6_rpl_opt_transit_pathlifetime,
5102 { "Path Lifetime", "icmpv6.rpl.opt.transit.pathlifetime", FT_UINT8, BASE_DEC, NULL, 0x0,
5103 "The length of time in Lifetime Units that the prefix is valid for route determination", HFILL }},
5104 { &hf_icmpv6_rpl_opt_transit_parent,
5105 { "Parent Address", "icmpv6.rpl.opt.transit.parent", FT_IPv6, BASE_NONE, NULL, 0x0,
5106 "IPv6 Address of the DODAG Parent of the node originally issuing the Transit Information Option", HFILL }},
5107 { &hf_icmpv6_rpl_opt_solicited_instance,
5108 { "Instance", "icmpv6.rpl.opt.solicited.instance", FT_UINT8, BASE_DEC, NULL, 0x0,
5109 "Containing the RPLInstanceID that is being solicited when valid", HFILL }},
5110 { &hf_icmpv6_rpl_opt_solicited_flag,
5111 { "Flag", "icmpv6.rpl.opt.solicited.flag", FT_UINT8, BASE_HEX, NULL, 0x0,
5113 { &hf_icmpv6_rpl_opt_solicited_flag_v,
5114 { "Version predicate", "icmpv6.rpl.opt.solicited.flag.v", FT_BOOLEAN, 8, TFS(&tfs_true_false), RPL_OPT_SOLICITED_FLAG_V,
5115 "The Version predicate is true if the receiver's DODAGVersionNumber matches the requested Version Number", HFILL }},
5116 { &hf_icmpv6_rpl_opt_solicited_flag_i,
5117 { "InstanceID predicate","icmpv6.rpl.opt.solicited.flag.i", FT_BOOLEAN, 8, TFS(&tfs_true_false), RPL_OPT_SOLICITED_FLAG_I,
5118 "The InstanceID predicate is true when the RPL node's current RPLInstanceID matches the requested RPLInstanceID", HFILL }},
5119 { &hf_icmpv6_rpl_opt_solicited_flag_d,
5120 { "DODAGID predicate", "icmpv6.rpl.opt.solicited.flag.d", FT_BOOLEAN, 8, TFS(&tfs_true_false), RPL_OPT_SOLICITED_FLAG_D,
5121 "The DODAGID predicate is true if the RPL node's parent set has the same DODAGID as the DODAGID field", HFILL }},
5122 { &hf_icmpv6_rpl_opt_solicited_flag_rsv,
5123 { "Reserved", "icmpv6.rpl.opt.solicited.flag.rsv", FT_UINT8, BASE_DEC, NULL, RPL_OPT_SOLICITED_FLAG_RSV,
5124 "Must be Zero", HFILL }},
5125 { &hf_icmpv6_rpl_opt_solicited_dodagid,
5126 { "DODAGID", "icmpv6.rpl.opt.solicited.dodagid", FT_IPv6, BASE_NONE, NULL, 0x0,
5127 "the DODAGID that is being solicited when valid", HFILL }},
5128 { &hf_icmpv6_rpl_opt_solicited_version,
5129 { "Version", "icmpv6.rpl.opt.solicited.version", FT_UINT8, BASE_DEC, NULL, 0x0,
5130 "the value of DODAGVersionNumber that is being solicited when valid", HFILL }},
5132 { &hf_icmpv6_rpl_opt_prefix_length,
5133 { "Prefix Length", "icmpv6.rpl.opt.prefix.length", FT_UINT8, BASE_DEC, NULL, 0x0,
5134 "The number of leading bits in the Prefix that are valid", HFILL }},
5135 { &hf_icmpv6_rpl_opt_prefix_flag,
5136 { "Flag", "icmpv6.rpl.opt.prefix.flag", FT_UINT8, BASE_HEX, NULL, 0x0,
5138 { &hf_icmpv6_rpl_opt_prefix_flag_l,
5139 { "On Link", "icmpv6.rpl.opt.prefix.flag.l", FT_BOOLEAN, 8, TFS(&tfs_set_notset), RPL_OPT_PREFIX_FLAG_L,
5140 "When set, indicates that this prefix can be used for on-link determination", HFILL }},
5141 { &hf_icmpv6_rpl_opt_prefix_flag_a,
5142 { "Auto Address Config","icmpv6.rpl.opt.config.flag.a", FT_BOOLEAN, 8, TFS(&tfs_set_notset), RPL_OPT_PREFIX_FLAG_A,
5143 "When set indicates that this prefix can be used for stateless address configuration", HFILL }},
5144 { &hf_icmpv6_rpl_opt_prefix_flag_r,
5145 { "Router Address", "icmpv6.rpl.opt.config.flag.r", FT_BOOLEAN, 8, TFS(&tfs_set_notset), RPL_OPT_PREFIX_FLAG_R,
5146 "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 }},
5147 { &hf_icmpv6_rpl_opt_prefix_flag_rsv,
5148 { "Reserved", "icmpv6.rpl.opt.config.flag.rsv", FT_UINT8, BASE_DEC, NULL, RPL_OPT_PREFIX_FLAG_RSV,
5149 "Must Be Zero", HFILL }},
5150 { &hf_icmpv6_rpl_opt_prefix_vlifetime,
5151 { "Valid Lifetime", "icmpv6.rpl.opt.prefix.valid_lifetime", FT_UINT32, BASE_DEC, NULL, 0x0,
5152 "The length of time in seconds that the prefix is valid for the purpose of on-link determination", HFILL }},
5153 { &hf_icmpv6_rpl_opt_prefix_plifetime,
5154 { "Preferred Lifetime", "icmpv6.rpl.opt.prefix.preferred_lifetime", FT_UINT32, BASE_DEC, NULL, 0x0,
5155 "The length of time in seconds that addresses generated from the prefix via stateless address autoconfiguration remain preferred", HFILL }},
5156 { &hf_icmpv6_rpl_opt_prefix,
5157 { "Destination Prefix", "icmpv6.rpl.opt.prefix", FT_IPv6, BASE_NONE, NULL, 0x0,
5158 "An IPv6 address or a prefix of an IPv6 address", HFILL }},
5159 { &hf_icmpv6_rpl_opt_targetdesc,
5160 { "Descriptor", "icmpv6.rpl.opt.targetdesc.descriptor", FT_UINT32, BASE_HEX, NULL, 0x0,
5161 "Opaque Data", HFILL }},
5163 { &hf_icmpv6_rpl_opt_route_discovery_flag,
5164 { "Flags", "icmpv6.rpl.opt.routediscovery.flag", FT_NONE, BASE_NONE, NULL, 0x0,
5166 { &hf_icmpv6_rpl_opt_route_discovery_reply,
5167 { "Reply", "icmpv6.rpl.opt.routediscovery.flag.reply", FT_BOOLEAN, 8, TFS(&tfs_yes_no), RPL_OPT_ROUTE_DISCOVERY_R,
5168 "The Origin sets this flag to one to allow the Target(s) to send P2P-DRO messages back to the Origin", HFILL }},
5169 { &hf_icmpv6_rpl_opt_route_discovery_hop_by_hop,
5170 { "Hop-by-Hop", "icmpv6.rpl.opt.routediscovery.flag.hopbyhop", FT_BOOLEAN, 8, TFS(&tfs_yes_no), RPL_OPT_ROUTE_DISCOVERY_H,
5171 "The Origin sets this flag to one if it desires Hop-by-hop Routes and to zero if it desires Source Routes.", HFILL }},
5172 { &hf_icmpv6_rpl_opt_route_discovery_num_of_routes,
5173 { "Number of Routes", "icmpv6.rpl.opt.routediscovery.flag.numofroutes", FT_UINT8, BASE_DEC, NULL, RPL_OPT_ROUTE_DISCOVERY_N,
5174 "This value plus one indicates the number of Source Routes that each Target should convey to the Origin", HFILL }},
5175 { &hf_icmpv6_rpl_opt_route_discovery_compr,
5176 { "Compr", "icmpv6.rpl.opt.routediscovery.flag.compr", FT_UINT8, BASE_DEC, NULL, RPL_OPT_ROUTE_DISCOVERY_COMPR,
5177 "Number of prefix octets that are elided from the Target field and Address vector", HFILL }},
5178 { &hf_icmpv6_rpl_opt_route_discovery_lifetime,
5179 { "Lifetime", "icmpv6.rpl.opt.routediscovery.lifetime", FT_UINT8, BASE_DEC, NULL, RPL_OPT_ROUTE_DISCOVERY_L,
5180 "Lifetime of the temporary DODAG", HFILL }},
5181 { &hf_icmpv6_rpl_opt_route_discovery_maxrank,
5182 { "MaxRank", "icmpv6.rpl.opt.routediscovery.maxrank", FT_UINT8, BASE_DEC, NULL, RPL_OPT_ROUTE_DISCOVERY_MR_NH,
5183 "Upper limit of the integer portion of the rank when used inside a DIO", HFILL }},
5184 { &hf_icmpv6_rpl_opt_route_discovery_nh,
5185 { "NH", "icmpv6.rpl.opt.routediscovery.nh", FT_UINT8, BASE_DEC, NULL, RPL_OPT_ROUTE_DISCOVERY_MR_NH,
5186 "Index of the next-hop (NH) address inside the Address vector", HFILL }},
5187 { &hf_icmpv6_rpl_opt_route_discovery_target_addr,
5188 { "Target Address", "icmpv6.rpl.opt.routediscovery.targetaddr", FT_IPv6, BASE_NONE, NULL, 0x0,
5189 "An IPv6 address of the Target after eliding Compr number of prefix octets", HFILL }},
5190 { &hf_icmpv6_rpl_opt_route_discovery_addr_vec,
5191 { "Address Vector", "icmpv6.rpl.opt.routediscovery.addr_vec", FT_NONE, BASE_NONE, NULL, 0x0,
5193 { &hf_icmpv6_rpl_opt_route_discovery_addr_vec_addr,
5194 { "Address", "icmpv6.rpl.opt.routediscovery.addrvec.addr", FT_IPv6, BASE_NONE, NULL, 0x0,
5196 { &hf_icmpv6_rpl_p2p_dro_instance,
5197 { "RPLInstanceID", "icmpv6.rpl.p2p.dro.instance", FT_UINT8, BASE_DEC, NULL, 0x0,
5198 "Set by the DODAG root that indicates which RPL Instance the DODAG is part of", HFILL }},
5199 { &hf_icmpv6_rpl_p2p_dro_version,
5200 { "Version", "icmpv6.rpl.p2p.dro.version", FT_UINT8, BASE_DEC, NULL, 0x0,
5201 "Set by the DODAG root to the DODAGVersionNumber", HFILL }},
5202 { &hf_icmpv6_rpl_p2p_dro_flag,
5203 { "Flags", "icmpv6.rpl.p2p.dro.flag", FT_NONE, BASE_NONE, NULL, 0x0,
5205 { &hf_icmpv6_rpl_p2p_dro_flag_stop,
5206 { "Stop", "icmpv6.rpl.p2p.dro.flag.stop", FT_BOOLEAN, 16, TFS(&tfs_yes_no), RPL_P2P_DRO_FLAG_S,
5207 "Indicates that the P2P-RPL route discovery is over", HFILL }},
5208 { &hf_icmpv6_rpl_p2p_dro_flag_ack,
5209 { "Ack", "icmpv6.rpl.p2p.dro.flag.ack", FT_BOOLEAN, 16, TFS(&tfs_yes_no), RPL_P2P_DRO_FLAG_A,
5210 "Indicates that the Origin MUST unicast a P2P-DRO-ACK message to the Target", HFILL }},
5211 { &hf_icmpv6_rpl_p2p_dro_flag_seq,
5212 { "Seq", "icmpv6.rpl.p2p.dro.flag.seq", FT_UINT16, BASE_DEC, NULL, RPL_P2P_DRO_FLAG_SEQ,
5213 "Indicates the sequence number for the P2P-DRO", HFILL }},
5214 { &hf_icmpv6_rpl_p2p_dro_flag_reserved,
5215 { "Reserved", "icmpv6.rpl.p2p.dro.flag.reserved", FT_UINT16, BASE_DEC, NULL, RPL_P2P_DRO_FLAG_RSV,
5217 { &hf_icmpv6_rpl_p2p_dro_dagid,
5218 { "DODAGID", "icmpv6.rpl.p2p.dro.dagid", FT_IPv6, BASE_NONE, NULL, 0x0,
5219 "IPv6 address set by a DODAG root which uniquely identifies a DODAG", HFILL }},
5220 { &hf_icmpv6_rpl_p2p_droack_flag,
5221 { "Flags", "icmpv6.rpl.p2p.droack.flag", FT_NONE, BASE_NONE, NULL, 0x0,
5223 { &hf_icmpv6_rpl_p2p_droack_flag_seq,
5224 { "Seq", "icmpv6.rpl.p2p.droack.flag.seq", FT_UINT16, BASE_DEC, NULL, RPL_P2P_DROACK_FLAG_SEQ,
5225 "Indicates the sequence number for the P2P-DRO", HFILL }},
5226 { &hf_icmpv6_rpl_p2p_droack_flag_reserved,
5227 { "Reserved", "icmpv6.rpl.p2p.droack.flag.reserved", FT_UINT16, BASE_DEC, NULL, RPL_P2P_DROACK_FLAG_RSV,
5230 /* RFC6743 Locator Update (156) */
5232 { &hf_icmpv6_ilnp_nb_locs,
5233 { "Num of Locs", "icmpv6.ilnp.nb_locs", FT_UINT8, BASE_DEC, NULL, 0x0,
5234 "The number of 64-bit Locator values that are advertised in this message", HFILL }},
5235 { &hf_icmpv6_ilnp_locator,
5236 { "Locator", "icmpv6.ilnp.nb_locs", FT_UINT64, BASE_HEX, NULL, 0x0,
5237 "The 64-bit Locator values currently valid for the sending ILNPv6 node", HFILL }},
5238 { &hf_icmpv6_ilnp_preference,
5239 { "Preference", "icmpv6.ilnp.nb_locs", FT_UINT32, BASE_DEC, NULL, 0x0,
5240 "The preferability of each Locator relative to other valid Locator values", HFILL }},
5241 { &hf_icmpv6_ilnp_lifetime,
5242 { "Lifetime", "icmpv6.ilnp.nb_locs", FT_UINT32, BASE_DEC, NULL, 0x0,
5243 "The maximum number of seconds that this particular Locator may be considered valid", HFILL }},
5245 /* 6lowpan-nd: Neighbour Discovery for 6LoWPAN Networks */
5246 { &hf_icmpv6_da_status,
5247 { "Status", "icmpv6.6lowpannd.da.status", FT_UINT8, BASE_DEC, VALS(nd_opt_6lowpannd_status_val), 0x0,
5248 "Indicates the status of a registration in the DAC", HFILL }},
5249 { &hf_icmpv6_da_rsv,
5250 { "Reserved", "icmpv6.6lowpannd.da.rsv", FT_UINT8, BASE_DEC, NULL, 0x0,
5251 "Must be Zero", HFILL }},
5252 { &hf_icmpv6_da_lifetime,
5253 { "Lifetime", "icmpv6.6lowpannd.da.lifetime", FT_UINT16, BASE_DEC, NULL, 0x0,
5254 "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 }},
5255 { &hf_icmpv6_da_eui64,
5256 { "EUI-64", "icmpv6.6lowpannd.da.eui64", FT_EUI64, BASE_NONE, NULL, 0x0,
5257 "This field is used to uniquely identify the interface of the registered address by including the EUI-64 identifier", HFILL }},
5258 { &hf_icmpv6_da_raddr,
5259 { "Registered Address", "icmpv6.6lowpannd.da.reg_addr", FT_IPv6, BASE_NONE, NULL, 0x0,
5260 "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 }},
5262 /* Conversation-related [generated] header fields */
5263 { &hf_icmpv6_resp_in,
5264 { "Response In", "icmpv6.resp_in", FT_FRAMENUM, BASE_NONE, NULL, 0x0,
5265 "The response to this request is in this frame", HFILL }},
5266 {&hf_icmpv6_no_resp,
5267 {"No response seen", "icmpv6.no_resp", FT_NONE, BASE_NONE, NULL, 0x0,
5268 "No corresponding response frame was seen", HFILL}},
5269 { &hf_icmpv6_resp_to,
5270 { "Response To", "icmpv6.resp_to", FT_FRAMENUM, BASE_NONE, NULL, 0x0,
5271 "This is the response to the request in this frame", HFILL }},
5272 { &hf_icmpv6_resptime,
5273 { "Response Time", "icmpv6.resptime", FT_DOUBLE, BASE_NONE, NULL, 0x0,
5274 "The time between the request and the response, in ms.", HFILL }}
5277 static gint *ett[] = {
5281 &ett_icmpv6_flag_prefix,
5282 &ett_icmpv6_flag_map,
5283 &ett_icmpv6_flag_route_info,
5284 &ett_icmpv6_flag_6lowpan,
5285 &ett_icmpv6_flag_efo,
5286 &ett_icmpv6_rpl_opt,
5287 &ett_icmpv6_rpl_flag_routing,
5288 &ett_icmpv6_rpl_flag_config,
5289 &ett_icmpv6_rpl_flag_transit,
5290 &ett_icmpv6_rpl_flag_solicited,
5291 &ett_icmpv6_rpl_flag_prefix,
5292 &ett_icmpv6_rpl_route_discovery_flag,
5293 &ett_icmpv6_rpl_route_discovery_addr_vec,
5294 &ett_icmpv6_rpl_p2p_dro_flag,
5295 &ett_icmpv6_rpl_p2p_droack_flag,
5296 &ett_icmpv6_flag_ni,
5297 &ett_icmpv6_flag_rr,
5300 &ett_icmpv6_rr_up_flag_mask,
5301 &ett_icmpv6_rr_up_flag_ra,
5302 &ett_icmpv6_rr_up_flag,
5304 &ett_icmpv6_rr_rm_flag,
5305 &ett_icmpv6_flag_mld,
5306 &ett_icmpv6_flag_ra,
5307 &ett_icmpv6_flag_na,
5308 &ett_icmpv6_flag_mip6,
5309 &ett_icmpv6_flag_fmip6,
5310 &ett_icmpv6_flag_secure,
5311 &ett_icmpv6_flag_rpl_dio,
5312 &ett_icmpv6_flag_rpl_dao,
5313 &ett_icmpv6_flag_rpl_daoack,
5314 &ett_icmpv6_flag_rpl_cc,
5315 &ett_icmpv6_opt_name,
5316 &ett_icmpv6_cga_param_name
5319 static ei_register_info ei[] = {
5320 { &ei_icmpv6_invalid_option_length, { "icmpv6.invalid_option_length", PI_MALFORMED, PI_ERROR, "Invalid Option Length", EXPFILL }},
5321 { &ei_icmpv6_undecoded_option, { "icmpv6.undecoded.option", PI_UNDECODED, PI_NOTE, "Undecoded option", EXPFILL }},
5322 { &ei_icmpv6_unknown_data, { "icmpv6.unknown_data.expert", PI_MALFORMED, PI_ERROR, "Unknown Data (not interpreted)", EXPFILL }},
5323 { &ei_icmpv6_undecoded_rpl_option, { "icmpv6.undecoded.rpl_option", PI_UNDECODED, PI_NOTE, "Undecoded RPL Option", EXPFILL }},
5324 { &ei_icmpv6_undecoded_type, { "icmpv6.undecoded.type", PI_UNDECODED, PI_NOTE, "Undecoded type", EXPFILL }},
5325 { &ei_icmpv6_rr_pco_mp_matchlen, { "icmpv6.rr.pco.mp.matchlen.gt128", PI_PROTOCOL, PI_WARN, "MatchLen is greater than 128", EXPFILL }},
5326 { &ei_icmpv6_rr_pco_mp_matchedlen, { "icmpv6.rr.pco.mp.matchedlen.gt128", PI_PROTOCOL, PI_WARN, "MatchedLen is greater than 128", EXPFILL }},
5327 { &ei_icmpv6_checksum, { "icmpv6.checksum_bad.expert", PI_CHECKSUM, PI_WARN, "Bad checksum", EXPFILL }},
5328 { &ei_icmpv6_resp_not_found, { "icmpv6.resp_not_found", PI_SEQUENCE, PI_WARN, "Response not found", EXPFILL }},
5329 { &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 }},
5330 { &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 }},
5331 { &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 }},
5332 { &ei_icmpv6_rpl_p2p_dro_zero, { "icmpv6.rpl.p2p.dro.zero", PI_PROTOCOL, PI_WARN, "This field MUST be set to zero", EXPFILL }},
5335 expert_module_t* expert_icmpv6;
5337 proto_icmpv6 = proto_register_protocol("Internet Control Message Protocol v6",
5338 "ICMPv6", "icmpv6");
5339 proto_register_field_array(proto_icmpv6, hf, array_length(hf));
5340 proto_register_subtree_array(ett, array_length(ett));
5341 expert_icmpv6 = expert_register_protocol(proto_icmpv6);
5342 expert_register_field_array(expert_icmpv6, ei, array_length(ei));
5344 icmpv6_handle = new_register_dissector("icmpv6", dissect_icmpv6, proto_icmpv6);
5346 icmpv6_tap = register_tap("icmpv6");
5350 proto_reg_handoff_icmpv6(void)
5352 dissector_add_uint("ip.proto", IP_PROTO_ICMPV6, icmpv6_handle);
5355 * Get a handle for the IPv6 dissector.
5357 ipv6_handle = find_dissector("ipv6");
5358 data_handle = find_dissector("data");
5362 * Editor modelines - http://www.wireshark.org/tools/modelines.html
5367 * indent-tabs-mode: nil
5370 * vi: set shiftwidth=4 tabstop=8 expandtab:
5371 * :indentSize=4:tabSize=8:noTabs=true: