25#include "../common/routing_table.h"
32typedef struct _alias_element_t {
41typedef struct _alias_list_t {
47 struct _alias_list_t *
next;
94 return (&as->
data)[i];
172 while (node != NULL) {
223 node_pointer->
right = n;
251static bool _aliases_insert(
258 log_error(
"failed to allocate memory for node");
273 bool success = _aliases_insert(n->
left, key, val);
279 bool success = _aliases_insert(n->
right, key, val);
289 n = _aliases_skew(n);
290 n = _aliases_split(n);
305 return _aliases_insert(a->
root, (
a_key_t) key, value);
323static void _aliases_clear(
node_t *n) {
329 if (n->
left != NULL) {
330 _aliases_clear(n->
left);
332 if (n->
right != NULL) {
333 _aliases_clear(n->
right);
337 if (n->
val != NULL) {
350 _aliases_clear(a->
root);
static bool aliases_insert(aliases_t *a, key_mask_t key, alias_list_t *value)
Add/overwrite an element into an aliases tree.
key_mask_t km
key mast combo
static bool alias_list_append(alias_list_t *as, key_mask_t val, uint32_t source)
Append an element to a list.
unsigned int n_elements
Elements in this instance.
struct _alias_list_t * next
Next element in list of lists.
void alias_list_delete(alias_list_t *a)
Delete all elements in an alias list.
int64_t as_int
the 64 bit int version
alias_element_t data
Data region.
a_key_t key
Key and value of this node.
static alias_list_t * alias_list_new(unsigned int max_size)
Create a new list on the stack.
key_mask_t key_mask
key_mask of the element
node_t * root
pointer to first element
static void alias_list_join(alias_list_t *a, alias_list_t *b)
Append a list to an existing list.
static alias_list_t * aliases_find(aliases_t *a, key_mask_t key)
Retrieve an element from an aliases container.
unsigned int max_size
Max number of elements in this instance.
static bool aliases_contains(aliases_t *a, key_mask_t key)
See if the aliases contain holds an element.
static alias_element_t alias_list_get(alias_list_t *as, unsigned int i)
Get an element from the list.
static void aliases_remove(aliases_t *a, key_mask_t key)
Remove an element from an aliases tree.
struct node_t * left
left child
uint32_t source
Source of packets matching the element.
struct node_t * right
right child
alias_list_t * val
alias ......
static aliases_t aliases_init(void)
Create a new, empty, aliases container.
static void aliases_clear(aliases_t *a)
Remove all elements from an aliases container and free all sub-containers.
unsigned int level
tree level maybe?
Copy of key mask needed for Mundy compressor.
the key union from a key and mask to a 64 bit number
SpiNNaker debug header file.
void log_error(const char *message,...)
This function logs errors. Errors usually indicate a serious fault in the program,...