ft.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2017 Freie Universit├Ąt Berlin
3  *
4  * This file is subject to the terms and conditions of the GNU Lesser
5  * General Public License v2.1. See the file LICENSE in the top level
6  * directory for more details.
7  */
8 
20 #ifndef NET_GNRC_IPV6_NIB_FT_H
21 #define NET_GNRC_IPV6_NIB_FT_H
22 
23 #include <stdint.h>
24 
25 #include "net/gnrc/pkt.h"
26 #include "net/ipv6/addr.h"
27 
28 #ifdef __cplusplus
29 extern "C" {
30 #endif
31 
35 typedef struct {
38  uint8_t dst_len;
40  uint8_t primary;
42  uint16_t iface;
44 
60  gnrc_ipv6_nib_ft_t *fte);
61 
82 int gnrc_ipv6_nib_ft_add(const ipv6_addr_t *dst, unsigned dst_len,
83  const ipv6_addr_t *next_hop, unsigned iface,
84  uint16_t lifetime);
85 
97 void gnrc_ipv6_nib_ft_del(const ipv6_addr_t *dst, unsigned dst_len);
98 
139 bool gnrc_ipv6_nib_ft_iter(const ipv6_addr_t *next_hop, unsigned iface,
140  void **state, gnrc_ipv6_nib_ft_t *fte);
141 
142 
151 
152 #ifdef __cplusplus
153 }
154 #endif
155 
156 #endif /* NET_GNRC_IPV6_NIB_FT_H */
157 
uint16_t iface
interface to gnrc_ipv6_nib_ft_t::next_hop
Definition: ft.h:42
ipv6_addr_t next_hop
next hop to gnrc_ipv6_nib_ft_t::dst
Definition: ft.h:37
Definitions for IPv6 addresses.
General definitions for network packets and their helper functions.
Forwarding table entry view on NIB.
Definition: ft.h:35
uint8_t dst_len
prefix-length in bits of gnrc_ipv6_nib_ft_t::dst
Definition: ft.h:38
uint8_t primary
!= 0 if gnrc_ipv6_nib_ft_t::dst is preferred default route
Definition: ft.h:40
int gnrc_ipv6_nib_ft_add(const ipv6_addr_t *dst, unsigned dst_len, const ipv6_addr_t *next_hop, unsigned iface, uint16_t lifetime)
Adds a new route to the 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_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.
Type to represent parts (either headers or payload) of a packet, called snips.
Data type to represent an IPv6 address.
Definition: ipv6/addr.h:74
void gnrc_ipv6_nib_ft_del(const ipv6_addr_t *dst, unsigned dst_len)
Deletes a route from forwarding table.
ipv6_addr_t dst
destination or prefix
Definition: ft.h:36