From: Miek Gieben Date: Wed, 8 Mar 2006 16:15:18 +0000 (+0000) Subject: move pcat to its onw directory. Delete this dir when we do a release, also delete... X-Git-Tag: release-1.1.0~308 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=16ebd227e5724ebff1ffcdc9ba18e474ed6a41cb;p=thirdparty%2Fldns.git move pcat to its onw directory. Delete this dir when we do a release, also delete the test dir --- diff --git a/examples/Makefile.in b/examples/Makefile.in index 8e1b5e93..5dd5efdd 100644 --- a/examples/Makefile.in +++ b/examples/Makefile.in @@ -47,8 +47,6 @@ PROGRAMS=$(SOURCES:.c=) all: $(PROGRAMS) -p: pcat pcat-diff pcat-print - ldns-read-zone: ldns-read-zone.o $(LINK) -o $@ $+ @@ -82,15 +80,6 @@ ldns-walk: ldns-walk.o ldns-dpa: ldns-dpa.o $(LINK) -o $@ $+ -pcat: pcat.o - $(LINK) -o $@ $+ - -pcat-diff: pcat-diff.o - $(LINK) -o $@ $+ - -pcat-print: pcat-print.o - $(LINK) -o $@ $+ - ldns-zsplit: ldns-zsplit.o $(LINK) -o $@ $+ diff --git a/makedist.sh b/makedist.sh index bf2ad908..67858650 100755 --- a/makedist.sh +++ b/makedist.sh @@ -156,8 +156,11 @@ if [ -f $tarfile ]; then && rm -f $tarfile) || error_cleanup "User abort." fi -#info "Deleting the test directory" -#rm -rf ldns-$version/test/ +info "Deleting the test directory" +rm -rf ldns-$version/test/ + +info "Deleting the pcat directory" +rm -rf ldns-$version/pcat/ info "Creating tar ldns-$version.tar.gz" tar czf ../ldns-$version.tar.gz ldns-$version || error_cleanup "Failed to create tar file." diff --git a/pcat/Makefile.in b/pcat/Makefile.in new file mode 100644 index 00000000..1a220dc6 --- /dev/null +++ b/pcat/Makefile.in @@ -0,0 +1,49 @@ +# Standard installation pathnames +# See the file LICENSE for the license +SHELL = @SHELL@ +VERSION = @PACKAGE_VERSION@ +basesrcdir = $(shell basename `pwd`) +srcdir = @srcdir@ +prefix = @prefix@ +exec_prefix = @exec_prefix@ +bindir = @bindir@ +mandir = @mandir@ + +CC = @CC@ +CFLAGS = @CFLAGS@ -Wall -I. +CPPFLAGS = @CPPFLAGS@ +LDFLAGS = @LDFLAGS@ +LIBS = @LIBS@ + +INSTALL = $(srcdir)/../install-sh + +COMPILE = $(CC) $(CPPFLAGS) $(CFLAGS) +LINK = $(CC) $(CFLAGS) $(LDFLAGS) $(LIBS) + +HEADER = config.h + +.PHONY: all clean realclean + +all: p + +p: pcat pcat-diff pcat-print + +pcat: pcat.o + $(LINK) -o $@ $+ + +pcat-diff: pcat-diff.o + $(LINK) -o $@ $+ + +pcat-print: pcat-print.o + $(LINK) -o $@ $+ + +clean: + rm -f pcat pcat-diff pcat-print + +realclean: clean + rm -f configure config.h config.log config.status + + +## implicit rule +%.o: $(srcdir)/%.c + $(COMPILE) -c $< diff --git a/pcat/config.h.in b/pcat/config.h.in new file mode 100644 index 00000000..28b3814d --- /dev/null +++ b/pcat/config.h.in @@ -0,0 +1,158 @@ +/* config.h.in. Generated from configure.ac by autoheader. */ + +/* Define to 1 if you have the header file. */ +#undef HAVE_ARPA_INET_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_ASSERT_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_GETOPT_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_INTTYPES_H + +/* Define to 1 if you have the `isblank' function. */ +#undef HAVE_ISBLANK + +/* Define to 1 if you have the `ldns' library (-lldns). */ +#undef HAVE_LIBLDNS + +/* Define to 1 if you have the `pcap' library (-lpcap). */ +#undef HAVE_LIBPCAP + +/* Define to 1 if you have the header file. */ +#undef HAVE_MEMORY_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_NETINET_IF_ETHER_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_NETINET_IN_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_NETINET_IN_HCTYPE_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_NETINET_IP_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_NETINET_UDP_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_PCAP_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_STDINT_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_STDIO_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_STDLIB_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_STRINGS_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_STRING_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_SYS_MOUNT_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_SYS_PARAM_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_SYS_SOCKET_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_SYS_STAT_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_SYS_TIME_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_SYS_TYPES_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_TIME_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_UNISTD_H + +/* Define to the address where bug reports for this package should be sent. */ +#undef PACKAGE_BUGREPORT + +/* Define to the full name of this package. */ +#undef PACKAGE_NAME + +/* Define to the full name and version of this package. */ +#undef PACKAGE_STRING + +/* Define to the one symbol short name of this package. */ +#undef PACKAGE_TARNAME + +/* Define to the version of this package. */ +#undef PACKAGE_VERSION + +/* Define to 1 if you have the ANSI C header files. */ +#undef STDC_HEADERS + +/* Define to 1 if on AIX 3. + System headers sometimes define this. + We just want to avoid a redefinition error message. */ +#ifndef _ALL_SOURCE +# undef _ALL_SOURCE +#endif + + + +#include +#include +#include +#include + +#if STDC_HEADERS +#include +#include +#endif + +#ifdef HAVE_STDINT_H +#include +#endif + +#ifdef HAVE_SYS_SOCKET_H +#include +#endif + +#ifdef HAVE_NETINET_IN_H +#include +#endif + +#ifdef HAVE_ARPA_INET_H +#include +#endif + +#ifdef HAVE_NETINET_UDP_H +#include +#endif + +#ifdef HAVE_TIME_H +#include +#endif + +#ifdef HAVE_PCAP_H +#include +#endif + +#include + +#ifdef HAVE_NETINET_IP_H +#include +#endif + +#ifdef HAVE_NETINET_IF_ETHER_H +#include +#endif + diff --git a/pcat/configure.ac b/pcat/configure.ac new file mode 100644 index 00000000..75dfb194 --- /dev/null +++ b/pcat/configure.ac @@ -0,0 +1,107 @@ +# -*- Autoconf -*- +# Process this file with autoconf to produce a configure script. + +AC_PREREQ(2.57) +AC_INIT(pcat, 1.1.0, miek@miek.nl,pcat) +AC_CONFIG_SRCDIR([pcat.c]) + +AC_AIX +# Checks for programs. +AC_PROG_CC +AC_PROG_MAKE_SET + +AC_CHECK_HEADERS([sys/types.h getopt.h stdlib.h stdio.h assert.h netinet/in.hctype.h netinet/udp.h time.h pcap.h arpa/inet.h sys/time.h sys/socket.h],,, [AC_INCLUDES_DEFAULT]) +AC_CHECK_HEADERS([netinet/in.h netinet/ip.h netinet/if_ether.h]) + +AC_CHECK_HEADERS([sys/param.h sys/mount.h],,, +[AC_INCLUDES_DEFAULT] +[ + [ + #if HAVE_SYS_PARAM_H + # include + #endif + ] +]) + +# check for ldns +AC_ARG_WITH(ldns, + AC_HELP_STRING([--with-ldns=PATH specify prefix of path of ldns library to use]) + , + [ + specialldnsdir="$withval" + CPPFLAGS="$CPPFLAGS -I$withval/include" + LDFLAGS="$LDFLAGS -L$withval/lib" + ] +) + +AC_CHECK_LIB(ldns, ldns_rr_new,, [ + AC_MSG_ERROR([Can't find ldns library]) + ] +) + +AC_CHECK_HEADER(ldns/dns.h,, [ + AC_MSG_ERROR([Can't find ldns headers]) + ], [AC_INCLUDES_DEFAULT] +) + +AC_CHECK_LIB(pcap, pcap_open_offline,, [ + AC_MSG_WARN([Can't find pcap library (needed for ldns-dpa, will not build dpa now.)]) + ] +) + +AC_CHECK_FUNCS(isblank) + +AH_BOTTOM([ + +#include +#include +#include +#include + +#if STDC_HEADERS +#include +#include +#endif + +#ifdef HAVE_STDINT_H +#include +#endif + +#ifdef HAVE_SYS_SOCKET_H +#include +#endif + +#ifdef HAVE_NETINET_IN_H +#include +#endif + +#ifdef HAVE_ARPA_INET_H +#include +#endif + +#ifdef HAVE_NETINET_UDP_H +#include +#endif + +#ifdef HAVE_TIME_H +#include +#endif + +#ifdef HAVE_PCAP_H +#include +#endif + +#include + +#ifdef HAVE_NETINET_IP_H +#include +#endif + +#ifdef HAVE_NETINET_IF_ETHER_H +#include +#endif +]) + +AC_CONFIG_FILES([Makefile]) +AC_CONFIG_HEADER([config.h]) +AC_OUTPUT diff --git a/examples/pcat-diff.c b/pcat/pcat-diff.c similarity index 100% rename from examples/pcat-diff.c rename to pcat/pcat-diff.c diff --git a/examples/pcat-print.c b/pcat/pcat-print.c similarity index 100% rename from examples/pcat-print.c rename to pcat/pcat-print.c diff --git a/examples/pcat.c b/pcat/pcat.c similarity index 100% rename from examples/pcat.c rename to pcat/pcat.c diff --git a/tsig.c b/tsig.c index ce107d68..44236088 100644 --- a/tsig.c +++ b/tsig.c @@ -208,7 +208,7 @@ ldns_tsig_mac_new( digester = ldns_digest_function(algorithm_name); if (digester) { - (void) HMAC(digester, key_bytes, key_size, (void *)wireformat, (size_t)wiresize, mac_bytes + 2, &md_len); + (void) HMAC(digester, key_bytes, key_size, (void *)wireformat, wiresize, mac_bytes + 2, &md_len); ldns_write_uint16(mac_bytes, md_len); result = ldns_rdf_new_frm_data(LDNS_RDF_TYPE_INT16_DATA, md_len + 2, mac_bytes);