23#include "../common/routing_table.h"
41#define FULL 0xffffffff
44#define EMPTY 0x00000000
47#define INIT_SOURCE 0x0
56 return merge->entries.count - 1;
bool bit_set_clear(bit_set_t *b)
Empty a bitset entirely.
static bool bit_set_add(bit_set_t *b, unsigned int i)
Add an element to a bitset.
static bool bit_set_contains(bit_set_t *b, unsigned int i)
Test if an element is in a bitset.
static bool bit_set_remove(bit_set_t *b, unsigned int i)
Remove an element from a bitset.
static bool bit_set_init(bit_set_t *b, unsigned int length)
Create a new bitset.
static void bit_set_delete(bit_set_t *b)
Destroy a bitset.
uint32_t route
Route taken by entries in the merge.
#define EMPTY
the empty mask
static int merge_goodness(merge_t *merge)
Get the goodness for a merge.
static void merge_clear(merge_t *m)
Clear a merge.
key_mask_t key_mask
key_mask resulting from the merge
#define INIT_ROUTE
the init for routes of entries
static bool merge_contains(merge_t *m, unsigned int i)
See if an entry is contained within a merge.
static void merge_delete(merge_t *m)
Destroy a merge.
static void merge_remove(merge_t *m, unsigned int i)
Remove an entry from the merge.
static bool merge_init(merge_t *m, uint32_t n_entries_in_table)
Initialise a merge.
uint32_t source
Collective source of entries in the route.
#define INIT_SOURCE
the init for sources of entries
static void merge_add(merge_t *m, unsigned int i)
Add an entry to the merge.
bit_set_t entries
Set of entries included in the merge.
merge struct. entries which can be merged
static entry_t merge(const entry_t *entry1, const entry_t *entry2)
Merges a single pair of route entries.
key_mask_t key_mask
Key and mask.
uint32_t mask
Mask for the key_mask.
static key_mask_t key_mask_merge(key_mask_t a, key_mask_t b)
Generate a new key-mask which is a combination of two other key_masks.
uint32_t route
Routing direction.
int routing_table_get_n_entries(void)
Get the number of entries in the routing table.
entry_t * routing_table_get_entry(uint32_t entry_id_to_find)
Gets a pointer to where this entry is stored.
uint32_t key
Key for the key_mask.
uint32_t source
Source of packets arriving at this entry.
Holds data for a routing table entry.