]>
Commit | Line | Data |
---|---|---|
fa201b69 JM |
1 | /* |
2 | * wpa_supplicant / WPS integration | |
52eb293d | 3 | * Copyright (c) 2008-2009, Jouni Malinen <j@w1.fi> |
fa201b69 JM |
4 | * |
5 | * This program is free software; you can redistribute it and/or modify | |
6 | * it under the terms of the GNU General Public License version 2 as | |
7 | * published by the Free Software Foundation. | |
8 | * | |
9 | * Alternatively, this software may be distributed under the terms of BSD | |
10 | * license. | |
11 | * | |
12 | * See README and COPYING for more details. | |
13 | */ | |
14 | ||
15 | #ifndef WPS_SUPPLICANT_H | |
16 | #define WPS_SUPPLICANT_H | |
17 | ||
9c3a2284 JM |
18 | struct wpa_scan_res; |
19 | ||
fa201b69 JM |
20 | #ifdef CONFIG_WPS |
21 | ||
f90c86d4 JM |
22 | #include "wps/wps.h" |
23 | #include "wps/wps_defs.h" | |
24 | ||
6fa81a3b JM |
25 | struct wpa_bss; |
26 | ||
52eb293d JM |
27 | struct wps_new_ap_settings { |
28 | const char *ssid_hex; | |
29 | const char *auth; | |
30 | const char *encr; | |
31 | const char *key_hex; | |
32 | }; | |
33 | ||
116654ce JM |
34 | int wpas_wps_init(struct wpa_supplicant *wpa_s); |
35 | void wpas_wps_deinit(struct wpa_supplicant *wpa_s); | |
fa201b69 | 36 | int wpas_wps_eapol_cb(struct wpa_supplicant *wpa_s); |
f90c86d4 | 37 | enum wps_request_type wpas_wps_get_req_type(struct wpa_ssid *ssid); |
9fa243b2 JM |
38 | int wpas_wps_start_pbc(struct wpa_supplicant *wpa_s, const u8 *bssid, |
39 | int p2p_group); | |
fcc60db4 | 40 | int wpas_wps_start_pin(struct wpa_supplicant *wpa_s, const u8 *bssid, |
3c5126a4 | 41 | const char *pin, int p2p_group, u16 dev_pw_id); |
2f9929ff | 42 | int wpas_wps_cancel(struct wpa_supplicant *wpa_s); |
46bdb83a | 43 | int wpas_wps_start_oob(struct wpa_supplicant *wpa_s, char *device_type, |
e1ee6b60 | 44 | char *path, char *method, char *name); |
fcc60db4 | 45 | int wpas_wps_start_reg(struct wpa_supplicant *wpa_s, const u8 *bssid, |
52eb293d | 46 | const char *pin, struct wps_new_ap_settings *settings); |
a6099152 JM |
47 | int wpas_wps_ssid_bss_match(struct wpa_supplicant *wpa_s, |
48 | struct wpa_ssid *ssid, struct wpa_scan_res *bss); | |
49 | int wpas_wps_ssid_wildcard_ok(struct wpa_supplicant *wpa_s, | |
50 | struct wpa_ssid *ssid, struct wpa_scan_res *bss); | |
351f09a2 | 51 | int wpas_wps_scan_pbc_overlap(struct wpa_supplicant *wpa_s, |
6fa81a3b | 52 | struct wpa_bss *selected, struct wpa_ssid *ssid); |
a524f05e | 53 | void wpas_wps_notify_scan_results(struct wpa_supplicant *wpa_s); |
24c23d1b | 54 | int wpas_wps_searching(struct wpa_supplicant *wpa_s); |
611ed491 JM |
55 | int wpas_wps_scan_result_text(const u8 *ies, size_t ies_len, char *pos, |
56 | char *end); | |
08486685 | 57 | int wpas_wps_er_start(struct wpa_supplicant *wpa_s, const char *filter); |
e9bcfebf | 58 | int wpas_wps_er_stop(struct wpa_supplicant *wpa_s); |
31fcea93 JM |
59 | int wpas_wps_er_add_pin(struct wpa_supplicant *wpa_s, const u8 *addr, |
60 | const char *uuid, const char *pin); | |
564cd7fa | 61 | int wpas_wps_er_pbc(struct wpa_supplicant *wpa_s, const char *uuid); |
e64dcfd5 JM |
62 | int wpas_wps_er_learn(struct wpa_supplicant *wpa_s, const char *uuid, |
63 | const char *pin); | |
ef10f473 JM |
64 | int wpas_wps_er_set_config(struct wpa_supplicant *wpa_s, const char *uuid, |
65 | int id); | |
7d6640a6 JM |
66 | int wpas_wps_er_config(struct wpa_supplicant *wpa_s, const char *uuid, |
67 | const char *pin, struct wps_new_ap_settings *settings); | |
1a1bf008 | 68 | int wpas_wps_terminate_pending(struct wpa_supplicant *wpa_s); |
41e650ae | 69 | int wpas_wps_in_progress(struct wpa_supplicant *wpa_s); |
611aea7d | 70 | void wpas_wps_update_config(struct wpa_supplicant *wpa_s); |
fa201b69 JM |
71 | |
72 | #else /* CONFIG_WPS */ | |
73 | ||
116654ce JM |
74 | static inline int wpas_wps_init(struct wpa_supplicant *wpa_s) |
75 | { | |
76 | return 0; | |
77 | } | |
78 | ||
79 | static inline void wpas_wps_deinit(struct wpa_supplicant *wpa_s) | |
80 | { | |
81 | } | |
82 | ||
fa201b69 JM |
83 | static inline int wpas_wps_eapol_cb(struct wpa_supplicant *wpa_s) |
84 | { | |
85 | return 0; | |
86 | } | |
87 | ||
351f09a2 JM |
88 | static inline u8 wpas_wps_get_req_type(struct wpa_ssid *ssid) |
89 | { | |
90 | return 0; | |
91 | } | |
92 | ||
a6099152 JM |
93 | static inline int wpas_wps_ssid_bss_match(struct wpa_supplicant *wpa_s, |
94 | struct wpa_ssid *ssid, | |
351f09a2 JM |
95 | struct wpa_scan_res *bss) |
96 | { | |
97 | return -1; | |
98 | } | |
99 | ||
a6099152 JM |
100 | static inline int wpas_wps_ssid_wildcard_ok(struct wpa_supplicant *wpa_s, |
101 | struct wpa_ssid *ssid, | |
351f09a2 JM |
102 | struct wpa_scan_res *bss) |
103 | { | |
104 | return 0; | |
105 | } | |
106 | ||
107 | static inline int wpas_wps_scan_pbc_overlap(struct wpa_supplicant *wpa_s, | |
9c3a2284 | 108 | struct wpa_bss *selected, |
351f09a2 | 109 | struct wpa_ssid *ssid) |
fa201b69 | 110 | { |
b01c18a8 | 111 | return 0; |
fa201b69 JM |
112 | } |
113 | ||
a524f05e JM |
114 | static inline void wpas_wps_notify_scan_results(struct wpa_supplicant *wpa_s) |
115 | { | |
116 | } | |
117 | ||
24c23d1b JM |
118 | static inline int wpas_wps_searching(struct wpa_supplicant *wpa_s) |
119 | { | |
120 | return 0; | |
121 | } | |
122 | ||
fa201b69 JM |
123 | #endif /* CONFIG_WPS */ |
124 | ||
125 | #endif /* WPS_SUPPLICANT_H */ |