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

Function hash_rule

modules/drouting/dr_load.c:109–131  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

107}
108
109void hash_rule(char* grplst, str* prefix, rt_info_t* rule, MD5_CTX* hash_ctx)
110{
111 int i;
112
113 if (hash_ctx == NULL)
114 return;
115
116 MD5Update(hash_ctx, grplst, strlen(grplst));
117 if (prefix->s && prefix->len)
118 MD5Update(hash_ctx, prefix->s, prefix->len);
119
120 MD5Update(hash_ctx, (char *)&rule->priority, sizeof(rule->priority));
121 if (rule->attrs.s && rule->attrs.len)
122 MD5Update(hash_ctx, rule->attrs.s, rule->attrs.len);
123 MD5Update(hash_ctx, (char *)rule->sort_alg, sizeof(rule->sort_alg));
124
125 for (i=0;i<rule->pgwa_len;i++) {
126 if (rule->pgwl[i].is_carrier == 1)
127 hash_carrier(rule->pgwl[i].dst.carrier,hash_ctx);
128 else
129 hash_dst(rule->pgwl[i].dst.gw,hash_ctx);
130 }
131}
132
133static int add_rule(rt_data_t *rdata, char *grplst, str *prefix,
134 rt_info_t *rule, osips_malloc_f malloc_f, osips_free_f free_f,MD5_CTX* hash_ctx)

Callers 1

add_ruleFunction · 0.70

Calls 3

MD5UpdateFunction · 0.85
hash_carrierFunction · 0.85
hash_dstFunction · 0.85

Tested by

no test coverage detected