Commit a4a614f4 authored by Thomas Markwalder's avatar Thomas Markwalder
Browse files

[5589] Addressed review comments except for unit tests not loading library

    Too numerous to mention.
parent b53946b9
...@@ -7,7 +7,8 @@ ...@@ -7,7 +7,8 @@
statistics in deployments running multiple Kea servers that use statistics in deployments running multiple Kea servers that use
shared lease back end. The in-memory statistics kept by individual shared lease back end. The in-memory statistics kept by individual
servers only track lease changes made by that server. Thus in a servers only track lease changes made by that server. Thus in a
deployment with multiple servers, these statistics are incomplete. deployment with multiple servers (e.g. two kea-dhcp6 servers using the
same PostgreSQL database for lease storage), these statistics are incomplete.
In Kea 1.4, the MySQL and PostgreSQL back ends were modified to track In Kea 1.4, the MySQL and PostgreSQL back ends were modified to track
lease allocation changes as they occur via database triggers. Additionally, lease allocation changes as they occur via database triggers. Additionally,
all four lease back ends were extended to support retrieving lease all four lease back ends were extended to support retrieving lease
...@@ -111,9 +112,7 @@ ...@@ -111,9 +112,7 @@
The following command would fetch lease statistcis for all known subnets from kea-dhcp4 server: The following command would fetch lease statistcis for all known subnets from kea-dhcp4 server:
<screen> <screen>
{ {
"command": "stat-lease4-get", "command": "stat-lease4-get"
"arguments": {
}
} }
</screen> </screen>
</para> </para>
...@@ -170,22 +169,12 @@ ...@@ -170,22 +169,12 @@
<itemizedlist> <itemizedlist>
<listitem><simpara><command>subnet-id</command> - ID of the subnet</simpara></listitem> <listitem><simpara><command>subnet-id</command> - ID of the subnet</simpara></listitem>
<listitem><simpara><command>total-addresses</command> - total number of addresses <listitem><simpara><command>total-addresses</command> - total number of addresses
available for DHCPv4 management. In other words, this is the sum of all available for DHCPv4 management in the subnet. In other words, this is the sum of all
addresses in all configured pools. This statistic changes only during addresses in all the configured pools in the subnet.</simpara></listitem>
configuration changes. Note it does not take into account any addresses that <listitem><simpara><command>assigned-addresses</command> - number of addresses
may be reserved due to host reservation. in the subnet that are currently assigned to a client.</simpara></listitem>
</simpara></listitem> <listitem><simpara><command>declined-addresses</command> - number of addresses
<listitem><simpara><command>assigned-addresses</command> - number of assigned in the subnet that are currently declined and are thus unavailable for assignment.
addresses in a given subnet. It increases every time a new lease is
allocated (as a result of receiving a DHCPREQUEST message) and is decreased
every time a lease is released (a DHCPRELEASE message is received) or expires.
</simpara></listitem>
<listitem><simpara><command>declined-addresses</command> - number of IPv4 addresses
that are currently declined in a given subnet, so is a count of the number
of leases currently unavailable. Once a lease is recovered, this statistic
will be decreased. Ideally, this statistic should be zero. If this statistic
is non-zero (or worse increasing), a network administrator should investigate
if there is a misbehaving device in his network.
</simpara></listitem> </simpara></listitem>
</itemizedlist></para> </itemizedlist></para>
</listitem> </listitem>
...@@ -193,35 +182,17 @@ ...@@ -193,35 +182,17 @@
<itemizedlist> <itemizedlist>
<listitem><simpara><command>subnet-id</command> - ID of the subnet</simpara></listitem> <listitem><simpara><command>subnet-id</command> - ID of the subnet</simpara></listitem>
<listitem><simpara><command>total-nas</command> - number of NA addresses available <listitem><simpara><command>total-nas</command> - number of NA addresses available
for DHCPv6 management for a given subnet. In other words, this is the for DHCPv6 management in the subnet. In other words, this is the sum of all
sum of all addresses in all configured pools. This statistic changes the NA addresses in the all configured NA pools in the subnet.</simpara></listitem>
only during configuration changes. Note that it does not take into account
any addresses that may be reserved due to host reservation.</simpara>
</listitem>
<listitem><simpara><command>assigned-nas</command> - number of NA addresses in a <listitem><simpara><command>assigned-nas</command> - number of NA addresses in a
the subnet that are assigned. This statistic increases every time a new the subnet that are currently assigned to a client.</simpara></listitem>
lease is allocated (as a result of receiving a REQUEST message) and is <listitem><simpara><command>declined-nas</command> - number of NA addresses that
decreased every time a lease is released (a RELEASE message is received) are currently declined and are thus unavailable for assignment.</simpara></listitem>
or expires. <listitem><simpara><command>total-pds</command> - total number of prefixes available
</simpara></listitem> of DHCPv6 management in the subnet. In other words, this is the sum of all prefixes
<listitem><simpara><command>declined-nas</command> - number of IPv6 addresses that in all the configured prefix pools in the subnet.</simpara></listitem>
are currently declined and so counts the number of leases currently <listitem><simpara><command>assigned-pds</command> - number of prefixes in the subnet
unavailable. Once a lease is recovered, this statistic will be decreased. that are currently assigned to a client.</simpara></listitem>
Ideally, this statistic should be zero. If this statistic is non-zero
(or worse, increasing), the network administrator should investigate if
there is a misbehaving device in the network.
</simpara></listitem>
<listitem><simpara><command>total-pds</command> - total number of PD prefixes available
of DHCPv6 management for a given subnet. In other words, this is the sum
of all prefixes in all configured pools. This statistic changes only during
configuration changes. Note it does not take into account any prefixes that
may be reserved due to host reservation.
</simpara></listitem>
<listitem><simpara><command>assigned-pds</command> - number of PD prefixes in a given
subnet that are assigned. This statistic increases every time a new lease is
allocated (as a result of receiving a REQUEST message) and is decreased every
time a lease is released (a RELEASE message is received) or expires.
</simpara></listitem>
</itemizedlist></para> </itemizedlist></para>
</listitem> </listitem>
<listitem><para><command>rows</command> - a list of rows, one per subnet ID. Each row <listitem><para><command>rows</command> - a list of rows, one per subnet ID. Each row
...@@ -245,7 +216,8 @@ ...@@ -245,7 +216,8 @@
"result-set": { "result-set": {
"columns": [ "subnet-id", "total-addresses", "assigned-addresses", "declined-addresses" ] "columns": [ "subnet-id", "total-addresses", "assigned-addresses", "declined-addresses" ]
"rows": [ "rows": [
[ 10, 256, 111, 0 ], [ 20, 4098, 2034, 4 ] [ 10, 256, 111, 0 ],
[ 20, 4098, 2034, 4 ]
], ],
"timestamp": "2018-05-04 15:03:37.000000" "timestamp": "2018-05-04 15:03:37.000000"
} }
...@@ -254,7 +226,9 @@ ...@@ -254,7 +226,9 @@
</screen> </screen>
</para> </para>
<para> <para>
The response to a DHCPv6 command might look as follows: The response to a DHCPv6 command might look as follows (subnet 10 has no
prefix pools, subnet 20 has no NA pools, and subnet 30 has both NA and PD
pools):
<screen> <screen>
{ {
"result": 0, "result": 0,
...@@ -263,8 +237,9 @@ ...@@ -263,8 +237,9 @@
"result-set": { "result-set": {
"columns": [ "subnet-id", "total-nas", "assigned-nas", "declined-nas", "total-pds", "assigned-pds" ] "columns": [ "subnet-id", "total-nas", "assigned-nas", "declined-nas", "total-pds", "assigned-pds" ]
"rows": [ "rows": [
[ 10, 256, 111, 0 ], [ 10, 4096, 2400, 3, 0, 0],
[ 20, 4098, 2034, 4 ] [ 20, 0, 0, 0, 1048, 233 ]
[ 30, 256, 60, 0, 1048, 15 ]
], ],
"timestamp": "2018-05-04 15:03:37.000000" "timestamp": "2018-05-04 15:03:37.000000"
} }
......
...@@ -313,6 +313,15 @@ ...@@ -313,6 +313,15 @@
</simpara> </simpara>
</listitem> </listitem>
<listitem>
<simpara>
<command>kea-dhcp4.stat-cmds-hooks</command> - this logger is used
to log messages related to operation of the Stats Cmds hooks library.
In general these will pertain to loading and unloading the library,
as well as execution of commands by the library.
</simpara>
</listitem>
<listitem> <listitem>
<simpara> <simpara>
<command>kea-dhcp6</command> - the root logger for the DHCPv6 <command>kea-dhcp6</command> - the root logger for the DHCPv6
......
...@@ -60,6 +60,25 @@ public: ...@@ -60,6 +60,25 @@ public:
/// @brief Denotes the query selection mode all, subnet, /// @brief Denotes the query selection mode all, subnet,
/// or subnet range /// or subnet range
LeaseStatsQuery::SelectMode select_mode_; LeaseStatsQuery::SelectMode select_mode_;
/// @brief Generate a string version of the contents
std::string toText() {
std::stringstream os;
switch (select_mode_) {
case LeaseStatsQuery::ALL_SUBNETS:
os << "[all subnets]";
break;
case LeaseStatsQuery::SINGLE_SUBNET:
os << "[subnet-id=" << first_subnet_id_ << "]";
break;
case LeaseStatsQuery::SUBNET_RANGE:
os << "[subnets " << first_subnet_id_
<< " through " << last_subnet_id_ << "]";
break;
}
return (os.str());
}
}; };
public: public:
...@@ -102,8 +121,7 @@ public: ...@@ -102,8 +121,7 @@ public:
/// must fulfill: 0 < first-subnet-id < last-subnet-id /// must fulfill: 0 < first-subnet-id < last-subnet-id
/// -# subnet-id and subnet-range are mutually exclusive /// -# subnet-id and subnet-range are mutually exclusive
Parameters getParameters(const ConstElementPtr& cmd_args); Parameters getParameters(const ConstElementPtr& cmd_args);
/// @brief Executes the lease4 query and constructs the outbound result set
/// @brief Executes the lease4 query and constructs the outbound result set
/// ///
/// This method uses the command parameters to identify the range /// This method uses the command parameters to identify the range
/// of configured subnets. If the range contains no known subnets /// of configured subnets. If the range contains no known subnets
...@@ -195,39 +213,46 @@ public: ...@@ -195,39 +213,46 @@ public:
int int
LeaseStatCmdsImpl::statLease4GetHandler(CalloutHandle& handle) { LeaseStatCmdsImpl::statLease4GetHandler(CalloutHandle& handle) {
ElementPtr result = Element::createMap(); ElementPtr result = Element::createMap();
int response_code; Parameters params;
string txt = "malformed command"; ConstElementPtr response;
// Extract the command and then the parameters
try { try {
// Extract the command and then the parameters
extractCommand(handle); extractCommand(handle);
Parameters params = getParameters(cmd_args_); params = getParameters(cmd_args_);
} catch (const std::exception& ex) {
LOG_ERROR(stat_cmds_logger, STAT_CMDS_LEASE4_GET_INVALID)
.arg(ex.what());
setErrorResponse(handle, ex.what());
return (1);
}
try {
// Now build the result set // Now build the result set
txt = "building result";
uint64_t rows = makeResultSet4(result, params); uint64_t rows = makeResultSet4(result, params);
LOG_INFO(stat_cmds_logger, STAT_CMDS_LEASE4_GET)
// Eureka it worked! .arg(params.toText())
response_code = CONTROL_RESULT_SUCCESS; .arg(rows);
std::stringstream os; std::stringstream os;
os << "stat-lease4-get: " << rows << " rows found"; os << "stat-lease4-get" << params.toText() << ": " << rows << " rows found";
txt = os.str(); response = createAnswer(CONTROL_RESULT_SUCCESS, os.str(), result);
} catch (const NotFound& ex) { } catch (const NotFound& ex) {
// Criteria was valid but included no known subnets, // Criteria was valid but included no known subnets,
// so we return a not found response. // so we return a not found response.
response_code = CONTROL_RESULT_EMPTY; LOG_INFO(stat_cmds_logger, STAT_CMDS_LEASE4_GET_NO_SUBNETS)
.arg(params.toText())
.arg(ex.what());
std::stringstream os; std::stringstream os;
os << "stat-lease4-get: " << "no matching data, " << ex.what(); os << "stat-lease4-get" << params.toText() << ": no matching data, " << ex.what();
txt = os.str(); response = createAnswer(CONTROL_RESULT_EMPTY, os.str(), result);
} catch (const std::exception& ex) { } catch (const std::exception& ex) {
LOG_ERROR(stat_cmds_logger, STAT_LEASE4_GET_FAILED) LOG_ERROR(stat_cmds_logger, STAT_CMDS_LEASE4_GET_FAILED)
.arg(txt) .arg(params.toText())
.arg(ex.what()); .arg(ex.what());
setErrorResponse(handle, ex.what()); setErrorResponse(handle, ex.what());
return (1); return (1);
} }
LOG_INFO(stat_cmds_logger, STAT_LEASE4_GET).arg(txt);
ConstElementPtr response = createAnswer(response_code, txt, result);
setResponse(handle, response); setResponse(handle, response);
return (0); return (0);
} }
...@@ -235,40 +260,46 @@ LeaseStatCmdsImpl::statLease4GetHandler(CalloutHandle& handle) { ...@@ -235,40 +260,46 @@ LeaseStatCmdsImpl::statLease4GetHandler(CalloutHandle& handle) {
int int
LeaseStatCmdsImpl::statLease6GetHandler(CalloutHandle& handle) { LeaseStatCmdsImpl::statLease6GetHandler(CalloutHandle& handle) {
ElementPtr result = Element::createMap(); ElementPtr result = Element::createMap();
int response_code; Parameters params;
string txt = "malformed command"; ConstElementPtr response;
// Extract the command and then the parameters
try { try {
// Extract the command and then the parameters
extractCommand(handle); extractCommand(handle);
Parameters params = getParameters(cmd_args_); params = getParameters(cmd_args_);
} catch (const std::exception& ex) {
LOG_ERROR(stat_cmds_logger, STAT_CMDS_LEASE6_GET_INVALID)
.arg(ex.what());
setErrorResponse(handle, ex.what());
return (1);
}
try {
// Now build the result set // Now build the result set
txt = "building result";
uint64_t rows = makeResultSet6(result, params); uint64_t rows = makeResultSet6(result, params);
LOG_INFO(stat_cmds_logger, STAT_CMDS_LEASE6_GET)
// Eureka it worked! .arg(params.toText())
response_code = CONTROL_RESULT_SUCCESS; .arg(rows);
std::stringstream os; std::stringstream os;
os << "stat-lease6-get: " << rows << " rows found"; os << "stat-lease6-get" << params.toText() << ": " << rows << " rows found";
txt = os.str(); response = createAnswer(CONTROL_RESULT_SUCCESS, os.str(), result);
} catch (const NotFound& ex) { } catch (const NotFound& ex) {
// Criteria was valid but included no known subnets, // Criteria was valid but included no known subnets,
// so we return a not found response. // so we return a not found response.
result = Element::createMap(); LOG_INFO(stat_cmds_logger, STAT_CMDS_LEASE6_GET_NO_SUBNETS)
response_code = CONTROL_RESULT_EMPTY; .arg(params.toText())
.arg(ex.what());
std::stringstream os; std::stringstream os;
os << "stat-lease6-get: " << "no matching data, " << ex.what(); os << "stat-lease6-get" << params.toText() << ": no matching data, " << ex.what();
txt = os.str(); response = createAnswer(CONTROL_RESULT_EMPTY, os.str(), result);
} catch (const std::exception& ex) { } catch (const std::exception& ex) {
LOG_ERROR(stat_cmds_logger, STAT_LEASE6_GET_FAILED) LOG_ERROR(stat_cmds_logger, STAT_CMDS_LEASE6_GET_FAILED)
.arg(txt) .arg(params.toText())
.arg(ex.what()); .arg(ex.what());
setErrorResponse(handle, ex.what()); setErrorResponse(handle, ex.what());
return (1); return (1);
} }
LOG_INFO(stat_cmds_logger, STAT_LEASE6_GET).arg(txt);
ConstElementPtr response = createAnswer(response_code, txt, result);
setResponse(handle, response); setResponse(handle, response);
return (0); return (0);
} }
...@@ -277,8 +308,14 @@ LeaseStatCmdsImpl::Parameters ...@@ -277,8 +308,14 @@ LeaseStatCmdsImpl::Parameters
LeaseStatCmdsImpl::getParameters(const ConstElementPtr& cmd_args) { LeaseStatCmdsImpl::getParameters(const ConstElementPtr& cmd_args) {
Parameters params; Parameters params;
if (!cmd_args || cmd_args->getType() != Element::map) { params.select_mode_ = LeaseStatsQuery::ALL_SUBNETS;
isc_throw(BadValue, "Parameters missing or are not a map."); if (!cmd_args ) {
// No arguments defaults to ALL_SUBNETS.
return (params);
}
if (cmd_args->getType() != Element::map) {
isc_throw(BadValue, "'arguments' parameter is not a map");
} }
params.select_mode_ = LeaseStatsQuery::ALL_SUBNETS; params.select_mode_ = LeaseStatsQuery::ALL_SUBNETS;
...@@ -299,7 +336,7 @@ LeaseStatCmdsImpl::getParameters(const ConstElementPtr& cmd_args) { ...@@ -299,7 +336,7 @@ LeaseStatCmdsImpl::getParameters(const ConstElementPtr& cmd_args) {
if (cmd_args->contains("subnet-range")) { if (cmd_args->contains("subnet-range")) {
if (params.select_mode_ == LeaseStatsQuery::SINGLE_SUBNET) { if (params.select_mode_ == LeaseStatsQuery::SINGLE_SUBNET) {
isc_throw(BadValue, "Cannot specify both subnet-id and subnet-range"); isc_throw(BadValue, "cannot specify both subnet-id and subnet-range");
} }
ConstElementPtr range = cmd_args->get("subnet-range"); ConstElementPtr range = cmd_args->get("subnet-range");
...@@ -567,7 +604,8 @@ LeaseStatCmdsImpl::createResultSet(const ElementPtr &result_wrapper, ...@@ -567,7 +604,8 @@ LeaseStatCmdsImpl::createResultSet(const ElementPtr &result_wrapper,
result_wrapper->set("result-set", result_set); result_wrapper->set("result-set", result_set);
// Create the timestamp based on time now and add it to the result set. // Create the timestamp based on time now and add it to the result set.
boost::posix_time::ptime now(boost::posix_time::second_clock::universal_time()); boost::posix_time::ptime now(boost::posix_time::microsec_clock::universal_time());
ElementPtr timestamp = Element::create(isc::util::ptimeToText(now)); ElementPtr timestamp = Element::create(isc::util::ptimeToText(now));
result_set->set("timestamp", timestamp); result_set->set("timestamp", timestamp);
...@@ -632,8 +670,5 @@ StatCmds::statLease6GetHandler(CalloutHandle& handle) { ...@@ -632,8 +670,5 @@ StatCmds::statLease6GetHandler(CalloutHandle& handle) {
return(impl.statLease6GetHandler(handle)); return(impl.statLease6GetHandler(handle));
} }
StatCmds::StatCmds() {
}
}; };
}; };
// Copyright (C) 2017-2018 Internet Systems Consortium, Inc. ("ISC") // Copyright (C) 2018 Internet Systems Consortium, Inc. ("ISC")
// //
// This Source Code Form is subject to the terms of the Mozilla Public // 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 // License, v. 2.0. If a copy of the MPL was not distributed with this
...@@ -7,7 +7,6 @@ ...@@ -7,7 +7,6 @@
#ifndef STAT_CMDS_H #ifndef STAT_CMDS_H
#define STAT_CMDS_H #define STAT_CMDS_H
#include <cc/data.h>
#include <hooks/hooks.h> #include <hooks/hooks.h>
#include <boost/shared_ptr.hpp> #include <boost/shared_ptr.hpp>
...@@ -25,14 +24,12 @@ class StatCmdsImpl; ...@@ -25,14 +24,12 @@ class StatCmdsImpl;
/// stat manipulations. /// stat manipulations.
class StatCmds { class StatCmds {
public: public:
/// @brief Constructor. /// @brief Default Constructor.
/// StatCmds() {};
/// It creates an instance of the @c StatCmdsImpl.
StatCmds();
/// @brief stat-lease4-get command handler /// @brief stat-lease4-get command handler
/// ///
/// This command attempts to fetch lease4 statistics for one or /// This command attempts to fetch lease4 statistics for one or
/// more subnets based upon subnet selection criteria (or lack thereof). /// more subnets based upon subnet selection criteria (or lack thereof).
/// It extracts the command name and arguments from the given Callouthandle, /// It extracts the command name and arguments from the given Callouthandle,
/// attempts to process them, and then set's the handle's "response" /// attempts to process them, and then set's the handle's "response"
...@@ -40,10 +37,10 @@ public: ...@@ -40,10 +37,10 @@ public:
/// { /// {
/// "command": "stat-lease4-get", /// "command": "stat-lease4-get",
/// "arguments": { /// "arguments": {
/// "subnet-id": x // optional /// "subnet-id": 10 // optional
/// "subnet-range": { // optional /// "subnet-range": { // optional
/// "first-subnet-id": x, // id >= x /// "first-subnet-id": 10, // id >= 10
/// "last-subnet-id": y // id <= x /// "last-subnet-id": 50 // id <= 50
/// } /// }
/// } /// }
/// } /// }
...@@ -56,7 +53,7 @@ public: ...@@ -56,7 +53,7 @@ public:
/// "arguments": { /// "arguments": {
/// "result-set": { /// "result-set": {
/// "timestamp": "2018-03-22 09:43:30.815371", /// "timestamp": "2018-03-22 09:43:30.815371",
/// "columns": ["subnet_id", "total-addresses", /// "columns": ["subnet_id", "total-addresses",
/// "assigned-addresses", "declined-addresses"], /// "assigned-addresses", "declined-addresses"],
/// "rows": [ /// "rows": [
/// [1, 600, 450, 3], /// [1, 600, 450, 3],
...@@ -75,7 +72,7 @@ public: ...@@ -75,7 +72,7 @@ public:
/// @brief stat-lease6-get command handler /// @brief stat-lease6-get command handler
/// ///
/// This command attempts to fetch lease6 statistics for one or /// This command attempts to fetch lease6 statistics for one or
/// more subnets based upon subnet selection criteria (or lack thereof). /// more subnets based upon subnet selection criteria (or lack thereof).
/// It extracts the command name and arguments from the given Callouthandle, /// It extracts the command name and arguments from the given Callouthandle,
/// attempts to process them, and then set's the handle's "response" /// attempts to process them, and then set's the handle's "response"
...@@ -83,10 +80,10 @@ public: ...@@ -83,10 +80,10 @@ public:
/// { /// {
/// "command": "stat-lease6-get", /// "command": "stat-lease6-get",
/// "arguments": { /// "arguments": {
/// "subnet-id": x // optional /// "subnet-id": 10 // optional
/// "subnet-range": { // optional /// "subnet-range": { // optional
/// "first-subnet-id": x, // id >= x /// "first-subnet-id": 10, // id >= 10
/// "last-subnet-id": y // id <= x /// "last-subnet-id": 50 // id <= 50
/// } /// }
/// } /// }
/// } /// }
...@@ -99,8 +96,8 @@ public: ...@@ -99,8 +96,8 @@ public:
/// "arguments": { /// "arguments": {
/// "result-set": { /// "result-set": {
/// "timestamp": "2018-03-22 09:43:30.815371", /// "timestamp": "2018-03-22 09:43:30.815371",
/// "columns": ["subnet_id", "total-nas", /// "columns": ["subnet_id", "total-nas",
/// "assigned-nas", "declined-nas", /// "assigned-nas", "declined-nas",
/// "total-pds", "assigned-pds"], /// "total-pds", "assigned-pds"],
/// "rows": [ /// "rows": [
/// [1, 600, 450, 3, 64, 10], /// [1, 600, 450, 3, 64, 10],
...@@ -116,11 +113,6 @@ public: ...@@ -116,11 +113,6 @@ public:
/// @return result of the operation /// @return result of the operation
int int
statLease6GetHandler(hooks::CalloutHandle& handle); statLease6GetHandler(hooks::CalloutHandle& handle);
#if 0
private:
/// Pointer to the actual implementation
boost::shared_ptr<StatCmdsImpl> impl_;
#endif
}; };
}; };
......
...@@ -13,8 +13,6 @@ ...@@ -13,8 +13,6 @@
#include <cc/command_interpreter.h> #include <cc/command_interpreter.h>
#include <hooks/hooks.h> #include <hooks/hooks.h>
using namespace isc::config;
using namespace isc::data;
using namespace isc::hooks; using namespace isc::hooks;
using namespace isc::stat_cmds; using namespace isc::stat_cmds;
...@@ -49,7 +47,7 @@ int stat_lease6_get(CalloutHandle& handle) { ...@@ -49,7 +47,7 @@ int stat_lease6_get(CalloutHandle& handle) {
int load(LibraryHandle& handle) { int load(LibraryHandle& handle) {
handle.registerCommandCallout("stat-lease4-get", stat_lease4_get); handle.registerCommandCallout("stat-lease4-get", stat_lease4_get);
handle.registerCommandCallout("stat-lease6-get", stat_lease6_get); handle.registerCommandCallout("stat-lease6-get", stat_lease6_get);
LOG_INFO(stat_cmds_logger, STAT_CMDS_INIT_OK); LOG_INFO(stat_cmds_logger, STAT_CMDS_CMDS_INIT_OK);
return (0); return (0);
} }
...@@ -57,7 +55,7 @@ int load(LibraryHandle& handle) { ...@@ -57,7 +55,7 @@ int load(LibraryHandle& handle) {
/// ///
/// @return 0 if deregistration was successful, 1 otherwise /// @return 0 if deregistration was successful, 1 otherwise
int unload() { int unload() {
LOG_INFO(stat_cmds_logger, STAT_CMDS_DEINIT_OK); LOG_INFO(stat_cmds_logger, STAT_CMDS_CMDS_DEINIT_OK);
return (0);