+3550. [func] Unified the internal and export versions of the
+ BIND libraries, allowing external clients to use
+ the same libraries as BIND. [RT #33131]
+
3549. [doc] Documentation for "request-nsid" was missing.
[RT #33153]
- New zone file format "map" is an image of a zone database
that can be loaded directly into memory, allowing much faster
zone loading.
- - Up to 32 response-policy zones (RPZ) can now be configured.
- RPZ performance has been substantially improved.
+ - Substantial improvement in response-policy zone (RPZ)
+ performance. Up to 32 response-policy zones can be
+ configured with minimal performance loss.
- ACLs can now be specified based on geographic location
using the MacMind GeoIP databases.
- New XML schema (version 3) for the statistics channel
browsers.
- The statistics channel can now provide data in JSON
format as well as XML.
+ - The internal and export versions of the BIND libraries
+ (libisc, libdns, etc) have been unified so that external
+ library clients can use the same libraries as BIND itself.
- New 'dnssec-coverage' tool to check DNSSEC key coverage
for a zone and report if a lapse in signing coverage has
been inadvertently scheduled.
JOURNALPRINT=$TOP/bin/tools/named-journalprint
VERIFY=$TOP/bin/dnssec/dnssec-verify
ARPANAME=$TOP/bin/tools/arpaname
-SAMPLE=$TOP/lib/export/samples/sample
+RESOLVE=$TOP/lib/samples/resolve
# The "stress" test is not run by default since it creates enough
# load on the machine to make it unusable to other users.
export NAMED LWRESD DIG NSUPDATE KEYGEN KEYFRLAB SIGNER KEYSIGNER KEYSETTOOL \
PERL SUBDIRS RNDC CHECKZONE PK11GEN PK11LIST PK11DEL TESTSOCK6 \
- JOURNALPRINT ARPANAME SAMPLE
+ JOURNALPRINT ARPANAME RESOLVE
rm -f ns2/nsec3chain-test.db
rm -f */example.bk
rm -f dig.out.*
-rm -f sample.out*
+rm -f resolve.out*
rm -f random.data
rm -f ns2/dlv.db
rm -f ns3/multiple.example.db ns3/nsec3-unknown.example.db ns3/nsec3.example.db
rm -f nosign.before
rm -f signing.out*
rm -f canonical?.*
+rm -f ns1/resolve.key
local ($dn, $class, $type, $flags, $proto, $alg, @rest) = split;
local $key = join("", @rest);
print "-a $alg -e -k $dn -K $key\n"
-' > sample.key
+' > resolve.key
rm -f dig.out.*
DIGOPTS="+tcp +noadd +nosea +nostat +nocmd +dnssec -p 5300"
-SAMPLEKEY=`cat ns1/sample.key`
+RESKEY=`cat ns1/resolve.key`
# convert private-type records to readable form
showprivate () {
if [ $ret != 0 ]; then echo "I:failed"; fi
status=`expr $status + $ret`
-if [ -x ${SAMPLE} ] ; then
+if [ -x ${RESOLVE} ] ; then
ret=0
echo "I:checking postive validation NSEC using dns_client ($n)"
- $SAMPLE $SAMPLEKEY -p 5300 -t a 10.53.0.4 a.example > sample.out$n || ret=1
- grep "a.example..*10.0.0.1" sample.out$n > /dev/null || ret=1
- grep "a.example..*.RRSIG.A 3 2 300 .*" sample.out$n > /dev/null || ret=1
+ $RESOLVE $RESKEY -p 5300 -t a -s 10.53.0.4 a.example > resolve.out$n || ret=1
+ grep "a.example..*10.0.0.1" resolve.out$n > /dev/null || ret=1
+ grep "a.example..*.RRSIG.A 3 2 300 .*" resolve.out$n > /dev/null || ret=1
n=`expr $n + 1`
if [ $ret != 0 ]; then echo "I:failed"; fi
status=`expr $status + $ret`
if [ $ret != 0 ]; then echo "I:failed"; fi
status=`expr $status + $ret`
-if [ -x ${SAMPLE} ] ; then
+if [ -x ${RESOLVE} ] ; then
ret=0
echo "I:checking positive validation NSEC3 using dns_client ($n)"
- $SAMPLE $SAMPLEKEY -p 5300 -t a 10.53.0.4 a.nsec3.example > sample.out$n || ret=1
- grep "a.nsec3.example..*10.0.0.1" sample.out$n > /dev/null || ret=1
- grep "a.nsec3.example..*RRSIG.A 7 3 300.*" sample.out$n > /dev/null || ret=1
+ $RESOLVE $RESKEY -p 5300 -t a -s 10.53.0.4 a.nsec3.example > resolve.out$n || ret=1
+ grep "a.nsec3.example..*10.0.0.1" resolve.out$n > /dev/null || ret=1
+ grep "a.nsec3.example..*RRSIG.A 7 3 300.*" resolve.out$n > /dev/null || ret=1
n=`expr $n + 1`
if [ $ret != 0 ]; then echo "I:failed"; fi
status=`expr $status + $ret`
if [ $ret != 0 ]; then echo "I:failed"; fi
status=`expr $status + $ret`
-if [ -x ${SAMPLE} ] ; then
+if [ -x ${RESOLVE} ] ; then
ret=0
echo "I:checking positive validation OPTOUT using dns_client ($n)"
- $SAMPLE $SAMPLEKEY -p 5300 -t a 10.53.0.4 a.optout.example > sample.out$n || ret=1
- grep "a.optout.example..*10.0.0.1" sample.out$n > /dev/null || ret=1
- grep "a.optout.example..*RRSIG.A 7 3 300.*" sample.out$n > /dev/null || ret=1
+ $RESOLVE $RESKEY -p 5300 -t a -s 10.53.0.4 a.optout.example > resolve.out$n || ret=1
+ grep "a.optout.example..*10.0.0.1" resolve.out$n > /dev/null || ret=1
+ grep "a.optout.example..*RRSIG.A 7 3 300.*" resolve.out$n > /dev/null || ret=1
n=`expr $n + 1`
if [ $ret != 0 ]; then echo "I:failed"; fi
status=`expr $status + $ret`
if [ $ret != 0 ]; then echo "I:failed"; fi
status=`expr $status + $ret`
-if [ -x ${SAMPLE} ] ; then
+if [ -x ${RESOLVE} ] ; then
ret=0
echo "I:checking positive wildcard validation NSEC using dns_client ($n)"
- $SAMPLE $SAMPLEKEY -p 5300 -t a 10.53.0.4 a.wild.example > sample.out$n || ret=1
- grep "a.wild.example..*10.0.0.27" sample.out$n > /dev/null || ret=1
- grep "a.wild.example..*RRSIG.A 3 2 300.*" sample.out$n > /dev/null || ret=1
+ $RESOLVE $RESKEY -p 5300 -t a -s 10.53.0.4 a.wild.example > resolve.out$n || ret=1
+ grep "a.wild.example..*10.0.0.27" resolve.out$n > /dev/null || ret=1
+ grep "a.wild.example..*RRSIG.A 3 2 300.*" resolve.out$n > /dev/null || ret=1
n=`expr $n + 1`
if [ $ret != 0 ]; then echo "I:failed"; fi
status=`expr $status + $ret`
if [ $ret != 0 ]; then echo "I:failed"; fi
status=`expr $status + $ret`
-if [ -x ${SAMPLE} ] ; then
+if [ -x ${RESOLVE} ] ; then
ret=0
echo "I:checking positive wildcard validation NSEC3 using dns_client ($n)"
- $SAMPLE $SAMPLEKEY -p 5300 -t a 10.53.0.4 a.wild.nsec3.example > sample.out$n || ret=1
- grep "a.wild.nsec3.example..*10.0.0.6" sample.out$n > /dev/null || ret=1
- grep "a.wild.nsec3.example..*RRSIG.A 7 3 300.*" sample.out$n > /dev/null || ret=1
+ $RESOLVE $RESKEY -p 5300 -t a -s 10.53.0.4 a.wild.nsec3.example > resolve.out$n || ret=1
+ grep "a.wild.nsec3.example..*10.0.0.6" resolve.out$n > /dev/null || ret=1
+ grep "a.wild.nsec3.example..*RRSIG.A 7 3 300.*" resolve.out$n > /dev/null || ret=1
n=`expr $n + 1`
if [ $ret != 0 ]; then echo "I:failed"; fi
status=`expr $status + $ret`
if [ $ret != 0 ]; then echo "I:failed"; fi
status=`expr $status + $ret`
-if [ -x ${SAMPLE} ] ; then
+if [ -x ${RESOLVE} ] ; then
ret=0
echo "I:checking positive wildcard validation OPTOUT using dns_client ($n)"
- $SAMPLE $SAMPLEKEY -p 5300 -t a 10.53.0.4 a.wild.optout.example > sample.out$n || ret=1
- grep "a.wild.optout.example..*10.0.0.6" sample.out$n > /dev/null || ret=1
- grep "a.wild.optout.example..*RRSIG.A 7 3 300.*" sample.out$n > /dev/null || ret=1
+ $RESOLVE $RESKEY -p 5300 -t a -s 10.53.0.4 a.wild.optout.example > resolve.out$n || ret=1
+ grep "a.wild.optout.example..*10.0.0.6" resolve.out$n > /dev/null || ret=1
+ grep "a.wild.optout.example..*RRSIG.A 7 3 300.*" resolve.out$n > /dev/null || ret=1
n=`expr $n + 1`
if [ $ret != 0 ]; then echo "I:failed"; fi
status=`expr $status + $ret`
if [ $ret != 0 ]; then echo "I:failed"; fi
status=`expr $status + $ret`
-if [ -x ${SAMPLE} ] ; then
+if [ -x ${RESOLVE} ] ; then
ret=0
echo "I:checking negative validation NXDOMAIN NSEC using dns_client ($n)"
- $SAMPLE $SAMPLEKEY -p 5300 -t a 10.53.0.4 q.example > /dev/null 2> sample.out$n || ret=1
- grep "resolution failed: ncache nxdomain" sample.out$n > /dev/null || ret=1
+ $RESOLVE $RESKEY -p 5300 -t a -s 10.53.0.4 q.example > /dev/null 2> resolve.out$n || ret=1
+ grep "resolution failed: ncache nxdomain" resolve.out$n > /dev/null || ret=1
n=`expr $n + 1`
if [ $ret != 0 ]; then echo "I:failed"; fi
status=`expr $status + $ret`
if [ $ret != 0 ]; then echo "I:failed"; fi
status=`expr $status + $ret`
-if [ -x ${SAMPLE} ] ; then
+if [ -x ${RESOLVE} ] ; then
ret=0
echo "I:checking negative validation NXDOMAIN NSEC3 using dns_client ($n)"
- $SAMPLE $SAMPLEKEY -p 5300 -t a 10.53.0.4 q.nsec3.example > /dev/null 2> sample.out$n || ret=1
- grep "resolution failed: ncache nxdomain" sample.out$n > /dev/null || ret=1
+ $RESOLVE $RESKEY -p 5300 -t a -s 10.53.0.4 q.nsec3.example > /dev/null 2> resolve.out$n || ret=1
+ grep "resolution failed: ncache nxdomain" resolve.out$n > /dev/null || ret=1
n=`expr $n + 1`
if [ $ret != 0 ]; then echo "I:failed"; fi
status=`expr $status + $ret`
if [ $ret != 0 ]; then echo "I:failed"; fi
status=`expr $status + $ret`
-if [ -x ${SAMPLE} ] ; then
+if [ -x ${RESOLVE} ] ; then
ret=0
echo "I:checking negative validation NXDOMAIN OPTOUT using dns_client ($n)"
- $SAMPLE $SAMPLEKEY -p 5300 -t a 10.53.0.4 q.optout.example > /dev/null 2> sample.out$n || ret=1
- grep "resolution failed: ncache nxdomain" sample.out$n > /dev/null || ret=1
+ $RESOLVE $RESKEY -p 5300 -t a -s 10.53.0.4 q.optout.example > /dev/null 2> resolve.out$n || ret=1
+ grep "resolution failed: ncache nxdomain" resolve.out$n > /dev/null || ret=1
n=`expr $n + 1`
if [ $ret != 0 ]; then echo "I:failed"; fi
status=`expr $status + $ret`
if [ $ret != 0 ]; then echo "I:failed"; fi
status=`expr $status + $ret`
-if [ -x ${SAMPLE} ] ; then
+if [ -x ${RESOLVE} ] ; then
ret=0
echo "I:checking negative validation NODATA OPTOUT using dns_client ($n)"
- $SAMPLE $SAMPLEKEY -p 5300 -t txt 10.53.0.4 a.example > /dev/null 2> sample.out$n || ret=1
- grep "resolution failed: ncache nxrrset" sample.out$n > /dev/null || ret=1
+ $RESOLVE $RESKEY -p 5300 -t txt -s 10.53.0.4 a.example > /dev/null 2> resolve.out$n || ret=1
+ grep "resolution failed: ncache nxrrset" resolve.out$n > /dev/null || ret=1
n=`expr $n + 1`
if [ $ret != 0 ]; then echo "I:failed"; fi
status=`expr $status + $ret`
if [ $ret != 0 ]; then echo "I:failed"; fi
status=`expr $status + $ret`
-if [ -x ${SAMPLE} ] ; then
+if [ -x ${RESOLVE} ] ; then
ret=0
echo "I:checking negative validation NODATA NSEC3 using dns_client ($n)"
- $SAMPLE $SAMPLEKEY -p 5300 -t txt 10.53.0.4 a.nsec3.example > /dev/null 2> sample.out$n || ret=1
- grep "resolution failed: ncache nxrrset" sample.out$n > /dev/null || ret=1
+ $RESOLVE $RESKEY -p 5300 -t txt -s 10.53.0.4 a.nsec3.example > /dev/null 2> resolve.out$n || ret=1
+ grep "resolution failed: ncache nxrrset" resolve.out$n > /dev/null || ret=1
n=`expr $n + 1`
if [ $ret != 0 ]; then echo "I:failed"; fi
status=`expr $status + $ret`
if [ $ret != 0 ]; then echo "I:failed"; fi
status=`expr $status + $ret`
-if [ -x ${SAMPLE} ] ; then
+if [ -x ${RESOLVE} ] ; then
ret=0
echo "I:checking negative validation NODATA OPTOUT using dns_client ($n)"
- $SAMPLE $SAMPLEKEY -p 5300 -t txt 10.53.0.4 a.optout.example > /dev/null 2> sample.out$n || ret=1
- grep "resolution failed: ncache nxrrset" sample.out$n > /dev/null || ret=1
+ $RESOLVE $RESKEY -p 5300 -t txt -s 10.53.0.4 a.optout.example > /dev/null 2> resolve.out$n || ret=1
+ grep "resolution failed: ncache nxrrset" resolve.out$n > /dev/null || ret=1
n=`expr $n + 1`
if [ $ret != 0 ]; then echo "I:failed"; fi
status=`expr $status + $ret`
if [ $ret != 0 ]; then echo "I:failed"; fi
status=`expr $status + $ret`
-if [ -x ${SAMPLE} ] ; then
+if [ -x ${RESOLVE} ] ; then
ret=0
echo "I:checking negative wildcard validation NSEC using dns_client ($n)"
- $SAMPLE $SAMPLEKEY -p 5300 -t txt 10.53.0.4 b.wild.example > /dev/null 2> sample.out$n || ret=1
- grep "resolution failed: ncache nxrrset" sample.out$n > /dev/null || ret=1
+ $RESOLVE $RESKEY -p 5300 -t txt -s 10.53.0.4 b.wild.example > /dev/null 2> resolve.out$n || ret=1
+ grep "resolution failed: ncache nxrrset" resolve.out$n > /dev/null || ret=1
n=`expr $n + 1`
if [ $ret != 0 ]; then echo "I:failed"; fi
status=`expr $status + $ret`
if [ $ret != 0 ]; then echo "I:failed"; fi
status=`expr $status + $ret`
-if [ -x ${SAMPLE} ] ; then
+if [ -x ${RESOLVE} ] ; then
ret=0
echo "I:checking negative wildcard validation NSEC3 using dns_client ($n)"
- $SAMPLE $SAMPLEKEY -p 5300 -t txt 10.53.0.4 b.wild.nsec3.example > /dev/null 2> sample.out$n || ret=1
- grep "resolution failed: ncache nxrrset" sample.out$n > /dev/null || ret=1
+ $RESOLVE $RESKEY -p 5300 -t txt -s 10.53.0.4 b.wild.nsec3.example > /dev/null 2> resolve.out$n || ret=1
+ grep "resolution failed: ncache nxrrset" resolve.out$n > /dev/null || ret=1
n=`expr $n + 1`
if [ $ret != 0 ]; then echo "I:failed"; fi
status=`expr $status + $ret`
if [ $ret != 0 ]; then echo "I:failed"; fi
status=`expr $status + $ret`
-if [ -x ${SAMPLE} ] ; then
+if [ -x ${RESOLVE} ] ; then
ret=0
echo "I:checking negative wildcard validation OPTOUT using dns_client ($n)"
- $SAMPLE $SAMPLEKEY -p 5300 -t txt 10.53.0.4 b.optout.nsec3.example > /dev/null 2> sample.out$n || ret=1
- grep "resolution failed: ncache nxrrset" sample.out$n > /dev/null || ret=1
+ $RESOLVE $RESKEY -p 5300 -t txt -s 10.53.0.4 b.optout.nsec3.example > /dev/null 2> resolve.out$n || ret=1
+ grep "resolution failed: ncache nxrrset" resolve.out$n > /dev/null || ret=1
n=`expr $n + 1`
if [ $ret != 0 ]; then echo "I:failed"; fi
status=`expr $status + $ret`
if [ $ret != 0 ]; then echo "I:failed"; fi
status=`expr $status + $ret`
-if [ -x ${SAMPLE} ] ; then
+if [ -x ${RESOLVE} ] ; then
ret=0
echo "I:checking 1-server insecurity proof NSEC using dns_client ($n)"
- $SAMPLE $SAMPLEKEY -p 5300 -t a 10.53.0.4 a.insecure.example > sample.out$n || ret=1
- grep "a.insecure.example..*10.0.0.1" sample.out$n > /dev/null || ret=1
+ $RESOLVE $RESKEY -p 5300 -t a -s 10.53.0.4 a.insecure.example > resolve.out$n || ret=1
+ grep "a.insecure.example..*10.0.0.1" resolve.out$n > /dev/null || ret=1
n=`expr $n + 1`
if [ $ret != 0 ]; then echo "I:failed"; fi
status=`expr $status + $ret`
if [ $ret != 0 ]; then echo "I:failed"; fi
status=`expr $status + $ret`
-if [ -x ${SAMPLE} ] ; then
+if [ -x ${RESOLVE} ] ; then
ret=0
echo "I:checking 1-server insecurity proof NSEC3 using dns_client ($n)"
- $SAMPLE $SAMPLEKEY -p 5300 -t a 10.53.0.4 a.insecure.nsec3.example > sample.out$n || ret=1
- grep "a.insecure.nsec3.example..*10.0.0.1" sample.out$n > /dev/null || ret=1
+ $RESOLVE $RESKEY -p 5300 -t a -s 10.53.0.4 a.insecure.nsec3.example > resolve.out$n || ret=1
+ grep "a.insecure.nsec3.example..*10.0.0.1" resolve.out$n > /dev/null || ret=1
n=`expr $n + 1`
if [ $ret != 0 ]; then echo "I:failed"; fi
status=`expr $status + $ret`
if [ $ret != 0 ]; then echo "I:failed"; fi
status=`expr $status + $ret`
-if [ -x ${SAMPLE} ] ; then
+if [ -x ${RESOLVE} ] ; then
ret=0
echo "I:checking 1-server insecurity proof OPTOUT using dns_client ($n)"
- $SAMPLE $SAMPLEKEY -p 5300 -t a 10.53.0.4 a.insecure.optout.example > sample.out$n || ret=1
- grep "a.insecure.optout.example..*10.0.0.1" sample.out$n > /dev/null || ret=1
+ $RESOLVE $RESKEY -p 5300 -t a -s 10.53.0.4 a.insecure.optout.example > resolve.out$n || ret=1
+ grep "a.insecure.optout.example..*10.0.0.1" resolve.out$n > /dev/null || ret=1
n=`expr $n + 1`
if [ $ret != 0 ]; then echo "I:failed"; fi
status=`expr $status + $ret`
if [ $ret != 0 ]; then echo "I:failed"; fi
status=`expr $status + $ret`
-if [ -x ${SAMPLE} ] ; then
+if [ -x ${RESOLVE} ] ; then
ret=0
echo "I:checking 1-server negative insecurity proof NSEC using dns_client ($n)"
- $SAMPLE $SAMPLEKEY -p 5300 -t a 10.53.0.4 q.insecure.example > /dev/null 2> sample.out$n || ret=1
- grep "resolution failed: ncache nxdomain" sample.out$n > /dev/null || ret=1
+ $RESOLVE $RESKEY -p 5300 -t a -s 10.53.0.4 q.insecure.example > /dev/null 2> resolve.out$n || ret=1
+ grep "resolution failed: ncache nxdomain" resolve.out$n > /dev/null || ret=1
n=`expr $n + 1`
if [ $ret != 0 ]; then echo "I:failed"; fi
status=`expr $status + $ret`
if [ $ret != 0 ]; then echo "I:failed"; fi
status=`expr $status + $ret`
-if [ -x ${SAMPLE} ] ; then
+if [ -x ${RESOLVE} ] ; then
ret=0
echo "I:checking 1-server negative insecurity proof NSEC3 using dns_client ($n)"
- $SAMPLE $SAMPLEKEY -p 5300 -t a 10.53.0.4 q.insecure.nsec3.example > /dev/null 2> sample.out$n || ret=1
- grep "resolution failed: ncache nxdomain" sample.out$n > /dev/null || ret=1
+ $RESOLVE $RESKEY -p 5300 -t a -s 10.53.0.4 q.insecure.nsec3.example > /dev/null 2> resolve.out$n || ret=1
+ grep "resolution failed: ncache nxdomain" resolve.out$n > /dev/null || ret=1
n=`expr $n + 1`
if [ $ret != 0 ]; then echo "I:failed"; fi
status=`expr $status + $ret`
if [ $ret != 0 ]; then echo "I:failed"; fi
status=`expr $status + $ret`
-if [ -x ${SAMPLE} ] ; then
+if [ -x ${RESOLVE} ] ; then
ret=0
echo "I:checking 1-server negative insecurity proof OPTOUT using dns_client ($n)"
- $SAMPLE $SAMPLEKEY -p 5300 -t a 10.53.0.4 q.insecure.optout.example > /dev/null 2> sample.out$n || ret=1
- grep "resolution failed: ncache nxdomain" sample.out$n > /dev/null || ret=1
+ $RESOLVE $RESKEY -p 5300 -t a -s 10.53.0.4 q.insecure.optout.example > /dev/null 2> resolve.out$n || ret=1
+ grep "resolution failed: ncache nxdomain" resolve.out$n > /dev/null || ret=1
n=`expr $n + 1`
if [ $ret != 0 ]; then echo "I:failed"; fi
status=`expr $status + $ret`
if [ $ret != 0 ]; then echo "I:failed"; fi
status=`expr $status + $ret`
-if [ -x ${SAMPLE} ] ; then
+if [ -x ${RESOLVE} ] ; then
ret=0
echo "I:checking failed validation using dns_client ($n)"
- $SAMPLE $SAMPLEKEY -p 5300 -t a 10.53.0.4 a.bogus.example > /dev/null 2> sample.out$n || ret=1
- grep "resolution failed: no valid RRSIG" sample.out$n > /dev/null || ret=1
+ $RESOLVE $RESKEY -p 5300 -t a -s 10.53.0.4 a.bogus.example > /dev/null 2> resolve.out$n || ret=1
+ grep "resolution failed: no valid RRSIG" resolve.out$n > /dev/null || ret=1
n=`expr $n + 1`
if [ $ret != 0 ]; then echo "I:failed"; fi
status=`expr $status + $ret`
if [ $ret != 0 ]; then echo "I:failed"; fi
status=`expr $status + $ret`
-if [ -x ${SAMPLE} ] ; then
+if [ -x ${RESOLVE} ] ; then
ret=0
echo "I:checking that validation fails when key record is missing using dns_client ($n)"
- $SAMPLE $SAMPLEKEY -p 5300 -t a 10.53.0.4 a.b.keyless.example > /dev/null 2> sample.out$n || ret=1
- grep "resolution failed: broken trust chain" sample.out$n > /dev/null || ret=1
+ $RESOLVE $RESKEY -p 5300 -t a -s 10.53.0.4 a.b.keyless.example > /dev/null 2> resolve.out$n || ret=1
+ grep "resolution failed: broken trust chain" resolve.out$n > /dev/null || ret=1
n=`expr $n + 1`
if [ $ret != 0 ]; then echo "I:failed"; fi
status=`expr $status + $ret`
rm -f ns6/to-be-removed.tld.db ns6/to-be-removed.tld.db.jnl
rm -f ns7/server.db ns7/server.db.jnl
rm -f random.data
-rm -f sample.out
+rm -f resolve.out
if [ $ret != 0 ]; then echo "I:failed"; fi
status=`expr $status + $ret`
-if [ -x ${SAMPLE} ] ; then
+if [ -x ${RESOLVE} ] ; then
echo "I:checking non-cachable NXDOMAIN response handling using dns_client"
ret=0
- ${SAMPLE} -p 5300 -t a 10.53.0.1 nxdomain.example.net 2> sample.out || ret=1
- grep "resolution failed: ncache nxdomain" sample.out > /dev/null || ret=1
+ ${RESOLVE} -p 5300 -t a -s 10.53.0.1 nxdomain.example.net 2> resolve.out || ret=1
+ grep "resolution failed: ncache nxdomain" resolve.out > /dev/null || ret=1
if [ $ret != 0 ]; then echo "I:failed"; fi
status=`expr $status + $ret`
fi
if [ $ret != 0 ]; then echo "I:failed"; fi
status=`expr $status + $ret`
-if [ -x ${SAMPLE} ] ; then
+if [ -x ${RESOLVE} ] ; then
echo "I:checking non-cachable NODATA response handling using dns_client"
ret=0
- ${SAMPLE} -p 5300 -t a 10.53.0.1 nodata.example.net 2> sample.out || ret=1
- grep "resolution failed: ncache nxrrset" sample.out > /dev/null || ret=1
+ ${RESOLVE} -p 5300 -t a -s 10.53.0.1 nodata.example.net 2> resolve.out || ret=1
+ grep "resolution failed: ncache nxrrset" resolve.out > /dev/null || ret=1
if [ $ret != 0 ]; then echo "I:failed"; fi
status=`expr $status + $ret`
fi
# If the server has the "INSIST(!external)" bug, this query will kill it.
$DIG +tcp www.example.com. a @10.53.0.1 -p 5300 >/dev/null || status=1
-if [ -x ${SAMPLE} ] ; then
+if [ -x ${RESOLVE} ] ; then
echo "I:checking handling of bogus referrals using dns_client"
ret=0
- ${SAMPLE} -p 5300 -t a 10.53.0.1 www.example.com 2> sample.out || ret=1
- grep "resolution failed: failure" sample.out > /dev/null || ret=1
+ ${RESOLVE} -p 5300 -t a -s 10.53.0.1 www.example.com 2> resolve.out || ret=1
+ grep "resolution failed: failure" resolve.out > /dev/null || ret=1
if [ $ret != 0 ]; then echo "I:failed"; fi
status=`expr $status + $ret`
fi
status=`expr $status + $ret`
-if [ -x ${SAMPLE} ] ; then
+if [ -x ${RESOLVE} ] ; then
echo "I:checking answer IPv4 address filtering using dns_client (accept)"
ret=0
- ${SAMPLE} -p 5300 -t a 10.53.0.1 www.example.org > sample.out || ret=1
- grep "www.example.org..*.192.0.2.1" sample.out > /dev/null || ret=1
+ ${RESOLVE} -p 5300 -t a -s 10.53.0.1 www.example.org > resolve.out || ret=1
+ grep "www.example.org..*.192.0.2.1" resolve.out > /dev/null || ret=1
if [ $ret != 0 ]; then echo "I:failed"; fi
status=`expr $status + $ret`
fi
if [ $ret != 0 ]; then echo "I:failed"; fi
status=`expr $status + $ret`
-if [ -x ${SAMPLE} ] ; then
+if [ -x ${RESOLVE} ] ; then
echo "I:checking answer IPv6 address filtering using dns_client (accept)"
ret=0
- ${SAMPLE} -p 5300 -t aaaa 10.53.0.1 www.example.org > sample.out || ret=1
- grep "www.example.org..*.2001:db8:beef::1" sample.out > /dev/null || ret=1
+ ${RESOLVE} -p 5300 -t aaaa -s 10.53.0.1 www.example.org > resolve.out || ret=1
+ grep "www.example.org..*.2001:db8:beef::1" resolve.out > /dev/null || ret=1
if [ $ret != 0 ]; then echo "I:failed"; fi
status=`expr $status + $ret`
fi
if [ $ret != 0 ]; then echo "I:failed"; fi
status=`expr $status + $ret`
-if [ -x ${SAMPLE} ] ; then
+if [ -x ${RESOLVE} ] ; then
echo "I:checking CNAME target filtering using dns_client (accept)"
ret=0
- ${SAMPLE} -p 5300 -t a 10.53.0.1 goodcname.example.net > sample.out || ret=1
- grep "goodcname.example.net..*.goodcname.example.org." sample.out > /dev/null || ret=1
- grep "goodcname.example.org..*.192.0.2.1" sample.out > /dev/null || ret=1
+ ${RESOLVE} -p 5300 -t a -s 10.53.0.1 goodcname.example.net > resolve.out || ret=1
+ grep "goodcname.example.net..*.goodcname.example.org." resolve.out > /dev/null || ret=1
+ grep "goodcname.example.org..*.192.0.2.1" resolve.out > /dev/null || ret=1
if [ $ret != 0 ]; then echo "I:failed"; fi
status=`expr $status + $ret`
fi
if [ $ret != 0 ]; then echo "I:failed"; fi
status=`expr $status + $ret`
-if [ -x ${SAMPLE} ] ; then
+if [ -x ${RESOLVE} ] ; then
echo "I:checking CNAME target filtering using dns_client (accept due to subdomain)"
ret=0
- ${SAMPLE} -p 5300 -t a 10.53.0.1 cname.sub.example.org > sample.out || ret=1
- grep "cname.sub.example.org..*.ok.sub.example.org." sample.out > /dev/null || ret=1
- grep "ok.sub.example.org..*.192.0.2.1" sample.out > /dev/null || ret=1
+ ${RESOLVE} -p 5300 -t a -s 10.53.0.1 cname.sub.example.org > resolve.out || ret=1
+ grep "cname.sub.example.org..*.ok.sub.example.org." resolve.out > /dev/null || ret=1
+ grep "ok.sub.example.org..*.192.0.2.1" resolve.out > /dev/null || ret=1
if [ $ret != 0 ]; then echo "I:failed"; fi
status=`expr $status + $ret`
fi
if [ $ret != 0 ]; then echo "I:failed"; fi
status=`expr $status + $ret`
-if [ -x ${SAMPLE} ] ; then
+if [ -x ${RESOLVE} ] ; then
echo "I:checking DNAME target filtering using dns_client (accept)"
ret=0
- ${SAMPLE} -p 5300 -t a 10.53.0.1 foo.gooddname.example.net > sample.out || ret=1
- grep "foo.gooddname.example.net..*.gooddname.example.org" sample.out > /dev/null || ret=1
- grep "foo.gooddname.example.org..*.192.0.2.1" sample.out > /dev/null || ret=1
+ ${RESOLVE} -p 5300 -t a -s 10.53.0.1 foo.gooddname.example.net > resolve.out || ret=1
+ grep "foo.gooddname.example.net..*.gooddname.example.org" resolve.out > /dev/null || ret=1
+ grep "foo.gooddname.example.org..*.192.0.2.1" resolve.out > /dev/null || ret=1
if [ $ret != 0 ]; then echo "I:failed"; fi
status=`expr $status + $ret`
fi
if [ $ret != 0 ]; then echo "I:failed"; fi
status=`expr $status + $ret`
-if [ -x ${SAMPLE} ] ; then
+if [ -x ${RESOLVE} ] ; then
echo "I:checking DNAME target filtering using dns_client (accept due to subdomain)"
ret=0
- ${SAMPLE} -p 5300 -t a 10.53.0.1 www.dname.sub.example.org > sample.out || ret=1
- grep "www.dname.sub.example.org..*.ok.sub.example.org." sample.out > /dev/null || ret=1
- grep "www.ok.sub.example.org..*.192.0.2.1" sample.out > /dev/null || ret=1
+ ${RESOLVE} -p 5300 -t a -s 10.53.0.1 www.dname.sub.example.org > resolve.out || ret=1
+ grep "www.dname.sub.example.org..*.ok.sub.example.org." resolve.out > /dev/null || ret=1
+ grep "www.ok.sub.example.org..*.192.0.2.1" resolve.out > /dev/null || ret=1
if [ $ret != 0 ]; then echo "I:failed"; fi
status=`expr $status + $ret`
fi
ISC_PLATFORM_NEEDNETINETIN6H
LWRES_PLATFORM_HAVEIPV6
ISC_PLATFORM_HAVEIPV6
-export_includedir
-export_libdir
BIND9_CO_RULE
-LIBEXPORT
LIBTOOL_IN_MAIN
LIBTOOL_ALLOW_UNDEFINED
LIBTOOL_MODE_LINK
with_libtool
enable_backtrace
enable_symtable
-enable_exportlib
-with_export_libdir
-with_export_includedir
enable_ipv6
with_kame
enable_getifaddrs
--enable-backtrace log stack backtrace on abort [default=yes]
--enable-symtable use internal symbol table for backtrace
[all|minimal(default)|none]
- --enable-exportlib build exportable library (GNU make required)
- [default=no]
--enable-ipv6 use IPv6 default=autodetect
--enable-getifaddrs Enable the use of getifaddrs() [yes|no].
--disable-isc-spnego use SPNEGO from GSSAPI library
--with-libjson=PATH Build with libjson0 library yes|no|path
--with-purify=PATH use Rational purify
--with-libtool use GNU libtool
- --with-export-libdir=PATH
- installation directory for the export library
- [EPREFIX/lib/bind9]
- --with-export-includedir=PATH
- installation directory for the header files of the
- export library [PREFIX/include/bind9]
--with-kame=PATH use Kame IPv6 default path /usr/local/v6
--with-readline=LIBSPEC specify readline library default -lreadline
test "${with_atf+set}" = set || with_atf=yes
test "${enable_filter_aaaa+set}" = set || enable_filter_aaaa=yes
test "${with_dlz_filesystem+set}" = set || with_dlz_filesystem=yes
- case "$host" in
- *-darwin*)
- test "${enable_exportlib+set}" = set || enable_exportlib=yes
- ;;
- *-linux*)
- test "${enable_exportlib+set}" = set || enable_exportlib=yes
- ;;
- esac
;;
esac
#
-#
-# build exportable DNS library?
-#
-# Check whether --enable-exportlib was given.
-if test "${enable_exportlib+set}" = set; then :
- enableval=$enable_exportlib;
-fi
-
-case "$enable_exportlib" in
- yes)
- gmake=
- for x in gmake gnumake make; do
- if $x --version 2>/dev/null | grep GNU > /dev/null; then
- gmake=$x
- break;
- fi
- done
- if test -z "$gmake"; then
- as_fn_error $? "exportlib requires GNU make. Install it or disable the feature." "$LINENO" 5
- fi
- LIBEXPORT=lib/export
-
- BIND9_CO_RULE="%.$O: \${srcdir}/%.c"
- ;;
- no|*)
- BIND9_CO_RULE=".c.$O:"
- ;;
-esac
-
-
-
-# Check whether --with-export-libdir was given.
-if test "${with_export_libdir+set}" = set; then :
- withval=$with_export_libdir; export_libdir="$withval"
-fi
-
-if test -z "$export_libdir"; then
- export_libdir="\${exec_prefix}/lib/bind9/"
-fi
-
-
-
-# Check whether --with-export-includedir was given.
-if test "${with_export_includedir+set}" = set; then :
- withval=$with_export_includedir; export_includedir="$withval"
-fi
-
-if test -z "$export_includedir"; then
- export_includedir="\${prefix}/include/bind9/"
-fi
+BIND9_CO_RULE=".c.$O:"
#
# elsewhere if there's a good reason for doing so.
#
-ac_config_files="$ac_config_files make/Makefile make/mkdep Makefile bin/Makefile bin/check/Makefile bin/confgen/Makefile bin/confgen/unix/Makefile bin/dig/Makefile bin/dnssec/Makefile bin/named/Makefile bin/named/unix/Makefile bin/nsupdate/Makefile bin/pkcs11/Makefile bin/python/Makefile bin/python/dnssec-checkds.py bin/python/dnssec-coverage.py bin/rndc/Makefile bin/tests/Makefile bin/tests/atomic/Makefile bin/tests/db/Makefile bin/tests/dst/Makefile bin/tests/dst/Kdh.+002+18602.key bin/tests/dst/Kdh.+002+18602.private bin/tests/dst/Kdh.+002+48957.key bin/tests/dst/Kdh.+002+48957.private bin/tests/dst/Ktest.+001+00002.key bin/tests/dst/Ktest.+001+54622.key bin/tests/dst/Ktest.+001+54622.private bin/tests/dst/Ktest.+003+23616.key bin/tests/dst/Ktest.+003+23616.private bin/tests/dst/Ktest.+003+49667.key bin/tests/dst/dst_2_data bin/tests/dst/t2_data_1 bin/tests/dst/t2_data_2 bin/tests/dst/t2_dsasig bin/tests/dst/t2_rsasig bin/tests/hashes/Makefile bin/tests/headerdep_test.sh bin/tests/master/Makefile bin/tests/mem/Makefile bin/tests/names/Makefile bin/tests/net/Makefile bin/tests/rbt/Makefile bin/tests/resolver/Makefile bin/tests/sockaddr/Makefile bin/tests/system/Makefile bin/tests/system/conf.sh bin/tests/system/dlz/prereq.sh bin/tests/system/dlzexternal/Makefile bin/tests/system/dlzexternal/ns1/named.conf bin/tests/system/dsdigest/prereq.sh bin/tests/system/ecdsa/prereq.sh bin/tests/system/dlzredir/prereq.sh bin/tests/system/filter-aaaa/Makefile bin/tests/system/geoip/Makefile bin/tests/system/gost/prereq.sh bin/tests/system/lwresd/Makefile bin/tests/system/rpz/Makefile bin/tests/system/rsabigexponent/Makefile bin/tests/system/tkey/Makefile bin/tests/system/tsiggss/Makefile bin/tests/tasks/Makefile bin/tests/timers/Makefile bin/tests/virtual-time/Makefile bin/tests/virtual-time/conf.sh bin/tools/Makefile contrib/check-secure-delegation.pl contrib/zone-edit.sh doc/Makefile doc/arm/Makefile doc/doxygen/Doxyfile doc/doxygen/Makefile doc/doxygen/doxygen-input-filter doc/misc/Makefile doc/xsl/Makefile doc/xsl/isc-docbook-chunk.xsl doc/xsl/isc-docbook-html.xsl doc/xsl/isc-docbook-latex.xsl doc/xsl/isc-manpage.xsl isc-config.sh lib/Makefile lib/bind9/Makefile lib/bind9/include/Makefile lib/bind9/include/bind9/Makefile lib/dns/Makefile lib/dns/include/Makefile lib/dns/include/dns/Makefile lib/dns/include/dst/Makefile lib/dns/tests/Makefile lib/export/Makefile lib/export/dns/Makefile lib/export/dns/include/Makefile lib/export/dns/include/dns/Makefile lib/export/dns/include/dst/Makefile lib/export/irs/Makefile lib/export/irs/include/Makefile lib/export/irs/include/irs/Makefile lib/export/isc/$thread_dir/Makefile lib/export/isc/$thread_dir/include/Makefile lib/export/isc/$thread_dir/include/isc/Makefile lib/export/isc/Makefile lib/export/isc/include/Makefile lib/export/isc/include/isc/Makefile lib/export/isc/nls/Makefile lib/export/isc/unix/Makefile lib/export/isc/unix/include/Makefile lib/export/isc/unix/include/isc/Makefile lib/export/isccfg/Makefile lib/export/isccfg/include/Makefile lib/export/isccfg/include/isccfg/Makefile lib/export/samples/Makefile lib/export/samples/Makefile-postinstall lib/irs/Makefile lib/irs/include/Makefile lib/irs/include/irs/Makefile lib/irs/include/irs/netdb.h lib/irs/include/irs/platform.h lib/isc/$arch/Makefile lib/isc/$arch/include/Makefile lib/isc/$arch/include/isc/Makefile lib/isc/$thread_dir/Makefile lib/isc/$thread_dir/include/Makefile lib/isc/$thread_dir/include/isc/Makefile lib/isc/Makefile lib/isc/include/Makefile lib/isc/include/isc/Makefile lib/isc/include/isc/platform.h lib/isc/tests/Makefile lib/isc/nls/Makefile lib/isc/unix/Makefile lib/isc/unix/include/Makefile lib/isc/unix/include/isc/Makefile lib/isccc/Makefile lib/isccc/include/Makefile lib/isccc/include/isccc/Makefile lib/isccfg/Makefile lib/isccfg/include/Makefile lib/isccfg/include/isccfg/Makefile lib/lwres/Makefile lib/lwres/include/Makefile lib/lwres/include/lwres/Makefile lib/lwres/include/lwres/netdb.h lib/lwres/include/lwres/platform.h lib/lwres/man/Makefile lib/lwres/unix/Makefile lib/lwres/unix/include/Makefile lib/lwres/unix/include/lwres/Makefile lib/tests/Makefile lib/tests/include/Makefile lib/tests/include/tests/Makefile unit/Makefile unit/unittest.sh"
+ac_config_files="$ac_config_files make/Makefile make/mkdep Makefile bin/Makefile bin/check/Makefile bin/confgen/Makefile bin/confgen/unix/Makefile bin/dig/Makefile bin/dnssec/Makefile bin/named/Makefile bin/named/unix/Makefile bin/nsupdate/Makefile bin/pkcs11/Makefile bin/python/Makefile bin/python/dnssec-checkds.py bin/python/dnssec-coverage.py bin/rndc/Makefile bin/tests/Makefile bin/tests/atomic/Makefile bin/tests/db/Makefile bin/tests/dst/Makefile bin/tests/dst/Kdh.+002+18602.key bin/tests/dst/Kdh.+002+18602.private bin/tests/dst/Kdh.+002+48957.key bin/tests/dst/Kdh.+002+48957.private bin/tests/dst/Ktest.+001+00002.key bin/tests/dst/Ktest.+001+54622.key bin/tests/dst/Ktest.+001+54622.private bin/tests/dst/Ktest.+003+23616.key bin/tests/dst/Ktest.+003+23616.private bin/tests/dst/Ktest.+003+49667.key bin/tests/dst/dst_2_data bin/tests/dst/t2_data_1 bin/tests/dst/t2_data_2 bin/tests/dst/t2_dsasig bin/tests/dst/t2_rsasig bin/tests/hashes/Makefile bin/tests/headerdep_test.sh bin/tests/master/Makefile bin/tests/mem/Makefile bin/tests/names/Makefile bin/tests/net/Makefile bin/tests/rbt/Makefile bin/tests/resolver/Makefile bin/tests/sockaddr/Makefile bin/tests/system/Makefile bin/tests/system/conf.sh bin/tests/system/dlz/prereq.sh bin/tests/system/dlzexternal/Makefile bin/tests/system/dlzexternal/ns1/named.conf bin/tests/system/dsdigest/prereq.sh bin/tests/system/ecdsa/prereq.sh bin/tests/system/dlzredir/prereq.sh bin/tests/system/filter-aaaa/Makefile bin/tests/system/geoip/Makefile bin/tests/system/gost/prereq.sh bin/tests/system/lwresd/Makefile bin/tests/system/rpz/Makefile bin/tests/system/rsabigexponent/Makefile bin/tests/system/tkey/Makefile bin/tests/system/tsiggss/Makefile bin/tests/tasks/Makefile bin/tests/timers/Makefile bin/tests/virtual-time/Makefile bin/tests/virtual-time/conf.sh bin/tools/Makefile contrib/check-secure-delegation.pl contrib/zone-edit.sh doc/Makefile doc/arm/Makefile doc/doxygen/Doxyfile doc/doxygen/Makefile doc/doxygen/doxygen-input-filter doc/misc/Makefile doc/xsl/Makefile doc/xsl/isc-docbook-chunk.xsl doc/xsl/isc-docbook-html.xsl doc/xsl/isc-docbook-latex.xsl doc/xsl/isc-manpage.xsl isc-config.sh lib/Makefile lib/bind9/Makefile lib/bind9/include/Makefile lib/bind9/include/bind9/Makefile lib/dns/Makefile lib/dns/include/Makefile lib/dns/include/dns/Makefile lib/dns/include/dst/Makefile lib/dns/tests/Makefile lib/irs/Makefile lib/irs/include/Makefile lib/irs/include/irs/Makefile lib/irs/include/irs/netdb.h lib/irs/include/irs/platform.h lib/isc/$arch/Makefile lib/isc/$arch/include/Makefile lib/isc/$arch/include/isc/Makefile lib/isc/$thread_dir/Makefile lib/isc/$thread_dir/include/Makefile lib/isc/$thread_dir/include/isc/Makefile lib/isc/Makefile lib/isc/include/Makefile lib/isc/include/isc/Makefile lib/isc/include/isc/platform.h lib/isc/tests/Makefile lib/isc/nls/Makefile lib/isc/unix/Makefile lib/isc/unix/include/Makefile lib/isc/unix/include/isc/Makefile lib/isccc/Makefile lib/isccc/include/Makefile lib/isccc/include/isccc/Makefile lib/isccfg/Makefile lib/isccfg/include/Makefile lib/isccfg/include/isccfg/Makefile lib/lwres/Makefile lib/lwres/include/Makefile lib/lwres/include/lwres/Makefile lib/lwres/include/lwres/netdb.h lib/lwres/include/lwres/platform.h lib/lwres/man/Makefile lib/lwres/unix/Makefile lib/lwres/unix/include/Makefile lib/lwres/unix/include/lwres/Makefile lib/tests/Makefile lib/tests/include/Makefile lib/tests/include/tests/Makefile lib/samples/Makefile lib/samples/Makefile-postinstall unit/Makefile unit/unittest.sh"
#
"lib/dns/include/dns/Makefile") CONFIG_FILES="$CONFIG_FILES lib/dns/include/dns/Makefile" ;;
"lib/dns/include/dst/Makefile") CONFIG_FILES="$CONFIG_FILES lib/dns/include/dst/Makefile" ;;
"lib/dns/tests/Makefile") CONFIG_FILES="$CONFIG_FILES lib/dns/tests/Makefile" ;;
- "lib/export/Makefile") CONFIG_FILES="$CONFIG_FILES lib/export/Makefile" ;;
- "lib/export/dns/Makefile") CONFIG_FILES="$CONFIG_FILES lib/export/dns/Makefile" ;;
- "lib/export/dns/include/Makefile") CONFIG_FILES="$CONFIG_FILES lib/export/dns/include/Makefile" ;;
- "lib/export/dns/include/dns/Makefile") CONFIG_FILES="$CONFIG_FILES lib/export/dns/include/dns/Makefile" ;;
- "lib/export/dns/include/dst/Makefile") CONFIG_FILES="$CONFIG_FILES lib/export/dns/include/dst/Makefile" ;;
- "lib/export/irs/Makefile") CONFIG_FILES="$CONFIG_FILES lib/export/irs/Makefile" ;;
- "lib/export/irs/include/Makefile") CONFIG_FILES="$CONFIG_FILES lib/export/irs/include/Makefile" ;;
- "lib/export/irs/include/irs/Makefile") CONFIG_FILES="$CONFIG_FILES lib/export/irs/include/irs/Makefile" ;;
- "lib/export/isc/$thread_dir/Makefile") CONFIG_FILES="$CONFIG_FILES lib/export/isc/$thread_dir/Makefile" ;;
- "lib/export/isc/$thread_dir/include/Makefile") CONFIG_FILES="$CONFIG_FILES lib/export/isc/$thread_dir/include/Makefile" ;;
- "lib/export/isc/$thread_dir/include/isc/Makefile") CONFIG_FILES="$CONFIG_FILES lib/export/isc/$thread_dir/include/isc/Makefile" ;;
- "lib/export/isc/Makefile") CONFIG_FILES="$CONFIG_FILES lib/export/isc/Makefile" ;;
- "lib/export/isc/include/Makefile") CONFIG_FILES="$CONFIG_FILES lib/export/isc/include/Makefile" ;;
- "lib/export/isc/include/isc/Makefile") CONFIG_FILES="$CONFIG_FILES lib/export/isc/include/isc/Makefile" ;;
- "lib/export/isc/nls/Makefile") CONFIG_FILES="$CONFIG_FILES lib/export/isc/nls/Makefile" ;;
- "lib/export/isc/unix/Makefile") CONFIG_FILES="$CONFIG_FILES lib/export/isc/unix/Makefile" ;;
- "lib/export/isc/unix/include/Makefile") CONFIG_FILES="$CONFIG_FILES lib/export/isc/unix/include/Makefile" ;;
- "lib/export/isc/unix/include/isc/Makefile") CONFIG_FILES="$CONFIG_FILES lib/export/isc/unix/include/isc/Makefile" ;;
- "lib/export/isccfg/Makefile") CONFIG_FILES="$CONFIG_FILES lib/export/isccfg/Makefile" ;;
- "lib/export/isccfg/include/Makefile") CONFIG_FILES="$CONFIG_FILES lib/export/isccfg/include/Makefile" ;;
- "lib/export/isccfg/include/isccfg/Makefile") CONFIG_FILES="$CONFIG_FILES lib/export/isccfg/include/isccfg/Makefile" ;;
- "lib/export/samples/Makefile") CONFIG_FILES="$CONFIG_FILES lib/export/samples/Makefile" ;;
- "lib/export/samples/Makefile-postinstall") CONFIG_FILES="$CONFIG_FILES lib/export/samples/Makefile-postinstall" ;;
"lib/irs/Makefile") CONFIG_FILES="$CONFIG_FILES lib/irs/Makefile" ;;
"lib/irs/include/Makefile") CONFIG_FILES="$CONFIG_FILES lib/irs/include/Makefile" ;;
"lib/irs/include/irs/Makefile") CONFIG_FILES="$CONFIG_FILES lib/irs/include/irs/Makefile" ;;
"lib/tests/Makefile") CONFIG_FILES="$CONFIG_FILES lib/tests/Makefile" ;;
"lib/tests/include/Makefile") CONFIG_FILES="$CONFIG_FILES lib/tests/include/Makefile" ;;
"lib/tests/include/tests/Makefile") CONFIG_FILES="$CONFIG_FILES lib/tests/include/tests/Makefile" ;;
+ "lib/samples/Makefile") CONFIG_FILES="$CONFIG_FILES lib/samples/Makefile" ;;
+ "lib/samples/Makefile-postinstall") CONFIG_FILES="$CONFIG_FILES lib/samples/Makefile-postinstall" ;;
"unit/Makefile") CONFIG_FILES="$CONFIG_FILES unit/Makefile" ;;
"unit/unittest.sh") CONFIG_FILES="$CONFIG_FILES unit/unittest.sh" ;;
test "${with_atf+set}" = set || with_atf=yes
test "${enable_filter_aaaa+set}" = set || enable_filter_aaaa=yes
test "${with_dlz_filesystem+set}" = set || with_dlz_filesystem=yes
- case "$host" in
- *-darwin*)
- test "${enable_exportlib+set}" = set || enable_exportlib=yes
- ;;
- *-linux*)
- test "${enable_exportlib+set}" = set || enable_exportlib=yes
- ;;
- esac
;;
esac
#
AC_SUBST(LIBTOOL_ALLOW_UNDEFINED)
AC_SUBST(LIBTOOL_IN_MAIN)
-#
-# build exportable DNS library?
-#
-AC_ARG_ENABLE(exportlib,
- [ --enable-exportlib build exportable library (GNU make required)
- [[default=no]]])
-case "$enable_exportlib" in
- yes)
- gmake=
- for x in gmake gnumake make; do
- if $x --version 2>/dev/null | grep GNU > /dev/null; then
- gmake=$x
- break;
- fi
- done
- if test -z "$gmake"; then
- AC_MSG_ERROR([exportlib requires GNU make. Install it or disable the feature.])
- fi
- LIBEXPORT=lib/export
- AC_SUBST(LIBEXPORT)
- BIND9_CO_RULE="%.$O: \${srcdir}/%.c"
- ;;
- no|*)
- BIND9_CO_RULE=".c.$O:"
- ;;
-esac
+BIND9_CO_RULE=".c.$O:"
AC_SUBST(BIND9_CO_RULE)
-AC_ARG_WITH(export-libdir,
- [ --with-export-libdir[=PATH]
- installation directory for the export library
- [[EPREFIX/lib/bind9]]],
- export_libdir="$withval",)
-if test -z "$export_libdir"; then
- export_libdir="\${exec_prefix}/lib/bind9/"
-fi
-AC_SUBST(export_libdir)
-
-AC_ARG_WITH(export-includedir,
- [ --with-export-includedir[=PATH]
- installation directory for the header files of the
- export library [[PREFIX/include/bind9]]],
- export_includedir="$withval",)
-if test -z "$export_includedir"; then
- export_includedir="\${prefix}/include/bind9/"
-fi
-AC_SUBST(export_includedir)
-
#
# Here begins a very long section to determine the system's networking
# capabilities. The order of the tests is significant.
lib/dns/include/dns/Makefile
lib/dns/include/dst/Makefile
lib/dns/tests/Makefile
- lib/export/Makefile
- lib/export/dns/Makefile
- lib/export/dns/include/Makefile
- lib/export/dns/include/dns/Makefile
- lib/export/dns/include/dst/Makefile
- lib/export/irs/Makefile
- lib/export/irs/include/Makefile
- lib/export/irs/include/irs/Makefile
- lib/export/isc/$thread_dir/Makefile
- lib/export/isc/$thread_dir/include/Makefile
- lib/export/isc/$thread_dir/include/isc/Makefile
- lib/export/isc/Makefile
- lib/export/isc/include/Makefile
- lib/export/isc/include/isc/Makefile
- lib/export/isc/nls/Makefile
- lib/export/isc/unix/Makefile
- lib/export/isc/unix/include/Makefile
- lib/export/isc/unix/include/isc/Makefile
- lib/export/isccfg/Makefile
- lib/export/isccfg/include/Makefile
- lib/export/isccfg/include/isccfg/Makefile
- lib/export/samples/Makefile
- lib/export/samples/Makefile-postinstall
lib/irs/Makefile
lib/irs/include/Makefile
lib/irs/include/irs/Makefile
lib/tests/Makefile
lib/tests/include/Makefile
lib/tests/include/tests/Makefile
+ lib/samples/Makefile
+ lib/samples/Makefile-postinstall
unit/Makefile
unit/unittest.sh
])
# Attempt to disable parallel processing.
.NOTPARALLEL:
.NO_PARALLEL:
-SUBDIRS = isc isccc dns isccfg bind9 lwres tests
+SUBDIRS = isc isccc dns isccfg bind9 lwres irs tests samples
TARGETS =
@BIND9_MAKE_RULES@
stats.@O@ tcpmsg.@O@ time.@O@ timer.@O@ tkey.@O@ \
tsec.@O@ tsig.@O@ ttl.@O@ update.@O@ validator.@O@ \
version.@O@ view.@O@ xfrin.@O@ zone.@O@ zonekey.@O@ zt.@O@
+PORTDNSOBJS = client.@O@ ecdb.@O@
-OBJS= ${DNSOBJS} ${OTHEROBJS} ${DSTOBJS} @GEOIPLINKOBJS@
+OBJS= ${DNSOBJS} ${OTHEROBJS} ${DSTOBJS} ${PORTDNSOBJS} \
+ @GEOIPLINKOBJS@
# Alphabetically
stats.c tcpmsg.c time.c timer.c tkey.c \
tsec.c tsig.c ttl.c update.c validator.c \
version.c view.c xfrin.c zone.c zonekey.c zt.c ${OTHERSRCS}
+PORTDNSSRCS = client.c ecdb.c
-SRCS = ${DSTSRCS} ${DNSSRCS} @GEOIPLINKSRCS@
+SRCS = ${DSTSRCS} ${DNSSRCS} ${PORTDNSSRCS} @GEOIPLINKSRCS@
SUBDIRS = include
TARGETS = include/dns/enumtype.h include/dns/enumclass.h \
${BUILD_CC} ${BUILD_CFLAGS} -I${top_srcdir}/lib/isc/include \
${BUILD_CPPFLAGS} ${BUILD_LDFLAGS} -o $@ ${srcdir}/gen.c ${BUILD_LIBS}
-rbtdb64.@O@: rbtdb.c
+rbtdb64.@O@: rbtdb64.c rbtdb.c
depend: include/dns/enumtype.h include/dns/enumclass.h \
include/dns/rdatastruct.h code.h
return (dns_name_fromtext(name, &buffer, dns_rootname, 0, NULL));
}
-#ifdef BIND9
struct dns_byaddr {
/* Unlocked. */
unsigned int magic;
*byaddrp = NULL;
}
-#endif /* BIND9 */
return (ISC_R_SUCCESS);
}
-#ifdef BIND9
isc_result_t
dns_cache_load(dns_cache_t *cache) {
isc_result_t result;
return (result);
}
-#endif /* BIND9 */
isc_result_t
dns_cache_dump(dns_cache_t *cache) {
-#ifdef BIND9
isc_result_t result;
-#endif
REQUIRE(VALID_CACHE(cache));
if (cache->filename == NULL)
return (ISC_R_SUCCESS);
-#ifdef BIND9
LOCK(&cache->filelock);
result = dns_master_dump(cache->mctx, cache->db, NULL,
&dns_master_style_cache, cache->filename);
UNLOCK(&cache->filelock);
return (result);
-#else
- return (ISC_R_NOTIMPLEMENTED);
-#endif
}
*/
#include "rbtdb.h"
-#ifdef BIND9
#include "rbtdb64.h"
-#endif
static ISC_LIST(dns_dbimplementation_t) implementations;
static isc_rwlock_t implock;
static isc_once_t once = ISC_ONCE_INIT;
static dns_dbimplementation_t rbtimp;
-#ifdef BIND9
static dns_dbimplementation_t rbt64imp;
-#endif
static void
initialize(void) {
rbtimp.driverarg = NULL;
ISC_LINK_INIT(&rbtimp, link);
-#ifdef BIND9
rbt64imp.name = "rbt64";
rbt64imp.create = dns_rbtdb64_create;
rbt64imp.mctx = NULL;
rbt64imp.driverarg = NULL;
ISC_LINK_INIT(&rbt64imp, link);
-#endif
ISC_LIST_INIT(implementations);
ISC_LIST_APPEND(implementations, &rbtimp, link);
-#ifdef BIND9
ISC_LIST_APPEND(implementations, &rbt64imp, link);
-#endif
}
static inline dns_dbimplementation_t *
return (db->rdclass);
}
-#ifdef BIND9
isc_result_t
dns_db_beginload(dns_db_t *db, dns_rdatacallbacks_t *callbacks) {
/*
return ((db->methods->dump)(db, version, filename, masterformat));
}
-#endif /* BIND9 */
/***
*** Version Methods
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
-#ifdef BIND9
static void
dispatch_initrandom(arc4ctx_t *actx, isc_entropy_t *entropy,
isc_mutex_t *lock)
return (result);
}
-#else
-/*
- * For general purpose library, we don't have to be too strict about the
- * quality of random values. Performance doesn't matter much, either.
- * So we simply use the isc_random module to keep the library as small as
- * possible.
- */
-
-static void
-dispatch_initrandom(arc4ctx_t *actx, isc_entropy_t *entropy,
- isc_mutex_t *lock)
-{
- UNUSED(actx);
- UNUSED(entropy);
- UNUSED(lock);
-
- return;
-}
-
-static isc_uint16_t
-dispatch_random(arc4ctx_t *actx) {
- isc_uint32_t r;
-
- UNUSED(actx);
-
- isc_random_get(&r);
- return (r & 0xffff);
-}
-#endif /* BIND9 */
static isc_uint16_t
dispatch_uniformrandom(arc4ctx_t *actx, isc_uint16_t upper_bound) {
INSIST(dispsock->portentry != NULL);
deref_portentry(disp, &dispsock->portentry);
-#ifdef BIND9
if (disp->nsockets > DNS_DISPATCH_POOLSOCKS)
destroy_dispsocket(disp, &dispsock);
else {
destroy_dispsocket(disp, &dispsock);
}
}
-#else
- /* This kind of optimization isn't necessary for normal use */
- UNUSED(qid);
- UNUSED(result);
-
- destroy_dispsocket(disp, &dispsock);
-#endif
}
/*
DESTROYLOCK(&mgr->rpool_lock);
DESTROYLOCK(&mgr->depool_lock);
-#ifdef BIND9
if (mgr->entropy != NULL)
isc_entropy_detach(&mgr->entropy);
-#endif /* BIND9 */
if (mgr->qid != NULL)
qid_destroy(mctx, &mgr->qid);
sock = *sockp;
if (sock != NULL) {
-#ifdef BIND9
result = isc_socket_open(sock);
if (result != ISC_R_SUCCESS)
return (result);
-#else
- INSIST(0);
-#endif
} else if (dup_socket != NULL) {
result = isc_socket_dup(dup_socket, &sock);
if (result != ISC_R_SUCCESS)
if (*sockp == NULL)
isc_socket_detach(&sock);
else {
-#ifdef BIND9
isc_socket_close(sock);
-#else
- INSIST(0);
-#endif
}
return (result);
}
if (result != ISC_R_SUCCESS)
goto kill_dpool;
-#ifdef BIND9
if (entropy != NULL)
isc_entropy_attach(entropy, &mgr->entropy);
-#else
- UNUSED(entropy);
-#endif
dispatch_initrandom(&mgr->arc4ctx, mgr->entropy, &mgr->arc4_lock);
*/
REQUIRE(dbp != NULL && DNS_DLZ_VALID(*dbp));
-#ifdef BIND9
if ((*dbp)->ssutable != NULL) {
dns_ssutable_detach(&(*dbp)->ssutable);
}
-#endif
-
/* call the drivers destroy method */
if ((*dbp) != NULL) {
RWUNLOCK(&dlz_implock, isc_rwlocktype_write);
}
-#ifdef BIND9
/*
* Create a writeable DLZ zone. This can be called by DLZ drivers
* during configure() to create a zone that can be updated. The zone
return (result);
}
-#endif
/*%
* Configure a DLZ driver. This is optional, and if supplied gives
#define DST_AS_STR(t) ((t).value.as_textregion.base)
static dst_func_t *dst_t_func[DST_MAX_ALGS];
-#ifdef BIND9
static isc_entropy_t *dst_entropy_pool = NULL;
-#endif
static unsigned int dst_entropy_flags = 0;
static isc_boolean_t dst_initialized = ISC_FALSE;
return (_r); \
} while (0); \
-#if defined(OPENSSL) && defined(BIND9)
+#if defined(OPENSSL)
static void *
default_memalloc(void *arg, size_t size) {
UNUSED(arg);
isc_result_t result;
REQUIRE(mctx != NULL);
-#ifdef BIND9
- REQUIRE(ectx != NULL);
-#else
- UNUSED(ectx);
-#endif
REQUIRE(dst_initialized == ISC_FALSE);
#ifndef OPENSSL
dst__memory_pool = NULL;
-#if defined(OPENSSL) && defined(BIND9)
+#if defined(OPENSSL)
UNUSED(mctx);
/*
* When using --with-openssl, there seems to be no good way of not
#ifndef OPENSSL_LEAKS
isc_mem_setdestroycheck(dst__memory_pool, ISC_FALSE);
#endif
-#else
+#else /* OPENSSL */
isc_mem_attach(mctx, &dst__memory_pool);
-#endif
-#ifdef BIND9
- isc_entropy_attach(ectx, &dst_entropy_pool);
-#endif
- dst_entropy_flags = eflags;
+#endif /* OPENSSL */
+ if (ectx != NULL) {
+ isc_entropy_attach(ectx, &dst_entropy_pool);
+ dst_entropy_flags = eflags;
+ }
dst_result_register();
#endif
if (dst__memory_pool != NULL)
isc_mem_detach(&dst__memory_pool);
-#ifdef BIND9
if (dst_entropy_pool != NULL)
isc_entropy_detach(&dst_entropy_pool);
-#endif
}
isc_boolean_t
isc_result_t
dst__entropy_getdata(void *buf, unsigned int len, isc_boolean_t pseudo) {
-#ifdef BIND9
unsigned int flags = dst_entropy_flags;
+ if (dst_entropy_pool == NULL)
+ return (ISC_R_FAILURE);
+
if (len == 0)
return (ISC_R_SUCCESS);
if (pseudo)
else
flags |= ISC_ENTROPY_BLOCKING;
return (isc_entropy_getdata(dst_entropy_pool, buf, len, NULL, flags));
-#else
- UNUSED(buf);
- UNUSED(len);
- UNUSED(pseudo);
-
- return (ISC_R_NOTIMPLEMENTED);
-#endif
}
unsigned int
dst__entropy_status(void) {
-#ifdef BIND9
#ifdef GSSAPI
unsigned int flags = dst_entropy_flags;
isc_result_t ret;
unsigned char buf[32];
static isc_boolean_t first = ISC_TRUE;
+ if (dst_entropy_pool == NULL)
+ return (0);
+
if (first) {
/* Someone believes RAND_status() initializes the PRNG */
flags &= ~ISC_ENTROPY_GOODONLY;
}
#endif
return (isc_entropy_status(dst_entropy_pool));
-#else
- return (0);
-#endif
}
isc_buffer_t *
isc_boolean_t search;
char *dlzname;
ISC_LINK(dns_dlzdb_t) link;
-#ifdef BIND9
dns_ssutable_t *ssutable;
-#endif
};
dns_zone_t * managed_keys;
dns_zone_t * redirect;
-#ifdef BIND9
- /* File in which to store configuration for newly added zones */
+ /*
+ * File and configuration data for zones added at runtime
+ * (only used in BIND9).
+ *
+ * XXX: This should be a pointer to an opaque type that
+ * named implements.
+ */
char * new_zone_file;
-
void * new_zone_config;
void (*cfg_destroy)(void **);
-#endif
};
#define DNS_VIEW_MAGIC ISC_MAGIC('V','i','e','w')
*\li *viewp is NULL.
*/
+isc_result_t
+dns_view_createzonetable(dns_view_t *view);
+/*%<
+ * Create a zonetable for the view.
+ *
+ * Requires:
+ *
+ *\li 'view' is a valid, unfrozen view.
+ *
+ *\li 'view' does not have a zonetable already.
+ *
+ * Returns:
+ *
+ *\li #ISC_R_SUCCESS
+ *
+ *\li Any error that dns_zt_create() can return.
+ */
+
isc_result_t
dns_view_createresolver(dns_view_t *view,
isc_taskmgr_t *taskmgr,
static isc_once_t init_once = ISC_ONCE_INIT;
static isc_mem_t *dns_g_mctx = NULL;
-#ifndef BIND9
static dns_dbimplementation_t *dbimp = NULL;
-#endif
static isc_boolean_t initialize_done = ISC_FALSE;
static isc_mutex_t reflock;
static unsigned int references = 0;
if (result != ISC_R_SUCCESS)
return;
dns_result_register();
-#ifndef BIND9
result = dns_ecdb_register(dns_g_mctx, &dbimp);
if (result != ISC_R_SUCCESS)
goto cleanup_mctx;
-#endif
result = isc_hash_create(dns_g_mctx, NULL, DNS_NAME_MAXWIRE);
if (result != ISC_R_SUCCESS)
goto cleanup_db;
cleanup_hash:
isc_hash_destroy();
cleanup_db:
-#ifndef BIND9
- dns_ecdb_unregister(&dbimp);
+ if (dbimp != NULL)
+ dns_ecdb_unregister(&dbimp);
cleanup_mctx:
-#endif
- isc_mem_detach(&dns_g_mctx);
+ if (dns_g_mctx != NULL)
+ isc_mem_detach(&dns_g_mctx);
}
isc_result_t
dst_lib_destroy();
isc_hash_destroy();
-#ifndef BIND9
- dns_ecdb_unregister(&dbimp);
-#endif
- isc_mem_detach(&dns_g_mctx);
+ if (dbimp != NULL)
+ dns_ecdb_unregister(&dbimp);
+ if (dns_g_mctx != NULL)
+ isc_mem_detach(&dns_g_mctx);
}
#define N_TABS 10
static char tabs[N_TABS+1] = "\t\t\t\t\t\t\t\t\t\t";
-#ifdef BIND9
struct dns_dumpctx {
unsigned int magic;
isc_mem_t *mctx;
dns_totext_ctx_t *ctx,
isc_buffer_t *buffer, FILE *f);
};
-#endif /* BIND9 */
#define NXDOMAIN(x) (((x)->attributes & DNS_RDATASETATTR_NXDOMAIN) != 0)
ISC_FALSE, target));
}
-#ifdef BIND9
/*
* Print an rdataset. 'buffer' is a scratch buffer, which must have been
* dynamically allocated by the caller. It must be large enough to
return (result);
}
-#endif /* BIND9 */
isc_result_t
dns_master_stylecreate(dns_master_style_t **stylep, unsigned int flags,
ISC_LINK_INIT(target, link);
}
-#ifdef BIND9
static isc_result_t
rr_exists(dns_db_t *db, dns_dbversion_t *ver, dns_name_t *name,
const dns_rdata_t *rdata, isc_boolean_t *flag)
dns_db_detachnode(db, &node);
return (result);
}
-#endif
-#ifdef BIND9
isc_result_t
dns_nsec3param_deletechains(dns_db_t *db, dns_dbversion_t *ver,
dns_zone_t *zone, isc_boolean_t nonsec,
dns_db_detachnode(db, &node);
return (result);
}
-#endif
isc_result_t
dns_nsec3_addnsec3sx(dns_db_t *db, dns_dbversion_t *version,
static void free_rbtdb(dns_rbtdb_t *rbtdb, isc_boolean_t log,
isc_event_t *event);
static void overmem(dns_db_t *db, isc_boolean_t overmem);
-#ifdef BIND9
static void setnsec3parameters(dns_db_t *db, rbtdb_version_t *version);
-#endif
/*%
* 'init_count' is used to initialize 'newheader->count' which inturn
if (rbtdb->cachestats != NULL)
isc_stats_detach(&rbtdb->cachestats);
-#ifdef BIND9
if (rbtdb->load_rpzs != NULL) {
/*
* We must be cleaning up after a failed zone loading.
REQUIRE(rbtdb->rpz_num < rbtdb->rpzs->p.num_zones);
dns_rpz_detach_rpzs(&rbtdb->rpzs);
}
-#endif
isc_mem_put(rbtdb->common.mctx, rbtdb->node_locks,
rbtdb->node_lock_count * sizeof(rbtdb_nodelock_t));
switch (node->nsec) {
case DNS_RBT_NSEC_NORMAL:
-#ifdef BIND9
if (rbtdb->rpzs != NULL) {
dns_fixedname_init(&fname);
name = dns_fixedname_name(&fname);
dns_rbt_fullnamefromnode(node, name);
dns_rpz_delete(rbtdb->rpzs, rbtdb->rpz_num, name);
}
-#endif
result = dns_rbt_deletenode(rbtdb->tree, node, ISC_FALSE);
break;
case DNS_RBT_NSEC_HAS_NSEC:
}
}
result = dns_rbt_deletenode(rbtdb->tree, node, ISC_FALSE);
-#ifdef BIND9
if (rbtdb->rpzs != NULL)
dns_rpz_delete(rbtdb->rpzs, rbtdb->rpz_num, name);
-#endif
break;
case DNS_RBT_NSEC_NSEC:
result = dns_rbt_deletenode(rbtdb->nsec, node, ISC_FALSE);
static void
iszonesecure(dns_db_t *db, rbtdb_version_t *version, dns_dbnode_t *origin) {
-#ifndef BIND9
- UNUSED(db);
- UNUSED(version);
- UNUSED(origin);
-
- return;
-#else
dns_rdataset_t keyset;
dns_rdataset_t nsecset, signsecset;
isc_boolean_t haszonekey = ISC_FALSE;
version->secure = dns_db_secure;
else
version->secure = dns_db_insecure;
-#endif
}
/*%<
* Walk the origin node looking for NSEC3PARAM records.
* Cache the nsec3 parameters.
*/
-#ifdef BIND9
static void
setnsec3parameters(dns_db_t *db, rbtdb_version_t *version) {
dns_rbtnode_t *node;
isc_rwlocktype_read);
RWUNLOCK(&rbtdb->tree_lock, isc_rwlocktype_read);
}
-#endif
static void
cleanup_dead_nodes_callback(isc_task_t *task, isc_event_t *event) {
node = NULL;
result = dns_rbt_addnode(tree, name, &node);
if (result == ISC_R_SUCCESS) {
-#ifdef BIND9
if (rbtdb->rpzs != NULL && tree == rbtdb->tree) {
dns_fixedname_t fnamef;
dns_name_t *fname;
return (result);
}
}
-#endif
dns_rbt_namefromnode(node, &nodename);
#ifdef DNS_RBT_USEHASH
node->locknum = node->hashval % rbtdb->node_lock_count;
return (result);
}
-#ifdef BIND9
/*
* Connect this RBTDB to the response policy zone summary data for the view.
*/
RWUNLOCK(&rbtdb->tree_lock, isc_rwlocktype_write);
return (result);
}
-#endif
static isc_result_t
cache_find(dns_db_t *db, dns_name_t *name, dns_dbversion_t *version,
noderesult = dns_rbt_addnode(rbtdb->tree, name, nodep);
-#ifdef BIND9
if (rbtdb->rpzs != NULL && noderesult == ISC_R_SUCCESS)
noderesult = dns_rpz_add(rbtdb->load_rpzs, rbtdb->rpz_num,
name);
-#endif
if (!hasnsec)
return (noderesult);
RBTDB_LOCK(&rbtdb->lock, isc_rwlocktype_write);
-#ifdef BIND9
if (rbtdb->rpzs != NULL) {
isc_result_t result;
return (result);
}
}
-#endif
REQUIRE((rbtdb->attributes & (RBTDB_ATTR_LOADED|RBTDB_ATTR_LOADING))
== 0);
REQUIRE(VALID_RBTDB(rbtdb));
INSIST(rbtversion == NULL || rbtversion->rbtdb == rbtdb);
-#ifdef BIND9
return (dns_master_dump2(rbtdb->common.mctx, db, version,
&dns_master_style_default,
filename, masterformat));
-#else
- UNUSED(version);
- UNUSED(filename);
- UNUSED(masterformat);
-
- return (ISC_R_NOTIMPLEMENTED);
-#endif /* BIND9 */
}
static void
resigned,
isdnssec,
NULL,
-#ifdef BIND9
rpz_attach,
rpz_ready,
-#else
- NULL,
- NULL,
-#endif
NULL,
NULL,
NULL,
dns_name_t *fname, dns_message_t *msg,
isc_stdtime_t now)
{
-#ifndef BIND9
- UNUSED(rdataset);
- UNUSED(type);
- UNUSED(qtype);
- UNUSED(acache);
- UNUSED(zonep);
- UNUSED(dbp);
- UNUSED(versionp);
- UNUSED(nodep);
- UNUSED(fname);
- UNUSED(msg);
- UNUSED(now);
-
- return (ISC_R_NOTIMPLEMENTED);
-#else
dns_rbtdb_t *rbtdb = rdataset->private1;
dns_rbtnode_t *rbtnode = rdataset->private2;
unsigned char *raw = rdataset->private3; /* RDATASLAB */
dns_db_detach((dns_db_t **)(void*)&rbtdb);
*arg = NULL;
-#endif /* BIND9 */
}
-#ifdef BIND9
static void
acache_cancelentry(isc_mem_t *mctx, dns_acacheentry_t *entry,
acache_cbarg_t **cbargp)
*cbargp = NULL;
}
-#endif /* BIND9 */
static isc_result_t
rdataset_setadditional(dns_rdataset_t *rdataset, dns_rdatasetadditional_t type,
dns_dbversion_t *version, dns_dbnode_t *node,
dns_name_t *fname)
{
-#ifndef BIND9
- UNUSED(rdataset);
- UNUSED(type);
- UNUSED(qtype);
- UNUSED(acache);
- UNUSED(zone);
- UNUSED(db);
- UNUSED(version);
- UNUSED(node);
- UNUSED(fname);
-
- return (ISC_R_NOTIMPLEMENTED);
-#else
dns_rbtdb_t *rbtdb = rdataset->private1;
dns_rbtnode_t *rbtnode = rdataset->private2;
unsigned char *raw = rdataset->private3; /* RDATASLAB */
}
return (result);
-#endif
}
static isc_result_t
rdataset_putadditional(dns_acache_t *acache, dns_rdataset_t *rdataset,
dns_rdatasetadditional_t type, dns_rdatatype_t qtype)
{
-#ifndef BIND9
- UNUSED(acache);
- UNUSED(rdataset);
- UNUSED(type);
- UNUSED(qtype);
-
- return (ISC_R_NOTIMPLEMENTED);
-#else
dns_rbtdb_t *rbtdb = rdataset->private1;
dns_rbtnode_t *rbtnode = rdataset->private2;
unsigned char *raw = rdataset->private3; /* RDATASLAB */
}
return (ISC_R_SUCCESS);
-#endif
}
/*%
return (result);
}
-#ifdef BIND9
static void
prime_done(isc_task_t *task, isc_event_t *event) {
dns_resolver_t *res;
}
}
}
-#endif /* BIND9 */
void
dns_resolver_freeze(dns_resolver_t *res) {
#include <dns/db.h>
#include <dns/dispatch.h>
#include <dns/dlz.h>
-#ifdef BIND9
#include <dns/dns64.h>
-#endif
#include <dns/dnssec.h>
#include <dns/events.h>
#include <dns/forward.h>
goto cleanup_name;
view->zonetable = NULL;
-#ifdef BIND9
- result = dns_zt_create(mctx, rdclass, &view->zonetable);
- if (result != ISC_R_SUCCESS) {
- UNEXPECTED_ERROR(__FILE__, __LINE__,
- "dns_zt_create() failed: %s",
- isc_result_totext(result));
- result = ISC_R_UNEXPECTED;
- goto cleanup_mutex;
+ if (isc_bind9) {
+ result = dns_zt_create(mctx, rdclass, &view->zonetable);
+ if (result != ISC_R_SUCCESS) {
+ UNEXPECTED_ERROR(__FILE__, __LINE__,
+ "dns_zt_create() failed: %s",
+ isc_result_totext(result));
+ result = ISC_R_UNEXPECTED;
+ goto cleanup_mutex;
+ }
}
-#endif
view->secroots_priv = NULL;
view->fwdtable = NULL;
result = dns_fwdtable_create(mctx, &view->fwdtable);
dns_fixedname_init(&view->dlv_fixed);
view->managed_keys = NULL;
view->redirect = NULL;
-#ifdef BIND9
view->new_zone_file = NULL;
view->new_zone_config = NULL;
view->cfg_destroy = NULL;
- result = dns_order_create(view->mctx, &view->order);
- if (result != ISC_R_SUCCESS)
- goto cleanup_dynkeys;
-#endif
+ if (isc_bind9) {
+ result = dns_order_create(view->mctx, &view->order);
+ if (result != ISC_R_SUCCESS)
+ goto cleanup_dynkeys;
+ }
result = dns_peerlist_new(view->mctx, &view->peers);
if (result != ISC_R_SUCCESS)
return (ISC_R_SUCCESS);
cleanup_peerlist:
- dns_peerlist_detach(&view->peers);
+ if (view->peers != NULL)
+ dns_peerlist_detach(&view->peers);
cleanup_order:
-#ifdef BIND9
- dns_order_detach(&view->order);
+ if (view->order != NULL)
+ dns_order_detach(&view->order);
cleanup_dynkeys:
-#endif
- dns_tsigkeyring_detach(&view->dynamickeys);
+ if (view->dynamickeys != NULL)
+ dns_tsigkeyring_detach(&view->dynamickeys);
cleanup_references:
isc_refcount_destroy(&view->references);
cleanup_fwdtable:
- dns_fwdtable_destroy(&view->fwdtable);
+ if (view->fwdtable != NULL)
+ dns_fwdtable_destroy(&view->fwdtable);
cleanup_zt:
-#ifdef BIND9
- dns_zt_detach(&view->zonetable);
+ if (view->zonetable != NULL)
+ dns_zt_detach(&view->zonetable);
cleanup_mutex:
-#endif
DESTROYLOCK(&view->lock);
cleanup_name:
static inline void
destroy(dns_view_t *view) {
-#ifdef BIND9
dns_dns64_t *dns64;
dns_dlzdb_t *dlzdb;
-#endif
REQUIRE(!ISC_LINK_LINKED(view, link));
REQUIRE(isc_refcount_current(&view->references) == 0);
REQUIRE(ADBSHUTDOWN(view));
REQUIRE(REQSHUTDOWN(view));
-#ifdef BIND9
if (view->order != NULL)
dns_order_detach(&view->order);
-#endif
if (view->peers != NULL)
dns_peerlist_detach(&view->peers);
dns_adb_detach(&view->adb);
if (view->resolver != NULL)
dns_resolver_detach(&view->resolver);
-#ifdef BIND9
if (view->acache != NULL) {
if (view->cachedb != NULL)
dns_acache_putdb(view->acache, view->cachedb);
ISC_LIST_UNLINK(view->dlz_unsearched, dlzdb, link);
dns_dlzdestroy(&dlzdb);
}
-#else
- INSIST(view->acache == NULL);
- INSIST(view->rpzs == NULL);
- INSIST(ISC_LIST_EMPTY(view->dlz_searched));
- INSIST(ISC_LIST_EMPTY(view->dlz_unsearched));
- INSIST(view->rrl == NULL);
-#endif
if (view->requestmgr != NULL)
dns_requestmgr_detach(&view->requestmgr);
if (view->task != NULL)
dns_stats_detach(&view->resquerystats);
if (view->secroots_priv != NULL)
dns_keytable_detach(&view->secroots_priv);
-#ifdef BIND9
for (dns64 = ISC_LIST_HEAD(view->dns64);
dns64 != NULL;
dns64 = ISC_LIST_HEAD(view->dns64)) {
if (view->redirect != NULL)
dns_zone_detach(&view->redirect);
dns_view_setnewzones(view, ISC_FALSE, NULL, NULL);
-#endif
dns_fwdtable_destroy(&view->fwdtable);
dns_aclenv_destroy(&view->aclenv);
DESTROYLOCK(&view->lock);
view->flush = ISC_TRUE;
isc_refcount_decrement(&view->references, &refs);
if (refs == 0) {
-#ifdef BIND9
dns_zone_t *mkzone = NULL, *rdzone = NULL;
-#endif
LOCK(&view->lock);
if (!RESSHUTDOWN(view))
dns_adb_shutdown(view->adb);
if (!REQSHUTDOWN(view))
dns_requestmgr_shutdown(view->requestmgr);
-#ifdef BIND9
if (view->acache != NULL)
dns_acache_shutdown(view->acache);
- if (view->flush)
- dns_zt_flushanddetach(&view->zonetable);
- else
- dns_zt_detach(&view->zonetable);
+ if (view->zonetable != NULL) {
+ if (view->flush)
+ dns_zt_flushanddetach(&view->zonetable);
+ else
+ dns_zt_detach(&view->zonetable);
+ }
if (view->managed_keys != NULL) {
mkzone = view->managed_keys;
view->managed_keys = NULL;
if (view->flush)
dns_zone_flush(rdzone);
}
-#endif
done = all_done(view);
UNLOCK(&view->lock);
-#ifdef BIND9
/* Need to detach zones outside view lock */
if (mkzone != NULL)
dns_zone_detach(&mkzone);
if (rdzone != NULL)
dns_zone_detach(&rdzone);
-#endif
}
*viewp = NULL;
view_flushanddetach(viewp, ISC_FALSE);
}
-#ifdef BIND9
static isc_result_t
dialup(dns_zone_t *zone, void *dummy) {
UNUSED(dummy);
void
dns_view_dialup(dns_view_t *view) {
REQUIRE(DNS_VIEW_VALID(view));
- (void)dns_zt_apply(view->zonetable, ISC_FALSE, dialup, NULL);
+ if (view->zonetable != NULL)
+ (void)dns_zt_apply(view->zonetable, ISC_FALSE, dialup, NULL);
}
-#endif
void
dns_view_weakattach(dns_view_t *source, dns_view_t **targetp) {
destroy(view);
}
+isc_result_t
+dns_view_createzonetable(dns_view_t *view) {
+
+ REQUIRE(DNS_VIEW_VALID(view));
+ REQUIRE(!view->frozen);
+ REQUIRE(view->zonetable == NULL);
+
+ return (dns_zt_create(view->mctx, view->rdclass, &view->zonetable));
+}
+
isc_result_t
dns_view_createresolver(dns_view_t *view,
isc_taskmgr_t *taskmgr,
view->cacheshared = shared;
if (view->cache != NULL) {
-#ifdef BIND9
if (view->acache != NULL)
dns_acache_putdb(view->acache, view->cachedb);
-#endif
dns_db_detach(&view->cachedb);
dns_cache_detach(&view->cache);
}
dns_cache_attachdb(cache, &view->cachedb);
INSIST(DNS_DB_VALID(view->cachedb));
-#ifdef BIND9
if (view->acache != NULL)
dns_acache_setdb(view->acache, view->cachedb);
-#endif
}
isc_boolean_t
view->frozen = ISC_TRUE;
}
-#ifdef BIND9
void
dns_view_thaw(dns_view_t *view) {
REQUIRE(DNS_VIEW_VALID(view));
REQUIRE(DNS_VIEW_VALID(view));
REQUIRE(!view->frozen);
+ REQUIRE(view->zonetable != NULL);
result = dns_zt_mount(view->zonetable, zone);
return (result);
}
-#endif
-#ifdef BIND9
isc_result_t
dns_view_findzone(dns_view_t *view, dns_name_t *name, dns_zone_t **zonep) {
isc_result_t result;
return (result);
}
-#endif
isc_result_t
dns_view_find(dns_view_t *view, dns_name_t *name, dns_rdatatype_t type,
dns_rdataset_t zrdataset, zsigrdataset;
dns_zone_t *zone;
-#ifndef BIND9
- UNUSED(use_hints);
- UNUSED(use_static_stub);
- UNUSED(zone);
-#endif
-
/*
* Find an rdataset whose owner name is 'name', and whose type is
* 'type'.
db = NULL;
node = NULL;
is_staticstub_zone = ISC_FALSE;
-#ifdef BIND9
zone = NULL;
- result = dns_zt_find(view->zonetable, name, 0, NULL, &zone);
- if (zone != NULL && dns_zone_gettype(zone) == dns_zone_staticstub &&
- !use_static_stub) {
+ if (view->zonetable != NULL) {
+ result = dns_zt_find(view->zonetable, name, 0, NULL, &zone);
+ if (zone != NULL && !use_static_stub &&
+ dns_zone_gettype(zone) == dns_zone_staticstub)
+ result = ISC_R_NOTFOUND;
+ } else
result = ISC_R_NOTFOUND;
- }
if (result == ISC_R_SUCCESS || result == DNS_R_PARTIALMATCH) {
result = dns_zone_getdb(zone, &db);
if (result != ISC_R_SUCCESS && view->cachedb != NULL)
}
} else if (result == ISC_R_NOTFOUND && view->cachedb != NULL)
dns_db_attach(view->cachedb, &db);
-#else
- result = ISC_R_NOTFOUND;
- if (view->cachedb != NULL)
- dns_db_attach(view->cachedb, &db);
-#endif /* BIND9 */
else
goto cleanup;
result = ISC_R_SUCCESS;
}
-#ifdef BIND9
if (result == ISC_R_NOTFOUND && use_hints && view->hints != NULL) {
if (dns_rdataset_isassociated(rdataset))
dns_rdataset_disassociate(rdataset);
if (db == NULL && node != NULL)
dns_db_detachnode(view->hints, &node);
}
-#endif /* BIND9 */
cleanup:
if (dns_rdataset_isassociated(&zrdataset)) {
} else
INSIST(node == NULL);
-#ifdef BIND9
if (zone != NULL)
dns_zone_detach(&zone);
-#endif
return (result);
}
dns_rdataset_t zrdataset, zsigrdataset;
dns_fixedname_t zfixedname;
-#ifndef BIND9
- UNUSED(zone);
-#endif
-
REQUIRE(DNS_VIEW_VALID(view));
REQUIRE(view->frozen);
/*
* Find the right database.
*/
-#ifdef BIND9
zone = NULL;
- result = dns_zt_find(view->zonetable, name, 0, NULL, &zone);
+ if (view->zonetable != NULL)
+ result = dns_zt_find(view->zonetable, name, 0, NULL, &zone);
+ else
+ result = ISC_R_NOTFOUND;
if (result == ISC_R_SUCCESS || result == DNS_R_PARTIALMATCH)
result = dns_zone_getdb(zone, &db);
-#else
- result = ISC_R_NOTFOUND;
-#endif
if (result == ISC_R_NOTFOUND) {
/*
* We're not directly authoritative for this query name, nor
}
if (db != NULL)
dns_db_detach(&db);
-#ifdef BIND9
if (zone != NULL)
dns_zone_detach(&zone);
-#endif
return (result);
}
return (ISC_R_SUCCESS);
}
-#ifdef BIND9
isc_result_t
dns_viewlist_findzone(dns_viewlist_t *list, dns_name_t *name,
isc_boolean_t allclasses, dns_rdataclass_t rdclass,
* treat it as not found.
*/
zp = (zone1 == NULL) ? &zone1 : &zone2;
- result = dns_zt_find(view->zonetable, name, 0, NULL, zp);
+ if (view->zonetable != NULL)
+ result = dns_zt_find(view->zonetable, name, 0, NULL,
+ zp);
+ else
+ result = ISC_R_NOTFOUND;
INSIST(result == ISC_R_SUCCESS ||
result == ISC_R_NOTFOUND ||
result == DNS_R_PARTIALMATCH);
return (dns_zt_asyncload(view->zonetable, callback, arg));
}
-
-#endif /* BIND9 */
-
isc_result_t
dns_view_gettsig(dns_view_t *view, dns_name_t *keyname, dns_tsigkey_t **keyp)
{
view->dynamickeys));
}
-#ifdef BIND9
isc_result_t
dns_view_dumpdbtostream(dns_view_t *view, FILE *fp) {
isc_result_t result;
dns_resolver_printbadcache(view->resolver, fp);
return (ISC_R_SUCCESS);
}
-#endif
isc_result_t
dns_view_flushcache(dns_view_t *view) {
if (result != ISC_R_SUCCESS)
return (result);
}
-#ifdef BIND9
if (view->acache != NULL)
dns_acache_putdb(view->acache, view->cachedb);
-#endif
dns_db_detach(&view->cachedb);
dns_cache_attachdb(view->cache, &view->cachedb);
-#ifdef BIND9
if (view->acache != NULL)
dns_acache_setdb(view->acache, view->cachedb);
if (view->resolver != NULL)
dns_resolver_flushbadcache(view->resolver, NULL);
-#endif
dns_adb_flush(view->adb);
return (ISC_R_SUCCESS);
return (view->rootdelonly);
}
-#ifdef BIND9
isc_result_t
dns_view_freezezones(dns_view_t *view, isc_boolean_t value) {
REQUIRE(DNS_VIEW_VALID(view));
+ REQUIRE(view->zonetable != NULL);
+
return (dns_zt_freezezones(view->zonetable, value));
}
-#endif
void
dns_view_setadbstats(dns_view_t *view, isc_stats_t *stats) {
REQUIRE(DNS_VIEW_VALID(view));
REQUIRE((cfgctx != NULL && cfg_destroy != NULL) || !allow);
-#ifdef BIND9
if (view->new_zone_file != NULL) {
isc_mem_free(view->mctx, view->new_zone_file);
view->new_zone_file = NULL;
view->new_zone_config = cfgctx;
view->cfg_destroy = cfg_destroy;
}
-#else
- UNUSED(allow);
- UNUSED(cfgctx);
- UNUSED(cfg_destroy);
-#endif
}
isc_result_t
zone_detachdb(zone);
if (zone->acache != NULL)
dns_acache_detach(&zone->acache);
-#ifdef BIND9
if (zone->rpzs != NULL) {
REQUIRE(zone->rpz_num < zone->rpzs->p.num_zones);
dns_rpz_detach_rpzs(&zone->rpzs);
zone->rpz_num = DNS_RPZ_INVALID_NUM;
}
-#endif
zone_freedbargs(zone);
RUNTIME_CHECK(dns_zone_setmasterswithkeys(zone, NULL, NULL, 0)
== ISC_R_SUCCESS);
isc_result_t tresult;
unsigned int options;
-#ifdef BIND9
if (zone->rpz_num != DNS_RPZ_INVALID_NUM) {
REQUIRE(zone->rpzs != NULL);
dns_db_rpz_attach(db, zone->rpzs, zone->rpz_num);
}
-#endif
options = get_master_options(zone);
if (DNS_ZONE_OPTION(zone, DNS_ZONEOPT_MANYERRORS))
if (result != ISC_R_SUCCESS)
goto cleanup;
} else {
-#ifdef BIND9
result = dns_db_rpz_ready(db);
if (result != ISC_R_SUCCESS)
goto cleanup;
-#endif
zone_attachdb(zone, db);
ZONEDB_UNLOCK(&zone->dblock, isc_rwlocktype_write);
DNS_ZONE_SETFLAG(zone,
REQUIRE(DNS_ZONE_VALID(zone));
REQUIRE(LOCKED_ZONE(zone));
-#ifdef BIND9
result = dns_db_rpz_ready(db);
if (result != ISC_R_SUCCESS)
return (result);
-#endif
result = zone_get_from_db(zone, db, &nscount, &soacount,
NULL, NULL, NULL, NULL, NULL, NULL);
if (result == ISC_R_SUCCESS)
zmgr->loadtasks = pool;
-#ifdef BIND9
/*
* We always set all tasks in the zone-load task pool to
* privileged. This prevents other tasks in the system from
* set it and forget it.
*/
isc_taskpool_setprivilege(zmgr->loadtasks, ISC_TRUE);
-#endif
/* Create or resize the zone memory context pool. */
if (zmgr->mctxpool == NULL)
+++ /dev/null
-# Copyright (C) 2009, 2012 Internet Systems Consortium, Inc. ("ISC")
-#
-# Permission to use, copy, modify, and/or distribute this software for any
-# purpose with or without fee is hereby granted, provided that the above
-# copyright notice and this permission notice appear in all copies.
-#
-# THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
-# REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
-# AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
-# INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
-# LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
-# OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
-# PERFORMANCE OF THIS SOFTWARE.
-
-# $Id: Makefile.in,v 1.3 2009/09/02 23:48:02 tbox Exp $
-
-srcdir = @srcdir@
-top_srcdir = @top_srcdir@
-
-# Note: the order of SUBDIRS is important.
-# Attempt to disable parallel processing.
-.NOTPARALLEL:
-.NO_PARALLEL:
-SUBDIRS = isc dns isccfg irs samples
-TARGETS =
-
-@BIND9_MAKE_RULES@
+++ /dev/null
-code.h
-gen
-.libs
-enumclass.h
-enumtype.h
-rdatastruct.h
+++ /dev/null
-# Copyright (C) 2009-2013 Internet Systems Consortium, Inc. ("ISC")
-#
-# Permission to use, copy, modify, and/or distribute this software for any
-# purpose with or without fee is hereby granted, provided that the above
-# copyright notice and this permission notice appear in all copies.
-#
-# THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
-# REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
-# AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
-# INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
-# LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
-# OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
-# PERFORMANCE OF THIS SOFTWARE.
-
-# $Id$
-
-top_srcdir = @top_srcdir@
-srcdir = @top_srcdir@/lib/dns
-export_srcdir = @top_srcdir@/lib/export
-
-# Attempt to disable parallel processing.
-.NOTPARALLEL:
-.NO_PARALLEL:
-
-@BIND9_VERSION@
-@BIND9_MAJOR@
-
-@LIBDNS_MAPAPI@
-
-@LIBDNS_API@
-
-@BIND9_MAKE_INCLUDES@
-
-CINCLUDES = -I. -Iinclude ${DNS_INCLUDES} -I${export_srcdir}/isc/include \
- ${ISC_INCLUDES} @DST_OPENSSL_INC@ @DST_GSSAPI_INC@
-
-CDEFINES = -DUSE_MD5 @USE_OPENSSL@ @USE_GSSAPI@
-
-CWARNINGS =
-
-ISCLIBS = ../isc/libisc.@A@
-
-ISCDEPLIBS = ../isc/libisc.@A@
-
-LIBS = @LIBS@
-
-# Alphabetically
-
-OPENSSLGOSTLINKOBJS = opensslgost_link.@O@
-OPENSSLLINKOBJS = openssl_link.@O@ openssldh_link.@O@ openssldsa_link.@O@ \
- opensslecdsa_link.@O@ @OPENSSLGOSTLINKOBJS@ opensslrsa_link.@O@
-
-DSTOBJS = @OPENSSLLINKOBJS@ \
- dst_api.@O@ dst_lib.@O@ dst_parse.@O@ dst_result.@O@ \
- gssapi_link.@O@ gssapictx.@O@ hmac_link.@O@ key.@O@
-
-DNSOBJS = acl.@O@ adb.@O@ byaddr.@O@ \
- cache.@O@ callbacks.@O@ client.@O@ compress.@O@ \
- db.@O@ dbiterator.@O@ diff.@O@ dispatch.@O@ dlz.@O@ dnssec.@O@ \
- ds.@O@ \
- forward.@O@ geoip.@O@ iptable.@O@ keytable.@O@ \
- lib.@O@ log.@O@ master.@O@ masterdump.@O@ message.@O@ \
- name.@O@ ncache.@O@ nsec.@O@ nsec3.@O@ \
- peer.@O@ portlist.@O@ \
- rbt.@O@ rbtdb.@O@ rcode.@O@ rdata.@O@ \
- rdatalist.@O@ rdataset.@O@ rdatasetiter.@O@ rdataslab.@O@ \
- request.@O@ resolver.@O@ result.@O@ soa.@O@ stats.@O@ \
- tcpmsg.@O@ time.@O@ tsec.@O@ tsig.@O@ ttl.@O@ \
- validator.@O@ version.@O@ view.@O@
-PORTDNSOBJS = ecdb.@O@
-GEOIPLINKOBJS = geoip.@O@
-
-OBJS= ${DNSOBJS} ${OTHEROBJS} ${DSTOBJS} ${PORTDNSOBJS} @GEOIPLINKOBJS@
-
-# Alphabetically
-
-OPENSSLGOSTLINKSRCS = opensslgost_link.c
-OPENSSLLINKSRCS = openssl_link.c openssldh_link.c openssldsa_link.c \
- opensslecdsa_link.c @OPENSSLGOSTLINKSRCS@ opensslrsa_link.c
-
-DSTSRCS = @OPENSSLLINKSRCS@ \
- dst_api.c dst_lib.c dst_parse.c \
- dst_result.c gssapi_link.c gssapictx.c \
- hmac_link.c key.c
-
-DNSSRCS = acl.c adb.c byaddr.c \
- cache.c callbacks.c client.c compress.c \
- db.c dbiterator.c diff.c dispatch.c dlz.c dnssec.c ds.c \
- forward.c geoip.c iptable.c keytable.c \
- lib.c log.c master.c masterdump.c message.c \
- name.c ncache.c nsec.c nsec3.c \
- peer.c portlist.c \
- rbt.c rbtdb.c rcode.c rdata.c \
- rdatalist.c rdataset.c rdatasetiter.c rdataslab.c \
- request.c res.c resolver.c result.c soa.c stats.c \
- tcpmsg.c time.c tsec.c tsig.c ttl.c \
- validator.c version.c view.c
-PORTDNSSRCS = ecdb.c
-GEOIPLINKSRCS = geoip.c
-
-SRCS = ${DSTSRCS} ${DNSSRCS} ${PORTDNSSRCS} @GEOIPLINKSRCS@
-
-SUBDIRS = include
-TARGETS = include/dns/enumtype.h include/dns/enumclass.h \
- include/dns/rdatastruct.h timestamp
-
-DEPENDEXTRA = ./gen -F include/dns/rdatastruct.h \
- -s ${srcdir} -d >> Makefile ;
-
-@BIND9_MAKE_RULES@
-
-version.@O@: ${srcdir}/version.c
- ${LIBTOOL_MODE_COMPILE} ${CC} ${ALL_CFLAGS} \
- -DVERSION=\"${VERSION}\" \
- -DMAJOR=\"${MAJOR}\" \
- -DMAPAPI=\"${MAPAPI}\" \
- -DLIBINTERFACE=${LIBINTERFACE} \
- -DLIBREVISION=${LIBREVISION} \
- -DLIBAGE=${LIBAGE} \
- -c ${srcdir}/version.c
-
-libdns.@SA@: ${OBJS}
- ${AR} ${ARFLAGS} $@ ${OBJS}
- ${RANLIB} $@
-
-libdns.la: ${OBJS}
- ${LIBTOOL_MODE_LINK} \
- ${CC} ${ALL_CFLAGS} ${LDFLAGS} -o libdns.la \
- -rpath ${export_libdir} \
- -version-info ${LIBINTERFACE}:${LIBREVISION}:${LIBAGE} \
- ${OBJS} ${ISCLIBS} @DNS_CRYPTO_LIBS@ ${LIBS}
-
-timestamp: libdns.@A@
- touch timestamp
-
-installdirs:
- $(SHELL) ${top_srcdir}/mkinstalldirs ${DESTDIR}${export_libdir}
-
-install:: timestamp installdirs
- ${LIBTOOL_MODE_INSTALL} ${INSTALL_DATA} libdns.@A@ \
- ${DESTDIR}${export_libdir}/
-
-clean distclean::
- rm -f libdns.@A@ timestamp
- rm -f gen code.h include/dns/enumtype.h include/dns/enumclass.h
- rm -f include/dns/rdatastruct.h
-
-newrr::
- rm -f code.h include/dns/enumtype.h include/dns/enumclass.h
- rm -f include/dns/rdatastruct.h
-
-include: include/dns/enumtype.h include/dns/enumclass.h \
- include/dns/rdatastruct.h
-
-rdata.@O@: code.h
-
-include/dns/enumtype.h: gen
- ./gen -s ${srcdir} -t > $@
-
-include/dns/enumclass.h: gen
- ./gen -s ${srcdir} -c > $@
-
-include/dns/rdatastruct.h: gen \
- ${srcdir}/rdata/rdatastructpre.h \
- ${srcdir}/rdata/rdatastructsuf.h
- ./gen -s ${srcdir} -i \
- -P ${srcdir}/rdata/rdatastructpre.h \
- -S ${srcdir}/rdata/rdatastructsuf.h > $@
-
-code.h: gen
- ./gen -s ${srcdir} > code.h
-
-gen: ${srcdir}/gen.c
- ${CC} ${ALL_CFLAGS} ${LDFLAGS} -o $@ ${srcdir}/gen.c ${LIBS}
-
-#We don't need rbtdb64 for this library
-#rbtdb64.@O@: rbtdb.c
-
-depend: include/dns/enumtype.h include/dns/enumclass.h \
- include/dns/rdatastruct.h code.h
-subdirs: include/dns/enumtype.h include/dns/enumclass.h \
- include/dns/rdatastruct.h code.h
-${OBJS}: include/dns/enumtype.h include/dns/enumclass.h \
- include/dns/rdatastruct.h
+++ /dev/null
-# Copyright (C) 2009, 2012 Internet Systems Consortium, Inc. ("ISC")
-#
-# Permission to use, copy, modify, and/or distribute this software for any
-# purpose with or without fee is hereby granted, provided that the above
-# copyright notice and this permission notice appear in all copies.
-#
-# THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
-# REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
-# AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
-# INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
-# LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
-# OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
-# PERFORMANCE OF THIS SOFTWARE.
-
-# $Id: Makefile.in,v 1.3 2009/09/02 23:48:02 tbox Exp $
-
-srcdir = @srcdir@
-top_srcdir = @top_srcdir@
-
-SUBDIRS = dns dst
-TARGETS =
-
-@BIND9_MAKE_RULES@
+++ /dev/null
-# Copyright (C) 2009, 2012 Internet Systems Consortium, Inc. ("ISC")
-#
-# Permission to use, copy, modify, and/or distribute this software for any
-# purpose with or without fee is hereby granted, provided that the above
-# copyright notice and this permission notice appear in all copies.
-#
-# THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
-# REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
-# AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
-# INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
-# LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
-# OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
-# PERFORMANCE OF THIS SOFTWARE.
-
-# $Id: Makefile.in,v 1.4 2009/09/18 07:18:04 jinmei Exp $
-
-srcdir = @srcdir@
-top_srcdir = @top_srcdir@
-
-@BIND9_VERSION@
-
-HEADERS = acl.h adb.h byaddr.h \
- cache.h callbacks.h cert.h client.h compress.h \
- db.h dbiterator.h diff.h dispatch.h dlz.h dnssec.h \
- ds.h dsdigest.h events.h fixedname.h ecdb.h \
- forward.h iptable.h \
- keytable.h keyvalues.h \
- lib.h log.h \
- master.h masterdump.h message.h \
- name.h ncache.h nsec.h nsec3.h \
- peer.h portlist.h \
- rbt.h rcode.h rdata.h rdataclass.h \
- rdatalist.h rdataset.h rdatasetiter.h rdataslab.h rdatatype.h \
- request.h resolver.h result.h \
- secalg.h secproto.h soa.h stats.h \
- tcpmsg.h time.h tsec.h tsig.h ttl.h types.h \
- validator.h version.h view.h
-
-GENHEADERS = enumclass.h enumtype.h rdatastruct.h
-
-SUBDIRS =
-TARGETS =
-
-@BIND9_MAKE_RULES@
-
-installdirs:
- $(SHELL) ${top_srcdir}/mkinstalldirs ${DESTDIR}${export_includedir}/dns
-
-install:: installdirs
- for i in ${HEADERS}; do \
- ${INSTALL_DATA} ${top_srcdir}/lib/dns/include/dns/$$i \
- ${DESTDIR}${export_includedir}/dns ; \
- done
- for i in ${GENHEADERS}; do \
- ${INSTALL_DATA} $$i ${DESTDIR}${export_includedir}/dns ; \
- done
+++ /dev/null
-# Copyright (C) 2009, 2012 Internet Systems Consortium, Inc. ("ISC")
-#
-# Permission to use, copy, modify, and/or distribute this software for any
-# purpose with or without fee is hereby granted, provided that the above
-# copyright notice and this permission notice appear in all copies.
-#
-# THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
-# REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
-# AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
-# INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
-# LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
-# OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
-# PERFORMANCE OF THIS SOFTWARE.
-
-# $Id: Makefile.in,v 1.3 2009/09/02 23:48:02 tbox Exp $
-
-srcdir = @srcdir@
-top_srcdir = @top_srcdir@
-
-@BIND9_VERSION@
-
-HEADERS = dst.h gssapi.h lib.h result.h
-
-SUBDIRS =
-TARGETS =
-
-@BIND9_MAKE_RULES@
-
-installdirs:
- $(SHELL) ${top_srcdir}/mkinstalldirs ${DESTDIR}${export_includedir}/dst
-
-install:: installdirs
- for i in ${HEADERS}; do \
- ${INSTALL_DATA} ${top_srcdir}/lib/dns/include/dst/$$i \
- ${DESTDIR}${export_includedir}/dst ; \
- done
+++ /dev/null
-# Copyright (C) 2009, 2011-2013 Internet Systems Consortium, Inc. ("ISC")
-#
-# Permission to use, copy, modify, and/or distribute this software for any
-# purpose with or without fee is hereby granted, provided that the above
-# copyright notice and this permission notice appear in all copies.
-#
-# THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
-# REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
-# AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
-# INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
-# LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
-# OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
-# PERFORMANCE OF THIS SOFTWARE.
-
-# $Id$
-
-top_srcdir = @top_srcdir@
-srcdir = @top_srcdir@/lib/irs
-export_srcdir = @top_srcdir@/lib/export
-
-@BIND9_VERSION@
-
-@LIBIRS_API@
-
-@BIND9_MAKE_INCLUDES@
-
-CINCLUDES = -I. -I./include -I${srcdir}/include -I ../../irs/include \
- ${ISCCFG_INCLUDES} -I../dns/include ${DNS_INCLUDES} \
- -I../dns/include ${DNS_INCLUDES} \
- -I${export_srcdir}/isc/include ${ISC_INCLUDES}
-CDEFINES =
-CWARNINGS =
-
-# Alphabetically
-OBJS = context.@O@ \
- dnsconf.@O@ \
- gai_strerror.@O@ getaddrinfo.@O@ getnameinfo.@O@ \
- resconf.@O@
-
-# Alphabetically
-SRCS = context.c \
- dnsconf.c \
- gai_sterror.c getaddrinfo.c getnameinfo.c \
- resconf.c
-
-ISCLIBS = ../isc/libisc.@A@
-DNSLIBS = ../dns/libdns.@A@
-ISCCFGLIBS = ../isccfg/libisccfg.@A@
-
-LIBS = @LIBS@
-
-SUBDIRS = include
-TARGETS = timestamp
-
-@BIND9_MAKE_RULES@
-
-version.@O@: ${srcdir}/version.c
- ${LIBTOOL_MODE_COMPILE} ${CC} ${ALL_CFLAGS} \
- -DVERSION=\"${VERSION}\" \
- -DLIBINTERFACE=${LIBINTERFACE} \
- -DLIBREVISION=${LIBREVISION} \
- -DLIBAGE=${LIBAGE} \
- -c ${srcdir}/version.c
-
-libirs.@SA@: ${OBJS} version.@O@
- ${AR} ${ARFLAGS} $@ ${OBJS} version.@O@
- ${RANLIB} $@
-
-libirs.la: ${OBJS} version.@O@
- ${LIBTOOL_MODE_LINK} \
- ${CC} ${ALL_CFLAGS} ${LDFLAGS} -o libirs.la \
- -rpath ${export_libdir} \
- -version-info ${LIBINTERFACE}:${LIBREVISION}:${LIBAGE} \
- ${OBJS} version.@O@ ${LIBS} ${ISCCFGLIBS} ${DNSLIBS} ${ISCLIBS}
-
-timestamp: libirs.@A@
- touch timestamp
-
-installdirs:
- $(SHELL) ${top_srcdir}/mkinstalldirs ${DESTDIR}${export_libdir}
-
-install:: timestamp installdirs
- ${LIBTOOL_MODE_INSTALL} ${INSTALL_DATA} libirs.@A@ \
- ${DESTDIR}${export_libdir}/
-
-clean distclean::
- rm -f libirs.@A@ libirs.la timestamp
+++ /dev/null
-# Copyright (C) 2009, 2011, 2012 Internet Systems Consortium, Inc. ("ISC")
-#
-# Permission to use, copy, modify, and/or distribute this software for any
-# purpose with or without fee is hereby granted, provided that the above
-# copyright notice and this permission notice appear in all copies.
-#
-# THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
-# REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
-# AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
-# INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
-# LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
-# OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
-# PERFORMANCE OF THIS SOFTWARE.
-
-# $Id$
-
-srcdir = @srcdir@
-top_srcdir = @top_srcdir@
-
-
-SUBDIRS = irs
-TARGETS =
-
-@BIND9_MAKE_RULES@
+++ /dev/null
-# Copyright (C) 2009, 2012 Internet Systems Consortium, Inc. ("ISC")
-#
-# Permission to use, copy, modify, and/or distribute this software for any
-# purpose with or without fee is hereby granted, provided that the above
-# copyright notice and this permission notice appear in all copies.
-#
-# THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
-# REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
-# AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
-# INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
-# LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
-# OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
-# PERFORMANCE OF THIS SOFTWARE.
-
-# $Id: Makefile.in,v 1.3 2009/09/02 23:48:02 tbox Exp $
-
-srcdir = @srcdir@
-top_srcdir = @top_srcdir@
-
-#
-# Only list headers that are to be installed and are not
-# machine generated. The latter are handled specially in the
-# install target below.
-#
-HEADERS = context.h dnsconf.h resconf.h types.h version.h
-
-SUBDIRS =
-TARGETS =
-
-@BIND9_MAKE_RULES@
-
-installdirs:
- $(SHELL) ${top_srcdir}/mkinstalldirs ${DESTDIR}${export_includedir}/irs
-
-install:: installdirs
- for i in ${HEADERS}; do \
- ${INSTALL_DATA} ${top_srcdir}/lib/irs/include/irs/$$i \
- ${DESTDIR}${export_includedir}/irs ; \
- done
- ${INSTALL_DATA} ${top_srcdir}/lib/irs/include/irs/netdb.h \
- ${DESTDIR}${export_includedir}/irs
- ${INSTALL_DATA} ${top_srcdir}/lib/irs/include/irs/platform.h \
- ${DESTDIR}${export_includedir}/irs
-
-distclean::
- rm -f netdb.h platform.h
+++ /dev/null
-# Copyright (C) 2009, 2010, 2012, 2013 Internet Systems Consortium, Inc. ("ISC")
-#
-# Permission to use, copy, modify, and/or distribute this software for any
-# purpose with or without fee is hereby granted, provided that the above
-# copyright notice and this permission notice appear in all copies.
-#
-# THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
-# REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
-# AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
-# INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
-# LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
-# OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
-# PERFORMANCE OF THIS SOFTWARE.
-
-# $Id: Makefile.in,v 1.8 2010/06/09 23:50:58 tbox Exp $
-
-top_srcdir = @top_srcdir@
-srcdir = @top_srcdir@/lib/isc
-export_srcdir = @top_srcdir@/lib/export
-
-@BIND9_VERSION@
-
-@LIBISC_API@
-
-CINCLUDES = -I${srcdir}/unix/include \
- -I${srcdir}/@ISC_THREAD_DIR@/include \
- -I${srcdir}/@ISC_ARCH_DIR@/include \
- -I${export_srcdir}/isc/include -I${srcdir}/include \
- @ISC_OPENSSL_INC@
-CDEFINES = @USE_OPENSSL@ -DUSE_APPIMPREGISTER -DUSE_MEMIMPREGISTER \
- -DUSE_SOCKETIMPREGISTER -DUSE_TASKIMPREGISTER \
- -DUSE_TIMERIMPREGISTER
-CWARNINGS =
-
-# Alphabetically
-# {file,dir}.c is necessary for isclog
-# symtab.c is necessary for isccfg
-APIOBJS = app_api.@O@ mem_api.@O@ socket_api.@O@ \
- task_api.@O@ timer_api.@O@
-
-ISCDRIVEROBJS = mem.@O@ unix/socket.@O@ task.@O@ timer.@O@ lib.@O@ \
- heap.@O@ #timer module depends on this
-
-UNIXOBJS = @ISC_ISCIPV6_O@ \
- unix/app.@O@ \
- unix/dir.@O@ \
- unix/errno2result.@O@ \
- unix/file.@O@ \
- unix/fsaccess.@O@ \
- unix/stdio.@O@ \
- unix/stdtime.@O@ unix/strerror.@O@ unix/time.@O@
-
-NLSOBJS = nls/msgcat.@O@
-
-THREADOPTOBJS = @ISC_THREAD_DIR@/condition.@O@ @ISC_THREAD_DIR@/mutex.@O@
-
-THREADOBJS = @THREADOPTOBJS@ @ISC_THREAD_DIR@/thread.@O@
-
-WIN32OBJS = win32/condition.@O@ win32/dir.@O@ win32/file.@O@ \
- win32/fsaccess.@O@ win32/once.@O@ win32/stdtime.@O@ \
- win32/thread.@O@ win32/time.@O@
-
-# Alphabetically
-OBJS = @ISC_EXTRA_OBJS@ \
- assertions.@O@ backtrace.@O@ backtrace-emptytbl.@O@ base32.@O@ \
- base64.@O@ buffer.@O@ bufferlist.@O@ \
- error.@O@ event.@O@ \
- hash.@O@ hex.@O@ hmacmd5.@O@ hmacsha.@O@ \
- inet_aton.@O@ iterated_hash.@O@ lex.@O@ lfsr.@O@ log.@O@ \
- md5.@O@ mutexblock.@O@ netaddr.@O@ netscope.@O@ \
- ondestroy.@O@ parseint.@O@ portset.@O@ radix.@O@ \
- random.@O@ refcount.@O@ region.@O@ regex.@O@ result.@O@ \
- rwlock.@O@ serial.@O@ sha1.@O@ sha2.@O@ sockaddr.@O@ \
- stats.@O@ string.@O@ \
- symtab.@O@ \
- version.@O@ \
- ${APIOBJS} ${ISCDRIVEROBJS} \
- ${UNIXOBJS} ${NLSOBJS} ${THREADOBJS}
-
-# Alphabetically
-APISRCS = app_api.c mem_api.c socket_api.c \
- task_api.c timer_api.c
-
-ISCDRIVERSRCS = mem.c task.c lib.c timer.c heap.c
-
-SRCS = @ISC_EXTRA_SRCS@ \
- assertions.c backtrace.c backtrace-emptytbl.c base32.c \
- base64.c buffer.c bufferlist.c \
- error.c event.c \
- hash.c hex.c hmacmd5.c hmacsha.c \
- inet_aton.c iterated_hash.c lex.c log.c lfsr.c \
- md5.c mutexblock.c \
- netaddr.c netscope.c \
- ondestroy.c \
- parseint.c portset.c radix.c \
- random.c refcount.c region.c regex.c result.c rwlock.c \
- serial.c sha1.c sha2.c sockaddr.c stats.c string.c symtab.c \
- version.c \
- ${APISRCS} ${ISCDRIVERSRCS}
-
-LIBS = @LIBS@
-
-SUBDIRS = include unix nls @ISC_THREAD_DIR@
-TARGETS = timestamp
-
-@BIND9_MAKE_RULES@
-
-version.@O@: ${srcdir}/version.c
- ${LIBTOOL_MODE_COMPILE} ${CC} ${ALL_CFLAGS} \
- -DVERSION=\"${VERSION}\" \
- -DLIBINTERFACE=${LIBINTERFACE} \
- -DLIBREVISION=${LIBREVISION} \
- -DLIBAGE=${LIBAGE} \
- -c ${srcdir}/version.c
-
-libisc.@SA@: ${OBJS}
- ${AR} ${ARFLAGS} $@ ${OBJS}
- ${RANLIB} $@
-
-libisc.la: ${OBJS}
- ${LIBTOOL_MODE_LINK} \
- ${CC} ${ALL_CFLAGS} ${LDFLAGS} -o libisc.la \
- -rpath ${export_libdir} \
- -version-info ${LIBINTERFACE}:${LIBREVISION}:${LIBAGE} \
- ${OBJS} ${LIBS}
-
-timestamp: libisc.@A@
- touch timestamp
-
-installdirs:
- $(SHELL) ${top_srcdir}/mkinstalldirs ${DESTDIR}${export_libdir}
-
-install:: timestamp installdirs
- ${LIBTOOL_MODE_INSTALL} ${INSTALL_DATA} libisc.@A@ \
- ${DESTDIR}${export_libdir}
-
-clean distclean::
- rm -f libisc.@A@ libisc.la timestamp
+++ /dev/null
-# Copyright (C) 2009, 2011, 2012 Internet Systems Consortium, Inc. ("ISC")
-#
-# Permission to use, copy, modify, and/or distribute this software for any
-# purpose with or without fee is hereby granted, provided that the above
-# copyright notice and this permission notice appear in all copies.
-#
-# THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
-# REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
-# AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
-# INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
-# LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
-# OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
-# PERFORMANCE OF THIS SOFTWARE.
-
-# $Id$
-
-srcdir = @srcdir@
-top_srcdir = @top_srcdir@
-
-
-SUBDIRS = isc
-TARGETS =
-
-@BIND9_MAKE_RULES@
+++ /dev/null
-# Copyright (C) 2009, 2012, 2013 Internet Systems Consortium, Inc. ("ISC")
-#
-# Permission to use, copy, modify, and/or distribute this software for any
-# purpose with or without fee is hereby granted, provided that the above
-# copyright notice and this permission notice appear in all copies.
-#
-# THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
-# REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
-# AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
-# INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
-# LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
-# OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
-# PERFORMANCE OF THIS SOFTWARE.
-
-# $Id: Makefile.in,v 1.3 2009/12/05 23:31:41 each Exp $
-
-srcdir = @srcdir@
-top_srcdir = @top_srcdir@
-export_srcdir = @top_srcdir@/lib/export
-
-@BIND9_VERSION@
-
-#
-# Only list headers that are to be installed and are not
-# machine generated. The latter are handled specially in the
-# install target below.
-#
-HEADERS = app.h assertions.h base64.h bitstring.h boolean.h \
- buffer.h bufferlist.h commandline.h entropy.h error.h event.h \
- eventclass.h file.h formatcheck.h fsaccess.h \
- hash.h heap.h hex.h hmacmd5.h \
- httpd.h \
- interfaceiter.h @ISC_IPV6_H@ iterated_hash.h json.h lang.h lex.h \
- lfsr.h lib.h list.h log.h \
- magic.h md5.h mem.h msgcat.h msgs.h \
- mutexblock.h namespace.h netaddr.h ondestroy.h os.h parseint.h \
- print.h quota.h radix.h random.h ratelimiter.h \
- refcount.h regex.h region.h resource.h \
- result.h resultclass.h rwlock.h serial.h sha1.h sha2.h \
- sockaddr.h socket.h stdio.h stdlib.h string.h \
- symtab.h \
- task.h taskpool.h timer.h types.h util.h version.h \
- xml.h
-
-SUBDIRS =
-TARGETS =
-
-@BIND9_MAKE_RULES@
-
-installdirs:
- $(SHELL) ${top_srcdir}/mkinstalldirs ${DESTDIR}${export_includedir}/isc
-
-install:: installdirs
- for i in ${HEADERS}; do \
- ${INSTALL_DATA} ${top_srcdir}/lib/isc/include/isc/$$i \
- ${DESTDIR}${export_includedir}/isc ; \
- done
- ${INSTALL_DATA} ${top_srcdir}/lib/isc/include/isc/platform.h \
- ${DESTDIR}${export_includedir}/isc
- ${INSTALL_DATA} ${top_srcdir}/lib/isc/@ISC_ARCH_DIR@/include/isc/atomic.h \
- ${DESTDIR}${export_includedir}/isc
- ${INSTALL_DATA} ${export_srcdir}/isc/include/isc/bind9.h \
- ${DESTDIR}${export_includedir}/isc
-
-distclean::
- rm -f platform.h
+++ /dev/null
-# Copyright (C) 2009, 2012 Internet Systems Consortium, Inc. ("ISC")
-#
-# Permission to use, copy, modify, and/or distribute this software for any
-# purpose with or without fee is hereby granted, provided that the above
-# copyright notice and this permission notice appear in all copies.
-#
-# THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
-# REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
-# AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
-# INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
-# LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
-# OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
-# PERFORMANCE OF THIS SOFTWARE.
-
-# $Id: Makefile.in,v 1.3 2009/09/02 23:48:02 tbox Exp $
-
-top_srcdir = @top_srcdir@
-srcdir = @top_srcdir@/lib/isc/nls
-export_srcdir = @top_srcdir@/lib/export
-
-@BIND9_MAKE_INCLUDES@
-
-CINCLUDES = -I${srcdir}/unix/include \
- -I${export_srcdir}/isc/include \
- ${ISC_INCLUDES}
-
-CDEFINES =
-CWARNINGS =
-
-OBJS = msgcat.@O@
-
-SRCS = msgcat.c
-
-SUBDIRS =
-TARGETS = ${OBJS}
-
-@BIND9_MAKE_RULES@
+++ /dev/null
-# Copyright (C) 2009, 2010, 2012 Internet Systems Consortium, Inc. ("ISC")
-#
-# Permission to use, copy, modify, and/or distribute this software for any
-# purpose with or without fee is hereby granted, provided that the above
-# copyright notice and this permission notice appear in all copies.
-#
-# THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
-# REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
-# AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
-# INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
-# LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
-# OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
-# PERFORMANCE OF THIS SOFTWARE.
-
-# $Id: Makefile.in,v 1.5 2010/06/09 23:50:58 tbox Exp $
-
-top_srcdir = @top_srcdir@
-srcdir = @top_srcdir@/lib/isc/nothreads
-export_srcdir = @top_srcdir@/lib/export
-
-@BIND9_MAKE_INCLUDES@
-
-CINCLUDES = -I${srcdir}/include \
- -I${srcdir}/../unix/include \
- -I${export_srcdir}/isc/include \
- -I../include \
- -I${srcdir}/../include \
- -I${srcdir}/..
-
-CDEFINES =
-CWARNINGS =
-
-THREADOPTOBJS = condition.@O@ mutex.@O@
-OBJS = @THREADOPTOBJS@ thread.@O@
-
-THREADOPTSRCS = condition.c mutex.c
-SRCS = @THREADOPTSRCS@ thread.c
-
-SUBDIRS = include
-TARGETS = ${OBJS}
-
-@BIND9_MAKE_RULES@
+++ /dev/null
-# Copyright (C) 2009, 2011, 2012 Internet Systems Consortium, Inc. ("ISC")
-#
-# Permission to use, copy, modify, and/or distribute this software for any
-# purpose with or without fee is hereby granted, provided that the above
-# copyright notice and this permission notice appear in all copies.
-#
-# THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
-# REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
-# AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
-# INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
-# LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
-# OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
-# PERFORMANCE OF THIS SOFTWARE.
-
-# $Id$
-
-srcdir = @srcdir@
-top_srcdir = @top_srcdir@
-
-
-SUBDIRS = isc
-TARGETS =
-
-@BIND9_MAKE_RULES@
+++ /dev/null
-# Copyright (C) 2009, 2012 Internet Systems Consortium, Inc. ("ISC")
-#
-# Permission to use, copy, modify, and/or distribute this software for any
-# purpose with or without fee is hereby granted, provided that the above
-# copyright notice and this permission notice appear in all copies.
-#
-# THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
-# REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
-# AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
-# INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
-# LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
-# OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
-# PERFORMANCE OF THIS SOFTWARE.
-
-# $Id: Makefile.in,v 1.2 2009/09/01 00:22:27 jinmei Exp $
-
-srcdir = @srcdir@
-top_srcdir = @top_srcdir@
-
-@BIND9_VERSION@
-
-HEADERS = condition.h mutex.h once.h thread.h
-
-SUBDIRS =
-TARGETS =
-
-@BIND9_MAKE_RULES@
-
-installdirs:
- $(SHELL) ${top_srcdir}/mkinstalldirs ${DESTDIR}${export_includedir}/isc
-
-install:: installdirs
- for i in ${HEADERS}; do \
- ${INSTALL_DATA} $(top_srcdir)/lib/isc/nothreads/include/isc/$$i \
- ${DESTDIR}${export_includedir}/isc ; \
- done
+++ /dev/null
-# Copyright (C) 2009, 2012 Internet Systems Consortium, Inc. ("ISC")
-#
-# Permission to use, copy, modify, and/or distribute this software for any
-# purpose with or without fee is hereby granted, provided that the above
-# copyright notice and this permission notice appear in all copies.
-#
-# THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
-# REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
-# AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
-# INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
-# LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
-# OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
-# PERFORMANCE OF THIS SOFTWARE.
-
-# $Id: Makefile.in,v 1.3 2009/09/02 23:48:02 tbox Exp $
-
-top_srcdir = @top_srcdir@
-srcdir = @top_srcdir@/lib/isc/pthreads
-export_srcdir = @top_srcdir@/lib/export
-
-@BIND9_MAKE_INCLUDES@
-
-CINCLUDES = -I${srcdir}/include \
- -I${srcdir}/../unix/include \
- -I${export_srcdir}/isc/include \
- -I../include \
- -I${srcdir}/../include \
- -I${srcdir}/..
-
-CDEFINES =
-CWARNINGS =
-
-OBJS = condition.@O@ mutex.@O@ thread.@O@
-
-SRCS = condition.c mutex.c thread.c
-
-SUBDIRS = include
-TARGETS = ${OBJS}
-
-@BIND9_MAKE_RULES@
+++ /dev/null
-# Copyright (C) 2009, 2011, 2012 Internet Systems Consortium, Inc. ("ISC")
-#
-# Permission to use, copy, modify, and/or distribute this software for any
-# purpose with or without fee is hereby granted, provided that the above
-# copyright notice and this permission notice appear in all copies.
-#
-# THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
-# REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
-# AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
-# INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
-# LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
-# OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
-# PERFORMANCE OF THIS SOFTWARE.
-
-# $Id$
-
-srcdir = @srcdir@
-top_srcdir = @top_srcdir@
-
-
-SUBDIRS = isc
-TARGETS =
-
-@BIND9_MAKE_RULES@
+++ /dev/null
-# Copyright (C) 2009, 2012 Internet Systems Consortium, Inc. ("ISC")
-#
-# Permission to use, copy, modify, and/or distribute this software for any
-# purpose with or without fee is hereby granted, provided that the above
-# copyright notice and this permission notice appear in all copies.
-#
-# THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
-# REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
-# AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
-# INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
-# LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
-# OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
-# PERFORMANCE OF THIS SOFTWARE.
-
-# $Id: Makefile.in,v 1.2 2009/09/01 00:22:27 jinmei Exp $
-
-srcdir = @srcdir@
-top_srcdir = @top_srcdir@
-
-@BIND9_VERSION@
-
-HEADERS = condition.h mutex.h once.h thread.h
-
-SUBDIRS =
-TARGETS =
-
-@BIND9_MAKE_RULES@
-
-installdirs:
- $(SHELL) ${top_srcdir}/mkinstalldirs ${DESTDIR}${export_includedir}/isc
-
-install:: installdirs
- for i in ${HEADERS}; do \
- ${INSTALL_DATA} $(top_srcdir)/lib/isc/pthreads/include/isc/$$i \
- ${DESTDIR}${export_includedir}/isc ; \
- done
+++ /dev/null
-# Copyright (C) 2009, 2012 Internet Systems Consortium, Inc. ("ISC")
-#
-# Permission to use, copy, modify, and/or distribute this software for any
-# purpose with or without fee is hereby granted, provided that the above
-# copyright notice and this permission notice appear in all copies.
-#
-# THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
-# REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
-# AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
-# INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
-# LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
-# OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
-# PERFORMANCE OF THIS SOFTWARE.
-
-# $Id: Makefile.in,v 1.3 2009/09/02 23:48:02 tbox Exp $
-
-top_srcdir = @top_srcdir@
-srcdir = @top_srcdir@/lib/isc/unix
-export_srcdir = @top_srcdir@/lib/export
-
-@BIND9_MAKE_INCLUDES@
-
-CINCLUDES = -I${srcdir}/include \
- -I${srcdir}/../@ISC_THREAD_DIR@/include \
- -I${export_srcdir}/isc/include \
- -I../include \
- -I${srcdir}/../include \
- -I${srcdir}/..
-
-CDEFINES = -DUSE_SOCKETIMPREGISTER -DUSE_APPIMPREGISTER
-
-CWARNINGS =
-
-# Alphabetically
-ISCDRIVEROBJS = app.@O@ socket.@O@
-
-OBJS = @ISC_IPV6_O@ \
- dir.@O@ \
- errno2result.@O@ \
- file.@O@ fsaccess.@O@ \
- stdio.@O@ stdtime.@O@ strerror.@O@ \
- time.@O@ \
- ${ISCDRIVEROBJS}
-
-# Alphabetically
-ISCDRIVERSRCS = app.c socket.c
-
-SRCS = @ISC_IPV6_C@ \
- dir.c \
- errno2result.c \
- file.c fsaccess.c \
- stdio.c stdtime.c strerror.c \
- time.c \
- ${ISCDRIVERSRCS}
-
-SUBDIRS = include
-TARGETS = ${OBJS}
-
-@BIND9_MAKE_RULES@
+++ /dev/null
-# Copyright (C) 2009, 2011, 2012 Internet Systems Consortium, Inc. ("ISC")
-#
-# Permission to use, copy, modify, and/or distribute this software for any
-# purpose with or without fee is hereby granted, provided that the above
-# copyright notice and this permission notice appear in all copies.
-#
-# THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
-# REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
-# AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
-# INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
-# LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
-# OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
-# PERFORMANCE OF THIS SOFTWARE.
-
-# $Id$
-
-srcdir = @srcdir@
-top_srcdir = @top_srcdir@
-
-
-SUBDIRS = isc
-TARGETS =
-
-@BIND9_MAKE_RULES@
+++ /dev/null
-# Copyright (C) 2009, 2012 Internet Systems Consortium, Inc. ("ISC")
-#
-# Permission to use, copy, modify, and/or distribute this software for any
-# purpose with or without fee is hereby granted, provided that the above
-# copyright notice and this permission notice appear in all copies.
-#
-# THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
-# REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
-# AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
-# INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
-# LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
-# OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
-# PERFORMANCE OF THIS SOFTWARE.
-
-# $Id: Makefile.in,v 1.2 2009/09/01 00:22:27 jinmei Exp $
-
-srcdir = @srcdir@
-top_srcdir = @top_srcdir@
-
-@BIND9_VERSION@
-
-HEADERS = dir.h int.h net.h netdb.h offset.h stdtime.h \
- syslog.h time.h
-
-SUBDIRS =
-TARGETS =
-
-@BIND9_MAKE_RULES@
-
-installdirs:
- $(SHELL) ${top_srcdir}/mkinstalldirs ${DESTDIR}${export_includedir}/isc
-
-install:: installdirs
- for i in ${HEADERS}; do \
- ${INSTALL_DATA} $(top_srcdir)/lib/isc/unix/include/isc/$$i \
- ${DESTDIR}${export_includedir}/isc ; \
- done
+++ /dev/null
-# Copyright (C) 2009, 2011-2013 Internet Systems Consortium, Inc. ("ISC")
-#
-# Permission to use, copy, modify, and/or distribute this software for any
-# purpose with or without fee is hereby granted, provided that the above
-# copyright notice and this permission notice appear in all copies.
-#
-# THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
-# REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
-# AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
-# INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
-# LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
-# OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
-# PERFORMANCE OF THIS SOFTWARE.
-
-# $Id$
-
-top_srcdir = @top_srcdir@
-srcdir = @top_srcdir@/lib/isccfg
-export_srcdir = @top_srcdir@/lib/export
-
-@BIND9_VERSION@
-
-@LIBISCCFG_API@
-
-@BIND9_MAKE_INCLUDES@
-
-CINCLUDES = -I. ${DNS_INCLUDES} -I${export_srcdir}/isc/include \
- ${ISC_INCLUDES} ${ISCCFG_INCLUDES}
-
-CDEFINES =
-CWARNINGS =
-
-ISCLIBS = ../isc/libisc.@A@
-DNSLIBS = ../dns/libdns.@A@ @DNS_CRYPTO_LIBS@
-
-ISCDEPLIBS = ../../lib/isc/libisc.@A@
-ISCCFGDEPLIBS = libisccfg.@A@
-
-LIBS = @LIBS@
-
-SUBDIRS = include
-
-# Alphabetically
-OBJS = dnsconf.@O@ log.@O@ parser.@O@ version.@O@
-
-# Alphabetically
-SRCS = dnsconf.c log.c parser.c version.c
-
-TARGETS = timestamp
-
-@BIND9_MAKE_RULES@
-
-version.@O@: ${srcdir}/version.c
- ${LIBTOOL_MODE_COMPILE} ${CC} ${ALL_CFLAGS} \
- -DVERSION=\"${VERSION}\" \
- -DLIBINTERFACE=${LIBINTERFACE} \
- -DLIBREVISION=${LIBREVISION} \
- -DLIBAGE=${LIBAGE} \
- -c ${srcdir}/version.c
-
-libisccfg.@SA@: ${OBJS}
- ${AR} ${ARFLAGS} $@ ${OBJS}
- ${RANLIB} $@
-
-libisccfg.la: ${OBJS}
- ${LIBTOOL_MODE_LINK} \
- ${CC} ${ALL_CFLAGS} ${LDFLAGS} -o libisccfg.la \
- -rpath ${export_libdir} \
- -version-info ${LIBINTERFACE}:${LIBREVISION}:${LIBAGE} \
- ${OBJS} ${LIBS} ${DNSLIBS} ${ISCLIBS}
-
-timestamp: libisccfg.@A@
- touch timestamp
-
-installdirs:
- $(SHELL) ${top_srcdir}/mkinstalldirs ${DESTDIR}${export_libdir}
-
-install:: timestamp installdirs
- ${LIBTOOL_MODE_INSTALL} ${INSTALL_DATA} libisccfg.@A@ \
- ${DESTDIR}${export_libdir}/
-
-clean distclean::
- rm -f libisccfg.@A@ timestamp
+++ /dev/null
-# Copyright (C) 2009, 2011, 2012 Internet Systems Consortium, Inc. ("ISC")
-#
-# Permission to use, copy, modify, and/or distribute this software for any
-# purpose with or without fee is hereby granted, provided that the above
-# copyright notice and this permission notice appear in all copies.
-#
-# THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
-# REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
-# AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
-# INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
-# LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
-# OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
-# PERFORMANCE OF THIS SOFTWARE.
-
-# $Id$
-
-srcdir = @srcdir@
-top_srcdir = @top_srcdir@
-
-
-SUBDIRS = isccfg
-TARGETS =
-
-@BIND9_MAKE_RULES@
+++ /dev/null
-# Copyright (C) 2009, 2012 Internet Systems Consortium, Inc. ("ISC")
-#
-# Permission to use, copy, modify, and/or distribute this software for any
-# purpose with or without fee is hereby granted, provided that the above
-# copyright notice and this permission notice appear in all copies.
-#
-# THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
-# REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
-# AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
-# INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
-# LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
-# OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
-# PERFORMANCE OF THIS SOFTWARE.
-
-# $Id: Makefile.in,v 1.3 2009/09/02 23:48:02 tbox Exp $
-
-srcdir = @srcdir@
-top_srcdir = @top_srcdir@
-
-@BIND9_VERSION@
-
-#
-# Only list headers that are to be installed and are not
-# machine generated. The latter are handled specially in the
-# install target below.
-#
-HEADERS = cfg.h grammar.h log.h dnsconf.h version.h
-
-SUBDIRS =
-TARGETS =
-
-@BIND9_MAKE_RULES@
-
-installdirs:
- $(SHELL) ${top_srcdir}/mkinstalldirs \
- ${DESTDIR}${export_includedir}/isccfg
-
-install:: installdirs
- for i in ${HEADERS}; do \
- ${INSTALL_DATA} ${top_srcdir}/lib/isccfg/include/isccfg/$$i \
- ${DESTDIR}${export_includedir}/isccfg ; \
- done
+++ /dev/null
-Makefile-postinstall
-nsprobe
-sample
-sample-async
-sample-gai
-sample-request
-sample-update
# Alphabetically
OBJS = @ISC_EXTRA_OBJS@ \
assertions.@O@ backtrace.@O@ base32.@O@ base64.@O@ \
- bitstring.@O@ buffer.@O@ bufferlist.@O@ commandline.@O@ \
- error.@O@ event.@O@ \
+ bind9.@O@ bitstring.@O@ buffer.@O@ bufferlist.@O@ \
+ commandline.@O@ error.@O@ event.@O@ \
hash.@O@ heap.@O@ hex.@O@ hmacmd5.@O@ hmacsha.@O@ \
httpd.@O@ inet_aton.@O@ iterated_hash.@O@ \
lex.@O@ lfsr.@O@ lib.@O@ log.@O@ \
# Alphabetically
SRCS = @ISC_EXTRA_SRCS@ \
- assertions.c backtrace.c base32.c base64.c bitstring.c \
- buffer.c bufferlist.c commandline.c error.c event.c \
- heap.c hex.c hmacmd5.c hmacsha.c \
+ assertions.c backtrace.c base32.c base64.c bind9.c \
+ bitstring.c buffer.c bufferlist.c commandline.c \
+ error.c event.c heap.c hex.c hmacmd5.c hmacsha.c \
httpd.c inet_aton.c iterated_hash.c \
lex.c lfsr.c lib.c log.c \
md5.c mem.c mutexblock.c \
isc_appctx_create(isc_mem_t *mctx, isc_appctx_t **ctxp) {
isc_result_t result;
+ if (isc_bind9)
+ return (isc__appctx_create(mctx, ctxp));
+
LOCK(&createlock);
REQUIRE(appctx_createfunc != NULL);
isc_appctx_destroy(isc_appctx_t **ctxp) {
REQUIRE(ctxp != NULL && ISCAPI_APPCTX_VALID(*ctxp));
- (*ctxp)->methods->ctxdestroy(ctxp);
+ if (isc_bind9)
+ isc__appctx_destroy(ctxp);
+ else
+ (*ctxp)->methods->ctxdestroy(ctxp);
ENSURE(*ctxp == NULL);
}
isc_app_ctxstart(isc_appctx_t *ctx) {
REQUIRE(ISCAPI_APPCTX_VALID(ctx));
+ if (isc_bind9)
+ return (isc__app_ctxstart(ctx));
+
return (ctx->methods->ctxstart(ctx));
}
isc_app_ctxrun(isc_appctx_t *ctx) {
REQUIRE(ISCAPI_APPCTX_VALID(ctx));
+ if (isc_bind9)
+ return (isc__app_ctxrun(ctx));
+
return (ctx->methods->ctxrun(ctx));
}
isc_app_ctxsuspend(isc_appctx_t *ctx) {
REQUIRE(ISCAPI_APPCTX_VALID(ctx));
+ if (isc_bind9)
+ return (isc__app_ctxsuspend(ctx));
+
return (ctx->methods->ctxsuspend(ctx));
}
isc_app_ctxshutdown(isc_appctx_t *ctx) {
REQUIRE(ISCAPI_APPCTX_VALID(ctx));
+ if (isc_bind9)
+ return (isc__app_ctxshutdown(ctx));
+
return (ctx->methods->ctxshutdown(ctx));
}
isc_app_ctxfinish(isc_appctx_t *ctx) {
REQUIRE(ISCAPI_APPCTX_VALID(ctx));
+ if (isc_bind9)
+ isc__app_ctxfinish(ctx);
+
ctx->methods->ctxfinish(ctx);
}
REQUIRE(ISCAPI_APPCTX_VALID(ctx));
REQUIRE(taskmgr != NULL);
+ if (isc_bind9)
+ isc__appctx_settaskmgr(ctx, taskmgr);
+
ctx->methods->settaskmgr(ctx, taskmgr);
}
REQUIRE(ISCAPI_APPCTX_VALID(ctx));
REQUIRE(socketmgr != NULL);
+ if (isc_bind9)
+ isc__appctx_setsocketmgr(ctx, socketmgr);
+
ctx->methods->setsocketmgr(ctx, socketmgr);
}
REQUIRE(ISCAPI_APPCTX_VALID(ctx));
REQUIRE(timermgr != NULL);
+ if (isc_bind9)
+ isc__appctx_settimermgr(ctx, timermgr);
+
ctx->methods->settimermgr(ctx, timermgr);
}
+
+isc_result_t
+isc_app_start() {
+ if (isc_bind9)
+ return (isc__app_start());
+
+ return (ISC_R_NOTIMPLEMENTED);
+}
+
+isc_result_t
+isc_app_onrun(isc_mem_t *mctx, isc_task_t *task,
+ isc_taskaction_t action, void *arg)
+{
+ if (isc_bind9)
+ return (isc__app_onrun(mctx, task, action, arg));
+
+ return (ISC_R_NOTIMPLEMENTED);
+}
+
+isc_result_t
+isc_app_run() {
+ if (isc_bind9)
+ return (isc__app_run());
+
+ return (ISC_R_NOTIMPLEMENTED);
+}
+
+isc_result_t
+isc_app_shutdown() {
+ if (isc_bind9)
+ return (isc__app_shutdown());
+
+ return (ISC_R_NOTIMPLEMENTED);
+}
+
+isc_result_t
+isc_app_reload() {
+ if (isc_bind9)
+ return (isc__app_reload());
+
+ return (ISC_R_NOTIMPLEMENTED);
+}
+
+void
+isc_app_finish() {
+ if (!isc_bind9)
+ return;
+
+ isc__app_finish();
+}
+
+void
+isc_app_block() {
+ if (!isc_bind9)
+ return;
+
+ isc__app_block();
+}
+
+void
+isc_app_unblock() {
+ if (!isc_bind9)
+ return;
+
+ isc__app_unblock();
+}
/*
- * Copyright (C) 2009 Internet Systems Consortium, Inc. ("ISC")
+ * Copyright (C) 2012 Internet Systems Consortium, Inc. ("ISC")
*
* Permission to use, copy, modify, and/or distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: bind9.h,v 1.2 2009/12/05 23:31:41 each Exp $ */
+/*! \file */
-#ifndef ISC_BIND9_H
-#define ISC_BIND9_H 1
+#include <isc/bind9.h>
/*
- * This determines whether we are building BIND9 or using the exported
- * libisc/libdns libraries. The version of this file included in the
- * standard BIND9 build defines BIND9; the version included with the
- * exportable libraries does not.
+ * This determines whether we are using the libisc/libdns libraries
+ * in BIND9 or in some other application. It is initialized to ISC_TRUE
+ * and remains unchanged for BIND9 and related tools; export library
+ * clients will run isc_lib_register(), which sets it to ISC_FALSE,
+ * overriding certain BIND9 behaviors.
*/
-#undef BIND9
-
-#endif /* ISC_BIND9_H */
+LIBISC_EXTERNAL_DATA isc_boolean_t isc_bind9 = ISC_TRUE;
hctx->vectorlen = vlen;
hctx->rndvector = rv;
-#ifdef BIND9
if (entropy != NULL)
isc_entropy_attach(entropy, &hctx->entropy);
-#else
- UNUSED(entropy);
-#endif
*hctxp = hctx;
return (ISC_R_SUCCESS);
if (hctx->initialized == ISC_TRUE)
goto out;
- if (hctx->entropy) {
-#ifdef BIND9
+ if (hctx->entropy != NULL) {
isc_result_t result;
result = isc_entropy_getdata(hctx->entropy,
hctx->rndvector, hctx->vectorlen,
NULL, 0);
INSIST(result == ISC_R_SUCCESS);
-#else
- INSIST(0);
-#endif
} else {
isc_uint32_t pr;
unsigned int i, copylen;
isc_refcount_destroy(&hctx->refcnt);
mctx = hctx->mctx;
-#ifdef BIND9
if (hctx->entropy != NULL)
isc_entropy_detach(&hctx->entropy);
-#endif
if (hctx->rndvector != NULL)
isc_mem_put(mctx, hctx->rndvector, hctx->vectorlen);
*\li 'timermgr' is a valid timer manager.
*/
-#ifdef USE_APPIMPREGISTER
/*%<
* See isc_appctx_create() above.
*/
* usually do not have to care about this function: it would call
* isc_lib_register(), which internally calls this function.
*/
-#endif /* USE_APPIMPREGISTER */
ISC_LANG_ENDDECLS
#ifndef ISC_BIND9_H
#define ISC_BIND9_H 1
+#include <isc/boolean.h>
+#include <isc/platform.h>
+
/*
- * This determines whether we are building BIND9 or using the exported
- * libisc/libdns libraries. The version of this file included in the
- * standard BIND9 build defines BIND9; the version included with the
- * exportable libraries does not.
+ * This determines whether we are using the libisc/libdns libraries
+ * in BIND9 or in some other application. For BIND9 (named and related
+ * tools) it must be set to ISC_TRUE at runtime. Export library clients
+ * will call isc_lib_register(), which will set it to ISC_FALSE.
*/
-#define BIND9 1
+LIBISC_EXTERNAL_DATA extern isc_boolean_t isc_bind9;
#endif /* ISC_BIND9_H */
void
ISCMEMPOOLFUNC(put)(isc_mempool_t *, void * _ISC_MEM_FLARG);
-#ifdef USE_MEMIMPREGISTER
-
/*%<
* See isc_mem_create2() above.
*/
* usually do not have to care about this function: it would call
* isc_lib_register(), which internally calls this function.
*/
-#endif /* USE_MEMIMPREGISTER */
ISC_LANG_ENDDECLS
+++ /dev/null
-/*
- * Copyright (C) 2009-2013 Internet Systems Consortium, Inc. ("ISC")
- *
- * Permission to use, copy, modify, and/or distribute this software for any
- * purpose with or without fee is hereby granted, provided that the above
- * copyright notice and this permission notice appear in all copies.
- *
- * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
- * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
- * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
- * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
- * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
- * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
- * PERFORMANCE OF THIS SOFTWARE.
- */
-
-/* $Id$ */
-
-#ifndef ISCAPI_NAMESPACE_H
-#define ISCAPI_NAMESPACE_H 1
-
-/*%
- * name space conversions
- */
-
-#ifdef BIND9
-
-#define isc_app_start isc__app_start
-#define isc_app_ctxstart isc__app_ctxstart
-#define isc_app_onrun isc__app_onrun
-#define isc_app_run isc__app_run
-#define isc_app_ctxrun isc__app_ctxrun
-#define isc_app_shutdown isc__app_shutdown
-#define isc_app_ctxfinish isc__app_ctxfinish
-#define isc_app_ctxshutdown isc__app_ctxshutdown
-#define isc_app_ctxsuspend isc__app_ctxsuspend
-#define isc_app_reload isc__app_reload
-#define isc_app_finish isc__app_finish
-#define isc_app_block isc__app_block
-#define isc_app_unblock isc__app_unblock
-#define isc_appctx_create isc__appctx_create
-#define isc_appctx_destroy isc__appctx_destroy
-#define isc_appctx_settaskmgr isc__appctx_settaskmgr
-#define isc_appctx_setsocketmgr isc__appctx_setsocketmgr
-#define isc_appctx_settimermgr isc__appctx_settimermgr
-
-#define isc_mem_checkdestroyed isc__mem_checkdestroyed
-#define isc_mem_createx isc__mem_createx
-#define isc_mem_createx2 isc__mem_createx2
-#define isc_mem_create isc__mem_create
-#define isc_mem_create2 isc__mem_create2
-#define isc_mem_attach isc__mem_attach
-#define isc_mem_detach isc__mem_detach
-#define isc__mem_putanddetach isc___mem_putanddetach
-#define isc_mem_destroy isc__mem_destroy
-#define isc_mem_ondestroy isc__mem_ondestroy
-#define isc__mem_get isc___mem_get
-#define isc__mem_put isc___mem_put
-#define isc_mem_stats isc__mem_stats
-#define isc__mem_allocate isc___mem_allocate
-#define isc__mem_free isc___mem_free
-#define isc__mem_strdup isc___mem_strdup
-#define isc__mem_reallocate isc___mem_reallocate
-#define isc_mem_references isc__mem_references
-#define isc_mem_setdestroycheck isc__mem_setdestroycheck
-#define isc_mem_setquota isc__mem_setquota
-#define isc_mem_getname isc__mem_getname
-#define isc_mem_getquota isc__mem_getquota
-#define isc_mem_gettag isc__mem_gettag
-#define isc_mem_inuse isc__mem_inuse
-#define isc_mem_maxinuse isc__mem_maxinuse
-#define isc_mem_total isc__mem_total
-#define isc_mem_isovermem isc__mem_isovermem
-#define isc_mem_setname isc__mem_setname
-#define isc_mem_setwater isc__mem_setwater
-#define isc_mem_printactive isc__mem_printactive
-#define isc_mem_printallactive isc__mem_printallactive
-#define isc_mem_waterack isc__mem_waterack
-#define isc_mempool_create isc__mempool_create
-#define isc_mempool_setname isc__mempool_setname
-#define isc_mempool_destroy isc__mempool_destroy
-#define isc_mempool_associatelock isc__mempool_associatelock
-#define isc__mempool_get isc___mempool_get
-#define isc__mempool_put isc___mempool_put
-#define isc_mempool_setfreemax isc__mempool_setfreemax
-#define isc_mempool_getfreemax isc__mempool_getfreemax
-#define isc_mempool_getfreecount isc__mempool_getfreecount
-#define isc_mempool_setmaxalloc isc__mempool_setmaxalloc
-#define isc_mempool_getmaxalloc isc__mempool_getmaxalloc
-#define isc_mempool_getallocated isc__mempool_getallocated
-#define isc_mempool_setfillcount isc__mempool_setfillcount
-#define isc_mempool_getfillcount isc__mempool_getfillcount
-
-#define isc_socket_create isc__socket_create
-#define isc_socket_dup isc__socket_dup
-#define isc_socket_attach isc__socket_attach
-#define isc_socket_detach isc__socket_detach
-#define isc_socketmgr_create isc__socketmgr_create
-#define isc_socketmgr_create2 isc__socketmgr_create2
-#define isc_socketmgr_destroy isc__socketmgr_destroy
-#define isc_socket_open isc__socket_open
-#define isc_socket_close isc__socket_close
-#define isc_socket_recvv isc__socket_recvv
-#define isc_socket_recv isc__socket_recv
-#define isc_socket_recv2 isc__socket_recv2
-#define isc_socket_send isc__socket_send
-#define isc_socket_sendto isc__socket_sendto
-#define isc_socket_sendv isc__socket_sendv
-#define isc_socket_sendtov isc__socket_sendtov
-#define isc_socket_sendto2 isc__socket_sendto2
-#define isc_socket_cleanunix isc__socket_cleanunix
-#define isc_socket_permunix isc__socket_permunix
-#define isc_socket_bind isc__socket_bind
-#define isc_socket_filter isc__socket_filter
-#define isc_socket_listen isc__socket_listen
-#define isc_socket_accept isc__socket_accept
-#define isc_socket_connect isc__socket_connect
-#define isc_socket_getfd isc__socket_getfd
-#define isc_socket_getname isc__socket_getname
-#define isc_socket_gettag isc__socket_gettag
-#define isc_socket_getpeername isc__socket_getpeername
-#define isc_socket_getsockname isc__socket_getsockname
-#define isc_socket_cancel isc__socket_cancel
-#define isc_socket_gettype isc__socket_gettype
-#define isc_socket_isbound isc__socket_isbound
-#define isc_socket_ipv6only isc__socket_ipv6only
-#define isc_socket_dscp isc__socket_dscp
-#define isc_socket_setname isc__socket_setname
-#define isc_socketmgr_getmaxsockets isc__socketmgr_getmaxsockets
-#define isc_socketmgr_setstats isc__socketmgr_setstats
-#define isc_socketmgr_setreserved isc__socketmgr_setreserved
-#define isc__socketmgr_maxudp isc___socketmgr_maxudp
-#define isc_socket_fdwatchcreate isc__socket_fdwatchcreate
-#define isc_socket_fdwatchpoke isc__socket_fdwatchpoke
-
-#define isc_task_create isc__task_create
-#define isc_task_attach isc__task_attach
-#define isc_task_detach isc__task_detach
-/* #define isc_task_exiting isc__task_exiting XXXMPA */
-#define isc_task_send isc__task_send
-#define isc_task_sendanddetach isc__task_sendanddetach
-#define isc_task_purgerange isc__task_purgerange
-#define isc_task_purge isc__task_purge
-#define isc_task_purgeevent isc__task_purgeevent
-#define isc_task_unsendrange isc__task_unsendrange
-#define isc_task_unsend isc__task_unsend
-#define isc_task_onshutdown isc__task_onshutdown
-#define isc_task_shutdown isc__task_shutdown
-#define isc_task_destroy isc__task_destroy
-#define isc_task_setname isc__task_setname
-#define isc_task_getname isc__task_getname
-#define isc_task_gettag isc__task_gettag
-#define isc_task_getcurrenttime isc__task_getcurrenttime
-#define isc_taskmgr_create isc__taskmgr_create
-#define isc_taskmgr_setmode isc__taskmgr_setmode
-#define isc_taskmgr_mode isc__taskmgr_mode
-#define isc_taskmgr_destroy isc__taskmgr_destroy
-#define isc_taskmgr_setexcltask isc__taskmgr_setexcltask
-#define isc_taskmgr_excltask isc__taskmgr_excltask
-#define isc_task_beginexclusive isc__task_beginexclusive
-#define isc_task_endexclusive isc__task_endexclusive
-#define isc_task_setprivilege isc__task_setprivilege
-#define isc_task_privilege isc__task_privilege
-
-#define isc_timer_create isc__timer_create
-#define isc_timer_reset isc__timer_reset
-#define isc_timer_gettype isc__timer_gettype
-#define isc_timer_touch isc__timer_touch
-#define isc_timer_attach isc__timer_attach
-#define isc_timer_detach isc__timer_detach
-#define isc_timermgr_create isc__timermgr_create
-#define isc_timermgr_poke isc__timermgr_poke
-#define isc_timermgr_destroy isc__timermgr_destroy
-
-#endif /* BIND9 */
-
-#endif /* ISCAPI_NAMESPACE_H */
/*@{*/
isc_boolean_t
-isc_socket_isbound(isc_socket_t *sock);
+isc__socket_isbound(isc_socket_t *sock);
+/*%
+ * Intended for internal use in BIND9 only
+ */
void
isc_socket_ipv6only(isc_socket_t *sock, isc_boolean_t yes);
*/
#endif /* HAVE_JSON */
-#ifdef USE_SOCKETIMPREGISTER
/*%<
* See isc_socketmgr_create() above.
*/
* usually do not have to care about this function: it would call
* isc_lib_register(), which internally calls this function.
*/
-#endif /* USE_SOCKETIMPREGISTER */
ISC_LANG_ENDDECLS
/*% Timer Type */
typedef enum {
+ isc_timertype_undefined = -1, /*%< Undefined */
isc_timertype_ticker = 0, /*%< Ticker */
isc_timertype_once = 1, /*%< Once */
isc_timertype_limited = 2, /*%< Limited */
void isc_timermgr_poke(isc_timermgr_t *m);
-#ifdef USE_TIMERIMPREGISTER
/*%<
* See isc_timermgr_create() above.
*/
* usually do not have to care about this function: it would call
* isc_lib_register(), which internally calls this function.
*/
-#endif /* USE_TIMERIMPREGISTER */
ISC_LANG_ENDDECLS
#define ISC_TYPES_H 1
#include <isc/bind9.h>
-#include <isc/namespace.h>
/*! \file isc/types.h
* \brief
}
}
-#ifndef BIND9
static isc_once_t register_once = ISC_ONCE_INIT;
static void
do_register(void) {
+ isc_bind9 = ISC_FALSE;
+
RUNTIME_CHECK(isc__mem_register() == ISC_R_SUCCESS);
RUNTIME_CHECK(isc__app_register() == ISC_R_SUCCESS);
RUNTIME_CHECK(isc__task_register() == ISC_R_SUCCESS);
RUNTIME_CHECK(isc_once_do(®ister_once, do_register)
== ISC_R_SUCCESS);
}
-#endif
#include <limits.h>
+#include <isc/bind9.h>
#include <isc/json.h>
#include <isc/magic.h>
#include <isc/mem.h>
/* List of all active memory contexts. */
static ISC_LIST(isc__mem_t) contexts;
+
static isc_once_t once = ISC_ONCE_INIT;
static isc_mutex_t lock;
+static isc_mutex_t createlock;
/*%
* Total size of lost memory due to a bug of external library.
print_active(isc__mem_t *ctx, FILE *out);
/*%
- * The following can be either static or public, depending on build environment.
+ * The following are intended for internal use (indicated by "isc__"
+ * prefix) but are not declared as static, allowing direct access
+ * from unit tests, etc.
*/
-#ifdef BIND9
-#define ISC_MEMFUNC_SCOPE
-#else
-#define ISC_MEMFUNC_SCOPE static
-#endif
-
-ISC_MEMFUNC_SCOPE isc_result_t
-isc__mem_createx(size_t init_max_size, size_t target_size,
- isc_memalloc_t memalloc, isc_memfree_t memfree, void *arg,
- isc_mem_t **ctxp);
-ISC_MEMFUNC_SCOPE isc_result_t
-isc__mem_createx2(size_t init_max_size, size_t target_size,
- isc_memalloc_t memalloc, isc_memfree_t memfree, void *arg,
- isc_mem_t **ctxp, unsigned int flags);
-ISC_MEMFUNC_SCOPE isc_result_t
-isc__mem_create(size_t init_max_size, size_t target_size, isc_mem_t **ctxp);
-ISC_MEMFUNC_SCOPE isc_result_t
+isc_result_t
isc__mem_create2(size_t init_max_size, size_t target_size,
isc_mem_t **ctxp, unsigned int flags);
-ISC_MEMFUNC_SCOPE void
+void
isc__mem_attach(isc_mem_t *source, isc_mem_t **targetp);
-ISC_MEMFUNC_SCOPE void
+void
isc__mem_detach(isc_mem_t **ctxp);
-ISC_MEMFUNC_SCOPE void
+void
isc___mem_putanddetach(isc_mem_t **ctxp, void *ptr, size_t size FLARG);
-ISC_MEMFUNC_SCOPE void
+void
isc__mem_destroy(isc_mem_t **ctxp);
-ISC_MEMFUNC_SCOPE isc_result_t
+isc_result_t
isc__mem_ondestroy(isc_mem_t *ctx, isc_task_t *task, isc_event_t **event);
-ISC_MEMFUNC_SCOPE void *
+void *
isc___mem_get(isc_mem_t *ctx, size_t size FLARG);
-ISC_MEMFUNC_SCOPE void
+void
isc___mem_put(isc_mem_t *ctx, void *ptr, size_t size FLARG);
-ISC_MEMFUNC_SCOPE void
+void
isc__mem_stats(isc_mem_t *ctx, FILE *out);
-ISC_MEMFUNC_SCOPE void *
+void *
isc___mem_allocate(isc_mem_t *ctx, size_t size FLARG);
-ISC_MEMFUNC_SCOPE void *
+void *
isc___mem_reallocate(isc_mem_t *ctx, void *ptr, size_t size FLARG);
-ISC_MEMFUNC_SCOPE void
+void
isc___mem_free(isc_mem_t *ctx, void *ptr FLARG);
-ISC_MEMFUNC_SCOPE char *
+char *
isc___mem_strdup(isc_mem_t *mctx, const char *s FLARG);
-ISC_MEMFUNC_SCOPE void
+void
isc__mem_setdestroycheck(isc_mem_t *ctx, isc_boolean_t flag);
-ISC_MEMFUNC_SCOPE void
+void
isc__mem_setquota(isc_mem_t *ctx, size_t quota);
-ISC_MEMFUNC_SCOPE size_t
+size_t
isc__mem_getquota(isc_mem_t *ctx);
-ISC_MEMFUNC_SCOPE size_t
+size_t
isc__mem_inuse(isc_mem_t *ctx);
-ISC_MEMFUNC_SCOPE size_t
+size_t
isc__mem_maxinuse(isc_mem_t *ctx);
-ISC_MEMFUNC_SCOPE size_t
+size_t
isc__mem_total(isc_mem_t *ctx);
-ISC_MEMFUNC_SCOPE isc_boolean_t
+isc_boolean_t
isc__mem_isovermem(isc_mem_t *ctx);
-ISC_MEMFUNC_SCOPE void
+void
isc__mem_setwater(isc_mem_t *ctx, isc_mem_water_t water, void *water_arg,
size_t hiwater, size_t lowater);
-ISC_MEMFUNC_SCOPE void
+void
isc__mem_waterack(isc_mem_t *ctx0, int flag);
-ISC_MEMFUNC_SCOPE void
+void
isc__mem_setname(isc_mem_t *ctx, const char *name, void *tag);
-ISC_MEMFUNC_SCOPE const char *
+const char *
isc__mem_getname(isc_mem_t *ctx);
-ISC_MEMFUNC_SCOPE void *
+void *
isc__mem_gettag(isc_mem_t *ctx);
-ISC_MEMFUNC_SCOPE isc_result_t
+isc_result_t
isc__mempool_create(isc_mem_t *mctx, size_t size, isc_mempool_t **mpctxp);
-ISC_MEMFUNC_SCOPE void
+void
isc__mempool_setname(isc_mempool_t *mpctx, const char *name);
-ISC_MEMFUNC_SCOPE void
+void
isc__mempool_destroy(isc_mempool_t **mpctxp);
-ISC_MEMFUNC_SCOPE void
+void
isc__mempool_associatelock(isc_mempool_t *mpctx, isc_mutex_t *lock);
-ISC_MEMFUNC_SCOPE void *
+void *
isc___mempool_get(isc_mempool_t *mpctx FLARG);
-ISC_MEMFUNC_SCOPE void
+void
isc___mempool_put(isc_mempool_t *mpctx, void *mem FLARG);
-ISC_MEMFUNC_SCOPE void
+void
isc__mempool_setfreemax(isc_mempool_t *mpctx, unsigned int limit);
-ISC_MEMFUNC_SCOPE unsigned int
+unsigned int
isc__mempool_getfreemax(isc_mempool_t *mpctx);
-ISC_MEMFUNC_SCOPE unsigned int
+unsigned int
isc__mempool_getfreecount(isc_mempool_t *mpctx);
-ISC_MEMFUNC_SCOPE void
+void
isc__mempool_setmaxalloc(isc_mempool_t *mpctx, unsigned int limit);
-ISC_MEMFUNC_SCOPE unsigned int
+unsigned int
isc__mempool_getmaxalloc(isc_mempool_t *mpctx);
-ISC_MEMFUNC_SCOPE unsigned int
+unsigned int
isc__mempool_getallocated(isc_mempool_t *mpctx);
-ISC_MEMFUNC_SCOPE void
+void
isc__mempool_setfillcount(isc_mempool_t *mpctx, unsigned int limit);
-ISC_MEMFUNC_SCOPE unsigned int
+unsigned int
isc__mempool_getfillcount(isc_mempool_t *mpctx);
-#ifdef BIND9
-ISC_MEMFUNC_SCOPE void
+void
isc__mem_printactive(isc_mem_t *ctx0, FILE *file);
-ISC_MEMFUNC_SCOPE void
+void
isc__mem_printallactive(FILE *file);
-ISC_MEMFUNC_SCOPE void
-isc__mem_checkdestroyed(FILE *file);
-ISC_MEMFUNC_SCOPE unsigned int
+unsigned int
isc__mem_references(isc_mem_t *ctx0);
-#endif
#endif /* ISC_MEM_TRACKLINES */
static struct isc__memmethods {
/*%
* The following are defined just for avoiding unused static functions.
*/
-#ifndef BIND9
void *createx, *create, *create2, *ondestroy, *stats,
- *setquota, *getquota, *setname, *getname, *gettag;
-#endif
+ *setquota, *getquota, *setname, *getname, *gettag;
} memmethods = {
{
isc__mem_attach,
isc__mem_total,
isc__mem_isovermem,
isc__mempool_create
- }
-#ifndef BIND9
- ,
- (void *)isc__mem_createx, (void *)isc__mem_create,
- (void *)isc__mem_create2, (void *)isc__mem_ondestroy,
- (void *)isc__mem_stats, (void *)isc__mem_setquota,
- (void *)isc__mem_getquota, (void *)isc__mem_setname,
- (void *)isc__mem_getname, (void *)isc__mem_gettag
-#endif
+ },
+ (void *)isc_mem_createx,
+ (void *)isc_mem_create,
+ (void *)isc_mem_create2,
+ (void *)isc_mem_ondestroy,
+ (void *)isc_mem_stats,
+ (void *)isc_mem_setquota,
+ (void *)isc_mem_getquota,
+ (void *)isc_mem_setname,
+ (void *)isc_mem_getname,
+ (void *)isc_mem_gettag
};
static struct isc__mempoolmethods {
/*%
* The following are defined just for avoiding unused static functions.
*/
-#ifndef BIND9
void *getfreemax, *getfreecount, *getmaxalloc, *getfillcount;
-#endif
} mempoolmethods = {
{
isc__mempool_destroy,
isc__mempool_setname,
isc__mempool_associatelock,
isc__mempool_setfillcount
- }
-#ifndef BIND9
- ,
- (void *)isc__mempool_getfreemax, (void *)isc__mempool_getfreecount,
- (void *)isc__mempool_getmaxalloc, (void *)isc__mempool_getfillcount
-#endif
+ },
+ (void *)isc_mempool_getfreemax,
+ (void *)isc_mempool_getfreecount,
+ (void *)isc_mempool_getmaxalloc,
+ (void *)isc_mempool_getfillcount
};
#if ISC_MEM_TRACKLINES
* mctx must be locked.
*/
static inline void
-add_trace_entry(isc__mem_t *mctx, const void *ptr, unsigned int size
- FLARG)
-{
+add_trace_entry(isc__mem_t *mctx, const void *ptr, unsigned int size FLARG) {
debuglink_t *dl;
unsigned int i;
unsigned int mysize = size;
static void
initialize_action(void) {
+ RUNTIME_CHECK(isc_mutex_init(&createlock) == ISC_R_SUCCESS);
RUNTIME_CHECK(isc_mutex_init(&lock) == ISC_R_SUCCESS);
ISC_LIST_INIT(contexts);
totallost = 0;
* Public.
*/
-ISC_MEMFUNC_SCOPE isc_result_t
-isc__mem_createx(size_t init_max_size, size_t target_size,
+isc_result_t
+isc_mem_createx(size_t init_max_size, size_t target_size,
isc_memalloc_t memalloc, isc_memfree_t memfree, void *arg,
isc_mem_t **ctxp)
{
- return (isc__mem_createx2(init_max_size, target_size, memalloc, memfree,
- arg, ctxp, ISC_MEMFLAG_DEFAULT));
+ return (isc_mem_createx2(init_max_size, target_size, memalloc, memfree,
+ arg, ctxp, ISC_MEMFLAG_DEFAULT));
}
-ISC_MEMFUNC_SCOPE isc_result_t
-isc__mem_createx2(size_t init_max_size, size_t target_size,
+isc_result_t
+isc_mem_createx2(size_t init_max_size, size_t target_size,
isc_memalloc_t memalloc, isc_memfree_t memfree, void *arg,
isc_mem_t **ctxp, unsigned int flags)
{
return (result);
}
-ISC_MEMFUNC_SCOPE isc_result_t
-isc__mem_create(size_t init_max_size, size_t target_size, isc_mem_t **ctxp) {
- return (isc__mem_createx2(init_max_size, target_size,
- default_memalloc, default_memfree, NULL,
- ctxp, ISC_MEMFLAG_DEFAULT));
-}
-
-ISC_MEMFUNC_SCOPE isc_result_t
-isc__mem_create2(size_t init_max_size, size_t target_size,
- isc_mem_t **ctxp, unsigned int flags)
-{
- return (isc__mem_createx2(init_max_size, target_size,
- default_memalloc, default_memfree, NULL,
- ctxp, flags));
-}
-
static void
destroy(isc__mem_t *ctx) {
unsigned int i;
isc_ondestroy_notify(&ondest, ctx);
}
-ISC_MEMFUNC_SCOPE void
+void
isc__mem_attach(isc_mem_t *source0, isc_mem_t **targetp) {
isc__mem_t *source = (isc__mem_t *)source0;
*targetp = (isc_mem_t *)source;
}
-ISC_MEMFUNC_SCOPE void
+void
isc__mem_detach(isc_mem_t **ctxp) {
isc__mem_t *ctx;
isc_boolean_t want_destroy = ISC_FALSE;
* isc_mem_detach(&mctx);
*/
-ISC_MEMFUNC_SCOPE void
+void
isc___mem_putanddetach(isc_mem_t **ctxp, void *ptr, size_t size FLARG) {
isc__mem_t *ctx;
isc_boolean_t want_destroy = ISC_FALSE;
destroy(ctx);
}
-ISC_MEMFUNC_SCOPE void
+void
isc__mem_destroy(isc_mem_t **ctxp) {
isc__mem_t *ctx;
*ctxp = NULL;
}
-ISC_MEMFUNC_SCOPE isc_result_t
-isc__mem_ondestroy(isc_mem_t *ctx0, isc_task_t *task, isc_event_t **event) {
+isc_result_t
+isc_mem_ondestroy(isc_mem_t *ctx0, isc_task_t *task, isc_event_t **event) {
isc__mem_t *ctx = (isc__mem_t *)ctx0;
isc_result_t res;
return (res);
}
-ISC_MEMFUNC_SCOPE void *
+void *
isc___mem_get(isc_mem_t *ctx0, size_t size FLARG) {
isc__mem_t *ctx = (isc__mem_t *)ctx0;
void *ptr;
return (ptr);
}
-ISC_MEMFUNC_SCOPE void
+void
isc___mem_put(isc_mem_t *ctx0, void *ptr, size_t size FLARG) {
isc__mem_t *ctx = (isc__mem_t *)ctx0;
isc_boolean_t call_water = ISC_FALSE;
(ctx->water)(ctx->water_arg, ISC_MEM_LOWATER);
}
-ISC_MEMFUNC_SCOPE void
+void
isc__mem_waterack(isc_mem_t *ctx0, int flag) {
isc__mem_t *ctx = (isc__mem_t *)ctx0;
/*
* Print the stats[] on the stream "out" with suitable formatting.
*/
-ISC_MEMFUNC_SCOPE void
-isc__mem_stats(isc_mem_t *ctx0, FILE *out) {
+void
+isc_mem_stats(isc_mem_t *ctx0, FILE *out) {
isc__mem_t *ctx = (isc__mem_t *)ctx0;
size_t i;
const struct stats *s;
*/
static void *
-isc__mem_allocateunlocked(isc_mem_t *ctx0, size_t size) {
+mem_allocateunlocked(isc_mem_t *ctx0, size_t size) {
isc__mem_t *ctx = (isc__mem_t *)ctx0;
size_info *si;
return (&si[1]);
}
-ISC_MEMFUNC_SCOPE void *
+void *
isc___mem_allocate(isc_mem_t *ctx0, size_t size FLARG) {
isc__mem_t *ctx = (isc__mem_t *)ctx0;
size_info *si;
if ((ctx->flags & ISC_MEMFLAG_INTERNAL) != 0) {
MCTXLOCK(ctx, &ctx->lock);
- si = isc__mem_allocateunlocked((isc_mem_t *)ctx, size);
+ si = mem_allocateunlocked((isc_mem_t *)ctx, size);
} else {
- si = isc__mem_allocateunlocked((isc_mem_t *)ctx, size);
+ si = mem_allocateunlocked((isc_mem_t *)ctx, size);
MCTXLOCK(ctx, &ctx->lock);
if (si != NULL)
mem_getstats(ctx, si[-1].u.size);
return (si);
}
-ISC_MEMFUNC_SCOPE void *
+void *
isc___mem_reallocate(isc_mem_t *ctx0, void *ptr, size_t size FLARG) {
isc__mem_t *ctx = (isc__mem_t *)ctx0;
void *new_ptr = NULL;
return (new_ptr);
}
-ISC_MEMFUNC_SCOPE void
+void
isc___mem_free(isc_mem_t *ctx0, void *ptr FLARG) {
isc__mem_t *ctx = (isc__mem_t *)ctx0;
size_info *si;
* Other useful things.
*/
-ISC_MEMFUNC_SCOPE char *
+char *
isc___mem_strdup(isc_mem_t *mctx0, const char *s FLARG) {
isc__mem_t *mctx = (isc__mem_t *)mctx0;
size_t len;
len = strlen(s);
- ns = isc___mem_allocate((isc_mem_t *)mctx, len + 1 FLARG_PASS);
+ ns = isc__mem_allocate((isc_mem_t *)mctx, len + 1 FLARG_PASS);
if (ns != NULL)
strncpy(ns, s, len + 1);
return (ns);
}
-ISC_MEMFUNC_SCOPE void
+void
isc__mem_setdestroycheck(isc_mem_t *ctx0, isc_boolean_t flag) {
isc__mem_t *ctx = (isc__mem_t *)ctx0;
* Quotas
*/
-ISC_MEMFUNC_SCOPE void
-isc__mem_setquota(isc_mem_t *ctx0, size_t quota) {
+void
+isc_mem_setquota(isc_mem_t *ctx0, size_t quota) {
isc__mem_t *ctx = (isc__mem_t *)ctx0;
REQUIRE(VALID_CONTEXT(ctx));
MCTXUNLOCK(ctx, &ctx->lock);
}
-ISC_MEMFUNC_SCOPE size_t
-isc__mem_getquota(isc_mem_t *ctx0) {
+size_t
+isc_mem_getquota(isc_mem_t *ctx0) {
isc__mem_t *ctx = (isc__mem_t *)ctx0;
size_t quota;
return (quota);
}
-ISC_MEMFUNC_SCOPE size_t
+size_t
isc__mem_inuse(isc_mem_t *ctx0) {
isc__mem_t *ctx = (isc__mem_t *)ctx0;
size_t inuse;
return (inuse);
}
-ISC_MEMFUNC_SCOPE size_t
+size_t
isc__mem_maxinuse(isc_mem_t *ctx0) {
isc__mem_t *ctx = (isc__mem_t *)ctx0;
size_t maxinuse;
return (maxinuse);
}
-ISC_MEMFUNC_SCOPE size_t
+size_t
isc__mem_total(isc_mem_t *ctx0) {
isc__mem_t *ctx = (isc__mem_t *)ctx0;
size_t total;
return (total);
}
-ISC_MEMFUNC_SCOPE void
+void
isc__mem_setwater(isc_mem_t *ctx0, isc_mem_water_t water, void *water_arg,
- size_t hiwater, size_t lowater)
+ size_t hiwater, size_t lowater)
{
isc__mem_t *ctx = (isc__mem_t *)ctx0;
isc_boolean_t callwater = ISC_FALSE;
(oldwater)(oldwater_arg, ISC_MEM_LOWATER);
}
-ISC_MEMFUNC_SCOPE isc_boolean_t
+isc_boolean_t
isc__mem_isovermem(isc_mem_t *ctx0) {
isc__mem_t *ctx = (isc__mem_t *)ctx0;
return (ctx->is_overmem);
}
-ISC_MEMFUNC_SCOPE void
-isc__mem_setname(isc_mem_t *ctx0, const char *name, void *tag) {
+void
+isc_mem_setname(isc_mem_t *ctx0, const char *name, void *tag) {
isc__mem_t *ctx = (isc__mem_t *)ctx0;
REQUIRE(VALID_CONTEXT(ctx));
UNLOCK(&ctx->lock);
}
-ISC_MEMFUNC_SCOPE const char *
-isc__mem_getname(isc_mem_t *ctx0) {
+const char *
+isc_mem_getname(isc_mem_t *ctx0) {
isc__mem_t *ctx = (isc__mem_t *)ctx0;
REQUIRE(VALID_CONTEXT(ctx));
+ if (ctx->name == NULL)
+ return ("");
+
return (ctx->name);
}
-ISC_MEMFUNC_SCOPE void *
-isc__mem_gettag(isc_mem_t *ctx0) {
+void *
+isc_mem_gettag(isc_mem_t *ctx0) {
isc__mem_t *ctx = (isc__mem_t *)ctx0;
-
+
REQUIRE(VALID_CONTEXT(ctx));
return (ctx->tag);
* Memory pool stuff
*/
-ISC_MEMFUNC_SCOPE isc_result_t
+isc_result_t
isc__mempool_create(isc_mem_t *mctx0, size_t size, isc_mempool_t **mpctxp) {
isc__mem_t *mctx = (isc__mem_t *)mctx0;
isc__mempool_t *mpctx;
return (ISC_R_SUCCESS);
}
-ISC_MEMFUNC_SCOPE void
+void
isc__mempool_setname(isc_mempool_t *mpctx0, const char *name) {
isc__mempool_t *mpctx = (isc__mempool_t *)mpctx0;
#endif
}
-ISC_MEMFUNC_SCOPE void
+void
isc__mempool_destroy(isc_mempool_t **mpctxp) {
isc__mempool_t *mpctx;
isc__mem_t *mctx;
*mpctxp = NULL;
}
-ISC_MEMFUNC_SCOPE void
+void
isc__mempool_associatelock(isc_mempool_t *mpctx0, isc_mutex_t *lock) {
isc__mempool_t *mpctx = (isc__mempool_t *)mpctx0;
mpctx->lock = lock;
}
-ISC_MEMFUNC_SCOPE void *
+void *
isc___mempool_get(isc_mempool_t *mpctx0 FLARG) {
isc__mempool_t *mpctx = (isc__mempool_t *)mpctx0;
element *item;
}
/* coverity[+free : arg-1] */
-ISC_MEMFUNC_SCOPE void
+void
isc___mempool_put(isc_mempool_t *mpctx0, void *mem FLARG) {
isc__mempool_t *mpctx = (isc__mempool_t *)mpctx0;
isc__mem_t *mctx;
* Quotas
*/
-ISC_MEMFUNC_SCOPE void
+void
isc__mempool_setfreemax(isc_mempool_t *mpctx0, unsigned int limit) {
isc__mempool_t *mpctx = (isc__mempool_t *)mpctx0;
UNLOCK(mpctx->lock);
}
-ISC_MEMFUNC_SCOPE unsigned int
-isc__mempool_getfreemax(isc_mempool_t *mpctx0) {
+unsigned int
+isc_mempool_getfreemax(isc_mempool_t *mpctx0) {
isc__mempool_t *mpctx = (isc__mempool_t *)mpctx0;
unsigned int freemax;
return (freemax);
}
-ISC_MEMFUNC_SCOPE unsigned int
-isc__mempool_getfreecount(isc_mempool_t *mpctx0) {
+unsigned int
+isc_mempool_getfreecount(isc_mempool_t *mpctx0) {
isc__mempool_t *mpctx = (isc__mempool_t *)mpctx0;
unsigned int freecount;
return (freecount);
}
-ISC_MEMFUNC_SCOPE void
+void
isc__mempool_setmaxalloc(isc_mempool_t *mpctx0, unsigned int limit) {
isc__mempool_t *mpctx = (isc__mempool_t *)mpctx0;
UNLOCK(mpctx->lock);
}
-ISC_MEMFUNC_SCOPE unsigned int
-isc__mempool_getmaxalloc(isc_mempool_t *mpctx0) {
+unsigned int
+isc_mempool_getmaxalloc(isc_mempool_t *mpctx0) {
isc__mempool_t *mpctx = (isc__mempool_t *)mpctx0;
unsigned int maxalloc;
return (maxalloc);
}
-ISC_MEMFUNC_SCOPE unsigned int
+unsigned int
isc__mempool_getallocated(isc_mempool_t *mpctx0) {
isc__mempool_t *mpctx = (isc__mempool_t *)mpctx0;
unsigned int allocated;
return (allocated);
}
-ISC_MEMFUNC_SCOPE void
+void
isc__mempool_setfillcount(isc_mempool_t *mpctx0, unsigned int limit) {
isc__mempool_t *mpctx = (isc__mempool_t *)mpctx0;
UNLOCK(mpctx->lock);
}
-ISC_MEMFUNC_SCOPE unsigned int
-isc__mempool_getfillcount(isc_mempool_t *mpctx0) {
+unsigned int
+isc_mempool_getfillcount(isc_mempool_t *mpctx0) {
isc__mempool_t *mpctx = (isc__mempool_t *)mpctx0;
unsigned int fillcount;
return (fillcount);
}
-#ifdef USE_MEMIMPREGISTER
isc_result_t
isc__mem_register() {
- return (isc_mem_register(isc__mem_create2));
+ return (isc_mem_register(isc_mem_create2));
}
-#endif
-#ifdef BIND9
-ISC_MEMFUNC_SCOPE void
+void
isc__mem_printactive(isc_mem_t *ctx0, FILE *file) {
#if ISC_MEM_TRACKLINES
isc__mem_t *ctx = (isc__mem_t *)ctx0;
#endif
}
-ISC_MEMFUNC_SCOPE void
-isc__mem_printallactive(FILE *file) {
+void
+isc_mem_printallactive(FILE *file) {
#if !ISC_MEM_TRACKLINES
UNUSED(file);
#else
#endif
}
-ISC_MEMFUNC_SCOPE void
-isc__mem_checkdestroyed(FILE *file) {
+void
+isc_mem_checkdestroyed(FILE *file) {
#if !ISC_MEM_TRACKLINES
UNUSED(file);
#endif
UNLOCK(&lock);
}
-ISC_MEMFUNC_SCOPE unsigned int
+unsigned int
isc_mem_references(isc_mem_t *ctx0) {
isc__mem_t *ctx = (isc__mem_t *)ctx0;
unsigned int references;
return (result);
}
#endif /* HAVE_JSON */
-#endif /* BIND9 */
+
+static isc_memcreatefunc_t mem_createfunc = NULL;
+
+isc_result_t
+isc_mem_register(isc_memcreatefunc_t createfunc) {
+ isc_result_t result = ISC_R_SUCCESS;
+
+ RUNTIME_CHECK(isc_once_do(&once, initialize_action) == ISC_R_SUCCESS);
+
+ LOCK(&createlock);
+ if (mem_createfunc == NULL)
+ mem_createfunc = createfunc;
+ else
+ result = ISC_R_EXISTS;
+ UNLOCK(&createlock);
+
+ return (result);
+}
+
+
+isc_result_t
+isc__mem_create2(size_t init_max_size, size_t target_size, isc_mem_t **mctxp,
+ unsigned int flags)
+{
+ isc_result_t result;
+
+ LOCK(&createlock);
+
+ REQUIRE(mem_createfunc != NULL);
+ result = (*mem_createfunc)(init_max_size, target_size, mctxp, flags);
+
+ UNLOCK(&createlock);
+
+ return (result);
+}
+
+isc_result_t
+isc_mem_create(size_t init_max_size, size_t target_size, isc_mem_t **mctxp) {
+ isc_result_t result;
+
+ if (isc_bind9)
+ return (isc_mem_createx2(init_max_size, target_size,
+ default_memalloc, default_memfree,
+ NULL, mctxp, ISC_MEMFLAG_DEFAULT));
+ LOCK(&createlock);
+
+ REQUIRE(mem_createfunc != NULL);
+ result = (*mem_createfunc)(init_max_size, target_size, mctxp,
+ ISC_MEMFLAG_DEFAULT);
+
+ UNLOCK(&createlock);
+
+ return (result);
+}
+
+isc_result_t
+isc_mem_create2(size_t init_max_size, size_t target_size, isc_mem_t **mctxp,
+ unsigned int flags)
+{
+ if (isc_bind9)
+ return (isc_mem_createx2(init_max_size, target_size,
+ default_memalloc, default_memfree,
+ NULL, mctxp, flags));
+
+ return (isc_mem_createx2(init_max_size, target_size,
+ default_memalloc, default_memfree,
+ NULL, mctxp, flags));
+}
+
+void
+isc_mem_attach(isc_mem_t *source, isc_mem_t **targetp) {
+ REQUIRE(ISCAPI_MCTX_VALID(source));
+ REQUIRE(targetp != NULL && *targetp == NULL);
+
+ if (isc_bind9)
+ isc__mem_attach(source, targetp);
+ else
+ source->methods->attach(source, targetp);
+
+ ENSURE(*targetp == source);
+}
+
+void
+isc_mem_detach(isc_mem_t **mctxp) {
+ REQUIRE(mctxp != NULL && ISCAPI_MCTX_VALID(*mctxp));
+
+ if (isc_bind9)
+ isc__mem_detach(mctxp);
+ else
+ (*mctxp)->methods->detach(mctxp);
+
+ ENSURE(*mctxp == NULL);
+}
+
+void
+isc_mem_destroy(isc_mem_t **mctxp) {
+ REQUIRE(mctxp != NULL && ISCAPI_MCTX_VALID(*mctxp));
+
+ if (isc_bind9)
+ isc__mem_destroy(mctxp);
+ else
+ (*mctxp)->methods->destroy(mctxp);
+
+ ENSURE(*mctxp == NULL);
+}
+
+void
+isc_mem_setdestroycheck(isc_mem_t *mctx, isc_boolean_t flag) {
+ REQUIRE(ISCAPI_MCTX_VALID(mctx));
+
+ mctx->methods->setdestroycheck(mctx, flag);
+}
+
+void
+isc_mem_setwater(isc_mem_t *ctx, isc_mem_water_t water, void *water_arg,
+ size_t hiwater, size_t lowater)
+{
+ REQUIRE(ISCAPI_MCTX_VALID(ctx));
+
+ if (isc_bind9)
+ isc__mem_setwater(ctx, water, water_arg, hiwater, lowater);
+ else
+ ctx->methods->setwater(ctx, water, water_arg, hiwater, lowater);
+}
+
+void
+isc_mem_waterack(isc_mem_t *ctx, int flag) {
+ REQUIRE(ISCAPI_MCTX_VALID(ctx));
+
+ if (isc_bind9)
+ isc__mem_waterack(ctx, flag);
+ else
+ ctx->methods->waterack(ctx, flag);
+}
+
+size_t
+isc_mem_inuse(isc_mem_t *mctx) {
+ REQUIRE(ISCAPI_MCTX_VALID(mctx));
+
+ if (isc_bind9)
+ return (isc__mem_inuse(mctx));
+
+ return (mctx->methods->inuse(mctx));
+}
+
+size_t
+isc_mem_maxinuse(isc_mem_t *mctx) {
+ REQUIRE(ISCAPI_MCTX_VALID(mctx));
+
+ if (isc_bind9)
+ return (isc__mem_maxinuse(mctx));
+
+ return (mctx->methods->maxinuse(mctx));
+}
+
+size_t
+isc_mem_total(isc_mem_t *mctx) {
+ REQUIRE(ISCAPI_MCTX_VALID(mctx));
+
+ if (isc_bind9)
+ return (isc__mem_total(mctx));
+
+ return (mctx->methods->total(mctx));
+}
+
+isc_boolean_t
+isc_mem_isovermem(isc_mem_t *mctx) {
+ REQUIRE(ISCAPI_MCTX_VALID(mctx));
+
+ if (isc_bind9)
+ return (isc__mem_isovermem(mctx));
+
+ return (mctx->methods->isovermem(mctx));
+}
+
+
+isc_result_t
+isc_mempool_create(isc_mem_t *mctx, size_t size, isc_mempool_t **mpctxp) {
+ REQUIRE(ISCAPI_MCTX_VALID(mctx));
+
+ return (mctx->methods->mpcreate(mctx, size, mpctxp));
+}
+
+void
+isc_mempool_destroy(isc_mempool_t **mpctxp) {
+ REQUIRE(mpctxp != NULL && ISCAPI_MPOOL_VALID(*mpctxp));
+
+ if (isc_bind9)
+ isc__mempool_destroy(mpctxp);
+ else
+ (*mpctxp)->methods->destroy(mpctxp);
+
+ ENSURE(*mpctxp == NULL);
+}
+
+unsigned int
+isc_mempool_getallocated(isc_mempool_t *mpctx) {
+ REQUIRE(ISCAPI_MPOOL_VALID(mpctx));
+
+ if (isc_bind9)
+ return (isc__mempool_getallocated(mpctx));
+
+ return (mpctx->methods->getallocated(mpctx));
+}
+
+void
+isc_mempool_setmaxalloc(isc_mempool_t *mpctx, unsigned int limit) {
+ REQUIRE(ISCAPI_MPOOL_VALID(mpctx));
+
+ if (isc_bind9)
+ isc__mempool_setmaxalloc(mpctx, limit);
+ else
+ mpctx->methods->setmaxalloc(mpctx, limit);
+}
+
+void
+isc_mempool_setfreemax(isc_mempool_t *mpctx, unsigned int limit) {
+ REQUIRE(ISCAPI_MPOOL_VALID(mpctx));
+
+ if (isc_bind9)
+ isc__mempool_setfreemax(mpctx, limit);
+ else
+ mpctx->methods->setfreemax(mpctx, limit);
+}
+
+void
+isc_mempool_setname(isc_mempool_t *mpctx, const char *name) {
+ REQUIRE(ISCAPI_MPOOL_VALID(mpctx));
+
+ if (isc_bind9)
+ isc__mempool_setname(mpctx, name);
+ else
+ mpctx->methods->setname(mpctx, name);
+}
+
+void
+isc_mempool_associatelock(isc_mempool_t *mpctx, isc_mutex_t *lock) {
+ REQUIRE(ISCAPI_MPOOL_VALID(mpctx));
+
+ if (isc_bind9)
+ isc__mempool_associatelock(mpctx, lock);
+ else
+ mpctx->methods->associatelock(mpctx, lock);
+}
+
+void
+isc_mempool_setfillcount(isc_mempool_t *mpctx, unsigned int limit) {
+ REQUIRE(ISCAPI_MPOOL_VALID(mpctx));
+
+ if (isc_bind9)
+ isc__mempool_setfillcount(mpctx, limit);
+ else
+ mpctx->methods->setfillcount(mpctx, limit);
+}
+
+void *
+isc__mem_get(isc_mem_t *mctx, size_t size FLARG) {
+ REQUIRE(ISCAPI_MCTX_VALID(mctx));
+
+ if (isc_bind9)
+ return (isc___mem_get(mctx, size FLARG_PASS));
+
+ return (mctx->methods->memget(mctx, size FLARG_PASS));
+
+}
+
+void
+isc__mem_put(isc_mem_t *mctx, void *ptr, size_t size FLARG) {
+ REQUIRE(ISCAPI_MCTX_VALID(mctx));
+
+ if (isc_bind9)
+ isc___mem_put(mctx, ptr, size FLARG_PASS);
+ else
+ mctx->methods->memput(mctx, ptr, size FLARG_PASS);
+}
+
+void
+isc__mem_putanddetach(isc_mem_t **mctxp, void *ptr, size_t size FLARG) {
+ REQUIRE(mctxp != NULL && ISCAPI_MCTX_VALID(*mctxp));
+
+ if (isc_bind9)
+ isc___mem_putanddetach(mctxp, ptr, size FLARG_PASS);
+ else
+ (*mctxp)->methods->memputanddetach(mctxp, ptr, size FLARG_PASS);
+
+ /*
+ * XXX: We cannot always ensure *mctxp == NULL here
+ * (see lib/isc/mem.c).
+ */
+}
+
+void *
+isc__mem_allocate(isc_mem_t *mctx, size_t size FLARG) {
+ REQUIRE(ISCAPI_MCTX_VALID(mctx));
+
+ if (isc_bind9)
+ return (isc___mem_allocate(mctx, size FLARG_PASS));
+
+ return (mctx->methods->memallocate(mctx, size FLARG_PASS));
+}
+
+void *
+isc__mem_reallocate(isc_mem_t *mctx, void *ptr, size_t size FLARG) {
+ REQUIRE(ISCAPI_MCTX_VALID(mctx));
+
+ if (isc_bind9)
+ return (isc___mem_reallocate(mctx, ptr, size FLARG_PASS));
+
+ return (mctx->methods->memreallocate(mctx, ptr, size FLARG_PASS));
+}
+
+char *
+isc__mem_strdup(isc_mem_t *mctx, const char *s FLARG) {
+ REQUIRE(ISCAPI_MCTX_VALID(mctx));
+
+ if (isc_bind9)
+ return (isc___mem_strdup(mctx, s FLARG_PASS));
+
+ return (mctx->methods->memstrdup(mctx, s FLARG_PASS));
+}
+
+void
+isc__mem_free(isc_mem_t *mctx, void *ptr FLARG) {
+ REQUIRE(ISCAPI_MCTX_VALID(mctx));
+
+ if (isc_bind9)
+ isc___mem_free(mctx, ptr FLARG_PASS);
+ else
+ mctx->methods->memfree(mctx, ptr FLARG_PASS);
+}
+
+void *
+isc__mempool_get(isc_mempool_t *mpctx FLARG) {
+ REQUIRE(ISCAPI_MPOOL_VALID(mpctx));
+
+ if (isc_bind9)
+ return (isc___mempool_get(mpctx FLARG_PASS));
+
+ return (mpctx->methods->get(mpctx FLARG_PASS));
+}
+
+void
+isc__mempool_put(isc_mempool_t *mpctx, void *mem FLARG) {
+ REQUIRE(ISCAPI_MPOOL_VALID(mpctx));
+
+ if (isc_bind9)
+ isc___mempool_put(mpctx, mem FLARG_PASS);
+ else
+ mpctx->methods->put(mpctx, mem FLARG_PASS);
+}
+++ /dev/null
-/*
- * Copyright (C) 2009, 2010, 2012 Internet Systems Consortium, Inc. ("ISC")
- *
- * Permission to use, copy, modify, and/or distribute this software for any
- * purpose with or without fee is hereby granted, provided that the above
- * copyright notice and this permission notice appear in all copies.
- *
- * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
- * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
- * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
- * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
- * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
- * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
- * PERFORMANCE OF THIS SOFTWARE.
- */
-
-/* $Id: mem_api.c,v 1.8 2010/08/12 21:30:26 jinmei Exp $ */
-
-#include <config.h>
-
-#include <isc/magic.h>
-#include <isc/mem.h>
-#include <isc/once.h>
-#include <isc/util.h>
-
-#if ISC_MEM_TRACKLINES
-#define FLARG_PASS , file, line
-#define FLARG , const char *file, unsigned int line
-#else
-#define FLARG_PASS
-#define FLARG
-#endif
-
-static isc_mutex_t createlock;
-static isc_once_t once = ISC_ONCE_INIT;
-static isc_memcreatefunc_t mem_createfunc = NULL;
-
-static void
-initialize(void) {
- RUNTIME_CHECK(isc_mutex_init(&createlock) == ISC_R_SUCCESS);
-}
-
-isc_result_t
-isc_mem_register(isc_memcreatefunc_t createfunc) {
- isc_result_t result = ISC_R_SUCCESS;
-
- RUNTIME_CHECK(isc_once_do(&once, initialize) == ISC_R_SUCCESS);
-
- LOCK(&createlock);
- if (mem_createfunc == NULL)
- mem_createfunc = createfunc;
- else
- result = ISC_R_EXISTS;
- UNLOCK(&createlock);
-
- return (result);
-}
-
-isc_result_t
-isc_mem_create(size_t init_max_size, size_t target_size, isc_mem_t **mctxp) {
- isc_result_t result;
-
- LOCK(&createlock);
-
- REQUIRE(mem_createfunc != NULL);
- result = (*mem_createfunc)(init_max_size, target_size, mctxp,
- ISC_MEMFLAG_DEFAULT);
-
- UNLOCK(&createlock);
-
- return (result);
-}
-
-isc_result_t
-isc_mem_create2(size_t init_max_size, size_t target_size, isc_mem_t **mctxp,
- unsigned int flags)
-{
- isc_result_t result;
-
- LOCK(&createlock);
-
- REQUIRE(mem_createfunc != NULL);
- result = (*mem_createfunc)(init_max_size, target_size, mctxp, flags);
-
- UNLOCK(&createlock);
-
- return (result);
-}
-
-void
-isc_mem_attach(isc_mem_t *source, isc_mem_t **targetp) {
- REQUIRE(ISCAPI_MCTX_VALID(source));
- REQUIRE(targetp != NULL && *targetp == NULL);
-
- source->methods->attach(source, targetp);
-
- ENSURE(*targetp == source);
-}
-
-void
-isc_mem_detach(isc_mem_t **mctxp) {
- REQUIRE(mctxp != NULL && ISCAPI_MCTX_VALID(*mctxp));
-
- (*mctxp)->methods->detach(mctxp);
-
- ENSURE(*mctxp == NULL);
-}
-
-void
-isc_mem_destroy(isc_mem_t **mctxp) {
- REQUIRE(mctxp != NULL && ISCAPI_MCTX_VALID(*mctxp));
-
- (*mctxp)->methods->destroy(mctxp);
-
- ENSURE(*mctxp == NULL);
-}
-
-void *
-isc__mem_get(isc_mem_t *mctx, size_t size FLARG) {
- REQUIRE(ISCAPI_MCTX_VALID(mctx));
-
- return (mctx->methods->memget(mctx, size FLARG_PASS));
-}
-
-void
-isc__mem_put(isc_mem_t *mctx, void *ptr, size_t size FLARG) {
- REQUIRE(ISCAPI_MCTX_VALID(mctx));
-
- mctx->methods->memput(mctx, ptr, size FLARG_PASS);
-}
-
-void
-isc__mem_putanddetach(isc_mem_t **mctxp, void *ptr, size_t size FLARG) {
- REQUIRE(mctxp != NULL && ISCAPI_MCTX_VALID(*mctxp));
-
- (*mctxp)->methods->memputanddetach(mctxp, ptr, size FLARG_PASS);
-
- /*
- * XXX: We cannot always ensure *mctxp == NULL here
- * (see lib/isc/mem.c).
- */
-}
-
-void *
-isc__mem_allocate(isc_mem_t *mctx, size_t size FLARG) {
- REQUIRE(ISCAPI_MCTX_VALID(mctx));
-
- return (mctx->methods->memallocate(mctx, size FLARG_PASS));
-}
-
-void *
-isc__mem_reallocate(isc_mem_t *mctx, void *ptr, size_t size FLARG) {
- REQUIRE(ISCAPI_MCTX_VALID(mctx));
-
- return (mctx->methods->memreallocate(mctx, ptr, size FLARG_PASS));
-}
-
-char *
-isc__mem_strdup(isc_mem_t *mctx, const char *s FLARG) {
- REQUIRE(ISCAPI_MCTX_VALID(mctx));
-
- return (mctx->methods->memstrdup(mctx, s FLARG_PASS));
-}
-
-void
-isc__mem_free(isc_mem_t *mctx, void *ptr FLARG) {
- REQUIRE(ISCAPI_MCTX_VALID(mctx));
-
- mctx->methods->memfree(mctx, ptr FLARG_PASS);
-}
-
-void
-isc_mem_setdestroycheck(isc_mem_t *mctx, isc_boolean_t flag) {
- REQUIRE(ISCAPI_MCTX_VALID(mctx));
-
- mctx->methods->setdestroycheck(mctx, flag);
-}
-
-void
-isc_mem_setwater(isc_mem_t *ctx, isc_mem_water_t water, void *water_arg,
- size_t hiwater, size_t lowater)
-{
- REQUIRE(ISCAPI_MCTX_VALID(ctx));
-
- ctx->methods->setwater(ctx, water, water_arg, hiwater, lowater);
-}
-
-void
-isc_mem_waterack(isc_mem_t *ctx, int flag) {
- REQUIRE(ISCAPI_MCTX_VALID(ctx));
-
- ctx->methods->waterack(ctx, flag);
-}
-
-size_t
-isc_mem_inuse(isc_mem_t *mctx) {
- REQUIRE(ISCAPI_MCTX_VALID(mctx));
-
- return (mctx->methods->inuse(mctx));
-}
-
-isc_boolean_t
-isc_mem_isovermem(isc_mem_t *mctx) {
- REQUIRE(ISCAPI_MCTX_VALID(mctx));
-
- return (mctx->methods->isovermem(mctx));
-}
-
-size_t
-isc_mem_maxinuse(isc_mem_t *mctx) {
- REQUIRE(ISCAPI_MCTX_VALID(mctx));
-
- return (mctx->methods->maxinuse(mctx));
-}
-
-size_t
-isc_mem_total(isc_mem_t *mctx) {
- REQUIRE(ISCAPI_MCTX_VALID(mctx));
-
- return (mctx->methods->total(mctx));
-}
-
-void
-isc_mem_setname(isc_mem_t *mctx, const char *name, void *tag) {
- REQUIRE(ISCAPI_MCTX_VALID(mctx));
-
- UNUSED(name);
- UNUSED(tag);
-
- return;
-}
-
-const char *
-isc_mem_getname(isc_mem_t *mctx) {
- REQUIRE(ISCAPI_MCTX_VALID(mctx));
-
- return ("");
-}
-
-void *
-isc_mem_gettag(isc_mem_t *mctx) {
- REQUIRE(ISCAPI_MCTX_VALID(mctx));
-
- return (NULL);
-}
-
-isc_result_t
-isc_mempool_create(isc_mem_t *mctx, size_t size, isc_mempool_t **mpctxp) {
- REQUIRE(ISCAPI_MCTX_VALID(mctx));
-
- return (mctx->methods->mpcreate(mctx, size, mpctxp));
-}
-
-void
-isc_mempool_destroy(isc_mempool_t **mpctxp) {
- REQUIRE(mpctxp != NULL && ISCAPI_MPOOL_VALID(*mpctxp));
-
- (*mpctxp)->methods->destroy(mpctxp);
-
- ENSURE(*mpctxp == NULL);
-}
-
-void *
-isc__mempool_get(isc_mempool_t *mpctx FLARG) {
- REQUIRE(ISCAPI_MPOOL_VALID(mpctx));
-
- return (mpctx->methods->get(mpctx FLARG_PASS));
-}
-
-void
-isc__mempool_put(isc_mempool_t *mpctx, void *mem FLARG) {
- REQUIRE(ISCAPI_MPOOL_VALID(mpctx));
-
- mpctx->methods->put(mpctx, mem FLARG_PASS);
-}
-
-unsigned int
-isc_mempool_getallocated(isc_mempool_t *mpctx) {
- REQUIRE(ISCAPI_MPOOL_VALID(mpctx));
-
- return (mpctx->methods->getallocated(mpctx));
-}
-
-void
-isc_mempool_setmaxalloc(isc_mempool_t *mpctx, unsigned int limit) {
- REQUIRE(ISCAPI_MPOOL_VALID(mpctx));
-
- mpctx->methods->setmaxalloc(mpctx, limit);
-}
-
-void
-isc_mempool_setfreemax(isc_mempool_t *mpctx, unsigned int limit) {
- REQUIRE(ISCAPI_MPOOL_VALID(mpctx));
-
- mpctx->methods->setfreemax(mpctx, limit);
-}
-
-void
-isc_mempool_setname(isc_mempool_t *mpctx, const char *name) {
- REQUIRE(ISCAPI_MPOOL_VALID(mpctx));
-
- mpctx->methods->setname(mpctx, name);
-}
-
-void
-isc_mempool_associatelock(isc_mempool_t *mpctx, isc_mutex_t *lock) {
- REQUIRE(ISCAPI_MPOOL_VALID(mpctx));
-
- mpctx->methods->associatelock(mpctx, lock);
-}
-
-void
-isc_mempool_setfillcount(isc_mempool_t *mpctx, unsigned int limit) {
- REQUIRE(ISCAPI_MPOOL_VALID(mpctx));
-
- mpctx->methods->setfillcount(mpctx, limit);
-}
isc_socketmgr_create(isc_mem_t *mctx, isc_socketmgr_t **managerp) {
isc_result_t result;
+ if (isc_bind9)
+ return (isc__socketmgr_create(mctx, managerp));
+
LOCK(&createlock);
REQUIRE(socketmgr_createfunc != NULL);
isc_socketmgr_destroy(isc_socketmgr_t **managerp) {
REQUIRE(managerp != NULL && ISCAPI_SOCKETMGR_VALID(*managerp));
- (*managerp)->methods->destroy(managerp);
+ if (isc_bind9)
+ isc__socketmgr_destroy(managerp);
+ else
+ (*managerp)->methods->destroy(managerp);
ENSURE(*managerp == NULL);
}
{
REQUIRE(ISCAPI_SOCKETMGR_VALID(manager));
+ if (isc_bind9)
+ return (isc__socket_create(manager, pf, type, socketp));
+
return (manager->methods->socketcreate(manager, pf, type, socketp));
}
REQUIRE(ISCAPI_SOCKET_VALID(sock));
REQUIRE(socketp != NULL && *socketp == NULL);
- sock->methods->attach(sock, socketp);
+ if (isc_bind9)
+ isc__socket_attach(sock, socketp);
+ else
+ sock->methods->attach(sock, socketp);
ENSURE(*socketp == sock);
}
isc_socket_detach(isc_socket_t **socketp) {
REQUIRE(socketp != NULL && ISCAPI_SOCKET_VALID(*socketp));
- (*socketp)->methods->detach(socketp);
+ if (isc_bind9)
+ isc__socket_detach(socketp);
+ else
+ (*socketp)->methods->detach(socketp);
ENSURE(*socketp == NULL);
}
{
REQUIRE(ISCAPI_SOCKET_VALID(sock));
+ if (isc_bind9)
+ return (isc__socket_bind(sock, sockaddr, options));
+
return (sock->methods->bind(sock, sockaddr, options));
}
{
REQUIRE(ISCAPI_SOCKET_VALID(sock));
+ if (isc_bind9)
+ return (isc__socket_sendto(sock, region, task,
+ action, arg, address, pktinfo));
+
return (sock->methods->sendto(sock, region, task, action, arg, address,
pktinfo));
}
-isc_result_t
-isc_socket_sendto2(isc_socket_t *sock, isc_region_t *region,
- isc_task_t *task, isc_sockaddr_t *address,
- struct in6_pktinfo *pktinfo, isc_socketevent_t *event,
- unsigned int flags)
-{
- REQUIRE(ISCAPI_SOCKET_VALID(sock));
-
- return (sock->methods->sendto2(sock, region, task, address,
- pktinfo, event, flags));
-}
-
isc_result_t
isc_socket_connect(isc_socket_t *sock, isc_sockaddr_t *addr, isc_task_t *task,
isc_taskaction_t action, const void *arg)
{
REQUIRE(ISCAPI_SOCKET_VALID(sock));
+ if (isc_bind9)
+ return (isc__socket_connect(sock, addr, task, action, arg));
+
return (sock->methods->connect(sock, addr, task, action, arg));
}
{
REQUIRE(ISCAPI_SOCKET_VALID(sock));
- return (sock->methods->recv(sock, region, minimum, task, action, arg));
-}
-
-isc_result_t
-isc_socket_recv2(isc_socket_t *sock, isc_region_t *region,
- unsigned int minimum, isc_task_t *task,
- isc_socketevent_t *event, unsigned int flags)
-{
- REQUIRE(ISCAPI_SOCKET_VALID(sock));
+ if (isc_bind9)
+ return (isc__socket_recv(sock, region, minimum,
+ task, action, arg));
- return (sock->methods->recv2(sock, region, minimum, task,
- event, flags));
+ return (sock->methods->recv(sock, region, minimum, task, action, arg));
}
void
isc_socket_cancel(isc_socket_t *sock, isc_task_t *task, unsigned int how) {
REQUIRE(ISCAPI_SOCKET_VALID(sock));
- sock->methods->cancel(sock, task, how);
+ if (isc_bind9)
+ isc__socket_cancel(sock, task, how);
+ else
+ sock->methods->cancel(sock, task, how);
}
isc_result_t
isc_socket_getsockname(isc_socket_t *sock, isc_sockaddr_t *addressp) {
REQUIRE(ISCAPI_SOCKET_VALID(sock));
+ if (isc_bind9)
+ return (isc__socket_getsockname(sock, addressp));
+
return (sock->methods->getsockname(sock, addressp));
}
isc_socket_ipv6only(isc_socket_t *sock, isc_boolean_t yes) {
REQUIRE(ISCAPI_SOCKET_VALID(sock));
- sock->methods->ipv6only(sock, yes);
+ if (isc_bind9)
+ isc__socket_ipv6only(sock, yes);
+ else
+ sock->methods->ipv6only(sock, yes);
}
void
isc_socket_gettype(isc_socket_t *sock) {
REQUIRE(ISCAPI_SOCKET_VALID(sock));
+ if (isc_bind9)
+ return (isc__socket_gettype(sock));
+
return (sock->methods->gettype(sock));
}
{
REQUIRE(ISCAPI_SOCKETMGR_VALID(manager));
+ if (isc_bind9)
+ return (isc__socket_fdwatchcreate(manager, fd, flags,
+ callback, cbarg,
+ task, socketp));
+
return (manager->methods->fdwatchcreate(manager, fd, flags,
callback, cbarg, task,
socketp));
{
REQUIRE(ISCAPI_SOCKET_VALID(sock));
- return(sock->methods->fdwatchpoke(sock, flags));
+ if (isc_bind9)
+ return (isc__socket_fdwatchpoke(sock, flags));
+
+ return (sock->methods->fdwatchpoke(sock, flags));
}
isc_result_t
REQUIRE(ISCAPI_SOCKET_VALID(sock));
REQUIRE(socketp != NULL && *socketp == NULL);
- return(sock->methods->dup(sock, socketp));
+ if (isc_bind9)
+ return (isc__socket_dup(sock, socketp));
+
+ return (sock->methods->dup(sock, socketp));
}
int
isc_socket_getfd(isc_socket_t *sock) {
REQUIRE(ISCAPI_SOCKET_VALID(sock));
- return(sock->methods->getfd(sock));
+ if (isc_bind9)
+ return (isc__socket_getfd(sock));
+
+ return (sock->methods->getfd(sock));
+}
+
+isc_result_t
+isc_socket_open(isc_socket_t *sock) {
+ return (isc__socket_open(sock));
+}
+
+isc_result_t
+isc_socket_close(isc_socket_t *sock) {
+ return (isc__socket_close(sock));
+}
+
+isc_result_t
+isc_socketmgr_create2(isc_mem_t *mctx, isc_socketmgr_t **managerp,
+ unsigned int maxsocks)
+{
+ return (isc__socketmgr_create2(mctx, managerp, maxsocks));
+}
+
+isc_result_t
+isc_socket_recvv(isc_socket_t *sock, isc_bufferlist_t *buflist,
+ unsigned int minimum, isc_task_t *task,
+ isc_taskaction_t action, const void *arg)
+{
+ return (isc__socket_recvv(sock, buflist, minimum, task, action, arg));
+}
+
+isc_result_t
+isc_socket_recv2(isc_socket_t *sock, isc_region_t *region,
+ unsigned int minimum, isc_task_t *task,
+ isc_socketevent_t *event, unsigned int flags)
+{
+ return (isc__socket_recv2(sock, region, minimum, task, event, flags));
+}
+
+isc_result_t
+isc_socket_send(isc_socket_t *sock, isc_region_t *region,
+ isc_task_t *task, isc_taskaction_t action, const void *arg)
+{
+ return (isc__socket_send(sock, region, task, action, arg));
+}
+
+isc_result_t
+isc_socket_sendv(isc_socket_t *sock, isc_bufferlist_t *buflist,
+ isc_task_t *task, isc_taskaction_t action, const void *arg)
+{
+ return (isc__socket_sendv(sock, buflist, task, action, arg));
+}
+
+isc_result_t
+isc_socket_sendtov(isc_socket_t *sock, isc_bufferlist_t *buflist,
+ isc_task_t *task, isc_taskaction_t action, const void *arg,
+ isc_sockaddr_t *address, struct in6_pktinfo *pktinfo)
+{
+ return (isc__socket_sendtov(sock, buflist, task, action, arg,
+ address, pktinfo));
+}
+
+isc_result_t
+isc_socket_sendto2(isc_socket_t *sock, isc_region_t *region,
+ isc_task_t *task,
+ isc_sockaddr_t *address, struct in6_pktinfo *pktinfo,
+ isc_socketevent_t *event, unsigned int flags)
+{
+ return (isc__socket_sendto2(sock, region, task, address, pktinfo,
+ event, flags));
}
+
+void
+isc_socket_cleanunix(isc_sockaddr_t *sockaddr, isc_boolean_t active) {
+ isc__socket_cleanunix(sockaddr, active);
+}
+
+isc_result_t
+isc_socket_permunix(isc_sockaddr_t *sockaddr, isc_uint32_t perm,
+ isc_uint32_t owner, isc_uint32_t group)
+{
+ return (isc__socket_permunix(sockaddr, perm, owner, group));
+}
+
+isc_result_t
+isc_socket_filter(isc_socket_t *sock, const char *filter) {
+ return (isc__socket_filter(sock, filter));
+}
+
+isc_result_t
+isc_socket_listen(isc_socket_t *sock, unsigned int backlog) {
+ return (isc__socket_listen(sock, backlog));
+}
+
+isc_result_t
+isc_socket_accept(isc_socket_t *sock, isc_task_t *task,
+ isc_taskaction_t action, const void *arg)
+{
+ return (isc__socket_accept(sock, task, action, arg));
+}
+
+isc_result_t
+isc_socket_getpeername(isc_socket_t *sock, isc_sockaddr_t *addressp) {
+ return (isc__socket_getpeername(sock, addressp));
+}
+
#include <config.h>
+#include <isc/app.h>
#include <isc/condition.h>
#include <isc/event.h>
#include <isc/json.h>
#include <isc/magic.h>
#include <isc/mem.h>
#include <isc/msgs.h>
+#include <isc/once.h>
#include <isc/platform.h>
#include <isc/string.h>
#include <isc/task.h>
* is expected to have a separate manager; no "worker threads" are shared by
* the application threads.
*/
-#ifdef BIND9
#ifdef ISC_PLATFORM_USETHREADS
#define USE_WORKER_THREADS
#else
#define USE_SHARED_MANAGER
#endif /* ISC_PLATFORM_USETHREADS */
-#endif /* BIND9 */
#include "task_p.h"
task_state_done
} task_state_t;
-#if defined(HAVE_LIBXML2) && defined(BIND9)
+#if defined(HAVE_LIBXML2)
static const char *statenames[] = {
"idle", "ready", "running", "done",
};
#endif /* USE_SHARED_MANAGER */
/*%
- * The following can be either static or public, depending on build environment.
+ * The following are intended for internal use (indicated by "isc__"
+ * prefix) but are not declared as static, allowing direct access from
+ * unit tests etc.
*/
-#ifdef BIND9
-#define ISC_TASKFUNC_SCOPE
-#else
-#define ISC_TASKFUNC_SCOPE static
-#endif
-
-ISC_TASKFUNC_SCOPE isc_result_t
+isc_result_t
isc__task_create(isc_taskmgr_t *manager0, unsigned int quantum,
isc_task_t **taskp);
-ISC_TASKFUNC_SCOPE void
+void
isc__task_attach(isc_task_t *source0, isc_task_t **targetp);
-ISC_TASKFUNC_SCOPE void
+void
isc__task_detach(isc_task_t **taskp);
-ISC_TASKFUNC_SCOPE void
+void
isc__task_send(isc_task_t *task0, isc_event_t **eventp);
-ISC_TASKFUNC_SCOPE void
+void
isc__task_sendanddetach(isc_task_t **taskp, isc_event_t **eventp);
-ISC_TASKFUNC_SCOPE unsigned int
+unsigned int
isc__task_purgerange(isc_task_t *task0, void *sender, isc_eventtype_t first,
isc_eventtype_t last, void *tag);
-ISC_TASKFUNC_SCOPE unsigned int
+unsigned int
isc__task_purge(isc_task_t *task, void *sender, isc_eventtype_t type,
void *tag);
-ISC_TASKFUNC_SCOPE isc_boolean_t
-isc__task_purgeevent(isc_task_t *task0, isc_event_t *event);
-ISC_TASKFUNC_SCOPE unsigned int
+isc_boolean_t
+isc_task_purgeevent(isc_task_t *task0, isc_event_t *event);
+unsigned int
isc__task_unsendrange(isc_task_t *task, void *sender, isc_eventtype_t first,
isc_eventtype_t last, void *tag,
isc_eventlist_t *events);
-ISC_TASKFUNC_SCOPE unsigned int
+unsigned int
isc__task_unsend(isc_task_t *task, void *sender, isc_eventtype_t type,
void *tag, isc_eventlist_t *events);
-ISC_TASKFUNC_SCOPE isc_result_t
+isc_result_t
isc__task_onshutdown(isc_task_t *task0, isc_taskaction_t action,
const void *arg);
-ISC_TASKFUNC_SCOPE void
+void
isc__task_shutdown(isc_task_t *task0);
-ISC_TASKFUNC_SCOPE void
+void
isc__task_destroy(isc_task_t **taskp);
-ISC_TASKFUNC_SCOPE void
+void
isc__task_setname(isc_task_t *task0, const char *name, void *tag);
-ISC_TASKFUNC_SCOPE const char *
+const char *
isc__task_getname(isc_task_t *task0);
-ISC_TASKFUNC_SCOPE void *
+void *
isc__task_gettag(isc_task_t *task0);
-ISC_TASKFUNC_SCOPE void
+void
isc__task_getcurrenttime(isc_task_t *task0, isc_stdtime_t *t);
-ISC_TASKFUNC_SCOPE isc_result_t
+isc_result_t
isc__taskmgr_create(isc_mem_t *mctx, unsigned int workers,
unsigned int default_quantum, isc_taskmgr_t **managerp);
-ISC_TASKFUNC_SCOPE void
+void
isc__taskmgr_destroy(isc_taskmgr_t **managerp);
-ISC_TASKFUNC_SCOPE void
-isc__taskmgr_setexcltask(isc_taskmgr_t *mgr0, isc_task_t *task0);
-ISC_TASKFUNC_SCOPE isc_result_t
-isc__taskmgr_excltask(isc_taskmgr_t *mgr0, isc_task_t **taskp);
-ISC_TASKFUNC_SCOPE isc_result_t
+void
+isc_taskmgr_setexcltask(isc_taskmgr_t *mgr0, isc_task_t *task0);
+isc_result_t
+isc_taskmgr_excltask(isc_taskmgr_t *mgr0, isc_task_t **taskp);
+isc_result_t
isc__task_beginexclusive(isc_task_t *task);
-ISC_TASKFUNC_SCOPE void
+void
isc__task_endexclusive(isc_task_t *task0);
-ISC_TASKFUNC_SCOPE void
+void
isc__task_setprivilege(isc_task_t *task0, isc_boolean_t priv);
-ISC_TASKFUNC_SCOPE isc_boolean_t
+isc_boolean_t
isc__task_privilege(isc_task_t *task0);
-ISC_TASKFUNC_SCOPE void
+void
isc__taskmgr_setmode(isc_taskmgr_t *manager0, isc_taskmgrmode_t mode);
-ISC_TASKFUNC_SCOPE isc_taskmgrmode_t
+isc_taskmgrmode_t
isc__taskmgr_mode(isc_taskmgr_t *manager0);
static inline isc_boolean_t
/*%
* The following are defined just for avoiding unused static functions.
*/
-#ifndef BIND9
void *purgeevent, *unsendrange, *getname, *gettag, *getcurrenttime;
-#endif
} taskmethods = {
{
isc__task_attach,
isc__task_endexclusive,
isc__task_setprivilege,
isc__task_privilege
- }
-#ifndef BIND9
- ,
- (void *)isc__task_purgeevent, (void *)isc__task_unsendrange,
- (void *)isc__task_getname, (void *)isc__task_gettag,
+ },
+ (void *)isc_task_purgeevent,
+ (void *)isc__task_unsendrange,
+ (void *)isc__task_getname,
+ (void *)isc__task_gettag,
(void *)isc__task_getcurrenttime
-#endif
};
static isc_taskmgrmethods_t taskmgrmethods = {
isc__taskmgr_setmode,
isc__taskmgr_mode,
isc__task_create,
- isc__taskmgr_setexcltask,
- isc__taskmgr_excltask
+ isc_taskmgr_setexcltask,
+ isc_taskmgr_excltask
};
/***
isc_mem_put(manager->mctx, task, sizeof(*task));
}
-ISC_TASKFUNC_SCOPE isc_result_t
+isc_result_t
isc__task_create(isc_taskmgr_t *manager0, unsigned int quantum,
isc_task_t **taskp)
{
return (ISC_R_SUCCESS);
}
-ISC_TASKFUNC_SCOPE void
+void
isc__task_attach(isc_task_t *source0, isc_task_t **targetp) {
isc__task_t *source = (isc__task_t *)source0;
return (ISC_FALSE);
}
-ISC_TASKFUNC_SCOPE void
+void
isc__task_detach(isc_task_t **taskp) {
isc__task_t *task;
isc_boolean_t was_idle;
return (was_idle);
}
-ISC_TASKFUNC_SCOPE void
+void
isc__task_send(isc_task_t *task0, isc_event_t **eventp) {
isc__task_t *task = (isc__task_t *)task0;
isc_boolean_t was_idle;
}
}
-ISC_TASKFUNC_SCOPE void
+void
isc__task_sendanddetach(isc_task_t **taskp, isc_event_t **eventp) {
isc_boolean_t idle1, idle2;
isc__task_t *task;
return (count);
}
-ISC_TASKFUNC_SCOPE unsigned int
+unsigned int
isc__task_purgerange(isc_task_t *task0, void *sender, isc_eventtype_t first,
isc_eventtype_t last, void *tag)
{
return (count);
}
-ISC_TASKFUNC_SCOPE unsigned int
+unsigned int
isc__task_purge(isc_task_t *task, void *sender, isc_eventtype_t type,
void *tag)
{
return (isc__task_purgerange(task, sender, type, type, tag));
}
-ISC_TASKFUNC_SCOPE isc_boolean_t
-isc__task_purgeevent(isc_task_t *task0, isc_event_t *event) {
+isc_boolean_t
+isc_task_purgeevent(isc_task_t *task0, isc_event_t *event) {
isc__task_t *task = (isc__task_t *)task0;
isc_event_t *curr_event, *next_event;
return (ISC_TRUE);
}
-ISC_TASKFUNC_SCOPE unsigned int
+unsigned int
isc__task_unsendrange(isc_task_t *task, void *sender, isc_eventtype_t first,
isc_eventtype_t last, void *tag,
isc_eventlist_t *events)
last, tag, events, ISC_FALSE));
}
-ISC_TASKFUNC_SCOPE unsigned int
+unsigned int
isc__task_unsend(isc_task_t *task, void *sender, isc_eventtype_t type,
void *tag, isc_eventlist_t *events)
{
type, tag, events, ISC_FALSE));
}
-ISC_TASKFUNC_SCOPE isc_result_t
+isc_result_t
isc__task_onshutdown(isc_task_t *task0, isc_taskaction_t action,
const void *arg)
{
return (result);
}
-ISC_TASKFUNC_SCOPE void
+void
isc__task_shutdown(isc_task_t *task0) {
isc__task_t *task = (isc__task_t *)task0;
isc_boolean_t was_idle;
task_ready(task);
}
-ISC_TASKFUNC_SCOPE void
+void
isc__task_destroy(isc_task_t **taskp) {
/*
isc_task_detach(taskp);
}
-ISC_TASKFUNC_SCOPE void
+void
isc__task_setname(isc_task_t *task0, const char *name, void *tag) {
isc__task_t *task = (isc__task_t *)task0;
UNLOCK(&task->lock);
}
-ISC_TASKFUNC_SCOPE const char *
+const char *
isc__task_getname(isc_task_t *task0) {
isc__task_t *task = (isc__task_t *)task0;
return (task->name);
}
-ISC_TASKFUNC_SCOPE void *
+void *
isc__task_gettag(isc_task_t *task0) {
isc__task_t *task = (isc__task_t *)task0;
return (task->tag);
}
-ISC_TASKFUNC_SCOPE void
+void
isc__task_getcurrenttime(isc_task_t *task0, isc_stdtime_t *t) {
isc__task_t *task = (isc__task_t *)task0;
#endif /* USE_SHARED_MANAGER */
}
-ISC_TASKFUNC_SCOPE isc_result_t
+isc_result_t
isc__taskmgr_create(isc_mem_t *mctx, unsigned int workers,
unsigned int default_quantum, isc_taskmgr_t **managerp)
{
return (result);
}
-ISC_TASKFUNC_SCOPE void
+void
isc__taskmgr_destroy(isc_taskmgr_t **managerp) {
isc__taskmgr_t *manager;
isc__task_t *task;
UNLOCK(&manager->lock);
while (isc__taskmgr_ready((isc_taskmgr_t *)manager))
(void)isc__taskmgr_dispatch((isc_taskmgr_t *)manager);
-#ifdef BIND9
if (!ISC_LIST_EMPTY(manager->tasks))
isc_mem_printallactive(stderr);
-#endif
INSIST(ISC_LIST_EMPTY(manager->tasks));
#ifdef USE_SHARED_MANAGER
taskmgr = NULL;
*managerp = NULL;
}
-ISC_TASKFUNC_SCOPE void
+void
isc__taskmgr_setmode(isc_taskmgr_t *manager0, isc_taskmgrmode_t mode) {
isc__taskmgr_t *manager = (isc__taskmgr_t *)manager0;
UNLOCK(&manager->lock);
}
-ISC_TASKFUNC_SCOPE isc_taskmgrmode_t
+isc_taskmgrmode_t
isc__taskmgr_mode(isc_taskmgr_t *manager0) {
isc__taskmgr_t *manager = (isc__taskmgr_t *)manager0;
isc_taskmgrmode_t mode;
}
#else
-ISC_TASKFUNC_SCOPE void
+void
isc__taskmgr_pause(isc_taskmgr_t *manager0) {
isc__taskmgr_t *manager = (isc__taskmgr_t *)manager0;
LOCK(&manager->lock);
UNLOCK(&manager->lock);
}
-ISC_TASKFUNC_SCOPE void
+void
isc__taskmgr_resume(isc_taskmgr_t *manager0) {
isc__taskmgr_t *manager = (isc__taskmgr_t *)manager0;
}
#endif /* USE_WORKER_THREADS */
-ISC_TASKFUNC_SCOPE void
-isc__taskmgr_setexcltask(isc_taskmgr_t *mgr0, isc_task_t *task0) {
+void
+isc_taskmgr_setexcltask(isc_taskmgr_t *mgr0, isc_task_t *task0) {
isc__taskmgr_t *mgr = (isc__taskmgr_t *) mgr0;
isc__task_t *task = (isc__task_t *) task0;
isc__task_attach(task0, (isc_task_t **) &mgr->excl);
}
-ISC_TASKFUNC_SCOPE isc_result_t
-isc__taskmgr_excltask(isc_taskmgr_t *mgr0, isc_task_t **taskp) {
+isc_result_t
+isc_taskmgr_excltask(isc_taskmgr_t *mgr0, isc_task_t **taskp) {
isc__taskmgr_t *mgr = (isc__taskmgr_t *) mgr0;
REQUIRE(VALID_MANAGER(mgr));
return (ISC_R_SUCCESS);
}
-ISC_TASKFUNC_SCOPE isc_result_t
+isc_result_t
isc__task_beginexclusive(isc_task_t *task0) {
#ifdef USE_WORKER_THREADS
isc__task_t *task = (isc__task_t *)task0;
return (ISC_R_SUCCESS);
}
-ISC_TASKFUNC_SCOPE void
+void
isc__task_endexclusive(isc_task_t *task0) {
#ifdef USE_WORKER_THREADS
isc__task_t *task = (isc__task_t *)task0;
#endif
}
-ISC_TASKFUNC_SCOPE void
+void
isc__task_setprivilege(isc_task_t *task0, isc_boolean_t priv) {
isc__task_t *task = (isc__task_t *)task0;
isc__taskmgr_t *manager = task->manager;
UNLOCK(&manager->lock);
}
-ISC_TASKFUNC_SCOPE isc_boolean_t
+isc_boolean_t
isc__task_privilege(isc_task_t *task0) {
isc__task_t *task = (isc__task_t *)task0;
isc_boolean_t priv;
return (priv);
}
-#ifdef USE_SOCKETIMPREGISTER
isc_result_t
isc__task_register() {
return (isc_task_register(isc__taskmgr_create));
}
-#endif
isc_boolean_t
isc_task_exiting(isc_task_t *t) {
}
-#ifdef BIND9
#ifdef HAVE_LIBXML2
#define TRY0(a) do { xmlrc = (a); if (xmlrc < 0) goto error; } while(0)
int
return (result);
}
#endif
-#endif /* BIND9 */
+
+
+static isc_mutex_t createlock;
+static isc_once_t once = ISC_ONCE_INIT;
+static isc_taskmgrcreatefunc_t taskmgr_createfunc = NULL;
+
+static void
+initialize(void) {
+ RUNTIME_CHECK(isc_mutex_init(&createlock) == ISC_R_SUCCESS);
+}
+
+isc_result_t
+isc_task_register(isc_taskmgrcreatefunc_t createfunc) {
+ isc_result_t result = ISC_R_SUCCESS;
+
+ RUNTIME_CHECK(isc_once_do(&once, initialize) == ISC_R_SUCCESS);
+
+ LOCK(&createlock);
+ if (taskmgr_createfunc == NULL)
+ taskmgr_createfunc = createfunc;
+ else
+ result = ISC_R_EXISTS;
+ UNLOCK(&createlock);
+
+ return (result);
+}
+
+isc_result_t
+isc_taskmgr_createinctx(isc_mem_t *mctx, isc_appctx_t *actx,
+ unsigned int workers, unsigned int default_quantum,
+ isc_taskmgr_t **managerp)
+{
+ isc_result_t result;
+
+ LOCK(&createlock);
+
+ REQUIRE(taskmgr_createfunc != NULL);
+ result = (*taskmgr_createfunc)(mctx, workers, default_quantum,
+ managerp);
+
+ UNLOCK(&createlock);
+
+ if (result == ISC_R_SUCCESS)
+ isc_appctx_settaskmgr(actx, *managerp);
+
+ return (result);
+}
+
+isc_result_t
+isc_taskmgr_create(isc_mem_t *mctx, unsigned int workers,
+ unsigned int default_quantum, isc_taskmgr_t **managerp)
+{
+ isc_result_t result;
+
+ if (isc_bind9)
+ return (isc__taskmgr_create(mctx, workers,
+ default_quantum, managerp));
+ LOCK(&createlock);
+
+ REQUIRE(taskmgr_createfunc != NULL);
+ result = (*taskmgr_createfunc)(mctx, workers, default_quantum,
+ managerp);
+
+ UNLOCK(&createlock);
+
+ return (result);
+}
+
+void
+isc_taskmgr_destroy(isc_taskmgr_t **managerp) {
+ REQUIRE(managerp != NULL && ISCAPI_TASKMGR_VALID(*managerp));
+
+ if (isc_bind9)
+ isc__taskmgr_destroy(managerp);
+ else
+ (*managerp)->methods->destroy(managerp);
+
+ ENSURE(*managerp == NULL);
+}
+
+void
+isc_taskmgr_setmode(isc_taskmgr_t *manager, isc_taskmgrmode_t mode) {
+ REQUIRE(ISCAPI_TASKMGR_VALID(manager));
+
+ if (isc_bind9)
+ isc__taskmgr_setmode(manager, mode);
+ else
+ manager->methods->setmode(manager, mode);
+}
+
+isc_taskmgrmode_t
+isc_taskmgr_mode(isc_taskmgr_t *manager) {
+ REQUIRE(ISCAPI_TASKMGR_VALID(manager));
+
+ if (isc_bind9)
+ return (isc__taskmgr_mode(manager));
+
+ return (manager->methods->mode(manager));
+}
+
+isc_result_t
+isc_task_create(isc_taskmgr_t *manager, unsigned int quantum,
+ isc_task_t **taskp)
+{
+ REQUIRE(ISCAPI_TASKMGR_VALID(manager));
+ REQUIRE(taskp != NULL && *taskp == NULL);
+
+ if (isc_bind9)
+ return (isc__task_create(manager, quantum, taskp));
+
+ return (manager->methods->taskcreate(manager, quantum, taskp));
+}
+
+void
+isc_task_attach(isc_task_t *source, isc_task_t **targetp) {
+ REQUIRE(ISCAPI_TASK_VALID(source));
+ REQUIRE(targetp != NULL && *targetp == NULL);
+
+ if (isc_bind9)
+ isc__task_attach(source, targetp);
+ else
+ source->methods->attach(source, targetp);
+
+ ENSURE(*targetp == source);
+}
+
+void
+isc_task_detach(isc_task_t **taskp) {
+ REQUIRE(taskp != NULL && ISCAPI_TASK_VALID(*taskp));
+
+ if (isc_bind9)
+ isc__task_detach(taskp);
+ else
+ (*taskp)->methods->detach(taskp);
+
+ ENSURE(*taskp == NULL);
+}
+
+void
+isc_task_send(isc_task_t *task, isc_event_t **eventp) {
+ REQUIRE(ISCAPI_TASK_VALID(task));
+ REQUIRE(eventp != NULL && *eventp != NULL);
+
+ if (isc_bind9)
+ isc__task_send(task, eventp);
+ else {
+ task->methods->send(task, eventp);
+ ENSURE(*eventp == NULL);
+ }
+}
+
+void
+isc_task_sendanddetach(isc_task_t **taskp, isc_event_t **eventp) {
+ REQUIRE(taskp != NULL && ISCAPI_TASK_VALID(*taskp));
+ REQUIRE(eventp != NULL && *eventp != NULL);
+
+ if (isc_bind9)
+ isc__task_sendanddetach(taskp, eventp);
+ else {
+ (*taskp)->methods->sendanddetach(taskp, eventp);
+ ENSURE(*eventp == NULL);
+ }
+
+ ENSURE(*taskp == NULL);
+}
+
+unsigned int
+isc_task_unsend(isc_task_t *task, void *sender, isc_eventtype_t type,
+ void *tag, isc_eventlist_t *events)
+{
+ REQUIRE(ISCAPI_TASK_VALID(task));
+
+ if (isc_bind9)
+ return (isc__task_unsend(task, sender, type, tag, events));
+
+ return (task->methods->unsend(task, sender, type, tag, events));
+}
+
+isc_result_t
+isc_task_onshutdown(isc_task_t *task, isc_taskaction_t action, const void *arg)
+{
+ REQUIRE(ISCAPI_TASK_VALID(task));
+
+ if (isc_bind9)
+ return (isc__task_onshutdown(task, action, arg));
+
+ return (task->methods->onshutdown(task, action, arg));
+}
+
+void
+isc_task_shutdown(isc_task_t *task) {
+ REQUIRE(ISCAPI_TASK_VALID(task));
+
+ if (isc_bind9)
+ isc__task_shutdown(task);
+ else
+ task->methods->shutdown(task);
+}
+
+void
+isc_task_destroy(isc_task_t **taskp) {
+ if (!isc_bind9)
+ return;
+
+ isc__task_destroy(taskp);
+}
+
+void
+isc_task_setname(isc_task_t *task, const char *name, void *tag) {
+ REQUIRE(ISCAPI_TASK_VALID(task));
+
+ if (isc_bind9)
+ isc__task_setname(task, name, tag);
+ else
+ task->methods->setname(task, name, tag);
+}
+
+unsigned int
+isc_task_purge(isc_task_t *task, void *sender, isc_eventtype_t type, void *tag)
+{
+ REQUIRE(ISCAPI_TASK_VALID(task));
+
+ if (isc_bind9)
+ return (isc__task_purge(task, sender, type, tag));
+
+ return (task->methods->purgeevents(task, sender, type, tag));
+}
+
+isc_result_t
+isc_task_beginexclusive(isc_task_t *task) {
+ REQUIRE(ISCAPI_TASK_VALID(task));
+
+ if (isc_bind9)
+ return (isc__task_beginexclusive(task));
+
+ return (task->methods->beginexclusive(task));
+}
+
+void
+isc_task_endexclusive(isc_task_t *task) {
+ REQUIRE(ISCAPI_TASK_VALID(task));
+
+ if (isc_bind9)
+ isc__task_endexclusive(task);
+ else
+ task->methods->endexclusive(task);
+}
+
+void
+isc_task_setprivilege(isc_task_t *task, isc_boolean_t priv) {
+ REQUIRE(ISCAPI_TASK_VALID(task));
+
+ if (isc_bind9)
+ isc__task_setprivilege(task, priv);
+ else
+ task->methods->setprivilege(task, priv);
+}
+
+isc_boolean_t
+isc_task_privilege(isc_task_t *task) {
+ REQUIRE(ISCAPI_TASK_VALID(task));
+
+ if (isc_bind9)
+ return (isc__task_privilege(task));
+
+ return (task->methods->privilege(task));
+}
+
+void
+isc_task_getcurrenttime(isc_task_t *task, isc_stdtime_t *t) {
+ if (!isc_bind9)
+ return;
+
+ isc__task_getcurrenttime(task, t);
+}
+
+/*%
+ * This is necessary for libisc's internal timer implementation. Other
+ * implementation might skip implementing this.
+ */
+unsigned int
+isc_task_purgerange(isc_task_t *task, void *sender, isc_eventtype_t first,
+ isc_eventtype_t last, void *tag)
+{
+ REQUIRE(ISCAPI_TASK_VALID(task));
+
+ if (isc_bind9)
+ return (isc__task_purgerange(task, sender, first, last, tag));
+
+ return (task->methods->purgerange(task, sender, first, last, tag));
+}
+++ /dev/null
-/*
- * Copyright (C) 2009-2012 Internet Systems Consortium, Inc. ("ISC")
- *
- * Permission to use, copy, modify, and/or distribute this software for any
- * purpose with or without fee is hereby granted, provided that the above
- * copyright notice and this permission notice appear in all copies.
- *
- * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
- * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
- * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
- * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
- * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
- * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
- * PERFORMANCE OF THIS SOFTWARE.
- */
-
-/* $Id$ */
-
-#include <config.h>
-
-#include <unistd.h>
-
-#include <isc/app.h>
-#include <isc/magic.h>
-#include <isc/mutex.h>
-#include <isc/once.h>
-#include <isc/task.h>
-#include <isc/util.h>
-
-static isc_mutex_t createlock;
-static isc_once_t once = ISC_ONCE_INIT;
-static isc_taskmgrcreatefunc_t taskmgr_createfunc = NULL;
-
-static void
-initialize(void) {
- RUNTIME_CHECK(isc_mutex_init(&createlock) == ISC_R_SUCCESS);
-}
-
-isc_result_t
-isc_task_register(isc_taskmgrcreatefunc_t createfunc) {
- isc_result_t result = ISC_R_SUCCESS;
-
- RUNTIME_CHECK(isc_once_do(&once, initialize) == ISC_R_SUCCESS);
-
- LOCK(&createlock);
- if (taskmgr_createfunc == NULL)
- taskmgr_createfunc = createfunc;
- else
- result = ISC_R_EXISTS;
- UNLOCK(&createlock);
-
- return (result);
-}
-
-isc_result_t
-isc_taskmgr_createinctx(isc_mem_t *mctx, isc_appctx_t *actx,
- unsigned int workers, unsigned int default_quantum,
- isc_taskmgr_t **managerp)
-{
- isc_result_t result;
-
- LOCK(&createlock);
-
- REQUIRE(taskmgr_createfunc != NULL);
- result = (*taskmgr_createfunc)(mctx, workers, default_quantum,
- managerp);
-
- UNLOCK(&createlock);
-
- if (result == ISC_R_SUCCESS)
- isc_appctx_settaskmgr(actx, *managerp);
-
- return (result);
-}
-
-isc_result_t
-isc_taskmgr_create(isc_mem_t *mctx, unsigned int workers,
- unsigned int default_quantum, isc_taskmgr_t **managerp)
-{
- isc_result_t result;
-
- LOCK(&createlock);
-
- REQUIRE(taskmgr_createfunc != NULL);
- result = (*taskmgr_createfunc)(mctx, workers, default_quantum,
- managerp);
-
- UNLOCK(&createlock);
-
- return (result);
-}
-
-void
-isc_taskmgr_destroy(isc_taskmgr_t **managerp) {
- REQUIRE(managerp != NULL && ISCAPI_TASKMGR_VALID(*managerp));
-
- (*managerp)->methods->destroy(managerp);
-
- ENSURE(*managerp == NULL);
-}
-
-void
-isc_taskmgr_setmode(isc_taskmgr_t *manager, isc_taskmgrmode_t mode) {
- REQUIRE(ISCAPI_TASKMGR_VALID(manager));
-
- manager->methods->setmode(manager, mode);
-}
-
-isc_taskmgrmode_t
-isc_taskmgr_mode(isc_taskmgr_t *manager) {
- REQUIRE(ISCAPI_TASKMGR_VALID(manager));
-
- return (manager->methods->mode(manager));
-}
-
-isc_result_t
-isc_task_create(isc_taskmgr_t *manager, unsigned int quantum,
- isc_task_t **taskp)
-{
- REQUIRE(ISCAPI_TASKMGR_VALID(manager));
- REQUIRE(taskp != NULL && *taskp == NULL);
-
- return (manager->methods->taskcreate(manager, quantum, taskp));
-}
-
-void
-isc_task_attach(isc_task_t *source, isc_task_t **targetp) {
- REQUIRE(ISCAPI_TASK_VALID(source));
- REQUIRE(targetp != NULL && *targetp == NULL);
-
- source->methods->attach(source, targetp);
-
- ENSURE(*targetp == source);
-}
-
-void
-isc_task_detach(isc_task_t **taskp) {
- REQUIRE(taskp != NULL && ISCAPI_TASK_VALID(*taskp));
-
- (*taskp)->methods->detach(taskp);
-
- ENSURE(*taskp == NULL);
-}
-
-void
-isc_task_send(isc_task_t *task, isc_event_t **eventp) {
- REQUIRE(ISCAPI_TASK_VALID(task));
- REQUIRE(eventp != NULL && *eventp != NULL);
-
- task->methods->send(task, eventp);
-
- ENSURE(*eventp == NULL);
-}
-
-void
-isc_task_sendanddetach(isc_task_t **taskp, isc_event_t **eventp) {
- REQUIRE(taskp != NULL && ISCAPI_TASK_VALID(*taskp));
- REQUIRE(eventp != NULL && *eventp != NULL);
-
- (*taskp)->methods->sendanddetach(taskp, eventp);
-
- ENSURE(*taskp == NULL && *eventp == NULL);
-}
-
-unsigned int
-isc_task_unsend(isc_task_t *task, void *sender, isc_eventtype_t type,
- void *tag, isc_eventlist_t *events)
-{
- REQUIRE(ISCAPI_TASK_VALID(task));
-
- return (task->methods->unsend(task, sender, type, tag, events));
-}
-
-isc_result_t
-isc_task_onshutdown(isc_task_t *task, isc_taskaction_t action, const void *arg)
-{
- REQUIRE(ISCAPI_TASK_VALID(task));
-
- return (task->methods->onshutdown(task, action, arg));
-}
-
-void
-isc_task_shutdown(isc_task_t *task) {
- REQUIRE(ISCAPI_TASK_VALID(task));
-
- task->methods->shutdown(task);
-}
-
-void
-isc_task_setname(isc_task_t *task, const char *name, void *tag) {
- REQUIRE(ISCAPI_TASK_VALID(task));
-
- task->methods->setname(task, name, tag);
-}
-
-unsigned int
-isc_task_purge(isc_task_t *task, void *sender, isc_eventtype_t type, void *tag)
-{
- REQUIRE(ISCAPI_TASK_VALID(task));
-
- return (task->methods->purgeevents(task, sender, type, tag));
-}
-
-void
-isc_taskmgr_setexcltask(isc_taskmgr_t *mgr, isc_task_t *task) {
- REQUIRE(ISCAPI_TASK_VALID(task));
- return (mgr->methods->setexcltask(mgr, task));
-}
-
-isc_result_t
-isc_taskmgr_excltask(isc_taskmgr_t *mgr, isc_task_t **taskp) {
- return (mgr->methods->excltask(mgr, taskp));
-}
-
-isc_result_t
-isc_task_beginexclusive(isc_task_t *task) {
- REQUIRE(ISCAPI_TASK_VALID(task));
-
- return (task->methods->beginexclusive(task));
-}
-
-void
-isc_task_endexclusive(isc_task_t *task) {
- REQUIRE(ISCAPI_TASK_VALID(task));
-
- task->methods->endexclusive(task);
-}
-
-void
-isc_task_setprivilege(isc_task_t *task, isc_boolean_t priv) {
- REQUIRE(ISCAPI_TASK_VALID(task));
-
- task->methods->setprivilege(task, priv);
-}
-
-isc_boolean_t
-isc_task_privilege(isc_task_t *task) {
- REQUIRE(ISCAPI_TASK_VALID(task));
-
- return (task->methods->privilege(task));
-}
-
-
-/*%
- * This is necessary for libisc's internal timer implementation. Other
- * implementation might skip implementing this.
- */
-unsigned int
-isc_task_purgerange(isc_task_t *task, void *sender, isc_eventtype_t first,
- isc_eventtype_t last, void *tag)
-{
- REQUIRE(ISCAPI_TASK_VALID(task));
-
- return (task->methods->purgerange(task, sender, first, last, tag));
-}
/*! \file */
-#if defined(BIND9) && defined(ISC_PLATFORM_USETHREADS)
+#if defined(ISC_PLATFORM_USETHREADS)
void
isc__taskmgr_pause(isc_taskmgr_t *taskmgr);
isc_result_t
isc__taskmgr_dispatch(isc_taskmgr_t *taskmgr);
-#endif /* !BIND9 || !ISC_PLATFORM_USETHREADS */
+#endif /* !ISC_PLATFORM_USETHREADS */
#endif /* ISC_TASK_P_H */
#include <config.h>
+#include <isc/app.h>
#include <isc/condition.h>
#include <isc/heap.h>
#include <isc/log.h>
#include <isc/magic.h>
#include <isc/mem.h>
#include <isc/msgs.h>
+#include <isc/once.h>
#include <isc/platform.h>
#include <isc/task.h>
#include <isc/thread.h>
#endif
/* See task.c about the following definition: */
-#ifdef BIND9
#ifdef ISC_PLATFORM_USETHREADS
#define USE_TIMER_THREAD
#else
#define USE_SHARED_MANAGER
#endif /* ISC_PLATFORM_USETHREADS */
-#endif /* BIND9 */
#ifndef USE_TIMER_THREAD
#include "timer_p.h"
};
/*%
- * The followings can be either static or public, depending on build
- * environment.
+ * The following are intended for internal use (indicated by "isc__"
+ * prefix) but are not declared as static, allowing direct access from
+ * unit tests etc.
*/
-#ifdef BIND9
-#define ISC_TIMERFUNC_SCOPE
-#else
-#define ISC_TIMERFUNC_SCOPE static
-#endif
-
-ISC_TIMERFUNC_SCOPE isc_result_t
+isc_result_t
isc__timer_create(isc_timermgr_t *manager, isc_timertype_t type,
const isc_time_t *expires, const isc_interval_t *interval,
isc_task_t *task, isc_taskaction_t action, const void *arg,
isc_timer_t **timerp);
-ISC_TIMERFUNC_SCOPE isc_result_t
+isc_result_t
isc__timer_reset(isc_timer_t *timer, isc_timertype_t type,
- const isc_time_t *expires, const isc_interval_t *interval,
+ const isc_time_t *expires, const isc_interval_t *interval,
isc_boolean_t purge);
-ISC_TIMERFUNC_SCOPE isc_timertype_t
-isc__timer_gettype(isc_timer_t *timer);
-ISC_TIMERFUNC_SCOPE isc_result_t
+isc_timertype_t
+isc_timer_gettype(isc_timer_t *timer);
+isc_result_t
isc__timer_touch(isc_timer_t *timer);
-ISC_TIMERFUNC_SCOPE void
+void
isc__timer_attach(isc_timer_t *timer0, isc_timer_t **timerp);
-ISC_TIMERFUNC_SCOPE void
+void
isc__timer_detach(isc_timer_t **timerp);
-ISC_TIMERFUNC_SCOPE isc_result_t
+isc_result_t
isc__timermgr_create(isc_mem_t *mctx, isc_timermgr_t **managerp);
-ISC_TIMERFUNC_SCOPE void
-isc__timermgr_poke(isc_timermgr_t *manager0);
-ISC_TIMERFUNC_SCOPE void
+void
+isc_timermgr_poke(isc_timermgr_t *manager0);
+void
isc__timermgr_destroy(isc_timermgr_t **managerp);
static struct isc__timermethods {
/*%
* The following are defined just for avoiding unused static functions.
*/
-#ifndef BIND9
void *gettype;
-#endif
} timermethods = {
{
isc__timer_attach,
isc__timer_detach,
isc__timer_reset,
isc__timer_touch
- }
-#ifndef BIND9
- ,
- (void *)isc__timer_gettype
-#endif
+ },
+ (void *)isc_timer_gettype
};
static struct isc__timermgrmethods {
isc_timermgrmethods_t methods;
-#ifndef BIND9
void *poke; /* see above */
-#endif
} timermgrmethods = {
{
isc__timermgr_destroy,
isc__timer_create
- }
-#ifndef BIND9
- ,
- (void *)isc__timermgr_poke
-#endif
+ },
+ (void *)isc_timermgr_poke
};
#ifdef USE_SHARED_MANAGER
isc_mem_put(manager->mctx, timer, sizeof(*timer));
}
-ISC_TIMERFUNC_SCOPE isc_result_t
+isc_result_t
isc__timer_create(isc_timermgr_t *manager0, isc_timertype_t type,
const isc_time_t *expires, const isc_interval_t *interval,
isc_task_t *task, isc_taskaction_t action, const void *arg,
return (ISC_R_SUCCESS);
}
-ISC_TIMERFUNC_SCOPE isc_result_t
+isc_result_t
isc__timer_reset(isc_timer_t *timer0, isc_timertype_t type,
const isc_time_t *expires, const isc_interval_t *interval,
isc_boolean_t purge)
return (result);
}
-ISC_TIMERFUNC_SCOPE isc_timertype_t
-isc__timer_gettype(isc_timer_t *timer0) {
+isc_timertype_t
+isc_timer_gettype(isc_timer_t *timer0) {
isc__timer_t *timer = (isc__timer_t *)timer0;
isc_timertype_t t;
return (t);
}
-ISC_TIMERFUNC_SCOPE isc_result_t
+isc_result_t
isc__timer_touch(isc_timer_t *timer0) {
isc__timer_t *timer = (isc__timer_t *)timer0;
isc_result_t result;
return (result);
}
-ISC_TIMERFUNC_SCOPE void
+void
isc__timer_attach(isc_timer_t *timer0, isc_timer_t **timerp) {
isc__timer_t *timer = (isc__timer_t *)timer0;
*timerp = (isc_timer_t *)timer;
}
-ISC_TIMERFUNC_SCOPE void
+void
isc__timer_detach(isc_timer_t **timerp) {
isc__timer_t *timer;
isc_boolean_t free_timer = ISC_FALSE;
timer->index = index;
}
-ISC_TIMERFUNC_SCOPE isc_result_t
+isc_result_t
isc__timermgr_create(isc_mem_t *mctx, isc_timermgr_t **managerp) {
isc__timermgr_t *manager;
isc_result_t result;
return (ISC_R_SUCCESS);
}
-ISC_TIMERFUNC_SCOPE void
-isc__timermgr_poke(isc_timermgr_t *manager0) {
+void
+isc_timermgr_poke(isc_timermgr_t *manager0) {
#ifdef USE_TIMER_THREAD
isc__timermgr_t *manager = (isc__timermgr_t *)manager0;
#endif
}
-ISC_TIMERFUNC_SCOPE void
+void
isc__timermgr_destroy(isc_timermgr_t **managerp) {
isc__timermgr_t *manager;
isc_mem_t *mctx;
}
#endif /* USE_TIMER_THREAD */
-#ifdef USE_TIMERIMPREGISTER
isc_result_t
isc__timer_register() {
return (isc_timer_register(isc__timermgr_create));
}
-#endif
+
+static isc_mutex_t createlock;
+static isc_once_t once = ISC_ONCE_INIT;
+static isc_timermgrcreatefunc_t timermgr_createfunc = NULL;
+
+static void
+initialize(void) {
+ RUNTIME_CHECK(isc_mutex_init(&createlock) == ISC_R_SUCCESS);
+}
+
+isc_result_t
+isc_timer_register(isc_timermgrcreatefunc_t createfunc) {
+ isc_result_t result = ISC_R_SUCCESS;
+
+ RUNTIME_CHECK(isc_once_do(&once, initialize) == ISC_R_SUCCESS);
+
+ LOCK(&createlock);
+ if (timermgr_createfunc == NULL)
+ timermgr_createfunc = createfunc;
+ else
+ result = ISC_R_EXISTS;
+ UNLOCK(&createlock);
+
+ return (result);
+}
+
+isc_result_t
+isc_timermgr_createinctx(isc_mem_t *mctx, isc_appctx_t *actx,
+ isc_timermgr_t **managerp)
+{
+ isc_result_t result;
+
+ LOCK(&createlock);
+
+ REQUIRE(timermgr_createfunc != NULL);
+ result = (*timermgr_createfunc)(mctx, managerp);
+
+ UNLOCK(&createlock);
+
+ if (result == ISC_R_SUCCESS)
+ isc_appctx_settimermgr(actx, *managerp);
+
+ return (result);
+}
+
+isc_result_t
+isc_timermgr_create(isc_mem_t *mctx, isc_timermgr_t **managerp) {
+ isc_result_t result;
+
+ if (isc_bind9)
+ return (isc__timermgr_create(mctx, managerp));
+
+ LOCK(&createlock);
+
+ REQUIRE(timermgr_createfunc != NULL);
+ result = (*timermgr_createfunc)(mctx, managerp);
+
+ UNLOCK(&createlock);
+
+ return (result);
+}
+
+void
+isc_timermgr_destroy(isc_timermgr_t **managerp) {
+ REQUIRE(*managerp != NULL && ISCAPI_TIMERMGR_VALID(*managerp));
+
+ if (isc_bind9)
+ isc__timermgr_destroy(managerp);
+ else
+ (*managerp)->methods->destroy(managerp);
+
+ ENSURE(*managerp == NULL);
+}
+
+isc_result_t
+isc_timer_create(isc_timermgr_t *manager, isc_timertype_t type,
+ const isc_time_t *expires, const isc_interval_t *interval,
+ isc_task_t *task, isc_taskaction_t action, const void *arg,
+ isc_timer_t **timerp)
+{
+ REQUIRE(ISCAPI_TIMERMGR_VALID(manager));
+
+ if (isc_bind9)
+ return (isc__timer_create(manager, type, expires, interval,
+ task, action, arg, timerp));
+
+ return (manager->methods->timercreate(manager, type, expires,
+ interval, task, action, arg,
+ timerp));
+}
+
+void
+isc_timer_attach(isc_timer_t *timer, isc_timer_t **timerp) {
+ REQUIRE(ISCAPI_TIMER_VALID(timer));
+ REQUIRE(timerp != NULL && *timerp == NULL);
+
+ if (isc_bind9)
+ isc__timer_attach(timer, timerp);
+ else
+ timer->methods->attach(timer, timerp);
+
+ ENSURE(*timerp == timer);
+}
+
+void
+isc_timer_detach(isc_timer_t **timerp) {
+ REQUIRE(timerp != NULL && ISCAPI_TIMER_VALID(*timerp));
+
+ if (isc_bind9)
+ isc__timer_detach(timerp);
+ else
+ (*timerp)->methods->detach(timerp);
+
+ ENSURE(*timerp == NULL);
+}
+
+isc_result_t
+isc_timer_reset(isc_timer_t *timer, isc_timertype_t type,
+ const isc_time_t *expires, const isc_interval_t *interval,
+ isc_boolean_t purge)
+{
+ REQUIRE(ISCAPI_TIMER_VALID(timer));
+
+ if (isc_bind9)
+ return (isc__timer_reset(timer, type, expires,
+ interval, purge));
+
+ return (timer->methods->reset(timer, type, expires, interval, purge));
+}
+
+isc_result_t
+isc_timer_touch(isc_timer_t *timer) {
+ REQUIRE(ISCAPI_TIMER_VALID(timer));
+
+ if (isc_bind9)
+ return (isc__timer_touch(timer));
+
+ return (timer->methods->touch(timer));
+}
+++ /dev/null
-/*
- * Copyright (C) 2009, 2012 Internet Systems Consortium, Inc. ("ISC")
- *
- * Permission to use, copy, modify, and/or distribute this software for any
- * purpose with or without fee is hereby granted, provided that the above
- * copyright notice and this permission notice appear in all copies.
- *
- * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
- * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
- * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
- * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
- * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
- * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
- * PERFORMANCE OF THIS SOFTWARE.
- */
-
-/* $Id: timer_api.c,v 1.4 2009/09/02 23:48:02 tbox Exp $ */
-
-#include <config.h>
-
-#include <unistd.h>
-
-#include <isc/app.h>
-#include <isc/magic.h>
-#include <isc/mutex.h>
-#include <isc/once.h>
-#include <isc/timer.h>
-#include <isc/util.h>
-
-static isc_mutex_t createlock;
-static isc_once_t once = ISC_ONCE_INIT;
-static isc_timermgrcreatefunc_t timermgr_createfunc = NULL;
-
-static void
-initialize(void) {
- RUNTIME_CHECK(isc_mutex_init(&createlock) == ISC_R_SUCCESS);
-}
-
-isc_result_t
-isc_timer_register(isc_timermgrcreatefunc_t createfunc) {
- isc_result_t result = ISC_R_SUCCESS;
-
- RUNTIME_CHECK(isc_once_do(&once, initialize) == ISC_R_SUCCESS);
-
- LOCK(&createlock);
- if (timermgr_createfunc == NULL)
- timermgr_createfunc = createfunc;
- else
- result = ISC_R_EXISTS;
- UNLOCK(&createlock);
-
- return (result);
-}
-
-isc_result_t
-isc_timermgr_createinctx(isc_mem_t *mctx, isc_appctx_t *actx,
- isc_timermgr_t **managerp)
-{
- isc_result_t result;
-
- LOCK(&createlock);
-
- REQUIRE(timermgr_createfunc != NULL);
- result = (*timermgr_createfunc)(mctx, managerp);
-
- UNLOCK(&createlock);
-
- if (result == ISC_R_SUCCESS)
- isc_appctx_settimermgr(actx, *managerp);
-
- return (result);
-}
-
-isc_result_t
-isc_timermgr_create(isc_mem_t *mctx, isc_timermgr_t **managerp) {
- isc_result_t result;
-
- LOCK(&createlock);
-
- REQUIRE(timermgr_createfunc != NULL);
- result = (*timermgr_createfunc)(mctx, managerp);
-
- UNLOCK(&createlock);
-
- return (result);
-}
-
-void
-isc_timermgr_destroy(isc_timermgr_t **managerp) {
- REQUIRE(*managerp != NULL && ISCAPI_TIMERMGR_VALID(*managerp));
-
- (*managerp)->methods->destroy(managerp);
-
- ENSURE(*managerp == NULL);
-}
-
-isc_result_t
-isc_timer_create(isc_timermgr_t *manager, isc_timertype_t type,
- const isc_time_t *expires, const isc_interval_t *interval,
- isc_task_t *task, isc_taskaction_t action, const void *arg,
- isc_timer_t **timerp)
-{
- REQUIRE(ISCAPI_TIMERMGR_VALID(manager));
-
- return (manager->methods->timercreate(manager, type, expires,
- interval, task, action, arg,
- timerp));
-}
-
-void
-isc_timer_attach(isc_timer_t *timer, isc_timer_t **timerp) {
- REQUIRE(ISCAPI_TIMER_VALID(timer));
- REQUIRE(timerp != NULL && *timerp == NULL);
-
- timer->methods->attach(timer, timerp);
-
- ENSURE(*timerp == timer);
-}
-
-void
-isc_timer_detach(isc_timer_t **timerp) {
- REQUIRE(timerp != NULL && ISCAPI_TIMER_VALID(*timerp));
-
- (*timerp)->methods->detach(timerp);
-
- ENSURE(*timerp == NULL);
-}
-
-isc_result_t
-isc_timer_reset(isc_timer_t *timer, isc_timertype_t type,
- const isc_time_t *expires, const isc_interval_t *interval,
- isc_boolean_t purge)
-{
- REQUIRE(ISCAPI_TIMER_VALID(timer));
-
- return (timer->methods->reset(timer, type, expires, interval, purge));
-}
-
-isc_result_t
-isc_timer_touch(isc_timer_t *timer) {
- REQUIRE(ISCAPI_TIMER_VALID(timer));
-
- return (timer->methods->touch(timer));
-}
#include <isc/time.h>
#include <isc/util.h>
+#ifdef ISC_PLATFORM_USETHREADS
+#include <pthread.h>
+#endif
+
/*%
* For BIND9 internal applications built with threads, we use a single app
* context and let multiple worker, I/O, timer threads do actual jobs.
* For other cases (including BIND9 built without threads) an app context acts
* as an event loop dispatching various events.
*/
-#if defined(ISC_PLATFORM_USETHREADS) && defined(BIND9)
-#define USE_THREADS_SINGLECTX
-#endif
-
-#ifdef ISC_PLATFORM_USETHREADS
-#include <pthread.h>
-#endif
-
-#ifndef USE_THREADS_SINGLECTX
+#ifndef ISC_PLATFORM_USETHREADS
#include "../timer_p.h"
#include "../task_p.h"
#include "socket_p.h"
-#endif /* USE_THREADS_SINGLECTX */
+#endif /* ISC_PLATFORM_USETHREADS */
#ifdef ISC_PLATFORM_USETHREADS
static pthread_t blockedthread;
#endif /* ISC_PLATFORM_USETHREADS */
/*%
- * The following can be either static or public, depending on build environment.
+ * The following are intended for internal use (indicated by "isc__"
+ * prefix) but are not declared as static, allowing direct access from
+ * unit tests etc.
*/
-
-#ifdef BIND9
-#define ISC_APPFUNC_SCOPE
-#else
-#define ISC_APPFUNC_SCOPE static
-#endif
-
-ISC_APPFUNC_SCOPE isc_result_t isc__app_start(void);
-ISC_APPFUNC_SCOPE isc_result_t isc__app_ctxstart(isc_appctx_t *ctx);
-ISC_APPFUNC_SCOPE isc_result_t isc__app_onrun(isc_mem_t *mctx,
- isc_task_t *task,
- isc_taskaction_t action,
- void *arg);
-ISC_APPFUNC_SCOPE isc_result_t isc__app_ctxrun(isc_appctx_t *ctx);
-ISC_APPFUNC_SCOPE isc_result_t isc__app_run(void);
-ISC_APPFUNC_SCOPE isc_result_t isc__app_ctxshutdown(isc_appctx_t *ctx);
-ISC_APPFUNC_SCOPE isc_result_t isc__app_shutdown(void);
-ISC_APPFUNC_SCOPE isc_result_t isc__app_reload(void);
-ISC_APPFUNC_SCOPE isc_result_t isc__app_ctxsuspend(isc_appctx_t *ctx);
-ISC_APPFUNC_SCOPE void isc__app_ctxfinish(isc_appctx_t *ctx);
-ISC_APPFUNC_SCOPE void isc__app_finish(void);
-ISC_APPFUNC_SCOPE void isc__app_block(void);
-ISC_APPFUNC_SCOPE void isc__app_unblock(void);
-ISC_APPFUNC_SCOPE isc_result_t isc__appctx_create(isc_mem_t *mctx,
- isc_appctx_t **ctxp);
-ISC_APPFUNC_SCOPE void isc__appctx_destroy(isc_appctx_t **ctxp);
-ISC_APPFUNC_SCOPE void isc__appctx_settaskmgr(isc_appctx_t *ctx,
- isc_taskmgr_t *taskmgr);
-ISC_APPFUNC_SCOPE void isc__appctx_setsocketmgr(isc_appctx_t *ctx,
- isc_socketmgr_t *socketmgr);
-ISC_APPFUNC_SCOPE void isc__appctx_settimermgr(isc_appctx_t *ctx,
- isc_timermgr_t *timermgr);
+isc_result_t isc__app_start(void);
+isc_result_t isc__app_ctxstart(isc_appctx_t *ctx);
+isc_result_t isc__app_onrun(isc_mem_t *mctx, isc_task_t *task,
+ isc_taskaction_t action, void *arg);
+isc_result_t isc__app_ctxrun(isc_appctx_t *ctx);
+isc_result_t isc__app_run(void);
+isc_result_t isc__app_ctxshutdown(isc_appctx_t *ctx);
+isc_result_t isc__app_shutdown(void);
+isc_result_t isc__app_reload(void);
+isc_result_t isc__app_ctxsuspend(isc_appctx_t *ctx);
+void isc__app_ctxfinish(isc_appctx_t *ctx);
+void isc__app_finish(void);
+void isc__app_block(void);
+void isc__app_unblock(void);
+isc_result_t isc__appctx_create(isc_mem_t *mctx, isc_appctx_t **ctxp);
+void isc__appctx_destroy(isc_appctx_t **ctxp);
+void isc__appctx_settaskmgr(isc_appctx_t *ctx, isc_taskmgr_t *taskmgr);
+void isc__appctx_setsocketmgr(isc_appctx_t *ctx, isc_socketmgr_t *socketmgr);
+void isc__appctx_settimermgr(isc_appctx_t *ctx, isc_timermgr_t *timermgr);
/*
* The application context of this module. This implementation actually
isc_taskmgr_t *taskmgr;
isc_socketmgr_t *socketmgr;
isc_timermgr_t *timermgr;
+#ifdef ISC_PLATFORM_USETHREADS
+ isc_mutex_t readylock;
+ isc_condition_t ready;
+#endif /* ISC_PLATFORM_USETHREADS */
} isc__appctx_t;
static isc__appctx_t isc_g_appctx;
/*%
* The following are defined just for avoiding unused static functions.
*/
-#ifndef BIND9
void *run, *shutdown, *start, *onrun, *reload, *finish,
- *block, *unblock;
-#endif
+ *block, *unblock;
} appmethods = {
{
isc__appctx_destroy,
isc__appctx_settaskmgr,
isc__appctx_setsocketmgr,
isc__appctx_settimermgr
- }
-#ifndef BIND9
- ,
- (void *)isc__app_run, (void *)isc__app_shutdown,
- (void *)isc__app_start, (void *)isc__app_onrun, (void *)isc__app_reload,
- (void *)isc__app_finish, (void *)isc__app_block,
+ },
+ (void *)isc__app_run,
+ (void *)isc__app_shutdown,
+ (void *)isc__app_start,
+ (void *)isc__app_onrun,
+ (void *)isc__app_reload,
+ (void *)isc__app_finish,
+ (void *)isc__app_block,
(void *)isc__app_unblock
-#endif
};
#ifdef HAVE_LINUXTHREADS
isc_g_appctx.want_shutdown = ISC_TRUE;
}
+#ifdef ISC_PLATFORM_USETHREADS
static void
reload_action(int arg) {
UNUSED(arg);
isc_g_appctx.want_reload = ISC_TRUE;
}
#endif
+#endif
static isc_result_t
handle_signal(int sig, void (*handler)(int)) {
return (ISC_R_SUCCESS);
}
-ISC_APPFUNC_SCOPE isc_result_t
+isc_result_t
isc__app_ctxstart(isc_appctx_t *ctx0) {
isc__appctx_t *ctx = (isc__appctx_t *)ctx0;
isc_result_t result;
+ int presult;
+ sigset_t sset;
+ char strbuf[ISC_STRERRORSIZE];
+
REQUIRE(VALID_APPCTX(ctx));
}
#endif
+#ifdef ISC_PLATFORM_USETHREADS
#ifdef HAVE_LINUXTHREADS
main_thread = pthread_self();
-#endif
+#endif /* HAVE_LINUXTHREADS */
- result = isc_mutex_init(&ctx->lock);
+ result = isc_mutex_init(&ctx->readylock);
if (result != ISC_R_SUCCESS)
return (result);
+ result = isc_condition_init(&ctx->ready);
+ if (result != ISC_R_SUCCESS)
+ goto cleanup_rlock;
+
+ result = isc_mutex_init(&ctx->lock);
+ if (result != ISC_R_SUCCESS)
+ goto cleanup_rcond;
+#else
+ result = isc_mutex_init(&ctx->lock);
+ if (result != ISC_R_SUCCESS)
+ goto cleanup;
+#endif
+
ISC_LIST_INIT(ctx->on_run);
ctx->shutdown_requested = ISC_FALSE;
ctx->want_reload = ISC_FALSE;
ctx->blocked = ISC_FALSE;
- return (ISC_R_SUCCESS);
-}
-
-ISC_APPFUNC_SCOPE isc_result_t
-isc__app_start(void) {
- isc_result_t result;
- int presult;
- sigset_t sset;
- char strbuf[ISC_STRERRORSIZE];
-
- isc_g_appctx.common.impmagic = APPCTX_MAGIC;
- isc_g_appctx.common.magic = ISCAPI_APPCTX_MAGIC;
- isc_g_appctx.common.methods = &appmethods.methods;
- isc_g_appctx.mctx = NULL;
- /* The remaining members will be initialized in ctxstart() */
-
- result = isc__app_ctxstart((isc_appctx_t *)&isc_g_appctx);
- if (result != ISC_R_SUCCESS)
- return (result);
-
#ifndef HAVE_SIGWAIT
/*
* Install do-nothing handlers for SIGINT and SIGTERM.
*/
result = handle_signal(SIGINT, exit_action);
if (result != ISC_R_SUCCESS)
- return (result);
+ goto cleanup;
result = handle_signal(SIGTERM, exit_action);
if (result != ISC_R_SUCCESS)
- return (result);
+ goto cleanup;
#endif
/*
*/
result = handle_signal(SIGPIPE, SIG_IGN);
if (result != ISC_R_SUCCESS)
- return (result);
+ goto cleanup;
/*
* On Solaris 2, delivery of a signal whose action is SIG_IGN
*/
result = handle_signal(SIGHUP, SIG_DFL);
if (result != ISC_R_SUCCESS)
- return (result);
+ goto cleanup;
#ifdef HAVE_SIGWAIT
result = handle_signal(SIGTERM, SIG_DFL);
if (result != ISC_R_SUCCESS)
- return (result);
+ goto cleanup;
result = handle_signal(SIGINT, SIG_DFL);
if (result != ISC_R_SUCCESS)
- return (result);
+ goto cleanup;
#endif
#ifdef ISC_PLATFORM_USETHREADS
isc__strerror(errno, strbuf, sizeof(strbuf));
UNEXPECTED_ERROR(__FILE__, __LINE__,
"isc_app_start() sigsetops: %s", strbuf);
- return (ISC_R_UNEXPECTED);
+ result = ISC_R_UNEXPECTED;
+ goto cleanup;
}
presult = pthread_sigmask(SIG_BLOCK, &sset, NULL);
if (presult != 0) {
UNEXPECTED_ERROR(__FILE__, __LINE__,
"isc_app_start() pthread_sigmask: %s",
strbuf);
- return (ISC_R_UNEXPECTED);
+ result = ISC_R_UNEXPECTED;
+ goto cleanup;
}
#else /* ISC_PLATFORM_USETHREADS */
/*
isc__strerror(errno, strbuf, sizeof(strbuf));
UNEXPECTED_ERROR(__FILE__, __LINE__,
"isc_app_start() sigsetops: %s", strbuf);
- return (ISC_R_UNEXPECTED);
+ result = ISC_R_UNEXPECTED;
+ goto cleanup;
}
presult = sigprocmask(SIG_UNBLOCK, &sset, NULL);
if (presult != 0) {
isc__strerror(presult, strbuf, sizeof(strbuf));
UNEXPECTED_ERROR(__FILE__, __LINE__,
"isc_app_start() sigprocmask: %s", strbuf);
- return (ISC_R_UNEXPECTED);
+ result = ISC_R_UNEXPECTED;
+ goto cleanup;
}
#endif /* ISC_PLATFORM_USETHREADS */
return (ISC_R_SUCCESS);
+
+ cleanup:
+#ifdef ISC_PLATFORM_USETHREADS
+ cleanup_rcond:
+ isc_condition_destroy(&ctx->ready);
+
+ cleanup_rlock:
+ isc_mutex_destroy(&ctx->readylock);
+#endif /* ISC_PLATFORM_USETHREADS */
+ return (result);
+}
+
+isc_result_t
+isc__app_start(void) {
+ isc_g_appctx.common.impmagic = APPCTX_MAGIC;
+ isc_g_appctx.common.magic = ISCAPI_APPCTX_MAGIC;
+ isc_g_appctx.common.methods = &appmethods.methods;
+ isc_g_appctx.mctx = NULL;
+ /* The remaining members will be initialized in ctxstart() */
+
+ return (isc__app_ctxstart((isc_appctx_t *)&isc_g_appctx));
}
-ISC_APPFUNC_SCOPE isc_result_t
+isc_result_t
isc__app_onrun(isc_mem_t *mctx, isc_task_t *task, isc_taskaction_t action,
void *arg)
{
return (result);
}
-#ifndef USE_THREADS_SINGLECTX
+#ifndef ISC_PLATFORM_USETHREADS
/*!
* Event loop for nonthreaded programs.
*/
}
return (ISC_R_SUCCESS);
}
-#endif /* USE_THREADS_SINGLECTX */
-#ifndef ISC_PLATFORM_USETHREADS
/*
* This is a gross hack to support waiting for condition
* variables in nonthreaded programs in a limited way;
signalled = ISC_TRUE;
return (ISC_R_SUCCESS);
}
-
#endif /* ISC_PLATFORM_USETHREADS */
-ISC_APPFUNC_SCOPE isc_result_t
+isc_result_t
isc__app_ctxrun(isc_appctx_t *ctx0) {
isc__appctx_t *ctx = (isc__appctx_t *)ctx0;
int result;
isc_event_t *event, *next_event;
isc_task_t *task;
-#ifdef USE_THREADS_SINGLECTX
+#ifdef ISC_PLATFORM_USETHREADS
sigset_t sset;
char strbuf[ISC_STRERRORSIZE];
#ifdef HAVE_SIGWAIT
int sig;
-#endif
-#endif /* USE_THREADS_SINGLECTX */
+#endif /* HAVE_SIGWAIT */
+#endif /* ISC_PLATFORM_USETHREADS */
REQUIRE(VALID_APPCTX(ctx));
UNLOCK(&ctx->lock);
-#ifndef HAVE_SIGWAIT
- /*
- * Catch SIGHUP.
- *
- * We do this here to ensure that the signal handler is installed
- * (i.e. that it wasn't a "one-shot" handler).
- */
- if (ctx == &isc_g_appctx) {
- result = handle_signal(SIGHUP, reload_action);
- if (result != ISC_R_SUCCESS)
- return (ISC_R_SUCCESS);
- }
-#endif
-
-#ifdef USE_THREADS_SINGLECTX
+#ifndef ISC_PLATFORM_USETHREADS
+ (void) isc__taskmgr_dispatch(ctx->taskmgr);
+ result = evloop(ctx);
+ return (result);
+#else /* ISC_PLATFORM_USETHREADS */
/*
- * When we are using multiple contexts, we don't rely on signals.
+ * BIND9 internal tools using multiple contexts do not
+ * rely on signal.
*/
- if (ctx != &isc_g_appctx)
+ if (isc_bind9 && ctx != &isc_g_appctx)
return (ISC_R_SUCCESS);
/*
- * There is no danger if isc_app_shutdown() is called before we wait
- * for signals. Signals are blocked, so any such signal will simply
- * be made pending and we will get it when we call sigwait().
+ * There is no danger if isc_app_shutdown() is called before we
+ * wait for signals. Signals are blocked, so any such signal will
+ * simply be made pending and we will get it when we call
+ * sigwait().
*/
-
while (!ctx->want_shutdown) {
#ifdef HAVE_SIGWAIT
- /*
- * Wait for SIGHUP, SIGINT, or SIGTERM.
- */
- if (sigemptyset(&sset) != 0 ||
- sigaddset(&sset, SIGHUP) != 0 ||
- sigaddset(&sset, SIGINT) != 0 ||
- sigaddset(&sset, SIGTERM) != 0) {
- isc__strerror(errno, strbuf, sizeof(strbuf));
- UNEXPECTED_ERROR(__FILE__, __LINE__,
- "isc_app_run() sigsetops: %s", strbuf);
- return (ISC_R_UNEXPECTED);
- }
+ if (isc_bind9) {
+ /*
+ * BIND9 internal; single context:
+ * Wait for SIGHUP, SIGINT, or SIGTERM.
+ */
+ if (sigemptyset(&sset) != 0 ||
+ sigaddset(&sset, SIGHUP) != 0 ||
+ sigaddset(&sset, SIGINT) != 0 ||
+ sigaddset(&sset, SIGTERM) != 0) {
+ isc__strerror(errno, strbuf, sizeof(strbuf));
+ UNEXPECTED_ERROR(__FILE__, __LINE__,
+ "isc_app_run() sigsetops: %s",
+ strbuf);
+ return (ISC_R_UNEXPECTED);
+ }
#ifndef HAVE_UNIXWARE_SIGWAIT
- result = sigwait(&sset, &sig);
- if (result == 0) {
- if (sig == SIGINT || sig == SIGTERM)
- ctx->want_shutdown = ISC_TRUE;
- else if (sig == SIGHUP)
- ctx->want_reload = ISC_TRUE;
- }
+ result = sigwait(&sset, &sig);
+ if (result == 0) {
+ if (sig == SIGINT || sig == SIGTERM)
+ ctx->want_shutdown = ISC_TRUE;
+ else if (sig == SIGHUP)
+ ctx->want_reload = ISC_TRUE;
+ }
#else /* Using UnixWare sigwait semantics. */
- sig = sigwait(&sset);
- if (sig >= 0) {
- if (sig == SIGINT || sig == SIGTERM)
- ctx->want_shutdown = ISC_TRUE;
- else if (sig == SIGHUP)
- ctx->want_reload = ISC_TRUE;
- }
-
+ sig = sigwait(&sset);
+ if (sig >= 0) {
+ if (sig == SIGINT || sig == SIGTERM)
+ ctx->want_shutdown = ISC_TRUE;
+ else if (sig == SIGHUP)
+ ctx->want_reload = ISC_TRUE;
+ }
#endif /* HAVE_UNIXWARE_SIGWAIT */
+ } else {
+ /*
+ * External, or BIND9 using multiple contexts:
+ * wait until woken up.
+ */
+ LOCK(&ctx->readylock);
+ WAIT(&ctx->ready, &ctx->readylock);
+ UNLOCK(&ctx->readylock);
+ }
#else /* Don't have sigwait(). */
- /*
- * Listen for all signals.
- */
- if (sigemptyset(&sset) != 0) {
- isc__strerror(errno, strbuf, sizeof(strbuf));
- UNEXPECTED_ERROR(__FILE__, __LINE__,
- "isc_app_run() sigsetops: %s",
- strbuf);
- return (ISC_R_UNEXPECTED);
+ if (isc_bind9) {
+ /*
+ * BIND9 internal; single context:
+ * Install a signal handler for SIGHUP, then wait for
+ * all signals.
+ */
+ result = handle_signal(SIGHUP, reload_action);
+ if (result != ISC_R_SUCCESS)
+ return (ISC_R_SUCCESS);
+
+ if (sigemptyset(&sset) != 0) {
+ isc__strerror(errno, strbuf, sizeof(strbuf));
+ UNEXPECTED_ERROR(__FILE__, __LINE__,
+ "isc_app_run() sigsetops: %s",
+ strbuf);
+ return (ISC_R_UNEXPECTED);
+ }
+ result = sigsuspend(&sset);
+ } else {
+ /*
+ * External, or BIND9 using multiple contexts:
+ * wait until woken up.
+ */
+ LOCK(&ctx->readylock);
+ WAIT(&ctx->ready, &ctx->readylock);
+ UNLOCK(&ctx->readylock);
}
- result = sigsuspend(&sset);
#endif /* HAVE_SIGWAIT */
if (ctx->want_reload) {
exit(1);
}
-#else /* USE_THREADS_SINGLECTX */
-
- (void)isc__taskmgr_dispatch(ctx->taskmgr);
-
- result = evloop(ctx);
- if (result != ISC_R_SUCCESS)
- return (result);
-
-#endif /* USE_THREADS_SINGLECTX */
-
return (ISC_R_SUCCESS);
+#endif /* ISC_PLATFORM_USETHREADS */
}
-ISC_APPFUNC_SCOPE isc_result_t
+isc_result_t
isc__app_run() {
return (isc__app_ctxrun((isc_appctx_t *)&isc_g_appctx));
}
-ISC_APPFUNC_SCOPE isc_result_t
+isc_result_t
isc__app_ctxshutdown(isc_appctx_t *ctx0) {
isc__appctx_t *ctx = (isc__appctx_t *)ctx0;
isc_boolean_t want_kill = ISC_TRUE;
+#ifdef ISC_PLATFORM_USETHREADS
char strbuf[ISC_STRERRORSIZE];
+#endif /* ISC_PLATFORM_USETHREADS */
REQUIRE(VALID_APPCTX(ctx));
UNLOCK(&ctx->lock);
if (want_kill) {
- if (ctx != &isc_g_appctx)
+ if (isc_bind9 && ctx != &isc_g_appctx)
+ /* BIND9 internal, but using multiple contexts */
ctx->want_shutdown = ISC_TRUE;
else {
+#ifndef ISC_PLATFORM_USETHREADS
+ ctx->want_shutdown = ISC_TRUE;
+#else /* ISC_PLATFORM_USETHREADS */
#ifdef HAVE_LINUXTHREADS
- int result;
-
- result = pthread_kill(main_thread, SIGTERM);
- if (result != 0) {
- isc__strerror(result, strbuf, sizeof(strbuf));
- UNEXPECTED_ERROR(__FILE__, __LINE__,
- "isc_app_shutdown() "
- "pthread_kill: %s",
- strbuf);
- return (ISC_R_UNEXPECTED);
+ if (isc_bind9) {
+ /* BIND9 internal, single context */
+ int result;
+
+ result = pthread_kill(main_thread, SIGTERM);
+ if (result != 0) {
+ isc__strerror(result,
+ strbuf, sizeof(strbuf));
+ UNEXPECTED_ERROR(__FILE__, __LINE__,
+ "isc_app_shutdown() "
+ "pthread_kill: %s",
+ strbuf);
+ return (ISC_R_UNEXPECTED);
+ }
}
#else
- if (kill(getpid(), SIGTERM) < 0) {
- isc__strerror(errno, strbuf, sizeof(strbuf));
- UNEXPECTED_ERROR(__FILE__, __LINE__,
- "isc_app_shutdown() "
- "kill: %s", strbuf);
- return (ISC_R_UNEXPECTED);
+ if (isc_bind9) {
+ /* BIND9 internal, single context */
+ if (kill(getpid(), SIGTERM) < 0) {
+ isc__strerror(errno,
+ strbuf, sizeof(strbuf));
+ UNEXPECTED_ERROR(__FILE__, __LINE__,
+ "isc_app_shutdown() "
+ "kill: %s", strbuf);
+ return (ISC_R_UNEXPECTED);
+ }
+ }
+#endif /* HAVE_LINUXTHREADS */
+ else {
+ /* External, multiple contexts */
+ ctx->want_shutdown = ISC_TRUE;
+ SIGNAL(&ctx->ready);
}
-#endif /* HAVE_LINUXTHREADS */
+#endif /* ISC_PLATFORM_USETHREADS */
}
}
return (ISC_R_SUCCESS);
}
-ISC_APPFUNC_SCOPE isc_result_t
+isc_result_t
isc__app_shutdown() {
return (isc__app_ctxshutdown((isc_appctx_t *)&isc_g_appctx));
}
-ISC_APPFUNC_SCOPE isc_result_t
+isc_result_t
isc__app_ctxsuspend(isc_appctx_t *ctx0) {
isc__appctx_t *ctx = (isc__appctx_t *)ctx0;
isc_boolean_t want_kill = ISC_TRUE;
+#ifdef ISC_PLATFORM_USETHREADS
char strbuf[ISC_STRERRORSIZE];
+#endif
REQUIRE(VALID_APPCTX(ctx));
UNLOCK(&ctx->lock);
if (want_kill) {
- if (ctx != &isc_g_appctx)
+ if (isc_bind9 && ctx != &isc_g_appctx)
+ /* BIND9 internal, but using multiple contexts */
ctx->want_reload = ISC_TRUE;
else {
+#ifndef ISC_PLATFORM_USETHREADS
+ ctx->want_reload = ISC_TRUE;
+#else /* ISC_PLATFORM_USETHREADS */
#ifdef HAVE_LINUXTHREADS
- int result;
-
- result = pthread_kill(main_thread, SIGHUP);
- if (result != 0) {
- isc__strerror(result, strbuf, sizeof(strbuf));
- UNEXPECTED_ERROR(__FILE__, __LINE__,
- "isc_app_reload() "
- "pthread_kill: %s",
- strbuf);
- return (ISC_R_UNEXPECTED);
+ if (isc_bind9) {
+ /* BIND9 internal, single context */
+ int result;
+
+ result = pthread_kill(main_thread, SIGHUP);
+ if (result != 0) {
+ isc__strerror(result,
+ strbuf, sizeof(strbuf));
+ UNEXPECTED_ERROR(__FILE__, __LINE__,
+ "isc_app_reload() "
+ "pthread_kill: %s",
+ strbuf);
+ return (ISC_R_UNEXPECTED);
+ }
}
#else
- if (kill(getpid(), SIGHUP) < 0) {
- isc__strerror(errno, strbuf, sizeof(strbuf));
- UNEXPECTED_ERROR(__FILE__, __LINE__,
- "isc_app_reload() "
- "kill: %s", strbuf);
- return (ISC_R_UNEXPECTED);
+ if (isc_bind9) {
+ /* BIND9 internal, single context */
+ if (kill(getpid(), SIGHUP) < 0) {
+ isc__strerror(errno,
+ strbuf, sizeof(strbuf));
+ UNEXPECTED_ERROR(__FILE__, __LINE__,
+ "isc_app_reload() "
+ "kill: %s", strbuf);
+ return (ISC_R_UNEXPECTED);
+ }
}
-#endif
+#endif /* HAVE_LINUXTHREADS */
+ else {
+ /* External, multiple contexts */
+ ctx->want_reload = ISC_TRUE;
+ SIGNAL(&ctx->ready);
+ }
+#endif /* ISC_PLATFORM_USETHREADS */
}
}
return (ISC_R_SUCCESS);
}
-ISC_APPFUNC_SCOPE isc_result_t
+isc_result_t
isc__app_reload(void) {
return (isc__app_ctxsuspend((isc_appctx_t *)&isc_g_appctx));
}
-ISC_APPFUNC_SCOPE void
+void
isc__app_ctxfinish(isc_appctx_t *ctx0) {
isc__appctx_t *ctx = (isc__appctx_t *)ctx0;
DESTROYLOCK(&ctx->lock);
}
-ISC_APPFUNC_SCOPE void
+void
isc__app_finish(void) {
isc__app_ctxfinish((isc_appctx_t *)&isc_g_appctx);
}
-ISC_APPFUNC_SCOPE void
+void
isc__app_block(void) {
#ifdef ISC_PLATFORM_USETHREADS
sigset_t sset;
#endif /* ISC_PLATFORM_USETHREADS */
}
-ISC_APPFUNC_SCOPE void
+void
isc__app_unblock(void) {
#ifdef ISC_PLATFORM_USETHREADS
sigset_t sset;
#endif /* ISC_PLATFORM_USETHREADS */
}
-ISC_APPFUNC_SCOPE isc_result_t
+isc_result_t
isc__appctx_create(isc_mem_t *mctx, isc_appctx_t **ctxp) {
isc__appctx_t *ctx;
return (ISC_R_SUCCESS);
}
-ISC_APPFUNC_SCOPE void
+void
isc__appctx_destroy(isc_appctx_t **ctxp) {
isc__appctx_t *ctx;
*ctxp = NULL;
}
-ISC_APPFUNC_SCOPE void
+void
isc__appctx_settaskmgr(isc_appctx_t *ctx0, isc_taskmgr_t *taskmgr) {
isc__appctx_t *ctx = (isc__appctx_t *)ctx0;
ctx->taskmgr = taskmgr;
}
-ISC_APPFUNC_SCOPE void
+void
isc__appctx_setsocketmgr(isc_appctx_t *ctx0, isc_socketmgr_t *socketmgr) {
isc__appctx_t *ctx = (isc__appctx_t *)ctx0;
ctx->socketmgr = socketmgr;
}
-ISC_APPFUNC_SCOPE void
+void
isc__appctx_settimermgr(isc_appctx_t *ctx0, isc_timermgr_t *timermgr) {
isc__appctx_t *ctx = (isc__appctx_t *)ctx0;
ctx->timermgr = timermgr;
}
-#ifdef USE_APPIMPREGISTER
isc_result_t
isc__app_register() {
return (isc_app_register(isc__appctx_create));
}
-#endif
+
+#include "../app_api.c"
hints.ai_family = AF_INET;
hints.ai_socktype = SOCK_DGRAM;
hints.ai_protocol = IPPROTO_UDP;
- hints.ai_flags = AI_PASSIVE;
+ hints.ai_flags = AI_PASSIVE | AI_NUMERICHOST;
n = getaddrinfo("127.0.0.1", NULL, &hints, &res0);
if (n != 0 || res0 == NULL) {
}
s = socket(res0->ai_family, res0->ai_socktype, res0->ai_protocol);
+
if (s == -1) {
isc__strerror(errno, strbuf, sizeof(strbuf));
isc_log_write(isc_lctx, ISC_LOGCATEGORY_GENERAL,
hints.ai_family = AF_INET6;
hints.ai_socktype = SOCK_DGRAM;
hints.ai_protocol = IPPROTO_UDP;
- hints.ai_flags = AI_PASSIVE;
+ hints.ai_flags = AI_PASSIVE | AI_NUMERICHOST;
n = getaddrinfo("::1", NULL, &hints, &res0);
if (n != 0 || res0 == NULL) {
#include "errno2result.h"
/* See task.c about the following definition: */
-#ifdef BIND9
#ifdef ISC_PLATFORM_USETHREADS
#define USE_WATCHER_THREAD
#else
#define USE_SHARED_MANAGER
#endif /* ISC_PLATFORM_USETHREADS */
-#endif /* BIND9 */
#ifndef USE_WATCHER_THREAD
#include "socket_p.h"
static void setdscp(isc__socket_t *sock, isc_dscp_t dscp);
/*%
- * The following can be either static or public, depending on build environment.
+ * The following are intended for internal use (indicated by "isc__"
+ * prefix) but are not declared as static, allowing direct access from
+ * unit tests etc.
*/
-#ifdef BIND9
-#define ISC_SOCKETFUNC_SCOPE
-#else
-#define ISC_SOCKETFUNC_SCOPE static
-#endif
-
-ISC_SOCKETFUNC_SCOPE isc_result_t
+isc_result_t
+isc__socket_open(isc_socket_t *sock0);
+isc_result_t
+isc__socket_close(isc_socket_t *sock0);
+isc_result_t
isc__socket_create(isc_socketmgr_t *manager, int pf, isc_sockettype_t type,
isc_socket_t **socketp);
-ISC_SOCKETFUNC_SCOPE void
+void
isc__socket_attach(isc_socket_t *sock, isc_socket_t **socketp);
-ISC_SOCKETFUNC_SCOPE void
+void
isc__socket_detach(isc_socket_t **socketp);
-ISC_SOCKETFUNC_SCOPE isc_result_t
-isc__socketmgr_create(isc_mem_t *mctx, isc_socketmgr_t **managerp);
-ISC_SOCKETFUNC_SCOPE isc_result_t
-isc__socketmgr_create2(isc_mem_t *mctx, isc_socketmgr_t **managerp,
- unsigned int maxsocks);
-ISC_SOCKETFUNC_SCOPE void
-isc__socketmgr_destroy(isc_socketmgr_t **managerp);
-ISC_SOCKETFUNC_SCOPE isc_result_t
+isc_result_t
isc__socket_recvv(isc_socket_t *sock, isc_bufferlist_t *buflist,
unsigned int minimum, isc_task_t *task,
isc_taskaction_t action, const void *arg);
-ISC_SOCKETFUNC_SCOPE isc_result_t
+isc_result_t
isc__socket_recv(isc_socket_t *sock, isc_region_t *region,
unsigned int minimum, isc_task_t *task,
isc_taskaction_t action, const void *arg);
-ISC_SOCKETFUNC_SCOPE isc_result_t
+isc_result_t
isc__socket_recv2(isc_socket_t *sock, isc_region_t *region,
unsigned int minimum, isc_task_t *task,
isc_socketevent_t *event, unsigned int flags);
-ISC_SOCKETFUNC_SCOPE isc_result_t
+isc_result_t
isc__socket_send(isc_socket_t *sock, isc_region_t *region,
isc_task_t *task, isc_taskaction_t action, const void *arg);
-ISC_SOCKETFUNC_SCOPE isc_result_t
+isc_result_t
isc__socket_sendto(isc_socket_t *sock, isc_region_t *region,
isc_task_t *task, isc_taskaction_t action, const void *arg,
isc_sockaddr_t *address, struct in6_pktinfo *pktinfo);
-ISC_SOCKETFUNC_SCOPE isc_result_t
+isc_result_t
isc__socket_sendv(isc_socket_t *sock, isc_bufferlist_t *buflist,
isc_task_t *task, isc_taskaction_t action, const void *arg);
-ISC_SOCKETFUNC_SCOPE isc_result_t
+isc_result_t
isc__socket_sendtov(isc_socket_t *sock, isc_bufferlist_t *buflist,
isc_task_t *task, isc_taskaction_t action, const void *arg,
isc_sockaddr_t *address, struct in6_pktinfo *pktinfo);
-ISC_SOCKETFUNC_SCOPE isc_result_t
+isc_result_t
isc__socket_sendto2(isc_socket_t *sock, isc_region_t *region,
isc_task_t *task,
isc_sockaddr_t *address, struct in6_pktinfo *pktinfo,
isc_eventtype_t eventtype, isc_taskaction_t action,
const void *arg);
-ISC_SOCKETFUNC_SCOPE void
+void
isc__socket_cleanunix(isc_sockaddr_t *sockaddr, isc_boolean_t active);
-ISC_SOCKETFUNC_SCOPE isc_result_t
+isc_result_t
isc__socket_permunix(isc_sockaddr_t *sockaddr, isc_uint32_t perm,
isc_uint32_t owner, isc_uint32_t group);
-ISC_SOCKETFUNC_SCOPE isc_result_t
+isc_result_t
isc__socket_bind(isc_socket_t *sock, isc_sockaddr_t *sockaddr,
unsigned int options);
-ISC_SOCKETFUNC_SCOPE isc_result_t
+isc_result_t
isc__socket_filter(isc_socket_t *sock, const char *filter);
-ISC_SOCKETFUNC_SCOPE isc_result_t
+isc_result_t
isc__socket_listen(isc_socket_t *sock, unsigned int backlog);
-ISC_SOCKETFUNC_SCOPE isc_result_t
+isc_result_t
isc__socket_accept(isc_socket_t *sock,
isc_task_t *task, isc_taskaction_t action, const void *arg);
-ISC_SOCKETFUNC_SCOPE isc_result_t
+isc_result_t
isc__socket_connect(isc_socket_t *sock, isc_sockaddr_t *addr,
isc_task_t *task, isc_taskaction_t action,
const void *arg);
-ISC_SOCKETFUNC_SCOPE isc_result_t
+isc_result_t
isc__socket_getpeername(isc_socket_t *sock, isc_sockaddr_t *addressp);
-ISC_SOCKETFUNC_SCOPE isc_result_t
+isc_result_t
isc__socket_getsockname(isc_socket_t *sock, isc_sockaddr_t *addressp);
-ISC_SOCKETFUNC_SCOPE void
+void
isc__socket_cancel(isc_socket_t *sock, isc_task_t *task, unsigned int how);
-ISC_SOCKETFUNC_SCOPE isc_sockettype_t
+isc_sockettype_t
isc__socket_gettype(isc_socket_t *sock);
-ISC_SOCKETFUNC_SCOPE isc_boolean_t
+isc_boolean_t
isc__socket_isbound(isc_socket_t *sock);
-ISC_SOCKETFUNC_SCOPE void
+void
isc__socket_ipv6only(isc_socket_t *sock, isc_boolean_t yes);
-ISC_SOCKETFUNC_SCOPE void
+void
isc__socket_dscp(isc_socket_t *sock, isc_dscp_t dscp);
-#ifdef BIND9
-#ifdef HAVE_LIBXML2
-ISC_SOCKETFUNC_SCOPE void
-isc__socketmgr_renderxml(isc_socketmgr_t *mgr0, xmlTextWriterPtr writer);
-#endif
-#ifdef HAVE_JSON
-ISC_SOCKETFUNC_SCOPE isc_result_t
-isc__socketmgr_renderjson(isc_socketmgr_t *mgr0, json_object *stats);
-#endif
-#endif /* BIND9 */
-
-ISC_SOCKETFUNC_SCOPE isc_result_t
+isc_result_t
isc__socket_fdwatchcreate(isc_socketmgr_t *manager, int fd, int flags,
isc_sockfdwatch_t callback, void *cbarg,
isc_task_t *task, isc_socket_t **socketp);
-ISC_SOCKETFUNC_SCOPE isc_result_t
+isc_result_t
isc__socket_fdwatchpoke(isc_socket_t *sock, int flags);
-ISC_SOCKETFUNC_SCOPE isc_result_t
+isc_result_t
isc__socket_dup(isc_socket_t *sock, isc_socket_t **socketp);
-ISC_SOCKETFUNC_SCOPE int
+int
isc__socket_getfd(isc_socket_t *sock);
+isc_result_t
+isc__socketmgr_create(isc_mem_t *mctx, isc_socketmgr_t **managerp);
+isc_result_t
+isc__socketmgr_create2(isc_mem_t *mctx, isc_socketmgr_t **managerp,
+ unsigned int maxsocks);
+isc_result_t
+isc_socketmgr_getmaxsockets(isc_socketmgr_t *manager0, unsigned int *nsockp);
+void
+isc_socketmgr_setstats(isc_socketmgr_t *manager0, isc_stats_t *stats);
+void
+isc__socketmgr_destroy(isc_socketmgr_t **managerp);
+void
+isc__socket_setname(isc_socket_t *socket0, const char *name, void *tag);
+const char *
+isc__socket_getname(isc_socket_t *socket0);
+void *
+isc__socket_gettag(isc_socket_t *socket0);
+
+#ifdef HAVE_LIBXML2
+void
+isc__socketmgr_renderxml(isc_socketmgr_t *mgr0, xmlTextWriterPtr writer);
+#endif
+#ifdef HAVE_JSON
+isc_result_t
+isc__socketmgr_renderjson(isc_socketmgr_t *mgr0, json_object *stats);
+#endif
+
static struct {
isc_socketmethods_t methods;
/*%
* The following are defined just for avoiding unused static functions.
*/
-#ifndef BIND9
void *recvv, *send, *sendv, *sendto2, *cleanunix, *permunix, *filter,
- *listen, *accept, *getpeername, *isbound;
-#endif
+ *listen, *accept, *getpeername, *isbound;
} socketmethods = {
{
isc__socket_attach,
isc__socket_dup,
isc__socket_getfd,
isc__socket_dscp
- }
-#ifndef BIND9
- ,
+ },
(void *)isc__socket_recvv, (void *)isc__socket_send,
(void *)isc__socket_sendv, (void *)isc__socket_sendto2,
(void *)isc__socket_cleanunix, (void *)isc__socket_permunix,
(void *)isc__socket_filter, (void *)isc__socket_listen,
(void *)isc__socket_accept, (void *)isc__socket_getpeername,
(void *)isc__socket_isbound
-#endif
};
static isc_socketmgrmethods_t socketmgrmethods = {
memcpy(CMSG_DATA(cmsgp), &use_min_mtu, sizeof(use_min_mtu));
#endif
}
-#ifdef BIND9
if (isc_dscp_check_value != -1) {
if (sock->type == isc_sockettype_udp)
INSIST((int)dev->dscp == isc_dscp_check_value);
strbuf);
}
}
-#endif
}
#endif
#endif /* USE_CMSG && ISC_PLATFORM_HAVEIPV6 */
* called with 'arg' as the arg value. The new socket is returned
* in 'socketp'.
*/
-ISC_SOCKETFUNC_SCOPE isc_result_t
+isc_result_t
isc__socket_create(isc_socketmgr_t *manager0, int pf, isc_sockettype_t type,
isc_socket_t **socketp)
{
* Duplicate an existing socket. The new socket is returned
* in 'socketp'.
*/
-ISC_SOCKETFUNC_SCOPE isc_result_t
+isc_result_t
isc__socket_dup(isc_socket_t *sock0, isc_socket_t **socketp) {
isc__socket_t *sock = (isc__socket_t *)sock0;
sock0));
}
-#ifdef BIND9
-ISC_SOCKETFUNC_SCOPE isc_result_t
+isc_result_t
isc__socket_open(isc_socket_t *sock0) {
isc_result_t result;
isc__socket_t *sock = (isc__socket_t *)sock0;
return (result);
}
-#endif /* BIND9 */
/*
* Create a new 'type' socket managed by 'manager'. Events
* called with 'arg' as the arg value. The new socket is returned
* in 'socketp'.
*/
-ISC_SOCKETFUNC_SCOPE isc_result_t
+isc_result_t
isc__socket_fdwatchcreate(isc_socketmgr_t *manager0, int fd, int flags,
isc_sockfdwatch_t callback, void *cbarg,
isc_task_t *task, isc_socket_t **socketp)
* it is for writing but could be used for reading if desired
*/
-ISC_SOCKETFUNC_SCOPE isc_result_t
+isc_result_t
isc__socket_fdwatchpoke(isc_socket_t *sock0, int flags)
{
isc__socket_t *sock = (isc__socket_t *)sock0;
/*
* Attach to a socket. Caller must explicitly detach when it is done.
*/
-ISC_SOCKETFUNC_SCOPE void
+void
isc__socket_attach(isc_socket_t *sock0, isc_socket_t **socketp) {
isc__socket_t *sock = (isc__socket_t *)sock0;
* Dereference a socket. If this is the last reference to it, clean things
* up by destroying the socket.
*/
-ISC_SOCKETFUNC_SCOPE void
+void
isc__socket_detach(isc_socket_t **socketp) {
isc__socket_t *sock;
isc_boolean_t kill_socket = ISC_FALSE;
*socketp = NULL;
}
-#ifdef BIND9
-ISC_SOCKETFUNC_SCOPE isc_result_t
+isc_result_t
isc__socket_close(isc_socket_t *sock0) {
isc__socket_t *sock = (isc__socket_t *)sock0;
int fd;
return (ISC_R_SUCCESS);
}
-#endif /* BIND9 */
/*
* I/O is possible on a given socket. Schedule an event to this task that
}
#endif /* USE_WATCHER_THREAD */
-#ifdef BIND9
-ISC_SOCKETFUNC_SCOPE void
+void
isc__socketmgr_setreserved(isc_socketmgr_t *manager0, isc_uint32_t reserved) {
isc__socketmgr_t *manager = (isc__socketmgr_t *)manager0;
manager->reserved = reserved;
}
-ISC_SOCKETFUNC_SCOPE void
-isc___socketmgr_maxudp(isc_socketmgr_t *manager0, int maxudp) {
+void
+isc__socketmgr_maxudp(isc_socketmgr_t *manager0, int maxudp) {
isc__socketmgr_t *manager = (isc__socketmgr_t *)manager0;
REQUIRE(VALID_MANAGER(manager));
manager->maxudp = maxudp;
}
-#endif /* BIND9 */
/*
* Create a new socket manager.
#endif /* USE_KQUEUE */
}
-ISC_SOCKETFUNC_SCOPE isc_result_t
+isc_result_t
isc__socketmgr_create(isc_mem_t *mctx, isc_socketmgr_t **managerp) {
return (isc__socketmgr_create2(mctx, managerp, 0));
}
-ISC_SOCKETFUNC_SCOPE isc_result_t
+isc_result_t
isc__socketmgr_create2(isc_mem_t *mctx, isc_socketmgr_t **managerp,
unsigned int maxsocks)
{
return (result);
}
-#ifdef BIND9
isc_result_t
-isc__socketmgr_getmaxsockets(isc_socketmgr_t *manager0, unsigned int *nsockp) {
+isc_socketmgr_getmaxsockets(isc_socketmgr_t *manager0, unsigned int *nsockp) {
isc__socketmgr_t *manager = (isc__socketmgr_t *)manager0;
REQUIRE(VALID_MANAGER(manager));
REQUIRE(nsockp != NULL);
}
void
-isc__socketmgr_setstats(isc_socketmgr_t *manager0, isc_stats_t *stats) {
+isc_socketmgr_setstats(isc_socketmgr_t *manager0, isc_stats_t *stats) {
isc__socketmgr_t *manager = (isc__socketmgr_t *)manager0;
REQUIRE(VALID_MANAGER(manager));
isc_stats_attach(stats, &manager->stats);
}
-#endif
-ISC_SOCKETFUNC_SCOPE void
+void
isc__socketmgr_destroy(isc_socketmgr_t **managerp) {
isc__socketmgr_t *manager;
int i;
return (result);
}
-ISC_SOCKETFUNC_SCOPE isc_result_t
+isc_result_t
isc__socket_recvv(isc_socket_t *sock0, isc_bufferlist_t *buflist,
unsigned int minimum, isc_task_t *task,
isc_taskaction_t action, const void *arg)
return (socket_recv(sock, dev, task, 0));
}
-ISC_SOCKETFUNC_SCOPE isc_result_t
+isc_result_t
isc__socket_recv(isc_socket_t *sock0, isc_region_t *region,
unsigned int minimum, isc_task_t *task,
isc_taskaction_t action, const void *arg)
return (isc__socket_recv2(sock0, region, minimum, task, dev, 0));
}
-ISC_SOCKETFUNC_SCOPE isc_result_t
+isc_result_t
isc__socket_recv2(isc_socket_t *sock0, isc_region_t *region,
unsigned int minimum, isc_task_t *task,
isc_socketevent_t *event, unsigned int flags)
return (result);
}
-ISC_SOCKETFUNC_SCOPE isc_result_t
+isc_result_t
isc__socket_send(isc_socket_t *sock, isc_region_t *region,
isc_task_t *task, isc_taskaction_t action, const void *arg)
{
NULL));
}
-ISC_SOCKETFUNC_SCOPE isc_result_t
+isc_result_t
isc__socket_sendto(isc_socket_t *sock0, isc_region_t *region,
isc_task_t *task, isc_taskaction_t action, const void *arg,
isc_sockaddr_t *address, struct in6_pktinfo *pktinfo)
return (socket_send(sock, dev, task, address, pktinfo, 0));
}
-ISC_SOCKETFUNC_SCOPE isc_result_t
+isc_result_t
isc__socket_sendv(isc_socket_t *sock, isc_bufferlist_t *buflist,
isc_task_t *task, isc_taskaction_t action, const void *arg)
{
NULL));
}
-ISC_SOCKETFUNC_SCOPE isc_result_t
+isc_result_t
isc__socket_sendtov(isc_socket_t *sock0, isc_bufferlist_t *buflist,
isc_task_t *task, isc_taskaction_t action, const void *arg,
isc_sockaddr_t *address, struct in6_pktinfo *pktinfo)
return (socket_send(sock, dev, task, address, pktinfo, 0));
}
-ISC_SOCKETFUNC_SCOPE isc_result_t
+isc_result_t
isc__socket_sendto2(isc_socket_t *sock0, isc_region_t *region,
isc_task_t *task,
isc_sockaddr_t *address, struct in6_pktinfo *pktinfo,
return (socket_send(sock, event, task, address, pktinfo, flags));
}
-ISC_SOCKETFUNC_SCOPE void
+void
isc__socket_cleanunix(isc_sockaddr_t *sockaddr, isc_boolean_t active) {
#ifdef ISC_PLATFORM_HAVESYSUNH
int s;
#endif
}
-ISC_SOCKETFUNC_SCOPE isc_result_t
+isc_result_t
isc__socket_permunix(isc_sockaddr_t *sockaddr, isc_uint32_t perm,
isc_uint32_t owner, isc_uint32_t group)
{
#endif
}
-ISC_SOCKETFUNC_SCOPE isc_result_t
+isc_result_t
isc__socket_bind(isc_socket_t *sock0, isc_sockaddr_t *sockaddr,
unsigned int options) {
isc__socket_t *sock = (isc__socket_t *)sock0;
*/
#undef ENABLE_ACCEPTFILTER
-ISC_SOCKETFUNC_SCOPE isc_result_t
+isc_result_t
isc__socket_filter(isc_socket_t *sock0, const char *filter) {
isc__socket_t *sock = (isc__socket_t *)sock0;
#if defined(SO_ACCEPTFILTER) && defined(ENABLE_ACCEPTFILTER)
* is a new connection we'll have to allocate a new one anyway, so we might
* as well keep things simple rather than having to track them.
*/
-ISC_SOCKETFUNC_SCOPE isc_result_t
+isc_result_t
isc__socket_listen(isc_socket_t *sock0, unsigned int backlog) {
isc__socket_t *sock = (isc__socket_t *)sock0;
char strbuf[ISC_STRERRORSIZE];
/*
* This should try to do aggressive accept() XXXMLG
*/
-ISC_SOCKETFUNC_SCOPE isc_result_t
+isc_result_t
isc__socket_accept(isc_socket_t *sock0,
isc_task_t *task, isc_taskaction_t action, const void *arg)
{
return (ISC_R_SUCCESS);
}
-ISC_SOCKETFUNC_SCOPE isc_result_t
+isc_result_t
isc__socket_connect(isc_socket_t *sock0, isc_sockaddr_t *addr,
isc_task_t *task, isc_taskaction_t action, const void *arg)
{
isc_task_sendanddetach(&task, ISC_EVENT_PTR(&dev));
}
-ISC_SOCKETFUNC_SCOPE isc_result_t
+isc_result_t
isc__socket_getpeername(isc_socket_t *sock0, isc_sockaddr_t *addressp) {
isc__socket_t *sock = (isc__socket_t *)sock0;
isc_result_t result;
return (result);
}
-ISC_SOCKETFUNC_SCOPE isc_result_t
+isc_result_t
isc__socket_getsockname(isc_socket_t *sock0, isc_sockaddr_t *addressp) {
isc__socket_t *sock = (isc__socket_t *)sock0;
ISC_SOCKADDR_LEN_T len;
* Run through the list of events on this socket, and cancel the ones
* queued for task "task" of type "how". "how" is a bitmask.
*/
-ISC_SOCKETFUNC_SCOPE void
+void
isc__socket_cancel(isc_socket_t *sock0, isc_task_t *task, unsigned int how) {
isc__socket_t *sock = (isc__socket_t *)sock0;
UNLOCK(&sock->lock);
}
-ISC_SOCKETFUNC_SCOPE isc_sockettype_t
+isc_sockettype_t
isc__socket_gettype(isc_socket_t *sock0) {
isc__socket_t *sock = (isc__socket_t *)sock0;
return (sock->type);
}
-ISC_SOCKETFUNC_SCOPE isc_boolean_t
+isc_boolean_t
isc__socket_isbound(isc_socket_t *sock0) {
isc__socket_t *sock = (isc__socket_t *)sock0;
isc_boolean_t val;
return (val);
}
-ISC_SOCKETFUNC_SCOPE void
+void
isc__socket_ipv6only(isc_socket_t *sock0, isc_boolean_t yes) {
isc__socket_t *sock = (isc__socket_t *)sock0;
#if defined(IPV6_V6ONLY)
#endif
}
-ISC_SOCKETFUNC_SCOPE void
+void
isc__socket_dscp(isc_socket_t *sock0, isc_dscp_t dscp) {
isc__socket_t *sock = (isc__socket_t *)sock0;
}
#endif /* USE_WATCHER_THREAD */
-#ifdef BIND9
void
isc__socket_setname(isc_socket_t *socket0, const char *name, void *tag) {
isc__socket_t *socket = (isc__socket_t *)socket0;
UNLOCK(&socket->lock);
}
-ISC_SOCKETFUNC_SCOPE const char *
+const char *
isc__socket_getname(isc_socket_t *socket0) {
isc__socket_t *socket = (isc__socket_t *)socket0;
return (socket->tag);
}
-#endif /* BIND9 */
-#ifdef USE_SOCKETIMPREGISTER
isc_result_t
isc__socket_register() {
return (isc_socket_register(isc__socketmgr_create));
}
-#endif
-ISC_SOCKETFUNC_SCOPE int
+int
isc__socket_getfd(isc_socket_t *socket0) {
isc__socket_t *socket = (isc__socket_t *)socket0;
return ((short) socket->fd);
}
-#ifdef BIND9
-
#if defined(HAVE_LIBXML2) || defined(HAVE_JSON)
static const char *
_socktype(isc_sockettype_t type)
#ifdef HAVE_LIBXML2
#define TRY0(a) do { xmlrc = (a); if (xmlrc < 0) goto error; } while(0)
-ISC_SOCKETFUNC_SCOPE int
+int
isc_socketmgr_renderxml(isc_socketmgr_t *mgr0, xmlTextWriterPtr writer) {
isc__socketmgr_t *mgr = (isc__socketmgr_t *)mgr0;
isc__socket_t *sock = NULL;
} \
} while(0)
-ISC_SOCKETFUNC_SCOPE isc_result_t
+isc_result_t
isc_socketmgr_renderjson(isc_socketmgr_t *mgr0, json_object *stats) {
isc_result_t result = ISC_R_SUCCESS;
isc__socketmgr_t *mgr = (isc__socketmgr_t *)mgr0;
return (result);
}
#endif /* HAVE_JSON */
-#endif /* BIND9 */
+
+#include "../socket_api.c"
blocked = ISC_FALSE;
REQUIRE(blockedthread == GetCurrentThread());
}
+
+#include "../app_api.c"
}
isc_result_t
-isc__socketmgr_getmaxsockets(isc_socketmgr_t *manager, unsigned int *nsockp) {
+isc_socketmgr_getmaxsockets(isc_socketmgr_t *manager, unsigned int *nsockp) {
REQUIRE(VALID_MANAGER(manager));
REQUIRE(nsockp != NULL);
}
void
-isc__socketmgr_setstats(isc_socketmgr_t *manager, isc_stats_t *stats) {
+isc_socketmgr_setstats(isc_socketmgr_t *manager, isc_stats_t *stats) {
REQUIRE(VALID_MANAGER(manager));
REQUIRE(ISC_LIST_EMPTY(manager->socklist));
REQUIRE(manager->stats == NULL);
return (xmlrc);
}
#endif /* HAVE_LIBXML2 */
+
+#include "../socket_api.c"
SUBDIRS = include
# Alphabetically
-OBJS = aclconf.@O@ log.@O@ namedconf.@O@ parser.@O@ version.@O@
+OBJS = aclconf.@O@ dnsconf.@O@ log.@O@ namedconf.@O@ \
+ parser.@O@ version.@O@
# Alphabetically
-SRCS = aclconf.c log.c namedconf.c parser.c version.c
+SRCS = aclconf.c dnsconf.c log.c namedconf.c \
+ parser.c version.c
TARGETS = timestamp
srcdir = @srcdir@
top_srcdir = @top_srcdir@
-export_srcdir = @top_srcdir@/lib/export
@BIND9_VERSION@
@BIND9_MAKE_INCLUDES@
CINCLUDES = -I${srcdir}/include -I../dns/include \
- -I${export_srcdir}/isc/include \
${DNS_INCLUDES} ${ISC_INCLUDES} \
-I${top_srcdir}/lib/irs/include \
-I../../irs/include
ISCCFGDEPLIBS = ../isccfg/libisccfg.@A@
IRSDEPLIBS = ../irs/libirs.@A@
-DEPLIBS = ${DNSDEPLIBS} ${ISCCFGDEPLIBS} ${ISCDEPLIBS}
+DEPLIBS = ${DNSDEPLIBS} ${ISCDEPLIBS} ${ISCCFGDEPLIBS}
LIBS = ${DNSLIBS} ${ISCCFGLIBS} ${ISCLIBS} @LIBS@
SUBDIRS =
-TARGETS = sample@EXEEXT@ sample-async@EXEEXT@ sample-gai@EXEEXT@ \
+TARGETS = resolve@EXEEXT@ sample-async@EXEEXT@ sample-gai@EXEEXT@ \
sample-update@EXEEXT@ sample-request@EXEEXT@ nsprobe@EXEEXT@
-OBJS = sample.@O@ sample-async.@O@ sample-gai.@O@ sample-update.@O@ \
+OBJS = resolve.@O@ sample-async.@O@ sample-gai.@O@ sample-update.@O@ \
sample-request.@O@ nsprobe.@O@
UOBJS =
-SRCS = sample.c sample-async.c sample-gai.c sample-update.c \
+SRCS = resolve.c sample-async.c sample-gai.c sample-update.c \
sample-request.c nsprobe.c
MANPAGES =
@BIND9_MAKE_RULES@
-sample@EXEEXT@: sample.@O@ ${DEPLIBS}
+resolve@EXEEXT@: resolve.@O@ ${IRSDEPLIBS} ${DEPLIBS}
${LIBTOOL_MODE_LINK} ${PURIFY} ${CC} ${CFLAGS} ${LDFLAGS} -o $@ \
- sample.@O@ ${LIBS}
+ resolve.@O@ ${IRSLIBS} ${LIBS}
sample-async@EXEEXT@: sample-async.@O@ ${DEPLIBS}
${LIBTOOL_MODE_LINK} ${PURIFY} ${CC} ${CFLAGS} ${LDFLAGS} -o $@ \
clean distclean maintainer-clean::
rm -f ${TARGETS}
+ rm -f sample.key
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: sample.c,v 1.5 2009/09/29 15:06:07 fdupont Exp $ */
-
#include <config.h>
#include <sys/types.h>
#include <isc/sockaddr.h>
#include <isc/util.h>
+#include <irs/resconf.h>
+
#include <dns/client.h>
#include <dns/fixedname.h>
#include <dns/keyvalues.h>
static void
usage(void) {
- fprintf(stderr, "sample [-t RRtype] "
+ fprintf(stderr, "resolve [-t RRtype] "
"[[-a algorithm] [-e] -k keyname -K keystring] "
- "[-s domain:serveraddr_for_domain ] "
- "server_address hostname\n");
+ "[-S domain:serveraddr_for_domain ] [-s server_address]"
+ "hostname\n");
exit(1);
}
main(int argc, char *argv[]) {
int ch;
isc_textregion_t tr;
+ char *server = NULL;
char *altserver = NULL;
char *altserveraddr = NULL;
char *altservername = NULL;
unsigned int clientopt, resopt;
isc_boolean_t is_sep = ISC_FALSE;
const char *port = "53";
+ isc_mem_t *mctx = NULL;
- while ((ch = getopt(argc, argv, "a:es:t:k:K:p:")) != -1) {
+ while ((ch = getopt(argc, argv, "a:es:t:k:K:p:S:")) != -1) {
switch (ch) {
case 't':
tr.base = optarg;
case 'e':
is_sep = ISC_TRUE;
break;
- case 's':
+ case 'S':
if (altserver != NULL) {
fprintf(stderr, "alternate server "
"already defined: %s\n",
}
altserver = optarg;
break;
+ case 's':
+ if (server != NULL) {
+ fprintf(stderr, "server "
+ "already defined: %s\n",
+ server);
+ exit(1);
+ }
+ server = optarg;
+ break;
case 'k':
keynamestr = optarg;
break;
argc -= optind;
argv += optind;
- if (argc < 2)
+ if (argc < 1)
usage();
if (altserver != NULL) {
exit(1);
}
+ result = isc_mem_create(0, 0, &mctx);
+ if (result != ISC_R_SUCCESS) {
+ fprintf(stderr, "failed to crate mctx\n");
+ exit(1);
+ }
+
clientopt = 0;
result = dns_client_create(&client, clientopt);
if (result != ISC_R_SUCCESS) {
}
/* Set the nameserver */
- addserver(client, argv[0], port, NULL);
+ if (server == NULL) {
+ irs_resconf_t *resconf = NULL;
+ isc_sockaddrlist_t *nameservers;
+
+ result = irs_resconf_load(mctx, "/etc/resolv.conf", &resconf);
+ nameservers = irs_resconf_getnameservers(resconf);
+ result = dns_client_setservers(client, dns_rdataclass_in,
+ NULL, nameservers);
+ if (result != ISC_R_SUCCESS) {
+ fprintf(stderr, "dns_client_setservers failed: %d\n",
+ result);
+ exit(1);
+ }
+ } else {
+ addserver(client, server, port, NULL);
+ }
/* Set the alternate nameserver (when specified) */
if (altserver != NULL)
}
/* Construct qname */
- namelen = strlen(argv[1]);
- isc_buffer_init(&b, argv[1], namelen);
+ namelen = strlen(argv[0]);
+ isc_buffer_init(&b, argv[0], namelen);
isc_buffer_add(&b, namelen);
dns_fixedname_init(&qname0);
qname = dns_fixedname_name(&qname0);
--- /dev/null
+#!/bin/sh
+# Fetch a copy of a current root signing key; used for testing
+# DNSSEC validation in 'sample'.
+#
+# After running this script, "sample `cat sample.key` <args>" will
+# perform a lookup as specified in <args> and validate the result
+# using the root key.
+#
+# (This is NOT a secure method of obtaining the root key; it is
+# included here for testing purposes only.)
+dig +noall +answer dnskey . | perl -n -e '
+local ($dn, $ttl, $class, $type, $flags, $proto, $alg, @rest) = split;
+next if ($flags != 257);
+local $key = join("", @rest);
+print "-a $alg -e -k $dn -K $key\n"
+' > sample.key
localstatedir = @localstatedir@
mandir = @mandir@
datarootdir = @datarootdir@
-export_libdir = @export_libdir@
-export_includedir = @export_includedir@
DESTDIR =