Microchip® Advanced Software Framework

nbr-table.h File Reference
#include "contiki.h"
#include "net/linkaddr.h"
#include "net/netstack.h"

Data Structures

struct  nbr_table
 

Macros

#define NBR_TABLE(type, name)
 A static neighbor table. More...
 
#define NBR_TABLE_DECLARE(name)   extern nbr_table_t *name
 Declaration of non-static neighbor tables. More...
 
#define NBR_TABLE_GLOBAL(type, name)
 A non-static neighbor table. More...
 
#define NBR_TABLE_MAX_NEIGHBORS   8
 

Typedefs

typedef void( nbr_table_callback )(nbr_table_item_t *item)
 
typedef void nbr_table_item_t
 
typedef struct nbr_table nbr_table_t
 

Functions

Neighbor tables: register and loop through table elements
int nbr_table_register (nbr_table_t *table, nbr_table_callback *callback)
 
nbr_table_item_tnbr_table_head (nbr_table_t *table)
 
nbr_table_item_tnbr_table_next (nbr_table_t *table, nbr_table_item_t *item)
 
Neighbor tables: add and get data
nbr_table_item_tnbr_table_add_lladdr (nbr_table_t *table, const linkaddr_t *lladdr)
 
nbr_table_item_tnbr_table_get_from_lladdr (nbr_table_t *table, const linkaddr_t *lladdr)
 
Neighbor tables: set flags (unused, locked, unlocked)
int nbr_table_remove (nbr_table_t *table, nbr_table_item_t *item)
 
int nbr_table_lock (nbr_table_t *table, nbr_table_item_t *item)
 
int nbr_table_unlock (nbr_table_t *table, nbr_table_item_t *item)
 
Neighbor tables: address manipulation
linkaddr_tnbr_table_get_lladdr (nbr_table_t *table, const nbr_table_item_t *item)
 

#define NBR_TABLE (   type,
  name 
)
Value:
static type _##name##_mem[NBR_TABLE_MAX_NEIGHBORS]; \
static nbr_table_t name##_struct = { 0, sizeof(type), NULL, (nbr_table_item_t *)_##name##_mem }; \
static nbr_table_t *name = &name##_struct \
#define NULL
Definition: def.h:47
void nbr_table_item_t
Definition: nbr-table.h:50
Definition: nbr-table.h:56
#define NBR_TABLE_MAX_NEIGHBORS
Definition: nbr-table.h:46

A static neighbor table.

To be initialized through nbr_table_register(name)

#define NBR_TABLE_DECLARE (   name)    extern nbr_table_t *name

Declaration of non-static neighbor tables.

#define NBR_TABLE_GLOBAL (   type,
  name 
)
Value:
static type _##name##_mem[NBR_TABLE_MAX_NEIGHBORS]; \
static nbr_table_t name##_struct = { 0, sizeof(type), NULL, (nbr_table_item_t *)_##name##_mem }; \
nbr_table_t *name = &name##_struct \
#define NULL
Definition: def.h:47
void nbr_table_item_t
Definition: nbr-table.h:50
Definition: nbr-table.h:56
#define NBR_TABLE_MAX_NEIGHBORS
Definition: nbr-table.h:46
struct nbr_table nbr_table_t

A non-static neighbor table.

To be initialized through nbr_table_register(name)

#define NBR_TABLE_MAX_NEIGHBORS   8

Referenced by uip_ds6_init().

typedef void( nbr_table_callback)(nbr_table_item_t *item)
typedef void nbr_table_item_t
typedef struct nbr_table nbr_table_t

linkaddr_t* nbr_table_get_lladdr ( nbr_table_t table,
const nbr_table_item_t item 
)
int nbr_table_lock ( nbr_table_t table,
nbr_table_item_t item 
)
int nbr_table_remove ( nbr_table_t table,
nbr_table_item_t item 
)
int nbr_table_unlock ( nbr_table_t table,
nbr_table_item_t item 
)

References locked_map, and nbr_set_bit().

Referenced by rpl_set_preferred_parent().