1 /* $NetBSD: dlz_dlopen.h,v 1.1.1.5 2014/12/10 03:34:42 christos Exp $ */ 2 3 /* 4 * Copyright (C) 2011-2013 Internet Systems Consortium, Inc. ("ISC") 5 * 6 * Permission to use, copy, modify, and/or distribute this software for any 7 * purpose with or without fee is hereby granted, provided that the above 8 * copyright notice and this permission notice appear in all copies. 9 * 10 * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH 11 * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY 12 * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT, 13 * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM 14 * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE 15 * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR 16 * PERFORMANCE OF THIS SOFTWARE. 17 */ 18 19 /* Id */ 20 21 /*! \file dns/dlz_open.h */ 22 23 #ifndef DLZ_DLOPEN_H 24 #define DLZ_DLOPEN_H 25 26 #include <dns/sdlz.h> 27 28 ISC_LANG_BEGINDECLS 29 30 /* 31 * This header provides a minimal set of defines and typedefs needed 32 * for the entry points of an external DLZ module for bind9. 33 */ 34 35 #define DLZ_DLOPEN_VERSION 3 36 #define DLZ_DLOPEN_AGE 0 37 38 /* 39 * dlz_dlopen_version() is required for all DLZ external drivers. It 40 * should return DLZ_DLOPEN_VERSION 41 */ 42 typedef int dlz_dlopen_version_t(unsigned int *flags); 43 44 /* 45 * dlz_dlopen_create() is required for all DLZ external drivers. 46 */ 47 typedef isc_result_t dlz_dlopen_create_t(const char *dlzname, 48 unsigned int argc, 49 char *argv[], 50 void **dbdata, 51 ...); 52 53 /* 54 * dlz_dlopen_destroy() is optional, and will be called when the 55 * driver is unloaded if supplied 56 */ 57 typedef void dlz_dlopen_destroy_t(void *dbdata); 58 59 /* 60 * dlz_dlopen_findzonedb() is required for all DLZ external drivers 61 */ 62 typedef isc_result_t dlz_dlopen_findzonedb_t(void *dbdata, 63 const char *name, 64 dns_clientinfomethods_t *methods, 65 dns_clientinfo_t *clientinfo); 66 67 /* 68 * dlz_dlopen_lookup() is required for all DLZ external drivers 69 */ 70 typedef isc_result_t dlz_dlopen_lookup_t(const char *zone, 71 const char *name, 72 void *dbdata, 73 dns_sdlzlookup_t *lookup, 74 dns_clientinfomethods_t *methods, 75 dns_clientinfo_t *clientinfo); 76 77 /* 78 * dlz_dlopen_authority is optional() if dlz_dlopen_lookup() 79 * supplies authority information for the dns record 80 */ 81 typedef isc_result_t dlz_dlopen_authority_t(const char *zone, 82 void *dbdata, 83 dns_sdlzlookup_t *lookup); 84 85 /* 86 * dlz_dlopen_allowzonexfr() is optional, and should be supplied if 87 * you want to support zone transfers 88 */ 89 typedef isc_result_t dlz_dlopen_allowzonexfr_t(void *dbdata, 90 const char *name, 91 const char *client); 92 93 /* 94 * dlz_dlopen_allnodes() is optional, but must be supplied if supply a 95 * dlz_dlopen_allowzonexfr() function 96 */ 97 typedef isc_result_t dlz_dlopen_allnodes_t(const char *zone, 98 void *dbdata, 99 dns_sdlzallnodes_t *allnodes); 100 101 /* 102 * dlz_dlopen_newversion() is optional. It should be supplied if you 103 * want to support dynamic updates. 104 */ 105 typedef isc_result_t dlz_dlopen_newversion_t(const char *zone, 106 void *dbdata, 107 void **versionp); 108 109 /* 110 * dlz_closeversion() is optional, but must be supplied if you supply 111 * a dlz_newversion() function 112 */ 113 typedef void dlz_dlopen_closeversion_t(const char *zone, 114 isc_boolean_t commit, 115 void *dbdata, 116 void **versionp); 117 118 /* 119 * dlz_dlopen_configure() is optional, but must be supplied if you 120 * want to support dynamic updates 121 */ 122 typedef isc_result_t dlz_dlopen_configure_t(dns_view_t *view, 123 dns_dlzdb_t *dlzdb, 124 void *dbdata); 125 126 /* 127 * dlz_dlopen_setclientcallback() is optional, but must be supplied if you 128 * want to retrieve information about the client (e.g., source address) 129 * before sending a replay. 130 */ 131 typedef isc_result_t dlz_dlopen_setclientcallback_t(dns_view_t *view, 132 void *dbdata); 133 134 135 /* 136 * dlz_dlopen_ssumatch() is optional, but must be supplied if you want 137 * to support dynamic updates 138 */ 139 typedef isc_boolean_t dlz_dlopen_ssumatch_t(const char *signer, 140 const char *name, 141 const char *tcpaddr, 142 const char *type, 143 const char *key, 144 isc_uint32_t keydatalen, 145 unsigned char *keydata, 146 void *dbdata); 147 148 /* 149 * dlz_dlopen_addrdataset() is optional, but must be supplied if you 150 * want to support dynamic updates 151 */ 152 typedef isc_result_t dlz_dlopen_addrdataset_t(const char *name, 153 const char *rdatastr, 154 void *dbdata, 155 void *version); 156 157 /* 158 * dlz_dlopen_subrdataset() is optional, but must be supplied if you 159 * want to support dynamic updates 160 */ 161 typedef isc_result_t dlz_dlopen_subrdataset_t(const char *name, 162 const char *rdatastr, 163 void *dbdata, 164 void *version); 165 166 /* 167 * dlz_dlopen_delrdataset() is optional, but must be supplied if you 168 * want to support dynamic updates 169 */ 170 typedef isc_result_t dlz_dlopen_delrdataset_t(const char *name, 171 const char *type, 172 void *dbdata, 173 void *version); 174 175 ISC_LANG_ENDDECLS 176 177 #endif 178