1*03f9172cSAndroid Build Coastguard Worker /*
2*03f9172cSAndroid Build Coastguard Worker * WPA Supplicant - Basic AP mode support routines
3*03f9172cSAndroid Build Coastguard Worker * Copyright (c) 2003-2009, Jouni Malinen <[email protected]>
4*03f9172cSAndroid Build Coastguard Worker * Copyright (c) 2009, Atheros Communications
5*03f9172cSAndroid Build Coastguard Worker *
6*03f9172cSAndroid Build Coastguard Worker * This software may be distributed under the terms of the BSD license.
7*03f9172cSAndroid Build Coastguard Worker * See README for more details.
8*03f9172cSAndroid Build Coastguard Worker */
9*03f9172cSAndroid Build Coastguard Worker
10*03f9172cSAndroid Build Coastguard Worker #ifndef AP_H
11*03f9172cSAndroid Build Coastguard Worker #define AP_H
12*03f9172cSAndroid Build Coastguard Worker
13*03f9172cSAndroid Build Coastguard Worker enum macaddr_acl;
14*03f9172cSAndroid Build Coastguard Worker
15*03f9172cSAndroid Build Coastguard Worker int wpa_supplicant_create_ap(struct wpa_supplicant *wpa_s,
16*03f9172cSAndroid Build Coastguard Worker struct wpa_ssid *ssid);
17*03f9172cSAndroid Build Coastguard Worker void wpa_supplicant_ap_deinit(struct wpa_supplicant *wpa_s);
18*03f9172cSAndroid Build Coastguard Worker void wpa_supplicant_ap_rx_eapol(struct wpa_supplicant *wpa_s,
19*03f9172cSAndroid Build Coastguard Worker const u8 *src_addr, const u8 *buf, size_t len,
20*03f9172cSAndroid Build Coastguard Worker enum frame_encryption encrypted);
21*03f9172cSAndroid Build Coastguard Worker int wpa_supplicant_ap_wps_pbc(struct wpa_supplicant *wpa_s, const u8 *bssid,
22*03f9172cSAndroid Build Coastguard Worker const u8 *p2p_dev_addr);
23*03f9172cSAndroid Build Coastguard Worker int wpa_supplicant_ap_wps_pin(struct wpa_supplicant *wpa_s, const u8 *bssid,
24*03f9172cSAndroid Build Coastguard Worker const char *pin, char *buf, size_t buflen,
25*03f9172cSAndroid Build Coastguard Worker int timeout);
26*03f9172cSAndroid Build Coastguard Worker int wpa_supplicant_ap_wps_cancel(struct wpa_supplicant *wpa_s);
27*03f9172cSAndroid Build Coastguard Worker void wpas_wps_ap_pin_disable(struct wpa_supplicant *wpa_s);
28*03f9172cSAndroid Build Coastguard Worker const char * wpas_wps_ap_pin_random(struct wpa_supplicant *wpa_s, int timeout);
29*03f9172cSAndroid Build Coastguard Worker const char * wpas_wps_ap_pin_get(struct wpa_supplicant *wpa_s);
30*03f9172cSAndroid Build Coastguard Worker int wpas_wps_ap_pin_set(struct wpa_supplicant *wpa_s, const char *pin,
31*03f9172cSAndroid Build Coastguard Worker int timeout);
32*03f9172cSAndroid Build Coastguard Worker int ap_ctrl_iface_sta_first(struct wpa_supplicant *wpa_s,
33*03f9172cSAndroid Build Coastguard Worker char *buf, size_t buflen);
34*03f9172cSAndroid Build Coastguard Worker int ap_ctrl_iface_sta(struct wpa_supplicant *wpa_s, const char *txtaddr,
35*03f9172cSAndroid Build Coastguard Worker char *buf, size_t buflen);
36*03f9172cSAndroid Build Coastguard Worker int ap_ctrl_iface_sta_next(struct wpa_supplicant *wpa_s, const char *txtaddr,
37*03f9172cSAndroid Build Coastguard Worker char *buf, size_t buflen);
38*03f9172cSAndroid Build Coastguard Worker int ap_ctrl_iface_sta_deauthenticate(struct wpa_supplicant *wpa_s,
39*03f9172cSAndroid Build Coastguard Worker const char *txtaddr);
40*03f9172cSAndroid Build Coastguard Worker int ap_ctrl_iface_sta_disassociate(struct wpa_supplicant *wpa_s,
41*03f9172cSAndroid Build Coastguard Worker const char *txtaddr);
42*03f9172cSAndroid Build Coastguard Worker int ap_ctrl_iface_wpa_get_status(struct wpa_supplicant *wpa_s, char *buf,
43*03f9172cSAndroid Build Coastguard Worker size_t buflen, int verbose);
44*03f9172cSAndroid Build Coastguard Worker int ap_ctrl_iface_disassoc_imminent(struct wpa_supplicant *wpa_s,
45*03f9172cSAndroid Build Coastguard Worker const char *buf);
46*03f9172cSAndroid Build Coastguard Worker int ap_ctrl_iface_ess_disassoc(struct wpa_supplicant *wpa_s, const char *buf);
47*03f9172cSAndroid Build Coastguard Worker int ap_ctrl_iface_bss_tm_req(struct wpa_supplicant *wpa_s, const char *buf);
48*03f9172cSAndroid Build Coastguard Worker int ap_ctrl_iface_acl_add_mac(struct wpa_supplicant *wpa_s,
49*03f9172cSAndroid Build Coastguard Worker enum macaddr_acl acl_type, const char *buf);
50*03f9172cSAndroid Build Coastguard Worker int ap_ctrl_iface_acl_del_mac(struct wpa_supplicant *wpa_s,
51*03f9172cSAndroid Build Coastguard Worker enum macaddr_acl acl_type, const char *buf);
52*03f9172cSAndroid Build Coastguard Worker int ap_ctrl_iface_acl_show_mac(struct wpa_supplicant *wpa_s,
53*03f9172cSAndroid Build Coastguard Worker enum macaddr_acl acl_type, char *buf,
54*03f9172cSAndroid Build Coastguard Worker size_t buflen);
55*03f9172cSAndroid Build Coastguard Worker void ap_ctrl_iface_acl_clear_list(struct wpa_supplicant *wpa_s,
56*03f9172cSAndroid Build Coastguard Worker enum macaddr_acl acl_type);
57*03f9172cSAndroid Build Coastguard Worker int ap_ctrl_iface_disassoc_deny_mac(struct wpa_supplicant *wpa_s);
58*03f9172cSAndroid Build Coastguard Worker int ap_ctrl_iface_disassoc_accept_mac(struct wpa_supplicant *wpa_s);
59*03f9172cSAndroid Build Coastguard Worker int ap_ctrl_iface_set_acl(struct wpa_supplicant *wpa_s);
60*03f9172cSAndroid Build Coastguard Worker void ap_tx_status(void *ctx, const u8 *addr,
61*03f9172cSAndroid Build Coastguard Worker const u8 *buf, size_t len, int ack);
62*03f9172cSAndroid Build Coastguard Worker void ap_eapol_tx_status(void *ctx, const u8 *dst,
63*03f9172cSAndroid Build Coastguard Worker const u8 *data, size_t len, int ack);
64*03f9172cSAndroid Build Coastguard Worker void ap_client_poll_ok(void *ctx, const u8 *addr);
65*03f9172cSAndroid Build Coastguard Worker void ap_rx_from_unknown_sta(void *ctx, const u8 *addr, int wds);
66*03f9172cSAndroid Build Coastguard Worker void ap_mgmt_rx(void *ctx, struct rx_mgmt *rx_mgmt);
67*03f9172cSAndroid Build Coastguard Worker void ap_mgmt_tx_cb(void *ctx, const u8 *buf, size_t len, u16 stype, int ok);
68*03f9172cSAndroid Build Coastguard Worker int wpa_supplicant_ap_update_beacon(struct wpa_supplicant *wpa_s);
69*03f9172cSAndroid Build Coastguard Worker int wpa_supplicant_ap_mac_addr_filter(struct wpa_supplicant *wpa_s,
70*03f9172cSAndroid Build Coastguard Worker const u8 *addr);
71*03f9172cSAndroid Build Coastguard Worker void wpa_supplicant_ap_pwd_auth_fail(struct wpa_supplicant *wpa_s);
72*03f9172cSAndroid Build Coastguard Worker int ap_switch_channel(struct wpa_supplicant *wpa_s,
73*03f9172cSAndroid Build Coastguard Worker struct csa_settings *settings);
74*03f9172cSAndroid Build Coastguard Worker int ap_ctrl_iface_chanswitch(struct wpa_supplicant *wpa_s, const char *txtaddr);
75*03f9172cSAndroid Build Coastguard Worker void wpas_ap_ch_switch(struct wpa_supplicant *wpa_s, int freq, int ht,
76*03f9172cSAndroid Build Coastguard Worker int offset, int width, int cf1, int cf2,
77*03f9172cSAndroid Build Coastguard Worker u16 punct_bitmap, int finished);
78*03f9172cSAndroid Build Coastguard Worker struct wpabuf * wpas_ap_wps_nfc_config_token(struct wpa_supplicant *wpa_s,
79*03f9172cSAndroid Build Coastguard Worker int ndef);
80*03f9172cSAndroid Build Coastguard Worker #ifdef CONFIG_AP
81*03f9172cSAndroid Build Coastguard Worker struct wpabuf * wpas_ap_wps_nfc_handover_sel(struct wpa_supplicant *wpa_s,
82*03f9172cSAndroid Build Coastguard Worker int ndef);
83*03f9172cSAndroid Build Coastguard Worker #else /* CONFIG_AP */
84*03f9172cSAndroid Build Coastguard Worker static inline struct wpabuf *
wpas_ap_wps_nfc_handover_sel(struct wpa_supplicant * wpa_s,int ndef)85*03f9172cSAndroid Build Coastguard Worker wpas_ap_wps_nfc_handover_sel(struct wpa_supplicant *wpa_s,
86*03f9172cSAndroid Build Coastguard Worker int ndef)
87*03f9172cSAndroid Build Coastguard Worker {
88*03f9172cSAndroid Build Coastguard Worker return NULL;
89*03f9172cSAndroid Build Coastguard Worker }
90*03f9172cSAndroid Build Coastguard Worker #endif /* CONFIG_AP */
91*03f9172cSAndroid Build Coastguard Worker
92*03f9172cSAndroid Build Coastguard Worker int wpas_ap_wps_nfc_report_handover(struct wpa_supplicant *wpa_s,
93*03f9172cSAndroid Build Coastguard Worker const struct wpabuf *req,
94*03f9172cSAndroid Build Coastguard Worker const struct wpabuf *sel);
95*03f9172cSAndroid Build Coastguard Worker int wpas_ap_wps_add_nfc_pw(struct wpa_supplicant *wpa_s, u16 pw_id,
96*03f9172cSAndroid Build Coastguard Worker const struct wpabuf *pw, const u8 *pubkey_hash);
97*03f9172cSAndroid Build Coastguard Worker
98*03f9172cSAndroid Build Coastguard Worker struct hostapd_config;
99*03f9172cSAndroid Build Coastguard Worker int wpa_supplicant_conf_ap_ht(struct wpa_supplicant *wpa_s,
100*03f9172cSAndroid Build Coastguard Worker struct wpa_ssid *ssid,
101*03f9172cSAndroid Build Coastguard Worker struct hostapd_config *conf);
102*03f9172cSAndroid Build Coastguard Worker
103*03f9172cSAndroid Build Coastguard Worker int wpas_ap_stop_ap(struct wpa_supplicant *wpa_s);
104*03f9172cSAndroid Build Coastguard Worker
105*03f9172cSAndroid Build Coastguard Worker int wpas_ap_pmksa_cache_list(struct wpa_supplicant *wpa_s, char *buf,
106*03f9172cSAndroid Build Coastguard Worker size_t len);
107*03f9172cSAndroid Build Coastguard Worker void wpas_ap_pmksa_cache_flush(struct wpa_supplicant *wpa_s);
108*03f9172cSAndroid Build Coastguard Worker int wpas_ap_pmksa_cache_list_mesh(struct wpa_supplicant *wpa_s, const u8 *addr,
109*03f9172cSAndroid Build Coastguard Worker char *buf, size_t len);
110*03f9172cSAndroid Build Coastguard Worker int wpas_ap_pmksa_cache_add_external(struct wpa_supplicant *wpa_s, char *cmd);
111*03f9172cSAndroid Build Coastguard Worker int wpas_ap_update_beacon(struct wpa_supplicant *wpa_s);
112*03f9172cSAndroid Build Coastguard Worker
113*03f9172cSAndroid Build Coastguard Worker void wpas_ap_event_dfs_radar_detected(struct wpa_supplicant *wpa_s,
114*03f9172cSAndroid Build Coastguard Worker struct dfs_event *radar);
115*03f9172cSAndroid Build Coastguard Worker void wpas_ap_event_dfs_cac_started(struct wpa_supplicant *wpa_s,
116*03f9172cSAndroid Build Coastguard Worker struct dfs_event *radar);
117*03f9172cSAndroid Build Coastguard Worker void wpas_ap_event_dfs_cac_finished(struct wpa_supplicant *wpa_s,
118*03f9172cSAndroid Build Coastguard Worker struct dfs_event *radar);
119*03f9172cSAndroid Build Coastguard Worker void wpas_ap_event_dfs_cac_aborted(struct wpa_supplicant *wpa_s,
120*03f9172cSAndroid Build Coastguard Worker struct dfs_event *radar);
121*03f9172cSAndroid Build Coastguard Worker void wpas_ap_event_dfs_cac_nop_finished(struct wpa_supplicant *wpa_s,
122*03f9172cSAndroid Build Coastguard Worker struct dfs_event *radar);
123*03f9172cSAndroid Build Coastguard Worker
124*03f9172cSAndroid Build Coastguard Worker void ap_periodic(struct wpa_supplicant *wpa_s);
125*03f9172cSAndroid Build Coastguard Worker
126*03f9172cSAndroid Build Coastguard Worker #endif /* AP_H */
127