Revision ae80a2de nest/rt-attr.c
nest/rt-attr.c | ||
---|---|---|
98 | 98 |
HASH_INIT(src_hash, rta_pool, RSH_INIT_ORDER); |
99 | 99 |
} |
100 | 100 |
|
101 |
static inline int u32_cto(unsigned int x) { return ffs(~x) - 1; }
|
|
101 |
static inline int u32_cto(uint x) { return ffs(~x) - 1; } |
|
102 | 102 |
|
103 | 103 |
static inline u32 |
104 | 104 |
rte_src_alloc_id(void) |
... | ... | |
195 | 195 |
* Multipath Next Hop |
196 | 196 |
*/ |
197 | 197 |
|
198 |
static inline unsigned int
|
|
198 |
static inline uint |
|
199 | 199 |
mpnh_hash(struct mpnh *x) |
200 | 200 |
{ |
201 |
unsigned int h = 0;
|
|
201 |
uint h = 0; |
|
202 | 202 |
for (; x; x = x->next) |
203 | 203 |
h ^= ipa_hash(x->gw); |
204 | 204 |
|
... | ... | |
666 | 666 |
} |
667 | 667 |
|
668 | 668 |
static inline void |
669 |
opaque_format(struct adata *ad, byte *buf, unsigned int size)
|
|
669 |
opaque_format(struct adata *ad, byte *buf, uint size) |
|
670 | 670 |
{ |
671 | 671 |
byte *bound = buf + size - 10; |
672 | 672 |
int i; |
... | ... | |
838 | 838 |
* ea_hash() takes an extended attribute list and calculated a hopefully |
839 | 839 |
* uniformly distributed hash value from its contents. |
840 | 840 |
*/ |
841 |
inline unsigned int
|
|
841 |
inline uint |
|
842 | 842 |
ea_hash(ea_list *e) |
843 | 843 |
{ |
844 | 844 |
u32 h = 0; |
... | ... | |
900 | 900 |
* rta's |
901 | 901 |
*/ |
902 | 902 |
|
903 |
static unsigned int rta_cache_count;
|
|
904 |
static unsigned int rta_cache_size = 32;
|
|
905 |
static unsigned int rta_cache_limit;
|
|
906 |
static unsigned int rta_cache_mask;
|
|
903 |
static uint rta_cache_count; |
|
904 |
static uint rta_cache_size = 32; |
|
905 |
static uint rta_cache_limit; |
|
906 |
static uint rta_cache_mask; |
|
907 | 907 |
static rta **rta_hash_table; |
908 | 908 |
|
909 | 909 |
static void |
... | ... | |
917 | 917 |
rta_cache_mask = rta_cache_size - 1; |
918 | 918 |
} |
919 | 919 |
|
920 |
static inline unsigned int
|
|
920 |
static inline uint |
|
921 | 921 |
rta_hash(rta *a) |
922 | 922 |
{ |
923 | 923 |
return (((uint) (uintptr_t) a->src) ^ ipa_hash(a->gw) ^ |
... | ... | |
957 | 957 |
static inline void |
958 | 958 |
rta_insert(rta *r) |
959 | 959 |
{ |
960 |
unsigned int h = r->hash_key & rta_cache_mask;
|
|
960 |
uint h = r->hash_key & rta_cache_mask; |
|
961 | 961 |
r->next = rta_hash_table[h]; |
962 | 962 |
if (r->next) |
963 | 963 |
r->next->pprev = &r->next; |
... | ... | |
968 | 968 |
static void |
969 | 969 |
rta_rehash(void) |
970 | 970 |
{ |
971 |
unsigned int ohs = rta_cache_size;
|
|
972 |
unsigned int h;
|
|
971 |
uint ohs = rta_cache_size; |
|
972 |
uint h; |
|
973 | 973 |
rta *r, *n; |
974 | 974 |
rta **oht = rta_hash_table; |
975 | 975 |
|
... | ... | |
1002 | 1002 |
rta_lookup(rta *o) |
1003 | 1003 |
{ |
1004 | 1004 |
rta *r; |
1005 |
unsigned int h;
|
|
1005 |
uint h; |
|
1006 | 1006 |
|
1007 | 1007 |
ASSERT(!(o->aflags & RTAF_CACHED)); |
1008 | 1008 |
if (o->eattrs) |
... | ... | |
1093 | 1093 |
rta_dump_all(void) |
1094 | 1094 |
{ |
1095 | 1095 |
rta *a; |
1096 |
unsigned int h;
|
|
1096 |
uint h; |
|
1097 | 1097 |
|
1098 | 1098 |
debug("Route attribute cache (%d entries, rehash at %d):\n", rta_cache_count, rta_cache_limit); |
1099 | 1099 |
for(h=0; h<rta_cache_size; h++) |
Also available in: Unified diff