Revert "TODO epan/dissectors/asn1/kerberos/packet-kerberos-template.c new GSS flags"
[wireshark-sm.git] / epan / dissectors / packet-wifi-p2p.c
blobd1d0508dcac8c2682743c4f5379ac09565590ef5
1 /* packet-wifi-p2p.c
3 * Wi-Fi P2P
5 * Copyright 2009-2010 Atheros Communications
7 * SPDX-License-Identifier: GPL-2.0-or-later
8 */
10 #include "config.h"
12 #include <epan/packet.h>
13 #include <epan/to_str.h>
14 #include <epan/expert.h>
16 #include "packet-ieee80211.h"
18 void proto_register_p2p(void);
19 void proto_reg_handoff_p2p(void);
21 enum {
22 P2P_ATTR_STATUS = 0,
23 P2P_ATTR_MINOR_REASON_CODE = 1,
24 P2P_ATTR_P2P_CAPABILITY = 2,
25 P2P_ATTR_P2P_DEVICE_ID = 3,
26 P2P_ATTR_GROUP_OWNER_INTENT = 4,
27 P2P_ATTR_CONFIGURATION_TIMEOUT = 5,
28 P2P_ATTR_LISTEN_CHANNEL = 6,
29 P2P_ATTR_P2P_GROUP_BSSID = 7,
30 P2P_ATTR_EXTENDED_LISTEN_TIMING = 8,
31 P2P_ATTR_INTENDED_P2P_INTERFACE_ADDRESS = 9,
32 P2P_ATTR_P2P_MANAGEABILITY = 10,
33 P2P_ATTR_CHANNEL_LIST = 11,
34 P2P_ATTR_NOTICE_OF_ABSENCE = 12,
35 P2P_ATTR_P2P_DEVICE_INFO = 13,
36 P2P_ATTR_P2P_GROUP_INFO = 14,
37 P2P_ATTR_P2P_GROUP_ID = 15,
38 P2P_ATTR_P2P_INTERFACE = 16,
39 P2P_ATTR_OPERATING_CHANNEL = 17,
40 P2P_ATTR_INVITATION_FLAGS = 18,
41 P2P_ATTR_OOB_GROUP_OWNER_NEGOTIATION_CHANNEL = 19,
42 /* 20 Unused */
43 P2P_ATTR_SERVICE_HASH = 21,
44 P2P_ATTR_SESSION_INFORMATION_DATA_INFO = 22,
45 P2P_ATTR_CONNECTION_CAPABILITY_INFO = 23,
46 P2P_ATTR_ADVERTISEMENT_ID_INFO = 24,
47 P2P_ATTR_ADVERTISED_SERVICE_INFO = 25,
48 P2P_ATTR_SESSION_ID_INFO = 26,
49 P2P_ATTR_FEATURE_CAPABILITY = 27,
50 P2P_ATTR_PERSISTENT_GROUP_INFO = 28,
51 /* 29-220 Reserved */
52 P2P_ATTR_VENDOR_SPECIFIC = 221
53 /* 222-255 Reserved */
56 static const value_string p2p_attr_types[] = {
57 { P2P_ATTR_STATUS, "Status" },
58 { P2P_ATTR_MINOR_REASON_CODE, "Minor Reason Code" },
59 { P2P_ATTR_P2P_CAPABILITY, "P2P Capability" },
60 { P2P_ATTR_P2P_DEVICE_ID, "P2P Device ID" },
61 { P2P_ATTR_GROUP_OWNER_INTENT, "Group Owner Intent" },
62 { P2P_ATTR_CONFIGURATION_TIMEOUT, "Configuration Timeout" },
63 { P2P_ATTR_LISTEN_CHANNEL, "Listen Channel" },
64 { P2P_ATTR_P2P_GROUP_BSSID, "P2P Group BSSID" },
65 { P2P_ATTR_EXTENDED_LISTEN_TIMING, "Extended Listen Timing" },
66 { P2P_ATTR_INTENDED_P2P_INTERFACE_ADDRESS,
67 "Intended P2P Interface Address" },
68 { P2P_ATTR_P2P_MANAGEABILITY, "P2P Manageability" },
69 { P2P_ATTR_CHANNEL_LIST, "Channel List" },
70 { P2P_ATTR_NOTICE_OF_ABSENCE, "Notice of Absence" },
71 { P2P_ATTR_P2P_DEVICE_INFO, "P2P Device Info" },
72 { P2P_ATTR_P2P_GROUP_INFO, "P2P Group Info" },
73 { P2P_ATTR_P2P_GROUP_ID, "P2P Group ID" },
74 { P2P_ATTR_P2P_INTERFACE, "P2P Interface" },
75 { P2P_ATTR_OPERATING_CHANNEL, "Operating Channel" },
76 { P2P_ATTR_INVITATION_FLAGS, "Invitation Flags" },
77 { P2P_ATTR_VENDOR_SPECIFIC, "Vendor specific attribute" },
78 { P2P_ATTR_OOB_GROUP_OWNER_NEGOTIATION_CHANNEL, "Out-of-Band Group Owner Negotiation Channel" },
79 { 20, "Unused" },
80 { P2P_ATTR_SERVICE_HASH, "Service Hash" },
81 { P2P_ATTR_SESSION_INFORMATION_DATA_INFO, "Session Information Data Info" },
82 { P2P_ATTR_CONNECTION_CAPABILITY_INFO, "Connection Capability Info" },
83 { P2P_ATTR_ADVERTISEMENT_ID_INFO, "Advertisement ID Info" },
84 { P2P_ATTR_ADVERTISED_SERVICE_INFO, "Advertised Service Info" },
85 { P2P_ATTR_SESSION_ID_INFO, "Session ID Info" },
86 { P2P_ATTR_FEATURE_CAPABILITY, "Feature Capability" },
87 { P2P_ATTR_PERSISTENT_GROUP_INFO, "Persistent Group Info" },
88 { 0, NULL }
91 #define P2P_DEV_CAPAB_SERVICE_DISCOVERY 0x01
92 #define P2P_DEV_CAPAB_P2P_CLIENT_DISCOVERABILITY 0x02
93 #define P2P_DEV_CAPAB_CONCURRENT_OPERATION 0x04
94 #define P2P_DEV_CAPAB_P2P_INFRASTRUCTURE_MANAGED 0x08
95 #define P2P_DEV_CAPAB_P2P_DEVICE_LIMIT 0x10
96 #define P2P_DEV_CAPAB_P2P_INVITATION_PROCEDURE 0x20
98 #define P2P_GROUP_CAPAB_P2P_GROUP_OWNER 0x01
99 #define P2P_GROUP_CAPAB_PERSISTENT_P2P_GROUP 0x02
100 #define P2P_GROUP_CAPAB_P2P_GROUP_LIMIT 0x04
101 #define P2P_GROUP_CAPAB_INTRA_BSS_DISTRIBUTION 0x08
102 #define P2P_GROUP_CAPAB_CROSS_CONNECTION 0x10
103 #define P2P_GROUP_CAPAB_PERSISTENT_RECONNECT 0x20
104 #define P2P_GROUP_CAPAB_GROUP_FORMATION 0x40
106 #define WPS_CONF_METH_USBA 0x0001
107 #define WPS_CONF_METH_ETHERNET 0x0002
108 #define WPS_CONF_METH_LABEL 0x0004
109 #define WPS_CONF_METH_DISPLAY 0x0008
110 #define WPS_CONF_METH_EXT_NFC_TOKEN 0x0010
111 #define WPS_CONF_METH_INT_NFC_TOKEN 0x0020
112 #define WPS_CONF_METH_NFC_INTERFACE 0x0040
113 #define WPS_CONF_METH_PUSHBUTTON 0x0080
114 #define WPS_CONF_METH_KEYPAD 0x0100
116 enum {
117 P2P_ACT_GO_NEG_REQ = 0,
118 P2P_ACT_GO_NEG_RESP = 1,
119 P2P_ACT_GO_NEG_CONF = 2,
120 P2P_ACT_INVITATION_REQ = 3,
121 P2P_ACT_INVITATION_RESP = 4,
122 P2P_ACT_DEV_DISC_REQ = 5,
123 P2P_ACT_DEV_DISC_RESP = 6,
124 P2P_ACT_PROV_DISC_REQ = 7,
125 P2P_ACT_PROV_DISC_RESP = 8
128 static const value_string p2p_public_action_subtypes[] = {
129 { P2P_ACT_GO_NEG_REQ, "GO Negotiation Request" },
130 { P2P_ACT_GO_NEG_RESP, "GO Negotiation Response" },
131 { P2P_ACT_GO_NEG_CONF, "GO Negotiation Confirmation" },
132 { P2P_ACT_INVITATION_REQ, "P2P Invitation Request" },
133 { P2P_ACT_INVITATION_RESP, "P2P Invitation Response" },
134 { P2P_ACT_DEV_DISC_REQ, "Device Discoverability Request" },
135 { P2P_ACT_DEV_DISC_RESP, "Device Discoverability Response" },
136 { P2P_ACT_PROV_DISC_REQ, "Provision Discovery Request" },
137 { P2P_ACT_PROV_DISC_RESP, "Provision Discovery Response" },
138 { 0, NULL }
141 enum {
142 P2P_ACT_NOA = 0,
143 P2P_ACT_P2P_PRESENCE_REQ = 1,
144 P2P_ACT_P2P_PRESENCE_RESP = 2,
145 P2P_ACT_GO_DISC_REQ = 3
148 static const value_string p2p_action_subtypes[] = {
149 { P2P_ACT_NOA, "Notice of Absence" },
150 { P2P_ACT_P2P_PRESENCE_REQ, "P2P Presence Request" },
151 { P2P_ACT_P2P_PRESENCE_RESP, "P2P Presence Response" },
152 { P2P_ACT_GO_DISC_REQ, "GO Discoverability Request" },
153 { 0, NULL }
156 enum {
157 P2P_STATUS_SUCCESS = 0,
158 P2P_FAIL_INFORMATION_CURRENTLY_UNAVAILABLE = 1,
159 P2P_FAIL_INCOMPATIBLE_PARAMETERS = 2,
160 P2P_FAIL_LIMIT_REACHED = 3,
161 P2P_FAIL_INVALID_PARAMETERS = 4,
162 P2P_FAIL_UNABLE_TO_ACCOMMODATE = 5,
163 P2P_FAIL_PREVIOUS_PROTOCOL_ERROR = 6,
164 P2P_FAIL_NO_COMMON_CHANNELS = 7,
165 P2P_FAIL_UNKNOWN_P2P_GROUP = 8,
166 P2P_FAIL_BOTH_DEVICES_GO = 9,
167 P2P_FAIL_INCOMPATIBLE_PROVISION_METHOD = 10,
168 P2P_FAIL_REJECTED_BY_USER = 11,
169 P2P_SUCCESS_ACCEPTED_BY_USER = 12
172 static const value_string p2p_status_codes[] = {
173 { P2P_STATUS_SUCCESS, "Success" },
174 { P2P_FAIL_INFORMATION_CURRENTLY_UNAVAILABLE, "Fail; information is "
175 "currently unavailable" },
176 { P2P_FAIL_INCOMPATIBLE_PARAMETERS, "Fail; incompatible parameters" },
177 { P2P_FAIL_LIMIT_REACHED, "Fail; limit reached" },
178 { P2P_FAIL_INVALID_PARAMETERS, "Fail; invalid parameters" },
179 { P2P_FAIL_UNABLE_TO_ACCOMMODATE, "Fail; unable to accommodate request" },
180 { P2P_FAIL_PREVIOUS_PROTOCOL_ERROR, "Fail; previous protocol error, or "
181 "disruptive behavior" },
182 { P2P_FAIL_NO_COMMON_CHANNELS, "Fail; no common channels" },
183 { P2P_FAIL_UNKNOWN_P2P_GROUP, "Fail; unknown P2P Group" },
184 { P2P_FAIL_BOTH_DEVICES_GO, "Fail; both P2P Devices indicated an Intent of "
185 "15 in Group Owner Negotiation" },
186 { P2P_FAIL_INCOMPATIBLE_PROVISION_METHOD, "Fail; incompatible provisioning "
187 "method" },
188 { P2P_FAIL_REJECTED_BY_USER, "Fail; rejected by user" },
189 { P2P_SUCCESS_ACCEPTED_BY_USER, "Success; Accepted by user" },
190 { 0, NULL }
193 enum {
194 P2P_MINOR_RESERVED = 0,
195 P2P_MINOR_DISCONNECT_DUE_TO_CROSS_CONNECTION = 1,
196 P2P_MINOR_DISCONNECT_DUE_TO_NOT_P2P_MANAGED = 2,
197 P2P_MINOR_DISCONNECT_DUE_TO_NO_COEXISTENCE = 3,
198 P2P_MINOR_DISCONNECT_DUE_TO_OUTSIDE_POLICY = 4
201 static const value_string p2p_minor_reason_codes[] = {
202 { P2P_MINOR_RESERVED, "Reserved" },
203 { P2P_MINOR_DISCONNECT_DUE_TO_CROSS_CONNECTION,
204 "Disconnected because Cross Connection capability is not allow" },
205 { P2P_MINOR_DISCONNECT_DUE_TO_NOT_P2P_MANAGED,
206 "Disconnected because P2P Infrastructure Managed not supported" },
207 { P2P_MINOR_DISCONNECT_DUE_TO_NO_COEXISTENCE,
208 "Disconnected because concurrent device is not setting coexistence "
209 "parameters" },
210 { P2P_MINOR_DISCONNECT_DUE_TO_OUTSIDE_POLICY,
211 "Disconnected because P2P operation is outside the IT defined policy" },
212 { 0, NULL }
215 static const value_string invitation_types[] = {
216 { 0, "Join active P2P Group" },
217 { 1, "Reinvoke Persistent Group" },
218 { 0, NULL }
221 static const value_string p2p_service_protocol_types[] = {
222 { 0, "All Service Protocol Types" },
223 { 1, "Bonjour" },
224 { 2, "UPnP" },
225 { 3, "WS-Discovery" },
226 { 4, "Wi-Fi Display" },
227 { 0, NULL }
230 static const value_string p2p_sd_status_codes[] = {
231 { 0, "Success" },
232 { 1, "Service Protocol Type not available" },
233 { 2, "Requested information not available" },
234 { 3, "Bad Request" },
235 { 0, NULL }
238 static const value_string p2p_oob_group_owner_negotiation_channel_role_indication_vals[] = {
239 { 0, "Indicate that the P2P device is not in a group" },
240 { 1, "Indicate that the P2P device is a Group Client" },
241 { 2, "Indicate that the P2P device is a Group Owner" },
242 { 0, NULL }
245 static int proto_p2p;
247 static int ett_p2p_tlv;
248 static int ett_p2p_service_tlv;
249 static int ett_p2p_advertised_service;
250 static int ett_p2p_client_descr;
252 static int hf_p2p_attr_type;
253 static int hf_p2p_attr_len;
255 /* static int hf_p2p_attr_capab; */
256 static int hf_p2p_attr_capab_device;
257 static int hf_p2p_attr_capab_device_service_discovery;
258 static int hf_p2p_attr_capab_device_client_discoverability;
259 static int hf_p2p_attr_capab_device_concurrent_operation;
260 static int hf_p2p_attr_capab_device_infrastructure_managed;
261 static int hf_p2p_attr_capab_device_limit;
262 static int hf_p2p_attr_capab_invitation_procedure;
263 static int hf_p2p_attr_capab_group;
264 static int hf_p2p_attr_capab_group_owner;
265 static int hf_p2p_attr_capab_group_persistent;
266 static int hf_p2p_attr_capab_group_limit;
267 static int hf_p2p_attr_capab_group_intra_bss_distribution;
268 static int hf_p2p_attr_capab_group_cross_connection;
269 static int hf_p2p_attr_capab_group_persistent_reconnect;
270 static int hf_p2p_attr_capab_group_group_formation;
271 static int hf_p2p_attr_capab_group_ip_address_allocation;
273 static int hf_p2p_attr_device_id;
275 static int hf_p2p_attr_status;
277 static int hf_p2p_attr_go_intent;
278 static int hf_p2p_attr_go_intent_tie_breaker;
280 /* static int hf_p2p_attr_listen_channel; */
281 static int hf_p2p_attr_listen_channel_country;
282 static int hf_p2p_attr_listen_channel_oper_class;
283 static int hf_p2p_attr_listen_channel_number;
285 /* static int hf_p2p_attr_operating_channel; */
286 static int hf_p2p_attr_operating_channel_country;
287 static int hf_p2p_attr_operating_channel_oper_class;
288 static int hf_p2p_attr_operating_channel_number;
290 /* static int hf_p2p_attr_channel_list; */
291 static int hf_p2p_attr_channel_list_country;
292 static int hf_p2p_attr_channel_list_oper_class;
293 static int hf_p2p_attr_channel_list_num_chan;
294 static int hf_p2p_attr_channel_list_chan;
296 /* static int hf_p2p_attr_dev_info; */
297 static int hf_p2p_attr_dev_info_p2p_dev_addr;
298 static int hf_p2p_attr_dev_info_pri_dev_type;
299 static int hf_p2p_attr_dev_info_pri_dev_type_category;
300 static int hf_p2p_attr_dev_info_pri_dev_type_oui;
301 static int hf_p2p_attr_dev_info_pri_dev_type_subcategory;
302 static int hf_p2p_attr_dev_info_num_sec;
303 static int hf_p2p_attr_dev_info_sec_dev_type;
304 static int hf_p2p_attr_dev_info_dev_name_type;
305 static int hf_p2p_attr_dev_info_dev_name_len;
306 static int hf_p2p_attr_dev_info_dev_name;
307 static int hf_p2p_attr_dev_info_config_methods;
308 static int hf_p2p_attr_dev_info_config_methods_usba;
309 static int hf_p2p_attr_dev_info_config_methods_ethernet;
310 static int hf_p2p_attr_dev_info_config_methods_label;
311 static int hf_p2p_attr_dev_info_config_methods_display;
312 static int hf_p2p_attr_dev_info_config_methods_ext_nfc_token;
313 static int hf_p2p_attr_dev_info_config_methods_int_nfc_token;
314 static int hf_p2p_attr_dev_info_config_methods_nfc_interface;
315 static int hf_p2p_attr_dev_info_config_methods_pushbutton;
316 static int hf_p2p_attr_dev_info_config_methods_keypad;
317 static int hf_p2p_attr_config_timeout_go;
318 static int hf_p2p_attr_config_timeout_client;
319 static int hf_p2p_attr_intended_interface_addr;
320 static int hf_p2p_attr_extended_listen_timing_period;
321 static int hf_p2p_attr_extended_listen_timing_interval;
322 static int hf_p2p_attr_p2p_group_id_dev_addr;
323 static int hf_p2p_attr_p2p_group_id_ssid;
324 static int hf_p2p_attr_p2p_group_bssid;
326 static int hf_p2p_attr_noa_index;
327 static int hf_p2p_attr_noa_params;
328 static int hf_p2p_attr_noa_params_opp_ps;
329 static int hf_p2p_attr_noa_params_ctwindow;
330 static int hf_p2p_attr_noa_count_type;
331 static int hf_p2p_attr_noa_duration;
332 static int hf_p2p_attr_noa_interval;
333 static int hf_p2p_attr_noa_start_time;
335 /* static int hf_p2p_attr_gi; */
336 static int hf_p2p_attr_gi_length;
337 static int hf_p2p_attr_gi_p2p_dev_addr;
338 static int hf_p2p_attr_gi_p2p_iface_addr;
339 static int hf_p2p_attr_gi_dev_capab;
340 static int hf_p2p_attr_gi_dev_capab_service_discovery;
341 static int hf_p2p_attr_gi_dev_capab_client_discoverability;
342 static int hf_p2p_attr_gi_dev_capab_concurrent_operation;
343 static int hf_p2p_attr_gi_dev_capab_infrastructure_managed;
344 static int hf_p2p_attr_gi_dev_capab_limit;
345 /* static int hf_p2p_attr_gi_dev_capab_invitation_procedure; */
346 static int hf_p2p_attr_gi_config_methods;
347 /* static int hf_p2p_attr_gi_config_methods_usba; */
348 /* static int hf_p2p_attr_gi_config_methods_ethernet; */
349 /* static int hf_p2p_attr_gi_config_methods_label; */
350 /* static int hf_p2p_attr_gi_config_methods_display; */
351 /* static int hf_p2p_attr_gi_config_methods_ext_nfc_token; */
352 /* static int hf_p2p_attr_gi_config_methods_int_nfc_token; */
353 /* static int hf_p2p_attr_gi_config_methods_nfc_interface; */
354 /* static int hf_p2p_attr_gi_config_methods_pushbutton; */
355 /* static int hf_p2p_attr_gi_config_methods_keypad; */
356 static int hf_p2p_attr_gi_pri_dev_type;
357 static int hf_p2p_attr_gi_pri_dev_type_category;
358 static int hf_p2p_attr_gi_pri_dev_type_oui;
359 static int hf_p2p_attr_gi_pri_dev_type_subcategory;
360 static int hf_p2p_attr_gi_num_sec_dev_types;
361 static int hf_p2p_attr_gi_sec_dev_type;
362 static int hf_p2p_attr_gi_dev_name_type;
363 static int hf_p2p_attr_gi_dev_name_len;
364 static int hf_p2p_attr_gi_dev_name;
366 static int hf_p2p_attr_invitation_flags;
367 static int hf_p2p_attr_invitation_flags_type;
369 static int hf_p2p_attr_manageability_bitmap;
370 static int hf_p2p_attr_manageability_bitmap_mgmt;
371 static int hf_p2p_attr_manageability_bitmap_cross_connect;
372 static int hf_p2p_attr_manageability_bitmap_coex_opt;
374 static int hf_p2p_attr_minor_reason_code;
376 static int hf_p2p_attr_oob_group_owner_negotiation_channel_country;
377 static int hf_p2p_attr_oob_group_owner_negotiation_channel_oper_class;
378 static int hf_p2p_attr_oob_group_owner_negotiation_channel_number;
379 static int hf_p2p_attr_oob_group_owner_negotiation_channel_role_indication;
381 static int hf_p2p_attr_service_hash;
383 static int hf_p2p_attr_session_information;
385 static int hf_p2p_attr_connection_capability;
387 static int hf_p2p_attr_advertisement_id;
388 static int hf_p2p_attr_advertisement_id_service_mac_address;
390 static int hf_p2p_attr_advertised_service_advertisement_id;
391 static int hf_p2p_attr_advertised_service_config_methods;
392 static int hf_p2p_attr_advertised_service_service_name_length;
393 static int hf_p2p_attr_advertised_service_service_name;
395 static int hf_p2p_attr_session_id;
396 static int hf_p2p_attr_session_id_session_mac_address;
398 static int hf_p2p_attr_feature_capability;
400 static int hf_p2p_attr_persistent_group_p2p_device_address;
401 static int hf_p2p_attr_persistent_group_ssid;
404 static int hf_p2p_anqp_service_update_indicator;
405 static int hf_p2p_anqp_length;
406 static int hf_p2p_anqp_service_protocol_type;
407 static int hf_p2p_anqp_service_transaction_id;
408 static int hf_p2p_anqp_query_data;
409 static int hf_p2p_anqp_status_code;
410 static int hf_p2p_anqp_response_data;
412 static int hf_p2p_action_subtype;
413 static int hf_p2p_action_dialog_token;
414 static int hf_p2p_public_action_subtype;
415 static int hf_p2p_public_action_dialog_token;
417 static expert_field ei_wifi_p2p_attr_dev_info_dev_name_type;
418 static expert_field ei_wifi_p2p_attr_len;
419 static expert_field ei_wifi_p2p_anqp_length;
420 static expert_field ei_wifi_p2p_anqp_unexpected_padding;
422 static dissector_handle_t wifi_p2p_act_handle;
423 static dissector_handle_t wifi_p2p_anqp_handle;
424 static dissector_handle_t wifi_p2p_ie_handle;
425 static dissector_handle_t wifi_p2p_pubact_handle;
426 static dissector_handle_t wifi_display_ie_handle;
428 static void dissect_wifi_p2p_capability(proto_item *tlv_root,
429 proto_item *tlv_item,
430 tvbuff_t *tvb, int offset)
432 proto_tree_add_item(tlv_root, hf_p2p_attr_capab_device, tvb,
433 offset + 3, 1, ENC_BIG_ENDIAN);
434 proto_tree_add_item(tlv_root,
435 hf_p2p_attr_capab_device_service_discovery, tvb,
436 offset + 3, 1, ENC_BIG_ENDIAN);
437 proto_tree_add_item(tlv_root,
438 hf_p2p_attr_capab_device_client_discoverability,
439 tvb, offset + 3, 1, ENC_BIG_ENDIAN);
440 proto_tree_add_item(tlv_root,
441 hf_p2p_attr_capab_device_concurrent_operation,
442 tvb, offset + 3, 1, ENC_BIG_ENDIAN);
443 proto_tree_add_item(tlv_root,
444 hf_p2p_attr_capab_device_infrastructure_managed,
445 tvb, offset + 3, 1, ENC_BIG_ENDIAN);
446 proto_tree_add_item(tlv_root, hf_p2p_attr_capab_device_limit, tvb,
447 offset + 3, 1, ENC_BIG_ENDIAN);
448 proto_tree_add_item(tlv_root, hf_p2p_attr_capab_invitation_procedure, tvb,
449 offset + 3, 1, ENC_BIG_ENDIAN);
451 proto_tree_add_item(tlv_root, hf_p2p_attr_capab_group,
452 tvb, offset + 4, 1, ENC_BIG_ENDIAN);
453 proto_tree_add_item(tlv_root, hf_p2p_attr_capab_group_owner,
454 tvb, offset + 4, 1, ENC_BIG_ENDIAN);
455 proto_tree_add_item(tlv_root, hf_p2p_attr_capab_group_persistent,
456 tvb, offset + 4, 1, ENC_BIG_ENDIAN);
457 proto_tree_add_item(tlv_root, hf_p2p_attr_capab_group_limit,
458 tvb, offset + 4, 1, ENC_BIG_ENDIAN);
459 proto_tree_add_item(tlv_root,
460 hf_p2p_attr_capab_group_intra_bss_distribution,
461 tvb, offset + 4, 1, ENC_BIG_ENDIAN);
462 proto_tree_add_item(tlv_root, hf_p2p_attr_capab_group_cross_connection,
463 tvb, offset + 4, 1, ENC_BIG_ENDIAN);
464 proto_tree_add_item(tlv_root,
465 hf_p2p_attr_capab_group_persistent_reconnect,
466 tvb, offset + 4, 1, ENC_BIG_ENDIAN);
467 proto_tree_add_item(tlv_root, hf_p2p_attr_capab_group_group_formation,
468 tvb, offset + 4, 1, ENC_BIG_ENDIAN);
469 proto_tree_add_item(tlv_root, hf_p2p_attr_capab_group_ip_address_allocation,
470 tvb, offset + 4, 1, ENC_BIG_ENDIAN);
472 proto_item_append_text(tlv_item, ": Device 0x%x Group 0x%x",
473 tvb_get_uint8(tvb, offset + 3),
474 tvb_get_uint8(tvb, offset + 4));
477 static void dissect_device_id(proto_item *tlv_root, proto_item *tlv_item,
478 tvbuff_t *tvb, int offset)
480 proto_tree_add_item(tlv_root, hf_p2p_attr_device_id, tvb,
481 offset + 3, 6, ENC_NA);
482 proto_item_append_text(tlv_item, ": %s", tvb_ether_to_str(wmem_packet_scope(), tvb, offset+3));
485 static void dissect_group_owner_intent(proto_item *tlv_root,
486 proto_item *tlv_item,
487 tvbuff_t *tvb, int offset)
489 proto_tree_add_item(tlv_root, hf_p2p_attr_go_intent, tvb,
490 offset + 3, 1, ENC_BIG_ENDIAN);
491 proto_tree_add_item(tlv_root, hf_p2p_attr_go_intent_tie_breaker, tvb,
492 offset + 3, 1, ENC_BIG_ENDIAN);
493 proto_item_append_text(tlv_item, ": Intent %u Tie breaker %u",
494 tvb_get_uint8(tvb, offset + 3) >> 1,
495 tvb_get_uint8(tvb, offset + 3) & 0x01);
498 static void dissect_status(proto_item *tlv_root, proto_item *tlv_item,
499 tvbuff_t *tvb, int offset)
501 proto_tree_add_item(tlv_root, hf_p2p_attr_status, tvb,
502 offset + 3, 1, ENC_BIG_ENDIAN);
503 proto_item_append_text(tlv_item, ": %u (%s)",
504 tvb_get_uint8(tvb, offset + 3),
505 val_to_str(tvb_get_uint8(tvb, offset + 3),
506 p2p_status_codes,
507 "Unknown Status Code (%u)"));
510 static void dissect_listen_channel(proto_item *tlv_root, proto_item *tlv_item,
511 tvbuff_t *tvb, int offset)
513 proto_tree_add_item(tlv_root, hf_p2p_attr_listen_channel_country, tvb,
514 offset + 3, 3, ENC_ASCII);
515 proto_tree_add_item(tlv_root, hf_p2p_attr_listen_channel_oper_class, tvb,
516 offset + 6, 1, ENC_BIG_ENDIAN);
517 proto_tree_add_item(tlv_root, hf_p2p_attr_listen_channel_number, tvb,
518 offset + 7, 1, ENC_BIG_ENDIAN);
519 proto_item_append_text(tlv_item, ": Operating Class %u "
520 "Channel Number %u",
521 tvb_get_uint8(tvb, offset + 6),
522 tvb_get_uint8(tvb, offset + 7));
525 static void dissect_operating_channel(proto_item *tlv_root,
526 proto_item *tlv_item,
527 tvbuff_t *tvb, int offset)
529 proto_tree_add_item(tlv_root, hf_p2p_attr_operating_channel_country, tvb,
530 offset + 3, 3, ENC_ASCII);
531 proto_tree_add_item(tlv_root, hf_p2p_attr_operating_channel_oper_class, tvb,
532 offset + 6, 1, ENC_BIG_ENDIAN);
533 proto_tree_add_item(tlv_root, hf_p2p_attr_operating_channel_number, tvb,
534 offset + 7, 1, ENC_BIG_ENDIAN);
535 proto_item_append_text(tlv_item, ": Operating Class %u "
536 "Channel Number %u",
537 tvb_get_uint8(tvb, offset + 6),
538 tvb_get_uint8(tvb, offset + 7));
541 static void dissect_channel_list(proto_item *tlv_root, tvbuff_t *tvb,
542 int offset, uint16_t slen)
544 int s_offset = offset + 3;
545 uint8_t num_chan;
547 proto_tree_add_item(tlv_root, hf_p2p_attr_channel_list_country, tvb,
548 s_offset, 3, ENC_ASCII);
549 s_offset += 3;
551 while (offset + 3 + slen > s_offset) {
552 proto_tree_add_item(tlv_root, hf_p2p_attr_channel_list_oper_class, tvb,
553 s_offset, 1, ENC_BIG_ENDIAN);
554 s_offset++;
556 proto_tree_add_item(tlv_root, hf_p2p_attr_channel_list_num_chan, tvb,
557 s_offset, 1, ENC_BIG_ENDIAN);
558 num_chan = tvb_get_uint8(tvb, s_offset);
559 s_offset++;
561 proto_tree_add_item(tlv_root, hf_p2p_attr_channel_list_chan, tvb,
562 s_offset, num_chan, ENC_NA);
563 s_offset += num_chan;
567 static void dissect_wifi_p2p_device_info(packet_info *pinfo,
568 proto_item *tlv_root, tvbuff_t *tvb,
569 int offset, uint16_t slen)
571 int s_offset, nlen;
572 uint8_t num_sec;
573 uint16_t attr_type, attr_len;
574 proto_item *item;
576 s_offset = offset + 3;
578 proto_tree_add_item(tlv_root, hf_p2p_attr_dev_info_p2p_dev_addr, tvb,
579 s_offset, 6, ENC_NA);
580 s_offset += 6;
582 proto_tree_add_item(tlv_root, hf_p2p_attr_dev_info_config_methods,
583 tvb, s_offset, 2, ENC_BIG_ENDIAN);
584 proto_tree_add_item(tlv_root,
585 hf_p2p_attr_dev_info_config_methods_usba,
586 tvb, s_offset, 2, ENC_BIG_ENDIAN);
587 proto_tree_add_item(tlv_root,
588 hf_p2p_attr_dev_info_config_methods_ethernet,
589 tvb, s_offset, 2, ENC_BIG_ENDIAN);
590 proto_tree_add_item(tlv_root,
591 hf_p2p_attr_dev_info_config_methods_label,
592 tvb, s_offset, 2, ENC_BIG_ENDIAN);
593 proto_tree_add_item(tlv_root,
594 hf_p2p_attr_dev_info_config_methods_display,
595 tvb, s_offset, 2, ENC_BIG_ENDIAN);
596 proto_tree_add_item(tlv_root,
597 hf_p2p_attr_dev_info_config_methods_ext_nfc_token,
598 tvb, s_offset, 2, ENC_BIG_ENDIAN);
599 proto_tree_add_item(tlv_root,
600 hf_p2p_attr_dev_info_config_methods_int_nfc_token,
601 tvb, s_offset, 2, ENC_BIG_ENDIAN);
602 proto_tree_add_item(tlv_root,
603 hf_p2p_attr_dev_info_config_methods_nfc_interface,
604 tvb, s_offset, 2, ENC_BIG_ENDIAN);
605 proto_tree_add_item(tlv_root,
606 hf_p2p_attr_dev_info_config_methods_pushbutton,
607 tvb, s_offset, 2, ENC_BIG_ENDIAN);
608 proto_tree_add_item(tlv_root,
609 hf_p2p_attr_dev_info_config_methods_keypad,
610 tvb, s_offset, 2, ENC_BIG_ENDIAN);
612 s_offset += 2;
614 proto_tree_add_item(tlv_root, hf_p2p_attr_dev_info_pri_dev_type, tvb,
615 s_offset, 8, ENC_NA);
616 proto_tree_add_item(tlv_root, hf_p2p_attr_dev_info_pri_dev_type_category,
617 tvb, s_offset, 2, ENC_BIG_ENDIAN);
618 proto_tree_add_item(tlv_root, hf_p2p_attr_dev_info_pri_dev_type_oui,
619 tvb, s_offset + 2, 4, ENC_NA);
620 proto_tree_add_item(tlv_root, hf_p2p_attr_dev_info_pri_dev_type_subcategory,
621 tvb, s_offset + 6, 2, ENC_BIG_ENDIAN);
622 s_offset += 8;
624 num_sec = tvb_get_uint8(tvb, s_offset);
625 proto_tree_add_item(tlv_root, hf_p2p_attr_dev_info_num_sec, tvb,
626 s_offset, 1, ENC_BIG_ENDIAN);
627 s_offset++;
629 while (num_sec > 0) {
630 proto_tree_add_item(tlv_root, hf_p2p_attr_dev_info_sec_dev_type,
631 tvb, s_offset, 8, ENC_NA);
632 s_offset += 8;
633 num_sec--;
636 item = proto_tree_add_item(tlv_root, hf_p2p_attr_dev_info_dev_name_type,
637 tvb, s_offset, 2, ENC_BIG_ENDIAN);
638 attr_type = tvb_get_ntohs(tvb, s_offset);
639 if (attr_type != 0x1011) {
640 expert_add_info_format(pinfo, item, &ei_wifi_p2p_attr_dev_info_dev_name_type, "Incorrect Device Name attribute type");
642 s_offset += 2;
643 item = proto_tree_add_item(tlv_root, hf_p2p_attr_dev_info_dev_name_len,
644 tvb, s_offset, 2, ENC_BIG_ENDIAN);
645 attr_len = tvb_get_ntohs(tvb, s_offset);
646 s_offset += 2;
647 if (attr_len > offset + 3 + slen - s_offset) {
648 expert_add_info_format(pinfo, item, &ei_wifi_p2p_attr_len, "Invalid Device Name attribute length");
649 return;
651 nlen = offset + 3 + slen - s_offset;
652 if (nlen > 0)
653 item = proto_tree_add_item(tlv_root, hf_p2p_attr_dev_info_dev_name,
654 tvb, s_offset,
655 nlen > attr_len ? attr_len : nlen,
656 ENC_ASCII);
657 if (nlen != attr_len) {
658 expert_add_info_format(pinfo, item, &ei_wifi_p2p_attr_len, "Invalid Device Name attribute");
662 static void dissect_configuration_timeout(proto_item *tlv_root,
663 proto_item *tlv_item,
664 tvbuff_t *tvb, int offset)
666 proto_tree_add_item(tlv_root, hf_p2p_attr_config_timeout_go, tvb,
667 offset + 3, 1, ENC_BIG_ENDIAN);
668 proto_tree_add_item(tlv_root, hf_p2p_attr_config_timeout_client, tvb,
669 offset + 4, 1, ENC_BIG_ENDIAN);
670 proto_item_append_text(tlv_item, ": GO %u msec, client %u msec",
671 tvb_get_uint8(tvb, offset + 3) * 10,
672 tvb_get_uint8(tvb, offset + 4) * 10);
675 static void dissect_intended_interface_addr(proto_item *tlv_root,
676 proto_item *tlv_item,
677 tvbuff_t *tvb, int offset)
679 proto_tree_add_item(tlv_root, hf_p2p_attr_intended_interface_addr, tvb,
680 offset + 3, 6, ENC_NA);
681 proto_item_append_text(tlv_item, ": %s", tvb_ether_to_str(wmem_packet_scope(), tvb, offset + 3));
684 static void dissect_extended_listen_timing(proto_item *tlv_root,
685 proto_item *tlv_item,
686 tvbuff_t *tvb, int offset)
688 uint16_t period, interval;
689 period = tvb_get_letohs(tvb, offset + 3);
690 interval = tvb_get_letohs(tvb, offset + 5);
691 proto_tree_add_uint(tlv_root, hf_p2p_attr_extended_listen_timing_period, tvb,
692 offset + 3, 2, period);
693 proto_tree_add_uint(tlv_root, hf_p2p_attr_extended_listen_timing_interval,
694 tvb, offset + 5, 2, interval);
695 proto_item_append_text(tlv_item, ": Availability Period %u msec, "
696 "Availability Interval %u msec", period, interval);
699 static void dissect_wifi_p2p_group_id(proto_item *tlv_root,
700 proto_item *tlv_item, tvbuff_t *tvb,
701 int offset, uint16_t slen)
703 int s_offset;
705 s_offset = offset + 3;
706 proto_tree_add_item(tlv_root, hf_p2p_attr_p2p_group_id_dev_addr, tvb,
707 s_offset, 6, ENC_NA);
708 proto_item_append_text(tlv_item, ": %s", tvb_ether_to_str(wmem_packet_scope(), tvb, offset + 3));
709 s_offset += 6;
710 proto_tree_add_item(tlv_root, hf_p2p_attr_p2p_group_id_ssid, tvb,
711 s_offset, offset + 3 + slen - s_offset, ENC_ASCII);
714 static void dissect_wifi_p2p_group_bssid(packet_info *pinfo,
715 proto_item *tlv_root,
716 proto_item *tlv_item, tvbuff_t *tvb,
717 int offset, uint16_t slen)
719 int s_offset;
721 if (slen != 6) {
722 expert_add_info_format(pinfo, tlv_item, &ei_wifi_p2p_attr_len, "Invalid ethernet address");
723 return;
726 s_offset = offset + 3;
727 proto_tree_add_item(tlv_root, hf_p2p_attr_p2p_group_bssid, tvb,
728 s_offset, 6, ENC_NA);
729 proto_item_append_text(tlv_item, ": %s", tvb_ether_to_str(pinfo->pool, tvb, offset + 3));
732 static void dissect_notice_of_absence(packet_info *pinfo, proto_item *tlv_root,
733 proto_item *tlv_item,
734 tvbuff_t *tvb, int offset, uint16_t slen)
736 int s_offset = offset + 3;
738 if (slen < 2) {
739 expert_add_info_format(pinfo, tlv_item, &ei_wifi_p2p_attr_len, "Too short NoA");
740 return;
743 proto_tree_add_item(tlv_root, hf_p2p_attr_noa_index, tvb, s_offset, 1,
744 ENC_BIG_ENDIAN);
745 proto_tree_add_item(tlv_root, hf_p2p_attr_noa_params, tvb, s_offset + 1, 1,
746 ENC_BIG_ENDIAN);
747 proto_tree_add_item(tlv_root, hf_p2p_attr_noa_params_opp_ps, tvb,
748 s_offset + 1, 1, ENC_BIG_ENDIAN);
749 proto_tree_add_item(tlv_root, hf_p2p_attr_noa_params_ctwindow, tvb,
750 s_offset + 1, 1, ENC_BIG_ENDIAN);
752 s_offset += 2;
753 while (offset + 3 + slen >= s_offset + 13) {
754 proto_tree_add_item(tlv_root, hf_p2p_attr_noa_count_type, tvb, s_offset, 1,
755 ENC_BIG_ENDIAN);
756 s_offset++;
757 proto_tree_add_item(tlv_root, hf_p2p_attr_noa_duration, tvb, s_offset, 4,
758 ENC_LITTLE_ENDIAN);
759 s_offset += 4;
760 proto_tree_add_item(tlv_root, hf_p2p_attr_noa_interval, tvb, s_offset, 4,
761 ENC_LITTLE_ENDIAN);
762 s_offset += 4;
763 proto_tree_add_item(tlv_root, hf_p2p_attr_noa_start_time, tvb, s_offset, 4,
764 ENC_LITTLE_ENDIAN);
765 s_offset += 4;
769 static void dissect_wifi_p2p_group_info(packet_info *pinfo,
770 proto_item *tlv_root,
771 proto_item *tlv_item,
772 tvbuff_t *tvb, int offset,
773 uint16_t slen)
775 int s_offset = offset + 3;
776 int next_offset, ci_len, num_sec, left, nlen;
777 uint16_t attr_type, attr_len;
778 proto_item *item;
779 proto_tree *tree;
781 while (offset + 3 + slen > s_offset) {
782 if (offset + 3 + slen - s_offset < 25) {
783 expert_add_info_format(pinfo, tlv_item, &ei_wifi_p2p_attr_len, "Too short P2P Client Info Descriptor");
784 break;
787 ci_len = tvb_get_uint8(tvb, s_offset);
788 tree = proto_tree_add_subtree(tlv_root, tvb, s_offset, 1 + ci_len,
789 ett_p2p_client_descr, NULL, "P2P Client Info Descriptor");
791 item = proto_tree_add_item(tree, hf_p2p_attr_gi_length, tvb, s_offset,
792 1, ENC_BIG_ENDIAN);
793 if (ci_len < 24 || s_offset + ci_len > offset + 3 + slen) {
794 expert_add_info_format(pinfo, item, &ei_wifi_p2p_attr_len, "Invalid P2P Client Info Descriptor Length");
795 break;
797 s_offset++;
798 next_offset = s_offset + ci_len;
800 proto_tree_add_item(tree, hf_p2p_attr_gi_p2p_dev_addr, tvb, s_offset,
801 6, ENC_NA);
802 proto_item_append_text(tree, ": %s", tvb_ether_to_str(pinfo->pool, tvb, s_offset));
803 s_offset += 6;
805 proto_tree_add_item(tree, hf_p2p_attr_gi_p2p_iface_addr, tvb, s_offset,
806 6, ENC_NA);
807 s_offset += 6;
809 proto_tree_add_item(tree, hf_p2p_attr_gi_dev_capab, tvb, s_offset, 1,
810 ENC_BIG_ENDIAN);
811 proto_tree_add_item(tree,
812 hf_p2p_attr_gi_dev_capab_service_discovery, tvb,
813 s_offset, 1, ENC_BIG_ENDIAN);
814 proto_tree_add_item(tree,
815 hf_p2p_attr_gi_dev_capab_client_discoverability,
816 tvb, s_offset, 1, ENC_BIG_ENDIAN);
817 proto_tree_add_item(tree,
818 hf_p2p_attr_gi_dev_capab_concurrent_operation,
819 tvb, s_offset, 1, ENC_BIG_ENDIAN);
820 proto_tree_add_item(tree,
821 hf_p2p_attr_gi_dev_capab_infrastructure_managed,
822 tvb, s_offset, 1, ENC_BIG_ENDIAN);
823 proto_tree_add_item(tree, hf_p2p_attr_gi_dev_capab_limit, tvb,
824 s_offset, 1, ENC_BIG_ENDIAN);
825 proto_tree_add_item(tree, hf_p2p_attr_capab_invitation_procedure, tvb,
826 s_offset, 1, ENC_BIG_ENDIAN);
827 s_offset++;
829 proto_tree_add_item(tree, hf_p2p_attr_gi_config_methods, tvb, s_offset,
830 2, ENC_BIG_ENDIAN);
831 s_offset += 2;
833 proto_tree_add_item(tree, hf_p2p_attr_gi_pri_dev_type, tvb,
834 s_offset, 8, ENC_NA);
835 proto_tree_add_item(tree, hf_p2p_attr_gi_pri_dev_type_category,
836 tvb, s_offset, 2, ENC_BIG_ENDIAN);
837 proto_tree_add_item(tree, hf_p2p_attr_gi_pri_dev_type_oui,
838 tvb, s_offset + 2, 4, ENC_NA);
839 proto_tree_add_item(tree, hf_p2p_attr_gi_pri_dev_type_subcategory,
840 tvb, s_offset + 6, 2, ENC_BIG_ENDIAN);
841 s_offset += 8;
843 item = proto_tree_add_item(tree, hf_p2p_attr_gi_num_sec_dev_types, tvb,
844 s_offset, 1, ENC_BIG_ENDIAN);
845 num_sec = tvb_get_uint8(tvb, s_offset);
846 s_offset++;
847 left = offset + 3 + slen - s_offset;
848 if (left < 8 * num_sec) {
849 expert_add_info_format(pinfo, item, &ei_wifi_p2p_attr_len, "Invalid Secondary Device Type List");
850 break;
852 while (num_sec > 0) {
853 proto_tree_add_item(tree, hf_p2p_attr_gi_sec_dev_type,
854 tvb, s_offset, 8, ENC_NA);
855 s_offset += 8;
856 num_sec--;
859 item = proto_tree_add_item(tree, hf_p2p_attr_gi_dev_name_type,
860 tvb, s_offset, 2, ENC_BIG_ENDIAN);
861 attr_type = tvb_get_ntohs(tvb, s_offset);
862 if (attr_type != 0x1011) {
863 expert_add_info_format(pinfo, item, &ei_wifi_p2p_attr_dev_info_dev_name_type, "Incorrect Device Name attribute type");
865 s_offset += 2;
866 item = proto_tree_add_item(tree, hf_p2p_attr_gi_dev_name_len,
867 tvb, s_offset, 2, ENC_BIG_ENDIAN);
868 attr_len = tvb_get_ntohs(tvb, s_offset);
869 s_offset += 2;
870 if (attr_len > offset + 3 + slen - s_offset) {
871 expert_add_info_format(pinfo, item, &ei_wifi_p2p_attr_len, "Invalid Device Name attribute length");
872 break;
874 nlen = next_offset - s_offset;
875 if (nlen > 0)
876 item = proto_tree_add_item(tree, hf_p2p_attr_gi_dev_name,
877 tvb, s_offset,
878 nlen > attr_len ? attr_len : nlen,
879 ENC_ASCII);
880 if (nlen != attr_len) {
881 expert_add_info_format(pinfo, item, &ei_wifi_p2p_attr_len, "Invalid Device Name attribute");
884 s_offset = next_offset;
888 static void dissect_invitation_flags(proto_item *tlv_root,
889 proto_item *tlv_item,
890 tvbuff_t *tvb, int offset)
892 proto_tree_add_item(tlv_root, hf_p2p_attr_invitation_flags, tvb,
893 offset + 3, 1, ENC_BIG_ENDIAN);
894 proto_tree_add_item(tlv_root, hf_p2p_attr_invitation_flags_type, tvb,
895 offset + 3, 1, ENC_BIG_ENDIAN);
896 proto_item_append_text(tlv_item, ": Invitation Flags 0x%x",
897 tvb_get_uint8(tvb, offset + 3));
900 static void dissect_manageability(proto_item *tlv_root,
901 proto_item *tlv_item,
902 tvbuff_t *tvb, int offset)
904 proto_tree_add_item(tlv_root, hf_p2p_attr_manageability_bitmap, tvb,
905 offset + 3, 1, ENC_BIG_ENDIAN);
906 proto_tree_add_item(tlv_root, hf_p2p_attr_manageability_bitmap_mgmt, tvb,
907 offset + 3, 1, ENC_BIG_ENDIAN);
908 proto_tree_add_item(tlv_root, hf_p2p_attr_manageability_bitmap_cross_connect,
909 tvb, offset + 3, 1, ENC_BIG_ENDIAN);
910 proto_tree_add_item(tlv_root, hf_p2p_attr_manageability_bitmap_coex_opt, tvb,
911 offset + 3, 1, ENC_BIG_ENDIAN);
912 proto_item_append_text(tlv_item, ": Bitmap field 0x%x",
913 tvb_get_uint8(tvb, offset + 3));
916 static void dissect_minor_reason_code(proto_item *tlv_root,
917 proto_item *tlv_item,
918 tvbuff_t *tvb, int offset)
920 proto_tree_add_item(tlv_root, hf_p2p_attr_minor_reason_code, tvb,
921 offset + 3, 1, ENC_BIG_ENDIAN);
922 proto_item_append_text(tlv_item, ": %u (%s)",
923 tvb_get_uint8(tvb, offset + 3),
924 val_to_str(tvb_get_uint8(tvb, offset + 3),
925 p2p_minor_reason_codes,
926 "Unknown Minor Reason Code (%u)"));
929 static void dissect_oob_group_owner_negotiation_channel(proto_item *tlv_root,
930 proto_item *tlv_item,
931 tvbuff_t *tvb, int offset)
933 proto_tree_add_item(tlv_root, hf_p2p_attr_oob_group_owner_negotiation_channel_country, tvb,
934 offset + 3, 3, ENC_ASCII);
935 proto_tree_add_item(tlv_root, hf_p2p_attr_oob_group_owner_negotiation_channel_oper_class, tvb,
936 offset + 6, 1, ENC_BIG_ENDIAN);
937 proto_tree_add_item(tlv_root, hf_p2p_attr_oob_group_owner_negotiation_channel_number, tvb,
938 offset + 7, 1, ENC_BIG_ENDIAN);
939 proto_tree_add_item(tlv_root, hf_p2p_attr_oob_group_owner_negotiation_channel_role_indication, tvb,
940 offset + 7, 1, ENC_BIG_ENDIAN);
941 proto_item_append_text(tlv_item, ": Operating Class %u "
942 "Channel Number %u",
943 tvb_get_uint8(tvb, offset + 6),
944 tvb_get_uint8(tvb, offset + 7));
947 static void dissect_service_hash(proto_item *tlv_root,
948 proto_item *tlv_item _U_,
949 tvbuff_t *tvb, int offset, int slen)
952 int s_offset = offset + 3;
954 while(s_offset < offset + 3 + slen) {
955 proto_tree_add_item(tlv_root, hf_p2p_attr_service_hash, tvb,
956 s_offset, 6, ENC_NA);
957 s_offset += 6;
961 static void dissect_session_information(proto_item *tlv_root,
962 proto_item *tlv_item _U_,
963 tvbuff_t *tvb, int offset, int slen)
965 proto_tree_add_item(tlv_root, hf_p2p_attr_session_information, tvb,
966 offset+3, slen, ENC_ASCII);
970 static void dissect_connection_capability(proto_item *tlv_root,
971 proto_item *tlv_item _U_,
972 tvbuff_t *tvb, int offset)
974 proto_tree_add_item(tlv_root, hf_p2p_attr_connection_capability, tvb,
975 offset+3, 1, ENC_NA);
980 static void dissect_advertisement_id(proto_item *tlv_root,
981 proto_item *tlv_item _U_,
982 tvbuff_t *tvb, int offset)
984 proto_tree_add_item(tlv_root, hf_p2p_attr_advertisement_id, tvb,
985 offset+3, 4, ENC_NA);
987 proto_tree_add_item(tlv_root, hf_p2p_attr_advertisement_id_service_mac_address, tvb,
988 offset+7, 6, ENC_NA);
992 static void dissect_advertised_service(proto_item *tlv_root,
993 proto_item *tlv_item _U_,
994 tvbuff_t *tvb, int offset, int slen)
996 proto_item *subtree;
997 int s_offset = offset + 3;
998 int len_service_name;
1000 subtree = proto_tree_add_subtree(tlv_root, tvb, s_offset, slen,
1001 ett_p2p_advertised_service, NULL, "Advertised Service");
1004 while (s_offset < offset + 3 + slen) {
1005 proto_tree_add_item(subtree, hf_p2p_attr_advertised_service_advertisement_id, tvb,
1006 s_offset, 4, ENC_BIG_ENDIAN);
1007 s_offset += 4;
1008 proto_tree_add_item(subtree, hf_p2p_attr_advertised_service_config_methods, tvb,
1009 s_offset, 2, ENC_BIG_ENDIAN);
1010 s_offset += 2;
1011 proto_tree_add_item(subtree, hf_p2p_attr_advertised_service_service_name_length, tvb,
1012 s_offset, 2, ENC_BIG_ENDIAN);
1013 len_service_name = tvb_get_uint8(tvb, s_offset);
1014 s_offset += 1;
1016 proto_tree_add_item(subtree, hf_p2p_attr_advertised_service_service_name, tvb,
1017 s_offset, len_service_name, ENC_ASCII);
1018 s_offset += len_service_name;
1024 static void dissect_session_id(proto_item *tlv_root,
1025 proto_item *tlv_item _U_,
1026 tvbuff_t *tvb, int offset)
1028 proto_tree_add_item(tlv_root, hf_p2p_attr_session_id, tvb,
1029 offset+3, 4, ENC_NA);
1031 proto_tree_add_item(tlv_root, hf_p2p_attr_session_id_session_mac_address, tvb,
1032 offset+7, 6, ENC_NA);
1036 static void dissect_feature_capability(proto_item *tlv_root,
1037 proto_item *tlv_item _U_,
1038 tvbuff_t *tvb, int offset, int slen)
1040 proto_tree_add_item(tlv_root, hf_p2p_attr_feature_capability, tvb,
1041 offset+3, slen, ENC_NA);
1046 static void dissect_persistent_group(proto_item *tlv_root,
1047 proto_item *tlv_item _U_,
1048 tvbuff_t *tvb, int offset, int slen)
1050 proto_tree_add_item(tlv_root, hf_p2p_attr_persistent_group_p2p_device_address, tvb,
1051 offset+3, 6, ENC_NA);
1053 proto_tree_add_item(tlv_root, hf_p2p_attr_persistent_group_ssid, tvb,
1054 offset+3+6, slen+6, ENC_ASCII);
1058 static int
1059 dissect_wifi_p2p_ie(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, void *data _U_)
1061 uint16_t slen = 0;
1062 uint8_t stype = 0;
1063 int offset = 0;
1064 int size = tvb_reported_length(tvb);
1065 proto_item *tlv_root, *tlv_item;
1067 while (size > 0) {
1068 if (size < 3) {
1069 expert_add_info_format(pinfo, NULL, &ei_wifi_p2p_attr_len, "Packet too short for P2P IE");
1070 break;
1073 stype = tvb_get_uint8(tvb, offset);
1074 slen = tvb_get_letohs(tvb, offset + 1);
1076 tlv_root = proto_tree_add_subtree(tree, tvb, offset, 3 + slen, ett_p2p_tlv, &tlv_item,
1077 val_to_str(stype, p2p_attr_types,
1078 "Unknown attribute type (%u)"));
1080 proto_tree_add_item(tlv_root, hf_p2p_attr_type, tvb, offset, 1, ENC_BIG_ENDIAN);
1081 proto_tree_add_uint(tlv_root, hf_p2p_attr_len, tvb, offset + 1, 2,
1082 slen);
1084 switch(stype) {
1085 case P2P_ATTR_P2P_CAPABILITY:
1086 dissect_wifi_p2p_capability(tlv_root, tlv_item, tvb, offset);
1087 break;
1088 case P2P_ATTR_P2P_DEVICE_ID:
1089 dissect_device_id(tlv_root, tlv_item, tvb, offset);
1090 break;
1091 case P2P_ATTR_GROUP_OWNER_INTENT:
1092 dissect_group_owner_intent(tlv_root, tlv_item, tvb, offset);
1093 break;
1094 case P2P_ATTR_STATUS:
1095 dissect_status(tlv_root, tlv_item, tvb, offset);
1096 break;
1097 case P2P_ATTR_LISTEN_CHANNEL:
1098 dissect_listen_channel(tlv_root, tlv_item, tvb, offset);
1099 break;
1100 case P2P_ATTR_OPERATING_CHANNEL:
1101 dissect_operating_channel(tlv_root, tlv_item, tvb, offset);
1102 break;
1103 case P2P_ATTR_CHANNEL_LIST:
1104 dissect_channel_list(tlv_root, tvb, offset, slen);
1105 break;
1106 case P2P_ATTR_P2P_DEVICE_INFO:
1107 dissect_wifi_p2p_device_info(pinfo, tlv_root, tvb, offset, slen);
1108 break;
1109 case P2P_ATTR_CONFIGURATION_TIMEOUT:
1110 dissect_configuration_timeout(tlv_root, tlv_item, tvb, offset);
1111 break;
1112 case P2P_ATTR_INTENDED_P2P_INTERFACE_ADDRESS:
1113 dissect_intended_interface_addr(tlv_root, tlv_item, tvb, offset);
1114 break;
1115 case P2P_ATTR_EXTENDED_LISTEN_TIMING:
1116 dissect_extended_listen_timing(tlv_root, tlv_item, tvb, offset);
1117 break;
1118 case P2P_ATTR_P2P_GROUP_ID:
1119 dissect_wifi_p2p_group_id(tlv_root, tlv_item, tvb, offset, slen);
1120 break;
1121 case P2P_ATTR_P2P_GROUP_BSSID:
1122 dissect_wifi_p2p_group_bssid(pinfo, tlv_root, tlv_item, tvb, offset, slen);
1123 break;
1124 case P2P_ATTR_NOTICE_OF_ABSENCE:
1125 dissect_notice_of_absence(pinfo, tlv_root, tlv_item, tvb, offset, slen);
1126 break;
1127 case P2P_ATTR_P2P_GROUP_INFO:
1128 dissect_wifi_p2p_group_info(pinfo, tlv_root, tlv_item, tvb, offset,
1129 slen);
1130 break;
1131 case P2P_ATTR_INVITATION_FLAGS:
1132 dissect_invitation_flags(tlv_root, tlv_item, tvb, offset);
1133 break;
1134 case P2P_ATTR_P2P_MANAGEABILITY:
1135 dissect_manageability(tlv_root, tlv_item, tvb, offset);
1136 break;
1137 case P2P_ATTR_MINOR_REASON_CODE:
1138 dissect_minor_reason_code(tlv_root, tlv_item, tvb, offset);
1139 break;
1140 case P2P_ATTR_OOB_GROUP_OWNER_NEGOTIATION_CHANNEL:
1141 dissect_oob_group_owner_negotiation_channel(tlv_root, tlv_item, tvb, offset);
1142 break;
1143 case P2P_ATTR_SERVICE_HASH:
1144 dissect_service_hash(tlv_root, tlv_item, tvb, offset, slen);
1145 break;
1146 case P2P_ATTR_SESSION_INFORMATION_DATA_INFO:
1147 dissect_session_information(tlv_root, tlv_item, tvb, offset, slen);
1148 break;
1149 case P2P_ATTR_CONNECTION_CAPABILITY_INFO:
1150 dissect_connection_capability(tlv_root, tlv_item, tvb, offset);
1151 break;
1152 case P2P_ATTR_ADVERTISEMENT_ID_INFO:
1153 dissect_advertisement_id(tlv_root, tlv_item, tvb, offset);
1154 break;
1155 case P2P_ATTR_ADVERTISED_SERVICE_INFO:
1156 dissect_advertised_service(tlv_root, tlv_item, tvb, offset, slen);
1157 break;
1158 case P2P_ATTR_SESSION_ID_INFO:
1159 dissect_session_id(tlv_root, tlv_item, tvb, offset);
1160 break;
1161 case P2P_ATTR_FEATURE_CAPABILITY:
1162 dissect_feature_capability(tlv_root, tlv_item, tvb, offset, slen);
1163 break;
1164 case P2P_ATTR_PERSISTENT_GROUP_INFO:
1165 dissect_persistent_group(tlv_root, tlv_item, tvb, offset, slen);
1166 break;
1169 offset += 3 + slen;
1170 size -= 3 + slen;
1173 return tvb_captured_length(tvb);
1176 static int
1177 dissect_wifi_p2p_public_action(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_)
1179 int offset = 0;
1180 uint8_t subtype;
1181 proto_tree_add_item(tree, hf_p2p_public_action_subtype, tvb, offset, 1,
1182 ENC_BIG_ENDIAN);
1183 subtype = tvb_get_uint8(tvb, offset);
1184 col_append_fstr(pinfo->cinfo, COL_INFO, ", P2P - %s",
1185 val_to_str(subtype, p2p_public_action_subtypes,
1186 "Unknown (%u)"));
1187 offset++;
1188 proto_tree_add_item(tree, hf_p2p_public_action_dialog_token, tvb, offset, 1,
1189 ENC_BIG_ENDIAN);
1190 offset++;
1191 /* Followed by variable length IEs dissected by packet-ieee80211.c */
1192 return offset;
1195 static int
1196 dissect_wifi_p2p_action(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, void *data _U_)
1198 int offset = 0;
1200 proto_tree_add_item(tree, hf_p2p_action_subtype, tvb, offset, 1, ENC_BIG_ENDIAN);
1201 offset++;
1202 proto_tree_add_item(tree, hf_p2p_action_dialog_token, tvb, offset, 1, ENC_BIG_ENDIAN);
1203 offset++;
1205 /* Followed by variable length IEs dissected by packet-ieee80211.c */
1206 return offset;
1209 static int
1210 dissect_wifi_p2p_anqp(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, void *data)
1212 int offset = 0;
1213 proto_item *item;
1214 anqp_info_dissector_data_t* anqp_data = (anqp_info_dissector_data_t*)data;
1215 tvbuff_t *next_tvb;
1217 DISSECTOR_ASSERT(anqp_data);
1219 item = proto_tree_add_item(tree, hf_p2p_anqp_service_update_indicator, tvb,
1220 offset, 2, ENC_LITTLE_ENDIAN);
1221 offset += 2;
1223 while (tvb_reported_length_remaining(tvb, offset) >= (anqp_data->request ? 4 : 5)) {
1224 uint16_t len;
1225 proto_tree *tlv;
1226 uint8_t type, id, sd_proto;
1228 len = tvb_get_letohs(tvb, offset);
1229 if (len < 2) {
1230 expert_add_info_format(pinfo, item, &ei_wifi_p2p_anqp_length, "Too short Service TLV field");
1231 return offset;
1233 if (len > tvb_reported_length_remaining(tvb, offset + 2)) {
1234 expert_add_info_format(pinfo, item, &ei_wifi_p2p_anqp_length, "Too short frame for Service TLV field");
1235 return offset;
1238 type = tvb_get_uint8(tvb, offset + 2);
1239 id = tvb_get_uint8(tvb, offset + 3);
1240 tlv = proto_tree_add_subtree_format(tree, tvb, offset, 2 + len,
1241 ett_p2p_service_tlv, &item, "Service TLV (Transaction ID: %u Type: %s)",
1242 id, val_to_str(type, p2p_service_protocol_types,
1243 "Unknown (%u)"));
1245 proto_tree_add_item(tlv, hf_p2p_anqp_length, tvb, offset, 2, ENC_LITTLE_ENDIAN);
1246 offset += 2;
1247 sd_proto = tvb_get_uint8(tvb, offset);
1248 proto_tree_add_item(tlv, hf_p2p_anqp_service_protocol_type, tvb,
1249 offset, 1, ENC_BIG_ENDIAN);
1250 proto_tree_add_item(tlv, hf_p2p_anqp_service_transaction_id, tvb,
1251 offset + 1, 1, ENC_BIG_ENDIAN);
1252 if (anqp_data->request) {
1253 proto_tree_add_item(tlv, hf_p2p_anqp_query_data, tvb,
1254 offset + 2, len - 2, ENC_NA);
1255 } else {
1256 proto_tree_add_item(tlv, hf_p2p_anqp_status_code, tvb,
1257 offset + 2, 1, ENC_BIG_ENDIAN);
1258 proto_tree_add_item(tlv, hf_p2p_anqp_response_data, tvb,
1259 offset + 3, len - 3, ENC_NA);
1260 if (sd_proto == 4) {
1261 next_tvb = tvb_new_subset_length(tvb, offset + 3, len - 3);
1262 call_dissector(wifi_display_ie_handle, next_tvb, pinfo, tlv);
1265 offset += len;
1268 if (tvb_reported_length_remaining(tvb, offset) > 0) {
1269 expert_add_info(pinfo, item, &ei_wifi_p2p_anqp_unexpected_padding);
1272 return tvb_captured_length(tvb);
1275 void
1276 proto_register_p2p(void)
1278 static hf_register_info hf[] = {
1279 { &hf_p2p_attr_type,
1280 { "Attribute Type", "wifi_p2p.type",
1281 FT_UINT8, BASE_DEC, VALS(p2p_attr_types), 0x0, NULL, HFILL }},
1282 { &hf_p2p_attr_len,
1283 { "Attribute Length", "wifi_p2p.length",
1284 FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL }},
1286 #if 0
1287 { &hf_p2p_attr_capab,
1288 { "P2P Capability", "wifi_p2p.p2p_capability",
1289 FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL }},
1290 #endif
1291 { &hf_p2p_attr_capab_device,
1292 { "Device Capability Bitmap",
1293 "wifi_p2p.p2p_capability.device_capability",
1294 FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL }},
1295 { &hf_p2p_attr_capab_device_service_discovery,
1296 { "Service Discovery",
1297 "wifi_p2p.p2p_capability.device_capability.service_discovery",
1298 FT_UINT8, BASE_HEX, NULL, P2P_DEV_CAPAB_SERVICE_DISCOVERY, NULL, HFILL
1300 { &hf_p2p_attr_capab_device_client_discoverability,
1301 { "P2P Client Discoverability",
1302 "wifi_p2p.p2p_capability.device_capability.client_discoverability",
1303 FT_UINT8, BASE_HEX, NULL, P2P_DEV_CAPAB_P2P_CLIENT_DISCOVERABILITY,
1304 NULL, HFILL
1306 { &hf_p2p_attr_capab_device_concurrent_operation,
1307 { "Concurrent Operation",
1308 "wifi_p2p.p2p_capability.device_capability.concurrent_operation",
1309 FT_UINT8, BASE_HEX, NULL, P2P_DEV_CAPAB_CONCURRENT_OPERATION, NULL,
1310 HFILL
1312 { &hf_p2p_attr_capab_device_infrastructure_managed,
1313 { "P2P Infrastructure Managed",
1314 "wifi_p2p.p2p_capability.device_capability.infrastructure_managed",
1315 FT_UINT8, BASE_HEX, NULL, P2P_DEV_CAPAB_P2P_INFRASTRUCTURE_MANAGED,
1316 NULL, HFILL
1318 { &hf_p2p_attr_capab_device_limit,
1319 { "P2P Device Limit",
1320 "wifi_p2p.p2p_capability.device_capability.device_limit",
1321 FT_UINT8, BASE_HEX, NULL, P2P_DEV_CAPAB_P2P_DEVICE_LIMIT, NULL, HFILL
1323 { &hf_p2p_attr_capab_invitation_procedure,
1324 { "P2P Invitation Procedure",
1325 "wifi_p2p.p2p_capability.device_capability.invitation_procedure",
1326 FT_UINT8, BASE_HEX, NULL, P2P_DEV_CAPAB_P2P_INVITATION_PROCEDURE, NULL,
1327 HFILL
1329 { &hf_p2p_attr_capab_group,
1330 { "Group Capability Bitmap", "wifi_p2p.p2p_capability.group_capability",
1331 FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL }},
1332 { &hf_p2p_attr_capab_group_owner,
1333 { "P2P Group Owner",
1334 "wifi_p2p.p2p_capability.group_capability.group_owner",
1335 FT_UINT8, BASE_HEX, NULL, P2P_GROUP_CAPAB_P2P_GROUP_OWNER, NULL, HFILL
1337 { &hf_p2p_attr_capab_group_persistent,
1338 { "Persistent P2P Group",
1339 "wifi_p2p.p2p_capability.group_capability.persistent_group",
1340 FT_UINT8, BASE_HEX, NULL, P2P_GROUP_CAPAB_PERSISTENT_P2P_GROUP, NULL,
1341 HFILL }},
1342 { &hf_p2p_attr_capab_group_limit,
1343 { "P2P Group Limit",
1344 "wifi_p2p.p2p_capability.group_capability.group_limit",
1345 FT_UINT8, BASE_HEX, NULL, P2P_GROUP_CAPAB_P2P_GROUP_LIMIT, NULL, HFILL
1347 { &hf_p2p_attr_capab_group_intra_bss_distribution,
1348 { "Intra-BSS Distribution",
1349 "wifi_p2p.p2p_capability.group_capability.intra_bss_distribution",
1350 FT_UINT8, BASE_HEX, NULL, P2P_GROUP_CAPAB_INTRA_BSS_DISTRIBUTION, NULL,
1351 HFILL }},
1352 { &hf_p2p_attr_capab_group_cross_connection,
1353 { "Cross Connection",
1354 "wifi_p2p.p2p_capability.group_capability.cross_connection",
1355 FT_UINT8, BASE_HEX, NULL, P2P_GROUP_CAPAB_CROSS_CONNECTION, NULL, HFILL
1357 { &hf_p2p_attr_capab_group_persistent_reconnect,
1358 { "Persistent Reconnect",
1359 "wifi_p2p.p2p_capability.group_capability.persistent_reconnect",
1360 FT_UINT8, BASE_HEX, NULL, P2P_GROUP_CAPAB_PERSISTENT_RECONNECT, NULL,
1361 HFILL }},
1362 { &hf_p2p_attr_capab_group_group_formation,
1363 { "Group Formation",
1364 "wifi_p2p.p2p_capability.group_capability.group_formation",
1365 FT_UINT8, BASE_HEX, NULL, P2P_GROUP_CAPAB_GROUP_FORMATION, NULL, HFILL
1367 { &hf_p2p_attr_capab_group_ip_address_allocation,
1368 { "IP Address Allocation",
1369 "wifi_p2p.p2p_capability.group_capability.ip_address_allocation",
1370 FT_UINT8, BASE_HEX, NULL, P2P_GROUP_CAPAB_GROUP_FORMATION, NULL, HFILL
1373 { &hf_p2p_attr_device_id,
1374 { "Device ID", "wifi_p2p.device_id",
1375 FT_ETHER, BASE_NONE, NULL, 0x0, NULL, HFILL }},
1377 { &hf_p2p_attr_status,
1378 { "Status Code", "wifi_p2p.status",
1379 FT_UINT8, BASE_DEC, VALS(p2p_status_codes), 0x0, NULL, HFILL }},
1381 { &hf_p2p_attr_go_intent,
1382 { "Group Owner Intent", "wifi_p2p.go_intent",
1383 FT_UINT8, BASE_DEC, NULL, 0x1e, NULL, HFILL }},
1384 { &hf_p2p_attr_go_intent_tie_breaker,
1385 { "Group Owner Intent Tie Breaker", "wifi_p2p.go_intent_tie_breaker",
1386 FT_UINT8, BASE_DEC, NULL, 0x01, NULL, HFILL }},
1388 #if 0
1389 { &hf_p2p_attr_listen_channel,
1390 { "Listen Channel", "wifi_p2p.listen_channel",
1391 FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL }},
1392 #endif
1393 { &hf_p2p_attr_listen_channel_country,
1394 { "Country String", "wifi_p2p.listen_channel.country_string",
1395 FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL }},
1396 { &hf_p2p_attr_listen_channel_oper_class,
1397 { "Operating Class", "wifi_p2p.listen_channel.operating_class",
1398 FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }},
1399 { &hf_p2p_attr_listen_channel_number,
1400 { "Channel Number", "wifi_p2p.listen_channel.channel_number",
1401 FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }},
1403 #if 0
1404 { &hf_p2p_attr_operating_channel,
1405 { "Operating Channel", "wifi_p2p.operating_channel",
1406 FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL }},
1407 #endif
1408 { &hf_p2p_attr_operating_channel_country,
1409 { "Country String", "wifi_p2p.operating_channel.country_string",
1410 FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL }},
1411 { &hf_p2p_attr_operating_channel_oper_class,
1412 { "Operating Class", "wifi_p2p.operating_channel.operating_class",
1413 FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }},
1414 { &hf_p2p_attr_operating_channel_number,
1415 { "Channel Number", "wifi_p2p.operating_channel.channel_number",
1416 FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }},
1418 #if 0
1419 { &hf_p2p_attr_channel_list,
1420 { "Channel List", "wifi_p2p.channel_list",
1421 FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL }},
1422 #endif
1423 { &hf_p2p_attr_channel_list_country,
1424 { "Country String", "wifi_p2p.channel_list.country_string",
1425 FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL }},
1426 { &hf_p2p_attr_channel_list_oper_class,
1427 { "Operating Class", "wifi_p2p.channel_list.operating_class",
1428 FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }},
1429 { &hf_p2p_attr_channel_list_num_chan,
1430 { "Number of Channels", "wifi_p2p.channel_list.num_chan",
1431 FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }},
1432 { &hf_p2p_attr_channel_list_chan,
1433 { "Channel List", "wifi_p2p.channel_list.channel_list",
1434 FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL }},
1435 #if 0
1436 { &hf_p2p_attr_dev_info,
1437 { "Device Info", "wifi_p2p.dev_info",
1438 FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL }},
1439 #endif
1440 { &hf_p2p_attr_dev_info_p2p_dev_addr,
1441 { "P2P Device address", "wifi_p2p.dev_info.p2p_dev_addr",
1442 FT_ETHER, BASE_NONE, NULL, 0x0, NULL, HFILL }},
1443 { &hf_p2p_attr_dev_info_pri_dev_type,
1444 { "Primary Device Type", "wifi_p2p.dev_info.pri_dev_type",
1445 FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL }},
1446 { &hf_p2p_attr_dev_info_pri_dev_type_category,
1447 { "Primary Device Type: Category",
1448 "wifi_p2p.dev_info.pri_dev_type.category",
1449 FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL }},
1450 { &hf_p2p_attr_dev_info_pri_dev_type_oui,
1451 { "Primary Device Type: OUI", "wifi_p2p.dev_info.pri_dev_type.oui",
1452 FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL }},
1453 { &hf_p2p_attr_dev_info_pri_dev_type_subcategory,
1454 { "Primary Device Type: Subcategory",
1455 "wifi_p2p.dev_info.pri_dev_type.subcategory",
1456 FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL }},
1457 { &hf_p2p_attr_dev_info_num_sec,
1458 { "Number of Secondary Device Types", "wifi_p2p.dev_info.num_sec",
1459 FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }},
1460 { &hf_p2p_attr_dev_info_sec_dev_type,
1461 { "Secondary Device Type", "wifi_p2p.dev_info.sec_dev_type",
1462 FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL }},
1463 { &hf_p2p_attr_dev_info_dev_name_type,
1464 { "Device Name attribute type", "wifi_p2p.dev_info.dev_name_type",
1465 FT_UINT16, BASE_HEX, NULL, 0x0, NULL, HFILL }},
1466 { &hf_p2p_attr_dev_info_dev_name_len,
1467 { "Device Name attribute length", "wifi_p2p.dev_info.dev_name_len",
1468 FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL }},
1469 { &hf_p2p_attr_dev_info_dev_name,
1470 { "Device Name", "wifi_p2p.dev_info.dev_name",
1471 FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL }},
1472 { &hf_p2p_attr_dev_info_config_methods,
1473 { "Config Methods", "wifi_p2p.dev_info.config_methods",
1474 FT_UINT16, BASE_HEX, NULL, 0, NULL, HFILL }},
1475 { &hf_p2p_attr_dev_info_config_methods_usba,
1476 { "USBA (Flash Drive)", "wifi_p2p.dev_info.config_methods.usba",
1477 FT_UINT16, BASE_HEX, NULL, WPS_CONF_METH_USBA, NULL, HFILL }},
1478 { &hf_p2p_attr_dev_info_config_methods_ethernet,
1479 { "Ethernet", "wifi_p2p.dev_info.config_methods.ethernet",
1480 FT_UINT16, BASE_HEX, NULL, WPS_CONF_METH_ETHERNET, NULL, HFILL }},
1481 { &hf_p2p_attr_dev_info_config_methods_label,
1482 { "Label", "wifi_p2p.dev_info.config_methods.label",
1483 FT_UINT16, BASE_HEX, NULL, WPS_CONF_METH_LABEL, NULL, HFILL }},
1484 { &hf_p2p_attr_dev_info_config_methods_display,
1485 { "Display", "wifi_p2p.dev_info.config_methods.display",
1486 FT_UINT16, BASE_HEX, NULL, WPS_CONF_METH_DISPLAY, NULL, HFILL }},
1487 { &hf_p2p_attr_dev_info_config_methods_ext_nfc_token,
1488 { "External NFC Token", "wifi_p2p.dev_info.config_methods.ext_nfc_token",
1489 FT_UINT16, BASE_HEX, NULL, WPS_CONF_METH_EXT_NFC_TOKEN, NULL, HFILL }},
1490 { &hf_p2p_attr_dev_info_config_methods_int_nfc_token,
1491 { "Integrated NFC Token",
1492 "wifi_p2p.dev_info.config_methods.int_nfc_token",
1493 FT_UINT16, BASE_HEX, NULL, WPS_CONF_METH_INT_NFC_TOKEN, NULL, HFILL }},
1494 { &hf_p2p_attr_dev_info_config_methods_nfc_interface,
1495 { "NFC Interface", "wifi_p2p.dev_info.config_methods.nfc_interface",
1496 FT_UINT16, BASE_HEX, NULL, WPS_CONF_METH_NFC_INTERFACE, NULL, HFILL }},
1497 { &hf_p2p_attr_dev_info_config_methods_pushbutton,
1498 { "PushButton", "wifi_p2p.dev_info.config_methods.pushbutton",
1499 FT_UINT16, BASE_HEX, NULL, WPS_CONF_METH_PUSHBUTTON, NULL, HFILL }},
1500 { &hf_p2p_attr_dev_info_config_methods_keypad,
1501 { "Keypad", "wifi_p2p.dev_info.config_methods.keypad",
1502 FT_UINT16, BASE_HEX, NULL, WPS_CONF_METH_KEYPAD, NULL, HFILL }},
1503 { &hf_p2p_attr_config_timeout_go,
1504 { "GO Configuration Timeout", "wifi_p2p.config_timeout.go",
1505 FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }},
1506 { &hf_p2p_attr_config_timeout_client,
1507 { "Client Configuration Timeout", "wifi_p2p.config_timeout.client",
1508 FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }},
1509 { &hf_p2p_attr_intended_interface_addr,
1510 { "P2P Interface Address", "wifi_p2p.intended_interface_addr",
1511 FT_ETHER, BASE_NONE, NULL, 0x0, NULL, HFILL }},
1512 { &hf_p2p_attr_extended_listen_timing_period,
1513 { "Availability Period", "wifi_p2p.extended_listen_timing.period",
1514 FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL }},
1515 { &hf_p2p_attr_extended_listen_timing_interval,
1516 { "Availability Interval", "wifi_p2p.extended_listen_timing.interval",
1517 FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL }},
1518 { &hf_p2p_attr_p2p_group_id_dev_addr,
1519 { "P2P Device address", "wifi_p2p.p2p_group_id.p2p_dev_addr",
1520 FT_ETHER, BASE_NONE, NULL, 0x0, NULL, HFILL }},
1521 { &hf_p2p_attr_p2p_group_id_ssid,
1522 { "SSID", "wifi_p2p.p2p_group_id.ssid",
1523 FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL }},
1524 { &hf_p2p_attr_p2p_group_bssid,
1525 { "BSSID", "wifi_p2p.p2p_group_bssid",
1526 FT_ETHER, BASE_NONE, NULL, 0x0, NULL, HFILL }},
1528 { &hf_p2p_attr_noa_index,
1529 { "Index", "wifi_p2p.noa.index",
1530 FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }},
1531 { &hf_p2p_attr_noa_params,
1532 { "CTWindow and OppPS Parameters", "wifi_p2p.noa.params",
1533 FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL }},
1534 { &hf_p2p_attr_noa_params_opp_ps,
1535 { "OppPS", "wifi_p2p.noa.params.opp_ps",
1536 FT_UINT8, BASE_DEC, NULL, 0x80, NULL, HFILL }},
1537 { &hf_p2p_attr_noa_params_ctwindow,
1538 { "CTWindow", "wifi_p2p.noa.params.ctwindow",
1539 FT_UINT8, BASE_DEC, NULL, 0x7f, NULL, HFILL }},
1540 { &hf_p2p_attr_noa_count_type,
1541 { "Count/Type", "wifi_p2p.noa.count_type",
1542 FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }},
1543 { &hf_p2p_attr_noa_duration,
1544 { "Duration", "wifi_p2p.noa.duration",
1545 FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL }},
1546 { &hf_p2p_attr_noa_interval,
1547 { "Interval", "wifi_p2p.noa.interval",
1548 FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL }},
1549 { &hf_p2p_attr_noa_start_time,
1550 { "Start Time", "wifi_p2p.noa.start_time",
1551 FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL }},
1553 #if 0
1554 { &hf_p2p_attr_gi,
1555 { "Device Info", "wifi_p2p.group_info",
1556 FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL }},
1557 #endif
1558 { &hf_p2p_attr_gi_length,
1559 { "P2P Client Info Descriptor Length", "wifi_p2p.group_info.length",
1560 FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }},
1561 { &hf_p2p_attr_gi_p2p_dev_addr,
1562 { "P2P Device address", "wifi_p2p.group_info.p2p_dev_addr",
1563 FT_ETHER, BASE_NONE, NULL, 0x0, NULL, HFILL }},
1564 { &hf_p2p_attr_gi_p2p_iface_addr,
1565 { "P2P Interface address", "wifi_p2p.group_info.p2p_interface_addr",
1566 FT_ETHER, BASE_NONE, NULL, 0x0, NULL, HFILL }},
1567 { &hf_p2p_attr_gi_dev_capab,
1568 { "Device Capability Bitmap", "wifi_p2p.group_info.device_capability",
1569 FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL }},
1570 { &hf_p2p_attr_gi_dev_capab_service_discovery,
1571 { "Service Discovery",
1572 "wifi_p2p.group_info.device_capability.service_discovery",
1573 FT_UINT8, BASE_HEX, NULL, P2P_DEV_CAPAB_SERVICE_DISCOVERY, NULL, HFILL
1575 { &hf_p2p_attr_gi_dev_capab_client_discoverability,
1576 { "P2P Client Discoverability",
1577 "wifi_p2p.group_info.device_capability.client_discoverability",
1578 FT_UINT8, BASE_HEX, NULL, P2P_DEV_CAPAB_P2P_CLIENT_DISCOVERABILITY,
1579 NULL, HFILL
1581 { &hf_p2p_attr_gi_dev_capab_concurrent_operation,
1582 { "Concurrent Operation",
1583 "wifi_p2p.group_info.device_capability.concurrent_operation",
1584 FT_UINT8, BASE_HEX, NULL, P2P_DEV_CAPAB_CONCURRENT_OPERATION, NULL,
1585 HFILL
1587 { &hf_p2p_attr_gi_dev_capab_infrastructure_managed,
1588 { "P2P Infrastructure Managed",
1589 "wifi_p2p.group_info.device_capability.infrastructure_managed",
1590 FT_UINT8, BASE_HEX, NULL, P2P_DEV_CAPAB_P2P_INFRASTRUCTURE_MANAGED,
1591 NULL, HFILL
1593 { &hf_p2p_attr_gi_dev_capab_limit,
1594 { "P2P Device Limit",
1595 "wifi_p2p.group_info.device_capability.device_limit",
1596 FT_UINT8, BASE_HEX, NULL, P2P_DEV_CAPAB_P2P_DEVICE_LIMIT, NULL, HFILL }},
1597 #if 0
1598 { &hf_p2p_attr_gi_dev_capab_invitation_procedure,
1599 { "P2P Invitation Procedure",
1600 "wifi_p2p.group_info.device_capability.invitation_procedure",
1601 FT_UINT8, BASE_HEX, NULL, P2P_DEV_CAPAB_P2P_INVITATION_PROCEDURE, NULL,
1602 HFILL }},
1603 #endif
1604 { &hf_p2p_attr_gi_pri_dev_type,
1605 { "Primary Device Type", "wifi_p2p.group_info.pri_dev_type",
1606 FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL }},
1607 { &hf_p2p_attr_gi_pri_dev_type_category,
1608 { "Primary Device Type: Category",
1609 "wifi_p2p.group_info.pri_dev_type.category",
1610 FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL }},
1611 { &hf_p2p_attr_gi_pri_dev_type_oui,
1612 { "Primary Device Type: OUI", "wifi_p2p.group_info.pri_dev_type.oui",
1613 FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL }},
1614 { &hf_p2p_attr_gi_pri_dev_type_subcategory,
1615 { "Primary Device Type: Subcategory",
1616 "wifi_p2p.group_info.pri_dev_type.subcategory",
1617 FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL }},
1618 { &hf_p2p_attr_gi_num_sec_dev_types,
1619 { "Number of Secondary Device Types", "wifi_p2p.group_info.num_sec",
1620 FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }},
1621 { &hf_p2p_attr_gi_sec_dev_type,
1622 { "Secondary Device Type", "wifi_p2p.group_info.sec_dev_type",
1623 FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL }},
1624 { &hf_p2p_attr_gi_dev_name_type,
1625 { "Device Name attribute type", "wifi_p2p.group_info.dev_name_type",
1626 FT_UINT16, BASE_HEX, NULL, 0x0, NULL, HFILL }},
1627 { &hf_p2p_attr_gi_dev_name_len,
1628 { "Device Name attribute length", "wifi_p2p.group_info.dev_name_len",
1629 FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL }},
1630 { &hf_p2p_attr_gi_dev_name,
1631 { "Device Name", "wifi_p2p.group_info.dev_name",
1632 FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL }},
1633 { &hf_p2p_attr_gi_config_methods,
1634 { "Config Methods", "wifi_p2p.group_info.config_methods",
1635 FT_UINT16, BASE_HEX, NULL, 0, NULL, HFILL }},
1636 #if 0
1637 { &hf_p2p_attr_gi_config_methods_usba,
1638 { "USBA (Flash Drive)", "wifi_p2p.group_info.config_methods.usba",
1639 FT_UINT16, BASE_HEX, NULL, WPS_CONF_METH_USBA, NULL, HFILL }},
1640 #endif
1641 #if 0
1642 { &hf_p2p_attr_gi_config_methods_ethernet,
1643 { "Ethernet", "wifi_p2p.group_info.config_methods.ethernet",
1644 FT_UINT16, BASE_HEX, NULL, WPS_CONF_METH_ETHERNET, NULL, HFILL }},
1645 #endif
1646 #if 0
1647 { &hf_p2p_attr_gi_config_methods_label,
1648 { "Label", "wifi_p2p.group_info.config_methods.label",
1649 FT_UINT16, BASE_HEX, NULL, WPS_CONF_METH_LABEL, NULL, HFILL }},
1650 #endif
1651 #if 0
1652 { &hf_p2p_attr_gi_config_methods_display,
1653 { "Display", "wifi_p2p.group_info.config_methods.display",
1654 FT_UINT16, BASE_HEX, NULL, WPS_CONF_METH_DISPLAY, NULL, HFILL }},
1655 #endif
1656 #if 0
1657 { &hf_p2p_attr_gi_config_methods_ext_nfc_token,
1658 { "External NFC Token",
1659 "wifi_p2p.group_info.config_methods.ext_nfc_token",
1660 FT_UINT16, BASE_HEX, NULL, WPS_CONF_METH_EXT_NFC_TOKEN, NULL, HFILL }},
1661 #endif
1662 #if 0
1663 { &hf_p2p_attr_gi_config_methods_int_nfc_token,
1664 { "Integrated NFC Token",
1665 "wifi_p2p.group_info.config_methods.int_nfc_token",
1666 FT_UINT16, BASE_HEX, NULL, WPS_CONF_METH_INT_NFC_TOKEN, NULL, HFILL }},
1667 #endif
1668 #if 0
1669 { &hf_p2p_attr_gi_config_methods_nfc_interface,
1670 { "NFC Interface", "wifi_p2p.group_info.config_methods.nfc_interface",
1671 FT_UINT16, BASE_HEX, NULL, WPS_CONF_METH_NFC_INTERFACE, NULL, HFILL }},
1672 #endif
1673 #if 0
1674 { &hf_p2p_attr_gi_config_methods_pushbutton,
1675 { "PushButton", "wifi_p2p.group_info.config_methods.pushbutton",
1676 FT_UINT16, BASE_HEX, NULL, WPS_CONF_METH_PUSHBUTTON, NULL, HFILL }},
1677 #endif
1678 #if 0
1679 { &hf_p2p_attr_gi_config_methods_keypad,
1680 { "Keypad", "wifi_p2p.group_info.config_methods.keypad",
1681 FT_UINT16, BASE_HEX, NULL, WPS_CONF_METH_KEYPAD, NULL, HFILL }},
1682 #endif
1684 { &hf_p2p_attr_invitation_flags,
1685 { "Invitation Flags", "wifi_p2p.invitation_flags",
1686 FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL }},
1687 { &hf_p2p_attr_invitation_flags_type,
1688 { "Invitation Type", "wifi_p2p.invitation_flags.type",
1689 FT_UINT8, BASE_HEX, VALS(invitation_types), 0x01, NULL, HFILL }},
1691 { &hf_p2p_attr_manageability_bitmap,
1692 { "Manageability Bitmap field", "wifi_p2p.manageability.bitmap",
1693 FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL }},
1694 { &hf_p2p_attr_manageability_bitmap_mgmt,
1695 { "P2P Device Management", "wifi_p2p.manageability.bitmap.dev_mgmt",
1696 FT_UINT8, BASE_HEX, NULL, 0x01, NULL, HFILL }},
1697 { &hf_p2p_attr_manageability_bitmap_cross_connect,
1698 { "Cross Connection Permitted",
1699 "wifi_p2p.manageability.bitmap.cross_connect",
1700 FT_UINT8, BASE_HEX, NULL, 0x02, NULL, HFILL }},
1701 { &hf_p2p_attr_manageability_bitmap_coex_opt,
1702 { "Coexistence Optional", "wifi_p2p.manageability.bitmap.coex_opt",
1703 FT_UINT8, BASE_HEX, NULL, 0x04, NULL, HFILL }},
1705 { &hf_p2p_attr_minor_reason_code,
1706 { "Minor Reason Code", "wifi_p2p.minor_reason_code",
1707 FT_UINT8, BASE_DEC, VALS(p2p_minor_reason_codes), 0x0, NULL, HFILL }},
1709 { &hf_p2p_attr_oob_group_owner_negotiation_channel_country,
1710 { "Country String", "wifi_p2p.oob_group_owner_negotiation_channel.country_string",
1711 FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL }},
1712 { &hf_p2p_attr_oob_group_owner_negotiation_channel_oper_class,
1713 { "Operating Class", "wifi_p2p.oob_group_owner_negotiation_channel.operating_class",
1714 FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }},
1715 { &hf_p2p_attr_oob_group_owner_negotiation_channel_number,
1716 { "Channel Number", "wifi_p2p.oob_group_owner_negotiation_channel.channel_number",
1717 FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }},
1718 { &hf_p2p_attr_oob_group_owner_negotiation_channel_role_indication,
1719 { "Role Indication", "wifi_p2p.oob_group_owner_negotiation_channel.role_indication",
1720 FT_UINT8, BASE_DEC, VALS(p2p_oob_group_owner_negotiation_channel_role_indication_vals), 0x0, NULL, HFILL }},
1722 { &hf_p2p_attr_service_hash,
1723 { "Service Hash", "wifi_p2p.service_hash",
1724 FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL }},
1726 { &hf_p2p_attr_session_information,
1727 { "Service Information", "wifi_p2p.session_information",
1728 FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL }},
1730 { &hf_p2p_attr_connection_capability,
1731 { "Connection Capability Information", "wifi_p2p.connection_capability",
1732 FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL }},
1734 { &hf_p2p_attr_advertisement_id,
1735 { "Advertisement ID", "wifi_p2p.advertisement_id",
1736 FT_UINT32, BASE_HEX, NULL, 0x0, NULL, HFILL }},
1737 { &hf_p2p_attr_advertisement_id_service_mac_address,
1738 { "Service MAC Address", "wifi_p2p.advertisement_id.service_mac_address",
1739 FT_ETHER, BASE_NONE, NULL, 0x0, NULL, HFILL }},
1741 { &hf_p2p_attr_advertised_service_advertisement_id,
1742 { "Advertisement ID", "wifi_p2p.advertised_service.advertisement_id",
1743 FT_UINT32, BASE_HEX, NULL, 0x0, NULL, HFILL }},
1744 { &hf_p2p_attr_advertised_service_config_methods,
1745 { "Service Config Methods", "wifi_p2p.advertised_service.config_methods",
1746 FT_UINT16, BASE_HEX, NULL, 0x0, NULL, HFILL }},
1747 { &hf_p2p_attr_advertised_service_service_name_length,
1748 { "Service Name Length", "wifi_p2p.advertised_service.service_name_length",
1749 FT_UINT32, BASE_HEX, NULL, 0x0, NULL, HFILL }},
1750 { &hf_p2p_attr_advertised_service_service_name,
1751 { "Service Name", "wifi_p2p.advertised_service.service_name",
1752 FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL }},
1754 { &hf_p2p_attr_session_id,
1755 { "Session ID", "wifi_p2p.session_id",
1756 FT_UINT32, BASE_HEX, NULL, 0x0, NULL, HFILL }},
1757 { &hf_p2p_attr_session_id_session_mac_address,
1758 { "Session MAC Address", "wifi_p2p.session_id.session_mac_address",
1759 FT_ETHER, BASE_NONE, NULL, 0x0, NULL, HFILL }},
1761 { &hf_p2p_attr_feature_capability,
1762 { "Feature Capability", "wifi_p2p.feature_capability",
1763 FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL }},
1765 { &hf_p2p_attr_persistent_group_p2p_device_address,
1766 { "P2P device address", "wifi_p2p.persistent_group.p2p_device_address",
1767 FT_ETHER, BASE_NONE, NULL, 0x0, NULL, HFILL }},
1768 { &hf_p2p_attr_persistent_group_ssid,
1769 { "SSID", "wifi_p2p.persistent_group.ssid",
1770 FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL }},
1773 { &hf_p2p_anqp_service_update_indicator,
1774 { "Service Update Indicator", "wifi_p2p.anqp.service_update_indicator",
1775 FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL }},
1776 { &hf_p2p_anqp_length,
1777 { "Length", "wifi_p2p.anqp.length",
1778 FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL }},
1779 { &hf_p2p_anqp_service_protocol_type,
1780 { "Service Protocol Type", "wifi_p2p.anqp.service_protocol_type",
1781 FT_UINT8, BASE_DEC, VALS(p2p_service_protocol_types), 0x0, NULL,
1782 HFILL }},
1783 { &hf_p2p_anqp_service_transaction_id,
1784 { "Service Transaction ID", "wifi_p2p.anqp.service_transaction_id",
1785 FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }},
1786 { &hf_p2p_anqp_query_data,
1787 { "Query Data", "wifi_p2p.anqp.query_data",
1788 FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL }},
1789 { &hf_p2p_anqp_status_code,
1790 { "Status Code", "wifi_p2p.anqp.status_code",
1791 FT_UINT8, BASE_DEC, VALS(p2p_sd_status_codes), 0x0,
1792 "Service Query Status Code", HFILL }},
1793 { &hf_p2p_anqp_response_data,
1794 { "Response Data", "wifi_p2p.anqp.response_data",
1795 FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL }},
1797 { &hf_p2p_action_subtype,
1798 { "P2P Action Subtype", "wifi_p2p.action.subtype",
1799 FT_UINT8, BASE_DEC, VALS(p2p_action_subtypes), 0x0, NULL, HFILL }},
1800 { &hf_p2p_action_dialog_token,
1801 { "P2P Action Dialog Token", "wifi_p2p.action.dialog_token",
1802 FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }},
1803 { &hf_p2p_public_action_subtype,
1804 { "P2P Public Action Subtype", "wifi_p2p.public_action.subtype",
1805 FT_UINT8, BASE_DEC, VALS(p2p_public_action_subtypes), 0x0, NULL, HFILL
1807 { &hf_p2p_public_action_dialog_token,
1808 { "P2P Public Action Dialog Token",
1809 "wifi_p2p.public_action.dialog_token",
1810 FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }}
1812 static int *ett[] = {
1813 &ett_p2p_tlv,
1814 &ett_p2p_service_tlv,
1815 &ett_p2p_advertised_service,
1816 &ett_p2p_client_descr
1819 static ei_register_info ei[] = {
1820 { &ei_wifi_p2p_attr_dev_info_dev_name_type, { "wifi_p2p.dev_info.dev_name_type.invalid", PI_MALFORMED, PI_ERROR, "Incorrect Device Name attribute type", EXPFILL }},
1821 { &ei_wifi_p2p_attr_len, { "wifi_p2p.length.invalid", PI_MALFORMED, PI_ERROR, "Invalid attribute length", EXPFILL }},
1822 { &ei_wifi_p2p_anqp_length, { "wifi_p2p.anqp.length.invalid", PI_MALFORMED, PI_ERROR, "Invalid anqp_length", EXPFILL }},
1823 { &ei_wifi_p2p_anqp_unexpected_padding, { "wifi_p2p.anqp.unexpected_padding", PI_MALFORMED, PI_ERROR, "Unexpected padding in the end of P2P ANQP", EXPFILL }},
1826 expert_module_t* expert_p2p;
1828 proto_p2p = proto_register_protocol("Wi-Fi Peer-to-Peer", "Wi-Fi P2P", "wifi_p2p");
1829 proto_register_field_array(proto_p2p, hf, array_length(hf));
1830 proto_register_subtree_array(ett, array_length(ett));
1832 expert_p2p = expert_register_protocol(proto_p2p);
1833 expert_register_field_array(expert_p2p, ei, array_length(ei));
1835 wifi_p2p_act_handle = register_dissector("wifi_p2p.action", dissect_wifi_p2p_action, proto_p2p);
1836 wifi_p2p_anqp_handle = register_dissector("wifi_p2p.anqp", dissect_wifi_p2p_anqp, proto_p2p);
1837 wifi_p2p_ie_handle = register_dissector("wifi_p2p.ie", dissect_wifi_p2p_ie, proto_p2p);
1838 wifi_p2p_pubact_handle = register_dissector("wifi_p2p.public_action", dissect_wifi_p2p_public_action, proto_p2p);
1841 void
1842 proto_reg_handoff_p2p(void)
1844 dissector_add_uint("wlan.action.wifi_alliance.subtype", WFA_SUBTYPE_P2P, wifi_p2p_act_handle);
1845 dissector_add_uint("wlan.anqp.wifi_alliance.subtype", WFA_SUBTYPE_P2P, wifi_p2p_anqp_handle);
1846 dissector_add_uint("wlan.ie.wifi_alliance.subtype", WFA_SUBTYPE_P2P, wifi_p2p_ie_handle);
1847 dissector_add_uint("wlan.pa.wifi_alliance.subtype", WFA_SUBTYPE_P2P, wifi_p2p_pubact_handle);
1849 wifi_display_ie_handle = find_dissector_add_dependency("wifi_display_ie", proto_p2p);
1853 * Editor modelines
1855 * Local Variables:
1856 * c-basic-offset: 2
1857 * tab-width: 8
1858 * indent-tabs-mode: nil
1859 * End:
1861 * ex: set shiftwidth=2 tabstop=8 expandtab:
1862 * :indentSize=2:tabSize=8:noTabs=true: