aboutsummaryrefslogtreecommitdiffstats
path: root/src/utils
diff options
context:
space:
mode:
authorJouni Malinen <j@w1.fi>2013-05-18 16:18:31 (GMT)
committerJouni Malinen <j@w1.fi>2013-05-18 16:18:31 (GMT)
commitc4bf83a7231f2f41d21530d8c73a1033ae728ba5 (patch)
tree5f907208dd701e0ae5ca804383a977126e015792 /src/utils
parent7793c959e6ff88d57d8577b83ef8001826658f9f (diff)
downloadhostap-c4bf83a7231f2f41d21530d8c73a1033ae728ba5.zip
hostap-c4bf83a7231f2f41d21530d8c73a1033ae728ba5.tar.gz
hostap-c4bf83a7231f2f41d21530d8c73a1033ae728ba5.tar.bz2
P2P: No duplicate AP-STA-CONNECTED/DISCONNECTED as global event
These events are sent as a special case to both the group interface and "parent interface" (i.e., the interface that was used for managing P2P negotiation). The latter is not really correct event, so get rid of it with the new global control interface design where there is no need to support legacy upper layer implementations. Signed-hostap: Jouni Malinen <j@w1.fi>
Diffstat (limited to 'src/utils')
-rw-r--r--src/utils/wpa_debug.c23
-rw-r--r--src/utils/wpa_debug.h15
2 files changed, 38 insertions, 0 deletions
diff --git a/src/utils/wpa_debug.c b/src/utils/wpa_debug.c
index 75cb473..38ea8aa 100644
--- a/src/utils/wpa_debug.c
+++ b/src/utils/wpa_debug.c
@@ -671,6 +671,29 @@ void wpa_msg_global(void *ctx, int level, const char *fmt, ...)
os_free(buf);
}
+
+void wpa_msg_no_global(void *ctx, int level, const char *fmt, ...)
+{
+ va_list ap;
+ char *buf;
+ const int buflen = 2048;
+ int len;
+
+ buf = os_malloc(buflen);
+ if (buf == NULL) {
+ wpa_printf(MSG_ERROR, "wpa_msg_no_global: Failed to allocate "
+ "message buffer");
+ return;
+ }
+ va_start(ap, fmt);
+ len = vsnprintf(buf, buflen, fmt, ap);
+ va_end(ap);
+ wpa_printf(level, "%s", buf);
+ if (wpa_msg_cb)
+ wpa_msg_cb(ctx, level, 2, buf, len);
+ os_free(buf);
+}
+
#endif /* CONFIG_NO_WPA_MSG */
diff --git a/src/utils/wpa_debug.h b/src/utils/wpa_debug.h
index 4b60898..2ed1bd8 100644
--- a/src/utils/wpa_debug.h
+++ b/src/utils/wpa_debug.h
@@ -156,6 +156,7 @@ void wpa_hexdump_ascii_key(int level, const char *title, const u8 *buf,
#define wpa_msg(args...) do { } while (0)
#define wpa_msg_ctrl(args...) do { } while (0)
#define wpa_msg_global(args...) do { } while (0)
+#define wpa_msg_no_global(args...) do { } while (0)
#define wpa_msg_register_cb(f) do { } while (0)
#define wpa_msg_register_ifname_cb(f) do { } while (0)
#else /* CONFIG_NO_WPA_MSG */
@@ -206,6 +207,20 @@ PRINTF_FORMAT(3, 4);
void wpa_msg_global(void *ctx, int level, const char *fmt, ...)
PRINTF_FORMAT(3, 4);
+/**
+ * wpa_msg_no_global - 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 does not send the output as a global
+ * event.
+ */
+void wpa_msg_no_global(void *ctx, int level, const char *fmt, ...)
+PRINTF_FORMAT(3, 4);
+
typedef void (*wpa_msg_cb_func)(void *ctx, int level, int global,
const char *txt, size_t len);