MCPcopy Create free account
hub / github.com/OpenSIPS/opensips / internal_check_rt

Function internal_check_rt

modules/drouting/prefix_tree.c:83–120  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

81
82
83static inline rt_info_t*
84internal_check_rt(
85 ptree_node_t *ptn,
86 unsigned int rgid,
87 int *rgidx
88 )
89{
90 int i,j;
91 int rg_pos=0;
92 rg_entry_t* rg=NULL;
93 rt_info_wrp_t* rtlw=NULL;
94
95 if((NULL==ptn) || (NULL==ptn->rg))
96 goto err_exit;
97 rg_pos = ptn->rg_pos;
98 rg=ptn->rg;
99 for(i=0;(i<rg_pos) && (rg[i].rgid!=rgid);i++);
100 if(i<rg_pos) {
101 LM_DBG("found rgid %d (rule list %p)\n",
102 rgid, rg[i].rtlw);
103 rtlw=rg[i].rtlw;
104 j = 0;
105 while(rtlw!=NULL) {
106 if ( j++ >= *rgidx) {
107 if (!rtlw->rtl->time_rec || tmrec_expr_check(rtlw->rtl->time_rec) == 1)
108 goto ok_exit;
109 }
110 rtlw=rtlw->next;
111 }
112 }
113err_exit:
114 return NULL;
115
116ok_exit:
117 /* if rules are still in this node, point to the next index */
118 *rgidx = (rtlw->next) ? j : 0 ;
119 return rtlw->rtl;
120}
121
122
123rt_info_t*

Callers 3

check_rtFunction · 0.85
_check_rtFunction · 0.85
get_prefixFunction · 0.85

Calls 1

tmrec_expr_checkFunction · 0.85

Tested by

no test coverage detected