19#ifndef __ROUTING_TABLE_H__
20#define __ROUTING_TABLE_H__
124 return ~km.key & ~km.mask;
150 uint32_t new_xs = ~(a.
key ^ b.
key);
void log_debug(const char *message,...)
This function logs debugging messages. This level of message is normally not printed except when the ...
key_mask_t key_mask
Key and mask.
uint32_t mask
Mask for the key_mask.
bool routing_table_get_entries(uint32_t start_entry, uint32_t n_entries, entry_t *output)
Gets a pointer to several entries.
static void swap_entries(int a, int b)
Swap a pair of entries at the given indices.
static uint32_t key_mask_get_xs(key_mask_t km)
Get a mask of the Xs in a key_mask.
entry_t entries[]
Entries in the table.
uint32_t size
Number of entries in the table.
static unsigned int key_mask_count_xs(key_mask_t km)
Get a count of the Xs in a 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.
static void routing_table_copy_entry(int new_index, int old_index)
Copy an entry from one index to another.
uint32_t route
Routing direction.
int routing_table_get_n_entries(void)
Get the number of entries in the routing table.
static bool key_mask_intersect(key_mask_t a, key_mask_t b)
Determine if two key_masks would match any of the same keys.
entry_t * routing_table_get_entry(uint32_t entry_id_to_find)
Gets a pointer to where this entry is stored.
static void routing_table_put_entry(const entry_t *entry, int index)
Write an entry to a specific index.
uint32_t key
Key for the key_mask.
void routing_table_wait_for_last_transfer(void)
Waits for the last transfer from routing_table_get_entries to complete.
void routing_table_remove_from_size(int size_to_remove)
updates table stores accordingly.
uint32_t source
Source of packets arriving at this entry.
Holds data for a routing table entry.
Holds a routing table description.