version 1.1, 2012/02/21 17:26:11
|
version 1.1.1.3, 2013/07/21 23:54:37
|
Line 99 ecommunity_add_val (struct ecommunity *ecom, struct ec
|
Line 99 ecommunity_add_val (struct ecommunity *ecom, struct ec
|
/* This function takes pointer to Extended Communites strucutre then |
/* This function takes pointer to Extended Communites strucutre then |
create a new Extended Communities structure by uniq and sort each |
create a new Extended Communities structure by uniq and sort each |
Extended Communities value. */ |
Extended Communities value. */ |
static struct ecommunity * | struct ecommunity * |
ecommunity_uniq_sort (struct ecommunity *ecom) |
ecommunity_uniq_sort (struct ecommunity *ecom) |
{ |
{ |
int i; |
int i; |
Line 233 unsigned int
|
Line 233 unsigned int
|
ecommunity_hash_make (void *arg) |
ecommunity_hash_make (void *arg) |
{ |
{ |
const struct ecommunity *ecom = arg; |
const struct ecommunity *ecom = arg; |
|
int size = ecom->size * ECOMMUNITY_SIZE; |
|
u_int8_t *pnt = ecom->val; |
|
unsigned int key = 0; |
int c; |
int c; |
unsigned int key; |
|
u_int8_t *pnt; |
|
|
|
key = 0; | for (c = 0; c < size; c += ECOMMUNITY_SIZE) |
pnt = ecom->val; | { |
| key += pnt[c]; |
for (c = 0; c < ecom->size * ECOMMUNITY_SIZE; c++) | key += pnt[c + 1]; |
key += pnt[c]; | key += pnt[c + 2]; |
| key += pnt[c + 3]; |
| key += pnt[c + 4]; |
| key += pnt[c + 5]; |
| key += pnt[c + 6]; |
| key += pnt[c + 7]; |
| } |
|
|
return key; |
return key; |
} |
} |