Revision ae80a2de nest/route.h

View differences:

nest/route.h
47 47
  byte efef;				/* 0xff to distinguish between iterator and node */
48 48
  byte pad[3];
49 49
  struct fib_node *node;		/* Or NULL if freshly merged */
50
  unsigned int hash;
50
  uint hash;
51 51
};
52 52

  
53 53
typedef void (*fib_init_func)(struct fib_node *);
......
56 56
  pool *fib_pool;			/* Pool holding all our data */
57 57
  slab *fib_slab;			/* Slab holding all fib nodes */
58 58
  struct fib_node **hash_table;		/* Node hash table */
59
  unsigned int hash_size;		/* Number of hash table entries (a power of two) */
60
  unsigned int hash_order;		/* Binary logarithm of hash_size */
61
  unsigned int hash_shift;		/* 16 - hash_log */
62
  unsigned int entries;			/* Number of entries */
63
  unsigned int entries_min, entries_max;/* Entry count limits (else start rehashing) */
59
  uint hash_size;			/* Number of hash table entries (a power of two) */
60
  uint hash_order;			/* Binary logarithm of hash_size */
61
  uint hash_shift;			/* 16 - hash_log */
62
  uint entries;				/* Number of entries */
63
  uint entries_min, entries_max;	/* Entry count limits (else start rehashing) */
64 64
  fib_init_func init;			/* Constructor */
65 65
};
66 66

  
......
78 78

  
79 79
#define FIB_WALK(fib, z) do {					\
80 80
	struct fib_node *z, **ff = (fib)->hash_table;		\
81
	unsigned int count = (fib)->hash_size;			\
81
	uint count = (fib)->hash_size;				\
82 82
	while (count--)						\
83 83
	  for(z = *ff++; z; z=z->next)
84 84

  
......
88 88

  
89 89
#define FIB_ITERATE_START(fib, it, z) do {			\
90 90
	struct fib_node *z = fit_get(fib, it);			\
91
	unsigned int count = (fib)->hash_size;			\
92
	unsigned int hpos = (it)->hash;				\
91
	uint count = (fib)->hash_size;				\
92
	uint hpos = (it)->hash;					\
93 93
	for(;;) {						\
94 94
	  if (!z)						\
95 95
            {							\
......
435 435
#define EAF_TEMP 0x80			/* A temporary attribute (the one stored in the tmp attr list) */
436 436

  
437 437
struct adata {
438
  unsigned int length;			/* Length of data */
438
  uint length;				/* Length of data */
439 439
  byte data[0];
440 440
};
441 441

  
......
475 475
unsigned ea_scan(ea_list *);		/* How many bytes do we need for merged ea_list */
476 476
void ea_merge(ea_list *from, ea_list *to); /* Merge sub-lists to allocated buffer */
477 477
int ea_same(ea_list *x, ea_list *y);	/* Test whether two ea_lists are identical */
478
unsigned int ea_hash(ea_list *e);	/* Calculate 16-bit hash value */
478
uint ea_hash(ea_list *e);	/* Calculate 16-bit hash value */
479 479
ea_list *ea_append(ea_list *to, ea_list *what);
480 480
void ea_format_bitfield(struct eattr *a, byte *buf, int bufsize, const char **names, int min, int max);
481 481

  

Also available in: Unified diff