p2p_supplicant.h revision 7a5e50a0554bee77a9da492ea3d86f46147f1671
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; 167a5e50a0554bee77a9da492ea3d86f46147f1671Dmitry Shmidtstruct p2p_channels; 178d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt 188d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidtint wpas_p2p_init(struct wpa_global *global, struct wpa_supplicant *wpa_s); 198d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidtvoid wpas_p2p_deinit(struct wpa_supplicant *wpa_s); 208d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidtvoid wpas_p2p_deinit_global(struct wpa_global *global); 218d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidtint wpas_p2p_connect(struct wpa_supplicant *wpa_s, const u8 *peer_addr, 228d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt const char *pin, enum p2p_wps_method wps_method, 2304949598a23f501be6eec21697465fd46a28840aDmitry Shmidt int persistent_group, int auto_join, int join, 2404949598a23f501be6eec21697465fd46a28840aDmitry Shmidt int auth, int go_intent, int freq, int persistent_id, 2561d9df3e62aaa0e87ad05452fcb95142159a17b6Dmitry Shmidt int pd, int ht40); 268d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidtvoid wpas_p2p_remain_on_channel_cb(struct wpa_supplicant *wpa_s, 278d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt unsigned int freq, unsigned int duration); 288d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidtvoid wpas_p2p_cancel_remain_on_channel_cb(struct wpa_supplicant *wpa_s, 298d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt unsigned int freq); 301f69aa52ea2e0a73ac502565df8c666ee49cab6aDmitry Shmidt#ifdef ANDROID_P2P 31c5ec7f57ead87efa365800228aa0b09a12d9e6c4Dmitry Shmidtint wpas_p2p_handle_frequency_conflicts(struct wpa_supplicant *wpa_s, 32d5e4923d04122f81300fa68fb07d64ede28fd44dDmitry Shmidt int freq, struct wpa_ssid *ssid); 331f69aa52ea2e0a73ac502565df8c666ee49cab6aDmitry Shmidt#endif 348d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidtint wpas_p2p_group_remove(struct wpa_supplicant *wpa_s, const char *ifname); 358d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidtint wpas_p2p_group_add(struct wpa_supplicant *wpa_s, int persistent_group, 3661d9df3e62aaa0e87ad05452fcb95142159a17b6Dmitry Shmidt int freq, int ht40); 378d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidtint wpas_p2p_group_add_persistent(struct wpa_supplicant *wpa_s, 388d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt struct wpa_ssid *ssid, int addr_allocated, 397a5e50a0554bee77a9da492ea3d86f46147f1671Dmitry Shmidt int freq, int ht40, 407a5e50a0554bee77a9da492ea3d86f46147f1671Dmitry Shmidt const struct p2p_channels *channels); 418d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidtstruct p2p_group * wpas_p2p_group_init(struct wpa_supplicant *wpa_s, 4204949598a23f501be6eec21697465fd46a28840aDmitry Shmidt struct wpa_ssid *ssid); 438d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidtvoid wpas_p2p_wps_success(struct wpa_supplicant *wpa_s, const u8 *peer_addr, 448d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt int registrar); 4504949598a23f501be6eec21697465fd46a28840aDmitry Shmidtenum wpas_p2p_prov_disc_use { 4604949598a23f501be6eec21697465fd46a28840aDmitry Shmidt WPAS_P2P_PD_FOR_GO_NEG, 4704949598a23f501be6eec21697465fd46a28840aDmitry Shmidt WPAS_P2P_PD_FOR_JOIN, 4804949598a23f501be6eec21697465fd46a28840aDmitry Shmidt WPAS_P2P_PD_AUTO 4904949598a23f501be6eec21697465fd46a28840aDmitry Shmidt}; 508d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidtint wpas_p2p_prov_disc(struct wpa_supplicant *wpa_s, const u8 *peer_addr, 5104949598a23f501be6eec21697465fd46a28840aDmitry Shmidt const char *config_method, 5204949598a23f501be6eec21697465fd46a28840aDmitry Shmidt enum wpas_p2p_prov_disc_use use); 538d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidtvoid wpas_send_action_tx_status(struct wpa_supplicant *wpa_s, const u8 *dst, 548d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt const u8 *data, size_t data_len, 558d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt enum p2p_send_action_result result); 568d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidtint wpas_p2p_scan_result_text(const u8 *ies, size_t ies_len, char *buf, 578d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt char *end); 588d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidtenum p2p_discovery_type; 598d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidtint wpas_p2p_find(struct wpa_supplicant *wpa_s, unsigned int timeout, 608d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt enum p2p_discovery_type type, 61c5ec7f57ead87efa365800228aa0b09a12d9e6c4Dmitry Shmidt unsigned int num_req_dev_types, const u8 *req_dev_types, 6261d9df3e62aaa0e87ad05452fcb95142159a17b6Dmitry Shmidt const u8 *dev_id, unsigned int search_delay); 638d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidtvoid wpas_p2p_stop_find(struct wpa_supplicant *wpa_s); 648d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidtint wpas_p2p_listen(struct wpa_supplicant *wpa_s, unsigned int timeout); 658d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidtint wpas_p2p_assoc_req_ie(struct wpa_supplicant *wpa_s, struct wpa_bss *bss, 668d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt u8 *buf, size_t len, int p2p_group); 678d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidtint wpas_p2p_probe_req_rx(struct wpa_supplicant *wpa_s, const u8 *addr, 681f69aa52ea2e0a73ac502565df8c666ee49cab6aDmitry Shmidt const u8 *dst, const u8 *bssid, 6904949598a23f501be6eec21697465fd46a28840aDmitry Shmidt const u8 *ie, size_t ie_len, 7004949598a23f501be6eec21697465fd46a28840aDmitry Shmidt int ssi_signal); 718d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidtvoid wpas_p2p_rx_action(struct wpa_supplicant *wpa_s, const u8 *da, 728d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt const u8 *sa, const u8 *bssid, 738d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt u8 category, const u8 *data, size_t len, int freq); 748d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidtvoid wpas_p2p_scan_ie(struct wpa_supplicant *wpa_s, struct wpabuf *ies); 758d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidtvoid wpas_p2p_group_deinit(struct wpa_supplicant *wpa_s); 768d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidtvoid wpas_dev_found(void *ctx, const u8 *addr, 778d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt const struct p2p_peer_info *info, 788d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt int new_device); 798d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidtvoid wpas_go_neg_completed(void *ctx, struct p2p_go_neg_results *res); 808d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidtvoid wpas_go_neg_req_rx(void *ctx, const u8 *src, u16 dev_passwd_id); 818d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidtvoid wpas_prov_disc_req(void *ctx, const u8 *peer, u16 config_methods, 828d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt const u8 *dev_addr, const u8 *pri_dev_type, 838d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt const char *dev_name, u16 supp_config_methods, 841f69aa52ea2e0a73ac502565df8c666ee49cab6aDmitry Shmidt u8 dev_capab, u8 group_capab, const u8 *group_id, 851f69aa52ea2e0a73ac502565df8c666ee49cab6aDmitry Shmidt size_t group_id_len); 868d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidtvoid wpas_prov_disc_resp(void *ctx, const u8 *peer, u16 config_methods); 878d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidtvoid wpas_sd_request(void *ctx, int freq, const u8 *sa, u8 dialog_token, 888d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt u16 update_indic, const u8 *tlvs, size_t tlvs_len); 898d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidtvoid wpas_sd_response(void *ctx, const u8 *sa, u16 update_indic, 908d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt const u8 *tlvs, size_t tlvs_len); 911f69aa52ea2e0a73ac502565df8c666ee49cab6aDmitry Shmidtu64 wpas_p2p_sd_request(struct wpa_supplicant *wpa_s, const u8 *dst, 921f69aa52ea2e0a73ac502565df8c666ee49cab6aDmitry Shmidt const struct wpabuf *tlvs); 931f69aa52ea2e0a73ac502565df8c666ee49cab6aDmitry Shmidtu64 wpas_p2p_sd_request_upnp(struct wpa_supplicant *wpa_s, const u8 *dst, 941f69aa52ea2e0a73ac502565df8c666ee49cab6aDmitry Shmidt u8 version, const char *query); 9561d9df3e62aaa0e87ad05452fcb95142159a17b6Dmitry Shmidtu64 wpas_p2p_sd_request_wifi_display(struct wpa_supplicant *wpa_s, 9661d9df3e62aaa0e87ad05452fcb95142159a17b6Dmitry Shmidt const u8 *dst, const char *role); 971f69aa52ea2e0a73ac502565df8c666ee49cab6aDmitry Shmidtint wpas_p2p_sd_cancel_request(struct wpa_supplicant *wpa_s, u64 req); 988d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidtvoid wpas_p2p_sd_response(struct wpa_supplicant *wpa_s, int freq, 998d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt const u8 *dst, u8 dialog_token, 1008d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt const struct wpabuf *resp_tlvs); 101b5e8f06e18446918f6d801566e5709a8c87f1780Dmitry Shmidt#ifdef ANDROID_P2P 102b5e8f06e18446918f6d801566e5709a8c87f1780Dmitry Shmidtvoid wpas_p2p_sd_service_update(struct wpa_supplicant *wpa_s, int action); 103b5e8f06e18446918f6d801566e5709a8c87f1780Dmitry Shmidt#else 1048d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidtvoid wpas_p2p_sd_service_update(struct wpa_supplicant *wpa_s); 105b5e8f06e18446918f6d801566e5709a8c87f1780Dmitry Shmidt#endif 1068d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidtvoid wpas_p2p_service_flush(struct wpa_supplicant *wpa_s); 1078d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidtint wpas_p2p_service_add_bonjour(struct wpa_supplicant *wpa_s, 1088d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt struct wpabuf *query, struct wpabuf *resp); 1098d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidtint wpas_p2p_service_del_bonjour(struct wpa_supplicant *wpa_s, 1108d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt const struct wpabuf *query); 1118d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidtint wpas_p2p_service_add_upnp(struct wpa_supplicant *wpa_s, u8 version, 1128d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt const char *service); 1138d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidtint wpas_p2p_service_del_upnp(struct wpa_supplicant *wpa_s, u8 version, 1148d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt const char *service); 1158d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidtint wpas_p2p_reject(struct wpa_supplicant *wpa_s, const u8 *addr); 1168d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidtint wpas_p2p_invite(struct wpa_supplicant *wpa_s, const u8 *peer_addr, 11731be0a4b946ecab910c0a9af3837dbccea5d204bJouni Malinen struct wpa_ssid *ssid, const u8 *go_dev_addr, int freq, 1187a5e50a0554bee77a9da492ea3d86f46147f1671Dmitry Shmidt int ht40, int pref_freq); 1198d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidtint wpas_p2p_invite_group(struct wpa_supplicant *wpa_s, const char *ifname, 1208d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt const u8 *peer_addr, const u8 *go_dev_addr); 1218d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidtvoid wpas_p2p_completed(struct wpa_supplicant *wpa_s); 1228d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidtint wpas_p2p_presence_req(struct wpa_supplicant *wpa_s, u32 duration1, 1238d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt u32 interval1, u32 duration2, u32 interval2); 1248d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidtint wpas_p2p_ext_listen(struct wpa_supplicant *wpa_s, unsigned int period, 1258d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt unsigned int interval); 1262b89da85b8cfe9bb862e8dd334855263c3522c00Jouni Malinenint wpas_p2p_deauth_notif(struct wpa_supplicant *wpa_s, const u8 *bssid, 1272b89da85b8cfe9bb862e8dd334855263c3522c00Jouni Malinen u16 reason_code, const u8 *ie, size_t ie_len, 1282b89da85b8cfe9bb862e8dd334855263c3522c00Jouni Malinen int locally_generated); 1298d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidtvoid wpas_p2p_disassoc_notif(struct wpa_supplicant *wpa_s, const u8 *bssid, 13004949598a23f501be6eec21697465fd46a28840aDmitry Shmidt u16 reason_code, const u8 *ie, size_t ie_len, 13104949598a23f501be6eec21697465fd46a28840aDmitry Shmidt int locally_generated); 1328d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidtvoid wpas_p2p_update_config(struct wpa_supplicant *wpa_s); 1338d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidtint wpas_p2p_set_noa(struct wpa_supplicant *wpa_s, u8 count, int start, 1348d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt int duration); 1358d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidtint wpas_p2p_set_cross_connect(struct wpa_supplicant *wpa_s, int enabled); 1368d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidtvoid wpas_p2p_notif_connected(struct wpa_supplicant *wpa_s); 1378d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidtvoid wpas_p2p_notif_disconnected(struct wpa_supplicant *wpa_s); 1388d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidtint wpas_p2p_notif_pbc_overlap(struct wpa_supplicant *wpa_s); 1398d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidtvoid wpas_p2p_update_channel_list(struct wpa_supplicant *wpa_s); 1408d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidtint wpas_p2p_cancel(struct wpa_supplicant *wpa_s); 1418d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidtvoid wpas_p2p_interface_unavailable(struct wpa_supplicant *wpa_s); 1428d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidtvoid wpas_p2p_update_best_channels(struct wpa_supplicant *wpa_s, 1438d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt int freq_24, int freq_5, int freq_overall); 1448d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidtint wpas_p2p_unauthorize(struct wpa_supplicant *wpa_s, const char *addr); 1458d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidtint wpas_p2p_disconnect(struct wpa_supplicant *wpa_s); 14675ecf5267604f166b85a7ee2cf0d9cb682966680Jouni Malinenvoid wpas_p2p_wps_failed(struct wpa_supplicant *wpa_s, 14775ecf5267604f166b85a7ee2cf0d9cb682966680Jouni Malinen struct wps_event_fail *fail); 1481f69aa52ea2e0a73ac502565df8c666ee49cab6aDmitry Shmidtint wpas_p2p_in_progress(struct wpa_supplicant *wpa_s); 1491f69aa52ea2e0a73ac502565df8c666ee49cab6aDmitry Shmidtvoid wpas_p2p_network_removed(struct wpa_supplicant *wpa_s, 1501f69aa52ea2e0a73ac502565df8c666ee49cab6aDmitry Shmidt struct wpa_ssid *ssid); 1511f69aa52ea2e0a73ac502565df8c666ee49cab6aDmitry Shmidtstruct wpa_ssid * wpas_p2p_get_persistent(struct wpa_supplicant *wpa_s, 152c5ec7f57ead87efa365800228aa0b09a12d9e6c4Dmitry Shmidt const u8 *addr, const u8 *ssid, 153c5ec7f57ead87efa365800228aa0b09a12d9e6c4Dmitry Shmidt size_t ssid_len); 1541f69aa52ea2e0a73ac502565df8c666ee49cab6aDmitry Shmidtvoid wpas_p2p_notify_ap_sta_authorized(struct wpa_supplicant *wpa_s, 1551f69aa52ea2e0a73ac502565df8c666ee49cab6aDmitry Shmidt const u8 *addr); 15604949598a23f501be6eec21697465fd46a28840aDmitry Shmidtint wpas_p2p_scan_no_go_seen(struct wpa_supplicant *wpa_s); 15761d9df3e62aaa0e87ad05452fcb95142159a17b6Dmitry Shmidtint wpas_p2p_get_ht40_mode(struct wpa_supplicant *wpa_s, 15861d9df3e62aaa0e87ad05452fcb95142159a17b6Dmitry Shmidt struct hostapd_hw_modes *mode, u8 channel); 15961d9df3e62aaa0e87ad05452fcb95142159a17b6Dmitry Shmidtunsigned int wpas_p2p_search_delay(struct wpa_supplicant *wpa_s); 1608d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt 1618d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt#endif /* P2P_SUPPLICANT_H */ 162