version 1.1.2.1, 2010/10/27 13:10:40
|
version 1.1.2.3, 2010/10/27 13:50:03
|
Line 2
|
Line 2
|
#include "dwds.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|any> [interface [...]]\n" |
|
"\n" |
|
"\t-v\t\tVerbose ...\n" |
|
"\t-f\t\tForeground, not demonize process ...\n" |
|
"\t-c <config>\tConfig file [default=/etc/dwds.conf]\n" |
|
"\n", compiled, compiledby, compilehost); |
|
} |
|
|
|
// --------------------------------------------------------------- |
|
|
int |
int |
main(int argc, char **argv) |
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; |
return 0; |
} |
} |