122c9018cy/*
222c9018cy * Common hostapd/wpa_supplicant ctrl iface code.
322c9018cy * Copyright (c) 2002-2013, Jouni Malinen <j@w1.fi>
422c9018cy * Copyright (c) 2015, Qualcomm Atheros, Inc.
522c9018cy *
622c9018cy * This software may be distributed under the terms of the BSD license.
722c9018cy * See README for more details.
822c9018cy */
922c9018cy#ifndef CONTROL_IFACE_COMMON_H
1022c9018cy#define CONTROL_IFACE_COMMON_H
1122c9018cy
1222c9018cy#include "utils/list.h"
1322c9018cy
148d61b8dcy/* Events enable bits (wpa_ctrl_dst::events) */
158d61b8dcy#define WPA_EVENT_RX_PROBE_REQUEST BIT(0)
168d61b8dcy
1722c9018cy/**
1822c9018cy * struct wpa_ctrl_dst - Data structure of control interface monitors
1922c9018cy *
2022c9018cy * This structure is used to store information about registered control
2122c9018cy * interface monitors into struct wpa_supplicant.
2222c9018cy */
2322c9018cystruct wpa_ctrl_dst {
2422c9018cy	struct dl_list list;
2522c9018cy	struct sockaddr_storage addr;
2622c9018cy	socklen_t addrlen;
2722c9018cy	int debug_level;
2822c9018cy	int errors;
298d61b8dcy	u32 events; /* WPA_EVENT_* bitmap */
3022c9018cy};
3122c9018cy
3222c9018cyvoid sockaddr_print(int level, const char *msg, struct sockaddr_storage *sock,
3322c9018cy		    socklen_t socklen);
3422c9018cy
3522c9018cyint ctrl_iface_attach(struct dl_list *ctrl_dst, struct sockaddr_storage *from,
368d61b8dcy		       socklen_t fromlen, const char *input);
3722c9018cyint ctrl_iface_detach(struct dl_list *ctrl_dst, struct sockaddr_storage *from,
3822c9018cy		      socklen_t fromlen);
3922c9018cyint ctrl_iface_level(struct dl_list *ctrl_dst, struct sockaddr_storage *from,
4022c9018cy		     socklen_t fromlen, const char *level);
4122c9018cy
4222c9018cy#endif /* CONTROL_IFACE_COMMON_H */
43