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,
85 NBR_TABLE_REASON_IPV6_ND_AUTOFILL,
87 NBR_TABLE_REASON_LLSEC,
88 NBR_TABLE_REASON_LINK_STATS,
89 NBR_TABLE_REASON_SIXTOP,
94 int nbr_table_register(nbr_table_t *table, nbr_table_callback *callback);
95 int nbr_table_is_registered(nbr_table_t *table);
96 nbr_table_item_t *nbr_table_head(nbr_table_t *table);
97 nbr_table_item_t *nbr_table_next(nbr_table_t *table, nbr_table_item_t *item);
102 nbr_table_item_t *nbr_table_add_lladdr(nbr_table_t *table,
const linkaddr_t *lladdr, nbr_table_reason_t reason,
void *data);
103 nbr_table_item_t *nbr_table_get_from_lladdr(nbr_table_t *table,
const linkaddr_t *lladdr);
108 int nbr_table_remove(nbr_table_t *table, nbr_table_item_t *item);
109 int nbr_table_lock(nbr_table_t *table, nbr_table_item_t *item);
110 int nbr_table_unlock(nbr_table_t *table, nbr_table_item_t *item);
115 linkaddr_t *nbr_table_get_lladdr(nbr_table_t *table,
const nbr_table_item_t *item);
Header file for the link-layer address representation
Include file for the Contiki low-layer network stack (NETSTACK)