Kea 3.0.3-git
isc::flex_id Namespace Reference

Functions

void clearConfiguration ()
 Clears stored configuration.
void parseAndStoreExpression (bool v6, const std::string &expr)
 Parses expression provided as text.
template<typename PacketType>
void retrieveFlexId (CalloutHandle &callout_handle, const Expression &expression, PacketType &pkt, std::vector< uint8_t > &id)
 Retrieves flexible identifier from the context or computes it.
void storeConfiguration (bool v6, const std::string &expr, const bool apply_to_leases, const bool ignore_iaid)
 Stores expression.

Variables

isc::log::Logger flex_id_logger ("flex-id-hooks")
 Flexible Identifier Logger.

Function Documentation

◆ clearConfiguration()

void isc::flex_id::clearConfiguration ( )

Clears stored configuration.

This is mostly useful between tests.

Definition at line 74 of file callouts.cc.

Referenced by load().

◆ parseAndStoreExpression()

void isc::flex_id::parseAndStoreExpression ( bool v6,
const std::string & expr )

Parses expression provided as text.

Parameters
memfile backend versionsIndicates if the expression refers to IPv6 or IPv4 case.
exprExpression in the textual form.

Definition at line 52 of file callouts.cc.

References isc::eval::EvalContext::expression_, isc_throw, isc::eval::EvalContext::PARSER_STRING, isc::eval::EvalContext::parseString(), isc::dhcp::Option::V4, and isc::dhcp::Option::V6.

Referenced by storeConfiguration().

Here is the call graph for this function:

◆ retrieveFlexId()

template<typename PacketType>
void isc::flex_id::retrieveFlexId ( CalloutHandle & callout_handle,
const Expression & expression,
PacketType & pkt,
std::vector< uint8_t > & id )

Retrieves flexible identifier from the context or computes it.

Parameters
callout_handleCallout handle.
expressionExpression to be applied for evaluation against the packet.
pktPacket against which expression should be evaluated.
[out]idReference to the storage into which the flexible identifier should be stored after evaluation.

Definition at line 88 of file callouts.cc.

References isc::log::DBGLVL_TRACE_BASIC, isc::dhcp::evaluateString(), FLEX_ID_EXPRESSION_EVALUATED, FLEX_ID_EXPRESSION_EVALUATED_NP, FLEX_ID_EXPRESSION_HEX, flex_id_logger, isc::hooks::CalloutHandle::getContext(), isc::util::str::isPrintable(), LOG_DEBUG, LOG_INFO, isc::hooks::CalloutHandle::setContext(), and isc::dhcp::IdentifierType< min_size, max_size >::toText().

Referenced by host4_identifier(), host6_identifier(), pkt4_receive(), and pkt6_receive().

Here is the call graph for this function:

◆ storeConfiguration()

void isc::flex_id::storeConfiguration ( bool v6,
const std::string & expr,
const bool apply_to_leases,
const bool ignore_iaid )

Stores expression.

Parameters
memfile backend versionsIndicates if the expression refers to IPv6 or IPv4 case.
exprExpression in textual form.
apply_to_leasesIndicates if flexible identifier should be used to replace client supplied client identifier or DUID.
ignore_iaidIndicates if IAID should be ignored.

Definition at line 64 of file callouts.cc.

References parseAndStoreExpression().

Referenced by load().

Here is the call graph for this function:

Variable Documentation

◆ flex_id_logger

isc::log::Logger isc::flex_id::flex_id_logger ( "flex-id-hooks" )

Flexible Identifier Logger.

Define the logger used to log messages. We could define it in multiple modules, but defining in a single module and linking to it saves time and space.

Definition at line 22 of file flex_id_log.h.

Referenced by load(), pkt4_receive(), pkt4_send(), pkt6_receive(), pkt6_send(), retrieveFlexId(), and unload().