byname_test.c revision 499b34cea04a46823d003d4c0520c8b03e8513cb
/*
* Copyright (C) 2000, 2001 Internet Software Consortium.
*
* Permission to use, copy, modify, and distribute this software for any
* 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 INTERNET SOFTWARE CONSORTIUM
* DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL
* INTERNET SOFTWARE CONSORTIUM 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.25 2001/01/09 21:40:55 bwelling Exp $ */
/*
* 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, 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;
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);
}
(void)isc_app_run();
if (verbose)
return (0);
}