![]() |
Kea 3.0.0
|
Token that represents fields of a DHCPv4 packet. More...
#include <token.h>
Public Types | |
| enum | FieldType : int { CHADDR , GIADDR , CIADDR , YIADDR , SIADDR , HLEN , HTYPE , MSGTYPE , TRANSID } |
| enum value that determines the field. More... | |
Public Member Functions | |
| TokenPkt4 (const FieldType type) | |
| Constructor (does nothing) | |
| virtual unsigned | evaluate (Pkt &pkt, ValueStack &values) |
| Gets a value from the specified packet. | |
| 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. | |
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 fields of a DHCPv4 packet.
For example in the expression pkt4.chaddr == 0x0102030405 this token represents the pkt4.chaddr expression.
Currently supported fields are:
| enum isc::dhcp::TokenPkt4::FieldType : int |
enum value that determines the field.
|
inline |
|
virtual |
Gets a value from the specified packet.
Evaluation uses fields available in the packet. It does not require any values to be present on the stack.
| EvalTypeError | when called for DHCPv6 packet |
| pkt | - fields will be extracted from here |
| values | - stack of values (1 result will be pushed) |
Implements isc::dhcp::Token.
Definition at line 560 of file token.cc.
References CHADDR, CIADDR, isc::dhcp::EVAL_DBG_STACK, isc::dhcp::EVAL_DEBUG_PKT4, isc::dhcp::eval_logger, isc::eval::EvalContext::fromUint32(), isc::dhcp::Pkt4::getCiaddr(), isc::dhcp::Pkt4::getGiaddr(), isc::dhcp::Pkt4::getHlen(), isc::dhcp::Pkt4::getHtype(), isc::dhcp::Pkt4::getHWAddr(), isc::dhcp::Pkt::getLabel(), isc::dhcp::Pkt4::getSiaddr(), isc::dhcp::Pkt::getTransid(), isc::dhcp::Pkt4::getType(), isc::dhcp::Pkt4::getYiaddr(), GIADDR, HLEN, HTYPE, isc_throw, LOG_DEBUG, MSGTYPE, SIADDR, isc::asiolink::IOAddress::toBytes(), toHex(), TRANSID, and YIADDR.
|
inline |