]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
1991. [cleanup] The configuration data, once read, should be treated
authorMark Andrews <marka@isc.org>
Tue, 28 Feb 2006 06:32:54 +0000 (06:32 +0000)
committerMark Andrews <marka@isc.org>
Tue, 28 Feb 2006 06:32:54 +0000 (06:32 +0000)
                        as readonly.  Expand the use of const to enforce this
                        at compile time. [RT #15813]

52 files changed:
CHANGES
bin/check/named-checkconf.c
bin/named/aclconf.c
bin/named/config.c
bin/named/controlconf.c
bin/named/include/named/aclconf.h
bin/named/include/named/config.h
bin/named/include/named/control.h
bin/named/include/named/globals.h
bin/named/include/named/logconf.h
bin/named/include/named/lwresd.h
bin/named/include/named/server.h
bin/named/include/named/sortlist.h
bin/named/include/named/tkeyconf.h
bin/named/include/named/tsigconf.h
bin/named/include/named/zoneconf.h
bin/named/logconf.c
bin/named/lwdgabn.c
bin/named/lwresd.c
bin/named/query.c
bin/named/server.c
bin/named/sortlist.c
bin/named/tkeyconf.c
bin/named/tsigconf.c
bin/named/zoneconf.c
bin/rndc/rndc.c
lib/bind9/check.c
lib/bind9/include/bind9/check.h
lib/dns/acl.c
lib/dns/cache.c
lib/dns/compress.c
lib/dns/include/dns/acl.h
lib/dns/include/dns/cache.h
lib/dns/include/dns/compress.h
lib/dns/include/dns/message.h
lib/dns/include/dns/name.h
lib/dns/include/dns/peer.h
lib/dns/include/dns/rdataset.h
lib/dns/include/dns/types.h
lib/dns/include/dns/zone.h
lib/dns/message.c
lib/dns/name.c
lib/dns/peer.c
lib/dns/rdataset.c
lib/dns/zone.c
lib/isc/include/isc/sockaddr.h
lib/isc/include/isc/symtab.h
lib/isc/sockaddr.c
lib/isccfg/include/isccfg/cfg.h
lib/isccfg/include/isccfg/grammar.h
lib/isccfg/namedconf.c
lib/isccfg/parser.c

diff --git a/CHANGES b/CHANGES
index 2d2eedd2cef4c57bab7423ad57aac8d433afd973..efba7ea74f24d6504f9f2d3ae4b08554f7e800c9 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -1,3 +1,7 @@
+1991.  [cleanup]       The configuration data, once read, should be treated
+                       as readonly.  Expand the use of const to enforce this
+                       at compile time. [RT #15813]
+
 1990.  [bug]           libbind:  isc's override of broken gettimeofday()
                        implementions was not always effective.
                        [RT #15709]
index e7f91386ff0ea0e8a5466a1723d16e111a4a46b2..7ec75a3362b374a96433eb07fe3ba3a8c79c5e77 100644 (file)
@@ -15,7 +15,7 @@
  * PERFORMANCE OF THIS SOFTWARE.
  */
 
-/* $Id: named-checkconf.c,v 1.12.12.9 2005/03/03 06:33:38 marka Exp $ */
+/* $Id: named-checkconf.c,v 1.12.12.10 2006/02/28 06:32:53 marka Exp $ */
 
 #include <config.h>
 
@@ -60,9 +60,9 @@ usage(void) {
 }
 
 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;
-       char *directory;
+       const char *directory;
 
        REQUIRE(strcasecmp("directory", clausename) == 0);
 
@@ -85,18 +85,18 @@ directory_callback(const char *clausename, cfg_obj_t *obj, void *arg) {
 }
 
 static isc_result_t
-configure_zone(const char *vclass, const char *view, cfg_obj_t *zconfig,
-              isc_mem_t *mctx)
+configure_zone(const char *vclass, const char *view,
+              const cfg_obj_t *zconfig, isc_mem_t *mctx)
 {
        isc_result_t result;
        const char *zclass;
        const char *zname;
        const char *zfile;
-       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;
+       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;
 
        zname = cfg_obj_asstring(cfg_tuple_get(zconfig, "name"));
        classobj = cfg_tuple_get(zconfig, "class");
@@ -125,12 +125,12 @@ configure_zone(const char *vclass, const char *view, cfg_obj_t *zconfig,
 }
 
 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;
 
@@ -148,7 +148,7 @@ configure_view(const char *vclass, const char *view, cfg_obj_t *config,
             element != NULL;
             element = cfg_list_next(element))
        {
-               cfg_obj_t *zconfig = cfg_listelt_value(element);
+               const cfg_obj_t *zconfig = cfg_listelt_value(element);
                tresult = configure_zone(vclass, view, zconfig, mctx);
                if (tresult != ISC_R_SUCCESS)
                        result = tresult;
@@ -158,11 +158,11 @@ configure_view(const char *vclass, const char *view, cfg_obj_t *config,
 
 
 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;
index 8b6d0c767d4fe8f61a9f082acb183dc06563ce16..ecf33f6ee2246b9adb13045d54943893830c68df 100644 (file)
@@ -15,7 +15,7 @@
  * PERFORMANCE OF THIS SOFTWARE.
  */
 
-/* $Id: aclconf.c,v 1.27.12.5 2005/03/17 03:58:25 marka Exp $ */
+/* $Id: aclconf.c,v 1.27.12.6 2006/02/28 06:32:53 marka Exp $ */
 
 #include <config.h>
 
@@ -54,10 +54,10 @@ ns_aclconfctx_destroy(ns_aclconfctx_t *ctx) {
  * Find the definition of the named acl whose name is "name".
  */
 static isc_result_t
-get_acl_def(cfg_obj_t *cctx, 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)
@@ -65,7 +65,7 @@ get_acl_def(cfg_obj_t *cctx, char *name, cfg_obj_t **ret) {
        for (elt = cfg_list_first(acls);
             elt != NULL;
             elt = cfg_list_next(elt)) {
-               cfg_obj_t *acl = cfg_listelt_value(elt);
+               const cfg_obj_t *acl = cfg_listelt_value(elt);
                const char *aclname = cfg_obj_asstring(cfg_tuple_get(acl, "name"));
                if (strcasecmp(aclname, name) == 0) {
                        *ret = cfg_tuple_get(acl, "value");
@@ -76,15 +76,15 @@ get_acl_def(cfg_obj_t *cctx, char *name, cfg_obj_t **ret) {
 }
 
 static isc_result_t
-convert_named_acl(cfg_obj_t *nameobj, cfg_obj_t *cctx,
+convert_named_acl(const cfg_obj_t *nameobj, const cfg_obj_t *cctx,
                  ns_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;
-       char *aclname = cfg_obj_asstring(nameobj);
+       const char *aclname = cfg_obj_asstring(nameobj);
 
        /* Look for an already-converted version. */
        for (dacl = ISC_LIST_HEAD(ctx->named_acl_cache);
@@ -113,7 +113,7 @@ convert_named_acl(cfg_obj_t *nameobj, cfg_obj_t *cctx,
         */
        memset(&loop, 0, sizeof(loop));
        ISC_LINK_INIT(&loop, nextincache);
-       loop.name = aclname;
+       DE_CONST(aclname, loop.name);
        loop.magic = LOOP_MAGIC;
        ISC_LIST_APPEND(ctx->named_acl_cache, &loop, nextincache);
        result = ns_acl_fromconfig(cacl, cctx, ctx, mctx, &dacl);
@@ -131,7 +131,7 @@ convert_named_acl(cfg_obj_t *nameobj, cfg_obj_t *cctx,
 }
 
 static isc_result_t
-convert_keyname(cfg_obj_t *keyobj, isc_mem_t *mctx, dns_name_t *dnsname) {
+convert_keyname(const cfg_obj_t *keyobj, isc_mem_t *mctx, dns_name_t *dnsname) {
        isc_result_t result;
        isc_buffer_t buf;
        dns_fixedname_t fixname;
@@ -154,8 +154,8 @@ convert_keyname(cfg_obj_t *keyobj, isc_mem_t *mctx, dns_name_t *dnsname) {
 }
 
 isc_result_t
-ns_acl_fromconfig(cfg_obj_t *caml,
-                 cfg_obj_t *cctx,
+ns_acl_fromconfig(const cfg_obj_t *caml,
+                 const cfg_obj_t *cctx,
                  ns_aclconfctx_t *ctx,
                  isc_mem_t *mctx,
                  dns_acl_t **target)
@@ -164,7 +164,7 @@ ns_acl_fromconfig(cfg_obj_t *caml,
        unsigned int count;
        dns_acl_t *dacl = NULL;
        dns_aclelement_t *de;
-       cfg_listelt_t *elt;
+       const cfg_listelt_t *elt;
 
        REQUIRE(target != NULL && *target == NULL);
 
@@ -183,7 +183,7 @@ ns_acl_fromconfig(cfg_obj_t *caml,
             elt != NULL;
             elt = cfg_list_next(elt))
        {
-               cfg_obj_t *ce = cfg_listelt_value(elt);
+               const cfg_obj_t *ce = cfg_listelt_value(elt);
                if (cfg_obj_istuple(ce)) {
                        /* This must be a negated element. */
                        ce = cfg_tuple_get(ce, "value");
@@ -215,7 +215,7 @@ ns_acl_fromconfig(cfg_obj_t *caml,
                                goto cleanup;
                } else if (cfg_obj_isstring(ce)) {
                        /* ACL name */
-                       char *name = cfg_obj_asstring(ce);
+                       const char *name = cfg_obj_asstring(ce);
                        if (strcasecmp(name, "localhost") == 0) {
                                de->type = dns_aclelementtype_localhost;
                        } else if (strcasecmp(name, "localnets") == 0) {
index 39f90fb57cc3daf73c624b63da9ed4b8a22cadbc..7b5b99e6720e506f89c1aa0e851572ed331fcbe6 100644 (file)
@@ -15,7 +15,7 @@
  * PERFORMANCE OF THIS SOFTWARE.
  */
 
-/* $Id: config.c,v 1.11.2.4.8.31 2006/01/04 23:50:19 marka Exp $ */
+/* $Id: config.c,v 1.11.2.4.8.32 2006/02/28 06:32:53 marka Exp $ */
 
 #include <config.h>
 
@@ -196,7 +196,7 @@ ns_config_parsedefaults(cfg_parser_t *parser, cfg_obj_t **conf) {
 }
 
 isc_result_t
-ns_config_get(cfg_obj_t **maps, const char *name, cfg_obj_t **obj) {
+ns_config_get(const cfg_obj_t **maps, const char *name, const cfg_obj_t **obj) {
        int i;
 
        for (i = 0;; i++) {
@@ -208,11 +208,13 @@ ns_config_get(cfg_obj_t **maps, const char *name, cfg_obj_t **obj) {
 }
 
 isc_result_t
-ns_checknames_get(cfg_obj_t **maps, const char *which, cfg_obj_t **obj) {
-       cfg_listelt_t *element;
-       cfg_obj_t *checknames;
-       cfg_obj_t *type;
-       cfg_obj_t *value;
+ns_checknames_get(const cfg_obj_t **maps, const char *which,
+                 const cfg_obj_t **obj)
+{
+       const cfg_listelt_t *element;
+       const cfg_obj_t *checknames;
+       const cfg_obj_t *type;
+       const cfg_obj_t *value;
        int i;
 
        for (i = 0;; i++) {
@@ -243,8 +245,8 @@ ns_checknames_get(cfg_obj_t **maps, const char *which, cfg_obj_t **obj) {
 }
 
 int
-ns_config_listcount(cfg_obj_t *list) {
-       cfg_listelt_t *e;
+ns_config_listcount(const cfg_obj_t *list) {
+       const cfg_listelt_t *e;
        int i = 0;
 
        for (e = cfg_list_first(list); e != NULL; e = cfg_list_next(e))
@@ -254,9 +256,9 @@ ns_config_listcount(cfg_obj_t *list) {
 }
 
 isc_result_t
-ns_config_getclass(cfg_obj_t *classobj, dns_rdataclass_t defclass,
+ns_config_getclass(const cfg_obj_t *classobj, dns_rdataclass_t defclass,
                   dns_rdataclass_t *classp) {
-       char *str;
+       const char *str;
        isc_textregion_t r;
        isc_result_t result;
 
@@ -265,7 +267,7 @@ ns_config_getclass(cfg_obj_t *classobj, dns_rdataclass_t defclass,
                return (ISC_R_SUCCESS);
        }
        str = cfg_obj_asstring(classobj);
-       r.base = str;
+       DE_CONST(str, r.base);
        r.length = strlen(str);
        result = dns_rdataclass_fromtext(classp, &r);
        if (result != ISC_R_SUCCESS)
@@ -275,9 +277,9 @@ ns_config_getclass(cfg_obj_t *classobj, dns_rdataclass_t defclass,
 }
 
 isc_result_t
-ns_config_gettype(cfg_obj_t *typeobj, dns_rdatatype_t deftype,
+ns_config_gettype(const cfg_obj_t *typeobj, dns_rdatatype_t deftype,
                   dns_rdatatype_t *typep) {
-       char *str;
+       const char *str;
        isc_textregion_t r;
        isc_result_t result;
 
@@ -286,7 +288,7 @@ ns_config_gettype(cfg_obj_t *typeobj, dns_rdatatype_t deftype,
                return (ISC_R_SUCCESS);
        }
        str = cfg_obj_asstring(typeobj);
-       r.base = str;
+       DE_CONST(str, r.base);
        r.length = strlen(str);
        result = dns_rdatatype_fromtext(typep, &r);
        if (result != ISC_R_SUCCESS)
@@ -296,9 +298,9 @@ ns_config_gettype(cfg_obj_t *typeobj, dns_rdatatype_t deftype,
 }
 
 dns_zonetype_t
-ns_config_getzonetype(cfg_obj_t *zonetypeobj) {
+ns_config_getzonetype(const cfg_obj_t *zonetypeobj) {
        dns_zonetype_t ztype = dns_zone_none;
-       char *str;
+       const char *str;
 
        str = cfg_obj_asstring(zonetypeobj);
        if (strcasecmp(str, "master") == 0)
@@ -313,14 +315,14 @@ ns_config_getzonetype(cfg_obj_t *zonetypeobj) {
 }
 
 isc_result_t
-ns_config_getiplist(cfg_obj_t *config, cfg_obj_t *list,
+ns_config_getiplist(const cfg_obj_t *config, const cfg_obj_t *list,
                    in_port_t defport, isc_mem_t *mctx,
                    isc_sockaddr_t **addrsp, isc_uint32_t *countp)
 {
        int count, i = 0;
-       cfg_obj_t *addrlist;
-       cfg_obj_t *portobj;
-       cfg_listelt_t *element;
+       const cfg_obj_t *addrlist;
+       const cfg_obj_t *portobj;
+       const cfg_listelt_t *element;
        isc_sockaddr_t *addrs;
        in_port_t port;
        isc_result_t result;
@@ -380,10 +382,12 @@ ns_config_putiplist(isc_mem_t *mctx, isc_sockaddr_t **addrsp,
 }
 
 static isc_result_t
-get_masters_def(cfg_obj_t *cctx, 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)
@@ -391,7 +395,7 @@ get_masters_def(cfg_obj_t *cctx, char *name, cfg_obj_t **ret) {
        for (elt = cfg_list_first(masters);
             elt != NULL;
             elt = cfg_list_next(elt)) {
-               cfg_obj_t *list;
+               const cfg_obj_t *list;
                const char *listname;
 
                list = cfg_listelt_value(elt);
@@ -406,24 +410,24 @@ get_masters_def(cfg_obj_t *cctx, char *name, cfg_obj_t **ret) {
 }
 
 isc_result_t
-ns_config_getipandkeylist(cfg_obj_t *config, cfg_obj_t *list, isc_mem_t *mctx,
-                         isc_sockaddr_t **addrsp, dns_name_t ***keysp,
-                         isc_uint32_t *countp)
+ns_config_getipandkeylist(const cfg_obj_t *config, const cfg_obj_t *list,
+                         isc_mem_t *mctx, isc_sockaddr_t **addrsp,
+                         dns_name_t ***keysp, isc_uint32_t *countp)
 {
        isc_uint32_t addrcount = 0, keycount = 0, i = 0;
        isc_uint32_t listcount = 0, l = 0, j;
        isc_uint32_t stackcount = 0, pushed = 0;
        isc_result_t result;
-       cfg_listelt_t *element;
-       cfg_obj_t *addrlist;
-       cfg_obj_t *portobj;
+       const cfg_listelt_t *element;
+       const cfg_obj_t *addrlist;
+       const cfg_obj_t *portobj;
        in_port_t port;
        dns_fixedname_t fname;
        isc_sockaddr_t *addrs = NULL;
        dns_name_t **keys = NULL;
-       char **lists = NULL;
+       const char **lists = NULL;
        struct {
-               cfg_listelt_t *element;
+               const cfg_listelt_t *element;
                in_port_t port;
        } *stack = NULL;
 
@@ -457,9 +461,9 @@ ns_config_getipandkeylist(cfg_obj_t *config, cfg_obj_t *list, isc_mem_t *mctx,
             element != NULL;
             element = cfg_list_next(element))
        {
-               cfg_obj_t *addr;
-               cfg_obj_t *key;
-               char *keystr;
+               const cfg_obj_t *addr;
+               const cfg_obj_t *key;
+               const char *keystr;
                isc_buffer_t b;
 
                addr = cfg_tuple_get(cfg_listelt_value(element),
@@ -467,7 +471,7 @@ ns_config_getipandkeylist(cfg_obj_t *config, cfg_obj_t *list, isc_mem_t *mctx,
                key = cfg_tuple_get(cfg_listelt_value(element), "key");
 
                if (!cfg_obj_issockaddr(addr)) {
-                       char *listname = cfg_obj_asstring(addr);
+                       const char *listname = cfg_obj_asstring(addr);
                        isc_result_t tresult;
 
                        /* Grow lists? */
@@ -683,10 +687,10 @@ ns_config_putipandkeylist(isc_mem_t *mctx, isc_sockaddr_t **addrsp,
 }
 
 isc_result_t
-ns_config_getport(cfg_obj_t *config, in_port_t *portp) {
-       cfg_obj_t *maps[3];
-       cfg_obj_t *options = NULL;
-       cfg_obj_t *portobj = NULL;
+ns_config_getport(const cfg_obj_t *config, in_port_t *portp) {
+       const cfg_obj_t *maps[3];
+       const cfg_obj_t *options = NULL;
+       const cfg_obj_t *portobj = NULL;
        isc_result_t result;
        int i;
 
index a58ceee65c81a8fbc8f301b1849780cea6a30103..b6bcc166200c02bae13774e9c049ee53d6c6a016 100644 (file)
@@ -15,7 +15,7 @@
  * PERFORMANCE OF THIS SOFTWARE.
  */
 
-/* $Id: controlconf.c,v 1.28.2.9.2.9 2006/01/04 23:50:19 marka Exp $ */
+/* $Id: controlconf.c,v 1.28.2.9.2.10 2006/02/28 06:32:53 marka Exp $ */
 
 #include <config.h>
 
@@ -650,10 +650,12 @@ ns_controls_shutdown(ns_controls_t *controls) {
 }
 
 static isc_result_t
-cfgkeylist_find(cfg_obj_t *keylist, const char *keyname, cfg_obj_t **objp) {
-       cfg_listelt_t *element;
+cfgkeylist_find(const cfg_obj_t *keylist, const char *keyname,
+               const cfg_obj_t **objp)
+{
+       const cfg_listelt_t *element;
        const char *str;
-       cfg_obj_t *obj;
+       const cfg_obj_t *obj;
 
        for (element = cfg_list_first(keylist);
             element != NULL;
@@ -672,13 +674,13 @@ cfgkeylist_find(cfg_obj_t *keylist, const char *keyname, cfg_obj_t **objp) {
 }
 
 static isc_result_t
-controlkeylist_fromcfg(cfg_obj_t *keylist, isc_mem_t *mctx,
+controlkeylist_fromcfg(const cfg_obj_t *keylist, isc_mem_t *mctx,
                       controlkeylist_t *keyids)
 {
-       cfg_listelt_t *element;
+       const cfg_listelt_t *element;
        char *newstr = NULL;
        const char *str;
-       cfg_obj_t *obj;
+       const cfg_obj_t *obj;
        controlkey_t *key = NULL;
 
        for (element = cfg_list_first(keylist);
@@ -713,11 +715,11 @@ controlkeylist_fromcfg(cfg_obj_t *keylist, isc_mem_t *mctx,
 }
 
 static void
-register_keys(cfg_obj_t *control, cfg_obj_t *keylist,
+register_keys(const cfg_obj_t *control, const cfg_obj_t *keylist,
              controlkeylist_t *keyids, isc_mem_t *mctx, const char *socktext)
 {
        controlkey_t *keyid, *next;
-       cfg_obj_t *keydef;
+       const cfg_obj_t *keydef;
        char secret[1024];
        isc_buffer_t b;
        isc_result_t result;
@@ -737,10 +739,10 @@ register_keys(cfg_obj_t *control, cfg_obj_t *keylist,
                        ISC_LIST_UNLINK(*keyids, keyid, link);
                        free_controlkey(keyid, mctx);
                } else {
-                       cfg_obj_t *algobj = NULL;
-                       cfg_obj_t *secretobj = NULL;
-                       char *algstr = NULL;
-                       char *secretstr = NULL;
+                       const cfg_obj_t *algobj = NULL;
+                       const cfg_obj_t *secretobj = NULL;
+                       const char *algstr = NULL;
+                       const char *secretstr = NULL;
 
                        (void)cfg_map_get(keydef, "algorithm", &algobj);
                        (void)cfg_map_get(keydef, "secret", &secretobj);
@@ -806,11 +808,11 @@ get_rndckey(isc_mem_t *mctx, controlkeylist_t *keyids) {
        isc_result_t result;
        cfg_parser_t *pctx = NULL;
        cfg_obj_t *config = NULL;
-       cfg_obj_t *key = NULL;
-       cfg_obj_t *algobj = NULL;
-       cfg_obj_t *secretobj = NULL;
-       char *algstr = NULL;
-       char *secretstr = 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;
        char secret[1024];
        isc_buffer_t b;
@@ -889,12 +891,13 @@ get_rndckey(isc_mem_t *mctx, controlkeylist_t *keyids) {
  * valid or both are NULL.
  */
 static void
-get_key_info(cfg_obj_t *config, cfg_obj_t *control,
-            cfg_obj_t **global_keylistp, cfg_obj_t **control_keylistp)
+get_key_info(const cfg_obj_t *config, const cfg_obj_t *control,
+            const cfg_obj_t **global_keylistp,
+            const cfg_obj_t **control_keylistp)
 {
        isc_result_t result;
-       cfg_obj_t *control_keylist = NULL;
-       cfg_obj_t *global_keylist = NULL;
+       const cfg_obj_t *control_keylist = NULL;
+       const cfg_obj_t *global_keylist = NULL;
 
        REQUIRE(global_keylistp != NULL && *global_keylistp == NULL);
        REQUIRE(control_keylistp != NULL && *control_keylistp == NULL);
@@ -913,15 +916,15 @@ get_key_info(cfg_obj_t *config, cfg_obj_t *control,
 }
 
 static void
-update_listener(ns_controls_t *cp,
-               controllistener_t **listenerp, cfg_obj_t *control,
-               cfg_obj_t *config, isc_sockaddr_t *addr,
-               ns_aclconfctx_t *aclconfctx, const char *socktext)
+update_listener(ns_controls_t *cp, controllistener_t **listenerp,
+               const cfg_obj_t *control, const cfg_obj_t *config,
+               isc_sockaddr_t *addr, ns_aclconfctx_t *aclconfctx,
+               const char *socktext)
 {
        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;
@@ -1031,14 +1034,15 @@ update_listener(ns_controls_t *cp,
 
 static void
 add_listener(ns_controls_t *cp, controllistener_t **listenerp,
-            cfg_obj_t *control, cfg_obj_t *config, isc_sockaddr_t *addr,
-            ns_aclconfctx_t *aclconfctx, const char *socktext)
+            const cfg_obj_t *control, const cfg_obj_t *config,
+            isc_sockaddr_t *addr, ns_aclconfctx_t *aclconfctx,
+            const char *socktext)
 {
        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;
 
@@ -1149,13 +1153,13 @@ add_listener(ns_controls_t *cp, controllistener_t **listenerp,
 }
 
 isc_result_t
-ns_controls_configure(ns_controls_t *cp, cfg_obj_t *config,
+ns_controls_configure(ns_controls_t *cp, const cfg_obj_t *config,
                      ns_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);
@@ -1177,8 +1181,8 @@ ns_controls_configure(ns_controls_t *cp, cfg_obj_t *config,
                for (element = cfg_list_first(controlslist);
                     element != NULL;
                     element = cfg_list_next(element)) {
-                       cfg_obj_t *controls;
-                       cfg_obj_t *inetcontrols = NULL;
+                       const cfg_obj_t *controls;
+                       const cfg_obj_t *inetcontrols = NULL;
 
                        controls = cfg_listelt_value(element);
                        (void)cfg_map_get(controls, "inet", &inetcontrols);
@@ -1188,9 +1192,9 @@ ns_controls_configure(ns_controls_t *cp, cfg_obj_t *config,
                        for (element2 = cfg_list_first(inetcontrols);
                             element2 != NULL;
                             element2 = cfg_list_next(element2)) {
-                               cfg_obj_t *control;
-                               cfg_obj_t *obj;
-                               isc_sockaddr_t *addr;
+                               const cfg_obj_t *control;
+                               const cfg_obj_t *obj;
+                               isc_sockaddr_t addr;
 
                                /*
                                 * The parser handles BIND 8 configuration file
@@ -1203,12 +1207,12 @@ ns_controls_configure(ns_controls_t *cp, cfg_obj_t *config,
                                control = cfg_listelt_value(element2);
 
                                obj = cfg_tuple_get(control, "address");
-                               addr = cfg_obj_assockaddr(obj);
-                               if (isc_sockaddr_getport(addr) == 0)
-                                       isc_sockaddr_setport(addr,
+                               addr = *cfg_obj_assockaddr(obj);
+                               if (isc_sockaddr_getport(&addr) == 0)
+                                       isc_sockaddr_setport(&addr,
                                                             NS_CONTROL_PORT);
 
-                               isc_sockaddr_format(addr, socktext,
+                               isc_sockaddr_format(&addr, socktext,
                                                    sizeof(socktext));
 
                                isc_log_write(ns_g_lctx,
@@ -1219,7 +1223,7 @@ ns_controls_configure(ns_controls_t *cp, cfg_obj_t *config,
                                              socktext);
 
                                update_listener(cp, &listener, control, config,
-                                               addr, aclconfctx, socktext);
+                                               &addr, aclconfctx, socktext);
 
                                if (listener != NULL)
                                        /*
@@ -1233,7 +1237,7 @@ ns_controls_configure(ns_controls_t *cp, cfg_obj_t *config,
                                         * This is a new listener.
                                         */
                                        add_listener(cp, &listener, control,
-                                                    config, addr, aclconfctx,
+                                                    config, &addr, aclconfctx,
                                                     socktext);
 
                                if (listener != NULL)
index 812657278485a5f2998413f7397d36dfcd478b2c..68fe4a0960002d1049d7575063184e720e8dc451 100644 (file)
@@ -15,7 +15,7 @@
  * PERFORMANCE OF THIS SOFTWARE.
  */
 
-/* $Id: aclconf.h,v 1.12.208.1 2004/03/06 10:21:23 marka Exp $ */
+/* $Id: aclconf.h,v 1.12.208.2 2006/02/28 06:32:53 marka Exp $ */
 
 #ifndef NS_ACLCONF_H
 #define NS_ACLCONF_H 1
@@ -49,8 +49,8 @@ ns_aclconfctx_destroy(ns_aclconfctx_t *ctx);
  */
 
 isc_result_t
-ns_acl_fromconfig(cfg_obj_t *caml,
-                 cfg_obj_t *cctx,
+ns_acl_fromconfig(const cfg_obj_t *caml,
+                 const cfg_obj_t *cctx,
                  ns_aclconfctx_t *ctx,
                  isc_mem_t *mctx,
                  dns_acl_t **target);
index b3b4f121606bbb4bc1848022543877c722ca6c5f..97afa9ad74ca047f6da86158b3ec0526f49e78bb 100644 (file)
@@ -15,7 +15,7 @@
  * PERFORMANCE OF THIS SOFTWARE.
  */
 
-/* $Id: config.h,v 1.4.12.4 2004/04/20 14:12:10 marka Exp $ */
+/* $Id: config.h,v 1.4.12.5 2006/02/28 06:32:53 marka Exp $ */
 
 #ifndef NAMED_CONFIG_H
 #define NAMED_CONFIG_H 1
@@ -29,27 +29,28 @@ isc_result_t
 ns_config_parsedefaults(cfg_parser_t *parser, cfg_obj_t **conf);
 
 isc_result_t
-ns_config_get(cfg_obj_t **maps, const char* name, cfg_obj_t **obj);
+ns_config_get(const cfg_obj_t **maps, const char* name, const cfg_obj_t **obj);
 
 isc_result_t
-ns_checknames_get(cfg_obj_t **maps, const char* name, cfg_obj_t **obj);
+ns_checknames_get(const cfg_obj_t **maps, const char* name,
+                 const cfg_obj_t **obj);
 
 int
-ns_config_listcount(cfg_obj_t *list);
+ns_config_listcount(const cfg_obj_t *list);
 
 isc_result_t
-ns_config_getclass(cfg_obj_t *classobj, dns_rdataclass_t defclass,
+ns_config_getclass(const cfg_obj_t *classobj, dns_rdataclass_t defclass,
                   dns_rdataclass_t *classp);
 
 isc_result_t
-ns_config_gettype(cfg_obj_t *typeobj, dns_rdatatype_t deftype,
+ns_config_gettype(const cfg_obj_t *typeobj, dns_rdatatype_t deftype,
                  dns_rdatatype_t *typep);
 
 dns_zonetype_t
-ns_config_getzonetype(cfg_obj_t *zonetypeobj);
+ns_config_getzonetype(const cfg_obj_t *zonetypeobj);
 
 isc_result_t
-ns_config_getiplist(cfg_obj_t *config, cfg_obj_t *list,
+ns_config_getiplist(const cfg_obj_t *config, const cfg_obj_t *list,
                    in_port_t defport, isc_mem_t *mctx,
                    isc_sockaddr_t **addrsp, isc_uint32_t *countp);
 
@@ -58,16 +59,16 @@ ns_config_putiplist(isc_mem_t *mctx, isc_sockaddr_t **addrsp,
                    isc_uint32_t count);
 
 isc_result_t
-ns_config_getipandkeylist(cfg_obj_t *config, cfg_obj_t *list, isc_mem_t *mctx,
-                         isc_sockaddr_t **addrsp, dns_name_t ***keys,
-                         isc_uint32_t *countp);
+ns_config_getipandkeylist(const cfg_obj_t *config, const cfg_obj_t *list,
+                         isc_mem_t *mctx, isc_sockaddr_t **addrsp,
+                         dns_name_t ***keys, isc_uint32_t *countp);
 
 void
 ns_config_putipandkeylist(isc_mem_t *mctx, isc_sockaddr_t **addrsp,
                          dns_name_t ***keys, isc_uint32_t count);
 
 isc_result_t
-ns_config_getport(cfg_obj_t *config, in_port_t *portp);
+ns_config_getport(const cfg_obj_t *config, in_port_t *portp);
 
 isc_result_t
 ns_config_getkeyalgorithm(const char *str, dns_name_t **name);
index bbb7d36cbbe76a3cd68719ae08ca3a0634a58862..4ae2ce70903709fb1f576482103a2405fe66ab68 100644 (file)
@@ -15,7 +15,7 @@
  * PERFORMANCE OF THIS SOFTWARE.
  */
 
-/* $Id: control.h,v 1.6.2.2.2.7 2004/09/03 03:43:32 marka Exp $ */
+/* $Id: control.h,v 1.6.2.2.2.8 2006/02/28 06:32:53 marka Exp $ */
 
 #ifndef NAMED_CONTROL_H
 #define NAMED_CONTROL_H 1
@@ -67,7 +67,7 @@ ns_controls_destroy(ns_controls_t **ctrlsp);
  */
 
 isc_result_t
-ns_controls_configure(ns_controls_t *controls, cfg_obj_t *config,
+ns_controls_configure(ns_controls_t *controls, const cfg_obj_t *config,
                      ns_aclconfctx_t *aclconfctx);
 /*
  * Configure zero or more command channels into 'controls'
index 2cc854839562543d1060ddcbc50e3f281efd1b6f..e0b14b181602aca5a8680525b5ef5efe6b6ba964 100644 (file)
@@ -15,7 +15,7 @@
  * PERFORMANCE OF THIS SOFTWARE.
  */
 
-/* $Id: globals.h,v 1.59.68.5 2004/03/08 04:04:20 marka Exp $ */
+/* $Id: globals.h,v 1.59.68.6 2006/02/28 06:32:53 marka Exp $ */
 
 #ifndef NAMED_GLOBALS_H
 #define NAMED_GLOBALS_H 1
@@ -75,7 +75,7 @@ EXTERN unsigned int           ns_g_debuglevel         INIT(0);
  * Current configuration information.
  */
 EXTERN cfg_obj_t *             ns_g_config             INIT(NULL);
-EXTERN cfg_obj_t *             ns_g_defaults           INIT(NULL);
+EXTERN const cfg_obj_t *       ns_g_defaults           INIT(NULL);
 EXTERN const char *            ns_g_conffile           INIT(NS_SYSCONFDIR
                                                             "/named.conf");
 EXTERN const char *            ns_g_keyfile            INIT(NS_SYSCONFDIR
index a6f7450c938684f4a2b0350ad3235868c0f28ce1..eb5c6130339a98f49fae2eb055c72e4adc8da995 100644 (file)
@@ -15,7 +15,7 @@
  * PERFORMANCE OF THIS SOFTWARE.
  */
 
-/* $Id: logconf.h,v 1.10.208.1 2004/03/06 10:21:24 marka Exp $ */
+/* $Id: logconf.h,v 1.10.208.2 2006/02/28 06:32:53 marka Exp $ */
 
 #ifndef NAMED_LOGCONF_H
 #define NAMED_LOGCONF_H 1
@@ -23,7 +23,7 @@
 #include <isc/log.h>
 
 isc_result_t
-ns_log_configure(isc_logconfig_t *logconf, cfg_obj_t *logstmt);
+ns_log_configure(isc_logconfig_t *logconf, const cfg_obj_t *logstmt);
 /*
  * Set up the logging configuration in '*logconf' according to
  * the named.conf data in 'logstmt'.
index 7ba857c04ed15ceff0d43e9dce3eb81a26cf2f96..d64f29f1da7e51b74312d842fbd230ce22b961d9 100644 (file)
@@ -15,7 +15,7 @@
  * PERFORMANCE OF THIS SOFTWARE.
  */
 
-/* $Id: lwresd.h,v 1.12.208.1 2004/03/06 10:21:25 marka Exp $ */
+/* $Id: lwresd.h,v 1.12.208.2 2006/02/28 06:32:53 marka Exp $ */
 
 #ifndef NAMED_LWRESD_H
 #define NAMED_LWRESD_H 1
@@ -56,7 +56,7 @@ struct ns_lwreslistener {
  * Configure lwresd.
  */
 isc_result_t
-ns_lwresd_configure(isc_mem_t *mctx, cfg_obj_t *config);
+ns_lwresd_configure(isc_mem_t *mctx, const cfg_obj_t *config);
 
 isc_result_t
 ns_lwresd_parseeresolvconf(isc_mem_t *mctx, cfg_parser_t *pctx,
@@ -72,7 +72,8 @@ ns_lwresd_shutdown(void);
  * Manager functions
  */
 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);
 
 void
 ns_lwdmanager_attach(ns_lwresd_t *source, ns_lwresd_t **targetp);
index 97eb2efce341c470c41c0bc51520335edfb5bc46..e919ec37350c03a48b4a900a7910a94104d5ef18 100644 (file)
@@ -15,7 +15,7 @@
  * PERFORMANCE OF THIS SOFTWARE.
  */
 
-/* $Id: server.h,v 1.58.2.1.10.11 2004/03/08 04:04:21 marka Exp $ */
+/* $Id: server.h,v 1.58.2.1.10.12 2006/02/28 06:32:53 marka Exp $ */
 
 #ifndef NAMED_SERVER_H
 #define NAMED_SERVER_H 1
@@ -208,6 +208,6 @@ ns_server_dumprecursing(ns_server_t *server);
  * Maintain a list of dispatches that require reserved ports.
  */
 void
-ns_add_reserved_dispatch(ns_server_t *server, isc_sockaddr_t *addr);
+ns_add_reserved_dispatch(ns_server_t *server, const isc_sockaddr_t *addr);
 
 #endif /* NAMED_SERVER_H */
index 88a149387795870306eb91a6868e24c9d23e3ab5..f3c79bf41889761b76a89afd5abe085829b8e239 100644 (file)
@@ -15,7 +15,7 @@
  * PERFORMANCE OF THIS SOFTWARE.
  */
 
-/* $Id: sortlist.h,v 1.4.208.1 2004/03/06 10:21:26 marka Exp $ */
+/* $Id: sortlist.h,v 1.4.208.2 2006/02/28 06:32:53 marka Exp $ */
 
 #ifndef NAMED_SORTLIST_H
 #define NAMED_SORTLIST_H 1
@@ -28,7 +28,7 @@
  * Type for callback functions that rank addresses.
  */
 typedef int 
-(*dns_addressorderfunc_t)(isc_netaddr_t *address, void *arg);
+(*dns_addressorderfunc_t)(const isc_netaddr_t *address, const void *arg);
 
 /*
  * Return value type for setup_sortlist.
@@ -40,7 +40,8 @@ typedef enum {
 } ns_sortlisttype_t;
 
 ns_sortlisttype_t
-ns_sortlist_setup(dns_acl_t *acl, isc_netaddr_t *clientaddr, void **argp);
+ns_sortlist_setup(dns_acl_t *acl, isc_netaddr_t *clientaddr,
+                 const void **argp);
 /*
  * Find the sortlist statement in 'acl' that applies to 'clientaddr', if any.
  *
@@ -55,14 +56,14 @@ ns_sortlist_setup(dns_acl_t *acl, isc_netaddr_t *clientaddr, void **argp);
  */
 
 int
-ns_sortlist_addrorder1(isc_netaddr_t *addr, void *arg);
+ns_sortlist_addrorder1(const isc_netaddr_t *addr, const void *arg);
 /*
  * Find the sort order of 'addr' in 'arg', the matching element
  * of a 1-element top-level sortlist statement.
  */
 
 int
-ns_sortlist_addrorder2(isc_netaddr_t *addr, void *arg);
+ns_sortlist_addrorder2(const isc_netaddr_t *addr, const void *arg);
 /*
  * Find the sort order of 'addr' in 'arg', a topology-like
  * ACL forming the second element in a 2-element top-level
@@ -72,7 +73,7 @@ ns_sortlist_addrorder2(isc_netaddr_t *addr, void *arg);
 void
 ns_sortlist_byaddrsetup(dns_acl_t *sortlist_acl, isc_netaddr_t *client_addr,
                        dns_addressorderfunc_t *orderp,
-                       void **argp);
+                       const void **argp);
 /*
  * Find the sortlist statement in 'acl' that applies to 'clientaddr', if any.
  * If a sortlist statement applies, return in '*orderp' a pointer to a function
index e3710eae3e00f749e6014a9c94e6c88f2c2de1dc..fb47a5e3ca2413ffb3877073c23f1c27aeb75ae8 100644 (file)
@@ -15,7 +15,7 @@
  * PERFORMANCE OF THIS SOFTWARE.
  */
 
-/* $Id: tkeyconf.h,v 1.9.208.1 2004/03/06 10:21:26 marka Exp $ */
+/* $Id: tkeyconf.h,v 1.9.208.2 2006/02/28 06:32:53 marka Exp $ */
 
 #ifndef NS_TKEYCONF_H
 #define NS_TKEYCONF_H 1
@@ -28,8 +28,8 @@
 ISC_LANG_BEGINDECLS
 
 isc_result_t
-ns_tkeyctx_fromconfig(cfg_obj_t *options, isc_mem_t *mctx, isc_entropy_t *ectx,
-                     dns_tkeyctx_t **tctxp);
+ns_tkeyctx_fromconfig(const cfg_obj_t *options, isc_mem_t *mctx,
+                     isc_entropy_t *ectx, dns_tkeyctx_t **tctxp);
 /*
  *     Create a TKEY context and configure it, including the default DH key
  *     and default domain, according to 'options'.
index ef4161ded8a15246f70314a75efa09ecae1368f5..0beee2b511a21d8928cb072f6bef5966166c14d5 100644 (file)
@@ -15,7 +15,7 @@
  * PERFORMANCE OF THIS SOFTWARE.
  */
 
-/* $Id: tsigconf.h,v 1.9.208.1 2004/03/06 10:21:26 marka Exp $ */
+/* $Id: tsigconf.h,v 1.9.208.2 2006/02/28 06:32:53 marka Exp $ */
 
 #ifndef NS_TSIGCONF_H
 #define NS_TSIGCONF_H 1
@@ -26,7 +26,7 @@
 ISC_LANG_BEGINDECLS
 
 isc_result_t
-ns_tsigkeyring_fromconfig(cfg_obj_t *config, cfg_obj_t *vconfig,
+ns_tsigkeyring_fromconfig(const cfg_obj_t *config, const cfg_obj_t *vconfig,
                          isc_mem_t *mctx, dns_tsig_keyring_t **ringp);
 /*
  * Create a TSIG key ring and configure it according to the 'key'
index 3b8f200dc79fb24255bf76a9605e4bcc33c94a89..66d862e8c19846f935620af1f94e444bb1f00c49 100644 (file)
@@ -15,7 +15,7 @@
  * PERFORMANCE OF THIS SOFTWARE.
  */
 
-/* $Id: zoneconf.h,v 1.16.2.2.8.1 2004/03/06 10:21:27 marka Exp $ */
+/* $Id: zoneconf.h,v 1.16.2.2.8.2 2006/02/28 06:32:53 marka Exp $ */
 
 #ifndef NS_ZONECONF_H
 #define NS_ZONECONF_H 1
@@ -30,8 +30,9 @@
 ISC_LANG_BEGINDECLS
 
 isc_result_t
-ns_zone_configure(cfg_obj_t *config, cfg_obj_t *vconfig, cfg_obj_t *zconfig,
-                 ns_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, ns_aclconfctx_t *ac,
+                 dns_zone_t *zone);
 /*
  * Configure or reconfigure a zone according to the named.conf
  * data in 'cctx' and 'czone'.
@@ -48,7 +49,7 @@ ns_zone_configure(cfg_obj_t *config, cfg_obj_t *vconfig, cfg_obj_t *zconfig,
  */
 
 isc_boolean_t
-ns_zone_reusable(dns_zone_t *zone, cfg_obj_t *zconfig);
+ns_zone_reusable(dns_zone_t *zone, const cfg_obj_t *zconfig);
 /*
  * If 'zone' can be safely reconfigured according to the configuration
  * data in 'zconfig', return ISC_TRUE.  If the configuration data is so
index 596d40166bb3b37559345d671986a1fa6eca62f5..45f024f347855839d9e08f736f464f2c5070375f 100644 (file)
@@ -15,7 +15,7 @@
  * PERFORMANCE OF THIS SOFTWARE.
  */
 
-/* $Id: logconf.c,v 1.30.2.3.10.2 2004/03/06 10:21:18 marka Exp $ */
+/* $Id: logconf.c,v 1.30.2.3.10.3 2006/02/28 06:32:53 marka Exp $ */
 
 #include <config.h>
 
  * 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);
@@ -68,8 +68,8 @@ category_fromconf(cfg_obj_t *ccat, isc_logconfig_t *lctx) {
             element != NULL;
             element = cfg_list_next(element))
        {
-               cfg_obj_t *channel = cfg_listelt_value(element);
-               char *channelname = cfg_obj_asstring(channel);
+               const cfg_obj_t *channel = cfg_listelt_value(element);
+               const char *channelname = cfg_obj_asstring(channel);
 
                result = isc_log_usechannel(lctx, channelname, category,
                                            module);
@@ -89,18 +89,18 @@ category_fromconf(cfg_obj_t *ccat, isc_logconfig_t *lctx) {
  * in 'cchan' and add it to 'lctx'.
  */
 static isc_result_t
-channel_fromconf(cfg_obj_t *channel, isc_logconfig_t *lctx) {
+channel_fromconf(const cfg_obj_t *channel, isc_logconfig_t *lctx) {
        isc_result_t result;
        isc_logdestination_t dest;
        unsigned int type;
        unsigned int flags = 0;
        int level;
        const char *channelname;
-       cfg_obj_t *fileobj = NULL;
-       cfg_obj_t *syslogobj = NULL;
-       cfg_obj_t *nullobj = NULL;
-       cfg_obj_t *stderrobj = NULL;
-       cfg_obj_t *severity = NULL;
+       const cfg_obj_t *fileobj = NULL;
+       const cfg_obj_t *syslogobj = NULL;
+       const cfg_obj_t *nullobj = NULL;
+       const cfg_obj_t *stderrobj = NULL;
+       const cfg_obj_t *severity = NULL;
        int i;
 
        channelname = cfg_obj_asstring(cfg_map_getname(channel));
@@ -130,9 +130,10 @@ channel_fromconf(cfg_obj_t *channel, isc_logconfig_t *lctx) {
        type = ISC_LOG_TONULL;
        
        if (fileobj != NULL) {
-               cfg_obj_t *pathobj = cfg_tuple_get(fileobj, "file");
-               cfg_obj_t *sizeobj = cfg_tuple_get(fileobj, "size");
-               cfg_obj_t *versionsobj = cfg_tuple_get(fileobj, "versions");
+               const cfg_obj_t *pathobj = cfg_tuple_get(fileobj, "file");
+               const cfg_obj_t *sizeobj = cfg_tuple_get(fileobj, "size");
+               const cfg_obj_t *versionsobj =
+                                cfg_tuple_get(fileobj, "versions");
                isc_int32_t versions = ISC_LOG_ROLLNEVER;
                isc_offset_t size = 0;
 
@@ -157,7 +158,7 @@ channel_fromconf(cfg_obj_t *channel, isc_logconfig_t *lctx) {
                type = ISC_LOG_TOSYSLOG;
 
                if (cfg_obj_isstring(syslogobj)) {
-                       char *facilitystr = cfg_obj_asstring(syslogobj);
+                       const char *facilitystr = cfg_obj_asstring(syslogobj);
                        (void)isc_syslog_facilityfromstring(facilitystr,
                                                            &facility);
                }
@@ -174,9 +175,9 @@ channel_fromconf(cfg_obj_t *channel, isc_logconfig_t *lctx) {
         * Munge flags.
         */
        {
-               cfg_obj_t *printcat = NULL;
-               cfg_obj_t *printsev = NULL;
-               cfg_obj_t *printtime = NULL;
+               const cfg_obj_t *printcat = NULL;
+               const cfg_obj_t *printsev = NULL;
+               const cfg_obj_t *printtime = NULL;
 
                (void)cfg_map_get(channel, "print-category", &printcat);
                (void)cfg_map_get(channel, "print-severity", &printsev);
@@ -193,7 +194,7 @@ channel_fromconf(cfg_obj_t *channel, isc_logconfig_t *lctx) {
        level = ISC_LOG_INFO;
        if (cfg_map_get(channel, "severity", &severity) == ISC_R_SUCCESS) {
                if (cfg_obj_isstring(severity)) {
-                       char *str = cfg_obj_asstring(severity);
+                       const char *str = cfg_obj_asstring(severity);
                        if (strcasecmp(str, "critical") == 0)
                                level = ISC_LOG_CRITICAL;
                        else if (strcasecmp(str, "error") == 0)
@@ -242,13 +243,14 @@ channel_fromconf(cfg_obj_t *channel, isc_logconfig_t *lctx) {
 }
 
 isc_result_t
-ns_log_configure(isc_logconfig_t *logconf, cfg_obj_t *logstmt) {
+ns_log_configure(isc_logconfig_t *logconf, const cfg_obj_t *logstmt) {
        isc_result_t result;
-       cfg_obj_t *channels = NULL;
-       cfg_obj_t *categories = NULL;
-       cfg_listelt_t *element;
+       const cfg_obj_t *channels = NULL;
+       const cfg_obj_t *categories = NULL;
+       const cfg_listelt_t *element;
        isc_boolean_t default_set = ISC_FALSE;
        isc_boolean_t unmatched_set = ISC_FALSE;
+       const cfg_obj_t *catname;
 
        CHECK(ns_log_setdefaultchannels(logconf));
 
@@ -257,7 +259,7 @@ ns_log_configure(isc_logconfig_t *logconf, cfg_obj_t *logstmt) {
             element != NULL;
             element = cfg_list_next(element))
        {
-               cfg_obj_t *channel = cfg_listelt_value(element);
+               const cfg_obj_t *channel = cfg_listelt_value(element);
                CHECK(channel_fromconf(channel, logconf));
        }
 
@@ -266,15 +268,15 @@ ns_log_configure(isc_logconfig_t *logconf, cfg_obj_t *logstmt) {
             element != NULL;
             element = cfg_list_next(element))
        {
-               cfg_obj_t *category = cfg_listelt_value(element);
+               const cfg_obj_t *category = cfg_listelt_value(element);
                CHECK(category_fromconf(category, logconf));
                if (!default_set) {
-                       cfg_obj_t *catname = cfg_tuple_get(category, "name");
+                       catname = cfg_tuple_get(category, "name");
                        if (strcmp(cfg_obj_asstring(catname), "default") == 0)
                                default_set = ISC_TRUE;
                }
                if (!unmatched_set) {
-                       cfg_obj_t *catname = cfg_tuple_get(category, "name");
+                       catname = cfg_tuple_get(category, "name");
                        if (strcmp(cfg_obj_asstring(catname), "unmatched") == 0)
                                unmatched_set = ISC_TRUE;
                }
index 030a77ae7864891e9601004d27c8c5f3f1d7c2e3..5c821bdbc034eb6972f7123d789a95591b5b6e03 100644 (file)
@@ -15,7 +15,7 @@
  * PERFORMANCE OF THIS SOFTWARE.
  */
 
-/* $Id: lwdgabn.c,v 1.13.12.3 2004/03/08 04:04:19 marka Exp $ */
+/* $Id: lwdgabn.c,v 1.13.12.4 2006/02/28 06:32:53 marka Exp $ */
 
 #include <config.h>
 
@@ -120,7 +120,7 @@ sort_addresses(ns_lwdclient_t *client) {
        rankedaddress *addrs;
        isc_netaddr_t remote;
        dns_addressorderfunc_t order;
-       void *arg;
+       const void *arg;
        ns_lwresd_t *lwresd = client->clientmgr->listener->manager;
        unsigned int i;
        isc_result_t result;
index 441082e7849bcb07698a465b12ad1cab9ec5a888..e48822f7119586556f210b79aacf9fa0ddffad53 100644 (file)
@@ -15,7 +15,7 @@
  * PERFORMANCE OF THIS SOFTWARE.
  */
 
-/* $Id: lwresd.c,v 1.37.2.2.2.7 2006/01/04 23:50:19 marka Exp $ */
+/* $Id: lwresd.c,v 1.37.2.2.2.8 2006/02/28 06:32:53 marka Exp $ */
 
 /*
  * Main program for the Lightweight Resolver Daemon.
@@ -285,14 +285,14 @@ ns_lwresd_parseeresolvconf(isc_mem_t *mctx, cfg_parser_t *pctx,
  * Handle lwresd manager objects
  */
 isc_result_t
-ns_lwdmanager_create(isc_mem_t *mctx, cfg_obj_t *lwres,
+ns_lwdmanager_create(isc_mem_t *mctx, const cfg_obj_t *lwres,
                     ns_lwresd_t **lwresdp)
 {
        ns_lwresd_t *lwresd;
        const char *vname;
        dns_rdataclass_t vclass;
-       cfg_obj_t *obj, *viewobj, *searchobj;
-       cfg_listelt_t *element;
+       const cfg_obj_t *obj, *viewobj, *searchobj;
+       const cfg_listelt_t *element;
        isc_result_t result;
 
        INSIST(lwresdp != NULL && *lwresdp == NULL);
@@ -356,8 +356,8 @@ ns_lwdmanager_create(isc_mem_t *mctx, cfg_obj_t *lwres,
                     element != NULL;
                     element = cfg_list_next(element))
                {
-                       cfg_obj_t *search;
-                       char *searchstr;
+                       const cfg_obj_t *search;
+                       const char *searchstr;
                        isc_buffer_t namebuf;
                        dns_fixedname_t fname;
                        dns_name_t *name;
@@ -745,11 +745,11 @@ configure_listener(isc_sockaddr_t *address, ns_lwresd_t *lwresd,
 }
 
 isc_result_t
-ns_lwresd_configure(isc_mem_t *mctx, cfg_obj_t *config) {
-       cfg_obj_t *lwreslist = NULL;
-       cfg_obj_t *lwres = NULL;
-       cfg_obj_t *listenerslist = NULL;
-       cfg_listelt_t *element = NULL;
+ns_lwresd_configure(isc_mem_t *mctx, const cfg_obj_t *config) {
+       const cfg_obj_t *lwreslist = NULL;
+       const cfg_obj_t *lwres = NULL;
+       const cfg_obj_t *listenerslist = NULL;
+       const cfg_listelt_t *element = NULL;
        ns_lwreslistener_t *listener;
        ns_lwreslistenerlist_t newlisteners;
        isc_result_t result;
index 4e8185e8d22c5d30d125006efb71f990d719e5d2..d4e4645db2737eeace1061f4123dd4fcb38a0467 100644 (file)
@@ -15,7 +15,7 @@
  * PERFORMANCE OF THIS SOFTWARE.
  */
 
-/* $Id: query.c,v 1.198.2.13.4.38 2006/02/03 23:51:37 marka Exp $ */
+/* $Id: query.c,v 1.198.2.13.4.39 2006/02/28 06:32:53 marka Exp $ */
 
 #include <config.h>
 
@@ -2182,7 +2182,7 @@ do { \
  *     ISC_R_NOTIMPLEMENTED    The rdata is not a known address type.
  */
 static isc_result_t
-rdata_tonetaddr(dns_rdata_t *rdata, isc_netaddr_t *netaddr) {
+rdata_tonetaddr(const dns_rdata_t *rdata, isc_netaddr_t *netaddr) {
        struct in_addr ina;
        struct in6_addr in6a;
        
@@ -2208,7 +2208,7 @@ rdata_tonetaddr(dns_rdata_t *rdata, isc_netaddr_t *netaddr) {
  * sortlist statement.
  */
 static int
-query_sortlist_order_2element(dns_rdata_t *rdata, void *arg) {
+query_sortlist_order_2element(const dns_rdata_t *rdata, const void *arg) {
        isc_netaddr_t netaddr;
 
        if (rdata_tonetaddr(rdata, &netaddr) != ISC_R_SUCCESS)
@@ -2221,7 +2221,7 @@ query_sortlist_order_2element(dns_rdata_t *rdata, void *arg) {
  * of a 1-element top-level sortlist statement.
  */
 static int
-query_sortlist_order_1element(dns_rdata_t *rdata, void *arg) {
+query_sortlist_order_1element(const dns_rdata_t *rdata, const void *arg) {
        isc_netaddr_t netaddr;
 
        if (rdata_tonetaddr(rdata, &netaddr) != ISC_R_SUCCESS)
@@ -2237,7 +2237,7 @@ static void
 setup_query_sortlist(ns_client_t *client) {
        isc_netaddr_t netaddr;
        dns_rdatasetorderfunc_t order = NULL;
-       void *order_arg = NULL;
+       const void *order_arg = NULL;
        
        isc_netaddr_fromsockaddr(&netaddr, &client->peeraddr);
        switch (ns_sortlist_setup(client->view->sortlist,
index df94ac0d3bd8aa211088acb5070810c37beae58e..0c24f7572eeafaefeabbadb9072e1b92292a9069 100644 (file)
@@ -15,7 +15,7 @@
  * PERFORMANCE OF THIS SOFTWARE.
  */
 
-/* $Id: server.c,v 1.339.2.15.2.68 2006/02/26 23:03:52 marka Exp $ */
+/* $Id: server.c,v 1.339.2.15.2.69 2006/02/28 06:32:53 marka Exp $ */
 
 #include <config.h>
 
@@ -167,25 +167,25 @@ static void
 ns_server_reload(isc_task_t *task, isc_event_t *event);
 
 static isc_result_t
-ns_listenelt_fromconfig(cfg_obj_t *listener, cfg_obj_t *config,
+ns_listenelt_fromconfig(const cfg_obj_t *listener, const cfg_obj_t *config,
                        ns_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,
                         ns_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,
               ns_aclconfctx_t *aclconf);
 
 static void
@@ -197,13 +197,13 @@ end_reserved_dispatches(ns_server_t *server, isc_boolean_t all);
  * (for a global default).
  */
 static isc_result_t
-configure_view_acl(cfg_obj_t *vconfig, cfg_obj_t *config,
+configure_view_acl(const cfg_obj_t *vconfig, const cfg_obj_t *config,
                   const char *aclname, ns_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)
@@ -211,7 +211,7 @@ configure_view_acl(cfg_obj_t *vconfig, cfg_obj_t *config,
        if (vconfig != NULL)
                maps[i++] = cfg_tuple_get(vconfig, "options");
        if (config != NULL) {
-               cfg_obj_t *options = NULL;
+               const cfg_obj_t *options = NULL;
                (void)cfg_map_get(config, "options", &options);
                if (options != NULL)
                        maps[i++] = options;
@@ -231,13 +231,13 @@ configure_view_acl(cfg_obj_t *vconfig, cfg_obj_t *config,
 }
 
 static isc_result_t
-configure_view_dnsseckey(cfg_obj_t *vconfig, cfg_obj_t *key,
+configure_view_dnsseckey(const cfg_obj_t *vconfig, const cfg_obj_t *key,
                         dns_keytable_t *keytable, isc_mem_t *mctx)
 {
        dns_rdataclass_t viewclass;
        dns_rdata_dnskey_t keystruct;
        isc_uint32_t flags, proto, alg;
-       char *keystr, *keynamestr;
+       const char *keystr, *keynamestr;
        unsigned char keydata[4096];
        isc_buffer_t keydatabuf;
        unsigned char rrdata[4096];
@@ -258,7 +258,7 @@ configure_view_dnsseckey(cfg_obj_t *vconfig, cfg_obj_t *key,
        if (vconfig == NULL)
                viewclass = dns_rdataclass_in;
        else {
-               cfg_obj_t *classobj = cfg_tuple_get(vconfig, "class");
+               const cfg_obj_t *classobj = cfg_tuple_get(vconfig, "class");
                CHECK(ns_config_getclass(classobj, dns_rdataclass_in,
                                         &viewclass));
        }
@@ -334,15 +334,15 @@ configure_view_dnsseckey(cfg_obj_t *vconfig, cfg_obj_t *key,
  * from 'vconfig' and 'config'.  The variable to be configured is '*target'.
  */
 static isc_result_t
-configure_view_dnsseckeys(cfg_obj_t *vconfig, cfg_obj_t *config,
+configure_view_dnsseckeys(const cfg_obj_t *vconfig, const cfg_obj_t *config,
                          isc_mem_t *mctx, dns_keytable_t **target)
 {
        isc_result_t result;
-       cfg_obj_t *keys = NULL;
-       cfg_obj_t *voptions = NULL;
-       cfg_listelt_t *element, *element2;
-       cfg_obj_t *keylist;
-       cfg_obj_t *key;
+       const cfg_obj_t *keys = NULL;
+       const cfg_obj_t *voptions = NULL;
+       const cfg_listelt_t *element, *element2;
+       const cfg_obj_t *keylist;
+       const cfg_obj_t *key;
        dns_keytable_t *keytable = NULL;
 
        CHECK(dns_keytable_create(mctx, &keytable));
@@ -381,10 +381,10 @@ configure_view_dnsseckeys(cfg_obj_t *vconfig, cfg_obj_t *config,
 }
 
 static isc_result_t
-mustbesecure(cfg_obj_t *mbs, dns_resolver_t *resolver)
+mustbesecure(const cfg_obj_t *mbs, dns_resolver_t *resolver)
 {
-       cfg_listelt_t *element;
-       cfg_obj_t *obj;
+       const cfg_listelt_t *element;
+       const cfg_obj_t *obj;
        const char *str;
        dns_fixedname_t fixed;
        dns_name_t *name;
@@ -418,14 +418,14 @@ mustbesecure(cfg_obj_t *mbs, dns_resolver_t *resolver)
  * Get a dispatch appropriate for the resolver of a given view.
  */
 static isc_result_t
-get_view_querysource_dispatch(cfg_obj_t **maps,
+get_view_querysource_dispatch(const cfg_obj_t **maps,
                              int af, dns_dispatch_t **dispatchp)
 {
        isc_result_t result;
        dns_dispatch_t *disp;
        isc_sockaddr_t sa;
        unsigned int attrs, attrmask;
-       cfg_obj_t *obj = NULL;
+       const cfg_obj_t *obj = NULL;
 
        /*
         * Make compiler happy.
@@ -516,10 +516,10 @@ get_view_querysource_dispatch(cfg_obj_t **maps,
 }
 
 static isc_result_t
-configure_order(dns_order_t *order, cfg_obj_t *ent) {
+configure_order(dns_order_t *order, const cfg_obj_t *ent) {
        dns_rdataclass_t rdclass;
        dns_rdatatype_t rdtype;
-       cfg_obj_t *obj;
+       const cfg_obj_t *obj;
        dns_fixedname_t fixed;
        unsigned int mode = 0;
        const char *str;
@@ -580,12 +580,12 @@ configure_order(dns_order_t *order, cfg_obj_t *ent) {
 }
 
 static isc_result_t
-configure_peer(cfg_obj_t *cpeer, isc_mem_t *mctx, dns_peer_t **peerp) {
-       isc_sockaddr_t *sa;
+configure_peer(const cfg_obj_t *cpeer, isc_mem_t *mctx, dns_peer_t **peerp) {
+       const isc_sockaddr_t *sa;
        isc_netaddr_t na;
        dns_peer_t *peer;
-       cfg_obj_t *obj;
-       char *str;
+       const cfg_obj_t *obj;
+       const char *str;
        isc_result_t result;
 
        sa = cfg_obj_assockaddr(cfg_map_getname(cpeer));
@@ -663,10 +663,10 @@ configure_peer(cfg_obj_t *cpeer, isc_mem_t *mctx, dns_peer_t **peerp) {
 }
 
 static isc_result_t
-disable_algorithms(cfg_obj_t *disabled, dns_resolver_t *resolver) {
+disable_algorithms(const cfg_obj_t *disabled, dns_resolver_t *resolver) {
        isc_result_t result;
-       cfg_obj_t *algorithms;
-       cfg_listelt_t *element;
+       const cfg_obj_t *algorithms;
+       const cfg_listelt_t *element;
        const char *str;
        dns_fixedname_t fixed;
        dns_name_t *name;
@@ -687,7 +687,7 @@ disable_algorithms(cfg_obj_t *disabled, dns_resolver_t *resolver) {
                isc_textregion_t r;
                dns_secalg_t alg;
 
-               r.base = cfg_obj_asstring(cfg_listelt_value(element));
+               DE_CONST(cfg_obj_asstring(cfg_listelt_value(element)), r.base);
                r.length = strlen(r.base);
 
                result = dns_secalg_fromtext(&alg, &r);
@@ -716,21 +716,21 @@ disable_algorithms(cfg_obj_t *disabled, dns_resolver_t *resolver) {
  * 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, ns_aclconfctx_t *actx,
+configure_view(dns_view_t *view, const cfg_obj_t *config,
+              const cfg_obj_t *vconfig, isc_mem_t *mctx, ns_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;
-       cfg_obj_t *disabled;
-       cfg_obj_t *obj;
-       cfg_listelt_t *element;
+       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;
+       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;
@@ -791,7 +791,7 @@ configure_view(dns_view_t *view, cfg_obj_t *config, cfg_obj_t *vconfig,
             element != NULL;
             element = cfg_list_next(element))
        {
-               cfg_obj_t *zconfig = cfg_listelt_value(element);
+               const cfg_obj_t *zconfig = cfg_listelt_value(element);
                CHECK(configure_zone(config, zconfig, vconfig, mctx, view,
                                     actx));
        }
@@ -1017,8 +1017,8 @@ configure_view(dns_view_t *view, cfg_obj_t *config, cfg_obj_t *vconfig,
         * Configure the view's peer list.
         */
        {
-               cfg_obj_t *peers = NULL;
-               cfg_listelt_t *element;
+               const cfg_obj_t *peers = NULL;
+               const cfg_listelt_t *element;
                dns_peerlist_t *newpeers = NULL;
 
                (void)ns_config_get(cfgmaps, "server", &peers);
@@ -1027,7 +1027,7 @@ configure_view(dns_view_t *view, cfg_obj_t *config, cfg_obj_t *vconfig,
                     element != NULL;
                     element = cfg_list_next(element))
                {
-                       cfg_obj_t *cpeer = cfg_listelt_value(element);
+                       const cfg_obj_t *cpeer = cfg_listelt_value(element);
                        dns_peer_t *peer;
 
                        CHECK(configure_peer(cpeer, mctx, &peer));
@@ -1042,8 +1042,8 @@ configure_view(dns_view_t *view, cfg_obj_t *config, cfg_obj_t *vconfig,
         *      Configure the views rrset-order.
         */
        {
-               cfg_obj_t *rrsetorder = NULL;
-               cfg_listelt_t *element;
+               const cfg_obj_t *rrsetorder = NULL;
+               const cfg_listelt_t *element;
 
                (void)ns_config_get(maps, "rrset-order", &rrsetorder);
                CHECK(dns_order_create(mctx, &order));
@@ -1051,7 +1051,7 @@ configure_view(dns_view_t *view, cfg_obj_t *config, cfg_obj_t *vconfig,
                     element != NULL;
                     element = cfg_list_next(element))
                {
-                       cfg_obj_t *ent = cfg_listelt_value(element);
+                       const cfg_obj_t *ent = cfg_listelt_value(element);
 
                        CHECK(configure_order(order, ent));
                }
@@ -1274,8 +1274,8 @@ configure_view(dns_view_t *view, cfg_obj_t *config, cfg_obj_t *vconfig,
                        dns_fixedname_t fixed;
                        dns_name_t *name;
                        isc_buffer_t b;
-                       char *str;
-                       cfg_obj_t *exclude;
+                       const char *str;
+                       const cfg_obj_t *exclude;
 
                        dns_fixedname_init(&fixed);
                        name = dns_fixedname_name(&fixed);
@@ -1329,12 +1329,12 @@ configure_hints(dns_view_t *view, const char *filename) {
 }
 
 static isc_result_t
-configure_alternates(cfg_obj_t *config, dns_view_t *view,
-                    cfg_obj_t *alternates)
+configure_alternates(const cfg_obj_t *config, dns_view_t *view,
+                    const cfg_obj_t *alternates)
 {
-       cfg_obj_t *portobj;
-       cfg_obj_t *addresses;
-       cfg_listelt_t *element;
+       const cfg_obj_t *portobj;
+       const cfg_obj_t *addresses;
+       const cfg_listelt_t *element;
        isc_result_t result = ISC_R_SUCCESS;
        in_port_t port;
 
@@ -1367,14 +1367,14 @@ configure_alternates(cfg_obj_t *config, dns_view_t *view,
             element != NULL;
             element = cfg_list_next(element))
        {
-               cfg_obj_t *alternate = cfg_listelt_value(element);
+               const cfg_obj_t *alternate = cfg_listelt_value(element);
                isc_sockaddr_t sa;
 
                if (!cfg_obj_issockaddr(alternate)) {
                        dns_fixedname_t fixed;
                        dns_name_t *name;
-                       char *str = cfg_obj_asstring(cfg_tuple_get(alternate,
-                                                                  "name"));
+                       const char *str = cfg_obj_asstring(cfg_tuple_get(
+                                                          alternate, "name"));
                        isc_buffer_t buffer;
                        in_port_t myport = port;
 
@@ -1414,12 +1414,12 @@ configure_alternates(cfg_obj_t *config, dns_view_t *view,
 }
 
 static isc_result_t
-configure_forward(cfg_obj_t *config, dns_view_t *view, dns_name_t *origin,
-                 cfg_obj_t *forwarders, cfg_obj_t *forwardtype)
+configure_forward(const cfg_obj_t *config, dns_view_t *view, dns_name_t *origin,
+                 const cfg_obj_t *forwarders, const cfg_obj_t *forwardtype)
 {
-       cfg_obj_t *portobj;
-       cfg_obj_t *faddresses;
-       cfg_listelt_t *element;
+       const cfg_obj_t *portobj;
+       const cfg_obj_t *faddresses;
+       const cfg_listelt_t *element;
        dns_fwdpolicy_t fwdpolicy = dns_fwdpolicy_none;
        isc_sockaddrlist_t addresses;
        isc_sockaddr_t *sa;
@@ -1457,7 +1457,7 @@ configure_forward(cfg_obj_t *config, dns_view_t *view, dns_name_t *origin,
             element != NULL;
             element = cfg_list_next(element))
        {
-               cfg_obj_t *forwarder = cfg_listelt_value(element);
+               const cfg_obj_t *forwarder = cfg_listelt_value(element);
                sa = isc_mem_get(view->mctx, sizeof(isc_sockaddr_t));
                if (sa == NULL) {
                        result = ISC_R_NOMEMORY;
@@ -1480,7 +1480,7 @@ configure_forward(cfg_obj_t *config, dns_view_t *view, dns_name_t *origin,
                if (forwardtype == NULL)
                        fwdpolicy = dns_fwdpolicy_first;
                else {
-                       char *forwardstr = cfg_obj_asstring(forwardtype);
+                       const char *forwardstr = cfg_obj_asstring(forwardtype);
                        if (strcasecmp(forwardstr, "first") == 0)
                                fwdpolicy = dns_fwdpolicy_first;
                        else if (strcasecmp(forwardstr, "only") == 0)
@@ -1522,14 +1522,16 @@ configure_forward(cfg_obj_t *config, dns_view_t *view, dns_name_t *origin,
  * The view created is attached to '*viewp'.
  */
 static isc_result_t
-create_view(cfg_obj_t *vconfig, dns_viewlist_t *viewlist, dns_view_t **viewp) {
+create_view(const cfg_obj_t *vconfig, dns_viewlist_t *viewlist,
+           dns_view_t **viewp)
+{
        isc_result_t result;
        const char *viewname;
        dns_rdataclass_t viewclass;
        dns_view_t *view = NULL;
 
        if (vconfig != NULL) {
-               cfg_obj_t *classobj = NULL;
+               const cfg_obj_t *classobj = NULL;
 
                viewname = cfg_obj_asstring(cfg_tuple_get(vconfig, "name"));
                classobj = cfg_tuple_get(vconfig, "class");
@@ -1559,19 +1561,19 @@ create_view(cfg_obj_t *vconfig, dns_viewlist_t *viewlist, dns_view_t **viewp) {
  * Configure or reconfigure a zone.
  */
 static isc_result_t
-configure_zone(cfg_obj_t *config, cfg_obj_t *zconfig, cfg_obj_t *vconfig,
-              isc_mem_t *mctx, dns_view_t *view,
+configure_zone(const cfg_obj_t *config, const cfg_obj_t *zconfig,
+              const cfg_obj_t *vconfig, isc_mem_t *mctx, dns_view_t *view,
               ns_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;
@@ -1628,7 +1630,7 @@ configure_zone(cfg_obj_t *config, cfg_obj_t *zconfig, cfg_obj_t *vconfig,
         * configure it and return.
         */
        if (strcasecmp(ztypestr, "hint") == 0) {
-               cfg_obj_t *fileobj = NULL;
+               const cfg_obj_t *fileobj = NULL;
                if (cfg_map_get(zoptions, "file", &fileobj) != ISC_R_SUCCESS) {
                        isc_log_write(ns_g_lctx, NS_LOGCATEGORY_GENERAL,
                                      NS_LOGMODULE_SERVER, ISC_LOG_ERROR,
@@ -1638,7 +1640,7 @@ configure_zone(cfg_obj_t *config, cfg_obj_t *zconfig, cfg_obj_t *vconfig,
                        goto cleanup;
                }
                if (dns_name_equal(origin, dns_rootname)) {
-                       char *hintsfile = cfg_obj_asstring(fileobj);
+                       const char *hintsfile = cfg_obj_asstring(fileobj);
 
                        result = configure_hints(view, hintsfile);
                        if (result != ISC_R_SUCCESS) {
@@ -1794,9 +1796,10 @@ configure_zone(cfg_obj_t *config, cfg_obj_t *zconfig, cfg_obj_t *vconfig,
  * Configure a single server quota.
  */
 static void
-configure_server_quota(cfg_obj_t **maps, const char *name, isc_quota_t *quota)
+configure_server_quota(const cfg_obj_t **maps, const char *name,
+                      isc_quota_t *quota)
 {
-       cfg_obj_t *obj = NULL;
+       const cfg_obj_t *obj = NULL;
        isc_result_t result;
 
        result = ns_config_get(maps, name, &obj);
@@ -1809,9 +1812,9 @@ configure_server_quota(cfg_obj_t **maps, const char *name, isc_quota_t *quota)
  * parsed.  This can be extended to support other options if necessary.
  */
 static isc_result_t
-directory_callback(const char *clausename, cfg_obj_t *obj, void *arg) {
+directory_callback(const char *clausename, const cfg_obj_t *obj, void *arg) {
        isc_result_t result;
-       char *directory;
+       const char *directory;
 
        REQUIRE(strcasecmp("directory", clausename) == 0);
 
@@ -2047,7 +2050,7 @@ setstring(ns_server_t *server, char **field, const char *value) {
  * or NULL if whether 'obj' is a string or void value, respectively.
  */
 static isc_result_t
-setoptstring(ns_server_t *server, char **field, cfg_obj_t *obj) {
+setoptstring(ns_server_t *server, char **field, const cfg_obj_t *obj) {
        if (cfg_obj_isvoid(obj))
                return (setstring(server, field, NULL));
        else
@@ -2055,11 +2058,12 @@ setoptstring(ns_server_t *server, char **field, cfg_obj_t *obj) {
 }
 
 static void
-set_limit(cfg_obj_t **maps, const char *configname, const char *description,
-         isc_resource_t resourceid, isc_resourcevalue_t defaultvalue)
+set_limit(const cfg_obj_t **maps, const char *configname,
+         const char *description, isc_resource_t resourceid,
+         isc_resourcevalue_t defaultvalue)
 {
-       cfg_obj_t *obj = NULL;
-       char *resource;
+       const cfg_obj_t *obj = NULL;
+       const char *resource;
        isc_resourcevalue_t value;
        isc_result_t result;
 
@@ -2090,7 +2094,7 @@ set_limit(cfg_obj_t **maps, const char *configname, const char *description,
                  ns_g_init ## resource)
 
 static void
-set_limits(cfg_obj_t **maps) {
+set_limits(const cfg_obj_t **maps) {
        SETLIMIT("stacksize", stacksize, "stack size");
        SETLIMIT("datasize", datasize, "data size");
        SETLIMIT("coresize", coresize, "core size");
@@ -2099,15 +2103,15 @@ set_limits(cfg_obj_t **maps) {
 
 static isc_result_t
 portlist_fromconf(dns_portlist_t *portlist, unsigned int family,
-                 cfg_obj_t *ports)
+                 const cfg_obj_t *ports)
 {
-       cfg_listelt_t *element;
+       const cfg_listelt_t *element;
        isc_result_t result = ISC_R_SUCCESS;
 
        for (element = cfg_list_first(ports);
             element != NULL;
             element = cfg_list_next(element)) {
-               cfg_obj_t *obj = cfg_listelt_value(element);
+               const cfg_obj_t *obj = cfg_listelt_value(element);
                in_port_t port = (in_port_t)cfg_obj_asuint32(obj);
                
                result = dns_portlist_add(portlist, family, port);
@@ -2124,13 +2128,13 @@ load_configuration(const char *filename, ns_server_t *server,
        isc_result_t result;
        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;
@@ -2317,7 +2321,7 @@ load_configuration(const char *filename, ns_server_t *server,
         * statement.
         */
        {
-               cfg_obj_t *clistenon = NULL;
+               const cfg_obj_t *clistenon = NULL;
                ns_listenlist_t *listenon = NULL;
 
                clistenon = NULL;
@@ -2351,7 +2355,7 @@ load_configuration(const char *filename, ns_server_t *server,
         * Ditto for IPv6.
         */
        {
-               cfg_obj_t *clistenon = NULL;
+               const cfg_obj_t *clistenon = NULL;
                ns_listenlist_t *listenon = NULL;
 
                if (options != NULL)
@@ -2436,7 +2440,7 @@ load_configuration(const char *filename, ns_server_t *server,
             element != NULL;
             element = cfg_list_next(element))
        {
-               cfg_obj_t *vconfig = cfg_listelt_value(element);
+               const cfg_obj_t *vconfig = cfg_listelt_value(element);
                view = NULL;
 
                CHECK(create_view(vconfig, &viewlist, &view));
@@ -2476,7 +2480,7 @@ load_configuration(const char *filename, ns_server_t *server,
             element != NULL;
             element = cfg_list_next(element))
        {
-               cfg_obj_t *vconfig = cfg_listelt_value(element);
+               const cfg_obj_t *vconfig = cfg_listelt_value(element);
                CHECK(create_view(vconfig, &viewlist, &view));
                CHECK(configure_view(view, config, vconfig, ns_g_mctx,
                                     &aclconfctx, ISC_FALSE));
@@ -2580,7 +2584,7 @@ load_configuration(const char *filename, ns_server_t *server,
                              "ignoring config file logging "
                              "statement due to -g option");
        } else {
-               cfg_obj_t *logobj = NULL;
+               const cfg_obj_t *logobj = NULL;
                isc_logconfig_t *logc = NULL;
 
                CHECKM(isc_logconfig_create(ns_g_lctx, &logc),
@@ -2619,8 +2623,8 @@ load_configuration(const char *filename, ns_server_t *server,
         * compatibility.
         */
        if (first_time) {
-               cfg_obj_t *logobj = NULL;
-               cfg_obj_t *categories = NULL;
+               const cfg_obj_t *logobj = NULL;
+               const cfg_obj_t *categories = NULL;
 
                obj = NULL;
                if (ns_config_get(maps, "querylog", &obj) == ISC_R_SUCCESS) {
@@ -2632,13 +2636,13 @@ load_configuration(const char *filename, ns_server_t *server,
                                (void)cfg_map_get(logobj, "category",
                                                  &categories);
                        if (categories != NULL) {
-                               cfg_listelt_t *element;
+                               const cfg_listelt_t *element;
                                for (element = cfg_list_first(categories);
                                     element != NULL;
                                     element = cfg_list_next(element))
                                {
-                                       cfg_obj_t *catobj;
-                                       char *str;
+                                       const cfg_obj_t *catobj;
+                                       const char *str;
 
                                        obj = cfg_listelt_value(element);
                                        catobj = cfg_tuple_get(obj, "name");
@@ -3131,7 +3135,7 @@ end_reserved_dispatches(ns_server_t *server, isc_boolean_t all) {
 }
 
 void
-ns_add_reserved_dispatch(ns_server_t *server, isc_sockaddr_t *addr) {
+ns_add_reserved_dispatch(ns_server_t *server, const isc_sockaddr_t *addr) {
        ns_dispatch_t *dispatch;
        in_port_t port;
        char addrbuf[ISC_SOCKADDR_FORMATSIZE];
@@ -3484,12 +3488,12 @@ ns_server_togglequerylog(ns_server_t *server) {
 }
 
 static isc_result_t
-ns_listenlist_fromconfig(cfg_obj_t *listenlist, cfg_obj_t *config,
+ns_listenlist_fromconfig(const cfg_obj_t *listenlist, const cfg_obj_t *config,
                         ns_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);
@@ -3503,7 +3507,7 @@ ns_listenlist_fromconfig(cfg_obj_t *listenlist, cfg_obj_t *config,
             element = cfg_list_next(element))
        {
                ns_listenelt_t *delt = NULL;
-               cfg_obj_t *listener = cfg_listelt_value(element);
+               const cfg_obj_t *listener = cfg_listelt_value(element);
                result = ns_listenelt_fromconfig(listener, config, actx,
                                                 mctx, &delt);
                if (result != ISC_R_SUCCESS)
@@ -3523,12 +3527,12 @@ ns_listenlist_fromconfig(cfg_obj_t *listenlist, cfg_obj_t *config,
  * data structure.
  */
 static isc_result_t
-ns_listenelt_fromconfig(cfg_obj_t *listener, cfg_obj_t *config,
+ns_listenelt_fromconfig(const cfg_obj_t *listener, const cfg_obj_t *config,
                        ns_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);
index 0098fe779c890cf2cfe61f424729d412514d04c8..c7c4034f16b757b0f92fa4c869289479b77dfe66 100644 (file)
@@ -15,7 +15,7 @@
  * PERFORMANCE OF THIS SOFTWARE.
  */
 
-/* $Id: sortlist.c,v 1.5.12.4 2004/03/08 04:04:19 marka Exp $ */
+/* $Id: sortlist.c,v 1.5.12.5 2006/02/28 06:32:53 marka Exp $ */
 
 #include <config.h>
 
@@ -30,7 +30,9 @@
 #include <named/sortlist.h>
 
 ns_sortlisttype_t
-ns_sortlist_setup(dns_acl_t *acl, isc_netaddr_t *clientaddr, void **argp) {
+ns_sortlist_setup(dns_acl_t *acl, isc_netaddr_t *clientaddr,
+                 const void **argp)
+{
        unsigned int i;
 
        if (acl == NULL)
@@ -44,7 +46,7 @@ ns_sortlist_setup(dns_acl_t *acl, isc_netaddr_t *clientaddr, void **argp) {
                dns_aclelement_t *e = &acl->elements[i];
                dns_aclelement_t *try_elt;
                dns_aclelement_t *order_elt = NULL;
-               dns_aclelement_t *matched_elt = NULL;
+               const dns_aclelement_t *matched_elt = NULL;
 
                if (e->type == dns_aclelementtype_nestedacl) {
                        dns_acl_t *inner = e->u.nestedacl;
@@ -106,8 +108,8 @@ ns_sortlist_setup(dns_acl_t *acl, isc_netaddr_t *clientaddr, void **argp) {
 }
 
 int
-ns_sortlist_addrorder2(isc_netaddr_t *addr, void *arg) {
-       dns_acl_t *sortacl = (dns_acl_t *) arg;
+ns_sortlist_addrorder2(const isc_netaddr_t *addr, const void *arg) {
+       const dns_acl_t *sortacl = (const dns_acl_t *) arg;
        int match;
 
        (void)dns_acl_match(addr, NULL, sortacl,
@@ -122,8 +124,8 @@ ns_sortlist_addrorder2(isc_netaddr_t *addr, void *arg) {
 }
 
 int
-ns_sortlist_addrorder1(isc_netaddr_t *addr, void *arg) {
-       dns_aclelement_t *matchelt = (dns_aclelement_t *) arg;
+ns_sortlist_addrorder1(const isc_netaddr_t *addr, const void *arg) {
+       const dns_aclelement_t *matchelt = (const dns_aclelement_t *) arg;
        if (dns_aclelement_match(addr, NULL, matchelt,
                                 &ns_g_server->aclenv,
                                 NULL)) {
@@ -136,7 +138,7 @@ ns_sortlist_addrorder1(isc_netaddr_t *addr, void *arg) {
 void
 ns_sortlist_byaddrsetup(dns_acl_t *sortlist_acl, isc_netaddr_t *client_addr,
                       dns_addressorderfunc_t *orderp,
-                      void **argp)
+                      const void **argp)
 {
        ns_sortlisttype_t sortlisttype;
 
index 7fc13f3d9c0ba26d298a3b1629b5ad3134fceabf..7c3af5cb65949081ac79792fed20ca3f75070013 100644 (file)
@@ -15,7 +15,7 @@
  * PERFORMANCE OF THIS SOFTWARE.
  */
 
-/* $Id: tkeyconf.c,v 1.19.208.2 2004/06/11 00:30:51 marka Exp $ */
+/* $Id: tkeyconf.c,v 1.19.208.3 2006/02/28 06:32:53 marka Exp $ */
 
 #include <config.h>
 
 
 
 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;
-       char *s;
+       const char *s;
        isc_uint32_t n;
        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);
index 38524c37fad7330a842af44c50860725da40f01d..76bf31422489155f092b0cc293ce74cdab75df90 100644 (file)
@@ -15,7 +15,7 @@
  * PERFORMANCE OF THIS SOFTWARE.
  */
 
-/* $Id: tsigconf.c,v 1.21.208.4 2004/03/08 04:04:19 marka Exp $ */
+/* $Id: tsigconf.c,v 1.21.208.5 2006/02/28 06:32:53 marka Exp $ */
 
 #include <config.h>
 
 #include <named/tsigconf.h>
 
 static isc_result_t
-add_initial_keys(cfg_obj_t *list, dns_tsig_keyring_t *ring, isc_mem_t *mctx) {
-       cfg_listelt_t *element;
-       cfg_obj_t *key = NULL;
-       char *keyid = NULL;
+add_initial_keys(const cfg_obj_t *list, dns_tsig_keyring_t *ring,
+                isc_mem_t *mctx)
+{
+       const cfg_listelt_t *element;
+       const cfg_obj_t *key = NULL;
+       const char *keyid = NULL;
        unsigned char *secret = NULL;
        int secretalloc = 0;
        int secretlen = 0;
@@ -49,14 +51,14 @@ add_initial_keys(cfg_obj_t *list, dns_tsig_keyring_t *ring, isc_mem_t *mctx) {
             element != NULL;
             element = cfg_list_next(element))
        {
-               cfg_obj_t *algobj = NULL;
-               cfg_obj_t *secretobj = NULL;
+               const cfg_obj_t *algobj = NULL;
+               const cfg_obj_t *secretobj = NULL;
                dns_name_t keyname;
                dns_name_t *alg;
-               char *algstr;
+               const char *algstr;
                char keynamedata[1024];
                isc_buffer_t keynamesrc, keynamebuf;
-               char *secretstr;
+               const char *secretstr;
                isc_buffer_t secretbuf;
 
                key = cfg_listelt_value(element);
@@ -129,11 +131,11 @@ add_initial_keys(cfg_obj_t *list, dns_tsig_keyring_t *ring, isc_mem_t *mctx) {
 }
 
 isc_result_t
-ns_tsigkeyring_fromconfig(cfg_obj_t *config, cfg_obj_t *vconfig,
+ns_tsigkeyring_fromconfig(const cfg_obj_t *config, const cfg_obj_t *vconfig,
                          isc_mem_t *mctx, dns_tsig_keyring_t **ringp)
 {
-       cfg_obj_t *maps[3];
-       cfg_obj_t *keylist;
+       const cfg_obj_t *maps[3];
+       const cfg_obj_t *keylist;
        dns_tsig_keyring_t *ring = NULL;
        isc_result_t result;
        int i;
index 7296a5e50f92d0b7145d0b4a8072656a2b197264..66ef9050c53e5865b2620cd463044dcdb35d4b9e 100644 (file)
@@ -15,7 +15,7 @@
  * PERFORMANCE OF THIS SOFTWARE.
  */
 
-/* $Id: zoneconf.c,v 1.87.2.4.10.18 2006/01/05 03:38:39 marka Exp $ */
+/* $Id: zoneconf.c,v 1.87.2.4.10.19 2006/02/28 06:32:53 marka Exp $ */
 
 #include <config.h>
 
  * 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, ns_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,
+                  ns_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;
 
@@ -72,7 +72,7 @@ configure_zone_acl(cfg_obj_t *zconfig, cfg_obj_t *vconfig, cfg_obj_t *config,
        if (vconfig != NULL)
                maps[i++] = cfg_tuple_get(vconfig, "options");
        if (config != NULL) {
-               cfg_obj_t *options = NULL;
+               const cfg_obj_t *options = NULL;
                (void)cfg_map_get(config, "options", &options);
                if (options != NULL)
                        maps[i++] = options;
@@ -98,9 +98,9 @@ configure_zone_acl(cfg_obj_t *zconfig, cfg_obj_t *vconfig, cfg_obj_t *config,
  * Parse the zone update-policy statement.
  */
 static isc_result_t
-configure_zone_ssutable(cfg_obj_t *zconfig, dns_zone_t *zone) {
-       cfg_obj_t *updatepolicy = NULL;
-       cfg_listelt_t *element, *element2;
+configure_zone_ssutable(const cfg_obj_t *zconfig, dns_zone_t *zone) {
+       const cfg_obj_t *updatepolicy = NULL;
+       const cfg_listelt_t *element, *element2;
        dns_ssutable_t *table = NULL;
        isc_mem_t *mctx = dns_zone_getmctx(zone);
        isc_result_t result;
@@ -119,13 +119,13 @@ configure_zone_ssutable(cfg_obj_t *zconfig, dns_zone_t *zone) {
             element != NULL;
             element = cfg_list_next(element))
        {
-               cfg_obj_t *stmt = cfg_listelt_value(element);
-               cfg_obj_t *mode = cfg_tuple_get(stmt, "mode");
-               cfg_obj_t *identity = cfg_tuple_get(stmt, "identity");
-               cfg_obj_t *matchtype = cfg_tuple_get(stmt, "matchtype");
-               cfg_obj_t *dname = cfg_tuple_get(stmt, "name");
-               cfg_obj_t *typelist = cfg_tuple_get(stmt, "types");
-               char *str;
+               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;
                dns_fixedname_t fname, fident;
@@ -193,14 +193,14 @@ configure_zone_ssutable(cfg_obj_t *zconfig, dns_zone_t *zone) {
                     element2 != NULL;
                     element2 = cfg_list_next(element2))
                {
-                       cfg_obj_t *typeobj;
+                       const cfg_obj_t *typeobj;
                        isc_textregion_t r;
 
                        INSIST(i < n);
 
                        typeobj = cfg_listelt_value(element2);
                        str = cfg_obj_asstring(typeobj);
-                       r.base = str;
+                       DE_CONST(str, r.base);
                        r.length = strlen(str);
 
                        result = dns_rdatatype_fromtext(&types[i++], &r);
@@ -239,8 +239,8 @@ configure_zone_ssutable(cfg_obj_t *zconfig, dns_zone_t *zone) {
  * Convert a config file zone type into a server zone type.
  */
 static inline dns_zonetype_t
-zonetype_fromconfig(cfg_obj_t *map) {
-       cfg_obj_t *obj = NULL;
+zonetype_fromconfig(const cfg_obj_t *map) {
+       const cfg_obj_t *obj = NULL;
        isc_result_t result;
 
        result = cfg_map_get(map, "type", &obj);
@@ -295,7 +295,9 @@ strtoargv(isc_mem_t *mctx, char *s, unsigned int *argcp, char ***argvp) {
 }
 
 static void
-checknames(dns_zonetype_t ztype, cfg_obj_t **maps, cfg_obj_t **objp) {
+checknames(dns_zonetype_t ztype, const cfg_obj_t **maps,
+          const cfg_obj_t **objp)
+{
        const char *zone = NULL;
        isc_result_t result;
 
@@ -310,17 +312,18 @@ checknames(dns_zonetype_t ztype, cfg_obj_t **maps, cfg_obj_t **objp) {
 }
 
 isc_result_t
-ns_zone_configure(cfg_obj_t *config, cfg_obj_t *vconfig, cfg_obj_t *zconfig,
-                 ns_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, ns_aclconfctx_t *ac,
+                 dns_zone_t *zone)
 {
        isc_result_t result;
-       char *zname;
+       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;
@@ -430,7 +433,7 @@ ns_zone_configure(cfg_obj_t *config, cfg_obj_t *vconfig, cfg_obj_t *zconfig,
                else
                        dialup = dns_dialuptype_no;
        } else {
-               char *dialupstr = cfg_obj_asstring(obj);
+               const char *dialupstr = cfg_obj_asstring(obj);
                if (strcasecmp(dialupstr, "notify") == 0)
                        dialup = dns_dialuptype_notify;
                else if (strcasecmp(dialupstr, "notify-passive") == 0)
@@ -464,7 +467,7 @@ ns_zone_configure(cfg_obj_t *config, cfg_obj_t *vconfig, cfg_obj_t *zconfig,
                        else
                                notifytype = dns_notifytype_no;
                } else {
-                       char *notifystr = cfg_obj_asstring(obj);
+                       const char *notifystr = cfg_obj_asstring(obj);
                        if (strcasecmp(notifystr, "explicit") == 0)
                                notifytype = dns_notifytype_explicit;
                        else
@@ -718,9 +721,9 @@ ns_zone_configure(cfg_obj_t *config, cfg_obj_t *vconfig, cfg_obj_t *zconfig,
 }
 
 isc_boolean_t
-ns_zone_reusable(dns_zone_t *zone, cfg_obj_t *zconfig) {
-       cfg_obj_t *zoptions = NULL;
-       cfg_obj_t *obj = NULL;
+ns_zone_reusable(dns_zone_t *zone, const cfg_obj_t *zconfig) {
+       const cfg_obj_t *zoptions = NULL;
+       const cfg_obj_t *obj = NULL;
        const char *cfilename;
        const char *zfilename;
 
index 63e8f23b9ff56c687546aa3faab46ff832ffc5df..b567579841da03a923a9a9dbfb842c6e8c635eb0 100644 (file)
@@ -15,7 +15,7 @@
  * PERFORMANCE OF THIS SOFTWARE.
  */
 
-/* $Id: rndc.c,v 1.77.2.5.2.15 2005/03/17 03:58:27 marka Exp $ */
+/* $Id: rndc.c,v 1.77.2.5.2.16 2006/02/28 06:32:53 marka Exp $ */
 
 /*
  * Principal Author: DCL
@@ -378,17 +378,17 @@ parse_config(isc_mem_t *mctx, isc_log_t *log, const char *keyname,
 {
        isc_result_t result;
        const char *conffile = admin_conffile;
-       cfg_obj_t *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 *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_listelt_t *elt;
+       const cfg_listelt_t *elt;
        const char *secretstr;
        const char *algorithm;
        static char secretarray[1024];
@@ -420,7 +420,7 @@ parse_config(isc_mem_t *mctx, isc_log_t *log, const char *keyname,
        if (key_only && servername == NULL)
                servername = "127.0.0.1";
        else if (servername == NULL && options != NULL) {
-               cfg_obj_t *defserverobj = NULL;
+               const cfg_obj_t *defserverobj = NULL;
                (void)cfg_map_get(options, "default-server", &defserverobj);
                if (defserverobj != NULL)
                        servername = cfg_obj_asstring(defserverobj);
index e6e86fd14dfcfdc0da3ad2f8eeccaa84e0c61862..9789b7c8813130cd7c251de6c976994b1517981d 100644 (file)
@@ -15,7 +15,7 @@
  * PERFORMANCE OF THIS SOFTWARE.
  */
 
-/* $Id: check.c,v 1.37.6.32 2005/11/03 23:08:41 marka Exp $ */
+/* $Id: check.c,v 1.37.6.33 2006/02/28 06:32:54 marka Exp $ */
 
 #include <config.h>
 
@@ -50,12 +50,12 @@ freekey(char *key, unsigned int type, isc_symvalue_t value, void *userarg) {
 }
 
 static isc_result_t
-check_orderent(cfg_obj_t *ent, isc_log_t *logctx) {
+check_orderent(const cfg_obj_t *ent, isc_log_t *logctx) {
        isc_result_t result = ISC_R_SUCCESS;
        isc_result_t tresult;
        isc_textregion_t r;
        dns_fixedname_t fixed;
-       cfg_obj_t *obj;
+       const cfg_obj_t *obj;
        dns_rdataclass_t rdclass;
        dns_rdatatype_t rdtype;
        isc_buffer_t b;
@@ -132,11 +132,11 @@ check_orderent(cfg_obj_t *ent, isc_log_t *logctx) {
 }
 
 static isc_result_t
-check_order(cfg_obj_t *options, isc_log_t *logctx) {
+check_order(const cfg_obj_t *options, isc_log_t *logctx) {
        isc_result_t result = ISC_R_SUCCESS;
        isc_result_t tresult;
-       cfg_listelt_t *element;
-       cfg_obj_t *obj = NULL;
+       const cfg_listelt_t *element;
+       const cfg_obj_t *obj = NULL;
 
        if (cfg_map_get(options, "rrset-order", &obj) != ISC_R_SUCCESS)
                return (result);
@@ -153,12 +153,12 @@ check_order(cfg_obj_t *options, isc_log_t *logctx) {
 }
 
 static isc_result_t
-check_dual_stack(cfg_obj_t *options, isc_log_t *logctx) {
-       cfg_listelt_t *element;
-       cfg_obj_t *alternates = NULL;
-       cfg_obj_t *value;
-       cfg_obj_t *obj;
-       char *str;
+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;
        isc_buffer_t buffer;
@@ -213,9 +213,9 @@ check_dual_stack(cfg_obj_t *options, isc_log_t *logctx) {
 }
 
 static isc_result_t
-check_forward(cfg_obj_t *options, isc_log_t *logctx) {
-       cfg_obj_t *forward = NULL;
-       cfg_obj_t *forwarders = NULL;
+check_forward(const cfg_obj_t *options, isc_log_t *logctx) {
+       const cfg_obj_t *forward = NULL;
+       const cfg_obj_t *forwarders = NULL;
 
        (void)cfg_map_get(options, "forward", &forward);
        (void)cfg_map_get(options, "forwarders", &forwarders);
@@ -229,15 +229,15 @@ check_forward(cfg_obj_t *options, isc_log_t *logctx) {
 }
 
 static isc_result_t
-disabled_algorithms(cfg_obj_t *disabled, isc_log_t *logctx) {
+disabled_algorithms(const cfg_obj_t *disabled, isc_log_t *logctx) {
        isc_result_t result = ISC_R_SUCCESS;
        isc_result_t tresult;
-       cfg_listelt_t *element;
+       const cfg_listelt_t *element;
        const char *str;
        isc_buffer_t b;
        dns_fixedname_t fixed;
        dns_name_t *name;
-       cfg_obj_t *obj;
+       const cfg_obj_t *obj;
 
        dns_fixedname_init(&fixed);
        name = dns_fixedname_name(&fixed);
@@ -262,7 +262,7 @@ disabled_algorithms(cfg_obj_t *disabled, isc_log_t *logctx) {
                dns_secalg_t alg;
                isc_result_t tresult;
 
-               r.base = cfg_obj_asstring(cfg_listelt_value(element));
+               DE_CONST(cfg_obj_asstring(cfg_listelt_value(element)), r.base);
                r.length = strlen(r.base);
 
                tresult = dns_secalg_fromtext(&alg, &r);
@@ -280,8 +280,9 @@ disabled_algorithms(cfg_obj_t *disabled, isc_log_t *logctx) {
 }
 
 static isc_result_t
-nameexist(cfg_obj_t *obj, const char *name, int value, isc_symtab_t *symtab,
-         const char *fmt, isc_log_t *logctx, isc_mem_t *mctx)
+nameexist(const cfg_obj_t *obj, const char *name, int value,
+         isc_symtab_t *symtab, const char *fmt, isc_log_t *logctx,
+         isc_mem_t *mctx)
 {
        char *key;
        const char *file;
@@ -292,14 +293,14 @@ nameexist(cfg_obj_t *obj, const char *name, int value, isc_symtab_t *symtab,
        key = isc_mem_strdup(mctx, name);
        if (key == NULL)
                return (ISC_R_NOMEMORY);
-       symvalue.as_pointer = obj;
+       symvalue.as_cpointer = obj;
        result = isc_symtab_define(symtab, key, value, symvalue,
                                   isc_symexists_reject);
        if (result == ISC_R_EXISTS) {
                RUNTIME_CHECK(isc_symtab_lookup(symtab, key, value,
                                                &symvalue) == ISC_R_SUCCESS);
-               file = cfg_obj_file(symvalue.as_pointer);
-               line = cfg_obj_line(symvalue.as_pointer);
+               file = cfg_obj_file(symvalue.as_cpointer);
+               line = cfg_obj_line(symvalue.as_cpointer);
 
                if (file == NULL)
                        file = "<unknown file>";
@@ -313,10 +314,10 @@ nameexist(cfg_obj_t *obj, const char *name, int value, isc_symtab_t *symtab,
 }
 
 static isc_result_t
-mustbesecure(cfg_obj_t *secure, isc_symtab_t *symtab, isc_log_t *logctx,
+mustbesecure(const cfg_obj_t *secure, isc_symtab_t *symtab, isc_log_t *logctx,
             isc_mem_t *mctx)
 {
-       cfg_obj_t *obj;
+       const cfg_obj_t *obj;
        char namebuf[DNS_NAME_FORMATSIZE];
        const char *str;
        dns_fixedname_t fixed;
@@ -351,12 +352,12 @@ typedef struct {
 } intervaltable;
 
 static isc_result_t
-check_options(cfg_obj_t *options, isc_log_t *logctx, isc_mem_t *mctx) {
+check_options(const cfg_obj_t *options, isc_log_t *logctx, isc_mem_t *mctx) {
        isc_result_t result = ISC_R_SUCCESS;
        isc_result_t tresult;
        unsigned int i;
-       cfg_obj_t *obj = NULL;
-       cfg_listelt_t *element;
+       const cfg_obj_t *obj = NULL;
+       const cfg_listelt_t *element;
        isc_symtab_t *symtab = NULL;
 
        static intervaltable intervals[] = {
@@ -411,9 +412,9 @@ check_options(cfg_obj_t *options, isc_log_t *logctx, isc_mem_t *mctx) {
        (void)cfg_map_get(options, "root-delegation-only", &obj);
        if (obj != NULL) {
                if (!cfg_obj_isvoid(obj)) {
-                       cfg_listelt_t *element;
-                       cfg_obj_t *exclude;
-                       char *str;
+                       const cfg_listelt_t *element;
+                       const cfg_obj_t *exclude;
+                       const char *str;
                        dns_fixedname_t fixed;
                        dns_name_t *name;
                        isc_buffer_t b;
@@ -557,10 +558,10 @@ check_options(cfg_obj_t *options, isc_log_t *logctx, isc_mem_t *mctx) {
 }
 
 static isc_result_t
-get_masters_def(cfg_obj_t *cctx, 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)
@@ -568,7 +569,7 @@ get_masters_def(cfg_obj_t *cctx, char *name, cfg_obj_t **ret) {
        for (elt = cfg_list_first(masters);
             elt != NULL;
             elt = cfg_list_next(elt)) {
-               cfg_obj_t *list;
+               const cfg_obj_t *list;
                const char *listname;
 
                list = cfg_listelt_value(elt);
@@ -583,18 +584,18 @@ get_masters_def(cfg_obj_t *cctx, char *name, cfg_obj_t **ret) {
 }
 
 static isc_result_t
-validate_masters(cfg_obj_t *obj, cfg_obj_t *config, isc_uint32_t *countp,
-                isc_log_t *logctx, isc_mem_t *mctx)
+validate_masters(const cfg_obj_t *obj, const cfg_obj_t *config,
+                isc_uint32_t *countp, isc_log_t *logctx, isc_mem_t *mctx)
 {
        isc_result_t result = ISC_R_SUCCESS;
        isc_result_t tresult;
        isc_uint32_t count = 0;
        isc_symtab_t *symtab = NULL;
        isc_symvalue_t symvalue;
-       cfg_listelt_t *element;
-       cfg_listelt_t **stack = NULL;
+       const cfg_listelt_t *element;
+       const cfg_listelt_t **stack = NULL;
        isc_uint32_t stackcount = 0, pushed = 0;
-       cfg_obj_t *list;
+       const cfg_obj_t *list;
 
        REQUIRE(countp != NULL);
        result = isc_symtab_create(mctx, 100, NULL, NULL, ISC_FALSE, &symtab);
@@ -611,9 +612,9 @@ validate_masters(cfg_obj_t *obj, cfg_obj_t *config, isc_uint32_t *countp,
             element != NULL;
             element = cfg_list_next(element))
        {
-               char *listname;
-               cfg_obj_t *addr;
-               cfg_obj_t *key;
+               const char *listname;
+               const cfg_obj_t *addr;
+               const cfg_obj_t *key;
 
                addr = cfg_tuple_get(cfg_listelt_value(element),
                                     "masterselement");
@@ -631,7 +632,7 @@ validate_masters(cfg_obj_t *obj, cfg_obj_t *config, isc_uint32_t *countp,
                                result = ISC_R_FAILURE;
                }
                listname = cfg_obj_asstring(addr);
-               symvalue.as_pointer = addr;
+               symvalue.as_cpointer = addr;
                tresult = isc_symtab_define(symtab, listname, 1, symvalue,
                                            isc_symexists_reject);
                if (tresult == ISC_R_EXISTS)
@@ -691,14 +692,15 @@ typedef struct {
 } optionstable;
 
 static isc_result_t
-check_zoneconf(cfg_obj_t *zconfig, cfg_obj_t *config, isc_symtab_t *symtab,
-              dns_rdataclass_t defclass, isc_log_t *logctx, isc_mem_t *mctx)
+check_zoneconf(const cfg_obj_t *zconfig, const cfg_obj_t *config,
+              isc_symtab_t *symtab, dns_rdataclass_t defclass,
+              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;
@@ -902,10 +904,10 @@ check_zoneconf(cfg_obj_t *zconfig, cfg_obj_t *config, isc_symtab_t *symtab,
         * 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)) {
-                       char *str = cfg_obj_asstring(dialup);
+                       const char *str = cfg_obj_asstring(dialup);
                        for (i = 0;
                             i < sizeof(dialups) / sizeof(dialups[0]);
                             i++)
@@ -970,9 +972,9 @@ check_zoneconf(cfg_obj_t *zconfig, cfg_obj_t *config, isc_symtab_t *symtab,
 }
 
 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));
        
        (void)cfg_map_get(key, "algorithm", &algobj);
@@ -988,20 +990,20 @@ bind9_check_key(cfg_obj_t *key, isc_log_t *logctx) {
 }
 
 static isc_result_t
-check_keylist(cfg_obj_t *keys, isc_symtab_t *symtab, isc_log_t *logctx) {
+check_keylist(const cfg_obj_t *keys, isc_symtab_t *symtab, isc_log_t *logctx) {
        isc_result_t result = ISC_R_SUCCESS;
        isc_result_t tresult;
-       cfg_listelt_t *element;
+       const cfg_listelt_t *element;
 
        for (element = cfg_list_first(keys);
             element != NULL;
             element = cfg_list_next(element))
        {
-               cfg_obj_t *key = cfg_listelt_value(element);
+               const cfg_obj_t *key = cfg_listelt_value(element);
                const char *keyname = cfg_obj_asstring(cfg_map_getname(key));
                isc_symvalue_t symvalue;
 
-               symvalue.as_pointer = key;
+               symvalue.as_cpointer = key;
                tresult = isc_symtab_define(symtab, keyname, 1,
                                            symvalue, isc_symexists_reject);
                if (tresult == ISC_R_EXISTS) {
@@ -1010,8 +1012,8 @@ check_keylist(cfg_obj_t *keys, isc_symtab_t *symtab, isc_log_t *logctx) {
 
                        RUNTIME_CHECK(isc_symtab_lookup(symtab, keyname,
                                            1, &symvalue) == ISC_R_SUCCESS);
-                       file = cfg_obj_file(symvalue.as_pointer);
-                       line = cfg_obj_line(symvalue.as_pointer);
+                       file = cfg_obj_file(symvalue.as_cpointer);
+                       line = cfg_obj_line(symvalue.as_cpointer);
 
                        if (file == NULL)
                                file = "<unknown file>";
@@ -1031,13 +1033,16 @@ check_keylist(cfg_obj_t *keys, isc_symtab_t *symtab, isc_log_t *logctx) {
 }
 
 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;
-       cfg_listelt_t *e1, *e2;
-       cfg_obj_t *v1, *v2;
-       isc_sockaddr_t *s1, *s2;
+       const cfg_listelt_t *e1;
+       const cfg_listelt_t *e2;
+       const cfg_obj_t *v1;
+       const cfg_obj_t *v2;
+       const isc_sockaddr_t *s1;
+       const isc_sockaddr_t *s2;
        isc_netaddr_t na;
-       cfg_obj_t *ts;
+       const cfg_obj_t *ts;
        char buf[128];
        const char *xfr;
        isc_buffer_t target;
@@ -1090,13 +1095,13 @@ check_servers(cfg_obj_t *servers, isc_log_t *logctx) {
 }
                
 static isc_result_t
-check_viewconf(cfg_obj_t *config, cfg_obj_t *vconfig, dns_rdataclass_t vclass,
-              isc_log_t *logctx, isc_mem_t *mctx)
+check_viewconf(const cfg_obj_t *config, const cfg_obj_t *vconfig,
+              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;
@@ -1120,7 +1125,7 @@ check_viewconf(cfg_obj_t *config, cfg_obj_t *vconfig, dns_rdataclass_t vclass,
             element = cfg_list_next(element))
        {
                isc_result_t tresult;
-               cfg_obj_t *zone = cfg_listelt_value(element);
+               const cfg_obj_t *zone = cfg_listelt_value(element);
 
                tresult = check_zoneconf(zone, config, symtab, vclass,
                                         logctx, mctx);
@@ -1165,7 +1170,7 @@ check_viewconf(cfg_obj_t *config, cfg_obj_t *vconfig, dns_rdataclass_t vclass,
         * Check that forwarding is reasonable.
         */
        if (vconfig == 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)
@@ -1178,7 +1183,7 @@ check_viewconf(cfg_obj_t *config, cfg_obj_t *vconfig, dns_rdataclass_t vclass,
         * Check that dual-stack-servers is reasonable.
         */
        if (vconfig == 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)
@@ -1215,14 +1220,16 @@ check_viewconf(cfg_obj_t *config, cfg_obj_t *vconfig, dns_rdataclass_t vclass,
 
 
 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;
@@ -1256,7 +1263,7 @@ bind9_check_namedconf(cfg_obj_t *config, isc_log_t *logctx, isc_mem_t *mctx) {
                                   logctx, mctx) != ISC_R_SUCCESS)
                        result = ISC_R_FAILURE;
        } else {
-               cfg_obj_t *zones = NULL;
+               const cfg_obj_t *zones = NULL;
 
                (void)cfg_map_get(config, "zone", &zones);
                if (zones != NULL) {
@@ -1274,10 +1281,10 @@ bind9_check_namedconf(cfg_obj_t *config, isc_log_t *logctx, isc_mem_t *mctx) {
             velement != NULL;
             velement = cfg_list_next(velement))
        {
-               cfg_obj_t *view = cfg_listelt_value(velement);
-               cfg_obj_t *vname = cfg_tuple_get(view, "name");
-               cfg_obj_t *voptions = cfg_tuple_get(view, "options");
-               cfg_obj_t *vclassobj = cfg_tuple_get(view, "class");
+               const cfg_obj_t *view = cfg_listelt_value(velement);
+               const cfg_obj_t *vname = cfg_tuple_get(view, "name");
+               const cfg_obj_t *voptions = cfg_tuple_get(view, "options");
+               const cfg_obj_t *vclassobj = cfg_tuple_get(view, "class");
                dns_rdataclass_t vclass = dns_rdataclass_in;
                isc_result_t tresult = ISC_R_SUCCESS;
                const char *key = cfg_obj_asstring(vname);
@@ -1295,7 +1302,7 @@ bind9_check_namedconf(cfg_obj_t *config, isc_log_t *logctx, isc_mem_t *mctx) {
                                            cfg_obj_asstring(vname), r.base);
                }
                if (tresult == ISC_R_SUCCESS && symtab != NULL) {
-                       symvalue.as_pointer = view;
+                       symvalue.as_cpointer = view;
                        tresult = isc_symtab_define(symtab, key, vclass,
                                                    symvalue,
                                                    isc_symexists_reject);
@@ -1304,8 +1311,8 @@ bind9_check_namedconf(cfg_obj_t *config, isc_log_t *logctx, isc_mem_t *mctx) {
                                unsigned int line;
                                RUNTIME_CHECK(isc_symtab_lookup(symtab, key,
                                           vclass, &symvalue) == ISC_R_SUCCESS);
-                               file = cfg_obj_file(symvalue.as_pointer);
-                               line = cfg_obj_line(symvalue.as_pointer);
+                               file = cfg_obj_file(symvalue.as_cpointer);
+                               line = cfg_obj_line(symvalue.as_cpointer);
                                cfg_obj_log(view, logctx, ISC_LOG_ERROR,
                                            "view '%s': already exists "
                                            "previous definition: %s:%u",
@@ -1345,14 +1352,14 @@ bind9_check_namedconf(cfg_obj_t *config, isc_log_t *logctx, isc_mem_t *mctx) {
 
         tresult = cfg_map_get(config, "acl", &acls);
         if (tresult == ISC_R_SUCCESS) {
-               cfg_listelt_t *elt;
-               cfg_listelt_t *elt2;
+               const cfg_listelt_t *elt;
+               const cfg_listelt_t *elt2;
                const char *aclname;
 
                for (elt = cfg_list_first(acls);
                     elt != NULL;
                     elt = cfg_list_next(elt)) {
-                       cfg_obj_t *acl = cfg_listelt_value(elt);
+                       const cfg_obj_t *acl = cfg_listelt_value(elt);
                        unsigned int i;
 
                        aclname = cfg_obj_asstring(cfg_tuple_get(acl, "name"));
@@ -1371,7 +1378,7 @@ bind9_check_namedconf(cfg_obj_t *config, isc_log_t *logctx, isc_mem_t *mctx) {
                        for (elt2 = cfg_list_next(elt);
                             elt2 != NULL;
                             elt2 = cfg_list_next(elt2)) {
-                               cfg_obj_t *acl2 = cfg_listelt_value(elt2);
+                               const cfg_obj_t *acl2 = cfg_listelt_value(elt2);
                                const char *name;
                                name = cfg_obj_asstring(cfg_tuple_get(acl2,
                                                                      "name"));
@@ -1395,21 +1402,21 @@ bind9_check_namedconf(cfg_obj_t *config, isc_log_t *logctx, isc_mem_t *mctx) {
 
         tresult = cfg_map_get(config, "kal", &kals);
         if (tresult == ISC_R_SUCCESS) {
-               cfg_listelt_t *elt;
-               cfg_listelt_t *elt2;
+               const cfg_listelt_t *elt;
+               const cfg_listelt_t *elt2;
                const char *aclname;
 
                for (elt = cfg_list_first(kals);
                     elt != NULL;
                     elt = cfg_list_next(elt)) {
-                       cfg_obj_t *acl = cfg_listelt_value(elt);
+                       const cfg_obj_t *acl = cfg_listelt_value(elt);
 
                        aclname = cfg_obj_asstring(cfg_tuple_get(acl, "name"));
 
                        for (elt2 = cfg_list_next(elt);
                             elt2 != NULL;
                             elt2 = cfg_list_next(elt2)) {
-                               cfg_obj_t *acl2 = cfg_listelt_value(elt2);
+                               const cfg_obj_t *acl2 = cfg_listelt_value(elt2);
                                const char *name;
                                name = cfg_obj_asstring(cfg_tuple_get(acl2,
                                                                      "name"));
index dcda517bb4304e9479ac8aa31d589f786865b5bb..d1c9d08b60c79c52e8f9d979fb2e3fa960ff251f 100644 (file)
@@ -15,7 +15,7 @@
  * PERFORMANCE OF THIS SOFTWARE.
  */
 
-/* $Id: check.h,v 1.1.200.4 2004/03/08 09:04:28 marka Exp $ */
+/* $Id: check.h,v 1.1.200.5 2006/02/28 06:32:54 marka Exp $ */
 
 #ifndef BIND9_CHECK_H
 #define BIND9_CHECK_H 1
@@ -28,7 +28,8 @@
 ISC_LANG_BEGINDECLS
 
 isc_result_t
-bind9_check_namedconf(cfg_obj_t *config, isc_log_t *logctx, isc_mem_t *mctx);
+bind9_check_namedconf(const cfg_obj_t *config, isc_log_t *logctx,
+                     isc_mem_t *mctx);
 /*
  * Check the syntactic validity of a configuration parse tree generated from
  * a named.conf file.
@@ -44,7 +45,7 @@ bind9_check_namedconf(cfg_obj_t *config, isc_log_t *logctx, isc_mem_t *mctx);
  */
 
 isc_result_t
-bind9_check_key(cfg_obj_t *config, isc_log_t *logctx);
+bind9_check_key(const cfg_obj_t *config, isc_log_t *logctx);
 /*
  * As above, but for a single 'key' statement.
  */
index d2814405a7204ec3c4a9adc362a29d26c7b19b8c..da4d048a46224eb32dbbda047fa9f0742edfd244 100644 (file)
@@ -15,7 +15,7 @@
  * PERFORMANCE OF THIS SOFTWARE.
  */
 
-/* $Id: acl.c,v 1.23.52.4 2004/03/09 05:21:08 marka Exp $ */
+/* $Id: acl.c,v 1.23.52.5 2006/02/28 06:32:54 marka Exp $ */
 
 #include <config.h>
 
@@ -68,7 +68,7 @@ dns_acl_create(isc_mem_t *mctx, int n, dns_acl_t **target) {
 }
 
 isc_result_t
-dns_acl_appendelement(dns_acl_t *acl, dns_aclelement_t *elt) {
+dns_acl_appendelement(dns_acl_t *acl, const dns_aclelement_t *elt) {
        if (acl->length + 1 > acl->alloc) {
                /*
                 * Resize the ACL.
@@ -123,12 +123,12 @@ dns_acl_none(isc_mem_t *mctx, dns_acl_t **target) {
 }
 
 isc_result_t
-dns_acl_match(isc_netaddr_t *reqaddr,
-             dns_name_t *reqsigner,
-             dns_acl_t *acl,
-             dns_aclenv_t *env,
+dns_acl_match(const isc_netaddr_t *reqaddr,
+             const dns_name_t *reqsigner,
+             const dns_acl_t *acl,
+             const dns_aclenv_t *env,
              int *match,
-             dns_aclelement_t **matchelt)
+             dns_aclelement_t const**matchelt)
 {
        unsigned int i;
 
@@ -150,9 +150,9 @@ dns_acl_match(isc_netaddr_t *reqaddr,
 }
 
 isc_result_t
-dns_acl_elementmatch(dns_acl_t *acl,
-                    dns_aclelement_t *elt,
-                    dns_aclelement_t **matchelt)
+dns_acl_elementmatch(const dns_acl_t *acl,
+                    const dns_aclelement_t *elt,
+                    const dns_aclelement_t **matchelt)
 {
        unsigned int i;
 
@@ -173,14 +173,14 @@ dns_acl_elementmatch(dns_acl_t *acl,
 }
 
 isc_boolean_t
-dns_aclelement_match(isc_netaddr_t *reqaddr,
-                    dns_name_t *reqsigner,
-                    dns_aclelement_t *e,
-                    dns_aclenv_t *env,
-                    dns_aclelement_t **matchelt)
+dns_aclelement_match(const isc_netaddr_t *reqaddr,
+                    const dns_name_t *reqsigner,
+                    const dns_aclelement_t *e,
+                    const dns_aclenv_t *env,
+                    const dns_aclelement_t **matchelt)
 {
        dns_acl_t *inner = NULL;
-       isc_netaddr_t *addr;
+       const isc_netaddr_t *addr;
        isc_netaddr_t v4addr;
        int indirectmatch;
        isc_result_t result;
@@ -312,7 +312,7 @@ dns_acl_detach(dns_acl_t **aclp) {
 }
 
 isc_boolean_t
-dns_aclelement_equal(dns_aclelement_t *ea, dns_aclelement_t *eb) {
+dns_aclelement_equal(const dns_aclelement_t *ea, const dns_aclelement_t *eb) {
        if (ea->type != eb->type)
                return (ISC_FALSE);
        switch (ea->type) {
@@ -338,7 +338,7 @@ dns_aclelement_equal(dns_aclelement_t *ea, dns_aclelement_t *eb) {
 }
 
 isc_boolean_t
-dns_acl_equal(dns_acl_t *a, dns_acl_t *b) {
+dns_acl_equal(const dns_acl_t *a, const dns_acl_t *b) {
        unsigned int i;
        if (a == b)
                return (ISC_TRUE);
@@ -353,7 +353,7 @@ dns_acl_equal(dns_acl_t *a, dns_acl_t *b) {
 }
 
 static isc_boolean_t
-is_loopback(dns_aclipprefix_t *p) {
+is_loopback(const dns_aclipprefix_t *p) {
        switch (p->address.family) {
        case AF_INET:
                if (p->prefixlen == 32 &&
@@ -372,7 +372,7 @@ is_loopback(dns_aclipprefix_t *p) {
 }
 
 isc_boolean_t
-dns_acl_isinsecure(dns_acl_t *a) {
+dns_acl_isinsecure(const dns_acl_t *a) {
        unsigned int i;
        for (i = 0; i < a->length; i++) {
                dns_aclelement_t *e = &a->elements[i];
index 0a68d7c32bcae831131634ca444d7cdae3cf513f..8dc11b3a3baa18f97d5c2b9d3d497b7fabbd4903 100644 (file)
@@ -15,7 +15,7 @@
  * PERFORMANCE OF THIS SOFTWARE.
  */
 
-/* $Id: cache.c,v 1.45.2.4.8.12 2006/01/26 23:09:36 marka Exp $ */
+/* $Id: cache.c,v 1.45.2.4.8.13 2006/02/28 06:32:54 marka Exp $ */
 
 #include <config.h>
 
@@ -386,7 +386,7 @@ dns_cache_attachdb(dns_cache_t *cache, dns_db_t **dbp) {
 }
 
 isc_result_t
-dns_cache_setfilename(dns_cache_t *cache, char *filename) {
+dns_cache_setfilename(dns_cache_t *cache, const char *filename) {
        char *newname;
 
        REQUIRE(VALID_CACHE(cache));
index e0fe8c276a13a374859e6c9d76d8e7f710bd964e..6f2eda77fe566ad5d18d14ba71f2b8ef1719cd2b 100644 (file)
@@ -15,7 +15,7 @@
  * PERFORMANCE OF THIS SOFTWARE.
  */
 
-/* $Id: compress.c,v 1.50.206.2 2004/03/06 08:13:37 marka Exp $ */
+/* $Id: compress.c,v 1.50.206.3 2006/02/28 06:32:54 marka Exp $ */
 
 #define DNS_NAME_USEINLINE 1
 
@@ -111,7 +111,7 @@ do { \
  * If no match is found return ISC_FALSE.
  */
 isc_boolean_t
-dns_compress_findglobal(dns_compress_t *cctx, dns_name_t *name,
+dns_compress_findglobal(dns_compress_t *cctx, const dns_name_t *name,
                        dns_name_t *prefix, isc_uint16_t *offset)
 {
        dns_name_t tname, nname;
@@ -161,15 +161,15 @@ dns_compress_findglobal(dns_compress_t *cctx, dns_name_t *name,
 }
 
 static inline unsigned int
-name_length(dns_name_t *name) {
+name_length(const dns_name_t *name) {
        isc_region_t r;
        dns_name_toregion(name, &r);
        return (r.length);
 }
 
 void
-dns_compress_add(dns_compress_t *cctx, dns_name_t *name, dns_name_t *prefix,
-                isc_uint16_t offset)
+dns_compress_add(dns_compress_t *cctx, const dns_name_t *name,
+                const dns_name_t *prefix, isc_uint16_t offset)
 {
        dns_name_t tname;
        unsigned int start;
index bc723f43bf99b466d8e9080625223611d6ab27e7..6b5a13d5e66467a8c06cfe73861d81821f4ec255 100644 (file)
@@ -15,7 +15,7 @@
  * PERFORMANCE OF THIS SOFTWARE.
  */
 
-/* $Id: acl.h,v 1.20.52.3 2004/03/08 09:04:34 marka Exp $ */
+/* $Id: acl.h,v 1.20.52.4 2006/02/28 06:32:54 marka Exp $ */
 
 #ifndef DNS_ACL_H
 #define DNS_ACL_H 1
@@ -104,7 +104,7 @@ dns_acl_create(isc_mem_t *mctx, int n, dns_acl_t **target);
  */
 
 isc_result_t
-dns_acl_appendelement(dns_acl_t *acl, dns_aclelement_t *elt);
+dns_acl_appendelement(dns_acl_t *acl, const dns_aclelement_t *elt);
 /*
  * Append an element to an existing ACL.
  */
@@ -128,13 +128,13 @@ void
 dns_acl_detach(dns_acl_t **aclp);
 
 isc_boolean_t
-dns_aclelement_equal(dns_aclelement_t *ea, dns_aclelement_t *eb);
+dns_aclelement_equal(const dns_aclelement_t *ea, const dns_aclelement_t *eb);
 
 isc_boolean_t
-dns_acl_equal(dns_acl_t *a, dns_acl_t *b);
+dns_acl_equal(const dns_acl_t *a, const dns_acl_t *b);
 
 isc_boolean_t
-dns_acl_isinsecure(dns_acl_t *a);
+dns_acl_isinsecure(const dns_acl_t *a);
 /*
  * Return ISC_TRUE iff the acl 'a' is considered insecure, that is,
  * if it contains IP addresses other than those of the local host.
@@ -154,12 +154,12 @@ void
 dns_aclenv_destroy(dns_aclenv_t *env);
 
 isc_result_t
-dns_acl_match(isc_netaddr_t *reqaddr,
-             dns_name_t *reqsigner,
-             dns_acl_t *acl,
-             dns_aclenv_t *env,
+dns_acl_match(const isc_netaddr_t *reqaddr,
+             const dns_name_t *reqsigner,
+             const dns_acl_t *acl,
+             const dns_aclenv_t *env,
              int *match,
-             dns_aclelement_t **matchelt);
+             const dns_aclelement_t **matchelt);
 /*
  * General, low-level ACL matching.  This is expected to
  * be useful even for weird stuff like the topology and sortlist statements.
@@ -185,11 +185,11 @@ dns_acl_match(isc_netaddr_t *reqaddr,
  */
 
 isc_boolean_t
-dns_aclelement_match(isc_netaddr_t *reqaddr,
-                    dns_name_t *reqsigner,
-                    dns_aclelement_t *e,
-                    dns_aclenv_t *env,              
-                    dns_aclelement_t **matchelt);
+dns_aclelement_match(const isc_netaddr_t *reqaddr,
+                    const dns_name_t *reqsigner,
+                    const dns_aclelement_t *e,
+                    const dns_aclenv_t *env,                
+                    const dns_aclelement_t **matchelt);
 /*
  * Like dns_acl_match, but matches against the single ACL element 'e'
  * rather than a complete list and returns ISC_TRUE iff it matched.
@@ -200,9 +200,9 @@ dns_aclelement_match(isc_netaddr_t *reqaddr,
  */
 
 isc_result_t
-dns_acl_elementmatch(dns_acl_t *acl,
-                    dns_aclelement_t *elt,
-                    dns_aclelement_t **matchelt);
+dns_acl_elementmatch(const dns_acl_t *acl,
+                    const dns_aclelement_t *elt,
+                    const dns_aclelement_t **matchelt);
 /*
  * Search for an ACL element in 'acl' which is exactly the same as 'elt'.
  * If there is one, and 'matchelt' is non NULL, then '*matchelt' will point
index 79c53de8f010889e16a2895e132206b5d1d4e7d5..1f88c14d9bd9ddc968116659034761e93116e112 100644 (file)
@@ -15,7 +15,7 @@
  * PERFORMANCE OF THIS SOFTWARE.
  */
 
-/* $Id: cache.h,v 1.17.12.3 2004/03/08 09:04:34 marka Exp $ */
+/* $Id: cache.h,v 1.17.12.4 2006/02/28 06:32:54 marka Exp $ */
 
 #ifndef DNS_CACHE_H
 #define DNS_CACHE_H 1
@@ -151,7 +151,7 @@ dns_cache_attachdb(dns_cache_t *cache, dns_db_t **dbp);
 
 
 isc_result_t
-dns_cache_setfilename(dns_cache_t *cahce, char *filename);
+dns_cache_setfilename(dns_cache_t *cahce, const char *filename);
 /*
  * If 'filename' is non-NULL, make the cache persistent.
  * The cache's data will be stored in the given file.
index 0f6451cc6bf91007a91dbcaec5a87d8ee3e4c4fa..420955dd6142ae132a9b2fbef45bd8668866d203 100644 (file)
@@ -15,7 +15,7 @@
  * PERFORMANCE OF THIS SOFTWARE.
  */
 
-/* $Id: compress.h,v 1.29.2.2.8.1 2004/03/06 08:13:51 marka Exp $ */
+/* $Id: compress.h,v 1.29.2.2.8.2 2006/02/28 06:32:54 marka Exp $ */
 
 #ifndef DNS_COMPRESS_H
 #define DNS_COMPRESS_H 1
@@ -136,7 +136,7 @@ dns_compress_getedns(dns_compress_t *cctx);
  */
 
 isc_boolean_t
-dns_compress_findglobal(dns_compress_t *cctx, dns_name_t *name,
+dns_compress_findglobal(dns_compress_t *cctx, const dns_name_t *name,
                        dns_name_t *prefix, isc_uint16_t *offset);
 /*
  *     Finds longest possible match of 'name' in the global compression table.
@@ -155,8 +155,8 @@ dns_compress_findglobal(dns_compress_t *cctx, dns_name_t *name,
  */
 
 void
-dns_compress_add(dns_compress_t *cctx, dns_name_t *name, dns_name_t *prefix,
-                isc_uint16_t offset);
+dns_compress_add(dns_compress_t *cctx, const dns_name_t *name,
+                const dns_name_t *prefix, isc_uint16_t offset);
 /*
  *     Add compression pointers for 'name' to the compression table,
  *     not replacing existing pointers.
index f871af86c3812f5216aa2218a576e0dad443f14a..960c11aa12b3bddebc8d9427094e8b9c7bb250ef 100644 (file)
@@ -15,7 +15,7 @@
  * PERFORMANCE OF THIS SOFTWARE.
  */
 
-/* $Id: message.h,v 1.100.2.3.8.9 2006/01/06 00:01:42 marka Exp $ */
+/* $Id: message.h,v 1.100.2.3.8.10 2006/02/28 06:32:54 marka Exp $ */
 
 #ifndef DNS_MESSAGE_H
 #define DNS_MESSAGE_H 1
@@ -236,7 +236,7 @@ struct dns_message {
        isc_region_t                    saved;
 
        dns_rdatasetorderfunc_t         order;
-       void *                          order_arg;
+       const void *                    order_arg;
 };
 
 /***
@@ -1281,7 +1281,7 @@ dns_message_getrawmessage(dns_message_t *msg);
 
 void
 dns_message_setsortorder(dns_message_t *msg, dns_rdatasetorderfunc_t order,
-                        void *order_arg);
+                        const void *order_arg);
 /*
  * Define the order in which RR sets get rendered by
  * dns_message_rendersection() to be the ascending order
index 5f6a3db9c191deb9d0019fa5010bb4ddc864f831..41adf742d3a4d10caf81de69528d18c197287c15 100644 (file)
@@ -15,7 +15,7 @@
  * PERFORMANCE OF THIS SOFTWARE.
  */
 
-/* $Id: name.h,v 1.95.2.3.2.12 2004/09/08 00:29:34 marka Exp $ */
+/* $Id: name.h,v 1.95.2.3.2.13 2006/02/28 06:32:54 marka Exp $ */
 
 #ifndef DNS_NAME_H
 #define DNS_NAME_H 1
@@ -589,7 +589,7 @@ dns_name_getlabelsequence(const dns_name_t *source, unsigned int first,
 
 
 void
-dns_name_clone(dns_name_t *source, dns_name_t *target);
+dns_name_clone(const dns_name_t *source, dns_name_t *target);
 /*
  * Make 'target' refer to the same name as 'source'.
  *
@@ -703,7 +703,8 @@ dns_name_fromwire(dns_name_t *name, isc_buffer_t *source,
  */
 
 isc_result_t
-dns_name_towire(dns_name_t *name, dns_compress_t *cctx, isc_buffer_t *target);
+dns_name_towire(const dns_name_t *name, dns_compress_t *cctx,
+               isc_buffer_t *target);
 /*
  * Convert 'name' into wire format, compressing it as specified by the
  * compression context 'cctx', and storing the result in 'target'.
@@ -983,7 +984,7 @@ dns_name_split(dns_name_t *name, unsigned int suffixlabels,
  */
 
 isc_result_t
-dns_name_dup(dns_name_t *source, isc_mem_t *mctx, dns_name_t *target);
+dns_name_dup(const dns_name_t *source, isc_mem_t *mctx, dns_name_t *target);
 /*
  * Make 'target' a dynamically allocated copy of 'source'.
  *
index 03f720af354825f49d996a47b4aa71d494d6eb5c..77c188d6da6bc7682cc92f970dc60638d7166b90 100644 (file)
@@ -15,7 +15,7 @@
  * PERFORMANCE OF THIS SOFTWARE.
  */
 
-/* $Id: peer.h,v 1.16.2.1.10.3 2004/03/06 08:13:58 marka Exp $ */
+/* $Id: peer.h,v 1.16.2.1.10.4 2006/02/28 06:32:54 marka Exp $ */
 
 #ifndef DNS_PEER_H
 #define DNS_PEER_H 1
@@ -167,7 +167,8 @@ isc_result_t
 dns_peer_setkey(dns_peer_t *peer, dns_name_t **keyval);
 
 isc_result_t
-dns_peer_settransfersource(dns_peer_t *peer, isc_sockaddr_t *transfer_source);
+dns_peer_settransfersource(dns_peer_t *peer,
+                          const isc_sockaddr_t *transfer_source);
 
 isc_result_t
 dns_peer_gettransfersource(dns_peer_t *peer, isc_sockaddr_t *transfer_source);
index d856784c3e88cf384208db4794e1b9a5c98ed5ed..1356b9f7072d9a0ceb3b5804432d8adf35e433f4 100644 (file)
@@ -15,7 +15,7 @@
  * PERFORMANCE OF THIS SOFTWARE.
  */
 
-/* $Id: rdataset.h,v 1.41.2.5.2.8 2005/03/17 03:58:31 marka Exp $ */
+/* $Id: rdataset.h,v 1.41.2.5.2.9 2006/02/28 06:32:54 marka Exp $ */
 
 #ifndef DNS_RDATASET_H
 #define DNS_RDATASET_H 1
@@ -365,11 +365,11 @@ dns_rdataset_towire(dns_rdataset_t *rdataset,
 
 isc_result_t
 dns_rdataset_towiresorted(dns_rdataset_t *rdataset,
-                         dns_name_t *owner_name,
+                         const dns_name_t *owner_name,
                          dns_compress_t *cctx,
                          isc_buffer_t *target,
                          dns_rdatasetorderfunc_t order,
-                         void *order_arg,
+                         const void *order_arg,
                          unsigned int options,
                          unsigned int *countp);
 /*
@@ -384,11 +384,11 @@ dns_rdataset_towiresorted(dns_rdataset_t *rdataset,
 
 isc_result_t
 dns_rdataset_towirepartial(dns_rdataset_t *rdataset,
-                          dns_name_t *owner_name,
+                          const dns_name_t *owner_name,
                           dns_compress_t *cctx,
                           isc_buffer_t *target,
                           dns_rdatasetorderfunc_t order,
-                          void *order_arg,
+                          const void *order_arg,
                           unsigned int options,
                           unsigned int *countp,
                           void **state);
index 2bad7ea02ccac00d5a94b46e08e3ca6a6972e5e2..95e35db730863e5080059f8fada2bc76d6415397 100644 (file)
@@ -15,7 +15,7 @@
  * PERFORMANCE OF THIS SOFTWARE.
  */
 
-/* $Id: types.h,v 1.103.12.7 2004/03/08 09:04:39 marka Exp $ */
+/* $Id: types.h,v 1.103.12.8 2006/02/28 06:32:54 marka Exp $ */
 
 #ifndef DNS_TYPES_H
 #define DNS_TYPES_H 1
@@ -294,6 +294,6 @@ typedef void
 (*dns_updatecallback_t)(void *, isc_result_t, dns_message_t *);
 
 typedef int 
-(*dns_rdatasetorderfunc_t)(dns_rdata_t *rdata, void *arg);
+(*dns_rdatasetorderfunc_t)(const dns_rdata_t *rdata, const void *arg);
 
 #endif /* DNS_TYPES_H */
index b7680fa277411a555061681bed460196dcf9ecbd..9d517da6a98be62a42300a497e8c295b217d79f7 100644 (file)
@@ -15,7 +15,7 @@
  * PERFORMANCE OF THIS SOFTWARE.
  */
 
-/* $Id: zone.h,v 1.106.2.7.4.15 2004/10/26 02:08:43 marka Exp $ */
+/* $Id: zone.h,v 1.106.2.7.4.16 2006/02/28 06:32:54 marka Exp $ */
 
 #ifndef DNS_ZONE_H
 #define DNS_ZONE_H 1
@@ -163,7 +163,7 @@ dns_zone_getview(dns_zone_t *zone);
  */
 
 isc_result_t
-dns_zone_setorigin(dns_zone_t *zone, dns_name_t *origin);
+dns_zone_setorigin(dns_zone_t *zone, const dns_name_t *origin);
 /*
  *     Sets the zones origin to 'origin'.
  *
@@ -414,11 +414,13 @@ dns_zone_maintenance(dns_zone_t *zone);
  */
 
 isc_result_t
-dns_zone_setmasters(dns_zone_t *zone, isc_sockaddr_t *masters,
+dns_zone_setmasters(dns_zone_t *zone, const isc_sockaddr_t *masters,
                    isc_uint32_t count);
 isc_result_t
-dns_zone_setmasterswithkeys(dns_zone_t *zone, isc_sockaddr_t *masters,
-                           dns_name_t **keynames, isc_uint32_t count);
+dns_zone_setmasterswithkeys(dns_zone_t *zone,
+                           const isc_sockaddr_t *masters,
+                           dns_name_t **keynames,
+                           isc_uint32_t count);
 /*
  *     Set the list of master servers for the zone.
  *
@@ -440,7 +442,7 @@ dns_zone_setmasterswithkeys(dns_zone_t *zone, isc_sockaddr_t *masters,
  */
 
 isc_result_t
-dns_zone_setalsonotify(dns_zone_t *zone, isc_sockaddr_t *notify,
+dns_zone_setalsonotify(dns_zone_t *zone, const isc_sockaddr_t *notify,
                       isc_uint32_t count);
 /*
  *     Set the list of additional servers to be notified when
@@ -525,9 +527,10 @@ dns_zone_setmaxretrytime(dns_zone_t *zone, isc_uint32_t val);
  */
 
 isc_result_t
-dns_zone_setxfrsource4(dns_zone_t *zone, isc_sockaddr_t *xfrsource);
+dns_zone_setxfrsource4(dns_zone_t *zone, const isc_sockaddr_t *xfrsource);
 isc_result_t
-dns_zone_setaltxfrsource4(dns_zone_t *zone, isc_sockaddr_t *xfrsource);
+dns_zone_setaltxfrsource4(dns_zone_t *zone,
+                         const isc_sockaddr_t *xfrsource);
 /*
  *     Set the source address to be used in IPv4 zone transfers.
  *
@@ -552,9 +555,10 @@ dns_zone_getaltxfrsource4(dns_zone_t *zone);
  */
 
 isc_result_t
-dns_zone_setxfrsource6(dns_zone_t *zone, isc_sockaddr_t *xfrsource);
+dns_zone_setxfrsource6(dns_zone_t *zone, const isc_sockaddr_t *xfrsource);
 isc_result_t
-dns_zone_setaltxfrsource6(dns_zone_t *zone, isc_sockaddr_t *xfrsource);
+dns_zone_setaltxfrsource6(dns_zone_t *zone,
+                        const isc_sockaddr_t *xfrsource);
 /*
  *     Set the source address to be used in IPv6 zone transfers.
  *
@@ -579,7 +583,7 @@ dns_zone_getaltxfrsource6(dns_zone_t *zone);
  */
 
 isc_result_t
-dns_zone_setnotifysrc4(dns_zone_t *zone, isc_sockaddr_t *notifysrc);
+dns_zone_setnotifysrc4(dns_zone_t *zone, const isc_sockaddr_t *notifysrc);
 /*
  *     Set the source address to be used with IPv4 NOTIFY messages.
  *
@@ -602,7 +606,7 @@ dns_zone_getnotifysrc4(dns_zone_t *zone);
  */
 
 isc_result_t
-dns_zone_setnotifysrc6(dns_zone_t *zone, isc_sockaddr_t *notifysrc);
+dns_zone_setnotifysrc6(dns_zone_t *zone, const isc_sockaddr_t *notifysrc);
 /*
  *     Set the source address to be used with IPv6 NOTIFY messages.
  *
index cdcd74e4142e0c5e9570205d71e639f12fa6bf1a..33875433f6aa05f6ecdb19a053af0c8a8fb80608 100644 (file)
@@ -15,7 +15,7 @@
  * PERFORMANCE OF THIS SOFTWARE.
  */
 
-/* $Id: message.c,v 1.194.2.10.2.23 2006/01/05 01:04:10 marka Exp $ */
+/* $Id: message.c,v 1.194.2.10.2.24 2006/02/28 06:32:54 marka Exp $ */
 
 /***
  *** Imports
@@ -1823,7 +1823,7 @@ dns_message_rendersection(dns_message_t *msg, dns_section_t sectionid,
                if (rdataset != NULL &&
                    (rdataset->attributes & DNS_RDATASETATTR_REQUIREDGLUE) != 0 &&
                    (rdataset->attributes & DNS_RDATASETATTR_RENDERED) == 0) {
-                       void *order_arg = msg->order_arg;
+                       const void *order_arg = msg->order_arg;
                        st = *(msg->buffer);
                        count = 0;
                        if (partial)
@@ -3211,7 +3211,7 @@ dns_message_getrawmessage(dns_message_t *msg) {
 
 void
 dns_message_setsortorder(dns_message_t *msg, dns_rdatasetorderfunc_t order,
-                        void *order_arg)
+                        const void *order_arg)
 {
        REQUIRE(DNS_MESSAGE_VALID(msg));
        msg->order = order;
index 116a56a8186785da248a4dff73f8f3f814031367..5eaf0dc5501b91b4a6aaf0ea020552634179fcbc 100644 (file)
@@ -15,7 +15,7 @@
  * PERFORMANCE OF THIS SOFTWARE.
  */
 
-/* $Id: name.c,v 1.127.2.7.2.14 2005/10/14 01:38:48 marka Exp $ */
+/* $Id: name.c,v 1.127.2.7.2.15 2006/02/28 06:32:54 marka Exp $ */
 
 #include <config.h>
 
@@ -856,7 +856,7 @@ dns_name_getlabelsequence(const dns_name_t *source,
 }
 
 void
-dns_name_clone(dns_name_t *source, dns_name_t *target) {
+dns_name_clone(const dns_name_t *source, dns_name_t *target) {
 
        /*
         * Make 'target' refer to the same name as 'source'.
@@ -1748,7 +1748,9 @@ dns_name_fromwire(dns_name_t *name, isc_buffer_t *source,
 }
 
 isc_result_t
-dns_name_towire(dns_name_t *name, dns_compress_t *cctx, isc_buffer_t *target) {
+dns_name_towire(const dns_name_t *name, dns_compress_t *cctx,
+               isc_buffer_t *target)
+{
        unsigned int methods;
        isc_uint16_t offset;
        dns_name_t gp;  /* Global compression prefix */
@@ -1962,7 +1964,9 @@ dns_name_split(dns_name_t *name, unsigned int suffixlabels,
 }
 
 isc_result_t
-dns_name_dup(dns_name_t *source, isc_mem_t *mctx, dns_name_t *target) {
+dns_name_dup(const dns_name_t *source, isc_mem_t *mctx,
+            dns_name_t *target)
+{
        /*
         * Make 'target' a dynamically allocated copy of 'source'.
         */
index a50ff0c9abe5f9d2e252562c2a95c0e9a660f238..687f68abce3c755a1211deb8dad2ae09c7f6a5cd 100644 (file)
@@ -15,7 +15,7 @@
  * PERFORMANCE OF THIS SOFTWARE.
  */
 
-/* $Id: peer.c,v 1.14.2.1.10.4 2004/03/06 08:13:41 marka Exp $ */
+/* $Id: peer.c,v 1.14.2.1.10.5 2006/02/28 06:32:54 marka Exp $ */
 
 #include <config.h>
 
@@ -491,7 +491,9 @@ dns_peer_setkeybycharp(dns_peer_t *peer, const char *keyval) {
 }
 
 isc_result_t
-dns_peer_settransfersource(dns_peer_t *peer, isc_sockaddr_t *transfer_source) {
+dns_peer_settransfersource(dns_peer_t *peer,
+                          const isc_sockaddr_t *transfer_source)
+{
        REQUIRE(DNS_PEER_VALID(peer));
 
        if (peer->transfer_source != NULL) {
index 672777b02f50541ce59b6fa09dc3e8538d0984e5..3a79d0b20cad2bdf6321fd24d9b122320294ab08 100644 (file)
@@ -15,7 +15,7 @@
  * PERFORMANCE OF THIS SOFTWARE.
  */
 
-/* $Id: rdataset.c,v 1.58.2.2.2.10 2004/03/08 09:04:31 marka Exp $ */
+/* $Id: rdataset.c,v 1.58.2.2.2.11 2006/02/28 06:32:54 marka Exp $ */
 
 #include <config.h>
 
@@ -280,9 +280,9 @@ towire_compare(const void *av, const void *bv) {
 }
 
 static isc_result_t
-towiresorted(dns_rdataset_t *rdataset, dns_name_t *owner_name,
+towiresorted(dns_rdataset_t *rdataset, const dns_name_t *owner_name,
             dns_compress_t *cctx, isc_buffer_t *target,
-            dns_rdatasetorderfunc_t order, void *order_arg,
+            dns_rdatasetorderfunc_t order, const void *order_arg,
             isc_boolean_t partial, unsigned int options,
             unsigned int *countp, void **state)
 {
@@ -528,11 +528,11 @@ towiresorted(dns_rdataset_t *rdataset, dns_name_t *owner_name,
 
 isc_result_t
 dns_rdataset_towiresorted(dns_rdataset_t *rdataset,
-                         dns_name_t *owner_name,
+                         const dns_name_t *owner_name,
                          dns_compress_t *cctx,
                          isc_buffer_t *target,
                          dns_rdatasetorderfunc_t order,
-                         void *order_arg,
+                         const void *order_arg,
                          unsigned int options,
                          unsigned int *countp)
 {
@@ -543,11 +543,11 @@ dns_rdataset_towiresorted(dns_rdataset_t *rdataset,
 
 isc_result_t
 dns_rdataset_towirepartial(dns_rdataset_t *rdataset,
-                          dns_name_t *owner_name,
+                          const dns_name_t *owner_name,
                           dns_compress_t *cctx,
                           isc_buffer_t *target,
                           dns_rdatasetorderfunc_t order,
-                          void *order_arg,
+                          const void *order_arg,
                           unsigned int options,
                           unsigned int *countp,
                           void **state)
index 40a6b793a0e3b203751939a85779a3c2667c5745..0593be26c8e8ed38965a9e2939aa2de950e8e9b5 100644 (file)
@@ -15,7 +15,7 @@
  * PERFORMANCE OF THIS SOFTWARE.
  */
 
-/* $Id: zone.c,v 1.333.2.23.2.62 2006/01/04 03:43:20 marka Exp $ */
+/* $Id: zone.c,v 1.333.2.23.2.63 2006/02/28 06:32:54 marka Exp $ */
 
 #include <config.h>
 
@@ -805,7 +805,7 @@ dns_zone_getview(dns_zone_t *zone) {
 
 
 isc_result_t
-dns_zone_setorigin(dns_zone_t *zone, dns_name_t *origin) {
+dns_zone_setorigin(dns_zone_t *zone, const dns_name_t *origin) {
        isc_result_t result;
 
        REQUIRE(DNS_ZONE_VALID(zone));
@@ -1823,7 +1823,7 @@ dns_zone_getoptions(dns_zone_t *zone) {
 }
 
 isc_result_t
-dns_zone_setxfrsource4(dns_zone_t *zone, isc_sockaddr_t *xfrsource) {
+dns_zone_setxfrsource4(dns_zone_t *zone, const isc_sockaddr_t *xfrsource) {
        REQUIRE(DNS_ZONE_VALID(zone));
 
        LOCK_ZONE(zone);
@@ -1840,7 +1840,7 @@ dns_zone_getxfrsource4(dns_zone_t *zone) {
 }
 
 isc_result_t
-dns_zone_setxfrsource6(dns_zone_t *zone, isc_sockaddr_t *xfrsource) {
+dns_zone_setxfrsource6(dns_zone_t *zone, const isc_sockaddr_t *xfrsource) {
        REQUIRE(DNS_ZONE_VALID(zone));
 
        LOCK_ZONE(zone);
@@ -1857,7 +1857,9 @@ dns_zone_getxfrsource6(dns_zone_t *zone) {
 }
 
 isc_result_t
-dns_zone_setaltxfrsource4(dns_zone_t *zone, isc_sockaddr_t *altxfrsource) {
+dns_zone_setaltxfrsource4(dns_zone_t *zone,
+                         const isc_sockaddr_t *altxfrsource)
+{
        REQUIRE(DNS_ZONE_VALID(zone));
 
        LOCK_ZONE(zone);
@@ -1874,7 +1876,9 @@ dns_zone_getaltxfrsource4(dns_zone_t *zone) {
 }
 
 isc_result_t
-dns_zone_setaltxfrsource6(dns_zone_t *zone, isc_sockaddr_t *altxfrsource) {
+dns_zone_setaltxfrsource6(dns_zone_t *zone,
+                         const isc_sockaddr_t *altxfrsource)
+{
        REQUIRE(DNS_ZONE_VALID(zone));
 
        LOCK_ZONE(zone);
@@ -1891,7 +1895,7 @@ dns_zone_getaltxfrsource6(dns_zone_t *zone) {
 }
 
 isc_result_t
-dns_zone_setnotifysrc4(dns_zone_t *zone, isc_sockaddr_t *notifysrc) {
+dns_zone_setnotifysrc4(dns_zone_t *zone, const isc_sockaddr_t *notifysrc) {
        REQUIRE(DNS_ZONE_VALID(zone));
 
        LOCK_ZONE(zone);
@@ -1908,7 +1912,7 @@ dns_zone_getnotifysrc4(dns_zone_t *zone) {
 }
 
 isc_result_t
-dns_zone_setnotifysrc6(dns_zone_t *zone, isc_sockaddr_t *notifysrc) {
+dns_zone_setnotifysrc6(dns_zone_t *zone, const isc_sockaddr_t *notifysrc) {
        REQUIRE(DNS_ZONE_VALID(zone));
 
        LOCK_ZONE(zone);
@@ -1925,7 +1929,7 @@ dns_zone_getnotifysrc6(dns_zone_t *zone) {
 }
 
 isc_result_t
-dns_zone_setalsonotify(dns_zone_t *zone, isc_sockaddr_t *notify,
+dns_zone_setalsonotify(dns_zone_t *zone, const isc_sockaddr_t *notify,
                       isc_uint32_t count)
 {
        isc_sockaddr_t *new;
@@ -1955,7 +1959,7 @@ dns_zone_setalsonotify(dns_zone_t *zone, isc_sockaddr_t *notify,
 }
 
 isc_result_t
-dns_zone_setmasters(dns_zone_t *zone, isc_sockaddr_t *masters,
+dns_zone_setmasters(dns_zone_t *zone, const isc_sockaddr_t *masters,
                    isc_uint32_t count)
 {
        isc_result_t result;
@@ -1965,8 +1969,10 @@ dns_zone_setmasters(dns_zone_t *zone, isc_sockaddr_t *masters,
 }
 
 isc_result_t
-dns_zone_setmasterswithkeys(dns_zone_t *zone, isc_sockaddr_t *masters,
-                           dns_name_t **keynames, isc_uint32_t count)
+dns_zone_setmasterswithkeys(dns_zone_t *zone,
+                           const isc_sockaddr_t *masters,
+                           dns_name_t **keynames,
+                           isc_uint32_t count)
 {
        isc_sockaddr_t *new;
        isc_result_t result = ISC_R_SUCCESS;
index 1ffbca640fc11a72467f56941891d561cb9fdfc9..a502de708ac27e54cbd047116a0baa0c86d30d65 100644 (file)
@@ -15,7 +15,7 @@
  * PERFORMANCE OF THIS SOFTWARE.
  */
 
-/* $Id: sockaddr.h,v 1.35.12.8 2005/07/29 00:13:10 marka Exp $ */
+/* $Id: sockaddr.h,v 1.35.12.9 2006/02/28 06:32:54 marka Exp $ */
 
 #ifndef ISC_SOCKADDR_H
 #define ISC_SOCKADDR_H 1
@@ -141,7 +141,7 @@ isc_sockaddr_setport(isc_sockaddr_t *sockaddr, in_port_t port);
  */
 
 in_port_t
-isc_sockaddr_getport(isc_sockaddr_t *sockaddr);
+isc_sockaddr_getport(const isc_sockaddr_t *sockaddr);
 /*
  * Get the port stored in 'sockaddr'.
  */
@@ -168,25 +168,25 @@ isc_sockaddr_format(const isc_sockaddr_t *sa, char *array, unsigned int size);
  */
 
 isc_boolean_t
-isc_sockaddr_ismulticast(isc_sockaddr_t *sa);
+isc_sockaddr_ismulticast(const isc_sockaddr_t *sa);
 /*
  * Returns ISC_TRUE if the address is a multicast address.
  */
 
 isc_boolean_t
-isc_sockaddr_isexperimental(isc_sockaddr_t *sa);
+isc_sockaddr_isexperimental(const isc_sockaddr_t *sa);
 /*
  * Returns ISC_TRUE if the address is a experimental (CLASS E) address.
  */
 
 isc_boolean_t
-isc_sockaddr_islinklocal(isc_sockaddr_t *sa);
+isc_sockaddr_islinklocal(const isc_sockaddr_t *sa);
 /*
  * Returns ISC_TRUE if the address is a link local addresss.
  */
 
 isc_boolean_t
-isc_sockaddr_issitelocal(isc_sockaddr_t *sa);
+isc_sockaddr_issitelocal(const isc_sockaddr_t *sa);
 /*
  * Returns ISC_TRUE if the address is a sitelocal address.
  */
index d8dbd2107ec5531f51177ed2d983af0274ebb73a..bd0c68cd5588a2cf2d557c9ac6a7026aaa163323 100644 (file)
@@ -15,7 +15,7 @@
  * PERFORMANCE OF THIS SOFTWARE.
  */
 
-/* $Id: symtab.h,v 1.16.206.1 2004/03/06 08:14:49 marka Exp $ */
+/* $Id: symtab.h,v 1.16.206.2 2006/02/28 06:32:54 marka Exp $ */
 
 #ifndef ISC_SYMTAB_H
 #define ISC_SYMTAB_H 1
@@ -88,6 +88,7 @@
 
 typedef union isc_symvalue {
        void *                          as_pointer;
+       const void *                    as_cpointer;
        int                             as_integer;
        unsigned int                    as_uinteger;
 } isc_symvalue_t;
index 4c47e4e06bcea01244f7b43405cb7a323b830216..2647a27424ac66ac09ee47b34d03fed25d568b04 100644 (file)
@@ -15,7 +15,7 @@
  * PERFORMANCE OF THIS SOFTWARE.
  */
 
-/* $Id: sockaddr.c,v 1.48.2.1.2.10 2004/05/15 03:46:12 jinmei Exp $ */
+/* $Id: sockaddr.c,v 1.48.2.1.2.11 2006/02/28 06:32:54 marka Exp $ */
 
 #include <config.h>
 
@@ -400,7 +400,7 @@ isc_sockaddr_setport(isc_sockaddr_t *sockaddr, in_port_t port) {
 }
 
 in_port_t
-isc_sockaddr_getport(isc_sockaddr_t *sockaddr) {
+isc_sockaddr_getport(const isc_sockaddr_t *sockaddr) {
        in_port_t port = 0;
 
        switch (sockaddr->type.sa.sa_family) {
@@ -422,7 +422,7 @@ isc_sockaddr_getport(isc_sockaddr_t *sockaddr) {
 }
 
 isc_boolean_t
-isc_sockaddr_ismulticast(isc_sockaddr_t *sockaddr) {
+isc_sockaddr_ismulticast(const isc_sockaddr_t *sockaddr) {
        isc_netaddr_t netaddr;
 
        isc_netaddr_fromsockaddr(&netaddr, sockaddr);
@@ -430,7 +430,7 @@ isc_sockaddr_ismulticast(isc_sockaddr_t *sockaddr) {
 }
 
 isc_boolean_t
-isc_sockaddr_isexperimental(isc_sockaddr_t *sockaddr) {
+isc_sockaddr_isexperimental(const isc_sockaddr_t *sockaddr) {
        isc_netaddr_t netaddr;
 
        if (sockaddr->type.sa.sa_family == AF_INET) {
@@ -441,7 +441,7 @@ isc_sockaddr_isexperimental(isc_sockaddr_t *sockaddr) {
 }
 
 isc_boolean_t
-isc_sockaddr_issitelocal(isc_sockaddr_t *sockaddr) {
+isc_sockaddr_issitelocal(const isc_sockaddr_t *sockaddr) {
        isc_netaddr_t netaddr;
 
        if (sockaddr->type.sa.sa_family == AF_INET6) {
@@ -452,7 +452,7 @@ isc_sockaddr_issitelocal(isc_sockaddr_t *sockaddr) {
 }
 
 isc_boolean_t
-isc_sockaddr_islinklocal(isc_sockaddr_t *sockaddr) {
+isc_sockaddr_islinklocal(const isc_sockaddr_t *sockaddr) {
        isc_netaddr_t netaddr;
 
        if (sockaddr->type.sa.sa_family == AF_INET6) {
index b4081cd7b38354935ef34a283481bfe23b186b0f..92983b1328b00a021b9ea6054d3004b40c18a490 100644 (file)
@@ -15,7 +15,7 @@
  * PERFORMANCE OF THIS SOFTWARE.
  */
 
-/* $Id: cfg.h,v 1.30.12.4 2004/03/08 09:05:07 marka Exp $ */
+/* $Id: cfg.h,v 1.30.12.5 2006/02/28 06:32:54 marka Exp $ */
 
 #ifndef ISCCFG_CFG_H
 #define ISCCFG_CFG_H 1
@@ -74,7 +74,7 @@ typedef struct cfg_listelt cfg_listelt_t;
  * "directory".
  */
 typedef isc_result_t
-(*cfg_parsecallback_t)(const char *clausename, cfg_obj_t *obj, void *arg);
+(*cfg_parsecallback_t)(const char *clausename, const cfg_obj_t *obj, void *arg);
 
 /***
  *** Functions
@@ -143,20 +143,20 @@ cfg_parser_destroy(cfg_parser_t **pctxp);
  */
 
 isc_boolean_t
-cfg_obj_isvoid(cfg_obj_t *obj);
+cfg_obj_isvoid(const cfg_obj_t *obj);
 /*
  * Return true iff 'obj' is of void type (e.g., an optional 
  * value not specified).
  */
 
 isc_boolean_t
-cfg_obj_ismap(cfg_obj_t *obj);
+cfg_obj_ismap(const cfg_obj_t *obj);
 /*
  * Return true iff 'obj' is of a map type.
  */
 
 isc_result_t
-cfg_map_get(cfg_obj_t *mapobj, const char* name, cfg_obj_t **obj);
+cfg_map_get(const cfg_obj_t *mapobj, const char* name, const cfg_obj_t **obj);
 /*
  * Extract an element from a configuration object, which
  * must be of a map type.
@@ -171,8 +171,8 @@ cfg_map_get(cfg_obj_t *mapobj, const char* name, cfg_obj_t **obj);
  *      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.
  *
@@ -185,13 +185,13 @@ cfg_map_getname(cfg_obj_t *mapobj);
  */
 
 isc_boolean_t
-cfg_obj_istuple(cfg_obj_t *obj);
+cfg_obj_istuple(const cfg_obj_t *obj);
 /*
  * Return true iff 'obj' is of a map type.
  */
 
-cfg_obj_t *
-cfg_tuple_get(cfg_obj_t *tupleobj, const char *name);
+const cfg_obj_t *
+cfg_tuple_get(const cfg_obj_t *tupleobj, const char *name);
 /*
  * Extract an element from a configuration object, which
  * must be of a tuple type.
@@ -203,13 +203,13 @@ cfg_tuple_get(cfg_obj_t *tupleobj, const char *name);
  */
 
 isc_boolean_t
-cfg_obj_isuint32(cfg_obj_t *obj);
+cfg_obj_isuint32(const cfg_obj_t *obj);
 /*
  * Return true iff 'obj' is of integer type.
  */
 
 isc_uint32_t
-cfg_obj_asuint32(cfg_obj_t *obj);
+cfg_obj_asuint32(const cfg_obj_t *obj);
 /*
  * Returns the value of a configuration object of 32-bit integer type.
  *
@@ -221,13 +221,13 @@ cfg_obj_asuint32(cfg_obj_t *obj);
  */
 
 isc_boolean_t
-cfg_obj_isuint64(cfg_obj_t *obj);
+cfg_obj_isuint64(const cfg_obj_t *obj);
 /*
  * Return true iff 'obj' is of integer type.
  */
 
 isc_uint64_t
-cfg_obj_asuint64(cfg_obj_t *obj);
+cfg_obj_asuint64(const cfg_obj_t *obj);
 /*
  * Returns the value of a configuration object of 64-bit integer type.
  *
@@ -239,13 +239,13 @@ cfg_obj_asuint64(cfg_obj_t *obj);
  */
 
 isc_boolean_t
-cfg_obj_isstring(cfg_obj_t *obj);
+cfg_obj_isstring(const cfg_obj_t *obj);
 /*
  * Return true iff 'obj' is of string type.
  */
 
-char *
-cfg_obj_asstring(cfg_obj_t *obj);
+const char *
+cfg_obj_asstring(const cfg_obj_t *obj);
 /*
  * Returns the value of a configuration object of a string type
  * as a null-terminated string.
@@ -258,13 +258,13 @@ cfg_obj_asstring(cfg_obj_t *obj);
  */
 
 isc_boolean_t
-cfg_obj_isboolean(cfg_obj_t *obj);
+cfg_obj_isboolean(const cfg_obj_t *obj);
 /*
  * Return true iff 'obj' is of a boolean type.
  */
 
 isc_boolean_t
-cfg_obj_asboolean(cfg_obj_t *obj);
+cfg_obj_asboolean(const cfg_obj_t *obj);
 /*
  * Returns the value of a configuration object of a boolean type.
  *
@@ -276,13 +276,13 @@ cfg_obj_asboolean(cfg_obj_t *obj);
  */
 
 isc_boolean_t
-cfg_obj_issockaddr(cfg_obj_t *obj);
+cfg_obj_issockaddr(const cfg_obj_t *obj);
 /*
  * Return true iff 'obj' is a socket address.
  */
 
-isc_sockaddr_t *
-cfg_obj_assockaddr(cfg_obj_t *obj);
+const isc_sockaddr_t *
+cfg_obj_assockaddr(const cfg_obj_t *obj);
 /*
  * Returns the value of a configuration object representing a socket address.
  *
@@ -295,13 +295,13 @@ cfg_obj_assockaddr(cfg_obj_t *obj);
  */
 
 isc_boolean_t
-cfg_obj_isnetprefix(cfg_obj_t *obj);
+cfg_obj_isnetprefix(const cfg_obj_t *obj);
 /*
  * Return true iff 'obj' is a network prefix.
  */
 
 void
-cfg_obj_asnetprefix(cfg_obj_t *obj, isc_netaddr_t *netaddr,
+cfg_obj_asnetprefix(const cfg_obj_t *obj, isc_netaddr_t *netaddr,
                    unsigned int *prefixlen);
 /*
  * Gets the value of a configuration object representing a network
@@ -314,13 +314,13 @@ cfg_obj_asnetprefix(cfg_obj_t *obj, isc_netaddr_t *netaddr,
  */
 
 isc_boolean_t
-cfg_obj_islist(cfg_obj_t *obj);
+cfg_obj_islist(const cfg_obj_t *obj);
 /*
  * Return true iff 'obj' is of list type.
  */
 
-cfg_listelt_t *
-cfg_list_first(cfg_obj_t *obj);
+const cfg_listelt_t *
+cfg_list_first(const cfg_obj_t *obj);
 /*
  * Returns the first list element in a configuration object of a list type.
  *
@@ -332,8 +332,8 @@ cfg_list_first(cfg_obj_t *obj);
  *     or NULL if the list is empty or nonexistent.
  */
 
-cfg_listelt_t *
-cfg_list_next(cfg_listelt_t *elt);
+const cfg_listelt_t *
+cfg_list_next(const cfg_listelt_t *elt);
 /*
  * Returns the next element of a list of configuration objects.
  *
@@ -346,8 +346,8 @@ cfg_list_next(cfg_listelt_t *elt);
  *     or NULL if there are no more elements.
  */
 
-cfg_obj_t *
-cfg_listelt_value(cfg_listelt_t *elt);
+const cfg_obj_t *
+cfg_listelt_value(const cfg_listelt_t *elt);
 /*
  * Returns the configuration object associated with cfg_listelt_t.
  *
@@ -360,7 +360,7 @@ cfg_listelt_value(cfg_listelt_t *elt);
  */
 
 void
-cfg_print(cfg_obj_t *obj,
+cfg_print(const cfg_obj_t *obj,
          void (*f)(void *closure, const char *text, int textlen),
          void *closure);
 /*
@@ -378,7 +378,7 @@ cfg_print_grammar(const cfg_type_t *type,
  */
 
 isc_boolean_t
-cfg_obj_istype(cfg_obj_t *obj, const cfg_type_t *type);
+cfg_obj_istype(const cfg_obj_t *obj, const cfg_type_t *type);
 /*
  * Return true iff 'obj' is of type 'type'. 
  */
@@ -389,7 +389,8 @@ void cfg_obj_destroy(cfg_parser_t *pctx, cfg_obj_t **obj);
  */
 
 void
-cfg_obj_log(cfg_obj_t *obj, isc_log_t *lctx, int level, const char *fmt, ...)
+cfg_obj_log(const cfg_obj_t *obj, isc_log_t *lctx, int level,
+            const char *fmt, ...)
        ISC_FORMAT_PRINTF(4, 5);
 /*
  * Log a message concerning configuration object 'obj' to the logging
@@ -398,13 +399,13 @@ cfg_obj_log(cfg_obj_t *obj, isc_log_t *lctx, int level, const char *fmt, ...)
  */
 
 const char *
-cfg_obj_file(cfg_obj_t *obj);
+cfg_obj_file(const cfg_obj_t *obj);
 /*
  * Return the file that defined this object.
  */
 
 unsigned int
-cfg_obj_line(cfg_obj_t *obj);
+cfg_obj_line(const cfg_obj_t *obj);
 /*
  * Return the line in file where this object was defined.
  */
index 92b142b7ac75fa180ec90108f0742062cbb762bd..1b2ba0bf44111865cbfe9ee516ce533289494a18 100644 (file)
@@ -15,7 +15,7 @@
  * PERFORMANCE OF THIS SOFTWARE.
  */
 
-/* $Id: grammar.h,v 1.3.50.4 2004/11/30 01:15:44 marka Exp $ */
+/* $Id: grammar.h,v 1.3.50.5 2006/02/28 06:32:54 marka Exp $ */
 
 #ifndef ISCCFG_GRAMMAR_H
 #define ISCCFG_GRAMMAR_H 1
@@ -63,7 +63,7 @@ typedef struct cfg_rep cfg_rep_t;
 
 typedef isc_result_t (*cfg_parsefunc_t)(cfg_parser_t *, const cfg_type_t *type,
                                        cfg_obj_t **);
-typedef void        (*cfg_printfunc_t)(cfg_printer_t *, cfg_obj_t *);
+typedef void        (*cfg_printfunc_t)(cfg_printer_t *, const cfg_obj_t *);
 typedef void        (*cfg_docfunc_t)(cfg_printer_t *, const cfg_type_t *);
 typedef void        (*cfg_freefunc_t)(cfg_parser_t *, cfg_obj_t *);
 
@@ -156,7 +156,7 @@ struct cfg_obj {
                isc_sockaddr_t  sockaddr;
                cfg_netprefix_t netprefix;
        }               value;
-       char *          file;
+       const char *    file;
        unsigned int    line;
 };
 
@@ -274,16 +274,16 @@ isc_result_t
 cfg_parse_uint32(cfg_parser_t *pctx, const cfg_type_t *type, cfg_obj_t **ret);
 
 void
-cfg_print_uint32(cfg_printer_t *pctx, cfg_obj_t *obj);
+cfg_print_uint32(cfg_printer_t *pctx, const cfg_obj_t *obj);
 
 void
-cfg_print_uint64(cfg_printer_t *pctx, cfg_obj_t *obj);
+cfg_print_uint64(cfg_printer_t *pctx, const cfg_obj_t *obj);
 
 isc_result_t
 cfg_parse_qstring(cfg_parser_t *pctx, const cfg_type_t *type, cfg_obj_t **ret);
 
 void
-cfg_print_ustring(cfg_printer_t *pctx, cfg_obj_t *obj);
+cfg_print_ustring(cfg_printer_t *pctx, const cfg_obj_t *obj);
 
 isc_result_t
 cfg_parse_astring(cfg_parser_t *pctx, const cfg_type_t *type, cfg_obj_t **ret);
@@ -292,7 +292,7 @@ isc_result_t
 cfg_parse_rawaddr(cfg_parser_t *pctx, unsigned int flags, isc_netaddr_t *na);
 
 void
-cfg_print_rawaddr(cfg_printer_t *pctx, isc_netaddr_t *na);
+cfg_print_rawaddr(cfg_printer_t *pctx, const isc_netaddr_t *na);
 
 isc_boolean_t
 cfg_lookingat_netaddr(cfg_parser_t *pctx, unsigned int flags);
@@ -304,7 +304,7 @@ isc_result_t
 cfg_parse_sockaddr(cfg_parser_t *pctx, const cfg_type_t *type, cfg_obj_t **ret);
 
 void
-cfg_print_sockaddr(cfg_printer_t *pctx, cfg_obj_t *obj);
+cfg_print_sockaddr(cfg_printer_t *pctx, const cfg_obj_t *obj);
 
 void
 cfg_doc_sockaddr(cfg_printer_t *pctx, const cfg_type_t *type);
@@ -323,7 +323,7 @@ isc_result_t
 cfg_parse_tuple(cfg_parser_t *pctx, const cfg_type_t *type, cfg_obj_t **ret);
 
 void
-cfg_print_tuple(cfg_printer_t *pctx, cfg_obj_t *obj);
+cfg_print_tuple(cfg_printer_t *pctx, const cfg_obj_t *obj);
 
 void
 cfg_doc_tuple(cfg_printer_t *pctx, const cfg_type_t *type);
@@ -339,7 +339,7 @@ isc_result_t
 cfg_parse_bracketed_list(cfg_parser_t *pctx, const cfg_type_t *type, cfg_obj_t **ret);
 
 void
-cfg_print_bracketed_list(cfg_printer_t *pctx, cfg_obj_t *obj);
+cfg_print_bracketed_list(cfg_printer_t *pctx, const cfg_obj_t *obj);
 
 void
 cfg_doc_bracketed_list(cfg_printer_t *pctx, const cfg_type_t *type);
@@ -348,7 +348,7 @@ isc_result_t
 cfg_parse_spacelist(cfg_parser_t *pctx, const cfg_type_t *type, cfg_obj_t **ret);
 
 void
-cfg_print_spacelist(cfg_printer_t *pctx, cfg_obj_t *obj);
+cfg_print_spacelist(cfg_printer_t *pctx, const cfg_obj_t *obj);
 
 isc_result_t
 cfg_parse_enum(cfg_parser_t *pctx, const cfg_type_t *type, cfg_obj_t **ret);
@@ -374,7 +374,7 @@ isc_result_t
 cfg_parse_addressed_map(cfg_parser_t *pctx, const cfg_type_t *type, cfg_obj_t **ret);
 
 void
-cfg_print_map(cfg_printer_t *pctx, cfg_obj_t *obj);
+cfg_print_map(cfg_printer_t *pctx, const cfg_obj_t *obj);
 
 void
 cfg_doc_map(cfg_printer_t *pctx, const cfg_type_t *type);
@@ -383,7 +383,7 @@ isc_result_t
 cfg_parse_mapbody(cfg_parser_t *pctx, const cfg_type_t *type, cfg_obj_t **ret);
 
 void
-cfg_print_mapbody(cfg_printer_t *pctx, cfg_obj_t *obj);
+cfg_print_mapbody(cfg_printer_t *pctx, const cfg_obj_t *obj);
 
 void
 cfg_doc_mapbody(cfg_printer_t *pctx, const cfg_type_t *type);
@@ -392,7 +392,7 @@ isc_result_t
 cfg_parse_void(cfg_parser_t *pctx, const cfg_type_t *type, cfg_obj_t **ret);
 
 void
-cfg_print_void(cfg_printer_t *pctx, cfg_obj_t *obj);
+cfg_print_void(cfg_printer_t *pctx, const cfg_obj_t *obj);
 
 void
 cfg_doc_void(cfg_printer_t *pctx, const cfg_type_t *type);
@@ -401,7 +401,7 @@ isc_result_t
 cfg_parse_obj(cfg_parser_t *pctx, const cfg_type_t *type, cfg_obj_t **ret);
 
 void
-cfg_print_obj(cfg_printer_t *pctx, cfg_obj_t *obj);
+cfg_print_obj(cfg_printer_t *pctx, const cfg_obj_t *obj);
 
 void
 cfg_doc_obj(cfg_printer_t *pctx, const cfg_type_t *type);
index bfc5dda425e6585c6f4647588165576479bf2918..ca281b1934cc6a89b41fadae043379e3aef46449 100644 (file)
@@ -15,7 +15,7 @@
  * PERFORMANCE OF THIS SOFTWARE.
  */
 
-/* $Id: namedconf.c,v 1.21.44.32 2005/10/26 05:06:40 marka Exp $ */
+/* $Id: namedconf.c,v 1.21.44.33 2006/02/28 06:32:54 marka Exp $ */
 
 #include <config.h>
 
@@ -58,7 +58,7 @@ static isc_result_t
 parse_optional_keyvalue(cfg_parser_t *pctx, const cfg_type_t *type, cfg_obj_t **ret);
 
 static void
-print_keyvalue(cfg_printer_t *pctx, cfg_obj_t *obj);
+print_keyvalue(cfg_printer_t *pctx, const cfg_obj_t *obj);
 
 static void
 doc_keyvalue(cfg_printer_t *pctx, const cfg_type_t *type);
@@ -428,7 +428,7 @@ static cfg_type_t cfg_type_transferformat = {
  */
 
 static void
-print_none(cfg_printer_t *pctx, cfg_obj_t *obj) {
+print_none(cfg_printer_t *pctx, const cfg_obj_t *obj) {
        UNUSED(obj);
        cfg_print_chars(pctx, "none", 4);
 }
@@ -469,7 +469,7 @@ static cfg_type_t cfg_type_qstringornone = {
  */
 
 static void
-print_hostname(cfg_printer_t *pctx, cfg_obj_t *obj) {
+print_hostname(cfg_printer_t *pctx, const cfg_obj_t *obj) {
        UNUSED(obj);
        cfg_print_chars(pctx, "hostname", 4);
 }
@@ -1127,7 +1127,7 @@ parse_optional_keyvalue(cfg_parser_t *pctx, const cfg_type_t *type, cfg_obj_t **
 }
 
 static void
-print_keyvalue(cfg_printer_t *pctx, cfg_obj_t *obj) {
+print_keyvalue(cfg_printer_t *pctx, const cfg_obj_t *obj) {
        const keyword_type_t *kw = obj->type->of;
        cfg_print_cstr(pctx, kw->name);
        cfg_print_chars(pctx, " ", 1);
@@ -1332,7 +1332,7 @@ parse_querysource6(cfg_parser_t *pctx, const cfg_type_t *type, cfg_obj_t **ret)
 }
 
 static void
-print_querysource(cfg_printer_t *pctx, cfg_obj_t *obj) {
+print_querysource(cfg_printer_t *pctx, const cfg_obj_t *obj) {
        isc_netaddr_t na;
        isc_netaddr_fromsockaddr(&na, &obj->value.sockaddr);
        cfg_print_chars(pctx, "address ", 8);
@@ -1408,7 +1408,7 @@ static cfg_tuplefielddef_t negated_fields[] = {
 };
 
 static void
-print_negated(cfg_printer_t *pctx, cfg_obj_t *obj) {
+print_negated(cfg_printer_t *pctx, const cfg_obj_t *obj) {
        cfg_print_chars(pctx, "!", 1);
        cfg_print_tuple(pctx, obj);
 }
@@ -1625,7 +1625,7 @@ parse_logfile(cfg_parser_t *pctx, const cfg_type_t *type, cfg_obj_t **ret) {
 }
 
 static void
-print_logfile(cfg_printer_t *pctx, cfg_obj_t *obj) {
+print_logfile(cfg_printer_t *pctx, const cfg_obj_t *obj) {
        cfg_print_obj(pctx, obj->value.tuple[0]); /* file */
        if (obj->value.tuple[1]->type->print != cfg_print_void) {
                cfg_print_chars(pctx, " versions ", 10);
index 823150e71b65d57efa9dfb3afd98de168a9875b3..42ce9f0c03a67881cfe6b0a33438feb9f8924b28 100644 (file)
@@ -15,7 +15,7 @@
  * PERFORMANCE OF THIS SOFTWARE.
  */
 
-/* $Id: parser.c,v 1.70.2.20.2.20 2006/01/04 23:50:21 marka Exp $ */
+/* $Id: parser.c,v 1.70.2.20.2.21 2006/02/28 06:32:54 marka Exp $ */
 
 #include <config.h>
 
@@ -68,7 +68,7 @@ static isc_result_t
 parse_list(cfg_parser_t *pctx, const cfg_type_t *type, cfg_obj_t **ret);
 
 static void
-print_list(cfg_printer_t *pctx, cfg_obj_t *obj);
+print_list(cfg_printer_t *pctx, const cfg_obj_t *obj);
 
 static void
 free_list(cfg_parser_t *pctx, cfg_obj_t *obj);
@@ -134,7 +134,7 @@ static cfg_type_t cfg_type_implicitlist = {
 /* Functions. */
 
 void
-cfg_print_obj(cfg_printer_t *pctx, cfg_obj_t *obj) {
+cfg_print_obj(cfg_printer_t *pctx, const cfg_obj_t *obj) {
        obj->type->print(pctx, obj);
 }
 
@@ -177,7 +177,7 @@ cfg_parse_obj(cfg_parser_t *pctx, const cfg_type_t *type, cfg_obj_t **ret) {
 }
 
 void
-cfg_print(cfg_obj_t *obj,
+cfg_print(const cfg_obj_t *obj,
          void (*f)(void *closure, const char *text, int textlen),
          void *closure)
 {
@@ -243,14 +243,14 @@ cfg_parse_tuple(cfg_parser_t *pctx, const cfg_type_t *type, cfg_obj_t **ret)
 }
 
 void
-cfg_print_tuple(cfg_printer_t *pctx, cfg_obj_t *obj) {
+cfg_print_tuple(cfg_printer_t *pctx, const cfg_obj_t *obj) {
        unsigned int i;
        const cfg_tuplefielddef_t *fields = obj->type->of;
        const cfg_tuplefielddef_t *f;
        isc_boolean_t need_space = ISC_FALSE;
 
        for (f = fields, i = 0; f->name != NULL; f++, i++) {
-               cfg_obj_t *fieldobj = obj->value.tuple[i];
+               const cfg_obj_t *fieldobj = obj->value.tuple[i];
                if (need_space)
                        cfg_print_chars(pctx, " ", 1);
                cfg_print_obj(pctx, fieldobj);
@@ -291,13 +291,13 @@ free_tuple(cfg_parser_t *pctx, cfg_obj_t *obj) {
 }
 
 isc_boolean_t
-cfg_obj_istuple(cfg_obj_t *obj) {
+cfg_obj_istuple(const cfg_obj_t *obj) {
        REQUIRE(obj != NULL);
        return (ISC_TF(obj->type->rep == &cfg_rep_tuple));
 }
 
-cfg_obj_t *
-cfg_tuple_get(cfg_obj_t *tupleobj, const char* name) {
+const cfg_obj_t *
+cfg_tuple_get(const cfg_obj_t *tupleobj, const char* name) {
        unsigned int i;
        const cfg_tuplefielddef_t *fields;
        const cfg_tuplefielddef_t *f;
@@ -548,7 +548,7 @@ cfg_parse_void(cfg_parser_t *pctx, const cfg_type_t *type, cfg_obj_t **ret) {
 }
 
 void
-cfg_print_void(cfg_printer_t *pctx, cfg_obj_t *obj) {
+cfg_print_void(cfg_printer_t *pctx, const cfg_obj_t *obj) {
        UNUSED(pctx);
        UNUSED(obj);
 }
@@ -560,7 +560,7 @@ cfg_doc_void(cfg_printer_t *pctx, const cfg_type_t *type) {
 }
 
 isc_boolean_t
-cfg_obj_isvoid(cfg_obj_t *obj) {
+cfg_obj_isvoid(const cfg_obj_t *obj) {
        REQUIRE(obj != NULL);
        return (ISC_TF(obj->type->rep == &cfg_rep_void));
 }
@@ -606,18 +606,18 @@ cfg_print_rawuint(cfg_printer_t *pctx, unsigned int u) {
 }
 
 void
-cfg_print_uint32(cfg_printer_t *pctx, cfg_obj_t *obj) {
+cfg_print_uint32(cfg_printer_t *pctx, const cfg_obj_t *obj) {
        cfg_print_rawuint(pctx, obj->value.uint32);
 }
 
 isc_boolean_t
-cfg_obj_isuint32(cfg_obj_t *obj) {
+cfg_obj_isuint32(const cfg_obj_t *obj) {
        REQUIRE(obj != NULL);
        return (ISC_TF(obj->type->rep == &cfg_rep_uint32));
 }
 
 isc_uint32_t
-cfg_obj_asuint32(cfg_obj_t *obj) {
+cfg_obj_asuint32(const cfg_obj_t *obj) {
        REQUIRE(obj != NULL && obj->type->rep == &cfg_rep_uint32);
        return (obj->value.uint32);
 }
@@ -632,19 +632,19 @@ cfg_type_t cfg_type_uint32 = {
  * uint64
  */
 isc_boolean_t
-cfg_obj_isuint64(cfg_obj_t *obj) {
+cfg_obj_isuint64(const cfg_obj_t *obj) {
        REQUIRE(obj != NULL);
        return (ISC_TF(obj->type->rep == &cfg_rep_uint64));
 }
 
 isc_uint64_t
-cfg_obj_asuint64(cfg_obj_t *obj) {
+cfg_obj_asuint64(const cfg_obj_t *obj) {
        REQUIRE(obj != NULL && obj->type->rep == &cfg_rep_uint64);
        return (obj->value.uint64);
 }
 
 void
-cfg_print_uint64(cfg_printer_t *pctx, cfg_obj_t *obj) {
+cfg_print_uint64(cfg_printer_t *pctx, const cfg_obj_t *obj) {
        char buf[32];
        snprintf(buf, sizeof(buf), "%" ISC_PRINT_QUADFORMAT "u",
                 obj->value.uint64);
@@ -723,7 +723,9 @@ parse_ustring(cfg_parser_t *pctx, const cfg_type_t *type, cfg_obj_t **ret) {
 }
 
 isc_result_t
-cfg_parse_astring(cfg_parser_t *pctx, const cfg_type_t *type, cfg_obj_t **ret) {
+cfg_parse_astring(cfg_parser_t *pctx, const cfg_type_t *type,
+                 cfg_obj_t **ret)
+{
         isc_result_t result;
        UNUSED(type);
 
@@ -781,12 +783,12 @@ cfg_doc_enum(cfg_printer_t *pctx, const cfg_type_t *type) {
 }
 
 void
-cfg_print_ustring(cfg_printer_t *pctx, cfg_obj_t *obj) {
+cfg_print_ustring(cfg_printer_t *pctx, const cfg_obj_t *obj) {
        cfg_print_chars(pctx, obj->value.string.base, obj->value.string.length);
 }
 
 static void
-print_qstring(cfg_printer_t *pctx, cfg_obj_t *obj) {
+print_qstring(cfg_printer_t *pctx, const cfg_obj_t *obj) {
        cfg_print_chars(pctx, "\"", 1);
        cfg_print_ustring(pctx, obj);
        cfg_print_chars(pctx, "\"", 1);
@@ -799,13 +801,13 @@ free_string(cfg_parser_t *pctx, cfg_obj_t *obj) {
 }
 
 isc_boolean_t
-cfg_obj_isstring(cfg_obj_t *obj) {
+cfg_obj_isstring(const cfg_obj_t *obj) {
        REQUIRE(obj != NULL);
        return (ISC_TF(obj->type->rep == &cfg_rep_string));
 }
 
-char *
-cfg_obj_asstring(cfg_obj_t *obj) {
+const char *
+cfg_obj_asstring(const cfg_obj_t *obj) {
        REQUIRE(obj != NULL && obj->type->rep == &cfg_rep_string);
        return (obj->value.string.base);
 }
@@ -833,13 +835,13 @@ cfg_type_t cfg_type_astring = {
  */
 
 isc_boolean_t
-cfg_obj_isboolean(cfg_obj_t *obj) {
+cfg_obj_isboolean(const cfg_obj_t *obj) {
        REQUIRE(obj != NULL);
        return (ISC_TF(obj->type->rep == &cfg_rep_boolean));
 }
 
 isc_boolean_t
-cfg_obj_asboolean(cfg_obj_t *obj) {
+cfg_obj_asboolean(const cfg_obj_t *obj) {
        REQUIRE(obj != NULL && obj->type->rep == &cfg_rep_boolean);
        return (obj->value.boolean);
 }
@@ -885,7 +887,7 @@ parse_boolean(cfg_parser_t *pctx, const cfg_type_t *type, cfg_obj_t **ret)
 }
 
 static void
-print_boolean(cfg_printer_t *pctx, cfg_obj_t *obj) {
+print_boolean(cfg_printer_t *pctx, const cfg_obj_t *obj) {
        if (obj->value.boolean)
                cfg_print_chars(pctx, "yes", 3);
        else
@@ -999,9 +1001,9 @@ parse_list(cfg_parser_t *pctx, const cfg_type_t *listtype, cfg_obj_t **ret)
 }
 
 static void
-print_list(cfg_printer_t *pctx, cfg_obj_t *obj) {
-       cfg_list_t *list = &obj->value.list;
-       cfg_listelt_t *elt;
+print_list(cfg_printer_t *pctx, const cfg_obj_t *obj) {
+       const cfg_list_t *list = &obj->value.list;
+       const cfg_listelt_t *elt;
 
        for (elt = ISC_LIST_HEAD(*list);
             elt != NULL;
@@ -1025,7 +1027,7 @@ cfg_parse_bracketed_list(cfg_parser_t *pctx, const cfg_type_t *type,
 }
 
 void
-cfg_print_bracketed_list(cfg_printer_t *pctx, cfg_obj_t *obj) {
+cfg_print_bracketed_list(cfg_printer_t *pctx, const cfg_obj_t *obj) {
        print_open(pctx);
        print_list(pctx, obj);
        print_close(pctx);
@@ -1072,9 +1074,9 @@ cfg_parse_spacelist(cfg_parser_t *pctx, const cfg_type_t *listtype,
 }
 
 void
-cfg_print_spacelist(cfg_printer_t *pctx, cfg_obj_t *obj) {
-       cfg_list_t *list = &obj->value.list;
-       cfg_listelt_t *elt;
+cfg_print_spacelist(cfg_printer_t *pctx, const cfg_obj_t *obj) {
+       const cfg_list_t *list = &obj->value.list;
+       const cfg_listelt_t *elt;
 
        for (elt = ISC_LIST_HEAD(*list);
             elt != NULL;
@@ -1087,27 +1089,27 @@ cfg_print_spacelist(cfg_printer_t *pctx, cfg_obj_t *obj) {
 
 
 isc_boolean_t
-cfg_obj_islist(cfg_obj_t *obj) {
+cfg_obj_islist(const cfg_obj_t *obj) {
        REQUIRE(obj != NULL);
        return (ISC_TF(obj->type->rep == &cfg_rep_list));
 }
 
-cfg_listelt_t *
-cfg_list_first(cfg_obj_t *obj) {
+const cfg_listelt_t *
+cfg_list_first(const cfg_obj_t *obj) {
        REQUIRE(obj == NULL || obj->type->rep == &cfg_rep_list);
        if (obj == NULL)
                return (NULL);
        return (ISC_LIST_HEAD(obj->value.list));
 }
 
-cfg_listelt_t *
-cfg_list_next(cfg_listelt_t *elt) {
+const cfg_listelt_t *
+cfg_list_next(const cfg_listelt_t *elt) {
        REQUIRE(elt != NULL);
        return (ISC_LIST_NEXT(elt, link));
 }
 
-cfg_obj_t *
-cfg_listelt_value(cfg_listelt_t *elt) {
+const cfg_obj_t *
+cfg_listelt_value(const cfg_listelt_t *elt) {
        REQUIRE(elt != NULL);
        return (elt->obj);
 }
@@ -1366,7 +1368,7 @@ cfg_parse_addressed_map(cfg_parser_t *pctx, const cfg_type_t *type, cfg_obj_t **
 }
 
 void
-cfg_print_mapbody(cfg_printer_t *pctx, cfg_obj_t *obj) {
+cfg_print_mapbody(cfg_printer_t *pctx, const cfg_obj_t *obj) {
        isc_result_t result = ISC_R_SUCCESS;
 
        const cfg_clausedef_t * const *clauseset;
@@ -1446,7 +1448,7 @@ static struct flagtext {
 };
 
 void
-cfg_print_map(cfg_printer_t *pctx, cfg_obj_t *obj) {
+cfg_print_map(cfg_printer_t *pctx, const cfg_obj_t *obj) {
        if (obj->value.map.id != NULL) {
                cfg_print_obj(pctx, obj->value.map.id);
                cfg_print_chars(pctx, " ", 1);
@@ -1505,16 +1507,16 @@ cfg_doc_map(cfg_printer_t *pctx, const cfg_type_t *type) {
 }
 
 isc_boolean_t
-cfg_obj_ismap(cfg_obj_t *obj) {
+cfg_obj_ismap(const cfg_obj_t *obj) {
        REQUIRE(obj != NULL);
        return (ISC_TF(obj->type->rep == &cfg_rep_map));
 }
 
 isc_result_t
-cfg_map_get(cfg_obj_t *mapobj, const char* name, cfg_obj_t **obj) {
+cfg_map_get(const cfg_obj_t *mapobj, const char* name, const cfg_obj_t **obj) {
        isc_result_t result;
        isc_symvalue_t val;
-       cfg_map_t *map;
+       const cfg_map_t *map;
        
        REQUIRE(mapobj != NULL && mapobj->type->rep == &cfg_rep_map);
        REQUIRE(name != NULL);
@@ -1529,8 +1531,8 @@ cfg_map_get(cfg_obj_t *mapobj, const char* name, cfg_obj_t **obj) {
        return (ISC_R_SUCCESS);
 }
 
-cfg_obj_t *
-cfg_map_getname(cfg_obj_t *mapobj) {
+const cfg_obj_t *
+cfg_map_getname(const cfg_obj_t *mapobj) {
        REQUIRE(mapobj != NULL && mapobj->type->rep == &cfg_rep_map);
        return (mapobj->value.map.id);
 }
@@ -1760,7 +1762,7 @@ cfg_parse_rawport(cfg_parser_t *pctx, unsigned int flags, in_port_t *port) {
 }
 
 void
-cfg_print_rawaddr(cfg_printer_t *pctx, isc_netaddr_t *na) {
+cfg_print_rawaddr(cfg_printer_t *pctx, const isc_netaddr_t *na) {
        isc_result_t result;
        char text[128];
        isc_buffer_t buf;
@@ -1850,21 +1852,22 @@ cfg_parse_netprefix(cfg_parser_t *pctx, const cfg_type_t *type,
 }
 
 static void
-print_netprefix(cfg_printer_t *pctx, cfg_obj_t *obj) {
-       cfg_netprefix_t *p = &obj->value.netprefix;
+print_netprefix(cfg_printer_t *pctx, const cfg_obj_t *obj) {
+       const cfg_netprefix_t *p = &obj->value.netprefix;
+
        cfg_print_rawaddr(pctx, &p->address);
        cfg_print_chars(pctx, "/", 1);
        cfg_print_rawuint(pctx, p->prefixlen);
 }
 
 isc_boolean_t
-cfg_obj_isnetprefix(cfg_obj_t *obj) {
+cfg_obj_isnetprefix(const cfg_obj_t *obj) {
        REQUIRE(obj != NULL);
        return (ISC_TF(obj->type->rep == &cfg_rep_netprefix));
 }
 
 void
-cfg_obj_asnetprefix(cfg_obj_t *obj, isc_netaddr_t *netaddr,
+cfg_obj_asnetprefix(const cfg_obj_t *obj, isc_netaddr_t *netaddr,
                    unsigned int *prefixlen) {
        REQUIRE(obj != NULL && obj->type->rep == &cfg_rep_netprefix);
        *netaddr = obj->value.netprefix.address;
@@ -1915,7 +1918,7 @@ cfg_parse_sockaddr(cfg_parser_t *pctx, const cfg_type_t *type, cfg_obj_t **ret)
 }
 
 void
-cfg_print_sockaddr(cfg_printer_t *pctx, cfg_obj_t *obj) {
+cfg_print_sockaddr(cfg_printer_t *pctx, const cfg_obj_t *obj) {
        isc_netaddr_t netaddr;
        in_port_t port;
        char buf[ISC_NETADDR_FORMATSIZE];
@@ -1960,13 +1963,13 @@ cfg_doc_sockaddr(cfg_printer_t *pctx, const cfg_type_t *type) {
 }
 
 isc_boolean_t
-cfg_obj_issockaddr(cfg_obj_t *obj) {
+cfg_obj_issockaddr(const cfg_obj_t *obj) {
        REQUIRE(obj != NULL);
        return (ISC_TF(obj->type->rep == &cfg_rep_sockaddr));
 }
 
-isc_sockaddr_t *
-cfg_obj_assockaddr(cfg_obj_t *obj) {
+const isc_sockaddr_t *
+cfg_obj_assockaddr(const cfg_obj_t *obj) {
        REQUIRE(obj != NULL && obj->type->rep == &cfg_rep_sockaddr);
        return (&obj->value.sockaddr);
 }
@@ -2163,7 +2166,8 @@ parser_complain(cfg_parser_t *pctx, isc_boolean_t is_warning,
 }
 
 void
-cfg_obj_log(cfg_obj_t *obj, isc_log_t *lctx, int level, const char *fmt, ...) {
+cfg_obj_log(const cfg_obj_t *obj, isc_log_t *lctx, int level,
+           const char *fmt, ...) {
        va_list ap;
        char msgbuf[2048];
 
@@ -2181,12 +2185,12 @@ cfg_obj_log(cfg_obj_t *obj, isc_log_t *lctx, int level, const char *fmt, ...) {
 }
 
 const char *
-cfg_obj_file(cfg_obj_t *obj) {
+cfg_obj_file(const cfg_obj_t *obj) {
        return (obj->file);
 }
 
 unsigned int
-cfg_obj_line(cfg_obj_t *obj) {
+cfg_obj_line(const cfg_obj_t *obj) {
        return (obj->line);
 }
 
@@ -2247,7 +2251,7 @@ free_map(cfg_parser_t *pctx, cfg_obj_t *obj) {
 }
 
 isc_boolean_t
-cfg_obj_istype(cfg_obj_t *obj, const cfg_type_t *type) {
+cfg_obj_istype(const cfg_obj_t *obj, const cfg_type_t *type) {
        return (ISC_TF(obj->type == type));
 }