adb_test.c revision 1a69a1a78cfaa86f3b68bbc965232b7876d4da2a
28d9fd53819cc163629c867466b20d8ebcae8842David Lawrence * Copyright (C) 1999, 2000 Internet Software Consortium.
5d51e67c3b4f35c1be742574aacc1d88fe6ed444Mark Andrews * Permission to use, copy, modify, and distribute this software for any
5d51e67c3b4f35c1be742574aacc1d88fe6ed444Mark Andrews * purpose with or without fee is hereby granted, provided that the above
5d51e67c3b4f35c1be742574aacc1d88fe6ed444Mark Andrews * copyright notice and this permission notice appear in all copies.
15a44745412679c30a6d022733925af70a38b715David Lawrence * THE SOFTWARE IS PROVIDED "AS IS" AND INTERNET SOFTWARE CONSORTIUM DISCLAIMS
15a44745412679c30a6d022733925af70a38b715David Lawrence * ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES
15a44745412679c30a6d022733925af70a38b715David Lawrence * OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL INTERNET SOFTWARE
15a44745412679c30a6d022733925af70a38b715David Lawrence * CONSORTIUM BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
15a44745412679c30a6d022733925af70a38b715David Lawrence * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
15a44745412679c30a6d022733925af70a38b715David Lawrence * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
15a44745412679c30a6d022733925af70a38b715David Lawrence * ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
5d51e67c3b4f35c1be742574aacc1d88fe6ed444Mark Andrewscheck_result(isc_result_t result, char *format, ...) {
5d51e67c3b4f35c1be742574aacc1d88fe6ed444Mark Andrewsstatic inline void
5d51e67c3b4f35c1be742574aacc1d88fe6ed444Mark Andrews RUNTIME_CHECK(isc_mutex_lock(&client_lock) == ISC_R_SUCCESS);
5d51e67c3b4f35c1be742574aacc1d88fe6ed444Mark Andrewsstatic inline void
5d51e67c3b4f35c1be742574aacc1d88fe6ed444Mark Andrews RUNTIME_CHECK(isc_mutex_unlock(&client_lock) == ISC_R_SUCCESS);
5d51e67c3b4f35c1be742574aacc1d88fe6ed444Mark Andrewslookup_callback(isc_task_t *task, isc_event_t *ev) {
5d51e67c3b4f35c1be742574aacc1d88fe6ed444Mark Andrews printf("Task %p got event %p type %08x from %p, client %p\n",
5d51e67c3b4f35c1be742574aacc1d88fe6ed444Mark Andrews result = isc_taskmgr_create(mctx, 2, 0, &taskmgr);
3ddd814a97de1d152ba0913c592d6e6dc83d38a6Michael Graff result = isc_socketmgr_create(mctx, &socketmgr);
6d12fdf96621801e80f3f4c2a8a569fe48766a20David Lawrence check_result(result, "isc_socketmgr_create");
5d51e67c3b4f35c1be742574aacc1d88fe6ed444Mark Andrews result = dns_view_create(mctx, dns_rdataclass_in, "_default", &view);
9281e7aa775026dc47c01745fdcc438645146877Mark Andrews result = dns_cache_create(mctx, taskmgr, timermgr, dns_rdataclass_in,
9281e7aa775026dc47c01745fdcc438645146877Mark Andrews * XXXRTH hardwired number of tasks. Also, we'll need to
9281e7aa775026dc47c01745fdcc438645146877Mark Andrews * see if we are dealing with a shared dispatcher in this view.
9281e7aa775026dc47c01745fdcc438645146877Mark Andrews result = dns_view_createresolver(view, taskmgr, 16, socketmgr,
9281e7aa775026dc47c01745fdcc438645146877Mark Andrews check_result(result, "dns_view_createresolver()");
5d51e67c3b4f35c1be742574aacc1d88fe6ed444Mark Andrews result = dns_rootns_create(mctx, dns_rdataclass_in, NULL, &rootdb);
d981ca645597116d227a48bf37cc5edc061c854dBob Halley unsigned int options;
d981ca645597116d227a48bf37cc5edc061c854dBob Halley isc_buffer_init(&namebuf, namedata, sizeof(namedata));
f1b0e9107d5fc7669920b76b4e32f93e9d16c85cBob Halley result = dns_name_fromtext(&name, &t, dns_rootname, ISC_FALSE,
f1b0e9107d5fc7669920b76b4e32f93e9d16c85cBob Halley check_result(result, "dns_name_fromtext %s", target);
f1b0e9107d5fc7669920b76b4e32f93e9d16c85cBob Halley result = dns_name_dup(&name, mctx, &client->name);
e27a69f8bd9538e08f775265167ba6cc5f47c587Bob Halley result = dns_adb_createfind(adb, t2, lookup_callback, client,
e27a69f8bd9538e08f775265167ba6cc5f47c587Bob Halley if ((client->find->options & DNS_ADBFIND_WANTEVENT) != 0)
== ISC_R_SUCCESS);
create_view();
CLOCK();
CUNLOCK();
CLOCK();
CUNLOCK();
isc_app_run();