mirror of
https://gitlab.isc.org/isc-projects/bind9
synced 2025-08-30 05:57:52 +00:00
Merge branch 'libdns-cleanup2' into 'master'
libdns cleanup See merge request isc-projects/bind9!172
This commit is contained in:
commit
76fa1c181c
3
CHANGES
3
CHANGES
@ -1,3 +1,6 @@
|
||||
4920. [cleanup] Clean up libdns removing most of the backwards
|
||||
compatibility wrappers.
|
||||
|
||||
4919. [cleanup] Clean up the isc_hash_* namespace and leave only
|
||||
the FNV-1a hash implementation. [GL #178]
|
||||
|
||||
|
@ -99,18 +99,17 @@ isc_boolean_t docheckmx = ISC_FALSE;
|
||||
isc_boolean_t dochecksrv = ISC_FALSE;
|
||||
isc_boolean_t docheckns = ISC_FALSE;
|
||||
#endif
|
||||
unsigned int zone_options = DNS_ZONEOPT_CHECKNS |
|
||||
DNS_ZONEOPT_CHECKMX |
|
||||
DNS_ZONEOPT_MANYERRORS |
|
||||
DNS_ZONEOPT_CHECKNAMES |
|
||||
DNS_ZONEOPT_CHECKINTEGRITY |
|
||||
dns_zoneopt_t zone_options = DNS_ZONEOPT_CHECKNS |
|
||||
DNS_ZONEOPT_CHECKMX |
|
||||
DNS_ZONEOPT_MANYERRORS |
|
||||
DNS_ZONEOPT_CHECKNAMES |
|
||||
DNS_ZONEOPT_CHECKINTEGRITY |
|
||||
#if CHECK_SIBLING
|
||||
DNS_ZONEOPT_CHECKSIBLING |
|
||||
DNS_ZONEOPT_CHECKSIBLING |
|
||||
#endif
|
||||
DNS_ZONEOPT_CHECKWILDCARD |
|
||||
DNS_ZONEOPT_WARNMXCNAME |
|
||||
DNS_ZONEOPT_WARNSRVCNAME;
|
||||
unsigned int zone_options2 = 0;
|
||||
DNS_ZONEOPT_CHECKWILDCARD |
|
||||
DNS_ZONEOPT_WARNMXCNAME |
|
||||
DNS_ZONEOPT_WARNSRVCNAME;
|
||||
|
||||
/*
|
||||
* This needs to match the list in bin/named/log.c.
|
||||
@ -691,7 +690,8 @@ load_zone(isc_mem_t *mctx, const char *zonename, const char *filename,
|
||||
CHECK(dns_name_fromtext(origin, &buffer, dns_rootname, 0, NULL));
|
||||
CHECK(dns_zone_setorigin(zone, origin));
|
||||
CHECK(dns_zone_setdbtype(zone, 1, (const char * const *) dbtype));
|
||||
CHECK(dns_zone_setfile2(zone, filename, fileformat));
|
||||
CHECK(dns_zone_setfile(zone, filename, fileformat,
|
||||
&dns_master_style_default));
|
||||
if (journal != NULL)
|
||||
CHECK(dns_zone_setjournal(zone, journal));
|
||||
|
||||
@ -701,7 +701,6 @@ load_zone(isc_mem_t *mctx, const char *zonename, const char *filename,
|
||||
|
||||
dns_zone_setclass(zone, rdclass);
|
||||
dns_zone_setoption(zone, zone_options, ISC_TRUE);
|
||||
dns_zone_setoption2(zone, zone_options2, ISC_TRUE);
|
||||
dns_zone_setoption(zone, DNS_ZONEOPT_NOMERGE, nomerge);
|
||||
|
||||
dns_zone_setmaxttl(zone, maxttl);
|
||||
@ -764,8 +763,8 @@ dump_zone(const char *zonename, dns_zone_t *zone, const char *filename,
|
||||
}
|
||||
}
|
||||
|
||||
result = dns_zone_dumptostream3(zone, output, fileformat, style,
|
||||
rawversion);
|
||||
result = dns_zone_dumptostream(zone, output, fileformat, style,
|
||||
rawversion);
|
||||
if (output != stdout)
|
||||
(void)isc_stdio_close(output);
|
||||
|
||||
|
@ -22,6 +22,7 @@
|
||||
|
||||
#include <dns/masterdump.h>
|
||||
#include <dns/types.h>
|
||||
#include <dns/zone.h>
|
||||
|
||||
ISC_LANG_BEGINDECLS
|
||||
|
||||
@ -49,8 +50,7 @@ extern isc_boolean_t nomerge;
|
||||
extern isc_boolean_t docheckmx;
|
||||
extern isc_boolean_t docheckns;
|
||||
extern isc_boolean_t dochecksrv;
|
||||
extern unsigned int zone_options;
|
||||
extern unsigned int zone_options2;
|
||||
extern dns_zoneopt_t zone_options;
|
||||
|
||||
ISC_LANG_ENDDECLS
|
||||
|
||||
|
@ -408,7 +408,7 @@ configure_zone(const char *vclass, const char *view,
|
||||
obj = NULL;
|
||||
if (get_maps(maps, "max-zone-ttl", &obj)) {
|
||||
maxttl = cfg_obj_asuint32(obj);
|
||||
zone_options2 |= DNS_ZONEOPT2_CHECKTTL;
|
||||
zone_options |= DNS_ZONEOPT_CHECKTTL;
|
||||
}
|
||||
|
||||
result = load_zone(mctx, zname, zfile, masterformat,
|
||||
|
@ -260,7 +260,7 @@ main(int argc, char **argv) {
|
||||
break;
|
||||
|
||||
case 'l':
|
||||
zone_options2 |= DNS_ZONEOPT2_CHECKTTL;
|
||||
zone_options |= DNS_ZONEOPT_CHECKTTL;
|
||||
endp = NULL;
|
||||
maxttl = strtol(isc_commandline_argument, &endp, 0);
|
||||
if (*endp != '\0') {
|
||||
|
@ -170,12 +170,12 @@ generate_key(isc_mem_t *mctx, const char *randomfile, dns_secalg_t alg,
|
||||
|
||||
entropy_flags = ISC_ENTROPY_BLOCKING | ISC_ENTROPY_GOODONLY;
|
||||
|
||||
DO("initialize dst library", dst_lib_init(mctx, ectx, entropy_flags));
|
||||
DO("initialize dst library", dst_lib_init(mctx, ectx, NULL, entropy_flags));
|
||||
|
||||
DO("generate key", dst_key_generate(dns_rootname, alg,
|
||||
keysize, 0, 0,
|
||||
DNS_KEYPROTO_ANY,
|
||||
dns_rdataclass_in, mctx, &key));
|
||||
keysize, 0, 0, DNS_KEYPROTO_ANY,
|
||||
dns_rdataclass_in, mctx, &key,
|
||||
NULL));
|
||||
|
||||
isc_buffer_init(&key_rawbuffer, &key_rawsecret, sizeof(key_rawsecret));
|
||||
|
||||
|
@ -521,17 +521,17 @@ setup_style(dns_master_style_t **stylep) {
|
||||
}
|
||||
|
||||
if (multiline || (nottl && noclass))
|
||||
result = dns_master_stylecreate2(&style, styleflags,
|
||||
24, 24, 24, 32, 80, 8,
|
||||
splitwidth, mctx);
|
||||
result = dns_master_stylecreate(&style, styleflags,
|
||||
24, 24, 24, 32, 80, 8,
|
||||
splitwidth, mctx);
|
||||
else if (nottl || noclass)
|
||||
result = dns_master_stylecreate2(&style, styleflags,
|
||||
24, 24, 32, 40, 80, 8,
|
||||
splitwidth, mctx);
|
||||
result = dns_master_stylecreate(&style, styleflags,
|
||||
24, 24, 32, 40, 80, 8,
|
||||
splitwidth, mctx);
|
||||
else
|
||||
result = dns_master_stylecreate2(&style, styleflags,
|
||||
24, 32, 40, 48, 80, 8,
|
||||
splitwidth, mctx);
|
||||
result = dns_master_stylecreate(&style, styleflags,
|
||||
24, 32, 40, 48, 80, 8,
|
||||
splitwidth, mctx);
|
||||
|
||||
if (result == ISC_R_SUCCESS)
|
||||
*stylep = style;
|
||||
@ -1540,7 +1540,7 @@ get_reverse(char *reverse, size_t len, char *value, isc_boolean_t strict) {
|
||||
|
||||
dns_fixedname_init(&fname);
|
||||
name = dns_fixedname_name(&fname);
|
||||
result = dns_byaddr_createptrname2(&addr, options, name);
|
||||
result = dns_byaddr_createptrname(&addr, options, name);
|
||||
if (result != ISC_R_SUCCESS)
|
||||
return (result);
|
||||
dns_name_format(name, reverse, (unsigned int)len);
|
||||
@ -1624,8 +1624,8 @@ main(int argc, char *argv[]) {
|
||||
|
||||
/* Create client */
|
||||
clopt = DNS_CLIENTCREATEOPT_USECACHE;
|
||||
result = dns_client_createx2(mctx, actx, taskmgr, socketmgr, timermgr,
|
||||
clopt, &client, srcaddr4, srcaddr6);
|
||||
result = dns_client_createx(mctx, actx, taskmgr, socketmgr, timermgr,
|
||||
clopt, &client, srcaddr4, srcaddr6);
|
||||
if (result != ISC_R_SUCCESS) {
|
||||
delv_log(ISC_LOG_ERROR, "dns_client_create: %s",
|
||||
isc_result_totext(result));
|
||||
|
@ -480,17 +480,17 @@ printmessage(dig_query_t *query, dns_message_t *msg, isc_boolean_t headers) {
|
||||
}
|
||||
if (query->lookup->multiline ||
|
||||
(query->lookup->nottl && query->lookup->noclass))
|
||||
result = dns_master_stylecreate2(&style, styleflags,
|
||||
24, 24, 24, 32, 80, 8,
|
||||
splitwidth, mctx);
|
||||
result = dns_master_stylecreate(&style, styleflags,
|
||||
24, 24, 24, 32, 80, 8,
|
||||
splitwidth, mctx);
|
||||
else if (query->lookup->nottl || query->lookup->noclass)
|
||||
result = dns_master_stylecreate2(&style, styleflags,
|
||||
24, 24, 32, 40, 80, 8,
|
||||
splitwidth, mctx);
|
||||
result = dns_master_stylecreate(&style, styleflags,
|
||||
24, 24, 32, 40, 80, 8,
|
||||
splitwidth, mctx);
|
||||
else
|
||||
result = dns_master_stylecreate2(&style, styleflags,
|
||||
24, 32, 40, 48, 80, 8,
|
||||
splitwidth, mctx);
|
||||
result = dns_master_stylecreate(&style, styleflags,
|
||||
24, 32, 40, 48, 80, 8,
|
||||
splitwidth, mctx);
|
||||
check_result(result, "dns_master_stylecreate");
|
||||
|
||||
if (query->lookup->cmdline[0] != 0) {
|
||||
|
@ -355,7 +355,7 @@ get_reverse(char *reverse, size_t len, char *value, isc_boolean_t ip6_int,
|
||||
options |= DNS_BYADDROPT_IPV6INT;
|
||||
dns_fixedname_init(&fname);
|
||||
name = dns_fixedname_name(&fname);
|
||||
result = dns_byaddr_createptrname2(&addr, options, name);
|
||||
result = dns_byaddr_createptrname(&addr, options, name);
|
||||
if (result != ISC_R_SUCCESS)
|
||||
return (result);
|
||||
dns_name_format(name, reverse, (unsigned int)len);
|
||||
@ -1400,7 +1400,7 @@ setup_libs(void) {
|
||||
result = isc_entropy_create(mctx, &entp);
|
||||
check_result(result, "isc_entropy_create");
|
||||
|
||||
result = dst_lib_init(mctx, entp, 0);
|
||||
result = dst_lib_init(mctx, entp, NULL, 0);
|
||||
check_result(result, "dst_lib_init");
|
||||
is_dst_up = ISC_TRUE;
|
||||
|
||||
|
@ -254,8 +254,8 @@ load_db(const char *filename, dns_db_t **dbp, dns_dbnode_t **nodep) {
|
||||
rdclass, 0, NULL, dbp);
|
||||
check_result(result, "dns_db_create()");
|
||||
|
||||
result = dns_db_load3(*dbp, filename,
|
||||
dns_masterformat_text, DNS_MASTER_HINT);
|
||||
result = dns_db_load(*dbp, filename,
|
||||
dns_masterformat_text, DNS_MASTER_HINT);
|
||||
if (result != ISC_R_SUCCESS && result != DNS_R_SEENINCLUDE) {
|
||||
fatal("can't load %s: %s", filename,
|
||||
isc_result_totext(result));
|
||||
@ -379,9 +379,9 @@ formatset(dns_rdataset_t *rdataset) {
|
||||
* which just separates fields with spaces. The huge tab stop width
|
||||
* eliminates any tab characters.
|
||||
*/
|
||||
result = dns_master_stylecreate2(&style, styleflags,
|
||||
0, 0, 0, 0, 0, 1000000, 0,
|
||||
mctx);
|
||||
result = dns_master_stylecreate(&style, styleflags,
|
||||
0, 0, 0, 0, 0, 1000000, 0,
|
||||
mctx);
|
||||
check_result(result, "dns_master_stylecreate2 failed");
|
||||
|
||||
result = isc_buffer_allocate(mctx, &buf, MAX_CDS_RDATA_TEXT_SIZE);
|
||||
@ -671,8 +671,11 @@ matching_sigs(keyinfo_t *keytbl, dns_rdataset_t *rdataset,
|
||||
}
|
||||
|
||||
result = dns_dnssec_verify(name, rdataset, ki->dst,
|
||||
ISC_FALSE, mctx, &sigrdata);
|
||||
if (result != ISC_R_SUCCESS) {
|
||||
ISC_FALSE, 0, mctx,
|
||||
&sigrdata, NULL);
|
||||
|
||||
if (result != ISC_R_SUCCESS &&
|
||||
result != DNS_R_FROMWILDCARD) {
|
||||
vbprintf(1, "skip RRSIG by key %d:"
|
||||
" verification failed: %s\n",
|
||||
sig.keyid, isc_result_totext(result));
|
||||
@ -1234,7 +1237,7 @@ main(int argc, char *argv[]) {
|
||||
if (ectx == NULL) {
|
||||
setup_entropy(mctx, NULL, &ectx);
|
||||
}
|
||||
result = dst_lib_init(mctx, ectx,
|
||||
result = dst_lib_init(mctx, ectx, NULL,
|
||||
ISC_ENTROPY_BLOCKING | ISC_ENTROPY_GOODONLY);
|
||||
if (result != ISC_R_SUCCESS) {
|
||||
fatal("could not initialize dst: %s",
|
||||
|
@ -114,7 +114,7 @@ loadset(const char *filename, dns_rdataset_t *rdataset) {
|
||||
db_load_from_stream(db, stdin);
|
||||
filename = "input";
|
||||
} else {
|
||||
result = dns_db_load(db, filename);
|
||||
result = dns_db_load(db, filename, dns_masterformat_text, 0);
|
||||
if (result != ISC_R_SUCCESS && result != DNS_R_SEENINCLUDE)
|
||||
fatal("can't load %s: %s", filename,
|
||||
isc_result_totext(result));
|
||||
@ -479,7 +479,7 @@ main(int argc, char **argv) {
|
||||
|
||||
if (ectx == NULL)
|
||||
setup_entropy(mctx, NULL, &ectx);
|
||||
result = dst_lib_init(mctx, ectx,
|
||||
result = dst_lib_init(mctx, ectx, NULL,
|
||||
ISC_ENTROPY_BLOCKING | ISC_ENTROPY_GOODONLY);
|
||||
if (result != ISC_R_SUCCESS)
|
||||
fatal("could not initialize dst: %s",
|
||||
|
@ -119,8 +119,8 @@ loadset(const char *filename, dns_rdataset_t *rdataset) {
|
||||
db_load_from_stream(db, stdin);
|
||||
filename = "input";
|
||||
} else {
|
||||
result = dns_db_load3(db, filename, dns_masterformat_text,
|
||||
DNS_MASTER_NOTTL);
|
||||
result = dns_db_load(db, filename, dns_masterformat_text,
|
||||
DNS_MASTER_NOTTL);
|
||||
if (result != ISC_R_SUCCESS && result != DNS_R_SEENINCLUDE)
|
||||
fatal("can't load %s: %s", filename,
|
||||
isc_result_totext(result));
|
||||
@ -408,7 +408,7 @@ main(int argc, char **argv) {
|
||||
|
||||
if (ectx == NULL)
|
||||
setup_entropy(mctx, NULL, &ectx);
|
||||
result = dst_lib_init(mctx, ectx,
|
||||
result = dst_lib_init(mctx, ectx, NULL,
|
||||
ISC_ENTROPY_BLOCKING | ISC_ENTROPY_GOODONLY);
|
||||
if (result != ISC_R_SUCCESS)
|
||||
fatal("could not initialize dst: %s",
|
||||
|
@ -349,8 +349,8 @@ main(int argc, char **argv) {
|
||||
|
||||
if (ectx == NULL)
|
||||
setup_entropy(mctx, NULL, &ectx);
|
||||
ret = dst_lib_init2(mctx, ectx, engine,
|
||||
ISC_ENTROPY_BLOCKING | ISC_ENTROPY_GOODONLY);
|
||||
ret = dst_lib_init(mctx, ectx, engine,
|
||||
ISC_ENTROPY_BLOCKING | ISC_ENTROPY_GOODONLY);
|
||||
if (ret != ISC_R_SUCCESS)
|
||||
fatal("could not initialize dst: %s",
|
||||
isc_result_totext(ret));
|
||||
|
@ -496,8 +496,8 @@ main(int argc, char **argv) {
|
||||
|
||||
if (ectx == NULL)
|
||||
setup_entropy(mctx, NULL, &ectx);
|
||||
ret = dst_lib_init2(mctx, ectx, engine,
|
||||
ISC_ENTROPY_BLOCKING | ISC_ENTROPY_GOODONLY);
|
||||
ret = dst_lib_init(mctx, ectx, engine,
|
||||
ISC_ENTROPY_BLOCKING | ISC_ENTROPY_GOODONLY);
|
||||
if (ret != ISC_R_SUCCESS)
|
||||
fatal("could not initialize dst: %s",
|
||||
isc_result_totext(ret));
|
||||
@ -862,15 +862,15 @@ main(int argc, char **argv) {
|
||||
|
||||
if (!quiet && show_progress) {
|
||||
fprintf(stderr, "Generating key pair.");
|
||||
ret = dst_key_generate2(name, alg, size, param, flags,
|
||||
protocol, rdclass, mctx, &key,
|
||||
&progress);
|
||||
ret = dst_key_generate(name, alg, size, param, flags,
|
||||
protocol, rdclass, mctx, &key,
|
||||
&progress);
|
||||
putc('\n', stderr);
|
||||
fflush(stderr);
|
||||
} else {
|
||||
ret = dst_key_generate2(name, alg, size, param, flags,
|
||||
protocol, rdclass, mctx, &key,
|
||||
NULL);
|
||||
ret = dst_key_generate(name, alg, size, param, flags,
|
||||
protocol, rdclass, mctx, &key,
|
||||
NULL);
|
||||
}
|
||||
|
||||
isc_entropy_stopcallbacksources(ectx);
|
||||
|
@ -182,8 +182,8 @@ main(int argc, char **argv) {
|
||||
|
||||
if (ectx == NULL)
|
||||
setup_entropy(mctx, NULL, &ectx);
|
||||
result = dst_lib_init2(mctx, ectx, engine,
|
||||
ISC_ENTROPY_BLOCKING | ISC_ENTROPY_GOODONLY);
|
||||
result = dst_lib_init(mctx, ectx, engine,
|
||||
ISC_ENTROPY_BLOCKING | ISC_ENTROPY_GOODONLY);
|
||||
if (result != ISC_R_SUCCESS)
|
||||
fatal("Could not initialize dst: %s",
|
||||
isc_result_totext(result));
|
||||
|
@ -380,8 +380,8 @@ main(int argc, char **argv) {
|
||||
|
||||
if (ectx == NULL)
|
||||
setup_entropy(mctx, NULL, &ectx);
|
||||
result = dst_lib_init2(mctx, ectx, engine,
|
||||
ISC_ENTROPY_BLOCKING | ISC_ENTROPY_GOODONLY);
|
||||
result = dst_lib_init(mctx, ectx, engine,
|
||||
ISC_ENTROPY_BLOCKING | ISC_ENTROPY_GOODONLY);
|
||||
if (result != ISC_R_SUCCESS)
|
||||
fatal("Could not initialize dst: %s",
|
||||
isc_result_totext(result));
|
||||
|
@ -295,8 +295,8 @@ signwithkey(dns_name_t *name, dns_rdataset_t *rdataset, dst_key_t *key,
|
||||
|
||||
if (tryverify) {
|
||||
result = dns_dnssec_verify(name, rdataset, key,
|
||||
ISC_TRUE, mctx, &trdata);
|
||||
if (result == ISC_R_SUCCESS) {
|
||||
ISC_TRUE, 0, mctx, &trdata, NULL);
|
||||
if (result == ISC_R_SUCCESS || result == DNS_R_FROMWILDCARD) {
|
||||
vbprintf(3, "\tsignature verified\n");
|
||||
INCSTAT(nverified);
|
||||
} else {
|
||||
@ -456,8 +456,9 @@ setverifies(dns_name_t *name, dns_rdataset_t *set, dst_key_t *key,
|
||||
dns_rdata_t *rrsig)
|
||||
{
|
||||
isc_result_t result;
|
||||
result = dns_dnssec_verify(name, set, key, ISC_FALSE, mctx, rrsig);
|
||||
if (result == ISC_R_SUCCESS) {
|
||||
result = dns_dnssec_verify(name, set, key, ISC_FALSE, 0, mctx, rrsig,
|
||||
NULL);
|
||||
if (result == ISC_R_SUCCESS || result == DNS_R_FROMWILDCARD) {
|
||||
INCSTAT(nverified);
|
||||
return (ISC_TRUE);
|
||||
} else {
|
||||
@ -905,7 +906,7 @@ opendb(const char *prefix, dns_name_t *name, dns_rdataclass_t rdclass,
|
||||
rdclass, 0, NULL, dbp);
|
||||
check_result(result, "dns_db_create()");
|
||||
|
||||
result = dns_db_load3(*dbp, filename, inputformat, DNS_MASTER_HINT);
|
||||
result = dns_db_load(*dbp, filename, inputformat, DNS_MASTER_HINT);
|
||||
if (result != ISC_R_SUCCESS && result != DNS_R_SEENINCLUDE)
|
||||
dns_db_detach(dbp);
|
||||
}
|
||||
@ -2470,7 +2471,7 @@ loadzone(char *file, char *origin, dns_rdataclass_t rdclass, dns_db_t **db) {
|
||||
rdclass, 0, NULL, db);
|
||||
check_result(result, "dns_db_create()");
|
||||
|
||||
result = dns_db_load2(*db, file, inputformat);
|
||||
result = dns_db_load(*db, file, inputformat, 0);
|
||||
if (result != ISC_R_SUCCESS && result != DNS_R_SEENINCLUDE)
|
||||
fatal("failed loading zone from '%s': %s",
|
||||
file, isc_result_totext(result));
|
||||
@ -2636,7 +2637,7 @@ build_final_keylist(void) {
|
||||
* Find keys that match this zone in the key repository.
|
||||
*/
|
||||
result = dns_dnssec_findmatchingkeys(gorigin, directory,
|
||||
mctx, &matchkeys);
|
||||
now, mctx, &matchkeys);
|
||||
if (result == ISC_R_NOTFOUND) {
|
||||
result = ISC_R_SUCCESS;
|
||||
}
|
||||
@ -2985,7 +2986,8 @@ writeset(const char *prefix, dns_rdatatype_t type) {
|
||||
check_result(result, "dns_diff_apply");
|
||||
dns_diff_clear(&diff);
|
||||
|
||||
result = dns_master_dump(mctx, db, dbversion, style, filename);
|
||||
result = dns_master_dump(mctx, db, dbversion, style, filename,
|
||||
dns_masterformat_text, NULL);
|
||||
check_result(result, "dns_master_dump");
|
||||
|
||||
isc_mem_put(mctx, filename, filenamelen);
|
||||
@ -3503,7 +3505,7 @@ main(int argc, char *argv[]) {
|
||||
if (!pseudorandom)
|
||||
eflags |= ISC_ENTROPY_GOODONLY;
|
||||
|
||||
result = dst_lib_init2(mctx, ectx, engine, eflags);
|
||||
result = dst_lib_init(mctx, ectx, engine, eflags);
|
||||
if (result != ISC_R_SUCCESS)
|
||||
fatal("could not initialize dst: %s",
|
||||
isc_result_totext(result));
|
||||
@ -3633,8 +3635,8 @@ main(int argc, char *argv[]) {
|
||||
if (output_dnssec_only && set_maxttl)
|
||||
fatal("option -D cannot be used with -M");
|
||||
|
||||
result = dns_master_stylecreate(&dsstyle, DNS_STYLEFLAG_NO_TTL,
|
||||
0, 24, 0, 0, 0, 8, mctx);
|
||||
result = dns_master_stylecreate(&dsstyle, DNS_STYLEFLAG_NO_TTL,
|
||||
0, 24, 0, 0, 0, 8, 0xffffffff, mctx);
|
||||
check_result(result, "dns_master_stylecreate");
|
||||
|
||||
gdb = NULL;
|
||||
@ -3878,9 +3880,9 @@ main(int argc, char *argv[]) {
|
||||
header.flags = DNS_MASTERRAW_SOURCESERIALSET;
|
||||
header.sourceserial = serialnum;
|
||||
}
|
||||
result = dns_master_dumptostream3(mctx, gdb, gversion,
|
||||
masterstyle, outputformat,
|
||||
&header, outfp);
|
||||
result = dns_master_dumptostream(mctx, gdb, gversion,
|
||||
masterstyle, outputformat,
|
||||
&header, outfp);
|
||||
check_result(result, "dns_master_dumptostream3");
|
||||
}
|
||||
|
||||
|
@ -108,7 +108,7 @@ loadzone(char *file, char *origin, dns_rdataclass_t rdclass, dns_db_t **db) {
|
||||
rdclass, 0, NULL, db);
|
||||
check_result(result, "dns_db_create()");
|
||||
|
||||
result = dns_db_load2(*db, file, inputformat);
|
||||
result = dns_db_load(*db, file, inputformat, 0);
|
||||
switch (result) {
|
||||
case DNS_R_SEENINCLUDE:
|
||||
case ISC_R_SUCCESS:
|
||||
@ -281,7 +281,7 @@ main(int argc, char *argv[]) {
|
||||
if (ectx == NULL)
|
||||
setup_entropy(mctx, NULL, &ectx);
|
||||
|
||||
result = dst_lib_init2(mctx, ectx, engine, ISC_ENTROPY_BLOCKING);
|
||||
result = dst_lib_init(mctx, ectx, engine, ISC_ENTROPY_BLOCKING);
|
||||
if (result != ISC_R_SUCCESS)
|
||||
fatal("could not initialize dst: %s",
|
||||
isc_result_totext(result));
|
||||
|
@ -506,6 +506,7 @@ key_collision(dst_key_t *dstkey, dns_name_t *name, const char *dir,
|
||||
dns_secalg_t alg;
|
||||
char filename[ISC_DIR_NAMEMAX];
|
||||
isc_buffer_t fileb;
|
||||
isc_stdtime_t now;
|
||||
|
||||
if (exact != NULL)
|
||||
*exact = ISC_FALSE;
|
||||
@ -529,7 +530,8 @@ key_collision(dst_key_t *dstkey, dns_name_t *name, const char *dir,
|
||||
}
|
||||
|
||||
ISC_LIST_INIT(matchkeys);
|
||||
result = dns_dnssec_findmatchingkeys(name, dir, mctx, &matchkeys);
|
||||
isc_stdtime_get(&now);
|
||||
result = dns_dnssec_findmatchingkeys(name, dir, now, mctx, &matchkeys);
|
||||
if (result == ISC_R_NOTFOUND)
|
||||
return (ISC_FALSE);
|
||||
|
||||
@ -624,10 +626,11 @@ goodsig(dns_name_t *origin, dns_rdata_t *sigrdata, dns_name_t *name,
|
||||
continue;
|
||||
}
|
||||
result = dns_dnssec_verify(name, rdataset, dstkey, ISC_FALSE,
|
||||
mctx, sigrdata);
|
||||
0, mctx, sigrdata, NULL);
|
||||
dst_key_free(&dstkey);
|
||||
if (result == ISC_R_SUCCESS)
|
||||
if (result == ISC_R_SUCCESS || result == DNS_R_FROMWILDCARD) {
|
||||
return(ISC_TRUE);
|
||||
}
|
||||
}
|
||||
return (ISC_FALSE);
|
||||
}
|
||||
|
@ -230,7 +230,8 @@ address_ok(isc_sockaddr_t *sockaddr, dns_acl_t *acl) {
|
||||
|
||||
isc_netaddr_fromsockaddr(&netaddr, sockaddr);
|
||||
|
||||
result = dns_acl_match(&netaddr, NULL, acl, env, &match, NULL);
|
||||
result = dns_acl_match(&netaddr, NULL, NULL, 0, NULL, acl, env, &match,
|
||||
NULL);
|
||||
|
||||
if (result != ISC_R_SUCCESS || match <= 0)
|
||||
return (ISC_FALSE);
|
||||
|
@ -869,8 +869,8 @@ load_view_keys(const cfg_obj_t *keys, const cfg_obj_t *vconfig,
|
||||
* initializing key; that's why 'managed'
|
||||
* is duplicated below.
|
||||
*/
|
||||
CHECK(dns_keytable_add2(secroots, managed,
|
||||
managed, &dstkey));
|
||||
CHECK(dns_keytable_add(secroots, managed,
|
||||
managed, &dstkey));
|
||||
}
|
||||
}
|
||||
|
||||
@ -3350,7 +3350,7 @@ create_empty_zone(dns_zone_t *zone, dns_name_t *name, dns_view_t *view,
|
||||
dns_db_closeversion(db, &version, ISC_TRUE);
|
||||
CHECK(dns_zone_replacedb(zone, db, ISC_FALSE));
|
||||
}
|
||||
dns_zone_setoption2(zone, DNS_ZONEOPT2_AUTOEMPTY, ISC_TRUE);
|
||||
dns_zone_setoption(zone, DNS_ZONEOPT_AUTOEMPTY, ISC_TRUE);
|
||||
dns_zone_setview(zone, view);
|
||||
CHECK(dns_view_addzone(view, zone));
|
||||
|
||||
@ -3615,8 +3615,8 @@ create_mapped_acl(void) {
|
||||
if (result != ISC_R_SUCCESS)
|
||||
return (result);
|
||||
|
||||
result = dns_iptable_addprefix2(acl->iptable, &addr, 96,
|
||||
ISC_TRUE, ISC_FALSE);
|
||||
result = dns_iptable_addprefix(acl->iptable, &addr, 96,
|
||||
ISC_TRUE, ISC_FALSE);
|
||||
if (result == ISC_R_SUCCESS)
|
||||
dns_acl_attach(acl, &named_g_mapped);
|
||||
dns_acl_detach(&acl);
|
||||
@ -4208,10 +4208,10 @@ configure_view(dns_view_t *view, dns_viewlist_t *viewlist,
|
||||
isc_mem_setname(cmctx, "cache", NULL);
|
||||
CHECK(isc_mem_create(0, 0, &hmctx));
|
||||
isc_mem_setname(hmctx, "cache_heap", NULL);
|
||||
CHECK(dns_cache_create3(cmctx, hmctx, named_g_taskmgr,
|
||||
named_g_timermgr, view->rdclass,
|
||||
cachename, "rbt", 0, NULL,
|
||||
&cache));
|
||||
CHECK(dns_cache_create(cmctx, hmctx, named_g_taskmgr,
|
||||
named_g_timermgr, view->rdclass,
|
||||
cachename, "rbt", 0, NULL,
|
||||
&cache));
|
||||
isc_mem_detach(&cmctx);
|
||||
isc_mem_detach(&hmctx);
|
||||
}
|
||||
@ -4229,7 +4229,7 @@ configure_view(dns_view_t *view, dns_viewlist_t *viewlist,
|
||||
ISC_LINK_INIT(nsc, link);
|
||||
ISC_LIST_APPEND(*cachelist, nsc, link);
|
||||
}
|
||||
dns_view_setcache2(view, cache, shared_cache);
|
||||
dns_view_setcache(view, cache, shared_cache);
|
||||
|
||||
/*
|
||||
* cache-file cannot be inherited if views are present, but this
|
||||
@ -5254,7 +5254,7 @@ configure_view(dns_view_t *view, dns_viewlist_t *viewlist,
|
||||
* empty zone for it.
|
||||
*/
|
||||
result = dns_fwdtable_find(view->fwdtable, name,
|
||||
&dnsforwarders);
|
||||
NULL, &dnsforwarders);
|
||||
if (result == ISC_R_SUCCESS &&
|
||||
dnsforwarders->fwdpolicy == dns_fwdpolicy_only)
|
||||
continue;
|
||||
@ -6145,7 +6145,8 @@ add_keydata_zone(dns_view_t *view, const char *directory, isc_mem_t *mctx) {
|
||||
defaultview ? "managed-keys" : view->name,
|
||||
defaultview ? "bind" : "mkeys",
|
||||
filename, sizeof(filename)));
|
||||
CHECK(dns_zone_setfile(zone, filename));
|
||||
CHECK(dns_zone_setfile(zone, filename, dns_masterformat_text,
|
||||
&dns_master_style_default));
|
||||
|
||||
dns_zone_setview(zone, view);
|
||||
dns_zone_settype(zone, dns_zone_key);
|
||||
@ -6266,8 +6267,8 @@ add_listenelt(isc_mem_t *mctx, ns_listenlist_t *list, isc_sockaddr_t *addr,
|
||||
if (result != ISC_R_SUCCESS)
|
||||
return (result);
|
||||
|
||||
result = dns_iptable_addprefix(src_acl->iptable,
|
||||
&netaddr, 128, ISC_TRUE);
|
||||
result = dns_iptable_addprefix(src_acl->iptable, &netaddr,
|
||||
128, ISC_TRUE, ISC_FALSE);
|
||||
if (result != ISC_R_SUCCESS)
|
||||
goto clean;
|
||||
|
||||
@ -6565,9 +6566,9 @@ dotat(dns_keytable_t *keytable, dns_keynode_t *keynode, void *arg) {
|
||||
|
||||
result = dns_resolver_createfetch(view->resolver, tatname,
|
||||
dns_rdatatype_null, NULL, NULL,
|
||||
NULL, 0, tat->task, tat_done, tat,
|
||||
&tat->rdataset, &tat->sigrdataset,
|
||||
&tat->fetch);
|
||||
NULL, NULL, 0, 0, 0, NULL, tat->task,
|
||||
tat_done, tat, &tat->rdataset,
|
||||
&tat->sigrdataset, &tat->fetch);
|
||||
|
||||
if (result != ISC_R_SUCCESS) {
|
||||
isc_task_detach(&tat->task);
|
||||
@ -6819,7 +6820,7 @@ generate_session_key(const char *filename, const char *keynamestr,
|
||||
/* generate key */
|
||||
result = dst_key_generate(keyname, algtype, bits, 1, 0,
|
||||
DNS_KEYPROTO_ANY, dns_rdataclass_in,
|
||||
mctx, &key);
|
||||
mctx, &key, NULL);
|
||||
if (result != ISC_R_SUCCESS)
|
||||
return (result);
|
||||
|
||||
@ -9012,7 +9013,7 @@ load_configuration(const char *filename, named_server_t *server,
|
||||
{
|
||||
dns_view_setviewrevert(view);
|
||||
(void)dns_zt_apply(view->zonetable, ISC_FALSE,
|
||||
removed, view);
|
||||
NULL, removed, view);
|
||||
}
|
||||
dns_view_detach(&view);
|
||||
}
|
||||
@ -9423,8 +9424,8 @@ named_server_create(isc_mem_t *mctx, named_server_t **serverp) {
|
||||
server->in_roothints = NULL;
|
||||
|
||||
/* Must be first. */
|
||||
CHECKFATAL(dst_lib_init2(named_g_mctx, named_g_entropy,
|
||||
named_g_engine, ISC_ENTROPY_GOODONLY),
|
||||
CHECKFATAL(dst_lib_init(named_g_mctx, named_g_entropy,
|
||||
named_g_engine, ISC_ENTROPY_GOODONLY),
|
||||
"initializing DST");
|
||||
|
||||
CHECKFATAL(dns_rootns_create(mctx, dns_rdataclass_in, NULL,
|
||||
@ -10379,7 +10380,7 @@ add_view_tolist(struct dumpcontext *dctx, dns_view_t *view) {
|
||||
ISC_LIST_INIT(vle->zonelist);
|
||||
ISC_LIST_APPEND(dctx->viewlist, vle, link);
|
||||
if (dctx->dumpzones)
|
||||
result = dns_zt_apply(view->zonetable, ISC_TRUE,
|
||||
result = dns_zt_apply(view->zonetable, ISC_TRUE, NULL,
|
||||
add_zone_tolist, dctx);
|
||||
return (result);
|
||||
}
|
||||
@ -10876,7 +10877,7 @@ named_server_validation(named_server_t *server, isc_lex_t *lex,
|
||||
{
|
||||
if (ptr != NULL && strcasecmp(ptr, view->name) != 0)
|
||||
continue;
|
||||
CHECK(dns_view_flushcache(view));
|
||||
CHECK(dns_view_flushcache(view, ISC_FALSE));
|
||||
|
||||
if (set) {
|
||||
view->enablevalidation = enable;
|
||||
@ -10967,7 +10968,7 @@ named_server_flushcache(named_server_t *server, isc_lex_t *lex) {
|
||||
if (ptr != NULL && !nsc->needflush)
|
||||
continue;
|
||||
nsc->needflush = ISC_TRUE;
|
||||
result = dns_view_flushcache2(nsc->primaryview, ISC_FALSE);
|
||||
result = dns_view_flushcache(nsc->primaryview, ISC_FALSE);
|
||||
if (result != ISC_R_SUCCESS) {
|
||||
flushed = ISC_FALSE;
|
||||
isc_log_write(named_g_lctx, NAMED_LOGCATEGORY_GENERAL,
|
||||
@ -10998,7 +10999,7 @@ named_server_flushcache(named_server_t *server, isc_lex_t *lex) {
|
||||
nsc = ISC_LIST_NEXT(nsc, link)) {
|
||||
if (!nsc->needflush || nsc->cache != view->cache)
|
||||
continue;
|
||||
result = dns_view_flushcache2(view, ISC_TRUE);
|
||||
result = dns_view_flushcache(view, ISC_TRUE);
|
||||
if (result != ISC_R_SUCCESS) {
|
||||
flushed = ISC_FALSE;
|
||||
isc_log_write(named_g_lctx,
|
||||
@ -11621,7 +11622,7 @@ named_server_sync(named_server_t *server, isc_lex_t *lex, isc_buffer_t **text) {
|
||||
view != NULL;
|
||||
view = ISC_LIST_NEXT(view, link)) {
|
||||
result = dns_zt_apply(view->zonetable, ISC_FALSE,
|
||||
synczone, &cleanup);
|
||||
NULL, synczone, &cleanup);
|
||||
if (result != ISC_R_SUCCESS &&
|
||||
tresult == ISC_R_SUCCESS)
|
||||
tresult = result;
|
||||
@ -13936,10 +13937,18 @@ named_server_zonestatus(named_server_t *server, isc_lex_t *lex,
|
||||
}
|
||||
|
||||
/* Serial number */
|
||||
serial = dns_zone_getserial(mayberaw);
|
||||
result = dns_zone_getserial(mayberaw, &serial);
|
||||
/* XXXWPK TODO this is to mirror old behavior with dns_zone_getserial */
|
||||
if (result != ISC_R_SUCCESS) {
|
||||
serial = 0;
|
||||
}
|
||||
snprintf(serbuf, sizeof(serbuf), "%u", serial);
|
||||
if (hasraw) {
|
||||
signed_serial = dns_zone_getserial(zone);
|
||||
result = dns_zone_getserial(zone, &signed_serial);
|
||||
/* XXXWPK TODO ut supra */
|
||||
if (result != ISC_R_SUCCESS) {
|
||||
serial = 0;
|
||||
}
|
||||
snprintf(sserbuf, sizeof(sserbuf), "%u", signed_serial);
|
||||
}
|
||||
|
||||
|
@ -100,7 +100,7 @@ user_zonetype( dns_zone_t *zone ) {
|
||||
};
|
||||
const struct zt *tp;
|
||||
|
||||
if ((dns_zone_getoptions2(zone) & DNS_ZONEOPT2_AUTOEMPTY) != 0)
|
||||
if ((dns_zone_getoptions(zone) & DNS_ZONEOPT_AUTOEMPTY) != 0)
|
||||
return ("builtin");
|
||||
|
||||
view = dns_zone_getview(zone);
|
||||
@ -1494,7 +1494,7 @@ zone_xmlrender(dns_zone_t *zone, void *arg) {
|
||||
TRY0(xmlTextWriterEndElement(writer)); /* type */
|
||||
|
||||
TRY0(xmlTextWriterStartElement(writer, ISC_XMLCHAR "serial"));
|
||||
if (dns_zone_getserial2(zone, &serial) == ISC_R_SUCCESS)
|
||||
if (dns_zone_getserial(zone, &serial) == ISC_R_SUCCESS)
|
||||
TRY0(xmlTextWriterWriteFormatString(writer, "%u", serial));
|
||||
else
|
||||
TRY0(xmlTextWriterWriteString(writer, ISC_XMLCHAR "-"));
|
||||
@ -1916,7 +1916,7 @@ generatexml(named_server_t *server, isc_uint32_t flags,
|
||||
TRY0(xmlTextWriterStartElement(writer,
|
||||
ISC_XMLCHAR "zones"));
|
||||
result = dns_zt_apply(view->zonetable, ISC_TRUE,
|
||||
zone_xmlrender, writer);
|
||||
NULL, zone_xmlrender, writer);
|
||||
if (result != ISC_R_SUCCESS)
|
||||
goto error;
|
||||
TRY0(xmlTextWriterEndElement(writer)); /* /zones */
|
||||
@ -2271,7 +2271,7 @@ zone_jsonrender(dns_zone_t *zone, void *arg) {
|
||||
dns_rdataclass_format(rdclass, classbuf, sizeof(classbuf));
|
||||
class_only = classbuf;
|
||||
|
||||
if (dns_zone_getserial2(zone, &serial) != ISC_R_SUCCESS)
|
||||
if (dns_zone_getserial(zone, &serial) != ISC_R_SUCCESS)
|
||||
zoneobj = addzone(zone_name_only, class_only,
|
||||
user_zonetype(zone), 0, ISC_FALSE);
|
||||
else
|
||||
@ -2609,8 +2609,10 @@ generatejson(named_server_t *server, size_t *msglen,
|
||||
CHECKMEM(za);
|
||||
|
||||
if ((flags & STATS_JSON_ZONES) != 0) {
|
||||
result = dns_zt_apply(view->zonetable, ISC_TRUE,
|
||||
zone_jsonrender, za);
|
||||
result = dns_zt_apply(view->zonetable,
|
||||
ISC_TRUE,
|
||||
NULL, zone_jsonrender,
|
||||
za);
|
||||
if (result != ISC_R_SUCCESS) {
|
||||
goto error;
|
||||
}
|
||||
@ -3177,7 +3179,7 @@ client_ok(const isc_sockaddr_t *fromaddr, void *arg) {
|
||||
isc_netaddr_fromsockaddr(&netaddr, fromaddr);
|
||||
|
||||
LOCK(&listener->lock);
|
||||
if (dns_acl_match(&netaddr, NULL, listener->acl, env,
|
||||
if (dns_acl_match(&netaddr, NULL, NULL, 0, NULL, listener->acl, env,
|
||||
&match, NULL) == ISC_R_SUCCESS && match > 0)
|
||||
{
|
||||
UNLOCK(&listener->lock);
|
||||
|
@ -1049,21 +1049,21 @@ named_zone_configure(const cfg_obj_t *config, const cfg_obj_t *vconfig,
|
||||
size_t signedlen = strlen(filename) + sizeof(SIGNED);
|
||||
char *signedname;
|
||||
|
||||
RETERR(dns_zone_setfile3(raw, filename,
|
||||
masterformat, masterstyle));
|
||||
RETERR(dns_zone_setfile(raw, filename,
|
||||
masterformat, masterstyle));
|
||||
signedname = isc_mem_get(mctx, signedlen);
|
||||
if (signedname == NULL)
|
||||
return (ISC_R_NOMEMORY);
|
||||
|
||||
(void)snprintf(signedname, signedlen, "%s" SIGNED, filename);
|
||||
result = dns_zone_setfile3(zone, signedname,
|
||||
dns_masterformat_raw, NULL);
|
||||
result = dns_zone_setfile(zone, signedname,
|
||||
dns_masterformat_raw, NULL);
|
||||
isc_mem_put(mctx, signedname, signedlen);
|
||||
if (result != ISC_R_SUCCESS)
|
||||
return (result);
|
||||
} else
|
||||
RETERR(dns_zone_setfile3(zone, filename,
|
||||
masterformat, masterstyle));
|
||||
RETERR(dns_zone_setfile(zone, filename,
|
||||
masterformat, masterstyle));
|
||||
|
||||
obj = NULL;
|
||||
result = cfg_map_get(zoptions, "journal", &obj);
|
||||
|
@ -989,7 +989,7 @@ setup_system(void) {
|
||||
result = isc_task_onshutdown(global_task, shutdown_program, NULL);
|
||||
check_result(result, "isc_task_onshutdown");
|
||||
|
||||
result = dst_lib_init(gmctx, entropy, 0);
|
||||
result = dst_lib_init(gmctx, entropy, NULL, 0);
|
||||
check_result(result, "dst_lib_init");
|
||||
is_dst_up = ISC_TRUE;
|
||||
|
||||
@ -2493,11 +2493,11 @@ send_update(dns_name_t *zone, isc_sockaddr_t *master) {
|
||||
if (updatemsg->tsigname)
|
||||
updatemsg->tsigname->attributes |= DNS_NAMEATTR_NOCOMPRESS;
|
||||
|
||||
result = dns_request_createvia3(requestmgr, updatemsg, srcaddr,
|
||||
master, options, tsigkey, timeout,
|
||||
udp_timeout, udp_retries, global_task,
|
||||
update_completed, NULL, &request);
|
||||
check_result(result, "dns_request_createvia3");
|
||||
result = dns_request_createvia(requestmgr, updatemsg, srcaddr,
|
||||
master, -1, options, tsigkey, timeout,
|
||||
udp_timeout, udp_retries, global_task,
|
||||
update_completed, NULL, &request);
|
||||
check_result(result, "dns_request_createvia");
|
||||
|
||||
if (debugging)
|
||||
show_message(stdout, updatemsg, "Outgoing update query:");
|
||||
@ -2602,13 +2602,13 @@ recvsoa(isc_task_t *task, isc_event_t *event) {
|
||||
else
|
||||
srcaddr = localaddr4;
|
||||
|
||||
result = dns_request_createvia3(requestmgr, soaquery, srcaddr,
|
||||
addr, 0, NULL,
|
||||
FIND_TIMEOUT * 20,
|
||||
FIND_TIMEOUT, 3,
|
||||
global_task, recvsoa, reqinfo,
|
||||
&request);
|
||||
check_result(result, "dns_request_createvia3");
|
||||
result = dns_request_createvia(requestmgr, soaquery, srcaddr,
|
||||
addr, -1, 0, NULL,
|
||||
FIND_TIMEOUT * 20,
|
||||
FIND_TIMEOUT, 3,
|
||||
global_task, recvsoa, reqinfo,
|
||||
&request);
|
||||
check_result(result, "dns_request_createvia");
|
||||
requests++;
|
||||
return;
|
||||
}
|
||||
@ -2805,11 +2805,11 @@ sendrequest(isc_sockaddr_t *destaddr, dns_message_t *msg,
|
||||
else
|
||||
srcaddr = localaddr4;
|
||||
|
||||
result = dns_request_createvia3(requestmgr, msg, srcaddr, destaddr, 0,
|
||||
default_servers ? NULL : tsigkey,
|
||||
FIND_TIMEOUT * 20, FIND_TIMEOUT, 3,
|
||||
global_task, recvsoa, reqinfo, request);
|
||||
check_result(result, "dns_request_createvia3");
|
||||
result = dns_request_createvia(requestmgr, msg, srcaddr, destaddr, -1,
|
||||
0, default_servers ? NULL : tsigkey,
|
||||
FIND_TIMEOUT * 20, FIND_TIMEOUT, 3,
|
||||
global_task, recvsoa, reqinfo, request);
|
||||
check_result(result, "dns_request_createvia");
|
||||
requests++;
|
||||
}
|
||||
|
||||
@ -3003,11 +3003,11 @@ send_gssrequest(isc_sockaddr_t *destaddr, dns_message_t *msg,
|
||||
else
|
||||
srcaddr = localaddr4;
|
||||
|
||||
result = dns_request_createvia3(requestmgr, msg, srcaddr, destaddr,
|
||||
options, tsigkey, FIND_TIMEOUT * 20,
|
||||
FIND_TIMEOUT, 3, global_task, recvgss,
|
||||
reqinfo, request);
|
||||
check_result(result, "dns_request_createvia3");
|
||||
result = dns_request_createvia(requestmgr, msg, srcaddr, destaddr,
|
||||
-1, options, tsigkey, FIND_TIMEOUT * 20,
|
||||
FIND_TIMEOUT, 3, global_task, recvgss,
|
||||
reqinfo, request);
|
||||
check_result(result, "dns_request_createvia");
|
||||
if (debugging)
|
||||
show_message(stdout, msg, "Outgoing update query:");
|
||||
requests++;
|
||||
|
@ -75,7 +75,7 @@ loadzone(dns_db_t **db, const char *origin, const char *filename) {
|
||||
if (result != ISC_R_SUCCESS)
|
||||
return (result);
|
||||
|
||||
result = dns_db_load(*db, filename);
|
||||
result = dns_db_load(*db, filename, dns_masterformat_text, 0);
|
||||
return (result);
|
||||
}
|
||||
|
||||
@ -101,7 +101,7 @@ main(int argc, char **argv) {
|
||||
CHECK(isc_mem_create(0, 0, &mctx));
|
||||
CHECK(isc_entropy_create(mctx, &ectx));
|
||||
|
||||
CHECK(dst_lib_init(mctx, ectx, ISC_ENTROPY_BLOCKING));
|
||||
CHECK(dst_lib_init(mctx, ectx, NULL, ISC_ENTROPY_BLOCKING));
|
||||
dst_active = ISC_TRUE;
|
||||
|
||||
CHECK(isc_log_create(mctx, &lctx, &logconfig));
|
||||
|
@ -180,10 +180,11 @@ create_view(void) {
|
||||
* Cache.
|
||||
*/
|
||||
cache = NULL;
|
||||
result = dns_cache_create(mctx, taskmgr, timermgr, dns_rdataclass_in,
|
||||
"rbt", 0, NULL, &cache);
|
||||
result = dns_cache_create(mctx, mctx, taskmgr, timermgr,
|
||||
dns_rdataclass_in, "", "rbt", 0, NULL,
|
||||
&cache);
|
||||
check_result(result, "dns_cache_create");
|
||||
dns_view_setcache(view, cache);
|
||||
dns_view_setcache(view, cache, ISC_FALSE);
|
||||
dns_cache_detach(&cache);
|
||||
|
||||
{
|
||||
@ -258,7 +259,8 @@ lookup(const char *target) {
|
||||
options |= DNS_ADBFIND_GLUEOK;
|
||||
result = dns_adb_createfind(adb, t2, lookup_callback, client,
|
||||
&client->name, dns_rootname, 0, options,
|
||||
now, NULL, view->dstport, &client->find);
|
||||
now, NULL, view->dstport, 0, NULL,
|
||||
&client->find);
|
||||
if (result != ISC_R_SUCCESS)
|
||||
printf("DNS_ADB_CREATEFIND -> %s\n", dns_result_totext(result));
|
||||
dns_adb_dumpfind(client->find, stderr);
|
||||
|
@ -132,8 +132,8 @@ main(int argc, char *argv[]) {
|
||||
RUNTIME_CHECK(isc_socketmgr_create(mctx, &socketmgr) == ISC_R_SUCCESS);
|
||||
|
||||
cache = NULL;
|
||||
RUNTIME_CHECK(dns_cache_create(mctx, taskmgr, timermgr,
|
||||
dns_rdataclass_in, "rbt", 0, NULL,
|
||||
RUNTIME_CHECK(dns_cache_create(mctx, mctx, taskmgr, timermgr,
|
||||
dns_rdataclass_in, "", "rbt", 0, NULL,
|
||||
&cache) == ISC_R_SUCCESS);
|
||||
|
||||
view = NULL;
|
||||
@ -205,7 +205,7 @@ main(int argc, char *argv[]) {
|
||||
== ISC_R_SUCCESS);
|
||||
}
|
||||
|
||||
dns_view_setcache(view, cache);
|
||||
dns_view_setcache(view, cache, ISC_FALSE);
|
||||
dns_view_freeze(view);
|
||||
|
||||
dns_cache_detach(&cache);
|
||||
|
@ -120,7 +120,7 @@ do_find(isc_boolean_t want_event) {
|
||||
dns_fixedname_name(&fixed),
|
||||
dns_rootname, 0, options, 0,
|
||||
dns_fixedname_name(&target), 0,
|
||||
&find);
|
||||
0, NULL, &find);
|
||||
if (result == ISC_R_SUCCESS) {
|
||||
if (!ISC_LIST_EMPTY(find->list)) {
|
||||
/*
|
||||
@ -250,8 +250,8 @@ main(int argc, char *argv[]) {
|
||||
RUNTIME_CHECK(isc_socketmgr_create(mctx, &socketmgr) == ISC_R_SUCCESS);
|
||||
|
||||
cache = NULL;
|
||||
RUNTIME_CHECK(dns_cache_create(mctx, taskmgr, timermgr,
|
||||
dns_rdataclass_in, "rbt", 0, NULL,
|
||||
RUNTIME_CHECK(dns_cache_create(mctx, mctx, taskmgr, timermgr,
|
||||
dns_rdataclass_in, "", "rbt", 0, NULL,
|
||||
&cache) == ISC_R_SUCCESS);
|
||||
|
||||
view = NULL;
|
||||
@ -322,7 +322,7 @@ main(int argc, char *argv[]) {
|
||||
== ISC_R_SUCCESS);
|
||||
}
|
||||
|
||||
dns_view_setcache(view, cache);
|
||||
dns_view_setcache(view, cache, ISC_FALSE);
|
||||
dns_view_freeze(view);
|
||||
|
||||
dns_cache_detach(&cache);
|
||||
|
@ -274,7 +274,7 @@ load(const char *filename, const char *origintext, isc_boolean_t cache) {
|
||||
}
|
||||
|
||||
printf("loading %s (%s)\n", filename, origintext);
|
||||
result = dns_db_load(dbi->db, filename);
|
||||
result = dns_db_load(dbi->db, filename, dns_masterformat_text, 0);
|
||||
if (result != ISC_R_SUCCESS && result != DNS_R_SEENINCLUDE) {
|
||||
dns_db_detach(&dbi->db);
|
||||
isc_mem_put(mctx, dbi, sizeof(*dbi));
|
||||
|
@ -52,8 +52,8 @@ use(dst_key_t *key, isc_mem_t *mctx) {
|
||||
isc_buffer_add(&databuf, strlen(data));
|
||||
isc_buffer_usedregion(&databuf, &datareg);
|
||||
|
||||
ret = dst_context_create3(key, mctx,
|
||||
DNS_LOGCATEGORY_GENERAL, ISC_TRUE, &ctx);
|
||||
ret = dst_context_create(key, mctx,
|
||||
DNS_LOGCATEGORY_GENERAL, ISC_TRUE, 0, &ctx);
|
||||
if (ret != ISC_R_SUCCESS) {
|
||||
printf("contextcreate(%u) returned: %s\n", dst_key_alg(key),
|
||||
isc_result_totext(ret));
|
||||
@ -73,8 +73,8 @@ use(dst_key_t *key, isc_mem_t *mctx) {
|
||||
|
||||
isc_buffer_forward(&sigbuf, 1);
|
||||
isc_buffer_remainingregion(&sigbuf, &sigreg);
|
||||
ret = dst_context_create3(key, mctx,
|
||||
DNS_LOGCATEGORY_GENERAL, ISC_FALSE, &ctx);
|
||||
ret = dst_context_create(key, mctx,
|
||||
DNS_LOGCATEGORY_GENERAL, ISC_FALSE, 0, &ctx);
|
||||
if (ret != ISC_R_SUCCESS) {
|
||||
printf("contextcreate(%u) returned: %s\n", dst_key_alg(key),
|
||||
isc_result_totext(ret));
|
||||
@ -214,7 +214,7 @@ generate(int alg, isc_mem_t *mctx) {
|
||||
dst_key_t *key = NULL;
|
||||
|
||||
ret = dst_key_generate(dns_rootname, alg, 512, 0, 0, 0,
|
||||
dns_rdataclass_in, mctx, &key);
|
||||
dns_rdataclass_in, mctx, &key, NULL);
|
||||
printf("generate(%d) returned: %s\n", alg, isc_result_totext(ret));
|
||||
if (ret != ISC_R_SUCCESS)
|
||||
return;
|
||||
@ -254,7 +254,8 @@ main(void) {
|
||||
result = isc_entropy_createfilesource(ectx, "randomfile");
|
||||
if (result != ISC_R_SUCCESS)
|
||||
return (1);
|
||||
dst_lib_init(mctx, ectx, ISC_ENTROPY_BLOCKING|ISC_ENTROPY_GOODONLY);
|
||||
dst_lib_init(mctx, ectx, NULL,
|
||||
ISC_ENTROPY_BLOCKING|ISC_ENTROPY_GOODONLY);
|
||||
|
||||
dns_fixedname_init(&fname);
|
||||
name = dns_fixedname_name(&fname);
|
||||
|
@ -475,7 +475,7 @@ main(int argc, char *argv[]) {
|
||||
RUNCHECK(isc_entropy_create(mctx, &ectx));
|
||||
RUNCHECK(isc_entropy_createfilesource(ectx, "/dev/urandom"));
|
||||
|
||||
RUNCHECK(dst_lib_init(mctx, ectx, ISC_ENTROPY_GOODONLY));
|
||||
RUNCHECK(dst_lib_init(mctx, ectx, NULL, ISC_ENTROPY_GOODONLY));
|
||||
|
||||
taskmgr = NULL;
|
||||
RUNCHECK(isc_taskmgr_create(mctx, 1, 0, &taskmgr));
|
||||
|
@ -79,8 +79,9 @@ main(int argc, char *argv[]) {
|
||||
callbacks.add = print_dataset;
|
||||
|
||||
result = dns_master_loadfile(argv[1], &origin, &origin,
|
||||
dns_rdataclass_in, 0,
|
||||
&callbacks, mctx);
|
||||
dns_rdataclass_in, 0, 0,
|
||||
&callbacks, NULL, NULL, mctx,
|
||||
dns_masterformat_text, 0);
|
||||
fprintf(stdout, "dns_master_loadfile: %s\n",
|
||||
dns_result_totext(result));
|
||||
}
|
||||
|
@ -138,7 +138,7 @@ nsecify(char *filename) {
|
||||
result = dns_db_create(mctx, "rbt", name, dns_dbtype_zone,
|
||||
dns_rdataclass_in, 0, NULL, &db);
|
||||
check_result(result, "dns_db_create()");
|
||||
result = dns_db_load(db, filename);
|
||||
result = dns_db_load(db, filename, dns_masterformat_text, 0);
|
||||
if (result == DNS_R_SEENINCLUDE)
|
||||
result = ISC_R_SUCCESS;
|
||||
check_result(result, "dns_db_load()");
|
||||
|
@ -225,7 +225,7 @@ main(int argc, char *argv[]) {
|
||||
}
|
||||
|
||||
RUNTIME_CHECK(isc_entropy_create(mctx, &ent) == ISC_R_SUCCESS);
|
||||
RUNTIME_CHECK(dst_lib_init(mctx, ent, 0) == ISC_R_SUCCESS);
|
||||
RUNTIME_CHECK(dst_lib_init(mctx, ent, NULL, 0) == ISC_R_SUCCESS);
|
||||
|
||||
dns_result_register();
|
||||
dst_result_register();
|
||||
|
@ -107,7 +107,8 @@ setup(const char *zonename, const char *filename, const char *classname) {
|
||||
result = dns_zone_setdbtype(zone, 1, &rbt);
|
||||
ERRRET(result, "dns_zone_setdatabase");
|
||||
|
||||
result = dns_zone_setfile(zone, filename);
|
||||
result = dns_zone_setfile(zone, filename, dns_masterformat_text,
|
||||
&dns_master_style_default);
|
||||
ERRRET(result, "dns_zone_setfile");
|
||||
|
||||
region.base = classname;
|
||||
@ -190,7 +191,9 @@ query(void) {
|
||||
if (s != NULL)
|
||||
*s = '\0';
|
||||
if (strcmp(buf, "dump") == 0) {
|
||||
dns_zone_dumptostream(zone, stdout);
|
||||
dns_zone_dumptostream(zone, stdout,
|
||||
dns_masterformat_text,
|
||||
&dns_master_style_default, 0);
|
||||
continue;
|
||||
}
|
||||
if (strlen(buf) == 0U)
|
||||
|
@ -119,7 +119,7 @@ syncptr_find_zone(sample_instance_t *inst, dns_rdata_t *rdata,
|
||||
* @example
|
||||
* 192.168.0.1 -> 1.0.168.192.in-addr.arpa
|
||||
*/
|
||||
CHECK(dns_byaddr_createptrname2(&isc_ip, 0, name));
|
||||
CHECK(dns_byaddr_createptrname(&isc_ip, 0, name));
|
||||
|
||||
/* Find a zone containing owner name of the PTR record. */
|
||||
result = dns_zt_find(inst->view->zonetable, name, 0, NULL, zone);
|
||||
|
@ -154,7 +154,7 @@ load_zone(dns_zone_t *zone) {
|
||||
goto cleanup;
|
||||
zone_dynamic = (result == DNS_R_DYNAMIC);
|
||||
|
||||
CHECK(dns_zone_getserial2(zone, &serial));
|
||||
CHECK(dns_zone_getserial(zone, &serial));
|
||||
dns_zone_log(zone, ISC_LOG_INFO, "loaded serial %u", serial);
|
||||
|
||||
if (zone_dynamic)
|
||||
|
@ -177,8 +177,10 @@ sendquery(isc_task_t *task) {
|
||||
request = NULL;
|
||||
result = dns_request_createvia(requestmgr, message,
|
||||
have_src ? &srcaddr : NULL, &dstaddr,
|
||||
DNS_REQUESTOPT_TCP|DNS_REQUESTOPT_SHARE,
|
||||
NULL, TIMEOUT, task, recvresponse,
|
||||
-1,
|
||||
DNS_REQUESTOPT_TCP |
|
||||
DNS_REQUESTOPT_SHARE,
|
||||
NULL, TIMEOUT, 0, 0, task, recvresponse,
|
||||
message, &request);
|
||||
CHECK("dns_request_create", result);
|
||||
|
||||
@ -284,7 +286,7 @@ main(int argc, char *argv[]) {
|
||||
if (randomfile != NULL)
|
||||
RUNCHECK(isc_entropy_createfilesource(ectx, randomfile));
|
||||
|
||||
RUNCHECK(dst_lib_init(mctx, ectx, ISC_ENTROPY_GOODONLY));
|
||||
RUNCHECK(dst_lib_init(mctx, ectx, NULL, ISC_ENTROPY_GOODONLY));
|
||||
|
||||
taskmgr = NULL;
|
||||
RUNCHECK(isc_taskmgr_create(mctx, 1, 0, &taskmgr));
|
||||
|
@ -192,7 +192,7 @@ main(int argc, char **argv) {
|
||||
"../random.data",
|
||||
ISC_ENTROPY_KEYBOARDNO),
|
||||
"isc_entropy_usebestsource(\"../random.data\")");
|
||||
CHECK(dst_lib_init2(mctx, ectx, NULL, 0), "dst_lib_init2()");
|
||||
CHECK(dst_lib_init(mctx, ectx, NULL, 0), "dst_lib_init()");
|
||||
CHECK(isc_log_create(mctx, &log_, &logconfig), "isc_log_create()");
|
||||
isc_log_setcontext(log_);
|
||||
dns_log_init(log_);
|
||||
|
@ -264,7 +264,7 @@ main(int argc, char *argv[]) {
|
||||
logconfig = NULL;
|
||||
RUNCHECK(isc_log_create(mctx, &log, &logconfig));
|
||||
|
||||
RUNCHECK(dst_lib_init(mctx, ectx, ISC_ENTROPY_GOODONLY));
|
||||
RUNCHECK(dst_lib_init(mctx, ectx, NULL, ISC_ENTROPY_GOODONLY));
|
||||
|
||||
taskmgr = NULL;
|
||||
RUNCHECK(isc_taskmgr_create(mctx, 1, 0, &taskmgr));
|
||||
|
@ -195,7 +195,7 @@ main(int argc, char **argv) {
|
||||
logconfig = NULL;
|
||||
RUNCHECK(isc_log_create(mctx, &log, &logconfig));
|
||||
|
||||
RUNCHECK(dst_lib_init(mctx, ectx, ISC_ENTROPY_GOODONLY));
|
||||
RUNCHECK(dst_lib_init(mctx, ectx, NULL, ISC_ENTROPY_GOODONLY));
|
||||
|
||||
taskmgr = NULL;
|
||||
RUNCHECK(isc_taskmgr_create(mctx, 1, 0, &taskmgr));
|
||||
|
@ -268,17 +268,17 @@ recvresponse(isc_task_t *task, isc_event_t *event) {
|
||||
styleflags |= DNS_STYLEFLAG_RRCOMMENT;
|
||||
}
|
||||
if (display_multiline || (!display_ttl && !display_class))
|
||||
result = dns_master_stylecreate2(&style, styleflags,
|
||||
24, 24, 24, 32, 80, 8,
|
||||
display_splitwidth, mctx);
|
||||
result = dns_master_stylecreate(&style, styleflags,
|
||||
24, 24, 24, 32, 80, 8,
|
||||
display_splitwidth, mctx);
|
||||
else if (!display_ttl || !display_class)
|
||||
result = dns_master_stylecreate2(&style, styleflags,
|
||||
24, 24, 32, 40, 80, 8,
|
||||
display_splitwidth, mctx);
|
||||
result = dns_master_stylecreate(&style, styleflags,
|
||||
24, 24, 32, 40, 80, 8,
|
||||
display_splitwidth, mctx);
|
||||
else
|
||||
result = dns_master_stylecreate2(&style, styleflags,
|
||||
24, 32, 40, 48, 80, 8,
|
||||
display_splitwidth, mctx);
|
||||
result = dns_master_stylecreate(&style, styleflags,
|
||||
24, 32, 40, 48, 80, 8,
|
||||
display_splitwidth, mctx);
|
||||
CHECK("dns_master_stylecreate2", result);
|
||||
|
||||
flags = 0;
|
||||
@ -684,12 +684,12 @@ sendquery(struct query *query, isc_task_t *task)
|
||||
if (tcp_mode)
|
||||
options |= DNS_REQUESTOPT_TCP | DNS_REQUESTOPT_SHARE;
|
||||
request = NULL;
|
||||
result = dns_request_createvia4(requestmgr, message,
|
||||
have_src ? &srcaddr : NULL, &dstaddr,
|
||||
dscp, options, NULL,
|
||||
query->timeout, query->udptimeout,
|
||||
query->udpretries, task,
|
||||
recvresponse, message, &request);
|
||||
result = dns_request_createvia(requestmgr, message,
|
||||
have_src ? &srcaddr : NULL, &dstaddr,
|
||||
dscp, options, NULL,
|
||||
query->timeout, query->udptimeout,
|
||||
query->udpretries, task,
|
||||
recvresponse, message, &request);
|
||||
CHECK("dns_request_createvia4", result);
|
||||
|
||||
return ISC_R_SUCCESS;
|
||||
@ -1004,7 +1004,7 @@ get_reverse(char *reverse, size_t len, const char *value,
|
||||
options |= DNS_BYADDROPT_IPV6INT;
|
||||
dns_fixedname_init(&fname);
|
||||
name = dns_fixedname_name(&fname);
|
||||
result = dns_byaddr_createptrname2(&addr, options, name);
|
||||
result = dns_byaddr_createptrname(&addr, options, name);
|
||||
CHECK("dns_byaddr_createptrname2", result);
|
||||
dns_name_format(name, reverse, (unsigned int)len);
|
||||
return;
|
||||
@ -1934,7 +1934,7 @@ main(int argc, char *argv[]) {
|
||||
|
||||
ectx = NULL;
|
||||
RUNCHECK(isc_entropy_create(mctx, &ectx));
|
||||
RUNCHECK(dst_lib_init(mctx, ectx, ISC_ENTROPY_GOODONLY));
|
||||
RUNCHECK(dst_lib_init(mctx, ectx, NULL, ISC_ENTROPY_GOODONLY));
|
||||
RUNCHECK(isc_entropy_getdata(ectx, cookie_secret,
|
||||
sizeof(cookie_secret), NULL, 0));
|
||||
|
||||
|
@ -77,7 +77,7 @@ bdb_putrdata(DB *db, dns_name_t *name, dns_ttl_t ttl, dns_rdata_t *rdata)
|
||||
|
||||
isc_buffer_init(&databuf, rdatatext, MAX_RDATATEXT);
|
||||
|
||||
dns_ttl_totext(ttl, ISC_FALSE, &databuf);
|
||||
dns_ttl_totext(ttl, ISC_FALSE, ISC_TRUE, &databuf);
|
||||
*(char *)isc_buffer_used(&databuf) = ' ';
|
||||
isc_buffer_add(&databuf, 1);
|
||||
|
||||
@ -142,7 +142,8 @@ main(int argc, char *argv[])
|
||||
dns_dbtype_zone, dns_rdataclass_in, 0, NULL,
|
||||
&db) == ISC_R_SUCCESS);
|
||||
|
||||
REQUIRE(dns_db_load(db, argv[2]) == ISC_R_SUCCESS);
|
||||
REQUIRE(dns_db_load(db, argv[2], dns_masterformat_text, 0)
|
||||
== ISC_R_SUCCESS);
|
||||
|
||||
REQUIRE(dns_db_createiterator(db, 0, &dbiter) == ISC_R_SUCCESS);
|
||||
|
||||
|
@ -228,7 +228,7 @@ main (int argc, char **argv)
|
||||
dns_rdataclass_in, 0, NULL, &db);
|
||||
isc_result_check (result, "dns_db_create");
|
||||
|
||||
result = dns_db_load (db, zonefile);
|
||||
result = dns_db_load(db, zonefile, dns_masterformat_text, 0);
|
||||
isc_result_check (result, "Check Zone Syntax: dns_db_load");
|
||||
|
||||
result = dns_db_createiterator (db, 0, &dbit);
|
||||
|
@ -173,7 +173,7 @@ main(int argc, char **argv) {
|
||||
dns_rdataclass_in, 0, NULL, &db);
|
||||
check_result(result, "dns_db_create");
|
||||
|
||||
result = dns_db_load(db, zonefile);
|
||||
result = dns_db_load(db, zonefile, dns_masterformat_text, 0);
|
||||
if (result == DNS_R_SEENINCLUDE)
|
||||
result = ISC_R_SUCCESS;
|
||||
check_result(result, "dns_db_load");
|
||||
|
@ -182,7 +182,7 @@ main(int argc, char *argv[])
|
||||
dns_rdataclass_in, 0, NULL, &db);
|
||||
check_result(result, "dns_db_create");
|
||||
|
||||
result = dns_db_load(db, zonefile);
|
||||
result = dns_db_load(db, zonefile, dns_masterformat_text, 0);
|
||||
if (result == DNS_R_SEENINCLUDE)
|
||||
result = ISC_R_SUCCESS;
|
||||
check_result(result, "dns_db_load");
|
||||
|
@ -100,7 +100,8 @@ dns_acl_anyornone(isc_mem_t *mctx, isc_boolean_t neg, dns_acl_t **target) {
|
||||
if (result != ISC_R_SUCCESS)
|
||||
return (result);
|
||||
|
||||
result = dns_iptable_addprefix(acl->iptable, NULL, 0, ISC_TF(!neg));
|
||||
result = dns_iptable_addprefix(acl->iptable, NULL, 0, ISC_TF(!neg),
|
||||
ISC_FALSE);
|
||||
if (result != ISC_R_SUCCESS) {
|
||||
dns_acl_detach(&acl);
|
||||
return (result);
|
||||
@ -178,28 +179,17 @@ dns_acl_isnone(dns_acl_t *acl)
|
||||
* return with a positive value in match; for a match with a negated ACL
|
||||
* element or radix entry, return with a negative value in match.
|
||||
*/
|
||||
|
||||
isc_result_t
|
||||
dns_acl_match(const isc_netaddr_t *reqaddr,
|
||||
const dns_name_t *reqsigner,
|
||||
const isc_netaddr_t *ecs,
|
||||
isc_uint8_t ecslen,
|
||||
isc_uint8_t *scope,
|
||||
const dns_acl_t *acl,
|
||||
const dns_aclenv_t *env,
|
||||
int *match,
|
||||
const dns_aclelement_t **matchelt)
|
||||
{
|
||||
return (dns_acl_match2(reqaddr, reqsigner, NULL, 0, NULL, acl, env,
|
||||
match, matchelt));
|
||||
}
|
||||
|
||||
isc_result_t
|
||||
dns_acl_match2(const isc_netaddr_t *reqaddr,
|
||||
const dns_name_t *reqsigner,
|
||||
const isc_netaddr_t *ecs,
|
||||
isc_uint8_t ecslen,
|
||||
isc_uint8_t *scope,
|
||||
const dns_acl_t *acl,
|
||||
const dns_aclenv_t *env,
|
||||
int *match,
|
||||
const dns_aclelement_t **matchelt)
|
||||
{
|
||||
isc_uint16_t bitlen;
|
||||
isc_prefix_t pfx;
|
||||
@ -290,8 +280,8 @@ dns_acl_match2(const isc_netaddr_t *reqaddr,
|
||||
break;
|
||||
}
|
||||
|
||||
if (dns_aclelement_match2(reqaddr, reqsigner, ecs, ecslen,
|
||||
scope, e, env, matchelt))
|
||||
if (dns_aclelement_match(reqaddr, reqsigner, ecs, ecslen,
|
||||
scope, e, env, matchelt))
|
||||
{
|
||||
if (match_num == -1 || e->node_num < match_num) {
|
||||
if (e->negative)
|
||||
@ -424,26 +414,16 @@ dns_acl_merge(dns_acl_t *dest, dns_acl_t *source, isc_boolean_t pos)
|
||||
* a reference to a named ACL or a nested ACL, a matching element
|
||||
* returned through 'matchelt' is not necessarily 'e' itself.
|
||||
*/
|
||||
|
||||
isc_boolean_t
|
||||
dns_aclelement_match(const isc_netaddr_t *reqaddr,
|
||||
const dns_name_t *reqsigner,
|
||||
const isc_netaddr_t *ecs,
|
||||
isc_uint8_t ecslen,
|
||||
isc_uint8_t *scope,
|
||||
const dns_aclelement_t *e,
|
||||
const dns_aclenv_t *env,
|
||||
const dns_aclelement_t **matchelt)
|
||||
{
|
||||
return (dns_aclelement_match2(reqaddr, reqsigner, NULL, 0, NULL,
|
||||
e, env, matchelt));
|
||||
}
|
||||
|
||||
isc_boolean_t
|
||||
dns_aclelement_match2(const isc_netaddr_t *reqaddr,
|
||||
const dns_name_t *reqsigner,
|
||||
const isc_netaddr_t *ecs,
|
||||
isc_uint8_t ecslen,
|
||||
isc_uint8_t *scope,
|
||||
const dns_aclelement_t *e,
|
||||
const dns_aclenv_t *env,
|
||||
const dns_aclelement_t **matchelt)
|
||||
{
|
||||
dns_acl_t *inner = NULL;
|
||||
int indirectmatch;
|
||||
@ -493,8 +473,8 @@ dns_aclelement_match2(const isc_netaddr_t *reqaddr,
|
||||
INSIST(0);
|
||||
}
|
||||
|
||||
result = dns_acl_match2(reqaddr, reqsigner, ecs, ecslen, scope,
|
||||
inner, env, &indirectmatch, matchelt);
|
||||
result = dns_acl_match(reqaddr, reqsigner, ecs, ecslen, scope,
|
||||
inner, env, &indirectmatch, matchelt);
|
||||
INSIST(result == ISC_R_SUCCESS);
|
||||
|
||||
/*
|
||||
@ -687,8 +667,8 @@ dns_acl_allowed(isc_netaddr_t *addr, dns_name_t *signer,
|
||||
|
||||
if (acl == NULL)
|
||||
return (ISC_TRUE);
|
||||
result = dns_acl_match2(addr, signer, ecs_addr, ecs_addrlen,
|
||||
ecs_scope, acl, aclenv, &match, NULL);
|
||||
result = dns_acl_match(addr, signer, ecs_addr, ecs_addrlen,
|
||||
ecs_scope, acl, aclenv, &match, NULL);
|
||||
if (result == ISC_R_SUCCESS && match > 0)
|
||||
return (ISC_TRUE);
|
||||
return (ISC_FALSE);
|
||||
|
@ -2937,20 +2937,8 @@ dns_adb_createfind(dns_adb_t *adb, isc_task_t *task, isc_taskaction_t action,
|
||||
void *arg, const dns_name_t *name, const dns_name_t *qname,
|
||||
dns_rdatatype_t qtype, unsigned int options,
|
||||
isc_stdtime_t now, dns_name_t *target,
|
||||
in_port_t port, dns_adbfind_t **findp)
|
||||
{
|
||||
return (dns_adb_createfind2(adb, task, action, arg, name,
|
||||
qname, qtype, options, now,
|
||||
target, port, 0, NULL, findp));
|
||||
}
|
||||
|
||||
isc_result_t
|
||||
dns_adb_createfind2(dns_adb_t *adb, isc_task_t *task, isc_taskaction_t action,
|
||||
void *arg, const dns_name_t *name, const dns_name_t *qname,
|
||||
dns_rdatatype_t qtype, unsigned int options,
|
||||
isc_stdtime_t now, dns_name_t *target,
|
||||
in_port_t port, unsigned int depth, isc_counter_t *qc,
|
||||
dns_adbfind_t **findp)
|
||||
in_port_t port, unsigned int depth, isc_counter_t *qc,
|
||||
dns_adbfind_t **findp)
|
||||
{
|
||||
dns_adbfind_t *find;
|
||||
dns_adbname_t *adbname;
|
||||
@ -3712,12 +3700,12 @@ dbfind_name(dns_adbname_t *adbname, isc_stdtime_t now, dns_rdatatype_t rdtype)
|
||||
* matching static-stub zone without looking into the cache to honor
|
||||
* the configuration on which server we should send queries to.
|
||||
*/
|
||||
result = dns_view_find2(adb->view, &adbname->name, rdtype, now,
|
||||
NAME_GLUEOK(adbname) ? DNS_DBFIND_GLUEOK : 0,
|
||||
ISC_TF(NAME_HINTOK(adbname)),
|
||||
(adbname->flags & NAME_STARTATZONE) != 0 ?
|
||||
ISC_TRUE : ISC_FALSE,
|
||||
NULL, NULL, fname, &rdataset, NULL);
|
||||
result = dns_view_find(adb->view, &adbname->name, rdtype, now,
|
||||
NAME_GLUEOK(adbname) ? DNS_DBFIND_GLUEOK : 0,
|
||||
ISC_TF(NAME_HINTOK(adbname)),
|
||||
(adbname->flags & NAME_STARTATZONE) != 0 ?
|
||||
ISC_TRUE : ISC_FALSE,
|
||||
NULL, NULL, fname, &rdataset, NULL);
|
||||
|
||||
/* XXXVIX this switch statement is too sparse to gen a jump table. */
|
||||
switch (result) {
|
||||
@ -4039,9 +4027,9 @@ fetch_name(dns_adbname_t *adbname, isc_boolean_t start_at_zone,
|
||||
adbname);
|
||||
dns_fixedname_init(&fixed);
|
||||
name = dns_fixedname_name(&fixed);
|
||||
result = dns_view_findzonecut2(adb->view, &adbname->name, name,
|
||||
0, 0, ISC_TRUE, ISC_FALSE,
|
||||
&rdataset, NULL);
|
||||
result = dns_view_findzonecut(adb->view, &adbname->name, name,
|
||||
0, 0, ISC_TRUE, ISC_FALSE,
|
||||
&rdataset, NULL);
|
||||
if (result != ISC_R_SUCCESS && result != DNS_R_HINT)
|
||||
goto cleanup;
|
||||
nameservers = &rdataset;
|
||||
@ -4055,12 +4043,12 @@ fetch_name(dns_adbname_t *adbname, isc_boolean_t start_at_zone,
|
||||
}
|
||||
fetch->depth = depth;
|
||||
|
||||
result = dns_resolver_createfetch3(adb->view->resolver, &adbname->name,
|
||||
type, name, nameservers, NULL,
|
||||
NULL, 0, options, depth, qc,
|
||||
adb->task, fetch_callback, adbname,
|
||||
&fetch->rdataset, NULL,
|
||||
&fetch->fetch);
|
||||
result = dns_resolver_createfetch(adb->view->resolver, &adbname->name,
|
||||
type, name, nameservers, NULL,
|
||||
NULL, 0, options, depth, qc,
|
||||
adb->task, fetch_callback, adbname,
|
||||
&fetch->rdataset, NULL,
|
||||
&fetch->fetch);
|
||||
if (result != ISC_R_SUCCESS)
|
||||
goto cleanup;
|
||||
|
||||
@ -4481,12 +4469,7 @@ dns_adb_getudpsize(dns_adb_t *adb, dns_adbaddrinfo_t *addr) {
|
||||
}
|
||||
|
||||
unsigned int
|
||||
dns_adb_probesize(dns_adb_t *adb, dns_adbaddrinfo_t *addr) {
|
||||
return dns_adb_probesize2(adb, addr, 0);
|
||||
}
|
||||
|
||||
unsigned int
|
||||
dns_adb_probesize2(dns_adb_t *adb, dns_adbaddrinfo_t *addr, int lookups) {
|
||||
dns_adb_probesize(dns_adb_t *adb, dns_adbaddrinfo_t *addr, int lookups) {
|
||||
int bucket;
|
||||
unsigned int size;
|
||||
|
||||
|
@ -43,21 +43,8 @@ static char hex_digits[] = {
|
||||
};
|
||||
|
||||
isc_result_t
|
||||
dns_byaddr_createptrname(const isc_netaddr_t *address, isc_boolean_t nibble,
|
||||
dns_byaddr_createptrname(const isc_netaddr_t *address, unsigned int options,
|
||||
dns_name_t *name)
|
||||
{
|
||||
/*
|
||||
* We dropped bitstring labels, so all lookups will use nibbles.
|
||||
*/
|
||||
UNUSED(nibble);
|
||||
|
||||
return (dns_byaddr_createptrname2(address,
|
||||
DNS_BYADDROPT_IPV6INT, name));
|
||||
}
|
||||
|
||||
isc_result_t
|
||||
dns_byaddr_createptrname2(const isc_netaddr_t *address, unsigned int options,
|
||||
dns_name_t *name)
|
||||
{
|
||||
char textname[128];
|
||||
const unsigned char *bytes;
|
||||
@ -245,8 +232,8 @@ dns_byaddr_create(isc_mem_t *mctx, const isc_netaddr_t *address,
|
||||
|
||||
dns_fixedname_init(&byaddr->name);
|
||||
|
||||
result = dns_byaddr_createptrname2(address, options,
|
||||
dns_fixedname_name(&byaddr->name));
|
||||
result = dns_byaddr_createptrname(address, options,
|
||||
dns_fixedname_name(&byaddr->name));
|
||||
if (result != ISC_R_SUCCESS)
|
||||
goto cleanup_lock;
|
||||
|
||||
|
@ -176,31 +176,10 @@ cache_create_db(dns_cache_t *cache, dns_db_t **db) {
|
||||
}
|
||||
|
||||
isc_result_t
|
||||
dns_cache_create(isc_mem_t *cmctx, isc_taskmgr_t *taskmgr,
|
||||
dns_cache_create(isc_mem_t *cmctx, isc_mem_t *hmctx, isc_taskmgr_t *taskmgr,
|
||||
isc_timermgr_t *timermgr, dns_rdataclass_t rdclass,
|
||||
const char *db_type, unsigned int db_argc, char **db_argv,
|
||||
dns_cache_t **cachep)
|
||||
{
|
||||
return (dns_cache_create3(cmctx, cmctx, taskmgr, timermgr, rdclass, "",
|
||||
db_type, db_argc, db_argv, cachep));
|
||||
}
|
||||
|
||||
isc_result_t
|
||||
dns_cache_create2(isc_mem_t *cmctx, isc_taskmgr_t *taskmgr,
|
||||
isc_timermgr_t *timermgr, dns_rdataclass_t rdclass,
|
||||
const char *cachename, const char *db_type,
|
||||
unsigned int db_argc, char **db_argv, dns_cache_t **cachep)
|
||||
{
|
||||
return (dns_cache_create3(cmctx, cmctx, taskmgr, timermgr, rdclass,
|
||||
cachename, db_type, db_argc, db_argv,
|
||||
cachep));
|
||||
}
|
||||
|
||||
isc_result_t
|
||||
dns_cache_create3(isc_mem_t *cmctx, isc_mem_t *hmctx, isc_taskmgr_t *taskmgr,
|
||||
isc_timermgr_t *timermgr, dns_rdataclass_t rdclass,
|
||||
const char *cachename, const char *db_type,
|
||||
unsigned int db_argc, char **db_argv, dns_cache_t **cachep)
|
||||
const char *cachename, const char *db_type,
|
||||
unsigned int db_argc, char **db_argv, dns_cache_t **cachep)
|
||||
{
|
||||
isc_result_t result;
|
||||
dns_cache_t *cache;
|
||||
@ -521,7 +500,8 @@ dns_cache_load(dns_cache_t *cache) {
|
||||
return (ISC_R_SUCCESS);
|
||||
|
||||
LOCK(&cache->filelock);
|
||||
result = dns_db_load(cache->db, cache->filename);
|
||||
result = dns_db_load(cache->db, cache->filename,
|
||||
dns_masterformat_text, 0);
|
||||
UNLOCK(&cache->filelock);
|
||||
|
||||
return (result);
|
||||
@ -538,7 +518,8 @@ dns_cache_dump(dns_cache_t *cache) {
|
||||
|
||||
LOCK(&cache->filelock);
|
||||
result = dns_master_dump(cache->mctx, cache->db, NULL,
|
||||
&dns_master_style_cache, cache->filename);
|
||||
&dns_master_style_cache, cache->filename,
|
||||
dns_masterformat_text, NULL);
|
||||
UNLOCK(&cache->filelock);
|
||||
return (result);
|
||||
|
||||
|
135
lib/dns/client.c
135
lib/dns/client.c
@ -399,7 +399,7 @@ dns_client_create(dns_client_t **clientp, unsigned int options) {
|
||||
isc_log_setdebuglevel(lctx, logdebuglevel);
|
||||
#endif
|
||||
result = dns_client_createx(mctx, actx, taskmgr, socketmgr, timermgr,
|
||||
options, clientp);
|
||||
options, clientp, NULL, NULL);
|
||||
if (result != ISC_R_SUCCESS)
|
||||
goto cleanup;
|
||||
|
||||
@ -425,22 +425,11 @@ dns_client_create(dns_client_t **clientp, unsigned int options) {
|
||||
}
|
||||
|
||||
isc_result_t
|
||||
dns_client_createx(isc_mem_t *mctx, isc_appctx_t *actx, isc_taskmgr_t *taskmgr,
|
||||
isc_socketmgr_t *socketmgr, isc_timermgr_t *timermgr,
|
||||
unsigned int options, dns_client_t **clientp)
|
||||
{
|
||||
isc_result_t result;
|
||||
result = dns_client_createx2(mctx, actx, taskmgr, socketmgr, timermgr,
|
||||
options, clientp, NULL, NULL);
|
||||
return (result);
|
||||
}
|
||||
|
||||
isc_result_t
|
||||
dns_client_createx2(isc_mem_t *mctx, isc_appctx_t *actx,
|
||||
isc_taskmgr_t *taskmgr, isc_socketmgr_t *socketmgr,
|
||||
isc_timermgr_t *timermgr, unsigned int options,
|
||||
dns_client_t **clientp, const isc_sockaddr_t *localaddr4,
|
||||
const isc_sockaddr_t *localaddr6)
|
||||
dns_client_createx(isc_mem_t *mctx, isc_appctx_t *actx,
|
||||
isc_taskmgr_t *taskmgr, isc_socketmgr_t *socketmgr,
|
||||
isc_timermgr_t *timermgr, unsigned int options,
|
||||
dns_client_t **clientp, const isc_sockaddr_t *localaddr4,
|
||||
const isc_sockaddr_t *localaddr6)
|
||||
{
|
||||
dns_client_t *client;
|
||||
isc_result_t result;
|
||||
@ -784,7 +773,8 @@ start_fetch(resctx_t *rctx) {
|
||||
result = dns_resolver_createfetch(rctx->view->resolver,
|
||||
dns_fixedname_name(&rctx->name),
|
||||
rctx->type,
|
||||
NULL, NULL, NULL, fopts,
|
||||
NULL, NULL, NULL, NULL, 0,
|
||||
fopts, 0, NULL,
|
||||
rctx->task, fetch_done, rctx,
|
||||
rctx->rdataset,
|
||||
rctx->sigrdataset,
|
||||
@ -807,7 +797,8 @@ view_find(resctx_t *rctx, dns_db_t **dbp, dns_dbnode_t **nodep,
|
||||
type = rctx->type;
|
||||
|
||||
result = dns_view_find(rctx->view, name, type, 0, 0, ISC_FALSE,
|
||||
dbp, nodep, foundname, rctx->rdataset,
|
||||
ISC_FALSE, dbp, nodep, foundname,
|
||||
rctx->rdataset,
|
||||
rctx->sigrdataset);
|
||||
|
||||
return (result);
|
||||
@ -1549,7 +1540,7 @@ dns_client_addtrustedkey(dns_client_t *client, dns_rdataclass_t rdclass,
|
||||
if (result != ISC_R_SUCCESS)
|
||||
goto cleanup;
|
||||
|
||||
result = dns_keytable_add2(secroots, ISC_FALSE, ISC_FALSE, &dstkey);
|
||||
result = dns_keytable_add(secroots, ISC_FALSE, ISC_FALSE, &dstkey);
|
||||
|
||||
cleanup:
|
||||
if (dstkey != NULL)
|
||||
@ -1796,11 +1787,11 @@ dns_client_startrequest(dns_client_t *client, dns_message_t *qmessage,
|
||||
UNLOCK(&client->lock);
|
||||
|
||||
ctx->request = NULL;
|
||||
result = dns_request_createvia3(view->requestmgr, qmessage, NULL,
|
||||
server, reqoptions, ctx->tsigkey,
|
||||
timeout, udptimeout, udpretries,
|
||||
client->task, request_done, ctx,
|
||||
&ctx->request);
|
||||
result = dns_request_createvia(view->requestmgr, qmessage, NULL,
|
||||
server, -1, reqoptions, ctx->tsigkey,
|
||||
timeout, udptimeout, udpretries,
|
||||
client->task, request_done, ctx,
|
||||
&ctx->request);
|
||||
if (result == ISC_R_SUCCESS) {
|
||||
dns_view_detach(&view);
|
||||
*transp = (dns_clientreqtrans_t *)ctx;
|
||||
@ -2003,18 +1994,19 @@ update_done(isc_task_t *task, isc_event_t *event) {
|
||||
reqoptions = 0;
|
||||
if (uctx->want_tcp)
|
||||
reqoptions |= DNS_REQUESTOPT_TCP;
|
||||
result = dns_request_createvia3(uctx->view->requestmgr,
|
||||
uctx->updatemsg,
|
||||
NULL,
|
||||
uctx->currentserver,
|
||||
reqoptions,
|
||||
uctx->tsigkey,
|
||||
timeout,
|
||||
client->update_udptimeout,
|
||||
client->update_udpretries,
|
||||
client->task,
|
||||
update_done, uctx,
|
||||
&uctx->updatereq);
|
||||
result = dns_request_createvia(uctx->view->requestmgr,
|
||||
uctx->updatemsg,
|
||||
NULL,
|
||||
uctx->currentserver,
|
||||
-1,
|
||||
reqoptions,
|
||||
uctx->tsigkey,
|
||||
timeout,
|
||||
client->update_udptimeout,
|
||||
client->update_udpretries,
|
||||
client->task,
|
||||
update_done, uctx,
|
||||
&uctx->updatereq);
|
||||
UNLOCK(&uctx->lock);
|
||||
|
||||
if (result == ISC_R_SUCCESS) {
|
||||
@ -2064,14 +2056,14 @@ send_update(updatectx_t *uctx) {
|
||||
reqoptions = 0;
|
||||
if (uctx->want_tcp)
|
||||
reqoptions |= DNS_REQUESTOPT_TCP;
|
||||
result = dns_request_createvia3(uctx->view->requestmgr,
|
||||
uctx->updatemsg,
|
||||
NULL, uctx->currentserver,
|
||||
reqoptions, uctx->tsigkey, timeout,
|
||||
client->update_udptimeout,
|
||||
client->update_udpretries,
|
||||
client->task, update_done, uctx,
|
||||
&uctx->updatereq);
|
||||
result = dns_request_createvia(uctx->view->requestmgr,
|
||||
uctx->updatemsg,
|
||||
NULL, uctx->currentserver,
|
||||
-1, reqoptions, uctx->tsigkey, timeout,
|
||||
client->update_udptimeout,
|
||||
client->update_udpretries,
|
||||
client->task, update_done, uctx,
|
||||
&uctx->updatereq);
|
||||
if (result == ISC_R_SUCCESS &&
|
||||
uctx->state == dns_clientupdatestate_prepare) {
|
||||
uctx->state = dns_clientupdatestate_sent;
|
||||
@ -2322,14 +2314,14 @@ receive_soa(isc_task_t *task, isc_event_t *event) {
|
||||
reqoptions = 0;
|
||||
if (uctx->want_tcp)
|
||||
reqoptions |= DNS_REQUESTOPT_TCP;
|
||||
result = dns_request_createvia3(uctx->view->requestmgr,
|
||||
uctx->soaquery, NULL, addr,
|
||||
reqoptions, NULL,
|
||||
client->find_timeout * 20,
|
||||
client->find_timeout, 3,
|
||||
uctx->client->task,
|
||||
receive_soa, uctx,
|
||||
&newrequest);
|
||||
result = dns_request_createvia(uctx->view->requestmgr,
|
||||
uctx->soaquery, NULL, addr, -1,
|
||||
reqoptions, NULL,
|
||||
client->find_timeout * 20,
|
||||
client->find_timeout, 3,
|
||||
uctx->client->task,
|
||||
receive_soa, uctx,
|
||||
&newrequest);
|
||||
if (result == ISC_R_SUCCESS) {
|
||||
LOCK(&uctx->lock);
|
||||
dns_request_destroy(&uctx->soareq);
|
||||
@ -2425,17 +2417,18 @@ receive_soa(isc_task_t *task, isc_event_t *event) {
|
||||
reqoptions = 0;
|
||||
if (uctx->want_tcp)
|
||||
reqoptions |= DNS_REQUESTOPT_TCP;
|
||||
result = dns_request_createvia3(uctx->view->requestmgr,
|
||||
soaquery, NULL,
|
||||
uctx->currentserver,
|
||||
reqoptions,
|
||||
uctx->tsigkey,
|
||||
client->find_timeout *
|
||||
20,
|
||||
client->find_timeout,
|
||||
3, client->task,
|
||||
receive_soa, uctx,
|
||||
&uctx->soareq);
|
||||
result = dns_request_createvia(uctx->view->requestmgr,
|
||||
soaquery, NULL,
|
||||
uctx->currentserver,
|
||||
-1,
|
||||
reqoptions,
|
||||
uctx->tsigkey,
|
||||
client->find_timeout *
|
||||
20,
|
||||
client->find_timeout,
|
||||
3, client->task,
|
||||
receive_soa, uctx,
|
||||
&uctx->soareq);
|
||||
}
|
||||
}
|
||||
|
||||
@ -2485,13 +2478,13 @@ request_soa(updatectx_t *uctx) {
|
||||
if (uctx->want_tcp)
|
||||
reqoptions |= DNS_REQUESTOPT_TCP;
|
||||
|
||||
result = dns_request_createvia3(uctx->view->requestmgr,
|
||||
soaquery, NULL, uctx->currentserver,
|
||||
reqoptions, uctx->tsigkey,
|
||||
uctx->client->find_timeout * 20,
|
||||
uctx->client->find_timeout, 3,
|
||||
uctx->client->task, receive_soa, uctx,
|
||||
&uctx->soareq);
|
||||
result = dns_request_createvia(uctx->view->requestmgr,
|
||||
soaquery, NULL, uctx->currentserver,
|
||||
-1, reqoptions, uctx->tsigkey,
|
||||
uctx->client->find_timeout * 20,
|
||||
uctx->client->find_timeout, 3,
|
||||
uctx->client->task, receive_soa, uctx,
|
||||
&uctx->soareq);
|
||||
if (result == ISC_R_SUCCESS) {
|
||||
uctx->soaquery = soaquery;
|
||||
return (ISC_R_SUCCESS);
|
||||
|
34
lib/dns/db.c
34
lib/dns/db.c
@ -310,18 +310,8 @@ dns_db_endload(dns_db_t *db, dns_rdatacallbacks_t *callbacks) {
|
||||
}
|
||||
|
||||
isc_result_t
|
||||
dns_db_load(dns_db_t *db, const char *filename) {
|
||||
return (dns_db_load3(db, filename, dns_masterformat_text, 0));
|
||||
}
|
||||
|
||||
isc_result_t
|
||||
dns_db_load2(dns_db_t *db, const char *filename, dns_masterformat_t format) {
|
||||
return (dns_db_load3(db, filename, format, 0));
|
||||
}
|
||||
|
||||
isc_result_t
|
||||
dns_db_load3(dns_db_t *db, const char *filename, dns_masterformat_t format,
|
||||
unsigned int options)
|
||||
dns_db_load(dns_db_t *db, const char *filename, dns_masterformat_t format,
|
||||
unsigned int options)
|
||||
{
|
||||
isc_result_t result, eresult;
|
||||
dns_rdatacallbacks_t callbacks;
|
||||
@ -339,9 +329,9 @@ dns_db_load3(dns_db_t *db, const char *filename, dns_masterformat_t format,
|
||||
result = dns_db_beginload(db, &callbacks);
|
||||
if (result != ISC_R_SUCCESS)
|
||||
return (result);
|
||||
result = dns_master_loadfile2(filename, &db->origin, &db->origin,
|
||||
db->rdclass, options,
|
||||
&callbacks, db->mctx, format);
|
||||
result = dns_master_loadfile(filename, &db->origin, &db->origin,
|
||||
db->rdclass, options, 0, &callbacks,
|
||||
NULL, NULL, db->mctx, format, 0);
|
||||
eresult = dns_db_endload(db, &callbacks);
|
||||
/*
|
||||
* We always call dns_db_endload(), but we only want to return its
|
||||
@ -369,20 +359,6 @@ dns_db_dump(dns_db_t *db, dns_dbversion_t *version, const char *filename) {
|
||||
dns_masterformat_text));
|
||||
}
|
||||
|
||||
isc_result_t
|
||||
dns_db_dump2(dns_db_t *db, dns_dbversion_t *version, const char *filename,
|
||||
dns_masterformat_t masterformat) {
|
||||
/*
|
||||
* Dump 'db' into master file 'filename' in the 'masterformat' format.
|
||||
* XXXJT: is it okay to modify the interface to the existing "dump"
|
||||
* method?
|
||||
*/
|
||||
|
||||
REQUIRE(DNS_DB_VALID(db));
|
||||
|
||||
return ((db->methods->dump)(db, version, filename, masterformat));
|
||||
}
|
||||
|
||||
/***
|
||||
*** Version Methods
|
||||
***/
|
||||
|
@ -1138,7 +1138,8 @@ udp_recv(isc_event_t *ev_in, dns_dispatch_t *disp, dispsocket_t *dispsock) {
|
||||
*/
|
||||
isc_netaddr_fromsockaddr(&netaddr, &ev->address);
|
||||
if (disp->mgr->blackhole != NULL &&
|
||||
dns_acl_match(&netaddr, NULL, disp->mgr->blackhole,
|
||||
dns_acl_match(&netaddr, NULL, NULL, 0, NULL,
|
||||
disp->mgr->blackhole,
|
||||
NULL, &match, NULL) == ISC_R_SUCCESS &&
|
||||
match > 0)
|
||||
{
|
||||
@ -2495,28 +2496,12 @@ dispatch_free(dns_dispatch_t **dispp) {
|
||||
|
||||
isc_result_t
|
||||
dns_dispatch_createtcp(dns_dispatchmgr_t *mgr, isc_socket_t *sock,
|
||||
isc_taskmgr_t *taskmgr, unsigned int buffersize,
|
||||
isc_taskmgr_t *taskmgr, const isc_sockaddr_t *localaddr,
|
||||
const isc_sockaddr_t *destaddr, unsigned int buffersize,
|
||||
unsigned int maxbuffers, unsigned int maxrequests,
|
||||
unsigned int buckets, unsigned int increment,
|
||||
unsigned int attributes, dns_dispatch_t **dispp)
|
||||
{
|
||||
|
||||
attributes |= DNS_DISPATCHATTR_PRIVATE; /* XXXMLG */
|
||||
|
||||
return (dns_dispatch_createtcp2(mgr, sock, taskmgr, NULL, NULL,
|
||||
buffersize, maxbuffers, maxrequests,
|
||||
buckets, increment, attributes,
|
||||
dispp));
|
||||
}
|
||||
|
||||
isc_result_t
|
||||
dns_dispatch_createtcp2(dns_dispatchmgr_t *mgr, isc_socket_t *sock,
|
||||
isc_taskmgr_t *taskmgr, const isc_sockaddr_t *localaddr,
|
||||
const isc_sockaddr_t *destaddr, unsigned int buffersize,
|
||||
unsigned int maxbuffers, unsigned int maxrequests,
|
||||
unsigned int buckets, unsigned int increment,
|
||||
unsigned int attributes, dns_dispatch_t **dispp)
|
||||
{
|
||||
isc_result_t result;
|
||||
dns_dispatch_t *disp;
|
||||
|
||||
@ -2622,7 +2607,8 @@ dns_dispatch_createtcp2(dns_dispatchmgr_t *mgr, isc_socket_t *sock,
|
||||
|
||||
isc_result_t
|
||||
dns_dispatch_gettcp(dns_dispatchmgr_t *mgr, const isc_sockaddr_t *destaddr,
|
||||
const isc_sockaddr_t *localaddr, dns_dispatch_t **dispp)
|
||||
const isc_sockaddr_t *localaddr, isc_boolean_t *connected,
|
||||
dns_dispatch_t **dispp)
|
||||
{
|
||||
dns_dispatch_t *disp;
|
||||
isc_result_t result;
|
||||
@ -2635,6 +2621,7 @@ dns_dispatch_gettcp(dns_dispatchmgr_t *mgr, const isc_sockaddr_t *destaddr,
|
||||
REQUIRE(destaddr != NULL);
|
||||
REQUIRE(dispp != NULL && *dispp == NULL);
|
||||
|
||||
/* First pass */
|
||||
attributes = DNS_DISPATCHATTR_TCP | DNS_DISPATCHATTR_CONNECTED;
|
||||
mask = DNS_DISPATCHATTR_TCP | DNS_DISPATCHATTR_PRIVATE |
|
||||
DNS_DISPATCHATTR_EXCLUSIVE | DNS_DISPATCHATTR_CONNECTED;
|
||||
@ -2660,70 +2647,20 @@ dns_dispatch_gettcp(dns_dispatchmgr_t *mgr, const isc_sockaddr_t *destaddr,
|
||||
disp->refcount++;
|
||||
*dispp = disp;
|
||||
match = ISC_TRUE;
|
||||
if (connected != NULL) {
|
||||
*connected = ISC_TRUE;
|
||||
}
|
||||
}
|
||||
}
|
||||
UNLOCK(&disp->lock);
|
||||
disp = ISC_LIST_NEXT(disp, link);
|
||||
}
|
||||
UNLOCK(&mgr->lock);
|
||||
return (match ? ISC_R_SUCCESS : ISC_R_NOTFOUND);
|
||||
}
|
||||
|
||||
isc_result_t
|
||||
dns_dispatch_gettcp2(dns_dispatchmgr_t *mgr, const isc_sockaddr_t *destaddr,
|
||||
const isc_sockaddr_t *localaddr, isc_boolean_t *connected,
|
||||
dns_dispatch_t **dispp)
|
||||
{
|
||||
dns_dispatch_t *disp;
|
||||
isc_result_t result;
|
||||
isc_sockaddr_t peeraddr;
|
||||
isc_sockaddr_t sockname;
|
||||
unsigned int attributes, mask;
|
||||
isc_boolean_t match = ISC_FALSE;
|
||||
|
||||
REQUIRE(VALID_DISPATCHMGR(mgr));
|
||||
REQUIRE(destaddr != NULL);
|
||||
REQUIRE(dispp != NULL && *dispp == NULL);
|
||||
REQUIRE(connected != NULL);
|
||||
|
||||
/* First pass (same as dns_dispatch_gettcp()) */
|
||||
attributes = DNS_DISPATCHATTR_TCP | DNS_DISPATCHATTR_CONNECTED;
|
||||
mask = DNS_DISPATCHATTR_TCP | DNS_DISPATCHATTR_PRIVATE |
|
||||
DNS_DISPATCHATTR_EXCLUSIVE | DNS_DISPATCHATTR_CONNECTED;
|
||||
|
||||
LOCK(&mgr->lock);
|
||||
disp = ISC_LIST_HEAD(mgr->list);
|
||||
while (disp != NULL && !match) {
|
||||
LOCK(&disp->lock);
|
||||
if ((disp->shutting_down == 0) &&
|
||||
ATTRMATCH(disp->attributes, attributes, mask) &&
|
||||
(localaddr == NULL ||
|
||||
isc_sockaddr_eqaddr(localaddr, &disp->local))) {
|
||||
result = isc_socket_getsockname(disp->socket,
|
||||
&sockname);
|
||||
if (result == ISC_R_SUCCESS)
|
||||
result = isc_socket_getpeername(disp->socket,
|
||||
&peeraddr);
|
||||
if (result == ISC_R_SUCCESS &&
|
||||
isc_sockaddr_equal(destaddr, &peeraddr) &&
|
||||
(localaddr == NULL ||
|
||||
isc_sockaddr_eqaddr(localaddr, &sockname))) {
|
||||
/* attach */
|
||||
disp->refcount++;
|
||||
*dispp = disp;
|
||||
match = ISC_TRUE;
|
||||
*connected = ISC_TRUE;
|
||||
}
|
||||
}
|
||||
UNLOCK(&disp->lock);
|
||||
disp = ISC_LIST_NEXT(disp, link);
|
||||
}
|
||||
if (match) {
|
||||
if (match || connected == NULL) {
|
||||
UNLOCK(&mgr->lock);
|
||||
return (ISC_R_SUCCESS);
|
||||
return (match ? ISC_R_SUCCESS : ISC_R_NOTFOUND);
|
||||
}
|
||||
|
||||
/* Second pass */
|
||||
/* Second pass, only if connected != NULL */
|
||||
attributes = DNS_DISPATCHATTR_TCP;
|
||||
|
||||
disp = ISC_LIST_HEAD(mgr->list);
|
||||
@ -3174,21 +3111,11 @@ dns_dispatch_detach(dns_dispatch_t **dispp) {
|
||||
}
|
||||
|
||||
isc_result_t
|
||||
dns_dispatch_addresponse2(dns_dispatch_t *disp, const isc_sockaddr_t *dest,
|
||||
isc_task_t *task, isc_taskaction_t action, void *arg,
|
||||
dns_messageid_t *idp, dns_dispentry_t **resp,
|
||||
isc_socketmgr_t *sockmgr)
|
||||
{
|
||||
return (dns_dispatch_addresponse3(disp, 0, dest, task, action, arg,
|
||||
idp, resp, sockmgr));
|
||||
}
|
||||
|
||||
isc_result_t
|
||||
dns_dispatch_addresponse3(dns_dispatch_t *disp, unsigned int options,
|
||||
const isc_sockaddr_t *dest, isc_task_t *task,
|
||||
isc_taskaction_t action, void *arg,
|
||||
dns_messageid_t *idp, dns_dispentry_t **resp,
|
||||
isc_socketmgr_t *sockmgr)
|
||||
dns_dispatch_addresponse(dns_dispatch_t *disp, unsigned int options,
|
||||
const isc_sockaddr_t *dest, isc_task_t *task,
|
||||
isc_taskaction_t action, void *arg,
|
||||
dns_messageid_t *idp, dns_dispentry_t **resp,
|
||||
isc_socketmgr_t *sockmgr)
|
||||
{
|
||||
dns_dispentry_t *res;
|
||||
unsigned int bucket;
|
||||
@ -3382,18 +3309,6 @@ dns_dispatch_addresponse3(dns_dispatch_t *disp, unsigned int options,
|
||||
return (ISC_R_SUCCESS);
|
||||
}
|
||||
|
||||
isc_result_t
|
||||
dns_dispatch_addresponse(dns_dispatch_t *disp, const isc_sockaddr_t *dest,
|
||||
isc_task_t *task, isc_taskaction_t action, void *arg,
|
||||
dns_messageid_t *idp, dns_dispentry_t **resp)
|
||||
{
|
||||
REQUIRE(VALID_DISPATCH(disp));
|
||||
REQUIRE((disp->attributes & DNS_DISPATCHATTR_EXCLUSIVE) == 0);
|
||||
|
||||
return (dns_dispatch_addresponse3(disp, 0, dest, task, action, arg,
|
||||
idp, resp, NULL));
|
||||
}
|
||||
|
||||
void
|
||||
dns_dispatch_starttcp(dns_dispatch_t *disp) {
|
||||
|
||||
|
@ -24,6 +24,7 @@
|
||||
#include <dns/rdata.h>
|
||||
#include <dns/rdataset.h>
|
||||
#include <dns/result.h>
|
||||
#include <string.h>
|
||||
|
||||
struct dns_dns64 {
|
||||
unsigned char bits[16]; /*
|
||||
@ -138,8 +139,8 @@ dns_dns64_aaaafroma(const dns_dns64_t *dns64, const isc_netaddr_t *reqaddr,
|
||||
return (DNS_R_DISALLOWED);
|
||||
|
||||
if (dns64->clients != NULL) {
|
||||
result = dns_acl_match(reqaddr, reqsigner, dns64->clients, env,
|
||||
&match, NULL);
|
||||
result = dns_acl_match(reqaddr, reqsigner, NULL, 0, NULL,
|
||||
dns64->clients, env, &match, NULL);
|
||||
if (result != ISC_R_SUCCESS)
|
||||
return (result);
|
||||
if (match <= 0)
|
||||
@ -152,8 +153,8 @@ dns_dns64_aaaafroma(const dns_dns64_t *dns64, const isc_netaddr_t *reqaddr,
|
||||
|
||||
memmove(&ina.s_addr, a, 4);
|
||||
isc_netaddr_fromin(&netaddr, &ina);
|
||||
result = dns_acl_match(&netaddr, NULL, dns64->mapped, env,
|
||||
&match, NULL);
|
||||
result = dns_acl_match(&netaddr, NULL, NULL, 0, NULL,
|
||||
dns64->mapped, env, &match, NULL);
|
||||
if (result != ISC_R_SUCCESS)
|
||||
return (result);
|
||||
if (match <= 0)
|
||||
@ -227,8 +228,8 @@ dns_dns64_aaaaok(const dns_dns64_t *dns64, const isc_netaddr_t *reqaddr,
|
||||
* Work out if this dns64 structure applies to this client.
|
||||
*/
|
||||
if (dns64->clients != NULL) {
|
||||
result = dns_acl_match(reqaddr, reqsigner,
|
||||
dns64->clients, env,
|
||||
result = dns_acl_match(reqaddr, reqsigner, NULL, 0,
|
||||
NULL, dns64->clients, env,
|
||||
&match, NULL);
|
||||
if (result != ISC_R_SUCCESS)
|
||||
continue;
|
||||
@ -266,9 +267,10 @@ dns_dns64_aaaaok(const dns_dns64_t *dns64, const isc_netaddr_t *reqaddr,
|
||||
memmove(&in6.s6_addr, rdata.data, 16);
|
||||
isc_netaddr_fromin6(&netaddr, &in6);
|
||||
|
||||
result = dns_acl_match(&netaddr, NULL,
|
||||
dns64->excluded,
|
||||
env, &match, NULL);
|
||||
result = dns_acl_match(&netaddr, NULL, NULL,
|
||||
0, NULL,
|
||||
dns64->excluded, env,
|
||||
&match, NULL);
|
||||
if (result == ISC_R_SUCCESS && match <= 0) {
|
||||
answer = ISC_TRUE;
|
||||
if (aaaaok == NULL)
|
||||
|
105
lib/dns/dnssec.c
105
lib/dns/dnssec.c
@ -268,8 +268,8 @@ dns_dnssec_sign(const dns_name_t *name, dns_rdataset_t *set, dst_key_t *key,
|
||||
if (ret != ISC_R_SUCCESS)
|
||||
goto cleanup_databuf;
|
||||
|
||||
ret = dst_context_create3(key, mctx,
|
||||
DNS_LOGCATEGORY_DNSSEC, ISC_TRUE, &ctx);
|
||||
ret = dst_context_create(key, mctx,
|
||||
DNS_LOGCATEGORY_DNSSEC, ISC_TRUE, 0, &ctx);
|
||||
if (ret != ISC_R_SUCCESS)
|
||||
goto cleanup_databuf;
|
||||
|
||||
@ -363,18 +363,9 @@ cleanup_signature:
|
||||
}
|
||||
|
||||
isc_result_t
|
||||
dns_dnssec_verify2(const dns_name_t *name, dns_rdataset_t *set, dst_key_t *key,
|
||||
isc_boolean_t ignoretime, isc_mem_t *mctx,
|
||||
dns_rdata_t *sigrdata, dns_name_t *wild)
|
||||
{
|
||||
return (dns_dnssec_verify3(name, set, key, ignoretime, 0, mctx,
|
||||
sigrdata, wild));
|
||||
}
|
||||
|
||||
isc_result_t
|
||||
dns_dnssec_verify3(const dns_name_t *name, dns_rdataset_t *set, dst_key_t *key,
|
||||
isc_boolean_t ignoretime, unsigned int maxbits,
|
||||
isc_mem_t *mctx, dns_rdata_t *sigrdata, dns_name_t *wild)
|
||||
dns_dnssec_verify(const dns_name_t *name, dns_rdataset_t *set, dst_key_t *key,
|
||||
isc_boolean_t ignoretime, unsigned int maxbits,
|
||||
isc_mem_t *mctx, dns_rdata_t *sigrdata, dns_name_t *wild)
|
||||
{
|
||||
dns_rdata_rrsig_t sig;
|
||||
dns_fixedname_t fnewname;
|
||||
@ -464,8 +455,8 @@ dns_dnssec_verify3(const dns_name_t *name, dns_rdataset_t *set, dst_key_t *key,
|
||||
}
|
||||
|
||||
again:
|
||||
ret = dst_context_create4(key, mctx, DNS_LOGCATEGORY_DNSSEC,
|
||||
ISC_FALSE, maxbits, &ctx);
|
||||
ret = dst_context_create(key, mctx, DNS_LOGCATEGORY_DNSSEC,
|
||||
ISC_FALSE, maxbits, &ctx);
|
||||
if (ret != ISC_R_SUCCESS)
|
||||
goto cleanup_struct;
|
||||
|
||||
@ -590,20 +581,6 @@ cleanup_struct:
|
||||
return (ret);
|
||||
}
|
||||
|
||||
isc_result_t
|
||||
dns_dnssec_verify(const dns_name_t *name, dns_rdataset_t *set, dst_key_t *key,
|
||||
isc_boolean_t ignoretime, isc_mem_t *mctx,
|
||||
dns_rdata_t *sigrdata)
|
||||
{
|
||||
isc_result_t result;
|
||||
|
||||
result = dns_dnssec_verify2(name, set, key, ignoretime, mctx,
|
||||
sigrdata, NULL);
|
||||
if (result == DNS_R_FROMWILDCARD)
|
||||
result = ISC_R_SUCCESS;
|
||||
return (result);
|
||||
}
|
||||
|
||||
isc_boolean_t
|
||||
dns_dnssec_keyactive(dst_key_t *key, isc_stdtime_t now) {
|
||||
isc_result_t result;
|
||||
@ -730,11 +707,11 @@ syncdelete(dst_key_t *key, isc_stdtime_t now) {
|
||||
== DNS_KEYOWNER_ZONE)
|
||||
|
||||
isc_result_t
|
||||
dns_dnssec_findzonekeys3(dns_db_t *db, dns_dbversion_t *ver,
|
||||
dns_dbnode_t *node, const dns_name_t *name,
|
||||
const char *directory, isc_stdtime_t now,
|
||||
isc_mem_t *mctx, unsigned int maxkeys,
|
||||
dst_key_t **keys, unsigned int *nkeys)
|
||||
dns_dnssec_findzonekeys(dns_db_t *db, dns_dbversion_t *ver,
|
||||
dns_dbnode_t *node, const dns_name_t *name,
|
||||
const char *directory, isc_stdtime_t now,
|
||||
isc_mem_t *mctx, unsigned int maxkeys,
|
||||
dst_key_t **keys, unsigned int *nkeys)
|
||||
{
|
||||
dns_rdataset_t rdataset;
|
||||
dns_rdata_t rdata = DNS_RDATA_INIT;
|
||||
@ -890,33 +867,6 @@ dns_dnssec_findzonekeys3(dns_db_t *db, dns_dbversion_t *ver,
|
||||
return (result);
|
||||
}
|
||||
|
||||
isc_result_t
|
||||
dns_dnssec_findzonekeys2(dns_db_t *db, dns_dbversion_t *ver,
|
||||
dns_dbnode_t *node, const dns_name_t *name,
|
||||
const char *directory, isc_mem_t *mctx,
|
||||
unsigned int maxkeys, dst_key_t **keys,
|
||||
unsigned int *nkeys)
|
||||
{
|
||||
isc_stdtime_t now;
|
||||
|
||||
isc_stdtime_get(&now);
|
||||
return (dns_dnssec_findzonekeys3(db, ver, node, name, directory, now,
|
||||
mctx, maxkeys, keys, nkeys));
|
||||
}
|
||||
|
||||
isc_result_t
|
||||
dns_dnssec_findzonekeys(dns_db_t *db, dns_dbversion_t *ver,
|
||||
dns_dbnode_t *node, const dns_name_t *name,
|
||||
isc_mem_t *mctx, unsigned int maxkeys,
|
||||
dst_key_t **keys, unsigned int *nkeys)
|
||||
{
|
||||
isc_stdtime_t now;
|
||||
|
||||
isc_stdtime_get(&now);
|
||||
return (dns_dnssec_findzonekeys3(db, ver, node, name, NULL, now,
|
||||
mctx, maxkeys, keys, nkeys));
|
||||
}
|
||||
|
||||
isc_result_t
|
||||
dns_dnssec_signmessage(dns_message_t *msg, dst_key_t *key) {
|
||||
dns_rdata_sig_t sig; /* SIG(0) */
|
||||
@ -969,8 +919,8 @@ dns_dnssec_signmessage(dns_message_t *msg, dst_key_t *key) {
|
||||
|
||||
isc_buffer_init(&databuf, data, sizeof(data));
|
||||
|
||||
RETERR(dst_context_create3(key, mctx,
|
||||
DNS_LOGCATEGORY_DNSSEC, ISC_TRUE, &ctx));
|
||||
RETERR(dst_context_create(key, mctx,
|
||||
DNS_LOGCATEGORY_DNSSEC, ISC_TRUE, 0, &ctx));
|
||||
|
||||
/*
|
||||
* Digest the fields of the SIG - we can cheat and use
|
||||
@ -1118,8 +1068,8 @@ dns_dnssec_verifymessage(isc_buffer_t *source, dns_message_t *msg,
|
||||
goto failure;
|
||||
}
|
||||
|
||||
RETERR(dst_context_create3(key, mctx,
|
||||
DNS_LOGCATEGORY_DNSSEC, ISC_FALSE, &ctx));
|
||||
RETERR(dst_context_create(key, mctx,
|
||||
DNS_LOGCATEGORY_DNSSEC, ISC_FALSE, 0, &ctx));
|
||||
|
||||
/*
|
||||
* Digest the SIG(0) record, except for the signature.
|
||||
@ -1243,9 +1193,9 @@ dns_dnssec_signs(dns_rdata_t *rdata, const dns_name_t *name,
|
||||
|
||||
if (sig.algorithm == key.algorithm &&
|
||||
sig.keyid == keytag) {
|
||||
result = dns_dnssec_verify2(name, rdataset, dstkey,
|
||||
ignoretime, mctx,
|
||||
&sigrdata, NULL);
|
||||
result = dns_dnssec_verify(name, rdataset, dstkey,
|
||||
ignoretime, 0, mctx,
|
||||
&sigrdata, NULL);
|
||||
if (result == ISC_R_SUCCESS) {
|
||||
dst_key_free(&dstkey);
|
||||
return (ISC_TRUE);
|
||||
@ -1406,9 +1356,9 @@ get_hints(dns_dnsseckey_t *key, isc_stdtime_t now) {
|
||||
* Get a list of DNSSEC keys from the key repository
|
||||
*/
|
||||
isc_result_t
|
||||
dns_dnssec_findmatchingkeys2(const dns_name_t *origin, const char *directory,
|
||||
isc_stdtime_t now, isc_mem_t *mctx,
|
||||
dns_dnsseckeylist_t *keylist)
|
||||
dns_dnssec_findmatchingkeys(const dns_name_t *origin, const char *directory,
|
||||
isc_stdtime_t now, isc_mem_t *mctx,
|
||||
dns_dnsseckeylist_t *keylist)
|
||||
{
|
||||
isc_result_t result = ISC_R_SUCCESS;
|
||||
isc_boolean_t dir_open = ISC_FALSE;
|
||||
@ -1536,17 +1486,6 @@ dns_dnssec_findmatchingkeys2(const dns_name_t *origin, const char *directory,
|
||||
return (result);
|
||||
}
|
||||
|
||||
isc_result_t
|
||||
dns_dnssec_findmatchingkeys(const dns_name_t *origin, const char *directory,
|
||||
isc_mem_t *mctx, dns_dnsseckeylist_t *keylist)
|
||||
{
|
||||
isc_stdtime_t now;
|
||||
|
||||
isc_stdtime_get(&now);
|
||||
return (dns_dnssec_findmatchingkeys2(origin, directory, now, mctx,
|
||||
keylist));
|
||||
}
|
||||
|
||||
/*%
|
||||
* Add 'newkey' to 'keylist' if it's not already there.
|
||||
*
|
||||
|
@ -185,15 +185,8 @@ unlock:
|
||||
|
||||
isc_result_t
|
||||
dns_dt_create(isc_mem_t *mctx, dns_dtmode_t mode, const char *path,
|
||||
struct fstrm_iothr_options **foptp, dns_dtenv_t **envp)
|
||||
{
|
||||
return (dns_dt_create2(mctx, mode, path, foptp, NULL, envp));
|
||||
}
|
||||
|
||||
isc_result_t
|
||||
dns_dt_create2(isc_mem_t *mctx, dns_dtmode_t mode, const char *path,
|
||||
struct fstrm_iothr_options **foptp, isc_task_t *reopen_task,
|
||||
dns_dtenv_t **envp)
|
||||
struct fstrm_iothr_options **foptp, isc_task_t *reopen_task,
|
||||
dns_dtenv_t **envp)
|
||||
{
|
||||
isc_result_t result = ISC_R_SUCCESS;
|
||||
fstrm_res res;
|
||||
|
@ -148,13 +148,8 @@ default_memfree(void *arg, void *ptr) {
|
||||
#endif
|
||||
|
||||
isc_result_t
|
||||
dst_lib_init(isc_mem_t *mctx, isc_entropy_t *ectx, unsigned int eflags) {
|
||||
return (dst_lib_init2(mctx, ectx, NULL, eflags));
|
||||
}
|
||||
|
||||
isc_result_t
|
||||
dst_lib_init2(isc_mem_t *mctx, isc_entropy_t *ectx,
|
||||
const char *engine, unsigned int eflags) {
|
||||
dst_lib_init(isc_mem_t *mctx, isc_entropy_t *ectx,
|
||||
const char *engine, unsigned int eflags) {
|
||||
isc_result_t result;
|
||||
|
||||
REQUIRE(mctx != NULL);
|
||||
@ -339,31 +334,9 @@ dst_ds_digest_supported(unsigned int digest_type) {
|
||||
}
|
||||
|
||||
isc_result_t
|
||||
dst_context_create(dst_key_t *key, isc_mem_t *mctx, dst_context_t **dctxp) {
|
||||
return (dst_context_create4(key, mctx, DNS_LOGCATEGORY_GENERAL,
|
||||
ISC_TRUE, 0, dctxp));
|
||||
}
|
||||
|
||||
isc_result_t
|
||||
dst_context_create2(dst_key_t *key, isc_mem_t *mctx,
|
||||
isc_logcategory_t *category, dst_context_t **dctxp)
|
||||
{
|
||||
return (dst_context_create4(key, mctx, category, ISC_TRUE, 0, dctxp));
|
||||
}
|
||||
|
||||
isc_result_t
|
||||
dst_context_create3(dst_key_t *key, isc_mem_t *mctx,
|
||||
isc_logcategory_t *category, isc_boolean_t useforsigning,
|
||||
dst_context_t **dctxp)
|
||||
{
|
||||
return (dst_context_create4(key, mctx, category,
|
||||
useforsigning, 0, dctxp));
|
||||
}
|
||||
|
||||
isc_result_t
|
||||
dst_context_create4(dst_key_t *key, isc_mem_t *mctx,
|
||||
isc_logcategory_t *category, isc_boolean_t useforsigning,
|
||||
int maxbits, dst_context_t **dctxp)
|
||||
dst_context_create(dst_key_t *key, isc_mem_t *mctx,
|
||||
isc_logcategory_t *category, isc_boolean_t useforsigning,
|
||||
int maxbits, dst_context_t **dctxp)
|
||||
{
|
||||
dst_context_t *dctx;
|
||||
isc_result_t result;
|
||||
@ -983,19 +956,8 @@ dst_key_generate(const dns_name_t *name, unsigned int alg,
|
||||
unsigned int bits, unsigned int param,
|
||||
unsigned int flags, unsigned int protocol,
|
||||
dns_rdataclass_t rdclass,
|
||||
isc_mem_t *mctx, dst_key_t **keyp)
|
||||
{
|
||||
return (dst_key_generate2(name, alg, bits, param, flags, protocol,
|
||||
rdclass, mctx, keyp, NULL));
|
||||
}
|
||||
|
||||
isc_result_t
|
||||
dst_key_generate2(const dns_name_t *name, unsigned int alg,
|
||||
unsigned int bits, unsigned int param,
|
||||
unsigned int flags, unsigned int protocol,
|
||||
dns_rdataclass_t rdclass,
|
||||
isc_mem_t *mctx, dst_key_t **keyp,
|
||||
void (*callback)(int))
|
||||
isc_mem_t *mctx, dst_key_t **keyp,
|
||||
void (*callback)(int))
|
||||
{
|
||||
dst_key_t *key;
|
||||
isc_result_t ret;
|
||||
|
@ -192,14 +192,7 @@ dns_fwdtable_delete(dns_fwdtable_t *fwdtable, const dns_name_t *name) {
|
||||
|
||||
isc_result_t
|
||||
dns_fwdtable_find(dns_fwdtable_t *fwdtable, const dns_name_t *name,
|
||||
dns_forwarders_t **forwardersp)
|
||||
{
|
||||
return (dns_fwdtable_find2(fwdtable, name, NULL, forwardersp));
|
||||
}
|
||||
|
||||
isc_result_t
|
||||
dns_fwdtable_find2(dns_fwdtable_t *fwdtable, const dns_name_t *name,
|
||||
dns_name_t *foundname, dns_forwarders_t **forwardersp)
|
||||
dns_name_t *foundname, dns_forwarders_t **forwardersp)
|
||||
{
|
||||
isc_result_t result;
|
||||
|
||||
|
@ -211,21 +211,13 @@ dns_aclenv_destroy(dns_aclenv_t *env);
|
||||
isc_result_t
|
||||
dns_acl_match(const isc_netaddr_t *reqaddr,
|
||||
const dns_name_t *reqsigner,
|
||||
const isc_netaddr_t *ecs,
|
||||
isc_uint8_t ecslen,
|
||||
isc_uint8_t *scope,
|
||||
const dns_acl_t *acl,
|
||||
const dns_aclenv_t *env,
|
||||
int *match,
|
||||
const dns_aclelement_t **matchelt);
|
||||
|
||||
isc_result_t
|
||||
dns_acl_match2(const isc_netaddr_t *reqaddr,
|
||||
const dns_name_t *reqsigner,
|
||||
const isc_netaddr_t *ecs,
|
||||
isc_uint8_t ecslen,
|
||||
isc_uint8_t *scope,
|
||||
const dns_acl_t *acl,
|
||||
const dns_aclenv_t *env,
|
||||
int *match,
|
||||
const dns_aclelement_t **matchelt);
|
||||
/*%<
|
||||
* General, low-level ACL matching. This is expected to
|
||||
* be useful even for weird stuff like the topology and sortlist statements.
|
||||
@ -260,19 +252,12 @@ dns_acl_match2(const isc_netaddr_t *reqaddr,
|
||||
isc_boolean_t
|
||||
dns_aclelement_match(const isc_netaddr_t *reqaddr,
|
||||
const dns_name_t *reqsigner,
|
||||
const isc_netaddr_t *ecs,
|
||||
isc_uint8_t ecslen,
|
||||
isc_uint8_t *scope,
|
||||
const dns_aclelement_t *e,
|
||||
const dns_aclenv_t *env,
|
||||
const dns_aclelement_t **matchelt);
|
||||
|
||||
isc_boolean_t
|
||||
dns_aclelement_match2(const isc_netaddr_t *reqaddr,
|
||||
const dns_name_t *reqsigner,
|
||||
const isc_netaddr_t *ecs,
|
||||
isc_uint8_t ecslen,
|
||||
isc_uint8_t *scope,
|
||||
const dns_aclelement_t *e,
|
||||
const dns_aclenv_t *env,
|
||||
const dns_aclelement_t **matchelt);
|
||||
/*%<
|
||||
* Like dns_acl_match, but matches against the single ACL element 'e'
|
||||
* rather than a complete ACL, and returns ISC_TRUE iff it matched.
|
||||
|
@ -333,15 +333,9 @@ isc_result_t
|
||||
dns_adb_createfind(dns_adb_t *adb, isc_task_t *task, isc_taskaction_t action,
|
||||
void *arg, const dns_name_t *name, const dns_name_t *qname,
|
||||
dns_rdatatype_t qtype, unsigned int options,
|
||||
isc_stdtime_t now, dns_name_t *target,
|
||||
in_port_t port, dns_adbfind_t **find);
|
||||
isc_result_t
|
||||
dns_adb_createfind2(dns_adb_t *adb, isc_task_t *task, isc_taskaction_t action,
|
||||
void *arg, const dns_name_t *name, const dns_name_t *qname,
|
||||
dns_rdatatype_t qtype, unsigned int options,
|
||||
isc_stdtime_t now, dns_name_t *target, in_port_t port,
|
||||
unsigned int depth, isc_counter_t *qc,
|
||||
dns_adbfind_t **find);
|
||||
isc_stdtime_t now, dns_name_t *target, in_port_t port,
|
||||
unsigned int depth, isc_counter_t *qc,
|
||||
dns_adbfind_t **find);
|
||||
/*%<
|
||||
* Main interface for clients. The adb will look up the name given in
|
||||
* "name" and will build up a list of found addresses, and perhaps start
|
||||
@ -611,9 +605,7 @@ dns_adb_getudpsize(dns_adb_t *adb, dns_adbaddrinfo_t *addr);
|
||||
*/
|
||||
|
||||
unsigned int
|
||||
dns_adb_probesize(dns_adb_t *adb, dns_adbaddrinfo_t *addr);
|
||||
unsigned int
|
||||
dns_adb_probesize2(dns_adb_t *adb, dns_adbaddrinfo_t *addr, int lookups);
|
||||
dns_adb_probesize (dns_adb_t *adb, dns_adbaddrinfo_t *addr, int lookups);
|
||||
/*%
|
||||
* Return suggested EDNS UDP size based on observed responses / failures.
|
||||
* 'lookups' is the number of times the current lookup has been attempted.
|
||||
|
@ -141,12 +141,8 @@ dns_byaddr_destroy(dns_byaddr_t **byaddrp);
|
||||
*/
|
||||
|
||||
isc_result_t
|
||||
dns_byaddr_createptrname(const isc_netaddr_t *address, isc_boolean_t nibble,
|
||||
dns_byaddr_createptrname(const isc_netaddr_t *address, unsigned int options,
|
||||
dns_name_t *name);
|
||||
|
||||
isc_result_t
|
||||
dns_byaddr_createptrname2(const isc_netaddr_t *address, unsigned int options,
|
||||
dns_name_t *name);
|
||||
/*%<
|
||||
* Creates a name that would be used in a PTR query for this address. The
|
||||
* nibble flag indicates that the 'nibble' format is to be used if an IPv6
|
||||
|
@ -55,22 +55,11 @@ ISC_LANG_BEGINDECLS
|
||||
/***
|
||||
*** Functions
|
||||
***/
|
||||
|
||||
isc_result_t
|
||||
dns_cache_create(isc_mem_t *cmctx, isc_taskmgr_t *taskmgr,
|
||||
dns_cache_create(isc_mem_t *cmctx, isc_mem_t *hmctx, isc_taskmgr_t *taskmgr,
|
||||
isc_timermgr_t *timermgr, dns_rdataclass_t rdclass,
|
||||
const char *db_type, unsigned int db_argc, char **db_argv,
|
||||
dns_cache_t **cachep);
|
||||
isc_result_t
|
||||
dns_cache_create2(isc_mem_t *cmctx, isc_taskmgr_t *taskmgr,
|
||||
isc_timermgr_t *timermgr, dns_rdataclass_t rdclass,
|
||||
const char *cachename, const char *db_type,
|
||||
unsigned int db_argc, char **db_argv, dns_cache_t **cachep);
|
||||
isc_result_t
|
||||
dns_cache_create3(isc_mem_t *cmctx, isc_mem_t *hmctx, isc_taskmgr_t *taskmgr,
|
||||
isc_timermgr_t *timermgr, dns_rdataclass_t rdclass,
|
||||
const char *cachename, const char *db_type,
|
||||
unsigned int db_argc, char **db_argv, dns_cache_t **cachep);
|
||||
const char *cachename, const char *db_type,
|
||||
unsigned int db_argc, char **db_argv, dns_cache_t **cachep);
|
||||
/*%<
|
||||
* Create a new DNS cache.
|
||||
*
|
||||
|
@ -162,16 +162,11 @@ isc_result_t
|
||||
dns_client_create(dns_client_t **clientp, unsigned int options);
|
||||
|
||||
isc_result_t
|
||||
dns_client_createx(isc_mem_t *mctx, isc_appctx_t *actx, isc_taskmgr_t *taskmgr,
|
||||
isc_socketmgr_t *socketmgr, isc_timermgr_t *timermgr,
|
||||
unsigned int options, dns_client_t **clientp);
|
||||
|
||||
isc_result_t
|
||||
dns_client_createx2(isc_mem_t *mctx, isc_appctx_t *actx,
|
||||
isc_taskmgr_t *taskmgr, isc_socketmgr_t *socketmgr,
|
||||
isc_timermgr_t *timermgr, unsigned int options,
|
||||
dns_client_t **clientp, const isc_sockaddr_t *localaddr4,
|
||||
const isc_sockaddr_t *localaddr6);
|
||||
dns_client_createx(isc_mem_t *mctx, isc_appctx_t *actx,
|
||||
isc_taskmgr_t *taskmgr, isc_socketmgr_t *socketmgr,
|
||||
isc_timermgr_t *timermgr, unsigned int options,
|
||||
dns_client_t **clientp, const isc_sockaddr_t *localaddr4,
|
||||
const isc_sockaddr_t *localaddr6);
|
||||
/*%<
|
||||
* Create a DNS client. These functions create a new client object with
|
||||
* minimal internal resources such as the default 'view' for the IN class and
|
||||
|
@ -518,14 +518,8 @@ dns_db_endload(dns_db_t *db, dns_rdatacallbacks_t *callbacks);
|
||||
*/
|
||||
|
||||
isc_result_t
|
||||
dns_db_load(dns_db_t *db, const char *filename);
|
||||
|
||||
isc_result_t
|
||||
dns_db_load2(dns_db_t *db, const char *filename, dns_masterformat_t format);
|
||||
|
||||
isc_result_t
|
||||
dns_db_load3(dns_db_t *db, const char *filename, dns_masterformat_t format,
|
||||
unsigned int options);
|
||||
dns_db_load(dns_db_t *db, const char *filename, dns_masterformat_t format,
|
||||
unsigned int options);
|
||||
/*%<
|
||||
* Load master file 'filename' into 'db'.
|
||||
*
|
||||
@ -575,10 +569,6 @@ dns_db_serialize(dns_db_t *db, dns_dbversion_t *version, FILE *rbtfile);
|
||||
|
||||
isc_result_t
|
||||
dns_db_dump(dns_db_t *db, dns_dbversion_t *version, const char *filename);
|
||||
|
||||
isc_result_t
|
||||
dns_db_dump2(dns_db_t *db, dns_dbversion_t *version, const char *filename,
|
||||
dns_masterformat_t masterformat);
|
||||
/*%<
|
||||
* Dump version 'version' of 'db' to master file 'filename'.
|
||||
*
|
||||
|
@ -290,17 +290,11 @@ dns_dispatch_getudp_dup(dns_dispatchmgr_t *mgr, isc_socketmgr_t *sockmgr,
|
||||
|
||||
isc_result_t
|
||||
dns_dispatch_createtcp(dns_dispatchmgr_t *mgr, isc_socket_t *sock,
|
||||
isc_taskmgr_t *taskmgr, unsigned int buffersize,
|
||||
isc_taskmgr_t *taskmgr, const isc_sockaddr_t *localaddr,
|
||||
const isc_sockaddr_t *destaddr, unsigned int buffersize,
|
||||
unsigned int maxbuffers, unsigned int maxrequests,
|
||||
unsigned int buckets, unsigned int increment,
|
||||
unsigned int attributes, dns_dispatch_t **dispp);
|
||||
isc_result_t
|
||||
dns_dispatch_createtcp2(dns_dispatchmgr_t *mgr, isc_socket_t *sock,
|
||||
isc_taskmgr_t *taskmgr, const isc_sockaddr_t *localaddr,
|
||||
const isc_sockaddr_t *destaddr, unsigned int buffersize,
|
||||
unsigned int maxbuffers, unsigned int maxrequests,
|
||||
unsigned int buckets, unsigned int increment,
|
||||
unsigned int attributes, dns_dispatch_t **dispp);
|
||||
/*%<
|
||||
* Create a new dns_dispatch and attach it to the provided isc_socket_t.
|
||||
*
|
||||
@ -374,34 +368,20 @@ dns_dispatch_starttcp(dns_dispatch_t *disp);
|
||||
|
||||
isc_result_t
|
||||
dns_dispatch_gettcp(dns_dispatchmgr_t *mgr, const isc_sockaddr_t *destaddr,
|
||||
const isc_sockaddr_t *localaddr, dns_dispatch_t **dispp);
|
||||
isc_result_t
|
||||
dns_dispatch_gettcp2(dns_dispatchmgr_t *mgr, const isc_sockaddr_t *destaddr,
|
||||
const isc_sockaddr_t *localaddr, isc_boolean_t *connected,
|
||||
dns_dispatch_t **dispp);
|
||||
/*
|
||||
* Attempt to connect to a existing TCP connection (connection completed
|
||||
* for dns_dispatch_gettcp()).
|
||||
* if connected == NULL).
|
||||
*/
|
||||
|
||||
|
||||
isc_result_t
|
||||
dns_dispatch_addresponse3(dns_dispatch_t *disp, unsigned int options,
|
||||
const isc_sockaddr_t *dest, isc_task_t *task,
|
||||
isc_taskaction_t action, void *arg,
|
||||
isc_uint16_t *idp, dns_dispentry_t **resp,
|
||||
isc_socketmgr_t *sockmgr);
|
||||
|
||||
isc_result_t
|
||||
dns_dispatch_addresponse2(dns_dispatch_t *disp, const isc_sockaddr_t *dest,
|
||||
isc_task_t *task, isc_taskaction_t action, void *arg,
|
||||
isc_uint16_t *idp, dns_dispentry_t **resp,
|
||||
isc_socketmgr_t *sockmgr);
|
||||
|
||||
isc_result_t
|
||||
dns_dispatch_addresponse(dns_dispatch_t *disp, const isc_sockaddr_t *dest,
|
||||
isc_task_t *task, isc_taskaction_t action, void *arg,
|
||||
isc_uint16_t *idp, dns_dispentry_t **resp);
|
||||
dns_dispatch_addresponse(dns_dispatch_t *disp, unsigned int options,
|
||||
const isc_sockaddr_t *dest, isc_task_t *task,
|
||||
isc_taskaction_t action, void *arg,
|
||||
isc_uint16_t *idp, dns_dispentry_t **resp,
|
||||
isc_socketmgr_t *sockmgr);
|
||||
/*%<
|
||||
* Add a response entry for this dispatch.
|
||||
*
|
||||
|
@ -119,18 +119,8 @@ dns_dnssec_sign(const dns_name_t *name, dns_rdataset_t *set, dst_key_t *key,
|
||||
|
||||
isc_result_t
|
||||
dns_dnssec_verify(const dns_name_t *name, dns_rdataset_t *set, dst_key_t *key,
|
||||
isc_boolean_t ignoretime, isc_mem_t *mctx,
|
||||
dns_rdata_t *sigrdata);
|
||||
|
||||
isc_result_t
|
||||
dns_dnssec_verify2(const dns_name_t *name, dns_rdataset_t *set, dst_key_t *key,
|
||||
isc_boolean_t ignoretime, isc_mem_t *mctx,
|
||||
dns_rdata_t *sigrdata, dns_name_t *wild);
|
||||
|
||||
isc_result_t
|
||||
dns_dnssec_verify3(const dns_name_t *name, dns_rdataset_t *set, dst_key_t *key,
|
||||
isc_boolean_t ignoretime, unsigned int maxbits,
|
||||
isc_mem_t *mctx, dns_rdata_t *sigrdata, dns_name_t *wild);
|
||||
isc_boolean_t ignoretime, unsigned int maxbits,
|
||||
isc_mem_t *mctx, dns_rdata_t *sigrdata, dns_name_t *wild);
|
||||
/*%<
|
||||
* Verifies the RRSIG record covering this rdataset signed by a specific
|
||||
* key. This does not determine if the key's owner is authorized to sign
|
||||
@ -164,24 +154,11 @@ dns_dnssec_verify3(const dns_name_t *name, dns_rdataset_t *set, dst_key_t *key,
|
||||
|
||||
/*@{*/
|
||||
isc_result_t
|
||||
dns_dnssec_findzonekeys(dns_db_t *db, dns_dbversion_t *ver, dns_dbnode_t *node,
|
||||
const dns_name_t *name, isc_mem_t *mctx,
|
||||
unsigned int maxkeys, dst_key_t **keys,
|
||||
unsigned int *nkeys);
|
||||
|
||||
isc_result_t
|
||||
dns_dnssec_findzonekeys2(dns_db_t *db, dns_dbversion_t *ver,
|
||||
dns_dbnode_t *node, const dns_name_t *name,
|
||||
const char *directory, isc_mem_t *mctx,
|
||||
unsigned int maxkeys, dst_key_t **keys,
|
||||
unsigned int *nkeys);
|
||||
|
||||
isc_result_t
|
||||
dns_dnssec_findzonekeys3(dns_db_t *db, dns_dbversion_t *ver,
|
||||
dns_dbnode_t *node, const dns_name_t *name,
|
||||
const char *directory, isc_stdtime_t now,
|
||||
isc_mem_t *mctx, unsigned int maxkeys,
|
||||
dst_key_t **keys, unsigned int *nkeys);
|
||||
dns_dnssec_findzonekeys(dns_db_t *db, dns_dbversion_t *ver,
|
||||
dns_dbnode_t *node, const dns_name_t *name,
|
||||
const char *directory, isc_stdtime_t now,
|
||||
isc_mem_t *mctx, unsigned int maxkeys,
|
||||
dst_key_t **keys, unsigned int *nkeys);
|
||||
|
||||
/*%<
|
||||
* Finds a set of zone keys.
|
||||
@ -291,12 +268,8 @@ dns_dnsseckey_destroy(isc_mem_t *mctx, dns_dnsseckey_t **dkp);
|
||||
|
||||
isc_result_t
|
||||
dns_dnssec_findmatchingkeys(const dns_name_t *origin, const char *directory,
|
||||
isc_mem_t *mctx, dns_dnsseckeylist_t *keylist);
|
||||
|
||||
isc_result_t
|
||||
dns_dnssec_findmatchingkeys2(const dns_name_t *origin, const char *directory,
|
||||
isc_stdtime_t now, isc_mem_t *mctx,
|
||||
dns_dnsseckeylist_t *keylist);
|
||||
isc_stdtime_t now, isc_mem_t *mctx,
|
||||
dns_dnsseckeylist_t *keylist);
|
||||
/*%<
|
||||
* Search 'directory' for K* key files matching the name in 'origin'.
|
||||
* Append all such keys, along with use hints gleaned from their
|
||||
|
@ -118,12 +118,8 @@ struct dns_dtdata {
|
||||
|
||||
isc_result_t
|
||||
dns_dt_create(isc_mem_t *mctx, dns_dtmode_t mode, const char *path,
|
||||
struct fstrm_iothr_options **foptp, dns_dtenv_t **envp);
|
||||
|
||||
isc_result_t
|
||||
dns_dt_create2(isc_mem_t *mctx, dns_dtmode_t mode, const char *path,
|
||||
struct fstrm_iothr_options **foptp, isc_task_t *reopen_task,
|
||||
dns_dtenv_t **envp);
|
||||
struct fstrm_iothr_options **foptp, isc_task_t *reopen_task,
|
||||
dns_dtenv_t **envp);
|
||||
/*%<
|
||||
* Create and initialize the dnstap environment.
|
||||
*
|
||||
|
@ -89,24 +89,7 @@ dns_fwdtable_delete(dns_fwdtable_t *fwdtable, const dns_name_t *name);
|
||||
|
||||
isc_result_t
|
||||
dns_fwdtable_find(dns_fwdtable_t *fwdtable, const dns_name_t *name,
|
||||
dns_forwarders_t **forwardersp);
|
||||
/*%<
|
||||
* Finds a domain in the forwarding table. The closest matching parent
|
||||
* domain is returned.
|
||||
*
|
||||
* Requires:
|
||||
* \li fwdtable is a valid forwarding table.
|
||||
* \li name is a valid name
|
||||
* \li forwardersp != NULL && *forwardersp == NULL
|
||||
*
|
||||
* Returns:
|
||||
* \li #ISC_R_SUCCESS
|
||||
* \li #ISC_R_NOTFOUND
|
||||
*/
|
||||
|
||||
isc_result_t
|
||||
dns_fwdtable_find2(dns_fwdtable_t *fwdtable, const dns_name_t *name,
|
||||
dns_name_t *foundname, dns_forwarders_t **forwardersp);
|
||||
dns_name_t *foundname, dns_forwarders_t **forwardersp);
|
||||
/*%<
|
||||
* Finds a domain in the forwarding table. The closest matching parent
|
||||
* domain is returned.
|
||||
|
@ -45,11 +45,8 @@ dns_iptable_create(isc_mem_t *mctx, dns_iptable_t **target);
|
||||
|
||||
isc_result_t
|
||||
dns_iptable_addprefix(dns_iptable_t *tab, const isc_netaddr_t *addr,
|
||||
isc_uint16_t bitlen, isc_boolean_t pos);
|
||||
isc_result_t
|
||||
dns_iptable_addprefix2(dns_iptable_t *tab, const isc_netaddr_t *addr,
|
||||
isc_uint16_t bitlen, isc_boolean_t pos,
|
||||
isc_boolean_t is_ecs);
|
||||
isc_uint16_t bitlen, isc_boolean_t pos,
|
||||
isc_boolean_t is_ecs);
|
||||
/*
|
||||
* Add an IP prefix to an existing IP table
|
||||
*/
|
||||
|
@ -105,9 +105,6 @@ dns_keytable_detach(dns_keytable_t **keytablep);
|
||||
|
||||
isc_result_t
|
||||
dns_keytable_add(dns_keytable_t *keytable, isc_boolean_t managed,
|
||||
dst_key_t **keyp) ISC_DEPRECATED;
|
||||
isc_result_t
|
||||
dns_keytable_add2(dns_keytable_t *keytable, isc_boolean_t managed,
|
||||
isc_boolean_t initial, dst_key_t **keyp);
|
||||
/*%<
|
||||
* Add '*keyp' to 'keytable' (using the name in '*keyp').
|
||||
|
@ -118,54 +118,12 @@ dns_master_loadfile(const char *master_file,
|
||||
dns_name_t *origin,
|
||||
dns_rdataclass_t zclass,
|
||||
unsigned int options,
|
||||
isc_uint32_t resign,
|
||||
dns_rdatacallbacks_t *callbacks,
|
||||
isc_mem_t *mctx);
|
||||
|
||||
isc_result_t
|
||||
dns_master_loadfile2(const char *master_file,
|
||||
dns_name_t *top,
|
||||
dns_name_t *origin,
|
||||
dns_rdataclass_t zclass,
|
||||
unsigned int options,
|
||||
dns_rdatacallbacks_t *callbacks,
|
||||
isc_mem_t *mctx,
|
||||
dns_masterformat_t format);
|
||||
|
||||
isc_result_t
|
||||
dns_master_loadfile3(const char *master_file,
|
||||
dns_name_t *top,
|
||||
dns_name_t *origin,
|
||||
dns_rdataclass_t zclass,
|
||||
unsigned int options,
|
||||
isc_uint32_t resign,
|
||||
dns_rdatacallbacks_t *callbacks,
|
||||
isc_mem_t *mctx,
|
||||
dns_masterformat_t format);
|
||||
|
||||
isc_result_t
|
||||
dns_master_loadfile4(const char *master_file,
|
||||
dns_name_t *top,
|
||||
dns_name_t *origin,
|
||||
dns_rdataclass_t zclass,
|
||||
unsigned int options,
|
||||
isc_uint32_t resign,
|
||||
dns_rdatacallbacks_t *callbacks,
|
||||
dns_masterincludecb_t include_cb,
|
||||
void *include_arg, isc_mem_t *mctx,
|
||||
dns_masterformat_t format);
|
||||
|
||||
isc_result_t
|
||||
dns_master_loadfile5(const char *master_file,
|
||||
dns_name_t *top,
|
||||
dns_name_t *origin,
|
||||
dns_rdataclass_t zclass,
|
||||
unsigned int options,
|
||||
isc_uint32_t resign,
|
||||
dns_rdatacallbacks_t *callbacks,
|
||||
dns_masterincludecb_t include_cb,
|
||||
void *include_arg, isc_mem_t *mctx,
|
||||
dns_masterformat_t format,
|
||||
dns_ttl_t maxttl);
|
||||
dns_masterincludecb_t include_cb,
|
||||
void *include_arg, isc_mem_t *mctx,
|
||||
dns_masterformat_t format,
|
||||
dns_ttl_t maxttl);
|
||||
|
||||
isc_result_t
|
||||
dns_master_loadstream(FILE *stream,
|
||||
@ -200,64 +158,14 @@ dns_master_loadfileinc(const char *master_file,
|
||||
dns_name_t *origin,
|
||||
dns_rdataclass_t zclass,
|
||||
unsigned int options,
|
||||
isc_uint32_t resign,
|
||||
dns_rdatacallbacks_t *callbacks,
|
||||
isc_task_t *task,
|
||||
dns_loaddonefunc_t done, void *done_arg,
|
||||
dns_loadctx_t **ctxp, isc_mem_t *mctx);
|
||||
|
||||
isc_result_t
|
||||
dns_master_loadfileinc2(const char *master_file,
|
||||
dns_name_t *top,
|
||||
dns_name_t *origin,
|
||||
dns_rdataclass_t zclass,
|
||||
unsigned int options,
|
||||
dns_rdatacallbacks_t *callbacks,
|
||||
isc_task_t *task,
|
||||
dns_loaddonefunc_t done, void *done_arg,
|
||||
dns_loadctx_t **ctxp, isc_mem_t *mctx,
|
||||
dns_masterformat_t format);
|
||||
|
||||
isc_result_t
|
||||
dns_master_loadfileinc3(const char *master_file,
|
||||
dns_name_t *top,
|
||||
dns_name_t *origin,
|
||||
dns_rdataclass_t zclass,
|
||||
unsigned int options,
|
||||
isc_uint32_t resign,
|
||||
dns_rdatacallbacks_t *callbacks,
|
||||
isc_task_t *task,
|
||||
dns_loaddonefunc_t done, void *done_arg,
|
||||
dns_loadctx_t **ctxp, isc_mem_t *mctx,
|
||||
dns_masterformat_t format);
|
||||
|
||||
isc_result_t
|
||||
dns_master_loadfileinc4(const char *master_file,
|
||||
dns_name_t *top,
|
||||
dns_name_t *origin,
|
||||
dns_rdataclass_t zclass,
|
||||
unsigned int options,
|
||||
isc_uint32_t resign,
|
||||
dns_rdatacallbacks_t *callbacks,
|
||||
isc_task_t *task,
|
||||
dns_loaddonefunc_t done, void *done_arg,
|
||||
dns_loadctx_t **ctxp,
|
||||
dns_masterincludecb_t include_cb, void *include_arg,
|
||||
isc_mem_t *mctx, dns_masterformat_t format);
|
||||
|
||||
isc_result_t
|
||||
dns_master_loadfileinc5(const char *master_file,
|
||||
dns_name_t *top,
|
||||
dns_name_t *origin,
|
||||
dns_rdataclass_t zclass,
|
||||
unsigned int options,
|
||||
isc_uint32_t resign,
|
||||
dns_rdatacallbacks_t *callbacks,
|
||||
isc_task_t *task,
|
||||
dns_loaddonefunc_t done, void *done_arg,
|
||||
dns_loadctx_t **ctxp,
|
||||
dns_masterincludecb_t include_cb, void *include_arg,
|
||||
isc_mem_t *mctx, dns_masterformat_t format,
|
||||
isc_uint32_t maxttl);
|
||||
dns_loadctx_t **ctxp,
|
||||
dns_masterincludecb_t include_cb, void *include_arg,
|
||||
isc_mem_t *mctx, dns_masterformat_t format,
|
||||
isc_uint32_t maxttl);
|
||||
|
||||
isc_result_t
|
||||
dns_master_loadstreaminc(FILE *stream,
|
||||
|
@ -267,20 +267,9 @@ dns_master_dumptostreaminc(isc_mem_t *mctx, dns_db_t *db,
|
||||
isc_result_t
|
||||
dns_master_dumptostream(isc_mem_t *mctx, dns_db_t *db,
|
||||
dns_dbversion_t *version,
|
||||
const dns_master_style_t *style, FILE *f);
|
||||
|
||||
isc_result_t
|
||||
dns_master_dumptostream2(isc_mem_t *mctx, dns_db_t *db,
|
||||
dns_dbversion_t *version,
|
||||
const dns_master_style_t *style,
|
||||
dns_masterformat_t format, FILE *f);
|
||||
|
||||
isc_result_t
|
||||
dns_master_dumptostream3(isc_mem_t *mctx, dns_db_t *db,
|
||||
dns_dbversion_t *version,
|
||||
const dns_master_style_t *style,
|
||||
dns_masterformat_t format,
|
||||
dns_masterrawheader_t *header, FILE *f);
|
||||
const dns_master_style_t *style,
|
||||
dns_masterformat_t format,
|
||||
dns_masterrawheader_t *header, FILE *f);
|
||||
/*%<
|
||||
* Dump the database 'db' to the steam 'f' in the specified format by
|
||||
* 'format'. If the format is dns_masterformat_text (the RFC1035 format),
|
||||
@ -311,40 +300,19 @@ dns_master_dumptostream3(isc_mem_t *mctx, dns_db_t *db,
|
||||
/*@}*/
|
||||
|
||||
/*@{*/
|
||||
|
||||
isc_result_t
|
||||
dns_master_dumpinc(isc_mem_t *mctx, dns_db_t *db, dns_dbversion_t *version,
|
||||
const dns_master_style_t *style, const char *filename,
|
||||
isc_task_t *task, dns_dumpdonefunc_t done, void *done_arg,
|
||||
dns_dumpctx_t **dctxp);
|
||||
|
||||
isc_result_t
|
||||
dns_master_dumpinc2(isc_mem_t *mctx, dns_db_t *db, dns_dbversion_t *version,
|
||||
const dns_master_style_t *style, const char *filename,
|
||||
isc_task_t *task, dns_dumpdonefunc_t done, void *done_arg, dns_dumpctx_t **dctxp, dns_masterformat_t format);
|
||||
|
||||
isc_result_t
|
||||
dns_master_dumpinc3(isc_mem_t *mctx, dns_db_t *db, dns_dbversion_t *version,
|
||||
const dns_master_style_t *style, const char *filename,
|
||||
isc_task_t *task, dns_dumpdonefunc_t done, void
|
||||
*done_arg, dns_dumpctx_t **dctxp,
|
||||
dns_masterformat_t format, dns_masterrawheader_t *header);
|
||||
isc_task_t *task, dns_dumpdonefunc_t done, void
|
||||
*done_arg, dns_dumpctx_t **dctxp,
|
||||
dns_masterformat_t format, dns_masterrawheader_t *header);
|
||||
|
||||
isc_result_t
|
||||
dns_master_dump(isc_mem_t *mctx, dns_db_t *db,
|
||||
dns_dbversion_t *version,
|
||||
const dns_master_style_t *style, const char *filename);
|
||||
|
||||
isc_result_t
|
||||
dns_master_dump2(isc_mem_t *mctx, dns_db_t *db,
|
||||
dns_dbversion_t *version,
|
||||
const dns_master_style_t *style, const char *filename,
|
||||
dns_masterformat_t format);
|
||||
|
||||
isc_result_t
|
||||
dns_master_dump3(isc_mem_t *mctx, dns_db_t *db,
|
||||
dns_dbversion_t *version,
|
||||
const dns_master_style_t *style, const char *filename,
|
||||
dns_masterformat_t format, dns_masterrawheader_t *header);
|
||||
const dns_master_style_t *style, const char *filename,
|
||||
dns_masterformat_t format, dns_masterrawheader_t *header);
|
||||
|
||||
/*%<
|
||||
* Dump the database 'db' to the file 'filename' in the specified format by
|
||||
@ -414,15 +382,7 @@ dns_master_stylecreate(dns_master_style_t **style,
|
||||
unsigned int ttl_column, unsigned int class_column,
|
||||
unsigned int type_column, unsigned int rdata_column,
|
||||
unsigned int line_length, unsigned int tab_width,
|
||||
isc_mem_t *mctx);
|
||||
|
||||
isc_result_t
|
||||
dns_master_stylecreate2(dns_master_style_t **style,
|
||||
dns_masterstyle_flags_t flags,
|
||||
unsigned int ttl_column, unsigned int class_column,
|
||||
unsigned int type_column, unsigned int rdata_column,
|
||||
unsigned int line_length, unsigned int tab_width,
|
||||
unsigned int split_width, isc_mem_t *mctx);
|
||||
unsigned int split_width, isc_mem_t *mctx);
|
||||
|
||||
void
|
||||
dns_master_styledestroy(dns_master_style_t **style, isc_mem_t *mctx);
|
||||
|
@ -1375,25 +1375,17 @@ dns_message_gettimeadjust(dns_message_t *msg);
|
||||
*/
|
||||
|
||||
void
|
||||
dns_message_logpacket(dns_message_t *message, const char *description,
|
||||
dns_message_logpacket(dns_message_t *message,
|
||||
const char *description, const isc_sockaddr_t *address,
|
||||
isc_logcategory_t *category, isc_logmodule_t *module,
|
||||
int level, isc_mem_t *mctx);
|
||||
void
|
||||
dns_message_logpacket2(dns_message_t *message,
|
||||
const char *description, const isc_sockaddr_t *address,
|
||||
isc_logcategory_t *category, isc_logmodule_t *module,
|
||||
int level, isc_mem_t *mctx);
|
||||
|
||||
void
|
||||
dns_message_logfmtpacket(dns_message_t *message, const char *description,
|
||||
const isc_sockaddr_t *address,
|
||||
isc_logcategory_t *category, isc_logmodule_t *module,
|
||||
const dns_master_style_t *style, int level,
|
||||
isc_mem_t *mctx);
|
||||
void
|
||||
dns_message_logfmtpacket2(dns_message_t *message, const char *description,
|
||||
const isc_sockaddr_t *address,
|
||||
isc_logcategory_t *category, isc_logmodule_t *module,
|
||||
const dns_master_style_t *style, int level,
|
||||
isc_mem_t *mctx);
|
||||
/*%<
|
||||
* Log 'message' at the specified logging parameters.
|
||||
*
|
||||
|
@ -193,45 +193,15 @@ dns_request_create(dns_requestmgr_t *requestmgr, dns_message_t *message,
|
||||
*\li requestp != NULL && *requestp == NULL
|
||||
*/
|
||||
|
||||
/*% See dns_request_createvia4() */
|
||||
isc_result_t
|
||||
dns_request_createvia(dns_requestmgr_t *requestmgr, dns_message_t *message,
|
||||
const isc_sockaddr_t *srcaddr,
|
||||
const isc_sockaddr_t *destaddr, unsigned int options,
|
||||
const isc_sockaddr_t *destaddr,
|
||||
isc_dscp_t dscp, unsigned int options,
|
||||
dns_tsigkey_t *key, unsigned int timeout,
|
||||
unsigned int udptimeout, unsigned int udpretries,
|
||||
isc_task_t *task, isc_taskaction_t action, void *arg,
|
||||
dns_request_t **requestp);
|
||||
|
||||
/*% See dns_request_createvia4() */
|
||||
isc_result_t
|
||||
dns_request_createvia2(dns_requestmgr_t *requestmgr, dns_message_t *message,
|
||||
const isc_sockaddr_t *srcaddr,
|
||||
const isc_sockaddr_t *destaddr,
|
||||
unsigned int options, dns_tsigkey_t *key,
|
||||
unsigned int timeout, unsigned int udptimeout,
|
||||
isc_task_t *task, isc_taskaction_t action, void *arg,
|
||||
dns_request_t **requestp);
|
||||
|
||||
/*% See dns_request_createvia4() */
|
||||
isc_result_t
|
||||
dns_request_createvia3(dns_requestmgr_t *requestmgr, dns_message_t *message,
|
||||
const isc_sockaddr_t *srcaddr,
|
||||
const isc_sockaddr_t *destaddr,
|
||||
unsigned int options, dns_tsigkey_t *key,
|
||||
unsigned int timeout, unsigned int udptimeout,
|
||||
unsigned int udpretries, isc_task_t *task,
|
||||
isc_taskaction_t action, void *arg,
|
||||
dns_request_t **requestp);
|
||||
|
||||
isc_result_t
|
||||
dns_request_createvia4(dns_requestmgr_t *requestmgr, dns_message_t *message,
|
||||
const isc_sockaddr_t *srcaddr,
|
||||
const isc_sockaddr_t *destaddr,
|
||||
isc_dscp_t dscp, unsigned int options,
|
||||
dns_tsigkey_t *key, unsigned int timeout,
|
||||
unsigned int udptimeout, unsigned int udpretries,
|
||||
isc_task_t *task, isc_taskaction_t action, void *arg,
|
||||
dns_request_t **requestp);
|
||||
/*%<
|
||||
* Create and send a request.
|
||||
*
|
||||
@ -267,44 +237,15 @@ dns_request_createvia4(dns_requestmgr_t *requestmgr, dns_message_t *message,
|
||||
*\li requestp != NULL && *requestp == NULL
|
||||
*/
|
||||
|
||||
/*% See dns_request_createraw4() */
|
||||
isc_result_t
|
||||
dns_request_createraw(dns_requestmgr_t *requestmgr, isc_buffer_t *msgbuf,
|
||||
const isc_sockaddr_t *srcaddr,
|
||||
const isc_sockaddr_t *destaddr,
|
||||
unsigned int options, unsigned int timeout,
|
||||
isc_task_t *task, isc_taskaction_t action, void *arg,
|
||||
isc_dscp_t dscp, unsigned int options,
|
||||
unsigned int timeout, unsigned int udptimeout,
|
||||
unsigned int udpretries, isc_task_t *task,
|
||||
isc_taskaction_t action, void *arg,
|
||||
dns_request_t **requestp);
|
||||
|
||||
/*% See dns_request_createraw4() */
|
||||
isc_result_t
|
||||
dns_request_createraw2(dns_requestmgr_t *requestmgr, isc_buffer_t *msgbuf,
|
||||
const isc_sockaddr_t *srcaddr,
|
||||
const isc_sockaddr_t *destaddr,
|
||||
unsigned int options, unsigned int timeout,
|
||||
unsigned int udptimeout, isc_task_t *task,
|
||||
isc_taskaction_t action, void *arg,
|
||||
dns_request_t **requestp);
|
||||
|
||||
/*% See dns_request_createraw4() */
|
||||
isc_result_t
|
||||
dns_request_createraw3(dns_requestmgr_t *requestmgr, isc_buffer_t *msgbuf,
|
||||
const isc_sockaddr_t *srcaddr,
|
||||
const isc_sockaddr_t *destaddr,
|
||||
unsigned int options, unsigned int timeout,
|
||||
unsigned int udptimeout, unsigned int udpretries,
|
||||
isc_task_t *task, isc_taskaction_t action, void *arg,
|
||||
dns_request_t **requestp);
|
||||
|
||||
isc_result_t
|
||||
dns_request_createraw4(dns_requestmgr_t *requestmgr, isc_buffer_t *msgbuf,
|
||||
const isc_sockaddr_t *srcaddr,
|
||||
const isc_sockaddr_t *destaddr,
|
||||
isc_dscp_t dscp, unsigned int options,
|
||||
unsigned int timeout, unsigned int udptimeout,
|
||||
unsigned int udpretries, isc_task_t *task,
|
||||
isc_taskaction_t action, void *arg,
|
||||
dns_request_t **requestp);
|
||||
/*!<
|
||||
* \brief Create and send a request.
|
||||
*
|
||||
|
@ -267,35 +267,13 @@ dns_resolver_createfetch(dns_resolver_t *res, const dns_name_t *name,
|
||||
dns_rdatatype_t type,
|
||||
const dns_name_t *domain, dns_rdataset_t *nameservers,
|
||||
dns_forwarders_t *forwarders,
|
||||
unsigned int options, isc_task_t *task,
|
||||
const isc_sockaddr_t *client, isc_uint16_t id,
|
||||
unsigned int options, unsigned int depth,
|
||||
isc_counter_t *qc, isc_task_t *task,
|
||||
isc_taskaction_t action, void *arg,
|
||||
dns_rdataset_t *rdataset,
|
||||
dns_rdataset_t *sigrdataset,
|
||||
dns_fetch_t **fetchp);
|
||||
|
||||
isc_result_t
|
||||
dns_resolver_createfetch2(dns_resolver_t *res, const dns_name_t *name,
|
||||
dns_rdatatype_t type,
|
||||
const dns_name_t *domain, dns_rdataset_t *nameservers,
|
||||
dns_forwarders_t *forwarders,
|
||||
const isc_sockaddr_t *client, isc_uint16_t id,
|
||||
unsigned int options, isc_task_t *task,
|
||||
isc_taskaction_t action, void *arg,
|
||||
dns_rdataset_t *rdataset,
|
||||
dns_rdataset_t *sigrdataset,
|
||||
dns_fetch_t **fetchp);
|
||||
isc_result_t
|
||||
dns_resolver_createfetch3(dns_resolver_t *res, const dns_name_t *name,
|
||||
dns_rdatatype_t type,
|
||||
const dns_name_t *domain, dns_rdataset_t *nameservers,
|
||||
dns_forwarders_t *forwarders,
|
||||
const isc_sockaddr_t *client, isc_uint16_t id,
|
||||
unsigned int options, unsigned int depth,
|
||||
isc_counter_t *qc, isc_task_t *task,
|
||||
isc_taskaction_t action, void *arg,
|
||||
dns_rdataset_t *rdataset,
|
||||
dns_rdataset_t *sigrdataset,
|
||||
dns_fetch_t **fetchp);
|
||||
/*%<
|
||||
* Recurse to answer a question.
|
||||
*
|
||||
|
@ -129,10 +129,6 @@ dns_ssutable_addrule(dns_ssutable_t *table, isc_boolean_t grant,
|
||||
|
||||
isc_boolean_t
|
||||
dns_ssutable_checkrules(dns_ssutable_t *table, const dns_name_t *signer,
|
||||
const dns_name_t *name, const isc_netaddr_t *addr,
|
||||
dns_rdatatype_t type, const dst_key_t *key);
|
||||
isc_boolean_t
|
||||
dns_ssutable_checkrules2(dns_ssutable_t *table, const dns_name_t *signer,
|
||||
const dns_name_t *name, const isc_netaddr_t *addr,
|
||||
isc_boolean_t tcp, const dns_aclenv_t *env,
|
||||
dns_rdatatype_t type, const dst_key_t *key);
|
||||
|
@ -31,10 +31,7 @@ ISC_LANG_BEGINDECLS
|
||||
|
||||
isc_result_t
|
||||
dns_ttl_totext(isc_uint32_t src, isc_boolean_t verbose,
|
||||
isc_buffer_t *target);
|
||||
isc_result_t
|
||||
dns_ttl_totext2(isc_uint32_t src, isc_boolean_t verbose,
|
||||
isc_boolean_t upcase, isc_buffer_t *target);
|
||||
isc_boolean_t upcase, isc_buffer_t *target);
|
||||
/*%<
|
||||
* Output a TTL or other time interval in a human-readable form.
|
||||
* The time interval is given as a count of seconds in 'src'.
|
||||
|
@ -416,9 +416,7 @@ dns_view_createresolver(dns_view_t *view,
|
||||
*/
|
||||
|
||||
void
|
||||
dns_view_setcache(dns_view_t *view, dns_cache_t *cache);
|
||||
void
|
||||
dns_view_setcache2(dns_view_t *view, dns_cache_t *cache, isc_boolean_t shared);
|
||||
dns_view_setcache(dns_view_t *view, dns_cache_t *cache, isc_boolean_t shared);
|
||||
/*%<
|
||||
* Set the view's cache database. If 'shared' is true, this means the cache
|
||||
* is created by another view and is shared with that view. dns_view_setcache()
|
||||
@ -546,17 +544,13 @@ dns_view_thaw(dns_view_t *view);
|
||||
*
|
||||
*\li 'view' is no longer frozen.
|
||||
*/
|
||||
|
||||
isc_result_t
|
||||
dns_view_find(dns_view_t *view, const dns_name_t *name, dns_rdatatype_t type,
|
||||
isc_stdtime_t now, unsigned int options, isc_boolean_t use_hints,
|
||||
isc_stdtime_t now, unsigned int options,
|
||||
isc_boolean_t use_hints, isc_boolean_t use_static_stub,
|
||||
dns_db_t **dbp, dns_dbnode_t **nodep, dns_name_t *foundname,
|
||||
dns_rdataset_t *rdataset, dns_rdataset_t *sigrdataset);
|
||||
isc_result_t
|
||||
dns_view_find2(dns_view_t *view, const dns_name_t *name, dns_rdatatype_t type,
|
||||
isc_stdtime_t now, unsigned int options,
|
||||
isc_boolean_t use_hints, isc_boolean_t use_static_stub,
|
||||
dns_db_t **dbp, dns_dbnode_t **nodep, dns_name_t *foundname,
|
||||
dns_rdataset_t *rdataset, dns_rdataset_t *sigrdataset);
|
||||
/*%<
|
||||
* Find an rdataset whose owner name is 'name', and whose type is
|
||||
* 'type'.
|
||||
@ -703,19 +697,12 @@ dns_view_simplefind(dns_view_t *view, const dns_name_t *name,
|
||||
* or an error occurred.
|
||||
*/
|
||||
|
||||
/*% See dns_view_findzonecut2() */
|
||||
isc_result_t
|
||||
dns_view_findzonecut(dns_view_t *view, const dns_name_t *name,
|
||||
dns_name_t *fname, isc_stdtime_t now,
|
||||
unsigned int options, isc_boolean_t use_hints,
|
||||
unsigned int options,
|
||||
isc_boolean_t use_hints, isc_boolean_t use_cache,
|
||||
dns_rdataset_t *rdataset, dns_rdataset_t *sigrdataset);
|
||||
|
||||
isc_result_t
|
||||
dns_view_findzonecut2(dns_view_t *view, const dns_name_t *name,
|
||||
dns_name_t *fname, isc_stdtime_t now,
|
||||
unsigned int options,
|
||||
isc_boolean_t use_hints, isc_boolean_t use_cache,
|
||||
dns_rdataset_t *rdataset, dns_rdataset_t *sigrdataset);
|
||||
/*%<
|
||||
* Find the best known zonecut containing 'name'.
|
||||
*
|
||||
@ -907,9 +894,7 @@ dns_view_dumpdbtostream(dns_view_t *view, FILE *fp);
|
||||
*/
|
||||
|
||||
isc_result_t
|
||||
dns_view_flushcache(dns_view_t *view);
|
||||
isc_result_t
|
||||
dns_view_flushcache2(dns_view_t *view, isc_boolean_t fixuponly);
|
||||
dns_view_flushcache(dns_view_t *view, isc_boolean_t fixuponly);
|
||||
/*%<
|
||||
* Flush the view's cache (and ADB). If 'fixuponly' is true, it only updates
|
||||
* the internal reference to the cache DB with omitting actual flush operation.
|
||||
|
@ -46,31 +46,14 @@ typedef struct dns_xfrin_ctx dns_xfrin_ctx_t;
|
||||
|
||||
ISC_LANG_BEGINDECLS
|
||||
|
||||
/*% see dns_xfrin_create2() */
|
||||
isc_result_t
|
||||
dns_xfrin_create(dns_zone_t *zone, dns_rdatatype_t xfrtype,
|
||||
const isc_sockaddr_t *masteraddr, dns_tsigkey_t *tsigkey,
|
||||
isc_mem_t *mctx, isc_timermgr_t *timermgr,
|
||||
isc_socketmgr_t *socketmgr, isc_task_t *task,
|
||||
dns_xfrindone_t done, dns_xfrin_ctx_t **xfrp);
|
||||
|
||||
isc_result_t
|
||||
dns_xfrin_create2(dns_zone_t *zone, dns_rdatatype_t xfrtype,
|
||||
const isc_sockaddr_t *masteraddr,
|
||||
const isc_sockaddr_t *sourceaddr,
|
||||
dns_tsigkey_t *tsigkey, isc_mem_t *mctx,
|
||||
isc_timermgr_t *timermgr, isc_socketmgr_t *socketmgr,
|
||||
isc_task_t *task, dns_xfrindone_t done,
|
||||
dns_xfrin_ctx_t **xfrp);
|
||||
|
||||
isc_result_t
|
||||
dns_xfrin_create3(dns_zone_t *zone, dns_rdatatype_t xfrtype,
|
||||
const isc_sockaddr_t *masteraddr,
|
||||
const isc_sockaddr_t *sourceaddr,
|
||||
isc_dscp_t dscp, dns_tsigkey_t *tsigkey, isc_mem_t *mctx,
|
||||
isc_timermgr_t *timermgr, isc_socketmgr_t *socketmgr,
|
||||
isc_task_t *task, dns_xfrindone_t done,
|
||||
dns_xfrin_ctx_t **xfrp);
|
||||
const isc_sockaddr_t *masteraddr,
|
||||
const isc_sockaddr_t *sourceaddr,
|
||||
isc_dscp_t dscp, dns_tsigkey_t *tsigkey, isc_mem_t *mctx,
|
||||
isc_timermgr_t *timermgr, isc_socketmgr_t *socketmgr,
|
||||
isc_task_t *task, dns_xfrindone_t done,
|
||||
dns_xfrin_ctx_t **xfrp);
|
||||
/*%<
|
||||
* Attempt to start an incoming zone transfer of 'zone'
|
||||
* from 'masteraddr', creating a dns_xfrin_ctx_t object to
|
||||
|
@ -49,53 +49,38 @@ typedef enum {
|
||||
dns_zonestat_full
|
||||
} dns_zonestat_level_t;
|
||||
|
||||
#define DNS_ZONEOPT_SERVERS 0x00000001U /*%< perform server checks */
|
||||
#define DNS_ZONEOPT_PARENTS 0x00000002U /*%< perform parent checks */
|
||||
#define DNS_ZONEOPT_CHILDREN 0x00000004U /*%< perform child checks */
|
||||
#define DNS_ZONEOPT_NOTIFY 0x00000008U /*%< perform NOTIFY */
|
||||
#define DNS_ZONEOPT_MANYERRORS 0x00000010U /*%< return many errors on load */
|
||||
#define DNS_ZONEOPT_IXFRFROMDIFFS 0x00000020U /*%< calculate differences */
|
||||
#define DNS_ZONEOPT_NOMERGE 0x00000040U /*%< don't merge journal */
|
||||
#define DNS_ZONEOPT_CHECKNS 0x00000080U /*%< check if NS's are addresses */
|
||||
#define DNS_ZONEOPT_FATALNS 0x00000100U /*%< DNS_ZONEOPT_CHECKNS is fatal */
|
||||
#define DNS_ZONEOPT_MULTIMASTER 0x00000200U /*%< this zone has multiple masters */
|
||||
#define DNS_ZONEOPT_USEALTXFRSRC 0x00000400U /*%< use alternate transfer sources */
|
||||
#define DNS_ZONEOPT_CHECKNAMES 0x00000800U /*%< check-names */
|
||||
#define DNS_ZONEOPT_CHECKNAMESFAIL 0x00001000U /*%< fatal check-name failures */
|
||||
#define DNS_ZONEOPT_CHECKWILDCARD 0x00002000U /*%< check for internal wildcards */
|
||||
#define DNS_ZONEOPT_CHECKMX 0x00004000U /*%< check-mx */
|
||||
#define DNS_ZONEOPT_CHECKMXFAIL 0x00008000U /*%< fatal check-mx failures */
|
||||
#define DNS_ZONEOPT_CHECKINTEGRITY 0x00010000U /*%< perform integrity checks */
|
||||
#define DNS_ZONEOPT_CHECKSIBLING 0x00020000U /*%< perform sibling glue checks */
|
||||
#define DNS_ZONEOPT_NOCHECKNS 0x00040000U /*%< disable IN NS address checks */
|
||||
#define DNS_ZONEOPT_WARNMXCNAME 0x00080000U /*%< warn on MX CNAME check */
|
||||
#define DNS_ZONEOPT_IGNOREMXCNAME 0x00100000U /*%< ignore MX CNAME check */
|
||||
#define DNS_ZONEOPT_WARNSRVCNAME 0x00200000U /*%< warn on SRV CNAME check */
|
||||
#define DNS_ZONEOPT_IGNORESRVCNAME 0x00400000U /*%< ignore SRV CNAME check */
|
||||
#define DNS_ZONEOPT_UPDATECHECKKSK 0x00800000U /*%< check dnskey KSK flag */
|
||||
#define DNS_ZONEOPT_TRYTCPREFRESH 0x01000000U /*%< try tcp refresh on udp failure */
|
||||
#define DNS_ZONEOPT_NOTIFYTOSOA 0x02000000U /*%< Notify the SOA MNAME */
|
||||
#define DNS_ZONEOPT_NSEC3TESTZONE 0x04000000U /*%< nsec3-test-zone */
|
||||
#define DNS_ZONEOPT_SECURETOINSECURE 0x08000000U /*%< dnssec-secure-to-insecure */
|
||||
#define DNS_ZONEOPT_DNSKEYKSKONLY 0x10000000U /*%< dnssec-dnskey-kskonly */
|
||||
#define DNS_ZONEOPT_CHECKDUPRR 0x20000000U /*%< check-dup-records */
|
||||
#define DNS_ZONEOPT_CHECKDUPRRFAIL 0x40000000U /*%< fatal check-dup-records failures */
|
||||
#define DNS_ZONEOPT_CHECKSPF 0x80000000U /*%< check SPF records */
|
||||
|
||||
/*
|
||||
* The following zone options are shifted left into the
|
||||
* higher-order 32 bits of the options.
|
||||
*/
|
||||
#define DNS_ZONEOPT2_CHECKTTL 0x00000001U /*%< check max-zone-ttl */
|
||||
#define DNS_ZONEOPT2_AUTOEMPTY 0x00000002U /*%< automatic empty zone */
|
||||
|
||||
#ifndef NOMINUM_PUBLIC
|
||||
/*
|
||||
* Nominum specific options build down.
|
||||
*/
|
||||
#define DNS_ZONEOPT_NOTIFYFORWARD 0x80000000U /* forward notify to master */
|
||||
#endif /* NOMINUM_PUBLIC */
|
||||
|
||||
typedef enum {
|
||||
DNS_ZONEOPT_MANYERRORS = 1<<0, /*%< return many errors on load */
|
||||
DNS_ZONEOPT_IXFRFROMDIFFS = 1<<1, /*%< calculate differences */
|
||||
DNS_ZONEOPT_NOMERGE = 1<<2, /*%< don't merge journal */
|
||||
DNS_ZONEOPT_CHECKNS = 1<<3, /*%< check if NS's are addresses */
|
||||
DNS_ZONEOPT_FATALNS = 1<<4, /*%< DNS_ZONEOPT_CHECKNS is fatal */
|
||||
DNS_ZONEOPT_MULTIMASTER = 1<<5, /*%< this zone has multiple masters */
|
||||
DNS_ZONEOPT_USEALTXFRSRC = 1<<6, /*%< use alternate transfer sources */
|
||||
DNS_ZONEOPT_CHECKNAMES = 1<<7, /*%< check-names */
|
||||
DNS_ZONEOPT_CHECKNAMESFAIL = 1<<8, /*%< fatal check-name failures */
|
||||
DNS_ZONEOPT_CHECKWILDCARD = 1<<9, /*%< check for internal wildcards */
|
||||
DNS_ZONEOPT_CHECKMX = 1<<10, /*%< check-mx */
|
||||
DNS_ZONEOPT_CHECKMXFAIL = 1<<11, /*%< fatal check-mx failures */
|
||||
DNS_ZONEOPT_CHECKINTEGRITY = 1<<12, /*%< perform integrity checks */
|
||||
DNS_ZONEOPT_CHECKSIBLING = 1<<13, /*%< perform sibling glue checks */
|
||||
DNS_ZONEOPT_NOCHECKNS = 1<<14, /*%< disable IN NS address checks */
|
||||
DNS_ZONEOPT_WARNMXCNAME = 1<<15, /*%< warn on MX CNAME check */
|
||||
DNS_ZONEOPT_IGNOREMXCNAME = 1<<16, /*%< ignore MX CNAME check */
|
||||
DNS_ZONEOPT_WARNSRVCNAME = 1<<17, /*%< warn on SRV CNAME check */
|
||||
DNS_ZONEOPT_IGNORESRVCNAME = 1<<18, /*%< ignore SRV CNAME check */
|
||||
DNS_ZONEOPT_UPDATECHECKKSK = 1<<19, /*%< check dnskey KSK flag */
|
||||
DNS_ZONEOPT_TRYTCPREFRESH = 1<<20, /*%< try tcp refresh on udp failure */
|
||||
DNS_ZONEOPT_NOTIFYTOSOA = 1<<21, /*%< Notify the SOA MNAME */
|
||||
DNS_ZONEOPT_NSEC3TESTZONE = 1<<22, /*%< nsec3-test-zone */
|
||||
DNS_ZONEOPT_SECURETOINSECURE = 1<<23, /*%< dnssec-secure-to-insecure */
|
||||
DNS_ZONEOPT_DNSKEYKSKONLY = 1<<24, /*%< dnssec-dnskey-kskonly */
|
||||
DNS_ZONEOPT_CHECKDUPRR = 1<<25, /*%< check-dup-records */
|
||||
DNS_ZONEOPT_CHECKDUPRRFAIL = 1<<26, /*%< fatal check-dup-records failures */
|
||||
DNS_ZONEOPT_CHECKSPF = 1<<27, /*%< check SPF records */
|
||||
DNS_ZONEOPT_CHECKTTL = 1<<28, /*%< check max-zone-ttl */
|
||||
DNS_ZONEOPT_AUTOEMPTY = 1<<29 /*%< automatic empty zone */
|
||||
} dns_zoneopt_t;
|
||||
/*
|
||||
* Zone key maintenance options
|
||||
*/
|
||||
@ -178,15 +163,10 @@ dns_zone_getclass(dns_zone_t *zone);
|
||||
*/
|
||||
|
||||
isc_result_t
|
||||
dns_zone_getserial2(dns_zone_t *zone, isc_uint32_t *serialp);
|
||||
|
||||
isc_uint32_t
|
||||
dns_zone_getserial(dns_zone_t *zone);
|
||||
dns_zone_getserial(dns_zone_t *zone, isc_uint32_t *serialp);
|
||||
/*%<
|
||||
* Returns the current serial number of the zone. On success, the SOA
|
||||
* serial of the zone will be copied into '*serialp'.
|
||||
* dns_zone_getserial() cannot catch failure cases and is deprecated by
|
||||
* dns_zone_getserial2().
|
||||
*
|
||||
* Requires:
|
||||
*\li 'zone' to be a valid zone.
|
||||
@ -272,14 +252,8 @@ dns_zone_getorigin(dns_zone_t *zone);
|
||||
*/
|
||||
|
||||
isc_result_t
|
||||
dns_zone_setfile(dns_zone_t *zone, const char *file);
|
||||
|
||||
isc_result_t
|
||||
dns_zone_setfile2(dns_zone_t *zone, const char *file,
|
||||
dns_masterformat_t format);
|
||||
isc_result_t
|
||||
dns_zone_setfile3(dns_zone_t *zone, const char *file,
|
||||
dns_masterformat_t format, const dns_master_style_t *style);
|
||||
dns_zone_setfile(dns_zone_t *zone, const char *file,
|
||||
dns_masterformat_t format, const dns_master_style_t *style);
|
||||
/*%<
|
||||
* Sets the name of the master file in the format of 'format' from which
|
||||
* the zone loads its database to 'file'.
|
||||
@ -289,15 +263,6 @@ dns_zone_setfile3(dns_zone_t *zone, const char *file,
|
||||
* For zones with persistent databases, the file name
|
||||
* setting is ignored.
|
||||
*
|
||||
* dns_zone_setfile() is a backward-compatible form of
|
||||
* dns_zone_setfile2(), which always specifies the
|
||||
* dns_masterformat_text (RFC1035) format.
|
||||
*
|
||||
* dns_zone_setfile2() is a backward-compatible form of
|
||||
* dns_zone_setfile3(), which also specifies the style
|
||||
* that should be used if a zone using the 'text'
|
||||
* masterformat is ever dumped.
|
||||
*
|
||||
* Require:
|
||||
*\li 'zone' to be a valid zone.
|
||||
*
|
||||
@ -602,15 +567,9 @@ dns_zone_dump(dns_zone_t *zone);
|
||||
*/
|
||||
|
||||
isc_result_t
|
||||
dns_zone_dumptostream(dns_zone_t *zone, FILE *fd);
|
||||
|
||||
isc_result_t
|
||||
dns_zone_dumptostream2(dns_zone_t *zone, FILE *fd, dns_masterformat_t format,
|
||||
const dns_master_style_t *style);
|
||||
isc_result_t
|
||||
dns_zone_dumptostream3(dns_zone_t *zone, FILE *fd, dns_masterformat_t format,
|
||||
const dns_master_style_t *style,
|
||||
const isc_uint32_t rawversion);
|
||||
dns_zone_dumptostream(dns_zone_t *zone, FILE *fd, dns_masterformat_t format,
|
||||
const dns_master_style_t *style,
|
||||
const isc_uint32_t rawversion);
|
||||
/*%<
|
||||
* Write the zone to stream 'fd' in the specified 'format'.
|
||||
* If the 'format' is dns_masterformat_text (RFC1035), 'style' also
|
||||
@ -632,17 +591,6 @@ dns_zone_dumptostream3(dns_zone_t *zone, FILE *fd, dns_masterformat_t format,
|
||||
*\li 'fd' to be a stream open for writing.
|
||||
*/
|
||||
|
||||
isc_result_t
|
||||
dns_zone_fulldumptostream(dns_zone_t *zone, FILE *fd);
|
||||
/*%<
|
||||
* The same as dns_zone_dumptostream, but dumps the zone with
|
||||
* different dump settings (dns_master_style_full).
|
||||
*
|
||||
* Require:
|
||||
*\li 'zone' to be a valid zone.
|
||||
*\li 'fd' to be a stream open for writing.
|
||||
*/
|
||||
|
||||
void
|
||||
dns_zone_maintenance(dns_zone_t *zone);
|
||||
/*%<
|
||||
@ -718,37 +666,21 @@ dns_zone_unload(dns_zone_t *zone);
|
||||
*/
|
||||
|
||||
void
|
||||
dns_zone_setoption(dns_zone_t *zone, unsigned int option,
|
||||
dns_zone_setoption(dns_zone_t *zone, dns_zoneopt_t option,
|
||||
isc_boolean_t value);
|
||||
void
|
||||
dns_zone_setoption2(dns_zone_t *zone, unsigned int option,
|
||||
isc_boolean_t value);
|
||||
/*%<
|
||||
* Set the given options on ('value' == ISC_TRUE) or off
|
||||
* ('value' == #ISC_FALSE).
|
||||
*
|
||||
* dns_zone_setoption2() has been introduced because the number
|
||||
* of options needed now exceeds the 32 bits in the zone->options
|
||||
* field; it should be used set options with names beginning
|
||||
* with DNS_ZONEOPT2_.
|
||||
*
|
||||
* Require:
|
||||
*\li 'zone' to be a valid zone.
|
||||
*/
|
||||
|
||||
unsigned int
|
||||
dns_zoneopt_t
|
||||
dns_zone_getoptions(dns_zone_t *zone);
|
||||
unsigned int
|
||||
dns_zone_getoptions2(dns_zone_t *zone);
|
||||
/*%<
|
||||
* Returns the current zone options.
|
||||
*
|
||||
* Callers should be aware there is now more than one set of zone
|
||||
* options. dns_zone_getoptions2() has been introduced because the
|
||||
* number of options needed now exceeds the 32 bits in the
|
||||
* zone->options field. It returns the options whose names begin
|
||||
* with DNS_ZONEOPT2_.
|
||||
*
|
||||
* Require:
|
||||
*\li 'zone' to be a valid zone.
|
||||
*/
|
||||
@ -1266,10 +1198,7 @@ dns_zone_getjournalsize(dns_zone_t *zone);
|
||||
|
||||
isc_result_t
|
||||
dns_zone_notifyreceive(dns_zone_t *zone, isc_sockaddr_t *from,
|
||||
dns_message_t *msg);
|
||||
isc_result_t
|
||||
dns_zone_notifyreceive2(dns_zone_t *zone, isc_sockaddr_t *from,
|
||||
isc_sockaddr_t *to, dns_message_t *msg);
|
||||
isc_sockaddr_t *to, dns_message_t *msg);
|
||||
/*%<
|
||||
* Tell the zone that it has received a NOTIFY message from another
|
||||
* server. This may cause some zone maintenance activity to occur.
|
||||
|
@ -172,12 +172,8 @@ dns_zt_freezezones(dns_zt_t *zt, isc_boolean_t freeze);
|
||||
*/
|
||||
|
||||
isc_result_t
|
||||
dns_zt_apply(dns_zt_t *zt, isc_boolean_t stop,
|
||||
dns_zt_apply(dns_zt_t *zt, isc_boolean_t stop, isc_result_t *sub,
|
||||
isc_result_t (*action)(dns_zone_t *, void *), void *uap);
|
||||
|
||||
isc_result_t
|
||||
dns_zt_apply2(dns_zt_t *zt, isc_boolean_t stop, isc_result_t *sub,
|
||||
isc_result_t (*action)(dns_zone_t *, void *), void *uap);
|
||||
/*%<
|
||||
* Apply a given 'action' to all zone zones in the table.
|
||||
* If 'stop' is 'ISC_TRUE' then walking the zone tree will stop if
|
||||
|
@ -128,13 +128,9 @@ typedef struct dst_context dst_context_t;
|
||||
/***
|
||||
*** Functions
|
||||
***/
|
||||
|
||||
isc_result_t
|
||||
dst_lib_init(isc_mem_t *mctx, isc_entropy_t *ectx, unsigned int eflags);
|
||||
|
||||
isc_result_t
|
||||
dst_lib_init2(isc_mem_t *mctx, isc_entropy_t *ectx,
|
||||
const char *engine, unsigned int eflags);
|
||||
dst_lib_init(isc_mem_t *mctx, isc_entropy_t *ectx,
|
||||
const char *engine, unsigned int eflags);
|
||||
/*%<
|
||||
* Initializes the DST subsystem.
|
||||
*
|
||||
@ -196,21 +192,9 @@ dst_ds_digest_supported(unsigned int digest_type);
|
||||
*/
|
||||
|
||||
isc_result_t
|
||||
dst_context_create(dst_key_t *key, isc_mem_t *mctx, dst_context_t **dctxp);
|
||||
|
||||
isc_result_t
|
||||
dst_context_create2(dst_key_t *key, isc_mem_t *mctx,
|
||||
isc_logcategory_t *category, dst_context_t **dctxp);
|
||||
|
||||
isc_result_t
|
||||
dst_context_create3(dst_key_t *key, isc_mem_t *mctx,
|
||||
isc_logcategory_t *category, isc_boolean_t useforsigning,
|
||||
dst_context_t **dctxp);
|
||||
|
||||
isc_result_t
|
||||
dst_context_create4(dst_key_t *key, isc_mem_t *mctx,
|
||||
isc_logcategory_t *category, isc_boolean_t useforsigning,
|
||||
int maxbits, dst_context_t **dctxp);
|
||||
dst_context_create(dst_key_t *key, isc_mem_t *mctx,
|
||||
isc_logcategory_t *category, isc_boolean_t useforsigning,
|
||||
int maxbits, dst_context_t **dctxp);
|
||||
/*%<
|
||||
* Creates a context to be used for a sign or verify operation.
|
||||
*
|
||||
@ -583,15 +567,8 @@ dst_key_generate(const dns_name_t *name, unsigned int alg,
|
||||
unsigned int bits, unsigned int param,
|
||||
unsigned int flags, unsigned int protocol,
|
||||
dns_rdataclass_t rdclass,
|
||||
isc_mem_t *mctx, dst_key_t **keyp);
|
||||
|
||||
isc_result_t
|
||||
dst_key_generate2(const dns_name_t *name, unsigned int alg,
|
||||
unsigned int bits, unsigned int param,
|
||||
unsigned int flags, unsigned int protocol,
|
||||
dns_rdataclass_t rdclass,
|
||||
isc_mem_t *mctx, dst_key_t **keyp,
|
||||
void (*callback)(int));
|
||||
isc_mem_t *mctx, dst_key_t **keyp,
|
||||
void (*callback)(int));
|
||||
|
||||
/*%<
|
||||
* Generate a DST key (or keypair) with the supplied parameters. The
|
||||
|
@ -56,15 +56,8 @@ static isc_boolean_t dns_iptable_pos = ISC_TRUE;
|
||||
*/
|
||||
isc_result_t
|
||||
dns_iptable_addprefix(dns_iptable_t *tab, const isc_netaddr_t *addr,
|
||||
isc_uint16_t bitlen, isc_boolean_t pos)
|
||||
{
|
||||
return(dns_iptable_addprefix2(tab, addr, bitlen, pos, ISC_FALSE));
|
||||
}
|
||||
|
||||
isc_result_t
|
||||
dns_iptable_addprefix2(dns_iptable_t *tab, const isc_netaddr_t *addr,
|
||||
isc_uint16_t bitlen, isc_boolean_t pos,
|
||||
isc_boolean_t is_ecs)
|
||||
isc_uint16_t bitlen, isc_boolean_t pos,
|
||||
isc_boolean_t is_ecs)
|
||||
{
|
||||
isc_result_t result;
|
||||
isc_prefix_t pfx;
|
||||
|
@ -308,14 +308,7 @@ insert(dns_keytable_t *keytable, isc_boolean_t managed, isc_boolean_t initial,
|
||||
|
||||
isc_result_t
|
||||
dns_keytable_add(dns_keytable_t *keytable, isc_boolean_t managed,
|
||||
dst_key_t **keyp)
|
||||
{
|
||||
return (dns_keytable_add2(keytable, managed, ISC_FALSE, keyp));
|
||||
}
|
||||
|
||||
isc_result_t
|
||||
dns_keytable_add2(dns_keytable_t *keytable, isc_boolean_t managed,
|
||||
isc_boolean_t initial, dst_key_t **keyp)
|
||||
isc_boolean_t initial, dst_key_t **keyp)
|
||||
{
|
||||
REQUIRE(keyp != NULL && *keyp != NULL);
|
||||
REQUIRE(!initial || managed);
|
||||
|
@ -91,7 +91,7 @@ initialize(void) {
|
||||
if (result != ISC_R_SUCCESS)
|
||||
goto cleanup_db;
|
||||
|
||||
result = dst_lib_init(dns_g_mctx, ectx, 0);
|
||||
result = dst_lib_init(dns_g_mctx, ectx, NULL, 0);
|
||||
if (result != ISC_R_SUCCESS)
|
||||
goto cleanup_ectx;
|
||||
|
||||
|
@ -85,7 +85,8 @@ start_fetch(dns_lookup_t *lookup) {
|
||||
result = dns_resolver_createfetch(lookup->view->resolver,
|
||||
dns_fixedname_name(&lookup->name),
|
||||
lookup->type,
|
||||
NULL, NULL, NULL, 0,
|
||||
NULL, NULL, NULL, NULL, 0, 0, 0,
|
||||
NULL,
|
||||
lookup->task, fetch_done, lookup,
|
||||
&lookup->rdataset,
|
||||
&lookup->sigrdataset,
|
||||
@ -165,9 +166,9 @@ view_find(dns_lookup_t *lookup, dns_name_t *foundname) {
|
||||
type = lookup->type;
|
||||
|
||||
result = dns_view_find(lookup->view, name, type, 0, 0, ISC_FALSE,
|
||||
&lookup->event->db, &lookup->event->node,
|
||||
foundname, &lookup->rdataset,
|
||||
&lookup->sigrdataset);
|
||||
ISC_FALSE, &lookup->event->db,
|
||||
&lookup->event->node, foundname,
|
||||
&lookup->rdataset, &lookup->sigrdataset);
|
||||
return (result);
|
||||
}
|
||||
|
||||
|
132
lib/dns/master.c
132
lib/dns/master.c
@ -2588,61 +2588,12 @@ load_raw(dns_loadctx_t *lctx) {
|
||||
|
||||
isc_result_t
|
||||
dns_master_loadfile(const char *master_file, dns_name_t *top,
|
||||
dns_name_t *origin,
|
||||
dns_rdataclass_t zclass, unsigned int options,
|
||||
dns_rdatacallbacks_t *callbacks, isc_mem_t *mctx)
|
||||
{
|
||||
return (dns_master_loadfile5(master_file, top, origin, zclass,
|
||||
options, 0, callbacks, NULL, NULL,
|
||||
mctx, dns_masterformat_text, 0));
|
||||
}
|
||||
|
||||
isc_result_t
|
||||
dns_master_loadfile2(const char *master_file, dns_name_t *top,
|
||||
dns_name_t *origin,
|
||||
dns_rdataclass_t zclass, unsigned int options,
|
||||
dns_rdatacallbacks_t *callbacks, isc_mem_t *mctx,
|
||||
dns_masterformat_t format)
|
||||
{
|
||||
return (dns_master_loadfile5(master_file, top, origin, zclass,
|
||||
options, 0, callbacks, NULL, NULL,
|
||||
mctx, format, 0));
|
||||
}
|
||||
|
||||
isc_result_t
|
||||
dns_master_loadfile3(const char *master_file, dns_name_t *top,
|
||||
dns_name_t *origin, dns_rdataclass_t zclass,
|
||||
unsigned int options, isc_uint32_t resign,
|
||||
dns_rdatacallbacks_t *callbacks, isc_mem_t *mctx,
|
||||
dns_masterformat_t format)
|
||||
{
|
||||
return (dns_master_loadfile5(master_file, top, origin, zclass,
|
||||
options, resign, callbacks, NULL, NULL,
|
||||
mctx, format, 0));
|
||||
}
|
||||
|
||||
isc_result_t
|
||||
dns_master_loadfile4(const char *master_file, dns_name_t *top,
|
||||
dns_name_t *origin, dns_rdataclass_t zclass,
|
||||
unsigned int options, isc_uint32_t resign,
|
||||
dns_rdatacallbacks_t *callbacks,
|
||||
dns_masterincludecb_t include_cb, void *include_arg,
|
||||
isc_mem_t *mctx, dns_masterformat_t format)
|
||||
{
|
||||
return (dns_master_loadfile5(master_file, top, origin, zclass,
|
||||
options, resign, callbacks,
|
||||
include_cb, include_arg,
|
||||
mctx, format, 0));
|
||||
}
|
||||
|
||||
isc_result_t
|
||||
dns_master_loadfile5(const char *master_file, dns_name_t *top,
|
||||
dns_name_t *origin, dns_rdataclass_t zclass,
|
||||
unsigned int options, isc_uint32_t resign,
|
||||
dns_rdatacallbacks_t *callbacks,
|
||||
dns_masterincludecb_t include_cb, void *include_arg,
|
||||
isc_mem_t *mctx, dns_masterformat_t format,
|
||||
dns_ttl_t maxttl)
|
||||
dns_name_t *origin, dns_rdataclass_t zclass,
|
||||
unsigned int options, isc_uint32_t resign,
|
||||
dns_rdatacallbacks_t *callbacks,
|
||||
dns_masterincludecb_t include_cb, void *include_arg,
|
||||
isc_mem_t *mctx, dns_masterformat_t format,
|
||||
dns_ttl_t maxttl)
|
||||
{
|
||||
dns_loadctx_t *lctx = NULL;
|
||||
isc_result_t result;
|
||||
@ -2670,72 +2621,13 @@ dns_master_loadfile5(const char *master_file, dns_name_t *top,
|
||||
isc_result_t
|
||||
dns_master_loadfileinc(const char *master_file, dns_name_t *top,
|
||||
dns_name_t *origin, dns_rdataclass_t zclass,
|
||||
unsigned int options, dns_rdatacallbacks_t *callbacks,
|
||||
unsigned int options, isc_uint32_t resign,
|
||||
dns_rdatacallbacks_t *callbacks,
|
||||
isc_task_t *task, dns_loaddonefunc_t done,
|
||||
void *done_arg, dns_loadctx_t **lctxp, isc_mem_t *mctx)
|
||||
{
|
||||
return (dns_master_loadfileinc4(master_file, top, origin, zclass,
|
||||
options, 0, callbacks, task, done,
|
||||
done_arg, lctxp, NULL, NULL, mctx,
|
||||
dns_masterformat_text));
|
||||
}
|
||||
|
||||
isc_result_t
|
||||
dns_master_loadfileinc2(const char *master_file, dns_name_t *top,
|
||||
dns_name_t *origin, dns_rdataclass_t zclass,
|
||||
unsigned int options, dns_rdatacallbacks_t *callbacks,
|
||||
isc_task_t *task, dns_loaddonefunc_t done,
|
||||
void *done_arg, dns_loadctx_t **lctxp, isc_mem_t *mctx,
|
||||
dns_masterformat_t format)
|
||||
{
|
||||
return (dns_master_loadfileinc4(master_file, top, origin, zclass,
|
||||
options, 0, callbacks, task, done,
|
||||
done_arg, lctxp, NULL, NULL, mctx,
|
||||
format));
|
||||
}
|
||||
|
||||
isc_result_t
|
||||
dns_master_loadfileinc3(const char *master_file, dns_name_t *top,
|
||||
dns_name_t *origin, dns_rdataclass_t zclass,
|
||||
unsigned int options, isc_uint32_t resign,
|
||||
dns_rdatacallbacks_t *callbacks, isc_task_t *task,
|
||||
dns_loaddonefunc_t done, void *done_arg,
|
||||
dns_loadctx_t **lctxp, isc_mem_t *mctx,
|
||||
dns_masterformat_t format)
|
||||
{
|
||||
return (dns_master_loadfileinc4(master_file, top, origin, zclass,
|
||||
options, resign, callbacks, task,
|
||||
done, done_arg, lctxp, NULL, NULL,
|
||||
mctx, format));
|
||||
}
|
||||
|
||||
isc_result_t
|
||||
dns_master_loadfileinc4(const char *master_file, dns_name_t *top,
|
||||
dns_name_t *origin, dns_rdataclass_t zclass,
|
||||
unsigned int options, isc_uint32_t resign,
|
||||
dns_rdatacallbacks_t *callbacks,
|
||||
isc_task_t *task, dns_loaddonefunc_t done,
|
||||
void *done_arg, dns_loadctx_t **lctxp,
|
||||
dns_masterincludecb_t include_cb, void *include_arg,
|
||||
isc_mem_t *mctx, dns_masterformat_t format)
|
||||
{
|
||||
options &= ~DNS_MASTER_CHECKTTL;
|
||||
return (dns_master_loadfileinc5(master_file, top, origin, zclass,
|
||||
options, resign, callbacks, task,
|
||||
done, done_arg, lctxp, include_cb,
|
||||
include_arg, mctx, format, 0));
|
||||
}
|
||||
|
||||
isc_result_t
|
||||
dns_master_loadfileinc5(const char *master_file, dns_name_t *top,
|
||||
dns_name_t *origin, dns_rdataclass_t zclass,
|
||||
unsigned int options, isc_uint32_t resign,
|
||||
dns_rdatacallbacks_t *callbacks,
|
||||
isc_task_t *task, dns_loaddonefunc_t done,
|
||||
void *done_arg, dns_loadctx_t **lctxp,
|
||||
dns_masterincludecb_t include_cb, void *include_arg,
|
||||
isc_mem_t *mctx, dns_masterformat_t format,
|
||||
isc_uint32_t maxttl)
|
||||
void *done_arg, dns_loadctx_t **lctxp,
|
||||
dns_masterincludecb_t include_cb, void *include_arg,
|
||||
isc_mem_t *mctx, dns_masterformat_t format,
|
||||
isc_uint32_t maxttl)
|
||||
{
|
||||
dns_loadctx_t *lctx = NULL;
|
||||
isc_result_t result;
|
||||
|
@ -558,7 +558,7 @@ rdataset_totext(dns_rdataset_t *rdataset,
|
||||
INDENT_TO(ttl_column);
|
||||
if ((ctx->style.flags & DNS_STYLEFLAG_TTL_UNITS) != 0) {
|
||||
length = target->used;
|
||||
result = dns_ttl_totext2(rdataset->ttl,
|
||||
result = dns_ttl_totext(rdataset->ttl,
|
||||
ISC_FALSE, ISC_FALSE,
|
||||
target);
|
||||
if (result != ISC_R_SUCCESS)
|
||||
@ -880,7 +880,8 @@ dump_rdataset(isc_mem_t *mctx, const dns_name_t *name,
|
||||
{
|
||||
isc_buffer_clear(buffer);
|
||||
result = dns_ttl_totext(rdataset->ttl,
|
||||
ISC_TRUE, buffer);
|
||||
ISC_TRUE, ISC_TRUE,
|
||||
buffer);
|
||||
INSIST(result == ISC_R_SUCCESS);
|
||||
isc_buffer_usedregion(buffer, &r);
|
||||
fprintf(f, "$TTL %u\t; %.*s\n", rdataset->ttl,
|
||||
@ -1793,35 +1794,12 @@ dns_master_dumptostreaminc(isc_mem_t *mctx, dns_db_t *db,
|
||||
return (result);
|
||||
}
|
||||
|
||||
/*
|
||||
* Dump an entire database into a master file.
|
||||
*/
|
||||
isc_result_t
|
||||
dns_master_dumptostream(isc_mem_t *mctx, dns_db_t *db,
|
||||
dns_dbversion_t *version,
|
||||
const dns_master_style_t *style,
|
||||
FILE *f)
|
||||
{
|
||||
return (dns_master_dumptostream3(mctx, db, version, style,
|
||||
dns_masterformat_text, NULL, f));
|
||||
}
|
||||
|
||||
isc_result_t
|
||||
dns_master_dumptostream2(isc_mem_t *mctx, dns_db_t *db,
|
||||
dns_dbversion_t *version,
|
||||
const dns_master_style_t *style,
|
||||
dns_masterformat_t format, FILE *f)
|
||||
{
|
||||
return (dns_master_dumptostream3(mctx, db, version, style,
|
||||
format, NULL, f));
|
||||
}
|
||||
|
||||
isc_result_t
|
||||
dns_master_dumptostream3(isc_mem_t *mctx, dns_db_t *db,
|
||||
dns_dbversion_t *version,
|
||||
const dns_master_style_t *style,
|
||||
dns_masterformat_t format,
|
||||
dns_masterrawheader_t *header, FILE *f)
|
||||
dns_masterformat_t format,
|
||||
dns_masterrawheader_t *header, FILE *f)
|
||||
{
|
||||
dns_dumpctx_t *dctx = NULL;
|
||||
isc_result_t result;
|
||||
@ -1880,29 +1858,8 @@ isc_result_t
|
||||
dns_master_dumpinc(isc_mem_t *mctx, dns_db_t *db, dns_dbversion_t *version,
|
||||
const dns_master_style_t *style, const char *filename,
|
||||
isc_task_t *task, dns_dumpdonefunc_t done, void *done_arg,
|
||||
dns_dumpctx_t **dctxp)
|
||||
{
|
||||
return (dns_master_dumpinc3(mctx, db, version, style, filename, task,
|
||||
done, done_arg, dctxp,
|
||||
dns_masterformat_text, NULL));
|
||||
}
|
||||
|
||||
isc_result_t
|
||||
dns_master_dumpinc2(isc_mem_t *mctx, dns_db_t *db, dns_dbversion_t *version,
|
||||
const dns_master_style_t *style, const char *filename,
|
||||
isc_task_t *task, dns_dumpdonefunc_t done, void *done_arg,
|
||||
dns_dumpctx_t **dctxp, dns_masterformat_t format)
|
||||
{
|
||||
return (dns_master_dumpinc3(mctx, db, version, style, filename, task,
|
||||
done, done_arg, dctxp, format, NULL));
|
||||
}
|
||||
|
||||
isc_result_t
|
||||
dns_master_dumpinc3(isc_mem_t *mctx, dns_db_t *db, dns_dbversion_t *version,
|
||||
const dns_master_style_t *style, const char *filename,
|
||||
isc_task_t *task, dns_dumpdonefunc_t done, void *done_arg,
|
||||
dns_dumpctx_t **dctxp, dns_masterformat_t format,
|
||||
dns_masterrawheader_t *header)
|
||||
dns_dumpctx_t **dctxp, dns_masterformat_t format,
|
||||
dns_masterrawheader_t *header)
|
||||
{
|
||||
FILE *f = NULL;
|
||||
isc_result_t result;
|
||||
@ -1953,25 +1910,8 @@ dns_master_dumpinc3(isc_mem_t *mctx, dns_db_t *db, dns_dbversion_t *version,
|
||||
|
||||
isc_result_t
|
||||
dns_master_dump(isc_mem_t *mctx, dns_db_t *db, dns_dbversion_t *version,
|
||||
const dns_master_style_t *style, const char *filename)
|
||||
{
|
||||
return (dns_master_dump3(mctx, db, version, style, filename,
|
||||
dns_masterformat_text, NULL));
|
||||
}
|
||||
|
||||
isc_result_t
|
||||
dns_master_dump2(isc_mem_t *mctx, dns_db_t *db, dns_dbversion_t *version,
|
||||
const dns_master_style_t *style, const char *filename,
|
||||
dns_masterformat_t format)
|
||||
{
|
||||
return (dns_master_dump3(mctx, db, version, style, filename,
|
||||
format, NULL));
|
||||
}
|
||||
|
||||
isc_result_t
|
||||
dns_master_dump3(isc_mem_t *mctx, dns_db_t *db, dns_dbversion_t *version,
|
||||
const dns_master_style_t *style, const char *filename,
|
||||
dns_masterformat_t format, dns_masterrawheader_t *header)
|
||||
const dns_master_style_t *style, const char *filename,
|
||||
dns_masterformat_t format, dns_masterrawheader_t *header)
|
||||
{
|
||||
FILE *f = NULL;
|
||||
isc_result_t result;
|
||||
@ -2098,21 +2038,7 @@ dns_master_stylecreate(dns_master_style_t **stylep,
|
||||
unsigned int ttl_column, unsigned int class_column,
|
||||
unsigned int type_column, unsigned int rdata_column,
|
||||
unsigned int line_length, unsigned int tab_width,
|
||||
isc_mem_t *mctx)
|
||||
{
|
||||
return (dns_master_stylecreate2(stylep, flags, ttl_column,
|
||||
class_column, type_column,
|
||||
rdata_column, line_length,
|
||||
tab_width, 0xffffffff, mctx));
|
||||
}
|
||||
|
||||
isc_result_t
|
||||
dns_master_stylecreate2(dns_master_style_t **stylep,
|
||||
dns_masterstyle_flags_t flags,
|
||||
unsigned int ttl_column, unsigned int class_column,
|
||||
unsigned int type_column, unsigned int rdata_column,
|
||||
unsigned int line_length, unsigned int tab_width,
|
||||
unsigned int split_width, isc_mem_t *mctx)
|
||||
unsigned int split_width, isc_mem_t *mctx)
|
||||
{
|
||||
dns_master_style_t *style;
|
||||
|
||||
|
@ -3604,6 +3604,7 @@ dns_message_pseudosectiontoyaml(dns_message_t *msg,
|
||||
ADD_STRING(target, buf);
|
||||
ADD_STRING(target, " (");
|
||||
result = dns_ttl_totext(secs,
|
||||
ISC_TRUE,
|
||||
ISC_TRUE,
|
||||
target);
|
||||
if (result != ISC_R_SUCCESS)
|
||||
@ -3855,6 +3856,7 @@ dns_message_pseudosectiontotext(dns_message_t *msg,
|
||||
ADD_STRING(target, buf);
|
||||
ADD_STRING(target, " (");
|
||||
result = dns_ttl_totext(secs,
|
||||
ISC_TRUE,
|
||||
ISC_TRUE,
|
||||
target);
|
||||
if (result != ISC_R_SUCCESS)
|
||||
@ -4248,19 +4250,10 @@ dns_opcode_totext(dns_opcode_t opcode, isc_buffer_t *target) {
|
||||
}
|
||||
|
||||
void
|
||||
dns_message_logpacket(dns_message_t *message, const char *description,
|
||||
dns_message_logpacket(dns_message_t *message,
|
||||
const char *description, const isc_sockaddr_t *address,
|
||||
isc_logcategory_t *category, isc_logmodule_t *module,
|
||||
int level, isc_mem_t *mctx)
|
||||
{
|
||||
logfmtpacket(message, description, NULL, category, module,
|
||||
&dns_master_style_debug, level, mctx);
|
||||
}
|
||||
|
||||
void
|
||||
dns_message_logpacket2(dns_message_t *message,
|
||||
const char *description, const isc_sockaddr_t *address,
|
||||
isc_logcategory_t *category, isc_logmodule_t *module,
|
||||
int level, isc_mem_t *mctx)
|
||||
{
|
||||
REQUIRE(address != NULL);
|
||||
|
||||
@ -4269,22 +4262,12 @@ dns_message_logpacket2(dns_message_t *message,
|
||||
}
|
||||
|
||||
void
|
||||
dns_message_logfmtpacket(dns_message_t *message, const char *description,
|
||||
dns_message_logfmtpacket(dns_message_t *message,
|
||||
const char *description,
|
||||
const isc_sockaddr_t *address,
|
||||
isc_logcategory_t *category, isc_logmodule_t *module,
|
||||
const dns_master_style_t *style, int level,
|
||||
isc_mem_t *mctx)
|
||||
{
|
||||
logfmtpacket(message, description, NULL, category, module, style,
|
||||
level, mctx);
|
||||
}
|
||||
|
||||
void
|
||||
dns_message_logfmtpacket2(dns_message_t *message,
|
||||
const char *description,
|
||||
const isc_sockaddr_t *address,
|
||||
isc_logcategory_t *category, isc_logmodule_t *module,
|
||||
const dns_master_style_t *style, int level,
|
||||
isc_mem_t *mctx)
|
||||
{
|
||||
REQUIRE(address != NULL);
|
||||
|
||||
|
@ -268,8 +268,8 @@ checkbogus(isc_task_t *task, isc_event_t *event) {
|
||||
nta_ref(nta);
|
||||
result = dns_resolver_createfetch(view->resolver, nta->name,
|
||||
dns_rdatatype_nsec,
|
||||
NULL, NULL, NULL,
|
||||
DNS_FETCHOPT_NONTA,
|
||||
NULL, NULL, NULL, NULL, 0,
|
||||
DNS_FETCHOPT_NONTA, 0, NULL,
|
||||
task, fetch_done, nta,
|
||||
&nta->rdataset,
|
||||
&nta->sigrdataset,
|
||||
|
@ -7931,9 +7931,9 @@ dump(dns_db_t *db, dns_dbversion_t *version, const char *filename,
|
||||
REQUIRE(VALID_RBTDB(rbtdb));
|
||||
INSIST(rbtversion == NULL || rbtversion->rbtdb == rbtdb);
|
||||
|
||||
return (dns_master_dump2(rbtdb->common.mctx, db, version,
|
||||
&dns_master_style_default,
|
||||
filename, masterformat));
|
||||
return (dns_master_dump(rbtdb->common.mctx, db, version,
|
||||
&dns_master_style_default,
|
||||
filename, masterformat, NULL));
|
||||
}
|
||||
|
||||
static void
|
||||
|
@ -138,7 +138,8 @@ totext_soa(ARGS_TOTEXT) {
|
||||
/* Print times in week/day/hour/minute/second form */
|
||||
if (i >= 1) {
|
||||
RETERR(str_totext(" (", target));
|
||||
RETERR(dns_ttl_totext(num, ISC_TRUE, target));
|
||||
RETERR(dns_ttl_totext(num, ISC_TRUE,
|
||||
ISC_TRUE, target));
|
||||
RETERR(str_totext(")", target));
|
||||
}
|
||||
RETERR(str_totext(tctx->linebreak, target));
|
||||
|
@ -508,7 +508,7 @@ isblackholed(dns_dispatchmgr_t *dispatchmgr, const isc_sockaddr_t *destaddr) {
|
||||
blackhole = dns_dispatchmgr_getblackhole(dispatchmgr);
|
||||
if (blackhole != NULL) {
|
||||
isc_netaddr_fromsockaddr(&netaddr, destaddr);
|
||||
if (dns_acl_match(&netaddr, NULL, blackhole,
|
||||
if (dns_acl_match(&netaddr, NULL, NULL, 0, NULL, blackhole,
|
||||
NULL, &match, NULL) == ISC_R_SUCCESS &&
|
||||
match > 0)
|
||||
drop = ISC_TRUE;
|
||||
@ -534,9 +534,9 @@ create_tcp_dispatch(isc_boolean_t newtcp, isc_boolean_t share,
|
||||
isc_sockaddr_t bind_any;
|
||||
|
||||
if (!newtcp && share) {
|
||||
result = dns_dispatch_gettcp2(requestmgr->dispatchmgr,
|
||||
destaddr, srcaddr,
|
||||
connected, dispatchp);
|
||||
result = dns_dispatch_gettcp(requestmgr->dispatchmgr,
|
||||
destaddr, srcaddr,
|
||||
connected, dispatchp);
|
||||
if (result == ISC_R_SUCCESS) {
|
||||
char peer[ISC_SOCKADDR_FORMATSIZE];
|
||||
|
||||
@ -548,7 +548,7 @@ create_tcp_dispatch(isc_boolean_t newtcp, isc_boolean_t share,
|
||||
}
|
||||
} else if (!newtcp) {
|
||||
result = dns_dispatch_gettcp(requestmgr->dispatchmgr, destaddr,
|
||||
srcaddr, dispatchp);
|
||||
srcaddr, NULL, dispatchp);
|
||||
if (result == ISC_R_SUCCESS) {
|
||||
char peer[ISC_SOCKADDR_FORMATSIZE];
|
||||
|
||||
@ -588,11 +588,11 @@ create_tcp_dispatch(isc_boolean_t newtcp, isc_boolean_t share,
|
||||
attrs |= DNS_DISPATCHATTR_MAKEQUERY;
|
||||
|
||||
isc_socket_dscp(sock, dscp);
|
||||
result = dns_dispatch_createtcp2(requestmgr->dispatchmgr,
|
||||
sock, requestmgr->taskmgr,
|
||||
srcaddr, destaddr,
|
||||
4096, 32768, 32768, 16411, 16433,
|
||||
attrs, dispatchp);
|
||||
result = dns_dispatch_createtcp(requestmgr->dispatchmgr,
|
||||
sock, requestmgr->taskmgr,
|
||||
srcaddr, destaddr,
|
||||
4096, 32768, 32768, 16411, 16433,
|
||||
attrs, dispatchp);
|
||||
cleanup:
|
||||
isc_socket_detach(&sock);
|
||||
return (result);
|
||||
@ -692,59 +692,11 @@ isc_result_t
|
||||
dns_request_createraw(dns_requestmgr_t *requestmgr, isc_buffer_t *msgbuf,
|
||||
const isc_sockaddr_t *srcaddr,
|
||||
const isc_sockaddr_t *destaddr,
|
||||
unsigned int options, unsigned int timeout,
|
||||
isc_task_t *task, isc_taskaction_t action, void *arg,
|
||||
isc_dscp_t dscp, unsigned int options,
|
||||
unsigned int timeout, unsigned int udptimeout,
|
||||
unsigned int udpretries, isc_task_t *task,
|
||||
isc_taskaction_t action, void *arg,
|
||||
dns_request_t **requestp)
|
||||
{
|
||||
return(dns_request_createraw4(requestmgr, msgbuf, srcaddr, destaddr,
|
||||
-1, options, timeout, 0, 0, task, action,
|
||||
arg, requestp));
|
||||
}
|
||||
|
||||
isc_result_t
|
||||
dns_request_createraw2(dns_requestmgr_t *requestmgr, isc_buffer_t *msgbuf,
|
||||
const isc_sockaddr_t *srcaddr,
|
||||
const isc_sockaddr_t *destaddr,
|
||||
unsigned int options, unsigned int timeout,
|
||||
unsigned int udptimeout, isc_task_t *task,
|
||||
isc_taskaction_t action, void *arg,
|
||||
dns_request_t **requestp)
|
||||
{
|
||||
unsigned int udpretries = 0;
|
||||
|
||||
if (udptimeout != 0)
|
||||
udpretries = timeout / udptimeout;
|
||||
|
||||
return (dns_request_createraw4(requestmgr, msgbuf, srcaddr, destaddr,
|
||||
-1, options, timeout, udptimeout,
|
||||
udpretries, task, action, arg,
|
||||
requestp));
|
||||
}
|
||||
|
||||
isc_result_t
|
||||
dns_request_createraw3(dns_requestmgr_t *requestmgr, isc_buffer_t *msgbuf,
|
||||
const isc_sockaddr_t *srcaddr,
|
||||
const isc_sockaddr_t *destaddr,
|
||||
unsigned int options, unsigned int timeout,
|
||||
unsigned int udptimeout, unsigned int udpretries,
|
||||
isc_task_t *task, isc_taskaction_t action, void *arg,
|
||||
dns_request_t **requestp)
|
||||
{
|
||||
return (dns_request_createraw4(requestmgr, msgbuf, srcaddr, destaddr,
|
||||
-1, options, timeout, udptimeout,
|
||||
udpretries, task, action, arg,
|
||||
requestp));
|
||||
}
|
||||
|
||||
isc_result_t
|
||||
dns_request_createraw4(dns_requestmgr_t *requestmgr, isc_buffer_t *msgbuf,
|
||||
const isc_sockaddr_t *srcaddr,
|
||||
const isc_sockaddr_t *destaddr,
|
||||
isc_dscp_t dscp, unsigned int options,
|
||||
unsigned int timeout, unsigned int udptimeout,
|
||||
unsigned int udpretries, isc_task_t *task,
|
||||
isc_taskaction_t action, void *arg,
|
||||
dns_request_t **requestp)
|
||||
{
|
||||
dns_request_t *request = NULL;
|
||||
isc_task_t *tclone = NULL;
|
||||
@ -832,10 +784,10 @@ dns_request_createraw4(dns_requestmgr_t *requestmgr, isc_buffer_t *msgbuf,
|
||||
dispopt |= DNS_DISPATCHOPT_FIXEDID;
|
||||
}
|
||||
|
||||
result = dns_dispatch_addresponse3(request->dispatch, dispopt,
|
||||
destaddr, task, req_response,
|
||||
request, &id, &request->dispentry,
|
||||
requestmgr->socketmgr);
|
||||
result = dns_dispatch_addresponse(request->dispatch, dispopt,
|
||||
destaddr, task, req_response,
|
||||
request, &id, &request->dispentry,
|
||||
requestmgr->socketmgr);
|
||||
if (result != ISC_R_SUCCESS) {
|
||||
if ((options & DNS_REQUESTOPT_FIXEDID) != 0 && !newtcp) {
|
||||
newtcp = ISC_TRUE;
|
||||
@ -921,69 +873,20 @@ dns_request_create(dns_requestmgr_t *requestmgr, dns_message_t *message,
|
||||
isc_taskaction_t action, void *arg,
|
||||
dns_request_t **requestp)
|
||||
{
|
||||
return (dns_request_createvia4(requestmgr, message, NULL, address,
|
||||
-1, options, key, timeout, 0, 0, task,
|
||||
action, arg, requestp));
|
||||
return (dns_request_createvia(requestmgr, message, NULL, address,
|
||||
-1, options, key, timeout, 0, 0, task,
|
||||
action, arg, requestp));
|
||||
}
|
||||
|
||||
isc_result_t
|
||||
dns_request_createvia(dns_requestmgr_t *requestmgr, dns_message_t *message,
|
||||
const isc_sockaddr_t *srcaddr,
|
||||
const isc_sockaddr_t *destaddr,
|
||||
unsigned int options, dns_tsigkey_t *key,
|
||||
unsigned int timeout, isc_task_t *task,
|
||||
isc_taskaction_t action, void *arg,
|
||||
isc_dscp_t dscp, unsigned int options,
|
||||
dns_tsigkey_t *key, unsigned int timeout,
|
||||
unsigned int udptimeout, unsigned int udpretries,
|
||||
isc_task_t *task, isc_taskaction_t action, void *arg,
|
||||
dns_request_t **requestp)
|
||||
{
|
||||
return(dns_request_createvia4(requestmgr, message, srcaddr, destaddr,
|
||||
-1, options, key, timeout, 0, 0, task,
|
||||
action, arg, requestp));
|
||||
}
|
||||
|
||||
isc_result_t
|
||||
dns_request_createvia2(dns_requestmgr_t *requestmgr, dns_message_t *message,
|
||||
const isc_sockaddr_t *srcaddr,
|
||||
const isc_sockaddr_t *destaddr,
|
||||
unsigned int options, dns_tsigkey_t *key,
|
||||
unsigned int timeout, unsigned int udptimeout,
|
||||
isc_task_t *task, isc_taskaction_t action, void *arg,
|
||||
dns_request_t **requestp)
|
||||
{
|
||||
unsigned int udpretries = 0;
|
||||
|
||||
if (udptimeout != 0)
|
||||
udpretries = timeout / udptimeout;
|
||||
return (dns_request_createvia4(requestmgr, message, srcaddr, destaddr,
|
||||
-1, options, key, timeout, udptimeout,
|
||||
udpretries, task, action, arg,
|
||||
requestp));
|
||||
}
|
||||
|
||||
isc_result_t
|
||||
dns_request_createvia3(dns_requestmgr_t *requestmgr, dns_message_t *message,
|
||||
const isc_sockaddr_t *srcaddr,
|
||||
const isc_sockaddr_t *destaddr,
|
||||
unsigned int options, dns_tsigkey_t *key,
|
||||
unsigned int timeout, unsigned int udptimeout,
|
||||
unsigned int udpretries, isc_task_t *task,
|
||||
isc_taskaction_t action, void *arg,
|
||||
dns_request_t **requestp)
|
||||
{
|
||||
return (dns_request_createvia4(requestmgr, message, srcaddr, destaddr,
|
||||
-1, options, key, timeout, udptimeout,
|
||||
udpretries, task, action, arg,
|
||||
requestp));
|
||||
}
|
||||
|
||||
isc_result_t
|
||||
dns_request_createvia4(dns_requestmgr_t *requestmgr, dns_message_t *message,
|
||||
const isc_sockaddr_t *srcaddr,
|
||||
const isc_sockaddr_t *destaddr,
|
||||
isc_dscp_t dscp, unsigned int options,
|
||||
dns_tsigkey_t *key, unsigned int timeout,
|
||||
unsigned int udptimeout, unsigned int udpretries,
|
||||
isc_task_t *task, isc_taskaction_t action, void *arg,
|
||||
dns_request_t **requestp)
|
||||
{
|
||||
dns_request_t *request = NULL;
|
||||
isc_task_t *tclone = NULL;
|
||||
@ -1060,10 +963,10 @@ dns_request_createvia4(dns_requestmgr_t *requestmgr, dns_message_t *message,
|
||||
if (result != ISC_R_SUCCESS)
|
||||
goto cleanup;
|
||||
|
||||
result = dns_dispatch_addresponse2(request->dispatch, destaddr, task,
|
||||
req_response, request, &id,
|
||||
&request->dispentry,
|
||||
requestmgr->socketmgr);
|
||||
result = dns_dispatch_addresponse(request->dispatch, 0, destaddr,
|
||||
task, req_response, request, &id,
|
||||
&request->dispentry,
|
||||
requestmgr->socketmgr);
|
||||
if (result != ISC_R_SUCCESS)
|
||||
goto cleanup;
|
||||
sock = req_getsocket(request);
|
||||
|
@ -2387,14 +2387,15 @@ resquery_send(resquery_t *query) {
|
||||
/*
|
||||
* Get a query id from the dispatch.
|
||||
*/
|
||||
result = dns_dispatch_addresponse2(query->dispatch,
|
||||
&query->addrinfo->sockaddr,
|
||||
task,
|
||||
resquery_response,
|
||||
query,
|
||||
&query->id,
|
||||
&query->dispentry,
|
||||
res->socketmgr);
|
||||
result = dns_dispatch_addresponse(query->dispatch,
|
||||
0,
|
||||
&query->addrinfo->sockaddr,
|
||||
task,
|
||||
resquery_response,
|
||||
query,
|
||||
&query->id,
|
||||
&query->dispentry,
|
||||
res->socketmgr);
|
||||
if (result != ISC_R_SUCCESS)
|
||||
goto cleanup_temps;
|
||||
|
||||
@ -2538,9 +2539,9 @@ resquery_send(resquery_t *query) {
|
||||
|
||||
if ((flags & FCTX_ADDRINFO_EDNSOK) != 0 &&
|
||||
(query->options & DNS_FETCHOPT_EDNS512) == 0) {
|
||||
udpsize = dns_adb_probesize2(fctx->adb,
|
||||
query->addrinfo,
|
||||
fctx->timeouts);
|
||||
udpsize = dns_adb_probesize(fctx->adb,
|
||||
query->addrinfo,
|
||||
fctx->timeouts);
|
||||
if (udpsize > res->udpsize)
|
||||
udpsize = res->udpsize;
|
||||
}
|
||||
@ -2761,13 +2762,13 @@ resquery_send(resquery_t *query) {
|
||||
/*
|
||||
* Log the outgoing packet.
|
||||
*/
|
||||
dns_message_logfmtpacket2(fctx->qmessage, "sending packet to",
|
||||
&query->addrinfo->sockaddr,
|
||||
DNS_LOGCATEGORY_RESOLVER,
|
||||
DNS_LOGMODULE_PACKETS,
|
||||
&dns_master_style_comment,
|
||||
ISC_LOG_DEBUG(11),
|
||||
fctx->res->mctx);
|
||||
dns_message_logfmtpacket(fctx->qmessage, "sending packet to",
|
||||
&query->addrinfo->sockaddr,
|
||||
DNS_LOGCATEGORY_RESOLVER,
|
||||
DNS_LOGMODULE_PACKETS,
|
||||
&dns_master_style_comment,
|
||||
ISC_LOG_DEBUG(11),
|
||||
fctx->res->mctx);
|
||||
|
||||
/*
|
||||
* We're now done with the query message.
|
||||
@ -2932,10 +2933,12 @@ resquery_connected(isc_task_t *task, isc_event_t *event) {
|
||||
attrs |= DNS_DISPATCHATTR_MAKEQUERY;
|
||||
|
||||
result = dns_dispatch_createtcp(query->dispatchmgr,
|
||||
query->tcpsocket,
|
||||
query->fctx->res->taskmgr,
|
||||
4096, 2, 1, 1, 3, attrs,
|
||||
&query->dispatch);
|
||||
query->tcpsocket,
|
||||
query->fctx->res->taskmgr,
|
||||
NULL, NULL,
|
||||
4096, 2, 1, 1, 3,
|
||||
attrs,
|
||||
&query->dispatch);
|
||||
|
||||
/*
|
||||
* Regardless of whether dns_dispatch_create()
|
||||
@ -3346,13 +3349,13 @@ findname(fetchctx_t *fctx, const dns_name_t *name, in_port_t port,
|
||||
* See what we know about this address.
|
||||
*/
|
||||
find = NULL;
|
||||
result = dns_adb_createfind2(fctx->adb,
|
||||
res->buckets[fctx->bucketnum].task,
|
||||
fctx_finddone, fctx, name,
|
||||
&fctx->name, fctx->type,
|
||||
options, now, NULL,
|
||||
res->view->dstport,
|
||||
fctx->depth + 1, fctx->qc, &find);
|
||||
result = dns_adb_createfind(fctx->adb,
|
||||
res->buckets[fctx->bucketnum].task,
|
||||
fctx_finddone, fctx, name,
|
||||
&fctx->name, fctx->type,
|
||||
options, now, NULL,
|
||||
res->view->dstport,
|
||||
fctx->depth + 1, fctx->qc, &find);
|
||||
if (result != ISC_R_SUCCESS) {
|
||||
if (result == DNS_R_ALIAS) {
|
||||
char namebuf[DNS_NAME_FORMATSIZE];
|
||||
@ -3518,8 +3521,8 @@ fctx_getaddresses(fetchctx_t *fctx, isc_boolean_t badcache) {
|
||||
|
||||
dns_fixedname_init(&fixed);
|
||||
domain = dns_fixedname_name(&fixed);
|
||||
result = dns_fwdtable_find2(res->view->fwdtable, name,
|
||||
domain, &forwarders);
|
||||
result = dns_fwdtable_find(res->view->fwdtable, name,
|
||||
domain, &forwarders);
|
||||
if (result == ISC_R_SUCCESS) {
|
||||
fwd = ISC_LIST_HEAD(forwarders->fwdrs);
|
||||
fctx->fwdpolicy = forwarders->fwdpolicy;
|
||||
@ -3754,7 +3757,7 @@ possibly_mark(fetchctx_t *fctx, dns_adbaddrinfo_t *addr) {
|
||||
if (blackhole != NULL) {
|
||||
int match;
|
||||
|
||||
if (dns_acl_match(&ipaddr, NULL, blackhole,
|
||||
if (dns_acl_match(&ipaddr, NULL, NULL, 0, NULL, blackhole,
|
||||
&res->view->aclenv,
|
||||
&match, NULL) == ISC_R_SUCCESS &&
|
||||
match > 0)
|
||||
@ -4599,8 +4602,8 @@ fctx_create(dns_resolver_t *res, const dns_name_t *name, dns_rdatatype_t type,
|
||||
/* Find the forwarder for this name. */
|
||||
dns_fixedname_init(&fixed);
|
||||
fname = dns_fixedname_name(&fixed);
|
||||
result = dns_fwdtable_find2(fctx->res->view->fwdtable, fwdname,
|
||||
fname, &forwarders);
|
||||
result = dns_fwdtable_find(fctx->res->view->fwdtable, fwdname,
|
||||
fname, &forwarders);
|
||||
if (result == ISC_R_SUCCESS)
|
||||
fctx->fwdpolicy = forwarders->fwdpolicy;
|
||||
|
||||
@ -4614,6 +4617,7 @@ fctx_create(dns_resolver_t *res, const dns_name_t *name, dns_rdatatype_t type,
|
||||
findoptions |= DNS_DBFIND_NOEXACT;
|
||||
result = dns_view_findzonecut(res->view, name, fname,
|
||||
0, findoptions, ISC_TRUE,
|
||||
ISC_TRUE,
|
||||
&fctx->nameservers,
|
||||
NULL);
|
||||
if (result != ISC_R_SUCCESS)
|
||||
@ -6519,8 +6523,9 @@ is_answeraddress_allowed(dns_view_t *view, dns_name_t *name,
|
||||
isc_netaddr_fromin6(&netaddr, &in6a);
|
||||
}
|
||||
|
||||
result = dns_acl_match(&netaddr, NULL, view->denyansweracl,
|
||||
&view->aclenv, &match, NULL);
|
||||
result = dns_acl_match(&netaddr, NULL, NULL, 0, NULL,
|
||||
view->denyansweracl, &view->aclenv,
|
||||
&match, NULL);
|
||||
|
||||
if (result == ISC_R_SUCCESS && match > 0) {
|
||||
isc_netaddr_format(&netaddr, addrbuf, sizeof(addrbuf));
|
||||
@ -6851,8 +6856,8 @@ resume_dslookup(isc_task_t *task, isc_event_t *event) {
|
||||
|
||||
result = dns_resolver_createfetch(fctx->res, &fctx->nsname,
|
||||
dns_rdatatype_ns, domain,
|
||||
nsrdataset, NULL,
|
||||
fctx->options, task,
|
||||
nsrdataset, NULL, NULL, 0,
|
||||
fctx->options, 0, NULL, task,
|
||||
resume_dslookup, fctx,
|
||||
&fctx->nsrrset, NULL,
|
||||
&fctx->nsfetch);
|
||||
@ -7687,13 +7692,13 @@ rctx_edns(respctx_t *rctx) {
|
||||
fctx->rmessage->rcode == dns_rcode_yxdomain) &&
|
||||
bad_edns(fctx, &query->addrinfo->sockaddr))
|
||||
{
|
||||
dns_message_logpacket2(fctx->rmessage,
|
||||
"received packet (bad edns) from",
|
||||
&query->addrinfo->sockaddr,
|
||||
DNS_LOGCATEGORY_RESOLVER,
|
||||
DNS_LOGMODULE_RESOLVER,
|
||||
ISC_LOG_DEBUG(3),
|
||||
fctx->res->mctx);
|
||||
dns_message_logpacket(fctx->rmessage,
|
||||
"received packet (bad edns) from",
|
||||
&query->addrinfo->sockaddr,
|
||||
DNS_LOGCATEGORY_RESOLVER,
|
||||
DNS_LOGMODULE_RESOLVER,
|
||||
ISC_LOG_DEBUG(3),
|
||||
fctx->res->mctx);
|
||||
dns_adb_changeflags(fctx->adb, query->addrinfo,
|
||||
DNS_FETCHOPT_NOEDNS0,
|
||||
DNS_FETCHOPT_NOEDNS0);
|
||||
@ -7715,12 +7720,12 @@ rctx_edns(respctx_t *rctx) {
|
||||
* should be safe to do for any rcode we limit it to NOERROR
|
||||
* and NXDOMAIN.
|
||||
*/
|
||||
dns_message_logpacket2(fctx->rmessage,
|
||||
"received packet (no opt) from",
|
||||
&query->addrinfo->sockaddr,
|
||||
DNS_LOGCATEGORY_RESOLVER,
|
||||
DNS_LOGMODULE_RESOLVER,
|
||||
ISC_LOG_DEBUG(3), fctx->res->mctx);
|
||||
dns_message_logpacket(fctx->rmessage,
|
||||
"received packet (no opt) from",
|
||||
&query->addrinfo->sockaddr,
|
||||
DNS_LOGCATEGORY_RESOLVER,
|
||||
DNS_LOGMODULE_RESOLVER,
|
||||
ISC_LOG_DEBUG(3), fctx->res->mctx);
|
||||
dns_adb_changeflags(fctx->adb, query->addrinfo,
|
||||
DNS_FETCHOPT_NOEDNS0,
|
||||
DNS_FETCHOPT_NOEDNS0);
|
||||
@ -8995,7 +9000,7 @@ rctx_nextserver(respctx_t *rctx, dns_adbaddrinfo_t *addrinfo,
|
||||
result = dns_view_findzonecut(fctx->res->view,
|
||||
name, fname,
|
||||
rctx->now, findoptions,
|
||||
ISC_TRUE,
|
||||
ISC_TRUE, ISC_TRUE,
|
||||
&fctx->nameservers,
|
||||
NULL);
|
||||
if (result != ISC_R_SUCCESS) {
|
||||
@ -9113,8 +9118,8 @@ rctx_chaseds(respctx_t *rctx, dns_adbaddrinfo_t *addrinfo, isc_result_t result)
|
||||
|
||||
result = dns_resolver_createfetch(fctx->res, &fctx->nsname,
|
||||
dns_rdatatype_ns,
|
||||
NULL, NULL, NULL,
|
||||
fctx->options, rctx->task,
|
||||
NULL, NULL, NULL, NULL, 0,
|
||||
fctx->options, 0, NULL, rctx->task,
|
||||
resume_dslookup, fctx,
|
||||
&fctx->nsrrset, NULL,
|
||||
&fctx->nsfetch);
|
||||
@ -9216,14 +9221,14 @@ rctx_logpacket(respctx_t *rctx) {
|
||||
isc_buffer_t zb;
|
||||
#endif /* HAVE_DNSTAP */
|
||||
|
||||
dns_message_logfmtpacket2(rctx->fctx->rmessage,
|
||||
"received packet from",
|
||||
&rctx->query->addrinfo->sockaddr,
|
||||
DNS_LOGCATEGORY_RESOLVER,
|
||||
DNS_LOGMODULE_PACKETS,
|
||||
&dns_master_style_comment,
|
||||
ISC_LOG_DEBUG(10),
|
||||
rctx->fctx->res->mctx);
|
||||
dns_message_logfmtpacket(rctx->fctx->rmessage,
|
||||
"received packet from",
|
||||
&rctx->query->addrinfo->sockaddr,
|
||||
DNS_LOGCATEGORY_RESOLVER,
|
||||
DNS_LOGMODULE_PACKETS,
|
||||
&dns_master_style_comment,
|
||||
ISC_LOG_DEBUG(10),
|
||||
rctx->fctx->res->mctx);
|
||||
|
||||
#ifdef HAVE_DNSTAP
|
||||
/*
|
||||
@ -9978,7 +9983,8 @@ dns_resolver_prime(dns_resolver_t *res) {
|
||||
LOCK(&res->primelock);
|
||||
result = dns_resolver_createfetch(res, dns_rootname,
|
||||
dns_rdatatype_ns,
|
||||
NULL, NULL, NULL, 0,
|
||||
NULL, NULL, NULL, NULL, 0, 0,
|
||||
0, NULL,
|
||||
res->buckets[0].task,
|
||||
prime_done,
|
||||
res, rdataset, NULL,
|
||||
@ -10172,48 +10178,13 @@ dns_resolver_createfetch(dns_resolver_t *res, const dns_name_t *name,
|
||||
dns_rdatatype_t type,
|
||||
const dns_name_t *domain, dns_rdataset_t *nameservers,
|
||||
dns_forwarders_t *forwarders,
|
||||
unsigned int options, isc_task_t *task,
|
||||
const isc_sockaddr_t *client, dns_messageid_t id,
|
||||
unsigned int options, unsigned int depth,
|
||||
isc_counter_t *qc, isc_task_t *task,
|
||||
isc_taskaction_t action, void *arg,
|
||||
dns_rdataset_t *rdataset,
|
||||
dns_rdataset_t *sigrdataset,
|
||||
dns_fetch_t **fetchp)
|
||||
{
|
||||
return (dns_resolver_createfetch3(res, name, type, domain,
|
||||
nameservers, forwarders, NULL, 0,
|
||||
options, 0, NULL, task, action, arg,
|
||||
rdataset, sigrdataset, fetchp));
|
||||
}
|
||||
|
||||
isc_result_t
|
||||
dns_resolver_createfetch2(dns_resolver_t *res, const dns_name_t *name,
|
||||
dns_rdatatype_t type,
|
||||
const dns_name_t *domain, dns_rdataset_t *nameservers,
|
||||
dns_forwarders_t *forwarders,
|
||||
const isc_sockaddr_t *client, dns_messageid_t id,
|
||||
unsigned int options, isc_task_t *task,
|
||||
isc_taskaction_t action, void *arg,
|
||||
dns_rdataset_t *rdataset,
|
||||
dns_rdataset_t *sigrdataset,
|
||||
dns_fetch_t **fetchp)
|
||||
{
|
||||
return (dns_resolver_createfetch3(res, name, type, domain,
|
||||
nameservers, forwarders, client, id,
|
||||
options, 0, NULL, task, action, arg,
|
||||
rdataset, sigrdataset, fetchp));
|
||||
}
|
||||
|
||||
isc_result_t
|
||||
dns_resolver_createfetch3(dns_resolver_t *res, const dns_name_t *name,
|
||||
dns_rdatatype_t type,
|
||||
const dns_name_t *domain, dns_rdataset_t *nameservers,
|
||||
dns_forwarders_t *forwarders,
|
||||
const isc_sockaddr_t *client, dns_messageid_t id,
|
||||
unsigned int options, unsigned int depth,
|
||||
isc_counter_t *qc, isc_task_t *task,
|
||||
isc_taskaction_t action, void *arg,
|
||||
dns_rdataset_t *rdataset,
|
||||
dns_rdataset_t *sigrdataset,
|
||||
dns_fetch_t **fetchp)
|
||||
{
|
||||
dns_fetch_t *fetch;
|
||||
fetchctx_t *fctx = NULL;
|
||||
|
@ -224,8 +224,9 @@ dns_rootns_create(isc_mem_t *mctx, dns_rdataclass_t rdclass,
|
||||
*/
|
||||
result = dns_master_loadfile(filename, &db->origin,
|
||||
&db->origin, db->rdclass,
|
||||
DNS_MASTER_HINT,
|
||||
&callbacks, db->mctx);
|
||||
DNS_MASTER_HINT, 0, &callbacks,
|
||||
NULL, NULL, db->mctx,
|
||||
dns_masterformat_text, 0);
|
||||
} else if (rdclass == dns_rdataclass_in) {
|
||||
/*
|
||||
* Default to using the Internet root servers.
|
||||
|
@ -1022,8 +1022,9 @@ dns_rrl(dns_view_t *view,
|
||||
rrl = view->rrl;
|
||||
if (rrl->exempt != NULL) {
|
||||
isc_netaddr_fromsockaddr(&netclient, client_addr);
|
||||
result = dns_acl_match(&netclient, NULL, rrl->exempt,
|
||||
&view->aclenv, &exempt_match, NULL);
|
||||
result = dns_acl_match(&netclient, NULL, NULL, 0, NULL,
|
||||
rrl->exempt, &view->aclenv,
|
||||
&exempt_match, NULL);
|
||||
if (result == ISC_R_SUCCESS && exempt_match > 0)
|
||||
return (DNS_RRL_RESULT_OK);
|
||||
}
|
||||
|
@ -1126,7 +1126,8 @@ modrdataset(dns_db_t *db, dns_dbnode_t *node, dns_dbversion_t *version,
|
||||
if (result != ISC_R_SUCCESS)
|
||||
return (result);
|
||||
|
||||
result = dns_master_stylecreate(&style, 0, 0, 0, 0, 0, 0, 1, mctx);
|
||||
result = dns_master_stylecreate(&style, 0, 0, 0, 0, 0, 0, 1,
|
||||
0xffffffff, mctx);
|
||||
if (result != ISC_R_SUCCESS)
|
||||
goto cleanup;
|
||||
|
||||
|
@ -343,19 +343,9 @@ stf_from_address(dns_name_t *stfself, const isc_netaddr_t *tcpaddr) {
|
||||
|
||||
isc_boolean_t
|
||||
dns_ssutable_checkrules(dns_ssutable_t *table, const dns_name_t *signer,
|
||||
const dns_name_t *name, const isc_netaddr_t *tcpaddr,
|
||||
const dns_name_t *name, const isc_netaddr_t *addr,
|
||||
isc_boolean_t tcp, const dns_aclenv_t *env,
|
||||
dns_rdatatype_t type, const dst_key_t *key)
|
||||
{
|
||||
return (dns_ssutable_checkrules2
|
||||
(table, signer, name, tcpaddr,
|
||||
tcpaddr == NULL ? ISC_FALSE : ISC_TRUE,
|
||||
NULL, type, key));
|
||||
}
|
||||
isc_boolean_t
|
||||
dns_ssutable_checkrules2(dns_ssutable_t *table, const dns_name_t *signer,
|
||||
const dns_name_t *name, const isc_netaddr_t *addr,
|
||||
isc_boolean_t tcp, const dns_aclenv_t *env,
|
||||
dns_rdatatype_t type, const dst_key_t *key)
|
||||
{
|
||||
dns_ssurule_t *rule;
|
||||
unsigned int i;
|
||||
@ -430,8 +420,9 @@ dns_ssutable_checkrules2(dns_ssutable_t *table, const dns_name_t *signer,
|
||||
if (!dns_name_issubdomain(name, rule->name)) {
|
||||
continue;
|
||||
}
|
||||
dns_acl_match(addr, NULL, env->localhost,
|
||||
NULL, &match, NULL);
|
||||
dns_acl_match(addr, NULL, NULL, 0, NULL,
|
||||
env->localhost, NULL, &match,
|
||||
NULL);
|
||||
if (match == 0) {
|
||||
if (signer != NULL) {
|
||||
isc_log_write(dns_lctx,
|
||||
|
@ -138,13 +138,13 @@ ATF_TC_BODY(dns_acl_isinsecure, tc) {
|
||||
|
||||
inaddr.s_addr = htonl(0x0a000000); /* 10.0.0.0 */
|
||||
isc_netaddr_fromin(&addr, &inaddr);
|
||||
result = dns_iptable_addprefix2(pos4pos6->iptable, &addr, 8,
|
||||
ISC_TRUE, ecs[pass].first);
|
||||
result = dns_iptable_addprefix(pos4pos6->iptable, &addr, 8,
|
||||
ISC_TRUE, ecs[pass].first);
|
||||
ATF_REQUIRE_EQ(result, ISC_R_SUCCESS);
|
||||
|
||||
addr.family = AF_INET6; /* 0a00:: */
|
||||
result = dns_iptable_addprefix2(pos4pos6->iptable, &addr, 8,
|
||||
ISC_TRUE, ecs[pass].second);
|
||||
result = dns_iptable_addprefix(pos4pos6->iptable, &addr, 8,
|
||||
ISC_TRUE, ecs[pass].second);
|
||||
ATF_REQUIRE_EQ(result, ISC_R_SUCCESS);
|
||||
|
||||
result = dns_acl_merge(notpos4pos6, pos4pos6, ISC_FALSE);
|
||||
@ -152,13 +152,13 @@ ATF_TC_BODY(dns_acl_isinsecure, tc) {
|
||||
|
||||
inaddr.s_addr = htonl(0x0a000000); /* !10.0.0.0/8 */
|
||||
isc_netaddr_fromin(&addr, &inaddr);
|
||||
result = dns_iptable_addprefix2(neg4pos6->iptable, &addr, 8,
|
||||
ISC_FALSE, ecs[pass].first);
|
||||
result = dns_iptable_addprefix(neg4pos6->iptable, &addr, 8,
|
||||
ISC_FALSE, ecs[pass].first);
|
||||
ATF_REQUIRE_EQ(result, ISC_R_SUCCESS);
|
||||
|
||||
addr.family = AF_INET6; /* 0a00::/8 */
|
||||
result = dns_iptable_addprefix2(neg4pos6->iptable, &addr, 8,
|
||||
ISC_TRUE, ecs[pass].second);
|
||||
result = dns_iptable_addprefix(neg4pos6->iptable, &addr, 8,
|
||||
ISC_TRUE, ecs[pass].second);
|
||||
ATF_REQUIRE_EQ(result, ISC_R_SUCCESS);
|
||||
|
||||
result = dns_acl_merge(notneg4pos6, neg4pos6, ISC_FALSE);
|
||||
@ -166,13 +166,13 @@ ATF_TC_BODY(dns_acl_isinsecure, tc) {
|
||||
|
||||
inaddr.s_addr = htonl(0x0a000000); /* 10.0.0.0/8 */
|
||||
isc_netaddr_fromin(&addr, &inaddr);
|
||||
result = dns_iptable_addprefix2(pos4neg6->iptable, &addr, 8,
|
||||
ISC_TRUE, ecs[pass].first);
|
||||
result = dns_iptable_addprefix(pos4neg6->iptable, &addr, 8,
|
||||
ISC_TRUE, ecs[pass].first);
|
||||
ATF_REQUIRE_EQ(result, ISC_R_SUCCESS);
|
||||
|
||||
addr.family = AF_INET6; /* !0a00::/8 */
|
||||
result = dns_iptable_addprefix2(pos4neg6->iptable, &addr, 8,
|
||||
ISC_FALSE, ecs[pass].second);
|
||||
result = dns_iptable_addprefix(pos4neg6->iptable, &addr, 8,
|
||||
ISC_FALSE, ecs[pass].second);
|
||||
ATF_REQUIRE_EQ(result, ISC_R_SUCCESS);
|
||||
|
||||
result = dns_acl_merge(notpos4neg6, pos4neg6, ISC_FALSE);
|
||||
@ -180,13 +180,13 @@ ATF_TC_BODY(dns_acl_isinsecure, tc) {
|
||||
|
||||
inaddr.s_addr = htonl(0x0a000000); /* !10.0.0.0/8 */
|
||||
isc_netaddr_fromin(&addr, &inaddr);
|
||||
result = dns_iptable_addprefix2(neg4neg6->iptable, &addr, 8,
|
||||
ISC_FALSE, ecs[pass].first);
|
||||
result = dns_iptable_addprefix(neg4neg6->iptable, &addr, 8,
|
||||
ISC_FALSE, ecs[pass].first);
|
||||
ATF_REQUIRE_EQ(result, ISC_R_SUCCESS);
|
||||
|
||||
addr.family = AF_INET6; /* !0a00::/8 */
|
||||
result = dns_iptable_addprefix2(neg4neg6->iptable, &addr, 8,
|
||||
ISC_FALSE, ecs[pass].second);
|
||||
result = dns_iptable_addprefix(neg4neg6->iptable, &addr, 8,
|
||||
ISC_FALSE, ecs[pass].second);
|
||||
ATF_REQUIRE_EQ(result, ISC_R_SUCCESS);
|
||||
|
||||
result = dns_acl_merge(notneg4neg6, neg4neg6, ISC_FALSE);
|
||||
@ -224,16 +224,16 @@ ATF_TC_BODY(dns_acl_isinsecure, tc) {
|
||||
|
||||
inaddr.s_addr = htonl(0x7f000001); /* 127.0.0.1 */
|
||||
isc_netaddr_fromin(&addr, &inaddr);
|
||||
result = dns_iptable_addprefix2(loop4->iptable, &addr, 32,
|
||||
ISC_TRUE, ecs[pass].first);
|
||||
result = dns_iptable_addprefix(loop4->iptable, &addr, 32,
|
||||
ISC_TRUE, ecs[pass].first);
|
||||
ATF_REQUIRE_EQ(result, ISC_R_SUCCESS);
|
||||
|
||||
result = dns_acl_merge(notloop4, loop4, ISC_FALSE);
|
||||
ATF_REQUIRE_EQ(result, ISC_R_SUCCESS);
|
||||
|
||||
isc_netaddr_fromin6(&addr, &in6addr_loopback); /* ::1 */
|
||||
result = dns_iptable_addprefix2(loop6->iptable, &addr, 128,
|
||||
ISC_TRUE, ecs[pass].first);
|
||||
result = dns_iptable_addprefix(loop6->iptable, &addr, 128,
|
||||
ISC_TRUE, ecs[pass].first);
|
||||
ATF_REQUIRE_EQ(result, ISC_R_SUCCESS);
|
||||
|
||||
result = dns_acl_merge(notloop6, loop6, ISC_FALSE);
|
||||
@ -270,13 +270,13 @@ ATF_TC_BODY(dns_acl_isinsecure, tc) {
|
||||
|
||||
inaddr.s_addr = htonl(0x7f000001); /* 127.0.0.1 */
|
||||
isc_netaddr_fromin(&addr, &inaddr);
|
||||
result = dns_iptable_addprefix2(loop4pos6->iptable, &addr, 32,
|
||||
ISC_TRUE, ecs[pass].first);
|
||||
result = dns_iptable_addprefix(loop4pos6->iptable, &addr, 32,
|
||||
ISC_TRUE, ecs[pass].first);
|
||||
ATF_REQUIRE_EQ(result, ISC_R_SUCCESS);
|
||||
|
||||
addr.family = AF_INET6; /* f700:0001::/32 */
|
||||
result = dns_iptable_addprefix2(loop4pos6->iptable, &addr, 32,
|
||||
ISC_TRUE, ecs[pass].second);
|
||||
result = dns_iptable_addprefix(loop4pos6->iptable, &addr, 32,
|
||||
ISC_TRUE, ecs[pass].second);
|
||||
ATF_REQUIRE_EQ(result, ISC_R_SUCCESS);
|
||||
|
||||
result = dns_acl_merge(notloop4pos6, loop4pos6, ISC_FALSE);
|
||||
@ -284,13 +284,13 @@ ATF_TC_BODY(dns_acl_isinsecure, tc) {
|
||||
|
||||
inaddr.s_addr = htonl(0x7f000001); /* 127.0.0.1 */
|
||||
isc_netaddr_fromin(&addr, &inaddr);
|
||||
result = dns_iptable_addprefix2(loop4neg6->iptable, &addr, 32,
|
||||
ISC_TRUE, ecs[pass].first);
|
||||
result = dns_iptable_addprefix(loop4neg6->iptable, &addr, 32,
|
||||
ISC_TRUE, ecs[pass].first);
|
||||
ATF_REQUIRE_EQ(result, ISC_R_SUCCESS);
|
||||
|
||||
addr.family = AF_INET6; /* !f700:0001::/32 */
|
||||
result = dns_iptable_addprefix2(loop4neg6->iptable, &addr, 32,
|
||||
ISC_FALSE, ecs[pass].second);
|
||||
result = dns_iptable_addprefix(loop4neg6->iptable, &addr, 32,
|
||||
ISC_FALSE, ecs[pass].second);
|
||||
ATF_REQUIRE_EQ(result, ISC_R_SUCCESS);
|
||||
|
||||
result = dns_acl_merge(notloop4neg6, loop4neg6, ISC_FALSE);
|
||||
|
@ -280,7 +280,8 @@ ATF_TC_BODY(class, tc) {
|
||||
dns_rdataclass_in, 0, NULL, &db);
|
||||
ATF_REQUIRE_EQ(result, ISC_R_SUCCESS);
|
||||
|
||||
result = dns_db_load(db, "testdata/db/data.db");
|
||||
result = dns_db_load(db, "testdata/db/data.db",
|
||||
dns_masterformat_text, 0);
|
||||
ATF_REQUIRE_EQ(result, ISC_R_SUCCESS);
|
||||
|
||||
ATF_CHECK_EQ(dns_db_class(db), dns_rdataclass_in);
|
||||
@ -303,7 +304,8 @@ ATF_TC_BODY(dbtype, tc) {
|
||||
result = dns_db_create(mctx, "rbt", dns_rootname, dns_dbtype_zone,
|
||||
dns_rdataclass_in, 0, NULL, &db);
|
||||
ATF_REQUIRE_EQ(result, ISC_R_SUCCESS);
|
||||
result = dns_db_load(db, "testdata/db/data.db");
|
||||
result = dns_db_load(db, "testdata/db/data.db",
|
||||
dns_masterformat_text, 0);
|
||||
ATF_REQUIRE_EQ(result, ISC_R_SUCCESS);
|
||||
ATF_CHECK(dns_db_iszone(db));
|
||||
ATF_CHECK(!dns_db_iscache(db));
|
||||
@ -313,7 +315,8 @@ ATF_TC_BODY(dbtype, tc) {
|
||||
result = dns_db_create(mctx, "rbt", dns_rootname, dns_dbtype_cache,
|
||||
dns_rdataclass_in, 0, NULL, &db);
|
||||
ATF_REQUIRE_EQ(result, ISC_R_SUCCESS);
|
||||
result = dns_db_load(db, "testdata/db/data.db");
|
||||
result = dns_db_load(db, "testdata/db/data.db",
|
||||
dns_masterformat_text, 0);
|
||||
ATF_REQUIRE_EQ(result, ISC_R_SUCCESS);
|
||||
ATF_CHECK(dns_db_iscache(db));
|
||||
ATF_CHECK(!dns_db_iszone(db));
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user