summaryrefslogtreecommitdiff
path: root/source4/dns_server
diff options
context:
space:
mode:
authorAmitay Isaacs <amitay@gmail.com>2012-04-05 16:45:01 +1000
committerAmitay Isaacs <amitay@gmail.com>2012-04-16 11:16:34 +1000
commitbbc98df743fb81b560bbb0d1e2a3db6425720fac (patch)
tree1ed094dada64354851c6289d3c5b43d081f5c588 /source4/dns_server
parent07677b2e433e4dc1aa956b2fda0e477a9c7b88b5 (diff)
downloadsamba-bbc98df743fb81b560bbb0d1e2a3db6425720fac.tar.gz
samba-bbc98df743fb81b560bbb0d1e2a3db6425720fac.tar.bz2
samba-bbc98df743fb81b560bbb0d1e2a3db6425720fac.zip
dlz_bind9: Build shared libraries for both BIND versions 9.8 and 9.9
This adds #define BIND_VERSION_9_8 and keeps the current version as 9.9, so shared libraries can be built for both BIND versions.
Diffstat (limited to 'source4/dns_server')
-rw-r--r--source4/dns_server/dlz_bind9.c5
-rw-r--r--source4/dns_server/dlz_minimal.h13
-rw-r--r--source4/dns_server/wscript_build10
3 files changed, 28 insertions, 0 deletions
diff --git a/source4/dns_server/dlz_bind9.c b/source4/dns_server/dlz_bind9.c
index 153574b1aa..224f242b87 100644
--- a/source4/dns_server/dlz_bind9.c
+++ b/source4/dns_server/dlz_bind9.c
@@ -846,10 +846,15 @@ static isc_result_t dlz_lookup_types(struct dlz_bind9_data *state,
/*
lookup one record
*/
+#ifdef BIND_VERSION_9_8
+_PUBLIC_ isc_result_t dlz_lookup(const char *zone, const char *name,
+ void *dbdata, dns_sdlzlookup_t *lookup)
+#else
_PUBLIC_ isc_result_t dlz_lookup(const char *zone, const char *name,
void *dbdata, dns_sdlzlookup_t *lookup,
dns_clientinfomethods_t *methods,
dns_clientinfo_t *clientinfo)
+#endif
{
struct dlz_bind9_data *state = talloc_get_type_abort(dbdata, struct dlz_bind9_data);
return dlz_lookup_types(state, zone, name, lookup, NULL);
diff --git a/source4/dns_server/dlz_minimal.h b/source4/dns_server/dlz_minimal.h
index 3f408ab117..5262cbdaa6 100644
--- a/source4/dns_server/dlz_minimal.h
+++ b/source4/dns_server/dlz_minimal.h
@@ -23,10 +23,18 @@
tree.
*/
typedef unsigned int isc_result_t;
+#ifdef BIND_VERSION_9_8
+typedef bool isc_boolean_t;
+#else
typedef int isc_boolean_t;
+#endif
typedef uint32_t dns_ttl_t;
+#ifdef BIND_VERSION_9_8
+#define DLZ_DLOPEN_VERSION 1
+#else
#define DLZ_DLOPEN_VERSION 2
+#endif
/* return this in flags to dlz_version() if thread safe */
#define DNS_SDLZFLAG_THREADSAFE 0x00000001U
@@ -108,10 +116,15 @@ isc_result_t dlz_findzonedb(void *dbdata, const char *name);
/*
dlz_lookup is required for all DLZ external drivers
*/
+#ifdef BIND_VERSION_9_8
+isc_result_t dlz_lookup(const char *zone, const char *name,
+ void *dbdata, dns_sdlzlookup_t *lookup);
+#else
isc_result_t dlz_lookup(const char *zone, const char *name,
void *dbdata, dns_sdlzlookup_t *lookup,
dns_clientinfomethods_t *methods,
dns_clientinfo_t *clientinfo);
+#endif
/*
dlz_allowzonexfr() is optional, and should be supplied if you want
diff --git a/source4/dns_server/wscript_build b/source4/dns_server/wscript_build
index 29895b2d18..e508fcdbe6 100644
--- a/source4/dns_server/wscript_build
+++ b/source4/dns_server/wscript_build
@@ -12,8 +12,18 @@ bld.SAMBA_MODULE('service_dns',
# a bind9 dlz module giving access to the Samba DNS SAM
bld.SAMBA_LIBRARY('dlz_bind9',
source='dlz_bind9.c',
+ cflags='-DBIND_VERSION_9_8',
private_library=True,
link_name='modules/bind9/dlz_bind9.so',
realname='dlz_bind9.so',
install_path='${MODULESDIR}/bind9',
deps='samba-hostconfig samdb gensec popt')
+
+bld.SAMBA_LIBRARY('dlz_bind9_9',
+ source='dlz_bind9.c',
+ cflags='-DBIND_VERSION_9_9',
+ private_library=True,
+ link_name='modules/bind9/dlz_bind9_9.so',
+ realname='dlz_bind9.so',
+ install_path='${MODULESDIR}/bind9',
+ deps='samba-hostconfig samdb gensec popt')