Root/package/hostapd/files/multicall.c

1#include <stdio.h>
2#include <string.h>
3#include <stdbool.h>
4
5extern int hostapd_main(int argc, char **argv);
6extern int wpa_supplicant_main(int argc, char **argv);
7
8int main(int argc, char **argv)
9{
10    bool restart = false;
11    const char *prog = argv[0];
12
13restart:
14    if (strstr(argv[0], "hostapd"))
15        return hostapd_main(argc, argv);
16    else if (strstr(argv[0], "wpa_supplicant"))
17        return wpa_supplicant_main(argc, argv);
18
19    if (!restart && argc > 1) {
20        argv++;
21        argc--;
22        restart = true;
23        goto restart;
24    }
25
26    fprintf(stderr, "Invalid command.\nUsage: %s wpa_supplicant|hostapd [<arguments>]\n", prog);
27    return 255;
28}
29

Archive Download this file



interactive