Prefix list component of neighbor information base. More...

Detailed Description

Prefix list component of neighbor information base.

Files

file  pl.h
 Prefix list defintions.
 

Data Structures

struct  gnrc_ipv6_nib_pl_t
 Prefix list entry view on NIB. More...
 

Functions

int gnrc_ipv6_nib_pl_set (unsigned iface, const ipv6_addr_t *pfx, unsigned pfx_len, uint32_t valid_ltime, uint32_t pref_ltime)
 Adds (or updates) prefix to NIB. More...
 
void gnrc_ipv6_nib_pl_del (unsigned iface, const ipv6_addr_t *pfx, unsigned pfx_len)
 Deletes prefix from NIB. More...
 
bool gnrc_ipv6_nib_pl_iter (unsigned iface, void **state, gnrc_ipv6_nib_pl_t *ple)
 Iterates over all prefix list entries in the NIB. More...
 
void gnrc_ipv6_nib_pl_print (gnrc_ipv6_nib_pl_t *ple)
 Prints a prefix list entry. More...
 

Function Documentation

◆ gnrc_ipv6_nib_pl_del()

void gnrc_ipv6_nib_pl_del ( unsigned  iface,
const ipv6_addr_t pfx,
unsigned  pfx_len 
)

Deletes prefix from NIB.

Precondition
pfx != NULL
Parameters
[in]ifaceThe interface pfx is expected to be on (0 for any).
[in]pfxThe prefix to be removed.
[in]pfx_lenLength of pfx in bits.

◆ gnrc_ipv6_nib_pl_iter()

bool gnrc_ipv6_nib_pl_iter ( unsigned  iface,
void **  state,
gnrc_ipv6_nib_pl_t ple 
)

Iterates over all prefix list entries in the NIB.

Precondition
(state != NULL) && (ple != NULL)
Parameters
[in]ifaceRestrict iteration to entries on this interface. 0 for any interface.
[in,out]stateIteration state of the prefix list. Must point to NULL pointer to start iteration
[out]pleThe next prefix list entry.

Usage example:

int main(void) {
void *state = NULL;
puts("My prefixes:");
while (gnrc_ipv6_nib_pl_iter(0, &state, &ple)) {
}
return 0;
}
Note
The list may change during iteration.
Returns
true, if iteration can be continued.
false, if ple is the last prefix list ple in the NIB.

◆ gnrc_ipv6_nib_pl_print()

void gnrc_ipv6_nib_pl_print ( gnrc_ipv6_nib_pl_t ple)

Prints a prefix list entry.

Precondition
ple != NULL
Parameters
[in]pleA prefix list entry

◆ gnrc_ipv6_nib_pl_set()

int gnrc_ipv6_nib_pl_set ( unsigned  iface,
const ipv6_addr_t pfx,
unsigned  pfx_len,
uint32_t  valid_ltime,
uint32_t  pref_ltime 
)

Adds (or updates) prefix to NIB.

Precondition
(pfx != NULL)
Parameters
[in]ifaceInterface pfx is valid on.
[in]pfxThe prefix. May not be a link-local prefix or a multicast address and its first pfx_len bits may not be 0.
[in]pfx_lenLength of pfx in bits. Condition pfx_len > 0 must hold.
[in]valid_ltimeLifetime (in ms) until prefix expires from now. UINT32_MAX for infinite lifetime. Addresses with expired prefixes are removed from iface.
[in]pref_ltimeLifetime (in ms) until prefix deprecates from now. UINT32_MAX for infinite lifetime. Addresses with deprecated prefixes should not be used for new communication. Only applications with difficulty changing to another address without service disruption should use deprecated addresses. May not be greater then valid_ltime.
Returns
0, on success.
-EINVAL, if pfx was fe80::` or multicast, pfx_len was == 0, the first pfx_len bits of @ pfx were 0, or if pref_ltime > valid_ltime.
-ENOMEM, if no space was left in the prefix list.