]> git.ipfire.org Git - thirdparty/kea.git/commitdiff
[#1184] Checkpoint: message added, todo: minor improvements
authorFrancis Dupont <fdupont@isc.org>
Tue, 28 Apr 2020 13:56:07 +0000 (15:56 +0200)
committerFrancis Dupont <fdupont@isc.org>
Thu, 14 May 2020 13:51:20 +0000 (15:51 +0200)
12 files changed:
configure.ac
kea_version.h.in
src/bin/dhcp4/dhcp4_messages.cc
src/bin/dhcp4/dhcp4_messages.h
src/bin/dhcp4/dhcp4_messages.mes
src/bin/dhcp4/main.cc
src/bin/dhcp6/dhcp6_messages.mes
src/bin/dhcp6/main.cc
src/lib/process/d_controller.cc
src/lib/process/process_messages.cc
src/lib/process/process_messages.h
src/lib/process/process_messages.mes

index db18f7f2413addb8ef6481243efe05b47ba317ee..4f4a304648ebc14a0df6354a07171e12e787f5ee 100755 (executable)
@@ -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}
index 67da3520473ad81afefe76557daf6654e2082d8a..c0857f56cb78d1a73906ad3ec4d2b190bffa2934 100644 (file)
@@ -1 +1,2 @@
 #define EXTENDED_VERSION "@KEA_SRCID@"
+#define PACKAGE_VERSION_TYPE "@PACKAGE_VERSION_TYPE@"
index be38bf24a5a4aeed2dfb7337ffbec525ee4ba325..2960a979e9a92c985953073356f06a6563266394 100644 (file)
@@ -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)",
index 6f8746737a9eabac8c029a7f6c92fe9130af324e..67042f5ab87c951915c6b8581ffada025b5dd63a 100644 (file)
@@ -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;
index c7a965b9a595b834ce3484e0b985b826514f10c9..aaccb6e4fe1c16617828f58de511895148032762 100644 (file)
@@ -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.
 
index 516098a8f51c1f331e96b85238269db84a6b7eb5..86610984b753446ed98abc9610d74ad0497394ee 100644 (file)
@@ -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);
 
index 9055f010bd59de3a427a8b1a3b7df6089495eb60..49ad38f0897378b57fbdc248b73e2fa64b9c684d 100644 (file)
@@ -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.
index a70500aa0235bca18b4a2a2e29c681aa19d01034..d4e61bfb8c9f6cac6ac8ec59f888c81b4f83858e 100644 (file)
@@ -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);
 
index f971eb01191259dfc1d6ebf6b0f3f6f7fa1beb33..323b21da47bbdae45ed445be38f301074d2cacb1 100644 (file)
@@ -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
index c33986caf280400deff29f059fdebe008aa7d66a..9f448089d5c1f7750c3cd863cfd52c27e6de7e97 100644 (file)
@@ -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",
index 389c59faab6450f88bfff2334ac96a804ebb3d29..e77056180718ab49f5900c16d27f0533ffb21203 100644 (file)
@@ -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;
index 7156da9e8a9ee220525a4a438642fef4229504ef..a45cea44a1f3e62e1f282eb487839fb44f21f401 100644 (file)
@@ -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.