/*
* 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>
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)
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;