adb_test.c revision 0c27b3fe77ac1d5094ba3521e8142d9e7973133f
/*
* Copyright (C) 1999-2001, 2004, 2005, 2007, 2009, 2011-2013, 2015, 2016 Internet Systems Consortium, Inc. ("ISC")
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*/
/* $Id: adb_test.c,v 1.73 2011/08/30 23:46:51 tbox Exp $ */
/*! \file */
#include <config.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#include <dns/dispatch.h>
struct client {
const char *target;
};
static isc_mempool_t *cmp;
static isc_logconfig_t *lcfg;
static isc_taskmgr_t *taskmgr;
static isc_socketmgr_t *socketmgr;
static isc_timermgr_t *timermgr;
static dns_dispatchmgr_t *dispatchmgr;
static dns_view_t *view;
static isc_mutex_t client_lock;
static isc_stdtime_t now;
static void
static void
if (result == ISC_R_SUCCESS)
return;
exit(1);
}
static client_t *
new_client(void) {
return (client);
}
static void
free_client(client_t **c) {
client = *c;
*c = NULL;
}
static inline void
CLOCK(void) {
}
static inline void
CUNLOCK(void) {
}
static void
printf("NAME %s:\n\tTask %p got event %p type %08x from %p, client %p\n\terr4: %s err6: %s\n",
isc_event_free(&ev);
CLOCK();
CUNLOCK();
}
static void
create_managers(void) {
dispatchmgr = NULL;
}
static void
create_view(void) {
/*
* View.
*/
/*
* Cache.
*/
{
unsigned int attrs;
512, 6, 1024, 17, 19,
== ISC_R_SUCCESS);
512, 6, 1024, 17, 19,
== ISC_R_SUCCESS);
timermgr, 0,
}
}
static void
unsigned char namedata[256];
isc_buffer_t t, namebuf;
unsigned int options;
client = new_client();
options = 0;
if (result != ISC_R_SUCCESS)
} else {
printf("NAME %s: err4 %s, err6 %s\n",
}
}
int
result = isc_app_start();
/*
* EVERYTHING needs a memory context.
*/
== ISC_R_SUCCESS);
/*
* Create and install the default channel.
*/
/*
* Set the initial debug level.
*/
create_view();
/*
* Lock the entire client list here. This will cause all events
* for found names to block as well.
*/
CLOCK();
lookup("www.firstcard.com.");
lookup("dns04.flame.org.");
CUNLOCK();
sleep(10);
sleep(10);
CLOCK();
CUNLOCK();
sleep(20);
isc_app_run();
return (0);
}