43 NBR_TABLE_REASON_UNDEFINED,
44 NBR_TABLE_REASON_RPL_DIO,
45 NBR_TABLE_REASON_RPL_DAO,
46 NBR_TABLE_REASON_RPL_DIS,
47 NBR_TABLE_REASON_ROUTE,
48 NBR_TABLE_REASON_IPV6_ND,
50 NBR_TABLE_REASON_LLSEC,
51 NBR_TABLE_REASON_LINK_STATS,
52 NBR_TABLE_REASON_IPV6_ND_AUTOFILL,
53 NBR_TABLE_REASON_SIXTOP,
57 #ifdef NBR_TABLE_CONF_MAX_NEIGHBORS 58 #define NBR_TABLE_MAX_NEIGHBORS NBR_TABLE_CONF_MAX_NEIGHBORS 60 #define NBR_TABLE_MAX_NEIGHBORS 8 63 #ifdef NBR_TABLE_CONF_GC_GET_WORST 64 #define NBR_TABLE_GC_GET_WORST NBR_TABLE_CONF_GC_GET_WORST 66 #define NBR_TABLE_GC_GET_WORST nbr_table_gc_get_worst 69 #ifdef NBR_TABLE_CONF_CAN_ACCEPT_NEW 70 #define NBR_TABLE_CAN_ACCEPT_NEW NBR_TABLE_CONF_CAN_ACCEPT_NEW 72 #define NBR_TABLE_CAN_ACCEPT_NEW nbr_table_can_accept_new 75 const linkaddr_t *NBR_TABLE_GC_GET_WORST(
const linkaddr_t *lladdr1,
const linkaddr_t *lladdr2);
76 bool NBR_TABLE_CAN_ACCEPT_NEW(
const linkaddr_t *
new,
const linkaddr_t *candidate_for_removal,
77 nbr_table_reason_t reason,
void *data);
80 typedef void nbr_table_item_t;
83 typedef void(nbr_table_callback)(nbr_table_item_t *item);
86 typedef struct nbr_table {
89 nbr_table_callback *callback;
90 nbr_table_item_t *data;
94 typedef struct nbr_table_key {
95 struct nbr_table_key *next;
100 #define NBR_TABLE(type, name) \ 101 static type _##name##_mem[NBR_TABLE_MAX_NEIGHBORS]; \ 102 static nbr_table_t name##_struct = { 0, sizeof(type), NULL, (nbr_table_item_t *)_##name##_mem }; \ 103 static nbr_table_t *name = &name##_struct \ 106 #define NBR_TABLE_GLOBAL(type, name) \ 107 static type _##name##_mem[NBR_TABLE_MAX_NEIGHBORS]; \ 108 static nbr_table_t name##_struct = { 0, sizeof(type), NULL, (nbr_table_item_t *)_##name##_mem }; \ 109 nbr_table_t *name = &name##_struct \ 112 #define NBR_TABLE_DECLARE(name) extern nbr_table_t *name 116 int nbr_table_register(nbr_table_t *table, nbr_table_callback *callback);
117 int nbr_table_is_registered(nbr_table_t *table);
118 nbr_table_item_t *nbr_table_head(nbr_table_t *table);
119 nbr_table_item_t *nbr_table_next(nbr_table_t *table, nbr_table_item_t *item);
124 nbr_table_item_t *nbr_table_add_lladdr(nbr_table_t *table,
const linkaddr_t *lladdr, nbr_table_reason_t reason,
void *data);
125 nbr_table_item_t *nbr_table_get_from_lladdr(nbr_table_t *table,
const linkaddr_t *lladdr);
130 int nbr_table_remove(nbr_table_t *table, nbr_table_item_t *item);
131 int nbr_table_lock(nbr_table_t *table, nbr_table_item_t *item);
132 int nbr_table_unlock(nbr_table_t *table, nbr_table_item_t *item);
137 linkaddr_t *nbr_table_get_lladdr(nbr_table_t *table,
const nbr_table_item_t *item);
142 void nbr_table_clear(
void);
143 bool nbr_table_entry_is_allowed(nbr_table_t *table,
const linkaddr_t *lladdr,
144 nbr_table_reason_t reason,
void *data);
145 nbr_table_key_t *nbr_table_key_head(
void);
146 nbr_table_key_t *nbr_table_key_next(nbr_table_key_t *key);
147 int nbr_table_count_entries(
void);
Header file for the link-layer address representation
Include file for the Contiki low-layer network stack (NETSTACK)