]> git.ipfire.org Git - thirdparty/ldns.git/commitdiff
move pcat to its onw directory. Delete this dir when we do a release, also delete...
authorMiek Gieben <miekg@NLnetLabs.nl>
Wed, 8 Mar 2006 16:15:18 +0000 (16:15 +0000)
committerMiek Gieben <miekg@NLnetLabs.nl>
Wed, 8 Mar 2006 16:15:18 +0000 (16:15 +0000)
examples/Makefile.in
makedist.sh
pcat/Makefile.in [new file with mode: 0644]
pcat/config.h.in [new file with mode: 0644]
pcat/configure.ac [new file with mode: 0644]
pcat/pcat-diff.c [moved from examples/pcat-diff.c with 100% similarity]
pcat/pcat-print.c [moved from examples/pcat-print.c with 100% similarity]
pcat/pcat.c [moved from examples/pcat.c with 100% similarity]
tsig.c

index 8e1b5e937a824f19ff5fbf543fa1fff3efe05e08..5dd5efdd4366449fc4dc3675230f81245d8b4b3e 100644 (file)
@@ -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 $@ $+
 
index bf2ad908d78feffaeb0f4101488ed89b698364c1..67858650a5e83f263c5d7c50bd7dd92c82634630 100755 (executable)
@@ -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 (file)
index 0000000..1a220dc
--- /dev/null
@@ -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 (file)
index 0000000..28b3814
--- /dev/null
@@ -0,0 +1,158 @@
+/* config.h.in.  Generated from configure.ac by autoheader.  */
+
+/* Define to 1 if you have the <arpa/inet.h> header file. */
+#undef HAVE_ARPA_INET_H
+
+/* Define to 1 if you have the <assert.h> header file. */
+#undef HAVE_ASSERT_H
+
+/* Define to 1 if you have the <getopt.h> header file. */
+#undef HAVE_GETOPT_H
+
+/* Define to 1 if you have the <inttypes.h> 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 <memory.h> header file. */
+#undef HAVE_MEMORY_H
+
+/* Define to 1 if you have the <netinet/if_ether.h> header file. */
+#undef HAVE_NETINET_IF_ETHER_H
+
+/* Define to 1 if you have the <netinet/in.h> header file. */
+#undef HAVE_NETINET_IN_H
+
+/* Define to 1 if you have the <netinet/in.hctype.h> header file. */
+#undef HAVE_NETINET_IN_HCTYPE_H
+
+/* Define to 1 if you have the <netinet/ip.h> header file. */
+#undef HAVE_NETINET_IP_H
+
+/* Define to 1 if you have the <netinet/udp.h> header file. */
+#undef HAVE_NETINET_UDP_H
+
+/* Define to 1 if you have the <pcap.h> header file. */
+#undef HAVE_PCAP_H
+
+/* Define to 1 if you have the <stdint.h> header file. */
+#undef HAVE_STDINT_H
+
+/* Define to 1 if you have the <stdio.h> header file. */
+#undef HAVE_STDIO_H
+
+/* Define to 1 if you have the <stdlib.h> header file. */
+#undef HAVE_STDLIB_H
+
+/* Define to 1 if you have the <strings.h> header file. */
+#undef HAVE_STRINGS_H
+
+/* Define to 1 if you have the <string.h> header file. */
+#undef HAVE_STRING_H
+
+/* Define to 1 if you have the <sys/mount.h> header file. */
+#undef HAVE_SYS_MOUNT_H
+
+/* Define to 1 if you have the <sys/param.h> header file. */
+#undef HAVE_SYS_PARAM_H
+
+/* Define to 1 if you have the <sys/socket.h> header file. */
+#undef HAVE_SYS_SOCKET_H
+
+/* Define to 1 if you have the <sys/stat.h> header file. */
+#undef HAVE_SYS_STAT_H
+
+/* Define to 1 if you have the <sys/time.h> header file. */
+#undef HAVE_SYS_TIME_H
+
+/* Define to 1 if you have the <sys/types.h> header file. */
+#undef HAVE_SYS_TYPES_H
+
+/* Define to 1 if you have the <time.h> header file. */
+#undef HAVE_TIME_H
+
+/* Define to 1 if you have the <unistd.h> 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 <stdio.h>
+#include <string.h>
+#include <unistd.h>
+#include <assert.h>
+
+#if STDC_HEADERS
+#include <stdlib.h>
+#include <stddef.h>
+#endif
+
+#ifdef HAVE_STDINT_H
+#include <stdint.h>
+#endif
+
+#ifdef HAVE_SYS_SOCKET_H
+#include <sys/socket.h>
+#endif
+
+#ifdef HAVE_NETINET_IN_H
+#include <netinet/in.h>
+#endif
+
+#ifdef HAVE_ARPA_INET_H
+#include <arpa/inet.h>
+#endif
+
+#ifdef HAVE_NETINET_UDP_H
+#include <netinet/udp.h>
+#endif
+
+#ifdef HAVE_TIME_H
+#include <time.h>
+#endif
+
+#ifdef HAVE_PCAP_H
+#include <pcap.h>
+#endif
+
+#include <netinet/in_systm.h>  
+
+#ifdef HAVE_NETINET_IP_H
+#include <netinet/ip.h>
+#endif
+
+#ifdef HAVE_NETINET_IF_ETHER_H
+#include <netinet/if_ether.h>
+#endif
+
diff --git a/pcat/configure.ac b/pcat/configure.ac
new file mode 100644 (file)
index 0000000..75dfb19
--- /dev/null
@@ -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 <sys/param.h>
+   #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 <stdio.h>
+#include <string.h>
+#include <unistd.h>
+#include <assert.h>
+
+#if STDC_HEADERS
+#include <stdlib.h>
+#include <stddef.h>
+#endif
+
+#ifdef HAVE_STDINT_H
+#include <stdint.h>
+#endif
+
+#ifdef HAVE_SYS_SOCKET_H
+#include <sys/socket.h>
+#endif
+
+#ifdef HAVE_NETINET_IN_H
+#include <netinet/in.h>
+#endif
+
+#ifdef HAVE_ARPA_INET_H
+#include <arpa/inet.h>
+#endif
+
+#ifdef HAVE_NETINET_UDP_H
+#include <netinet/udp.h>
+#endif
+
+#ifdef HAVE_TIME_H
+#include <time.h>
+#endif
+
+#ifdef HAVE_PCAP_H
+#include <pcap.h>
+#endif
+
+#include <netinet/in_systm.h>  
+
+#ifdef HAVE_NETINET_IP_H
+#include <netinet/ip.h>
+#endif
+
+#ifdef HAVE_NETINET_IF_ETHER_H
+#include <netinet/if_ether.h>
+#endif
+])
+
+AC_CONFIG_FILES([Makefile])
+AC_CONFIG_HEADER([config.h])
+AC_OUTPUT
similarity index 100%
rename from examples/pcat-diff.c
rename to pcat/pcat-diff.c
similarity index 100%
rename from examples/pcat-print.c
rename to pcat/pcat-print.c
similarity index 100%
rename from examples/pcat.c
rename to pcat/pcat.c
diff --git a/tsig.c b/tsig.c
index ce107d68fd2d567eee59109348b5b72d23ec5c49..442360885dfb57a50158513aa2f9eb17ac74796d 100644 (file)
--- 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);