rem: return (((unsigned long)dir)==RR_FLOW_UPSTREAM)?1:-1;
add: return (dir==RR_FLOW_UPSTREAM)?0:-1;
context: int is_direction(struct sip_msg * msg, char *dir, char *foo){	static str ftag_param = {"ftag",4};	static unsigned int last_id = (unsigned int)-1;	static unsigned int last_dir = 0;	str ftag_val;	str tag;	if ( last_id==msg->id && last_dir!=0) {		if (last_dir==RR_FLOW_UPSTREAM)			goto upstream;		else			goto downstream;	}	ftag_val.s = 0;	ftag_val.len = 0;	if (get_route_param( msg, &ftag_param, &ftag_val)!=0) {		DBG("DEBUG:rr:is_direction: param ftag not found\n");		goto downstream;	}	if ( ftag_val.s==0 || ftag_val.len==0 ) {		DBG("DEBUG:rr:is_direction: param ftag has empty val\n");		goto downstream;	}	/* get the tag value from FROM hdr */	if ( parse_from_header(msg)!=0 )		goto downstream;	tag = ((struct to_body*)msg->from->parsed)->tag_value;	if (tag.s==0 || tag.len==0)		goto downstream;	/* compare the 2 strings */	if (tag.len!=ftag_val.len || memcmp(tag.s,ftag_val.s,ftag_val.len))		goto upstream;downstream:	last_id = msg->id;	last_dir = RR_FLOW_DOWNSTREAM;	return (((unsigned long)dir)==RR_FLOW_DOWNSTREAM)?1:-1;upstream:	last_id = msg->id;	last_dir = RR_FLOW_UPSTREAM;	return (((unsigned long)dir)==RR_FLOW_UPSTREAM)?1:-1;}