Kea: isc::dhcp::TokenPkt6 Class Reference

| Kea 3.2.0-git

isc::dhcp::TokenPkt6 Class Reference

Token that represents fields of DHCPv6 packet. More...

`#include <token.h>`

Inheritance diagram for isc::dhcp::TokenPkt6:
[legend]

## Public Types
enum | FieldType : uint16_t { MSGTYPE , TRANSID }
| enum value that determines the field. More...

## Public Member Functions
| TokenPkt6 (const FieldType type)
| Constructor (does nothing).
virtual unsigned | evaluate (Pkt &pkt, ValueStack &values)
| Gets a value of 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.

## Detailed Description

Token that represents fields of DHCPv6 packet.

For example in the expression pkt6.msgtype == 1 this token represents the message type of the DHCPv6 packet. The integer values are placed on the value stack as 4 byte strings.

Currently supported fields are:

- msgtype
- transid

Definition at line 674 of file token.h.

## Member Enumeration Documentation

## ◆ FieldType

enum isc::dhcp::TokenPkt6::FieldType : uint16_t

enum value that determines the field.

Enumerator
MSGTYPE | msg type
TRANSID | transaction id (integer but manipulated as a string)

Definition at line 677 of file token.h.

## Constructor & Destructor Documentation

## ◆ TokenPkt6()

isc::dhcp::TokenPkt6::TokenPkt6 | ( | const FieldType | type | ) |
| inline

Constructor (does nothing).

Definition at line 683 of file token.h.

## Member Function Documentation

## ◆ evaluate()

unsigned TokenPkt6::evaluate | ( | Pkt & | pkt,
|  | ValueStack & | values )
| virtual

Gets a value of the specified packet.

The evaluation uses fields that are available in the packet. It does not require any values to be present on the stack.

Exceptions

  EvalTypeError | when called for a DHCPv4 packet

Parameters

  pkt | - packet from which to extract the fields
  values | - stack of values, 1 result will be pushed

Returns
  0 which means evaluate next token if any.

Implements isc::dhcp::Token.

Definition at line 641 of file token.cc.

References isc::dhcp::EVAL_DBG_STACK, isc::dhcp::EVAL_DEBUG_PKT6, isc::dhcp::eval_logger, isc::eval::EvalContext::fromUint32(), isc::dhcp::Pkt::getLabel(), isc::dhcp::Pkt::getTransid(), isc::dhcp::Pkt6::getType(), isc_throw, LOG_DEBUG, MSGTYPE, toHex(), and TRANSID.

Here is the call graph for this function:

## ◆ getType()

FieldType isc::dhcp::TokenPkt6::getType | ( |  | ) |
| inline

Returns field type.

This method is used only in tests.

Returns
  type of the field.

Definition at line 702 of file token.h.

The documentation for this class was generated from the following files:

- token.h
- token.cc