remove dns_client_update() and related code
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.
This commit is contained in:
@@ -730,7 +730,6 @@ export PYTHON
|
||||
export RESOLVE
|
||||
export RNDC
|
||||
export RRCHECKER
|
||||
export SAMPLEUPDATE
|
||||
export SIGNER
|
||||
export SUBDIRS
|
||||
export TMPDIR
|
||||
|
||||
@@ -68,7 +68,6 @@ KEYCREATE=$TOP_BUILDDIR/bin/tests/system/tkey/keycreate
|
||||
KEYDELETE=$TOP_BUILDDIR/bin/tests/system/tkey/keydelete
|
||||
MAKEJOURNAL=$TOP_BUILDDIR/bin/tests/system/makejournal
|
||||
PIPEQUERIES=$TOP_BUILDDIR/bin/tests/system/pipelined/pipequeries
|
||||
SAMPLEUPDATE=$TOP_BUILDDIR/lib/samples/sample-update
|
||||
|
||||
# we don't want a KRB5_CONFIG setting breaking the tests
|
||||
KRB5_CONFIG=/dev/null
|
||||
|
||||
@@ -56,7 +56,6 @@ REVOKE=$TOP_BUILDDIR/Build/$VSCONF/dnssec-revoke@EXEEXT@
|
||||
RNDC=$TOP_BUILDDIR/Build/$VSCONF/rndc@EXEEXT@
|
||||
RNDCCONFGEN=$TOP_BUILDDIR/Build/$VSCONF/rndc-confgen@EXEEXT@
|
||||
RRCHECKER=$TOP_BUILDDIR/Build/$VSCONF/named-rrchecker@EXEEXT@
|
||||
SAMPLEUPDATE=$TOP_BUILDDIR/Build/$VSCONF/update@EXEEXT@
|
||||
SETTIME=$TOP_BUILDDIR/Build/$VSCONF/dnssec-settime@EXEEXT@
|
||||
SIGNER=$TOP_BUILDDIR/Build/$VSCONF/dnssec-signzone@EXEEXT@
|
||||
TSIGKEYGEN=$TOP_BUILDDIR/Build/$VSCONF/tsig-keygen@EXEEXT@
|
||||
@@ -71,7 +70,6 @@ KEYCREATE=$TOP_BUILDDIR/Build/$VSCONF/keycreate@EXEEXT@
|
||||
KEYDELETE=$TOP_BUILDDIR/Build/$VSCONF/keydelete@EXEEXT@
|
||||
MAKEJOURNAL=$TOP_BUILDDIR/Build/$VSCONF/makejournal@EXEEXT@
|
||||
PIPEQUERIES=$TOP_BUILDDIR/Build/$VSCONF/pipequeries@EXEEXT@
|
||||
# to port SAMPLEUPDATE=$TOP_BUILDDIR/lib/samples/sample-update
|
||||
|
||||
# we don't want a KRB5_CONFIG setting breaking the tests
|
||||
KRB5_CONFIG=NUL
|
||||
|
||||
@@ -1428,88 +1428,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
|
||||
|
||||
@@ -308,15 +308,9 @@
|
||||
<ProjectReference Include="..\..\..\lib\samples\win32\nsprobe.vcxproj">
|
||||
<Project>{CB2A29F6-E73B-40AB-8AC4-2C1AAE7280BD}</Project>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="..\..\..\lib\samples\win32\request.vcxproj">
|
||||
<Project>{FF440E85-7450-439C-82EE-04C464512D0E}</Project>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="..\..\..\lib\samples\win32\resolve.vcxproj">
|
||||
<Project>{F66D8B7E-721D-4602-99AD-820D19AD1313}</Project>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="..\..\..\lib\samples\win32\update.vcxproj">
|
||||
<Project>{05682E12-523F-4DAE-8E6D-ADFDBC308AFD}</Project>
|
||||
</ProjectReference>
|
||||
@END SAMPLES
|
||||
<ProjectReference Include="..\..\..\lib\win32\bindevt\bindevt.vcxproj">
|
||||
<Project>{0D745CD9-FC3B-49DC-99BE-1E6DF85593F0}</Project>
|
||||
|
||||
1483
lib/dns/client.c
1483
lib/dns/client.c
File diff suppressed because it is too large
Load Diff
@@ -112,15 +112,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.
|
||||
@@ -135,24 +126,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,
|
||||
@@ -160,24 +133,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.
|
||||
*
|
||||
* 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:
|
||||
*
|
||||
@@ -504,146 +469,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 */
|
||||
|
||||
@@ -135,25 +135,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
|
||||
|
||||
2
lib/samples/.gitignore
vendored
2
lib/samples/.gitignore
vendored
@@ -3,5 +3,3 @@ process
|
||||
resolve
|
||||
sample-async
|
||||
sample-gai
|
||||
sample-request
|
||||
sample-update
|
||||
|
||||
@@ -8,8 +8,6 @@ AM_CPPFLAGS += \
|
||||
noinst_PROGRAMS = \
|
||||
resolve \
|
||||
sample-async \
|
||||
sample-update \
|
||||
sample-request \
|
||||
nsprobe
|
||||
|
||||
resolve_SOURCES = resolve.c
|
||||
@@ -18,11 +16,5 @@ resolve_LDADD = $(LIBISC_LIBS) $(LIBIRS_LIBS) $(LIBDNS_LIBS)
|
||||
sample_async_SOURCES = sample-async.c
|
||||
sample_async_LDADD = $(LIBISC_LIBS) $(LIBDNS_LIBS)
|
||||
|
||||
sample_update_SOURCES = sample-update.c
|
||||
sample_update_LDADD = $(LIBISC_LIBS) $(LIBDNS_LIBS)
|
||||
|
||||
sample_request_SOURCES = sample-request.c
|
||||
sample_request_LDADD = $(LIBISC_LIBS) $(LIBDNS_LIBS)
|
||||
|
||||
nsprobe_SOURCES = nsprobe.c
|
||||
nsprobe_LDADD = $(LIBISC_LIBS) $(LIBDNS_LIBS)
|
||||
|
||||
@@ -1,249 +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/attributes.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_NORETURN static void
|
||||
usage(void);
|
||||
|
||||
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);
|
||||
}
|
||||
@@ -1,781 +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/attributes.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_NORETURN static void
|
||||
usage(void);
|
||||
|
||||
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, ®ion);
|
||||
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, ®ion);
|
||||
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, ®ion);
|
||||
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, ®ion);
|
||||
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, ®ion);
|
||||
if (result != ISC_R_SUCCESS) {
|
||||
fprintf(stderr, "invalid type: %s\n", word);
|
||||
exit(1);
|
||||
}
|
||||
} else {
|
||||
rdataclass = default_rdataclass;
|
||||
result = dns_rdatatype_fromtext(&rdatatype, ®ion);
|
||||
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);
|
||||
}
|
||||
}
|
||||
@@ -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>
|
||||
@@ -1,127 +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);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
|
||||
<AdditionalDependencies>@OPENSSL_LIBCRYPTO@@OPENSSL_LIBSSL@libisc.lib;libdns.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);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
|
||||
<AdditionalDependencies>@OPENSSL_LIBCRYPTO@@OPENSSL_LIBSSL@libisc.lib;libdns.lib;ws2_32.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="..\sample-request.c" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\..\..\lib\isc\win32\libisc.vcxproj">
|
||||
<Project>{3840E563-D180-4761-AA9C-E6155F02EAFF}</Project>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="..\..\..\lib\dns\win32\libdns.vcxproj">
|
||||
<Project>{5FEBFD4E-CCB0-48B9-B733-E15EEB85C16A}</Project>
|
||||
</ProjectReference>
|
||||
</ItemGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
|
||||
<ImportGroup Label="ExtensionTargets">
|
||||
</ImportGroup>
|
||||
</Project>
|
||||
@@ -1,3 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
</Project>
|
||||
@@ -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>
|
||||
@@ -1,127 +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);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
|
||||
<AdditionalDependencies>@OPENSSL_LIBCRYPTO@@OPENSSL_LIBSSL@libisc.lib;libdns.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);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
|
||||
<AdditionalDependencies>@OPENSSL_LIBCRYPTO@@OPENSSL_LIBSSL@libisc.lib;libdns.lib;ws2_32.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="..\sample-update.c" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\..\..\lib\isc\win32\libisc.vcxproj">
|
||||
<Project>{3840E563-D180-4761-AA9C-E6155F02EAFF}</Project>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="..\..\..\lib\dns\win32\libdns.vcxproj">
|
||||
<Project>{5FEBFD4E-CCB0-48B9-B733-E15EEB85C16A}</Project>
|
||||
</ProjectReference>
|
||||
</ItemGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
|
||||
<ImportGroup Label="ExtensionTargets">
|
||||
</ImportGroup>
|
||||
</Project>
|
||||
@@ -1,3 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
</Project>
|
||||
@@ -2193,23 +2193,15 @@
|
||||
./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-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
|
||||
|
||||
@@ -133,10 +133,6 @@ my @projectlist = ("../bin/check/win32/checkconf.vcxproj",
|
||||
"../lib/samples/win32/resolve.vcxproj.filters",
|
||||
"../lib/samples/win32/async.vcxproj",
|
||||
"../lib/samples/win32/async.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",
|
||||
|
||||
@@ -29,10 +29,6 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "async", "..\lib\samples\win
|
||||
EndProject
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "gai", "..\lib\samples\win32\gai.vcxproj", "{D42B8670-8DF6-4D90-90F7-DB5FB845AFAE}"
|
||||
EndProject
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "update", "..\lib\samples\win32\update.vcxproj", "{05682E12-523F-4DAE-8E6D-ADFDBC308AFD}"
|
||||
EndProject
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "request", "..\lib\samples\win32\request.vcxproj", "{FF440E85-7450-439C-82EE-04C464512D0E}"
|
||||
EndProject
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "nsprobe", "..\lib\samples\win32\nsprobe.vcxproj", "{CB2A29F6-E73B-40AB-8AC4-2C1AAE7280BD}"
|
||||
EndProject
|
||||
@END SAMPLES
|
||||
|
||||
Reference in New Issue
Block a user