32 return (cloneInternal<OptionVendor>());
49 length += opt.second->len();
61 if (distance(begin, end) <
sizeof(uint32_t)) {
63 "Truncated vendor-specific information option"
64 <<
", length=" << distance(begin, end));
81 length +=
sizeof(uint32_t);
85 length +=
sizeof(uint8_t);
90 length += opt.second->len();
97 std::stringstream output;
100 output << vendor_id_ <<
" (uint32)";
106 length += opt.second->len();
108 output <<
" " << length <<
" (uint8)";
114 return (output.str());
static size_t unpackVendorOptions6(const uint32_t vendor_id, const OptionBuffer &buf, isc::dhcp::OptionCollection &options)
Parses provided buffer as DHCPv6 vendor options and creates Option objects.
static size_t unpackVendorOptions4(const uint32_t vendor_id, const OptionBuffer &buf, isc::dhcp::OptionCollection &options)
Parses provided buffer as DHCPv4 vendor options and creates Option objects.
OptionVendor(Option::Universe u, const uint32_t vendor_id)
Constructor.
virtual uint16_t len() const
returns complete length of option
OptionPtr clone() const
Copies this option and returns a pointer to the copy.
virtual void unpack(OptionBufferConstIter begin, OptionBufferConstIter end)
Parses received buffer.
virtual std::string toText(int indent=0) const
Returns the option in the textual format.
virtual 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.
std::string headerToText(const int indent=0, const std::string &type_name="") const
Returns option header in the textual format.
std::string suboptionsToText(const int indent=0) const
Returns collection of suboptions in the textual format.
virtual uint16_t getHeaderLen() const
Returns length of header (2 for v4, 4 for v6)
Universe
defines option universe DHCPv4 or DHCPv6
Universe universe_
option universe (V4 or V6)
void packOptions(isc::util::OutputBuffer &buf, bool check=true) const
Store sub options in a buffer.
OptionCollection options_
collection for storing suboptions
Universe getUniverse() const
returns option universe (V4 or V6)
void packHeader(isc::util::OutputBuffer &buf, bool check=true) const
Store option's header in a buffer.
void check() const
A protected method used for option correctness.
Exception thrown during option unpacking This exception is thrown when an error has occurred,...
The OutputBuffer class is a buffer abstraction for manipulating mutable data.
void writeUint8(uint8_t data)
Write an unsigned 8-bit integer into the buffer.
void writeUint32(uint32_t data)
Write an unsigned 32-bit integer in host byte order into the buffer in network byte order.
#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
std::vector< uint8_t > OptionBuffer
buffer types used in DHCP code.
boost::shared_ptr< Option > OptionPtr
uint32_t readUint32(const void *buffer, size_t length)
Read Unsigned 32-Bit Integer from Buffer.