From 95b41befcb9e75df2b451ceeb9f8812ccedcc25f Mon Sep 17 00:00:00 2001 From: Andreas Gustafsson Date: Tue, 30 May 2000 18:01:19 +0000 Subject: [PATCH] conform to recent dispatch creation changes; still doesn't work --- bin/tests/byaddr_test.c | 34 ++++++++++++++++++++++++++++++---- bin/tests/byname_test.c | 34 ++++++++++++++++++++++++++++++---- 2 files changed, 60 insertions(+), 8 deletions(-) diff --git a/bin/tests/byaddr_test.c b/bin/tests/byaddr_test.c index 71e0a34c6e..297c913cc8 100644 --- a/bin/tests/byaddr_test.c +++ b/bin/tests/byaddr_test.c @@ -52,7 +52,7 @@ done(isc_task_t *task, isc_event_t *event) { REQUIRE(event->ev_type == DNS_EVENT_BYADDRDONE); bevent = (dns_byaddrevent_t *)event; - (void)task; + UNUSED(task); printf("byaddr event result = %s\n", isc_result_totext(bevent->result)); @@ -151,10 +151,36 @@ main(int argc, char *argv[]) { RUNTIME_CHECK(dns_view_create(mctx, dns_rdataclass_in, "default", &view) == ISC_R_SUCCESS); - RUNTIME_CHECK(dns_view_createresolver(view, taskmgr, 10, socketmgr, - timermgr, 0, - dispatchmgr, NULL, NULL) == + { + unsigned int attrs; + isc_sockaddr_t any4, any6; + dns_dispatch_t *disp4 = NULL; + dns_dispatch_t *disp6 = NULL; + + isc_sockaddr_any(&any4); + isc_sockaddr_any6(&any6); + + attrs = DNS_DISPATCHATTR_IPV4 | DNS_DISPATCHATTR_UDP; + RUNTIME_CHECK(dns_dispatch_getudp(dispatchmgr, socketmgr, + taskmgr, &any4, 512, 6, 1024, + 17, 19, attrs, attrs, &disp4) + == ISC_R_SUCCESS); + INSIST(disp4 != NULL); + + attrs = DNS_DISPATCHATTR_IPV6 | DNS_DISPATCHATTR_UDP; + RUNTIME_CHECK(dns_dispatch_getudp(dispatchmgr, socketmgr, + taskmgr, &any6, 512, 6, 1024, + 17, 19, attrs, attrs, &disp6) + == ISC_R_SUCCESS); + INSIST(disp6 != NULL); + + RUNTIME_CHECK(dns_view_createresolver(view, taskmgr, 10, + socketmgr, + timermgr, 0, + dispatchmgr, + disp4, disp6) == ISC_R_SUCCESS); + } { struct in_addr ina; diff --git a/bin/tests/byname_test.c b/bin/tests/byname_test.c index 8be2118696..fcd24a883e 100644 --- a/bin/tests/byname_test.c +++ b/bin/tests/byname_test.c @@ -204,7 +204,7 @@ adb_callback(isc_task_t *etask, isc_event_t *event) { static void run(isc_task_t *task, isc_event_t *event) { - (void)task; + UNUSED(task); do_find(ISC_TRUE); isc_event_free(&event); } @@ -277,10 +277,36 @@ main(int argc, char *argv[]) { RUNTIME_CHECK(dns_view_create(mctx, dns_rdataclass_in, "default", &view) == ISC_R_SUCCESS); - RUNTIME_CHECK(dns_view_createresolver(view, taskmgr, 10, socketmgr, - timermgr, 0, - dispatchmgr, NULL, NULL) == + { + unsigned int attrs; + isc_sockaddr_t any4, any6; + dns_dispatch_t *disp4 = NULL; + dns_dispatch_t *disp6 = NULL; + + isc_sockaddr_any(&any4); + isc_sockaddr_any6(&any6); + + attrs = DNS_DISPATCHATTR_IPV4 | DNS_DISPATCHATTR_UDP; + RUNTIME_CHECK(dns_dispatch_getudp(dispatchmgr, socketmgr, + taskmgr, &any4, 512, 6, 1024, + 17, 19, attrs, attrs, &disp4) + == ISC_R_SUCCESS); + INSIST(disp4 != NULL); + + attrs = DNS_DISPATCHATTR_IPV6 | DNS_DISPATCHATTR_UDP; + RUNTIME_CHECK(dns_dispatch_getudp(dispatchmgr, socketmgr, + taskmgr, &any6, 512, 6, 1024, + 17, 19, attrs, attrs, &disp6) + == ISC_R_SUCCESS); + INSIST(disp6 != NULL); + + RUNTIME_CHECK(dns_view_createresolver(view, taskmgr, 10, + socketmgr, + timermgr, 0, + dispatchmgr, + disp4, disp6) == ISC_R_SUCCESS); + } { struct in_addr ina;