]> git.ipfire.org Git - thirdparty/kea.git/commitdiff
[master] Revert only the trac4121 merge
authorFrancis Dupont <fdupont@isc.org>
Mon, 23 Nov 2015 21:51:10 +0000 (22:51 +0100)
committerFrancis Dupont <fdupont@isc.org>
Mon, 23 Nov 2015 21:51:10 +0000 (22:51 +0100)
ChangeLog
src/lib/dhcp/libdhcp++.cc
src/lib/dhcp/libdhcp++.h
src/lib/dhcp/pkt4.cc
src/lib/dhcp/pkt6.cc
src/lib/dhcp/tests/libdhcp++_unittest.cc

index ab02a66a4baa43c392816cdd117909d0fa55042b..b7e279fad7b5a7861812841eb24b1d4d55d390a4 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,12 @@
+1054.  [func]          [tmark]
+       Replaced underscores, "_", with hyphens "-", in the parameter
+       names used in the kea-ddns server's configuration as well as
+       those in the DDNS messages (NCRs) sent to the server. For
+       example, "ip_address" is now "ip-address", "change_type" is
+       now "change-type".  This makes JSON element naming consistent
+       throughout Kea.
+       (Trac #4202    git 91bf527662060d4b1e294cd53e79b431edf0e910)
+
 1053.  [doc]           tomek
        Support for DHCPDECLINE (v4) and DECLINE (v6) messages is
        now described in the Kea User's Guide.
index bbc7f823671e510c40a697c9503930413a5693f5..069f09a04a2ca22712a621d59e71486c01a8ec54 100644 (file)
@@ -682,39 +682,6 @@ LibDHCP::packOptions(isc::util::OutputBuffer& buf,
     }
 }
 
-void
-LibDHCP::packOptions4(isc::util::OutputBuffer& buf,
-                     const OptionCollection& options) {
-    OptionCollection::const_iterator it = options.begin();
-    for (; it != options.end(); ++it) {
-       // Some options must be last
-       if ((it->first == DHO_DHCP_AGENT_OPTIONS) ||
-           (it->first == DHO_END)) {
-           continue;
-       }
-        it->second->pack(buf);
-    }
-    // Add the RAI option if it exists
-    it = options.find(DHO_DHCP_AGENT_OPTIONS);
-    if (it != options.end()) {
-       it->second->pack(buf);
-    }
-    // And at the end the END option
-    it = options.find(DHO_END);
-    if (it != options.end()) {
-       it->second->pack(buf);
-    }
-}
-
-void
-LibDHCP::packOptions6(isc::util::OutputBuffer& buf,
-                      const OptionCollection& options) {
-    for (OptionCollection::const_iterator it = options.begin();
-         it != options.end(); ++it) {
-        it->second->pack(buf);
-    }
-}
-
 void LibDHCP::OptionFactoryRegister(Option::Universe u,
                                     uint16_t opt_type,
                                     Option::Factory* factory) {
index eaac60d7a49b0d311970b052654c270397e4a885..57fac075bfe5aa17bc24608778f433fc67677d88 100644 (file)
@@ -134,19 +134,9 @@ public:
     ///
     /// @param buf output buffer (assembled options will be stored here)
     /// @param options collection of options to store to
-
-    /// Generic version: to be used when there is no specific order
     static void packOptions(isc::util::OutputBuffer& buf,
                             const isc::dhcp::OptionCollection& options);
 
-    /// DHCPv4 version: put some options last
-    static void packOptions4(isc::util::OutputBuffer& buf,
-                             const isc::dhcp::OptionCollection& options);
-
-    /// DHCPv6 version (currently same than the generic one)
-    static void packOptions6(isc::util::OutputBuffer& buf,
-                             const isc::dhcp::OptionCollection& options);
-
     /// @brief Parses provided buffer as DHCPv6 options and creates
     /// Option objects.
     ///
index e1e6673499096ff5017f2c7e4a89eaa01f00a7c9..cae19d07543792d3144b3510184308ac0590e29c 100644 (file)
@@ -143,7 +143,7 @@ Pkt4::pack() {
         // write DHCP magic cookie
         buffer_out_.writeUint32(DHCP_OPTIONS_COOKIE);
 
-        LibDHCP::packOptions4(buffer_out_, options_);
+        LibDHCP::packOptions(buffer_out_, options_);
 
         // add END option that indicates end of options
         // (End option is very simple, just a 255 octet)
index 6f95ef930a6cbf30bf26cea16c36687943537f83..33b4633722a97eec5ed8b35881dcb36ac7673bf7 100644 (file)
@@ -244,7 +244,7 @@ Pkt6::packUDP() {
         buffer_out_.writeUint8( (transid_) & 0xff );
 
         // the rest are options
-        LibDHCP::packOptions6(buffer_out_, options_);
+        LibDHCP::packOptions(buffer_out_, options_);
     }
     catch (const Exception& e) {
        // An exception is thrown and message will be written to Logger
index b80931818ab3db91dc98f11a37b6fe151a659f16..048e31f36132157f510fe6a7672bf03664fdb1d9 100644 (file)
@@ -342,7 +342,7 @@ TEST_F(LibDhcpTest, packOptions6) {
 
     OutputBuffer assembled(512);
 
-    EXPECT_NO_THROW(LibDHCP::packOptions6(assembled, opts));
+    EXPECT_NO_THROW(LibDHCP::packOptions(assembled, opts));
     EXPECT_EQ(sizeof(v6packed), assembled.getLength());
     EXPECT_EQ(0, memcmp(assembled.getData(), v6packed, sizeof(v6packed)));
 }
@@ -528,16 +528,15 @@ TEST_F(LibDhcpTest, packOptions4) {
     // the map. This gurantees that options are packed in the same order
     // they were added. Otherwise, options would get sorted by code and
     // the resulting buffer wouldn't match with the reference buffer.
-    // But this doesn't apply to the RAI code which is always the last one
     opts.insert(make_pair(opt1->getType(), opt1));
     opts.insert(make_pair(opt1->getType(), opt2));
-    opts.insert(make_pair(rai->getType(), rai));
     opts.insert(make_pair(opt1->getType(), opt3));
     opts.insert(make_pair(opt1->getType(), opt4));
     opts.insert(make_pair(opt1->getType(), opt5));
+    opts.insert(make_pair(opt1->getType(), rai));
 
     OutputBuffer buf(100);
-    EXPECT_NO_THROW(LibDHCP::packOptions4(buf, opts));
+    EXPECT_NO_THROW(LibDHCP::packOptions(buf, opts));
     ASSERT_EQ(buf.getLength(), sizeof(v4_opts));
     EXPECT_EQ(0, memcmp(v4_opts, buf.getData(), sizeof(v4_opts)));
 }