File:  [ELWIX - Embedded LightWeight unIX -] / embedtools / src / dwds.c
Revision 1.1.2.3: download - view: text, annotated - select for diffs - revision graph
Wed Oct 27 13:50:03 2010 UTC (13 years, 7 months ago) by misho
Branches: tools1_0
*** empty log message ***

#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|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
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;
}

FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>