Loading...
Searching...
No Matches

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

Detailed Description

Prefix list component of neighbor information base.

Files

file  pl.h
 Prefix list definitions.
 

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.
 
void gnrc_ipv6_nib_pl_del (unsigned iface, const ipv6_addr_t *pfx, unsigned pfx_len)
 Deletes prefix from NIB.
 
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.
 
static uint32_t gnrc_ipv6_nib_pl_valid_offset (const gnrc_ipv6_nib_pl_t *ple)
 Provides the time in milliseconds for which the prefix list entry is valid.
 
static uint32_t gnrc_ipv6_nib_pl_pref_offset (const gnrc_ipv6_nib_pl_t *ple)
 Provides the time in milliseconds for which the prefix list entry is preferred.
 
void gnrc_ipv6_nib_pl_print (gnrc_ipv6_nib_pl_t *ple)
 Prints a prefix list entry.
 

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;
}
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.
void gnrc_ipv6_nib_pl_print(gnrc_ipv6_nib_pl_t *ple)
Prints a prefix list entry.
Prefix list definitions.
Prefix list entry view on NIB.
Definition pl.h:38
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_pref_offset()

static uint32_t gnrc_ipv6_nib_pl_pref_offset ( const gnrc_ipv6_nib_pl_t ple)
inlinestatic

Provides the time in milliseconds for which the prefix list entry is preferred.

A prefix for which the preference expired is deprecated (see [RFC 4862] (https://tools.ietf.org/html/rfc4862))

Parameters
[in]pleA prefix list entry.
Returns
The time in milliseconds for which the prefix list entry is preferred. UINT32_MAX if it is preferred forever.

Definition at line 159 of file pl.h.

◆ 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. Must not be NULL.
[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.

◆ gnrc_ipv6_nib_pl_valid_offset()

static uint32_t gnrc_ipv6_nib_pl_valid_offset ( const gnrc_ipv6_nib_pl_t ple)
inlinestatic

Provides the time in milliseconds for which the prefix list entry is valid.

Parameters
[in]pleA prefix list entry.
Returns
The time in milliseconds for which the prefix list entry is valid. UINT32_MAX if it is valid forever.

Definition at line 139 of file pl.h.