Kaynağa Gözat

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

Miklos Tirpak 17 yıl önce
ebeveyn
işleme
0c924c149f
2 değiştirilmiş dosya ile 3 ekleme ve 0 silme
  1. 1 0
      cfg.y
  2. 2 0
      route.c

+ 1 - 0
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); }

+ 2 - 0
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);