#include <dhcp/option6_status_code.h>
#include <dhcp/option_custom.h>
#include <dhcp/option_definition.h>
+#include <dhcp/option_dnr.h>
#include <dhcp/option_int.h>
#include <dhcp/option_int_array.h>
#include <dhcp/option_opaque_data_tuples.h>
// Prefix Exclude (option code 67),
return (OptionPtr(new Option6PDExclude(begin, end)));
+ case D6O_V6_DNR:
+ return (OptionPtr(new OptionDNR6(begin, end)));
+
default:
break;
}
// DHCPv4 SZTP Redirect Option (option code 143).
return (factoryOpaqueDataTuples(Option::V4, getCode(), begin, end, OpaqueDataTuple::LENGTH_2_BYTES));
+ case DHO_V4_DNR:
+ return (OptionPtr(new OptionDNR4(begin, end)));
+
default:
break;
}
#include <config.h>
+#include <dhcp/dhcp4.h>
+#include <dhcp/dhcp6.h>
#include <dhcp/option_dnr.h>
namespace isc {
namespace dhcp {
-OptionDNR6::OptionDNR6(const uint16_t type) : Option(Universe::V6, type) {
+OptionDNR6::OptionDNR6() : Option(V6, D6O_V6_DNR) {
}
-OptionDNR6::OptionDNR6(const uint16_t type,
- OptionBufferConstIter begin,
- OptionBufferConstIter end) : Option(Universe::V6, type) {
+OptionDNR6::OptionDNR6(OptionBufferConstIter begin, OptionBufferConstIter end)
+ : Option(V6, D6O_V6_DNR) {
unpack(begin, end);
}
return Option::len();
}
-OptionDNR4::OptionDNR4(const uint16_t type) : Option(V4, type) {
+OptionDNR4::OptionDNR4() : Option(V4, DHO_V4_DNR) {
}
-OptionDNR4::OptionDNR4(const uint16_t type,
- OptionBufferConstIter begin,
- OptionBufferConstIter end) : Option(V4, type) {
+OptionDNR4::OptionDNR4(OptionBufferConstIter begin, OptionBufferConstIter end)
+ : Option(V4, DHO_V4_DNR) {
unpack(begin, end);
}
namespace dhcp {
class OptionDNR6 : public Option {
- OptionDNR6(const uint16_t type);
-
- OptionDNR6(const uint16_t type, OptionBufferConstIter begin, OptionBufferConstIter end);
-
public:
+ OptionDNR6();
+ OptionDNR6(OptionBufferConstIter begin, OptionBufferConstIter end);
virtual OptionPtr clone() const;
virtual void pack(util::OutputBuffer& buf, bool check) const;
virtual void unpack(OptionBufferConstIter begin, OptionBufferConstIter end);
};
class OptionDNR4 : public Option {
- OptionDNR4(const uint16_t type);
-
- OptionDNR4(const uint16_t type, OptionBufferConstIter begin, OptionBufferConstIter end);
-
public:
+ OptionDNR4();
+ OptionDNR4(OptionBufferConstIter begin, OptionBufferConstIter end);
virtual OptionPtr clone() const;
virtual void pack(util::OutputBuffer& buf, bool check) const;
virtual void unpack(OptionBufferConstIter begin, OptionBufferConstIter end);
RECORD_DECL(OPT_6RD_RECORDS, OPT_UINT8_TYPE, OPT_UINT8_TYPE,
OPT_IPV6_ADDRESS_TYPE, OPT_IPV4_ADDRESS_TYPE);
-// RFC-draft-ietf-add-dnr DHCPv4 DNR option.
-//
-// DNR Instance Data Length (2 octets), Service Priority (2 octets), ADN Length (1 octet),
-// authentication-domain-name FQDN(s), Addr Length (1 octet), IPv4 address(es), SvcParams
-//RECORD_DECL(V4_DNR_RECORDS, OPT_UINT16_TYPE, OPT_UINT16_TYPE, OPT_UINT8_TYPE, OPT_FQDN_TYPE,
-// OPT_UINT8_TYPE, OPT_IPV4_ADDRESS_TYPE, OPT_BINARY_TYPE);
-
/// @brief Definitions of standard DHCPv4 options.
const OptionDefParams STANDARD_V4_OPTION_DEFINITIONS[] = {
{ "subnet-mask", DHO_SUBNET_MASK, DHCP4_OPTION_SPACE,
OPT_UINT8_TYPE, false, NO_RECORD_DEF, "" },
{ "v4-portparams", DHO_V4_PORTPARAMS, DHCP4_OPTION_SPACE, OPT_RECORD_TYPE,
false, RECORD_DEF(V4_PORTPARAMS_RECORDS), "" },
- { "v4-dnr", DHO_V4_DNR, DHCP4_OPTION_SPACE, OPT_TUPLE_TYPE,
+ { "v4-dnr", DHO_V4_DNR, DHCP4_OPTION_SPACE, OPT_BINARY_TYPE,
true, NO_RECORD_DEF, "" },
{ "option-6rd", DHO_6RD, DHCP4_OPTION_SPACE, OPT_RECORD_TYPE, true,
RECORD_DEF(OPT_6RD_RECORDS), "" },
// RFC-draft-ietf-add-dnr DHCPv6 DNR option.
//
// Service Priority (2 octets), ADN Length (2 octets),
-// authentication-domain-name FQDN(s), Addr Length (2 octets), IPv6 address(es), SvcParams
-RECORD_DECL(V6_DNR_RECORDS, OPT_UINT16_TYPE, OPT_UINT16_TYPE, OPT_FQDN_TYPE, OPT_UINT16_TYPE,
- OPT_IPV6_ADDRESS_TYPE, OPT_BINARY_TYPE);
+// Opaque data is represented here by the binary data field.
+// It must contain at least authentication-domain-name FQDN(s).
+// It may contain Addr Length (2 octets), IPv6 address(es), SvcParams.
+RECORD_DECL(V6_DNR_RECORDS, OPT_UINT16_TYPE, OPT_UINT16_TYPE, OPT_BINARY_TYPE);
/// Standard DHCPv6 option definitions.
///