/// @param begin Iterator pointing to the beginning of the buffer holding an
/// option.
/// @param end Iterator pointing to the end of the buffer holding an option.
+ /// @param convenient_notation Flag stating whether data in buffer is a convenient
+ /// notation string that needs custom parsing or binary
+ /// data. Defaults to @c false.
///
/// @throw OutOfRange Thrown in case of truncated data. May be also thrown when
/// @c DnrInstance::unpackDnrInstanceDataLength(begin,end) throws.
/// @throw BadValue Thrown when @c DnrInstance::unpackAdn(begin,end) throws.
/// @throw InvalidOptionDnrDomainName Thrown when @c DnrInstance::unpackAdn(begin,end) throws.
- Option4Dnr(OptionBufferConstIter begin, OptionBufferConstIter end);
+ Option4Dnr(OptionBufferConstIter begin,
+ OptionBufferConstIter end,
+ bool convenient_notation = false);
/// @brief Constructor of the empty %Option.
///
protected:
/// @brief Container holding DNR Instances.
DnrInstanceContainer dnr_instances_;
+
+private:
+ /// @brief Flag stating whether the %Option was constructed with a convenient notation string,
+ /// that needs custom parsing, or binary data.
+ bool convenient_notation_;
};
/// A pointer to the @c OptionDnr4 object.
/// @param begin Iterator pointing to the beginning of the buffer holding an
/// option.
/// @param end Iterator pointing to the end of the buffer holding an option.
+ /// @param convenient_notation Flag stating whether data in buffer is a convenient
+ /// notation string that needs custom parsing or binary
+ /// data. Defaults to @c false.
///
/// @throw OutOfRange Thrown in case of truncated data.
/// @throw BadValue Thrown when @c DnrInstance::unpackAdn(begin,end) throws.
/// @throw InvalidOptionDnrDomainName Thrown when @c DnrInstance::unpackAdn(begin,end) throws.
- Option6Dnr(OptionBufferConstIter begin, OptionBufferConstIter end);
+ Option6Dnr(OptionBufferConstIter begin,
+ OptionBufferConstIter end,
+ bool convenient_notation = false);
/// @brief Constructor of the %Option with all fields from params.
///
/// @throw OutOfRange Thrown in case of malformed data detected during parsing e.g.
/// Addr Len not divisible by 16, Addr Len is 0, addresses data truncated etc.
void unpackAddresses(OptionBufferConstIter& begin, OptionBufferConstIter end) override;
+
+private:
+ /// @brief Flag stating whether the %Option was constructed with a convenient notation string,
+ /// that needs custom parsing, or binary data.
+ bool convenient_notation_;
};
/// A pointer to the @c Option6Dnr object.
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), ADN FQDN.
-// Opaque data is represented here by the binary data field.
-// It may contain Addr Length (1 octet), IPv4 address(es), SvcParams,
-// and next DNR instances as binary data.
-RECORD_DECL(V4_DNR_RECORDS, OPT_UINT16_TYPE, OPT_UINT16_TYPE, OPT_UINT8_TYPE,
- OPT_FQDN_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_RECORD_TYPE,
- false, RECORD_DEF(V4_DNR_RECORDS), "" },
+ { "v4-dnr", DHO_V4_DNR, DHCP4_OPTION_SPACE, OPT_INTERNAL_TYPE,
+ false, NO_RECORD_DEF, "" },
{ "option-6rd", DHO_6RD, DHCP4_OPTION_SPACE, OPT_RECORD_TYPE, true,
RECORD_DEF(OPT_6RD_RECORDS), "" },
{ "v4-access-domain", DHO_V4_ACCESS_DOMAIN, DHCP4_OPTION_SPACE,
// Three 1 byte fileds to describe a network interface: type, major and minor
RECORD_DECL(CLIENT_NII_RECORDS, OPT_UINT8_TYPE, OPT_UINT8_TYPE, OPT_UINT8_TYPE);
-// RFC-draft-ietf-add-dnr DHCPv6 DNR option.
-//
-// Service Priority (2 octets), ADN Length (2 octets), ADN FQDN.
-// Opaque data is represented here by the binary data field.
-// It may contain Addr Length (2 octets), IPv6 address(es), SvcParams.
-RECORD_DECL(V6_DNR_RECORDS, OPT_UINT16_TYPE, OPT_UINT16_TYPE, OPT_FQDN_TYPE, OPT_BINARY_TYPE);
-
/// Standard DHCPv6 option definitions.
///
/// @warning in this array, the initializers are provided for all
false, NO_RECORD_DEF, MAPT_V6_OPTION_SPACE },
{ "s46-cont-lw", D6O_S46_CONT_LW, DHCP6_OPTION_SPACE, OPT_EMPTY_TYPE,
false, NO_RECORD_DEF, LW_V6_OPTION_SPACE },
- { "v6-dnr", D6O_V6_DNR, DHCP6_OPTION_SPACE, OPT_RECORD_TYPE,
- false, RECORD_DEF(V6_DNR_RECORDS), "" }
+ { "v6-dnr", D6O_V6_DNR, DHCP6_OPTION_SPACE, OPT_INTERNAL_TYPE,
+ false, NO_RECORD_DEF, "" }
// @todo There is still a bunch of options for which we have to provide
// definitions but we don't do it because they are not really