diff options
author | Felix Fietkau <nbd@openwrt.org> | 2010-01-23 08:28:26 +0000 |
---|---|---|
committer | Felix Fietkau <nbd@openwrt.org> | 2010-01-23 08:28:26 +0000 |
commit | 64268c716596edbad395cfa82ff30eb84a2f8488 (patch) | |
tree | 04d424eaeac0deea69260e5390f3d5972908c9ec /package/hostapd/files/multicall.c | |
parent | 26c953db2072dcc03e36c43446d237df83770270 (diff) | |
download | upstream-64268c716596edbad395cfa82ff30eb84a2f8488.tar.gz upstream-64268c716596edbad395cfa82ff30eb84a2f8488.tar.bz2 upstream-64268c716596edbad395cfa82ff30eb84a2f8488.zip |
hostapd: add a build variant for wpa_supplicant and one for a multicall hostapd+supplicant program (wpad) and remove the old wpa_supplicant package
SVN-Revision: 19286
Diffstat (limited to 'package/hostapd/files/multicall.c')
-rw-r--r-- | package/hostapd/files/multicall.c | 28 |
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; +} |