]> git.ipfire.org Git - thirdparty/kea.git/commitdiff
[#1235] Updated v6 option defintions, made current server_id accessible
authorThomas Markwalder <tmark@isc.org>
Fri, 12 Jun 2020 15:42:00 +0000 (11:42 -0400)
committerThomas Markwalder <tmark@isc.org>
Tue, 16 Jun 2020 16:10:08 +0000 (12:10 -0400)
src/lib/dhcp/libdhcp++.cc
    Added LQ_QUERY_OPTION_SPACE to encapuslate options conveyed with
    D6O_LQ_QUERY options

src/lib/dhcp/std_option_defs.h
    Revamped defintions D6O_LQ_QUERY adn D6O_CLIENT_DATA

src/lib/dhcp/tests/libdhcp++_unittest.cc
    Updated unit tests

src/lib/dhcp/tests/pkt6_unittest.cc
    TEST_F(Pkt6Test, lqQueryOption)
    TEST_F(Pkt6Test, clientDataOption)
    TEST_F(Pkt6Test, relayDataOption) - new tests

src/lib/dhcpsrv/cfg_duid.*
    CfgDUID::create() - modified to retain the created
    DUID so it can be retrieved in places other than
    than Dhcp6Srv instances, such as hook callouts.

src/lib/dhcpsrv/tests/cfg_duid_unittest.cc
    Updated unit tests.

src/lib/dhcp/libdhcp++.cc
src/lib/dhcp/std_option_defs.h
src/lib/dhcpsrv/tests/cfg_duid_unittest.cc

index 6a6ba1344bc2cd308e6ac38f6a120d35b05f3f28..994e7a638af6030f6ce1c4d30d480642643800e5 100644 (file)
@@ -50,6 +50,7 @@ const OptionDefParamsEncapsulation OPTION_DEF_PARAMS[] = {
     { LW_V6_OPTION_DEFINITIONS,             LW_V6_OPTION_DEFINITIONS_SIZE,           LW_V6_OPTION_SPACE          },
     { V4V6_RULE_OPTION_DEFINITIONS,         V4V6_RULE_OPTION_DEFINITIONS_SIZE,       V4V6_RULE_OPTION_SPACE      },
     { V4V6_BIND_OPTION_DEFINITIONS,         V4V6_BIND_OPTION_DEFINITIONS_SIZE,       V4V6_BIND_OPTION_SPACE      },
+    { LQ_QUERY_OPTION_DEFINITIONS,          LQ_QUERY_OPTION_DEFINITIONS_SIZE,        LQ_QUERY_OPTION_SPACE       },
     { LAST_RESORT_V4_OPTION_DEFINITIONS,    LAST_RESORT_V4_OPTION_DEFINITIONS_SIZE,  LAST_RESORT_V4_OPTION_SPACE },
     { NULL,                                 0,                                       ""                          }
 };
index 9c08a1d215694fa9ff22c6cfcf80e3019df2f909..8142140dd08446e777891959f9e4f5937d19e87f 100644 (file)
@@ -27,6 +27,7 @@
 #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"
+#define LQ_QUERY_OPTION_SPACE            "lq-query-option-space"
 
 // NOTE:
 // When adding a new space, make sure you also update
@@ -564,6 +565,18 @@ const int V4V6_BIND_OPTION_DEFINITIONS_SIZE =
     sizeof(V4V6_BIND_OPTION_DEFINITIONS) /
     sizeof(V4V6_BIND_OPTION_DEFINITIONS[0]);
 
+/// @brief LQ_QUERY suboption definitions (v6)
+const OptionDefParams LQ_QUERY_OPTION_DEFINITIONS[] = {
+    { "clientid", D6O_CLIENTID, OPT_BINARY_TYPE, false, NO_RECORD_DEF, ""},
+    { "iaaddr", D6O_IAADDR, OPT_RECORD_TYPE, false, RECORD_DEF(IAADDR_RECORDS), ""},
+    { "oro", D6O_ORO, OPT_UINT16_TYPE, true, NO_RECORD_DEF, "" }
+};
+
+const int LQ_QUERY_OPTION_DEFINITIONS_SIZE =
+    sizeof(LQ_QUERY_OPTION_DEFINITIONS) /
+    sizeof(LQ_QUERY_OPTION_DEFINITIONS[0]);
+
+
 }  // namespace
 
 }  // namespace dhcp
index 10da5b9b4fd88f61b442fca4774aea96d2190957..e862ab7f403411268473ff81d282e5b269485e7f 100644 (file)
@@ -220,7 +220,11 @@ TEST_F(CfgDUIDTest, createEN) {
     // Verify that the DUID file has been created.
     EXPECT_TRUE(fileExists(absolutePath(DUID_FILE_NAME)));
 
+<<<<<<< HEAD
     // Verify getCurrentDuid() returns the value created.
+=======
+    // Verifiy getCurrentDuid() returns the value created.
+>>>>>>> [#1235] Updated v6 option defintions, made current server_id accessible
     DuidPtr current_duid = cfg.getCurrentDuid();
     ASSERT_TRUE(current_duid);
     EXPECT_EQ(*current_duid, *duid);
@@ -245,7 +249,11 @@ TEST_F(CfgDUIDTest, createLL) {
     // Verify that the DUID file has been created.
     EXPECT_TRUE(fileExists(absolutePath(DUID_FILE_NAME)));
 
+<<<<<<< HEAD
     // Verify getCurrentDuid() returns the value created.
+=======
+    // Verifiy getCurrentDuid() returns the value created.
+>>>>>>> [#1235] Updated v6 option defintions, made current server_id accessible
     DuidPtr current_duid = cfg.getCurrentDuid();
     ASSERT_TRUE(current_duid);
     EXPECT_EQ(*current_duid, *duid);
@@ -271,7 +279,11 @@ TEST_F(CfgDUIDTest, createDisableWrite) {
     // DUID persistence is disabled so there should be no DUID file.
     EXPECT_FALSE(fileExists(absolutePath(DUID_FILE_NAME)));
 
+<<<<<<< HEAD
     // Verify getCurrentDuid() returns the value created.
+=======
+    // Verifiy getCurrentDuid() returns the value created.
+>>>>>>> [#1235] Updated v6 option defintions, made current server_id accessible
     DuidPtr current_duid = cfg.getCurrentDuid();
     ASSERT_TRUE(current_duid);
     EXPECT_EQ(*current_duid, *duid);