p2p_supplicant.h revision 61d9df3e62aaa0e87ad05452fcb95142159a17b6
18d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt/* 28d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt * wpa_supplicant - P2P 38d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt * Copyright (c) 2009-2010, Atheros Communications 48d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt * 5c5ec7f57ead87efa365800228aa0b09a12d9e6c4Dmitry Shmidt * This software may be distributed under the terms of the BSD license. 6c5ec7f57ead87efa365800228aa0b09a12d9e6c4Dmitry Shmidt * See README for more details. 78d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt */ 88d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt 98d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt#ifndef P2P_SUPPLICANT_H 108d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt#define P2P_SUPPLICANT_H 118d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt 128d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidtenum p2p_wps_method; 138d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidtstruct p2p_go_neg_results; 148d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidtenum p2p_send_action_result; 158d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidtstruct p2p_peer_info; 168d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt 178d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidtint wpas_p2p_init(struct wpa_global *global, struct wpa_supplicant *wpa_s); 188d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidtvoid wpas_p2p_deinit(struct wpa_supplicant *wpa_s); 198d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidtvoid wpas_p2p_deinit_global(struct wpa_global *global); 208d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidtint wpas_p2p_connect(struct wpa_supplicant *wpa_s, const u8 *peer_addr, 218d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt const char *pin, enum p2p_wps_method wps_method, 2204949598a23f501be6eec21697465fd46a28840aDmitry Shmidt int persistent_group, int auto_join, int join, 2304949598a23f501be6eec21697465fd46a28840aDmitry Shmidt int auth, int go_intent, int freq, int persistent_id, 2461d9df3e62aaa0e87ad05452fcb95142159a17b6Dmitry Shmidt int pd, int ht40); 258d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidtvoid wpas_p2p_remain_on_channel_cb(struct wpa_supplicant *wpa_s, 268d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt unsigned int freq, unsigned int duration); 278d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidtvoid wpas_p2p_cancel_remain_on_channel_cb(struct wpa_supplicant *wpa_s, 288d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt unsigned int freq); 291f69aa52ea2e0a73ac502565df8c666ee49cab6aDmitry Shmidt#ifdef ANDROID_P2P 30c5ec7f57ead87efa365800228aa0b09a12d9e6c4Dmitry Shmidtint wpas_p2p_handle_frequency_conflicts(struct wpa_supplicant *wpa_s, 311f69aa52ea2e0a73ac502565df8c666ee49cab6aDmitry Shmidt int freq); 321f69aa52ea2e0a73ac502565df8c666ee49cab6aDmitry Shmidt#endif 338d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidtint wpas_p2p_group_remove(struct wpa_supplicant *wpa_s, const char *ifname); 348d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidtint wpas_p2p_group_add(struct wpa_supplicant *wpa_s, int persistent_group, 3561d9df3e62aaa0e87ad05452fcb95142159a17b6Dmitry Shmidt int freq, int ht40); 368d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidtint wpas_p2p_group_add_persistent(struct wpa_supplicant *wpa_s, 378d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt struct wpa_ssid *ssid, int addr_allocated, 3861d9df3e62aaa0e87ad05452fcb95142159a17b6Dmitry Shmidt int freq, int ht40); 398d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidtstruct p2p_group * wpas_p2p_group_init(struct wpa_supplicant *wpa_s, 4004949598a23f501be6eec21697465fd46a28840aDmitry Shmidt struct wpa_ssid *ssid); 418d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidtvoid wpas_p2p_wps_success(struct wpa_supplicant *wpa_s, const u8 *peer_addr, 428d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt int registrar); 4304949598a23f501be6eec21697465fd46a28840aDmitry Shmidtenum wpas_p2p_prov_disc_use { 4404949598a23f501be6eec21697465fd46a28840aDmitry Shmidt WPAS_P2P_PD_FOR_GO_NEG, 4504949598a23f501be6eec21697465fd46a28840aDmitry Shmidt WPAS_P2P_PD_FOR_JOIN, 4604949598a23f501be6eec21697465fd46a28840aDmitry Shmidt WPAS_P2P_PD_AUTO 4704949598a23f501be6eec21697465fd46a28840aDmitry Shmidt}; 488d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidtint wpas_p2p_prov_disc(struct wpa_supplicant *wpa_s, const u8 *peer_addr, 4904949598a23f501be6eec21697465fd46a28840aDmitry Shmidt const char *config_method, 5004949598a23f501be6eec21697465fd46a28840aDmitry Shmidt enum wpas_p2p_prov_disc_use use); 518d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidtvoid wpas_send_action_tx_status(struct wpa_supplicant *wpa_s, const u8 *dst, 528d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt const u8 *data, size_t data_len, 538d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt enum p2p_send_action_result result); 548d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidtint wpas_p2p_scan_result_text(const u8 *ies, size_t ies_len, char *buf, 558d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt char *end); 568d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidtenum p2p_discovery_type; 578d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidtint wpas_p2p_find(struct wpa_supplicant *wpa_s, unsigned int timeout, 588d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt enum p2p_discovery_type type, 59c5ec7f57ead87efa365800228aa0b09a12d9e6c4Dmitry Shmidt unsigned int num_req_dev_types, const u8 *req_dev_types, 6061d9df3e62aaa0e87ad05452fcb95142159a17b6Dmitry Shmidt const u8 *dev_id, unsigned int search_delay); 618d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidtvoid wpas_p2p_stop_find(struct wpa_supplicant *wpa_s); 628d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidtint wpas_p2p_listen(struct wpa_supplicant *wpa_s, unsigned int timeout); 638d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidtint wpas_p2p_assoc_req_ie(struct wpa_supplicant *wpa_s, struct wpa_bss *bss, 648d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt u8 *buf, size_t len, int p2p_group); 658d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidtint wpas_p2p_probe_req_rx(struct wpa_supplicant *wpa_s, const u8 *addr, 661f69aa52ea2e0a73ac502565df8c666ee49cab6aDmitry Shmidt const u8 *dst, const u8 *bssid, 6704949598a23f501be6eec21697465fd46a28840aDmitry Shmidt const u8 *ie, size_t ie_len, 6804949598a23f501be6eec21697465fd46a28840aDmitry Shmidt int ssi_signal); 698d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidtvoid wpas_p2p_rx_action(struct wpa_supplicant *wpa_s, const u8 *da, 708d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt const u8 *sa, const u8 *bssid, 718d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt u8 category, const u8 *data, size_t len, int freq); 728d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidtvoid wpas_p2p_scan_ie(struct wpa_supplicant *wpa_s, struct wpabuf *ies); 738d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidtvoid wpas_p2p_group_deinit(struct wpa_supplicant *wpa_s); 748d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidtvoid wpas_dev_found(void *ctx, const u8 *addr, 758d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt const struct p2p_peer_info *info, 768d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt int new_device); 778d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidtvoid wpas_go_neg_completed(void *ctx, struct p2p_go_neg_results *res); 788d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidtvoid wpas_go_neg_req_rx(void *ctx, const u8 *src, u16 dev_passwd_id); 798d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidtvoid wpas_prov_disc_req(void *ctx, const u8 *peer, u16 config_methods, 808d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt const u8 *dev_addr, const u8 *pri_dev_type, 818d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt const char *dev_name, u16 supp_config_methods, 821f69aa52ea2e0a73ac502565df8c666ee49cab6aDmitry Shmidt u8 dev_capab, u8 group_capab, const u8 *group_id, 831f69aa52ea2e0a73ac502565df8c666ee49cab6aDmitry Shmidt size_t group_id_len); 848d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidtvoid wpas_prov_disc_resp(void *ctx, const u8 *peer, u16 config_methods); 858d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidtvoid wpas_sd_request(void *ctx, int freq, const u8 *sa, u8 dialog_token, 868d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt u16 update_indic, const u8 *tlvs, size_t tlvs_len); 878d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidtvoid wpas_sd_response(void *ctx, const u8 *sa, u16 update_indic, 888d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt const u8 *tlvs, size_t tlvs_len); 891f69aa52ea2e0a73ac502565df8c666ee49cab6aDmitry Shmidtu64 wpas_p2p_sd_request(struct wpa_supplicant *wpa_s, const u8 *dst, 901f69aa52ea2e0a73ac502565df8c666ee49cab6aDmitry Shmidt const struct wpabuf *tlvs); 911f69aa52ea2e0a73ac502565df8c666ee49cab6aDmitry Shmidtu64 wpas_p2p_sd_request_upnp(struct wpa_supplicant *wpa_s, const u8 *dst, 921f69aa52ea2e0a73ac502565df8c666ee49cab6aDmitry Shmidt u8 version, const char *query); 9361d9df3e62aaa0e87ad05452fcb95142159a17b6Dmitry Shmidtu64 wpas_p2p_sd_request_wifi_display(struct wpa_supplicant *wpa_s, 9461d9df3e62aaa0e87ad05452fcb95142159a17b6Dmitry Shmidt const u8 *dst, const char *role); 951f69aa52ea2e0a73ac502565df8c666ee49cab6aDmitry Shmidtint wpas_p2p_sd_cancel_request(struct wpa_supplicant *wpa_s, u64 req); 968d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidtvoid wpas_p2p_sd_response(struct wpa_supplicant *wpa_s, int freq, 978d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt const u8 *dst, u8 dialog_token, 988d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt const struct wpabuf *resp_tlvs); 99b5e8f06e18446918f6d801566e5709a8c87f1780Dmitry Shmidt#ifdef ANDROID_P2P 100b5e8f06e18446918f6d801566e5709a8c87f1780Dmitry Shmidtvoid wpas_p2p_sd_service_update(struct wpa_supplicant *wpa_s, int action); 101b5e8f06e18446918f6d801566e5709a8c87f1780Dmitry Shmidt#else 1028d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidtvoid wpas_p2p_sd_service_update(struct wpa_supplicant *wpa_s); 103b5e8f06e18446918f6d801566e5709a8c87f1780Dmitry Shmidt#endif 1048d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidtvoid wpas_p2p_service_flush(struct wpa_supplicant *wpa_s); 1058d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidtint wpas_p2p_service_add_bonjour(struct wpa_supplicant *wpa_s, 1068d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt struct wpabuf *query, struct wpabuf *resp); 1078d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidtint wpas_p2p_service_del_bonjour(struct wpa_supplicant *wpa_s, 1088d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt const struct wpabuf *query); 1098d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidtint wpas_p2p_service_add_upnp(struct wpa_supplicant *wpa_s, u8 version, 1108d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt const char *service); 1118d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidtint wpas_p2p_service_del_upnp(struct wpa_supplicant *wpa_s, u8 version, 1128d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt const char *service); 1138d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidtint wpas_p2p_reject(struct wpa_supplicant *wpa_s, const u8 *addr); 1148d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidtint wpas_p2p_invite(struct wpa_supplicant *wpa_s, const u8 *peer_addr, 1158d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt struct wpa_ssid *ssid, const u8 *go_dev_addr); 1168d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidtint wpas_p2p_invite_group(struct wpa_supplicant *wpa_s, const char *ifname, 1178d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt const u8 *peer_addr, const u8 *go_dev_addr); 1188d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidtvoid wpas_p2p_completed(struct wpa_supplicant *wpa_s); 1198d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidtint wpas_p2p_presence_req(struct wpa_supplicant *wpa_s, u32 duration1, 1208d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt u32 interval1, u32 duration2, u32 interval2); 1218d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidtint wpas_p2p_ext_listen(struct wpa_supplicant *wpa_s, unsigned int period, 1228d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt unsigned int interval); 1238d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidtvoid wpas_p2p_deauth_notif(struct wpa_supplicant *wpa_s, const u8 *bssid, 12404949598a23f501be6eec21697465fd46a28840aDmitry Shmidt u16 reason_code, const u8 *ie, size_t ie_len, 12504949598a23f501be6eec21697465fd46a28840aDmitry Shmidt int locally_generated); 1268d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidtvoid wpas_p2p_disassoc_notif(struct wpa_supplicant *wpa_s, const u8 *bssid, 12704949598a23f501be6eec21697465fd46a28840aDmitry Shmidt u16 reason_code, const u8 *ie, size_t ie_len, 12804949598a23f501be6eec21697465fd46a28840aDmitry Shmidt int locally_generated); 1298d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidtvoid wpas_p2p_update_config(struct wpa_supplicant *wpa_s); 1308d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidtint wpas_p2p_set_noa(struct wpa_supplicant *wpa_s, u8 count, int start, 1318d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt int duration); 1328d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidtint wpas_p2p_set_cross_connect(struct wpa_supplicant *wpa_s, int enabled); 1338d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidtvoid wpas_p2p_notif_connected(struct wpa_supplicant *wpa_s); 1348d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidtvoid wpas_p2p_notif_disconnected(struct wpa_supplicant *wpa_s); 1358d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidtint wpas_p2p_notif_pbc_overlap(struct wpa_supplicant *wpa_s); 1368d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidtvoid wpas_p2p_update_channel_list(struct wpa_supplicant *wpa_s); 1378d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidtint wpas_p2p_cancel(struct wpa_supplicant *wpa_s); 1388d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidtvoid wpas_p2p_interface_unavailable(struct wpa_supplicant *wpa_s); 1398d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidtvoid wpas_p2p_update_best_channels(struct wpa_supplicant *wpa_s, 1408d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt int freq_24, int freq_5, int freq_overall); 1418d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidtint wpas_p2p_unauthorize(struct wpa_supplicant *wpa_s, const char *addr); 1428d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidtint wpas_p2p_disconnect(struct wpa_supplicant *wpa_s); 14375ecf5267604f166b85a7ee2cf0d9cb682966680Jouni Malinenvoid wpas_p2p_wps_failed(struct wpa_supplicant *wpa_s, 14475ecf5267604f166b85a7ee2cf0d9cb682966680Jouni Malinen struct wps_event_fail *fail); 1451f69aa52ea2e0a73ac502565df8c666ee49cab6aDmitry Shmidtint wpas_p2p_in_progress(struct wpa_supplicant *wpa_s); 1461f69aa52ea2e0a73ac502565df8c666ee49cab6aDmitry Shmidtvoid wpas_p2p_network_removed(struct wpa_supplicant *wpa_s, 1471f69aa52ea2e0a73ac502565df8c666ee49cab6aDmitry Shmidt struct wpa_ssid *ssid); 1481f69aa52ea2e0a73ac502565df8c666ee49cab6aDmitry Shmidtstruct wpa_ssid * wpas_p2p_get_persistent(struct wpa_supplicant *wpa_s, 149c5ec7f57ead87efa365800228aa0b09a12d9e6c4Dmitry Shmidt const u8 *addr, const u8 *ssid, 150c5ec7f57ead87efa365800228aa0b09a12d9e6c4Dmitry Shmidt size_t ssid_len); 1511f69aa52ea2e0a73ac502565df8c666ee49cab6aDmitry Shmidtvoid wpas_p2p_notify_ap_sta_authorized(struct wpa_supplicant *wpa_s, 1521f69aa52ea2e0a73ac502565df8c666ee49cab6aDmitry Shmidt const u8 *addr); 15304949598a23f501be6eec21697465fd46a28840aDmitry Shmidtint wpas_p2p_scan_no_go_seen(struct wpa_supplicant *wpa_s); 15461d9df3e62aaa0e87ad05452fcb95142159a17b6Dmitry Shmidtint wpas_p2p_get_ht40_mode(struct wpa_supplicant *wpa_s, 15561d9df3e62aaa0e87ad05452fcb95142159a17b6Dmitry Shmidt struct hostapd_hw_modes *mode, u8 channel); 15661d9df3e62aaa0e87ad05452fcb95142159a17b6Dmitry Shmidtunsigned int wpas_p2p_search_delay(struct wpa_supplicant *wpa_s); 1578d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt 1588d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt#endif /* P2P_SUPPLICANT_H */ 159