Revert "TODO epan/dissectors/asn1/kerberos/packet-kerberos-template.c new GSS flags"
[wireshark-sm.git] / epan / dissectors / packet-wps.c
blob654bab1a31ec6c5762ad2cc8f4c50d1a919970a5
1 /* packet-wps.c
3 * Wifi Simple Config aka Wifi Protected Setup
5 * Written by Jens Braeuer using WiFi-Alliance Spec 1.0h and
6 * parts of a patch by JP Jiang and Philippe Teuwen. November 2007
8 * Spec:
9 * https://www.wi-fi.org/knowledge_center_overview.php?type=4
10 * Patch:
11 * http://wireshark.digimirror.nl/lists/wireshark-dev/200703/msg00121.html
13 * Copyright 2007 Jens Braeuer <jensb@cs.tu-berlin.de>
15 * Wireshark - Network traffic analyzer
16 * By Gerald Combs <gerald@wireshark.org>
17 * Copyright 1998 Gerald Combs
19 * SPDX-License-Identifier: GPL-2.0-or-later
23 #include "config.h"
25 #include <epan/packet.h>
26 #include <epan/expert.h>
27 #include <epan/sminmpec.h>
28 #include <epan/tfs.h>
29 #include <wsutil/array.h>
31 #include "packet-wps.h"
32 #include "packet-ieee80211.h"
34 void proto_register_wps(void);
35 void proto_reg_handoff_wps(void);
37 static int hf_eapwps_opcode;
38 static int hf_eapwps_flags;
39 static int hf_eapwps_flag_mf;
40 static int hf_eapwps_flag_lf;
41 static int hf_eapwps_msglen;
43 static int ett_eap_wps_attr;
44 static int ett_eap_wps_flags;
46 static expert_field ei_eapwps_packet_too_short;
47 static expert_field ei_eapwps_fmt_warn_too_long;
48 static expert_field ei_eapwps_fmt_length_warn;
50 static dissector_handle_t wps_handle;
52 /* OPCodes */
53 #define OPC_WSC_START 0x01 /* WPS OPCODE WSC_Start */
54 #define OPC_WSC_ACK 0x02 /* WPS OPCODE WSC_ACK */
55 #define OPC_WSC_NACK 0x03 /* WPS OPCODE WSC_NACK */
56 #define OPC_WSC_MSG 0x04 /* WPS OPCODE WSC_MSG */
57 #define OPC_WSC_DONE 0x05 /* WPS OPCODE WSC_Done */
58 #define OPC_WSC_FRAG_ACK 0x06 /* WPS OPCODE WSC_FRAG_ACK */
60 static const value_string eapwps_opcode_vals[] = {
61 { OPC_WSC_START, "WSC Start"},
62 { OPC_WSC_ACK, "WSC Ack"},
63 { OPC_WSC_NACK, "WSC Nack" },
64 { OPC_WSC_MSG, "WSC Msg" },
65 { OPC_WSC_DONE, "WSC Done" },
66 { OPC_WSC_FRAG_ACK, "WSC Frag Ack" },
67 { 0, NULL }
70 /* Flag-Field masks */
71 #define MASK_WSC_FLAG_MF 0x01 /* WPS Flag more frag */
72 #define MASK_WSC_FLAG_LF 0x02 /* WPS flag length field */
74 #define WPS_TLV_TYPE_AP_CHANNEL 0x1001
75 #define WPS_TLV_TYPE_ASSOCIATION_STATE 0x1002
76 #define WPS_TLV_TYPE_AUTHENTICATION_TYPE 0x1003
77 #define WPS_TLV_TYPE_AUTHENTICATION_TYPE_FLAGS 0x1004
78 #define WPS_TLV_TYPE_AUTHENTICATOR 0x1005
79 #define WPS_TLV_TYPE_CONFIG_METHODS 0x1008
80 #define WPS_TLV_TYPE_CONFIGURATION_ERROR 0x1009
81 #define WPS_TLV_TYPE_CONFIRMATION_URL4 0x100a
82 #define WPS_TLV_TYPE_CONFIRMATION_URL6 0x100b
83 #define WPS_TLV_TYPE_CONNECTION_TYPE 0x100c
84 #define WPS_TLV_TYPE_CONNECTION_TYPE_FLAGS 0x100d
85 #define WPS_TLV_TYPE_CREDENTIAL 0x100e
86 #define WPS_TLV_TYPE_DEVICE_NAME 0x1011
87 #define WPS_TLV_TYPE_DEVICE_PASSWORD_ID 0x1012
88 #define WPS_TLV_TYPE_E_HASH1 0X1014
89 #define WPS_TLV_TYPE_E_HASH2 0x1015
90 #define WPS_TLV_TYPE_E_SNONCE1 0x1016
91 #define WPS_TLV_TYPE_E_SNONCE2 0x1017
92 #define WPS_TLV_TYPE_ENCRYPTED_SETTINGS 0x1018
93 #define WPS_TLV_TYPE_ENCRYPTION_TYPE 0x100f
94 #define WPS_TLV_TYPE_ENCRYPTION_TYPE_FLAGS 0x1010
95 #define WPS_TLV_TYPE_ENROLLEE_NONCE 0x101a
96 #define WPS_TLV_TYPE_FEATURE_ID 0x101b
97 #define WPS_TLV_TYPE_IDENTITY 0x101c
98 #define WPS_TLV_TYPE_IDENTITY_PROOF 0x101d
99 #define WPS_TLV_TYPE_KEY_WRAP_AUTHENTICATOR 0x101e
100 #define WPS_TLV_TYPE_KEY_IDENTIFIER 0x101f
101 #define WPS_TLV_TYPE_MAC_ADDRESS 0x1020
102 #define WPS_TLV_TYPE_MANUFACTURER 0x1021
103 #define WPS_TLV_TYPE_MESSAGE_TYPE 0x1022
104 #define WPS_TLV_TYPE_MODEL_NAME 0x1023
105 #define WPS_TLV_TYPE_MODEL_NUMBER 0x1024
106 #define WPS_TLV_TYPE_NETWORK_INDEX 0x1026
107 #define WPS_TLV_TYPE_NETWORK_KEY 0x1027
108 #define WPS_TLV_TYPE_NETWORK_KEY_INDEX 0x1028
109 #define WPS_TLV_TYPE_NEW_DEVICE_NAME 0x1029
110 #define WPS_TLV_TYPE_NEW_PASSWORD 0x102a
111 #define WPS_TLV_TYPE_OOB_DEVICE_PASSWORD 0x102c
112 #define WPS_TLV_TYPE_OS_VERSION 0x102d
113 #define WPS_TLV_TYPE_POWER_LEVEL 0x102f
114 #define WPS_TLV_TYPE_PSK_CURRENT 0x1030
115 #define WPS_TLV_TYPE_PSK_MAX 0x1031
116 #define WPS_TLV_TYPE_PUBLIC_KEY 0x1032
117 #define WPS_TLV_TYPE_RADIO_ENABLED 0x1033
118 #define WPS_TLV_TYPE_REBOOT 0x1034
119 #define WPS_TLV_TYPE_REGISTRAR_CURRENT 0x1035
120 #define WPS_TLV_TYPE_REGISTRAR_ESTABLISHED 0x1036
121 #define WPS_TLV_TYPE_REGISTRAR_LIST 0x1037
122 #define WPS_TLV_TYPE_REGISTRAR_MAX 0x1038
123 #define WPS_TLV_TYPE_REGISTRAR_NONCE 0x1039
124 #define WPS_TLV_TYPE_REQUEST_TYPE 0x103a
125 #define WPS_TLV_TYPE_RESPONSE_TYPE 0x103b
126 #define WPS_TLV_TYPE_RF_BANDS 0x103c
127 #define WPS_TLV_TYPE_R_HASH1 0x103d
128 #define WPS_TLV_TYPE_R_HASH2 0x103e
129 #define WPS_TLV_TYPE_R_SNONCE1 0x103f
130 #define WPS_TLV_TYPE_R_SNONCE2 0x1040
131 #define WPS_TLV_TYPE_SELECTED_REGISTRAR 0x1041
132 #define WPS_TLV_TYPE_SERIAL_NUMBER 0x1042
133 #define WPS_TLV_TYPE_WIFI_PROTECTED_SETUP_STATE 0x1044
134 #define WPS_TLV_TYPE_SSID 0x1045
135 #define WPS_TLV_TYPE_TOTAL_NETWORKS 0x1046
136 #define WPS_TLV_TYPE_UUID_E 0x1047
137 #define WPS_TLV_TYPE_UUID_R 0x1048
138 #define WPS_TLV_TYPE_VENDOR_EXTENSION 0x1049
139 #define WPS_TLV_TYPE_VERSION 0x104a
140 #define WPS_TLV_TYPE_X509_CERTIFICATE_REQUEST 0x104b
141 #define WPS_TLV_TYPE_X509_CERTIFICATE 0x104c
142 #define WPS_TLV_TYPE_EAP_IDENTITY 0x104d
143 #define WPS_TLV_TYPE_MESSAGE_COUNTER 0x104e
144 #define WPS_TLV_TYPE_PUBLIC_KEY_HASH 0x104f
145 #define WPS_TLV_TYPE_REKEY_KEY 0x1050
146 #define WPS_TLV_TYPE_KEY_LIFETIME 0x1051
147 #define WPS_TLV_TYPE_PERMITTED_CONFIG_METHODS 0x1052
148 #define WPS_TLV_TYPE_SELECTED_REGISTRAR_CONFIG_METHODS 0x1053
149 #define WPS_TLV_TYPE_PRIMARY_DEVICE_TYPE 0x1054
150 #define WPS_TLV_TYPE_SECONDARY_DEVICE_TYPE_LIST 0x1055
151 #define WPS_TLV_TYPE_PORTABLE_DEVICE 0x1056
152 #define WPS_TLV_TYPE_AP_SETUP_LOCKED 0x1057
153 #define WPS_TLV_TYPE_APPLICATION_EXTENSION 0x1058
154 #define WPS_TLV_TYPE_EAP_TYPE 0x1059
155 #define WPS_TLV_TYPE_INITIALIZATION_VECTOR 0x1060
156 #define WPS_TLV_TYPE_KEY_PROVIDED_AUTOMATICALLY 0x1061
157 #define WPS_TLV_TYPE_8021X_ENABLED 0x1062
158 #define WPS_TLV_TYPE_APPSESSIONKEY 0x1063
159 #define WPS_TLV_TYPE_WEPTRANSMITKEY 0x1064
160 #define WPS_TLV_TYPE_REQUESTED_DEV_TYPE 0x106a
163 static const value_string eapwps_tlv_types[] = {
164 { WPS_TLV_TYPE_AP_CHANNEL, "AP Channel" },
165 { WPS_TLV_TYPE_ASSOCIATION_STATE, "Association State" },
166 { WPS_TLV_TYPE_AUTHENTICATION_TYPE, "Authentication Type" },
167 { WPS_TLV_TYPE_AUTHENTICATION_TYPE_FLAGS, "Authentication Type Flags" },
168 { WPS_TLV_TYPE_AUTHENTICATOR, "Authenticator" },
169 { WPS_TLV_TYPE_CONFIG_METHODS, "Config Methods" },
170 { WPS_TLV_TYPE_CONFIGURATION_ERROR, "Configuration Error" },
171 { WPS_TLV_TYPE_CONFIRMATION_URL4, "Confirmation URL4" },
172 { WPS_TLV_TYPE_CONFIRMATION_URL6, "Confirmation URL6" },
173 { WPS_TLV_TYPE_CONNECTION_TYPE, "Connection Type" },
174 { WPS_TLV_TYPE_CONNECTION_TYPE_FLAGS, "Connection Type Flags" },
175 { WPS_TLV_TYPE_CREDENTIAL, "Credential" },
176 { WPS_TLV_TYPE_DEVICE_NAME, "Device Name" },
177 { WPS_TLV_TYPE_DEVICE_PASSWORD_ID, "Device Password ID" },
178 { WPS_TLV_TYPE_E_HASH1, "E Hash1" },
179 { WPS_TLV_TYPE_E_HASH2, "E Hash2" },
180 { WPS_TLV_TYPE_E_SNONCE1, "E SNonce1" },
181 { WPS_TLV_TYPE_E_SNONCE2, "E SNonce2" },
182 { WPS_TLV_TYPE_ENCRYPTED_SETTINGS, "Encrypted Settings" },
183 { WPS_TLV_TYPE_ENCRYPTION_TYPE, "Encryption Type" },
184 { WPS_TLV_TYPE_ENCRYPTION_TYPE_FLAGS, "Encryption Type Flags" },
185 { WPS_TLV_TYPE_ENROLLEE_NONCE, "Enrollee Nonce" },
186 { WPS_TLV_TYPE_FEATURE_ID, "Feature Id" },
187 { WPS_TLV_TYPE_IDENTITY, "Identity" },
188 { WPS_TLV_TYPE_IDENTITY_PROOF, "Identity Proof" },
189 { WPS_TLV_TYPE_KEY_WRAP_AUTHENTICATOR, "Key Wrap Authenticator" },
190 { WPS_TLV_TYPE_KEY_IDENTIFIER, "Key Identifier" },
191 { WPS_TLV_TYPE_MAC_ADDRESS, "MAC Address" },
192 { WPS_TLV_TYPE_MANUFACTURER, "Manufacturer" },
193 { WPS_TLV_TYPE_MESSAGE_TYPE, "Message Type" },
194 { WPS_TLV_TYPE_MODEL_NAME, "Model Name" },
195 { WPS_TLV_TYPE_MODEL_NUMBER, "Model Number" },
196 { WPS_TLV_TYPE_NETWORK_INDEX, "Network Index" },
197 { WPS_TLV_TYPE_NETWORK_KEY, "Network Key" },
198 { WPS_TLV_TYPE_NETWORK_KEY_INDEX, "Network Key Index" },
199 { WPS_TLV_TYPE_NEW_DEVICE_NAME, "New Device Name" },
200 { WPS_TLV_TYPE_NEW_PASSWORD, "New Password" },
201 { WPS_TLV_TYPE_OOB_DEVICE_PASSWORD, "OOB Device Password" },
202 { WPS_TLV_TYPE_OS_VERSION, "OS Version" },
203 { WPS_TLV_TYPE_POWER_LEVEL, "Power Level" },
204 { WPS_TLV_TYPE_PSK_CURRENT, "PSK Current" },
205 { WPS_TLV_TYPE_PSK_MAX, "PSK Max" },
206 { WPS_TLV_TYPE_PUBLIC_KEY, "Public Key" },
207 { WPS_TLV_TYPE_RADIO_ENABLED, "Radio Enabled" },
208 { WPS_TLV_TYPE_REBOOT, "Reboot" },
209 { WPS_TLV_TYPE_REGISTRAR_CURRENT, "Registrar Current" },
210 { WPS_TLV_TYPE_REGISTRAR_ESTABLISHED, "Registrar Established" },
211 { WPS_TLV_TYPE_REGISTRAR_LIST, "Registrar List" },
212 { WPS_TLV_TYPE_REGISTRAR_MAX, "registrar_max" },
213 { WPS_TLV_TYPE_REGISTRAR_NONCE, "Registrar Nonce" },
214 { WPS_TLV_TYPE_REQUEST_TYPE, "Request Type" },
215 { WPS_TLV_TYPE_RESPONSE_TYPE, "Response Type" },
216 { WPS_TLV_TYPE_RF_BANDS, "RF Bands" },
217 { WPS_TLV_TYPE_R_HASH1, "R Hash1" },
218 { WPS_TLV_TYPE_R_HASH2, "R Hash2" },
219 { WPS_TLV_TYPE_R_SNONCE1, "R Snonce1" },
220 { WPS_TLV_TYPE_R_SNONCE2, "R Snonce2" },
221 { WPS_TLV_TYPE_SELECTED_REGISTRAR, "Selected Registrar" },
222 { WPS_TLV_TYPE_SERIAL_NUMBER, "Serial Number" },
223 { WPS_TLV_TYPE_WIFI_PROTECTED_SETUP_STATE, "Wifi Protected Setup State" },
224 { WPS_TLV_TYPE_SSID, "SSID" },
225 { WPS_TLV_TYPE_TOTAL_NETWORKS, "Total Networks" },
226 { WPS_TLV_TYPE_UUID_E, "UUID E" },
227 { WPS_TLV_TYPE_UUID_R, "UUID R" },
228 { WPS_TLV_TYPE_VENDOR_EXTENSION, "Vendor Extension" },
229 { WPS_TLV_TYPE_VERSION, "Version" },
230 { WPS_TLV_TYPE_X509_CERTIFICATE_REQUEST, "X509 Certificate Request" },
231 { WPS_TLV_TYPE_X509_CERTIFICATE, "X509 Certificate" },
232 { WPS_TLV_TYPE_EAP_IDENTITY, "EAP Identity" },
233 { WPS_TLV_TYPE_MESSAGE_COUNTER, "Message Counter" },
234 { WPS_TLV_TYPE_PUBLIC_KEY_HASH, "Public Key Hash" },
235 { WPS_TLV_TYPE_REKEY_KEY, "Rekey Key" },
236 { WPS_TLV_TYPE_KEY_LIFETIME, "Key Lifetime" },
237 { WPS_TLV_TYPE_PERMITTED_CONFIG_METHODS, "Permitted Config Methods" },
238 { WPS_TLV_TYPE_SELECTED_REGISTRAR_CONFIG_METHODS, "Selected Registrar Config Methods" },
239 { WPS_TLV_TYPE_PRIMARY_DEVICE_TYPE, "Primary Device Type" },
240 { WPS_TLV_TYPE_SECONDARY_DEVICE_TYPE_LIST, "Secondary Device Type List" },
241 { WPS_TLV_TYPE_PORTABLE_DEVICE, "Portable Device" },
242 { WPS_TLV_TYPE_AP_SETUP_LOCKED, "Ap Setup Locked" },
243 { WPS_TLV_TYPE_APPLICATION_EXTENSION, "Application Extension" },
244 { WPS_TLV_TYPE_EAP_TYPE, "EAP Type" },
245 { WPS_TLV_TYPE_INITIALIZATION_VECTOR, "Initialization Vector" },
246 { WPS_TLV_TYPE_KEY_PROVIDED_AUTOMATICALLY, "Key Provided Automatically" },
247 { WPS_TLV_TYPE_8021X_ENABLED, "8021x Enabled" },
248 { WPS_TLV_TYPE_APPSESSIONKEY, "AppSessionKey" },
249 { WPS_TLV_TYPE_WEPTRANSMITKEY, "WEPTransmitKey" },
250 { WPS_TLV_TYPE_REQUESTED_DEV_TYPE, "Requested Device Type" },
251 { 0, NULL }
255 /* WFA Vendor Extension */
257 #define WPS_WFA_EXT_VERSION2 0x00
258 #define WPS_WFA_EXT_AUTHORIZEDMACS 0x01
259 #define WPS_WFA_EXT_NETWORK_KEY_SHAREABLE 0x02
260 #define WPS_WFA_EXT_REQUEST_TO_ENROLL 0x03
261 #define WPS_WFA_EXT_SETTINGS_DELAY_TIME 0x04
262 #define WPS_WFA_EXT_REG_CFG_METHODS 0x05
263 #define WPS_WFA_EXT_MULTI_AP 0x06
264 #define WPS_WFA_EXT_MULTI_AP_PROFILE 0x07
265 #define WPS_WFA_EXT_MULTI_AP_8021Q 0x08
268 static const value_string eapwps_wfa_ext_types[] = {
269 { WPS_WFA_EXT_VERSION2, "Version2" },
270 { WPS_WFA_EXT_AUTHORIZEDMACS, "AuthorizedMACs" },
271 { WPS_WFA_EXT_NETWORK_KEY_SHAREABLE, "Network Key Shareable" },
272 { WPS_WFA_EXT_REQUEST_TO_ENROLL, "Request to Enroll" },
273 { WPS_WFA_EXT_SETTINGS_DELAY_TIME, "Settings Delay Time" },
274 { WPS_WFA_EXT_REG_CFG_METHODS, "Register configuration methods" },
275 { WPS_WFA_EXT_MULTI_AP, "Multi-AP Extension" },
276 { WPS_WFA_EXT_MULTI_AP_PROFILE, "Multi-AP Profile" },
277 { WPS_WFA_EXT_MULTI_AP_8021Q, "Multi-AP Profile 8021Q Settings" },
278 { 0, NULL }
281 static const value_string wps_wfa_ext_multi_ap_profiles_vals[] = {
282 { 0x01, "Multi-AP Profile-1" },
283 { 0x02, "Multi-AP Profile-2" },
284 { 0x03, "Multi-AP Profile-3" },
285 { 0, NULL }
287 #define WFA_OUI 0x0050F204
289 static int proto_wps;
291 static int hf_eapwps_tlv_type;
292 static int hf_eapwps_tlv_len;
294 static int hf_eapwps_tlv_ap_channel;
295 static int hf_eapwps_tlv_association_state;
296 static int hf_eapwps_tlv_authentication_type;
297 static int hf_eapwps_tlv_authentication_type_flags;
298 static int hf_eapwps_tlv_authentication_type_flags_open;
299 static int hf_eapwps_tlv_authentication_type_flags_wpapsk;
300 static int hf_eapwps_tlv_authentication_type_flags_shared;
301 static int hf_eapwps_tlv_authentication_type_flags_wpa;
302 static int hf_eapwps_tlv_authentication_type_flags_wpa2;
303 static int hf_eapwps_tlv_authentication_type_flags_wpa2psk;
304 static int hf_eapwps_tlv_authenticator;
305 static int hf_eapwps_tlv_config_methods;
306 static int hf_eapwps_tlv_config_methods_usba;
307 static int hf_eapwps_tlv_config_methods_ethernet;
308 static int hf_eapwps_tlv_config_methods_label;
309 static int hf_eapwps_tlv_config_methods_display;
310 static int hf_eapwps_tlv_config_methods_phy_display;
311 static int hf_eapwps_tlv_config_methods_virt_display;
312 static int hf_eapwps_tlv_config_methods_nfcext;
313 static int hf_eapwps_tlv_config_methods_nfcint;
314 static int hf_eapwps_tlv_config_methods_nfcinf;
315 static int hf_eapwps_tlv_config_methods_pushbutton;
316 static int hf_eapwps_tlv_config_methods_phy_pushbutton;
317 static int hf_eapwps_tlv_config_methods_virt_pushbutton;
318 static int hf_eapwps_tlv_config_methods_keypad;
319 static int hf_eapwps_tlv_configuration_error;
320 static int hf_eapwps_tlv_confirmation_url4;
321 static int hf_eapwps_tlv_confirmation_url6;
322 static int hf_eapwps_tlv_connection_type;
323 static int hf_eapwps_tlv_connection_type_flags;
324 static int hf_eapwps_tlv_connection_type_flags_ess;
325 static int hf_eapwps_tlv_connection_type_flags_ibss;
326 static int hf_eapwps_tlv_credential;
327 static int hf_eapwps_tlv_device_name;
328 static int hf_eapwps_tlv_device_password_id;
329 static int hf_eapwps_tlv_e_hash1;
330 static int hf_eapwps_tlv_e_hash2;
331 static int hf_eapwps_tlv_e_snonce1;
332 static int hf_eapwps_tlv_e_snonce2;
333 static int hf_eapwps_tlv_encrypted_settings;
334 static int hf_eapwps_tlv_encryption_type;
335 static int hf_eapwps_tlv_encryption_type_flags;
336 static int hf_eapwps_tlv_encryption_type_flags_none;
337 static int hf_eapwps_tlv_encryption_type_flags_wep;
338 static int hf_eapwps_tlv_encryption_type_flags_tkip;
339 static int hf_eapwps_tlv_encryption_type_flags_aes;
340 static int hf_eapwps_tlv_enrollee_nonce;
341 static int hf_eapwps_tlv_feature_id;
342 static int hf_eapwps_tlv_identity;
343 static int hf_eapwps_tlv_identity_proof;
344 static int hf_eapwps_tlv_key_wrap_authenticator;
345 static int hf_eapwps_tlv_key_identifier;
346 static int hf_eapwps_tlv_mac_address;
347 static int hf_eapwps_tlv_manufacturer;
348 static int hf_eapwps_tlv_message_type;
349 static int hf_eapwps_tlv_model_name;
350 static int hf_eapwps_tlv_model_number;
351 static int hf_eapwps_tlv_network_index;
352 static int hf_eapwps_tlv_network_key;
353 static int hf_eapwps_tlv_network_key_index;
354 static int hf_eapwps_tlv_new_device_name;
355 static int hf_eapwps_tlv_new_password;
356 static int hf_eapwps_tlv_oob_device_password;
357 static int hf_eapwps_tlv_os_version;
358 static int hf_eapwps_tlv_power_level;
359 static int hf_eapwps_tlv_psk_current;
360 static int hf_eapwps_tlv_psk_max;
361 static int hf_eapwps_tlv_public_key;
362 static int hf_eapwps_tlv_radio_enabled;
363 static int hf_eapwps_tlv_reboot;
364 static int hf_eapwps_tlv_registrar_current;
365 static int hf_eapwps_tlv_registrar_established;
366 static int hf_eapwps_tlv_registrar_list;
367 static int hf_eapwps_tlv_registrar_max;
368 static int hf_eapwps_tlv_registrar_nonce;
369 static int hf_eapwps_tlv_request_type;
370 static int hf_eapwps_tlv_response_type;
371 static int hf_eapwps_tlv_rf_bands;
372 static int hf_eapwps_tlv_r_hash1;
373 static int hf_eapwps_tlv_r_hash2;
374 static int hf_eapwps_tlv_r_snonce1;
375 static int hf_eapwps_tlv_r_snonce2;
376 static int hf_eapwps_tlv_selected_registrar;
377 static int hf_eapwps_tlv_serial_number;
378 static int hf_eapwps_tlv_wifi_protected_setup_state;
379 static int hf_eapwps_tlv_ssid;
380 static int hf_eapwps_tlv_total_networks;
381 static int hf_eapwps_tlv_uuid_e;
382 static int hf_eapwps_tlv_uuid_r;
383 static int hf_eapwps_tlv_vendor_extension;
384 static int hf_eapwps_tlv_version;
385 static int hf_eapwps_tlv_x509_certificate_request;
386 static int hf_eapwps_tlv_x509_certificate;
387 static int hf_eapwps_tlv_eap_identity;
388 static int hf_eapwps_tlv_message_counter;
389 static int hf_eapwps_tlv_public_key_hash;
390 static int hf_eapwps_tlv_rekey_key;
391 static int hf_eapwps_tlv_key_lifetime;
392 static int hf_eapwps_tlv_permitted_config_methods;
393 static int hf_eapwps_tlv_permitted_config_methods_usba;
394 static int hf_eapwps_tlv_permitted_config_methods_ethernet;
395 static int hf_eapwps_tlv_permitted_config_methods_label;
396 static int hf_eapwps_tlv_permitted_config_methods_display;
397 static int hf_eapwps_tlv_permitted_config_methods_phy_display;
398 static int hf_eapwps_tlv_permitted_config_methods_virt_display;
399 static int hf_eapwps_tlv_permitted_config_methods_nfcext;
400 static int hf_eapwps_tlv_permitted_config_methods_nfcint;
401 static int hf_eapwps_tlv_permitted_config_methods_nfcinf;
402 static int hf_eapwps_tlv_permitted_config_methods_pushbutton;
403 static int hf_eapwps_tlv_permitted_config_methods_phy_pushbutton;
404 static int hf_eapwps_tlv_permitted_config_methods_virt_pushbutton;
405 static int hf_eapwps_tlv_permitted_config_methods_keypad;
406 static int hf_eapwps_tlv_selected_registrar_config_methods;
407 static int hf_eapwps_tlv_selected_registrar_config_methods_usba;
408 static int hf_eapwps_tlv_selected_registrar_config_methods_ethernet;
409 static int hf_eapwps_tlv_selected_registrar_config_methods_label;
410 static int hf_eapwps_tlv_selected_registrar_config_methods_display;
411 static int hf_eapwps_tlv_selected_registrar_config_methods_phy_display;
412 static int hf_eapwps_tlv_selected_registrar_config_methods_virt_display;
413 static int hf_eapwps_tlv_selected_registrar_config_methods_nfcext;
414 static int hf_eapwps_tlv_selected_registrar_config_methods_nfcint;
415 static int hf_eapwps_tlv_selected_registrar_config_methods_nfcinf;
416 static int hf_eapwps_tlv_selected_registrar_config_methods_pushbutton;
417 static int hf_eapwps_tlv_selected_registrar_config_methods_phy_pushbutton;
418 static int hf_eapwps_tlv_selected_registrar_config_methods_virt_pushbutton;
419 static int hf_eapwps_tlv_selected_registrar_config_methods_keypad;
420 static int hf_eapwps_tlv_primary_device_type;
421 static int hf_eapwps_tlv_primary_device_type_category;
422 #define WPS_DEVICE_TYPE_CATEGORY_MAX 11
423 static int hf_eapwps_tlv_primary_device_type_subcategory[WPS_DEVICE_TYPE_CATEGORY_MAX];
424 static int hf_eapwps_tlv_secondary_device_type_list;
425 static int hf_eapwps_tlv_portable_device;
426 static int hf_eapwps_tlv_ap_setup_locked;
427 static int hf_eapwps_tlv_application_extension;
428 static int hf_eapwps_tlv_eap_type;
429 static int hf_eapwps_tlv_initialization_vector;
430 static int hf_eapwps_tlv_key_provided_automatically;
431 static int hf_eapwps_tlv_8021x_enabled;
432 static int hf_eapwps_tlv_appsessionkey;
433 static int hf_eapwps_tlv_weptransmitkey;
434 static int hf_eapwps_tlv_requested_dev_type;
436 static int hf_eapwps_vendor_id;
437 static int hf_eapwps_wfa_ext_id;
438 static int hf_eapwps_wfa_ext_len;
440 static int hf_eapwps_wfa_ext_version2;
441 static int hf_eapwps_wfa_ext_authorizedmacs;
442 static int hf_eapwps_wfa_ext_network_key_shareable;
443 static int hf_eapwps_wfa_ext_request_to_enroll;
444 static int hf_eapwps_wfa_ext_settings_delay_time;
445 static int hf_multi_ap_backhaul_sta;
446 static int hf_multi_ap_backhaul_bss;
447 static int hf_multi_ap_fronthaul_bss;
448 static int hf_multi_ap_teardown_bsses;
449 static int hf_multi_ap_profile1_backhaul_sta_assoc_disallowed;
450 static int hf_multi_ap_profile2_backhaul_sta_assoc_disallowed;
451 static int hf_multi_ap_reserved;
452 static int hf_multi_ap_flags;
453 static int hf_multi_ap_profiles;
454 static int hf_multi_ap_8021q;
456 static int ett_wps_tlv;
457 static int ett_eap_wps_ap_channel;
458 static int ett_eap_wps_association_state;
459 static int ett_eap_wps_authentication_type;
460 static int ett_eap_wps_authentication_type_flags;
461 static int ett_eap_wps_authenticator;
462 static int ett_eap_wps_config_methods;
463 static int ett_eap_wps_configuration_error;
464 static int ett_eap_wps_confirmation_url4;
465 static int ett_eap_wps_confirmation_url6;
466 static int ett_eap_wps_connection_type;
467 static int ett_eap_wps_connection_type_flags;
468 static int ett_eap_wps_credential;
469 static int ett_eap_wps_device_name;
470 static int ett_eap_wps_device_password_id;
471 static int ett_eap_wps_e_hash1;
472 static int ett_eap_wps_e_hash2;
473 static int ett_eap_wps_e_snonce1;
474 static int ett_eap_wps_e_snonce2;
475 static int ett_eap_wps_encrypted_settings;
476 static int ett_eap_wps_encryption_type;
477 static int ett_eap_wps_encryption_type_flags;
478 static int ett_eap_wps_enrollee_nonce;
479 static int ett_eap_wps_feature_id;
480 static int ett_eap_wps_identity;
481 static int ett_eap_wps_identity_proof;
482 static int ett_eap_wps_key_wrap_authenticator;
483 static int ett_eap_wps_key_identifier;
484 static int ett_eap_wps_mac_address;
485 static int ett_eap_wps_manufacturer;
486 static int ett_eap_wps_message_type;
487 static int ett_eap_wps_model_name;
488 static int ett_eap_wps_model_number;
489 static int ett_eap_wps_network_index;
490 static int ett_eap_wps_network_key;
491 static int ett_eap_wps_network_key_index;
492 static int ett_eap_wps_new_device_name;
493 static int ett_eap_wps_new_password;
494 static int ett_eap_wps_oob_device_password;
495 static int ett_eap_wps_os_version;
496 static int ett_eap_wps_power_level;
497 static int ett_eap_wps_psk_current;
498 static int ett_eap_wps_psk_max;
499 static int ett_eap_wps_public_key;
500 static int ett_eap_wps_radio_enabled;
501 static int ett_eap_wps_reboot;
502 static int ett_eap_wps_registrar_current;
503 static int ett_eap_wps_registrar_established;
504 static int ett_eap_wps_registrar_list;
505 static int ett_eap_wps_registrar_max;
506 static int ett_eap_wps_registrar_nonce;
507 static int ett_eap_wps_request_type;
508 static int ett_eap_wps_response_type;
509 static int ett_eap_wps_rf_bands;
510 static int ett_eap_wps_r_hash1;
511 static int ett_eap_wps_r_hash2;
512 static int ett_eap_wps_r_snonce1;
513 static int ett_eap_wps_r_snonce2;
514 static int ett_eap_wps_selected_registrar;
515 static int ett_eap_wps_serial_number;
516 static int ett_eap_wps_wifi_protected_setup_state;
517 static int ett_eap_wps_ssid;
518 static int ett_eap_wps_total_networks;
519 static int ett_eap_wps_uuid_e;
520 static int ett_eap_wps_uuid_r;
521 static int ett_eap_wps_vendor_extension;
522 static int ett_eap_wps_version;
523 static int ett_eap_wps_x509_certificate_request;
524 static int ett_eap_wps_x509_certificate;
525 static int ett_eap_wps_eap_identity;
526 static int ett_eap_wps_message_counter;
527 static int ett_eap_wps_public_key_hash;
528 static int ett_eap_wps_rekey_key;
529 static int ett_eap_wps_key_lifetime;
530 static int ett_eap_wps_permitted_config_methods;
531 static int ett_eap_wps_selected_registrar_config_methods;
532 static int ett_eap_wps_primary_device_type;
533 static int ett_eap_wps_secondary_device_type_list;
534 static int ett_eap_wps_portable_device;
535 static int ett_eap_wps_ap_setup_locked;
536 static int ett_eap_wps_application_extension;
537 static int ett_eap_wps_eap_type;
538 static int ett_eap_wps_initialization_vector;
539 static int ett_eap_wps_key_provided_automatically;
540 static int ett_eap_wps_8021x_enabled;
541 static int ett_eap_wps_appsessionkey;
542 static int ett_eap_wps_weptransmitkey;
543 static int ett_wps_wfa_ext;
544 static int ett_multi_ap_flags;
546 static const value_string eapwps_tlv_association_state_vals[] = {
547 { 0, "Not associated" },
548 { 1, "Connection success" },
549 { 2, "Configuration Failure" },
550 { 3, "Association Failure" },
551 { 4, "IP Failure" },
552 { 0, NULL }
555 #define EAPWPS_AUTHTYPE_OPEN 0x01
556 #define EAPWPS_AUTHTYPE_WPAPSK 0x02
557 #define EAPWPS_AUTHTYPE_SHARED 0x04
558 #define EAPWPS_AUTHTYPE_WPA 0x08
559 #define EAPWPS_AUTHTYPE_WPA2 0x10
560 #define EAPWPS_AUTHTYPE_WPA2PSK 0x20
562 static const value_string eapwps_tlv_authentication_type_vals[] = {
563 { EAPWPS_AUTHTYPE_OPEN, "Open" },
564 { EAPWPS_AUTHTYPE_WPAPSK, "WPA PSK" },
565 { EAPWPS_AUTHTYPE_SHARED, "Shared" },
566 { EAPWPS_AUTHTYPE_WPA, "WPA" },
567 { EAPWPS_AUTHTYPE_WPA2, "WPA2" },
568 { EAPWPS_AUTHTYPE_WPA2PSK, "WPA2 PSK" },
569 { 0, NULL }
572 #define EAPWPS_CONFMETH_USBA 0x0001
573 #define EAPWPS_CONFMETH_ETHERNET 0x0002
574 #define EAPWPS_CONFMETH_LABEL 0x0004
575 #define EAPWPS_CONFMETH_DISPLAY 0x0008
576 #define EAPWPS_CONFMETH_VIRT_DISPLAY 0x2000
577 #define EAPWPS_CONFMETH_PHY_DISPLAY 0x4000
578 #define EAPWPS_CONFMETH_NFCEXT 0x0010
579 #define EAPWPS_CONFMETH_NFCINT 0x0020
580 #define EAPWPS_CONFMETH_NFCINF 0x0040
581 #define EAPWPS_CONFMETH_PUSHBUTTON 0x0080
582 #define EAPWPS_CONFMETH_VIRT_PUSHBUTTON 0x0200
583 #define EAPWPS_CONFMETH_PHY_PUSHBUTTON 0x0400
584 #define EAPWPS_CONFMETH_KEYPAD 0x0100
586 static const value_string eapwps_tlv_configuration_error_vals[] = {
587 { 0, "No Error" },
588 { 1, "OOB Interface Read Error" },
589 { 2, "Decryption CRC Failure" },
590 { 3, "2.4 channel not supported" },
591 { 4, "5.0 channel not supported" },
592 { 5, "Signal too weak" },
593 { 6, "Network auth failure" },
594 { 7, "Network association failure" },
595 { 8, "No DHCP response" },
596 { 9, "Failed DHCP config" },
597 { 10, "IP address conflict" },
598 { 11, "Couldn't connect to Registrar" },
599 { 12, "Multiple PBC sessions detected" },
600 { 13, "Rogue activity suspected" },
601 { 14, "Device busy" },
602 { 15, "Setup locked" },
603 { 16, "Message Timeout" },
604 { 17, "Registration Session Timeout" },
605 { 18, "Device Password Auth Failure" },
606 { 0, NULL }
609 #define EAPWPS_CONNTYPE_ESS 0x1
610 #define EAPWPS_CONNTYPE_IBSS 0x2
612 static const value_string eapwps_tlv_connection_type_vals[] = {
613 { EAPWPS_CONNTYPE_ESS, "ESS" },
614 { EAPWPS_CONNTYPE_IBSS, "IBSS" },
615 { 0, NULL}
618 #define EAPWPS_DEVPW_PIN 0x0
619 #define EAPWPS_DEVPW_USER 0x1
620 #define EAPWPS_DEVPW_MACHINE 0x2
621 #define EAPWPS_DEVPW_REKEY 0x3
622 #define EAPWPS_DEVPW_PUSHBUTTON 0x4
623 #define EAPWPS_DEVPW_REGISTRAR 0x5
625 static const value_string eapwps_tlv_device_password_id_vals[] = {
626 { EAPWPS_DEVPW_PIN, "PIN (default)" },
627 { EAPWPS_DEVPW_USER, "User specified" },
628 { EAPWPS_DEVPW_MACHINE, "Machine specified" },
629 { EAPWPS_DEVPW_REKEY, "Rekey" },
630 { EAPWPS_DEVPW_PUSHBUTTON, "PushButton" },
631 { EAPWPS_DEVPW_REGISTRAR, "Registrar specified" },
632 { 0, NULL }
635 #define EAPWPS_ENCTYPE_NONE 0x1
636 #define EAPWPS_ENCTYPE_WEP 0x2
637 #define EAPWPS_ENCTYPE_TKIP 0x4
638 #define EAPWPS_ENCTYPE_AES 0x8
640 static const value_string eapwps_tlv_encryption_type_vals[] = {
641 { EAPWPS_ENCTYPE_NONE, "none" },
642 { EAPWPS_ENCTYPE_WEP, "WEP" },
643 { EAPWPS_ENCTYPE_TKIP, "TKIP" },
644 { EAPWPS_ENCTYPE_AES, "AES" },
645 { 0, NULL }
648 static const value_string eapwps_tlv_message_type_vals[] = {
649 { 0x01, "Beacon" },
650 { 0x02, "Probe Request" },
651 { 0x03, "Probe Response" },
652 { 0x04, "M1" },
653 { 0x05, "M2" },
654 { 0x06, "M2D" },
655 { 0x07, "M3" },
656 { 0x08, "M4" },
657 { 0x09, "M5" },
658 { 0x0A, "M6" },
659 { 0x0B, "M7" },
660 { 0x0C, "M8" },
661 { 0x0D, "WSC_ACK" },
662 { 0x0E, "WSC_NACK" },
663 { 0x0F, "WSC_DONE" },
664 { 0, NULL }
668 static const value_string eapwps_tlv_request_type_vals[] = {
669 { 0x00, "Enrollee, Info only" },
670 { 0x01, "Enrollee, open 802.1X" },
671 { 0x02, "Registrar" },
672 { 0x03, "WLAN Manager Registrar" },
673 { 0, NULL }
676 static const value_string eapwps_tlv_response_type_vals[] = {
677 { 0x00, "Enrollee, Info only" },
678 { 0x01, "Enrollee, open 802.1X" },
679 { 0x02, "Registrar" },
680 { 0x03, "AP" },
681 { 0, NULL }
684 static const value_string eapwps_tlv_rf_bands_vals[] = {
685 { 0x01, "2.4 GHz" },
686 { 0x02, "5 GHz" },
687 { 0x03, "2.4 and 5 GHz" },
688 { 0, NULL }
691 static const value_string eapwps_tlv_wifi_protected_setup_state[] = {
692 { 0x00, "Reserved" },
693 { 0x01, "Not configured" },
694 { 0x02, "Configured" },
695 { 0, NULL }
698 static const value_string eapwps_tlv_primary_device_type_category[] = {
699 { 0x01, "Computer" },
700 { 0x02, "Input Device" },
701 { 0x03, "Printers, Scanners, Faxes and Copiers" },
702 { 0x04, "Camera" },
703 { 0x05, "Storage" },
704 { 0x06, "Network Infrastructure" },
705 { 0x07, "Displays" },
706 { 0x08, "Multimedia Devices" },
707 { 0x09, "Gaming Devices" },
708 { 0x0A, "Telephone" },
709 { 0x0B, "Audio Devices" },
710 { 0, NULL }
713 static const value_string eapwps_tlv_computer_subcategory[] = {
714 { 0x01, "PC" },
715 { 0x02, "Server" },
716 { 0x03, "Media Center" },
717 { 0x04, "Ultra-mobile PC" },
718 { 0x05, "Notebook" },
719 { 0x06, "Desktop" },
720 { 0x07, "MID (Mobile Internet Device)" },
721 { 0x08, "Netbook" },
722 { 0, NULL }
725 static const value_string eapwps_tlv_input_device_subcategory[] = {
726 { 0x01, "Keyboard" },
727 { 0x02, "Mouse" },
728 { 0x03, "Joystick" },
729 { 0x04, "Trackball" },
730 { 0x05, "Gaming controller" },
731 { 0x06, "Remote" },
732 { 0x07, "Touchscreen" },
733 { 0x08, "Biometric reader" },
734 { 0x09, "Barcode reader" },
735 { 0, NULL }
738 static const value_string eapwps_tlv_printers_scanners_faxes_copiers_subcategory[] = {
739 { 0x01, "Printer or Print Server" },
740 { 0x02, "Scanner" },
741 { 0x03, "Fax" },
742 { 0x04, "Copier" },
743 { 0x05, "All-in-one (Printer, Scanner, Fax, Copier)" },
744 { 0, NULL }
747 static const value_string eapwps_tlv_camera_subcategory[] = {
748 { 0x01, "Digital Still Camera" },
749 { 0x02, "Video Camera" },
750 { 0x03, "Web Camera" },
751 { 0x04, "Security Camera" },
752 { 0, NULL }
755 static const value_string eapwps_tlv_storage_subcategory[] = {
756 { 0x01, "NAS" },
757 { 0, NULL }
760 static const value_string eapwps_tlv_network_infrastructure_subcategory[] = {
761 { 0x01, "AP" },
762 { 0x02, "Router" },
763 { 0x03, "Switch" },
764 { 0x04, "Gateway" },
765 { 0x05, "Bridge" },
766 { 0, NULL }
769 static const value_string eapwps_tlv_displays_subcategory[] = {
770 { 0x01, "Television" },
771 { 0x02, "Electronic Picture Frame" },
772 { 0x03, "Projector" },
773 { 0x04, "Monitor" },
774 { 0, NULL }
777 static const value_string eapwps_tlv_multimedia_devices_subcategory[] = {
778 { 0x01, "DAR" },
779 { 0x02, "PVR" },
780 { 0x03, "MCX" },
781 { 0x04, "Set-top box" },
782 { 0x05, "Media Server/Media Adapter/Media Extender" },
783 { 0x06, "Portable Video Player" },
784 { 0, NULL }
787 static const value_string eapwps_tlv_gaming_devices_subcategory[] = {
788 { 0x01, "Xbox" },
789 { 0x02, "Xbox360" },
790 { 0x03, "Playstation" },
791 { 0x04, "Game Console/Game Console Adapter" },
792 { 0x05, "Portable Gaming Device" },
793 { 0, NULL }
796 static const value_string eapwps_tlv_telephone_subcategory[] = {
797 { 0x01, "Windows Mobile" },
798 { 0x02, "Phone - single mode" },
799 { 0x03, "Phone - dual mode" },
800 { 0x04, "Smartphone - single mode" },
801 { 0x05, "Smartphone - dual mode" },
802 { 0, NULL }
805 static const value_string eapwps_tlv_audio_devices_subcategory[] = {
806 { 0x01, "Audio tuner/receiver" },
807 { 0x02, "Speakers" },
808 { 0x03, "Portable Music Player (PMP)" },
809 { 0x04, "Headset (headphones + microphone)" },
810 { 0x05, "Headphones" },
811 { 0x06, "Microphone" },
812 { 0x07, "Home Theater Systems" },
813 { 0, NULL }
817 static void
818 add_wps_wfa_ext(uint8_t id, proto_tree *tree, tvbuff_t *tvb,
819 int offset, int size)
821 proto_item *item;
822 proto_tree *elem;
823 uint8_t val8;
824 static int * const flags[] = {
825 &hf_multi_ap_backhaul_sta,
826 &hf_multi_ap_backhaul_bss,
827 &hf_multi_ap_fronthaul_bss,
828 &hf_multi_ap_teardown_bsses,
829 &hf_multi_ap_profile1_backhaul_sta_assoc_disallowed,
830 &hf_multi_ap_profile2_backhaul_sta_assoc_disallowed,
831 &hf_multi_ap_reserved,
832 NULL
835 elem = proto_tree_add_subtree(tree, tvb, offset - 2, 2 + size, ett_wps_wfa_ext, &item,
836 val_to_str(id, eapwps_wfa_ext_types, "Unknown (%u)"));
837 proto_tree_add_item(elem, hf_eapwps_wfa_ext_id, tvb, offset - 2, 1, ENC_BIG_ENDIAN);
838 proto_tree_add_item(elem, hf_eapwps_wfa_ext_len, tvb, offset - 1, 1, ENC_BIG_ENDIAN);
840 switch (id) {
841 case WPS_WFA_EXT_VERSION2:
842 val8 = tvb_get_uint8(tvb, offset);
843 proto_item_append_text(item, ": %d.%d", val8 >> 4, val8 & 0x0f);
844 proto_tree_add_item(elem, hf_eapwps_wfa_ext_version2, tvb,
845 offset, 1, ENC_BIG_ENDIAN);
846 break;
847 case WPS_WFA_EXT_AUTHORIZEDMACS:
848 proto_tree_add_item(elem, hf_eapwps_wfa_ext_authorizedmacs,
849 tvb, offset, size, ENC_NA);
850 break;
851 case WPS_WFA_EXT_NETWORK_KEY_SHAREABLE:
852 val8 = tvb_get_uint8(tvb, offset);
853 proto_item_append_text(item, ": %s", val8 ? "TRUE" : "FALSE");
854 proto_tree_add_item(elem, hf_eapwps_wfa_ext_network_key_shareable,
855 tvb, offset, 1, ENC_BIG_ENDIAN);
856 break;
857 case WPS_WFA_EXT_REQUEST_TO_ENROLL:
858 val8 = tvb_get_uint8(tvb, offset);
859 proto_item_append_text(item, ": %s", val8 ? "TRUE" : "FALSE");
860 proto_tree_add_item(elem, hf_eapwps_wfa_ext_request_to_enroll,
861 tvb, offset, 1, ENC_BIG_ENDIAN);
862 break;
863 case WPS_WFA_EXT_SETTINGS_DELAY_TIME:
864 val8 = tvb_get_uint8(tvb, offset);
865 proto_item_append_text(item, ": %d second(s)", val8);
866 proto_tree_add_item(elem, hf_eapwps_wfa_ext_settings_delay_time,
867 tvb, offset, 1, ENC_BIG_ENDIAN);
868 break;
869 case WPS_WFA_EXT_MULTI_AP:
870 proto_tree_add_bitmask(elem, tvb, offset, hf_multi_ap_flags, ett_multi_ap_flags,
871 flags, ENC_NA);
872 offset++;
873 break;
874 case WPS_WFA_EXT_MULTI_AP_PROFILE:
875 proto_tree_add_item(elem, hf_multi_ap_profiles, tvb, offset, 1,
876 ENC_BIG_ENDIAN);
877 break;
878 case WPS_WFA_EXT_MULTI_AP_8021Q:
879 proto_tree_add_item(elem, hf_multi_ap_8021q, tvb, offset, 2,
880 ENC_LITTLE_ENDIAN);
881 break;
882 default:
883 break;
887 static void
888 dissect_wps_wfa_ext(proto_tree *tree, tvbuff_t *tvb,
889 int offset, int size)
891 int pos = offset;
892 int end = offset + size;
893 uint8_t id, len;
895 while (pos + 2 < end) {
896 id = tvb_get_uint8(tvb, pos);
897 len = tvb_get_uint8(tvb, pos + 1);
898 if ((pos + 2 + len) > end)
899 break;
900 pos += 2;
901 add_wps_wfa_ext(id, tree, tvb, pos, len);
902 pos += len;
906 static int
907 dissect_wps_wfa_ext_via_dt(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree,
908 void *data _U_)
910 int size = tvb_reported_length(tvb);
912 dissect_wps_wfa_ext(tree, tvb, 0, size);
914 return size;
917 static void
918 dissect_wps_vendor_ext(proto_tree *tree, tvbuff_t *tvb,
919 int offset, int size)
921 uint32_t vendor_id;
923 if (size < 3)
924 return;
925 vendor_id = tvb_get_ntoh24(tvb, offset);
926 proto_tree_add_item(tree, hf_eapwps_vendor_id, tvb, offset, 3, ENC_BIG_ENDIAN);
927 if (vendor_id == VENDOR_WIFI_ALLIANCE)
928 dissect_wps_wfa_ext(tree, tvb, offset + 3, size - 3);
931 /* ********************************************************************** */
932 /* pinfo may be NULL ! */
933 /* ********************************************************************** */
934 void
935 dissect_wps_tlvs(proto_tree *eap_tree, tvbuff_t *tvb, int offset,
936 int size, packet_info *pinfo)
938 static const char *fmt_warn_too_long = "Value too long (max. %d)";
939 static const char *fmt_length_warn = "Value length not %d";
941 unsigned tlv_len;
942 uint16_t tlv_type;
944 proto_item *tlv_item = NULL; /* the root item */
945 proto_tree *tlv_root = NULL;
946 proto_item *tmp_item = NULL;
948 int hfindex = -1;
950 while(size > 0) {
952 /* incomplete tlv-entry case */
953 if (size < 4) {
954 if ((tmp_item != NULL) && pinfo)
955 expert_add_info(pinfo, tmp_item, &ei_eapwps_packet_too_short);
956 break;
959 tmp_item = NULL;
961 tlv_type = tvb_get_ntohs(tvb, offset);
962 tlv_len = tvb_get_ntohs(tvb, offset+2);
964 /* TOP Node for each TLV-item */
965 tlv_root = proto_tree_add_subtree_format(eap_tree, tvb, offset, tlv_len+4,
966 ett_wps_tlv, &tlv_item, "Unknown Type (0x%04x)", tlv_type);
968 /* analog to Tagged parameters in 802.11 */
969 proto_tree_add_item(tlv_root, hf_eapwps_tlv_type, tvb, offset, 2, ENC_BIG_ENDIAN);
970 proto_tree_add_item(tlv_root, hf_eapwps_tlv_len, tvb, offset+2, 2, ENC_BIG_ENDIAN);
972 switch(tlv_type) {
973 case WPS_TLV_TYPE_AP_CHANNEL:
974 tmp_item = proto_tree_add_item(tlv_root, hf_eapwps_tlv_ap_channel, tvb, offset+4, 2, ENC_BIG_ENDIAN);
975 hfindex = hf_eapwps_tlv_ap_channel;
977 break;
979 case WPS_TLV_TYPE_ASSOCIATION_STATE:
980 tmp_item = proto_tree_add_item(tlv_root, hf_eapwps_tlv_association_state, tvb, offset+4, 2, ENC_BIG_ENDIAN);
981 hfindex = hf_eapwps_tlv_association_state;
983 break;
985 case WPS_TLV_TYPE_AUTHENTICATION_TYPE:
986 tmp_item = proto_tree_add_item(tlv_root, hf_eapwps_tlv_authentication_type, tvb, offset+4, 2, ENC_BIG_ENDIAN);
987 hfindex = hf_eapwps_tlv_authentication_type;
989 break;
991 case WPS_TLV_TYPE_AUTHENTICATION_TYPE_FLAGS:
992 tmp_item = proto_tree_add_item(tlv_root, hf_eapwps_tlv_authentication_type_flags, tvb, offset+4, 2, ENC_BIG_ENDIAN);
993 hfindex = hf_eapwps_tlv_authentication_type_flags;
995 proto_tree_add_item(tlv_root, hf_eapwps_tlv_authentication_type_flags_open, tvb, offset+4, 2, ENC_BIG_ENDIAN);
996 proto_tree_add_item(tlv_root, hf_eapwps_tlv_authentication_type_flags_wpapsk, tvb, offset+4, 2, ENC_BIG_ENDIAN);
997 proto_tree_add_item(tlv_root, hf_eapwps_tlv_authentication_type_flags_shared, tvb, offset+4, 2, ENC_BIG_ENDIAN);
998 proto_tree_add_item(tlv_root, hf_eapwps_tlv_authentication_type_flags_wpa, tvb, offset+4, 2, ENC_BIG_ENDIAN);
999 proto_tree_add_item(tlv_root, hf_eapwps_tlv_authentication_type_flags_wpa2, tvb, offset+4, 2, ENC_BIG_ENDIAN);
1000 proto_tree_add_item(tlv_root, hf_eapwps_tlv_authentication_type_flags_wpa2psk, tvb, offset+4, 2, ENC_BIG_ENDIAN);
1002 break;
1004 case WPS_TLV_TYPE_AUTHENTICATOR:
1005 tmp_item = proto_tree_add_item(tlv_root, hf_eapwps_tlv_authenticator, tvb, offset+4, 8, ENC_NA);
1006 hfindex = hf_eapwps_tlv_authenticator;
1008 proto_item_append_text(tmp_item, " (1st 64 bits of HMAC)");
1009 break;
1011 case WPS_TLV_TYPE_CONFIG_METHODS:
1012 tmp_item = proto_tree_add_item(tlv_root, hf_eapwps_tlv_config_methods, tvb, offset+4, 2, ENC_BIG_ENDIAN);
1013 hfindex = hf_eapwps_tlv_config_methods;
1015 proto_tree_add_item(tlv_root, hf_eapwps_tlv_config_methods_usba, tvb, offset+4, 2, ENC_BIG_ENDIAN);
1016 proto_tree_add_item(tlv_root, hf_eapwps_tlv_config_methods_ethernet, tvb, offset+4, 2, ENC_BIG_ENDIAN);
1017 proto_tree_add_item(tlv_root, hf_eapwps_tlv_config_methods_label, tvb, offset+4, 2, ENC_BIG_ENDIAN);
1018 proto_tree_add_item(tlv_root, hf_eapwps_tlv_config_methods_display, tvb, offset+4, 2, ENC_BIG_ENDIAN);
1019 proto_tree_add_item(tlv_root, hf_eapwps_tlv_config_methods_virt_display, tvb, offset+4, 2, ENC_BIG_ENDIAN);
1020 proto_tree_add_item(tlv_root, hf_eapwps_tlv_config_methods_phy_display, tvb, offset+4, 2, ENC_BIG_ENDIAN);
1021 proto_tree_add_item(tlv_root, hf_eapwps_tlv_config_methods_nfcext, tvb, offset+4, 2, ENC_BIG_ENDIAN);
1022 proto_tree_add_item(tlv_root, hf_eapwps_tlv_config_methods_nfcint, tvb, offset+4, 2, ENC_BIG_ENDIAN);
1023 proto_tree_add_item(tlv_root, hf_eapwps_tlv_config_methods_nfcinf, tvb, offset+4, 2, ENC_BIG_ENDIAN);
1024 proto_tree_add_item(tlv_root, hf_eapwps_tlv_config_methods_pushbutton, tvb, offset+4, 2, ENC_BIG_ENDIAN);
1025 proto_tree_add_item(tlv_root, hf_eapwps_tlv_config_methods_virt_pushbutton, tvb, offset+4, 2, ENC_BIG_ENDIAN);
1026 proto_tree_add_item(tlv_root, hf_eapwps_tlv_config_methods_phy_pushbutton, tvb, offset+4, 2, ENC_BIG_ENDIAN);
1027 proto_tree_add_item(tlv_root, hf_eapwps_tlv_config_methods_keypad, tvb, offset+4, 2, ENC_BIG_ENDIAN);
1029 break;
1031 case WPS_TLV_TYPE_CONFIGURATION_ERROR:
1032 tmp_item = proto_tree_add_item(tlv_root, hf_eapwps_tlv_configuration_error, tvb, offset+4, 2, ENC_BIG_ENDIAN);
1033 hfindex = hf_eapwps_tlv_configuration_error;
1035 break;
1037 case WPS_TLV_TYPE_CONFIRMATION_URL4: /* max len is 64 */
1038 tmp_item = proto_tree_add_item(tlv_root, hf_eapwps_tlv_confirmation_url4, tvb, offset+4, tlv_len, ENC_ASCII);
1039 hfindex = hf_eapwps_tlv_confirmation_url4;
1040 if (tlv_len > 64)
1041 expert_add_info_format(pinfo, tmp_item, &ei_eapwps_fmt_warn_too_long, fmt_warn_too_long, tlv_len);
1043 break;
1045 case WPS_TLV_TYPE_CONFIRMATION_URL6: /* max len is 76 */
1046 tmp_item = proto_tree_add_item(tlv_root, hf_eapwps_tlv_confirmation_url6, tvb, offset+4, tlv_len, ENC_ASCII);
1047 hfindex = hf_eapwps_tlv_confirmation_url6;
1048 if (tlv_len > 76)
1049 expert_add_info_format(pinfo, tmp_item, &ei_eapwps_fmt_warn_too_long, fmt_warn_too_long, tlv_len);
1051 break;
1053 case WPS_TLV_TYPE_CONNECTION_TYPE:
1054 tmp_item = proto_tree_add_item(tlv_root, hf_eapwps_tlv_connection_type, tvb, offset+4, 1, ENC_BIG_ENDIAN);
1055 hfindex = hf_eapwps_tlv_connection_type;
1057 break;
1059 case WPS_TLV_TYPE_CONNECTION_TYPE_FLAGS:
1060 tmp_item = proto_tree_add_item(tlv_root, hf_eapwps_tlv_connection_type_flags, tvb, offset+4, 1, ENC_BIG_ENDIAN);
1061 hfindex = hf_eapwps_tlv_connection_type_flags;
1063 proto_tree_add_item(tlv_root, hf_eapwps_tlv_connection_type_flags_ess, tvb, offset+4, 1, ENC_BIG_ENDIAN);
1064 proto_tree_add_item(tlv_root, hf_eapwps_tlv_connection_type_flags_ibss, tvb, offset+4, 1, ENC_BIG_ENDIAN);
1066 break;
1068 case WPS_TLV_TYPE_CREDENTIAL:
1069 tmp_item = proto_tree_add_item(tlv_root, hf_eapwps_tlv_credential, tvb, offset+4, tlv_len, ENC_NA);
1070 hfindex = hf_eapwps_tlv_credential;
1072 break;
1074 case WPS_TLV_TYPE_DEVICE_NAME: /* len <= 32, check ! */
1075 tmp_item = proto_tree_add_item(tlv_root, hf_eapwps_tlv_device_name, tvb, offset+4, tlv_len, ENC_ASCII);
1076 hfindex = hf_eapwps_tlv_device_name;
1077 if ((tlv_len > 32) && pinfo)
1078 expert_add_info_format(pinfo, tmp_item, &ei_eapwps_fmt_warn_too_long, fmt_warn_too_long, tlv_len);
1080 break;
1082 case WPS_TLV_TYPE_DEVICE_PASSWORD_ID:
1083 tmp_item = proto_tree_add_item(tlv_root, hf_eapwps_tlv_device_password_id, tvb, offset+4, 2, ENC_BIG_ENDIAN);
1084 hfindex = hf_eapwps_tlv_device_password_id;
1086 break;
1088 case WPS_TLV_TYPE_E_HASH1:
1089 /* assert tlv_len == 32 */
1090 tmp_item = proto_tree_add_item(tlv_root, hf_eapwps_tlv_e_hash1, tvb, offset+4, 32, ENC_NA);
1091 hfindex = hf_eapwps_tlv_e_hash1;
1092 if ((tlv_len != 32) && pinfo)
1093 expert_add_info_format(pinfo, tmp_item, &ei_eapwps_fmt_length_warn, fmt_length_warn, 32);
1095 break;
1097 case WPS_TLV_TYPE_E_HASH2:
1098 /* assert tlv_len == 32 */
1099 tmp_item = proto_tree_add_item(tlv_root, hf_eapwps_tlv_e_hash2, tvb, offset+4, 32, ENC_NA);
1100 hfindex = hf_eapwps_tlv_e_hash2;
1101 if ((tlv_len != 32) && pinfo)
1102 expert_add_info_format(pinfo, tmp_item, &ei_eapwps_fmt_length_warn, fmt_length_warn, 32);
1104 break;
1106 case WPS_TLV_TYPE_E_SNONCE1:
1107 /* assert tlv_len == 16 */
1108 tmp_item = proto_tree_add_item(tlv_root, hf_eapwps_tlv_e_snonce1, tvb, offset+4, 16, ENC_NA);
1109 hfindex = hf_eapwps_tlv_e_snonce1;
1110 if ((tlv_len != 16) && pinfo)
1111 expert_add_info_format(pinfo, tmp_item, &ei_eapwps_fmt_length_warn, fmt_length_warn, 16);
1113 break;
1115 case WPS_TLV_TYPE_E_SNONCE2:
1116 tmp_item = proto_tree_add_item(tlv_root, hf_eapwps_tlv_e_snonce2, tvb, offset+4, 16, ENC_NA);
1117 hfindex = hf_eapwps_tlv_e_snonce2;
1118 if ((tlv_len != 16) && pinfo)
1119 expert_add_info_format(pinfo, tmp_item, &ei_eapwps_fmt_length_warn, fmt_length_warn, 16);
1121 break;
1123 case WPS_TLV_TYPE_ENCRYPTED_SETTINGS:
1124 tmp_item = proto_tree_add_item(tlv_root, hf_eapwps_tlv_encrypted_settings, tvb, offset+4, tlv_len, ENC_NA);
1125 hfindex = hf_eapwps_tlv_encrypted_settings;
1127 break;
1129 case WPS_TLV_TYPE_ENCRYPTION_TYPE:
1130 tmp_item = proto_tree_add_item(tlv_root, hf_eapwps_tlv_encryption_type, tvb, offset+4, 2, ENC_BIG_ENDIAN);
1131 hfindex = hf_eapwps_tlv_encryption_type;
1133 break;
1135 case WPS_TLV_TYPE_ENCRYPTION_TYPE_FLAGS:
1136 tmp_item = proto_tree_add_item(tlv_root, hf_eapwps_tlv_encryption_type_flags, tvb, offset+4, 2, ENC_BIG_ENDIAN);
1137 hfindex = hf_eapwps_tlv_encryption_type_flags;
1139 proto_tree_add_item(tlv_root, hf_eapwps_tlv_encryption_type_flags_none, tvb, offset+4, 2, ENC_BIG_ENDIAN);
1140 proto_tree_add_item(tlv_root, hf_eapwps_tlv_encryption_type_flags_wep, tvb, offset+4, 2, ENC_BIG_ENDIAN);
1141 proto_tree_add_item(tlv_root, hf_eapwps_tlv_encryption_type_flags_tkip, tvb, offset+4, 2, ENC_BIG_ENDIAN);
1142 proto_tree_add_item(tlv_root, hf_eapwps_tlv_encryption_type_flags_aes, tvb, offset+4, 2, ENC_BIG_ENDIAN);
1144 break;
1146 case WPS_TLV_TYPE_ENROLLEE_NONCE:
1147 /* assert tlv_len == 16 */
1148 tmp_item = proto_tree_add_item(tlv_root, hf_eapwps_tlv_enrollee_nonce, tvb, offset+4, 16, ENC_NA);
1149 hfindex = hf_eapwps_tlv_enrollee_nonce;
1150 if ((tlv_len != 16) && pinfo)
1151 expert_add_info_format(pinfo, tmp_item, &ei_eapwps_fmt_length_warn, fmt_length_warn, 16);
1153 break;
1155 case WPS_TLV_TYPE_FEATURE_ID:
1156 tmp_item = proto_tree_add_item(tlv_root, hf_eapwps_tlv_feature_id, tvb, offset+4, 4, ENC_BIG_ENDIAN);
1157 hfindex = hf_eapwps_tlv_feature_id;
1159 break;
1161 case WPS_TLV_TYPE_IDENTITY:
1162 /* check that tlv_len <= 80 */
1163 tmp_item = proto_tree_add_item(tlv_root, hf_eapwps_tlv_identity, tvb, offset+4, tlv_len, ENC_ASCII);
1164 hfindex = hf_eapwps_tlv_identity;
1165 if ((tlv_len > 80) && pinfo)
1166 expert_add_info_format(pinfo, tmp_item, &ei_eapwps_fmt_warn_too_long, fmt_warn_too_long, tlv_len);
1168 break;
1170 case WPS_TLV_TYPE_IDENTITY_PROOF:
1171 tmp_item = proto_tree_add_item(tlv_root, hf_eapwps_tlv_identity_proof, tvb, offset+4, tlv_len, ENC_NA);
1172 hfindex = hf_eapwps_tlv_identity_proof;
1174 break;
1176 case WPS_TLV_TYPE_KEY_WRAP_AUTHENTICATOR:
1177 tmp_item = proto_tree_add_item(tlv_root, hf_eapwps_tlv_key_wrap_authenticator, tvb, offset+4, 8, ENC_NA);
1178 hfindex = hf_eapwps_tlv_key_wrap_authenticator;
1180 break;
1182 case WPS_TLV_TYPE_KEY_IDENTIFIER:
1183 tmp_item = proto_tree_add_item(tlv_root, hf_eapwps_tlv_key_identifier, tvb, offset+4, 16, ENC_NA);
1184 hfindex = hf_eapwps_tlv_key_identifier;
1186 break;
1188 case WPS_TLV_TYPE_MAC_ADDRESS:
1189 tmp_item = proto_tree_add_item(tlv_root, hf_eapwps_tlv_mac_address, tvb, offset+4, 6, ENC_NA);
1190 hfindex = hf_eapwps_tlv_mac_address;
1192 break;
1194 case WPS_TLV_TYPE_MANUFACTURER:
1195 /* check tlv_len <= 64 byte */
1196 tmp_item = proto_tree_add_item(tlv_root, hf_eapwps_tlv_manufacturer, tvb, offset+4, tlv_len, ENC_ASCII);
1197 hfindex = hf_eapwps_tlv_manufacturer;
1198 if ((tlv_len > 64) && pinfo)
1199 expert_add_info_format(pinfo, tmp_item, &ei_eapwps_fmt_warn_too_long, fmt_warn_too_long, tlv_len);
1201 break;
1203 case WPS_TLV_TYPE_MESSAGE_TYPE:
1204 tmp_item = proto_tree_add_item(tlv_root, hf_eapwps_tlv_message_type, tvb, offset+4, 1, ENC_BIG_ENDIAN);
1205 hfindex = hf_eapwps_tlv_message_type;
1206 if ((pinfo != NULL))
1207 col_append_fstr(pinfo->cinfo, COL_INFO, ", %s", val_to_str(tvb_get_uint8(tvb, offset+4),
1208 eapwps_tlv_message_type_vals,
1209 "Unknown (0x%02x)"));
1210 break;
1212 case WPS_TLV_TYPE_MODEL_NAME:
1213 /* check tlv_len <= 32 byte */
1214 tmp_item = proto_tree_add_item(tlv_root, hf_eapwps_tlv_model_name, tvb, offset+4, tlv_len, ENC_ASCII);
1215 hfindex = hf_eapwps_tlv_model_name;
1216 if ((tlv_len > 32) && pinfo)
1217 expert_add_info_format(pinfo, tmp_item, &ei_eapwps_fmt_warn_too_long, fmt_warn_too_long, tlv_len);
1219 break;
1221 case WPS_TLV_TYPE_MODEL_NUMBER:
1222 /* check tlv_len <= 32 byte */
1223 tmp_item = proto_tree_add_item(tlv_root, hf_eapwps_tlv_model_number, tvb, offset+4, tlv_len, ENC_ASCII);
1224 hfindex = hf_eapwps_tlv_model_number;
1225 if ((tlv_len > 32) && pinfo)
1226 expert_add_info_format(pinfo, tmp_item, &ei_eapwps_fmt_warn_too_long, fmt_warn_too_long, tlv_len);
1228 break;
1230 case WPS_TLV_TYPE_NETWORK_INDEX:
1231 tmp_item = proto_tree_add_item(tlv_root, hf_eapwps_tlv_network_index, tvb, offset+4, 1, ENC_BIG_ENDIAN);
1232 hfindex = hf_eapwps_tlv_network_index;
1234 break;
1236 case WPS_TLV_TYPE_NETWORK_KEY:
1237 /* check tlv_len <= 64 byte */
1238 tmp_item = proto_tree_add_item(tlv_root, hf_eapwps_tlv_network_key, tvb, offset+4, tlv_len, ENC_NA);
1239 hfindex = hf_eapwps_tlv_network_key;
1240 if ((tlv_len > 64) && pinfo)
1241 expert_add_info_format(pinfo, tmp_item, &ei_eapwps_fmt_warn_too_long, fmt_warn_too_long, tlv_len);
1243 break;
1245 case WPS_TLV_TYPE_NETWORK_KEY_INDEX:
1246 tmp_item = proto_tree_add_item(tlv_root, hf_eapwps_tlv_network_key_index, tvb, offset+4, 1, ENC_BIG_ENDIAN);
1247 hfindex = hf_eapwps_tlv_network_key_index;
1249 break;
1251 case WPS_TLV_TYPE_NEW_DEVICE_NAME:
1252 /* check tlv_len <= 32 byte */
1253 tmp_item = proto_tree_add_item(tlv_root, hf_eapwps_tlv_new_device_name, tvb, offset+4, tlv_len, ENC_NA);
1254 hfindex = hf_eapwps_tlv_new_device_name;
1255 if ((tlv_len > 32) && pinfo)
1256 expert_add_info_format(pinfo, tmp_item, &ei_eapwps_fmt_warn_too_long, fmt_warn_too_long, tlv_len);
1258 break;
1260 case WPS_TLV_TYPE_NEW_PASSWORD:
1261 /* check tlv_len <= 64 byte */
1262 tmp_item = proto_tree_add_item(tlv_root, hf_eapwps_tlv_new_password, tvb, offset+4, tlv_len, ENC_NA);
1263 hfindex = hf_eapwps_tlv_new_password;
1264 if ((tlv_len > 64) && pinfo)
1265 expert_add_info_format(pinfo, tmp_item, &ei_eapwps_fmt_warn_too_long, fmt_warn_too_long, tlv_len);
1267 break;
1269 case WPS_TLV_TYPE_OOB_DEVICE_PASSWORD:
1270 /* check tlv_len <= 56 byte */
1271 tmp_item = proto_tree_add_item(tlv_root, hf_eapwps_tlv_oob_device_password, tvb, offset+4, tlv_len, ENC_NA);
1272 hfindex = hf_eapwps_tlv_oob_device_password;
1273 if ((tlv_len > 56) && pinfo)
1274 expert_add_info_format(pinfo, tmp_item, &ei_eapwps_fmt_warn_too_long, fmt_warn_too_long, tlv_len);
1276 break;
1278 case WPS_TLV_TYPE_OS_VERSION:
1279 tmp_item = proto_tree_add_item(tlv_root, hf_eapwps_tlv_os_version, tvb, offset+4, 4, ENC_BIG_ENDIAN);
1280 hfindex = hf_eapwps_tlv_os_version;
1282 break;
1284 case WPS_TLV_TYPE_POWER_LEVEL:
1285 tmp_item = proto_tree_add_item(tlv_root, hf_eapwps_tlv_power_level, tvb, offset+4, 1, ENC_BIG_ENDIAN);
1286 hfindex = hf_eapwps_tlv_power_level;
1288 break;
1290 case WPS_TLV_TYPE_PSK_CURRENT:
1291 tmp_item = proto_tree_add_item(tlv_root, hf_eapwps_tlv_psk_current, tvb, offset+4, 1, ENC_BIG_ENDIAN);
1292 hfindex = hf_eapwps_tlv_psk_current;
1294 break;
1296 case WPS_TLV_TYPE_PSK_MAX:
1297 tmp_item = proto_tree_add_item(tlv_root, hf_eapwps_tlv_psk_max, tvb, offset+4, 1, ENC_BIG_ENDIAN);
1298 hfindex = hf_eapwps_tlv_psk_max;
1300 break;
1302 case WPS_TLV_TYPE_PUBLIC_KEY:
1303 /* check tlv_len == 192 byte */
1304 tmp_item = proto_tree_add_item(tlv_root, hf_eapwps_tlv_public_key, tvb, offset+4, 192, ENC_NA);
1305 hfindex = hf_eapwps_tlv_public_key;
1306 if ((tlv_len != 192) && pinfo)
1307 expert_add_info_format(pinfo, tmp_item, &ei_eapwps_fmt_length_warn, fmt_length_warn, 192);
1309 break;
1311 case WPS_TLV_TYPE_RADIO_ENABLED:
1312 tmp_item = proto_tree_add_item(tlv_root, hf_eapwps_tlv_radio_enabled, tvb, offset+4, 1, ENC_BIG_ENDIAN);
1313 hfindex = hf_eapwps_tlv_radio_enabled;
1315 break;
1317 case WPS_TLV_TYPE_REBOOT:
1318 tmp_item = proto_tree_add_item(tlv_root, hf_eapwps_tlv_reboot, tvb, offset+4, 1, ENC_BIG_ENDIAN);
1319 hfindex = hf_eapwps_tlv_reboot;
1321 break;
1323 case WPS_TLV_TYPE_REGISTRAR_CURRENT:
1324 tmp_item = proto_tree_add_item(tlv_root, hf_eapwps_tlv_registrar_current, tvb, offset+4, 1, ENC_BIG_ENDIAN);
1325 hfindex = hf_eapwps_tlv_registrar_current;
1327 break;
1329 case WPS_TLV_TYPE_REGISTRAR_ESTABLISHED:
1330 tmp_item = proto_tree_add_item(tlv_root, hf_eapwps_tlv_registrar_established, tvb, offset+4, 1, ENC_BIG_ENDIAN);
1331 hfindex = hf_eapwps_tlv_registrar_established;
1333 break;
1335 case WPS_TLV_TYPE_REGISTRAR_LIST:
1336 /* NYI: list is */
1337 /* - 16 bytes uuid */
1338 /* - NULL-Terminated device name string */
1339 tmp_item = proto_tree_add_item(tlv_root, hf_eapwps_tlv_registrar_list, tvb, offset+4, tlv_len, ENC_NA);
1340 hfindex = hf_eapwps_tlv_registrar_list;
1342 break;
1344 case WPS_TLV_TYPE_REGISTRAR_MAX:
1345 tmp_item = proto_tree_add_item(tlv_root, hf_eapwps_tlv_registrar_max, tvb, offset+4, 1, ENC_BIG_ENDIAN);
1346 hfindex = hf_eapwps_tlv_registrar_max;
1348 break;
1350 case WPS_TLV_TYPE_REGISTRAR_NONCE:
1351 tmp_item = proto_tree_add_item(tlv_root, hf_eapwps_tlv_registrar_nonce, tvb, offset+4, 16, ENC_NA);
1352 hfindex = hf_eapwps_tlv_registrar_nonce;
1354 break;
1356 case WPS_TLV_TYPE_REQUEST_TYPE:
1357 tmp_item = proto_tree_add_item(tlv_root, hf_eapwps_tlv_request_type, tvb, offset+4, 1, ENC_BIG_ENDIAN);
1358 hfindex = hf_eapwps_tlv_request_type;
1360 break;
1362 case WPS_TLV_TYPE_RESPONSE_TYPE:
1363 tmp_item = proto_tree_add_item(tlv_root, hf_eapwps_tlv_response_type, tvb, offset+4, 1, ENC_BIG_ENDIAN);
1364 hfindex = hf_eapwps_tlv_response_type;
1366 break;
1368 case WPS_TLV_TYPE_RF_BANDS:
1369 tmp_item = proto_tree_add_item(tlv_root, hf_eapwps_tlv_rf_bands, tvb, offset+4, 1, ENC_BIG_ENDIAN);
1370 hfindex = hf_eapwps_tlv_rf_bands;
1372 break;
1374 case WPS_TLV_TYPE_R_HASH1:
1375 tmp_item = proto_tree_add_item(tlv_root, hf_eapwps_tlv_r_hash1, tvb, offset+4, 32, ENC_NA);
1376 hfindex = hf_eapwps_tlv_r_hash1;
1378 break;
1380 case WPS_TLV_TYPE_R_HASH2:
1381 tmp_item = proto_tree_add_item(tlv_root, hf_eapwps_tlv_r_hash2, tvb, offset+4, 32, ENC_NA);
1382 hfindex = hf_eapwps_tlv_r_hash2;
1384 break;
1386 case WPS_TLV_TYPE_R_SNONCE1:
1387 tmp_item = proto_tree_add_item(tlv_root, hf_eapwps_tlv_r_snonce1, tvb, offset+4, 16, ENC_NA);
1388 hfindex = hf_eapwps_tlv_r_snonce1;
1390 break;
1392 case WPS_TLV_TYPE_R_SNONCE2:
1393 tmp_item = proto_tree_add_item(tlv_root, hf_eapwps_tlv_r_snonce2, tvb, offset+4, 16, ENC_NA);
1394 hfindex = hf_eapwps_tlv_r_snonce2;
1396 break;
1398 case WPS_TLV_TYPE_SELECTED_REGISTRAR:
1399 tmp_item = proto_tree_add_item(tlv_root, hf_eapwps_tlv_selected_registrar, tvb, offset+4, 1, ENC_BIG_ENDIAN);
1400 hfindex = hf_eapwps_tlv_selected_registrar;
1402 break;
1404 case WPS_TLV_TYPE_SERIAL_NUMBER:
1405 /* check tlv_len <= 32 bytes */
1406 tmp_item = proto_tree_add_item(tlv_root, hf_eapwps_tlv_serial_number, tvb, offset+4, tlv_len, ENC_ASCII);
1407 hfindex = hf_eapwps_tlv_serial_number;
1408 if ((tlv_len > 32) && pinfo)
1409 expert_add_info_format(pinfo, tmp_item, &ei_eapwps_fmt_warn_too_long, fmt_warn_too_long, tlv_len);
1411 break;
1413 case WPS_TLV_TYPE_WIFI_PROTECTED_SETUP_STATE:
1414 tmp_item = proto_tree_add_item(tlv_root, hf_eapwps_tlv_wifi_protected_setup_state, tvb, offset+4, 1, ENC_BIG_ENDIAN);
1415 hfindex = hf_eapwps_tlv_wifi_protected_setup_state;
1417 break;
1419 case WPS_TLV_TYPE_SSID:
1420 /* check tlv_len <= 32 bytes */
1421 tmp_item = proto_tree_add_item(tlv_root, hf_eapwps_tlv_ssid, tvb, offset+4, tlv_len, ENC_ASCII);
1422 hfindex = hf_eapwps_tlv_ssid;
1423 if ((tlv_len > 32) && pinfo)
1424 expert_add_info_format(pinfo, tmp_item, &ei_eapwps_fmt_warn_too_long, fmt_warn_too_long, tlv_len);
1426 break;
1428 case WPS_TLV_TYPE_TOTAL_NETWORKS:
1429 tmp_item = proto_tree_add_item(tlv_root, hf_eapwps_tlv_total_networks, tvb, offset+4, 1, ENC_BIG_ENDIAN);
1430 hfindex = hf_eapwps_tlv_total_networks;
1432 break;
1434 case WPS_TLV_TYPE_UUID_E:
1435 tmp_item = proto_tree_add_item(tlv_root, hf_eapwps_tlv_uuid_e, tvb, offset+4, tlv_len, ENC_NA);
1436 hfindex = hf_eapwps_tlv_uuid_e;
1437 if ((tlv_len > 16) && pinfo)
1438 expert_add_info_format(pinfo, tmp_item, &ei_eapwps_fmt_warn_too_long, fmt_warn_too_long, tlv_len);
1440 break;
1442 case WPS_TLV_TYPE_UUID_R:
1443 tmp_item = proto_tree_add_item(tlv_root, hf_eapwps_tlv_uuid_r, tvb, offset+4, tlv_len, ENC_NA);
1444 hfindex = hf_eapwps_tlv_uuid_r;
1445 if ((tlv_len > 16) && pinfo)
1446 expert_add_info_format(pinfo, tmp_item, &ei_eapwps_fmt_warn_too_long, fmt_warn_too_long, tlv_len);
1448 break;
1450 case WPS_TLV_TYPE_VENDOR_EXTENSION:
1451 tmp_item = proto_tree_add_item(tlv_root, hf_eapwps_tlv_vendor_extension, tvb, offset+4, tlv_len, ENC_NA);
1452 hfindex = hf_eapwps_tlv_vendor_extension;
1454 break;
1456 case WPS_TLV_TYPE_VERSION:
1457 tmp_item = proto_tree_add_item(tlv_root, hf_eapwps_tlv_version, tvb, offset+4, 1, ENC_BIG_ENDIAN);
1458 hfindex = hf_eapwps_tlv_version;
1460 break;
1462 case WPS_TLV_TYPE_X509_CERTIFICATE_REQUEST:
1463 tmp_item = proto_tree_add_item(tlv_root, hf_eapwps_tlv_x509_certificate_request, tvb, offset+4, tlv_len, ENC_NA);
1464 hfindex = hf_eapwps_tlv_x509_certificate_request;
1466 break;
1468 case WPS_TLV_TYPE_X509_CERTIFICATE:
1469 tmp_item = proto_tree_add_item(tlv_root, hf_eapwps_tlv_x509_certificate, tvb, offset+4, tlv_len, ENC_NA);
1470 hfindex = hf_eapwps_tlv_x509_certificate;
1472 break;
1474 case WPS_TLV_TYPE_EAP_IDENTITY:
1475 /* check tlv_len <= 64 byte */
1476 tmp_item = proto_tree_add_item(tlv_root, hf_eapwps_tlv_eap_identity, tvb, offset+4, tlv_len, ENC_NA);
1477 hfindex = hf_eapwps_tlv_eap_identity;
1478 if ((tlv_len > 64) && pinfo)
1479 expert_add_info_format(pinfo, tmp_item, &ei_eapwps_fmt_warn_too_long, fmt_warn_too_long, tlv_len);
1481 break;
1483 case WPS_TLV_TYPE_MESSAGE_COUNTER:
1484 tmp_item = proto_tree_add_item(tlv_root, hf_eapwps_tlv_message_counter, tvb, offset+4, 8, ENC_BIG_ENDIAN);
1485 hfindex = hf_eapwps_tlv_message_counter;
1487 break;
1489 case WPS_TLV_TYPE_PUBLIC_KEY_HASH:
1490 tmp_item = proto_tree_add_item(tlv_root, hf_eapwps_tlv_public_key_hash, tvb, offset+4, 20, ENC_NA);
1491 hfindex = hf_eapwps_tlv_public_key_hash;
1493 break;
1495 case WPS_TLV_TYPE_REKEY_KEY:
1496 tmp_item = proto_tree_add_item(tlv_root, hf_eapwps_tlv_rekey_key, tvb, offset+4, 32, ENC_NA);
1497 hfindex = hf_eapwps_tlv_rekey_key;
1499 break;
1501 case WPS_TLV_TYPE_KEY_LIFETIME:
1502 tmp_item = proto_tree_add_item(tlv_root, hf_eapwps_tlv_key_lifetime, tvb, offset+4, 4, ENC_BIG_ENDIAN);
1503 hfindex = hf_eapwps_tlv_key_lifetime;
1505 break;
1507 case WPS_TLV_TYPE_PERMITTED_CONFIG_METHODS:
1508 tmp_item = proto_tree_add_item(tlv_root, hf_eapwps_tlv_permitted_config_methods, tvb, offset+4, 2, ENC_BIG_ENDIAN);
1509 hfindex = hf_eapwps_tlv_permitted_config_methods;
1511 proto_tree_add_item(tlv_root, hf_eapwps_tlv_permitted_config_methods_usba, tvb, offset+4, 2, ENC_BIG_ENDIAN);
1512 proto_tree_add_item(tlv_root, hf_eapwps_tlv_permitted_config_methods_ethernet, tvb, offset+4, 2, ENC_BIG_ENDIAN);
1513 proto_tree_add_item(tlv_root, hf_eapwps_tlv_permitted_config_methods_label, tvb, offset+4, 2, ENC_BIG_ENDIAN);
1514 proto_tree_add_item(tlv_root, hf_eapwps_tlv_permitted_config_methods_display, tvb, offset+4, 2, ENC_BIG_ENDIAN);
1515 proto_tree_add_item(tlv_root, hf_eapwps_tlv_permitted_config_methods_virt_display, tvb, offset+4, 2, ENC_BIG_ENDIAN);
1516 proto_tree_add_item(tlv_root, hf_eapwps_tlv_permitted_config_methods_phy_display, tvb, offset+4, 2, ENC_BIG_ENDIAN);
1517 proto_tree_add_item(tlv_root, hf_eapwps_tlv_permitted_config_methods_nfcext, tvb, offset+4, 2, ENC_BIG_ENDIAN);
1518 proto_tree_add_item(tlv_root, hf_eapwps_tlv_permitted_config_methods_nfcint, tvb, offset+4, 2, ENC_BIG_ENDIAN);
1519 proto_tree_add_item(tlv_root, hf_eapwps_tlv_permitted_config_methods_nfcinf, tvb, offset+4, 2, ENC_BIG_ENDIAN);
1520 proto_tree_add_item(tlv_root, hf_eapwps_tlv_permitted_config_methods_pushbutton, tvb, offset+4, 2, ENC_BIG_ENDIAN);
1521 proto_tree_add_item(tlv_root, hf_eapwps_tlv_permitted_config_methods_virt_pushbutton, tvb, offset+4, 2, ENC_BIG_ENDIAN);
1522 proto_tree_add_item(tlv_root, hf_eapwps_tlv_permitted_config_methods_phy_pushbutton, tvb, offset+4, 2, ENC_BIG_ENDIAN);
1523 proto_tree_add_item(tlv_root, hf_eapwps_tlv_permitted_config_methods_keypad, tvb, offset+4, 2, ENC_BIG_ENDIAN);
1525 break;
1527 case WPS_TLV_TYPE_SELECTED_REGISTRAR_CONFIG_METHODS:
1528 tmp_item = proto_tree_add_item(tlv_root, hf_eapwps_tlv_selected_registrar_config_methods, tvb, offset+4, 2, ENC_BIG_ENDIAN);
1529 hfindex = hf_eapwps_tlv_selected_registrar_config_methods;
1531 proto_tree_add_item(tlv_root, hf_eapwps_tlv_selected_registrar_config_methods_usba, tvb, offset+4, 2, ENC_BIG_ENDIAN);
1532 proto_tree_add_item(tlv_root, hf_eapwps_tlv_selected_registrar_config_methods_ethernet, tvb, offset+4, 2, ENC_BIG_ENDIAN);
1533 proto_tree_add_item(tlv_root, hf_eapwps_tlv_selected_registrar_config_methods_label, tvb, offset+4, 2, ENC_BIG_ENDIAN);
1534 proto_tree_add_item(tlv_root, hf_eapwps_tlv_selected_registrar_config_methods_display, tvb, offset+4, 2, ENC_BIG_ENDIAN);
1535 proto_tree_add_item(tlv_root, hf_eapwps_tlv_selected_registrar_config_methods_virt_display, tvb, offset+4, 2, ENC_BIG_ENDIAN);
1536 proto_tree_add_item(tlv_root, hf_eapwps_tlv_selected_registrar_config_methods_phy_display, tvb, offset+4, 2, ENC_BIG_ENDIAN);
1537 proto_tree_add_item(tlv_root, hf_eapwps_tlv_selected_registrar_config_methods_nfcext, tvb, offset+4, 2, ENC_BIG_ENDIAN);
1538 proto_tree_add_item(tlv_root, hf_eapwps_tlv_selected_registrar_config_methods_nfcint, tvb, offset+4, 2, ENC_BIG_ENDIAN);
1539 proto_tree_add_item(tlv_root, hf_eapwps_tlv_selected_registrar_config_methods_nfcinf, tvb, offset+4, 2, ENC_BIG_ENDIAN);
1540 proto_tree_add_item(tlv_root, hf_eapwps_tlv_selected_registrar_config_methods_pushbutton, tvb, offset+4, 2, ENC_BIG_ENDIAN);
1541 proto_tree_add_item(tlv_root, hf_eapwps_tlv_selected_registrar_config_methods_virt_pushbutton, tvb, offset+4, 2, ENC_BIG_ENDIAN);
1542 proto_tree_add_item(tlv_root, hf_eapwps_tlv_selected_registrar_config_methods_phy_pushbutton, tvb, offset+4, 2, ENC_BIG_ENDIAN);
1543 proto_tree_add_item(tlv_root, hf_eapwps_tlv_selected_registrar_config_methods_keypad, tvb, offset+4, 2, ENC_BIG_ENDIAN);
1545 break;
1547 case WPS_TLV_TYPE_PRIMARY_DEVICE_TYPE:
1548 tmp_item = proto_tree_add_item(tlv_root, hf_eapwps_tlv_primary_device_type, tvb, offset+4, 8, ENC_NA);
1549 hfindex = hf_eapwps_tlv_primary_device_type;
1550 if (tvb_get_ntohl(tvb, offset+6) == WFA_OUI) {
1551 uint16_t dev_cat = tvb_get_ntohs(tvb, offset+4);
1552 if ((dev_cat > 0) && (dev_cat <= WPS_DEVICE_TYPE_CATEGORY_MAX)) {
1553 proto_tree_add_item(tlv_root, hf_eapwps_tlv_primary_device_type_category, tvb, offset+4, 2, ENC_BIG_ENDIAN);
1554 proto_tree_add_item(tlv_root, hf_eapwps_tlv_primary_device_type_subcategory[dev_cat-1], tvb, offset+10, 2, ENC_BIG_ENDIAN);
1558 break;
1560 case WPS_TLV_TYPE_SECONDARY_DEVICE_TYPE_LIST:
1561 /* check tlv_len <= 128 byte */
1562 tmp_item = proto_tree_add_item(tlv_root, hf_eapwps_tlv_secondary_device_type_list, tvb, offset+4, tlv_len, ENC_NA);
1563 hfindex = hf_eapwps_tlv_secondary_device_type_list;
1564 if ((tlv_len > 128) && pinfo)
1565 expert_add_info_format(pinfo, tmp_item, &ei_eapwps_fmt_warn_too_long, fmt_warn_too_long, tlv_len);
1567 break;
1569 case WPS_TLV_TYPE_PORTABLE_DEVICE:
1570 tmp_item = proto_tree_add_item(tlv_root, hf_eapwps_tlv_portable_device, tvb, offset+4, 1, ENC_BIG_ENDIAN);
1571 hfindex = hf_eapwps_tlv_portable_device;
1573 break;
1575 case WPS_TLV_TYPE_AP_SETUP_LOCKED:
1576 tmp_item = proto_tree_add_item(tlv_root, hf_eapwps_tlv_ap_setup_locked, tvb, offset+4, 1, ENC_BIG_ENDIAN);
1577 hfindex = hf_eapwps_tlv_ap_setup_locked;
1579 break;
1581 case WPS_TLV_TYPE_APPLICATION_EXTENSION:
1582 /* check tlv_len <= 512 byte */
1583 tmp_item = proto_tree_add_item(tlv_root, hf_eapwps_tlv_application_extension, tvb, offset+4, tlv_len, ENC_NA);
1584 hfindex = hf_eapwps_tlv_application_extension;
1585 if ((tlv_len > 512) && pinfo)
1586 expert_add_info_format(pinfo, tmp_item, &ei_eapwps_fmt_warn_too_long, fmt_warn_too_long, tlv_len);
1588 break;
1590 case WPS_TLV_TYPE_EAP_TYPE:
1591 /* check tlv_len <= 8 byte */
1592 tmp_item = proto_tree_add_item(tlv_root, hf_eapwps_tlv_eap_type, tvb, offset+4, tlv_len, ENC_NA);
1593 hfindex = hf_eapwps_tlv_eap_type;
1594 if ((tlv_len > 8) && pinfo)
1595 expert_add_info_format(pinfo, tmp_item, &ei_eapwps_fmt_warn_too_long, fmt_warn_too_long, tlv_len);
1597 break;
1599 case WPS_TLV_TYPE_INITIALIZATION_VECTOR:
1600 tmp_item = proto_tree_add_item(tlv_root, hf_eapwps_tlv_initialization_vector, tvb, offset+4, 32, ENC_NA);
1601 hfindex = hf_eapwps_tlv_initialization_vector;
1603 break;
1605 case WPS_TLV_TYPE_KEY_PROVIDED_AUTOMATICALLY:
1606 tmp_item = proto_tree_add_item(tlv_root, hf_eapwps_tlv_key_provided_automatically, tvb, offset+4, 1, ENC_BIG_ENDIAN);
1607 hfindex = hf_eapwps_tlv_key_provided_automatically;
1609 break;
1611 case WPS_TLV_TYPE_8021X_ENABLED:
1612 tmp_item = proto_tree_add_item(tlv_root, hf_eapwps_tlv_8021x_enabled, tvb, offset+4, 1, ENC_BIG_ENDIAN);
1613 hfindex = hf_eapwps_tlv_8021x_enabled;
1615 break;
1617 case WPS_TLV_TYPE_APPSESSIONKEY:
1618 /* check tlv_len <= 128 byte */
1619 tmp_item = proto_tree_add_item(tlv_root, hf_eapwps_tlv_appsessionkey, tvb, offset+4, tlv_len, ENC_NA);
1620 hfindex = hf_eapwps_tlv_appsessionkey;
1621 if ((tlv_len > 128) && pinfo)
1622 expert_add_info_format(pinfo, tmp_item, &ei_eapwps_fmt_warn_too_long, fmt_warn_too_long, tlv_len);
1624 break;
1626 case WPS_TLV_TYPE_WEPTRANSMITKEY:
1627 tmp_item = proto_tree_add_item(tlv_root, hf_eapwps_tlv_weptransmitkey, tvb, offset+4, 1, ENC_BIG_ENDIAN);
1628 hfindex = hf_eapwps_tlv_weptransmitkey;
1630 break;
1632 case WPS_TLV_TYPE_REQUESTED_DEV_TYPE:
1633 tmp_item = proto_tree_add_item(tlv_root,
1634 hf_eapwps_tlv_requested_dev_type, tvb,
1635 offset + 4, 8, ENC_NA);
1636 hfindex = hf_eapwps_tlv_requested_dev_type;
1637 break;
1639 default:
1640 /* do something useful ? */
1641 tmp_item = NULL;
1642 hfindex = -1;
1645 if ((tmp_item != NULL) && (tlv_item != NULL)) {
1646 /* make the tree look nicer :-)
1647 tmp_item -> a proto_item specific to the _value_
1648 tlv_item -> root-item grouping
1649 - "Data Element Type"
1650 - "Date Element Length"
1651 - tmp_item */
1652 uint32_t value = -1;
1653 void *valuep = NULL;
1654 header_field_info *hf_info = NULL;
1655 const char *fmt = NULL;
1657 proto_item_set_text(tlv_item, "%s",
1658 val_to_str(tlv_type, eapwps_tlv_types, "Unknown (0x%04x)"));
1660 /* Rendered strings for value. Thanks to Stig Bjorlykke */
1661 hf_info = proto_registrar_get_nth(hfindex);
1662 if (hf_info != NULL) {
1663 switch(hf_info->type) {
1664 case FT_UINT8:
1665 fmt = hf_info->strings ? ": %s (0x%02x)": ": 0x%02x";
1666 value = tvb_get_uint8 (tvb, offset+4);
1667 break;
1668 case FT_UINT16:
1669 fmt = hf_info->strings ? ": %s (0x%04x)": ": 0x%04x";
1670 value = tvb_get_ntohs (tvb, offset+4);
1671 break;
1672 case FT_UINT32:
1673 fmt = hf_info->strings ? ": %s (0x%08x)": ": 0x%08x";
1674 value = tvb_get_ntohl (tvb, offset+4);
1675 break;
1676 case FT_STRING:
1677 fmt = ": %s";
1678 valuep = tvb_get_string_enc(wmem_packet_scope(), tvb, offset+4, tlv_len, ENC_ASCII);
1679 break;
1680 default:
1681 /* make compiler happy */
1682 break;
1686 if ((hf_info != NULL) && hf_info->strings) {
1687 /* item has value_string */
1688 proto_item_append_text(tlv_item, fmt, val_to_str(value,
1689 (const value_string *)hf_info->strings,
1690 "Unknown: %d"), value);
1691 } else if (valuep != NULL) {
1692 /* the string-case */
1693 proto_item_append_text(tlv_item, fmt, valuep);
1694 } else if (fmt != NULL) {
1695 /* field is FT_UINT(8|16|32) but has no value_string */
1696 proto_item_append_text(tlv_item, fmt, value);
1697 } else {
1698 /* field is either FT_ETHER or FT_BYTES, don't do anything */
1703 if (tlv_type == WPS_TLV_TYPE_VENDOR_EXTENSION)
1704 dissect_wps_vendor_ext(tlv_root, tvb, offset + 4, tlv_len);
1706 offset += tlv_len + 2 + 2;
1707 size -= tlv_len + 2 + 2;
1711 /********************************************************************** */
1712 /********************************************************************** */
1714 static int
1715 dissect_wps(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_)
1717 proto_item *pi;
1718 proto_tree *pt;
1719 uint8_t flags;
1720 int offset;
1721 int size;
1723 offset = 0;
1724 size = tvb_captured_length(tvb);
1726 pi = proto_tree_add_item(tree, hf_eapwps_opcode, tvb, offset, 1, ENC_BIG_ENDIAN);
1727 offset += 1; size -= 1;
1729 pi = proto_item_get_parent(pi);
1730 if (pi != NULL)
1731 proto_item_append_text(pi, " (Wifi Alliance, WifiProtectedSetup)");
1732 if (pinfo != NULL)
1733 col_append_str(pinfo->cinfo, COL_INFO, ", WPS");
1735 /* Flag field, if msg-len flag set, add appropriate field */
1736 flags = tvb_get_uint8(tvb,offset);
1737 pi = proto_tree_add_item(tree, hf_eapwps_flags, tvb, offset, 1, ENC_BIG_ENDIAN);
1738 pt = proto_item_add_subtree(pi, ett_eap_wps_flags);
1740 proto_tree_add_item(pt, hf_eapwps_flag_mf, tvb, offset, 1, ENC_BIG_ENDIAN);
1741 proto_tree_add_item(pt, hf_eapwps_flag_lf, tvb, offset, 1, ENC_BIG_ENDIAN);
1742 offset += 1; size -= 1;
1744 if (flags & MASK_WSC_FLAG_LF) {
1745 /* length field is present in first eap-packet when msg is fragmented */
1746 proto_tree_add_item(tree, hf_eapwps_msglen, tvb, offset, 2, ENC_BIG_ENDIAN);
1747 offset += 2; size -= 2;
1750 dissect_wps_tlvs(tree, tvb, offset, size, pinfo);
1752 return size;
1755 /********************************************************************** */
1756 /********************************************************************** */
1757 void
1758 proto_register_wps(void)
1760 static hf_register_info hf[] = {
1762 /* These data-elements are sent in EAP-Pakets using expanded types */
1763 /* (see RFC3748 Section 5.7) */
1764 /* Paket dissections is done here and not in (packet-eap) as */
1765 /* both (tlvs and fields named eap.wps.*) are defined by */
1766 /* WifiAlliance */
1767 { &hf_eapwps_opcode,
1768 { "Opcode", "eap.wps.code",
1769 FT_UINT8, BASE_DEC, VALS(eapwps_opcode_vals), 0x0, "WSC Message Type", HFILL }},
1771 { &hf_eapwps_flags,
1772 { "Flags", "eap.wps.flags",
1773 FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL }},
1775 { &hf_eapwps_flag_mf,
1776 { "More flag", "eap.wps.flags.more",
1777 FT_BOOLEAN, 8, NULL, MASK_WSC_FLAG_MF, NULL, HFILL }},
1779 { &hf_eapwps_flag_lf,
1780 { "Length field present", "eap.wps.flags.length",
1781 FT_BOOLEAN, 8, NULL, MASK_WSC_FLAG_LF, NULL, HFILL }},
1783 { &hf_eapwps_msglen,
1784 { "Length field", "eap.wps.msglen",
1785 FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL }},
1787 /* TLV encoded data which may be contained in */
1788 /* 802.11 Management frames and EAP-extended type */
1789 { &hf_eapwps_tlv_type,
1790 { "Data Element Type", "wps.type",
1791 FT_UINT16, BASE_HEX, VALS(eapwps_tlv_types), 0x0, NULL, HFILL }},
1793 { &hf_eapwps_tlv_len,
1794 { "Data Element Length", "wps.length",
1795 FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL }},
1798 { &hf_eapwps_tlv_ap_channel,
1799 { "AP Channel", "wps.ap_channel",
1800 FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL }},
1802 { &hf_eapwps_tlv_association_state,
1803 { "Association State", "wps.association_state",
1804 FT_UINT16, BASE_HEX, VALS(eapwps_tlv_association_state_vals), 0x0, NULL, HFILL }},
1807 { &hf_eapwps_tlv_authentication_type,
1808 { "Authentication Type", "wps.authentication_type",
1809 FT_UINT16, BASE_HEX, VALS(eapwps_tlv_authentication_type_vals), 0x0, NULL, HFILL }},
1811 { &hf_eapwps_tlv_authentication_type_flags,
1812 { "Authentication Type Flags", "wps.authentication_type_flags",
1813 FT_UINT16, BASE_HEX, NULL, 0x0, NULL, HFILL }},
1815 { &hf_eapwps_tlv_authentication_type_flags_open,
1816 { "Open", "wps.authentication_type.open",
1817 FT_UINT16, BASE_HEX, NULL, EAPWPS_AUTHTYPE_OPEN, NULL, HFILL }},
1819 { &hf_eapwps_tlv_authentication_type_flags_wpapsk,
1820 { "WPA PSK", "wps.authentication_type.wpapsk",
1821 FT_UINT16, BASE_HEX, NULL, EAPWPS_AUTHTYPE_WPAPSK, NULL, HFILL }},
1823 { &hf_eapwps_tlv_authentication_type_flags_shared,
1824 { "Shared", "wps.authentication_type.shared",
1825 FT_UINT16, BASE_HEX, NULL, EAPWPS_AUTHTYPE_SHARED, NULL, HFILL }},
1827 { &hf_eapwps_tlv_authentication_type_flags_wpa,
1828 { "WPA", "wps.authentication_type.wpa",
1829 FT_UINT16, BASE_HEX, NULL, EAPWPS_AUTHTYPE_WPA, NULL, HFILL }},
1831 { &hf_eapwps_tlv_authentication_type_flags_wpa2,
1832 { "WPA2", "wps.authentication_type.wpa2",
1833 FT_UINT16, BASE_HEX, NULL, EAPWPS_AUTHTYPE_WPA2, NULL, HFILL }},
1835 { &hf_eapwps_tlv_authentication_type_flags_wpa2psk,
1836 { "WPA2PSK", "wps.authentication_type.wpa2psk",
1837 FT_UINT16, BASE_HEX, NULL, EAPWPS_AUTHTYPE_WPA2PSK, NULL, HFILL }},
1840 { &hf_eapwps_tlv_authenticator,
1841 { "Authenticator", "wps.authenticator",
1842 FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL }},
1845 { &hf_eapwps_tlv_config_methods,
1846 { "Configuration Methods", "wps.config_methods",
1847 FT_UINT16, BASE_HEX, NULL, 0x0, NULL, HFILL }},
1849 { &hf_eapwps_tlv_config_methods_usba,
1850 { "USB", "wps.config_methods.usba",
1851 FT_UINT16, BASE_HEX, NULL, EAPWPS_CONFMETH_USBA, NULL, HFILL }},
1853 { &hf_eapwps_tlv_config_methods_ethernet,
1854 { "Ethernet", "wps.config_methods.ethernet",
1855 FT_UINT16, BASE_HEX, NULL, EAPWPS_CONFMETH_ETHERNET, NULL, HFILL }},
1857 { &hf_eapwps_tlv_config_methods_label,
1858 { "Label", "wps.config_methods.label",
1859 FT_UINT16, BASE_HEX, NULL, EAPWPS_CONFMETH_LABEL, NULL, HFILL }},
1861 { &hf_eapwps_tlv_config_methods_display,
1862 { "Display", "wps.config_methods.display",
1863 FT_UINT16, BASE_HEX, NULL, EAPWPS_CONFMETH_DISPLAY, NULL, HFILL }},
1865 { &hf_eapwps_tlv_config_methods_virt_display,
1866 { "Virtual Display", "wps.config_methods.virt_display",
1867 FT_UINT16, BASE_HEX, NULL, EAPWPS_CONFMETH_VIRT_DISPLAY, NULL, HFILL }},
1869 { &hf_eapwps_tlv_config_methods_phy_display,
1870 { "Physical Display", "wps.config_methods.phy_display",
1871 FT_UINT16, BASE_HEX, NULL, EAPWPS_CONFMETH_PHY_DISPLAY, NULL, HFILL }},
1873 { &hf_eapwps_tlv_config_methods_nfcext,
1874 { "External NFC", "wps.config_methods.nfcext",
1875 FT_UINT16, BASE_HEX, NULL, EAPWPS_CONFMETH_NFCEXT, NULL, HFILL }},
1877 { &hf_eapwps_tlv_config_methods_nfcint,
1878 { "Internal NFC", "wps.config_methods.nfcint",
1879 FT_UINT16, BASE_HEX, NULL, EAPWPS_CONFMETH_NFCINT, NULL, HFILL }},
1881 { &hf_eapwps_tlv_config_methods_nfcinf,
1882 { "NFC Interface", "wps.config_methods.nfcinf",
1883 FT_UINT16, BASE_HEX, NULL, EAPWPS_CONFMETH_NFCINF, NULL, HFILL }},
1885 { &hf_eapwps_tlv_config_methods_pushbutton,
1886 { "Push Button", "wps.config_methods.pushbutton",
1887 FT_UINT16, BASE_HEX, NULL, EAPWPS_CONFMETH_PUSHBUTTON, NULL, HFILL }},
1889 { &hf_eapwps_tlv_config_methods_virt_pushbutton,
1890 { "Virtual Push Button", "wps.config_methods.virt_pushbutton",
1891 FT_UINT16, BASE_HEX, NULL, EAPWPS_CONFMETH_VIRT_PUSHBUTTON, NULL, HFILL }},
1893 { &hf_eapwps_tlv_config_methods_phy_pushbutton,
1894 { "Physical Push Button", "wps.config_methods.phy_pushbutton",
1895 FT_UINT16, BASE_HEX, NULL, EAPWPS_CONFMETH_PHY_PUSHBUTTON, NULL, HFILL }},
1897 { &hf_eapwps_tlv_config_methods_keypad,
1898 { "Keypad", "wps.config_methods.keypad",
1899 FT_UINT16, BASE_HEX, NULL, EAPWPS_CONFMETH_KEYPAD, NULL, HFILL }},
1902 { &hf_eapwps_tlv_configuration_error,
1903 { "Configuration Error", "wps.configuration_error",
1904 FT_UINT16, BASE_HEX, VALS(eapwps_tlv_configuration_error_vals), 0x0, NULL, HFILL }},
1906 { &hf_eapwps_tlv_confirmation_url4,
1907 { "Confirmation URL4", "wps.confirmation_url4",
1908 FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL }},
1910 { &hf_eapwps_tlv_confirmation_url6,
1911 { "Confirmation URL6", "wps.confirmation_url6",
1912 FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL }},
1915 { &hf_eapwps_tlv_connection_type,
1916 { "Connection Type", "wps.connection_type",
1917 FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL }},
1919 { &hf_eapwps_tlv_connection_type_flags,
1920 { "Connection Types", "wps.connection_type_flags",
1921 FT_UINT8, BASE_HEX, VALS(eapwps_tlv_connection_type_vals), 0x0, NULL, HFILL }},
1923 { &hf_eapwps_tlv_connection_type_flags_ess,
1924 { "ESS", "wps.connection_type_flags.ess",
1925 FT_UINT8, BASE_HEX, NULL, EAPWPS_CONNTYPE_ESS, NULL, HFILL }},
1927 { &hf_eapwps_tlv_connection_type_flags_ibss,
1928 { "IBSS", "wps.connection_type_flags.ibss",
1929 FT_UINT8, BASE_HEX, NULL, EAPWPS_CONNTYPE_IBSS, NULL, HFILL }},
1932 { &hf_eapwps_tlv_credential, /* Encrypted */
1933 { "Credential", "wps.credential",
1934 FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL }},
1937 { &hf_eapwps_tlv_device_name,
1938 { "Device Name", "wps.device_name",
1939 FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL }},
1941 { &hf_eapwps_tlv_device_password_id,
1942 { "Device Password ID", "wps.device_password_id",
1943 FT_UINT16, BASE_HEX, VALS(eapwps_tlv_device_password_id_vals), 0x0, NULL, HFILL }},
1946 { &hf_eapwps_tlv_e_hash1,
1947 { "Enrollee Hash 1", "wps.e_hash1",
1948 FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL }},
1950 { &hf_eapwps_tlv_e_hash2,
1951 { "Enrollee Hash 2", "wps.e_hash2",
1952 FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL }},
1954 { &hf_eapwps_tlv_e_snonce1,
1955 { "Enrollee SNounce 1", "wps.e_snonce1",
1956 FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL }},
1958 { &hf_eapwps_tlv_e_snonce2,
1959 { "Enrollee SNounce 2", "wps.e_snonce2",
1960 FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL }},
1963 { &hf_eapwps_tlv_encrypted_settings, /* Encrypted ! */
1964 { "Encrypted Settings", "wps.encrypted_settings",
1965 FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL }},
1968 { &hf_eapwps_tlv_encryption_type,
1969 { "Encryption Type", "wps.encryption_type",
1970 FT_UINT16, BASE_HEX, VALS(eapwps_tlv_encryption_type_vals), 0x0, NULL, HFILL }},
1972 { &hf_eapwps_tlv_encryption_type_flags,
1973 { "Encryption Type Flags", "wps.encryption_type_flags",
1974 FT_UINT16, BASE_HEX, NULL, 0x0, NULL, HFILL }},
1976 { &hf_eapwps_tlv_encryption_type_flags_none,
1977 { "None", "wps.encryption_type_flags.none",
1978 FT_UINT16, BASE_HEX, NULL, EAPWPS_ENCTYPE_NONE, NULL, HFILL }},
1980 { &hf_eapwps_tlv_encryption_type_flags_wep,
1981 { "WEP", "wps.encryption_type_flags.wep",
1982 FT_UINT16, BASE_HEX, NULL, EAPWPS_ENCTYPE_WEP, NULL, HFILL }},
1984 { &hf_eapwps_tlv_encryption_type_flags_tkip,
1985 { "TKIP", "wps.encryption_type_flags.tkip",
1986 FT_UINT16, BASE_HEX, NULL, EAPWPS_ENCTYPE_TKIP, NULL, HFILL }},
1988 { &hf_eapwps_tlv_encryption_type_flags_aes,
1989 { "AES", "wps.encryption_type_flags.aes",
1990 FT_UINT16, BASE_HEX, NULL, EAPWPS_ENCTYPE_AES, NULL, HFILL }},
1993 { &hf_eapwps_tlv_enrollee_nonce,
1994 { "Enrollee Nonce", "wps.enrollee_nonce",
1995 FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL }},
1997 { &hf_eapwps_tlv_feature_id,
1998 { "Feature ID", "wps.feature_id",
1999 FT_UINT32, BASE_HEX, NULL, 0x0, NULL, HFILL }},
2002 { &hf_eapwps_tlv_identity,
2003 { "Identity", "wps.identity",
2004 FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL }},
2006 { &hf_eapwps_tlv_identity_proof, /* Encrypted ! */
2007 { "Identity Proof", "wps.identity_proof",
2008 FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL }},
2011 { &hf_eapwps_tlv_key_wrap_authenticator,
2012 { "Key Wrap Authenticator", "wps.key_wrap_authenticator",
2013 FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL }},
2015 { &hf_eapwps_tlv_key_identifier,
2016 { "Key Identifier", "wps.key_identifier",
2017 FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL }},
2020 { &hf_eapwps_tlv_mac_address,
2021 { "MAC", "wps.mac_address",
2022 FT_ETHER, BASE_NONE, NULL, 0x0, NULL, HFILL }},
2024 { &hf_eapwps_tlv_manufacturer,
2025 { "Manufacturer", "wps.manufacturer",
2026 FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL }},
2028 { &hf_eapwps_tlv_message_type,
2029 { "Message Type", "wps.message_type",
2030 FT_UINT8, BASE_HEX, VALS(eapwps_tlv_message_type_vals), 0x0, NULL, HFILL }},
2033 { &hf_eapwps_tlv_model_name,
2034 { "Model Name", "wps.model_name",
2035 FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL }},
2037 { &hf_eapwps_tlv_model_number,
2038 { "Model Number", "wps.model_number",
2039 FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL }},
2042 { &hf_eapwps_tlv_network_index,
2043 { "Network Index", "wps.network_index",
2044 FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL }},
2047 { &hf_eapwps_tlv_network_key,
2048 { "Network Key", "wps.network_key",
2049 FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL }},
2051 { &hf_eapwps_tlv_network_key_index,
2052 { "Network Key Index", "wps.network_key_index",
2053 FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL }},
2056 { &hf_eapwps_tlv_new_device_name,
2057 { "New Device Name", "wps.new_device_name",
2058 FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL }},
2060 { &hf_eapwps_tlv_new_password,
2061 { "New Password", "wps.new_password",
2062 FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL }},
2064 { &hf_eapwps_tlv_oob_device_password,
2065 { "OOB Device Password", "wps.oob_device_password",
2066 FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL }},
2069 { &hf_eapwps_tlv_os_version,
2070 { "OS Version", "wps.os_version",
2071 FT_UINT32, BASE_HEX, NULL, 0x0, NULL, HFILL }},
2073 { &hf_eapwps_tlv_power_level,
2074 { "Power Level", "wps.power_level",
2075 FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL }},
2078 { &hf_eapwps_tlv_psk_current,
2079 { "PSK Current", "wps.psk_current",
2080 FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL }},
2082 { &hf_eapwps_tlv_psk_max,
2083 { "PSK Max", "wps.psk_max",
2084 FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL }},
2087 { &hf_eapwps_tlv_public_key,
2088 { "Public Key", "wps.public_key",
2089 FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL }},
2091 { &hf_eapwps_tlv_radio_enabled, /* Add info */
2092 { "Radio Enabled", "wps.radio_enabled",
2093 FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL }},
2094 { &hf_eapwps_tlv_reboot, /* Add info */
2095 { "Reboot", "wps.reboot",
2096 FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL }},
2098 { &hf_eapwps_tlv_registrar_current,
2099 { "Registrar current", "wps.registrar_current",
2100 FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL }},
2101 { &hf_eapwps_tlv_registrar_established, /* Add info */
2102 { "Registrar established", "wps.registrar_established",
2103 FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL }},
2104 { &hf_eapwps_tlv_registrar_list,
2105 { "Registrar list", "wps.registrar_list",
2106 FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL }},
2107 { &hf_eapwps_tlv_registrar_max,
2108 { "Registrar max", "wps.registrar_max",
2109 FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL }},
2110 { &hf_eapwps_tlv_registrar_nonce,
2111 { "Registrar Nonce", "wps.registrar_nonce",
2112 FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL }},
2114 { &hf_eapwps_tlv_request_type,
2115 { "Request Type", "wps.request_type",
2116 FT_UINT8, BASE_HEX, VALS(eapwps_tlv_request_type_vals), 0x0, NULL, HFILL }},
2117 { &hf_eapwps_tlv_response_type,
2118 { "Response Type", "wps.response_type",
2119 FT_UINT8, BASE_HEX, VALS(eapwps_tlv_response_type_vals), 0x0, NULL, HFILL }},
2121 { &hf_eapwps_tlv_rf_bands,
2122 { "RF Bands", "wps.rf_bands",
2123 FT_UINT8, BASE_HEX, VALS(eapwps_tlv_rf_bands_vals), 0x0, NULL, HFILL }},
2126 { &hf_eapwps_tlv_r_hash1,
2127 { "Registrar Hash 1", "wps.r_hash1",
2128 FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL }},
2130 { &hf_eapwps_tlv_r_hash2,
2131 { "Registrar Hash 2", "wps.r_hash2",
2132 FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL }},
2134 { &hf_eapwps_tlv_r_snonce1,
2135 { "Registrar Snonce1", "wps.r_snonce1",
2136 FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL }},
2138 { &hf_eapwps_tlv_r_snonce2,
2139 { "Registrar Snonce 2", "wps.r_snonce2",
2140 FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL }},
2143 { &hf_eapwps_tlv_selected_registrar,
2144 { "Selected Registrar", "wps.selected_registrar",
2145 FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL }},
2147 { &hf_eapwps_tlv_serial_number,
2148 { "Serial Number", "wps.serial_number",
2149 FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL }},
2151 { &hf_eapwps_tlv_wifi_protected_setup_state,
2152 { "Wifi Protected Setup State", "wps.wifi_protected_setup_state",
2153 FT_UINT8, BASE_HEX, VALS(eapwps_tlv_wifi_protected_setup_state), 0x0, NULL, HFILL }},
2155 { &hf_eapwps_tlv_ssid,
2156 { "SSID", "wps.ssid",
2157 FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL }},
2159 { &hf_eapwps_tlv_total_networks,
2160 { "Total Networks", "wps.total_networks",
2161 FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL }},
2164 { &hf_eapwps_tlv_uuid_e,
2165 { "UUID Enrollee", "wps.uuid_e",
2166 FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL }},
2168 { &hf_eapwps_tlv_uuid_r,
2169 { "UUID Registrar", "wps.uuid_r",
2170 FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL }},
2173 { &hf_eapwps_tlv_vendor_extension,
2174 { "Vendor Extension", "wps.vendor_extension",
2175 FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL }},
2177 { &hf_eapwps_tlv_version,
2178 { "Version", "wps.version",
2179 FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL }},
2181 { &hf_eapwps_tlv_x509_certificate_request,
2182 { "X509 Certificate Request", "wps.x509_certificate_request",
2183 FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL }},
2184 { &hf_eapwps_tlv_x509_certificate,
2185 { "X509 Certificate", "wps.x509_certificate",
2186 FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL }},
2188 { &hf_eapwps_tlv_eap_identity,
2189 { "EAP Identity", "wps.eap_identity",
2190 FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL }},
2192 { &hf_eapwps_tlv_message_counter,
2193 { "Message Counter", "wps.message_counter",
2194 FT_UINT64, BASE_HEX, NULL, 0x0, NULL, HFILL }},
2196 { &hf_eapwps_tlv_public_key_hash,
2197 { "Public Key Hash", "wps.public_key_hash",
2198 FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL }},
2200 { &hf_eapwps_tlv_rekey_key,
2201 { "Rekey Key", "wps.rekey_key",
2202 FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL }},
2203 { &hf_eapwps_tlv_key_lifetime,
2204 { "Key Lifetime", "wps.key_lifetime",
2205 FT_UINT32, BASE_HEX, NULL, 0x0, NULL, HFILL }},
2207 { &hf_eapwps_tlv_permitted_config_methods,
2208 { "Permitted COnfig Methods", "wps.permitted_config_methods",
2209 FT_UINT16, BASE_HEX, NULL, 0x0, NULL, HFILL }},
2211 { &hf_eapwps_tlv_permitted_config_methods_usba,
2212 { "USB", "wps.permitted_config_methods.usba",
2213 FT_UINT16, BASE_HEX, NULL, EAPWPS_CONFMETH_USBA, NULL, HFILL }},
2215 { &hf_eapwps_tlv_permitted_config_methods_ethernet,
2216 { "Ethernet", "wps.permitted_config_methods.ethernet",
2217 FT_UINT16, BASE_HEX, NULL, EAPWPS_CONFMETH_ETHERNET, NULL, HFILL }},
2219 { &hf_eapwps_tlv_permitted_config_methods_label,
2220 { "Label", "wps.permitted_config_methods.label",
2221 FT_UINT16, BASE_HEX, NULL, EAPWPS_CONFMETH_LABEL, NULL, HFILL }},
2223 { &hf_eapwps_tlv_permitted_config_methods_display,
2224 { "Display", "wps.permitted_config_methods.display",
2225 FT_UINT16, BASE_HEX, NULL, EAPWPS_CONFMETH_DISPLAY, NULL, HFILL }},
2227 { &hf_eapwps_tlv_permitted_config_methods_virt_display,
2228 { "Virtual Display", "wps.permitted_config_methods.virt_display",
2229 FT_UINT16, BASE_HEX, NULL, EAPWPS_CONFMETH_VIRT_DISPLAY, NULL, HFILL }},
2231 { &hf_eapwps_tlv_permitted_config_methods_phy_display,
2232 { "Physical Display", "wps.permitted_config_methods.phy_display",
2233 FT_UINT16, BASE_HEX, NULL, EAPWPS_CONFMETH_PHY_DISPLAY, NULL, HFILL }},
2235 { &hf_eapwps_tlv_permitted_config_methods_nfcext,
2236 { "External NFC", "wps.permitted_config_methods.nfcext",
2237 FT_UINT16, BASE_HEX, NULL, EAPWPS_CONFMETH_NFCEXT, NULL, HFILL }},
2239 { &hf_eapwps_tlv_permitted_config_methods_nfcint,
2240 { "Internal NFC", "wps.permitted_config_methods.nfcint",
2241 FT_UINT16, BASE_HEX, NULL, EAPWPS_CONFMETH_NFCINT, NULL, HFILL }},
2243 { &hf_eapwps_tlv_permitted_config_methods_nfcinf,
2244 { "NFC Interface", "wps.permitted_config_methods.nfcinf",
2245 FT_UINT16, BASE_HEX, NULL, EAPWPS_CONFMETH_NFCINF, NULL, HFILL }},
2247 { &hf_eapwps_tlv_permitted_config_methods_pushbutton,
2248 { "Push Button", "wps.permitted_config_methods.pushbutton",
2249 FT_UINT16, BASE_HEX, NULL, EAPWPS_CONFMETH_PUSHBUTTON, NULL, HFILL }},
2251 { &hf_eapwps_tlv_permitted_config_methods_virt_pushbutton,
2252 { "Virtual Push Button", "wps.permitted_config_methods.virt_pushbutton",
2253 FT_UINT16, BASE_HEX, NULL, EAPWPS_CONFMETH_VIRT_PUSHBUTTON, NULL, HFILL }},
2255 { &hf_eapwps_tlv_permitted_config_methods_phy_pushbutton,
2256 { "Physical Push Button", "wps.permitted_config_methods.phy_pushbutton",
2257 FT_UINT16, BASE_HEX, NULL, EAPWPS_CONFMETH_PHY_PUSHBUTTON, NULL, HFILL }},
2259 { &hf_eapwps_tlv_permitted_config_methods_keypad,
2260 { "Keypad", "wps.permitted_config_methods.keypad",
2261 FT_UINT16, BASE_HEX, NULL, EAPWPS_CONFMETH_KEYPAD, NULL, HFILL }},
2263 { &hf_eapwps_tlv_selected_registrar_config_methods,
2264 { "Selected Registrar Config Methods", "wps.selected_registrar_config_methods",
2265 FT_UINT16, BASE_HEX, NULL, 0x0, NULL, HFILL }},
2267 { &hf_eapwps_tlv_selected_registrar_config_methods_usba,
2268 { "USB", "wps.selected_registrar_config_methods.usba",
2269 FT_UINT16, BASE_HEX, NULL, EAPWPS_CONFMETH_USBA, NULL, HFILL }},
2271 { &hf_eapwps_tlv_selected_registrar_config_methods_ethernet,
2272 { "Ethernet", "wps.selected_registrar_config_methods.ethernet",
2273 FT_UINT16, BASE_HEX, NULL, EAPWPS_CONFMETH_ETHERNET, NULL, HFILL }},
2275 { &hf_eapwps_tlv_selected_registrar_config_methods_label,
2276 { "Label", "wps.selected_registrar_config_methods.label",
2277 FT_UINT16, BASE_HEX, NULL, EAPWPS_CONFMETH_LABEL, NULL, HFILL }},
2279 { &hf_eapwps_tlv_selected_registrar_config_methods_display,
2280 { "Display", "wps.selected_registrar_config_methods.display",
2281 FT_UINT16, BASE_HEX, NULL, EAPWPS_CONFMETH_DISPLAY, NULL, HFILL }},
2283 { &hf_eapwps_tlv_selected_registrar_config_methods_virt_display,
2284 { "Virtual Display", "wps.selected_registrar_config_methods.virt_display",
2285 FT_UINT16, BASE_HEX, NULL, EAPWPS_CONFMETH_VIRT_DISPLAY, NULL, HFILL }},
2287 { &hf_eapwps_tlv_selected_registrar_config_methods_phy_display,
2288 { "Physical Display", "wps.selected_registrar_config_methods.phy_display",
2289 FT_UINT16, BASE_HEX, NULL, EAPWPS_CONFMETH_PHY_DISPLAY, NULL, HFILL }},
2291 { &hf_eapwps_tlv_selected_registrar_config_methods_nfcext,
2292 { "External NFC", "wps.selected_registrar_config_methods.nfcext",
2293 FT_UINT16, BASE_HEX, NULL, EAPWPS_CONFMETH_NFCEXT, NULL, HFILL }},
2295 { &hf_eapwps_tlv_selected_registrar_config_methods_nfcint,
2296 { "Internal NFC", "wps.selected_registrar_config_methods.nfcint",
2297 FT_UINT16, BASE_HEX, NULL, EAPWPS_CONFMETH_NFCINT, NULL, HFILL }},
2299 { &hf_eapwps_tlv_selected_registrar_config_methods_nfcinf,
2300 { "NFC Interface", "wps.selected_registrar_config_methods.nfcinf",
2301 FT_UINT16, BASE_HEX, NULL, EAPWPS_CONFMETH_NFCINF, NULL, HFILL }},
2303 { &hf_eapwps_tlv_selected_registrar_config_methods_pushbutton,
2304 { "Push Button", "wps.selected_registrar_config_methods.pushbutton",
2305 FT_UINT16, BASE_HEX, NULL, EAPWPS_CONFMETH_PUSHBUTTON, NULL, HFILL }},
2307 { &hf_eapwps_tlv_selected_registrar_config_methods_virt_pushbutton,
2308 { "Virtual Push Button", "wps.selected_registrar_config_methods.virt_pushbutton",
2309 FT_UINT16, BASE_HEX, NULL, EAPWPS_CONFMETH_VIRT_PUSHBUTTON, NULL, HFILL }},
2311 { &hf_eapwps_tlv_selected_registrar_config_methods_phy_pushbutton,
2312 { "Physical Push Button", "wps.selected_registrar_config_methods.phy_pushbutton",
2313 FT_UINT16, BASE_HEX, NULL, EAPWPS_CONFMETH_PHY_PUSHBUTTON, NULL, HFILL }},
2315 { &hf_eapwps_tlv_selected_registrar_config_methods_keypad,
2316 { "Keypad", "wps.selected_registrar_config_methods.keypad",
2317 FT_UINT16, BASE_HEX, NULL, EAPWPS_CONFMETH_KEYPAD, NULL, HFILL }},
2319 { &hf_eapwps_tlv_primary_device_type,
2320 { "Primary Device Type", "wps.primary_device_type",
2321 FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL }},
2323 { &hf_eapwps_tlv_primary_device_type_category,
2324 { "Category", "wps.primary_device_type.category",
2325 FT_UINT16, BASE_HEX, VALS(eapwps_tlv_primary_device_type_category), 0x0, NULL, HFILL }},
2327 { &hf_eapwps_tlv_primary_device_type_subcategory[0],
2328 { "Subcategory", "wps.primary_device_type.subcategory_computer",
2329 FT_UINT16, BASE_HEX, VALS(eapwps_tlv_computer_subcategory), 0x0, NULL, HFILL }},
2331 { &hf_eapwps_tlv_primary_device_type_subcategory[1],
2332 { "Subcategory", "wps.primary_device_type.subcategory_input_device",
2333 FT_UINT16, BASE_HEX, VALS(eapwps_tlv_input_device_subcategory), 0x0, NULL, HFILL }},
2335 { &hf_eapwps_tlv_primary_device_type_subcategory[2],
2336 { "Subcategory", "wps.primary_device_type.subcategory_printers_scanners_faxes_copiers",
2337 FT_UINT16, BASE_HEX, VALS(eapwps_tlv_printers_scanners_faxes_copiers_subcategory), 0x0, NULL, HFILL }},
2339 { &hf_eapwps_tlv_primary_device_type_subcategory[3],
2340 { "Subcategory", "wps.primary_device_type.subcategory_camera",
2341 FT_UINT16, BASE_HEX, VALS(eapwps_tlv_camera_subcategory), 0x0, NULL, HFILL }},
2343 { &hf_eapwps_tlv_primary_device_type_subcategory[4],
2344 { "Subcategory", "wps.primary_device_type.subcategory_storage",
2345 FT_UINT16, BASE_HEX, VALS(eapwps_tlv_storage_subcategory), 0x0, NULL, HFILL }},
2347 { &hf_eapwps_tlv_primary_device_type_subcategory[5],
2348 { "Subcategory", "wps.primary_device_type.subcategory_network_infrastructure",
2349 FT_UINT16, BASE_HEX, VALS(eapwps_tlv_network_infrastructure_subcategory), 0x0, NULL, HFILL }},
2351 { &hf_eapwps_tlv_primary_device_type_subcategory[6],
2352 { "Subcategory", "wps.primary_device_type.subcategory_displays",
2353 FT_UINT16, BASE_HEX, VALS(eapwps_tlv_displays_subcategory), 0x0, NULL, HFILL }},
2355 { &hf_eapwps_tlv_primary_device_type_subcategory[7],
2356 { "Subcategory", "wps.primary_device_type.subcategory_multimedia_devices",
2357 FT_UINT16, BASE_HEX, VALS(eapwps_tlv_multimedia_devices_subcategory), 0x0, NULL, HFILL }},
2359 { &hf_eapwps_tlv_primary_device_type_subcategory[8],
2360 { "Subcategory", "wps.primary_device_type.subcategory_gaming_devices",
2361 FT_UINT16, BASE_HEX, VALS(eapwps_tlv_gaming_devices_subcategory), 0x0, NULL, HFILL }},
2363 { &hf_eapwps_tlv_primary_device_type_subcategory[9],
2364 { "Subcategory", "wps.primary_device_type.subcategory_telephone",
2365 FT_UINT16, BASE_HEX, VALS(eapwps_tlv_telephone_subcategory), 0x0, NULL, HFILL }},
2367 { &hf_eapwps_tlv_primary_device_type_subcategory[10],
2368 { "Subcategory", "wps.primary_device_type.subcategory_audio_devices",
2369 FT_UINT16, BASE_HEX, VALS(eapwps_tlv_audio_devices_subcategory), 0x0, NULL, HFILL }},
2372 { &hf_eapwps_tlv_secondary_device_type_list,
2373 { "Secondary Device Type List", "wps.secondary_device_type_list",
2374 FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL }},
2376 { &hf_eapwps_tlv_portable_device, /* Add info */
2377 { "Portable Device", "wps.portable_device",
2378 FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL }},
2380 { &hf_eapwps_tlv_ap_setup_locked, /* Add info */
2381 { "AP Setup Locked", "wps.ap_setup_locked",
2382 FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL }},
2384 { &hf_eapwps_tlv_application_extension,
2385 { "Application Extension", "wps.application_extension",
2386 FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL }},
2388 { &hf_eapwps_tlv_eap_type,
2389 { "EAP Type", "wps.eap_type",
2390 FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL }},
2392 { &hf_eapwps_tlv_initialization_vector,
2393 { "Initialization Vector", "wps.initialization_vector",
2394 FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL }},
2396 { &hf_eapwps_tlv_key_provided_automatically, /* Add info */
2397 { "Key Provided Automatically", "wps.key_provided_automatically",
2398 FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL }},
2400 { &hf_eapwps_tlv_8021x_enabled, /* Add info */
2401 { "8021x Enabled", "wps.8021x_enabled",
2402 FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL }},
2404 { &hf_eapwps_tlv_appsessionkey,
2405 { "AppSessionKey", "wps.appsessionkey",
2406 FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL }},
2408 { &hf_eapwps_tlv_weptransmitkey,
2409 { "WEP Transmit Key", "wps.weptransmitkey",
2410 FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL }},
2412 { &hf_eapwps_tlv_requested_dev_type,
2413 { "Requested Device Type", "wps.requested_dev_type",
2414 FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL }},
2416 { &hf_eapwps_vendor_id,
2417 { "Vendor ID", "wps.vendor_id",
2418 FT_UINT24, BASE_DEC, NULL, 0x0, NULL, HFILL }},
2420 { &hf_eapwps_wfa_ext_id,
2421 { "WFA Extension Subelement ID", "wps.ext.id",
2422 FT_UINT8, BASE_DEC, VALS(eapwps_wfa_ext_types), 0x0, NULL, HFILL }},
2424 { &hf_eapwps_wfa_ext_len,
2425 { "WFA Extension Subelement Length", "wps.ext.len",
2426 FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }},
2428 { &hf_eapwps_wfa_ext_version2,
2429 { "Version2", "wps.ext.version2",
2430 FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL }},
2432 { &hf_eapwps_wfa_ext_authorizedmacs,
2433 { "AuthorizedMACs", "wps.ext.authorizedmacs",
2434 FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL }},
2436 { &hf_eapwps_wfa_ext_network_key_shareable,
2437 { "Network Key Shareable", "wps.ext.network_key_shareable",
2438 FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL }},
2440 { &hf_eapwps_wfa_ext_request_to_enroll,
2441 { "Request to Enroll", "wps.ext.request_to_enroll",
2442 FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL }},
2444 { &hf_eapwps_wfa_ext_settings_delay_time,
2445 { "Settings Delay Time", "wps.ext.settings_delay_time",
2446 FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL }},
2448 { &hf_multi_ap_backhaul_sta,
2449 { "Backhaul STA", "wps.ext.multi_ap.backhaul_sta",
2450 FT_BOOLEAN, 8, TFS(&tfs_present_not_present), 0x80, NULL, HFILL }},
2452 { &hf_multi_ap_backhaul_bss,
2453 { "Backhaul BSS", "wps.ext.multi_ap.backhaul_bss",
2454 FT_BOOLEAN, 8, TFS(&tfs_present_not_present), 0x40, NULL, HFILL }},
2456 { &hf_multi_ap_fronthaul_bss,
2457 { "Fronthaul BSS", "wps.ext.multi_ap.fronthaul_bss",
2458 FT_BOOLEAN, 8, TFS(&tfs_present_not_present), 0x20, NULL, HFILL }},
2460 { &hf_multi_ap_teardown_bsses,
2461 { "Teardown", "wps.ext.multi_ap.teardown",
2462 FT_BOOLEAN, 8, TFS(&tfs_required_not_required), 0x10, NULL, HFILL }},
2464 { &hf_multi_ap_profile1_backhaul_sta_assoc_disallowed,
2465 { "Profile-1 Backhaul STA association disallowed", "wps.ext.multi_ap.profile1_backhaul_sta_disallowed",
2466 FT_BOOLEAN, 8, TFS(&tfs_present_not_present), 0x08, NULL, HFILL }},
2468 { &hf_multi_ap_profile2_backhaul_sta_assoc_disallowed,
2469 { "Profile-2 Backhaul STA association disallowed", "wps.ext.multi_ap.profile2_backhaul_sta_disallowed",
2470 FT_BOOLEAN, 8, TFS(&tfs_present_not_present), 0x04, NULL, HFILL }},
2472 { &hf_multi_ap_reserved,
2473 { "Reserved", "wps.ext.multi_ap.reserved",
2474 FT_UINT8, BASE_HEX, NULL, 0x03, NULL, HFILL }},
2476 { &hf_multi_ap_flags,
2477 { "Multi-AP Flags", "wps.ext.multi_ap_flags",
2478 FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL }},
2480 { &hf_multi_ap_profiles,
2481 { "Multi-AP Profile", "wps.ext.multi_ap_profile",
2482 FT_UINT8, BASE_HEX, VALS(wps_wfa_ext_multi_ap_profiles_vals), 0x0, NULL,
2483 HFILL }},
2485 { &hf_multi_ap_8021q,
2486 { "Primary VLAN ID", "wps.ext.primary_vlan_id",
2487 FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL }},
2489 static int *ett[] = {
2490 &ett_eap_wps_attr,
2491 &ett_eap_wps_flags,
2492 /* EAP WPS */
2493 &ett_wps_tlv,
2494 &ett_eap_wps_ap_channel,
2495 &ett_eap_wps_association_state,
2496 &ett_eap_wps_authentication_type,
2497 &ett_eap_wps_authentication_type_flags,
2498 &ett_eap_wps_authenticator,
2499 &ett_eap_wps_config_methods,
2500 &ett_eap_wps_configuration_error,
2501 &ett_eap_wps_confirmation_url4,
2502 &ett_eap_wps_confirmation_url6,
2503 &ett_eap_wps_connection_type,
2504 &ett_eap_wps_connection_type_flags,
2505 &ett_eap_wps_credential,
2506 &ett_eap_wps_device_name,
2507 &ett_eap_wps_device_password_id,
2508 &ett_eap_wps_e_hash1,
2509 &ett_eap_wps_e_hash2,
2510 &ett_eap_wps_e_snonce1,
2511 &ett_eap_wps_e_snonce2,
2512 &ett_eap_wps_encrypted_settings,
2513 &ett_eap_wps_encryption_type,
2514 &ett_eap_wps_encryption_type_flags,
2515 &ett_eap_wps_enrollee_nonce,
2516 &ett_eap_wps_feature_id,
2517 &ett_eap_wps_identity,
2518 &ett_eap_wps_identity_proof,
2519 &ett_eap_wps_key_wrap_authenticator,
2520 &ett_eap_wps_key_identifier,
2521 &ett_eap_wps_mac_address,
2522 &ett_eap_wps_manufacturer,
2523 &ett_eap_wps_message_type,
2524 &ett_eap_wps_model_name,
2525 &ett_eap_wps_model_number,
2526 &ett_eap_wps_network_index,
2527 &ett_eap_wps_network_key,
2528 &ett_eap_wps_network_key_index,
2529 &ett_eap_wps_new_device_name,
2530 &ett_eap_wps_new_password,
2531 &ett_eap_wps_oob_device_password,
2532 &ett_eap_wps_os_version,
2533 &ett_eap_wps_power_level,
2534 &ett_eap_wps_psk_current,
2535 &ett_eap_wps_psk_max,
2536 &ett_eap_wps_public_key,
2537 &ett_eap_wps_radio_enabled,
2538 &ett_eap_wps_reboot,
2539 &ett_eap_wps_registrar_current,
2540 &ett_eap_wps_registrar_established,
2541 &ett_eap_wps_registrar_list,
2542 &ett_eap_wps_registrar_max,
2543 &ett_eap_wps_registrar_nonce,
2544 &ett_eap_wps_request_type,
2545 &ett_eap_wps_response_type,
2546 &ett_eap_wps_rf_bands,
2547 &ett_eap_wps_r_hash1,
2548 &ett_eap_wps_r_hash2,
2549 &ett_eap_wps_r_snonce1,
2550 &ett_eap_wps_r_snonce2,
2551 &ett_eap_wps_selected_registrar,
2552 &ett_eap_wps_serial_number,
2553 &ett_eap_wps_wifi_protected_setup_state,
2554 &ett_eap_wps_ssid,
2555 &ett_eap_wps_total_networks,
2556 &ett_eap_wps_uuid_e,
2557 &ett_eap_wps_uuid_r,
2558 &ett_eap_wps_vendor_extension,
2559 &ett_eap_wps_version,
2560 &ett_eap_wps_x509_certificate_request,
2561 &ett_eap_wps_x509_certificate,
2562 &ett_eap_wps_eap_identity,
2563 &ett_eap_wps_message_counter,
2564 &ett_eap_wps_public_key_hash,
2565 &ett_eap_wps_rekey_key,
2566 &ett_eap_wps_key_lifetime,
2567 &ett_eap_wps_permitted_config_methods,
2568 &ett_eap_wps_selected_registrar_config_methods,
2569 &ett_eap_wps_primary_device_type,
2570 &ett_eap_wps_secondary_device_type_list,
2571 &ett_eap_wps_portable_device,
2572 &ett_eap_wps_ap_setup_locked,
2573 &ett_eap_wps_application_extension,
2574 &ett_eap_wps_eap_type,
2575 &ett_eap_wps_initialization_vector,
2576 &ett_eap_wps_key_provided_automatically,
2577 &ett_eap_wps_8021x_enabled,
2578 &ett_eap_wps_appsessionkey,
2579 &ett_eap_wps_weptransmitkey,
2580 &ett_wps_wfa_ext,
2581 &ett_multi_ap_flags,
2584 static ei_register_info ei[] = {
2585 { &ei_eapwps_packet_too_short, { "wps.packet_too_short", PI_MALFORMED, PI_ERROR, "Packet too short", EXPFILL }},
2586 { &ei_eapwps_fmt_warn_too_long, { "wps.length.value_too_long", PI_MALFORMED, PI_ERROR, "Value too long", EXPFILL }},
2587 { &ei_eapwps_fmt_length_warn, { "wps.length.too_long", PI_MALFORMED, PI_ERROR, "Value length not X", EXPFILL }},
2590 expert_module_t* expert_wps;
2592 proto_wps = proto_register_protocol("Wifi Protected Setup",
2593 "WPS", "wps");
2594 proto_register_field_array(proto_wps, hf, array_length(hf));
2595 proto_register_subtree_array(ett, array_length(ett));
2596 expert_wps = expert_register_protocol(proto_wps);
2597 expert_register_field_array(expert_wps, ei, array_length(ei));
2599 wps_handle = register_dissector("wps", dissect_wps, proto_wps);
2602 void
2603 proto_reg_handoff_wps(void)
2605 dissector_add_uint("wlan.ie.wifi_alliance.subtype", WFA_SUBTYPE_IEEE1905_MULTI_AP, create_dissector_handle(dissect_wps_wfa_ext_via_dt, proto_wps));
2606 dissector_add_uint("eap.ext.vendor_id", WFA_VENDOR_ID, wps_handle);
2610 * Editor modelines
2612 * Local Variables:
2613 * c-basic-offset: 2
2614 * tab-width: 8
2615 * indent-tabs-mode: nil
2616 * End:
2618 * ex: set shiftwidth=2 tabstop=8 expandtab:
2619 * :indentSize=2:tabSize=8:noTabs=true: