Merge branch 'moonshot' of ssh://moonshot.suchdamage.org:822/srv/git/libeap into...
[libeap.git] / wpa_supplicant / main.c
index c936b9e..c0aa59c 100644 (file)
@@ -19,6 +19,9 @@
 
 #include "common.h"
 #include "wpa_supplicant_i.h"
+#include "driver_i.h"
+
+extern struct wpa_driver_ops *wpa_drivers[];
 
 
 static void usage(void)
@@ -31,6 +34,7 @@ static void usage(void)
               "        -i<ifname> -c<config file> [-C<ctrl>] [-D<driver>] "
               "[-p<driver_param>] \\\n"
               "        [-b<br_ifname>] [-f<debug file>] \\\n"
+              "        [-o<override driver>] [-O<override ctrl>] \\\n"
               "        [-N -i<ifname> -c<conf> [-C<ctrl>] "
               "[-D<driver>] \\\n"
               "        [-p<driver_param>] [-b<br_ifname>] ...]\n"
@@ -38,10 +42,10 @@ static void usage(void)
               "drivers:\n",
               wpa_supplicant_version, wpa_supplicant_license);
 
-       for (i = 0; wpa_supplicant_drivers[i]; i++) {
+       for (i = 0; wpa_drivers[i]; i++) {
                printf("  %s = %s\n",
-                      wpa_supplicant_drivers[i]->name,
-                      wpa_supplicant_drivers[i]->desc);
+                      wpa_drivers[i]->name,
+                      wpa_drivers[i]->desc);
        }
 
 #ifndef CONFIG_NO_STDOUT_DEBUG
@@ -64,20 +68,21 @@ static void usage(void)
        printf("  -t = include timestamp in debug messages\n"
               "  -h = show this help text\n"
               "  -L = show license (GPL and BSD)\n"
+              "  -o = override driver parameter for new interfaces\n"
+              "  -O = override ctrl_interface parameter for new interfaces\n"
               "  -p = driver parameters\n"
               "  -P = PID file\n"
               "  -q = decrease debugging verbosity (-qq even less)\n");
-#ifdef CONFIG_CTRL_IFACE_DBUS
+#ifdef CONFIG_DBUS
        printf("  -u = enable DBus control interface\n");
-#endif /* CONFIG_CTRL_IFACE_DBUS */
+#endif /* CONFIG_DBUS */
        printf("  -v = show version\n"
               "  -W = wait for a control interface monitor before starting\n"
               "  -N = start describing new interface\n");
 
        printf("example:\n"
               "  wpa_supplicant -D%s -iwlan0 -c/etc/wpa_supplicant.conf\n",
-              wpa_supplicant_drivers[i] ?
-                  wpa_supplicant_drivers[i]->name : "wext");
+              wpa_drivers[i] ? wpa_drivers[i]->name : "wext");
 #endif /* CONFIG_NO_STDOUT_DEBUG */
 }
 
@@ -138,7 +143,7 @@ int main(int argc, char *argv[])
        wpa_supplicant_fd_workaround();
 
        for (;;) {
-               c = getopt(argc, argv, "b:Bc:C:D:df:g:hi:KLNp:P:qstuvW");
+               c = getopt(argc, argv, "b:Bc:C:D:df:g:hi:KLNo:O:p:P:qstuvW");
                if (c < 0)
                        break;
                switch (c) {
@@ -189,6 +194,12 @@ int main(int argc, char *argv[])
                        license();
                        exitcode = 0;
                        goto out;
+               case 'o':
+                       params.override_driver = optarg;
+                       break;
+               case 'O':
+                       params.override_ctrl_interface = optarg;
+                       break;
                case 'p':
                        iface->driver_param = optarg;
                        break;
@@ -207,11 +218,11 @@ int main(int argc, char *argv[])
                case 't':
                        params.wpa_debug_timestamp++;
                        break;
-#ifdef CONFIG_CTRL_IFACE_DBUS
+#ifdef CONFIG_DBUS
                case 'u':
                        params.dbus_ctrl_interface = 1;
                        break;
-#endif /* CONFIG_CTRL_IFACE_DBUS */
+#endif /* CONFIG_DBUS */
                case 'v':
                        printf("%s\n", wpa_supplicant_version);
                        exitcode = 0;