mirror of
https://github.com/isc-projects/bind9.git
synced 2026-05-28 04:34:54 -04:00
Merge branch 'each-cleanup-function-names' into 'main'
remove extra function names See merge request isc-projects/bind9!8204
This commit is contained in:
commit
8ff4895628
69 changed files with 400 additions and 414 deletions
|
|
@ -487,7 +487,8 @@ dns64prefix_answer(dns_message_t *msg, isc_buffer_t *buf) {
|
|||
size_t i, count = 10;
|
||||
|
||||
name = dns_fixedname_initname(&fixed);
|
||||
result = dns_name_fromstring(name, "ipv4only.arpa", 0, NULL);
|
||||
result = dns_name_fromstring(name, "ipv4only.arpa", dns_rootname, 0,
|
||||
NULL);
|
||||
check_result(result, "dns_name_fromstring");
|
||||
|
||||
result = dns_message_findname(msg, DNS_SECTION_ANSWER, name,
|
||||
|
|
|
|||
|
|
@ -2029,7 +2029,7 @@ next_origin(dig_lookup_t *oldlookup) {
|
|||
* Check for a absolute name or ndots being met.
|
||||
*/
|
||||
name = dns_fixedname_initname(&fixed);
|
||||
result = dns_name_fromstring2(name, oldlookup->textname, NULL, 0, NULL);
|
||||
result = dns_name_fromstring(name, oldlookup->textname, NULL, 0, NULL);
|
||||
if (result == ISC_R_SUCCESS &&
|
||||
(dns_name_isabsolute(name) ||
|
||||
(int)dns_name_countlabels(name) > ndots))
|
||||
|
|
|
|||
|
|
@ -274,7 +274,7 @@ emit(dns_dsdigest_t dt, bool showall, bool cds, dns_rdata_t *rdata) {
|
|||
fatal("can't build record");
|
||||
}
|
||||
|
||||
result = dns_name_totext(name, false, &nameb);
|
||||
result = dns_name_totext(name, 0, &nameb);
|
||||
if (result != ISC_R_SUCCESS) {
|
||||
fatal("can't print name");
|
||||
}
|
||||
|
|
|
|||
|
|
@ -2194,7 +2194,8 @@ configure_rpz_name(dns_view_t *view, const cfg_obj_t *obj, dns_name_t *name,
|
|||
const char *str, const char *msg) {
|
||||
isc_result_t result;
|
||||
|
||||
result = dns_name_fromstring(name, str, DNS_NAME_DOWNCASE, view->mctx);
|
||||
result = dns_name_fromstring(name, str, dns_rootname, DNS_NAME_DOWNCASE,
|
||||
view->mctx);
|
||||
if (result != ISC_R_SUCCESS) {
|
||||
cfg_obj_log(obj, named_g_lctx, DNS_RPZ_ERROR_LEVEL,
|
||||
"invalid %s '%s'", msg, str);
|
||||
|
|
@ -2207,8 +2208,8 @@ configure_rpz_name2(dns_view_t *view, const cfg_obj_t *obj, dns_name_t *name,
|
|||
const char *str, const dns_name_t *origin) {
|
||||
isc_result_t result;
|
||||
|
||||
result = dns_name_fromstring2(name, str, origin, DNS_NAME_DOWNCASE,
|
||||
view->mctx);
|
||||
result = dns_name_fromstring(name, str, origin, DNS_NAME_DOWNCASE,
|
||||
view->mctx);
|
||||
if (result != ISC_R_SUCCESS) {
|
||||
cfg_obj_log(obj, named_g_lctx, DNS_RPZ_ERROR_LEVEL,
|
||||
"invalid zone '%s'", str);
|
||||
|
|
@ -2671,7 +2672,7 @@ catz_addmodzone_cb(void *arg) {
|
|||
name = dns_catz_entry_getname(cz->entry);
|
||||
|
||||
isc_buffer_init(&namebuf, nameb, DNS_NAME_FORMATSIZE);
|
||||
dns_name_totext(name, true, &namebuf);
|
||||
dns_name_totext(name, DNS_NAME_OMITFINALDOT, &namebuf);
|
||||
isc_buffer_putuint8(&namebuf, 0);
|
||||
|
||||
result = dns_fwdtable_find(cz->view->fwdtable, name, &dnsforwarders);
|
||||
|
|
@ -3020,8 +3021,8 @@ configure_catz_zone(dns_view_t *view, dns_view_t *pview,
|
|||
|
||||
str = cfg_obj_asstring(cfg_tuple_get(catz_obj, "zone name"));
|
||||
|
||||
result = dns_name_fromstring(&origin, str, DNS_NAME_DOWNCASE,
|
||||
view->mctx);
|
||||
result = dns_name_fromstring(&origin, str, dns_rootname,
|
||||
DNS_NAME_DOWNCASE, view->mctx);
|
||||
if (result == ISC_R_SUCCESS && dns_name_equal(&origin, dns_rootname)) {
|
||||
result = DNS_R_EMPTYLABEL;
|
||||
}
|
||||
|
|
@ -3415,7 +3416,7 @@ create_empty_zone(dns_zone_t *pzone, dns_name_t *name, dns_view_t *view,
|
|||
{
|
||||
zconfig = cfg_listelt_value(element);
|
||||
str = cfg_obj_asstring(cfg_tuple_get(zconfig, "name"));
|
||||
CHECK(dns_name_fromstring(zname, str, 0, NULL));
|
||||
CHECK(dns_name_fromstring(zname, str, dns_rootname, 0, NULL));
|
||||
namereln = dns_name_fullcompare(zname, name, &order, &nlabels);
|
||||
if (namereln != dns_namereln_subdomain) {
|
||||
continue;
|
||||
|
|
@ -3446,10 +3447,11 @@ create_empty_zone(dns_zone_t *pzone, dns_name_t *name, dns_view_t *view,
|
|||
dns_name_clone(name, ns);
|
||||
} else {
|
||||
CHECK(dns_name_fromstring(ns, empty_dbtype[2],
|
||||
0, NULL));
|
||||
dns_rootname, 0,
|
||||
NULL));
|
||||
}
|
||||
CHECK(dns_name_fromstring(contact, empty_dbtype[3], 0,
|
||||
NULL));
|
||||
CHECK(dns_name_fromstring(contact, empty_dbtype[3],
|
||||
dns_rootname, 0, NULL));
|
||||
CHECK(add_soa(db, version, name, ns, contact));
|
||||
CHECK(add_ns(db, version, name, ns));
|
||||
}
|
||||
|
|
@ -5648,9 +5650,9 @@ configure_view(dns_view_t *view, dns_viewlist_t *viewlist, cfg_obj_t *config,
|
|||
result = named_config_get(maps, "empty-server", &obj);
|
||||
if (result == ISC_R_SUCCESS) {
|
||||
CHECK(dns_name_fromstring(name, cfg_obj_asstring(obj),
|
||||
0, NULL));
|
||||
dns_rootname, 0, NULL));
|
||||
isc_buffer_init(&buffer, server, sizeof(server) - 1);
|
||||
CHECK(dns_name_totext(name, false, &buffer));
|
||||
CHECK(dns_name_totext(name, 0, &buffer));
|
||||
server[isc_buffer_usedlength(&buffer)] = 0;
|
||||
empty_dbtype[2] = server;
|
||||
} else {
|
||||
|
|
@ -5661,9 +5663,9 @@ configure_view(dns_view_t *view, dns_viewlist_t *viewlist, cfg_obj_t *config,
|
|||
result = named_config_get(maps, "empty-contact", &obj);
|
||||
if (result == ISC_R_SUCCESS) {
|
||||
CHECK(dns_name_fromstring(name, cfg_obj_asstring(obj),
|
||||
0, NULL));
|
||||
dns_rootname, 0, NULL));
|
||||
isc_buffer_init(&buffer, contact, sizeof(contact) - 1);
|
||||
CHECK(dns_name_totext(name, false, &buffer));
|
||||
CHECK(dns_name_totext(name, 0, &buffer));
|
||||
contact[isc_buffer_usedlength(&buffer)] = 0;
|
||||
empty_dbtype[3] = contact;
|
||||
} else {
|
||||
|
|
@ -5701,7 +5703,8 @@ configure_view(dns_view_t *view, dns_viewlist_t *viewlist, cfg_obj_t *config,
|
|||
/*
|
||||
* Look for zone on drop list.
|
||||
*/
|
||||
CHECK(dns_name_fromstring(name, empty, 0, NULL));
|
||||
CHECK(dns_name_fromstring(name, empty, dns_rootname, 0,
|
||||
NULL));
|
||||
if (disablelist != NULL &&
|
||||
on_disable_list(disablelist, name))
|
||||
{
|
||||
|
|
@ -5804,8 +5807,9 @@ configure_view(dns_view_t *view, dns_viewlist_t *viewlist, cfg_obj_t *config,
|
|||
dns_forwarders_t *dnsforwarders = NULL;
|
||||
dns_fwdpolicy_t fwdpolicy = dns_fwdpolicy_none;
|
||||
|
||||
CHECK(dns_name_fromstring(
|
||||
name, zones[ipv4only_zone].name, 0, NULL));
|
||||
CHECK(dns_name_fromstring(name,
|
||||
zones[ipv4only_zone].name,
|
||||
dns_rootname, 0, NULL));
|
||||
|
||||
(void)dns_view_findzone(view, name, DNS_ZTFIND_EXACT,
|
||||
&zone);
|
||||
|
|
@ -5883,8 +5887,8 @@ configure_view(dns_view_t *view, dns_viewlist_t *viewlist, cfg_obj_t *config,
|
|||
result = named_config_get(maps, "nxdomain-redirect", &obj);
|
||||
if (result == ISC_R_SUCCESS) {
|
||||
dns_name_t *name = dns_fixedname_name(&view->redirectfixed);
|
||||
CHECK(dns_name_fromstring(name, cfg_obj_asstring(obj), 0,
|
||||
NULL));
|
||||
CHECK(dns_name_fromstring(name, cfg_obj_asstring(obj),
|
||||
dns_rootname, 0, NULL));
|
||||
view->redirectzone = name;
|
||||
} else {
|
||||
view->redirectzone = NULL;
|
||||
|
|
@ -5907,8 +5911,9 @@ configure_view(dns_view_t *view, dns_viewlist_t *viewlist, cfg_obj_t *config,
|
|||
|
||||
ntaname = dns_fixedname_initname(&fntaname);
|
||||
obj = cfg_listelt_value(element);
|
||||
CHECK(dns_name_fromstring(
|
||||
ntaname, cfg_obj_asstring(obj), 0, NULL));
|
||||
CHECK(dns_name_fromstring(ntaname,
|
||||
cfg_obj_asstring(obj),
|
||||
dns_rootname, 0, NULL));
|
||||
CHECK(dns_ntatable_add(ntatable, ntaname, true, 0,
|
||||
0xffffffffU));
|
||||
}
|
||||
|
|
@ -6158,7 +6163,8 @@ validate_tls(const cfg_obj_t *config, dns_view_t *view, const cfg_obj_t *obj,
|
|||
isc_log_t *logctx, const char *str, dns_name_t **name) {
|
||||
dns_fixedname_t fname;
|
||||
dns_name_t *nm = dns_fixedname_initname(&fname);
|
||||
isc_result_t result = dns_name_fromstring(nm, str, 0, NULL);
|
||||
isc_result_t result = dns_name_fromstring(nm, str, dns_rootname, 0,
|
||||
NULL);
|
||||
|
||||
if (result != ISC_R_SUCCESS) {
|
||||
cfg_obj_log(obj, logctx, ISC_LOG_ERROR,
|
||||
|
|
@ -7155,7 +7161,7 @@ get_tat_qname(dns_name_t *target, dns_name_t *keyname, dns_keynode_t *keynode) {
|
|||
isc_textregion_consume(&r, m);
|
||||
}
|
||||
|
||||
return (dns_name_fromstring2(target, label, keyname, 0, NULL));
|
||||
return (dns_name_fromstring(target, label, keyname, 0, NULL));
|
||||
}
|
||||
|
||||
static void
|
||||
|
|
@ -7759,7 +7765,7 @@ configure_zone_setviewcommit(isc_result_t result, const cfg_obj_t *zconfig,
|
|||
zname = cfg_obj_asstring(cfg_tuple_get(zconfig, "name"));
|
||||
origin = dns_fixedname_initname(&fixorigin);
|
||||
|
||||
result2 = dns_name_fromstring(origin, zname, 0, NULL);
|
||||
result2 = dns_name_fromstring(origin, zname, dns_rootname, 0, NULL);
|
||||
if (result2 != ISC_R_SUCCESS) {
|
||||
return;
|
||||
}
|
||||
|
|
@ -10460,7 +10466,7 @@ zone_from_args(named_server_t *server, isc_lex_t *lex, const char *zonetxt,
|
|||
}
|
||||
|
||||
name = dns_fixedname_initname(&fname);
|
||||
CHECK(dns_name_fromstring(name, zonebuf, 0, NULL));
|
||||
CHECK(dns_name_fromstring(name, zonebuf, dns_rootname, 0, NULL));
|
||||
|
||||
/* Look for the optional class name. */
|
||||
classtxt = next_token(lex, text);
|
||||
|
|
@ -11098,9 +11104,9 @@ listenelt_fromconfig(const cfg_obj_t *listener, const cfg_obj_t *config,
|
|||
&tls_params, tlsctx_cache, &delt));
|
||||
}
|
||||
|
||||
result = cfg_acl_fromconfig2(cfg_tuple_get(listener, "acl"), config,
|
||||
named_g_lctx, actx, mctx, 0, family,
|
||||
&delt->acl);
|
||||
result = cfg_acl_fromconfig(cfg_tuple_get(listener, "acl"), config,
|
||||
named_g_lctx, actx, mctx, family,
|
||||
&delt->acl);
|
||||
if (result != ISC_R_SUCCESS) {
|
||||
ns_listenelt_destroy(delt);
|
||||
return (result);
|
||||
|
|
@ -13347,7 +13353,7 @@ delete_zoneconf(dns_view_t *view, cfg_parser_t *pctx, const cfg_obj_t *config,
|
|||
cfg_listelt_t *e;
|
||||
|
||||
zn = cfg_obj_asstring(cfg_tuple_get(zconf, "name"));
|
||||
result = dns_name_fromstring(myname, zn, 0, NULL);
|
||||
result = dns_name_fromstring(myname, zn, dns_rootname, 0, NULL);
|
||||
if (result != ISC_R_SUCCESS || !dns_name_equal(zname, myname)) {
|
||||
continue;
|
||||
}
|
||||
|
|
@ -14193,7 +14199,8 @@ find_name_in_list_from_map(const cfg_obj_t *config,
|
|||
if (strcmp(map_key_for_list, "zone") == 0) {
|
||||
name1 = dns_fixedname_initname(&fixed1);
|
||||
name2 = dns_fixedname_initname(&fixed2);
|
||||
result = dns_name_fromstring(name1, name, 0, NULL);
|
||||
result = dns_name_fromstring(name1, name, dns_rootname, 0,
|
||||
NULL);
|
||||
RUNTIME_CHECK(result == ISC_R_SUCCESS);
|
||||
}
|
||||
|
||||
|
|
@ -14212,7 +14219,8 @@ find_name_in_list_from_map(const cfg_obj_t *config,
|
|||
}
|
||||
|
||||
if (name1 != NULL) {
|
||||
result = dns_name_fromstring(name2, vname, 0, NULL);
|
||||
result = dns_name_fromstring(name2, vname, dns_rootname,
|
||||
0, NULL);
|
||||
if (result == ISC_R_SUCCESS &&
|
||||
dns_name_equal(name1, name2))
|
||||
{
|
||||
|
|
|
|||
|
|
@ -2827,7 +2827,7 @@ lookforsoa:
|
|||
size_t size;
|
||||
|
||||
isc_buffer_init(&buf, serverstr, sizeof(serverstr));
|
||||
result = dns_name_totext(&primary, true, &buf);
|
||||
result = dns_name_totext(&primary, DNS_NAME_OMITFINALDOT, &buf);
|
||||
check_result(result, "dns_name_totext");
|
||||
serverstr[isc_buffer_usedlength(&buf)] = 0;
|
||||
|
||||
|
|
|
|||
|
|
@ -81,14 +81,14 @@ parse_params(isc_mem_t *mctx, int argc, char **argv, dns_name_t *z1,
|
|||
result = ISC_R_FAILURE;
|
||||
goto cleanup;
|
||||
}
|
||||
result = dns_name_fromstring2(z1, argv[0], dns_rootname, 0, mctx);
|
||||
result = dns_name_fromstring(z1, argv[0], dns_rootname, 0, mctx);
|
||||
if (result != ISC_R_SUCCESS) {
|
||||
log_write(ISC_LOG_ERROR,
|
||||
"parse_params: dns_name_fromstring2 -> %s",
|
||||
isc_result_totext(result));
|
||||
goto cleanup;
|
||||
}
|
||||
result = dns_name_fromstring2(z2, argv[1], dns_rootname, 0, mctx);
|
||||
result = dns_name_fromstring(z2, argv[1], dns_rootname, 0, mctx);
|
||||
if (result != ISC_R_SUCCESS) {
|
||||
log_write(ISC_LOG_ERROR,
|
||||
"parse_params: dns_name_fromstring2 -> %s",
|
||||
|
|
|
|||
|
|
@ -62,7 +62,7 @@ loadzone(dns_db_t **db, const char *origin, const char *filename) {
|
|||
|
||||
name = dns_fixedname_initname(&fixed);
|
||||
|
||||
result = dns_name_fromstring(name, origin, 0, NULL);
|
||||
result = dns_name_fromstring(name, origin, dns_rootname, 0, NULL);
|
||||
if (result != ISC_R_SUCCESS) {
|
||||
return (result);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -185,7 +185,8 @@ main(int argc, char *argv[]) {
|
|||
|
||||
if (origin != NULL) {
|
||||
name = dns_fixedname_initname(&fixed);
|
||||
result = dns_name_fromstring(name, origin, 0, NULL);
|
||||
result = dns_name_fromstring(name, origin, dns_rootname, 0,
|
||||
NULL);
|
||||
if (result != ISC_R_SUCCESS) {
|
||||
fatal("dns_name_fromstring: %s",
|
||||
isc_result_totext(result));
|
||||
|
|
|
|||
|
|
@ -193,7 +193,7 @@ LLVMFuzzerInitialize(int *argc ISC_ATTR_UNUSED, char ***argv ISC_ATTR_UNUSED) {
|
|||
dns_tsigkeyring_create(mctx, &ring);
|
||||
dns_tsigkeyring_create(mctx, &emptyring);
|
||||
|
||||
result = dns_name_fromstring(name, "tsig-key", 0, NULL);
|
||||
result = dns_name_fromstring(name, "tsig-key", dns_rootname, 0, NULL);
|
||||
if (result != ISC_R_SUCCESS) {
|
||||
fprintf(stderr, "dns_name_fromstring failed: %s\n",
|
||||
isc_result_totext(result));
|
||||
|
|
@ -214,7 +214,7 @@ LLVMFuzzerInitialize(int *argc ISC_ATTR_UNUSED, char ***argv ISC_ATTR_UNUSED) {
|
|||
return (1);
|
||||
}
|
||||
|
||||
result = dns_name_fromstring(name, "sig0key", 0, NULL);
|
||||
result = dns_name_fromstring(name, "sig0key", dns_rootname, 0, NULL);
|
||||
if (result != ISC_R_SUCCESS) {
|
||||
fprintf(stderr, "dns_name_fromstring failed: %s\n",
|
||||
isc_result_totext(result));
|
||||
|
|
|
|||
|
|
@ -1439,7 +1439,8 @@ catz_process_primaries(dns_catz_zone_t *catz, dns_ipkeylist_t *ipkl,
|
|||
memmove(keycbuf, rdatastr.data, rdatastr.length);
|
||||
keycbuf[rdatastr.length] = 0;
|
||||
dns_rdata_freestruct(&rdata_txt);
|
||||
result = dns_name_fromstring(keyname, keycbuf, 0, mctx);
|
||||
result = dns_name_fromstring(keyname, keycbuf,
|
||||
dns_rootname, 0, mctx);
|
||||
if (result != ISC_R_SUCCESS) {
|
||||
dns_name_free(keyname, mctx);
|
||||
isc_mem_put(mctx, keyname, sizeof(*keyname));
|
||||
|
|
@ -1867,13 +1868,13 @@ dns_catz_generate_masterfilename(dns_catz_zone_t *catz, dns_catz_entry_t *entry,
|
|||
|
||||
isc_buffer_putstr(tbuf, catz->catzs->view->name);
|
||||
isc_buffer_putstr(tbuf, "_");
|
||||
result = dns_name_totext(&catz->name, true, tbuf);
|
||||
result = dns_name_totext(&catz->name, DNS_NAME_OMITFINALDOT, tbuf);
|
||||
if (result != ISC_R_SUCCESS) {
|
||||
goto cleanup;
|
||||
}
|
||||
|
||||
isc_buffer_putstr(tbuf, "_");
|
||||
result = dns_name_totext(&entry->name, true, tbuf);
|
||||
result = dns_name_totext(&entry->name, DNS_NAME_OMITFINALDOT, tbuf);
|
||||
if (result != ISC_R_SUCCESS) {
|
||||
goto cleanup;
|
||||
}
|
||||
|
|
@ -1966,7 +1967,7 @@ dns_catz_generate_zonecfg(dns_catz_zone_t *catz, dns_catz_entry_t *entry,
|
|||
isc_buffer_allocate(catz->catzs->mctx, &buffer, ISC_BUFFER_INCR);
|
||||
|
||||
isc_buffer_putstr(buffer, "zone \"");
|
||||
dns_name_totext(&entry->name, true, buffer);
|
||||
dns_name_totext(&entry->name, DNS_NAME_OMITFINALDOT, buffer);
|
||||
isc_buffer_putstr(buffer, "\" { type secondary; primaries");
|
||||
|
||||
isc_buffer_putstr(buffer, " { ");
|
||||
|
|
@ -2003,7 +2004,7 @@ dns_catz_generate_zonecfg(dns_catz_zone_t *catz, dns_catz_entry_t *entry,
|
|||
if (entry->opts.masters.keys[i] != NULL) {
|
||||
isc_buffer_putstr(buffer, " key ");
|
||||
result = dns_name_totext(entry->opts.masters.keys[i],
|
||||
true, buffer);
|
||||
DNS_NAME_OMITFINALDOT, buffer);
|
||||
if (result != ISC_R_SUCCESS) {
|
||||
goto cleanup;
|
||||
}
|
||||
|
|
@ -2012,7 +2013,7 @@ dns_catz_generate_zonecfg(dns_catz_zone_t *catz, dns_catz_entry_t *entry,
|
|||
if (entry->opts.masters.tlss[i] != NULL) {
|
||||
isc_buffer_putstr(buffer, " tls ");
|
||||
result = dns_name_totext(entry->opts.masters.tlss[i],
|
||||
true, buffer);
|
||||
DNS_NAME_OMITFINALDOT, buffer);
|
||||
if (result != ISC_R_SUCCESS) {
|
||||
goto cleanup;
|
||||
}
|
||||
|
|
@ -2293,7 +2294,7 @@ dns__catz_update_cb(void *data) {
|
|||
* records might be processed differently depending on the version of
|
||||
* the catalog zone's schema.
|
||||
*/
|
||||
result = dns_name_fromstring2(name, "version", &updb->origin, 0, NULL);
|
||||
result = dns_name_fromstring(name, "version", &updb->origin, 0, NULL);
|
||||
if (result != ISC_R_SUCCESS) {
|
||||
dns_dbiterator_destroy(&updbit);
|
||||
isc_log_write(dns_lctx, DNS_LOGCATEGORY_GENERAL,
|
||||
|
|
|
|||
|
|
@ -117,7 +117,8 @@ name_to_gbuffer(const dns_name_t *name, isc_buffer_t *buffer,
|
|||
namep = &tname;
|
||||
}
|
||||
|
||||
result = dns_name_toprincipal(namep, buffer);
|
||||
result = dns_name_totext(
|
||||
namep, DNS_NAME_OMITFINALDOT | DNS_NAME_PRINCIPAL, buffer);
|
||||
RUNTIME_CHECK(result == ISC_R_SUCCESS);
|
||||
isc_buffer_putuint8(buffer, 0);
|
||||
isc_buffer_usedregion(buffer, &r);
|
||||
|
|
@ -383,7 +384,8 @@ dst_gssapi_identitymatchesrealmkrb5(const dns_name_t *signer,
|
|||
* a string, and do string operations on them.
|
||||
*/
|
||||
isc_buffer_init(&buffer, sbuf, sizeof(sbuf));
|
||||
result = dns_name_toprincipal(signer, &buffer);
|
||||
result = dns_name_totext(
|
||||
signer, DNS_NAME_OMITFINALDOT | DNS_NAME_PRINCIPAL, &buffer);
|
||||
RUNTIME_CHECK(result == ISC_R_SUCCESS);
|
||||
isc_buffer_putuint8(&buffer, 0);
|
||||
dns_name_format(realm, rbuf, sizeof(rbuf));
|
||||
|
|
@ -431,7 +433,8 @@ dst_gssapi_identitymatchesrealmkrb5(const dns_name_t *signer,
|
|||
dns_name_t *machine;
|
||||
|
||||
machine = dns_fixedname_initname(&fixed);
|
||||
result = dns_name_fromstring(machine, sname, 0, NULL);
|
||||
result = dns_name_fromstring(machine, sname, dns_rootname, 0,
|
||||
NULL);
|
||||
if (result != ISC_R_SUCCESS) {
|
||||
return (false);
|
||||
}
|
||||
|
|
@ -460,7 +463,8 @@ dst_gssapi_identitymatchesrealmms(const dns_name_t *signer,
|
|||
* a string, and do string operations on them.
|
||||
*/
|
||||
isc_buffer_init(&buffer, sbuf, sizeof(sbuf));
|
||||
result = dns_name_toprincipal(signer, &buffer);
|
||||
result = dns_name_totext(
|
||||
signer, DNS_NAME_OMITFINALDOT | DNS_NAME_PRINCIPAL, &buffer);
|
||||
RUNTIME_CHECK(result == ISC_R_SUCCESS);
|
||||
isc_buffer_putuint8(&buffer, 0);
|
||||
dns_name_format(realm, rbuf, sizeof(rbuf));
|
||||
|
|
@ -511,7 +515,7 @@ dst_gssapi_identitymatchesrealmms(const dns_name_t *signer,
|
|||
dns_name_t *machine;
|
||||
|
||||
machine = dns_fixedname_initname(&fixed);
|
||||
result = dns_name_fromstring2(machine, sbuf, realm, 0, NULL);
|
||||
result = dns_name_fromstring(machine, sbuf, realm, 0, NULL);
|
||||
if (result != ISC_R_SUCCESS) {
|
||||
return (false);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -720,10 +720,7 @@ dns_name_fromwire(dns_name_t *name, isc_buffer_t *source, dns_decompress_t dctx,
|
|||
|
||||
isc_result_t
|
||||
dns_name_towire(const dns_name_t *name, dns_compress_t *cctx,
|
||||
isc_buffer_t *target);
|
||||
isc_result_t
|
||||
dns_name_towire2(const dns_name_t *name, dns_compress_t *cctx,
|
||||
isc_buffer_t *target, uint16_t *comp_offsetp);
|
||||
isc_buffer_t *target, uint16_t *comp_offsetp);
|
||||
/*%<
|
||||
* Convert 'name' into wire format, compressing it as specified by the
|
||||
* compression context 'cctx', and storing the result in 'target'.
|
||||
|
|
@ -800,30 +797,22 @@ dns_name_fromtext(dns_name_t *name, isc_buffer_t *source,
|
|||
*/
|
||||
|
||||
#define DNS_NAME_OMITFINALDOT 0x01U
|
||||
#define DNS_NAME_MASTERFILE 0x02U /* escape $ and @ */
|
||||
#define DNS_NAME_PRINCIPAL 0x02U /* do not escape $ and @ */
|
||||
|
||||
isc_result_t
|
||||
dns_name_toprincipal(const dns_name_t *name, isc_buffer_t *target);
|
||||
|
||||
isc_result_t
|
||||
dns_name_totext(const dns_name_t *name, bool omit_final_dot,
|
||||
dns_name_totext(const dns_name_t *name, unsigned int options,
|
||||
isc_buffer_t *target);
|
||||
|
||||
isc_result_t
|
||||
dns_name_totext2(const dns_name_t *name, unsigned int options,
|
||||
isc_buffer_t *target);
|
||||
/*%<
|
||||
* Convert 'name' into text format, storing the result in 'target'.
|
||||
*
|
||||
* Notes:
|
||||
*\li If 'omit_final_dot' is true, then the final '.' in absolute
|
||||
* names other than the root name will be omitted.
|
||||
*
|
||||
*\li If DNS_NAME_OMITFINALDOT is set in options, then the final '.'
|
||||
* in absolute names other than the root name will be omitted.
|
||||
*
|
||||
*\li If DNS_NAME_MASTERFILE is set in options, '$' and '@' will also
|
||||
* be escaped.
|
||||
*\li If DNS_NAME_PRINCIPAL is set in options, '$' and '@' will *not*
|
||||
* be escaped; otherwise they will, along with other characters that
|
||||
* are special in zone files ('"', '(', ')', '.', ';', and '\'),
|
||||
* which are always escaped.
|
||||
*
|
||||
*\li If dns_name_countlabels == 0, the name will be "@", representing the
|
||||
* current origin as described by RFC1035.
|
||||
|
|
@ -834,9 +823,9 @@ dns_name_totext2(const dns_name_t *name, unsigned int options,
|
|||
*
|
||||
*\li 'name' is a valid name
|
||||
*
|
||||
*\li 'target' is a valid buffer.
|
||||
*\li 'target' is a valid buffer
|
||||
*
|
||||
*\li if dns_name_isabsolute == FALSE, then omit_final_dot == FALSE
|
||||
*\li if dns_name_isabsolute is false, then omit_final_dot is false
|
||||
*
|
||||
* Ensures:
|
||||
*
|
||||
|
|
@ -1160,12 +1149,9 @@ dns_name_tostring(const dns_name_t *source, char **target, isc_mem_t *mctx);
|
|||
*/
|
||||
|
||||
isc_result_t
|
||||
dns_name_fromstring(dns_name_t *target, const char *src, unsigned int options,
|
||||
dns_name_fromstring(dns_name_t *target, const char *src,
|
||||
const dns_name_t *origin, unsigned int options,
|
||||
isc_mem_t *mctx);
|
||||
isc_result_t
|
||||
dns_name_fromstring2(dns_name_t *target, const char *src,
|
||||
const dns_name_t *origin, unsigned int options,
|
||||
isc_mem_t *mctx);
|
||||
/*%<
|
||||
* Convert a string to a name and place it in target, allocating memory
|
||||
* as necessary. 'options' has the same semantics as that of
|
||||
|
|
|
|||
|
|
@ -503,7 +503,10 @@ ncache_summary(dns_rdataset_t *rdataset, bool omit_final_dot,
|
|||
CHECK(str_totext("; ", target));
|
||||
}
|
||||
|
||||
CHECK(dns_name_totext(&name, omit_final_dot, target));
|
||||
CHECK(dns_name_totext(
|
||||
&name,
|
||||
omit_final_dot ? DNS_NAME_OMITFINALDOT : 0,
|
||||
target));
|
||||
CHECK(str_totext(" ", target));
|
||||
CHECK(dns_rdatatype_totext(rds.type, target));
|
||||
if (rds.type == dns_rdatatype_rrsig) {
|
||||
|
|
@ -603,7 +606,10 @@ rdataset_totext(dns_rdataset_t *rdataset, const dns_name_t *owner_name,
|
|||
!first))
|
||||
{
|
||||
unsigned int name_start = target->used;
|
||||
RETERR(dns_name_totext(name, omit_final_dot, target));
|
||||
RETERR(dns_name_totext(
|
||||
name,
|
||||
omit_final_dot ? DNS_NAME_OMITFINALDOT : 0,
|
||||
target));
|
||||
column += target->used - name_start;
|
||||
}
|
||||
|
||||
|
|
@ -800,7 +806,8 @@ question_totext(dns_rdataset_t *rdataset, const dns_name_t *owner_name,
|
|||
/* Owner name */
|
||||
{
|
||||
unsigned int name_start = target->used;
|
||||
RETERR(dns_name_totext(owner_name, omit_final_dot, target));
|
||||
unsigned int opts = omit_final_dot ? DNS_NAME_OMITFINALDOT : 0;
|
||||
RETERR(dns_name_totext(owner_name, opts, target));
|
||||
column += target->used - name_start;
|
||||
}
|
||||
|
||||
|
|
@ -1055,7 +1062,7 @@ dump_rdatasets_text(isc_mem_t *mctx, const dns_name_t *name,
|
|||
|
||||
if (itresult == ISC_R_SUCCESS && ctx->neworigin != NULL) {
|
||||
isc_buffer_clear(buffer);
|
||||
itresult = dns_name_totext(ctx->neworigin, false, buffer);
|
||||
itresult = dns_name_totext(ctx->neworigin, 0, buffer);
|
||||
RUNTIME_CHECK(itresult == ISC_R_SUCCESS);
|
||||
isc_buffer_usedregion(buffer, &r);
|
||||
fprintf(f, "$ORIGIN %.*s\n", (int)r.length, (char *)r.base);
|
||||
|
|
|
|||
|
|
@ -1098,24 +1098,8 @@ dns_name_fromtext(dns_name_t *name, isc_buffer_t *source,
|
|||
}
|
||||
|
||||
isc_result_t
|
||||
dns_name_totext(const dns_name_t *name, bool omit_final_dot,
|
||||
dns_name_totext(const dns_name_t *name, unsigned int options,
|
||||
isc_buffer_t *target) {
|
||||
unsigned int options = DNS_NAME_MASTERFILE;
|
||||
|
||||
if (omit_final_dot) {
|
||||
options |= DNS_NAME_OMITFINALDOT;
|
||||
}
|
||||
return (dns_name_totext2(name, options, target));
|
||||
}
|
||||
|
||||
isc_result_t
|
||||
dns_name_toprincipal(const dns_name_t *name, isc_buffer_t *target) {
|
||||
return (dns_name_totext2(name, DNS_NAME_OMITFINALDOT, target));
|
||||
}
|
||||
|
||||
isc_result_t
|
||||
dns_name_totext2(const dns_name_t *name, unsigned int options,
|
||||
isc_buffer_t *target) {
|
||||
unsigned char *ndata;
|
||||
char *tdata;
|
||||
unsigned int nlen, tlen;
|
||||
|
|
@ -1202,8 +1186,7 @@ dns_name_totext2(const dns_name_t *name, unsigned int options,
|
|||
/* Special modifiers in zone files. */
|
||||
case 0x40: /* '@' */
|
||||
case 0x24: /* '$' */
|
||||
if ((options & DNS_NAME_MASTERFILE) ==
|
||||
0)
|
||||
if ((options & DNS_NAME_PRINCIPAL) != 0)
|
||||
{
|
||||
goto no_escape;
|
||||
}
|
||||
|
|
@ -1663,13 +1646,7 @@ root_label:;
|
|||
|
||||
isc_result_t
|
||||
dns_name_towire(const dns_name_t *name, dns_compress_t *cctx,
|
||||
isc_buffer_t *target) {
|
||||
return (dns_name_towire2(name, cctx, target, NULL));
|
||||
}
|
||||
|
||||
isc_result_t
|
||||
dns_name_towire2(const dns_name_t *name, dns_compress_t *cctx,
|
||||
isc_buffer_t *target, uint16_t *name_coff) {
|
||||
isc_buffer_t *target, uint16_t *name_coff) {
|
||||
bool compress;
|
||||
dns_offsets_t clo;
|
||||
dns_name_t clname;
|
||||
|
|
@ -2026,7 +2003,7 @@ dns_name_print(const dns_name_t *name, FILE *stream) {
|
|||
REQUIRE(VALID_NAME(name));
|
||||
|
||||
isc_buffer_init(&b, t, sizeof(t));
|
||||
result = dns_name_totext(name, false, &b);
|
||||
result = dns_name_totext(name, 0, &b);
|
||||
if (result != ISC_R_SUCCESS) {
|
||||
return (result);
|
||||
}
|
||||
|
|
@ -2067,7 +2044,7 @@ dns_name_format(const dns_name_t *name, char *cp, unsigned int size) {
|
|||
* Leave room for null termination after buffer.
|
||||
*/
|
||||
isc_buffer_init(&buf, cp, size - 1);
|
||||
result = dns_name_totext(name, true, &buf);
|
||||
result = dns_name_totext(name, DNS_NAME_OMITFINALDOT, &buf);
|
||||
if (result == ISC_R_SUCCESS) {
|
||||
isc_buffer_putuint8(&buf, (uint8_t)'\0');
|
||||
} else {
|
||||
|
|
@ -2090,7 +2067,7 @@ dns_name_tostring(const dns_name_t *name, char **target, isc_mem_t *mctx) {
|
|||
REQUIRE(target != NULL && *target == NULL);
|
||||
|
||||
isc_buffer_init(&buf, txt, sizeof(txt));
|
||||
result = dns_name_totext(name, false, &buf);
|
||||
result = dns_name_totext(name, 0, &buf);
|
||||
if (result != ISC_R_SUCCESS) {
|
||||
return (result);
|
||||
}
|
||||
|
|
@ -2104,20 +2081,10 @@ dns_name_tostring(const dns_name_t *name, char **target, isc_mem_t *mctx) {
|
|||
return (ISC_R_SUCCESS);
|
||||
}
|
||||
|
||||
/*
|
||||
* dns_name_fromstring() -- convert directly from a string to a name,
|
||||
* allocating memory as needed
|
||||
*/
|
||||
isc_result_t
|
||||
dns_name_fromstring(dns_name_t *target, const char *src, unsigned int options,
|
||||
dns_name_fromstring(dns_name_t *target, const char *src,
|
||||
const dns_name_t *origin, unsigned int options,
|
||||
isc_mem_t *mctx) {
|
||||
return (dns_name_fromstring2(target, src, dns_rootname, options, mctx));
|
||||
}
|
||||
|
||||
isc_result_t
|
||||
dns_name_fromstring2(dns_name_t *target, const char *src,
|
||||
const dns_name_t *origin, unsigned int options,
|
||||
isc_mem_t *mctx) {
|
||||
isc_result_t result;
|
||||
isc_buffer_t buf;
|
||||
dns_fixedname_t fn;
|
||||
|
|
|
|||
|
|
@ -352,7 +352,7 @@ dns_ncache_towire(dns_rdataset_t *rdataset, dns_compress_t *cctx,
|
|||
* Write the name.
|
||||
*/
|
||||
dns_compress_setpermitted(cctx, true);
|
||||
result = dns_name_towire(&name, cctx, target);
|
||||
result = dns_name_towire(&name, cctx, target, NULL);
|
||||
if (result != ISC_R_SUCCESS) {
|
||||
goto rollback;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -551,7 +551,7 @@ dns_ntatable_save(dns_ntatable_t *ntatable, FILE *fp) {
|
|||
}
|
||||
|
||||
isc_buffer_init(&b, nbuf, sizeof(nbuf));
|
||||
result = dns_name_totext(n->name, false, &b);
|
||||
result = dns_name_totext(n->name, 0, &b);
|
||||
if (result != ISC_R_SUCCESS) {
|
||||
continue;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -139,9 +139,9 @@ totext_any_tsig(ARGS_TOTEXT) {
|
|||
char *bufp;
|
||||
dns_name_t name;
|
||||
dns_name_t prefix;
|
||||
bool sub;
|
||||
uint64_t sigtime;
|
||||
unsigned short n;
|
||||
unsigned int opts;
|
||||
|
||||
REQUIRE(rdata->type == dns_rdatatype_tsig);
|
||||
REQUIRE(rdata->rdclass == dns_rdataclass_any);
|
||||
|
|
@ -154,8 +154,9 @@ totext_any_tsig(ARGS_TOTEXT) {
|
|||
dns_name_init(&name, NULL);
|
||||
dns_name_init(&prefix, NULL);
|
||||
dns_name_fromregion(&name, &sr);
|
||||
sub = name_prefix(&name, tctx->origin, &prefix);
|
||||
RETERR(dns_name_totext(&prefix, sub, target));
|
||||
opts = name_prefix(&name, tctx->origin, &prefix) ? DNS_NAME_OMITFINALDOT
|
||||
: 0;
|
||||
RETERR(dns_name_totext(&prefix, opts, target));
|
||||
RETERR(str_totext(" ", target));
|
||||
isc_region_consume(&sr, name_length(&name));
|
||||
|
||||
|
|
@ -335,7 +336,7 @@ towire_any_tsig(ARGS_TOWIRE) {
|
|||
dns_rdata_toregion(rdata, &sr);
|
||||
dns_name_init(&name, offsets);
|
||||
dns_name_fromregion(&name, &sr);
|
||||
RETERR(dns_name_towire(&name, cctx, target));
|
||||
RETERR(dns_name_towire(&name, cctx, target, NULL));
|
||||
isc_region_consume(&sr, name_length(&name));
|
||||
return (mem_tobuffer(target, sr.base, sr.length));
|
||||
}
|
||||
|
|
|
|||
|
|
@ -69,7 +69,7 @@ totext_ch_a(ARGS_TOTEXT) {
|
|||
isc_region_t region;
|
||||
dns_name_t name;
|
||||
dns_name_t prefix;
|
||||
bool sub;
|
||||
unsigned int opts;
|
||||
char buf[sizeof("0177777")];
|
||||
uint16_t addr;
|
||||
|
||||
|
|
@ -85,8 +85,9 @@ totext_ch_a(ARGS_TOTEXT) {
|
|||
isc_region_consume(®ion, name_length(&name));
|
||||
addr = uint16_fromregion(®ion);
|
||||
|
||||
sub = name_prefix(&name, tctx->origin, &prefix);
|
||||
RETERR(dns_name_totext(&prefix, sub, target));
|
||||
opts = name_prefix(&name, tctx->origin, &prefix) ? DNS_NAME_OMITFINALDOT
|
||||
: 0;
|
||||
RETERR(dns_name_totext(&prefix, opts, target));
|
||||
|
||||
snprintf(buf, sizeof(buf), "%o", addr); /* note octal */
|
||||
RETERR(str_totext(" ", target));
|
||||
|
|
@ -146,7 +147,7 @@ towire_ch_a(ARGS_TOWIRE) {
|
|||
|
||||
dns_name_fromregion(&name, &sregion);
|
||||
isc_region_consume(&sregion, name_length(&name));
|
||||
RETERR(dns_name_towire(&name, cctx, target));
|
||||
RETERR(dns_name_towire(&name, cctx, target, NULL));
|
||||
|
||||
isc_buffer_availableregion(target, &tregion);
|
||||
if (tregion.length < 2) {
|
||||
|
|
|
|||
|
|
@ -71,8 +71,7 @@ totext_afsdb(ARGS_TOTEXT) {
|
|||
dns_name_t prefix;
|
||||
isc_region_t region;
|
||||
char buf[sizeof("64000 ")];
|
||||
bool sub;
|
||||
unsigned int num;
|
||||
unsigned int num, opts;
|
||||
|
||||
REQUIRE(rdata->type == dns_rdatatype_afsdb);
|
||||
REQUIRE(rdata->length != 0);
|
||||
|
|
@ -86,8 +85,9 @@ totext_afsdb(ARGS_TOTEXT) {
|
|||
snprintf(buf, sizeof(buf), "%u ", num);
|
||||
RETERR(str_totext(buf, target));
|
||||
dns_name_fromregion(&name, ®ion);
|
||||
sub = name_prefix(&name, tctx->origin, &prefix);
|
||||
return (dns_name_totext(&prefix, sub, target));
|
||||
opts = name_prefix(&name, tctx->origin, &prefix) ? DNS_NAME_OMITFINALDOT
|
||||
: 0;
|
||||
return (dns_name_totext(&prefix, opts, target));
|
||||
}
|
||||
|
||||
static isc_result_t
|
||||
|
|
@ -142,7 +142,7 @@ towire_afsdb(ARGS_TOWIRE) {
|
|||
dns_name_init(&name, offsets);
|
||||
dns_name_fromregion(&name, &sr);
|
||||
|
||||
return (dns_name_towire(&name, cctx, target));
|
||||
return (dns_name_towire(&name, cctx, target, NULL));
|
||||
}
|
||||
|
||||
static int
|
||||
|
|
|
|||
|
|
@ -174,7 +174,7 @@ totext_amtrelay(ARGS_TOTEXT) {
|
|||
case 3:
|
||||
dns_name_init(&name, NULL);
|
||||
dns_name_fromregion(&name, ®ion);
|
||||
return (dns_name_totext(&name, false, target));
|
||||
return (dns_name_totext(&name, 0, target));
|
||||
|
||||
default:
|
||||
UNREACHABLE();
|
||||
|
|
|
|||
|
|
@ -46,7 +46,7 @@ totext_cname(ARGS_TOTEXT) {
|
|||
isc_region_t region;
|
||||
dns_name_t name;
|
||||
dns_name_t prefix;
|
||||
bool sub;
|
||||
unsigned int opts;
|
||||
|
||||
REQUIRE(rdata->type == dns_rdatatype_cname);
|
||||
REQUIRE(rdata->length != 0);
|
||||
|
|
@ -57,9 +57,9 @@ totext_cname(ARGS_TOTEXT) {
|
|||
dns_rdata_toregion(rdata, ®ion);
|
||||
dns_name_fromregion(&name, ®ion);
|
||||
|
||||
sub = name_prefix(&name, tctx->origin, &prefix);
|
||||
|
||||
return (dns_name_totext(&prefix, sub, target));
|
||||
opts = name_prefix(&name, tctx->origin, &prefix) ? DNS_NAME_OMITFINALDOT
|
||||
: 0;
|
||||
return (dns_name_totext(&prefix, opts, target));
|
||||
}
|
||||
|
||||
static isc_result_t
|
||||
|
|
@ -92,7 +92,7 @@ towire_cname(ARGS_TOWIRE) {
|
|||
dns_rdata_toregion(rdata, ®ion);
|
||||
dns_name_fromregion(&name, ®ion);
|
||||
|
||||
return (dns_name_towire(&name, cctx, target));
|
||||
return (dns_name_towire(&name, cctx, target, NULL));
|
||||
}
|
||||
|
||||
static int
|
||||
|
|
|
|||
|
|
@ -47,7 +47,7 @@ totext_dname(ARGS_TOTEXT) {
|
|||
isc_region_t region;
|
||||
dns_name_t name;
|
||||
dns_name_t prefix;
|
||||
bool sub;
|
||||
unsigned int opts;
|
||||
|
||||
REQUIRE(rdata->type == dns_rdatatype_dname);
|
||||
REQUIRE(rdata->length != 0);
|
||||
|
|
@ -58,9 +58,9 @@ totext_dname(ARGS_TOTEXT) {
|
|||
dns_rdata_toregion(rdata, ®ion);
|
||||
dns_name_fromregion(&name, ®ion);
|
||||
|
||||
sub = name_prefix(&name, tctx->origin, &prefix);
|
||||
|
||||
return (dns_name_totext(&prefix, sub, target));
|
||||
opts = name_prefix(&name, tctx->origin, &prefix) ? DNS_NAME_OMITFINALDOT
|
||||
: 0;
|
||||
return (dns_name_totext(&prefix, opts, target));
|
||||
}
|
||||
|
||||
static isc_result_t
|
||||
|
|
@ -92,7 +92,7 @@ towire_dname(ARGS_TOWIRE) {
|
|||
dns_rdata_toregion(rdata, ®ion);
|
||||
dns_name_fromregion(&name, ®ion);
|
||||
|
||||
return (dns_name_towire(&name, cctx, target));
|
||||
return (dns_name_towire(&name, cctx, target, NULL));
|
||||
}
|
||||
|
||||
static int
|
||||
|
|
|
|||
|
|
@ -177,7 +177,7 @@ totext_hip(ARGS_TOTEXT) {
|
|||
while (region.length > 0) {
|
||||
dns_name_fromregion(&name, ®ion);
|
||||
|
||||
RETERR(dns_name_totext(&name, false, target));
|
||||
RETERR(dns_name_totext(&name, 0, target));
|
||||
isc_region_consume(®ion, name.length);
|
||||
if (region.length > 0) {
|
||||
RETERR(str_totext(tctx->linebreak, target));
|
||||
|
|
|
|||
|
|
@ -187,7 +187,7 @@ totext_ipseckey(ARGS_TOTEXT) {
|
|||
|
||||
case 3:
|
||||
dns_name_fromregion(&name, ®ion);
|
||||
RETERR(dns_name_totext(&name, false, target));
|
||||
RETERR(dns_name_totext(&name, 0, target));
|
||||
isc_region_consume(®ion, name_length(&name));
|
||||
break;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -55,7 +55,7 @@ totext_lp(ARGS_TOTEXT) {
|
|||
isc_region_t region;
|
||||
dns_name_t name;
|
||||
dns_name_t prefix;
|
||||
bool sub;
|
||||
unsigned int opts;
|
||||
char buf[sizeof("64000")];
|
||||
unsigned short num;
|
||||
|
||||
|
|
@ -74,8 +74,9 @@ totext_lp(ARGS_TOTEXT) {
|
|||
RETERR(str_totext(" ", target));
|
||||
|
||||
dns_name_fromregion(&name, ®ion);
|
||||
sub = name_prefix(&name, tctx->origin, &prefix);
|
||||
return (dns_name_totext(&prefix, sub, target));
|
||||
opts = name_prefix(&name, tctx->origin, &prefix) ? DNS_NAME_OMITFINALDOT
|
||||
: 0;
|
||||
return (dns_name_totext(&prefix, opts, target));
|
||||
}
|
||||
|
||||
static isc_result_t
|
||||
|
|
|
|||
|
|
@ -45,7 +45,7 @@ totext_mb(ARGS_TOTEXT) {
|
|||
isc_region_t region;
|
||||
dns_name_t name;
|
||||
dns_name_t prefix;
|
||||
bool sub;
|
||||
unsigned int opts;
|
||||
|
||||
REQUIRE(rdata->type == dns_rdatatype_mb);
|
||||
REQUIRE(rdata->length != 0);
|
||||
|
|
@ -56,9 +56,9 @@ totext_mb(ARGS_TOTEXT) {
|
|||
dns_rdata_toregion(rdata, ®ion);
|
||||
dns_name_fromregion(&name, ®ion);
|
||||
|
||||
sub = name_prefix(&name, tctx->origin, &prefix);
|
||||
|
||||
return (dns_name_totext(&prefix, sub, target));
|
||||
opts = name_prefix(&name, tctx->origin, &prefix) ? DNS_NAME_OMITFINALDOT
|
||||
: 0;
|
||||
return (dns_name_totext(&prefix, opts, target));
|
||||
}
|
||||
|
||||
static isc_result_t
|
||||
|
|
@ -91,7 +91,7 @@ towire_mb(ARGS_TOWIRE) {
|
|||
dns_rdata_toregion(rdata, ®ion);
|
||||
dns_name_fromregion(&name, ®ion);
|
||||
|
||||
return (dns_name_towire(&name, cctx, target));
|
||||
return (dns_name_towire(&name, cctx, target, NULL));
|
||||
}
|
||||
|
||||
static int
|
||||
|
|
|
|||
|
|
@ -45,7 +45,7 @@ totext_md(ARGS_TOTEXT) {
|
|||
isc_region_t region;
|
||||
dns_name_t name;
|
||||
dns_name_t prefix;
|
||||
bool sub;
|
||||
unsigned int opts;
|
||||
|
||||
REQUIRE(rdata->type == dns_rdatatype_md);
|
||||
REQUIRE(rdata->length != 0);
|
||||
|
|
@ -56,9 +56,9 @@ totext_md(ARGS_TOTEXT) {
|
|||
dns_rdata_toregion(rdata, ®ion);
|
||||
dns_name_fromregion(&name, ®ion);
|
||||
|
||||
sub = name_prefix(&name, tctx->origin, &prefix);
|
||||
|
||||
return (dns_name_totext(&prefix, sub, target));
|
||||
opts = name_prefix(&name, tctx->origin, &prefix) ? DNS_NAME_OMITFINALDOT
|
||||
: 0;
|
||||
return (dns_name_totext(&prefix, opts, target));
|
||||
}
|
||||
|
||||
static isc_result_t
|
||||
|
|
@ -91,7 +91,7 @@ towire_md(ARGS_TOWIRE) {
|
|||
dns_rdata_toregion(rdata, ®ion);
|
||||
dns_name_fromregion(&name, ®ion);
|
||||
|
||||
return (dns_name_towire(&name, cctx, target));
|
||||
return (dns_name_towire(&name, cctx, target, NULL));
|
||||
}
|
||||
|
||||
static int
|
||||
|
|
|
|||
|
|
@ -45,7 +45,7 @@ totext_mf(ARGS_TOTEXT) {
|
|||
isc_region_t region;
|
||||
dns_name_t name;
|
||||
dns_name_t prefix;
|
||||
bool sub;
|
||||
unsigned int opts;
|
||||
|
||||
REQUIRE(rdata->type == dns_rdatatype_mf);
|
||||
REQUIRE(rdata->length != 0);
|
||||
|
|
@ -56,9 +56,9 @@ totext_mf(ARGS_TOTEXT) {
|
|||
dns_rdata_toregion(rdata, ®ion);
|
||||
dns_name_fromregion(&name, ®ion);
|
||||
|
||||
sub = name_prefix(&name, tctx->origin, &prefix);
|
||||
|
||||
return (dns_name_totext(&prefix, sub, target));
|
||||
opts = name_prefix(&name, tctx->origin, &prefix) ? DNS_NAME_OMITFINALDOT
|
||||
: 0;
|
||||
return (dns_name_totext(&prefix, opts, target));
|
||||
}
|
||||
|
||||
static isc_result_t
|
||||
|
|
@ -91,7 +91,7 @@ towire_mf(ARGS_TOWIRE) {
|
|||
dns_rdata_toregion(rdata, ®ion);
|
||||
dns_name_fromregion(&name, ®ion);
|
||||
|
||||
return (dns_name_towire(&name, cctx, target));
|
||||
return (dns_name_towire(&name, cctx, target, NULL));
|
||||
}
|
||||
|
||||
static int
|
||||
|
|
|
|||
|
|
@ -45,7 +45,7 @@ totext_mg(ARGS_TOTEXT) {
|
|||
isc_region_t region;
|
||||
dns_name_t name;
|
||||
dns_name_t prefix;
|
||||
bool sub;
|
||||
unsigned int opts;
|
||||
|
||||
REQUIRE(rdata->type == dns_rdatatype_mg);
|
||||
REQUIRE(rdata->length != 0);
|
||||
|
|
@ -56,9 +56,9 @@ totext_mg(ARGS_TOTEXT) {
|
|||
dns_rdata_toregion(rdata, ®ion);
|
||||
dns_name_fromregion(&name, ®ion);
|
||||
|
||||
sub = name_prefix(&name, tctx->origin, &prefix);
|
||||
|
||||
return (dns_name_totext(&prefix, sub, target));
|
||||
opts = name_prefix(&name, tctx->origin, &prefix) ? DNS_NAME_OMITFINALDOT
|
||||
: 0;
|
||||
return (dns_name_totext(&prefix, opts, target));
|
||||
}
|
||||
|
||||
static isc_result_t
|
||||
|
|
@ -91,7 +91,7 @@ towire_mg(ARGS_TOWIRE) {
|
|||
dns_rdata_toregion(rdata, ®ion);
|
||||
dns_name_fromregion(&name, ®ion);
|
||||
|
||||
return (dns_name_towire(&name, cctx, target));
|
||||
return (dns_name_towire(&name, cctx, target, NULL));
|
||||
}
|
||||
|
||||
static int
|
||||
|
|
|
|||
|
|
@ -61,7 +61,7 @@ totext_minfo(ARGS_TOTEXT) {
|
|||
dns_name_t rmail;
|
||||
dns_name_t email;
|
||||
dns_name_t prefix;
|
||||
bool sub;
|
||||
unsigned int opts;
|
||||
|
||||
REQUIRE(rdata->type == dns_rdatatype_minfo);
|
||||
REQUIRE(rdata->length != 0);
|
||||
|
|
@ -78,14 +78,17 @@ totext_minfo(ARGS_TOTEXT) {
|
|||
dns_name_fromregion(&email, ®ion);
|
||||
isc_region_consume(®ion, email.length);
|
||||
|
||||
sub = name_prefix(&rmail, tctx->origin, &prefix);
|
||||
|
||||
RETERR(dns_name_totext(&prefix, sub, target));
|
||||
opts = name_prefix(&rmail, tctx->origin, &prefix)
|
||||
? DNS_NAME_OMITFINALDOT
|
||||
: 0;
|
||||
RETERR(dns_name_totext(&prefix, opts, target));
|
||||
|
||||
RETERR(str_totext(" ", target));
|
||||
|
||||
sub = name_prefix(&email, tctx->origin, &prefix);
|
||||
return (dns_name_totext(&prefix, sub, target));
|
||||
opts = name_prefix(&email, tctx->origin, &prefix)
|
||||
? DNS_NAME_OMITFINALDOT
|
||||
: 0;
|
||||
return (dns_name_totext(&prefix, opts, target));
|
||||
}
|
||||
|
||||
static isc_result_t
|
||||
|
|
@ -128,12 +131,12 @@ towire_minfo(ARGS_TOWIRE) {
|
|||
dns_name_fromregion(&rmail, ®ion);
|
||||
isc_region_consume(®ion, name_length(&rmail));
|
||||
|
||||
RETERR(dns_name_towire(&rmail, cctx, target));
|
||||
RETERR(dns_name_towire(&rmail, cctx, target, NULL));
|
||||
|
||||
dns_name_fromregion(&rmail, ®ion);
|
||||
isc_region_consume(®ion, rmail.length);
|
||||
|
||||
return (dns_name_towire(&rmail, cctx, target));
|
||||
return (dns_name_towire(&rmail, cctx, target, NULL));
|
||||
}
|
||||
|
||||
static int
|
||||
|
|
|
|||
|
|
@ -45,7 +45,7 @@ totext_mr(ARGS_TOTEXT) {
|
|||
isc_region_t region;
|
||||
dns_name_t name;
|
||||
dns_name_t prefix;
|
||||
bool sub;
|
||||
unsigned int opts;
|
||||
|
||||
REQUIRE(rdata->type == dns_rdatatype_mr);
|
||||
REQUIRE(rdata->length != 0);
|
||||
|
|
@ -56,9 +56,9 @@ totext_mr(ARGS_TOTEXT) {
|
|||
dns_rdata_toregion(rdata, ®ion);
|
||||
dns_name_fromregion(&name, ®ion);
|
||||
|
||||
sub = name_prefix(&name, tctx->origin, &prefix);
|
||||
|
||||
return (dns_name_totext(&prefix, sub, target));
|
||||
opts = name_prefix(&name, tctx->origin, &prefix) ? DNS_NAME_OMITFINALDOT
|
||||
: 0;
|
||||
return (dns_name_totext(&prefix, opts, target));
|
||||
}
|
||||
|
||||
static isc_result_t
|
||||
|
|
@ -91,7 +91,7 @@ towire_mr(ARGS_TOWIRE) {
|
|||
dns_rdata_toregion(rdata, ®ion);
|
||||
dns_name_fromregion(&name, ®ion);
|
||||
|
||||
return (dns_name_towire(&name, cctx, target));
|
||||
return (dns_name_towire(&name, cctx, target, NULL));
|
||||
}
|
||||
|
||||
static int
|
||||
|
|
|
|||
|
|
@ -101,7 +101,7 @@ totext_mx(ARGS_TOTEXT) {
|
|||
isc_region_t region;
|
||||
dns_name_t name;
|
||||
dns_name_t prefix;
|
||||
bool sub;
|
||||
unsigned int opts;
|
||||
char buf[sizeof("64000")];
|
||||
unsigned short num;
|
||||
|
||||
|
|
@ -120,8 +120,9 @@ totext_mx(ARGS_TOTEXT) {
|
|||
RETERR(str_totext(" ", target));
|
||||
|
||||
dns_name_fromregion(&name, ®ion);
|
||||
sub = name_prefix(&name, tctx->origin, &prefix);
|
||||
return (dns_name_totext(&prefix, sub, target));
|
||||
opts = name_prefix(&name, tctx->origin, &prefix) ? DNS_NAME_OMITFINALDOT
|
||||
: 0;
|
||||
return (dns_name_totext(&prefix, opts, target));
|
||||
}
|
||||
|
||||
static isc_result_t
|
||||
|
|
@ -165,7 +166,7 @@ towire_mx(ARGS_TOWIRE) {
|
|||
dns_name_init(&name, offsets);
|
||||
dns_name_fromregion(&name, ®ion);
|
||||
|
||||
return (dns_name_towire(&name, cctx, target));
|
||||
return (dns_name_towire(&name, cctx, target, NULL));
|
||||
}
|
||||
|
||||
static int
|
||||
|
|
|
|||
|
|
@ -244,7 +244,7 @@ totext_naptr(ARGS_TOTEXT) {
|
|||
isc_region_t region;
|
||||
dns_name_t name;
|
||||
dns_name_t prefix;
|
||||
bool sub;
|
||||
unsigned int opts;
|
||||
char buf[sizeof("64000")];
|
||||
unsigned short num;
|
||||
|
||||
|
|
@ -296,8 +296,9 @@ totext_naptr(ARGS_TOTEXT) {
|
|||
* Replacement.
|
||||
*/
|
||||
dns_name_fromregion(&name, ®ion);
|
||||
sub = name_prefix(&name, tctx->origin, &prefix);
|
||||
return (dns_name_totext(&prefix, sub, target));
|
||||
opts = name_prefix(&name, tctx->origin, &prefix) ? DNS_NAME_OMITFINALDOT
|
||||
: 0;
|
||||
return (dns_name_totext(&prefix, opts, target));
|
||||
}
|
||||
|
||||
static isc_result_t
|
||||
|
|
@ -388,7 +389,7 @@ towire_naptr(ARGS_TOWIRE) {
|
|||
*/
|
||||
dns_name_init(&name, offsets);
|
||||
dns_name_fromregion(&name, &sr);
|
||||
return (dns_name_towire(&name, cctx, target));
|
||||
return (dns_name_towire(&name, cctx, target, NULL));
|
||||
}
|
||||
|
||||
static int
|
||||
|
|
|
|||
|
|
@ -56,7 +56,7 @@ totext_ns(ARGS_TOTEXT) {
|
|||
isc_region_t region;
|
||||
dns_name_t name;
|
||||
dns_name_t prefix;
|
||||
bool sub;
|
||||
unsigned int opts;
|
||||
|
||||
REQUIRE(rdata->type == dns_rdatatype_ns);
|
||||
REQUIRE(rdata->length != 0);
|
||||
|
|
@ -67,9 +67,9 @@ totext_ns(ARGS_TOTEXT) {
|
|||
dns_rdata_toregion(rdata, ®ion);
|
||||
dns_name_fromregion(&name, ®ion);
|
||||
|
||||
sub = name_prefix(&name, tctx->origin, &prefix);
|
||||
|
||||
return (dns_name_totext(&prefix, sub, target));
|
||||
opts = name_prefix(&name, tctx->origin, &prefix) ? DNS_NAME_OMITFINALDOT
|
||||
: 0;
|
||||
return (dns_name_totext(&prefix, opts, target));
|
||||
}
|
||||
|
||||
static isc_result_t
|
||||
|
|
@ -102,7 +102,7 @@ towire_ns(ARGS_TOWIRE) {
|
|||
dns_rdata_toregion(rdata, ®ion);
|
||||
dns_name_fromregion(&name, ®ion);
|
||||
|
||||
return (dns_name_towire(&name, cctx, target));
|
||||
return (dns_name_towire(&name, cctx, target, NULL));
|
||||
}
|
||||
|
||||
static int
|
||||
|
|
|
|||
|
|
@ -65,7 +65,7 @@ totext_nsec(ARGS_TOTEXT) {
|
|||
dns_rdata_toregion(rdata, &sr);
|
||||
dns_name_fromregion(&name, &sr);
|
||||
isc_region_consume(&sr, name_length(&name));
|
||||
RETERR(dns_name_totext(&name, false, target));
|
||||
RETERR(dns_name_totext(&name, 0, target));
|
||||
/*
|
||||
* Don't leave a trailing space when there's no typemap present.
|
||||
*/
|
||||
|
|
@ -111,7 +111,7 @@ towire_nsec(ARGS_TOWIRE) {
|
|||
dns_rdata_toregion(rdata, &sr);
|
||||
dns_name_fromregion(&name, &sr);
|
||||
isc_region_consume(&sr, name_length(&name));
|
||||
RETERR(dns_name_towire(&name, cctx, target));
|
||||
RETERR(dns_name_towire(&name, cctx, target, NULL));
|
||||
|
||||
return (mem_tobuffer(target, sr.base, sr.length));
|
||||
}
|
||||
|
|
|
|||
|
|
@ -91,10 +91,9 @@ fromtext_nxt(ARGS_FROMTEXT) {
|
|||
static isc_result_t
|
||||
totext_nxt(ARGS_TOTEXT) {
|
||||
isc_region_t sr;
|
||||
unsigned int i, j;
|
||||
unsigned int i, j, opts;
|
||||
dns_name_t name;
|
||||
dns_name_t prefix;
|
||||
bool sub;
|
||||
|
||||
REQUIRE(rdata->type == dns_rdatatype_nxt);
|
||||
REQUIRE(rdata->length != 0);
|
||||
|
|
@ -104,8 +103,9 @@ totext_nxt(ARGS_TOTEXT) {
|
|||
dns_rdata_toregion(rdata, &sr);
|
||||
dns_name_fromregion(&name, &sr);
|
||||
isc_region_consume(&sr, name_length(&name));
|
||||
sub = name_prefix(&name, tctx->origin, &prefix);
|
||||
RETERR(dns_name_totext(&prefix, sub, target));
|
||||
opts = name_prefix(&name, tctx->origin, &prefix) ? DNS_NAME_OMITFINALDOT
|
||||
: 0;
|
||||
RETERR(dns_name_totext(&prefix, opts, target));
|
||||
|
||||
for (i = 0; i < sr.length; i++) {
|
||||
if (sr.base[i] != 0) {
|
||||
|
|
@ -174,7 +174,7 @@ towire_nxt(ARGS_TOWIRE) {
|
|||
dns_rdata_toregion(rdata, &sr);
|
||||
dns_name_fromregion(&name, &sr);
|
||||
isc_region_consume(&sr, name_length(&name));
|
||||
RETERR(dns_name_towire(&name, cctx, target));
|
||||
RETERR(dns_name_towire(&name, cctx, target, NULL));
|
||||
|
||||
return (mem_tobuffer(target, sr.base, sr.length));
|
||||
}
|
||||
|
|
|
|||
|
|
@ -58,7 +58,7 @@ totext_ptr(ARGS_TOTEXT) {
|
|||
isc_region_t region;
|
||||
dns_name_t name;
|
||||
dns_name_t prefix;
|
||||
bool sub;
|
||||
unsigned int opts;
|
||||
|
||||
REQUIRE(rdata->type == dns_rdatatype_ptr);
|
||||
REQUIRE(rdata->length != 0);
|
||||
|
|
@ -69,9 +69,9 @@ totext_ptr(ARGS_TOTEXT) {
|
|||
dns_rdata_toregion(rdata, ®ion);
|
||||
dns_name_fromregion(&name, ®ion);
|
||||
|
||||
sub = name_prefix(&name, tctx->origin, &prefix);
|
||||
|
||||
return (dns_name_totext(&prefix, sub, target));
|
||||
opts = name_prefix(&name, tctx->origin, &prefix) ? DNS_NAME_OMITFINALDOT
|
||||
: 0;
|
||||
return (dns_name_totext(&prefix, opts, target));
|
||||
}
|
||||
|
||||
static isc_result_t
|
||||
|
|
@ -104,7 +104,7 @@ towire_ptr(ARGS_TOWIRE) {
|
|||
dns_rdata_toregion(rdata, ®ion);
|
||||
dns_name_fromregion(&name, ®ion);
|
||||
|
||||
return (dns_name_towire(&name, cctx, target));
|
||||
return (dns_name_towire(&name, cctx, target, NULL));
|
||||
}
|
||||
|
||||
static int
|
||||
|
|
|
|||
|
|
@ -63,7 +63,7 @@ totext_rp(ARGS_TOTEXT) {
|
|||
dns_name_t rmail;
|
||||
dns_name_t email;
|
||||
dns_name_t prefix;
|
||||
bool sub;
|
||||
unsigned int opts;
|
||||
|
||||
REQUIRE(rdata->type == dns_rdatatype_rp);
|
||||
REQUIRE(rdata->length != 0);
|
||||
|
|
@ -80,13 +80,17 @@ totext_rp(ARGS_TOTEXT) {
|
|||
dns_name_fromregion(&email, ®ion);
|
||||
isc_region_consume(®ion, email.length);
|
||||
|
||||
sub = name_prefix(&rmail, tctx->origin, &prefix);
|
||||
RETERR(dns_name_totext(&prefix, sub, target));
|
||||
opts = name_prefix(&rmail, tctx->origin, &prefix)
|
||||
? DNS_NAME_OMITFINALDOT
|
||||
: 0;
|
||||
RETERR(dns_name_totext(&prefix, opts, target));
|
||||
|
||||
RETERR(str_totext(" ", target));
|
||||
|
||||
sub = name_prefix(&email, tctx->origin, &prefix);
|
||||
return (dns_name_totext(&prefix, sub, target));
|
||||
opts = name_prefix(&email, tctx->origin, &prefix)
|
||||
? DNS_NAME_OMITFINALDOT
|
||||
: 0;
|
||||
return (dns_name_totext(&prefix, opts, target));
|
||||
}
|
||||
|
||||
static isc_result_t
|
||||
|
|
@ -128,12 +132,12 @@ towire_rp(ARGS_TOWIRE) {
|
|||
dns_name_fromregion(&rmail, ®ion);
|
||||
isc_region_consume(®ion, rmail.length);
|
||||
|
||||
RETERR(dns_name_towire(&rmail, cctx, target));
|
||||
RETERR(dns_name_towire(&rmail, cctx, target, NULL));
|
||||
|
||||
dns_name_fromregion(&rmail, ®ion);
|
||||
isc_region_consume(®ion, rmail.length);
|
||||
|
||||
return (dns_name_towire(&rmail, cctx, target));
|
||||
return (dns_name_towire(&rmail, cctx, target, NULL));
|
||||
}
|
||||
|
||||
static int
|
||||
|
|
|
|||
|
|
@ -268,7 +268,7 @@ totext_rrsig(ARGS_TOTEXT) {
|
|||
dns_name_init(&name, NULL);
|
||||
dns_name_fromregion(&name, &sr);
|
||||
isc_region_consume(&sr, name_length(&name));
|
||||
RETERR(dns_name_totext(&name, false, target));
|
||||
RETERR(dns_name_totext(&name, 0, target));
|
||||
|
||||
/*
|
||||
* Sig.
|
||||
|
|
@ -378,7 +378,7 @@ towire_rrsig(ARGS_TOWIRE) {
|
|||
dns_name_init(&name, offsets);
|
||||
dns_name_fromregion(&name, &sr);
|
||||
isc_region_consume(&sr, name_length(&name));
|
||||
RETERR(dns_name_towire(&name, cctx, target));
|
||||
RETERR(dns_name_towire(&name, cctx, target, NULL));
|
||||
|
||||
/*
|
||||
* Signature.
|
||||
|
|
|
|||
|
|
@ -65,7 +65,7 @@ totext_rt(ARGS_TOTEXT) {
|
|||
isc_region_t region;
|
||||
dns_name_t name;
|
||||
dns_name_t prefix;
|
||||
bool sub;
|
||||
unsigned int opts;
|
||||
char buf[sizeof("64000")];
|
||||
unsigned short num;
|
||||
|
||||
|
|
@ -82,8 +82,9 @@ totext_rt(ARGS_TOTEXT) {
|
|||
RETERR(str_totext(buf, target));
|
||||
RETERR(str_totext(" ", target));
|
||||
dns_name_fromregion(&name, ®ion);
|
||||
sub = name_prefix(&name, tctx->origin, &prefix);
|
||||
return (dns_name_totext(&prefix, sub, target));
|
||||
opts = name_prefix(&name, tctx->origin, &prefix) ? DNS_NAME_OMITFINALDOT
|
||||
: 0;
|
||||
return (dns_name_totext(&prefix, opts, target));
|
||||
}
|
||||
|
||||
static isc_result_t
|
||||
|
|
@ -138,7 +139,7 @@ towire_rt(ARGS_TOWIRE) {
|
|||
dns_name_init(&name, offsets);
|
||||
dns_name_fromregion(&name, ®ion);
|
||||
|
||||
return (dns_name_towire(&name, cctx, target));
|
||||
return (dns_name_towire(&name, cctx, target, NULL));
|
||||
}
|
||||
|
||||
static int
|
||||
|
|
|
|||
|
|
@ -150,7 +150,7 @@ totext_sig(ARGS_TOTEXT) {
|
|||
unsigned long foot;
|
||||
dns_name_t name;
|
||||
dns_name_t prefix;
|
||||
bool sub;
|
||||
unsigned int opts;
|
||||
|
||||
REQUIRE(rdata->type == dns_rdatatype_sig);
|
||||
REQUIRE(rdata->length != 0);
|
||||
|
|
@ -235,8 +235,9 @@ totext_sig(ARGS_TOTEXT) {
|
|||
dns_name_init(&prefix, NULL);
|
||||
dns_name_fromregion(&name, &sr);
|
||||
isc_region_consume(&sr, name_length(&name));
|
||||
sub = name_prefix(&name, tctx->origin, &prefix);
|
||||
RETERR(dns_name_totext(&prefix, sub, target));
|
||||
opts = name_prefix(&name, tctx->origin, &prefix) ? DNS_NAME_OMITFINALDOT
|
||||
: 0;
|
||||
RETERR(dns_name_totext(&prefix, opts, target));
|
||||
|
||||
/*
|
||||
* Sig.
|
||||
|
|
@ -341,7 +342,7 @@ towire_sig(ARGS_TOWIRE) {
|
|||
dns_name_init(&name, offsets);
|
||||
dns_name_fromregion(&name, &sr);
|
||||
isc_region_consume(&sr, name_length(&name));
|
||||
RETERR(dns_name_towire(&name, cctx, target));
|
||||
RETERR(dns_name_towire(&name, cctx, target, NULL));
|
||||
|
||||
/*
|
||||
* Signature.
|
||||
|
|
|
|||
|
|
@ -85,7 +85,7 @@ totext_soa(ARGS_TOTEXT) {
|
|||
dns_name_t mname;
|
||||
dns_name_t rname;
|
||||
dns_name_t prefix;
|
||||
bool sub;
|
||||
unsigned int opts;
|
||||
int i;
|
||||
bool multiline;
|
||||
bool comm;
|
||||
|
|
@ -112,13 +112,17 @@ totext_soa(ARGS_TOTEXT) {
|
|||
dns_name_fromregion(&rname, &dregion);
|
||||
isc_region_consume(&dregion, name_length(&rname));
|
||||
|
||||
sub = name_prefix(&mname, tctx->origin, &prefix);
|
||||
RETERR(dns_name_totext(&prefix, sub, target));
|
||||
opts = name_prefix(&mname, tctx->origin, &prefix)
|
||||
? DNS_NAME_OMITFINALDOT
|
||||
: 0;
|
||||
RETERR(dns_name_totext(&prefix, opts, target));
|
||||
|
||||
RETERR(str_totext(" ", target));
|
||||
|
||||
sub = name_prefix(&rname, tctx->origin, &prefix);
|
||||
RETERR(dns_name_totext(&prefix, sub, target));
|
||||
opts = name_prefix(&rname, tctx->origin, &prefix)
|
||||
? DNS_NAME_OMITFINALDOT
|
||||
: 0;
|
||||
RETERR(dns_name_totext(&prefix, opts, target));
|
||||
|
||||
if (multiline) {
|
||||
RETERR(str_totext(" (", target));
|
||||
|
|
@ -211,11 +215,11 @@ towire_soa(ARGS_TOWIRE) {
|
|||
|
||||
dns_name_fromregion(&mname, &sregion);
|
||||
isc_region_consume(&sregion, name_length(&mname));
|
||||
RETERR(dns_name_towire(&mname, cctx, target));
|
||||
RETERR(dns_name_towire(&mname, cctx, target, NULL));
|
||||
|
||||
dns_name_fromregion(&rname, &sregion);
|
||||
isc_region_consume(&sregion, name_length(&rname));
|
||||
RETERR(dns_name_towire(&rname, cctx, target));
|
||||
RETERR(dns_name_towire(&rname, cctx, target, NULL));
|
||||
|
||||
isc_buffer_availableregion(target, &tregion);
|
||||
if (tregion.length < 20) {
|
||||
|
|
|
|||
|
|
@ -52,7 +52,7 @@ totext_talink(ARGS_TOTEXT) {
|
|||
dns_name_t prev;
|
||||
dns_name_t next;
|
||||
dns_name_t prefix;
|
||||
bool sub;
|
||||
unsigned int opts;
|
||||
|
||||
REQUIRE(rdata->type == dns_rdatatype_talink);
|
||||
REQUIRE(rdata->length != 0);
|
||||
|
|
@ -69,13 +69,15 @@ totext_talink(ARGS_TOTEXT) {
|
|||
dns_name_fromregion(&next, &dregion);
|
||||
isc_region_consume(&dregion, name_length(&next));
|
||||
|
||||
sub = name_prefix(&prev, tctx->origin, &prefix);
|
||||
RETERR(dns_name_totext(&prefix, sub, target));
|
||||
opts = name_prefix(&prev, tctx->origin, &prefix) ? DNS_NAME_OMITFINALDOT
|
||||
: 0;
|
||||
RETERR(dns_name_totext(&prefix, opts, target));
|
||||
|
||||
RETERR(str_totext(" ", target));
|
||||
|
||||
sub = name_prefix(&next, tctx->origin, &prefix);
|
||||
return (dns_name_totext(&prefix, sub, target));
|
||||
opts = name_prefix(&next, tctx->origin, &prefix) ? DNS_NAME_OMITFINALDOT
|
||||
: 0;
|
||||
return (dns_name_totext(&prefix, opts, target));
|
||||
}
|
||||
|
||||
static isc_result_t
|
||||
|
|
@ -117,11 +119,11 @@ towire_talink(ARGS_TOWIRE) {
|
|||
|
||||
dns_name_fromregion(&prev, &sregion);
|
||||
isc_region_consume(&sregion, name_length(&prev));
|
||||
RETERR(dns_name_towire(&prev, cctx, target));
|
||||
RETERR(dns_name_towire(&prev, cctx, target, NULL));
|
||||
|
||||
dns_name_fromregion(&next, &sregion);
|
||||
isc_region_consume(&sregion, name_length(&next));
|
||||
return (dns_name_towire(&next, cctx, target));
|
||||
return (dns_name_towire(&next, cctx, target, NULL));
|
||||
}
|
||||
|
||||
static int
|
||||
|
|
|
|||
|
|
@ -126,7 +126,7 @@ totext_tkey(ARGS_TOTEXT) {
|
|||
unsigned long n;
|
||||
dns_name_t name;
|
||||
dns_name_t prefix;
|
||||
bool sub;
|
||||
unsigned int opts;
|
||||
|
||||
REQUIRE(rdata->type == dns_rdatatype_tkey);
|
||||
REQUIRE(rdata->length != 0);
|
||||
|
|
@ -139,8 +139,9 @@ totext_tkey(ARGS_TOTEXT) {
|
|||
dns_name_init(&name, NULL);
|
||||
dns_name_init(&prefix, NULL);
|
||||
dns_name_fromregion(&name, &sr);
|
||||
sub = name_prefix(&name, tctx->origin, &prefix);
|
||||
RETERR(dns_name_totext(&prefix, sub, target));
|
||||
opts = name_prefix(&name, tctx->origin, &prefix) ? DNS_NAME_OMITFINALDOT
|
||||
: 0;
|
||||
RETERR(dns_name_totext(&prefix, opts, target));
|
||||
RETERR(str_totext(" ", target));
|
||||
isc_region_consume(&sr, name_length(&name));
|
||||
|
||||
|
|
@ -320,7 +321,7 @@ towire_tkey(ARGS_TOWIRE) {
|
|||
dns_rdata_toregion(rdata, &sr);
|
||||
dns_name_init(&name, offsets);
|
||||
dns_name_fromregion(&name, &sr);
|
||||
RETERR(dns_name_towire(&name, cctx, target));
|
||||
RETERR(dns_name_towire(&name, cctx, target, NULL));
|
||||
isc_region_consume(&sr, name_length(&name));
|
||||
|
||||
return (mem_tobuffer(target, sr.base, sr.length));
|
||||
|
|
|
|||
|
|
@ -106,7 +106,7 @@ totext_in_a6(ARGS_TOTEXT) {
|
|||
char buf[sizeof("128")];
|
||||
dns_name_t name;
|
||||
dns_name_t prefix;
|
||||
bool sub;
|
||||
unsigned int opts;
|
||||
|
||||
REQUIRE(rdata->type == dns_rdatatype_a6);
|
||||
REQUIRE(rdata->rdclass == dns_rdataclass_in);
|
||||
|
|
@ -140,8 +140,9 @@ totext_in_a6(ARGS_TOTEXT) {
|
|||
dns_name_init(&name, NULL);
|
||||
dns_name_init(&prefix, NULL);
|
||||
dns_name_fromregion(&name, &sr);
|
||||
sub = name_prefix(&name, tctx->origin, &prefix);
|
||||
return (dns_name_totext(&prefix, sub, target));
|
||||
opts = name_prefix(&name, tctx->origin, &prefix) ? DNS_NAME_OMITFINALDOT
|
||||
: 0;
|
||||
return (dns_name_totext(&prefix, opts, target));
|
||||
}
|
||||
|
||||
static isc_result_t
|
||||
|
|
@ -226,7 +227,7 @@ towire_in_a6(ARGS_TOWIRE) {
|
|||
|
||||
dns_name_init(&name, offsets);
|
||||
dns_name_fromregion(&name, &sr);
|
||||
return (dns_name_towire(&name, cctx, target));
|
||||
return (dns_name_towire(&name, cctx, target, NULL));
|
||||
}
|
||||
|
||||
static int
|
||||
|
|
|
|||
|
|
@ -54,7 +54,7 @@ totext_in_kx(ARGS_TOTEXT) {
|
|||
isc_region_t region;
|
||||
dns_name_t name;
|
||||
dns_name_t prefix;
|
||||
bool sub;
|
||||
unsigned int opts;
|
||||
char buf[sizeof("64000")];
|
||||
unsigned short num;
|
||||
|
||||
|
|
@ -74,8 +74,9 @@ totext_in_kx(ARGS_TOTEXT) {
|
|||
RETERR(str_totext(" ", target));
|
||||
|
||||
dns_name_fromregion(&name, ®ion);
|
||||
sub = name_prefix(&name, tctx->origin, &prefix);
|
||||
return (dns_name_totext(&prefix, sub, target));
|
||||
opts = name_prefix(&name, tctx->origin, &prefix) ? DNS_NAME_OMITFINALDOT
|
||||
: 0;
|
||||
return (dns_name_totext(&prefix, opts, target));
|
||||
}
|
||||
|
||||
static isc_result_t
|
||||
|
|
@ -120,7 +121,7 @@ towire_in_kx(ARGS_TOWIRE) {
|
|||
dns_name_init(&name, offsets);
|
||||
dns_name_fromregion(&name, ®ion);
|
||||
|
||||
return (dns_name_towire(&name, cctx, target));
|
||||
return (dns_name_towire(&name, cctx, target, NULL));
|
||||
}
|
||||
|
||||
static int
|
||||
|
|
|
|||
|
|
@ -48,7 +48,7 @@ totext_in_nsap_ptr(ARGS_TOTEXT) {
|
|||
isc_region_t region;
|
||||
dns_name_t name;
|
||||
dns_name_t prefix;
|
||||
bool sub;
|
||||
unsigned int opts;
|
||||
|
||||
REQUIRE(rdata->type == dns_rdatatype_nsap_ptr);
|
||||
REQUIRE(rdata->rdclass == dns_rdataclass_in);
|
||||
|
|
@ -60,9 +60,9 @@ totext_in_nsap_ptr(ARGS_TOTEXT) {
|
|||
dns_rdata_toregion(rdata, ®ion);
|
||||
dns_name_fromregion(&name, ®ion);
|
||||
|
||||
sub = name_prefix(&name, tctx->origin, &prefix);
|
||||
|
||||
return (dns_name_totext(&prefix, sub, target));
|
||||
opts = name_prefix(&name, tctx->origin, &prefix) ? DNS_NAME_OMITFINALDOT
|
||||
: 0;
|
||||
return (dns_name_totext(&prefix, opts, target));
|
||||
}
|
||||
|
||||
static isc_result_t
|
||||
|
|
@ -96,7 +96,7 @@ towire_in_nsap_ptr(ARGS_TOWIRE) {
|
|||
dns_rdata_toregion(rdata, ®ion);
|
||||
dns_name_fromregion(&name, ®ion);
|
||||
|
||||
return (dns_name_towire(&name, cctx, target));
|
||||
return (dns_name_towire(&name, cctx, target, NULL));
|
||||
}
|
||||
|
||||
static int
|
||||
|
|
|
|||
|
|
@ -70,7 +70,7 @@ totext_in_px(ARGS_TOTEXT) {
|
|||
isc_region_t region;
|
||||
dns_name_t name;
|
||||
dns_name_t prefix;
|
||||
bool sub;
|
||||
unsigned int opts;
|
||||
char buf[sizeof("64000")];
|
||||
unsigned short num;
|
||||
|
||||
|
|
@ -95,17 +95,19 @@ totext_in_px(ARGS_TOTEXT) {
|
|||
* MAP822.
|
||||
*/
|
||||
dns_name_fromregion(&name, ®ion);
|
||||
sub = name_prefix(&name, tctx->origin, &prefix);
|
||||
opts = name_prefix(&name, tctx->origin, &prefix) ? DNS_NAME_OMITFINALDOT
|
||||
: 0;
|
||||
isc_region_consume(®ion, name_length(&name));
|
||||
RETERR(dns_name_totext(&prefix, sub, target));
|
||||
RETERR(dns_name_totext(&prefix, opts, target));
|
||||
RETERR(str_totext(" ", target));
|
||||
|
||||
/*
|
||||
* MAPX400.
|
||||
*/
|
||||
dns_name_fromregion(&name, ®ion);
|
||||
sub = name_prefix(&name, tctx->origin, &prefix);
|
||||
return (dns_name_totext(&prefix, sub, target));
|
||||
opts = name_prefix(&name, tctx->origin, &prefix) ? DNS_NAME_OMITFINALDOT
|
||||
: 0;
|
||||
return (dns_name_totext(&prefix, opts, target));
|
||||
}
|
||||
|
||||
static isc_result_t
|
||||
|
|
@ -167,7 +169,7 @@ towire_in_px(ARGS_TOWIRE) {
|
|||
*/
|
||||
dns_name_init(&name, offsets);
|
||||
dns_name_fromregion(&name, ®ion);
|
||||
RETERR(dns_name_towire(&name, cctx, target));
|
||||
RETERR(dns_name_towire(&name, cctx, target, NULL));
|
||||
isc_region_consume(®ion, name_length(&name));
|
||||
|
||||
/*
|
||||
|
|
@ -175,7 +177,7 @@ towire_in_px(ARGS_TOWIRE) {
|
|||
*/
|
||||
dns_name_init(&name, offsets);
|
||||
dns_name_fromregion(&name, ®ion);
|
||||
return (dns_name_towire(&name, cctx, target));
|
||||
return (dns_name_towire(&name, cctx, target, NULL));
|
||||
}
|
||||
|
||||
static int
|
||||
|
|
|
|||
|
|
@ -91,7 +91,7 @@ totext_in_srv(ARGS_TOTEXT) {
|
|||
isc_region_t region;
|
||||
dns_name_t name;
|
||||
dns_name_t prefix;
|
||||
bool sub;
|
||||
unsigned int opts;
|
||||
char buf[sizeof("64000")];
|
||||
unsigned short num;
|
||||
|
||||
|
|
@ -134,8 +134,9 @@ totext_in_srv(ARGS_TOTEXT) {
|
|||
* Target.
|
||||
*/
|
||||
dns_name_fromregion(&name, ®ion);
|
||||
sub = name_prefix(&name, tctx->origin, &prefix);
|
||||
return (dns_name_totext(&prefix, sub, target));
|
||||
opts = name_prefix(&name, tctx->origin, &prefix) ? DNS_NAME_OMITFINALDOT
|
||||
: 0;
|
||||
return (dns_name_totext(&prefix, opts, target));
|
||||
}
|
||||
|
||||
static isc_result_t
|
||||
|
|
@ -191,7 +192,7 @@ towire_in_srv(ARGS_TOWIRE) {
|
|||
*/
|
||||
dns_name_init(&name, offsets);
|
||||
dns_name_fromregion(&name, &sr);
|
||||
return (dns_name_towire(&name, cctx, target));
|
||||
return (dns_name_towire(&name, cctx, target, NULL));
|
||||
}
|
||||
|
||||
static int
|
||||
|
|
@ -335,8 +336,8 @@ additionaldata_in_srv(ARGS_ADDLDATA) {
|
|||
|
||||
dns_fixedname_init(&fixed);
|
||||
snprintf(buf, sizeof(buf), "_%u._tcp", port);
|
||||
result = dns_name_fromstring2(dns_fixedname_name(&fixed), buf, NULL, 0,
|
||||
NULL);
|
||||
result = dns_name_fromstring(dns_fixedname_name(&fixed), buf, NULL, 0,
|
||||
NULL);
|
||||
if (result != ISC_R_SUCCESS) {
|
||||
return (ISC_R_SUCCESS);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -660,7 +660,7 @@ generic_totext_in_svcb(ARGS_TOTEXT) {
|
|||
isc_region_t region;
|
||||
dns_name_t name;
|
||||
dns_name_t prefix;
|
||||
bool sub;
|
||||
unsigned int opts;
|
||||
char buf[sizeof("xxxx:xxxx:xxxx:xxxx:xxxx:xxxx:255.255.255.255")];
|
||||
unsigned short num;
|
||||
int n;
|
||||
|
|
@ -686,8 +686,9 @@ generic_totext_in_svcb(ARGS_TOTEXT) {
|
|||
*/
|
||||
dns_name_fromregion(&name, ®ion);
|
||||
isc_region_consume(®ion, name_length(&name));
|
||||
sub = name_prefix(&name, tctx->origin, &prefix);
|
||||
RETERR(dns_name_totext(&prefix, sub, target));
|
||||
opts = name_prefix(&name, tctx->origin, &prefix) ? DNS_NAME_OMITFINALDOT
|
||||
: 0;
|
||||
RETERR(dns_name_totext(&prefix, opts, target));
|
||||
|
||||
while (region.length > 0) {
|
||||
isc_region_t r;
|
||||
|
|
@ -966,7 +967,7 @@ generic_towire_in_svcb(ARGS_TOWIRE) {
|
|||
*/
|
||||
dns_name_init(&name, offsets);
|
||||
dns_name_fromregion(&name, ®ion);
|
||||
RETERR(dns_name_towire(&name, cctx, target));
|
||||
RETERR(dns_name_towire(&name, cctx, target, NULL));
|
||||
isc_region_consume(®ion, name_length(&name));
|
||||
|
||||
/*
|
||||
|
|
|
|||
|
|
@ -385,7 +385,7 @@ towiresorted(dns_rdataset_t *rdataset, const dns_name_t *owner_name,
|
|||
|
||||
rrbuffer = *target;
|
||||
dns_compress_setpermitted(cctx, true);
|
||||
result = dns_name_towire2(name, cctx, target, &offset);
|
||||
result = dns_name_towire(name, cctx, target, &offset);
|
||||
if (result != ISC_R_SUCCESS) {
|
||||
goto rollback;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -2676,7 +2676,7 @@ resquery_send(resquery_t *query) {
|
|||
memset(&zr, 0, sizeof(zr));
|
||||
isc_buffer_init(&zb, zone, sizeof(zone));
|
||||
dns_compress_setpermitted(&cctx, false);
|
||||
result = dns_name_towire(fctx->domain, &cctx, &zb);
|
||||
result = dns_name_towire(fctx->domain, &cctx, &zb, NULL);
|
||||
if (result == ISC_R_SUCCESS) {
|
||||
isc_buffer_usedregion(&zb, &zr);
|
||||
}
|
||||
|
|
@ -9627,7 +9627,7 @@ rctx_logpacket(respctx_t *rctx) {
|
|||
dns_compress_init(&cctx, fctx->mctx, 0);
|
||||
dns_compress_setpermitted(&cctx, false);
|
||||
isc_buffer_init(&zb, zone, sizeof(zone));
|
||||
result = dns_name_towire(fctx->domain, &cctx, &zb);
|
||||
result = dns_name_towire(fctx->domain, &cctx, &zb, NULL);
|
||||
if (result == ISC_R_SUCCESS) {
|
||||
isc_buffer_usedregion(&zb, &zr);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -956,7 +956,8 @@ make_log_buf(dns_rrl_t *rrl, dns_rrl_entry_t *e, const char *str1,
|
|||
}
|
||||
if (qname != NULL) {
|
||||
ADD_LOG_CSTR(&lb, " for ");
|
||||
(void)dns_name_totext(qname, true, &lb);
|
||||
(void)dns_name_totext(qname, DNS_NAME_OMITFINALDOT,
|
||||
&lb);
|
||||
} else {
|
||||
ADD_LOG_CSTR(&lb, " for (?)");
|
||||
}
|
||||
|
|
|
|||
|
|
@ -483,12 +483,12 @@ getnodedata(dns_db_t *db, const dns_name_t *name, bool create,
|
|||
dns_name_countlabels(&sdlz->common.origin);
|
||||
dns_name_init(&relname, NULL);
|
||||
dns_name_getlabelsequence(name, 0, labels, &relname);
|
||||
result = dns_name_totext(&relname, true, &b);
|
||||
result = dns_name_totext(&relname, DNS_NAME_OMITFINALDOT, &b);
|
||||
if (result != ISC_R_SUCCESS) {
|
||||
return (result);
|
||||
}
|
||||
} else {
|
||||
result = dns_name_totext(name, true, &b);
|
||||
result = dns_name_totext(name, DNS_NAME_OMITFINALDOT, &b);
|
||||
if (result != ISC_R_SUCCESS) {
|
||||
return (result);
|
||||
}
|
||||
|
|
@ -496,7 +496,8 @@ getnodedata(dns_db_t *db, const dns_name_t *name, bool create,
|
|||
isc_buffer_putuint8(&b, 0);
|
||||
|
||||
isc_buffer_init(&b2, zonestr, sizeof(zonestr));
|
||||
result = dns_name_totext(&sdlz->common.origin, true, &b2);
|
||||
result = dns_name_totext(&sdlz->common.origin, DNS_NAME_OMITFINALDOT,
|
||||
&b2);
|
||||
if (result != ISC_R_SUCCESS) {
|
||||
return (result);
|
||||
}
|
||||
|
|
@ -558,7 +559,8 @@ getnodedata(dns_db_t *db, const dns_name_t *name, bool create,
|
|||
}
|
||||
|
||||
isc_buffer_init(&b, wildstr, sizeof(wildstr));
|
||||
result = dns_name_totext(wild, true, &b);
|
||||
result = dns_name_totext(wild, DNS_NAME_OMITFINALDOT,
|
||||
&b);
|
||||
if (result != ISC_R_SUCCESS) {
|
||||
MAYBE_UNLOCK(sdlz->dlzimp);
|
||||
return (result);
|
||||
|
|
@ -693,7 +695,8 @@ createiterator(dns_db_t *db, unsigned int options,
|
|||
}
|
||||
|
||||
isc_buffer_init(&b, zonestr, sizeof(zonestr));
|
||||
result = dns_name_totext(&sdlz->common.origin, true, &b);
|
||||
result = dns_name_totext(&sdlz->common.origin, DNS_NAME_OMITFINALDOT,
|
||||
&b);
|
||||
if (result != ISC_R_SUCCESS) {
|
||||
return (result);
|
||||
}
|
||||
|
|
@ -1423,7 +1426,7 @@ dns_sdlzallowzonexfr(void *driverarg, void *dbdata, isc_mem_t *mctx,
|
|||
|
||||
/* Convert DNS name to ascii text */
|
||||
isc_buffer_init(&b, namestr, sizeof(namestr));
|
||||
result = dns_name_totext(name, true, &b);
|
||||
result = dns_name_totext(name, DNS_NAME_OMITFINALDOT, &b);
|
||||
if (result != ISC_R_SUCCESS) {
|
||||
return (result);
|
||||
}
|
||||
|
|
@ -1542,7 +1545,7 @@ dns_sdlzfindzone(void *driverarg, void *dbdata, isc_mem_t *mctx,
|
|||
|
||||
/* Convert DNS name to ascii text */
|
||||
isc_buffer_init(&b, namestr, sizeof(namestr));
|
||||
result = dns_name_totext(name, true, &b);
|
||||
result = dns_name_totext(name, DNS_NAME_OMITFINALDOT, &b);
|
||||
if (result != ISC_R_SUCCESS) {
|
||||
return (result);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -15347,7 +15347,8 @@ zone_namerd_tostr(dns_zone_t *zone, char *buf, size_t length) {
|
|||
isc_buffer_init(&buffer, buf, (unsigned int)length - 1);
|
||||
if (zone->type != dns_zone_redirect && zone->type != dns_zone_key) {
|
||||
if (dns_name_dynamic(&zone->origin)) {
|
||||
result = dns_name_totext(&zone->origin, true, &buffer);
|
||||
result = dns_name_totext(
|
||||
&zone->origin, DNS_NAME_OMITFINALDOT, &buffer);
|
||||
}
|
||||
if (result != ISC_R_SUCCESS &&
|
||||
isc_buffer_availablelength(&buffer) >=
|
||||
|
|
@ -15392,7 +15393,8 @@ zone_name_tostr(dns_zone_t *zone, char *buf, size_t length) {
|
|||
*/
|
||||
isc_buffer_init(&buffer, buf, (unsigned int)length - 1);
|
||||
if (dns_name_dynamic(&zone->origin)) {
|
||||
result = dns_name_totext(&zone->origin, true, &buffer);
|
||||
result = dns_name_totext(&zone->origin, DNS_NAME_OMITFINALDOT,
|
||||
&buffer);
|
||||
}
|
||||
if (result != ISC_R_SUCCESS &&
|
||||
isc_buffer_availablelength(&buffer) >= (sizeof("<UNKNOWN>") - 1))
|
||||
|
|
|
|||
|
|
@ -620,18 +620,9 @@ parse_geoip_element(const cfg_obj_t *obj, isc_log_t *lctx,
|
|||
#endif /* HAVE_GEOIP2 */
|
||||
|
||||
isc_result_t
|
||||
cfg_acl_fromconfig(const cfg_obj_t *caml, const cfg_obj_t *cctx,
|
||||
cfg_acl_fromconfig(const cfg_obj_t *acl_data, const cfg_obj_t *cctx,
|
||||
isc_log_t *lctx, cfg_aclconfctx_t *ctx, isc_mem_t *mctx,
|
||||
unsigned int nest_level, dns_acl_t **target) {
|
||||
return (cfg_acl_fromconfig2(caml, cctx, lctx, ctx, mctx, nest_level, 0,
|
||||
target));
|
||||
}
|
||||
|
||||
isc_result_t
|
||||
cfg_acl_fromconfig2(const cfg_obj_t *acl_data, const cfg_obj_t *cctx,
|
||||
isc_log_t *lctx, cfg_aclconfctx_t *ctx, isc_mem_t *mctx,
|
||||
unsigned int nest_level, uint16_t family,
|
||||
dns_acl_t **target) {
|
||||
isc_result_t result;
|
||||
dns_acl_t *dacl = NULL, *inneracl = NULL;
|
||||
dns_aclelement_t *de;
|
||||
|
|
@ -795,18 +786,6 @@ cfg_acl_fromconfig2(const cfg_obj_t *acl_data, const cfg_obj_t *cctx,
|
|||
unsigned int bitlen;
|
||||
|
||||
cfg_obj_asnetprefix(ce, &addr, &bitlen);
|
||||
if (family != 0 && family != addr.family) {
|
||||
char buf[ISC_NETADDR_FORMATSIZE + 1];
|
||||
isc_netaddr_format(&addr, buf, sizeof(buf));
|
||||
cfg_obj_log(ce, lctx, ISC_LOG_WARNING,
|
||||
"'%s': incorrect address family; "
|
||||
"ignoring",
|
||||
buf);
|
||||
if (nest_level != 0) {
|
||||
dns_acl_detach(&de->nestedacl);
|
||||
}
|
||||
continue;
|
||||
}
|
||||
result = isc_netaddr_prefixok(&addr, bitlen);
|
||||
if (result != ISC_R_SUCCESS) {
|
||||
char buf[ISC_NETADDR_FORMATSIZE + 1];
|
||||
|
|
|
|||
|
|
@ -278,7 +278,8 @@ validate_tls(const cfg_obj_t *config, const cfg_obj_t *obj, isc_log_t *logctx,
|
|||
const char *str) {
|
||||
dns_fixedname_t fname;
|
||||
dns_name_t *nm = dns_fixedname_initname(&fname);
|
||||
isc_result_t result = dns_name_fromstring(nm, str, 0, NULL);
|
||||
isc_result_t result = dns_name_fromstring(nm, str, dns_rootname, 0,
|
||||
NULL);
|
||||
|
||||
if (result != ISC_R_SUCCESS) {
|
||||
cfg_obj_log(obj, logctx, ISC_LOG_ERROR,
|
||||
|
|
@ -975,7 +976,8 @@ check_name(const char *str) {
|
|||
dns_fixedname_t fixed;
|
||||
|
||||
dns_fixedname_init(&fixed);
|
||||
return (dns_name_fromstring(dns_fixedname_name(&fixed), str, 0, NULL));
|
||||
return (dns_name_fromstring(dns_fixedname_name(&fixed), str,
|
||||
dns_rootname, 0, NULL));
|
||||
}
|
||||
|
||||
static bool
|
||||
|
|
@ -2344,7 +2346,8 @@ resume:
|
|||
const char *str = cfg_obj_asstring(key);
|
||||
dns_fixedname_t fname;
|
||||
dns_name_t *nm = dns_fixedname_initname(&fname);
|
||||
tresult = dns_name_fromstring(nm, str, 0, NULL);
|
||||
tresult = dns_name_fromstring(
|
||||
nm, str, dns_rootname, 0, NULL);
|
||||
if (tresult != ISC_R_SUCCESS) {
|
||||
cfg_obj_log(key, logctx, ISC_LOG_ERROR,
|
||||
"'%s' is not a valid name",
|
||||
|
|
@ -2358,7 +2361,8 @@ resume:
|
|||
const char *str = cfg_obj_asstring(tls);
|
||||
dns_fixedname_t fname;
|
||||
dns_name_t *nm = dns_fixedname_initname(&fname);
|
||||
tresult = dns_name_fromstring(nm, str, 0, NULL);
|
||||
tresult = dns_name_fromstring(
|
||||
nm, str, dns_rootname, 0, NULL);
|
||||
if (tresult != ISC_R_SUCCESS) {
|
||||
cfg_obj_log(tls, logctx, ISC_LOG_ERROR,
|
||||
"'%s' is not a valid name",
|
||||
|
|
@ -2491,7 +2495,7 @@ check_update_policy(const cfg_obj_t *policy, isc_log_t *logctx) {
|
|||
}
|
||||
|
||||
str = cfg_obj_asstring(identity);
|
||||
tresult = dns_name_fromstring(id, str, 1, NULL);
|
||||
tresult = dns_name_fromstring(id, str, dns_rootname, 1, NULL);
|
||||
if (tresult != ISC_R_SUCCESS) {
|
||||
cfg_obj_log(identity, logctx, ISC_LOG_ERROR,
|
||||
"'%s' is not a valid name", str);
|
||||
|
|
@ -2509,7 +2513,8 @@ check_update_policy(const cfg_obj_t *policy, isc_log_t *logctx) {
|
|||
str = cfg_obj_asstring(dname);
|
||||
}
|
||||
if (tresult == ISC_R_SUCCESS) {
|
||||
tresult = dns_name_fromstring(name, str, 0, NULL);
|
||||
tresult = dns_name_fromstring(name, str, dns_rootname,
|
||||
0, NULL);
|
||||
if (tresult != ISC_R_SUCCESS) {
|
||||
cfg_obj_log(dname, logctx, ISC_LOG_ERROR,
|
||||
"'%s' is not a valid name", str);
|
||||
|
|
@ -4492,7 +4497,7 @@ record_static_keys(isc_symtab_t *symtab, isc_mem_t *mctx,
|
|||
const char *str = cfg_obj_asstring(cfg_tuple_get(obj, "name"));
|
||||
isc_symvalue_t symvalue;
|
||||
|
||||
result = dns_name_fromstring(name, str, 0, NULL);
|
||||
result = dns_name_fromstring(name, str, dns_rootname, 0, NULL);
|
||||
if (result != ISC_R_SUCCESS) {
|
||||
continue;
|
||||
}
|
||||
|
|
@ -4565,7 +4570,7 @@ check_initializing_keys(isc_symtab_t *symtab, const cfg_obj_t *keylist,
|
|||
}
|
||||
|
||||
str = cfg_obj_asstring(cfg_tuple_get(obj, "name"));
|
||||
result = dns_name_fromstring(name, str, 0, NULL);
|
||||
result = dns_name_fromstring(name, str, dns_rootname, 0, NULL);
|
||||
if (result != ISC_R_SUCCESS) {
|
||||
continue;
|
||||
}
|
||||
|
|
@ -4613,7 +4618,7 @@ record_ds_keys(isc_symtab_t *symtab, isc_mem_t *mctx,
|
|||
const char *str = cfg_obj_asstring(cfg_tuple_get(obj, "name"));
|
||||
isc_symvalue_t symvalue;
|
||||
|
||||
result = dns_name_fromstring(name, str, 0, NULL);
|
||||
result = dns_name_fromstring(name, str, dns_rootname, 0, NULL);
|
||||
if (result != ISC_R_SUCCESS) {
|
||||
continue;
|
||||
}
|
||||
|
|
@ -4805,7 +4810,8 @@ check_rpz_catz(const char *rpz_catz, const cfg_obj_t *rpz_obj,
|
|||
}
|
||||
}
|
||||
|
||||
tresult = dns_name_fromstring(name, zonename, 0, NULL);
|
||||
tresult = dns_name_fromstring(name, zonename, dns_rootname, 0,
|
||||
NULL);
|
||||
if (tresult != ISC_R_SUCCESS) {
|
||||
cfg_obj_log(nameobj, logctx, ISC_LOG_ERROR,
|
||||
"bad domain name '%s'", zonename);
|
||||
|
|
@ -4864,7 +4870,8 @@ check_rpz(const cfg_obj_t *rpz_obj, isc_log_t *logctx) {
|
|||
nameobj = cfg_tuple_get(obj, "zone name");
|
||||
zonename = cfg_obj_asstring(nameobj);
|
||||
|
||||
tresult = dns_name_fromstring(name, zonename, 0, NULL);
|
||||
tresult = dns_name_fromstring(name, zonename, dns_rootname, 0,
|
||||
NULL);
|
||||
if (tresult != ISC_R_SUCCESS) {
|
||||
cfg_obj_log(obj, logctx, ISC_LOG_ERROR,
|
||||
"bad domain name '%s'", zonename);
|
||||
|
|
@ -4922,7 +4929,8 @@ check_catz(const cfg_obj_t *catz_obj, const char *viewname, isc_mem_t *mctx,
|
|||
nameobj = cfg_tuple_get(obj, "zone name");
|
||||
zonename = cfg_obj_asstring(nameobj);
|
||||
|
||||
tresult = dns_name_fromstring(name, zonename, 0, NULL);
|
||||
tresult = dns_name_fromstring(name, zonename, dns_rootname, 0,
|
||||
NULL);
|
||||
if (tresult != ISC_R_SUCCESS) {
|
||||
cfg_obj_log(obj, logctx, ISC_LOG_ERROR,
|
||||
"bad domain name '%s'", zonename);
|
||||
|
|
|
|||
|
|
@ -60,12 +60,6 @@ isc_result_t
|
|||
cfg_acl_fromconfig(const cfg_obj_t *caml, const cfg_obj_t *cctx,
|
||||
isc_log_t *lctx, cfg_aclconfctx_t *ctx, isc_mem_t *mctx,
|
||||
unsigned int nest_level, dns_acl_t **target);
|
||||
|
||||
isc_result_t
|
||||
cfg_acl_fromconfig2(const cfg_obj_t *caml, const cfg_obj_t *cctx,
|
||||
isc_log_t *lctx, cfg_aclconfctx_t *ctx, isc_mem_t *mctx,
|
||||
unsigned int nest_level, uint16_t family,
|
||||
dns_acl_t **target);
|
||||
/*
|
||||
* Construct a new dns_acl_t from configuration data in 'caml' and
|
||||
* 'cctx'. Memory is allocated through 'mctx'.
|
||||
|
|
@ -76,11 +70,6 @@ cfg_acl_fromconfig2(const cfg_obj_t *caml, const cfg_obj_t *cctx,
|
|||
* nested dns_acl_t object when the referring objects were created
|
||||
* passing the same ACL configuration context 'ctx'.
|
||||
*
|
||||
* cfg_acl_fromconfig() is a backward-compatible version of
|
||||
* cfg_acl_fromconfig2(), which allows an address family to be
|
||||
* specified. If 'family' is not zero, then only addresses/prefixes
|
||||
* of a matching family (AF_INET or AF_INET6) may be configured.
|
||||
*
|
||||
* On success, attach '*target' to the new dns_acl_t object.
|
||||
*
|
||||
* Require:
|
||||
|
|
|
|||
|
|
@ -626,7 +626,7 @@ renderend:
|
|||
|
||||
isc_buffer_init(&b, zone, sizeof(zone));
|
||||
dns_compress_setpermitted(&cctx, false);
|
||||
eresult = dns_name_towire(zo, &cctx, &b);
|
||||
eresult = dns_name_towire(zo, &cctx, &b, NULL);
|
||||
if (eresult == ISC_R_SUCCESS) {
|
||||
isc_buffer_usedregion(&b, &zr);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -78,7 +78,7 @@ main(void) {
|
|||
|
||||
for (unsigned int i = 0; i < count; i++) {
|
||||
dns_name_t *name = dns_fixedname_name(&fixedname[i]);
|
||||
result = dns_name_towire(name, &cctx, &buf);
|
||||
result = dns_name_towire(name, &cctx, &buf, NULL);
|
||||
if (result == ISC_R_NOSPACE) {
|
||||
dns_compress_invalidate(&cctx);
|
||||
dns_compress_init(&cctx, mctx, 0);
|
||||
|
|
|
|||
|
|
@ -67,7 +67,7 @@ ISC_LOOP_TEST_IMPL(basic) {
|
|||
isc_result_t result;
|
||||
uint32_t flags = BADCACHE_TEST_FLAG;
|
||||
|
||||
dns_name_fromstring2(name, "example.com.", NULL, 0, NULL);
|
||||
dns_name_fromstring(name, "example.com.", NULL, 0, NULL);
|
||||
|
||||
bc = dns_badcache_new(mctx);
|
||||
dns_badcache_add(bc, name, dns_rdatatype_aaaa, false, flags, now + 60);
|
||||
|
|
@ -95,7 +95,7 @@ ISC_LOOP_TEST_IMPL(expire) {
|
|||
isc_result_t result;
|
||||
uint32_t flags = BADCACHE_TEST_FLAG;
|
||||
|
||||
dns_name_fromstring2(name, "example.com.", NULL, 0, NULL);
|
||||
dns_name_fromstring(name, "example.com.", NULL, 0, NULL);
|
||||
|
||||
bc = dns_badcache_new(mctx);
|
||||
dns_badcache_add(bc, name, dns_rdatatype_aaaa, false, flags, now + 60);
|
||||
|
|
@ -138,7 +138,7 @@ ISC_LOOP_TEST_IMPL(print) {
|
|||
uint8_t buf[4096];
|
||||
size_t len;
|
||||
|
||||
dns_name_fromstring2(name, "example.com.", NULL, 0, NULL);
|
||||
dns_name_fromstring(name, "example.com.", NULL, 0, NULL);
|
||||
|
||||
bc = dns_badcache_new(mctx);
|
||||
dns_badcache_add(bc, name, dns_rdatatype_a, false, flags, expire);
|
||||
|
|
@ -169,7 +169,7 @@ ISC_LOOP_TEST_IMPL(flush) {
|
|||
isc_result_t result;
|
||||
uint32_t flags = BADCACHE_TEST_FLAG;
|
||||
|
||||
dns_name_fromstring2(name, "example.com.", NULL, 0, NULL);
|
||||
dns_name_fromstring(name, "example.com.", NULL, 0, NULL);
|
||||
|
||||
bc = dns_badcache_new(mctx);
|
||||
dns_badcache_add(bc, name, dns_rdatatype_aaaa, false, flags, now + 60);
|
||||
|
|
@ -197,22 +197,22 @@ ISC_LOOP_TEST_IMPL(flushname) {
|
|||
|
||||
bc = dns_badcache_new(mctx);
|
||||
|
||||
dns_name_fromstring2(name, "example.com.", NULL, 0, NULL);
|
||||
dns_name_fromstring(name, "example.com.", NULL, 0, NULL);
|
||||
dns_badcache_add(bc, name, dns_rdatatype_aaaa, false, flags, now + 60);
|
||||
result = dns_badcache_find(bc, name, dns_rdatatype_aaaa, &flags, now);
|
||||
assert_int_equal(result, ISC_R_SUCCESS);
|
||||
|
||||
dns_name_fromstring2(name, "sub.example.com.", NULL, 0, NULL);
|
||||
dns_name_fromstring(name, "sub.example.com.", NULL, 0, NULL);
|
||||
dns_badcache_add(bc, name, dns_rdatatype_aaaa, false, flags, now + 60);
|
||||
result = dns_badcache_find(bc, name, dns_rdatatype_aaaa, &flags, now);
|
||||
assert_int_equal(result, ISC_R_SUCCESS);
|
||||
|
||||
dns_name_fromstring2(name, "sub.sub.example.com.", NULL, 0, NULL);
|
||||
dns_name_fromstring(name, "sub.sub.example.com.", NULL, 0, NULL);
|
||||
dns_badcache_add(bc, name, dns_rdatatype_aaaa, false, flags, now + 60);
|
||||
result = dns_badcache_find(bc, name, dns_rdatatype_aaaa, &flags, now);
|
||||
assert_int_equal(result, ISC_R_SUCCESS);
|
||||
|
||||
dns_name_fromstring2(name, "sub.example.com.", NULL, 0, NULL);
|
||||
dns_name_fromstring(name, "sub.example.com.", NULL, 0, NULL);
|
||||
dns_badcache_flushname(bc, name);
|
||||
|
||||
result = dns_badcache_find(bc, name, dns_rdatatype_aaaa, &flags, now);
|
||||
|
|
@ -220,11 +220,11 @@ ISC_LOOP_TEST_IMPL(flushname) {
|
|||
result = dns_badcache_find(bc, name, dns_rdatatype_a, &flags, now);
|
||||
assert_int_equal(result, ISC_R_NOTFOUND);
|
||||
|
||||
dns_name_fromstring2(name, "sub.sub.example.com.", NULL, 0, NULL);
|
||||
dns_name_fromstring(name, "sub.sub.example.com.", NULL, 0, NULL);
|
||||
result = dns_badcache_find(bc, name, dns_rdatatype_aaaa, &flags, now);
|
||||
assert_int_equal(result, ISC_R_SUCCESS);
|
||||
|
||||
dns_name_fromstring2(name, "example.com.", NULL, 0, NULL);
|
||||
dns_name_fromstring(name, "example.com.", NULL, 0, NULL);
|
||||
result = dns_badcache_find(bc, name, dns_rdatatype_aaaa, &flags, now);
|
||||
assert_int_equal(result, ISC_R_SUCCESS);
|
||||
|
||||
|
|
@ -243,36 +243,36 @@ ISC_LOOP_TEST_IMPL(flushtree) {
|
|||
|
||||
bc = dns_badcache_new(mctx);
|
||||
|
||||
dns_name_fromstring2(name, "example.com.", NULL, 0, NULL);
|
||||
dns_name_fromstring(name, "example.com.", NULL, 0, NULL);
|
||||
dns_badcache_add(bc, name, dns_rdatatype_aaaa, false, flags, now + 60);
|
||||
result = dns_badcache_find(bc, name, dns_rdatatype_aaaa, &flags, now);
|
||||
assert_int_equal(result, ISC_R_SUCCESS);
|
||||
assert_int_equal(flags, BADCACHE_TEST_FLAG);
|
||||
|
||||
dns_name_fromstring2(name, "sub.example.com.", NULL, 0, NULL);
|
||||
dns_name_fromstring(name, "sub.example.com.", NULL, 0, NULL);
|
||||
dns_badcache_add(bc, name, dns_rdatatype_aaaa, false, flags, now + 60);
|
||||
result = dns_badcache_find(bc, name, dns_rdatatype_aaaa, &flags, now);
|
||||
assert_int_equal(result, ISC_R_SUCCESS);
|
||||
assert_int_equal(flags, BADCACHE_TEST_FLAG);
|
||||
|
||||
dns_name_fromstring2(name, "sub.sub.example.com.", NULL, 0, NULL);
|
||||
dns_name_fromstring(name, "sub.sub.example.com.", NULL, 0, NULL);
|
||||
dns_badcache_add(bc, name, dns_rdatatype_aaaa, false, flags, now + 60);
|
||||
result = dns_badcache_find(bc, name, dns_rdatatype_aaaa, &flags, now);
|
||||
assert_int_equal(result, ISC_R_SUCCESS);
|
||||
assert_int_equal(flags, BADCACHE_TEST_FLAG);
|
||||
|
||||
dns_name_fromstring2(name, "sub.example.com.", NULL, 0, NULL);
|
||||
dns_name_fromstring(name, "sub.example.com.", NULL, 0, NULL);
|
||||
dns_badcache_flushtree(bc, name);
|
||||
|
||||
dns_name_fromstring2(name, "sub.sub.example.com.", NULL, 0, NULL);
|
||||
dns_name_fromstring(name, "sub.sub.example.com.", NULL, 0, NULL);
|
||||
result = dns_badcache_find(bc, name, dns_rdatatype_aaaa, &flags, now);
|
||||
assert_int_equal(result, ISC_R_NOTFOUND);
|
||||
|
||||
dns_name_fromstring2(name, "sub.example.com.", NULL, 0, NULL);
|
||||
dns_name_fromstring(name, "sub.example.com.", NULL, 0, NULL);
|
||||
result = dns_badcache_find(bc, name, dns_rdatatype_aaaa, &flags, now);
|
||||
assert_int_equal(result, ISC_R_NOTFOUND);
|
||||
|
||||
dns_name_fromstring2(name, "example.com.", NULL, 0, NULL);
|
||||
dns_name_fromstring(name, "example.com.", NULL, 0, NULL);
|
||||
result = dns_badcache_find(bc, name, dns_rdatatype_aaaa, &flags, now);
|
||||
assert_int_equal(result, ISC_R_SUCCESS);
|
||||
assert_int_equal(flags, BADCACHE_TEST_FLAG);
|
||||
|
|
@ -292,19 +292,19 @@ ISC_LOOP_TEST_IMPL(purge) {
|
|||
|
||||
bc = dns_badcache_new(mctx);
|
||||
|
||||
dns_name_fromstring2(name, "example.com.", NULL, 0, NULL);
|
||||
dns_name_fromstring(name, "example.com.", NULL, 0, NULL);
|
||||
dns_badcache_add(bc, name, dns_rdatatype_aaaa, false, flags, now);
|
||||
result = dns_badcache_find(bc, name, dns_rdatatype_aaaa, &flags,
|
||||
now - 60);
|
||||
assert_int_equal(result, ISC_R_SUCCESS);
|
||||
|
||||
dns_name_fromstring2(name, "sub.example.com.", NULL, 0, NULL);
|
||||
dns_name_fromstring(name, "sub.example.com.", NULL, 0, NULL);
|
||||
dns_badcache_add(bc, name, dns_rdatatype_aaaa, false, flags, now);
|
||||
result = dns_badcache_find(bc, name, dns_rdatatype_aaaa, &flags,
|
||||
now - 60);
|
||||
assert_int_equal(result, ISC_R_SUCCESS);
|
||||
|
||||
dns_name_fromstring2(name, "sub.sub.example.com.", NULL, 0, NULL);
|
||||
dns_name_fromstring(name, "sub.sub.example.com.", NULL, 0, NULL);
|
||||
dns_badcache_add(bc, name, dns_rdatatype_aaaa, false, flags, now);
|
||||
result = dns_badcache_find(bc, name, dns_rdatatype_aaaa, &flags,
|
||||
now - 60);
|
||||
|
|
@ -314,17 +314,17 @@ ISC_LOOP_TEST_IMPL(purge) {
|
|||
now + 30);
|
||||
assert_int_equal(result, ISC_R_NOTFOUND);
|
||||
|
||||
dns_name_fromstring2(name, "sub.sub.example.com.", NULL, 0, NULL);
|
||||
dns_name_fromstring(name, "sub.sub.example.com.", NULL, 0, NULL);
|
||||
result = dns_badcache_find(bc, name, dns_rdatatype_aaaa, &flags,
|
||||
now + 30);
|
||||
assert_int_equal(result, ISC_R_NOTFOUND);
|
||||
|
||||
dns_name_fromstring2(name, "sub.example.com.", NULL, 0, NULL);
|
||||
dns_name_fromstring(name, "sub.example.com.", NULL, 0, NULL);
|
||||
result = dns_badcache_find(bc, name, dns_rdatatype_aaaa, &flags,
|
||||
now + 30);
|
||||
assert_int_equal(result, ISC_R_NOTFOUND);
|
||||
|
||||
dns_name_fromstring2(name, "example.com.", NULL, 0, NULL);
|
||||
dns_name_fromstring(name, "example.com.", NULL, 0, NULL);
|
||||
result = dns_badcache_find(bc, name, dns_rdatatype_aaaa, &flags,
|
||||
now + 30);
|
||||
assert_int_equal(result, ISC_R_NOTFOUND);
|
||||
|
|
|
|||
|
|
@ -114,7 +114,7 @@ ISC_RUN_TEST_IMPL(dns_dbfind_staleok) {
|
|||
example = dns_fixedname_initname(&example_fixed);
|
||||
found = dns_fixedname_initname(&found_fixed);
|
||||
|
||||
result = dns_name_fromstring(example, "example", 0, NULL);
|
||||
result = dns_name_fromstring(example, "example", dns_rootname, 0, NULL);
|
||||
assert_int_equal(result, ISC_R_SUCCESS);
|
||||
|
||||
/*
|
||||
|
|
|
|||
|
|
@ -173,7 +173,7 @@ ISC_RUN_TEST_IMPL(dns_dt_send) {
|
|||
isc_buffer_init(&zb, zone, sizeof(zone));
|
||||
dns_compress_init(&cctx, mctx, 0);
|
||||
dns_compress_setpermitted(&cctx, false);
|
||||
result = dns_name_towire(zname, &cctx, &zb);
|
||||
result = dns_name_towire(zname, &cctx, &zb, NULL);
|
||||
assert_int_equal(result, ISC_R_SUCCESS);
|
||||
dns_compress_invalidate(&cctx);
|
||||
isc_buffer_usedregion(&zb, &zr);
|
||||
|
|
|
|||
|
|
@ -93,15 +93,15 @@ ISC_RUN_TEST_IMPL(fullcompare) {
|
|||
if (data[i].name1[0] == 0) {
|
||||
dns_fixedname_init(&fixed1);
|
||||
} else {
|
||||
result = dns_name_fromstring2(name1, data[i].name1,
|
||||
NULL, 0, NULL);
|
||||
result = dns_name_fromstring(name1, data[i].name1, NULL,
|
||||
0, NULL);
|
||||
assert_int_equal(result, ISC_R_SUCCESS);
|
||||
}
|
||||
if (data[i].name2[0] == 0) {
|
||||
dns_fixedname_init(&fixed2);
|
||||
} else {
|
||||
result = dns_name_fromstring2(name2, data[i].name2,
|
||||
NULL, 0, NULL);
|
||||
result = dns_name_fromstring(name2, data[i].name2, NULL,
|
||||
0, NULL);
|
||||
assert_int_equal(result, ISC_R_SUCCESS);
|
||||
}
|
||||
relation = dns_name_fullcompare(name1, name1, &order, &nlabels);
|
||||
|
|
@ -144,33 +144,29 @@ compress_test(const dns_name_t *name1, const dns_name_t *name2,
|
|||
|
||||
if (rdata) {
|
||||
/* RDATA compression */
|
||||
assert_int_equal(dns_name_towire(name1, cctx, &source),
|
||||
assert_int_equal(dns_name_towire(name1, cctx, &source, NULL),
|
||||
ISC_R_SUCCESS);
|
||||
assert_int_equal(dns_name_towire(name2, cctx, &source),
|
||||
assert_int_equal(dns_name_towire(name2, cctx, &source, NULL),
|
||||
ISC_R_SUCCESS);
|
||||
assert_int_equal(dns_name_towire(name2, cctx, &source),
|
||||
assert_int_equal(dns_name_towire(name2, cctx, &source, NULL),
|
||||
ISC_R_SUCCESS);
|
||||
assert_int_equal(dns_name_towire(name3, cctx, &source),
|
||||
assert_int_equal(dns_name_towire(name3, cctx, &source, NULL),
|
||||
ISC_R_SUCCESS);
|
||||
} else {
|
||||
/* Owner name compression */
|
||||
uint16_t offset = 0xffff;
|
||||
assert_int_equal(
|
||||
dns_name_towire2(name1, cctx, &source, &offset),
|
||||
ISC_R_SUCCESS);
|
||||
assert_int_equal(dns_name_towire(name1, cctx, &source, &offset),
|
||||
ISC_R_SUCCESS);
|
||||
|
||||
offset = 0xffff;
|
||||
assert_int_equal(
|
||||
dns_name_towire2(name2, cctx, &source, &offset),
|
||||
ISC_R_SUCCESS);
|
||||
assert_int_equal(
|
||||
dns_name_towire2(name2, cctx, &source, &offset),
|
||||
ISC_R_SUCCESS);
|
||||
assert_int_equal(dns_name_towire(name2, cctx, &source, &offset),
|
||||
ISC_R_SUCCESS);
|
||||
assert_int_equal(dns_name_towire(name2, cctx, &source, &offset),
|
||||
ISC_R_SUCCESS);
|
||||
|
||||
offset = 0xffff;
|
||||
assert_int_equal(
|
||||
dns_name_towire2(name3, cctx, &source, &offset),
|
||||
ISC_R_SUCCESS);
|
||||
assert_int_equal(dns_name_towire(name3, cctx, &source, &offset),
|
||||
ISC_R_SUCCESS);
|
||||
}
|
||||
assert_int_equal(source.used, compressed_length);
|
||||
assert_true(memcmp(source.base, compressed, source.used) == 0);
|
||||
|
|
@ -434,7 +430,7 @@ ISC_RUN_TEST_IMPL(collision) {
|
|||
}
|
||||
dns_compress_rollback(&cctx, coff);
|
||||
|
||||
result = dns_name_towire(&name, &cctx, &message);
|
||||
result = dns_name_towire(&name, &cctx, &message, NULL);
|
||||
assert_int_equal(result, ISC_R_SUCCESS);
|
||||
|
||||
/* we must be able to find the name we just added */
|
||||
|
|
@ -493,7 +489,8 @@ ISC_RUN_TEST_IMPL(istat) {
|
|||
name = dns_fixedname_initname(&fixed);
|
||||
|
||||
for (i = 0; i < (sizeof(data) / sizeof(data[0])); i++) {
|
||||
result = dns_name_fromstring(name, data[i].name, 0, NULL);
|
||||
result = dns_name_fromstring(name, data[i].name, dns_rootname,
|
||||
0, NULL);
|
||||
assert_int_equal(result, ISC_R_SUCCESS);
|
||||
assert_int_equal(dns_name_istat(name), data[i].istat);
|
||||
}
|
||||
|
|
@ -621,11 +618,11 @@ ISC_RUN_TEST_IMPL(hash) {
|
|||
n1 = dns_fixedname_initname(&f1);
|
||||
n2 = dns_fixedname_initname(&f2);
|
||||
|
||||
result = dns_name_fromstring2(n1, testcases[i].name1, NULL, 0,
|
||||
NULL);
|
||||
result = dns_name_fromstring(n1, testcases[i].name1, NULL, 0,
|
||||
NULL);
|
||||
assert_int_equal(result, ISC_R_SUCCESS);
|
||||
result = dns_name_fromstring2(n2, testcases[i].name2, NULL, 0,
|
||||
NULL);
|
||||
result = dns_name_fromstring(n2, testcases[i].name2, NULL, 0,
|
||||
NULL);
|
||||
assert_int_equal(result, ISC_R_SUCCESS);
|
||||
|
||||
/* Check case-insensitive hashing first */
|
||||
|
|
@ -680,11 +677,11 @@ ISC_RUN_TEST_IMPL(issubdomain) {
|
|||
n1 = dns_fixedname_initname(&f1);
|
||||
n2 = dns_fixedname_initname(&f2);
|
||||
|
||||
result = dns_name_fromstring2(n1, testcases[i].name1, NULL, 0,
|
||||
NULL);
|
||||
result = dns_name_fromstring(n1, testcases[i].name1, NULL, 0,
|
||||
NULL);
|
||||
assert_int_equal(result, ISC_R_SUCCESS);
|
||||
result = dns_name_fromstring2(n2, testcases[i].name2, NULL, 0,
|
||||
NULL);
|
||||
result = dns_name_fromstring(n2, testcases[i].name2, NULL, 0,
|
||||
NULL);
|
||||
assert_int_equal(result, ISC_R_SUCCESS);
|
||||
|
||||
if (verbose) {
|
||||
|
|
@ -730,8 +727,8 @@ ISC_RUN_TEST_IMPL(countlabels) {
|
|||
|
||||
name = dns_fixedname_initname(&fname);
|
||||
|
||||
result = dns_name_fromstring2(name, testcases[i].namestr, NULL,
|
||||
0, NULL);
|
||||
result = dns_name_fromstring(name, testcases[i].namestr, NULL,
|
||||
0, NULL);
|
||||
assert_int_equal(result, ISC_R_SUCCESS);
|
||||
|
||||
if (verbose) {
|
||||
|
|
@ -771,11 +768,11 @@ ISC_RUN_TEST_IMPL(getlabel) {
|
|||
n1 = dns_fixedname_initname(&f1);
|
||||
n2 = dns_fixedname_initname(&f2);
|
||||
|
||||
result = dns_name_fromstring2(n1, testcases[i].name1, NULL, 0,
|
||||
NULL);
|
||||
result = dns_name_fromstring(n1, testcases[i].name1, NULL, 0,
|
||||
NULL);
|
||||
assert_int_equal(result, ISC_R_SUCCESS);
|
||||
result = dns_name_fromstring2(n2, testcases[i].name2, NULL, 0,
|
||||
NULL);
|
||||
result = dns_name_fromstring(n2, testcases[i].name2, NULL, 0,
|
||||
NULL);
|
||||
assert_int_equal(result, ISC_R_SUCCESS);
|
||||
|
||||
dns_name_getlabel(n1, testcases[i].pos1, &l1);
|
||||
|
|
@ -819,11 +816,11 @@ ISC_RUN_TEST_IMPL(getlabelsequence) {
|
|||
n1 = dns_fixedname_initname(&f1);
|
||||
n2 = dns_fixedname_initname(&f2);
|
||||
|
||||
result = dns_name_fromstring2(n1, testcases[i].name1, NULL, 0,
|
||||
NULL);
|
||||
result = dns_name_fromstring(n1, testcases[i].name1, NULL, 0,
|
||||
NULL);
|
||||
assert_int_equal(result, ISC_R_SUCCESS);
|
||||
result = dns_name_fromstring2(n2, testcases[i].name2, NULL, 0,
|
||||
NULL);
|
||||
result = dns_name_fromstring(n2, testcases[i].name2, NULL, 0,
|
||||
NULL);
|
||||
assert_int_equal(result, ISC_R_SUCCESS);
|
||||
|
||||
dns_name_getlabelsequence(n1, testcases[i].pos1,
|
||||
|
|
@ -849,11 +846,12 @@ ISC_RUN_TEST_IMPL(maxlabels) {
|
|||
"a.b.c.";
|
||||
|
||||
name = dns_fixedname_initname(&fixed);
|
||||
result = dns_name_fromstring(name, one_too_many, 0, NULL);
|
||||
result = dns_name_fromstring(name, one_too_many, dns_rootname, 0, NULL);
|
||||
assert_int_equal(result, ISC_R_NOSPACE);
|
||||
|
||||
name = dns_fixedname_initname(&fixed);
|
||||
result = dns_name_fromstring(name, one_too_many + 2, 0, NULL);
|
||||
result = dns_name_fromstring(name, one_too_many + 2, dns_rootname, 0,
|
||||
NULL);
|
||||
assert_int_equal(result, ISC_R_SUCCESS);
|
||||
assert_true(dns_name_isvalid(name));
|
||||
assert_int_equal(dns_name_countlabels(name), DNS_NAME_MAXLABELS);
|
||||
|
|
|
|||
|
|
@ -224,17 +224,19 @@ rdata_checknames(dns_rdata_t *rdata) {
|
|||
(void)dns_rdata_checknames(rdata, dns_rootname, NULL);
|
||||
(void)dns_rdata_checknames(rdata, dns_rootname, bad);
|
||||
|
||||
result = dns_name_fromstring(name, "example.net", 0, NULL);
|
||||
result = dns_name_fromstring(name, "example.net", dns_rootname, 0,
|
||||
NULL);
|
||||
assert_int_equal(result, ISC_R_SUCCESS);
|
||||
(void)dns_rdata_checknames(rdata, name, NULL);
|
||||
(void)dns_rdata_checknames(rdata, name, bad);
|
||||
|
||||
result = dns_name_fromstring(name, "in-addr.arpa", 0, NULL);
|
||||
result = dns_name_fromstring(name, "in-addr.arpa", dns_rootname, 0,
|
||||
NULL);
|
||||
assert_int_equal(result, ISC_R_SUCCESS);
|
||||
(void)dns_rdata_checknames(rdata, name, NULL);
|
||||
(void)dns_rdata_checknames(rdata, name, bad);
|
||||
|
||||
result = dns_name_fromstring(name, "ip6.arpa", 0, NULL);
|
||||
result = dns_name_fromstring(name, "ip6.arpa", dns_rootname, 0, NULL);
|
||||
assert_int_equal(result, ISC_R_SUCCESS);
|
||||
(void)dns_rdata_checknames(rdata, name, NULL);
|
||||
(void)dns_rdata_checknames(rdata, name, bad);
|
||||
|
|
|
|||
|
|
@ -129,7 +129,8 @@ compare_tuples(const zonediff_t *expected, dns_difftuple_t *found,
|
|||
* Check owner name.
|
||||
*/
|
||||
expected_name = dns_fixedname_initname(&expected_fname);
|
||||
result = dns_name_fromstring(expected_name, expected->owner, 0, mctx);
|
||||
result = dns_name_fromstring(expected_name, expected->owner,
|
||||
dns_rootname, 0, mctx);
|
||||
assert_int_equal(result, ISC_R_SUCCESS);
|
||||
dns_name_format(&found->name, found_name, sizeof(found_name));
|
||||
assert_true(dns_name_equal(expected_name, &found->name));
|
||||
|
|
|
|||
|
|
@ -287,7 +287,7 @@ ISC_RUN_TEST_IMPL(tsig_tcp) {
|
|||
/* isc_log_setdebuglevel(lctx, 99); */
|
||||
|
||||
keyname = dns_fixedname_initname(&fkeyname);
|
||||
result = dns_name_fromstring(keyname, "test", 0, NULL);
|
||||
result = dns_name_fromstring(keyname, "test", dns_rootname, 0, NULL);
|
||||
assert_int_equal(result, ISC_R_SUCCESS);
|
||||
|
||||
dns_tsigkeyring_create(mctx, &ring);
|
||||
|
|
|
|||
|
|
@ -127,7 +127,7 @@ dns_test_makezone(const char *name, dns_zone_t **zonep, dns_view_t *view,
|
|||
*/
|
||||
dns_zone_settype(zone, dns_zone_primary);
|
||||
origin = dns_fixedname_initname(&fixed_origin);
|
||||
result = dns_name_fromstring(origin, name, 0, NULL);
|
||||
result = dns_name_fromstring(origin, name, dns_rootname, 0, NULL);
|
||||
if (result != ISC_R_SUCCESS) {
|
||||
goto detach_zone;
|
||||
}
|
||||
|
|
@ -219,7 +219,7 @@ dns_test_loaddb(dns_db_t **db, dns_dbtype_t dbtype, const char *origin,
|
|||
|
||||
name = dns_fixedname_initname(&fixed);
|
||||
|
||||
result = dns_name_fromstring(name, origin, 0, NULL);
|
||||
result = dns_name_fromstring(name, origin, dns_rootname, 0, NULL);
|
||||
if (result != ISC_R_SUCCESS) {
|
||||
return (result);
|
||||
}
|
||||
|
|
@ -455,7 +455,8 @@ dns_test_difffromchanges(dns_diff_t *diff, const zonechange_t *changes,
|
|||
* Parse owner name.
|
||||
*/
|
||||
name = dns_fixedname_initname(&fixedname);
|
||||
result = dns_name_fromstring(name, changes[i].owner, 0, mctx);
|
||||
result = dns_name_fromstring(name, changes[i].owner,
|
||||
dns_rootname, 0, mctx);
|
||||
if (result != ISC_R_SUCCESS) {
|
||||
break;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -285,7 +285,7 @@ attach_query_msg_to_client(ns_client_t *client, const char *qnamestr,
|
|||
* class IN and type "qtype", link the two and add the result to the
|
||||
* QUESTION section of the query.
|
||||
*/
|
||||
result = dns_name_fromstring(qname, qnamestr, 0, mctx);
|
||||
result = dns_name_fromstring(qname, qnamestr, dns_rootname, 0, mctx);
|
||||
if (result != ISC_R_SUCCESS) {
|
||||
goto put_name;
|
||||
}
|
||||
|
|
@ -533,7 +533,7 @@ ns_test_loaddb(dns_db_t **db, dns_dbtype_t dbtype, const char *origin,
|
|||
|
||||
name = dns_fixedname_initname(&fixed);
|
||||
|
||||
result = dns_name_fromstring(name, origin, 0, NULL);
|
||||
result = dns_name_fromstring(name, origin, dns_rootname, 0, NULL);
|
||||
if (result != ISC_R_SUCCESS) {
|
||||
return (result);
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue