]>
Commit | Line | Data |
---|---|---|
fa201b69 JM |
1 | /* |
2 | * wpa_supplicant / WPS integration | |
d7645d23 | 3 | * Copyright (c) 2008-2012, Jouni Malinen <j@w1.fi> |
fa201b69 | 4 | * |
0f3d578e JM |
5 | * This software may be distributed under the terms of the BSD license. |
6 | * See README for more details. | |
fa201b69 JM |
7 | */ |
8 | ||
9 | #ifndef WPS_SUPPLICANT_H | |
10 | #define WPS_SUPPLICANT_H | |
11 | ||
f9f0526b | 12 | struct wpa_scan_results; |
9c3a2284 | 13 | |
fa201b69 JM |
14 | #ifdef CONFIG_WPS |
15 | ||
f90c86d4 JM |
16 | #include "wps/wps.h" |
17 | #include "wps/wps_defs.h" | |
18 | ||
6fa81a3b JM |
19 | struct wpa_bss; |
20 | ||
52eb293d JM |
21 | struct wps_new_ap_settings { |
22 | const char *ssid_hex; | |
23 | const char *auth; | |
24 | const char *encr; | |
25 | const char *key_hex; | |
26 | }; | |
27 | ||
116654ce JM |
28 | int wpas_wps_init(struct wpa_supplicant *wpa_s); |
29 | void wpas_wps_deinit(struct wpa_supplicant *wpa_s); | |
fa201b69 | 30 | int wpas_wps_eapol_cb(struct wpa_supplicant *wpa_s); |
f90c86d4 | 31 | enum wps_request_type wpas_wps_get_req_type(struct wpa_ssid *ssid); |
9fa243b2 JM |
32 | int wpas_wps_start_pbc(struct wpa_supplicant *wpa_s, const u8 *bssid, |
33 | int p2p_group); | |
fcc60db4 | 34 | int wpas_wps_start_pin(struct wpa_supplicant *wpa_s, const u8 *bssid, |
3c5126a4 | 35 | const char *pin, int p2p_group, u16 dev_pw_id); |
2f9929ff | 36 | int wpas_wps_cancel(struct wpa_supplicant *wpa_s); |
fcc60db4 | 37 | int wpas_wps_start_reg(struct wpa_supplicant *wpa_s, const u8 *bssid, |
52eb293d | 38 | const char *pin, struct wps_new_ap_settings *settings); |
a6099152 | 39 | int wpas_wps_ssid_bss_match(struct wpa_supplicant *wpa_s, |
620c7837 | 40 | struct wpa_ssid *ssid, struct wpa_bss *bss); |
a6099152 | 41 | int wpas_wps_ssid_wildcard_ok(struct wpa_supplicant *wpa_s, |
620c7837 | 42 | struct wpa_ssid *ssid, struct wpa_bss *bss); |
351f09a2 | 43 | int wpas_wps_scan_pbc_overlap(struct wpa_supplicant *wpa_s, |
6fa81a3b | 44 | struct wpa_bss *selected, struct wpa_ssid *ssid); |
a524f05e | 45 | void wpas_wps_notify_scan_results(struct wpa_supplicant *wpa_s); |
24c23d1b | 46 | int wpas_wps_searching(struct wpa_supplicant *wpa_s); |
611ed491 JM |
47 | int wpas_wps_scan_result_text(const u8 *ies, size_t ies_len, char *pos, |
48 | char *end); | |
08486685 | 49 | int wpas_wps_er_start(struct wpa_supplicant *wpa_s, const char *filter); |
e9bcfebf | 50 | int wpas_wps_er_stop(struct wpa_supplicant *wpa_s); |
31fcea93 JM |
51 | int wpas_wps_er_add_pin(struct wpa_supplicant *wpa_s, const u8 *addr, |
52 | const char *uuid, const char *pin); | |
564cd7fa | 53 | int wpas_wps_er_pbc(struct wpa_supplicant *wpa_s, const char *uuid); |
e64dcfd5 JM |
54 | int wpas_wps_er_learn(struct wpa_supplicant *wpa_s, const char *uuid, |
55 | const char *pin); | |
ef10f473 JM |
56 | int wpas_wps_er_set_config(struct wpa_supplicant *wpa_s, const char *uuid, |
57 | int id); | |
7d6640a6 JM |
58 | int wpas_wps_er_config(struct wpa_supplicant *wpa_s, const char *uuid, |
59 | const char *pin, struct wps_new_ap_settings *settings); | |
1cea09a9 JM |
60 | struct wpabuf * wpas_wps_er_nfc_config_token(struct wpa_supplicant *wpa_s, |
61 | int ndef, const char *uuid); | |
1a1bf008 | 62 | int wpas_wps_terminate_pending(struct wpa_supplicant *wpa_s); |
41e650ae | 63 | int wpas_wps_in_progress(struct wpa_supplicant *wpa_s); |
611aea7d | 64 | void wpas_wps_update_config(struct wpa_supplicant *wpa_s); |
3f2c8ba6 JM |
65 | struct wpabuf * wpas_wps_nfc_token(struct wpa_supplicant *wpa_s, int ndef); |
66 | int wpas_wps_start_nfc(struct wpa_supplicant *wpa_s, const u8 *bssid); | |
d7645d23 JM |
67 | int wpas_wps_nfc_tag_read(struct wpa_supplicant *wpa_s, |
68 | const struct wpabuf *data); | |
e65552dd JM |
69 | struct wpabuf * wpas_wps_nfc_handover_req(struct wpa_supplicant *wpa_s); |
70 | struct wpabuf * wpas_wps_nfc_handover_sel(struct wpa_supplicant *wpa_s); | |
71 | int wpas_wps_nfc_rx_handover_req(struct wpa_supplicant *wpa_s, | |
72 | const struct wpabuf *data); | |
73 | int wpas_wps_nfc_rx_handover_sel(struct wpa_supplicant *wpa_s, | |
74 | const struct wpabuf *data); | |
f9f0526b JM |
75 | void wpas_wps_update_ap_info(struct wpa_supplicant *wpa_s, |
76 | struct wpa_scan_results *scan_res); | |
77 | void wpas_wps_notify_assoc(struct wpa_supplicant *wpa_s, const u8 *bssid); | |
fa201b69 JM |
78 | |
79 | #else /* CONFIG_WPS */ | |
80 | ||
116654ce JM |
81 | static inline int wpas_wps_init(struct wpa_supplicant *wpa_s) |
82 | { | |
83 | return 0; | |
84 | } | |
85 | ||
86 | static inline void wpas_wps_deinit(struct wpa_supplicant *wpa_s) | |
87 | { | |
88 | } | |
89 | ||
fa201b69 JM |
90 | static inline int wpas_wps_eapol_cb(struct wpa_supplicant *wpa_s) |
91 | { | |
92 | return 0; | |
93 | } | |
94 | ||
351f09a2 JM |
95 | static inline u8 wpas_wps_get_req_type(struct wpa_ssid *ssid) |
96 | { | |
97 | return 0; | |
98 | } | |
99 | ||
a6099152 JM |
100 | static inline int wpas_wps_ssid_bss_match(struct wpa_supplicant *wpa_s, |
101 | struct wpa_ssid *ssid, | |
3385647d | 102 | struct wpa_bss *bss) |
351f09a2 JM |
103 | { |
104 | return -1; | |
105 | } | |
106 | ||
a6099152 JM |
107 | static inline int wpas_wps_ssid_wildcard_ok(struct wpa_supplicant *wpa_s, |
108 | struct wpa_ssid *ssid, | |
d2901915 | 109 | struct wpa_bss *bss) |
351f09a2 JM |
110 | { |
111 | return 0; | |
112 | } | |
113 | ||
114 | static inline int wpas_wps_scan_pbc_overlap(struct wpa_supplicant *wpa_s, | |
9c3a2284 | 115 | struct wpa_bss *selected, |
351f09a2 | 116 | struct wpa_ssid *ssid) |
fa201b69 | 117 | { |
b01c18a8 | 118 | return 0; |
fa201b69 JM |
119 | } |
120 | ||
a524f05e JM |
121 | static inline void wpas_wps_notify_scan_results(struct wpa_supplicant *wpa_s) |
122 | { | |
123 | } | |
124 | ||
24c23d1b JM |
125 | static inline int wpas_wps_searching(struct wpa_supplicant *wpa_s) |
126 | { | |
127 | return 0; | |
128 | } | |
129 | ||
f9f0526b JM |
130 | static inline void wpas_wps_update_ap_info(struct wpa_supplicant *wpa_s, |
131 | struct wpa_scan_results *scan_res) | |
132 | { | |
133 | } | |
134 | ||
135 | static inline void wpas_wps_notify_assoc(struct wpa_supplicant *wpa_s, | |
136 | const u8 *bssid) | |
137 | { | |
138 | } | |
139 | ||
fa201b69 JM |
140 | #endif /* CONFIG_WPS */ |
141 | ||
142 | #endif /* WPS_SUPPLICANT_H */ |