![]() |
Kea
1.5.0
|
Forward declaration to OptionInt. More...
#include <option_definition.h>
Public Member Functions | |
| OptionInt (Option::Universe u, uint16_t type, OptionBufferConstIter begin, OptionBufferConstIter end) | |
| Constructor. More... | |
| OptionInt (Option::Universe u, uint16_t type, T value) | |
| Constructor. More... | |
| virtual OptionPtr | clone () const |
| Copies this option and returns a pointer to the copy. More... | |
| T | getValue () const |
| Return option value. 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 | setValue (T value) |
| Set option value. More... | |
| virtual std::string | toText (int indent=0) const |
| Returns option carrying an integer value in the textual format. More... | |
| virtual void | unpack (OptionBufferConstIter begin, OptionBufferConstIter end) |
| Parses received buffer. More... | |
Forward declaration to OptionInt.
This template class represents DHCP option with single value.
This forward declaration is needed to access the OptionInt class without having to include the option_int.h header file. It is required because this header includes libdhcp++.h, and including option_int.h would cause circular inclusion between libdhcp++.h, option_definition.h and option6_int.h.
This value is of integer type and can be any of the following:
| T | data field type (see above). |
Definition at line 64 of file option_definition.h.
|
inline |
Constructor.
| u | universe (V4 or V6) |
| type | option type. |
| value | option value. |
| isc::dhcp::InvalidDataType | if data field type provided as template parameter is not a supported integer type. |
Definition at line 65 of file option_int.h.
References DHCP4_OPTION_SPACE, DHCP6_OPTION_SPACE, isc_throw, and isc::dhcp::Option::V4.
|
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 shorter than data size. |
| isc::dhcp::InvalidDataType | if data field type provided as template parameter is not a supported integer type. |
Definition at line 88 of file option_int.h.
References DHCP4_OPTION_SPACE, DHCP6_OPTION_SPACE, isc_throw, isc::dhcp::OptionInt< T >::unpack(), and isc::dhcp::Option::V4.
Here is the call graph for this function:
|
inlinevirtual |
Copies this option and returns a pointer to the copy.
Definition at line 99 of file option_int.h.
|
inline |
Return option value.
Definition at line 190 of file option_int.h.
Referenced by isc::dhcp::OptionInt< T >::toText().
|
inlinevirtual |
returns complete length of option
Returns length of this option, including option header and suboptions
Definition at line 197 of file option_int.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 field 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 111 of file option_int.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 |
|
inlinevirtual |
Returns option carrying an integer value in the textual format.
The returned value also includes the suboptions if present.
| indent | Number of spaces to be inserted before the text. |
Definition at line 217 of file option_int.h.
References isc::dhcp::OptionDataTypeUtil::getDataTypeName(), and isc::dhcp::OptionInt< T >::getValue().
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::OutOfRange | if provided buffer is shorter than data size. |
| isc::dhcp::InvalidDataType | if size of a data field 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 147 of file option_int.h.
References isc_throw, isc::util::readUint16(), and isc::util::readUint32().
Referenced by isc::dhcp::OptionInt< T >::OptionInt().
Here is the call graph for this function: