1999-10-04 20:25:05 +00:00
|
|
|
/*
|
1999-10-31 18:42:01 +00:00
|
|
|
* Copyright (C) 1999 Internet Software Consortium.
|
1999-10-04 20:25:05 +00:00
|
|
|
*
|
|
|
|
* 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.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include <config.h>
|
|
|
|
|
|
|
|
#include <stdio.h>
|
|
|
|
#include <stdlib.h>
|
|
|
|
#include <unistd.h>
|
|
|
|
#include <string.h>
|
|
|
|
|
1999-10-16 00:38:21 +00:00
|
|
|
#include <isc/app.h>
|
1999-10-04 20:25:05 +00:00
|
|
|
#include <isc/assertions.h>
|
|
|
|
#include <isc/buffer.h>
|
|
|
|
#include <isc/error.h>
|
|
|
|
#include <isc/mem.h>
|
|
|
|
#include <isc/task.h>
|
|
|
|
#include <isc/thread.h>
|
1999-10-21 23:09:41 +00:00
|
|
|
#include <isc/timer.h>
|
1999-10-04 20:25:05 +00:00
|
|
|
#include <isc/result.h>
|
|
|
|
#include <isc/sockaddr.h>
|
1999-10-21 23:09:41 +00:00
|
|
|
#include <isc/socket.h>
|
1999-10-04 20:25:05 +00:00
|
|
|
#include <isc/net.h>
|
|
|
|
|
1999-10-22 01:02:38 +00:00
|
|
|
#include <dns/adb.h>
|
1999-12-02 22:38:34 +00:00
|
|
|
#include <dns/cache.h>
|
1999-10-21 23:09:41 +00:00
|
|
|
#include <dns/db.h>
|
|
|
|
#include <dns/master.h>
|
2000-01-20 00:38:49 +00:00
|
|
|
#include <dns/log.h>
|
2000-01-22 02:03:19 +00:00
|
|
|
#include <dns/name.h>
|
|
|
|
#include <dns/rootns.h>
|
1999-10-04 20:25:05 +00:00
|
|
|
|
1999-10-23 04:02:05 +00:00
|
|
|
typedef struct client client_t;
|
|
|
|
struct client {
|
|
|
|
dns_name_t name;
|
|
|
|
ISC_LINK(client_t) link;
|
1999-10-29 18:30:48 +00:00
|
|
|
dns_adbfind_t *find;
|
1999-10-23 04:02:05 +00:00
|
|
|
};
|
|
|
|
|
1999-10-04 20:25:05 +00:00
|
|
|
isc_mem_t *mctx;
|
1999-10-27 22:24:40 +00:00
|
|
|
isc_mempool_t *cmp;
|
|
|
|
isc_log_t *lctx;
|
1999-10-25 22:53:15 +00:00
|
|
|
isc_taskmgr_t *taskmgr;
|
1999-10-21 23:09:41 +00:00
|
|
|
isc_socketmgr_t *socketmgr;
|
|
|
|
isc_timermgr_t *timermgr;
|
1999-10-23 04:02:05 +00:00
|
|
|
isc_task_t *t1, *t2;
|
1999-10-21 23:09:41 +00:00
|
|
|
dns_view_t *view;
|
1999-10-23 04:02:05 +00:00
|
|
|
dns_db_t *rootdb;
|
|
|
|
ISC_LIST(client_t) clients;
|
|
|
|
isc_mutex_t client_lock;
|
|
|
|
isc_stdtime_t now;
|
|
|
|
dns_adb_t *adb;
|
|
|
|
|
|
|
|
static void check_result(isc_result_t, char *, ...);
|
|
|
|
isc_result_t ns_rootns_init(void);
|
|
|
|
void create_managers(void);
|
1999-10-16 00:38:21 +00:00
|
|
|
static void lookup_callback(isc_task_t *, isc_event_t *);
|
1999-10-23 04:02:05 +00:00
|
|
|
void create_view(void);
|
|
|
|
client_t *new_client(void);
|
|
|
|
void free_client(client_t **);
|
|
|
|
static inline void CLOCK(void);
|
|
|
|
static inline void CUNLOCK(void);
|
1999-10-26 00:16:36 +00:00
|
|
|
void lookup(char *);
|
|
|
|
void insert(char *, char *, dns_ttl_t, isc_stdtime_t);
|
1999-10-16 00:38:21 +00:00
|
|
|
|
1999-10-04 20:25:05 +00:00
|
|
|
static void
|
1999-10-23 04:02:05 +00:00
|
|
|
check_result(isc_result_t result, char *format, ...)
|
1999-10-04 20:25:05 +00:00
|
|
|
{
|
|
|
|
va_list args;
|
|
|
|
|
1999-10-23 04:02:05 +00:00
|
|
|
if (result == ISC_R_SUCCESS)
|
|
|
|
return;
|
|
|
|
|
1999-10-04 20:25:05 +00:00
|
|
|
va_start(args, format);
|
|
|
|
vfprintf(stderr, format, args);
|
|
|
|
va_end(args);
|
|
|
|
fprintf(stderr, "\n");
|
|
|
|
exit(1);
|
|
|
|
}
|
|
|
|
|
1999-10-23 04:02:05 +00:00
|
|
|
client_t *
|
|
|
|
new_client(void)
|
|
|
|
{
|
|
|
|
client_t *client;
|
|
|
|
|
1999-10-27 22:24:40 +00:00
|
|
|
client = isc_mempool_get(cmp);
|
1999-10-23 04:02:05 +00:00
|
|
|
INSIST(client != NULL);
|
|
|
|
dns_name_init(&client->name, NULL);
|
|
|
|
ISC_LINK_INIT(client, link);
|
1999-10-29 18:30:48 +00:00
|
|
|
client->find = NULL;
|
1999-10-23 04:02:05 +00:00
|
|
|
|
|
|
|
return (client);
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
free_client(client_t **c)
|
|
|
|
{
|
|
|
|
client_t *client;
|
|
|
|
|
|
|
|
INSIST(c != NULL);
|
|
|
|
client = *c;
|
|
|
|
*c = NULL;
|
|
|
|
INSIST(client != NULL);
|
|
|
|
dns_name_free(&client->name, mctx);
|
|
|
|
INSIST(!ISC_LINK_LINKED(client, link));
|
1999-10-29 18:30:48 +00:00
|
|
|
INSIST(client->find == NULL);
|
1999-10-23 04:02:05 +00:00
|
|
|
|
1999-10-27 22:24:40 +00:00
|
|
|
isc_mempool_put(cmp, client);
|
1999-10-23 04:02:05 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static inline void
|
|
|
|
CLOCK(void)
|
|
|
|
{
|
|
|
|
RUNTIME_CHECK(isc_mutex_lock(&client_lock) == ISC_R_SUCCESS);
|
|
|
|
}
|
|
|
|
|
|
|
|
static inline void
|
|
|
|
CUNLOCK(void)
|
|
|
|
{
|
|
|
|
RUNTIME_CHECK(isc_mutex_unlock(&client_lock) == ISC_R_SUCCESS);
|
|
|
|
}
|
1999-10-21 23:09:41 +00:00
|
|
|
|
1999-10-16 00:38:21 +00:00
|
|
|
static void
|
|
|
|
lookup_callback(isc_task_t *task, isc_event_t *ev)
|
|
|
|
{
|
1999-10-27 22:24:40 +00:00
|
|
|
client_t *client;
|
1999-10-16 00:38:21 +00:00
|
|
|
|
1999-10-27 22:24:40 +00:00
|
|
|
client = ev->arg;
|
1999-10-29 18:30:48 +00:00
|
|
|
INSIST(client->find == ev->sender);
|
1999-10-16 00:38:21 +00:00
|
|
|
|
1999-10-27 22:24:40 +00:00
|
|
|
printf("Task %p got event %p type %08x from %p, client %p\n",
|
1999-10-29 18:30:48 +00:00
|
|
|
task, ev, ev->type, client->find, client);
|
1999-10-29 18:00:31 +00:00
|
|
|
|
|
|
|
isc_event_free(&ev);
|
1999-10-27 22:24:40 +00:00
|
|
|
|
1999-10-23 04:02:05 +00:00
|
|
|
CLOCK();
|
|
|
|
|
1999-10-29 18:30:48 +00:00
|
|
|
dns_adb_dumpfind(client->find, stderr);
|
|
|
|
dns_adb_destroyfind(&client->find);
|
1999-10-27 22:24:40 +00:00
|
|
|
|
|
|
|
ISC_LIST_UNLINK(clients, client, link);
|
|
|
|
free_client(&client);
|
1999-10-23 04:02:05 +00:00
|
|
|
|
|
|
|
CUNLOCK();
|
1999-10-16 00:38:21 +00:00
|
|
|
}
|
|
|
|
|
1999-10-21 23:09:41 +00:00
|
|
|
void
|
|
|
|
create_managers(void)
|
|
|
|
{
|
|
|
|
isc_result_t result;
|
|
|
|
|
1999-10-25 22:53:15 +00:00
|
|
|
taskmgr = NULL;
|
|
|
|
result = isc_taskmgr_create(mctx, 2, 0, &taskmgr);
|
1999-10-21 23:09:41 +00:00
|
|
|
check_result(result, "isc_taskmgr_create");
|
|
|
|
|
|
|
|
timermgr = NULL;
|
|
|
|
result = isc_timermgr_create(mctx, &timermgr);
|
|
|
|
check_result(result, "isc_timermgr_create");
|
|
|
|
|
|
|
|
socketmgr = NULL;
|
|
|
|
result = isc_socketmgr_create(mctx, &socketmgr);
|
|
|
|
check_result(result, "isc_socketmgr_create");
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
create_view(void)
|
|
|
|
{
|
1999-12-02 22:38:34 +00:00
|
|
|
dns_cache_t *cache;
|
1999-10-21 23:09:41 +00:00
|
|
|
isc_result_t result;
|
|
|
|
|
|
|
|
/*
|
|
|
|
* View.
|
|
|
|
*/
|
|
|
|
view = NULL;
|
|
|
|
result = dns_view_create(mctx, dns_rdataclass_in, "_default", &view);
|
|
|
|
check_result(result, "dns_view_create");
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Cache.
|
|
|
|
*/
|
1999-12-02 22:38:34 +00:00
|
|
|
cache = NULL;
|
|
|
|
result = dns_cache_create(mctx, taskmgr, timermgr, dns_rdataclass_in,
|
|
|
|
"rbt", 0, NULL, &cache);
|
|
|
|
check_result(result, "dns_cache_create");
|
|
|
|
dns_view_setcache(view, cache);
|
|
|
|
dns_cache_detach(&cache);
|
1999-10-21 23:09:41 +00:00
|
|
|
|
|
|
|
/*
|
|
|
|
* Resolver.
|
|
|
|
*
|
|
|
|
* XXXRTH hardwired number of tasks. Also, we'll need to
|
|
|
|
* see if we are dealing with a shared dispatcher in this view.
|
|
|
|
*/
|
1999-10-25 22:53:15 +00:00
|
|
|
result = dns_view_createresolver(view, taskmgr, 16, socketmgr,
|
2000-01-26 16:59:05 +00:00
|
|
|
timermgr, 0, NULL, NULL);
|
1999-10-29 01:26:45 +00:00
|
|
|
check_result(result, "dns_view_createresolver()");
|
1999-10-21 23:09:41 +00:00
|
|
|
|
2000-01-22 02:03:19 +00:00
|
|
|
rootdb = NULL;
|
|
|
|
result = dns_rootns_create(mctx, &rootdb);
|
|
|
|
check_result(result, "dns_rootns_create()");
|
1999-10-23 04:02:05 +00:00
|
|
|
dns_view_sethints(view, rootdb);
|
1999-10-28 18:50:59 +00:00
|
|
|
dns_db_detach(&rootdb);
|
1999-10-21 23:09:41 +00:00
|
|
|
|
|
|
|
dns_view_freeze(view);
|
|
|
|
}
|
|
|
|
|
1999-10-21 01:18:06 +00:00
|
|
|
|
1999-10-23 04:02:05 +00:00
|
|
|
void
|
1999-10-26 00:16:36 +00:00
|
|
|
insert(char *target, char *addr, dns_ttl_t ttl, isc_stdtime_t now)
|
1999-10-04 20:25:05 +00:00
|
|
|
{
|
|
|
|
isc_sockaddr_t sockaddr;
|
|
|
|
struct in_addr ina;
|
1999-10-23 04:02:05 +00:00
|
|
|
dns_name_t name;
|
|
|
|
unsigned char namedata[256];
|
|
|
|
isc_buffer_t t, namebuf;
|
1999-10-04 20:25:05 +00:00
|
|
|
isc_result_t result;
|
1999-10-23 04:02:05 +00:00
|
|
|
|
|
|
|
INSIST(target != NULL);
|
|
|
|
|
|
|
|
isc_buffer_init(&t, target, strlen(target), ISC_BUFFERTYPE_TEXT);
|
|
|
|
isc_buffer_add(&t, strlen(target));
|
|
|
|
isc_buffer_init(&namebuf, namedata, sizeof namedata,
|
|
|
|
ISC_BUFFERTYPE_BINARY);
|
|
|
|
dns_name_init(&name, NULL);
|
|
|
|
result = dns_name_fromtext(&name, &t, dns_rootname, ISC_FALSE,
|
|
|
|
&namebuf);
|
|
|
|
check_result(result, "dns_name_fromtext %s", target);
|
|
|
|
|
|
|
|
ina.s_addr = inet_addr(addr);
|
|
|
|
isc_sockaddr_fromin(&sockaddr, &ina, 53);
|
1999-11-25 00:08:41 +00:00
|
|
|
result = _dns_adb_insert(adb, &name, &sockaddr, ttl, now);
|
|
|
|
check_result(result, "_dns_adb_insert %s -> %s", target, addr);
|
1999-10-23 04:02:05 +00:00
|
|
|
printf("Added %s -> %s\n", target, addr);
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
lookup(char *target)
|
|
|
|
{
|
|
|
|
dns_name_t name;
|
|
|
|
unsigned char namedata[256];
|
|
|
|
client_t *client;
|
1999-10-04 20:25:05 +00:00
|
|
|
isc_buffer_t t, namebuf;
|
1999-10-23 04:02:05 +00:00
|
|
|
isc_result_t result;
|
1999-10-29 19:20:36 +00:00
|
|
|
unsigned int options;
|
1999-10-23 04:02:05 +00:00
|
|
|
|
|
|
|
INSIST(target != NULL);
|
|
|
|
|
|
|
|
client = new_client();
|
|
|
|
isc_buffer_init(&t, target, strlen(target), ISC_BUFFERTYPE_TEXT);
|
|
|
|
isc_buffer_add(&t, strlen(target));
|
|
|
|
isc_buffer_init(&namebuf, namedata, sizeof namedata,
|
|
|
|
ISC_BUFFERTYPE_BINARY);
|
|
|
|
dns_name_init(&name, NULL);
|
|
|
|
result = dns_name_fromtext(&name, &t, dns_rootname, ISC_FALSE,
|
|
|
|
&namebuf);
|
|
|
|
check_result(result, "dns_name_fromtext %s", target);
|
|
|
|
|
|
|
|
result = dns_name_dup(&name, mctx, &client->name);
|
|
|
|
check_result(result, "dns_name_dup %s", target);
|
|
|
|
|
1999-11-03 00:43:50 +00:00
|
|
|
options = 0;
|
|
|
|
options |= DNS_ADBFIND_INET;
|
|
|
|
options |= DNS_ADBFIND_INET6;
|
|
|
|
options |= DNS_ADBFIND_WANTEVENT;
|
1999-10-29 18:00:31 +00:00
|
|
|
result = dns_adb_createfind(adb, t2, lookup_callback, client,
|
1999-10-29 19:20:36 +00:00
|
|
|
&client->name, dns_rootname, options,
|
2000-01-21 02:51:29 +00:00
|
|
|
now, NULL, &client->find);
|
1999-10-29 01:26:45 +00:00
|
|
|
check_result(result, "dns_adb_lookup()");
|
1999-10-29 18:30:48 +00:00
|
|
|
dns_adb_dumpfind(client->find, stderr);
|
1999-10-23 04:02:05 +00:00
|
|
|
|
1999-10-29 18:30:48 +00:00
|
|
|
if ((client->find->options & DNS_ADBFIND_WANTEVENT) != 0)
|
1999-10-27 22:24:40 +00:00
|
|
|
ISC_LIST_APPEND(clients, client, link);
|
|
|
|
else {
|
1999-10-29 18:30:48 +00:00
|
|
|
dns_adb_destroyfind(&client->find);
|
1999-10-27 22:24:40 +00:00
|
|
|
free_client(&client);
|
1999-10-23 04:02:05 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
int
|
|
|
|
main(int argc, char **argv)
|
|
|
|
{
|
|
|
|
isc_result_t result;
|
1999-10-29 01:26:45 +00:00
|
|
|
isc_logdestination_t destination;
|
1999-10-04 20:25:05 +00:00
|
|
|
|
1999-10-06 22:12:04 +00:00
|
|
|
(void)argc;
|
|
|
|
(void)argv;
|
|
|
|
|
1999-10-04 20:25:05 +00:00
|
|
|
dns_result_register();
|
1999-10-16 00:38:21 +00:00
|
|
|
result = isc_app_start();
|
|
|
|
check_result(result, "isc_app_start()");
|
1999-10-04 20:25:05 +00:00
|
|
|
|
1999-12-16 23:29:07 +00:00
|
|
|
isc_stdtime_get(&now);
|
1999-10-19 21:28:09 +00:00
|
|
|
|
1999-10-23 04:02:05 +00:00
|
|
|
result = isc_mutex_init(&client_lock);
|
|
|
|
check_result(result, "isc_mutex_init(&client_lock)");
|
|
|
|
ISC_LIST_INIT(clients);
|
|
|
|
|
1999-10-04 20:25:05 +00:00
|
|
|
/*
|
|
|
|
* EVERYTHING needs a memory context.
|
|
|
|
*/
|
|
|
|
mctx = NULL;
|
|
|
|
RUNTIME_CHECK(isc_mem_create(0, 0, &mctx) == ISC_R_SUCCESS);
|
|
|
|
|
1999-10-27 22:24:40 +00:00
|
|
|
cmp = NULL;
|
|
|
|
RUNTIME_CHECK(isc_mempool_create(mctx, sizeof(client_t), &cmp)
|
|
|
|
== ISC_R_SUCCESS);
|
|
|
|
isc_mempool_setname(cmp, "adb test clients");
|
|
|
|
|
|
|
|
result = isc_log_create(mctx, &lctx);
|
|
|
|
check_result(result, "isc_log_create()");
|
|
|
|
|
|
|
|
result = dns_log_init(lctx);
|
|
|
|
check_result(result, "dns_log_init()");
|
|
|
|
|
1999-10-29 01:26:45 +00:00
|
|
|
/*
|
|
|
|
* Create and install the default channel.
|
|
|
|
*/
|
|
|
|
destination.file.stream = stderr;
|
|
|
|
destination.file.name = NULL;
|
|
|
|
destination.file.versions = ISC_LOG_ROLLNEVER;
|
|
|
|
destination.file.maximum_size = 0;
|
|
|
|
result = isc_log_createchannel(lctx, "_default",
|
|
|
|
ISC_LOG_TOFILEDESC,
|
|
|
|
ISC_LOG_DYNAMIC,
|
|
|
|
&destination, ISC_LOG_PRINTTIME);
|
|
|
|
check_result(result, "isc_log_createchannel()");
|
|
|
|
result = isc_log_usechannel(lctx, "_default", NULL, NULL);
|
|
|
|
check_result(result, "isc_log_usechannel()");
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Set the initial debug level.
|
|
|
|
*/
|
|
|
|
isc_log_setdebuglevel(lctx, 99);
|
|
|
|
|
1999-10-21 23:09:41 +00:00
|
|
|
create_managers();
|
1999-10-04 20:25:05 +00:00
|
|
|
|
|
|
|
t1 = NULL;
|
1999-10-25 22:53:15 +00:00
|
|
|
result = isc_task_create(taskmgr, NULL, 0, &t1);
|
1999-10-04 20:25:05 +00:00
|
|
|
check_result(result, "isc_task_create t1");
|
|
|
|
t2 = NULL;
|
1999-10-25 22:53:15 +00:00
|
|
|
result = isc_task_create(taskmgr, NULL, 0, &t2);
|
1999-10-04 20:25:05 +00:00
|
|
|
check_result(result, "isc_task_create t2");
|
|
|
|
|
|
|
|
printf("task 1 = %p\n", t1);
|
|
|
|
printf("task 2 = %p\n", t2);
|
|
|
|
|
1999-10-21 23:09:41 +00:00
|
|
|
create_view();
|
1999-10-21 01:18:06 +00:00
|
|
|
|
1999-10-29 01:26:45 +00:00
|
|
|
adb = view->adb;
|
1999-10-04 20:25:05 +00:00
|
|
|
|
1999-10-21 01:18:06 +00:00
|
|
|
/*
|
1999-10-23 04:02:05 +00:00
|
|
|
* Lock the entire client list here. This will cause all events
|
|
|
|
* for found names to block as well.
|
1999-10-21 01:18:06 +00:00
|
|
|
*/
|
1999-10-23 04:02:05 +00:00
|
|
|
CLOCK();
|
1999-11-03 00:43:50 +00:00
|
|
|
lookup("f.root-servers.net."); /* Should be in hints */
|
|
|
|
lookup("www.iengines.com"); /* should fetch */
|
|
|
|
lookup("www.isc.org"); /* should fetch */
|
|
|
|
lookup("www.flame.org"); /* should fetch */
|
1999-10-27 19:36:58 +00:00
|
|
|
lookup("kechara.flame.org."); /* should fetch */
|
|
|
|
lookup("moghedien.flame.org."); /* should fetch */
|
|
|
|
lookup("mailrelay.flame.org."); /* should fetch */
|
1999-10-29 19:20:36 +00:00
|
|
|
lookup("ipv4v6.flame.org."); /* should fetch */
|
1999-11-04 08:30:55 +00:00
|
|
|
lookup("nonexistant.flame.org."); /* should fail to be found */
|
|
|
|
lookup("foobar.badns.flame.org."); /* should fail utterly (NS) */
|
|
|
|
lookup("i.root-servers.net."); /* Should be in hints */
|
|
|
|
CUNLOCK();
|
|
|
|
|
|
|
|
sleep(5);
|
|
|
|
|
|
|
|
dns_adb_dump(adb, stderr);
|
|
|
|
|
|
|
|
sleep (5);
|
|
|
|
|
|
|
|
CLOCK();
|
|
|
|
lookup("f.root-servers.net."); /* Should be in hints */
|
|
|
|
lookup("www.iengines.com"); /* should fetch */
|
|
|
|
lookup("www.isc.org"); /* should fetch */
|
|
|
|
lookup("www.flame.org"); /* should fetch */
|
|
|
|
lookup("kechara.flame.org."); /* should fetch */
|
|
|
|
lookup("moghedien.flame.org."); /* should fetch */
|
|
|
|
lookup("mailrelay.flame.org."); /* should fetch */
|
|
|
|
lookup("ipv4v6.flame.org."); /* should fetch */
|
|
|
|
lookup("nonexistant.flame.org."); /* should fail to be found */
|
|
|
|
lookup("foobar.badns.flame.org."); /* should fail utterly (NS) */
|
1999-11-01 20:16:35 +00:00
|
|
|
lookup("i.root-servers.net."); /* Should be in hints */
|
1999-10-23 04:02:05 +00:00
|
|
|
CUNLOCK();
|
1999-10-21 01:18:06 +00:00
|
|
|
|
|
|
|
dns_adb_dump(adb, stderr);
|
|
|
|
|
1999-10-16 00:38:21 +00:00
|
|
|
isc_task_detach(&t1);
|
|
|
|
isc_task_detach(&t2);
|
|
|
|
|
1999-10-04 20:25:05 +00:00
|
|
|
isc_mem_stats(mctx, stdout);
|
1999-10-19 01:37:22 +00:00
|
|
|
dns_adb_dump(adb, stderr);
|
1999-10-04 20:25:05 +00:00
|
|
|
|
1999-10-19 01:37:22 +00:00
|
|
|
isc_app_run();
|
|
|
|
|
1999-10-27 22:24:40 +00:00
|
|
|
dns_adb_dump(adb, stderr);
|
1999-10-27 19:36:58 +00:00
|
|
|
|
1999-10-28 20:09:51 +00:00
|
|
|
dns_view_detach(&view);
|
1999-10-29 01:26:45 +00:00
|
|
|
adb = NULL;
|
1999-10-21 23:09:41 +00:00
|
|
|
|
|
|
|
isc_socketmgr_destroy(&socketmgr);
|
|
|
|
isc_timermgr_destroy(&timermgr);
|
1999-10-12 02:06:08 +00:00
|
|
|
|
1999-10-04 20:25:05 +00:00
|
|
|
fprintf(stderr, "Destroying task manager\n");
|
1999-10-25 22:53:15 +00:00
|
|
|
isc_taskmgr_destroy(&taskmgr);
|
1999-10-04 20:25:05 +00:00
|
|
|
|
1999-10-27 22:24:40 +00:00
|
|
|
isc_log_destroy(&lctx);
|
|
|
|
|
|
|
|
isc_mempool_destroy(&cmp);
|
1999-10-04 20:25:05 +00:00
|
|
|
isc_mem_stats(mctx, stdout);
|
|
|
|
isc_mem_destroy(&mctx);
|
|
|
|
|
1999-10-16 00:38:21 +00:00
|
|
|
isc_app_finish();
|
|
|
|
|
1999-10-04 20:25:05 +00:00
|
|
|
return (0);
|
|
|
|
}
|