Updated to hostap_2_6
[mech_eap.git] / libeap / src / common / ctrl_iface_common.h
1 /*
2  * Common hostapd/wpa_supplicant ctrl iface code.
3  * Copyright (c) 2002-2013, Jouni Malinen <j@w1.fi>
4  * Copyright (c) 2015, Qualcomm Atheros, Inc.
5  *
6  * This software may be distributed under the terms of the BSD license.
7  * See README for more details.
8  */
9 #ifndef CONTROL_IFACE_COMMON_H
10 #define CONTROL_IFACE_COMMON_H
11
12 #include "utils/list.h"
13
14 /**
15  * struct wpa_ctrl_dst - Data structure of control interface monitors
16  *
17  * This structure is used to store information about registered control
18  * interface monitors into struct wpa_supplicant.
19  */
20 struct wpa_ctrl_dst {
21         struct dl_list list;
22         struct sockaddr_storage addr;
23         socklen_t addrlen;
24         int debug_level;
25         int errors;
26 };
27
28 void sockaddr_print(int level, const char *msg, struct sockaddr_storage *sock,
29                     socklen_t socklen);
30
31 int ctrl_iface_attach(struct dl_list *ctrl_dst, struct sockaddr_storage *from,
32                        socklen_t fromlen);
33 int ctrl_iface_detach(struct dl_list *ctrl_dst, struct sockaddr_storage *from,
34                       socklen_t fromlen);
35 int ctrl_iface_level(struct dl_list *ctrl_dst, struct sockaddr_storage *from,
36                      socklen_t fromlen, const char *level);
37
38 #endif /* CONTROL_IFACE_COMMON_H */