Kea: isc::dhcp::TokenEqual Class Reference

| Kea 3.2.0-git

isc::dhcp::TokenEqual Class Reference

Token that represents equality operator (compares two other tokens). More...

`#include <token.h>`

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

## Public Member Functions
| TokenEqual ()
| Constructor (does nothing).
virtual unsigned | evaluate (Pkt &pkt, ValueStack &values)
| Compare two values.
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 equality operator (compares two other tokens).

For example in the expression option[vendor-class].text == "MSFT" this token represents the equal (==) sign.

Definition at line 784 of file token.h.

## Constructor & Destructor Documentation

## ◆ TokenEqual()

isc::dhcp::TokenEqual::TokenEqual | ( |  | ) |
| inline

Constructor (does nothing).

Definition at line 787 of file token.h.

## Member Function Documentation

## ◆ evaluate()

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

Compare two values.

Evaluation does not use packet information, but rather consumes the last two parameters. It does a simple string comparison and sets the value to either "true" or "false". It requires at least two parameters to be present on stack.

Exceptions

  EvalBadStack | if there are less than 2 values on stack

Parameters

  pkt | (unused)
  values | - stack of values (2 arguments will be popped, 1 result will be pushed)

Returns
  0 which means evaluate next token if any.

Implements isc::dhcp::Token.

Definition at line 749 of file token.cc.

References isc::dhcp::EVAL_DBG_STACK, isc::dhcp::EVAL_DEBUG_EQUAL, isc::dhcp::eval_logger, isc::dhcp::Pkt::getLabel(), isc_throw, LOG_DEBUG, and toHex().

Here is the call graph for this function:

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

- token.h
- token.cc