aboutsummaryrefslogtreecommitdiffstats
path: root/wpa_supplicant
diff options
context:
space:
mode:
authorJouni Malinen <jouni@qca.qualcomm.com>2015-02-06 10:08:28 (GMT)
committerJouni Malinen <j@w1.fi>2015-06-10 13:02:00 (GMT)
commit995a3a06f4bfe85da787ae7b683c874b1f170e64 (patch)
tree0997b27915303636aaf0a0f3a8c21fefa888e60b /wpa_supplicant
parente66bcedd3ea62c1fa72f95cea918483ec5cb84a5 (diff)
downloadhostap-995a3a06f4bfe85da787ae7b683c874b1f170e64.zip
hostap-995a3a06f4bfe85da787ae7b683c874b1f170e64.tar.gz
hostap-995a3a06f4bfe85da787ae7b683c874b1f170e64.tar.bz2
Document the wpa_msg_cb "global" parameter
Instead of an int variable with magic values 0, 1, 2, use an enum that gives clearer meaning to the values now that the original boolean type global argument is not really a boolean anymore. Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
Diffstat (limited to 'wpa_supplicant')
-rw-r--r--wpa_supplicant/ctrl_iface_named_pipe.c3
-rw-r--r--wpa_supplicant/ctrl_iface_udp.c3
-rw-r--r--wpa_supplicant/ctrl_iface_unix.c16
3 files changed, 12 insertions, 10 deletions
diff --git a/wpa_supplicant/ctrl_iface_named_pipe.c b/wpa_supplicant/ctrl_iface_named_pipe.c
index dc02db2..54e0e2f 100644
--- a/wpa_supplicant/ctrl_iface_named_pipe.c
+++ b/wpa_supplicant/ctrl_iface_named_pipe.c
@@ -423,7 +423,8 @@ static int ctrl_iface_parse(struct ctrl_iface_priv *priv, const char *params)
}
-static void wpa_supplicant_ctrl_iface_msg_cb(void *ctx, int level, int global,
+static void wpa_supplicant_ctrl_iface_msg_cb(void *ctx, int level,
+ enum wpa_msg_type type,
const char *txt, size_t len)
{
struct wpa_supplicant *wpa_s = ctx;
diff --git a/wpa_supplicant/ctrl_iface_udp.c b/wpa_supplicant/ctrl_iface_udp.c
index bf6a3df..76f69f2 100644
--- a/wpa_supplicant/ctrl_iface_udp.c
+++ b/wpa_supplicant/ctrl_iface_udp.c
@@ -322,7 +322,8 @@ static void wpa_supplicant_ctrl_iface_receive(int sock, void *eloop_ctx,
}
-static void wpa_supplicant_ctrl_iface_msg_cb(void *ctx, int level, int global,
+static void wpa_supplicant_ctrl_iface_msg_cb(void *ctx, int level,
+ enum wpa_msg_type type,
const char *txt, size_t len)
{
struct wpa_supplicant *wpa_s = ctx;
diff --git a/wpa_supplicant/ctrl_iface_unix.c b/wpa_supplicant/ctrl_iface_unix.c
index b1ac766..22001cf 100644
--- a/wpa_supplicant/ctrl_iface_unix.c
+++ b/wpa_supplicant/ctrl_iface_unix.c
@@ -295,7 +295,8 @@ static char * wpa_supplicant_ctrl_iface_path(struct wpa_supplicant *wpa_s)
}
-static void wpa_supplicant_ctrl_iface_msg_cb(void *ctx, int level, int global,
+static void wpa_supplicant_ctrl_iface_msg_cb(void *ctx, int level,
+ enum wpa_msg_type type,
const char *txt, size_t len)
{
struct wpa_supplicant *wpa_s = ctx;
@@ -303,15 +304,14 @@ static void wpa_supplicant_ctrl_iface_msg_cb(void *ctx, int level, int global,
if (wpa_s == NULL)
return;
- if (global != 2 && wpa_s->global->ctrl_iface) {
+ if (type != WPA_MSG_NO_GLOBAL && wpa_s->global->ctrl_iface) {
struct ctrl_iface_global_priv *priv = wpa_s->global->ctrl_iface;
if (!dl_list_empty(&priv->ctrl_dst)) {
- wpa_supplicant_ctrl_iface_send(wpa_s, global ? NULL :
- wpa_s->ifname,
- priv->sock,
- &priv->ctrl_dst,
- level, txt, len, NULL,
- priv);
+ wpa_supplicant_ctrl_iface_send(
+ wpa_s,
+ type == WPA_MSG_GLOBAL ? NULL : wpa_s->ifname,
+ priv->sock, &priv->ctrl_dst, level, txt, len,
+ NULL, priv);
}
}