Kea 2.7.5
|
Token that represents a value of an option within a DHCPv6 relay encapsulation. More...
#include <token.h>
Public Member Functions | |
TokenRelay6Option (const int8_t nest_level, const uint16_t option_code, const RepresentationType &rep_type) | |
Constructor that takes a nesting level and an option code as parameters. | |
int8_t | getNest () const |
Returns nest-level. | |
Public Member Functions inherited from isc::dhcp::TokenOption | |
TokenOption (const uint16_t option_code, const RepresentationType &rep_type) | |
Constructor that takes an option code as a parameter. | |
virtual unsigned | evaluate (Pkt &pkt, ValueStack &values) |
Evaluates the values of the option. | |
uint16_t | getCode () const |
Returns option-code. | |
RepresentationType | getRepresentation () const |
Returns representation-type. | |
Public Member Functions inherited from isc::dhcp::Token | |
virtual | ~Token () |
Virtual destructor. | |
virtual unsigned | getLabel () const |
Return the label of this token. | |
Protected Member Functions | |
virtual OptionPtr | getOption (Pkt &pkt) |
Attempts to obtain specified option from the specified relay block. | |
Protected Member Functions inherited from isc::dhcp::TokenOption | |
virtual std::string | pushFailure (ValueStack &values) |
Auxiliary method that puts string representing a failure. | |
Protected Attributes | |
int8_t | nest_level_ |
nesting level of the relay block to use | |
Protected Attributes inherited from isc::dhcp::TokenOption | |
uint16_t | option_code_ |
Code of the option to be extracted. | |
RepresentationType | representation_type_ |
Representation type. | |
Additional Inherited Members | |
Public Types inherited from isc::dhcp::TokenOption | |
enum | RepresentationType { TEXTUAL , HEXADECIMAL , EXISTS } |
Token representation type. More... | |
Static Public Member Functions inherited from isc::dhcp::Token | |
static bool | toBool (std::string value) |
Coverts a (string) value to a boolean. | |
Token that represents a value of an option within a DHCPv6 relay encapsulation.
This represents a reference to a given option similar to TokenOption but from within the information from a relay. In the expression relay6[nest-level].option[option-code], nest-level indicates which of the relays to examine and option-code which option to extract.
During the evaluation it tries to extract the value of the specified option from the requested relay block. If the relay block doesn't exist or the option is not found an empty string ("") is returned (or "false" when the representation is EXISTS).
The nesting level can go from 0 (closest to the server) to 31, or from -1 (closest to the client) to -32
|
inline |
|
inline |
Returns nest-level.
This method is used in testing to determine if the parser has instantiated TokenRelay6Option with correct parameters.
Definition at line 546 of file token.h.
References nest_level_.
Attempts to obtain specified option from the specified relay block.
pkt | DHCPv6 packet that hopefully contains the proper relay block |
Reimplemented from isc::dhcp::TokenOption.
Definition at line 471 of file token.cc.
References isc_throw, nest_level_, isc::dhcp::TokenOption::option_code_, and isc::dhcp::Pkt6::relay_info_.
|
protected |
nesting level of the relay block to use
Definition at line 556 of file token.h.
Referenced by getNest(), and getOption().