Browse code

intop (==, <, >, <=, >=) is supported between two integer AVP values

Miklos Tirpak authored on 23/04/2008 12:55:17
Showing 2 changed files
... ...
@@ -1587,6 +1587,7 @@ exp_elem:
1587 1587
 	| attr_id_val intop NUMBER	{$$=mk_elem( $2, AVP_O, (void*)$1, NUMBER_ST, (void*)$3); }
1588 1588
 	| attr_id_val binop NUMBER	{$$=mk_elem( $2, AVP_O, (void*)$1, NUMBER_ST, (void*)$3); }
1589 1589
 	| attr_id_val strop attr_id_val {$$=mk_elem( $2, AVP_O, (void*)$1, AVP_ST, (void*)$3); }
1590
+	| attr_id_val intop attr_id_val {$$=mk_elem( $2, AVP_O, (void*)$1, AVP_ST, (void*)$3); }
1590 1591
 
1591 1592
 	| select_id                 { $$=mk_elem( NO_OP, SELECT_O, $1, 0, 0); }
1592 1593
 	| select_id strop STRING    { $$=mk_elem( $2, SELECT_O, $1, STRING_ST, $3); }
... ...
@@ -814,6 +814,8 @@ inline static int comp_avp(int op, avp_spec_t* spec, int rtype, union exp_op* r,
814 814
 				}
815 815
 				num_val.numval=uval;
816 816
 				return comp_num(op, val.n, NUMBER_ST, &num_val);
817
+			case AVP_ST:
818
+				return comp_num(op, val.n, rtype, r);
817 819
 			default:
818 820
 				LOG(L_CRIT, "BUG: comp_avp: invalid type for numeric avp "
819 821
 							"comparison (%d)\n", rtype);