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