Commit bd535576 authored by Francis Dupont's avatar Francis Dupont
Browse files

[4107] Added the 2 private options (now update the doc)

parent 8c1b9097
......@@ -223,6 +223,10 @@ extern const int dhcpv6_type_name_max;
// Taken from http://www.iana.org/assignments/enterprise-numbers
#define ENTERPRISE_ID_ISC 2495
/* DHCPv4-over-DHCPv6 (RFC 7341) inter-process communication */
#define ISC_V6_4O6_INTERFACE 60000
#define ISC_V6_4O6_SRC_ADDRESS 60001
/* Offsets into IA_*'s where Option spaces commence. */
#define IA_NA_OFFSET 12 /* IAID, T1, T2, all 4 octets each */
#define IA_TA_OFFSET 4 /* IAID only, 4 octets */
......
......@@ -110,6 +110,11 @@ LibDHCP::getVendorOption6Defs(const uint32_t vendor_id) {
initVendorOptsDocsis6();
}
if (vendor_id == ENTERPRISE_ID_ISC &&
vendor6_defs_.find(ENTERPRISE_ID_ISC) == vendor6_defs_.end()) {
initVendorOptsIsc6();
}
VendorOptionDefContainers::const_iterator def = vendor6_defs_.find(vendor_id);
if (def == vendor6_defs_.end()) {
// No such vendor-id space
......@@ -737,6 +742,12 @@ LibDHCP::initVendorOptsDocsis6() {
initOptionSpace(vendor6_defs_[VENDOR_ID_CABLE_LABS], DOCSIS3_V6_DEFS, DOCSIS3_V6_DEFS_SIZE);
}
void
LibDHCP::initVendorOptsIsc6() {
vendor6_defs_[ENTERPRISE_ID_ISC] = OptionDefContainer();
initOptionSpace(vendor6_defs_[ENTERPRISE_ID_ISC], ISC_V6_DEFS, ISC_V6_DEFS_SIZE);
}
void initOptionSpace(OptionDefContainer& defs,
const OptionDefParams* params,
size_t params_size) {
......
......@@ -281,6 +281,9 @@ private:
static void initVendorOptsDocsis6();
/// Initialize private DHCPv6 option definitions.
static void initVendorOptsIsc6();
/// pointers to factories that produce DHCPv6 options
static FactoryMap v4factories_;
......
......@@ -346,7 +346,7 @@ const OptionDefParams OPTION_DEF_PARAMS6[] = {
NO_RECORD_DEF, "" },
{ "dhcpv4-message", D6O_DHCPV4_MSG, OPT_BINARY_TYPE, false, NO_RECORD_DEF, "" },
{ "dhcp4o6-server-addr", D6O_DHCPV4_O_DHCPV6_SERVER, OPT_IPV6_ADDRESS_TYPE, true,
NO_RECORD_DEF, "" }
NO_RECORD_DEF, "" },
{ "bootfile-url", D6O_BOOTFILE_URL, OPT_STRING_TYPE, false, NO_RECORD_DEF, "" },
{ "bootfile-param", D6O_BOOTFILE_PARAM, OPT_BINARY_TYPE, false, NO_RECORD_DEF, "" },
{ "client-arch-type", D6O_CLIENT_ARCH_TYPE, OPT_UINT16_TYPE, true, NO_RECORD_DEF, "" },
......@@ -374,6 +374,14 @@ const OptionDefParams OPTION_DEF_PARAMS6[] = {
const int OPTION_DEF_PARAMS_SIZE6 =
sizeof(OPTION_DEF_PARAMS6) / sizeof(OPTION_DEF_PARAMS6[0]);
/// @brief Definitions of private DHCPv6 options
const OptionDefParams ISC_V6_DEFS[] = {
{ "4o6-interface", ISC_V6_4O6_INTERFACE, OPT_STRING_TYPE, false, NO_RECORD_DEF, "" },
{ "4o6-source-address", ISC_V6_4O6_SRC_ADDRESS, OPT_IPV6_ADDRESS_TYPE, false, NO_RECORD_DEF, "" }
};
const int ISC_V6_DEFS_SIZE = sizeof(ISC_V6_DEFS) / sizeof(OptionDefParams);
} // unnamed namespace
} // namespace dhcp
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment