3 * Wi-Fi Neighbour Awareness Networking (NAN)
5 * Copyright 2019 Samsung Electronics
7 * SPDX-License-Identifier: GPL-2.0-or-later
11 #include <epan/packet.h>
12 #include <epan/expert.h>
14 #include <wsutil/array.h>
15 #include "packet-ieee80211.h"
17 #include <wsutil/str_util.h>
19 void proto_reg_handoff_nan(void);
20 void proto_register_nan(void);
22 static dissector_handle_t nan_act_handle
;
23 static dissector_handle_t nan_disco_handle
;
24 static dissector_handle_t nan_beacon_handle
;
26 static dissector_table_t ie_handle_table
;
28 #define WFA_ACTION_OUI_TYPE 0x18
29 #define WFA_NAN_IE_OUI_TYPE 0x13
30 #define WFA_SERVICE_DISCOVERY_SUBTYPE 0x13
32 #define NAN_MASTER_IND_LENGTH 2
33 #define NAN_CLUSTER_LENGTH 13
34 #define NAN_SDA_MIN_LENGTH 9
35 #define NAN_SDEA_MIN_LENGTH 3
36 #define NAN_CONNECTION_CAP_LENGTH 2
37 #define NAN_WLAN_INFRA_MIN_LENGTH 15
38 #define NAN_P2P_OP_MIN_LENGTH 9
39 #define NAN_IBSS_MIN_LENGTH 14
40 #define NAN_MESH_MIN_LENGTH 8
41 #define NAN_RANGING_MIN_LENGTH 8
42 #define NAN_CLUSTER_DISC_LENGTH 22
43 #define NAN_DEVICE_CAP_LENGTH 9
44 #define NAN_NDP_MIN_LENGTH 11
45 #define NAN_NDPE_MIN_LENGTH 11
46 #define NAN_AVAILABILITY_MIN_LENGTH 8
47 #define NAN_NDC_MIN_LENGTH 11
48 #define NAN_NDL_MIN_LENGTH 4
49 #define NAN_NDL_QOS_LENGTH 3
50 #define NAN_UNALIGNED_SCH_MIN_LENGTH 16
51 #define NAN_RANGING_SETUP_MIN_LENGTH 4
52 #define NAN_EXTENDED_WLAN_INFRA_LENGTH 20
53 #define NAN_EXTENDED_P2P_OP_LENGTH 14
54 #define NAN_EXTENDED_IBSS_LENGTH 19
55 #define NAN_EXTENDED_MESH_MIN_LENGTH 13
56 #define NAN_CIPHER_SUITE_INFO_MIN_LENGTH 3
57 #define NAN_SECURITY_CONTEXT_INFO_MIN_LENGTH 4
58 #define NAN_PUBLIC_AVAIL_MIN_LENGTH 4
59 #define NAN_VENDOR_SPECIFIC_MIN_LENGTH 3
60 #define NAN_DEVICE_CAPABILITY_EXTENSION_MIN_LENGTH 2
61 #define NAN_IDENTITY_RESOLUTION_MIN_LEN 1
62 #define NAN_PAIRING_BOOTSTRAPPING_LEN 5
64 #define NAN_UNALIGNED_SCH_BAND_ID_EXIST 0
65 #define NAN_UNALIGNED_SCH_CHANNEL_ENTRY_EXIST 1
66 #define NAN_UNALIGNED_SCH_CHANNEL_ENTRY_W_AUX_EXIST 2
70 static expert_field ei_nan_elem_len_invalid
;
71 static expert_field ei_nan_unknown_attr_id
;
72 static expert_field ei_nan_unknown_op_class
;
73 static expert_field ei_nan_unknown_beacon_type
;
74 static expert_field ei_nan_invalid_channel_num_for_op_class
;
75 static expert_field ei_nan_invalid_channel_count
;
78 static int ett_attributes
;
79 static int ett_map_control
;
80 static int ett_type_status
;
81 static int ett_time_bitmap_ctrl
;
82 static int ett_non_nan_op_channel
;
83 static int ett_non_nan_beacon
;
84 static int ett_cluster_anchor_master_info
;
85 static int ett_sda_service_ctr
;
86 static int ett_sda_srf_ctr
;
87 static int ett_sdea_ctr
;
88 static int ett_sdea_range_limit
;
89 static int ett_sdea_service_info
;
90 static int ett_connection_cap_field
;
91 static int ett_further_av_map_entry_ctrl
;
92 static int ett_device_cap_map_id
;
93 static int ett_device_cap_committed_dw
;
94 static int ett_device_cap_supported_bands
;
95 static int ett_device_cap_op_mode
;
96 static int ett_device_cap_antennas
;
97 static int ett_device_cap_capabilities
;
98 static int ett_ndp_control
;
99 static int ett_ndpe_tlv
;
100 static int ett_availability_ctr
;
101 static int ett_availability_entry
;
102 static int ett_availability_entry_ctr
;
103 static int ett_availability_entry_entries
;
104 static int ett_availability_entry_entries_channel
;
105 static int ett_ndc_ctr
;
106 static int ett_ndc_entries
;
107 static int ett_device_ndc_map_id
;
108 static int ett_ndl_control
;
109 static int ett_ndl_schedule_entries
;
110 static int ett_unaligned_sch_ctrl
;
111 static int ett_unaligned_sch_ulw_overwrite
;
112 static int ett_unaligned_sch_ulw_ctrl
;
113 static int ett_ranging_setup_ftm_params
;
114 static int ett_ranging_setup_ctrl
;
115 static int ett_ranging_setup_schedule_entries
;
116 static int ett_ranging_info_location_info_availability
;
117 static int ett_p2p_device_role
;
118 static int ett_cipher_suite_info_list
;
119 static int ett_security_context_identifiers
;
120 static int ett_public_availability_sch_entries
;
121 static int ett_ie_tree
;
122 static int ett_availability_op_class
;
123 static int ett_device_capability_extension
;
124 static int ett_nan_pairing_bootstrapping_type_status
;
125 static int ett_nan_pairing_bootstrapping_method
;
126 static int ett_nan_cipher_suite_capabilities
;
128 static int hf_nan_attribute_type
;
129 static int hf_nan_attribute_len
;
130 static int hf_nan_action_subtype
;
131 static int hf_nan_instance_id
;
132 static int hf_nan_service_id
;
133 static int hf_nan_map_id
;
134 static int hf_nan_oui
;
135 static int hf_nan_type_status
;
136 static int hf_nan_reason_code
;
137 static int hf_nan_status_1
;
138 static int hf_nan_status_2
;
139 static int hf_nan_bss_id
;
140 static int hf_nan_availability_intervals_bitmap
;
141 static int hf_nan_mac_address
;
142 static int hf_nan_publish_id
;
143 static int hf_nan_dialog_tokens
;
144 static int hf_nan_time_bitmap
;
145 static int hf_nan_time_bitmap_len
;
146 static int hf_nan_time_bitmap_ctrl
;
147 static int hf_nan_time_bitmap_ctrl_bit_duration
;
148 static int hf_nan_time_bitmap_ctrl_period
;
149 static int hf_nan_time_bitmap_ctrl_start_offset
;
150 static int hf_nan_map_ctrl_map_id
;
151 static int hf_nan_map_ctrl_availability_interval_duration
;
152 static int hf_nan_map_ctrl_repeat
;
153 static int hf_nan_map_ctrl_field
;
154 static int hf_nan_non_op_channel_global_op_class
;
155 static int hf_nan_non_op_channel_channel
;
156 static int hf_nan_non_op_channel_center_freq
;
157 static int hf_nan_non_beacon_tbtt_offset
;
158 static int hf_nan_non_beacon_interval
;
159 static int hf_nan_attr_master_preference
;
160 static int hf_nan_attr_master_random_factor
;
161 static int hf_nan_attr_cluster_anchor_master_rank
;
162 static int hf_nan_attr_cluster_hop_count
;
163 static int hf_nan_attr_cluster_beacon_transmission_time
;
164 static int hf_nan_attr_sda_requestor_instance_id
;
165 static int hf_nan_attr_sda_sc
;
166 static int hf_nan_attr_sda_sc_type
;
167 static int hf_nan_attr_sda_sc_matching_filter
;
168 static int hf_nan_attr_sda_sc_service_response
;
169 static int hf_nan_attr_sda_sc_service_info
;
170 static int hf_nan_attr_sda_sc_discovery_range
;
171 static int hf_nan_attr_sda_sc_binding_bitmap
;
172 static int hf_nan_attr_sda_binding_bitmap
;
173 static int hf_nan_attr_sda_matching_filter_len
;
174 static int hf_nan_attr_sda_matching_filter_val
;
175 static int hf_nan_attr_sda_service_response_filter_len
;
176 static int hf_nan_attr_sda_srf_ctr
;
177 static int hf_nan_attr_sda_srf_ctr_type
;
178 static int hf_nan_attr_sda_srf_ctr_include
;
179 static int hf_nan_attr_sda_srf_ctr_bloom_filter_index
;
180 static int hf_nan_attr_sda_srf_address_set
;
181 static int hf_nan_attr_sda_service_info_len
;
182 static int hf_nan_attr_sda_service_info
;
183 static int hf_nan_attr_sdea_ctr
;
184 static int hf_nan_attr_sdea_ctr_fsd
;
185 static int hf_nan_attr_sdea_ctr_fsd_w_gas
;
186 static int hf_nan_attr_sdea_ctr_data_path
;
187 static int hf_nan_attr_sdea_ctr_data_path_type
;
188 static int hf_nan_attr_sdea_ctr_reserved_multicast_type
;
189 static int hf_nan_attr_sdea_ctr_qos
;
190 static int hf_nan_attr_sdea_ctr_security
;
191 static int hf_nan_attr_sdea_ctr_ranging
;
192 static int hf_nan_attr_sdea_ctr_range_limit
;
193 static int hf_nan_attr_sdea_ctr_service_update_indicator
;
194 static int hf_nan_attr_sdea_ingress_range_limit
;
195 static int hf_nan_attr_sdea_egress_range_limit
;
196 static int hf_nan_attr_sdea_service_update_indicator
;
197 static int hf_nan_attr_sdea_service_info_length
;
198 static int hf_nan_attr_sdea_service_info_protocol_type
;
199 static int hf_nan_attr_sdea_service_info_specific
;
200 static int hf_nan_attr_connection_cap_bitmap
;
201 static int hf_nan_attr_connection_cap_wifi_direct
;
202 static int hf_nan_attr_connection_cap_p2ps
;
203 static int hf_nan_attr_connection_cap_tdls
;
204 static int hf_nan_attr_connection_cap_wlan_infra
;
205 static int hf_nan_attr_connection_cap_ibss
;
206 static int hf_nan_attr_connection_cap_mesh
;
207 static int hf_nan_attr_wlan_infra_device_role
;
208 static int hf_nan_attr_p2p_device_role_device
;
209 static int hf_nan_attr_p2p_device_role_group_owner
;
210 static int hf_nan_attr_p2p_device_role_client
;
211 static int hf_nan_attr_p2p_device_role
;
212 static int hf_nan_attr_mesh_id
;
213 static int hf_nan_attr_further_av_map_entry_av_interval_duration
;
214 static int hf_nan_attr_further_av_map_op_class
;
215 static int hf_nan_attr_further_av_map_channel_num
;
216 static int hf_nan_attr_further_av_map_entry_ctrl
;
217 static int hf_nan_attr_further_av_map_id
;
218 static int hf_nan_attr_country_code
;
219 static int hf_nan_attr_ranging_protocol
;
220 static int hf_nan_attr_cluster_disc_id
;
221 static int hf_nan_attr_cluster_disc_time_offset
;
222 static int hf_nan_attr_cluster_disc_anchor_master_rank
;
223 static int hf_nan_attr_device_cap_map_id_apply_to
;
224 static int hf_nan_attr_device_cap_map_id_associated_maps
;
225 static int hf_nan_attr_device_cap_committed_dw
;
226 static int hf_nan_attr_device_cap_committed_dw_24ghz
;
227 static int hf_nan_attr_device_cap_committed_dw_5ghz
;
228 static int hf_nan_attr_device_cap_committed_dw_24ghz_overwrite
;
229 static int hf_nan_attr_device_cap_committed_dw_5ghz_overwrite
;
230 static int hf_nan_attr_device_cap_supported_bands
;
231 static int hf_nan_attr_device_cap_supported_bands_reserved_tv_whitespaces
;
232 static int hf_nan_attr_device_cap_supported_bands_sub_1ghz
;
233 static int hf_nan_attr_device_cap_supported_bands_24ghz
;
234 static int hf_nan_attr_device_cap_supported_bands_reserved_36ghz
;
235 static int hf_nan_attr_device_cap_supported_bands_5ghz
;
236 static int hf_nan_attr_device_cap_supported_bands_reserved_60ghz
;
237 static int hf_nan_attr_device_cap_supported_bands_reserved_45ghz
;
238 static int hf_nan_attr_device_cap_supported_bands_6ghz
;
239 static int hf_nan_attr_device_cap_op_mode
;
240 static int hf_nan_attr_device_cap_op_mode_phy_vht
;
241 static int hf_nan_attr_device_cap_op_mode_phy_he
;
242 static int hf_nan_attr_device_cap_op_mode_phy_he_vht8080
;
243 static int hf_nan_attr_device_cap_op_mode_phy_he_vht160
;
244 static int hf_nan_attr_device_cap_op_mode_reserved_paging_ndl
;
245 static int hf_nan_attr_device_cap_antennas
;
246 static int hf_nan_attr_device_cap_antennas_tx
;
247 static int hf_nan_attr_device_cap_antennas_rx
;
248 static int hf_nan_attr_device_cap_max_channel_switch_time
;
249 static int hf_nan_attr_device_cap_capabilities
;
250 static int hf_nan_attr_device_cap_capabilities_dfs_master
;
251 static int hf_nan_attr_device_cap_capabilities_extended_key_id
;
252 static int hf_nan_attr_device_cap_capabilities_simul_ndp_reception
;
253 static int hf_nan_attr_device_cap_capabilities_ndpe_attr_support
;
254 static int hf_nan_attr_device_cap_capabilities_s3_capable
;
255 static int hf_nan_attr_ndp_type
;
256 static int hf_nan_attr_ndp_initiator
;
257 static int hf_nan_attr_ndp_id
;
258 static int hf_nan_attr_ndp_ctrl_confirm
;
259 static int hf_nan_attr_ndp_ctrl_security_pres
;
260 static int hf_nan_attr_ndp_ctrl_publish_id_pres
;
261 static int hf_nan_attr_ndp_ctrl_responder_ndi_pres
;
262 static int hf_nan_attr_ndp_ctrl_sepcific_info_pres
;
263 static int hf_nan_attr_ndpe_ctrl_confirm
;
264 static int hf_nan_attr_ndpe_ctrl_security_pres
;
265 static int hf_nan_attr_ndpe_ctrl_publish_id_pres
;
266 static int hf_nan_attr_ndpe_ctrl_responder_ndi_pres
;
267 static int hf_nan_attr_ndpe_ctrl_gtk_requried
;
268 static int hf_nan_attr_ndp_control
;
269 static int hf_nan_attr_ndpe_control
;
270 static int hf_nan_attr_ndp_responder_ndi
;
271 static int hf_nan_attr_ndp_specific_info
;
272 static int hf_nan_attr_ndpe_tlv_type
;
273 static int hf_nan_attr_ndpe_tlv_len
;
274 static int hf_nan_attr_ndpe_tlv_ipv6_interface_identifier
;
275 static int hf_nan_attr_availability_sequence_id
;
276 static int hf_nan_attr_availability_ctr
;
277 static int hf_nan_attr_availability_map_id
;
278 static int hf_nan_attr_availability_committed_changed
;
279 static int hf_nan_attr_availability_potential_changed
;
280 static int hf_nan_attr_availability_public_availability_changed
;
281 static int hf_nan_attr_availability_ndc_changed
;
282 static int hf_nan_attr_availability_reserved_multicast_schedule_changed
;
283 static int hf_nan_attr_availability_reserved_multicast_schedule_change_changed
;
284 static int hf_nan_attr_availability_entry_len
;
285 static int hf_nan_attr_availability_entry_ctr
;
286 static int hf_nan_attr_availability_entry_ctr_type
;
287 static int hf_nan_attr_availability_entry_ctr_pref
;
288 static int hf_nan_attr_availability_entry_ctr_utilization
;
289 static int hf_nan_attr_availability_entry_ctr_rx_nss
;
290 static int hf_nan_attr_availability_entry_ctr_time_bitmap
;
291 static int hf_nan_attr_availability_entry_entries_type
;
292 static int hf_nan_attr_availability_entry_entries_non_contiguous_bw
;
293 static int hf_nan_attr_availability_entry_entries_num_entries
;
294 static int hf_nan_attr_availability_entry_entries_band
;
295 static int hf_nan_attr_availability_entry_entries_channel_op_class
;
296 static int hf_nan_attr_availability_entry_entries_channel_bitmap
;
297 static int hf_nan_attr_availability_entry_entries_primary_channel_bitmap
;
298 static int hf_nan_attr_availability_entry_entries_aux_channel_bitmap
;
299 static int hf_nan_attr_availability_entry_entries_channel_set
;
300 static int hf_nan_attr_availability_entry_entries_start_channel_number
;
301 static int hf_nan_attr_availability_entry_entries_number_of_ch_included
;
302 static int hf_nan_attr_availability_entry_entries_start_freq
;
303 static int hf_nan_attr_availability_entry_entries_bandwidth
;
304 static int hf_nan_attr_ndc_id
;
305 static int hf_nan_attr_ndc_ctrl
;
306 static int hf_nan_attr_ndc_ctrl_selected
;
307 static int hf_nan_attr_ndc_map_id_related_sch
;
308 static int hf_nan_attr_ndl_type
;
309 static int hf_nan_attr_ndl_control
;
310 static int hf_nan_attr_ndl_ctrl_peer_id
;
311 static int hf_nan_attr_ndl_ctrl_immutable_schedule_pres
;
312 static int hf_nan_attr_ndl_ctrl_ndc_pres
;
313 static int hf_nan_attr_ndl_ctrl_qos
;
314 static int hf_nan_attr_ndl_ctrl_type
;
315 static int hf_nan_attr_ndl_ctrl_setup_reason
;
316 static int hf_nan_attr_ndl_ctrl_max_idle_pres
;
317 static int hf_nan_attr_ndl_reserved_peer_id
;
318 static int hf_nan_attr_ndl_max_idle
;
319 static int hf_nan_attr_ndlqos_min_time_slots
;
320 static int hf_nan_attr_ndlqos_max_latency
;
321 static int hf_nan_attr_unaligned_sch_ctrl
;
322 static int hf_nan_attr_unaligned_sch_ctrl_schedule_id
;
323 static int hf_nan_attr_unaligned_sch_ctrl_seq_id
;
324 static int hf_nan_attr_unaligned_sch_starting_time
;
325 static int hf_nan_attr_unaligned_sch_duration
;
326 static int hf_nan_attr_unaligned_sch_period
;
327 static int hf_nan_attr_unaligned_sch_count_down
;
328 static int hf_nan_attr_unaligned_sch_ulw_overwrite
;
329 static int hf_nan_attr_unaligned_sch_ulw_overwrite_all
;
330 static int hf_nan_attr_unaligned_sch_ulw_overwrite_map_id
;
331 static int hf_nan_attr_unaligned_sch_ulw_ctrl
;
332 static int hf_nan_attr_unaligned_sch_ulw_ctrl_type
;
333 static int hf_nan_attr_unaligned_sch_ulw_ctrl_channel_av
;
334 static int hf_nan_attr_unaligned_sch_ulw_ctrl_rxnss
;
335 static int hf_nan_attr_ranging_info_location_info_avail
;
336 static int hf_nan_attr_ranging_info_location_info_avail_lci
;
337 static int hf_nan_attr_ranging_info_location_info_avail_geospatial
;
338 static int hf_nan_attr_ranging_info_location_info_avail_civic_location
;
339 static int hf_nan_attr_ranging_info_location_info_avail_last_movement_pres
;
340 static int hf_nan_attr_ranging_info_last_movement_indication
;
341 static int hf_nan_attr_ranging_setup_type
;
342 static int hf_nan_attr_ranging_setup_ctrl
;
343 static int hf_nan_attr_ranging_setup_ctrl_report_req
;
344 static int hf_nan_attr_ranging_setup_ctrl_ftm_params
;
345 static int hf_nan_attr_ranging_setup_ctrl_entry_list
;
346 static int hf_nan_attr_ranging_setup_ftm_params
;
347 static int hf_nan_attr_ranging_setup_ftm_max_per_burst
;
348 static int hf_nan_attr_ranging_setup_ftm_min_delta
;
349 static int hf_nan_attr_ranging_setup_ftm_max_burst_duration
;
350 static int hf_nan_attr_ranging_setup_ftm_format_bw
;
351 static int hf_nan_attr_ftm_range_report
;
352 static int hf_nan_attr_cipher_suite_capabilities
;
353 static int hf_nan_attr_cipher_suite_capabilities_ndtksa_nmtksa_replay_counters
;
354 static int hf_nan_attr_cipher_suite_capabilities_gtksa_igtksa_bigtksa_support
;
355 static int hf_nan_attr_cipher_suite_capabilities_gtksa_replay_counters
;
356 static int hf_nan_attr_cipher_suite_capabilities_igtksa_bigtksa_cipher
;
357 static int hf_nan_attr_cipher_suite_id
;
358 static int hf_nan_attr_security_context_identifier
;
359 static int hf_nan_attr_security_context_identifier_len
;
360 static int hf_nan_attr_security_context_identifier_type
;
361 static int hf_nan_attr_shared_key_rsna_descriptor
;
362 static int hf_nan_attr_vendor_specific_body
;
363 static int hf_nan_attr_container_element_id
;
364 static int hf_nan_attr_container_element_len
;
365 /* Device Capability Extension attribute, Capability Info field */
366 static int hf_nan_attr_device_capability_extension
;
367 static int hf_nan_attr_device_capability_extension_6g_regulatory_info_presented
;
368 static int hf_nan_attr_device_capability_extension_6g_regulatory_info
;
369 static int hf_nan_attr_device_capability_extension_6g_regulatory_info_reserved
;
370 static int hf_nan_attr_device_capability_extension_paring_setup_enabled
;
371 static int hf_nan_attr_device_capability_extension_npk_nik_cache_enabled
;
372 /* NAN Identity Resolution attribute */
373 static int hf_nan_attr_identity_cipher_version
;
374 static int hf_nan_attr_identity_resolution_nonce
;
375 static int hf_nan_attr_identity_resolution_tag
;
377 /* NAN Pairing Bootstrapping attribute */
378 static int hf_nan_attr_pairing_bootstrapping_dialog_token
;
379 static int hf_nan_attr_pairing_bootstrapping_type_status
;
380 static int hf_nan_attr_pairing_bootstrapping_type
;
381 static int hf_nan_attr_pairing_bootstrapping_status
;
382 static int hf_nan_attr_pairing_bootstrapping_resaon_code
;
383 static int hf_nan_attr_pairing_bootstrapping_comeback_after
;
384 static int hf_nan_attr_pairing_bootstrapping_comeback_cookie_len
;
385 static int hf_nan_attr_pairing_bootstrapping_comeback_cookie
;
386 static int hf_nan_attr_pairing_bootstrapping_methods
;
387 static int hf_nan_attr_pairing_bootstrapping_method_opportunistic_bootstrapping
;
388 static int hf_nan_attr_pairing_bootstrapping_method_pin_code_display
;
389 static int hf_nan_attr_pairing_bootstrapping_method_passphrase_display
;
390 static int hf_nan_attr_pairing_bootstrapping_method_qr_code_display
;
391 static int hf_nan_attr_pairing_bootstrapping_method_nfc_tag
;
392 static int hf_nan_attr_pairing_bootstrapping_method_keypad_pin_code_only
;
393 static int hf_nan_attr_pairing_bootstrapping_method_keypad_passphrase
;
394 static int hf_nan_attr_pairing_bootstrapping_method_qr_code_scan
;
395 static int hf_nan_attr_pairing_bootstrapping_method_nfc_reader
;
396 static int hf_nan_attr_pairing_bootstrapping_method_reserved
;
397 static int hf_nan_attr_pairing_bootstrapping_method_service_managed_bootstrapping
;
398 static int hf_nan_attr_pairing_bootstrapping_method_bootstrapping_handshakes_skipped
;
400 static int hf_nan_attr_reserved
;
403 NAN_ATTR_MASTER_INDICATION
= 0x00,
404 NAN_ATTR_CLUSTER
= 0x01,
405 NAN_ATTR_SERVICE_ID_LIST
= 0x02,
406 NAN_ATTR_SERVICE_DESCRIPTOR
= 0x03,
407 NAN_ATTR_CONNECTION_CAPABILITY
= 0x04,
408 NAN_ATTR_WLAN_INFRA
= 0x05,
409 NAN_ATTR_P2P_OPERATION
= 0x06,
410 NAN_ATTR_IBSS
= 0x07,
411 NAN_ATTR_MESH
= 0x08,
412 NAN_ATTR_FURTHER_SERVICE_DISCOVERY
= 0x09,
413 NAN_ATTR_FURTHER_AVAILABILITY_MAP
= 0x0A,
414 NAN_ATTR_COUNTRY_CODE
= 0x0B,
415 NAN_ATTR_RANGING
= 0x0C,
416 NAN_ATTR_CLUSTER_DISCOVERY
= 0x0D,
417 NAN_ATTR_SERVICE_DESCRIPTOR_EXTENSION
= 0x0E,
418 NAN_ATTR_DEVICE_CAPABILITY
= 0x0F,
420 NAN_ATTR_RESERVED_NMSG
= 0x11,
421 NAN_ATTR_AVAILABILITY
= 0x12,
424 NAN_ATTR_NDL_QOS
= 0x15,
425 NAN_ATTR_RESERVED_MULTICAST_SCHEDULE
= 0x16,
426 NAN_ATTR_UNALIGNED_SCHEDULE
= 0x17,
427 NAN_ATTR_RESERVED_UNICAST_PAGING
= 0x18,
428 NAN_ATTR_RESERVED_MULTICAST_PAGING
= 0x19,
429 NAN_ATTR_RANGING_INFORMATION
= 0x1A,
430 NAN_ATTR_RANGING_SETUP
= 0x1B,
431 NAN_ATTR_FTM_RANGING_REPORT
= 0x1C,
432 NAN_ATTR_ELEMENT_CONTAINER
= 0x1D,
433 NAN_ATTR_EXTENDED_WLAN_INFRA
= 0x1E,
434 NAN_ATTR_EXTENDED_P2P_OPERATION
= 0x1F,
435 NAN_ATTR_EXTENDED_IBSS
= 0x20,
436 NAN_ATTR_EXTENDED_MESH
= 0x21,
437 NAN_ATTR_CIPHER_SUITE_INFO
= 0x22,
438 NAN_ATTR_SECURITY_CONTEXT_INFO
= 0x23,
439 NAN_ATTR_SHARED_KEY_DESCRIPTOR
= 0x24,
440 NAN_ATTR_RESERVED_MULTICAST_SCHEDULE_CHANGE
= 0x25,
441 NAN_ATTR_RESERVED_MULTICAST_SCHEDULE_OWNER_CHANGE
= 0x26,
442 NAN_ATTR_PUBLIC_AVAILABILITY
= 0x27,
443 NAN_ATTR_SUBSCRIBE_SERVICE_ID_LIST
= 0x28,
444 NAN_ATTR_NDP_EXTENSION
= 0x29,
445 NAN_ATTR_DEVICE_CAPABILITY_EXTENSION
= 0x2a,
446 NAN_ATTR_IDENTITY_RESOLUTION
= 0x2b,
447 NAN_ATTR_PAIRING_BOOTSTRAPPING
= 0x2c,
448 NAN_ATTR_VENDOR_SPECIFIC
= 0xDD
451 static const value_string attribute_types
[] = {
452 { NAN_ATTR_MASTER_INDICATION
, "Master Indication Attribute" },
453 { NAN_ATTR_CLUSTER
, "Cluster Attribute" },
454 { NAN_ATTR_SERVICE_ID_LIST
, "Service ID List Attribute" },
455 { NAN_ATTR_SERVICE_DESCRIPTOR
, "Service Descriptor Attribute" },
456 { NAN_ATTR_CONNECTION_CAPABILITY
, "NAN Connection Capability Attribute" },
457 { NAN_ATTR_WLAN_INFRA
, "WLAN Infrastructure Attribute" },
458 { NAN_ATTR_P2P_OPERATION
, "P2P Operation Attribute" },
459 { NAN_ATTR_IBSS
, "IBSS Attribute" },
460 { NAN_ATTR_MESH
, "Mesh Attribute" },
461 { NAN_ATTR_FURTHER_SERVICE_DISCOVERY
, "Further NAN Service Discovery Attribute" },
462 { NAN_ATTR_FURTHER_AVAILABILITY_MAP
, "Further Availability Map Attribute" },
463 { NAN_ATTR_COUNTRY_CODE
, "Country Code Attribute" },
464 { NAN_ATTR_RANGING
, "Ranging Attribute" },
465 { NAN_ATTR_CLUSTER_DISCOVERY
, "Cluster Discovery Attribute" },
466 { NAN_ATTR_SERVICE_DESCRIPTOR_EXTENSION
, "Service Descriptor Extension Attribute" },
467 { NAN_ATTR_DEVICE_CAPABILITY
, "Device Capability" },
468 { NAN_ATTR_NDP
, "NDP Attribute" },
469 { NAN_ATTR_RESERVED_NMSG
, "Reserved (NMSG)" },
470 { NAN_ATTR_AVAILABILITY
, "NAN Availability" },
471 { NAN_ATTR_NDC
, "NDC Attribute" },
472 { NAN_ATTR_NDL
, "NDL Attribute" },
473 { NAN_ATTR_NDL_QOS
, "NDL QoS Attribute" },
474 { NAN_ATTR_RESERVED_MULTICAST_SCHEDULE
, "Reserved (Multicast Schedule)" },
475 { NAN_ATTR_UNALIGNED_SCHEDULE
, "Unaligned Schedule Attribute" },
476 { NAN_ATTR_RESERVED_UNICAST_PAGING
, "Reserved (Unicast Paging)" },
477 { NAN_ATTR_RESERVED_MULTICAST_PAGING
, "Reserved (Multicast Paging)" },
478 { NAN_ATTR_RANGING_INFORMATION
, "Ranging Information Attribute" },
479 { NAN_ATTR_RANGING_SETUP
, "Ranging Setup Attribute" },
480 { NAN_ATTR_FTM_RANGING_REPORT
, "FTM Ranging Report Attribute" },
481 { NAN_ATTR_ELEMENT_CONTAINER
, "Element Container Attribute" },
482 { NAN_ATTR_EXTENDED_WLAN_INFRA
, "Extended WLAN Infrastructure Attribute" },
483 { NAN_ATTR_EXTENDED_P2P_OPERATION
, "Extended P2P Operation Attribute" },
484 { NAN_ATTR_EXTENDED_IBSS
, "Extended IBSS Attribute" },
485 { NAN_ATTR_EXTENDED_MESH
, "Extended Mesh Attribute" },
486 { NAN_ATTR_CIPHER_SUITE_INFO
, "Cipher Suite Info Attribute" },
487 { NAN_ATTR_SECURITY_CONTEXT_INFO
, "Security Context Info Attribute" },
488 { NAN_ATTR_SHARED_KEY_DESCRIPTOR
, "Shared-Key Descriptor Attribute" },
489 { NAN_ATTR_RESERVED_MULTICAST_SCHEDULE_CHANGE
, "Reserved (Multicast Schedule Change)" },
490 { NAN_ATTR_RESERVED_MULTICAST_SCHEDULE_OWNER_CHANGE
, "Reserved (Multicast Schedule Owner Change)" },
491 { NAN_ATTR_PUBLIC_AVAILABILITY
, "Public Availability Attribute" },
492 { NAN_ATTR_SUBSCRIBE_SERVICE_ID_LIST
, "Subscribe Service ID List Attribute" },
493 { NAN_ATTR_NDP_EXTENSION
, "NDP Extension Attribute" },
494 { NAN_ATTR_DEVICE_CAPABILITY_EXTENSION
, "Device Capability Extension"},
495 { NAN_ATTR_IDENTITY_RESOLUTION
, "NAN Identity Resolution"},
496 { NAN_ATTR_PAIRING_BOOTSTRAPPING
, "NAN Pairing Bootstrapping"},
497 { NAN_ATTR_VENDOR_SPECIFIC
, "Vendor Specific Attribute" },
501 // Bitmask fields shared by multiple attributes
502 static int* const map_control_fields
[] = {
503 &hf_nan_map_ctrl_map_id
,
504 &hf_nan_map_ctrl_availability_interval_duration
,
505 &hf_nan_map_ctrl_repeat
,
509 static int* const time_bitmap_ctr_fields
[] = {
510 &hf_nan_time_bitmap_ctrl_bit_duration
,
511 &hf_nan_time_bitmap_ctrl_period
,
512 &hf_nan_time_bitmap_ctrl_start_offset
,
516 static const true_false_string srf_type_flags
= {
517 "Address Set is a Bloom filter",
518 "Address Set is a sequence of MAC Addresses"
521 static const true_false_string srf_include_flags
= {
522 "Only STAs Present in Address Set shall send a response",
523 "STAs present in Address Set shall not send responses"
526 static const true_false_string sdea_ctr_data_path_type_flags
= {
528 "Unicast NDP required (Reserved if NDP is not required)"
531 static const true_false_string sdea_ctr_reserved_multicast_type_flags
= {
532 "Many to many (Reserved if NDP is not required)",
533 "One to many (Reserved if NDP is not required)"
536 static const true_false_string device_cap_map_id_apply_to_flags
= {
537 "Only specified map",
541 static const true_false_string device_cap_op_mode_phy_flags_vht
= {
546 static const true_false_string device_cap_op_mode_phy_flags_he
= {
551 static const true_false_string availability_entry_entries_type_flags
= {
552 "Operating Classes and channel entries",
556 static const true_false_string ndc_ctr_selected_flags
= {
557 "Selected NDC for a NDL Schedule",
558 "NDC included for the peer's information"
561 static const value_string map_ctrl_availability_interval_duration
[] = {
569 static const value_string service_ctr_type
[] = {
577 static const range_string service_info_protocol_type
[] = {
578 { 0, 0, "Reserved" },
581 { 3, 255, "Reserved" },
585 static const value_string availability_entry_type
[] = {
589 { 3, "Committed + Potential" },
590 { 4, "Conditional" },
592 { 6, "Potential + Conditional" },
597 static const range_string availability_entry_time_bitmap_ctr_bit_duration_type
[] = {
602 { 4, 7, "Reserved" },
606 static const value_string availability_entry_time_bitmap_ctr_period_type
[] = {
617 static const range_string availability_entry_entries_band_type
[] = {
618 { 0, 0, "Reserved (for TV white spaces)" },
619 { 1, 1, "Sub-1 GHz" },
621 { 3, 3, "Reserved (for 3.6 GHz)" },
622 { 4, 4, "4.9 and 5 GHz" },
623 { 5, 5, "Reserved (for 60 GHz)" },
624 { 6, 6, "Reserved (for 45 GHz)" },
626 { 8, 255, "Reserved" },
630 static const range_string ndp_type_values
[] = {
632 { 1, 1, "Response" },
634 { 3, 3, "Security Install" },
635 { 4, 4, "Terminate" },
636 { 5, 15, "Reserved" },
640 static const range_string ndpe_tlv_type_values
[] = {
641 { 0, 0, "IPv6 Link Local" },
642 { 1, 1, "Service Info" },
643 { 2, 255, "Reserved" },
647 static const range_string ndl_type_values
[] = {
649 { 1, 1, "Response" },
651 { 3, 15, "Reserved" },
655 static const range_string ranging_setup_type_values
[] = {
657 { 1, 1, "Response" },
658 { 2, 2, "Termination" },
659 { 3, 15, "Reserved" },
663 static const range_string status_type1_values
[] = {
664 { 0, 0, "Continue" },
665 { 1, 1, "Accepted" },
666 { 2, 2, "Rejected" },
667 { 3, 15, "Reserved" },
671 static const range_string status_type2_values
[] = {
672 { 0, 0, "Accepted" },
673 { 1, 1, "Rejected" },
674 { 2, 15, "Reserved" },
678 static const range_string reason_code_values
[] = {
679 { 0, 0, "Reserved" },
680 { 1, 1, "UNSPECIFIED_REASON" },
681 { 2, 2, "RESOURCE_LIMITATION" },
682 { 3, 3, "INVALID_PARAMETERS" },
683 { 4, 4, "FTM_PARAMETERS_INCAPABLE" },
684 { 5, 5, "NO_MOVEMENT" },
685 { 6, 6, "INVALID_AVAILABILITY" },
686 { 7, 7, "IMMUTABLE_UNACCEPTABLE" },
687 { 8, 8, "SECURITY_POLICY" },
688 { 9, 9, "QoS_UNACCEPTABLE" },
689 { 10, 10, "NDP_REJECTED" },
690 { 11, 11, "NDL_UNACCEPTABLE" },
691 { 12, 12, "Ranging Schedule unacceptable" },
692 { 13, 255, "Reserved" },
696 static const range_string action_frame_type_values
[] = {
697 { 0, 0, "Reserved" },
698 { 1, 1, "Ranging Request" },
699 { 2, 2, "Ranging Response" },
700 { 3, 3, "Ranging Termination" },
701 { 4, 4, "Ranging Report" },
702 { 5, 5, "Data Path Request" },
703 { 6, 6, "Data Path Response" },
704 { 7, 7, "Data Path Confirm" },
705 { 8, 8, "Data Path Key Installment" },
706 { 9, 9, "Data Path Termination" },
707 { 10, 10, "Schedule Request" },
708 { 11, 11, "Schedule Response" },
709 { 12, 12, "Schedule Confirm" },
710 { 13, 13, "Schedule Update Notification" },
711 { 14, 255, "Reserved" },
715 static const value_string ndl_type_string
[] = {
717 { 1, "Reserved (P-NDL)" },
721 static const value_string ndl_setup_reason
[] = {
723 { 1, "FSD using GAS" },
729 static const value_string unaligned_sch_ulw_type
[] = {
730 { 0, "Followed by a Band ID field" },
731 { 1, "Followed by a Channel Entry field without Auxiliary Channel" },
732 { 2, "Followed by a Channel Entry field with Auxiliary Channel" },
737 static const range_string security_context_iden_type
[] = {
738 { 0, 0, "Reserved" },
739 { 1, 1, "ND-PMKID" },
740 { 2, 255, "Reserved" },
744 static const value_string device_role
[] = {
746 { 1, "Non-AP STA associated with AP" },
747 { 2, "Non-AP STA listening to AP" },
751 static const range_string furth_av_map_id
[] = {
752 {0, 15, "Identify Further Availability attribute"},
753 {16, 255, "Reserved"},
757 static const value_string device_capability_extension_6g_regulatoty_info
[] = {
759 { 1, "Standard Power AP" },
760 { 2, "Very Low Power AP" },
761 { 3, "Indoor Enabled AP" },
762 { 4, "Indoor Standard Power AP" },
766 static const range_string nan_identity_resolution_cipher_version
[] = {
767 {0, 0, "128-bit NIK, 64-bit Nonce, 64-bit Tag, HMAC-SHA-256"},
768 {1, 255, "Reserved"},
772 static const value_string nan_pairing_bootstrapping_pairing_bootstrapping_type
[] = {
776 { 0, NULL
} /* Reserved for other value */
779 static const value_string nan_pairing_bootstrapping_pairing_bootstrapping_status
[] = {
783 { 0, NULL
} /* Reserved for other value */
786 static const value_string cipher_suite_capabilities_nd_nm_tksa_replay_counters
[] = {
787 { 0, "4 ND-TKSA and NM-TKSA (if applicable) replay counters" },
788 { 1, "16 ND-TKSA and NM-TKSA (if applicable) replay counters" },
792 static const value_string cipher_suite_capabilities_group_and_integrity_sa_support
[] = {
793 { 0, "GTKSA, IGTKSA, BIGTKSA are not supported" },
794 { 1, "GTKSA and IGTKSA are supported, and BIGTKSA is not supported" },
795 { 2, "GTKSA, IGTKSA, and BIGTKSA are supported" },
800 static const value_string cipher_suite_capabilities_gtksa_replay_counters
[] = {
801 { 0, "4 GTKSA replay counters" },
802 { 1, "16 GTKSA replay counters" },
806 static const value_string cipher_suite_capabilities_integrity_sa_ciphers
[] = {
807 { 0, "NCS-BIP-128 (BIP-CMAC-128)" },
808 { 1, "NCS-BIP_256 (BIP-GMAC-256)" },
812 #define PACKET_WIFI_NAN_MAX_CHANNEL_SET_LEN (64)
814 typedef struct _range_channel_set
{
817 const int channel_set
[PACKET_WIFI_NAN_MAX_CHANNEL_SET_LEN
];
821 rval_to_channel_set(const uint32_t val
, const range_channel_set
* ra
)
826 while (*ra
[i
].channel_set
) /* no such thing as channel 0 - end of list */
828 if ((val
>= ra
[i
].value_min
) && (val
<= ra
[i
].value_max
))
830 return ra
[i
].channel_set
;
838 static unsigned int channel_number_valid(const uint8_t channel_number
, const int *const channel_set
)
840 for (unsigned int i
= 0; i
< PACKET_WIFI_NAN_MAX_CHANNEL_SET_LEN
; i
++)
842 if (channel_set
[i
] == channel_number
)
848 return PACKET_WIFI_NAN_MAX_CHANNEL_SET_LEN
;
851 // TODO: this table corresponds to the 802.11 global operating classes.
852 // it's probably in the 802.11 dissector somewhere and ideally this
853 // should be used instead...
854 static const range_channel_set op_class_channel
[] = {
856 {81, 81, {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13}},
858 {83, 83, {1, 2, 3, 4, 5, 6, 7, 8, 9}},
859 {84, 84, {5, 6, 7, 8, 9, 10, 11, 12, 13}},
864 {94, 94, {133, 137}},
865 {95, 95, {136, 138}},
866 {96, 96, {131, 132, 133, 134, 135, 136, 137, 138}},
868 {101, 101, {21, 25}},
869 {102, 102, {11, 13, 15, 17, 19}},
870 {103, 103, {1, 2, 3, 4, 5, 6, 7, 8, 9, 10}},
871 {104, 104, {184, 192}},
872 {105, 105, {188, 196}},
873 {106, 106, {191, 195}},
874 {107, 107, {189, 191, 193, 195, 197}},
875 {108, 108, {188, 189, 190, 191, 192, 193, 194, 195, 196, 197}},
876 {109, 109, {184, 188, 192, 196}},
877 {110, 110, {183, 184, 185, 186, 187, 188, 189}},
878 {111, 111, {182, 183, 184, 185, 186, 187, 188, 189}},
879 {112, 112, {8, 12, 16}},
880 {113, 113, {7, 8, 9, 10, 11}},
881 {114, 114, {6, 7, 8, 9, 10, 11}},
882 {115, 115, {36, 40, 44, 48}},
883 {116, 116, {36, 44}},
884 {117, 117, {40, 48}},
885 {118, 118, {52, 56, 60, 64}},
886 {119, 119, {52, 60}},
887 {120, 120, {56, 64}},
888 {121, 121, {100, 104, 108, 112, 116, 120, 124, 128, 132, 136, 140, 144}},
889 {122, 122, {100, 108, 116, 124, 132, 140}},
890 {123, 123, {103, 112, 120, 128, 136, 144}},
891 {124, 124, {149, 153, 157, 161}},
892 {125, 125, {149, 153, 157, 161,165, 169}},
893 {126, 126, {149, 157}},
894 {127, 127, {153, 161}},
895 {128, 128, {42, 58, 106, 122, 138, 155}},
896 {129, 129, {50, 114}},
897 {130, 130, {42, 58, 106, 122, 138, 155}},
898 {131, 131, {1, 5, 9, 13, 17, 21, 25, 29, 33, 37, 41, 45, 49, 53, 57, 61, 65, 69, 73, 77, 81, 85, 89, 93, 97, 101, 105, 109, 113, 117, 121, 125, 129, 133, 137, 141, 145, 149, 153, 157, 161, 165, 169, 173, 177, 181, 185, 189, 193, 197, 201, 205, 209, 213, 217, 221, 225, 229, 233}},
899 {132, 132, {3, 11, 19, 27, 35, 43, 51, 59, 67, 75, 83, 91, 99, 107, 115, 123, 131, 139, 147, 155, 163, 171, 179, 187, 195, 203, 211, 219, 227}},
900 {133, 133, {7, 23, 39, 55, 71, 87, 103, 119, 135, 151, 167, 183, 199, 215}},
901 {134, 134, {15, 47, 79, 111, 143, 175, 207}},
902 {135, 135, {7, 23, 39, 55, 71, 87, 103, 119, 135, 151, 167, 183, 199, 215}},
903 {137, 137, {31, 63, 95, 127, 159, 191}},
906 {180, 180, {1, 2, 3, 4, 5, 6}},
910 {0, 0, {0}}, /* no such thing as channel 1 - end of list */
913 static const range_string op_channel_spacing
[] = {
918 {86, 86, "12, 14, 16"},
919 {87, 87, "24, 28, 32"},
920 {88, 93, "Reserved"},
924 {97, 100, "Reserved"},
956 {138, 179, "Reserved"},
958 {181, 191, "Reserved"},
959 {255, 255, "Reserved"},
963 static const range_string op_starting_freq
[] = {
969 {88, 93, "Reserved"},
972 {97, 100, "Reserved"},
975 {103, 103, "4.9375"},
978 {108, 108, "4.0025"},
980 {111, 111, "4.0025"},
982 {114, 114, "5.0025"},
987 {138, 179, "Reserved"},
989 {181, 191, "Reserved"},
990 {255, 255, "Reserved"},
995 dissect_attr_master_indication(proto_tree
* attr_tree
, tvbuff_t
* tvb
, int offset
, uint16_t attr_len
, packet_info
* pinfo
)
997 if (attr_len
!= NAN_MASTER_IND_LENGTH
)
999 expert_add_info(pinfo
, attr_tree
, &ei_nan_elem_len_invalid
);
1003 proto_tree_add_item(attr_tree
, hf_nan_attr_master_preference
, tvb
,
1004 offset
+ 3, 1, ENC_BIG_ENDIAN
);
1005 proto_tree_add_item(attr_tree
, hf_nan_attr_master_random_factor
, tvb
,
1006 offset
+ 4, 1, ENC_BIG_ENDIAN
);
1010 dissect_attr_cluster(proto_tree
* attr_tree
, tvbuff_t
* tvb
, int offset
, uint16_t attr_len
, packet_info
* pinfo
)
1012 if (attr_len
!= NAN_CLUSTER_LENGTH
)
1014 expert_add_info(pinfo
, attr_tree
, &ei_nan_elem_len_invalid
);
1018 proto_tree
* anchor_master_tree
= proto_tree_add_subtree(attr_tree
, tvb
, offset
+ 3, 13,
1019 ett_cluster_anchor_master_info
, NULL
, "Anchor Master Information");
1020 proto_tree_add_item(anchor_master_tree
, hf_nan_attr_cluster_anchor_master_rank
, tvb
,
1021 offset
+ 3, 8, ENC_BIG_ENDIAN
);
1022 proto_tree_add_item(anchor_master_tree
, hf_nan_attr_cluster_hop_count
, tvb
,
1023 offset
+ 11, 1, ENC_BIG_ENDIAN
);
1024 proto_tree_add_item(anchor_master_tree
, hf_nan_attr_cluster_beacon_transmission_time
, tvb
,
1025 offset
+ 12, 4, ENC_BIG_ENDIAN
);
1029 dissect_attr_service_id_list(proto_tree
* attr_tree
, tvbuff_t
* tvb
, int offset
, uint16_t attr_len
, packet_info
* pinfo
)
1031 if (attr_len
% 6 != 0 || attr_len
== 0)
1033 expert_add_info_format(pinfo
, attr_tree
, &ei_nan_elem_len_invalid
, "Invalid Service ID length");
1037 int num_service_ids
= attr_len
/ 6;
1039 for (int i
= 1; i
<= num_service_ids
; ++i
)
1041 proto_tree_add_item(attr_tree
, hf_nan_service_id
, tvb
, offset
, 6, ENC_NA
);
1047 dissect_attr_sda(proto_tree
* attr_tree
, tvbuff_t
* tvb
, int offset
, uint16_t attr_len
, packet_info
* pinfo
)
1049 if (attr_len
< NAN_SDA_MIN_LENGTH
)
1051 expert_add_info(pinfo
, attr_tree
, &ei_nan_elem_len_invalid
);
1055 proto_tree_add_item(attr_tree
, hf_nan_service_id
, tvb
,
1056 offset
+ 3, 6, ENC_NA
);
1057 proto_tree_add_item(attr_tree
, hf_nan_instance_id
, tvb
,
1058 offset
+ 9, 1, ENC_BIG_ENDIAN
);
1059 proto_tree_add_item(attr_tree
, hf_nan_attr_sda_requestor_instance_id
, tvb
,
1060 offset
+ 10, 1, ENC_BIG_ENDIAN
);
1063 static int* const service_ctr_fields
[] = {
1064 &hf_nan_attr_sda_sc_type
,
1065 &hf_nan_attr_sda_sc_matching_filter
,
1066 &hf_nan_attr_sda_sc_service_response
,
1067 &hf_nan_attr_sda_sc_service_info
,
1068 &hf_nan_attr_sda_sc_discovery_range
,
1069 &hf_nan_attr_sda_sc_binding_bitmap
,
1073 proto_tree_add_bitmask(attr_tree
, tvb
, offset
, hf_nan_attr_sda_sc
,
1074 ett_sda_service_ctr
, service_ctr_fields
, ENC_LITTLE_ENDIAN
);
1076 uint8_t service_ctr_byte
= tvb_get_uint8(tvb
, offset
);
1079 const uint8_t BITMASK_TYPE_SUBSCRIBE
= 0x01;
1080 const uint8_t BITMASK_TYPE_FOLLOW_UP
= 0x02;
1081 const uint8_t BITMASK_MATCHING_FILTER_PRESENT
= 0x04;
1082 const uint8_t BITMASK_SERVICE_RESPONSE_FILTER_PRESENT
= 0x08;
1083 const uint8_t BITMASK_SERVICE_INFO_PRESENT
= 0x10;
1084 const uint8_t BITMASK_BITMAP_PRESENT
= 0x40;
1086 if (service_ctr_byte
& BITMASK_TYPE_SUBSCRIBE
)
1088 col_prepend_fstr(pinfo
->cinfo
, COL_INFO
, "SDF Subscribe, ");
1090 else if (service_ctr_byte
& BITMASK_TYPE_FOLLOW_UP
)
1092 col_prepend_fstr(pinfo
->cinfo
, COL_INFO
, "SDF Follow up, ");
1096 col_prepend_fstr(pinfo
->cinfo
, COL_INFO
, "SDF Publish, ");
1099 if (service_ctr_byte
& BITMASK_BITMAP_PRESENT
)
1101 proto_tree_add_item(attr_tree
, hf_nan_attr_sda_binding_bitmap
, tvb
,
1102 offset
, 2, ENC_LITTLE_ENDIAN
);
1106 if (service_ctr_byte
& BITMASK_MATCHING_FILTER_PRESENT
)
1108 proto_tree_add_item(attr_tree
, hf_nan_attr_sda_matching_filter_len
, tvb
,
1109 offset
, 1, ENC_LITTLE_ENDIAN
);
1110 int mf_len
= tvb_get_uint8(tvb
, offset
);
1111 int dissected_mf_len
= 0;
1113 while (dissected_mf_len
< mf_len
)
1115 int filter_len
= tvb_get_uint8(tvb
, offset
);
1116 proto_tree_add_item(attr_tree
, hf_nan_attr_sda_matching_filter_val
, tvb
,
1117 offset
+ 1, filter_len
, ENC_NA
);
1118 offset
+= filter_len
+ 1;
1119 dissected_mf_len
+= filter_len
+ 1;
1123 if (service_ctr_byte
& BITMASK_SERVICE_RESPONSE_FILTER_PRESENT
)
1125 proto_tree_add_item(attr_tree
, hf_nan_attr_sda_service_response_filter_len
, tvb
,
1126 offset
, 1, ENC_LITTLE_ENDIAN
);
1127 int srf_len
= tvb_get_uint8(tvb
, offset
);
1129 static int* const srf_ctr_fields
[] = {
1130 &hf_nan_attr_sda_srf_ctr_type
,
1131 &hf_nan_attr_sda_srf_ctr_include
,
1132 &hf_nan_attr_sda_srf_ctr_bloom_filter_index
,
1136 proto_tree_add_bitmask(attr_tree
, tvb
, offset
+ 1, hf_nan_attr_sda_srf_ctr
,
1137 ett_sda_service_ctr
, srf_ctr_fields
, ENC_LITTLE_ENDIAN
);
1138 proto_tree_add_item(attr_tree
, hf_nan_attr_sda_srf_address_set
, tvb
,
1139 offset
+ 2, srf_len
- 1, ENC_NA
);
1140 offset
+= srf_len
+ 1;
1143 if (service_ctr_byte
& BITMASK_SERVICE_INFO_PRESENT
)
1145 uint32_t service_info_len
;
1147 /* XXX - use FT_UINT_BYTES? */
1148 proto_tree_add_item_ret_uint(attr_tree
, hf_nan_attr_sda_service_info_len
, tvb
,
1149 offset
, 1, ENC_BIG_ENDIAN
, &service_info_len
);
1150 proto_tree_add_item(attr_tree
, hf_nan_attr_sda_service_info
, tvb
,
1151 offset
+ 1, service_info_len
, ENC_NA
);
1152 // offset += service_info_len + 1;
1157 dissect_attr_sdea(proto_tree
* attr_tree
, tvbuff_t
* tvb
, int offset
, uint16_t attr_len
, packet_info
* pinfo
)
1159 if (attr_len
< NAN_SDEA_MIN_LENGTH
)
1161 expert_add_info(pinfo
, attr_tree
, &ei_nan_elem_len_invalid
);
1165 proto_tree_add_item(attr_tree
, hf_nan_instance_id
, tvb
,
1166 offset
+ 3, 1, ENC_LITTLE_ENDIAN
);
1168 uint16_t dissected_len
= 1;
1170 static int* const sdea_ctr_fields
[] = {
1171 &hf_nan_attr_sdea_ctr_fsd
,
1172 &hf_nan_attr_sdea_ctr_fsd_w_gas
,
1173 &hf_nan_attr_sdea_ctr_data_path
,
1174 &hf_nan_attr_sdea_ctr_data_path_type
,
1175 &hf_nan_attr_sdea_ctr_reserved_multicast_type
,
1176 &hf_nan_attr_sdea_ctr_qos
,
1177 &hf_nan_attr_sdea_ctr_security
,
1178 &hf_nan_attr_sdea_ctr_ranging
,
1179 &hf_nan_attr_sdea_ctr_range_limit
,
1180 &hf_nan_attr_sdea_ctr_service_update_indicator
,
1184 proto_tree_add_bitmask(attr_tree
, tvb
, offset
, hf_nan_attr_sdea_ctr
, ett_sdea_ctr
,
1185 sdea_ctr_fields
, ENC_LITTLE_ENDIAN
);
1187 uint16_t sdea_ctr_byte
= tvb_get_letohs(tvb
, offset
);
1191 if (sdea_ctr_byte
& 0x100)
1193 proto_tree
* range_lim_tree
= proto_tree_add_subtree(attr_tree
, tvb
, offset
, 4,
1194 ett_sdea_range_limit
, NULL
, "Range Limit");
1195 proto_tree_add_item(range_lim_tree
, hf_nan_attr_sdea_ingress_range_limit
, tvb
,
1196 offset
, 2, ENC_LITTLE_ENDIAN
);
1197 proto_tree_add_item(range_lim_tree
, hf_nan_attr_sdea_egress_range_limit
, tvb
,
1198 offset
+ 2, 2, ENC_LITTLE_ENDIAN
);
1203 if (sdea_ctr_byte
& 0x200)
1205 proto_tree_add_item(attr_tree
, hf_nan_attr_sdea_service_update_indicator
, tvb
,
1206 offset
, 1, ENC_LITTLE_ENDIAN
);
1211 // If Service Info field is present
1212 if (dissected_len
< attr_len
)
1214 proto_tree_add_item(attr_tree
, hf_nan_attr_sdea_service_info_length
, tvb
,
1215 offset
, 2, ENC_LITTLE_ENDIAN
);
1216 proto_tree
* service_info_tree
= proto_tree_add_subtree(attr_tree
, tvb
, offset
+ 2,
1217 attr_len
- dissected_len
- 2, ett_sdea_service_info
, NULL
, "Service Info");
1218 proto_tree_add_item(service_info_tree
, hf_nan_oui
, tvb
,
1219 offset
+ 2, 3, ENC_NA
);
1220 proto_tree_add_item(service_info_tree
, hf_nan_attr_sdea_service_info_protocol_type
, tvb
,
1221 offset
+ 5, 1, ENC_BIG_ENDIAN
);
1222 proto_tree_add_item(service_info_tree
, hf_nan_attr_sdea_service_info_specific
, tvb
,
1223 offset
+ 6, attr_len
- dissected_len
- 6, ENC_NA
);
1228 dissect_attr_connection_capability(proto_tree
* attr_tree
, tvbuff_t
* tvb
, int offset
, uint16_t attr_len
, packet_info
* pinfo
)
1230 if (attr_len
!= NAN_CONNECTION_CAP_LENGTH
)
1232 expert_add_info(pinfo
, attr_tree
, &ei_nan_elem_len_invalid
);
1236 static int* const connection_cap_bitmap_fields
[] = {
1237 &hf_nan_attr_connection_cap_wifi_direct
,
1238 &hf_nan_attr_connection_cap_p2ps
,
1239 &hf_nan_attr_connection_cap_tdls
,
1240 &hf_nan_attr_connection_cap_wlan_infra
,
1241 &hf_nan_attr_connection_cap_ibss
,
1242 &hf_nan_attr_connection_cap_mesh
,
1246 proto_tree_add_bitmask(attr_tree
, tvb
, offset
+ 3, hf_nan_attr_connection_cap_bitmap
,
1247 ett_connection_cap_field
, connection_cap_bitmap_fields
, ENC_LITTLE_ENDIAN
);
1251 dissect_attr_wlan_infra(proto_tree
* attr_tree
, tvbuff_t
* tvb
, int offset
, uint16_t attr_len
, packet_info
* pinfo
)
1253 if (attr_len
< NAN_WLAN_INFRA_MIN_LENGTH
)
1255 expert_add_info(pinfo
, attr_tree
, &ei_nan_elem_len_invalid
);
1259 unsigned sub_offset
= offset
+ 3;
1260 proto_tree_add_item(attr_tree
, hf_nan_bss_id
, tvb
, sub_offset
, 6, ENC_LITTLE_ENDIAN
);
1262 proto_tree_add_item(attr_tree
, hf_nan_mac_address
, tvb
, sub_offset
, 6, ENC_NA
);
1264 proto_tree_add_bitmask(attr_tree
, tvb
, sub_offset
, hf_nan_map_ctrl_field
,
1265 ett_map_control
, map_control_fields
, ENC_LITTLE_ENDIAN
);
1267 int bitmap_length
= attr_len
- 14;
1268 proto_tree_add_item(attr_tree
, hf_nan_availability_intervals_bitmap
, tvb
, sub_offset
, bitmap_length
, ENC_NA
);
1269 sub_offset
+= bitmap_length
;
1270 proto_tree_add_item(attr_tree
, hf_nan_attr_wlan_infra_device_role
, tvb
, sub_offset
, 1, ENC_BIG_ENDIAN
);
1274 dissect_attr_p2p_operation(proto_tree
* attr_tree
, tvbuff_t
* tvb
, int offset
, uint16_t attr_len
, packet_info
* pinfo
)
1276 if (attr_len
< NAN_P2P_OP_MIN_LENGTH
)
1278 expert_add_info(pinfo
, attr_tree
, &ei_nan_elem_len_invalid
);
1282 unsigned sub_offset
= offset
+ 3;
1283 static int* const p2p_bitmap_fields
[] = {
1284 &hf_nan_attr_p2p_device_role_device
,
1285 &hf_nan_attr_p2p_device_role_group_owner
,
1286 &hf_nan_attr_p2p_device_role_client
,
1290 proto_tree_add_bitmask(attr_tree
, tvb
, sub_offset
, hf_nan_attr_p2p_device_role
,
1291 ett_p2p_device_role
, p2p_bitmap_fields
, ENC_LITTLE_ENDIAN
);
1293 proto_tree_add_item(attr_tree
, hf_nan_mac_address
, tvb
, sub_offset
, 6, ENC_NA
);
1295 proto_tree_add_bitmask(attr_tree
, tvb
, sub_offset
, hf_nan_map_ctrl_field
,
1296 ett_map_control
, map_control_fields
, ENC_LITTLE_ENDIAN
);
1298 proto_tree_add_item(attr_tree
, hf_nan_availability_intervals_bitmap
, tvb
, sub_offset
, -1, ENC_NA
);
1302 dissect_attr_ibss(proto_tree
* attr_tree
, tvbuff_t
* tvb
, int offset
, uint16_t attr_len
, packet_info
* pinfo
)
1304 if (attr_len
< NAN_IBSS_MIN_LENGTH
)
1306 expert_add_info(pinfo
, attr_tree
, &ei_nan_elem_len_invalid
);
1310 unsigned sub_offset
= offset
+ 3;
1311 proto_tree_add_item(attr_tree
, hf_nan_bss_id
, tvb
, sub_offset
, 6, ENC_LITTLE_ENDIAN
);
1313 proto_tree_add_item(attr_tree
, hf_nan_mac_address
, tvb
, sub_offset
, 6, ENC_NA
);
1315 proto_tree_add_bitmask(attr_tree
, tvb
, sub_offset
, hf_nan_map_ctrl_field
,
1316 ett_map_control
, map_control_fields
, ENC_LITTLE_ENDIAN
);
1318 proto_tree_add_item(attr_tree
, hf_nan_availability_intervals_bitmap
, tvb
, sub_offset
, -1, ENC_NA
);
1322 dissect_attr_mesh(proto_tree
* attr_tree
, tvbuff_t
* tvb
, int offset
, uint16_t attr_len
, packet_info
* pinfo
)
1324 if (attr_len
< NAN_MESH_MIN_LENGTH
)
1326 expert_add_info(pinfo
, attr_tree
, &ei_nan_elem_len_invalid
);
1330 unsigned sub_offset
= offset
+ 3;
1331 proto_tree_add_item(attr_tree
, hf_nan_mac_address
, tvb
, sub_offset
, 6, ENC_NA
);
1334 uint8_t duration
= tvb_get_bits8(tvb
, sub_offset
* 8 + 5, 2);
1335 unsigned bitmap_length
;
1350 proto_tree_add_bitmask(attr_tree
, tvb
, sub_offset
, hf_nan_map_ctrl_field
,
1351 ett_map_control
, map_control_fields
, ENC_LITTLE_ENDIAN
);
1353 proto_tree_add_item(attr_tree
, hf_nan_availability_intervals_bitmap
, tvb
, sub_offset
, bitmap_length
, ENC_NA
);
1354 sub_offset
+= bitmap_length
;
1355 proto_tree_add_item(attr_tree
, hf_nan_attr_mesh_id
, tvb
, sub_offset
, -1, ENC_NA
);
1359 dissect_attr_further_service_discovery(proto_tree
* attr_tree
, tvbuff_t
* tvb
, int offset
, uint16_t attr_len
)
1361 unsigned sub_offset
= offset
+ 3;
1362 proto_tree_add_bitmask(attr_tree
, tvb
, sub_offset
, hf_nan_map_ctrl_field
,
1363 ett_map_control
, map_control_fields
, ENC_LITTLE_ENDIAN
);
1365 int bitmap_length
= attr_len
- 1;
1366 proto_tree_add_item(attr_tree
, hf_nan_availability_intervals_bitmap
, tvb
, sub_offset
, bitmap_length
, ENC_NA
);
1370 dissect_attr_further_availability_map(proto_tree
* attr_tree
, tvbuff_t
* tvb
, int offset
)
1372 unsigned sub_offset
= offset
+ 3;
1373 proto_tree_add_item(attr_tree
, hf_nan_attr_further_av_map_id
, tvb
, sub_offset
, 1, ENC_BIG_ENDIAN
);
1376 static int* const availability_entry_control_fields
[] = {
1377 &hf_nan_attr_further_av_map_entry_av_interval_duration
,
1381 proto_tree_add_bitmask(attr_tree
, tvb
, sub_offset
, hf_nan_attr_further_av_map_entry_ctrl
,
1382 ett_further_av_map_entry_ctrl
, availability_entry_control_fields
, ENC_LITTLE_ENDIAN
);
1384 proto_tree_add_item(attr_tree
, hf_nan_attr_further_av_map_op_class
, tvb
, sub_offset
, 1, ENC_BIG_ENDIAN
);
1386 proto_tree_add_item(attr_tree
, hf_nan_attr_further_av_map_channel_num
, tvb
, sub_offset
, 1, ENC_BIG_ENDIAN
);
1388 proto_tree_add_item(attr_tree
, hf_nan_availability_intervals_bitmap
, tvb
, sub_offset
, -1, ENC_NA
);
1392 dissect_attr_country_code(proto_tree
* attr_tree
, tvbuff_t
* tvb
, int offset
)
1394 unsigned sub_offset
= offset
+ 3;
1395 proto_tree_add_item(attr_tree
, hf_nan_attr_country_code
, tvb
, sub_offset
, 2, ENC_ASCII
);
1399 dissect_attr_ranging(proto_tree
* attr_tree
, tvbuff_t
* tvb
, int offset
, uint16_t attr_len
, packet_info
* pinfo
)
1401 if (attr_len
< NAN_RANGING_MIN_LENGTH
)
1403 expert_add_info(pinfo
, attr_tree
, &ei_nan_elem_len_invalid
);
1407 unsigned sub_offset
= offset
+ 3;
1408 proto_tree_add_item(attr_tree
, hf_nan_mac_address
, tvb
, sub_offset
, 6, ENC_NA
);
1410 proto_tree_add_bitmask(attr_tree
, tvb
, sub_offset
, hf_nan_map_ctrl_field
,
1411 ett_map_control
, map_control_fields
, ENC_LITTLE_ENDIAN
);
1413 proto_tree_add_item(attr_tree
, hf_nan_attr_ranging_protocol
, tvb
, sub_offset
, 1, ENC_BIG_ENDIAN
);
1415 proto_tree_add_item(attr_tree
, hf_nan_availability_intervals_bitmap
, tvb
, sub_offset
, -1, ENC_NA
);
1419 dissect_attr_cluter_discovery(proto_tree
* attr_tree
, tvbuff_t
* tvb
, int offset
, uint16_t attr_len
, packet_info
* pinfo
)
1421 if (attr_len
!= NAN_CLUSTER_DISC_LENGTH
)
1423 expert_add_info(pinfo
, attr_tree
, &ei_nan_elem_len_invalid
);
1427 unsigned sub_offset
= offset
+ 3;
1428 proto_tree_add_item(attr_tree
, hf_nan_attr_cluster_disc_id
, tvb
, sub_offset
, 6, ENC_LITTLE_ENDIAN
);
1430 proto_tree_add_item(attr_tree
, hf_nan_attr_cluster_disc_time_offset
, tvb
, sub_offset
, 8, ENC_LITTLE_ENDIAN
);
1432 proto_tree_add_item(attr_tree
, hf_nan_attr_cluster_disc_anchor_master_rank
, tvb
, sub_offset
, 8, ENC_LITTLE_ENDIAN
);
1436 dissect_attr_device_capability(proto_tree
* attr_tree
, tvbuff_t
* tvb
, int offset
, uint16_t attr_len
, packet_info
* pinfo
)
1438 if (attr_len
!= NAN_DEVICE_CAP_LENGTH
)
1440 expert_add_info(pinfo
, attr_tree
, &ei_nan_elem_len_invalid
);
1444 static int* const device_cap_map_id_fields
[] = {
1445 &hf_nan_attr_device_cap_map_id_apply_to
,
1446 &hf_nan_attr_device_cap_map_id_associated_maps
,
1449 static int* const device_cap_committed_dw_fields
[] = {
1450 &hf_nan_attr_device_cap_committed_dw_24ghz
,
1451 &hf_nan_attr_device_cap_committed_dw_5ghz
,
1452 &hf_nan_attr_device_cap_committed_dw_24ghz_overwrite
,
1453 &hf_nan_attr_device_cap_committed_dw_5ghz_overwrite
,
1456 static int* const device_cap_supported_bands_fields
[] = {
1457 &hf_nan_attr_device_cap_supported_bands_reserved_tv_whitespaces
,
1458 &hf_nan_attr_device_cap_supported_bands_sub_1ghz
,
1459 &hf_nan_attr_device_cap_supported_bands_24ghz
,
1460 &hf_nan_attr_device_cap_supported_bands_reserved_36ghz
,
1461 &hf_nan_attr_device_cap_supported_bands_5ghz
,
1462 &hf_nan_attr_device_cap_supported_bands_reserved_60ghz
,
1463 &hf_nan_attr_device_cap_supported_bands_reserved_45ghz
,
1464 &hf_nan_attr_device_cap_supported_bands_6ghz
,
1467 static int* const device_cap_op_mode_fields
[] = {
1468 &hf_nan_attr_device_cap_op_mode_phy_vht
,
1469 &hf_nan_attr_device_cap_op_mode_phy_he_vht8080
,
1470 &hf_nan_attr_device_cap_op_mode_phy_he_vht160
,
1471 &hf_nan_attr_device_cap_op_mode_reserved_paging_ndl
,
1472 &hf_nan_attr_device_cap_op_mode_phy_he
,
1475 static int* const device_cap_antennas_fields
[] = {
1476 &hf_nan_attr_device_cap_antennas_tx
,
1477 &hf_nan_attr_device_cap_antennas_rx
,
1480 static int* const device_cap_capabilities_fields
[] = {
1481 &hf_nan_attr_device_cap_capabilities_dfs_master
,
1482 &hf_nan_attr_device_cap_capabilities_extended_key_id
,
1483 &hf_nan_attr_device_cap_capabilities_simul_ndp_reception
,
1484 &hf_nan_attr_device_cap_capabilities_ndpe_attr_support
,
1485 &hf_nan_attr_device_cap_capabilities_s3_capable
,
1489 proto_tree_add_bitmask(attr_tree
, tvb
, offset
+ 3, hf_nan_map_id
,
1490 ett_device_cap_map_id
, device_cap_map_id_fields
, ENC_LITTLE_ENDIAN
);
1491 proto_tree_add_bitmask(attr_tree
, tvb
, offset
+ 4, hf_nan_attr_device_cap_committed_dw
,
1492 ett_device_cap_committed_dw
, device_cap_committed_dw_fields
, ENC_LITTLE_ENDIAN
);
1493 proto_tree_add_bitmask(attr_tree
, tvb
, offset
+ 6, hf_nan_attr_device_cap_supported_bands
,
1494 ett_device_cap_supported_bands
, device_cap_supported_bands_fields
, ENC_LITTLE_ENDIAN
);
1495 proto_tree_add_bitmask(attr_tree
, tvb
, offset
+ 7, hf_nan_attr_device_cap_op_mode
,
1496 ett_device_cap_op_mode
, device_cap_op_mode_fields
, ENC_LITTLE_ENDIAN
);
1497 proto_tree_add_bitmask(attr_tree
, tvb
, offset
+ 8, hf_nan_attr_device_cap_antennas
,
1498 ett_device_cap_antennas
, device_cap_antennas_fields
, ENC_LITTLE_ENDIAN
);
1499 proto_tree_add_item(attr_tree
, hf_nan_attr_device_cap_max_channel_switch_time
, tvb
,
1500 offset
+ 9, 2, ENC_LITTLE_ENDIAN
);
1501 proto_tree_add_bitmask(attr_tree
, tvb
, offset
+ 11, hf_nan_attr_device_cap_capabilities
,
1502 ett_device_cap_capabilities
, device_cap_capabilities_fields
, ENC_LITTLE_ENDIAN
);
1506 dissect_attr_ndp(proto_tree
* attr_tree
, tvbuff_t
* tvb
, int offset
, uint16_t attr_len
, packet_info
* pinfo
)
1508 if (attr_len
< NAN_NDP_MIN_LENGTH
)
1510 expert_add_info(pinfo
, attr_tree
, &ei_nan_elem_len_invalid
);
1514 unsigned sub_offset
= offset
+ 3;
1515 proto_tree_add_item(attr_tree
, hf_nan_dialog_tokens
, tvb
, sub_offset
, 1, ENC_BIG_ENDIAN
);
1518 static int* const ndp_type_status_fields
[] = {
1519 &hf_nan_attr_ndp_type
,
1523 static int* const ndp_control_fields
[] = {
1524 &hf_nan_attr_ndp_ctrl_confirm
,
1525 &hf_nan_attr_ndp_ctrl_security_pres
,
1526 &hf_nan_attr_ndp_ctrl_publish_id_pres
,
1527 &hf_nan_attr_ndp_ctrl_responder_ndi_pres
,
1528 &hf_nan_attr_ndp_ctrl_sepcific_info_pres
,
1532 proto_tree_add_bitmask(attr_tree
, tvb
, sub_offset
, hf_nan_type_status
,
1533 ett_type_status
, ndp_type_status_fields
, ENC_LITTLE_ENDIAN
);
1535 uint8_t bits_type
= tvb_get_bits8(tvb
, sub_offset
* 8 + 4, 4);
1536 uint8_t bit_offset
= (sub_offset
* 8) + 4;
1537 uint8_t bits_status
= tvb_get_bits8(tvb
, bit_offset
, 4);
1539 proto_tree_add_item(attr_tree
, hf_nan_reason_code
, tvb
, sub_offset
, 1, ENC_BIG_ENDIAN
);
1541 proto_tree_add_item(attr_tree
, hf_nan_attr_ndp_initiator
, tvb
, sub_offset
, 6, ENC_NA
);
1543 proto_tree_add_item(attr_tree
, hf_nan_attr_ndp_id
, tvb
, sub_offset
, 1, ENC_BIG_ENDIAN
);
1545 proto_tree_add_bitmask(attr_tree
, tvb
, sub_offset
, hf_nan_attr_ndp_control
,
1546 ett_ndp_control
, ndp_control_fields
, ENC_LITTLE_ENDIAN
);
1548 uint8_t bits_ndp_info
= tvb_get_bits8(tvb
, (sub_offset
* 8) + 2, 1);
1549 uint8_t bits_publish_id
= tvb_get_bits8(tvb
, (sub_offset
* 8) + 4, 1);
1552 if (bits_publish_id
== 1 && bits_type
== 0)
1554 proto_tree_add_item(attr_tree
, hf_nan_publish_id
, tvb
, sub_offset
, 1, ENC_BIG_ENDIAN
);
1557 if (bits_type
== 1 && (bits_status
== 0 || bits_status
== 1))
1559 proto_tree_add_item(attr_tree
, hf_nan_attr_ndp_responder_ndi
, tvb
, sub_offset
, 6, ENC_NA
);
1564 proto_tree_add_item(attr_tree
, hf_nan_attr_ndp_specific_info
, tvb
, sub_offset
, -1, ENC_NA
);
1569 dissect_attr_ndpe(proto_tree
* attr_tree
, tvbuff_t
* tvb
, int offset
, uint16_t attr_len
, packet_info
* pinfo
)
1571 if (attr_len
< NAN_NDPE_MIN_LENGTH
)
1573 expert_add_info(pinfo
, attr_tree
, &ei_nan_elem_len_invalid
);
1577 static int* const ndp_type_status_fields
[] = {
1578 &hf_nan_attr_ndp_type
,
1582 static int* const ndpe_control_fields
[] = {
1583 &hf_nan_attr_ndpe_ctrl_confirm
,
1584 &hf_nan_attr_ndpe_ctrl_security_pres
,
1585 &hf_nan_attr_ndpe_ctrl_publish_id_pres
,
1586 &hf_nan_attr_ndpe_ctrl_responder_ndi_pres
,
1587 &hf_nan_attr_ndpe_ctrl_gtk_requried
,
1591 int dissected_len
= 0;
1592 proto_tree_add_item(attr_tree
, hf_nan_dialog_tokens
, tvb
, offset
+ 3, 1, ENC_BIG_ENDIAN
);
1593 proto_tree_add_bitmask(attr_tree
, tvb
, offset
+ 4, hf_nan_type_status
,
1594 ett_type_status
, ndp_type_status_fields
, ENC_LITTLE_ENDIAN
);
1598 uint8_t bits_type
= tvb_get_bits8(tvb
, offset
* 8 + 4, 4);
1599 uint32_t bit_offset
= (offset
* 8) + 4;
1600 uint8_t bits_status
= tvb_get_bits8(tvb
, bit_offset
, 4);
1602 proto_tree_add_item(attr_tree
, hf_nan_reason_code
, tvb
, offset
+ 1, 1, ENC_BIG_ENDIAN
);
1603 proto_tree_add_item(attr_tree
, hf_nan_attr_ndp_initiator
, tvb
, offset
+ 2, 6, ENC_NA
);
1604 proto_tree_add_item(attr_tree
, hf_nan_attr_ndp_id
, tvb
, offset
+ 8, 1, ENC_BIG_ENDIAN
);
1605 proto_tree_add_bitmask(attr_tree
, tvb
, offset
+ 9, hf_nan_attr_ndpe_control
,
1606 ett_ndp_control
, ndpe_control_fields
, ENC_LITTLE_ENDIAN
);
1610 uint8_t bits_publish_id
= tvb_get_bits8(tvb
, (offset
* 8) + 4, 1);
1614 if (bits_publish_id
== 1 && bits_type
== 0)
1616 proto_tree_add_item(attr_tree
, hf_nan_publish_id
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
1620 if (bits_type
== 1 && (bits_status
== 0 || bits_status
== 1))
1622 proto_tree_add_item(attr_tree
, hf_nan_attr_ndp_responder_ndi
, tvb
, offset
, 6, ENC_NA
);
1627 while (dissected_len
< attr_len
)
1629 uint8_t tlv_type
= tvb_get_uint8(tvb
, offset
);
1630 uint16_t tlv_len
= tvb_get_letohs(tvb
, offset
+ 1);
1631 proto_tree
* tlv_tree
= proto_tree_add_subtree(attr_tree
, tvb
, offset
, tlv_len
+ 3,
1632 ett_ndpe_tlv
, NULL
, "TLV entry");
1633 proto_tree_add_item(tlv_tree
, hf_nan_attr_ndpe_tlv_type
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
1634 proto_tree_add_item(tlv_tree
, hf_nan_attr_ndpe_tlv_len
, tvb
, offset
+ 1, 2, ENC_LITTLE_ENDIAN
);
1639 proto_tree_add_item(tlv_tree
, hf_nan_attr_ndpe_tlv_ipv6_interface_identifier
, tvb
, offset
+ 3, 8, ENC_NA
);
1641 dissected_len
+= 11;
1644 proto_tree_add_item(tlv_tree
, hf_nan_oui
, tvb
, offset
+ 3, 3, ENC_NA
);
1645 proto_tree_add_item(tlv_tree
, hf_nan_attr_vendor_specific_body
, tvb
, offset
+ 6, tlv_len
- 3, ENC_NA
);
1646 offset
+= tlv_len
+ 3;
1647 dissected_len
+= tlv_len
+ 3;
1650 proto_tree_add_item(tlv_tree
, hf_nan_attr_vendor_specific_body
, tvb
, offset
+ 3, tlv_len
, ENC_NA
);
1651 offset
+= tlv_len
+ 3;
1652 dissected_len
+= tlv_len
+ 3;
1659 dissect_attr_availability(proto_tree
* attr_tree
, tvbuff_t
* tvb
, int offset
, uint16_t attr_len
, packet_info
* pinfo
)
1661 if (attr_len
< NAN_AVAILABILITY_MIN_LENGTH
)
1663 expert_add_info(pinfo
, attr_tree
, &ei_nan_elem_len_invalid
);
1667 static int* const availability_ctr_fields
[] = {
1668 &hf_nan_attr_availability_map_id
,
1669 &hf_nan_attr_availability_committed_changed
,
1670 &hf_nan_attr_availability_potential_changed
,
1671 &hf_nan_attr_availability_public_availability_changed
,
1672 &hf_nan_attr_availability_ndc_changed
,
1673 &hf_nan_attr_availability_reserved_multicast_schedule_changed
,
1674 &hf_nan_attr_availability_reserved_multicast_schedule_change_changed
,
1677 static int* const availability_entry_ctr_fields
[] = {
1678 &hf_nan_attr_availability_entry_ctr_type
,
1679 &hf_nan_attr_availability_entry_ctr_pref
,
1680 &hf_nan_attr_availability_entry_ctr_utilization
,
1681 &hf_nan_attr_availability_entry_ctr_rx_nss
,
1682 &hf_nan_attr_availability_entry_ctr_time_bitmap
,
1686 proto_tree_add_item(attr_tree
, hf_nan_attr_availability_sequence_id
, tvb
,
1687 offset
+ 3, 1, ENC_LITTLE_ENDIAN
);
1688 proto_tree_add_bitmask(attr_tree
, tvb
, offset
+ 4, hf_nan_attr_availability_ctr
,
1689 ett_device_cap_capabilities
, availability_ctr_fields
, ENC_LITTLE_ENDIAN
);
1692 int dissected_len
= 3;
1693 while (dissected_len
< attr_len
)
1695 uint16_t entry_len
= tvb_get_letohs(tvb
, offset
);
1696 uint8_t entry_type
= tvb_get_bits8(tvb
, offset
* 8 + 21, 3);
1697 uint8_t hdr_len
= 2;
1698 uint32_t time_bitmap_len
= 0;
1699 uint64_t avail_entry
;
1700 const char* entry_type_msg
= val_to_str(entry_type
, availability_entry_type
,
1701 "Unknown type (%u)");
1702 char* info_msg
= wmem_strconcat(pinfo
->pool
, "Availability Type : ", entry_type_msg
, NULL
);
1703 proto_tree
* entry_tree
= proto_tree_add_subtree(attr_tree
, tvb
, offset
, entry_len
+ 2,
1704 ett_availability_entry
, NULL
, info_msg
);
1705 proto_tree_add_item(entry_tree
, hf_nan_attr_availability_entry_len
, tvb
,
1706 offset
, 2, ENC_LITTLE_ENDIAN
);
1707 proto_tree_add_bitmask_ret_uint64(entry_tree
, tvb
, offset
+ 2, hf_nan_attr_availability_entry_ctr
,
1708 ett_availability_entry_ctr
, availability_entry_ctr_fields
, ENC_LITTLE_ENDIAN
, &avail_entry
);
1711 bool time_bitmap_present
= avail_entry
& (1 << 12);
1712 if (time_bitmap_present
)
1714 proto_tree_add_bitmask(entry_tree
, tvb
, offset
,
1715 hf_nan_time_bitmap_ctrl
, ett_time_bitmap_ctrl
,
1716 time_bitmap_ctr_fields
, ENC_LITTLE_ENDIAN
);
1717 proto_tree_add_item_ret_uint(entry_tree
, hf_nan_time_bitmap_len
, tvb
,
1718 offset
+ 2, 1, ENC_LITTLE_ENDIAN
, &time_bitmap_len
);
1719 proto_tree_add_item(entry_tree
, hf_nan_time_bitmap
, tvb
,
1720 offset
+ 3, time_bitmap_len
, ENC_NA
);
1722 offset
+= 3 + time_bitmap_len
;
1725 int entries_len
= entry_len
- hdr_len
- time_bitmap_len
;
1726 proto_tree
* entries_tree
= proto_tree_add_subtree(entry_tree
, tvb
, offset
, entries_len
,
1727 ett_availability_entry_entries
, NULL
, "Band/Channel Entries");
1729 uint64_t entries_type
, non_contiguous_bw
, num_entries
;
1730 proto_tree_add_bits_ret_val(entries_tree
, hf_nan_attr_availability_entry_entries_type
, tvb
,
1731 offset
* 8, 1, &entries_type
, ENC_LITTLE_ENDIAN
);
1732 proto_tree_add_bits_ret_val(entries_tree
,
1733 hf_nan_attr_availability_entry_entries_non_contiguous_bw
, tvb
, offset
* 8 + 1, 1,
1734 &non_contiguous_bw
, ENC_LITTLE_ENDIAN
);
1735 proto_tree_add_bits_ret_val(entries_tree
, hf_nan_attr_availability_entry_entries_num_entries
,
1736 tvb
, offset
* 8 + 4, 4, &num_entries
, ENC_LITTLE_ENDIAN
);
1739 for (uint8_t i
= 0; i
< num_entries
; i
++)
1741 switch (entries_type
) {
1744 proto_tree_add_item(entries_tree
, hf_nan_attr_availability_entry_entries_band
, tvb
,
1745 offset
, 1, ENC_LITTLE_ENDIAN
);
1751 int channel_entry_len
= (non_contiguous_bw
== 0) ? 4 : 6;
1752 proto_tree
* channel_tree
= proto_tree_add_subtree(entries_tree
, tvb
, offset
,
1753 channel_entry_len
, ett_availability_entry_entries_channel
, NULL
, "Channel Entry");
1754 uint8_t op_class
= tvb_get_uint8(tvb
, offset
);
1755 uint16_t bitmap
= tvb_get_uint16(tvb
, offset
+ 1, ENC_LITTLE_ENDIAN
);
1756 proto_tree
* op_class_tree
= proto_tree_add_subtree(channel_tree
, tvb
, offset
, 1, ett_availability_op_class
, NULL
, "Operating Class");
1757 proto_tree_add_item(op_class_tree
, hf_nan_attr_availability_entry_entries_start_freq
, tvb
, offset
, 1, ENC_LITTLE_ENDIAN
);
1758 proto_tree_add_item(op_class_tree
, hf_nan_attr_availability_entry_entries_bandwidth
, tvb
, offset
, 1, ENC_LITTLE_ENDIAN
);
1760 str
= wmem_strbuf_new(pinfo
->pool
, "");
1763 for(unsigned i_bitmap
= 0; i_bitmap
< 16; ++i_bitmap
)
1765 if (bitmap
& (1u << i_bitmap
))
1768 const int *channel_set
= rval_to_channel_set(op_class
, op_class_channel
);
1769 if (channel_set
== NULL
)
1771 expert_add_info(pinfo
, channel_tree
, &ei_nan_unknown_op_class
);
1774 int channel
= channel_set
[i_bitmap
];
1778 // TODO: replace these magic numbers (or use 802.11 dissector for this)
1780 wmem_strbuf_append_printf(str
, "%s", "Derived from regulation ");
1783 wmem_strbuf_append_printf(str
, "%s", "Vendor Specific ");
1786 wmem_strbuf_append_printf(str
, "%s", "Reserved ");
1789 wmem_strbuf_append_printf(str
, "%d ", channel
);
1794 proto_tree_add_string(channel_tree
, hf_nan_attr_availability_entry_entries_channel_set
, tvb
, offset
+ 1, 2, wmem_strbuf_finalize(str
));
1798 /* This is the new and standard rules for mapping channels for 6G channels introduced in NAN R4.
1799 * Some vendors may have already implemetned a different approach to support NAN 6G before
1800 * the introduction of standard 6G NAN operation. And hence, in this case, the availability
1801 * may not be correct. */
1802 uint8_t start_ch_number
= bitmap
& 0xff;
1803 uint8_t number_of_chs
= (bitmap
& 0xff00) >> 8;
1805 const int *channel_set_higher_op_class
= rval_to_channel_set(op_class
, op_class_channel
);
1806 if (channel_set_higher_op_class
)
1808 unsigned int start_ch_number_idx
= channel_number_valid(start_ch_number
, channel_set_higher_op_class
);
1809 if (start_ch_number_idx
== PACKET_WIFI_NAN_MAX_CHANNEL_SET_LEN
)
1811 /* The given channel number does not belong to this operating class */
1812 expert_add_info(pinfo
, channel_tree
, &ei_nan_invalid_channel_num_for_op_class
);
1815 if (!number_of_chs
|| number_of_chs
> PACKET_WIFI_NAN_MAX_CHANNEL_SET_LEN
)
1817 /* Number of channel should at least be one and should not exceed the maximum */
1818 expert_add_info(pinfo
, channel_tree
, &ei_nan_invalid_channel_count
);
1821 uint8_t number_of_chs_max
=
1822 (number_of_chs
+ start_ch_number_idx
< PACKET_WIFI_NAN_MAX_CHANNEL_SET_LEN
) ?
1823 (number_of_chs
+ start_ch_number_idx
) : PACKET_WIFI_NAN_MAX_CHANNEL_SET_LEN
;
1824 for (uint8_t num_ch
= start_ch_number_idx
; num_ch
< number_of_chs_max
; num_ch
++)
1826 wmem_strbuf_append_printf(str
, "%d ", channel_set_higher_op_class
[num_ch
]);
1831 expert_add_info(pinfo
, channel_tree
, &ei_nan_unknown_op_class
);
1833 proto_tree_add_item(channel_tree
, hf_nan_attr_availability_entry_entries_start_channel_number
, tvb
, offset
+ 1, 1, ENC_LITTLE_ENDIAN
);
1834 proto_tree_add_item(channel_tree
, hf_nan_attr_availability_entry_entries_number_of_ch_included
, tvb
, offset
+ 2, 1, ENC_LITTLE_ENDIAN
);
1836 proto_tree_add_string(channel_tree
, hf_nan_attr_availability_entry_entries_channel_set
, tvb
, offset
+ 1, 2, wmem_strbuf_finalize(str
));
1838 proto_tree_add_item(channel_tree
,
1839 hf_nan_attr_availability_entry_entries_primary_channel_bitmap
, tvb
,
1840 offset
+ 3, 1, ENC_LITTLE_ENDIAN
);
1842 if (non_contiguous_bw
== 1)
1844 proto_tree_add_item(channel_tree
,
1845 hf_nan_attr_availability_entry_entries_aux_channel_bitmap
, tvb
,
1846 offset
+ 4, 2, ENC_LITTLE_ENDIAN
);
1848 offset
+= channel_entry_len
;
1853 dissected_len
+= entry_len
+ 2;
1858 dissect_attr_ndc(proto_tree
* attr_tree
, tvbuff_t
* tvb
, int offset
, uint16_t attr_len
, packet_info
* pinfo
)
1860 if (attr_len
< NAN_NDC_MIN_LENGTH
)
1862 expert_add_info(pinfo
, attr_tree
, &ei_nan_elem_len_invalid
);
1866 static int* const ndc_ctr_fields
[] = {
1867 &hf_nan_attr_ndc_ctrl_selected
,
1871 static int* const ndc_map_id_fields
[] = {
1872 &hf_nan_attr_ndc_map_id_related_sch
,
1876 proto_tree_add_item(attr_tree
, hf_nan_attr_ndc_id
, tvb
, offset
+ 3, 6, ENC_NA
);
1877 proto_tree_add_bitmask(attr_tree
, tvb
, offset
+ 9, hf_nan_attr_ndc_ctrl
,
1878 ett_ndc_ctr
, ndc_ctr_fields
, ENC_LITTLE_ENDIAN
);
1881 int dissected_len
= 7;
1882 while (dissected_len
< attr_len
)
1884 uint8_t time_bitmap_len
= tvb_get_uint8(tvb
, offset
+ 3);
1885 proto_tree
* entry_tree
= proto_tree_add_subtree(attr_tree
, tvb
, offset
,
1886 time_bitmap_len
+ 4, ett_ndc_entries
, NULL
, "Schedule Entry");
1887 proto_tree_add_bitmask(entry_tree
, tvb
, offset
, hf_nan_map_id
,
1888 ett_device_ndc_map_id
, ndc_map_id_fields
, ENC_LITTLE_ENDIAN
);
1889 proto_tree_add_bitmask(entry_tree
, tvb
, offset
+ 1,
1890 hf_nan_time_bitmap_ctrl
, ett_time_bitmap_ctrl
,
1891 time_bitmap_ctr_fields
, ENC_LITTLE_ENDIAN
);
1892 proto_tree_add_item(entry_tree
, hf_nan_time_bitmap_len
, tvb
,
1893 offset
+ 3, 1, ENC_BIG_ENDIAN
);
1894 proto_tree_add_item(entry_tree
, hf_nan_time_bitmap
, tvb
,
1895 offset
+ 4, time_bitmap_len
, ENC_NA
);
1897 offset
+= time_bitmap_len
+ 4;
1898 dissected_len
+= time_bitmap_len
+ 4;
1903 dissect_attr_ndl(proto_tree
* attr_tree
, tvbuff_t
* tvb
, int offset
, uint16_t attr_len
, packet_info
* pinfo
)
1905 if (attr_len
< NAN_NDL_MIN_LENGTH
)
1907 expert_add_info(pinfo
, attr_tree
, &ei_nan_elem_len_invalid
);
1911 unsigned sub_offset
= offset
+ 3;
1912 unsigned dissected_len
= 0;
1913 proto_tree_add_item(attr_tree
, hf_nan_dialog_tokens
, tvb
, sub_offset
, 1, ENC_BIG_ENDIAN
);
1916 static int* const ndl_type_status_fields
[] = {
1917 &hf_nan_attr_ndl_type
,
1921 static int* const ndl_control_fields
[] = {
1922 &hf_nan_attr_ndl_ctrl_peer_id
,
1923 &hf_nan_attr_ndl_ctrl_immutable_schedule_pres
,
1924 &hf_nan_attr_ndl_ctrl_ndc_pres
,
1925 &hf_nan_attr_ndl_ctrl_qos
,
1926 &hf_nan_attr_ndl_ctrl_max_idle_pres
,
1927 &hf_nan_attr_ndl_ctrl_type
,
1928 &hf_nan_attr_ndl_ctrl_setup_reason
,
1932 proto_tree_add_bitmask(attr_tree
, tvb
, sub_offset
, hf_nan_type_status
,
1933 ett_type_status
, ndl_type_status_fields
, ENC_LITTLE_ENDIAN
);
1935 proto_tree_add_item(attr_tree
, hf_nan_reason_code
, tvb
, sub_offset
, 1, ENC_BIG_ENDIAN
);
1937 proto_tree_add_bitmask(attr_tree
, tvb
, sub_offset
, hf_nan_attr_ndl_control
,
1938 ett_ndl_control
, ndl_control_fields
, ENC_LITTLE_ENDIAN
);
1940 uint8_t peer_id_pres
= tvb_get_bits8(tvb
, sub_offset
* 8 + 7, 1);
1941 uint8_t immutable_sched_pres
= tvb_get_bits8(tvb
, sub_offset
* 8 + 6, 1);
1942 uint8_t idle_per
= tvb_get_bits8(tvb
, sub_offset
* 8 + 3, 1);
1948 proto_tree_add_item(attr_tree
, hf_nan_attr_ndl_reserved_peer_id
, tvb
, sub_offset
, 1, ENC_BIG_ENDIAN
);
1954 proto_tree_add_item(attr_tree
, hf_nan_attr_ndl_max_idle
, tvb
, sub_offset
, 2, ENC_LITTLE_ENDIAN
);
1958 if (immutable_sched_pres
)
1960 char* info_msg
= "Immutable Schedule entry list";
1961 proto_tree
* sub_attr_tree
= proto_tree_add_subtree(attr_tree
, tvb
, sub_offset
, attr_len
- dissected_len
,
1962 ett_ndl_schedule_entries
, NULL
, info_msg
);
1963 while (dissected_len
< attr_len
)
1965 proto_tree_add_item(sub_attr_tree
, hf_nan_map_id
, tvb
, sub_offset
, 1, ENC_BIG_ENDIAN
);
1967 proto_tree_add_bitmask(sub_attr_tree
, tvb
, sub_offset
, hf_nan_time_bitmap_ctrl
, ett_time_bitmap_ctrl
,
1968 time_bitmap_ctr_fields
, ENC_LITTLE_ENDIAN
);
1970 unsigned field_length
= tvb_get_uint8(tvb
, sub_offset
);
1971 proto_tree_add_item(sub_attr_tree
, hf_nan_time_bitmap_len
, tvb
, sub_offset
, 1, ENC_BIG_ENDIAN
);
1973 proto_tree_add_item(sub_attr_tree
, hf_nan_time_bitmap
, tvb
, sub_offset
, field_length
, ENC_NA
);
1974 sub_offset
+= field_length
;
1975 dissected_len
+= field_length
+ 4;
1981 dissect_attr_ndl_qos(proto_tree
* attr_tree
, tvbuff_t
* tvb
, int offset
, uint16_t attr_len
, packet_info
* pinfo
)
1983 if (attr_len
!= NAN_NDL_QOS_LENGTH
)
1985 expert_add_info(pinfo
, attr_tree
, &ei_nan_elem_len_invalid
);
1989 unsigned sub_offset
= offset
+ 3;
1990 proto_tree_add_item(attr_tree
, hf_nan_attr_ndlqos_min_time_slots
, tvb
, sub_offset
, 1, ENC_BIG_ENDIAN
);
1992 proto_tree_add_item(attr_tree
, hf_nan_attr_ndlqos_max_latency
, tvb
, sub_offset
, 2, ENC_LITTLE_ENDIAN
);
1996 dissect_attr_unaligned_schedule(proto_tree
* attr_tree
, tvbuff_t
* tvb
, int offset
, uint16_t attr_len
, packet_info
* pinfo
)
1998 if (attr_len
< NAN_UNALIGNED_SCH_MIN_LENGTH
)
2000 expert_add_info(pinfo
, attr_tree
, &ei_nan_elem_len_invalid
);
2004 unsigned sub_offset
= offset
+ 3;
2005 unsigned dissected_len
= 0;
2006 static int* const control_fields
[] = {
2007 &hf_nan_attr_unaligned_sch_ctrl_schedule_id
,
2008 &hf_nan_attr_unaligned_sch_ctrl_seq_id
,
2012 proto_tree_add_bitmask(attr_tree
, tvb
, sub_offset
, hf_nan_attr_unaligned_sch_ctrl
,
2013 ett_unaligned_sch_ctrl
, control_fields
, ENC_LITTLE_ENDIAN
);
2015 proto_tree_add_item(attr_tree
, hf_nan_attr_unaligned_sch_starting_time
, tvb
, sub_offset
, 4, ENC_LITTLE_ENDIAN
);
2017 proto_tree_add_item(attr_tree
, hf_nan_attr_unaligned_sch_duration
, tvb
, sub_offset
, 4, ENC_LITTLE_ENDIAN
);
2019 proto_tree_add_item(attr_tree
, hf_nan_attr_unaligned_sch_period
, tvb
, sub_offset
, 4, ENC_LITTLE_ENDIAN
);
2021 proto_tree_add_item(attr_tree
, hf_nan_attr_unaligned_sch_count_down
, tvb
, sub_offset
, 1, ENC_BIG_ENDIAN
);
2024 static int* const ulw_overwrite_fields
[] = {
2025 &hf_nan_attr_unaligned_sch_ulw_overwrite_all
,
2026 &hf_nan_attr_unaligned_sch_ulw_overwrite_map_id
,
2030 proto_tree_add_bitmask(attr_tree
, tvb
, sub_offset
, hf_nan_attr_unaligned_sch_ulw_overwrite
,
2031 ett_unaligned_sch_ulw_overwrite
, ulw_overwrite_fields
, ENC_LITTLE_ENDIAN
);
2033 dissected_len
+= 16;
2035 // ULW Control and Band ID or Channel Entry present
2036 if (dissected_len
< attr_len
)
2038 static int* const ulw_control_fields
[] = {
2039 &hf_nan_attr_unaligned_sch_ulw_ctrl_type
,
2040 &hf_nan_attr_unaligned_sch_ulw_ctrl_channel_av
,
2041 &hf_nan_attr_unaligned_sch_ulw_ctrl_rxnss
,
2045 proto_tree_add_bitmask(attr_tree
, tvb
, sub_offset
, hf_nan_attr_unaligned_sch_ulw_ctrl
,
2046 ett_unaligned_sch_ulw_ctrl
, ulw_control_fields
, ENC_LITTLE_ENDIAN
);
2047 uint8_t entry_type
= tvb_get_bits8(tvb
, sub_offset
* 8 + 6, 2);
2052 case NAN_UNALIGNED_SCH_BAND_ID_EXIST
:
2053 proto_tree_add_item(attr_tree
, hf_nan_attr_availability_entry_entries_band
,
2054 tvb
, sub_offset
, 1, ENC_LITTLE_ENDIAN
);
2057 case NAN_UNALIGNED_SCH_CHANNEL_ENTRY_EXIST
:
2059 proto_tree
* channel_tree
= proto_tree_add_subtree(attr_tree
, tvb
, sub_offset
, 4,
2060 ett_availability_entry_entries_channel
, NULL
, "Channel Entry");
2061 proto_tree_add_item(channel_tree
, hf_nan_attr_availability_entry_entries_channel_op_class
,
2062 tvb
, sub_offset
, 1, ENC_LITTLE_ENDIAN
);
2064 proto_tree_add_item(channel_tree
, hf_nan_attr_availability_entry_entries_channel_bitmap
,
2065 tvb
, sub_offset
, 2, ENC_LITTLE_ENDIAN
);
2067 proto_tree_add_item(channel_tree
, hf_nan_attr_availability_entry_entries_primary_channel_bitmap
,
2068 tvb
, sub_offset
, 1, ENC_LITTLE_ENDIAN
);
2071 case NAN_UNALIGNED_SCH_CHANNEL_ENTRY_W_AUX_EXIST
:
2073 proto_tree
* channel_tree
= proto_tree_add_subtree(attr_tree
, tvb
, sub_offset
, 4,
2074 ett_availability_entry_entries_channel
, NULL
, "Channel Entry");
2075 proto_tree_add_item(channel_tree
, hf_nan_attr_availability_entry_entries_channel_op_class
,
2076 tvb
, sub_offset
, 1, ENC_LITTLE_ENDIAN
);
2078 proto_tree_add_item(channel_tree
, hf_nan_attr_availability_entry_entries_channel_bitmap
,
2079 tvb
, sub_offset
, 2, ENC_LITTLE_ENDIAN
);
2081 proto_tree_add_item(channel_tree
, hf_nan_attr_availability_entry_entries_primary_channel_bitmap
,
2082 tvb
, sub_offset
, 1, ENC_LITTLE_ENDIAN
);
2084 proto_tree_add_item(channel_tree
, hf_nan_attr_availability_entry_entries_aux_channel_bitmap
,
2085 tvb
, sub_offset
, 2, ENC_LITTLE_ENDIAN
);
2093 dissect_attr_ranging_info(proto_tree
* attr_tree
, tvbuff_t
* tvb
, int offset
)
2095 unsigned sub_offset
= offset
+ 3;
2096 static int* const location_info_availability_fields
[] = {
2097 &hf_nan_attr_ranging_info_location_info_avail_lci
,
2098 &hf_nan_attr_ranging_info_location_info_avail_geospatial
,
2099 &hf_nan_attr_ranging_info_location_info_avail_civic_location
,
2100 &hf_nan_attr_ranging_info_location_info_avail_last_movement_pres
,
2104 proto_tree_add_bitmask(attr_tree
, tvb
, sub_offset
, hf_nan_attr_ranging_info_location_info_avail
,
2105 ett_ranging_info_location_info_availability
, location_info_availability_fields
, ENC_LITTLE_ENDIAN
);
2106 bool loc_exists
= tvb_get_bits8(tvb
, sub_offset
* 8 + 4, 1);
2110 proto_tree_add_item(attr_tree
, hf_nan_attr_ranging_info_last_movement_indication
, tvb
, sub_offset
, 2, ENC_LITTLE_ENDIAN
);
2115 dissect_attr_ranging_setup(proto_tree
* attr_tree
, tvbuff_t
* tvb
, int offset
, uint16_t attr_len
, packet_info
* pinfo
)
2117 if (attr_len
< NAN_RANGING_SETUP_MIN_LENGTH
)
2119 expert_add_info(pinfo
, attr_tree
, &ei_nan_elem_len_invalid
);
2123 unsigned sub_offset
= offset
+ 3;
2124 unsigned dissected_len
= 0;
2125 proto_tree_add_item(attr_tree
, hf_nan_dialog_tokens
, tvb
, sub_offset
, 1, ENC_BIG_ENDIAN
);
2128 static int* const ranging_setup_type_status_fields
[] = {
2129 &hf_nan_attr_ranging_setup_type
,
2133 static int* const ranging_setup_ctrl_fields
[] = {
2134 &hf_nan_attr_ranging_setup_ctrl_report_req
,
2135 &hf_nan_attr_ranging_setup_ctrl_ftm_params
,
2136 &hf_nan_attr_ranging_setup_ctrl_entry_list
,
2140 proto_tree_add_bitmask(attr_tree
, tvb
, sub_offset
, hf_nan_type_status
,
2141 ett_type_status
, ranging_setup_type_status_fields
, ENC_LITTLE_ENDIAN
);
2143 proto_tree_add_item(attr_tree
, hf_nan_reason_code
, tvb
, sub_offset
, 1, ENC_BIG_ENDIAN
);
2145 proto_tree_add_bitmask(attr_tree
, tvb
, sub_offset
, hf_nan_attr_ranging_setup_ctrl
,
2146 ett_ranging_setup_ctrl
, ranging_setup_ctrl_fields
, ENC_LITTLE_ENDIAN
);
2147 uint8_t ftm_check
= tvb_get_bits8(tvb
, sub_offset
* 8 + 6, 1);
2148 uint8_t ranging_entry_check
= tvb_get_bits8(tvb
, sub_offset
* 8 + 5, 1);
2154 static int* const ranging_setup_ftm_param_fields
[] = {
2155 &hf_nan_attr_ranging_setup_ftm_max_burst_duration
,
2156 &hf_nan_attr_ranging_setup_ftm_min_delta
,
2157 &hf_nan_attr_ranging_setup_ftm_max_per_burst
,
2158 &hf_nan_attr_ranging_setup_ftm_format_bw
,
2162 proto_tree_add_bitmask(attr_tree
, tvb
, sub_offset
, hf_nan_attr_ranging_setup_ftm_params
,
2163 ett_ranging_setup_ftm_params
, ranging_setup_ftm_param_fields
, ENC_LITTLE_ENDIAN
);
2167 if (ranging_entry_check
)
2169 char* info_msg
= "Ranging Schedule Entry List";
2170 proto_tree
* sub_attr_tree
= proto_tree_add_subtree(attr_tree
, tvb
, sub_offset
, attr_len
- dissected_len
,
2171 ett_ranging_setup_schedule_entries
, NULL
, info_msg
);
2173 while (dissected_len
< attr_len
)
2175 proto_tree_add_item(sub_attr_tree
, hf_nan_map_id
, tvb
, sub_offset
, 1, ENC_BIG_ENDIAN
);
2177 proto_tree_add_bitmask(sub_attr_tree
, tvb
, sub_offset
, hf_nan_time_bitmap_ctrl
, ett_time_bitmap_ctrl
,
2178 time_bitmap_ctr_fields
, ENC_LITTLE_ENDIAN
);
2180 unsigned field_length
= tvb_get_uint8(tvb
, sub_offset
);
2181 proto_tree_add_item(sub_attr_tree
, hf_nan_time_bitmap_len
, tvb
, sub_offset
, 1, ENC_BIG_ENDIAN
);
2183 proto_tree_add_item(sub_attr_tree
, hf_nan_time_bitmap
, tvb
, sub_offset
, field_length
, ENC_NA
);
2184 sub_offset
+= field_length
;
2185 dissected_len
+= field_length
+ 4;
2191 dissect_attr_ftm_report(proto_tree
* attr_tree
, tvbuff_t
* tvb
, int offset
)
2193 unsigned sub_offset
= offset
+ 3;
2194 proto_tree_add_item(attr_tree
, hf_nan_attr_ftm_range_report
, tvb
, sub_offset
, -1, ENC_NA
);
2198 dissect_attr_element_container(proto_tree
* attr_tree
, tvbuff_t
* tvb
, int offset
, uint16_t attr_len
, packet_info
* pinfo
)
2200 unsigned sub_offset
= offset
+ 3;
2202 // Some header fields and trees are reused.
2203 static int* const container_map_id_fields
[] = {
2204 &hf_nan_attr_device_cap_map_id_apply_to
,
2205 &hf_nan_attr_device_cap_map_id_associated_maps
,
2208 proto_tree_add_bitmask(attr_tree
, tvb
, sub_offset
, hf_nan_map_id
,
2209 ett_device_cap_map_id
, container_map_id_fields
, ENC_LITTLE_ENDIAN
);
2211 unsigned dissected_length
= 1;
2212 proto_tree
* sub_tree
;
2213 while (dissected_length
< attr_len
)
2215 unsigned element_id
= tvb_get_uint8(tvb
, sub_offset
);
2216 unsigned element_len
= tvb_get_uint8(tvb
, sub_offset
+ 1);
2217 const char* msg
= val_to_str(element_id
, ie_tag_num_vals
, "Unknown element ID (%u)");
2219 sub_tree
= proto_tree_add_subtree(attr_tree
, tvb
, sub_offset
, element_len
+ 2, ett_ie_tree
, NULL
, msg
);
2220 proto_tree_add_item(sub_tree
, hf_nan_attr_container_element_id
, tvb
, sub_offset
, 1, ENC_BIG_ENDIAN
);
2222 proto_tree_add_item(sub_tree
, hf_nan_attr_container_element_len
, tvb
, sub_offset
, 1, ENC_BIG_ENDIAN
);
2225 ieee80211_tagged_field_data_t field_data
= { 0 };
2226 tvbuff_t
* ie_tvb
= tvb_new_subset_length(tvb
, sub_offset
, element_len
);
2227 field_data
.item_tag
= sub_tree
;
2228 dissector_try_uint_with_data(ie_handle_table
, element_id
, ie_tvb
, pinfo
, sub_tree
, true, &field_data
);
2229 sub_offset
+= element_len
;
2230 dissected_length
+= element_len
+ 2;
2235 dissect_attr_extended_wlan_infra(proto_tree
* attr_tree
, tvbuff_t
* tvb
, int offset
, uint16_t attr_len
, packet_info
* pinfo
)
2237 if (attr_len
!= NAN_EXTENDED_WLAN_INFRA_LENGTH
)
2239 expert_add_info(pinfo
, attr_tree
, &ei_nan_elem_len_invalid
);
2243 unsigned sub_offset
= offset
+ 3;
2244 proto_tree_add_item(attr_tree
, hf_nan_bss_id
, tvb
, sub_offset
, 6, ENC_LITTLE_ENDIAN
);
2246 proto_tree_add_item(attr_tree
, hf_nan_mac_address
, tvb
, sub_offset
, 6, ENC_NA
);
2248 proto_tree_add_item(attr_tree
, hf_nan_attr_wlan_infra_device_role
, tvb
, sub_offset
, 1, ENC_BIG_ENDIAN
);
2251 char* info_msg
= "Non-NAN Operating Channel Information";
2252 proto_tree
* sub_attr_tree_op
= proto_tree_add_subtree(attr_tree
, tvb
, sub_offset
, 3,
2253 ett_non_nan_op_channel
, NULL
, info_msg
);
2254 proto_tree_add_item(sub_attr_tree_op
, hf_nan_non_op_channel_global_op_class
, tvb
, sub_offset
, 1, ENC_BIG_ENDIAN
);
2256 proto_tree_add_item(sub_attr_tree_op
, hf_nan_non_op_channel_channel
, tvb
, sub_offset
, 1, ENC_BIG_ENDIAN
);
2258 proto_tree_add_item(sub_attr_tree_op
, hf_nan_non_op_channel_center_freq
, tvb
, sub_offset
, 1, ENC_BIG_ENDIAN
);
2261 char* info_msg_beacon
= "Non-NAN Beacon Information";
2262 proto_tree
* sub_attr_tree_beacon
= proto_tree_add_subtree(attr_tree
, tvb
, sub_offset
, 4,
2263 ett_non_nan_beacon
, NULL
, info_msg_beacon
);
2264 proto_tree_add_item(sub_attr_tree_beacon
, hf_nan_non_beacon_tbtt_offset
, tvb
, sub_offset
, 2, ENC_LITTLE_ENDIAN
);
2266 proto_tree_add_item(sub_attr_tree_beacon
, hf_nan_non_beacon_interval
, tvb
, sub_offset
, 2, ENC_LITTLE_ENDIAN
);
2271 dissect_attr_extended_p2p_operation(proto_tree
* attr_tree
, tvbuff_t
* tvb
, int offset
, uint16_t attr_len
, packet_info
* pinfo
)
2273 if (attr_len
!= NAN_EXTENDED_P2P_OP_LENGTH
)
2275 expert_add_info(pinfo
, attr_tree
, &ei_nan_elem_len_invalid
);
2279 unsigned sub_offset
= offset
+ 3;
2280 static int* const ext_p2p_bitmap_fields
[] = {
2281 &hf_nan_attr_p2p_device_role_device
,
2282 &hf_nan_attr_p2p_device_role_group_owner
,
2283 &hf_nan_attr_p2p_device_role_client
,
2287 proto_tree_add_bitmask(attr_tree
, tvb
, sub_offset
, hf_nan_attr_p2p_device_role
,
2288 ett_p2p_device_role
, ext_p2p_bitmap_fields
, ENC_LITTLE_ENDIAN
);
2290 proto_tree_add_item(attr_tree
, hf_nan_mac_address
, tvb
, sub_offset
, 6, ENC_NA
);
2293 char* info_msg
= "Non-NAN Operating Channel Information";
2294 proto_tree
* sub_attr_tree_op
= proto_tree_add_subtree(attr_tree
, tvb
, sub_offset
, 3,
2295 ett_non_nan_op_channel
, NULL
, info_msg
);
2296 proto_tree_add_item(sub_attr_tree_op
, hf_nan_non_op_channel_global_op_class
, tvb
, sub_offset
, 1, ENC_BIG_ENDIAN
);
2298 proto_tree_add_item(sub_attr_tree_op
, hf_nan_non_op_channel_channel
, tvb
, sub_offset
, 1, ENC_BIG_ENDIAN
);
2300 proto_tree_add_item(sub_attr_tree_op
, hf_nan_non_op_channel_center_freq
, tvb
, sub_offset
, 1, ENC_BIG_ENDIAN
);
2303 char* info_msg_beacon
= "Non-NAN Beacon Information";
2304 proto_tree
* sub_attr_tree_beacon
= proto_tree_add_subtree(attr_tree
, tvb
, sub_offset
, 4,
2305 ett_non_nan_beacon
, NULL
, info_msg_beacon
);
2306 proto_tree_add_item(sub_attr_tree_beacon
, hf_nan_non_beacon_tbtt_offset
, tvb
, sub_offset
, 2, ENC_LITTLE_ENDIAN
);
2308 proto_tree_add_item(sub_attr_tree_beacon
, hf_nan_non_beacon_interval
, tvb
, sub_offset
, 2, ENC_LITTLE_ENDIAN
);
2313 dissect_attr_extended_ibss(proto_tree
* attr_tree
, tvbuff_t
* tvb
, int offset
, uint16_t attr_len
, packet_info
* pinfo
)
2315 if (attr_len
!= NAN_EXTENDED_IBSS_LENGTH
)
2317 expert_add_info(pinfo
, attr_tree
, &ei_nan_elem_len_invalid
);
2321 unsigned sub_offset
= offset
+ 3;
2322 proto_tree_add_item(attr_tree
, hf_nan_bss_id
, tvb
, sub_offset
, 6, ENC_LITTLE_ENDIAN
);
2324 proto_tree_add_item(attr_tree
, hf_nan_mac_address
, tvb
, sub_offset
, 6, ENC_NA
);
2327 char* info_msg
= "Non-NAN Operating Channel Information";
2328 proto_tree
* sub_attr_tree_op
= proto_tree_add_subtree(attr_tree
, tvb
, sub_offset
, 3,
2329 ett_non_nan_op_channel
, NULL
, info_msg
);
2330 proto_tree_add_item(sub_attr_tree_op
, hf_nan_non_op_channel_global_op_class
, tvb
, sub_offset
, 1, ENC_BIG_ENDIAN
);
2332 proto_tree_add_item(sub_attr_tree_op
, hf_nan_non_op_channel_channel
, tvb
, sub_offset
, 1, ENC_BIG_ENDIAN
);
2334 proto_tree_add_item(sub_attr_tree_op
, hf_nan_non_op_channel_center_freq
, tvb
, sub_offset
, 1, ENC_BIG_ENDIAN
);
2337 char* info_msg_beacon
= "Non-NAN Beacon Information";
2338 proto_tree
* sub_attr_tree_beacon
= proto_tree_add_subtree(attr_tree
, tvb
, sub_offset
, 4,
2339 ett_non_nan_beacon
, NULL
, info_msg_beacon
);
2340 proto_tree_add_item(sub_attr_tree_beacon
, hf_nan_non_beacon_tbtt_offset
, tvb
, sub_offset
, 2, ENC_LITTLE_ENDIAN
);
2342 proto_tree_add_item(sub_attr_tree_beacon
, hf_nan_non_beacon_interval
, tvb
, sub_offset
, 2, ENC_LITTLE_ENDIAN
);
2347 dissect_attr_extended_mesh(proto_tree
* attr_tree
, tvbuff_t
* tvb
, int offset
, uint16_t attr_len
, packet_info
* pinfo
)
2349 if (attr_len
< NAN_EXTENDED_MESH_MIN_LENGTH
)
2351 expert_add_info(pinfo
, attr_tree
, &ei_nan_elem_len_invalid
);
2355 unsigned sub_offset
= offset
+ 3;
2356 unsigned length
= tvb_get_uint16(tvb
, sub_offset
- 2, ENC_LITTLE_ENDIAN
);
2357 proto_tree_add_item(attr_tree
, hf_nan_mac_address
, tvb
, sub_offset
, 6, ENC_NA
);
2360 char* info_msg
= "Non-NAN Operating Channel Information";
2361 proto_tree
* sub_attr_tree_op
= proto_tree_add_subtree(attr_tree
, tvb
, sub_offset
, 3,
2362 ett_non_nan_op_channel
, NULL
, info_msg
);
2363 proto_tree_add_item(sub_attr_tree_op
, hf_nan_non_op_channel_global_op_class
, tvb
, sub_offset
, 1, ENC_BIG_ENDIAN
);
2365 proto_tree_add_item(sub_attr_tree_op
, hf_nan_non_op_channel_channel
, tvb
, sub_offset
, 1, ENC_BIG_ENDIAN
);
2367 proto_tree_add_item(sub_attr_tree_op
, hf_nan_non_op_channel_center_freq
, tvb
, sub_offset
, 1, ENC_BIG_ENDIAN
);
2370 char* info_msg_beacon
= "Non-NAN Beacon Information";
2371 proto_tree
* sub_attr_tree_beacon
= proto_tree_add_subtree(attr_tree
, tvb
, sub_offset
, 4,
2372 ett_non_nan_beacon
, NULL
, info_msg_beacon
);
2373 proto_tree_add_item(sub_attr_tree_beacon
, hf_nan_non_beacon_tbtt_offset
, tvb
, sub_offset
, 2, ENC_LITTLE_ENDIAN
);
2375 proto_tree_add_item(sub_attr_tree_beacon
, hf_nan_non_beacon_interval
, tvb
, sub_offset
, 2, ENC_LITTLE_ENDIAN
);
2378 proto_tree_add_item(attr_tree
, hf_nan_attr_mesh_id
, tvb
, sub_offset
, length
- sub_offset
+ 3, ENC_NA
);
2382 dissect_attr_cipher_suite_info(proto_tree
* attr_tree
, tvbuff_t
* tvb
, int offset
, uint16_t attr_len
, packet_info
* pinfo
)
2384 if (attr_len
< NAN_CIPHER_SUITE_INFO_MIN_LENGTH
)
2386 expert_add_info(pinfo
, attr_tree
, &ei_nan_elem_len_invalid
);
2390 unsigned sub_offset
= offset
+ 3;
2391 unsigned dissected_len
= 0;
2393 proto_tree
* caps_tree
= proto_tree_add_subtree(attr_tree
, tvb
, sub_offset
, 1, ett_nan_cipher_suite_capabilities
, NULL
, "Capabilities");
2394 proto_tree_add_item(caps_tree
, hf_nan_attr_cipher_suite_capabilities_ndtksa_nmtksa_replay_counters
, tvb
, sub_offset
, 1, ENC_LITTLE_ENDIAN
);
2395 proto_tree_add_item(caps_tree
, hf_nan_attr_cipher_suite_capabilities_gtksa_igtksa_bigtksa_support
, tvb
, sub_offset
, 1, ENC_LITTLE_ENDIAN
);
2396 proto_tree_add_item(caps_tree
, hf_nan_attr_cipher_suite_capabilities_gtksa_replay_counters
, tvb
, sub_offset
, 1, ENC_LITTLE_ENDIAN
);
2397 proto_tree_add_item(caps_tree
, hf_nan_attr_cipher_suite_capabilities_igtksa_bigtksa_cipher
, tvb
, sub_offset
, 1, ENC_LITTLE_ENDIAN
);
2402 char* info_msg
= "Cipher Suite List";
2403 proto_tree
* sub_attr_tree
= proto_tree_add_subtree(attr_tree
, tvb
, sub_offset
, attr_len
- dissected_len
,
2404 ett_cipher_suite_info_list
, NULL
, info_msg
);
2406 while (dissected_len
< attr_len
)
2408 proto_tree_add_item(sub_attr_tree
, hf_nan_attr_cipher_suite_id
, tvb
, sub_offset
, 1, ENC_BIG_ENDIAN
);
2410 proto_tree_add_item(sub_attr_tree
, hf_nan_publish_id
, tvb
, sub_offset
, 1, ENC_BIG_ENDIAN
);
2417 dissect_attr_security_context_info(proto_tree
* attr_tree
, tvbuff_t
* tvb
, int offset
, uint16_t attr_len
, packet_info
* pinfo
)
2419 if (attr_len
< NAN_CIPHER_SUITE_INFO_MIN_LENGTH
)
2421 expert_add_info(pinfo
, attr_tree
, &ei_nan_elem_len_invalid
);
2425 unsigned sub_offset
= offset
+ 3;
2426 unsigned dissected_len
= 0;
2428 while (dissected_len
< attr_len
)
2430 unsigned field_length
= tvb_get_uint16(tvb
, sub_offset
, ENC_LITTLE_ENDIAN
);
2431 proto_item
* sub_attr_tree
= proto_tree_add_subtree(attr_tree
, tvb
, sub_offset
, field_length
+ 4,
2432 ett_attributes
, NULL
, "Security Context Identifier");
2433 proto_tree_add_item(sub_attr_tree
, hf_nan_attr_security_context_identifier_len
, tvb
, sub_offset
, 2, ENC_LITTLE_ENDIAN
);
2435 proto_tree_add_item(sub_attr_tree
, hf_nan_attr_security_context_identifier_type
, tvb
, sub_offset
, 1, ENC_BIG_ENDIAN
);
2437 proto_tree_add_item(sub_attr_tree
, hf_nan_publish_id
, tvb
, sub_offset
, 1, ENC_BIG_ENDIAN
);
2439 proto_tree_add_item(sub_attr_tree
, hf_nan_attr_security_context_identifier
, tvb
, sub_offset
, field_length
, ENC_NA
);
2440 sub_offset
+= field_length
;
2441 dissected_len
+= field_length
+ 4;
2446 dissect_attr_shared_key_descriptor(proto_tree
* attr_tree
, tvbuff_t
* tvb
, int offset
)
2448 unsigned sub_offset
= offset
+ 3;
2449 proto_tree_add_item(attr_tree
, hf_nan_publish_id
, tvb
, sub_offset
, 1, ENC_BIG_ENDIAN
);
2451 proto_tree_add_item(attr_tree
, hf_nan_attr_shared_key_rsna_descriptor
, tvb
, sub_offset
, -1, ENC_NA
);
2455 dissect_attr_public_availability(proto_tree
* attr_tree
, tvbuff_t
* tvb
, int offset
, uint16_t attr_len
, packet_info
* pinfo
)
2457 if (attr_len
< NAN_PUBLIC_AVAIL_MIN_LENGTH
)
2459 expert_add_info(pinfo
, attr_tree
, &ei_nan_elem_len_invalid
);
2463 unsigned sub_offset
= offset
+ 3;
2464 unsigned dissected_len
= 0;
2466 proto_tree
* sub_attr_tree
= proto_tree_add_subtree(attr_tree
, tvb
, sub_offset
, attr_len
,
2467 ett_public_availability_sch_entries
, NULL
, "Public Availability Schedule Entry List");
2468 while (dissected_len
< attr_len
)
2470 proto_tree_add_item(sub_attr_tree
, hf_nan_map_id
, tvb
, sub_offset
, 1, ENC_BIG_ENDIAN
);
2472 proto_tree_add_bitmask(sub_attr_tree
, tvb
, sub_offset
, hf_nan_time_bitmap_ctrl
, ett_time_bitmap_ctrl
,
2473 time_bitmap_ctr_fields
, ENC_LITTLE_ENDIAN
);
2475 unsigned field_length
= tvb_get_uint8(tvb
, sub_offset
);
2476 proto_tree_add_item(sub_attr_tree
, hf_nan_time_bitmap_len
, tvb
, sub_offset
, 1, ENC_BIG_ENDIAN
);
2478 proto_tree_add_item(sub_attr_tree
, hf_nan_time_bitmap
, tvb
, sub_offset
, field_length
, ENC_NA
);
2479 sub_offset
+= field_length
;
2480 dissected_len
+= field_length
+ 4;
2485 dissect_attr_vendor_specific(proto_tree
* attr_tree
, tvbuff_t
* tvb
, int offset
, uint16_t attr_len
, packet_info
* pinfo
)
2487 if (attr_len
< NAN_VENDOR_SPECIFIC_MIN_LENGTH
)
2489 expert_add_info(pinfo
, attr_tree
, &ei_nan_elem_len_invalid
);
2493 unsigned sub_offset
= offset
+ 3;
2494 tvbuff_t
* ie_tvb
= tvb_new_subset_length(tvb
, sub_offset
, -1);
2495 ieee80211_tagged_field_data_t field_data
= { 0 };
2496 field_data
.item_tag
= attr_tree
;
2497 dissector_try_uint_with_data(ie_handle_table
, TAG_VENDOR_SPECIFIC_IE
, ie_tvb
, pinfo
, attr_tree
, true, &field_data
);
2501 dissect_attr_device_capability_extension(proto_tree
* attr_tree
, tvbuff_t
* tvb
, int offset
, uint16_t attr_len
, packet_info
* pinfo
)
2503 if (attr_len
< NAN_DEVICE_CAPABILITY_EXTENSION_MIN_LENGTH
)
2505 /* At least has 9 bits defined in NAN-R4 spec */
2506 expert_add_info(pinfo
, attr_tree
, &ei_nan_elem_len_invalid
);
2510 static int* const capability_info_fields
[] = {
2511 &hf_nan_attr_device_capability_extension_6g_regulatory_info_presented
,
2512 &hf_nan_attr_device_capability_extension_6g_regulatory_info
,
2513 &hf_nan_attr_device_capability_extension_6g_regulatory_info_reserved
,
2514 &hf_nan_attr_device_capability_extension_paring_setup_enabled
,
2515 &hf_nan_attr_device_capability_extension_npk_nik_cache_enabled
,
2519 proto_tree_add_bitmask(attr_tree
, tvb
, offset
+ 3, hf_nan_attr_device_capability_extension
,
2520 ett_device_capability_extension
, capability_info_fields
, ENC_LITTLE_ENDIAN
);
2524 dissect_attr_nan_identity_resolution(proto_tree
* attr_tree
, tvbuff_t
* tvb
, int offset
, uint16_t attr_len
, packet_info
* pinfo
)
2526 if (attr_len
< NAN_IDENTITY_RESOLUTION_MIN_LEN
)
2528 /* At least 1 byte: Cipher version */
2529 expert_add_info(pinfo
, attr_tree
, &ei_nan_elem_len_invalid
);
2533 proto_tree_add_item(attr_tree
, hf_nan_attr_identity_cipher_version
, tvb
,
2534 offset
+ 3, 1, ENC_LITTLE_ENDIAN
);
2536 uint8_t cipher_version
= tvb_get_uint8(tvb
, offset
+ 3);
2537 switch (cipher_version
)
2540 proto_tree_add_item(attr_tree
, hf_nan_attr_identity_resolution_nonce
, tvb
,
2541 offset
+ 4, 8, ENC_NA
);
2542 proto_tree_add_item(attr_tree
, hf_nan_attr_identity_resolution_tag
, tvb
,
2543 offset
+ 12, 8, ENC_NA
);
2546 proto_tree_add_item(attr_tree
, hf_nan_attr_reserved
, tvb
,
2547 offset
+ 3, attr_len
- 1, ENC_NA
);
2552 dissect_attr_nan_pairing_bootstrapping(proto_tree
* attr_tree
, tvbuff_t
* tvb
, int offset
, uint16_t attr_len
, packet_info
* pinfo
)
2554 if (attr_len
< NAN_PAIRING_BOOTSTRAPPING_LEN
)
2556 /* At least 5 bytes: Dialog Token(1) + Type and Status(1) + Reason Code(1) + Pairing Bootstrapping Method(2) */
2557 expert_add_info(pinfo
, attr_tree
, &ei_nan_elem_len_invalid
);
2560 int npba_local_offset
= offset
+ 3;
2563 proto_tree_add_item(attr_tree
, hf_nan_attr_pairing_bootstrapping_dialog_token
, tvb
,
2564 npba_local_offset
, 1, ENC_LITTLE_ENDIAN
);
2565 npba_local_offset
+= 1;
2567 /* Type and Status */
2568 uint8_t type_status
= tvb_get_uint8(tvb
, npba_local_offset
);
2569 uint8_t type
= type_status
& 0x0f;
2570 uint8_t status
= (type_status
& 0xf0) >> 4;
2572 static int* const type_and_status_fields
[] = {
2573 &hf_nan_attr_pairing_bootstrapping_type
,
2574 &hf_nan_attr_pairing_bootstrapping_status
,
2577 proto_tree_add_bitmask(attr_tree
, tvb
, npba_local_offset
, hf_nan_attr_pairing_bootstrapping_type_status
,
2578 ett_nan_pairing_bootstrapping_type_status
, type_and_status_fields
, ENC_LITTLE_ENDIAN
);
2579 npba_local_offset
+= 1;
2582 * Indicate the reject reason when Type = 2 (Response) and Status = 1 (Rejected); otherwise, reserved */
2583 if ((type
== 2) && (status
== 1))
2585 proto_tree_add_item(attr_tree
, hf_nan_attr_pairing_bootstrapping_resaon_code
, tvb
,
2586 npba_local_offset
, 1, ENC_LITTLE_ENDIAN
);
2590 proto_tree_add_item(attr_tree
, hf_nan_attr_reserved
, tvb
,
2591 npba_local_offset
, 1, ENC_NA
);
2593 npba_local_offset
+= 1;
2595 /* Comeback, if any. Presetned if,
2596 * a) type is 2 and status is 2, or
2597 * b) type is 1 and status is 2, and cookie is requried (based on attribute length)
2599 bool comeback_presented
= (attr_len
> NAN_PAIRING_BOOTSTRAPPING_LEN
);
2601 bool comeback_after_presented
= comeback_presented
&& ((type
== 2) && (status
== 2));
2603 if (comeback_after_presented
)
2605 proto_tree_add_item(attr_tree
, hf_nan_attr_pairing_bootstrapping_comeback_after
, tvb
,
2606 npba_local_offset
, 2, ENC_LITTLE_ENDIAN
);
2607 npba_local_offset
+= 2;
2610 if (comeback_presented
)
2612 uint8_t cookie_len
= tvb_get_uint8(tvb
, npba_local_offset
);
2613 proto_tree_add_item(attr_tree
, hf_nan_attr_pairing_bootstrapping_comeback_cookie_len
, tvb
,
2614 npba_local_offset
, 1, ENC_LITTLE_ENDIAN
);
2615 npba_local_offset
+= 1;
2619 proto_tree_add_item(attr_tree
, hf_nan_attr_pairing_bootstrapping_comeback_cookie
, tvb
,
2620 npba_local_offset
, cookie_len
, ENC_NA
);
2621 npba_local_offset
+= cookie_len
;
2625 /* Pairing Bootstrapping Method */
2626 static int* const pairing_bootstrapping_method
[] = {
2627 &hf_nan_attr_pairing_bootstrapping_method_opportunistic_bootstrapping
,
2628 &hf_nan_attr_pairing_bootstrapping_method_pin_code_display
,
2629 &hf_nan_attr_pairing_bootstrapping_method_passphrase_display
,
2630 &hf_nan_attr_pairing_bootstrapping_method_qr_code_display
,
2631 &hf_nan_attr_pairing_bootstrapping_method_nfc_tag
,
2632 &hf_nan_attr_pairing_bootstrapping_method_keypad_pin_code_only
,
2633 &hf_nan_attr_pairing_bootstrapping_method_keypad_passphrase
,
2634 &hf_nan_attr_pairing_bootstrapping_method_qr_code_scan
,
2635 &hf_nan_attr_pairing_bootstrapping_method_nfc_reader
,
2636 &hf_nan_attr_pairing_bootstrapping_method_reserved
,
2637 &hf_nan_attr_pairing_bootstrapping_method_service_managed_bootstrapping
,
2638 &hf_nan_attr_pairing_bootstrapping_method_bootstrapping_handshakes_skipped
,
2641 if (type
== 2 && status
)
2643 proto_tree_add_item(attr_tree
, hf_nan_attr_reserved
, tvb
,
2644 npba_local_offset
, 2, ENC_NA
);
2648 proto_tree_add_bitmask(attr_tree
, tvb
, npba_local_offset
, hf_nan_attr_pairing_bootstrapping_methods
,
2649 ett_nan_pairing_bootstrapping_method
, pairing_bootstrapping_method
, ENC_LITTLE_ENDIAN
);
2654 find_attribute_field(proto_tree
* nan_tree
, tvbuff_t
* tvb
, unsigned tvb_len
, unsigned* offset
, packet_info
* pinfo
)
2656 if ((tvb_len
- *offset
) < 3)
2658 proto_tree_add_expert_format(nan_tree
, pinfo
, &ei_nan_elem_len_invalid
, tvb
, *offset
, -1,
2659 "Insufficient remaining packet bytes for NAN attribute");
2664 int attr_id
= tvb_get_uint8(tvb
, *offset
);
2665 uint16_t attr_len
= tvb_get_letohs(tvb
, *offset
+ 1);
2667 if ((*offset
+ 3 + attr_len
) > tvb_len
)
2669 proto_tree_add_expert_format(nan_tree
, pinfo
, &ei_nan_elem_len_invalid
, tvb
, *offset
, -1,
2670 "Attribute length (%u) exceeds remaining packet length. Attribute id: %u", attr_len
, attr_id
);
2675 proto_tree
* attr_tree
= proto_tree_add_subtree(nan_tree
, tvb
, *offset
, attr_len
+ 3,
2676 ett_attributes
, NULL
, val_to_str(attr_id
, attribute_types
, "Unknown attribute ID (%u)"));
2678 proto_tree_add_item(attr_tree
, hf_nan_attribute_type
, tvb
, *offset
, 1, ENC_NA
);
2679 proto_tree_add_item(attr_tree
, hf_nan_attribute_len
, tvb
, *offset
+ 1, 2, ENC_LITTLE_ENDIAN
);
2682 case NAN_ATTR_SERVICE_DESCRIPTOR
:
2683 dissect_attr_sda(attr_tree
, tvb
, *offset
, attr_len
, pinfo
);
2685 case NAN_ATTR_MASTER_INDICATION
:
2686 dissect_attr_master_indication(attr_tree
, tvb
, *offset
, attr_len
, pinfo
);
2688 case NAN_ATTR_CLUSTER
:
2689 dissect_attr_cluster(attr_tree
, tvb
, *offset
, attr_len
, pinfo
);
2691 case NAN_ATTR_CIPHER_SUITE_INFO
:
2692 dissect_attr_cipher_suite_info(attr_tree
, tvb
, *offset
, attr_len
, pinfo
);
2694 case NAN_ATTR_SECURITY_CONTEXT_INFO
:
2695 dissect_attr_security_context_info(attr_tree
, tvb
, *offset
, attr_len
, pinfo
);
2697 case NAN_ATTR_SHARED_KEY_DESCRIPTOR
:
2698 dissect_attr_shared_key_descriptor(attr_tree
, tvb
, *offset
);
2700 case NAN_ATTR_PUBLIC_AVAILABILITY
:
2701 dissect_attr_public_availability(attr_tree
, tvb
, *offset
, attr_len
, pinfo
);
2703 case NAN_ATTR_ELEMENT_CONTAINER
:
2704 dissect_attr_element_container(attr_tree
, tvb
, *offset
, attr_len
, pinfo
);
2706 case NAN_ATTR_FTM_RANGING_REPORT
:
2707 dissect_attr_ftm_report(attr_tree
, tvb
, *offset
);
2709 case NAN_ATTR_RANGING_SETUP
:
2710 dissect_attr_ranging_setup(attr_tree
, tvb
, *offset
, attr_len
, pinfo
);
2712 case NAN_ATTR_RANGING_INFORMATION
:
2713 dissect_attr_ranging_info(attr_tree
, tvb
, *offset
);
2715 case NAN_ATTR_UNALIGNED_SCHEDULE
:
2716 dissect_attr_unaligned_schedule(attr_tree
, tvb
, *offset
, attr_len
, pinfo
);
2718 case NAN_ATTR_NDL_QOS
:
2719 dissect_attr_ndl_qos(attr_tree
, tvb
, *offset
, attr_len
, pinfo
);
2721 case NAN_ATTR_EXTENDED_WLAN_INFRA
:
2722 dissect_attr_extended_wlan_infra(attr_tree
, tvb
, *offset
, attr_len
, pinfo
);
2724 case NAN_ATTR_EXTENDED_P2P_OPERATION
:
2725 dissect_attr_extended_p2p_operation(attr_tree
, tvb
, *offset
, attr_len
, pinfo
);
2727 case NAN_ATTR_EXTENDED_IBSS
:
2728 dissect_attr_extended_ibss(attr_tree
, tvb
, *offset
, attr_len
, pinfo
);
2730 case NAN_ATTR_EXTENDED_MESH
:
2731 dissect_attr_extended_mesh(attr_tree
, tvb
, *offset
, attr_len
, pinfo
);
2733 case NAN_ATTR_CONNECTION_CAPABILITY
:
2734 dissect_attr_connection_capability(attr_tree
, tvb
, *offset
, attr_len
, pinfo
);
2736 case NAN_ATTR_CLUSTER_DISCOVERY
:
2737 dissect_attr_cluter_discovery(attr_tree
, tvb
, *offset
, attr_len
, pinfo
);
2739 case NAN_ATTR_RANGING
:
2740 dissect_attr_ranging(attr_tree
, tvb
, *offset
, attr_len
, pinfo
);
2742 case NAN_ATTR_COUNTRY_CODE
:
2743 dissect_attr_country_code(attr_tree
, tvb
, *offset
);
2745 case NAN_ATTR_FURTHER_AVAILABILITY_MAP
:
2746 dissect_attr_further_availability_map(attr_tree
, tvb
, *offset
);
2748 case NAN_ATTR_FURTHER_SERVICE_DISCOVERY
:
2749 dissect_attr_further_service_discovery(attr_tree
, tvb
, *offset
, attr_len
);
2752 dissect_attr_mesh(attr_tree
, tvb
, *offset
, attr_len
, pinfo
);
2755 dissect_attr_ibss(attr_tree
, tvb
, *offset
, attr_len
, pinfo
);
2757 case NAN_ATTR_P2P_OPERATION
:
2758 dissect_attr_p2p_operation(attr_tree
, tvb
, *offset
, attr_len
, pinfo
);
2760 case NAN_ATTR_WLAN_INFRA
:
2761 dissect_attr_wlan_infra(attr_tree
, tvb
, *offset
, attr_len
, pinfo
);
2764 dissect_attr_ndp(attr_tree
, tvb
, *offset
, attr_len
, pinfo
);
2766 case NAN_ATTR_NDP_EXTENSION
:
2767 dissect_attr_ndpe(attr_tree
, tvb
, *offset
, attr_len
, pinfo
);
2769 case NAN_ATTR_SERVICE_DESCRIPTOR_EXTENSION
:
2770 dissect_attr_sdea(attr_tree
, tvb
, *offset
, attr_len
, pinfo
);
2772 case NAN_ATTR_DEVICE_CAPABILITY
:
2773 dissect_attr_device_capability(attr_tree
, tvb
, *offset
, attr_len
, pinfo
);
2775 case NAN_ATTR_AVAILABILITY
:
2776 dissect_attr_availability(attr_tree
, tvb
, *offset
, attr_len
, pinfo
);
2779 dissect_attr_ndc(attr_tree
, tvb
, *offset
, attr_len
, pinfo
);
2781 case NAN_ATTR_SERVICE_ID_LIST
:
2782 case NAN_ATTR_SUBSCRIBE_SERVICE_ID_LIST
:
2783 dissect_attr_service_id_list(attr_tree
, tvb
, *offset
, attr_len
, pinfo
);
2785 case NAN_ATTR_VENDOR_SPECIFIC
:
2786 dissect_attr_vendor_specific(attr_tree
, tvb
, *offset
, attr_len
, pinfo
);
2789 dissect_attr_ndl(attr_tree
, tvb
, *offset
, attr_len
, pinfo
);
2791 case NAN_ATTR_DEVICE_CAPABILITY_EXTENSION
:
2792 dissect_attr_device_capability_extension(attr_tree
, tvb
, *offset
, attr_len
, pinfo
);
2794 case NAN_ATTR_IDENTITY_RESOLUTION
:
2795 dissect_attr_nan_identity_resolution(attr_tree
, tvb
, *offset
, attr_len
, pinfo
);
2797 case NAN_ATTR_PAIRING_BOOTSTRAPPING
:
2798 dissect_attr_nan_pairing_bootstrapping(attr_tree
, tvb
, *offset
, attr_len
, pinfo
);
2801 expert_add_info(pinfo
, attr_tree
, &ei_nan_unknown_attr_id
);
2804 *offset
+= attr_len
+ 3;
2808 dissect_nan_beacon(tvbuff_t
* tvb
, packet_info
* pinfo
, proto_tree
* tree
, void* data _U_
)
2810 unsigned offset
= 0;
2812 col_set_str(pinfo
->cinfo
, COL_PROTOCOL
, "NAN");
2815 // Workaround to identify NAN Discovery vs Synchronization beacon frames.
2817 // We have to determine the beacon interval, but there is, unfortunately,
2818 // no mechanism by which a subdissector can request that an arbitrary
2819 // field value be provided to it by the calling dissector, so we can't
2820 // just ask for "wlan.fixed.beacon".
2822 // Fortunately, we are currently putting the Discovery vs. Sync information
2823 // only in the Info column, and the beacon interval is put at the end
2824 // of the Info column, as "BI={interval}", by the 802.11 dissector, so
2825 // we can just fetch the Info column string and, if it's present, extract
2828 // An interval of 100, meaning .1024 seconds, means it's a Discovery
2829 // beacon, and an interval of 512, meaning .524288 seconds, means
2830 // it's a Sync beacon.
2832 const char* info_text
= col_get_text(pinfo
->cinfo
, COL_INFO
);
2833 if (info_text
!= NULL
&& g_str_has_suffix(info_text
, "100"))
2835 col_prepend_fstr(pinfo
->cinfo
, COL_INFO
, "Discovery ");
2837 else if (info_text
!= NULL
&& g_str_has_suffix(info_text
, "512"))
2839 col_prepend_fstr(pinfo
->cinfo
, COL_INFO
, "Sync ");
2843 expert_add_info(pinfo
, tree
, &ei_nan_unknown_beacon_type
);
2844 col_prepend_fstr(pinfo
->cinfo
, COL_INFO
, "[Unknown] ");
2847 proto_item
* ti
= proto_tree_add_item(tree
, proto_nan
, tvb
, 0, -1, ENC_NA
);
2848 proto_tree
* nan_tree
= proto_item_add_subtree(ti
, ett_nan
);
2850 unsigned tvb_len
= tvb_reported_length(tvb
);
2851 while (offset
< tvb_len
)
2853 find_attribute_field(nan_tree
, tvb
, tvb_len
, &offset
, pinfo
);
2855 return tvb_captured_length(tvb
);
2859 dissect_nan_action(tvbuff_t
* tvb
, packet_info
* pinfo
, proto_tree
* tree
, void* data _U_
)
2861 unsigned offset
= 0;
2863 col_set_str(pinfo
->cinfo
, COL_PROTOCOL
, "NAN");
2865 proto_tree
* upper_tree
= proto_tree_get_parent_tree(tree
);
2866 proto_item
* ti
= proto_tree_add_item(upper_tree
, proto_nan
, tvb
, 0, -1, ENC_NA
);
2867 proto_tree
* nan_tree
= proto_item_add_subtree(ti
, ett_nan
);
2869 uint8_t subtype
= tvb_get_uint8(tvb
, offset
);
2870 const char* subtype_text
= rval_to_str(subtype
, action_frame_type_values
, "Unknown type (%u)");
2871 proto_item_set_text(ti
, "%s", subtype_text
);
2872 proto_tree_add_item(nan_tree
, hf_nan_action_subtype
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
2874 col_prepend_fstr(pinfo
->cinfo
, COL_INFO
, "%s", subtype_text
);
2877 unsigned tvb_len
= tvb_reported_length(tvb
);
2878 while (offset
< tvb_len
)
2880 find_attribute_field(nan_tree
, tvb
, tvb_len
, &offset
, pinfo
);
2882 return tvb_captured_length(tvb
);
2886 dissect_nan_service_discovery(tvbuff_t
* tvb
, packet_info
* pinfo
, proto_tree
* tree
, void* data _U_
)
2888 unsigned offset
= 0;
2889 col_set_str(pinfo
->cinfo
, COL_PROTOCOL
, "NAN");
2890 proto_item
* ti
= proto_tree_add_item(tree
, proto_nan
, tvb
, 0, -1, ENC_NA
);
2891 proto_tree
* nan_tree
= proto_item_add_subtree(ti
, ett_nan
);
2893 unsigned tvb_len
= tvb_reported_length(tvb
);
2894 while (offset
< tvb_len
)
2896 find_attribute_field(nan_tree
, tvb
, tvb_len
, &offset
, pinfo
);
2898 return tvb_captured_length(tvb
);
2902 proto_register_nan(void)
2904 static hf_register_info hf
[] = {
2905 { &hf_nan_attribute_type
,
2908 "wifi_nan.attribute.type",
2909 FT_UINT8
, BASE_DEC
, VALS(attribute_types
), 0x0, NULL
, HFILL
2912 { &hf_nan_attribute_len
,
2915 "wifi_nan.attribute.len",
2916 FT_UINT16
, BASE_DEC
, NULL
, 0x0, NULL
, HFILL
2919 { &hf_nan_action_subtype
,
2922 "wifi_nan.action.subtype",
2923 FT_UINT8
, BASE_HEX
| BASE_RANGE_STRING
, RVALS(action_frame_type_values
), 0x0, NULL
, HFILL
2926 { &hf_nan_instance_id
,
2929 "wifi_nan.instance_id",
2930 FT_UINT8
, BASE_HEX
, NULL
, 0x0, NULL
, HFILL
2933 { &hf_nan_service_id
,
2936 "wifi_nan.service_id",
2937 FT_BYTES
, SEP_COLON
, NULL
, 0x0, NULL
, HFILL
2944 FT_UINT8
, BASE_HEX_DEC
, NULL
, 0x0, NULL
, HFILL
2951 FT_BYTES
, SEP_COLON
, NULL
, 0x0, NULL
, HFILL
2954 { &hf_nan_type_status
,
2957 "wifi_nan.type_status",
2958 FT_UINT8
, BASE_DEC
, NULL
, 0x0, NULL
, HFILL
2961 { &hf_nan_reason_code
,
2964 "wifi_nan.reason_code",
2965 FT_UINT8
, BASE_DEC
| BASE_RANGE_STRING
, RVALS(reason_code_values
), 0x0, NULL
, HFILL
2972 FT_UINT8
, BASE_DEC
| BASE_RANGE_STRING
, RVALS(status_type1_values
), 0xF0, NULL
, HFILL
2979 FT_UINT8
, BASE_DEC
| BASE_RANGE_STRING
, RVALS(status_type2_values
), 0xF0, NULL
, HFILL
2986 FT_UINT48
, BASE_DEC
, NULL
, 0x0, NULL
, HFILL
2989 { &hf_nan_availability_intervals_bitmap
,
2991 "Availability Intervals Bitmap",
2992 "wifi_nan.availability_intervals_bitmap",
2993 FT_BYTES
, SEP_DASH
, NULL
, 0x0, NULL
, HFILL
2996 { &hf_nan_mac_address
,
2999 "wifi_nan.mac_address",
3000 FT_BYTES
, SEP_COLON
, NULL
, 0x0, NULL
, HFILL
3003 { &hf_nan_publish_id
,
3006 "wifi_nan.publish_id",
3007 FT_UINT8
, BASE_DEC
, NULL
, 0x0, NULL
, HFILL
3010 { &hf_nan_dialog_tokens
,
3013 "wifi_nan.dialog_token",
3014 FT_UINT8
, BASE_DEC
, NULL
, 0x0, NULL
, HFILL
3017 { &hf_nan_time_bitmap
,
3020 "wifi_nan.time_bitmap",
3021 FT_BYTES
, SEP_DASH
, NULL
, 0x0, NULL
, HFILL
3024 { &hf_nan_time_bitmap_len
,
3026 "Time Bitmap Length",
3027 "wifi_nan.time_bitmap.len",
3028 FT_UINT8
, BASE_DEC
, NULL
, 0x0, NULL
, HFILL
3031 { &hf_nan_time_bitmap_ctrl
,
3033 "Time Bitmap Control",
3034 "wifi_nan.time_bitmap.ctrl",
3035 FT_UINT16
, BASE_HEX
, NULL
, 0x0, NULL
, HFILL
3038 { &hf_nan_time_bitmap_ctrl_bit_duration
,
3041 "wifi_nan.time_bitmap.ctrl.bit_duration",
3042 FT_UINT16
, BASE_DEC
| BASE_RANGE_STRING
, RVALS(availability_entry_time_bitmap_ctr_bit_duration_type
),
3046 { &hf_nan_time_bitmap_ctrl_period
,
3049 "wifi_nan.time_bitmap.ctrl.period",
3050 FT_UINT16
, BASE_DEC
, VALS(availability_entry_time_bitmap_ctr_period_type
),
3054 { &hf_nan_time_bitmap_ctrl_start_offset
,
3057 "wifi_nan.time_bitmap.ctrl.start_offset",
3058 FT_UINT16
, BASE_DEC
, NULL
, 0x7FC0, NULL
, HFILL
3061 { &hf_nan_map_ctrl_map_id
,
3064 "wifi_nan.map_ctrl.map_id",
3065 FT_UINT8
, BASE_HEX_DEC
, NULL
, 0xF, NULL
, HFILL
3068 { &hf_nan_map_ctrl_availability_interval_duration
,
3070 "Availability Interval Duration",
3071 "wifi_nan.map_ctrl.interval_duration",
3072 FT_UINT8
, BASE_DEC
, VALS(map_ctrl_availability_interval_duration
), 0x30, NULL
, HFILL
3075 { &hf_nan_map_ctrl_repeat
,
3078 "wifi_nan.map_ctrl.repeat",
3079 FT_UINT8
, BASE_DEC
, NULL
, 0x40, NULL
, HFILL
3082 { &hf_nan_map_ctrl_field
,
3085 "wifi_nan.map_ctrl",
3086 FT_UINT8
, BASE_DEC
, NULL
, 0x0, NULL
, HFILL
3089 { &hf_nan_non_op_channel_global_op_class
,
3091 "Global Operation Class",
3092 "wifi_nan.non_op_channel.global_op_class",
3093 FT_UINT8
, BASE_DEC
, NULL
, 0x0, NULL
, HFILL
3096 { &hf_nan_non_op_channel_channel
,
3099 "wifi_nan.non_op_channel.channel",
3100 FT_UINT8
, BASE_DEC
, NULL
, 0x0, NULL
, HFILL
3103 { &hf_nan_non_op_channel_center_freq
,
3105 "Channel Center Frequency",
3106 "wifi_nan.non_op_channel.center_freq",
3107 FT_UINT8
, BASE_DEC
, NULL
, 0x0, NULL
, HFILL
3110 { &hf_nan_non_beacon_tbtt_offset
,
3113 "wifi_nan.non_beacon.tbtt_offset",
3114 FT_UINT16
, BASE_DEC
, NULL
, 0x0, NULL
, HFILL
3117 { &hf_nan_non_beacon_interval
,
3120 "wifi_nan.non_beacon.interval",
3121 FT_UINT16
, BASE_DEC
, NULL
, 0x0, NULL
, HFILL
3124 { &hf_nan_attr_master_preference
,
3126 "Master Preference",
3127 "wifi_nan.master_indication.preference",
3128 FT_UINT8
, BASE_HEX
, NULL
, 0x0, NULL
, HFILL
3131 { &hf_nan_attr_master_random_factor
,
3134 "wifi_nan.master_indication.random_factor",
3135 FT_UINT8
, BASE_DEC
, NULL
, 0x0, NULL
, HFILL
3138 { &hf_nan_attr_cluster_anchor_master_rank
,
3140 "Anchor Master Rank",
3141 "wifi_nan.cluster.anchor_master_rank",
3142 FT_UINT64
, BASE_DEC_HEX
, NULL
, 0x0, NULL
, HFILL
3145 { &hf_nan_attr_cluster_hop_count
,
3147 "Hop Count to Anchor Master",
3148 "wifi_nan.cluster.hop_count",
3149 FT_UINT8
, BASE_DEC
, NULL
, 0x0, NULL
, HFILL
3152 { &hf_nan_attr_cluster_beacon_transmission_time
,
3154 "Anchor Master Beacon Transmission Time",
3155 "wifi_nan.cluster.beacon_transmission_time",
3156 FT_UINT32
, BASE_HEX_DEC
, NULL
, 0x0, NULL
, HFILL
3159 { &hf_nan_attr_sda_requestor_instance_id
,
3161 "Requestor Instance ID",
3162 "wifi_nan.sda.requestor_instance_id",
3163 FT_UINT8
, BASE_HEX
, NULL
, 0x0, NULL
, HFILL
3166 { &hf_nan_attr_sda_sc
,
3170 FT_UINT8
, BASE_HEX
, NULL
, 0x0, NULL
, HFILL
3173 { &hf_nan_attr_sda_sc_type
,
3175 "Service Control Type",
3176 "wifi_nan.sda.sc.type",
3177 FT_UINT8
, BASE_HEX
, VALS(service_ctr_type
), 0x03, NULL
, HFILL
3180 { &hf_nan_attr_sda_sc_matching_filter
,
3182 "Matching Filter Present",
3183 "wifi_nan.sda.sc.matching_filter",
3184 FT_BOOLEAN
, 8, NULL
, 0x04, NULL
, HFILL
3187 { &hf_nan_attr_sda_sc_service_response
,
3189 "Service Response Filter Present",
3190 "wifi_nan.sda.sc.service_response",
3191 FT_BOOLEAN
, 8, NULL
, 0x08, NULL
, HFILL
3194 { &hf_nan_attr_sda_sc_service_info
,
3196 "Service Info Present",
3197 "wifi_nan.sda.sc.service_info",
3198 FT_BOOLEAN
, 8, NULL
, 0x10, NULL
, HFILL
3201 { &hf_nan_attr_sda_sc_discovery_range
,
3203 "Discovery Range Limited",
3204 "wifi_nan.sda.sc.discovery_range",
3205 FT_BOOLEAN
, 8, NULL
, 0x20, NULL
, HFILL
3208 { &hf_nan_attr_sda_sc_binding_bitmap
,
3210 "Binding Bitmap Present",
3211 "wifi_nan.sda.sc.binding_bitmap",
3212 FT_BOOLEAN
, 8, NULL
, 0x40, NULL
, HFILL
3215 { &hf_nan_attr_sda_binding_bitmap
,
3218 "wifi_nan.sda.binding_bitmap",
3219 FT_UINT16
, BASE_HEX
, NULL
, 0x0, NULL
, HFILL
3222 { &hf_nan_attr_sda_matching_filter_len
,
3224 "Matching Filter Length",
3225 "wifi_nan.sda.matching_filter_len",
3226 FT_UINT8
, BASE_DEC
, NULL
, 0x0, NULL
, HFILL
3229 { &hf_nan_attr_sda_matching_filter_val
,
3231 "Matching Filter Value",
3232 "wifi_nan.sda.matching_filter_val",
3233 FT_BYTES
, SEP_DASH
, NULL
, 0x0, NULL
, HFILL
3236 { &hf_nan_attr_sda_service_response_filter_len
,
3238 "Service Response Filter Length",
3239 "wifi_nan.sda.service_response_filter_len",
3240 FT_UINT8
, BASE_DEC
, NULL
, 0x0, NULL
, HFILL
3243 { &hf_nan_attr_sda_srf_ctr
,
3246 "wifi_nan.sda.srf_ctr",
3247 FT_UINT8
, BASE_HEX
, NULL
, 0x0, NULL
, HFILL
3250 { &hf_nan_attr_sda_srf_ctr_type
,
3253 "wifi_nan.sda.srf_type",
3254 FT_BOOLEAN
, 8, TFS(&srf_type_flags
), 0x01, NULL
, HFILL
3257 { &hf_nan_attr_sda_srf_ctr_include
,
3260 "wifi_nan.sda.srf_include",
3261 FT_BOOLEAN
, 8, TFS(&srf_include_flags
), 0x02, NULL
, HFILL
3264 { &hf_nan_attr_sda_srf_ctr_bloom_filter_index
,
3266 "Bloom Filter Index",
3267 "wifi_nan.sda.srf_bloom_filter_index",
3268 FT_UINT8
, BASE_DEC_HEX
, NULL
, 0x0C, NULL
, HFILL
3271 { &hf_nan_attr_sda_srf_address_set
,
3274 "wifi_nan.sda.srf_address_set",
3275 FT_BYTES
, SEP_DASH
, NULL
, 0x0, NULL
, HFILL
3278 { &hf_nan_attr_sda_service_info_len
,
3280 "Service Info Length",
3281 "wifi_nan.sda.service_info_len",
3282 FT_UINT8
, BASE_DEC
, NULL
, 0x0, NULL
, HFILL
3285 { &hf_nan_attr_sda_service_info
,
3288 "wifi_nan.sda.service_info",
3289 FT_BYTES
, SEP_DASH
, NULL
, 0x0, NULL
, HFILL
3292 { &hf_nan_attr_sdea_ctr
,
3295 "wifi_nan.sdea.ctr",
3296 FT_UINT16
, BASE_HEX
, NULL
, 0x0, NULL
, HFILL
3299 { &hf_nan_attr_sdea_ctr_fsd
,
3302 "wifi_nan.sdea.ctr_fsd",
3303 FT_BOOLEAN
, 16, NULL
, 0x0001, NULL
, HFILL
3306 { &hf_nan_attr_sdea_ctr_fsd_w_gas
,
3309 "wifi_nan.sdea.ctr_fsd_w_gas",
3310 FT_BOOLEAN
, 16, NULL
, 0x0002, NULL
, HFILL
3313 { &hf_nan_attr_sdea_ctr_data_path
,
3315 "Data Path Required",
3316 "wifi_nan.sdea.ctr_data_path",
3317 FT_BOOLEAN
, 16, NULL
, 0x0004, NULL
, HFILL
3320 { &hf_nan_attr_sdea_ctr_data_path_type
,
3323 "wifi_nan.sdea.ctr_data_path_type",
3324 FT_BOOLEAN
, 16, TFS(&sdea_ctr_data_path_type_flags
), 0x0008, NULL
, HFILL
3327 { &hf_nan_attr_sdea_ctr_reserved_multicast_type
,
3329 "Reserved (Multicast Type)",
3330 "wifi_nan.sdea.ctr_reserved_multicast_type",
3331 FT_BOOLEAN
, 16, TFS(&sdea_ctr_reserved_multicast_type_flags
), 0x0010, NULL
, HFILL
3334 { &hf_nan_attr_sdea_ctr_qos
,
3337 "wifi_nan.sdea.ctr_qos",
3338 FT_BOOLEAN
, 16, NULL
, 0x0020, NULL
, HFILL
3341 { &hf_nan_attr_sdea_ctr_security
,
3343 "Security Required",
3344 "wifi_nan.sdea.ctr_security",
3345 FT_BOOLEAN
, 16, NULL
, 0x0040, NULL
, HFILL
3348 { &hf_nan_attr_sdea_ctr_ranging
,
3351 "wifi_nan.sdea.ctr_ranging",
3352 FT_BOOLEAN
, 16, NULL
, 0x0080, NULL
, HFILL
3355 { &hf_nan_attr_sdea_ctr_range_limit
,
3357 "Range Limit Present",
3358 "wifi_nan.sdea.ctr_range_limit",
3359 FT_BOOLEAN
, 16, NULL
, 0x0100, NULL
, HFILL
3362 { &hf_nan_attr_sdea_ctr_service_update_indicator
,
3364 "Service Update Indicator Present",
3365 "wifi_nan.sdea.ctr_service_update_indicator",
3366 FT_BOOLEAN
, 16, NULL
, 0x0200, NULL
, HFILL
3369 { &hf_nan_attr_sdea_ingress_range_limit
,
3371 "Ingress Range Limit",
3372 "wifi_nan.sdea.range_limit_ingress",
3373 FT_UINT16
, BASE_DEC
, NULL
, 0x0, NULL
, HFILL
3376 { &hf_nan_attr_sdea_egress_range_limit
,
3378 "Egress Range Limit",
3379 "wifi_nan.sdea.range_limit_egress",
3380 FT_UINT16
, BASE_DEC
, NULL
, 0x0, NULL
, HFILL
3383 { &hf_nan_attr_sdea_service_update_indicator
,
3385 "Service Update Indicator",
3386 "wifi_nan.sdea.service_update_indicator",
3387 FT_UINT8
, BASE_DEC
, NULL
, 0x0, NULL
, HFILL
3390 { &hf_nan_attr_sdea_service_info_length
,
3392 "Service Info Length",
3393 "wifi_nan.sdea.service_info_len",
3394 FT_UINT16
, BASE_DEC
, NULL
, 0x0, NULL
, HFILL
3397 { &hf_nan_attr_sdea_service_info_protocol_type
,
3399 "Service Protocol Type",
3400 "wifi_nan.sdea.service_info_protocol_type",
3401 FT_UINT8
, BASE_RANGE_STRING
| BASE_DEC
, RVALS(service_info_protocol_type
), 0x0, NULL
, HFILL
3404 { &hf_nan_attr_sdea_service_info_specific
,
3406 "Service Specific info",
3407 "wifi_nan.sdea.service_info_specific",
3408 FT_BYTES
, SEP_DASH
, NULL
, 0x0, NULL
, HFILL
3411 { &hf_nan_attr_connection_cap_bitmap
,
3413 "Connection Capability Bitmap",
3414 "wifi_nan.connection_cap.bitmap",
3415 FT_UINT16
, BASE_DEC
, NULL
, 0x0, NULL
, HFILL
3418 { &hf_nan_attr_connection_cap_wifi_direct
,
3421 "wifi_nan.connection_cap.wifi_direct",
3422 FT_BOOLEAN
, 16, NULL
, 0x1, NULL
, HFILL
3425 { &hf_nan_attr_connection_cap_p2ps
,
3428 "wifi_nan.connection_cap.p2ps",
3429 FT_BOOLEAN
, 16, NULL
, 0x2, NULL
, HFILL
3432 { &hf_nan_attr_connection_cap_tdls
,
3435 "wifi_nan.connection_cap.tdls",
3436 FT_BOOLEAN
, 16, NULL
, 0x4, NULL
, HFILL
3439 { &hf_nan_attr_connection_cap_wlan_infra
,
3441 "WLAN Infrastructure",
3442 "wifi_nan.connection_cap.wlan_infra",
3443 FT_BOOLEAN
, 16, NULL
, 0x8, NULL
, HFILL
3446 { &hf_nan_attr_connection_cap_ibss
,
3449 "wifi_nan.connection_cap.ibss",
3450 FT_BOOLEAN
, 16, NULL
, 0x0010, NULL
, HFILL
3453 { &hf_nan_attr_connection_cap_mesh
,
3456 "wifi_nan.connection_cap.mesh",
3457 FT_BOOLEAN
, 16, NULL
, 0x0020, NULL
, HFILL
3460 { &hf_nan_attr_wlan_infra_device_role
,
3463 "wifi_nan.wlan_infra.device_role",
3464 FT_UINT8
, BASE_DEC
, VALS(device_role
), 0x0, NULL
, HFILL
3467 { &hf_nan_attr_p2p_device_role_device
,
3470 "wifi_nan.p2p.device",
3471 FT_BOOLEAN
, 8, NULL
, 0x1, NULL
, HFILL
3474 { &hf_nan_attr_p2p_device_role_group_owner
,
3477 "wifi_nan.p2p.group_owner",
3478 FT_BOOLEAN
, 8, NULL
, 0x2, NULL
, HFILL
3481 { &hf_nan_attr_p2p_device_role_client
,
3484 "wifi_nan.p2p.client",
3485 FT_BOOLEAN
, 8, NULL
, 0x4, NULL
, HFILL
3488 { &hf_nan_attr_p2p_device_role
,
3491 "wifi_nan.p2p.device_role",
3492 FT_UINT8
, BASE_HEX
, NULL
, 0x0, NULL
, HFILL
3495 { &hf_nan_attr_mesh_id
,
3499 FT_BYTES
, SEP_DASH
, NULL
, 0x0, NULL
, HFILL
3502 { &hf_nan_attr_further_av_map_id
,
3505 "wifi_nan.furth.av.map.id",
3506 FT_UINT8
, BASE_HEX
| BASE_RANGE_STRING
, RVALS(furth_av_map_id
), 0x0, NULL
, HFILL
3509 { &hf_nan_attr_further_av_map_entry_av_interval_duration
,
3511 "Availability Interval Duration",
3512 "wifi_nan.further_av_map.entry.av_interval_duration",
3513 FT_UINT8
, BASE_DEC
, VALS(map_ctrl_availability_interval_duration
), 0x03, NULL
, HFILL
3516 { &hf_nan_attr_further_av_map_op_class
,
3519 "wifi_nan.further_av_map.entry.op_class",
3520 FT_UINT8
, BASE_HEX_DEC
, NULL
, 0x0, NULL
, HFILL
3523 { &hf_nan_attr_further_av_map_channel_num
,
3526 "wifi_nan.further_av_map.entry.channel_number",
3527 FT_UINT8
, BASE_HEX_DEC
, NULL
, 0x0, NULL
, HFILL
3530 { &hf_nan_attr_further_av_map_entry_ctrl
,
3532 "Entry Control Fields",
3533 "wifi_nan.further_av_map.entry.ctrl",
3534 FT_UINT8
, BASE_HEX_DEC
, NULL
, 0x0, NULL
, HFILL
3537 { &hf_nan_attr_country_code
,
3539 "Condensed Country String",
3540 "wifi_nan.country_code",
3541 FT_STRINGZ
, BASE_NONE
, NULL
, 0x0, NULL
, HFILL
3544 { &hf_nan_attr_ranging_protocol
,
3547 "wifi_nan.ranging.protocol",
3548 FT_UINT8
, BASE_HEX_DEC
, NULL
, 0x0, NULL
, HFILL
3551 { &hf_nan_attr_cluster_disc_id
,
3554 "wifi_nan.cluster_disc.id",
3555 FT_UINT48
, BASE_HEX
, NULL
, 0x0, NULL
, HFILL
3558 { &hf_nan_attr_cluster_disc_time_offset
,
3560 "Cluster Time Offset",
3561 "wifi_nan.cluster_disc.time_offset",
3562 FT_UINT64
, BASE_DEC_HEX
, NULL
, 0x0, NULL
, HFILL
3565 { &hf_nan_attr_cluster_disc_anchor_master_rank
,
3567 "Anchor Master Rank",
3568 "wifi_nan.cluster_disc.anchor_master_rank",
3569 FT_UINT64
, BASE_DEC_HEX
, NULL
, 0x0, NULL
, HFILL
3572 { &hf_nan_attr_device_cap_map_id_apply_to
,
3575 "wifi_nan.device_cap.map_id_apply_to",
3576 FT_BOOLEAN
, 8, TFS(&device_cap_map_id_apply_to_flags
), 0x01, NULL
, HFILL
3579 { &hf_nan_attr_device_cap_map_id_associated_maps
,
3582 "wifi_nan.device_cap.map_id_associated_maps",
3583 FT_UINT8
, BASE_HEX_DEC
, NULL
, 0x1E, NULL
, HFILL
3586 { &hf_nan_attr_device_cap_committed_dw
,
3588 "Committed DW Info",
3589 "wifi_nan.device_cap.committed_dw_info",
3590 FT_UINT16
, BASE_DEC
, NULL
, 0x0, NULL
, HFILL
3593 { &hf_nan_attr_device_cap_committed_dw_24ghz
,
3596 "wifi_nan.device_cap.committed_dw_info.24ghz",
3597 FT_UINT16
, BASE_DEC
, NULL
, 0x0007, NULL
, HFILL
3600 { &hf_nan_attr_device_cap_committed_dw_5ghz
,
3603 "wifi_nan.device_cap.committed_dw_info.5ghz",
3604 FT_UINT16
, BASE_DEC
, NULL
, 0x0038, NULL
, HFILL
3607 { &hf_nan_attr_device_cap_committed_dw_24ghz_overwrite
,
3609 "2.4 GHz DW Overwrite",
3610 "wifi_nan.device_cap.committed_dw_info.24ghz_overwrite",
3611 FT_UINT16
, BASE_DEC
, NULL
, 0x03C0, NULL
, HFILL
3614 { &hf_nan_attr_device_cap_committed_dw_5ghz_overwrite
,
3616 "5 GHz DW Overwrite",
3617 "wifi_nan.device_cap.committed_dw_info.5ghz_overwrite",
3618 FT_UINT16
, BASE_DEC
, NULL
, 0x3C00, NULL
, HFILL
3621 { &hf_nan_attr_device_cap_supported_bands
,
3624 "wifi_nan.device_cap.supported_bands",
3625 FT_UINT8
, BASE_HEX
, NULL
, 0x0, NULL
, HFILL
3628 { &hf_nan_attr_device_cap_supported_bands_reserved_tv_whitespaces
,
3630 "Reserved (for TV white spaces)",
3631 "wifi_nan.device_cap.supported_bands.tv_whitespaces",
3632 FT_BOOLEAN
, 8, NULL
, 0x01, NULL
, HFILL
3635 { &hf_nan_attr_device_cap_supported_bands_sub_1ghz
,
3638 "wifi_nan.device_cap.supported_bands.sub_1ghz",
3639 FT_BOOLEAN
, 8, NULL
, 0x02, NULL
, HFILL
3642 { &hf_nan_attr_device_cap_supported_bands_24ghz
,
3645 "wifi_nan.device_cap.supported_bands.24ghz",
3646 FT_BOOLEAN
, 8, NULL
, 0x04, NULL
, HFILL
3649 { &hf_nan_attr_device_cap_supported_bands_reserved_36ghz
,
3651 "Reserved (for 3.6 GHz)",
3652 "wifi_nan.device_cap.supported_bands.reserved_36ghz",
3653 FT_BOOLEAN
, 8, NULL
, 0x08, NULL
, HFILL
3656 { &hf_nan_attr_device_cap_supported_bands_5ghz
,
3659 "wifi_nan.device_cap.supported_bands.5ghz",
3660 FT_BOOLEAN
, 8, NULL
, 0x10, NULL
, HFILL
3663 { &hf_nan_attr_device_cap_supported_bands_reserved_60ghz
,
3665 "Reserved (for 60 GHz)",
3666 "wifi_nan.device_cap.supported_bands.reserved_60ghz",
3667 FT_BOOLEAN
, 8, NULL
, 0x20, NULL
, HFILL
3670 { &hf_nan_attr_device_cap_supported_bands_reserved_45ghz
,
3672 "Reserved (for 45 GHz)",
3673 "wifi_nan.device_cap.supported_bands.reserved_45ghz",
3674 FT_BOOLEAN
, 8, NULL
, 0x40, NULL
, HFILL
3677 { &hf_nan_attr_device_cap_supported_bands_6ghz
,
3680 "wifi_nan.device_cap.supported_bands.6ghz",
3681 FT_BOOLEAN
, 8, NULL
, 0x80, NULL
, HFILL
3684 { &hf_nan_attr_device_cap_op_mode
,
3687 "wifi_nan.device_cap.op_mode",
3688 FT_UINT8
, BASE_HEX
, NULL
, 0x0, NULL
, HFILL
3691 { &hf_nan_attr_device_cap_op_mode_phy_vht
,
3693 "PHY Mode (VHT/HT)",
3694 "wifi_nan.device_cap.op_mode.phy.vht",
3695 FT_BOOLEAN
, 8, TFS(&device_cap_op_mode_phy_flags_vht
), 0x01, NULL
, HFILL
3698 { &hf_nan_attr_device_cap_op_mode_phy_he
,
3701 "wifi_nan.device_cap.op_mode.phy.he",
3702 FT_BOOLEAN
, 8, TFS(&device_cap_op_mode_phy_flags_he
), 0x10, NULL
, HFILL
3705 { &hf_nan_attr_device_cap_op_mode_phy_he_vht8080
,
3708 "wifi_nan.device_cap.op_mode.vht8080",
3709 FT_BOOLEAN
, 8, NULL
, 0x02, NULL
, HFILL
3712 { &hf_nan_attr_device_cap_op_mode_phy_he_vht160
,
3715 "wifi_nan.device_cap.op_mode.vht160",
3716 FT_BOOLEAN
, 8, NULL
, 0x04, NULL
, HFILL
3719 { &hf_nan_attr_device_cap_op_mode_reserved_paging_ndl
,
3721 "Reserved (Paging NDL Support)",
3722 "wifi_nan.device_cap.op_mode.reserved_paging_ndl",
3723 FT_BOOLEAN
, 8, NULL
, 0x08, NULL
, HFILL
3726 { &hf_nan_attr_device_cap_antennas
,
3729 "wifi_nan.device_cap.antennas",
3730 FT_UINT8
, BASE_HEX
, NULL
, 0x0, NULL
, HFILL
3733 { &hf_nan_attr_device_cap_antennas_tx
,
3735 "Number of TX antennas",
3736 "wifi_nan.device_cap.antennas.tx",
3737 FT_UINT8
, BASE_DEC
, NULL
, 0x0F, NULL
, HFILL
3740 { &hf_nan_attr_device_cap_antennas_rx
,
3742 "Number of RX antennas",
3743 "wifi_nan.device_cap.antennas.rx",
3744 FT_UINT8
, BASE_DEC
, NULL
, 0xF0, NULL
, HFILL
3747 { &hf_nan_attr_device_cap_max_channel_switch_time
,
3749 "Max Channel Switch Time (us)",
3750 "wifi_nan.device_cap.max_channel_switch_time",
3751 FT_UINT16
, BASE_DEC
, NULL
, 0x0, NULL
, HFILL
3754 { &hf_nan_attr_device_cap_capabilities
,
3757 "wifi_nan.device_cap.capabilities",
3758 FT_UINT8
, BASE_HEX
, NULL
, 0x0, NULL
, HFILL
3761 { &hf_nan_attr_device_cap_capabilities_dfs_master
,
3764 "wifi_nan.device_cap.capabilities.dfs_master",
3765 FT_BOOLEAN
, 8, NULL
, 0x01, NULL
, HFILL
3768 { &hf_nan_attr_device_cap_capabilities_extended_key_id
,
3771 "wifi_nan.device_cap.capabilities.extended_key_id",
3772 FT_BOOLEAN
, 8, NULL
, 0x02, NULL
, HFILL
3775 { &hf_nan_attr_device_cap_capabilities_simul_ndp_reception
,
3777 "Simultaneous NDP data reception",
3778 "wifi_nan.device_cap.capabilities.simul_ndp_reception",
3779 FT_BOOLEAN
, 8, NULL
, 0x04, NULL
, HFILL
3782 { &hf_nan_attr_device_cap_capabilities_ndpe_attr_support
,
3784 "NDPE attribute support",
3785 "wifi_nan.device_cap.capabilities.ndpe_attr_support",
3786 FT_BOOLEAN
, 8, NULL
, 0x08, NULL
, HFILL
3789 { &hf_nan_attr_device_cap_capabilities_s3_capable
,
3792 "wifi_nan.device_cap.capabilities.s3_capable",
3793 FT_BOOLEAN
, 8, NULL
, 0x10, NULL
, HFILL
3796 { &hf_nan_attr_ndp_type
,
3799 "wifi_nan.ndp.type",
3800 FT_UINT8
, BASE_DEC
| BASE_RANGE_STRING
, RVALS(ndp_type_values
), 0xF, NULL
, HFILL
3803 { &hf_nan_attr_ndp_initiator
,
3806 "wifi_nan.ndp.initiator_ndi",
3807 FT_BYTES
, SEP_DASH
, NULL
, 0x0, NULL
, HFILL
3810 { &hf_nan_attr_ndp_id
,
3814 FT_UINT8
, BASE_HEX_DEC
, NULL
, 0x0, NULL
, HFILL
3817 { &hf_nan_attr_ndp_ctrl_confirm
,
3820 "wifi_nan.ndp.ctrl.confirm",
3821 FT_BOOLEAN
, 8, NULL
, 0x1, NULL
, HFILL
3824 { &hf_nan_attr_ndp_ctrl_security_pres
,
3827 "wifi_nan.ndp.ctrl.security_pres",
3828 FT_BOOLEAN
, 8, NULL
, 0x4, NULL
, HFILL
3831 { &hf_nan_attr_ndp_ctrl_publish_id_pres
,
3833 "Publish ID Present",
3834 "wifi_nan.ndp.ctrl.publish_id_pres",
3835 FT_BOOLEAN
, 8, NULL
, 0x8, NULL
, HFILL
3838 { &hf_nan_attr_ndp_ctrl_responder_ndi_pres
,
3840 "Responder NDI Present",
3841 "wifi_nan.ndp.ctrl.responder_ndi_pres",
3842 FT_BOOLEAN
, 8, NULL
, 0x10, NULL
, HFILL
3845 { &hf_nan_attr_ndp_ctrl_sepcific_info_pres
,
3847 "NDP Specific Info Present",
3848 "wifi_nan.ndp.ctrl.specific_info_pres",
3849 FT_BOOLEAN
, 8, NULL
, 0x20, NULL
, HFILL
3852 { &hf_nan_attr_ndpe_ctrl_confirm
,
3855 "wifi_nan.ndpe.ctrl.confirm",
3856 FT_BOOLEAN
, 8, NULL
, 0x1, NULL
, HFILL
3859 { &hf_nan_attr_ndpe_ctrl_security_pres
,
3862 "wifi_nan.ndpe.ctrl.security_pres",
3863 FT_BOOLEAN
, 8, NULL
, 0x4, NULL
, HFILL
3866 { &hf_nan_attr_ndpe_ctrl_publish_id_pres
,
3868 "Publish ID Present",
3869 "wifi_nan.ndpe.ctrl.publish_id_pres",
3870 FT_BOOLEAN
, 8, NULL
, 0x8, NULL
, HFILL
3873 { &hf_nan_attr_ndpe_ctrl_responder_ndi_pres
,
3875 "Responder NDI Present",
3876 "wifi_nan.ndpe.ctrl.responder_ndi_pres",
3877 FT_BOOLEAN
, 8, NULL
, 0x10, NULL
, HFILL
3880 { &hf_nan_attr_ndpe_ctrl_gtk_requried
,
3883 "wifi_nan.ndpe.ctrl.gtk_required",
3884 FT_BOOLEAN
, 8, NULL
, 0x20, NULL
, HFILL
3887 { &hf_nan_attr_ndp_control
,
3890 "wifi_nan.ndp.ctrl",
3891 FT_UINT8
, BASE_HEX_DEC
, NULL
, 0x0, NULL
, HFILL
3894 { &hf_nan_attr_ndpe_control
,
3897 "wifi_nan.ndpe.ctrl",
3898 FT_UINT8
, BASE_HEX_DEC
, NULL
, 0x0, NULL
, HFILL
3901 { &hf_nan_attr_ndp_responder_ndi
,
3904 "wifi_nan.ndp.responder.ndi",
3905 FT_BYTES
, SEP_DASH
, NULL
, 0x0, NULL
, HFILL
3908 { &hf_nan_attr_ndp_specific_info
,
3910 "NDP Specific Info",
3911 "wifi_nan.ndp.specific_info",
3912 FT_BYTES
, SEP_DASH
, NULL
, 0x0, NULL
, HFILL
3915 { &hf_nan_attr_ndpe_tlv_type
,
3918 "wifi_nan.ndpe.tlv.type",
3919 FT_UINT8
, BASE_DEC
| BASE_RANGE_STRING
, RVALS(ndpe_tlv_type_values
), 0x0, NULL
, HFILL
3922 { &hf_nan_attr_ndpe_tlv_len
,
3925 "wifi_nan.ndpe.tlv.len",
3926 FT_UINT16
, BASE_DEC
, NULL
, 0x0, NULL
, HFILL
3929 { &hf_nan_attr_ndpe_tlv_ipv6_interface_identifier
,
3931 "Interface Identifier",
3932 "wifi_nan.ndpe.tlv.ipv6_interface_identifier",
3933 FT_BYTES
, SEP_COLON
, NULL
, 0x0, NULL
, HFILL
3936 { &hf_nan_attr_availability_sequence_id
,
3939 "wifi_nan.availability.sequence_id",
3940 FT_UINT8
, BASE_DEC
, NULL
, 0x0, NULL
, HFILL
3943 { &hf_nan_attr_availability_ctr
,
3945 "Attribute Control",
3946 "wifi_nan.availability.ctr",
3947 FT_UINT16
, BASE_HEX
, NULL
, 0x0, NULL
, HFILL
3950 { &hf_nan_attr_availability_map_id
,
3953 "wifi_nan.availability.map_id",
3954 FT_UINT16
, BASE_HEX_DEC
, NULL
, 0x000F, NULL
, HFILL
3957 { &hf_nan_attr_availability_committed_changed
,
3959 "Committed Changed",
3960 "wifi_nan.availability.committed_changed",
3961 FT_BOOLEAN
, 16, NULL
, 0x0010, NULL
, HFILL
3964 { &hf_nan_attr_availability_potential_changed
,
3966 "Potential Changed",
3967 "wifi_nan.availability.potential_changed",
3968 FT_BOOLEAN
, 16, NULL
, 0x0020, NULL
, HFILL
3971 { &hf_nan_attr_availability_public_availability_changed
,
3973 "Public Availability Attribute Changed",
3974 "wifi_nan.availability.public_availability_changed",
3975 FT_BOOLEAN
, 16, NULL
, 0x0040, NULL
, HFILL
3978 { &hf_nan_attr_availability_ndc_changed
,
3980 "NDC Attribute Changed",
3981 "wifi_nan.availability.ndc_changed",
3982 FT_BOOLEAN
, 16, NULL
, 0x0080, NULL
, HFILL
3985 { &hf_nan_attr_availability_reserved_multicast_schedule_changed
,
3987 "Reserved (Multicast Schedule Attribute Changed)",
3988 "wifi_nan.availability.reserved_multicast_schedule_changed",
3989 FT_BOOLEAN
, 16, NULL
, 0x0100, NULL
, HFILL
3992 { &hf_nan_attr_availability_reserved_multicast_schedule_change_changed
,
3994 "Reserved (Multicast Schedule Change Attribute Change Changed)",
3995 "wifi_nan.availability.reserved_multicast_schedule_change_changed",
3996 FT_BOOLEAN
, 16, NULL
, 0x0200, NULL
, HFILL
3999 { &hf_nan_attr_availability_entry_len
,
4002 "wifi_nan.availability.entry.len",
4003 FT_UINT16
, BASE_DEC
, NULL
, 0x0, NULL
, HFILL
4006 { &hf_nan_attr_availability_entry_ctr
,
4009 "wifi_nan.availability.entry.ctr",
4010 FT_UINT16
, BASE_HEX
, NULL
, 0x0, NULL
, HFILL
4013 { &hf_nan_attr_availability_entry_ctr_type
,
4015 "Availability Type",
4016 "wifi_nan.availability.entry.ctr.type",
4017 FT_UINT16
, BASE_HEX
, VALS(availability_entry_type
), 0x0007, NULL
, HFILL
4020 { &hf_nan_attr_availability_entry_ctr_pref
,
4023 "wifi_nan.availability.entry.ctr.pref",
4024 FT_UINT16
, BASE_DEC
, NULL
, 0x0018, NULL
, HFILL
4027 { &hf_nan_attr_availability_entry_ctr_utilization
,
4030 "wifi_nan.availability.entry.ctr.utilization",
4031 FT_UINT16
, BASE_DEC
, NULL
, 0x00E0, NULL
, HFILL
4034 { &hf_nan_attr_availability_entry_ctr_rx_nss
,
4037 "wifi_nan.availability.entry.ctr.rx_nss",
4038 FT_UINT16
, BASE_DEC
, NULL
, 0x0F00, NULL
, HFILL
4041 { &hf_nan_attr_availability_entry_ctr_time_bitmap
,
4043 "Time Bitmap Present",
4044 "wifi_nan.availability.entry.ctr.time_bitmap",
4045 FT_BOOLEAN
, 16, NULL
, 0x1000, NULL
, HFILL
4048 { &hf_nan_attr_availability_entry_entries_type
,
4051 "wifi_nan.availability.entry.entries.type",
4052 FT_BOOLEAN
, BASE_NONE
, TFS(&availability_entry_entries_type_flags
), 0x0, NULL
, HFILL
4055 { &hf_nan_attr_availability_entry_entries_non_contiguous_bw
,
4057 "Non-contiguous Bandwidth",
4058 "wifi_nan.availability.entry.entries.non_contiguous_bw",
4059 FT_BOOLEAN
, BASE_NONE
, NULL
, 0x0, NULL
, HFILL
4062 { &hf_nan_attr_availability_entry_entries_num_entries
,
4064 "Number of Entries",
4065 "wifi_nan.availability.entry.entries.num_entries",
4066 FT_UINT8
, BASE_DEC
, NULL
, 0x0, NULL
, HFILL
4069 { &hf_nan_attr_availability_entry_entries_band
,
4072 "wifi_nan.availability.entry.entries.band",
4073 FT_UINT8
, BASE_DEC
| BASE_RANGE_STRING
, RVALS(availability_entry_entries_band_type
), 0x0, NULL
, HFILL
4076 { &hf_nan_attr_availability_entry_entries_channel_op_class
,
4079 "wifi_nan.availability.entry.entries.channel.op_class",
4080 FT_UINT8
, BASE_DEC
, NULL
, 0x0, NULL
, HFILL
4083 { &hf_nan_attr_availability_entry_entries_channel_bitmap
,
4086 "wifi_nan.availability.entry.entries.channel.bitmap",
4087 FT_UINT16
, BASE_HEX
, NULL
, 0x0, NULL
, HFILL
4090 { &hf_nan_attr_availability_entry_entries_primary_channel_bitmap
,
4092 "Primary Channel Bitmap",
4093 "wifi_nan.availability.entry.entries.channel.primary_bitmap",
4094 FT_UINT8
, BASE_HEX
, NULL
, 0x0, NULL
, HFILL
4097 { &hf_nan_attr_availability_entry_entries_aux_channel_bitmap
,
4099 "Auxiliary Channel Bitmap",
4100 "wifi_nan.availability.entry.entries.channel.aux_bitmap",
4101 FT_UINT16
, BASE_HEX
, NULL
, 0x0, NULL
, HFILL
4104 { &hf_nan_attr_availability_entry_entries_channel_set
,
4106 "Channel Bitmap - Channel Set",
4107 "wifi_nan.ava.chan.set",
4108 FT_STRING
, BASE_NONE
, NULL
, 0x00, NULL
, HFILL
4111 { &hf_nan_attr_availability_entry_entries_start_channel_number
,
4113 "Start Channel Number",
4114 "wifi_nan.availability.entry.entries.channel.start_channel_number",
4115 FT_UINT8
, BASE_DEC
, NULL
, 0x0, NULL
, HFILL
4118 { &hf_nan_attr_availability_entry_entries_number_of_ch_included
,
4120 "Number of Channels Included",
4121 "wifi_nan.availability.entry.entries.channel.num_of_channel",
4122 FT_UINT8
, BASE_DEC
, NULL
, 0x0, NULL
, HFILL
4125 { &hf_nan_attr_availability_entry_entries_start_freq
,
4127 "Starting Frequency",
4128 "wifi_nan.av.entry.start.freq",
4129 FT_UINT8
, BASE_DEC
| BASE_RANGE_STRING
, RVALS(op_starting_freq
), 0x0, NULL
, HFILL
4132 { &hf_nan_attr_availability_entry_entries_bandwidth
,
4135 "wifi_nan.av.entry.bandwidth",
4136 FT_UINT8
, BASE_DEC
| BASE_RANGE_STRING
, RVALS(op_channel_spacing
), 0x0, NULL
, HFILL
4139 { &hf_nan_attr_ndc_id
,
4143 FT_BYTES
, SEP_DASH
, NULL
, 0x0, NULL
, HFILL
4146 { &hf_nan_attr_ndc_ctrl
,
4149 "wifi_nan.ndc.ctrl",
4150 FT_UINT8
, BASE_HEX
, NULL
, 0x0, NULL
, HFILL
4153 { &hf_nan_attr_ndc_ctrl_selected
,
4156 "wifi_nan.ndc.ctrl.selected",
4157 FT_BOOLEAN
, 8, TFS(&ndc_ctr_selected_flags
), 0x01, NULL
, HFILL
4160 { &hf_nan_attr_ndc_map_id_related_sch
,
4162 "NAN Availability associated with schedule time bitmap",
4163 "wifi_nan.ndc.map.id.rel",
4164 FT_UINT8
, BASE_DEC
, NULL
, 0x0f, NULL
, HFILL
4167 { &hf_nan_attr_ndl_type
,
4170 "wifi_nan.ndl.type",
4171 FT_UINT8
, BASE_DEC
| BASE_RANGE_STRING
, RVALS(ndl_type_values
), 0xF, NULL
, HFILL
4174 { &hf_nan_attr_ndl_control
,
4177 "wifi_nan.ndl.ctrl",
4178 FT_UINT8
, BASE_DEC
, NULL
, 0x0, NULL
, HFILL
4181 { &hf_nan_attr_ndl_ctrl_peer_id
,
4183 "NDL Peer ID Present",
4184 "wifi_nan.ndl.ctrl.peer_id",
4185 FT_BOOLEAN
, 8, NULL
, 0x1, NULL
, HFILL
4188 { &hf_nan_attr_ndl_ctrl_immutable_schedule_pres
,
4190 "Immutable Schedule Present",
4191 "wifi_nan.ndl.ctrl.immutable_schedule_pres",
4192 FT_BOOLEAN
, 8, NULL
, 0x2, NULL
, HFILL
4195 { &hf_nan_attr_ndl_ctrl_ndc_pres
,
4197 "NDC Attribute Present",
4198 "wifi_nan.ndl.ctrl.ndc_pres",
4199 FT_BOOLEAN
, 8, NULL
, 0x4, NULL
, HFILL
4202 { &hf_nan_attr_ndl_ctrl_qos
,
4205 "wifi_nan.ndl.ctrl.qos_pres",
4206 FT_BOOLEAN
, 8, NULL
, 0x8, NULL
, HFILL
4209 { &hf_nan_attr_ndl_ctrl_max_idle_pres
,
4211 "Max Idle period Present",
4212 "wifi_nan.ndl.ctrl.max_idle_period_pres",
4213 FT_BOOLEAN
, 8, NULL
, 0x10, NULL
, HFILL
4216 { &hf_nan_attr_ndl_ctrl_type
,
4219 "wifi_nan.ndl.ctrl.type",
4220 FT_UINT8
, BASE_DEC
, VALS(ndl_type_string
), 0x20, NULL
, HFILL
4223 { &hf_nan_attr_ndl_ctrl_setup_reason
,
4226 "wifi_nan.ndl.ctrl.setup_reason",
4227 FT_UINT8
, BASE_DEC
, VALS(ndl_setup_reason
), 0xC0, NULL
, HFILL
4230 { &hf_nan_attr_ndl_reserved_peer_id
,
4232 "Reserved (NDL Peer ID)",
4233 "wifi_nan.ndl.peer_id",
4234 FT_UINT8
, BASE_DEC_HEX
, NULL
, 0x0, NULL
, HFILL
4237 { &hf_nan_attr_ndl_max_idle
,
4240 "wifi_nan.ndl.max.idle",
4241 FT_UINT16
, BASE_DEC
, NULL
, 0x0, NULL
, HFILL
4244 { &hf_nan_attr_ndlqos_min_time_slots
,
4246 "Minimum Time Slots",
4247 "wifi_nan.ndl_qos.min_time_slots",
4248 FT_UINT8
, BASE_DEC
, NULL
, 0x0, NULL
, HFILL
4251 { &hf_nan_attr_ndlqos_max_latency
,
4254 "wifi_nan.ndl_qos.max_latency",
4255 FT_UINT16
, BASE_DEC
, NULL
, 0x0, NULL
, HFILL
4258 { &hf_nan_attr_unaligned_sch_ctrl
,
4260 "Attribute Control",
4261 "wifi_nan.unaligned_schedule.ctrl",
4262 FT_UINT16
, BASE_HEX_DEC
, NULL
, 0x0, NULL
, HFILL
4265 { &hf_nan_attr_unaligned_sch_ctrl_schedule_id
,
4268 "wifi_nan.unaligned_schedule.ctrl.schedule_id",
4269 FT_UINT16
, BASE_HEX_DEC
, NULL
, 0xF, NULL
, HFILL
4272 { &hf_nan_attr_unaligned_sch_ctrl_seq_id
,
4275 "wifi_nan.unaligned_schedule.ctrl.sequence_id",
4276 FT_UINT16
, BASE_HEX_DEC
, NULL
, 0x0F00, NULL
, HFILL
4279 { &hf_nan_attr_unaligned_sch_starting_time
,
4282 "wifi_nan.unaligned_schedule.starting_time",
4283 FT_UINT32
, BASE_HEX_DEC
, NULL
, 0x0, NULL
, HFILL
4286 { &hf_nan_attr_unaligned_sch_duration
,
4289 "wifi_nan.unaligned_schedule.duration",
4290 FT_UINT32
, BASE_DEC
, NULL
, 0x0, NULL
, HFILL
4293 { &hf_nan_attr_unaligned_sch_period
,
4296 "wifi_nan.unaligned_schedule.period",
4297 FT_UINT32
, BASE_DEC
, NULL
, 0x0, NULL
, HFILL
4300 { &hf_nan_attr_unaligned_sch_count_down
,
4303 "wifi_nan.unaligned_schedule.count_down",
4304 FT_UINT8
, BASE_DEC
, NULL
, 0x0, NULL
, HFILL
4307 { &hf_nan_attr_unaligned_sch_ulw_overwrite
,
4310 "wifi_nan.unaligned_schedule.ulw_overwrite",
4311 FT_UINT8
, BASE_HEX
, NULL
, 0x0, NULL
, HFILL
4314 { &hf_nan_attr_unaligned_sch_ulw_overwrite_all
,
4317 "wifi_nan.unaligned_schedule.ulw_overwrite.overwrite_all",
4318 FT_BOOLEAN
, 8, NULL
, 0x1, NULL
, HFILL
4321 { &hf_nan_attr_unaligned_sch_ulw_overwrite_map_id
,
4324 "wifi_nan.unaligned_schedule.ulw_overwrite.map_id",
4325 FT_UINT8
, BASE_HEX_DEC
, NULL
, 0x1E, NULL
, HFILL
4328 { &hf_nan_attr_unaligned_sch_ulw_ctrl
,
4330 "ULW Control Field",
4331 "wifi_nan.attribute.ulw.ctrl",
4332 FT_UINT8
, BASE_HEX
, NULL
, 0x0, NULL
, HFILL
4335 { &hf_nan_attr_unaligned_sch_ulw_ctrl_type
,
4338 "wifi_nan.unaligned_schedule.ulw_ctrl.type",
4339 FT_UINT8
, BASE_DEC_HEX
, VALS(unaligned_sch_ulw_type
), 0x3, NULL
, HFILL
4342 { &hf_nan_attr_unaligned_sch_ulw_ctrl_channel_av
,
4344 "Channel Availability",
4345 "wifi_nan.unaligned_schedule.ulw_ctrl.channel_availability",
4346 FT_BOOLEAN
, 8, NULL
, 0x04, NULL
, HFILL
4349 { &hf_nan_attr_unaligned_sch_ulw_ctrl_rxnss
,
4352 "wifi_nan.unaligned_schedule.ulw_ctrl.rx_nss",
4353 FT_UINT8
, BASE_HEX
, NULL
, 0x78, NULL
, HFILL
4356 { &hf_nan_attr_ranging_info_location_info_avail
,
4358 "Location Info Availability",
4359 "wifi_nan.ranging_info.location_info_availability",
4360 FT_UINT8
, BASE_HEX
, NULL
, 0x0, NULL
, HFILL
4363 { &hf_nan_attr_ranging_info_location_info_avail_lci
,
4365 "LCI Local Coordinates",
4366 "wifi_nan.ranging_info.location_info_availability.local_coord",
4367 FT_BOOLEAN
, 8, NULL
, 0x1, NULL
, HFILL
4370 { &hf_nan_attr_ranging_info_location_info_avail_geospatial
,
4372 "Geospatial LCI WGS84",
4373 "wifi_nan.ranging_info.location_info_availability.geospatial",
4374 FT_BOOLEAN
, 8, NULL
, 0x2, NULL
, HFILL
4377 { &hf_nan_attr_ranging_info_location_info_avail_civic_location
,
4380 "wifi_nan.ranging_info.location_info_availability.civic_location",
4381 FT_BOOLEAN
, 8, NULL
, 0x4, NULL
, HFILL
4384 { &hf_nan_attr_ranging_info_location_info_avail_last_movement_pres
,
4386 "Last Movement Indication",
4387 "wifi_nan.ranging_info.location_info_availability.last_movement_indication",
4388 FT_BOOLEAN
, 8, NULL
, 0x8, NULL
, HFILL
4391 { &hf_nan_attr_ranging_info_last_movement_indication
,
4393 "Last Movement Indication",
4394 "wifi_nan.ranging_info.last_movement_indication",
4395 FT_UINT16
, BASE_DEC
, NULL
, 0x0, NULL
, HFILL
4398 { &hf_nan_attr_ranging_setup_type
,
4401 "wifi_nan.ranging_setup.type",
4402 FT_UINT8
, BASE_DEC
| BASE_RANGE_STRING
, RVALS(ranging_setup_type_values
), 0xF, NULL
, HFILL
4405 { &hf_nan_attr_ranging_setup_ctrl
,
4408 "wifi_nan.ranging_setup.ctrl",
4409 FT_UINT8
, BASE_DEC
, NULL
, 0x0, NULL
, HFILL
4412 { &hf_nan_attr_ranging_setup_ctrl_report_req
,
4414 "Ranging Report Required",
4415 "wifi_nan.ranging_setup.ctrl.report_required",
4416 FT_BOOLEAN
, 3, NULL
, 0x1, NULL
, HFILL
4419 { &hf_nan_attr_ranging_setup_ctrl_ftm_params
,
4421 "FTM Parameters Present",
4422 "wifi_nan.ranging_setup.ctrl.ftm_params",
4423 FT_BOOLEAN
, 3, NULL
, 0x2, NULL
, HFILL
4426 { &hf_nan_attr_ranging_setup_ctrl_entry_list
,
4428 "Ranging Schedule Entry List Present",
4429 "wifi_nan.ranging_setup.ctrl.sch_entry_pres",
4430 FT_BOOLEAN
, 3, NULL
, 0x4, NULL
, HFILL
4433 { &hf_nan_attr_ranging_setup_ftm_params
,
4436 "wifi_nan.ranging_setup.ftm",
4437 FT_UINT24
, BASE_HEX_DEC
, NULL
, 0x0, NULL
, HFILL
4440 { &hf_nan_attr_ranging_setup_ftm_max_burst_duration
,
4442 "Max Burst Duration",
4443 "wifi_nan.ranging_setup.ftm.max_burst_duration",
4444 FT_UINT24
, BASE_HEX_DEC
, NULL
, 0xF, NULL
, HFILL
4447 { &hf_nan_attr_ranging_setup_ftm_min_delta
,
4450 "wifi_nan.ranging_setup.ftm.min_delta_ftm",
4451 FT_UINT24
, BASE_HEX_DEC
, NULL
, 0x03F0, NULL
, HFILL
4454 { &hf_nan_attr_ranging_setup_ftm_max_per_burst
,
4456 "Max FTMs per Burst",
4457 "wifi_nan.ranging_setup.ftm.max_ftms_per_burst",
4458 FT_UINT24
, BASE_HEX_DEC
, NULL
, 0x7C00, NULL
, HFILL
4461 { &hf_nan_attr_ranging_setup_ftm_format_bw
,
4463 "FTM Format and Bandwidth",
4464 "wifi_nan.ranging_setup.ftm.format_bw",
4465 FT_UINT24
, BASE_HEX_DEC
, NULL
, 0x1F8000, NULL
, HFILL
4468 { &hf_nan_attr_ftm_range_report
,
4471 "wifi_nan.ftm.range_report",
4472 FT_BYTES
, SEP_DASH
, NULL
, 0x0, NULL
, HFILL
4475 { &hf_nan_attr_cipher_suite_capabilities
,
4478 "wifi_nan.cipher_suite.capabilities",
4479 FT_UINT8
, BASE_HEX
, NULL
, 0x0, NULL
, HFILL
4482 { &hf_nan_attr_cipher_suite_capabilities_ndtksa_nmtksa_replay_counters
,
4484 "ND-TKSA and NM-TKSA Replay Counters",
4485 "wifi_nan.cipher_suite.capabilities.replay_counters.ndtksa",
4486 FT_UINT8
, BASE_HEX
, VALS(cipher_suite_capabilities_nd_nm_tksa_replay_counters
), 0x01, NULL
, HFILL
4489 { &hf_nan_attr_cipher_suite_capabilities_gtksa_igtksa_bigtksa_support
,
4491 "GTKSA, IGTKSA, and BIGTKSA Support",
4492 "wifi_nan.cipher_suite.capabilities.group_key_support",
4493 FT_UINT8
, BASE_HEX
, VALS(cipher_suite_capabilities_group_and_integrity_sa_support
), 0x06, NULL
, HFILL
4496 { &hf_nan_attr_cipher_suite_capabilities_gtksa_replay_counters
,
4498 "GTKSA Replay Counters",
4499 "wifi_nan.cipher_suite.capabilities.replay_counters.gtksa",
4500 FT_UINT8
, BASE_HEX
, VALS(cipher_suite_capabilities_gtksa_replay_counters
), 0x08, NULL
, HFILL
4503 { &hf_nan_attr_cipher_suite_capabilities_igtksa_bigtksa_cipher
,
4505 "IGTKSA and BIGTKSA Cipher",
4506 "wifi_nan.cipher_suite.capabilities.integrity_key_cipher",
4507 FT_UINT8
, BASE_HEX
, VALS(cipher_suite_capabilities_integrity_sa_ciphers
), 0x10, NULL
, HFILL
4510 { &hf_nan_attr_cipher_suite_id
,
4513 "wifi_nan.cipher_suite.id",
4514 FT_UINT8
, BASE_DEC_HEX
, NULL
, 0x0, NULL
, HFILL
4517 { &hf_nan_attr_security_context_identifier
,
4519 "Security Context Identifier",
4520 "wifi_nan.security_context.identifier",
4521 FT_BYTES
, SEP_DASH
, NULL
, 0x0, NULL
, HFILL
4524 { &hf_nan_attr_security_context_identifier_len
,
4526 "Security Context Identifier Length",
4527 "wifi_nan.security_context.identifier_len",
4528 FT_UINT16
, BASE_DEC
, NULL
, 0x0, NULL
, HFILL
4531 { &hf_nan_attr_security_context_identifier_type
,
4533 "Security Context Identifier Type",
4534 "wifi_nan.security_context.identifier_type",
4535 FT_UINT8
, BASE_DEC
| BASE_RANGE_STRING
, RVALS(security_context_iden_type
), 0x0, NULL
, HFILL
4538 { &hf_nan_attr_shared_key_rsna_descriptor
,
4540 "IEEE 802.11 RSNA Key Descriptor",
4541 "wifi_nan.shared_key.rsna_key_descriptor",
4542 FT_BYTES
, SEP_DASH
, NULL
, 0x0, NULL
, HFILL
4545 { &hf_nan_attr_vendor_specific_body
,
4548 "wifi_nan.vendor_specific.body",
4549 FT_BYTES
, SEP_DASH
, NULL
, 0x0, NULL
, HFILL
4552 { &hf_nan_attr_container_element_id
,
4555 "wifi_nan.container.element.id",
4556 FT_UINT8
, BASE_DEC
, NULL
, 0x0, NULL
, HFILL
4559 { &hf_nan_attr_container_element_len
,
4562 "wifi_nan.container.element.len",
4563 FT_UINT8
, BASE_DEC
, NULL
, 0x0, NULL
, HFILL
4566 { &hf_nan_attr_device_capability_extension
,
4568 "Capability Extension",
4569 "wifi_nan.device_capability_extension.capability_info",
4570 FT_UINT16
, BASE_HEX
, NULL
, 0x0, NULL
, HFILL
4573 { &hf_nan_attr_device_capability_extension_6g_regulatory_info_presented
,
4575 "6GHz Regulatory Info Presented",
4576 "wifi_nan.device_capability_extension.6g_regulatory_presented",
4577 FT_BOOLEAN
, 16, NULL
, 0x0001, NULL
, HFILL
4580 { &hf_nan_attr_device_capability_extension_6g_regulatory_info
,
4582 "6GHz Regulatory Info",
4583 "wifi_nan.device_capability_extension.6g_regulatory",
4584 FT_UINT16
, BASE_HEX_DEC
, VALS(device_capability_extension_6g_regulatoty_info
), 0x000e, NULL
, HFILL
4587 { &hf_nan_attr_device_capability_extension_6g_regulatory_info_reserved
,
4589 "Reserved for 6GHz Regulatory Info",
4590 "wifi_nan.device_capability_extension.6g_regulatory_reserved",
4591 FT_UINT16
, BASE_HEX_DEC
, NULL
, 0x00f0, NULL
, HFILL
4594 { &hf_nan_attr_device_capability_extension_paring_setup_enabled
,
4597 "wifi_nan.device_capability_extension.paring_enable",
4598 FT_BOOLEAN
, 16, NULL
, 0x0100, NULL
, HFILL
4601 { &hf_nan_attr_device_capability_extension_npk_nik_cache_enabled
,
4603 "NPK/NIK Caching Enable",
4604 "wifi_nan.device_capability_extension.npk_nik_caching_enable",
4605 FT_BOOLEAN
, 16, NULL
, 0x0200, NULL
, HFILL
4608 { &hf_nan_attr_identity_cipher_version
,
4611 "wifi_nan.identity_resolution.cipher_version",
4612 FT_UINT8
, BASE_DEC
| BASE_RANGE_STRING
, RVALS(nan_identity_resolution_cipher_version
), 0x0, NULL
, HFILL
4615 { &hf_nan_attr_identity_resolution_nonce
,
4618 "wifi_nan.identity_resolution.nonce",
4619 FT_BYTES
, SEP_DASH
, NULL
, 0x0, NULL
, HFILL
4622 { &hf_nan_attr_identity_resolution_tag
,
4625 "wifi_nan.identity_resolution.tag",
4626 FT_BYTES
, SEP_DASH
, NULL
, 0x0, NULL
, HFILL
4629 { &hf_nan_attr_reserved
,
4632 "wifi_nan.reserved",
4633 FT_BYTES
, SEP_DASH
, NULL
, 0x0, NULL
, HFILL
4636 { &hf_nan_attr_pairing_bootstrapping_dialog_token
,
4639 "wifi_nan.nan_pairing_bootstrapping.dialog_token",
4640 FT_UINT8
, BASE_DEC
, NULL
, 0x0, NULL
, HFILL
4643 { &hf_nan_attr_pairing_bootstrapping_type_status
,
4646 "wifi_nan.nan_pairing_bootstrapping.type_status",
4647 FT_UINT8
, BASE_DEC
, NULL
, 0x0, NULL
, HFILL
4650 { &hf_nan_attr_pairing_bootstrapping_type
,
4653 "wifi_nan.nan_pairing_bootstrapping.type",
4654 FT_UINT8
, BASE_HEX_DEC
, VALS(nan_pairing_bootstrapping_pairing_bootstrapping_type
), 0x0f, NULL
, HFILL
4657 { &hf_nan_attr_pairing_bootstrapping_status
,
4660 "wifi_nan.nan_pairing_bootstrapping.status",
4661 FT_UINT8
, BASE_HEX_DEC
, VALS(nan_pairing_bootstrapping_pairing_bootstrapping_status
), 0xf0, NULL
, HFILL
4664 { &hf_nan_attr_pairing_bootstrapping_comeback_after
,
4666 "Comeback after (TU)",
4667 "wifi_nan.nan_pairing_bootstrapping.comeback_after",
4668 FT_UINT16
, BASE_DEC
, NULL
, 0x0, NULL
, HFILL
4671 { &hf_nan_attr_pairing_bootstrapping_comeback_cookie_len
,
4674 "wifi_nan.nan_pairing_bootstrapping.cookie_len",
4675 FT_UINT8
, BASE_DEC
, NULL
, 0x0, NULL
, HFILL
4678 { &hf_nan_attr_pairing_bootstrapping_comeback_cookie
,
4681 "wifi_nan.nan_pairing_bootstrapping.cookie",
4682 FT_BYTES
, SEP_DASH
, NULL
, 0x0, NULL
, HFILL
4685 { &hf_nan_attr_pairing_bootstrapping_methods
,
4687 "Bootstrapping Methods",
4688 "wifi_nan.nan_pairing_bootstrapping.bootstrapping_methods",
4689 FT_UINT16
, BASE_HEX
, NULL
, 0x0, NULL
, HFILL
4692 { &hf_nan_attr_pairing_bootstrapping_method_opportunistic_bootstrapping
,
4694 "Opportunistic Bootstrapping",
4695 "wifi_nan.nan_pairing_bootstrapping.bootstrapping_methods.opportunistic",
4696 FT_UINT16
, BASE_HEX
, NULL
, 0x0001, NULL
, HFILL
4699 { &hf_nan_attr_pairing_bootstrapping_method_pin_code_display
,
4701 "Pin Code (Display)",
4702 "wifi_nan.nan_pairing_bootstrapping.bootstrapping_methods.pin_code_display",
4703 FT_UINT16
, BASE_HEX
, NULL
, 0x0002, NULL
, HFILL
4706 { &hf_nan_attr_pairing_bootstrapping_method_passphrase_display
,
4708 "Passphrase (Display)",
4709 "wifi_nan.nan_pairing_bootstrapping.bootstrapping_methods.passphrase_display",
4710 FT_UINT16
, BASE_HEX
, NULL
, 0x0004, NULL
, HFILL
4713 { &hf_nan_attr_pairing_bootstrapping_method_qr_code_display
,
4715 "QR Code (Display)",
4716 "wifi_nan.nan_pairing_bootstrapping.bootstrapping_methods.qr_code_display",
4717 FT_UINT16
, BASE_HEX
, NULL
, 0x0008, NULL
, HFILL
4720 { &hf_nan_attr_pairing_bootstrapping_method_nfc_tag
,
4723 "wifi_nan.nan_pairing_bootstrapping.bootstrapping_methods.nfc_tag",
4724 FT_UINT16
, BASE_HEX
, NULL
, 0x0010, NULL
, HFILL
4727 { &hf_nan_attr_pairing_bootstrapping_method_keypad_pin_code_only
,
4729 "Pin Code Only (Keypad)",
4730 "wifi_nan.nan_pairing_bootstrapping.bootstrapping_methods.pin_code_keypad",
4731 FT_UINT16
, BASE_HEX
, NULL
, 0x0020, NULL
, HFILL
4734 { &hf_nan_attr_pairing_bootstrapping_method_keypad_passphrase
,
4736 "Passphrase (Keypad)",
4737 "wifi_nan.nan_pairing_bootstrapping.bootstrapping_methods.passphrase_keypad",
4738 FT_UINT16
, BASE_HEX
, NULL
, 0x0040, NULL
, HFILL
4741 { &hf_nan_attr_pairing_bootstrapping_method_qr_code_scan
,
4744 "wifi_nan.nan_pairing_bootstrapping.bootstrapping_methods.qr_code_scan",
4745 FT_UINT16
, BASE_HEX
, NULL
, 0x0080, NULL
, HFILL
4748 { &hf_nan_attr_pairing_bootstrapping_method_nfc_reader
,
4751 "wifi_nan.nan_pairing_bootstrapping.bootstrapping_methods.nfc_reader",
4752 FT_UINT16
, BASE_HEX
, NULL
, 0x0100, NULL
, HFILL
4755 { &hf_nan_attr_pairing_bootstrapping_method_reserved
,
4758 "wifi_nan.nan_pairing_bootstrapping.bootstrapping_methods.reserved",
4759 FT_UINT16
, BASE_HEX
, NULL
, 0x3e00, NULL
, HFILL
4762 { &hf_nan_attr_pairing_bootstrapping_method_service_managed_bootstrapping
,
4765 "wifi_nan.nan_pairing_bootstrapping.bootstrapping_methods.service_managed",
4766 FT_UINT16
, BASE_HEX
, NULL
, 0x4000, NULL
, HFILL
4769 { &hf_nan_attr_pairing_bootstrapping_method_bootstrapping_handshakes_skipped
,
4771 "Bootstrapping Handshakes Skipped",
4772 "wifi_nan.nan_pairing_bootstrapping.bootstrapping_methods.bootstrapping_handshakes_skipped",
4773 FT_UINT16
, BASE_HEX
, NULL
, 0x8000, NULL
, HFILL
4778 static int* ett
[] = {
4783 &ett_time_bitmap_ctrl
,
4784 &ett_non_nan_op_channel
,
4785 &ett_non_nan_beacon
,
4786 &ett_cluster_anchor_master_info
,
4787 &ett_sda_service_ctr
,
4790 &ett_sdea_range_limit
,
4791 &ett_sdea_service_info
,
4792 &ett_connection_cap_field
,
4793 &ett_further_av_map_entry_ctrl
,
4794 &ett_p2p_device_role
,
4795 &ett_device_cap_map_id
,
4796 &ett_device_cap_committed_dw
,
4797 &ett_device_cap_supported_bands
,
4798 &ett_device_cap_op_mode
,
4799 &ett_device_cap_antennas
,
4800 &ett_device_cap_capabilities
,
4803 &ett_availability_ctr
,
4804 &ett_availability_entry
,
4805 &ett_availability_entry_ctr
,
4806 &ett_availability_entry_entries
,
4807 &ett_availability_entry_entries_channel
,
4808 &ett_availability_op_class
,
4811 &ett_device_ndc_map_id
,
4813 &ett_ndl_schedule_entries
,
4814 &ett_unaligned_sch_ctrl
,
4815 &ett_unaligned_sch_ulw_overwrite
,
4816 &ett_unaligned_sch_ulw_ctrl
,
4817 &ett_ranging_info_location_info_availability
,
4818 &ett_ranging_setup_ctrl
,
4819 &ett_ranging_setup_ftm_params
,
4820 &ett_ranging_setup_schedule_entries
,
4821 &ett_cipher_suite_info_list
,
4822 &ett_security_context_identifiers
,
4823 &ett_public_availability_sch_entries
,
4825 &ett_device_capability_extension
,
4826 &ett_nan_pairing_bootstrapping_type_status
,
4827 &ett_nan_pairing_bootstrapping_method
,
4828 &ett_nan_cipher_suite_capabilities
4831 static ei_register_info ei
[] = {
4832 { &ei_nan_elem_len_invalid
,
4834 "wifi_nan.expert.elem_len_invalid",
4835 PI_MALFORMED
, PI_ERROR
,
4836 "Element length invalid",
4840 { &ei_nan_unknown_attr_id
,
4842 "wifi_nan.expert.unknown_attr_id",
4843 PI_PROTOCOL
, PI_ERROR
,
4844 "Unknown attribute ID",
4848 { &ei_nan_unknown_op_class
,
4850 "wifi_nan.expert.unknown_op_class",
4851 PI_PROTOCOL
, PI_COMMENT
,
4852 "Unknown Operating Class - Channel Set unavailable",
4856 { &ei_nan_unknown_beacon_type
,
4858 "wifi_nan.expert.unknown_beacon_type",
4859 PI_PROTOCOL
, PI_WARN
,
4860 "Unknown beacon type - Beacon type detection error",
4864 { &ei_nan_invalid_channel_num_for_op_class
,
4866 "wifi_nan.expert.invalid_ch_num",
4867 PI_PROTOCOL
, PI_WARN
,
4868 "Invalid Channel number for given operation class",
4872 { &ei_nan_invalid_channel_count
,
4874 "wifi_nan.expert.invalid_ch_count",
4875 PI_PROTOCOL
, PI_WARN
,
4876 "Invalid Channel count",
4882 proto_nan
= proto_register_protocol("Wi-Fi Neighbor Awareness Networking (NAN)", "Wi-Fi NAN", "wifi_nan");
4884 proto_register_field_array(proto_nan
, hf
, array_length(hf
));
4885 proto_register_subtree_array(ett
, array_length(ett
));
4887 nan_act_handle
= register_dissector("nan.action", dissect_nan_action
, proto_nan
);
4888 nan_disco_handle
= register_dissector("nan.service_discovery", dissect_nan_service_discovery
, proto_nan
);
4889 nan_beacon_handle
= register_dissector("nan.beacon", dissect_nan_beacon
, proto_nan
);
4891 expert_module_t
* expert_nan
= expert_register_protocol(proto_nan
);
4892 expert_register_field_array(expert_nan
, ei
, array_length(ei
));
4894 ie_handle_table
= find_dissector_table("wlan.tag.number");
4898 proto_reg_handoff_nan(void)
4900 dissector_add_uint("wlan.pa.wifi_alliance.subtype", WFA_ACTION_OUI_TYPE
, nan_act_handle
);
4901 dissector_add_uint("wlan.pa.wifi_alliance.subtype", WFA_SERVICE_DISCOVERY_SUBTYPE
, nan_disco_handle
);
4902 dissector_add_uint("wlan.ie.wifi_alliance.subtype", WFA_NAN_IE_OUI_TYPE
, nan_beacon_handle
);
4906 * Editor modelines - https://www.wireshark.org/tools/modelines.html
4911 * indent-tabs-mode: nil
4914 * vi: set shiftwidth=4 tabstop=8 expandtab:
4915 * :indentSize=4:tabSize=8:noTabs=true: