From c183a39ca7922da98c6bc832c22607c4dbc8357f Mon Sep 17 00:00:00 2001 From: tobhe Date: Mon, 29 Nov 2021 12:27:18 +0000 Subject: [PATCH] Add command line option to show the version ok patrick@ --- sbin/iked/iked.8 | 8 +++++--- sbin/iked/iked.c | 8 ++++++-- sbin/iked/version.h | 3 +++ 3 files changed, 14 insertions(+), 5 deletions(-) create mode 100644 sbin/iked/version.h diff --git a/sbin/iked/iked.8 b/sbin/iked/iked.8 index 87b24966767..faa7cfda78c 100644 --- a/sbin/iked/iked.8 +++ b/sbin/iked/iked.8 @@ -1,4 +1,4 @@ -.\" $OpenBSD: iked.8,v 1.28 2020/11/20 13:03:00 jmc Exp $ +.\" $OpenBSD: iked.8,v 1.29 2021/11/29 12:27:18 tobhe Exp $ .\" .\" Copyright (c) 2010 - 2014 Reyk Floeter .\" @@ -14,7 +14,7 @@ .\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF .\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. .\" -.Dd $Mdocdate: November 20 2020 $ +.Dd $Mdocdate: November 29 2021 $ .Dt IKED 8 .Os .Sh NAME @@ -22,7 +22,7 @@ .Nd Internet Key Exchange version 2 (IKEv2) daemon .Sh SYNOPSIS .Nm iked -.Op Fl dnSTtv +.Op Fl dnSTtvV .Op Fl D Ar macro Ns = Ns Ar value .Op Fl f Ar file .Op Fl p Ar udpencap_port @@ -109,6 +109,8 @@ This option is only recommended for testing; the default is to negotiate NAT-Traversal with the peers. .It Fl v Produce more verbose output. +.It Fl V +Show the version and exit. .El .Sh PUBLIC KEY AUTHENTICATION It is possible to store trusted public keys to make them directly diff --git a/sbin/iked/iked.c b/sbin/iked/iked.c index fa7fd3d5c6a..b08101533c5 100644 --- a/sbin/iked/iked.c +++ b/sbin/iked/iked.c @@ -1,4 +1,4 @@ -/* $OpenBSD: iked.c,v 1.59 2021/11/25 18:28:51 tobhe Exp $ */ +/* $OpenBSD: iked.c,v 1.60 2021/11/29 12:27:18 tobhe Exp $ */ /* * Copyright (c) 2019 Tobias Heider @@ -36,6 +36,7 @@ #include "iked.h" #include "ikev2.h" +#include "version.h" __dead void usage(void); @@ -78,7 +79,7 @@ main(int argc, char *argv[]) log_init(1, LOG_DAEMON); - while ((c = getopt(argc, argv, "6D:df:np:Ss:Ttv")) != -1) { + while ((c = getopt(argc, argv, "6D:df:np:Ss:TtvV")) != -1) { switch (c) { case '6': log_warnx("the -6 option is ignored and will be " @@ -127,6 +128,9 @@ main(int argc, char *argv[]) verbose++; opts |= IKED_OPT_VERBOSE; break; + case 'V': + fprintf(stderr, "OpenIKED %s\n", IKED_VERSION); + return 0; default: usage(); } diff --git a/sbin/iked/version.h b/sbin/iked/version.h new file mode 100644 index 00000000000..e242ba49691 --- /dev/null +++ b/sbin/iked/version.h @@ -0,0 +1,3 @@ +/* $OpenBSD: version.h,v 1.1 2021/11/29 12:27:18 tobhe Exp $ */ + +#define IKED_VERSION "7.0" -- 2.20.1