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

Function hash_carrier

modules/drouting/routing.c:248–268  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

246}
247
248void hash_carrier(pcr_t *pcr,MD5_CTX *hash_ctx)
249{
250 int i;
251
252 if (hash_ctx == NULL)
253 return;
254
255 MD5Update(hash_ctx, pcr->id.s, pcr->id.len);
256 MD5Update(hash_ctx, (char *)&pcr->sort_alg, sizeof(pcr->sort_alg));
257 for (i=0;i<pcr->pgwa_len;i++) {
258 if (pcr->pgwl[i].is_carrier == 1)
259 hash_carrier(pcr->pgwl[i].dst.carrier,hash_ctx);
260 else
261 hash_dst(pcr->pgwl[i].dst.gw,hash_ctx);
262
263 MD5Update(hash_ctx, (char *)&pcr->pgwl[i].weight, sizeof(pcr->pgwl[i].weight));
264 }
265
266 if (pcr->attrs.s && pcr->attrs.len)
267 MD5Update(hash_ctx, pcr->attrs.s, pcr->attrs.len);
268}
269
270int add_carrier(char *id, int flags, char *sort_alg, char *gwlist, char *attrs,
271 int state, rt_data_t *rd,

Callers 2

hash_ruleFunction · 0.85
add_carrierFunction · 0.85

Calls 2

MD5UpdateFunction · 0.85
hash_dstFunction · 0.85

Tested by

no test coverage detected