]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
silent compiler warnings for DLZ exernal driver support and example
authorFrancis Dupont <fdupont@isc.org>
Thu, 17 Mar 2011 09:41:07 +0000 (09:41 +0000)
committerFrancis Dupont <fdupont@isc.org>
Thu, 17 Mar 2011 09:41:07 +0000 (09:41 +0000)
bin/named/include/dlz/dlz_dlopen_driver.h
bin/named/unix/dlz_dlopen_driver.c
bin/named/win32/dlz_dlopen_driver.c
bin/tests/system/dlzexternal/driver.c
bin/tests/system/dlzexternal/driver.h
lib/dns/include/dns/dlz.h
lib/dns/include/dns/dlz_dlopen.h [new file with mode: 0644]
lib/dns/include/dns/sdlz.h

index 2b019eb5b09a18c6825e94306e23eb254b921a3d..7af325a13b30136816c98069ee8824d92cf81e24 100644 (file)
@@ -14,7 +14,7 @@
  * PERFORMANCE OF THIS SOFTWARE.
  */
 
-/* $Id: dlz_dlopen_driver.h,v 1.1.4.3 2011/03/10 23:47:26 tbox Exp $ */
+/* $Id: dlz_dlopen_driver.h,v 1.1.4.4 2011/03/17 09:41:06 fdupont Exp $ */
 
 #ifndef DLZ_DLOPEN_DRIVER_H
 #define DLZ_DLOPEN_DRIVER_H
@@ -24,7 +24,4 @@ dlz_dlopen_init(isc_mem_t *mctx);
 
 void
 dlz_dlopen_clear(void);
-
-#define DLZ_DLOPEN_VERSION 1
-
 #endif
index 3a968b36b6d50c73e0d631b45cbde790711d1f2e..56ee512d96b3ab53a7b0f75ae111f929ee4ccd59 100644 (file)
@@ -14,7 +14,7 @@
  * PERFORMANCE OF THIS SOFTWARE.
  */
 
-/* $Id: dlz_dlopen_driver.c,v 1.1.4.3 2011/03/10 23:47:26 tbox Exp $ */
+/* $Id: dlz_dlopen_driver.c,v 1.1.4.4 2011/03/17 09:41:06 fdupont Exp $ */
 
 #include <config.h>
 
@@ -24,8 +24,8 @@
 #include <dlfcn.h>
 
 #include <dns/log.h>
-#include <dns/sdlz.h>
 #include <dns/result.h>
+#include <dns/dlz_dlopen.h>
 
 #include <isc/mem.h>
 #include <isc/print.h>
@@ -51,35 +51,21 @@ typedef struct dlopen_data {
        int version;
        isc_boolean_t in_configure;
 
-       int (*dlz_version)(unsigned int *flags);
-       isc_result_t (*dlz_create)(const char *dlzname,
-                                  unsigned int argc, char *argv[],
-                                  void **dbdata, ...);
-       isc_result_t (*dlz_findzonedb)(void *dbdata, const char *name);
-       isc_result_t (*dlz_lookup)(const char *zone, const char *name,
-                                  void *dbdata, dns_sdlzlookup_t *lookup);
-       isc_result_t (*dlz_authority)(const char *zone, void *dbdata,
-                                     dns_sdlzlookup_t *lookup);
-       isc_result_t (*dlz_allnodes)(const char *zone, void *dbdata,
-                                    dns_sdlzallnodes_t *allnodes);
-       isc_result_t (*dlz_allowzonexfr)(void *dbdata, const char *name,
-                                        const char *client);
-       isc_result_t (*dlz_newversion)(const char *zone, void *dbdata,
-                                      void **versionp);
-       void         (*dlz_closeversion)(const char *zone, isc_boolean_t commit,
-                                        void *dbdata, void **versionp);
-       isc_result_t (*dlz_configure)(dns_view_t *view, void *dbdata);
-       isc_boolean_t (*dlz_ssumatch)(const char *signer, const char *name,
-                                     const char *tcpaddr, const char *type,
-                                     const char *key, isc_uint32_t keydatalen,
-                                     unsigned char *keydata, void *dbdata);
-       isc_result_t (*dlz_addrdataset)(const char *name, const char *rdatastr,
-                                       void *dbdata, void *version);
-       isc_result_t (*dlz_subrdataset)(const char *name, const char *rdatastr,
-                                       void *dbdata, void *version);
-       isc_result_t (*dlz_delrdataset)(const char *name, const char *type,
-                                       void *dbdata, void *version);
-       void         (*dlz_destroy)(void *dbdata);
+       dlz_dlopen_version_t *dlz_version;
+       dlz_dlopen_create_t *dlz_create;
+       dlz_dlopen_findzonedb_t *dlz_findzonedb;
+       dlz_dlopen_lookup_t *dlz_lookup;
+       dlz_dlopen_authority_t *dlz_authority;
+       dlz_dlopen_allnodes_t *dlz_allnodes;
+       dlz_dlopen_allowzonexfr_t *dlz_allowzonexfr;
+       dlz_dlopen_newversion_t *dlz_newversion;
+       dlz_dlopen_closeversion_t *dlz_closeversion;
+       dlz_dlopen_configure_t *dlz_configure;
+       dlz_dlopen_ssumatch_t *dlz_ssumatch;
+       dlz_dlopen_addrdataset_t *dlz_addrdataset;
+       dlz_dlopen_subrdataset_t *dlz_subrdataset;
+       dlz_dlopen_delrdataset_t *dlz_delrdataset;
+       dlz_dlopen_destroy_t *dlz_destroy;
 } dlopen_data_t;
 
 /* Modules can choose whether they are lock-safe or not. */
@@ -288,10 +274,14 @@ dlopen_dlz_create(const char *dlzname, unsigned int argc, char *argv[],
        }
 
        /* Find the symbols */
-       cd->dlz_version = dl_load_symbol(cd, "dlz_version", ISC_TRUE);
-       cd->dlz_create = dl_load_symbol(cd, "dlz_create", ISC_TRUE);
-       cd->dlz_lookup = dl_load_symbol(cd, "dlz_lookup", ISC_TRUE);
-       cd->dlz_findzonedb = dl_load_symbol(cd, "dlz_findzonedb", ISC_TRUE);
+       cd->dlz_version = (dlz_dlopen_version_t *)
+               dl_load_symbol(cd, "dlz_version", ISC_TRUE);
+       cd->dlz_create = (dlz_dlopen_create_t *)
+               dl_load_symbol(cd, "dlz_create", ISC_TRUE);
+       cd->dlz_lookup = (dlz_dlopen_lookup_t *)
+               dl_load_symbol(cd, "dlz_lookup", ISC_TRUE);
+       cd->dlz_findzonedb = (dlz_dlopen_findzonedb_t *)
+               dl_load_symbol(cd, "dlz_findzonedb", ISC_TRUE);
 
        if (cd->dlz_create == NULL ||
            cd->dlz_lookup == NULL ||
@@ -301,19 +291,28 @@ dlopen_dlz_create(const char *dlzname, unsigned int argc, char *argv[],
                goto failed;
        }
 
-       cd->dlz_allowzonexfr = dl_load_symbol(cd, "dlz_allowzonexfr",
-                                             ISC_FALSE);
-       cd->dlz_allnodes = dl_load_symbol(cd, "dlz_allnodes",
-                                         ISC_TF(cd->dlz_allowzonexfr != NULL));
-       cd->dlz_authority = dl_load_symbol(cd, "dlz_authority", ISC_FALSE);
-       cd->dlz_newversion = dl_load_symbol(cd, "dlz_newversion", ISC_FALSE);
-       cd->dlz_closeversion = dl_load_symbol(cd, "dlz_closeversion",
-                                           ISC_TF(cd->dlz_newversion != NULL));
-       cd->dlz_configure = dl_load_symbol(cd, "dlz_configure", ISC_FALSE);
-       cd->dlz_ssumatch = dl_load_symbol(cd, "dlz_ssumatch", ISC_FALSE);
-       cd->dlz_addrdataset = dl_load_symbol(cd, "dlz_addrdataset", ISC_FALSE);
-       cd->dlz_subrdataset = dl_load_symbol(cd, "dlz_subrdataset", ISC_FALSE);
-       cd->dlz_delrdataset = dl_load_symbol(cd, "dlz_delrdataset", ISC_FALSE);
+       cd->dlz_allowzonexfr = (dlz_dlopen_allowzonexfr_t *)
+               dl_load_symbol(cd, "dlz_allowzonexfr", ISC_FALSE);
+       cd->dlz_allnodes = (dlz_dlopen_allnodes_t *)
+               dl_load_symbol(cd, "dlz_allnodes",
+                              ISC_TF(cd->dlz_allowzonexfr != NULL));
+       cd->dlz_authority = (dlz_dlopen_authority_t *)
+               dl_load_symbol(cd, "dlz_authority", ISC_FALSE);
+       cd->dlz_newversion = (dlz_dlopen_newversion_t *)
+               dl_load_symbol(cd, "dlz_newversion", ISC_FALSE);
+       cd->dlz_closeversion = (dlz_dlopen_closeversion_t *)
+               dl_load_symbol(cd, "dlz_closeversion",
+                              ISC_TF(cd->dlz_newversion != NULL));
+       cd->dlz_configure = (dlz_dlopen_configure_t *)
+               dl_load_symbol(cd, "dlz_configure", ISC_FALSE);
+       cd->dlz_ssumatch = (dlz_dlopen_ssumatch_t *)
+               dl_load_symbol(cd, "dlz_ssumatch", ISC_FALSE);
+       cd->dlz_addrdataset = (dlz_dlopen_addrdataset_t *)
+               dl_load_symbol(cd, "dlz_addrdataset", ISC_FALSE);
+       cd->dlz_subrdataset = (dlz_dlopen_subrdataset_t *)
+               dl_load_symbol(cd, "dlz_subrdataset", ISC_FALSE);
+       cd->dlz_delrdataset = (dlz_dlopen_delrdataset_t *)
+               dl_load_symbol(cd, "dlz_delrdataset", ISC_FALSE);
 
        /* Check the version of the API is the same */
        cd->version = cd->dlz_version(&cd->flags);
@@ -355,7 +354,7 @@ failed:
        if (cd->dlzname)
                isc_mem_free(mctx, cd->dlzname);
        if (dlopen_flags)
-               isc_mutex_destroy(&cd->lock);
+               (void) isc_mutex_destroy(&cd->lock);
 #ifdef HAVE_DLCLOSE
        if (cd->dl_handle)
                dlclose(cd->dl_handle);
@@ -392,7 +391,7 @@ dlopen_dlz_destroy(void *driverarg, void *dbdata) {
                dlclose(cd->dl_handle);
 #endif
 
-       isc_mutex_destroy(&cd->lock);
+       (void) isc_mutex_destroy(&cd->lock);
 
        mctx = cd->mctx;
        isc_mem_put(mctx, cd, sizeof(*cd));
index 7b17e049f78cf75a3a82e97bb8866c5bc4497153..52292b5b315a9d4a9cb1568c4518a75b90c7d7a9 100644 (file)
@@ -14,7 +14,7 @@
  * PERFORMANCE OF THIS SOFTWARE.
  */
 
-/* $Id: dlz_dlopen_driver.c,v 1.4.2.2 2011/03/17 09:40:08 fdupont Exp $ */
+/* $Id: dlz_dlopen_driver.c,v 1.4.2.3 2011/03/17 09:41:07 fdupont Exp $ */
 
 #include <config.h>
 
@@ -25,8 +25,8 @@
 #include <stdlib.h>
 
 #include <dns/log.h>
-#include <dns/sdlz.h>
 #include <dns/result.h>
+#include <dns/dlz_dlopen.h>
 
 #include <isc/mem.h>
 #include <isc/print.h>
@@ -52,35 +52,21 @@ typedef struct dlopen_data {
        int version;
        isc_boolean_t in_configure;
 
-       int (*dlz_version)(unsigned int *flags);
-       isc_result_t (*dlz_create)(const char *dlzname,
-                                  unsigned int argc, char *argv[],
-                                  void **dbdata, ...);
-       isc_result_t (*dlz_findzonedb)(void *dbdata, const char *name);
-       isc_result_t (*dlz_lookup)(const char *zone, const char *name,
-                                  void *dbdata, dns_sdlzlookup_t *lookup);
-       isc_result_t (*dlz_authority)(const char *zone, void *dbdata,
-                                     dns_sdlzlookup_t *lookup);
-       isc_result_t (*dlz_allnodes)(const char *zone, void *dbdata,
-                                    dns_sdlzallnodes_t *allnodes);
-       isc_result_t (*dlz_allowzonexfr)(void *dbdata, const char *name,
-                                        const char *client);
-       isc_result_t (*dlz_newversion)(const char *zone, void *dbdata,
-                                      void **versionp);
-       void         (*dlz_closeversion)(const char *zone, isc_boolean_t commit,
-                                        void *dbdata, void **versionp);
-       isc_result_t (*dlz_configure)(dns_view_t *view, void *dbdata);
-       isc_boolean_t (*dlz_ssumatch)(const char *signer, const char *name,
-                                     const char *tcpaddr, const char *type,
-                                     const char *key, isc_uint32_t keydatalen,
-                                     unsigned char *keydata, void *dbdata);
-       isc_result_t (*dlz_addrdataset)(const char *name, const char *rdatastr,
-                                       void *dbdata, void *version);
-       isc_result_t (*dlz_subrdataset)(const char *name, const char *rdatastr,
-                                       void *dbdata, void *version);
-       isc_result_t (*dlz_delrdataset)(const char *name, const char *type,
-                                       void *dbdata, void *version);
-       void         (*dlz_destroy)(void *dbdata);
+       dlz_dlopen_version_t *dlz_version;
+       dlz_dlopen_create_t *dlz_create;
+       dlz_dlopen_findzonedb_t *dlz_findzonedb;
+       dlz_dlopen_lookup_t *dlz_lookup;
+       dlz_dlopen_authority_t *dlz_authority;
+       dlz_dlopen_allnodes_t *dlz_allnodes;
+       dlz_dlopen_allowzonexfr_t *dlz_allowzonexfr;
+       dlz_dlopen_newversion_t *dlz_newversion;
+       dlz_dlopen_closeversion_t *dlz_closeversion;
+       dlz_dlopen_configure_t *dlz_configure;
+       dlz_dlopen_ssumatch_t *dlz_ssumatch;
+       dlz_dlopen_addrdataset_t *dlz_addrdataset;
+       dlz_dlopen_subrdataset_t *dlz_subrdataset;
+       dlz_dlopen_delrdataset_t *dlz_delrdataset;
+       dlz_dlopen_destroy_t *dlz_destroy;
 } dlopen_data_t;
 
 /* Modules can choose whether they are lock-safe or not. */
@@ -278,10 +264,14 @@ dlopen_dlz_create(const char *dlzname, unsigned int argc, char *argv[],
        }
 
        /* Find the symbols */
-       cd->dlz_version = dl_load_symbol(cd, "dlz_version", ISC_TRUE);
-       cd->dlz_create = dl_load_symbol(cd, "dlz_create", ISC_TRUE);
-       cd->dlz_lookup = dl_load_symbol(cd, "dlz_lookup", ISC_TRUE);
-       cd->dlz_findzonedb = dl_load_symbol(cd, "dlz_findzonedb", ISC_TRUE);
+       cd->dlz_version = (dlz_dlopen_version_t *)
+               dl_load_symbol(cd, "dlz_version", ISC_TRUE);
+       cd->dlz_create = (dlz_dlopen_create_t *)
+               dl_load_symbol(cd, "dlz_create", ISC_TRUE);
+       cd->dlz_lookup = (dlz_dlopen_lookup_t *)
+               dl_load_symbol(cd, "dlz_lookup", ISC_TRUE);
+       cd->dlz_findzonedb = (dlz_dlopen_findzonedb_t *)
+               dl_load_symbol(cd, "dlz_findzonedb", ISC_TRUE);
 
        if (cd->dlz_create == NULL ||
            cd->dlz_lookup == NULL ||
@@ -291,19 +281,28 @@ dlopen_dlz_create(const char *dlzname, unsigned int argc, char *argv[],
                goto failed;
        }
 
-       cd->dlz_allowzonexfr = dl_load_symbol(cd, "dlz_allowzonexfr",
-                                             ISC_FALSE);
-       cd->dlz_allnodes = dl_load_symbol(cd, "dlz_allnodes",
-                                         ISC_TF(cd->dlz_allowzonexfr != NULL));
-       cd->dlz_authority = dl_load_symbol(cd, "dlz_authority", ISC_FALSE);
-       cd->dlz_newversion = dl_load_symbol(cd, "dlz_newversion", ISC_FALSE);
-       cd->dlz_closeversion = dl_load_symbol(cd, "dlz_closeversion",
-                                           ISC_TF(cd->dlz_newversion != NULL));
-       cd->dlz_configure = dl_load_symbol(cd, "dlz_configure", ISC_FALSE);
-       cd->dlz_ssumatch = dl_load_symbol(cd, "dlz_ssumatch", ISC_FALSE);
-       cd->dlz_addrdataset = dl_load_symbol(cd, "dlz_addrdataset", ISC_FALSE);
-       cd->dlz_subrdataset = dl_load_symbol(cd, "dlz_subrdataset", ISC_FALSE);
-       cd->dlz_delrdataset = dl_load_symbol(cd, "dlz_delrdataset", ISC_FALSE);
+       cd->dlz_allowzonexfr = (dlz_dlopen_allowzonexfr_t *)
+               dl_load_symbol(cd, "dlz_allowzonexfr", ISC_FALSE);
+       cd->dlz_allnodes = (dlz_dlopen_allnodes_t *)
+               dl_load_symbol(cd, "dlz_allnodes",
+                              ISC_TF(cd->dlz_allowzonexfr != NULL));
+       cd->dlz_authority = (dlz_dlopen_authority_t *)
+               dl_load_symbol(cd, "dlz_authority", ISC_FALSE);
+       cd->dlz_newversion = (dlz_dlopen_newversion_t *)
+               dl_load_symbol(cd, "dlz_newversion", ISC_FALSE);
+       cd->dlz_closeversion = (dlz_dlopen_closeversion_t *)
+               dl_load_symbol(cd, "dlz_closeversion",
+                              ISC_TF(cd->dlz_newversion != NULL));
+       cd->dlz_configure = (dlz_dlopen_configure_t *)
+               dl_load_symbol(cd, "dlz_configure", ISC_FALSE);
+       cd->dlz_ssumatch = (dlz_dlopen_ssumatch_t *)
+               dl_load_symbol(cd, "dlz_ssumatch", ISC_FALSE);
+       cd->dlz_addrdataset = (dlz_dlopen_addrdataset_t *)
+               dl_load_symbol(cd, "dlz_addrdataset", ISC_FALSE);
+       cd->dlz_subrdataset = (dlz_dlopen_subrdataset_t *)
+               dl_load_symbol(cd, "dlz_subrdataset", ISC_FALSE);
+       cd->dlz_delrdataset = (dlz_dlopen_delrdataset_t *)
+               dl_load_symbol(cd, "dlz_delrdataset", ISC_FALSE);
 
        /* Check the version of the API is the same */
        cd->version = cd->dlz_version(&cd->flags);
@@ -320,7 +319,7 @@ dlopen_dlz_create(const char *dlzname, unsigned int argc, char *argv[],
         * extended version of dlz create, with the addition of
         * named function pointers for helper functions that the
         * driver will need. This avoids the need for the backend to
-        * link the bind9 libraries
+        * link the BIND9 libraries
         */
        MAYBE_LOCK(cd);
        result = cd->dlz_create(dlzname, argc-1, argv+1,
@@ -345,7 +344,7 @@ failed:
        if (cd->dlzname)
                isc_mem_free(mctx, cd->dlzname);
        if (triedload)
-               isc_mutex_destroy(&cd->lock);
+               (void) isc_mutex_destroy(&cd->lock);
        if (cd->dl_handle)
                FreeLibrary(cd->dl_handle);
        isc_mem_put(mctx, cd, sizeof(*cd));
@@ -378,7 +377,7 @@ dlopen_dlz_destroy(void *driverarg, void *dbdata) {
        if (cd->dl_handle)
                FreeLibrary(cd->dl_handle);
 
-       isc_mutex_destroy(&cd->lock);
+       (void) isc_mutex_destroy(&cd->lock);
 
        mctx = cd->mctx;
        isc_mem_put(mctx, cd, sizeof(*cd));
index e4c3c42254dcb1d4f825a6c5adfc88f82393720f..dde142ef825d4c1a5668ded7aca5a67373ed8ea7 100644 (file)
@@ -14,7 +14,7 @@
  * PERFORMANCE OF THIS SOFTWARE.
  */
 
-/* $Id: driver.c,v 1.1.4.3 2011/03/10 23:47:26 tbox Exp $ */
+/* $Id: driver.c,v 1.1.4.4 2011/03/17 09:41:07 fdupont Exp $ */
 
 /*
  * This provides a very simple example of an external loadable DLZ
@@ -34,6 +34,7 @@
 #include <isc/util.h>
 
 #include <dns/types.h>
+#include <dns/dlz_dlopen.h>
 
 #include "driver.h"
 
@@ -51,6 +52,8 @@ struct record {
 
 #define MAX_RECORDS 100
 
+typedef void log_t(int level, const char *fmt, ...);
+
 struct dlz_example_data {
        char *zone_name;
 
@@ -62,13 +65,10 @@ struct dlz_example_data {
        isc_boolean_t transaction_started;
 
        /* Helper functions from the dlz_dlopen driver */
-       void (*log)(int level, const char *fmt, ...);
-       isc_result_t (*putrr)(dns_sdlzlookup_t *handle, const char *type,
-                             dns_ttl_t ttl, const char *data);
-       isc_result_t (*putnamedrr)(dns_sdlzlookup_t *handle, const char *name,
-                                  const char *type, dns_ttl_t ttl,
-                                  const char *data);
-       isc_result_t (*writeable_zone)(dns_view_t *view, const char *zone_name);
+       log_t *log;
+       dns_sdlz_putrr_t *putrr;
+       dns_sdlz_putnamedrr_t *putnamedrr;
+       dns_dlz_writeablezone_t *writeable_zone;
 };
 
 static isc_boolean_t
@@ -96,7 +96,7 @@ add_name(struct dlz_example_data *state, struct record *list,
        int first_empty = -1;
 
        for (i = 0; i < MAX_RECORDS; i++) {
-               if (first_empty == -1 && strlen(list[i].name) == 0) {
+               if (first_empty == -1 && strlen(list[i].name) == 0U) {
                        first_empty = i;
                }
                if (strcasecmp(list[i].name, name) != 0)
@@ -167,13 +167,13 @@ b9_add_helper(struct dlz_example_data *state,
              const char *helper_name, void *ptr)
 {
        if (strcmp(helper_name, "log") == 0)
-               state->log = ptr;
+               state->log = (log_t *)ptr;
        if (strcmp(helper_name, "putrr") == 0)
-               state->putrr = ptr;
+               state->putrr = (dns_sdlz_putrr_t *)ptr;
        if (strcmp(helper_name, "putnamedrr") == 0)
-               state->putnamedrr = ptr;
+               state->putnamedrr = (dns_sdlz_putnamedrr_t *)ptr;
        if (strcmp(helper_name, "writeable_zone") == 0)
-               state->writeable_zone = ptr;
+               state->writeable_zone = (dns_dlz_writeablezone_t *)ptr;
 }
 
 
@@ -319,7 +319,7 @@ dlz_allnodes(const char *zone, void *dbdata, dns_sdlzallnodes_t *allnodes) {
 
        for (i = 0; i < MAX_RECORDS; i++) {
                isc_result_t result;
-               if (strlen(state->current[i].name) == 0) {
+               if (strlen(state->current[i].name) == 0U) {
                        continue;
                }
                result = state->putnamedrr(allnodes, state->current[i].name,
@@ -381,7 +381,7 @@ dlz_closeversion(const char *zone, isc_boolean_t commit,
                           "dlz_example: committing transaction on zone %s",
                           zone);
                for (i = 0; i < MAX_RECORDS; i++) {
-                       if (strlen(state->adds[i].name) > 0) {
+                       if (strlen(state->adds[i].name) > 0U) {
                                add_name(state, &state->current[0],
                                         state->adds[i].name,
                                         state->adds[i].type,
@@ -390,7 +390,7 @@ dlz_closeversion(const char *zone, isc_boolean_t commit,
                        }
                }
                for (i = 0; i < MAX_RECORDS; i++) {
-                       if (strlen(state->deletes[i].name) > 0) {
+                       if (strlen(state->deletes[i].name) > 0U) {
                                del_name(state, &state->current[0],
                                         state->deletes[i].name,
                                         state->deletes[i].type,
index a8456dd4689f0b58ae33976faabdf5af82730e9c..832aedfb1574d66d3f9934eaf1c13eb7ae94573d 100644 (file)
  * PERFORMANCE OF THIS SOFTWARE.
  */
 
-/* $Id: driver.h,v 1.1.4.3 2011/03/10 23:47:29 tbox Exp $ */
-
-/*
- * This header provides a minimal set of defines and typedefs needed
- * for building an external DLZ module for bind9. When creating a new
- * external DLZ driver, please copy this header into your own source
- * tree.
- */
-
-#define DLZ_DLOPEN_VERSION 1
-
-/* Return this in flags to dlz_version() if thread safe */
-#define DNS_SDLZFLAG_THREADSAFE                0x00000001U
-
-#if 0
-/* Result codes */
-#define ISC_R_SUCCESS                  0
-#define ISC_R_NOMEMORY                 1
-#define ISC_R_NOTFOUND                 23
-#define ISC_R_FAILURE                  25
-
-/* Log levels */
-#define ISC_LOG_INFO           (-1)
-#define ISC_LOG_NOTICE         (-2)
-#define ISC_LOG_WARNING        (-3)
-#define ISC_LOG_ERROR          (-4)
-#define ISC_LOG_CRITICAL       (-5)
-#endif
-
-/* Some opaque structures */
-typedef void *dns_sdlzlookup_t;
-typedef void *dns_sdlzallnodes_t;
-
-/*
- * dlz_version() is required for all DLZ external drivers. It should
- * return DLZ_DLOPEN_VERSION
- */
-int
-dlz_version(unsigned int *flags);
-
-/*
- * dlz_create() is required for all DLZ external drivers.
- */
-isc_result_t
-dlz_create(const char *dlzname, unsigned int argc,
-                  char *argv[], void **dbdata, ...);
-
-/*
- * dlz_destroy() is optional, and will be called when the driver is
- * unloaded if supplied
- */
-void
-dlz_destroy(void *dbdata);
-
-/*
- * dlz_findzonedb is required for all DLZ external drivers
- */
-isc_result_t
-dlz_findzonedb(void *dbdata, const char *name);
-
-/*
- * dlz_lookup is required for all DLZ external drivers
- */
-isc_result_t
-dlz_lookup(const char *zone, const char *name,
-                  void *dbdata, dns_sdlzlookup_t *lookup);
-
-/*
- * dlz_allowzonexfr() is optional, and should be supplied if you want
- * to support zone transfers
- */
-isc_result_t
-dlz_allowzonexfr(void *dbdata, const char *name, const char *client);
-
-/*
- * dlz_allnodes() is optional, but must be supplied if supply a
- * dlz_allowzonexfr() function
- */
-isc_result_t
-dlz_allnodes(const char *zone, void *dbdata, dns_sdlzallnodes_t *allnodes);
-
-/*
- * dlz_newversion() is optional. It should be supplied if you want to
- * support dynamic updates.
- */
-isc_result_t
-dlz_newversion(const char *zone, void *dbdata, void **versionp);
-
-/*
- *  dlz_closeversion() is optional, but must be supplied if you supply
- *  a dlz_newversion() function
- */
-void
-dlz_closeversion(const char *zone, isc_boolean_t commit,
-                                void *dbdata, void **versionp);
-
-/*
- * dlz_configure() is optional, but must be supplied if you want to
- * support dynamic updates
- */
-isc_result_t
-dlz_configure(dns_view_t *view, void *dbdata);
-
-/*
- * dlz_ssumatch() is optional, but must be supplied if you want to
- * support dynamic updates
- */
-isc_boolean_t
-dlz_ssumatch(const char *signer, const char *name, const char *tcpaddr,
-                        const char *type, const char *key, isc_uint32_t keydatalen,
-                        unsigned char *keydata, void *dbdata);
-
-/*
- * dlz_addrdataset() is optional, but must be supplied if you want to
- * support dynamic updates
- */
-isc_result_t
-dlz_addrdataset(const char *name, const char *rdatastr,
-                               void *dbdata, void *version);
-
-/*
- * dlz_subrdataset() is optional, but must be supplied if you want to
- * support dynamic updates
- */
-isc_result_t
-dlz_subrdataset(const char *name, const char *rdatastr,
-                               void *dbdata, void *version);
-
-/*
- * dlz_delrdataset() is optional, but must be supplied if you want to
- * support dynamic updates
- */
-isc_result_t
-dlz_delrdataset(const char *name, const char *type,
-                               void *dbdata, void *version);
+/* $Id: driver.h,v 1.1.4.4 2011/03/17 09:41:07 fdupont Exp $ */
+
+/*
+ * This header includes the declarations of entry points.
+ */
+
+dlz_dlopen_version_t dlz_version;
+dlz_dlopen_create_t dlz_create;
+dlz_dlopen_destroy_t dlz_destroy;
+dlz_dlopen_findzonedb_t dlz_findzonedb;
+dlz_dlopen_lookup_t dlz_lookup;
+dlz_dlopen_allowzonexfr_t dlz_allowzonexfr;
+dlz_dlopen_allnodes_t dlz_allnodes;
+dlz_dlopen_newversion_t dlz_newversion;
+dlz_dlopen_closeversion_t dlz_closeversion;
+dlz_dlopen_configure_t dlz_configure;
+dlz_dlopen_ssumatch_t dlz_ssumatch;
+dlz_dlopen_addrdataset_t dlz_addrdataset;
+dlz_dlopen_subrdataset_t dlz_subrdataset;
+dlz_dlopen_delrdataset_t dlz_delrdataset;
index c9ac1d871f7ac2e12068c630b5ee461bbbfb33df..79c8f0cf2b67b4f1a2b755344eb84f0a690faea2 100644 (file)
@@ -50,7 +50,7 @@
  * USE OR PERFORMANCE OF THIS SOFTWARE.
  */
 
-/* $Id: dlz.h,v 1.12 2010/12/20 23:47:21 tbox Exp $ */
+/* $Id: dlz.h,v 1.12.14.1 2011/03/17 09:41:07 fdupont Exp $ */
 
 /*! \file dns/dlz.h */
 
@@ -318,9 +318,9 @@ dns_dlzunregister(dns_dlzimplementation_t **dlzimp);
  */
 
 
-isc_result_t
-dns_dlz_writeablezone(dns_view_t *view, const char *zone_name);
-
+typedef isc_result_t dns_dlz_writeablezone_t(dns_view_t *view,
+                                            const char *zone_name);
+dns_dlz_writeablezone_t dns_dlz_writeablezone;
 /*%<
  * creates a writeable DLZ zone. Must be called from within the
  * configure() method of a DLZ driver.
diff --git a/lib/dns/include/dns/dlz_dlopen.h b/lib/dns/include/dns/dlz_dlopen.h
new file mode 100644 (file)
index 0000000..2dbecc7
--- /dev/null
@@ -0,0 +1,160 @@
+/*
+ * Copyright (C) 2011  Internet Systems Consortium, Inc. ("ISC")
+ *
+ * Permission to use, copy, modify, and/or distribute this software for any
+ * purpose with or without fee is hereby granted, provided that the above
+ * copyright notice and this permission notice appear in all copies.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
+ * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
+ * AND FITNESS.  IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
+ * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
+ * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
+ * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
+ * PERFORMANCE OF THIS SOFTWARE.
+ */
+
+/* $Id: dlz_dlopen.h,v 1.2.2.2 2011/03/17 09:41:07 fdupont Exp $ */
+
+/*! \file dns/dlz_open.h */
+
+#ifndef DLZ_DLOPEN_H
+#define DLZ_DLOPEN_H
+
+#include <dns/sdlz.h>
+
+ISC_LANG_BEGINDECLS
+
+/*
+ * This header provides a minimal set of defines and typedefs needed
+ * for the entry points of an external DLZ module for bind9.
+ */
+
+#define DLZ_DLOPEN_VERSION 1
+
+/*
+ * dlz_dlopen_version() is required for all DLZ external drivers. It
+ * should return DLZ_DLOPEN_VERSION
+ */
+typedef int dlz_dlopen_version_t (unsigned int *flags);
+
+/*
+ * dlz_dlopen_create() is required for all DLZ external drivers.
+ */
+typedef isc_result_t dlz_dlopen_create_t (const char *dlzname,
+                                         unsigned int argc,
+                                         char *argv[],
+                                         void **dbdata,
+                                         ...);
+
+/*
+ * dlz_dlopen_destroy() is optional, and will be called when the
+ * driver is unloaded if supplied
+ */
+typedef void dlz_dlopen_destroy_t (void *dbdata);
+
+/*
+ * dlz_dlopen_findzonedb() is required for all DLZ external drivers
+ */
+typedef isc_result_t dlz_dlopen_findzonedb_t (void *dbdata,
+                                             const char *name);
+
+/*
+ * dlz_dlopen_lookup() is required for all DLZ external drivers
+ */
+typedef isc_result_t dlz_dlopen_lookup_t (const char *zone,
+                                         const char *name,
+                                         void *dbdata,
+                                         dns_sdlzlookup_t *lookup);
+
+/*
+ * dlz_dlopen_authority is optional() if dlz_dlopen_lookup()
+ * supplies authority information for the dns record
+ */
+typedef isc_result_t dlz_dlopen_authority_t (const char *zone,
+                                            void *dbdata,
+                                            dns_sdlzlookup_t *lookup);
+
+/*
+ * dlz_dlopen_allowzonexfr() is optional, and should be supplied if
+ * you want to support zone transfers
+ */
+typedef isc_result_t dlz_dlopen_allowzonexfr_t (void *dbdata,
+                                               const char *name,
+                                               const char *client);
+
+/*
+ * dlz_dlopen_allnodes() is optional, but must be supplied if supply a
+ * dlz_dlopen_allowzonexfr() function
+ */
+typedef isc_result_t dlz_dlopen_allnodes_t (const char *zone,
+                                           void *dbdata,
+                                           dns_sdlzallnodes_t *allnodes);
+
+/*
+ * dlz_dlopen_newversion() is optional. It should be supplied if you
+ * want to support dynamic updates.
+ */
+typedef isc_result_t dlz_dlopen_newversion_t (const char *zone,
+                                             void *dbdata,
+                                             void **versionp);
+
+/*
+ * dlz_closeversion() is optional, but must be supplied if you supply
+ * a dlz_newversion() function
+ */
+typedef void dlz_dlopen_closeversion_t (const char *zone,
+                                       isc_boolean_t commit,
+                                       void *dbdata,
+                                       void **versionp);
+
+/*
+ * dlz_dlopen_configure() is optional, but must be supplied if you
+ * want to support dynamic updates
+ */
+typedef isc_result_t dlz_dlopen_configure_t (dns_view_t *view,
+                                            void *dbdata);
+
+/*
+ * dlz_dlopen_ssumatch() is optional, but must be supplied if you want
+ * to support dynamic updates
+ */
+typedef isc_boolean_t dlz_dlopen_ssumatch_t (const char *signer,
+                                            const char *name,
+                                            const char *tcpaddr,
+                                            const char *type,
+                                            const char *key,
+                                            isc_uint32_t keydatalen,
+                                            unsigned char *keydata,
+                                            void *dbdata);
+
+/*
+ * dlz_dlopen_addrdataset() is optional, but must be supplied if you
+ * want to support dynamic updates
+ */
+typedef isc_result_t dlz_dlopen_addrdataset_t (const char *name,
+                                              const char *rdatastr,
+                                              void *dbdata,
+                                              void *version);
+
+/*
+ * dlz_dlopen_subrdataset() is optional, but must be supplied if you
+ * want to support dynamic updates
+ */
+typedef isc_result_t dlz_dlopen_subrdataset_t (const char *name,
+                                              const char *rdatastr,
+                                              void *dbdata,
+                                              void *version);
+
+/*
+ * dlz_dlopen_delrdataset() is optional, but must be supplied if you
+ * want to support dynamic updates
+ */
+typedef isc_result_t dlz_dlopen_delrdataset_t (const char *name,
+                                              const char *type,
+                                              void *dbdata,
+                                              void *version);
+
+ISC_LANG_ENDDECLS
+
+#endif
index ddf42a6834ccff689cfae238c50a14c25dd5d5e8..ab8742d7eb0859e617ee0da285ad45bcb0ffe43e 100644 (file)
@@ -50,7 +50,7 @@
  * USE OR PERFORMANCE OF THIS SOFTWARE.
  */
 
-/* $Id: sdlz.h,v 1.14 2011/01/13 08:50:29 tbox Exp $ */
+/* $Id: sdlz.h,v 1.14.8.1 2011/03/17 09:41:07 fdupont Exp $ */
 
 /*! \file dns/sdlz.h */
 
@@ -317,25 +317,33 @@ dns_sdlzunregister(dns_sdlzimplementation_t **sdlzimp);
  * function is called.
  */
 
-isc_result_t
-dns_sdlz_putnamedrr(dns_sdlzallnodes_t *allnodes, const char *name,
-                  const char *type, dns_ttl_t ttl, const char *data);
+typedef isc_result_t dns_sdlz_putnamedrr_t(dns_sdlzallnodes_t *allnodes,
+                                          const char *name,
+                                          const char *type,
+                                          dns_ttl_t ttl,
+                                          const char *data);
+dns_sdlz_putnamedrr_t dns_sdlz_putnamedrr;
+
 /*%<
  * Add a single resource record to the allnodes structure to be later
  * parsed into a zone transfer response.
  */
 
-isc_result_t
-dns_sdlz_putrr(dns_sdlzlookup_t *lookup, const char *type, dns_ttl_t ttl,
-             const char *data);
+typedef isc_result_t dns_sdlz_putrr_t(dns_sdlzlookup_t *lookup,
+                                     const char *type,
+                                     dns_ttl_t ttl,
+                                     const char *data);
+dns_sdlz_putrr_t dns_sdlz_putrr;
 /*%<
  * Add a single resource record to the lookup structure to be later
  * parsed into a query response.
  */
 
-isc_result_t
-dns_sdlz_putsoa(dns_sdlzlookup_t *lookup, const char *mname, const char *rname,
-              isc_uint32_t serial);
+typedef isc_result_t dns_sdlz_putsoa_t(dns_sdlzlookup_t *lookup,
+                                      const char *mname,
+                                      const char *rname,
+                                      isc_uint32_t serial);
+dns_sdlz_putsoa_t dns_sdlz_putsoa;
 /*%<
  * This function may optionally be called from the 'authority'
  * callback to simplify construction of the SOA record for 'zone'.  It
@@ -347,9 +355,11 @@ dns_sdlz_putsoa(dns_sdlzlookup_t *lookup, const char *mname, const char *rname,
  */
 
 
-isc_result_t
-dns_sdlz_setdb(dns_dlzdb_t *dlzdatabase, dns_rdataclass_t rdclass,
-              dns_name_t *name, dns_db_t **dbp);
+typedef isc_result_t dns_sdlz_setdb_t(dns_dlzdb_t *dlzdatabase, 
+                                     dns_rdataclass_t rdclass,
+                                     dns_name_t *name,
+                                     dns_db_t **dbp);
+dns_sdlz_setdb_t dns_sdlz_setdb;
 /*%<
  * Create the database pointers for a writeable SDLZ zone
  */