]> 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 c2b53ee236fc3244eb65cdc587b26fe37fd181e5..3368d58f7b6f1becb777150969eb29596c0458e4 100644 (file)
--- a/iw.c
+++ b/iw.c
@@ -1,13 +1,13 @@
 /*
  * nl80211 userspace tool
  *
- * Copyright 2007      Johannes Berg <johannes@sipsolutions.net>
- *
- * GPLv2
+ * Copyright 2007, 2008        Johannes Berg <johannes@sipsolutions.net>
  */
 
 #include <errno.h>
 #include <stdio.h>
+#include <string.h>
+
 #include <netlink/genl/genl.h>
 #include <netlink/genl/family.h>
 #include <netlink/genl/ctrl.h>  
@@ -90,10 +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: %s [options] {dev <phydev>} {interface <interface> } {COMMAND}\n"
-                       "where COMMAND := { add | del }\n", argv0);
+       fprintf(stderr, "Usage: %1$s dev <phydev> <OBJECT> <COMMAND> [OPTIONS]"
+                       "\n     %1$s dev <phydev> info\n"
+                       "\n"
+                       "where OBJECT := { interface | station | mpath }\n"
+                       "and COMMAND := { add | del | set | get | dump }\n",
+                       argv0);
 }
 
 int main(int argc, char **argv)
@@ -137,6 +141,12 @@ int main(int argc, char **argv)
 
        if (strcmp(type, "interface") == 0)
                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;