ANNOUNCEMENT: NSD 1.2.0 released
Colm MacCarthaigh
colm.maccarthaigh at heanet.ie
Wed Jul 9 15:34:11 UTC 2003
On Wed, Jul 09, 2003 at 05:16:58PM +0200, Erik Rozendaal wrote:
> Actually, you just need to make sure you compile with -I<nsd-source-dir>
> -DHAVE_CONFIG_H. Try to use the same CPPFLAGS and CFLAGS for your
> plugin as you used to compile NSD. Or adapt the "example-plugin" rules
> in Makefile.in for your own plugins.
>
> Or maybe there should be a sample/reference Makefile for plugins...
Might be an idea, I have autoconf templated and a Makefile.in
for my acl plugin (their attached) but it's quite messy!
I've compiled the example plugin using
gcc -shared -I$nsdsource -DHAVE_CONFIG_H $nsdsource/dname.c \
example-plugin.c -o example-plugin.so
and it's working just fine for .nl, but if I create subdomains
I'm in trouble. What would the equivelant for
nsd->register_data(nsd, id, "\004\002nl", "hello, world!");
be for example.com ? I've tried:
"\004\002example.com",
"\004\002example\004\002com",
"\004\002example\002com"
without success.
--
Colm MacCárthaigh / HEAnet, Teach Brooklawn, / Innealtóir Ghréasáin
+353 1 6609040 / Bóthar Shelbourne, BÁC, IE / http://www.hea.net/
-------------- next part --------------
dnl
dnl Some global settings
dnl
AC_INIT(ACLC,0.1,colm.maccarthaigh at heanet.ie)
AC_ARG_WITH([nsd-source],
AC_HELP_STRING([--with-nsd-source=path], [Pathname to the NSD source]),
[nsdsource=$withval])
AC_SUBST(nsdsource)
AC_ARG_WITH([nsd-modules],
AC_HELP_STRING([--with-nsd-modules=path], [Pathname to the NSD Modules]),
[moddir=$withval])
AC_SUBST(moddir)
AC_CHECK_FILES($nsdsource/dns.h $nsdsource/nsd-plugin.h, ,
echo
echo "Your NSD Source directory does not contain the neccessary headers."
echo "Please ensure you are using the --with-nsd-source=path argument"
echo "and that it refers to a valid unpacked NSD source directory."
exit )
AC_ARG_WITH([nsd-modules-dir],
AC_HELP_STRING([--with-nsd-modules=path], [Pathname to the NSD modules directory]),
[nsdmodules=$withval])
AC_SUBST(nsdmodules)
# Checks for programs.
AC_PROG_CC
AC_PROG_INSTALL
AC_CONFIG_FILES([Makefile])
AC_OUTPUT
-------------- next part --------------
NSD_SOURCE = @nsdsource@
CC = @CC@
INCLUDE = -I. -I${NSD_SOURCE}
CFLAGS = @CFLAGS@ ${INCLUDE} -pedantic
prefix = @prefix@
mandir = @mandir@
moddir = @moddir@
sbinbir = @sbindir@
INSTALL = @INSTALL@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
INSTALL_DATA = @INSTALL_DATA@
ACLC_OBJECTS = aclc_main.o aclc_parser.o aclc_lexer.o nsd_acl_subnet.o
PLUGIN_OBJECTS = nsd_acl_plugin.o nsd_acl.o nsd_acl_subnet.o
all: aclc
aclc: ${ACLC_OBJECTS}
${CC} ${CFLAGS} -o aclc ${ACLC_OBJECTS}
acl-plugin: ${PLUGIN_OBJECTS}
${CC} ${CFLAGS} -shared -o acl-plugin.so ${PLUGIN_OBJECTS}
# generated by 'gcc -MM *.c'
aclc_lexer.o: aclc_lexer.c aclc_parser.h
aclc_main.o: aclc_main.c nsd_acl.h nsd_acl_subnet.h
aclc_parser.o: aclc_parser.c nsd_acl.h nsd_acl_subnet.h
nsd_acl.o: nsd_acl.c nsd_acl.h
nsd_acl_subnet.o: nsd_acl_subnet.c nsd_acl_subnet.h
nsd_acl_plugin.o: nsd_acl_plugin.c nsd_acl.h nsd_acl_subnet.h
install: all
$(INSTALL) -d $(sbindir)
$(INSTALL) -d $(mandir)
$(INSTALL) -d $(moddir)
$(INSTALL) -d $(mandir)/man8
$(INSTALL) aclc $(sbindir)/aclc
$(INSTALL) aclc.8 $(mandir)/man8/aclc.8
$(INSTALL) nsd-acl-plugin.so $(moddir)/nsd-acl-plugin.so
# You'll need flex, not just lex, to generate a decent case-insensitive lexer
#parser:
# flex -l -i -oaclc_lexer.c aclc_lexer.l
# bison -d -oaclc_parser.c -y aclc_parser.y
clean:
rm -f *.o aclc
distclean: clean
rm -rf autom4te.cache config.log config.status Makefile
More information about the nsd-users
mailing list