Kea 2.2.0
stat_cmds_callouts.cc
Go to the documentation of this file.
1// Copyright (C) 2018-2020 Internet Systems Consortium, Inc. ("ISC")
2//
3// This Source Code Form is subject to the terms of the Mozilla Public
4// License, v. 2.0. If a copy of the MPL was not distributed with this
5// file, You can obtain one at http://mozilla.org/MPL/2.0/.
6
7// Functions accessed by the hooks framework use C linkage to avoid the name
8// mangling that accompanies use of the C++ compiler as well as to avoid
9// issues related to namespaces.
10
11#include <config.h>
12
13#include <stat_cmds.h>
14#include <stat_cmds_log.h>
16#include <hooks/hooks.h>
17
18using namespace isc::hooks;
19using namespace isc::stat_cmds;
20
21extern "C" {
22
30 StatCmds stat_cmds;
31 return(stat_cmds.statLease4GetHandler(handle));
32}
33
41 StatCmds stat_cmds;
42 return(stat_cmds.statLease6GetHandler(handle));
43}
44
49int load(LibraryHandle& handle) {
50 handle.registerCommandCallout("stat-lease4-get", stat_lease4_get);
51 handle.registerCommandCallout("stat-lease6-get", stat_lease6_get);
53 return (0);
54}
55
59int unload() {
61 return (0);
62}
63
68 return (1);
69}
70
71} // end extern "C"
Per-packet callout handle.
void registerCommandCallout(const std::string &command_name, CalloutPtr callout)
Register control command handler.
Implements the logic for processing commands pertaining to stat manipulation.
Definition: stat_cmds.h:25
int statLease4GetHandler(hooks::CalloutHandle &handle)
stat-lease4-get command handler
Definition: stat_cmds.cc:718
int statLease6GetHandler(hooks::CalloutHandle &handle)
stat-lease6-get command handler
Definition: stat_cmds.cc:732
This file contains several functions and constants that are used for handling commands and responses ...
#define LOG_INFO(LOGGER, MESSAGE)
Macro to conveniently test info output and log it.
Definition: macros.h:20
isc::log::Logger stat_cmds_logger("stat-cmds-hooks")
Definition: stat_cmds_log.h:17
int stat_lease6_get(CalloutHandle &handle)
This is a command callout for 'stat-lease6-get' command.
int stat_lease4_get(CalloutHandle &handle)
This is a command callout for 'stat-lease4-get' command.
int multi_threading_compatible()
This function is called to retrieve the multi-threading compatibility.
int unload()
This function is called when the library is unloaded.
int load(LibraryHandle &handle)
This function is called when the library is loaded.
const isc::log::MessageID STAT_CMDS_DEINIT_OK
const isc::log::MessageID STAT_CMDS_INIT_OK