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