Commit Diff
Diff:
3206c3fb5568215c214704ec30feb687755bb18a
3fffb5bdfec545f1fb49336267df9688cf07f099
Commit:
3fffb5bdfec545f1fb49336267df9688cf07f099
Tree:
b916df21c6047fb33aac0b620d1062d0d3c7ea0c
Author:
pjp <pjp@delphinusdns.org>
Committer:
pjp <pjp@delphinusdns.org>
Date:
Tue Jan 3 08:36:38 2017 UTC
Message:
Add versionstrings to ddd-config.h via configure for both delphinusdnsd and dd-convert.c, both are at version 1.1.0-alpha
blob - 2f492e47aeae7fe4e8cf1674e1f7a003031f3282
blob + ef7cd4bf4ce3ee93340e0bbb3df97f5538e5c557
--- configure
+++ configure
@@ -1,6 +1,10 @@
#!/bin/sh
+VERSION="1.1.0-alpha"
+DD_VERSION="delphinusdnsd-$VERSION"
+DD_VERSION_LEN=`echo -n $DD_VERSION | wc -c`
+
echo "/* ddd-config.h - autogenerated by configure */" > ddd-config.h
until [ -z $1 ]
@@ -17,6 +21,10 @@ do
esac
shift
done
+
+echo "#define DD_CONVERT_VERSION \"dd-convert $VERSION\"" >> ddd-config.h
+echo "#define DD_VERSION \"$DD_VERSION\"" >> ddd-config.h
+echo "#define DD_VERSION_LEN $DD_VERSION_LEN" >> ddd-config.h
openbsd() {
echo configuring for OpenBSD
blob - 25a783a343cc58586670bb16302ed6df8eb74625
blob + 668c5ba9cc8c4af5ea268c85f8aedb64389c3bff
--- dd-convert.8
+++ dd-convert.8
@@ -43,6 +43,7 @@
.Op Fl o Ar outputfile
.Op Fl s Ar salt
.Op Fl t Ar ttl
+.Op Fl v
.Op Fl z Ar ZSKfile
.Op Fl Z
.Sh DESCRIPTION
@@ -122,6 +123,11 @@ same as anything that requires salt. The input is in
.Fl t
.Ar ttl
is the time to live for created DNSKEY resource records. Default is 3600.
+.It Xo
+.Fl v
+prints the version of
+.Nm
+and exits.
.It Xo
.Fl z
.Ar ZSKfile
blob - 4ebc8b0efcfba69b426a90d7b3b364711b11912e
blob + 57e7104413ba949f23cb86e7b2712873f468fb08
--- dd-convert.c
+++ dd-convert.c
@@ -28,6 +28,7 @@
#include "ddd-include.h"
#include "ddd-dns.h"
#include "ddd-db.h"
+#include "ddd-config.h"
#include <openssl/bn.h>
#include <openssl/obj_mac.h>
@@ -164,7 +165,7 @@ main(int argc, char *argv[])
DB_ENV *dbenv;
- while ((ch = getopt(argc, argv, "a:B:e:hI:i:Kk:n:o:s:t:Zz:")) != -1) {
+ while ((ch = getopt(argc, argv, "a:B:e:hI:i:Kk:n:o:s:t:vZz:")) != -1) {
switch (ch) {
case 'a':
/* algorithm */
@@ -238,6 +239,12 @@ main(int argc, char *argv[])
ttl = atoi(optarg);
break;
+
+ case 'v':
+ /* version */
+
+ printf("%s\n", DD_CONVERT_VERSION);
+ exit(0);
case 'Z':
/* create ZSK */
blob - 3730df380f43bf3df37bc40ebb241fbda42c6263
blob + 0bf965fdce478fa41125731fe383c3b8e2bccb05
--- delphinusdnsd.c
+++ delphinusdnsd.c
@@ -139,8 +139,13 @@ u_int16_t port = 53;
u_int32_t cachesize = 0;
char *bind_list[255];
char *interface_list[255];
+#ifndef DD_VERSION
char *versionstring = "delphinusdnsd -current";
uint8_t vslen = 22;
+#else
+char *versionstring = DD_VERSION;
+uint8_t vslen = DD_VERSION_LEN;
+#endif
int *ptr = NULL;
/* singly linked list for tcp operations */
@@ -161,7 +166,7 @@ static struct tcps {
} *tn1, *tnp, *tntmp;
-static const char rcsid[] = "$Id: delphinusdnsd.c,v 1.6 2017/01/02 18:18:27 pjp Exp $";
+static const char rcsid[] = "$Id: delphinusdnsd.c,v 1.7 2017/01/03 08:36:38 pjp Exp $";
/*
* MAIN - set up arguments, set up database, set up sockets, call mainloop
repomaster@centroid.eu