|
join 1.0
lightweight network framework library
|
DHCP option list. More...
#include <dhcp_option.hpp>
Classes | |
| struct | Info |
| description of an option. More... | |
Public Member Functions | |
| DhcpOption ()=default | |
| create the DhcpOption instance. | |
| DhcpOption (const_iterator first, const_iterator last) | |
| create the DhcpOption instance with the elements from range. | |
| DhcpOption (const DhcpOption &other)=default | |
| create instance by copy. | |
| DhcpOption & | operator= (const DhcpOption &other)=default |
| assign instance by copy. | |
| DhcpOption (DhcpOption &&other)=default | |
| create instance by move. | |
| DhcpOption & | operator= (DhcpOption &&other)=default |
| assign instance by move. | |
| ~DhcpOption ()=default | |
| destroy the DhcpOption instance. | |
| const DhcpOptionValue & | at (uint8_t code) const |
| get the value identified by code, with range verification. | |
| template<typename T > | |
| const T * | getIf (uint8_t code) const |
| get the value identified by code if it is present and holds the requested type. | |
| const_iterator | find (uint8_t code) const |
| find the element with the given code. | |
| bool | contains (uint8_t code) const |
| check if there is an element identified by code in the list. | |
| const_iterator | begin () const |
| get an iterator to the first element of the list. | |
| const_iterator | cbegin () const |
| get an iterator to the first element of the list. | |
| const_iterator | end () const |
| get an iterator to the element following the last element of the list. | |
| const_iterator | cend () const |
| get an iterator to the element following the last element of the list. | |
| bool | empty () const |
| check if the list has no element. | |
| size_t | size () const |
| get the number of options in the list. | |
| size_t | erase (uint8_t code) |
| remove the element identified by code. | |
| void | clear () |
| remove all elements from the list. | |
| template<typename T > | |
| bool | insert (uint8_t code, T &&value) |
| add an option to the list, converting the value to the type the option carries. | |
| void | insert (const_iterator first, const_iterator last) |
| insert elements from range. | |
| void | swap (DhcpOption &other) |
| exchange the contents of the list with those of other. | |
| std::string | dump () const |
| dump the options in string format. | |
Static Public Member Functions | |
| template<typename T > | |
| static bool | isValid (uint8_t code, T &&value) |
| check that a value can be carried by the given option. | |
| static const Info * | describe (uint8_t code) noexcept |
| get the description of the given option. | |
Static Protected Member Functions | |
| static const char * | codeName (uint8_t code) noexcept |
| get the name of the given option. | |
| static void | write (std::ostream &stream, uint8_t code, const DhcpOptionValue &value) |
| write an option value in string format. | |
| static bool | accepts (const Info &info, uint32_t value) noexcept |
| check that a value satisfies the constraints of the given option. | |
| template<typename Target , typename Source > | |
| static std::enable_if< std::is_signed< Source >::value, bool >::type | fits (Source value) noexcept |
| check that a signed value can be represented by the target type. | |
| template<typename Target , typename Source > | |
| static std::enable_if<!std::is_signed< Source >::value, bool >::type | fits (Source value) noexcept |
| check that an unsigned value can be represented by the target type. | |
| template<typename Target , typename Source > | |
| static bool | store (const Info &info, Source value, DhcpOptionValue &out) |
| store an integer value as the given target type. | |
| static bool | invalid () noexcept |
| report an invalid option value. | |
| template<typename T > | |
| static std::enable_if< std::is_integral< typenamestd::decay< T >::type >::value, bool >::type | convert (uint8_t code, T value, DhcpOptionValue &out) |
| convert an integer to the type the given option carries. | |
| static bool | convert (uint8_t code, const std::string &value, DhcpOptionValue &out) |
| convert a string to the type the given option carries. | |
| static bool | convert (uint8_t code, const char *value, DhcpOptionValue &out) |
| convert a string to the type the given option carries. | |
| static bool | convert (uint8_t code, const IpAddress &value, DhcpOptionValue &out) |
| store an IP address in the given option. | |
| static bool | convert (uint8_t code, const MacAddress &value, DhcpOptionValue &out) |
| store a hardware address in the given option. | |
| static bool | convert (uint8_t code, const ByteList &value, DhcpOptionValue &out) |
| store a list of bytes in the given option. | |
| static bool | convert (uint8_t code, const WordList &value, DhcpOptionValue &out) |
| store a list of words in the given option. | |
| static bool | convert (uint8_t code, const IpList &value, DhcpOptionValue &out) |
| store a list of IP addresses in the given option. | |
Protected Attributes | |
| Options | _options |
| options. | |
Friends | |
| bool | operator== (const DhcpOption &lhs, const DhcpOption &rhs) |
| friendship with equal operator. | |
| bool | operator!= (const DhcpOption &lhs, const DhcpOption &rhs) |
| friendship with not equal operator. | |
| bool | operator< (const DhcpOption &lhs, const DhcpOption &rhs) |
| friendship with lower operator. | |
| bool | operator> (const DhcpOption &lhs, const DhcpOption &rhs) |
| friendship with greater operator. | |
| bool | operator<= (const DhcpOption &lhs, const DhcpOption &rhs) |
| friendship with lower or equal operator. | |
| bool | operator>= (const DhcpOption &lhs, const DhcpOption &rhs) |
| friendship with greater or equal operator. | |
DHCP option list.
| using join::DhcpOption::const_iterator = Options::const_iterator |
constant iterator from nested container.
| using join::DhcpOption::Options = std::map<uint8_t, DhcpOptionValue> |
option list.
| enum join::DhcpOption::Code : uint8_t |
option codes.
type of the value an option carries on the wire.
|
default |
create the DhcpOption instance.
|
inline |
create the DhcpOption instance with the elements from range.
| first | first element to insert. |
| last | last element to insert. |
|
default |
create instance by copy.
| other | other object to copy. |
|
default |
create instance by move.
| other | other object to move. |
|
default |
destroy the DhcpOption instance.
|
inlinestaticprotectednoexcept |
check that a value satisfies the constraints of the given option.
| info | option description. |
| value | value to check. |
|
inline |
get the value identified by code, with range verification.
| code | code used to locate the value. |
| std::out_of_range | if the option is not in the list. |
|
inline |
get an iterator to the first element of the list.
|
inline |
get an iterator to the first element of the list.
|
inline |
get an iterator to the element following the last element of the list.
|
inline |
remove all elements from the list.
|
staticprotectednoexcept |
get the name of the given option.
| code | option code. |
|
inline |
check if there is an element identified by code in the list.
| code | code of the element to search for. |
|
staticprotected |
store a list of bytes in the given option.
| code | option code. |
| value | value to store. |
| out | converted value. |
|
inlinestaticprotected |
convert a string to the type the given option carries.
| code | option code. |
| value | value to convert. |
| out | converted value. |
|
inlinestaticprotected |
store an IP address in the given option.
| code | option code. |
| value | value to store. |
| out | converted value. |
|
staticprotected |
store a list of IP addresses in the given option.
| code | option code. |
| value | value to store. |
| out | converted value. |
|
inlinestaticprotected |
store a hardware address in the given option.
| code | option code. |
| value | value to store. |
| out | converted value. |
|
staticprotected |
convert a string to the type the given option carries.
| code | option code. |
| value | value to convert. |
| out | converted value. |
|
staticprotected |
store a list of words in the given option.
| code | option code. |
| value | value to store. |
| out | converted value. |
|
inlinestaticprotected |
convert an integer to the type the given option carries.
| code | option code. |
| value | value to convert. |
| out | converted value. |
|
staticnoexcept |
get the description of the given option.
| code | option code. |
|
inline |
dump the options in string format.
|
inline |
check if the list has no element.
|
inline |
get an iterator to the element following the last element of the list.
|
inline |
remove the element identified by code.
| code | code to compare to. |
|
inline |
find the element with the given code.
| code | code of the element to search for. |
|
inlinestaticprotectednoexcept |
check that a signed value can be represented by the target type.
| value | value to check. |
|
inlinestaticprotectednoexcept |
check that an unsigned value can be represented by the target type.
| value | value to check. |
|
inline |
get the value identified by code if it is present and holds the requested type.
| code | code used to locate the value. |
|
inline |
insert elements from range.
| first | first element to insert. |
| last | last element to insert. |
|
inline |
add an option to the list, converting the value to the type the option carries.
| code | option code. |
| value | option value. |
|
inlinestaticprotectednoexcept |
report an invalid option value.
|
inlinestatic |
check that a value can be carried by the given option.
| code | option code. |
| value | option value. |
|
default |
assign instance by copy.
| other | other object to copy. |
|
default |
assign instance by move.
| other | other object to move. |
|
inline |
get the number of options in the list.
|
inlinestaticprotected |
store an integer value as the given target type.
| info | option description. |
| value | value to store. |
| out | converted value. |
|
inline |
exchange the contents of the list with those of other.
| other | list to exchange the contents with. |
|
staticprotected |
write an option value in string format.
| stream | stream to write to. |
| code | option code. |
| value | option value. |
|
friend |
friendship with not equal operator.
| lhs | options to compare. |
| rhs | options to compare to. |
|
friend |
friendship with lower operator.
| lhs | options to compare. |
| rhs | options to compare to. |
|
friend |
friendship with lower or equal operator.
| lhs | options to compare. |
| rhs | options to compare to. |
|
friend |
friendship with equal operator.
| lhs | options to compare. |
| rhs | options to compare to. |
|
friend |
friendship with greater operator.
| lhs | options to compare. |
| rhs | options to compare to. |
|
friend |
friendship with greater or equal operator.
| lhs | options to compare. |
| rhs | options to compare to. |
|
protected |
options.