]> git.ipfire.org Git - thirdparty/iw.git/commitdiff
add ability to document commands, document event/help
authorJohannes Berg <johannes@sipsolutions.net>
Tue, 5 May 2009 12:48:16 +0000 (14:48 +0200)
committerJohannes Berg <johannes@sipsolutions.net>
Tue, 5 May 2009 12:48:16 +0000 (14:48 +0200)
12 files changed:
event.c
ibss.c
info.c
interface.c
iw.c
iw.h
mesh.c
mpath.c
phy.c
reg.c
scan.c
station.c

diff --git a/event.c b/event.c
index 6a2bfd7808470ab51226489add794bd1782dc86e..a9e08a9f8d6449c5c04a01f219f8c7190fa7b1c2 100644 (file)
--- a/event.c
+++ b/event.c
@@ -299,4 +299,7 @@ static int print_events(struct nl80211_state *state,
 
        return __listen_events(state, 0, NULL, &args);
 }
-TOPLEVEL(event, "[-t] [-f]", 0, 0, CIB_NONE, print_events);
+TOPLEVEL(event, "[-t] [-f]", 0, 0, CIB_NONE, print_events,
+       "Monitor events from the kernel.\n"
+       "-t - print timestamp\n"
+       "-f - print full frame for auth/assoc etc.");
diff --git a/ibss.c b/ibss.c
index e3bbdeb899eaa2c77336a60d86cdbd449cf7c27d..65016d12a15947b706e50a7c8fe8dc07f27dd3e0 100644 (file)
--- a/ibss.c
+++ b/ibss.c
@@ -63,6 +63,6 @@ static int leave_ibss(struct nl80211_state *state,
        return 0;
 }
 COMMAND(ibss, leave, NULL,
-       NL80211_CMD_LEAVE_IBSS, 0, CIB_NETDEV, leave_ibss);
+       NL80211_CMD_LEAVE_IBSS, 0, CIB_NETDEV, leave_ibss, NULL);
 COMMAND(ibss, join, "<SSID> <freq in MHz> [fixed-freq] [<fixed bssid>]",
-       NL80211_CMD_JOIN_IBSS, 0, CIB_NETDEV, join_ibss);
+       NL80211_CMD_JOIN_IBSS, 0, CIB_NETDEV, join_ibss, NULL);
diff --git a/info.c b/info.c
index 66c652d5f76bb6a36b168bbfa4eabfbcf76ceed0..78f73d544676b223125dc039649fc3242e1d02e3 100644 (file)
--- a/info.c
+++ b/info.c
@@ -266,6 +266,6 @@ static int handle_info(struct nl80211_state *state,
 
        return 0;
 }
-TOPLEVEL(info, NULL, NL80211_CMD_GET_WIPHY, 0, CIB_PHY, handle_info);
-TOPLEVEL(list, NULL, NL80211_CMD_GET_WIPHY, NLM_F_DUMP, CIB_NONE, handle_info);
-TOPLEVEL(phy, NULL, NL80211_CMD_GET_WIPHY, NLM_F_DUMP, CIB_NONE, handle_info);
+TOPLEVEL(info, NULL, NL80211_CMD_GET_WIPHY, 0, CIB_PHY, handle_info, NULL);
+TOPLEVEL(list, NULL, NL80211_CMD_GET_WIPHY, NLM_F_DUMP, CIB_NONE, handle_info, NULL);
+TOPLEVEL(phy, NULL, NL80211_CMD_GET_WIPHY, NLM_F_DUMP, CIB_NONE, handle_info, NULL);
index 3665c5a81fbc3bf5b6583b6ce7a34321377984c7..54c2f0e6a0f91abd098ff808e473e72d0fcc2aba 100644 (file)
@@ -182,9 +182,9 @@ static int handle_interface_add(struct nl80211_state *state,
        return -ENOBUFS;
 }
 COMMAND(interface, add, "<name> type <type> [mesh_id <meshid>] [flags ...]",
-       NL80211_CMD_NEW_INTERFACE, 0, CIB_PHY, handle_interface_add);
+       NL80211_CMD_NEW_INTERFACE, 0, CIB_PHY, handle_interface_add, NULL);
 COMMAND(interface, add, "<name> type <type> [mesh_id <meshid>] [flags ...]",
-       NL80211_CMD_NEW_INTERFACE, 0, CIB_NETDEV, handle_interface_add);
+       NL80211_CMD_NEW_INTERFACE, 0, CIB_NETDEV, handle_interface_add, NULL);
 
 static int handle_interface_del(struct nl80211_state *state,
                                struct nl_cb *cb,
@@ -193,7 +193,7 @@ static int handle_interface_del(struct nl80211_state *state,
 {
        return 0;
 }
-TOPLEVEL(del, NULL, NL80211_CMD_DEL_INTERFACE, 0, CIB_NETDEV, handle_interface_del);
+TOPLEVEL(del, NULL, NL80211_CMD_DEL_INTERFACE, 0, CIB_NETDEV, handle_interface_del, NULL);
 HIDDEN(interface, del, NULL, NL80211_CMD_DEL_INTERFACE, 0, CIB_NETDEV, handle_interface_del);
 
 static int print_iface_handler(struct nl_msg *msg, void *arg)
@@ -232,7 +232,7 @@ static int handle_interface_info(struct nl80211_state *state,
        nl_cb_set(cb, NL_CB_VALID, NL_CB_CUSTOM, print_iface_handler, NULL);
        return 0;
 }
-TOPLEVEL(info, NULL, NL80211_CMD_GET_INTERFACE, 0, CIB_NETDEV, handle_interface_info);
+TOPLEVEL(info, NULL, NL80211_CMD_GET_INTERFACE, 0, CIB_NETDEV, handle_interface_info, NULL);
 
 static int handle_interface_set(struct nl80211_state *state,
                                struct nl_cb *cb,
@@ -260,7 +260,7 @@ static int handle_interface_set(struct nl80211_state *state,
        return -ENOBUFS;
 }
 COMMAND(set, monitor, "<flag> [...]",
-       NL80211_CMD_SET_INTERFACE, 0, CIB_NETDEV, handle_interface_set);
+       NL80211_CMD_SET_INTERFACE, 0, CIB_NETDEV, handle_interface_set, NULL);
 
 static int handle_interface_meshid(struct nl80211_state *state,
                                   struct nl_cb *cb,
@@ -281,7 +281,7 @@ static int handle_interface_meshid(struct nl80211_state *state,
        return -ENOBUFS;
 }
 COMMAND(set, meshid, "<meshid>",
-       NL80211_CMD_SET_INTERFACE, 0, CIB_NETDEV, handle_interface_meshid);
+       NL80211_CMD_SET_INTERFACE, 0, CIB_NETDEV, handle_interface_meshid, NULL);
 
 static unsigned int dev_dump_wiphy;
 
@@ -294,7 +294,7 @@ static int handle_dev_dump(struct nl80211_state *state,
        nl_cb_set(cb, NL_CB_VALID, NL_CB_CUSTOM, print_iface_handler, &dev_dump_wiphy);
        return 0;
 }
-TOPLEVEL(dev, NULL, NL80211_CMD_GET_INTERFACE, NLM_F_DUMP, CIB_NONE, handle_dev_dump);
+TOPLEVEL(dev, NULL, NL80211_CMD_GET_INTERFACE, NLM_F_DUMP, CIB_NONE, handle_dev_dump, NULL);
 
 static int handle_interface_type(struct nl80211_state *state,
                                 struct nl_cb *cb,
@@ -318,4 +318,4 @@ static int handle_interface_type(struct nl80211_state *state,
        return -ENOBUFS;
 }
 COMMAND(set, type, "<type>",
-       NL80211_CMD_SET_INTERFACE, 0, CIB_NETDEV, handle_interface_type);
+       NL80211_CMD_SET_INTERFACE, 0, CIB_NETDEV, handle_interface_type, NULL);
diff --git a/iw.c b/iw.c
index dca9089443687c2c0bed428dbab51733d699d8a8..2102278034700828e9b230dca30de7808991d014 100644 (file)
--- a/iw.c
+++ b/iw.c
@@ -94,13 +94,15 @@ static void nl80211_cleanup(struct nl80211_state *state)
        nl_socket_free(state->nl_sock);
 }
 
-__COMMAND(NULL, NULL, "", NULL, 0, 0, 0, CIB_NONE, NULL);
-__COMMAND(NULL, NULL, "", NULL, 1, 0, 0, CIB_NONE, NULL);
+__COMMAND(NULL, NULL, "", NULL, 0, 0, 0, CIB_NONE, NULL, NULL);
+__COMMAND(NULL, NULL, "", NULL, 1, 0, 0, CIB_NONE, NULL, NULL);
 
 static int cmd_size;
 
-static void __usage_cmd(struct cmd *cmd, char *indent)
+static void __usage_cmd(struct cmd *cmd, char *indent, bool full)
 {
+       const char *start, *lend, *end;
+
        fprintf(stderr, "%s", indent);
 
        switch (cmd->idby) {
@@ -119,6 +121,29 @@ static void __usage_cmd(struct cmd *cmd, char *indent)
        if (cmd->args)
                fprintf(stderr, " %s", cmd->args);
        fprintf(stderr, "\n");
+
+       if (!full || !cmd->help)
+               return;
+
+       /* hack */
+       if (strlen(indent))
+               indent = "\t\t";
+       else
+               fprintf(stderr, "\n");
+
+       /* print line by line */
+       start = cmd->help;
+       end = strchr(start, '\0');
+       do {
+               lend = strchr(start, '\n');
+               if (!lend)
+                       lend = end;
+               fprintf(stderr, "%s", indent);
+               fprintf(stderr, "%.*s\n", (int)(lend - start), start);
+               start = lend + 1;
+       } while (end != lend);
+
+       fprintf(stderr, "\n");
 }
 
 static void usage_options(void)
@@ -127,7 +152,9 @@ static void usage_options(void)
        fprintf(stderr, "\t--debug\t\tenable netlink debugging\n");
 }
 
-static void usage(const char *argv0)
+static const char *argv0;
+
+static void usage(bool full)
 {
        struct cmd *cmd;
 
@@ -135,19 +162,28 @@ static void usage(const char *argv0)
        usage_options();
        fprintf(stderr, "\t--version\tshow version\n");
        fprintf(stderr, "Commands:\n");
-       fprintf(stderr, "\thelp\n");
        for (cmd = &__start___cmd; cmd < &__stop___cmd;
             cmd = (struct cmd *)((char *)cmd + cmd_size)) {
                if (!cmd->handler || cmd->hidden)
                        continue;
-               __usage_cmd(cmd, "\t");
+               __usage_cmd(cmd, "\t", full);
        }
 }
 
-static void usage_cmd(const char *argv0, struct cmd *cmd)
+static int print_help(struct nl80211_state *state,
+                     struct nl_cb *cb,
+                     struct nl_msg *msg,
+                     int argc, char **argv)
+{
+       exit(3);
+}
+TOPLEVEL(help, NULL, 0, 0, CIB_NONE, print_help,
+        "Print usage for each command.");
+
+static void usage_cmd(struct cmd *cmd)
 {
        fprintf(stderr, "Usage:\t%s [options] ", argv0);
-       __usage_cmd(cmd, "");
+       __usage_cmd(cmd, "", true);
        usage_options();
 }
 
@@ -354,7 +390,6 @@ int main(int argc, char **argv)
 {
        struct nl80211_state nlstate;
        int err;
-       const char *argv0;
        struct cmd *cmd = NULL;
 
        /* calculate command size including padding */
@@ -375,8 +410,9 @@ int main(int argc, char **argv)
                return 0;
        }
 
+       /* need to treat "help" command specially so it works w/o nl80211 */
        if (argc == 0 || strcmp(*argv, "help") == 0) {
-               usage(argv0);
+               usage(argc != 0);
                return 0;
        }
 
@@ -402,9 +438,9 @@ int main(int argc, char **argv)
 
        if (err == 1) {
                if (cmd)
-                       usage_cmd(argv0, cmd);
+                       usage_cmd(cmd);
                else
-                       usage(argv0);
+                       usage(false);
        } else if (err < 0)
                fprintf(stderr, "command failed: %s (%d)\n", strerror(-err), err);
 
diff --git a/iw.h b/iw.h
index 7dcab513b82c1c6738f336976a61cd835490fc86..d97cc6e5320591dd28436e19451b536248059af4 100644 (file)
--- a/iw.h
+++ b/iw.h
@@ -37,6 +37,7 @@ struct cmd {
        const char *section;
        const char *name;
        const char *args;
+       const char *help;
        const enum nl80211_commands cmd;
        int nl_msg_flags;
        int hidden;
@@ -54,7 +55,7 @@ struct cmd {
 
 #define ARRAY_SIZE(ar) (sizeof(ar)/sizeof(ar[0]))
 
-#define __COMMAND(_section, _symname, _name, _args, _nlcmd, _flags, _hidden, _idby, _handler)\
+#define __COMMAND(_section, _symname, _name, _args, _nlcmd, _flags, _hidden, _idby, _handler, _help)\
        static const struct cmd                                         \
        __cmd ## _ ## _symname ## _ ## _handler ## _ ## _nlcmd ## _ ## _idby ## _ ## _hidden\
        __attribute__((used)) __attribute__((section("__cmd"))) = {     \
@@ -66,13 +67,14 @@ struct cmd {
                .hidden = (_hidden),                                    \
                .idby = (_idby),                                        \
                .handler = (_handler),                                  \
+               .help = (_help),                                        \
         }
-#define COMMAND(section, name, args, cmd, flags, idby, handler)        \
-       __COMMAND(#section, name, #name, args, cmd, flags, 0, idby, handler)
-#define HIDDEN(section, name, args, cmd, flags, idby, handler) \
-       __COMMAND(#section, name, #name, args, cmd, flags, 1, idby, handler)
-#define TOPLEVEL(name, args, cmd, flags, idby, handler)                \
-       __COMMAND(NULL, name, #name, args, cmd, flags, 0, idby, handler)
+#define COMMAND(section, name, args, cmd, flags, idby, handler, help)  \
+       __COMMAND(#section, name, #name, args, cmd, flags, 0, idby, handler, help)
+#define HIDDEN(section, name, args, cmd, flags, idby, handler)         \
+       __COMMAND(#section, name, #name, args, cmd, flags, 1, idby, handler, NULL)
+#define TOPLEVEL(name, args, cmd, flags, idby, handler, help)          \
+       __COMMAND(NULL, name, #name, args, cmd, flags, 0, idby, handler, help)
 extern struct cmd __start___cmd;
 extern struct cmd __stop___cmd;
 
diff --git a/mesh.c b/mesh.c
index 39a24b156c922234b84d6cbc49c5acdc82f256b2..df43465429b5bd10acc6e28641e552067b10cd94 100644 (file)
--- a/mesh.c
+++ b/mesh.c
@@ -244,7 +244,7 @@ static int set_interface_meshparam(struct nl80211_state *state,
 }
 
 COMMAND(set, mesh_param, "<param> <value>",
-       NL80211_CMD_SET_MESH_PARAMS, 0, CIB_NETDEV, set_interface_meshparam);
+       NL80211_CMD_SET_MESH_PARAMS, 0, CIB_NETDEV, set_interface_meshparam, NULL);
 
 /* Getter */
 static int print_mesh_param_handler(struct nl_msg *msg, void *arg)
@@ -290,4 +290,4 @@ static int get_interface_meshparam(struct nl80211_state *state,
 }
 
 COMMAND(get, mesh_param, "<param>",
-       NL80211_CMD_GET_MESH_PARAMS, 0, CIB_NETDEV, get_interface_meshparam);
+       NL80211_CMD_GET_MESH_PARAMS, 0, CIB_NETDEV, get_interface_meshparam, NULL);
diff --git a/mpath.c b/mpath.c
index e4bc8b695d720330e8f3830e9013b06931f4ae80..2a3dc0f1292ba639419ad75a3562a8766bd28afa 100644 (file)
--- a/mpath.c
+++ b/mpath.c
@@ -123,9 +123,9 @@ static int handle_mpath_get(struct nl80211_state *state,
        return -ENOBUFS;
 }
 COMMAND(mpath, get, "<MAC address>",
-       NL80211_CMD_GET_MPATH, 0, CIB_NETDEV, handle_mpath_get);
+       NL80211_CMD_GET_MPATH, 0, CIB_NETDEV, handle_mpath_get, NULL);
 COMMAND(mpath, del, "<MAC address>",
-       NL80211_CMD_DEL_MPATH, 0, CIB_NETDEV, handle_mpath_get);
+       NL80211_CMD_DEL_MPATH, 0, CIB_NETDEV, handle_mpath_get, NULL);
 
 static int handle_mpath_set(struct nl80211_state *state,
                            struct nl_cb *cb,
@@ -169,9 +169,9 @@ static int handle_mpath_set(struct nl80211_state *state,
        return -ENOBUFS;
 }
 COMMAND(mpath, new, "<destination MAC address> next_hop <next hop MAC address>",
-       NL80211_CMD_NEW_MPATH, 0, CIB_NETDEV, handle_mpath_set);
+       NL80211_CMD_NEW_MPATH, 0, CIB_NETDEV, handle_mpath_set, NULL);
 COMMAND(mpath, set, "<destination MAC address> next_hop <next hop MAC address>",
-       NL80211_CMD_SET_MPATH, 0, CIB_NETDEV, handle_mpath_set);
+       NL80211_CMD_SET_MPATH, 0, CIB_NETDEV, handle_mpath_set, NULL);
 
 static int handle_mpath_dump(struct nl80211_state *state,
                             struct nl_cb *cb,
@@ -182,4 +182,4 @@ static int handle_mpath_dump(struct nl80211_state *state,
        return 0;
 }
 COMMAND(mpath, dump, NULL,
-       NL80211_CMD_GET_MPATH, NLM_F_DUMP, CIB_NETDEV, handle_mpath_dump);
+       NL80211_CMD_GET_MPATH, NLM_F_DUMP, CIB_NETDEV, handle_mpath_dump, NULL);
diff --git a/phy.c b/phy.c
index 341e5a4649e3d50cb51dc99ad877d58ca168059a..bf0d6c1e5d3f61a8bd64bf505dd2fbf5f5ce1040 100644 (file)
--- a/phy.c
+++ b/phy.c
@@ -25,7 +25,7 @@ static int handle_name(struct nl80211_state *state,
  nla_put_failure:
        return -ENOBUFS;
 }
-COMMAND(set, name, "<new name>", NL80211_CMD_SET_WIPHY, 0, CIB_PHY, handle_name);
+COMMAND(set, name, "<new name>", NL80211_CMD_SET_WIPHY, 0, CIB_PHY, handle_name, NULL);
 
 static int handle_freqchan(struct nl_msg *msg, bool chan,
                           int argc, char **argv)
@@ -75,9 +75,9 @@ static int handle_freq(struct nl80211_state *state,
        return handle_freqchan(msg, false, argc, argv);
 }
 COMMAND(set, freq, "<freq> [HT20|HT40+|HT40-]",
-       NL80211_CMD_SET_WIPHY, 0, CIB_PHY, handle_freq);
+       NL80211_CMD_SET_WIPHY, 0, CIB_PHY, handle_freq, NULL);
 COMMAND(set, freq, "<freq> [HT20|HT40+|HT40-]",
-       NL80211_CMD_SET_WIPHY, 0, CIB_NETDEV, handle_freq);
+       NL80211_CMD_SET_WIPHY, 0, CIB_NETDEV, handle_freq, NULL);
 
 static int handle_chan(struct nl80211_state *state,
                       struct nl_cb *cb, struct nl_msg *msg,
@@ -86,6 +86,6 @@ static int handle_chan(struct nl80211_state *state,
        return handle_freqchan(msg, true, argc, argv);
 }
 COMMAND(set, channel, "<channel> [HT20|HT40+|HT40-]",
-       NL80211_CMD_SET_WIPHY, 0, CIB_PHY, handle_chan);
+       NL80211_CMD_SET_WIPHY, 0, CIB_PHY, handle_chan, NULL);
 COMMAND(set, channel, "<channel> [HT20|HT40+|HT40-]",
-       NL80211_CMD_SET_WIPHY, 0, CIB_NETDEV, handle_chan);
+       NL80211_CMD_SET_WIPHY, 0, CIB_NETDEV, handle_chan, NULL);
diff --git a/reg.c b/reg.c
index 796379ab50b9dd8891f199259551c7e797eee17f..b336471f42c0787fbd0f472ce4289aca6a7bf651 100644 (file)
--- a/reg.c
+++ b/reg.c
@@ -91,7 +91,7 @@ static int handle_reg_set(struct nl80211_state *state,
        return -ENOBUFS;
 }
 COMMAND(reg, set, "<ISO/IEC 3166-1 alpha2>",
-       NL80211_CMD_REQ_SET_REG, 0, CIB_NONE, handle_reg_set);
+       NL80211_CMD_REQ_SET_REG, 0, CIB_NONE, handle_reg_set, NULL);
 
 static int print_reg_handler(struct nl_msg *msg, void *arg)
 
@@ -184,4 +184,4 @@ static int handle_reg_get(struct nl80211_state *state,
        nl_cb_set(cb, NL_CB_VALID, NL_CB_CUSTOM, print_reg_handler, NULL);
        return 0;
 }
-COMMAND(reg, get, NULL, NL80211_CMD_GET_REG, 0, CIB_NONE, handle_reg_get);
+COMMAND(reg, get, NULL, NL80211_CMD_GET_REG, 0, CIB_NONE, handle_reg_get, NULL);
diff --git a/scan.c b/scan.c
index 8eb6477abed4f8f63efbc8e5aeb32293b65a1111..1373f89f0d88f3ac28d2352e8ebb776e3bca9a8a 100644 (file)
--- a/scan.c
+++ b/scan.c
@@ -108,7 +108,7 @@ static int handle_scan(struct nl80211_state *state,
        return err;
 }
 COMMAND(scan, trigger, "[freq <freq>*] [ssid <ssid>*|passive]",
-       NL80211_CMD_TRIGGER_SCAN, 0, CIB_NETDEV, handle_scan);
+       NL80211_CMD_TRIGGER_SCAN, 0, CIB_NETDEV, handle_scan, NULL);
 
 static void tab_on_first(bool *first)
 {
@@ -811,7 +811,7 @@ static int handle_scan_dump(struct nl80211_state *state,
        return 0;
 }
 COMMAND(scan, dump, "[-u]",
-       NL80211_CMD_GET_SCAN, NLM_F_DUMP, CIB_NETDEV, handle_scan_dump);
+       NL80211_CMD_GET_SCAN, NLM_F_DUMP, CIB_NETDEV, handle_scan_dump, NULL);
 
 static int handle_scan_combined(struct nl80211_state *state,
                                struct nl_cb *cb,
@@ -890,4 +890,4 @@ static int handle_scan_combined(struct nl80211_state *state,
        dump_argv[0] = argv[0];
        return handle_cmd(state, II_NETDEV, dump_argc, dump_argv);
 }
-TOPLEVEL(scan, "[-u] [freq <freq>*] [ssid <ssid>*|passive]", 0, 0, CIB_NETDEV, handle_scan_combined);
+TOPLEVEL(scan, "[-u] [freq <freq>*] [ssid <ssid>*|passive]", 0, 0, CIB_NETDEV, handle_scan_combined, NULL);
index 638e44f329ddf2d7c4e93773f865f09ca9b94b41..f18f3ea1f95b8aefa14ce3518d147177330b1c46 100644 (file)
--- a/station.c
+++ b/station.c
@@ -188,9 +188,9 @@ static int handle_station_get(struct nl80211_state *state,
        return -ENOBUFS;
 }
 COMMAND(station, get, "<MAC address>",
-       NL80211_CMD_GET_STATION, 0, CIB_NETDEV, handle_station_get);
+       NL80211_CMD_GET_STATION, 0, CIB_NETDEV, handle_station_get, NULL);
 COMMAND(station, del, "<MAC address>",
-       NL80211_CMD_DEL_STATION, 0, CIB_NETDEV, handle_station_get);
+       NL80211_CMD_DEL_STATION, 0, CIB_NETDEV, handle_station_get, NULL);
 
 static int handle_station_set(struct nl80211_state *state,
                              struct nl_cb *cb,
@@ -237,7 +237,7 @@ static int handle_station_set(struct nl80211_state *state,
        return -ENOBUFS;
 }
 COMMAND(station, set, "<MAC address> plink_action <open|block>",
-       NL80211_CMD_SET_STATION, 0, CIB_NETDEV, handle_station_set);
+       NL80211_CMD_SET_STATION, 0, CIB_NETDEV, handle_station_set, NULL);
 
 static int handle_station_dump(struct nl80211_state *state,
                               struct nl_cb *cb,
@@ -248,4 +248,4 @@ static int handle_station_dump(struct nl80211_state *state,
        return 0;
 }
 COMMAND(station, dump, NULL,
-       NL80211_CMD_GET_STATION, NLM_F_DUMP, CIB_NETDEV, handle_station_dump);
+       NL80211_CMD_GET_STATION, NLM_F_DUMP, CIB_NETDEV, handle_station_dump, NULL);