Kea  1.9.9-git
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>
15 #include <cc/command_interpreter.h>
16 #include <hooks/hooks.h>
17 
18 using namespace isc::hooks;
19 using namespace isc::stat_cmds;
20 
21 extern "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 
49 int 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 
59 int unload() {
61  return (0);
62 }
63 
68  return (1);
69 }
70 
71 } // end extern "C"
const isc::log::MessageID STAT_CMDS_INIT_OK
#define LOG_INFO(LOGGER, MESSAGE)
Macro to conveniently test info output and log it.
Definition: macros.h:20
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
Per-packet callout handle.
int stat_lease4_get(CalloutHandle &handle)
This is a command callout for 'stat-lease4-get' command.
int load(LibraryHandle &handle)
This function is called when the library is loaded.
int statLease4GetHandler(hooks::CalloutHandle &handle)
stat-lease4-get command handler
Definition: stat_cmds.cc:678
int stat_lease6_get(CalloutHandle &handle)
This is a command callout for 'stat-lease6-get' command.
int statLease6GetHandler(hooks::CalloutHandle &handle)
stat-lease6-get command handler
Definition: stat_cmds.cc:685
This file contains several functions and constants that are used for handling commands and responses ...
int unload()
This function is called when the library is unloaded.
int multi_threading_compatible()
This function is called to retrieve the multi-threading compatibility.
const isc::log::MessageID STAT_CMDS_DEINIT_OK
isc::log::Logger stat_cmds_logger("stat-cmds-hooks")
Definition: stat_cmds_log.h:17