adb_test.c revision 29f28fe573d4b3b318b3b026d567c1eb86738015
/*
* 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>
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 void
{
printf("Task %p got event %p type %08x from %p, arg %p\n",
isc_event_free(&ev);
}
unsigned char namestorage1[512];
unsigned char namestorage2[512];
unsigned char namestorage3[512];
int
{
isc_buffer_t t, namebuf;
(void)argc;
(void)argv;
result = isc_app_start();
/*
* EVERYTHING needs a memory context.
*/
/*
* The task manager is independent (other than memory context)
*/
/*
* Create the address database.
*/
#define NAME1 "kechara.flame.org."
#define NAME2 "moghedien.isc.org."
#define NAME3 "nonexistant.flame.org."
&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, and kill the adb
*/
/*
* look up a name that doesn't exit.
*/
if (result == ISC_R_SUCCESS) {
} else {
}
isc_app_run();
return (0);
}