]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - contrib/wpa_supplicant/wpa_supplicant.h
This commit was generated by cvs2svn to compensate for changes in r154184,
[FreeBSD/FreeBSD.git] / contrib / wpa_supplicant / wpa_supplicant.h
1 #ifndef WPA_SUPPLICANT_H
2 #define WPA_SUPPLICANT_H
3
4 /* Driver wrappers are not supposed to directly touch the internal data
5  * structure used in wpa_supplicant, so that definition is not provided here.
6  */
7 struct wpa_supplicant;
8
9 typedef enum {
10         EVENT_ASSOC, EVENT_DISASSOC, EVENT_MICHAEL_MIC_FAILURE,
11         EVENT_SCAN_RESULTS, EVENT_ASSOCINFO, EVENT_INTERFACE_STATUS,
12         EVENT_PMKID_CANDIDATE
13 } wpa_event_type;
14
15 union wpa_event_data {
16         struct {
17                 /* Optional request information data: IEs included in AssocReq
18                  * and AssocResp. If these are not returned by the driver,
19                  * WPA Supplicant will generate the WPA/RSN IE. */
20                 u8 *req_ies, *resp_ies;
21                 size_t req_ies_len, resp_ies_len;
22
23                 /* Optional Beacon/ProbeResp data: IEs included in Beacon or
24                  * Probe Response frames from the current AP (i.e., the one
25                  * that the client just associated with). This information is
26                  * used to update WPA/RSN IE for the AP. If this field is not
27                  * set, the results from previous scan will be used. If no
28                  * data for the new AP is found, scan results will be requested
29                  * again (without scan request). At this point, the driver is
30                  * expected to provide WPA/RSN IE for the AP (if WPA/WPA2 is
31                  * used). */
32                 u8 *beacon_ies; /* beacon or probe resp IEs */
33                 size_t beacon_ies_len;
34         } assoc_info;
35         struct {
36                 int unicast;
37         } michael_mic_failure;
38         struct {
39                 char ifname[20];
40                 enum {
41                         EVENT_INTERFACE_ADDED, EVENT_INTERFACE_REMOVED
42                 } ievent;
43         } interface_status;
44         struct {
45                 u8 bssid[ETH_ALEN];
46                 int index; /* smaller the index, higher the priority */
47                 int preauth;
48         } pmkid_candidate;
49 };
50
51 /**
52  * wpa_supplicant_event - report a driver event for wpa_supplicant
53  * @wpa_s: pointer to wpa_supplicant data; this is the @ctx variable registered
54  *      with wpa_driver_events_init()
55  * @event: event type (defined above)
56  * @data: possible extra data for the event
57  *
58  * Driver wrapper code should call this function whenever an event is received
59  * from the driver.
60  */
61 void wpa_supplicant_event(struct wpa_supplicant *wpa_s, wpa_event_type event,
62                           union wpa_event_data *data);
63
64 /**
65  * wpa_msg - conditional printf for default target and ctrl_iface monitors
66  * @level: priority level (MSG_*) of the message
67  * @fmt: printf format string, followed by optional arguments
68  *
69  * This function is used to print conditional debugging and error messages. The
70  * output may be directed to stdout, stderr, and/or syslog based on
71  * configuration. This function is like wpa_printf(), but it also sends the
72  * same message to all attached ctrl_iface monitors.
73  *
74  * Note: New line '\n' is added to the end of the text when printing to stdout.
75  */
76 void wpa_msg(struct wpa_supplicant *wpa_s, int level, char *fmt, ...)
77 __attribute__ ((format (printf, 3, 4)));
78
79 const char * wpa_ssid_txt(u8 *ssid, size_t ssid_len);
80
81 #endif /* WPA_SUPPLICANT_H */