|
| PDUOption (option_type opt=option_type(), size_t length=0, const data_type *data=0) |
| Constructs a PDUOption.
|
|
| PDUOption (const PDUOption &rhs) |
| Copy constructor.
|
|
| PDUOption (PDUOption &&rhs) TINS_NOEXCEPT |
| Move constructor.
|
|
PDUOption & | operator= (PDUOption &&rhs) TINS_NOEXCEPT |
| Move assignment operator.
|
|
PDUOption & | operator= (const PDUOption &rhs) |
| Copy assignment operator.
|
|
| ~PDUOption () |
| Destructor.
|
|
template<typename ForwardIterator > |
| PDUOption (option_type opt, ForwardIterator start, ForwardIterator end) |
| Constructs a PDUOption from iterators, which indicate the data to be stored in it.
|
|
template<typename ForwardIterator > |
| PDUOption (option_type opt, uint16_t length, ForwardIterator start, ForwardIterator end) |
| Constructs a PDUOption from iterators, which indicate the data to be stored in it.
|
|
option_type | option () const |
|
void | option (option_type opt) |
|
const data_type * | data_ptr () const |
|
size_t | data_size () const |
| Retrieves the length of this option's data.
|
|
size_t | length_field () const |
| Retrieves the data length field.
|
|
template<typename T > |
T | to () const |
| Constructs a T from this PDUOption.
|
|
template<typename T, typename U>
class Tins::PDUOption< T, U >
Represents a PDU option field.
Several PDUs, such as TCP, IP, Dot11 or DHCP contain options. All of them behave exactly the same way. This class represents those options.
The OptionType template parameter indicates the type that will be used to store this option's identifier.
template<typename T , typename U >
template<typename ForwardIterator >
Tins::PDUOption< T, U >::PDUOption |
( |
option_type | opt, |
|
|
uint16_t | length, |
|
|
ForwardIterator | start, |
|
|
ForwardIterator | end ) |
|
inline |
Constructs a PDUOption from iterators, which indicate the data to be stored in it.
The length parameter indicates the contents of the length field when this option is serialized. Note that this can be different to std::distance(start, end).
- See also
- length_field
- Parameters
-
opt | The option type. |
length | The length of this option. |
start | The beginning of the option data. |
end | The end of the option data. |
template<typename T , typename U >
Retrieves the data length field.
This is what the size field will contain when this option is serialized. It can differ from the actual data size.
This will be equal to data_size unless the constructor that takes both a data length and two iterators is used.
- See also
- data_size.