summaryrefslogtreecommitdiff
path: root/nest
diff options
context:
space:
mode:
Diffstat (limited to 'nest')
-rw-r--r--nest/a-path.c2
-rw-r--r--nest/a-set.c4
-rw-r--r--nest/attrs.h6
-rw-r--r--nest/cli.c10
-rw-r--r--nest/cli.h12
-rw-r--r--nest/neighbor.c4
-rw-r--r--nest/proto.c22
-rw-r--r--nest/protocol.h18
-rw-r--r--nest/route.h22
-rw-r--r--nest/rt-attr.c30
-rw-r--r--nest/rt-fib.c10
-rw-r--r--nest/rt-table.c10
12 files changed, 75 insertions, 75 deletions
diff --git a/nest/a-path.c b/nest/a-path.c
index dc36e653..c9c5aefb 100644
--- a/nest/a-path.c
+++ b/nest/a-path.c
@@ -124,7 +124,7 @@ as_path_convert_to_new(struct adata *path, byte *dst, int req_as)
}
void
-as_path_format(struct adata *path, byte *buf, unsigned int size)
+as_path_format(struct adata *path, byte *buf, uint size)
{
byte *p = path->data;
byte *e = p + path->length;
diff --git a/nest/a-set.c b/nest/a-set.c
index 42ef9b06..a6116022 100644
--- a/nest/a-set.c
+++ b/nest/a-set.c
@@ -32,7 +32,7 @@
* the buffer to indicate truncation.
*/
int
-int_set_format(struct adata *set, int way, int from, byte *buf, unsigned int size)
+int_set_format(struct adata *set, int way, int from, byte *buf, uint size)
{
u32 *z = (u32 *) set->data;
byte *end = buf + size - 24;
@@ -113,7 +113,7 @@ ec_format(byte *buf, u64 ec)
}
int
-ec_set_format(struct adata *set, int from, byte *buf, unsigned int size)
+ec_set_format(struct adata *set, int from, byte *buf, uint size)
{
u32 *z = int_set_get_data(set);
byte *end = buf + size - 24;
diff --git a/nest/attrs.h b/nest/attrs.h
index b6e067cb..1d005a6a 100644
--- a/nest/attrs.h
+++ b/nest/attrs.h
@@ -30,7 +30,7 @@ struct f_tree;
struct adata *as_path_prepend(struct linpool *pool, struct adata *olda, u32 as);
int as_path_convert_to_old(struct adata *path, byte *dst, int *new_used);
int as_path_convert_to_new(struct adata *path, byte *dst, int req_as);
-void as_path_format(struct adata *path, byte *buf, unsigned int size);
+void as_path_format(struct adata *path, byte *buf, uint size);
int as_path_getlen(struct adata *path);
int as_path_getlen_int(struct adata *path, int bs);
int as_path_get_first(struct adata *path, u32 *orig_as);
@@ -95,9 +95,9 @@ static inline u64 ec_ip4(u64 kind, u64 key, u64 val)
static inline u64 ec_generic(u64 key, u64 val)
{ return (key << 32) | val; }
-int int_set_format(struct adata *set, int way, int from, byte *buf, unsigned int size);
+int int_set_format(struct adata *set, int way, int from, byte *buf, uint size);
int ec_format(byte *buf, u64 ec);
-int ec_set_format(struct adata *set, int from, byte *buf, unsigned int size);
+int ec_set_format(struct adata *set, int from, byte *buf, uint size);
int int_set_contains(struct adata *list, u32 val);
int ec_set_contains(struct adata *list, u64 val);
struct adata *int_set_add(struct linpool *pool, struct adata *list, u32 val);
diff --git a/nest/cli.c b/nest/cli.c
index 11f98794..83e79616 100644
--- a/nest/cli.c
+++ b/nest/cli.c
@@ -163,7 +163,7 @@ static void
cli_copy_message(cli *c)
{
byte *p, *q;
- unsigned int cnt = 2;
+ uint cnt = 2;
if (c->ring_overflow)
{
@@ -230,12 +230,12 @@ cli_written(cli *c)
static byte *cli_rh_pos;
-static unsigned int cli_rh_len;
+static uint cli_rh_len;
static int cli_rh_trick_flag;
struct cli *this_cli;
static int
-cli_cmd_read_hook(byte *buf, unsigned int max, UNUSED int fd)
+cli_cmd_read_hook(byte *buf, uint max, UNUSED int fd)
{
if (!cli_rh_trick_flag)
{
@@ -330,7 +330,7 @@ static list cli_log_hooks;
static int cli_log_inited;
void
-cli_set_log_echo(cli *c, unsigned int mask, unsigned int size)
+cli_set_log_echo(cli *c, uint mask, uint size)
{
if (c->ring_buf)
{
@@ -351,7 +351,7 @@ cli_set_log_echo(cli *c, unsigned int mask, unsigned int size)
}
void
-cli_echo(unsigned int class, byte *msg)
+cli_echo(uint class, byte *msg)
{
unsigned len, free, i, l;
cli *c;
diff --git a/nest/cli.h b/nest/cli.h
index 396656e8..92f3c3d7 100644
--- a/nest/cli.h
+++ b/nest/cli.h
@@ -40,10 +40,10 @@ typedef struct cli {
struct linpool *parser_pool; /* Pool used during parsing */
byte *ring_buf; /* Ring buffer for asynchronous messages */
byte *ring_end, *ring_read, *ring_write; /* Pointers to the ring buffer */
- unsigned int ring_overflow; /* Counter of ring overflows */
- unsigned int log_mask; /* Mask of allowed message levels */
- unsigned int log_threshold; /* When free < log_threshold, store only important messages */
- unsigned int async_msg_size; /* Total size of async messages queued in tx_buf */
+ uint ring_overflow; /* Counter of ring overflows */
+ uint log_mask; /* Mask of allowed message levels */
+ uint log_threshold; /* When free < log_threshold, store only important messages */
+ uint async_msg_size; /* Total size of async messages queued in tx_buf */
} cli;
extern pool *cli_pool;
@@ -55,7 +55,7 @@ extern struct cli *this_cli; /* Used during parsing */
void cli_printf(cli *, int, char *, ...);
#define cli_msg(x...) cli_printf(this_cli, x)
-void cli_set_log_echo(cli *, unsigned int mask, unsigned int size);
+void cli_set_log_echo(cli *, uint mask, uint size);
/* Functions provided to sysdep layer */
@@ -64,7 +64,7 @@ void cli_init(void);
void cli_free(cli *);
void cli_kick(cli *);
void cli_written(cli *);
-void cli_echo(unsigned int class, byte *msg);
+void cli_echo(uint class, byte *msg);
static inline int cli_access_restricted(void)
{
diff --git a/nest/neighbor.c b/nest/neighbor.c
index 48b6b6ac..1685d67e 100644
--- a/nest/neighbor.c
+++ b/nest/neighbor.c
@@ -49,7 +49,7 @@
static slab *neigh_slab;
static list sticky_neigh_list, neigh_hash_table[NEIGH_HASH_SIZE];
-static inline unsigned int
+static inline uint
neigh_hash(struct proto *p, ip_addr *a)
{
return (p->hash_key ^ ipa_hash(*a)) & (NEIGH_HASH_SIZE-1);
@@ -126,7 +126,7 @@ neigh_find2(struct proto *p, ip_addr *a, struct iface *ifa, unsigned flags)
{
neighbor *n;
int class, scope = -1;
- unsigned int h = neigh_hash(p, a);
+ uint h = neigh_hash(p, a);
struct iface *i;
struct ifa *addr;
diff --git a/nest/proto.c b/nest/proto.c
index 44cfb637..6531083c 100644
--- a/nest/proto.c
+++ b/nest/proto.c
@@ -1488,7 +1488,7 @@ proto_show_basic_info(struct proto *p)
}
void
-proto_cmd_show(struct proto *p, unsigned int verbose, int cnt)
+proto_cmd_show(struct proto *p, uint verbose, int cnt)
{
byte buf[256], tbuf[TM_DATETIME_BUFFER_SIZE];
@@ -1524,7 +1524,7 @@ proto_cmd_show(struct proto *p, unsigned int verbose, int cnt)
}
void
-proto_cmd_disable(struct proto *p, unsigned int arg UNUSED, int cnt UNUSED)
+proto_cmd_disable(struct proto *p, uint arg UNUSED, int cnt UNUSED)
{
if (p->disabled)
{
@@ -1540,7 +1540,7 @@ proto_cmd_disable(struct proto *p, unsigned int arg UNUSED, int cnt UNUSED)
}
void
-proto_cmd_enable(struct proto *p, unsigned int arg UNUSED, int cnt UNUSED)
+proto_cmd_enable(struct proto *p, uint arg UNUSED, int cnt UNUSED)
{
if (!p->disabled)
{
@@ -1555,7 +1555,7 @@ proto_cmd_enable(struct proto *p, unsigned int arg UNUSED, int cnt UNUSED)
}
void
-proto_cmd_restart(struct proto *p, unsigned int arg UNUSED, int cnt UNUSED)
+proto_cmd_restart(struct proto *p, uint arg UNUSED, int cnt UNUSED)
{
if (p->disabled)
{
@@ -1573,7 +1573,7 @@ proto_cmd_restart(struct proto *p, unsigned int arg UNUSED, int cnt UNUSED)
}
void
-proto_cmd_reload(struct proto *p, unsigned int dir, int cnt UNUSED)
+proto_cmd_reload(struct proto *p, uint dir, int cnt UNUSED)
{
if (p->disabled)
{
@@ -1615,19 +1615,19 @@ proto_cmd_reload(struct proto *p, unsigned int dir, int cnt UNUSED)
}
void
-proto_cmd_debug(struct proto *p, unsigned int mask, int cnt UNUSED)
+proto_cmd_debug(struct proto *p, uint mask, int cnt UNUSED)
{
p->debug = mask;
}
void
-proto_cmd_mrtdump(struct proto *p, unsigned int mask, int cnt UNUSED)
+proto_cmd_mrtdump(struct proto *p, uint mask, int cnt UNUSED)
{
p->mrtdump = mask;
}
static void
-proto_apply_cmd_symbol(struct symbol *s, void (* cmd)(struct proto *, unsigned int, int), unsigned int arg)
+proto_apply_cmd_symbol(struct symbol *s, void (* cmd)(struct proto *, uint, int), uint arg)
{
if (s->class != SYM_PROTO)
{
@@ -1640,7 +1640,7 @@ proto_apply_cmd_symbol(struct symbol *s, void (* cmd)(struct proto *, unsigned i
}
static void
-proto_apply_cmd_patt(char *patt, void (* cmd)(struct proto *, unsigned int, int), unsigned int arg)
+proto_apply_cmd_patt(char *patt, void (* cmd)(struct proto *, uint, int), uint arg)
{
int cnt = 0;
@@ -1660,8 +1660,8 @@ proto_apply_cmd_patt(char *patt, void (* cmd)(struct proto *, unsigned int, int)
}
void
-proto_apply_cmd(struct proto_spec ps, void (* cmd)(struct proto *, unsigned int, int),
- int restricted, unsigned int arg)
+proto_apply_cmd(struct proto_spec ps, void (* cmd)(struct proto *, uint, int),
+ int restricted, uint arg)
{
if (restricted && cli_access_restricted())
return;
diff --git a/nest/protocol.h b/nest/protocol.h
index 8660cc2c..a51e9afd 100644
--- a/nest/protocol.h
+++ b/nest/protocol.h
@@ -261,15 +261,15 @@ void proto_graceful_restart_unlock(struct proto *p);
void proto_show_limit(struct proto_limit *l, const char *dsc);
void proto_show_basic_info(struct proto *p);
-void proto_cmd_show(struct proto *, unsigned int, int);
-void proto_cmd_disable(struct proto *, unsigned int, int);
-void proto_cmd_enable(struct proto *, unsigned int, int);
-void proto_cmd_restart(struct proto *, unsigned int, int);
-void proto_cmd_reload(struct proto *, unsigned int, int);
-void proto_cmd_debug(struct proto *, unsigned int, int);
-void proto_cmd_mrtdump(struct proto *, unsigned int, int);
-
-void proto_apply_cmd(struct proto_spec ps, void (* cmd)(struct proto *, unsigned int, int), int restricted, unsigned int arg);
+void proto_cmd_show(struct proto *, uint, int);
+void proto_cmd_disable(struct proto *, uint, int);
+void proto_cmd_enable(struct proto *, uint, int);
+void proto_cmd_restart(struct proto *, uint, int);
+void proto_cmd_reload(struct proto *, uint, int);
+void proto_cmd_debug(struct proto *, uint, int);
+void proto_cmd_mrtdump(struct proto *, uint, int);
+
+void proto_apply_cmd(struct proto_spec ps, void (* cmd)(struct proto *, uint, int), int restricted, uint arg);
struct proto *proto_get_named(struct symbol *, struct protocol *);
#define CMD_RELOAD 0
diff --git a/nest/route.h b/nest/route.h
index 2e6bf741..8f3c7c9a 100644
--- a/nest/route.h
+++ b/nest/route.h
@@ -47,7 +47,7 @@ struct fib_iterator { /* See lib/slists.h for an explanation */
byte efef; /* 0xff to distinguish between iterator and node */
byte pad[3];
struct fib_node *node; /* Or NULL if freshly merged */
- unsigned int hash;
+ uint hash;
};
typedef void (*fib_init_func)(struct fib_node *);
@@ -56,11 +56,11 @@ struct fib {
pool *fib_pool; /* Pool holding all our data */
slab *fib_slab; /* Slab holding all fib nodes */
struct fib_node **hash_table; /* Node hash table */
- unsigned int hash_size; /* Number of hash table entries (a power of two) */
- unsigned int hash_order; /* Binary logarithm of hash_size */
- unsigned int hash_shift; /* 16 - hash_log */
- unsigned int entries; /* Number of entries */
- unsigned int entries_min, entries_max;/* Entry count limits (else start rehashing) */
+ uint hash_size; /* Number of hash table entries (a power of two) */
+ uint hash_order; /* Binary logarithm of hash_size */
+ uint hash_shift; /* 16 - hash_log */
+ uint entries; /* Number of entries */
+ uint entries_min, entries_max; /* Entry count limits (else start rehashing) */
fib_init_func init; /* Constructor */
};
@@ -78,7 +78,7 @@ void fit_put(struct fib_iterator *, struct fib_node *);
#define FIB_WALK(fib, z) do { \
struct fib_node *z, **ff = (fib)->hash_table; \
- unsigned int count = (fib)->hash_size; \
+ uint count = (fib)->hash_size; \
while (count--) \
for(z = *ff++; z; z=z->next)
@@ -88,8 +88,8 @@ void fit_put(struct fib_iterator *, struct fib_node *);
#define FIB_ITERATE_START(fib, it, z) do { \
struct fib_node *z = fit_get(fib, it); \
- unsigned int count = (fib)->hash_size; \
- unsigned int hpos = (it)->hash; \
+ uint count = (fib)->hash_size; \
+ uint hpos = (it)->hash; \
for(;;) { \
if (!z) \
{ \
@@ -435,7 +435,7 @@ typedef struct eattr {
#define EAF_TEMP 0x80 /* A temporary attribute (the one stored in the tmp attr list) */
struct adata {
- unsigned int length; /* Length of data */
+ uint length; /* Length of data */
byte data[0];
};
@@ -475,7 +475,7 @@ void ea_sort(ea_list *); /* Sort entries in all sub-lists */
unsigned ea_scan(ea_list *); /* How many bytes do we need for merged ea_list */
void ea_merge(ea_list *from, ea_list *to); /* Merge sub-lists to allocated buffer */
int ea_same(ea_list *x, ea_list *y); /* Test whether two ea_lists are identical */
-unsigned int ea_hash(ea_list *e); /* Calculate 16-bit hash value */
+uint ea_hash(ea_list *e); /* Calculate 16-bit hash value */
ea_list *ea_append(ea_list *to, ea_list *what);
void ea_format_bitfield(struct eattr *a, byte *buf, int bufsize, const char **names, int min, int max);
diff --git a/nest/rt-attr.c b/nest/rt-attr.c
index c5537208..85a192c8 100644
--- a/nest/rt-attr.c
+++ b/nest/rt-attr.c
@@ -98,7 +98,7 @@ rte_src_init(void)
HASH_INIT(src_hash, rta_pool, RSH_INIT_ORDER);
}
-static inline int u32_cto(unsigned int x) { return ffs(~x) - 1; }
+static inline int u32_cto(uint x) { return ffs(~x) - 1; }
static inline u32
rte_src_alloc_id(void)
@@ -195,10 +195,10 @@ rt_prune_sources(void)
* Multipath Next Hop
*/
-static inline unsigned int
+static inline uint
mpnh_hash(struct mpnh *x)
{
- unsigned int h = 0;
+ uint h = 0;
for (; x; x = x->next)
h ^= ipa_hash(x->gw);
@@ -666,7 +666,7 @@ ea_format_bitfield(struct eattr *a, byte *buf, int bufsize, const char **names,
}
static inline void
-opaque_format(struct adata *ad, byte *buf, unsigned int size)
+opaque_format(struct adata *ad, byte *buf, uint size)
{
byte *bound = buf + size - 10;
int i;
@@ -838,7 +838,7 @@ ea_dump(ea_list *e)
* ea_hash() takes an extended attribute list and calculated a hopefully
* uniformly distributed hash value from its contents.
*/
-inline unsigned int
+inline uint
ea_hash(ea_list *e)
{
u32 h = 0;
@@ -900,10 +900,10 @@ ea_append(ea_list *to, ea_list *what)
* rta's
*/
-static unsigned int rta_cache_count;
-static unsigned int rta_cache_size = 32;
-static unsigned int rta_cache_limit;
-static unsigned int rta_cache_mask;
+static uint rta_cache_count;
+static uint rta_cache_size = 32;
+static uint rta_cache_limit;
+static uint rta_cache_mask;
static rta **rta_hash_table;
static void
@@ -917,7 +917,7 @@ rta_alloc_hash(void)
rta_cache_mask = rta_cache_size - 1;
}
-static inline unsigned int
+static inline uint
rta_hash(rta *a)
{
return (((uint) (uintptr_t) a->src) ^ ipa_hash(a->gw) ^
@@ -957,7 +957,7 @@ rta_copy(rta *o)
static inline void
rta_insert(rta *r)
{
- unsigned int h = r->hash_key & rta_cache_mask;
+ uint h = r->hash_key & rta_cache_mask;
r->next = rta_hash_table[h];
if (r->next)
r->next->pprev = &r->next;
@@ -968,8 +968,8 @@ rta_insert(rta *r)
static void
rta_rehash(void)
{
- unsigned int ohs = rta_cache_size;
- unsigned int h;
+ uint ohs = rta_cache_size;
+ uint h;
rta *r, *n;
rta **oht = rta_hash_table;
@@ -1002,7 +1002,7 @@ rta *
rta_lookup(rta *o)
{
rta *r;
- unsigned int h;
+ uint h;
ASSERT(!(o->aflags & RTAF_CACHED));
if (o->eattrs)
@@ -1093,7 +1093,7 @@ void
rta_dump_all(void)
{
rta *a;
- unsigned int h;
+ uint h;
debug("Route attribute cache (%d entries, rehash at %d):\n", rta_cache_count, rta_cache_limit);
for(h=0; h<rta_cache_size; h++)
diff --git a/nest/rt-fib.c b/nest/rt-fib.c
index b9c7d2a2..aa5e2357 100644
--- a/nest/rt-fib.c
+++ b/nest/rt-fib.c
@@ -206,7 +206,7 @@ fib_histogram(struct fib *f)
void *
fib_get(struct fib *f, ip_addr *a, int len)
{
- unsigned int h = ipa_hash(*a);
+ uint h = ipa_hash(*a);
struct fib_node **ee = f->hash_table + (h >> f->hash_shift);
struct fib_node *g, *e = *ee;
u32 uid = h << 16;
@@ -321,7 +321,7 @@ void
fib_delete(struct fib *f, void *E)
{
struct fib_node *e = E;
- unsigned int h = fib_hash(f, &e->prefix);
+ uint h = fib_hash(f, &e->prefix);
struct fib_node **ee = f->hash_table + h;
struct fib_iterator *it;
@@ -442,7 +442,7 @@ fit_put(struct fib_iterator *i, struct fib_node *n)
void
fib_check(struct fib *f)
{
- unsigned int i, ec, lo, nulls;
+ uint i, ec, lo, nulls;
ec = 0;
for(i=0; i<f->hash_size; i++)
@@ -452,7 +452,7 @@ fib_check(struct fib *f)
for(n=f->hash_table[i]; n; n=n->next)
{
struct fib_iterator *j, *j0;
- unsigned int h0 = ipa_hash(n->prefix);
+ uint h0 = ipa_hash(n->prefix);
if (h0 < lo)
bug("fib_check: discord in hash chains");
lo = h0;
@@ -489,7 +489,7 @@ struct fib f;
void dump(char *m)
{
- unsigned int i;
+ uint i;
debug("%s ... order=%d, size=%d, entries=%d\n", m, f.hash_order, f.hash_size, f.hash_size);
for(i=0; i<f.hash_size; i++)
diff --git a/nest/rt-table.c b/nest/rt-table.c
index 24517e2c..d5af41c7 100644
--- a/nest/rt-table.c
+++ b/nest/rt-table.c
@@ -182,14 +182,14 @@ rte_trace(struct proto *p, rte *e, int dir, char *msg)
}
static inline void
-rte_trace_in(unsigned int flag, struct proto *p, rte *e, char *msg)
+rte_trace_in(uint flag, struct proto *p, rte *e, char *msg)
{
if (p->debug & flag)
rte_trace(p, e, '>', msg);
}
static inline void
-rte_trace_out(unsigned int flag, struct proto *p, rte *e, char *msg)
+rte_trace_out(uint flag, struct proto *p, rte *e, char *msg)
{
if (p->debug & flag)
rte_trace(p, e, '<', msg);
@@ -1880,7 +1880,7 @@ hc_hash(ip_addr a, rtable *dep)
static inline void
hc_insert(struct hostcache *hc, struct hostentry *he)
{
- unsigned int k = he->hash_key >> hc->hash_shift;
+ uint k = he->hash_key >> hc->hash_shift;
he->next = hc->hash_table[k];
hc->hash_table[k] = he;
}
@@ -1889,7 +1889,7 @@ static inline void
hc_remove(struct hostcache *hc, struct hostentry *he)
{
struct hostentry **hep;
- unsigned int k = he->hash_key >> hc->hash_shift;
+ uint k = he->hash_key >> hc->hash_shift;
for (hep = &hc->hash_table[k]; *hep != he; hep = &(*hep)->next);
*hep = he->next;
@@ -2154,7 +2154,7 @@ rt_get_hostentry(rtable *tab, ip_addr a, ip_addr ll, rtable *dep)
if (!tab->hostcache)
rt_init_hostcache(tab);
- unsigned int k = hc_hash(a, dep);
+ uint k = hc_hash(a, dep);
struct hostcache *hc = tab->hostcache;
for (he = hc->hash_table[k >> hc->hash_shift]; he != NULL; he = he->next)
if (ipa_equal(he->addr, a) && (he->tab == dep))