#include "global.h" #include "dwds.h" int Verbose, Kill; char szConfig[MAXPATHLEN] = DWDS_CONFIG; extern char compiled[], compiledby[], compilehost[]; static void Usage() { printf( "-= dWDS =- WiFi dynamic WDS service managment for VAP\n" "=== %s === %s@%s ===\n\n" " Syntax: dwds [options] [interface [...]]\n" "\n" "\t-v\t\tVerbose ...\n" "\t-f\t\tForeground, not demonize process ...\n" "\t-c \tConfig file [default=/etc/dwds.conf]\n" "\n", compiled, compiledby, compilehost); } // --------------------------------------------------------------- int main(int argc, char **argv) { char ch, fg = 0; while ((ch = getopt(argc, argv, "hvfc:")) != -1) switch (ch) { case 'v': Verbose++; break; case 'f': fg = 1; break; case 'c': strlcpy(szConfig, optarg, MAXPATHLEN); break; case 'h': default: Usage(); return 1; } argc -= optind; argv += optind; if (!argc) { printf("Error:: not specified interface for use ...\n"); Usage(); return 1; } return 0; }