return -1;
}
- /*
- * The RHS is a compiled regex, which we don't yet
- * support. So just re-parse it at run time for
- * programmer laziness.
- */
- if ((map->op == T_OP_REG_EQ) || (map->op == T_OP_REG_NE)) {
- if (box->type != FR_TYPE_STRING) {
- fr_strerror_const("Invalid type for regular expression");
- return -1;
- }
-
- rcode = fr_regex_cmp_op(map->op, &vp->data, box);
- TALLOC_FREE(to_free);
- if (rcode < 0) return rcode;
-
- return (rcode == 1);
- }
-
/*
* Let the calculation code do upcasting as necessary.
*/
RCSID("$Id$")
#include <freeradius-devel/util/strerror.h>
+#include <freeradius-devel/util/regex.h>
#include <math.h>
#include "calc.h"
op = T_OP_NE;
break;
+ case T_OP_REG_EQ:
+ case T_OP_REG_NE:
+ if (b->type != FR_TYPE_STRING) {
+ fr_strerror_const("Invalid type for regular expression");
+ return -1;
+ }
+
+ rcode = fr_regex_cmp_op(op, a, b);
+ if (rcode < 0) return rcode;
+
+ fr_value_box_init(dst, FR_TYPE_BOOL, NULL, false); /* @todo - enum */
+ dst->vb_bool = (rcode != 0);
+ return 0;
+
default:
break;
}