43 #ifdef NBR_TABLE_CONF_MAX_NEIGHBORS
44 #define NBR_TABLE_MAX_NEIGHBORS NBR_TABLE_CONF_MAX_NEIGHBORS
46 #define NBR_TABLE_MAX_NEIGHBORS 8
50 typedef void nbr_table_item_t;
53 typedef void(nbr_table_callback)(nbr_table_item_t *item);
56 typedef struct nbr_table {
59 nbr_table_callback *callback;
60 nbr_table_item_t *data;
64 #define NBR_TABLE(type, name) \
65 static type _##name##_mem[NBR_TABLE_MAX_NEIGHBORS]; \
66 static nbr_table_t name##_struct = { 0, sizeof(type), NULL, (nbr_table_item_t *)_##name##_mem }; \
67 static nbr_table_t *name = &name##_struct \
70 #define NBR_TABLE_GLOBAL(type, name) \
71 static type _##name##_mem[NBR_TABLE_MAX_NEIGHBORS]; \
72 static nbr_table_t name##_struct = { 0, sizeof(type), NULL, (nbr_table_item_t *)_##name##_mem }; \
73 nbr_table_t *name = &name##_struct \
76 #define NBR_TABLE_DECLARE(name) extern nbr_table_t *name
79 NBR_TABLE_REASON_UNDEFINED,
80 NBR_TABLE_REASON_RPL_DIO,
81 NBR_TABLE_REASON_RPL_DAO,
82 NBR_TABLE_REASON_RPL_DIS,
83 NBR_TABLE_REASON_ROUTE,
84 NBR_TABLE_REASON_IPV6_ND,
86 NBR_TABLE_REASON_LLSEC,
87 NBR_TABLE_REASON_LINK_STATS,
92 int nbr_table_register(nbr_table_t *table, nbr_table_callback *callback);
93 nbr_table_item_t *nbr_table_head(nbr_table_t *table);
94 nbr_table_item_t *nbr_table_next(nbr_table_t *table, nbr_table_item_t *item);
99 nbr_table_item_t *nbr_table_add_lladdr(nbr_table_t *table,
const linkaddr_t *lladdr, nbr_table_reason_t reason,
void *data);
100 nbr_table_item_t *nbr_table_get_from_lladdr(nbr_table_t *table,
const linkaddr_t *lladdr);
105 int nbr_table_remove(nbr_table_t *table, nbr_table_item_t *item);
106 int nbr_table_lock(nbr_table_t *table, nbr_table_item_t *item);
107 int nbr_table_unlock(nbr_table_t *table, nbr_table_item_t *item);
112 linkaddr_t *nbr_table_get_lladdr(nbr_table_t *table,
const nbr_table_item_t *item);
113 int nbr_table_update_lladdr(
const linkaddr_t *old_addr,
const linkaddr_t *new_addr,
int remove_if_duplicate);
Header file for the Rime address representation
Include file for the Contiki low-layer network stack (NETSTACK)