From: Miek Gieben Date: Wed, 11 May 2005 10:13:06 +0000 (+0000) Subject: add ldns_version function, for returning our internal versioning, orthoginal to libve... X-Git-Tag: release-0.50^2~6 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=98e48def4d971c41dcd8587101320b3a95d293a2;p=thirdparty%2Fldns.git add ldns_version function, for returning our internal versioning, orthoginal to libversioning from libtool --- diff --git a/configure.ac b/configure.ac index 256a0128..c72e25fd 100644 --- a/configure.ac +++ b/configure.ac @@ -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 diff --git a/ldns/dns.h b/ldns/dns.h index a728728a..bbae1c37 100644 --- a/ldns/dns.h +++ b/ldns/dns.h @@ -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 index 00000000..a728728a --- /dev/null +++ b/ldns/dns.h.in @@ -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 +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#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_ */ diff --git a/ldns/util.h b/ldns/util.h index ee6d5271..f55c35ff 100644 --- a/ldns/util.h +++ b/ldns/util.h @@ -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 18ae1720..2c4a8ed1 100644 --- 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 3b0f3847..ae66ab4a 100644 --- a/util.c +++ b/util.c @@ -151,3 +151,9 @@ int_to_hexdigit(int i) abort(); } } + +char * +ldns_version(void) +{ + return (char*)LDNS_VERSION; +}