}
if (symtab == NULL) {
- result = isc_symtab_create(sym_mctx, 100, freekey, sym_mctx,
- false, &symtab);
- if (result != ISC_R_SUCCESS) {
- return;
- }
+ isc_symtab_create(sym_mctx, 100, freekey, sym_mctx, false,
+ &symtab);
}
key = isc_mem_strdup(sym_mctx, key);
isc_buffer_add(&buffer, strlen(zonename));
origin = dns_fixedname_initname(&fixorigin);
CHECK(dns_name_fromtext(origin, &buffer, dns_rootname, 0, NULL));
- CHECK(dns_zone_setorigin(zone, origin));
+ dns_zone_setorigin(zone, origin);
dns_zone_setdbtype(zone, 1, (const char *const *)dbtype);
if (strcmp(filename, "-") == 0) {
- CHECK(dns_zone_setstream(zone, stdin, fileformat,
- &dns_master_style_default));
+ dns_zone_setstream(zone, stdin, fileformat,
+ &dns_master_style_default);
} else {
- CHECK(dns_zone_setfile(zone, filename, fileformat,
- &dns_master_style_default));
+ dns_zone_setfile(zone, filename, fileformat,
+ &dns_master_style_default);
}
if (journal != NULL) {
- CHECK(dns_zone_setjournal(zone, journal));
+ dns_zone_setjournal(zone, journal);
}
region.base = UNCONST(classname);
CHECK(ns_interfacemgr_create(mctx, sctx, loopmgr, netmgr, dispatchmgr,
NULL, &interfacemgr));
- CHECK(dns_view_create(mctx, loopmgr, dispatchmgr, dns_rdataclass_in,
- "_default", &view));
+ dns_view_create(mctx, loopmgr, dispatchmgr, dns_rdataclass_in,
+ "_default", &view);
CHECK(dns_cache_create(loopmgr, dns_rdataclass_in, "", mctx, &cache));
dns_view_setcache(view, cache, false);
dns_cache_detach(&cache);
CHECK(cfg_map_get(config, "key", &key));
keyid = isc_mem_get(mctx, sizeof(*keyid));
+ *keyid = (controlkey_t){
+ .algorithm = DST_ALG_UNKNOWN,
+ .link = ISC_LINK_INITIALIZER,
+ };
keyid->keyname = isc_mem_strdup(mctx,
cfg_obj_asstring(cfg_map_getname(key)));
- keyid->secret.base = NULL;
- keyid->secret.length = 0;
- keyid->algorithm = DST_ALG_UNKNOWN;
- ISC_LINK_INIT(keyid, link);
- if (keyid->keyname == NULL) {
- CHECK(ISC_R_NOMEMORY);
- }
CHECK(isccfg_check_key(key));
*
* Returns:
*\li ISC_R_SUCCESS
- *\li ISC_R_NOMEMORY
+ *\li return codes from dns_name_fromtext()
*/
*
* Returns:
* \li ISC_R_SUCCESS
- * \li ISC_R_NOMEMORY
+ * \li DNS_R_BADALG
+ * \li return codes from dns_name_fromtext()
*/
return ISC_R_FAILURE;
}
- if ((instance = isc_mem_allocate(mctx, namelen + 1)) == NULL) {
- UNEXPECTED_ERROR("named_smf_get_instance memory "
- "allocation failed: %s",
- isc_result_totext(ISC_R_NOMEMORY));
- scf_handle_destroy(h);
- return ISC_R_FAILURE;
- }
-
+ instance = isc_mem_allocate(mctx, namelen + 1);
if (scf_myname(h, instance, namelen + 1) == -1) {
if (debug) {
UNEXPECTED_ERROR("scf_myname() failed: %s",
* explicit entry for "." when the name is "*".
*/
if (addroot) {
- result = dns_order_add(order, dns_rootname, rdtype, rdclass,
- mode);
- if (result != ISC_R_SUCCESS) {
- return result;
- }
+ dns_order_add(order, dns_rootname, rdtype, rdclass, mode);
}
- return dns_order_add(order, dns_fixedname_name(&fixed), rdtype, rdclass,
- mode);
+ dns_order_add(order, dns_fixedname_name(&fixed), rdtype, rdclass, mode);
+
+ return ISC_R_SUCCESS;
}
static isc_result_t
unsigned int i;
isc_result_t result = ISC_R_SUCCESS;
- CHECK(dns_zone_getdbtype(zone, &argv, mctx));
+ dns_zone_getdbtype(zone, &argv, mctx);
/*
* Check that all the arguments match.
isc_buffer_add(&b, strlen(reverse));
CHECK(dns_name_fromtext(name, &b, dns_rootname, 0, NULL));
dns_zone_create(&zone, mctx, 0);
- CHECK(dns_zone_setorigin(zone, name));
+ dns_zone_setorigin(zone, name);
dns_zone_setview(zone, view);
CHECK(dns_zonemgr_managezone(named_g_server->zonemgr, zone));
dns_zone_setclass(zone, view->rdclass);
if (pzone == NULL) {
CHECK(dns_zonemgr_createzone(named_g_server->zonemgr, &zone));
- CHECK(dns_zone_setorigin(zone, name));
+ dns_zone_setorigin(zone, name);
CHECK(dns_zonemgr_managezone(named_g_server->zonemgr, zone));
if (db == NULL) {
dns_zone_setdbtype(zone, empty_dbtypec, empty_dbtype);
* Create the actual zone.
*/
dns_zone_create(&zone, mctx, 0);
- CHECK(dns_zone_setorigin(zone, name));
+ dns_zone_setorigin(zone, name);
CHECK(dns_zonemgr_managezone(named_g_server->zonemgr, zone));
dns_zone_setclass(zone, view->rdclass);
dns_zone_settype(zone, dns_zone_primary);
const cfg_obj_t *name, *search = NULL;
char *s = isc_mem_strdup(mctx, cfg_obj_asstring(obj));
- if (s == NULL) {
- result = ISC_R_NOMEMORY;
- goto cleanup;
- }
-
result = isc_commandline_strtoargv(mctx, s, &dlzargc,
&dlzargv, 0);
if (result != ISC_R_SUCCESS) {
dns64options |= DNS_DNS64_BREAK_DNSSEC;
}
- result = dns_dns64_create(mctx, &na, prefixlen, sp,
- clients, mapped, excluded,
- dns64options, &dns64);
- if (result != ISC_R_SUCCESS) {
- goto cleanup;
- }
+ dns_dns64_create(mctx, &na, prefixlen, sp, clients,
+ mapped, excluded, dns64options,
+ &dns64);
dns_dns64_append(&view->dns64, dns64);
view->dns64cnt++;
result = dns64_reverse(view, mctx, &na, prefixlen,
dns_peerlist_t *newpeers = NULL;
(void)named_config_get(cfgmaps, "server", &peers);
- CHECK(dns_peerlist_new(mctx, &newpeers));
+ dns_peerlist_new(mctx, &newpeers);
for (element = cfg_list_first(peers); element != NULL;
element = cfg_list_next(element))
{
const cfg_obj_t *rrsetorder = NULL;
(void)named_config_get(maps, "rrset-order", &rrsetorder);
- CHECK(dns_order_create(mctx, &order));
+ dns_order_create(mctx, &order);
for (element = cfg_list_first(rrsetorder); element != NULL;
element = cfg_list_next(element))
{
if (dctx == NULL) {
const void *hashinit = isc_hash_get_initializer();
- CHECK(dns_dyndb_createctx(mctx, hashinit, view,
- named_g_server->zonemgr,
- named_g_loopmgr, &dctx));
+ dns_dyndb_createctx(mctx, hashinit, view,
+ named_g_server->zonemgr,
+ named_g_loopmgr, &dctx);
}
CHECK(configure_dyndb(dyndb, mctx, dctx));
}
INSIST(view == NULL);
- result = dns_view_create(named_g_mctx, named_g_loopmgr,
- named_g_dispatchmgr, viewclass, viewname,
- &view);
- if (result != ISC_R_SUCCESS) {
- return result;
- }
+ dns_view_create(named_g_mctx, named_g_loopmgr, named_g_dispatchmgr,
+ viewclass, viewname, &view);
isc_nonce_buf(view->secret, sizeof(view->secret));
} else {
CHECK(dns_zonemgr_createzone(named_g_server->zonemgr,
&zone));
- CHECK(dns_zone_setorigin(zone, origin));
+ dns_zone_setorigin(zone, origin);
dns_zone_setview(zone, view);
CHECK(dns_zonemgr_managezone(named_g_server->zonemgr,
zone));
* to create a new one.
*/
CHECK(dns_zonemgr_createzone(named_g_server->zonemgr, &zone));
- CHECK(dns_zone_setorigin(zone, origin));
+ dns_zone_setorigin(zone, origin);
dns_zone_setview(zone, view);
CHECK(dns_zonemgr_managezone(named_g_server->zonemgr, zone));
dns_zone_setstats(zone, named_g_server->zonestats);
if (raw == NULL) {
dns_zone_create(&raw, dns_zone_getmem(zone),
dns_zone_gettid(zone));
- CHECK(dns_zone_setorigin(raw, origin));
+ dns_zone_setorigin(raw, origin);
dns_zone_setview(raw, view);
dns_zone_setstats(raw, named_g_server->zonestats);
CHECK(dns_zone_link(zone, raw));
/* No existing keydata zone was found; create one */
CHECK(dns_zonemgr_createzone(named_g_server->zonemgr, &zone));
- CHECK(dns_zone_setorigin(zone, dns_rootname));
+ dns_zone_setorigin(zone, dns_rootname);
defaultview = (strcmp(view->name, "_default") == 0);
CHECK(isc_file_sanitize(
directory, defaultview ? "managed-keys" : view->name,
defaultview ? "bind" : "mkeys", filename, sizeof(filename)));
- CHECK(dns_zone_setfile(zone, filename, dns_masterformat_text,
- &dns_master_style_default));
+ dns_zone_setfile(zone, filename, dns_masterformat_text,
+ &dns_master_style_default);
dns_zone_setview(zone, view);
dns_zone_settype(zone, dns_zone_key);
/*
* Configure sets of UDP query source ports.
*/
- result = isc_portset_create(named_g_mctx, &v4portset);
- if (result != ISC_R_SUCCESS) {
- isc_log_write(NAMED_LOGCATEGORY_GENERAL, NAMED_LOGMODULE_SERVER,
- ISC_LOG_ERROR, "creating UDP/IPv4 port set: %s",
- isc_result_totext(result));
- goto cleanup_bindkeys_parser;
- }
- result = isc_portset_create(named_g_mctx, &v6portset);
- if (result != ISC_R_SUCCESS) {
- isc_log_write(NAMED_LOGCATEGORY_GENERAL, NAMED_LOGMODULE_SERVER,
- ISC_LOG_ERROR, "creating UDP/IPv6 port set: %s",
- isc_result_totext(result));
- goto cleanup_v4portset;
- }
+ isc_portset_create(named_g_mctx, &v4portset);
+ isc_portset_create(named_g_mctx, &v6portset);
result = isc_net_getudpportrange(AF_INET, &udpport_low, &udpport_high);
if (result != ISC_R_SUCCESS) {
ISC_LOG_ERROR,
"get the default UDP/IPv4 port range: %s",
isc_result_totext(result));
- goto cleanup_v6portset;
+ goto cleanup_portsets;
}
isc_portset_addrange(v4portset, udpport_low, udpport_high);
ISC_LOG_ERROR,
"get the default UDP/IPv6 port range: %s",
isc_result_totext(result));
- goto cleanup_v6portset;
+ goto cleanup_portsets;
}
isc_portset_addrange(v6portset, udpport_low, udpport_high);
if (!ns_server_getoption(server->sctx, NS_SERVER_DISABLE6)) {
} else {
result = named_config_getport(config, "port", &listen_port);
if (result != ISC_R_SUCCESS) {
- goto cleanup_v6portset;
+ goto cleanup_portsets;
}
}
result = named_config_get(maps, "listen-on", &clistenon);
if (result != ISC_R_SUCCESS) {
- goto cleanup_v6portset;
+ goto cleanup_portsets;
}
result = listenlist_fromconfig(
clistenon, config, named_g_aclconfctx, named_g_mctx,
AF_INET, server->tlsctx_server_cache, &listenon);
if (result != ISC_R_SUCCESS) {
- goto cleanup_v6portset;
+ goto cleanup_portsets;
}
if (listenon != NULL) {
ns_interfacemgr_setlistenon4(server->interfacemgr,
result = named_config_get(maps, "listen-on-v6", &clistenon);
if (result != ISC_R_SUCCESS) {
- goto cleanup_v6portset;
+ goto cleanup_portsets;
}
result = listenlist_fromconfig(
clistenon, config, named_g_aclconfctx, named_g_mctx,
AF_INET6, server->tlsctx_server_cache, &listenon);
if (result != ISC_R_SUCCESS) {
- goto cleanup_v6portset;
+ goto cleanup_portsets;
}
if (listenon != NULL) {
ns_interfacemgr_setlistenon6(server->interfacemgr,
"unable to listen on any configured "
"interfaces");
result = ISC_R_FAILURE;
- goto cleanup_v6portset;
+ goto cleanup_portsets;
}
}
dns_keystore_detach(&keystore);
}
-cleanup_v6portset:
+cleanup_portsets:
isc_portset_destroy(named_g_mctx, &v6portset);
-
-cleanup_v4portset:
isc_portset_destroy(named_g_mctx, &v4portset);
cleanup_bindkeys_parser:
isc_buffer_t b;
const cfg_obj_t *obj;
- result = dns_tkeyctx_create(mctx, &tctx);
- if (result != ISC_R_SUCCESS) {
- return result;
- }
+ dns_tkeyctx_create(mctx, &tctx);
obj = NULL;
result = cfg_map_get(options, "tkey-domain", &obj);
if (result == ISC_R_SUCCESS) {
cpval = isc_mem_strdup(mctx, cfg_obj_asstring(obj));
}
- if (cpval == NULL) {
- CHECK(ISC_R_NOMEMORY);
- }
obj = NULL;
result = cfg_map_get(zoptions, "dlz", &obj);
size_t signedlen = strlen(filename) + sizeof(SIGNED);
char *signedname;
- CHECK(dns_zone_setfile(raw, filename, masterformat,
- masterstyle));
+ dns_zone_setfile(raw, filename, masterformat, masterstyle);
signedname = isc_mem_get(mctx, signedlen);
(void)snprintf(signedname, signedlen, "%s" SIGNED, filename);
- result = dns_zone_setfile(zone, signedname,
- dns_masterformat_raw, NULL);
+ dns_zone_setfile(zone, signedname, dns_masterformat_raw, NULL);
isc_mem_put(mctx, signedname, signedlen);
- CHECK(result);
} else {
- CHECK(dns_zone_setfile(zone, filename, masterformat,
- masterstyle));
+ dns_zone_setfile(zone, filename, masterformat, masterstyle);
}
obj = NULL;
result = cfg_map_get(zoptions, "journal", &obj);
if (result == ISC_R_SUCCESS) {
- CHECK(dns_zone_setjournal(mayberaw, cfg_obj_asstring(obj)));
+ dns_zone_setjournal(mayberaw, cfg_obj_asstring(obj));
}
/*
result = named_config_get(maps, "key-directory", &obj);
if (result == ISC_R_SUCCESS) {
filename = cfg_obj_asstring(obj);
- CHECK(dns_zone_setkeydirectory(zone, filename));
+ dns_zone_setkeydirectory(zone, filename);
}
/* Also save a reference to the keystore list. */
dns_zone_setkeystores(zone, keystorelist);
in_port_t udpport_low, udpport_high;
isc_result_t result;
- result = isc_portset_create(gmctx, &v4portset);
- check_result(result, "isc_portset_create (v4)");
+ isc_portset_create(gmctx, &v4portset);
result = isc_net_getudpportrange(AF_INET, &udpport_low, &udpport_high);
check_result(result, "isc_net_getudpportrange (v4)");
isc_portset_addrange(v4portset, udpport_low, udpport_high);
- result = isc_portset_create(gmctx, &v6portset);
- check_result(result, "isc_portset_create (v6)");
+ isc_portset_create(gmctx, &v6portset);
result = isc_net_getudpportrange(AF_INET6, &udpport_low, &udpport_high);
check_result(result, "isc_net_getudpportrange (v6)");
isc_portset_addrange(v6portset, udpport_low, udpport_high);
dns_zone_create(&raw, inst->mctx, 0); /* FIXME: all zones are assigned
to loop 0 */
- result = dns_zone_setorigin(raw, name);
- if (result != ISC_R_SUCCESS) {
- log_write(ISC_LOG_ERROR,
- "create_zone: dns_zone_setorigin -> %s\n",
- isc_result_totext(result));
- goto cleanup;
- }
+ dns_zone_setorigin(raw, name);
dns_zone_setclass(raw, dns_rdataclass_in);
dns_zone_settype(raw, dns_zone_primary);
dns_zone_setdbtype(raw, 1, zone_argv);
RUNCHECK(dns_requestmgr_create(mctx, loopmgr, dispatchmgr, dispatchv4,
NULL, &requestmgr));
- RUNCHECK(dns_view_create(mctx, loopmgr, NULL, 0, "_test", &view));
+ dns_view_create(mctx, loopmgr, NULL, 0, "_test", &view);
isc_loopmgr_setup(loopmgr, sendqueries, NULL);
isc_loopmgr_teardown(loopmgr, teardown_view, view);
in_port_t udpport_low, udpport_high;
isc_result_t result;
- result = isc_portset_create(mctx, &v4portset);
- if (result != ISC_R_SUCCESS) {
- fatal("isc_portset_create (v4) failed");
- }
-
+ isc_portset_create(mctx, &v4portset);
result = isc_net_getudpportrange(AF_INET, &udpport_low, &udpport_high);
if (result != ISC_R_SUCCESS) {
fatal("isc_net_getudpportrange (v4) failed");
isc_portset_addrange(v4portset, udpport_low, udpport_high);
- result = isc_portset_create(mctx, &v6portset);
- if (result != ISC_R_SUCCESS) {
- fatal("isc_portset_create (v6) failed");
- }
+ isc_portset_create(mctx, &v6portset);
result = isc_net_getudpportrange(AF_INET6, &udpport_low, &udpport_high);
if (result != ISC_R_SUCCESS) {
fatal("isc_net_getudpportrange (v6) failed");
mctx, loopmgr, dispatchmgr, have_ipv4 ? dispatchvx : NULL,
have_ipv6 ? dispatchvx : NULL, &requestmgr));
- RUNCHECK(dns_view_create(mctx, loopmgr, NULL, 0, "_mdig", &view));
+ dns_view_create(mctx, loopmgr, NULL, 0, "_mdig", &view);
}
/*% Main processing routine for mdig */
options = ISC_LEXOPT_EOL;
isc_lex_setcomments(lex, ISC_LEXCOMMENT_DNSMASTERFILE);
- RUNTIME_CHECK(isc_lex_openstream(lex, stdin) == ISC_R_SUCCESS);
+ isc_lex_openstream(lex, stdin);
if (origin != NULL) {
name = dns_fixedname_initname(&fixed);
isc_loopmgr_create(mctx, 1, &loopmgr);
- result = dns_view_create(mctx, loopmgr, NULL, dns_rdataclass_in, "view",
- &view);
- if (result != ISC_R_SUCCESS) {
- fprintf(stderr, "dns_view_create failed: %s\n",
- isc_result_totext(result));
- return 1;
- }
+ dns_view_create(mctx, loopmgr, NULL, dns_rdataclass_in, "view", &view);
dns_tsigkeyring_create(mctx, &ring);
dns_tsigkeyring_create(mctx, &emptyring);
dns_zone_create(&zone, mctx, 0);
- result = dns_zone_setorigin(zone, name);
- if (result != ISC_R_SUCCESS) {
- fprintf(stderr, "dns_zone_setorigin failed: %s\n",
- isc_result_totext(result));
- return 1;
- }
-
+ dns_zone_setorigin(zone, name);
dns_zone_setclass(zone, view->rdclass);
dns_zone_settype(zone, dns_zone_primary);
-
- result = dns_zone_setkeydirectory(zone, wd);
- if (result != ISC_R_SUCCESS) {
- fprintf(stderr, "dns_zone_setkeydirectory failed: %s\n",
- isc_result_totext(result));
- return 1;
- }
-
- result = dns_zone_setfile(zone, pathbuf, dns_masterformat_text,
- &dns_master_style_default);
- if (result != ISC_R_SUCCESS) {
- fprintf(stderr, "dns_zone_setfile failed: %s\n",
- isc_result_totext(result));
- return 1;
- }
+ dns_zone_setkeydirectory(zone, wd);
+ dns_zone_setfile(zone, pathbuf, dns_masterformat_text,
+ &dns_master_style_default);
result = dns_zone_load(zone, false);
if (result != ISC_R_SUCCESS) {
sizeof(sockaddr));
}
} else {
- result = dns_ipkeylist_resize(mctx, ipkl, i + 1);
- if (result != ISC_R_SUCCESS) {
- return result;
- }
+ dns_ipkeylist_resize(mctx, ipkl, i + 1);
ipkl->labels[i] = isc_mem_get(mctx,
sizeof(*ipkl->labels[0]));
rcount = dns_rdataset_count(value) + ipkl->count;
- result = dns_ipkeylist_resize(mctx, ipkl, rcount);
- if (result != ISC_R_SUCCESS) {
- return result;
- }
+ dns_ipkeylist_resize(mctx, ipkl, rcount);
for (result = dns_rdataset_first(value); result == ISC_R_SUCCESS;
result = dns_rdataset_next(value))
in_port_t udpport_low, udpport_high;
isc_result_t result;
- result = isc_portset_create(mctx, &v4portset);
- if (result != ISC_R_SUCCESS) {
- goto cleanup;
- }
+ isc_portset_create(mctx, &v4portset);
result = isc_net_getudpportrange(AF_INET, &udpport_low, &udpport_high);
if (result != ISC_R_SUCCESS) {
goto cleanup;
}
isc_portset_addrange(v4portset, udpport_low, udpport_high);
- result = isc_portset_create(mctx, &v6portset);
- if (result != ISC_R_SUCCESS) {
- goto cleanup;
- }
+ isc_portset_create(mctx, &v6portset);
result = isc_net_getudpportrange(AF_INET6, &udpport_low, &udpport_high);
if (result != ISC_R_SUCCESS) {
goto cleanup;
isc_result_t result;
dns_view_t *view = NULL;
- result = dns_view_create(mctx, loopmgr, dispatchmgr, rdclass,
- DNS_CLIENTVIEW_NAME, &view);
- if (result != ISC_R_SUCCESS) {
- return result;
- }
+ dns_view_create(mctx, loopmgr, dispatchmgr, rdclass,
+ DNS_CLIENTVIEW_NAME, &view);
/* Initialize view security roots */
dns_view_initsecroots(view);
/* Create it */
dns_zone_create(&zone, view->mctx, 0);
- result = dns_zone_setorigin(zone, origin);
- if (result != ISC_R_SUCCESS) {
- goto cleanup;
- }
+ dns_zone_setorigin(zone, origin);
dns_zone_setview(zone, view);
dns_zone_setadded(zone, true);
ISC_LINK(dns_dns64_t) link;
};
-isc_result_t
+void
dns_dns64_create(isc_mem_t *mctx, const isc_netaddr_t *prefix,
unsigned int prefixlen, const isc_netaddr_t *suffix,
dns_acl_t *clients, dns_acl_t *mapped, dns_acl_t *excluded,
dns64->mctx = NULL;
isc_mem_attach(mctx, &dns64->mctx);
*dns64p = dns64;
- return ISC_R_SUCCESS;
}
void
(void)dns_name_downcase(owner, name, NULL);
md = isc_md_new();
- if (md == NULL) {
- return ISC_R_NOMEMORY;
- }
result = isc_md_init(md, md_type);
if (result != ISC_R_SUCCESS) {
}
}
-isc_result_t
+void
dns_dyndb_createctx(isc_mem_t *mctx, const void *hashinit, dns_view_t *view,
dns_zonemgr_t *zmgr, isc_loopmgr_t *loopmgr,
dns_dyndbctx_t **dctxp) {
dctx->magic = DNS_DYNDBCTX_MAGIC;
*dctxp = dctx;
-
- return ISC_R_SUCCESS;
}
void
*\li #ISC_R_NOMORE Addresses might have been returned, but no events
* will ever be posted for this context. This is only
* returned if task != NULL.
- *\li #ISC_R_NOMEMORY insufficient resources
*\li #DNS_R_ALIAS 'name' is an alias for another name.
*
* Notes:
*
* Returns:
*\li #ISC_R_SUCCESS
- *\li #ISC_R_NOMEMORY
*\li #ISC_R_SHUTTINGDOWN
*/
* Returns:
*
*\li #ISC_R_SUCCESS
- *\li #ISC_R_NOMEMORY
*/
void
*
* Returns:
*\li #ISC_R_SUCCESS
- *\li #ISC_R_NOMEMORY
*/
isc_result_t
*
* Returns:
*\li #ISC_R_SUCCESS
- *\li #ISC_R_NOMEMORY
*\li other error returns.
*/
*
* Returns:
*\li #ISC_R_SUCCESS
- *\li #ISC_R_NOMEMORY
*\li other error returns.
*/
*
* Returns:
* \li ISC_R_SUCCESS on success
- * \li ISC_R_NOMEMORY on allocation failure
*/
dns_catz_entry_t *
*
* Returns:
* \li ISC_R_SUCCESS on success
- * \li ISC_R_NOMEMORY on allocation failure
*/
void
* Returns:
*
* \li #ISC_R_SUCCESS
- * \li #ISC_R_NOMEMORY
* \li #ISC_R_NOTFOUND db_type not found
*
* \li Many other errors are possible, depending on what db_type was
* Returns:
*
* \li #ISC_R_SUCCESS
- * \li #ISC_R_NOMEMORY
*
* \li Other results are possible, depending upon the database
* implementation used, syntax errors in the master file, etc.
* Returns:
*
* \li #ISC_R_SUCCESS
- * \li #ISC_R_NOMEMORY
*
* \li Other results are possible, depending upon the database
* implementation used, syntax errors in the master file, etc.
* Returns:
*
* \li #ISC_R_SUCCESS
- * \li #ISC_R_NOMEMORY
*
* \li Other results are possible, depending upon the database
* implementation used, syntax errors in the master file, etc.
* Returns:
*
* \li #ISC_R_SUCCESS
- * \li #ISC_R_NOMEMORY
*
* \li Other results are possible, depending upon the database
* implementation used, OS file errors, etc.
* Returns:
*
* \li #ISC_R_SUCCESS
- * \li #ISC_R_NOMEMORY
*
* \li Other results are possible, depending upon the database
* implementation used.
*
* \li #ISC_R_SUCCESS
* \li #ISC_R_NOTFOUND If !create and name not found.
- * \li #ISC_R_NOMEMORY Can only happen if create is true.
*
* \li Other results are possible, depending upon the database
* implementation used.
*
* Error results:
*
- * \li #ISC_R_NOMEMORY
- *
* \li #DNS_R_BADDB Data that is required to be
* present in the DB, e.g. an NSEC
* record in a secure zone, is not
* Returns:
*
* \li #ISC_R_SUCCESS
- * \li #ISC_R_NOMEMORY
*/
/***
* Returns:
*
* \li #ISC_R_SUCCESS
- * \li #DNS_R_UNCHANGED The operation did not change
- * anything. \li #ISC_R_NOMEMORY \li #DNS_R_NOTEXACT
+ * \li #DNS_R_UNCHANGED The operation did not change anything.
+ * \li #DNS_R_NOTEXACT
*
* \li Other results are possible, depending upon the database
* implementation used.
*
* Returns:
* \li #ISC_R_SUCCESS The registration succeeded
- * \li #ISC_R_NOMEMORY Out of memory
* \li #ISC_R_EXISTS A database implementation with the same name exists
*
* Ensures:
*
* \li #ISC_R_SUCCESS
* \li #ISC_R_NOTFOUND If !create and name not found.
- * \li #ISC_R_NOMEMORY Can only happen if create is true.
*
* \li Other results are possible, depending upon the database
* implementation used.
*
* Returns:
* \li #ISC_R_SUCCESS
- * \li #ISC_R_NOMEMORY
* \li #ISC_R_NOTIMPLEMENTED - Not supported by this DB implementation.
*/
*
* Returns:
*\li #ISC_R_SUCCESS
- *\li #ISC_R_NOMEMORY
- *\li #ISC_R_UNEXPECTED
*\li any error from dns_rdataset_totext()
*/
* Returns:
*
*\li ISC_R_SUCCESS -- all is well.
- *\li ISC_R_NOMEMORY -- memory could not be allocated.
*\li ISC_R_NOMORE -- no more message ids can be allocated
* for this destination.
*/
#define DNS_DNS64_RECURSIVE 0x01 /* Recursive query. */
#define DNS_DNS64_DNSSEC 0x02 /* DNSSEC sensitive query. */
-isc_result_t
+void
dns_dns64_create(isc_mem_t *mctx, const isc_netaddr_t *prefix,
unsigned int prefixlen, const isc_netaddr_t *suffix,
dns_acl_t *client, dns_acl_t *mapped, dns_acl_t *excluded,
* 'client' to be NULL or a valid acl.
* 'mapped' to be NULL or a valid acl.
* 'excluded' to be NULL or a valid acl.
- *
- * Returns:
- * ISC_R_SUCCESS
- * ISC_R_NOMEMORY
*/
void
*
* Returns:
*\li #ISC_R_SUCCESS
- *\li #ISC_R_NOMEMORY
*\li DST_R_INVALIDPUBLICKEY
*\li various errors from dns_name_totext
*/
*
* Returns:
*\li #ISC_R_SUCCESS
- *\li #ISC_R_NOMEMORY
*\li #ISC_R_NOSPACE
*\li #DNS_R_INVALIDTIME - the expiration is before the inception
*\li #DNS_R_KEYUNAUTHORIZED - the key cannot sign this data (either
*
* Returns:
*\li #ISC_R_SUCCESS
- *\li #ISC_R_NOMEMORY
*\li #DNS_R_FROMWILDCARD - the signature is valid and is from
* a wildcard expansion. dns_dnssec_verify2() only.
* 'wild' contains the name of the wildcard if non-NULL.
*
* Returns:
*\li #ISC_R_SUCCESS
- *\li #ISC_R_NOMEMORY
*\li DST_R_*
*/
*
* Returns:
*\li #ISC_R_SUCCESS
- *\li #ISC_R_NOMEMORY
*\li #ISC_R_NOTFOUND - no SIG(0) was found
*\li #DNS_R_SIGINVALID - the SIG record is not well-formed or
* was not generated by the key.
* Returns:
*\li #ISC_R_SUCCESS
*\li #ISC_R_NOTFOUND
- *\li #ISC_R_NOMEMORY
*\li any error returned by dns_name_totext(), isc_dir_open(), or
* dst_key_fromnamedfile()
*
*
* Returns:
*\li #ISC_R_SUCCESS
- *\li #ISC_R_NOMEMORY
*\li Other errors are possible
*/
*
* Returns:
*\li #ISC_R_SUCCESS
- *\li #ISC_R_NOMEMORY
*\li Other errors are possible
*/
* as opposed to merely being reconfigured.
*/
-isc_result_t
+void
dns_dyndb_createctx(isc_mem_t *mctx, const void *hashinit, dns_view_t *view,
dns_zonemgr_t *zmgr, isc_loopmgr_t *loopmgr,
dns_dyndbctx_t **dctxp);
* etc). This structure is expected to last only until all dyndb
* modules have been loaded and initialized; after that it will be
* destroyed with dns_dyndb_destroyctx().
- *
- * Returns:
- *\li #ISC_R_SUCCESS
- *\li #ISC_R_NOMEMORY
- *\li Other errors are possible
*/
void
*
* Returns:
* \li #ISC_R_SUCCESS
- * \li #ISC_R_NOMEMORY
+ * \li other errors from dns_qp_insert()
*/
isc_result_t
*\li #ISC_R_SUCCESS -- success
*\li any other value -- failure
*/
-isc_result_t
+
+void
dns_ipkeylist_resize(isc_mem_t *mctx, dns_ipkeylist_t *ipkl, unsigned int n);
/*%<
* Resize ipkl to contain n elements. Size (count) is not changed, and the
* \li 'mctx' to be a valid memory context.
* \li 'ipk' to be non NULL
* \li 'n' >= ipkl->count
- *
- * Returns:
- * \li #ISC_R_SUCCESS if success
- * \li #ISC_R_NOMEMORY if there's no memory, ipkeylist is left untouched
*/
#define DNS_KASP_KEY_ROLE_KSK 0x01
#define DNS_KASP_KEY_ROLE_ZSK 0x02
-isc_result_t
+void
dns_kasp_create(isc_mem_t *mctx, const char *name, dns_kasp_t **kaspp);
/*%<
* Create a KASP.
*\li kaspp != NULL && *kaspp == NULL
*
* Returns:
- *
- *\li #ISC_R_SUCCESS
- *\li #ISC_R_NOMEMORY
- *
- *\li Other errors are possible.
*/
void
* Requires:
*
*\li 'kasp' is a valid, frozen kasp.
- *
- * Returns:
- *
- *\li #ISC_R_SUCCESS
- *\li #ISC_R_NOMEMORY
- *
- *\li Other errors are possible.
*/
bool
*\li 'key' is not NULL.
*/
-isc_result_t
+void
dns_kasp_key_create(dns_kasp_t *kasp, dns_kasp_key_t **keyp);
/*%<
* Create a key inside a KASP.
*\li 'kasp' is a valid kasp.
*
*\li keyp != NULL && *keyp == NULL
- *
- * Returns:
- *
- *\li #ISC_R_SUCCESS
- *\li #ISC_R_NOMEMORY
- *
- *\li Other errors are possible.
*/
void
* Requires:
*
*\li 'kasp' is a valid, frozen kasp.
- *
- * Returns:
- *
- *\li #ISC_R_SUCCESS
- *\li #ISC_R_NOMEMORY
- *
- *\li Other errors are possible.
*/
void
#define DNS_KEYSTORE_KEYDIRECTORY "key-directory"
-isc_result_t
+void
dns_keystore_create(isc_mem_t *mctx, const char *name, dns_keystore_t **kspp);
/*%<
* Create a key store.
*\li 'name' is a valid C string.
*
*\li kspp != NULL && *kspp == NULL
- *
- * Returns:
- *
- *\li #ISC_R_SUCCESS
- *\li #ISC_R_NOMEMORY
- *
- *\li Other errors are possible.
*/
const char *
*\li ISC_R_SUCCESS upon successfully loading the master file.
*\li DNS_R_SEENINCLUDE upon successfully loading the master file with
* a $INCLUDE statement.
- *\li ISC_R_NOMEMORY out of memory.
*\li ISC_R_UNEXPECTEDEND expected to be able to read a input token and
* there was not one.
*\li ISC_R_UNEXPECTED
*
* Returns:
*\li ISC_R_SUCCESS
- *\li ISC_R_NOMEMORY
*\li Any database or rrset iterator error.
*\li Any dns_rdata_totext() error code.
*/
*
* Returns:
*\li ISC_R_SUCCESS
- *\li ISC_R_NOMEMORY
*\li Any database or rrset iterator error.
*\li Any dns_rdata_totext() error code.
*/
*
* Returns:
*\li #ISC_R_SUCCESS -- all is well
- *\li #ISC_R_NOMEMORY -- no memory
*\li #DNS_R_RECOVERABLE -- the message parsed properly, but contained
* errors.
*\li Many other errors possible XXXMLG
* Returns:
*
*\li #ISC_R_SUCCESS
- *\li #ISC_R_NOMEMORY
+ *\li any return code from dns_rdataset_first()
*
* Ensures:
*\li 'tsig' points to NULL or an allocated buffer which must be freed
* \li opt to be a non NULL and *opt to be NULL.
*
* Returns:
- * \li ISC_R_SUCCESS on success.
- * \li ISC_R_NOMEMORY
+ * \li ISC_R_SUCCESS
* \li ISC_R_NOSPACE
- * \li other.
*/
void
* Returns:
*
*\li ISC_R_SUCCESS
- *\li ISC_R_NOMEMORY
- *
*\li Any error that dns_name_totext() can return.
*/
#include <dns/types.h>
-isc_result_t
+void
dns_order_create(isc_mem_t *mctx, dns_order_t **orderp);
/*%<
* Create a order object.
* Requires:
* \li 'orderp' to be non NULL and '*orderp == NULL'.
*\li 'mctx' to be valid.
- *
- * Returns:
- *\li ISC_R_SUCCESS
- *\li ISC_R_NOMEMORY
*/
-isc_result_t
+void
dns_order_add(dns_order_t *order, const dns_name_t *name,
dns_rdatatype_t rdtype, dns_rdataclass_t rdclass,
unsigned int mode);
*\li 'name' to be valid.
*\li 'mode' to be one of #DNS_RDATASETATTR_RANDOMIZE,
* #DNS_RDATASETATTR_FIXEDORDER or zero (#DNS_RDATASETATTR_CYCLIC).
- *
- * Returns:
- *\li #ISC_R_SUCCESS
- *\li #ISC_R_NOMEMORY
*/
unsigned int
*** Functions
***/
-isc_result_t
+void
dns_peerlist_new(isc_mem_t *mem, dns_peerlist_t **list);
void
*
* Returns:
*\li ISC_R_SUCCESS - successful completion
- *\li ISC_R_NOMEMORY - no memory.
- *\li XXX others
+ *\li ISC_R_NOSPACE - more than 64k RRs
+ *\li DNS_R_TOOMANYRECORDS - more than max-records-per-rrset RRs
+ *\li DNS_R_SINGLETON - singleton type has more than one RR
*/
unsigned int
* Returns:
*\li #ISC_R_SUCCESS
*\li #ISC_R_RANGE
- *\li #ISC_R_NOMEMORY
*/
isc_result_t
* Returns:
*\li #ISC_R_SUCCESS
*\li #ISC_R_RANGE
- *\li #ISC_R_NOMEMORY
*/
bool
* Returns:
*
* \li #ISC_R_SUCCESS
- * \li #ISC_R_NOMEMORY
+ * \li any error from dns_db_createiterator()
*/
isc_result_t
* Requires:
*\li 'mctx' is a valid memory context
*\li 'table' is not NULL, and '*table' is NULL
- *
- * Returns:
- *\li ISC_R_SUCCESS
- *\li ISC_R_NOMEMORY
*/
void
*\li 'name' is a valid absolute name
*\li If 'ntypes' > 0, 'types' must not be NULL
*\li 'debug' must not be NULL
- *
- * Returns:
- *\li ISC_R_SUCCESS
- *\li ISC_R_NOMEMORY
*/
bool
char *gssapi_keytab;
};
-isc_result_t
+void
dns_tkeyctx_create(isc_mem_t *mctx, dns_tkeyctx_t **tctxp);
/*%<
* Create an empty TKEY context.
*
* Requires:
*\li 'mctx' is not NULL
- *\li 'tctx' is not NULL
- *\li '*tctx' is NULL
- *
- * Returns
- *\li #ISC_R_SUCCESS
- *\li #ISC_R_NOMEMORY
- *\li return codes from dns_name_fromtext()
+ *\li 'tctxp' is not NULL
+ *\li '*tctxp' is NULL
*/
void
*\li #ISC_R_SUCCESS
*\li #ISC_R_EXISTS - a key with this name already exists
*\li #ISC_R_NOTIMPLEMENTED - algorithm is not implemented
- *\li #ISC_R_NOMEMORY
*/
void
*
* Returns:
*\li #ISC_R_SUCCESS
- *\li #ISC_R_NOMEMORY
*\li #ISC_R_NOSPACE
*\li #DNS_R_EXPECTEDTSIG
* - this is a response & msg->querytsig is NULL
*
* Returns:
*\li #ISC_R_SUCCESS
- *\li #ISC_R_NOMEMORY
*\li #DNS_R_EXPECTEDTSIG - A TSIG was expected but not seen
*\li #DNS_R_UNEXPECTEDTSIG - A TSIG was seen but not expected
*\li #DNS_R_TSIGERRORSET - the TSIG verified but ->error was set
#endif /* __OpenBSD__ */
#endif /* HAVE_LMDB */
-isc_result_t
+void
dns_view_create(isc_mem_t *mctx, isc_loopmgr_t *loopmgr,
dns_dispatchmgr_t *dispmgr, dns_rdataclass_t rdclass,
const char *name, dns_view_t **viewp);
*\li 'name' is a valid C string.
*
*\li viewp != NULL && *viewp == NULL
- *
- * Returns:
- *
- *\li #ISC_R_SUCCESS
- *\li #ISC_R_NOMEMORY
- *
- *\li Other errors are possible.
*/
void
*
* Returns:
*\li #ISC_R_SUCCESS
- *\li #ISC_R_NOMEMORY
+ * other returns are failures.
*/
isc_result_t
*\li 'zone' to be a valid zone.
*/
-isc_result_t
+void
dns_zone_setorigin(dns_zone_t *zone, const dns_name_t *origin);
/*%<
* Sets the zones origin to 'origin'.
*
* Returns:
*\li #ISC_R_SUCCESS
- *\li #ISC_R_NOMEMORY
*/
dns_name_t *
*\li 'zone' to be a valid zone.
*/
-isc_result_t
+void
dns_zone_setfile(dns_zone_t *zone, const char *file, dns_masterformat_t format,
const dns_master_style_t *style);
/*%<
*
* Require:
*\li 'zone' to be a valid zone.
- *
- * Returns:
- *\li #ISC_R_NOMEMORY
- *\li #ISC_R_SUCCESS
*/
const char *
*\li Pointer to null-terminated file name, or NULL.
*/
-isc_result_t
+void
dns_zone_setstream(dns_zone_t *zone, const FILE *stream,
dns_masterformat_t format, const dns_master_style_t *style);
/*%<
*\li 'stream' to be a valid and open FILE *.
*\li 'zone->masterfile' to be NULL, since we should load data either from
* 'stream' or from a master file, but not both.
- *
- * Returns:
- *\li #ISC_R_NOMEMORY
- *\li #ISC_R_SUCCESS
*/
void
*\li #ISC_R_ALREADYRUNNING
*\li #ISC_R_SUCCESS
*\li #ISC_R_FAILURE
- *\li #ISC_R_NOMEMORY
*/
bool
*\li 'dbargv' to point to dbargc NULL-terminated strings
*/
-isc_result_t
+void
dns_zone_getdbtype(dns_zone_t *zone, char ***argv, isc_mem_t *mctx);
/*%<
* Returns the current dbtype. isc_mem_free() should be used
*\li 'zone' to be a valid zone.
*\li 'argv' to be non NULL and *argv to be NULL.
*\li 'mctx' to be valid.
- *
- * Returns:
- *\li #ISC_R_NOMEMORY
- *\li #ISC_R_SUCCESS
*/
void
*\li 'keynames' array of dns_name_t's for tsig keys or NULL.
*
*\li If 'addresses' is NULL then 'count' must be zero.
- *
- * Returns:
- *\li #ISC_R_SUCCESS
- *\li #ISC_R_NOMEMORY
- *\li Any result dns_name_dup() can return, if keynames!=NULL
*/
void
*\li 'keynames' array of dns_name_t's for tsig keys or NULL.
*
*\li If 'addresses' is NULL then 'count' must be zero.
- *
- * Returns:
- *\li #ISC_R_SUCCESS
- *\li #ISC_R_NOMEMORY
- *\li Any result dns_name_dup() can return, if keynames!=NULL
*/
void
*\li 'zone' to be a valid zone.
*\li 'addresses' to be non-NULL if count != 0.
*\li 'count' to be the number of notifiees.
- *
- * Returns:
- *\li #ISC_R_SUCCESS
- *\li #ISC_R_NOMEMORY
*/
void
*\li 'zone' to be valid initialised zone.
*/
-isc_result_t
+void
dns_zone_setjournal(dns_zone_t *zone, const char *myjournal);
/*%<
* Sets the filename used for journaling updates / IXFR transfers.
*
* Requires:
*\li 'zone' to be a valid zone.
- *
- * Returns:
- *\li #ISC_R_SUCCESS
- *\li #ISC_R_NOMEMORY
*/
char *
*\li 'callback' to be non NULL.
* Returns:
*\li #ISC_R_SUCCESS if the message has been forwarded,
- *\li #ISC_R_NOMEMORY
*\li Others
*/
* (result ISC_R_NOMORE).
*/
-isc_result_t
+void
dns_zone_setkeydirectory(dns_zone_t *zone, const char *directory);
/*%<
* Sets the name of the directory where private keys used for
*
* Require:
*\li 'zone' to be a valid zone.
- *
- * Returns:
- *\li #ISC_R_NOMEMORY
- *\li #ISC_R_SUCCESS
*/
const char *
*
* Returns:
* \li ISC_R_SUCCESS
- * \li ISC_R_NOMEMORY
+ * \li DST_R_UNSUPPORTEDALG
+ * \li DST_R_NULLKEY
+ * \li Other errors are possible.
*
* Ensures:
* \li *dctxp will contain a usable context.
*
* Returns:
* ISC_R_SUCCESS
- * ISC_R_NOMEMORY
* ISC_R_NOTIMPLEMENTED
* others.
*/
isc_result_t
dns_ipkeylist_copy(isc_mem_t *mctx, const dns_ipkeylist_t *src,
dns_ipkeylist_t *dst) {
- isc_result_t result = ISC_R_SUCCESS;
uint32_t i;
REQUIRE(dst != NULL);
return ISC_R_SUCCESS;
}
- result = dns_ipkeylist_resize(mctx, dst, src->count);
- if (result != ISC_R_SUCCESS) {
- return result;
- }
+ dns_ipkeylist_resize(mctx, dst, src->count);
memmove(dst->addrs, src->addrs, src->count * sizeof(isc_sockaddr_t));
return ISC_R_SUCCESS;
}
-isc_result_t
+void
dns_ipkeylist_resize(isc_mem_t *mctx, dns_ipkeylist_t *ipkl, unsigned int n) {
REQUIRE(ipkl != NULL);
REQUIRE(n > ipkl->count);
if (n <= ipkl->allocated) {
- return ISC_R_SUCCESS;
+ return;
}
ipkl->addrs = isc_mem_creget(mctx, ipkl->addrs, ipkl->allocated, n,
sizeof(ipkl->labels[0]));
ipkl->allocated = n;
- return ISC_R_SUCCESS;
}
* previously allocated by isc_mem_get().
*/
-static isc_result_t
+static void
size_buffer(isc_mem_t *mctx, isc_buffer_t *b, unsigned int size) {
if (b->length < size) {
void *mem = isc_mem_get(mctx, size);
- if (mem == NULL) {
- return ISC_R_NOMEMORY;
- }
if (b->base != NULL) {
isc_mem_put(mctx, b->base, b->length);
}
b->length = size;
}
isc_buffer_clear(b);
- return ISC_R_SUCCESS;
}
isc_result_t
FAIL(ISC_R_UNEXPECTED);
}
- CHECK(size_buffer(j->mctx, &j->it.source, rrhdr.size));
+ size_buffer(j->mctx, &j->it.source, rrhdr.size);
CHECK(journal_read(j, j->it.source.base, rrhdr.size));
isc_buffer_add(&j->it.source, rrhdr.size);
* no compression in present, the output of dns_*_fromwire()
* is no larger than the input.
*/
- CHECK(size_buffer(j->mctx, &j->it.target, rrhdr.size));
+ size_buffer(j->mctx, &j->it.target, rrhdr.size);
/*
* Parse the owner name. We don't know where it
/* Default TTLsig (maximum zone ttl) */
#define DEFAULT_TTLSIG 604800 /* one week */
-isc_result_t
+void
dns_kasp_create(isc_mem_t *mctx, const char *name, dns_kasp_t **kaspp) {
dns_kasp_t *kasp;
dns_kasp_t k = {
isc_refcount_init(&kasp->references, 1);
*kaspp = kasp;
- return ISC_R_SUCCESS;
}
void
ISC_LIST_APPEND(kasp->keys, key, link);
}
-isc_result_t
+void
dns_kasp_key_create(dns_kasp_t *kasp, dns_kasp_key_t **keyp) {
dns_kasp_key_t *key = NULL;
dns_kasp_key_t k = { .tag_max = 0xffff, .length = -1 };
ISC_LINK_INIT(key, link);
*keyp = key;
- return ISC_R_SUCCESS;
}
void
#include <dns/keystore.h>
#include <dns/keyvalues.h>
-isc_result_t
+void
dns_keystore_create(isc_mem_t *mctx, const char *name, dns_keystore_t **kspp) {
dns_keystore_t *keystore;
keystore->magic = DNS_KEYSTORE_MAGIC;
*kspp = keystore;
-
- return ISC_R_SUCCESS;
}
static inline void
else \
LOGIT(result)
-#define LOGIT(result) \
- if (result == ISC_R_NOMEMORY) \
- (*callbacks->error)(callbacks, "dns_master_load: %s", \
- isc_result_totext(result)); \
- else \
- (*callbacks->error)(callbacks, "%s: %s:%lu: %s", \
- "dns_master_load", source, line, \
- isc_result_totext(result))
+#define LOGIT(result) \
+ (*callbacks->error)(callbacks, "%s: %s:%lu: %s", "dns_master_load", \
+ source, line, isc_result_totext(result))
static unsigned char in_addr_arpa_data[] = "\007IN-ADDR\004ARPA";
static unsigned char in_addr_arpa_offsets[] = { 0, 8, 13 };
result = isc_lex_gettoken(lex, options, token);
if (result != ISC_R_SUCCESS) {
switch (result) {
- case ISC_R_NOMEMORY:
- return ISC_R_NOMEMORY;
default:
(*callbacks->error)(callbacks,
"dns_master_load: %s:%lu:"
target_mem = isc_mem_get(lctx->mctx, target_size);
rhsbuf = isc_mem_get(lctx->mctx, DNS_MASTER_RHS);
lhsbuf = isc_mem_get(lctx->mctx, DNS_MASTER_LHS);
- if (target_mem == NULL || rhsbuf == NULL || lhsbuf == NULL) {
- result = ISC_R_NOMEMORY;
- goto error_cleanup;
- }
isc_buffer_init(&target, target_mem, target_size);
n = sscanf(range, "%d-%d%1[/]%d", &start, &stop, dummy, &step);
goto cleanup;
error_cleanup:
- if (result == ISC_R_NOMEMORY) {
- (*callbacks->error)(callbacks, "$GENERATE: %s",
- isc_result_totext(result));
- } else {
- (*callbacks->error)(callbacks, "$GENERATE: %s:%lu: %s", source,
- line, isc_result_totext(result));
- }
+ (*callbacks->error)(callbacks, "$GENERATE: %s:%lu: %s", source, line,
+ isc_result_totext(result));
insist_cleanup:
INSIST(result != ISC_R_SUCCESS);
new_rdata = grow_rdata(rdata_size + RDSZ, rdata,
rdata_size, ¤t_list,
&glue_list, mctx);
- if (new_rdata == NULL) {
- result = ISC_R_NOMEMORY;
- goto log_and_cleanup;
- }
rdata_size += RDSZ;
rdata = new_rdata;
}
rdatalist_size + RDLSZ, rdatalist,
rdatalist_size, ¤t_list,
&glue_list, mctx);
- if (new_rdatalist == NULL) {
- result = ISC_R_NOMEMORY;
- goto log_and_cleanup;
- }
rdatalist = new_rdatalist;
rdatalist_size += RDLSZ;
}
new_rdata = grow_rdata(rdcount + RDSZ, rdata,
rdata_size, &head, &dummy, mctx);
- if (new_rdata == NULL) {
- result = ISC_R_NOMEMORY;
- goto cleanup;
- }
rdata_size = rdcount + RDSZ;
rdata = new_rdata;
}
loadctx_create(dns_masterformat_text, mctx, options, 0, top, zclass,
origin, callbacks, NULL, NULL, NULL, NULL, NULL, &lctx);
- result = isc_lex_openstream(lctx->lex, stream);
- if (result != ISC_R_SUCCESS) {
- goto cleanup;
- }
+ isc_lex_openstream(lctx->lex, stream);
result = (lctx->load)(lctx);
INSIST(result != DNS_R_CONTINUE);
-cleanup:
dns_loadctx_detach(&lctx);
return result;
}
}
result = callbacks->add(callbacks->add_private, owner,
&dataset DNS__DB_FILELINE);
- if (result == ISC_R_NOMEMORY) {
- (*error)(callbacks, "dns_master_load: %s",
- isc_result_totext(result));
- } else if (result != ISC_R_SUCCESS) {
+ if (result != ISC_R_SUCCESS) {
dns_name_format(owner, namebuf, sizeof(namebuf));
if (source != NULL) {
(*error)(callbacks, "%s: %s:%lu: %s: %s",
#define DNS_ORDER_MAGIC ISC_MAGIC('O', 'r', 'd', 'r')
#define DNS_ORDER_VALID(order) ISC_MAGIC_VALID(order, DNS_ORDER_MAGIC)
-isc_result_t
+void
dns_order_create(isc_mem_t *mctx, dns_order_t **orderp) {
- dns_order_t *order;
+ dns_order_t *order = NULL;
REQUIRE(orderp != NULL && *orderp == NULL);
order = isc_mem_get(mctx, sizeof(*order));
+ *order = (dns_order_t){
+ .ents = ISC_LIST_INITIALIZER,
+ .references = ISC_REFCOUNT_INITIALIZER(1),
+ .magic = DNS_ORDER_MAGIC,
+ };
- ISC_LIST_INIT(order->ents);
-
- /* Implicit attach. */
- isc_refcount_init(&order->references, 1);
-
- order->mctx = NULL;
isc_mem_attach(mctx, &order->mctx);
- order->magic = DNS_ORDER_MAGIC;
*orderp = order;
- return ISC_R_SUCCESS;
}
-isc_result_t
+void
dns_order_add(dns_order_t *order, const dns_name_t *name,
dns_rdatatype_t rdtype, dns_rdataclass_t rdclass,
unsigned int mode) {
- dns_order_ent_t *ent;
+ dns_order_ent_t *ent = NULL;
REQUIRE(DNS_ORDER_VALID(order));
REQUIRE(mode == DNS_RDATASETATTR_RANDOMIZE ||
mode == DNS_RDATASETATTR_NONE);
ent = isc_mem_get(order->mctx, sizeof(*ent));
+ *ent = (dns_order_ent_t){
+ .rdtype = rdtype,
+ .rdclass = rdclass,
+ .mode = mode,
+ .link = ISC_LINK_INITIALIZER,
+ };
dns_fixedname_init(&ent->name);
dns_name_copy(name, dns_fixedname_name(&ent->name));
- ent->rdtype = rdtype;
- ent->rdclass = rdclass;
- ent->mode = mode;
- ISC_LINK_INIT(ent, link);
+
ISC_LIST_INITANDAPPEND(order->ents, ent, link);
- return ISC_R_SUCCESS;
}
static bool
static void
peer_delete(dns_peer_t **peer);
-isc_result_t
+void
dns_peerlist_new(isc_mem_t *mem, dns_peerlist_t **list) {
dns_peerlist_t *l;
l->magic = DNS_PEERLIST_MAGIC;
*list = l;
-
- return ISC_R_SUCCESS;
}
void
}
rdatastr = isc_buffer_base(buffer);
- if (rdatastr == NULL) {
- result = ISC_R_NOMEMORY;
- goto cleanup;
- }
rdatastr[isc_buffer_usedlength(buffer) - 1] = 0;
MAYBE_LOCK(sdlz->dlzimp);
va_end(ap);
}
-isc_result_t
+void
dns_tkeyctx_create(isc_mem_t *mctx, dns_tkeyctx_t **tctxp) {
REQUIRE(mctx != NULL);
REQUIRE(tctxp != NULL && *tctxp == NULL);
isc_mem_attach(mctx, &tctx->mctx);
*tctxp = tctx;
- return ISC_R_SUCCESS;
}
void
*/
#define DEFAULT_EDNS_BUFSIZE 1232
-isc_result_t
+void
dns_view_create(isc_mem_t *mctx, isc_loopmgr_t *loopmgr,
dns_dispatchmgr_t *dispatchmgr, dns_rdataclass_t rdclass,
const char *name, dns_view_t **viewp) {
REQUIRE(viewp != NULL && *viewp == NULL);
result = isc_file_sanitize(NULL, name, "nta", buffer, sizeof(buffer));
- if (result != ISC_R_SUCCESS) {
- return result;
- }
+ RUNTIME_CHECK(result == ISC_R_SUCCESS);
view = isc_mem_get(mctx, sizeof(*view));
*view = (dns_view_t){
isc_mutex_init(&view->new_zone_lock);
- result = dns_order_create(view->mctx, &view->order);
- if (result != ISC_R_SUCCESS) {
- goto cleanup_new_zone_lock;
- }
+ dns_order_create(view->mctx, &view->order);
- result = dns_peerlist_new(view->mctx, &view->peers);
- if (result != ISC_R_SUCCESS) {
- goto cleanup_order;
- }
+ dns_peerlist_new(view->mctx, &view->peers);
dns_aclenv_create(view->mctx, &view->aclenv);
view->magic = DNS_VIEW_MAGIC;
*viewp = view;
-
- return ISC_R_SUCCESS;
-
-cleanup_order:
- if (view->order != NULL) {
- dns_order_detach(&view->order);
- }
-
-cleanup_new_zone_lock:
- isc_mutex_destroy(&view->new_zone_lock);
- dns_badcache_destroy(&view->failcache);
-
- if (view->dynamickeys != NULL) {
- dns_tsigkeyring_detach(&view->dynamickeys);
- }
-
- isc_refcount_decrementz(&view->weakrefs);
- isc_refcount_destroy(&view->weakrefs);
-
- isc_refcount_decrementz(&view->references);
- isc_refcount_destroy(&view->references);
-
- dns_fwdtable_destroy(&view->fwdtable);
- dns_zt_detach(&view->zonetable);
-
- isc_mutex_destroy(&view->lock);
-
- if (view->nta_file != NULL) {
- isc_mem_free(mctx, view->nta_file);
- }
-
- isc_mem_free(mctx, view->name);
- isc_mem_putanddetach(&view->mctx, view, sizeof(*view));
-
- return result;
}
static void
zone_catz_enable(dns_zone_t *zone, dns_catz_zones_t *catzs);
static void
zone_catz_disable(dns_zone_t *zone);
-static isc_result_t
+static void
default_journal(dns_zone_t *zone);
static void
zone_xfrdone(dns_zone_t *zone, uint32_t *expireopt, isc_result_t result);
zone->db_argv = NULL;
}
-isc_result_t
+void
dns_zone_getdbtype(dns_zone_t *zone, char ***argv, isc_mem_t *mctx) {
size_t size = 0;
unsigned int i;
- isc_result_t result = ISC_R_SUCCESS;
void *mem;
char **tmp, *tmp2, *base;
}
UNLOCK_ZONE(zone);
*argv = mem;
- return result;
}
void
UNLOCK_ZONE(zone);
}
-isc_result_t
+void
dns_zone_setorigin(dns_zone_t *zone, const dns_name_t *origin) {
- isc_result_t result = ISC_R_SUCCESS;
char namebuf[1024];
REQUIRE(DNS_ZONE_VALID(zone));
zone->strname = isc_mem_strdup(zone->mctx, namebuf);
if (inline_secure(zone)) {
- result = dns_zone_setorigin(zone->raw, origin);
+ dns_zone_setorigin(zone->raw, origin);
}
UNLOCK_ZONE(zone);
- return result;
}
-static isc_result_t
-dns_zone_setstring(dns_zone_t *zone, char **field, const char *value) {
+static void
+setstring(dns_zone_t *zone, char **field, const char *value) {
char *copy;
if (value != NULL) {
}
*field = copy;
- return ISC_R_SUCCESS;
}
-isc_result_t
+void
dns_zone_setfile(dns_zone_t *zone, const char *file, dns_masterformat_t format,
const dns_master_style_t *style) {
- isc_result_t result = ISC_R_SUCCESS;
-
REQUIRE(DNS_ZONE_VALID(zone));
REQUIRE(zone->stream == NULL);
LOCK_ZONE(zone);
- result = dns_zone_setstring(zone, &zone->masterfile, file);
- if (result == ISC_R_SUCCESS) {
- zone->masterformat = format;
- if (format == dns_masterformat_text) {
- zone->masterstyle = style;
- }
- result = default_journal(zone);
+ setstring(zone, &zone->masterfile, file);
+ zone->masterformat = format;
+ if (format == dns_masterformat_text) {
+ zone->masterstyle = style;
}
+ default_journal(zone);
UNLOCK_ZONE(zone);
-
- return result;
}
const char *
return zone->masterfile;
}
-isc_result_t
+void
dns_zone_setstream(dns_zone_t *zone, const FILE *stream,
dns_masterformat_t format, const dns_master_style_t *style) {
- isc_result_t result = ISC_R_SUCCESS;
-
REQUIRE(DNS_ZONE_VALID(zone));
REQUIRE(stream != NULL);
REQUIRE(zone->masterfile == NULL);
if (format == dns_masterformat_text) {
zone->masterstyle = style;
}
- result = default_journal(zone);
+ default_journal(zone);
UNLOCK_ZONE(zone);
-
- return result;
}
dns_ttl_t
return;
}
-static isc_result_t
+static void
default_journal(dns_zone_t *zone) {
- isc_result_t result;
char *journal;
REQUIRE(DNS_ZONE_VALID(zone));
} else {
journal = NULL;
}
- result = dns_zone_setstring(zone, &zone->journal, journal);
+ setstring(zone, &zone->journal, journal);
if (journal != NULL) {
isc_mem_free(zone->mctx, journal);
}
- return result;
}
-isc_result_t
+void
dns_zone_setjournal(dns_zone_t *zone, const char *myjournal) {
- isc_result_t result = ISC_R_SUCCESS;
-
REQUIRE(DNS_ZONE_VALID(zone));
LOCK_ZONE(zone);
- result = dns_zone_setstring(zone, &zone->journal, myjournal);
+ setstring(zone, &zone->journal, myjournal);
UNLOCK_ZONE(zone);
-
- return result;
}
char *
{
DNS_ZONE_SETFLAG(zone, DNS_ZONEFLG_FIRSTREFRESH);
- if (result != ISC_R_NOMEMORY) {
- if (zone->journal != NULL) {
- zone_saveunique(zone, zone->journal,
- "jn-XXXXXXXX");
- }
- if (zone->masterfile != NULL) {
- zone_saveunique(zone, zone->masterfile,
- "db-XXXXXXXX");
- }
+ if (zone->journal != NULL) {
+ zone_saveunique(zone, zone->journal, "jn-XXXXXXXX");
+ }
+ if (zone->masterfile != NULL) {
+ zone_saveunique(zone, zone->masterfile, "db-XXXXXXXX");
}
/* Mark the zone for immediate refresh. */
}
}
-isc_result_t
+void
dns_zone_setkeydirectory(dns_zone_t *zone, const char *directory) {
- isc_result_t result = ISC_R_SUCCESS;
-
REQUIRE(DNS_ZONE_VALID(zone));
LOCK_ZONE(zone);
- result = dns_zone_setstring(zone, &zone->keydirectory, directory);
+ setstring(zone, &zone->keydirectory, directory);
UNLOCK_ZONE(zone);
-
- return result;
}
const char *
isc_result_t
isc_file_splitpath(isc_mem_t *mctx, const char *path, char **dirname,
char const **bname) {
- char *dir;
- const char *file, *slash;
+ char *dir = NULL;
+ const char *file = NULL, *slash = NULL;
if (path == NULL) {
return ISC_R_INVALIDFILE;
dir = isc_mem_strdup(mctx, ".");
}
- if (dir == NULL) {
- return ISC_R_NOMEMORY;
- }
-
if (*file == '\0') {
isc_mem_free(mctx, dir);
return ISC_R_INVALIDFILE;
*
* Returns:
*\li #ISC_R_SUCCESS -- all is well.
- *\li #ISC_R_NOMEMORY -- not enough memory to compress data
*\li #ISC_R_FAILURE -- error during compression or compressed
* data would be larger than input data
*/
*\li #ISC_R_SUCCESS Operation succeeded.
*\li #ISC_R_NOSPACE 'b' does not allow reallocation and appending the
* formatted string to it would cause it to overflow.
- *\li #ISC_R_NOMEMORY Reallocation failed.
*\li #ISC_R_FAILURE Other error occurred.
*/
* Returns:
* - ISC_R_SUCCESS on success
* - ISC_R_INVALIDFILE if 'path' is empty or ends with '/'
- * - ISC_R_NOMEMORY if unable to allocate memory
*/
isc_result_t
*\li write-lock
*
* Returns:
- *\li #ISC_R_NOMEMORY -- not enough memory to create pool
*\li #ISC_R_EXISTS -- node of the same key already exists
*\li #ISC_R_SUCCESS -- all is well.
*/
*
* Returns:
*\li #ISC_R_SUCCESS
- * \li #ISC_R_NOMEMORY
*\li Various network-related errors
*/
*
* Ensures:
*\li On success, *lexp is attached to the newly created lexer.
- *
- * Returns:
- *\li #ISC_R_SUCCESS
- *\li #ISC_R_NOMEMORY
*/
void
*
* Returns:
*\li #ISC_R_SUCCESS
- *\li #ISC_R_NOMEMORY Out of memory
*\li #ISC_R_NOTFOUND File not found
*\li #ISC_R_NOPERM No permission to open file
*\li #ISC_R_FAILURE Couldn't open file, not sure why
*\li #ISC_R_UNEXPECTED
*/
-isc_result_t
+void
isc_lex_openstream(isc_lex_t *lex, FILE *stream);
/*%<
* Make 'stream' the current input source for 'lex'.
*\li 'lex' is a valid lexer.
*
*\li 'stream' is a valid C stream.
- *
- * Returns:
- *\li #ISC_R_SUCCESS
- *\li #ISC_R_NOMEMORY Out of memory
*/
isc_result_t
*
* Returns:
*\li #ISC_R_SUCCESS
- *\li #ISC_R_NOMEMORY Out of memory
*/
isc_result_t
* Returns:
*\li #ISC_R_SUCCESS
*\li #ISC_R_UNEXPECTEDEND
- *\li #ISC_R_NOMEMORY
*
* These two results are returned only if their corresponding lexer
* options are not set.
*
* Returns:
* \li #ISC_R_SUCCESS
- * \li #ISC_R_NOMEMORY
* \li #ISC_R_NOTFOUND - there are no sources.
*/
* #ISC_LOG_DEBUGONLY or #ISC_LOG_BUFFERED.
*
* Ensures:
- *\li #ISC_R_SUCCESS
- * A channel with the given name is usable with
- * isc_log_usechannel().
- *
- *\li #ISC_R_NOMEMORY or #ISC_R_UNEXPECTED
- * No additional memory is being used by the logging context.
- * Any channel that previously existed with the given name
- * is not redefined.
+ * A channel with the given name is usable with isc_log_usechannel().
*/
isc_result_t
* Defaults:
*\li freemax = 1
*\li fillcount = 1
- *
- * Returns:
- *\li #ISC_R_NOMEMORY -- not enough memory to create pool
- *\li #ISC_R_SUCCESS -- all is well.
*/
#define isc_mempool_destroy(mp) isc__mempool_destroy((mp)_ISC_MEM_FILELINE)
*** Functions
***/
-isc_result_t
+void
isc_portset_create(isc_mem_t *mctx, isc_portset_t **portsetp);
/*%<
* Create a port set and initialize it as an empty set.
* Requires:
*\li 'mctx' to be valid.
*\li 'portsetp' to be non NULL and '*portsetp' to be NULL;
- *
- * Returns:
- *\li #ISC_R_SUCCESS
- *\li #ISC_R_NOMEMORY
*/
void
* a valid prefix.
*
* Returns:
- * \li ISC_R_NOMEMORY
* \li ISC_R_SUCCESS
*/
* \li 'mctx' to be valid.
* \li 'target' to be non NULL and '*target' to be NULL.
* \li 'maxbits' to be less than or equal to RADIX_MAXBITS.
- *
- * Returns:
- * \li ISC_R_NOMEMORY
- * \li ISC_R_SUCCESS
*/
void
} isc_symexists_t;
/*% Create a symbol table. */
-isc_result_t
+void
isc_symtab_create(isc_mem_t *mctx, unsigned int size,
isc_symtabaction_t undefine_action, void *undefine_arg,
bool case_sensitive, isc_symtab_t **symtabp);
LIST(struct inputsource) sources;
};
-static isc_result_t
+static void
grow_data(isc_lex_t *lex, size_t *remainingp, char **currp, char **prevp) {
char *tmp;
lex->data = tmp;
*remainingp += lex->max_token;
lex->max_token *= 2;
- return ISC_R_SUCCESS;
}
void
memmove(lex->specials, specials, 256);
}
-static isc_result_t
+static void
new_source(isc_lex_t *lex, bool is_file, bool need_close, void *input,
const char *name) {
inputsource *source;
source = isc_mem_get(lex->mctx, sizeof(*source));
- source->result = ISC_R_SUCCESS;
- source->is_file = is_file;
- source->need_close = need_close;
- source->at_eof = false;
- source->last_was_eol = lex->last_was_eol;
- source->input = input;
- source->name = isc_mem_strdup(lex->mctx, name);
- source->pushback = NULL;
+ *source = (inputsource){
+ .is_file = is_file,
+ .need_close = need_close,
+ .last_was_eol = lex->last_was_eol,
+ .input = input,
+ .name = isc_mem_strdup(lex->mctx, name),
+ .line = 1,
+ .link = ISC_LINK_INITIALIZER,
+ };
isc_buffer_allocate(lex->mctx, &source->pushback,
(unsigned int)lex->max_token);
- source->ignored = 0;
- source->line = 1;
- ISC_LIST_INITANDPREPEND(lex->sources, source, link);
-
- return ISC_R_SUCCESS;
+ ISC_LIST_PREPEND(lex->sources, source, link);
}
isc_result_t
return result;
}
- result = new_source(lex, true, true, stream, filename);
- if (result != ISC_R_SUCCESS) {
- (void)fclose(stream);
- }
- return result;
+ new_source(lex, true, true, stream, filename);
+ return ISC_R_SUCCESS;
}
-isc_result_t
+void
isc_lex_openstream(isc_lex_t *lex, FILE *stream) {
char name[128];
snprintf(name, sizeof(name), "stream-%p", stream);
- return new_source(lex, true, false, stream, name);
+ new_source(lex, true, false, stream, name);
}
isc_result_t
snprintf(name, sizeof(name), "buffer-%p", buffer);
- return new_source(lex, false, false, buffer, name);
+ new_source(lex, false, false, buffer, name);
+ return ISC_R_SUCCESS;
}
isc_result_t
state = lexstate_string;
}
if (remaining == 0U) {
- result = grow_data(lex, &remaining, &curr,
- &prev);
- if (result != ISC_R_SUCCESS) {
- goto done;
- }
+ grow_data(lex, &remaining, &curr, &prev);
}
INSIST(remaining > 0U);
*curr++ = c;
(options & ISC_LEXOPT_VPAIR) != 0)
{
if (remaining == 0U) {
- result = grow_data(lex, &remaining,
- &curr, &prev);
- if (result != ISC_R_SUCCESS) {
- goto done;
- }
+ grow_data(lex, &remaining, &curr,
+ &prev);
}
INSIST(remaining > 0U);
*curr++ = c;
: false;
}
if (remaining == 0U) {
- result = grow_data(lex, &remaining, &curr,
- &prev);
- if (result != ISC_R_SUCCESS) {
- goto done;
- }
+ grow_data(lex, &remaining, &curr, &prev);
}
INSIST(remaining > 0U);
*curr++ = c;
escaped = false;
}
if (remaining == 0U) {
- result = grow_data(lex, &remaining,
- &curr, &prev);
- if (result != ISC_R_SUCCESS) {
- goto done;
- }
+ grow_data(lex, &remaining, &curr,
+ &prev);
}
INSIST(remaining > 0U);
prev = curr;
}
if (remaining == 0U) {
- result = grow_data(lex, &remaining, &curr,
- &prev);
- if (result != ISC_R_SUCCESS) {
- goto done;
- }
+ grow_data(lex, &remaining, &curr, &prev);
}
INSIST(remaining > 0U);
prev = curr;
}
}
-isc_result_t
+void
isc_portset_create(isc_mem_t *mctx, isc_portset_t **portsetp) {
isc_portset_t *portset;
portset = isc_mem_get(mctx, sizeof(*portset));
*portset = (isc_portset_t){ 0 };
*portsetp = portset;
-
- return ISC_R_SUCCESS;
}
void
bool case_sensitive;
};
-isc_result_t
+void
isc_symtab_create(isc_mem_t *mctx, unsigned int size,
isc_symtabaction_t undefine_action, void *undefine_arg,
bool case_sensitive, isc_symtab_t **symtabp) {
symtab->magic = SYMTAB_MAGIC;
*symtabp = symtab;
-
- return ISC_R_SUCCESS;
}
void
*/
static isc_result_t
check_remoteserverlists(const cfg_obj_t *cctx, isc_mem_t *mctx) {
- isc_result_t result, tresult;
+ isc_result_t result = ISC_R_SUCCESS, tresult;
isc_symtab_t *symtab = NULL;
- result = isc_symtab_create(mctx, 100, freekey, mctx, false, &symtab);
- if (result != ISC_R_SUCCESS) {
- return result;
- }
+ isc_symtab_create(mctx, 100, freekey, mctx, false, &symtab);
+
tresult = check_remoteserverlist(cctx, "remote-servers", symtab, mctx);
if (tresult != ISC_R_SUCCESS) {
result = tresult;
const cfg_listelt_t *elt = NULL;
isc_symtab_t *symtab = NULL;
- result = isc_symtab_create(mctx, 100, NULL, NULL, false, &symtab);
- if (result != ISC_R_SUCCESS) {
- return result;
- }
+ isc_symtab_create(mctx, 100, NULL, NULL, false, &symtab);
result = cfg_map_get(config, "http", &obj);
if (result != ISC_R_SUCCESS) {
return result;
}
- result = isc_symtab_create(mctx, 100, NULL, NULL, false, &symtab);
- if (result != ISC_R_SUCCESS) {
- return result;
- }
+ isc_symtab_create(mctx, 100, NULL, NULL, false, &symtab);
for (elt = cfg_list_first(obj); elt != NULL; elt = cfg_list_next(elt)) {
const char *name;
const cfg_obj_t *listobj;
REQUIRE(countp != NULL);
- result = isc_symtab_create(mctx, 100, NULL, NULL, false, &symtab);
- if (result != ISC_R_SUCCESS) {
- *countp = count;
- return result;
- }
+ isc_symtab_create(mctx, 100, NULL, NULL, false, &symtab);
newlist:
listobj = cfg_tuple_get(obj, "addresses");
static isc_result_t
check_ta_conflicts(const cfg_obj_t *global_ta, const cfg_obj_t *view_ta,
bool autovalidation, isc_mem_t *mctx) {
- isc_result_t result, tresult;
+ isc_result_t result = ISC_R_SUCCESS, tresult;
const cfg_listelt_t *elt = NULL;
const cfg_obj_t *keylist = NULL;
isc_symtab_t *statictab = NULL, *dstab = NULL;
- result = isc_symtab_create(mctx, 100, freekey, mctx, false, &statictab);
- if (result != ISC_R_SUCCESS) {
- goto cleanup;
- }
-
- result = isc_symtab_create(mctx, 100, freekey, mctx, false, &dstab);
- if (result != ISC_R_SUCCESS) {
- goto cleanup;
- }
+ isc_symtab_create(mctx, 100, freekey, mctx, false, &statictab);
+ isc_symtab_create(mctx, 100, freekey, mctx, false, &dstab);
/*
* First we record all the static keys (trust-anchors configured with
}
}
-cleanup:
if (statictab != NULL) {
isc_symtab_destroy(&statictab);
}
const cfg_obj_t *obj, *nameobj, *primariesobj;
const char *zonename;
const char *forview = " for view ";
- isc_result_t result, tresult;
+ isc_result_t result = ISC_R_SUCCESS, tresult;
isc_symtab_t *symtab = NULL;
dns_fixedname_t fixed;
dns_name_t *name = dns_fixedname_initname(&fixed);
forview = "";
}
- result = isc_symtab_create(mctx, 100, freekey, mctx, false, &symtab);
- if (result != ISC_R_SUCCESS) {
- return result;
- }
+ isc_symtab_create(mctx, 100, freekey, mctx, false, &symtab);
obj = cfg_tuple_get(catz_obj, "zone list");
* Check that all zone statements are syntactically correct and
* there are no duplicate zones.
*/
- tresult = isc_symtab_create(mctx, 1000, freekey, mctx, false, &symtab);
- if (tresult != ISC_R_SUCCESS) {
- return ISC_R_NOMEMORY;
- }
+ isc_symtab_create(mctx, 1000, freekey, mctx, false, &symtab);
cfg_aclconfctx_create(mctx, &actx);
* Check that all key statements are syntactically correct and
* there are no duplicate keys.
*/
- tresult = isc_symtab_create(mctx, 1000, freekey, mctx, false, &symtab);
- if (tresult != ISC_R_SUCCESS) {
- goto cleanup;
- }
+ isc_symtab_create(mctx, 1000, freekey, mctx, false, &symtab);
(void)cfg_map_get(config, "key", &keys);
tresult = check_keylist(keys, symtab, mctx);
return ISC_R_SUCCESS;
}
- result = isc_symtab_create(mctx, 100, NULL, NULL, false, &symtab);
- if (result != ISC_R_SUCCESS) {
- return result;
- }
+ isc_symtab_create(mctx, 100, NULL, NULL, false, &symtab);
symvalue.as_cpointer = NULL;
for (i = 0; default_channels[i] != NULL; i++) {
cfg_aclconfctx_create(mctx, &actx);
- result = isc_symtab_create(mctx, 100, freekey, mctx, true, &symtab);
- if (result != ISC_R_SUCCESS) {
- goto cleanup;
- }
+ isc_symtab_create(mctx, 100, freekey, mctx, true, &symtab);
/*
* INET: Check allow clause.
result = ISC_R_FAMILYNOSUPPORT;
}
}
-cleanup:
+
cfg_aclconfctx_detach(&actx);
if (symtab != NULL) {
isc_symtab_destroy(&symtab);
* case sensitive. This will prevent people using FOO.DB and foo.db
* on case sensitive file systems but that shouldn't be a major issue.
*/
- tresult = isc_symtab_create(mctx, 100, NULL, NULL, false, &files);
- if (tresult != ISC_R_SUCCESS) {
- result = tresult;
- goto cleanup;
- }
-
- tresult = isc_symtab_create(mctx, 100, freekey, mctx, false, &keydirs);
- if (tresult != ISC_R_SUCCESS) {
- result = tresult;
- goto cleanup;
- }
-
- tresult = isc_symtab_create(mctx, 100, freekey, mctx, true, &inview);
- if (tresult != ISC_R_SUCCESS) {
- result = tresult;
- goto cleanup;
- }
+ isc_symtab_create(mctx, 100, NULL, NULL, false, &files);
+ isc_symtab_create(mctx, 100, freekey, mctx, false, &keydirs);
+ isc_symtab_create(mctx, 100, freekey, mctx, true, &inview);
if (views == NULL) {
tresult = check_viewconf(config, NULL, NULL, dns_rdataclass_in,
}
}
- tresult = isc_symtab_create(mctx, 100, NULL, NULL, true, &symtab);
- if (tresult != ISC_R_SUCCESS) {
- result = tresult;
- goto cleanup;
- }
+ isc_symtab_create(mctx, 100, NULL, NULL, true, &symtab);
+
for (velement = cfg_list_first(views); velement != NULL;
velement = cfg_list_next(velement))
{
}
}
-cleanup:
if (symtab != NULL) {
isc_symtab_destroy(&symtab);
}
*
* Returns:
* \li #ISC_R_SUCCESS - success
- *\li #ISC_R_NOMEMORY - no memory available
*\li #ISC_R_INVALIDFILE - file doesn't exist or is unreadable
*\li others - file contains errors
*/
*
*\li #ISC_R_SUCCESS If creating and configuring the KASP succeeds.
*\li #ISC_R_EXISTS If 'kasplist' already has a kasp structure with 'name'.
- *\li #ISC_R_NOMEMORY
*
*\li Other errors are possible.
*/
*
*\li #ISC_R_SUCCESS If creating and configuring the keystore succeeds.
*\li #ISC_R_EXISTS If 'keystorelist' already has a keystore with 'name'.
- *\li #ISC_R_NOMEMORY
*
*\li Other errors are possible.
*/
const cfg_obj_t *tagrange = NULL;
/* Create a new key reference. */
- result = dns_kasp_key_create(kasp, &key);
- if (result != ISC_R_SUCCESS) {
- return result;
- }
+ dns_kasp_key_create(kasp, &key);
if (config == NULL) {
/* We are creating a key reference for the default kasp. */
return result;
}
+ result = ISC_R_SUCCESS;
+
/* No kasp with configured name was found in list, create new one. */
INSIST(kasp == NULL);
- result = dns_kasp_create(mctx, kaspname, &kasp);
- if (result != ISC_R_SUCCESS) {
- return result;
- }
+ dns_kasp_create(mctx, kaspname, &kasp);
INSIST(kasp != NULL);
/* Now configure. */
{
/* Create a new key reference. */
new_key = NULL;
- result = dns_kasp_key_create(kasp, &new_key);
- if (result != ISC_R_SUCCESS) {
- cfg_obj_log(config, ISC_LOG_ERROR,
- "dnssec-policy: failed to "
- "configure keys (%s)",
- isc_result_totext(result));
- goto cleanup;
- }
+ dns_kasp_key_create(kasp, &new_key);
if (dns_kasp_key_ksk(key)) {
new_key->role |= DNS_KASP_KEY_ROLE_KSK;
}
* No key-store with configured name was found in list, create new one.
*/
INSIST(keystore == NULL);
- result = dns_keystore_create(mctx, name, &keystore);
- if (result != ISC_R_SUCCESS) {
- return result;
- }
+ dns_keystore_create(mctx, name, &keystore);
INSIST(keystore != NULL);
/* Now configure. */
cfg_obj_t *obj = NULL;
CHECK(cfg_create_obj(pctx, type, &obj));
- CHECK(isc_symtab_create(pctx->mctx, 5, /* XXX */
- map_symtabitem_destroy, pctx, false, &symtab));
+ isc_symtab_create(pctx->mctx, 5, /* XXX */
+ map_symtabitem_destroy, pctx, false, &symtab);
obj->value.map.symtab = symtab;
obj->value.map.id = NULL;
* the active list.
*/
dbversion = client_getdbversion(client);
- if (dbversion == NULL) {
- return NULL;
- }
dns_db_attach(db, &dbversion->db);
dns_db_currentversion(db, &dbversion->version);
dbversion->acl_checked = false;
*
* Returns:
*\li #ISC_R_SUCCESS
- *\li #ISC_R_NOMEMORY
*\li Other errors are possible
*/
*versionp = NULL;
dbversion = ns_client_findversion(client, tdbp);
- if (dbversion == NULL) {
- tresult = ISC_R_NOMEMORY;
- } else {
- /*
- * Be sure to return our database.
- */
- *dbp = tdbp;
- *versionp = dbversion->version;
- }
+
+ /*
+ * Be sure to return our database.
+ */
+ *dbp = tdbp;
+ *versionp = dbversion->version;
/*
* We return a null zone, No stats for DLZ zones.
isc_buffer_t *dbuf, b;
dns_name_t *fname = NULL;
dns_rdataset_t *neg = NULL, *negsig = NULL;
- isc_result_t result = ISC_R_NOMEMORY;
+ isc_result_t result;
CTRACE(ISC_LOG_DEBUG(3), "query_addnoqnameproof");
dns_name_getlabelsequence(qname, skip, count,
found);
+ /*
+ * These ensure fname, rdataset, and
+ * sigrdataset are non-NULL
+ */
fixfname(qctx->client, &qctx->fname,
&qctx->dbuf, &b);
fixrdataset(qctx->client, &qctx->rdataset);
fixrdataset(qctx->client, &qctx->sigrdataset);
- if (qctx->fname == NULL ||
- qctx->rdataset == NULL ||
- qctx->sigrdataset == NULL)
- {
- CCTRACE(ISC_LOG_ERROR, "query_sign_"
- "nodata: "
- "failure "
- "getting "
- "closest "
- "encloser");
- QUERY_ERROR(qctx, ISC_R_NOMEMORY);
- return ns_query_done(qctx);
- }
+
/*
* 'nearest' doesn't exist so
* 'exist' is set to false.
result = dns_test_makezone("nsec3", &zone, NULL, false);
assert_int_equal(result, ISC_R_SUCCESS);
- result = dns_zone_setfile(
- zone, TESTS_DIR "/testdata/nsec3param/nsec3.db.signed",
- dns_masterformat_text, &dns_master_style_default);
- assert_int_equal(result, ISC_R_SUCCESS);
+ dns_zone_setfile(zone, TESTS_DIR "/testdata/nsec3param/nsec3.db.signed",
+ dns_masterformat_text, &dns_master_style_default);
result = dns_zone_load(zone, false);
assert_int_equal(result, ISC_R_SUCCESS);
"testdata/master/master18.data");
assert_int_equal(result, DNS_R_SEENINCLUDE);
- result = dns_zone_setkeydirectory(zone, TESTS_DIR "/testkeys");
- assert_int_equal(result, ISC_R_SUCCESS);
+ dns_zone_setkeydirectory(zone, TESTS_DIR "/testkeys");
result = dns_zone_findkeys(zone, db, NULL, now, mctx, DNS_MAXZONEKEYS,
zone_keys, &nkeys);
UNUSED(state);
- result = isc_symtab_create(mctx, 3, undefine, NULL, false, &st);
- assert_int_equal(result, ISC_R_SUCCESS);
+ isc_symtab_create(mctx, 3, undefine, NULL, false, &st);
assert_non_null(st);
/* Nothing should be in the table yet */
}
}
- result = dns_view_create(mctx, loopmgr, dispatchmgr, dns_rdataclass_in,
- name, &view);
+ dns_view_create(mctx, loopmgr, dispatchmgr, dns_rdataclass_in, name,
+ &view);
if (dispatchmgr != NULL) {
dns_dispatchmgr_detach(&dispatchmgr);
}
- if (result != ISC_R_SUCCESS) {
- return result;
- }
-
if (with_cache) {
result = dns_cache_create(loopmgr, dns_rdataclass_in, "", mctx,
&cache);
if (result != ISC_R_SUCCESS) {
goto detach_zone;
}
- result = dns_zone_setorigin(zone, origin);
- if (result != ISC_R_SUCCESS) {
- goto detach_zone;
- }
+ dns_zone_setorigin(zone, origin);
/*
* If requested, create a view.
isc_nmhandle_detach(&client->reqhandle);
- if (*qctxp == NULL) {
- return ISC_R_NOMEMORY;
- } else {
- return ISC_R_SUCCESS;
- }
+ return ISC_R_SUCCESS;
}
isc_result_t