Commit c0a3c488 authored by Mark Andrews's avatar Mark Andrews
Browse files

add missing DBC checks for catz and add isc_magic checks; add DBC checks to ht.c

(cherry picked from commit a487473f)
(cherry picked from commit 17d9fa3c)
parent e00427f2
Pipeline #7417 passed with stages
in 15 minutes and 58 seconds
5103. [bug] Add missing design by contract tests to dns_catz*.
[GL #748]
5101. [bug] Fix default installation path for Python modules.
[GL #730]
 
......
......@@ -32,11 +32,19 @@
#include <dns/view.h>
#include <dns/zone.h>
#define DNS_CATZ_ZONE_MAGIC ISC_MAGIC('c', 'a', 't', 'z')
#define DNS_CATZ_ZONES_MAGIC ISC_MAGIC('c', 'a', 't', 's')
#define DNS_CATZ_ENTRY_MAGIC ISC_MAGIC('c', 'a', 't', 'e')
#define DNS_CATZ_ZONE_VALID(catz) ISC_MAGIC_VALID(catz, DNS_CATZ_ZONE_MAGIC)
#define DNS_CATZ_ZONES_VALID(catzs) ISC_MAGIC_VALID(catzs, DNS_CATZ_ZONES_MAGIC)
#define DNS_CATZ_ENTRY_VALID(entry) ISC_MAGIC_VALID(entry, DNS_CATZ_ENTRY_MAGIC)
/*%
* Single member zone in a catalog
*/
struct dns_catz_entry {
unsigned int magic;
dns_name_t name;
dns_catz_options_t opts;
isc_refcount_t refs;
......@@ -46,6 +54,7 @@ struct dns_catz_entry {
* Catalog zone
*/
struct dns_catz_zone {
unsigned int magic;
dns_name_t name;
dns_catz_zones_t *catzs;
dns_rdata_t soa;
......@@ -58,7 +67,7 @@ struct dns_catz_zone {
dns_catz_options_t defoptions;
dns_catz_options_t zoneoptions;
isc_time_t lastupdated;
bool updatepending;
bool updatepending;
uint32_t version;
dns_db_t *db;
......@@ -67,8 +76,8 @@ struct dns_catz_zone {
isc_timer_t *updatetimer;
isc_event_t updateevent;
bool active;
bool db_registered;
bool active;
bool db_registered;
isc_refcount_t refs;
};
......@@ -84,6 +93,7 @@ catz_process_zones_suboption(dns_catz_zone_t *zone, dns_rdataset_t *value,
* Collection of catalog zones for a view
*/
struct dns_catz_zones {
unsigned int magic;
isc_ht_t *zones;
isc_mem_t *mctx;
isc_refcount_t refs;
......@@ -97,6 +107,9 @@ struct dns_catz_zones {
void
dns_catz_options_init(dns_catz_options_t *options) {
REQUIRE(options != NULL);
dns_ipkeylist_init(&options->masters);
options->allow_query = NULL;
......@@ -112,6 +125,10 @@ dns_catz_options_init(dns_catz_options_t *options) {
void
dns_catz_options_free(dns_catz_options_t *options, isc_mem_t *mctx) {
REQUIRE(options != NULL);
REQUIRE(mctx != NULL);
if (options->masters.count != 0)
dns_ipkeylist_clear(mctx, &options->masters);
if (options->zonedir != NULL) {
......@@ -128,6 +145,7 @@ isc_result_t
dns_catz_options_copy(isc_mem_t *mctx, const dns_catz_options_t *src,
dns_catz_options_t *dst)
{
REQUIRE(mctx != NULL);
REQUIRE(src != NULL);
REQUIRE(dst != NULL);
REQUIRE(dst->masters.count == 0);
......@@ -158,6 +176,10 @@ isc_result_t
dns_catz_options_setdefault(isc_mem_t *mctx, const dns_catz_options_t *defaults,
dns_catz_options_t *opts)
{
REQUIRE(mctx != NULL);
REQUIRE(defaults != NULL);
REQUIRE(opts != NULL);
if (opts->masters.count == 0 && defaults->masters.count != 0)
dns_ipkeylist_copy(mctx, &defaults->masters, &opts->masters);
......@@ -182,6 +204,7 @@ dns_catz_entry_new(isc_mem_t *mctx, const dns_name_t *domain,
dns_catz_entry_t *nentry;
isc_result_t result;
REQUIRE(mctx != NULL);
REQUIRE(nentryp != NULL && *nentryp == NULL);
nentry = isc_mem_get(mctx, sizeof(dns_catz_entry_t));
......@@ -197,6 +220,7 @@ dns_catz_entry_new(isc_mem_t *mctx, const dns_name_t *domain,
dns_catz_options_init(&nentry->opts);
isc_refcount_init(&nentry->refs, 1);
nentry->magic = DNS_CATZ_ENTRY_MAGIC;
*nentryp = nentry;
return (ISC_R_SUCCESS);
......@@ -207,6 +231,7 @@ cleanup:
dns_name_t *
dns_catz_entry_getname(dns_catz_entry_t *entry) {
REQUIRE(DNS_CATZ_ENTRY_VALID(entry));
return (&entry->name);
}
......@@ -217,6 +242,10 @@ dns_catz_entry_copy(dns_catz_zone_t *zone, const dns_catz_entry_t *entry,
isc_result_t result;
dns_catz_entry_t *nentry = NULL;
REQUIRE(DNS_CATZ_ZONE_VALID(zone));
REQUIRE(DNS_CATZ_ENTRY_VALID(entry));
REQUIRE(nentryp != NULL && *nentryp == NULL);
result = dns_catz_entry_new(zone->catzs->mctx, &entry->name, &nentry);
if (result != ISC_R_SUCCESS)
return (result);
......@@ -232,7 +261,9 @@ dns_catz_entry_copy(dns_catz_zone_t *zone, const dns_catz_entry_t *entry,
void
dns_catz_entry_attach(dns_catz_entry_t *entry, dns_catz_entry_t **entryp) {
REQUIRE(DNS_CATZ_ENTRY_VALID(entry));
REQUIRE(entryp != NULL && *entryp == NULL);
isc_refcount_increment(&entry->refs, NULL);
*entryp = entry;
}
......@@ -243,9 +274,11 @@ dns_catz_entry_detach(dns_catz_zone_t *zone, dns_catz_entry_t **entryp) {
isc_mem_t *mctx;
unsigned int refs;
REQUIRE(DNS_CATZ_ZONE_VALID(zone));
REQUIRE(entryp != NULL && *entryp != NULL);
entry = *entryp;
REQUIRE(DNS_CATZ_ENTRY_VALID(entry));
*entryp = NULL;
mctx = zone->catzs->mctx;
......@@ -262,6 +295,7 @@ dns_catz_entry_detach(dns_catz_zone_t *zone, dns_catz_entry_t **entryp) {
bool
dns_catz_entry_validate(const dns_catz_entry_t *entry) {
REQUIRE(DNS_CATZ_ENTRY_VALID(entry));
UNUSED(entry);
return (true);
......@@ -271,6 +305,9 @@ bool
dns_catz_entry_cmp(const dns_catz_entry_t *ea, const dns_catz_entry_t *eb) {
isc_region_t ra, rb;
REQUIRE(DNS_CATZ_ENTRY_VALID(ea));
REQUIRE(DNS_CATZ_ENTRY_VALID(eb));
if (ea == eb)
return (true);
......@@ -311,21 +348,21 @@ dns_catz_entry_cmp(const dns_catz_entry_t *ea, const dns_catz_entry_t *eb) {
dns_name_t *
dns_catz_zone_getname(dns_catz_zone_t *zone) {
REQUIRE(zone != NULL);
REQUIRE(DNS_CATZ_ZONE_VALID(zone));
return (&zone->name);
}
dns_catz_options_t *
dns_catz_zone_getdefoptions(dns_catz_zone_t *zone) {
REQUIRE(zone != NULL);
REQUIRE(DNS_CATZ_ZONE_VALID(zone));
return (&zone->defoptions);
}
void
dns_catz_zone_resetdefoptions(dns_catz_zone_t *zone) {
REQUIRE(zone != NULL);
REQUIRE(DNS_CATZ_ZONE_VALID(zone));
dns_catz_options_free(&zone->defoptions, zone->catzs->mctx);
dns_catz_options_init(&zone->defoptions);
......@@ -342,8 +379,8 @@ dns_catz_zones_merge(dns_catz_zone_t *target, dns_catz_zone_t *newzone) {
char zname[DNS_NAME_FORMATSIZE];
dns_catz_zoneop_fn_t addzone, modzone, delzone;
REQUIRE(target != NULL);
REQUIRE(newzone != NULL);
REQUIRE(DNS_CATZ_ZONE_VALID(newzone));
REQUIRE(DNS_CATZ_ZONE_VALID(target));
/* TODO verify the new zone first! */
......@@ -398,9 +435,9 @@ dns_catz_zones_merge(dns_catz_zone_t *target, dns_catz_zone_t *newzone) {
result = delcur ? isc_ht_iter_delcurrent_next(iter1) :
isc_ht_iter_next(iter1))
{
dns_catz_entry_t *nentry;
dns_catz_entry_t *oentry;
unsigned char * key;
dns_catz_entry_t *nentry = NULL;
dns_catz_entry_t *oentry = NULL;
unsigned char * key = NULL;
size_t keysize;
delcur = false;
......@@ -471,7 +508,7 @@ dns_catz_zones_merge(dns_catz_zone_t *target, dns_catz_zone_t *newzone) {
result == ISC_R_SUCCESS;
result = isc_ht_iter_delcurrent_next(iter2))
{
dns_catz_entry_t *entry;
dns_catz_entry_t *entry = NULL;
isc_ht_iter_current(iter2, (void **) &entry);
dns_name_format(&entry->name, zname, DNS_NAME_FORMATSIZE);
......@@ -494,7 +531,7 @@ dns_catz_zones_merge(dns_catz_zone_t *target, dns_catz_zone_t *newzone) {
result == ISC_R_SUCCESS;
result = isc_ht_iter_delcurrent_next(iteradd))
{
dns_catz_entry_t *entry;
dns_catz_entry_t *entry = NULL;
isc_ht_iter_current(iteradd, (void **) &entry);
dns_name_format(&entry->name, zname, DNS_NAME_FORMATSIZE);
......@@ -513,7 +550,7 @@ dns_catz_zones_merge(dns_catz_zone_t *target, dns_catz_zone_t *newzone) {
result == ISC_R_SUCCESS;
result = isc_ht_iter_delcurrent_next(itermod))
{
dns_catz_entry_t *entry;
dns_catz_entry_t *entry = NULL;
isc_ht_iter_current(itermod, (void **) &entry);
dns_name_format(&entry->name, zname, DNS_NAME_FORMATSIZE);
......@@ -547,7 +584,6 @@ cleanup:
if (tomod != NULL)
isc_ht_destroy(&tomod);
return (result);
}
isc_result_t
......@@ -586,6 +622,7 @@ dns_catz_new_zones(dns_catz_zones_t **catzsp, dns_catz_zonemodmethods_t *zmm,
result = isc_task_create(taskmgr, 0, &new_zones->updater);
if (result != ISC_R_SUCCESS)
goto cleanup_ht;
new_zones->magic = DNS_CATZ_ZONES_MAGIC;
*catzsp = new_zones;
return (ISC_R_SUCCESS);
......@@ -604,7 +641,7 @@ dns_catz_new_zones(dns_catz_zones_t **catzsp, dns_catz_zonemodmethods_t *zmm,
void
dns_catz_catzs_set_view(dns_catz_zones_t *catzs, dns_view_t *view) {
REQUIRE(catzs != NULL);
REQUIRE(DNS_CATZ_ZONES_VALID(catzs));
REQUIRE(view != NULL);
/* Either it's a new one or it's being reconfigured. */
REQUIRE(catzs->view == NULL || !strcmp(catzs->view->name, view->name));
......@@ -619,7 +656,9 @@ dns_catz_new_zone(dns_catz_zones_t *catzs, dns_catz_zone_t **zonep,
isc_result_t result;
dns_catz_zone_t *new_zone;
REQUIRE(DNS_CATZ_ZONES_VALID(catzs));
REQUIRE(zonep != NULL && *zonep == NULL);
REQUIRE(ISC_MAGIC_VALID(name, DNS_NAME_MAGIC));
new_zone = isc_mem_get(catzs->mctx, sizeof(*new_zone));
if (new_zone == NULL)
......@@ -656,6 +695,7 @@ dns_catz_new_zone(dns_catz_zones_t *catzs, dns_catz_zone_t **zonep,
new_zone->db_registered = false;
new_zone->version = (uint32_t)(-1);
isc_refcount_init(&new_zone->refs, 1);
new_zone->magic = DNS_CATZ_ZONE_MAGIC;
*zonep = new_zone;
......@@ -679,9 +719,10 @@ dns_catz_add_zone(dns_catz_zones_t *catzs, const dns_name_t *name,
isc_result_t result, tresult;
char zname[DNS_NAME_FORMATSIZE];
REQUIRE(catzs != NULL);
REQUIRE(name != NULL);
REQUIRE(DNS_CATZ_ZONES_VALID(catzs));
REQUIRE(ISC_MAGIC_VALID(name, DNS_NAME_MAGIC));
REQUIRE(zonep != NULL && *zonep == NULL);
dns_name_format(name, zname, DNS_NAME_FORMATSIZE);
isc_log_write(dns_lctx, DNS_LOGCATEGORY_GENERAL,
DNS_LOGMODULE_MASTER, ISC_LOG_DEBUG(3),
......@@ -719,7 +760,10 @@ dns_catz_add_zone(dns_catz_zones_t *catzs, const dns_name_t *name,
dns_catz_zone_t *
dns_catz_get_zone(dns_catz_zones_t *catzs, const dns_name_t *name) {
isc_result_t result;
dns_catz_zone_t *found;
dns_catz_zone_t *found = NULL;
REQUIRE(DNS_CATZ_ZONES_VALID(catzs));
REQUIRE(ISC_MAGIC_VALID(name, DNS_NAME_MAGIC));
result = isc_ht_find(catzs->zones, name->ndata, name->length,
(void **) &found);
......@@ -731,6 +775,7 @@ dns_catz_get_zone(dns_catz_zones_t *catzs, const dns_name_t *name) {
void
dns_catz_catzs_attach(dns_catz_zones_t *catzs, dns_catz_zones_t **catzsp) {
REQUIRE(DNS_CATZ_ZONES_VALID(catzs));
REQUIRE(catzsp != NULL && *catzsp == NULL);
isc_refcount_increment(&catzs->refs, NULL);
......@@ -750,7 +795,6 @@ dns_catz_zone_detach(dns_catz_zone_t **zonep) {
isc_result_t result;
dns_catz_zone_t *zone;
isc_ht_iter_t *iter = NULL;
isc_mem_t *mctx;
unsigned int refs;
REQUIRE(zonep != NULL && *zonep != NULL);
......@@ -759,6 +803,7 @@ dns_catz_zone_detach(dns_catz_zone_t **zonep) {
*zonep = NULL;
isc_refcount_decrement(&zone->refs, &refs);
if (refs == 0) {
isc_mem_t *mctx = zone->catzs->mctx;
if (zone->entries != NULL) {
result = isc_ht_iter_create(zone->entries, &iter);
INSIST(result == ISC_R_SUCCESS);
......@@ -766,7 +811,7 @@ dns_catz_zone_detach(dns_catz_zone_t **zonep) {
result == ISC_R_SUCCESS;
result = isc_ht_iter_delcurrent_next(iter))
{
dns_catz_entry_t *entry;
dns_catz_entry_t *entry = NULL;
isc_ht_iter_current(iter, (void **) &entry);
dns_catz_entry_detach(zone, &entry);
......@@ -778,7 +823,7 @@ dns_catz_zone_detach(dns_catz_zone_t **zonep) {
INSIST(isc_ht_count(zone->entries) == 0);
isc_ht_destroy(&zone->entries);
}
mctx = zone->catzs->mctx;
zone->magic = 0;
isc_timer_detach(&zone->updatetimer);
isc_refcount_destroy(&zone->refs);
if (zone->db_registered == true) {
......@@ -803,22 +848,21 @@ dns_catz_zone_detach(dns_catz_zone_t **zonep) {
}
void
dns_catz_catzs_detach(dns_catz_zones_t ** catzsp) {
dns_catz_catzs_detach(dns_catz_zones_t **catzsp) {
dns_catz_zones_t *catzs;
isc_ht_iter_t *iter = NULL;
isc_result_t result;
unsigned int refs;
dns_catz_zone_t *zone;
REQUIRE(catzsp != NULL);
catzs = *catzsp;
REQUIRE(catzs != NULL);
REQUIRE(DNS_CATZ_ZONES_VALID(catzs));
*catzsp = NULL;
isc_refcount_decrement(&catzs->refs, &refs);
if (refs == 0) {
catzs->magic = 0;
DESTROYLOCK(&catzs->lock);
if (catzs->zones != NULL) {
result = isc_ht_iter_create(catzs->zones, &iter);
......@@ -826,6 +870,7 @@ dns_catz_catzs_detach(dns_catz_zones_t ** catzsp) {
for (result = isc_ht_iter_first(iter);
result == ISC_R_SUCCESS;)
{
dns_catz_zone_t *zone = NULL;
isc_ht_iter_current(iter, (void **) &zone);
result = isc_ht_iter_delcurrent_next(iter);
dns_catz_zone_detach(&zone);
......@@ -883,9 +928,9 @@ catz_process_zones(dns_catz_zone_t *zone, dns_rdataset_t *value,
dns_label_t mhash;
dns_name_t opt;
REQUIRE(zone != NULL);
REQUIRE(DNS_CATZ_ZONE_VALID(zone));
REQUIRE(DNS_RDATASET_VALID(value));
REQUIRE(name != NULL);
REQUIRE(ISC_MAGIC_VALID(name, DNS_NAME_MAGIC));
if (value->rdclass != dns_rdataclass_in)
return (ISC_R_FAILURE);
......@@ -976,7 +1021,7 @@ catz_process_version(dns_catz_zone_t *zone, dns_rdataset_t *value) {
uint32_t tversion;
char t[16];
REQUIRE(zone != NULL);
REQUIRE(DNS_CATZ_ZONE_VALID(zone));
REQUIRE(DNS_RDATASET_VALID(value));
if (value->rdclass != dns_rdataclass_in ||
......@@ -1041,11 +1086,11 @@ catz_process_masters(dns_catz_zone_t *zone, dns_ipkeylist_t *ipkl,
unsigned int rcount;
unsigned int i;
REQUIRE(zone != NULL);
REQUIRE(DNS_CATZ_ZONE_VALID(zone));
REQUIRE(ipkl != NULL);
REQUIRE(DNS_RDATASET_VALID(value));
REQUIRE(dns_rdataset_isassociated(value));
REQUIRE(name != NULL);
REQUIRE(ISC_MAGIC_VALID(name, DNS_NAME_MAGIC));
mctx = zone->catzs->mctx;
memset(&rdata_a, 0, sizeof(rdata_a));
......@@ -1225,7 +1270,7 @@ catz_process_apl(dns_catz_zone_t *zone, isc_buffer_t **aclbp,
isc_buffer_t *aclb = NULL;
unsigned char buf[256]; /* larger than INET6_ADDRSTRLEN */
REQUIRE(zone != NULL);
REQUIRE(DNS_CATZ_ZONE_VALID(zone));
REQUIRE(aclbp != NULL);
REQUIRE(*aclbp == NULL);
REQUIRE(DNS_RDATASET_VALID(value));
......@@ -1302,9 +1347,10 @@ catz_process_zones_suboption(dns_catz_zone_t *zone, dns_rdataset_t *value,
dns_name_t prefix;
catz_opt_t opt;
REQUIRE(zone != NULL);
REQUIRE(DNS_CATZ_ZONE_VALID(zone));
REQUIRE(mhash != NULL);
REQUIRE(DNS_RDATASET_VALID(value));
REQUIRE(ISC_MAGIC_VALID(name, DNS_NAME_MAGIC));
if (name->labels == 0)
return (ISC_R_FAILURE);
......@@ -1360,8 +1406,8 @@ catz_process_value(dns_catz_zone_t *zone, dns_name_t *name,
dns_name_t prefix;
catz_opt_t opt;
REQUIRE(zone != NULL);
REQUIRE(name != NULL);
REQUIRE(DNS_CATZ_ZONE_VALID(zone));
REQUIRE(ISC_MAGIC_VALID(name, DNS_NAME_MAGIC));
REQUIRE(DNS_RDATASET_VALID(rdataset));
dns_name_getlabel(name, name->labels - 1, &option);
......@@ -1406,8 +1452,9 @@ dns_catz_update_process(dns_catz_zones_t *catzs, dns_catz_zone_t *zone,
dns_rdata_soa_t soa;
dns_name_t prefix;
REQUIRE(catzs != NULL);
REQUIRE(zone != NULL);
REQUIRE(DNS_CATZ_ZONES_VALID(catzs));
REQUIRE(DNS_CATZ_ZONE_VALID(zone));
REQUIRE(ISC_MAGIC_VALID(src_name, DNS_NAME_MAGIC));
nrres = dns_name_fullcompare(src_name, &zone->name, &order, &nlabels);
if (nrres == dns_namereln_equal) {
......@@ -1451,7 +1498,7 @@ dns_catz_generate_masterfilename(dns_catz_zone_t *zone, dns_catz_entry_t *entry,
isc_result_t result;
size_t rlen;
REQUIRE(zone != NULL);
REQUIRE(DNS_CATZ_ZONE_VALID(zone));
REQUIRE(entry != NULL);
REQUIRE(buffer != NULL && *buffer != NULL);
......@@ -1528,7 +1575,7 @@ dns_catz_generate_zonecfg(dns_catz_zone_t *zone, dns_catz_entry_t *entry,
char pbuf[sizeof("65535")]; /* used both for port number and DSCP */
char zname[DNS_NAME_FORMATSIZE];
REQUIRE(zone != NULL);
REQUIRE(DNS_CATZ_ZONE_VALID(zone));
REQUIRE(entry != NULL);
REQUIRE(buf != NULL && *buf == NULL);
......@@ -1640,7 +1687,7 @@ dns_catz_update_taskaction(isc_task_t *task, isc_event_t *event) {
REQUIRE(event != NULL);
zone = event->ev_arg;
REQUIRE(zone != NULL);
REQUIRE(DNS_CATZ_ZONE_VALID(zone));
LOCK(&zone->catzs->lock);
zone->updatepending = false;
......@@ -1752,7 +1799,7 @@ dns_catz_update_from_db(dns_db_t *db, dns_catz_zones_t *catzs) {
uint32_t vers;
REQUIRE(DNS_DB_VALID(db));
REQUIRE(catzs != NULL);
REQUIRE(DNS_CATZ_ZONES_VALID(catzs));
/*
* Create a new catz in the same context as current catz.
......@@ -1925,9 +1972,8 @@ void
dns_catz_prereconfig(dns_catz_zones_t *catzs) {
isc_result_t result;
isc_ht_iter_t *iter = NULL;
dns_catz_zone_t *zone;
REQUIRE(catzs != NULL);
REQUIRE(DNS_CATZ_ZONES_VALID(catzs));
result = isc_ht_iter_create(catzs->zones, &iter);
INSIST(result == ISC_R_SUCCESS);
......@@ -1935,6 +1981,7 @@ dns_catz_prereconfig(dns_catz_zones_t *catzs) {
result == ISC_R_SUCCESS;
result = isc_ht_iter_next(iter))
{
dns_catz_zone_t *zone = NULL;
isc_ht_iter_current(iter, (void **) &zone);
zone->active = false;
}
......@@ -1947,7 +1994,8 @@ dns_catz_postreconfig(dns_catz_zones_t *catzs) {
isc_result_t result;
dns_catz_zone_t *newzone = NULL;
isc_ht_iter_t *iter = NULL;
dns_catz_zone_t *zone;
REQUIRE(DNS_CATZ_ZONES_VALID(catzs));
LOCK(&catzs->lock);
result = isc_ht_iter_create(catzs->zones, &iter);
......@@ -1955,6 +2003,8 @@ dns_catz_postreconfig(dns_catz_zones_t *catzs) {
for (result = isc_ht_iter_first(iter);
result == ISC_R_SUCCESS;)
{
dns_catz_zone_t *zone = NULL;
isc_ht_iter_current(iter, (void **) &zone);
if (zone->active == false) {
char cname[DNS_NAME_FORMATSIZE];
......@@ -1990,5 +2040,6 @@ dns_catz_postreconfig(dns_catz_zones_t *catzs) {
isc_result_t
dns_catz_get_iterator(dns_catz_zone_t *catz, isc_ht_iter_t **itp) {
REQUIRE(DNS_CATZ_ZONE_VALID(catz));
return (isc_ht_iter_create(catz->entries, itp));
}
......@@ -77,7 +77,7 @@ dns_catz_options_init(dns_catz_options_t *options);
* Initialize 'options' to NULL values.
*
* Requires:
* \li options to be non NULL
* \li 'options' to be non NULL.
*/
void
......@@ -86,20 +86,20 @@ dns_catz_options_free(dns_catz_options_t *options, isc_mem_t *mctx);
* Free 'options' contents into 'mctx'. ('options' itself is not freed.)
*
* Requires:
* \li options to be non NULL
* \li mctx to be a valid memory context
* \li 'options' to be non NULL.
* \li 'mctx' to be a valid memory context.
*/
isc_result_t
dns_catz_options_copy(isc_mem_t *mctx, const dns_catz_options_t *opts,
dns_catz_options_t *nopts);
/*%<
* Duplicate 'opts' into 'nopts', allocating space from 'mctx'
* Duplicate 'opts' into 'nopts', allocating space from 'mctx'.
*
* Requires:
* \li 'mctx' to be a valid memory context
* \li 'options' to be non NULL and valid options
* \li 'nopts' to be non NULL
* \li 'mctx' to be a valid memory context.
* \li 'options' to be non NULL and valid options.
* \li 'nopts' to be non NULL.
*/
isc_result_t
......@@ -109,9 +109,9 @@ dns_catz_options_setdefault(isc_mem_t *mctx, const dns_catz_options_t *defaults,
* Replace empty values in 'opts' with values from 'defaults'
*
* Requires:
* \li mctx to be a valid memory context
* \li defaults to be non NULL and valid options
* \li opts to be non NULL
* \li 'mctx' to be a valid memory context.
* \li 'defaults' to be non NULL and valid options.
* \li 'opts' to be non NULL.
*/
dns_name_t *
......@@ -120,10 +120,10 @@ dns_catz_entry_getname(dns_catz_entry_t *entry);
* Get domain name for 'entry'
*
* Requires:
* \li entry to be non NULL
* \li 'entry' to be non NULL.
*
* Returns:
* \li domain name for entry
* \li domain name for entry.
*/
isc_result_t
......@@ -133,9 +133,9 @@ dns_catz_entry_new(isc_mem_t *mctx, const dns_name_t *domain,
* Allocate a new catz_entry on 'mctx', with the name 'domain'
*
* Requires:
* \li mctx to be a valid memory context
* \li domain to be valid dns_name or NULL
* \li nentryp to be non NULL, *nentryp to be NULL
* \li 'mctx' to be a valid memory context.
* \li 'domain' to be valid dns_name or NULL.
* \li 'nentryp' to be non NULL, *nentryp to be NULL.
*
* Returns:
* \li ISC_R_SUCCESS on success
......@@ -149,9 +149,9 @@ dns_catz_entry_copy(dns_catz_zone_t *zone, const dns_catz_entry_t *entry,
* Allocate a new catz_entry and deep copy 'entry' into 'nentryp'.
*
* Requires:
* \li mctx to be a valid memory context
* \li entry to be non NULL
* \li nentryp to be non NULL, *nentryp to be NULL
* \li 'mctx' to be a valid memory context.
* \li 'entry' to be non NULL.
* \li 'nentryp' to be non NULL, *nentryp to be NULL.
*
* Returns:
* \li ISC_R_SUCCESS on success
......@@ -164,8 +164,8 @@ dns_catz_entry_attach(dns_catz_entry_t *entry, dns_catz_entry_t **entryp);
* Attach an entry
*
* Requires:
* \li entry is not NULL
* \li entryp is not NULL, *entryp is NULL
* \li 'entry' is a valid dns_catz_entry_t.
* \li 'entryp' is not NULL and '*entryp' is NULL.
*/
void
......@@ -174,8 +174,8 @@ dns_catz_entry_detach(dns_catz_zone_t *zone, dns_catz_entry_t **entryp);
* Detach an entry, free if no further references
*
* Requires:
* \li zone is not NULL
* \li entryp is not NULL, *entryp is not NULL
* \li 'zone' is a valid dns_catz_zone_t.
* \li 'entryp' is not NULL and '*entryp' is not NULL.
*/