summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFrancis Dupont <fdupont@isc.org>2020-04-28 15:56:07 +0200
committerFrancis Dupont <fdupont@isc.org>2020-05-14 15:51:20 +0200
commitfa4c581f5b0369c48628f9fba614833740ea4d8b (patch)
tree27c487e630cd93c79322d104e114096365c86061
parent[#767] untabified (diff)
downloadkea-fa4c581f5b0369c48628f9fba614833740ea4d8b.tar.xz
kea-fa4c581f5b0369c48628f9fba614833740ea4d8b.zip
[#1184] Checkpoint: message added, todo: minor improvements
-rwxr-xr-xconfigure.ac13
-rw-r--r--kea_version.h.in1
-rw-r--r--src/bin/dhcp4/dhcp4_messages.cc2
-rw-r--r--src/bin/dhcp4/dhcp4_messages.h1
-rw-r--r--src/bin/dhcp4/dhcp4_messages.mes4
-rw-r--r--src/bin/dhcp4/main.cc9
-rw-r--r--src/bin/dhcp6/dhcp6_messages.mes4
-rw-r--r--src/bin/dhcp6/main.cc9
-rw-r--r--src/lib/process/d_controller.cc8
-rw-r--r--src/lib/process/process_messages.cc4
-rw-r--r--src/lib/process/process_messages.h3
-rw-r--r--src/lib/process/process_messages.mes6
12 files changed, 56 insertions, 8 deletions
diff --git a/configure.ac b/configure.ac
index db18f7f241..4f4a304648 100755
--- a/configure.ac
+++ b/configure.ac
@@ -41,7 +41,7 @@ else
KEA_SRCID="tarball"
AC_MSG_RESULT("tarball")
fi
-# Export EXTENDED_VERSION to config.h
+# Export KEA_SRCID to config.h
# This will be either "tarball" or "git abcd".
# We do not want to put this in a config.h, because it messes up ccache
# horribly. When building different branches, the commit-id is different
@@ -50,6 +50,16 @@ fi
# Now it is in kea_version.h and config.status substitutes it.
AC_SUBST(KEA_SRCID)
+# Check whether the version is a development one (odd minor).
+AC_MSG_CHECKING(whether this is a development or stable version)
+PACKAGE_VERSION_MINOR=`echo $PACKAGE_VERSION | cut -d '.' -f 2`
+PACKAGE_VERSION_TYPE="stable"
+if expr "$PACKAGE_VERSION_MINOR" % 2 = 1; then
+ PACKAGE_VERSION_TYPE="development"
+fi
+# Export PACKAGE_VERSION_TYPE to kea_version.h
+AC_SUBST(PACKAGE_VERSION_TYPE)
+
# Find a separator for path_replacer
for sep in "+" "," ";" "&" "__NONE__"; do
if `pwd | grep -q $sep`; then continue; fi
@@ -1784,6 +1794,7 @@ Package:
Name: ${PACKAGE_NAME}
Version: ${PACKAGE_VERSION}
Extended version: ${EXTENDED_VERSION}
+ Version type: ${PACKAGE_VERSION_TYPE}
OS Family: ${OS_TYPE}
Prefix: ${prefix}
diff --git a/kea_version.h.in b/kea_version.h.in
index 67da352047..c0857f56cb 100644
--- a/kea_version.h.in
+++ b/kea_version.h.in
@@ -1 +1,2 @@
#define EXTENDED_VERSION "@KEA_SRCID@"
+#define PACKAGE_VERSION_TYPE "@PACKAGE_VERSION_TYPE@"
diff --git a/src/bin/dhcp4/dhcp4_messages.cc b/src/bin/dhcp4/dhcp4_messages.cc
index be38bf24a5..2960a979e9 100644
--- a/src/bin/dhcp4/dhcp4_messages.cc
+++ b/src/bin/dhcp4/dhcp4_messages.cc
@@ -50,6 +50,7 @@ extern const isc::log::MessageID DHCP4_DECLINE_LEASE_MISMATCH = "DHCP4_DECLINE_L
extern const isc::log::MessageID DHCP4_DECLINE_LEASE_NOT_FOUND = "DHCP4_DECLINE_LEASE_NOT_FOUND";
extern const isc::log::MessageID DHCP4_DEFERRED_OPTION_MISSING = "DHCP4_DEFERRED_OPTION_MISSING";
extern const isc::log::MessageID DHCP4_DEFERRED_OPTION_UNPACK_FAIL = "DHCP4_DEFERRED_OPTION_UNPACK_FAIL";
+extern const isc::log::MessageID DHCP4_DEVELOPMENT_VERSION = "DHCP4_DEVELOPMENT_VERSION";
extern const isc::log::MessageID DHCP4_DHCP4O6_BAD_PACKET = "DHCP4_DHCP4O6_BAD_PACKET";
extern const isc::log::MessageID DHCP4_DHCP4O6_PACKET_RECEIVED = "DHCP4_DHCP4O6_PACKET_RECEIVED";
extern const isc::log::MessageID DHCP4_DHCP4O6_PACKET_SEND = "DHCP4_DHCP4O6_PACKET_SEND";
@@ -196,6 +197,7 @@ const char* values[] = {
"DHCP4_DECLINE_LEASE_NOT_FOUND", "Received DHCPDECLINE for addr %1 from client %2, but no such lease found.",
"DHCP4_DEFERRED_OPTION_MISSING", "can find deferred option code %1 in the query",
"DHCP4_DEFERRED_OPTION_UNPACK_FAIL", "An error unpacking the deferred option %1: %2",
+ "DHCP4_DEVELOPMENT_VERSION", "This software is a development branch of Kea. It is not recommended for production use.",
"DHCP4_DHCP4O6_BAD_PACKET", "received malformed DHCPv4o6 packet: %1",
"DHCP4_DHCP4O6_PACKET_RECEIVED", "received DHCPv4o6 packet from DHCPv4 server (type %1) for %2 on interface %3",
"DHCP4_DHCP4O6_PACKET_SEND", "%1: trying to send packet %2 (type %3) to %4 port %5 on interface %6 encapsulating %7: %8 (type %9)",
diff --git a/src/bin/dhcp4/dhcp4_messages.h b/src/bin/dhcp4/dhcp4_messages.h
index 6f8746737a..67042f5ab8 100644
--- a/src/bin/dhcp4/dhcp4_messages.h
+++ b/src/bin/dhcp4/dhcp4_messages.h
@@ -51,6 +51,7 @@ extern const isc::log::MessageID DHCP4_DECLINE_LEASE_MISMATCH;
extern const isc::log::MessageID DHCP4_DECLINE_LEASE_NOT_FOUND;
extern const isc::log::MessageID DHCP4_DEFERRED_OPTION_MISSING;
extern const isc::log::MessageID DHCP4_DEFERRED_OPTION_UNPACK_FAIL;
+extern const isc::log::MessageID DHCP4_DEVELOPMENT_VERSION;
extern const isc::log::MessageID DHCP4_DHCP4O6_BAD_PACKET;
extern const isc::log::MessageID DHCP4_DHCP4O6_PACKET_RECEIVED;
extern const isc::log::MessageID DHCP4_DHCP4O6_PACKET_SEND;
diff --git a/src/bin/dhcp4/dhcp4_messages.mes b/src/bin/dhcp4/dhcp4_messages.mes
index c7a965b9a5..aaccb6e4fe 100644
--- a/src/bin/dhcp4/dhcp4_messages.mes
+++ b/src/bin/dhcp4/dhcp4_messages.mes
@@ -256,6 +256,10 @@ A debug message issued when deferred unpacking of an option failed, making it
to be left unpacked in the packet. The first argument is the option code,
the second the error.
+% DHCP4_DEVELOPMENT_VERSION This software is a development branch of Kea. It is not recommended for production use.
+This warning message is displayed when the version is a development
+(vs stable) one: the second number of the version is odd.
+
% DHCP4_DHCP4O6_BAD_PACKET received malformed DHCPv4o6 packet: %1
A malformed DHCPv4o6 packet was received.
diff --git a/src/bin/dhcp4/main.cc b/src/bin/dhcp4/main.cc
index 516098a8f5..86610984b7 100644
--- a/src/bin/dhcp4/main.cc
+++ b/src/bin/dhcp4/main.cc
@@ -45,7 +45,10 @@ const char* const DHCP4_NAME = "kea-dhcp4";
/// Note: This function never returns. It terminates the process.
void
usage() {
- cerr << "Kea DHCPv4 server, version " << VERSION << endl;
+ cerr << "Kea DHCPv4 server, "
+ << "version " << VERSION
+ << " (" << PACKAGE_VERSION_TYPE << ")"
+ << endl;
cerr << endl;
cerr << "Usage: " << DHCP4_NAME
<< " -[v|V|W] [-d] [-{c|t} cfgfile] [-p number] [-P number]" << endl;
@@ -215,6 +218,10 @@ main(int argc, char* argv[]) {
LOG_INFO(dhcp4_logger, DHCP4_STARTING).arg(VERSION);
+ if (PACKAGE_VERSION_TYPE == "development") {
+ LOG_WARN(dhcp4_logger, DHCP4_DEVELOPMENT_VERSION);
+ }
+
// Create the server instance.
ControlledDhcpv4Srv server(server_port_number, client_port_number);
diff --git a/src/bin/dhcp6/dhcp6_messages.mes b/src/bin/dhcp6/dhcp6_messages.mes
index 9055f010bd..49ad38f089 100644
--- a/src/bin/dhcp6/dhcp6_messages.mes
+++ b/src/bin/dhcp6/dhcp6_messages.mes
@@ -270,6 +270,10 @@ received in Decline message. It's expected that the option will contain an
address that is being declined. Specific information will be printed in a
separate message.
+% DHCP6_DEVELOPMENT_VERSION This software is a development branch of Kea. It is not recommended for production use.
+This warning message is displayed when the version is a development
+(vs stable) one: the second number of the version is odd.
+
% DHCP6_DHCP4O6_PACKET_RECEIVED received DHCPv4o6 packet from DHCPv4 server (type %1) for %2 port %3 on interface %4
This debug message is printed when the server is receiving a DHCPv4o6
from the DHCPv4 server over inter-process communication.
diff --git a/src/bin/dhcp6/main.cc b/src/bin/dhcp6/main.cc
index a70500aa02..d4e61bfb8c 100644
--- a/src/bin/dhcp6/main.cc
+++ b/src/bin/dhcp6/main.cc
@@ -45,7 +45,10 @@ const char* const DHCP6_NAME = "kea-dhcp6";
/// Note: This function never returns. It terminates the process.
void
usage() {
- cerr << "Kea DHCPv6 server, version " << VERSION << endl;
+ cerr << "Kea DHCPv6 server, "
+ << "version " << VERSION
+ << " (" << PACKAGE_VERSION_TYPE << ")"
+ << endl;
cerr << endl;
cerr << "Usage: " << DHCP6_NAME
<< " -[v|V|W] [-d] [-{c|t} cfgfile] [-p number] [-P number]" << endl;
@@ -215,6 +218,10 @@ main(int argc, char* argv[]) {
LOG_INFO(dhcp6_logger, DHCP6_STARTING).arg(VERSION);
+ if (PACKAGE_VERSION_TYPE == "development") {
+ LOG_WARN(dhcp6_logger, DHCP6_DEVELOPMENT_VERSION);
+ }
+
// Create the server instance.
ControlledDhcpv6Srv server(server_port_number, client_port_number);
diff --git a/src/lib/process/d_controller.cc b/src/lib/process/d_controller.cc
index f971eb0119..323b21da47 100644
--- a/src/lib/process/d_controller.cc
+++ b/src/lib/process/d_controller.cc
@@ -112,6 +112,10 @@ DControllerBase::launch(int argc, char* argv[], const bool test_mode) {
// Log the starting of the service.
LOG_INFO(dctl_logger, DCTL_STARTING)
.arg(app_name_).arg(getpid()).arg(VERSION);
+ // When it is not a stable version dissuade use in production.
+ if (PACKAGE_VERSION_TYPE == "development") {
+ LOG_WARN(dctl_logger, DCTL_DEVELOPMENT_VERSION);
+ }
try {
// Step 2 is to create and initialize the application process object.
initProcess();
@@ -811,6 +815,6 @@ DControllerBase::getVersion(bool extended) {
return (tmp.str());
}
-}; // namespace isc::process
+} // end of namespace isc::process
-}; // namespace isc
+} // end of namespace isc
diff --git a/src/lib/process/process_messages.cc b/src/lib/process/process_messages.cc
index c33986caf2..9f448089d5 100644
--- a/src/lib/process/process_messages.cc
+++ b/src/lib/process/process_messages.cc
@@ -1,4 +1,4 @@
-// File created from ../../../src/lib/process/process_messages.mes on Thu Jun 13 2019 01:25
+// File created from ../../../src/lib/process/process_messages.mes on Tue Apr 28 2020 15:46
#include <cstddef>
#include <log/message_types.h>
@@ -21,6 +21,7 @@ extern const isc::log::MessageID DCTL_CONFIG_LOAD_FAIL = "DCTL_CONFIG_LOAD_FAIL"
extern const isc::log::MessageID DCTL_CONFIG_START = "DCTL_CONFIG_START";
extern const isc::log::MessageID DCTL_CONFIG_STUB = "DCTL_CONFIG_STUB";
extern const isc::log::MessageID DCTL_CONFIG_UPDATE = "DCTL_CONFIG_UPDATE";
+extern const isc::log::MessageID DCTL_DEVELOPMENT_VERSION = "DCTL_DEVELOPMENT_VERSION";
extern const isc::log::MessageID DCTL_INIT_PROCESS = "DCTL_INIT_PROCESS";
extern const isc::log::MessageID DCTL_INIT_PROCESS_FAIL = "DCTL_INIT_PROCESS_FAIL";
extern const isc::log::MessageID DCTL_NOT_RUNNING = "DCTL_NOT_RUNNING";
@@ -57,6 +58,7 @@ const char* values[] = {
"DCTL_CONFIG_START", "parsing new configuration: %1",
"DCTL_CONFIG_STUB", "%1 configuration stub handler called",
"DCTL_CONFIG_UPDATE", "%1 updated configuration received: %2",
+ "DCTL_DEVELOPMENT_VERSION", "This software is a development branch of Kea. It is not recommended for production use.",
"DCTL_INIT_PROCESS", "%1 initializing the application",
"DCTL_INIT_PROCESS_FAIL", "%1 application initialization failed: %2",
"DCTL_NOT_RUNNING", "%1 application instance is not running",
diff --git a/src/lib/process/process_messages.h b/src/lib/process/process_messages.h
index 389c59faab..e770561807 100644
--- a/src/lib/process/process_messages.h
+++ b/src/lib/process/process_messages.h
@@ -1,4 +1,4 @@
-// File created from ../../../src/lib/process/process_messages.mes on Thu Jun 13 2019 01:25
+// File created from ../../../src/lib/process/process_messages.mes on Tue Apr 28 2020 15:46
#ifndef PROCESS_MESSAGES_H
#define PROCESS_MESSAGES_H
@@ -22,6 +22,7 @@ extern const isc::log::MessageID DCTL_CONFIG_LOAD_FAIL;
extern const isc::log::MessageID DCTL_CONFIG_START;
extern const isc::log::MessageID DCTL_CONFIG_STUB;
extern const isc::log::MessageID DCTL_CONFIG_UPDATE;
+extern const isc::log::MessageID DCTL_DEVELOPMENT_VERSION;
extern const isc::log::MessageID DCTL_INIT_PROCESS;
extern const isc::log::MessageID DCTL_INIT_PROCESS_FAIL;
extern const isc::log::MessageID DCTL_NOT_RUNNING;
diff --git a/src/lib/process/process_messages.mes b/src/lib/process/process_messages.mes
index 7156da9e8a..a45cea44a1 100644
--- a/src/lib/process/process_messages.mes
+++ b/src/lib/process/process_messages.mes
@@ -1,4 +1,4 @@
-# Copyright (C) 2016-2019 Internet Systems Consortium, Inc. ("ISC")
+# Copyright (C) 2016-2020 Internet Systems Consortium, Inc. ("ISC")
#
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
@@ -49,6 +49,10 @@ may be provided.
This warning message is issued when the configuration includes a deprecated
object (i.e. a top level element) which will be ignored.
+% DCTL_DEVELOPMENT_VERSION This software is a development branch of Kea. It is not recommended for production use.
+This warning message is displayed when the version is a development
+(vs stable) one: the second number of the version is odd.
+
% DCTL_CONFIG_FETCH Fetching configuration data from config backends.
This is an informational message emitted when the Kea server is about to begin
retrieving configuration data from one or more configuration backends.