27#include <boost/foreach.hpp>
28#include <boost/lexical_cast.hpp>
29#include <boost/shared_array.hpp>
30#include <boost/shared_ptr.hpp>
34#include <unordered_map>
50 { STANDARD_V4_OPTION_DEFINITIONS, STANDARD_V4_OPTION_DEFINITIONS_SIZE,
DHCP4_OPTION_SPACE },
51 { STANDARD_V6_OPTION_DEFINITIONS, STANDARD_V6_OPTION_DEFINITIONS_SIZE,
DHCP6_OPTION_SPACE },
61 { CABLELABS_CLIENT_CONF_DEFINITIONS, CABLELABS_CLIENT_CONF_DEFINITIONS_SIZE,
74map<unsigned short, Option::Factory*> LibDHCP::v4factories_;
77map<unsigned short, Option::Factory*> LibDHCP::v6factories_;
102bool LibDHCP::initialized_ = LibDHCP::initOptionDefs();
106 auto const& container = option_defs_.find(space);
107 if (container != option_defs_.end()) {
108 return (container->second);
123 }
else if (ENTERPRISE_ID_ISC == vendor_id) {
136 if (range.first != range.second) {
137 return (*range.first);
148 if (range.first != range.second) {
149 return (*range.first);
157 const string& name) {
166 if (range.first != range.second) {
167 return (*range.first);
175 const uint16_t code) {
187 if (range.first != range.second) {
188 return (*range.first);
199 if (range.first != range.second) {
200 return (*range.first);
211 if (range.first != range.second) {
212 return (*range.first);
220 return (runtime_option_defs_.getValue().getItems(space));
227 for (
auto const& name : option_space_names) {
229 for (
auto const& def : *container) {
234 runtime_option_defs_ = defs_copy;
239 runtime_option_defs_.reset();
244 runtime_option_defs_.revert();
249 runtime_option_defs_.commit();
257 if (range.first != range.second) {
258 return (*range.first);
269 if (range.first != range.second) {
270 return (*range.first);
289 ((code >= 224) && (code <= 254))));
296 FactoryMap::iterator it;
298 it = v4factories_.find(type);
299 if (it == v4factories_.end()) {
301 "for DHCP v4 option type " << type);
304 it = v6factories_.find(type);
305 if (it == v6factories_.end()) {
307 "for DHCPv6 option type " << type);
311 "Option::V4 or Option::V6");
313 return (it->second(u, type, buf));
322 size_t* relay_msg_offset ,
323 size_t* relay_msg_len ,
330 size_t length = buf.size();
331 size_t last_offset = 0;
350 while (offset < length) {
352 last_offset = offset;
355 if (offset + 4 > length) {
357 return (last_offset);
361 uint16_t opt_type =
readUint16(&buf[offset], 2);
364 uint16_t opt_len =
readUint16(&buf[offset], 2);
367 if (offset + opt_len > length) {
376 return (last_offset);
379 if (opt_type ==
D6O_RELAY_MSG && relay_msg_offset && relay_msg_len) {
381 *relay_msg_offset = offset;
382 *relay_msg_len = opt_len;
390 if (offset + 4 > length) {
394 return (last_offset);
399 buf.begin() + offset,
400 buf.begin() + offset + opt_len,
402 options.insert(std::make_pair(opt_type, vendor_opt));
419 range = idx.equal_range(opt_type);
420 num_defs = std::distance(range.first, range.second);
426 range = runtime_idx.equal_range(opt_type);
427 num_defs = std::distance(range.first, range.second);
434 " definitions for option type " << opt_type <<
435 " returned. Currently it is not supported to initialize"
436 " multiple option definitions for the same option code."
437 " This will be supported once support for option spaces"
439 }
else if (num_defs == 0) {
446 buf.begin() + offset,
447 buf.begin() + offset + opt_len));
454 opt = def->optionFactory(
Option::V6, opt_type,
455 buf.begin() + offset,
456 buf.begin() + offset + opt_len,
465 }
catch (
const std::exception& ex) {
467 <<
", opt_len: " <<
static_cast<uint16_t
>(opt_len)
468 <<
", error: " << ex.what());
474 options.insert(std::make_pair(opt_type, opt));
480 last_offset = offset;
481 return (last_offset);
489 size_t last_offset = 0;
506 bool flex_pad = (check && (runtime_idx.count(
DHO_PAD) == 0));
507 bool flex_end = (check && (runtime_idx.count(
DHO_END) == 0));
513 vector<uint32_t> count(256, 0);
514 while (offset < buf.size()) {
516 uint8_t opt_type = buf[offset++];
521 if ((opt_type ==
DHO_END) && (space_is_dhcp4 || flex_end)) {
530 if ((opt_type ==
DHO_PAD) && (space_is_dhcp4 || flex_pad)) {
534 if (offset + 1 > buf.size()) {
539 uint8_t opt_len = buf[offset++];
540 if (offset + opt_len > buf.size()) {
546 if (space_is_dhcp4 && opt_len == 0 && opt_type ==
DHO_HOST_NAME) {
553 count[opt_type] += 1;
557 unordered_map<uint8_t, pair<OptionBuffer, uint32_t>> fused;
561 while (offset < buf.size()) {
563 last_offset = offset;
566 uint8_t opt_type = buf[offset++];
571 if ((opt_type ==
DHO_END) && (space_is_dhcp4 || flex_end)) {
575 return (last_offset);
582 if ((opt_type ==
DHO_PAD) && (space_is_dhcp4 || flex_pad)) {
586 if (offset + 1 > buf.size()) {
594 return (last_offset);
597 uint8_t opt_len = buf[offset++];
598 if (offset + opt_len > buf.size()) {
603 return (last_offset);
611 if (space_is_dhcp4 && opt_len == 0 && opt_type ==
DHO_HOST_NAME) {
615 OptionBuffer obuf(buf.begin() + offset, buf.begin() + offset + opt_len);
619 uint32_t opt_count = count[opt_type];
622 previous.insert(previous.end(), obuf.begin(), obuf.end());
623 uint32_t& already_seen = fused[opt_type].second;
625 if (already_seen != opt_count) {
645 range = idx.equal_range(opt_type);
646 num_defs = std::distance(range.first, range.second);
652 range = runtime_idx.equal_range(opt_type);
653 num_defs = std::distance(range.first, range.second);
661 for (
auto const& existing : deferred) {
662 if (existing == opt_type) {
668 deferred.push_back(opt_type);
672 if (space_is_dhcp4 &&
682 " definitions for option type " <<
683 static_cast<int>(opt_type) <<
684 " returned. Currently it is not supported to initialize"
685 " multiple option definitions for the same option code."
686 " This will be supported once support for option spaces"
688 }
else if (num_defs == 0) {
696 opt = def->optionFactory(
Option::V4, opt_type, obuf);
704 }
catch (
const std::exception& ex) {
706 <<
", opt_len: " <<
static_cast<uint16_t
>(opt_len)
707 <<
", error: " << ex.
what());
713 options.insert(std::make_pair(opt_type, opt));
716 last_offset = offset;
717 return (last_offset);
731 if ((exp_len > 0) && (opt_len > exp_len) && !def->getArrayType() &&
732 def->getEncapsulatedSpace().empty()) {
734 <<
static_cast<uint16_t
>(exp_len) <<
" for data type "
745 typedef vector<OpaqueDataTuple> TuplesCollection;
746 map<uint32_t, TuplesCollection> vendors_tuples;
748 BOOST_FOREACH(
auto const& it, range) {
750 auto const&
data = it.second->getData();
752 while ((size =
data.size() - offset) != 0) {
753 if (size <
sizeof(uint32_t)) {
756 "Truncated vendor-class information option"
757 <<
", length=" << size);
765 vendors_tuples[vendor_id].push_back(tuple);
766 offset += tuple.getTotalLength();
770 }
catch (
const isc::Exception&) {
776 if (vendors_tuples.empty()) {
782 for (
auto const& vendor : vendors_tuples) {
783 if (vendor.second.empty()) {
788 for (
size_t i = 0; i < vendor.second.size(); ++i) {
790 vendor_opt->setTuple(0, vendor.second[0]);
792 vendor_opt->addTuple(vendor.second[i]);
805 map<uint32_t, OptionCollection> vendors_data;
807 BOOST_FOREACH(
auto const& it, range) {
809 auto const& data = it.second->getData();
811 while ((size = data.size() - offset) != 0) {
812 if (size <
sizeof(uint32_t)) {
815 "Truncated vendor-specific information option"
816 <<
", length=" << size);
818 uint32_t vendor_id =
readUint32(&data[offset], data.size());
820 const OptionBuffer vendor_buffer(data.begin() + offset, data.end());
823 vendors_data[vendor_id]);
827 }
catch (
const isc::Exception&) {
833 if (vendors_data.empty()) {
839 for (
auto const& vendor : vendors_data) {
841 for (
auto const& option : vendor.second) {
842 vendor_opt->addOption(option.second);
854 extendVivco(options);
855 extendVivso(options);
865 "Too deep recursion in unpacking vendor options");
868 size_t length = buf.size();
879 idx = &(option_defs->get<1>());
884 while (offset < length) {
885 if (offset + 4 > length) {
887 "Vendor option parse failed: truncated header");
890 uint16_t opt_type =
readUint16(&buf[offset], 2);
893 uint16_t opt_len =
readUint16(&buf[offset], 2);
896 if (offset + opt_len > length) {
898 "Vendor option parse failed. Tried to parse "
899 << offset + opt_len <<
" bytes from " << length
900 <<
"-byte long buffer.");
914 idx->equal_range(opt_type);
917 size_t num_defs = std::distance(range.first, range.second);
923 " definitions for option type " << opt_type <<
924 " returned. Currently it is not supported to"
925 " initialize multiple option definitions for the"
926 " same option code. This will be supported once"
927 " support for option spaces is implemented");
928 }
else if (num_defs == 1) {
933 opt = def->optionFactory(
Option::V6, opt_type,
934 buf.begin() + offset,
935 buf.begin() + offset + opt_len,
947 buf.begin() + offset,
948 buf.begin() + offset + opt_len));
953 options.insert(std::make_pair(opt_type, opt));
973 idx = &(option_defs->get<1>());
978 while (offset < buf.size()) {
982 uint8_t data_len = buf[offset++];
984 if (offset + data_len > buf.size()) {
987 "Attempt to parse truncated vendor option");
990 uint8_t offset_end = offset + data_len;
993 while (offset < offset_end) {
994 uint8_t opt_type = buf[offset++];
998 if (offset + 1 > offset_end) {
1003 "Attempt to parse truncated vendor option "
1004 <<
static_cast<int>(opt_type));
1007 uint8_t opt_len = buf[offset++];
1008 if (offset + opt_len > offset_end) {
1010 "Option parse failed. Tried to parse "
1011 << offset + opt_len <<
" bytes from " << buf.size()
1012 <<
"-byte long buffer.");
1025 idx->equal_range(opt_type);
1028 size_t num_defs = std::distance(range.first, range.second);
1034 " option definitions for option type "
1035 << opt_type <<
" returned. Currently it is"
1036 " not supported to initialize multiple option"
1037 " definitions for the same option code."
1038 " This will be supported once support for"
1039 " option spaces is implemented");
1040 }
else if (num_defs == 1) {
1045 opt = def->optionFactory(
Option::V4, opt_type,
1046 buf.begin() + offset,
1047 buf.begin() + offset + opt_len);
1053 buf.begin() + offset,
1054 buf.begin() + offset + opt_len));
1057 options.insert(std::make_pair(opt_type, opt));
1069 bool top,
bool check) {
1079 if (x != options.end()) {
1080 x->second->pack(buf, check);
1084 for (
auto const& option : options) {
1086 switch (option.first) {
1093 end = option.second;
1096 option.second->pack(buf, check);
1102 for (
auto const& option : agent) {
1103 option.second->pack(buf, check);
1108 end->pack(buf, check);
1116 bool result =
false;
1122 if (tries == std::numeric_limits<uint16_t>::max()) {
1124 << tries <<
" times.");
1131 for (
auto const& option : options) {
1136 bool updated =
false;
1137 bool found_suboptions =
false;
1152 if (sub_options.size()) {
1156 used + candidate->getHeaderLen());
1171 if (found_suboptions || candidate->len() > (255 - used)) {
1174 scoped_options.push_back(candidate_scoped_options);
1177 copy.erase(option.first);
1187 for (
auto const& sub_option : candidate->getMutableOptions()) {
1189 candidate->getType(),
1191 data_sub_option->addOption(sub_option.second);
1192 distinct_options.insert(make_pair(candidate->getType(), data_sub_option));
1201 candidate->getType(),
1203 candidate->getData().end())));
1205 data_option->pack(buf,
false);
1206 uint32_t header_len = candidate->getHeaderLen();
1208 if (used >= 255 - header_len) {
1210 << candidate->getType() <<
" after parent already used "
1215 uint8_t len = 255 - header_len - used;
1220 uint32_t size = buf.
getLength() - header_len;
1238 copy.erase(option.first);
1241 uint32_t offset = 0;
1244 for (; offset != size;) {
1248 if (size - offset < len) {
1249 len = size - offset;
1256 candidate->getType(),
1258 data + offset + len)));
1263 copy.insert(make_pair(candidate->getType(), new_option));
1265 }
else if ((candidate->len() > (255 - used)) && size) {
1270 copy.insert(make_pair(candidate->getType(), data_option));
1275 copy.insert(distinct_options.begin(), distinct_options.end());
1295 for (
auto const& option : options) {
1296 option.second->pack(buf);
1302 pair<OptionCollection::const_iterator, OptionCollection::const_iterator>
1304 if (range.first == range.second) {
1308 static_cast<void>(options.erase(range.first, range.second));
1310 for (
auto const& opt : ntp_servers) {
1311 for (
auto const& sub : opt.second->getOptions()) {
1313 new_option->addOption(sub.second);
1325 if (v6factories_.find(opt_type) != v6factories_.end()) {
1327 <<
"for option type " << opt_type);
1329 v6factories_[opt_type] = factory;
1336 if (opt_type == 0) {
1342 if (opt_type > 254) {
1345 if (v4factories_.find(opt_type) != v4factories_.end()) {
1347 <<
"for option type " << opt_type);
1349 v4factories_[opt_type] = factory;
1360LibDHCP::initOptionDefs() {
1361 for (uint32_t i = 0; OPTION_DEF_PARAMS[i].optionDefParams; ++i) {
1362 string space = OPTION_DEF_PARAMS[i].space;
1365 OPTION_DEF_PARAMS[i].optionDefParams,
1366 OPTION_DEF_PARAMS[i].size);
1390 if ((option_space.size() < 8) || (option_space.substr(0,7) !=
"vendor-")) {
1397 string x = option_space.substr(7);
1399 check = boost::lexical_cast<int64_t>(x);
1400 }
catch (
const boost::bad_lexical_cast &) {
1404 if ((check < 0) || (check > std::numeric_limits<uint32_t>::max())) {
1409 return (
static_cast<uint32_t
>(check));
1414 size_t params_size) {
1424 for (
size_t i = 0; i < params_size; ++i) {
1425 string encapsulates(params[i].encapsulates);
1426 if (!encapsulates.empty() && params[i].
array) {
1428 <<
"option with code '" << params[i].code
1429 <<
"' may not encapsulate option space '"
1430 << encapsulates <<
"' because the definition"
1431 <<
" indicates that this option comprises an array"
1439 if (encapsulates.empty()) {
1452 params[i].encapsulates));
1456 for (
size_t rec = 0; rec < params[i].
records_size; ++rec) {
1457 definition->addRecordField(params[i].records[rec]);
1461 definition->validate();
1473 static_cast<void>(defs->push_back(definition));
1481 static bool check_once(
true);
1499 static bool check_once(
true);
1517 static bool check_once(
true);
1535 static bool check_once(
true);
1553 static bool check_once(
true);
1571 static bool check_once(
true);
1589 static bool check_once(
true);
1607 static bool check_once(
true);
1625 static bool check_once(
true);
1643 static bool check_once(
true);
1661 static bool check_once(
true);
1679 static bool check_once(
true);
1697 static bool check_once(
true);
1715 static bool check_once(
true);
A generic exception that is thrown if a parameter given to a method is considered invalid in that con...
This is a base class for exceptions thrown from the DNS library module.
virtual const char * what() const
Returns a C-style character string of the cause of the exception.
A generic exception that is thrown when an unexpected error condition occurs.
static size_t unpackOptions4(const OptionBuffer &buf, const std::string &option_space, isc::dhcp::OptionCollection &options, std::list< uint16_t > &deferred, bool flexible_pad_end=false)
Parses provided buffer as DHCPv4 options and creates Option objects.
static void OptionFactoryRegister(Option::Universe u, uint16_t type, Option::Factory *factory)
Registers factory method that produces options of specific option types.
static const OptionDefinition & D6O_LQ_RELAY_DATA_DEF()
Get definition of D6O_LQ_RELAY_DATA option.
static const OptionDefinition & D6O_NTP_SERVER_DEF()
Get definition of D6O_NTP_SERVER option.
static const OptionDefinition & D6O_RSOO_DEF()
Get definition of D6O_RSOO option.
static size_t MAX_RECURSION_LEVEL
Maximum level of recursion unpacking options.
static const OptionDefContainerPtr getOptionDefs(const std::string &space)
Returns collection of option definitions.
static void splitNtpServerOptions6(isc::dhcp::OptionCollection &options)
Split NTP server option to one suboption per instance.
static bool shouldDeferOptionUnpack(const std::string &space, const uint16_t code)
Checks if an option unpacking has to be deferred.
static isc::dhcp::OptionPtr optionFactory(isc::dhcp::Option::Universe u, uint16_t type, const OptionBuffer &buf)
Factory function to create instance of option.
static void setRuntimeOptionDefs(const OptionDefSpaceContainer &defs)
Copies option definitions created at runtime.
static OptionDefinitionPtr getOptionDef(const std::string &space, const uint16_t code)
Return the first option definition matching a particular option code.
static OptionDefinitionPtr getVendorOptionDef(const Option::Universe u, const uint32_t vendor_id, const uint16_t code)
Returns vendor option definition for a given vendor-id and code.
static size_t unpackOptions6(const OptionBuffer &buf, const std::string &option_space, isc::dhcp::OptionCollection &options, size_t *relay_msg_offset=0, size_t *relay_msg_len=0, size_t rec_level=0)
Parses provided buffer as DHCPv6 options and creates Option objects.
static OptionDefContainerPtr getLastResortOptionDefs(const std::string &space)
Returns last resort option definitions for specified option space name.
static const OptionDefinition & D6O_LQ_QUERY_DEF()
Get definition of D6O_LQ_QUERY option.
static OptionDefContainerPtr getRuntimeOptionDefs(const std::string &space)
Returns runtime (non-standard) option definitions for specified option space name.
static void commitRuntimeOptionDefs()
Commits runtime option definitions.
static void clearRuntimeOptionDefs()
Removes runtime option definitions.
static const OptionDefinition & D6O_IAADDR_DEF()
Get definition of D6O_IAADDR option.
static void extendVendorOptions4(isc::dhcp::OptionCollection &options)
Extend vendor options from fused options in multiple OptionVendor or OptionVendorClass options and ad...
static const OptionDefinition & D6O_CLIENT_DATA_DEF()
Get definition of D6O_CLIENT_DATA option.
static void sanityCheckScalarLength(const OptionDefinitionPtr &def, uint16_t opt_len)
Validates a scalar option's length against it's defined length.
static void packOptions4(isc::util::OutputBuffer &buf, const isc::dhcp::OptionCollection &options, bool top=false, bool check=true)
Stores DHCPv4 options in a buffer.
static size_t unpackVendorOptions6(const uint32_t vendor_id, const OptionBuffer &buf, isc::dhcp::OptionCollection &options, size_t rec_level=0)
Parses provided buffer as DHCPv6 vendor options and creates Option objects.
static bool splitOptions4(isc::dhcp::OptionCollection &options, ScopedOptionsCopyContainer &scopedOptions, uint32_t used=0)
Split long options in multiple options with the same option code (RFC3396).
static const OptionDefinition & DHO_DHCP_REQUESTED_ADDRESS_DEF()
Get definition of DHO_DHCP_REQUESTED_ADDRESS option.
static const OptionDefinition & D6O_BOOTFILE_URL_DEF()
Get definition of D6O_BOOTFILE_URL option.
static const OptionDefinition & DHO_DHCP_SERVER_IDENTIFIER_DEF()
Get definition of DHO_DHCP_SERVER_IDENTIFIER option.
static const OptionDefinition & DHO_SUBNET_SELECTION_DEF()
Get definition of DHO_SUBNET_SELECTION option.
static void revertRuntimeOptionDefs()
Reverts uncommitted changes to runtime option definitions.
static const OptionDefinition & DHO_DOMAIN_SEARCH_DEF()
Get definition of DHO_DOMAIN_SEARCH option.
static const OptionDefContainerPtr getVendorOptionDefs(Option::Universe u, const uint32_t vendor_id)
Returns option definitions for given universe and vendor.
static const OptionDefinition & D6O_CLIENT_FQDN_DEF()
Get definition of D6O_CLIENT_FQDN option.
static const OptionDefinition & DHO_DHCP_AGENT_OPTIONS_DEF()
Get definition of DHO_DHCP_AGENT_OPTIONS option.
static uint32_t optionSpaceToVendorId(const std::string &option_space)
Converts option space name to vendor id.
static OptionDefinitionPtr getRuntimeOptionDef(const std::string &space, const uint16_t code)
Returns runtime (non-standard) option definition by space and option code.
static void packOptions6(isc::util::OutputBuffer &buf, const isc::dhcp::OptionCollection &options)
Stores DHCPv6 options in a buffer.
static const OptionDefinition & DHO_STATUS_CODE_DEF()
Get definition of DHO_STATUS_CODE option.
static OptionDefinitionPtr getLastResortOptionDef(const std::string &space, const uint16_t code)
Returns last resort option definition by space and option code.
static size_t unpackVendorOptions4(const uint32_t vendor_id, const OptionBuffer &buf, isc::dhcp::OptionCollection &options)
Parses provided buffer as DHCPv4 vendor options and creates Option objects.
Exception to be thrown when the operation on OpaqueDataTuple object results in an error.
Represents a single instance of the opaque data preceded by length.
Option with defined data fields represented as buffers that can be accessed using data field index.
static const std::string & getDataTypeName(const OptionDataType data_type)
Return option data type name from the data type enumerator.
static int getDataTypeLen(const OptionDataType data_type)
Get data type buffer length.
Class of option definition space container.
void addItem(const OptionDefinitionPtr &def)
Adds a new option definition to the container.
Base class representing a DHCP option definition.
Wrapper exception thrown by unpackOptionsX functions to add option type and len to the underlying err...
std::list< Selector > getOptionSpaceNames() const
Get a list of existing option spaces.
ItemsContainerPtr getItems(const Selector &option_space) const
Get all items for the particular option space.
This class encapsulates DHCPv6 Vendor Class and DHCPv4 V-I Vendor Class options.
This class represents vendor-specific information option.
static bool lenient_parsing_
Governs whether options should be parsed less strictly.
Universe
defines option universe DHCPv4 or DHCPv6
OptionPtr Factory(Option::Universe u, uint16_t type, const OptionBuffer &buf)
a factory function prototype
RAII object enabling duplication of the stored options and restoring the original options on destruct...
Exception thrown during option unpacking This exception is thrown when an error has occurred,...
Exception thrown during option unpacking This exception is thrown when an error has occurred unpackin...
The OutputBuffer class is a buffer abstraction for manipulating mutable data.
const uint8_t * getData() const
Return a pointer to the head of the data stored in the buffer.
size_t getLength() const
Return the length of data written in the buffer.
This class implements set/commit mechanism for a single object.
#define DOCSIS3_V6_OPTION_SPACE
#define VENDOR_ID_CABLE_LABS
#define DOCSIS3_V4_OPTION_SPACE
global docsis3 option spaces
#define isc_throw(type, stream)
A shortcut macro to insert known values into exception arguments.
#define isc_throw_assert(expr)
Replacement for assert() that throws if the expression is false.
void initOptionSpace(OptionDefContainerPtr &defs, const OptionDefParams *params, size_t params_size)
const OptionDefContainerPtr null_option_def_container_(new OptionDefContainer())
ElementPtr copy(ConstElementPtr from, unsigned level)
Copy the data up to a nesting level.
boost::shared_ptr< OptionVendor > OptionVendorPtr
Pointer to a vendor option.
@ DHO_DHCP_SERVER_IDENTIFIER
@ DHO_DHCP_REQUESTED_ADDRESS
@ DHO_VENDOR_ENCAPSULATED_OPTIONS
std::multimap< unsigned int, OptionPtr > OptionCollection
A collection of DHCP (v4 or v6) options.
const OptionDefParams DOCSIS3_V4_OPTION_DEFINITIONS[]
Definitions of standard DHCPv4 options.
const char * DOCSIS3_CLASS_EROUTER
The class as specified in vendor-class option by the devices.
boost::shared_ptr< OptionDefinition > OptionDefinitionPtr
Pointer to option definition object.
const int DOCSIS3_V6_OPTION_DEFINITIONS_SIZE
Number of option definitions defined.
std::pair< OptionDefContainerNameIndex::const_iterator, OptionDefContainerNameIndex::const_iterator > OptionDefContainerNameRange
Pair of iterators to represent the range of options definitions having the same option name.
const char * DOCSIS3_CLASS_MODEM
DOCSIS3.0 compatible cable modem.
boost::shared_ptr< OptionVendorClass > OptionVendorClassPtr
Defines a pointer to the OptionVendorClass.
std::map< std::string, OptionDefContainerPtr > OptionDefContainers
Container that holds option definitions for various option spaces.
std::shared_ptr< ScopedSubOptionsCopy > ScopedOptionsCopyPtr
A pointer to a ScopedSubOptionsCopy object.
OptionDefContainer::nth_index< 2 >::type OptionDefContainerNameIndex
Type of the index #2 - option name.
std::vector< uint8_t > OptionBuffer
buffer types used in DHCP code.
std::pair< OptionDefContainerTypeIndex::const_iterator, OptionDefContainerTypeIndex::const_iterator > OptionDefContainerTypeRange
Pair of iterators to represent the range of options definitions having the same option type value.
boost::multi_index_container< OptionDefinitionPtr, boost::multi_index::indexed_by< boost::multi_index::sequenced<>, boost::multi_index::hashed_non_unique< boost::multi_index::const_mem_fun< OptionDefinition, uint16_t, &OptionDefinition::getCode > >, boost::multi_index::hashed_non_unique< boost::multi_index::const_mem_fun< OptionDefinition, std::string, &OptionDefinition::getName > >, boost::multi_index::ordered_non_unique< boost::multi_index::const_mem_fun< data::BaseStampedElement, boost::posix_time::ptime, &data::StampedElement::getModificationTime > >, boost::multi_index::hashed_non_unique< boost::multi_index::tag< OptionIdIndexTag >, boost::multi_index::const_mem_fun< data::BaseStampedElement, uint64_t, &data::BaseStampedElement::getId > > > > OptionDefContainer
Multi index container for DHCP option definitions.
const int DOCSIS3_V4_OPTION_DEFINITIONS_SIZE
Number of option definitions defined.
OptionDefContainer::nth_index< 1 >::type OptionDefContainerTypeIndex
Type of the index #1 - option type.
boost::shared_ptr< Option > OptionPtr
std::vector< ScopedOptionsCopyPtr > ScopedOptionsCopyContainer
A container of ScopedOptionsCopyPtr objects.
const OptionDefParams DOCSIS3_V6_OPTION_DEFINITIONS[]
Definitions of standard DHCPv6 options.
boost::shared_ptr< OptionDefContainer > OptionDefContainerPtr
Pointer to an option definition container.
uint16_t readUint16(void const *const buffer, size_t const length)
uint16_t wrapper over readUint.
uint32_t readUint32(void const *const buffer, size_t const length)
uint32_t wrapper over readUint.
Defines the logger used by the top-level component of kea-lfc.
#define V4V6_BIND_OPTION_SPACE
#define LAST_RESORT_V4_OPTION_SPACE
#define DHCP4_OPTION_SPACE
global std option spaces
#define ISC_V6_OPTION_SPACE
#define V6_NTP_SERVER_SPACE
#define V4V6_RULE_OPTION_SPACE
#define MAPE_V6_OPTION_SPACE
#define DHCP_AGENT_OPTION_SPACE
encapsulated option spaces
#define LW_V6_OPTION_SPACE
#define DHCP6_OPTION_SPACE
#define MAPT_V6_OPTION_SPACE
#define CABLELABS_CLIENT_CONF_SPACE
Encapsulation of option definition parameters and the structure size.
Parameters being used to make up an option definition.