X-Git-Url: http://git.osdn.net/view?a=blobdiff_plain;f=wpa_supplicant%2Fsrc%2Futils%2Fwpa_debug.h;h=1ea5c2be2e5e10ca04817b6ab8f7e86e35a5ff62;hb=dde787cc314cd04caa4ea5f031cc8a02495ca513;hp=c8e840fb6d973ab4949adf72daa2ef5e23a66df0;hpb=44e8544d6995f5119d0155109a742f57ad8abd32;p=android-x86%2Fexternal-wpa_supplicant_6.git diff --git a/wpa_supplicant/src/utils/wpa_debug.h b/wpa_supplicant/src/utils/wpa_debug.h index c8e840f..1ea5c2b 100644 --- a/wpa_supplicant/src/utils/wpa_debug.h +++ b/wpa_supplicant/src/utils/wpa_debug.h @@ -83,7 +83,7 @@ void wpa_debug_print_timestamp(void); * * Note: New line '\n' is added to the end of the text when printing to stdout. */ -void wpa_printf(int level, char *fmt, ...) +void wpa_printf(int level, const char *fmt, ...) PRINTF_FORMAT(2, 3); /** @@ -165,6 +165,7 @@ void wpa_hexdump_ascii_key(int level, const char *title, const u8 *buf, #ifdef CONFIG_NO_WPA_MSG #define wpa_msg(args...) do { } while (0) +#define wpa_msg_ctrl(args...) do { } while (0) #define wpa_msg_register_cb(f) do { } while (0) #else /* CONFIG_NO_WPA_MSG */ /** @@ -181,7 +182,22 @@ void wpa_hexdump_ascii_key(int level, const char *title, const u8 *buf, * * Note: New line '\n' is added to the end of the text when printing to stdout. */ -void wpa_msg(void *ctx, int level, char *fmt, ...) PRINTF_FORMAT(3, 4); +void wpa_msg(void *ctx, int level, const char *fmt, ...) PRINTF_FORMAT(3, 4); + +/** + * wpa_msg_ctrl - Conditional printf for ctrl_iface monitors + * @ctx: Pointer to context data; this is the ctx variable registered + * with struct wpa_driver_ops::init() + * @level: priority level (MSG_*) of the message + * @fmt: printf format string, followed by optional arguments + * + * This function is used to print conditional debugging and error messages. + * This function is like wpa_msg(), but it sends the output only to the + * attached ctrl_iface monitors. In other words, it can be used for frequent + * events that do not need to be sent to syslog. + */ +void wpa_msg_ctrl(void *ctx, int level, const char *fmt, ...) +PRINTF_FORMAT(3, 4); typedef void (*wpa_msg_cb_func)(void *ctx, int level, const char *txt, size_t len);