| 246 | } |
| 247 | |
| 248 | void 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 | |
| 270 | int add_carrier(char *id, int flags, char *sort_alg, char *gwlist, char *attrs, |
| 271 | int state, rt_data_t *rd, |
no test coverage detected