Files | |
file | ft.h |
Forwarding table definitions. | |
Data Structures | |
struct | gnrc_ipv6_nib_ft_t |
Forwarding table entry view on NIB. More... | |
Functions | |
int | gnrc_ipv6_nib_ft_get (const ipv6_addr_t *dst, gnrc_pktsnip_t *pkt, gnrc_ipv6_nib_ft_t *fte) |
Gets the best matching forwarding table entry to a destination. | |
int | gnrc_ipv6_nib_ft_add (const ipv6_addr_t *dst, unsigned dst_len, const ipv6_addr_t *next_hop, unsigned iface, uint32_t lifetime) |
Adds a new route to the forwarding table. | |
void | gnrc_ipv6_nib_ft_del (const ipv6_addr_t *dst, unsigned dst_len) |
Deletes a route from forwarding table. | |
bool | gnrc_ipv6_nib_ft_iter (const ipv6_addr_t *next_hop, unsigned iface, void **state, gnrc_ipv6_nib_ft_t *fte) |
Iterates over all forwarding table entries in the NIB. | |
void | gnrc_ipv6_nib_ft_print (const gnrc_ipv6_nib_ft_t *fte) |
Prints a forwarding table entry. | |
int gnrc_ipv6_nib_ft_add | ( | const ipv6_addr_t * | dst, |
unsigned | dst_len, | ||
const ipv6_addr_t * | next_hop, | ||
unsigned | iface, | ||
uint32_t | lifetime | ||
) |
Adds a new route to the forwarding table.
If dst
is the default route, the route will be configured to be the default route.
[in] | dst | The destination to the route. May be NULL or :: for default route. |
[in] | dst_len | The prefix length of dst in bits. May be 0 for default route. |
[in] | next_hop | The next hop to dst/ May be NULL, if dst/ no the default route. |
[in] | iface | The interface to next_hop . May not be 0. |
[in] | lifetime | Lifetime of the route in seconds. 0 for infinite lifetime. |
void gnrc_ipv6_nib_ft_del | ( | const ipv6_addr_t * | dst, |
unsigned | dst_len | ||
) |
Deletes a route from forwarding table.
If dst
is the default route, the function assures, that the current primary default route is removed first.
[in] | dst | The destination of the route. May be NULL or :: for default route. |
[in] | dst_len | The prefix length of dst in bits. May be 0 for default route. |
int gnrc_ipv6_nib_ft_get | ( | const ipv6_addr_t * | dst, |
gnrc_pktsnip_t * | pkt, | ||
gnrc_ipv6_nib_ft_t * | fte | ||
) |
Gets the best matching forwarding table entry to a destination.
(dst != NULL) && (fte != NULL)
[in] | dst | The destination. |
[in] | pkt | Packet that is supposed to go to that destination (is handed over to a reactive routing protocol if one exists on the interface found and no route is found) |
[out] | fte | The resulting forwarding table entry. |
bool gnrc_ipv6_nib_ft_iter | ( | const ipv6_addr_t * | next_hop, |
unsigned | iface, | ||
void ** | state, | ||
gnrc_ipv6_nib_ft_t * | fte | ||
) |
Iterates over all forwarding table entries in the NIB.
(state != NULL) && (fte != NULL)
[in] | next_hop | Restrict iteration to entries to this next hop. NULL for any next hop. Can be used to build a source routing tree. |
[in] | iface | Restrict iteration to entries on this interface. 0 for any interface. |
[in,out] | state | Iteration state of the forwarding table. Must point to a NULL pointer to start iteration. |
[out] | fte | The next forwarding table entry. |
The iteration over all forwarding table entries in the NIB includes all entries added via gnrc_ipv6_nib_ft_add()
and entries that are currently in the Destination Cache, in the Prefix List (only if they're on-link), and in the Default Router List.
Usage example:
fte
is the last neighbor cache entry in the NIB. void gnrc_ipv6_nib_ft_print | ( | const gnrc_ipv6_nib_ft_t * | fte | ) |
Prints a forwarding table entry.
fce != NULL
[in] | fte | A forwarding table entry. |