Contiki-Inga 3.x
Data Structures | Typedefs | Functions
IPv6 Neighbor cache (link-layer/IPv6 address mapping)

Data structure and methods for IPv6 Neighbor Cache (RFC 4861, section 5.1) More...

Data Structures

struct  uip_ds6_nbr
 An entry in the nbr cache. More...
 

Typedefs

typedef struct uip_ds6_nbr uip_ds6_nbr_t
 An entry in the nbr cache.
 

Functions

void uip_ds6_neighbors_init (void)
 Initialize neighbor cache. More...
 

Possible states for the nbr cache entries

#define NBR_INCOMPLETE   0
 
#define NBR_REACHABLE   1
 
#define NBR_STALE   2
 
#define NBR_DELAY   3
 
#define NBR_PROBE   4
 

Neighbor Cache basic routines

uip_ds6_nbr_tuip_ds6_nbr_add (const uip_ipaddr_t *ipaddr, const uip_lladdr_t *lladdr, uint8_t isrouter, uint8_t state)
 Adds a neighbor to the neighbor cache. More...
 
void uip_ds6_nbr_rm (uip_ds6_nbr_t *nbr)
 Removes entry from neighbor cache.
 
const uip_lladdr_tuip_ds6_nbr_get_ll (const uip_ds6_nbr_t *nbr)
 Returns link-local address of neighbor.
 
const uip_ipaddr_t * uip_ds6_nbr_get_ipaddr (const uip_ds6_nbr_t *nbr)
 Returns IP address of neighbor.
 
uip_ds6_nbr_tuip_ds6_nbr_lookup (const uip_ipaddr_t *ipaddr)
 Lookup if a neighbor cache entry for given IP address exists. More...
 
uip_ds6_nbr_tuip_ds6_nbr_ll_lookup (const uip_lladdr_t *lladdr)
 Lookup if a neighbor cache entry for given link-layer address exists. More...
 
uip_ipaddr_t * uip_ds6_nbr_ipaddr_from_lladdr (const uip_lladdr_t *lladdr)
 Returns IP address associated with link-local address, based on neighbor cache entry. More...
 
const uip_lladdr_tuip_ds6_nbr_lladdr_from_ipaddr (const uip_ipaddr_t *ipaddr)
 Returns link-layer address associated with IP address, based on neighbor cache entry. More...
 
void uip_ds6_link_neighbor_callback (int status, int numtx)
 ?
 
void uip_ds6_neighbor_periodic (void)
 ?
 
int uip_ds6_nbr_num (void)
 ?
 
uip_ds6_nbr_tuip_ds6_get_least_lifetime_neighbor (void)
 This searches inside the neighbor table for the neighbor that is about to expire the next. More...
 

Detailed Description

Data structure and methods for IPv6 Neighbor Cache (RFC 4861, section 5.1)

Author
Mathilde Durvy mdurv.nosp@m.y@ci.nosp@m.sco.c.nosp@m.om
Julien Abeille jabei.nosp@m.lle@.nosp@m.cisco.nosp@m..com
Simon Duquennoy simon.nosp@m.duq@.nosp@m.sics..nosp@m.se

Function Documentation

uip_ds6_nbr_t* uip_ds6_get_least_lifetime_neighbor ( void  )

This searches inside the neighbor table for the neighbor that is about to expire the next.

Returns
A reference to the neighbor about to expire the next or NULL if table is empty.

Definition at line 280 of file uip-ds6-nbr.c.

References NULL, and stimer_remaining().

uip_ds6_nbr_t* uip_ds6_nbr_add ( const uip_ipaddr_t *  ipaddr,
const uip_lladdr_t lladdr,
uint8_t  isrouter,
uint8_t  state 
)

Adds a neighbor to the neighbor cache.

Parameters
ipaddrIP address of the neighbor to add.
lladdrLink-local address of the neighbor (may be unknown when added), NULL if not known (requires state to be set to NBR_INCOMPLETE)
isrouterSet to 1 if neighbor is a router, to 0 if host or unknown
stateState of this entry. Possible values are: NBR_INCOMPLETE, NBR_REACHABLE, NBR_STALE, NBR_DELAY, NBR_PROBE

Definition at line 80 of file uip-ds6-nbr.c.

References NULL, stimer_set(), and uip_ipaddr_copy.

Referenced by tcpip_ipv6_output(), uip_nd6_ns_input(), and uip_nd6_ra_input().

uip_ipaddr_t* uip_ds6_nbr_ipaddr_from_lladdr ( const uip_lladdr_t lladdr)

Returns IP address associated with link-local address, based on neighbor cache entry.

Definition at line 178 of file uip-ds6-nbr.c.

References NULL, and uip_ds6_nbr_ll_lookup().

uip_ds6_nbr_t* uip_ds6_nbr_ll_lookup ( const uip_lladdr_t lladdr)

Lookup if a neighbor cache entry for given link-layer address exists.

Parameters
llpaddrlink-layer address to look up
Returns
NULL if no entry was found, otherwise a pointer to that entry

Definition at line 171 of file uip-ds6-nbr.c.

Referenced by uip_ds6_link_neighbor_callback(), and uip_ds6_nbr_ipaddr_from_lladdr().

const uip_lladdr_t* uip_ds6_nbr_lladdr_from_ipaddr ( const uip_ipaddr_t *  ipaddr)

Returns link-layer address associated with IP address, based on neighbor cache entry.

Definition at line 186 of file uip-ds6-nbr.c.

References NULL, uip_ds6_nbr_get_ll(), and uip_ds6_nbr_lookup().

Referenced by uip_ds6_route_add().

uip_ds6_nbr_t* uip_ds6_nbr_lookup ( const uip_ipaddr_t *  ipaddr)

Lookup if a neighbor cache entry for given IP address exists.

Parameters
ipaddrIP address to look up
Returns
NULL if no entry was found, otherwise a pointer to that entry

Definition at line 156 of file uip-ds6-nbr.c.

References NULL.

Referenced by tcpip_ipv6_output(), uip_ds6_defrt_choose(), uip_ds6_nbr_lladdr_from_ipaddr(), uip_nd6_na_input(), uip_nd6_ns_input(), and uip_nd6_ra_input().

void uip_ds6_neighbors_init ( void  )

Initialize neighbor cache.

Definition at line 74 of file uip-ds6-nbr.c.

References uip_ds6_nbr_rm().

Referenced by uip_ds6_init().