summaryrefslogtreecommitdiff
path: root/package/hostapd/files/multicall.c
diff options
context:
space:
mode:
authornbd <nbd@3c298f89-4303-0410-b956-a3cf2f4a3e73>2010-01-23 08:28:26 +0000
committernbd <nbd@3c298f89-4303-0410-b956-a3cf2f4a3e73>2010-01-23 08:28:26 +0000
commit1f0cb60a115cf4ed359a58a76ffdd46bcc5bbda1 (patch)
tree76570bd515c1b16edfd03ecc34cba3c45baceb55 /package/hostapd/files/multicall.c
parent7f1760652d125ff3867abe3c62dcb0f22a0013f1 (diff)
hostapd: add a build variant for wpa_supplicant and one for a multicall hostapd+supplicant program (wpad) and remove the old wpa_supplicant package
git-svn-id: svn://svn.openwrt.org/openwrt/trunk@19286 3c298f89-4303-0410-b956-a3cf2f4a3e73
Diffstat (limited to 'package/hostapd/files/multicall.c')
-rw-r--r--package/hostapd/files/multicall.c28
1 files changed, 28 insertions, 0 deletions
diff --git a/package/hostapd/files/multicall.c b/package/hostapd/files/multicall.c
new file mode 100644
index 0000000000..c8e814bb5c
--- /dev/null
+++ b/package/hostapd/files/multicall.c
@@ -0,0 +1,28 @@
+#include <stdio.h>
+#include <string.h>
+#include <stdbool.h>
+
+extern int hostapd_main(int argc, char **argv);
+extern int wpa_supplicant_main(int argc, char **argv);
+
+int main(int argc, char **argv)
+{
+ bool restart = false;
+ const char *prog = argv[0];
+
+restart:
+ if (strstr(argv[0], "hostapd"))
+ return hostapd_main(argc, argv);
+ else if (strstr(argv[0], "wpa_supplicant"))
+ return wpa_supplicant_main(argc, argv);
+
+ if (!restart && argc > 1) {
+ argv++;
+ argc--;
+ restart = true;
+ goto restart;
+ }
+
+ fprintf(stderr, "Invalid command.\nUsage: %s wpa_supplicant|hostapd [<arguments>]\n", prog);
+ return 255;
+}