예제 #1
0
/** print usage. */
static void usage()
{
	const char** m;
	const char *evnm="event", *evsys="", *evmethod="";
	printf("usage:  unbound [options]\n");
	printf("	start unbound daemon DNS resolver.\n");
	printf("-h	this help\n");
	printf("-c file	config file to read instead of %s\n", CONFIGFILE);
	printf("	file format is described in unbound.conf(5).\n");
	printf("-d	do not fork into the background.\n");
	printf("-v	verbose (more times to increase verbosity)\n");
#ifdef UB_ON_WINDOWS
	printf("-w opt	windows option: \n");
	printf("   	install, remove - manage the services entry\n");
	printf("   	service - used to start from services control panel\n");
#endif
	printf("Version %s\n", PACKAGE_VERSION);
	get_event_sys(&evnm, &evsys, &evmethod);
	printf("linked libs: %s %s (it uses %s), ldns %s, %s\n", 
		evnm, evsys, evmethod, ldns_version(), 
#ifdef HAVE_SSL
		SSLeay_version(SSLEAY_VERSION)
#elif defined(HAVE_NSS)
		NSS_GetVersion()
#endif
		);
	printf("linked modules:");
	for(m = module_list_avail(); *m; m++)
		printf(" %s", *m);
	printf("\n");
	printf("configured for %s on %s with options:%s\n",
		CONFIGURE_TARGET, CONFIGURE_DATE, CONFIGURE_BUILD_WITH);
	printf("BSD licensed, see LICENSE in source package for details.\n");
	printf("Report bugs to %s\n", PACKAGE_BUGREPORT);
}
예제 #2
0
파일: unbound.c 프로젝트: jedisct1/unbound
/** print usage. */
static void usage(void)
{
	const char** m;
	const char *evnm="event", *evsys="", *evmethod="";
	time_t t;
	struct timeval now;
	struct ub_event_base* base;
	printf("usage:  unbound [options]\n");
	printf("	start unbound daemon DNS resolver.\n");
	printf("-h	this help\n");
	printf("-c file	config file to read instead of %s\n", CONFIGFILE);
	printf("	file format is described in unbound.conf(5).\n");
	printf("-d	do not fork into the background.\n");
	printf("-p	do not create a pidfile.\n");
	printf("-v	verbose (more times to increase verbosity)\n");
#ifdef UB_ON_WINDOWS
	printf("-w opt	windows option: \n");
	printf("   	install, remove - manage the services entry\n");
	printf("   	service - used to start from services control panel\n");
#endif
	printf("Version %s\n", PACKAGE_VERSION);
	base = ub_default_event_base(0,&t,&now);
	ub_get_event_sys(base, &evnm, &evsys, &evmethod);
	printf("linked libs: %s %s (it uses %s), %s\n", 
		evnm, evsys, evmethod,
#ifdef HAVE_SSL
#  ifdef SSLEAY_VERSION
		SSLeay_version(SSLEAY_VERSION)
#  else
		OpenSSL_version(OPENSSL_VERSION)
#  endif
#elif defined(HAVE_NSS)
		NSS_GetVersion()
#elif defined(HAVE_NETTLE)
		"nettle"
#endif
		);
	printf("linked modules:");
	for(m = module_list_avail(); *m; m++)
		printf(" %s", *m);
	printf("\n");
#ifdef USE_DNSCRYPT
	printf("DNSCrypt feature available\n");
#endif
	printf("BSD licensed, see LICENSE in source package for details.\n");
	printf("Report bugs to %s\n", PACKAGE_BUGREPORT);
	ub_event_base_free(base);
}
예제 #3
0
struct 
module_func_block* module_factory(const char** str)
{
        int i = 0;
        const char* s = *str;
	const char** names = module_list_avail();
	fbgetfunctype* fb = module_funcs_avail();
        while(*s && isspace((unsigned char)*s))
                s++;
	while(names[i]) {
                if(strncmp(names[i], s, strlen(names[i])) == 0) {
                        s += strlen(names[i]);
                        *str = s;
                        return (*fb[i])();
                }
		i++;
        }
        return NULL;
}