adb_test.c revision e45d323a2a0f4ca08d4b139546e60a5fa7bd3f0c
/*
* Copyright (C) 1998, 1999 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.
*/
#include <config.h>
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <string.h>
#include <isc/assertions.h>
#include <isc/sockaddr.h>
unsigned char namestorage1[512];
unsigned char namestorage2[512];
unsigned char namestorage3[512];
unsigned char namestorage4[512];
static void fatal(char *, ...);
static inline void check_result(isc_result_t, char *);
static void
{
exit(1);
}
static inline void
{
if (result != ISC_R_SUCCESS)
}
static char root_ns[] =
";\n"
"; Internet Root Nameservers\n"
";\n"
"; Thu Sep 23 17:57:37 PDT 1999\n"
";\n"
"$TTL 518400\n"
". 518400 IN NS F.ROOT-SERVERS.NET.\n"
". 518400 IN NS B.ROOT-SERVERS.NET.\n"
". 518400 IN NS J.ROOT-SERVERS.NET.\n"
". 518400 IN NS K.ROOT-SERVERS.NET.\n"
". 518400 IN NS L.ROOT-SERVERS.NET.\n"
". 518400 IN NS M.ROOT-SERVERS.NET.\n"
". 518400 IN NS I.ROOT-SERVERS.NET.\n"
". 518400 IN NS E.ROOT-SERVERS.NET.\n"
". 518400 IN NS D.ROOT-SERVERS.NET.\n"
". 518400 IN NS A.ROOT-SERVERS.NET.\n"
". 518400 IN NS H.ROOT-SERVERS.NET.\n"
". 518400 IN NS C.ROOT-SERVERS.NET.\n"
". 518400 IN NS G.ROOT-SERVERS.NET.\n"
"F.ROOT-SERVERS.NET. 3600000 IN A 192.5.5.241\n"
"B.ROOT-SERVERS.NET. 3600000 IN A 128.9.0.107\n"
"J.ROOT-SERVERS.NET. 3600000 IN A 198.41.0.10\n"
"K.ROOT-SERVERS.NET. 3600000 IN A 193.0.14.129\n"
"L.ROOT-SERVERS.NET. 3600000 IN A 198.32.64.12\n"
"M.ROOT-SERVERS.NET. 3600000 IN A 202.12.27.33\n"
"I.ROOT-SERVERS.NET. 3600000 IN A 192.36.148.17\n"
"E.ROOT-SERVERS.NET. 3600000 IN A 192.203.230.10\n"
"D.ROOT-SERVERS.NET. 3600000 IN A 128.8.10.90\n"
"A.ROOT-SERVERS.NET. 3600000 IN A 198.41.0.4\n"
"H.ROOT-SERVERS.NET. 3600000 IN A 128.63.2.53\n"
"C.ROOT-SERVERS.NET. 3600000 IN A 192.33.4.12\n"
"G.ROOT-SERVERS.NET. 3600000 IN A 192.112.36.4\n";
ns_rootns_init(void)
{
if (result != ISC_R_SUCCESS)
return (result);
if (result != ISC_R_SUCCESS)
return (result);
ns_g_rootns->mctx);
if (result == ISC_R_SUCCESS)
if (result != ISC_R_SUCCESS)
goto db_detach;
return (DNS_R_SUCCESS);
return (result);
}
void
ns_rootns_destroy(void)
{
}
static void
{
printf("Task %p got event %p type %08x from %p, arg %p\n",
isc_event_free(&ev);
}
void
create_managers(void)
{
}
void
create_view(void)
{
/*
* View.
*/
/*
* Cache.
*/
dns_db_detach(&db);
/*
* Resolver.
*
* XXXRTH hardwired number of tasks. Also, we'll need to
* see if we are dealing with a shared dispatcher in this view.
*/
result = ns_rootns_init();
/*
* We have default hints for class IN.
*/
}
void
destroy_view(void)
{
}
int
{
isc_buffer_t t, namebuf;
(void)argc;
(void)argv;
result = isc_app_start();
/*
* EVERYTHING needs a memory context.
*/
create_view();
/*
* Create the address database.
*/
#define NAME1 "kechara.flame.org."
#define NAME2 "moghedien.isc.org."
#define NAME3 "nonexistant.flame.org."
#define NAME4 "f.root-servers.net."
&namebuf);
&namebuf);
&namebuf);
&namebuf);
/*
* Store this address for this name.
*/
printf("Added 1.2.3.4 -> NAME1\n");
printf("Added 1.2.3.5 -> NAME1\n");
printf("Added 1.2.3.5 -> NAME2\n");
printf("Added 1.2.3.6 -> NAME1\n");
/*
* Try to look up a name or two.
*/
/*
* Mark one entry as lame, then look this name up again.
*/
/*
* And while we're here, add some goodness to it and tweak up
* the srtt value a bit.
*/
/*
* look it up again
*/
/*
* delete one of the names
*/
/*
* look up a name that doesn't exit.
*/
if (result == ISC_R_SUCCESS) {
} else {
}
/*
* Look up a host that will be in the hints database
*/
if (result == ISC_R_SUCCESS) {
} else {
}
}
isc_app_run();
destroy_view();
return (0);
}