10 extern int wpa_debug_level;
11 extern int wpa_debug_show_keys;
12 extern int wpa_debug_timestamp;
18 MSG_EXCESSIVE, MSG_MSGDUMP, MSG_DEBUG, MSG_INFO, MSG_WARNING, MSG_ERROR
21 #ifdef CONFIG_NO_STDOUT_DEBUG
23 #define wpa_debug_print_timestamp() do { } while (0)
24 #define wpa_printf(args...) do { } while (0)
25 #define wpa_hexdump(l,t,b,le) do { } while (0)
26 #define wpa_hexdump_buf(l,t,b) do { } while (0)
27 #define wpa_hexdump_key(l,t,b,le) do { } while (0)
28 #define wpa_hexdump_buf_key(l,t,b) do { } while (0)
29 #define wpa_hexdump_ascii(l,t,b,le) do { } while (0)
30 #define wpa_hexdump_ascii_key(l,t,b,le) do { } while (0)
31 #define wpa_debug_open_file(p) do { } while (0)
32 #define wpa_debug_close_file() do { } while (0)
33 #define wpa_debug_setup_stdout() do { } while (0)
34 #define wpa_dbg(args...) do { } while (0)
36 static inline int wpa_debug_reopen_file(
void)
43 int wpa_debug_open_file(
const char *path);
44 int wpa_debug_reopen_file(
void);
45 void wpa_debug_close_file(
void);
46 void wpa_debug_setup_stdout(
void);
69 void wpa_printf(
int level,
const char *fmt, ...)
83 void wpa_hexdump(
int level, const
char *title, const
void *buf,
size_t len);
85 static inline
void wpa_hexdump_buf(
int level, const
char *title,
88 wpa_hexdump(level, title, buf ? wpabuf_head(buf) : NULL,
89 buf ? wpabuf_len(buf) : 0);
105 void wpa_hexdump_key(
int level,
const char *title,
const void *buf,
size_t len);
107 static inline void wpa_hexdump_buf_key(
int level,
const char *title,
111 buf ? wpabuf_len(buf) : 0);
153 #define wpa_dbg(args...) wpa_msg(args)
158 #ifdef CONFIG_NO_WPA_MSG
159 #define wpa_msg(args...) do { } while (0)
160 #define wpa_msg_ctrl(args...) do { } while (0)
161 #define wpa_msg_global(args...) do { } while (0)
162 #define wpa_msg_global_ctrl(args...) do { } while (0)
163 #define wpa_msg_no_global(args...) do { } while (0)
164 #define wpa_msg_global_only(args...) do { } while (0)
165 #define wpa_msg_register_cb(f) do { } while (0)
166 #define wpa_msg_register_ifname_cb(f) do { } while (0)
182 void wpa_msg(
void *ctx,
int level,
const char *fmt, ...) PRINTF_FORMAT(3, 4);
196 void wpa_msg_ctrl(
void *ctx,
int level, const
char *fmt, ...)
259 WPA_MSG_PER_INTERFACE,
265 typedef void (*wpa_msg_cb_func)(
void *ctx,
int level,
enum wpa_msg_type type,
266 const char *txt,
size_t len);
274 typedef const char * (*wpa_msg_get_ifname_func)(
void *ctx);
275 void wpa_msg_register_ifname_cb(wpa_msg_get_ifname_func func);
279 #ifdef CONFIG_NO_HOSTAPD_LOGGER
280 #define hostapd_logger(args...) do { } while (0)
281 #define hostapd_logger_register_cb(f) do { } while (0)
283 void hostapd_logger(
void *ctx,
const u8 *addr,
unsigned int module,
int level,
284 const char *fmt, ...) PRINTF_FORMAT(5, 6);
286 typedef
void (*hostapd_logger_cb_func)(
void *ctx, const u8 *addr,
287 unsigned int module,
int level,
288 const
char *txt,
size_t len);
297 #define HOSTAPD_MODULE_IEEE80211 0x00000001
298 #define HOSTAPD_MODULE_IEEE8021X 0x00000002
299 #define HOSTAPD_MODULE_RADIUS 0x00000004
300 #define HOSTAPD_MODULE_WPA 0x00000008
301 #define HOSTAPD_MODULE_DRIVER 0x00000010
302 #define HOSTAPD_MODULE_IAPP 0x00000020
303 #define HOSTAPD_MODULE_MLME 0x00000040
305 enum hostapd_logger_level {
306 HOSTAPD_LEVEL_DEBUG_VERBOSE = 0,
307 HOSTAPD_LEVEL_DEBUG = 1,
308 HOSTAPD_LEVEL_INFO = 2,
309 HOSTAPD_LEVEL_NOTICE = 3,
310 HOSTAPD_LEVEL_WARNING = 4
314 #ifdef CONFIG_DEBUG_SYSLOG
316 void wpa_debug_open_syslog(
void);
317 void wpa_debug_close_syslog(
void);
321 static inline void wpa_debug_open_syslog(
void)
325 static inline void wpa_debug_close_syslog(
void)
331 #ifdef CONFIG_DEBUG_LINUX_TRACING
333 int wpa_debug_open_linux_tracing(
void);
334 void wpa_debug_close_linux_tracing(
void);
338 static inline int wpa_debug_open_linux_tracing(
void)
343 static inline void wpa_debug_close_linux_tracing(
void)
351 #define WPA_ASSERT(a) \
354 printf("WPA_ASSERT FAILED '" #a "' " \
356 __FUNCTION__, __FILE__, __LINE__); \
361 #define WPA_ASSERT(a) do { } while (0)
364 const char * debug_level_str(
int level);
365 int str_to_debug_level(
const char *s);
void wpa_debug_print_timestamp(void)
Print timestamp for debug output.
Definition: wpa_debug.c:61
void wpa_hexdump_ascii(int level, const char *title, const void *buf, size_t len)
conditional hex dump
Definition: wpa_debug.c:494
void void void void void void wpa_msg_global_only(void *ctx, int level, const char *fmt,...) PRINTF_FORMAT(3
Conditional printf for ctrl_iface monitors.
void void void void void wpa_msg_no_global(void *ctx, int level, const char *fmt,...) PRINTF_FORMAT(3
Conditional printf for ctrl_iface monitors.
void void void wpa_msg_global(void *ctx, int level, const char *fmt,...) PRINTF_FORMAT(3
Global printf for ctrl_iface monitors.
void wpa_hexdump_ascii_key(int level, const char *title, const void *buf, size_t len)
conditional hex dump, hide keys
Definition: wpa_debug.c:501
void wpa_msg(void *ctx, int level, const char *fmt,...) PRINTF_FORMAT(3
Conditional printf for default target and ctrl_iface monitors.
void wpa_hexdump_key(int level, const char *title, const void *buf, size_t len)
conditional hex dump, hide keys
Definition: wpa_debug.c:380
void void wpa_msg_ctrl(void *ctx, int level, const char *fmt,...) PRINTF_FORMAT(3
Conditional printf for ctrl_iface monitors.
void hostapd_logger_register_cb(hostapd_logger_cb_func func)
Register callback function for hostapd_logger()
Definition: wpa_debug.c:781
void void void void wpa_msg_global_ctrl(void *ctx, int level, const char *fmt,...) PRINTF_FORMAT(3
Conditional global printf for ctrl_iface monitors.
void void wpa_hexdump(int level, const char *title, const void *buf, size_t len)
conditional hex dump
Definition: wpa_debug.c:374
void wpa_msg_register_cb(wpa_msg_cb_func func)
Register callback function for wpa_msg() messages.
Definition: wpa_debug.c:587
void wpa_printf(int level, const char *fmt,...) PRINTF_FORMAT(2
conditional printf