]> git.ipfire.org Git - thirdparty/kea.git/commitdiff
[2414] Duid types moved to dhcp/duid.h
authorTomek Mrugalski <tomasz@isc.org>
Tue, 30 Oct 2012 15:53:10 +0000 (16:53 +0100)
committerTomek Mrugalski <tomasz@isc.org>
Tue, 30 Oct 2012 15:53:10 +0000 (16:53 +0100)
src/bin/dhcp6/dhcp6_srv.cc
src/lib/dhcp/dhcp6.h
tests/tools/perfdhcp/command_options.cc

index 7c57a6139cfaeaa591f4018a62a109011560f713..74949ed36ed35d8c48e0400b665148ffffe77dc5 100644 (file)
@@ -27,6 +27,7 @@
 #include <exceptions/exceptions.h>
 #include <util/io_utilities.h>
 #include <util/range_utilities.h>
+#include <dhcp/duid.h>
 
 using namespace isc;
 using namespace isc::asiolink;
@@ -243,7 +244,7 @@ void Dhcpv6Srv::setServerID() {
         seconds -= DUID_TIME_EPOCH;
 
         OptionBuffer srvid(8 + iface->getMacLen());
-        writeUint16(DUID_LLT, &srvid[0]);
+        writeUint16(DUID::DUID_LLT, &srvid[0]);
         writeUint16(HWTYPE_ETHERNET, &srvid[2]);
         writeUint32(static_cast<uint32_t>(seconds), &srvid[4]);
         memcpy(&srvid[0]+8, iface->getMac(), iface->getMacLen());
@@ -259,7 +260,7 @@ void Dhcpv6Srv::setServerID() {
     // See Section 9.3 of RFC3315 for details.
 
     OptionBuffer srvid(12);
-    writeUint16(DUID_EN, &srvid[0]);
+    writeUint16(DUID::DUID_EN, &srvid[0]);
     writeUint32(ENTERPRISE_ID_ISC, &srvid[2]);
 
     // Length of the identifier is company specific. I hereby declare
index 15c306da6676a8b3bcbdccf2d0833e39b50907bc..22e7c8d0e05909c3e1c8c3c5fba7172f3155798e 100644 (file)
@@ -105,10 +105,11 @@ extern const int dhcpv6_type_name_max;
 
 /* DUID type definitions (RFC3315 section 9).
  */
-#define DUID_LLT        1
-#define DUID_EN         2
-#define DUID_LL         3
-#define DUID_UUID       4
+// see isc::dhcp::DUID::DUIDType enum in dhcp/duid.h
+// #define DUID_LLT        1
+// #define DUID_EN         2
+// #define DUID_LL         3
+// #define DUID_UUID       4
 
 // Define hardware types
 // Taken from http://www.iana.org/assignments/arp-parameters/
index 9aa6abf0ccb751acacde8e43a7be1cfb235cf0be..9de07ca1eb4216b1fe95dfee49882b189cd4eb64 100644 (file)
@@ -23,6 +23,7 @@
 
 #include <exceptions/exceptions.h>
 #include <dhcp/iface_mgr.h>
+#include <dhcp/duid.h>
 #include "command_options.h"
 
 using namespace std;
@@ -567,8 +568,8 @@ CommandOptions::generateDuidTemplate() {
     const uint8_t duid_template_len = 14;
     duid_template_.resize(duid_template_len);
     // The first four octets consist of DUID LLT and hardware type.
-    duid_template_[0] = DUID_LLT >> 8;
-    duid_template_[1] = DUID_LLT & 0xff;
+    duid_template_[0] = static_cast<uint8_t>(static_cast<uint16_t>(isc::dhcp::DUID::DUID_LLT) >> 8);
+    duid_template_[1] = static_cast<uint8_t>(static_cast<uint16_t>(isc::dhcp::DUID::DUID_LLT) & 0xff);
     duid_template_[2] = HWTYPE_ETHERNET >> 8;
     duid_template_[3] = HWTYPE_ETHERNET & 0xff;