wpa_supplicant / hostapd  2.5
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
Functions | Variables
wpa_debug.c File Reference

wpa_supplicant/hostapd / Debug prints More...

#include "includes.h"
#include "common.h"

Functions

void wpa_debug_print_timestamp (void)
 Print timestamp for debug output. More...
 
void wpa_printf (int level, const char *fmt,...)
 conditional printf More...
 
void wpa_hexdump (int level, const char *title, const void *buf, size_t len)
 conditional hex dump More...
 
void wpa_hexdump_key (int level, const char *title, const void *buf, size_t len)
 conditional hex dump, hide keys More...
 
void wpa_hexdump_ascii (int level, const char *title, const void *buf, size_t len)
 conditional hex dump More...
 
void wpa_hexdump_ascii_key (int level, const char *title, const void *buf, size_t len)
 conditional hex dump, hide keys More...
 
int wpa_debug_reopen_file (void)
 
int wpa_debug_open_file (const char *path)
 
void wpa_debug_close_file (void)
 
void wpa_debug_setup_stdout (void)
 
void wpa_msg_register_cb (wpa_msg_cb_func func)
 Register callback function for wpa_msg() messages. More...
 
void wpa_msg_register_ifname_cb (wpa_msg_get_ifname_func func)
 
void wpa_msg (void *ctx, int level, const char *fmt,...)
 
void wpa_msg_ctrl (void *ctx, int level, const char *fmt,...)
 
void wpa_msg_global (void *ctx, int level, const char *fmt,...)
 
void wpa_msg_global_ctrl (void *ctx, int level, const char *fmt,...)
 
void wpa_msg_no_global (void *ctx, int level, const char *fmt,...)
 
void wpa_msg_global_only (void *ctx, int level, const char *fmt,...)
 
void hostapd_logger_register_cb (hostapd_logger_cb_func func)
 Register callback function for hostapd_logger() More...
 
void hostapd_logger (void *ctx, const u8 *addr, unsigned int module, int level, const char *fmt,...)
 
const char * debug_level_str (int level)
 
int str_to_debug_level (const char *s)
 

Variables

int wpa_debug_level = MSG_INFO
 
int wpa_debug_show_keys = 0
 
int wpa_debug_timestamp = 0
 

Detailed Description

wpa_supplicant/hostapd / Debug prints

Function Documentation

void hostapd_logger_register_cb ( hostapd_logger_cb_func  func)

Register callback function for hostapd_logger()

Parameters
funcCallback function (NULL to unregister)
void wpa_debug_print_timestamp ( void  )

Print timestamp for debug output.

This function prints a timestamp in seconds_from_1970.microsoconds format if debug output has been configured to include timestamps in debug messages.

void wpa_hexdump ( int  level,
const char *  title,
const void *  buf,
size_t  len 
)

conditional hex dump

Parameters
levelpriority level (MSG_*) of the message
titletitle of for the message
bufdata buffer to be dumped
lenlength of the buf

This function is used to print conditional debugging and error messages. The output may be directed to stdout, stderr, and/or syslog based on configuration. The contents of buf is printed out has hex dump.

void wpa_hexdump_ascii ( int  level,
const char *  title,
const void *  buf,
size_t  len 
)

conditional hex dump

Parameters
levelpriority level (MSG_*) of the message
titletitle of for the message
bufdata buffer to be dumped
lenlength of the buf

This function is used to print conditional debugging and error messages. The output may be directed to stdout, stderr, and/or syslog based on configuration. The contents of buf is printed out has hex dump with both the hex numbers and ASCII characters (for printable range) are shown. 16 bytes per line will be shown.

void wpa_hexdump_ascii_key ( int  level,
const char *  title,
const void *  buf,
size_t  len 
)

conditional hex dump, hide keys

Parameters
levelpriority level (MSG_*) of the message
titletitle of for the message
bufdata buffer to be dumped
lenlength of the buf

This function is used to print conditional debugging and error messages. The output may be directed to stdout, stderr, and/or syslog based on configuration. The contents of buf is printed out has hex dump with both the hex numbers and ASCII characters (for printable range) are shown. 16 bytes per line will be shown. This works like wpa_hexdump_ascii(), but by default, does not include secret keys (passwords, etc.) in debug output.

void wpa_hexdump_key ( int  level,
const char *  title,
const void *  buf,
size_t  len 
)

conditional hex dump, hide keys

Parameters
levelpriority level (MSG_*) of the message
titletitle of for the message
bufdata buffer to be dumped
lenlength of the buf

This function is used to print conditional debugging and error messages. The output may be directed to stdout, stderr, and/or syslog based on configuration. The contents of buf is printed out has hex dump. This works like wpa_hexdump(), but by default, does not include secret keys (passwords, etc.) in debug output.

void wpa_msg_register_cb ( wpa_msg_cb_func  func)

Register callback function for wpa_msg() messages.

Parameters
funcCallback function (NULL to unregister)
void wpa_printf ( int  level,
const char *  fmt,
  ... 
)

conditional printf

Parameters
levelpriority level (MSG_*) of the message
fmtprintf format string, followed by optional arguments

This function is used to print conditional debugging and error messages. The output may be directed to stdout, stderr, and/or syslog based on configuration.

Note: New line '
' is added to the end of the text when printing to stdout.