AC_MSG_RESULT("tarball")
fi
-# Export KEA_SRCID to config.h
+# Export KEA_SRCID to a C++ header.
# This will be either package version or "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
AC_CONFIG_FILES([tools/extract_bnf.sh],
[chmod +x tools/extract_bnf.sh])
-
-AC_OUTPUT
-
-dnl Print the results
-dnl
-
EXTENDED_VERSION=${PACKAGE_VERSION}
if test "$KEA_SRCID" != ""; then
EXTENDED_VERSION="${EXTENDED_VERSION} ($KEA_SRCID)"
fi
+AC_SUBST(EXTENDED_VERSION)
+
+AC_OUTPUT
# By default the following variables are defined:
# - prefix = /usr/local
libdir_real="$(eval echo ${libdir})"
libdir_real="$(eval echo ${libdir_real})"
+# Print the report.
cat > config.report << END
Kea source configure results:
- ``-v`` - displays the Kea version and exits.
+- ``-V`` - displays the extended Kea version and exits.
+
- ``-W`` - displays the Kea configuration report and exits. The report
is a copy of the ``config.report`` file produced by ``./configure``;
it is embedded in the executable binary.
- ``-h`` - prints a help message.
-- ``-v`` - prints the software version.
+- ``-v`` - displays the Kea version.
+
+- ``-V`` - displays the extended Kea version.
See :ref:`shell-tls` for new command-line arguments associated with TLS/HTTPS support.
``lease-dump``.
``-v|--version``
- Prints the ``kea-admin`` version and quits.
+ Displays the Kea version.
+
+``-V``
+ Displays the extended Kea version.
``-4``
Directs ``kea-admin`` to lease-dump the DHCPv4 leases. Incompatible with
The arguments are as follows:
``-v``
- Displays the version.
+ Displays the Kea version.
``-V``
- Displays the extended version.
+ Displays the extended Kea version.
``-W``
Displays the configuration report.
The arguments are as follows:
``-v``
- Displays the version.
+ Displays the Kea version.
``-V``
- Displays the extended version.
+ Displays the extended Kea version.
``-W``
Displays the configuration report.
The arguments are as follows:
``-v``
- Displays the version.
+ Displays the Kea version.
``-V``
- Displays the extended version.
+ Displays the extended Kea version.
``-W``
Displays the configuration report.
The arguments are as follows:
``-v``
- Displays the version.
+ Displays the Kea version.
``-V``
- Displays the extended version.
+ Displays the extended Kea version.
``-W``
Displays the configuration report.
if one of the processes was interrupted before completing its task.
``-v``
- Causes the version stamp to be printed.
+ Displays the Kea version.
``-V``
- Causes a longer form of the version stamp to be printed.
+ Displays the extended Kea version.
``-W``
Displays the configuration report.
The arguments are as follows:
``-v``
- Displays the version.
+ Displays the Kea version.
``-V``
- Displays the extended version.
+ Displays the extended Kea version.
``-W``
Displays the configuration report.
Displays help regarding command-line parameters.
``-v``
- Displays the version.
+ Displays the Kea version.
``--host``
Specifies the host to connect to. The Control Agent must be running at the
built. This is the default.
``-v|--version``
- Prints the ``keactrl`` version and quits.
+ Displays the Kea version.
+
+``-V``
+ Displays the extended Kea version.
Documentation
~~~~~~~~~~~~~
releasing it.
``-v``
- Prints the version of this program.
+ Displays the Kea version.
+
+``-V``
+ Displays the extended Kea version.
``-W exit-wait-time``
Specifies the exit-wait-time parameter, which causes ``perfdhcp`` to wait for
export exec_prefix
BASENAME=$(basename ${0})
SCRIPTS_DIR_DEFAULT="@datarootdir@/@PACKAGE@/scripts"
-VERSION="@PACKAGE_VERSION@"
+PACKAGE_VERSION="@PACKAGE_VERSION@"
+EXTENDED_VERSION="@EXTENDED_VERSION@"
assume_yes=0
-i or --input to specify the name of file from which leases will be uploaded
-o or --output to specify the name of file to which leases will be dumped
-y or --yes - assume yes on overwriting temporary files
-' "${BASENAME}" "${VERSION}" "${BASENAME}" "${SCRIPTS_DIR_DEFAULT}"
+' "${BASENAME}" "${PACKAGE_VERSION}" "${BASENAME}" "${SCRIPTS_DIR_DEFAULT}"
}
### Logging functions ###
fi
# Check if this is a simple question about version.
-if test "${command}" = "-v" || test "${command}" = "--version" ; then
- echo "${VERSION}"
+if test "${command}" = "-v" || test "${command}" = "--version"; then
+ echo "${PACKAGE_VERSION}"
+ exit 0
+fi
+
+if test "${command}" = "-V"; then
+ echo "${EXTENDED_VERSION}"
exit 0
fi
D2Controller::~D2Controller() {
}
-std::string
-D2Controller::getVersionAddendum() {
- std::stringstream stream;
- // Currently the only dependency D2 adds to base is cryptolink
- stream << isc::cryptolink::CryptoLink::getVersion() << std::endl;
- return (stream.str());
-
-}
-
} // end namespace isc::d2
} // end namespace isc
/// @note Does not throw.
void deregisterCommands();
-protected:
- /// @brief Returns version info specific to D2
- virtual std::string getVersionAddendum();
-
private:
/// @brief Creates an instance of the DHCP-DDNS specific application
/// process. This method is invoked during the process initialization
tmp << VERSION;
if (extended) {
- tmp << endl << EXTENDED_VERSION << endl;
+ tmp << " (" << EXTENDED_VERSION << ")" << endl;
tmp << "premium: " << PREMIUM_EXTENDED_VERSION << endl;
tmp << "linked with:" << endl;
tmp << "- " << Logger::getVersion() << endl;
tmp << VERSION;
if (extended) {
- tmp << endl << EXTENDED_VERSION << endl;
+ tmp << " (" << EXTENDED_VERSION << ")" << endl;
tmp << "premium: " << PREMIUM_EXTENDED_VERSION << endl;
tmp << "linked with:" << endl;
tmp << "- " << Logger::getVersion() << endl;
# used.
set -eu
-VERSION="@PACKAGE_VERSION@"
+PACKAGE_VERSION="@PACKAGE_VERSION@"
+EXTENDED_VERSION="@EXTENDED_VERSION@"
# Set the have_netconf flag to know if netconf is available.
if test '@HAVE_NETCONF@' = 'yes'; then
fi
# Check if this is a simple question about version.
-if test "${command}" = "-v" || test "${command}" = "--version" ; then
- echo "${VERSION}"
+if test "${command}" = "-v" || test "${command}" = "--version"; then
+ echo "${PACKAGE_VERSION}"
+ exit 0
+fi
+
+if test "${command}" = "-V"; then
+ echo "${EXTENDED_VERSION}"
exit 0
fi
exit 0 ;;
version)
- echo "keactrl: ${VERSION}"
+ echo "keactrl: ${PACKAGE_VERSION}"
run_conditional "dhcp4" "print_version kea-dhcp4 ${dhcp4_srv}" 0
run_conditional "dhcp6" "print_version kea-dhcp6 ${dhcp6_srv}" 0
run_conditional "dhcp_ddns" "print_version kea-dhcp-ddns ${dhcp_ddns_srv}" 0
db_version = Memfile_LeaseMgr::getDBVersion(Memfile_LeaseMgr::V6);
}
- version_stream << std::endl << EXTENDED_VERSION;
+ version_stream << " (" << EXTENDED_VERSION << ")";
if (!db_version.empty()) {
db_version = "backend: " + db_version;
version_stream << std::endl << db_version;
// file, You can obtain one at http://mozilla.org/MPL/2.0/.
#include <config.h>
+#include <kea_version.h>
#include <perfdhcp/command_options.h>
// Reset values of class members
reset();
- // Informs if program has been run with 'h' or 'v' option.
+ // Informs if program has been run with 'h', 'v' or 'V' option.
bool help_or_version_mode = initialize(argc, argv, print_cmd_line);
if (!help_or_version_mode) {
validate();
// In this section we collect argument values from command line
// they will be tuned and validated elsewhere
while((opt = getopt_long(argc, argv,
- "huv46A:r:t:R:b:n:p:d:D:l:P:a:L:N:M:s:iBc1"
+ "huvV46A:r:t:R:b:n:p:d:D:l:P:a:L:N:M:s:iBc1"
"J:T:X:O:o:E:S:I:x:W:w:e:f:F:g:C:y:Y:",
long_options, &opt_long_index)) != -1) {
stream << " -";
version();
return (true);
+ case 'V':
+ extendedVersion();
+ return (true);
+
case 'w':
wrapped_ = nonEmptyString("command for wrapped mode:"
" -w<command> must be specified");
-u: Enable checking address uniqueness. Lease valid lifetime should not be
shorter than test duration and clients should not request address more than
once without releasing it first.
--v: Report the version number of this program.
+-v: Display the Kea version.
+-V: Display the extended Kea version.
-W<time>: Specifies exit-wait-time parameter, that makes perfdhcp wait
for <time> us after an exit condition has been met to receive all
packets without sending any new packets. Expressed in microseconds.
void
CommandOptions::version() const {
- std::cout << "VERSION: " << VERSION << std::endl;
+ std::cout << VERSION << std::endl;
+}
+
+void
+CommandOptions::extendedVersion() const {
+ cout << VERSION << " (" << EXTENDED_VERSION << ")" << endl;
}
static void usage();
/// \brief Print program version.
- ///
- /// Prints perfdhcp version.
void version() const;
+ /// @brief Print extended program version.
+ void extendedVersion() const;
+
private:
/// \brief Initializes class members based on the command line.
///
VERSION = "@PACKAGE_VERSION@"
+EXTENDED_VERSION = "@EXTENDED_VERSION@"
def timeout_handler(signum, frame):
help='command to be executed. If not specified, '
'"list-commands" is used')
parser.add_argument('-v', action="store_true", help="Prints version")
+ parser.add_argument('-V', action="store_true", help="Prints extended version")
cmd_args = parser.parse_args()
if cmd_args.v:
print(VERSION)
sys.exit(0)
+ if cmd_args.V:
+ print(EXTENDED_VERSION)
+ sys.exit(0)
+
# Ok, now it's time to put the parameters parsed into the structure to be
# used by the connection.
params = CARequest()
// Verify that it is not empty and does contain the
// extended version number
ASSERT_FALSE(cfgReport.empty());
- EXPECT_NE(std::string::npos, cfgReport.find(EXTENDED_VERSION, 0));
+ EXPECT_NE(std::string::npos, cfgReport.find(VERSION));
+ EXPECT_NE(std::string::npos, cfgReport.find(EXTENDED_VERSION));
}
tmp << VERSION;
if (extended) {
- tmp << std::endl << EXTENDED_VERSION << std::endl;
+ tmp << " (" << EXTENDED_VERSION << ")" << std::endl;
tmp << "premium: " << PREMIUM_EXTENDED_VERSION << std::endl;
tmp << "linked with:" << std::endl;
tmp << "- " << isc::log::Logger::getVersion() << std::endl;
- tmp << getVersionAddendum();
+ tmp << "- " << isc::cryptolink::CryptoLink::getVersion();
}
return (tmp.str());
/// version text returned when DControllerBase::getVersion(true) is
/// invoked.
/// @return a string containing additional version info
- virtual std::string getVersionAddendum() { return (""); }
+ virtual std::string getVersionAddendum() { return (std::string()); }
/// @brief Deals with other (i.e. not application name) global objects.
///
text = controller_->getVersion(true);
EXPECT_NE(std::string::npos, text.find(VERSION));
EXPECT_NE(std::string::npos, text.find(EXTENDED_VERSION));
- EXPECT_NE(std::string::npos, text.find(controller_->getVersionAddendum()));
}
// Tests that the SIGTERM triggers a normal shutdown.