]> git.ipfire.org Git - thirdparty/iw.git/blobdiff - mesh.c
iw: remove sizer section and related code
[thirdparty/iw.git] / mesh.c
diff --git a/mesh.c b/mesh.c
index 37973355a64e549930dce8a1b64290384a3a63d9..40e5e5e8f0da1dbc2f5b8a1a512fba7a342d7b84 100644 (file)
--- a/mesh.c
+++ b/mesh.c
@@ -11,6 +11,7 @@
 #include "iw.h"
 
 SECTION(mesh);
+SECTION(mesh_param);
 
 
 typedef struct _any_t {
@@ -399,6 +400,7 @@ static int print_mesh_param_handler(struct nl_msg *msg, void *arg)
        if (!mdescr) {
                unsigned int i;
 
+               /* print out all the supported mesh parameters */
                for (i = 0; i < ARRAY_SIZE(_mesh_param_descrs); i++) {
                        mdescr = &_mesh_param_descrs[i];
                        if (mesh_params[mdescr->mesh_param_num]) {
@@ -410,7 +412,7 @@ static int print_mesh_param_handler(struct nl_msg *msg, void *arg)
                return NL_SKIP;
        }
 
-       /* print out the mesh parameter */
+       /* print out the requested mesh parameter */
        if (mesh_params[mdescr->mesh_param_num]) {
                mdescr->nla_print_fn(mesh_params[mdescr->mesh_param_num]);
                printf("\n");
@@ -447,6 +449,19 @@ COMMAND(get, mesh_param, "[<param>]",
        NL80211_CMD_GET_MESH_PARAMS, 0, CIB_NETDEV, get_interface_meshparam,
        "Retrieve mesh parameter (run command without any to see available ones).");
 
+static int dump_interface_meshparam(struct nl80211_state *state,
+                                   struct nl_msg *msg,
+                                   int argc, char **argv,
+                                   enum id_input id)
+{
+       register_handler(print_mesh_param_handler, NULL);
+       return 0;
+}
+
+COMMAND(mesh_param, dump, "",
+       NL80211_CMD_GET_MESH_PARAMS, 0, CIB_NETDEV, dump_interface_meshparam,
+       "List all supported mesh parameters");
+
 static int join_mesh(struct nl80211_state *state,
                     struct nl_msg *msg, int argc, char **argv,
                     enum id_input id)
@@ -470,7 +485,7 @@ static int join_mesh(struct nl80211_state *state,
                int err, parsed;
 
                err = parse_freqchan(&chandef, false, argc - 1, argv + 1,
-                                    &parsed);
+                                    &parsed, false);
                if (err)
                        return err;