Kea
1.9.9-git
|
Token that represents a value of a field within a DHCPv6 relay encapsulation. More...
#include <token.h>
Public Types | |
enum | FieldType { 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. More... | |
void | evaluate (Pkt &pkt, ValueStack &values) |
Extracts the specified field from the requested relay. More... | |
int8_t | getNest () const |
Returns nest-level. More... | |
FieldType | getType () |
Returns field type. More... | |
Public Member Functions inherited from isc::dhcp::Token | |
virtual | ~Token () |
Virtual destructor. More... | |
Protected Attributes | |
int8_t | nest_level_ |
Specifies field of the DHCPv6 relay option to get. More... | |
FieldType | type_ |
field to get More... | |
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. More... | |
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
|
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 598 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::dhcp::Pkt6::getRelay6LinkAddress(), isc::dhcp::Pkt6::getRelay6PeerAddress(), isc_throw, LINKADDR, LOG_DEBUG, nest_level_, PEERADDR, isc::dhcp::Pkt6::relay_info_, isc::asiolink::IOAddress::toBytes(), isc::util::encode::toHex(), 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 697 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 707 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 713 of file token.h.
Referenced by evaluate(), and getNest().
|
protected |