]> git.ipfire.org Git - thirdparty/kea.git/commitdiff
[#1025] Got rid of vendor-opts-space
authorFrancis Dupont <fdupont@isc.org>
Thu, 3 Sep 2020 13:58:31 +0000 (15:58 +0200)
committerFrancis Dupont <fdupont@isc.org>
Mon, 21 Sep 2020 10:52:46 +0000 (12:52 +0200)
doc/sphinx/arm/dhcp6-srv.rst
src/bin/dhcp4/tests/config_parser_unittest.cc
src/bin/dhcp6/tests/config_parser_unittest.cc
src/lib/dhcp/std_option_defs.h
src/lib/dhcp/tests/libdhcp++_unittest.cc

index c9530d8cfb64488951aa944102cfc03941277e45..92e18fc4de8e97d057c2f13c50788a6c90f6515c 100644 (file)
@@ -1853,15 +1853,13 @@ unsigned integers.
 DHCPv6 Vendor-Specific Options
 ------------------------------
 
-Currently there are two option spaces defined for the DHCPv6 daemon:
-"dhcp6" (for the top-level DHCPv6 options) and "vendor-opts-space", which is
-empty by default but in which options can be defined. Those options are
-carried in the Vendor-Specific Information option (code 17). The
-following examples show how to define an option "foo" with code 1 that
-consists of an IPv6 address, an unsigned 16-bit integer, and a string.
-The "foo" option is conveyed in a Vendor-Specific Information option,
-which comprises a single uint32 value that is set to "12345". The
-sub-option "foo" follows the data field holding this value.
+Vendor options in DHCPv6 are carried in the Vendor-Specific
+Information option (code 17). The following examples show how to
+define an option "foo" with code 1 that consists of an IPv6 address,
+an unsigned 16-bit integer, and a string.  The "foo" option is
+conveyed in a Vendor-Specific Information option, which comprises a
+single uint32 value that is set to "12345". The sub-option "foo"
+follows the data field holding this value.
 
 The first step is to define the format of the option:
 
@@ -1872,7 +1870,7 @@ The first step is to define the format of the option:
            {
                "name": "foo",
                "code": 1,
-               "space": "vendor-opts-space",
+               "space": "vendor-12345",
                "type": "record",
                "array": false,
                "record-types": "ipv6-address, uint16, string",
@@ -1882,7 +1880,7 @@ The first step is to define the format of the option:
        ...
    }
 
-(Note that the option space is set to ``vendor-opts-space``.) Once the
+(Note that the option space is set to ``vendor-12345``.) Once the
 option format is defined, the next step is to define actual values for
 that option:
 
@@ -1892,7 +1890,7 @@ that option:
        "option-data": [
            {
                "name": "foo",
-               "space": "vendor-opts-space",
+               "space": "vendor-12345",
                "data": "2001:db8:1::10, 123, Hello World"
            },
            ...
@@ -1931,6 +1929,9 @@ Alternatively, the option can be specified using its code.
        ...
    }
 
+A common configuration is to set the always-send flag to true so the
+vendor option is sent even when the client did not mention it in the query.
+
 .. _dhcp6-option-spaces:
 
 Nested DHCPv6 Options (Custom Option Spaces)
index ec9fe2c6a4934ccf992728eff45da169622d167a..fc1a52d10c782d328a8dca2e7ffe66779457c93d 100644 (file)
@@ -3829,7 +3829,7 @@ TEST_F(Dhcp4ParserTest, stdOptionDataEncapsulate) {
     // standard option #17. This option comprises an enterprise
     // number and sub options. By convention (introduced in
     // std_option_defs.h) option named 'vendor-opts'
-    // encapsulates the option space named 'vendor-opts-space'.
+    // encapsulates the option space named 'vendor-encapsulated-options-space'.
     // We add our dummy options to this option space and thus
     // they should be included as sub-options in the 'vendor-opts'
     // option.
index 54d2d53778be9a87899d65ed6bcaccc07c0669b4..f68c2e3251029279c3b8c9ea2b0ddd2f156fcdda 100644 (file)
@@ -4103,25 +4103,25 @@ TEST_F(Dhcp6ParserTest, DISABLED_stdOptionDataEncapsulate) {
         "\"renew-timer\": 1000,"
         "\"option-data\": [ {"
         "    \"name\": \"foo\","
-        "    \"space\": \"vendor-opts-space\","
+        "    \"space\": \"a-vendor-space\","
         "    \"data\": \"1234\""
         " },"
         " {"
         "    \"name\": \"foo2\","
-        "    \"space\": \"vendor-opts-space\","
+        "    \"space\": \"a-vendor-space\","
         "    \"data\": \"192.168.2.1\""
         " } ],"
         "\"option-def\": [ {"
         "    \"name\": \"foo\","
         "    \"code\": 110,"
         "    \"type\": \"uint32\","
-        "    \"space\": \"vendor-opts-space\""
+        "    \"space\": \"a-vendor-space\""
         " },"
         " {"
         "    \"name\": \"foo2\","
         "    \"code\": 111,"
         "    \"type\": \"ipv4-address\","
-        "    \"space\": \"vendor-opts-space\""
+        "    \"space\": \"a-vendor-space\""
         " } ]"
         "}";
 
@@ -4140,7 +4140,7 @@ TEST_F(Dhcp6ParserTest, DISABLED_stdOptionDataEncapsulate) {
     // standard option #17. This option comprises an enterprise
     // number and sub options. By convention (introduced in
     // std_option_defs.h) option named 'vendor-opts'
-    // encapsulates the option space named 'vendor-opts-space'.
+    // encapsulates the option space named 'vendor-<vendor-id>'.
     // We add our dummy options to this option space and thus
     // they should be included as sub-options in the 'vendor-opts'
     // option.
@@ -4153,25 +4153,25 @@ TEST_F(Dhcp6ParserTest, DISABLED_stdOptionDataEncapsulate) {
         " },"
         " {"
         "    \"name\": \"foo\","
-        "    \"space\": \"vendor-opts-space\","
+        "    \"space\": \"vendor-1234\","
         "    \"data\": \"1234\""
         " },"
         " {"
         "    \"name\": \"foo2\","
-        "    \"space\": \"vendor-opts-space\","
+        "    \"space\": \"vendor-1234\","
         "    \"data\": \"192.168.2.1\""
         " } ],"
         "\"option-def\": [ {"
         "    \"name\": \"foo\","
         "    \"code\": 110,"
         "    \"type\": \"uint32\","
-        "    \"space\": \"vendor-opts-space\""
+        "    \"space\": \"vendor-1234\""
         " },"
         " {"
         "    \"name\": \"foo2\","
         "    \"code\": 111,"
         "    \"type\": \"ipv4-address\","
-        "    \"space\": \"vendor-opts-space\""
+        "    \"space\": \"vendor-1234\""
         " } ],"
         "\"subnet6\": [ { "
         "    \"pools\": [ { \"pool\": \"2001:db8:1::/80\" } ],"
@@ -4263,25 +4263,25 @@ buildHooksLibrariesConfig(const std::vector<std::string>& libraries,
         "\"renew-timer\": 1000,"
         "\"option-data\": [ {"
         "    \"name\": \"foo\","
-        "    \"space\": \"vendor-opts-space\","
+        "    \"space\": \"a-vendor-space\","
         "    \"data\": \"1234\""
         " },"
         " {"
         "    \"name\": \"foo2\","
-        "    \"space\": \"vendor-opts-space\","
+        "    \"space\": \"a-vendor-space\","
         "    \"data\": \"192.168.2.1\""
         " } ],"
         "\"option-def\": [ {"
         "    \"name\": \"foo\","
         "    \"code\": 110,"
         "    \"type\": \"uint32\","
-        "    \"space\": \"vendor-opts-space\""
+        "    \"space\": \"a-vendor-space\""
         " },"
         " {"
         "    \"name\": \"foo2\","
         "    \"code\": 111,"
         "    \"type\": \"ipv4-address\","
-        "    \"space\": \"vendor-opts-space\""
+        "    \"space\": \"a-vendor-space\""
         " } ]");
 
     if (multi_threading) {
index 9c08a1d215694fa9ff22c6cfcf80e3019df2f909..8244f0cd77375fa02fe5defdf419df6dae5b8a1d 100644 (file)
@@ -25,7 +25,6 @@
 
 /// @brief encapsulated option spaces
 #define DHCP_AGENT_OPTION_SPACE          "dhcp-agent-options-space"
-#define VENDOR_OPTION_SPACE              "vendor-opts-space"
 #define VENDOR_ENCAPSULATED_OPTION_SPACE "vendor-encapsulated-options-space"
 
 // NOTE:
@@ -383,7 +382,7 @@ const OptionDefParams STANDARD_V6_OPTION_DEFINITIONS[] = {
     { "vendor-class", D6O_VENDOR_CLASS, OPT_RECORD_TYPE, false,
       RECORD_DEF(VENDOR_CLASS_RECORDS), "" },
     { "vendor-opts", D6O_VENDOR_OPTS, OPT_UINT32_TYPE, false,
-      NO_RECORD_DEF, VENDOR_OPTION_SPACE },
+      NO_RECORD_DEF, "" },
     { "interface-id", D6O_INTERFACE_ID, OPT_BINARY_TYPE, false, NO_RECORD_DEF, "" },
     { "reconf-msg", D6O_RECONF_MSG, OPT_UINT8_TYPE, false, NO_RECORD_DEF, "" },
     { "reconf-accept", D6O_RECONF_ACCEPT, OPT_EMPTY_TYPE, false,
index bd83a19e1f72101ff2efc0c725bd842ebf21ceab..3373da402419ab8223637a9b56d80acc9e247c57 100644 (file)
@@ -1837,8 +1837,7 @@ TEST_F(LibDhcpTest, stdOptionDefs6) {
 
     LibDhcpTest::testStdOptionDefs6(D6O_VENDOR_OPTS, vopt_buf.begin(),
                                     vopt_buf.end(),
-                                    typeid(OptionVendor),
-                                    VENDOR_OPTION_SPACE);
+                                    typeid(OptionVendor));
 
     LibDhcpTest::testStdOptionDefs6(D6O_INTERFACE_ID, begin, end,
                                     typeid(Option));