1991. [cleanup] The configuration data, once read, should be treated

as readonly.  Expand the use of const to enforce this
                        at compile time. [RT #15813]
This commit is contained in:
Mark Andrews 2006-02-28 02:39:52 +00:00
parent c4008fdd56
commit 45e1bd6358
50 changed files with 832 additions and 768 deletions

View file

@ -1,3 +1,7 @@
1991. [cleanup] The configuration data, once read, should be treated
as readonly. Expand the use of const to enforce this
at compile time. [RT #15813]
1990. [bug] libbind: isc's override of broken gettimeofday()
implementions was not always effective.
[RT #15709]

View file

@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
/* $Id: named-checkconf.c,v 1.41 2006/01/07 00:23:35 marka Exp $ */
/* $Id: named-checkconf.c,v 1.42 2006/02/28 02:39:51 marka Exp $ */
/*! \file */
@ -66,7 +66,7 @@ usage(void) {
/*% directory callback */
static isc_result_t
directory_callback(const char *clausename, cfg_obj_t *obj, void *arg) {
directory_callback(const char *clausename, const cfg_obj_t *obj, void *arg) {
isc_result_t result;
const char *directory;
@ -91,7 +91,7 @@ directory_callback(const char *clausename, cfg_obj_t *obj, void *arg) {
}
static isc_boolean_t
get_maps(cfg_obj_t **maps, const char *name, cfg_obj_t **obj) {
get_maps(const cfg_obj_t **maps, const char *name, const cfg_obj_t **obj) {
int i;
for (i = 0;; i++) {
if (maps[i] == NULL)
@ -102,11 +102,11 @@ get_maps(cfg_obj_t **maps, const char *name, cfg_obj_t **obj) {
}
static isc_boolean_t
get_checknames(cfg_obj_t **maps, cfg_obj_t **obj) {
cfg_listelt_t *element;
cfg_obj_t *checknames;
cfg_obj_t *type;
cfg_obj_t *value;
get_checknames(const cfg_obj_t **maps, const cfg_obj_t **obj) {
const cfg_listelt_t *element;
const cfg_obj_t *checknames;
const cfg_obj_t *type;
const cfg_obj_t *value;
isc_result_t result;
int i;
@ -135,7 +135,7 @@ get_checknames(cfg_obj_t **maps, cfg_obj_t **obj) {
}
static isc_result_t
config_get(cfg_obj_t **maps, const char *name, cfg_obj_t **obj) {
config_get(const cfg_obj_t **maps, const char *name, const cfg_obj_t **obj) {
int i;
for (i = 0;; i++) {
@ -148,22 +148,23 @@ config_get(cfg_obj_t **maps, const char *name, cfg_obj_t **obj) {
/*% configure the zone */
static isc_result_t
configure_zone(const char *vclass, const char *view, cfg_obj_t *zconfig,
cfg_obj_t *vconfig, cfg_obj_t *config, isc_mem_t *mctx)
configure_zone(const char *vclass, const char *view,
const cfg_obj_t *zconfig, const cfg_obj_t *vconfig,
const cfg_obj_t *config, isc_mem_t *mctx)
{
int i = 0;
isc_result_t result;
const char *zclass;
const char *zname;
const char *zfile;
cfg_obj_t *maps[4];
cfg_obj_t *zoptions = NULL;
cfg_obj_t *classobj = NULL;
cfg_obj_t *typeobj = NULL;
cfg_obj_t *fileobj = NULL;
cfg_obj_t *dbobj = NULL;
cfg_obj_t *obj = NULL;
cfg_obj_t *fmtobj = NULL;
const cfg_obj_t *maps[4];
const cfg_obj_t *zoptions = NULL;
const cfg_obj_t *classobj = NULL;
const cfg_obj_t *typeobj = NULL;
const cfg_obj_t *fileobj = NULL;
const cfg_obj_t *dbobj = NULL;
const cfg_obj_t *obj = NULL;
const cfg_obj_t *fmtobj = NULL;
dns_masterformat_t masterformat;
zone_options = DNS_ZONEOPT_CHECKNS | DNS_ZONEOPT_MANYERRORS;
@ -309,12 +310,12 @@ configure_zone(const char *vclass, const char *view, cfg_obj_t *zconfig,
/*% configure a view */
static isc_result_t
configure_view(const char *vclass, const char *view, cfg_obj_t *config,
cfg_obj_t *vconfig, isc_mem_t *mctx)
configure_view(const char *vclass, const char *view, const cfg_obj_t *config,
const cfg_obj_t *vconfig, isc_mem_t *mctx)
{
cfg_listelt_t *element;
cfg_obj_t *voptions;
cfg_obj_t *zonelist;
const cfg_listelt_t *element;
const cfg_obj_t *voptions;
const cfg_obj_t *zonelist;
isc_result_t result = ISC_R_SUCCESS;
isc_result_t tresult;
@ -332,7 +333,7 @@ configure_view(const char *vclass, const char *view, cfg_obj_t *config,
element != NULL;
element = cfg_list_next(element))
{
cfg_obj_t *zconfig = cfg_listelt_value(element);
const cfg_obj_t *zconfig = cfg_listelt_value(element);
tresult = configure_zone(vclass, view, zconfig, vconfig,
config, mctx);
if (tresult != ISC_R_SUCCESS)
@ -344,11 +345,11 @@ configure_view(const char *vclass, const char *view, cfg_obj_t *config,
/*% load zones from the configuration */
static isc_result_t
load_zones_fromconfig(cfg_obj_t *config, isc_mem_t *mctx) {
cfg_listelt_t *element;
cfg_obj_t *classobj;
cfg_obj_t *views;
cfg_obj_t *vconfig;
load_zones_fromconfig(const cfg_obj_t *config, isc_mem_t *mctx) {
const cfg_listelt_t *element;
const cfg_obj_t *classobj;
const cfg_obj_t *views;
const cfg_obj_t *vconfig;
const char *vclass;
isc_result_t result = ISC_R_SUCCESS;
isc_result_t tresult;

View file

@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
/* $Id: config.c,v 1.68 2006/01/27 02:35:14 marka Exp $ */
/* $Id: config.c,v 1.69 2006/02/28 02:39:51 marka Exp $ */
/*! \file */
@ -216,7 +216,7 @@ ns_config_parsedefaults(cfg_parser_t *parser, cfg_obj_t **conf) {
}
isc_result_t
ns_config_get(cfg_obj_t **maps, const char *name, cfg_obj_t **obj) {
ns_config_get(const cfg_obj_t **maps, const char *name, const cfg_obj_t **obj) {
int i;
for (i = 0;; i++) {
@ -228,11 +228,13 @@ ns_config_get(cfg_obj_t **maps, const char *name, cfg_obj_t **obj) {
}
isc_result_t
ns_checknames_get(cfg_obj_t **maps, const char *which, cfg_obj_t **obj) {
cfg_listelt_t *element;
cfg_obj_t *checknames;
cfg_obj_t *type;
cfg_obj_t *value;
ns_checknames_get(const cfg_obj_t **maps, const char *which,
const cfg_obj_t **obj)
{
const cfg_listelt_t *element;
const cfg_obj_t *checknames;
const cfg_obj_t *type;
const cfg_obj_t *value;
int i;
for (i = 0;; i++) {
@ -263,8 +265,8 @@ ns_checknames_get(cfg_obj_t **maps, const char *which, cfg_obj_t **obj) {
}
int
ns_config_listcount(cfg_obj_t *list) {
cfg_listelt_t *e;
ns_config_listcount(const cfg_obj_t *list) {
const cfg_listelt_t *e;
int i = 0;
for (e = cfg_list_first(list); e != NULL; e = cfg_list_next(e))
@ -274,7 +276,7 @@ ns_config_listcount(cfg_obj_t *list) {
}
isc_result_t
ns_config_getclass(cfg_obj_t *classobj, dns_rdataclass_t defclass,
ns_config_getclass(const cfg_obj_t *classobj, dns_rdataclass_t defclass,
dns_rdataclass_t *classp) {
isc_textregion_t r;
isc_result_t result;
@ -293,7 +295,7 @@ ns_config_getclass(cfg_obj_t *classobj, dns_rdataclass_t defclass,
}
isc_result_t
ns_config_gettype(cfg_obj_t *typeobj, dns_rdatatype_t deftype,
ns_config_gettype(const cfg_obj_t *typeobj, dns_rdatatype_t deftype,
dns_rdatatype_t *typep) {
isc_textregion_t r;
isc_result_t result;
@ -312,7 +314,7 @@ ns_config_gettype(cfg_obj_t *typeobj, dns_rdatatype_t deftype,
}
dns_zonetype_t
ns_config_getzonetype(cfg_obj_t *zonetypeobj) {
ns_config_getzonetype(const cfg_obj_t *zonetypeobj) {
dns_zonetype_t ztype = dns_zone_none;
const char *str;
@ -329,14 +331,14 @@ ns_config_getzonetype(cfg_obj_t *zonetypeobj) {
}
isc_result_t
ns_config_getiplist(cfg_obj_t *config, cfg_obj_t *list,
ns_config_getiplist(const cfg_obj_t *config, const cfg_obj_t *list,
in_port_t defport, isc_mem_t *mctx,
isc_sockaddr_t **addrsp, isc_uint32_t *countp)
{
int count, i = 0;
cfg_obj_t *addrlist;
cfg_obj_t *portobj;
cfg_listelt_t *element;
const cfg_obj_t *addrlist;
const cfg_obj_t *portobj;
const cfg_listelt_t *element;
isc_sockaddr_t *addrs;
in_port_t port;
isc_result_t result;
@ -396,10 +398,12 @@ ns_config_putiplist(isc_mem_t *mctx, isc_sockaddr_t **addrsp,
}
static isc_result_t
get_masters_def(cfg_obj_t *cctx, const char *name, cfg_obj_t **ret) {
get_masters_def(const cfg_obj_t *cctx, const char *name,
const cfg_obj_t **ret)
{
isc_result_t result;
cfg_obj_t *masters = NULL;
cfg_listelt_t *elt;
const cfg_obj_t *masters = NULL;
const cfg_listelt_t *elt;
result = cfg_map_get(cctx, "masters", &masters);
if (result != ISC_R_SUCCESS)
@ -407,7 +411,7 @@ get_masters_def(cfg_obj_t *cctx, const char *name, cfg_obj_t **ret) {
for (elt = cfg_list_first(masters);
elt != NULL;
elt = cfg_list_next(elt)) {
cfg_obj_t *list;
const cfg_obj_t *list;
const char *listname;
list = cfg_listelt_value(elt);
@ -422,24 +426,24 @@ get_masters_def(cfg_obj_t *cctx, const char *name, cfg_obj_t **ret) {
}
isc_result_t
ns_config_getipandkeylist(cfg_obj_t *config, cfg_obj_t *list, isc_mem_t *mctx,
isc_sockaddr_t **addrsp, dns_name_t ***keysp,
isc_uint32_t *countp)
ns_config_getipandkeylist(const cfg_obj_t *config, const cfg_obj_t *list,
isc_mem_t *mctx, isc_sockaddr_t **addrsp,
dns_name_t ***keysp, isc_uint32_t *countp)
{
isc_uint32_t addrcount = 0, keycount = 0, i = 0;
isc_uint32_t listcount = 0, l = 0, j;
isc_uint32_t stackcount = 0, pushed = 0;
isc_result_t result;
cfg_listelt_t *element;
cfg_obj_t *addrlist;
cfg_obj_t *portobj;
const cfg_listelt_t *element;
const cfg_obj_t *addrlist;
const cfg_obj_t *portobj;
in_port_t port;
dns_fixedname_t fname;
isc_sockaddr_t *addrs = NULL;
dns_name_t **keys = NULL;
struct { const char *name; } *lists = NULL;
struct {
cfg_listelt_t *element;
const cfg_listelt_t *element;
in_port_t port;
} *stack = NULL;
@ -473,8 +477,8 @@ ns_config_getipandkeylist(cfg_obj_t *config, cfg_obj_t *list, isc_mem_t *mctx,
element != NULL;
element = cfg_list_next(element))
{
cfg_obj_t *addr;
cfg_obj_t *key;
const cfg_obj_t *addr;
const cfg_obj_t *key;
const char *keystr;
isc_buffer_t b;
@ -699,10 +703,10 @@ ns_config_putipandkeylist(isc_mem_t *mctx, isc_sockaddr_t **addrsp,
}
isc_result_t
ns_config_getport(cfg_obj_t *config, in_port_t *portp) {
cfg_obj_t *maps[3];
cfg_obj_t *options = NULL;
cfg_obj_t *portobj = NULL;
ns_config_getport(const cfg_obj_t *config, in_port_t *portp) {
const cfg_obj_t *maps[3];
const cfg_obj_t *options = NULL;
const cfg_obj_t *portobj = NULL;
isc_result_t result;
int i;

View file

@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
/* $Id: controlconf.c,v 1.49 2006/01/27 23:57:46 marka Exp $ */
/* $Id: controlconf.c,v 1.50 2006/02/28 02:39:51 marka Exp $ */
/*! \file */
@ -659,10 +659,12 @@ ns_controls_shutdown(ns_controls_t *controls) {
}
static isc_result_t
cfgkeylist_find(cfg_obj_t *keylist, const char *keyname, cfg_obj_t **objp) {
cfg_listelt_t *element;
cfgkeylist_find(const cfg_obj_t *keylist, const char *keyname,
const cfg_obj_t **objp)
{
const cfg_listelt_t *element;
const char *str;
cfg_obj_t *obj;
const cfg_obj_t *obj;
for (element = cfg_list_first(keylist);
element != NULL;
@ -681,13 +683,13 @@ cfgkeylist_find(cfg_obj_t *keylist, const char *keyname, cfg_obj_t **objp) {
}
static isc_result_t
controlkeylist_fromcfg(cfg_obj_t *keylist, isc_mem_t *mctx,
controlkeylist_fromcfg(const cfg_obj_t *keylist, isc_mem_t *mctx,
controlkeylist_t *keyids)
{
cfg_listelt_t *element;
const cfg_listelt_t *element;
char *newstr = NULL;
const char *str;
cfg_obj_t *obj;
const cfg_obj_t *obj;
controlkey_t *key = NULL;
for (element = cfg_list_first(keylist);
@ -722,11 +724,11 @@ controlkeylist_fromcfg(cfg_obj_t *keylist, isc_mem_t *mctx,
}
static void
register_keys(cfg_obj_t *control, cfg_obj_t *keylist,
register_keys(const cfg_obj_t *control, const cfg_obj_t *keylist,
controlkeylist_t *keyids, isc_mem_t *mctx, const char *socktext)
{
controlkey_t *keyid, *next;
cfg_obj_t *keydef;
const cfg_obj_t *keydef;
char secret[1024];
isc_buffer_t b;
isc_result_t result;
@ -746,8 +748,8 @@ register_keys(cfg_obj_t *control, cfg_obj_t *keylist,
ISC_LIST_UNLINK(*keyids, keyid, link);
free_controlkey(keyid, mctx);
} else {
cfg_obj_t *algobj = NULL;
cfg_obj_t *secretobj = NULL;
const cfg_obj_t *algobj = NULL;
const cfg_obj_t *secretobj = NULL;
const char *algstr = NULL;
const char *secretstr = NULL;
@ -815,9 +817,9 @@ get_rndckey(isc_mem_t *mctx, controlkeylist_t *keyids) {
isc_result_t result;
cfg_parser_t *pctx = NULL;
cfg_obj_t *config = NULL;
cfg_obj_t *key = NULL;
cfg_obj_t *algobj = NULL;
cfg_obj_t *secretobj = NULL;
const cfg_obj_t *key = NULL;
const cfg_obj_t *algobj = NULL;
const cfg_obj_t *secretobj = NULL;
const char *algstr = NULL;
const char *secretstr = NULL;
controlkey_t *keyid = NULL;
@ -898,12 +900,13 @@ get_rndckey(isc_mem_t *mctx, controlkeylist_t *keyids) {
* valid or both are NULL.
*/
static void
get_key_info(cfg_obj_t *config, cfg_obj_t *control,
cfg_obj_t **global_keylistp, cfg_obj_t **control_keylistp)
get_key_info(const cfg_obj_t *config, const cfg_obj_t *control,
const cfg_obj_t **global_keylistp,
const cfg_obj_t **control_keylistp)
{
isc_result_t result;
cfg_obj_t *control_keylist = NULL;
cfg_obj_t *global_keylist = NULL;
const cfg_obj_t *control_keylist = NULL;
const cfg_obj_t *global_keylist = NULL;
REQUIRE(global_keylistp != NULL && *global_keylistp == NULL);
REQUIRE(control_keylistp != NULL && *control_keylistp == NULL);
@ -922,16 +925,15 @@ get_key_info(cfg_obj_t *config, cfg_obj_t *control,
}
static void
update_listener(ns_controls_t *cp,
controllistener_t **listenerp, cfg_obj_t *control,
cfg_obj_t *config, isc_sockaddr_t *addr,
cfg_aclconfctx_t *aclconfctx, const char *socktext,
isc_sockettype_t type)
update_listener(ns_controls_t *cp, controllistener_t **listenerp,
const cfg_obj_t *control, const cfg_obj_t *config,
isc_sockaddr_t *addr, cfg_aclconfctx_t *aclconfctx,
const char *socktext, isc_sockettype_t type)
{
controllistener_t *listener;
cfg_obj_t *allow;
cfg_obj_t *global_keylist = NULL;
cfg_obj_t *control_keylist = NULL;
const cfg_obj_t *allow;
const cfg_obj_t *global_keylist = NULL;
const cfg_obj_t *control_keylist = NULL;
dns_acl_t *new_acl = NULL;
controlkeylist_t keys;
isc_result_t result = ISC_R_SUCCESS;
@ -1062,15 +1064,15 @@ update_listener(ns_controls_t *cp,
static void
add_listener(ns_controls_t *cp, controllistener_t **listenerp,
cfg_obj_t *control, cfg_obj_t *config, isc_sockaddr_t *addr,
cfg_aclconfctx_t *aclconfctx, const char *socktext,
isc_sockettype_t type)
const cfg_obj_t *control, const cfg_obj_t *config,
isc_sockaddr_t *addr, cfg_aclconfctx_t *aclconfctx,
const char *socktext, isc_sockettype_t type)
{
isc_mem_t *mctx = cp->server->mctx;
controllistener_t *listener;
cfg_obj_t *allow;
cfg_obj_t *global_keylist = NULL;
cfg_obj_t *control_keylist = NULL;
const cfg_obj_t *allow;
const cfg_obj_t *global_keylist = NULL;
const cfg_obj_t *control_keylist = NULL;
dns_acl_t *new_acl = NULL;
isc_result_t result = ISC_R_SUCCESS;
@ -1200,13 +1202,13 @@ add_listener(ns_controls_t *cp, controllistener_t **listenerp,
}
isc_result_t
ns_controls_configure(ns_controls_t *cp, cfg_obj_t *config,
ns_controls_configure(ns_controls_t *cp, const cfg_obj_t *config,
cfg_aclconfctx_t *aclconfctx)
{
controllistener_t *listener;
controllistenerlist_t new_listeners;
cfg_obj_t *controlslist = NULL;
cfg_listelt_t *element, *element2;
const cfg_obj_t *controlslist = NULL;
const cfg_listelt_t *element, *element2;
char socktext[ISC_SOCKADDR_FORMATSIZE];
ISC_LIST_INIT(new_listeners);
@ -1228,8 +1230,8 @@ ns_controls_configure(ns_controls_t *cp, cfg_obj_t *config,
for (element = cfg_list_first(controlslist);
element != NULL;
element = cfg_list_next(element)) {
cfg_obj_t *controls;
cfg_obj_t *inetcontrols = NULL;
const cfg_obj_t *controls;
const cfg_obj_t *inetcontrols = NULL;
controls = cfg_listelt_value(element);
(void)cfg_map_get(controls, "inet", &inetcontrols);
@ -1239,9 +1241,9 @@ ns_controls_configure(ns_controls_t *cp, cfg_obj_t *config,
for (element2 = cfg_list_first(inetcontrols);
element2 != NULL;
element2 = cfg_list_next(element2)) {
cfg_obj_t *control;
cfg_obj_t *obj;
isc_sockaddr_t *addr;
const cfg_obj_t *control;
const cfg_obj_t *obj;
isc_sockaddr_t addr;
/*
* The parser handles BIND 8 configuration file
@ -1251,12 +1253,12 @@ ns_controls_configure(ns_controls_t *cp, cfg_obj_t *config,
control = cfg_listelt_value(element2);
obj = cfg_tuple_get(control, "address");
addr = cfg_obj_assockaddr(obj);
if (isc_sockaddr_getport(addr) == 0)
isc_sockaddr_setport(addr,
addr = *cfg_obj_assockaddr(obj);
if (isc_sockaddr_getport(&addr) == 0)
isc_sockaddr_setport(&addr,
NS_CONTROL_PORT);
isc_sockaddr_format(addr, socktext,
isc_sockaddr_format(&addr, socktext,
sizeof(socktext));
isc_log_write(ns_g_lctx,
@ -1267,7 +1269,7 @@ ns_controls_configure(ns_controls_t *cp, cfg_obj_t *config,
socktext);
update_listener(cp, &listener, control, config,
addr, aclconfctx, socktext,
&addr, aclconfctx, socktext,
isc_sockettype_tcp);
if (listener != NULL)
@ -1282,7 +1284,7 @@ ns_controls_configure(ns_controls_t *cp, cfg_obj_t *config,
* This is a new listener.
*/
add_listener(cp, &listener, control,
config, addr, aclconfctx,
config, &addr, aclconfctx,
socktext,
isc_sockettype_tcp);
@ -1294,8 +1296,8 @@ ns_controls_configure(ns_controls_t *cp, cfg_obj_t *config,
for (element = cfg_list_first(controlslist);
element != NULL;
element = cfg_list_next(element)) {
cfg_obj_t *controls;
cfg_obj_t *unixcontrols = NULL;
const cfg_obj_t *controls;
const cfg_obj_t *unixcontrols = NULL;
controls = cfg_listelt_value(element);
(void)cfg_map_get(controls, "unix", &unixcontrols);
@ -1305,8 +1307,8 @@ ns_controls_configure(ns_controls_t *cp, cfg_obj_t *config,
for (element2 = cfg_list_first(unixcontrols);
element2 != NULL;
element2 = cfg_list_next(element2)) {
cfg_obj_t *control;
cfg_obj_t *path;
const cfg_obj_t *control;
const cfg_obj_t *path;
isc_sockaddr_t addr;
isc_result_t result;

View file

@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
/* $Id: config.h,v 1.11 2006/01/27 23:57:46 marka Exp $ */
/* $Id: config.h,v 1.12 2006/02/28 02:39:51 marka Exp $ */
#ifndef NAMED_CONFIG_H
#define NAMED_CONFIG_H 1
@ -31,27 +31,28 @@ isc_result_t
ns_config_parsedefaults(cfg_parser_t *parser, cfg_obj_t **conf);
isc_result_t
ns_config_get(cfg_obj_t **maps, const char* name, cfg_obj_t **obj);
ns_config_get(const cfg_obj_t **maps, const char* name, const cfg_obj_t **obj);
isc_result_t
ns_checknames_get(cfg_obj_t **maps, const char* name, cfg_obj_t **obj);
ns_checknames_get(const cfg_obj_t **maps, const char* name,
const cfg_obj_t **obj);
int
ns_config_listcount(cfg_obj_t *list);
ns_config_listcount(const cfg_obj_t *list);
isc_result_t
ns_config_getclass(cfg_obj_t *classobj, dns_rdataclass_t defclass,
ns_config_getclass(const cfg_obj_t *classobj, dns_rdataclass_t defclass,
dns_rdataclass_t *classp);
isc_result_t
ns_config_gettype(cfg_obj_t *typeobj, dns_rdatatype_t deftype,
ns_config_gettype(const cfg_obj_t *typeobj, dns_rdatatype_t deftype,
dns_rdatatype_t *typep);
dns_zonetype_t
ns_config_getzonetype(cfg_obj_t *zonetypeobj);
ns_config_getzonetype(const cfg_obj_t *zonetypeobj);
isc_result_t
ns_config_getiplist(cfg_obj_t *config, cfg_obj_t *list,
ns_config_getiplist(const cfg_obj_t *config, const cfg_obj_t *list,
in_port_t defport, isc_mem_t *mctx,
isc_sockaddr_t **addrsp, isc_uint32_t *countp);
@ -60,16 +61,16 @@ ns_config_putiplist(isc_mem_t *mctx, isc_sockaddr_t **addrsp,
isc_uint32_t count);
isc_result_t
ns_config_getipandkeylist(cfg_obj_t *config, cfg_obj_t *list, isc_mem_t *mctx,
isc_sockaddr_t **addrsp, dns_name_t ***keys,
isc_uint32_t *countp);
ns_config_getipandkeylist(const cfg_obj_t *config, const cfg_obj_t *list,
isc_mem_t *mctx, isc_sockaddr_t **addrsp,
dns_name_t ***keys, isc_uint32_t *countp);
void
ns_config_putipandkeylist(isc_mem_t *mctx, isc_sockaddr_t **addrsp,
dns_name_t ***keys, isc_uint32_t count);
isc_result_t
ns_config_getport(cfg_obj_t *config, in_port_t *portp);
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,

View file

@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
/* $Id: control.h,v 1.19 2005/04/27 04:55:57 sra Exp $ */
/* $Id: control.h,v 1.20 2006/02/28 02:39:51 marka Exp $ */
#ifndef NAMED_CONTROL_H
#define NAMED_CONTROL_H 1
@ -71,7 +71,7 @@ ns_controls_destroy(ns_controls_t **ctrlsp);
*/
isc_result_t
ns_controls_configure(ns_controls_t *controls, cfg_obj_t *config,
ns_controls_configure(ns_controls_t *controls, const cfg_obj_t *config,
cfg_aclconfctx_t *aclconfctx);
/*%<
* Configure zero or more command channels into 'controls'

View file

@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
/* $Id: globals.h,v 1.66 2005/04/29 00:22:30 marka Exp $ */
/* $Id: globals.h,v 1.67 2006/02/28 02:39:51 marka Exp $ */
#ifndef NAMED_GLOBALS_H
#define NAMED_GLOBALS_H 1
@ -77,7 +77,7 @@ EXTERN unsigned int ns_g_debuglevel INIT(0);
* Current configuration information.
*/
EXTERN cfg_obj_t * ns_g_config INIT(NULL);
EXTERN cfg_obj_t * ns_g_defaults INIT(NULL);
EXTERN const cfg_obj_t * ns_g_defaults INIT(NULL);
EXTERN const char * ns_g_conffile INIT(NS_SYSCONFDIR
"/named.conf");
EXTERN const char * ns_g_keyfile INIT(NS_SYSCONFDIR

View file

@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
/* $Id: logconf.h,v 1.13 2005/04/29 00:22:30 marka Exp $ */
/* $Id: logconf.h,v 1.14 2006/02/28 02:39:51 marka Exp $ */
#ifndef NAMED_LOGCONF_H
#define NAMED_LOGCONF_H 1
@ -25,7 +25,7 @@
#include <isc/log.h>
isc_result_t
ns_log_configure(isc_logconfig_t *logconf, cfg_obj_t *logstmt);
ns_log_configure(isc_logconfig_t *logconf, const cfg_obj_t *logstmt);
/*%<
* Set up the logging configuration in '*logconf' according to
* the named.conf data in 'logstmt'.

View file

@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
/* $Id: lwresd.h,v 1.15 2005/04/29 00:22:31 marka Exp $ */
/* $Id: lwresd.h,v 1.16 2006/02/28 02:39:51 marka Exp $ */
#ifndef NAMED_LWRESD_H
#define NAMED_LWRESD_H 1
@ -58,7 +58,7 @@ struct ns_lwreslistener {
* Configure lwresd.
*/
isc_result_t
ns_lwresd_configure(isc_mem_t *mctx, cfg_obj_t *config);
ns_lwresd_configure(isc_mem_t *mctx, const cfg_obj_t *config);
isc_result_t
ns_lwresd_parseeresolvconf(isc_mem_t *mctx, cfg_parser_t *pctx,
@ -75,7 +75,8 @@ ns_lwresd_shutdown(void);
*/
/*% create manager */
isc_result_t
ns_lwdmanager_create(isc_mem_t *mctx, cfg_obj_t *lwres, ns_lwresd_t **lwresdp);
ns_lwdmanager_create(isc_mem_t *mctx, const cfg_obj_t *lwres,
ns_lwresd_t **lwresdp);
/*% attach to manager */
void

View file

@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
/* $Id: server.h,v 1.80 2005/08/18 00:57:27 marka Exp $ */
/* $Id: server.h,v 1.81 2006/02/28 02:39:51 marka Exp $ */
#ifndef NAMED_SERVER_H
#define NAMED_SERVER_H 1
@ -219,6 +219,6 @@ ns_server_dumprecursing(ns_server_t *server);
* Maintain a list of dispatches that require reserved ports.
*/
void
ns_add_reserved_dispatch(ns_server_t *server, isc_sockaddr_t *addr);
ns_add_reserved_dispatch(ns_server_t *server, const isc_sockaddr_t *addr);
#endif /* NAMED_SERVER_H */

View file

@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
/* $Id: sortlist.h,v 1.7 2005/04/29 00:22:32 marka Exp $ */
/* $Id: sortlist.h,v 1.8 2006/02/28 02:39:51 marka Exp $ */
#ifndef NAMED_SORTLIST_H
#define NAMED_SORTLIST_H 1
@ -30,7 +30,7 @@
* Type for callback functions that rank addresses.
*/
typedef int
(*dns_addressorderfunc_t)(isc_netaddr_t *address, void *arg);
(*dns_addressorderfunc_t)(const isc_netaddr_t *address, const void *arg);
/*%
* Return value type for setup_sortlist.
@ -42,7 +42,8 @@ typedef enum {
} ns_sortlisttype_t;
ns_sortlisttype_t
ns_sortlist_setup(dns_acl_t *acl, isc_netaddr_t *clientaddr, void **argp);
ns_sortlist_setup(dns_acl_t *acl, isc_netaddr_t *clientaddr,
const void **argp);
/*%<
* Find the sortlist statement in 'acl' that applies to 'clientaddr', if any.
*
@ -57,14 +58,14 @@ ns_sortlist_setup(dns_acl_t *acl, isc_netaddr_t *clientaddr, void **argp);
*/
int
ns_sortlist_addrorder1(isc_netaddr_t *addr, void *arg);
ns_sortlist_addrorder1(const isc_netaddr_t *addr, const void *arg);
/*%<
* Find the sort order of 'addr' in 'arg', the matching element
* of a 1-element top-level sortlist statement.
*/
int
ns_sortlist_addrorder2(isc_netaddr_t *addr, void *arg);
ns_sortlist_addrorder2(const isc_netaddr_t *addr, const void *arg);
/*%<
* Find the sort order of 'addr' in 'arg', a topology-like
* ACL forming the second element in a 2-element top-level
@ -74,7 +75,7 @@ ns_sortlist_addrorder2(isc_netaddr_t *addr, void *arg);
void
ns_sortlist_byaddrsetup(dns_acl_t *sortlist_acl, isc_netaddr_t *client_addr,
dns_addressorderfunc_t *orderp,
void **argp);
const void **argp);
/*%<
* Find the sortlist statement in 'acl' that applies to 'clientaddr', if any.
* If a sortlist statement applies, return in '*orderp' a pointer to a function

View file

@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
/* $Id: tkeyconf.h,v 1.12 2005/04/29 00:22:33 marka Exp $ */
/* $Id: tkeyconf.h,v 1.13 2006/02/28 02:39:51 marka Exp $ */
#ifndef NS_TKEYCONF_H
#define NS_TKEYCONF_H 1
@ -30,8 +30,8 @@
ISC_LANG_BEGINDECLS
isc_result_t
ns_tkeyctx_fromconfig(cfg_obj_t *options, isc_mem_t *mctx, isc_entropy_t *ectx,
dns_tkeyctx_t **tctxp);
ns_tkeyctx_fromconfig(const cfg_obj_t *options, isc_mem_t *mctx,
isc_entropy_t *ectx, dns_tkeyctx_t **tctxp);
/*%<
* Create a TKEY context and configure it, including the default DH key
* and default domain, according to 'options'.

View file

@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
/* $Id: tsigconf.h,v 1.12 2005/04/29 00:22:33 marka Exp $ */
/* $Id: tsigconf.h,v 1.13 2006/02/28 02:39:51 marka Exp $ */
#ifndef NS_TSIGCONF_H
#define NS_TSIGCONF_H 1
@ -28,7 +28,7 @@
ISC_LANG_BEGINDECLS
isc_result_t
ns_tsigkeyring_fromconfig(cfg_obj_t *config, cfg_obj_t *vconfig,
ns_tsigkeyring_fromconfig(const cfg_obj_t *config, const cfg_obj_t *vconfig,
isc_mem_t *mctx, dns_tsig_keyring_t **ringp);
/*%<
* Create a TSIG key ring and configure it according to the 'key'

View file

@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
/* $Id: zoneconf.h,v 1.22 2005/04/27 04:56:01 sra Exp $ */
/* $Id: zoneconf.h,v 1.23 2006/02/28 02:39:51 marka Exp $ */
#ifndef NS_ZONECONF_H
#define NS_ZONECONF_H 1
@ -31,8 +31,9 @@
ISC_LANG_BEGINDECLS
isc_result_t
ns_zone_configure(cfg_obj_t *config, cfg_obj_t *vconfig, cfg_obj_t *zconfig,
cfg_aclconfctx_t *ac, dns_zone_t *zone);
ns_zone_configure(const cfg_obj_t *config, const cfg_obj_t *vconfig,
const cfg_obj_t *zconfig, cfg_aclconfctx_t *ac,
dns_zone_t *zone);
/*%<
* Configure or reconfigure a zone according to the named.conf
* data in 'cctx' and 'czone'.
@ -49,7 +50,7 @@ ns_zone_configure(cfg_obj_t *config, cfg_obj_t *vconfig, cfg_obj_t *zconfig,
*/
isc_boolean_t
ns_zone_reusable(dns_zone_t *zone, cfg_obj_t *zconfig);
ns_zone_reusable(dns_zone_t *zone, const cfg_obj_t *zconfig);
/*%<
* If 'zone' can be safely reconfigured according to the configuration
* data in 'zconfig', return ISC_TRUE. If the configuration data is so

View file

@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
/* $Id: logconf.c,v 1.38 2005/08/23 02:36:06 marka Exp $ */
/* $Id: logconf.c,v 1.39 2006/02/28 02:39:51 marka Exp $ */
/*! \file */
@ -43,13 +43,13 @@
* in 'ccat' and add it to 'lctx'.
*/
static isc_result_t
category_fromconf(cfg_obj_t *ccat, isc_logconfig_t *lctx) {
category_fromconf(const cfg_obj_t *ccat, isc_logconfig_t *lctx) {
isc_result_t result;
const char *catname;
isc_logcategory_t *category;
isc_logmodule_t *module;
cfg_obj_t *destinations = NULL;
cfg_listelt_t *element = NULL;
const cfg_obj_t *destinations = NULL;
const cfg_listelt_t *element = NULL;
catname = cfg_obj_asstring(cfg_tuple_get(ccat, "name"));
category = isc_log_categorybyname(ns_g_lctx, catname);
@ -70,7 +70,7 @@ category_fromconf(cfg_obj_t *ccat, isc_logconfig_t *lctx) {
element != NULL;
element = cfg_list_next(element))
{
cfg_obj_t *channel = cfg_listelt_value(element);
const cfg_obj_t *channel = cfg_listelt_value(element);
const char *channelname = cfg_obj_asstring(channel);
result = isc_log_usechannel(lctx, channelname, category,
@ -91,18 +91,18 @@ category_fromconf(cfg_obj_t *ccat, isc_logconfig_t *lctx) {
* in 'cchan' and add it to 'lctx'.
*/
static isc_result_t
channel_fromconf(cfg_obj_t *channel, isc_logconfig_t *lctx) {
channel_fromconf(const cfg_obj_t *channel, isc_logconfig_t *lctx) {
isc_result_t result;
isc_logdestination_t dest;
unsigned int type;
unsigned int flags = 0;
int level;
const char *channelname;
cfg_obj_t *fileobj = NULL;
cfg_obj_t *syslogobj = NULL;
cfg_obj_t *nullobj = NULL;
cfg_obj_t *stderrobj = NULL;
cfg_obj_t *severity = NULL;
const cfg_obj_t *fileobj = NULL;
const cfg_obj_t *syslogobj = NULL;
const cfg_obj_t *nullobj = NULL;
const cfg_obj_t *stderrobj = NULL;
const cfg_obj_t *severity = NULL;
int i;
channelname = cfg_obj_asstring(cfg_map_getname(channel));
@ -132,9 +132,10 @@ channel_fromconf(cfg_obj_t *channel, isc_logconfig_t *lctx) {
type = ISC_LOG_TONULL;
if (fileobj != NULL) {
cfg_obj_t *pathobj = cfg_tuple_get(fileobj, "file");
cfg_obj_t *sizeobj = cfg_tuple_get(fileobj, "size");
cfg_obj_t *versionsobj = cfg_tuple_get(fileobj, "versions");
const cfg_obj_t *pathobj = cfg_tuple_get(fileobj, "file");
const cfg_obj_t *sizeobj = cfg_tuple_get(fileobj, "size");
const cfg_obj_t *versionsobj =
cfg_tuple_get(fileobj, "versions");
isc_int32_t versions = ISC_LOG_ROLLNEVER;
isc_offset_t size = 0;
@ -176,9 +177,9 @@ channel_fromconf(cfg_obj_t *channel, isc_logconfig_t *lctx) {
* Munge flags.
*/
{
cfg_obj_t *printcat = NULL;
cfg_obj_t *printsev = NULL;
cfg_obj_t *printtime = NULL;
const cfg_obj_t *printcat = NULL;
const cfg_obj_t *printsev = NULL;
const cfg_obj_t *printtime = NULL;
(void)cfg_map_get(channel, "print-category", &printcat);
(void)cfg_map_get(channel, "print-severity", &printsev);
@ -244,13 +245,14 @@ channel_fromconf(cfg_obj_t *channel, isc_logconfig_t *lctx) {
}
isc_result_t
ns_log_configure(isc_logconfig_t *logconf, cfg_obj_t *logstmt) {
ns_log_configure(isc_logconfig_t *logconf, const cfg_obj_t *logstmt) {
isc_result_t result;
cfg_obj_t *channels = NULL;
cfg_obj_t *categories = NULL;
cfg_listelt_t *element;
const cfg_obj_t *channels = NULL;
const cfg_obj_t *categories = NULL;
const cfg_listelt_t *element;
isc_boolean_t default_set = ISC_FALSE;
isc_boolean_t unmatched_set = ISC_FALSE;
const cfg_obj_t *catname;
CHECK(ns_log_setdefaultchannels(logconf));
@ -259,7 +261,7 @@ ns_log_configure(isc_logconfig_t *logconf, cfg_obj_t *logstmt) {
element != NULL;
element = cfg_list_next(element))
{
cfg_obj_t *channel = cfg_listelt_value(element);
const cfg_obj_t *channel = cfg_listelt_value(element);
CHECK(channel_fromconf(channel, logconf));
}
@ -268,15 +270,15 @@ ns_log_configure(isc_logconfig_t *logconf, cfg_obj_t *logstmt) {
element != NULL;
element = cfg_list_next(element))
{
cfg_obj_t *category = cfg_listelt_value(element);
const cfg_obj_t *category = cfg_listelt_value(element);
CHECK(category_fromconf(category, logconf));
if (!default_set) {
cfg_obj_t *catname = cfg_tuple_get(category, "name");
catname = cfg_tuple_get(category, "name");
if (strcmp(cfg_obj_asstring(catname), "default") == 0)
default_set = ISC_TRUE;
}
if (!unmatched_set) {
cfg_obj_t *catname = cfg_tuple_get(category, "name");
catname = cfg_tuple_get(category, "name");
if (strcmp(cfg_obj_asstring(catname), "unmatched") == 0)
unmatched_set = ISC_TRUE;
}

View file

@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
/* $Id: lwdgabn.c,v 1.18 2005/06/23 04:21:59 marka Exp $ */
/* $Id: lwdgabn.c,v 1.19 2006/02/28 02:39:51 marka Exp $ */
/*! \file */
@ -122,7 +122,7 @@ sort_addresses(ns_lwdclient_t *client) {
rankedaddress *addrs;
isc_netaddr_t remote;
dns_addressorderfunc_t order;
void *arg;
const void *arg;
ns_lwresd_t *lwresd = client->clientmgr->listener->manager;
unsigned int i;
isc_result_t result;

View file

@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
/* $Id: lwresd.c,v 1.51 2005/11/30 03:33:48 marka Exp $ */
/* $Id: lwresd.c,v 1.52 2006/02/28 02:39:51 marka Exp $ */
/*! \file
* \brief
@ -286,14 +286,14 @@ ns_lwresd_parseeresolvconf(isc_mem_t *mctx, cfg_parser_t *pctx,
* Handle lwresd manager objects
*/
isc_result_t
ns_lwdmanager_create(isc_mem_t *mctx, cfg_obj_t *lwres,
ns_lwdmanager_create(isc_mem_t *mctx, const cfg_obj_t *lwres,
ns_lwresd_t **lwresdp)
{
ns_lwresd_t *lwresd;
const char *vname;
dns_rdataclass_t vclass;
cfg_obj_t *obj, *viewobj, *searchobj;
cfg_listelt_t *element;
const cfg_obj_t *obj, *viewobj, *searchobj;
const cfg_listelt_t *element;
isc_result_t result;
INSIST(lwresdp != NULL && *lwresdp == NULL);
@ -357,7 +357,7 @@ ns_lwdmanager_create(isc_mem_t *mctx, cfg_obj_t *lwres,
element != NULL;
element = cfg_list_next(element))
{
cfg_obj_t *search;
const cfg_obj_t *search;
const char *searchstr;
isc_buffer_t namebuf;
dns_fixedname_t fname;
@ -752,11 +752,11 @@ configure_listener(isc_sockaddr_t *address, ns_lwresd_t *lwresd,
}
isc_result_t
ns_lwresd_configure(isc_mem_t *mctx, cfg_obj_t *config) {
cfg_obj_t *lwreslist = NULL;
cfg_obj_t *lwres = NULL;
cfg_obj_t *listenerslist = NULL;
cfg_listelt_t *element = NULL;
ns_lwresd_configure(isc_mem_t *mctx, const cfg_obj_t *config) {
const cfg_obj_t *lwreslist = NULL;
const cfg_obj_t *lwres = NULL;
const cfg_obj_t *listenerslist = NULL;
const cfg_listelt_t *element = NULL;
ns_lwreslistener_t *listener;
ns_lwreslistenerlist_t newlisteners;
isc_result_t result;

View file

@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
/* $Id: query.c,v 1.280 2006/02/02 22:48:58 marka Exp $ */
/* $Id: query.c,v 1.281 2006/02/28 02:39:51 marka Exp $ */
/*! \file */
@ -3052,7 +3052,7 @@ do { \
* ISC_R_NOTIMPLEMENTED The rdata is not a known address type.
*/
static isc_result_t
rdata_tonetaddr(dns_rdata_t *rdata, isc_netaddr_t *netaddr) {
rdata_tonetaddr(const dns_rdata_t *rdata, isc_netaddr_t *netaddr) {
struct in_addr ina;
struct in6_addr in6a;
@ -3078,7 +3078,7 @@ rdata_tonetaddr(dns_rdata_t *rdata, isc_netaddr_t *netaddr) {
* sortlist statement.
*/
static int
query_sortlist_order_2element(dns_rdata_t *rdata, void *arg) {
query_sortlist_order_2element(const dns_rdata_t *rdata, const void *arg) {
isc_netaddr_t netaddr;
if (rdata_tonetaddr(rdata, &netaddr) != ISC_R_SUCCESS)
@ -3091,7 +3091,7 @@ query_sortlist_order_2element(dns_rdata_t *rdata, void *arg) {
* of a 1-element top-level sortlist statement.
*/
static int
query_sortlist_order_1element(dns_rdata_t *rdata, void *arg) {
query_sortlist_order_1element(const dns_rdata_t *rdata, const void *arg) {
isc_netaddr_t netaddr;
if (rdata_tonetaddr(rdata, &netaddr) != ISC_R_SUCCESS)
@ -3107,7 +3107,7 @@ static void
setup_query_sortlist(ns_client_t *client) {
isc_netaddr_t netaddr;
dns_rdatasetorderfunc_t order = NULL;
void *order_arg = NULL;
const void *order_arg = NULL;
isc_netaddr_fromsockaddr(&netaddr, &client->peeraddr);
switch (ns_sortlist_setup(client->view->sortlist,

View file

@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
/* $Id: server.c,v 1.458 2006/02/26 22:54:46 marka Exp $ */
/* $Id: server.c,v 1.459 2006/02/28 02:39:51 marka Exp $ */
/*! \file */
@ -222,25 +222,25 @@ static void
ns_server_reload(isc_task_t *task, isc_event_t *event);
static isc_result_t
ns_listenelt_fromconfig(cfg_obj_t *listener, cfg_obj_t *config,
ns_listenelt_fromconfig(const cfg_obj_t *listener, const cfg_obj_t *config,
cfg_aclconfctx_t *actx,
isc_mem_t *mctx, ns_listenelt_t **target);
static isc_result_t
ns_listenlist_fromconfig(cfg_obj_t *listenlist, cfg_obj_t *config,
ns_listenlist_fromconfig(const cfg_obj_t *listenlist, const cfg_obj_t *config,
cfg_aclconfctx_t *actx,
isc_mem_t *mctx, ns_listenlist_t **target);
static isc_result_t
configure_forward(cfg_obj_t *config, dns_view_t *view, dns_name_t *origin,
cfg_obj_t *forwarders, cfg_obj_t *forwardtype);
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);
static isc_result_t
configure_alternates(cfg_obj_t *config, dns_view_t *view,
cfg_obj_t *alternates);
configure_alternates(const cfg_obj_t *config, dns_view_t *view,
const cfg_obj_t *alternates);
static isc_result_t
configure_zone(cfg_obj_t *config, cfg_obj_t *zconfig, cfg_obj_t *vconfig,
isc_mem_t *mctx, dns_view_t *view,
configure_zone(const cfg_obj_t *config, const cfg_obj_t *zconfig,
const cfg_obj_t *vconfig, isc_mem_t *mctx, dns_view_t *view,
cfg_aclconfctx_t *aclconf);
static void
@ -252,13 +252,13 @@ end_reserved_dispatches(ns_server_t *server, isc_boolean_t all);
* (for a global default).
*/
static isc_result_t
configure_view_acl(cfg_obj_t *vconfig, cfg_obj_t *config,
configure_view_acl(const cfg_obj_t *vconfig, const cfg_obj_t *config,
const char *aclname, cfg_aclconfctx_t *actx,
isc_mem_t *mctx, dns_acl_t **aclp)
{
isc_result_t result;
cfg_obj_t *maps[3];
cfg_obj_t *aclobj = NULL;
const cfg_obj_t *maps[3];
const cfg_obj_t *aclobj = NULL;
int i = 0;
if (*aclp != NULL)
@ -266,7 +266,7 @@ configure_view_acl(cfg_obj_t *vconfig, cfg_obj_t *config,
if (vconfig != NULL)
maps[i++] = cfg_tuple_get(vconfig, "options");
if (config != NULL) {
cfg_obj_t *options = NULL;
const cfg_obj_t *options = NULL;
(void)cfg_map_get(config, "options", &options);
if (options != NULL)
maps[i++] = options;
@ -287,7 +287,7 @@ configure_view_acl(cfg_obj_t *vconfig, cfg_obj_t *config,
}
static isc_result_t
configure_view_dnsseckey(cfg_obj_t *vconfig, cfg_obj_t *key,
configure_view_dnsseckey(const cfg_obj_t *vconfig, const cfg_obj_t *key,
dns_keytable_t *keytable, isc_mem_t *mctx)
{
dns_rdataclass_t viewclass;
@ -314,7 +314,7 @@ configure_view_dnsseckey(cfg_obj_t *vconfig, cfg_obj_t *key,
if (vconfig == NULL)
viewclass = dns_rdataclass_in;
else {
cfg_obj_t *classobj = cfg_tuple_get(vconfig, "class");
const cfg_obj_t *classobj = cfg_tuple_get(vconfig, "class");
CHECK(ns_config_getclass(classobj, dns_rdataclass_in,
&viewclass));
}
@ -390,15 +390,15 @@ configure_view_dnsseckey(cfg_obj_t *vconfig, cfg_obj_t *key,
* from 'vconfig' and 'config'. The variable to be configured is '*target'.
*/
static isc_result_t
configure_view_dnsseckeys(cfg_obj_t *vconfig, cfg_obj_t *config,
configure_view_dnsseckeys(const cfg_obj_t *vconfig, const cfg_obj_t *config,
isc_mem_t *mctx, dns_keytable_t **target)
{
isc_result_t result;
cfg_obj_t *keys = NULL;
cfg_obj_t *voptions = NULL;
cfg_listelt_t *element, *element2;
cfg_obj_t *keylist;
cfg_obj_t *key;
const cfg_obj_t *keys = NULL;
const cfg_obj_t *voptions = NULL;
const cfg_listelt_t *element, *element2;
const cfg_obj_t *keylist;
const cfg_obj_t *key;
dns_keytable_t *keytable = NULL;
CHECK(dns_keytable_create(mctx, &keytable));
@ -437,10 +437,10 @@ configure_view_dnsseckeys(cfg_obj_t *vconfig, cfg_obj_t *config,
}
static isc_result_t
mustbesecure(cfg_obj_t *mbs, dns_resolver_t *resolver)
mustbesecure(const cfg_obj_t *mbs, dns_resolver_t *resolver)
{
cfg_listelt_t *element;
cfg_obj_t *obj;
const cfg_listelt_t *element;
const cfg_obj_t *obj;
const char *str;
dns_fixedname_t fixed;
dns_name_t *name;
@ -474,14 +474,14 @@ mustbesecure(cfg_obj_t *mbs, dns_resolver_t *resolver)
* Get a dispatch appropriate for the resolver of a given view.
*/
static isc_result_t
get_view_querysource_dispatch(cfg_obj_t **maps,
get_view_querysource_dispatch(const cfg_obj_t **maps,
int af, dns_dispatch_t **dispatchp)
{
isc_result_t result;
dns_dispatch_t *disp;
isc_sockaddr_t sa;
unsigned int attrs, attrmask;
cfg_obj_t *obj = NULL;
const cfg_obj_t *obj = NULL;
/*
* Make compiler happy.
@ -572,10 +572,10 @@ get_view_querysource_dispatch(cfg_obj_t **maps,
}
static isc_result_t
configure_order(dns_order_t *order, cfg_obj_t *ent) {
configure_order(dns_order_t *order, const cfg_obj_t *ent) {
dns_rdataclass_t rdclass;
dns_rdatatype_t rdtype;
cfg_obj_t *obj;
const cfg_obj_t *obj;
dns_fixedname_t fixed;
unsigned int mode = 0;
const char *str;
@ -636,10 +636,10 @@ configure_order(dns_order_t *order, cfg_obj_t *ent) {
}
static isc_result_t
configure_peer(cfg_obj_t *cpeer, isc_mem_t *mctx, dns_peer_t **peerp) {
configure_peer(const cfg_obj_t *cpeer, isc_mem_t *mctx, dns_peer_t **peerp) {
isc_netaddr_t na;
dns_peer_t *peer;
cfg_obj_t *obj;
const cfg_obj_t *obj;
const char *str;
isc_result_t result;
unsigned int prefixlen;
@ -768,10 +768,10 @@ configure_peer(cfg_obj_t *cpeer, isc_mem_t *mctx, dns_peer_t **peerp) {
}
static isc_result_t
disable_algorithms(cfg_obj_t *disabled, dns_resolver_t *resolver) {
disable_algorithms(const cfg_obj_t *disabled, dns_resolver_t *resolver) {
isc_result_t result;
cfg_obj_t *algorithms;
cfg_listelt_t *element;
const cfg_obj_t *algorithms;
const cfg_listelt_t *element;
const char *str;
dns_fixedname_t fixed;
dns_name_t *name;
@ -814,12 +814,12 @@ disable_algorithms(cfg_obj_t *disabled, dns_resolver_t *resolver) {
}
static isc_boolean_t
on_disable_list(cfg_obj_t *disablelist, dns_name_t *zonename) {
cfg_listelt_t *element;
on_disable_list(const cfg_obj_t *disablelist, dns_name_t *zonename) {
const cfg_listelt_t *element;
dns_fixedname_t fixed;
dns_name_t *name;
isc_result_t result;
cfg_obj_t *value;
const cfg_obj_t *value;
const char *str;
isc_buffer_t b;
@ -883,26 +883,26 @@ check_dbtype(dns_zone_t **zonep, unsigned int dbtypec, const char **dbargv,
* global defaults in 'config' used exclusively.
*/
static isc_result_t
configure_view(dns_view_t *view, cfg_obj_t *config, cfg_obj_t *vconfig,
isc_mem_t *mctx, cfg_aclconfctx_t *actx,
isc_boolean_t need_hints)
configure_view(dns_view_t *view, const cfg_obj_t *config,
const cfg_obj_t *vconfig, isc_mem_t *mctx,
cfg_aclconfctx_t *actx, isc_boolean_t need_hints)
{
cfg_obj_t *maps[4];
cfg_obj_t *cfgmaps[3];
cfg_obj_t *options = NULL;
cfg_obj_t *voptions = NULL;
cfg_obj_t *forwardtype;
cfg_obj_t *forwarders;
cfg_obj_t *alternates;
cfg_obj_t *zonelist;
const cfg_obj_t *maps[4];
const cfg_obj_t *cfgmaps[3];
const cfg_obj_t *options = NULL;
const cfg_obj_t *voptions = NULL;
const cfg_obj_t *forwardtype;
const cfg_obj_t *forwarders;
const cfg_obj_t *alternates;
const cfg_obj_t *zonelist;
#ifdef DLZ
cfg_obj_t *dlz;
const cfg_obj_t *dlz;
unsigned int dlzargc;
char **dlzargv;
#endif
cfg_obj_t *disabled;
cfg_obj_t *obj;
cfg_listelt_t *element;
const cfg_obj_t *disabled;
const cfg_obj_t *obj;
const cfg_listelt_t *element;
in_port_t port;
dns_cache_t *cache = NULL;
isc_result_t result;
@ -928,7 +928,7 @@ configure_view(dns_view_t *view, cfg_obj_t *config, cfg_obj_t *vconfig,
const char *forview = " for view ";
isc_boolean_t rfc1918;
isc_boolean_t empty_zones_enable;
cfg_obj_t *disablelist = NULL;
const cfg_obj_t *disablelist = NULL;
REQUIRE(DNS_VIEW_VALID(view));
@ -1023,7 +1023,7 @@ configure_view(dns_view_t *view, cfg_obj_t *config, cfg_obj_t *vconfig,
element != NULL;
element = cfg_list_next(element))
{
cfg_obj_t *zconfig = cfg_listelt_value(element);
const cfg_obj_t *zconfig = cfg_listelt_value(element);
CHECK(configure_zone(config, zconfig, vconfig, mctx, view,
actx));
}
@ -1306,8 +1306,8 @@ configure_view(dns_view_t *view, cfg_obj_t *config, cfg_obj_t *vconfig,
* Configure the view's peer list.
*/
{
cfg_obj_t *peers = NULL;
cfg_listelt_t *element;
const cfg_obj_t *peers = NULL;
const cfg_listelt_t *element;
dns_peerlist_t *newpeers = NULL;
(void)ns_config_get(cfgmaps, "server", &peers);
@ -1316,7 +1316,7 @@ configure_view(dns_view_t *view, cfg_obj_t *config, cfg_obj_t *vconfig,
element != NULL;
element = cfg_list_next(element))
{
cfg_obj_t *cpeer = cfg_listelt_value(element);
const cfg_obj_t *cpeer = cfg_listelt_value(element);
dns_peer_t *peer;
CHECK(configure_peer(cpeer, mctx, &peer));
@ -1331,8 +1331,8 @@ configure_view(dns_view_t *view, cfg_obj_t *config, cfg_obj_t *vconfig,
* Configure the views rrset-order.
*/
{
cfg_obj_t *rrsetorder = NULL;
cfg_listelt_t *element;
const cfg_obj_t *rrsetorder = NULL;
const cfg_listelt_t *element;
(void)ns_config_get(maps, "rrset-order", &rrsetorder);
CHECK(dns_order_create(mctx, &order));
@ -1340,7 +1340,7 @@ configure_view(dns_view_t *view, cfg_obj_t *config, cfg_obj_t *vconfig,
element != NULL;
element = cfg_list_next(element))
{
cfg_obj_t *ent = cfg_listelt_value(element);
const cfg_obj_t *ent = cfg_listelt_value(element);
CHECK(configure_order(order, ent));
}
@ -1575,7 +1575,7 @@ configure_view(dns_view_t *view, cfg_obj_t *config, cfg_obj_t *vconfig,
dns_name_t *name;
isc_buffer_t b;
const char *str;
cfg_obj_t *exclude;
const cfg_obj_t *exclude;
dns_fixedname_init(&fixed);
name = dns_fixedname_name(&fixed);
@ -1800,12 +1800,12 @@ configure_hints(dns_view_t *view, const char *filename) {
}
static isc_result_t
configure_alternates(cfg_obj_t *config, dns_view_t *view,
cfg_obj_t *alternates)
configure_alternates(const cfg_obj_t *config, dns_view_t *view,
const cfg_obj_t *alternates)
{
cfg_obj_t *portobj;
cfg_obj_t *addresses;
cfg_listelt_t *element;
const cfg_obj_t *portobj;
const cfg_obj_t *addresses;
const cfg_listelt_t *element;
isc_result_t result = ISC_R_SUCCESS;
in_port_t port;
@ -1838,7 +1838,7 @@ configure_alternates(cfg_obj_t *config, dns_view_t *view,
element != NULL;
element = cfg_list_next(element))
{
cfg_obj_t *alternate = cfg_listelt_value(element);
const cfg_obj_t *alternate = cfg_listelt_value(element);
isc_sockaddr_t sa;
if (!cfg_obj_issockaddr(alternate)) {
@ -1885,12 +1885,12 @@ configure_alternates(cfg_obj_t *config, dns_view_t *view,
}
static isc_result_t
configure_forward(cfg_obj_t *config, dns_view_t *view, dns_name_t *origin,
cfg_obj_t *forwarders, cfg_obj_t *forwardtype)
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)
{
cfg_obj_t *portobj;
cfg_obj_t *faddresses;
cfg_listelt_t *element;
const cfg_obj_t *portobj;
const cfg_obj_t *faddresses;
const cfg_listelt_t *element;
dns_fwdpolicy_t fwdpolicy = dns_fwdpolicy_none;
isc_sockaddrlist_t addresses;
isc_sockaddr_t *sa;
@ -1928,7 +1928,7 @@ configure_forward(cfg_obj_t *config, dns_view_t *view, dns_name_t *origin,
element != NULL;
element = cfg_list_next(element))
{
cfg_obj_t *forwarder = cfg_listelt_value(element);
const cfg_obj_t *forwarder = cfg_listelt_value(element);
sa = isc_mem_get(view->mctx, sizeof(isc_sockaddr_t));
if (sa == NULL) {
result = ISC_R_NOMEMORY;
@ -1993,14 +1993,16 @@ configure_forward(cfg_obj_t *config, dns_view_t *view, dns_name_t *origin,
* The view created is attached to '*viewp'.
*/
static isc_result_t
create_view(cfg_obj_t *vconfig, dns_viewlist_t *viewlist, dns_view_t **viewp) {
create_view(const cfg_obj_t *vconfig, dns_viewlist_t *viewlist,
dns_view_t **viewp)
{
isc_result_t result;
const char *viewname;
dns_rdataclass_t viewclass;
dns_view_t *view = NULL;
if (vconfig != NULL) {
cfg_obj_t *classobj = NULL;
const cfg_obj_t *classobj = NULL;
viewname = cfg_obj_asstring(cfg_tuple_get(vconfig, "name"));
classobj = cfg_tuple_get(vconfig, "class");
@ -2030,19 +2032,19 @@ create_view(cfg_obj_t *vconfig, dns_viewlist_t *viewlist, dns_view_t **viewp) {
* Configure or reconfigure a zone.
*/
static isc_result_t
configure_zone(cfg_obj_t *config, cfg_obj_t *zconfig, cfg_obj_t *vconfig,
isc_mem_t *mctx, dns_view_t *view,
configure_zone(const cfg_obj_t *config, const cfg_obj_t *zconfig,
const cfg_obj_t *vconfig, isc_mem_t *mctx, dns_view_t *view,
cfg_aclconfctx_t *aclconf)
{
dns_view_t *pview = NULL; /* Production view */
dns_zone_t *zone = NULL; /* New or reused zone */
dns_zone_t *dupzone = NULL;
cfg_obj_t *options = NULL;
cfg_obj_t *zoptions = NULL;
cfg_obj_t *typeobj = NULL;
cfg_obj_t *forwarders = NULL;
cfg_obj_t *forwardtype = NULL;
cfg_obj_t *only = NULL;
const cfg_obj_t *options = NULL;
const cfg_obj_t *zoptions = NULL;
const cfg_obj_t *typeobj = NULL;
const cfg_obj_t *forwarders = NULL;
const cfg_obj_t *forwardtype = NULL;
const cfg_obj_t *only = NULL;
isc_result_t result;
isc_result_t tresult;
isc_buffer_t buffer;
@ -2099,7 +2101,7 @@ configure_zone(cfg_obj_t *config, cfg_obj_t *zconfig, cfg_obj_t *vconfig,
* configure it and return.
*/
if (strcasecmp(ztypestr, "hint") == 0) {
cfg_obj_t *fileobj = NULL;
const cfg_obj_t *fileobj = NULL;
if (cfg_map_get(zoptions, "file", &fileobj) != ISC_R_SUCCESS) {
isc_log_write(ns_g_lctx, NS_LOGCATEGORY_GENERAL,
NS_LOGMODULE_SERVER, ISC_LOG_ERROR,
@ -2267,9 +2269,10 @@ configure_zone(cfg_obj_t *config, cfg_obj_t *zconfig, cfg_obj_t *vconfig,
* Configure a single server quota.
*/
static void
configure_server_quota(cfg_obj_t **maps, const char *name, isc_quota_t *quota)
configure_server_quota(const cfg_obj_t **maps, const char *name,
isc_quota_t *quota)
{
cfg_obj_t *obj = NULL;
const cfg_obj_t *obj = NULL;
isc_result_t result;
result = ns_config_get(maps, name, &obj);
@ -2282,7 +2285,7 @@ configure_server_quota(cfg_obj_t **maps, const char *name, isc_quota_t *quota)
* parsed. This can be extended to support other options if necessary.
*/
static isc_result_t
directory_callback(const char *clausename, cfg_obj_t *obj, void *arg) {
directory_callback(const char *clausename, const cfg_obj_t *obj, void *arg) {
isc_result_t result;
const char *directory;
@ -2535,7 +2538,7 @@ setstring(ns_server_t *server, char **field, const char *value) {
* or NULL if whether 'obj' is a string or void value, respectively.
*/
static isc_result_t
setoptstring(ns_server_t *server, char **field, cfg_obj_t *obj) {
setoptstring(ns_server_t *server, char **field, const cfg_obj_t *obj) {
if (cfg_obj_isvoid(obj))
return (setstring(server, field, NULL));
else
@ -2543,10 +2546,11 @@ setoptstring(ns_server_t *server, char **field, cfg_obj_t *obj) {
}
static void
set_limit(cfg_obj_t **maps, const char *configname, const char *description,
isc_resource_t resourceid, isc_resourcevalue_t defaultvalue)
set_limit(const cfg_obj_t **maps, const char *configname,
const char *description, isc_resource_t resourceid,
isc_resourcevalue_t defaultvalue)
{
cfg_obj_t *obj = NULL;
const cfg_obj_t *obj = NULL;
const char *resource;
isc_resourcevalue_t value;
isc_result_t result;
@ -2578,7 +2582,7 @@ set_limit(cfg_obj_t **maps, const char *configname, const char *description,
ns_g_init ## resource)
static void
set_limits(cfg_obj_t **maps) {
set_limits(const cfg_obj_t **maps) {
SETLIMIT("stacksize", stacksize, "stack size");
SETLIMIT("datasize", datasize, "data size");
SETLIMIT("coresize", coresize, "core size");
@ -2587,15 +2591,15 @@ set_limits(cfg_obj_t **maps) {
static isc_result_t
portlist_fromconf(dns_portlist_t *portlist, unsigned int family,
cfg_obj_t *ports)
const cfg_obj_t *ports)
{
cfg_listelt_t *element;
const cfg_listelt_t *element;
isc_result_t result = ISC_R_SUCCESS;
for (element = cfg_list_first(ports);
element != NULL;
element = cfg_list_next(element)) {
cfg_obj_t *obj = cfg_listelt_value(element);
const cfg_obj_t *obj = cfg_listelt_value(element);
in_port_t port = (in_port_t)cfg_obj_asuint32(obj);
result = dns_portlist_add(portlist, family, port);
@ -2638,13 +2642,13 @@ load_configuration(const char *filename, ns_server_t *server,
isc_interval_t interval;
cfg_parser_t *parser = NULL;
cfg_obj_t *config;
cfg_obj_t *options;
cfg_obj_t *views;
cfg_obj_t *obj;
cfg_obj_t *v4ports, *v6ports;
cfg_obj_t *maps[3];
cfg_obj_t *builtin_views;
cfg_listelt_t *element;
const cfg_obj_t *options;
const cfg_obj_t *views;
const cfg_obj_t *obj;
const cfg_obj_t *v4ports, *v6ports;
const cfg_obj_t *maps[3];
const cfg_obj_t *builtin_views;
const cfg_listelt_t *element;
dns_view_t *view = NULL;
dns_view_t *view_next;
dns_viewlist_t viewlist;
@ -2831,7 +2835,7 @@ load_configuration(const char *filename, ns_server_t *server,
* statement.
*/
{
cfg_obj_t *clistenon = NULL;
const cfg_obj_t *clistenon = NULL;
ns_listenlist_t *listenon = NULL;
clistenon = NULL;
@ -2865,7 +2869,7 @@ load_configuration(const char *filename, ns_server_t *server,
* Ditto for IPv6.
*/
{
cfg_obj_t *clistenon = NULL;
const cfg_obj_t *clistenon = NULL;
ns_listenlist_t *listenon = NULL;
if (options != NULL)
@ -2952,7 +2956,7 @@ load_configuration(const char *filename, ns_server_t *server,
element != NULL;
element = cfg_list_next(element))
{
cfg_obj_t *vconfig = cfg_listelt_value(element);
const cfg_obj_t *vconfig = cfg_listelt_value(element);
view = NULL;
CHECK(create_view(vconfig, &viewlist, &view));
@ -2992,7 +2996,7 @@ load_configuration(const char *filename, ns_server_t *server,
element != NULL;
element = cfg_list_next(element))
{
cfg_obj_t *vconfig = cfg_listelt_value(element);
const cfg_obj_t *vconfig = cfg_listelt_value(element);
CHECK(create_view(vconfig, &viewlist, &view));
CHECK(configure_view(view, config, vconfig, ns_g_mctx,
&aclconfctx, ISC_FALSE));
@ -3096,7 +3100,7 @@ load_configuration(const char *filename, ns_server_t *server,
"ignoring config file logging "
"statement due to -g option");
} else {
cfg_obj_t *logobj = NULL;
const cfg_obj_t *logobj = NULL;
isc_logconfig_t *logc = NULL;
CHECKM(isc_logconfig_create(ns_g_lctx, &logc),
@ -3135,8 +3139,8 @@ load_configuration(const char *filename, ns_server_t *server,
* compatibility.
*/
if (first_time) {
cfg_obj_t *logobj = NULL;
cfg_obj_t *categories = NULL;
const cfg_obj_t *logobj = NULL;
const cfg_obj_t *categories = NULL;
obj = NULL;
if (ns_config_get(maps, "querylog", &obj) == ISC_R_SUCCESS) {
@ -3148,12 +3152,12 @@ load_configuration(const char *filename, ns_server_t *server,
(void)cfg_map_get(logobj, "category",
&categories);
if (categories != NULL) {
cfg_listelt_t *element;
const cfg_listelt_t *element;
for (element = cfg_list_first(categories);
element != NULL;
element = cfg_list_next(element))
{
cfg_obj_t *catobj;
const cfg_obj_t *catobj;
const char *str;
obj = cfg_listelt_value(element);
@ -3657,7 +3661,7 @@ end_reserved_dispatches(ns_server_t *server, isc_boolean_t all) {
}
void
ns_add_reserved_dispatch(ns_server_t *server, isc_sockaddr_t *addr) {
ns_add_reserved_dispatch(ns_server_t *server, const isc_sockaddr_t *addr) {
ns_dispatch_t *dispatch;
in_port_t port;
char addrbuf[ISC_SOCKADDR_FORMATSIZE];
@ -4033,12 +4037,12 @@ ns_server_togglequerylog(ns_server_t *server) {
}
static isc_result_t
ns_listenlist_fromconfig(cfg_obj_t *listenlist, cfg_obj_t *config,
ns_listenlist_fromconfig(const cfg_obj_t *listenlist, const cfg_obj_t *config,
cfg_aclconfctx_t *actx,
isc_mem_t *mctx, ns_listenlist_t **target)
{
isc_result_t result;
cfg_listelt_t *element;
const cfg_listelt_t *element;
ns_listenlist_t *dlist = NULL;
REQUIRE(target != NULL && *target == NULL);
@ -4052,7 +4056,7 @@ ns_listenlist_fromconfig(cfg_obj_t *listenlist, cfg_obj_t *config,
element = cfg_list_next(element))
{
ns_listenelt_t *delt = NULL;
cfg_obj_t *listener = cfg_listelt_value(element);
const cfg_obj_t *listener = cfg_listelt_value(element);
result = ns_listenelt_fromconfig(listener, config, actx,
mctx, &delt);
if (result != ISC_R_SUCCESS)
@ -4072,12 +4076,12 @@ ns_listenlist_fromconfig(cfg_obj_t *listenlist, cfg_obj_t *config,
* data structure.
*/
static isc_result_t
ns_listenelt_fromconfig(cfg_obj_t *listener, cfg_obj_t *config,
ns_listenelt_fromconfig(const cfg_obj_t *listener, const cfg_obj_t *config,
cfg_aclconfctx_t *actx,
isc_mem_t *mctx, ns_listenelt_t **target)
{
isc_result_t result;
cfg_obj_t *portobj;
const cfg_obj_t *portobj;
in_port_t port;
ns_listenelt_t *delt = NULL;
REQUIRE(target != NULL && *target == NULL);

View file

@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
/* $Id: sortlist.c,v 1.11 2005/04/29 00:22:29 marka Exp $ */
/* $Id: sortlist.c,v 1.12 2006/02/28 02:39:51 marka Exp $ */
/*! \file */
@ -32,7 +32,9 @@
#include <named/sortlist.h>
ns_sortlisttype_t
ns_sortlist_setup(dns_acl_t *acl, isc_netaddr_t *clientaddr, void **argp) {
ns_sortlist_setup(dns_acl_t *acl, isc_netaddr_t *clientaddr,
const void **argp)
{
unsigned int i;
if (acl == NULL)
@ -46,7 +48,7 @@ ns_sortlist_setup(dns_acl_t *acl, isc_netaddr_t *clientaddr, void **argp) {
dns_aclelement_t *e = &acl->elements[i];
dns_aclelement_t *try_elt;
dns_aclelement_t *order_elt = NULL;
dns_aclelement_t *matched_elt = NULL;
const dns_aclelement_t *matched_elt = NULL;
if (e->type == dns_aclelementtype_nestedacl) {
dns_acl_t *inner = e->u.nestedacl;
@ -108,8 +110,8 @@ ns_sortlist_setup(dns_acl_t *acl, isc_netaddr_t *clientaddr, void **argp) {
}
int
ns_sortlist_addrorder2(isc_netaddr_t *addr, void *arg) {
dns_acl_t *sortacl = (dns_acl_t *) arg;
ns_sortlist_addrorder2(const isc_netaddr_t *addr, const void *arg) {
const dns_acl_t *sortacl = (const dns_acl_t *) arg;
int match;
(void)dns_acl_match(addr, NULL, sortacl,
@ -124,8 +126,8 @@ ns_sortlist_addrorder2(isc_netaddr_t *addr, void *arg) {
}
int
ns_sortlist_addrorder1(isc_netaddr_t *addr, void *arg) {
dns_aclelement_t *matchelt = (dns_aclelement_t *) arg;
ns_sortlist_addrorder1(const isc_netaddr_t *addr, const void *arg) {
const dns_aclelement_t *matchelt = (const dns_aclelement_t *) arg;
if (dns_aclelement_match(addr, NULL, matchelt,
&ns_g_server->aclenv,
NULL)) {
@ -138,7 +140,7 @@ ns_sortlist_addrorder1(isc_netaddr_t *addr, void *arg) {
void
ns_sortlist_byaddrsetup(dns_acl_t *sortlist_acl, isc_netaddr_t *client_addr,
dns_addressorderfunc_t *orderp,
void **argp)
const void **argp)
{
ns_sortlisttype_t sortlisttype;

View file

@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
/* $Id: tkeyconf.c,v 1.24 2005/08/23 02:36:07 marka Exp $ */
/* $Id: tkeyconf.c,v 1.25 2006/02/28 02:39:51 marka Exp $ */
/*! \file */
@ -44,8 +44,8 @@
isc_result_t
ns_tkeyctx_fromconfig(cfg_obj_t *options, isc_mem_t *mctx, isc_entropy_t *ectx,
dns_tkeyctx_t **tctxp)
ns_tkeyctx_fromconfig(const cfg_obj_t *options, isc_mem_t *mctx,
isc_entropy_t *ectx, dns_tkeyctx_t **tctxp)
{
isc_result_t result;
dns_tkeyctx_t *tctx = NULL;
@ -54,7 +54,7 @@ ns_tkeyctx_fromconfig(cfg_obj_t *options, isc_mem_t *mctx, isc_entropy_t *ectx,
dns_fixedname_t fname;
dns_name_t *name;
isc_buffer_t b;
cfg_obj_t *obj;
const cfg_obj_t *obj;
int type;
result = dns_tkeyctx_create(mctx, ectx, &tctx);

View file

@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
/* $Id: tsigconf.c,v 1.27 2006/01/27 23:57:46 marka Exp $ */
/* $Id: tsigconf.c,v 1.28 2006/02/28 02:39:51 marka Exp $ */
/*! \file */
@ -37,10 +37,12 @@
#include <named/tsigconf.h>
static isc_result_t
add_initial_keys(cfg_obj_t *list, dns_tsig_keyring_t *ring, isc_mem_t *mctx) {
add_initial_keys(const cfg_obj_t *list, dns_tsig_keyring_t *ring,
isc_mem_t *mctx)
{
dns_tsigkey_t *tsigkey = NULL;
cfg_listelt_t *element;
cfg_obj_t *key = NULL;
const cfg_listelt_t *element;
const cfg_obj_t *key = NULL;
const char *keyid = NULL;
unsigned char *secret = NULL;
int secretalloc = 0;
@ -53,8 +55,8 @@ add_initial_keys(cfg_obj_t *list, dns_tsig_keyring_t *ring, isc_mem_t *mctx) {
element != NULL;
element = cfg_list_next(element))
{
cfg_obj_t *algobj = NULL;
cfg_obj_t *secretobj = NULL;
const cfg_obj_t *algobj = NULL;
const cfg_obj_t *secretobj = NULL;
dns_name_t keyname;
dns_name_t *alg;
const char *algstr;
@ -138,11 +140,11 @@ add_initial_keys(cfg_obj_t *list, dns_tsig_keyring_t *ring, isc_mem_t *mctx) {
}
isc_result_t
ns_tsigkeyring_fromconfig(cfg_obj_t *config, cfg_obj_t *vconfig,
ns_tsigkeyring_fromconfig(const cfg_obj_t *config, const cfg_obj_t *vconfig,
isc_mem_t *mctx, dns_tsig_keyring_t **ringp)
{
cfg_obj_t *maps[3];
cfg_obj_t *keylist;
const cfg_obj_t *maps[3];
const cfg_obj_t *keylist;
dns_tsig_keyring_t *ring = NULL;
isc_result_t result;
int i;

View file

@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
/* $Id: zoneconf.c,v 1.130 2006/02/16 01:34:24 marka Exp $ */
/* $Id: zoneconf.c,v 1.131 2006/02/28 02:39:51 marka Exp $ */
/*% */
@ -58,15 +58,15 @@
* Convenience function for configuring a single zone ACL.
*/
static isc_result_t
configure_zone_acl(cfg_obj_t *zconfig, cfg_obj_t *vconfig, cfg_obj_t *config,
const char *aclname, cfg_aclconfctx_t *actx,
dns_zone_t *zone,
configure_zone_acl(const cfg_obj_t *zconfig, const cfg_obj_t *vconfig,
const cfg_obj_t *config, const char *aclname,
cfg_aclconfctx_t *actx, dns_zone_t *zone,
void (*setzacl)(dns_zone_t *, dns_acl_t *),
void (*clearzacl)(dns_zone_t *))
{
isc_result_t result;
cfg_obj_t *maps[4];
cfg_obj_t *aclobj = NULL;
const cfg_obj_t *maps[4];
const cfg_obj_t *aclobj = NULL;
int i = 0;
dns_acl_t *dacl = NULL;
@ -75,7 +75,7 @@ configure_zone_acl(cfg_obj_t *zconfig, cfg_obj_t *vconfig, cfg_obj_t *config,
if (vconfig != NULL)
maps[i++] = cfg_tuple_get(vconfig, "options");
if (config != NULL) {
cfg_obj_t *options = NULL;
const cfg_obj_t *options = NULL;
(void)cfg_map_get(config, "options", &options);
if (options != NULL)
maps[i++] = options;
@ -101,9 +101,9 @@ configure_zone_acl(cfg_obj_t *zconfig, cfg_obj_t *vconfig, cfg_obj_t *config,
* Parse the zone update-policy statement.
*/
static isc_result_t
configure_zone_ssutable(cfg_obj_t *zconfig, dns_zone_t *zone) {
cfg_obj_t *updatepolicy = NULL;
cfg_listelt_t *element, *element2;
configure_zone_ssutable(const cfg_obj_t *zconfig, dns_zone_t *zone) {
const cfg_obj_t *updatepolicy = NULL;
const cfg_listelt_t *element, *element2;
dns_ssutable_t *table = NULL;
isc_mem_t *mctx = dns_zone_getmctx(zone);
isc_result_t result;
@ -122,12 +122,12 @@ configure_zone_ssutable(cfg_obj_t *zconfig, dns_zone_t *zone) {
element != NULL;
element = cfg_list_next(element))
{
cfg_obj_t *stmt = cfg_listelt_value(element);
cfg_obj_t *mode = cfg_tuple_get(stmt, "mode");
cfg_obj_t *identity = cfg_tuple_get(stmt, "identity");
cfg_obj_t *matchtype = cfg_tuple_get(stmt, "matchtype");
cfg_obj_t *dname = cfg_tuple_get(stmt, "name");
cfg_obj_t *typelist = cfg_tuple_get(stmt, "types");
const cfg_obj_t *stmt = cfg_listelt_value(element);
const cfg_obj_t *mode = cfg_tuple_get(stmt, "mode");
const cfg_obj_t *identity = cfg_tuple_get(stmt, "identity");
const cfg_obj_t *matchtype = cfg_tuple_get(stmt, "matchtype");
const cfg_obj_t *dname = cfg_tuple_get(stmt, "name");
const cfg_obj_t *typelist = cfg_tuple_get(stmt, "types");
const char *str;
isc_boolean_t grant = ISC_FALSE;
unsigned int mtype = DNS_SSUMATCHTYPE_NAME;
@ -200,7 +200,7 @@ configure_zone_ssutable(cfg_obj_t *zconfig, dns_zone_t *zone) {
element2 != NULL;
element2 = cfg_list_next(element2))
{
cfg_obj_t *typeobj;
const cfg_obj_t *typeobj;
isc_textregion_t r;
INSIST(i < n);
@ -246,8 +246,8 @@ configure_zone_ssutable(cfg_obj_t *zconfig, dns_zone_t *zone) {
* Convert a config file zone type into a server zone type.
*/
static inline dns_zonetype_t
zonetype_fromconfig(cfg_obj_t *map) {
cfg_obj_t *obj = NULL;
zonetype_fromconfig(const cfg_obj_t *map) {
const cfg_obj_t *obj = NULL;
isc_result_t result;
result = cfg_map_get(map, "type", &obj);
@ -302,7 +302,9 @@ strtoargv(isc_mem_t *mctx, char *s, unsigned int *argcp, char ***argvp) {
}
static void
checknames(dns_zonetype_t ztype, cfg_obj_t **maps, cfg_obj_t **objp) {
checknames(dns_zonetype_t ztype, const cfg_obj_t **maps,
const cfg_obj_t **objp)
{
const char *zone = NULL;
isc_result_t result;
@ -317,17 +319,18 @@ checknames(dns_zonetype_t ztype, cfg_obj_t **maps, cfg_obj_t **objp) {
}
isc_result_t
ns_zone_configure(cfg_obj_t *config, cfg_obj_t *vconfig, cfg_obj_t *zconfig,
cfg_aclconfctx_t *ac, dns_zone_t *zone)
ns_zone_configure(const cfg_obj_t *config, const cfg_obj_t *vconfig,
const cfg_obj_t *zconfig, cfg_aclconfctx_t *ac,
dns_zone_t *zone)
{
isc_result_t result;
const char *zname;
dns_rdataclass_t zclass;
dns_rdataclass_t vclass;
cfg_obj_t *maps[5];
cfg_obj_t *zoptions = NULL;
cfg_obj_t *options = NULL;
cfg_obj_t *obj;
const cfg_obj_t *maps[5];
const cfg_obj_t *zoptions = NULL;
const cfg_obj_t *options = NULL;
const cfg_obj_t *obj;
const char *filename = NULL;
dns_notifytype_t notifytype = dns_notifytype_yes;
isc_sockaddr_t *addrs;
@ -876,9 +879,9 @@ ns_zone_configure(cfg_obj_t *config, cfg_obj_t *vconfig, cfg_obj_t *zconfig,
}
isc_boolean_t
ns_zone_reusable(dns_zone_t *zone, cfg_obj_t *zconfig) {
cfg_obj_t *zoptions = NULL;
cfg_obj_t *obj = NULL;
ns_zone_reusable(dns_zone_t *zone, const cfg_obj_t *zconfig) {
const cfg_obj_t *zoptions = NULL;
const cfg_obj_t *obj = NULL;
const char *cfilename;
const char *zfilename;

View file

@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
/* $Id: rndc.c,v 1.108 2005/09/19 00:18:00 marka Exp $ */
/* $Id: rndc.c,v 1.109 2006/02/28 02:39:51 marka Exp $ */
/*! \file */
@ -415,25 +415,25 @@ parse_config(isc_mem_t *mctx, isc_log_t *log, const char *keyname,
{
isc_result_t result;
const char *conffile = admin_conffile;
cfg_obj_t *addresses = NULL;
cfg_obj_t *defkey = NULL;
cfg_obj_t *options = NULL;
cfg_obj_t *servers = NULL;
cfg_obj_t *server = NULL;
cfg_obj_t *keys = NULL;
cfg_obj_t *key = NULL;
cfg_obj_t *defport = NULL;
cfg_obj_t *secretobj = NULL;
cfg_obj_t *algorithmobj = NULL;
const cfg_obj_t *addresses = NULL;
const cfg_obj_t *defkey = NULL;
const cfg_obj_t *options = NULL;
const cfg_obj_t *servers = NULL;
const cfg_obj_t *server = NULL;
const cfg_obj_t *keys = NULL;
const cfg_obj_t *key = NULL;
const cfg_obj_t *defport = NULL;
const cfg_obj_t *secretobj = NULL;
const cfg_obj_t *algorithmobj = NULL;
cfg_obj_t *config = NULL;
cfg_obj_t *address = NULL;
cfg_listelt_t *elt;
const cfg_obj_t *address = NULL;
const cfg_listelt_t *elt;
const char *secretstr;
const char *algorithm;
static char secretarray[1024];
const cfg_type_t *conftype = &cfg_type_rndcconf;
isc_boolean_t key_only = ISC_FALSE;
cfg_listelt_t *element;
const cfg_listelt_t *element;
if (! isc_file_exists(conffile)) {
conffile = admin_keyfile;
@ -460,7 +460,7 @@ parse_config(isc_mem_t *mctx, isc_log_t *log, const char *keyname,
if (key_only && servername == NULL)
servername = "127.0.0.1";
else if (servername == NULL && options != NULL) {
cfg_obj_t *defserverobj = NULL;
const cfg_obj_t *defserverobj = NULL;
(void)cfg_map_get(options, "default-server", &defserverobj);
if (defserverobj != NULL)
servername = cfg_obj_asstring(defserverobj);
@ -570,7 +570,7 @@ parse_config(isc_mem_t *mctx, isc_log_t *log, const char *keyname,
if (!cfg_obj_issockaddr(address)) {
unsigned int myport;
const char *name;
cfg_obj_t *obj;
const cfg_obj_t *obj;
obj = cfg_tuple_get(address, "name");
name = cfg_obj_asstring(obj);

View file

@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
/* $Id: check.c,v 1.69 2006/02/17 00:24:20 marka Exp $ */
/* $Id: check.c,v 1.70 2006/02/28 02:39:51 marka Exp $ */
/*! \file */
@ -54,12 +54,12 @@ freekey(char *key, unsigned int type, isc_symvalue_t value, void *userarg) {
}
static isc_result_t
check_orderent(cfg_obj_t *ent, isc_log_t *logctx) {
check_orderent(const cfg_obj_t *ent, isc_log_t *logctx) {
isc_result_t result = ISC_R_SUCCESS;
isc_result_t tresult;
isc_textregion_t r;
dns_fixedname_t fixed;
cfg_obj_t *obj;
const cfg_obj_t *obj;
dns_rdataclass_t rdclass;
dns_rdatatype_t rdtype;
isc_buffer_t b;
@ -136,11 +136,11 @@ check_orderent(cfg_obj_t *ent, isc_log_t *logctx) {
}
static isc_result_t
check_order(cfg_obj_t *options, isc_log_t *logctx) {
check_order(const cfg_obj_t *options, isc_log_t *logctx) {
isc_result_t result = ISC_R_SUCCESS;
isc_result_t tresult;
cfg_listelt_t *element;
cfg_obj_t *obj = NULL;
const cfg_listelt_t *element;
const cfg_obj_t *obj = NULL;
if (cfg_map_get(options, "rrset-order", &obj) != ISC_R_SUCCESS)
return (result);
@ -157,11 +157,11 @@ check_order(cfg_obj_t *options, isc_log_t *logctx) {
}
static isc_result_t
check_dual_stack(cfg_obj_t *options, isc_log_t *logctx) {
cfg_listelt_t *element;
cfg_obj_t *alternates = NULL;
cfg_obj_t *value;
cfg_obj_t *obj;
check_dual_stack(const cfg_obj_t *options, isc_log_t *logctx) {
const cfg_listelt_t *element;
const cfg_obj_t *alternates = NULL;
const cfg_obj_t *value;
const cfg_obj_t *obj;
const char *str;
dns_fixedname_t fixed;
dns_name_t *name;
@ -217,9 +217,9 @@ check_dual_stack(cfg_obj_t *options, isc_log_t *logctx) {
}
static isc_result_t
check_forward(cfg_obj_t *options, isc_log_t *logctx) {
cfg_obj_t *forward = NULL;
cfg_obj_t *forwarders = NULL;
check_forward(const cfg_obj_t *options, isc_log_t *logctx) {
const cfg_obj_t *forward = NULL;
const cfg_obj_t *forwarders = NULL;
(void)cfg_map_get(options, "forward", &forward);
(void)cfg_map_get(options, "forwarders", &forwarders);
@ -233,15 +233,15 @@ check_forward(cfg_obj_t *options, isc_log_t *logctx) {
}
static isc_result_t
disabled_algorithms(cfg_obj_t *disabled, isc_log_t *logctx) {
disabled_algorithms(const cfg_obj_t *disabled, isc_log_t *logctx) {
isc_result_t result = ISC_R_SUCCESS;
isc_result_t tresult;
cfg_listelt_t *element;
const cfg_listelt_t *element;
const char *str;
isc_buffer_t b;
dns_fixedname_t fixed;
dns_name_t *name;
cfg_obj_t *obj;
const cfg_obj_t *obj;
dns_fixedname_init(&fixed);
name = dns_fixedname_name(&fixed);
@ -285,8 +285,9 @@ disabled_algorithms(cfg_obj_t *disabled, isc_log_t *logctx) {
}
static isc_result_t
nameexist(cfg_obj_t *obj, const char *name, int value, isc_symtab_t *symtab,
const char *fmt, isc_log_t *logctx, isc_mem_t *mctx)
nameexist(const cfg_obj_t *obj, const char *name, int value,
isc_symtab_t *symtab, const char *fmt, isc_log_t *logctx,
isc_mem_t *mctx)
{
char *key;
const char *file;
@ -297,14 +298,14 @@ nameexist(cfg_obj_t *obj, const char *name, int value, isc_symtab_t *symtab,
key = isc_mem_strdup(mctx, name);
if (key == NULL)
return (ISC_R_NOMEMORY);
symvalue.as_pointer = obj;
symvalue.as_cpointer = obj;
result = isc_symtab_define(symtab, key, value, symvalue,
isc_symexists_reject);
if (result == ISC_R_EXISTS) {
RUNTIME_CHECK(isc_symtab_lookup(symtab, key, value,
&symvalue) == ISC_R_SUCCESS);
file = cfg_obj_file(symvalue.as_pointer);
line = cfg_obj_line(symvalue.as_pointer);
file = cfg_obj_file(symvalue.as_cpointer);
line = cfg_obj_line(symvalue.as_cpointer);
if (file == NULL)
file = "<unknown file>";
@ -318,10 +319,10 @@ nameexist(cfg_obj_t *obj, const char *name, int value, isc_symtab_t *symtab,
}
static isc_result_t
mustbesecure(cfg_obj_t *secure, isc_symtab_t *symtab, isc_log_t *logctx,
mustbesecure(const cfg_obj_t *secure, isc_symtab_t *symtab, isc_log_t *logctx,
isc_mem_t *mctx)
{
cfg_obj_t *obj;
const cfg_obj_t *obj;
char namebuf[DNS_NAME_FORMATSIZE];
const char *str;
dns_fixedname_t fixed;
@ -350,13 +351,13 @@ mustbesecure(cfg_obj_t *secure, isc_symtab_t *symtab, isc_log_t *logctx,
}
static isc_result_t
checkacl(const char *aclname, cfg_aclconfctx_t *actx, cfg_obj_t *zconfig,
cfg_obj_t *voptions, cfg_obj_t *config, isc_log_t *logctx,
isc_mem_t *mctx)
checkacl(const char *aclname, cfg_aclconfctx_t *actx, const cfg_obj_t *zconfig,
const cfg_obj_t *voptions, const cfg_obj_t *config,
isc_log_t *logctx, isc_mem_t *mctx)
{
isc_result_t result;
cfg_obj_t *aclobj = NULL;
cfg_obj_t *options;
const cfg_obj_t *aclobj = NULL;
const cfg_obj_t *options;
dns_acl_t *acl = NULL;
if (zconfig != NULL) {
@ -380,8 +381,8 @@ checkacl(const char *aclname, cfg_aclconfctx_t *actx, cfg_obj_t *zconfig,
}
static isc_result_t
check_viewacls(cfg_aclconfctx_t *actx, cfg_obj_t *voptions, cfg_obj_t *config,
isc_log_t *logctx, isc_mem_t *mctx)
check_viewacls(cfg_aclconfctx_t *actx, const cfg_obj_t *voptions,
const cfg_obj_t *config, isc_log_t *logctx, isc_mem_t *mctx)
{
isc_result_t result = ISC_R_SUCCESS, tresult;
int i = 0;
@ -406,12 +407,12 @@ typedef struct {
} intervaltable;
static isc_result_t
check_options(cfg_obj_t *options, isc_log_t *logctx, isc_mem_t *mctx) {
check_options(const cfg_obj_t *options, isc_log_t *logctx, isc_mem_t *mctx) {
isc_result_t result = ISC_R_SUCCESS;
isc_result_t tresult;
unsigned int i;
cfg_obj_t *obj = NULL;
cfg_listelt_t *element;
const cfg_obj_t *obj = NULL;
const cfg_listelt_t *element;
isc_symtab_t *symtab = NULL;
dns_fixedname_t fixed;
const char *str;
@ -470,8 +471,8 @@ check_options(cfg_obj_t *options, isc_log_t *logctx, isc_mem_t *mctx) {
(void)cfg_map_get(options, "root-delegation-only", &obj);
if (obj != NULL) {
if (!cfg_obj_isvoid(obj)) {
cfg_listelt_t *element;
cfg_obj_t *exclude;
const cfg_listelt_t *element;
const cfg_obj_t *exclude;
const char *str;
dns_fixedname_t fixed;
dns_name_t *name;
@ -666,10 +667,10 @@ check_options(cfg_obj_t *options, isc_log_t *logctx, isc_mem_t *mctx) {
}
static isc_result_t
get_masters_def(cfg_obj_t *cctx, const char *name, cfg_obj_t **ret) {
get_masters_def(const cfg_obj_t *cctx, const char *name, const cfg_obj_t **ret) {
isc_result_t result;
cfg_obj_t *masters = NULL;
cfg_listelt_t *elt;
const cfg_obj_t *masters = NULL;
const cfg_listelt_t *elt;
result = cfg_map_get(cctx, "masters", &masters);
if (result != ISC_R_SUCCESS)
@ -677,7 +678,7 @@ get_masters_def(cfg_obj_t *cctx, const char *name, cfg_obj_t **ret) {
for (elt = cfg_list_first(masters);
elt != NULL;
elt = cfg_list_next(elt)) {
cfg_obj_t *list;
const cfg_obj_t *list;
const char *listname;
list = cfg_listelt_value(elt);
@ -692,18 +693,18 @@ get_masters_def(cfg_obj_t *cctx, const char *name, cfg_obj_t **ret) {
}
static isc_result_t
validate_masters(cfg_obj_t *obj, cfg_obj_t *config, isc_uint32_t *countp,
isc_log_t *logctx, isc_mem_t *mctx)
validate_masters(const cfg_obj_t *obj, const cfg_obj_t *config,
isc_uint32_t *countp, isc_log_t *logctx, isc_mem_t *mctx)
{
isc_result_t result = ISC_R_SUCCESS;
isc_result_t tresult;
isc_uint32_t count = 0;
isc_symtab_t *symtab = NULL;
isc_symvalue_t symvalue;
cfg_listelt_t *element;
cfg_listelt_t **stack = NULL;
const cfg_listelt_t *element;
const cfg_listelt_t **stack = NULL;
isc_uint32_t stackcount = 0, pushed = 0;
cfg_obj_t *list;
const cfg_obj_t *list;
REQUIRE(countp != NULL);
result = isc_symtab_create(mctx, 100, NULL, NULL, ISC_FALSE, &symtab);
@ -721,8 +722,8 @@ validate_masters(cfg_obj_t *obj, cfg_obj_t *config, isc_uint32_t *countp,
element = cfg_list_next(element))
{
const char *listname;
cfg_obj_t *addr;
cfg_obj_t *key;
const cfg_obj_t *addr;
const cfg_obj_t *key;
addr = cfg_tuple_get(cfg_listelt_value(element),
"masterselement");
@ -740,7 +741,7 @@ validate_masters(cfg_obj_t *obj, cfg_obj_t *config, isc_uint32_t *countp,
result = ISC_R_FAILURE;
}
listname = cfg_obj_asstring(addr);
symvalue.as_pointer = addr;
symvalue.as_cpointer = addr;
tresult = isc_symtab_define(symtab, listname, 1, symvalue,
isc_symexists_reject);
if (tresult == ISC_R_EXISTS)
@ -788,11 +789,11 @@ validate_masters(cfg_obj_t *obj, cfg_obj_t *config, isc_uint32_t *countp,
}
static isc_result_t
check_update_policy(cfg_obj_t *policy, isc_log_t *logctx) {
check_update_policy(const cfg_obj_t *policy, isc_log_t *logctx) {
isc_result_t result = ISC_R_SUCCESS;
isc_result_t tresult;
cfg_listelt_t *element;
cfg_listelt_t *element2;
const cfg_listelt_t *element;
const cfg_listelt_t *element2;
dns_fixedname_t fixed;
const char *str;
isc_buffer_t b;
@ -801,11 +802,11 @@ check_update_policy(cfg_obj_t *policy, isc_log_t *logctx) {
element != NULL;
element = cfg_list_next(element))
{
cfg_obj_t *stmt = cfg_listelt_value(element);
cfg_obj_t *identity = cfg_tuple_get(stmt, "identity");
cfg_obj_t *matchtype = cfg_tuple_get(stmt, "matchtype");
cfg_obj_t *dname = cfg_tuple_get(stmt, "name");
cfg_obj_t *typelist = cfg_tuple_get(stmt, "types");
const cfg_obj_t *stmt = cfg_listelt_value(element);
const cfg_obj_t *identity = cfg_tuple_get(stmt, "identity");
const cfg_obj_t *matchtype = cfg_tuple_get(stmt, "matchtype");
const cfg_obj_t *dname = cfg_tuple_get(stmt, "name");
const cfg_obj_t *typelist = cfg_tuple_get(stmt, "types");
dns_fixedname_init(&fixed);
str = cfg_obj_asstring(identity);
@ -842,7 +843,7 @@ check_update_policy(cfg_obj_t *policy, isc_log_t *logctx) {
element2 != NULL;
element2 = cfg_list_next(element2))
{
cfg_obj_t *typeobj;
const cfg_obj_t *typeobj;
isc_textregion_t r;
dns_rdatatype_t type;
@ -875,15 +876,16 @@ typedef struct {
} optionstable;
static isc_result_t
check_zoneconf(cfg_obj_t *zconfig, cfg_obj_t *voptions, cfg_obj_t *config,
isc_symtab_t *symtab, dns_rdataclass_t defclass,
cfg_aclconfctx_t *actx, isc_log_t *logctx, isc_mem_t *mctx)
check_zoneconf(const cfg_obj_t *zconfig, const cfg_obj_t *voptions,
const cfg_obj_t *config, isc_symtab_t *symtab,
dns_rdataclass_t defclass, cfg_aclconfctx_t *actx,
isc_log_t *logctx, isc_mem_t *mctx)
{
const char *zname;
const char *typestr;
unsigned int ztype;
cfg_obj_t *zoptions;
cfg_obj_t *obj = NULL;
const cfg_obj_t *zoptions;
const cfg_obj_t *obj = NULL;
isc_result_t result = ISC_R_SUCCESS;
isc_result_t tresult;
unsigned int i;
@ -1107,7 +1109,7 @@ check_zoneconf(cfg_obj_t *zconfig, cfg_obj_t *voptions, cfg_obj_t *config,
* Check the excessively complicated "dialup" option.
*/
if (ztype == MASTERZONE || ztype == SLAVEZONE || ztype == STUBZONE) {
cfg_obj_t *dialup = NULL;
const cfg_obj_t *dialup = NULL;
(void)cfg_map_get(zoptions, "dialup", &dialup);
if (dialup != NULL && cfg_obj_isstring(dialup)) {
const char *str = cfg_obj_asstring(dialup);
@ -1181,9 +1183,9 @@ typedef struct keyalgorithms {
} algorithmtable;
isc_result_t
bind9_check_key(cfg_obj_t *key, isc_log_t *logctx) {
cfg_obj_t *algobj = NULL;
cfg_obj_t *secretobj = NULL;
bind9_check_key(const cfg_obj_t *key, isc_log_t *logctx) {
const cfg_obj_t *algobj = NULL;
const cfg_obj_t *secretobj = NULL;
const char *keyname = cfg_obj_asstring(cfg_map_getname(key));
const char *algorithm;
int i;
@ -1263,16 +1265,16 @@ bind9_check_key(cfg_obj_t *key, isc_log_t *logctx) {
}
static isc_result_t
check_keylist(cfg_obj_t *keys, isc_symtab_t *symtab, isc_log_t *logctx) {
check_keylist(const cfg_obj_t *keys, isc_symtab_t *symtab, isc_log_t *logctx) {
isc_result_t result = ISC_R_SUCCESS;
isc_result_t tresult;
cfg_listelt_t *element;
const cfg_listelt_t *element;
for (element = cfg_list_first(keys);
element != NULL;
element = cfg_list_next(element))
{
cfg_obj_t *key = cfg_listelt_value(element);
const cfg_obj_t *key = cfg_listelt_value(element);
const char *keyname = cfg_obj_asstring(cfg_map_getname(key));
isc_symvalue_t symvalue;
@ -1280,7 +1282,7 @@ check_keylist(cfg_obj_t *keys, isc_symtab_t *symtab, isc_log_t *logctx) {
if (tresult != ISC_R_SUCCESS)
return (tresult);
symvalue.as_pointer = key;
symvalue.as_cpointer = key;
tresult = isc_symtab_define(symtab, keyname, 1,
symvalue, isc_symexists_reject);
if (tresult == ISC_R_EXISTS) {
@ -1289,8 +1291,8 @@ check_keylist(cfg_obj_t *keys, isc_symtab_t *symtab, isc_log_t *logctx) {
RUNTIME_CHECK(isc_symtab_lookup(symtab, keyname,
1, &symvalue) == ISC_R_SUCCESS);
file = cfg_obj_file(symvalue.as_pointer);
line = cfg_obj_line(symvalue.as_pointer);
file = cfg_obj_file(symvalue.as_cpointer);
line = cfg_obj_line(symvalue.as_cpointer);
if (file == NULL)
file = "<unknown file>";
@ -1316,14 +1318,14 @@ static struct {
};
static isc_result_t
check_servers(cfg_obj_t *servers, isc_log_t *logctx) {
check_servers(const cfg_obj_t *servers, isc_log_t *logctx) {
isc_result_t result = ISC_R_SUCCESS;
isc_result_t tresult;
cfg_listelt_t *e1, *e2;
cfg_obj_t *v1, *v2;
const cfg_listelt_t *e1, *e2;
const cfg_obj_t *v1, *v2;
isc_netaddr_t n1, n2;
unsigned int p1, p2;
cfg_obj_t *obj;
const cfg_obj_t *obj;
char buf[ISC_NETADDR_FORMATSIZE];
const char *xfr;
int source;
@ -1383,13 +1385,13 @@ check_servers(cfg_obj_t *servers, isc_log_t *logctx) {
}
static isc_result_t
check_viewconf(cfg_obj_t *config, cfg_obj_t *voptions, dns_rdataclass_t vclass,
isc_log_t *logctx, isc_mem_t *mctx)
check_viewconf(const cfg_obj_t *config, const cfg_obj_t *voptions,
dns_rdataclass_t vclass, isc_log_t *logctx, isc_mem_t *mctx)
{
cfg_obj_t *servers = NULL;
cfg_obj_t *zones = NULL;
cfg_obj_t *keys = NULL;
cfg_listelt_t *element;
const cfg_obj_t *servers = NULL;
const cfg_obj_t *zones = NULL;
const cfg_obj_t *keys = NULL;
const cfg_listelt_t *element;
isc_symtab_t *symtab = NULL;
isc_result_t result = ISC_R_SUCCESS;
isc_result_t tresult = ISC_R_SUCCESS;
@ -1416,7 +1418,7 @@ check_viewconf(cfg_obj_t *config, cfg_obj_t *voptions, dns_rdataclass_t vclass,
element = cfg_list_next(element))
{
isc_result_t tresult;
cfg_obj_t *zone = cfg_listelt_value(element);
const cfg_obj_t *zone = cfg_listelt_value(element);
tresult = check_zoneconf(zone, voptions, config, symtab,
vclass, &actx, logctx, mctx);
@ -1461,7 +1463,7 @@ check_viewconf(cfg_obj_t *config, cfg_obj_t *voptions, dns_rdataclass_t vclass,
* Check that forwarding is reasonable.
*/
if (voptions == NULL) {
cfg_obj_t *options = NULL;
const cfg_obj_t *options = NULL;
(void)cfg_map_get(config, "options", &options);
if (options != NULL)
if (check_forward(options, logctx) != ISC_R_SUCCESS)
@ -1474,7 +1476,7 @@ check_viewconf(cfg_obj_t *config, cfg_obj_t *voptions, dns_rdataclass_t vclass,
* Check that dual-stack-servers is reasonable.
*/
if (voptions == NULL) {
cfg_obj_t *options = NULL;
const cfg_obj_t *options = NULL;
(void)cfg_map_get(config, "options", &options);
if (options != NULL)
if (check_dual_stack(options, logctx) != ISC_R_SUCCESS)
@ -1525,20 +1527,22 @@ default_channels[] = {
};
static isc_result_t
bind9_check_logging(cfg_obj_t *config, isc_log_t *logctx, isc_mem_t *mctx) {
cfg_obj_t *categories = NULL;
cfg_obj_t *category;
cfg_obj_t *channels = NULL;
cfg_obj_t *channel;
cfg_listelt_t *element;
cfg_listelt_t *delement;
bind9_check_logging(const cfg_obj_t *config, isc_log_t *logctx,
isc_mem_t *mctx)
{
const cfg_obj_t *categories = NULL;
const cfg_obj_t *category;
const cfg_obj_t *channels = NULL;
const cfg_obj_t *channel;
const cfg_listelt_t *element;
const cfg_listelt_t *delement;
const char *channelname;
const char *catname;
cfg_obj_t *fileobj = NULL;
cfg_obj_t *syslogobj = NULL;
cfg_obj_t *nullobj = NULL;
cfg_obj_t *stderrobj = NULL;
cfg_obj_t *logobj = NULL;
const cfg_obj_t *fileobj = NULL;
const cfg_obj_t *syslogobj = NULL;
const cfg_obj_t *nullobj = NULL;
const cfg_obj_t *stderrobj = NULL;
const cfg_obj_t *logobj = NULL;
isc_result_t result = ISC_R_SUCCESS;
isc_result_t tresult;
isc_symtab_t *symtab = NULL;
@ -1553,7 +1557,7 @@ bind9_check_logging(cfg_obj_t *config, isc_log_t *logctx, isc_mem_t *mctx) {
if (result != ISC_R_SUCCESS)
return (result);
symvalue.as_pointer = NULL;
symvalue.as_cpointer = NULL;
for (i = 0; default_channels[i] != NULL; i++) {
tresult = isc_symtab_define(symtab, default_channels[i], 1,
symvalue, isc_symexists_replace);
@ -1631,10 +1635,10 @@ bind9_check_logging(cfg_obj_t *config, isc_log_t *logctx, isc_mem_t *mctx) {
}
static isc_result_t
key_exists(cfg_obj_t *keylist, const char *keyname) {
cfg_listelt_t *element;
key_exists(const cfg_obj_t *keylist, const char *keyname) {
const cfg_listelt_t *element;
const char *str;
cfg_obj_t *obj;
const cfg_obj_t *obj;
if (keylist == NULL)
return (ISC_R_NOTFOUND);
@ -1651,13 +1655,13 @@ key_exists(cfg_obj_t *keylist, const char *keyname) {
}
static isc_result_t
bind9_check_controlskeys(cfg_obj_t *control, cfg_obj_t *keylist,
bind9_check_controlskeys(const cfg_obj_t *control, const cfg_obj_t *keylist,
isc_log_t *logctx)
{
isc_result_t result = ISC_R_SUCCESS, tresult;
cfg_obj_t *control_keylist;
cfg_listelt_t *element;
cfg_obj_t *key;
const cfg_obj_t *control_keylist;
const cfg_listelt_t *element;
const cfg_obj_t *key;
control_keylist = cfg_tuple_get(control, "keys");
if (cfg_obj_isvoid(control_keylist))
@ -1679,17 +1683,19 @@ bind9_check_controlskeys(cfg_obj_t *control, cfg_obj_t *keylist,
}
static isc_result_t
bind9_check_controls(cfg_obj_t *config, isc_log_t *logctx, isc_mem_t *mctx) {
bind9_check_controls(const cfg_obj_t *config, isc_log_t *logctx,
isc_mem_t *mctx)
{
isc_result_t result = ISC_R_SUCCESS, tresult;
cfg_aclconfctx_t actx;
cfg_listelt_t *element, *element2;
cfg_obj_t *allow;
cfg_obj_t *control;
cfg_obj_t *controls;
cfg_obj_t *controlslist = NULL;
cfg_obj_t *inetcontrols;
cfg_obj_t *unixcontrols;
cfg_obj_t *keylist = NULL;
const cfg_listelt_t *element, *element2;
const cfg_obj_t *allow;
const cfg_obj_t *control;
const cfg_obj_t *controls;
const cfg_obj_t *controlslist = NULL;
const cfg_obj_t *inetcontrols;
const cfg_obj_t *unixcontrols;
const cfg_obj_t *keylist = NULL;
const char *path;
isc_uint32_t perm, mask;
dns_acl_t *acl = NULL;
@ -1774,14 +1780,16 @@ bind9_check_controls(cfg_obj_t *config, isc_log_t *logctx, isc_mem_t *mctx) {
}
isc_result_t
bind9_check_namedconf(cfg_obj_t *config, isc_log_t *logctx, isc_mem_t *mctx) {
cfg_obj_t *options = NULL;
cfg_obj_t *servers = NULL;
cfg_obj_t *views = NULL;
cfg_obj_t *acls = NULL;
cfg_obj_t *kals = NULL;
cfg_obj_t *obj;
cfg_listelt_t *velement;
bind9_check_namedconf(const cfg_obj_t *config, isc_log_t *logctx,
isc_mem_t *mctx)
{
const cfg_obj_t *options = NULL;
const cfg_obj_t *servers = NULL;
const cfg_obj_t *views = NULL;
const cfg_obj_t *acls = NULL;
const cfg_obj_t *kals = NULL;
const cfg_obj_t *obj;
const cfg_listelt_t *velement;
isc_result_t result = ISC_R_SUCCESS;
isc_result_t tresult;
isc_symtab_t *symtab = NULL;
@ -1821,7 +1829,7 @@ bind9_check_namedconf(cfg_obj_t *config, isc_log_t *logctx, isc_mem_t *mctx) {
logctx, mctx) != ISC_R_SUCCESS)
result = ISC_R_FAILURE;
} else {
cfg_obj_t *zones = NULL;
const cfg_obj_t *zones = NULL;
(void)cfg_map_get(config, "zone", &zones);
if (zones != NULL) {
@ -1839,10 +1847,10 @@ bind9_check_namedconf(cfg_obj_t *config, isc_log_t *logctx, isc_mem_t *mctx) {
velement != NULL;
velement = cfg_list_next(velement))
{
cfg_obj_t *view = cfg_listelt_value(velement);
cfg_obj_t *vname = cfg_tuple_get(view, "name");
cfg_obj_t *voptions = cfg_tuple_get(view, "options");
cfg_obj_t *vclassobj = cfg_tuple_get(view, "class");
const cfg_obj_t *view = cfg_listelt_value(velement);
const cfg_obj_t *vname = cfg_tuple_get(view, "name");
const cfg_obj_t *voptions = cfg_tuple_get(view, "options");
const cfg_obj_t *vclassobj = cfg_tuple_get(view, "class");
dns_rdataclass_t vclass = dns_rdataclass_in;
isc_result_t tresult = ISC_R_SUCCESS;
const char *key = cfg_obj_asstring(vname);
@ -1860,7 +1868,7 @@ bind9_check_namedconf(cfg_obj_t *config, isc_log_t *logctx, isc_mem_t *mctx) {
cfg_obj_asstring(vname), r.base);
}
if (tresult == ISC_R_SUCCESS && symtab != NULL) {
symvalue.as_pointer = view;
symvalue.as_cpointer = view;
tresult = isc_symtab_define(symtab, key, vclass,
symvalue,
isc_symexists_reject);
@ -1869,8 +1877,8 @@ bind9_check_namedconf(cfg_obj_t *config, isc_log_t *logctx, isc_mem_t *mctx) {
unsigned int line;
RUNTIME_CHECK(isc_symtab_lookup(symtab, key,
vclass, &symvalue) == ISC_R_SUCCESS);
file = cfg_obj_file(symvalue.as_pointer);
line = cfg_obj_line(symvalue.as_pointer);
file = cfg_obj_file(symvalue.as_cpointer);
line = cfg_obj_line(symvalue.as_cpointer);
cfg_obj_log(view, logctx, ISC_LOG_ERROR,
"view '%s': already exists "
"previous definition: %s:%u",
@ -1910,14 +1918,14 @@ bind9_check_namedconf(cfg_obj_t *config, isc_log_t *logctx, isc_mem_t *mctx) {
tresult = cfg_map_get(config, "acl", &acls);
if (tresult == ISC_R_SUCCESS) {
cfg_listelt_t *elt;
cfg_listelt_t *elt2;
const cfg_listelt_t *elt;
const cfg_listelt_t *elt2;
const char *aclname;
for (elt = cfg_list_first(acls);
elt != NULL;
elt = cfg_list_next(elt)) {
cfg_obj_t *acl = cfg_listelt_value(elt);
const cfg_obj_t *acl = cfg_listelt_value(elt);
unsigned int i;
aclname = cfg_obj_asstring(cfg_tuple_get(acl, "name"));
@ -1936,7 +1944,7 @@ bind9_check_namedconf(cfg_obj_t *config, isc_log_t *logctx, isc_mem_t *mctx) {
for (elt2 = cfg_list_next(elt);
elt2 != NULL;
elt2 = cfg_list_next(elt2)) {
cfg_obj_t *acl2 = cfg_listelt_value(elt2);
const cfg_obj_t *acl2 = cfg_listelt_value(elt2);
const char *name;
name = cfg_obj_asstring(cfg_tuple_get(acl2,
"name"));
@ -1960,21 +1968,21 @@ bind9_check_namedconf(cfg_obj_t *config, isc_log_t *logctx, isc_mem_t *mctx) {
tresult = cfg_map_get(config, "kal", &kals);
if (tresult == ISC_R_SUCCESS) {
cfg_listelt_t *elt;
cfg_listelt_t *elt2;
const cfg_listelt_t *elt;
const cfg_listelt_t *elt2;
const char *aclname;
for (elt = cfg_list_first(kals);
elt != NULL;
elt = cfg_list_next(elt)) {
cfg_obj_t *acl = cfg_listelt_value(elt);
const cfg_obj_t *acl = cfg_listelt_value(elt);
aclname = cfg_obj_asstring(cfg_tuple_get(acl, "name"));
for (elt2 = cfg_list_next(elt);
elt2 != NULL;
elt2 = cfg_list_next(elt2)) {
cfg_obj_t *acl2 = cfg_listelt_value(elt2);
const cfg_obj_t *acl2 = cfg_listelt_value(elt2);
const char *name;
name = cfg_obj_asstring(cfg_tuple_get(acl2,
"name"));

View file

@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
/* $Id: check.h,v 1.4 2005/04/29 00:22:42 marka Exp $ */
/* $Id: check.h,v 1.5 2006/02/28 02:39:51 marka Exp $ */
#ifndef BIND9_CHECK_H
#define BIND9_CHECK_H 1
@ -30,7 +30,8 @@
ISC_LANG_BEGINDECLS
isc_result_t
bind9_check_namedconf(cfg_obj_t *config, isc_log_t *logctx, isc_mem_t *mctx);
bind9_check_namedconf(const cfg_obj_t *config, isc_log_t *logctx,
isc_mem_t *mctx);
/*%<
* Check the syntactic validity of a configuration parse tree generated from
* a named.conf file.
@ -46,7 +47,7 @@ bind9_check_namedconf(cfg_obj_t *config, isc_log_t *logctx, isc_mem_t *mctx);
*/
isc_result_t
bind9_check_key(cfg_obj_t *config, isc_log_t *logctx);
bind9_check_key(const cfg_obj_t *config, isc_log_t *logctx);
/*%<
* Same as bind9_check_namedconf(), but for a single 'key' statement.
*/

View file

@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
/* $Id: acl.c,v 1.28 2005/07/12 01:00:14 marka Exp $ */
/* $Id: acl.c,v 1.29 2006/02/28 02:39:51 marka Exp $ */
/*! \file */
@ -74,7 +74,7 @@ dns_acl_create(isc_mem_t *mctx, int n, dns_acl_t **target) {
}
isc_result_t
dns_acl_appendelement(dns_acl_t *acl, dns_aclelement_t *elt) {
dns_acl_appendelement(dns_acl_t *acl, const dns_aclelement_t *elt) {
if (acl->length + 1 > acl->alloc) {
/*
* Resize the ACL.
@ -129,12 +129,12 @@ dns_acl_none(isc_mem_t *mctx, dns_acl_t **target) {
}
isc_result_t
dns_acl_match(isc_netaddr_t *reqaddr,
dns_name_t *reqsigner,
dns_acl_t *acl,
dns_aclenv_t *env,
dns_acl_match(const isc_netaddr_t *reqaddr,
const dns_name_t *reqsigner,
const dns_acl_t *acl,
const dns_aclenv_t *env,
int *match,
dns_aclelement_t **matchelt)
dns_aclelement_t const**matchelt)
{
unsigned int i;
@ -156,9 +156,9 @@ dns_acl_match(isc_netaddr_t *reqaddr,
}
isc_result_t
dns_acl_elementmatch(dns_acl_t *acl,
dns_aclelement_t *elt,
dns_aclelement_t **matchelt)
dns_acl_elementmatch(const dns_acl_t *acl,
const dns_aclelement_t *elt,
const dns_aclelement_t **matchelt)
{
unsigned int i;
@ -179,14 +179,14 @@ dns_acl_elementmatch(dns_acl_t *acl,
}
isc_boolean_t
dns_aclelement_match(isc_netaddr_t *reqaddr,
dns_name_t *reqsigner,
dns_aclelement_t *e,
dns_aclenv_t *env,
dns_aclelement_t **matchelt)
dns_aclelement_match(const isc_netaddr_t *reqaddr,
const dns_name_t *reqsigner,
const dns_aclelement_t *e,
const dns_aclenv_t *env,
const dns_aclelement_t **matchelt)
{
dns_acl_t *inner = NULL;
isc_netaddr_t *addr;
const isc_netaddr_t *addr;
isc_netaddr_t v4addr;
int indirectmatch;
isc_result_t result;
@ -318,7 +318,7 @@ dns_acl_detach(dns_acl_t **aclp) {
}
isc_boolean_t
dns_aclelement_equal(dns_aclelement_t *ea, dns_aclelement_t *eb) {
dns_aclelement_equal(const dns_aclelement_t *ea, const dns_aclelement_t *eb) {
if (ea->type != eb->type)
return (ISC_FALSE);
switch (ea->type) {
@ -344,7 +344,7 @@ dns_aclelement_equal(dns_aclelement_t *ea, dns_aclelement_t *eb) {
}
isc_boolean_t
dns_acl_equal(dns_acl_t *a, dns_acl_t *b) {
dns_acl_equal(const dns_acl_t *a, const dns_acl_t *b) {
unsigned int i;
if (a == b)
return (ISC_TRUE);
@ -359,7 +359,7 @@ dns_acl_equal(dns_acl_t *a, dns_acl_t *b) {
}
static isc_boolean_t
is_loopback(dns_aclipprefix_t *p) {
is_loopback(const dns_aclipprefix_t *p) {
switch (p->address.family) {
case AF_INET:
if (p->prefixlen == 32 &&
@ -378,7 +378,7 @@ is_loopback(dns_aclipprefix_t *p) {
}
isc_boolean_t
dns_acl_isinsecure(dns_acl_t *a) {
dns_acl_isinsecure(const dns_acl_t *a) {
unsigned int i;
for (i = 0; i < a->length; i++) {
dns_aclelement_t *e = &a->elements[i];

View file

@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
/* $Id: compress.c,v 1.55 2005/04/27 04:56:45 sra Exp $ */
/* $Id: compress.c,v 1.56 2006/02/28 02:39:51 marka Exp $ */
/*! \file */
@ -131,7 +131,7 @@ do { \
* If no match is found return ISC_FALSE.
*/
isc_boolean_t
dns_compress_findglobal(dns_compress_t *cctx, dns_name_t *name,
dns_compress_findglobal(dns_compress_t *cctx, const dns_name_t *name,
dns_name_t *prefix, isc_uint16_t *offset)
{
dns_name_t tname, nname;
@ -186,15 +186,15 @@ dns_compress_findglobal(dns_compress_t *cctx, dns_name_t *name,
}
static inline unsigned int
name_length(dns_name_t *name) {
name_length(const dns_name_t *name) {
isc_region_t r;
dns_name_toregion(name, &r);
return (r.length);
}
void
dns_compress_add(dns_compress_t *cctx, dns_name_t *name, dns_name_t *prefix,
isc_uint16_t offset)
dns_compress_add(dns_compress_t *cctx, const dns_name_t *name,
const dns_name_t *prefix, isc_uint16_t offset)
{
dns_name_t tname;
unsigned int start;

View file

@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
/* $Id: acl.h,v 1.24 2005/04/29 00:22:53 marka Exp $ */
/* $Id: acl.h,v 1.25 2006/02/28 02:39:51 marka Exp $ */
#ifndef DNS_ACL_H
#define DNS_ACL_H 1
@ -105,7 +105,7 @@ dns_acl_create(isc_mem_t *mctx, int n, dns_acl_t **target);
*/
isc_result_t
dns_acl_appendelement(dns_acl_t *acl, dns_aclelement_t *elt);
dns_acl_appendelement(dns_acl_t *acl, const dns_aclelement_t *elt);
/*%<
* Append an element to an existing ACL.
*/
@ -129,13 +129,13 @@ void
dns_acl_detach(dns_acl_t **aclp);
isc_boolean_t
dns_aclelement_equal(dns_aclelement_t *ea, dns_aclelement_t *eb);
dns_aclelement_equal(const dns_aclelement_t *ea, const dns_aclelement_t *eb);
isc_boolean_t
dns_acl_equal(dns_acl_t *a, dns_acl_t *b);
dns_acl_equal(const dns_acl_t *a, const dns_acl_t *b);
isc_boolean_t
dns_acl_isinsecure(dns_acl_t *a);
dns_acl_isinsecure(const dns_acl_t *a);
/*%<
* Return #ISC_TRUE iff the acl 'a' is considered insecure, that is,
* if it contains IP addresses other than those of the local host.
@ -155,12 +155,12 @@ void
dns_aclenv_destroy(dns_aclenv_t *env);
isc_result_t
dns_acl_match(isc_netaddr_t *reqaddr,
dns_name_t *reqsigner,
dns_acl_t *acl,
dns_aclenv_t *env,
dns_acl_match(const isc_netaddr_t *reqaddr,
const dns_name_t *reqsigner,
const dns_acl_t *acl,
const dns_aclenv_t *env,
int *match,
dns_aclelement_t **matchelt);
const dns_aclelement_t **matchelt);
/*%<
* General, low-level ACL matching. This is expected to
* be useful even for weird stuff like the topology and sortlist statements.
@ -186,11 +186,11 @@ dns_acl_match(isc_netaddr_t *reqaddr,
*/
isc_boolean_t
dns_aclelement_match(isc_netaddr_t *reqaddr,
dns_name_t *reqsigner,
dns_aclelement_t *e,
dns_aclenv_t *env,
dns_aclelement_t **matchelt);
dns_aclelement_match(const isc_netaddr_t *reqaddr,
const dns_name_t *reqsigner,
const dns_aclelement_t *e,
const dns_aclenv_t *env,
const dns_aclelement_t **matchelt);
/*%<
* Like dns_acl_match, but matches against the single ACL element 'e'
* rather than a complete list and returns ISC_TRUE iff it matched.
@ -201,9 +201,9 @@ dns_aclelement_match(isc_netaddr_t *reqaddr,
*/
isc_result_t
dns_acl_elementmatch(dns_acl_t *acl,
dns_aclelement_t *elt,
dns_aclelement_t **matchelt);
dns_acl_elementmatch(const dns_acl_t *acl,
const dns_aclelement_t *elt,
const dns_aclelement_t **matchelt);
/*%<
* Search for an ACL element in 'acl' which is exactly the same as 'elt'.
* If there is one, and 'matchelt' is non NULL, then '*matchelt' will point

View file

@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
/* $Id: compress.h,v 1.35 2005/04/27 04:56:54 sra Exp $ */
/* $Id: compress.h,v 1.36 2006/02/28 02:39:51 marka Exp $ */
#ifndef DNS_COMPRESS_H
#define DNS_COMPRESS_H 1
@ -157,7 +157,7 @@ dns_compress_getedns(dns_compress_t *cctx);
*/
isc_boolean_t
dns_compress_findglobal(dns_compress_t *cctx, dns_name_t *name,
dns_compress_findglobal(dns_compress_t *cctx, const dns_name_t *name,
dns_name_t *prefix, isc_uint16_t *offset);
/*%<
* Finds longest possible match of 'name' in the global compression table.
@ -176,8 +176,8 @@ dns_compress_findglobal(dns_compress_t *cctx, dns_name_t *name,
*/
void
dns_compress_add(dns_compress_t *cctx, dns_name_t *name, dns_name_t *prefix,
isc_uint16_t offset);
dns_compress_add(dns_compress_t *cctx, const dns_name_t *name,
const dns_name_t *prefix, isc_uint16_t offset);
/*%<
* Add compression pointers for 'name' to the compression table,
* not replacing existing pointers.

View file

@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
/* $Id: message.h,v 1.118 2006/01/06 00:01:44 marka Exp $ */
/* $Id: message.h,v 1.119 2006/02/28 02:39:51 marka Exp $ */
#ifndef DNS_MESSAGE_H
#define DNS_MESSAGE_H 1
@ -240,7 +240,7 @@ struct dns_message {
isc_region_t saved;
dns_rdatasetorderfunc_t order;
void * order_arg;
const void * order_arg;
};
/***
@ -1283,7 +1283,7 @@ dns_message_getrawmessage(dns_message_t *msg);
void
dns_message_setsortorder(dns_message_t *msg, dns_rdatasetorderfunc_t order,
void *order_arg);
const void *order_arg);
/*%<
* Define the order in which RR sets get rendered by
* dns_message_rendersection() to be the ascending order

View file

@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
/* $Id: name.h,v 1.120 2005/10/26 04:35:54 marka Exp $ */
/* $Id: name.h,v 1.121 2006/02/28 02:39:51 marka Exp $ */
#ifndef DNS_NAME_H
#define DNS_NAME_H 1
@ -604,7 +604,7 @@ dns_name_getlabelsequence(const dns_name_t *source, unsigned int first,
void
dns_name_clone(dns_name_t *source, dns_name_t *target);
dns_name_clone(const dns_name_t *source, dns_name_t *target);
/*%<
* Make 'target' refer to the same name as 'source'.
*
@ -720,7 +720,8 @@ dns_name_fromwire(dns_name_t *name, isc_buffer_t *source,
*/
isc_result_t
dns_name_towire(dns_name_t *name, dns_compress_t *cctx, isc_buffer_t *target);
dns_name_towire(const dns_name_t *name, dns_compress_t *cctx,
isc_buffer_t *target);
/*%<
* Convert 'name' into wire format, compressing it as specified by the
* compression context 'cctx', and storing the result in 'target'.
@ -994,7 +995,8 @@ dns_name_split(dns_name_t *name, unsigned int suffixlabels,
*/
isc_result_t
dns_name_dup(dns_name_t *source, isc_mem_t *mctx, dns_name_t *target);
dns_name_dup(const dns_name_t *source, isc_mem_t *mctx,
dns_name_t *target);
/*%<
* Make 'target' a dynamically allocated copy of 'source'.
*

View file

@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
/* $Id: peer.h,v 1.27 2006/02/17 00:24:21 marka Exp $ */
/* $Id: peer.h,v 1.28 2006/02/28 02:39:51 marka Exp $ */
#ifndef DNS_PEER_H
#define DNS_PEER_H 1
@ -177,7 +177,8 @@ isc_result_t
dns_peer_setkey(dns_peer_t *peer, dns_name_t **keyval);
isc_result_t
dns_peer_settransfersource(dns_peer_t *peer, isc_sockaddr_t *transfer_source);
dns_peer_settransfersource(dns_peer_t *peer,
const isc_sockaddr_t *transfer_source);
isc_result_t
dns_peer_gettransfersource(dns_peer_t *peer, isc_sockaddr_t *transfer_source);
@ -195,13 +196,13 @@ isc_result_t
dns_peer_getmaxudp(dns_peer_t *peer, isc_uint16_t *maxudp);
isc_result_t
dns_peer_setnotifysource(dns_peer_t *peer, isc_sockaddr_t *notify_source);
dns_peer_setnotifysource(dns_peer_t *peer, const isc_sockaddr_t *notify_source);
isc_result_t
dns_peer_getnotifysource(dns_peer_t *peer, isc_sockaddr_t *notify_source);
isc_result_t
dns_peer_setquerysource(dns_peer_t *peer, isc_sockaddr_t *query_source);
dns_peer_setquerysource(dns_peer_t *peer, const isc_sockaddr_t *query_source);
isc_result_t
dns_peer_getquerysource(dns_peer_t *peer, isc_sockaddr_t *query_source);

View file

@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
/* $Id: rdataset.h,v 1.56 2005/07/18 05:58:59 marka Exp $ */
/* $Id: rdataset.h,v 1.57 2006/02/28 02:39:51 marka Exp $ */
#ifndef DNS_RDATASET_H
#define DNS_RDATASET_H 1
@ -398,11 +398,11 @@ dns_rdataset_towire(dns_rdataset_t *rdataset,
isc_result_t
dns_rdataset_towiresorted(dns_rdataset_t *rdataset,
dns_name_t *owner_name,
const dns_name_t *owner_name,
dns_compress_t *cctx,
isc_buffer_t *target,
dns_rdatasetorderfunc_t order,
void *order_arg,
const void *order_arg,
unsigned int options,
unsigned int *countp);
/*%<
@ -417,11 +417,11 @@ dns_rdataset_towiresorted(dns_rdataset_t *rdataset,
isc_result_t
dns_rdataset_towirepartial(dns_rdataset_t *rdataset,
dns_name_t *owner_name,
const dns_name_t *owner_name,
dns_compress_t *cctx,
isc_buffer_t *target,
dns_rdatasetorderfunc_t order,
void *order_arg,
const void *order_arg,
unsigned int options,
unsigned int *countp,
void **state);

View file

@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
/* $Id: types.h,v 1.119 2006/01/27 23:57:46 marka Exp $ */
/* $Id: types.h,v 1.120 2006/02/28 02:39:51 marka Exp $ */
#ifndef DNS_TYPES_H
#define DNS_TYPES_H 1
@ -308,7 +308,7 @@ typedef void
(*dns_updatecallback_t)(void *, isc_result_t, dns_message_t *);
typedef int
(*dns_rdatasetorderfunc_t)(dns_rdata_t *, void *);
(*dns_rdatasetorderfunc_t)(const dns_rdata_t *, const void *);
typedef isc_boolean_t
(*dns_checkmxfunc_t)(dns_zone_t *, dns_name_t *, dns_name_t *);

View file

@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
/* $Id: zone.h,v 1.142 2006/02/21 23:12:27 marka Exp $ */
/* $Id: zone.h,v 1.143 2006/02/28 02:39:51 marka Exp $ */
#ifndef DNS_ZONE_H
#define DNS_ZONE_H 1
@ -176,7 +176,7 @@ dns_zone_getview(dns_zone_t *zone);
*/
isc_result_t
dns_zone_setorigin(dns_zone_t *zone, dns_name_t *origin);
dns_zone_setorigin(dns_zone_t *zone, const dns_name_t *origin);
/*%<
* Sets the zones origin to 'origin'.
*
@ -465,11 +465,13 @@ dns_zone_maintenance(dns_zone_t *zone);
*/
isc_result_t
dns_zone_setmasters(dns_zone_t *zone, isc_sockaddr_t *masters,
dns_zone_setmasters(dns_zone_t *zone, const isc_sockaddr_t *masters,
isc_uint32_t count);
isc_result_t
dns_zone_setmasterswithkeys(dns_zone_t *zone, isc_sockaddr_t *masters,
dns_name_t **keynames, isc_uint32_t count);
dns_zone_setmasterswithkeys(dns_zone_t *zone,
const isc_sockaddr_t *masters,
dns_name_t **keynames,
isc_uint32_t count);
/*%<
* Set the list of master servers for the zone.
*
@ -491,7 +493,7 @@ dns_zone_setmasterswithkeys(dns_zone_t *zone, isc_sockaddr_t *masters,
*/
isc_result_t
dns_zone_setalsonotify(dns_zone_t *zone, isc_sockaddr_t *notify,
dns_zone_setalsonotify(dns_zone_t *zone, const isc_sockaddr_t *notify,
isc_uint32_t count);
/*%<
* Set the list of additional servers to be notified when
@ -576,9 +578,10 @@ dns_zone_setmaxretrytime(dns_zone_t *zone, isc_uint32_t val);
*/
isc_result_t
dns_zone_setxfrsource4(dns_zone_t *zone, isc_sockaddr_t *xfrsource);
dns_zone_setxfrsource4(dns_zone_t *zone, const isc_sockaddr_t *xfrsource);
isc_result_t
dns_zone_setaltxfrsource4(dns_zone_t *zone, isc_sockaddr_t *xfrsource);
dns_zone_setaltxfrsource4(dns_zone_t *zone,
const isc_sockaddr_t *xfrsource);
/*%<
* Set the source address to be used in IPv4 zone transfers.
*
@ -603,9 +606,10 @@ dns_zone_getaltxfrsource4(dns_zone_t *zone);
*/
isc_result_t
dns_zone_setxfrsource6(dns_zone_t *zone, isc_sockaddr_t *xfrsource);
dns_zone_setxfrsource6(dns_zone_t *zone, const isc_sockaddr_t *xfrsource);
isc_result_t
dns_zone_setaltxfrsource6(dns_zone_t *zone, isc_sockaddr_t *xfrsource);
dns_zone_setaltxfrsource6(dns_zone_t *zone,
const isc_sockaddr_t *xfrsource);
/*%<
* Set the source address to be used in IPv6 zone transfers.
*
@ -630,7 +634,7 @@ dns_zone_getaltxfrsource6(dns_zone_t *zone);
*/
isc_result_t
dns_zone_setnotifysrc4(dns_zone_t *zone, isc_sockaddr_t *notifysrc);
dns_zone_setnotifysrc4(dns_zone_t *zone, const isc_sockaddr_t *notifysrc);
/*%<
* Set the source address to be used with IPv4 NOTIFY messages.
*
@ -653,7 +657,7 @@ dns_zone_getnotifysrc4(dns_zone_t *zone);
*/
isc_result_t
dns_zone_setnotifysrc6(dns_zone_t *zone, isc_sockaddr_t *notifysrc);
dns_zone_setnotifysrc6(dns_zone_t *zone, const isc_sockaddr_t *notifysrc);
/*%<
* Set the source address to be used with IPv6 NOTIFY messages.
*

View file

@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
/* $Id: message.c,v 1.230 2006/01/06 00:01:44 marka Exp $ */
/* $Id: message.c,v 1.231 2006/02/28 02:39:51 marka Exp $ */
/*! \file */
@ -1825,7 +1825,7 @@ dns_message_rendersection(dns_message_t *msg, dns_section_t sectionid,
if (rdataset != NULL &&
(rdataset->attributes & DNS_RDATASETATTR_REQUIREDGLUE) != 0 &&
(rdataset->attributes & DNS_RDATASETATTR_RENDERED) == 0) {
void *order_arg = msg->order_arg;
const void *order_arg = msg->order_arg;
st = *(msg->buffer);
count = 0;
if (partial)
@ -3213,7 +3213,7 @@ dns_message_getrawmessage(dns_message_t *msg) {
void
dns_message_setsortorder(dns_message_t *msg, dns_rdatasetorderfunc_t order,
void *order_arg)
const void *order_arg)
{
REQUIRE(DNS_MESSAGE_VALID(msg));
msg->order = order;

View file

@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
/* $Id: name.c,v 1.158 2006/01/10 23:50:42 marka Exp $ */
/* $Id: name.c,v 1.159 2006/02/28 02:39:51 marka Exp $ */
/*! \file */
@ -938,7 +938,7 @@ dns_name_getlabelsequence(const dns_name_t *source,
}
void
dns_name_clone(dns_name_t *source, dns_name_t *target) {
dns_name_clone(const dns_name_t *source, dns_name_t *target) {
/*
* Make 'target' refer to the same name as 'source'.
@ -1897,7 +1897,9 @@ dns_name_fromwire(dns_name_t *name, isc_buffer_t *source,
}
isc_result_t
dns_name_towire(dns_name_t *name, dns_compress_t *cctx, isc_buffer_t *target) {
dns_name_towire(const dns_name_t *name, dns_compress_t *cctx,
isc_buffer_t *target)
{
unsigned int methods;
isc_uint16_t offset;
dns_name_t gp; /* Global compression prefix */
@ -2111,7 +2113,9 @@ dns_name_split(dns_name_t *name, unsigned int suffixlabels,
}
isc_result_t
dns_name_dup(dns_name_t *source, isc_mem_t *mctx, dns_name_t *target) {
dns_name_dup(const dns_name_t *source, isc_mem_t *mctx,
dns_name_t *target)
{
/*
* Make 'target' a dynamically allocated copy of 'source'.
*/

View file

@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
/* $Id: peer.c,v 1.26 2006/02/17 00:24:21 marka Exp $ */
/* $Id: peer.c,v 1.27 2006/02/28 02:39:51 marka Exp $ */
/*! \file */
@ -532,7 +532,9 @@ dns_peer_setkeybycharp(dns_peer_t *peer, const char *keyval) {
}
isc_result_t
dns_peer_settransfersource(dns_peer_t *peer, isc_sockaddr_t *transfer_source) {
dns_peer_settransfersource(dns_peer_t *peer,
const isc_sockaddr_t *transfer_source)
{
REQUIRE(DNS_PEER_VALID(peer));
if (peer->transfer_source != NULL) {
@ -563,7 +565,9 @@ dns_peer_gettransfersource(dns_peer_t *peer, isc_sockaddr_t *transfer_source) {
}
isc_result_t
dns_peer_setnotifysource(dns_peer_t *peer, isc_sockaddr_t *notify_source) {
dns_peer_setnotifysource(dns_peer_t *peer,
const isc_sockaddr_t *notify_source)
{
REQUIRE(DNS_PEER_VALID(peer));
if (peer->notify_source != NULL) {
@ -594,7 +598,7 @@ dns_peer_getnotifysource(dns_peer_t *peer, isc_sockaddr_t *notify_source) {
}
isc_result_t
dns_peer_setquerysource(dns_peer_t *peer, isc_sockaddr_t *query_source) {
dns_peer_setquerysource(dns_peer_t *peer, const isc_sockaddr_t *query_source) {
REQUIRE(DNS_PEER_VALID(peer));
if (peer->query_source != NULL) {

View file

@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
/* $Id: rdataset.c,v 1.75 2005/04/29 00:22:51 marka Exp $ */
/* $Id: rdataset.c,v 1.76 2006/02/28 02:39:51 marka Exp $ */
/*! \file */
@ -285,9 +285,9 @@ towire_compare(const void *av, const void *bv) {
}
static isc_result_t
towiresorted(dns_rdataset_t *rdataset, dns_name_t *owner_name,
towiresorted(dns_rdataset_t *rdataset, const dns_name_t *owner_name,
dns_compress_t *cctx, isc_buffer_t *target,
dns_rdatasetorderfunc_t order, void *order_arg,
dns_rdatasetorderfunc_t order, const void *order_arg,
isc_boolean_t partial, unsigned int options,
unsigned int *countp, void **state)
{
@ -533,11 +533,11 @@ towiresorted(dns_rdataset_t *rdataset, dns_name_t *owner_name,
isc_result_t
dns_rdataset_towiresorted(dns_rdataset_t *rdataset,
dns_name_t *owner_name,
const dns_name_t *owner_name,
dns_compress_t *cctx,
isc_buffer_t *target,
dns_rdatasetorderfunc_t order,
void *order_arg,
const void *order_arg,
unsigned int options,
unsigned int *countp)
{
@ -548,11 +548,11 @@ dns_rdataset_towiresorted(dns_rdataset_t *rdataset,
isc_result_t
dns_rdataset_towirepartial(dns_rdataset_t *rdataset,
dns_name_t *owner_name,
const dns_name_t *owner_name,
dns_compress_t *cctx,
isc_buffer_t *target,
dns_rdatasetorderfunc_t order,
void *order_arg,
const void *order_arg,
unsigned int options,
unsigned int *countp,
void **state)

View file

@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
/* $Id: zone.c,v 1.452 2006/02/21 23:12:27 marka Exp $ */
/* $Id: zone.c,v 1.453 2006/02/28 02:39:51 marka Exp $ */
/*! \file */
@ -900,7 +900,7 @@ dns_zone_getview(dns_zone_t *zone) {
isc_result_t
dns_zone_setorigin(dns_zone_t *zone, dns_name_t *origin) {
dns_zone_setorigin(dns_zone_t *zone, const dns_name_t *origin) {
isc_result_t result;
REQUIRE(DNS_ZONE_VALID(zone));
@ -2470,7 +2470,7 @@ dns_zone_getoptions(dns_zone_t *zone) {
}
isc_result_t
dns_zone_setxfrsource4(dns_zone_t *zone, isc_sockaddr_t *xfrsource) {
dns_zone_setxfrsource4(dns_zone_t *zone, const isc_sockaddr_t *xfrsource) {
REQUIRE(DNS_ZONE_VALID(zone));
LOCK_ZONE(zone);
@ -2487,7 +2487,7 @@ dns_zone_getxfrsource4(dns_zone_t *zone) {
}
isc_result_t
dns_zone_setxfrsource6(dns_zone_t *zone, isc_sockaddr_t *xfrsource) {
dns_zone_setxfrsource6(dns_zone_t *zone, const isc_sockaddr_t *xfrsource) {
REQUIRE(DNS_ZONE_VALID(zone));
LOCK_ZONE(zone);
@ -2504,7 +2504,9 @@ dns_zone_getxfrsource6(dns_zone_t *zone) {
}
isc_result_t
dns_zone_setaltxfrsource4(dns_zone_t *zone, isc_sockaddr_t *altxfrsource) {
dns_zone_setaltxfrsource4(dns_zone_t *zone,
const isc_sockaddr_t *altxfrsource)
{
REQUIRE(DNS_ZONE_VALID(zone));
LOCK_ZONE(zone);
@ -2521,7 +2523,9 @@ dns_zone_getaltxfrsource4(dns_zone_t *zone) {
}
isc_result_t
dns_zone_setaltxfrsource6(dns_zone_t *zone, isc_sockaddr_t *altxfrsource) {
dns_zone_setaltxfrsource6(dns_zone_t *zone,
const isc_sockaddr_t *altxfrsource)
{
REQUIRE(DNS_ZONE_VALID(zone));
LOCK_ZONE(zone);
@ -2538,7 +2542,7 @@ dns_zone_getaltxfrsource6(dns_zone_t *zone) {
}
isc_result_t
dns_zone_setnotifysrc4(dns_zone_t *zone, isc_sockaddr_t *notifysrc) {
dns_zone_setnotifysrc4(dns_zone_t *zone, const isc_sockaddr_t *notifysrc) {
REQUIRE(DNS_ZONE_VALID(zone));
LOCK_ZONE(zone);
@ -2555,7 +2559,7 @@ dns_zone_getnotifysrc4(dns_zone_t *zone) {
}
isc_result_t
dns_zone_setnotifysrc6(dns_zone_t *zone, isc_sockaddr_t *notifysrc) {
dns_zone_setnotifysrc6(dns_zone_t *zone, const isc_sockaddr_t *notifysrc) {
REQUIRE(DNS_ZONE_VALID(zone));
LOCK_ZONE(zone);
@ -2572,7 +2576,7 @@ dns_zone_getnotifysrc6(dns_zone_t *zone) {
}
isc_result_t
dns_zone_setalsonotify(dns_zone_t *zone, isc_sockaddr_t *notify,
dns_zone_setalsonotify(dns_zone_t *zone, const isc_sockaddr_t *notify,
isc_uint32_t count)
{
isc_sockaddr_t *new;
@ -2602,7 +2606,7 @@ dns_zone_setalsonotify(dns_zone_t *zone, isc_sockaddr_t *notify,
}
isc_result_t
dns_zone_setmasters(dns_zone_t *zone, isc_sockaddr_t *masters,
dns_zone_setmasters(dns_zone_t *zone, const isc_sockaddr_t *masters,
isc_uint32_t count)
{
isc_result_t result;
@ -2612,8 +2616,10 @@ dns_zone_setmasters(dns_zone_t *zone, isc_sockaddr_t *masters,
}
isc_result_t
dns_zone_setmasterswithkeys(dns_zone_t *zone, isc_sockaddr_t *masters,
dns_name_t **keynames, isc_uint32_t count)
dns_zone_setmasterswithkeys(dns_zone_t *zone,
const isc_sockaddr_t *masters,
dns_name_t **keynames,
isc_uint32_t count)
{
isc_sockaddr_t *new;
isc_result_t result = ISC_R_SUCCESS;

View file

@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
/* $Id: sockaddr.h,v 1.49 2005/07/28 04:54:17 marka Exp $ */
/* $Id: sockaddr.h,v 1.50 2006/02/28 02:39:52 marka Exp $ */
#ifndef ISC_SOCKADDR_H
#define ISC_SOCKADDR_H 1
@ -168,7 +168,7 @@ isc_sockaddr_setport(isc_sockaddr_t *sockaddr, in_port_t port);
*/
in_port_t
isc_sockaddr_getport(isc_sockaddr_t *sockaddr);
isc_sockaddr_getport(const isc_sockaddr_t *sockaddr);
/*%<
* Get the port stored in 'sockaddr'.
*/
@ -195,25 +195,25 @@ isc_sockaddr_format(const isc_sockaddr_t *sa, char *array, unsigned int size);
*/
isc_boolean_t
isc_sockaddr_ismulticast(isc_sockaddr_t *sa);
isc_sockaddr_ismulticast(const isc_sockaddr_t *sa);
/*%<
* Returns #ISC_TRUE if the address is a multicast address.
*/
isc_boolean_t
isc_sockaddr_isexperimental(isc_sockaddr_t *sa);
isc_sockaddr_isexperimental(const isc_sockaddr_t *sa);
/*
* Returns ISC_TRUE if the address is a experimental (CLASS E) address.
*/
isc_boolean_t
isc_sockaddr_islinklocal(isc_sockaddr_t *sa);
isc_sockaddr_islinklocal(const isc_sockaddr_t *sa);
/*%<
* Returns ISC_TRUE if the address is a link local addresss.
*/
isc_boolean_t
isc_sockaddr_issitelocal(isc_sockaddr_t *sa);
isc_sockaddr_issitelocal(const isc_sockaddr_t *sa);
/*%<
* Returns ISC_TRUE if the address is a sitelocal address.
*/

View file

@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
/* $Id: symtab.h,v 1.19 2005/04/29 00:23:45 marka Exp $ */
/* $Id: symtab.h,v 1.20 2006/02/28 02:39:52 marka Exp $ */
#ifndef ISC_SYMTAB_H
#define ISC_SYMTAB_H 1
@ -86,6 +86,7 @@
/*% Symbol table value. */
typedef union isc_symvalue {
void * as_pointer;
const void * as_cpointer;
int as_integer;
unsigned int as_uinteger;
} isc_symvalue_t;

View file

@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
/* $Id: sockaddr.c,v 1.65 2005/04/27 04:57:15 sra Exp $ */
/* $Id: sockaddr.c,v 1.66 2006/02/28 02:39:52 marka Exp $ */
/*! \file */
@ -415,7 +415,7 @@ isc_sockaddr_setport(isc_sockaddr_t *sockaddr, in_port_t port) {
}
in_port_t
isc_sockaddr_getport(isc_sockaddr_t *sockaddr) {
isc_sockaddr_getport(const isc_sockaddr_t *sockaddr) {
in_port_t port = 0;
switch (sockaddr->type.sa.sa_family) {
@ -437,7 +437,7 @@ isc_sockaddr_getport(isc_sockaddr_t *sockaddr) {
}
isc_boolean_t
isc_sockaddr_ismulticast(isc_sockaddr_t *sockaddr) {
isc_sockaddr_ismulticast(const isc_sockaddr_t *sockaddr) {
isc_netaddr_t netaddr;
if (sockaddr->type.sa.sa_family == AF_INET ||
@ -449,7 +449,7 @@ isc_sockaddr_ismulticast(isc_sockaddr_t *sockaddr) {
}
isc_boolean_t
isc_sockaddr_isexperimental(isc_sockaddr_t *sockaddr) {
isc_sockaddr_isexperimental(const isc_sockaddr_t *sockaddr) {
isc_netaddr_t netaddr;
if (sockaddr->type.sa.sa_family == AF_INET) {
@ -460,7 +460,7 @@ isc_sockaddr_isexperimental(isc_sockaddr_t *sockaddr) {
}
isc_boolean_t
isc_sockaddr_issitelocal(isc_sockaddr_t *sockaddr) {
isc_sockaddr_issitelocal(const isc_sockaddr_t *sockaddr) {
isc_netaddr_t netaddr;
if (sockaddr->type.sa.sa_family == AF_INET6) {
@ -471,7 +471,7 @@ isc_sockaddr_issitelocal(isc_sockaddr_t *sockaddr) {
}
isc_boolean_t
isc_sockaddr_islinklocal(isc_sockaddr_t *sockaddr) {
isc_sockaddr_islinklocal(const isc_sockaddr_t *sockaddr) {
isc_netaddr_t netaddr;
if (sockaddr->type.sa.sa_family == AF_INET6) {

View file

@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
/* $Id: aclconf.c,v 1.5 2005/08/23 02:36:10 marka Exp $ */
/* $Id: aclconf.c,v 1.6 2006/02/28 02:39:52 marka Exp $ */
#include <config.h>
@ -53,10 +53,10 @@ cfg_aclconfctx_destroy(cfg_aclconfctx_t *ctx) {
* Find the definition of the named acl whose name is "name".
*/
static isc_result_t
get_acl_def(cfg_obj_t *cctx, const char *name, cfg_obj_t **ret) {
get_acl_def(const cfg_obj_t *cctx, const char *name, const cfg_obj_t **ret) {
isc_result_t result;
cfg_obj_t *acls = NULL;
cfg_listelt_t *elt;
const cfg_obj_t *acls = NULL;
const cfg_listelt_t *elt;
result = cfg_map_get(cctx, "acl", &acls);
if (result != ISC_R_SUCCESS)
@ -64,7 +64,7 @@ get_acl_def(cfg_obj_t *cctx, const char *name, cfg_obj_t **ret) {
for (elt = cfg_list_first(acls);
elt != NULL;
elt = cfg_list_next(elt)) {
cfg_obj_t *acl = cfg_listelt_value(elt);
const cfg_obj_t *acl = cfg_listelt_value(elt);
const char *aclname = cfg_obj_asstring(cfg_tuple_get(acl, "name"));
if (strcasecmp(aclname, name) == 0) {
*ret = cfg_tuple_get(acl, "value");
@ -75,12 +75,12 @@ get_acl_def(cfg_obj_t *cctx, const char *name, cfg_obj_t **ret) {
}
static isc_result_t
convert_named_acl(cfg_obj_t *nameobj, cfg_obj_t *cctx,
convert_named_acl(const cfg_obj_t *nameobj, const cfg_obj_t *cctx,
isc_log_t *lctx, cfg_aclconfctx_t *ctx,
isc_mem_t *mctx, dns_acl_t **target)
{
isc_result_t result;
cfg_obj_t *cacl = NULL;
const cfg_obj_t *cacl = NULL;
dns_acl_t *dacl;
dns_acl_t loop;
const char *aclname = cfg_obj_asstring(nameobj);
@ -130,7 +130,7 @@ convert_named_acl(cfg_obj_t *nameobj, cfg_obj_t *cctx,
}
static isc_result_t
convert_keyname(cfg_obj_t *keyobj, isc_log_t *lctx, isc_mem_t *mctx,
convert_keyname(const cfg_obj_t *keyobj, isc_log_t *lctx, isc_mem_t *mctx,
dns_name_t *dnsname)
{
isc_result_t result;
@ -155,8 +155,8 @@ convert_keyname(cfg_obj_t *keyobj, isc_log_t *lctx, isc_mem_t *mctx,
}
isc_result_t
cfg_acl_fromconfig(cfg_obj_t *caml,
cfg_obj_t *cctx,
cfg_acl_fromconfig(const cfg_obj_t *caml,
const cfg_obj_t *cctx,
isc_log_t *lctx,
cfg_aclconfctx_t *ctx,
isc_mem_t *mctx,
@ -166,7 +166,7 @@ cfg_acl_fromconfig(cfg_obj_t *caml,
unsigned int count;
dns_acl_t *dacl = NULL;
dns_aclelement_t *de;
cfg_listelt_t *elt;
const cfg_listelt_t *elt;
REQUIRE(target != NULL && *target == NULL);
@ -185,7 +185,7 @@ cfg_acl_fromconfig(cfg_obj_t *caml,
elt != NULL;
elt = cfg_list_next(elt))
{
cfg_obj_t *ce = cfg_listelt_value(elt);
const cfg_obj_t *ce = cfg_listelt_value(elt);
if (cfg_obj_istuple(ce)) {
/* This must be a negated element. */
ce = cfg_tuple_get(ce, "value");

View file

@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
/* $Id: aclconf.h,v 1.4 2005/01/13 05:15:16 marka Exp $ */
/* $Id: aclconf.h,v 1.5 2006/02/28 02:39:52 marka Exp $ */
#ifndef ISCCFG_ACLCONF_H
#define ISCCFG_ACLCONF_H 1
@ -49,8 +49,8 @@ cfg_aclconfctx_destroy(cfg_aclconfctx_t *ctx);
*/
isc_result_t
cfg_acl_fromconfig(cfg_obj_t *caml,
cfg_obj_t *cctx,
cfg_acl_fromconfig(const cfg_obj_t *caml,
const cfg_obj_t *cctx,
isc_log_t *lctx,
cfg_aclconfctx_t *ctx,
isc_mem_t *mctx,

View file

@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
/* $Id: cfg.h,v 1.37 2005/08/23 02:36:11 marka Exp $ */
/* $Id: cfg.h,v 1.38 2006/02/28 02:39:52 marka Exp $ */
#ifndef ISCCFG_CFG_H
#define ISCCFG_CFG_H 1
@ -75,7 +75,7 @@ typedef struct cfg_listelt cfg_listelt_t;
* "directory".
*/
typedef isc_result_t
(*cfg_parsecallback_t)(const char *clausename, cfg_obj_t *obj, void *arg);
(*cfg_parsecallback_t)(const char *clausename, const cfg_obj_t *obj, void *arg);
/***
*** Functions
@ -144,20 +144,20 @@ cfg_parser_destroy(cfg_parser_t **pctxp);
*/
isc_boolean_t
cfg_obj_isvoid(cfg_obj_t *obj);
cfg_obj_isvoid(const cfg_obj_t *obj);
/*%<
* Return true iff 'obj' is of void type (e.g., an optional
* value not specified).
*/
isc_boolean_t
cfg_obj_ismap(cfg_obj_t *obj);
cfg_obj_ismap(const cfg_obj_t *obj);
/*%<
* Return true iff 'obj' is of a map type.
*/
isc_result_t
cfg_map_get(cfg_obj_t *mapobj, const char* name, cfg_obj_t **obj);
cfg_map_get(const cfg_obj_t *mapobj, const char* name, const cfg_obj_t **obj);
/*%<
* Extract an element from a configuration object, which
* must be of a map type.
@ -172,8 +172,8 @@ cfg_map_get(cfg_obj_t *mapobj, const char* name, cfg_obj_t **obj);
* \li #ISC_R_NOTFOUND - name not found in map
*/
cfg_obj_t *
cfg_map_getname(cfg_obj_t *mapobj);
const cfg_obj_t *
cfg_map_getname(const cfg_obj_t *mapobj);
/*%<
* Get the name of a named map object, like a server "key" clause.
*
@ -186,13 +186,13 @@ cfg_map_getname(cfg_obj_t *mapobj);
*/
isc_boolean_t
cfg_obj_istuple(cfg_obj_t *obj);
cfg_obj_istuple(const cfg_obj_t *obj);
/*%<
* Return true iff 'obj' is of a map type.
*/
cfg_obj_t *
cfg_tuple_get(cfg_obj_t *tupleobj, const char *name);
const cfg_obj_t *
cfg_tuple_get(const cfg_obj_t *tupleobj, const char *name);
/*%<
* Extract an element from a configuration object, which
* must be of a tuple type.
@ -204,13 +204,13 @@ cfg_tuple_get(cfg_obj_t *tupleobj, const char *name);
*/
isc_boolean_t
cfg_obj_isuint32(cfg_obj_t *obj);
cfg_obj_isuint32(const cfg_obj_t *obj);
/*%<
* Return true iff 'obj' is of integer type.
*/
isc_uint32_t
cfg_obj_asuint32(cfg_obj_t *obj);
cfg_obj_asuint32(const cfg_obj_t *obj);
/*%<
* Returns the value of a configuration object of 32-bit integer type.
*
@ -222,13 +222,13 @@ cfg_obj_asuint32(cfg_obj_t *obj);
*/
isc_boolean_t
cfg_obj_isuint64(cfg_obj_t *obj);
cfg_obj_isuint64(const cfg_obj_t *obj);
/*%<
* Return true iff 'obj' is of integer type.
*/
isc_uint64_t
cfg_obj_asuint64(cfg_obj_t *obj);
cfg_obj_asuint64(const cfg_obj_t *obj);
/*%<
* Returns the value of a configuration object of 64-bit integer type.
*
@ -240,13 +240,13 @@ cfg_obj_asuint64(cfg_obj_t *obj);
*/
isc_boolean_t
cfg_obj_isstring(cfg_obj_t *obj);
cfg_obj_isstring(const cfg_obj_t *obj);
/*%<
* Return true iff 'obj' is of string type.
*/
const char *
cfg_obj_asstring(cfg_obj_t *obj);
cfg_obj_asstring(const cfg_obj_t *obj);
/*%<
* Returns the value of a configuration object of a string type
* as a null-terminated string.
@ -259,13 +259,13 @@ cfg_obj_asstring(cfg_obj_t *obj);
*/
isc_boolean_t
cfg_obj_isboolean(cfg_obj_t *obj);
cfg_obj_isboolean(const cfg_obj_t *obj);
/*%<
* Return true iff 'obj' is of a boolean type.
*/
isc_boolean_t
cfg_obj_asboolean(cfg_obj_t *obj);
cfg_obj_asboolean(const cfg_obj_t *obj);
/*%<
* Returns the value of a configuration object of a boolean type.
*
@ -277,13 +277,13 @@ cfg_obj_asboolean(cfg_obj_t *obj);
*/
isc_boolean_t
cfg_obj_issockaddr(cfg_obj_t *obj);
cfg_obj_issockaddr(const cfg_obj_t *obj);
/*%<
* Return true iff 'obj' is a socket address.
*/
isc_sockaddr_t *
cfg_obj_assockaddr(cfg_obj_t *obj);
const isc_sockaddr_t *
cfg_obj_assockaddr(const cfg_obj_t *obj);
/*%<
* Returns the value of a configuration object representing a socket address.
*
@ -296,13 +296,13 @@ cfg_obj_assockaddr(cfg_obj_t *obj);
*/
isc_boolean_t
cfg_obj_isnetprefix(cfg_obj_t *obj);
cfg_obj_isnetprefix(const cfg_obj_t *obj);
/*%<
* Return true iff 'obj' is a network prefix.
*/
void
cfg_obj_asnetprefix(cfg_obj_t *obj, isc_netaddr_t *netaddr,
cfg_obj_asnetprefix(const cfg_obj_t *obj, isc_netaddr_t *netaddr,
unsigned int *prefixlen);
/*%<
* Gets the value of a configuration object representing a network
@ -315,13 +315,13 @@ cfg_obj_asnetprefix(cfg_obj_t *obj, isc_netaddr_t *netaddr,
*/
isc_boolean_t
cfg_obj_islist(cfg_obj_t *obj);
cfg_obj_islist(const cfg_obj_t *obj);
/*%<
* Return true iff 'obj' is of list type.
*/
cfg_listelt_t *
cfg_list_first(cfg_obj_t *obj);
const cfg_listelt_t *
cfg_list_first(const cfg_obj_t *obj);
/*%<
* Returns the first list element in a configuration object of a list type.
*
@ -333,8 +333,8 @@ cfg_list_first(cfg_obj_t *obj);
* or NULL if the list is empty or nonexistent.
*/
cfg_listelt_t *
cfg_list_next(cfg_listelt_t *elt);
const cfg_listelt_t *
cfg_list_next(const cfg_listelt_t *elt);
/*%<
* Returns the next element of a list of configuration objects.
*
@ -347,8 +347,8 @@ cfg_list_next(cfg_listelt_t *elt);
* or NULL if there are no more elements.
*/
cfg_obj_t *
cfg_listelt_value(cfg_listelt_t *elt);
const cfg_obj_t *
cfg_listelt_value(const cfg_listelt_t *elt);
/*%<
* Returns the configuration object associated with cfg_listelt_t.
*
@ -361,7 +361,7 @@ cfg_listelt_value(cfg_listelt_t *elt);
*/
void
cfg_print(cfg_obj_t *obj,
cfg_print(const cfg_obj_t *obj,
void (*f)(void *closure, const char *text, int textlen),
void *closure);
/*%<
@ -379,7 +379,7 @@ cfg_print_grammar(const cfg_type_t *type,
*/
isc_boolean_t
cfg_obj_istype(cfg_obj_t *obj, const cfg_type_t *type);
cfg_obj_istype(const cfg_obj_t *obj, const cfg_type_t *type);
/*%<
* Return true iff 'obj' is of type 'type'.
*/
@ -390,7 +390,8 @@ void cfg_obj_destroy(cfg_parser_t *pctx, cfg_obj_t **obj);
*/
void
cfg_obj_log(cfg_obj_t *obj, isc_log_t *lctx, int level, const char *fmt, ...)
cfg_obj_log(const cfg_obj_t *obj, isc_log_t *lctx, int level,
const char *fmt, ...)
ISC_FORMAT_PRINTF(4, 5);
/*%<
* Log a message concerning configuration object 'obj' to the logging
@ -399,13 +400,13 @@ cfg_obj_log(cfg_obj_t *obj, isc_log_t *lctx, int level, const char *fmt, ...)
*/
const char *
cfg_obj_file(cfg_obj_t *obj);
cfg_obj_file(const cfg_obj_t *obj);
/*%<
* Return the file that defined this object.
*/
unsigned int
cfg_obj_line(cfg_obj_t *obj);
cfg_obj_line(const cfg_obj_t *obj);
/*%<
* Return the line in file where this object was defined.
*/

View file

@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
/* $Id: grammar.h,v 1.11 2006/02/19 06:50:48 marka Exp $ */
/* $Id: grammar.h,v 1.12 2006/02/28 02:39:52 marka Exp $ */
#ifndef ISCCFG_GRAMMAR_H
#define ISCCFG_GRAMMAR_H 1
@ -65,7 +65,7 @@ typedef struct cfg_rep cfg_rep_t;
typedef isc_result_t (*cfg_parsefunc_t)(cfg_parser_t *, const cfg_type_t *type,
cfg_obj_t **);
typedef void (*cfg_printfunc_t)(cfg_printer_t *, cfg_obj_t *);
typedef void (*cfg_printfunc_t)(cfg_printer_t *, const cfg_obj_t *);
typedef void (*cfg_docfunc_t)(cfg_printer_t *, const cfg_type_t *);
typedef void (*cfg_freefunc_t)(cfg_parser_t *, cfg_obj_t *);
@ -155,7 +155,7 @@ struct cfg_obj {
isc_sockaddr_t sockaddr;
cfg_netprefix_t netprefix;
} value;
char * file;
const char * file;
unsigned int line;
};
@ -283,16 +283,16 @@ isc_result_t
cfg_parse_uint32(cfg_parser_t *pctx, const cfg_type_t *type, cfg_obj_t **ret);
void
cfg_print_uint32(cfg_printer_t *pctx, cfg_obj_t *obj);
cfg_print_uint32(cfg_printer_t *pctx, const cfg_obj_t *obj);
void
cfg_print_uint64(cfg_printer_t *pctx, cfg_obj_t *obj);
cfg_print_uint64(cfg_printer_t *pctx, const cfg_obj_t *obj);
isc_result_t
cfg_parse_qstring(cfg_parser_t *pctx, const cfg_type_t *type, cfg_obj_t **ret);
void
cfg_print_ustring(cfg_printer_t *pctx, cfg_obj_t *obj);
cfg_print_ustring(cfg_printer_t *pctx, const cfg_obj_t *obj);
isc_result_t
cfg_parse_astring(cfg_parser_t *pctx, const cfg_type_t *type, cfg_obj_t **ret);
@ -301,7 +301,7 @@ isc_result_t
cfg_parse_rawaddr(cfg_parser_t *pctx, unsigned int flags, isc_netaddr_t *na);
void
cfg_print_rawaddr(cfg_printer_t *pctx, isc_netaddr_t *na);
cfg_print_rawaddr(cfg_printer_t *pctx, const isc_netaddr_t *na);
isc_boolean_t
cfg_lookingat_netaddr(cfg_parser_t *pctx, unsigned int flags);
@ -313,7 +313,7 @@ isc_result_t
cfg_parse_sockaddr(cfg_parser_t *pctx, const cfg_type_t *type, cfg_obj_t **ret);
void
cfg_print_sockaddr(cfg_printer_t *pctx, cfg_obj_t *obj);
cfg_print_sockaddr(cfg_printer_t *pctx, const cfg_obj_t *obj);
void
cfg_doc_sockaddr(cfg_printer_t *pctx, const cfg_type_t *type);
@ -332,7 +332,7 @@ isc_result_t
cfg_parse_tuple(cfg_parser_t *pctx, const cfg_type_t *type, cfg_obj_t **ret);
void
cfg_print_tuple(cfg_printer_t *pctx, cfg_obj_t *obj);
cfg_print_tuple(cfg_printer_t *pctx, const cfg_obj_t *obj);
void
cfg_doc_tuple(cfg_printer_t *pctx, const cfg_type_t *type);
@ -348,7 +348,7 @@ isc_result_t
cfg_parse_bracketed_list(cfg_parser_t *pctx, const cfg_type_t *type, cfg_obj_t **ret);
void
cfg_print_bracketed_list(cfg_printer_t *pctx, cfg_obj_t *obj);
cfg_print_bracketed_list(cfg_printer_t *pctx, const cfg_obj_t *obj);
void
cfg_doc_bracketed_list(cfg_printer_t *pctx, const cfg_type_t *type);
@ -357,7 +357,7 @@ isc_result_t
cfg_parse_spacelist(cfg_parser_t *pctx, const cfg_type_t *type, cfg_obj_t **ret);
void
cfg_print_spacelist(cfg_printer_t *pctx, cfg_obj_t *obj);
cfg_print_spacelist(cfg_printer_t *pctx, const cfg_obj_t *obj);
isc_result_t
cfg_parse_enum(cfg_parser_t *pctx, const cfg_type_t *type, cfg_obj_t **ret);
@ -387,7 +387,7 @@ cfg_parse_netprefix_map(cfg_parser_t *pctx, const cfg_type_t *type, cfg_obj_t **
ret);
void
cfg_print_map(cfg_printer_t *pctx, cfg_obj_t *obj);
cfg_print_map(cfg_printer_t *pctx, const cfg_obj_t *obj);
void
cfg_doc_map(cfg_printer_t *pctx, const cfg_type_t *type);
@ -396,7 +396,7 @@ isc_result_t
cfg_parse_mapbody(cfg_parser_t *pctx, const cfg_type_t *type, cfg_obj_t **ret);
void
cfg_print_mapbody(cfg_printer_t *pctx, cfg_obj_t *obj);
cfg_print_mapbody(cfg_printer_t *pctx, const cfg_obj_t *obj);
void
cfg_doc_mapbody(cfg_printer_t *pctx, const cfg_type_t *type);
@ -405,7 +405,7 @@ isc_result_t
cfg_parse_void(cfg_parser_t *pctx, const cfg_type_t *type, cfg_obj_t **ret);
void
cfg_print_void(cfg_printer_t *pctx, cfg_obj_t *obj);
cfg_print_void(cfg_printer_t *pctx, const cfg_obj_t *obj);
void
cfg_doc_void(cfg_printer_t *pctx, const cfg_type_t *type);
@ -414,7 +414,7 @@ isc_result_t
cfg_parse_obj(cfg_parser_t *pctx, const cfg_type_t *type, cfg_obj_t **ret);
void
cfg_print_obj(cfg_printer_t *pctx, cfg_obj_t *obj);
cfg_print_obj(cfg_printer_t *pctx, const cfg_obj_t *obj);
void
cfg_doc_obj(cfg_printer_t *pctx, const cfg_type_t *type);

View file

@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
/* $Id: namedconf.c,v 1.65 2006/02/17 00:24:21 marka Exp $ */
/* $Id: namedconf.c,v 1.66 2006/02/28 02:39:52 marka Exp $ */
/*! \file */
@ -60,7 +60,7 @@ static isc_result_t
parse_optional_keyvalue(cfg_parser_t *pctx, const cfg_type_t *type, cfg_obj_t **ret);
static void
print_keyvalue(cfg_printer_t *pctx, cfg_obj_t *obj);
print_keyvalue(cfg_printer_t *pctx, const cfg_obj_t *obj);
static void
doc_keyvalue(cfg_printer_t *pctx, const cfg_type_t *type);
@ -459,7 +459,7 @@ static cfg_type_t cfg_type_transferformat = {
*/
static void
print_none(cfg_printer_t *pctx, cfg_obj_t *obj) {
print_none(cfg_printer_t *pctx, const cfg_obj_t *obj) {
UNUSED(obj);
cfg_print_chars(pctx, "none", 4);
}
@ -500,7 +500,7 @@ static cfg_type_t cfg_type_qstringornone = {
*/
static void
print_hostname(cfg_printer_t *pctx, cfg_obj_t *obj) {
print_hostname(cfg_printer_t *pctx, const cfg_obj_t *obj) {
UNUSED(obj);
cfg_print_chars(pctx, "hostname", 4);
}
@ -1213,7 +1213,7 @@ parse_optional_keyvalue(cfg_parser_t *pctx, const cfg_type_t *type, cfg_obj_t **
}
static void
print_keyvalue(cfg_printer_t *pctx, cfg_obj_t *obj) {
print_keyvalue(cfg_printer_t *pctx, const cfg_obj_t *obj) {
const keyword_type_t *kw = obj->type->of;
cfg_print_cstr(pctx, kw->name);
cfg_print_chars(pctx, " ", 1);
@ -1460,7 +1460,7 @@ parse_querysource(cfg_parser_t *pctx, const cfg_type_t *type, cfg_obj_t **ret) {
}
static void
print_querysource(cfg_printer_t *pctx, cfg_obj_t *obj) {
print_querysource(cfg_printer_t *pctx, const cfg_obj_t *obj) {
isc_netaddr_t na;
isc_netaddr_fromsockaddr(&na, &obj->value.sockaddr);
cfg_print_chars(pctx, "address ", 8);
@ -1541,7 +1541,7 @@ static cfg_tuplefielddef_t negated_fields[] = {
};
static void
print_negated(cfg_printer_t *pctx, cfg_obj_t *obj) {
print_negated(cfg_printer_t *pctx, const cfg_obj_t *obj) {
cfg_print_chars(pctx, "!", 1);
cfg_print_tuple(pctx, obj);
}
@ -1758,7 +1758,7 @@ parse_logfile(cfg_parser_t *pctx, const cfg_type_t *type, cfg_obj_t **ret) {
}
static void
print_logfile(cfg_printer_t *pctx, cfg_obj_t *obj) {
print_logfile(cfg_printer_t *pctx, const cfg_obj_t *obj) {
cfg_print_obj(pctx, obj->value.tuple[0]); /* file */
if (obj->value.tuple[1]->type->print != cfg_print_void) {
cfg_print_chars(pctx, " versions ", 10);

View file

@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
/* $Id: parser.c,v 1.122 2006/02/19 06:50:48 marka Exp $ */
/* $Id: parser.c,v 1.123 2006/02/28 02:39:52 marka Exp $ */
/*! \file */
@ -70,7 +70,7 @@ static isc_result_t
parse_list(cfg_parser_t *pctx, const cfg_type_t *type, cfg_obj_t **ret);
static void
print_list(cfg_printer_t *pctx, cfg_obj_t *obj);
print_list(cfg_printer_t *pctx, const cfg_obj_t *obj);
static void
free_list(cfg_parser_t *pctx, cfg_obj_t *obj);
@ -136,7 +136,7 @@ static cfg_type_t cfg_type_implicitlist = {
/* Functions. */
void
cfg_print_obj(cfg_printer_t *pctx, cfg_obj_t *obj) {
cfg_print_obj(cfg_printer_t *pctx, const cfg_obj_t *obj) {
obj->type->print(pctx, obj);
}
@ -179,7 +179,7 @@ cfg_parse_obj(cfg_parser_t *pctx, const cfg_type_t *type, cfg_obj_t **ret) {
}
void
cfg_print(cfg_obj_t *obj,
cfg_print(const cfg_obj_t *obj,
void (*f)(void *closure, const char *text, int textlen),
void *closure)
{
@ -245,14 +245,14 @@ cfg_parse_tuple(cfg_parser_t *pctx, const cfg_type_t *type, cfg_obj_t **ret)
}
void
cfg_print_tuple(cfg_printer_t *pctx, cfg_obj_t *obj) {
cfg_print_tuple(cfg_printer_t *pctx, const cfg_obj_t *obj) {
unsigned int i;
const cfg_tuplefielddef_t *fields = obj->type->of;
const cfg_tuplefielddef_t *f;
isc_boolean_t need_space = ISC_FALSE;
for (f = fields, i = 0; f->name != NULL; f++, i++) {
cfg_obj_t *fieldobj = obj->value.tuple[i];
const cfg_obj_t *fieldobj = obj->value.tuple[i];
if (need_space)
cfg_print_chars(pctx, " ", 1);
cfg_print_obj(pctx, fieldobj);
@ -293,13 +293,13 @@ free_tuple(cfg_parser_t *pctx, cfg_obj_t *obj) {
}
isc_boolean_t
cfg_obj_istuple(cfg_obj_t *obj) {
cfg_obj_istuple(const cfg_obj_t *obj) {
REQUIRE(obj != NULL);
return (ISC_TF(obj->type->rep == &cfg_rep_tuple));
}
cfg_obj_t *
cfg_tuple_get(cfg_obj_t *tupleobj, const char* name) {
const cfg_obj_t *
cfg_tuple_get(const cfg_obj_t *tupleobj, const char* name) {
unsigned int i;
const cfg_tuplefielddef_t *fields;
const cfg_tuplefielddef_t *f;
@ -550,7 +550,7 @@ cfg_parse_void(cfg_parser_t *pctx, const cfg_type_t *type, cfg_obj_t **ret) {
}
void
cfg_print_void(cfg_printer_t *pctx, cfg_obj_t *obj) {
cfg_print_void(cfg_printer_t *pctx, const cfg_obj_t *obj) {
UNUSED(pctx);
UNUSED(obj);
}
@ -562,7 +562,7 @@ cfg_doc_void(cfg_printer_t *pctx, const cfg_type_t *type) {
}
isc_boolean_t
cfg_obj_isvoid(cfg_obj_t *obj) {
cfg_obj_isvoid(const cfg_obj_t *obj) {
REQUIRE(obj != NULL);
return (ISC_TF(obj->type->rep == &cfg_rep_void));
}
@ -608,18 +608,18 @@ cfg_print_rawuint(cfg_printer_t *pctx, unsigned int u) {
}
void
cfg_print_uint32(cfg_printer_t *pctx, cfg_obj_t *obj) {
cfg_print_uint32(cfg_printer_t *pctx, const cfg_obj_t *obj) {
cfg_print_rawuint(pctx, obj->value.uint32);
}
isc_boolean_t
cfg_obj_isuint32(cfg_obj_t *obj) {
cfg_obj_isuint32(const cfg_obj_t *obj) {
REQUIRE(obj != NULL);
return (ISC_TF(obj->type->rep == &cfg_rep_uint32));
}
isc_uint32_t
cfg_obj_asuint32(cfg_obj_t *obj) {
cfg_obj_asuint32(const cfg_obj_t *obj) {
REQUIRE(obj != NULL && obj->type->rep == &cfg_rep_uint32);
return (obj->value.uint32);
}
@ -634,19 +634,19 @@ cfg_type_t cfg_type_uint32 = {
* uint64
*/
isc_boolean_t
cfg_obj_isuint64(cfg_obj_t *obj) {
cfg_obj_isuint64(const cfg_obj_t *obj) {
REQUIRE(obj != NULL);
return (ISC_TF(obj->type->rep == &cfg_rep_uint64));
}
isc_uint64_t
cfg_obj_asuint64(cfg_obj_t *obj) {
cfg_obj_asuint64(const cfg_obj_t *obj) {
REQUIRE(obj != NULL && obj->type->rep == &cfg_rep_uint64);
return (obj->value.uint64);
}
void
cfg_print_uint64(cfg_printer_t *pctx, cfg_obj_t *obj) {
cfg_print_uint64(cfg_printer_t *pctx, const cfg_obj_t *obj) {
char buf[32];
snprintf(buf, sizeof(buf), "%" ISC_PRINT_QUADFORMAT "u",
obj->value.uint64);
@ -725,7 +725,9 @@ parse_ustring(cfg_parser_t *pctx, const cfg_type_t *type, cfg_obj_t **ret) {
}
isc_result_t
cfg_parse_astring(cfg_parser_t *pctx, const cfg_type_t *type, cfg_obj_t **ret) {
cfg_parse_astring(cfg_parser_t *pctx, const cfg_type_t *type,
cfg_obj_t **ret)
{
isc_result_t result;
UNUSED(type);
@ -783,12 +785,12 @@ cfg_doc_enum(cfg_printer_t *pctx, const cfg_type_t *type) {
}
void
cfg_print_ustring(cfg_printer_t *pctx, cfg_obj_t *obj) {
cfg_print_ustring(cfg_printer_t *pctx, const cfg_obj_t *obj) {
cfg_print_chars(pctx, obj->value.string.base, obj->value.string.length);
}
static void
print_qstring(cfg_printer_t *pctx, cfg_obj_t *obj) {
print_qstring(cfg_printer_t *pctx, const cfg_obj_t *obj) {
cfg_print_chars(pctx, "\"", 1);
cfg_print_ustring(pctx, obj);
cfg_print_chars(pctx, "\"", 1);
@ -801,13 +803,13 @@ free_string(cfg_parser_t *pctx, cfg_obj_t *obj) {
}
isc_boolean_t
cfg_obj_isstring(cfg_obj_t *obj) {
cfg_obj_isstring(const cfg_obj_t *obj) {
REQUIRE(obj != NULL);
return (ISC_TF(obj->type->rep == &cfg_rep_string));
}
const char *
cfg_obj_asstring(cfg_obj_t *obj) {
cfg_obj_asstring(const cfg_obj_t *obj) {
REQUIRE(obj != NULL && obj->type->rep == &cfg_rep_string);
return (obj->value.string.base);
}
@ -835,13 +837,13 @@ cfg_type_t cfg_type_astring = {
*/
isc_boolean_t
cfg_obj_isboolean(cfg_obj_t *obj) {
cfg_obj_isboolean(const cfg_obj_t *obj) {
REQUIRE(obj != NULL);
return (ISC_TF(obj->type->rep == &cfg_rep_boolean));
}
isc_boolean_t
cfg_obj_asboolean(cfg_obj_t *obj) {
cfg_obj_asboolean(const cfg_obj_t *obj) {
REQUIRE(obj != NULL && obj->type->rep == &cfg_rep_boolean);
return (obj->value.boolean);
}
@ -887,7 +889,7 @@ parse_boolean(cfg_parser_t *pctx, const cfg_type_t *type, cfg_obj_t **ret)
}
static void
print_boolean(cfg_printer_t *pctx, cfg_obj_t *obj) {
print_boolean(cfg_printer_t *pctx, const cfg_obj_t *obj) {
if (obj->value.boolean)
cfg_print_chars(pctx, "yes", 3);
else
@ -1001,9 +1003,9 @@ parse_list(cfg_parser_t *pctx, const cfg_type_t *listtype, cfg_obj_t **ret)
}
static void
print_list(cfg_printer_t *pctx, cfg_obj_t *obj) {
cfg_list_t *list = &obj->value.list;
cfg_listelt_t *elt;
print_list(cfg_printer_t *pctx, const cfg_obj_t *obj) {
const cfg_list_t *list = &obj->value.list;
const cfg_listelt_t *elt;
for (elt = ISC_LIST_HEAD(*list);
elt != NULL;
@ -1027,7 +1029,7 @@ cfg_parse_bracketed_list(cfg_parser_t *pctx, const cfg_type_t *type,
}
void
cfg_print_bracketed_list(cfg_printer_t *pctx, cfg_obj_t *obj) {
cfg_print_bracketed_list(cfg_printer_t *pctx, const cfg_obj_t *obj) {
print_open(pctx);
print_list(pctx, obj);
print_close(pctx);
@ -1074,9 +1076,9 @@ cfg_parse_spacelist(cfg_parser_t *pctx, const cfg_type_t *listtype,
}
void
cfg_print_spacelist(cfg_printer_t *pctx, cfg_obj_t *obj) {
cfg_list_t *list = &obj->value.list;
cfg_listelt_t *elt;
cfg_print_spacelist(cfg_printer_t *pctx, const cfg_obj_t *obj) {
const cfg_list_t *list = &obj->value.list;
const cfg_listelt_t *elt;
for (elt = ISC_LIST_HEAD(*list);
elt != NULL;
@ -1088,27 +1090,27 @@ cfg_print_spacelist(cfg_printer_t *pctx, cfg_obj_t *obj) {
}
isc_boolean_t
cfg_obj_islist(cfg_obj_t *obj) {
cfg_obj_islist(const cfg_obj_t *obj) {
REQUIRE(obj != NULL);
return (ISC_TF(obj->type->rep == &cfg_rep_list));
}
cfg_listelt_t *
cfg_list_first(cfg_obj_t *obj) {
const cfg_listelt_t *
cfg_list_first(const cfg_obj_t *obj) {
REQUIRE(obj == NULL || obj->type->rep == &cfg_rep_list);
if (obj == NULL)
return (NULL);
return (ISC_LIST_HEAD(obj->value.list));
}
cfg_listelt_t *
cfg_list_next(cfg_listelt_t *elt) {
const cfg_listelt_t *
cfg_list_next(const cfg_listelt_t *elt) {
REQUIRE(elt != NULL);
return (ISC_LIST_NEXT(elt, link));
}
cfg_obj_t *
cfg_listelt_value(cfg_listelt_t *elt) {
const cfg_obj_t *
cfg_listelt_value(const cfg_listelt_t *elt) {
REQUIRE(elt != NULL);
return (elt->obj);
}
@ -1376,7 +1378,7 @@ cfg_parse_netprefix_map(cfg_parser_t *pctx, const cfg_type_t *type, cfg_obj_t **
}
void
cfg_print_mapbody(cfg_printer_t *pctx, cfg_obj_t *obj) {
cfg_print_mapbody(cfg_printer_t *pctx, const cfg_obj_t *obj) {
isc_result_t result = ISC_R_SUCCESS;
const cfg_clausedef_t * const *clauseset;
@ -1456,7 +1458,7 @@ static struct flagtext {
};
void
cfg_print_map(cfg_printer_t *pctx, cfg_obj_t *obj) {
cfg_print_map(cfg_printer_t *pctx, const cfg_obj_t *obj) {
if (obj->value.map.id != NULL) {
cfg_print_obj(pctx, obj->value.map.id);
cfg_print_chars(pctx, " ", 1);
@ -1518,16 +1520,16 @@ cfg_doc_map(cfg_printer_t *pctx, const cfg_type_t *type) {
}
isc_boolean_t
cfg_obj_ismap(cfg_obj_t *obj) {
cfg_obj_ismap(const cfg_obj_t *obj) {
REQUIRE(obj != NULL);
return (ISC_TF(obj->type->rep == &cfg_rep_map));
}
isc_result_t
cfg_map_get(cfg_obj_t *mapobj, const char* name, cfg_obj_t **obj) {
cfg_map_get(const cfg_obj_t *mapobj, const char* name, const cfg_obj_t **obj) {
isc_result_t result;
isc_symvalue_t val;
cfg_map_t *map;
const cfg_map_t *map;
REQUIRE(mapobj != NULL && mapobj->type->rep == &cfg_rep_map);
REQUIRE(name != NULL);
@ -1542,8 +1544,8 @@ cfg_map_get(cfg_obj_t *mapobj, const char* name, cfg_obj_t **obj) {
return (ISC_R_SUCCESS);
}
cfg_obj_t *
cfg_map_getname(cfg_obj_t *mapobj) {
const cfg_obj_t *
cfg_map_getname(const cfg_obj_t *mapobj) {
REQUIRE(mapobj != NULL && mapobj->type->rep == &cfg_rep_map);
return (mapobj->value.map.id);
}
@ -1792,7 +1794,7 @@ cfg_parse_rawport(cfg_parser_t *pctx, unsigned int flags, in_port_t *port) {
}
void
cfg_print_rawaddr(cfg_printer_t *pctx, isc_netaddr_t *na) {
cfg_print_rawaddr(cfg_printer_t *pctx, const isc_netaddr_t *na) {
isc_result_t result;
char text[128];
isc_buffer_t buf;
@ -1935,21 +1937,22 @@ cfg_parse_netprefix(cfg_parser_t *pctx, const cfg_type_t *type,
}
static void
print_netprefix(cfg_printer_t *pctx, cfg_obj_t *obj) {
cfg_netprefix_t *p = &obj->value.netprefix;
print_netprefix(cfg_printer_t *pctx, const cfg_obj_t *obj) {
const cfg_netprefix_t *p = &obj->value.netprefix;
cfg_print_rawaddr(pctx, &p->address);
cfg_print_chars(pctx, "/", 1);
cfg_print_rawuint(pctx, p->prefixlen);
}
isc_boolean_t
cfg_obj_isnetprefix(cfg_obj_t *obj) {
cfg_obj_isnetprefix(const cfg_obj_t *obj) {
REQUIRE(obj != NULL);
return (ISC_TF(obj->type->rep == &cfg_rep_netprefix));
}
void
cfg_obj_asnetprefix(cfg_obj_t *obj, isc_netaddr_t *netaddr,
cfg_obj_asnetprefix(const cfg_obj_t *obj, isc_netaddr_t *netaddr,
unsigned int *prefixlen) {
REQUIRE(obj != NULL && obj->type->rep == &cfg_rep_netprefix);
*netaddr = obj->value.netprefix.address;
@ -2000,7 +2003,7 @@ cfg_parse_sockaddr(cfg_parser_t *pctx, const cfg_type_t *type, cfg_obj_t **ret)
}
void
cfg_print_sockaddr(cfg_printer_t *pctx, cfg_obj_t *obj) {
cfg_print_sockaddr(cfg_printer_t *pctx, const cfg_obj_t *obj) {
isc_netaddr_t netaddr;
in_port_t port;
char buf[ISC_NETADDR_FORMATSIZE];
@ -2045,13 +2048,13 @@ cfg_doc_sockaddr(cfg_printer_t *pctx, const cfg_type_t *type) {
}
isc_boolean_t
cfg_obj_issockaddr(cfg_obj_t *obj) {
cfg_obj_issockaddr(const cfg_obj_t *obj) {
REQUIRE(obj != NULL);
return (ISC_TF(obj->type->rep == &cfg_rep_sockaddr));
}
isc_sockaddr_t *
cfg_obj_assockaddr(cfg_obj_t *obj) {
const isc_sockaddr_t *
cfg_obj_assockaddr(const cfg_obj_t *obj) {
REQUIRE(obj != NULL && obj->type->rep == &cfg_rep_sockaddr);
return (&obj->value.sockaddr);
}
@ -2248,7 +2251,8 @@ parser_complain(cfg_parser_t *pctx, isc_boolean_t is_warning,
}
void
cfg_obj_log(cfg_obj_t *obj, isc_log_t *lctx, int level, const char *fmt, ...) {
cfg_obj_log(const cfg_obj_t *obj, isc_log_t *lctx, int level,
const char *fmt, ...) {
va_list ap;
char msgbuf[2048];
@ -2266,12 +2270,12 @@ cfg_obj_log(cfg_obj_t *obj, isc_log_t *lctx, int level, const char *fmt, ...) {
}
const char *
cfg_obj_file(cfg_obj_t *obj) {
cfg_obj_file(const cfg_obj_t *obj) {
return (obj->file);
}
unsigned int
cfg_obj_line(cfg_obj_t *obj) {
cfg_obj_line(const cfg_obj_t *obj) {
return (obj->line);
}
@ -2332,7 +2336,7 @@ free_map(cfg_parser_t *pctx, cfg_obj_t *obj) {
}
isc_boolean_t
cfg_obj_istype(cfg_obj_t *obj, const cfg_type_t *type) {
cfg_obj_istype(const cfg_obj_t *obj, const cfg_type_t *type) {
return (ISC_TF(obj->type == type));
}