blob: 8aa5ffa294a7ee0a856b3067c3610318f825733a [file] [log] [blame]
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07001/*
2 * WPA Supplicant - Basic AP mode support routines
3 * Copyright (c) 2003-2009, Jouni Malinen <j@w1.fi>
4 * Copyright (c) 2009, Atheros Communications
5 *
Dmitry Shmidtc5ec7f52012-03-06 16:33:24 -08006 * This software may be distributed under the terms of the BSD license.
7 * See README for more details.
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07008 */
9
10#ifndef AP_H
11#define AP_H
12
13int wpa_supplicant_create_ap(struct wpa_supplicant *wpa_s,
14 struct wpa_ssid *ssid);
15void wpa_supplicant_ap_deinit(struct wpa_supplicant *wpa_s);
16void wpa_supplicant_ap_rx_eapol(struct wpa_supplicant *wpa_s,
17 const u8 *src_addr, const u8 *buf, size_t len);
18int wpa_supplicant_ap_wps_pbc(struct wpa_supplicant *wpa_s, const u8 *bssid,
19 const u8 *p2p_dev_addr);
20int wpa_supplicant_ap_wps_pin(struct wpa_supplicant *wpa_s, const u8 *bssid,
Dmitry Shmidtd5e49232012-12-03 15:08:10 -080021 const char *pin, char *buf, size_t buflen,
22 int timeout);
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -070023int wpa_supplicant_ap_wps_cancel(struct wpa_supplicant *wpa_s);
24void wpas_wps_ap_pin_disable(struct wpa_supplicant *wpa_s);
25const char * wpas_wps_ap_pin_random(struct wpa_supplicant *wpa_s, int timeout);
26const char * wpas_wps_ap_pin_get(struct wpa_supplicant *wpa_s);
27int wpas_wps_ap_pin_set(struct wpa_supplicant *wpa_s, const char *pin,
28 int timeout);
29int ap_ctrl_iface_sta_first(struct wpa_supplicant *wpa_s,
30 char *buf, size_t buflen);
31int ap_ctrl_iface_sta(struct wpa_supplicant *wpa_s, const char *txtaddr,
32 char *buf, size_t buflen);
33int ap_ctrl_iface_sta_next(struct wpa_supplicant *wpa_s, const char *txtaddr,
34 char *buf, size_t buflen);
Dmitry Shmidt04949592012-07-19 12:16:46 -070035int ap_ctrl_iface_sta_deauthenticate(struct wpa_supplicant *wpa_s,
36 const char *txtaddr);
37int ap_ctrl_iface_sta_disassociate(struct wpa_supplicant *wpa_s,
38 const char *txtaddr);
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -070039int ap_ctrl_iface_wpa_get_status(struct wpa_supplicant *wpa_s, char *buf,
40 size_t buflen, int verbose);
41void ap_tx_status(void *ctx, const u8 *addr,
42 const u8 *buf, size_t len, int ack);
Dmitry Shmidt1f69aa52012-01-24 16:10:04 -080043void ap_eapol_tx_status(void *ctx, const u8 *dst,
44 const u8 *data, size_t len, int ack);
45void ap_client_poll_ok(void *ctx, const u8 *addr);
46void ap_rx_from_unknown_sta(void *ctx, const u8 *addr, int wds);
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -070047void ap_mgmt_rx(void *ctx, struct rx_mgmt *rx_mgmt);
48void ap_mgmt_tx_cb(void *ctx, const u8 *buf, size_t len, u16 stype, int ok);
49int wpa_supplicant_ap_update_beacon(struct wpa_supplicant *wpa_s);
50int wpa_supplicant_ap_mac_addr_filter(struct wpa_supplicant *wpa_s,
51 const u8 *addr);
52void wpa_supplicant_ap_pwd_auth_fail(struct wpa_supplicant *wpa_s);
Dmitry Shmidte0e48dc2013-11-18 12:00:06 -080053int ap_switch_channel(struct wpa_supplicant *wpa_s,
54 struct csa_settings *settings);
55int ap_ctrl_iface_chanswitch(struct wpa_supplicant *wpa_s, const char *txtaddr);
Dmitry Shmidt04949592012-07-19 12:16:46 -070056void wpas_ap_ch_switch(struct wpa_supplicant *wpa_s, int freq, int ht,
Dmitry Shmidt04f534e2013-12-09 15:50:16 -080057 int offset, int width, int cf1, int cf2);
Dmitry Shmidtf8623282013-02-20 14:34:59 -080058struct wpabuf * wpas_ap_wps_nfc_config_token(struct wpa_supplicant *wpa_s,
59 int ndef);
Dmitry Shmidt391c59f2013-09-03 12:16:28 -070060#ifdef CONFIG_AP
Dmitry Shmidtf8623282013-02-20 14:34:59 -080061struct wpabuf * wpas_ap_wps_nfc_handover_sel(struct wpa_supplicant *wpa_s,
62 int ndef);
Dmitry Shmidt391c59f2013-09-03 12:16:28 -070063#else /* CONFIG_AP */
64static inline struct wpabuf *
65wpas_ap_wps_nfc_handover_sel(struct wpa_supplicant *wpa_s,
66 int ndef)
67{
68 return NULL;
69}
70#endif /* CONFIG_AP */
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -070071
Dmitry Shmidtcf32e602014-01-28 10:57:39 -080072int wpas_ap_wps_nfc_report_handover(struct wpa_supplicant *wpa_s,
73 const struct wpabuf *req,
74 const struct wpabuf *sel);
75int wpas_ap_wps_add_nfc_pw(struct wpa_supplicant *wpa_s, u16 pw_id,
76 const struct wpabuf *pw, const u8 *pubkey_hash);
77
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -070078#endif /* AP_H */