Print the program help.
.TP
\fB\-V\fP, \fB\-\-version\fP
-Print the program version.
+Print the program version. The option \fB\-VV\fP makes the program
+print the compile time configuration summary.
.UNINDENT
.SH EXIT VALUES
.sp
An explicit \fIquery_type\fP specification. See possible values above.
.TP
\fB\-V\fP, \fB\-\-version\fP
-Print the program version.
+Print the program version. The option \fB\-VV\fP makes the program
+print the compile time configuration summary.
.TP
\fB\-x\fP \fIaddress\fP
Send a reverse (PTR) query for IPv4 or IPv6 \fIaddress\fP\&. The correct name, class
Print the program help.
.TP
\fB\-V\fP, \fB\-\-version\fP
-Print the program version.
+Print the program version. The option \fB\-VV\fP makes the program
+print the compile time configuration summary.
.UNINDENT
.sp
\fBNOTE:\fP
Enable verbose output.
.TP
\fB\-V\fP, \fB\-\-version\fP
-Print the program version.
+Print the program version. The option \fB\-VV\fP makes the program
+print the compile time configuration summary.
.TP
\fB\-w\fP
Wait forever for the reply.
Print the program help.
.TP
\fB\-V\fP, \fB\-\-version\fP
-Print the program version.
+Print the program version. The option \fB\-VV\fP makes the program
+print the compile time configuration summary.
.UNINDENT
.SH EXIT VALUES
.sp
Print the program help.
.TP
\fB\-V\fP, \fB\-\-version\fP
-Print the program version.
+Print the program version. The option \fB\-VV\fP makes the program
+print the compile time configuration summary.
.UNINDENT
.SS Actions
.INDENT 0.0
Print the program help.
.TP
\fB\-V\fP, \fB\-\-version\fP
-Print the program version.
+Print the program version. The option \fB\-VV\fP makes the program
+print the compile time configuration summary.
.UNINDENT
.SS Signals
.sp
\fBknsec3hash\fP \fIsalt\fP \fIalgorithm\fP \fIiterations\fP \fIname\fP
.sp
\fBknsec3hash\fP \fIalgorithm\fP \fIflags\fP \fIiterations\fP \fIsalt\fP \fIname\fP
+.sp
+\fBknsec3hash\fP [\fI\-h\fP] [\fI\-V\fP]
.SH DESCRIPTION
.sp
This utility generates a NSEC3 hash for a given domain name and parameters of NSEC3 hash.
\fIflags\fP
Specifies NSEC3 flags as an unsigned integer.
.UNINDENT
+.SS Options
+.INDENT 0.0
+.TP
+\fB\-h\fP, \fB\-\-help\fP
+Print the program help.
+.TP
+\fB\-V\fP, \fB\-\-version\fP
+Print the program version. The option \fB\-VV\fP makes the program
+print the compile time configuration summary.
+.UNINDENT
.SH EXIT VALUES
.sp
Exit status of 0 means successful operation. Any other exit status indicates
Use a TCP connection.
.TP
\fB\-V\fP, \fB\-\-version\fP
-Print the program version.
+Print the program version. The option \fB\-VV\fP makes the program
+print the compile time configuration summary.
.TP
\fB\-y\fP [\fIalg\fP:]\fIname\fP:\fIkey\fP
Use the TSIG key with a name \fIname\fP to authenticate the request. The \fIalg\fP
Print the program help.
.TP
\fB\-V\fP, \fB\-\-version\fP
-Print the program version.
+Print the program version. The option \fB\-VV\fP makes the program
+print the compile time configuration summary.
.UNINDENT
.SS Queries file format
.sp
Print the program help.
.TP
\fB\-V\fP, \fB\-\-version\fP
-Print the program version.
+Print the program version. The option \fB\-VV\fP makes the program
+print the compile time configuration summary.
.UNINDENT
.SH EXIT VALUES
.sp
Print the program help.
.TP
\fB\-V\fP, \fB\-\-version\fP
-Print the program version.
+Print the program version. The option \fB\-VV\fP makes the program
+print the compile time configuration summary.
.UNINDENT
.SH EXIT VALUES
.sp
Print the program help.
**-V**, **--version**
- Print the program version.
+ Print the program version. The option **-VV** makes the program
+ print the compile time configuration summary.
Exit values
-----------
An explicit *query_type* specification. See possible values above.
**-V**, **--version**
- Print the program version.
+ Print the program version. The option **-VV** makes the program
+ print the compile time configuration summary.
**-x** *address*
Send a reverse (PTR) query for IPv4 or IPv6 *address*. The correct name, class
Print the program help.
**-V**, **--version**
- Print the program version.
+ Print the program version. The option **-VV** makes the program
+ print the compile time configuration summary.
.. NOTE::
Keymgr runs with the same user privileges as configured for :doc:`knotd<man_knotd>`.
Enable verbose output.
**-V**, **--version**
- Print the program version.
+ Print the program version. The option **-VV** makes the program
+ print the compile time configuration summary.
**-w**
Wait forever for the reply.
Print the program help.
**-V**, **--version**
- Print the program version.
+ Print the program version. The option **-VV** makes the program
+ print the compile time configuration summary.
Exit values
-----------
Print the program help.
**-V**, **--version**
- Print the program version.
+ Print the program version. The option **-VV** makes the program
+ print the compile time configuration summary.
Actions
.......
Print the program help.
**-V**, **--version**
- Print the program version.
+ Print the program version. The option **-VV** makes the program
+ print the compile time configuration summary.
Signals
.......
:program:`knsec3hash` *algorithm* *flags* *iterations* *salt* *name*
+:program:`knsec3hash` [*-h*] [*-V*]
+
Description
-----------
*flags*
Specifies NSEC3 flags as an unsigned integer.
+Options
+.......
+
+**-h**, **--help**
+ Print the program help.
+
+**-V**, **--version**
+ Print the program version. The option **-VV** makes the program
+ print the compile time configuration summary.
+
Exit values
-----------
Use a TCP connection.
**-V**, **--version**
- Print the program version.
+ Print the program version. The option **-VV** makes the program
+ print the compile time configuration summary.
**-y** [*alg*:]\ *name*:*key*
Use the TSIG key with a name *name* to authenticate the request. The *alg*
Print the program help.
**-V**, **--version**
- Print the program version.
+ Print the program version. The option **-VV** makes the program
+ print the compile time configuration summary.
Queries file format
...................
Print the program help.
**-V**, **--version**
- Print the program version.
+ Print the program version. The option **-VV** makes the program
+ print the compile time configuration summary.
Exit values
-----------
Print the program help.
**-V**, **--version**
- Print the program version.
+ Print the program version. The option **-VV** makes the program
+ print the compile time configuration summary.
Exit values
-----------
-/* Copyright (C) 2021 CZ.NIC, z.s.p.o. <knot-dns@labs.nic.cz>
+/* Copyright (C) 2023 CZ.NIC, z.s.p.o. <knot-dns@labs.nic.cz>
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
#include "contrib/ctype.h"
#include "contrib/tolower.h"
+const char *configure_summary = CONFIGURE_SUMMARY;
+
uint8_t *memdup(const uint8_t *data, size_t data_size)
{
uint8_t *result = (uint8_t *)malloc(data_size);
-/* Copyright (C) 2022 CZ.NIC, z.s.p.o. <knot-dns@labs.nic.cz>
+/* Copyright (C) 2023 CZ.NIC, z.s.p.o. <knot-dns@labs.nic.cz>
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
#include <stddef.h>
#include <stdint.h>
+extern const char *configure_summary;
+
/*!
* \brief Create a copy of a binary buffer.
*
conf()->cache.srv_xdp_threads, conf()->cache.srv_bg_threads,
running_bkg_wrk, wrk_queue);
} else if (strcasecmp(type, "configure") == 0) {
- ret = snprintf(buff, sizeof(buff), "%s", CONFIGURE_SUMMARY);
+ ret = snprintf(buff, sizeof(buff), "%s", configure_summary);
} else if (strcasecmp(type, "cert-key") == 0) {
uint8_t pin[128];
size_t pin_len = server_cert_pin(args->server, pin, sizeof(pin));
#include <stdio.h>
#include "libknot/libknot.h"
+#include "contrib/string.h"
#include "contrib/ucw/lists.h"
#define DEFAULT_IPV4_NAME "127.0.0.1"
param_handle_f handler;
} param_t;
-inline static void print_version(const char *program_name)
+inline static void print_version(const char *prog_name, bool verbose)
{
- printf("%s (Knot DNS), version %s\n", program_name, PACKAGE_VERSION);
+ if (prog_name != NULL) {
+ printf("%s, ", prog_name);
+ }
+ printf("Knot DNS %s\n", PACKAGE_VERSION);
+ if (verbose) {
+ printf("\n%s\n", configure_summary);
+ }
}
/*!
{ "catalog", required_argument, NULL, 'a' },
{ "member", required_argument, NULL, 'm' },
{ "help", no_argument, NULL, 'h' },
- { "version", no_argument, NULL, 'V' },
+ { "version", optional_argument, NULL, 'V' },
{ NULL }
};
signal_init_std();
int opt = 0;
- while ((opt = getopt_long(argc, argv, "c:C:D:a:m:hV", opts, NULL)) != -1) {
+ while ((opt = getopt_long(argc, argv, "c:C:D:a:m:hV::", opts, NULL)) != -1) {
switch (opt) {
case 'c':
if (util_conf_init_file(optarg) != KNOT_EOK) {
print_help();
goto success;
case 'V':
- print_version(PROGRAM_NAME);
+ print_version(PROGRAM_NAME, optarg != NULL);
goto success;
default:
print_help();
*index += add;
break;
case 'V':
- if (len > 1) {
- ERR("invalid option -%s", opt);
- return KNOT_ENOTSUP;
- }
-
- print_version(PROGRAM_NAME);
+ print_version(PROGRAM_NAME, len > 1);
params->stop = true;
break;
case 'x':
if (strcmp(opt, "-help") == 0) {
print_help();
params->stop = true;
- } else if (strcmp(opt, "-version") == 0) {
- print_version(PROGRAM_NAME);
+ } else if (strncmp(opt, "-version", 8) == 0) {
+ print_version(PROGRAM_NAME, strlen(opt) > 9);
params->stop = true;
} else {
ERR("invalid option: -%s", opt);
{ "mono", no_argument, NULL, 'x' },
{ "color", no_argument, NULL, 'X' },
{ "help", no_argument, NULL, 'h' },
- { "version", no_argument, NULL, 'V' },
+ { "version", optional_argument, NULL, 'V' },
{ "json", no_argument, NULL, 'j' },
{ NULL }
};
list_params.color = isatty(STDOUT_FILENO);
int opt = 0, parm = 0;
- while ((opt = getopt_long(argc, argv, "c:C:D:t:ejlbxXhV", opts, NULL)) != -1) {
+ while ((opt = getopt_long(argc, argv, "c:C:D:t:ejlbxXhV::", opts, NULL)) != -1) {
switch (opt) {
case 'c':
if (util_conf_init_file(optarg) != KNOT_EOK) {
print_help();
goto success;
case 'V':
- print_version(PROGRAM_NAME);
+ print_version(PROGRAM_NAME, optarg != NULL);
goto success;
default:
print_help();
-/* Copyright (C) 2022 CZ.NIC, z.s.p.o. <knot-dns@labs.nic.cz>
+/* Copyright (C) 2023 CZ.NIC, z.s.p.o. <knot-dns@labs.nic.cz>
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
// Long options.
struct option opts[] = {
- { "help", no_argument, NULL, 'h' },
- { "version", no_argument, NULL, 'V' },
+ { "help", no_argument, NULL, 'h' },
+ { "version", optional_argument, NULL, 'V' },
{ NULL }
};
// Command line options processing.
int opt = 0;
- while ((opt = getopt_long(argc, argv, "46adhrsTvVwc:t:R:W:", opts, NULL))
+ while ((opt = getopt_long(argc, argv, "46adhrsTvV::wc:t:R:W:", opts, NULL))
!= -1) {
switch (opt) {
case '4':
conf->style.show_footer = true;
break;
case 'V':
- print_version(PROGRAM_NAME);
+ print_version(PROGRAM_NAME, optarg != NULL);
params->stop = false;
return KNOT_EOK;
case 'w':
{ "mono", no_argument, NULL, 'x' },
{ "color", no_argument, NULL, 'X' },
{ "help", no_argument, NULL, 'h' },
- { "version", no_argument, NULL, 'V' },
+ { "version", optional_argument, NULL, 'V' },
{ NULL }
};
signal_init_std();
int opt = 0;
- while ((opt = getopt_long(argc, argv, "c:C:D:l:s:zHdnxXhV", opts, NULL)) != -1) {
+ while ((opt = getopt_long(argc, argv, "c:C:D:l:s:zHdnxXhV::", opts, NULL)) != -1) {
switch (opt) {
case 'c':
if (util_conf_init_file(optarg) != KNOT_EOK) {
print_help();
goto success;
case 'V':
- print_version(PROGRAM_NAME);
+ print_version(PROGRAM_NAME, optarg != NULL);
goto success;
default:
print_help();
{ "color", no_argument, NULL, 'X' },
{ "verbose", no_argument, NULL, 'v' },
{ "help", no_argument, NULL, 'h' },
- { "version", no_argument, NULL, 'V' },
+ { "version", optional_argument, NULL, 'V' },
{ NULL }
};
/* Parse command line arguments */
int opt = 0;
- while ((opt = getopt_long(argc, argv, "+c:C:m:s:t:befxXvhV", opts, NULL)) != -1) {
+ while ((opt = getopt_long(argc, argv, "+c:C:m:s:t:befxXvhV::", opts, NULL)) != -1) {
switch (opt) {
case 'c':
params.orig_config = optarg;
print_help();
return EXIT_SUCCESS;
case 'V':
- print_version(PROGRAM_NAME);
+ print_version(PROGRAM_NAME, optarg != NULL);
return EXIT_SUCCESS;
default:
print_help();
#include "knot/common/systemd.h"
#include "knot/server/server.h"
#include "knot/server/tcp-handler.h"
+#include "utils/common/params.h"
#define PROGRAM_NAME "knotd"
CONF_MAPSIZE, RUN_DIR "/knot.sock");
}
-static void print_version(void)
-{
- printf("%s (Knot DNS), version %s\n", PROGRAM_NAME, PACKAGE_VERSION);
-}
-
static int set_config(const char *confdb, const char *config, size_t max_conf_size)
{
if (config != NULL && confdb != NULL) {
{ "daemonize", optional_argument, NULL, 'd' },
{ "verbose", no_argument, NULL, 'v' },
{ "help", no_argument, NULL, 'h' },
- { "version", no_argument, NULL, 'V' },
+ { "version", optional_argument, NULL, 'V' },
{ NULL }
};
/* Parse command line arguments. */
int opt = 0;
- while ((opt = getopt_long(argc, argv, "c:C:m:s:dvhV", opts, NULL)) != -1) {
+ while ((opt = getopt_long(argc, argv, "c:C:m:s:dvhV::", opts, NULL)) != -1) {
switch (opt) {
case 'c':
config = optarg;
print_help();
return EXIT_SUCCESS;
case 'V':
- print_version();
+ print_version(PROGRAM_NAME, optarg != NULL);
return EXIT_SUCCESS;
default:
print_help();
-/* Copyright (C) 2022 CZ.NIC, z.s.p.o. <knot-dns@labs.nic.cz>
+/* Copyright (C) 2023 CZ.NIC, z.s.p.o. <knot-dns@labs.nic.cz>
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
int main(int argc, char *argv[])
{
struct option options[] = {
- { "help", no_argument, NULL, 'h' },
- { "version", no_argument, NULL, 'V' },
+ { "help", no_argument, NULL, 'h' },
+ { "version", optional_argument, NULL, 'V' },
{ NULL }
};
int opt = 0;
- while ((opt = getopt_long(argc, argv, "hV", options, NULL)) != -1) {
+ while ((opt = getopt_long(argc, argv, "hV::", options, NULL)) != -1) {
switch(opt) {
case 'h':
print_help();
return EXIT_SUCCESS;
case 'V':
- print_version(PROGRAM_NAME);
+ print_version(PROGRAM_NAME, optarg != NULL);
return EXIT_SUCCESS;
default:
print_help();
-/* Copyright (C) 2022 CZ.NIC, z.s.p.o. <knot-dns@labs.nic.cz>
+/* Copyright (C) 2023 CZ.NIC, z.s.p.o. <knot-dns@labs.nic.cz>
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
// Long options.
struct option opts[] = {
- { "help", no_argument, NULL, 'h' },
- { "version", no_argument, NULL, 'V' },
+ { "help", no_argument, NULL, 'h' },
+ { "version", optional_argument, NULL, 'V' },
{ NULL }
};
/* Command line options processing. */
int opt = 0;
- while ((opt = getopt_long(argc, argv, "dhDvVp:t:r:y:k:", opts, NULL))
+ while ((opt = getopt_long(argc, argv, "dhDvV::p:t:r:y:k:", opts, NULL))
!= -1) {
switch (opt) {
case 'd':
params->protocol = PROTO_TCP;
break;
case 'V':
- print_version(PROGRAM_NAME);
+ print_version(PROGRAM_NAME, optarg != NULL);
params->stop = true;
return KNOT_EOK;
case 'p':
{
struct option opts[] = {
{ "help", no_argument, NULL, 'h' },
- { "version", no_argument, NULL, 'V' },
+ { "version", optional_argument, NULL, 'V' },
{ "duration", required_argument, NULL, 't' },
{ "qps", required_argument, NULL, 'Q' },
{ "batch", required_argument, NULL, 'b' },
bool default_at_once = true;
double argf;
char *argcp, *local_ip = NULL, *filename = NULL;
- while ((opt = getopt_long(argc, argv, "hVt:Q:b:rp:T::U::F:I:l:i:L:R:v:m:G:", opts, NULL)) != -1) {
+ while ((opt = getopt_long(argc, argv, "hV::t:Q:b:rp:T::U::F:I:l:i:L:R:v:m:G:", opts, NULL)) != -1) {
switch (opt) {
case 'h':
print_help();
exit(EXIT_SUCCESS);
case 'V':
- print_version(PROGRAM_NAME);
+ print_version(PROGRAM_NAME, optarg != NULL);
exit(EXIT_SUCCESS);
case 't':
assert(optarg);
{ "print", no_argument, NULL, 'p' },
{ "verbose", no_argument, NULL, 'v' },
{ "help", no_argument, NULL, 'h' },
- { "version", no_argument, NULL, 'V' },
+ { "version", optional_argument, NULL, 'V' },
{ NULL }
};
/* Parse command line arguments */
int opt = 0;
- while ((opt = getopt_long(argc, argv, "o:t:d:pvVh", opts, NULL)) != -1) {
+ while ((opt = getopt_long(argc, argv, "o:t:d:pvV::h", opts, NULL)) != -1) {
switch (opt) {
case 'o':
origin = optarg;
print_help();
return EXIT_SUCCESS;
case 'V':
- print_version(PROGRAM_NAME);
+ print_version(PROGRAM_NAME, optarg != NULL);
return EXIT_SUCCESS;
case 'd':
optional = str2bool(optarg) ? SEMCHECK_DNSSEC_ON : SEMCHECK_DNSSEC_OFF;
{ "verify" , no_argument, NULL, 'v' },
{ "time", required_argument, NULL, 't' },
{ "help", no_argument, NULL, 'h' },
- { "version", no_argument, NULL, 'V' },
+ { "version", optional_argument, NULL, 'V' },
{ NULL }
};
signal_init_std();
int opt = 0;
- while ((opt = getopt_long(argc, argv, "c:C:o:rvt:hV", opts, NULL)) != -1) {
+ while ((opt = getopt_long(argc, argv, "c:C:o:rvt:hV::", opts, NULL)) != -1) {
switch (opt) {
case 'c':
if (util_conf_init_file(optarg) != KNOT_EOK) {
print_help();
goto success;
case 'V':
- print_version(PROGRAM_NAME);
+ print_version(PROGRAM_NAME, optarg != NULL);
goto success;
default:
print_help();