dlz.h File Reference

#include <dns/clientinfo.h>
#include <dns/name.h>
#include <dns/types.h>
#include <dns/view.h>
#include <dst/dst.h>
#include <isc/lang.h>

Go to the source code of this file.

Data Structures

struct  dns_dlzmethods
 the methods supplied by a DLZ driver More...
struct  dns_dlzimplementation
 information about a DLZ driver More...
struct  dns_dlzdb
 An instance of a DLZ driver. More...

Defines

#define DLZ_H   1
#define DNS_DLZ_MAGIC   ISC_MAGIC('D','L','Z','D')
#define DNS_DLZ_VALID(dlz)   ISC_MAGIC_VALID(dlz, DNS_DLZ_MAGIC)

Typedefs

typedef isc_result_t(* dns_dlzallowzonexfr_t )(void *driverarg, void *dbdata, isc_mem_t *mctx, dns_rdataclass_t rdclass, dns_name_t *name, isc_sockaddr_t *clientaddr, dns_db_t **dbp)
 Method prototype. Drivers implementing the DLZ interface MUST supply an allow zone transfer method. This method is called when the DNS server is performing a zone transfer query. The driver's method should return ISC_R_SUCCESS and a database pointer to the name server if the zone is supported by the database, and zone transfer is allowed. Otherwise it will return ISC_R_NOTFOUND if the zone is not supported by the database, or ISC_R_NOPERM if zone transfers are not allowed. If an error occurs it should return a result code indicating the type of error.
typedef isc_result_t(* dns_dlzcreate_t )(isc_mem_t *mctx, const char *dlzname, unsigned int argc, char *argv[], void *driverarg, void **dbdata)
 Method prototype. Drivers implementing the DLZ interface MUST supply a create method. This method is called when the DNS server is starting up and creating drivers for use later.
typedef void(* dns_dlzdestroy_t )(void *driverarg, void **dbdata)
 Method prototype. Drivers implementing the DLZ interface MUST supply a destroy method. This method is called when the DNS server is shutting down and no longer needs the driver.
typedef isc_result_t(* dns_dlzfindzone_t )(void *driverarg, void *dbdata, isc_mem_t *mctx, dns_rdataclass_t rdclass, dns_name_t *name, dns_clientinfomethods_t *methods, dns_clientinfo_t *clientinfo, dns_db_t **dbp)
 Method prototype. Drivers implementing the DLZ interface MUST supply a find zone method. This method is called when the DNS server is performing a query. The find zone method will be called with the longest possible name first, and continue to be called with successively shorter domain names, until any of the following occur:.
typedef isc_result_t(* dns_dlzconfigure_t )(void *driverarg, void *dbdata, dns_view_t *view, dns_dlzdb_t *dlzdb)
 Method prototype. Drivers implementing the DLZ interface may optionally supply a configure method. If supplied, this will be called immediately after the create method is called. The driver may call configuration functions during the configure call.
typedef isc_boolean_t(* dns_dlzssumatch_t )(dns_name_t *signer, dns_name_t *name, isc_netaddr_t *tcpaddr, dns_rdatatype_t type, const dst_key_t *key, void *driverarg, void *dbdata)
 Method prototype. Drivers implementing the DLZ interface may optionally supply a ssumatch method. If supplied, this will be called to authorize update requests.
typedef struct dns_dlzmethods dns_dlzmethods_t
typedef isc_result_t(* dlzconfigure_callback_t )(dns_view_t *, dns_dlzdb_t *, dns_zone_t *)
typedef isc_result_t dns_dlz_writeablezone_t (dns_view_t *view, dns_dlzdb_t *dlzdb, const char *zone_name)

Functions

isc_result_t dns_dlzallowzonexfr (dns_view_t *view, dns_name_t *name, isc_sockaddr_t *clientaddr, dns_db_t **dbp)
 This method is called when the DNS server is performing a zone transfer query. It will call the DLZ driver's allow zone transfer method.
isc_result_t dns_dlzcreate (isc_mem_t *mctx, const char *dlzname, const char *drivername, unsigned int argc, char *argv[], dns_dlzdb_t **dbp)
 This method is called when the DNS server is starting up and creating drivers for use later. It will search the DLZ driver list for 'drivername' and return a DLZ driver via dbp if a match is found. If the DLZ driver supplies a create method, this function will call it.
void dns_dlzdestroy (dns_dlzdb_t **dbp)
 This method is called when the DNS server is shutting down and no longer needs the driver. If the DLZ driver supplies a destroy methods, this function will call it.
isc_result_t dns_dlzregister (const char *drivername, const dns_dlzmethods_t *methods, void *driverarg, isc_mem_t *mctx, dns_dlzimplementation_t **dlzimp)
 Register a dynamically loadable zones (DLZ) driver for the database type 'drivername', implemented by the functions in '*methods'.
isc_result_t dns_dlzstrtoargv (isc_mem_t *mctx, char *s, unsigned int *argcp, char ***argvp)
 This method is called when the name server is starting up to parse the DLZ driver command line from named.conf. Basically it splits up a string into and argc / argv. The primary difference of this method is items between braces { } are considered only 1 word. for example the command line "this is { one grouped phrase } and this isn't" would be parsed into:.
void dns_dlzunregister (dns_dlzimplementation_t **dlzimp)
 Removes the dlz driver from the list of registered dlz drivers. There must be no active dlz drivers of this type when this function is called.
isc_result_t dns_dlzconfigure (dns_view_t *view, dns_dlzdb_t *dlzdb, dlzconfigure_callback_t callback)
 call a DLZ drivers configure method, if supplied
isc_boolean_t dns_dlz_ssumatch (dns_dlzdb_t *dlzdatabase, dns_name_t *signer, dns_name_t *name, isc_netaddr_t *tcpaddr, dns_rdatatype_t type, const dst_key_t *key)
 call a DLZ drivers ssumatch method, if supplied. Otherwise return ISC_FALSE

Variables

dns_dlz_writeablezone_t dns_dlz_writeablezone
 creates a writeable DLZ zone. Must be called from within the configure() method of a DLZ driver.


Detailed Description

Definition in file dlz.h.


Define Documentation

#define DLZ_H   1

Definition at line 58 of file dlz.h.

#define DNS_DLZ_MAGIC   ISC_MAGIC('D','L','Z','D')

Definition at line 101 of file dlz.h.

Referenced by dns_dlzcreate().

#define DNS_DLZ_VALID ( dlz   )     ISC_MAGIC_VALID(dlz, DNS_DLZ_MAGIC)

Definition at line 102 of file dlz.h.

Referenced by dns_dlz_writeablezone(), dns_dlzallowzonexfr(), dns_dlzconfigure(), dns_dlzdestroy(), dns_view_searchdlz(), and zone_load().


Typedef Documentation

typedef isc_result_t(* dns_dlzallowzonexfr_t)(void *driverarg, void *dbdata, isc_mem_t *mctx, dns_rdataclass_t rdclass, dns_name_t *name, isc_sockaddr_t *clientaddr, dns_db_t **dbp)

Method prototype. Drivers implementing the DLZ interface MUST supply an allow zone transfer method. This method is called when the DNS server is performing a zone transfer query. The driver's method should return ISC_R_SUCCESS and a database pointer to the name server if the zone is supported by the database, and zone transfer is allowed. Otherwise it will return ISC_R_NOTFOUND if the zone is not supported by the database, or ISC_R_NOPERM if zone transfers are not allowed. If an error occurs it should return a result code indicating the type of error.

Definition at line 105 of file dlz.h.

typedef isc_result_t(* dns_dlzcreate_t)(isc_mem_t *mctx, const char *dlzname, unsigned int argc, char *argv[], void *driverarg, void **dbdata)

Method prototype. Drivers implementing the DLZ interface MUST supply a create method. This method is called when the DNS server is starting up and creating drivers for use later.

Definition at line 123 of file dlz.h.

typedef void(* dns_dlzdestroy_t)(void *driverarg, void **dbdata)

Method prototype. Drivers implementing the DLZ interface MUST supply a destroy method. This method is called when the DNS server is shutting down and no longer needs the driver.

Definition at line 133 of file dlz.h.

typedef isc_result_t(* dns_dlzfindzone_t)(void *driverarg, void *dbdata, isc_mem_t *mctx, dns_rdataclass_t rdclass, dns_name_t *name, dns_clientinfomethods_t *methods, dns_clientinfo_t *clientinfo, dns_db_t **dbp)

Method prototype. Drivers implementing the DLZ interface MUST supply a find zone method. This method is called when the DNS server is performing a query. The find zone method will be called with the longest possible name first, and continue to be called with successively shorter domain names, until any of the following occur:.

The driver's find zone method should return ISC_R_SUCCESS and a database pointer to the name server if the zone is supported by the database. Otherwise it will return ISC_R_NOTFOUND, and a null pointer if the zone is not supported. If an error occurs it should return a result code indicating the type of error.

Definition at line 142 of file dlz.h.

typedef isc_result_t(* dns_dlzconfigure_t)(void *driverarg, void *dbdata, dns_view_t *view, dns_dlzdb_t *dlzdb)

Method prototype. Drivers implementing the DLZ interface may optionally supply a configure method. If supplied, this will be called immediately after the create method is called. The driver may call configuration functions during the configure call.

Definition at line 174 of file dlz.h.

typedef isc_boolean_t(* dns_dlzssumatch_t)(dns_name_t *signer, dns_name_t *name, isc_netaddr_t *tcpaddr, dns_rdatatype_t type, const dst_key_t *key, void *driverarg, void *dbdata)

Method prototype. Drivers implementing the DLZ interface may optionally supply a ssumatch method. If supplied, this will be called to authorize update requests.

Definition at line 184 of file dlz.h.

typedef struct dns_dlzmethods dns_dlzmethods_t

typedef isc_result_t(* dlzconfigure_callback_t)(dns_view_t *, dns_dlzdb_t *, dns_zone_t *)

Definition at line 215 of file dlz.h.

typedef isc_result_t dns_dlz_writeablezone_t(dns_view_t *view, dns_dlzdb_t *dlzdb, const char *zone_name)

Definition at line 317 of file dlz.h.


Function Documentation

isc_result_t dns_dlzallowzonexfr ( dns_view_t view,
dns_name_t name,
isc_sockaddr_t clientaddr,
dns_db_t **  dbp 
)

This method is called when the DNS server is performing a zone transfer query. It will call the DLZ driver's allow zone transfer method.

Definition at line 114 of file dlz.c.

References dns_dlzmethods::allowzonexfr, dns_dlzdb::dbdata, dns_view::dlz_searched, DNS_DLZ_VALID, dns_dlzimplementation::driverarg, dns_dlzdb::implementation, ISC_LIST_HEAD, ISC_LIST_NEXT, ISC_R_NOPERM, ISC_R_NOTFOUND, ISC_R_NOTIMPLEMENTED, ISC_R_SUCCESS, dns_dlzdb::mctx, dns_dlzimplementation::methods, dns_view::rdclass, and REQUIRE.

Referenced by ns_xfr_start().

isc_result_t dns_dlzcreate ( isc_mem_t mctx,
const char *  dlzname,
const char *  drivername,
unsigned int  argc,
char *  argv[],
dns_dlzdb_t **  dbp 
)

This method is called when the DNS server is starting up and creating drivers for use later. It will search the DLZ driver list for 'drivername' and return a DLZ driver via dbp if a match is found. If the DLZ driver supplies a create method, this function will call it.

Definition at line 156 of file dlz.c.

References dns_dlzmethods::create, dns_dlzdb::dbdata, dlz_impfind(), dns_dlzdb::dlzname, DNS_DLZ_MAGIC, dns_lctx, DNS_LOGCATEGORY_DATABASE, DNS_LOGMODULE_DLZ, dns_dlzimplementation::driverarg, dns_dlzdb::implementation, ISC_LINK_INIT, ISC_LOG_DEBUG, ISC_LOG_ERROR, ISC_LOG_INFO, isc_log_write(), isc_mem_attach(), isc_mem_get, isc_mem_put, isc_mem_strdup, isc_once_do, ISC_R_NOMEMORY, ISC_R_NOTFOUND, ISC_R_SUCCESS, isc_rwlocktype_read, dns_dlzdb::magic, dns_dlzdb::mctx, dns_dlzimplementation::methods, once, REQUIRE, RUNTIME_CHECK, RWLOCK, and RWUNLOCK.

Referenced by configure_view().

void dns_dlzdestroy ( dns_dlzdb_t **  dbp  ) 

This method is called when the DNS server is shutting down and no longer needs the driver. If the DLZ driver supplies a destroy methods, this function will call it.

Definition at line 242 of file dlz.c.

References destroy(), DNS_DLZ_VALID, dns_lctx, DNS_LOGCATEGORY_DATABASE, DNS_LOGMODULE_DLZ, dns_ssutable_detach(), ISC_LOG_DEBUG, isc_log_write(), isc_mem_detach(), isc_mem_free, isc_mem_put, mctx, and REQUIRE.

Referenced by destroy().

isc_result_t dns_dlzregister ( const char *  drivername,
const dns_dlzmethods_t methods,
void *  driverarg,
isc_mem_t mctx,
dns_dlzimplementation_t **  dlzimp 
)

Register a dynamically loadable zones (DLZ) driver for the database type 'drivername', implemented by the functions in '*methods'.

dlzimp must point to a NULL dlz_implementation_t pointer. That is, dlzimp != NULL && *dlzimp == NULL. It will be assigned a value that will later be used to identify the driver when deregistering it.

Definition at line 280 of file dlz.c.

References dns_dlzmethods::create, dns_dlzmethods::destroy, dlz_impfind(), dns_lctx, DNS_LOGCATEGORY_DATABASE, DNS_LOGMODULE_DLZ, dns_dlzimplementation::driverarg, dns_dlzmethods::findzone, ISC_LINK_INIT, ISC_LIST_APPEND, ISC_LOG_DEBUG, isc_log_write(), isc_mem_attach(), isc_mem_get, isc_once_do, ISC_R_EXISTS, ISC_R_NOMEMORY, ISC_R_SUCCESS, isc_rwlocktype_write, dns_dlzimplementation::mctx, dns_dlzimplementation::methods, dns_dlzimplementation::name, once, REQUIRE, RUNTIME_CHECK, RWLOCK, and RWUNLOCK.

Referenced by dns_sdlzregister().

isc_result_t dns_dlzstrtoargv ( isc_mem_t mctx,
char *  s,
unsigned int *  argcp,
char ***  argvp 
)

This method is called when the name server is starting up to parse the DLZ driver command line from named.conf. Basically it splits up a string into and argc / argv. The primary difference of this method is items between braces { } are considered only 1 word. for example the command line "this is { one grouped phrase } and this isn't" would be parsed into:.

braces should NOT be nested, more than one grouping in the command line is allowed. Notice, argv[2] has an extra space at the beginning and end. Extra spaces are not stripped between a grouping. You can do so in your driver if needed, or be sure not to put extra spaces before / after the braces.

Definition at line 433 of file dlz.c.

References dns_dlzstrtoargvsub().

Referenced by configure_view().

void dns_dlzunregister ( dns_dlzimplementation_t **  dlzimp  ) 

Removes the dlz driver from the list of registered dlz drivers. There must be no active dlz drivers of this type when this function is called.

Definition at line 444 of file dlz.c.

References dns_lctx, DNS_LOGCATEGORY_DATABASE, DNS_LOGMODULE_DLZ, ISC_LIST_UNLINK, ISC_LOG_DEBUG, isc_log_write(), isc_mem_detach(), isc_mem_put, isc_once_do, ISC_R_SUCCESS, isc_rwlocktype_write, dns_dlzimplementation::mctx, mctx, once, REQUIRE, RUNTIME_CHECK, RWLOCK, and RWUNLOCK.

Referenced by dns_sdlzunregister().

isc_result_t dns_dlzconfigure ( dns_view_t view,
dns_dlzdb_t dlzdb,
dlzconfigure_callback_t  callback 
)

call a DLZ drivers configure method, if supplied

Definition at line 574 of file dlz.c.

References dns_dlzmethods::configure, dns_dlzdb::configure_callback, dns_dlzdb::dbdata, DNS_DLZ_VALID, dns_dlzimplementation::driverarg, dns_dlzdb::implementation, ISC_R_SUCCESS, dns_dlzimplementation::methods, and REQUIRE.

Referenced by configure_view().

isc_boolean_t dns_dlz_ssumatch ( dns_dlzdb_t dlzdatabase,
dns_name_t signer,
dns_name_t name,
isc_netaddr_t tcpaddr,
dns_rdatatype_t  type,
const dst_key_t key 
)

call a DLZ drivers ssumatch method, if supplied. Otherwise return ISC_FALSE

Definition at line 596 of file dlz.c.

References dns_dlzdb::dbdata, dns_lctx, DNS_LOGCATEGORY_DATABASE, DNS_LOGMODULE_DLZ, dns_dlzimplementation::driverarg, dns_dlzdb::implementation, ISC_FALSE, ISC_LOG_INFO, isc_log_write(), dns_dlzimplementation::methods, r, REQUIRE, and dns_dlzmethods::ssumatch.

Referenced by dns_ssutable_checkrules().


Variable Documentation

dns_dlz_writeablezone_t dns_dlz_writeablezone

creates a writeable DLZ zone. Must be called from within the configure() method of a DLZ driver.

Definition at line 321 of file dlz.h.


Generated on Tue Apr 28 17:41:09 2015 by Doxygen 1.5.4 for BIND9 Internals 9.11.0pre-alpha