add: DBG("DEBUG:avpops:check_avp: checked failed\n");
context: int ops_check_avp( struct sip_msg* msg, struct fis_param* ap,													struct fis_param* val){	unsigned short    name_type;	struct usr_avp    *avp1;	struct usr_avp    *avp2;	int_str           avp_val;	int_str           ck_val;	str               s_ip;	int               ck_flg;	int               n;	/* look if the required avp(s) is/are present */	name_type = (((ap->flags&AVPOPS_VAL_INT))?0:AVP_NAME_STR);	avp1 = search_first_avp( name_type, ap->val, &avp_val);	if (avp1==0)	{		DBG("DEBUG:avpops:check_avp: no avp found to check\n");		goto error;	}cycle1:	if (val->flags&AVPOPS_VAL_AVP)	{		/* the 2nd operator is an avp name -> get avp val */		name_type = (((val->flags&AVPOPS_VAL_INT))?0:AVP_NAME_STR);		avp2 = search_first_avp( name_type, val->val, &ck_val);		ck_flg = avp2->flags&AVP_VAL_STR?AVPOPS_VAL_STR:AVPOPS_VAL_INT;	} else {		ck_val = val->val;		ck_flg = val->flags;		avp2 = 0;	}cycle2:	/* are both values of the same type? */	if ( !( (avp1->flags&AVP_VAL_STR && ck_flg&AVPOPS_VAL_STR) ||		((avp1->flags&AVP_VAL_STR)==0 && ck_flg&AVPOPS_VAL_INT) ||		(avp1->flags&AVP_VAL_STR && ck_flg&AVPOPS_VAL_NONE)))	{		LOG(L_ERR,"ERROR:avpops:check_avp: value types don't match\n");		goto next;	}	if (avp1->flags&AVP_VAL_STR)	{		/* string values to check */		if (val->flags&AVPOPS_VAL_NONE)		{			/* value is variable */			if (val->flags&AVPOPS_USE_SRC_IP)			{				/* get value from src_ip */				if ( (s_ip.s=ip_addr2a( &msg->rcv.src_ip ))==0)				{					LOG(L_ERR,"ERROR:avpops:check_avp: cannot get src_ip\n");					goto error;				}				s_ip.len = strlen(s_ip.s);				ck_val.s = &s_ip;			} else {				/* get value from uri */				if ( (ck_val.s=get_source_uri(msg,val->flags))==0 )				{					LOG(L_ERR,"ERROR:avpops:check_avp: cannot get uri\n");					goto next;				}			}		}		DBG("DEBUG:avpops:check_avp: check <%.*s> against <%.*s> as str\n",			avp_val.s->len,avp_val.s->s, ck_val.s->len,ck_val.s->s);		/* do check */		if (val->flags&AVPOPS_OP_EQ)		{			if (avp_val.s->len!=ck_val.s->len)				return -1;			if (val->flags&AVPOPS_FLAG_CI)			{				if (strncasecmp(avp_val.s->s,ck_val.s->s,ck_val.s->len)==0)					return 1;			} else {				if (strncmp(avp_val.s->s,ck_val.s->s,ck_val.s->len)==0 )					return 1;			}		} else if (val->flags&AVPOPS_OP_LT) {			n = (avp_val.s->len>=ck_val.s->len)?avp_val.s->len:ck_val.s->len;			if (strncasecmp(avp_val.s->s,ck_val.s->s,n)==-1)				return 1;		} else if (val->flags&AVPOPS_OP_GT) {			n = (avp_val.s->len>=ck_val.s->len)?avp_val.s->len:ck_val.s->len;			if (strncasecmp(avp_val.s->s,ck_val.s->s,n)==1)				return 1;		} else {			LOG(L_CRIT,"BUG:avpops:check_avp: unknown operation "				"(flg=%d)\n",val->flags);		}	} else {		/* int values to check -> do check */		DBG("DEBUG:avpops:check_avp: check <%d> against <%d> as int\n",				avp_val.n, ck_val.n);		if (val->flags&AVPOPS_OP_EQ)		{			if ( avp_val.n==ck_val.n)				return 1;		} else if (val->flags&AVPOPS_OP_LT) {			if ( avp_val.n<ck_val.n)				return 1;		} else if (val->flags&AVPOPS_OP_GT) {			if ( avp_val.n>ck_val.n)				return 1;		} else {			LOG(L_CRIT,"BUG:avpops:check_avp: unknown operation "				"(flg=%d)\n",val->flags);		}	}next:	/* cycle for the second value (only if avp can have multiple vals) */	if ((val->flags&AVPOPS_VAL_AVP)&&(avp2=search_next_avp(avp2,&ck_val))!=0)	{		//assert(0);		ck_flg = avp2->flags&AVP_VAL_STR?AVPOPS_VAL_STR:AVPOPS_VAL_INT;		goto cycle2;	/* cycle for the first value -> next avp */	} else {		avp1=(val->flags&AVPOPS_FLAG_ALL)?search_next_avp(avp1,&avp_val):0;		if (avp1)			goto cycle1;	}	return -1; /* check failed */error:	return -1;}