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