/src/wireshark/epan/dissectors/packet-ipv6.c
Line | Count | Source |
1 | | /* packet-ipv6.c |
2 | | * Routines for IPv6 packet disassembly |
3 | | * |
4 | | * Wireshark - Network traffic analyzer |
5 | | * By Gerald Combs <gerald@wireshark.org> |
6 | | * Copyright 1998 Gerald Combs |
7 | | * |
8 | | * SHIM6 support added by Matthijs Mekking <matthijs@NLnetLabs.nl> |
9 | | * |
10 | | * MobileIPv6 support added by Tomislav Borosa <tomislav.borosa@siemens.hr> |
11 | | * |
12 | | * Added support for new IPv6 Hop by Hop PMTU Option <bob.hinden@gmail.com> |
13 | | * |
14 | | * SPDX-License-Identifier: GPL-2.0-or-later |
15 | | */ |
16 | | |
17 | | #include "config.h" |
18 | | |
19 | | #include <math.h> |
20 | | #include <epan/packet.h> |
21 | | #include <epan/capture_dissectors.h> |
22 | | #include <epan/expert.h> |
23 | | #include <epan/ip_opts.h> |
24 | | #include <epan/addr_resolv.h> |
25 | | #include <epan/maxmind_db.h> |
26 | | #include <epan/prefs.h> |
27 | | #include <epan/uat.h> |
28 | | #include <epan/conversation_table.h> |
29 | | #include <epan/conversation_filter.h> |
30 | | #include <epan/reassemble.h> |
31 | | #include <epan/etypes.h> |
32 | | #include <epan/aftypes.h> |
33 | | #include <epan/decode_as.h> |
34 | | #include <epan/proto_data.h> |
35 | | #include <epan/to_str.h> |
36 | | #include <epan/exported_pdu.h> |
37 | | #include <epan/exceptions.h> |
38 | | #include <epan/iana-ip.h> |
39 | | #include <epan/tfs.h> |
40 | | #include <epan/unit_strings.h> |
41 | | |
42 | | #include <wiretap/erf_record.h> |
43 | | #include "packet-iana-data.h" |
44 | | #include "packet-ip.h" |
45 | | #include "packet-juniper.h" |
46 | | #include "packet-sflow.h" |
47 | | #include "packet-vxlan.h" |
48 | | #include "packet-mpls.h" |
49 | | #include "packet-nsh.h" |
50 | | #include "packet-osi.h" |
51 | | #include "packet-ppp.h" |
52 | | #include "packet-arcnet.h" |
53 | | |
54 | | |
55 | | void proto_register_ipv6(void); |
56 | | void proto_reg_handoff_ipv6(void); |
57 | | |
58 | | /* Offsets of fields within an IPv6 header. */ |
59 | 160k | #define IP6H_CTL_VFC 0 |
60 | 22.9k | #define IP6H_CTL_FLOW 0 |
61 | 45.8k | #define IP6H_CTL_PLEN 4 |
62 | 45.8k | #define IP6H_CTL_NXT 6 |
63 | 45.8k | #define IP6H_CTL_HLIM 7 |
64 | 135k | #define IP6H_SRC 8 |
65 | 135k | #define IP6H_DST 24 |
66 | | |
67 | | /* Option types and related macros */ |
68 | 35.8k | #define IP6OPT_PAD1 0x00 /* 00 0 00000 = 0 */ |
69 | 8.41k | #define IP6OPT_PADN 0x01 /* 00 0 00001 = 1 */ |
70 | 363 | #define IP6OPT_TEL 0x04 /* 00 0 00100 = 4 */ |
71 | 249 | #define IP6OPT_RTALERT 0x05 /* 00 0 00101 = 5 */ |
72 | 53 | #define IP6OPT_CALIPSO 0x07 /* 00 0 00111 = 7 */ |
73 | 392 | #define IP6OPT_SMF_DPD 0x08 /* 00 0 01000 = 8 */ |
74 | 110 | #define IP6OPT_PDM 0x0F /* 00 0 01111 = 15 */ |
75 | 164 | #define IP6OPT_APN6 0x13 /* 00 0 10011 = 19 */ |
76 | 32 | #define IP6OPT_EXP_1E 0x1E /* 00 0 11110 = 30 */ |
77 | 224 | #define IP6OPT_RPL 0x23 /* 00 1 00011 = 35 */ |
78 | 399 | #define IP6OPT_QUICKSTART 0x26 /* 00 1 00110 = 38 */ |
79 | 336 | #define IP6OPT_PMTU 0x30 /* 00 1 10000 = 48 */ |
80 | 588 | #define IP6OPT_IOAM 0x31 /* 00 1 10001 = 49 */ |
81 | 67 | #define IP6OPT_EXP_3E 0x3E /* 00 1 11110 = 62 */ |
82 | 126 | #define IP6OPT_TPF 0x41 /* 01 0 00001 = 65 */ |
83 | 98 | #define IP6OPT_EXP_5E 0x5E /* 01 0 11110 = 94 */ |
84 | 407 | #define IP6OPT_RPL_OLD 0x63 /* 01 1 00011 = 99 */ /* DEPRECATED */ |
85 | 158 | #define IP6OPT_MPL 0x6D /* 01 1 01101 = 109 */ |
86 | 132 | #define IP6OPT_EXP_7E 0x7E /* 01 1 11110 = 126 */ |
87 | 18 | #define IP6OPT_ENDI 0x8A /* 10 0 01010 = 138 */ /* DEPRECATED */ |
88 | 50 | #define IP6OPT_ILNP_NONCE 0x8B /* 10 0 01011 = 139 */ |
89 | 72 | #define IP6OPT_LIO 0x8C /* 10 0 01100 = 140 */ |
90 | 167 | #define IP6OPT_EXP_9E 0x9E /* 10 0 11110 = 158 */ |
91 | 204 | #define IP6OPT_EXP_BE 0xBE /* 10 1 11110 = 190 */ |
92 | 1.04k | #define IP6OPT_JUMBO 0xC2 /* 11 0 00010 = 194 */ |
93 | 40 | #define IP6OPT_HOME_ADDRESS 0xC9 /* 11 0 01001 = 201 */ |
94 | 227 | #define IP6OPT_EXP_DE 0xDE /* 11 0 11110 = 222 */ |
95 | 77 | #define IP6OPT_IP_DFF 0xEE /* 11 1 01110 = 238 */ |
96 | 265 | #define IP6OPT_EXP_FE 0xFE /* 11 1 11110 = 254 */ |
97 | | |
98 | | #define IP6OPT_RTALERT_MLD 0 /* Datagram contains MLD msg */ |
99 | | #define IP6OPT_RTALERT_RSVP 1 /* Datagram contains RSVP msg */ |
100 | | #define IP6OPT_RTALERT_ACTNET 2 /* Datagram contains ACTNET msg */ |
101 | | |
102 | | /* RPL Routing header */ |
103 | 14 | #define IP6RRPL_BITMASK_CMPRI 0xF0000000 |
104 | 14 | #define IP6RRPL_BITMASK_CMPRE 0x0F000000 |
105 | 14 | #define IP6RRPL_BITMASK_PAD 0x00F00000 |
106 | 14 | #define IP6RRPL_BITMASK_RESERVED 0x000FFFFF |
107 | | |
108 | | /* IOAM Option-Types */ |
109 | 211 | #define IP6IOAM_PRE_TRACE 0 /* Pre-allocated Trace */ |
110 | 258 | #define IP6IOAM_INC_TRACE 1 /* Incremental Trace */ |
111 | 0 | #define IP6IOAM_POT 2 /* Proof of Transit */ |
112 | 1 | #define IP6IOAM_E2E 3 /* Edge to Edge */ |
113 | 63 | #define IP6IOAM_DEX 4 /* Direct Export */ |
114 | | |
115 | | /* IOAM Trace Types */ |
116 | 487 | #define IP6IOAM_TRACE_MASK_BIT0 (1 << 23) /* Hop_lim + Node ID */ |
117 | 487 | #define IP6IOAM_TRACE_MASK_BIT1 (1 << 22) /* Ingress and Egress IDs */ |
118 | 487 | #define IP6IOAM_TRACE_MASK_BIT2 (1 << 21) /* Timestamp seconds */ |
119 | 487 | #define IP6IOAM_TRACE_MASK_BIT3 (1 << 20) /* Timestamp fraction */ |
120 | 487 | #define IP6IOAM_TRACE_MASK_BIT4 (1 << 19) /* Transit delay */ |
121 | 487 | #define IP6IOAM_TRACE_MASK_BIT5 (1 << 18) /* IOAM-Namespace data */ |
122 | 487 | #define IP6IOAM_TRACE_MASK_BIT6 (1 << 17) /* Queue depth */ |
123 | 487 | #define IP6IOAM_TRACE_MASK_BIT7 (1 << 16) /* Checksum complement */ |
124 | 487 | #define IP6IOAM_TRACE_MASK_BIT8 (1 << 15) /* (wide) Hop_lim + Node ID */ |
125 | 487 | #define IP6IOAM_TRACE_MASK_BIT9 (1 << 14) /* (wide) Ingress and Egress IDs */ |
126 | 487 | #define IP6IOAM_TRACE_MASK_BIT10 (1 << 13) /* (wide) IOAM-Namespace data */ |
127 | 487 | #define IP6IOAM_TRACE_MASK_BIT11 (1 << 12) /* Buffer occupancy */ |
128 | 487 | #define IP6IOAM_TRACE_MASK_BIT12 (1 << 11) /* Undefined */ |
129 | 487 | #define IP6IOAM_TRACE_MASK_BIT13 (1 << 10) /* Undefined */ |
130 | 487 | #define IP6IOAM_TRACE_MASK_BIT14 (1 << 9) /* Undefined */ |
131 | 487 | #define IP6IOAM_TRACE_MASK_BIT15 (1 << 8) /* Undefined */ |
132 | 487 | #define IP6IOAM_TRACE_MASK_BIT16 (1 << 7) /* Undefined */ |
133 | 487 | #define IP6IOAM_TRACE_MASK_BIT17 (1 << 6) /* Undefined */ |
134 | 487 | #define IP6IOAM_TRACE_MASK_BIT18 (1 << 5) /* Undefined */ |
135 | 487 | #define IP6IOAM_TRACE_MASK_BIT19 (1 << 4) /* Undefined */ |
136 | 487 | #define IP6IOAM_TRACE_MASK_BIT20 (1 << 3) /* Undefined */ |
137 | 487 | #define IP6IOAM_TRACE_MASK_BIT21 (1 << 2) /* Undefined */ |
138 | 542 | #define IP6IOAM_TRACE_MASK_BIT22 (1 << 1) /* Opaque state snapshot */ |
139 | | |
140 | | /* Protocol specific data indices */ |
141 | 25.0k | #define IPV6_PROTO_VALUE 1 |
142 | 56.9k | #define IPV6_PROTO_PINFO 2 |
143 | | |
144 | | static int ipv6_tap; |
145 | | |
146 | | static int exported_pdu_tap; |
147 | | |
148 | | static int proto_ipv6; |
149 | | static int proto_ipv6_hopopts; |
150 | | static int proto_ipv6_routing; |
151 | | static int proto_ipv6_fraghdr; |
152 | | static int proto_ipv6_dstopts; |
153 | | |
154 | | static int proto_ipv6_routing_rt0; |
155 | | static int proto_ipv6_routing_mipv6; |
156 | | static int proto_ipv6_routing_rpl; |
157 | | static int proto_ipv6_routing_srh; |
158 | | static int proto_ipv6_routing_crh; |
159 | | |
160 | | static int hf_ipv6_version; |
161 | | static int hf_ip_version; |
162 | | static int hf_ipv6_tclass; |
163 | | static int hf_ipv6_tclass_dscp; |
164 | | static int hf_ipv6_tclass_ecn; |
165 | | static int hf_ipv6_flow; |
166 | | static int hf_ipv6_stream; |
167 | | static int hf_ipv6_plen; |
168 | | static int hf_ipv6_nxt; |
169 | | static int hf_ipv6_hlim; |
170 | | static int hf_ipv6_src; |
171 | | static int hf_ipv6_src_addr_space; |
172 | | static int hf_ipv6_src_multicast_flags; |
173 | | static int hf_ipv6_src_multicast_flags_reserved; |
174 | | static int hf_ipv6_src_multicast_flags_transient; |
175 | | static int hf_ipv6_src_multicast_flags_network_prefix; |
176 | | static int hf_ipv6_src_multicast_flags_embed_rp; |
177 | | static int hf_ipv6_src_special_purpose; |
178 | | static int hf_ipv6_src_special_purpose_source; |
179 | | static int hf_ipv6_src_special_purpose_destination; |
180 | | static int hf_ipv6_src_special_purpose_forwardable; |
181 | | static int hf_ipv6_src_special_purpose_global; |
182 | | static int hf_ipv6_src_special_purpose_reserved; |
183 | | static int hf_ipv6_src_multicast_scope; |
184 | | static int hf_ipv6_src_host; |
185 | | static int hf_ipv6_src_slaac_mac; |
186 | | static int hf_ipv6_src_isatap_ipv4; |
187 | | static int hf_ipv6_src_6to4_gateway_ipv4; |
188 | | static int hf_ipv6_src_6to4_sla_id; |
189 | | static int hf_ipv6_src_teredo_server_ipv4; |
190 | | static int hf_ipv6_src_teredo_port; |
191 | | static int hf_ipv6_src_teredo_client_ipv4; |
192 | | static int hf_ipv6_src_embed_ipv4; |
193 | | static int hf_ipv6_dst; |
194 | | static int hf_ipv6_dst_addr_space; |
195 | | static int hf_ipv6_dst_multicast_flags; |
196 | | static int hf_ipv6_dst_multicast_flags_reserved; |
197 | | static int hf_ipv6_dst_multicast_flags_transient; |
198 | | static int hf_ipv6_dst_multicast_flags_network_prefix; |
199 | | static int hf_ipv6_dst_multicast_flags_embed_rp; |
200 | | static int hf_ipv6_dst_multicast_scope; |
201 | | static int hf_ipv6_dst_special_purpose; |
202 | | static int hf_ipv6_dst_special_purpose_source; |
203 | | static int hf_ipv6_dst_special_purpose_destination; |
204 | | static int hf_ipv6_dst_special_purpose_forwardable; |
205 | | static int hf_ipv6_dst_special_purpose_global; |
206 | | static int hf_ipv6_dst_special_purpose_reserved; |
207 | | static int hf_ipv6_dst_host; |
208 | | static int hf_ipv6_dst_slaac_mac; |
209 | | static int hf_ipv6_dst_isatap_ipv4; |
210 | | static int hf_ipv6_dst_6to4_gateway_ipv4; |
211 | | static int hf_ipv6_dst_6to4_sla_id; |
212 | | static int hf_ipv6_dst_teredo_server_ipv4; |
213 | | static int hf_ipv6_dst_teredo_port; |
214 | | static int hf_ipv6_dst_teredo_client_ipv4; |
215 | | static int hf_ipv6_dst_embed_ipv4; |
216 | | static int hf_ipv6_addr; |
217 | | static int hf_ipv6_addr_space; |
218 | | static int hf_ipv6_multicast_flags; |
219 | | static int hf_ipv6_multicast_flags_reserved; |
220 | | static int hf_ipv6_multicast_flags_transient; |
221 | | static int hf_ipv6_multicast_flags_network_prefix; |
222 | | static int hf_ipv6_multicast_flags_embed_rp; |
223 | | static int hf_ipv6_multicast_scope; |
224 | | static int hf_ipv6_addr_special_purpose; |
225 | | static int hf_ipv6_addr_special_purpose_source; |
226 | | static int hf_ipv6_addr_special_purpose_destination; |
227 | | static int hf_ipv6_addr_special_purpose_forwardable; |
228 | | static int hf_ipv6_addr_special_purpose_global; |
229 | | static int hf_ipv6_addr_special_purpose_reserved; |
230 | | static int hf_ipv6_host; |
231 | | static int hf_ipv6_slaac_mac; |
232 | | static int hf_ipv6_isatap_ipv4; |
233 | | static int hf_ipv6_6to4_gateway_ipv4; |
234 | | static int hf_ipv6_6to4_sla_id; |
235 | | static int hf_ipv6_teredo_server_ipv4; |
236 | | static int hf_ipv6_teredo_port; |
237 | | static int hf_ipv6_teredo_client_ipv4; |
238 | | static int hf_ipv6_embed_ipv4_prefix; |
239 | | static int hf_ipv6_embed_ipv4; |
240 | | static int hf_ipv6_embed_ipv4_u; |
241 | | static int hf_ipv6_embed_ipv4_suffix; |
242 | | static int hf_ipv6_opt; |
243 | | static int hf_ipv6_opt_type; |
244 | | static int hf_ipv6_opt_type_action; |
245 | | static int hf_ipv6_opt_type_change; |
246 | | static int hf_ipv6_opt_type_rest; |
247 | | static int hf_ipv6_opt_length; |
248 | | static int hf_ipv6_opt_pad1; |
249 | | static int hf_ipv6_opt_padn; |
250 | | static int hf_ipv6_opt_tel; |
251 | | static int hf_ipv6_opt_rtalert; |
252 | | static int hf_ipv6_opt_pmtu_min; |
253 | | static int hf_ipv6_opt_pmtu_rtn; |
254 | | static int hf_ipv6_opt_pmtu_rtn_flag; |
255 | | static int hf_ipv6_opt_apn_id_type; |
256 | | static int hf_ipv6_opt_apn_flags; |
257 | | static int hf_ipv6_opt_apn_param_type; |
258 | | static int hf_ipv6_opt_apn_id_part1; |
259 | | static int hf_ipv6_opt_apn_id_part2; |
260 | | static int hf_ipv6_opt_apn_id_part3; |
261 | | static int hf_ipv6_opt_apn_id_part4; |
262 | | static int hf_ipv6_opt_jumbo; |
263 | | static int hf_ipv6_opt_calipso_doi; |
264 | | static int hf_ipv6_opt_calipso_cmpt_length; |
265 | | static int hf_ipv6_opt_calipso_sens_level; |
266 | | static int hf_ipv6_opt_calipso_checksum; |
267 | | static int hf_ipv6_opt_calipso_cmpt_bitmap; |
268 | | static int hf_ipv6_opt_smf_dpd_hash_bit; |
269 | | static int hf_ipv6_opt_smf_dpd_tid_type; |
270 | | static int hf_ipv6_opt_smf_dpd_tid_len; |
271 | | static int hf_ipv6_opt_smf_dpd_tagger_id; |
272 | | static int hf_ipv6_opt_smf_dpd_ident; |
273 | | static int hf_ipv6_opt_smf_dpd_hav; |
274 | | static int hf_ipv6_opt_pdm_scale_dtlr; |
275 | | static int hf_ipv6_opt_pdm_scale_dtls; |
276 | | static int hf_ipv6_opt_pdm_psn_this_pkt; |
277 | | static int hf_ipv6_opt_pdm_psn_last_recv; |
278 | | static int hf_ipv6_opt_pdm_delta_last_recv; |
279 | | static int hf_ipv6_opt_pdm_delta_last_sent; |
280 | | static int hf_ipv6_opt_qs_func; |
281 | | static int hf_ipv6_opt_qs_rate; |
282 | | static int hf_ipv6_opt_qs_ttl; |
283 | | static int hf_ipv6_opt_qs_ttl_diff; |
284 | | static int hf_ipv6_opt_qs_unused; |
285 | | static int hf_ipv6_opt_qs_nonce; |
286 | | static int hf_ipv6_opt_qs_reserved; |
287 | | static int hf_ipv6_opt_ioam_rsv; |
288 | | static int hf_ipv6_opt_ioam_opt_type; |
289 | | static int hf_ipv6_opt_ioam_trace_ns; |
290 | | static int hf_ipv6_opt_ioam_trace_nodelen; |
291 | | static int hf_ipv6_opt_ioam_trace_flags; |
292 | | static int hf_ipv6_opt_ioam_trace_flag_o; |
293 | | static int hf_ipv6_opt_ioam_trace_flag_l; |
294 | | static int hf_ipv6_opt_ioam_trace_flag_a; |
295 | | static int hf_ipv6_opt_ioam_trace_flag_rsv; |
296 | | static int hf_ipv6_opt_ioam_trace_remlen; |
297 | | static int hf_ipv6_opt_ioam_trace_type; |
298 | | static int hf_ipv6_opt_ioam_trace_type_bit0; |
299 | | static int hf_ipv6_opt_ioam_trace_type_bit1; |
300 | | static int hf_ipv6_opt_ioam_trace_type_bit2; |
301 | | static int hf_ipv6_opt_ioam_trace_type_bit3; |
302 | | static int hf_ipv6_opt_ioam_trace_type_bit4; |
303 | | static int hf_ipv6_opt_ioam_trace_type_bit5; |
304 | | static int hf_ipv6_opt_ioam_trace_type_bit6; |
305 | | static int hf_ipv6_opt_ioam_trace_type_bit7; |
306 | | static int hf_ipv6_opt_ioam_trace_type_bit8; |
307 | | static int hf_ipv6_opt_ioam_trace_type_bit9; |
308 | | static int hf_ipv6_opt_ioam_trace_type_bit10; |
309 | | static int hf_ipv6_opt_ioam_trace_type_bit11; |
310 | | static int hf_ipv6_opt_ioam_trace_type_undef; |
311 | | static int hf_ipv6_opt_ioam_trace_type_bit22; |
312 | | static int hf_ipv6_opt_ioam_trace_type_rsv; |
313 | | static int hf_ipv6_opt_ioam_trace_rsv; |
314 | | static int hf_ipv6_opt_ioam_trace_free_space; |
315 | | static int hf_ipv6_opt_ioam_trace_node_hlim; |
316 | | static int hf_ipv6_opt_ioam_trace_node_id; |
317 | | static int hf_ipv6_opt_ioam_trace_node_iif; |
318 | | static int hf_ipv6_opt_ioam_trace_node_eif; |
319 | | static int hf_ipv6_opt_ioam_trace_node_tss; |
320 | | static int hf_ipv6_opt_ioam_trace_node_tsf; |
321 | | static int hf_ipv6_opt_ioam_trace_node_trdelay; |
322 | | static int hf_ipv6_opt_ioam_trace_node_nsdata; |
323 | | static int hf_ipv6_opt_ioam_trace_node_qdepth; |
324 | | static int hf_ipv6_opt_ioam_trace_node_csum; |
325 | | static int hf_ipv6_opt_ioam_trace_node_id_wide; |
326 | | static int hf_ipv6_opt_ioam_trace_node_iif_wide; |
327 | | static int hf_ipv6_opt_ioam_trace_node_eif_wide; |
328 | | static int hf_ipv6_opt_ioam_trace_node_nsdata_wide; |
329 | | static int hf_ipv6_opt_ioam_trace_node_bufoccup; |
330 | | static int hf_ipv6_opt_ioam_trace_node_undefined; |
331 | | static int hf_ipv6_opt_ioam_trace_node_oss_len; |
332 | | static int hf_ipv6_opt_ioam_trace_node_oss_scid; |
333 | | static int hf_ipv6_opt_ioam_trace_node_oss_data; |
334 | | static int hf_ipv6_opt_ioam_dex_ns; |
335 | | static int hf_ipv6_opt_ioam_dex_flags; |
336 | | static int hf_ipv6_opt_ioam_dex_extflags; |
337 | | static int hf_ipv6_opt_ioam_dex_extflag_flag_rsv; |
338 | | static int hf_ipv6_opt_ioam_dex_extflag_flag_seqnum; |
339 | | static int hf_ipv6_opt_ioam_dex_extflag_flag_flowid; |
340 | | static int hf_ipv6_opt_ioam_dex_extflag_seqnum; |
341 | | static int hf_ipv6_opt_ioam_dex_extflag_flowid; |
342 | | static int hf_ipv6_opt_ioam_dex_rsv; |
343 | | static int hf_ipv6_opt_tpf_information; |
344 | | static int hf_ipv6_opt_mipv6_home_address; |
345 | | static int hf_ipv6_opt_rpl_flag; |
346 | | static int hf_ipv6_opt_rpl_flag_o; |
347 | | static int hf_ipv6_opt_rpl_flag_r; |
348 | | static int hf_ipv6_opt_rpl_flag_f; |
349 | | static int hf_ipv6_opt_rpl_flag_rsv; |
350 | | static int hf_ipv6_opt_rpl_instance_id; |
351 | | static int hf_ipv6_opt_rpl_senderrank; |
352 | | static int hf_ipv6_opt_ilnp_nonce; |
353 | | static int hf_ipv6_opt_lio_len; |
354 | | static int hf_ipv6_opt_lio_id; |
355 | | static int hf_ipv6_opt_mpl_flag; |
356 | | static int hf_ipv6_opt_mpl_flag_s; |
357 | | static int hf_ipv6_opt_mpl_flag_m; |
358 | | static int hf_ipv6_opt_mpl_flag_v; |
359 | | static int hf_ipv6_opt_mpl_flag_rsv; |
360 | | static int hf_ipv6_opt_mpl_sequence; |
361 | | static int hf_ipv6_opt_mpl_seed_id; |
362 | | static int hf_ipv6_opt_dff_flags; |
363 | | static int hf_ipv6_opt_dff_flag_ver; |
364 | | static int hf_ipv6_opt_dff_flag_dup; |
365 | | static int hf_ipv6_opt_dff_flag_ret; |
366 | | static int hf_ipv6_opt_dff_flag_rsv; |
367 | | static int hf_ipv6_opt_dff_seqnum; |
368 | | static int hf_ipv6_opt_experimental; |
369 | | static int hf_ipv6_opt_unknown_data; |
370 | | static int hf_ipv6_opt_unknown; |
371 | | static int hf_ipv6_dstopts_nxt; |
372 | | static int hf_ipv6_dstopts_len; |
373 | | static int hf_ipv6_dstopts_len_oct; |
374 | | static int hf_ipv6_hopopts_nxt; |
375 | | static int hf_ipv6_hopopts_len; |
376 | | static int hf_ipv6_hopopts_len_oct; |
377 | | static int hf_ipv6_routing_nxt; |
378 | | static int hf_ipv6_routing_len; |
379 | | static int hf_ipv6_routing_len_oct; |
380 | | static int hf_ipv6_routing_type; |
381 | | static int hf_ipv6_routing_segleft; |
382 | | static int hf_ipv6_routing_unknown_data; |
383 | | static int hf_ipv6_fraghdr_nxt; |
384 | | static int hf_ipv6_fraghdr_reserved_octet; |
385 | | static int hf_ipv6_fraghdr_offset; |
386 | | static int hf_ipv6_fraghdr_reserved_bits; |
387 | | static int hf_ipv6_fraghdr_more; |
388 | | static int hf_ipv6_fraghdr_ident; |
389 | | static int hf_ipv6_fragment; |
390 | | static int hf_ipv6_fragment_overlap; |
391 | | static int hf_ipv6_fragment_overlap_conflict; |
392 | | static int hf_ipv6_fragment_multiple_tails; |
393 | | static int hf_ipv6_fragment_too_long_fragment; |
394 | | static int hf_ipv6_fragment_error; |
395 | | static int hf_ipv6_fragment_count; |
396 | | static int hf_ipv6_fragments; |
397 | | static int hf_ipv6_reassembled_in; |
398 | | static int hf_ipv6_reassembled_length; |
399 | | static int hf_ipv6_reassembled_data; |
400 | | |
401 | | static int hf_ipv6_routing_src_reserved; |
402 | | static int hf_ipv6_routing_src_addr; |
403 | | |
404 | | static int hf_ipv6_routing_mipv6_reserved; |
405 | | static int hf_ipv6_routing_mipv6_home_address; |
406 | | |
407 | | static int hf_ipv6_routing_rpl_cmprI; |
408 | | static int hf_ipv6_routing_rpl_cmprE; |
409 | | static int hf_ipv6_routing_rpl_pad; |
410 | | static int hf_ipv6_routing_rpl_reserved; |
411 | | static int hf_ipv6_routing_rpl_addr_count; |
412 | | static int hf_ipv6_routing_rpl_addr; |
413 | | static int hf_ipv6_routing_rpl_fulladdr; |
414 | | |
415 | | static int hf_ipv6_routing_srh_last_entry; |
416 | | static int hf_ipv6_routing_srh_flags; |
417 | | static int hf_ipv6_routing_srh_tag; |
418 | | static int hf_ipv6_routing_srh_addr; |
419 | | |
420 | | static int hf_ipv6_routing_crh16_current_sid; |
421 | | static int hf_ipv6_routing_crh32_current_sid; |
422 | | static int hf_ipv6_routing_crh16_segment_id; |
423 | | static int hf_ipv6_routing_crh32_segment_id; |
424 | | |
425 | | struct ipv6_addr_info_s { |
426 | | int *hf_addr; |
427 | | int *hf_addr_space; |
428 | | int *hf_multicast_flags; |
429 | | int *const *hf_multicast_flags_bits; |
430 | | int *hf_multicast_scope; |
431 | | int *hf_special_purpose; |
432 | | int *hf_special_purpose_source; |
433 | | int *hf_special_purpose_destination; |
434 | | int *hf_special_purpose_forwardable; |
435 | | int *hf_special_purpose_global; |
436 | | int *hf_special_purpose_reserved; |
437 | | int *hf_host; |
438 | | }; |
439 | | |
440 | | static int *const ipv6_src_multicast_flags_bits[5] = { |
441 | | &hf_ipv6_src_multicast_flags_reserved, |
442 | | &hf_ipv6_src_multicast_flags_embed_rp, |
443 | | &hf_ipv6_src_multicast_flags_network_prefix, |
444 | | &hf_ipv6_src_multicast_flags_transient, |
445 | | NULL |
446 | | }; |
447 | | |
448 | | static struct ipv6_addr_info_s ipv6_src_info = { |
449 | | &hf_ipv6_src, |
450 | | &hf_ipv6_src_addr_space, |
451 | | &hf_ipv6_src_multicast_flags, |
452 | | ipv6_src_multicast_flags_bits, |
453 | | &hf_ipv6_src_multicast_scope, |
454 | | &hf_ipv6_src_special_purpose, |
455 | | &hf_ipv6_src_special_purpose_source, |
456 | | &hf_ipv6_src_special_purpose_destination, |
457 | | &hf_ipv6_src_special_purpose_forwardable, |
458 | | &hf_ipv6_src_special_purpose_global, |
459 | | &hf_ipv6_src_special_purpose_reserved, |
460 | | &hf_ipv6_src_host, |
461 | | }; |
462 | | |
463 | | static int *const ipv6_dst_multicast_flags_bits[5] = { |
464 | | &hf_ipv6_dst_multicast_flags_reserved, |
465 | | &hf_ipv6_dst_multicast_flags_embed_rp, |
466 | | &hf_ipv6_dst_multicast_flags_network_prefix, |
467 | | &hf_ipv6_dst_multicast_flags_transient, |
468 | | NULL |
469 | | }; |
470 | | |
471 | | static struct ipv6_addr_info_s ipv6_dst_info = { |
472 | | &hf_ipv6_dst, |
473 | | &hf_ipv6_dst_addr_space, |
474 | | &hf_ipv6_dst_multicast_flags, |
475 | | ipv6_dst_multicast_flags_bits, |
476 | | &hf_ipv6_dst_multicast_scope, |
477 | | &hf_ipv6_dst_special_purpose, |
478 | | &hf_ipv6_dst_special_purpose_source, |
479 | | &hf_ipv6_dst_special_purpose_destination, |
480 | | &hf_ipv6_dst_special_purpose_forwardable, |
481 | | &hf_ipv6_dst_special_purpose_global, |
482 | | &hf_ipv6_dst_special_purpose_reserved, |
483 | | &hf_ipv6_dst_host, |
484 | | }; |
485 | | |
486 | | static int hf_geoip_country; |
487 | | static int hf_geoip_country_iso; |
488 | | static int hf_geoip_city; |
489 | | static int hf_geoip_as_number; |
490 | | static int hf_geoip_as_org; |
491 | | static int hf_geoip_latitude; |
492 | | static int hf_geoip_longitude; |
493 | | static int hf_geoip_src_summary; |
494 | | static int hf_geoip_src_country; |
495 | | static int hf_geoip_src_country_iso; |
496 | | static int hf_geoip_src_city; |
497 | | static int hf_geoip_src_as_number; |
498 | | static int hf_geoip_src_as_org; |
499 | | static int hf_geoip_src_latitude; |
500 | | static int hf_geoip_src_longitude; |
501 | | static int hf_geoip_dst_summary; |
502 | | static int hf_geoip_dst_country; |
503 | | static int hf_geoip_dst_country_iso; |
504 | | static int hf_geoip_dst_city; |
505 | | static int hf_geoip_dst_as_number; |
506 | | static int hf_geoip_dst_as_org; |
507 | | static int hf_geoip_dst_latitude; |
508 | | static int hf_geoip_dst_longitude; |
509 | | |
510 | | static int ett_ipv6_proto; |
511 | | static int ett_ipv6_detail; |
512 | | static int ett_ipv6_detail_special_purpose; |
513 | | static int ett_ipv6_multicast_flags; |
514 | | static int ett_ipv6_traffic_class; |
515 | | static int ett_ipv6_opt; |
516 | | static int ett_ipv6_opt_type; |
517 | | static int ett_ipv6_opt_rpl; |
518 | | static int ett_ipv6_opt_mpl; |
519 | | static int ett_ipv6_opt_dff_flags; |
520 | | static int ett_ipv6_opt_ioam_trace_flags; |
521 | | static int ett_ipv6_opt_ioam_trace_types; |
522 | | static int ett_ipv6_opt_ioam_dex_extflags; |
523 | | static int ett_ipv6_hopopts_proto; |
524 | | static int ett_ipv6_fraghdr_proto; |
525 | | static int ett_ipv6_routing_proto; |
526 | | static int ett_ipv6_routing_srh_vect; |
527 | | static int ett_ipv6_fragments; |
528 | | static int ett_ipv6_fragment; |
529 | | static int ett_ipv6_dstopts_proto; |
530 | | |
531 | | static int ett_geoip_info; |
532 | | |
533 | | static uint32_t ipv6_stream_count; |
534 | | |
535 | | static expert_field ei_ipv6_routing_invalid_length; |
536 | | static expert_field ei_ipv6_routing_invalid_segleft; |
537 | | static expert_field ei_ipv6_routing_undecoded; |
538 | | static expert_field ei_ipv6_dst_addr_not_unspecified; |
539 | | static expert_field ei_ipv6_src_addr_not_multicast; |
540 | | static expert_field ei_ipv6_dst_addr_not_multicast; |
541 | | static expert_field ei_ipv6_src_route_list_mult_inst_same_addr; |
542 | | static expert_field ei_ipv6_src_route_list_src_addr; |
543 | | static expert_field ei_ipv6_src_route_list_dst_addr; |
544 | | static expert_field ei_ipv6_src_route_list_multicast_addr; |
545 | | static expert_field ei_ipv6_routing_rpl_cmpri_cmpre_pad; |
546 | | static expert_field ei_ipv6_routing_rpl_addr_count_ge0; |
547 | | static expert_field ei_ipv6_routing_rpl_reserved; |
548 | | static expert_field ei_ipv6_routing_deprecated; |
549 | | static expert_field ei_ipv6_opt_jumbo_missing; |
550 | | static expert_field ei_ipv6_opt_jumbo_prohibited; |
551 | | static expert_field ei_ipv6_opt_jumbo_truncated; |
552 | | static expert_field ei_ipv6_opt_jumbo_fragment; |
553 | | static expert_field ei_ipv6_opt_invalid_len; |
554 | | static expert_field ei_ipv6_opt_apn_invalid_id_type; |
555 | | static expert_field ei_ipv6_opt_unknown_data; |
556 | | static expert_field ei_ipv6_opt_deprecated; |
557 | | static expert_field ei_ipv6_opt_mpl_ipv6_src_seed_id; |
558 | | static expert_field ei_ipv6_hopopts_not_first; |
559 | | static expert_field ei_ipv6_plen_exceeds_framing; |
560 | | static expert_field ei_ipv6_plen_zero; |
561 | | static expert_field ei_ipv6_bogus_ipv6_version; |
562 | | static expert_field ei_ipv6_invalid_header; |
563 | | static expert_field ei_ipv6_opt_header_mismatch; |
564 | | static expert_field ei_ipv6_opt_ioam_invalid_nodelen; |
565 | | static expert_field ei_ipv6_opt_ioam_invalid_remlen; |
566 | | static expert_field ei_ipv6_opt_ioam_invalid_trace_type; |
567 | | static expert_field ei_ipv6_embed_ipv4_u_value; |
568 | | |
569 | | static dissector_handle_t ipv6_handle; |
570 | | static dissector_handle_t ilnp_handle; |
571 | | |
572 | | /* Reassemble fragmented datagrams */ |
573 | | static bool ipv6_reassemble = true; |
574 | | |
575 | | /* Place IPv6 summary in proto tree */ |
576 | | static bool ipv6_summary_in_tree = true; |
577 | | |
578 | | /* Show expanded information about IPv6 address */ |
579 | | static bool ipv6_address_detail = true; |
580 | | |
581 | | /* Perform strict RFC adherence checking */ |
582 | | static bool g_ipv6_rpl_srh_strict_rfc_checking; |
583 | | |
584 | | /* Use heuristics to determine subdissector */ |
585 | | static bool try_heuristic_first; |
586 | | |
587 | | /* Display IPv6 extension headers under the root tree */ |
588 | | static bool ipv6_exthdr_under_root; |
589 | | |
590 | | /* Hide extension header generated field for length */ |
591 | | static bool ipv6_exthdr_hide_len_oct_field; |
592 | | |
593 | | /* Assume TSO and correct zero-length IP packets */ |
594 | | static bool ipv6_tso_supported; |
595 | | |
596 | | /* Assign unique ID numbers to each IPv6 conversation. This increases |
597 | | * resource US because of having to lookup and create conversations |
598 | | * (which aren't otherwise needed.) |
599 | | */ |
600 | | static bool ipv6_track_conv_id = true; |
601 | | |
602 | | #define set_address_ipv6(dst, src_ip6) \ |
603 | 3.38k | set_address((dst), AT_IPv6, IPv6_ADDR_SIZE, (src_ip6)) |
604 | | |
605 | | #define set_address_ipv6_tvb(dst, tvb, offset) \ |
606 | | set_address_tvb((dst), AT_IPv6, IPv6_ADDR_SIZE, (tvb), (offset)) |
607 | | |
608 | | #define alloc_address_wmem_ipv6(scope, dst, src_ip6) \ |
609 | 93.1k | alloc_address_wmem((scope), (dst), AT_IPv6, IPv6_ADDR_SIZE, (src_ip6)) |
610 | | |
611 | | #define alloc_address_tvb_ipv6(scope, dst, tvb, offset) \ |
612 | 40 | alloc_address_tvb((scope), (dst), AT_IPv6, IPv6_ADDR_SIZE, (tvb), (offset)) |
613 | | |
614 | | extern const ws_in6_addr *tvb_get_ptr_ipv6(tvbuff_t tvb, int offset); |
615 | | #define tvb_get_ptr_ipv6(tvb, offset) \ |
616 | 91.5k | ((const ws_in6_addr *)tvb_get_ptr(tvb, offset, IPv6_ADDR_SIZE)) |
617 | | |
618 | | ipv6_pinfo_t *p_get_ipv6_pinfo(packet_info *pinfo) |
619 | 33.9k | { |
620 | 33.9k | return (ipv6_pinfo_t *)p_get_proto_data(pinfo->pool, pinfo, proto_ipv6, IPV6_PROTO_PINFO); |
621 | 33.9k | } |
622 | | |
623 | | /* Return tree pointer (for tree root preference) */ |
624 | | proto_tree *p_ipv6_pinfo_select_root(packet_info *pinfo, proto_tree *tree) |
625 | 4.34k | { |
626 | 4.34k | ipv6_pinfo_t *p; |
627 | | |
628 | 4.34k | if ((p = p_get_ipv6_pinfo(pinfo)) != NULL && p->ipv6_tree != NULL) |
629 | 1.53k | return p->ipv6_tree; |
630 | 2.80k | return tree; |
631 | 4.34k | } |
632 | | |
633 | | ipv6_pinfo_t *p_ipv6_pinfo_add_len(packet_info *pinfo, int exthdr_len) |
634 | 4.34k | { |
635 | 4.34k | ipv6_pinfo_t *p; |
636 | | |
637 | 4.34k | if ((p = p_get_ipv6_pinfo(pinfo)) == NULL) |
638 | 2.25k | return NULL; |
639 | | |
640 | 2.08k | p->frag_plen -= exthdr_len; |
641 | 2.08k | p->ipv6_item_len += exthdr_len; |
642 | 2.08k | return p; |
643 | 4.34k | } |
644 | | |
645 | | static void p_add_ipv6_nxt(packet_info *pinfo, uint8_t nxt) |
646 | 25.0k | { |
647 | 25.0k | uint8_t *ptr; |
648 | | |
649 | 25.0k | ptr = (uint8_t *)wmem_memdup(pinfo->pool, &nxt, sizeof(uint8_t)); |
650 | 25.0k | p_add_proto_data(pinfo->pool, pinfo, proto_ipv6, |
651 | 25.0k | (pinfo->curr_layer_num<<8) | IPV6_PROTO_VALUE, ptr); |
652 | 25.0k | } |
653 | | |
654 | | static uint8_t *p_get_ipv6_nxt(packet_info *pinfo) |
655 | 0 | { |
656 | 0 | return (uint8_t *)p_get_proto_data(pinfo->pool, pinfo, proto_ipv6, |
657 | 0 | (pinfo->curr_layer_num<<8) | IPV6_PROTO_VALUE); |
658 | 0 | } |
659 | | |
660 | | static void *ipv6_value(packet_info *pinfo) |
661 | 0 | { |
662 | 0 | uint8_t *nxt = p_get_ipv6_nxt(pinfo); |
663 | |
|
664 | 0 | if (nxt == NULL) { |
665 | 0 | return GUINT_TO_POINTER(255); /* Reserved IP Protocol */ |
666 | 0 | } |
667 | 0 | return GUINT_TO_POINTER((unsigned)*nxt); |
668 | 0 | } |
669 | | |
670 | | static void ipv6_prompt(packet_info *pinfo, char *result) |
671 | 0 | { |
672 | 0 | void *value = ipv6_value(pinfo); |
673 | |
|
674 | 0 | snprintf(result, MAX_DECODE_AS_PROMPT_LEN, "IP protocol %u as", GPOINTER_TO_UINT(value)); |
675 | 0 | } |
676 | | |
677 | | static const char* ipv6_conv_get_filter_type(conv_item_t* conv, conv_filter_type_e filter) |
678 | 0 | { |
679 | 0 | if ((filter == CONV_FT_SRC_ADDRESS) && (conv->src_address.type == AT_IPv6)) |
680 | 0 | return "ipv6.src"; |
681 | | |
682 | 0 | if ((filter == CONV_FT_DST_ADDRESS) && (conv->dst_address.type == AT_IPv6)) |
683 | 0 | return "ipv6.dst"; |
684 | | |
685 | 0 | if ((filter == CONV_FT_ANY_ADDRESS) && (conv->src_address.type == AT_IPv6)) |
686 | 0 | return "ipv6.addr"; |
687 | | |
688 | 0 | return CONV_FILTER_INVALID; |
689 | 0 | } |
690 | | |
691 | | static ct_dissector_info_t ipv6_ct_dissector_info = {&ipv6_conv_get_filter_type}; |
692 | | |
693 | | static tap_packet_status |
694 | | ipv6_conversation_packet(void *pct, packet_info *pinfo, epan_dissect_t *edt _U_, const void *vip, tap_flags_t flags) |
695 | 0 | { |
696 | 0 | conv_hash_t *hash = (conv_hash_t*) pct; |
697 | 0 | hash->flags = flags; |
698 | |
|
699 | 0 | const ipv6_tap_info_t *ip6 = (const ipv6_tap_info_t *)vip; |
700 | |
|
701 | 0 | if (!ipv6_track_conv_id) { |
702 | 0 | add_conversation_table_data(hash, &ip6->ip6_src, &ip6->ip6_dst, 0, 0, |
703 | 0 | 1, pinfo->fd->pkt_len, &pinfo->rel_ts, &pinfo->abs_ts, |
704 | 0 | &ipv6_ct_dissector_info, CONVERSATION_IPV6); |
705 | 0 | } else { |
706 | 0 | add_conversation_table_data_with_conv_id(hash, &ip6->ip6_src, &ip6->ip6_dst, 0, 0, |
707 | 0 | (conv_id_t)ip6->ip6_stream, 1, pinfo->fd->pkt_len, |
708 | 0 | &pinfo->rel_ts, &pinfo->abs_ts, &ipv6_ct_dissector_info, CONVERSATION_IPV6); |
709 | 0 | } |
710 | |
|
711 | 0 | return TAP_PACKET_REDRAW; |
712 | 0 | } |
713 | | |
714 | | static const char* ipv6_endpoint_get_filter_type(endpoint_item_t* endpoint, conv_filter_type_e filter) |
715 | 0 | { |
716 | 0 | if ((filter == CONV_FT_ANY_ADDRESS) && (endpoint->myaddress.type == AT_IPv6)) |
717 | 0 | return "ipv6.addr"; |
718 | | |
719 | 0 | return CONV_FILTER_INVALID; |
720 | 0 | } |
721 | | |
722 | | static et_dissector_info_t ipv6_endpoint_dissector_info = {&ipv6_endpoint_get_filter_type}; |
723 | | |
724 | | static tap_packet_status |
725 | | ipv6_endpoint_packet(void *pit, packet_info *pinfo, epan_dissect_t *edt _U_, const void *vip, tap_flags_t flags) |
726 | 0 | { |
727 | 0 | conv_hash_t *hash = (conv_hash_t*) pit; |
728 | 0 | hash->flags = flags; |
729 | |
|
730 | 0 | const ipv6_tap_info_t *ip6 = (const ipv6_tap_info_t *)vip; |
731 | |
|
732 | 0 | add_endpoint_table_data(hash, &ip6->ip6_src, 0, true, 1, |
733 | 0 | pinfo->fd->pkt_len, &ipv6_endpoint_dissector_info, ENDPOINT_NONE); |
734 | 0 | add_endpoint_table_data(hash, &ip6->ip6_dst, 0, false, 1, |
735 | 0 | pinfo->fd->pkt_len, &ipv6_endpoint_dissector_info, ENDPOINT_NONE); |
736 | |
|
737 | 0 | return TAP_PACKET_REDRAW; |
738 | 0 | } |
739 | | |
740 | | static bool |
741 | | ipv6_filter_valid(packet_info *pinfo, void *user_data _U_) |
742 | 0 | { |
743 | 0 | return proto_is_frame_protocol(pinfo->layers, "ipv6"); |
744 | 0 | } |
745 | | |
746 | | static char* |
747 | | ipv6_build_filter(packet_info *pinfo, void *user_data _U_) |
748 | 0 | { |
749 | 0 | return ws_strdup_printf("ipv6.addr eq %s and ipv6.addr eq %s", |
750 | 0 | address_to_str(pinfo->pool, &pinfo->net_src), |
751 | 0 | address_to_str(pinfo->pool, &pinfo->net_dst)); |
752 | 0 | } |
753 | | |
754 | | /* https://www.iana.org/assignments/ipv6-parameters/ipv6-parameters.xhtml#extension-header */ |
755 | | |
756 | | static bool ipv6_exthdr_check(int proto) |
757 | 0 | { |
758 | 0 | switch (proto) { |
759 | | /* fall through all cases */ |
760 | 0 | case IP_PROTO_HOPOPT: /* IPv6 Hop-by-Hop Option */ |
761 | 0 | case IP_PROTO_IPV6_ROUTE: /* Routing Header for IPv6 */ |
762 | 0 | case IP_PROTO_IPV6_FRAG: /* Fragment Header for IPv6 */ |
763 | 0 | case IP_PROTO_ESP: /* Encapsulating Security Payload */ |
764 | 0 | case IP_PROTO_AH: /* Authentication Header */ |
765 | 0 | case IP_PROTO_IPV6_OPTS: /* Destination Options for IPv6 */ |
766 | 0 | case IP_PROTO_MOBILITY_HEADER: /* Mobility Header */ |
767 | 0 | case IP_PROTO_HIP: /* Host Identity Protocol */ |
768 | 0 | case IP_PROTO_SHIM6: /* Shim6 Protocol */ |
769 | 0 | return true; |
770 | 0 | default: |
771 | 0 | break; |
772 | 0 | } |
773 | 0 | return false; |
774 | 0 | } |
775 | | |
776 | | const char* ipv6extprotostr(int proto) |
777 | 0 | { |
778 | 0 | if (ipv6_exthdr_check(proto)) |
779 | 0 | return ipprotostr(proto); |
780 | 0 | return NULL; |
781 | 0 | } |
782 | | |
783 | | /* UAT for providing a list of NAT64 prefixes */ |
784 | | |
785 | | struct nat64_prefix_data { |
786 | | char *ipaddr; |
787 | | uint8_t prefix_len; |
788 | | uint32_t prefix_wildcard_len; |
789 | | }; |
790 | | |
791 | | |
792 | | static uat_t *nat64_prefix_uat; |
793 | | static struct nat64_prefix_data *nat64_prefix_uats; |
794 | | static unsigned number_of_nat64_prefix; |
795 | | |
796 | | |
797 | | UAT_CSTRING_CB_DEF(nat64_prefix_uats, ipaddr, struct nat64_prefix_data) |
798 | | |
799 | | static bool |
800 | | nat64_prefix_uat_fld_ip_chk_cb(void *r _U_, const char *ipaddr, unsigned len _U_, const void *u1 _U_, const void *u2 _U_, char **err) |
801 | 0 | { |
802 | | /* Check for a valid IPv6 address */ |
803 | 0 | ws_in6_addr addr; |
804 | |
|
805 | 0 | if (ws_inet_pton6(ipaddr, &addr)) { |
806 | 0 | *err = NULL; |
807 | 0 | return true; |
808 | 0 | } |
809 | | |
810 | 0 | *err = ws_strdup_printf("No valid IPv6 address given."); |
811 | 0 | return false; |
812 | 0 | } |
813 | | |
814 | | static const value_string nat64_prefix_length_vals[] = |
815 | | { |
816 | | { 32, "32" }, |
817 | | { 40, "40" }, |
818 | | { 48, "48" }, |
819 | | { 56, "56" }, |
820 | | { 64, "64" }, |
821 | | { 96, "96" }, |
822 | | { 0, NULL } |
823 | | }; |
824 | | |
825 | | UAT_VS_DEF(nat64_prefix_uats, prefix_len, struct nat64_prefix_data, uint8_t, 96, "96") |
826 | | |
827 | | static const value_string nat64_prefix_wildcard_length_vals[] = |
828 | | { |
829 | | { 0, "0" }, |
830 | | { 8, "8" }, |
831 | | { 16, "16" }, |
832 | | { 32, "32" }, |
833 | | { 64, "64" }, |
834 | | { 0, NULL } |
835 | | }; |
836 | | |
837 | | UAT_VS_DEF(nat64_prefix_uats, prefix_wildcard_len, struct nat64_prefix_data, uint8_t, 0, "0") |
838 | | |
839 | | |
840 | | static void |
841 | | nat64_prefix_free_cb(void *data) |
842 | 0 | { |
843 | 0 | struct nat64_prefix_data *h = (struct nat64_prefix_data *)data; |
844 | |
|
845 | 0 | g_free(h->ipaddr); |
846 | 0 | } |
847 | | |
848 | | static void * |
849 | | nat64_prefix_copy_cb(void *dst_, const void *src_, size_t len _U_) |
850 | 0 | { |
851 | 0 | const struct nat64_prefix_data *src = (const struct nat64_prefix_data *)src_; |
852 | 0 | struct nat64_prefix_data *dst = (struct nat64_prefix_data *)dst_; |
853 | |
|
854 | 0 | dst->ipaddr = g_strdup(src->ipaddr); |
855 | 0 | dst->prefix_len = src->prefix_len; |
856 | 0 | dst->prefix_wildcard_len = src->prefix_wildcard_len; |
857 | |
|
858 | 0 | return dst; |
859 | 0 | } |
860 | | |
861 | | |
862 | | static int |
863 | | ipv6_previous_layer_id(packet_info *pinfo) |
864 | 3.11k | { |
865 | 3.11k | wmem_list_frame_t *layer; |
866 | | |
867 | 3.11k | layer = wmem_list_tail(pinfo->layers); |
868 | 3.11k | DISSECTOR_ASSERT(layer); |
869 | 3.11k | layer = wmem_list_frame_prev(layer); |
870 | 3.11k | if (layer != NULL) { |
871 | 3.11k | return GPOINTER_TO_INT(wmem_list_frame_data(layer)); |
872 | 3.11k | } |
873 | 0 | return -1; |
874 | 3.11k | } |
875 | | |
876 | | static const fragment_items ipv6_frag_items = { |
877 | | &ett_ipv6_fragment, |
878 | | &ett_ipv6_fragments, |
879 | | &hf_ipv6_fragments, |
880 | | &hf_ipv6_fragment, |
881 | | &hf_ipv6_fragment_overlap, |
882 | | &hf_ipv6_fragment_overlap_conflict, |
883 | | &hf_ipv6_fragment_multiple_tails, |
884 | | &hf_ipv6_fragment_too_long_fragment, |
885 | | &hf_ipv6_fragment_error, |
886 | | &hf_ipv6_fragment_count, |
887 | | &hf_ipv6_reassembled_in, |
888 | | &hf_ipv6_reassembled_length, |
889 | | &hf_ipv6_reassembled_data, |
890 | | "IPv6 fragments" |
891 | | }; |
892 | | |
893 | | static dissector_table_t ip_dissector_table; |
894 | | static dissector_table_t ipv6_routing_dissector_table; |
895 | | |
896 | | /* |
897 | | * defragmentation of IPv6 |
898 | | */ |
899 | | static reassembly_table ipv6_reassembly_table; |
900 | | |
901 | | /* http://www.iana.org/assignments/ipv6-parameters (last updated 2015-07-07) */ |
902 | | static const value_string ipv6_opt_type_vals[] = { |
903 | | { IP6OPT_PAD1, "Pad1" }, |
904 | | { IP6OPT_PADN, "PadN" }, |
905 | | { IP6OPT_TEL, "Tunnel Encapsulation Limit" }, |
906 | | { IP6OPT_RTALERT, "Router Alert" }, |
907 | | { IP6OPT_CALIPSO, "CALIPSO" }, |
908 | | { IP6OPT_SMF_DPD, "SMF_DPD" }, |
909 | | { IP6OPT_PDM, "Performance and Diagnostic Metrics" }, |
910 | | { IP6OPT_APN6, "Application-Aware IPv6 Networking (APN6)" }, |
911 | | { IP6OPT_EXP_1E, "Experimental (0x1E)" }, |
912 | | { IP6OPT_RPL, "RPL Option" }, |
913 | | { IP6OPT_QUICKSTART, "Quick-Start" }, |
914 | | { IP6OPT_PMTU, "Path MTU Option" }, |
915 | | { IP6OPT_IOAM, "IOAM Option" }, |
916 | | { IP6OPT_EXP_3E, "Experimental (0x3E)" }, |
917 | | { IP6OPT_TPF, "Tunnel Payload Forwarding (TPF) Information" }, |
918 | | { IP6OPT_EXP_5E, "Experimental (0x5E)" }, |
919 | | { IP6OPT_RPL_OLD, "RPL Option (deprecated)" }, |
920 | | { IP6OPT_MPL, "MPL Option" }, |
921 | | { IP6OPT_EXP_7E, "Experimental (0x7E)" }, |
922 | | { IP6OPT_ENDI, "Endpoint Identification" }, |
923 | | { IP6OPT_ILNP_NONCE, "ILNP Nonce" }, |
924 | | { IP6OPT_LIO, "Line-Identification Option" }, |
925 | | { IP6OPT_EXP_9E, "Experimental (0x9E)" }, |
926 | | { IP6OPT_EXP_BE, "Experimental (0xBE)" }, |
927 | | { IP6OPT_JUMBO, "Jumbo Payload" }, |
928 | | { IP6OPT_HOME_ADDRESS, "Home Address" }, |
929 | | { IP6OPT_EXP_DE, "Experimental (0xDE)" }, |
930 | | { IP6OPT_IP_DFF, "IP_DFF" }, |
931 | | { IP6OPT_EXP_FE, "Experimental (0xFE)" }, |
932 | | { 0, NULL } |
933 | | }; |
934 | | static value_string_ext ipv6_opt_type_vals_ext = VALUE_STRING_EXT_INIT(ipv6_opt_type_vals); |
935 | | |
936 | | static const value_string ipv6_opt_rtalert_vals[] = { |
937 | | { IP6OPT_RTALERT_MLD, "MLD" }, |
938 | | { IP6OPT_RTALERT_RSVP, "RSVP" }, |
939 | | { IP6OPT_RTALERT_ACTNET, "Active Network" }, |
940 | | { 0, NULL } |
941 | | }; |
942 | | |
943 | | enum { |
944 | | IP6OPT_SMF_DPD_NULL = 0, |
945 | | IP6OPT_SMF_DPD_DFLT, |
946 | | IP6OPT_SMF_DPD_IPv4, |
947 | | IP6OPT_SMF_DPD_IPv6 |
948 | | }; |
949 | | |
950 | | static const value_string ipv6_opt_smf_dpd_tidty_vals[] = { |
951 | | { IP6OPT_SMF_DPD_NULL, "NULL" }, |
952 | | { IP6OPT_SMF_DPD_DFLT, "DEFAULT" }, |
953 | | { IP6OPT_SMF_DPD_IPv4, "IPv4" }, |
954 | | { IP6OPT_SMF_DPD_IPv6, "IPv6" }, |
955 | | { 0, NULL } |
956 | | }; |
957 | | |
958 | | enum { |
959 | | IPv6_OPT_ACTION_SKIP = 0, |
960 | | IPv6_OPT_ACTION_DISC, |
961 | | IPv6_OPT_ACTION_ICMP, |
962 | | IPv6_OPT_ACTION_MCST, |
963 | | }; |
964 | | |
965 | | static const value_string ipv6_opt_type_action_vals[] = { |
966 | | { IPv6_OPT_ACTION_SKIP, "Skip and continue" }, |
967 | | { IPv6_OPT_ACTION_DISC, "Discard" }, |
968 | | { IPv6_OPT_ACTION_ICMP, "Discard and send ICMP Parameter Problem" }, |
969 | | { IPv6_OPT_ACTION_MCST, "Discard and send ICMP if not multicast" }, |
970 | | { 0, NULL } |
971 | | }; |
972 | | |
973 | | enum { |
974 | | IPv6_OPT_HDR_HBH = 0, |
975 | | IPv6_OPT_HDR_DST, |
976 | | IPv6_OPT_HDR_ANY |
977 | | }; |
978 | | |
979 | | static const int _ipv6_opt_type_hdr[][2] = { |
980 | | { IP6OPT_TEL, IPv6_OPT_HDR_DST }, |
981 | | { IP6OPT_RTALERT, IPv6_OPT_HDR_HBH }, |
982 | | { IP6OPT_PMTU, IPv6_OPT_HDR_HBH }, |
983 | | { IP6OPT_APN6, IPv6_OPT_HDR_ANY }, |
984 | | { IP6OPT_CALIPSO, IPv6_OPT_HDR_HBH }, |
985 | | { IP6OPT_SMF_DPD, IPv6_OPT_HDR_HBH }, |
986 | | { IP6OPT_PDM, IPv6_OPT_HDR_DST }, |
987 | | { IP6OPT_RPL, IPv6_OPT_HDR_HBH }, |
988 | | { IP6OPT_QUICKSTART, IPv6_OPT_HDR_HBH }, |
989 | | { IP6OPT_IOAM, IPv6_OPT_HDR_HBH }, |
990 | | { IP6OPT_TPF, IPv6_OPT_HDR_DST }, |
991 | | { IP6OPT_RPL_OLD, IPv6_OPT_HDR_HBH }, |
992 | | { IP6OPT_MPL, IPv6_OPT_HDR_HBH }, |
993 | | { IP6OPT_ILNP_NONCE, IPv6_OPT_HDR_DST }, |
994 | | { IP6OPT_LIO, IPv6_OPT_HDR_DST }, |
995 | | { IP6OPT_JUMBO, IPv6_OPT_HDR_HBH }, |
996 | | { IP6OPT_HOME_ADDRESS, IPv6_OPT_HDR_DST }, |
997 | | { IP6OPT_IP_DFF, IPv6_OPT_HDR_HBH }, |
998 | | { 0, IPv6_OPT_HDR_ANY } |
999 | | }; |
1000 | | |
1001 | | static inline int |
1002 | | ipv6_opt_type_hdr(int type) |
1003 | 8.30k | { |
1004 | 8.30k | static const int (*p)[2] = _ipv6_opt_type_hdr; |
1005 | | |
1006 | 8.30k | for (; (*p)[1] != IPv6_OPT_HDR_ANY; p++) { |
1007 | 6 | if ((*p)[0] == type) { |
1008 | 0 | return (*p)[1]; |
1009 | 0 | } |
1010 | 6 | } |
1011 | 8.30k | return IPv6_OPT_HDR_ANY; |
1012 | 8.30k | } |
1013 | | |
1014 | | enum { |
1015 | | IPv6_RT_HEADER_SOURCE_ROUTING = 0, /* DEPRECATED */ |
1016 | | IPv6_RT_HEADER_NIMROD = 1, /* DEPRECATED */ |
1017 | | IPv6_RT_HEADER_MOBILE_IP = 2, |
1018 | | IPv6_RT_HEADER_RPL = 3, |
1019 | | IPv6_RT_HEADER_SEGMENT_ROUTING = 4, |
1020 | | IPv6_RT_HEADER_COMPACT_16 = 5, |
1021 | | IPv6_RT_HEADER_COMPACT_32 = 6, |
1022 | | IPv6_RT_HEADER_EXP1 = 253, |
1023 | | IPv6_RT_HEADER_EXP2 = 254 |
1024 | | }; |
1025 | | |
1026 | | /* Routing Header Types */ |
1027 | | static const value_string routing_header_type[] = { |
1028 | | { IPv6_RT_HEADER_SOURCE_ROUTING, "Source Route" }, |
1029 | | { IPv6_RT_HEADER_NIMROD, "Nimrod" }, |
1030 | | { IPv6_RT_HEADER_MOBILE_IP, "Type 2 Routing" }, |
1031 | | { IPv6_RT_HEADER_RPL, "RPL Source Route" }, |
1032 | | { IPv6_RT_HEADER_SEGMENT_ROUTING, "Segment Routing" }, |
1033 | | { IPv6_RT_HEADER_COMPACT_16, "Compact Routing Header 16" }, |
1034 | | { IPv6_RT_HEADER_COMPACT_32, "Compact Routing Header 32" }, |
1035 | | { IPv6_RT_HEADER_EXP1, "Experiment 1" }, |
1036 | | { IPv6_RT_HEADER_EXP2, "Experiment 2" }, |
1037 | | { 0, NULL } |
1038 | | }; |
1039 | | |
1040 | | static const value_string mpl_seed_id_len_vals[] = { |
1041 | | { 0, "0" }, |
1042 | | { 1, "16-bit unsigned integer" }, |
1043 | | { 2, "64-bit unsigned integer" }, |
1044 | | { 3, "128-bit unsigned integer" }, |
1045 | | { 0, NULL } |
1046 | | }; |
1047 | | |
1048 | | static const value_string ipv6_multicast_scope_vals[] = { |
1049 | | { 0x0, "Reserved" }, |
1050 | | { 0x1, "Interface-Local scope" }, |
1051 | | { 0x2, "Link-Local scope" }, |
1052 | | { 0x3, "Realm-Local scope" }, |
1053 | | { 0x4, "Admin-Local scope" }, |
1054 | | { 0x5, "Site-Local scope" }, |
1055 | | { 0x6, "Unassigned" }, |
1056 | | { 0x7, "Unassigned" }, |
1057 | | { 0x8, "Organization-Local scope" }, |
1058 | | { 0x9, "Unassigned" }, |
1059 | | { 0xA, "Unassigned" }, |
1060 | | { 0xB, "Unassigned" }, |
1061 | | { 0xC, "Unassigned" }, |
1062 | | { 0xD, "Unassigned" }, |
1063 | | { 0xE, "Global scope" }, |
1064 | | { 0xF, "Reserved" }, |
1065 | | { 0, NULL } |
1066 | | }; |
1067 | | |
1068 | 492 | #define APN_ID_32BIT 1 |
1069 | 164 | #define APN_ID_64BIT 2 |
1070 | 270 | #define APN_ID_128BIT 3 |
1071 | | static const value_string apn_id_type_strs[] = { |
1072 | | { 0, "Invalid" }, |
1073 | | { APN_ID_32BIT, "32-bit" }, |
1074 | | { APN_ID_64BIT, "64-bit" }, |
1075 | | { APN_ID_128BIT, "128-bit" }, |
1076 | | { 0, NULL } |
1077 | | }; |
1078 | | |
1079 | | static bool |
1080 | | capture_ipv6(const unsigned char *pd, int offset, int len, capture_packet_info_t *cpinfo, const union wtap_pseudo_header *pseudo_header) |
1081 | 0 | { |
1082 | 0 | uint8_t nxt; |
1083 | |
|
1084 | 0 | if (!BYTES_ARE_IN_FRAME(offset, len, IPv6_HDR_SIZE)) |
1085 | 0 | return false; |
1086 | | |
1087 | 0 | capture_dissector_increment_count(cpinfo, proto_ipv6); |
1088 | |
|
1089 | 0 | nxt = pd[offset+6]; /* get the "next header" value */ |
1090 | 0 | offset += IPv6_HDR_SIZE; /* skip past the IPv6 header */ |
1091 | |
|
1092 | 0 | return try_capture_dissector("ip.proto", nxt, pd, offset, len, cpinfo, pseudo_header); |
1093 | 0 | } |
1094 | | |
1095 | | static bool |
1096 | | capture_ipv6_exthdr(const unsigned char *pd, int offset, int len, capture_packet_info_t *cpinfo, const union wtap_pseudo_header *pseudo_header) |
1097 | 0 | { |
1098 | 0 | uint8_t nxt; |
1099 | 0 | int advance; |
1100 | |
|
1101 | 0 | if (!BYTES_ARE_IN_FRAME(offset, len, 2)) |
1102 | 0 | return false; |
1103 | 0 | nxt = pd[offset]; |
1104 | 0 | switch (nxt) { |
1105 | 0 | case IP_PROTO_IPV6_FRAG: |
1106 | 0 | advance = IPv6_FRAGMENT_HDR_SIZE; |
1107 | 0 | break; |
1108 | 0 | default: |
1109 | 0 | advance = (pd[offset+1] + 1) << 3; |
1110 | 0 | break; |
1111 | 0 | } |
1112 | 0 | if (!BYTES_ARE_IN_FRAME(offset, len, advance)) |
1113 | 0 | return false; |
1114 | 0 | offset += advance; |
1115 | |
|
1116 | 0 | return try_capture_dissector("ip.proto", nxt, pd, offset, len, cpinfo, pseudo_header); |
1117 | 0 | } |
1118 | | |
1119 | | static void |
1120 | | add_geoip_info_entry(proto_tree *tree, packet_info *pinfo, tvbuff_t *tvb, int offset, const ws_in6_addr *ip6, bool isdst) |
1121 | 45.0k | { |
1122 | 45.0k | const mmdb_lookup_t *lookup = maxmind_db_lookup_ipv6(ip6); |
1123 | 45.0k | if (!lookup->found) return; |
1124 | | |
1125 | 0 | wmem_strbuf_t *summary = wmem_strbuf_new(pinfo->pool, ""); |
1126 | 0 | if (lookup->city) { |
1127 | 0 | wmem_strbuf_append(summary, lookup->city); |
1128 | 0 | } |
1129 | 0 | if (lookup->country_iso) { |
1130 | 0 | if (wmem_strbuf_get_len(summary) > 0) wmem_strbuf_append(summary, ", "); |
1131 | 0 | wmem_strbuf_append(summary, lookup->country_iso); |
1132 | 0 | } else if (lookup->country) { |
1133 | 0 | if (wmem_strbuf_get_len(summary) > 0) wmem_strbuf_append(summary, ", "); |
1134 | 0 | wmem_strbuf_append(summary, lookup->country); |
1135 | 0 | } |
1136 | 0 | if (lookup->as_number > 0) { |
1137 | 0 | if (wmem_strbuf_get_len(summary) > 0) wmem_strbuf_append(summary, ", "); |
1138 | 0 | wmem_strbuf_append_printf(summary, "ASN %u", lookup->as_number); |
1139 | 0 | } |
1140 | 0 | if (lookup->as_org) { |
1141 | 0 | if (wmem_strbuf_get_len(summary) > 0) wmem_strbuf_append(summary, ", "); |
1142 | 0 | wmem_strbuf_append(summary, lookup->as_org); |
1143 | 0 | } |
1144 | |
|
1145 | 0 | int addr_offset = offset + (isdst ? IP6H_DST : IP6H_SRC); |
1146 | 0 | int dir_hf = isdst ? hf_geoip_dst_summary : hf_geoip_src_summary; |
1147 | 0 | proto_item *geoip_info_item = proto_tree_add_string(tree, dir_hf, tvb, addr_offset, 16, wmem_strbuf_finalize(summary)); |
1148 | 0 | proto_item_set_generated(geoip_info_item); |
1149 | 0 | proto_tree *geoip_info_tree = proto_item_add_subtree(geoip_info_item, ett_geoip_info); |
1150 | |
|
1151 | 0 | proto_item *item; |
1152 | |
|
1153 | 0 | if (lookup->city) { |
1154 | 0 | dir_hf = isdst ? hf_geoip_dst_city : hf_geoip_src_city; |
1155 | 0 | item = proto_tree_add_string(geoip_info_tree, dir_hf, tvb, addr_offset, 16, lookup->city); |
1156 | 0 | proto_item_set_generated(item); |
1157 | 0 | item = proto_tree_add_string(geoip_info_tree, hf_geoip_city, tvb, addr_offset, 16, lookup->city); |
1158 | 0 | proto_item_set_generated(item); |
1159 | 0 | } |
1160 | |
|
1161 | 0 | if (lookup->country) { |
1162 | 0 | dir_hf = isdst ? hf_geoip_dst_country : hf_geoip_src_country; |
1163 | 0 | item = proto_tree_add_string(geoip_info_tree, dir_hf, tvb, addr_offset, 16, lookup->country); |
1164 | 0 | proto_item_set_generated(item); |
1165 | 0 | item = proto_tree_add_string(geoip_info_tree, hf_geoip_country, tvb, addr_offset, 16, lookup->country); |
1166 | 0 | proto_item_set_generated(item); |
1167 | 0 | } |
1168 | |
|
1169 | 0 | if (lookup->country_iso) { |
1170 | 0 | dir_hf = isdst ? hf_geoip_dst_country_iso : hf_geoip_src_country_iso; |
1171 | 0 | item = proto_tree_add_string(geoip_info_tree, dir_hf, tvb, addr_offset, 16, lookup->country_iso); |
1172 | 0 | proto_item_set_generated(item); |
1173 | 0 | item = proto_tree_add_string(geoip_info_tree, hf_geoip_country_iso, tvb, addr_offset, 16, lookup->country_iso); |
1174 | 0 | proto_item_set_generated(item); |
1175 | 0 | } |
1176 | |
|
1177 | 0 | if (lookup->as_number > 0) { |
1178 | 0 | dir_hf = isdst ? hf_geoip_dst_as_number : hf_geoip_src_as_number; |
1179 | 0 | item = proto_tree_add_uint(geoip_info_tree, dir_hf, tvb, addr_offset, 16, lookup->as_number); |
1180 | 0 | proto_item_set_generated(item); |
1181 | 0 | item = proto_tree_add_uint(geoip_info_tree, hf_geoip_as_number, tvb, addr_offset, 16, lookup->as_number); |
1182 | 0 | proto_item_set_generated(item); |
1183 | 0 | } |
1184 | |
|
1185 | 0 | if (lookup->as_org) { |
1186 | 0 | dir_hf = isdst ? hf_geoip_dst_as_org : hf_geoip_src_as_org; |
1187 | 0 | item = proto_tree_add_string(geoip_info_tree, dir_hf, tvb, addr_offset, 16, lookup->as_org); |
1188 | 0 | proto_item_set_generated(item); |
1189 | 0 | item = proto_tree_add_string(geoip_info_tree, hf_geoip_as_org, tvb, addr_offset, 16, lookup->as_org); |
1190 | 0 | proto_item_set_generated(item); |
1191 | 0 | } |
1192 | |
|
1193 | 0 | if (lookup->latitude >= -90.0 && lookup->latitude <= 90.0) { |
1194 | 0 | dir_hf = isdst ? hf_geoip_dst_latitude : hf_geoip_src_latitude; |
1195 | 0 | item = proto_tree_add_double(geoip_info_tree, dir_hf, tvb, addr_offset, 16, lookup->latitude); |
1196 | 0 | proto_item_set_generated(item); |
1197 | 0 | item = proto_tree_add_double(geoip_info_tree, hf_geoip_latitude, tvb, addr_offset, 16, lookup->latitude); |
1198 | 0 | proto_item_set_generated(item); |
1199 | 0 | } |
1200 | |
|
1201 | 0 | if (lookup->longitude >= -180.0 && lookup->longitude <= 180.0) { |
1202 | 0 | dir_hf = isdst ? hf_geoip_dst_longitude : hf_geoip_src_longitude; |
1203 | 0 | item = proto_tree_add_double(geoip_info_tree, dir_hf, tvb, addr_offset, 16, lookup->longitude); |
1204 | 0 | proto_item_set_generated(item); |
1205 | 0 | item = proto_tree_add_double(geoip_info_tree, hf_geoip_longitude, tvb, addr_offset, 16, lookup->longitude); |
1206 | 0 | proto_item_set_generated(item); |
1207 | 0 | } |
1208 | 0 | } |
1209 | | |
1210 | | static void |
1211 | | add_geoip_info(proto_tree *tree, packet_info *pinfo, tvbuff_t *tvb, int offset, const ws_in6_addr *src, const ws_in6_addr *dst) |
1212 | 22.5k | { |
1213 | 22.5k | add_geoip_info_entry(tree, pinfo, tvb, offset, src, false); |
1214 | 22.5k | add_geoip_info_entry(tree, pinfo, tvb, offset, dst, true); |
1215 | 22.5k | } |
1216 | | |
1217 | | /* Returns true if reassembled */ |
1218 | | static bool |
1219 | | ipv6_reassemble_do(tvbuff_t **tvb_ptr, int *offset_ptr, packet_info *pinfo, proto_tree *ipv6_tree, |
1220 | | uint32_t plen, uint16_t frag_off, bool frag_flg, uint32_t frag_ident, |
1221 | | bool *show_data_ptr) |
1222 | 17 | { |
1223 | 17 | fragment_head *ipfd_head; |
1224 | 17 | tvbuff_t *next_tvb; |
1225 | 17 | bool update_col_info = true; |
1226 | | |
1227 | 17 | pinfo->fragmented = true; |
1228 | 17 | *show_data_ptr = true; |
1229 | 17 | if (!ipv6_reassemble) { |
1230 | | /* not reassembling */ |
1231 | 17 | if (frag_off == 0) { |
1232 | | /* first fragment */ |
1233 | 2 | *show_data_ptr = false; |
1234 | 2 | } |
1235 | 17 | return false; |
1236 | 17 | } |
1237 | | |
1238 | | /* reassembling */ |
1239 | 0 | if (tvb_bytes_exist(*tvb_ptr, *offset_ptr, plen)) { |
1240 | 0 | ipfd_head = fragment_add_check(&ipv6_reassembly_table, |
1241 | 0 | *tvb_ptr, *offset_ptr, pinfo, frag_ident, NULL, |
1242 | 0 | frag_off, plen, frag_flg); |
1243 | 0 | next_tvb = process_reassembled_data(*tvb_ptr, *offset_ptr, pinfo, "Reassembled IPv6", |
1244 | 0 | ipfd_head, &ipv6_frag_items, &update_col_info, ipv6_tree); |
1245 | 0 | if (next_tvb) { |
1246 | | /* Process post-fragment headers after reassembly */ |
1247 | 0 | *offset_ptr = 0; |
1248 | 0 | *tvb_ptr = next_tvb; |
1249 | 0 | pinfo->fragmented = false; |
1250 | 0 | *show_data_ptr = false; |
1251 | 0 | return true; |
1252 | 0 | } |
1253 | 0 | } |
1254 | 0 | return false; |
1255 | 0 | } |
1256 | | |
1257 | | static proto_item * |
1258 | | _proto_tree_add_ipv6_vector_address(proto_tree *tree, packet_info *pinfo, int hfindex, tvbuff_t *tvb, int start, |
1259 | | int length, const ws_in6_addr *value_ptr, int idx) |
1260 | 3.38k | { |
1261 | 3.38k | address addr; |
1262 | 3.38k | char *str; |
1263 | | |
1264 | 3.38k | set_address_ipv6(&addr, value_ptr); |
1265 | 3.38k | str = address_with_resolution_to_str(pinfo->pool, &addr); |
1266 | 3.38k | return proto_tree_add_ipv6_format(tree, hfindex, tvb, start, length, |
1267 | 3.38k | value_ptr, "Address[%d]: %s", idx, str); |
1268 | 3.38k | } |
1269 | | |
1270 | | /* IPv6 Source Routing Header (Type 0) */ |
1271 | | static int |
1272 | | dissect_routing6_rt0(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data) |
1273 | 87 | { |
1274 | 87 | struct ws_rthdr *rt = (struct ws_rthdr *)data; |
1275 | 87 | proto_item *ti; |
1276 | 87 | int offset = 0; |
1277 | 87 | int idx; |
1278 | 87 | int rt0_addr_count; |
1279 | 87 | const ws_in6_addr *addr = NULL; |
1280 | | |
1281 | 87 | proto_tree_add_item(tree, hf_ipv6_routing_src_reserved, tvb, offset, 4, ENC_NA); |
1282 | 87 | offset += 4; |
1283 | | |
1284 | 87 | if (rt->hdr.ip6r_len % 2 != 0) { |
1285 | 20 | expert_add_info_format(pinfo, rt->ti_len, &ei_ipv6_routing_invalid_length, |
1286 | 20 | "IPv6 Routing Header extension header length must not be odd"); |
1287 | 20 | } |
1288 | 87 | rt0_addr_count = rt->hdr.ip6r_len / 2; |
1289 | 87 | if (rt->hdr.ip6r_segleft > rt0_addr_count) { |
1290 | 31 | expert_add_info_format(pinfo, rt->ti_segleft, &ei_ipv6_routing_invalid_segleft, |
1291 | 31 | "IPv6 Type 0 Routing Header segments left field must not exceed address count (%u)", rt0_addr_count); |
1292 | 31 | } |
1293 | | |
1294 | 477 | for (idx = 1; idx <= rt0_addr_count; idx++) { |
1295 | 390 | addr = tvb_get_ptr_ipv6(tvb, offset); |
1296 | 390 | ti = _proto_tree_add_ipv6_vector_address(tree, pinfo, hf_ipv6_routing_src_addr, tvb, |
1297 | 390 | offset, IPv6_ADDR_SIZE, addr, idx); |
1298 | 390 | offset += IPv6_ADDR_SIZE; |
1299 | 390 | if (in6_addr_is_multicast(addr)) { |
1300 | 93 | expert_add_info(pinfo, ti, &ei_ipv6_src_route_list_multicast_addr); |
1301 | 93 | } |
1302 | 390 | } |
1303 | | |
1304 | 87 | if (addr != NULL && pinfo->dst.type == AT_IPv6 && rt->hdr.ip6r_segleft > 0) { |
1305 | 3 | alloc_address_wmem_ipv6(pinfo->pool, &pinfo->dst, addr); |
1306 | 3 | } |
1307 | | |
1308 | 87 | expert_add_info(pinfo, rt->ti_type, &ei_ipv6_routing_deprecated); |
1309 | 87 | return tvb_captured_length(tvb); |
1310 | 87 | } |
1311 | | |
1312 | | /* Mobile IPv6 Routing Header (Type 2) */ |
1313 | | static int |
1314 | | dissect_routing6_mipv6(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data) |
1315 | 12 | { |
1316 | 12 | struct ws_rthdr *rt = (struct ws_rthdr *)data; |
1317 | 12 | proto_item *ti; |
1318 | 12 | int offset = 0; |
1319 | 12 | const ws_in6_addr *addr; |
1320 | | |
1321 | 12 | proto_tree_add_item(tree, hf_ipv6_routing_mipv6_reserved, tvb, offset, 4, ENC_NA); |
1322 | 12 | offset += 4; |
1323 | | |
1324 | 12 | if (rt->hdr.ip6r_len != 2) { |
1325 | 7 | expert_add_info_format(pinfo, rt->ti_len, &ei_ipv6_routing_invalid_length, |
1326 | 7 | "IPv6 Type 2 Routing Header extension header length must equal 2"); |
1327 | 7 | } |
1328 | 12 | if (rt->hdr.ip6r_segleft != 1) { |
1329 | 9 | expert_add_info_format(pinfo, rt->ti_segleft, &ei_ipv6_routing_invalid_segleft, |
1330 | 9 | "IPv6 Type 2 Routing Header segments left field must equal 1"); |
1331 | 9 | } |
1332 | | |
1333 | 12 | addr = tvb_get_ptr_ipv6(tvb, offset); |
1334 | 12 | ti = _proto_tree_add_ipv6_vector_address(tree, pinfo, hf_ipv6_routing_mipv6_home_address, tvb, |
1335 | 12 | offset, IPv6_ADDR_SIZE, addr, 1); |
1336 | 12 | if (in6_addr_is_multicast(addr)) { |
1337 | 3 | expert_add_info(pinfo, ti, &ei_ipv6_src_route_list_multicast_addr); |
1338 | 3 | } |
1339 | | |
1340 | 12 | if (pinfo->dst.type == AT_IPv6 && rt->hdr.ip6r_segleft > 0) { |
1341 | 3 | alloc_address_wmem_ipv6(pinfo->pool, &pinfo->dst, addr); |
1342 | 3 | } |
1343 | | |
1344 | 12 | return tvb_captured_length(tvb); |
1345 | 12 | } |
1346 | | |
1347 | | /* RPL Source Routing Header (Type 3) */ |
1348 | | static int |
1349 | | dissect_routing6_rpl(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data) |
1350 | 66 | { |
1351 | 66 | struct ws_rthdr *rt = (struct ws_rthdr *)data; |
1352 | 66 | proto_item *ti; |
1353 | 66 | int offset = 0; |
1354 | 66 | uint8_t cmprI, cmprE, cmprX, pad; |
1355 | 66 | uint32_t reserved; |
1356 | 66 | int idx; |
1357 | 66 | int rpl_addr_count; |
1358 | 66 | ws_in6_addr rpl_fulladdr; |
1359 | 66 | const ws_in6_addr *ip6_dst_addr, *ip6_src_addr; |
1360 | 66 | wmem_array_t *rpl_addr_vector = NULL; |
1361 | 66 | unsigned i; |
1362 | | |
1363 | | /* Must be IPv6 addresses */ |
1364 | 66 | if ((pinfo->dst.type != AT_IPv6) || (pinfo->src.type != AT_IPv6)) |
1365 | 1 | return 0; |
1366 | | |
1367 | | /* IPv6 destination address used for elided bytes */ |
1368 | 65 | ip6_dst_addr = (const ws_in6_addr *)pinfo->dst.data; |
1369 | | /* IPv6 source address used for strict checking */ |
1370 | 65 | ip6_src_addr = (const ws_in6_addr *)pinfo->src.data; |
1371 | | |
1372 | | /* from RFC6554: Multicast addresses MUST NOT appear in the IPv6 Destination Address field */ |
1373 | 65 | if (in6_addr_is_multicast(ip6_dst_addr)) { |
1374 | 26 | expert_add_info(pinfo, proto_tree_get_parent(tree), &ei_ipv6_dst_addr_not_multicast); |
1375 | 26 | } |
1376 | | |
1377 | 65 | proto_tree_add_item(tree, hf_ipv6_routing_rpl_cmprI, tvb, offset, 4, ENC_BIG_ENDIAN); |
1378 | 65 | proto_tree_add_item(tree, hf_ipv6_routing_rpl_cmprE, tvb, offset, 4, ENC_BIG_ENDIAN); |
1379 | 65 | ti = proto_tree_add_item(tree, hf_ipv6_routing_rpl_pad, tvb, offset, 4, ENC_BIG_ENDIAN); |
1380 | | |
1381 | 65 | cmprI = tvb_get_uint8(tvb, offset) & 0xF0; |
1382 | 65 | cmprE = tvb_get_uint8(tvb, offset) & 0x0F; |
1383 | 65 | pad = tvb_get_uint8(tvb, offset + 1) & 0xF0; |
1384 | | |
1385 | | /* Shift bytes over */ |
1386 | 65 | cmprI >>= 4; |
1387 | 65 | pad >>= 4; |
1388 | | |
1389 | | /* from RFC6554: when CmprI and CmprE are both 0, Pad MUST carry a value of 0 */ |
1390 | 65 | if (cmprI == 0 && cmprE == 0 && pad != 0) { |
1391 | 2 | expert_add_info_format(pinfo, ti, &ei_ipv6_routing_rpl_cmpri_cmpre_pad, "When cmprI equals 0 and cmprE equals 0, pad MUST equal 0 but instead was %d", pad); |
1392 | 2 | } |
1393 | | |
1394 | 65 | ti = proto_tree_add_item(tree, hf_ipv6_routing_rpl_reserved, tvb, offset, 4, ENC_BIG_ENDIAN); |
1395 | 65 | reserved = tvb_get_bits32(tvb, ((offset + 1) * 8) + 4, 20, ENC_BIG_ENDIAN); |
1396 | | |
1397 | 65 | if (reserved != 0) { |
1398 | 62 | expert_add_info_format(pinfo, ti, &ei_ipv6_routing_rpl_reserved, "Reserved field must equal 0 but instead was %d", reserved); |
1399 | 62 | } |
1400 | | |
1401 | | /* From RFC6554: |
1402 | | * n = (((Hdr Ext Len * 8) - Pad - (16 - CmprE)) / (16 - CmprI)) + 1 |
1403 | | */ |
1404 | 65 | rpl_addr_count = 0; |
1405 | 65 | if (rt->hdr.ip6r_len > 0) { |
1406 | 63 | rpl_addr_count = (((rt->hdr.ip6r_len * 8) - pad - (16 - cmprE)) / (16 - cmprI)) + 1; |
1407 | 63 | } |
1408 | 65 | ti = proto_tree_add_int(tree, hf_ipv6_routing_rpl_addr_count, tvb, offset, 2, rpl_addr_count); |
1409 | 65 | proto_item_set_generated(ti); |
1410 | 65 | if (rpl_addr_count < 0) { |
1411 | | /* This error should always be reported */ |
1412 | 2 | expert_add_info_format(pinfo, ti, &ei_ipv6_routing_rpl_addr_count_ge0, "Calculated total address count must be greater than or equal to 0, instead was %d", rpl_addr_count); |
1413 | 2 | } |
1414 | 63 | else if (rt->hdr.ip6r_segleft > (unsigned)rpl_addr_count) { |
1415 | 14 | expert_add_info_format(pinfo, rt->ti_segleft, &ei_ipv6_routing_invalid_segleft, |
1416 | 14 | "IPv6 RPL Routing Header segments left field must not exceed address count (%d)", rpl_addr_count); |
1417 | 14 | } |
1418 | | |
1419 | 65 | if (rpl_addr_count > 0) { |
1420 | 61 | offset += 4; |
1421 | | |
1422 | 61 | if (g_ipv6_rpl_srh_strict_rfc_checking) |
1423 | 0 | rpl_addr_vector = wmem_array_sized_new(pinfo->pool, IPv6_ADDR_SIZE, rpl_addr_count); |
1424 | | |
1425 | | /* We use cmprI for internal (e.g.: not last) address for how many bytes to elide, so actual bytes present = 16-CmprI */ |
1426 | 3.01k | for (idx = 1; idx <= rpl_addr_count; idx++) { |
1427 | 2.95k | if (idx == rpl_addr_count) |
1428 | 9 | cmprX = 16 - cmprE; |
1429 | 2.94k | else |
1430 | 2.94k | cmprX = 16 - cmprI; |
1431 | 2.95k | proto_tree_add_item(tree, hf_ipv6_routing_rpl_addr, tvb, offset, cmprX, ENC_NA); |
1432 | | /* Display Full Address */ |
1433 | 2.95k | memcpy(&rpl_fulladdr, ip6_dst_addr, IPv6_ADDR_SIZE); |
1434 | 2.95k | tvb_memcpy(tvb, &rpl_fulladdr.bytes[16-cmprX], offset, cmprX); |
1435 | 2.95k | ti = _proto_tree_add_ipv6_vector_address(tree, pinfo, hf_ipv6_routing_rpl_fulladdr, tvb, |
1436 | 2.95k | offset, cmprX, &rpl_fulladdr, idx); |
1437 | 2.95k | proto_item_set_generated(ti); |
1438 | 2.95k | offset += cmprX; |
1439 | | |
1440 | | /* IPv6 Source and Destination addresses of the encapsulating datagram (MUST) not appear in the SRH*/ |
1441 | 2.95k | if (memcmp(&rpl_fulladdr, ip6_src_addr, IPv6_ADDR_SIZE) == 0) { |
1442 | 60 | expert_add_info(pinfo, ti, &ei_ipv6_src_route_list_src_addr); |
1443 | 60 | } |
1444 | 2.95k | if (memcmp(&rpl_fulladdr, ip6_dst_addr, IPv6_ADDR_SIZE) == 0) { |
1445 | 474 | expert_add_info(pinfo, ti, &ei_ipv6_src_route_list_dst_addr); |
1446 | 474 | } |
1447 | | |
1448 | | /* Multicast addresses MUST NOT appear in the in SRH */ |
1449 | 2.95k | if (in6_addr_is_multicast(&rpl_fulladdr)) { |
1450 | 1.56k | expert_add_info(pinfo, ti, &ei_ipv6_src_route_list_multicast_addr); |
1451 | 1.56k | } |
1452 | | |
1453 | 2.95k | if (g_ipv6_rpl_srh_strict_rfc_checking) { |
1454 | | /* from RFC6554: */ |
1455 | | /* The SRH MUST NOT specify a path that visits a node more than once. */ |
1456 | | /* To do this, we will just check the current 'addr' against the previous addresses */ |
1457 | 0 | for (i = 0; i < wmem_array_get_count(rpl_addr_vector); i++) { |
1458 | | /* Compare the addresses */ |
1459 | 0 | if (memcmp(&rpl_fulladdr, wmem_array_index(rpl_addr_vector, i), IPv6_ADDR_SIZE) == 0) { |
1460 | | /* Found a previous that is the same */ |
1461 | 0 | expert_add_info(pinfo, ti, &ei_ipv6_src_route_list_mult_inst_same_addr); |
1462 | 0 | break; |
1463 | 0 | } |
1464 | 0 | } |
1465 | 0 | wmem_array_append(rpl_addr_vector, &rpl_fulladdr, 1); |
1466 | 0 | } |
1467 | | |
1468 | 2.95k | if (pinfo->dst.type == AT_IPv6 && rt->hdr.ip6r_segleft > 0) { |
1469 | 1.45k | alloc_address_wmem_ipv6(pinfo->pool, &pinfo->dst, &rpl_fulladdr); |
1470 | 1.45k | } |
1471 | 2.95k | } |
1472 | 61 | } |
1473 | | |
1474 | 65 | return tvb_captured_length(tvb); |
1475 | 66 | } |
1476 | | |
1477 | | /* Segment Routing Header (Type 4) */ |
1478 | | static int |
1479 | | dissect_routing6_srh(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data) |
1480 | 20 | { |
1481 | 20 | struct ws_rthdr *rt = (struct ws_rthdr *)data; |
1482 | 20 | int offset = 0; |
1483 | 20 | int addr_offset; |
1484 | 20 | uint32_t last_entry, addr_count; |
1485 | | |
1486 | 20 | proto_tree_add_item_ret_uint(tree, hf_ipv6_routing_srh_last_entry, |
1487 | 20 | tvb, offset, 1, ENC_BIG_ENDIAN, |
1488 | 20 | &last_entry); |
1489 | 20 | addr_count = last_entry + 1; |
1490 | 20 | offset += 1; |
1491 | | |
1492 | 20 | proto_tree_add_item(tree, hf_ipv6_routing_srh_flags, tvb, offset, 1, ENC_BIG_ENDIAN); |
1493 | 20 | offset += 1; |
1494 | | |
1495 | 20 | proto_tree_add_item(tree, hf_ipv6_routing_srh_tag, tvb, offset, 2, ENC_NA); |
1496 | 20 | offset += 2; |
1497 | | |
1498 | 20 | if (rt->hdr.ip6r_segleft > addr_count) { |
1499 | 9 | expert_add_info_format(pinfo, rt->ti_segleft, &ei_ipv6_routing_invalid_segleft, |
1500 | 9 | "IPv6 Type 4 Routing Header segments left field must not exceed address count (%u)", addr_count); |
1501 | 9 | } |
1502 | | |
1503 | 20 | if (pinfo->dst.type == AT_IPv6 && rt->hdr.ip6r_segleft > 0) { |
1504 | 8 | alloc_address_wmem_ipv6(pinfo->pool, &pinfo->dst, tvb_get_ptr_ipv6(tvb, offset)); |
1505 | 8 | } |
1506 | | |
1507 | 158 | for (unsigned i = 0; i < addr_count; i++) { |
1508 | 138 | addr_offset = offset + i * IPv6_ADDR_SIZE; |
1509 | 138 | _proto_tree_add_ipv6_vector_address(tree, pinfo, hf_ipv6_routing_srh_addr, tvb, |
1510 | 138 | addr_offset, IPv6_ADDR_SIZE, tvb_get_ptr_ipv6(tvb, addr_offset), i); |
1511 | 138 | } |
1512 | | |
1513 | | /* TODO: dissect TLVs */ |
1514 | | |
1515 | 20 | return tvb_captured_length(tvb); |
1516 | 20 | } |
1517 | | |
1518 | | /* Compact Routing Header 16 (Type 5) and Compact Routing Header 32 (Type 6). |
1519 | | https://tools.ietf.org/html/draft-bonica-6man-comp-rtg-hdr-23. */ |
1520 | | static int dissect_routing6_crh(tvbuff_t* tvb, packet_info* pinfo, proto_tree* tree, void* data) |
1521 | 53 | { |
1522 | 53 | int offset, minimum_crh_length; |
1523 | 53 | int sid; |
1524 | | |
1525 | 53 | unsigned sid_count; |
1526 | 53 | unsigned octets_per_sid; |
1527 | 53 | unsigned sids_beyond_first_word; |
1528 | 53 | unsigned sids_per_word; |
1529 | 53 | struct ws_rthdr* rt = (struct ws_rthdr*)data; |
1530 | 53 | bool is_crh16 = rt->hdr.ip6r_type == IPv6_RT_HEADER_COMPACT_16; |
1531 | 53 | uint8_t segments_left = rt->hdr.ip6r_segleft; |
1532 | | |
1533 | | /* Compute the minimum CRH length measured in 8-octet units, not including |
1534 | | the first 8 octets */ |
1535 | 53 | minimum_crh_length = -1; |
1536 | 53 | switch (rt->hdr.ip6r_type) { |
1537 | 18 | case IPv6_RT_HEADER_COMPACT_16: |
1538 | 18 | octets_per_sid = 2; |
1539 | 18 | sids_per_word = 4; |
1540 | 18 | sid_count = rt->hdr.ip6r_len * 4 + 2; |
1541 | 18 | if (segments_left <= 2) |
1542 | 6 | minimum_crh_length = 0; |
1543 | 18 | sids_beyond_first_word = segments_left - 2; |
1544 | 18 | break; |
1545 | 35 | case IPv6_RT_HEADER_COMPACT_32: |
1546 | 35 | octets_per_sid = 4; |
1547 | 35 | sids_per_word = 2; |
1548 | 35 | sid_count = rt->hdr.ip6r_len * 2 + 1; |
1549 | 35 | if (segments_left <= 1) |
1550 | 14 | minimum_crh_length = 0; |
1551 | 35 | sids_beyond_first_word = segments_left - 1; |
1552 | 35 | break; |
1553 | 0 | default: |
1554 | 0 | DISSECTOR_ASSERT_NOT_REACHED(); |
1555 | 53 | } |
1556 | 53 | if (minimum_crh_length) { |
1557 | 33 | minimum_crh_length = sids_beyond_first_word / sids_per_word; |
1558 | 33 | if (sids_beyond_first_word % sids_per_word) |
1559 | 29 | minimum_crh_length++; |
1560 | 33 | } |
1561 | 53 | if (minimum_crh_length > rt->hdr.ip6r_len) { |
1562 | 3 | expert_add_info_format(pinfo, rt->ti_len, &ei_ipv6_routing_invalid_length, |
1563 | 3 | "IPv6 Compact Routing Header minimum length must not exceed header length (%u)", |
1564 | 3 | rt->hdr.ip6r_len); |
1565 | 3 | } |
1566 | | |
1567 | 53 | offset = 0; |
1568 | 53 | if (is_crh16) { |
1569 | 18 | proto_item* current_sid_item = proto_tree_add_item(tree, hf_ipv6_routing_crh16_current_sid, |
1570 | 18 | tvb, offset + (octets_per_sid * segments_left), octets_per_sid, ENC_BIG_ENDIAN); |
1571 | 18 | proto_item_set_generated(current_sid_item); |
1572 | 35 | } else { |
1573 | 35 | proto_item* current_sid_item = proto_tree_add_item(tree, hf_ipv6_routing_crh32_current_sid, |
1574 | 35 | tvb, offset + (octets_per_sid * segments_left), octets_per_sid, ENC_BIG_ENDIAN); |
1575 | 35 | proto_item_set_generated(current_sid_item); |
1576 | 35 | } |
1577 | 53 | sid = is_crh16 ? tvb_get_uint16(tvb, offset, ENC_BIG_ENDIAN) |
1578 | 53 | : tvb_get_uint32(tvb, offset, ENC_BIG_ENDIAN); |
1579 | 53 | proto_tree* segment_ids |
1580 | 53 | = proto_tree_add_subtree(tree, tvb, 0, -1, 0, NULL, "Segment Identifiers"); |
1581 | 496 | for (unsigned i = 0; i < sid_count && sid; i++) { |
1582 | 443 | if (is_crh16) { |
1583 | 155 | proto_tree_add_uint_format(segment_ids, hf_ipv6_routing_crh16_segment_id, tvb, offset, |
1584 | 155 | octets_per_sid, sid, "SID[%d] = %d", i, sid); |
1585 | 288 | } else { |
1586 | 288 | proto_tree_add_uint_format(segment_ids, hf_ipv6_routing_crh32_segment_id, tvb, offset, |
1587 | 288 | octets_per_sid, sid, "SID[%d] = %d", i, sid); |
1588 | 288 | } |
1589 | 443 | offset += octets_per_sid; |
1590 | 443 | sid = is_crh16 ? tvb_get_uint16(tvb, offset, ENC_BIG_ENDIAN) |
1591 | 443 | : tvb_get_uint32(tvb, offset, ENC_BIG_ENDIAN); |
1592 | 443 | } |
1593 | | |
1594 | 53 | return tvb_captured_length(tvb); |
1595 | 53 | } |
1596 | | |
1597 | | /* |
1598 | | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ |
1599 | | | Next Header | Hdr Ext Len | Routing Type | Segments Left | |
1600 | | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ |
1601 | | | | |
1602 | | . . |
1603 | | . type-specific data . |
1604 | | . . |
1605 | | | | |
1606 | | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ |
1607 | | */ |
1608 | | static int |
1609 | 285 | dissect_routing6(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data) { |
1610 | 285 | struct ws_rthdr rt; |
1611 | 285 | unsigned nxt, hdr_len, total_len; |
1612 | 285 | proto_tree *rt_tree, *root_tree; |
1613 | 285 | proto_item *pi, *ti, *ti_hdr_len, *ti_type, *ti_segs; |
1614 | 285 | int offset = 0; |
1615 | 285 | tvbuff_t *next_tvb; |
1616 | 285 | int type, type_len; |
1617 | 285 | dissector_handle_t type_dissector; |
1618 | | |
1619 | 285 | col_append_sep_str(pinfo->cinfo, COL_INFO, " , ", "IPv6 routing"); |
1620 | | |
1621 | 285 | root_tree = p_ipv6_pinfo_select_root(pinfo, tree); |
1622 | | |
1623 | 285 | pi = proto_tree_add_item(root_tree, proto_ipv6_routing, tvb, offset, -1, ENC_NA); |
1624 | 285 | rt_tree = proto_item_add_subtree(pi, ett_ipv6_routing_proto); |
1625 | | |
1626 | 285 | proto_tree_add_item(rt_tree, hf_ipv6_routing_nxt, tvb, offset, 1, ENC_BIG_ENDIAN); |
1627 | 285 | nxt = tvb_get_uint8(tvb, offset); |
1628 | 285 | offset += 1; |
1629 | | |
1630 | 285 | ti_hdr_len = proto_tree_add_item(rt_tree, hf_ipv6_routing_len, tvb, offset, 1, ENC_BIG_ENDIAN); |
1631 | 285 | hdr_len = tvb_get_uint8(tvb, offset); |
1632 | | /* |
1633 | | Hdr Ext Len 8-bit unsigned integer. Length of the Routing |
1634 | | header in 8-octet units, not including the |
1635 | | first 8 octets. |
1636 | | */ |
1637 | 285 | total_len = (hdr_len + 1) * 8; |
1638 | 285 | type_len = total_len - 4; |
1639 | | |
1640 | 285 | proto_item_set_len(pi, total_len); |
1641 | 285 | ti = proto_tree_add_uint(rt_tree, hf_ipv6_routing_len_oct, tvb, offset, 1, total_len); |
1642 | 285 | proto_item_set_generated(ti); |
1643 | 285 | if (ipv6_exthdr_hide_len_oct_field) { |
1644 | 0 | proto_item_set_hidden(ti); |
1645 | 0 | proto_item_append_text(ti_hdr_len, " (%d bytes)", total_len); |
1646 | 0 | } |
1647 | 285 | p_ipv6_pinfo_add_len(pinfo, total_len); |
1648 | 285 | offset += 1; |
1649 | | |
1650 | 285 | ti_type = proto_tree_add_item(rt_tree, hf_ipv6_routing_type, tvb, offset, 1, ENC_BIG_ENDIAN); |
1651 | 285 | type = tvb_get_uint8(tvb, offset); |
1652 | 285 | proto_item_append_text(pi, " (%s)", val_to_str(pinfo->pool, type, routing_header_type, "Unknown type %u")); |
1653 | 285 | offset += 1; |
1654 | | |
1655 | 285 | ti_segs = proto_tree_add_item(rt_tree, hf_ipv6_routing_segleft, tvb, offset, 1, ENC_BIG_ENDIAN); |
1656 | 285 | offset += 1; |
1657 | | |
1658 | 285 | type_dissector = dissector_get_uint_handle(ipv6_routing_dissector_table, type); |
1659 | 285 | if (type_dissector != NULL) { |
1660 | 238 | tvb_memcpy(tvb, &(rt.hdr), 0, 4); |
1661 | 238 | rt.ti_len = ti_hdr_len; |
1662 | 238 | rt.ti_type = ti_type; |
1663 | 238 | rt.ti_segleft = ti_segs; |
1664 | 238 | call_dissector_with_data(type_dissector, tvb_new_subset_length(tvb, offset, type_len), pinfo, rt_tree, &rt); |
1665 | 238 | } |
1666 | 47 | else { |
1667 | | /* Unknown Routing Header Type */ |
1668 | 47 | ti = proto_tree_add_item(rt_tree, hf_ipv6_routing_unknown_data, tvb, offset, type_len, ENC_NA); |
1669 | 47 | expert_add_info(pinfo, ti, &ei_ipv6_routing_undecoded); |
1670 | 47 | } |
1671 | | |
1672 | 285 | p_add_ipv6_nxt(pinfo, nxt); |
1673 | | |
1674 | 285 | next_tvb = tvb_new_subset_remaining(tvb, total_len); |
1675 | 285 | ipv6_dissect_next(nxt, next_tvb, pinfo, tree, (ws_ip6 *)data); |
1676 | 285 | return tvb_captured_length(tvb); |
1677 | 285 | } |
1678 | | |
1679 | | static int |
1680 | 90 | dissect_fraghdr(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data) { |
1681 | 90 | proto_item *pi, *ti; |
1682 | 90 | proto_tree *frag_tree, *root_tree; |
1683 | 90 | uint8_t nxt; |
1684 | 90 | uint16_t offlg; |
1685 | 90 | uint16_t frag_off; |
1686 | 90 | bool frag_flg; |
1687 | 90 | uint32_t frag_ident; |
1688 | 90 | int offset = 0; |
1689 | 90 | ipv6_pinfo_t *ipv6_pinfo; |
1690 | 90 | bool show_data = false; |
1691 | 90 | bool reassembled; |
1692 | 90 | tvbuff_t *next_tvb; |
1693 | | |
1694 | 90 | nxt = tvb_get_uint8(tvb, offset); |
1695 | 90 | offlg = tvb_get_ntohs(tvb, offset + 2); |
1696 | 90 | frag_off = offlg & IP6F_OFF_MASK; /* offset in bytes */ |
1697 | 90 | frag_flg = offlg & IP6F_MORE_FRAG; |
1698 | 90 | frag_ident = tvb_get_ntohl(tvb, offset + 4); |
1699 | 90 | col_add_fstr(pinfo->cinfo, COL_INFO, "IPv6 fragment (off=%u more=%s ident=0x%08x nxt=%u)", |
1700 | 90 | frag_off, frag_flg ? "y" : "n", frag_ident, nxt); |
1701 | | |
1702 | 90 | root_tree = p_ipv6_pinfo_select_root(pinfo, tree); |
1703 | 90 | ipv6_pinfo = p_ipv6_pinfo_add_len(pinfo, IPv6_FRAGMENT_HDR_SIZE); |
1704 | | |
1705 | | /* IPv6 Fragmentation Header has fixed length of 8 bytes */ |
1706 | 90 | pi = proto_tree_add_item(root_tree, proto_ipv6_fraghdr, tvb, offset, IPv6_FRAGMENT_HDR_SIZE, ENC_NA); |
1707 | 90 | if (ipv6_pinfo != NULL && ipv6_pinfo->jumbo_plen != 0) { |
1708 | 0 | expert_add_info(pinfo, pi, &ei_ipv6_opt_jumbo_fragment); |
1709 | 0 | } |
1710 | | |
1711 | 90 | frag_tree = proto_item_add_subtree(pi, ett_ipv6_fraghdr_proto); |
1712 | | |
1713 | 90 | proto_tree_add_item(frag_tree, hf_ipv6_fraghdr_nxt, tvb, offset, 1, ENC_BIG_ENDIAN); |
1714 | 90 | offset += 1; |
1715 | | |
1716 | 90 | proto_tree_add_item(frag_tree, hf_ipv6_fraghdr_reserved_octet, tvb, offset, 1, ENC_BIG_ENDIAN); |
1717 | 90 | offset += 1; |
1718 | | |
1719 | 90 | ti = proto_tree_add_item(frag_tree, hf_ipv6_fraghdr_offset, tvb, offset, 2, ENC_BIG_ENDIAN); |
1720 | 90 | proto_item_append_text(ti, " (%d bytes)", frag_off); |
1721 | | |
1722 | 90 | proto_tree_add_item(frag_tree, hf_ipv6_fraghdr_reserved_bits, tvb, offset, 2, ENC_BIG_ENDIAN); |
1723 | | |
1724 | 90 | proto_tree_add_item(frag_tree, hf_ipv6_fraghdr_more, tvb, offset, 2, ENC_BIG_ENDIAN); |
1725 | 90 | offset += 2; |
1726 | | |
1727 | 90 | proto_tree_add_item(frag_tree, hf_ipv6_fraghdr_ident, tvb, offset, 4, ENC_BIG_ENDIAN); |
1728 | 90 | offset += 4; |
1729 | | |
1730 | 90 | if (ipv6_pinfo != NULL && ipv6_pinfo->frag_plen > 0) { |
1731 | 25 | if ((frag_off != 0) || frag_flg) { |
1732 | 17 | reassembled = ipv6_reassemble_do(&tvb, &offset, pinfo, root_tree, ipv6_pinfo->frag_plen, |
1733 | 17 | frag_off, frag_flg, frag_ident, &show_data); |
1734 | 17 | if (show_data) { |
1735 | 15 | next_tvb = tvb_new_subset_remaining(tvb, offset); |
1736 | 15 | call_data_dissector(next_tvb, pinfo, tree); |
1737 | 15 | return tvb_captured_length(tvb); |
1738 | 15 | } |
1739 | 2 | if (reassembled) { |
1740 | 0 | ipv6_pinfo->frag_plen = 0; |
1741 | 0 | next_tvb = tvb_new_subset_remaining(tvb, offset); |
1742 | 0 | ipv6_dissect_next(nxt, next_tvb, pinfo, tree, (ws_ip6 *)data); |
1743 | 0 | return tvb_captured_length(tvb); |
1744 | 0 | } |
1745 | 2 | } |
1746 | 25 | } |
1747 | | |
1748 | 75 | p_add_ipv6_nxt(pinfo, nxt); |
1749 | | |
1750 | 75 | next_tvb = tvb_new_subset_remaining(tvb, offset); |
1751 | 75 | ipv6_dissect_next(nxt, next_tvb, pinfo, tree, (ws_ip6 *)data); |
1752 | 75 | return tvb_captured_length(tvb); |
1753 | 90 | } |
1754 | | |
1755 | | struct opt_proto_item { |
1756 | | proto_item *type, *len; |
1757 | | proto_tree *root_tree; |
1758 | | }; |
1759 | | |
1760 | | /* |
1761 | | * Jumbo Payload Option |
1762 | | * |
1763 | | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ |
1764 | | | Option Type | Opt Data Len | |
1765 | | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ |
1766 | | | Jumbo Payload Length | |
1767 | | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ |
1768 | | */ |
1769 | | static int |
1770 | | dissect_opt_jumbo(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *opt_tree, |
1771 | | struct opt_proto_item *opt_ti, uint8_t opt_len) |
1772 | 197 | { |
1773 | 197 | proto_item *pi = proto_tree_get_parent(opt_tree); |
1774 | 197 | proto_item *ti; |
1775 | 197 | uint32_t jumbo_plen = 0; |
1776 | 197 | ipv6_pinfo_t *ipv6_pinfo = p_get_ipv6_pinfo(pinfo); |
1777 | | |
1778 | 197 | if (opt_len != 4) { |
1779 | 194 | expert_add_info_format(pinfo, opt_ti->len, &ei_ipv6_opt_invalid_len, |
1780 | 194 | "Jumbo Payload: Invalid length (%u bytes)", opt_len); |
1781 | 194 | } |
1782 | 197 | ti = proto_tree_add_item_ret_uint(opt_tree, hf_ipv6_opt_jumbo, tvb, offset, 4, ENC_BIG_ENDIAN, &jumbo_plen); |
1783 | 197 | offset += 4; |
1784 | | |
1785 | 197 | if (ipv6_pinfo != NULL && ipv6_pinfo->ip6_plen != 0) { |
1786 | 94 | expert_add_info(pinfo, pi, &ei_ipv6_opt_jumbo_prohibited); |
1787 | 94 | } |
1788 | 197 | if (jumbo_plen < 65536) { |
1789 | 24 | expert_add_info(pinfo, ti, &ei_ipv6_opt_jumbo_truncated); |
1790 | 24 | } |
1791 | | |
1792 | 197 | return offset; |
1793 | 197 | } |
1794 | | |
1795 | | /* |
1796 | | * RPL Option |
1797 | | * |
1798 | | 0 1 2 3 |
1799 | | 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 |
1800 | | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ |
1801 | | | Option Type | Opt Data Len | |
1802 | | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ |
1803 | | |O|R|F|0|0|0|0|0| RPLInstanceID | SenderRank | |
1804 | | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ |
1805 | | | (sub-TLVs) | |
1806 | | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ |
1807 | | */ |
1808 | | static int |
1809 | | dissect_opt_rpl(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *opt_tree, |
1810 | | struct opt_proto_item *opt_ti, uint8_t opt_len) |
1811 | 407 | { |
1812 | 407 | static int * const rpl_flags[] = { |
1813 | 407 | &hf_ipv6_opt_rpl_flag_o, |
1814 | 407 | &hf_ipv6_opt_rpl_flag_r, |
1815 | 407 | &hf_ipv6_opt_rpl_flag_f, |
1816 | 407 | &hf_ipv6_opt_rpl_flag_rsv, |
1817 | 407 | NULL |
1818 | 407 | }; |
1819 | | |
1820 | 407 | if (opt_len < 4) { |
1821 | 86 | expert_add_info_format(pinfo, opt_ti->len, &ei_ipv6_opt_invalid_len, |
1822 | 86 | "RPL Option: Invalid length (%u bytes)", opt_len); |
1823 | 86 | } |
1824 | 407 | proto_tree_add_bitmask(opt_tree, tvb, offset, hf_ipv6_opt_rpl_flag, ett_ipv6_opt_rpl, rpl_flags, ENC_NA); |
1825 | 407 | offset += 1; |
1826 | 407 | proto_tree_add_item(opt_tree, hf_ipv6_opt_rpl_instance_id, tvb, offset, 1, ENC_NA); |
1827 | 407 | offset += 1; |
1828 | 407 | proto_tree_add_item(opt_tree, hf_ipv6_opt_rpl_senderrank, tvb, offset, 2, ENC_BIG_ENDIAN); |
1829 | 407 | offset += 2; |
1830 | | |
1831 | | /* TODO: Add dissection of sub-TLVs */ |
1832 | | |
1833 | 407 | return offset; |
1834 | 407 | } |
1835 | | |
1836 | | /* |
1837 | | * Tunnel Encapsulation Limit Option |
1838 | | * |
1839 | | Option Type Opt Data Len Opt Data Len |
1840 | | 0 1 2 3 4 5 6 7 |
1841 | | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ |
1842 | | |0 0 0 0 0 1 0 0| 1 | Tun Encap Lim | |
1843 | | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ |
1844 | | */ |
1845 | | static int |
1846 | | dissect_opt_tel(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *opt_tree, |
1847 | | struct opt_proto_item *opt_ti, uint8_t opt_len) |
1848 | 363 | { |
1849 | 363 | if (opt_len != 1) { |
1850 | 343 | expert_add_info_format(pinfo, opt_ti->len, &ei_ipv6_opt_invalid_len, |
1851 | 343 | "Tunnel Encapsulation Limit: Invalid length (%u bytes)", opt_len); |
1852 | 343 | } |
1853 | 363 | proto_tree_add_item(opt_tree, hf_ipv6_opt_tel, tvb, offset, 1, ENC_BIG_ENDIAN); |
1854 | 363 | offset += 1; |
1855 | | |
1856 | 363 | return offset; |
1857 | 363 | } |
1858 | | |
1859 | | /* |
1860 | | * IPv6 Minimum Path MTU Hop by Hop Option |
1861 | | * |
1862 | | |
1863 | | Option Option Option |
1864 | | Type Data Len Data |
1865 | | +--------+--------+--------+--------+---------+-------+-+ |
1866 | | |BBCTTTTT|00000100| Min-PMTU | Rtn-PMTU |R| |
1867 | | +--------+--------+--------+--------+---------+-------+-+ |
1868 | | |
1869 | | Option Type: |
1870 | | |
1871 | | BB 00 Skip over this option and continue processing. |
1872 | | |
1873 | | C 1 Option data can change en route to the packet's final |
1874 | | destination. |
1875 | | |
1876 | | TTTTT 10000 Option Type assigned from IANA [IANA-HBH]. |
1877 | | |
1878 | | Length: 4 The size of the each value field in Option Data |
1879 | | field supports Path MTU values from 0 to 65,535 octets. |
1880 | | |
1881 | | Min-PMTU: n 16-bits. The minimum PMTU in octets, reflecting the |
1882 | | smallest link MTU that the packet experienced across |
1883 | | the path. This is called the Reported PMTU. A value |
1884 | | less than the IPv6 minimum link MTU [RFC8200] |
1885 | | should be ignored. |
1886 | | |
1887 | | Rtn-PMTU: n 15-bits. The returned minimum PMTU, carrying the 15 |
1888 | | most significant bits of the latest received Min-PMTU |
1889 | | field. The value zero means that no Reported MTU is |
1890 | | being returned. |
1891 | | |
1892 | | R n 1-bit. R-Flag. Set by the source to signal that |
1893 | | the destination should include the received |
1894 | | Reported PMTU in Rtn-PMTU field. |
1895 | | |
1896 | | [IANA-HBH] |
1897 | | "Destination Options and Hop-by-Hop Options", |
1898 | | <https://www.iana.org/assignments/ipv6-parameters/ |
1899 | | ipv6-parameters.xhtml#ipv6-parameters-2> |
1900 | | */ |
1901 | | static int |
1902 | | dissect_opt_pmtu(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *opt_tree, |
1903 | | struct opt_proto_item *opt_ti, uint8_t opt_len) |
1904 | 336 | { |
1905 | 336 | uint16_t val; |
1906 | | |
1907 | 336 | if (opt_len != 4) { |
1908 | 333 | expert_add_info_format(pinfo, opt_ti->len, &ei_ipv6_opt_invalid_len, |
1909 | 333 | "PMTU Option: Invalid Length (%u bytes)", opt_len); |
1910 | 333 | } |
1911 | | |
1912 | 336 | proto_tree_add_item(opt_tree, hf_ipv6_opt_pmtu_min, tvb, offset, 2, ENC_BIG_ENDIAN); |
1913 | 336 | offset += 2; |
1914 | 336 | val = tvb_get_ntohs(tvb, offset); |
1915 | 336 | proto_tree_add_uint(opt_tree, hf_ipv6_opt_pmtu_rtn, tvb, offset, 2, val & 0xFFFE); |
1916 | 336 | offset += 1; |
1917 | 336 | proto_tree_add_boolean(opt_tree, hf_ipv6_opt_pmtu_rtn_flag, tvb, offset, 1, val & 0x0001); |
1918 | 336 | offset += 1; |
1919 | | |
1920 | 336 | return offset; |
1921 | 336 | } |
1922 | | |
1923 | | /* |
1924 | | * IETF APN6 |
1925 | | * |
1926 | | * Application-Aware IPv6 Networking (APN6) |
1927 | | * |
1928 | | * https://datatracker.ietf.org/wg/apn/about/ |
1929 | | * https://datatracker.ietf.org/doc/draft-li-apn-header/ |
1930 | | * https://datatracker.ietf.org/doc/draft-li-apn-ipv6-encap/ |
1931 | | * |
1932 | | * 0 1 2 3 |
1933 | | 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 |
1934 | | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ |
1935 | | | APN-ID-Type | Flags | APN-Para-Type | |
1936 | | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ |
1937 | | | APN-ID | |
1938 | | | (32-bit/64-bit/128-bit) | |
1939 | | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ |
1940 | | * */ |
1941 | | static int |
1942 | | dissect_opt_apn6(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *opt_tree, |
1943 | | struct opt_proto_item *opt_ti, uint8_t opt_len) |
1944 | 164 | { |
1945 | 164 | if (opt_len < 8) { |
1946 | 73 | expert_add_info_format(pinfo, opt_ti->len, &ei_ipv6_opt_invalid_len, |
1947 | 73 | "APN6 Option: Invalid Length (%u bytes) for basic APN header and shortest APN ID(32-bit)", opt_len); |
1948 | 73 | } |
1949 | | |
1950 | 164 | uint32_t parsed_offset = 0; // offset is for DOH header; parsed_offset is for APN option. |
1951 | 164 | proto_tree *sub_tree = proto_tree_add_subtree(opt_tree, tvb, offset, opt_len, 0, NULL, "APN Header"); |
1952 | | |
1953 | 164 | uint8_t apn_id_type = tvb_get_uint8(tvb, offset); |
1954 | 164 | proto_item *apn_id_type_i = proto_tree_add_item(sub_tree, hf_ipv6_opt_apn_id_type, tvb, offset, 1, ENC_BIG_ENDIAN); |
1955 | | |
1956 | 164 | offset++; |
1957 | 164 | parsed_offset++; |
1958 | | |
1959 | 164 | if (apn_id_type < APN_ID_32BIT || apn_id_type > APN_ID_128BIT) { |
1960 | 141 | expert_add_info_format(pinfo, apn_id_type_i, &ei_ipv6_opt_apn_invalid_id_type, |
1961 | 141 | "APN6 Option: Invalid APN ID Type (%u)", apn_id_type); |
1962 | 141 | } |
1963 | | |
1964 | | |
1965 | 164 | proto_tree_add_item(sub_tree, hf_ipv6_opt_apn_flags, tvb, offset, 1, ENC_BIG_ENDIAN); |
1966 | 164 | offset++; |
1967 | 164 | parsed_offset++; |
1968 | | |
1969 | 164 | proto_tree_add_item(sub_tree, hf_ipv6_opt_apn_param_type, tvb, offset, 2, ENC_BIG_ENDIAN); |
1970 | 164 | offset += 2; |
1971 | 164 | parsed_offset += 2; |
1972 | | |
1973 | | |
1974 | 164 | if (apn_id_type >= APN_ID_32BIT) { |
1975 | 104 | proto_tree_add_item(sub_tree, hf_ipv6_opt_apn_id_part1, tvb, offset, 4, ENC_BIG_ENDIAN); |
1976 | 104 | offset += 4; |
1977 | 104 | parsed_offset += 4; |
1978 | 104 | } |
1979 | 164 | if (apn_id_type >= APN_ID_64BIT) { |
1980 | 85 | if (opt_len - parsed_offset < 4) { |
1981 | 4 | expert_add_info_format(pinfo, opt_ti->len, &ei_ipv6_opt_invalid_len, |
1982 | 4 | "APN6 Option: Invalid Length (%u bytes) for 64-bit APN ID, parsed offset %u", |
1983 | 4 | opt_len, parsed_offset); |
1984 | 4 | } |
1985 | 85 | proto_tree_add_item(sub_tree, hf_ipv6_opt_apn_id_part2, tvb, offset, 4, ENC_BIG_ENDIAN); |
1986 | 85 | offset += 4; |
1987 | 85 | parsed_offset += 4; |
1988 | 85 | } |
1989 | 164 | if (apn_id_type >= APN_ID_128BIT) { |
1990 | 80 | if (opt_len - parsed_offset < 8) { |
1991 | 49 | expert_add_info_format(pinfo, opt_ti->len, &ei_ipv6_opt_invalid_len, |
1992 | 49 | "APN6 Option: Invalid Length (%u bytes) for 128-bit APN ID, parsed offset %u", |
1993 | 49 | opt_len, parsed_offset); |
1994 | 49 | } |
1995 | | |
1996 | 80 | proto_tree_add_item(sub_tree, hf_ipv6_opt_apn_id_part3, tvb, offset, 4, ENC_BIG_ENDIAN); |
1997 | 80 | offset += 4; |
1998 | | |
1999 | 80 | proto_tree_add_item(sub_tree, hf_ipv6_opt_apn_id_part4, tvb, offset, 4, ENC_BIG_ENDIAN); |
2000 | 80 | offset += 4; |
2001 | 80 | } |
2002 | | |
2003 | 164 | return offset; |
2004 | 164 | } |
2005 | | |
2006 | | |
2007 | | /* |
2008 | | * IPv6 Router Alert Option |
2009 | | * |
2010 | | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ |
2011 | | |0 0 0|0 0 1 0 1|0 0 0 0 0 0 1 0| Value (2 octets) | |
2012 | | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ |
2013 | | length = 2 |
2014 | | */ |
2015 | | static int |
2016 | | dissect_opt_rtalert(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *opt_tree, |
2017 | | struct opt_proto_item *opt_ti, uint8_t opt_len) |
2018 | 249 | { |
2019 | 249 | if (opt_len != 2) { |
2020 | 242 | expert_add_info_format(pinfo, opt_ti->len, &ei_ipv6_opt_invalid_len, |
2021 | 242 | "Router alert: Invalid Length (%u bytes)", opt_len); |
2022 | 242 | } |
2023 | 249 | proto_tree_add_item(opt_tree, hf_ipv6_opt_rtalert, tvb, offset, 2, ENC_BIG_ENDIAN); |
2024 | 249 | offset += 2; |
2025 | | |
2026 | 249 | return offset; |
2027 | 249 | } |
2028 | | |
2029 | | /* |
2030 | | * Quick-Start Option for IPv6 |
2031 | | * |
2032 | | 0 1 2 3 |
2033 | | 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 |
2034 | | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ |
2035 | | | Option | Length=6 | Func. | Rate | Not Used | |
2036 | | | | | 1000 | Report| | |
2037 | | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ |
2038 | | | QS Nonce | R | |
2039 | | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ |
2040 | | */ |
2041 | | static int |
2042 | | dissect_opt_quickstart(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *opt_tree, |
2043 | | struct opt_proto_item *opt_ti, uint8_t opt_len, ws_ip6 *iph) |
2044 | 399 | { |
2045 | 399 | proto_item *pi = proto_tree_get_parent(opt_tree); |
2046 | 399 | proto_item *ti; |
2047 | 399 | uint8_t command, function, rate; |
2048 | 399 | uint32_t qs_ttl = 0; |
2049 | | |
2050 | 399 | if (opt_len != 6) { |
2051 | 390 | expert_add_info_format(pinfo, opt_ti->len, &ei_ipv6_opt_invalid_len, |
2052 | 390 | "Quick-Start: Invalid Length (%u bytes)", opt_len); |
2053 | 390 | } |
2054 | | |
2055 | 399 | command = tvb_get_uint8(tvb, offset); |
2056 | 399 | function = command >> 4; |
2057 | 399 | rate = command & QS_RATE_MASK; |
2058 | | |
2059 | 399 | proto_tree_add_item(opt_tree, hf_ipv6_opt_qs_func, tvb, offset, 1, ENC_BIG_ENDIAN); |
2060 | | |
2061 | 399 | switch (function) { |
2062 | 166 | case QS_RATE_REQUEST: |
2063 | 166 | proto_tree_add_item(opt_tree, hf_ipv6_opt_qs_rate, tvb, offset, 1, ENC_BIG_ENDIAN); |
2064 | 166 | offset += 1; |
2065 | 166 | proto_tree_add_item_ret_uint(opt_tree, hf_ipv6_opt_qs_ttl, tvb, offset, 1, ENC_BIG_ENDIAN, &qs_ttl); |
2066 | 166 | proto_item_append_text(pi, ", %s, QS TTL %u", |
2067 | 166 | val_to_str_ext(pinfo->pool, rate, &qs_rate_vals_ext, "Unknown (%u)"), |
2068 | 166 | qs_ttl); |
2069 | 166 | if (iph != NULL) { |
2070 | 108 | uint8_t ttl_diff; |
2071 | | |
2072 | 108 | ttl_diff = (iph->ip6_hop - qs_ttl) % 256; |
2073 | 108 | ti = proto_tree_add_uint(opt_tree, hf_ipv6_opt_qs_ttl_diff, tvb, offset, 1, ttl_diff); |
2074 | 108 | proto_item_set_generated(ti); |
2075 | 108 | proto_item_append_text(pi, ", QS TTL diff %u", ttl_diff); |
2076 | 108 | } |
2077 | 166 | offset += 1; |
2078 | 166 | proto_tree_add_item(opt_tree, hf_ipv6_opt_qs_nonce, tvb, offset, 4, ENC_BIG_ENDIAN); |
2079 | 166 | proto_tree_add_item(opt_tree, hf_ipv6_opt_qs_reserved, tvb, offset, 4, ENC_BIG_ENDIAN); |
2080 | 166 | offset += 4; |
2081 | 166 | break; |
2082 | 15 | case QS_RATE_REPORT: |
2083 | 15 | proto_tree_add_item(opt_tree, hf_ipv6_opt_qs_rate, tvb, offset, 1, ENC_BIG_ENDIAN); |
2084 | 15 | proto_item_append_text(pi, ", %s", val_to_str_ext(pinfo->pool, rate, &qs_rate_vals_ext, "Unknown (%u)")); |
2085 | 15 | offset += 1; |
2086 | 15 | proto_tree_add_item(opt_tree, hf_ipv6_opt_qs_unused, tvb, offset, 1, ENC_BIG_ENDIAN); |
2087 | 15 | offset += 1; |
2088 | 15 | proto_tree_add_item(opt_tree, hf_ipv6_opt_qs_nonce, tvb, offset, 4, ENC_BIG_ENDIAN); |
2089 | 15 | proto_tree_add_item(opt_tree, hf_ipv6_opt_qs_reserved, tvb, offset, 4, ENC_BIG_ENDIAN); |
2090 | 15 | offset += 4; |
2091 | 15 | break; |
2092 | 217 | default: |
2093 | 217 | break; |
2094 | 399 | } |
2095 | | |
2096 | 391 | return offset; |
2097 | 399 | } |
2098 | | |
2099 | | static const value_string ipv6_ioam_opt_types[] = { |
2100 | | { IP6IOAM_PRE_TRACE, "Pre-allocated Trace" }, |
2101 | | { IP6IOAM_INC_TRACE, "Incremental Trace" }, |
2102 | | { IP6IOAM_POT, "Proof of Transit" }, |
2103 | | { IP6IOAM_E2E, "Edge to Edge" }, |
2104 | | { IP6IOAM_DEX, "Direct Export" }, |
2105 | | { 0, NULL} |
2106 | | }; |
2107 | | |
2108 | | static int |
2109 | | dissect_opt_ioam_trace_node(tvbuff_t *tvb, int offset, |
2110 | | proto_tree *opt_tree, uint32_t trace_type) |
2111 | 487 | { |
2112 | 487 | proto_tree* sub_tree; |
2113 | | |
2114 | 487 | if (trace_type & IP6IOAM_TRACE_MASK_BIT0) { |
2115 | 13 | sub_tree = proto_tree_add_subtree(opt_tree, tvb, offset, 4, 0, NULL, |
2116 | 13 | "Hop_Lim and Node ID (short)"); |
2117 | 13 | proto_tree_add_item(sub_tree, hf_ipv6_opt_ioam_trace_node_hlim, |
2118 | 13 | tvb, offset, 1, ENC_NA); |
2119 | 13 | proto_tree_add_item(sub_tree, hf_ipv6_opt_ioam_trace_node_id, |
2120 | 13 | tvb, offset + 1, 3, ENC_BIG_ENDIAN); |
2121 | 13 | offset += 4; |
2122 | 13 | } |
2123 | | |
2124 | 487 | if (trace_type & IP6IOAM_TRACE_MASK_BIT1) { |
2125 | 19 | sub_tree = proto_tree_add_subtree(opt_tree, tvb, offset, 4, 0, NULL, |
2126 | 19 | "Ingress and Egress IDs (short)"); |
2127 | 19 | proto_tree_add_item(sub_tree, hf_ipv6_opt_ioam_trace_node_iif, |
2128 | 19 | tvb, offset, 2, ENC_BIG_ENDIAN); |
2129 | 19 | proto_tree_add_item(sub_tree, hf_ipv6_opt_ioam_trace_node_eif, |
2130 | 19 | tvb, offset + 2, 2, ENC_BIG_ENDIAN); |
2131 | 19 | offset += 4; |
2132 | 19 | } |
2133 | | |
2134 | 487 | if (trace_type & IP6IOAM_TRACE_MASK_BIT2) { |
2135 | 62 | proto_tree_add_item(opt_tree, hf_ipv6_opt_ioam_trace_node_tss, |
2136 | 62 | tvb, offset, 4, ENC_BIG_ENDIAN); |
2137 | 62 | offset += 4; |
2138 | 62 | } |
2139 | | |
2140 | 487 | if (trace_type & IP6IOAM_TRACE_MASK_BIT3) { |
2141 | 20 | proto_tree_add_item(opt_tree, hf_ipv6_opt_ioam_trace_node_tsf, |
2142 | 20 | tvb, offset, 4, ENC_BIG_ENDIAN); |
2143 | 20 | offset += 4; |
2144 | 20 | } |
2145 | | |
2146 | 487 | if (trace_type & IP6IOAM_TRACE_MASK_BIT4) { |
2147 | 31 | proto_tree_add_item(opt_tree, hf_ipv6_opt_ioam_trace_node_trdelay, |
2148 | 31 | tvb, offset, 4, ENC_BIG_ENDIAN); |
2149 | 31 | offset += 4; |
2150 | 31 | } |
2151 | | |
2152 | 487 | if (trace_type & IP6IOAM_TRACE_MASK_BIT5) { |
2153 | 48 | proto_tree_add_item(opt_tree, hf_ipv6_opt_ioam_trace_node_nsdata, |
2154 | 48 | tvb, offset, 4, ENC_BIG_ENDIAN); |
2155 | 48 | offset += 4; |
2156 | 48 | } |
2157 | | |
2158 | 487 | if (trace_type & IP6IOAM_TRACE_MASK_BIT6) { |
2159 | 85 | proto_tree_add_item(opt_tree, hf_ipv6_opt_ioam_trace_node_qdepth, |
2160 | 85 | tvb, offset, 4, ENC_BIG_ENDIAN); |
2161 | 85 | offset += 4; |
2162 | 85 | } |
2163 | | |
2164 | 487 | if (trace_type & IP6IOAM_TRACE_MASK_BIT7) { |
2165 | 116 | proto_tree_add_item(opt_tree, hf_ipv6_opt_ioam_trace_node_csum, |
2166 | 116 | tvb, offset, 4, ENC_BIG_ENDIAN); |
2167 | 116 | offset += 4; |
2168 | 116 | } |
2169 | | |
2170 | 487 | if (trace_type & IP6IOAM_TRACE_MASK_BIT8) { |
2171 | 31 | sub_tree = proto_tree_add_subtree(opt_tree, tvb, offset, 8, 0, NULL, |
2172 | 31 | "Hop_Lim and Node ID (wide)"); |
2173 | 31 | proto_tree_add_item(sub_tree, hf_ipv6_opt_ioam_trace_node_hlim, |
2174 | 31 | tvb, offset, 1, ENC_NA); |
2175 | 31 | proto_tree_add_item(sub_tree, hf_ipv6_opt_ioam_trace_node_id_wide, |
2176 | 31 | tvb, offset + 1, 7, ENC_BIG_ENDIAN); |
2177 | 31 | offset += 8; |
2178 | 31 | } |
2179 | | |
2180 | 487 | if (trace_type & IP6IOAM_TRACE_MASK_BIT9) { |
2181 | 28 | sub_tree = proto_tree_add_subtree(opt_tree, tvb, offset, 8, 0, NULL, |
2182 | 28 | "Ingress and Egress IDs (wide)"); |
2183 | 28 | proto_tree_add_item(sub_tree, hf_ipv6_opt_ioam_trace_node_iif_wide, |
2184 | 28 | tvb, offset, 4, ENC_BIG_ENDIAN); |
2185 | 28 | proto_tree_add_item(sub_tree, hf_ipv6_opt_ioam_trace_node_eif_wide, |
2186 | 28 | tvb, offset + 4, 4, ENC_BIG_ENDIAN); |
2187 | 28 | offset += 8; |
2188 | 28 | } |
2189 | | |
2190 | 487 | if (trace_type & IP6IOAM_TRACE_MASK_BIT10) { |
2191 | 32 | proto_tree_add_item(opt_tree, hf_ipv6_opt_ioam_trace_node_nsdata_wide, |
2192 | 32 | tvb, offset, 8, ENC_BIG_ENDIAN); |
2193 | 32 | offset += 8; |
2194 | 32 | } |
2195 | | |
2196 | 487 | if (trace_type & IP6IOAM_TRACE_MASK_BIT11) { |
2197 | 28 | proto_tree_add_item(opt_tree, hf_ipv6_opt_ioam_trace_node_bufoccup, |
2198 | 28 | tvb, offset, 4, ENC_BIG_ENDIAN); |
2199 | 28 | offset += 4; |
2200 | 28 | } |
2201 | | |
2202 | 487 | if (trace_type & IP6IOAM_TRACE_MASK_BIT12) { |
2203 | 11 | proto_tree_add_item(opt_tree, hf_ipv6_opt_ioam_trace_node_undefined, |
2204 | 11 | tvb, offset, 4, ENC_BIG_ENDIAN); |
2205 | 11 | offset += 4; |
2206 | 11 | } |
2207 | | |
2208 | 487 | if (trace_type & IP6IOAM_TRACE_MASK_BIT13) { |
2209 | 75 | proto_tree_add_item(opt_tree, hf_ipv6_opt_ioam_trace_node_undefined, |
2210 | 75 | tvb, offset, 4, ENC_BIG_ENDIAN); |
2211 | 75 | offset += 4; |
2212 | 75 | } |
2213 | | |
2214 | 487 | if (trace_type & IP6IOAM_TRACE_MASK_BIT14) { |
2215 | 86 | proto_tree_add_item(opt_tree, hf_ipv6_opt_ioam_trace_node_undefined, |
2216 | 86 | tvb, offset, 4, ENC_BIG_ENDIAN); |
2217 | 86 | offset += 4; |
2218 | 86 | } |
2219 | | |
2220 | 487 | if (trace_type & IP6IOAM_TRACE_MASK_BIT15) { |
2221 | 53 | proto_tree_add_item(opt_tree, hf_ipv6_opt_ioam_trace_node_undefined, |
2222 | 53 | tvb, offset, 4, ENC_BIG_ENDIAN); |
2223 | 53 | offset += 4; |
2224 | 53 | } |
2225 | | |
2226 | 487 | if (trace_type & IP6IOAM_TRACE_MASK_BIT16) { |
2227 | 30 | proto_tree_add_item(opt_tree, hf_ipv6_opt_ioam_trace_node_undefined, |
2228 | 30 | tvb, offset, 4, ENC_BIG_ENDIAN); |
2229 | 30 | offset += 4; |
2230 | 30 | } |
2231 | | |
2232 | 487 | if (trace_type & IP6IOAM_TRACE_MASK_BIT17) { |
2233 | 65 | proto_tree_add_item(opt_tree, hf_ipv6_opt_ioam_trace_node_undefined, |
2234 | 65 | tvb, offset, 4, ENC_BIG_ENDIAN); |
2235 | 65 | offset += 4; |
2236 | 65 | } |
2237 | | |
2238 | 487 | if (trace_type & IP6IOAM_TRACE_MASK_BIT18) { |
2239 | 54 | proto_tree_add_item(opt_tree, hf_ipv6_opt_ioam_trace_node_undefined, |
2240 | 54 | tvb, offset, 4, ENC_BIG_ENDIAN); |
2241 | 54 | offset += 4; |
2242 | 54 | } |
2243 | | |
2244 | 487 | if (trace_type & IP6IOAM_TRACE_MASK_BIT19) { |
2245 | 34 | proto_tree_add_item(opt_tree, hf_ipv6_opt_ioam_trace_node_undefined, |
2246 | 34 | tvb, offset, 4, ENC_BIG_ENDIAN); |
2247 | 34 | offset += 4; |
2248 | 34 | } |
2249 | | |
2250 | 487 | if (trace_type & IP6IOAM_TRACE_MASK_BIT20) { |
2251 | 47 | proto_tree_add_item(opt_tree, hf_ipv6_opt_ioam_trace_node_undefined, |
2252 | 47 | tvb, offset, 4, ENC_BIG_ENDIAN); |
2253 | 47 | offset += 4; |
2254 | 47 | } |
2255 | | |
2256 | 487 | if (trace_type & IP6IOAM_TRACE_MASK_BIT21) { |
2257 | 81 | proto_tree_add_item(opt_tree, hf_ipv6_opt_ioam_trace_node_undefined, |
2258 | 81 | tvb, offset, 4, ENC_BIG_ENDIAN); |
2259 | 81 | offset += 4; |
2260 | 81 | } |
2261 | | |
2262 | 487 | return offset; |
2263 | 487 | } |
2264 | | |
2265 | | /* |
2266 | | * IOAM Trace Option Header |
2267 | | * |
2268 | | 0 1 2 3 |
2269 | | 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 |
2270 | | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ |
2271 | | | Namespace-ID | NodeLen | Flags | RemainingLen| |
2272 | | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ |
2273 | | | IOAM-Trace-Type | Reserved | |
2274 | | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+<-+ |
2275 | | | | | |
2276 | | | node data list [0] | | |
2277 | | | | | |
2278 | | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ D |
2279 | | | | a |
2280 | | | node data list [1] | t |
2281 | | | | a |
2282 | | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ |
2283 | | ~ ........ ~ S |
2284 | | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ p |
2285 | | | | a |
2286 | | | node data list [n-1] | c |
2287 | | | | e |
2288 | | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | |
2289 | | | | | |
2290 | | | node data list [n] | | |
2291 | | | | | |
2292 | | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+<-+ |
2293 | | */ |
2294 | | static int |
2295 | | dissect_opt_ioam_trace(tvbuff_t *tvb, int offset, packet_info *pinfo, |
2296 | | proto_tree *opt_tree, struct opt_proto_item *opt_ti, uint8_t opt_len) |
2297 | 258 | { |
2298 | 258 | proto_item *ti; |
2299 | 258 | uint32_t trace_type, oss_scid; |
2300 | 258 | uint16_t len; |
2301 | 258 | uint8_t remlen, nodelen, oss_len, i = 0; |
2302 | 258 | int new_offset; |
2303 | | |
2304 | 258 | static int * const ioam_trace_flags[] = { |
2305 | 258 | &hf_ipv6_opt_ioam_trace_flag_o, |
2306 | 258 | &hf_ipv6_opt_ioam_trace_flag_l, |
2307 | 258 | &hf_ipv6_opt_ioam_trace_flag_a, |
2308 | 258 | &hf_ipv6_opt_ioam_trace_flag_rsv, |
2309 | 258 | NULL |
2310 | 258 | }; |
2311 | | |
2312 | 258 | static int * const ioam_trace_types[] = { |
2313 | 258 | &hf_ipv6_opt_ioam_trace_type_bit0, |
2314 | 258 | &hf_ipv6_opt_ioam_trace_type_bit1, |
2315 | 258 | &hf_ipv6_opt_ioam_trace_type_bit2, |
2316 | 258 | &hf_ipv6_opt_ioam_trace_type_bit3, |
2317 | 258 | &hf_ipv6_opt_ioam_trace_type_bit4, |
2318 | 258 | &hf_ipv6_opt_ioam_trace_type_bit5, |
2319 | 258 | &hf_ipv6_opt_ioam_trace_type_bit6, |
2320 | 258 | &hf_ipv6_opt_ioam_trace_type_bit7, |
2321 | 258 | &hf_ipv6_opt_ioam_trace_type_bit8, |
2322 | 258 | &hf_ipv6_opt_ioam_trace_type_bit9, |
2323 | 258 | &hf_ipv6_opt_ioam_trace_type_bit10, |
2324 | 258 | &hf_ipv6_opt_ioam_trace_type_bit11, |
2325 | 258 | &hf_ipv6_opt_ioam_trace_type_undef, |
2326 | 258 | &hf_ipv6_opt_ioam_trace_type_bit22, |
2327 | 258 | &hf_ipv6_opt_ioam_trace_type_rsv, |
2328 | 258 | NULL |
2329 | 258 | }; |
2330 | | |
2331 | 258 | if (opt_len < 10) { |
2332 | 104 | expert_add_info_format(pinfo, opt_ti->len, &ei_ipv6_opt_invalid_len, |
2333 | 104 | "IOAM Option: Invalid length (%u bytes)", opt_len); |
2334 | 104 | } |
2335 | | |
2336 | 258 | proto_tree_add_item(opt_tree, hf_ipv6_opt_ioam_trace_ns, tvb, offset, 2, ENC_BIG_ENDIAN); |
2337 | 258 | offset += 2; |
2338 | | |
2339 | 258 | nodelen = tvb_get_bits8(tvb, offset * 8, 5); |
2340 | 258 | proto_tree_add_bits_item(opt_tree, hf_ipv6_opt_ioam_trace_nodelen, tvb, |
2341 | 258 | offset * 8, 5, ENC_BIG_ENDIAN); |
2342 | | |
2343 | 258 | proto_tree_add_bitmask(opt_tree, tvb, offset, hf_ipv6_opt_ioam_trace_flags, |
2344 | 258 | ett_ipv6_opt_ioam_trace_flags, ioam_trace_flags, ENC_BIG_ENDIAN); |
2345 | | |
2346 | 258 | remlen = tvb_get_bits8(tvb, offset * 8 + 9, 7); |
2347 | 258 | ti = proto_tree_add_bits_item(opt_tree, hf_ipv6_opt_ioam_trace_remlen, tvb, |
2348 | 258 | offset * 8 + 9, 7, ENC_BIG_ENDIAN); |
2349 | 258 | if (remlen * 4 > opt_len - 10) { |
2350 | 109 | expert_add_info_format(pinfo, ti, &ei_ipv6_opt_ioam_invalid_remlen, |
2351 | 109 | "IOAM RemLen: Invalid length (%u bytes)", remlen * 4); |
2352 | 109 | } |
2353 | | |
2354 | 258 | offset += 2; |
2355 | | |
2356 | 258 | trace_type = tvb_get_bits32(tvb, offset * 8, 24, ENC_BIG_ENDIAN); |
2357 | 258 | ti = proto_tree_add_bitmask(opt_tree, tvb, offset, hf_ipv6_opt_ioam_trace_type, |
2358 | 258 | ett_ipv6_opt_ioam_trace_types, ioam_trace_types, ENC_BIG_ENDIAN); |
2359 | 258 | proto_tree_add_item(opt_tree, hf_ipv6_opt_ioam_trace_rsv, tvb, offset + 3, 1, ENC_NA); |
2360 | 258 | offset += 4; |
2361 | | |
2362 | | /* node data list parsing starts here */ |
2363 | 258 | if (!nodelen && trace_type != IP6IOAM_TRACE_MASK_BIT22) { |
2364 | 86 | expert_add_info(pinfo, ti, &ei_ipv6_opt_ioam_invalid_nodelen); |
2365 | 86 | return offset; |
2366 | 86 | } |
2367 | 172 | if (remlen * 4 > opt_len - 10) |
2368 | 27 | return offset; |
2369 | | |
2370 | 145 | proto_tree* trace_tree |
2371 | 145 | = proto_tree_add_subtree(opt_tree, tvb, offset, opt_len - 10, 0, NULL, "Trace Data"); |
2372 | | |
2373 | 145 | if (remlen) { |
2374 | 48 | proto_tree_add_item(trace_tree, hf_ipv6_opt_ioam_trace_free_space, tvb, |
2375 | 48 | offset, remlen * 4, ENC_NA); |
2376 | 48 | offset += remlen * 4; |
2377 | 48 | } |
2378 | | |
2379 | 145 | len = opt_len - 10 - remlen * 4; |
2380 | 551 | while (len && len >= nodelen * 4) { |
2381 | 487 | proto_tree* node_tree |
2382 | 487 | = proto_tree_add_subtree_format(trace_tree, tvb, offset, |
2383 | 487 | nodelen * 4, 0, NULL, "Node %u", ++i); |
2384 | | |
2385 | 487 | new_offset = dissect_opt_ioam_trace_node(tvb, offset, node_tree, trace_type); |
2386 | 487 | if (new_offset - offset != nodelen * 4) { |
2387 | 56 | expert_add_info(pinfo, ti, &ei_ipv6_opt_ioam_invalid_trace_type); |
2388 | 56 | return offset; |
2389 | 56 | } |
2390 | | |
2391 | 431 | offset = new_offset; |
2392 | 431 | len -= nodelen * 4; |
2393 | | |
2394 | | /* Opaque State Snapshot */ |
2395 | 431 | if (trace_type & IP6IOAM_TRACE_MASK_BIT22) { |
2396 | 170 | if (len < 4) { |
2397 | 10 | expert_add_info_format(pinfo, opt_ti->len, &ei_ipv6_opt_invalid_len, |
2398 | 10 | "IOAM Option: Invalid length (%u bytes)", opt_len); |
2399 | 10 | return offset; |
2400 | 10 | } |
2401 | | |
2402 | 160 | oss_len = tvb_get_uint8(tvb, offset); |
2403 | | |
2404 | 160 | proto_tree* oss_tree |
2405 | 160 | = proto_tree_add_subtree(node_tree, tvb, offset, (oss_len + 1) * 4, |
2406 | 160 | 0, NULL, "Opaque State Snapshot"); |
2407 | 160 | proto_tree_add_item(oss_tree, hf_ipv6_opt_ioam_trace_node_oss_len, |
2408 | 160 | tvb, offset, 1, ENC_NA); |
2409 | 160 | proto_tree_add_item_ret_uint(oss_tree, hf_ipv6_opt_ioam_trace_node_oss_scid, |
2410 | 160 | tvb, offset + 1, 3, ENC_BIG_ENDIAN, &oss_scid); |
2411 | 160 | offset += 4; |
2412 | | |
2413 | 160 | len -= 4; |
2414 | 160 | if (len < oss_len * 4) { |
2415 | 15 | expert_add_info_format(pinfo, opt_ti->len, &ei_ipv6_opt_invalid_len, |
2416 | 15 | "IOAM Option: Invalid length (%u bytes)", opt_len); |
2417 | 15 | return offset; |
2418 | 15 | } |
2419 | | |
2420 | 145 | if (oss_len > 0) { |
2421 | 26 | proto_tree_add_item(oss_tree, hf_ipv6_opt_ioam_trace_node_oss_data, |
2422 | 26 | tvb, offset, oss_len * 4, ENC_NA); |
2423 | | |
2424 | 26 | len -= oss_len * 4; |
2425 | 26 | offset += oss_len * 4; |
2426 | 26 | } |
2427 | 145 | } |
2428 | 431 | } |
2429 | | |
2430 | 64 | if (len) { |
2431 | 18 | expert_add_info_format(pinfo, opt_ti->len, &ei_ipv6_opt_invalid_len, |
2432 | 18 | "IOAM Option: Invalid length (%u bytes)", opt_len); |
2433 | 18 | } |
2434 | | |
2435 | 64 | return offset; |
2436 | 145 | } |
2437 | | |
2438 | | /* |
2439 | | * IOAM Direct Export Option Header |
2440 | | * |
2441 | | 0 1 2 3 |
2442 | | 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 |
2443 | | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ |
2444 | | | Namespace-ID | Flags |Extension-Flags| |
2445 | | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ |
2446 | | | IOAM-Trace-Type | Reserved | |
2447 | | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ |
2448 | | | Flow ID (Optional) | |
2449 | | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ |
2450 | | | Sequence Number (Optional) | |
2451 | | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ |
2452 | | */ |
2453 | | static int |
2454 | | dissect_opt_ioam_dex(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *opt_tree, |
2455 | | struct opt_proto_item *opt_ti, uint8_t opt_len) |
2456 | 63 | { |
2457 | 63 | uint8_t extflags; |
2458 | | |
2459 | 63 | static int * const ioam_dex_extflags[] = { |
2460 | 63 | &hf_ipv6_opt_ioam_dex_extflag_flag_rsv, |
2461 | 63 | &hf_ipv6_opt_ioam_dex_extflag_flag_seqnum, |
2462 | 63 | &hf_ipv6_opt_ioam_dex_extflag_flag_flowid, |
2463 | 63 | NULL |
2464 | 63 | }; |
2465 | | |
2466 | 63 | static int * const ioam_dex_trace_types[] = { |
2467 | 63 | &hf_ipv6_opt_ioam_trace_type_bit0, |
2468 | 63 | &hf_ipv6_opt_ioam_trace_type_bit1, |
2469 | 63 | &hf_ipv6_opt_ioam_trace_type_bit2, |
2470 | 63 | &hf_ipv6_opt_ioam_trace_type_bit3, |
2471 | 63 | &hf_ipv6_opt_ioam_trace_type_bit4, |
2472 | 63 | &hf_ipv6_opt_ioam_trace_type_bit5, |
2473 | 63 | &hf_ipv6_opt_ioam_trace_type_bit6, |
2474 | 63 | &hf_ipv6_opt_ioam_trace_type_bit7, |
2475 | 63 | &hf_ipv6_opt_ioam_trace_type_bit8, |
2476 | 63 | &hf_ipv6_opt_ioam_trace_type_bit9, |
2477 | 63 | &hf_ipv6_opt_ioam_trace_type_bit10, |
2478 | 63 | &hf_ipv6_opt_ioam_trace_type_bit11, |
2479 | 63 | &hf_ipv6_opt_ioam_trace_type_undef, |
2480 | 63 | &hf_ipv6_opt_ioam_trace_type_bit22, |
2481 | 63 | &hf_ipv6_opt_ioam_trace_type_rsv, |
2482 | 63 | NULL |
2483 | 63 | }; |
2484 | | |
2485 | 63 | if (opt_len < 10) { |
2486 | 48 | expert_add_info_format(pinfo, opt_ti->len, &ei_ipv6_opt_invalid_len, |
2487 | 48 | "IOAM Option: Invalid length (%u bytes)", opt_len); |
2488 | 48 | } |
2489 | | |
2490 | 63 | proto_tree_add_item(opt_tree, hf_ipv6_opt_ioam_dex_ns, tvb, offset, 2, ENC_BIG_ENDIAN); |
2491 | 63 | offset += 2; |
2492 | | |
2493 | 63 | proto_tree_add_item(opt_tree, hf_ipv6_opt_ioam_dex_flags, tvb, offset, 1, ENC_NA); |
2494 | 63 | offset++; |
2495 | | |
2496 | 63 | extflags = tvb_get_bits8(tvb, offset*8, 8); |
2497 | 63 | proto_tree_add_bitmask(opt_tree, tvb, offset, hf_ipv6_opt_ioam_dex_extflags, |
2498 | 63 | ett_ipv6_opt_ioam_dex_extflags, ioam_dex_extflags, ENC_BIG_ENDIAN); |
2499 | 63 | offset++; |
2500 | | |
2501 | 63 | proto_tree_add_bitmask(opt_tree, tvb, offset, hf_ipv6_opt_ioam_trace_type, |
2502 | 63 | ett_ipv6_opt_ioam_trace_types, ioam_dex_trace_types, ENC_BIG_ENDIAN); |
2503 | 63 | proto_tree_add_item(opt_tree, hf_ipv6_opt_ioam_trace_rsv, tvb, offset + 3, 1, ENC_NA); |
2504 | 63 | offset += 4; |
2505 | | |
2506 | 63 | if (extflags & 0x80) { |
2507 | 15 | proto_tree_add_item(opt_tree, hf_ipv6_opt_ioam_dex_extflag_flowid, tvb, offset, 4, ENC_BIG_ENDIAN); |
2508 | 15 | offset+=4; |
2509 | 15 | } |
2510 | | |
2511 | 63 | if (extflags & 0x40) { |
2512 | 25 | proto_tree_add_item(opt_tree, hf_ipv6_opt_ioam_dex_extflag_seqnum, tvb, offset, 4, ENC_BIG_ENDIAN); |
2513 | 25 | offset+=4; |
2514 | 25 | } |
2515 | | |
2516 | 63 | return offset; |
2517 | 63 | } |
2518 | | |
2519 | | /* |
2520 | | * IOAM Option Header |
2521 | | * |
2522 | | 0 1 2 3 |
2523 | | 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 |
2524 | | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ |
2525 | | | Option Type | Opt Data Len | Reserved | IOAM Type | |
2526 | | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ |
2527 | | */ |
2528 | | static int |
2529 | | dissect_opt_ioam(tvbuff_t *tvb, int offset, packet_info *pinfo, |
2530 | | proto_tree *opt_tree, struct opt_proto_item *opt_ti, uint8_t opt_len) |
2531 | 588 | { |
2532 | 588 | uint32_t opt_type; |
2533 | | |
2534 | 588 | if (opt_len < 2) { |
2535 | 128 | expert_add_info_format(pinfo, opt_ti->len, &ei_ipv6_opt_invalid_len, |
2536 | 128 | "IOAM Option: Invalid length (%u bytes)", opt_len); |
2537 | 128 | } |
2538 | | |
2539 | 588 | proto_tree_add_item(opt_tree, hf_ipv6_opt_ioam_rsv, tvb, offset, 1, ENC_NA); |
2540 | 588 | proto_tree_add_item_ret_uint(opt_tree, hf_ipv6_opt_ioam_opt_type, tvb, |
2541 | 588 | offset + 1, 1, ENC_NA, &opt_type); |
2542 | 588 | offset += 2; |
2543 | | |
2544 | 588 | proto_tree* opt_type_tree |
2545 | 588 | = proto_tree_add_subtree(opt_tree, tvb, offset, opt_len - 2, 0, NULL, |
2546 | 588 | val_to_str_const(opt_type, ipv6_ioam_opt_types, |
2547 | 588 | "Unknown Option-Type")); |
2548 | | |
2549 | 588 | switch (opt_type) { |
2550 | 211 | case IP6IOAM_PRE_TRACE: |
2551 | 258 | case IP6IOAM_INC_TRACE: |
2552 | 258 | offset = dissect_opt_ioam_trace(tvb, offset, pinfo, opt_type_tree, opt_ti, opt_len); |
2553 | 258 | break; |
2554 | 0 | case IP6IOAM_POT: |
2555 | 0 | break; |
2556 | 1 | case IP6IOAM_E2E: |
2557 | 1 | break; |
2558 | 63 | case IP6IOAM_DEX: |
2559 | 63 | offset = dissect_opt_ioam_dex(tvb, offset, pinfo, opt_type_tree, opt_ti, opt_len); |
2560 | 588 | } |
2561 | | |
2562 | 540 | return offset; |
2563 | 588 | } |
2564 | | |
2565 | | /* |
2566 | | * Tunnel Payload Forwarding Option for IPv6 |
2567 | | * |
2568 | | 0 1 2 3 |
2569 | | 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 |
2570 | | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ |
2571 | | | Option Type | Option Length | |
2572 | | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ |
2573 | | | TPF Information | |
2574 | | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ |
2575 | | */ |
2576 | | static int |
2577 | | dissect_opt_tpf(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *opt_tree, |
2578 | | struct opt_proto_item *opt_ti, uint8_t opt_len) |
2579 | 126 | { |
2580 | 126 | if (opt_len != 4) { |
2581 | 122 | expert_add_info_format(pinfo, opt_ti->len, &ei_ipv6_opt_invalid_len, |
2582 | 122 | "TPF: Invalid Length (%u bytes)", opt_len); |
2583 | 122 | } |
2584 | 126 | proto_tree_add_item(opt_tree, hf_ipv6_opt_tpf_information, tvb, offset, 4, ENC_BIG_ENDIAN); |
2585 | 126 | offset += 4; |
2586 | | |
2587 | 126 | return offset; |
2588 | 126 | } |
2589 | | |
2590 | | /* |
2591 | | ------------------------------------------------------------ |
2592 | | | Next Header | Hdr Ext Len | Option Type | Option Length| |
2593 | | +-------------+---------------+-------------+--------------+ |
2594 | | | CALIPSO Domain of Interpretation | |
2595 | | +-------------+---------------+-------------+--------------+ |
2596 | | | Cmpt Length | Sens Level | Checksum (CRC-16) | |
2597 | | +-------------+---------------+-------------+--------------+ |
2598 | | | Compartment Bitmap (Optional; variable length) | |
2599 | | +-------------+---------------+-------------+--------------+ |
2600 | | */ |
2601 | | static int |
2602 | | dissect_opt_calipso(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *opt_tree, |
2603 | | struct opt_proto_item *opt_ti, uint8_t opt_len) |
2604 | 53 | { |
2605 | 53 | uint32_t cmpt_length = 0; |
2606 | | |
2607 | 53 | if (opt_len < 8) { |
2608 | 39 | expert_add_info_format(pinfo, opt_ti->len, &ei_ipv6_opt_invalid_len, |
2609 | 39 | "CALIPSO: Invalid Length (%u bytes)", opt_len); |
2610 | 39 | } |
2611 | | |
2612 | 53 | proto_tree_add_item(opt_tree, hf_ipv6_opt_calipso_doi, tvb, |
2613 | 53 | offset, 4, ENC_BIG_ENDIAN); |
2614 | 53 | offset += 4; |
2615 | | |
2616 | 53 | proto_tree_add_item_ret_uint(opt_tree, hf_ipv6_opt_calipso_cmpt_length, tvb, |
2617 | 53 | offset, 1, ENC_BIG_ENDIAN, &cmpt_length); |
2618 | 53 | offset += 1; |
2619 | | |
2620 | 53 | proto_tree_add_item(opt_tree, hf_ipv6_opt_calipso_sens_level, tvb, |
2621 | 53 | offset, 1, ENC_BIG_ENDIAN); |
2622 | 53 | offset += 1; |
2623 | | |
2624 | 53 | proto_tree_add_checksum(opt_tree, tvb, offset, hf_ipv6_opt_calipso_checksum, -1, |
2625 | 53 | NULL, pinfo, 0, ENC_BIG_ENDIAN, PROTO_CHECKSUM_NO_FLAGS); |
2626 | 53 | offset += 2; |
2627 | | |
2628 | 53 | proto_tree_add_item(opt_tree, hf_ipv6_opt_calipso_cmpt_bitmap, tvb, |
2629 | 53 | offset, cmpt_length*4, ENC_NA); |
2630 | 53 | offset += cmpt_length*4; |
2631 | | |
2632 | 53 | return offset; |
2633 | 53 | } |
2634 | | |
2635 | | /* |
2636 | | * IPv6 SMF_DPD Option Header |
2637 | | * |
2638 | | 0 1 2 3 |
2639 | | 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 |
2640 | | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ |
2641 | | ... |0|0|0| 01000 | Opt. Data Len | |
2642 | | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ |
2643 | | |0|TidTy| TidLen| TaggerId (optional) ... | |
2644 | | +-+-+-+-+-+-+-+-+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ |
2645 | | | | Identifier ... |
2646 | | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ |
2647 | | |
2648 | | Figure 3: IPv6 SMF_DPD Option Header in I-DPD mode |
2649 | | |
2650 | | 0 1 2 3 |
2651 | | 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 |
2652 | | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ |
2653 | | ... |0|0|0| OptType | Opt. Data Len | |
2654 | | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ |
2655 | | |1| Hash Assist Value (HAV) ... |
2656 | | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ |
2657 | | |
2658 | | Figure 4: IPv6 SMF_DPD Option Header in H-DPD Mode |
2659 | | */ |
2660 | | static int |
2661 | | dissect_opt_smf_dpd(tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *opt_tree, |
2662 | | struct opt_proto_item *opt_ti _U_, uint8_t opt_len) |
2663 | 392 | { |
2664 | 392 | uint8_t hash_tid; |
2665 | 392 | uint8_t tid_len; |
2666 | 392 | int ident_len; |
2667 | | |
2668 | 392 | proto_tree_add_item(opt_tree, hf_ipv6_opt_smf_dpd_hash_bit, tvb, offset, 1, ENC_BIG_ENDIAN); |
2669 | 392 | hash_tid = tvb_get_uint8(tvb, offset); |
2670 | | |
2671 | 392 | if (hash_tid & 0x80) { |
2672 | | /* H-DPD Mode */ |
2673 | 28 | proto_tree_add_item(opt_tree, hf_ipv6_opt_smf_dpd_hav, tvb, offset, opt_len, ENC_NA); |
2674 | 28 | return offset + opt_len; |
2675 | 28 | } |
2676 | | |
2677 | | /* I-DPD Mode */ |
2678 | 364 | proto_tree_add_item(opt_tree, hf_ipv6_opt_smf_dpd_tid_type, tvb, offset, 1, ENC_BIG_ENDIAN); |
2679 | 364 | proto_tree_add_item(opt_tree, hf_ipv6_opt_smf_dpd_tid_len, tvb, offset, 1, ENC_BIG_ENDIAN); |
2680 | 364 | offset += 1; |
2681 | 364 | ident_len = opt_len - 1; |
2682 | 364 | if (hash_tid & 0x70) { |
2683 | 127 | tid_len = (hash_tid & 0x0f) + 1; |
2684 | 127 | proto_tree_add_item(opt_tree, hf_ipv6_opt_smf_dpd_tagger_id, tvb, offset, tid_len, ENC_NA); |
2685 | 127 | offset += tid_len; |
2686 | 127 | ident_len -= tid_len; |
2687 | 127 | } |
2688 | 364 | if (ident_len > 0) { |
2689 | 205 | proto_tree_add_item(opt_tree, hf_ipv6_opt_smf_dpd_ident, tvb, offset, ident_len, ENC_NA); |
2690 | 205 | offset += ident_len; |
2691 | 205 | } |
2692 | | |
2693 | 364 | return offset; |
2694 | 392 | } |
2695 | | |
2696 | | /* |
2697 | | * Performance and Diagnostic Metrics Destination Option (ietf-ippm-6man-pdm-option-13) |
2698 | | * |
2699 | | 0 1 2 3 |
2700 | | 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 |
2701 | | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ |
2702 | | | Option Type | Option Length | ScaleDTLR | ScaleDTLS | |
2703 | | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ |
2704 | | | PSN This Packet | PSN Last Received | |
2705 | | |-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ |
2706 | | | Delta Time Last Received | Delta Time Last Sent | |
2707 | | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ |
2708 | | */ |
2709 | | static int |
2710 | | dissect_opt_pdm(tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *opt_tree, |
2711 | | struct opt_proto_item *opt_ti _U_, uint8_t opt_len) |
2712 | 110 | { |
2713 | 110 | if (opt_len != 10) { |
2714 | 109 | expert_add_info_format(pinfo, opt_ti->len, &ei_ipv6_opt_invalid_len, |
2715 | 109 | "PDM: Invalid length (%u bytes)", opt_len); |
2716 | 109 | } |
2717 | 110 | proto_tree_add_item(opt_tree, hf_ipv6_opt_pdm_scale_dtlr, tvb, offset, 1, ENC_BIG_ENDIAN); |
2718 | 110 | offset += 1; |
2719 | 110 | proto_tree_add_item(opt_tree, hf_ipv6_opt_pdm_scale_dtls, tvb, offset, 1, ENC_BIG_ENDIAN); |
2720 | 110 | offset += 1; |
2721 | 110 | proto_tree_add_item(opt_tree, hf_ipv6_opt_pdm_psn_this_pkt, tvb, offset, 2, ENC_BIG_ENDIAN); |
2722 | 110 | offset += 2; |
2723 | 110 | proto_tree_add_item(opt_tree, hf_ipv6_opt_pdm_psn_last_recv, tvb, offset, 2, ENC_BIG_ENDIAN); |
2724 | 110 | offset += 2; |
2725 | 110 | proto_tree_add_item(opt_tree, hf_ipv6_opt_pdm_delta_last_recv, tvb, offset, 2, ENC_BIG_ENDIAN); |
2726 | 110 | offset += 2; |
2727 | 110 | proto_tree_add_item(opt_tree, hf_ipv6_opt_pdm_delta_last_sent, tvb, offset, 2, ENC_BIG_ENDIAN); |
2728 | 110 | offset += 2; |
2729 | | |
2730 | 110 | return offset; |
2731 | 110 | } |
2732 | | |
2733 | | /* |
2734 | | * Home Address Option |
2735 | | * |
2736 | | 0 1 2 3 |
2737 | | 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 |
2738 | | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ |
2739 | | | Option Type | Option Length | |
2740 | | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ |
2741 | | | | |
2742 | | + + |
2743 | | | | |
2744 | | + Home Address + |
2745 | | | | |
2746 | | + + |
2747 | | | | |
2748 | | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ |
2749 | | */ |
2750 | | static int |
2751 | | dissect_opt_home_address(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *opt_tree, |
2752 | | struct opt_proto_item *opt_ti, uint8_t opt_len) |
2753 | 40 | { |
2754 | 40 | if (opt_len != 16) { |
2755 | 40 | expert_add_info_format(pinfo, opt_ti->len, &ei_ipv6_opt_invalid_len, |
2756 | 40 | "Home Address: Invalid length (%u bytes)", opt_len); |
2757 | 40 | } |
2758 | 40 | proto_tree_add_item(opt_tree, hf_ipv6_opt_mipv6_home_address, tvb, offset, IPv6_ADDR_SIZE, ENC_NA); |
2759 | 40 | alloc_address_tvb_ipv6(pinfo->pool, &pinfo->src, tvb, offset); |
2760 | 40 | offset += IPv6_ADDR_SIZE; |
2761 | | |
2762 | 40 | return offset; |
2763 | 40 | } |
2764 | | |
2765 | | /* |
2766 | | * ILNP Nonce Option |
2767 | | * |
2768 | | |
2769 | | 0 1 2 3 |
2770 | | 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 |
2771 | | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ |
2772 | | | Next Header | Hdr Ext Len | Option Type | Option Length | |
2773 | | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ |
2774 | | / Nonce Value / |
2775 | | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ |
2776 | | */ |
2777 | | static int |
2778 | | dissect_opt_ilnp_nonce(tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *opt_tree, |
2779 | | struct opt_proto_item *opt_ti, uint8_t opt_len) |
2780 | 50 | { |
2781 | 50 | proto_tree_add_item(opt_tree, hf_ipv6_opt_ilnp_nonce, tvb, offset, opt_len, ENC_NA); |
2782 | | |
2783 | | // Make a new tvb for the ILNP protocol |
2784 | 50 | tvbuff_t* tvb_ilnp = tvb_new_subset_length(tvb, offset, opt_len); |
2785 | 50 | call_dissector_with_data(ilnp_handle, tvb_ilnp, pinfo, proto_tree_get_parent(opt_ti->root_tree), NULL); |
2786 | | |
2787 | 50 | offset += opt_len; |
2788 | 50 | return offset; |
2789 | 50 | } |
2790 | | |
2791 | | /* |
2792 | | * Line-Identification Option |
2793 | | * |
2794 | | 0 1 2 3 |
2795 | | 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 |
2796 | | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ |
2797 | | | Option Type | Option Length | |
2798 | | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ |
2799 | | | LineIDLen | Line ID... |
2800 | | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ |
2801 | | */ |
2802 | | static int |
2803 | | dissect_opt_lio(tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *opt_tree, |
2804 | | struct opt_proto_item *opt_ti _U_, uint8_t opt_len) |
2805 | 72 | { |
2806 | 72 | uint32_t lid_len = 0; |
2807 | | |
2808 | 72 | proto_tree_add_item_ret_uint(opt_tree, hf_ipv6_opt_lio_len, tvb, offset, 1, ENC_BIG_ENDIAN, &lid_len); |
2809 | 72 | offset += 1; |
2810 | | |
2811 | 72 | if (lid_len + 1 > opt_len) { |
2812 | | /* XXX Add expert info */ |
2813 | 58 | lid_len = opt_len - 1; |
2814 | 58 | } |
2815 | 72 | proto_tree_add_item(opt_tree, hf_ipv6_opt_lio_id, tvb, offset, lid_len, ENC_BIG_ENDIAN|ENC_ASCII); |
2816 | 72 | offset += lid_len; |
2817 | | |
2818 | 72 | return offset; |
2819 | 72 | } |
2820 | | |
2821 | | /* |
2822 | | * MPL Option |
2823 | | * |
2824 | | 0 1 2 3 |
2825 | | 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 |
2826 | | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ |
2827 | | | Option Type | Opt Data Len | |
2828 | | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ |
2829 | | | S |M|V| rsv | sequence | seed-id (optional) | |
2830 | | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ |
2831 | | */ |
2832 | | static int |
2833 | | dissect_opt_mpl(tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *opt_tree, |
2834 | | struct opt_proto_item *opt_ti _U_, uint8_t opt_len _U_) |
2835 | 158 | { |
2836 | 158 | static int * const mpl_flags[] = { |
2837 | 158 | &hf_ipv6_opt_mpl_flag_s, |
2838 | 158 | &hf_ipv6_opt_mpl_flag_m, |
2839 | 158 | &hf_ipv6_opt_mpl_flag_v, |
2840 | 158 | &hf_ipv6_opt_mpl_flag_rsv, |
2841 | 158 | NULL |
2842 | 158 | }; |
2843 | 158 | static const uint8_t seed_id_len_arr[4] = {0, 2, 8, 16}; |
2844 | 158 | uint8_t seed_id_len; |
2845 | | |
2846 | 158 | proto_tree_add_bitmask(opt_tree, tvb, offset, hf_ipv6_opt_mpl_flag, ett_ipv6_opt_mpl, mpl_flags, ENC_NA); |
2847 | 158 | seed_id_len = seed_id_len_arr[tvb_get_uint8(tvb, offset) >> 6]; |
2848 | 158 | offset +=1; |
2849 | | |
2850 | 158 | proto_tree_add_item(opt_tree, hf_ipv6_opt_mpl_sequence, tvb, offset, 1, ENC_NA); |
2851 | 158 | offset +=1; |
2852 | 158 | if (seed_id_len > 0) { |
2853 | 90 | proto_tree_add_item(opt_tree, hf_ipv6_opt_mpl_seed_id, tvb, offset, seed_id_len, ENC_NA); |
2854 | 90 | offset += seed_id_len; |
2855 | 90 | } |
2856 | 68 | else { |
2857 | 68 | expert_add_info(pinfo, opt_ti->type, &ei_ipv6_opt_mpl_ipv6_src_seed_id); |
2858 | 68 | } |
2859 | | |
2860 | 158 | return offset; |
2861 | 158 | } |
2862 | | |
2863 | | /* |
2864 | | * IPv6 DFF Header |
2865 | | * |
2866 | | 1 2 3 |
2867 | | 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 |
2868 | | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ |
2869 | | | Next Header | Hdr Ext Len | OptTypeDFF | OptDataLenDFF | |
2870 | | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ |
2871 | | |VER|D|R|0|0|0|0| Sequence Number | Pad1 | |
2872 | | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ |
2873 | | */ |
2874 | | static int |
2875 | | dissect_opt_dff(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *opt_tree, |
2876 | | struct opt_proto_item *opt_ti, uint8_t opt_len) |
2877 | 77 | { |
2878 | 77 | static int * const dff_flags[] = { |
2879 | 77 | &hf_ipv6_opt_dff_flag_ver, |
2880 | 77 | &hf_ipv6_opt_dff_flag_dup, |
2881 | 77 | &hf_ipv6_opt_dff_flag_ret, |
2882 | 77 | &hf_ipv6_opt_dff_flag_rsv, |
2883 | 77 | NULL |
2884 | 77 | }; |
2885 | | |
2886 | | /* Option length is 3 octets */ |
2887 | | /* http://www.rfc-editor.org/errata_search.php?eid=3937 */ |
2888 | 77 | if (opt_len != 3) { |
2889 | 70 | expert_add_info_format(pinfo, opt_ti->len, &ei_ipv6_opt_invalid_len, |
2890 | 70 | "IPv6 DFF: Invalid length (%u bytes)", opt_len); |
2891 | 70 | } |
2892 | 77 | proto_tree_add_bitmask(opt_tree, tvb, offset, hf_ipv6_opt_dff_flags, |
2893 | 77 | ett_ipv6_opt_dff_flags, dff_flags, ENC_NA); |
2894 | 77 | offset += 1; |
2895 | 77 | proto_tree_add_item(opt_tree, hf_ipv6_opt_dff_seqnum, tvb, offset, 2, ENC_BIG_ENDIAN); |
2896 | 77 | offset += 2; |
2897 | | |
2898 | 77 | return offset; |
2899 | 77 | } |
2900 | | |
2901 | | static int |
2902 | | dissect_opt_unknown(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *opt_tree, |
2903 | | struct opt_proto_item *opt_ti _U_, uint8_t opt_len) |
2904 | 3.46k | { |
2905 | 3.46k | proto_item *ti; |
2906 | | |
2907 | 3.46k | ti = proto_tree_add_item(opt_tree, hf_ipv6_opt_unknown, tvb, |
2908 | 3.46k | offset, opt_len, ENC_NA); |
2909 | 3.46k | expert_add_info(pinfo, ti, &ei_ipv6_opt_unknown_data); |
2910 | | |
2911 | 3.46k | return offset + opt_len; |
2912 | 3.46k | } |
2913 | | |
2914 | | static int |
2915 | | dissect_opts(tvbuff_t *tvb, int offset, proto_tree *tree, packet_info *pinfo, ws_ip6 *iph, const int exthdr_proto) |
2916 | 3.27k | { |
2917 | 3.27k | int len, offset_end; |
2918 | 3.27k | uint8_t nxt; |
2919 | 3.27k | proto_tree *exthdr_tree, *opt_tree, *opt_type_tree, *root_tree; |
2920 | 3.27k | proto_item *pi, *ti, *ti_len; |
2921 | 3.27k | int hf_exthdr_item_nxt, hf_exthdr_item_len, hf_exthdr_item_len_oct; |
2922 | 3.27k | int ett_exthdr_proto; |
2923 | 3.27k | uint8_t opt_type, opt_len, opt_start; |
2924 | 3.27k | int opt_hdr_type; |
2925 | 3.27k | const char *opt_name; |
2926 | 3.27k | bool hopopts; |
2927 | 3.27k | struct opt_proto_item opt_ti; |
2928 | 3.27k | tvbuff_t *next_tvb; |
2929 | | |
2930 | 3.27k | hopopts = (exthdr_proto == proto_ipv6_hopopts); |
2931 | | |
2932 | 3.27k | nxt = tvb_get_uint8(tvb, offset); |
2933 | 3.27k | len = (tvb_get_uint8(tvb, offset + 1) + 1) << 3; |
2934 | 3.27k | offset_end = offset + len; |
2935 | | |
2936 | 3.27k | root_tree = p_ipv6_pinfo_select_root(pinfo, tree); |
2937 | 3.27k | p_ipv6_pinfo_add_len(pinfo, len); |
2938 | | |
2939 | | /* !!! specify length */ |
2940 | 3.27k | ti = proto_tree_add_item(root_tree, exthdr_proto, tvb, offset, len, ENC_NA); |
2941 | | |
2942 | 3.27k | if (hopopts && ipv6_previous_layer_id(pinfo) != proto_ipv6) { |
2943 | | /* IPv6 Hop-by-Hop must appear immediately after IPv6 header (RFC 2460) */ |
2944 | 2.74k | expert_add_info(pinfo, ti, &ei_ipv6_hopopts_not_first); |
2945 | 2.74k | } |
2946 | | |
2947 | 3.27k | if (exthdr_proto == proto_ipv6_hopopts) { |
2948 | 3.11k | hf_exthdr_item_nxt = hf_ipv6_hopopts_nxt; |
2949 | 3.11k | hf_exthdr_item_len = hf_ipv6_hopopts_len; |
2950 | 3.11k | hf_exthdr_item_len_oct = hf_ipv6_hopopts_len_oct; |
2951 | 3.11k | ett_exthdr_proto = ett_ipv6_hopopts_proto; |
2952 | 3.11k | } else if (exthdr_proto == proto_ipv6_dstopts) { |
2953 | 40 | hf_exthdr_item_nxt = hf_ipv6_dstopts_nxt; |
2954 | 40 | hf_exthdr_item_len = hf_ipv6_dstopts_len; |
2955 | 40 | hf_exthdr_item_len_oct = hf_ipv6_dstopts_len_oct; |
2956 | 40 | ett_exthdr_proto = ett_ipv6_dstopts_proto; |
2957 | 116 | } else { |
2958 | 116 | DISSECTOR_ASSERT_NOT_REACHED(); |
2959 | 116 | } |
2960 | | |
2961 | 3.27k | exthdr_tree = proto_item_add_subtree(ti, ett_exthdr_proto); |
2962 | | |
2963 | 3.27k | proto_tree_add_item(exthdr_tree, hf_exthdr_item_nxt, tvb, offset, 1, ENC_BIG_ENDIAN); |
2964 | 3.27k | offset += 1; |
2965 | | |
2966 | 3.27k | ti_len = proto_tree_add_item(exthdr_tree, hf_exthdr_item_len, tvb, offset, 1, ENC_BIG_ENDIAN); |
2967 | 3.27k | ti = proto_tree_add_uint(exthdr_tree, hf_exthdr_item_len_oct, tvb, offset, 1, len); |
2968 | 3.27k | proto_item_set_generated(ti); |
2969 | 3.27k | if (ipv6_exthdr_hide_len_oct_field) { |
2970 | 0 | proto_item_set_hidden(ti); |
2971 | 0 | proto_item_append_text(ti_len, " (%d bytes)", len); |
2972 | 0 | } |
2973 | 3.27k | offset += 1; |
2974 | | |
2975 | 37.4k | while (offset < offset_end) { |
2976 | | /* there are more options */ |
2977 | | |
2978 | 34.8k | opt_type = tvb_get_uint8(tvb, offset); |
2979 | 34.8k | opt_len = tvb_get_uint8(tvb, offset + 1); |
2980 | 34.8k | opt_name = val_to_str_ext(pinfo->pool, opt_type, &ipv6_opt_type_vals_ext, "Unknown IPv6 Option (%u)"); |
2981 | | |
2982 | 34.8k | pi = proto_tree_add_none_format(exthdr_tree, hf_ipv6_opt, tvb, offset, 2 + opt_len, |
2983 | 34.8k | "%s", opt_name); |
2984 | 34.8k | opt_tree = proto_item_add_subtree(pi, ett_ipv6_opt); |
2985 | | |
2986 | 34.8k | opt_ti.type = proto_tree_add_item(opt_tree, hf_ipv6_opt_type, tvb, offset, 1, ENC_BIG_ENDIAN); |
2987 | | //Allow options to have access to the IP tree |
2988 | 34.8k | opt_ti.root_tree = tree; |
2989 | | |
2990 | 34.8k | if (opt_type == IP6OPT_PAD1) { |
2991 | | /* The Pad1 option is a special case, and contains no data. */ |
2992 | 26.4k | proto_tree_add_item(opt_tree, hf_ipv6_opt_pad1, tvb, offset, 1, ENC_NA); |
2993 | 26.4k | offset += 1; |
2994 | 26.4k | continue; |
2995 | 26.4k | } |
2996 | | |
2997 | 8.41k | if ((opt_hdr_type = ipv6_opt_type_hdr(opt_type)) != IPv6_OPT_HDR_ANY) { |
2998 | 0 | if (hopopts && (opt_hdr_type == IPv6_OPT_HDR_DST)) { |
2999 | 0 | expert_add_info_format(pinfo, opt_ti.type, &ei_ipv6_opt_header_mismatch, |
3000 | 0 | "%s must use a destination options header", opt_name); |
3001 | 0 | } |
3002 | 0 | else if (!hopopts && (opt_hdr_type == IPv6_OPT_HDR_HBH)) { |
3003 | 0 | expert_add_info_format(pinfo, opt_ti.type, &ei_ipv6_opt_header_mismatch, |
3004 | 0 | "%s must use a hop-by-hop options header", opt_name); |
3005 | 0 | } |
3006 | 0 | } |
3007 | | |
3008 | 8.41k | opt_type_tree = proto_item_add_subtree(opt_ti.type, ett_ipv6_opt_type); |
3009 | 8.41k | proto_tree_add_item(opt_type_tree, hf_ipv6_opt_type_action, tvb, offset, 1, ENC_BIG_ENDIAN); |
3010 | 8.41k | proto_tree_add_item(opt_type_tree, hf_ipv6_opt_type_change, tvb, offset, 1, ENC_BIG_ENDIAN); |
3011 | 8.41k | proto_tree_add_item(opt_type_tree, hf_ipv6_opt_type_rest, tvb, offset, 1, ENC_BIG_ENDIAN); |
3012 | 8.41k | offset += 1; |
3013 | | |
3014 | 8.41k | opt_ti.len = proto_tree_add_item(opt_tree, hf_ipv6_opt_length, tvb, offset, 1, ENC_BIG_ENDIAN); |
3015 | 8.41k | offset += 1; |
3016 | | |
3017 | 8.41k | if (opt_type == IP6OPT_PADN) { |
3018 | | /* RFC 2460 states : |
3019 | | * "The PadN option is used to insert two or more octets of |
3020 | | * padding into the Options area of a header. For N octets of |
3021 | | * padding, the Opt Data Len field contains the value N-2, and |
3022 | | * the Option Data consists of N-2 zero-valued octets." |
3023 | | */ |
3024 | 790 | proto_tree_add_item(opt_tree, hf_ipv6_opt_padn, tvb, offset, opt_len, ENC_NA); |
3025 | 790 | offset += opt_len; |
3026 | 790 | continue; |
3027 | 790 | } |
3028 | | |
3029 | 7.62k | opt_start = offset; |
3030 | 7.62k | switch (opt_type) { |
3031 | 197 | case IP6OPT_JUMBO: |
3032 | 197 | offset = dissect_opt_jumbo(tvb, offset, pinfo, opt_tree, &opt_ti, opt_len); |
3033 | 197 | break; |
3034 | 224 | case IP6OPT_RPL: |
3035 | 407 | case IP6OPT_RPL_OLD: |
3036 | 407 | offset = dissect_opt_rpl(tvb, offset, pinfo, opt_tree, &opt_ti, opt_len); |
3037 | 407 | break; |
3038 | 363 | case IP6OPT_TEL: |
3039 | 363 | offset = dissect_opt_tel(tvb, offset, pinfo, opt_tree, &opt_ti, opt_len); |
3040 | 363 | break; |
3041 | 249 | case IP6OPT_RTALERT: |
3042 | 249 | offset = dissect_opt_rtalert(tvb, offset, pinfo, opt_tree, &opt_ti, opt_len); |
3043 | 249 | break; |
3044 | 336 | case IP6OPT_PMTU: |
3045 | 336 | offset = dissect_opt_pmtu(tvb, offset, pinfo, opt_tree, &opt_ti, opt_len); |
3046 | 336 | break; |
3047 | 164 | case IP6OPT_APN6: |
3048 | 164 | offset = dissect_opt_apn6(tvb, offset, pinfo, opt_tree, &opt_ti, opt_len); |
3049 | 164 | break; |
3050 | 399 | case IP6OPT_QUICKSTART: |
3051 | 399 | offset = dissect_opt_quickstart(tvb, offset, pinfo, opt_tree, &opt_ti, opt_len, iph); |
3052 | 399 | break; |
3053 | 588 | case IP6OPT_IOAM: |
3054 | 588 | offset = dissect_opt_ioam(tvb, offset, pinfo, opt_tree, &opt_ti, opt_len); |
3055 | 588 | break; |
3056 | 126 | case IP6OPT_TPF: |
3057 | 126 | offset = dissect_opt_tpf(tvb, offset, pinfo, opt_tree, &opt_ti, opt_len); |
3058 | 126 | break; |
3059 | 53 | case IP6OPT_CALIPSO: |
3060 | 53 | offset = dissect_opt_calipso(tvb, offset, pinfo, opt_tree, &opt_ti, opt_len); |
3061 | 53 | break; |
3062 | 392 | case IP6OPT_SMF_DPD: |
3063 | 392 | offset = dissect_opt_smf_dpd(tvb, offset, pinfo, opt_tree, &opt_ti, opt_len); |
3064 | 392 | break; |
3065 | 110 | case IP6OPT_PDM: |
3066 | 110 | offset = dissect_opt_pdm(tvb, offset, pinfo, opt_tree, &opt_ti, opt_len); |
3067 | 110 | break; |
3068 | 40 | case IP6OPT_HOME_ADDRESS: |
3069 | 40 | offset = dissect_opt_home_address(tvb, offset, pinfo, opt_tree, &opt_ti, opt_len); |
3070 | 40 | break; |
3071 | 50 | case IP6OPT_ILNP_NONCE: |
3072 | 50 | offset = dissect_opt_ilnp_nonce(tvb, offset, pinfo, opt_tree, &opt_ti, opt_len); |
3073 | 50 | break; |
3074 | 72 | case IP6OPT_LIO: |
3075 | 72 | offset = dissect_opt_lio(tvb, offset, pinfo, opt_tree, &opt_ti, opt_len); |
3076 | 72 | break; |
3077 | 158 | case IP6OPT_MPL: |
3078 | 158 | offset = dissect_opt_mpl(tvb, offset, pinfo, opt_tree, &opt_ti, opt_len); |
3079 | 158 | break; |
3080 | 77 | case IP6OPT_IP_DFF: |
3081 | 77 | offset = dissect_opt_dff(tvb, offset, pinfo, opt_tree, &opt_ti, opt_len); |
3082 | 77 | break; |
3083 | 18 | case IP6OPT_ENDI: |
3084 | 18 | offset = dissect_opt_unknown(tvb, offset, pinfo, opt_tree, &opt_ti, opt_len); |
3085 | 18 | expert_add_info(pinfo, opt_ti.type, &ei_ipv6_opt_deprecated); |
3086 | 18 | break; |
3087 | 32 | case IP6OPT_EXP_1E: |
3088 | 67 | case IP6OPT_EXP_3E: |
3089 | 98 | case IP6OPT_EXP_5E: |
3090 | 132 | case IP6OPT_EXP_7E: |
3091 | 167 | case IP6OPT_EXP_9E: |
3092 | 204 | case IP6OPT_EXP_BE: |
3093 | 227 | case IP6OPT_EXP_DE: |
3094 | 265 | case IP6OPT_EXP_FE: |
3095 | 265 | proto_tree_add_item(opt_tree, hf_ipv6_opt_experimental, tvb, |
3096 | 265 | offset, opt_len, ENC_NA); |
3097 | 265 | offset += opt_len; |
3098 | 265 | break; |
3099 | 3.44k | default: |
3100 | 3.44k | offset = dissect_opt_unknown(tvb, offset, pinfo, opt_tree, &opt_ti, opt_len); |
3101 | 3.44k | break; |
3102 | 7.62k | } |
3103 | 6.91k | if (offset < opt_start + opt_len) { |
3104 | 722 | ti = proto_tree_add_item(opt_tree, hf_ipv6_opt_unknown_data, tvb, |
3105 | 722 | offset, opt_start + opt_len - offset, ENC_NA); |
3106 | 722 | expert_add_info(pinfo, ti, &ei_ipv6_opt_unknown_data); |
3107 | 722 | offset = opt_start + opt_len; |
3108 | 722 | } |
3109 | 6.91k | } |
3110 | | |
3111 | 2.55k | p_add_ipv6_nxt(pinfo, nxt); |
3112 | | |
3113 | 2.55k | next_tvb = tvb_new_subset_remaining(tvb, len); |
3114 | 2.55k | ipv6_dissect_next(nxt, next_tvb, pinfo, tree, iph); |
3115 | 2.55k | return tvb_captured_length(tvb); |
3116 | 3.27k | } |
3117 | | |
3118 | | static int |
3119 | | dissect_hopopts(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data) |
3120 | 3.23k | { |
3121 | 3.23k | col_append_sep_str(pinfo->cinfo, COL_INFO, " , ", "IPv6 hop-by-hop options"); |
3122 | | |
3123 | 3.23k | return dissect_opts(tvb, 0, tree, pinfo, (ws_ip6 *)data, proto_ipv6_hopopts); |
3124 | 3.23k | } |
3125 | | |
3126 | | static int |
3127 | | dissect_dstopts(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data) |
3128 | 41 | { |
3129 | 41 | col_append_sep_str(pinfo->cinfo, COL_INFO, " , ", "IPv6 destination options"); |
3130 | | |
3131 | 41 | return dissect_opts(tvb, 0, tree, pinfo, (ws_ip6 *)data, proto_ipv6_dstopts); |
3132 | 41 | } |
3133 | | |
3134 | | /* return value is > UINT16_MAX, else zero */ |
3135 | | /* tvb + offset contains the Hbh header */ |
3136 | | static uint32_t |
3137 | | ipv6_get_jumbo_plen(tvbuff_t *tvb, int offset) |
3138 | 96 | { |
3139 | 96 | int offset_end, hdr_len; |
3140 | 96 | int opt_type, opt_len; |
3141 | 96 | uint32_t jumbo_plen; |
3142 | | |
3143 | 96 | if (!tvb_bytes_exist(tvb, offset, 2)) { |
3144 | 18 | return 0; |
3145 | 18 | } |
3146 | 78 | hdr_len = (tvb_get_uint8(tvb, offset + 1) + 1) * 8; |
3147 | 78 | offset_end = offset + hdr_len; |
3148 | 78 | offset +=2; |
3149 | | |
3150 | 1.09k | while (offset < offset_end && tvb_bytes_exist(tvb, offset, 6)) { |
3151 | 1.01k | opt_type = tvb_get_uint8(tvb, offset); |
3152 | 1.01k | offset += 1; |
3153 | 1.01k | if (opt_type == IP6OPT_PAD1) { |
3154 | 588 | continue; |
3155 | 588 | } |
3156 | 426 | opt_len = tvb_get_uint8(tvb, offset); |
3157 | 426 | offset += 1; |
3158 | 426 | if (opt_type == IP6OPT_JUMBO && opt_len == 4) { |
3159 | 0 | jumbo_plen = tvb_get_uint32(tvb, offset, ENC_BIG_ENDIAN); |
3160 | 0 | if (jumbo_plen > UINT16_MAX) { |
3161 | 0 | return jumbo_plen; |
3162 | 0 | } |
3163 | 0 | return 0; |
3164 | 0 | } |
3165 | 426 | offset += opt_len; |
3166 | 426 | } |
3167 | 78 | return 0; |
3168 | 78 | } |
3169 | | |
3170 | | static void |
3171 | | add_ipv6_address_detail(packet_info *pinfo, proto_item *vis, proto_item *invis, |
3172 | | tvbuff_t *tvb, int offset, struct ipv6_addr_info_s *addr_info) |
3173 | 45.2k | { |
3174 | 45.2k | proto_item *ti; |
3175 | 45.2k | proto_tree *vtree; /* visible tree */ |
3176 | 45.2k | proto_tree *itree; /* invisible tree */ |
3177 | | |
3178 | 45.2k | vtree = proto_item_add_subtree(vis, ett_ipv6_detail); |
3179 | 45.2k | itree = proto_item_add_subtree(invis, ett_ipv6_detail); |
3180 | | |
3181 | | /* |
3182 | | * Internet Protocol Version 6 Address Space |
3183 | | * https://www.iana.org/assignments/ipv6-address-space/ipv6-address-space.xhtml |
3184 | | */ |
3185 | 45.2k | if (tvb_get_uint8(tvb, offset) == 0xFF) { |
3186 | | /* RFC 4291 section 2.4: multicast prefix */ |
3187 | 2.63k | ti = proto_tree_add_string(vtree, *addr_info->hf_addr_space, tvb, offset, 1, "Multicast"); |
3188 | 2.63k | proto_item_set_generated(ti); |
3189 | 2.63k | if (addr_info == &ipv6_src_info) { |
3190 | | /* "Shouldn't" see this one as a source */ |
3191 | 799 | expert_add_info(pinfo, ti, &ei_ipv6_src_addr_not_multicast); |
3192 | 799 | } |
3193 | | |
3194 | 2.63k | ti = proto_tree_add_string(itree, hf_ipv6_addr_space, tvb, offset, 1, "Multicast"); |
3195 | 2.63k | proto_item_set_generated(ti); |
3196 | | |
3197 | | /* |
3198 | | * Multicast address scope and flags. |
3199 | | * |
3200 | | * RFC 4291 Section 2.7: |
3201 | | * https://www.rfc-editor.org/rfc/rfc4291#section-2.7 |
3202 | | * |
3203 | | * RFC 7346: |
3204 | | * https://www.rfc-editor.org/rfc/rfc7346.html |
3205 | | * |
3206 | | * IANA Registry: |
3207 | | * https://www.iana.org/assignments/ipv6-multicast-addresses/ipv6-multicast-addresses.xhtml#ipv6-scope |
3208 | | */ |
3209 | | |
3210 | 2.63k | static int *const hf_ipv6_multicast_flags_bits[] = { |
3211 | 2.63k | &hf_ipv6_multicast_flags_reserved, |
3212 | 2.63k | &hf_ipv6_multicast_flags_embed_rp, |
3213 | 2.63k | &hf_ipv6_multicast_flags_network_prefix, |
3214 | 2.63k | &hf_ipv6_multicast_flags_transient, |
3215 | 2.63k | NULL |
3216 | 2.63k | }; |
3217 | | |
3218 | | /* Add multicast address flags. */ |
3219 | 2.63k | ti = proto_tree_add_bitmask(vtree, tvb, offset, *addr_info->hf_multicast_flags, |
3220 | 2.63k | ett_ipv6_multicast_flags, addr_info->hf_multicast_flags_bits, ENC_BIG_ENDIAN); |
3221 | 2.63k | proto_item_set_generated(ti); |
3222 | 2.63k | ti = proto_tree_add_bitmask(itree, tvb, offset, hf_ipv6_multicast_flags, |
3223 | 2.63k | ett_ipv6_multicast_flags, hf_ipv6_multicast_flags_bits, ENC_BIG_ENDIAN); |
3224 | 2.63k | proto_item_set_generated(ti); |
3225 | | |
3226 | | /* Add multicast address scope. */ |
3227 | 2.63k | ti = proto_tree_add_item(vtree, *addr_info->hf_multicast_scope, tvb, offset, 2, ENC_BIG_ENDIAN); |
3228 | 2.63k | proto_item_set_generated(ti); |
3229 | 2.63k | ti = proto_tree_add_item(itree, hf_ipv6_multicast_scope, tvb, offset, 2, ENC_BIG_ENDIAN); |
3230 | 2.63k | proto_item_set_generated(ti); |
3231 | 2.63k | } |
3232 | 42.5k | else if ((tvb_get_ntohs(tvb, offset) & 0xFFC0) == 0xFE80) { |
3233 | 831 | ti = proto_tree_add_string(vtree, *addr_info->hf_addr_space, tvb, offset, 2, "Link-Local Unicast"); |
3234 | 831 | proto_item_set_generated(ti); |
3235 | 831 | ti = proto_tree_add_string(itree, hf_ipv6_addr_space, tvb, offset, 2, "Link-Local Unicast"); |
3236 | 831 | proto_item_set_generated(ti); |
3237 | 831 | } |
3238 | 41.7k | else if ((tvb_get_uint8(tvb, offset) & 0x30) == 0x20) { |
3239 | 9.48k | ti = proto_tree_add_string(vtree, *addr_info->hf_addr_space, tvb, offset, 2, "Global Unicast"); |
3240 | 9.48k | proto_item_set_generated(ti); |
3241 | 9.48k | ti = proto_tree_add_string(itree, hf_ipv6_addr_space, tvb, offset, 2, "Global Unicast"); |
3242 | 9.48k | proto_item_set_generated(ti); |
3243 | 9.48k | } |
3244 | 32.2k | else if ((tvb_get_uint8(tvb, offset) & 0xFE) == 0xFC) { |
3245 | 313 | ti = proto_tree_add_string(vtree, *addr_info->hf_addr_space, tvb, offset, 2, "Unique Local Unicast"); |
3246 | 313 | proto_item_set_generated(ti); |
3247 | 313 | ti = proto_tree_add_string(itree, hf_ipv6_addr_space, tvb, offset, 2, "Unique Local Unicast"); |
3248 | 313 | proto_item_set_generated(ti); |
3249 | 313 | } |
3250 | 31.9k | else { |
3251 | 31.9k | ti = proto_tree_add_string(vtree, *addr_info->hf_addr_space, tvb, offset, 2, "Reserved by IETF"); |
3252 | 31.9k | proto_item_set_generated(ti); |
3253 | 31.9k | ti = proto_tree_add_string(itree, hf_ipv6_addr_space, tvb, offset, 2, "Reserved by IETF"); |
3254 | 31.9k | proto_item_set_generated(ti); |
3255 | 31.9k | } |
3256 | | |
3257 | | /* Check for IPv6 address special-purpose ranges. */ |
3258 | 45.2k | const ws_in6_addr *addr = tvb_get_ptr_ipv6(tvb, offset); |
3259 | 45.2k | const struct ws_iana_ip_special_block *block; |
3260 | 45.2k | proto_tree *vtree2; |
3261 | 45.2k | proto_tree *itree2; |
3262 | | |
3263 | 45.2k | if ((block = ws_iana_ipv6_special_block_lookup(addr)) != NULL) { |
3264 | 1.67k | ti = proto_tree_add_string(vtree, *addr_info->hf_special_purpose, tvb, offset, IPv6_ADDR_SIZE, block->name); |
3265 | 1.67k | proto_item_set_generated(ti); |
3266 | 1.67k | vtree2 = proto_item_add_subtree(ti, ett_ipv6_detail_special_purpose); |
3267 | | |
3268 | 1.67k | ti = proto_tree_add_string(itree, hf_ipv6_addr_special_purpose, tvb, offset, IPv6_ADDR_SIZE, block->name); |
3269 | 1.67k | proto_item_set_generated(ti); |
3270 | 1.67k | itree2 = proto_item_add_subtree(ti, ett_ipv6_detail_special_purpose); |
3271 | | |
3272 | 1.67k | if (block->source >= 0) { |
3273 | 1.67k | ti = proto_tree_add_boolean(vtree2, *addr_info->hf_special_purpose_source, tvb, offset, IPv6_ADDR_SIZE, block->source); |
3274 | 1.67k | proto_item_set_generated(ti); |
3275 | 1.67k | ti = proto_tree_add_boolean(itree2, hf_ipv6_addr_special_purpose_source, tvb, offset, IPv6_ADDR_SIZE, block->source); |
3276 | 1.67k | proto_item_set_generated(ti); |
3277 | 1.67k | } |
3278 | 1.67k | if (block->destination >= 0) { |
3279 | 1.67k | ti = proto_tree_add_boolean(vtree2, *addr_info->hf_special_purpose_destination, tvb, offset, IPv6_ADDR_SIZE, block->destination); |
3280 | 1.67k | proto_item_set_generated(ti); |
3281 | 1.67k | ti = proto_tree_add_boolean(itree2, hf_ipv6_addr_special_purpose_destination, tvb, offset, IPv6_ADDR_SIZE, block->destination); |
3282 | 1.67k | proto_item_set_generated(ti); |
3283 | 1.67k | } |
3284 | 1.67k | if (block->forwardable >= 0) { |
3285 | 1.67k | ti = proto_tree_add_boolean(vtree2, *addr_info->hf_special_purpose_forwardable, tvb, offset, IPv6_ADDR_SIZE, block->forwardable); |
3286 | 1.67k | proto_item_set_generated(ti); |
3287 | 1.67k | ti = proto_tree_add_boolean(itree2, hf_ipv6_addr_special_purpose_forwardable, tvb, offset, IPv6_ADDR_SIZE, block->forwardable); |
3288 | 1.67k | proto_item_set_generated(ti); |
3289 | 1.67k | } |
3290 | 1.67k | if (block->global >= 0) { |
3291 | 1.35k | ti = proto_tree_add_boolean(vtree2, *addr_info->hf_special_purpose_global, tvb, offset, IPv6_ADDR_SIZE, block->global); |
3292 | 1.35k | proto_item_set_generated(ti); |
3293 | 1.35k | ti = proto_tree_add_boolean(itree2, hf_ipv6_addr_special_purpose_global, tvb, offset, IPv6_ADDR_SIZE, block->global); |
3294 | 1.35k | proto_item_set_generated(ti); |
3295 | 1.35k | } |
3296 | 1.67k | if (block->reserved >= 0) { |
3297 | 1.67k | ti = proto_tree_add_boolean(vtree2, *addr_info->hf_special_purpose_reserved, tvb, offset, IPv6_ADDR_SIZE, block->reserved); |
3298 | 1.67k | proto_item_set_generated(ti); |
3299 | 1.67k | ti = proto_tree_add_boolean(itree2, hf_ipv6_addr_special_purpose_reserved, tvb, offset, IPv6_ADDR_SIZE, block->reserved); |
3300 | 1.67k | proto_item_set_generated(ti); |
3301 | 1.67k | } |
3302 | 1.67k | } |
3303 | 45.2k | } |
3304 | | |
3305 | | static void |
3306 | | add_ipv6_address(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset, |
3307 | | struct ipv6_addr_info_s *addr_info) |
3308 | 45.5k | { |
3309 | 45.5k | ws_in6_addr addr; |
3310 | 45.5k | const char *name; |
3311 | 45.5k | proto_item *ti, *vis, *invis; |
3312 | | |
3313 | 45.5k | vis = proto_tree_add_item(tree, *addr_info->hf_addr, tvb, offset, IPv6_ADDR_SIZE, ENC_NA); |
3314 | 45.5k | invis = proto_tree_add_item(tree, hf_ipv6_addr, tvb, offset, IPv6_ADDR_SIZE, ENC_NA); |
3315 | 45.5k | proto_item_set_hidden(invis); |
3316 | | |
3317 | 45.5k | if (ipv6_address_detail) { |
3318 | 45.2k | add_ipv6_address_detail(pinfo, vis, invis, tvb, offset, addr_info); |
3319 | 45.2k | } |
3320 | | |
3321 | 45.5k | if (!proto_field_is_referenced(tree, *addr_info->hf_host) && |
3322 | 2.88k | !proto_field_is_referenced(tree, hf_ipv6_host)) { |
3323 | | |
3324 | 2.88k | return; |
3325 | 2.88k | } |
3326 | | |
3327 | 42.6k | tvb_get_ipv6(tvb, offset, &addr); |
3328 | 42.6k | name = get_hostname6_wmem(pinfo->pool, &addr); |
3329 | 42.6k | ti = proto_tree_add_string(tree, *addr_info->hf_host, tvb, offset, IPv6_ADDR_SIZE, name); |
3330 | 42.6k | proto_item_set_generated(ti); |
3331 | 42.6k | proto_item_set_hidden(ti); |
3332 | 42.6k | ti = proto_tree_add_string(tree, hf_ipv6_host, tvb, offset, IPv6_ADDR_SIZE, name); |
3333 | 42.6k | proto_item_set_generated(ti); |
3334 | 42.6k | proto_item_set_hidden(ti); |
3335 | 42.6k | } |
3336 | | |
3337 | | #define ADDRESS_SET_GENERATED_HIDDEN(ti) \ |
3338 | 98 | G_STMT_START { \ |
3339 | 98 | proto_item_set_generated(ti); \ |
3340 | 98 | if (i > 0) proto_item_set_hidden(ti); \ |
3341 | 98 | } G_STMT_END |
3342 | | |
3343 | | /* RFC 3056 section 2 */ |
3344 | | static void |
3345 | | add_ipv6_address_6to4(proto_tree *tree, tvbuff_t *tvb, int offset, |
3346 | | int hf_gateway, int hf_sla_id) |
3347 | 45.0k | { |
3348 | 45.0k | if (tvb_get_ntohs(tvb, offset) != 0x2002) |
3349 | 44.9k | return; |
3350 | | |
3351 | 4 | struct { int gateway, sla_id; } hf[2] = { |
3352 | 4 | { hf_gateway, hf_sla_id}, |
3353 | 4 | { hf_ipv6_6to4_gateway_ipv4, hf_ipv6_6to4_sla_id} |
3354 | 4 | }; |
3355 | 4 | proto_item *ti; |
3356 | 12 | for (int i = 0; i < 2; i++) { |
3357 | 8 | ti = proto_tree_add_item(tree, hf[i].gateway, tvb, offset + 2, 4, ENC_BIG_ENDIAN); |
3358 | 8 | ADDRESS_SET_GENERATED_HIDDEN(ti); |
3359 | 8 | ti = proto_tree_add_item(tree, hf[i].sla_id, tvb, offset + 6, 2, ENC_BIG_ENDIAN); |
3360 | 8 | ADDRESS_SET_GENERATED_HIDDEN(ti); |
3361 | 8 | } |
3362 | 4 | } |
3363 | | |
3364 | | /* RFC 4380 section 4 */ |
3365 | | static void |
3366 | | add_ipv6_address_teredo(proto_tree *tree, tvbuff_t *tvb, int offset, |
3367 | | int hf_server, int hf_port, int hf_client) |
3368 | 45.0k | { |
3369 | 45.0k | if (tvb_get_ntohl(tvb, offset) != 0x20010000) |
3370 | 44.9k | return; |
3371 | | |
3372 | 8 | uint16_t mapped_port = tvb_get_ntohs(tvb, offset + 10) ^ 0xffff; |
3373 | 8 | uint32_t client_v4 = tvb_get_ipv4(tvb, offset + 12) ^ 0xffffffff; |
3374 | | |
3375 | 8 | struct { int server, port, client; } hf[2] = { |
3376 | 8 | { hf_server, hf_port, hf_client }, |
3377 | 8 | { hf_ipv6_teredo_server_ipv4, hf_ipv6_teredo_port, hf_ipv6_teredo_client_ipv4 } |
3378 | 8 | }; |
3379 | 8 | proto_item *ti; |
3380 | 24 | for (int i = 0; i < 2; i++) { |
3381 | 16 | ti = proto_tree_add_item(tree, hf[i].server, tvb, offset + 4, 4, ENC_BIG_ENDIAN); |
3382 | 16 | ADDRESS_SET_GENERATED_HIDDEN(ti); |
3383 | 16 | ti = proto_tree_add_uint(tree, hf[i].port, tvb, offset + 10, 2, mapped_port); |
3384 | 16 | ADDRESS_SET_GENERATED_HIDDEN(ti); |
3385 | 16 | ti = proto_tree_add_ipv4(tree, hf[i].client, tvb, offset + 12, 4, client_v4); |
3386 | 16 | ADDRESS_SET_GENERATED_HIDDEN(ti); |
3387 | 16 | } |
3388 | 8 | } |
3389 | | |
3390 | | /* RFC 4291 appendix A */ |
3391 | | static void |
3392 | | add_ipv6_address_slaac(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset, int hf_slaac) |
3393 | 45.0k | { |
3394 | 45.0k | if (!(tvb_get_uint8(tvb, offset + 8) & 0x02) || |
3395 | 44.9k | !(tvb_get_ntohs(tvb, offset + 11) == 0xfffe)) { |
3396 | 44.9k | return; |
3397 | 44.9k | } |
3398 | | |
3399 | 17 | uint8_t *mac_addr = (uint8_t *)wmem_alloc(pinfo->pool, 6); |
3400 | 17 | tvb_memcpy(tvb, mac_addr, offset + 8, 3); |
3401 | 17 | tvb_memcpy(tvb, mac_addr+3, offset + 13, 3); |
3402 | 17 | mac_addr[0] &= ~0x02; |
3403 | | |
3404 | 17 | struct { int mac; } hf[2] = { |
3405 | 17 | { hf_slaac }, |
3406 | 17 | { hf_ipv6_slaac_mac } |
3407 | 17 | }; |
3408 | 17 | proto_item *ti; |
3409 | 51 | for (int i = 0; i < 2; i++) { |
3410 | 34 | ti = proto_tree_add_ether(tree, hf[i].mac, tvb, offset + 8, 8, mac_addr); |
3411 | 34 | ADDRESS_SET_GENERATED_HIDDEN(ti); |
3412 | 34 | } |
3413 | 17 | } |
3414 | | |
3415 | | /* RFC 5214 section 6.1 */ |
3416 | | static void |
3417 | | add_ipv6_address_isatap(proto_tree *tree, tvbuff_t *tvb, int offset, int hf_isatap) |
3418 | 45.0k | { |
3419 | 45.0k | if ((tvb_get_ntohl(tvb, offset + 8) & 0xfcffffff) != 0x00005efe) |
3420 | 45.0k | return; |
3421 | | |
3422 | 0 | struct { int ipv4; } hf[2] = { |
3423 | 0 | { hf_isatap }, |
3424 | 0 | { hf_ipv6_isatap_ipv4 } |
3425 | 0 | }; |
3426 | 0 | proto_item *ti; |
3427 | 0 | for (int i = 0; i < 2; i++) { |
3428 | 0 | ti = proto_tree_add_item(tree, hf[i].ipv4, tvb, offset + 12, 4, ENC_BIG_ENDIAN); |
3429 | 0 | ADDRESS_SET_GENERATED_HIDDEN(ti); |
3430 | 0 | } |
3431 | 0 | } |
3432 | | |
3433 | | /* RFC 6052 */ |
3434 | | static void |
3435 | | add_ipv6_address_embed_ipv4(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset, int hf_embed) |
3436 | 45.0k | { |
3437 | | /* Section 2.1: Well-Known Prefix for IPv4-Embedded IPv6 Address: 64:FF9B::/96 */ |
3438 | 45.0k | static const uint8_t well_known_prefix[] = { |
3439 | 45.0k | 0x00, 0x64, 0xFF, 0x9B, |
3440 | 45.0k | 0x00, 0x00, 0x00, 0x00, |
3441 | 45.0k | 0x00, 0x00, 0x00, 0x00 |
3442 | 45.0k | }; |
3443 | | |
3444 | 45.0k | ws_in6_addr ipv6_addr; |
3445 | 45.0k | ws_in4_addr ipv4_addr; |
3446 | 45.0k | int ipv4_prefix; |
3447 | 45.0k | int ipv4_offset; |
3448 | 45.0k | bool ipv6_embed_ipv4 = false; |
3449 | | |
3450 | 45.0k | if (tvb_memeql(tvb, offset, well_known_prefix, sizeof well_known_prefix) == 0) { |
3451 | 180 | ipv4_addr = tvb_get_bits32(tvb, (offset * 8) + 96, 32, ENC_BIG_ENDIAN); |
3452 | 180 | ipv4_prefix = 96; |
3453 | 180 | ipv4_offset = 96; |
3454 | 180 | ipv6_embed_ipv4 = true; |
3455 | 44.8k | } else { |
3456 | 44.8k | for (size_t j = 0; j < number_of_nat64_prefix; j++) { |
3457 | 0 | if (nat64_prefix_uats[j].prefix_len <= nat64_prefix_uats[j].prefix_wildcard_len) { |
3458 | 0 | continue; |
3459 | 0 | } |
3460 | | |
3461 | 0 | if (ws_inet_pton6(nat64_prefix_uats[j].ipaddr, &ipv6_addr)) { |
3462 | 0 | if (tvb_memeql(tvb, offset, (const uint8_t *)&ipv6_addr, |
3463 | 0 | (nat64_prefix_uats[j].prefix_len - nat64_prefix_uats[j].prefix_wildcard_len) / 8) == 0) { |
3464 | 0 | switch (nat64_prefix_uats[j].prefix_len) |
3465 | 0 | { |
3466 | 0 | case 32: |
3467 | 0 | ipv4_addr = tvb_get_bits32(tvb, (offset * 8) + 32, 32, ENC_BIG_ENDIAN); |
3468 | 0 | break; |
3469 | 0 | case 40: |
3470 | 0 | ipv4_addr = tvb_get_bits32(tvb, (offset * 8) + 40, 24, ENC_BIG_ENDIAN) << 8; |
3471 | 0 | ipv4_addr |= tvb_get_bits32(tvb, (offset * 8) + 72, 8, ENC_BIG_ENDIAN); |
3472 | 0 | break; |
3473 | 0 | case 48: |
3474 | 0 | ipv4_addr = tvb_get_bits32(tvb, (offset * 8) + 48, 16, ENC_BIG_ENDIAN) << 16; |
3475 | 0 | ipv4_addr |= tvb_get_bits32(tvb, (offset * 8) + 72, 16, ENC_BIG_ENDIAN); |
3476 | 0 | break; |
3477 | 0 | case 56: |
3478 | 0 | ipv4_addr = tvb_get_bits32(tvb, (offset * 8) + 56, 8, ENC_BIG_ENDIAN) << 24; |
3479 | 0 | ipv4_addr |= tvb_get_bits32(tvb, (offset * 8) + 72, 24, ENC_BIG_ENDIAN); |
3480 | 0 | break; |
3481 | 0 | case 64: |
3482 | 0 | ipv4_addr = tvb_get_bits32(tvb, (offset * 8) + 72, 32, ENC_BIG_ENDIAN); |
3483 | 0 | break; |
3484 | 0 | case 96: |
3485 | 0 | ipv4_addr = tvb_get_bits32(tvb, (offset * 8) + 96, 32, ENC_BIG_ENDIAN); |
3486 | 0 | break; |
3487 | 0 | default: |
3488 | 0 | DISSECTOR_ASSERT_NOT_REACHED(); |
3489 | 0 | } |
3490 | | |
3491 | 0 | ipv4_prefix = nat64_prefix_uats[j].prefix_len; |
3492 | 0 | if (ipv4_prefix != 64) { |
3493 | 0 | ipv4_offset = ipv4_prefix; |
3494 | 0 | } else { |
3495 | 0 | ipv4_offset = 72; |
3496 | 0 | } |
3497 | 0 | ipv6_embed_ipv4 = true; |
3498 | 0 | break; |
3499 | 0 | } |
3500 | 0 | } |
3501 | 0 | } |
3502 | 44.8k | } |
3503 | | |
3504 | 45.0k | if (ipv6_embed_ipv4) { |
3505 | 180 | proto_item *ti; |
3506 | | |
3507 | | // The prefix |
3508 | 180 | ti = proto_tree_add_item(tree, hf_ipv6_embed_ipv4_prefix, tvb, offset, ipv4_prefix / 8, ENC_NA); |
3509 | 180 | proto_item_set_generated(ti); |
3510 | | |
3511 | | // Majority of IPv4 address is after u-field |
3512 | 180 | if (ipv4_prefix >= 56) { |
3513 | 180 | if (ipv4_prefix < 96) { |
3514 | 0 | ti = proto_tree_add_item(tree, hf_ipv6_embed_ipv4_u, tvb, offset + 8, 1, ENC_NA); |
3515 | 0 | proto_item_set_generated(ti); |
3516 | 0 | } |
3517 | 180 | if (tvb_get_uint8(tvb, offset + 8)) { |
3518 | 0 | expert_add_info(pinfo, ti, &ei_ipv6_embed_ipv4_u_value); |
3519 | 0 | } |
3520 | 180 | } |
3521 | | |
3522 | | // IPv4 embedded address |
3523 | 180 | ipv4_addr = g_ntohl(ipv4_addr); |
3524 | 180 | ti = proto_tree_add_ipv4(tree, hf_embed, tvb, |
3525 | 180 | offset + (ipv4_offset / 8), |
3526 | 180 | (ipv4_offset > 32 && ipv4_offset < 64) ? 5 : 4, ipv4_addr); |
3527 | 180 | proto_item_set_generated(ti); |
3528 | | |
3529 | 180 | ti = proto_tree_add_ipv4(tree, hf_ipv6_embed_ipv4, tvb, |
3530 | 180 | offset + (ipv4_offset / 8), |
3531 | 180 | (ipv4_offset > 32 && ipv4_offset < 64) ? 5 : 4, ipv4_addr); |
3532 | 180 | proto_item_set_generated(ti); |
3533 | | |
3534 | | // Majority of IPv4 address is before u-field |
3535 | 180 | if (ipv4_prefix < 56) { |
3536 | 0 | ti = proto_tree_add_item(tree, hf_ipv6_embed_ipv4_u, tvb, offset + 8, 1, ENC_NA); |
3537 | 0 | proto_item_set_generated(ti); |
3538 | 0 | if (tvb_get_uint8(tvb, offset + 8)) { |
3539 | 0 | expert_add_info(pinfo, ti, &ei_ipv6_embed_ipv4_u_value); |
3540 | 0 | } |
3541 | 0 | } |
3542 | | |
3543 | | // Suffix, if present |
3544 | 180 | if (ipv4_prefix < 96) { |
3545 | 0 | ti = proto_tree_add_item(tree, hf_ipv6_embed_ipv4_suffix, tvb, |
3546 | 0 | offset + ((72 + ipv4_prefix - 32) / 8), |
3547 | 0 | (56 - (ipv4_prefix - 32)) / 8, |
3548 | 0 | ENC_NA); |
3549 | 0 | proto_item_set_generated(ti); |
3550 | 0 | } |
3551 | 180 | } |
3552 | 45.0k | } |
3553 | | |
3554 | | static void |
3555 | | export_pdu(tvbuff_t *tvb, packet_info *pinfo) |
3556 | 22.5k | { |
3557 | 22.5k | if (have_tap_listener(exported_pdu_tap)) { |
3558 | 0 | exp_pdu_data_t *exp_pdu_data = wmem_new0(pinfo->pool, exp_pdu_data_t); |
3559 | |
|
3560 | 0 | exp_pdu_data->tvb_captured_length = tvb_captured_length(tvb); |
3561 | 0 | exp_pdu_data->tvb_reported_length = tvb_reported_length(tvb); |
3562 | 0 | exp_pdu_data->pdu_tvb = tvb; |
3563 | 0 | tap_queue_packet(exported_pdu_tap, pinfo, exp_pdu_data); |
3564 | 0 | } |
3565 | 22.5k | } |
3566 | | |
3567 | | static struct ipv6_analysis * |
3568 | | init_ipv6_conversation_data(packet_info *pinfo) |
3569 | 9.22k | { |
3570 | 9.22k | struct ipv6_analysis *ipv6d; |
3571 | | |
3572 | | /* Initialize the ip protocol data structure to add to the ip conversation */ |
3573 | 9.22k | ipv6d=wmem_new0(wmem_file_scope(), struct ipv6_analysis); |
3574 | | |
3575 | 9.22k | ipv6d->initial_frame = pinfo->num; |
3576 | 9.22k | ipv6d->stream = 0; |
3577 | 9.22k | ipv6d->stream = ipv6_stream_count++; |
3578 | | |
3579 | 9.22k | return ipv6d; |
3580 | 9.22k | } |
3581 | | |
3582 | | struct ipv6_analysis * |
3583 | | get_ipv6_conversation_data(conversation_t *conv, packet_info *pinfo) |
3584 | 22.5k | { |
3585 | 22.5k | struct ipv6_analysis *ipv6d; |
3586 | | |
3587 | | /* Did the caller supply the conversation pointer? */ |
3588 | 22.5k | if( conv==NULL ) { |
3589 | 0 | return NULL; |
3590 | 0 | } |
3591 | | |
3592 | | /* Get the data for this conversation */ |
3593 | 22.5k | ipv6d=(struct ipv6_analysis *)conversation_get_proto_data(conv, proto_ipv6); |
3594 | | |
3595 | 22.5k | if (!ipv6d) { |
3596 | 9.22k | ipv6d = init_ipv6_conversation_data(pinfo); |
3597 | 9.22k | conversation_add_proto_data(conv, proto_ipv6, ipv6d); |
3598 | 9.22k | } |
3599 | | |
3600 | 22.5k | if (!ipv6d) { |
3601 | 0 | return NULL; |
3602 | 0 | } |
3603 | | |
3604 | 22.5k | return ipv6d; |
3605 | 22.5k | } |
3606 | | |
3607 | | static int |
3608 | | dissect_ipv6(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_) |
3609 | 23.0k | { |
3610 | 23.0k | proto_tree *ipv6_tree, *pt; |
3611 | 23.0k | proto_item *ipv6_item, *ti, *pi; |
3612 | 23.0k | proto_item *ti_ipv6_plen = NULL, *ti_ipv6_version; |
3613 | 23.0k | uint8_t ip6_tcls, ip6_nxt, ip6_hlim; |
3614 | 23.0k | uint32_t ip6_flow; |
3615 | 23.0k | const ws_in6_addr *ip6_src, *ip6_dst; |
3616 | 23.0k | uint32_t ip6_plen = 0, jumbo_plen = 0; |
3617 | 23.0k | uint32_t plen; |
3618 | 23.0k | int offset; |
3619 | 23.0k | unsigned reported_plen; |
3620 | 23.0k | tvbuff_t *next_tvb; |
3621 | 23.0k | bool save_fragmented; |
3622 | 23.0k | int version; |
3623 | 23.0k | ws_ip6 *iph; |
3624 | 23.0k | struct ipv6_analysis *ipv6d=NULL; |
3625 | | |
3626 | 23.0k | offset = 0; |
3627 | | |
3628 | 23.0k | iph = wmem_new0(pinfo->pool, ws_ip6); |
3629 | | |
3630 | 23.0k | col_set_str(pinfo->cinfo, COL_PROTOCOL, "IPv6"); |
3631 | 23.0k | col_clear(pinfo->cinfo, COL_INFO); |
3632 | | |
3633 | 23.0k | ipv6_item = proto_tree_add_item(tree, proto_ipv6, tvb, offset, IPv6_HDR_SIZE, ENC_NA); |
3634 | 23.0k | ipv6_tree = proto_item_add_subtree(ipv6_item, ett_ipv6_proto); |
3635 | | |
3636 | | |
3637 | | /* Validate IP version (6) */ |
3638 | 23.0k | version = tvb_get_bits8(tvb, (offset + IP6H_CTL_VFC) * 8, 4); |
3639 | 23.0k | ti_ipv6_version = proto_tree_add_bits_item(ipv6_tree, hf_ipv6_version, tvb, |
3640 | 23.0k | (offset + IP6H_CTL_VFC) * 8, 4, ENC_BIG_ENDIAN); |
3641 | 23.0k | pi = proto_tree_add_item(ipv6_tree, hf_ip_version, tvb, |
3642 | 23.0k | offset + IP6H_CTL_VFC, 1, ENC_BIG_ENDIAN); |
3643 | 23.0k | proto_item_append_text(pi, " [This field makes the filter match on \"ip.version == 6\" possible]"); |
3644 | 23.0k | proto_item_set_hidden(pi); |
3645 | 23.0k | if (version != 6) { |
3646 | 97 | col_add_fstr(pinfo->cinfo, COL_INFO, |
3647 | 97 | "Bogus IPv6 version (%u, must be 6)", version); |
3648 | 97 | expert_add_info_format(pinfo, ti_ipv6_version, &ei_ipv6_bogus_ipv6_version, "Bogus IPv6 version"); |
3649 | 97 | return offset + IP6H_CTL_VFC; |
3650 | 97 | } |
3651 | | |
3652 | | /* Validate header size (40 bytes) */ |
3653 | 22.9k | if (tvb_reported_length(tvb) < IPv6_HDR_SIZE) { |
3654 | 412 | col_add_fstr(pinfo->cinfo, COL_INFO, |
3655 | 412 | "Invalid IPv6 header (%u bytes, need exactly 40)", |
3656 | 412 | tvb_reported_length(tvb)); |
3657 | 412 | expert_add_info_format(pinfo, ipv6_item, &ei_ipv6_invalid_header, |
3658 | 412 | "IPv6 header must be exactly 40 bytes"); |
3659 | 412 | } |
3660 | | |
3661 | | /* !!! warning: (4-bit) version, (6-bit) DSCP, (2-bit) ECN and (20-bit) Flow */ |
3662 | 22.9k | ti = proto_tree_add_item(ipv6_tree, hf_ipv6_tclass, tvb, |
3663 | 22.9k | offset + IP6H_CTL_VFC, 4, ENC_BIG_ENDIAN); |
3664 | 22.9k | ip6_tcls = tvb_get_bits8(tvb, (offset + IP6H_CTL_VFC) * 8 + 4, 8); |
3665 | 22.9k | proto_item_append_text(ti, " (DSCP: %s, ECN: %s)", |
3666 | 22.9k | val_to_str_ext_const(IPDSFIELD_DSCP(ip6_tcls), &dscp_short_vals_ext, "Unknown"), |
3667 | 22.9k | val_to_str_ext_const(IPDSFIELD_ECN(ip6_tcls), &ecn_short_vals_ext, "Unknown")); |
3668 | | |
3669 | 22.9k | pt = proto_item_add_subtree(ti, ett_ipv6_traffic_class); |
3670 | 22.9k | proto_tree_add_item(pt, hf_ipv6_tclass_dscp, tvb, |
3671 | 22.9k | offset + IP6H_CTL_VFC, 4, ENC_BIG_ENDIAN); |
3672 | 22.9k | proto_tree_add_item(pt, hf_ipv6_tclass_ecn, tvb, |
3673 | 22.9k | offset + IP6H_CTL_VFC, 4, ENC_BIG_ENDIAN); |
3674 | | |
3675 | | /* Set DSCP column */ |
3676 | 22.9k | col_add_str(pinfo->cinfo, COL_DSCP_VALUE, |
3677 | 22.9k | val_to_str_ext(pinfo->pool, IPDSFIELD_DSCP(ip6_tcls), &dscp_short_vals_ext, "%u")); |
3678 | | |
3679 | 22.9k | proto_tree_add_item_ret_uint(ipv6_tree, hf_ipv6_flow, tvb, |
3680 | 22.9k | offset + IP6H_CTL_FLOW + 1, 3, ENC_BIG_ENDIAN, &ip6_flow); |
3681 | | |
3682 | 22.9k | ip6_plen = tvb_get_uint16(tvb, offset + IP6H_CTL_PLEN, ENC_BIG_ENDIAN); |
3683 | | |
3684 | 22.9k | ip6_nxt = tvb_get_uint8(tvb, offset + IP6H_CTL_NXT); |
3685 | | |
3686 | 22.9k | if (ipv6_tso_supported && ip6_plen == 0 && |
3687 | 0 | ip6_nxt != IP_PROTO_HOPOPT && ip6_nxt != IP_PROTO_IPV6_NONXT) { |
3688 | 0 | ip6_plen = tvb_reported_length(tvb) - IPv6_HDR_SIZE; |
3689 | 0 | pi = proto_tree_add_uint_format_value(ipv6_tree, hf_ipv6_plen, tvb, |
3690 | 0 | offset + IP6H_CTL_PLEN, 2, ip6_plen, |
3691 | 0 | "%u bytes (reported as 0, presumed to be because " |
3692 | 0 | "of \"TCP segmentation offload\" (TSO))", |
3693 | 0 | ip6_plen); |
3694 | 0 | proto_item_set_generated(pi); |
3695 | 22.9k | } else { |
3696 | 22.9k | ti_ipv6_plen = proto_tree_add_item(ipv6_tree, hf_ipv6_plen, tvb, |
3697 | 22.9k | offset + IP6H_CTL_PLEN, 2, ENC_BIG_ENDIAN); |
3698 | 22.9k | if (ip6_plen == 0 && ip6_nxt != IP_PROTO_HOPOPT && ip6_nxt != IP_PROTO_IPV6_NONXT) { |
3699 | 67 | expert_add_info(pinfo, ti_ipv6_plen, &ei_ipv6_plen_zero); |
3700 | 67 | } |
3701 | 22.9k | } |
3702 | | |
3703 | 22.9k | proto_tree_add_item(ipv6_tree, hf_ipv6_nxt, tvb, offset + IP6H_CTL_NXT, 1, ENC_NA); |
3704 | | |
3705 | 22.9k | proto_tree_add_item(ipv6_tree, hf_ipv6_hlim, tvb, |
3706 | 22.9k | offset + IP6H_CTL_HLIM, 1, ENC_BIG_ENDIAN); |
3707 | 22.9k | ip6_hlim = tvb_get_uint8(tvb, offset + IP6H_CTL_HLIM); |
3708 | | |
3709 | | /* Source address */ |
3710 | 22.9k | add_ipv6_address(pinfo, ipv6_tree, tvb, offset + IP6H_SRC, &ipv6_src_info); |
3711 | 22.9k | ip6_src = tvb_get_ptr_ipv6(tvb, offset + IP6H_SRC); |
3712 | 22.9k | alloc_address_wmem_ipv6(pinfo->pool, &pinfo->net_src, ip6_src); |
3713 | 22.9k | copy_address_shallow(&pinfo->src, &pinfo->net_src); |
3714 | | |
3715 | | /* Destination address */ |
3716 | 22.9k | add_ipv6_address(pinfo, ipv6_tree, tvb, offset + IP6H_DST, &ipv6_dst_info); |
3717 | 22.9k | ip6_dst = tvb_get_ptr_ipv6(tvb, offset + IP6H_DST); |
3718 | 22.9k | alloc_address_wmem_ipv6(pinfo->pool, &pinfo->net_dst, ip6_dst); |
3719 | 22.9k | copy_address_shallow(&pinfo->dst, &pinfo->net_dst); |
3720 | | |
3721 | 22.9k | if (tree) { |
3722 | 22.5k | if (ipv6_summary_in_tree) { |
3723 | 22.5k | proto_item_append_text(ipv6_item, ", Src: %s, Dst: %s", |
3724 | 22.5k | address_with_resolution_to_str(pinfo->pool, &pinfo->src), |
3725 | 22.5k | address_with_resolution_to_str(pinfo->pool, &pinfo->dst)); |
3726 | 22.5k | } |
3727 | | |
3728 | | /* Add the different items for the address */ |
3729 | 22.5k | add_ipv6_address_6to4(ipv6_tree, tvb, offset + IP6H_SRC, |
3730 | 22.5k | hf_ipv6_src_6to4_gateway_ipv4, hf_ipv6_src_6to4_sla_id); |
3731 | 22.5k | add_ipv6_address_6to4(ipv6_tree, tvb, offset + IP6H_DST, |
3732 | 22.5k | hf_ipv6_dst_6to4_gateway_ipv4, hf_ipv6_dst_6to4_sla_id); |
3733 | | |
3734 | 22.5k | add_ipv6_address_teredo(ipv6_tree, tvb, offset + IP6H_SRC, |
3735 | 22.5k | hf_ipv6_src_teredo_server_ipv4, hf_ipv6_src_teredo_port, hf_ipv6_src_teredo_client_ipv4); |
3736 | 22.5k | add_ipv6_address_teredo(ipv6_tree, tvb, offset + IP6H_DST, |
3737 | 22.5k | hf_ipv6_dst_teredo_server_ipv4, hf_ipv6_dst_teredo_port, hf_ipv6_dst_teredo_client_ipv4); |
3738 | | |
3739 | 22.5k | add_ipv6_address_slaac(pinfo, ipv6_tree, tvb, offset + IP6H_SRC, hf_ipv6_src_slaac_mac); |
3740 | 22.5k | add_ipv6_address_slaac(pinfo, ipv6_tree, tvb, offset + IP6H_DST, hf_ipv6_dst_slaac_mac); |
3741 | | |
3742 | 22.5k | add_ipv6_address_isatap(ipv6_tree, tvb, offset + IP6H_SRC, hf_ipv6_src_isatap_ipv4); |
3743 | 22.5k | add_ipv6_address_isatap(ipv6_tree, tvb, offset + IP6H_DST, hf_ipv6_dst_isatap_ipv4); |
3744 | | |
3745 | 22.5k | add_ipv6_address_embed_ipv4(pinfo, ipv6_tree, tvb, offset + IP6H_SRC, hf_ipv6_src_embed_ipv4); |
3746 | 22.5k | add_ipv6_address_embed_ipv4(pinfo, ipv6_tree, tvb, offset + IP6H_DST, hf_ipv6_dst_embed_ipv4); |
3747 | | |
3748 | 22.5k | if (gbl_resolv_flags.maxmind_geoip) { |
3749 | 22.5k | add_geoip_info(ipv6_tree, pinfo, tvb, offset, ip6_src, ip6_dst); |
3750 | 22.5k | } |
3751 | 22.5k | } |
3752 | | |
3753 | | /* Increment offset to point to next header (may be an extension header) */ |
3754 | 22.9k | offset += IPv6_HDR_SIZE; |
3755 | | |
3756 | | /* Check for Jumbo option */ |
3757 | 22.9k | plen = ip6_plen; |
3758 | 22.9k | if (plen == 0 && ip6_nxt == IP_PROTO_HOPOPT) { |
3759 | 96 | jumbo_plen = ipv6_get_jumbo_plen(tvb, offset); |
3760 | 96 | if (jumbo_plen != 0) { |
3761 | 0 | proto_item_append_text(ti_ipv6_plen, " (Jumbogram)"); |
3762 | 0 | plen = jumbo_plen; |
3763 | 96 | } else { |
3764 | | /* IPv6 length zero is invalid if there is a hop-by-hop header without jumbo option */ |
3765 | 96 | col_set_str(pinfo->cinfo, COL_INFO, "Invalid IPv6 payload length"); |
3766 | 96 | expert_add_info(pinfo, ti_ipv6_plen, &ei_ipv6_opt_jumbo_missing); |
3767 | 96 | } |
3768 | 96 | } |
3769 | | |
3770 | 22.9k | reported_plen = tvb_reported_length(tvb) - IPv6_HDR_SIZE; |
3771 | 22.9k | if (!pinfo->flags.in_error_pkt && plen > reported_plen) { |
3772 | 14.7k | expert_add_info_format(pinfo, ti_ipv6_plen, &ei_ipv6_plen_exceeds_framing, |
3773 | 14.7k | "IPv6 payload length exceeds framing length (%d bytes)", reported_plen); |
3774 | 14.7k | } |
3775 | | |
3776 | | |
3777 | 22.9k | if (ipv6_track_conv_id) { |
3778 | | /* conversation management */ |
3779 | 22.5k | conversation_t *conv; |
3780 | | |
3781 | | /* find (and extend) an existing conversation, or create a new one */ |
3782 | 22.5k | conv = find_conversation_strat(pinfo, CONVERSATION_IPV6, NO_PORT_X, false); |
3783 | 22.5k | if(!conv) { |
3784 | 9.22k | conv=conversation_new_strat(pinfo, CONVERSATION_IPV6, NO_PORTS); |
3785 | 9.22k | } |
3786 | 13.2k | else { |
3787 | | /* |
3788 | | * while not strictly necessary because there is only 1 |
3789 | | * conversation between 2 IPs, we still move the last frame |
3790 | | * indicator as being a usual practice. |
3791 | | */ |
3792 | 13.2k | if (!(pinfo->fd->visited)) { |
3793 | 13.2k | if (pinfo->num > conv->last_frame) { |
3794 | 12.4k | conv->last_frame = pinfo->num; |
3795 | 12.4k | } |
3796 | 13.2k | } |
3797 | 13.2k | } |
3798 | | |
3799 | 22.5k | ipv6d = get_ipv6_conversation_data(conv, pinfo); |
3800 | 22.5k | if(ipv6d) { |
3801 | 22.5k | iph->ip6_stream = ipv6d->stream; |
3802 | | |
3803 | 22.5k | ipv6_item = proto_tree_add_uint(ipv6_tree, hf_ipv6_stream, tvb, 0, 0, ipv6d->stream); |
3804 | 22.5k | proto_item_set_generated(ipv6_item); |
3805 | 22.5k | } |
3806 | 22.5k | } |
3807 | | |
3808 | | /* Fill in IP header fields for subdissectors */ |
3809 | 22.9k | iph->ip6_ver = 6; |
3810 | 22.9k | iph->ip6_tc = ip6_tcls; |
3811 | 22.9k | iph->ip6_flw = ip6_flow; |
3812 | 22.9k | iph->ip6_len = plen; |
3813 | 22.9k | iph->ip6_nxt = ip6_nxt; |
3814 | 22.9k | iph->ip6_hop = ip6_hlim; |
3815 | 22.9k | alloc_address_wmem_ipv6(pinfo->pool, &iph->ip6_src, ip6_src); |
3816 | 22.9k | alloc_address_wmem_ipv6(pinfo->pool, &iph->ip6_dst, ip6_dst); |
3817 | | |
3818 | | /* Shared state between IPv6 header and extensions. */ |
3819 | 22.9k | ipv6_pinfo_t *ipv6_pinfo = wmem_new0(pinfo->pool, ipv6_pinfo_t); |
3820 | 22.9k | ipv6_pinfo->ip6_plen = ip6_plen; |
3821 | 22.9k | ipv6_pinfo->jumbo_plen = jumbo_plen; |
3822 | 22.9k | ipv6_pinfo->frag_plen = ip6_plen; /* updated by extension header dissectors, if any */ |
3823 | 22.9k | if (!ipv6_exthdr_under_root) { |
3824 | 22.5k | ipv6_pinfo->ipv6_tree = ipv6_tree; |
3825 | 22.5k | ipv6_pinfo->ipv6_item_len = IPv6_HDR_SIZE; |
3826 | 22.5k | } |
3827 | 22.9k | p_add_proto_data(pinfo->pool, pinfo, proto_ipv6, IPV6_PROTO_PINFO, ipv6_pinfo); |
3828 | | |
3829 | | /* Adjust the length of this tvbuff to include only the IPv6 datagram. */ |
3830 | 22.9k | set_actual_length(tvb, IPv6_HDR_SIZE + plen); |
3831 | | /* Only export after adjusting the length */ |
3832 | 22.9k | export_pdu(tvb, pinfo); |
3833 | 22.9k | save_fragmented = pinfo->fragmented; |
3834 | | |
3835 | 22.9k | p_add_ipv6_nxt(pinfo, ip6_nxt); |
3836 | | |
3837 | 22.9k | next_tvb = tvb_new_subset_remaining(tvb, offset); |
3838 | 22.9k | TRY { |
3839 | 22.5k | ipv6_dissect_next(ip6_nxt, next_tvb, pinfo, tree, iph); |
3840 | 22.5k | } |
3841 | 22.9k | FINALLY { |
3842 | | /* If we need to extend the length due to an ext header and haven't |
3843 | | * yet, do so now. This might be due to an exception or unreassembled |
3844 | | * fragments. |
3845 | | * XXX: What about the tap? We want to tap if we haven't yet, but |
3846 | | * if we always tapped here we would send to the tap in reverse order |
3847 | | * for IP-in-IP. |
3848 | | */ |
3849 | 22.5k | if (ipv6_pinfo != NULL && ipv6_pinfo->ipv6_tree != NULL) { |
3850 | | /* Set IPv6 Header length */ |
3851 | 659 | proto_item_set_len(proto_tree_get_parent(ipv6_pinfo->ipv6_tree), ipv6_pinfo->ipv6_item_len); |
3852 | 659 | ipv6_pinfo->ipv6_tree = NULL; |
3853 | 659 | } |
3854 | 22.5k | } |
3855 | 22.9k | ENDTRY; |
3856 | | |
3857 | 22.9k | pinfo->fragmented = save_fragmented; |
3858 | 22.9k | return tvb_captured_length(tvb); |
3859 | 23.0k | } |
3860 | | |
3861 | | bool |
3862 | | dissect_ipv6_heur(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data) |
3863 | 10 | { |
3864 | 10 | int length, tot_length; |
3865 | 10 | uint8_t version; |
3866 | | |
3867 | | /* |
3868 | | * IPv6 Header Format |
3869 | | * |
3870 | | * 0 1 2 3 |
3871 | | * 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 |
3872 | | * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ |
3873 | | * |Version| Traffic Class | Flow Label | |
3874 | | * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ |
3875 | | * | Payload Length | Next Header | Hop Limit | |
3876 | | * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ |
3877 | | */ |
3878 | | |
3879 | 10 | length = tvb_captured_length(tvb); |
3880 | 10 | if (length < 8) { |
3881 | | /* Need at least 8 bytes to make a decision */ |
3882 | 5 | return false; |
3883 | 5 | } |
3884 | | |
3885 | | /* Check IPv6 version */ |
3886 | 5 | version = tvb_get_uint8(tvb, 0) >> 4; |
3887 | 5 | if (version != 6) { |
3888 | 4 | return false; |
3889 | 4 | } |
3890 | | |
3891 | | /* Payload Length is the length of the payload without the IPv6 header. */ |
3892 | 1 | tot_length = tvb_get_ntohs(tvb, 4); |
3893 | 1 | if ((tot_length + 40) != (int)tvb_reported_length(tvb)) { |
3894 | 1 | return false; |
3895 | 1 | } |
3896 | | |
3897 | 0 | dissect_ipv6(tvb, pinfo, tree, data); |
3898 | 0 | return true; |
3899 | 1 | } |
3900 | | |
3901 | | void |
3902 | | ipv6_dissect_next(unsigned nxt, tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, ws_ip6 *iph) |
3903 | 25.1k | { |
3904 | 25.1k | dissector_handle_t nxt_handle; |
3905 | 25.1k | ipv6_pinfo_t *ipv6_pinfo = p_get_ipv6_pinfo(pinfo); |
3906 | | |
3907 | | /* https://www.iana.org/assignments/ipv6-parameters/ipv6-parameters.xhtml#extension-header */ |
3908 | | |
3909 | 25.1k | switch (nxt) { |
3910 | 2.56k | case IP_PROTO_HOPOPT: |
3911 | 2.75k | case IP_PROTO_IPV6_ROUTE: |
3912 | 2.81k | case IP_PROTO_IPV6_FRAG: |
3913 | | //case IP_PROTO_ESP: Even though ESP is technically an extension header, |
3914 | | // we treat it as a payload container. |
3915 | 2.84k | case IP_PROTO_AH: |
3916 | 2.85k | case IP_PROTO_IPV6_OPTS: |
3917 | 2.96k | case IP_PROTO_MOBILITY_HEADER: |
3918 | | //case IP_PROTO_HIP: Even though HIP is technically an extension header, the only defined |
3919 | | // next header is IP_NONE. Also the HIP dissector is not ready for this. |
3920 | 3.02k | case IP_PROTO_SHIM6: |
3921 | 3.02k | nxt_handle = dissector_get_uint_handle(ip_dissector_table, nxt); |
3922 | 3.02k | break; |
3923 | 22.0k | default: |
3924 | 22.0k | nxt_handle = NULL; |
3925 | 22.0k | break; |
3926 | 25.1k | } |
3927 | 25.1k | if (nxt_handle != NULL) { |
3928 | 3.02k | call_dissector_with_data(nxt_handle, tvb, pinfo, tree, iph); |
3929 | 3.02k | return; |
3930 | 3.02k | } |
3931 | | |
3932 | | /* |
3933 | | * Done with extension header chain |
3934 | | */ |
3935 | | |
3936 | 22.0k | if (ipv6_pinfo != NULL && ipv6_pinfo->ipv6_tree != NULL) { |
3937 | | /* Set IPv6 Header length */ |
3938 | 21.8k | proto_item_set_len(proto_tree_get_parent(ipv6_pinfo->ipv6_tree), ipv6_pinfo->ipv6_item_len); |
3939 | 21.8k | ipv6_pinfo->ipv6_tree = NULL; |
3940 | 21.8k | } |
3941 | | |
3942 | 22.0k | if (iph != NULL && iph->ip6_ver == 6) { |
3943 | 21.8k | iph->ip6_nxt = nxt; /* upper-layer protocol more useful */ |
3944 | 21.8k | tap_queue_packet(ipv6_tap, pinfo, iph); |
3945 | 21.8k | } |
3946 | | |
3947 | 22.0k | if (nxt == IP_PROTO_IPV6_NONXT) { |
3948 | 30 | col_set_str(pinfo->cinfo, COL_INFO, "IPv6 no next header"); |
3949 | 30 | call_data_dissector(tvb, pinfo, tree); |
3950 | 30 | return; |
3951 | 30 | } |
3952 | | |
3953 | 22.0k | if (ip_try_dissect(try_heuristic_first, nxt, tvb, pinfo, tree, iph)) { |
3954 | 16.3k | return; |
3955 | 16.3k | } |
3956 | | |
3957 | | /* Unknown protocol. */ |
3958 | 5.71k | col_add_fstr(pinfo->cinfo, COL_INFO, "Unknown IP Protocol: %s (%u)", ipprotostr(nxt), nxt); |
3959 | 5.71k | call_data_dissector(tvb, pinfo, tree); |
3960 | 5.71k | } |
3961 | | |
3962 | | static void |
3963 | | ipv6_init(void) |
3964 | 14 | { |
3965 | 14 | ipv6_stream_count = 0; |
3966 | 14 | } |
3967 | | |
3968 | | void |
3969 | | proto_register_ipv6(void) |
3970 | 14 | { |
3971 | 14 | static hf_register_info hf_ipv6[] = { |
3972 | 14 | { &hf_ipv6_version, |
3973 | 14 | { "Version", "ipv6.version", |
3974 | 14 | FT_UINT8, BASE_DEC, NULL, 0x00, |
3975 | 14 | NULL, HFILL } |
3976 | 14 | }, |
3977 | 14 | { &hf_ip_version, |
3978 | 14 | { "Version", "ip.version", |
3979 | 14 | FT_UINT8, BASE_DEC, NULL, 0xF0, |
3980 | 14 | NULL, HFILL } |
3981 | 14 | }, |
3982 | 14 | { &hf_ipv6_tclass, |
3983 | 14 | { "Traffic Class", "ipv6.tclass", |
3984 | 14 | FT_UINT32, BASE_HEX, NULL, 0x0FF00000, |
3985 | 14 | NULL, HFILL } |
3986 | 14 | }, |
3987 | 14 | { &hf_ipv6_tclass_dscp, |
3988 | 14 | { "Differentiated Services Codepoint", "ipv6.tclass.dscp", |
3989 | 14 | FT_UINT32, BASE_DEC | BASE_EXT_STRING, &dscp_vals_ext, 0x0FC00000, |
3990 | 14 | NULL, HFILL } |
3991 | 14 | }, |
3992 | 14 | { &hf_ipv6_tclass_ecn, |
3993 | 14 | { "Explicit Congestion Notification", "ipv6.tclass.ecn", |
3994 | 14 | FT_UINT32, BASE_DEC | BASE_EXT_STRING, &ecn_vals_ext, 0x00300000, |
3995 | 14 | NULL, HFILL } |
3996 | 14 | }, |
3997 | 14 | { &hf_ipv6_flow, |
3998 | 14 | { "Flow Label", "ipv6.flow", |
3999 | 14 | FT_UINT24, BASE_HEX, NULL, 0x0FFFFF, |
4000 | 14 | NULL, HFILL } |
4001 | 14 | }, |
4002 | 14 | { &hf_ipv6_plen, |
4003 | 14 | { "Payload Length", "ipv6.plen", |
4004 | 14 | FT_UINT16, BASE_DEC, NULL, 0x0, |
4005 | 14 | NULL, HFILL } |
4006 | 14 | }, |
4007 | 14 | { &hf_ipv6_nxt, |
4008 | 14 | { "Next Header", "ipv6.nxt", |
4009 | 14 | FT_UINT8, BASE_DEC | BASE_EXT_STRING, &ipproto_val_ext, 0x0, |
4010 | 14 | NULL, HFILL } |
4011 | 14 | }, |
4012 | 14 | { &hf_ipv6_hlim, |
4013 | 14 | { "Hop Limit", "ipv6.hlim", |
4014 | 14 | FT_UINT8, BASE_DEC, NULL, 0x0, |
4015 | 14 | NULL, HFILL } |
4016 | 14 | }, |
4017 | 14 | { &hf_ipv6_src, |
4018 | 14 | { "Source Address", "ipv6.src", |
4019 | 14 | FT_IPv6, BASE_NONE, NULL, 0x0, |
4020 | 14 | "Source IPv6 Address", HFILL } |
4021 | 14 | }, |
4022 | 14 | { &hf_ipv6_src_addr_space, |
4023 | 14 | { "Address Space", "ipv6.src_addr_space", |
4024 | 14 | FT_STRING, BASE_NONE, NULL, 0x0, |
4025 | 14 | "Source IPv6 Address Space", HFILL } |
4026 | 14 | }, |
4027 | 14 | { &hf_ipv6_src_multicast_flags, |
4028 | 14 | { "Multicast Flags", "ipv6.src_multicast_flags", |
4029 | 14 | FT_UINT16, BASE_HEX, NULL, 0x00F0, |
4030 | 14 | "Source Address Multicast Flags", HFILL } |
4031 | 14 | }, |
4032 | 14 | { &hf_ipv6_src_multicast_flags_transient, |
4033 | 14 | { "Transient", "ipv6.src_multicast_flags.transient", |
4034 | 14 | FT_BOOLEAN, 16, NULL, 0x0010, |
4035 | 14 | "Source Address Transient Multicast Flag", HFILL } |
4036 | 14 | }, |
4037 | 14 | { &hf_ipv6_src_multicast_flags_network_prefix, |
4038 | 14 | { "Network Prefix", "ipv6.src_multicast_flags.network_prefix", |
4039 | 14 | FT_BOOLEAN, 16, NULL, 0x0020, |
4040 | 14 | "Source Address Network Prefix Multicast Flag", HFILL } |
4041 | 14 | }, |
4042 | 14 | { &hf_ipv6_src_multicast_flags_embed_rp, |
4043 | 14 | { "Rendezvous Point (RP)", "ipv6.src_multicast_flags.embed_rp", |
4044 | 14 | FT_BOOLEAN, 16, NULL, 0x0040, |
4045 | 14 | "Source Address Rendezvous Point (RP) Multicast Flag", HFILL } |
4046 | 14 | }, |
4047 | 14 | { &hf_ipv6_src_multicast_flags_reserved, |
4048 | 14 | { "Reserved", "ipv6.src_multicast_flags.reserved", |
4049 | 14 | FT_UINT16, BASE_DEC, NULL, 0x0080, |
4050 | 14 | "Source Address Reserved Multicast Flag", HFILL } |
4051 | 14 | }, |
4052 | 14 | { &hf_ipv6_src_multicast_scope, |
4053 | 14 | { "Multicast Scope", "ipv6.src_multicast_scope", |
4054 | 14 | FT_UINT16, BASE_HEX, VALS(ipv6_multicast_scope_vals), 0x000F, |
4055 | 14 | "Source Address Multicast Scope", HFILL } |
4056 | 14 | }, |
4057 | 14 | { &hf_ipv6_src_special_purpose, |
4058 | 14 | { "Special-Purpose Allocation", "ipv6.src_special_purpose", |
4059 | 14 | FT_STRING, BASE_NONE, NULL, 0x0, |
4060 | 14 | "Source Address Special-Purpose Allocation", HFILL } |
4061 | 14 | }, |
4062 | 14 | { &hf_ipv6_src_special_purpose_source, |
4063 | 14 | { "Source", "ipv6.src_special_purpose_source", |
4064 | 14 | FT_BOOLEAN, BASE_NONE, NULL, 0x0, |
4065 | 14 | "Whether an address from the allocated special-purpose address " |
4066 | 14 | "block is valid when used as the source address of an IP datagram", HFILL } |
4067 | 14 | }, |
4068 | 14 | { &hf_ipv6_src_special_purpose_destination, |
4069 | 14 | { "Destination", "ipv6.src_special_purpose_destination", |
4070 | 14 | FT_BOOLEAN, BASE_NONE, NULL, 0x0, |
4071 | 14 | "Whether an address from the allocated special-purpose address " |
4072 | 14 | "block is valid when used as the destination address of an IP datagram", HFILL } |
4073 | 14 | }, |
4074 | 14 | { &hf_ipv6_src_special_purpose_forwardable, |
4075 | 14 | { "Forwardable", "ipv6.src_special_purpose_forwardable", |
4076 | 14 | FT_BOOLEAN, BASE_NONE, NULL, 0x0, |
4077 | 14 | "Whether a router may forward an IP datagram whose destination " |
4078 | 14 | "address is drawn from the allocated special-purpose address block", HFILL } |
4079 | 14 | }, |
4080 | 14 | { &hf_ipv6_src_special_purpose_global, |
4081 | 14 | { "Globally Reachable", "ipv6.src_special_purpose_global", |
4082 | 14 | FT_BOOLEAN, BASE_NONE, NULL, 0x0, |
4083 | 14 | "Whether an IP datagram whose destination address is drawn " |
4084 | 14 | "from the allocated special-purpose address block is " |
4085 | 14 | "forwardable beyond a specified administrative domain", HFILL } |
4086 | 14 | }, |
4087 | 14 | { &hf_ipv6_src_special_purpose_reserved, |
4088 | 14 | { "Reserved-by-Protocol", "ipv6.src_special_purpose_reserved", |
4089 | 14 | FT_BOOLEAN, BASE_NONE, NULL, 0x0, |
4090 | 14 | "Whether the special-purpose address block is reserved by IP itself", HFILL } |
4091 | 14 | }, |
4092 | 14 | { &hf_ipv6_src_host, |
4093 | 14 | { "Source Host", "ipv6.src_host", |
4094 | 14 | FT_STRING, BASE_NONE, NULL, 0x0, |
4095 | 14 | "Source IPv6 Host", HFILL } |
4096 | 14 | }, |
4097 | 14 | { &hf_ipv6_src_slaac_mac, |
4098 | 14 | { "Source SLAAC MAC", "ipv6.src_slaac_mac", |
4099 | 14 | FT_ETHER, BASE_NONE, NULL, 0x0, |
4100 | 14 | "Source IPv6 Stateless Address Autoconfiguration (SLAAC) 48-bit MAC Identifier", HFILL } |
4101 | 14 | }, |
4102 | 14 | { &hf_ipv6_src_isatap_ipv4, |
4103 | 14 | { "Source ISATAP IPv4", "ipv6.src_isatap_ipv4", |
4104 | 14 | FT_IPv4, BASE_NONE, NULL, 0x0, |
4105 | 14 | "Source IPv6 ISATAP Encapsulated IPv4 Address", HFILL } |
4106 | 14 | }, |
4107 | 14 | { &hf_ipv6_src_6to4_gateway_ipv4, |
4108 | 14 | { "Source 6to4 Gateway IPv4", "ipv6.src_6to4_gw_ipv4", |
4109 | 14 | FT_IPv4, BASE_NONE, NULL, 0x0, |
4110 | 14 | "Source IPv6 6to4 Gateway IPv4 Address", HFILL } |
4111 | 14 | }, |
4112 | 14 | { &hf_ipv6_src_6to4_sla_id, |
4113 | 14 | { "Source 6to4 SLA ID", "ipv6.src_6to4_sla_id", |
4114 | 14 | FT_UINT16, BASE_DEC, NULL, 0x0, |
4115 | 14 | "Source IPv6 6to4 SLA ID", HFILL } |
4116 | 14 | }, |
4117 | 14 | { &hf_ipv6_src_teredo_server_ipv4, |
4118 | 14 | { "Source Teredo Server IPv4", "ipv6.src_ts_ipv4", |
4119 | 14 | FT_IPv4, BASE_NONE, NULL, 0x0, |
4120 | 14 | "Source IPv6 Teredo Server Encapsulated IPv4 Address", HFILL } |
4121 | 14 | }, |
4122 | 14 | { &hf_ipv6_src_teredo_port, |
4123 | 14 | { "Source Teredo Port", "ipv6.src_tc_port", |
4124 | 14 | FT_UINT16, BASE_DEC, NULL, 0x0, |
4125 | 14 | "Source IPv6 Teredo Client Mapped Port", HFILL } |
4126 | 14 | }, |
4127 | 14 | { &hf_ipv6_src_teredo_client_ipv4, |
4128 | 14 | { "Source Teredo Client IPv4", "ipv6.src_tc_ipv4", |
4129 | 14 | FT_IPv4, BASE_NONE, NULL, 0x0, |
4130 | 14 | "Source IPv6 Teredo Client Encapsulated IPv4 Address", HFILL } |
4131 | 14 | }, |
4132 | 14 | { &hf_ipv6_src_embed_ipv4, |
4133 | 14 | { "Source Embedded IPv4", "ipv6.src_embed_ipv4", |
4134 | 14 | FT_IPv4, BASE_NONE, NULL, 0x0, |
4135 | 14 | "Source IPv4-Embedded IPv6 Address", HFILL } |
4136 | 14 | }, |
4137 | 14 | { &hf_ipv6_dst, |
4138 | 14 | { "Destination Address", "ipv6.dst", |
4139 | 14 | FT_IPv6, BASE_NONE, NULL, 0x0, |
4140 | 14 | "Destination IPv6 Address", HFILL } |
4141 | 14 | }, |
4142 | 14 | { &hf_ipv6_dst_addr_space, |
4143 | 14 | { "Address Space", "ipv6.dst_addr_space", |
4144 | 14 | FT_STRING, BASE_NONE, NULL, 0x0, |
4145 | 14 | "Destination IPv6 Address Space", HFILL } |
4146 | 14 | }, |
4147 | 14 | { &hf_ipv6_dst_multicast_flags, |
4148 | 14 | { "Multicast Flags", "ipv6.dst_multicast_flags", |
4149 | 14 | FT_UINT16, BASE_HEX, NULL, 0x00F0, |
4150 | 14 | "Destination Address Multicast Flags", HFILL } |
4151 | 14 | }, |
4152 | 14 | { &hf_ipv6_dst_multicast_flags_transient, |
4153 | 14 | { "Transient", "ipv6.dst_multicast_flags.transient", |
4154 | 14 | FT_BOOLEAN, 16, NULL, 0x0010, |
4155 | 14 | "Destination Address Transient Multicast Flag", HFILL } |
4156 | 14 | }, |
4157 | 14 | { &hf_ipv6_dst_multicast_flags_network_prefix, |
4158 | 14 | { "Network Prefix", "ipv6.dst_multicast_flags.network_prefix", |
4159 | 14 | FT_BOOLEAN, 16, NULL, 0x0020, |
4160 | 14 | "Destination Address Network Prefix Multicast Flag", HFILL } |
4161 | 14 | }, |
4162 | 14 | { &hf_ipv6_dst_multicast_flags_embed_rp, |
4163 | 14 | { "Rendezvous Point (RP)", "ipv6.dst_multicast_flags.embed_rp", |
4164 | 14 | FT_BOOLEAN, 16, NULL, 0x0040, |
4165 | 14 | "Destination Address Rendezvous Point (RP) Multicast Flag", HFILL } |
4166 | 14 | }, |
4167 | 14 | { &hf_ipv6_dst_multicast_flags_reserved, |
4168 | 14 | { "Reserved", "ipv6.dst_multicast_flags.reserved", |
4169 | 14 | FT_UINT16, BASE_DEC, NULL, 0x0080, |
4170 | 14 | "Destination Address Reserved Multicast Flag", HFILL } |
4171 | 14 | }, |
4172 | 14 | { &hf_ipv6_dst_multicast_scope, |
4173 | 14 | { "Multicast Scope", "ipv6.dst_multicast_scope", |
4174 | 14 | FT_UINT16, BASE_HEX, VALS(ipv6_multicast_scope_vals), 0x000F, |
4175 | 14 | "Destination Address Multicast Scope", HFILL } |
4176 | 14 | }, |
4177 | 14 | { &hf_ipv6_dst_special_purpose, |
4178 | 14 | { "Special-Purpose Allocation", "ipv6.dst_special_purpose", |
4179 | 14 | FT_STRING, BASE_NONE, NULL, 0x0, |
4180 | 14 | "Destination Address Special-Purpose Allocation", HFILL } |
4181 | 14 | }, |
4182 | 14 | { &hf_ipv6_dst_special_purpose_source, |
4183 | 14 | { "Source", "ipv6.dst_special_purpose_source", |
4184 | 14 | FT_BOOLEAN, BASE_NONE, NULL, 0x0, |
4185 | 14 | "Whether an address from the allocated special-purpose address " |
4186 | 14 | "block is valid when used as the source address of an IP datagram", HFILL } |
4187 | 14 | }, |
4188 | 14 | { &hf_ipv6_dst_special_purpose_destination, |
4189 | 14 | { "Destination", "ipv6.dst_special_purpose_destination", |
4190 | 14 | FT_BOOLEAN, BASE_NONE, NULL, 0x0, |
4191 | 14 | "Whether an address from the allocated special-purpose address " |
4192 | 14 | "block is valid when used as the destination address of an IP datagram", HFILL } |
4193 | 14 | }, |
4194 | 14 | { &hf_ipv6_dst_special_purpose_forwardable, |
4195 | 14 | { "Forwardable", "ipv6.dst_special_purpose_forwardable", |
4196 | 14 | FT_BOOLEAN, BASE_NONE, NULL, 0x0, |
4197 | 14 | "Whether a router may forward an IP datagram whose destination " |
4198 | 14 | "address is drawn from the allocated special-purpose address block", HFILL } |
4199 | 14 | }, |
4200 | 14 | { &hf_ipv6_dst_special_purpose_global, |
4201 | 14 | { "Globally Reachable", "ipv6.dst_special_purpose_global", |
4202 | 14 | FT_BOOLEAN, BASE_NONE, NULL, 0x0, |
4203 | 14 | "Whether an IP datagram whose destination address is drawn " |
4204 | 14 | "from the allocated special-purpose address block is " |
4205 | 14 | "forwardable beyond a specified administrative domain", HFILL } |
4206 | 14 | }, |
4207 | 14 | { &hf_ipv6_dst_special_purpose_reserved, |
4208 | 14 | { "Reserved-by-Protocol", "ipv6.dst_special_purpose_reserved", |
4209 | 14 | FT_BOOLEAN, BASE_NONE, NULL, 0x0, |
4210 | 14 | "Whether the special-purpose address block is reserved by IP itself", HFILL } |
4211 | 14 | }, |
4212 | 14 | { &hf_ipv6_dst_host, |
4213 | 14 | { "Destination Host", "ipv6.dst_host", |
4214 | 14 | FT_STRING, BASE_NONE, NULL, 0x0, |
4215 | 14 | "Destination IPv6 Host", HFILL } |
4216 | 14 | }, |
4217 | 14 | { &hf_ipv6_dst_slaac_mac, |
4218 | 14 | { "Destination SLAAC MAC", "ipv6.dst_slaac_mac", |
4219 | 14 | FT_ETHER, BASE_NONE, NULL, 0x0, |
4220 | 14 | "Destination IPv6 Stateless Address Autoconfiguration (SLAAC) 48-bit MAC Identifier", HFILL } |
4221 | 14 | }, |
4222 | 14 | { &hf_ipv6_dst_isatap_ipv4, |
4223 | 14 | { "Destination ISATAP IPv4", "ipv6.dst_isatap_ipv4", |
4224 | 14 | FT_IPv4, BASE_NONE, NULL, 0x0, |
4225 | 14 | "Destination IPv6 ISATAP Encapsulated IPv4 Address", HFILL } |
4226 | 14 | }, |
4227 | 14 | { &hf_ipv6_dst_6to4_gateway_ipv4, |
4228 | 14 | { "Destination 6to4 Gateway IPv4", "ipv6.dst_6to4_gw_ipv4", |
4229 | 14 | FT_IPv4, BASE_NONE, NULL, 0x0, |
4230 | 14 | "Destination IPv6 6to4 Gateway IPv4 Address", HFILL } |
4231 | 14 | }, |
4232 | 14 | { &hf_ipv6_dst_6to4_sla_id, |
4233 | 14 | { "Destination 6to4 SLA ID", "ipv6.dst_6to4_sla_id", |
4234 | 14 | FT_UINT16, BASE_DEC, NULL, 0x0, |
4235 | 14 | "Destination IPv6 6to4 SLA ID", HFILL } |
4236 | 14 | }, |
4237 | 14 | { &hf_ipv6_dst_teredo_server_ipv4, |
4238 | 14 | { "Destination Teredo Server IPv4", "ipv6.dst_ts_ipv4", |
4239 | 14 | FT_IPv4, BASE_NONE, NULL, 0x0, |
4240 | 14 | "Destination IPv6 Teredo Server Encapsulated IPv4 Address", HFILL } |
4241 | 14 | }, |
4242 | 14 | { &hf_ipv6_dst_teredo_port, |
4243 | 14 | { "Destination Teredo Port", "ipv6.dst_tc_port", |
4244 | 14 | FT_UINT16, BASE_DEC, NULL, 0x0, |
4245 | 14 | "Destination IPv6 Teredo Client Mapped Port", HFILL } |
4246 | 14 | }, |
4247 | 14 | { &hf_ipv6_dst_teredo_client_ipv4, |
4248 | 14 | { "Destination Teredo Client IPv4", "ipv6.dst_tc_ipv4", |
4249 | 14 | FT_IPv4, BASE_NONE, NULL, 0x0, |
4250 | 14 | "Destination IPv6 Teredo Client Encapsulated IPv4 Address", HFILL } |
4251 | 14 | }, |
4252 | 14 | { &hf_ipv6_dst_embed_ipv4, |
4253 | 14 | { "Destination Embedded IPv4", "ipv6.dst_embed_ipv4", |
4254 | 14 | FT_IPv4, BASE_NONE, NULL, 0x0, |
4255 | 14 | "Destination IPv4-Embedded IPv6 Address", HFILL } |
4256 | 14 | }, |
4257 | 14 | { &hf_ipv6_addr, |
4258 | 14 | { "Source or Destination Address", "ipv6.addr", |
4259 | 14 | FT_IPv6, BASE_NONE, NULL, 0x0, |
4260 | 14 | NULL, HFILL } |
4261 | 14 | }, |
4262 | 14 | { &hf_ipv6_addr_space, |
4263 | 14 | { "Address Space", "ipv6.addr_space", |
4264 | 14 | FT_STRING, BASE_NONE, NULL, 0x0, |
4265 | 14 | "Source or Destination Address Space", HFILL } |
4266 | 14 | }, |
4267 | 14 | { &hf_ipv6_multicast_flags, |
4268 | 14 | { "Multicast Flags", "ipv6.multicast_flags", |
4269 | 14 | FT_UINT16, BASE_HEX, NULL, 0x00F0, |
4270 | 14 | "Source or Destination Address Multicast Flags", HFILL } |
4271 | 14 | }, |
4272 | 14 | { &hf_ipv6_multicast_flags_transient, |
4273 | 14 | { "Transient", "ipv6.multicast_flags.transient", |
4274 | 14 | FT_BOOLEAN, 16, NULL, 0x0010, |
4275 | 14 | "Source or Destination Address Transient Multicast Flag", HFILL } |
4276 | 14 | }, |
4277 | 14 | { &hf_ipv6_multicast_flags_network_prefix, |
4278 | 14 | { "Network Prefix", "ipv6.multicast_flags.network_prefix", |
4279 | 14 | FT_BOOLEAN, 16, NULL, 0x0020, |
4280 | 14 | "Source or Destination Address Network Prefix Multicast Flag", HFILL } |
4281 | 14 | }, |
4282 | 14 | { &hf_ipv6_multicast_flags_embed_rp, |
4283 | 14 | { "Rendezvous Point (RP)", "ipv6.multicast_flags.embed_rp", |
4284 | 14 | FT_BOOLEAN, 16, NULL, 0x0040, |
4285 | 14 | "Source or Destination Address Rendezvous Point (RP) Multicast Flag", HFILL } |
4286 | 14 | }, |
4287 | 14 | { &hf_ipv6_multicast_flags_reserved, |
4288 | 14 | { "Reserved", "ipv6.multicast_flags.reserved", |
4289 | 14 | FT_UINT16, BASE_DEC, NULL, 0x0080, |
4290 | 14 | "Source or Destination Address Reserved Multicast Flag", HFILL } |
4291 | 14 | }, |
4292 | 14 | { &hf_ipv6_multicast_scope, |
4293 | 14 | { "Multicast Scope", "ipv6.multicast_scope", |
4294 | 14 | FT_UINT16, BASE_HEX, VALS(ipv6_multicast_scope_vals), 0x000F, |
4295 | 14 | "Source or Destination Address Multicast Scope", HFILL } |
4296 | 14 | }, |
4297 | 14 | { &hf_ipv6_addr_special_purpose, |
4298 | 14 | { "Special-Purpose Allocation", "ipv6.addr_special_purpose", |
4299 | 14 | FT_STRING, BASE_NONE, NULL, 0x0, |
4300 | 14 | "Source or Destination Address Special-Purpose Allocation", HFILL } |
4301 | 14 | }, |
4302 | 14 | { &hf_ipv6_addr_special_purpose_source, |
4303 | 14 | { "Source", "ipv6.addr_special_purpose_source", |
4304 | 14 | FT_BOOLEAN, BASE_NONE, NULL, 0x0, |
4305 | 14 | "Whether an address from the allocated special-purpose address " |
4306 | 14 | "block is valid when used as the source address of an IP datagram", HFILL } |
4307 | 14 | }, |
4308 | 14 | { &hf_ipv6_addr_special_purpose_destination, |
4309 | 14 | { "Destination", "ipv6.addr_special_purpose_destination", |
4310 | 14 | FT_BOOLEAN, BASE_NONE, NULL, 0x0, |
4311 | 14 | "Whether an address from the allocated special-purpose address " |
4312 | 14 | "block is valid when used as the destination address of an IP datagram", HFILL } |
4313 | 14 | }, |
4314 | 14 | { &hf_ipv6_addr_special_purpose_forwardable, |
4315 | 14 | { "Forwardable", "ipv6.addr_special_purpose_forwardable", |
4316 | 14 | FT_BOOLEAN, BASE_NONE, NULL, 0x0, |
4317 | 14 | "Whether a router may forward an IP datagram whose destination " |
4318 | 14 | "address is drawn from the allocated special-purpose address block", HFILL } |
4319 | 14 | }, |
4320 | 14 | { &hf_ipv6_addr_special_purpose_global, |
4321 | 14 | { "Globally Reachable", "ipv6.addr_special_purpose_global", |
4322 | 14 | FT_BOOLEAN, BASE_NONE, NULL, 0x0, |
4323 | 14 | "Whether an IP datagram whose destination address is drawn " |
4324 | 14 | "from the allocated special-purpose address block is " |
4325 | 14 | "forwardable beyond a specified administrative domain", HFILL } |
4326 | 14 | }, |
4327 | 14 | { &hf_ipv6_addr_special_purpose_reserved, |
4328 | 14 | { "Reserved-by-Protocol", "ipv6.addr_special_purpose_reserved", |
4329 | 14 | FT_BOOLEAN, BASE_NONE, NULL, 0x0, |
4330 | 14 | "Whether the special-purpose address block is reserved by IP itself", HFILL } |
4331 | 14 | }, |
4332 | 14 | { &hf_ipv6_host, |
4333 | 14 | { "Source or Destination Host", "ipv6.host", |
4334 | 14 | FT_STRING, BASE_NONE, NULL, 0x0, |
4335 | 14 | NULL, HFILL } |
4336 | 14 | }, |
4337 | 14 | { &hf_ipv6_slaac_mac, |
4338 | 14 | { "SLAAC MAC", "ipv6.slaac_mac", |
4339 | 14 | FT_ETHER, BASE_NONE, NULL, 0x0, |
4340 | 14 | "IPv6 Stateless Address Autoconfiguration (SLAAC) 48-bit MAC Identifier", HFILL } |
4341 | 14 | }, |
4342 | 14 | { &hf_ipv6_isatap_ipv4, |
4343 | 14 | { "ISATAP IPv4", "ipv6.isatap_ipv4", |
4344 | 14 | FT_IPv4, BASE_NONE, NULL, 0x0, |
4345 | 14 | "IPv6 ISATAP Encapsulated IPv4 Address", HFILL } |
4346 | 14 | }, |
4347 | 14 | { &hf_ipv6_6to4_gateway_ipv4, |
4348 | 14 | { "6to4 Gateway IPv4", "ipv6.6to4_gw_ipv4", |
4349 | 14 | FT_IPv4, BASE_NONE, NULL, 0x0, |
4350 | 14 | "IPv6 6to4 Gateway IPv4 Address", HFILL } |
4351 | 14 | }, |
4352 | 14 | { &hf_ipv6_6to4_sla_id, |
4353 | 14 | { "6to4 SLA ID", "ipv6.6to4_sla_id", |
4354 | 14 | FT_UINT16, BASE_DEC, NULL, 0x0, |
4355 | 14 | "IPv6 6to4 SLA ID", HFILL } |
4356 | 14 | }, |
4357 | 14 | { &hf_ipv6_teredo_server_ipv4, |
4358 | 14 | { "Teredo Server IPv4", "ipv6.ts_ipv4", |
4359 | 14 | FT_IPv4, BASE_NONE, NULL, 0x0, |
4360 | 14 | "IPv6 Teredo Server Encapsulated IPv4 Address", HFILL } |
4361 | 14 | }, |
4362 | 14 | { &hf_ipv6_teredo_port, |
4363 | 14 | { "Teredo Port", "ipv6.tc_port", |
4364 | 14 | FT_UINT16, BASE_DEC, NULL, 0x0, |
4365 | 14 | "IPv6 Teredo Client Mapped Port", HFILL } |
4366 | 14 | }, |
4367 | 14 | { &hf_ipv6_teredo_client_ipv4, |
4368 | 14 | { "Teredo Client IPv4", "ipv6.tc_ipv4", |
4369 | 14 | FT_IPv4, BASE_NONE, NULL, 0x0, |
4370 | 14 | "IPv6 Teredo Client Encapsulated IPv4 Address", HFILL } |
4371 | 14 | }, |
4372 | 14 | { &hf_ipv6_embed_ipv4_prefix, |
4373 | 14 | { "Embedded IPv4 Prefix", "ipv6.embed_ipv4_prefix", |
4374 | 14 | FT_BYTES, BASE_NONE, NULL, 0x0, |
4375 | 14 | "IPv4-Embedded IPv6 Address Prefix", HFILL } |
4376 | 14 | }, |
4377 | 14 | { &hf_ipv6_embed_ipv4, |
4378 | 14 | { "Embedded IPv4", "ipv6.embed_ipv4", |
4379 | 14 | FT_IPv4, BASE_NONE, NULL, 0x0, |
4380 | 14 | "IPv4-Embedded IPv6 Address", HFILL } |
4381 | 14 | }, |
4382 | 14 | { &hf_ipv6_embed_ipv4_u, |
4383 | 14 | { "Embedded IPv4 u field", "ipv6.embed_ipv4_u", |
4384 | 14 | FT_BYTES, BASE_NONE, NULL, 0x0, |
4385 | 14 | "IPv4-Embedded IPv6 Address u field", HFILL } |
4386 | 14 | }, |
4387 | 14 | { &hf_ipv6_embed_ipv4_suffix, |
4388 | 14 | { "Embedded IPv4 Suffix", "ipv6.embed_ipv4_suffix", |
4389 | 14 | FT_BYTES, BASE_NONE, NULL, 0x0, |
4390 | 14 | "IPv4-Embedded IPv6 Address Suffix", HFILL } |
4391 | 14 | }, |
4392 | | |
4393 | 14 | { &hf_ipv6_stream, |
4394 | 14 | { "Stream index", "ipv6.stream", |
4395 | 14 | FT_UINT32, BASE_DEC, NULL, 0x0, |
4396 | 14 | NULL, HFILL } |
4397 | 14 | }, |
4398 | | |
4399 | 14 | { &hf_geoip_country, |
4400 | 14 | { "Source or Destination GeoIP Country", "ipv6.geoip.country", |
4401 | 14 | FT_STRING, BASE_NONE, NULL, 0x0, |
4402 | 14 | NULL, HFILL } |
4403 | 14 | }, |
4404 | 14 | { &hf_geoip_country_iso, |
4405 | 14 | { "Source or Destination GeoIP ISO Two Letter Country Code", "ipv6.geoip.country_iso", |
4406 | 14 | FT_STRING, BASE_NONE, NULL, 0x0, |
4407 | 14 | NULL, HFILL } |
4408 | 14 | }, |
4409 | 14 | { &hf_geoip_city, |
4410 | 14 | { "Source or Destination GeoIP City", "ipv6.geoip.city", |
4411 | 14 | FT_STRING, BASE_NONE, NULL, 0x0, |
4412 | 14 | NULL, HFILL } |
4413 | 14 | }, |
4414 | 14 | { &hf_geoip_as_number, |
4415 | 14 | { "Source or Destination GeoIP AS Number", "ipv6.geoip.asnum", |
4416 | 14 | FT_UINT32, BASE_DEC, NULL, 0x0, |
4417 | 14 | NULL, HFILL } |
4418 | 14 | }, |
4419 | 14 | { &hf_geoip_as_org, |
4420 | 14 | { "Source or Destination GeoIP AS Organization", "ipv6.geoip.org", |
4421 | 14 | FT_STRING, BASE_NONE, NULL, 0x0, |
4422 | 14 | NULL, HFILL } |
4423 | 14 | }, |
4424 | 14 | { &hf_geoip_latitude, |
4425 | 14 | { "Source or Destination GeoIP Latitude", "ipv6.geoip.lat", |
4426 | 14 | FT_DOUBLE, BASE_NONE, NULL, 0x0, |
4427 | 14 | NULL, HFILL } |
4428 | 14 | }, |
4429 | 14 | { &hf_geoip_longitude, |
4430 | 14 | { "Source or Destination GeoIP Longitude", "ipv6.geoip.lon", |
4431 | 14 | FT_DOUBLE, BASE_NONE, NULL, 0x0, |
4432 | 14 | NULL, HFILL } |
4433 | 14 | }, |
4434 | 14 | { &hf_geoip_src_summary, |
4435 | 14 | { "Source GeoIP", "ipv6.geoip.src_summary", |
4436 | 14 | FT_STRING, BASE_NONE, NULL, 0x0, |
4437 | 14 | NULL, HFILL } |
4438 | 14 | }, |
4439 | 14 | { &hf_geoip_src_country, |
4440 | 14 | { "Source GeoIP Country", "ipv6.geoip.src_country", |
4441 | 14 | FT_STRING, BASE_NONE, NULL, 0x0, |
4442 | 14 | NULL, HFILL } |
4443 | 14 | }, |
4444 | 14 | { &hf_geoip_src_country_iso, |
4445 | 14 | { "Source GeoIP ISO Two Letter Country Code", "ipv6.geoip.src_country_iso", |
4446 | 14 | FT_STRING, BASE_NONE, NULL, 0x0, |
4447 | 14 | NULL, HFILL } |
4448 | 14 | }, |
4449 | 14 | { &hf_geoip_src_city, |
4450 | 14 | { "Source GeoIP City", "ipv6.geoip.src_city", |
4451 | 14 | FT_STRING, BASE_NONE, NULL, 0x0, |
4452 | 14 | NULL, HFILL } |
4453 | 14 | }, |
4454 | 14 | { &hf_geoip_src_as_number, |
4455 | 14 | { "Source GeoIP AS Number", "ipv6.geoip.src_asnum", |
4456 | 14 | FT_UINT32, BASE_DEC, NULL, 0x0, |
4457 | 14 | NULL, HFILL } |
4458 | 14 | }, |
4459 | 14 | { &hf_geoip_src_as_org, |
4460 | 14 | { "Source GeoIP AS Organization", "ipv6.geoip.src_org", |
4461 | 14 | FT_STRING, BASE_NONE, NULL, 0x0, |
4462 | 14 | NULL, HFILL } |
4463 | 14 | }, |
4464 | 14 | { &hf_geoip_src_latitude, |
4465 | 14 | { "Source GeoIP Latitude", "ipv6.geoip.src_lat", |
4466 | 14 | FT_DOUBLE, BASE_NONE, NULL, 0x0, |
4467 | 14 | NULL, HFILL } |
4468 | 14 | }, |
4469 | 14 | { &hf_geoip_src_longitude, |
4470 | 14 | { "Source GeoIP Longitude", "ipv6.geoip.src_lon", |
4471 | 14 | FT_DOUBLE, BASE_NONE, NULL, 0x0, |
4472 | 14 | NULL, HFILL } |
4473 | 14 | }, |
4474 | 14 | { &hf_geoip_dst_summary, |
4475 | 14 | { "Destination GeoIP", "ipv6.geoip.dst_summary", |
4476 | 14 | FT_STRING, BASE_NONE, NULL, 0x0, |
4477 | 14 | NULL, HFILL } |
4478 | 14 | }, |
4479 | 14 | { &hf_geoip_dst_country, |
4480 | 14 | { "Destination GeoIP Country", "ipv6.geoip.dst_country", |
4481 | 14 | FT_STRING, BASE_NONE, NULL, 0x0, |
4482 | 14 | NULL, HFILL } |
4483 | 14 | }, |
4484 | 14 | { &hf_geoip_dst_country_iso, |
4485 | 14 | { "Destination GeoIP ISO Two Letter Country Code", "ipv6.geoip.dst_country_iso", |
4486 | 14 | FT_STRING, BASE_NONE, NULL, 0x0, |
4487 | 14 | NULL, HFILL } |
4488 | 14 | }, |
4489 | 14 | { &hf_geoip_dst_city, |
4490 | 14 | { "Destination GeoIP City", "ipv6.geoip.dst_city", |
4491 | 14 | FT_STRING, BASE_NONE, NULL, 0x0, |
4492 | 14 | NULL, HFILL } |
4493 | 14 | }, |
4494 | 14 | { &hf_geoip_dst_as_number, |
4495 | 14 | { "Destination GeoIP AS Number", "ipv6.geoip.dst_asnum", |
4496 | 14 | FT_UINT32, BASE_DEC, NULL, 0x0, |
4497 | 14 | NULL, HFILL } |
4498 | 14 | }, |
4499 | 14 | { &hf_geoip_dst_as_org, |
4500 | 14 | { "Destination GeoIP AS Organization", "ipv6.geoip.dst_org", |
4501 | 14 | FT_STRING, BASE_NONE, NULL, 0x0, |
4502 | 14 | NULL, HFILL } |
4503 | 14 | }, |
4504 | 14 | { &hf_geoip_dst_latitude, |
4505 | 14 | { "Destination GeoIP Latitude", "ipv6.geoip.dst_lat", |
4506 | 14 | FT_DOUBLE, BASE_NONE, NULL, 0x0, |
4507 | 14 | NULL, HFILL } |
4508 | 14 | }, |
4509 | 14 | { &hf_geoip_dst_longitude, |
4510 | 14 | { "Destination GeoIP Longitude", "ipv6.geoip.dst_lon", |
4511 | 14 | FT_DOUBLE, BASE_NONE, NULL, 0x0, |
4512 | 14 | NULL, HFILL } |
4513 | 14 | }, |
4514 | | |
4515 | 14 | { &hf_ipv6_opt, |
4516 | 14 | { "IPv6 Option", "ipv6.opt", |
4517 | 14 | FT_NONE, BASE_NONE, NULL, 0x0, |
4518 | 14 | NULL, HFILL } |
4519 | 14 | }, |
4520 | 14 | { &hf_ipv6_opt_type, |
4521 | 14 | { "Type", "ipv6.opt.type", |
4522 | 14 | FT_UINT8, BASE_HEX | BASE_EXT_STRING, &ipv6_opt_type_vals_ext, 0x0, |
4523 | 14 | "Option type", HFILL } |
4524 | 14 | }, |
4525 | 14 | { &hf_ipv6_opt_type_action, |
4526 | 14 | { "Action", "ipv6.opt.type.action", |
4527 | 14 | FT_UINT8, BASE_DEC, VALS(ipv6_opt_type_action_vals), 0xC0, |
4528 | 14 | "Action for unrecognized option type", HFILL } |
4529 | 14 | }, |
4530 | 14 | { &hf_ipv6_opt_type_change, |
4531 | 14 | { "May Change", "ipv6.opt.type.change", |
4532 | 14 | FT_BOOLEAN, 8, TFS(&tfs_yes_no), 0x20, |
4533 | 14 | "Whether the option data may change en-route", HFILL } |
4534 | 14 | }, |
4535 | 14 | { &hf_ipv6_opt_type_rest, |
4536 | 14 | { "Low-Order Bits", "ipv6.opt.type.rest", |
4537 | 14 | FT_UINT8, BASE_HEX, NULL, 0x1F, |
4538 | 14 | "Remaining low-order bits", HFILL } |
4539 | 14 | }, |
4540 | 14 | { &hf_ipv6_opt_length, |
4541 | 14 | { "Length", "ipv6.opt.length", |
4542 | 14 | FT_UINT8, BASE_DEC, NULL, 0x0, |
4543 | 14 | "Option length in octets", HFILL } |
4544 | 14 | }, |
4545 | 14 | { &hf_ipv6_opt_pad1, |
4546 | 14 | { "Pad1", "ipv6.opt.pad1", |
4547 | 14 | FT_NONE, BASE_NONE, NULL, 0x0, |
4548 | 14 | "Pad1 Option", HFILL } |
4549 | 14 | }, |
4550 | 14 | { &hf_ipv6_opt_padn, |
4551 | 14 | { "PadN", "ipv6.opt.padn", |
4552 | 14 | FT_BYTES, BASE_NONE|BASE_ALLOW_ZERO, NULL, 0x0, |
4553 | 14 | "PadN Option", HFILL } |
4554 | 14 | }, |
4555 | 14 | { &hf_ipv6_opt_pmtu_min, |
4556 | 14 | { "Minimum Reported PMTU", "ipv6.opt.pmtu.min", |
4557 | 14 | FT_UINT16, BASE_DEC, NULL, 0x0, |
4558 | 14 | "The minimum reported PMTU in octets", HFILL } |
4559 | 14 | }, |
4560 | 14 | { &hf_ipv6_opt_pmtu_rtn, |
4561 | 14 | { "Return Minimum PMTU", "ipv6.opt.pmtu.rtn", |
4562 | 14 | FT_UINT16, BASE_DEC, NULL, 0x0, |
4563 | 14 | "The Return Min-PMTU in octets", HFILL } |
4564 | 14 | }, |
4565 | 14 | { &hf_ipv6_opt_pmtu_rtn_flag, |
4566 | 14 | { "Return Flag", "ipv6.opt.pmtu.r_flag", |
4567 | 14 | FT_BOOLEAN, BASE_NONE, NULL, 0x0, |
4568 | 14 | "Destination should include the received reported PMTU", HFILL } |
4569 | 14 | }, |
4570 | 14 | { &hf_ipv6_opt_apn_id_type, |
4571 | 14 | { "ID Type", "ipv6.opt.apn.id.type", |
4572 | 14 | FT_UINT8, BASE_DEC, VALS(apn_id_type_strs), 0x0, |
4573 | 14 | "The type of the APN ID", HFILL } |
4574 | 14 | }, |
4575 | 14 | { &hf_ipv6_opt_apn_flags, |
4576 | 14 | { "Flags", "ipv6.opt.apn.flags", |
4577 | 14 | FT_UINT8, BASE_HEX, NULL, 0x0, |
4578 | 14 | "Flags for advanced processing", HFILL } |
4579 | 14 | }, |
4580 | 14 | { &hf_ipv6_opt_apn_param_type, |
4581 | 14 | { "Parameters Types", "ipv6.opt.apn.param.type", |
4582 | 14 | FT_UINT16, BASE_HEX, NULL, 0x0, |
4583 | 14 | "Bitmap to identify the existence of APN Parameters", HFILL } |
4584 | 14 | }, |
4585 | 14 | { &hf_ipv6_opt_apn_id_part1, |
4586 | 14 | { "ID Part1", "ipv6.opt.apn.id.part1", |
4587 | 14 | FT_UINT32, BASE_HEX, NULL, 0x0, |
4588 | 14 | "The first 32-bit of the APN ID", HFILL } |
4589 | 14 | }, |
4590 | 14 | { &hf_ipv6_opt_apn_id_part2, |
4591 | 14 | { "ID Part2", "ipv6.opt.apn.id.part2", |
4592 | 14 | FT_UINT32, BASE_HEX, NULL, 0x0, |
4593 | 14 | "The second 32-bit of the APN ID", HFILL } |
4594 | 14 | }, |
4595 | 14 | { &hf_ipv6_opt_apn_id_part3, |
4596 | 14 | { "ID Part3", "ipv6.opt.apn.id.part3", |
4597 | 14 | FT_UINT32, BASE_HEX, NULL, 0x0, |
4598 | 14 | "The third 32-bit of the APN ID", HFILL } |
4599 | 14 | }, |
4600 | 14 | { &hf_ipv6_opt_apn_id_part4, |
4601 | 14 | { "ID Part4", "ipv6.opt.apn.id.part4", |
4602 | 14 | FT_UINT32, BASE_HEX, NULL, 0x0, |
4603 | 14 | "The last 32-bit of the APN ID", HFILL } |
4604 | 14 | }, |
4605 | 14 | { &hf_ipv6_opt_rtalert, |
4606 | 14 | { "Router Alert", "ipv6.opt.router_alert", |
4607 | 14 | FT_UINT16, BASE_DEC, VALS(ipv6_opt_rtalert_vals), 0x0, |
4608 | 14 | "Router Alert Option", HFILL } |
4609 | 14 | }, |
4610 | 14 | { &hf_ipv6_opt_tel, |
4611 | 14 | { "Tunnel Encapsulation Limit", "ipv6.opt.tel", |
4612 | 14 | FT_UINT8, BASE_DEC, NULL, 0x0, |
4613 | 14 | "How many further levels of encapsulation are permitted", HFILL } |
4614 | 14 | }, |
4615 | 14 | { &hf_ipv6_opt_jumbo, |
4616 | 14 | { "Payload Length", "ipv6.opt.jumbo", |
4617 | 14 | FT_UINT32, BASE_DEC, NULL, 0x0, |
4618 | 14 | "IPv6 (Jumbo) Payload Length", HFILL } |
4619 | 14 | }, |
4620 | 14 | { &hf_ipv6_opt_calipso_doi, |
4621 | 14 | { "CALIPSO Domain of Interpretation", "ipv6.opt.calipso.doi", |
4622 | 14 | FT_UINT32, BASE_DEC, NULL, 0x0, |
4623 | 14 | NULL, HFILL } |
4624 | 14 | }, |
4625 | 14 | { &hf_ipv6_opt_calipso_cmpt_length, |
4626 | 14 | { "Compartment Length", "ipv6.opt.calipso.cmpt.length", |
4627 | 14 | FT_UINT8, BASE_DEC, NULL, 0x0, |
4628 | 14 | NULL, HFILL } |
4629 | 14 | }, |
4630 | 14 | { &hf_ipv6_opt_calipso_sens_level, |
4631 | 14 | { "Sensitivity Level", "ipv6.opt.calipso.sens_level", |
4632 | 14 | FT_UINT8, BASE_DEC, NULL, 0x0, |
4633 | 14 | NULL, HFILL } |
4634 | 14 | }, |
4635 | 14 | { &hf_ipv6_opt_calipso_checksum, |
4636 | 14 | { "Checksum", "ipv6.opt.calipso.checksum", |
4637 | 14 | FT_UINT16, BASE_HEX, NULL, 0x0, |
4638 | 14 | NULL, HFILL } |
4639 | 14 | }, |
4640 | 14 | { &hf_ipv6_opt_calipso_cmpt_bitmap, |
4641 | 14 | { "Compartment Bitmap", "ipv6.opt.calipso.cmpt_bitmap", |
4642 | 14 | FT_BYTES, BASE_NONE, NULL, 0x0, |
4643 | 14 | NULL, HFILL } |
4644 | 14 | }, |
4645 | 14 | { &hf_ipv6_opt_smf_dpd_hash_bit, |
4646 | 14 | { "H-bit", "ipv6.opt.smf_dpd.hash_bit", |
4647 | 14 | FT_BOOLEAN, 8, NULL, 0x80, |
4648 | 14 | "Hash indicator", HFILL } |
4649 | 14 | }, |
4650 | 14 | { &hf_ipv6_opt_smf_dpd_tid_type, |
4651 | 14 | { "TaggerID Type", "ipv6.opt.smf_dpd.tid_type", |
4652 | 14 | FT_UINT8, BASE_DEC, VALS(ipv6_opt_smf_dpd_tidty_vals), 0x70, |
4653 | 14 | NULL, HFILL } |
4654 | 14 | }, |
4655 | 14 | { &hf_ipv6_opt_smf_dpd_tid_len, |
4656 | 14 | { "TaggerID Length", "ipv6.opt.smf_dpd.tid_len", |
4657 | 14 | FT_UINT8, BASE_DEC, NULL, 0x0F, |
4658 | 14 | NULL, HFILL } |
4659 | 14 | }, |
4660 | 14 | { &hf_ipv6_opt_smf_dpd_tagger_id, |
4661 | 14 | { "TaggerID", "ipv6.opt.smf_dpd.tagger_id", |
4662 | 14 | FT_BYTES, BASE_NONE, NULL, 0x0, |
4663 | 14 | NULL, HFILL } |
4664 | 14 | }, |
4665 | 14 | { &hf_ipv6_opt_smf_dpd_ident, |
4666 | 14 | { "Identifier", "ipv6.opt.smf_dpd.ident", |
4667 | 14 | FT_BYTES, BASE_NONE, NULL, 0x0, |
4668 | 14 | NULL, HFILL } |
4669 | 14 | }, |
4670 | 14 | { &hf_ipv6_opt_smf_dpd_hav, |
4671 | 14 | { "Hash Assist Value", "ipv6.opt.smf_dpd.hav", |
4672 | 14 | FT_BYTES, BASE_NONE, NULL, 0x0, |
4673 | 14 | NULL, HFILL } |
4674 | 14 | }, |
4675 | 14 | { &hf_ipv6_opt_pdm_scale_dtlr, |
4676 | 14 | { "Scale DTLR", "ipv6.opt.pdm.scale_dtlr", |
4677 | 14 | FT_UINT8, BASE_DEC, NULL, 0x0, |
4678 | 14 | "Scale for Delta Time Last Received", HFILL } |
4679 | 14 | }, |
4680 | 14 | { &hf_ipv6_opt_pdm_scale_dtls, |
4681 | 14 | { "Scale DTLS", "ipv6.opt.pdm.scale_dtls", |
4682 | 14 | FT_UINT8, BASE_DEC, NULL, 0x0, |
4683 | 14 | "Scale for Delta Time Last Sent", HFILL } |
4684 | 14 | }, |
4685 | 14 | { &hf_ipv6_opt_pdm_psn_this_pkt, |
4686 | 14 | { "PSN This Packet", "ipv6.opt.pdm.psn_this_pkt", |
4687 | 14 | FT_UINT16, BASE_DEC, NULL, 0x0, |
4688 | 14 | "Packet Sequence Number This Packet", HFILL } |
4689 | 14 | }, |
4690 | 14 | { &hf_ipv6_opt_pdm_psn_last_recv, |
4691 | 14 | { "PSN Last Received", "ipv6.opt.pdm.psn_last_recv", |
4692 | 14 | FT_UINT16, BASE_DEC, NULL, 0x0, |
4693 | 14 | "Packet Sequence Number Last Received", HFILL } |
4694 | 14 | }, |
4695 | 14 | { &hf_ipv6_opt_pdm_delta_last_recv, |
4696 | 14 | { "Delta Time Last Received", "ipv6.opt.pdm.delta_last_recv", |
4697 | 14 | FT_UINT16, BASE_DEC, NULL, 0x0, |
4698 | 14 | NULL, HFILL } |
4699 | 14 | }, |
4700 | 14 | { &hf_ipv6_opt_pdm_delta_last_sent, |
4701 | 14 | { "Delta Time Last Sent", "ipv6.opt.pdm.delta_last_sent", |
4702 | 14 | FT_UINT16, BASE_DEC, NULL, 0x0, |
4703 | 14 | NULL, HFILL } |
4704 | 14 | }, |
4705 | 14 | { &hf_ipv6_opt_qs_func, |
4706 | 14 | { "Function", "ipv6.opt.qs_func", |
4707 | 14 | FT_UINT8, BASE_DEC, VALS(qs_func_vals), QS_FUNC_MASK, |
4708 | 14 | NULL, HFILL } |
4709 | 14 | }, |
4710 | 14 | { &hf_ipv6_opt_qs_rate, |
4711 | 14 | { "Rate", "ipv6.opt.qs_rate", |
4712 | 14 | FT_UINT8, BASE_DEC | BASE_EXT_STRING, &qs_rate_vals_ext, QS_RATE_MASK, |
4713 | 14 | NULL, HFILL } |
4714 | 14 | }, |
4715 | 14 | { &hf_ipv6_opt_qs_ttl, |
4716 | 14 | { "QS TTL", "ipv6.opt.qs_ttl", |
4717 | 14 | FT_UINT8, BASE_DEC, NULL, 0x0, |
4718 | 14 | NULL, HFILL } |
4719 | 14 | }, |
4720 | 14 | { &hf_ipv6_opt_qs_ttl_diff, |
4721 | 14 | { "TTL Diff", "ipv6.opt.qs_ttl_diff", |
4722 | 14 | FT_UINT8, BASE_DEC, NULL, 0x0, |
4723 | 14 | NULL, HFILL } |
4724 | 14 | }, |
4725 | 14 | { &hf_ipv6_opt_qs_unused, |
4726 | 14 | { "Not Used", "ipv6.opt.qs_unused", |
4727 | 14 | FT_UINT8, BASE_DEC, NULL, 0x0, |
4728 | 14 | NULL, HFILL } |
4729 | 14 | }, |
4730 | 14 | { &hf_ipv6_opt_qs_nonce, |
4731 | 14 | { "QS Nonce", "ipv6.opt.qs_nonce", |
4732 | 14 | FT_UINT32, BASE_HEX, NULL, 0xFFFFFFFC, |
4733 | 14 | NULL, HFILL } |
4734 | 14 | }, |
4735 | 14 | { &hf_ipv6_opt_qs_reserved, |
4736 | 14 | { "Reserved", "ipv6.opt.qs_reserved", |
4737 | 14 | FT_UINT32, BASE_HEX, NULL, 0x0003, |
4738 | 14 | NULL, HFILL } |
4739 | 14 | }, |
4740 | 14 | { &hf_ipv6_opt_ioam_rsv, |
4741 | 14 | { "Reserved", "ipv6.opt.ioam.rsv", |
4742 | 14 | FT_UINT8, BASE_DEC, NULL, 0x0, |
4743 | 14 | "Reserved (must be zero)", HFILL } |
4744 | 14 | }, |
4745 | 14 | { &hf_ipv6_opt_ioam_opt_type, |
4746 | 14 | { "Option-Type", "ipv6.opt.ioam.opt_type", |
4747 | 14 | FT_UINT8, BASE_DEC, VALS(ipv6_ioam_opt_types), 0x0, |
4748 | 14 | NULL, HFILL } |
4749 | 14 | }, |
4750 | 14 | { &hf_ipv6_opt_ioam_trace_ns, |
4751 | 14 | { "Namespace ID", "ipv6.opt.ioam.trace.ns", |
4752 | 14 | FT_UINT16, BASE_DEC, NULL, 0x0, |
4753 | 14 | NULL, HFILL } |
4754 | 14 | }, |
4755 | 14 | { &hf_ipv6_opt_ioam_trace_nodelen, |
4756 | 14 | { "Node Length", "ipv6.opt.ioam.trace.nodelen", |
4757 | 14 | FT_UINT8, BASE_DEC, NULL, 0x0, |
4758 | 14 | NULL, HFILL } |
4759 | 14 | }, |
4760 | 14 | { &hf_ipv6_opt_ioam_trace_flags, |
4761 | 14 | { "Flags", "ipv6.opt.ioam.trace.flags", |
4762 | 14 | FT_UINT16, BASE_HEX, NULL, 0x0780, |
4763 | 14 | NULL, HFILL } |
4764 | 14 | }, |
4765 | 14 | { &hf_ipv6_opt_ioam_trace_flag_o, |
4766 | 14 | { "Overflow", "ipv6.opt.ioam.trace.flag.o", |
4767 | 14 | FT_BOOLEAN, 16, NULL, 0x0400, |
4768 | 14 | "Not enough free space", HFILL } |
4769 | 14 | }, |
4770 | 14 | { &hf_ipv6_opt_ioam_trace_flag_l, |
4771 | 14 | { "Loopback", "ipv6.opt.ioam.trace.flag.l", |
4772 | 14 | FT_BOOLEAN, 16, NULL, 0x0200, |
4773 | 14 | "Send a copy of the packet back towards the source", HFILL } |
4774 | 14 | }, |
4775 | 14 | { &hf_ipv6_opt_ioam_trace_flag_a, |
4776 | 14 | { "Active", "ipv6.opt.ioam.trace.flag.a", |
4777 | 14 | FT_BOOLEAN, 16, NULL, 0x0100, |
4778 | 14 | "Active measurement packet", HFILL } |
4779 | 14 | }, |
4780 | 14 | { &hf_ipv6_opt_ioam_trace_flag_rsv, |
4781 | 14 | { "Reserved", "ipv6.opt.ioam.trace.flag.rsv", |
4782 | 14 | FT_BOOLEAN, 16, NULL, 0x0080, |
4783 | 14 | "Reserved (must be zero)", HFILL } |
4784 | 14 | }, |
4785 | 14 | { &hf_ipv6_opt_ioam_trace_remlen, |
4786 | 14 | { "Remaining Length", "ipv6.opt.ioam.trace.remlen", |
4787 | 14 | FT_UINT8, BASE_DEC, NULL, 0x0, |
4788 | 14 | NULL, HFILL } |
4789 | 14 | }, |
4790 | 14 | { &hf_ipv6_opt_ioam_trace_type, |
4791 | 14 | { "Trace Type", "ipv6.opt.ioam.trace.type", |
4792 | 14 | FT_UINT24, BASE_HEX, NULL, 0x0, |
4793 | 14 | NULL, HFILL } |
4794 | 14 | }, |
4795 | 14 | { &hf_ipv6_opt_ioam_trace_type_bit0, |
4796 | 14 | { "Hop_Lim and Node ID (short)", "ipv6.opt.ioam.trace.type.bit0", |
4797 | 14 | FT_BOOLEAN, 24, NULL, 0x800000, |
4798 | 14 | NULL, HFILL } |
4799 | 14 | }, |
4800 | 14 | { &hf_ipv6_opt_ioam_trace_type_bit1, |
4801 | 14 | { "Ingress and Egress IDs (short)", "ipv6.opt.ioam.trace.type.bit1", |
4802 | 14 | FT_BOOLEAN, 24, NULL, 0x400000, |
4803 | 14 | NULL, HFILL } |
4804 | 14 | }, |
4805 | 14 | { &hf_ipv6_opt_ioam_trace_type_bit2, |
4806 | 14 | { "Timestamp seconds", "ipv6.opt.ioam.trace.type.bit2", |
4807 | 14 | FT_BOOLEAN, 24, NULL, 0x200000, |
4808 | 14 | NULL, HFILL } |
4809 | 14 | }, |
4810 | 14 | { &hf_ipv6_opt_ioam_trace_type_bit3, |
4811 | 14 | { "Timestamp fraction", "ipv6.opt.ioam.trace.type.bit3", |
4812 | 14 | FT_BOOLEAN, 24, NULL, 0x100000, |
4813 | 14 | NULL, HFILL } |
4814 | 14 | }, |
4815 | 14 | { &hf_ipv6_opt_ioam_trace_type_bit4, |
4816 | 14 | { "Transit delay", "ipv6.opt.ioam.trace.type.bit4", |
4817 | 14 | FT_BOOLEAN, 24, NULL, 0x080000, |
4818 | 14 | NULL, HFILL } |
4819 | 14 | }, |
4820 | 14 | { &hf_ipv6_opt_ioam_trace_type_bit5, |
4821 | 14 | { "IOAM-Namespace specific data (short)", "ipv6.opt.ioam.trace.type.bit5", |
4822 | 14 | FT_BOOLEAN, 24, NULL, 0x040000, |
4823 | 14 | NULL, HFILL } |
4824 | 14 | }, |
4825 | 14 | { &hf_ipv6_opt_ioam_trace_type_bit6, |
4826 | 14 | { "Queue depth", "ipv6.opt.ioam.trace.type.bit6", |
4827 | 14 | FT_BOOLEAN, 24, NULL, 0x020000, |
4828 | 14 | NULL, HFILL } |
4829 | 14 | }, |
4830 | 14 | { &hf_ipv6_opt_ioam_trace_type_bit7, |
4831 | 14 | { "Checksum complement", "ipv6.opt.ioam.trace.type.bit7", |
4832 | 14 | FT_BOOLEAN, 24, NULL, 0x010000, |
4833 | 14 | NULL, HFILL } |
4834 | 14 | }, |
4835 | 14 | { &hf_ipv6_opt_ioam_trace_type_bit8, |
4836 | 14 | { "Hop_Lim and Node ID (wide)", "ipv6.opt.ioam.trace.type.bit8", |
4837 | 14 | FT_BOOLEAN, 24, NULL, 0x008000, |
4838 | 14 | NULL, HFILL } |
4839 | 14 | }, |
4840 | 14 | { &hf_ipv6_opt_ioam_trace_type_bit9, |
4841 | 14 | { "Ingress and Egress IDs (wide)", "ipv6.opt.ioam.trace.type.bit9", |
4842 | 14 | FT_BOOLEAN, 24, NULL, 0x004000, |
4843 | 14 | NULL, HFILL } |
4844 | 14 | }, |
4845 | 14 | { &hf_ipv6_opt_ioam_trace_type_bit10, |
4846 | 14 | { "IOAM-Namespace specific data (wide)", "ipv6.opt.ioam.trace.type.bit10", |
4847 | 14 | FT_BOOLEAN, 24, NULL, 0x002000, |
4848 | 14 | NULL, HFILL } |
4849 | 14 | }, |
4850 | 14 | { &hf_ipv6_opt_ioam_trace_type_bit11, |
4851 | 14 | { "Buffer occupancy", "ipv6.opt.ioam.trace.type.bit11", |
4852 | 14 | FT_BOOLEAN, 24, NULL, 0x001000, |
4853 | 14 | NULL, HFILL } |
4854 | 14 | }, |
4855 | 14 | { &hf_ipv6_opt_ioam_trace_type_undef, |
4856 | 14 | { "Undefined", "ipv6.opt.ioam.trace.type.undef", |
4857 | 14 | FT_BOOLEAN, 24, NULL, 0x000ffc, |
4858 | 14 | NULL, HFILL } |
4859 | 14 | }, |
4860 | 14 | { &hf_ipv6_opt_ioam_trace_type_bit22, |
4861 | 14 | { "Opaque State Snapshot", "ipv6.opt.ioam.trace.type.bit22", |
4862 | 14 | FT_BOOLEAN, 24, NULL, 0x000002, |
4863 | 14 | NULL, HFILL } |
4864 | 14 | }, |
4865 | 14 | { &hf_ipv6_opt_ioam_trace_type_rsv, |
4866 | 14 | { "Reserved", "ipv6.opt.ioam.trace.type.rsv", |
4867 | 14 | FT_BOOLEAN, 24, NULL, 0x000001, |
4868 | 14 | NULL, HFILL } |
4869 | 14 | }, |
4870 | 14 | { &hf_ipv6_opt_ioam_trace_rsv, |
4871 | 14 | { "Reserved", "ipv6.opt.ioam.trace.rsv", |
4872 | 14 | FT_UINT8, BASE_DEC, NULL, 0x0, |
4873 | 14 | "Reserved (must be zero)", HFILL } |
4874 | 14 | }, |
4875 | 14 | { &hf_ipv6_opt_ioam_trace_free_space, |
4876 | 14 | { "Free space", "ipv6.opt.ioam.trace.free_space", |
4877 | 14 | FT_BYTES, BASE_NONE, NULL, 0x0, |
4878 | 14 | NULL, HFILL } |
4879 | 14 | }, |
4880 | 14 | { &hf_ipv6_opt_ioam_trace_node_hlim, |
4881 | 14 | { "Hop Limit", "ipv6.opt.ioam.trace.node.hlim", |
4882 | 14 | FT_UINT8, BASE_DEC, NULL, 0x0, |
4883 | 14 | NULL, HFILL } |
4884 | 14 | }, |
4885 | 14 | { &hf_ipv6_opt_ioam_trace_node_id, |
4886 | 14 | { "ID", "ipv6.opt.ioam.trace.node.id", |
4887 | 14 | FT_UINT24, BASE_HEX, NULL, 0x0, |
4888 | 14 | NULL, HFILL } |
4889 | 14 | }, |
4890 | 14 | { &hf_ipv6_opt_ioam_trace_node_iif, |
4891 | 14 | { "Ingress ID", "ipv6.opt.ioam.trace.node.iif", |
4892 | 14 | FT_UINT16, BASE_HEX, NULL, 0x0, |
4893 | 14 | NULL, HFILL } |
4894 | 14 | }, |
4895 | 14 | { &hf_ipv6_opt_ioam_trace_node_eif, |
4896 | 14 | { "Egress ID", "ipv6.opt.ioam.trace.node.eif", |
4897 | 14 | FT_UINT16, BASE_HEX, NULL, 0x0, |
4898 | 14 | NULL, HFILL } |
4899 | 14 | }, |
4900 | 14 | { &hf_ipv6_opt_ioam_trace_node_tss, |
4901 | 14 | { "Timestamp Seconds", "ipv6.opt.ioam.trace.node.tss", |
4902 | 14 | FT_UINT32, BASE_HEX, NULL, 0x0, |
4903 | 14 | NULL, HFILL } |
4904 | 14 | }, |
4905 | 14 | { &hf_ipv6_opt_ioam_trace_node_tsf, |
4906 | 14 | { "Timestamp Fraction", "ipv6.opt.ioam.trace.node.tsf", |
4907 | 14 | FT_UINT32, BASE_HEX, NULL, 0x0, |
4908 | 14 | NULL, HFILL } |
4909 | 14 | }, |
4910 | 14 | { &hf_ipv6_opt_ioam_trace_node_trdelay, |
4911 | 14 | { "Transit Delay", "ipv6.opt.ioam.trace.node.trdelay", |
4912 | 14 | FT_UINT32, BASE_HEX, NULL, 0x0, |
4913 | 14 | NULL, HFILL } |
4914 | 14 | }, |
4915 | 14 | { &hf_ipv6_opt_ioam_trace_node_nsdata, |
4916 | 14 | { "Namespace Data (short)", "ipv6.opt.ioam.trace.node.nsdata", |
4917 | 14 | FT_UINT32, BASE_HEX, NULL, 0x0, |
4918 | 14 | NULL, HFILL } |
4919 | 14 | }, |
4920 | 14 | { &hf_ipv6_opt_ioam_trace_node_qdepth, |
4921 | 14 | { "Queue Depth", "ipv6.opt.ioam.trace.node.qdepth", |
4922 | 14 | FT_UINT32, BASE_HEX, NULL, 0x0, |
4923 | 14 | NULL, HFILL } |
4924 | 14 | }, |
4925 | 14 | { &hf_ipv6_opt_ioam_trace_node_csum, |
4926 | 14 | { "Checksum Complement", "ipv6.opt.ioam.trace.node.csum", |
4927 | 14 | FT_UINT32, BASE_HEX, NULL, 0x0, |
4928 | 14 | NULL, HFILL } |
4929 | 14 | }, |
4930 | 14 | { &hf_ipv6_opt_ioam_trace_node_id_wide, |
4931 | 14 | { "ID", "ipv6.opt.ioam.trace.node.id_wide", |
4932 | 14 | FT_UINT56, BASE_HEX, NULL, 0x0, |
4933 | 14 | NULL, HFILL } |
4934 | 14 | }, |
4935 | 14 | { &hf_ipv6_opt_ioam_trace_node_iif_wide, |
4936 | 14 | { "Ingress ID", "ipv6.opt.ioam.trace.node.iif_wide", |
4937 | 14 | FT_UINT32, BASE_HEX, NULL, 0x0, |
4938 | 14 | NULL, HFILL } |
4939 | 14 | }, |
4940 | 14 | { &hf_ipv6_opt_ioam_trace_node_eif_wide, |
4941 | 14 | { "Egress ID", "ipv6.opt.ioam.trace.node.eif_wide", |
4942 | 14 | FT_UINT32, BASE_HEX, NULL, 0x0, |
4943 | 14 | NULL, HFILL } |
4944 | 14 | }, |
4945 | 14 | { &hf_ipv6_opt_ioam_trace_node_nsdata_wide, |
4946 | 14 | { "Namespace Data (wide)", "ipv6.opt.ioam.trace.node.nsdata_wide", |
4947 | 14 | FT_UINT64, BASE_HEX, NULL, 0x0, |
4948 | 14 | NULL, HFILL } |
4949 | 14 | }, |
4950 | 14 | { &hf_ipv6_opt_ioam_trace_node_bufoccup, |
4951 | 14 | { "Buffer Occupancy", "ipv6.opt.ioam.trace.node.bufoccup", |
4952 | 14 | FT_UINT32, BASE_HEX, NULL, 0x0, |
4953 | 14 | NULL, HFILL } |
4954 | 14 | }, |
4955 | 14 | { &hf_ipv6_opt_ioam_trace_node_undefined, |
4956 | 14 | { "Undefined bit", "ipv6.opt.ioam.trace.node.undefined", |
4957 | 14 | FT_UINT32, BASE_HEX, NULL, 0x0, |
4958 | 14 | NULL, HFILL } |
4959 | 14 | }, |
4960 | 14 | { &hf_ipv6_opt_ioam_trace_node_oss_len, |
4961 | 14 | { "Length", "ipv6.opt.ioam.trace.node.oss.len", |
4962 | 14 | FT_UINT8, BASE_DEC, NULL, 0x0, |
4963 | 14 | NULL, HFILL } |
4964 | 14 | }, |
4965 | 14 | { &hf_ipv6_opt_ioam_trace_node_oss_scid, |
4966 | 14 | { "Schema ID", "ipv6.opt.ioam.trace.node.oss.scid", |
4967 | 14 | FT_UINT24, BASE_HEX, NULL, 0x0, |
4968 | 14 | NULL, HFILL } |
4969 | 14 | }, |
4970 | 14 | { &hf_ipv6_opt_ioam_trace_node_oss_data, |
4971 | 14 | { "Data", "ipv6.opt.ioam.trace.node.oss.data", |
4972 | 14 | FT_BYTES, BASE_NONE, NULL, 0x0, |
4973 | 14 | NULL, HFILL } |
4974 | 14 | }, |
4975 | 14 | { &hf_ipv6_opt_ioam_dex_ns, |
4976 | 14 | { "Namespace ID", "ipv6.opt.ioam.dex.ns", |
4977 | 14 | FT_UINT16, BASE_DEC, NULL, 0x0, |
4978 | 14 | NULL, HFILL } |
4979 | 14 | }, |
4980 | 14 | { &hf_ipv6_opt_ioam_dex_flags, |
4981 | 14 | { "Flags", "ipv6.opt.ioam.dex.flags", |
4982 | 14 | FT_UINT8, BASE_DEC, NULL, 0x0, |
4983 | 14 | NULL, HFILL } |
4984 | 14 | }, |
4985 | 14 | { &hf_ipv6_opt_ioam_dex_extflags, |
4986 | 14 | { "Extension Flags", "ipv6.opt.ioam.dex.extflags", |
4987 | 14 | FT_UINT8, BASE_HEX, NULL, 0x0, |
4988 | 14 | NULL, HFILL } |
4989 | 14 | }, |
4990 | 14 | { &hf_ipv6_opt_ioam_dex_extflag_flag_seqnum, |
4991 | 14 | { "Sequence Number", "ipv6.opt.ioam.dex.extflag.flag.seqnum", |
4992 | 14 | FT_BOOLEAN, 8, NULL, 0x40, |
4993 | 14 | NULL, HFILL } |
4994 | 14 | }, |
4995 | 14 | { &hf_ipv6_opt_ioam_dex_extflag_flag_flowid, |
4996 | 14 | { "Flow ID", "ipv6.opt.ioam.dex.extflag.flag.flowid", |
4997 | 14 | FT_BOOLEAN, 8, NULL, 0x80, |
4998 | 14 | NULL, HFILL } |
4999 | 14 | }, |
5000 | 14 | { &hf_ipv6_opt_ioam_dex_extflag_flag_rsv, |
5001 | 14 | { "Reserved", "ipv6.opt.ioam.trace.type.rsv", |
5002 | 14 | FT_BOOLEAN, 8, NULL, 0x3F, |
5003 | 14 | NULL, HFILL } |
5004 | 14 | }, |
5005 | 14 | { &hf_ipv6_opt_ioam_dex_extflag_flowid, |
5006 | 14 | { "Flow ID", "ipv6.opt.ioam.dex.extflag.flowid", |
5007 | 14 | FT_UINT32, BASE_DEC, NULL, 0x0, |
5008 | 14 | NULL, HFILL } |
5009 | 14 | }, |
5010 | 14 | { &hf_ipv6_opt_ioam_dex_extflag_seqnum, |
5011 | 14 | { "Sequence Number", "ipv6.opt.ioam.dex.extflag.seqnum", |
5012 | 14 | FT_UINT32, BASE_DEC, NULL, 0x0, |
5013 | 14 | NULL, HFILL } |
5014 | 14 | }, |
5015 | 14 | { &hf_ipv6_opt_ioam_dex_rsv, |
5016 | 14 | { "Reserved", "ipv6.opt.ioam.dex.rsv", |
5017 | 14 | FT_UINT8, BASE_DEC, NULL, 0x0, |
5018 | 14 | NULL, HFILL } |
5019 | 14 | }, |
5020 | 14 | { &hf_ipv6_opt_tpf_information, |
5021 | 14 | { "TPF Information", "ipv6.opt.tpf_information", |
5022 | 14 | FT_UINT32, BASE_HEX, NULL, 0x0, |
5023 | 14 | "Tunnel Payload Forwarding Information", HFILL } |
5024 | 14 | }, |
5025 | 14 | { &hf_ipv6_opt_mipv6_home_address, |
5026 | 14 | { "MIPv6 Home Address", "ipv6.opt.mipv6.home_address", |
5027 | 14 | FT_IPv6, BASE_NONE, NULL, 0x0, |
5028 | 14 | NULL, HFILL } |
5029 | 14 | }, |
5030 | 14 | { &hf_ipv6_opt_rpl_flag, |
5031 | 14 | { "Flag", "ipv6.opt.rpl.flag", |
5032 | 14 | FT_UINT8, BASE_HEX, NULL, 0x0, |
5033 | 14 | NULL, HFILL } |
5034 | 14 | }, |
5035 | 14 | { &hf_ipv6_opt_rpl_flag_o, |
5036 | 14 | { "Down", "ipv6.opt.rpl.flag.o", |
5037 | 14 | FT_BOOLEAN, 8, NULL, 0x80, |
5038 | 14 | "The packet is expected to progress Up or Down", HFILL } |
5039 | 14 | }, |
5040 | 14 | { &hf_ipv6_opt_rpl_flag_r, |
5041 | 14 | { "Rank Error", "ipv6.opt.rpl.flag.r", |
5042 | 14 | FT_BOOLEAN, 8, NULL, 0x40, |
5043 | 14 | "Whether a rank error was detected", HFILL } |
5044 | 14 | }, |
5045 | 14 | { &hf_ipv6_opt_rpl_flag_f, |
5046 | 14 | { "Forwarding Error", "ipv6.opt.rpl.flag.f", |
5047 | 14 | FT_BOOLEAN, 8, NULL, 0x20, |
5048 | 14 | "Set if the node cannot forward the packet further towards the destination", HFILL } |
5049 | 14 | }, |
5050 | 14 | { &hf_ipv6_opt_rpl_flag_rsv, |
5051 | 14 | { "Reserved", "ipv6.opt.rpl.flag.rsv", |
5052 | 14 | FT_UINT8, BASE_HEX, NULL, 0x1F, |
5053 | 14 | "Reserved (must be zero)", HFILL } |
5054 | 14 | }, |
5055 | 14 | { &hf_ipv6_opt_rpl_instance_id, |
5056 | 14 | { "RPLInstanceID", "ipv6.opt.rpl.instance_id", |
5057 | 14 | FT_UINT8, BASE_HEX, NULL, 0x0, |
5058 | 14 | "The DODAG instance along which the packet is sent", HFILL } |
5059 | 14 | }, |
5060 | 14 | { &hf_ipv6_opt_rpl_senderrank, |
5061 | 14 | { "Sender Rank", "ipv6.opt.rpl.sender_rank", |
5062 | 14 | FT_UINT16, BASE_HEX, NULL, 0x0, |
5063 | 14 | "Set to zero by the source and to DAGRank(rank) by a router that forwards inside the RPL network", HFILL } |
5064 | 14 | }, |
5065 | 14 | { &hf_ipv6_opt_ilnp_nonce, |
5066 | 14 | { "ILNP Nonce", "ipv6.opt.ilnp_nonce", |
5067 | 14 | FT_BYTES, BASE_NONE, NULL, 0x0, |
5068 | 14 | NULL, HFILL } |
5069 | 14 | }, |
5070 | 14 | { &hf_ipv6_opt_lio_len, |
5071 | 14 | { "LineIDLen", "ipv6.opt.lio.length", |
5072 | 14 | FT_UINT8, BASE_DEC, NULL, 0x0, |
5073 | 14 | NULL, HFILL } |
5074 | 14 | }, |
5075 | 14 | { &hf_ipv6_opt_lio_id, |
5076 | 14 | { "Line ID", "ipv6.opt.lio.line_id", |
5077 | 14 | FT_STRING, BASE_NONE, NULL, 0x0, |
5078 | 14 | NULL, HFILL } |
5079 | 14 | }, |
5080 | 14 | { &hf_ipv6_opt_mpl_flag, |
5081 | 14 | { "Flag", "ipv6.opt.mpl.flag", |
5082 | 14 | FT_UINT8, BASE_HEX, NULL, 0x0, |
5083 | 14 | NULL, HFILL } |
5084 | 14 | }, |
5085 | 14 | { &hf_ipv6_opt_mpl_flag_s, |
5086 | 14 | { "Seed ID Length", "ipv6.opt.mpl.flag.s", |
5087 | 14 | FT_UINT8, BASE_DEC, VALS(mpl_seed_id_len_vals), 0xC0, |
5088 | 14 | "Identifies the length of Seed ID", HFILL } |
5089 | 14 | }, |
5090 | 14 | { &hf_ipv6_opt_mpl_flag_m, |
5091 | 14 | { "Largest Sequence", "ipv6.opt.mpl.flag.m", |
5092 | 14 | FT_BOOLEAN, 8, NULL, 0x20, |
5093 | 14 | "Indicates Sequence is known to be the largest sequence number", HFILL } |
5094 | 14 | }, |
5095 | 14 | { &hf_ipv6_opt_mpl_flag_v, |
5096 | 14 | { "Version", "ipv6.opt.mpl.flag.v", |
5097 | 14 | FT_BOOLEAN, 8, NULL, 0x10, |
5098 | 14 | "0 indicates this option conforms to RFC<TBC>", HFILL } |
5099 | 14 | }, |
5100 | 14 | { &hf_ipv6_opt_mpl_flag_rsv, |
5101 | 14 | { "Reserved", "ipv6.opt.mpl.flag.rsv", |
5102 | 14 | FT_UINT8, BASE_HEX, NULL, 0x0F, |
5103 | 14 | "Reserved (must be zero)", HFILL } |
5104 | 14 | }, |
5105 | 14 | { &hf_ipv6_opt_mpl_sequence, |
5106 | 14 | { "Sequence", "ipv6.opt.mpl.sequence", |
5107 | 14 | FT_UINT8, BASE_HEX, NULL, 0x0, |
5108 | 14 | "Identifies relative ordering of MPL Data Messages from the MPL Seed identified by Seed ID", HFILL } |
5109 | 14 | }, |
5110 | 14 | { &hf_ipv6_opt_mpl_seed_id, |
5111 | 14 | { "Seed ID", "ipv6.opt.mpl.seed_id", |
5112 | 14 | FT_BYTES, BASE_NONE, NULL, 0x0, |
5113 | 14 | "Uniquely identifies the MPL Seed that initiated dissemination of the MPL Data Message", HFILL } |
5114 | 14 | }, |
5115 | 14 | { &hf_ipv6_opt_dff_flags, |
5116 | 14 | { "Flags", "ipv6.opt.dff.flags", |
5117 | 14 | FT_UINT8, BASE_HEX, NULL, 0x0, |
5118 | 14 | NULL, HFILL } |
5119 | 14 | }, |
5120 | 14 | { &hf_ipv6_opt_dff_flag_ver, |
5121 | 14 | { "Version (VER)", "ipv6.opt.dff.flag.ver", |
5122 | 14 | FT_UINT8, BASE_DEC, NULL, 0xC0, |
5123 | 14 | "The version of DFF that is used", HFILL } |
5124 | 14 | }, |
5125 | 14 | { &hf_ipv6_opt_dff_flag_dup, |
5126 | 14 | { "Duplicate (DUP)", "ipv6.opt.dff.flag.dup", |
5127 | 14 | FT_BOOLEAN, 8, NULL, 0x20, |
5128 | 14 | "Indicates the packet is being retransmitted", HFILL } |
5129 | 14 | }, |
5130 | 14 | { &hf_ipv6_opt_dff_flag_ret, |
5131 | 14 | { "Return (RET)", "ipv6.opt.dff.flag.ret", |
5132 | 14 | FT_BOOLEAN, 8, NULL, 0x10, |
5133 | 14 | "Must be set to 1 prior to sending the packet back to the Previous Hop", HFILL } |
5134 | 14 | }, |
5135 | 14 | { &hf_ipv6_opt_dff_flag_rsv, |
5136 | 14 | { "Reserved", "ipv6.opt.dff.flag.rsv", |
5137 | 14 | FT_UINT8, BASE_HEX, NULL, 0x0F, |
5138 | 14 | "Reserved (must be zero)", HFILL } |
5139 | 14 | }, |
5140 | 14 | { &hf_ipv6_opt_dff_seqnum, |
5141 | 14 | { "Sequence Number", "ipv6.opt.dff.sequence_number", |
5142 | 14 | FT_UINT16, BASE_DEC_HEX, NULL, 0x0, |
5143 | 14 | NULL, HFILL } |
5144 | 14 | }, |
5145 | 14 | { &hf_ipv6_opt_experimental, |
5146 | 14 | { "Experimental Option", "ipv6.opt.experimental", |
5147 | 14 | FT_BYTES, BASE_NONE, NULL, 0x0, |
5148 | 14 | NULL, HFILL } |
5149 | 14 | }, |
5150 | 14 | { &hf_ipv6_opt_unknown_data, |
5151 | 14 | { "Unknown Data", "ipv6.opt_unknown_data", |
5152 | 14 | FT_BYTES, BASE_NONE, NULL, 0x0, |
5153 | 14 | "Not interpreted data", HFILL } |
5154 | 14 | }, |
5155 | 14 | { &hf_ipv6_opt_unknown, |
5156 | 14 | { "Unknown Option Payload", "ipv6.opt.unknown", |
5157 | 14 | FT_BYTES, BASE_NONE, NULL, 0x0, |
5158 | 14 | NULL, HFILL } |
5159 | 14 | }, |
5160 | 14 | { &hf_ipv6_fragment, |
5161 | 14 | { "IPv6 Fragment", "ipv6.fragment", |
5162 | 14 | FT_FRAMENUM, BASE_NONE, NULL, 0x0, |
5163 | 14 | NULL, HFILL } |
5164 | 14 | }, |
5165 | 14 | { &hf_ipv6_fragment_overlap, |
5166 | 14 | { "Fragment overlap", "ipv6.fragment.overlap", |
5167 | 14 | FT_BOOLEAN, BASE_NONE, NULL, 0x0, |
5168 | 14 | "Fragment overlaps with other fragments", HFILL } |
5169 | 14 | }, |
5170 | 14 | { &hf_ipv6_fragment_overlap_conflict, |
5171 | 14 | { "Conflicting data in fragment overlap", "ipv6.fragment.overlap.conflict", |
5172 | 14 | FT_BOOLEAN, BASE_NONE, NULL, 0x0, |
5173 | 14 | "Overlapping fragments contained conflicting data", HFILL } |
5174 | 14 | }, |
5175 | 14 | { &hf_ipv6_fragment_multiple_tails, |
5176 | 14 | { "Multiple tail fragments found", "ipv6.fragment.multipletails", |
5177 | 14 | FT_BOOLEAN, BASE_NONE, NULL, 0x0, |
5178 | 14 | "Several tails were found when defragmenting the packet", HFILL } |
5179 | 14 | }, |
5180 | 14 | { &hf_ipv6_fragment_too_long_fragment, |
5181 | 14 | { "Fragment too long", "ipv6.fragment.toolongfragment", |
5182 | 14 | FT_BOOLEAN, BASE_NONE, NULL, 0x0, |
5183 | 14 | "Fragment contained data past end of packet", HFILL } |
5184 | 14 | }, |
5185 | 14 | { &hf_ipv6_fragment_error, |
5186 | 14 | { "Defragmentation error", "ipv6.fragment.error", |
5187 | 14 | FT_FRAMENUM, BASE_NONE, NULL, 0x0, |
5188 | 14 | "Defragmentation error due to illegal fragments", HFILL } |
5189 | 14 | }, |
5190 | 14 | { &hf_ipv6_fragment_count, |
5191 | 14 | { "Fragment count", "ipv6.fragment.count", |
5192 | 14 | FT_UINT32, BASE_DEC, NULL, 0x0, |
5193 | 14 | NULL, HFILL } |
5194 | 14 | }, |
5195 | 14 | { &hf_ipv6_fragments, |
5196 | 14 | { "IPv6 Fragments", "ipv6.fragments", |
5197 | 14 | FT_NONE, BASE_NONE, NULL, 0x0, |
5198 | 14 | NULL, HFILL } |
5199 | 14 | }, |
5200 | 14 | { &hf_ipv6_reassembled_in, |
5201 | 14 | { "Reassembled IPv6 in frame", "ipv6.reassembled.in", |
5202 | 14 | FT_FRAMENUM, BASE_NONE, NULL, 0x0, |
5203 | 14 | "This IPv6 packet is reassembled in this frame", HFILL } |
5204 | 14 | }, |
5205 | 14 | { &hf_ipv6_reassembled_length, |
5206 | 14 | { "Reassembled IPv6 length", "ipv6.reassembled.length", |
5207 | 14 | FT_UINT32, BASE_DEC, NULL, 0x0, |
5208 | 14 | "The total length of the reassembled payload", HFILL } |
5209 | 14 | }, |
5210 | 14 | { &hf_ipv6_reassembled_data, |
5211 | 14 | { "Reassembled IPv6 data", "ipv6.reassembled.data", |
5212 | 14 | FT_BYTES, BASE_NONE, NULL, 0x0, |
5213 | 14 | "The reassembled payload", HFILL } |
5214 | 14 | } |
5215 | 14 | }; |
5216 | | |
5217 | 14 | static hf_register_info hf_ipv6_hopopts[] = { |
5218 | 14 | { &hf_ipv6_hopopts_nxt, |
5219 | 14 | { "Next Header", "ipv6.hopopts.nxt", |
5220 | 14 | FT_UINT8, BASE_DEC | BASE_EXT_STRING, &ipproto_val_ext, 0x0, |
5221 | 14 | NULL, HFILL } |
5222 | 14 | }, |
5223 | 14 | { &hf_ipv6_hopopts_len, |
5224 | 14 | { "Length", "ipv6.hopopts.len", |
5225 | 14 | FT_UINT8, BASE_DEC, NULL, 0x0, |
5226 | 14 | "Extension header length in 8-octet words (minus 1)", HFILL } |
5227 | 14 | }, |
5228 | 14 | { &hf_ipv6_hopopts_len_oct, |
5229 | 14 | { "Length", "ipv6.hopopts.len_oct", |
5230 | 14 | FT_UINT16, BASE_DEC|BASE_UNIT_STRING, UNS(&units_byte_bytes), 0x0, |
5231 | 14 | "Extension header length in octets", HFILL } |
5232 | 14 | } |
5233 | 14 | }; |
5234 | | |
5235 | 14 | static hf_register_info hf_ipv6_dstopts[] = { |
5236 | 14 | { &hf_ipv6_dstopts_nxt, |
5237 | 14 | { "Next Header", "ipv6.dstopts.nxt", |
5238 | 14 | FT_UINT8, BASE_DEC | BASE_EXT_STRING, &ipproto_val_ext, 0x0, |
5239 | 14 | NULL, HFILL } |
5240 | 14 | }, |
5241 | 14 | { &hf_ipv6_dstopts_len, |
5242 | 14 | { "Length", "ipv6.dstopts.len", |
5243 | 14 | FT_UINT8, BASE_DEC, NULL, 0x0, |
5244 | 14 | "Extension header length in 8-octet words (minus 1)", HFILL } |
5245 | 14 | }, |
5246 | 14 | { &hf_ipv6_dstopts_len_oct, |
5247 | 14 | { "Length", "ipv6.dstopts.len_oct", |
5248 | 14 | FT_UINT16, BASE_DEC|BASE_UNIT_STRING, UNS(&units_byte_bytes), 0x0, |
5249 | 14 | "Extension header length in octets", HFILL } |
5250 | 14 | } |
5251 | 14 | }; |
5252 | | |
5253 | 14 | static hf_register_info hf_ipv6_routing[] = { |
5254 | | |
5255 | | /* IPv6 Routing Header */ |
5256 | 14 | { &hf_ipv6_routing_nxt, |
5257 | 14 | { "Next Header", "ipv6.routing.nxt", |
5258 | 14 | FT_UINT8, BASE_DEC | BASE_EXT_STRING, &ipproto_val_ext, 0x0, |
5259 | 14 | NULL, HFILL } |
5260 | 14 | }, |
5261 | 14 | { &hf_ipv6_routing_len, |
5262 | 14 | { "Length", "ipv6.routing.len", |
5263 | 14 | FT_UINT8, BASE_DEC, NULL, 0x0, |
5264 | 14 | "Extension header length in 8-octet words (minus 1)", HFILL } |
5265 | 14 | }, |
5266 | 14 | { &hf_ipv6_routing_len_oct, |
5267 | 14 | { "Length", "ipv6.routing.len_oct", |
5268 | 14 | FT_UINT16, BASE_DEC|BASE_UNIT_STRING, UNS(&units_byte_bytes), 0x0, |
5269 | 14 | "Extension header length in octets", HFILL } |
5270 | 14 | }, |
5271 | 14 | { &hf_ipv6_routing_type, |
5272 | 14 | { "Type", "ipv6.routing.type", |
5273 | 14 | FT_UINT8, BASE_DEC, VALS(routing_header_type), 0x0, |
5274 | 14 | "Routing Header Type", HFILL } |
5275 | 14 | }, |
5276 | 14 | { &hf_ipv6_routing_segleft, |
5277 | 14 | { "Segments Left", "ipv6.routing.segleft", |
5278 | 14 | FT_UINT8, BASE_DEC, NULL, 0x0, |
5279 | 14 | "Routing Header Segments Left", HFILL } |
5280 | 14 | }, |
5281 | 14 | { &hf_ipv6_routing_unknown_data, |
5282 | 14 | { "Type-Specific Data", "ipv6.routing.unknown_data", |
5283 | 14 | FT_BYTES, BASE_NONE, NULL, 0x0, |
5284 | 14 | "Unknown routing header type-specific data", HFILL } |
5285 | 14 | }, |
5286 | | |
5287 | | /* Source Routing Header */ |
5288 | 14 | { &hf_ipv6_routing_src_reserved, |
5289 | 14 | { "Reserved", "ipv6.routing.src.reserved", |
5290 | 14 | FT_BYTES, BASE_NONE, NULL, 0x0, |
5291 | 14 | "Must be zero", HFILL } |
5292 | 14 | }, |
5293 | 14 | { &hf_ipv6_routing_src_addr, |
5294 | 14 | { "Address", "ipv6.routing.src.addr", |
5295 | 14 | FT_IPv6, BASE_NONE, NULL, 0x0, |
5296 | 14 | "Source Routing Header Address", HFILL }}, |
5297 | | |
5298 | | /* Mobile IPv6 */ |
5299 | 14 | { &hf_ipv6_routing_mipv6_reserved, |
5300 | 14 | { "Reserved", "ipv6.routing.mipv6.reserved", |
5301 | 14 | FT_BYTES, BASE_NONE, NULL, 0x0, |
5302 | 14 | "Must be zero", HFILL } |
5303 | 14 | }, |
5304 | 14 | { &hf_ipv6_routing_mipv6_home_address, |
5305 | 14 | { "Home Address", "ipv6.routing.mipv6.home_address", |
5306 | 14 | FT_IPv6, BASE_NONE, NULL, 0x0, |
5307 | 14 | NULL, HFILL } |
5308 | 14 | }, |
5309 | | |
5310 | | /* RPL Routing Header */ |
5311 | 14 | { &hf_ipv6_routing_rpl_cmprI, |
5312 | 14 | { "Compressed Internal Octets (CmprI)", "ipv6.routing.rpl.cmprI", |
5313 | 14 | FT_UINT32, BASE_DEC, NULL, IP6RRPL_BITMASK_CMPRI, |
5314 | 14 | "Elided octets from all but last segment", HFILL } |
5315 | 14 | }, |
5316 | 14 | { &hf_ipv6_routing_rpl_cmprE, |
5317 | 14 | { "Compressed Final Octets (CmprE)", "ipv6.routing.rpl.cmprE", |
5318 | 14 | FT_UINT32, BASE_DEC, NULL, IP6RRPL_BITMASK_CMPRE, |
5319 | 14 | "Elided octets from last segment address", HFILL } |
5320 | 14 | }, |
5321 | 14 | { &hf_ipv6_routing_rpl_pad, |
5322 | 14 | { "Padding Bytes", "ipv6.routing.rpl.pad", |
5323 | 14 | FT_UINT32, BASE_DEC, NULL, IP6RRPL_BITMASK_PAD, |
5324 | 14 | NULL, HFILL } |
5325 | 14 | }, |
5326 | 14 | { &hf_ipv6_routing_rpl_reserved, |
5327 | 14 | { "Reserved", "ipv6.routing.rpl.reserved", |
5328 | 14 | FT_UINT32, BASE_DEC, NULL, IP6RRPL_BITMASK_RESERVED, |
5329 | 14 | "Must be zero", HFILL } |
5330 | 14 | }, |
5331 | 14 | { &hf_ipv6_routing_rpl_addr_count, |
5332 | 14 | { "Total Address Count", "ipv6.routing.rpl.addr_count", |
5333 | 14 | FT_INT32, BASE_DEC, NULL, 0, |
5334 | 14 | NULL, HFILL } |
5335 | 14 | }, |
5336 | 14 | { &hf_ipv6_routing_rpl_addr, |
5337 | 14 | { "Address", "ipv6.routing.rpl.address", |
5338 | 14 | FT_BYTES, BASE_NONE, NULL, 0, |
5339 | 14 | NULL, HFILL } |
5340 | 14 | }, |
5341 | 14 | { &hf_ipv6_routing_rpl_fulladdr, |
5342 | 14 | { "Full Address", "ipv6.routing.rpl.full_address", |
5343 | 14 | FT_IPv6, BASE_NONE, NULL, 0, |
5344 | 14 | "Uncompressed IPv6 Address", HFILL } |
5345 | 14 | }, |
5346 | | |
5347 | | /* Segment Routing Header */ |
5348 | 14 | { &hf_ipv6_routing_srh_last_entry, |
5349 | 14 | { "Last Entry", "ipv6.routing.srh.last_entry", |
5350 | 14 | FT_UINT8, BASE_DEC, NULL, 0x0, |
5351 | 14 | "Index (zero based) of the last element of the Segment List", HFILL } |
5352 | 14 | }, |
5353 | 14 | { &hf_ipv6_routing_srh_flags, |
5354 | 14 | { "Flags", "ipv6.routing.srh.flags", |
5355 | 14 | FT_UINT8, BASE_HEX, NULL, 0x0, |
5356 | 14 | "Unused, 8 bits of flags", HFILL } |
5357 | 14 | }, |
5358 | 14 | { &hf_ipv6_routing_srh_tag, |
5359 | 14 | { "Tag", "ipv6.routing.srh.tag", |
5360 | 14 | FT_BYTES, BASE_NONE, NULL, 0x0, |
5361 | 14 | "Tag a packet as part of a class or group of packets", HFILL } |
5362 | 14 | }, |
5363 | 14 | { &hf_ipv6_routing_srh_addr, |
5364 | 14 | { "Address", "ipv6.routing.srh.addr", |
5365 | 14 | FT_IPv6, BASE_NONE, NULL, 0x0, |
5366 | 14 | "Segment address", HFILL } |
5367 | 14 | }, |
5368 | | |
5369 | | /* Compact Routing Header */ |
5370 | 14 | { &hf_ipv6_routing_crh16_current_sid, |
5371 | 14 | { "Current SID", "ipv6.routing.crh16.current_sid", |
5372 | 14 | FT_UINT16, BASE_DEC, NULL, 0x0, |
5373 | 14 | "Value of the current Segment ID", HFILL } |
5374 | 14 | }, |
5375 | 14 | { &hf_ipv6_routing_crh32_current_sid, |
5376 | 14 | { "Current SID", "ipv6.routing.crh32.current_sid", |
5377 | 14 | FT_UINT32, BASE_DEC, NULL, 0x0, |
5378 | 14 | "Value of the current Segment ID", HFILL } |
5379 | 14 | }, |
5380 | 14 | { &hf_ipv6_routing_crh16_segment_id, |
5381 | 14 | { "Segment ID", "ipv6.routing.crh16.sid", |
5382 | 14 | FT_UINT16, BASE_DEC, NULL, 0x0, |
5383 | 14 | "Segment address", HFILL } |
5384 | 14 | }, |
5385 | 14 | { &hf_ipv6_routing_crh32_segment_id, |
5386 | 14 | { "Segment ID", "ipv6.routing.crh32.sid", |
5387 | 14 | FT_UINT32, BASE_DEC, NULL, 0x0, |
5388 | 14 | "Segment address", HFILL } |
5389 | 14 | } |
5390 | 14 | }; |
5391 | | |
5392 | 14 | static hf_register_info hf_ipv6_fraghdr[] = { |
5393 | 14 | { &hf_ipv6_fraghdr_nxt, |
5394 | 14 | { "Next header", "ipv6.fraghdr.nxt", |
5395 | 14 | FT_UINT8, BASE_DEC | BASE_EXT_STRING, &ipproto_val_ext, 0x0, |
5396 | 14 | NULL, HFILL } |
5397 | 14 | }, |
5398 | 14 | { &hf_ipv6_fraghdr_reserved_octet, |
5399 | 14 | { "Reserved octet", "ipv6.fraghdr.reserved_octet", |
5400 | 14 | FT_UINT8, BASE_HEX, NULL, 0x0, |
5401 | 14 | "Should always be 0", HFILL } |
5402 | 14 | }, |
5403 | 14 | { &hf_ipv6_fraghdr_offset, |
5404 | 14 | { "Offset", "ipv6.fraghdr.offset", |
5405 | 14 | FT_UINT16, BASE_DEC, NULL, IP6F_OFF_MASK, |
5406 | 14 | "Fragment Offset", HFILL } |
5407 | 14 | }, |
5408 | 14 | { &hf_ipv6_fraghdr_reserved_bits, |
5409 | 14 | { "Reserved bits", "ipv6.fraghdr.reserved_bits", |
5410 | 14 | FT_UINT16, BASE_DEC, NULL, IP6F_RESERVED_MASK, |
5411 | 14 | NULL, HFILL } |
5412 | 14 | }, |
5413 | 14 | { &hf_ipv6_fraghdr_more, |
5414 | 14 | { "More Fragments", "ipv6.fraghdr.more", |
5415 | 14 | FT_BOOLEAN, 16, TFS(&tfs_yes_no), IP6F_MORE_FRAG, |
5416 | 14 | NULL, HFILL } |
5417 | 14 | }, |
5418 | 14 | { &hf_ipv6_fraghdr_ident, |
5419 | 14 | { "Identification", "ipv6.fraghdr.ident", |
5420 | 14 | FT_UINT32, BASE_HEX, NULL, 0x0, |
5421 | 14 | "Fragment Identification", HFILL } |
5422 | 14 | } |
5423 | 14 | }; |
5424 | | |
5425 | 14 | static int *ett_ipv6[] = { |
5426 | 14 | &ett_ipv6_proto, |
5427 | 14 | &ett_ipv6_detail, |
5428 | 14 | &ett_ipv6_detail_special_purpose, |
5429 | 14 | &ett_ipv6_multicast_flags, |
5430 | 14 | &ett_ipv6_traffic_class, |
5431 | 14 | &ett_geoip_info, |
5432 | 14 | &ett_ipv6_opt, |
5433 | 14 | &ett_ipv6_opt_type, |
5434 | 14 | &ett_ipv6_opt_rpl, |
5435 | 14 | &ett_ipv6_opt_mpl, |
5436 | 14 | &ett_ipv6_opt_dff_flags, |
5437 | 14 | &ett_ipv6_opt_ioam_trace_flags, |
5438 | 14 | &ett_ipv6_opt_ioam_trace_types, |
5439 | 14 | &ett_ipv6_opt_ioam_dex_extflags, |
5440 | 14 | &ett_ipv6_fragment, |
5441 | 14 | &ett_ipv6_fragments |
5442 | 14 | }; |
5443 | | |
5444 | 14 | static int *ett_ipv6_hopopts[] = { |
5445 | 14 | &ett_ipv6_hopopts_proto |
5446 | 14 | }; |
5447 | | |
5448 | 14 | static int *ett_ipv6_routing[] = { |
5449 | 14 | &ett_ipv6_routing_proto, |
5450 | 14 | &ett_ipv6_routing_srh_vect |
5451 | 14 | }; |
5452 | | |
5453 | 14 | static int *ett_ipv6_fraghdr[] = { |
5454 | 14 | &ett_ipv6_fraghdr_proto |
5455 | 14 | }; |
5456 | | |
5457 | 14 | static int *ett_ipv6_dstopts[] = { |
5458 | 14 | &ett_ipv6_dstopts_proto |
5459 | 14 | }; |
5460 | | |
5461 | 14 | static ei_register_info ei_ipv6[] = { |
5462 | 14 | { &ei_ipv6_opt_jumbo_missing, |
5463 | 14 | { "ipv6.opt.jumbo.missing", PI_MALFORMED, PI_ERROR, |
5464 | 14 | "IPv6 payload length equals 0 and Hop-By-Hop present and Jumbo Payload option missing", EXPFILL } |
5465 | 14 | }, |
5466 | 14 | { &ei_ipv6_opt_jumbo_prohibited, |
5467 | 14 | { "ipv6.opt.jumbo.prohibited", PI_PROTOCOL, PI_WARN, |
5468 | 14 | "When IPv6 payload length does not equal 0 a Jumbo Payload option must not be present", EXPFILL } |
5469 | 14 | }, |
5470 | 14 | { &ei_ipv6_opt_jumbo_truncated, |
5471 | 14 | { "ipv6.opt.jumbo.truncated", PI_PROTOCOL, PI_WARN, |
5472 | 14 | "Jumbo Payload option present and jumbo length < 65536", EXPFILL } |
5473 | 14 | }, |
5474 | 14 | { &ei_ipv6_opt_jumbo_fragment, |
5475 | 14 | { "ipv6.opt.jumbo.fragment", PI_PROTOCOL, PI_WARN, |
5476 | 14 | "Jumbo Payload option cannot be used with a fragment header", EXPFILL } |
5477 | 14 | }, |
5478 | 14 | { &ei_ipv6_opt_invalid_len, |
5479 | 14 | { "ipv6.opt.invalid_len", PI_MALFORMED, PI_ERROR, |
5480 | 14 | "Invalid IPv6 option length", EXPFILL } |
5481 | 14 | }, |
5482 | 14 | { &ei_ipv6_opt_apn_invalid_id_type, |
5483 | 14 | { "ipv6.opt.apn.invalid.id_type", PI_MALFORMED, PI_ERROR, |
5484 | 14 | "Invalid APN ID Type", EXPFILL } |
5485 | 14 | }, |
5486 | 14 | { &ei_ipv6_opt_unknown_data, |
5487 | 14 | { "ipv6.opt.unknown_data.expert", PI_UNDECODED, PI_NOTE, |
5488 | 14 | "Unknown Data (not interpreted)", EXPFILL } |
5489 | 14 | }, |
5490 | 14 | { &ei_ipv6_plen_exceeds_framing, |
5491 | 14 | { "ipv6.plen_exceeds_framing", PI_PROTOCOL, PI_WARN, |
5492 | 14 | "IPv6 payload length does not match expected framing length", EXPFILL } |
5493 | 14 | }, |
5494 | 14 | { &ei_ipv6_plen_zero, |
5495 | 14 | { "ipv6.plen_zero", PI_PROTOCOL, PI_CHAT, |
5496 | 14 | "IPv6 payload length equals 0 (maybe because of \"TCP segmentation offload\" (TSO))", EXPFILL } |
5497 | 14 | }, |
5498 | 14 | { &ei_ipv6_bogus_ipv6_version, |
5499 | 14 | { "ipv6.bogus_ipv6_version", PI_MALFORMED, PI_ERROR, |
5500 | 14 | "Bogus IP version", EXPFILL } |
5501 | 14 | }, |
5502 | 14 | { &ei_ipv6_invalid_header, |
5503 | 14 | { "ipv6.invalid_header", PI_MALFORMED, PI_ERROR, |
5504 | 14 | "Invalid IPv6 header", EXPFILL } |
5505 | 14 | }, |
5506 | 14 | { &ei_ipv6_opt_header_mismatch, |
5507 | 14 | { "ipv6.opt.header_mismatch", PI_PROTOCOL, PI_WARN, |
5508 | 14 | "Wrong options extension header for type", EXPFILL } |
5509 | 14 | }, |
5510 | 14 | { &ei_ipv6_opt_deprecated, |
5511 | 14 | { "ipv6.opt.deprecated", PI_DEPRECATED, PI_NOTE, |
5512 | 14 | "Option type is deprecated", EXPFILL } |
5513 | 14 | }, |
5514 | 14 | { &ei_ipv6_opt_mpl_ipv6_src_seed_id, |
5515 | 14 | { "ipv6.opt.mpl.ipv6_src_seed_id", PI_PROTOCOL, PI_COMMENT, |
5516 | 14 | "Seed ID is the IPv6 Source Address", EXPFILL } |
5517 | 14 | }, |
5518 | 14 | { &ei_ipv6_opt_ioam_invalid_nodelen, |
5519 | 14 | { "ipv6.opt.ioam.trace.invalid_nodelen", PI_PROTOCOL, PI_ERROR, |
5520 | 14 | "Invalid \"NodeLen\" value: cannot be 0", EXPFILL } |
5521 | 14 | }, |
5522 | 14 | { &ei_ipv6_opt_ioam_invalid_remlen, |
5523 | 14 | { "ipv6.opt.ioam.trace.invalid_remlen", PI_PROTOCOL, PI_ERROR, |
5524 | 14 | "Invalid \"RemLen\" value", EXPFILL } |
5525 | 14 | }, |
5526 | 14 | { &ei_ipv6_opt_ioam_invalid_trace_type, |
5527 | 14 | { "ipv6.opt.ioam.trace.invalid_type", PI_PROTOCOL, PI_ERROR, |
5528 | 14 | "Mismatch between Trace Type and NodeLen", EXPFILL } |
5529 | 14 | }, |
5530 | 14 | { &ei_ipv6_embed_ipv4_u_value, |
5531 | 14 | { "ipv6.embed_ipv4.u.nonzero", PI_PROTOCOL, PI_WARN, |
5532 | 14 | "IPv4-Embedded IPv6 address bit 64 to 71 must be zero", EXPFILL } |
5533 | 14 | }, |
5534 | 14 | { &ei_ipv6_dst_addr_not_unspecified, |
5535 | 14 | { "ipv6.addr.not_unspecified", PI_PROTOCOL, PI_WARN, |
5536 | 14 | "Unspecified address cannot appear as a destination", EXPFILL } |
5537 | 14 | } |
5538 | 14 | }; |
5539 | | |
5540 | 14 | static ei_register_info ei_ipv6_hopopts[] = { |
5541 | 14 | { &ei_ipv6_hopopts_not_first, |
5542 | 14 | { "ipv6.hopopts.not_first", PI_PROTOCOL, PI_ERROR, |
5543 | 14 | "IPv6 Hop-by-Hop extension header must appear immediately after IPv6 header", EXPFILL } |
5544 | 14 | } |
5545 | 14 | }; |
5546 | | |
5547 | 14 | static ei_register_info ei_ipv6_routing[] = { |
5548 | 14 | { &ei_ipv6_src_addr_not_multicast, |
5549 | 14 | { "ipv6.src_addr.not_multicast", PI_PROTOCOL, PI_WARN, |
5550 | 14 | "Source address must not be a multicast address", EXPFILL } |
5551 | 14 | }, |
5552 | 14 | { &ei_ipv6_dst_addr_not_multicast, |
5553 | 14 | { "ipv6.dst_addr.not_multicast", PI_PROTOCOL, PI_WARN, |
5554 | 14 | "Destination address must not be a multicast address", EXPFILL } |
5555 | 14 | }, |
5556 | 14 | { &ei_ipv6_src_route_list_mult_inst_same_addr, |
5557 | 14 | { "ipv6.src_route_list.mult_inst_same_addr", PI_PROTOCOL, PI_WARN, |
5558 | 14 | "Multiple instances of the same address must not appear in the source route list", EXPFILL } |
5559 | 14 | }, |
5560 | 14 | { &ei_ipv6_src_route_list_src_addr, |
5561 | 14 | { "ipv6.src_route_list.src_addr", PI_PROTOCOL, PI_WARN, |
5562 | 14 | "Source address must not appear in the source route list", EXPFILL } |
5563 | 14 | }, |
5564 | 14 | { &ei_ipv6_src_route_list_dst_addr, |
5565 | 14 | { "ipv6.src_route_list.dst_addr", PI_PROTOCOL, PI_WARN, |
5566 | 14 | "Destination address must not appear in the source route list", EXPFILL } |
5567 | 14 | }, |
5568 | 14 | { &ei_ipv6_src_route_list_multicast_addr, |
5569 | 14 | { "ipv6.src_route_list.multicast_addr", PI_PROTOCOL, PI_WARN, |
5570 | 14 | "Multicast addresses must not appear in the source route list", EXPFILL } |
5571 | 14 | }, |
5572 | 14 | { &ei_ipv6_routing_rpl_cmpri_cmpre_pad, |
5573 | 14 | { "ipv6.routing.rpl.cmprI_cmprE_pad", PI_PROTOCOL, PI_WARN, |
5574 | 14 | "When cmprI equals 0 and cmprE equals 0, pad MUST equal 0 but instead was X", EXPFILL } |
5575 | 14 | }, |
5576 | 14 | { &ei_ipv6_routing_rpl_addr_count_ge0, |
5577 | 14 | { "ipv6.routing.rpl.addr_count_ge0", PI_MALFORMED, PI_ERROR, |
5578 | 14 | "Calculated total address count must be greater than or equal to 0, instead was X", EXPFILL } |
5579 | 14 | }, |
5580 | 14 | { &ei_ipv6_routing_rpl_reserved, |
5581 | 14 | { "ipv6.routing.rpl.reserved_not0", PI_PROTOCOL, PI_NOTE, |
5582 | 14 | "Reserved field must equal 0 but instead was X", EXPFILL } |
5583 | 14 | }, |
5584 | 14 | { &ei_ipv6_routing_invalid_length, |
5585 | 14 | { "ipv6.routing.invalid_length", PI_MALFORMED, PI_ERROR, |
5586 | 14 | "Invalid IPv6 Routing header length", EXPFILL } |
5587 | 14 | }, |
5588 | 14 | { &ei_ipv6_routing_invalid_segleft, |
5589 | 14 | { "ipv6.routing.invalid_segleft", PI_PROTOCOL, PI_WARN, |
5590 | 14 | "IPv6 Routing Header segments left field must not exceed address count", EXPFILL } |
5591 | 14 | }, |
5592 | 14 | { &ei_ipv6_routing_undecoded, |
5593 | 14 | { "ipv6.routing.undecoded", PI_UNDECODED, PI_NOTE, |
5594 | 14 | "Undecoded IPv6 routing header field", EXPFILL } |
5595 | 14 | }, |
5596 | 14 | { &ei_ipv6_routing_deprecated, |
5597 | 14 | { "ipv6.routing.deprecated", PI_DEPRECATED, PI_NOTE, |
5598 | 14 | "Routing header type is deprecated", EXPFILL } |
5599 | 14 | } |
5600 | 14 | }; |
5601 | | |
5602 | | /* Decode As handling */ |
5603 | 14 | static build_valid_func ipv6_da_build_value[1] = {ipv6_value}; |
5604 | 14 | static decode_as_value_t ipv6_da_values = {ipv6_prompt, 1, ipv6_da_build_value}; |
5605 | | |
5606 | 14 | static decode_as_t ipv6_da = {"ipv6", "ip.proto", 1, 0, &ipv6_da_values, NULL, NULL, |
5607 | 14 | decode_as_default_populate_list, decode_as_default_reset, decode_as_default_change, NULL, NULL, NULL }; |
5608 | | |
5609 | 14 | static decode_as_t ipv6_hopopts_da = {"ipv6.hopopts", "ip.proto", 1, 0, &ipv6_da_values, NULL, NULL, |
5610 | 14 | decode_as_default_populate_list, decode_as_default_reset, decode_as_default_change, NULL, NULL, NULL }; |
5611 | | |
5612 | 14 | static decode_as_t ipv6_routing_da = {"ipv6.routing", "ip.proto", 1, 0, &ipv6_da_values, NULL, NULL, |
5613 | 14 | decode_as_default_populate_list, decode_as_default_reset, decode_as_default_change, NULL, NULL, NULL }; |
5614 | | |
5615 | 14 | static decode_as_t ipv6_fraghdr_da = {"ipv6.fraghdr", "ip.proto", 1, 0, &ipv6_da_values, NULL, NULL, |
5616 | 14 | decode_as_default_populate_list, decode_as_default_reset, decode_as_default_change, NULL, NULL, NULL }; |
5617 | | |
5618 | 14 | static decode_as_t ipv6_dstopts_da = {"ipv6.dstopts", "ip.proto", 1, 0, &ipv6_da_values, NULL, NULL, |
5619 | 14 | decode_as_default_populate_list, decode_as_default_reset, decode_as_default_change, NULL, NULL, NULL }; |
5620 | | |
5621 | 14 | module_t *ipv6_module; |
5622 | 14 | expert_module_t* expert_ipv6; |
5623 | 14 | expert_module_t* expert_ipv6_hopopts; |
5624 | 14 | expert_module_t* expert_ipv6_routing; |
5625 | | |
5626 | 14 | proto_ipv6 = proto_register_protocol("Internet Protocol Version 6", "IPv6", "ipv6"); |
5627 | 14 | proto_register_field_array(proto_ipv6, hf_ipv6, array_length(hf_ipv6)); |
5628 | 14 | proto_register_subtree_array(ett_ipv6, array_length(ett_ipv6)); |
5629 | 14 | expert_ipv6 = expert_register_protocol(proto_ipv6); |
5630 | 14 | expert_register_field_array(expert_ipv6, ei_ipv6, array_length(ei_ipv6)); |
5631 | | |
5632 | 14 | proto_ipv6_hopopts = proto_register_protocol("IPv6 Hop-by-Hop Option", "IPv6 Hop-by-Hop", "ipv6.hopopts"); |
5633 | 14 | proto_register_field_array(proto_ipv6_hopopts, hf_ipv6_hopopts, array_length(hf_ipv6_hopopts)); |
5634 | 14 | proto_register_subtree_array(ett_ipv6_hopopts, array_length(ett_ipv6_hopopts)); |
5635 | 14 | expert_ipv6_hopopts = expert_register_protocol(proto_ipv6_hopopts); |
5636 | 14 | expert_register_field_array(expert_ipv6_hopopts, ei_ipv6_hopopts, array_length(ei_ipv6_hopopts)); |
5637 | | |
5638 | 14 | proto_ipv6_routing = proto_register_protocol("Routing Header for IPv6", "IPv6 Routing", "ipv6.routing"); |
5639 | 14 | proto_register_field_array(proto_ipv6_routing, hf_ipv6_routing, array_length(hf_ipv6_routing)); |
5640 | 14 | proto_register_subtree_array(ett_ipv6_routing, array_length(ett_ipv6_routing)); |
5641 | 14 | expert_ipv6_routing = expert_register_protocol(proto_ipv6_routing); |
5642 | 14 | expert_register_field_array(expert_ipv6_routing, ei_ipv6_routing, array_length(ei_ipv6_routing)); |
5643 | | |
5644 | 14 | ipv6_routing_dissector_table = register_dissector_table("ipv6.routing.type", "IPv6 Routing Type", |
5645 | 14 | proto_ipv6_routing, FT_UINT8, BASE_DEC); |
5646 | | |
5647 | 14 | proto_ipv6_routing_rt0 = proto_register_protocol_in_name_only("IPv6 Routing Type - Source Route", "Source Route", "ipv6.routing.type.rt0", proto_ipv6, FT_BYTES); |
5648 | 14 | proto_ipv6_routing_mipv6 = proto_register_protocol_in_name_only("IPv6 Routing Type - Type 2", "Type 2", "ipv6.routing.type.mipv6", proto_ipv6, FT_BYTES); |
5649 | 14 | proto_ipv6_routing_rpl = proto_register_protocol_in_name_only("IPv6 Routing Type - RPL Source Route", "RPL Source Route", "ipv6.routing.type.mipv6", proto_ipv6, FT_BYTES); |
5650 | 14 | proto_ipv6_routing_srh = proto_register_protocol_in_name_only("IPv6 Routing Types - Segment Routing", "Segment Routing", "ipv6.routing.type.srh", proto_ipv6, FT_BYTES); |
5651 | 14 | proto_ipv6_routing_crh = proto_register_protocol_in_name_only("IPv6 Routing Types - Compact Routing", "Compact Routing", "ipv6.routing.type.crh", proto_ipv6, FT_BYTES); |
5652 | | |
5653 | 14 | proto_ipv6_fraghdr = proto_register_protocol("Fragment Header for IPv6", "IPv6 Fragment", "ipv6.fraghdr"); |
5654 | 14 | proto_register_field_array(proto_ipv6_fraghdr, hf_ipv6_fraghdr, array_length(hf_ipv6_fraghdr)); |
5655 | 14 | proto_register_subtree_array(ett_ipv6_fraghdr, array_length(ett_ipv6_fraghdr)); |
5656 | | |
5657 | 14 | proto_ipv6_dstopts = proto_register_protocol("Destination Options for IPv6", "IPv6 Destination", "ipv6.dstopts"); |
5658 | 14 | proto_register_field_array(proto_ipv6_dstopts, hf_ipv6_dstopts, array_length(hf_ipv6_dstopts)); |
5659 | 14 | proto_register_subtree_array(ett_ipv6_dstopts, array_length(ett_ipv6_dstopts)); |
5660 | | |
5661 | | /* Register configuration options */ |
5662 | 14 | ipv6_module = prefs_register_protocol(proto_ipv6, NULL); |
5663 | 14 | prefs_register_bool_preference(ipv6_module, "defragment", |
5664 | 14 | "Reassemble fragmented IPv6 datagrams", |
5665 | 14 | "Whether fragmented IPv6 datagrams should be reassembled", |
5666 | 14 | &ipv6_reassemble); |
5667 | 14 | prefs_register_bool_preference(ipv6_module, "summary_in_tree", |
5668 | 14 | "Show IPv6 summary in protocol tree", |
5669 | 14 | "Whether the IPv6 summary line should be shown in the protocol tree", |
5670 | 14 | &ipv6_summary_in_tree); |
5671 | 14 | prefs_register_bool_preference(ipv6_module, "address_detail" , |
5672 | 14 | "Show details about IPv6 addresses", |
5673 | 14 | "Whether to show extended information about IPv6 addresses", |
5674 | 14 | &ipv6_address_detail); |
5675 | | |
5676 | 14 | prefs_register_obsolete_preference(ipv6_module, "use_geoip"); |
5677 | | |
5678 | | /* RPL Strict Header Checking */ |
5679 | 14 | prefs_register_bool_preference(ipv6_module, "perform_strict_rpl_srh_rfc_checking", |
5680 | 14 | "Perform strict checking for RPL Source Routing Headers (RFC 6554)", |
5681 | 14 | "Check that all RPL Source Routed packets conform to RFC 6554 and do not visit a node more than once", |
5682 | 14 | &g_ipv6_rpl_srh_strict_rfc_checking); |
5683 | | |
5684 | 14 | prefs_register_bool_preference(ipv6_module, "try_heuristic_first", |
5685 | 14 | "Try heuristic sub-dissectors first", |
5686 | 14 | "Try to decode a packet using an heuristic sub-dissector before using a sub-dissector registered to a specific port", |
5687 | 14 | &try_heuristic_first); |
5688 | | |
5689 | 14 | prefs_register_bool_preference(ipv6_module, "exthdr_under_root_protocol_tree", |
5690 | 14 | "Display IPv6 extension headers under the root protocol tree", |
5691 | 14 | "Whether to display IPv6 extension headers as a separate protocol or a sub-protocol of the IPv6 packet", |
5692 | 14 | &ipv6_exthdr_under_root); |
5693 | | |
5694 | 14 | prefs_register_bool_preference(ipv6_module, "exthdr_hide_len_oct_field", |
5695 | 14 | "Use a single field for IPv6 extension header length", |
5696 | 14 | "If enabled the Length field in octets will be hidden", |
5697 | 14 | &ipv6_exthdr_hide_len_oct_field); |
5698 | | |
5699 | 14 | prefs_register_bool_preference(ipv6_module, "tso_support", |
5700 | 14 | "Support packet-capture from IPv6 TSO-enabled hardware", |
5701 | 14 | "Whether to correct for TSO-enabled (TCP segmentation offload) hardware " |
5702 | 14 | "captures, such as spoofing the IPv6 packet length", &ipv6_tso_supported); |
5703 | | |
5704 | 14 | prefs_register_static_text_preference(ipv6_module, "text_use_geoip" , |
5705 | 14 | "IP geolocation settings can be changed in the Name Resolution preferences", |
5706 | 14 | "IP geolocation settings can be changed in the Name Resolution preferences"); |
5707 | | |
5708 | 14 | prefs_register_bool_preference(ipv6_module, "conv_id", |
5709 | 14 | "Assign IPv6 conversation IDs", |
5710 | 14 | "Whether to assign unique numbers to each IPv6 conversation (increases resource consumption)", |
5711 | 14 | &ipv6_track_conv_id); |
5712 | | |
5713 | 14 | static uat_field_t nat64_uats_flds[] = { |
5714 | 14 | UAT_FLD_CSTRING_OTHER(nat64_prefix_uats, ipaddr, "NAT64 Prefix", nat64_prefix_uat_fld_ip_chk_cb, "IPv6 prefix address"), |
5715 | 14 | UAT_FLD_VS(nat64_prefix_uats, prefix_len, "Prefix length", nat64_prefix_length_vals, "IPv6 prefix address length"), |
5716 | 14 | UAT_FLD_VS(nat64_prefix_uats, prefix_wildcard_len, "Prefix wildcard length", nat64_prefix_wildcard_length_vals, "IPv6 prefix address wildcard length"), |
5717 | 14 | UAT_END_FIELDS |
5718 | 14 | }; |
5719 | | |
5720 | 14 | nat64_prefix_uat = uat_new("NAT64 Network-Specific Prefixes", |
5721 | 14 | sizeof(struct nat64_prefix_data), |
5722 | 14 | "NAT64_NSP_list", /* filename */ |
5723 | 14 | true, /* from_profile */ |
5724 | 14 | &nat64_prefix_uats, /* data_ptr */ |
5725 | 14 | &number_of_nat64_prefix, /* numitems_ptr */ |
5726 | 14 | UAT_AFFECTS_DISSECTION, |
5727 | 14 | NULL, |
5728 | 14 | nat64_prefix_copy_cb, |
5729 | 14 | NULL, |
5730 | 14 | nat64_prefix_free_cb, |
5731 | 14 | NULL, |
5732 | 14 | NULL, |
5733 | 14 | nat64_uats_flds); |
5734 | | |
5735 | 14 | prefs_register_uat_preference(ipv6_module, "nat64_prefixes", |
5736 | 14 | "NAT64 Prefixes", |
5737 | 14 | "A list of IPv6 prefixes used for NAT64s", |
5738 | 14 | nat64_prefix_uat); |
5739 | | |
5740 | 14 | register_init_routine(ipv6_init); |
5741 | | |
5742 | 14 | ipv6_handle = register_dissector("ipv6", dissect_ipv6, proto_ipv6); |
5743 | 14 | reassembly_table_register(&ipv6_reassembly_table, |
5744 | 14 | &addresses_reassembly_table_functions); |
5745 | 14 | ipv6_tap = register_tap("ipv6"); |
5746 | | |
5747 | 14 | register_decode_as(&ipv6_da); |
5748 | 14 | register_decode_as(&ipv6_hopopts_da); |
5749 | 14 | register_decode_as(&ipv6_routing_da); |
5750 | 14 | register_decode_as(&ipv6_fraghdr_da); |
5751 | 14 | register_decode_as(&ipv6_dstopts_da); |
5752 | | |
5753 | 14 | register_conversation_table(proto_ipv6, true, ipv6_conversation_packet, ipv6_endpoint_packet); |
5754 | 14 | register_conversation_filter("ipv6", "IPv6", ipv6_filter_valid, ipv6_build_filter, NULL); |
5755 | | |
5756 | 14 | register_capture_dissector("ipv6", capture_ipv6, proto_ipv6); |
5757 | 14 | } |
5758 | | |
5759 | | void |
5760 | | proto_reg_handoff_ipv6(void) |
5761 | 14 | { |
5762 | 14 | dissector_handle_t ipv6_hopopts_handle; |
5763 | 14 | dissector_handle_t ipv6_routing_handle; |
5764 | 14 | dissector_handle_t ipv6_fraghdr_handle; |
5765 | 14 | dissector_handle_t ipv6_dstopts_handle; |
5766 | 14 | capture_dissector_handle_t ipv6_cap_handle; |
5767 | 14 | capture_dissector_handle_t ipv6_ext_cap_handle; |
5768 | 14 | dissector_handle_t h; |
5769 | | |
5770 | 14 | dissector_add_uint("ethertype", ETHERTYPE_IPv6, ipv6_handle); |
5771 | 14 | dissector_add_uint("erf.types.type", ERF_TYPE_IPV6, ipv6_handle); |
5772 | 14 | dissector_add_uint("ppp.protocol", PPP_IPV6, ipv6_handle); |
5773 | 14 | dissector_add_uint("ppp.protocol", ETHERTYPE_IPv6, ipv6_handle); |
5774 | 14 | dissector_add_uint("gre.proto", ETHERTYPE_IPv6, ipv6_handle); |
5775 | 14 | dissector_add_uint("ip.proto", IP_PROTO_IPV6, ipv6_handle); |
5776 | 14 | dissector_add_uint("null.type", BSD_AF_INET6_BSD, ipv6_handle); |
5777 | 14 | dissector_add_uint("null.type", BSD_AF_INET6_FREEBSD, ipv6_handle); |
5778 | 14 | dissector_add_uint("null.type", BSD_AF_INET6_DARWIN, ipv6_handle); |
5779 | 14 | dissector_add_uint("chdlc.protocol", ETHERTYPE_IPv6, ipv6_handle); |
5780 | 14 | dissector_add_uint("fr.nlpid", NLPID_IP6, ipv6_handle); |
5781 | 14 | dissector_add_uint("osinl.excl", NLPID_IP6, ipv6_handle); |
5782 | 14 | dissector_add_uint("x.25.spi", NLPID_IP6, ipv6_handle); |
5783 | 14 | dissector_add_uint("arcnet.protocol_id", ARCNET_PROTO_IPv6, ipv6_handle); |
5784 | 14 | dissector_add_uint("juniper.proto", JUNIPER_PROTO_IP6, ipv6_handle); |
5785 | 14 | dissector_add_uint("juniper.proto", JUNIPER_PROTO_MPLS_IP6, ipv6_handle); |
5786 | 14 | dissector_add_uint("pwach.channel_type", PW_ACH_TYPE_IPV6, ipv6_handle); |
5787 | 14 | dissector_add_uint("mcc.proto", PW_ACH_TYPE_IPV6, ipv6_handle); |
5788 | 14 | dissector_add_uint("sflow_245.header_protocol", SFLOW_245_HEADER_IPv6, ipv6_handle); |
5789 | 14 | dissector_add_uint("enc", BSD_AF_INET6_BSD, ipv6_handle); |
5790 | 14 | dissector_add_uint("vxlan.next_proto", VXLAN_IPV6, ipv6_handle); |
5791 | 14 | dissector_add_uint("nsh.next_proto", NSH_IPV6, ipv6_handle); |
5792 | | |
5793 | 14 | dissector_add_for_decode_as_with_preference("udp.port", ipv6_handle); |
5794 | | |
5795 | 14 | ipv6_hopopts_handle = create_dissector_handle(dissect_hopopts, proto_ipv6_hopopts); |
5796 | 14 | dissector_add_uint("ip.proto", IP_PROTO_HOPOPT, ipv6_hopopts_handle); |
5797 | | |
5798 | 14 | ipv6_routing_handle = create_dissector_handle(dissect_routing6, proto_ipv6_routing); |
5799 | 14 | dissector_add_uint("ip.proto", IP_PROTO_IPV6_ROUTE, ipv6_routing_handle); |
5800 | | |
5801 | 14 | ipv6_fraghdr_handle = create_dissector_handle(dissect_fraghdr, proto_ipv6_fraghdr); |
5802 | 14 | dissector_add_uint("ip.proto", IP_PROTO_IPV6_FRAG, ipv6_fraghdr_handle); |
5803 | | |
5804 | 14 | ipv6_dstopts_handle = create_dissector_handle(dissect_dstopts, proto_ipv6_dstopts); |
5805 | 14 | dissector_add_uint("ip.proto", IP_PROTO_IPV6_OPTS, ipv6_dstopts_handle); |
5806 | | |
5807 | 14 | ip_dissector_table = find_dissector_table("ip.proto"); |
5808 | | |
5809 | 14 | ipv6_cap_handle = find_capture_dissector("ipv6"); |
5810 | 14 | capture_dissector_add_uint("ethertype", ETHERTYPE_IPv6, ipv6_cap_handle); |
5811 | 14 | capture_dissector_add_uint("enc", BSD_AF_INET6_BSD, ipv6_cap_handle); |
5812 | 14 | capture_dissector_add_uint("null.bsd", BSD_AF_INET6_BSD, ipv6_cap_handle); |
5813 | 14 | capture_dissector_add_uint("null.bsd", BSD_AF_INET6_FREEBSD, ipv6_cap_handle); |
5814 | 14 | capture_dissector_add_uint("null.bsd", BSD_AF_INET6_DARWIN, ipv6_cap_handle); |
5815 | 14 | capture_dissector_add_uint("fr.nlpid", NLPID_IP6, ipv6_cap_handle); |
5816 | | |
5817 | 14 | ipv6_ext_cap_handle = create_capture_dissector_handle(capture_ipv6_exthdr, proto_ipv6_hopopts); |
5818 | 14 | capture_dissector_add_uint("ip.proto", IP_PROTO_HOPOPT, ipv6_ext_cap_handle); |
5819 | 14 | ipv6_ext_cap_handle = create_capture_dissector_handle(capture_ipv6_exthdr, proto_ipv6_routing); |
5820 | 14 | capture_dissector_add_uint("ip.proto", IP_PROTO_IPV6_ROUTE, ipv6_ext_cap_handle); |
5821 | 14 | ipv6_ext_cap_handle = create_capture_dissector_handle(capture_ipv6_exthdr, proto_ipv6_fraghdr); |
5822 | 14 | capture_dissector_add_uint("ip.proto", IP_PROTO_IPV6_FRAG, ipv6_ext_cap_handle); |
5823 | 14 | ipv6_ext_cap_handle = create_capture_dissector_handle(capture_ipv6_exthdr, proto_ipv6_dstopts); |
5824 | 14 | capture_dissector_add_uint("ip.proto", IP_PROTO_IPV6_OPTS, ipv6_ext_cap_handle); |
5825 | | |
5826 | 14 | h = create_dissector_handle(dissect_routing6_rt0, proto_ipv6_routing_rt0); |
5827 | 14 | dissector_add_uint("ipv6.routing.type", IPv6_RT_HEADER_SOURCE_ROUTING, h); |
5828 | 14 | h = create_dissector_handle(dissect_routing6_mipv6, proto_ipv6_routing_mipv6); |
5829 | 14 | dissector_add_uint("ipv6.routing.type", IPv6_RT_HEADER_MOBILE_IP, h); |
5830 | 14 | h = create_dissector_handle(dissect_routing6_rpl, proto_ipv6_routing_rpl); |
5831 | 14 | dissector_add_uint("ipv6.routing.type", IPv6_RT_HEADER_RPL, h); |
5832 | 14 | h = create_dissector_handle(dissect_routing6_srh, proto_ipv6_routing_srh); |
5833 | 14 | dissector_add_uint("ipv6.routing.type", IPv6_RT_HEADER_SEGMENT_ROUTING, h); |
5834 | 14 | h = create_dissector_handle(dissect_routing6_crh, proto_ipv6_routing_crh); |
5835 | 14 | dissector_add_uint("ipv6.routing.type", IPv6_RT_HEADER_COMPACT_16, h); |
5836 | 14 | dissector_add_uint("ipv6.routing.type", IPv6_RT_HEADER_COMPACT_32, h); |
5837 | | |
5838 | 14 | heur_dissector_add("dect_nr.dlc", dissect_ipv6_heur, "IPv6 over DECT NR+", "ipv6_dect_nr", proto_ipv6, HEURISTIC_ENABLE); |
5839 | | |
5840 | 14 | ilnp_handle = find_dissector_add_dependency("ilnp", proto_ipv6_dstopts); |
5841 | | |
5842 | 14 | exported_pdu_tap = find_tap_id("IP"); |
5843 | 14 | } |
5844 | | |
5845 | | /* |
5846 | | * Editor modelines |
5847 | | * |
5848 | | * Local Variables: |
5849 | | * c-basic-offset: 4 |
5850 | | * tab-width: 8 |
5851 | | * indent-tabs-mode: nil |
5852 | | * End: |
5853 | | * |
5854 | | * ex: set shiftwidth=4 tabstop=8 expandtab: |
5855 | | * :indentSize=4:tabSize=8:noTabs=true: |
5856 | | */ |