Commit 52e2aab3 authored by Mark Andrews's avatar Mark Andrews
Browse files

4546. [func] Extend the use of const declarations. [RT #43379]

parent 25f3b58e
4546. [func] Extend the use of const declarations. [RT #43379]
4545. [func] Expand YAML output from dnstap-read to include
a detailed breakdown of the DNS message contents.
[RT #43642]
......
......@@ -175,7 +175,7 @@ logged(char *key, int value) {
}
static isc_boolean_t
checkns(dns_zone_t *zone, dns_name_t *name, dns_name_t *owner,
checkns(dns_zone_t *zone, const dns_name_t *name, const dns_name_t *owner,
dns_rdataset_t *a, dns_rdataset_t *aaaa)
{
#ifdef USE_GETADDRINFO
......@@ -379,7 +379,7 @@ checkns(dns_zone_t *zone, dns_name_t *name, dns_name_t *owner,
}
static isc_boolean_t
checkmx(dns_zone_t *zone, dns_name_t *name, dns_name_t *owner) {
checkmx(dns_zone_t *zone, const dns_name_t *name, const dns_name_t *owner) {
#ifdef USE_GETADDRINFO
struct addrinfo hints, *ai, *cur;
char namebuf[DNS_NAME_FORMATSIZE + 1];
......@@ -464,7 +464,7 @@ checkmx(dns_zone_t *zone, dns_name_t *name, dns_name_t *owner) {
}
static isc_boolean_t
checksrv(dns_zone_t *zone, dns_name_t *name, dns_name_t *owner) {
checksrv(dns_zone_t *zone, const dns_name_t *name, const dns_name_t *owner) {
#ifdef USE_GETADDRINFO
struct addrinfo hints, *ai, *cur;
char namebuf[DNS_NAME_FORMATSIZE + 1];
......
......@@ -177,7 +177,7 @@ char keyfile[MXNAME] = "";
char keysecret[MXNAME] = "";
unsigned char cookie_secret[33];
unsigned char cookie[8];
dns_name_t *hmacname = NULL;
const dns_name_t *hmacname = NULL;
unsigned int digestbits = 0;
isc_buffer_t *namebuf = NULL;
dns_tsigkey_t *key = NULL;
......
......@@ -356,8 +356,9 @@ printsection(dns_message_t *msg, dns_section_t sectionid,
}
static isc_result_t
printrdata(dns_message_t *msg, dns_rdataset_t *rdataset, dns_name_t *owner,
const char *set_name, isc_boolean_t headers)
printrdata(dns_message_t *msg, dns_rdataset_t *rdataset,
const dns_name_t *owner, const char *set_name,
isc_boolean_t headers)
{
isc_buffer_t target;
isc_result_t result;
......@@ -410,7 +411,7 @@ isc_result_t
printmessage(dig_query_t *query, dns_message_t *msg, isc_boolean_t headers) {
isc_boolean_t did_flag = ISC_FALSE;
dns_rdataset_t *opt, *tsig = NULL;
dns_name_t *tsigname;
const dns_name_t *tsigname;
isc_result_t result = ISC_R_SUCCESS;
int force_error;
......
......@@ -283,7 +283,7 @@ extern isc_sockaddr_t bind_address;
extern char keynametext[MXNAME];
extern char keyfile[MXNAME];
extern char keysecret[MXNAME];
extern dns_name_t *hmacname;
extern const dns_name_t *hmacname;
extern unsigned int digestbits;
#ifdef DIG_SIGCHASE
extern char trustedkey[MXNAME];
......
......@@ -1703,7 +1703,7 @@ allowed(isc_netaddr_t *addr, dns_name_t *signer,
*/
isc_boolean_t
ns_client_isself(dns_view_t *myview, dns_tsigkey_t *mykey,
isc_sockaddr_t *srcaddr, isc_sockaddr_t *dstaddr,
const isc_sockaddr_t *srcaddr, const isc_sockaddr_t *dstaddr,
dns_rdataclass_t rdclass, void *arg)
{
dns_view_t *view;
......@@ -2189,7 +2189,7 @@ client_request(isc_task_t *task, isc_event_t *event) {
isc_buffer_t tbuffer;
dns_view_t *view;
dns_rdataset_t *opt;
dns_name_t *signame;
const dns_name_t *signame;
isc_boolean_t ra; /* Recursion available. */
isc_netaddr_t netaddr;
int match;
......@@ -3747,7 +3747,7 @@ ns_client_log(ns_client_t *client, isc_logcategory_t *category,
}
void
ns_client_aclmsg(const char *msg, dns_name_t *name, dns_rdatatype_t type,
ns_client_aclmsg(const char *msg, const dns_name_t *name, dns_rdatatype_t type,
dns_rdataclass_t rdclass, char *buf, size_t len)
{
char namebuf[DNS_NAME_FORMATSIZE];
......
......@@ -956,14 +956,14 @@ struct keyalgorithms {
};
isc_result_t
ns_config_getkeyalgorithm(const char *str, dns_name_t **name,
ns_config_getkeyalgorithm(const char *str, const dns_name_t **name,
isc_uint16_t *digestbits)
{
return (ns_config_getkeyalgorithm2(str, name, NULL, digestbits));
}
isc_result_t
ns_config_getkeyalgorithm2(const char *str, dns_name_t **name,
ns_config_getkeyalgorithm2(const char *str, const dns_name_t **name,
unsigned int *typep, isc_uint16_t *digestbits)
{
int i;
......
......@@ -361,7 +361,7 @@ ns_client_logv(ns_client_t *client, isc_logcategory_t *category,
isc_logmodule_t *module, int level, const char *fmt, va_list ap) ISC_FORMAT_PRINTF(5, 0);
void
ns_client_aclmsg(const char *msg, dns_name_t *name, dns_rdatatype_t type,
ns_client_aclmsg(const char *msg, const dns_name_t *name, dns_rdatatype_t type,
dns_rdataclass_t rdclass, char *buf, size_t len);
#define NS_CLIENT_ACLMSGSIZE(x) \
......@@ -394,7 +394,7 @@ ns_client_qnamereplace(ns_client_t *client, dns_name_t *name);
isc_boolean_t
ns_client_isself(dns_view_t *myview, dns_tsigkey_t *mykey,
isc_sockaddr_t *srcaddr, isc_sockaddr_t *destaddr,
const isc_sockaddr_t *srcaddr, const isc_sockaddr_t *destaddr,
dns_rdataclass_t rdclass, void *arg);
/*%
* Isself callback.
......
......@@ -61,10 +61,10 @@ isc_result_t
ns_config_getport(const cfg_obj_t *config, in_port_t *portp);
isc_result_t
ns_config_getkeyalgorithm(const char *str, dns_name_t **name,
ns_config_getkeyalgorithm(const char *str, const dns_name_t **name,
isc_uint16_t *digestbits);
isc_result_t
ns_config_getkeyalgorithm2(const char *str, dns_name_t **name,
ns_config_getkeyalgorithm2(const char *str, const dns_name_t **name,
unsigned int *typep, isc_uint16_t *digestbits);
isc_result_t
......
......@@ -173,6 +173,6 @@ void
ns_interfacemgr_dumprecursing(FILE *f, ns_interfacemgr_t *mgr);
isc_boolean_t
ns_interfacemgr_listeningon(ns_interfacemgr_t *mgr, isc_sockaddr_t *addr);
ns_interfacemgr_listeningon(ns_interfacemgr_t *mgr, const isc_sockaddr_t *addr);
#endif /* NAMED_INTERFACEMGR_H */
......@@ -1221,7 +1221,9 @@ ns_interfacemgr_dumprecursing(FILE *f, ns_interfacemgr_t *mgr) {
}
isc_boolean_t
ns_interfacemgr_listeningon(ns_interfacemgr_t *mgr, isc_sockaddr_t *addr) {
ns_interfacemgr_listeningon(ns_interfacemgr_t *mgr,
const isc_sockaddr_t *addr)
{
isc_sockaddr_t *old;
for (old = ISC_LIST_HEAD(mgr->listenon);
......
......@@ -174,7 +174,7 @@ ns_lwsearchctx_next(ns_lwsearchctx_t *sctx) {
isc_result_t
ns_lwsearchctx_current(ns_lwsearchctx_t *sctx, dns_name_t *absname) {
dns_name_t *tname;
const dns_name_t *tname;
isc_boolean_t useexact = ISC_FALSE;
REQUIRE(sctx != NULL);
......
......@@ -757,7 +757,7 @@ query_findversion(ns_client_t *client, dns_db_t *db) {
}
static inline isc_result_t
query_validatezonedb(ns_client_t *client, dns_name_t *name,
query_validatezonedb(ns_client_t *client, const dns_name_t *name,
dns_rdatatype_t qtype, unsigned int options,
dns_zone_t *zone, dns_db_t *db,
dns_dbversion_t **versionp)
......@@ -907,9 +907,9 @@ query_validatezonedb(ns_client_t *client, dns_name_t *name,
}
static inline isc_result_t
query_getzonedb(ns_client_t *client, dns_name_t *name, dns_rdatatype_t qtype,
unsigned int options, dns_zone_t **zonep, dns_db_t **dbp,
dns_dbversion_t **versionp)
query_getzonedb(ns_client_t *client, const dns_name_t *name,
dns_rdatatype_t qtype, unsigned int options,
dns_zone_t **zonep, dns_db_t **dbp, dns_dbversion_t **versionp)
{
isc_result_t result;
unsigned int ztoptions;
......@@ -1082,8 +1082,8 @@ rpz_getdb(ns_client_t *client, dns_name_t *p_name, dns_rpz_type_t rpz_type,
}
static inline isc_result_t
query_getcachedb(ns_client_t *client, dns_name_t *name, dns_rdatatype_t qtype,
dns_db_t **dbp, unsigned int options)
query_getcachedb(ns_client_t *client, const dns_name_t *name,
dns_rdatatype_t qtype, dns_db_t **dbp, unsigned int options)
{
isc_result_t result;
isc_boolean_t check_acl;
......@@ -1314,7 +1314,7 @@ query_isduplicate(ns_client_t *client, dns_name_t *name,
}
static isc_result_t
query_addadditional(void *arg, dns_name_t *name, dns_rdatatype_t qtype) {
query_addadditional(void *arg, const dns_name_t *name, dns_rdatatype_t qtype) {
ns_client_t *client = arg;
isc_result_t result, eresult;
dns_dbnode_t *node;
......@@ -1774,7 +1774,7 @@ query_iscachevalid(dns_zone_t *zone, dns_db_t *db, dns_db_t *db0,
}
static isc_result_t
query_addadditional2(void *arg, dns_name_t *name, dns_rdatatype_t qtype) {
query_addadditional2(void *arg, const dns_name_t *name, dns_rdatatype_t qtype) {
client_additionalctx_t *additionalctx = arg;
dns_rdataset_t *rdataset_base;
ns_client_t *client;
......@@ -6999,17 +6999,18 @@ query_find(ns_client_t *client, dns_fetchevent_t *event, dns_rdatatype_t qtype)
char log_buf[DNS_RRL_LOG_BUF_LEN];
isc_result_t nc_result, resp_result;
dns_rrl_result_t rrl_result;
const dns_name_t *constname;
client->query.attributes |= NS_QUERYATTR_RRL_CHECKED;
wouldlog = isc_log_wouldlog(ns_g_lctx, DNS_RRL_LOG_DROP);
tname = fname;
constname = fname;
if (result == DNS_R_NXDOMAIN) {
/*
* Use the database origin name to rate limit NXDOMAIN
*/
if (db != NULL)
tname = dns_db_origin(db);
constname = dns_db_origin(db);
resp_result = result;
} else if (result == DNS_R_NCACHENXDOMAIN &&
rdataset != NULL &&
......@@ -7029,7 +7030,7 @@ query_find(ns_client_t *client, dns_fetchevent_t *event, dns_rdatatype_t qtype)
&nc_rdataset);
if (nc_rdataset.type == dns_rdatatype_soa) {
dns_rdataset_disassociate(&nc_rdataset);
tname = dns_fixedname_name(&fixed);
constname = dns_fixedname_name(&fixed);
break;
}
dns_rdataset_disassociate(&nc_rdataset);
......@@ -7046,14 +7047,14 @@ query_find(ns_client_t *client, dns_fetchevent_t *event, dns_rdatatype_t qtype)
* is off or not requested and the hints have not
* been loaded or we have "additional-from-cache no".
*/
tname = dns_rootname;
constname = dns_rootname;
resp_result = DNS_R_DELEGATION;
} else {
resp_result = ISC_R_SUCCESS;
}
rrl_result = dns_rrl(client->view, &client->peeraddr,
TCP(client), client->message->rdclass,
qtype, tname, resp_result, client->now,
qtype, constname, resp_result, client->now,
wouldlog, log_buf, sizeof(log_buf));
if (rrl_result != DNS_RRL_RESULT_OK) {
/*
......
......@@ -432,8 +432,9 @@ ns_listenlist_fromconfig(const cfg_obj_t *listenlist, const cfg_obj_t *config,
isc_uint16_t family, ns_listenlist_t **target);
static isc_result_t
configure_forward(const cfg_obj_t *config, dns_view_t *view, dns_name_t *origin,
const cfg_obj_t *forwarders, const cfg_obj_t *forwardtype);
configure_forward(const cfg_obj_t *config, dns_view_t *view,
const dns_name_t *origin, const cfg_obj_t *forwarders,
const cfg_obj_t *forwardtype);
static isc_result_t
configure_alternates(const cfg_obj_t *config, dns_view_t *view,
......@@ -788,7 +789,7 @@ dstkey_fromconfig(const cfg_obj_t *vconfig, const cfg_obj_t *key,
static isc_result_t
load_view_keys(const cfg_obj_t *keys, const cfg_obj_t *vconfig,
dns_view_t *view, isc_boolean_t managed,
dns_name_t *keyname, isc_mem_t *mctx)
const dns_name_t *keyname, isc_mem_t *mctx)
{
const cfg_listelt_t *elt, *elt2;
const cfg_obj_t *key, *keylist;
......@@ -2684,8 +2685,8 @@ configure_rrl(dns_view_t *view, const cfg_obj_t *config, const cfg_obj_t *map) {
}
static isc_result_t
add_soa(dns_db_t *db, dns_dbversion_t *version, dns_name_t *name,
dns_name_t *origin, dns_name_t *contact)
add_soa(dns_db_t *db, dns_dbversion_t *version, const dns_name_t *name,
const dns_name_t *origin, const dns_name_t *contact)
{
dns_dbnode_t *node = NULL;
dns_rdata_t rdata = DNS_RDATA_INIT;
......@@ -2715,8 +2716,8 @@ add_soa(dns_db_t *db, dns_dbversion_t *version, dns_name_t *name,
}
static isc_result_t
add_ns(dns_db_t *db, dns_dbversion_t *version, dns_name_t *name,
dns_name_t *nsname)
add_ns(dns_db_t *db, dns_dbversion_t *version, const dns_name_t *name,
const dns_name_t *nsname)
{
dns_dbnode_t *node = NULL;
dns_rdata_ns_t ns;
......@@ -4916,8 +4917,9 @@ configure_alternates(const cfg_obj_t *config, dns_view_t *view,
}
static isc_result_t
configure_forward(const cfg_obj_t *config, dns_view_t *view, dns_name_t *origin,
const cfg_obj_t *forwarders, const cfg_obj_t *forwardtype)
configure_forward(const cfg_obj_t *config, dns_view_t *view,
const dns_name_t *origin, const cfg_obj_t *forwarders,
const cfg_obj_t *forwardtype)
{
const cfg_obj_t *portobj, *dscpobj;
const cfg_obj_t *faddresses;
......@@ -6269,8 +6271,8 @@ cleanup_session_key(ns_server_t *server, isc_mem_t *mctx) {
static isc_result_t
generate_session_key(const char *filename, const char *keynamestr,
dns_name_t *keyname, const char *algstr,
dns_name_t *algname, unsigned int algtype,
const dns_name_t *keyname, const char *algstr,
const dns_name_t *algname, unsigned int algtype,
isc_uint16_t bits, isc_mem_t *mctx,
dns_tsigkey_t **tsigkeyp)
{
......@@ -6365,7 +6367,8 @@ configure_session_key(const cfg_obj_t **maps, ns_server_t *server,
const char *keyfile, *keynamestr, *algstr;
unsigned int algtype;
dns_fixedname_t fname;
dns_name_t *keyname, *algname;
dns_name_t *keyname;
const dns_name_t *algname;
isc_buffer_t buffer;
isc_uint16_t bits;
const cfg_obj_t *obj;
......@@ -12938,14 +12941,15 @@ ns_server_nta(ns_server_t *server, isc_lex_t *lex, isc_boolean_t readonly,
const char *msg = NULL;
isc_boolean_t dump = ISC_FALSE, force = ISC_FALSE;
dns_fixedname_t fn;
dns_name_t *ntaname;
const dns_name_t *ntaname;
dns_name_t *fname;
dns_ttl_t ntattl;
isc_boolean_t ttlset = ISC_FALSE, excl = ISC_FALSE;
UNUSED(force);
dns_fixedname_init(&fn);
ntaname = dns_fixedname_name(&fn);
fname = dns_fixedname_name(&fn);
/* Skip the command name. */
ptr = next_token(lex, text);
......@@ -13039,7 +13043,8 @@ ns_server_nta(ns_server_t *server, isc_lex_t *lex, isc_boolean_t readonly,
isc_buffer_t b;
isc_buffer_init(&b, namebuf, strlen(namebuf));
isc_buffer_add(&b, strlen(namebuf));
CHECK(dns_name_fromtext(ntaname, &b, dns_rootname, 0, NULL));
CHECK(dns_name_fromtext(fname, &b, dns_rootname, 0, NULL));
ntaname = fname;
}
/* Look for the view name. */
......
......@@ -49,7 +49,7 @@ add_initial_keys(const cfg_obj_t *list, dns_tsig_keyring_t *ring,
const cfg_obj_t *algobj = NULL;
const cfg_obj_t *secretobj = NULL;
dns_name_t keyname;
dns_name_t *alg;
const dns_name_t *alg;
const char *algstr;
char keynamedata[1024];
isc_buffer_t keynamesrc, keynamebuf;
......
......@@ -448,7 +448,7 @@ reset_system(void) {
}
static isc_uint16_t
parse_hmac(dns_name_t **hmac, const char *hmacstr, size_t len) {
parse_hmac(const dns_name_t **hmac, const char *hmacstr, size_t len) {
isc_uint16_t digestbits = 0;
isc_result_t result;
char buf[20];
......@@ -543,7 +543,7 @@ setup_keystr(void) {
dns_fixedname_t fkeyname;
dns_name_t *mykeyname;
char *name;
dns_name_t *hmacname = NULL;
const dns_name_t *hmacname = NULL;
isc_uint16_t digestbits = 0;
dns_fixedname_init(&fkeyname);
......@@ -674,7 +674,7 @@ static void
setup_keyfile(isc_mem_t *mctx, isc_log_t *lctx) {
dst_key_t *dstkey = NULL;
isc_result_t result;
dns_name_t *hmacname = NULL;
const dns_name_t *hmacname = NULL;
debug("Creating key...");
......@@ -1543,7 +1543,7 @@ evaluate_key(char *cmdline) {
int secretlen;
unsigned char *secret = NULL;
isc_buffer_t secretbuf;
dns_name_t *hmacname = NULL;
const dns_name_t *hmacname = NULL;
isc_uint16_t digestbits = 0;
char *n;
......
......@@ -31,13 +31,13 @@
#define BIGBUFLEN (64 * 1024)
static isc_result_t
t1_add_callback(void *arg, dns_name_t *owner, dns_rdataset_t *dataset);
t1_add_callback(void *arg, const dns_name_t *owner, dns_rdataset_t *dataset);
isc_mem_t *T1_mctx;
char *Tokens[T_MAXTOKS + 1];
static isc_result_t
t1_add_callback(void *arg, dns_name_t *owner, dns_rdataset_t *dataset) {
t1_add_callback(void *arg, const dns_name_t *owner, dns_rdataset_t *dataset) {
char buf[BIGBUFLEN];
isc_buffer_t target;
isc_result_t result;
......
......@@ -190,7 +190,7 @@ closeversion(dns_db_t *db, dns_dbversion_t **versionp, isc_boolean_t commit) {
}
static isc_result_t
findnode(dns_db_t *db, dns_name_t *name, isc_boolean_t create,
findnode(dns_db_t *db, const dns_name_t *name, isc_boolean_t create,
dns_dbnode_t **nodep)
{
sampledb_t *sampledb = (sampledb_t *) db;
......@@ -201,7 +201,7 @@ findnode(dns_db_t *db, dns_name_t *name, isc_boolean_t create,
}
static isc_result_t
find(dns_db_t *db, dns_name_t *name, dns_dbversion_t *version,
find(dns_db_t *db, const dns_name_t *name, dns_dbversion_t *version,
dns_rdatatype_t type, unsigned int options, isc_stdtime_t now,
dns_dbnode_t **nodep, dns_name_t *foundname, dns_rdataset_t *rdataset,
dns_rdataset_t *sigrdataset)
......@@ -216,7 +216,7 @@ find(dns_db_t *db, dns_name_t *name, dns_dbversion_t *version,
}
static isc_result_t
findzonecut(dns_db_t *db, dns_name_t *name, unsigned int options,
findzonecut(dns_db_t *db, const dns_name_t *name, unsigned int options,
isc_stdtime_t now, dns_dbnode_t **nodep, dns_name_t *foundname,
dns_rdataset_t *rdataset, dns_rdataset_t *sigrdataset)
{
......@@ -454,7 +454,7 @@ getnsec3parameters(dns_db_t *db, dns_dbversion_t *version,
}
static isc_result_t
findnsec3node(dns_db_t *db, dns_name_t *name, isc_boolean_t create,
findnsec3node(dns_db_t *db, const dns_name_t *name, isc_boolean_t create,
dns_dbnode_t **nodep)
{
sampledb_t *sampledb = (sampledb_t *) db;
......@@ -529,7 +529,7 @@ rpz_ready(dns_db_t *db) {
}
static isc_result_t
findnodeext(dns_db_t *db, dns_name_t *name,
findnodeext(dns_db_t *db, const dns_name_t *name,
isc_boolean_t create, dns_clientinfomethods_t *methods,
dns_clientinfo_t *clientinfo, dns_dbnode_t **nodep)
{
......@@ -542,7 +542,7 @@ findnodeext(dns_db_t *db, dns_name_t *name,
}
static isc_result_t
findext(dns_db_t *db, dns_name_t *name, dns_dbversion_t *version,
findext(dns_db_t *db, const dns_name_t *name, dns_dbversion_t *version,
dns_rdatatype_t type, unsigned int options, isc_stdtime_t now,
dns_dbnode_t **nodep, dns_name_t *foundname,
dns_clientinfomethods_t *methods, dns_clientinfo_t *clientinfo,
......@@ -639,8 +639,8 @@ static dns_dbmethods_t sampledb_methods = {
* credit goes to ISC.
*/
static isc_result_t
add_soa(dns_db_t *db, dns_dbversion_t *version, dns_name_t *name,
dns_name_t *origin, dns_name_t *contact)
add_soa(dns_db_t *db, dns_dbversion_t *version, const dns_name_t *name,
const dns_name_t *origin, const dns_name_t *contact)
{
dns_dbnode_t *node = NULL;
dns_rdata_t rdata = DNS_RDATA_INIT;
......@@ -669,8 +669,8 @@ add_soa(dns_db_t *db, dns_dbversion_t *version, dns_name_t *name,
static isc_result_t
add_ns(dns_db_t *db, dns_dbversion_t *version, dns_name_t *name,
dns_name_t *nsname)
add_ns(dns_db_t *db, dns_dbversion_t *version, const dns_name_t *name,
const dns_name_t *nsname)
{
dns_dbnode_t *node = NULL;
dns_rdata_ns_t ns;
......@@ -707,7 +707,7 @@ add_ns(dns_db_t *db, dns_dbversion_t *version, dns_name_t *name,
}
static isc_result_t
add_a(dns_db_t *db, dns_dbversion_t *version, dns_name_t *name,
add_a(dns_db_t *db, dns_dbversion_t *version, const dns_name_t *name,
struct in_addr addr)
{
dns_dbnode_t *node = NULL;
......@@ -749,7 +749,7 @@ add_a(dns_db_t *db, dns_dbversion_t *version, dns_name_t *name,
* @param[in] driverarg Driver-specific parameter from dns_db_register().
*/
isc_result_t
create_db(isc_mem_t *mctx, dns_name_t *origin, dns_dbtype_t type,
create_db(isc_mem_t *mctx, const dns_name_t *origin, dns_dbtype_t type,
dns_rdataclass_t rdclass, unsigned int argc, char *argv[],
void *driverarg, dns_db_t **dbp)
{
......
......@@ -8,7 +8,7 @@
#define DB_H_
isc_result_t
create_db(isc_mem_t *mctx, dns_name_t *origin, dns_dbtype_t type,
create_db(isc_mem_t *mctx, const dns_name_t *origin, dns_dbtype_t type,
dns_rdataclass_t rdclass, unsigned int argc, char *argv[],
void *driverarg, dns_db_t **dbp);
......
......@@ -281,12 +281,13 @@ struct dns_adbentry {
/*
* Internal functions (and prototypes).
*/
static inline dns_adbname_t *new_adbname(dns_adb_t *, dns_name_t *);
static inline dns_adbname_t *new_adbname(dns_adb_t *, const dns_name_t *);
static inline void free_adbname(dns_adb_t *, dns_adbname_t **);
static inline dns_adbnamehook_t *new_adbnamehook(dns_adb_t *,
dns_adbentry_t *);
static inline void free_adbnamehook(dns_adb_t *, dns_adbnamehook_t **);
static inline dns_adblameinfo_t *new_adblameinfo(dns_adb_t *, dns_name_t *,
static inline dns_adblameinfo_t *new_adblameinfo(dns_adb_t *,
const dns_name_t *,
dns_rdatatype_t);
static inline void free_adblameinfo(dns_adb_t *, dns_adblameinfo_t **);
static inline dns_adbentry_t *new_adbentry(dns_adb_t *);
......@@ -297,13 +298,14 @@ static inline dns_adbaddrinfo_t *new_adbaddrinfo(dns_adb_t *, dns_adbentry_t *,
in_port_t);
static inline dns_adbfetch_t *new_adbfetch(dns_adb_t *);
static inline void free_adbfetch(dns_adb_t *, dns_adbfetch_t **);
static inline dns_adbname_t *find_name_and_lock(dns_adb_t *, dns_name_t *,
static inline dns_adbname_t *find_name_and_lock(dns_adb_t *,
const dns_name_t *,
unsigned int, int *);
static inline dns_adbentry_t *find_entry_and_lock(dns_adb_t *,
isc_sockaddr_t *, int *,
isc_stdtime_t);
const isc_sockaddr_t *,
int *, isc_stdtime_t);
static void dump_adb(dns_adb_t *, FILE *, isc_boolean_t debug, isc_stdtime_t);
static void print_dns_name(FILE *, dns_name_t *);
static void print_dns_name(FILE *, const dns_name_t *);
static void print_namehook_list(FILE *, const char *legend,
dns_adb_t *adb,
dns_adbnamehooklist_t *list,
......@@ -1375,7 +1377,7 @@ clean_target(dns_adb_t *adb, dns_name_t *target) {
}
static isc_result_t
set_target(dns_adb_t *adb, dns_name_t *name, dns_name_t *fname,
set_target(dns_adb_t *adb, const dns_name_t *name, const dns_name_t *fname,
dns_rdataset_t *rdataset, dns_name_t *target)
{
isc_result_t result;
......@@ -1663,7 +1665,7 @@ dec_entry_refcnt(dns_adb_t *adb, isc_boolean_t overmem, dns_adbentry_t *entry,
}
static inline dns_adbname_t *
new_adbname(dns_adb_t *adb, dns_name_t *dnsname) {
new_adbname(dns_adb_t *adb, const dns_name_t *dnsname) {
dns_adbname_t *name;
name = isc_mempool_get(adb->nmp);
......@@ -1767,7 +1769,9 @@ free_adbnamehook(dns_adb_t *adb, dns_adbnamehook_t **namehook) {
}
static inline dns_adblameinfo_t *
new_adblameinfo(dns_adb_t *adb, dns_name_t *qname, dns_rdatatype_t qtype) {
new_adblameinfo(dns_adb_t *adb, const dns_name_t *qname,
dns_rdatatype_t qtype)
{
dns_adblameinfo_t *li;
li = isc_mempool_get(adb->limp);
......@@ -2034,7 +2038,7 @@ free_adbaddrinfo(dns_adb_t *adb, dns_adbaddrinfo_t **ainfo) {
* DNS_ADB_INVALIDBUCKET.
*/
static inline dns_adbname_t *
find_name_and_lock(dns_adb_t *adb, dns_name_t *name,
find_name_and_lock(dns_adb_t *adb, const dns_name_t *name,
unsigned int options, int *bucketp)
{
dns_adbname_t *adbname;
......@@ -2076,7 +2080,7 @@ find_name_and_lock(dns_adb_t *adb, dns_name_t *name,
* the bucket changes.
*/
static inline dns_adbentry_t *
find_entry_and_lock(dns_adb_t *adb, isc_sockaddr_t *addr, int *bucketp,
find_entry_and_lock(dns_adb_t *adb, const isc_sockaddr_t *addr, int *bucketp,
isc_stdtime_t now)
{
dns_adbentry_t *entry, *entry_next;
......@@ -2115,7 +2119,7 @@ find_entry_and_lock(dns_adb_t *adb, isc_sockaddr_t *addr, int *bucketp,
* Entry bucket MUST be locked!
*/
static isc_boolean_t
entry_is_lame(dns_adb_t *adb, dns_adbentry_t *entry, dns_name_t *qname,
entry_is_lame(dns_adb_t *adb, dns_adbentry_t *entry, const dns_name_t *qname,
dns_rdatatype_t qtype, isc_stdtime_t now)