]> git.ipfire.org Git - thirdparty/kea.git/commitdiff
[4107] Added the 2 private options (now update the doc)
authorFrancis Dupont <fdupont@isc.org>
Sat, 31 Oct 2015 05:35:23 +0000 (06:35 +0100)
committerFrancis Dupont <fdupont@isc.org>
Sat, 31 Oct 2015 05:35:23 +0000 (06:35 +0100)
src/lib/dhcp/dhcp6.h
src/lib/dhcp/libdhcp++.cc
src/lib/dhcp/libdhcp++.h
src/lib/dhcp/std_option_defs.h

index c18d53b9ec4324564d80330ba73abc265f0f6939..1380b1ae07f4df0b000374c45fb52e03642a1fd0 100644 (file)
@@ -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 */
index db484cce36634bad183349b054da084325e9d59f..069f09a04a2ca22712a621d59e71486c01a8ec54 100644 (file)
@@ -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) {
index 380e0aeacb2ddd75b0256b6cdb7b0b43bca7d39b..57fac075bfe5aa17bc24608778f433fc67677d88 100644 (file)
@@ -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_;
 
index d75048e9a715e9b738883b2464ff7335b23d52f2..da27a19408e16e960f788d48b4c614d955766739 100644 (file)
@@ -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