Annotation of embedtools/src/dwds.c, revision 1.1.2.3
1.1.2.1 misho 1: #include "global.h"
2: #include "dwds.h"
3:
4:
1.1.2.2 misho 5: int Verbose, Kill;
6: char szConfig[MAXPATHLEN] = DWDS_CONFIG;
7: extern char compiled[], compiledby[], compilehost[];
8:
9:
10: static void
11: Usage()
12: {
1.1.2.3 ! misho 13: printf( "-= dWDS =- WiFi dynamic WDS service managment for VAP\n"
1.1.2.2 misho 14: "=== %s === %s@%s ===\n\n"
1.1.2.3 ! misho 15: " Syntax: dwds [options] <interface|any> [interface [...]]\n"
1.1.2.2 misho 16: "\n"
17: "\t-v\t\tVerbose ...\n"
18: "\t-f\t\tForeground, not demonize process ...\n"
19: "\t-c <config>\tConfig file [default=/etc/dwds.conf]\n"
20: "\n", compiled, compiledby, compilehost);
21: }
22:
23: // ---------------------------------------------------------------
24:
1.1.2.1 misho 25: int
26: main(int argc, char **argv)
27: {
1.1.2.2 misho 28: char ch, fg = 0;
29:
1.1.2.3 ! misho 30: while ((ch = getopt(argc, argv, "hvfc:")) != -1)
! 31: switch (ch) {
! 32: case 'v':
! 33: Verbose++;
! 34: break;
! 35: case 'f':
! 36: fg = 1;
! 37: break;
! 38: case 'c':
! 39: strlcpy(szConfig, optarg, MAXPATHLEN);
! 40: break;
! 41: case 'h':
! 42: default:
! 43: Usage();
! 44: return 1;
! 45: }
! 46: argc -= optind;
! 47: argv += optind;
! 48: if (!argc) {
! 49: printf("Error:: not specified interface for use ...\n");
! 50: Usage();
! 51: return 1;
! 52: }
! 53:
1.1.2.1 misho 54: return 0;
55: }
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>