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