]> git.ipfire.org Git - thirdparty/iw.git/blobdiff - iw.c
add #include <string.h>
[thirdparty/iw.git] / iw.c
diff --git a/iw.c b/iw.c
index bff5f4b78fe2f8931284f4249129e502fc2adecb..3368d58f7b6f1becb777150969eb29596c0458e4 100644 (file)
--- a/iw.c
+++ b/iw.c
@@ -6,6 +6,8 @@
 
 #include <errno.h>
 #include <stdio.h>
+#include <string.h>
+
 #include <netlink/genl/genl.h>
 #include <netlink/genl/family.h>
 #include <netlink/genl/ctrl.h>  
@@ -88,15 +90,14 @@ static int get_phy_or_dev(int *argc, char ***argv, char **name)
        return 0;
 }
 
-void usage(char *argv0)
+static void usage(char *argv0)
 {
-       fprintf(stderr, "Usage: %1$s dev <phydev> interface <COMMAND> [OPTIONS]\n"
-                       "       %1$s dev <phydev> info\n"
-                       "\n"
-                       "where COMMAND := { add | del }\n"
+       fprintf(stderr, "Usage: %1$s dev <phydev> <OBJECT> <COMMAND> [OPTIONS]"
+                       "\n     %1$s dev <phydev> info\n"
                        "\n"
-                       "For add, OPTIONS := <name> type <type>\n"
-                       "For del, OPTIONS should be blank and phydev is the interface to delete.\n", argv0);
+                       "where OBJECT := { interface | station | mpath }\n"
+                       "and COMMAND := { add | del | set | get | dump }\n",
+                       argv0);
 }
 
 int main(int argc, char **argv)
@@ -142,6 +143,10 @@ int main(int argc, char **argv)
                err = handle_interface(&nlstate, phyname, ifname, argc, argv);
        else if (strcmp(type, "info") == 0)
                err = handle_info(&nlstate, phyname, ifname);
+       else if (strcmp(type, "station") == 0)
+               err = handle_station(&nlstate, ifname, argc, argv);
+       else if (strcmp(type, "mpath") == 0)
+               err = handle_mpath(&nlstate, ifname, argc, argv);
        else {
                fprintf(stderr, "No such object type %s\n", type);
                err = 1;