+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]
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: named-checkconf.c,v 1.28.18.13 2006/01/07 00:23:34 marka Exp $ */
+/* $Id: named-checkconf.c,v 1.28.18.14 2006/02/28 03:10:47 marka Exp $ */
/*! \file */
/*% 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;
}
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)
}
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;
}
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++) {
/*% 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;
/*% 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;
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)
/*% 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;
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: config.c,v 1.47.18.22 2006/01/27 02:50:51 marka Exp $ */
+/* $Id: config.c,v 1.47.18.23 2006/02/28 03:10:47 marka Exp $ */
/*! \file */
}
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++) {
}
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++) {
}
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))
}
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;
}
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;
}
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;
}
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;
}
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)
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);
}
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;
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;
}
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;
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: controlconf.c,v 1.40.18.8 2006/01/27 23:57:44 marka Exp $ */
+/* $Id: controlconf.c,v 1.40.18.9 2006/02/28 03:10:47 marka Exp $ */
/*! \file */
}
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;
}
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);
}
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;
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;
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;
* 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);
}
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;
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;
}
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);
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);
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
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,
socktext);
update_listener(cp, &listener, control, config,
- addr, aclconfctx, socktext,
+ &addr, aclconfctx, socktext,
isc_sockettype_tcp);
if (listener != NULL)
* This is a new listener.
*/
add_listener(cp, &listener, control,
- config, addr, aclconfctx,
+ config, &addr, aclconfctx,
socktext,
isc_sockettype_tcp);
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);
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;
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: config.h,v 1.6.18.5 2006/01/27 23:57:44 marka Exp $ */
+/* $Id: config.h,v 1.6.18.6 2006/02/28 03:10:47 marka Exp $ */
#ifndef NAMED_CONFIG_H
#define NAMED_CONFIG_H 1
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);
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,
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: control.h,v 1.14.18.5 2005/04/27 05:00:35 sra Exp $ */
+/* $Id: control.h,v 1.14.18.6 2006/02/28 03:10:47 marka Exp $ */
#ifndef NAMED_CONTROL_H
#define NAMED_CONTROL_H 1
*/
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'
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: globals.h,v 1.64.18.2 2005/04/29 00:15:34 marka Exp $ */
+/* $Id: globals.h,v 1.64.18.3 2006/02/28 03:10:47 marka Exp $ */
#ifndef NAMED_GLOBALS_H
#define NAMED_GLOBALS_H 1
* 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
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: logconf.h,v 1.11.18.2 2005/04/29 00:15:35 marka Exp $ */
+/* $Id: logconf.h,v 1.11.18.3 2006/02/28 03:10:47 marka Exp $ */
#ifndef NAMED_LOGCONF_H
#define NAMED_LOGCONF_H 1
#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'.
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: lwresd.h,v 1.13.18.2 2005/04/29 00:15:36 marka Exp $ */
+/* $Id: lwresd.h,v 1.13.18.3 2006/02/28 03:10:47 marka Exp $ */
#ifndef NAMED_LWRESD_H
#define NAMED_LWRESD_H 1
* 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,
*/
/*% 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
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: server.h,v 1.73.18.5 2005/08/15 01:46:49 marka Exp $ */
+/* $Id: server.h,v 1.73.18.6 2006/02/28 03:10:47 marka Exp $ */
#ifndef NAMED_SERVER_H
#define NAMED_SERVER_H 1
* 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 */
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: sortlist.h,v 1.5.18.2 2005/04/29 00:15:38 marka Exp $ */
+/* $Id: sortlist.h,v 1.5.18.3 2006/02/28 03:10:47 marka Exp $ */
#ifndef NAMED_SORTLIST_H
#define NAMED_SORTLIST_H 1
* 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.
} 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.
*
*/
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
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
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: tkeyconf.h,v 1.10.18.2 2005/04/29 00:15:38 marka Exp $ */
+/* $Id: tkeyconf.h,v 1.10.18.3 2006/02/28 03:10:47 marka Exp $ */
#ifndef NS_TKEYCONF_H
#define NS_TKEYCONF_H 1
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'.
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: tsigconf.h,v 1.10.18.2 2005/04/29 00:15:38 marka Exp $ */
+/* $Id: tsigconf.h,v 1.10.18.3 2006/02/28 03:10:47 marka Exp $ */
#ifndef NS_TSIGCONF_H
#define NS_TSIGCONF_H 1
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'
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: zoneconf.h,v 1.19.18.3 2005/04/27 05:00:37 sra Exp $ */
+/* $Id: zoneconf.h,v 1.19.18.4 2006/02/28 03:10:47 marka Exp $ */
#ifndef NS_ZONECONF_H
#define NS_ZONECONF_H 1
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'.
*/
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
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: logconf.c,v 1.35.18.3 2005/08/23 02:31:31 marka Exp $ */
+/* $Id: logconf.c,v 1.35.18.4 2006/02/28 03:10:47 marka Exp $ */
/*! \file */
* 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);
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,
* 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));
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;
* 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);
}
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));
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));
}
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;
}
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: lwdgabn.c,v 1.15.18.3 2005/06/23 04:23:13 marka Exp $ */
+/* $Id: lwdgabn.c,v 1.15.18.4 2006/02/28 03:10:47 marka Exp $ */
/*! \file */
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;
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: lwresd.c,v 1.46.18.5 2005/11/30 03:44:38 marka Exp $ */
+/* $Id: lwresd.c,v 1.46.18.6 2006/02/28 03:10:47 marka Exp $ */
/*! \file
* \brief
* 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);
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;
}
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;
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: query.c,v 1.257.18.24 2006/02/02 22:52:57 marka Exp $ */
+/* $Id: query.c,v 1.257.18.25 2006/02/28 03:10:47 marka Exp $ */
/*! \file */
* 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;
* 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)
* 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)
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,
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: server.c,v 1.419.18.40 2006/02/26 22:59:55 marka Exp $ */
+/* $Id: server.c,v 1.419.18.41 2006/02/28 03:10:47 marka Exp $ */
/*! \file */
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
* (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)
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;
}
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;
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));
}
* 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));
}
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;
* 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.
}
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;
}
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;
}
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;
}
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;
* 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;
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));
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));
}
* 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);
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));
* 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));
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));
}
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);
}
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;
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)) {
}
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;
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;
* 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");
* 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;
* 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,
* 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);
* 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;
* 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
}
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;
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");
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);
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;
* statement.
*/
{
- cfg_obj_t *clistenon = NULL;
+ const cfg_obj_t *clistenon = NULL;
ns_listenlist_t *listenon = NULL;
clistenon = NULL;
* Ditto for IPv6.
*/
{
- cfg_obj_t *clistenon = NULL;
+ const cfg_obj_t *clistenon = NULL;
ns_listenlist_t *listenon = NULL;
if (options != NULL)
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));
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));
"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),
* 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) {
(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);
}
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];
}
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);
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)
* 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);
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: sortlist.c,v 1.9.18.2 2005/04/29 00:15:26 marka Exp $ */
+/* $Id: sortlist.c,v 1.9.18.3 2006/02/28 03:10:47 marka Exp $ */
/*! \file */
#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)
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;
}
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,
}
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)) {
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;
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: tkeyconf.c,v 1.20.18.4 2005/08/23 02:31:34 marka Exp $ */
+/* $Id: tkeyconf.c,v 1.20.18.5 2006/02/28 03:10:47 marka Exp $ */
/*! \file */
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;
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);
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: tsigconf.c,v 1.22.18.5 2006/01/27 23:57:44 marka Exp $ */
+/* $Id: tsigconf.c,v 1.22.18.6 2006/02/28 03:10:47 marka Exp $ */
/*! \file */
#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;
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;
}
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;
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: zoneconf.c,v 1.110.18.20 2006/02/16 01:38:49 marka Exp $ */
+/* $Id: zoneconf.c,v 1.110.18.21 2006/02/28 03:10:47 marka Exp $ */
/*% */
* 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;
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;
* 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;
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;
element2 != NULL;
element2 = cfg_list_next(element2))
{
- cfg_obj_t *typeobj;
+ const cfg_obj_t *typeobj;
isc_textregion_t r;
INSIST(i < n);
* 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);
}
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;
}
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;
}
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;
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: rndc.c,v 1.96.18.12 2005/09/19 00:15:20 marka Exp $ */
+/* $Id: rndc.c,v 1.96.18.13 2006/02/28 03:10:48 marka Exp $ */
/*! \file */
{
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;
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);
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);
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: check.c,v 1.44.18.25 2006/02/17 00:42:10 marka Exp $ */
+/* $Id: check.c,v 1.44.18.26 2006/02/28 03:10:48 marka Exp $ */
/*! \file */
}
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;
}
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);
}
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;
}
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);
}
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);
}
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;
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>";
}
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;
}
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) {
}
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;
} 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;
(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;
}
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)
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);
}
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);
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");
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)
}
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;
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);
element2 != NULL;
element2 = cfg_list_next(element2))
{
- cfg_obj_t *typeobj;
+ const cfg_obj_t *typeobj;
isc_textregion_t r;
dns_rdatatype_t type;
} 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;
* 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);
} 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;
}
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;
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) {
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>";
};
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;
}
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;
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);
* 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)
* 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)
};
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;
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);
}
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);
}
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))
}
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;
}
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;
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) {
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);
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);
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",
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"));
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"));
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"));
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: check.h,v 1.2.18.2 2005/04/29 00:15:48 marka Exp $ */
+/* $Id: check.h,v 1.2.18.3 2006/02/28 03:10:48 marka Exp $ */
#ifndef BIND9_CHECK_H
#define BIND9_CHECK_H 1
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.
*/
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.
*/
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: acl.c,v 1.25.18.3 2005/07/12 01:22:18 marka Exp $ */
+/* $Id: acl.c,v 1.25.18.4 2006/02/28 03:10:48 marka Exp $ */
/*! \file */
}
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.
}
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;
}
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;
}
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;
}
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) {
}
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);
}
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 &&
}
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];
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: compress.c,v 1.52.18.3 2005/04/27 05:01:14 sra Exp $ */
+/* $Id: compress.c,v 1.52.18.4 2006/02/28 03:10:48 marka Exp $ */
/*! \file */
* 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;
}
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;
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: acl.h,v 1.22.18.2 2005/04/29 00:16:08 marka Exp $ */
+/* $Id: acl.h,v 1.22.18.3 2006/02/28 03:10:48 marka Exp $ */
#ifndef DNS_ACL_H
#define DNS_ACL_H 1
*/
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.
*/
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.
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.
*/
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.
*/
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
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: compress.h,v 1.32.18.4 2005/06/22 22:05:47 marka Exp $ */
+/* $Id: compress.h,v 1.32.18.5 2006/02/28 03:10:48 marka Exp $ */
#ifndef DNS_COMPRESS_H
#define DNS_COMPRESS_H 1
*/
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.
*/
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.
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: message.h,v 1.114.18.4 2006/01/06 00:01:43 marka Exp $ */
+/* $Id: message.h,v 1.114.18.5 2006/02/28 03:10:48 marka Exp $ */
#ifndef DNS_MESSAGE_H
#define DNS_MESSAGE_H 1
isc_region_t saved;
dns_rdatasetorderfunc_t order;
- void * order_arg;
+ const void * order_arg;
};
/***
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
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: name.h,v 1.107.18.13 2005/10/26 04:57:24 marka Exp $ */
+/* $Id: name.h,v 1.107.18.14 2006/02/28 03:10:48 marka Exp $ */
#ifndef DNS_NAME_H
#define DNS_NAME_H 1
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'.
*
*/
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'.
*/
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'.
*
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: peer.h,v 1.20.18.7 2006/02/17 00:42:10 marka Exp $ */
+/* $Id: peer.h,v 1.20.18.8 2006/02/28 03:10:48 marka Exp $ */
#ifndef DNS_PEER_H
#define DNS_PEER_H 1
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);
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);
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: rdataset.h,v 1.51.18.4 2005/04/27 05:01:37 sra Exp $ */
+/* $Id: rdataset.h,v 1.51.18.5 2006/02/28 03:10:48 marka Exp $ */
#ifndef DNS_RDATASET_H
#define DNS_RDATASET_H 1
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);
/*%<
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);
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: types.h,v 1.109.18.10 2006/01/27 23:57:44 marka Exp $ */
+/* $Id: types.h,v 1.109.18.11 2006/02/28 03:10:48 marka Exp $ */
#ifndef DNS_TYPES_H
#define DNS_TYPES_H 1
(*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 *);
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: zone.h,v 1.126.18.16 2006/02/21 23:17:32 marka Exp $ */
+/* $Id: zone.h,v 1.126.18.17 2006/02/28 03:10:48 marka Exp $ */
#ifndef DNS_ZONE_H
#define DNS_ZONE_H 1
*/
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'.
*
*/
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.
*
*/
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
*/
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.
*
*/
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.
*
*/
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.
*
*/
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.
*
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: message.c,v 1.222.18.8 2006/01/06 00:01:43 marka Exp $ */
+/* $Id: message.c,v 1.222.18.9 2006/02/28 03:10:48 marka Exp $ */
/*! \file */
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)
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;
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: name.c,v 1.144.18.14 2006/01/10 23:50:41 marka Exp $ */
+/* $Id: name.c,v 1.144.18.15 2006/02/28 03:10:48 marka Exp $ */
/*! \file */
}
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'.
}
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 */
}
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'.
*/
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: peer.c,v 1.19.18.7 2006/02/17 00:42:10 marka Exp $ */
+/* $Id: peer.c,v 1.19.18.8 2006/02/28 03:10:48 marka Exp $ */
/*! \file */
}
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) {
}
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) {
}
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) {
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: rdataset.c,v 1.72.18.3 2005/04/29 00:16:03 marka Exp $ */
+/* $Id: rdataset.c,v 1.72.18.4 2006/02/28 03:10:48 marka Exp $ */
/*! \file */
}
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)
{
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)
{
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)
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: zone.c,v 1.410.18.42 2006/02/21 23:17:32 marka Exp $ */
+/* $Id: zone.c,v 1.410.18.43 2006/02/28 03:10:48 marka Exp $ */
/*! \file */
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));
}
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);
}
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);
}
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);
}
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);
}
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);
}
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);
}
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;
}
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;
}
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;
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: sockaddr.h,v 1.42.18.6 2005/07/28 04:58:47 marka Exp $ */
+/* $Id: sockaddr.h,v 1.42.18.7 2006/02/28 03:10:48 marka Exp $ */
#ifndef ISC_SOCKADDR_H
#define ISC_SOCKADDR_H 1
*/
in_port_t
-isc_sockaddr_getport(isc_sockaddr_t *sockaddr);
+isc_sockaddr_getport(const isc_sockaddr_t *sockaddr);
/*%<
* Get the port stored in 'sockaddr'.
*/
*/
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.
*/
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: symtab.h,v 1.17.18.2 2005/04/29 00:17:03 marka Exp $ */
+/* $Id: symtab.h,v 1.17.18.3 2006/02/28 03:10:48 marka Exp $ */
#ifndef ISC_SYMTAB_H
#define ISC_SYMTAB_H 1
/*% Symbol table value. */
typedef union isc_symvalue {
void * as_pointer;
+ const void * as_cpointer;
int as_integer;
unsigned int as_uinteger;
} isc_symvalue_t;
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: sockaddr.c,v 1.59.18.6 2005/04/27 05:02:07 sra Exp $ */
+/* $Id: sockaddr.c,v 1.59.18.7 2006/02/28 03:10:48 marka Exp $ */
/*! \file */
}
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) {
}
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 ||
}
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) {
}
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) {
}
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) {
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: aclconf.c,v 1.2.2.4 2005/08/23 02:31:38 marka Exp $ */
+/* $Id: aclconf.c,v 1.2.2.5 2006/02/28 03:10:49 marka Exp $ */
#include <config.h>
* 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)
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");
}
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);
}
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;
}
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,
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);
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");
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: aclconf.h,v 1.2.2.3 2005/01/13 05:15:43 marka Exp $ */
+/* $Id: aclconf.h,v 1.2.2.4 2006/02/28 03:10:49 marka Exp $ */
#ifndef ISCCFG_ACLCONF_H
#define ISCCFG_ACLCONF_H 1
*/
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,
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: cfg.h,v 1.34.18.3 2005/08/23 02:31:40 marka Exp $ */
+/* $Id: cfg.h,v 1.34.18.4 2006/02/28 03:10:49 marka Exp $ */
#ifndef ISCCFG_CFG_H
#define ISCCFG_CFG_H 1
* "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
*/
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.
* \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.
*
*/
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.
*/
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.
*
*/
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.
*
*/
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.
*/
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.
*
*/
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.
*
*/
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
*/
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.
*
* 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.
*
* 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.
*
*/
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);
/*%<
*/
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'.
*/
*/
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
*/
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.
*/
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: grammar.h,v 1.4.18.7 2006/02/19 06:50:47 marka Exp $ */
+/* $Id: grammar.h,v 1.4.18.8 2006/02/28 03:10:49 marka Exp $ */
#ifndef ISCCFG_GRAMMAR_H
#define ISCCFG_GRAMMAR_H 1
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 *);
isc_sockaddr_t sockaddr;
cfg_netprefix_t netprefix;
} value;
- char * file;
+ const char * file;
unsigned int line;
};
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);
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);
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);
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);
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);
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);
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);
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);
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);
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);
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: namedconf.c,v 1.30.18.34 2006/02/17 00:42:10 marka Exp $ */
+/* $Id: namedconf.c,v 1.30.18.35 2006/02/28 03:10:49 marka Exp $ */
/*! \file */
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);
*/
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);
}
*/
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);
}
}
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);
}
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);
};
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);
}
}
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);
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: parser.c,v 1.112.18.10 2006/02/19 06:50:47 marka Exp $ */
+/* $Id: parser.c,v 1.112.18.11 2006/02/28 03:10:49 marka Exp $ */
/*! \file */
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);
/* 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);
}
}
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)
{
}
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);
}
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;
}
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);
}
}
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));
}
}
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);
}
* 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);
}
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);
}
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);
}
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);
}
*/
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);
}
}
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
}
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;
}
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);
}
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;
}
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);
}
}
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;
};
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);
}
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);
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);
}
}
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;
}
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;
}
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];
}
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);
}
}
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];
}
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);
}
}
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));
}