From: Tomek Mrugalski Date: Tue, 30 Oct 2012 15:53:10 +0000 (+0100) Subject: [2414] Duid types moved to dhcp/duid.h X-Git-Tag: trac2487_base~1^2~31^2~36 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=2e7420da8bcb358bb4c8bb6d3a8c42e3fc26d53a;p=thirdparty%2Fkea.git [2414] Duid types moved to dhcp/duid.h --- diff --git a/src/bin/dhcp6/dhcp6_srv.cc b/src/bin/dhcp6/dhcp6_srv.cc index 7c57a6139c..74949ed36e 100644 --- a/src/bin/dhcp6/dhcp6_srv.cc +++ b/src/bin/dhcp6/dhcp6_srv.cc @@ -27,6 +27,7 @@ #include #include #include +#include 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(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 diff --git a/src/lib/dhcp/dhcp6.h b/src/lib/dhcp/dhcp6.h index 15c306da66..22e7c8d0e0 100644 --- a/src/lib/dhcp/dhcp6.h +++ b/src/lib/dhcp/dhcp6.h @@ -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/ diff --git a/tests/tools/perfdhcp/command_options.cc b/tests/tools/perfdhcp/command_options.cc index 9aa6abf0cc..9de07ca1eb 100644 --- a/tests/tools/perfdhcp/command_options.cc +++ b/tests/tools/perfdhcp/command_options.cc @@ -23,6 +23,7 @@ #include #include +#include #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(static_cast(isc::dhcp::DUID::DUID_LLT) >> 8); + duid_template_[1] = static_cast(static_cast(isc::dhcp::DUID::DUID_LLT) & 0xff); duid_template_[2] = HWTYPE_ETHERNET >> 8; duid_template_[3] = HWTYPE_ETHERNET & 0xff;