23 if (!option->contains(
"space")) {
30 if (!option->contains(
"type")) {
38 if (!option->contains(
"code")) {
49 string index = space->stringValue() +
"@" + name->stringValue();
50 uint16_t val =
static_cast<uint16_t
>(code->intValue());
51 codes.insert(pair<string, uint16_t>(index, val));
65 string index = space->stringValue() +
"@" + name->stringValue();
66 OptionCodes::const_iterator it = codes.find(index);
67 if (it == codes.end()) {
79 STANDARD_V4_OPTION_DEFINITIONS_SIZE);
81 LAST_RESORT_V4_OPTION_DEFINITIONS_SIZE);
87 STANDARD_V6_OPTION_DEFINITIONS_SIZE);
92 MAPE_V6_OPTION_DEFINITIONS,
93 MAPE_V6_OPTION_DEFINITIONS_SIZE);
95 MAPT_V6_OPTION_DEFINITIONS,
96 MAPT_V6_OPTION_DEFINITIONS_SIZE);
98 LW_V6_OPTION_DEFINITIONS,
99 LW_V6_OPTION_DEFINITIONS_SIZE);
101 V4V6_RULE_OPTION_DEFINITIONS,
102 V4V6_RULE_OPTION_DEFINITIONS_SIZE);
104 V4V6_BIND_OPTION_DEFINITIONS,
105 V4V6_BIND_OPTION_DEFINITIONS_SIZE);
107 ISC_V6_OPTION_DEFINITIONS,
108 ISC_V6_OPTION_DEFINITIONS_SIZE);
115 size_t params_size) {
116 for (
size_t i = 0; i < params_size; ++i) {
117 string index = space +
"@" + params[i].name;
118 codes.insert(pair<string, uint16_t>(index, params[i].code));
static ElementPtr create(const Position &pos=ZERO_POSITION())
static void setCode(isc::data::ElementPtr option, const OptionCodes &codes)
Set code from name and definitions.
static void initCodes(OptionCodes &codes, const std::string &space)
Initialize code map.
static void setSpace(isc::data::ElementPtr option, const std::string &space)
Set space.
static void checkType(isc::data::ConstElementPtr option)
Checks if type is specified in option definition.
static void initCodesInternal(OptionCodes &codes, const std::string &space, const isc::dhcp::OptionDefParams *params, size_t params_size)
Initialize code map from option definition parameters.
static void collect(isc::data::ConstElementPtr option, OptionCodes &codes)
Collect definition.
static void checkCode(isc::data::ConstElementPtr option)
Check if code is specified in option defintion.
#define isc_throw(type, stream)
A shortcut macro to insert known values into exception arguments.
boost::shared_ptr< const Element > ConstElementPtr
boost::shared_ptr< Element > ElementPtr
const OptionDefParams DOCSIS3_V4_OPTION_DEFINITIONS[]
Definitions of standard DHCPv4 options.
const int DOCSIS3_V6_OPTION_DEFINITIONS_SIZE
Number of option definitions defined.
const int DOCSIS3_V4_OPTION_DEFINITIONS_SIZE
Number of option definitions defined.
const OptionDefParams DOCSIS3_V6_OPTION_DEFINITIONS[]
Definitions of standard DHCPv6 options.
std::unordered_map< std::string, uint16_t > OptionCodes
Map for DHCP option definitions handling code and an index built from space and name.
Defines the logger used by the top-level component of kea-lfc.
#define V4V6_BIND_OPTION_SPACE
#define DHCP4_OPTION_SPACE
global std option spaces
#define V4V6_RULE_OPTION_SPACE
#define MAPE_V6_OPTION_SPACE
#define LW_V6_OPTION_SPACE
#define DHCP6_OPTION_SPACE
#define MAPT_V6_OPTION_SPACE
Parameters being used to make up an option definition.