26 const uint8_t method,
const uint64_t rdm,
27 const std::vector<uint8_t>&
info)
29 protocol_(proto), algorithm_(algo),
30 rdm_method_(method), rdm_value_(rdm),
36 return (cloneInternal<Option6Auth>());
47 buf.writeUint16(
type_);
49 buf.writeUint16(11 + uint16_t(
auth_info_.size()));
70 "computing hash input");
74 buf.writeUint16(
type_);
101 begin +=
sizeof(uint8_t);
104 begin +=
sizeof(uint8_t);
107 begin +=
sizeof(uint8_t);
110 begin +=
sizeof(uint64_t);
113 std::for_each(begin, end, [
this](uint8_t msgdata)
120 std::string in(indent,
' ');
122 output << in <<
"protocol=" <<
static_cast<int>(
protocol_)
123 <<
", algorithm=" <<
static_cast<int>(
algorithm_)
124 <<
", rdm method=" <<
static_cast<int>(
rdm_method_)
A generic exception that is thrown if a parameter given to a method would refer to or modify out-of-r...
static const uint8_t OPTION6_HASH_MSG_LEN
uint8_t protocol_
keeps protocol type
static const uint8_t OPTION6_AUTH_MIN_LEN
static const uint8_t OPTION6_HDR
uint64_t rdm_value_
keeps replay detection method value
uint8_t rdm_method_
keeps replay detection method type
virtual std::string toText(int indent=0) const
Provides human readable text representation.
uint8_t algorithm_
keeps hash algorithm value
virtual OptionPtr clone() const
Copies this option and returns a pointer to the copy.
std::vector< uint8_t > auth_info_
keeps authentication information
void packHashInput(isc::util::OutputBuffer &buf) const
Writes option in wire-format to buf, for computing hash auth info filled with 0 for a length of 128 b...
void pack(isc::util::OutputBuffer &buf, bool check=true) const
Writes option in wire-format to buf, returns pointer to first unused byte after stored option.
Option6Auth(const uint8_t proto, const uint8_t algo, const uint8_t method, const uint64_t rdm, const std::vector< uint8_t > &info)
Constructor, used for auth options while transmitting.
virtual void unpack(OptionBufferConstIter begin, OptionBufferConstIter end)
Parses received buffer.
uint16_t type_
option type (0-255 for DHCPv4, 0-65535 for DHCPv6)
The OutputBuffer class is a buffer abstraction for manipulating mutable data.
#define isc_throw(type, stream)
A shortcut macro to insert known values into exception arguments.
OptionBuffer::const_iterator OptionBufferConstIter
const_iterator for walking over OptionBuffer
boost::shared_ptr< Option > OptionPtr
string encodeHex(const vector< uint8_t > &binary)
Encode binary data in the base16 format.
uint64_t readUint64(void const *const buffer, size_t const length)
uint16_t wrapper over readUint.
Defines the logger used by the top-level component of kea-lfc.