![]() |
Kea 2.0.2
|
Flex Option implementation. More...
#include <flex_option.h>
Classes | |
| class | OptionConfig |
| Option configuration. More... | |
Public Types | |
| enum | Action { NONE , ADD , SUPERSEDE , REMOVE } |
| Action. More... | |
| typedef std::map< uint16_t, OptionConfigPtr > | OptionConfigMap |
| The type of the option config map. More... | |
| typedef boost::shared_ptr< OptionConfig > | OptionConfigPtr |
| The type of shared pointers to option config. More... | |
Public Member Functions | |
| FlexOptionImpl () | |
| Constructor. More... | |
| ~FlexOptionImpl () | |
| Destructor. More... | |
| void | configure (isc::data::ConstElementPtr options) |
| Configure the Flex Option implementation. More... | |
| const OptionConfigMap & | getOptionConfigMap () const |
| Get the option config map. More... | |
| void | logAction (Action action, uint16_t code, const std::string &value) const |
| Log the action. More... | |
| template<typename PktType > | |
| void | process (isc::dhcp::Option::Universe universe, PktType query, PktType response) |
| Process a query / response pair. More... | |
Protected Member Functions | |
| OptionConfigMap & | getMutableOptionConfigMap () |
| Get a mutable reference to the option config map. More... | |
Flex Option implementation.
The implementation can be divided into two parts:
Definition at line 34 of file flex_option.h.
| typedef std::map<uint16_t, OptionConfigPtr> isc::flex_option::FlexOptionImpl::OptionConfigMap |
The type of the option config map.
Definition at line 142 of file flex_option.h.
| typedef boost::shared_ptr<OptionConfig> isc::flex_option::FlexOptionImpl::OptionConfigPtr |
The type of shared pointers to option config.
Definition at line 139 of file flex_option.h.
Action.
Currently supported actions are:
| Enumerator | |
|---|---|
| NONE | |
| ADD | |
| SUPERSEDE | |
| REMOVE | |
Definition at line 43 of file flex_option.h.
| isc::flex_option::FlexOptionImpl::FlexOptionImpl | ( | ) |
Constructor.
Definition at line 85 of file flex_option.cc.
| isc::flex_option::FlexOptionImpl::~FlexOptionImpl | ( | ) |
Destructor.
Definition at line 88 of file flex_option.cc.
| void isc::flex_option::FlexOptionImpl::configure | ( | isc::data::ConstElementPtr | options | ) |
Configure the Flex Option implementation.
| options | The element with option config list. |
| BadValue | and similar exceptions on error. |
Definition at line 93 of file flex_option.cc.
References isc_throw.
|
inlineprotected |
Get a mutable reference to the option config map.
Definition at line 265 of file flex_option.h.
|
inline |
Get the option config map.
Definition at line 153 of file flex_option.h.
Referenced by process().
| void isc::flex_option::FlexOptionImpl::logAction | ( | Action | action, |
| uint16_t | code, | ||
| const std::string & | value | ||
| ) | const |
Log the action.
| action | The action. |
| code | The option code. |
| value | The option value ("" for remove). |
Definition at line 244 of file flex_option.cc.
References isc::log::DBGLVL_TRACE_BASIC, isc::flex_option::flex_option_logger, FLEX_OPTION_PROCESS_ADD, FLEX_OPTION_PROCESS_REMOVE, FLEX_OPTION_PROCESS_SUPERSEDE, isc::util::str::isPrintable(), LOG_DEBUG, NONE, REMOVE, and SUPERSEDE.
Referenced by process().
Here is the call graph for this function:
|
inline |
Process a query / response pair.
| PktType | The type of pointers to packets: Pkt4Ptr or Pkt6Ptr. |
| universe | The option universe: Option::V4 or Option::V6. |
| query | The query packet. |
| response | The response packet. |
Definition at line 170 of file flex_option.h.
References ADD, isc::dhcp::evaluateBool(), isc::dhcp::evaluateString(), getOptionConfigMap(), logAction(), NONE, REMOVE, SUPERSEDE, and isc::util::str::tokens().
Here is the call graph for this function: