librpc: Shorten dcerpc_binding_handle_call a bit
[Samba/gebeck_regimport.git] / source4 / dns_server / dlz_minimal.h
blob5262cbdaa6aebe1ff896c5674421d29c2c96c431
1 /*
2 * Copyright (C) 2010 Andrew Tridgell
4 * Permission to use, copy, modify, and distribute this software for any
5 * purpose with or without fee is hereby granted, provided that the
6 * above copyright notice and this permission notice appear in all
7 * copies.
9 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR
10 * DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL
11 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL
12 * THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR
13 * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS
14 * 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
16 * USE OR PERFORMANCE OF THIS SOFTWARE.
20 This header provides a minimal set of defines and typedefs needed
21 for building an external DLZ module for bind9. When creating a new
22 external DLZ driver, please copy this header into your own source
23 tree.
25 typedef unsigned int isc_result_t;
26 #ifdef BIND_VERSION_9_8
27 typedef bool isc_boolean_t;
28 #else
29 typedef int isc_boolean_t;
30 #endif
31 typedef uint32_t dns_ttl_t;
33 #ifdef BIND_VERSION_9_8
34 #define DLZ_DLOPEN_VERSION 1
35 #else
36 #define DLZ_DLOPEN_VERSION 2
37 #endif
39 /* return this in flags to dlz_version() if thread safe */
40 #define DNS_SDLZFLAG_THREADSAFE 0x00000001U
42 /* result codes */
43 #define ISC_R_SUCCESS 0
44 #define ISC_R_NOMEMORY 1
45 #define ISC_R_NOPERM 6
46 #define ISC_R_NOTFOUND 23
47 #define ISC_R_FAILURE 25
48 #define ISC_R_NOMORE 29
50 /* boolean values */
51 #define ISC_TRUE 1
52 #define ISC_FALSE 0
54 /* log levels */
55 #define ISC_LOG_INFO (-1)
56 #define ISC_LOG_NOTICE (-2)
57 #define ISC_LOG_WARNING (-3)
58 #define ISC_LOG_ERROR (-4)
59 #define ISC_LOG_CRITICAL (-5)
61 /* some opaque structures */
62 typedef void *dns_sdlzlookup_t;
63 typedef void *dns_sdlzallnodes_t;
64 typedef void *dns_view_t;
65 typedef void *dns_clientinfomethods_t;
66 typedef void *dns_clientinfo_t;
69 * method definitions for callbacks provided by dlopen driver
72 typedef void log_t(int level, const char *fmt, ...);
74 typedef isc_result_t dns_sdlz_putrr_t(dns_sdlzlookup_t *lookup,
75 const char *type,
76 dns_ttl_t ttl,
77 const char *data);
79 typedef isc_result_t dns_sdlz_putnamedrr_t(dns_sdlzallnodes_t *allnodes,
80 const char *name,
81 const char *type,
82 dns_ttl_t ttl,
83 const char *data);
85 typedef isc_result_t dns_dlz_writeablezone_t(dns_view_t *view,
86 const char *zone_name);
90 * prototypes for the functions you can include in your driver
95 * dlz_version() is required for all DLZ external drivers. It should
96 * return DLZ_DLOPEN_VERSION
98 int dlz_version(unsigned int *flags);
101 * dlz_create() is required for all DLZ external drivers.
103 isc_result_t dlz_create(const char *dlzname, unsigned int argc, char *argv[], void **dbdata, ...);
106 * dlz_destroy() is optional, and will be called when the driver is
107 * unloaded if supplied
109 void dlz_destroy(void *dbdata);
112 dlz_findzonedb is required for all DLZ external drivers
114 isc_result_t dlz_findzonedb(void *dbdata, const char *name);
117 dlz_lookup is required for all DLZ external drivers
119 #ifdef BIND_VERSION_9_8
120 isc_result_t dlz_lookup(const char *zone, const char *name,
121 void *dbdata, dns_sdlzlookup_t *lookup);
122 #else
123 isc_result_t dlz_lookup(const char *zone, const char *name,
124 void *dbdata, dns_sdlzlookup_t *lookup,
125 dns_clientinfomethods_t *methods,
126 dns_clientinfo_t *clientinfo);
127 #endif
130 dlz_allowzonexfr() is optional, and should be supplied if you want
131 to support zone transfers
133 isc_result_t dlz_allowzonexfr(void *dbdata, const char *name, const char *client);
137 dlz_allnodes() is optional, but must be supplied if supply a
138 dlz_allowzonexfr() function
140 isc_result_t dlz_allnodes(const char *zone, void *dbdata, dns_sdlzallnodes_t *allnodes);
143 dlz_newversion() is optional. It should be supplied if you want to
144 support dynamic updates.
146 isc_result_t dlz_newversion(const char *zone, void *dbdata, void **versionp);
149 dlz_closeversion() is optional, but must be supplied if you supply
150 a dlz_newversion() function
152 void dlz_closeversion(const char *zone, isc_boolean_t commit, void *dbdata, void **versionp);
155 dlz_configure() is optional, but must be supplied if you want to
156 support dynamic updates
158 isc_result_t dlz_configure(dns_view_t *view, void *dbdata);
161 dlz_ssumatch() is optional, but must be supplied if you want to
162 support dynamic updates
164 isc_boolean_t dlz_ssumatch(const char *signer, const char *name, const char *tcpaddr,
165 const char *type, const char *key, uint32_t keydatalen, uint8_t *keydata,
166 void *dbdata);
169 dlz_addrdataset() is optional, but must be supplied if you want to
170 support dynamic updates
172 isc_result_t dlz_addrdataset(const char *name, const char *rdatastr, void *dbdata, void *version);
175 dlz_subrdataset() is optional, but must be supplied if you want to
176 support dynamic updates
178 isc_result_t dlz_subrdataset(const char *name, const char *rdatastr, void *dbdata, void *version);
181 dlz_delrdataset() is optional, but must be supplied if you want to
182 support dynamic updates
184 isc_result_t dlz_delrdataset(const char *name, const char *type, void *dbdata, void *version);