intop (==, <, >, <=, >=) is supported between two integer AVP values
authorMiklos Tirpak <miklos@iptel.org>
Wed, 23 Apr 2008 12:55:17 +0000 (12:55 +0000)
committerMiklos Tirpak <miklos@iptel.org>
Wed, 23 Apr 2008 12:55:17 +0000 (12:55 +0000)
cfg.y
route.c

diff --git a/cfg.y b/cfg.y
index 2c43015..68b1ec0 100644 (file)
--- a/cfg.y
+++ b/cfg.y
@@ -1587,6 +1587,7 @@ exp_elem:
        | attr_id_val intop NUMBER      {$$=mk_elem( $2, AVP_O, (void*)$1, NUMBER_ST, (void*)$3); }
        | attr_id_val binop NUMBER      {$$=mk_elem( $2, AVP_O, (void*)$1, NUMBER_ST, (void*)$3); }
        | attr_id_val strop attr_id_val {$$=mk_elem( $2, AVP_O, (void*)$1, AVP_ST, (void*)$3); }
+       | attr_id_val intop attr_id_val {$$=mk_elem( $2, AVP_O, (void*)$1, AVP_ST, (void*)$3); }
 
        | select_id                 { $$=mk_elem( NO_OP, SELECT_O, $1, 0, 0); }
        | select_id strop STRING    { $$=mk_elem( $2, SELECT_O, $1, STRING_ST, $3); }
diff --git a/route.c b/route.c
index 77a8128..a58ab93 100644 (file)
--- a/route.c
+++ b/route.c
@@ -814,6 +814,8 @@ inline static int comp_avp(int op, avp_spec_t* spec, int rtype, union exp_op* r,
                                }
                                num_val.numval=uval;
                                return comp_num(op, val.n, NUMBER_ST, &num_val);
+                       case AVP_ST:
+                               return comp_num(op, val.n, rtype, r);
                        default:
                                LOG(L_CRIT, "BUG: comp_avp: invalid type for numeric avp "
                                                        "comparison (%d)\n", rtype);