30 :
Option(V6, type), addrs_(addrs) {
34 :
Option(V6, type), addrs_(1,addr) {
45 return (cloneInternal<Option6AddrLst>());
64 buf.writeUint16(
type_);
70 for (
auto const& addr :
addrs_) {
73 <<
" is not an IPv6 address");
77 buf.writeData(&addr.toBytes()[0], V6ADDRESS_LEN);
83 if ((distance(begin, end) % V6ADDRESS_LEN) != 0) {
85 <<
" malformed: len=" << distance(begin, end)
86 <<
" is not divisible by 16.");
88 while (begin != end) {
90 begin += V6ADDRESS_LEN;
98 for (
auto const& addr :
addrs_) {
99 output <<
" " << addr;
101 return (output.str());
A generic exception that is thrown if a parameter given to a method is considered invalid in that con...
A generic exception that is thrown if a parameter given to a method would refer to or modify out-of-r...
The IOAddress class represents an IP addresses (version agnostic)
bool isV6() const
Convenience function to check for an IPv6 address.
static IOAddress fromBytes(short family, const uint8_t *data)
Creates an address from over wire data.
void setAddresses(const AddressContainer &addrs)
Sets list of addresses.
Option6AddrLst(uint16_t type, const AddressContainer &addrs)
Constructor used during option generation.
virtual uint16_t len() const
Returns length of the complete option (data length + DHCPv4/DHCPv6 option header)
virtual std::string toText(int indent=0) const
Returns string representation of the option.
virtual void unpack(OptionBufferConstIter begin, OptionBufferConstIter end)
Parses received data.
void setAddress(const isc::asiolink::IOAddress &addr)
Sets a single address.
std::vector< isc::asiolink::IOAddress > AddressContainer
a container for (IPv6) addresses
virtual OptionPtr clone() const
Copies this option and returns a pointer to the copy.
void pack(isc::util::OutputBuffer &buf, bool check=true) const
Assembles on-wire form of this option.
uint16_t type_
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.
virtual uint16_t getHeaderLen() const
Returns length of header (2 for v4, 4 for v6)
static const size_t OPTION6_HDR_LEN
length of any DHCPv6 option header
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
Defines the logger used by the top-level component of kea-lfc.