Kea 2.7.5
|
Defines the load and unload hooks library functions. More...
#include <config.h>
#include <hooks/hooks.h>
#include <user_chk_log.h>
#include <user_registry.h>
#include <user_file.h>
#include <iostream>
#include <fstream>
#include <errno.h>
Go to the source code of this file.
Functions | |
int | load (LibraryHandle &) |
Called by the Hooks library manager when the library is loaded. | |
int | unload () |
Called by the Hooks library manager when the library is unloaded. | |
Variables | |
const char * | default_user4_id_str = "00000000" |
Text id used to identify the default IPv4 user in the registry The format is a string containing an even number of hex digits. | |
const char * | default_user6_id_str = "00000000" |
Text id used to identify the default IPv6 user in the registry The format is a string containing an even number of hex digits. | |
const char * | query_user_id_label = "query_user_id" |
Text label of user id in the inbound query in callout context. | |
const char * | registered_user_label = "registered_user" |
Text label of registered user pointer in callout context. | |
const char * | registry_fname = "/tmp/user_chk_registry.txt" |
User registry input file name. | |
std::fstream | user_chk_output |
Output filestream for recording user check outcomes. | |
const char * | user_chk_output_fname = "/tmp/user_chk_outcome.txt" |
User check outcome file name. | |
UserRegistryPtr | user_registry |
Pointer to the registry instance. | |
Defines the load and unload hooks library functions.
Definition in file load_unload.cc.
int load | ( | LibraryHandle & | ) |
Called by the Hooks library manager when the library is loaded.
Instantiates the UserRegistry and opens the outcome file. Failure in either results in a failed return code.
Definition at line 66 of file load_unload.cc.
References isc_throw, LOG_ERROR, registry_fname, USER_CHK_HOOK_LOAD_ERROR, user_chk::user_chk_logger, user_chk_output, user_chk_output_fname, and user_registry.
int unload | ( | ) |
Called by the Hooks library manager when the library is unloaded.
Destroys the UserRegistry and closes the outcome file.
Definition at line 117 of file load_unload.cc.
References LOG_ERROR, USER_CHK_HOOK_UNLOAD_ERROR, user_chk::user_chk_logger, user_chk_output, and user_registry.
const char* default_user4_id_str = "00000000" |
Text id used to identify the default IPv4 user in the registry The format is a string containing an even number of hex digits.
Text id used to identify the default IPv4 user in the registry.
This value is to look up the default IPv4 user in the user registry for the the purpose of retrieving default values for user options.
Definition at line 47 of file load_unload.cc.
Referenced by getDefaultUser4().
const char* default_user6_id_str = "00000000" |
Text id used to identify the default IPv6 user in the registry The format is a string containing an even number of hex digits.
Text id used to identify the default IPv6 user in the registry.
This value is to look up the default IPv6 user in the user registry for the the purpose of retrieving default values for user options.
Definition at line 53 of file load_unload.cc.
Referenced by getDefaultUser6().
const char* query_user_id_label = "query_user_id" |
Text label of user id in the inbound query in callout context.
Definition at line 38 of file load_unload.cc.
Referenced by pkt4_receive(), pkt4_send(), pkt6_receive(), and pkt6_send().
const char* registered_user_label = "registered_user" |
Text label of registered user pointer in callout context.
Definition at line 41 of file load_unload.cc.
Referenced by pkt4_receive(), pkt4_send(), pkt6_receive(), pkt6_send(), subnet4_select(), and subnet6_select().
const char* registry_fname = "/tmp/user_chk_registry.txt" |
User registry input file name.
Definition at line 31 of file load_unload.cc.
Referenced by load().
std::fstream user_chk_output |
Output filestream for recording user check outcomes.
Definition at line 27 of file load_unload.cc.
Referenced by generate_output_record(), load(), and unload().
const char* user_chk_output_fname = "/tmp/user_chk_outcome.txt" |
User check outcome file name.
Definition at line 35 of file load_unload.cc.
Referenced by load().
UserRegistryPtr user_registry |
Pointer to the registry instance.
Definition at line 24 of file load_unload.cc.
Referenced by getDefaultUser4(), getDefaultUser6(), load(), pkt4_receive(), pkt6_receive(), subnet4_select(), subnet6_select(), and unload().