]> git.ipfire.org Git - thirdparty/ldns.git/commitdiff
add ldns_version function, for returning our internal versioning, orthoginal to libve...
authorMiek Gieben <miekg@NLnetLabs.nl>
Wed, 11 May 2005 10:13:06 +0000 (10:13 +0000)
committerMiek Gieben <miekg@NLnetLabs.nl>
Wed, 11 May 2005 10:13:06 +0000 (10:13 +0000)
configure.ac
ldns/dns.h
ldns/dns.h.in [new file with mode: 0644]
ldns/util.h
mx.c
util.c

index 256a0128b87a54d442f539b435092ad9e027c6bd..c72e25fd8d04124daadd5f4eec08eb9e35434ff1 100644 (file)
@@ -213,7 +213,6 @@ time_t timegm (struct tm *tm);
 ])
 
 
-AC_CONFIG_FILES([Makefile 
-                 ])
+AC_CONFIG_FILES([Makefile ldns/util.h])
 AC_CONFIG_HEADER([ldns/config.h])
 AC_OUTPUT
index a728728a2f792eec13aeb3b36b8c5c109d5705af..bbae1c37e00249dc1ec5a613cbdb3735dcb1bba3 100644 (file)
@@ -38,6 +38,8 @@
 #define LDNS_ROOT_LABEL        '\0'
 #define LDNS_DEFTTL            3600
 
+#define LDNS_VERSION   "0.50"
+
 /* lookup tables for standard DNS stuff  */
 
 /* Taken from RFC 2538, section 2.1.  */
diff --git a/ldns/dns.h.in b/ldns/dns.h.in
new file mode 100644 (file)
index 0000000..a728728
--- /dev/null
@@ -0,0 +1,53 @@
+/*
+ * dns.h -- defines for the Domain Name System
+ *
+ * Copyright (c) 2001-2005, NLnet Labs. All rights reserved.
+ *
+ * See LICENSE for the license.
+ *
+ * A bunch of defines that are used in the DNS
+ */
+
+#ifndef _DNS_H_
+#define _DNS_H_
+
+#include <ldns/config.h>
+#include <ldns/util.h>
+#include <ldns/buffer.h>
+#include <ldns/common.h>
+#include <ldns/dname.h>
+#include <ldns/dnssec.h>
+#include <ldns/error.h>
+#include <ldns/higher.h>
+#include <ldns/host2str.h>
+#include <ldns/host2wire.h>
+#include <ldns/net.h>
+#include <ldns/packet.h>
+#include <ldns/rdata.h>
+#include <ldns/resolver.h>
+#include <ldns/rr.h>
+#include <ldns/str2host.h>
+#include <ldns/wire2host.h>
+#include <ldns/rr_functions.h>
+#include <ldns/keys.h>
+#include <ldns/parse.h>
+
+#define LDNS_IP4ADDRLEN      (32/8)
+#define LDNS_IP6ADDRLEN      (128/8)
+#define LDNS_PORT      53
+#define LDNS_ROOT_LABEL        '\0'
+#define LDNS_DEFTTL            3600
+
+/* lookup tables for standard DNS stuff  */
+
+/* Taken from RFC 2538, section 2.1.  */
+extern ldns_lookup_table ldns_certificate_types[];
+/* Taken from RFC 2535, section 7.  */
+extern ldns_lookup_table ldns_algorithms[];
+/* rr types  */
+extern ldns_lookup_table ldns_rr_classes[];
+/* if these are used elsewhere */
+extern ldns_lookup_table ldns_rcodes[];
+extern ldns_lookup_table ldns_opcodes[];
+
+#endif /* _DNS_H_ */
index ee6d527196c084c307f223ea6e9ba953e806a3f3..f55c35ffea5cc9114b54d4301fd6fb30a91b4160 100644 (file)
@@ -16,6 +16,8 @@
 #define dprintf(X,Y) fprintf(stderr, (X), (Y))
 /* #define     dprintf(X, Y)  */
 
+#define LDNS_VERSION "0.50"
+
 /**
  * splint static inline workaround
  */
@@ -163,4 +165,9 @@ int hexdigit_to_int(char ch);
  */
 char int_to_hexdigit(int ch);
 
+/**
+ *
+ */
+char * ldns_version(void);
+
 #endif /* !_UTIL_H */
diff --git a/mx.c b/mx.c
index 18ae172090f4c5ebc03043d057f476b8002c66ed..2c4a8ed1e60f8a42f22429866f19860866b8761a 100644 (file)
--- a/mx.c
+++ b/mx.c
@@ -34,6 +34,8 @@ main(int argc, char *argv[])
                }
        }
 
+       printf("version %s\n", ldns_version());
+
        /* create a new resolver from /etc/resolv.conf */
        res = ldns_resolver_new_frm_file(NULL);
        if (!res) {
diff --git a/util.c b/util.c
index 3b0f3847db4e2be8381a8d9c962c052a2dd35189..ae66ab4a24aa9c2cee7e04cdf0dd773fe8fa569d 100644 (file)
--- a/util.c
+++ b/util.c
@@ -151,3 +151,9 @@ int_to_hexdigit(int i)
                abort();
        }
 }
+
+char *
+ldns_version(void)
+{
+       return (char*)LDNS_VERSION;
+}