15 #include <arpa/inet.h>
25 Option6IA::Option6IA(uint16_t type, uint32_t iaid)
31 "a different layout");
44 "a different layout");
54 return (cloneInternal<Option6IA>());
75 begin +=
sizeof(uint32_t);
77 begin +=
sizeof(uint32_t);
80 begin +=
sizeof(uint32_t);
99 output <<
": iaid=" <<
iaid_ <<
", t1=" <<
t1_ <<
", t2=" <<
t2_
102 return (output.str());
111 for (OptionCollection::const_iterator it =
options_.begin();
114 length += (*it).second->len();
void packOptions(isc::util::OutputBuffer &buf) const
Store sub options in a buffer.
virtual std::string toText(int indent=0) const
Provides human readable text representation.
virtual void unpack(OptionBufferConstIter begin, OptionBufferConstIter end)
Parses received buffer.
void pack(isc::util::OutputBuffer &buf) const
Writes option in wire-format to buf, returns pointer to first unused byte after stored option...
boost::shared_ptr< Option > OptionPtr
std::vector< uint8_t > OptionBuffer
buffer types used in DHCP code.
virtual OptionPtr clone() const
Copies this option and returns a pointer to the copy.
virtual uint16_t len() const
returns complete length of option
#define isc_throw(type, stream)
A shortcut macro to insert known values into exception arguments.
A generic exception that is thrown if a parameter given to a method is considered invalid in that con...
uint32_t t1_
keeps T1 timer value
OptionCollection options_
collection for storing suboptions
void setEncapsulatedSpace(const std::string &encapsulated_space)
Sets the name of the option space encapsulated by this option.
The OutputBuffer class is a buffer abstraction for manipulating mutable data.
uint32_t readUint32(const uint8_t *buffer, size_t length)
Read Unsigned 32-Bit Integer from Buffer.
OptionBuffer::const_iterator OptionBufferConstIter
const_iterator for walking over OptionBuffer
std::string suboptionsToText(const int indent=0) const
Returns collection of suboptions in the textual format.
void writeUint32(uint32_t data)
Write an unsigned 32-bit integer in host byte order into the buffer in network byte order...
Defines the logger used by the top-level component of kea-dhcp-ddns.
uint32_t iaid_
keeps IA identifier
void unpackOptions(const OptionBuffer &buf)
Builds a collection of sub options from the buffer.
#define DHCP6_OPTION_SPACE
uint16_t getType() const
Returns option type (0-255 for DHCPv4, 0-65535 for DHCPv6)
std::string headerToText(const int indent=0, const std::string &type_name="") const
Returns option header in the textual format.
void writeUint16(uint16_t data)
Write an unsigned 16-bit integer in host byte order into the buffer in network byte order...
A generic exception that is thrown if a parameter given to a method would refer to or modify out-of-r...
static const size_t OPTION6_IA_LEN
Length of IA_NA and IA_PD content.
uint32_t t2_
keeps T2 timer value
uint16_t type_
option type (0-255 for DHCPv4, 0-65535 for DHCPv6)
static const size_t OPTION6_HDR_LEN
length of any DHCPv6 option header
Option6IA(uint16_t type, uint32_t iaid)
Ctor, used for constructed options, usually during transmission.