1e5b75505Sopenharmony_ci/*
2e5b75505Sopenharmony_ci * Wi-Fi Protected Setup
3e5b75505Sopenharmony_ci * Copyright (c) 2007-2016, Jouni Malinen <j@w1.fi>
4e5b75505Sopenharmony_ci *
5e5b75505Sopenharmony_ci * This software may be distributed under the terms of the BSD license.
6e5b75505Sopenharmony_ci * See README for more details.
7e5b75505Sopenharmony_ci */
8e5b75505Sopenharmony_ci
9e5b75505Sopenharmony_ci#ifndef WPS_H
10e5b75505Sopenharmony_ci#define WPS_H
11e5b75505Sopenharmony_ci
12e5b75505Sopenharmony_ci#include "common/ieee802_11_defs.h"
13e5b75505Sopenharmony_ci#include "wps_defs.h"
14e5b75505Sopenharmony_ci
15e5b75505Sopenharmony_ci/**
16e5b75505Sopenharmony_ci * enum wsc_op_code - EAP-WSC OP-Code values
17e5b75505Sopenharmony_ci */
18e5b75505Sopenharmony_cienum wsc_op_code {
19e5b75505Sopenharmony_ci	WSC_UPnP = 0 /* No OP Code in UPnP transport */,
20e5b75505Sopenharmony_ci	WSC_Start = 0x01,
21e5b75505Sopenharmony_ci	WSC_ACK = 0x02,
22e5b75505Sopenharmony_ci	WSC_NACK = 0x03,
23e5b75505Sopenharmony_ci	WSC_MSG = 0x04,
24e5b75505Sopenharmony_ci	WSC_Done = 0x05,
25e5b75505Sopenharmony_ci	WSC_FRAG_ACK = 0x06
26e5b75505Sopenharmony_ci};
27e5b75505Sopenharmony_ci
28e5b75505Sopenharmony_cistruct wps_registrar;
29e5b75505Sopenharmony_cistruct upnp_wps_device_sm;
30e5b75505Sopenharmony_cistruct wps_er;
31e5b75505Sopenharmony_cistruct wps_parse_attr;
32e5b75505Sopenharmony_ci
33e5b75505Sopenharmony_ci/**
34e5b75505Sopenharmony_ci * struct wps_credential - WPS Credential
35e5b75505Sopenharmony_ci * @ssid: SSID
36e5b75505Sopenharmony_ci * @ssid_len: Length of SSID
37e5b75505Sopenharmony_ci * @auth_type: Authentication Type (WPS_AUTH_OPEN, .. flags)
38e5b75505Sopenharmony_ci * @encr_type: Encryption Type (WPS_ENCR_NONE, .. flags)
39e5b75505Sopenharmony_ci * @key_idx: Key index
40e5b75505Sopenharmony_ci * @key: Key
41e5b75505Sopenharmony_ci * @key_len: Key length in octets
42e5b75505Sopenharmony_ci * @mac_addr: MAC address of the Credential receiver
43e5b75505Sopenharmony_ci * @cred_attr: Unparsed Credential attribute data (used only in cred_cb());
44e5b75505Sopenharmony_ci *	this may be %NULL, if not used
45e5b75505Sopenharmony_ci * @cred_attr_len: Length of cred_attr in octets
46e5b75505Sopenharmony_ci */
47e5b75505Sopenharmony_cistruct wps_credential {
48e5b75505Sopenharmony_ci	u8 ssid[SSID_MAX_LEN];
49e5b75505Sopenharmony_ci	size_t ssid_len;
50e5b75505Sopenharmony_ci	u16 auth_type;
51e5b75505Sopenharmony_ci	u16 encr_type;
52e5b75505Sopenharmony_ci	u8 key_idx;
53e5b75505Sopenharmony_ci	u8 key[64];
54e5b75505Sopenharmony_ci	size_t key_len;
55e5b75505Sopenharmony_ci	u8 mac_addr[ETH_ALEN];
56e5b75505Sopenharmony_ci	const u8 *cred_attr;
57e5b75505Sopenharmony_ci	size_t cred_attr_len;
58e5b75505Sopenharmony_ci};
59e5b75505Sopenharmony_ci
60e5b75505Sopenharmony_ci#define WPS_DEV_TYPE_LEN 8
61e5b75505Sopenharmony_ci#define WPS_DEV_TYPE_BUFSIZE 21
62e5b75505Sopenharmony_ci#define WPS_SEC_DEV_TYPE_MAX_LEN 128
63e5b75505Sopenharmony_ci/* maximum number of advertised WPS vendor extension attributes */
64e5b75505Sopenharmony_ci#define MAX_WPS_VENDOR_EXTENSIONS 10
65e5b75505Sopenharmony_ci/* maximum size of WPS Vendor extension attribute */
66e5b75505Sopenharmony_ci#define WPS_MAX_VENDOR_EXT_LEN 1024
67e5b75505Sopenharmony_ci/* maximum number of parsed WPS vendor extension attributes */
68e5b75505Sopenharmony_ci#define MAX_WPS_PARSE_VENDOR_EXT 10
69e5b75505Sopenharmony_ci
70e5b75505Sopenharmony_ci/**
71e5b75505Sopenharmony_ci * struct wps_device_data - WPS Device Data
72e5b75505Sopenharmony_ci * @mac_addr: Device MAC address
73e5b75505Sopenharmony_ci * @device_name: Device Name (0..32 octets encoded in UTF-8)
74e5b75505Sopenharmony_ci * @manufacturer: Manufacturer (0..64 octets encoded in UTF-8)
75e5b75505Sopenharmony_ci * @model_name: Model Name (0..32 octets encoded in UTF-8)
76e5b75505Sopenharmony_ci * @model_number: Model Number (0..32 octets encoded in UTF-8)
77e5b75505Sopenharmony_ci * @serial_number: Serial Number (0..32 octets encoded in UTF-8)
78e5b75505Sopenharmony_ci * @pri_dev_type: Primary Device Type
79e5b75505Sopenharmony_ci * @sec_dev_type: Array of secondary device types
80e5b75505Sopenharmony_ci * @num_sec_dev_type: Number of secondary device types
81e5b75505Sopenharmony_ci * @os_version: OS Version
82e5b75505Sopenharmony_ci * @rf_bands: RF bands (WPS_RF_24GHZ, WPS_RF_50GHZ, WPS_RF_60GHZ flags)
83e5b75505Sopenharmony_ci * @p2p: Whether the device is a P2P device
84e5b75505Sopenharmony_ci */
85e5b75505Sopenharmony_cistruct wps_device_data {
86e5b75505Sopenharmony_ci	u8 mac_addr[ETH_ALEN];
87e5b75505Sopenharmony_ci	char *device_name;
88e5b75505Sopenharmony_ci	char *manufacturer;
89e5b75505Sopenharmony_ci	char *model_name;
90e5b75505Sopenharmony_ci	char *model_number;
91e5b75505Sopenharmony_ci	char *serial_number;
92e5b75505Sopenharmony_ci	u8 pri_dev_type[WPS_DEV_TYPE_LEN];
93e5b75505Sopenharmony_ci#define WPS_SEC_DEVICE_TYPES 5
94e5b75505Sopenharmony_ci	u8 sec_dev_type[WPS_SEC_DEVICE_TYPES][WPS_DEV_TYPE_LEN];
95e5b75505Sopenharmony_ci	u8 num_sec_dev_types;
96e5b75505Sopenharmony_ci	u32 os_version;
97e5b75505Sopenharmony_ci	u8 rf_bands;
98e5b75505Sopenharmony_ci	u16 config_methods;
99e5b75505Sopenharmony_ci	struct wpabuf *vendor_ext_m1;
100e5b75505Sopenharmony_ci	struct wpabuf *vendor_ext[MAX_WPS_VENDOR_EXTENSIONS];
101e5b75505Sopenharmony_ci	struct wpabuf *application_ext;
102e5b75505Sopenharmony_ci
103e5b75505Sopenharmony_ci	int p2p;
104e5b75505Sopenharmony_ci	u8 multi_ap_ext;
105e5b75505Sopenharmony_ci};
106e5b75505Sopenharmony_ci
107e5b75505Sopenharmony_ci/**
108e5b75505Sopenharmony_ci * struct wps_config - WPS configuration for a single registration protocol run
109e5b75505Sopenharmony_ci */
110e5b75505Sopenharmony_cistruct wps_config {
111e5b75505Sopenharmony_ci	/**
112e5b75505Sopenharmony_ci	 * wps - Pointer to long term WPS context
113e5b75505Sopenharmony_ci	 */
114e5b75505Sopenharmony_ci	struct wps_context *wps;
115e5b75505Sopenharmony_ci
116e5b75505Sopenharmony_ci	/**
117e5b75505Sopenharmony_ci	 * registrar - Whether this end is a Registrar
118e5b75505Sopenharmony_ci	 */
119e5b75505Sopenharmony_ci	int registrar;
120e5b75505Sopenharmony_ci
121e5b75505Sopenharmony_ci	/**
122e5b75505Sopenharmony_ci	 * pin - Enrollee Device Password (%NULL for Registrar or PBC)
123e5b75505Sopenharmony_ci	 */
124e5b75505Sopenharmony_ci	const u8 *pin;
125e5b75505Sopenharmony_ci
126e5b75505Sopenharmony_ci	/**
127e5b75505Sopenharmony_ci	 * pin_len - Length on pin in octets
128e5b75505Sopenharmony_ci	 */
129e5b75505Sopenharmony_ci	size_t pin_len;
130e5b75505Sopenharmony_ci
131e5b75505Sopenharmony_ci	/**
132e5b75505Sopenharmony_ci	 * pbc - Whether this is protocol run uses PBC
133e5b75505Sopenharmony_ci	 */
134e5b75505Sopenharmony_ci	int pbc;
135e5b75505Sopenharmony_ci
136e5b75505Sopenharmony_ci	/**
137e5b75505Sopenharmony_ci	 * assoc_wps_ie: (Re)AssocReq WPS IE (in AP; %NULL if not AP)
138e5b75505Sopenharmony_ci	 */
139e5b75505Sopenharmony_ci	const struct wpabuf *assoc_wps_ie;
140e5b75505Sopenharmony_ci
141e5b75505Sopenharmony_ci	/**
142e5b75505Sopenharmony_ci	 * new_ap_settings - New AP settings (%NULL if not used)
143e5b75505Sopenharmony_ci	 *
144e5b75505Sopenharmony_ci	 * This parameter provides new AP settings when using a wireless
145e5b75505Sopenharmony_ci	 * stations as a Registrar to configure the AP. %NULL means that AP
146e5b75505Sopenharmony_ci	 * will not be reconfigured, i.e., the station will only learn the
147e5b75505Sopenharmony_ci	 * current AP settings by using AP PIN.
148e5b75505Sopenharmony_ci	 */
149e5b75505Sopenharmony_ci	const struct wps_credential *new_ap_settings;
150e5b75505Sopenharmony_ci
151e5b75505Sopenharmony_ci	/**
152e5b75505Sopenharmony_ci	 * peer_addr: MAC address of the peer in AP; %NULL if not AP
153e5b75505Sopenharmony_ci	 */
154e5b75505Sopenharmony_ci	const u8 *peer_addr;
155e5b75505Sopenharmony_ci
156e5b75505Sopenharmony_ci	/**
157e5b75505Sopenharmony_ci	 * use_psk_key - Use PSK format key in Credential
158e5b75505Sopenharmony_ci	 *
159e5b75505Sopenharmony_ci	 * Force PSK format to be used instead of ASCII passphrase when
160e5b75505Sopenharmony_ci	 * building Credential for an Enrollee. The PSK value is set in
161e5b75505Sopenharmony_ci	 * struct wpa_context::psk.
162e5b75505Sopenharmony_ci	 */
163e5b75505Sopenharmony_ci	int use_psk_key;
164e5b75505Sopenharmony_ci
165e5b75505Sopenharmony_ci	/**
166e5b75505Sopenharmony_ci	 * dev_pw_id - Device Password ID for Enrollee when PIN is used
167e5b75505Sopenharmony_ci	 */
168e5b75505Sopenharmony_ci	u16 dev_pw_id;
169e5b75505Sopenharmony_ci
170e5b75505Sopenharmony_ci	/**
171e5b75505Sopenharmony_ci	 * p2p_dev_addr - P2P Device Address from (Re)Association Request
172e5b75505Sopenharmony_ci	 *
173e5b75505Sopenharmony_ci	 * On AP/GO, this is set to the P2P Device Address of the associating
174e5b75505Sopenharmony_ci	 * P2P client if a P2P IE is included in the (Re)Association Request
175e5b75505Sopenharmony_ci	 * frame and the P2P Device Address is included. Otherwise, this is set
176e5b75505Sopenharmony_ci	 * to %NULL to indicate the station does not have a P2P Device Address.
177e5b75505Sopenharmony_ci	 */
178e5b75505Sopenharmony_ci	const u8 *p2p_dev_addr;
179e5b75505Sopenharmony_ci
180e5b75505Sopenharmony_ci	/**
181e5b75505Sopenharmony_ci	 * pbc_in_m1 - Do not remove PushButton config method in M1 (AP)
182e5b75505Sopenharmony_ci	 *
183e5b75505Sopenharmony_ci	 * This can be used to enable a workaround to allow Windows 7 to use
184e5b75505Sopenharmony_ci	 * PBC with the AP.
185e5b75505Sopenharmony_ci	 */
186e5b75505Sopenharmony_ci	int pbc_in_m1;
187e5b75505Sopenharmony_ci
188e5b75505Sopenharmony_ci	/**
189e5b75505Sopenharmony_ci	 * peer_pubkey_hash - Peer public key hash or %NULL if not known
190e5b75505Sopenharmony_ci	 */
191e5b75505Sopenharmony_ci	const u8 *peer_pubkey_hash;
192e5b75505Sopenharmony_ci
193e5b75505Sopenharmony_ci	/**
194e5b75505Sopenharmony_ci	 * multi_ap_backhaul_sta - Whether this is a Multi-AP backhaul STA
195e5b75505Sopenharmony_ci	 * enrollee
196e5b75505Sopenharmony_ci	 */
197e5b75505Sopenharmony_ci	int multi_ap_backhaul_sta;
198e5b75505Sopenharmony_ci};
199e5b75505Sopenharmony_ci
200e5b75505Sopenharmony_cistruct wps_data * wps_init(const struct wps_config *cfg);
201e5b75505Sopenharmony_ci
202e5b75505Sopenharmony_civoid wps_deinit(struct wps_data *data);
203e5b75505Sopenharmony_ci
204e5b75505Sopenharmony_ci/**
205e5b75505Sopenharmony_ci * enum wps_process_res - WPS message processing result
206e5b75505Sopenharmony_ci */
207e5b75505Sopenharmony_cienum wps_process_res {
208e5b75505Sopenharmony_ci	/**
209e5b75505Sopenharmony_ci	 * WPS_DONE - Processing done
210e5b75505Sopenharmony_ci	 */
211e5b75505Sopenharmony_ci	WPS_DONE,
212e5b75505Sopenharmony_ci
213e5b75505Sopenharmony_ci	/**
214e5b75505Sopenharmony_ci	 * WPS_CONTINUE - Processing continues
215e5b75505Sopenharmony_ci	 */
216e5b75505Sopenharmony_ci	WPS_CONTINUE,
217e5b75505Sopenharmony_ci
218e5b75505Sopenharmony_ci	/**
219e5b75505Sopenharmony_ci	 * WPS_FAILURE - Processing failed
220e5b75505Sopenharmony_ci	 */
221e5b75505Sopenharmony_ci	WPS_FAILURE,
222e5b75505Sopenharmony_ci
223e5b75505Sopenharmony_ci	/**
224e5b75505Sopenharmony_ci	 * WPS_PENDING - Processing continues, but waiting for an external
225e5b75505Sopenharmony_ci	 *	event (e.g., UPnP message from an external Registrar)
226e5b75505Sopenharmony_ci	 */
227e5b75505Sopenharmony_ci	WPS_PENDING
228e5b75505Sopenharmony_ci};
229e5b75505Sopenharmony_cienum wps_process_res wps_process_msg(struct wps_data *wps,
230e5b75505Sopenharmony_ci				     enum wsc_op_code op_code,
231e5b75505Sopenharmony_ci				     const struct wpabuf *msg);
232e5b75505Sopenharmony_ci
233e5b75505Sopenharmony_cistruct wpabuf * wps_get_msg(struct wps_data *wps, enum wsc_op_code *op_code);
234e5b75505Sopenharmony_ci
235e5b75505Sopenharmony_ciint wps_is_selected_pbc_registrar(const struct wpabuf *msg);
236e5b75505Sopenharmony_ciint wps_is_selected_pin_registrar(const struct wpabuf *msg);
237e5b75505Sopenharmony_ciint wps_ap_priority_compar(const struct wpabuf *wps_a,
238e5b75505Sopenharmony_ci			   const struct wpabuf *wps_b);
239e5b75505Sopenharmony_ciint wps_is_addr_authorized(const struct wpabuf *msg, const u8 *addr,
240e5b75505Sopenharmony_ci			   int ver1_compat);
241e5b75505Sopenharmony_ciconst u8 * wps_get_uuid_e(const struct wpabuf *msg);
242e5b75505Sopenharmony_ciint wps_is_20(const struct wpabuf *msg);
243e5b75505Sopenharmony_ci
244e5b75505Sopenharmony_cistruct wpabuf * wps_build_assoc_req_ie(enum wps_request_type req_type);
245e5b75505Sopenharmony_cistruct wpabuf * wps_build_assoc_resp_ie(void);
246e5b75505Sopenharmony_cistruct wpabuf * wps_build_probe_req_ie(u16 pw_id, struct wps_device_data *dev,
247e5b75505Sopenharmony_ci				       const u8 *uuid,
248e5b75505Sopenharmony_ci				       enum wps_request_type req_type,
249e5b75505Sopenharmony_ci				       unsigned int num_req_dev_types,
250e5b75505Sopenharmony_ci				       const u8 *req_dev_types);
251e5b75505Sopenharmony_ci
252e5b75505Sopenharmony_ci
253e5b75505Sopenharmony_ci/**
254e5b75505Sopenharmony_ci * struct wps_registrar_config - WPS Registrar configuration
255e5b75505Sopenharmony_ci */
256e5b75505Sopenharmony_cistruct wps_registrar_config {
257e5b75505Sopenharmony_ci	/**
258e5b75505Sopenharmony_ci	 * new_psk_cb - Callback for new PSK
259e5b75505Sopenharmony_ci	 * @ctx: Higher layer context data (cb_ctx)
260e5b75505Sopenharmony_ci	 * @mac_addr: MAC address of the Enrollee
261e5b75505Sopenharmony_ci	 * @p2p_dev_addr: P2P Device Address of the Enrollee or all zeros if not
262e5b75505Sopenharmony_ci	 * @psk: The new PSK
263e5b75505Sopenharmony_ci	 * @psk_len: The length of psk in octets
264e5b75505Sopenharmony_ci	 * Returns: 0 on success, -1 on failure
265e5b75505Sopenharmony_ci	 *
266e5b75505Sopenharmony_ci	 * This callback is called when a new per-device PSK is provisioned.
267e5b75505Sopenharmony_ci	 */
268e5b75505Sopenharmony_ci	int (*new_psk_cb)(void *ctx, const u8 *mac_addr, const u8 *p2p_dev_addr,
269e5b75505Sopenharmony_ci			  const u8 *psk, size_t psk_len);
270e5b75505Sopenharmony_ci
271e5b75505Sopenharmony_ci	/**
272e5b75505Sopenharmony_ci	 * set_ie_cb - Callback for WPS IE changes
273e5b75505Sopenharmony_ci	 * @ctx: Higher layer context data (cb_ctx)
274e5b75505Sopenharmony_ci	 * @beacon_ie: WPS IE for Beacon
275e5b75505Sopenharmony_ci	 * @probe_resp_ie: WPS IE for Probe Response
276e5b75505Sopenharmony_ci	 * Returns: 0 on success, -1 on failure
277e5b75505Sopenharmony_ci	 *
278e5b75505Sopenharmony_ci	 * This callback is called whenever the WPS IE in Beacon or Probe
279e5b75505Sopenharmony_ci	 * Response frames needs to be changed (AP only). Callee is responsible
280e5b75505Sopenharmony_ci	 * for freeing the buffers.
281e5b75505Sopenharmony_ci	 */
282e5b75505Sopenharmony_ci	int (*set_ie_cb)(void *ctx, struct wpabuf *beacon_ie,
283e5b75505Sopenharmony_ci			 struct wpabuf *probe_resp_ie);
284e5b75505Sopenharmony_ci
285e5b75505Sopenharmony_ci	/**
286e5b75505Sopenharmony_ci	 * pin_needed_cb - Callback for requesting a PIN
287e5b75505Sopenharmony_ci	 * @ctx: Higher layer context data (cb_ctx)
288e5b75505Sopenharmony_ci	 * @uuid_e: UUID-E of the unknown Enrollee
289e5b75505Sopenharmony_ci	 * @dev: Device Data from the unknown Enrollee
290e5b75505Sopenharmony_ci	 *
291e5b75505Sopenharmony_ci	 * This callback is called whenever an unknown Enrollee requests to use
292e5b75505Sopenharmony_ci	 * PIN method and a matching PIN (Device Password) is not found in
293e5b75505Sopenharmony_ci	 * Registrar data.
294e5b75505Sopenharmony_ci	 */
295e5b75505Sopenharmony_ci	void (*pin_needed_cb)(void *ctx, const u8 *uuid_e,
296e5b75505Sopenharmony_ci			      const struct wps_device_data *dev);
297e5b75505Sopenharmony_ci
298e5b75505Sopenharmony_ci	/**
299e5b75505Sopenharmony_ci	 * reg_success_cb - Callback for reporting successful registration
300e5b75505Sopenharmony_ci	 * @ctx: Higher layer context data (cb_ctx)
301e5b75505Sopenharmony_ci	 * @mac_addr: MAC address of the Enrollee
302e5b75505Sopenharmony_ci	 * @uuid_e: UUID-E of the Enrollee
303e5b75505Sopenharmony_ci	 * @dev_pw: Device Password (PIN) used during registration
304e5b75505Sopenharmony_ci	 * @dev_pw_len: Length of dev_pw in octets
305e5b75505Sopenharmony_ci	 *
306e5b75505Sopenharmony_ci	 * This callback is called whenever an Enrollee completes registration
307e5b75505Sopenharmony_ci	 * successfully.
308e5b75505Sopenharmony_ci	 */
309e5b75505Sopenharmony_ci	void (*reg_success_cb)(void *ctx, const u8 *mac_addr,
310e5b75505Sopenharmony_ci			       const u8 *uuid_e, const u8 *dev_pw,
311e5b75505Sopenharmony_ci			       size_t dev_pw_len);
312e5b75505Sopenharmony_ci
313e5b75505Sopenharmony_ci	/**
314e5b75505Sopenharmony_ci	 * set_sel_reg_cb - Callback for reporting selected registrar changes
315e5b75505Sopenharmony_ci	 * @ctx: Higher layer context data (cb_ctx)
316e5b75505Sopenharmony_ci	 * @sel_reg: Whether the Registrar is selected
317e5b75505Sopenharmony_ci	 * @dev_passwd_id: Device Password ID to indicate with method or
318e5b75505Sopenharmony_ci	 *	specific password the Registrar intends to use
319e5b75505Sopenharmony_ci	 * @sel_reg_config_methods: Bit field of active config methods
320e5b75505Sopenharmony_ci	 *
321e5b75505Sopenharmony_ci	 * This callback is called whenever the Selected Registrar state
322e5b75505Sopenharmony_ci	 * changes (e.g., a new PIN becomes available or PBC is invoked). This
323e5b75505Sopenharmony_ci	 * callback is only used by External Registrar implementation;
324e5b75505Sopenharmony_ci	 * set_ie_cb() is used by AP implementation in similar caes, but it
325e5b75505Sopenharmony_ci	 * provides the full WPS IE data instead of just the minimal Registrar
326e5b75505Sopenharmony_ci	 * state information.
327e5b75505Sopenharmony_ci	 */
328e5b75505Sopenharmony_ci	void (*set_sel_reg_cb)(void *ctx, int sel_reg, u16 dev_passwd_id,
329e5b75505Sopenharmony_ci			       u16 sel_reg_config_methods);
330e5b75505Sopenharmony_ci
331e5b75505Sopenharmony_ci	/**
332e5b75505Sopenharmony_ci	 * enrollee_seen_cb - Callback for reporting Enrollee based on ProbeReq
333e5b75505Sopenharmony_ci	 * @ctx: Higher layer context data (cb_ctx)
334e5b75505Sopenharmony_ci	 * @addr: MAC address of the Enrollee
335e5b75505Sopenharmony_ci	 * @uuid_e: UUID of the Enrollee
336e5b75505Sopenharmony_ci	 * @pri_dev_type: Primary device type
337e5b75505Sopenharmony_ci	 * @config_methods: Config Methods
338e5b75505Sopenharmony_ci	 * @dev_password_id: Device Password ID
339e5b75505Sopenharmony_ci	 * @request_type: Request Type
340e5b75505Sopenharmony_ci	 * @dev_name: Device Name (if available)
341e5b75505Sopenharmony_ci	 */
342e5b75505Sopenharmony_ci	void (*enrollee_seen_cb)(void *ctx, const u8 *addr, const u8 *uuid_e,
343e5b75505Sopenharmony_ci				 const u8 *pri_dev_type, u16 config_methods,
344e5b75505Sopenharmony_ci				 u16 dev_password_id, u8 request_type,
345e5b75505Sopenharmony_ci				 const char *dev_name);
346e5b75505Sopenharmony_ci
347e5b75505Sopenharmony_ci	/**
348e5b75505Sopenharmony_ci	 * lookup_pskfile_cb - Callback for searching for PSK in wpa_psk_file
349e5b75505Sopenharmony_ci	 * @ctx: Higher layer context data (cb_ctx)
350e5b75505Sopenharmony_ci	 * @addr: Enrollee's MAC address
351e5b75505Sopenharmony_ci	 * @psk: Pointer to found PSK (output arg)
352e5b75505Sopenharmony_ci	 */
353e5b75505Sopenharmony_ci	int (*lookup_pskfile_cb)(void *ctx, const u8 *mac_addr, const u8 **psk);
354e5b75505Sopenharmony_ci
355e5b75505Sopenharmony_ci	/**
356e5b75505Sopenharmony_ci	 * cb_ctx: Higher layer context data for Registrar callbacks
357e5b75505Sopenharmony_ci	 */
358e5b75505Sopenharmony_ci	void *cb_ctx;
359e5b75505Sopenharmony_ci
360e5b75505Sopenharmony_ci	/**
361e5b75505Sopenharmony_ci	 * skip_cred_build: Do not build credential
362e5b75505Sopenharmony_ci	 *
363e5b75505Sopenharmony_ci	 * This option can be used to disable internal code that builds
364e5b75505Sopenharmony_ci	 * Credential attribute into M8 based on the current network
365e5b75505Sopenharmony_ci	 * configuration and Enrollee capabilities. The extra_cred data will
366e5b75505Sopenharmony_ci	 * then be used as the Credential(s).
367e5b75505Sopenharmony_ci	 */
368e5b75505Sopenharmony_ci	int skip_cred_build;
369e5b75505Sopenharmony_ci
370e5b75505Sopenharmony_ci	/**
371e5b75505Sopenharmony_ci	 * extra_cred: Additional Credential attribute(s)
372e5b75505Sopenharmony_ci	 *
373e5b75505Sopenharmony_ci	 * This optional data (set to %NULL to disable) can be used to add
374e5b75505Sopenharmony_ci	 * Credential attribute(s) for other networks into M8. If
375e5b75505Sopenharmony_ci	 * skip_cred_build is set, this will also override the automatically
376e5b75505Sopenharmony_ci	 * generated Credential attribute.
377e5b75505Sopenharmony_ci	 */
378e5b75505Sopenharmony_ci	const u8 *extra_cred;
379e5b75505Sopenharmony_ci
380e5b75505Sopenharmony_ci	/**
381e5b75505Sopenharmony_ci	 * extra_cred_len: Length of extra_cred in octets
382e5b75505Sopenharmony_ci	 */
383e5b75505Sopenharmony_ci	size_t extra_cred_len;
384e5b75505Sopenharmony_ci
385e5b75505Sopenharmony_ci	/**
386e5b75505Sopenharmony_ci	 * disable_auto_conf - Disable auto-configuration on first registration
387e5b75505Sopenharmony_ci	 *
388e5b75505Sopenharmony_ci	 * By default, the AP that is started in not configured state will
389e5b75505Sopenharmony_ci	 * generate a random PSK and move to configured state when the first
390e5b75505Sopenharmony_ci	 * registration protocol run is completed successfully. This option can
391e5b75505Sopenharmony_ci	 * be used to disable this functionality and leave it up to an external
392e5b75505Sopenharmony_ci	 * program to take care of configuration. This requires the extra_cred
393e5b75505Sopenharmony_ci	 * to be set with a suitable Credential and skip_cred_build being used.
394e5b75505Sopenharmony_ci	 */
395e5b75505Sopenharmony_ci	int disable_auto_conf;
396e5b75505Sopenharmony_ci
397e5b75505Sopenharmony_ci	/**
398e5b75505Sopenharmony_ci	 * dualband - Whether this is a concurrent dualband AP
399e5b75505Sopenharmony_ci	 */
400e5b75505Sopenharmony_ci	int dualband;
401e5b75505Sopenharmony_ci
402e5b75505Sopenharmony_ci	/**
403e5b75505Sopenharmony_ci	 * force_per_enrollee_psk - Force per-Enrollee random PSK
404e5b75505Sopenharmony_ci	 *
405e5b75505Sopenharmony_ci	 * This forces per-Enrollee random PSK to be generated even if a default
406e5b75505Sopenharmony_ci	 * PSK is set for a network.
407e5b75505Sopenharmony_ci	 */
408e5b75505Sopenharmony_ci	int force_per_enrollee_psk;
409e5b75505Sopenharmony_ci
410e5b75505Sopenharmony_ci	/**
411e5b75505Sopenharmony_ci	 * multi_ap_backhaul_ssid - SSID to supply to a Multi-AP backhaul
412e5b75505Sopenharmony_ci	 * enrollee
413e5b75505Sopenharmony_ci	 *
414e5b75505Sopenharmony_ci	 * This SSID is used by the Registrar to fill in information for
415e5b75505Sopenharmony_ci	 * Credentials when the enrollee advertises it is a Multi-AP backhaul
416e5b75505Sopenharmony_ci	 * STA.
417e5b75505Sopenharmony_ci	 */
418e5b75505Sopenharmony_ci	const u8 *multi_ap_backhaul_ssid;
419e5b75505Sopenharmony_ci
420e5b75505Sopenharmony_ci	/**
421e5b75505Sopenharmony_ci	 * multi_ap_backhaul_ssid_len - Length of multi_ap_backhaul_ssid in
422e5b75505Sopenharmony_ci	 * octets
423e5b75505Sopenharmony_ci	 */
424e5b75505Sopenharmony_ci	size_t multi_ap_backhaul_ssid_len;
425e5b75505Sopenharmony_ci
426e5b75505Sopenharmony_ci	/**
427e5b75505Sopenharmony_ci	 * multi_ap_backhaul_network_key - The Network Key (PSK) for the
428e5b75505Sopenharmony_ci	 * Multi-AP backhaul enrollee.
429e5b75505Sopenharmony_ci	 *
430e5b75505Sopenharmony_ci	 * This key can be either the ASCII passphrase (8..63 characters) or the
431e5b75505Sopenharmony_ci	 * 32-octet PSK (64 hex characters).
432e5b75505Sopenharmony_ci	 */
433e5b75505Sopenharmony_ci	const u8 *multi_ap_backhaul_network_key;
434e5b75505Sopenharmony_ci
435e5b75505Sopenharmony_ci	/**
436e5b75505Sopenharmony_ci	 * multi_ap_backhaul_network_key_len - Length of
437e5b75505Sopenharmony_ci	 * multi_ap_backhaul_network_key in octets
438e5b75505Sopenharmony_ci	 */
439e5b75505Sopenharmony_ci	size_t multi_ap_backhaul_network_key_len;
440e5b75505Sopenharmony_ci};
441e5b75505Sopenharmony_ci
442e5b75505Sopenharmony_ci
443e5b75505Sopenharmony_ci/**
444e5b75505Sopenharmony_ci * enum wps_event - WPS event types
445e5b75505Sopenharmony_ci */
446e5b75505Sopenharmony_cienum wps_event {
447e5b75505Sopenharmony_ci	/**
448e5b75505Sopenharmony_ci	 * WPS_EV_M2D - M2D received (Registrar did not know us)
449e5b75505Sopenharmony_ci	 */
450e5b75505Sopenharmony_ci	WPS_EV_M2D,
451e5b75505Sopenharmony_ci
452e5b75505Sopenharmony_ci	/**
453e5b75505Sopenharmony_ci	 * WPS_EV_FAIL - Registration failed
454e5b75505Sopenharmony_ci	 */
455e5b75505Sopenharmony_ci	WPS_EV_FAIL,
456e5b75505Sopenharmony_ci
457e5b75505Sopenharmony_ci	/**
458e5b75505Sopenharmony_ci	 * WPS_EV_SUCCESS - Registration succeeded
459e5b75505Sopenharmony_ci	 */
460e5b75505Sopenharmony_ci	WPS_EV_SUCCESS,
461e5b75505Sopenharmony_ci
462e5b75505Sopenharmony_ci	/**
463e5b75505Sopenharmony_ci	 * WPS_EV_PWD_AUTH_FAIL - Password authentication failed
464e5b75505Sopenharmony_ci	 */
465e5b75505Sopenharmony_ci	WPS_EV_PWD_AUTH_FAIL,
466e5b75505Sopenharmony_ci
467e5b75505Sopenharmony_ci	/**
468e5b75505Sopenharmony_ci	 * WPS_EV_PBC_OVERLAP - PBC session overlap detected
469e5b75505Sopenharmony_ci	 */
470e5b75505Sopenharmony_ci	WPS_EV_PBC_OVERLAP,
471e5b75505Sopenharmony_ci
472e5b75505Sopenharmony_ci	/**
473e5b75505Sopenharmony_ci	 * WPS_EV_PBC_TIMEOUT - PBC walktime expired before protocol run start
474e5b75505Sopenharmony_ci	 */
475e5b75505Sopenharmony_ci	WPS_EV_PBC_TIMEOUT,
476e5b75505Sopenharmony_ci
477e5b75505Sopenharmony_ci	/**
478e5b75505Sopenharmony_ci	 * WPS_EV_PBC_ACTIVE - PBC mode was activated
479e5b75505Sopenharmony_ci	 */
480e5b75505Sopenharmony_ci	WPS_EV_PBC_ACTIVE,
481e5b75505Sopenharmony_ci
482e5b75505Sopenharmony_ci	/**
483e5b75505Sopenharmony_ci	 * WPS_EV_PBC_DISABLE - PBC mode was disabled
484e5b75505Sopenharmony_ci	 */
485e5b75505Sopenharmony_ci	WPS_EV_PBC_DISABLE,
486e5b75505Sopenharmony_ci
487e5b75505Sopenharmony_ci	/**
488e5b75505Sopenharmony_ci	 * WPS_EV_ER_AP_ADD - ER: AP added
489e5b75505Sopenharmony_ci	 */
490e5b75505Sopenharmony_ci	WPS_EV_ER_AP_ADD,
491e5b75505Sopenharmony_ci
492e5b75505Sopenharmony_ci	/**
493e5b75505Sopenharmony_ci	 * WPS_EV_ER_AP_REMOVE - ER: AP removed
494e5b75505Sopenharmony_ci	 */
495e5b75505Sopenharmony_ci	WPS_EV_ER_AP_REMOVE,
496e5b75505Sopenharmony_ci
497e5b75505Sopenharmony_ci	/**
498e5b75505Sopenharmony_ci	 * WPS_EV_ER_ENROLLEE_ADD - ER: Enrollee added
499e5b75505Sopenharmony_ci	 */
500e5b75505Sopenharmony_ci	WPS_EV_ER_ENROLLEE_ADD,
501e5b75505Sopenharmony_ci
502e5b75505Sopenharmony_ci	/**
503e5b75505Sopenharmony_ci	 * WPS_EV_ER_ENROLLEE_REMOVE - ER: Enrollee removed
504e5b75505Sopenharmony_ci	 */
505e5b75505Sopenharmony_ci	WPS_EV_ER_ENROLLEE_REMOVE,
506e5b75505Sopenharmony_ci
507e5b75505Sopenharmony_ci	/**
508e5b75505Sopenharmony_ci	 * WPS_EV_ER_AP_SETTINGS - ER: AP Settings learned
509e5b75505Sopenharmony_ci	 */
510e5b75505Sopenharmony_ci	WPS_EV_ER_AP_SETTINGS,
511e5b75505Sopenharmony_ci
512e5b75505Sopenharmony_ci	/**
513e5b75505Sopenharmony_ci	 * WPS_EV_ER_SET_SELECTED_REGISTRAR - ER: SetSelectedRegistrar event
514e5b75505Sopenharmony_ci	 */
515e5b75505Sopenharmony_ci	WPS_EV_ER_SET_SELECTED_REGISTRAR,
516e5b75505Sopenharmony_ci
517e5b75505Sopenharmony_ci	/**
518e5b75505Sopenharmony_ci	 * WPS_EV_AP_PIN_SUCCESS - External Registrar used correct AP PIN
519e5b75505Sopenharmony_ci	 */
520e5b75505Sopenharmony_ci	WPS_EV_AP_PIN_SUCCESS
521e5b75505Sopenharmony_ci};
522e5b75505Sopenharmony_ci
523e5b75505Sopenharmony_ci/**
524e5b75505Sopenharmony_ci * union wps_event_data - WPS event data
525e5b75505Sopenharmony_ci */
526e5b75505Sopenharmony_ciunion wps_event_data {
527e5b75505Sopenharmony_ci	/**
528e5b75505Sopenharmony_ci	 * struct wps_event_m2d - M2D event data
529e5b75505Sopenharmony_ci	 */
530e5b75505Sopenharmony_ci	struct wps_event_m2d {
531e5b75505Sopenharmony_ci		u16 config_methods;
532e5b75505Sopenharmony_ci		const u8 *manufacturer;
533e5b75505Sopenharmony_ci		size_t manufacturer_len;
534e5b75505Sopenharmony_ci		const u8 *model_name;
535e5b75505Sopenharmony_ci		size_t model_name_len;
536e5b75505Sopenharmony_ci		const u8 *model_number;
537e5b75505Sopenharmony_ci		size_t model_number_len;
538e5b75505Sopenharmony_ci		const u8 *serial_number;
539e5b75505Sopenharmony_ci		size_t serial_number_len;
540e5b75505Sopenharmony_ci		const u8 *dev_name;
541e5b75505Sopenharmony_ci		size_t dev_name_len;
542e5b75505Sopenharmony_ci		const u8 *primary_dev_type; /* 8 octets */
543e5b75505Sopenharmony_ci		u16 config_error;
544e5b75505Sopenharmony_ci		u16 dev_password_id;
545e5b75505Sopenharmony_ci	} m2d;
546e5b75505Sopenharmony_ci
547e5b75505Sopenharmony_ci	/**
548e5b75505Sopenharmony_ci	 * struct wps_event_fail - Registration failure information
549e5b75505Sopenharmony_ci	 * @msg: enum wps_msg_type
550e5b75505Sopenharmony_ci	 */
551e5b75505Sopenharmony_ci	struct wps_event_fail {
552e5b75505Sopenharmony_ci		int msg;
553e5b75505Sopenharmony_ci		u16 config_error;
554e5b75505Sopenharmony_ci		u16 error_indication;
555e5b75505Sopenharmony_ci		u8 peer_macaddr[ETH_ALEN];
556e5b75505Sopenharmony_ci	} fail;
557e5b75505Sopenharmony_ci
558e5b75505Sopenharmony_ci	struct wps_event_success {
559e5b75505Sopenharmony_ci		u8 peer_macaddr[ETH_ALEN];
560e5b75505Sopenharmony_ci	} success;
561e5b75505Sopenharmony_ci
562e5b75505Sopenharmony_ci	struct wps_event_pwd_auth_fail {
563e5b75505Sopenharmony_ci		int enrollee;
564e5b75505Sopenharmony_ci		int part;
565e5b75505Sopenharmony_ci		u8 peer_macaddr[ETH_ALEN];
566e5b75505Sopenharmony_ci	} pwd_auth_fail;
567e5b75505Sopenharmony_ci
568e5b75505Sopenharmony_ci	struct wps_event_er_ap {
569e5b75505Sopenharmony_ci		const u8 *uuid;
570e5b75505Sopenharmony_ci		const u8 *mac_addr;
571e5b75505Sopenharmony_ci		const char *friendly_name;
572e5b75505Sopenharmony_ci		const char *manufacturer;
573e5b75505Sopenharmony_ci		const char *manufacturer_url;
574e5b75505Sopenharmony_ci		const char *model_description;
575e5b75505Sopenharmony_ci		const char *model_name;
576e5b75505Sopenharmony_ci		const char *model_number;
577e5b75505Sopenharmony_ci		const char *model_url;
578e5b75505Sopenharmony_ci		const char *serial_number;
579e5b75505Sopenharmony_ci		const char *upc;
580e5b75505Sopenharmony_ci		const u8 *pri_dev_type;
581e5b75505Sopenharmony_ci		u8 wps_state;
582e5b75505Sopenharmony_ci	} ap;
583e5b75505Sopenharmony_ci
584e5b75505Sopenharmony_ci	struct wps_event_er_enrollee {
585e5b75505Sopenharmony_ci		const u8 *uuid;
586e5b75505Sopenharmony_ci		const u8 *mac_addr;
587e5b75505Sopenharmony_ci		int m1_received;
588e5b75505Sopenharmony_ci		u16 config_methods;
589e5b75505Sopenharmony_ci		u16 dev_passwd_id;
590e5b75505Sopenharmony_ci		const u8 *pri_dev_type;
591e5b75505Sopenharmony_ci		const char *dev_name;
592e5b75505Sopenharmony_ci		const char *manufacturer;
593e5b75505Sopenharmony_ci		const char *model_name;
594e5b75505Sopenharmony_ci		const char *model_number;
595e5b75505Sopenharmony_ci		const char *serial_number;
596e5b75505Sopenharmony_ci	} enrollee;
597e5b75505Sopenharmony_ci
598e5b75505Sopenharmony_ci	struct wps_event_er_ap_settings {
599e5b75505Sopenharmony_ci		const u8 *uuid;
600e5b75505Sopenharmony_ci		const struct wps_credential *cred;
601e5b75505Sopenharmony_ci	} ap_settings;
602e5b75505Sopenharmony_ci
603e5b75505Sopenharmony_ci	struct wps_event_er_set_selected_registrar {
604e5b75505Sopenharmony_ci		const u8 *uuid;
605e5b75505Sopenharmony_ci		int sel_reg;
606e5b75505Sopenharmony_ci		u16 dev_passwd_id;
607e5b75505Sopenharmony_ci		u16 sel_reg_config_methods;
608e5b75505Sopenharmony_ci		enum {
609e5b75505Sopenharmony_ci			WPS_ER_SET_SEL_REG_START,
610e5b75505Sopenharmony_ci			WPS_ER_SET_SEL_REG_DONE,
611e5b75505Sopenharmony_ci			WPS_ER_SET_SEL_REG_FAILED
612e5b75505Sopenharmony_ci		} state;
613e5b75505Sopenharmony_ci	} set_sel_reg;
614e5b75505Sopenharmony_ci};
615e5b75505Sopenharmony_ci
616e5b75505Sopenharmony_ci/**
617e5b75505Sopenharmony_ci * struct upnp_pending_message - Pending PutWLANResponse messages
618e5b75505Sopenharmony_ci * @next: Pointer to next pending message or %NULL
619e5b75505Sopenharmony_ci * @addr: NewWLANEventMAC
620e5b75505Sopenharmony_ci * @msg: NewMessage
621e5b75505Sopenharmony_ci * @type: Message Type
622e5b75505Sopenharmony_ci */
623e5b75505Sopenharmony_cistruct upnp_pending_message {
624e5b75505Sopenharmony_ci	struct upnp_pending_message *next;
625e5b75505Sopenharmony_ci	u8 addr[ETH_ALEN];
626e5b75505Sopenharmony_ci	struct wpabuf *msg;
627e5b75505Sopenharmony_ci	enum wps_msg_type type;
628e5b75505Sopenharmony_ci};
629e5b75505Sopenharmony_ci
630e5b75505Sopenharmony_ci/**
631e5b75505Sopenharmony_ci * struct wps_context - Long term WPS context data
632e5b75505Sopenharmony_ci *
633e5b75505Sopenharmony_ci * This data is stored at the higher layer Authenticator or Supplicant data
634e5b75505Sopenharmony_ci * structures and it is maintained over multiple registration protocol runs.
635e5b75505Sopenharmony_ci */
636e5b75505Sopenharmony_cistruct wps_context {
637e5b75505Sopenharmony_ci	/**
638e5b75505Sopenharmony_ci	 * ap - Whether the local end is an access point
639e5b75505Sopenharmony_ci	 */
640e5b75505Sopenharmony_ci	int ap;
641e5b75505Sopenharmony_ci
642e5b75505Sopenharmony_ci	/**
643e5b75505Sopenharmony_ci	 * registrar - Pointer to WPS registrar data from wps_registrar_init()
644e5b75505Sopenharmony_ci	 */
645e5b75505Sopenharmony_ci	struct wps_registrar *registrar;
646e5b75505Sopenharmony_ci
647e5b75505Sopenharmony_ci	/**
648e5b75505Sopenharmony_ci	 * wps_state - Current WPS state
649e5b75505Sopenharmony_ci	 */
650e5b75505Sopenharmony_ci	enum wps_state wps_state;
651e5b75505Sopenharmony_ci
652e5b75505Sopenharmony_ci	/**
653e5b75505Sopenharmony_ci	 * ap_setup_locked - Whether AP setup is locked (only used at AP)
654e5b75505Sopenharmony_ci	 */
655e5b75505Sopenharmony_ci	int ap_setup_locked;
656e5b75505Sopenharmony_ci
657e5b75505Sopenharmony_ci	/**
658e5b75505Sopenharmony_ci	 * uuid - Own UUID
659e5b75505Sopenharmony_ci	 */
660e5b75505Sopenharmony_ci	u8 uuid[16];
661e5b75505Sopenharmony_ci
662e5b75505Sopenharmony_ci	/**
663e5b75505Sopenharmony_ci	 * ssid - SSID
664e5b75505Sopenharmony_ci	 *
665e5b75505Sopenharmony_ci	 * This SSID is used by the Registrar to fill in information for
666e5b75505Sopenharmony_ci	 * Credentials. In addition, AP uses it when acting as an Enrollee to
667e5b75505Sopenharmony_ci	 * notify Registrar of the current configuration.
668e5b75505Sopenharmony_ci	 */
669e5b75505Sopenharmony_ci	u8 ssid[SSID_MAX_LEN];
670e5b75505Sopenharmony_ci
671e5b75505Sopenharmony_ci	/**
672e5b75505Sopenharmony_ci	 * ssid_len - Length of ssid in octets
673e5b75505Sopenharmony_ci	 */
674e5b75505Sopenharmony_ci	size_t ssid_len;
675e5b75505Sopenharmony_ci
676e5b75505Sopenharmony_ci	/**
677e5b75505Sopenharmony_ci	 * dev - Own WPS device data
678e5b75505Sopenharmony_ci	 */
679e5b75505Sopenharmony_ci	struct wps_device_data dev;
680e5b75505Sopenharmony_ci
681e5b75505Sopenharmony_ci	/**
682e5b75505Sopenharmony_ci	 * dh_ctx - Context data for Diffie-Hellman operation
683e5b75505Sopenharmony_ci	 */
684e5b75505Sopenharmony_ci	void *dh_ctx;
685e5b75505Sopenharmony_ci
686e5b75505Sopenharmony_ci	/**
687e5b75505Sopenharmony_ci	 * dh_privkey - Diffie-Hellman private key
688e5b75505Sopenharmony_ci	 */
689e5b75505Sopenharmony_ci	struct wpabuf *dh_privkey;
690e5b75505Sopenharmony_ci
691e5b75505Sopenharmony_ci	/**
692e5b75505Sopenharmony_ci	 * dh_pubkey_oob - Diffie-Hellman public key
693e5b75505Sopenharmony_ci	 */
694e5b75505Sopenharmony_ci	struct wpabuf *dh_pubkey;
695e5b75505Sopenharmony_ci
696e5b75505Sopenharmony_ci	/**
697e5b75505Sopenharmony_ci	 * config_methods - Enabled configuration methods
698e5b75505Sopenharmony_ci	 *
699e5b75505Sopenharmony_ci	 * Bit field of WPS_CONFIG_*
700e5b75505Sopenharmony_ci	 */
701e5b75505Sopenharmony_ci	u16 config_methods;
702e5b75505Sopenharmony_ci
703e5b75505Sopenharmony_ci	/**
704e5b75505Sopenharmony_ci	 * encr_types - Enabled encryption types (bit field of WPS_ENCR_*)
705e5b75505Sopenharmony_ci	 */
706e5b75505Sopenharmony_ci	u16 encr_types;
707e5b75505Sopenharmony_ci
708e5b75505Sopenharmony_ci	/**
709e5b75505Sopenharmony_ci	 * encr_types_rsn - Enabled encryption types for RSN (WPS_ENCR_*)
710e5b75505Sopenharmony_ci	 */
711e5b75505Sopenharmony_ci	u16 encr_types_rsn;
712e5b75505Sopenharmony_ci
713e5b75505Sopenharmony_ci	/**
714e5b75505Sopenharmony_ci	 * encr_types_wpa - Enabled encryption types for WPA (WPS_ENCR_*)
715e5b75505Sopenharmony_ci	 */
716e5b75505Sopenharmony_ci	u16 encr_types_wpa;
717e5b75505Sopenharmony_ci
718e5b75505Sopenharmony_ci	/**
719e5b75505Sopenharmony_ci	 * auth_types - Authentication types (bit field of WPS_AUTH_*)
720e5b75505Sopenharmony_ci	 */
721e5b75505Sopenharmony_ci	u16 auth_types;
722e5b75505Sopenharmony_ci
723e5b75505Sopenharmony_ci	/**
724e5b75505Sopenharmony_ci	 * encr_types - Current AP encryption type (WPS_ENCR_*)
725e5b75505Sopenharmony_ci	 */
726e5b75505Sopenharmony_ci	u16 ap_encr_type;
727e5b75505Sopenharmony_ci
728e5b75505Sopenharmony_ci	/**
729e5b75505Sopenharmony_ci	 * ap_auth_type - Current AP authentication types (WPS_AUTH_*)
730e5b75505Sopenharmony_ci	 */
731e5b75505Sopenharmony_ci	u16 ap_auth_type;
732e5b75505Sopenharmony_ci
733e5b75505Sopenharmony_ci	/**
734e5b75505Sopenharmony_ci	 * network_key - The current Network Key (PSK) or %NULL to generate new
735e5b75505Sopenharmony_ci	 *
736e5b75505Sopenharmony_ci	 * If %NULL, Registrar will generate per-device PSK. In addition, AP
737e5b75505Sopenharmony_ci	 * uses this when acting as an Enrollee to notify Registrar of the
738e5b75505Sopenharmony_ci	 * current configuration.
739e5b75505Sopenharmony_ci	 *
740e5b75505Sopenharmony_ci	 * When using WPA/WPA2-Personal, this key can be either the ASCII
741e5b75505Sopenharmony_ci	 * passphrase (8..63 characters) or the 32-octet PSK (64 hex
742e5b75505Sopenharmony_ci	 * characters). When this is set to the ASCII passphrase, the PSK can
743e5b75505Sopenharmony_ci	 * be provided in the psk buffer and used per-Enrollee to control which
744e5b75505Sopenharmony_ci	 * key type is included in the Credential (e.g., to reduce calculation
745e5b75505Sopenharmony_ci	 * need on low-powered devices by provisioning PSK while still allowing
746e5b75505Sopenharmony_ci	 * other devices to get the passphrase).
747e5b75505Sopenharmony_ci	 */
748e5b75505Sopenharmony_ci	u8 *network_key;
749e5b75505Sopenharmony_ci
750e5b75505Sopenharmony_ci	/**
751e5b75505Sopenharmony_ci	 * network_key_len - Length of network_key in octets
752e5b75505Sopenharmony_ci	 */
753e5b75505Sopenharmony_ci	size_t network_key_len;
754e5b75505Sopenharmony_ci
755e5b75505Sopenharmony_ci	/**
756e5b75505Sopenharmony_ci	 * psk - The current network PSK
757e5b75505Sopenharmony_ci	 *
758e5b75505Sopenharmony_ci	 * This optional value can be used to provide the current PSK if
759e5b75505Sopenharmony_ci	 * network_key is set to the ASCII passphrase.
760e5b75505Sopenharmony_ci	 */
761e5b75505Sopenharmony_ci	u8 psk[32];
762e5b75505Sopenharmony_ci
763e5b75505Sopenharmony_ci	/**
764e5b75505Sopenharmony_ci	 * psk_set - Whether psk value is set
765e5b75505Sopenharmony_ci	 */
766e5b75505Sopenharmony_ci	int psk_set;
767e5b75505Sopenharmony_ci
768e5b75505Sopenharmony_ci	/**
769e5b75505Sopenharmony_ci	 * ap_settings - AP Settings override for M7 (only used at AP)
770e5b75505Sopenharmony_ci	 *
771e5b75505Sopenharmony_ci	 * If %NULL, AP Settings attributes will be generated based on the
772e5b75505Sopenharmony_ci	 * current network configuration.
773e5b75505Sopenharmony_ci	 */
774e5b75505Sopenharmony_ci	u8 *ap_settings;
775e5b75505Sopenharmony_ci
776e5b75505Sopenharmony_ci	/**
777e5b75505Sopenharmony_ci	 * ap_settings_len - Length of ap_settings in octets
778e5b75505Sopenharmony_ci	 */
779e5b75505Sopenharmony_ci	size_t ap_settings_len;
780e5b75505Sopenharmony_ci
781e5b75505Sopenharmony_ci	/**
782e5b75505Sopenharmony_ci	 * friendly_name - Friendly Name (required for UPnP)
783e5b75505Sopenharmony_ci	 */
784e5b75505Sopenharmony_ci	char *friendly_name;
785e5b75505Sopenharmony_ci
786e5b75505Sopenharmony_ci	/**
787e5b75505Sopenharmony_ci	 * manufacturer_url - Manufacturer URL (optional for UPnP)
788e5b75505Sopenharmony_ci	 */
789e5b75505Sopenharmony_ci	char *manufacturer_url;
790e5b75505Sopenharmony_ci
791e5b75505Sopenharmony_ci	/**
792e5b75505Sopenharmony_ci	 * model_description - Model Description (recommended for UPnP)
793e5b75505Sopenharmony_ci	 */
794e5b75505Sopenharmony_ci	char *model_description;
795e5b75505Sopenharmony_ci
796e5b75505Sopenharmony_ci	/**
797e5b75505Sopenharmony_ci	 * model_url - Model URL (optional for UPnP)
798e5b75505Sopenharmony_ci	 */
799e5b75505Sopenharmony_ci	char *model_url;
800e5b75505Sopenharmony_ci
801e5b75505Sopenharmony_ci	/**
802e5b75505Sopenharmony_ci	 * upc - Universal Product Code (optional for UPnP)
803e5b75505Sopenharmony_ci	 */
804e5b75505Sopenharmony_ci	char *upc;
805e5b75505Sopenharmony_ci
806e5b75505Sopenharmony_ci	/**
807e5b75505Sopenharmony_ci	 * cred_cb - Callback to notify that new Credentials were received
808e5b75505Sopenharmony_ci	 * @ctx: Higher layer context data (cb_ctx)
809e5b75505Sopenharmony_ci	 * @cred: The received Credential
810e5b75505Sopenharmony_ci	 * Return: 0 on success, -1 on failure
811e5b75505Sopenharmony_ci	 */
812e5b75505Sopenharmony_ci	int (*cred_cb)(void *ctx, const struct wps_credential *cred);
813e5b75505Sopenharmony_ci
814e5b75505Sopenharmony_ci	/**
815e5b75505Sopenharmony_ci	 * event_cb - Event callback (state information about progress)
816e5b75505Sopenharmony_ci	 * @ctx: Higher layer context data (cb_ctx)
817e5b75505Sopenharmony_ci	 * @event: Event type
818e5b75505Sopenharmony_ci	 * @data: Event data
819e5b75505Sopenharmony_ci	 */
820e5b75505Sopenharmony_ci	void (*event_cb)(void *ctx, enum wps_event event,
821e5b75505Sopenharmony_ci			 union wps_event_data *data);
822e5b75505Sopenharmony_ci
823e5b75505Sopenharmony_ci	/**
824e5b75505Sopenharmony_ci	 * rf_band_cb - Fetch currently used RF band
825e5b75505Sopenharmony_ci	 * @ctx: Higher layer context data (cb_ctx)
826e5b75505Sopenharmony_ci	 * Return: Current used RF band or 0 if not known
827e5b75505Sopenharmony_ci	 */
828e5b75505Sopenharmony_ci	int (*rf_band_cb)(void *ctx);
829e5b75505Sopenharmony_ci
830e5b75505Sopenharmony_ci	/**
831e5b75505Sopenharmony_ci	 * cb_ctx: Higher layer context data for callbacks
832e5b75505Sopenharmony_ci	 */
833e5b75505Sopenharmony_ci	void *cb_ctx;
834e5b75505Sopenharmony_ci
835e5b75505Sopenharmony_ci	struct upnp_wps_device_sm *wps_upnp;
836e5b75505Sopenharmony_ci
837e5b75505Sopenharmony_ci	/* Pending messages from UPnP PutWLANResponse */
838e5b75505Sopenharmony_ci	struct upnp_pending_message *upnp_msgs;
839e5b75505Sopenharmony_ci
840e5b75505Sopenharmony_ci	u16 ap_nfc_dev_pw_id;
841e5b75505Sopenharmony_ci	struct wpabuf *ap_nfc_dh_pubkey;
842e5b75505Sopenharmony_ci	struct wpabuf *ap_nfc_dh_privkey;
843e5b75505Sopenharmony_ci	struct wpabuf *ap_nfc_dev_pw;
844e5b75505Sopenharmony_ci
845e5b75505Sopenharmony_ci	/* Whether to send WPA2-PSK passphrase as a passphrase instead of PSK
846e5b75505Sopenharmony_ci	 * for WPA3-Personal transition mode needs. */
847e5b75505Sopenharmony_ci	bool use_passphrase;
848e5b75505Sopenharmony_ci};
849e5b75505Sopenharmony_ci
850e5b75505Sopenharmony_cistruct wps_registrar *
851e5b75505Sopenharmony_ciwps_registrar_init(struct wps_context *wps,
852e5b75505Sopenharmony_ci		   const struct wps_registrar_config *cfg);
853e5b75505Sopenharmony_civoid wps_registrar_deinit(struct wps_registrar *reg);
854e5b75505Sopenharmony_ciint wps_registrar_add_pin(struct wps_registrar *reg, const u8 *addr,
855e5b75505Sopenharmony_ci			  const u8 *uuid, const u8 *pin, size_t pin_len,
856e5b75505Sopenharmony_ci			  int timeout);
857e5b75505Sopenharmony_ciint wps_registrar_invalidate_pin(struct wps_registrar *reg, const u8 *uuid);
858e5b75505Sopenharmony_ciint wps_registrar_wps_cancel(struct wps_registrar *reg);
859e5b75505Sopenharmony_ciint wps_registrar_unlock_pin(struct wps_registrar *reg, const u8 *uuid);
860e5b75505Sopenharmony_ciint wps_registrar_button_pushed(struct wps_registrar *reg,
861e5b75505Sopenharmony_ci				const u8 *p2p_dev_addr);
862e5b75505Sopenharmony_civoid wps_registrar_complete(struct wps_registrar *registrar, const u8 *uuid_e,
863e5b75505Sopenharmony_ci			    const u8 *dev_pw, size_t dev_pw_len);
864e5b75505Sopenharmony_civoid wps_registrar_probe_req_rx(struct wps_registrar *reg, const u8 *addr,
865e5b75505Sopenharmony_ci				const struct wpabuf *wps_data,
866e5b75505Sopenharmony_ci				int p2p_wildcard);
867e5b75505Sopenharmony_ciint wps_registrar_update_ie(struct wps_registrar *reg);
868e5b75505Sopenharmony_ciint wps_registrar_get_info(struct wps_registrar *reg, const u8 *addr,
869e5b75505Sopenharmony_ci			   char *buf, size_t buflen);
870e5b75505Sopenharmony_ciint wps_registrar_config_ap(struct wps_registrar *reg,
871e5b75505Sopenharmony_ci			    struct wps_credential *cred);
872e5b75505Sopenharmony_ciint wps_registrar_add_nfc_pw_token(struct wps_registrar *reg,
873e5b75505Sopenharmony_ci				   const u8 *pubkey_hash, u16 pw_id,
874e5b75505Sopenharmony_ci				   const u8 *dev_pw, size_t dev_pw_len,
875e5b75505Sopenharmony_ci				   int pk_hash_provided_oob);
876e5b75505Sopenharmony_ciint wps_registrar_add_nfc_password_token(struct wps_registrar *reg,
877e5b75505Sopenharmony_ci					 const u8 *oob_dev_pw,
878e5b75505Sopenharmony_ci					 size_t oob_dev_pw_len);
879e5b75505Sopenharmony_civoid wps_registrar_flush(struct wps_registrar *reg);
880e5b75505Sopenharmony_ciint wps_registrar_update_multi_ap(struct wps_registrar *reg,
881e5b75505Sopenharmony_ci				  const u8 *multi_ap_backhaul_ssid,
882e5b75505Sopenharmony_ci				  size_t multi_ap_backhaul_ssid_len,
883e5b75505Sopenharmony_ci				  const u8 *multi_ap_backhaul_network_key,
884e5b75505Sopenharmony_ci				  size_t multi_ap_backhaul_network_key_len);
885e5b75505Sopenharmony_ci
886e5b75505Sopenharmony_ciint wps_build_credential_wrap(struct wpabuf *msg,
887e5b75505Sopenharmony_ci			      const struct wps_credential *cred);
888e5b75505Sopenharmony_ci
889e5b75505Sopenharmony_ciunsigned int wps_pin_checksum(unsigned int pin);
890e5b75505Sopenharmony_ciunsigned int wps_pin_valid(unsigned int pin);
891e5b75505Sopenharmony_ciint wps_generate_pin(unsigned int *pin);
892e5b75505Sopenharmony_ciint wps_pin_str_valid(const char *pin);
893e5b75505Sopenharmony_civoid wps_free_pending_msgs(struct upnp_pending_message *msgs);
894e5b75505Sopenharmony_ci
895e5b75505Sopenharmony_cistruct wpabuf * wps_get_oob_cred(struct wps_context *wps, int rf_band,
896e5b75505Sopenharmony_ci				 int channel);
897e5b75505Sopenharmony_ciint wps_oob_use_cred(struct wps_context *wps, struct wps_parse_attr *attr);
898e5b75505Sopenharmony_ciint wps_attr_text(struct wpabuf *data, char *buf, char *end);
899e5b75505Sopenharmony_ciconst char * wps_ei_str(enum wps_error_indication ei);
900e5b75505Sopenharmony_ci
901e5b75505Sopenharmony_cistruct wps_er * wps_er_init(struct wps_context *wps, const char *ifname,
902e5b75505Sopenharmony_ci			    const char *filter);
903e5b75505Sopenharmony_civoid wps_er_refresh(struct wps_er *er);
904e5b75505Sopenharmony_civoid wps_er_deinit(struct wps_er *er, void (*cb)(void *ctx), void *ctx);
905e5b75505Sopenharmony_civoid wps_er_set_sel_reg(struct wps_er *er, int sel_reg, u16 dev_passwd_id,
906e5b75505Sopenharmony_ci			u16 sel_reg_config_methods);
907e5b75505Sopenharmony_ciint wps_er_pbc(struct wps_er *er, const u8 *uuid, const u8 *addr);
908e5b75505Sopenharmony_ciconst u8 * wps_er_get_sta_uuid(struct wps_er *er, const u8 *addr);
909e5b75505Sopenharmony_ciint wps_er_learn(struct wps_er *er, const u8 *uuid, const u8 *addr,
910e5b75505Sopenharmony_ci		 const u8 *pin, size_t pin_len);
911e5b75505Sopenharmony_ciint wps_er_set_config(struct wps_er *er, const u8 *uuid, const u8 *addr,
912e5b75505Sopenharmony_ci		      const struct wps_credential *cred);
913e5b75505Sopenharmony_ciint wps_er_config(struct wps_er *er, const u8 *uuid, const u8 *addr,
914e5b75505Sopenharmony_ci		  const u8 *pin, size_t pin_len,
915e5b75505Sopenharmony_ci		  const struct wps_credential *cred);
916e5b75505Sopenharmony_cistruct wpabuf * wps_er_config_token_from_cred(struct wps_context *wps,
917e5b75505Sopenharmony_ci					      struct wps_credential *cred);
918e5b75505Sopenharmony_cistruct wpabuf * wps_er_nfc_config_token(struct wps_er *er, const u8 *uuid,
919e5b75505Sopenharmony_ci					const u8 *addr);
920e5b75505Sopenharmony_cistruct wpabuf * wps_er_nfc_handover_sel(struct wps_er *er,
921e5b75505Sopenharmony_ci					struct wps_context *wps, const u8 *uuid,
922e5b75505Sopenharmony_ci					const u8 *addr, struct wpabuf *pubkey);
923e5b75505Sopenharmony_ci
924e5b75505Sopenharmony_ciint wps_dev_type_str2bin(const char *str, u8 dev_type[WPS_DEV_TYPE_LEN]);
925e5b75505Sopenharmony_cichar * wps_dev_type_bin2str(const u8 dev_type[WPS_DEV_TYPE_LEN], char *buf,
926e5b75505Sopenharmony_ci			    size_t buf_len);
927e5b75505Sopenharmony_civoid uuid_gen_mac_addr(const u8 *mac_addr, u8 *uuid);
928e5b75505Sopenharmony_ciu16 wps_config_methods_str2bin(const char *str);
929e5b75505Sopenharmony_cistruct wpabuf * wps_build_nfc_pw_token(u16 dev_pw_id,
930e5b75505Sopenharmony_ci				       const struct wpabuf *pubkey,
931e5b75505Sopenharmony_ci				       const struct wpabuf *dev_pw);
932e5b75505Sopenharmony_cistruct wpabuf * wps_nfc_token_build(int ndef, int id, struct wpabuf *pubkey,
933e5b75505Sopenharmony_ci				    struct wpabuf *dev_pw);
934e5b75505Sopenharmony_ciint wps_nfc_gen_dh(struct wpabuf **pubkey, struct wpabuf **privkey);
935e5b75505Sopenharmony_cistruct wpabuf * wps_nfc_token_gen(int ndef, int *id, struct wpabuf **pubkey,
936e5b75505Sopenharmony_ci				  struct wpabuf **privkey,
937e5b75505Sopenharmony_ci				  struct wpabuf **dev_pw);
938e5b75505Sopenharmony_cistruct wpabuf * wps_build_nfc_handover_req(struct wps_context *ctx,
939e5b75505Sopenharmony_ci					   struct wpabuf *nfc_dh_pubkey);
940e5b75505Sopenharmony_cistruct wpabuf * wps_build_nfc_handover_sel(struct wps_context *ctx,
941e5b75505Sopenharmony_ci					   struct wpabuf *nfc_dh_pubkey,
942e5b75505Sopenharmony_ci					   const u8 *bssid, int freq);
943e5b75505Sopenharmony_cistruct wpabuf * wps_build_nfc_handover_req_p2p(struct wps_context *ctx,
944e5b75505Sopenharmony_ci					       struct wpabuf *nfc_dh_pubkey);
945e5b75505Sopenharmony_cistruct wpabuf * wps_build_nfc_handover_sel_p2p(struct wps_context *ctx,
946e5b75505Sopenharmony_ci					       int nfc_dev_pw_id,
947e5b75505Sopenharmony_ci					       struct wpabuf *nfc_dh_pubkey,
948e5b75505Sopenharmony_ci					       struct wpabuf *nfc_dev_pw);
949e5b75505Sopenharmony_ci
950e5b75505Sopenharmony_ci/* ndef.c */
951e5b75505Sopenharmony_cistruct wpabuf * ndef_parse_wifi(const struct wpabuf *buf);
952e5b75505Sopenharmony_cistruct wpabuf * ndef_build_wifi(const struct wpabuf *buf);
953e5b75505Sopenharmony_cistruct wpabuf * ndef_parse_p2p(const struct wpabuf *buf);
954e5b75505Sopenharmony_cistruct wpabuf * ndef_build_p2p(const struct wpabuf *buf);
955e5b75505Sopenharmony_ci
956e5b75505Sopenharmony_ci#ifdef CONFIG_WPS_STRICT
957e5b75505Sopenharmony_ciint wps_validate_beacon(const struct wpabuf *wps_ie);
958e5b75505Sopenharmony_ciint wps_validate_beacon_probe_resp(const struct wpabuf *wps_ie, int probe,
959e5b75505Sopenharmony_ci				   const u8 *addr);
960e5b75505Sopenharmony_ciint wps_validate_probe_req(const struct wpabuf *wps_ie, const u8 *addr);
961e5b75505Sopenharmony_ciint wps_validate_assoc_req(const struct wpabuf *wps_ie);
962e5b75505Sopenharmony_ciint wps_validate_assoc_resp(const struct wpabuf *wps_ie);
963e5b75505Sopenharmony_ciint wps_validate_m1(const struct wpabuf *tlvs);
964e5b75505Sopenharmony_ciint wps_validate_m2(const struct wpabuf *tlvs);
965e5b75505Sopenharmony_ciint wps_validate_m2d(const struct wpabuf *tlvs);
966e5b75505Sopenharmony_ciint wps_validate_m3(const struct wpabuf *tlvs);
967e5b75505Sopenharmony_ciint wps_validate_m4(const struct wpabuf *tlvs);
968e5b75505Sopenharmony_ciint wps_validate_m4_encr(const struct wpabuf *tlvs, int wps2);
969e5b75505Sopenharmony_ciint wps_validate_m5(const struct wpabuf *tlvs);
970e5b75505Sopenharmony_ciint wps_validate_m5_encr(const struct wpabuf *tlvs, int wps2);
971e5b75505Sopenharmony_ciint wps_validate_m6(const struct wpabuf *tlvs);
972e5b75505Sopenharmony_ciint wps_validate_m6_encr(const struct wpabuf *tlvs, int wps2);
973e5b75505Sopenharmony_ciint wps_validate_m7(const struct wpabuf *tlvs);
974e5b75505Sopenharmony_ciint wps_validate_m7_encr(const struct wpabuf *tlvs, int ap, int wps2);
975e5b75505Sopenharmony_ciint wps_validate_m8(const struct wpabuf *tlvs);
976e5b75505Sopenharmony_ciint wps_validate_m8_encr(const struct wpabuf *tlvs, int ap, int wps2);
977e5b75505Sopenharmony_ciint wps_validate_wsc_ack(const struct wpabuf *tlvs);
978e5b75505Sopenharmony_ciint wps_validate_wsc_nack(const struct wpabuf *tlvs);
979e5b75505Sopenharmony_ciint wps_validate_wsc_done(const struct wpabuf *tlvs);
980e5b75505Sopenharmony_ciint wps_validate_upnp_set_selected_registrar(const struct wpabuf *tlvs);
981e5b75505Sopenharmony_ci#else /* CONFIG_WPS_STRICT */
982e5b75505Sopenharmony_cistatic inline int wps_validate_beacon(const struct wpabuf *wps_ie){
983e5b75505Sopenharmony_ci	return 0;
984e5b75505Sopenharmony_ci}
985e5b75505Sopenharmony_ci
986e5b75505Sopenharmony_cistatic inline int wps_validate_beacon_probe_resp(const struct wpabuf *wps_ie,
987e5b75505Sopenharmony_ci						 int probe, const u8 *addr)
988e5b75505Sopenharmony_ci{
989e5b75505Sopenharmony_ci	return 0;
990e5b75505Sopenharmony_ci}
991e5b75505Sopenharmony_ci
992e5b75505Sopenharmony_cistatic inline int wps_validate_probe_req(const struct wpabuf *wps_ie,
993e5b75505Sopenharmony_ci					 const u8 *addr)
994e5b75505Sopenharmony_ci{
995e5b75505Sopenharmony_ci	return 0;
996e5b75505Sopenharmony_ci}
997e5b75505Sopenharmony_ci
998e5b75505Sopenharmony_cistatic inline int wps_validate_assoc_req(const struct wpabuf *wps_ie)
999e5b75505Sopenharmony_ci{
1000e5b75505Sopenharmony_ci	return 0;
1001e5b75505Sopenharmony_ci}
1002e5b75505Sopenharmony_ci
1003e5b75505Sopenharmony_cistatic inline int wps_validate_assoc_resp(const struct wpabuf *wps_ie)
1004e5b75505Sopenharmony_ci{
1005e5b75505Sopenharmony_ci	return 0;
1006e5b75505Sopenharmony_ci}
1007e5b75505Sopenharmony_ci
1008e5b75505Sopenharmony_cistatic inline int wps_validate_m1(const struct wpabuf *tlvs)
1009e5b75505Sopenharmony_ci{
1010e5b75505Sopenharmony_ci	return 0;
1011e5b75505Sopenharmony_ci}
1012e5b75505Sopenharmony_ci
1013e5b75505Sopenharmony_cistatic inline int wps_validate_m2(const struct wpabuf *tlvs)
1014e5b75505Sopenharmony_ci{
1015e5b75505Sopenharmony_ci	return 0;
1016e5b75505Sopenharmony_ci}
1017e5b75505Sopenharmony_ci
1018e5b75505Sopenharmony_cistatic inline int wps_validate_m2d(const struct wpabuf *tlvs)
1019e5b75505Sopenharmony_ci{
1020e5b75505Sopenharmony_ci	return 0;
1021e5b75505Sopenharmony_ci}
1022e5b75505Sopenharmony_ci
1023e5b75505Sopenharmony_cistatic inline int wps_validate_m3(const struct wpabuf *tlvs)
1024e5b75505Sopenharmony_ci{
1025e5b75505Sopenharmony_ci	return 0;
1026e5b75505Sopenharmony_ci}
1027e5b75505Sopenharmony_ci
1028e5b75505Sopenharmony_cistatic inline int wps_validate_m4(const struct wpabuf *tlvs)
1029e5b75505Sopenharmony_ci{
1030e5b75505Sopenharmony_ci	return 0;
1031e5b75505Sopenharmony_ci}
1032e5b75505Sopenharmony_ci
1033e5b75505Sopenharmony_cistatic inline int wps_validate_m4_encr(const struct wpabuf *tlvs, int wps2)
1034e5b75505Sopenharmony_ci{
1035e5b75505Sopenharmony_ci	return 0;
1036e5b75505Sopenharmony_ci}
1037e5b75505Sopenharmony_ci
1038e5b75505Sopenharmony_cistatic inline int wps_validate_m5(const struct wpabuf *tlvs)
1039e5b75505Sopenharmony_ci{
1040e5b75505Sopenharmony_ci	return 0;
1041e5b75505Sopenharmony_ci}
1042e5b75505Sopenharmony_ci
1043e5b75505Sopenharmony_cistatic inline int wps_validate_m5_encr(const struct wpabuf *tlvs, int wps2)
1044e5b75505Sopenharmony_ci{
1045e5b75505Sopenharmony_ci	return 0;
1046e5b75505Sopenharmony_ci}
1047e5b75505Sopenharmony_ci
1048e5b75505Sopenharmony_cistatic inline int wps_validate_m6(const struct wpabuf *tlvs)
1049e5b75505Sopenharmony_ci{
1050e5b75505Sopenharmony_ci	return 0;
1051e5b75505Sopenharmony_ci}
1052e5b75505Sopenharmony_ci
1053e5b75505Sopenharmony_cistatic inline int wps_validate_m6_encr(const struct wpabuf *tlvs, int wps2)
1054e5b75505Sopenharmony_ci{
1055e5b75505Sopenharmony_ci	return 0;
1056e5b75505Sopenharmony_ci}
1057e5b75505Sopenharmony_ci
1058e5b75505Sopenharmony_cistatic inline int wps_validate_m7(const struct wpabuf *tlvs)
1059e5b75505Sopenharmony_ci{
1060e5b75505Sopenharmony_ci	return 0;
1061e5b75505Sopenharmony_ci}
1062e5b75505Sopenharmony_ci
1063e5b75505Sopenharmony_cistatic inline int wps_validate_m7_encr(const struct wpabuf *tlvs, int ap,
1064e5b75505Sopenharmony_ci				       int wps2)
1065e5b75505Sopenharmony_ci{
1066e5b75505Sopenharmony_ci	return 0;
1067e5b75505Sopenharmony_ci}
1068e5b75505Sopenharmony_ci
1069e5b75505Sopenharmony_cistatic inline int wps_validate_m8(const struct wpabuf *tlvs)
1070e5b75505Sopenharmony_ci{
1071e5b75505Sopenharmony_ci	return 0;
1072e5b75505Sopenharmony_ci}
1073e5b75505Sopenharmony_ci
1074e5b75505Sopenharmony_cistatic inline int wps_validate_m8_encr(const struct wpabuf *tlvs, int ap,
1075e5b75505Sopenharmony_ci				       int wps2)
1076e5b75505Sopenharmony_ci{
1077e5b75505Sopenharmony_ci	return 0;
1078e5b75505Sopenharmony_ci}
1079e5b75505Sopenharmony_ci
1080e5b75505Sopenharmony_cistatic inline int wps_validate_wsc_ack(const struct wpabuf *tlvs)
1081e5b75505Sopenharmony_ci{
1082e5b75505Sopenharmony_ci	return 0;
1083e5b75505Sopenharmony_ci}
1084e5b75505Sopenharmony_ci
1085e5b75505Sopenharmony_cistatic inline int wps_validate_wsc_nack(const struct wpabuf *tlvs)
1086e5b75505Sopenharmony_ci{
1087e5b75505Sopenharmony_ci	return 0;
1088e5b75505Sopenharmony_ci}
1089e5b75505Sopenharmony_ci
1090e5b75505Sopenharmony_cistatic inline int wps_validate_wsc_done(const struct wpabuf *tlvs)
1091e5b75505Sopenharmony_ci{
1092e5b75505Sopenharmony_ci	return 0;
1093e5b75505Sopenharmony_ci}
1094e5b75505Sopenharmony_ci
1095e5b75505Sopenharmony_cistatic inline int wps_validate_upnp_set_selected_registrar(
1096e5b75505Sopenharmony_ci	const struct wpabuf *tlvs)
1097e5b75505Sopenharmony_ci{
1098e5b75505Sopenharmony_ci	return 0;
1099e5b75505Sopenharmony_ci}
1100e5b75505Sopenharmony_ci#endif /* CONFIG_WPS_STRICT */
1101e5b75505Sopenharmony_ci
1102e5b75505Sopenharmony_ci#endif /* WPS_H */
1103