Commit 8c1b9097 authored by Francis Dupont's avatar Francis Dupont
Browse files

[4107] Ported changes from fd4o6 (so not finished)

parent caa98afd
......@@ -110,8 +110,8 @@
//#define D6O_ADDRSEL 84 /* RFC7078 */
//#define D6O_ADDRSEL_TABLE 85 /* RFC7078 */
//#define D6O_V6_PCP_SERVER 86 /* RFC7291 */
//#define D6O_DHCPV4_MSG 87 /* RFC7341 */
//#define D6O_DHCPV4_O_DHCPV6_SERVER 88 /* RFC7341 */
#define D6O_DHCPV4_MSG 87 /* RFC7341 */
#define D6O_DHCPV4_O_DHCPV6_SERVER 88 /* RFC7341 */
//#define D6O_S46_RULE 89 /* RFC7598 */
//#define D6O_S46_BR 90 /* RFC7598 */
//#define D6O_S46_DMR 91 /* RFC7598 */
......@@ -195,8 +195,8 @@
//#define DHCPV6_RECONFIGURE_REQUEST 18
//#define DHCPV6_RECONFIGURE_REPLY 19
/* RFC 7341 */
//#define DHCPV6_DHCPV4_QUERY 20
//#define DHCPV6_DHCPV4_RESPONSE 21
#define DHCPV6_DHCPV4_QUERY 20
#define DHCPV6_DHCPV4_RESPONSE 21
/* draft-ietf-dhc-dhcpv6-active-leasequery-04 */
//#define DHCPV6_ACTIVELEASEQUERY 22
//#define DHCPV6_STARTTLS 23
......@@ -298,4 +298,8 @@ extern const int dhcpv6_type_name_max;
#define IRT_DEFAULT 86400
#define IRT_MINIMUM 600
/* DHCPv4-query message flags */
#define DHCPV4_QUERY_FLAGS_UNICAST (1 << 23)
#endif /* DHCP6_H */
......@@ -289,6 +289,8 @@ Pkt6::unpackUDP() {
case DHCPV6_DECLINE:
case DHCPV6_RECONFIGURE:
case DHCPV6_INFORMATION_REQUEST:
case DHCPV6_DHCPV4_QUERY:
case DHCPV6_DHCPV4_RESPONSE:
default: // assume that uknown messages are not using relay format
{
return (unpackMsg(data_.begin(), data_.end()));
......@@ -586,6 +588,8 @@ Pkt6::getName(const uint8_t type) {
static const char* REPLY = "REPLY";
static const char* REQUEST = "REQUEST";
static const char* SOLICIT = "SOLICIT";
static const char* DHCPV4_QUERY = "DHCPV4_QUERY";
static const char* DHCPV4_RESPONSE = "DHCPV4_RESPONSE";
static const char* UNKNOWN = "UNKNOWN";
switch (type) {
......@@ -634,6 +638,12 @@ Pkt6::getName(const uint8_t type) {
case DHCPV6_SOLICIT:
return (SOLICIT);
case DHCPV6_DHCPV4_QUERY:
return (DHCPV4_QUERY);
case DHCPV6_DHCPV4_RESPONSE:
return (DHCPV4_RESPONSE);
default:
;
}
......
......@@ -344,6 +344,9 @@ const OptionDefParams OPTION_DEF_PARAMS6[] = {
RECORD_DEF(LQ_RELAY_DATA_RECORDS), "" },
{ "lq-client-link", D6O_LQ_CLIENT_LINK, OPT_IPV6_ADDRESS_TYPE, true,
NO_RECORD_DEF, "" },
{ "dhcpv4-message", D6O_DHCPV4_MSG, OPT_BINARY_TYPE, false, NO_RECORD_DEF, "" },
{ "dhcp4o6-server-addr", D6O_DHCPV4_O_DHCPV6_SERVER, OPT_IPV6_ADDRESS_TYPE, true,
NO_RECORD_DEF, "" }
{ "bootfile-url", D6O_BOOTFILE_URL, OPT_STRING_TYPE, false, NO_RECORD_DEF, "" },
{ "bootfile-param", D6O_BOOTFILE_PARAM, OPT_BINARY_TYPE, false, NO_RECORD_DEF, "" },
{ "client-arch-type", D6O_CLIENT_ARCH_TYPE, OPT_UINT16_TYPE, true, NO_RECORD_DEF, "" },
......
......@@ -1200,6 +1200,12 @@ TEST_F(LibDhcpTest, stdOptionDefs6) {
fqdn_buf.begin(), fqdn_buf.end(),
typeid(OptionCustom));
LibDhcpTest::testStdOptionDefs6(D6O_DHCPV4_MSG, begin, end,
typeid(Option));
LibDhcpTest::testStdOptionDefs6(D6O_DHCPV4_O_DHCPV6_SERVER, begin, end,
typeid(Option6AddrLst));
LibDhcpTest::testStdOptionDefs6(D6O_PUBLIC_KEY, begin, end,
typeid(Option));
......
......@@ -594,6 +594,14 @@ TEST_F(Pkt6Test, getName) {
EXPECT_STREQ("DECLINE", Pkt6::getName(type));
break;
case DHCPV6_DHCPV4_QUERY:
EXPECT_STREQ("DHCPV4_QUERY", Pkt6::getName(type));
break;
case DHCPV6_DHCPV4_RESPONSE:
EXPECT_STREQ("DHCPV4_RESPONSE", Pkt6::getName(type));
break;
case DHCPV6_INFORMATION_REQUEST:
EXPECT_STREQ("INFORMATION_REQUEST",
Pkt6::getName(type));
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment