![]() |
Kea
1.5.0
|
Forward declaration to OptionIntArray. More...
#include <option_definition.h>
Public Member Functions | |
| OptionIntArray (const Option::Universe u, const uint16_t type) | |
| Constructor. More... | |
| OptionIntArray (const Option::Universe u, const uint16_t type, const OptionBuffer &buf) | |
| Constructor. More... | |
| OptionIntArray (const Option::Universe u, const uint16_t type, OptionBufferConstIter begin, OptionBufferConstIter end) | |
| Constructor. More... | |
| void | addValue (const T value) |
| Adds a new value to the array. More... | |
| virtual OptionPtr | clone () const |
| Copies this option and returns a pointer to the copy. More... | |
| const std::vector< T > & | getValues () const |
| Return collection of option values. More... | |
| virtual uint16_t | len () const |
| returns complete length of option More... | |
| void | pack (isc::util::OutputBuffer &buf) const |
| Writes option in wire-format to buf, returns pointer to first unused byte after stored option. More... | |
| void | setValues (const std::vector< T > &values) |
| Set option values. More... | |
| virtual std::string | toText (int indent=0) const |
| Returns textual representation of the option. More... | |
| virtual void | unpack (OptionBufferConstIter begin, OptionBufferConstIter end) |
| Parses received buffer. More... | |
Forward declaration to OptionIntArray.
This template class represents DHCP (v4 or v6) option with an array of integer values.
Forward declaration of OptionIntArray.
This forward declaration is needed to access the OptionIntArray class without having to include the option_int_array.h header file. It is required because this header includes libdhcp++.h, and including option_int_array.h would cause circular inclusion between libdhcp++.h, option_definition.h and option_int_array.h.
The type of the elements in the array can be any of the following:
| T | data field type (see above). |
Definition at line 74 of file option_definition.h.
|
inline |
Constructor.
Creates option with empty values vector.
| u | universe (V4 or V6). |
| type | option type. |
| isc::dhcp::InvalidDataType | if data field type provided as template parameter is not a supported integer type. |
Definition at line 73 of file option_int_array.h.
References isc_throw.
|
inline |
Constructor.
| u | universe (V4 or V6). |
| type | option type. |
| buf | buffer with option data (must not be empty). |
| isc::OutOfRange | if provided buffer is empty or its length is not multiple of size of the data type in bytes. |
| isc::dhcp::InvalidDataType | if data field type provided as template parameter is not a supported integer type. |
Definition at line 91 of file option_int_array.h.
References isc_throw, and isc::dhcp::OptionIntArray< T >::unpack().
Here is the call graph for this function:
|
inline |
Constructor.
This constructor creates option from a buffer. This constructor may throw exception if unpack function throws during buffer parsing.
| u | universe (V4 or V6). |
| type | option type. |
| begin | iterator to first byte of option data. |
| end | iterator to end of option data (first byte after option end). |
| isc::OutOfRange | if provided buffer is empty or its length is not multiple of size of the data type in bytes. |
| isc::dhcp::InvalidDataType | if data field type provided as template parameter is not a supported integer type. |
Definition at line 115 of file option_int_array.h.
References isc_throw, and isc::dhcp::OptionIntArray< T >::unpack().
Here is the call graph for this function:
|
inline |
Adds a new value to the array.
| value | a value being added. |
Definition at line 132 of file option_int_array.h.
|
inlinevirtual |
Copies this option and returns a pointer to the copy.
Definition at line 125 of file option_int_array.h.
|
inline |
Return collection of option values.
Definition at line 230 of file option_int_array.h.
|
inlinevirtual |
returns complete length of option
Returns length of this option, including option header and suboptions
Definition at line 242 of file option_int_array.h.
References isc::dhcp::Option::V4.
|
inline |
Writes option in wire-format to buf, returns pointer to first unused byte after stored option.
| [out] | buf | buffer (option will be stored here) |
| isc::dhcp::InvalidDataType | if size of a data fields type is not equal to 1, 2 or 4 bytes. The data type is not checked in this function because it is checked in a constructor. |
Definition at line 144 of file option_int_array.h.
References isc_throw, isc::util::OutputBuffer::writeUint16(), isc::util::OutputBuffer::writeUint32(), and isc::util::OutputBuffer::writeUint8().
Here is the call graph for this function:
|
inline |
Set option values.
| values | collection of values to be set for option. |
Definition at line 235 of file option_int_array.h.
|
inlinevirtual |
Returns textual representation of the option.
| indent | Number of space characters to be inserted before the text. |
Definition at line 260 of file option_int_array.h.
References isc::dhcp::OptionDataTypeUtil::getDataTypeName().
Here is the call graph for this function:
|
inlinevirtual |
Parses received buffer.
Parses received buffer and returns offset to the first unused byte after parsed option.
| begin | iterator to first byte of option data |
| end | iterator to end of option data (first byte after option end) |
| isc::dhcp::InvalidDataType | if size of a data fields type is not equal to 1, 2 or 4 bytes. The data type is not checked in this function because it is checked in a constructor. |
Definition at line 184 of file option_int_array.h.
References isc_throw, isc::util::readUint16(), and isc::util::readUint32().
Referenced by isc::dhcp::OptionIntArray< T >::OptionIntArray().
Here is the call graph for this function: