byname_test.c revision ee980d3fc4c23b7f87fed96d3ba5e928937c9ed4
/*
* Copyright (C) 2004, 2005, 2007, 2009, 2012 Internet Systems Consortium, Inc. ("ISC")
* Copyright (C) 2000, 2001 Internet Software Consortium.
*
* purpose with or without fee is hereby granted, provided that the above
* copyright notice and this permission notice appear in all copies.
*
* THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
* REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
* AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
* INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
* LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
* OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
* PERFORMANCE OF THIS SOFTWARE.
*/
/* $Id: byname_test.c,v 1.33 2009/09/02 23:48:01 tbox Exp $ */
/*! \file
* \author
* Principal Author: Bob Halley
*/
#include <config.h>
#include <stdlib.h>
#include <string.h>
#include <isc/commandline.h>
#include <dns/dispatch.h>
#include <dns/resolver.h>
static isc_taskmgr_t *taskmgr;
static dns_fixedname_t name;
static dns_fixedname_t target;
static isc_logconfig_t *lcfg;
static unsigned int level = 0;
static void
log_init(void) {
unsigned int flags;
/*
* Setup a logging context.
*/
/*
* Create and install the default channel.
*/
&destination, flags) ==
}
static void
char text[ISC_NETADDR_FORMATSIZE];
}
}
static void
char text[DNS_NAME_FORMATSIZE];
}
static void
unsigned int options;
if (want_event)
dns_rootname, 0, options, 0,
dns_fixedname_name(&target), 0,
&find);
if (result == ISC_R_SUCCESS) {
/*
* We have at least some of the addresses for the
* name.
*/
} else {
/*
* We don't know any of the addresses for this
* name.
*/
/*
* And ADB isn't going to send us any events
* either. This query loses.
*/
}
/*
* If the DNS_ADBFIND_WANTEVENT flag was set, we'll
* get an event when something happens.
*/
}
} else if (result == DNS_R_ALIAS) {
} else {
printf("dns_adb_createfind() returned %s\n",
}
if (done) {
}
}
static void
if (type == DNS_EVENT_ADBMOREADDRESSES)
else if (type == DNS_EVENT_ADBNOMOREADDRESSES) {
printf("no more addresses\n");
} else {
}
}
static void
}
int
unsigned int workers = 2;
int ch;
isc_buffer_t b;
== ISC_R_SUCCESS);
switch (ch) {
case 'd':
break;
case 'v':
break;
case 'w':
break;
}
}
log_init();
if (verbose) {
}
dispatchmgr = NULL;
== ISC_R_SUCCESS);
&cache) == ISC_R_SUCCESS);
&view) == ISC_R_SUCCESS);
{
unsigned int attrs;
if (isc_net_probeipv4() == ISC_R_SUCCESS) {
512, 6, 1024,
== ISC_R_SUCCESS);
}
if (isc_net_probeipv6() == ISC_R_SUCCESS) {
512, 6, 1024,
== ISC_R_SUCCESS);
}
timermgr, 0,
}
{
== ISC_R_SUCCESS);
}
dns_rootname, 0, NULL) ==
(void)isc_app_run();
if (verbose)
return (0);
}