]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
remove dns_client_update() and related code
authorEvan Hunt <each@isc.org>
Tue, 23 Mar 2021 01:04:23 +0000 (18:04 -0700)
committerOndřej Surý <ondrej@sury.org>
Mon, 19 Apr 2021 11:25:48 +0000 (13:25 +0200)
the libdns client API is no longer being maintained for
external use, we can remove the code that isn't being used
internally, as well as the related tests.

(cherry picked from commit fb2a352e7cca850783fdaaf51b465d1c6197fe75)

19 files changed:
bin/tests/system/conf.sh.common
bin/tests/system/conf.sh.in
bin/tests/system/conf.sh.win32
bin/tests/system/nsupdate/tests.sh
lib/dns/client.c
lib/dns/include/dns/client.h
lib/dns/win32/libdns.def.in
lib/samples/.gitignore
lib/samples/sample-request.c [deleted file]
lib/samples/sample-update.c [deleted file]
lib/samples/win32/request.vcxproj.filters.in [deleted file]
lib/samples/win32/request.vcxproj.in [deleted file]
lib/samples/win32/request.vcxproj.user [deleted file]
lib/samples/win32/update.vcxproj.filters.in [deleted file]
lib/samples/win32/update.vcxproj.in [deleted file]
lib/samples/win32/update.vcxproj.user [deleted file]
util/copyrights
win32utils/Configure
win32utils/bind9.sln.in

index 405e3abb13dc364d3ce72fcc35a07a1c95625ae1..154c08d438e7ecc758065db07d16c1240fc33c82 100644 (file)
@@ -737,7 +737,6 @@ export PYTHON
 export RESOLVE
 export RNDC
 export RRCHECKER
-export SAMPLEUPDATE
 export SIGNER
 export SUBDIRS
 export TMPDIR
index 4e87585eefe8440b0b50cbf7033edbd9c801c5c1..b1f7c115acc05fddc754e59e31919181d6972c4f 100644 (file)
@@ -72,7 +72,6 @@ KEYCREATE=$TOP/bin/tests/system/tkey/keycreate
 KEYDELETE=$TOP/bin/tests/system/tkey/keydelete
 MAKEJOURNAL=$TOP/bin/tests/makejournal
 PIPEQUERIES=$TOP/bin/tests/system/pipelined/pipequeries
-SAMPLEUPDATE=$TOP/lib/samples/sample-update
 
 # we don't want a KRB5_CONFIG setting breaking the tests
 KRB5_CONFIG=/dev/null
index 3fee9fc74ca89f7efe8524e2b74732661c1d2bf8..31a0e5a66735dc7f71612146c994cc4598cb1868 100644 (file)
@@ -63,7 +63,6 @@ REVOKE=$TOP/Build/$VSCONF/dnssec-revoke@EXEEXT@
 RNDC=$TOP/Build/$VSCONF/rndc@EXEEXT@
 RNDCCONFGEN=$TOP/Build/$VSCONF/rndc-confgen@EXEEXT@
 RRCHECKER=$TOP/Build/$VSCONF/named-rrchecker@EXEEXT@
-SAMPLEUPDATE=$TOP/Build/$VSCONF/update@EXEEXT@
 SETTIME=$TOP/Build/$VSCONF/dnssec-settime@EXEEXT@
 SIGNER=$TOP/Build/$VSCONF/dnssec-signzone@EXEEXT@
 TSIGKEYGEN=$TOP/Build/$VSCONF/tsig-keygen@EXEEXT@
@@ -78,7 +77,6 @@ KEYCREATE=$TOP/Build/$VSCONF/keycreate@EXEEXT@
 KEYDELETE=$TOP/Build/$VSCONF/keydelete@EXEEXT@
 MAKEJOURNAL=$TOP/Build/$VSCONF/makejournal@EXEEXT@
 PIPEQUERIES=$TOP/Build/$VSCONF/pipequeries@EXEEXT@
-# to port SAMPLEUPDATE=$TOP/lib/samples/sample-update
 
 # we don't want a KRB5_CONFIG setting breaking the tests
 KRB5_CONFIG=NUL
index d1d72e4459cd066d4aeb51fbff4e2fd81036321a..463f11f69e1879c376f6d8017dda11fe0da52a9a 100755 (executable)
@@ -1370,88 +1370,6 @@ EOF
   [ $ret = 0 ] || { echo_i "failed"; status=1; }
 
 fi
-#
-#  Add client library tests here
-#
-
-if test unset != "${SAMPLEUPDATE:-unset}" -a -x "${SAMPLEUPDATE}"
-then
-
-    n=`expr $n + 1`
-    ret=0
-    echo_i "check that dns_client_update handles prerequisite NXDOMAIN failure ($n)"
-    $SAMPLEUPDATE -P ${PORT} -a 10.53.0.1 -a 10.53.0.2 -p "nxdomain exists.sample" \
-       add "nxdomain-exists.sample 0 in a 1.2.3.4" > update.out.test$n 2>&1
-    $SAMPLEUPDATE -P ${PORT} -a 10.53.0.2 -p "nxdomain exists.sample" \
-       add "check-nxdomain-exists.sample 0 in a 1.2.3.4" > update.out.check$n 2>&1
-    $DIG $DIGOPTS +tcp @10.53.0.1 a nxdomain-exists.sample > dig.out.ns1.test$n
-    $DIG $DIGOPTS +tcp @10.53.0.2 a nxdomain-exists.sample > dig.out.ns2.test$n
-    $DIG $DIGOPTS +tcp @10.53.0.2 a check-nxdomain-exists.sample > check.out.ns2.test$n
-    grep "update failed: YXDOMAIN" update.out.test$n > /dev/null || ret=1
-    grep "update succeeded" update.out.check$n > /dev/null || ret=1
-    grep "status: NXDOMAIN" dig.out.ns1.test$n > /dev/null || ret=1
-    grep "status: NXDOMAIN" dig.out.ns2.test$n > /dev/null || ret=1
-    grep "status: NOERROR" check.out.ns2.test$n > /dev/null || ret=1
-    [ $ret = 0 ] || { echo_i "failed"; status=1; }
-
-    n=`expr $n + 1`
-    ret=0
-    echo_i "check that dns_client_update handles prerequisite YXDOMAIN failure ($n)"
-    $SAMPLEUPDATE -P ${PORT} -a 10.53.0.1 -a 10.53.0.2 -p "yxdomain nxdomain.sample" \
-       add "yxdomain-nxdomain.sample 0 in a 1.2.3.4" > update.out.test$n 2>&1
-    $SAMPLEUPDATE -P ${PORT} -a 10.53.0.2 -p "yxdomain nxdomain.sample" \
-       add "check-yxdomain-nxdomain.sample 0 in a 1.2.3.4" > update.out.check$n 2>&1
-    $DIG $DIGOPTS +tcp @10.53.0.1 a nxdomain-exists.sample > dig.out.ns1.test$n
-    $DIG $DIGOPTS +tcp @10.53.0.2 a nxdomain-exists.sample > dig.out.ns2.test$n
-    $DIG $DIGOPTS +tcp @10.53.0.2 a check-nxdomain-exists.sample > check.out.ns2.test$n
-    grep "update failed: NXDOMAIN" update.out.test$n > /dev/null || ret=1
-    grep "update succeeded" update.out.check$n > /dev/null || ret=1
-    grep "status: NXDOMAIN" dig.out.ns1.test$n > /dev/null || ret=1
-    grep "status: NXDOMAIN" dig.out.ns2.test$n > /dev/null || ret=1
-    grep "status: NOERROR" check.out.ns2.test$n > /dev/null || ret=1
-    [ $ret = 0 ] || { echo_i "failed"; status=1; }
-
-    n=`expr $n + 1`
-    ret=0
-    echo_i "check that dns_client_update handles prerequisite NXRRSET failure ($n)"
-    $SAMPLEUPDATE -P ${PORT} -a 10.53.0.1 -a 10.53.0.2 -p "nxrrset exists.sample TXT This RRset exists." \
-       add "nxrrset-exists.sample 0 in a 1.2.3.4" > update.out.test$n 2>&1
-    $SAMPLEUPDATE -P ${PORT} -a 10.53.0.2 -p "nxrrset exists.sample TXT This RRset exists." \
-       add "check-nxrrset-exists.sample 0 in a 1.2.3.4" > update.out.check$n 2>&1
-    $DIG $DIGOPTS +tcp @10.53.0.1 a nxrrset-exists.sample > dig.out.ns1.test$n
-    $DIG $DIGOPTS +tcp @10.53.0.2 a nxrrset-exists.sample > dig.out.ns2.test$n
-    $DIG $DIGOPTS +tcp @10.53.0.2 a check-nxrrset-exists.sample > check.out.ns2.test$n
-    grep "update failed: YXRRSET" update.out.test$n > /dev/null || ret=1
-    grep "update succeeded" update.out.check$n > /dev/null || ret=1
-    grep "status: NXDOMAIN" dig.out.ns1.test$n > /dev/null || ret=1
-    grep "status: NXDOMAIN" dig.out.ns2.test$n > /dev/null || ret=1
-    grep "status: NOERROR" check.out.ns2.test$n > /dev/null || ret=1
-    [ $ret = 0 ] || { echo_i "failed"; status=1; }
-
-    n=`expr $n + 1`
-    ret=0
-    echo_i "check that dns_client_update handles prerequisite YXRRSET failure ($n)"
-    $SAMPLEUPDATE -s -P ${PORT} -a 10.53.0.1 -a 10.53.0.2 \
-       -p "yxrrset no-txt.sample TXT" \
-       add "yxrrset-nxrrset.sample 0 in a 1.2.3.4" > update.out.test$n 2>&1
-    $SAMPLEUPDATE -P ${PORT} -a 10.53.0.2 -p "yxrrset no-txt.sample TXT" \
-       add "check-yxrrset-nxrrset.sample 0 in a 1.2.3.4" > update.out.check$n 2>&1
-    $DIG $DIGOPTS +tcp @10.53.0.1 a yxrrset-nxrrset.sample > dig.out.ns1.test$n
-    $DIG $DIGOPTS +tcp @10.53.0.2 a yxrrset-nxrrset.sample > dig.out.ns2.test$n
-    $DIG $DIGOPTS +tcp @10.53.0.2 a check-yxrrset-nxrrset.sample > check.out.ns2.test$n
-    grep "update failed: NXRRSET" update.out.test$n > /dev/null || ret=1
-    grep "update succeeded" update.out.check$n > /dev/null || ret=1
-    grep "status: NXDOMAIN" dig.out.ns1.test$n > /dev/null || ret=1
-    grep "status: NXDOMAIN" dig.out.ns2.test$n > /dev/null || ret=1
-    grep "status: NOERROR" check.out.ns2.test$n > /dev/null || ret=1
-    grep "2nd update failed: NXRRSET" update.out.test$n > /dev/null || ret=1
-    [ $ret = 0 ] || { echo_i "failed"; status=1; }
-
-fi
-
-#
-# End client library tests here
-#
 
 echo_i "exit status: $status"
 [ $status -eq 0 ] || exit 1
index b16bb76a67cda79d50809f977b30e48d6b2ca67d..01c4bbe93f6b200a37d70473c74a654486b33311 100644 (file)
@@ -95,9 +95,6 @@ struct dns_client {
        dns_dispatch_t *dispatchv4;
        dns_dispatch_t *dispatchv6;
 
-       unsigned int update_timeout;
-       unsigned int update_udptimeout;
-       unsigned int update_udpretries;
        unsigned int find_timeout;
        unsigned int find_udpretries;
 
@@ -107,17 +104,8 @@ struct dns_client {
        dns_viewlist_t viewlist;
        ISC_LIST(struct resctx) resctxs;
        ISC_LIST(struct reqctx) reqctxs;
-       ISC_LIST(struct updatectx) updatectxs;
 };
 
-/*%
- * Timeout/retry constants for dynamic update borrowed from nsupdate
- */
-#define DEF_UPDATE_TIMEOUT    300
-#define MIN_UPDATE_TIMEOUT    30
-#define DEF_UPDATE_UDPTIMEOUT 3
-#define DEF_UPDATE_UDPRETRIES 3
-
 #define DEF_FIND_TIMEOUT    5
 #define DEF_FIND_UDPRETRIES 3
 
@@ -202,65 +190,8 @@ typedef struct reqarg {
        bool canceled;
 } reqarg_t;
 
-/*%
- * Argument of an internal event for synchronous name resolution.
- */
-typedef struct updatearg {
-       /* Unlocked */
-       isc_appctx_t *actx;
-       dns_client_t *client;
-       isc_mutex_t lock;
-
-       /* Locked */
-       isc_result_t result;
-       dns_clientupdatetrans_t *trans;
-       bool canceled;
-} updatearg_t;
-
-/*%
- * Internal state for a single dynamic update procedure
- */
-typedef struct updatectx {
-       /* Unlocked */
-       unsigned int magic;
-       isc_mutex_t lock;
-       dns_client_t *client;
-       bool want_tcp;
-
-       /* Locked */
-       dns_request_t *updatereq;
-       dns_request_t *soareq;
-       dns_clientrestrans_t *restrans;
-       dns_clientrestrans_t *restrans2;
-       bool canceled;
-
-       /* Task Locked */
-       ISC_LINK(struct updatectx) link;
-       dns_clientupdatestate_t state;
-       dns_rdataclass_t rdclass;
-       dns_view_t *view;
-       dns_message_t *updatemsg;
-       dns_message_t *soaquery;
-       dns_clientupdateevent_t *event;
-       dns_tsigkey_t *tsigkey;
-       dst_key_t *sig0key;
-       dns_name_t *firstname;
-       dns_name_t soaqname;
-       dns_fixedname_t zonefname;
-       dns_name_t *zonename;
-       isc_sockaddrlist_t servers;
-       unsigned int nservers;
-       isc_sockaddr_t *currentserver;
-       struct updatectx *bp4;
-       struct updatectx *bp6;
-} updatectx_t;
-
-static isc_result_t
-request_soa(updatectx_t *uctx);
 static void
 client_resfind(resctx_t *rctx, dns_fetchevent_t *event);
-static isc_result_t
-send_update(updatectx_t *uctx);
 
 /*
  * Try honoring the operating system's preferred ephemeral port range.
@@ -408,84 +339,6 @@ createview(isc_mem_t *mctx, dns_rdataclass_t rdclass, unsigned int options,
        return (ISC_R_SUCCESS);
 }
 
-isc_result_t
-dns_client_create(dns_client_t **clientp, unsigned int options) {
-       isc_result_t result;
-       isc_mem_t *mctx = NULL;
-       isc_appctx_t *actx = NULL;
-       isc_taskmgr_t *taskmgr = NULL;
-       isc_socketmgr_t *socketmgr = NULL;
-       isc_timermgr_t *timermgr = NULL;
-#if 0
-       /* XXXMPA add debug logging support */
-       isc_log_t *lctx = NULL;
-       isc_logconfig_t *logconfig = NULL;
-       unsigned int logdebuglevel = 0;
-#endif /* if 0 */
-
-       isc_mem_create(&mctx);
-       result = isc_appctx_create(mctx, &actx);
-       if (result != ISC_R_SUCCESS) {
-               goto cleanup;
-       }
-       result = isc_app_ctxstart(actx);
-       if (result != ISC_R_SUCCESS) {
-               goto cleanup;
-       }
-       result = isc_taskmgr_createinctx(mctx, 1, 0, &taskmgr);
-       if (result != ISC_R_SUCCESS) {
-               goto cleanup;
-       }
-       result = isc_socketmgr_createinctx(mctx, &socketmgr);
-       if (result != ISC_R_SUCCESS) {
-               goto cleanup;
-       }
-       result = isc_timermgr_createinctx(mctx, &timermgr);
-       if (result != ISC_R_SUCCESS) {
-               goto cleanup;
-       }
-#if 0
-       isc_log_create(mctx, &lctx, &logconfig);
-       isc_log_setcontext(lctx);
-       dns_log_init(lctx);
-       dns_log_setcontext(lctx);
-       result = isc_log_usechannel(logconfig, "default_debug", NULL, NULL);
-       if (result != ISC_R_SUCCESS) {
-               goto cleanup;
-       }
-       isc_log_setdebuglevel(lctx, logdebuglevel);
-#endif /* if 0 */
-       result = dns_client_createx(mctx, actx, taskmgr, socketmgr, timermgr,
-                                   options, clientp, NULL, NULL);
-       if (result != ISC_R_SUCCESS) {
-               goto cleanup;
-       }
-
-       (*clientp)->attributes |= DNS_CLIENTATTR_OWNCTX;
-
-       /* client has its own reference to mctx, so we can detach it here */
-       isc_mem_detach(&mctx);
-
-       return (ISC_R_SUCCESS);
-
-cleanup:
-       if (taskmgr != NULL) {
-               isc_taskmgr_destroy(&taskmgr);
-       }
-       if (timermgr != NULL) {
-               isc_timermgr_destroy(&timermgr);
-       }
-       if (socketmgr != NULL) {
-               isc_socketmgr_destroy(&socketmgr);
-       }
-       if (actx != NULL) {
-               isc_appctx_destroy(&actx);
-       }
-       isc_mem_detach(&mctx);
-
-       return (result);
-}
-
 isc_result_t
 dns_client_createx(isc_mem_t *mctx, isc_appctx_t *actx, isc_taskmgr_t *taskmgr,
                   isc_socketmgr_t *socketmgr, isc_timermgr_t *timermgr,
@@ -572,14 +425,10 @@ dns_client_createx(isc_mem_t *mctx, isc_appctx_t *actx, isc_taskmgr_t *taskmgr,
 
        ISC_LIST_INIT(client->resctxs);
        ISC_LIST_INIT(client->reqctxs);
-       ISC_LIST_INIT(client->updatectxs);
 
        client->mctx = NULL;
        isc_mem_attach(mctx, &client->mctx);
 
-       client->update_timeout = DEF_UPDATE_TIMEOUT;
-       client->update_udptimeout = DEF_UPDATE_UDPTIMEOUT;
-       client->update_udpretries = DEF_UPDATE_UDPRETRIES;
        client->find_timeout = DEF_FIND_TIMEOUT;
        client->find_udpretries = DEF_FIND_UDPRETRIES;
        client->attributes = 0;
@@ -1863,1335 +1712,3 @@ dns_client_destroyreqtrans(dns_clientreqtrans_t **transp) {
 
        dns_client_destroy(&client);
 }
-
-/*%
- * Dynamic update routines
- */
-static isc_result_t
-rcode2result(dns_rcode_t rcode) {
-       /* XXX: isn't there a similar function? */
-       switch (rcode) {
-       case dns_rcode_formerr:
-               return (DNS_R_FORMERR);
-       case dns_rcode_servfail:
-               return (DNS_R_SERVFAIL);
-       case dns_rcode_nxdomain:
-               return (DNS_R_NXDOMAIN);
-       case dns_rcode_notimp:
-               return (DNS_R_NOTIMP);
-       case dns_rcode_refused:
-               return (DNS_R_REFUSED);
-       case dns_rcode_yxdomain:
-               return (DNS_R_YXDOMAIN);
-       case dns_rcode_yxrrset:
-               return (DNS_R_YXRRSET);
-       case dns_rcode_nxrrset:
-               return (DNS_R_NXRRSET);
-       case dns_rcode_notauth:
-               return (DNS_R_NOTAUTH);
-       case dns_rcode_notzone:
-               return (DNS_R_NOTZONE);
-       case dns_rcode_badvers:
-               return (DNS_R_BADVERS);
-       }
-
-       return (ISC_R_FAILURE);
-}
-
-static void
-update_sendevent(updatectx_t *uctx, isc_result_t result) {
-       isc_task_t *task;
-
-       dns_message_detach(&uctx->updatemsg);
-       if (uctx->tsigkey != NULL) {
-               dns_tsigkey_detach(&uctx->tsigkey);
-       }
-       if (uctx->sig0key != NULL) {
-               dst_key_free(&uctx->sig0key);
-       }
-
-       if (uctx->canceled) {
-               uctx->event->result = ISC_R_CANCELED;
-       } else {
-               uctx->event->result = result;
-       }
-       uctx->event->state = uctx->state;
-       task = uctx->event->ev_sender;
-       uctx->event->ev_sender = uctx;
-       isc_task_sendanddetach(&task, ISC_EVENT_PTR(&uctx->event));
-}
-
-static void
-update_done(isc_task_t *task, isc_event_t *event) {
-       isc_result_t result;
-       dns_requestevent_t *reqev = NULL;
-       dns_request_t *request;
-       dns_message_t *answer = NULL;
-       updatectx_t *uctx = event->ev_arg;
-       dns_client_t *client;
-       unsigned int timeout, reqoptions;
-
-       UNUSED(task);
-
-       REQUIRE(event->ev_type == DNS_EVENT_REQUESTDONE);
-       reqev = (dns_requestevent_t *)event;
-       request = reqev->request;
-       REQUIRE(UCTX_VALID(uctx));
-       client = uctx->client;
-       REQUIRE(DNS_CLIENT_VALID(client));
-
-       result = reqev->result;
-       if (result != ISC_R_SUCCESS) {
-               goto out;
-       }
-
-       dns_message_create(client->mctx, DNS_MESSAGE_INTENTPARSE, &answer);
-       uctx->state = dns_clientupdatestate_done;
-       result = dns_request_getresponse(request, answer,
-                                        DNS_MESSAGEPARSE_PRESERVEORDER);
-       if (result == ISC_R_SUCCESS && answer->rcode != dns_rcode_noerror) {
-               result = rcode2result(answer->rcode);
-       }
-
-out:
-       if (answer != NULL) {
-               dns_message_detach(&answer);
-       }
-       isc_event_free(&event);
-
-       LOCK(&uctx->lock);
-       uctx->currentserver = ISC_LIST_NEXT(uctx->currentserver, link);
-       dns_request_destroy(&uctx->updatereq);
-       /*
-        * Moving on to the next server shouldn't change the result
-        * for NXDOMAIN, YXDOMAIN, NXRRSET and YXRRSET as they
-        * indicate a prerequisite failure.  REFUSED should also
-        * be consistent across all servers but often isn't as that
-        * is policy rather that zone content driven (slaves that
-        * aren't willing to forward should return NOTIMPL).  NOTZONE
-        * indicates that we stuffed up the request construction so
-        * don't retry.
-        */
-       if (result != ISC_R_SUCCESS && result != DNS_R_NXDOMAIN &&
-           result != DNS_R_YXDOMAIN && result != DNS_R_YXRRSET &&
-           result != DNS_R_NXRRSET && result != DNS_R_NOTZONE &&
-           !uctx->canceled && uctx->currentserver != NULL)
-       {
-               dns_message_renderreset(uctx->updatemsg);
-               dns_message_settsigkey(uctx->updatemsg, NULL);
-
-               timeout = client->update_timeout / uctx->nservers;
-               if (timeout < MIN_UPDATE_TIMEOUT) {
-                       timeout = MIN_UPDATE_TIMEOUT;
-               }
-               reqoptions = 0;
-               if (uctx->want_tcp) {
-                       reqoptions |= DNS_REQUESTOPT_TCP;
-               }
-               result = dns_request_createvia(
-                       uctx->view->requestmgr, uctx->updatemsg, NULL,
-                       uctx->currentserver, -1, reqoptions, uctx->tsigkey,
-                       timeout, client->update_udptimeout,
-                       client->update_udpretries, client->task, update_done,
-                       uctx, &uctx->updatereq);
-               UNLOCK(&uctx->lock);
-
-               if (result == ISC_R_SUCCESS) {
-                       /* XXX: should we keep the 'done' state here? */
-                       uctx->state = dns_clientupdatestate_sent;
-                       return;
-               }
-       } else {
-               UNLOCK(&uctx->lock);
-       }
-
-       update_sendevent(uctx, result);
-}
-
-static isc_result_t
-send_update(updatectx_t *uctx) {
-       isc_result_t result;
-       dns_name_t *name = NULL;
-       dns_rdataset_t *rdataset = NULL;
-       dns_client_t *client = uctx->client;
-       unsigned int timeout, reqoptions;
-
-       REQUIRE(uctx->zonename != NULL && uctx->currentserver != NULL);
-
-       result = dns_message_gettempname(uctx->updatemsg, &name);
-       if (result != ISC_R_SUCCESS) {
-               return (result);
-       }
-       dns_name_init(name, NULL);
-       dns_name_clone(uctx->zonename, name);
-       result = dns_message_gettemprdataset(uctx->updatemsg, &rdataset);
-       if (result != ISC_R_SUCCESS) {
-               dns_message_puttempname(uctx->updatemsg, &name);
-               return (result);
-       }
-       dns_rdataset_makequestion(rdataset, uctx->rdclass, dns_rdatatype_soa);
-       ISC_LIST_INIT(name->list);
-       ISC_LIST_APPEND(name->list, rdataset, link);
-       dns_message_addname(uctx->updatemsg, name, DNS_SECTION_ZONE);
-       if (uctx->tsigkey == NULL && uctx->sig0key != NULL) {
-               result = dns_message_setsig0key(uctx->updatemsg, uctx->sig0key);
-               if (result != ISC_R_SUCCESS) {
-                       return (result);
-               }
-       }
-       timeout = client->update_timeout / uctx->nservers;
-       if (timeout < MIN_UPDATE_TIMEOUT) {
-               timeout = MIN_UPDATE_TIMEOUT;
-       }
-       reqoptions = 0;
-       if (uctx->want_tcp) {
-               reqoptions |= DNS_REQUESTOPT_TCP;
-       }
-       result = dns_request_createvia(
-               uctx->view->requestmgr, uctx->updatemsg, NULL,
-               uctx->currentserver, -1, reqoptions, uctx->tsigkey, timeout,
-               client->update_udptimeout, client->update_udpretries,
-               client->task, update_done, uctx, &uctx->updatereq);
-       if (result == ISC_R_SUCCESS &&
-           uctx->state == dns_clientupdatestate_prepare) {
-               uctx->state = dns_clientupdatestate_sent;
-       }
-
-       return (result);
-}
-
-static void
-resolveaddr_done(isc_task_t *task, isc_event_t *event) {
-       isc_result_t result;
-       int family;
-       dns_rdatatype_t qtype;
-       dns_clientresevent_t *rev = (dns_clientresevent_t *)event;
-       dns_name_t *name;
-       dns_rdataset_t *rdataset;
-       updatectx_t *uctx;
-       bool completed = false;
-
-       UNUSED(task);
-
-       REQUIRE(event->ev_arg != NULL);
-       uctx = *(updatectx_t **)event->ev_arg;
-       REQUIRE(UCTX_VALID(uctx));
-
-       if (event->ev_arg == &uctx->bp4) {
-               family = AF_INET;
-               qtype = dns_rdatatype_a;
-               LOCK(&uctx->lock);
-               dns_client_destroyrestrans(&uctx->restrans);
-               UNLOCK(&uctx->lock);
-       } else {
-               INSIST(event->ev_arg == &uctx->bp6);
-               family = AF_INET6;
-               qtype = dns_rdatatype_aaaa;
-               LOCK(&uctx->lock);
-               dns_client_destroyrestrans(&uctx->restrans2);
-               UNLOCK(&uctx->lock);
-       }
-
-       result = rev->result;
-       if (result != ISC_R_SUCCESS) {
-               goto done;
-       }
-
-       for (name = ISC_LIST_HEAD(rev->answerlist); name != NULL;
-            name = ISC_LIST_NEXT(name, link))
-       {
-               for (rdataset = ISC_LIST_HEAD(name->list); rdataset != NULL;
-                    rdataset = ISC_LIST_NEXT(rdataset, link))
-               {
-                       if (!dns_rdataset_isassociated(rdataset)) {
-                               continue;
-                       }
-                       if (rdataset->type != qtype) {
-                               continue;
-                       }
-
-                       for (result = dns_rdataset_first(rdataset);
-                            result == ISC_R_SUCCESS;
-                            result = dns_rdataset_next(rdataset))
-                       {
-                               dns_rdata_t rdata;
-                               dns_rdata_in_a_t rdata_a;
-                               dns_rdata_in_aaaa_t rdata_aaaa;
-                               isc_sockaddr_t *sa;
-
-                               sa = isc_mem_get(uctx->client->mctx,
-                                                sizeof(*sa));
-
-                               dns_rdata_init(&rdata);
-                               switch (family) {
-                               case AF_INET:
-                                       dns_rdataset_current(rdataset, &rdata);
-                                       result = dns_rdata_tostruct(
-                                               &rdata, &rdata_a, NULL);
-                                       RUNTIME_CHECK(result == ISC_R_SUCCESS);
-                                       isc_sockaddr_fromin(
-                                               sa, &rdata_a.in_addr, 53);
-                                       dns_rdata_freestruct(&rdata_a);
-                                       break;
-                               case AF_INET6:
-                                       dns_rdataset_current(rdataset, &rdata);
-                                       result = dns_rdata_tostruct(
-                                               &rdata, &rdata_aaaa, NULL);
-                                       RUNTIME_CHECK(result == ISC_R_SUCCESS);
-                                       isc_sockaddr_fromin6(
-                                               sa, &rdata_aaaa.in6_addr, 53);
-                                       dns_rdata_freestruct(&rdata_aaaa);
-                                       break;
-                               }
-
-                               ISC_LINK_INIT(sa, link);
-                               ISC_LIST_APPEND(uctx->servers, sa, link);
-                               uctx->nservers++;
-                       }
-               }
-       }
-
-done:
-       dns_client_freeresanswer(uctx->client, &rev->answerlist);
-       isc_event_free(&event);
-
-       LOCK(&uctx->lock);
-       if (uctx->restrans == NULL && uctx->restrans2 == NULL) {
-               completed = true;
-       }
-       UNLOCK(&uctx->lock);
-
-       if (completed) {
-               INSIST(uctx->currentserver == NULL);
-               uctx->currentserver = ISC_LIST_HEAD(uctx->servers);
-               if (uctx->currentserver != NULL && !uctx->canceled) {
-                       send_update(uctx);
-               } else {
-                       if (result == ISC_R_SUCCESS) {
-                               result = ISC_R_NOTFOUND;
-                       }
-                       update_sendevent(uctx, result);
-               }
-       }
-}
-
-static isc_result_t
-process_soa(updatectx_t *uctx, dns_rdataset_t *soaset,
-           const dns_name_t *soaname) {
-       isc_result_t result;
-       dns_rdata_t soarr = DNS_RDATA_INIT;
-       dns_rdata_soa_t soa;
-       dns_name_t primary;
-       unsigned int resoptions;
-
-       result = dns_rdataset_first(soaset);
-       if (result != ISC_R_SUCCESS) {
-               return (result);
-       }
-       dns_rdata_init(&soarr);
-       dns_rdataset_current(soaset, &soarr);
-       result = dns_rdata_tostruct(&soarr, &soa, NULL);
-       if (result != ISC_R_SUCCESS) {
-               return (result);
-       }
-
-       dns_name_init(&primary, NULL);
-       dns_name_clone(&soa.origin, &primary);
-
-       if (uctx->zonename == NULL) {
-               uctx->zonename = dns_fixedname_name(&uctx->zonefname);
-               dns_name_copynf(soaname, uctx->zonename);
-       }
-
-       if (uctx->currentserver != NULL) {
-               result = send_update(uctx);
-       } else {
-               /*
-                * Get addresses of the primary server.  We don't use the ADB
-                * feature so that we could avoid caching data.
-                */
-               LOCK(&uctx->lock);
-               uctx->bp4 = uctx;
-               resoptions = 0;
-               if (uctx->want_tcp) {
-                       resoptions |= DNS_CLIENTRESOPT_TCP;
-               }
-               result = dns_client_startresolve(
-                       uctx->client, &primary, uctx->rdclass, dns_rdatatype_a,
-                       resoptions, uctx->client->task, resolveaddr_done,
-                       &uctx->bp4, &uctx->restrans);
-               if (result == ISC_R_SUCCESS) {
-                       uctx->bp6 = uctx;
-                       result = dns_client_startresolve(
-                               uctx->client, &primary, uctx->rdclass,
-                               dns_rdatatype_aaaa, resoptions,
-                               uctx->client->task, resolveaddr_done,
-                               &uctx->bp6, &uctx->restrans2);
-               }
-               UNLOCK(&uctx->lock);
-       }
-
-       dns_rdata_freestruct(&soa);
-
-       return (result);
-}
-
-static void
-receive_soa(isc_task_t *task, isc_event_t *event) {
-       dns_requestevent_t *reqev = NULL;
-       updatectx_t *uctx;
-       dns_client_t *client;
-       isc_result_t result, eresult;
-       dns_request_t *request;
-       dns_message_t *rcvmsg = NULL;
-       dns_section_t section;
-       dns_rdataset_t *soaset = NULL;
-       int pass = 0;
-       dns_name_t *name;
-       dns_message_t *soaquery = NULL;
-       isc_sockaddr_t *addr;
-       bool seencname = false;
-       bool droplabel = false;
-       dns_name_t tname;
-       unsigned int nlabels, reqoptions;
-
-       UNUSED(task);
-
-       REQUIRE(event->ev_type == DNS_EVENT_REQUESTDONE);
-       reqev = (dns_requestevent_t *)event;
-       request = reqev->request;
-       result = eresult = reqev->result;
-       POST(result);
-       uctx = reqev->ev_arg;
-       client = uctx->client;
-       soaquery = uctx->soaquery;
-       addr = uctx->currentserver;
-       INSIST(addr != NULL);
-
-       isc_event_free(&event);
-
-       if (eresult != ISC_R_SUCCESS) {
-               result = eresult;
-               goto out;
-       }
-
-       dns_message_create(uctx->client->mctx, DNS_MESSAGE_INTENTPARSE,
-                          &rcvmsg);
-       result = dns_request_getresponse(request, rcvmsg,
-                                        DNS_MESSAGEPARSE_PRESERVEORDER);
-
-       if (result == DNS_R_TSIGERRORSET) {
-               dns_request_t *newrequest = NULL;
-
-               /* Retry SOA request without TSIG */
-               dns_message_detach(&rcvmsg);
-               dns_message_renderreset(uctx->soaquery);
-               reqoptions = 0;
-               if (uctx->want_tcp) {
-                       reqoptions |= DNS_REQUESTOPT_TCP;
-               }
-               result = dns_request_createvia(
-                       uctx->view->requestmgr, uctx->soaquery, NULL, addr, -1,
-                       reqoptions, NULL, client->find_timeout * 20,
-                       client->find_timeout, 3, uctx->client->task,
-                       receive_soa, uctx, &newrequest);
-               if (result == ISC_R_SUCCESS) {
-                       LOCK(&uctx->lock);
-                       dns_request_destroy(&uctx->soareq);
-                       uctx->soareq = newrequest;
-                       UNLOCK(&uctx->lock);
-
-                       return;
-               }
-               goto out;
-       }
-
-       section = DNS_SECTION_ANSWER;
-       POST(section);
-
-       if (rcvmsg->rcode != dns_rcode_noerror &&
-           rcvmsg->rcode != dns_rcode_nxdomain) {
-               result = rcode2result(rcvmsg->rcode);
-               goto out;
-       }
-
-lookforsoa:
-       if (pass == 0) {
-               section = DNS_SECTION_ANSWER;
-       } else if (pass == 1) {
-               section = DNS_SECTION_AUTHORITY;
-       } else {
-               droplabel = true;
-               goto out;
-       }
-
-       result = dns_message_firstname(rcvmsg, section);
-       if (result != ISC_R_SUCCESS) {
-               pass++;
-               goto lookforsoa;
-       }
-       while (result == ISC_R_SUCCESS) {
-               name = NULL;
-               dns_message_currentname(rcvmsg, section, &name);
-               soaset = NULL;
-               result = dns_message_findtype(name, dns_rdatatype_soa, 0,
-                                             &soaset);
-               if (result == ISC_R_SUCCESS) {
-                       break;
-               }
-               if (section == DNS_SECTION_ANSWER) {
-                       dns_rdataset_t *tset = NULL;
-                       if (dns_message_findtype(name, dns_rdatatype_cname, 0,
-                                                &tset) == ISC_R_SUCCESS ||
-                           dns_message_findtype(name, dns_rdatatype_dname, 0,
-                                                &tset) == ISC_R_SUCCESS)
-                       {
-                               seencname = true;
-                               break;
-                       }
-               }
-
-               result = dns_message_nextname(rcvmsg, section);
-       }
-
-       if (soaset == NULL && !seencname) {
-               pass++;
-               goto lookforsoa;
-       }
-
-       if (seencname) {
-               droplabel = true;
-               goto out;
-       }
-
-       result = process_soa(uctx, soaset, name);
-
-out:
-       if (droplabel) {
-               result = dns_message_firstname(soaquery, DNS_SECTION_QUESTION);
-               INSIST(result == ISC_R_SUCCESS);
-               name = NULL;
-               dns_message_currentname(soaquery, DNS_SECTION_QUESTION, &name);
-               nlabels = dns_name_countlabels(name);
-               if (nlabels == 1) {
-                       result = DNS_R_SERVFAIL; /* is there a better error? */
-               } else {
-                       dns_name_init(&tname, NULL);
-                       dns_name_getlabelsequence(name, 1, nlabels - 1, &tname);
-                       dns_name_clone(&tname, name);
-                       dns_request_destroy(&request);
-                       LOCK(&uctx->lock);
-                       uctx->soareq = NULL;
-                       UNLOCK(&uctx->lock);
-                       dns_message_renderreset(soaquery);
-                       dns_message_settsigkey(soaquery, NULL);
-                       reqoptions = 0;
-                       if (uctx->want_tcp) {
-                               reqoptions |= DNS_REQUESTOPT_TCP;
-                       }
-                       result = dns_request_createvia(
-                               uctx->view->requestmgr, soaquery, NULL,
-                               uctx->currentserver, -1, reqoptions,
-                               uctx->tsigkey, client->find_timeout * 20,
-                               client->find_timeout, 3, client->task,
-                               receive_soa, uctx, &uctx->soareq);
-               }
-       }
-
-       if (!droplabel || result != ISC_R_SUCCESS) {
-               dns_message_detach(&uctx->soaquery);
-               LOCK(&uctx->lock);
-               dns_request_destroy(&uctx->soareq);
-               UNLOCK(&uctx->lock);
-       }
-
-       if (rcvmsg != NULL) {
-               dns_message_detach(&rcvmsg);
-       }
-
-       if (result != ISC_R_SUCCESS) {
-               update_sendevent(uctx, result);
-       }
-}
-
-static isc_result_t
-request_soa(updatectx_t *uctx) {
-       isc_result_t result;
-       dns_message_t *soaquery = uctx->soaquery;
-       dns_name_t *name = NULL;
-       dns_rdataset_t *rdataset = NULL;
-       unsigned int reqoptions;
-
-       if (soaquery == NULL) {
-               dns_message_create(uctx->client->mctx, DNS_MESSAGE_INTENTRENDER,
-                                  &soaquery);
-       }
-       soaquery->flags |= DNS_MESSAGEFLAG_RD;
-       result = dns_message_gettempname(soaquery, &name);
-       if (result != ISC_R_SUCCESS) {
-               goto fail;
-       }
-       result = dns_message_gettemprdataset(soaquery, &rdataset);
-       if (result != ISC_R_SUCCESS) {
-               goto fail;
-       }
-       dns_rdataset_makequestion(rdataset, uctx->rdclass, dns_rdatatype_soa);
-       dns_name_clone(uctx->firstname, name);
-       ISC_LIST_APPEND(name->list, rdataset, link);
-       dns_message_addname(soaquery, name, DNS_SECTION_QUESTION);
-       rdataset = NULL;
-       name = NULL;
-       reqoptions = 0;
-       if (uctx->want_tcp) {
-               reqoptions |= DNS_REQUESTOPT_TCP;
-       }
-
-       result = dns_request_createvia(
-               uctx->view->requestmgr, soaquery, NULL, uctx->currentserver, -1,
-               reqoptions, uctx->tsigkey, uctx->client->find_timeout * 20,
-               uctx->client->find_timeout, 3, uctx->client->task, receive_soa,
-               uctx, &uctx->soareq);
-       if (result == ISC_R_SUCCESS) {
-               uctx->soaquery = soaquery;
-               return (ISC_R_SUCCESS);
-       }
-
-fail:
-       if (rdataset != NULL) {
-               ISC_LIST_UNLINK(name->list, rdataset, link); /* for safety */
-               dns_message_puttemprdataset(soaquery, &rdataset);
-       }
-       if (name != NULL) {
-               dns_message_puttempname(soaquery, &name);
-       }
-       dns_message_detach(&soaquery);
-
-       return (result);
-}
-
-static void
-resolvesoa_done(isc_task_t *task, isc_event_t *event) {
-       dns_clientresevent_t *rev = (dns_clientresevent_t *)event;
-       updatectx_t *uctx;
-       dns_name_t *name, tname;
-       dns_rdataset_t *rdataset = NULL;
-       isc_result_t result = rev->result;
-       unsigned int nlabels, resoptions;
-
-       UNUSED(task);
-
-       uctx = event->ev_arg;
-       REQUIRE(UCTX_VALID(uctx));
-
-       LOCK(&uctx->lock);
-       dns_client_destroyrestrans(&uctx->restrans);
-       UNLOCK(&uctx->lock);
-
-       uctx = event->ev_arg;
-       if (result != ISC_R_SUCCESS && result != DNS_R_NCACHENXDOMAIN &&
-           result != DNS_R_NCACHENXRRSET)
-       {
-               /* XXX: what about DNSSEC failure? */
-               goto out;
-       }
-
-       for (name = ISC_LIST_HEAD(rev->answerlist); name != NULL;
-            name = ISC_LIST_NEXT(name, link))
-       {
-               for (rdataset = ISC_LIST_HEAD(name->list); rdataset != NULL;
-                    rdataset = ISC_LIST_NEXT(rdataset, link))
-               {
-                       if (dns_rdataset_isassociated(rdataset) &&
-                           rdataset->type == dns_rdatatype_soa) {
-                               break;
-                       }
-               }
-       }
-
-       if (rdataset == NULL) {
-               /* Drop one label and retry resolution. */
-               nlabels = dns_name_countlabels(&uctx->soaqname);
-               if (nlabels == 1) {
-                       result = DNS_R_SERVFAIL; /* is there a better error? */
-                       goto out;
-               }
-               dns_name_init(&tname, NULL);
-               dns_name_getlabelsequence(&uctx->soaqname, 1, nlabels - 1,
-                                         &tname);
-               dns_name_clone(&tname, &uctx->soaqname);
-               resoptions = 0;
-               if (uctx->want_tcp) {
-                       resoptions |= DNS_CLIENTRESOPT_TCP;
-               }
-
-               result = dns_client_startresolve(
-                       uctx->client, &uctx->soaqname, uctx->rdclass,
-                       dns_rdatatype_soa, resoptions, uctx->client->task,
-                       resolvesoa_done, uctx, &uctx->restrans);
-       } else {
-               result = process_soa(uctx, rdataset, &uctx->soaqname);
-       }
-
-out:
-       dns_client_freeresanswer(uctx->client, &rev->answerlist);
-       isc_event_free(&event);
-
-       if (result != ISC_R_SUCCESS) {
-               update_sendevent(uctx, result);
-       }
-}
-
-static isc_result_t
-copy_name(isc_mem_t *mctx, dns_message_t *msg, const dns_name_t *name,
-         dns_name_t **newnamep) {
-       isc_result_t result;
-       dns_name_t *newname = NULL;
-       isc_region_t r;
-       isc_buffer_t *namebuf = NULL, *rdatabuf = NULL;
-       dns_rdatalist_t *rdatalist;
-       dns_rdataset_t *rdataset, *newrdataset;
-       dns_rdata_t rdata = DNS_RDATA_INIT, *newrdata;
-
-       result = dns_message_gettempname(msg, &newname);
-       if (result != ISC_R_SUCCESS) {
-               return (result);
-       }
-       isc_buffer_allocate(mctx, &namebuf, DNS_NAME_MAXWIRE);
-       dns_name_init(newname, NULL);
-       dns_name_setbuffer(newname, namebuf);
-       dns_message_takebuffer(msg, &namebuf);
-       dns_name_copynf(name, newname);
-
-       for (rdataset = ISC_LIST_HEAD(name->list); rdataset != NULL;
-            rdataset = ISC_LIST_NEXT(rdataset, link))
-       {
-               rdatalist = NULL;
-               result = dns_message_gettemprdatalist(msg, &rdatalist);
-               if (result != ISC_R_SUCCESS) {
-                       goto fail;
-               }
-               dns_rdatalist_init(rdatalist);
-               rdatalist->type = rdataset->type;
-               rdatalist->rdclass = rdataset->rdclass;
-               rdatalist->covers = rdataset->covers;
-               rdatalist->ttl = rdataset->ttl;
-
-               result = dns_rdataset_first(rdataset);
-               while (result == ISC_R_SUCCESS) {
-                       dns_rdata_reset(&rdata);
-                       dns_rdataset_current(rdataset, &rdata);
-
-                       newrdata = NULL;
-                       result = dns_message_gettemprdata(msg, &newrdata);
-                       if (result != ISC_R_SUCCESS) {
-                               goto fail;
-                       }
-                       dns_rdata_toregion(&rdata, &r);
-                       rdatabuf = NULL;
-                       isc_buffer_allocate(mctx, &rdatabuf, r.length);
-                       isc_buffer_putmem(rdatabuf, r.base, r.length);
-                       isc_buffer_usedregion(rdatabuf, &r);
-                       dns_rdata_init(newrdata);
-                       dns_rdata_fromregion(newrdata, rdata.rdclass,
-                                            rdata.type, &r);
-                       newrdata->flags = rdata.flags;
-
-                       ISC_LIST_APPEND(rdatalist->rdata, newrdata, link);
-                       dns_message_takebuffer(msg, &rdatabuf);
-
-                       result = dns_rdataset_next(rdataset);
-               }
-
-               newrdataset = NULL;
-               result = dns_message_gettemprdataset(msg, &newrdataset);
-               if (result != ISC_R_SUCCESS) {
-                       goto fail;
-               }
-               dns_rdatalist_tordataset(rdatalist, newrdataset);
-
-               ISC_LIST_APPEND(newname->list, newrdataset, link);
-       }
-
-       *newnamep = newname;
-
-       return (ISC_R_SUCCESS);
-
-fail:
-       dns_message_puttempname(msg, &newname);
-
-       return (result);
-}
-
-static void
-internal_update_callback(isc_task_t *task, isc_event_t *event) {
-       updatearg_t *uarg = event->ev_arg;
-       dns_clientupdateevent_t *uev = (dns_clientupdateevent_t *)event;
-
-       UNUSED(task);
-
-       LOCK(&uarg->lock);
-
-       uarg->result = uev->result;
-
-       dns_client_destroyupdatetrans(&uarg->trans);
-       isc_event_free(&event);
-
-       if (!uarg->canceled) {
-               UNLOCK(&uarg->lock);
-
-               /* Exit from the internal event loop */
-               isc_app_ctxsuspend(uarg->actx);
-       } else {
-               /*
-                * We have already exited from the loop (due to some
-                * unexpected event).  Just clean the arg up.
-                */
-               UNLOCK(&uarg->lock);
-               isc_mutex_destroy(&uarg->lock);
-               isc_mem_put(uarg->client->mctx, uarg, sizeof(*uarg));
-       }
-}
-
-isc_result_t
-dns_client_update(dns_client_t *client, dns_rdataclass_t rdclass,
-                 const dns_name_t *zonename, dns_namelist_t *prerequisites,
-                 dns_namelist_t *updates, isc_sockaddrlist_t *servers,
-                 dns_tsec_t *tsec, unsigned int options) {
-       isc_result_t result;
-       isc_appctx_t *actx;
-       updatearg_t *uarg;
-
-       REQUIRE(DNS_CLIENT_VALID(client));
-
-       if ((client->attributes & DNS_CLIENTATTR_OWNCTX) == 0 &&
-           (options & DNS_CLIENTUPDOPT_ALLOWRUN) == 0)
-       {
-               /*
-                * If the client is run under application's control, we need
-                * to create a new running (sub)environment for this
-                * particular update.
-                */
-               return (ISC_R_NOTIMPLEMENTED); /* XXXTBD */
-       } else {
-               actx = client->actx;
-       }
-
-       uarg = isc_mem_get(client->mctx, sizeof(*uarg));
-
-       isc_mutex_init(&uarg->lock);
-
-       uarg->actx = actx;
-       uarg->client = client;
-       uarg->result = ISC_R_FAILURE;
-       uarg->trans = NULL;
-       uarg->canceled = false;
-
-       result = dns_client_startupdate(
-               client, rdclass, zonename, prerequisites, updates, servers,
-               tsec, options, client->task, internal_update_callback, uarg,
-               &uarg->trans);
-       if (result != ISC_R_SUCCESS) {
-               isc_mutex_destroy(&uarg->lock);
-               isc_mem_put(client->mctx, uarg, sizeof(*uarg));
-               return (result);
-       }
-
-       /*
-        * Start internal event loop.  It blocks until the entire process
-        * is completed.
-        */
-       result = isc_app_ctxrun(actx);
-
-       LOCK(&uarg->lock);
-       if (result == ISC_R_SUCCESS || result == ISC_R_SUSPEND) {
-               result = uarg->result;
-       }
-
-       if (uarg->trans != NULL) {
-               /*
-                * Unusual termination (perhaps due to signal).  We need some
-                * tricky cleanup process.
-                */
-               uarg->canceled = true;
-               dns_client_cancelupdate(uarg->trans);
-
-               UNLOCK(&uarg->lock);
-
-               /* uarg will be freed in the event handler. */
-       } else {
-               UNLOCK(&uarg->lock);
-
-               isc_mutex_destroy(&uarg->lock);
-               isc_mem_put(client->mctx, uarg, sizeof(*uarg));
-       }
-
-       return (result);
-}
-
-static void
-startupdate(isc_task_t *task, isc_event_t *event) {
-       updatectx_t *uctx;
-       isc_result_t result;
-       unsigned int resoptions;
-
-       REQUIRE(event != NULL);
-
-       UNUSED(task);
-
-       uctx = event->ev_arg;
-
-       if (uctx->zonename != NULL && uctx->currentserver != NULL) {
-               result = send_update(uctx);
-               if (result != ISC_R_SUCCESS) {
-                       goto fail;
-               }
-       } else if (uctx->currentserver != NULL) {
-               result = request_soa(uctx);
-               if (result != ISC_R_SUCCESS) {
-                       goto fail;
-               }
-       } else {
-               resoptions = 0;
-               if (uctx->want_tcp) {
-                       resoptions |= DNS_CLIENTRESOPT_TCP;
-               }
-               dns_name_clone(uctx->firstname, &uctx->soaqname);
-               result = dns_client_startresolve(
-                       uctx->client, &uctx->soaqname, uctx->rdclass,
-                       dns_rdatatype_soa, resoptions, uctx->client->task,
-                       resolvesoa_done, uctx, &uctx->restrans);
-               if (result != ISC_R_SUCCESS) {
-                       goto fail;
-               }
-       }
-
-       isc_event_free(&event);
-
-fail:
-       if (result != ISC_R_SUCCESS) {
-               update_sendevent(uctx, result);
-       }
-}
-
-isc_result_t
-dns_client_startupdate(dns_client_t *client, dns_rdataclass_t rdclass,
-                      const dns_name_t *zonename,
-                      dns_namelist_t *prerequisites, dns_namelist_t *updates,
-                      isc_sockaddrlist_t *servers, dns_tsec_t *tsec,
-                      unsigned int options, isc_task_t *task,
-                      isc_taskaction_t action, void *arg,
-                      dns_clientupdatetrans_t **transp) {
-       dns_view_t *view = NULL;
-       isc_result_t result;
-       dns_name_t *name, *newname;
-       updatectx_t *uctx;
-       isc_task_t *tclone = NULL;
-       dns_section_t section = DNS_SECTION_UPDATE;
-       isc_sockaddr_t *server, *sa = NULL;
-       dns_tsectype_t tsectype = dns_tsectype_none;
-       bool want_tcp;
-
-       UNUSED(options);
-
-       REQUIRE(DNS_CLIENT_VALID(client));
-       REQUIRE(transp != NULL && *transp == NULL);
-       REQUIRE(updates != NULL);
-       REQUIRE(task != NULL);
-
-       if (tsec != NULL) {
-               tsectype = dns_tsec_gettype(tsec);
-               if (tsectype != dns_tsectype_tsig) {
-                       return (ISC_R_NOTIMPLEMENTED); /* XXX */
-               }
-       }
-
-       LOCK(&client->lock);
-       result = dns_viewlist_find(&client->viewlist, DNS_CLIENTVIEW_NAME,
-                                  rdclass, &view);
-       UNLOCK(&client->lock);
-       if (result != ISC_R_SUCCESS) {
-               return (result);
-       }
-
-       want_tcp = ((options & DNS_CLIENTUPDOPT_TCP) != 0);
-
-       /*
-        * Create a context and prepare some resources.
-        */
-
-       uctx = isc_mem_get(client->mctx, sizeof(*uctx));
-
-       isc_mutex_init(&uctx->lock);
-
-       tclone = NULL;
-       isc_task_attach(task, &tclone);
-       uctx->client = client;
-       ISC_LINK_INIT(uctx, link);
-       uctx->state = dns_clientupdatestate_prepare;
-       uctx->view = view;
-       uctx->rdclass = rdclass;
-       uctx->canceled = false;
-       uctx->updatemsg = NULL;
-       uctx->soaquery = NULL;
-       uctx->updatereq = NULL;
-       uctx->restrans = NULL;
-       uctx->restrans2 = NULL;
-       uctx->bp4 = NULL;
-       uctx->bp6 = NULL;
-       uctx->soareq = NULL;
-       uctx->event = NULL;
-       uctx->tsigkey = NULL;
-       uctx->sig0key = NULL;
-       uctx->zonename = NULL;
-       uctx->want_tcp = want_tcp;
-       dns_name_init(&uctx->soaqname, NULL);
-       ISC_LIST_INIT(uctx->servers);
-       uctx->nservers = 0;
-       uctx->currentserver = NULL;
-       dns_fixedname_init(&uctx->zonefname);
-       if (tsec != NULL) {
-               dns_tsec_getkey(tsec, &uctx->tsigkey);
-       }
-       uctx->event = (dns_clientupdateevent_t *)isc_event_allocate(
-               client->mctx, tclone, DNS_EVENT_UPDATEDONE, action, arg,
-               sizeof(*uctx->event));
-       if (zonename != NULL) {
-               uctx->zonename = dns_fixedname_name(&uctx->zonefname);
-               dns_name_copynf(zonename, uctx->zonename);
-       }
-       if (servers != NULL) {
-               for (server = ISC_LIST_HEAD(*servers); server != NULL;
-                    server = ISC_LIST_NEXT(server, link))
-               {
-                       sa = isc_mem_get(client->mctx, sizeof(*sa));
-                       sa->type = server->type;
-                       sa->length = server->length;
-                       ISC_LINK_INIT(sa, link);
-                       ISC_LIST_APPEND(uctx->servers, sa, link);
-                       if (uctx->currentserver == NULL) {
-                               uctx->currentserver = sa;
-                       }
-                       uctx->nservers++;
-               }
-       }
-
-       /* Make update message */
-       dns_message_create(client->mctx, DNS_MESSAGE_INTENTRENDER,
-                          &uctx->updatemsg);
-       uctx->updatemsg->opcode = dns_opcode_update;
-
-       if (prerequisites != NULL) {
-               for (name = ISC_LIST_HEAD(*prerequisites); name != NULL;
-                    name = ISC_LIST_NEXT(name, link))
-               {
-                       newname = NULL;
-                       result = copy_name(client->mctx, uctx->updatemsg, name,
-                                          &newname);
-                       if (result != ISC_R_SUCCESS) {
-                               goto fail;
-                       }
-                       dns_message_addname(uctx->updatemsg, newname,
-                                           DNS_SECTION_PREREQUISITE);
-               }
-       }
-
-       for (name = ISC_LIST_HEAD(*updates); name != NULL;
-            name = ISC_LIST_NEXT(name, link))
-       {
-               newname = NULL;
-               result = copy_name(client->mctx, uctx->updatemsg, name,
-                                  &newname);
-               if (result != ISC_R_SUCCESS) {
-                       goto fail;
-               }
-               dns_message_addname(uctx->updatemsg, newname,
-                                   DNS_SECTION_UPDATE);
-       }
-
-       uctx->firstname = NULL;
-       result = dns_message_firstname(uctx->updatemsg, section);
-       if (result == ISC_R_NOMORE) {
-               section = DNS_SECTION_PREREQUISITE;
-               result = dns_message_firstname(uctx->updatemsg, section);
-       }
-       if (result != ISC_R_SUCCESS) {
-               goto fail;
-       }
-       dns_message_currentname(uctx->updatemsg, section, &uctx->firstname);
-
-       uctx->magic = UCTX_MAGIC;
-
-       LOCK(&client->lock);
-       ISC_LIST_APPEND(client->updatectxs, uctx, link);
-       isc_refcount_increment(&client->references);
-       UNLOCK(&client->lock);
-
-       *transp = (dns_clientupdatetrans_t *)uctx;
-       result = isc_app_ctxonrun(client->actx, client->mctx, client->task,
-                                 startupdate, uctx);
-       if (result == ISC_R_ALREADYRUNNING) {
-               isc_event_t *event;
-               event = isc_event_allocate(client->mctx, dns_client_startupdate,
-                                          DNS_EVENT_STARTUPDATE, startupdate,
-                                          uctx, sizeof(*event));
-               result = ISC_R_SUCCESS;
-               isc_task_send(task, &event);
-       }
-       if (result == ISC_R_SUCCESS) {
-               return (result);
-       }
-
-       isc_refcount_decrement1(&client->references);
-       *transp = NULL;
-
-fail:
-       if (ISC_LINK_LINKED(uctx, link)) {
-               LOCK(&client->lock);
-               ISC_LIST_UNLINK(client->updatectxs, uctx, link);
-               UNLOCK(&client->lock);
-       }
-       if (uctx->updatemsg != NULL) {
-               dns_message_detach(&uctx->updatemsg);
-       }
-       while ((sa = ISC_LIST_HEAD(uctx->servers)) != NULL) {
-               ISC_LIST_UNLINK(uctx->servers, sa, link);
-               isc_mem_put(client->mctx, sa, sizeof(*sa));
-       }
-       if (uctx->event != NULL) {
-               isc_event_free(ISC_EVENT_PTR(&uctx->event));
-       }
-       if (uctx->tsigkey != NULL) {
-               dns_tsigkey_detach(&uctx->tsigkey);
-       }
-       isc_task_detach(&tclone);
-       isc_mutex_destroy(&uctx->lock);
-       uctx->magic = 0;
-       isc_mem_put(client->mctx, uctx, sizeof(*uctx));
-       dns_view_detach(&view);
-
-       return (result);
-}
-
-void
-dns_client_cancelupdate(dns_clientupdatetrans_t *trans) {
-       updatectx_t *uctx;
-
-       REQUIRE(trans != NULL);
-       uctx = (updatectx_t *)trans;
-       REQUIRE(UCTX_VALID(uctx));
-
-       LOCK(&uctx->lock);
-
-       if (!uctx->canceled) {
-               uctx->canceled = true;
-               if (uctx->updatereq != NULL) {
-                       dns_request_cancel(uctx->updatereq);
-               }
-               if (uctx->soareq != NULL) {
-                       dns_request_cancel(uctx->soareq);
-               }
-               if (uctx->restrans != NULL) {
-                       dns_client_cancelresolve(uctx->restrans);
-               }
-               if (uctx->restrans2 != NULL) {
-                       dns_client_cancelresolve(uctx->restrans2);
-               }
-       }
-
-       UNLOCK(&uctx->lock);
-}
-
-void
-dns_client_destroyupdatetrans(dns_clientupdatetrans_t **transp) {
-       updatectx_t *uctx;
-       isc_mem_t *mctx;
-       dns_client_t *client;
-       isc_sockaddr_t *sa;
-
-       REQUIRE(transp != NULL);
-       uctx = (updatectx_t *)*transp;
-       *transp = NULL;
-       REQUIRE(UCTX_VALID(uctx));
-       client = uctx->client;
-       REQUIRE(DNS_CLIENT_VALID(client));
-       REQUIRE(uctx->updatereq == NULL && uctx->updatemsg == NULL &&
-               uctx->soareq == NULL && uctx->soaquery == NULL &&
-               uctx->event == NULL && uctx->tsigkey == NULL &&
-               uctx->sig0key == NULL);
-
-       mctx = client->mctx;
-       dns_view_detach(&uctx->view);
-       while ((sa = ISC_LIST_HEAD(uctx->servers)) != NULL) {
-               ISC_LIST_UNLINK(uctx->servers, sa, link);
-               isc_mem_put(mctx, sa, sizeof(*sa));
-       }
-
-       LOCK(&client->lock);
-
-       INSIST(ISC_LINK_LINKED(uctx, link));
-       ISC_LIST_UNLINK(client->updatectxs, uctx, link);
-
-       UNLOCK(&client->lock);
-
-       isc_mutex_destroy(&uctx->lock);
-       uctx->magic = 0;
-
-       isc_mem_put(mctx, uctx, sizeof(*uctx));
-
-       dns_client_destroy(&client);
-}
-
-isc_mem_t *
-dns_client_mctx(dns_client_t *client) {
-       REQUIRE(DNS_CLIENT_VALID(client));
-       return (client->mctx);
-}
-
-typedef struct {
-       isc_buffer_t buffer;
-       dns_rdataset_t rdataset;
-       dns_rdatalist_t rdatalist;
-       dns_rdata_t rdata;
-       size_t size;
-       isc_mem_t *mctx;
-       unsigned char data[FLEXIBLE_ARRAY_MEMBER];
-} dns_client_updaterec_t;
-
-isc_result_t
-dns_client_updaterec(dns_client_updateop_t op, const dns_name_t *owner,
-                    dns_rdatatype_t type, dns_rdata_t *source, dns_ttl_t ttl,
-                    dns_name_t *target, dns_rdataset_t *rdataset,
-                    dns_rdatalist_t *rdatalist, dns_rdata_t *rdata,
-                    isc_mem_t *mctx) {
-       dns_client_updaterec_t *updaterec = NULL;
-       size_t size = offsetof(dns_client_updaterec_t, data);
-
-       REQUIRE(op < updateop_max);
-       REQUIRE(owner != NULL);
-       REQUIRE((rdataset != NULL && rdatalist != NULL && rdata != NULL) ||
-               (rdataset == NULL && rdatalist == NULL && rdata == NULL &&
-                mctx != NULL));
-       if (op == updateop_add) {
-               REQUIRE(source != NULL);
-       }
-       if (source != NULL) {
-               REQUIRE(source->type == type);
-               REQUIRE(op == updateop_add || op == updateop_delete ||
-                       op == updateop_exist);
-       }
-
-       size += owner->length;
-       if (source != NULL) {
-               size += source->length;
-       }
-
-       if (rdataset == NULL) {
-               updaterec = isc_mem_get(mctx, size);
-               rdataset = &updaterec->rdataset;
-               rdatalist = &updaterec->rdatalist;
-               rdata = &updaterec->rdata;
-               dns_rdataset_init(rdataset);
-               dns_rdatalist_init(&updaterec->rdatalist);
-               dns_rdata_init(&updaterec->rdata);
-               isc_buffer_init(
-                       &updaterec->buffer, updaterec->data,
-                       (unsigned int)(size -
-                                      offsetof(dns_client_updaterec_t, data)));
-               dns_name_copy(owner, target, &updaterec->buffer);
-               if (source != NULL) {
-                       isc_region_t r;
-                       dns_rdata_clone(source, rdata);
-                       dns_rdata_toregion(rdata, &r);
-                       rdata->data = isc_buffer_used(&updaterec->buffer);
-                       isc_buffer_copyregion(&updaterec->buffer, &r);
-               }
-               updaterec->mctx = NULL;
-               isc_mem_attach(mctx, &updaterec->mctx);
-       } else if (source != NULL) {
-               dns_rdata_clone(source, rdata);
-       }
-
-       switch (op) {
-       case updateop_add:
-               break;
-       case updateop_delete:
-               if (source != NULL) {
-                       ttl = 0;
-                       dns_rdata_makedelete(rdata);
-               } else {
-                       dns_rdata_deleterrset(rdata, type);
-               }
-               break;
-       case updateop_notexist:
-               dns_rdata_notexist(rdata, type);
-               break;
-       case updateop_exist:
-               if (source == NULL) {
-                       ttl = 0;
-                       dns_rdata_exists(rdata, type);
-               }
-       case updateop_none:
-               break;
-       default:
-               INSIST(0);
-               ISC_UNREACHABLE();
-       }
-
-       rdatalist->type = rdata->type;
-       rdatalist->rdclass = rdata->rdclass;
-       if (source != NULL) {
-               rdatalist->covers = dns_rdata_covers(rdata);
-               rdatalist->ttl = ttl;
-       }
-       ISC_LIST_APPEND(rdatalist->rdata, rdata, link);
-       dns_rdatalist_tordataset(rdatalist, rdataset);
-       ISC_LIST_APPEND(target->list, rdataset, link);
-       if (updaterec != NULL) {
-               target->attributes |= DNS_NAMEATTR_HASUPDATEREC;
-               dns_name_setbuffer(target, &updaterec->buffer);
-       }
-       if (op == updateop_add || op == updateop_delete) {
-               target->attributes |= DNS_NAMEATTR_UPDATE;
-       } else {
-               target->attributes |= DNS_NAMEATTR_PREREQUISITE;
-       }
-       return (ISC_R_SUCCESS);
-}
-
-void
-dns_client_freeupdate(dns_name_t **namep) {
-       dns_client_updaterec_t *updaterec;
-       dns_rdatalist_t *rdatalist;
-       dns_rdataset_t *rdataset;
-       dns_rdata_t *rdata;
-       dns_name_t *name;
-
-       REQUIRE(namep != NULL && *namep != NULL);
-
-       name = *namep;
-       for (rdataset = ISC_LIST_HEAD(name->list); rdataset != NULL;
-            rdataset = ISC_LIST_HEAD(name->list))
-       {
-               ISC_LIST_UNLINK(name->list, rdataset, link);
-               rdatalist = NULL;
-               dns_rdatalist_fromrdataset(rdataset, &rdatalist);
-               if (rdatalist == NULL) {
-                       dns_rdataset_disassociate(rdataset);
-                       continue;
-               }
-               for (rdata = ISC_LIST_HEAD(rdatalist->rdata); rdata != NULL;
-                    rdata = ISC_LIST_HEAD(rdatalist->rdata))
-               {
-                       ISC_LIST_UNLINK(rdatalist->rdata, rdata, link);
-               }
-               dns_rdataset_disassociate(rdataset);
-       }
-
-       if ((name->attributes & DNS_NAMEATTR_HASUPDATEREC) != 0) {
-               updaterec = (dns_client_updaterec_t *)name->buffer;
-               INSIST(updaterec != NULL);
-               isc_mem_putanddetach(&updaterec->mctx, updaterec,
-                                    updaterec->size);
-               *namep = NULL;
-       }
-}
index a6c93dd9a5c46c3084e4a0a5123e43c2b143d0bc..6350db1a69e52cfec60e7f84a4e9494baacbe937 100644 (file)
@@ -118,15 +118,6 @@ typedef struct dns_clientresevent {
        dns_namelist_t answerlist;
 } dns_clientresevent_t; /* too long? */
 
-/*%
- * Status of a dynamic update procedure.
- */
-typedef enum {
-       dns_clientupdatestate_prepare, /*%< no updates have been sent */
-       dns_clientupdatestate_sent,    /*%< updates were sent, no response */
-       dns_clientupdatestate_done     /*%< update was sent and succeeded */
-} dns_clientupdatestate_t;
-
 /*%
  * A dns_clientreqevent_t is sent when a DNS request is completed by a client.
  * 'result' stores the result code of the entire transaction.
@@ -141,24 +132,6 @@ typedef struct dns_clientreqevent {
        dns_message_t *rmessage;
 } dns_clientreqevent_t; /* too long? */
 
-/*%
- * A dns_clientupdateevent_t is sent when dynamic update performed by a client
- * completes.  'result' stores the result code of the entire update procedure.
- * 'state' specifies the status of the update procedure when this event is
- * sent.  This can be used as a hint by the receiver to determine whether
- * the update attempt was ever made.  In particular, if the state is
- * dns_clientupdatestate_prepare, the receiver can be sure that the requested
- * update was not applied.
- */
-typedef struct dns_clientupdateevent {
-       ISC_EVENT_COMMON(struct dns_clientupdateevent);
-       isc_result_t            result;
-       dns_clientupdatestate_t state;
-} dns_clientupdateevent_t; /* too long? */
-
-isc_result_t
-dns_client_create(dns_client_t **clientp, unsigned int options);
-
 isc_result_t
 dns_client_createx(isc_mem_t *mctx, isc_appctx_t *actx, isc_taskmgr_t *taskmgr,
                   isc_socketmgr_t *socketmgr, isc_timermgr_t *timermgr,
@@ -166,25 +139,16 @@ dns_client_createx(isc_mem_t *mctx, isc_appctx_t *actx, isc_taskmgr_t *taskmgr,
                   const isc_sockaddr_t *localaddr4,
                   const isc_sockaddr_t *localaddr6);
 /*%<
- * Create a DNS client.  These functions create a new client object with
- * minimal internal resources such as the default 'view' for the IN class and
- * IPv4/IPv6 dispatches for the view.
+ * Create a DNS client object with minimal internal resources, such as
+ * a default view for the IN class and IPv4/IPv6 dispatches for the view.
  *
- * dns_client_createx() takes 'manager' arguments so that the caller can
+ * dns_client_create() takes 'manager' arguments so that the caller can
  * control the behavior of the client through the underlying event framework.
- * On the other hand, dns_client_create() simplifies the interface and creates
- * the managers internally.  A DNS client object created via
- * dns_client_create() is expected to be used by an application that only needs
- * simple synchronous services or by a thread-based application.
- *
- * dns_client_createx2 takes two additional parameters, 'localaddr4' and
- * 'localaddr6', to specify the local address to use for each family. If
- * both are set to NULL, then wildcard addresses will be used for both
- * families. If only one is NULL, then the other address will be used
- * as the local address, and the other protocol family will not be used.
- *
- * If the DNS_CLIENTCREATEOPT_USECACHE flag is set in 'options',
- * dns_client_create(x) will create a cache database with the view.
+ * 'localaddr4' and 'localaddr6' specify the local addresses to use for
+ * each address family; if both are set to NULL, then wildcard addresses
+ * will be used for both families. If only one is NULL, then the other
+ * address will be used as the local address, and the NULL protocol family
+ * will not be used.
  *
  * Requires:
  *
@@ -511,146 +475,6 @@ dns_client_destroyreqtrans(dns_clientreqtrans_t **transp);
  *\li  *transp == NULL.
  */
 
-isc_result_t
-dns_client_update(dns_client_t *client, dns_rdataclass_t rdclass,
-                 const dns_name_t *zonename, dns_namelist_t *prerequisites,
-                 dns_namelist_t *updates, isc_sockaddrlist_t *servers,
-                 dns_tsec_t *tsec, unsigned int options);
-
-isc_result_t
-dns_client_startupdate(dns_client_t *client, dns_rdataclass_t rdclass,
-                      const dns_name_t *zonename,
-                      dns_namelist_t *prerequisites, dns_namelist_t *updates,
-                      isc_sockaddrlist_t *servers, dns_tsec_t *tsec,
-                      unsigned int options, isc_task_t *task,
-                      isc_taskaction_t action, void *arg,
-                      dns_clientupdatetrans_t **transp);
-/*%<
- * Perform DNS dynamic update for 'updates' of the 'rdclass' class with
- * optional 'prerequisites'.
- *
- * 'updates' are a list of names with associated RRsets to be updated.
- *
- * 'prerequisites' are a list of names with associated RRsets corresponding to
- * the prerequisites of the updates.  This is optional and can be NULL, in
- * which case the prerequisite section of the update message will be empty.
- *
- * Both 'updates' and 'prerequisites' must be constructed as specified in
- * RFC2136.
- *
- * 'zonename' is the name of the zone in which the updated names exist.
- * This is optional and can be NULL.  In this case, these functions internally
- * identify the appropriate zone through some queries for the SOA RR starting
- * with the first name in prerequisites or updates.
- *
- * 'servers' is a list of authoritative servers to which the update message
- * should be sent.  This is optional and can be NULL.  In this case, these
- * functions internally identify the appropriate primary server name and its
- * addresses through some queries for the SOA RR (like the case of zonename)
- * and supplemental A/AAAA queries for the server name.
- * Note: The client module generally assumes the given addresses are of the
- * primary server of the corresponding zone.  It will work even if a secondary
- * server address is specified as long as the server allows update forwarding,
- * it is generally discouraged to include secondary server addresses unless
- * there's strong reason to do so.
- *
- * 'tsec' is a transaction security object containing, e.g. a TSIG key for
- * authenticating the update transaction (and the supplemental query/response
- * transactions if the server is specified).  This is optional and can be
- * NULL, in which case the library tries the update without any transaction
- * authentication.
- *
- * It is typically expected that the client object passed to
- * dns_client_update() was created via dns_client_create() and has its own
- * managers and contexts.  However, if the DNS_CLIENTUPDOPT_ALLOWRUN flag is
- * set in 'options', this function performs the synchronous service even if
- * it does not have its own manager and context structures.
- *
- * dns_client_update() provides a synchronous service.  This function blocks
- * until the entire update procedure completes, including the additional
- * queries when necessary.
- *
- * dns_client_startupdate() is an asynchronous version of dns_client_update().
- * It immediately returns (typically with *transp being set to a non-NULL
- * pointer), and performs the update procedure through a set of internal
- * events.  All transactions including the additional query exchanges are
- * performed as a separate event, so none of these events cause blocking
- * operation.  When the update procedure completes, the specified function
- * 'action' will be called with the argument of a 'dns_clientupdateevent_t'
- * structure.  On return, '*transp' is set to an opaque transaction ID so that
- * the caller can cancel this update process.
- *
- * DNS_CLIENTUPDOPT_TCP switches to the TCP (vs. UDP) transport.
- *
- * Requires:
- *
- *\li  'client' is a valid client.
- *
- *\li  'updates' != NULL.
- *
- *\li  'task' is a valid task.
- *
- *\li  'transp' != NULL && *transp == NULL;
- *
- * Returns:
- *
- *\li  #ISC_R_SUCCESS                          On success.
- *
- *\li  Anything else                           Failure.
- */
-
-void
-dns_client_cancelupdate(dns_clientupdatetrans_t *trans);
-/*%<
- * Cancel an ongoing dynamic update procedure started via
- * dns_client_startupdate().
- *
- * Notes:
- *
- *\li  If the update procedure has not completed, post its UPDATEDONE
- *     event with a result code of #ISC_R_CANCELED.
- *
- * Requires:
- *
- *\li  'trans' is a valid transaction ID.
- */
-
-void
-dns_client_destroyupdatetrans(dns_clientupdatetrans_t **transp);
-/*%<
- * Destroy dynamic update transaction identified by '*transp'.
- *
- * Requires:
- *
- *\li  '*transp' is a valid transaction ID.
- *
- *\li  The caller has received the UPDATEDONE event (either because the
- *     update completed or because dns_client_cancelupdate() was called).
- *
- * Ensures:
- *
- *\li  *transp == NULL.
- */
-
-isc_result_t
-dns_client_updaterec(dns_client_updateop_t op, const dns_name_t *owner,
-                    dns_rdatatype_t type, dns_rdata_t *source, dns_ttl_t ttl,
-                    dns_name_t *target, dns_rdataset_t *rdataset,
-                    dns_rdatalist_t *rdatalist, dns_rdata_t *rdata,
-                    isc_mem_t *mctx);
-/*%<
- * TBD
- */
-
-void
-dns_client_freeupdate(dns_name_t **namep);
-/*%<
- * TBD
- */
-
-isc_mem_t *
-dns_client_mctx(dns_client_t *client);
-
 ISC_LANG_ENDDECLS
 
 #endif /* DNS_CLIENT_H */
index 46bfe243b543a0d9e431560ef6c0d4e04ca97348..cc7261a19adb3c3fda683a4bebb6210a0af6c762 100644 (file)
@@ -137,25 +137,18 @@ dns_cert_totext
 dns_client_addtrustedkey
 dns_client_cancelrequest
 dns_client_cancelresolve
-dns_client_cancelupdate
 dns_client_clearservers
-dns_client_create
 dns_client_createx
 dns_client_destroy
 dns_client_destroyreqtrans
 dns_client_destroyrestrans
-dns_client_destroyupdatetrans
 dns_client_freeresanswer
-dns_client_freeupdate
 dns_client_mctx
 dns_client_request
 dns_client_resolve
 dns_client_setservers
 dns_client_startrequest
 dns_client_startresolve
-dns_client_startupdate
-dns_client_update
-dns_client_updaterec
 dns_clientinfo_init
 dns_clientinfomethods_init
 dns_compress_add
index b132e8906073c990ed72b0a462f66dcdb3a6822c..4359b42e9fc6422a6e28bb42df968c5c072c7d75 100644 (file)
@@ -4,5 +4,3 @@ process
 resolve
 sample-async
 sample-gai
-sample-request
-sample-update
diff --git a/lib/samples/sample-request.c b/lib/samples/sample-request.c
deleted file mode 100644 (file)
index c02b28c..0000000
+++ /dev/null
@@ -1,248 +0,0 @@
-/*
- * Copyright (C) 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 https://mozilla.org/MPL/2.0/.
- *
- * See the COPYRIGHT file distributed with this work for additional
- * information regarding copyright ownership.
- */
-
-#ifndef WIN32
-#include <arpa/inet.h>
-#include <netdb.h>
-#include <netinet/in.h>
-#include <sys/socket.h>
-#include <sys/types.h>
-#include <unistd.h>
-#endif /* ifndef WIN32 */
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-
-#include <isc/base64.h>
-#include <isc/buffer.h>
-#include <isc/commandline.h>
-#include <isc/lib.h>
-#include <isc/mem.h>
-#include <isc/print.h>
-#include <isc/sockaddr.h>
-#include <isc/util.h>
-
-#include <dns/client.h>
-#include <dns/fixedname.h>
-#include <dns/keyvalues.h>
-#include <dns/lib.h>
-#include <dns/masterdump.h>
-#include <dns/message.h>
-#include <dns/name.h>
-#include <dns/rdata.h>
-#include <dns/rdataset.h>
-#include <dns/rdatastruct.h>
-#include <dns/rdatatype.h>
-#include <dns/result.h>
-#include <dns/secalg.h>
-
-#include <dst/dst.h>
-
-static isc_mem_t *mctx;
-static dns_fixedname_t fixedqname;
-
-ISC_PLATFORM_NORETURN_PRE static void
-usage(void) ISC_PLATFORM_NORETURN_POST;
-
-static void
-usage(void) {
-       fprintf(stderr, "sample-request [-t RRtype] server_address hostname\n");
-
-       exit(1);
-}
-
-static isc_result_t
-make_querymessage(dns_message_t *message, const char *namestr,
-                 dns_rdatatype_t rdtype) {
-       dns_name_t *qname = NULL, *qname0;
-       dns_rdataset_t *qrdataset = NULL;
-       isc_result_t result;
-       isc_buffer_t b;
-       unsigned int namelen;
-
-       REQUIRE(message != NULL);
-       REQUIRE(namestr != NULL);
-
-       /* Construct qname */
-       namelen = strlen(namestr);
-       isc_buffer_constinit(&b, namestr, namelen);
-       isc_buffer_add(&b, namelen);
-       qname0 = dns_fixedname_initname(&fixedqname);
-       result = dns_name_fromtext(qname0, &b, dns_rootname, 0, NULL);
-       if (result != ISC_R_SUCCESS) {
-               fprintf(stderr, "failed to convert qname: %u\n", result);
-               return (result);
-       }
-
-       /* Construct query message */
-       message->opcode = dns_opcode_query;
-       message->rdclass = dns_rdataclass_in;
-
-       result = dns_message_gettempname(message, &qname);
-       if (result != ISC_R_SUCCESS) {
-               goto cleanup;
-       }
-
-       result = dns_message_gettemprdataset(message, &qrdataset);
-       if (result != ISC_R_SUCCESS) {
-               goto cleanup;
-       }
-
-       dns_name_init(qname, NULL);
-       dns_name_clone(qname0, qname);
-       dns_rdataset_makequestion(qrdataset, message->rdclass, rdtype);
-       ISC_LIST_APPEND(qname->list, qrdataset, link);
-       dns_message_addname(message, qname, DNS_SECTION_QUESTION);
-
-       return (ISC_R_SUCCESS);
-
-cleanup:
-       if (qname != NULL) {
-               dns_message_puttempname(message, &qname);
-       }
-       if (qrdataset != NULL) {
-               dns_message_puttemprdataset(message, &qrdataset);
-       }
-       dns_message_detach(&message);
-       return (result);
-}
-
-static void
-print_section(dns_message_t *message, int section, isc_buffer_t *buf) {
-       isc_result_t result;
-       isc_region_t r;
-
-       result = dns_message_sectiontotext(message, section,
-                                          &dns_master_style_full, 0, buf);
-       if (result != ISC_R_SUCCESS) {
-               goto fail;
-       }
-
-       isc_buffer_usedregion(buf, &r);
-       printf("%.*s", (int)r.length, (char *)r.base);
-
-       return;
-
-fail:
-       fprintf(stderr, "failed to convert a section\n");
-}
-
-int
-main(int argc, char *argv[]) {
-       int ch, i, gaierror;
-       struct addrinfo hints, *res;
-       isc_textregion_t tr;
-       dns_client_t *client = NULL;
-       isc_result_t result;
-       isc_sockaddr_t sa;
-       dns_message_t *qmessage, *rmessage;
-       dns_rdatatype_t type = dns_rdatatype_a;
-       isc_buffer_t *outputbuf;
-
-       while ((ch = isc_commandline_parse(argc, argv, "t:")) != -1) {
-               switch (ch) {
-               case 't':
-                       tr.base = isc_commandline_argument;
-                       tr.length = strlen(isc_commandline_argument);
-                       result = dns_rdatatype_fromtext(&type, &tr);
-                       if (result != ISC_R_SUCCESS) {
-                               fprintf(stderr, "invalid RRtype: %s\n",
-                                       isc_commandline_argument);
-                               exit(1);
-                       }
-                       break;
-               default:
-                       usage();
-               }
-       }
-
-       argc -= isc_commandline_index;
-       argv += isc_commandline_index;
-       if (argc < 2) {
-               usage();
-       }
-
-       isc_lib_register();
-       result = dns_lib_init();
-       if (result != ISC_R_SUCCESS) {
-               fprintf(stderr, "dns_lib_init failed: %u\n", result);
-               exit(1);
-       }
-
-       result = dns_client_create(&client, 0);
-       if (result != ISC_R_SUCCESS) {
-               fprintf(stderr, "dns_client_create failed: %u\n", result);
-               exit(1);
-       }
-
-       /* Prepare message structures */
-       mctx = NULL;
-       qmessage = NULL;
-       rmessage = NULL;
-
-       isc_mem_create(&mctx);
-       dns_message_create(mctx, DNS_MESSAGE_INTENTRENDER, &qmessage);
-       dns_message_create(mctx, DNS_MESSAGE_INTENTPARSE, &rmessage);
-
-       /* Initialize the nameserver address */
-       memset(&hints, 0, sizeof(hints));
-       hints.ai_family = AF_UNSPEC;
-       hints.ai_socktype = SOCK_DGRAM;
-       hints.ai_protocol = IPPROTO_UDP;
-#ifdef AI_NUMERICHOST
-       hints.ai_flags = AI_NUMERICHOST;
-#endif /* ifdef AI_NUMERICHOST */
-       gaierror = getaddrinfo(argv[0], "53", &hints, &res);
-       if (gaierror != 0) {
-               fprintf(stderr, "getaddrinfo failed: %s\n",
-                       gai_strerror(gaierror));
-               exit(1);
-       }
-       INSIST(res->ai_addrlen <= sizeof(sa.type));
-       memmove(&sa.type, res->ai_addr, res->ai_addrlen);
-       freeaddrinfo(res);
-       sa.length = (unsigned int)res->ai_addrlen;
-       ISC_LINK_INIT(&sa, link);
-
-       /* Construct qname */
-       result = make_querymessage(qmessage, argv[1], type);
-       if (result != ISC_R_SUCCESS) {
-               fprintf(stderr, "failed to create a query\n");
-               exit(1);
-       }
-
-       /* Send request and wait for a response */
-       result = dns_client_request(client, qmessage, rmessage, &sa, 0, 0, NULL,
-                                   60, 0, 3);
-       if (result != ISC_R_SUCCESS) {
-               fprintf(stderr, "failed to get a response: %s\n",
-                       dns_result_totext(result));
-       }
-
-       /* Dump the response */
-       outputbuf = NULL;
-       isc_buffer_allocate(mctx, &outputbuf, 65535);
-       for (i = 0; i < DNS_SECTION_MAX; i++) {
-               print_section(rmessage, i, outputbuf);
-               isc_buffer_clear(outputbuf);
-       }
-       isc_buffer_free(&outputbuf);
-
-       /* Cleanup */
-       dns_message_detach(&qmessage);
-       dns_message_detach(&rmessage);
-       isc_mem_destroy(&mctx);
-       dns_client_destroy(&client);
-       dns_lib_shutdown();
-
-       return (0);
-}
diff --git a/lib/samples/sample-update.c b/lib/samples/sample-update.c
deleted file mode 100644 (file)
index 8b5c2fb..0000000
+++ /dev/null
@@ -1,780 +0,0 @@
-/*
- * Copyright (C) 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 https://mozilla.org/MPL/2.0/.
- *
- * See the COPYRIGHT file distributed with this work for additional
- * information regarding copyright ownership.
- */
-
-#ifndef WIN32
-#include <arpa/inet.h>
-#include <netdb.h>
-#include <netinet/in.h>
-#include <sys/socket.h>
-#include <sys/types.h>
-#include <unistd.h>
-#endif /* ifndef WIN32 */
-
-#include <ctype.h>
-#include <inttypes.h>
-#include <stdbool.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-
-#include <isc/buffer.h>
-#include <isc/commandline.h>
-#include <isc/lex.h>
-#include <isc/lib.h>
-#include <isc/mem.h>
-#include <isc/parseint.h>
-#include <isc/print.h>
-#include <isc/sockaddr.h>
-#include <isc/string.h>
-#include <isc/util.h>
-
-#include <dns/callbacks.h>
-#include <dns/client.h>
-#include <dns/fixedname.h>
-#include <dns/lib.h>
-#include <dns/name.h>
-#include <dns/rdata.h>
-#include <dns/rdataclass.h>
-#include <dns/rdatalist.h>
-#include <dns/rdataset.h>
-#include <dns/rdatastruct.h>
-#include <dns/rdatatype.h>
-#include <dns/result.h>
-#include <dns/secalg.h>
-#include <dns/tsec.h>
-
-#include <dst/dst.h>
-
-static dns_tsec_t *tsec = NULL;
-static const dns_rdataclass_t default_rdataclass = dns_rdataclass_in;
-static isc_bufferlist_t usedbuffers;
-static ISC_LIST(dns_rdatalist_t) usedrdatalists;
-
-static const char *port = "53";
-
-static void
-setup_tsec(char *keyfile, isc_mem_t *mctx);
-static void
-update_addordelete(isc_mem_t *mctx, char *cmdline, bool isdelete,
-                  dns_name_t *name);
-static void
-evaluate_prereq(isc_mem_t *mctx, char *cmdline, dns_name_t *name);
-
-ISC_PLATFORM_NORETURN_PRE static void
-usage(void) ISC_PLATFORM_NORETURN_POST;
-
-static void
-usage(void) {
-       fprintf(stderr, "sample-update "
-                       "-s "
-                       "[-a auth_server] "
-                       "[-k keyfile] "
-                       "[-p prerequisite] "
-                       "[-r recursive_server] "
-                       "[-z zonename] "
-                       "(add|delete) \"name TTL RRtype RDATA\"\n");
-       exit(1);
-}
-
-#ifdef _WIN32
-static void
-InitSockets(void) {
-       WORD wVersionRequested;
-       WSADATA wsaData;
-       int err;
-
-       wVersionRequested = MAKEWORD(2, 0);
-
-       err = WSAStartup(wVersionRequested, &wsaData);
-       if (err != 0) {
-               fprintf(stderr, "WSAStartup() failed: %d\n", err);
-               exit(1);
-       }
-}
-
-static void
-DestroySockets(void) {
-       WSACleanup();
-}
-#else /* ifdef _WIN32 */
-#define InitSockets()   ((void)0)
-#define DestroySockets() ((void)0)
-#endif /* ifdef _WIN32 */
-
-static bool
-addserver(const char *server, isc_sockaddrlist_t *list,
-         isc_sockaddr_t *sockaddr) {
-       struct addrinfo hints, *res;
-       int gaierror;
-
-       memset(&hints, 0, sizeof(hints));
-       hints.ai_family = AF_UNSPEC;
-       hints.ai_socktype = SOCK_DGRAM;
-       hints.ai_protocol = IPPROTO_UDP;
-#ifdef AI_NUMERICHOST
-       hints.ai_flags |= AI_NUMERICHOST;
-#endif /* ifdef AI_NUMERICHOST */
-#ifdef AI_NUMERICSERV
-       hints.ai_flags |= AI_NUMERICSERV;
-#endif /* ifdef AI_NUMERICSERV */
-       InitSockets();
-       gaierror = getaddrinfo(server, port, &hints, &res);
-       if (gaierror != 0) {
-               fprintf(stderr, "getaddrinfo(%s) failed: %s\n", server,
-                       gai_strerror(gaierror));
-               DestroySockets();
-               return (false);
-       }
-       INSIST(res->ai_addrlen <= sizeof(sockaddr->type));
-       memmove(&sockaddr->type, res->ai_addr, res->ai_addrlen);
-       sockaddr->length = (unsigned int)res->ai_addrlen;
-       ISC_LINK_INIT(sockaddr, link);
-       ISC_LIST_APPEND(*list, sockaddr, link);
-       freeaddrinfo(res);
-       DestroySockets();
-       return (true);
-}
-
-int
-main(int argc, char *argv[]) {
-       int ch;
-       dns_client_t *client = NULL;
-       char *zonenamestr = NULL;
-       char *keyfilename = NULL;
-       char *prereqstr = NULL;
-       isc_sockaddr_t sa_auth[10], sa_recursive[10];
-       unsigned int nsa_auth = 0, nsa_recursive = 0;
-       isc_sockaddrlist_t rec_servers;
-       isc_sockaddrlist_t auth_servers, *auth_serversp = &auth_servers;
-       isc_result_t result;
-       bool isdelete;
-       isc_buffer_t b, *buf;
-       dns_fixedname_t zname0, pname0, uname0;
-       unsigned int namelen;
-       dns_name_t *zname = NULL, *uname, *pname;
-       dns_rdataset_t *rdataset;
-       dns_rdatalist_t *rdatalist;
-       dns_rdata_t *rdata;
-       dns_namelist_t updatelist, prereqlist, *prereqlistp = NULL;
-       isc_mem_t *umctx = NULL;
-       bool sendtwice = false;
-
-       ISC_LIST_INIT(auth_servers);
-       ISC_LIST_INIT(rec_servers);
-
-       while ((ch = isc_commandline_parse(argc, argv, "a:k:p:P:r:sz:")) != EOF)
-       {
-               switch (ch) {
-               case 'k':
-                       keyfilename = isc_commandline_argument;
-                       break;
-               case 'a':
-                       if (nsa_auth < sizeof(sa_auth) / sizeof(*sa_auth) &&
-                           addserver(isc_commandline_argument, &auth_servers,
-                                     &sa_auth[nsa_auth]))
-                       {
-                               nsa_auth++;
-                       }
-                       break;
-               case 'p':
-                       prereqstr = isc_commandline_argument;
-                       break;
-               case 'P':
-                       port = isc_commandline_argument;
-                       break;
-               case 'r':
-                       if (nsa_recursive < sizeof(sa_recursive) /
-                                                   sizeof(*sa_recursive) &&
-                           addserver(isc_commandline_argument, &rec_servers,
-                                     &sa_recursive[nsa_recursive]))
-                       {
-                               nsa_recursive++;
-                       }
-                       break;
-               case 's':
-                       sendtwice = true;
-                       break;
-               case 'z':
-                       zonenamestr = isc_commandline_argument;
-                       break;
-               default:
-                       usage();
-               }
-       }
-
-       argc -= isc_commandline_index;
-       argv += isc_commandline_index;
-       if (argc < 2) {
-               usage();
-       }
-
-       /* command line argument validation */
-       if (strcmp(argv[0], "delete") == 0) {
-               isdelete = true;
-       } else if (strcmp(argv[0], "add") == 0) {
-               isdelete = false;
-       } else {
-               fprintf(stderr, "invalid update command: %s\n", argv[0]);
-               exit(1);
-       }
-
-       if (ISC_LIST_HEAD(auth_servers) == NULL &&
-           ISC_LIST_HEAD(rec_servers) == NULL) {
-               fprintf(stderr, "authoritative or recursive servers "
-                               "must be specified\n");
-               usage();
-       }
-
-       /* Initialization */
-       ISC_LIST_INIT(usedbuffers);
-       ISC_LIST_INIT(usedrdatalists);
-       ISC_LIST_INIT(prereqlist);
-       isc_lib_register();
-       result = dns_lib_init();
-       if (result != ISC_R_SUCCESS) {
-               fprintf(stderr, "dns_lib_init failed: %u\n", result);
-               exit(1);
-       }
-       isc_mem_create(&umctx);
-
-       result = dns_client_create(&client, 0);
-       if (result != ISC_R_SUCCESS) {
-               fprintf(stderr, "dns_client_create failed: %u\n", result);
-               exit(1);
-       }
-
-       /* Construct zone name */
-       zname = NULL;
-       if (zonenamestr != NULL) {
-               namelen = strlen(zonenamestr);
-               isc_buffer_init(&b, zonenamestr, namelen);
-               isc_buffer_add(&b, namelen);
-               zname = dns_fixedname_initname(&zname0);
-               result = dns_name_fromtext(zname, &b, dns_rootname, 0, NULL);
-               if (result != ISC_R_SUCCESS) {
-                       fprintf(stderr, "failed to convert zone name: %u\n",
-                               result);
-               }
-       }
-
-       /* Construct prerequisite name (if given) */
-       if (prereqstr != NULL) {
-               pname = dns_fixedname_initname(&pname0);
-               evaluate_prereq(umctx, prereqstr, pname);
-               ISC_LIST_APPEND(prereqlist, pname, link);
-               prereqlistp = &prereqlist;
-       }
-
-       /* Construct update name */
-       ISC_LIST_INIT(updatelist);
-       uname = dns_fixedname_initname(&uname0);
-       update_addordelete(umctx, argv[1], isdelete, uname);
-       ISC_LIST_APPEND(updatelist, uname, link);
-
-       /* Set up TSIG/SIG(0) key (if given) */
-       if (keyfilename != NULL) {
-               setup_tsec(keyfilename, umctx);
-       }
-
-       if (ISC_LIST_HEAD(auth_servers) == NULL) {
-               auth_serversp = NULL;
-       }
-
-       /* Perform update */
-       result = dns_client_update(client, default_rdataclass, /* XXX: fixed */
-                                  zname, prereqlistp, &updatelist,
-                                  auth_serversp, tsec, 0);
-       if (result != ISC_R_SUCCESS) {
-               fprintf(stderr, "update failed: %s\n",
-                       dns_result_totext(result));
-       } else {
-               fprintf(stderr, "update succeeded\n");
-       }
-
-       if (sendtwice) {
-               /* Perform 2nd update */
-               result = dns_client_update(client, default_rdataclass, /* XXX:
-                                                                       * fixed
-                                                                       */
-                                          zname, prereqlistp, &updatelist,
-                                          auth_serversp, tsec, 0);
-               if (result != ISC_R_SUCCESS) {
-                       fprintf(stderr, "2nd update failed: %s\n",
-                               dns_result_totext(result));
-               } else {
-                       fprintf(stderr, "2nd update succeeded\n");
-               }
-       }
-
-       /* Cleanup */
-       while ((pname = ISC_LIST_HEAD(prereqlist)) != NULL) {
-               while ((rdataset = ISC_LIST_HEAD(pname->list)) != NULL) {
-                       ISC_LIST_UNLINK(pname->list, rdataset, link);
-                       dns_rdataset_disassociate(rdataset);
-                       isc_mem_put(umctx, rdataset, sizeof(*rdataset));
-               }
-               ISC_LIST_UNLINK(prereqlist, pname, link);
-       }
-       while ((uname = ISC_LIST_HEAD(updatelist)) != NULL) {
-               while ((rdataset = ISC_LIST_HEAD(uname->list)) != NULL) {
-                       ISC_LIST_UNLINK(uname->list, rdataset, link);
-                       dns_rdataset_disassociate(rdataset);
-                       isc_mem_put(umctx, rdataset, sizeof(*rdataset));
-               }
-               ISC_LIST_UNLINK(updatelist, uname, link);
-       }
-       while ((rdatalist = ISC_LIST_HEAD(usedrdatalists)) != NULL) {
-               while ((rdata = ISC_LIST_HEAD(rdatalist->rdata)) != NULL) {
-                       ISC_LIST_UNLINK(rdatalist->rdata, rdata, link);
-                       isc_mem_put(umctx, rdata, sizeof(*rdata));
-               }
-               ISC_LIST_UNLINK(usedrdatalists, rdatalist, link);
-               isc_mem_put(umctx, rdatalist, sizeof(*rdatalist));
-       }
-       while ((buf = ISC_LIST_HEAD(usedbuffers)) != NULL) {
-               ISC_LIST_UNLINK(usedbuffers, buf, link);
-               isc_buffer_free(&buf);
-       }
-       if (tsec != NULL) {
-               dns_tsec_destroy(&tsec);
-       }
-       isc_mem_destroy(&umctx);
-       dns_client_destroy(&client);
-       dns_lib_shutdown();
-
-       return (0);
-}
-
-/*
- *  Subroutines borrowed from nsupdate.c
- */
-#define MAXWIRE (64 * 1024)
-#define TTL_MAX 2147483647U /* Maximum signed 32 bit integer. */
-
-static char *
-nsu_strsep(char **stringp, const char *delim) {
-       char *string = *stringp;
-       char *s;
-       const char *d;
-       char sc, dc;
-
-       if (string == NULL) {
-               return (NULL);
-       }
-
-       for (; *string != '\0'; string++) {
-               sc = *string;
-               for (d = delim; (dc = *d) != '\0'; d++) {
-                       if (sc == dc) {
-                               break;
-                       }
-               }
-               if (dc == 0) {
-                       break;
-               }
-       }
-
-       for (s = string; *s != '\0'; s++) {
-               sc = *s;
-               for (d = delim; (dc = *d) != '\0'; d++) {
-                       if (sc == dc) {
-                               *s++ = '\0';
-                               *stringp = s;
-                               return (string);
-                       }
-               }
-       }
-       *stringp = NULL;
-       return (string);
-}
-
-static void
-fatal(const char *format, ...) {
-       va_list args;
-
-       va_start(args, format);
-       vfprintf(stderr, format, args);
-       va_end(args);
-       fprintf(stderr, "\n");
-       exit(1);
-}
-
-static inline void
-check_result(isc_result_t result, const char *msg) {
-       if (result != ISC_R_SUCCESS) {
-               fatal("%s: %s", msg, isc_result_totext(result));
-       }
-}
-
-static void
-parse_name(char **cmdlinep, dns_name_t *name) {
-       isc_result_t result;
-       char *word;
-       isc_buffer_t source;
-
-       word = nsu_strsep(cmdlinep, " \t\r\n");
-       if (word == NULL || *word == 0) {
-               fprintf(stderr, "could not read owner name\n");
-               exit(1);
-       }
-
-       isc_buffer_init(&source, word, strlen(word));
-       isc_buffer_add(&source, strlen(word));
-       result = dns_name_fromtext(name, &source, dns_rootname, 0, NULL);
-       check_result(result, "dns_name_fromtext");
-       isc_buffer_invalidate(&source);
-}
-
-static void
-parse_rdata(isc_mem_t *mctx, char **cmdlinep, dns_rdataclass_t rdataclass,
-           dns_rdatatype_t rdatatype, dns_rdata_t *rdata) {
-       char *cmdline = *cmdlinep;
-       isc_buffer_t source, *buf = NULL, *newbuf = NULL;
-       isc_region_t r;
-       isc_lex_t *lex = NULL;
-       dns_rdatacallbacks_t callbacks;
-       isc_result_t result;
-
-       while (cmdline != NULL && *cmdline != 0 &&
-              isspace((unsigned char)*cmdline)) {
-               cmdline++;
-       }
-
-       if (cmdline != NULL && *cmdline != 0) {
-               dns_rdatacallbacks_init(&callbacks);
-               result = isc_lex_create(mctx, strlen(cmdline), &lex);
-               check_result(result, "isc_lex_create");
-               isc_buffer_init(&source, cmdline, strlen(cmdline));
-               isc_buffer_add(&source, strlen(cmdline));
-               result = isc_lex_openbuffer(lex, &source);
-               check_result(result, "isc_lex_openbuffer");
-               isc_buffer_allocate(mctx, &buf, MAXWIRE);
-               result = dns_rdata_fromtext(rdata, rdataclass, rdatatype, lex,
-                                           dns_rootname, 0, mctx, buf,
-                                           &callbacks);
-               isc_lex_destroy(&lex);
-               if (result == ISC_R_SUCCESS) {
-                       isc_buffer_usedregion(buf, &r);
-                       isc_buffer_allocate(mctx, &newbuf, r.length);
-                       isc_buffer_putmem(newbuf, r.base, r.length);
-                       isc_buffer_usedregion(newbuf, &r);
-                       dns_rdata_reset(rdata);
-                       dns_rdata_fromregion(rdata, rdataclass, rdatatype, &r);
-                       isc_buffer_free(&buf);
-                       ISC_LIST_APPEND(usedbuffers, newbuf, link);
-               } else {
-                       fprintf(stderr, "invalid rdata format: %s\n",
-                               isc_result_totext(result));
-                       isc_buffer_free(&buf);
-                       exit(1);
-               }
-       } else {
-               rdata->flags = DNS_RDATA_UPDATE;
-       }
-       *cmdlinep = cmdline;
-}
-
-static void
-update_addordelete(isc_mem_t *mctx, char *cmdline, bool isdelete,
-                  dns_name_t *name) {
-       isc_result_t result;
-       uint32_t ttl;
-       char *word;
-       dns_rdataclass_t rdataclass;
-       dns_rdatatype_t rdatatype;
-       dns_rdata_t *rdata = NULL;
-       dns_rdatalist_t *rdatalist = NULL;
-       dns_rdataset_t *rdataset = NULL;
-       isc_textregion_t region;
-
-       /*
-        * Read the owner name.
-        */
-       parse_name(&cmdline, name);
-
-       rdata = isc_mem_get(mctx, sizeof(*rdata));
-       dns_rdata_init(rdata);
-
-       /*
-        * If this is an add, read the TTL and verify that it's in range.
-        * If it's a delete, ignore a TTL if present (for compatibility).
-        */
-       word = nsu_strsep(&cmdline, " \t\r\n");
-       if (word == NULL || *word == 0) {
-               if (!isdelete) {
-                       fprintf(stderr, "could not read owner ttl\n");
-                       exit(1);
-               } else {
-                       ttl = 0;
-                       rdataclass = dns_rdataclass_any;
-                       rdatatype = dns_rdatatype_any;
-                       rdata->flags = DNS_RDATA_UPDATE;
-                       goto doneparsing;
-               }
-       }
-       result = isc_parse_uint32(&ttl, word, 10);
-       if (result != ISC_R_SUCCESS) {
-               if (isdelete) {
-                       ttl = 0;
-                       goto parseclass;
-               } else {
-                       fprintf(stderr, "ttl '%s': %s\n", word,
-                               isc_result_totext(result));
-                       exit(1);
-               }
-       }
-
-       if (isdelete) {
-               ttl = 0;
-       } else if (ttl > TTL_MAX) {
-               fprintf(stderr, "ttl '%s' is out of range (0 to %u)\n", word,
-                       TTL_MAX);
-               exit(1);
-       }
-
-       /*
-        * Read the class or type.
-        */
-       word = nsu_strsep(&cmdline, " \t\r\n");
-parseclass:
-       if (word == NULL || *word == 0) {
-               if (isdelete) {
-                       rdataclass = dns_rdataclass_any;
-                       rdatatype = dns_rdatatype_any;
-                       rdata->flags = DNS_RDATA_UPDATE;
-                       goto doneparsing;
-               } else {
-                       fprintf(stderr, "could not read class or type\n");
-                       exit(1);
-               }
-       }
-       region.base = word;
-       region.length = strlen(word);
-       result = dns_rdataclass_fromtext(&rdataclass, &region);
-       if (result == ISC_R_SUCCESS) {
-               /*
-                * Now read the type.
-                */
-               word = nsu_strsep(&cmdline, " \t\r\n");
-               if (word == NULL || *word == 0) {
-                       if (isdelete) {
-                               rdataclass = dns_rdataclass_any;
-                               rdatatype = dns_rdatatype_any;
-                               rdata->flags = DNS_RDATA_UPDATE;
-                               goto doneparsing;
-                       } else {
-                               fprintf(stderr, "could not read type\n");
-                               exit(1);
-                       }
-               }
-               region.base = word;
-               region.length = strlen(word);
-               result = dns_rdatatype_fromtext(&rdatatype, &region);
-               if (result != ISC_R_SUCCESS) {
-                       fprintf(stderr, "'%s' is not a valid type: %s\n", word,
-                               isc_result_totext(result));
-                       exit(1);
-               }
-       } else {
-               rdataclass = default_rdataclass;
-               result = dns_rdatatype_fromtext(&rdatatype, &region);
-               if (result != ISC_R_SUCCESS) {
-                       fprintf(stderr,
-                               "'%s' is not a valid class or type: "
-                               "%s\n",
-                               word, isc_result_totext(result));
-                       exit(1);
-               }
-       }
-
-       parse_rdata(mctx, &cmdline, rdataclass, rdatatype, rdata);
-
-       if (isdelete) {
-               if ((rdata->flags & DNS_RDATA_UPDATE) != 0) {
-                       rdataclass = dns_rdataclass_any;
-               } else {
-                       rdataclass = dns_rdataclass_none;
-               }
-       } else {
-               if ((rdata->flags & DNS_RDATA_UPDATE) != 0) {
-                       fprintf(stderr, "could not read rdata\n");
-                       exit(1);
-               }
-       }
-
-doneparsing:
-
-       rdatalist = isc_mem_get(mctx, sizeof(*rdatalist));
-       dns_rdatalist_init(rdatalist);
-       rdatalist->type = rdatatype;
-       rdatalist->rdclass = rdataclass;
-       rdatalist->covers = rdatatype;
-       rdatalist->ttl = (dns_ttl_t)ttl;
-       ISC_LIST_APPEND(rdatalist->rdata, rdata, link);
-       ISC_LIST_APPEND(usedrdatalists, rdatalist, link);
-
-       rdataset = isc_mem_get(mctx, sizeof(*rdataset));
-       dns_rdataset_init(rdataset);
-       dns_rdatalist_tordataset(rdatalist, rdataset);
-       dns_rdataset_setownercase(rdataset, name);
-       ISC_LIST_INIT(name->list);
-       ISC_LIST_APPEND(name->list, rdataset, link);
-}
-
-static void
-make_prereq(isc_mem_t *mctx, char *cmdline, bool ispositive, bool isrrset,
-           dns_name_t *name) {
-       isc_result_t result;
-       char *word;
-       isc_textregion_t region;
-       dns_rdataset_t *rdataset = NULL;
-       dns_rdatalist_t *rdatalist = NULL;
-       dns_rdataclass_t rdataclass;
-       dns_rdatatype_t rdatatype;
-       dns_rdata_t *rdata = NULL;
-
-       /*
-        * Read the owner name
-        */
-       parse_name(&cmdline, name);
-
-       /*
-        * If this is an rrset prereq, read the class or type.
-        */
-       if (isrrset) {
-               word = nsu_strsep(&cmdline, " \t\r\n");
-               if (word == NULL || *word == 0) {
-                       fprintf(stderr, "could not read class or type\n");
-                       exit(1);
-               }
-               region.base = word;
-               region.length = strlen(word);
-               result = dns_rdataclass_fromtext(&rdataclass, &region);
-               if (result == ISC_R_SUCCESS) {
-                       /*
-                        * Now read the type.
-                        */
-                       word = nsu_strsep(&cmdline, " \t\r\n");
-                       if (word == NULL || *word == 0) {
-                               fprintf(stderr, "could not read type\n");
-                               exit(1);
-                       }
-                       region.base = word;
-                       region.length = strlen(word);
-                       result = dns_rdatatype_fromtext(&rdatatype, &region);
-                       if (result != ISC_R_SUCCESS) {
-                               fprintf(stderr, "invalid type: %s\n", word);
-                               exit(1);
-                       }
-               } else {
-                       rdataclass = default_rdataclass;
-                       result = dns_rdatatype_fromtext(&rdatatype, &region);
-                       if (result != ISC_R_SUCCESS) {
-                               fprintf(stderr, "invalid type: %s\n", word);
-                               exit(1);
-                       }
-               }
-       } else {
-               rdatatype = dns_rdatatype_any;
-       }
-
-       rdata = isc_mem_get(mctx, sizeof(*rdata));
-       dns_rdata_init(rdata);
-
-       if (isrrset && ispositive) {
-               parse_rdata(mctx, &cmdline, rdataclass, rdatatype, rdata);
-       } else {
-               rdata->flags = DNS_RDATA_UPDATE;
-       }
-
-       rdatalist = isc_mem_get(mctx, sizeof(*rdatalist));
-       dns_rdatalist_init(rdatalist);
-       rdatalist->type = rdatatype;
-       if (ispositive) {
-               if (isrrset && rdata->data != NULL) {
-                       rdatalist->rdclass = rdataclass;
-               } else {
-                       rdatalist->rdclass = dns_rdataclass_any;
-               }
-       } else {
-               rdatalist->rdclass = dns_rdataclass_none;
-       }
-       rdata->rdclass = rdatalist->rdclass;
-       rdata->type = rdatatype;
-       ISC_LIST_APPEND(rdatalist->rdata, rdata, link);
-       ISC_LIST_APPEND(usedrdatalists, rdatalist, link);
-
-       rdataset = isc_mem_get(mctx, sizeof(*rdataset));
-       dns_rdataset_init(rdataset);
-       dns_rdatalist_tordataset(rdatalist, rdataset);
-       dns_rdataset_setownercase(rdataset, name);
-       ISC_LIST_INIT(name->list);
-       ISC_LIST_APPEND(name->list, rdataset, link);
-}
-
-static void
-evaluate_prereq(isc_mem_t *mctx, char *cmdline, dns_name_t *name) {
-       char *word;
-       bool ispositive, isrrset;
-
-       word = nsu_strsep(&cmdline, " \t\r\n");
-       if (word == NULL || *word == 0) {
-               fprintf(stderr, "could not read operation code\n");
-               exit(1);
-       }
-       if (strcasecmp(word, "nxdomain") == 0) {
-               ispositive = false;
-               isrrset = false;
-       } else if (strcasecmp(word, "yxdomain") == 0) {
-               ispositive = true;
-               isrrset = false;
-       } else if (strcasecmp(word, "nxrrset") == 0) {
-               ispositive = false;
-               isrrset = true;
-       } else if (strcasecmp(word, "yxrrset") == 0) {
-               ispositive = true;
-               isrrset = true;
-       } else {
-               fprintf(stderr, "incorrect operation code: %s\n", word);
-               exit(1);
-       }
-
-       make_prereq(mctx, cmdline, ispositive, isrrset, name);
-}
-
-static void
-setup_tsec(char *keyfile, isc_mem_t *mctx) {
-       dst_key_t *dstkey = NULL;
-       isc_result_t result;
-       dns_tsectype_t tsectype;
-
-       result = dst_key_fromnamedfile(
-               keyfile, NULL, DST_TYPE_PRIVATE | DST_TYPE_KEY, mctx, &dstkey);
-       if (result != ISC_R_SUCCESS) {
-               fprintf(stderr, "could not read key from %s: %s\n", keyfile,
-                       isc_result_totext(result));
-               exit(1);
-       }
-
-       if (dst_key_alg(dstkey) == DST_ALG_HMACMD5) {
-               tsectype = dns_tsectype_tsig;
-       } else {
-               tsectype = dns_tsectype_sig0;
-       }
-
-       result = dns_tsec_create(mctx, tsectype, dstkey, &tsec);
-       dst_key_free(&dstkey);
-       if (result != ISC_R_SUCCESS) {
-               fprintf(stderr, "could not create tsec: %s\n",
-                       isc_result_totext(result));
-               exit(1);
-       }
-}
diff --git a/lib/samples/win32/request.vcxproj.filters.in b/lib/samples/win32/request.vcxproj.filters.in
deleted file mode 100644 (file)
index 9edd41d..0000000
+++ /dev/null
@@ -1,22 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
-  <ItemGroup>
-    <Filter Include="Source Files">
-      <UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
-      <Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
-    </Filter>
-    <Filter Include="Header Files">
-      <UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
-      <Extensions>h;hpp;hxx;hm;inl;inc;xsd</Extensions>
-    </Filter>
-    <Filter Include="Resource Files">
-      <UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier>
-      <Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms</Extensions>
-    </Filter>
-  </ItemGroup>
-  <ItemGroup>
-    <ClCompile Include="..\sample-request.c">
-      <Filter>Source Files</Filter>
-    </ClCompile>
-  </ItemGroup>
-</Project>
\ No newline at end of file
diff --git a/lib/samples/win32/request.vcxproj.in b/lib/samples/win32/request.vcxproj.in
deleted file mode 100644 (file)
index 6b25eda..0000000
+++ /dev/null
@@ -1,119 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<Project DefaultTargets="Build" ToolsVersion="@TOOLS_VERSION@" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
-  <ItemGroup Label="ProjectConfigurations">
-    <ProjectConfiguration Include="Debug|@PLATFORM@">
-      <Configuration>Debug</Configuration>
-      <Platform>@PLATFORM@</Platform>
-    </ProjectConfiguration>
-    <ProjectConfiguration Include="Release|@PLATFORM@">
-      <Configuration>Release</Configuration>
-      <Platform>@PLATFORM@</Platform>
-    </ProjectConfiguration>
-  </ItemGroup>
-  <PropertyGroup Label="Globals">
-    <ProjectGuid>{FF440E85-7450-439C-82EE-04C464512D0E}</ProjectGuid>
-    <Keyword>Win32Proj</Keyword>
-    <RootNamespace>request</RootNamespace>
-    @WINDOWS_TARGET_PLATFORM_VERSION@
-  </PropertyGroup>
-  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|@PLATFORM@'" Label="Configuration">
-    <ConfigurationType>Application</ConfigurationType>
-    <UseDebugLibraries>true</UseDebugLibraries>
-    <CharacterSet>MultiByte</CharacterSet>
-    @PLATFORM_TOOLSET@
-  </PropertyGroup>
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|@PLATFORM@'" Label="Configuration">
-    <ConfigurationType>Application</ConfigurationType>
-    <UseDebugLibraries>false</UseDebugLibraries>
-    <WholeProgramOptimization>true</WholeProgramOptimization>
-    <CharacterSet>MultiByte</CharacterSet>
-    @PLATFORM_TOOLSET@
-  </PropertyGroup>
-  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
-  <ImportGroup Label="ExtensionSettings">
-  </ImportGroup>
-  <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|@PLATFORM@'">
-    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
-  </ImportGroup>
-  <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|@PLATFORM@'">
-    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
-  </ImportGroup>
-  <PropertyGroup Label="UserMacros" />
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|@PLATFORM@'">
-    <LinkIncremental>true</LinkIncremental>
-    <OutDir>..\..\..\Build\$(Configuration)\</OutDir>
-    <IntDir>.\$(Configuration)\</IntDir>
-    <IntDirSharingDetected>None</IntDirSharingDetected>
-  </PropertyGroup>
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|@PLATFORM@'">
-    <LinkIncremental>false</LinkIncremental>
-    <OutDir>..\..\..\Build\$(Configuration)\</OutDir>
-    <IntDir>.\$(Configuration)\</IntDir>
-    <IntDirSharingDetected>None</IntDirSharingDetected>
-  </PropertyGroup>
-  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|@PLATFORM@'">
-    <ClCompile>
-      <PrecompiledHeader>
-      </PrecompiledHeader>
-      <WarningLevel>Level4</WarningLevel>
-      <TreatWarningAsError>false</TreatWarningAsError>
-      <Optimization>Disabled</Optimization>
-      <PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <FunctionLevelLinking>true</FunctionLevelLinking>
-      <PrecompiledHeaderOutputFile>.\$(Configuration)\$(TargetName).pch</PrecompiledHeaderOutputFile>
-      <AssemblerListingLocation>.\$(Configuration)\</AssemblerListingLocation>
-      <ObjectFileName>.\$(Configuration)\</ObjectFileName>
-      <ProgramDataBaseFileName>$(OutDir)$(TargetName).pdb</ProgramDataBaseFileName>
-      <BrowseInformation>true</BrowseInformation>
-      <ForcedIncludeFiles>..\..\..\config.h</ForcedIncludeFiles>
-      <AdditionalIncludeDirectories>.\;..\..\..\;@LIBXML2_INC@@OPENSSL_INC@..\..\isc\win32;..\..\isc\win32\include;..\..\isc\include;..\..\dns\win32\include;..\..\dns\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
-      <CompileAs>CompileAsC</CompileAs>
-    </ClCompile>
-    <Link>
-      <SubSystem>Console</SubSystem>
-      <GenerateDebugInformation>true</GenerateDebugInformation>
-      <OutputFile>..\..\..\Build\$(Configuration)\$(TargetName)$(TargetExt)</OutputFile>
-      <AdditionalLibraryDirectories>..\..\isc\win32\$(Configuration);..\..\dns\win32\$(Configuration);..\..\isccfg\win32\$(Configuration);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
-      <AdditionalDependencies>@OPENSSL_LIBCRYPTO@@OPENSSL_LIBSSL@libisc.lib;libdns.lib;libisccfg.lib;ws2_32.lib;%(AdditionalDependencies)</AdditionalDependencies>
-    </Link>
-  </ItemDefinitionGroup>
-  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|@PLATFORM@'">
-    <ClCompile>
-      <WarningLevel>Level1</WarningLevel>
-      <TreatWarningAsError>true</TreatWarningAsError>
-      <PrecompiledHeader>
-      </PrecompiledHeader>
-      <Optimization>MaxSpeed</Optimization>
-      <FunctionLevelLinking>true</FunctionLevelLinking>
-      <IntrinsicFunctions>@INTRINSIC@</IntrinsicFunctions>
-      <PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion>
-      <WholeProgramOptimization>false</WholeProgramOptimization>
-      <StringPooling>true</StringPooling>
-      <PrecompiledHeaderOutputFile>.\$(Configuration)\$(TargetName).pch</PrecompiledHeaderOutputFile>
-      <AssemblerListingLocation>.\$(Configuration)\</AssemblerListingLocation>
-      <ObjectFileName>.\$(Configuration)\</ObjectFileName>
-      <ProgramDataBaseFileName>$(OutDir)$(TargetName).pdb</ProgramDataBaseFileName>
-      <ForcedIncludeFiles>..\..\..\config.h</ForcedIncludeFiles>
-      <AdditionalIncludeDirectories>.\;..\..\..\;@LIBXML2_INC@@OPENSSL_INC@..\..\isc\win32;..\..\isc\win32\include;..\..\isc\include;..\..\dns\win32\include;..\..\dns\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
-      <CompileAs>CompileAsC</CompileAs>
-    </ClCompile>
-    <Link>
-      <SubSystem>Console</SubSystem>
-      <GenerateDebugInformation>false</GenerateDebugInformation>
-      <EnableCOMDATFolding>true</EnableCOMDATFolding>
-      <OptimizeReferences>true</OptimizeReferences>
-      <OutputFile>..\..\..\Build\$(Configuration)\$(TargetName)$(TargetExt)</OutputFile>
-      <LinkTimeCodeGeneration>Default</LinkTimeCodeGeneration>
-      <AdditionalLibraryDirectories>..\..\isc\win32\$(Configuration);..\..\dns\win32\$(Configuration);..\..\isccfg\win32\$(Configuration);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
-      <AdditionalDependencies>@OPENSSL_LIBCRYPTO@@OPENSSL_LIBSSL@libisc.lib;libdns.lib;libisccfg.lib;ws2_32.lib;%(AdditionalDependencies)</AdditionalDependencies>
-    </Link>
-  </ItemDefinitionGroup>
-  <ItemGroup>
-    <ClCompile Include="..\sample-request.c" />
-  </ItemGroup>
-  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
-  <ImportGroup Label="ExtensionTargets">
-  </ImportGroup>
-</Project>
diff --git a/lib/samples/win32/request.vcxproj.user b/lib/samples/win32/request.vcxproj.user
deleted file mode 100644 (file)
index ace9a86..0000000
+++ /dev/null
@@ -1,3 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
-</Project>
\ No newline at end of file
diff --git a/lib/samples/win32/update.vcxproj.filters.in b/lib/samples/win32/update.vcxproj.filters.in
deleted file mode 100644 (file)
index 8479fba..0000000
+++ /dev/null
@@ -1,22 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
-  <ItemGroup>
-    <Filter Include="Source Files">
-      <UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
-      <Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
-    </Filter>
-    <Filter Include="Header Files">
-      <UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
-      <Extensions>h;hpp;hxx;hm;inl;inc;xsd</Extensions>
-    </Filter>
-    <Filter Include="Resource Files">
-      <UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier>
-      <Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms</Extensions>
-    </Filter>
-  </ItemGroup>
-  <ItemGroup>
-    <ClCompile Include="..\sample-update.c">
-      <Filter>Source Files</Filter>
-    </ClCompile>
-  </ItemGroup>
-</Project>
\ No newline at end of file
diff --git a/lib/samples/win32/update.vcxproj.in b/lib/samples/win32/update.vcxproj.in
deleted file mode 100644 (file)
index 92aac93..0000000
+++ /dev/null
@@ -1,119 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<Project DefaultTargets="Build" ToolsVersion="@TOOLS_VERSION@" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
-  <ItemGroup Label="ProjectConfigurations">
-    <ProjectConfiguration Include="Debug|@PLATFORM@">
-      <Configuration>Debug</Configuration>
-      <Platform>@PLATFORM@</Platform>
-    </ProjectConfiguration>
-    <ProjectConfiguration Include="Release|@PLATFORM@">
-      <Configuration>Release</Configuration>
-      <Platform>@PLATFORM@</Platform>
-    </ProjectConfiguration>
-  </ItemGroup>
-  <PropertyGroup Label="Globals">
-    <ProjectGuid>{05682E12-523F-4DAE-8E6D-ADFDBC308AFD}</ProjectGuid>
-    <Keyword>Win32Proj</Keyword>
-    <RootNamespace>update</RootNamespace>
-    @WINDOWS_TARGET_PLATFORM_VERSION@
-  </PropertyGroup>
-  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|@PLATFORM@'" Label="Configuration">
-    <ConfigurationType>Application</ConfigurationType>
-    <UseDebugLibraries>true</UseDebugLibraries>
-    <CharacterSet>MultiByte</CharacterSet>
-    @PLATFORM_TOOLSET@
-  </PropertyGroup>
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|@PLATFORM@'" Label="Configuration">
-    <ConfigurationType>Application</ConfigurationType>
-    <UseDebugLibraries>false</UseDebugLibraries>
-    <WholeProgramOptimization>true</WholeProgramOptimization>
-    <CharacterSet>MultiByte</CharacterSet>
-    @PLATFORM_TOOLSET@
-  </PropertyGroup>
-  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
-  <ImportGroup Label="ExtensionSettings">
-  </ImportGroup>
-  <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|@PLATFORM@'">
-    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
-  </ImportGroup>
-  <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|@PLATFORM@'">
-    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
-  </ImportGroup>
-  <PropertyGroup Label="UserMacros" />
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|@PLATFORM@'">
-    <LinkIncremental>true</LinkIncremental>
-    <OutDir>..\..\..\Build\$(Configuration)\</OutDir>
-    <IntDir>.\$(Configuration)\</IntDir>
-    <IntDirSharingDetected>None</IntDirSharingDetected>
-  </PropertyGroup>
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|@PLATFORM@'">
-    <LinkIncremental>false</LinkIncremental>
-    <OutDir>..\..\..\Build\$(Configuration)\</OutDir>
-    <IntDir>.\$(Configuration)\</IntDir>
-    <IntDirSharingDetected>None</IntDirSharingDetected>
-  </PropertyGroup>
-  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|@PLATFORM@'">
-    <ClCompile>
-      <PrecompiledHeader>
-      </PrecompiledHeader>
-      <WarningLevel>Level4</WarningLevel>
-      <TreatWarningAsError>false</TreatWarningAsError>
-      <Optimization>Disabled</Optimization>
-      <PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <FunctionLevelLinking>true</FunctionLevelLinking>
-      <PrecompiledHeaderOutputFile>.\$(Configuration)\$(TargetName).pch</PrecompiledHeaderOutputFile>
-      <AssemblerListingLocation>.\$(Configuration)\</AssemblerListingLocation>
-      <ObjectFileName>.\$(Configuration)\</ObjectFileName>
-      <ProgramDataBaseFileName>$(OutDir)$(TargetName).pdb</ProgramDataBaseFileName>
-      <BrowseInformation>true</BrowseInformation>
-      <ForcedIncludeFiles>..\..\..\config.h</ForcedIncludeFiles>
-      <AdditionalIncludeDirectories>.\;..\..\..\;@LIBXML2_INC@@OPENSSL_INC@..\..\isc\win32;..\..\isc\win32\include;..\..\isc\include;..\..\dns\win32\include;..\..\dns\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
-      <CompileAs>CompileAsC</CompileAs>
-    </ClCompile>
-    <Link>
-      <SubSystem>Console</SubSystem>
-      <GenerateDebugInformation>true</GenerateDebugInformation>
-      <OutputFile>..\..\..\Build\$(Configuration)\$(TargetName)$(TargetExt)</OutputFile>
-      <AdditionalLibraryDirectories>..\..\isc\win32\$(Configuration);..\..\dns\win32\$(Configuration);..\..\isccfg\win32\$(Configuration);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
-      <AdditionalDependencies>@OPENSSL_LIBCRYPTO@@OPENSSL_LIBSSL@libisc.lib;libdns.lib;libisccfg.lib;ws2_32.lib;%(AdditionalDependencies)</AdditionalDependencies>
-    </Link>
-  </ItemDefinitionGroup>
-  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|@PLATFORM@'">
-    <ClCompile>
-      <WarningLevel>Level1</WarningLevel>
-      <TreatWarningAsError>true</TreatWarningAsError>
-      <PrecompiledHeader>
-      </PrecompiledHeader>
-      <Optimization>MaxSpeed</Optimization>
-      <FunctionLevelLinking>true</FunctionLevelLinking>
-      <IntrinsicFunctions>@INTRINSIC@</IntrinsicFunctions>
-      <PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion>
-      <WholeProgramOptimization>false</WholeProgramOptimization>
-      <StringPooling>true</StringPooling>
-      <PrecompiledHeaderOutputFile>.\$(Configuration)\$(TargetName).pch</PrecompiledHeaderOutputFile>
-      <AssemblerListingLocation>.\$(Configuration)\</AssemblerListingLocation>
-      <ObjectFileName>.\$(Configuration)\</ObjectFileName>
-      <ProgramDataBaseFileName>$(OutDir)$(TargetName).pdb</ProgramDataBaseFileName>
-      <ForcedIncludeFiles>..\..\..\config.h</ForcedIncludeFiles>
-      <AdditionalIncludeDirectories>.\;..\..\..\;@LIBXML2_INC@@OPENSSL_INC@..\..\isc\win32;..\..\isc\win32\include;..\..\isc\include;..\..\dns\win32\include;..\..\dns\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
-      <CompileAs>CompileAsC</CompileAs>
-    </ClCompile>
-    <Link>
-      <SubSystem>Console</SubSystem>
-      <GenerateDebugInformation>false</GenerateDebugInformation>
-      <EnableCOMDATFolding>true</EnableCOMDATFolding>
-      <OptimizeReferences>true</OptimizeReferences>
-      <OutputFile>..\..\..\Build\$(Configuration)\$(TargetName)$(TargetExt)</OutputFile>
-      <LinkTimeCodeGeneration>Default</LinkTimeCodeGeneration>
-      <AdditionalLibraryDirectories>..\..\isc\win32\$(Configuration);..\..\dns\win32\$(Configuration);..\..\isccfg\win32\$(Configuration);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
-      <AdditionalDependencies>@OPENSSL_LIBCRYPTO@@OPENSSL_LIBSSL@libisc.lib;libdns.lib;libisccfg.lib;ws2_32.lib;%(AdditionalDependencies)</AdditionalDependencies>
-    </Link>
-  </ItemDefinitionGroup>
-  <ItemGroup>
-    <ClCompile Include="..\sample-update.c" />
-  </ItemGroup>
-  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
-  <ImportGroup Label="ExtensionTargets">
-  </ImportGroup>
-</Project>
diff --git a/lib/samples/win32/update.vcxproj.user b/lib/samples/win32/update.vcxproj.user
deleted file mode 100644 (file)
index ace9a86..0000000
+++ /dev/null
@@ -1,3 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
-</Project>
\ No newline at end of file
index 20f1098b8a01b655a45012abc1867d015ee80e9b..9d64a69cd402deccea39e723030fdace122445b7 100644 (file)
 ./lib/samples/resolve.c                                C       2009,2012,2013,2014,2015,2016,2017,2018,2019,2020,2021
 ./lib/samples/rootkey.sh                       SH      2013,2016,2018,2019,2020,2021
 ./lib/samples/sample-async.c                   C       2009,2013,2014,2015,2016,2018,2019,2020,2021
-./lib/samples/sample-gai.c                     C       2009,2012,2013,2014,2015,2016,2018,2019,2020,2021
-./lib/samples/sample-request.c                 C       2009,2012,2013,2014,2015,2016,2018,2019,2020,2021
-./lib/samples/sample-update.c                  C       2009,2010,2012,2013,2014,2015,2016,2017,2018,2019,2020,2021
 ./lib/samples/win32/async.vcxproj.filters.in   X       2014,2015,2018,2019,2020
 ./lib/samples/win32/async.vcxproj.in           X       2014,2015,2016,2017,2018,2019,2020
 ./lib/samples/win32/async.vcxproj.user         X       2014,2018,2019,2020,2021
 ./lib/samples/win32/nsprobe.vcxproj.filters.in X       2014,2015,2018,2019,2020
 ./lib/samples/win32/nsprobe.vcxproj.in         X       2014,2015,2016,2017,2018,2019,2020
 ./lib/samples/win32/nsprobe.vcxproj.user       X       2014,2018,2019,2020,2021
-./lib/samples/win32/request.vcxproj.filters.in X       2014,2015,2018,2019,2020
-./lib/samples/win32/request.vcxproj.in         X       2014,2015,2016,2017,2018,2019,2020
-./lib/samples/win32/request.vcxproj.user       X       2014,2018,2019,2020,2021
 ./lib/samples/win32/resolve.vcxproj.filters.in X       2014,2015,2018,2019,2020
 ./lib/samples/win32/resolve.vcxproj.in         X       2014,2015,2016,2017,2018,2019,2020
 ./lib/samples/win32/resolve.vcxproj.user       X       2014,2018,2019,2020,2021
-./lib/samples/win32/update.vcxproj.filters.in  X       2014,2015,2018,2019,2020
-./lib/samples/win32/update.vcxproj.in          X       2014,2015,2016,2017,2018,2019,2020
-./lib/samples/win32/update.vcxproj.user                X       2014,2018,2019,2020,2021
 ./lib/win32/bindevt/bindevt.c                  C       2000,2001,2004,2007,2016,2018,2019,2020,2021
 ./lib/win32/bindevt/bindevt.mc                 X       2001,2004,2007,2016,2018,2019,2020,2021
 ./lib/win32/bindevt/bindevt.vcxproj.filters.in X       2013,2015,2018,2019,2020
index fe3eb96a42049f937175e79acc6399c7cc3f1ba5..1eb56ba6c34e3e058b3c486cf4a0c58e04aa0654 100644 (file)
@@ -177,10 +177,6 @@ my @projectlist = ("..\\bin\\check\\win32\\checkconf.vcxproj",
                    "..\\lib\\samples\\win32\\async.vcxproj.filters",
                    "..\\lib\\samples\\win32\\gai.vcxproj",
                    "..\\lib\\samples\\win32\\gai.vcxproj.filters",
-                   "..\\lib\\samples\\win32\\update.vcxproj",
-                   "..\\lib\\samples\\win32\\update.vcxproj.filters",
-                   "..\\lib\\samples\\win32\\request.vcxproj",
-                   "..\\lib\\samples\\win32\\request.vcxproj.filters",
                    "..\\lib\\samples\\win32\\nsprobe.vcxproj",
                    "..\\lib\\samples\\win32\\nsprobe.vcxproj.filters",
                    "..\\lib\\win32\\bindevt\\bindevt.vcxproj",
index e126677ffcff288965488c74d661bc3e2fb7ec8e..be0e8a0b62ac9feafed3fa0e4887a739753bde41 100644 (file)
@@ -17,8 +17,6 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "BINDInstall", "..\bin\win32
                {F66D8B7E-721D-4602-99AD-820D19AD1313} = {F66D8B7E-721D-4602-99AD-820D19AD1313}
                {9FC33CA3-CE4A-4EDF-BA99-EECA4B81AD06} = {9FC33CA3-CE4A-4EDF-BA99-EECA4B81AD06}
                {D42B8670-8DF6-4D90-90F7-DB5FB845AFAE} = {D42B8670-8DF6-4D90-90F7-DB5FB845AFAE}
-               {05682E12-523F-4DAE-8E6D-ADFDBC308AFD} = {05682E12-523F-4DAE-8E6D-ADFDBC308AFD}
-               {FF440E85-7450-439C-82EE-04C464512D0E} = {FF440E85-7450-439C-82EE-04C464512D0E}
                {CB2A29F6-E73B-40AB-8AC4-2C1AAE7280BD} = {CB2A29F6-E73B-40AB-8AC4-2C1AAE7280BD}
 @END SAMPLES
                {723C65DA-A96C-4BA3-A34E-44F11CA346F9} = {723C65DA-A96C-4BA3-A34E-44F11CA346F9}
@@ -159,22 +157,6 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "gai", "..\lib\samples\win32
                {A4F29CEB-7644-4A7F-BE9E-02B6A90E4919} = {A4F29CEB-7644-4A7F-BE9E-02B6A90E4919}
        EndProjectSection
 EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "update", "..\lib\samples\win32\update.vcxproj", "{05682E12-523F-4DAE-8E6D-ADFDBC308AFD}"
-       ProjectSection(ProjectDependencies) = postProject
-               {A3F71D12-F38A-4C77-8D87-8E8854CA74A1} = {A3F71D12-F38A-4C77-8D87-8E8854CA74A1}
-               {3840E563-D180-4761-AA9C-E6155F02EAFF} = {3840E563-D180-4761-AA9C-E6155F02EAFF}
-               {5FEBFD4E-CCB0-48B9-B733-E15EEB85C16A} = {5FEBFD4E-CCB0-48B9-B733-E15EEB85C16A}
-               {B2DFA58C-6347-478E-81E8-01E06999D4F1} = {B2DFA58C-6347-478E-81E8-01E06999D4F1}
-       EndProjectSection
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "request", "..\lib\samples\win32\request.vcxproj", "{FF440E85-7450-439C-82EE-04C464512D0E}"
-       ProjectSection(ProjectDependencies) = postProject
-               {A3F71D12-F38A-4C77-8D87-8E8854CA74A1} = {A3F71D12-F38A-4C77-8D87-8E8854CA74A1}
-               {3840E563-D180-4761-AA9C-E6155F02EAFF} = {3840E563-D180-4761-AA9C-E6155F02EAFF}
-               {5FEBFD4E-CCB0-48B9-B733-E15EEB85C16A} = {5FEBFD4E-CCB0-48B9-B733-E15EEB85C16A}
-               {B2DFA58C-6347-478E-81E8-01E06999D4F1} = {B2DFA58C-6347-478E-81E8-01E06999D4F1}
-       EndProjectSection
-EndProject
 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "nsprobe", "..\lib\samples\win32\nsprobe.vcxproj", "{CB2A29F6-E73B-40AB-8AC4-2C1AAE7280BD}"
        ProjectSection(ProjectDependencies) = postProject
                {A3F71D12-F38A-4C77-8D87-8E8854CA74A1} = {A3F71D12-F38A-4C77-8D87-8E8854CA74A1}
@@ -626,14 +608,6 @@ Global
                {D42B8670-8DF6-4D90-90F7-DB5FB845AFAE}.Debug|@PLATFORM@.Build.0 = Debug|@PLATFORM@
                {D42B8670-8DF6-4D90-90F7-DB5FB845AFAE}.Release|@PLATFORM@.ActiveCfg = Release|@PLATFORM@
                {D42B8670-8DF6-4D90-90F7-DB5FB845AFAE}.Release|@PLATFORM@.Build.0 = Release|@PLATFORM@
-               {05682E12-523F-4DAE-8E6D-ADFDBC308AFD}.Debug|@PLATFORM@.ActiveCfg = Debug|@PLATFORM@
-               {05682E12-523F-4DAE-8E6D-ADFDBC308AFD}.Debug|@PLATFORM@.Build.0 = Debug|@PLATFORM@
-               {05682E12-523F-4DAE-8E6D-ADFDBC308AFD}.Release|@PLATFORM@.ActiveCfg = Release|@PLATFORM@
-               {05682E12-523F-4DAE-8E6D-ADFDBC308AFD}.Release|@PLATFORM@.Build.0 = Release|@PLATFORM@
-               {FF440E85-7450-439C-82EE-04C464512D0E}.Debug|@PLATFORM@.ActiveCfg = Debug|@PLATFORM@
-               {FF440E85-7450-439C-82EE-04C464512D0E}.Debug|@PLATFORM@.Build.0 = Debug|@PLATFORM@
-               {FF440E85-7450-439C-82EE-04C464512D0E}.Release|@PLATFORM@.ActiveCfg = Release|@PLATFORM@
-               {FF440E85-7450-439C-82EE-04C464512D0E}.Release|@PLATFORM@.Build.0 = Release|@PLATFORM@
                {CB2A29F6-E73B-40AB-8AC4-2C1AAE7280BD}.Debug|@PLATFORM@.ActiveCfg = Debug|@PLATFORM@
                {CB2A29F6-E73B-40AB-8AC4-2C1AAE7280BD}.Debug|@PLATFORM@.Build.0 = Debug|@PLATFORM@
                {CB2A29F6-E73B-40AB-8AC4-2C1AAE7280BD}.Release|@PLATFORM@.ActiveCfg = Release|@PLATFORM@