2 * Wi-Fi Protected Setup
3 * Copyright (c) 2007-2013, Jouni Malinen <j@w1.fi>
5 * This software may be distributed under the terms of the BSD license.
6 * See README for more details.
15 * enum wsc_op_code - EAP-WSC OP-Code values
18 WSC_UPnP = 0 /* No OP Code in UPnP transport */,
28 struct upnp_wps_device_sm;
30 struct wps_parse_attr;
33 * struct wps_credential - WPS Credential
35 * @ssid_len: Length of SSID
36 * @auth_type: Authentication Type (WPS_AUTH_OPEN, .. flags)
37 * @encr_type: Encryption Type (WPS_ENCR_NONE, .. flags)
40 * @key_len: Key length in octets
41 * @mac_addr: MAC address of the Credential receiver
42 * @cred_attr: Unparsed Credential attribute data (used only in cred_cb());
43 * this may be %NULL, if not used
44 * @cred_attr_len: Length of cred_attr in octets
46 struct wps_credential {
54 u8 mac_addr[ETH_ALEN];
59 #define WPS_DEV_TYPE_LEN 8
60 #define WPS_DEV_TYPE_BUFSIZE 21
61 #define WPS_SEC_DEV_TYPE_MAX_LEN 128
62 /* maximum number of advertised WPS vendor extension attributes */
63 #define MAX_WPS_VENDOR_EXTENSIONS 10
64 /* maximum size of WPS Vendor extension attribute */
65 #define WPS_MAX_VENDOR_EXT_LEN 1024
66 /* maximum number of parsed WPS vendor extension attributes */
67 #define MAX_WPS_PARSE_VENDOR_EXT 10
70 * struct wps_device_data - WPS Device Data
71 * @mac_addr: Device MAC address
72 * @device_name: Device Name (0..32 octets encoded in UTF-8)
73 * @manufacturer: Manufacturer (0..64 octets encoded in UTF-8)
74 * @model_name: Model Name (0..32 octets encoded in UTF-8)
75 * @model_number: Model Number (0..32 octets encoded in UTF-8)
76 * @serial_number: Serial Number (0..32 octets encoded in UTF-8)
77 * @pri_dev_type: Primary Device Type
78 * @sec_dev_type: Array of secondary device types
79 * @num_sec_dev_type: Number of secondary device types
80 * @os_version: OS Version
81 * @rf_bands: RF bands (WPS_RF_24GHZ, WPS_RF_50GHZ flags)
82 * @p2p: Whether the device is a P2P device
84 struct wps_device_data {
85 u8 mac_addr[ETH_ALEN];
91 u8 pri_dev_type[WPS_DEV_TYPE_LEN];
92 #define WPS_SEC_DEVICE_TYPES 5
93 u8 sec_dev_type[WPS_SEC_DEVICE_TYPES][WPS_DEV_TYPE_LEN];
98 struct wpabuf *vendor_ext_m1;
99 struct wpabuf *vendor_ext[MAX_WPS_VENDOR_EXTENSIONS];
105 * struct wps_config - WPS configuration for a single registration protocol run
109 * wps - Pointer to long term WPS context
111 struct wps_context *wps;
114 * registrar - Whether this end is a Registrar
119 * pin - Enrollee Device Password (%NULL for Registrar or PBC)
124 * pin_len - Length on pin in octets
129 * pbc - Whether this is protocol run uses PBC
134 * assoc_wps_ie: (Re)AssocReq WPS IE (in AP; %NULL if not AP)
136 const struct wpabuf *assoc_wps_ie;
139 * new_ap_settings - New AP settings (%NULL if not used)
141 * This parameter provides new AP settings when using a wireless
142 * stations as a Registrar to configure the AP. %NULL means that AP
143 * will not be reconfigured, i.e., the station will only learn the
144 * current AP settings by using AP PIN.
146 const struct wps_credential *new_ap_settings;
149 * peer_addr: MAC address of the peer in AP; %NULL if not AP
154 * use_psk_key - Use PSK format key in Credential
156 * Force PSK format to be used instead of ASCII passphrase when
157 * building Credential for an Enrollee. The PSK value is set in
158 * struct wpa_context::psk.
163 * dev_pw_id - Device Password ID for Enrollee when PIN is used
168 * p2p_dev_addr - P2P Device Address from (Re)Association Request
170 * On AP/GO, this is set to the P2P Device Address of the associating
171 * P2P client if a P2P IE is included in the (Re)Association Request
172 * frame and the P2P Device Address is included. Otherwise, this is set
173 * to %NULL to indicate the station does not have a P2P Device Address.
175 const u8 *p2p_dev_addr;
178 * pbc_in_m1 - Do not remove PushButton config method in M1 (AP)
180 * This can be used to enable a workaround to allow Windows 7 to use
186 * peer_pubkey_hash - Peer public key hash or %NULL if not known
188 const u8 *peer_pubkey_hash;
191 struct wps_data * wps_init(const struct wps_config *cfg);
193 void wps_deinit(struct wps_data *data);
196 * enum wps_process_res - WPS message processing result
198 enum wps_process_res {
200 * WPS_DONE - Processing done
205 * WPS_CONTINUE - Processing continues
210 * WPS_FAILURE - Processing failed
215 * WPS_PENDING - Processing continues, but waiting for an external
216 * event (e.g., UPnP message from an external Registrar)
220 enum wps_process_res wps_process_msg(struct wps_data *wps,
221 enum wsc_op_code op_code,
222 const struct wpabuf *msg);
224 struct wpabuf * wps_get_msg(struct wps_data *wps, enum wsc_op_code *op_code);
226 int wps_is_selected_pbc_registrar(const struct wpabuf *msg);
227 int wps_is_selected_pin_registrar(const struct wpabuf *msg);
228 int wps_ap_priority_compar(const struct wpabuf *wps_a,
229 const struct wpabuf *wps_b);
230 int wps_is_addr_authorized(const struct wpabuf *msg, const u8 *addr,
232 const u8 * wps_get_uuid_e(const struct wpabuf *msg);
233 int wps_is_20(const struct wpabuf *msg);
235 struct wpabuf * wps_build_assoc_req_ie(enum wps_request_type req_type);
236 struct wpabuf * wps_build_assoc_resp_ie(void);
237 struct wpabuf * wps_build_probe_req_ie(u16 pw_id, struct wps_device_data *dev,
239 enum wps_request_type req_type,
240 unsigned int num_req_dev_types,
241 const u8 *req_dev_types);
245 * struct wps_registrar_config - WPS Registrar configuration
247 struct wps_registrar_config {
249 * new_psk_cb - Callback for new PSK
250 * @ctx: Higher layer context data (cb_ctx)
251 * @mac_addr: MAC address of the Enrollee
252 * @p2p_dev_addr: P2P Device Address of the Enrollee or all zeros if not
254 * @psk_len: The length of psk in octets
255 * Returns: 0 on success, -1 on failure
257 * This callback is called when a new per-device PSK is provisioned.
259 int (*new_psk_cb)(void *ctx, const u8 *mac_addr, const u8 *p2p_dev_addr,
260 const u8 *psk, size_t psk_len);
263 * set_ie_cb - Callback for WPS IE changes
264 * @ctx: Higher layer context data (cb_ctx)
265 * @beacon_ie: WPS IE for Beacon
266 * @probe_resp_ie: WPS IE for Probe Response
267 * Returns: 0 on success, -1 on failure
269 * This callback is called whenever the WPS IE in Beacon or Probe
270 * Response frames needs to be changed (AP only). Callee is responsible
271 * for freeing the buffers.
273 int (*set_ie_cb)(void *ctx, struct wpabuf *beacon_ie,
274 struct wpabuf *probe_resp_ie);
277 * pin_needed_cb - Callback for requesting a PIN
278 * @ctx: Higher layer context data (cb_ctx)
279 * @uuid_e: UUID-E of the unknown Enrollee
280 * @dev: Device Data from the unknown Enrollee
282 * This callback is called whenever an unknown Enrollee requests to use
283 * PIN method and a matching PIN (Device Password) is not found in
286 void (*pin_needed_cb)(void *ctx, const u8 *uuid_e,
287 const struct wps_device_data *dev);
290 * reg_success_cb - Callback for reporting successful registration
291 * @ctx: Higher layer context data (cb_ctx)
292 * @mac_addr: MAC address of the Enrollee
293 * @uuid_e: UUID-E of the Enrollee
294 * @dev_pw: Device Password (PIN) used during registration
295 * @dev_pw_len: Length of dev_pw in octets
297 * This callback is called whenever an Enrollee completes registration
300 void (*reg_success_cb)(void *ctx, const u8 *mac_addr,
301 const u8 *uuid_e, const u8 *dev_pw,
305 * set_sel_reg_cb - Callback for reporting selected registrar changes
306 * @ctx: Higher layer context data (cb_ctx)
307 * @sel_reg: Whether the Registrar is selected
308 * @dev_passwd_id: Device Password ID to indicate with method or
309 * specific password the Registrar intends to use
310 * @sel_reg_config_methods: Bit field of active config methods
312 * This callback is called whenever the Selected Registrar state
313 * changes (e.g., a new PIN becomes available or PBC is invoked). This
314 * callback is only used by External Registrar implementation;
315 * set_ie_cb() is used by AP implementation in similar caes, but it
316 * provides the full WPS IE data instead of just the minimal Registrar
319 void (*set_sel_reg_cb)(void *ctx, int sel_reg, u16 dev_passwd_id,
320 u16 sel_reg_config_methods);
323 * enrollee_seen_cb - Callback for reporting Enrollee based on ProbeReq
324 * @ctx: Higher layer context data (cb_ctx)
325 * @addr: MAC address of the Enrollee
326 * @uuid_e: UUID of the Enrollee
327 * @pri_dev_type: Primary device type
328 * @config_methods: Config Methods
329 * @dev_password_id: Device Password ID
330 * @request_type: Request Type
331 * @dev_name: Device Name (if available)
333 void (*enrollee_seen_cb)(void *ctx, const u8 *addr, const u8 *uuid_e,
334 const u8 *pri_dev_type, u16 config_methods,
335 u16 dev_password_id, u8 request_type,
336 const char *dev_name);
339 * cb_ctx: Higher layer context data for Registrar callbacks
344 * skip_cred_build: Do not build credential
346 * This option can be used to disable internal code that builds
347 * Credential attribute into M8 based on the current network
348 * configuration and Enrollee capabilities. The extra_cred data will
349 * then be used as the Credential(s).
354 * extra_cred: Additional Credential attribute(s)
356 * This optional data (set to %NULL to disable) can be used to add
357 * Credential attribute(s) for other networks into M8. If
358 * skip_cred_build is set, this will also override the automatically
359 * generated Credential attribute.
361 const u8 *extra_cred;
364 * extra_cred_len: Length of extra_cred in octets
366 size_t extra_cred_len;
369 * disable_auto_conf - Disable auto-configuration on first registration
371 * By default, the AP that is started in not configured state will
372 * generate a random PSK and move to configured state when the first
373 * registration protocol run is completed successfully. This option can
374 * be used to disable this functionality and leave it up to an external
375 * program to take care of configuration. This requires the extra_cred
376 * to be set with a suitable Credential and skip_cred_build being used.
378 int disable_auto_conf;
381 * static_wep_only - Whether the BSS supports only static WEP
386 * dualband - Whether this is a concurrent dualband AP
391 * force_per_enrollee_psk - Force per-Enrollee random PSK
393 * This forces per-Enrollee random PSK to be generated even if a default
394 * PSK is set for a network.
396 int force_per_enrollee_psk;
401 * enum wps_event - WPS event types
405 * WPS_EV_M2D - M2D received (Registrar did not know us)
410 * WPS_EV_FAIL - Registration failed
415 * WPS_EV_SUCCESS - Registration succeeded
420 * WPS_EV_PWD_AUTH_FAIL - Password authentication failed
422 WPS_EV_PWD_AUTH_FAIL,
425 * WPS_EV_PBC_OVERLAP - PBC session overlap detected
430 * WPS_EV_PBC_TIMEOUT - PBC walktime expired before protocol run start
435 * WPS_EV_PBC_ACTIVE - PBC mode was activated
440 * WPS_EV_PBC_DISABLE - PBC mode was disabled
445 * WPS_EV_ER_AP_ADD - ER: AP added
450 * WPS_EV_ER_AP_REMOVE - ER: AP removed
455 * WPS_EV_ER_ENROLLEE_ADD - ER: Enrollee added
457 WPS_EV_ER_ENROLLEE_ADD,
460 * WPS_EV_ER_ENROLLEE_REMOVE - ER: Enrollee removed
462 WPS_EV_ER_ENROLLEE_REMOVE,
465 * WPS_EV_ER_AP_SETTINGS - ER: AP Settings learned
467 WPS_EV_ER_AP_SETTINGS,
470 * WPS_EV_ER_SET_SELECTED_REGISTRAR - ER: SetSelectedRegistrar event
472 WPS_EV_ER_SET_SELECTED_REGISTRAR,
475 * WPS_EV_AP_PIN_SUCCESS - External Registrar used correct AP PIN
477 WPS_EV_AP_PIN_SUCCESS
481 * union wps_event_data - WPS event data
483 union wps_event_data {
485 * struct wps_event_m2d - M2D event data
487 struct wps_event_m2d {
489 const u8 *manufacturer;
490 size_t manufacturer_len;
491 const u8 *model_name;
492 size_t model_name_len;
493 const u8 *model_number;
494 size_t model_number_len;
495 const u8 *serial_number;
496 size_t serial_number_len;
499 const u8 *primary_dev_type; /* 8 octets */
505 * struct wps_event_fail - Registration failure information
506 * @msg: enum wps_msg_type
508 struct wps_event_fail {
511 u16 error_indication;
512 u8 peer_macaddr[ETH_ALEN];
515 struct wps_event_success {
516 u8 peer_macaddr[ETH_ALEN];
519 struct wps_event_pwd_auth_fail {
522 u8 peer_macaddr[ETH_ALEN];
525 struct wps_event_er_ap {
528 const char *friendly_name;
529 const char *manufacturer;
530 const char *manufacturer_url;
531 const char *model_description;
532 const char *model_name;
533 const char *model_number;
534 const char *model_url;
535 const char *serial_number;
537 const u8 *pri_dev_type;
541 struct wps_event_er_enrollee {
547 const u8 *pri_dev_type;
548 const char *dev_name;
549 const char *manufacturer;
550 const char *model_name;
551 const char *model_number;
552 const char *serial_number;
555 struct wps_event_er_ap_settings {
557 const struct wps_credential *cred;
560 struct wps_event_er_set_selected_registrar {
564 u16 sel_reg_config_methods;
566 WPS_ER_SET_SEL_REG_START,
567 WPS_ER_SET_SEL_REG_DONE,
568 WPS_ER_SET_SEL_REG_FAILED
574 * struct upnp_pending_message - Pending PutWLANResponse messages
575 * @next: Pointer to next pending message or %NULL
576 * @addr: NewWLANEventMAC
578 * @type: Message Type
580 struct upnp_pending_message {
581 struct upnp_pending_message *next;
584 enum wps_msg_type type;
588 * struct wps_context - Long term WPS context data
590 * This data is stored at the higher layer Authenticator or Supplicant data
591 * structures and it is maintained over multiple registration protocol runs.
595 * ap - Whether the local end is an access point
600 * registrar - Pointer to WPS registrar data from wps_registrar_init()
602 struct wps_registrar *registrar;
605 * wps_state - Current WPS state
607 enum wps_state wps_state;
610 * ap_setup_locked - Whether AP setup is locked (only used at AP)
622 * This SSID is used by the Registrar to fill in information for
623 * Credentials. In addition, AP uses it when acting as an Enrollee to
624 * notify Registrar of the current configuration.
629 * ssid_len - Length of ssid in octets
634 * dev - Own WPS device data
636 struct wps_device_data dev;
639 * dh_ctx - Context data for Diffie-Hellman operation
644 * dh_privkey - Diffie-Hellman private key
646 struct wpabuf *dh_privkey;
649 * dh_pubkey_oob - Diffie-Hellman public key
651 struct wpabuf *dh_pubkey;
654 * config_methods - Enabled configuration methods
656 * Bit field of WPS_CONFIG_*
661 * encr_types - Enabled encryption types (bit field of WPS_ENCR_*)
666 * auth_types - Authentication types (bit field of WPS_AUTH_*)
671 * encr_types - Current AP encryption type (WPS_ENCR_*)
676 * ap_auth_type - Current AP authentication types (WPS_AUTH_*)
681 * network_key - The current Network Key (PSK) or %NULL to generate new
683 * If %NULL, Registrar will generate per-device PSK. In addition, AP
684 * uses this when acting as an Enrollee to notify Registrar of the
685 * current configuration.
687 * When using WPA/WPA2-Person, this key can be either the ASCII
688 * passphrase (8..63 characters) or the 32-octet PSK (64 hex
689 * characters). When this is set to the ASCII passphrase, the PSK can
690 * be provided in the psk buffer and used per-Enrollee to control which
691 * key type is included in the Credential (e.g., to reduce calculation
692 * need on low-powered devices by provisioning PSK while still allowing
693 * other devices to get the passphrase).
698 * network_key_len - Length of network_key in octets
700 size_t network_key_len;
703 * psk - The current network PSK
705 * This optional value can be used to provide the current PSK if
706 * network_key is set to the ASCII passphrase.
711 * psk_set - Whether psk value is set
716 * ap_settings - AP Settings override for M7 (only used at AP)
718 * If %NULL, AP Settings attributes will be generated based on the
719 * current network configuration.
724 * ap_settings_len - Length of ap_settings in octets
726 size_t ap_settings_len;
729 * friendly_name - Friendly Name (required for UPnP)
734 * manufacturer_url - Manufacturer URL (optional for UPnP)
736 char *manufacturer_url;
739 * model_description - Model Description (recommended for UPnP)
741 char *model_description;
744 * model_url - Model URL (optional for UPnP)
749 * upc - Universal Product Code (optional for UPnP)
754 * cred_cb - Callback to notify that new Credentials were received
755 * @ctx: Higher layer context data (cb_ctx)
756 * @cred: The received Credential
757 * Return: 0 on success, -1 on failure
759 int (*cred_cb)(void *ctx, const struct wps_credential *cred);
762 * event_cb - Event callback (state information about progress)
763 * @ctx: Higher layer context data (cb_ctx)
767 void (*event_cb)(void *ctx, enum wps_event event,
768 union wps_event_data *data);
771 * rf_band_cb - Fetch currently used RF band
772 * @ctx: Higher layer context data (cb_ctx)
773 * Return: Current used RF band or 0 if not known
775 int (*rf_band_cb)(void *ctx);
778 * cb_ctx: Higher layer context data for callbacks
782 struct upnp_wps_device_sm *wps_upnp;
784 /* Pending messages from UPnP PutWLANResponse */
785 struct upnp_pending_message *upnp_msgs;
787 u16 ap_nfc_dev_pw_id;
788 struct wpabuf *ap_nfc_dh_pubkey;
789 struct wpabuf *ap_nfc_dh_privkey;
790 struct wpabuf *ap_nfc_dev_pw;
793 struct wps_registrar *
794 wps_registrar_init(struct wps_context *wps,
795 const struct wps_registrar_config *cfg);
796 void wps_registrar_deinit(struct wps_registrar *reg);
797 int wps_registrar_add_pin(struct wps_registrar *reg, const u8 *addr,
798 const u8 *uuid, const u8 *pin, size_t pin_len,
800 int wps_registrar_invalidate_pin(struct wps_registrar *reg, const u8 *uuid);
801 int wps_registrar_wps_cancel(struct wps_registrar *reg);
802 int wps_registrar_unlock_pin(struct wps_registrar *reg, const u8 *uuid);
803 int wps_registrar_button_pushed(struct wps_registrar *reg,
804 const u8 *p2p_dev_addr);
805 void wps_registrar_complete(struct wps_registrar *registrar, const u8 *uuid_e,
806 const u8 *dev_pw, size_t dev_pw_len);
807 void wps_registrar_probe_req_rx(struct wps_registrar *reg, const u8 *addr,
808 const struct wpabuf *wps_data,
810 int wps_registrar_update_ie(struct wps_registrar *reg);
811 int wps_registrar_get_info(struct wps_registrar *reg, const u8 *addr,
812 char *buf, size_t buflen);
813 int wps_registrar_config_ap(struct wps_registrar *reg,
814 struct wps_credential *cred);
815 int wps_registrar_add_nfc_pw_token(struct wps_registrar *reg,
816 const u8 *pubkey_hash, u16 pw_id,
817 const u8 *dev_pw, size_t dev_pw_len,
818 int pk_hash_provided_oob);
819 int wps_registrar_add_nfc_password_token(struct wps_registrar *reg,
820 const u8 *oob_dev_pw,
821 size_t oob_dev_pw_len);
822 void wps_registrar_flush(struct wps_registrar *reg);
824 int wps_build_credential_wrap(struct wpabuf *msg,
825 const struct wps_credential *cred);
827 unsigned int wps_pin_checksum(unsigned int pin);
828 unsigned int wps_pin_valid(unsigned int pin);
829 unsigned int wps_generate_pin(void);
830 int wps_pin_str_valid(const char *pin);
831 void wps_free_pending_msgs(struct upnp_pending_message *msgs);
833 struct wpabuf * wps_get_oob_cred(struct wps_context *wps, int rf_band,
835 int wps_oob_use_cred(struct wps_context *wps, struct wps_parse_attr *attr);
836 int wps_attr_text(struct wpabuf *data, char *buf, char *end);
837 const char * wps_ei_str(enum wps_error_indication ei);
839 struct wps_er * wps_er_init(struct wps_context *wps, const char *ifname,
841 void wps_er_refresh(struct wps_er *er);
842 void wps_er_deinit(struct wps_er *er, void (*cb)(void *ctx), void *ctx);
843 void wps_er_set_sel_reg(struct wps_er *er, int sel_reg, u16 dev_passwd_id,
844 u16 sel_reg_config_methods);
845 int wps_er_pbc(struct wps_er *er, const u8 *uuid, const u8 *addr);
846 const u8 * wps_er_get_sta_uuid(struct wps_er *er, const u8 *addr);
847 int wps_er_learn(struct wps_er *er, const u8 *uuid, const u8 *addr,
848 const u8 *pin, size_t pin_len);
849 int wps_er_set_config(struct wps_er *er, const u8 *uuid, const u8 *addr,
850 const struct wps_credential *cred);
851 int wps_er_config(struct wps_er *er, const u8 *uuid, const u8 *addr,
852 const u8 *pin, size_t pin_len,
853 const struct wps_credential *cred);
854 struct wpabuf * wps_er_config_token_from_cred(struct wps_context *wps,
855 struct wps_credential *cred);
856 struct wpabuf * wps_er_nfc_config_token(struct wps_er *er, const u8 *uuid,
858 struct wpabuf * wps_er_nfc_handover_sel(struct wps_er *er,
859 struct wps_context *wps, const u8 *uuid,
860 const u8 *addr, struct wpabuf *pubkey);
862 int wps_dev_type_str2bin(const char *str, u8 dev_type[WPS_DEV_TYPE_LEN]);
863 char * wps_dev_type_bin2str(const u8 dev_type[WPS_DEV_TYPE_LEN], char *buf,
865 void uuid_gen_mac_addr(const u8 *mac_addr, u8 *uuid);
866 u16 wps_config_methods_str2bin(const char *str);
867 struct wpabuf * wps_build_nfc_pw_token(u16 dev_pw_id,
868 const struct wpabuf *pubkey,
869 const struct wpabuf *dev_pw);
870 struct wpabuf * wps_nfc_token_build(int ndef, int id, struct wpabuf *pubkey,
871 struct wpabuf *dev_pw);
872 int wps_nfc_gen_dh(struct wpabuf **pubkey, struct wpabuf **privkey);
873 struct wpabuf * wps_nfc_token_gen(int ndef, int *id, struct wpabuf **pubkey,
874 struct wpabuf **privkey,
875 struct wpabuf **dev_pw);
876 struct wpabuf * wps_build_nfc_handover_req(struct wps_context *ctx,
877 struct wpabuf *nfc_dh_pubkey);
878 struct wpabuf * wps_build_nfc_handover_sel(struct wps_context *ctx,
879 struct wpabuf *nfc_dh_pubkey,
880 const u8 *bssid, int freq);
881 struct wpabuf * wps_build_nfc_handover_req_p2p(struct wps_context *ctx,
882 struct wpabuf *nfc_dh_pubkey);
883 struct wpabuf * wps_build_nfc_handover_sel_p2p(struct wps_context *ctx,
885 struct wpabuf *nfc_dh_pubkey,
886 struct wpabuf *nfc_dev_pw);
889 struct wpabuf * ndef_parse_wifi(const struct wpabuf *buf);
890 struct wpabuf * ndef_build_wifi(const struct wpabuf *buf);
891 struct wpabuf * ndef_parse_p2p(const struct wpabuf *buf);
892 struct wpabuf * ndef_build_p2p(const struct wpabuf *buf);
894 #ifdef CONFIG_WPS_STRICT
895 int wps_validate_beacon(const struct wpabuf *wps_ie);
896 int wps_validate_beacon_probe_resp(const struct wpabuf *wps_ie, int probe,
898 int wps_validate_probe_req(const struct wpabuf *wps_ie, const u8 *addr);
899 int wps_validate_assoc_req(const struct wpabuf *wps_ie);
900 int wps_validate_assoc_resp(const struct wpabuf *wps_ie);
901 int wps_validate_m1(const struct wpabuf *tlvs);
902 int wps_validate_m2(const struct wpabuf *tlvs);
903 int wps_validate_m2d(const struct wpabuf *tlvs);
904 int wps_validate_m3(const struct wpabuf *tlvs);
905 int wps_validate_m4(const struct wpabuf *tlvs);
906 int wps_validate_m4_encr(const struct wpabuf *tlvs, int wps2);
907 int wps_validate_m5(const struct wpabuf *tlvs);
908 int wps_validate_m5_encr(const struct wpabuf *tlvs, int wps2);
909 int wps_validate_m6(const struct wpabuf *tlvs);
910 int wps_validate_m6_encr(const struct wpabuf *tlvs, int wps2);
911 int wps_validate_m7(const struct wpabuf *tlvs);
912 int wps_validate_m7_encr(const struct wpabuf *tlvs, int ap, int wps2);
913 int wps_validate_m8(const struct wpabuf *tlvs);
914 int wps_validate_m8_encr(const struct wpabuf *tlvs, int ap, int wps2);
915 int wps_validate_wsc_ack(const struct wpabuf *tlvs);
916 int wps_validate_wsc_nack(const struct wpabuf *tlvs);
917 int wps_validate_wsc_done(const struct wpabuf *tlvs);
918 int wps_validate_upnp_set_selected_registrar(const struct wpabuf *tlvs);
919 #else /* CONFIG_WPS_STRICT */
920 static inline int wps_validate_beacon(const struct wpabuf *wps_ie){
924 static inline int wps_validate_beacon_probe_resp(const struct wpabuf *wps_ie,
925 int probe, const u8 *addr)
930 static inline int wps_validate_probe_req(const struct wpabuf *wps_ie,
936 static inline int wps_validate_assoc_req(const struct wpabuf *wps_ie)
941 static inline int wps_validate_assoc_resp(const struct wpabuf *wps_ie)
946 static inline int wps_validate_m1(const struct wpabuf *tlvs)
951 static inline int wps_validate_m2(const struct wpabuf *tlvs)
956 static inline int wps_validate_m2d(const struct wpabuf *tlvs)
961 static inline int wps_validate_m3(const struct wpabuf *tlvs)
966 static inline int wps_validate_m4(const struct wpabuf *tlvs)
971 static inline int wps_validate_m4_encr(const struct wpabuf *tlvs, int wps2)
976 static inline int wps_validate_m5(const struct wpabuf *tlvs)
981 static inline int wps_validate_m5_encr(const struct wpabuf *tlvs, int wps2)
986 static inline int wps_validate_m6(const struct wpabuf *tlvs)
991 static inline int wps_validate_m6_encr(const struct wpabuf *tlvs, int wps2)
996 static inline int wps_validate_m7(const struct wpabuf *tlvs)
1001 static inline int wps_validate_m7_encr(const struct wpabuf *tlvs, int ap,
1007 static inline int wps_validate_m8(const struct wpabuf *tlvs)
1012 static inline int wps_validate_m8_encr(const struct wpabuf *tlvs, int ap,
1018 static inline int wps_validate_wsc_ack(const struct wpabuf *tlvs)
1023 static inline int wps_validate_wsc_nack(const struct wpabuf *tlvs)
1028 static inline int wps_validate_wsc_done(const struct wpabuf *tlvs)
1033 static inline int wps_validate_upnp_set_selected_registrar(
1034 const struct wpabuf *tlvs)
1038 #endif /* CONFIG_WPS_STRICT */