35bool checkExpression(
bool v6,
const std::string& expr) {
40 }
catch (
const std::exception& ex) {
69 const std::string& expected_proc_name =
70 (v6 ?
"kea-dhcp6" :
"kea-dhcp4");
71 if (proc_name != expected_proc_name) {
73 <<
", expected " << expected_proc_name);
87 std::string expr = param->stringValue();
88 if (!expr.empty() && !checkExpression(v6, expr)) {
103 bool replace_client_id =
false;
113 replace_client_id = param_replace->boolValue();
117 bool ignore_iaid =
false;
128 ignore_iaid = param_ignore->boolValue();
140 }
catch (
const std::exception& ex) {
static std::string typeToName(Element::types type)
Returns the name of the given type as a string.
A generic exception that is thrown when an unexpected error condition occurs.
uint16_t getFamily() const
Returns address family.
static CfgMgr & instance()
returns a single instance of Configuration Manager
Evaluation context, an interface to the expression evaluation.
@ PARSER_STRING
expression is expected to evaluate to string
isc::data::ConstElementPtr getParameter(const std::string &name)
Returns configuration parameter for the library.
static std::string getProcName()
returns the process name This value is used as when forming the default PID file name
#define isc_throw(type, stream)
A shortcut macro to insert known values into exception arguments.
int multi_threading_compatible()
This function is called to retrieve the multi-threading compatibility.
int unload()
Called by the Hooks library manager when the library is unloaded.
int load(LibraryHandle &handle)
Called by the Hooks library manager when the library is loaded.
const isc::log::MessageID FLEX_ID_IGNORE_IAID_JSON_TYPE
const isc::log::MessageID FLEX_ID_UNLOAD
const isc::log::MessageID FLEX_ID_EXPRESSION_PARSE_FAILED
const isc::log::MessageID FLEX_ID_IGNORE_IAID_ENABLED
const isc::log::MessageID FLEX_ID_LOAD_ERROR
const isc::log::MessageID FLEX_ID_NO_IDENTIFIER_EXPRESSION
const isc::log::MessageID FLEX_ID_REPLACE_CLIENT_ID_JSON_TYPE
const isc::log::MessageID FLEX_ID_EXPRESSION_INVALID_JSON_TYPE
#define LOG_ERROR(LOGGER, MESSAGE)
Macro to conveniently test error output and log it.
#define LOG_INFO(LOGGER, MESSAGE)
Macro to conveniently test info output and log it.
#define LOG_WARN(LOGGER, MESSAGE)
Macro to conveniently test warn output and log it.
#define LOG_DEBUG(LOGGER, LEVEL, MESSAGE)
Macro to conveniently test debug output and log it.
boost::shared_ptr< const Element > ConstElementPtr
isc::log::Logger flex_id_logger("flex-id-hooks")
Flexible Identifier Logger.
void clearConfiguration()
Clears stored configuration.
void storeConfiguration(bool v6, const std::string &expr, const bool apply_to_leases, const bool ignore_iaid)
Stores expression.
const int DBGLVL_TRACE_BASIC
Trace basic operations.
Defines the logger used by the top-level component of kea-lfc.