Kea 2.7.5
|
Token that represents a value of a field within a DHCPv6 relay encapsulation. More...
#include <token.h>
Public Types | |
enum | FieldType : int { PEERADDR , LINKADDR } |
enum value that determines the field. More... | |
Public Member Functions | |
TokenRelay6Field (const int8_t nest_level, const FieldType type) | |
Constructor that takes a nesting level and field type as parameters. | |
virtual unsigned | evaluate (Pkt &pkt, ValueStack &values) |
Extracts the specified field from the requested relay. | |
int8_t | getNest () const |
Returns nest-level. | |
FieldType | getType () |
Returns field type. | |
Public Member Functions inherited from isc::dhcp::Token | |
virtual | ~Token () |
Virtual destructor. | |
virtual unsigned | getLabel () const |
Return the label of this token. | |
Protected Attributes | |
int8_t | nest_level_ |
Specifies field of the DHCPv6 relay option to get. | |
FieldType | type_ |
field to get | |
Additional Inherited Members | |
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 a field within a DHCPv6 relay encapsulation.
This represents a reference to a field with a given DHCPv6 relay encapsulation. In the expression relay6[nest-level].field-name, nest-level indicates which of the relays to examine and field-name which of the fields to extract.
During the evaluation it tries to extract the value of the specified field from the requested relay block. If the relay block doesn't exist an empty string ("") is returned. If the relay block does exist the field is always returned as a 16 byte IPv6 address. As the relay may not have set the field it may be 0s.
The nesting level can go from 0 (closest to the server) to 31, or from -1 (closest to the client) to -32
enum isc::dhcp::TokenRelay6Field::FieldType : int |
|
inline |
|
virtual |
Extracts the specified field from the requested relay.
Evaluation uses fields available in the packet. It does not require any values to be present on the stack.
pkt | fields will be extracted from here |
values | - stack of values (1 result will be pushed) |
Implements isc::dhcp::Token.
Definition at line 683 of file token.cc.
References isc::dhcp::EVAL_DBG_STACK, isc::dhcp::EVAL_DEBUG_RELAY6, isc::dhcp::EVAL_DEBUG_RELAY6_RANGE, isc::dhcp::eval_logger, isc_throw, LINKADDR, LOG_DEBUG, nest_level_, PEERADDR, isc::dhcp::Pkt6::relay_info_, and type_.
|
inline |
Returns nest-level.
This method is used in testing to determine if the parser has instantiated TokenRelay6Field with correct parameters.
Definition at line 760 of file token.h.
References nest_level_.
|
inline |
Returns field type.
This method is used only in testing to determine if the parser has instantiated TokenRelay6Field with correct parameters.
Definition at line 770 of file token.h.
References type_.
|
protected |
Specifies field of the DHCPv6 relay option to get.
nesting level of the relay block to use
Definition at line 776 of file token.h.
Referenced by evaluate(), and getNest().
|
protected |