18d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt/*
28d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt * WPA Supplicant - Basic AP mode support routines
38d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt * Copyright (c) 2003-2009, Jouni Malinen <j@w1.fi>
48d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt * Copyright (c) 2009, Atheros Communications
58d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt *
6c5ec7f57ead87efa365800228aa0b09a12d9e6c4Dmitry Shmidt * This software may be distributed under the terms of the BSD license.
7c5ec7f57ead87efa365800228aa0b09a12d9e6c4Dmitry Shmidt * See README for more details.
88d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt */
98d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt
108d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt#ifndef AP_H
118d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt#define AP_H
128d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt
138d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidtint wpa_supplicant_create_ap(struct wpa_supplicant *wpa_s,
148d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt			     struct wpa_ssid *ssid);
158d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidtvoid wpa_supplicant_ap_deinit(struct wpa_supplicant *wpa_s);
168d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidtvoid wpa_supplicant_ap_rx_eapol(struct wpa_supplicant *wpa_s,
178d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt				const u8 *src_addr, const u8 *buf, size_t len);
188d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidtint wpa_supplicant_ap_wps_pbc(struct wpa_supplicant *wpa_s, const u8 *bssid,
198d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt			      const u8 *p2p_dev_addr);
208d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidtint wpa_supplicant_ap_wps_pin(struct wpa_supplicant *wpa_s, const u8 *bssid,
21d5e4923d04122f81300fa68fb07d64ede28fd44dDmitry Shmidt			      const char *pin, char *buf, size_t buflen,
22d5e4923d04122f81300fa68fb07d64ede28fd44dDmitry Shmidt			      int timeout);
238d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidtint wpa_supplicant_ap_wps_cancel(struct wpa_supplicant *wpa_s);
248d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidtvoid wpas_wps_ap_pin_disable(struct wpa_supplicant *wpa_s);
258d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidtconst char * wpas_wps_ap_pin_random(struct wpa_supplicant *wpa_s, int timeout);
268d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidtconst char * wpas_wps_ap_pin_get(struct wpa_supplicant *wpa_s);
278d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidtint wpas_wps_ap_pin_set(struct wpa_supplicant *wpa_s, const char *pin,
288d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt			int timeout);
298d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidtint ap_ctrl_iface_sta_first(struct wpa_supplicant *wpa_s,
308d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt			    char *buf, size_t buflen);
318d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidtint ap_ctrl_iface_sta(struct wpa_supplicant *wpa_s, const char *txtaddr,
328d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt		      char *buf, size_t buflen);
338d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidtint ap_ctrl_iface_sta_next(struct wpa_supplicant *wpa_s, const char *txtaddr,
348d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt			   char *buf, size_t buflen);
3504949598a23f501be6eec21697465fd46a28840aDmitry Shmidtint ap_ctrl_iface_sta_deauthenticate(struct wpa_supplicant *wpa_s,
3604949598a23f501be6eec21697465fd46a28840aDmitry Shmidt				     const char *txtaddr);
3704949598a23f501be6eec21697465fd46a28840aDmitry Shmidtint ap_ctrl_iface_sta_disassociate(struct wpa_supplicant *wpa_s,
3804949598a23f501be6eec21697465fd46a28840aDmitry Shmidt				   const char *txtaddr);
398d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidtint ap_ctrl_iface_wpa_get_status(struct wpa_supplicant *wpa_s, char *buf,
408d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt				 size_t buflen, int verbose);
418d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidtvoid ap_tx_status(void *ctx, const u8 *addr,
428d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt		  const u8 *buf, size_t len, int ack);
431f69aa52ea2e0a73ac502565df8c666ee49cab6aDmitry Shmidtvoid ap_eapol_tx_status(void *ctx, const u8 *dst,
441f69aa52ea2e0a73ac502565df8c666ee49cab6aDmitry Shmidt			const u8 *data, size_t len, int ack);
451f69aa52ea2e0a73ac502565df8c666ee49cab6aDmitry Shmidtvoid ap_client_poll_ok(void *ctx, const u8 *addr);
461f69aa52ea2e0a73ac502565df8c666ee49cab6aDmitry Shmidtvoid ap_rx_from_unknown_sta(void *ctx, const u8 *addr, int wds);
478d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidtvoid ap_mgmt_rx(void *ctx, struct rx_mgmt *rx_mgmt);
488d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidtvoid ap_mgmt_tx_cb(void *ctx, const u8 *buf, size_t len, u16 stype, int ok);
498d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidtint wpa_supplicant_ap_update_beacon(struct wpa_supplicant *wpa_s);
508d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidtint wpa_supplicant_ap_mac_addr_filter(struct wpa_supplicant *wpa_s,
518d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt				      const u8 *addr);
528d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidtvoid wpa_supplicant_ap_pwd_auth_fail(struct wpa_supplicant *wpa_s);
53e0e48dc666fb14a7bb60264ca87463ba7bc1fe0bDmitry Shmidtint ap_switch_channel(struct wpa_supplicant *wpa_s,
54e0e48dc666fb14a7bb60264ca87463ba7bc1fe0bDmitry Shmidt		      struct csa_settings *settings);
55e0e48dc666fb14a7bb60264ca87463ba7bc1fe0bDmitry Shmidtint ap_ctrl_iface_chanswitch(struct wpa_supplicant *wpa_s, const char *txtaddr);
5604949598a23f501be6eec21697465fd46a28840aDmitry Shmidtvoid wpas_ap_ch_switch(struct wpa_supplicant *wpa_s, int freq, int ht,
5704f534e89ed127da4077485376f24debc50d80d5Dmitry Shmidt		       int offset, int width, int cf1, int cf2);
58f86232838cf712377867cb42417c1613ab5dc425Dmitry Shmidtstruct wpabuf * wpas_ap_wps_nfc_config_token(struct wpa_supplicant *wpa_s,
59f86232838cf712377867cb42417c1613ab5dc425Dmitry Shmidt					     int ndef);
60391c59f0632df8db1c325da1d31d479b2eedce45Dmitry Shmidt#ifdef CONFIG_AP
61f86232838cf712377867cb42417c1613ab5dc425Dmitry Shmidtstruct wpabuf * wpas_ap_wps_nfc_handover_sel(struct wpa_supplicant *wpa_s,
62f86232838cf712377867cb42417c1613ab5dc425Dmitry Shmidt					     int ndef);
63391c59f0632df8db1c325da1d31d479b2eedce45Dmitry Shmidt#else /* CONFIG_AP */
64391c59f0632df8db1c325da1d31d479b2eedce45Dmitry Shmidtstatic inline struct wpabuf *
65391c59f0632df8db1c325da1d31d479b2eedce45Dmitry Shmidtwpas_ap_wps_nfc_handover_sel(struct wpa_supplicant *wpa_s,
66391c59f0632df8db1c325da1d31d479b2eedce45Dmitry Shmidt			     int ndef)
67391c59f0632df8db1c325da1d31d479b2eedce45Dmitry Shmidt{
68391c59f0632df8db1c325da1d31d479b2eedce45Dmitry Shmidt	return NULL;
69391c59f0632df8db1c325da1d31d479b2eedce45Dmitry Shmidt}
70391c59f0632df8db1c325da1d31d479b2eedce45Dmitry Shmidt#endif /* CONFIG_AP */
718d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt
72cf32e60fa7e0d33fe1551a6dba8dcbbec47ea50eDmitry Shmidtint wpas_ap_wps_nfc_report_handover(struct wpa_supplicant *wpa_s,
73cf32e60fa7e0d33fe1551a6dba8dcbbec47ea50eDmitry Shmidt				    const struct wpabuf *req,
74cf32e60fa7e0d33fe1551a6dba8dcbbec47ea50eDmitry Shmidt				    const struct wpabuf *sel);
75cf32e60fa7e0d33fe1551a6dba8dcbbec47ea50eDmitry Shmidtint wpas_ap_wps_add_nfc_pw(struct wpa_supplicant *wpa_s, u16 pw_id,
76cf32e60fa7e0d33fe1551a6dba8dcbbec47ea50eDmitry Shmidt			   const struct wpabuf *pw, const u8 *pubkey_hash);
77cf32e60fa7e0d33fe1551a6dba8dcbbec47ea50eDmitry Shmidt
786c0da2bb83f6915d8260912362692d1a742e057bDmitry Shmidtstruct hostapd_config;
79d80a401aed31d06f261efd19223cf55d1a2a8228Dmitry Shmidtint wpa_supplicant_conf_ap_ht(struct wpa_supplicant *wpa_s,
80d80a401aed31d06f261efd19223cf55d1a2a8228Dmitry Shmidt			      struct wpa_ssid *ssid,
81d80a401aed31d06f261efd19223cf55d1a2a8228Dmitry Shmidt			      struct hostapd_config *conf);
826c0da2bb83f6915d8260912362692d1a742e057bDmitry Shmidt
837f65602d49069f96a7bb44da8bd79ffe8d4c6a98Dmitry Shmidtint wpas_ap_stop_ap(struct wpa_supplicant *wpa_s);
847f65602d49069f96a7bb44da8bd79ffe8d4c6a98Dmitry Shmidt
85e4663044d3a689fb5458247e9bc0f8b58cf72fcaDmitry Shmidtint wpas_ap_pmksa_cache_list(struct wpa_supplicant *wpa_s, char *buf,
86e4663044d3a689fb5458247e9bc0f8b58cf72fcaDmitry Shmidt			     size_t len);
87e4663044d3a689fb5458247e9bc0f8b58cf72fcaDmitry Shmidtvoid wpas_ap_pmksa_cache_flush(struct wpa_supplicant *wpa_s);
88e4663044d3a689fb5458247e9bc0f8b58cf72fcaDmitry Shmidt
89203eadb9eda41a1dde4a583edb4684319e3f399eDmitry Shmidtvoid wpas_event_dfs_radar_detected(struct wpa_supplicant *wpa_s,
90203eadb9eda41a1dde4a583edb4684319e3f399eDmitry Shmidt				   struct dfs_event *radar);
91203eadb9eda41a1dde4a583edb4684319e3f399eDmitry Shmidtvoid wpas_event_dfs_cac_started(struct wpa_supplicant *wpa_s,
92203eadb9eda41a1dde4a583edb4684319e3f399eDmitry Shmidt				struct dfs_event *radar);
93203eadb9eda41a1dde4a583edb4684319e3f399eDmitry Shmidtvoid wpas_event_dfs_cac_finished(struct wpa_supplicant *wpa_s,
94203eadb9eda41a1dde4a583edb4684319e3f399eDmitry Shmidt				 struct dfs_event *radar);
95203eadb9eda41a1dde4a583edb4684319e3f399eDmitry Shmidtvoid wpas_event_dfs_cac_aborted(struct wpa_supplicant *wpa_s,
96203eadb9eda41a1dde4a583edb4684319e3f399eDmitry Shmidt				struct dfs_event *radar);
97203eadb9eda41a1dde4a583edb4684319e3f399eDmitry Shmidtvoid wpas_event_dfs_cac_nop_finished(struct wpa_supplicant *wpa_s,
98203eadb9eda41a1dde4a583edb4684319e3f399eDmitry Shmidt				     struct dfs_event *radar);
99203eadb9eda41a1dde4a583edb4684319e3f399eDmitry Shmidt
100d80a401aed31d06f261efd19223cf55d1a2a8228Dmitry Shmidtvoid ap_periodic(struct wpa_supplicant *wpa_s);
101d80a401aed31d06f261efd19223cf55d1a2a8228Dmitry Shmidt
1028d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt#endif /* AP_H */
103