* initializing key; that's why 'managed'
* is duplicated below.
*/
- CHECK(dns_keytable_add2(secroots, managed,
- managed, &dstkey));
+ CHECK(dns_keytable_add(secroots, managed,
+ managed, &dstkey));
}
}
if (result != ISC_R_SUCCESS)
return (result);
- result = dns_iptable_addprefix2(acl->iptable, &addr, 96,
- ISC_TRUE, ISC_FALSE);
+ result = dns_iptable_addprefix(acl->iptable, &addr, 96,
+ ISC_TRUE, ISC_FALSE);
if (result == ISC_R_SUCCESS)
dns_acl_attach(acl, &named_g_mapped);
dns_acl_detach(&acl);
* empty zone for it.
*/
result = dns_fwdtable_find(view->fwdtable, name,
- &dnsforwarders);
+ NULL, &dnsforwarders);
if (result == ISC_R_SUCCESS &&
dnsforwarders->fwdpolicy == dns_fwdpolicy_only)
continue;
if (result != ISC_R_SUCCESS)
return (result);
- result = dns_iptable_addprefix(src_acl->iptable,
- &netaddr, 128, ISC_TRUE);
+ result = dns_iptable_addprefix(src_acl->iptable, &netaddr,
+ 128, ISC_TRUE, ISC_FALSE);
if (result != ISC_R_SUCCESS)
goto clean;
if (result != ISC_R_SUCCESS)
return (result);
- result = dns_iptable_addprefix(acl->iptable, NULL, 0, ISC_TF(!neg));
+ result = dns_iptable_addprefix(acl->iptable, NULL, 0, ISC_TF(!neg),
+ ISC_FALSE);
if (result != ISC_R_SUCCESS) {
dns_acl_detach(&acl);
return (result);
if (result != ISC_R_SUCCESS)
goto cleanup;
- result = dns_keytable_add2(secroots, ISC_FALSE, ISC_FALSE, &dstkey);
+ result = dns_keytable_add(secroots, ISC_FALSE, ISC_FALSE, &dstkey);
cleanup:
if (dstkey != NULL)
isc_result_t
dns_fwdtable_find(dns_fwdtable_t *fwdtable, const dns_name_t *name,
- dns_forwarders_t **forwardersp)
-{
- return (dns_fwdtable_find2(fwdtable, name, NULL, forwardersp));
-}
-
-isc_result_t
-dns_fwdtable_find2(dns_fwdtable_t *fwdtable, const dns_name_t *name,
- dns_name_t *foundname, dns_forwarders_t **forwardersp)
+ dns_name_t *foundname, dns_forwarders_t **forwardersp)
{
isc_result_t result;
isc_result_t
dns_fwdtable_find(dns_fwdtable_t *fwdtable, const dns_name_t *name,
- dns_forwarders_t **forwardersp);
-/*%<
- * Finds a domain in the forwarding table. The closest matching parent
- * domain is returned.
- *
- * Requires:
- * \li fwdtable is a valid forwarding table.
- * \li name is a valid name
- * \li forwardersp != NULL && *forwardersp == NULL
- *
- * Returns:
- * \li #ISC_R_SUCCESS
- * \li #ISC_R_NOTFOUND
- */
-
-isc_result_t
-dns_fwdtable_find2(dns_fwdtable_t *fwdtable, const dns_name_t *name,
- dns_name_t *foundname, dns_forwarders_t **forwardersp);
+ dns_name_t *foundname, dns_forwarders_t **forwardersp);
/*%<
* Finds a domain in the forwarding table. The closest matching parent
* domain is returned.
isc_result_t
dns_iptable_addprefix(dns_iptable_t *tab, const isc_netaddr_t *addr,
- isc_uint16_t bitlen, isc_boolean_t pos);
-isc_result_t
-dns_iptable_addprefix2(dns_iptable_t *tab, const isc_netaddr_t *addr,
- isc_uint16_t bitlen, isc_boolean_t pos,
- isc_boolean_t is_ecs);
+ isc_uint16_t bitlen, isc_boolean_t pos,
+ isc_boolean_t is_ecs);
/*
* Add an IP prefix to an existing IP table
*/
isc_result_t
dns_keytable_add(dns_keytable_t *keytable, isc_boolean_t managed,
- dst_key_t **keyp) ISC_DEPRECATED;
-isc_result_t
-dns_keytable_add2(dns_keytable_t *keytable, isc_boolean_t managed,
isc_boolean_t initial, dst_key_t **keyp);
/*%<
* Add '*keyp' to 'keytable' (using the name in '*keyp').
*/
isc_result_t
dns_iptable_addprefix(dns_iptable_t *tab, const isc_netaddr_t *addr,
- isc_uint16_t bitlen, isc_boolean_t pos)
-{
- return(dns_iptable_addprefix2(tab, addr, bitlen, pos, ISC_FALSE));
-}
-
-isc_result_t
-dns_iptable_addprefix2(dns_iptable_t *tab, const isc_netaddr_t *addr,
- isc_uint16_t bitlen, isc_boolean_t pos,
- isc_boolean_t is_ecs)
+ isc_uint16_t bitlen, isc_boolean_t pos,
+ isc_boolean_t is_ecs)
{
isc_result_t result;
isc_prefix_t pfx;
isc_result_t
dns_keytable_add(dns_keytable_t *keytable, isc_boolean_t managed,
- dst_key_t **keyp)
-{
- return (dns_keytable_add2(keytable, managed, ISC_FALSE, keyp));
-}
-
-isc_result_t
-dns_keytable_add2(dns_keytable_t *keytable, isc_boolean_t managed,
- isc_boolean_t initial, dst_key_t **keyp)
+ isc_boolean_t initial, dst_key_t **keyp)
{
REQUIRE(keyp != NULL && *keyp != NULL);
REQUIRE(!initial || managed);
dns_fixedname_init(&fixed);
domain = dns_fixedname_name(&fixed);
- result = dns_fwdtable_find2(res->view->fwdtable, name,
- domain, &forwarders);
+ result = dns_fwdtable_find(res->view->fwdtable, name,
+ domain, &forwarders);
if (result == ISC_R_SUCCESS) {
fwd = ISC_LIST_HEAD(forwarders->fwdrs);
fctx->fwdpolicy = forwarders->fwdpolicy;
/* Find the forwarder for this name. */
dns_fixedname_init(&fixed);
fname = dns_fixedname_name(&fixed);
- result = dns_fwdtable_find2(fctx->res->view->fwdtable, fwdname,
- fname, &forwarders);
+ result = dns_fwdtable_find(fctx->res->view->fwdtable, fwdname,
+ fname, &forwarders);
if (result == ISC_R_SUCCESS)
fctx->fwdpolicy = forwarders->fwdpolicy;
inaddr.s_addr = htonl(0x0a000000); /* 10.0.0.0 */
isc_netaddr_fromin(&addr, &inaddr);
- result = dns_iptable_addprefix2(pos4pos6->iptable, &addr, 8,
- ISC_TRUE, ecs[pass].first);
+ result = dns_iptable_addprefix(pos4pos6->iptable, &addr, 8,
+ ISC_TRUE, ecs[pass].first);
ATF_REQUIRE_EQ(result, ISC_R_SUCCESS);
addr.family = AF_INET6; /* 0a00:: */
- result = dns_iptable_addprefix2(pos4pos6->iptable, &addr, 8,
- ISC_TRUE, ecs[pass].second);
+ result = dns_iptable_addprefix(pos4pos6->iptable, &addr, 8,
+ ISC_TRUE, ecs[pass].second);
ATF_REQUIRE_EQ(result, ISC_R_SUCCESS);
result = dns_acl_merge(notpos4pos6, pos4pos6, ISC_FALSE);
inaddr.s_addr = htonl(0x0a000000); /* !10.0.0.0/8 */
isc_netaddr_fromin(&addr, &inaddr);
- result = dns_iptable_addprefix2(neg4pos6->iptable, &addr, 8,
- ISC_FALSE, ecs[pass].first);
+ result = dns_iptable_addprefix(neg4pos6->iptable, &addr, 8,
+ ISC_FALSE, ecs[pass].first);
ATF_REQUIRE_EQ(result, ISC_R_SUCCESS);
addr.family = AF_INET6; /* 0a00::/8 */
- result = dns_iptable_addprefix2(neg4pos6->iptable, &addr, 8,
- ISC_TRUE, ecs[pass].second);
+ result = dns_iptable_addprefix(neg4pos6->iptable, &addr, 8,
+ ISC_TRUE, ecs[pass].second);
ATF_REQUIRE_EQ(result, ISC_R_SUCCESS);
result = dns_acl_merge(notneg4pos6, neg4pos6, ISC_FALSE);
inaddr.s_addr = htonl(0x0a000000); /* 10.0.0.0/8 */
isc_netaddr_fromin(&addr, &inaddr);
- result = dns_iptable_addprefix2(pos4neg6->iptable, &addr, 8,
- ISC_TRUE, ecs[pass].first);
+ result = dns_iptable_addprefix(pos4neg6->iptable, &addr, 8,
+ ISC_TRUE, ecs[pass].first);
ATF_REQUIRE_EQ(result, ISC_R_SUCCESS);
addr.family = AF_INET6; /* !0a00::/8 */
- result = dns_iptable_addprefix2(pos4neg6->iptable, &addr, 8,
- ISC_FALSE, ecs[pass].second);
+ result = dns_iptable_addprefix(pos4neg6->iptable, &addr, 8,
+ ISC_FALSE, ecs[pass].second);
ATF_REQUIRE_EQ(result, ISC_R_SUCCESS);
result = dns_acl_merge(notpos4neg6, pos4neg6, ISC_FALSE);
inaddr.s_addr = htonl(0x0a000000); /* !10.0.0.0/8 */
isc_netaddr_fromin(&addr, &inaddr);
- result = dns_iptable_addprefix2(neg4neg6->iptable, &addr, 8,
- ISC_FALSE, ecs[pass].first);
+ result = dns_iptable_addprefix(neg4neg6->iptable, &addr, 8,
+ ISC_FALSE, ecs[pass].first);
ATF_REQUIRE_EQ(result, ISC_R_SUCCESS);
addr.family = AF_INET6; /* !0a00::/8 */
- result = dns_iptable_addprefix2(neg4neg6->iptable, &addr, 8,
- ISC_FALSE, ecs[pass].second);
+ result = dns_iptable_addprefix(neg4neg6->iptable, &addr, 8,
+ ISC_FALSE, ecs[pass].second);
ATF_REQUIRE_EQ(result, ISC_R_SUCCESS);
result = dns_acl_merge(notneg4neg6, neg4neg6, ISC_FALSE);
inaddr.s_addr = htonl(0x7f000001); /* 127.0.0.1 */
isc_netaddr_fromin(&addr, &inaddr);
- result = dns_iptable_addprefix2(loop4->iptable, &addr, 32,
- ISC_TRUE, ecs[pass].first);
+ result = dns_iptable_addprefix(loop4->iptable, &addr, 32,
+ ISC_TRUE, ecs[pass].first);
ATF_REQUIRE_EQ(result, ISC_R_SUCCESS);
result = dns_acl_merge(notloop4, loop4, ISC_FALSE);
ATF_REQUIRE_EQ(result, ISC_R_SUCCESS);
isc_netaddr_fromin6(&addr, &in6addr_loopback); /* ::1 */
- result = dns_iptable_addprefix2(loop6->iptable, &addr, 128,
- ISC_TRUE, ecs[pass].first);
+ result = dns_iptable_addprefix(loop6->iptable, &addr, 128,
+ ISC_TRUE, ecs[pass].first);
ATF_REQUIRE_EQ(result, ISC_R_SUCCESS);
result = dns_acl_merge(notloop6, loop6, ISC_FALSE);
inaddr.s_addr = htonl(0x7f000001); /* 127.0.0.1 */
isc_netaddr_fromin(&addr, &inaddr);
- result = dns_iptable_addprefix2(loop4pos6->iptable, &addr, 32,
- ISC_TRUE, ecs[pass].first);
+ result = dns_iptable_addprefix(loop4pos6->iptable, &addr, 32,
+ ISC_TRUE, ecs[pass].first);
ATF_REQUIRE_EQ(result, ISC_R_SUCCESS);
addr.family = AF_INET6; /* f700:0001::/32 */
- result = dns_iptable_addprefix2(loop4pos6->iptable, &addr, 32,
- ISC_TRUE, ecs[pass].second);
+ result = dns_iptable_addprefix(loop4pos6->iptable, &addr, 32,
+ ISC_TRUE, ecs[pass].second);
ATF_REQUIRE_EQ(result, ISC_R_SUCCESS);
result = dns_acl_merge(notloop4pos6, loop4pos6, ISC_FALSE);
inaddr.s_addr = htonl(0x7f000001); /* 127.0.0.1 */
isc_netaddr_fromin(&addr, &inaddr);
- result = dns_iptable_addprefix2(loop4neg6->iptable, &addr, 32,
- ISC_TRUE, ecs[pass].first);
+ result = dns_iptable_addprefix(loop4neg6->iptable, &addr, 32,
+ ISC_TRUE, ecs[pass].first);
ATF_REQUIRE_EQ(result, ISC_R_SUCCESS);
addr.family = AF_INET6; /* !f700:0001::/32 */
- result = dns_iptable_addprefix2(loop4neg6->iptable, &addr, 32,
- ISC_FALSE, ecs[pass].second);
+ result = dns_iptable_addprefix(loop4neg6->iptable, &addr, 32,
+ ISC_FALSE, ecs[pass].second);
ATF_REQUIRE_EQ(result, ISC_R_SUCCESS);
result = dns_acl_merge(notloop4neg6, loop4neg6, ISC_FALSE);
/* Add a normal key */
create_key(257, 3, 5, "example.com", keystr1, &key);
- ATF_REQUIRE_EQ(dns_keytable_add2(keytable, ISC_FALSE, ISC_FALSE, &key),
+ ATF_REQUIRE_EQ(dns_keytable_add(keytable, ISC_FALSE, ISC_FALSE, &key),
ISC_R_SUCCESS);
/* Add an initializing managed key */
create_key(257, 3, 5, "managed.com", keystr1, &key);
- ATF_REQUIRE_EQ(dns_keytable_add2(keytable, ISC_TRUE, ISC_TRUE, &key),
+ ATF_REQUIRE_EQ(dns_keytable_add(keytable, ISC_TRUE, ISC_TRUE, &key),
ISC_R_SUCCESS);
/* Add a null key */
* nextkeynode() should still return NOTFOUND.
*/
create_key(257, 3, 5, "example.com", keystr1, &key);
- ATF_REQUIRE_EQ(dns_keytable_add2(keytable, ISC_FALSE, ISC_FALSE, &key),
+ ATF_REQUIRE_EQ(dns_keytable_add(keytable, ISC_FALSE, ISC_FALSE, &key),
ISC_R_SUCCESS);
ATF_REQUIRE_EQ(dns_keytable_nextkeynode(keytable, keynode,
&next_keynode), ISC_R_NOTFOUND);
/* Add another key (different keydata) */
dns_keytable_detachkeynode(keytable, &keynode);
create_key(257, 3, 5, "example.com", keystr2, &key);
- ATF_REQUIRE_EQ(dns_keytable_add2(keytable, ISC_FALSE, ISC_FALSE, &key),
+ ATF_REQUIRE_EQ(dns_keytable_add(keytable, ISC_FALSE, ISC_FALSE, &key),
ISC_R_SUCCESS);
ATF_REQUIRE_EQ(dns_keytable_find(keytable, str2name("example.com"),
&keynode), ISC_R_SUCCESS);
* ISC_R_NOTFOUND and that the added key is an initializing key.
*/
create_key(257, 3, 5, "managed.com", keystr2, &key);
- ATF_REQUIRE_EQ(dns_keytable_add2(keytable, ISC_TRUE, ISC_TRUE, &key),
+ ATF_REQUIRE_EQ(dns_keytable_add(keytable, ISC_TRUE, ISC_TRUE, &key),
ISC_R_SUCCESS);
ATF_REQUIRE_EQ(dns_keytable_find(keytable, str2name("managed.com"),
&keynode), ISC_R_SUCCESS);
* nodes for managed.com, both containing non-initializing keys.
*/
create_key(257, 3, 5, "managed.com", keystr2, &key);
- ATF_REQUIRE_EQ(dns_keytable_add2(keytable, ISC_TRUE, ISC_FALSE, &key),
+ ATF_REQUIRE_EQ(dns_keytable_add(keytable, ISC_TRUE, ISC_FALSE, &key),
ISC_R_SUCCESS);
ATF_REQUIRE_EQ(dns_keytable_find(keytable, str2name("managed.com"),
&keynode), ISC_R_SUCCESS);
* that the added key is an initializing key.
*/
create_key(257, 3, 5, "two.com", keystr1, &key);
- ATF_REQUIRE_EQ(dns_keytable_add2(keytable, ISC_TRUE, ISC_TRUE, &key),
+ ATF_REQUIRE_EQ(dns_keytable_add(keytable, ISC_TRUE, ISC_TRUE, &key),
ISC_R_SUCCESS);
ATF_REQUIRE_EQ(dns_keytable_find(keytable, str2name("two.com"),
&keynode), ISC_R_SUCCESS);
* ISC_R_NOTFOUND and that the added key is not an initializing key.
*/
create_key(257, 3, 5, "two.com", keystr2, &key);
- ATF_REQUIRE_EQ(dns_keytable_add2(keytable, ISC_TRUE, ISC_FALSE, &key),
+ ATF_REQUIRE_EQ(dns_keytable_add(keytable, ISC_TRUE, ISC_FALSE, &key),
ISC_R_SUCCESS);
ATF_REQUIRE_EQ(dns_keytable_find(keytable, str2name("two.com"),
&keynode), ISC_R_SUCCESS);
* nodes for two.com, both containing non-initializing keys.
*/
create_key(257, 3, 5, "two.com", keystr1, &key);
- ATF_REQUIRE_EQ(dns_keytable_add2(keytable, ISC_TRUE, ISC_FALSE, &key),
+ ATF_REQUIRE_EQ(dns_keytable_add(keytable, ISC_TRUE, ISC_FALSE, &key),
ISC_R_SUCCESS);
ATF_REQUIRE_EQ(dns_keytable_find(keytable, str2name("two.com"),
&keynode), ISC_R_SUCCESS);
ATF_REQUIRE_EQ(dns_keytable_find(keytable, str2name("null.example"),
&null_keynode), ISC_R_SUCCESS);
create_key(257, 3, 5, "null.example", keystr2, &key);
- ATF_REQUIRE_EQ(dns_keytable_add2(keytable, ISC_FALSE, ISC_FALSE, &key),
+ ATF_REQUIRE_EQ(dns_keytable_add(keytable, ISC_FALSE, ISC_FALSE, &key),
ISC_R_SUCCESS);
ATF_REQUIRE_EQ(dns_keytable_find(keytable, str2name("null.example"),
&keynode), ISC_R_SUCCESS);
ATF_REQUIRE_EQ(result, ISC_R_SUCCESS);
create_key(257, 3, 5, "example", keystr1, &key);
- result = dns_keytable_add2(keytable, ISC_FALSE, ISC_FALSE, &key);
+ result = dns_keytable_add(keytable, ISC_FALSE, ISC_FALSE, &key);
ATF_REQUIRE_EQ(result, ISC_R_SUCCESS);
isc_stdtime_get(&now);
dns_fwdtable_delete
dns_fwdtable_destroy
dns_fwdtable_find
-dns_fwdtable_find2
dns_generalstats_create
dns_generalstats_dump
dns_generalstats_increment
dns_ipkeylist_init
dns_ipkeylist_resize
dns_iptable_addprefix
-dns_iptable_addprefix2
dns_iptable_attach
dns_iptable_create
dns_iptable_detach
dns_keynode_trust
dns_keyring_restore
dns_keytable_add
-dns_keytable_add2
dns_keytable_attach
dns_keytable_attachkeynode
dns_keytable_create
goto failure;
CHECK(dns_dnssec_keyfromrdata(keyname, &rdata, mctx, &dstkey));
- CHECK(dns_keytable_add2(sr, ISC_TRUE, initial, &dstkey));
+ CHECK(dns_keytable_add(sr, ISC_TRUE, initial, &dstkey));
dns_keytable_detach(&sr);
failure:
const cfg_listelt_t *elt;
dns_iptable_t *iptab;
int new_nest_level = 0;
+ isc_boolean_t setpos;
if (nest_level != 0)
new_nest_level = nest_level - 1;
/* Network prefix */
isc_netaddr_t addr;
unsigned int bitlen;
- isc_boolean_t setpos, setecs;
+ isc_boolean_t setecs;
cfg_obj_asnetprefix(ce, &addr, &bitlen);
if (family != 0 && family != addr.family) {
*/
setpos = ISC_TF(nest_level != 0 || !neg);
setecs = cfg_obj_istype(ce, &cfg_type_ecsprefix);
- result = dns_iptable_addprefix2(iptab, &addr, bitlen,
- setpos, setecs);
+ result = dns_iptable_addprefix(iptab, &addr, bitlen,
+ setpos, setecs);
if (result != ISC_R_SUCCESS)
goto cleanup;
const char *name = cfg_obj_asstring(ce);
if (strcasecmp(name, "any") == 0) {
/* Iptable entry with zero bit length. */
+ setpos = ISC_TF(nest_level != 0 || !neg);
result = dns_iptable_addprefix(iptab, NULL, 0,
- ISC_TF(nest_level != 0 || !neg));
+ setpos,
+ ISC_FALSE);
if (result != ISC_R_SUCCESS)
goto cleanup;
* de->negative to true so we can handle
* "!none;".
*/
+ setpos = ISC_TF(nest_level != 0 || neg);
result = dns_iptable_addprefix(iptab, NULL, 0,
- ISC_TF(nest_level != 0 || neg));
+ setpos,
+ ISC_FALSE);
if (result != ISC_R_SUCCESS)
goto cleanup;
/* First add localhost address */
prefixlen = (netaddr->family == AF_INET) ? 32 : 128;
result = dns_iptable_addprefix(mgr->aclenv.localhost->iptable,
- netaddr, prefixlen, ISC_TRUE);
+ netaddr, prefixlen, ISC_TRUE, ISC_FALSE);
if (result != ISC_R_SUCCESS)
return (result);
}
result = dns_iptable_addprefix(mgr->aclenv.localnets->iptable,
- netaddr, prefixlen, ISC_TRUE);
+ netaddr, prefixlen, ISC_TRUE, ISC_FALSE);
if (result != ISC_R_SUCCESS)
return (result);