]> git.ipfire.org Git - thirdparty/iw.git/commitdiff
add command to set mesh ID
authorJohannes Berg <johannes@sipsolutions.net>
Tue, 16 Sep 2008 18:45:34 +0000 (20:45 +0200)
committerJohannes Berg <johannes@sipsolutions.net>
Tue, 16 Sep 2008 18:45:34 +0000 (20:45 +0200)
interface.c

index 58734c9b274c94de7125bd4df14da92ddfb4d5cf..2137665543022e72eef91e6cfbbb62ab5a88b406 100644 (file)
@@ -201,3 +201,23 @@ static int handle_interface_set(struct nl_cb *cb,
 }
 COMMAND(set, monitor, "<flag> [...]",
        NL80211_CMD_SET_INTERFACE, 0, CIB_NETDEV, handle_interface_set);
+
+static int handle_interface_meshid(struct nl_cb *cb,
+                                  struct nl_msg *msg,
+                                  int argc, char **argv)
+{
+       char *mesh_id = NULL;
+
+       if (argc != 1)
+               return 1;
+
+       mesh_id = argv[0];
+
+       NLA_PUT(msg, NL80211_ATTR_MESH_ID, strlen(mesh_id), mesh_id);
+
+       return 0;
+ nla_put_failure:
+       return -ENOBUFS;
+}
+COMMAND(set, meshid, "<meshid>",
+       NL80211_CMD_SET_INTERFACE, 0, CIB_NETDEV, handle_interface_meshid);