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,
56#define NBR_TABLE_MAX_NEIGHBORS NBR_TABLE_CONF_MAX_NEIGHBORS
58#ifdef NBR_TABLE_CONF_GC_GET_WORST
59#define NBR_TABLE_GC_GET_WORST NBR_TABLE_CONF_GC_GET_WORST
61#define NBR_TABLE_GC_GET_WORST nbr_table_gc_get_worst
64#ifdef NBR_TABLE_CONF_CAN_ACCEPT_NEW
65#define NBR_TABLE_CAN_ACCEPT_NEW NBR_TABLE_CONF_CAN_ACCEPT_NEW
67#define NBR_TABLE_CAN_ACCEPT_NEW nbr_table_can_accept_new
70const linkaddr_t *NBR_TABLE_GC_GET_WORST(
const linkaddr_t *lladdr1,
71 const linkaddr_t *lladdr2);
72bool NBR_TABLE_CAN_ACCEPT_NEW(
const linkaddr_t *
new,
73 const linkaddr_t *candidate_for_removal,
74 nbr_table_reason_t reason,
const void *data);
77typedef void nbr_table_item_t;
80typedef void(nbr_table_callback)(nbr_table_item_t *item);
83typedef struct nbr_table {
86 nbr_table_callback *callback;
87 nbr_table_item_t *data;
91typedef struct nbr_table_key {
92 struct nbr_table_key *next;
97#define NBR_TABLE(type, name) \
98 static type _##name##_mem[NBR_TABLE_MAX_NEIGHBORS]; \
99 static nbr_table_t name##_struct = { 0, sizeof(type), NULL, (nbr_table_item_t *)_##name##_mem }; \
100 static nbr_table_t *name = &name##_struct \
103#define NBR_TABLE_GLOBAL(type, name) \
104 static type _##name##_mem[NBR_TABLE_MAX_NEIGHBORS]; \
105 static nbr_table_t name##_struct = { 0, sizeof(type), NULL, (nbr_table_item_t *)_##name##_mem }; \
106 nbr_table_t *name = &name##_struct \
109#define NBR_TABLE_DECLARE(name) extern nbr_table_t *name
113int nbr_table_register(nbr_table_t *table, nbr_table_callback *callback);
114int nbr_table_is_registered(
const nbr_table_t *table);
115nbr_table_item_t *nbr_table_head(
const nbr_table_t *table);
116nbr_table_item_t *nbr_table_next(
const nbr_table_t *table,
117 nbr_table_item_t *item);
122nbr_table_item_t *nbr_table_add_lladdr(
const nbr_table_t *table,
123 const linkaddr_t *lladdr,
124 nbr_table_reason_t reason,
126nbr_table_item_t *nbr_table_get_from_lladdr(
const nbr_table_t *table,
127 const linkaddr_t *lladdr);
132int nbr_table_remove(
const nbr_table_t *table,
const nbr_table_item_t *item);
133int nbr_table_lock(
const nbr_table_t *table,
const nbr_table_item_t *item);
134int nbr_table_unlock(
const nbr_table_t *table,
const nbr_table_item_t *item);
139linkaddr_t *nbr_table_get_lladdr(
const nbr_table_t *table,
140 const nbr_table_item_t *item);
145void nbr_table_clear(
void);
146bool nbr_table_entry_is_allowed(
const nbr_table_t *table,
147 const linkaddr_t *lladdr,
148 nbr_table_reason_t reason,
const void *data);
149nbr_table_key_t *nbr_table_key_head(
void);
150nbr_table_key_t *nbr_table_key_next(
const nbr_table_key_t *key);
151int nbr_table_count_entries(
void);
Header file for the link-layer address representation.
Include file for the Contiki low-layer network stack (NETSTACK)