16 for (
auto const& it : expr) {
17 it->evaluate(pkt, values);
19 if (values.size() != 1) {
21 "1 value at the end of evaluation, got " << values.size());
29 for (
auto const& it : expr) {
30 it->evaluate(pkt, values);
32 if (values.size() != 1) {
34 "1 value at the end of evaluation, got " << values.size());
36 return (values.top());
EvalBadStack is thrown when more or less parameters are on the stack than expected.
Base class for classes representing DHCP messages.
static bool toBool(std::string value)
Coverts a (string) value to a boolean.
#define isc_throw(type, stream)
A shortcut macro to insert known values into exception arguments.
std::string evaluateString(const Expression &expr, Pkt &pkt)
bool evaluateBool(const Expression &expr, Pkt &pkt)
Evaluate a RPN expression for a v4 or v6 packet and return a true or false decision.
std::vector< TokenPtr > Expression
This is a structure that holds an expression converted to RPN.
std::stack< std::string > ValueStack
Evaluated values are stored as a stack of strings.
Defines the logger used by the top-level component of kea-lfc.