/*
* Copyright (C) 2011 Internet Systems Consortium, Inc. ("ISC")
*
* Permission to use, copy, modify, and 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 THE AUTHOR
* DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL
* THE AUTHOR 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.
*/
/*
* 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.
*/
#ifndef DLZ_MINIMAL_H
#ifdef ISC_PLATFORM_HAVESYSUNH
#endif
typedef unsigned int isc_result_t;
typedef int isc_boolean_t;
/*
* Define DLZ_DLOPEN_VERSION to different values to use older versions
* of the interface
*/
#ifndef DLZ_DLOPEN_VERSION
#define DLZ_DLOPEN_AGE 0
#endif
/* return these in flags from dlz_version() */
/* result codes */
#define ISC_R_SUCCESS 0
/* boolean values */
#define ISC_FALSE 0
/* log levels */
/* other useful definitions */
#define UNUSED(x) (void)(x)
do { \
union { const void *k; void *v; } _u; \
} while (0)
/* opaque structures */
typedef void *dns_sdlzlookup_t;
typedef void *dns_sdlzallnodes_t;
typedef void *dns_view_t;
typedef void *dns_dlzdb_t;
#if DLZ_DLOPEN_VERSION > 1
/*
* Method and type definitions needed for retrieval of client info
* from the caller.
*/
typedef struct isc_sockaddr {
union {
#ifdef ISC_PLATFORM_HAVESYSUNH
#endif
} type;
unsigned int length;
void * link;
typedef struct dns_clientinfo {
void *data;
void *dbversion;
isc_sockaddr_t **addrp);
void **addrp);
typedef struct dns_clientinfomethods {
#endif /* DLZ_DLOPEN_VERSION > 1 */
/*
* Method definitions for callbacks provided by the dlopen driver
*/
const char *type,
const char *data);
const char *name,
const char *type,
const char *data);
#if DLZ_DLOPEN_VERSION < 3
const char *zone_name);
#else /* DLZ_DLOPEN_VERSION >= 3 */
const char *zone_name);
#endif /* DLZ_DLOPEN_VERSION */
/*
* prototypes for the functions you can include in your module
*/
/*
* dlz_version() is required for all DLZ external drivers. It should
* return DLZ_DLOPEN_VERSION. 'flags' is updated to indicate capabilities
* of the module. In particular, if the module is thread-safe then it
* sets 'flags' to include DNS_SDLZFLAG_THREADSAFE. Other capability
* flags may be added in the future.
*/
int
dlz_version(unsigned int *flags);
/*
* dlz_create() is required for all DLZ external drivers.
*/
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
*/
#if DLZ_DLOPEN_VERSION < 3
#else /* DLZ_DLOPEN_VERSION >= 3 */
#endif /* DLZ_DLOPEN_VERSION */
/*
* dlz_lookup is required for all DLZ external drivers
*/
#if DLZ_DLOPEN_VERSION == 1
#else /* DLZ_DLOPEN_VERSION > 1 */
#endif /* DLZ_DLOPEN_VERSION */
/*
* dlz_authority() is optional if dlz_lookup() supplies
* authority information (i.e., SOA, NS) for the dns record
*/
/*
* dlz_allowzonexfr() is optional, and should be supplied if you want to
* support zone transfers
*/
/*
* dlz_allnodes() is optional, but must be supplied if supply a
* dlz_allowzonexfr() function
*/
/*
* dlz_newversion() is optional. It should be supplied if you want to
* support dynamic updates.
*/
/*
* dlz_closeversion() is optional, but must be supplied if you supply a
* dlz_newversion() function
*/
void
void **versionp);
/*
* dlz_configure() is optional, but must be supplied if you want to support
* dynamic updates
*/
#if DLZ_DLOPEN_VERSION < 3
#else /* DLZ_DLOPEN_VERSION >= 3 */
#endif /* DLZ_DLOPEN_VERSION */
/*
* dlz_ssumatch() is optional, but must be supplied if you want to support
* dynamic updates
*/
/*
* dlz_addrdataset() is optional, but must be supplied if you want to
* support dynamic updates
*/
void *version);
/*
* dlz_subrdataset() is optional, but must be supplied if you want to
* support dynamic updates
*/
void *version);
/*
* dlz_delrdataset() is optional, but must be supplied if you want to
* support dynamic updates
*/
void *version);
#endif /* DLZ_MINIMAL_H */