ipv6.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 
18 #ifndef NET_GNRC_NETIF_IPV6_H
19 #define NET_GNRC_NETIF_IPV6_H
20 
21 #include <assert.h>
22 #include <kernel_defines.h>
23 
24 #include "evtimer_msg.h"
25 #include "net/ipv6/addr.h"
26 #ifdef MODULE_GNRC_IPV6_NIB
27 #include "net/gnrc/ipv6/nib/conf.h"
28 #endif
29 #include "net/gnrc/netapi.h"
30 #include "net/gnrc/netif/conf.h"
31 #ifdef MODULE_NETSTATS_IPV6
32 #include "net/netstats.h"
33 #endif
34 
35 #ifdef __cplusplus
36 extern "C" {
37 #endif
38 
47 #define GNRC_NETIF_IPV6_ADDRS_FLAGS_STATE_MASK (0x1fU)
48 
56 #define GNRC_NETIF_IPV6_ADDRS_FLAGS_STATE_TENTATIVE (0x07U)
57 
61 #define GNRC_NETIF_IPV6_ADDRS_FLAGS_STATE_DEPRECATED (0x08U)
62 
66 #define GNRC_NETIF_IPV6_ADDRS_FLAGS_STATE_VALID (0x10U)
67 
71 #define GNRC_NETIF_IPV6_ADDRS_FLAGS_ANYCAST (0x20U)
72 
79 typedef struct {
87  uint8_t addrs_flags[CONFIG_GNRC_NETIF_IPV6_ADDRS_NUMOF];
88 
95 
102 #ifdef MODULE_NETSTATS_IPV6
103 
108  netstats_t stats;
109 #endif
110 #if defined(MODULE_GNRC_IPV6_NIB) || DOXYGEN
111 #if IS_ACTIVE(CONFIG_GNRC_IPV6_NIB_ROUTER) || DOXYGEN
112 
127  void (*route_info_cb)(unsigned type, const ipv6_addr_t *ctx_addr,
128  const void *ctx);
137 #endif /* CONFIG_GNRC_IPV6_NIB_ROUTER */
138 #if IS_ACTIVE(CONFIG_GNRC_IPV6_NIB_ARSM) || DOXYGEN
139 
147 #endif /* CONFIG_GNRC_IPV6_NIB_ARSM */
148 
155 #if IS_ACTIVE(CONFIG_GNRC_IPV6_NIB_6LN) || IS_ACTIVE(CONFIG_GNRC_IPV6_NIB_SLAAC) || DOXYGEN
156 
167 #endif
168 
169 #if IS_ACTIVE(CONFIG_GNRC_IPV6_NIB_ROUTER) || DOXYGEN
170 
178  uint32_t last_ra;
179 #endif /* CONFIG_GNRC_IPV6_NIB_ROUTER */
180 #if IS_ACTIVE(CONFIG_GNRC_IPV6_NIB_ARSM) || defined(DOXYGEN)
181 
190  uint32_t reach_time_base;
191 
199  uint32_t reach_time;
200 #endif /* CONFIG_GNRC_IPV6_NIB_ARSM */
201 
207  uint32_t retrans_time;
208 #if IS_ACTIVE(CONFIG_GNRC_IPV6_NIB_ROUTER) || DOXYGEN
209 
216  uint16_t rtr_ltime;
228  uint8_t ra_sent;
229 #endif
230 
236  uint8_t rs_sent;
243  uint8_t na_sent;
244 #endif /* MODULE_GNRC_IPV6_NIB */
245 
251  uint8_t aac_mode;
252 
258  uint16_t mtu;
260 
261 #ifdef __cplusplus
262 }
263 #endif
264 
265 #endif /* NET_GNRC_NETIF_IPV6_H */
266 
uint32_t reach_time
Reachable time (in ms)
Definition: ipv6.h:199
Definition of net statistics.
evtimer_msg_event_t recalc_reach_time
Event for GNRC_IPV6_NIB_RECALC_REACH_TIME.
Definition: ipv6.h:146
uint8_t rs_sent
number of unsolicited router solicitations scheduled
Definition: ipv6.h:236
Definitions for IPv6 addresses.
Configuration macros for Network interface API.
Generic interface to communicate with GNRC modules.
evtimer_msg_event_t search_rtr
Event for GNRC_IPV6_NIB_SEARCH_RTR.
Definition: ipv6.h:154
Global statistics struct.
Definition: netstats.h:43
#define GNRC_NETIF_IPV6_GROUPS_NUMOF
Maximum number of multicast groups per interface.
Definition: conf.h:107
uint32_t retrans_time
Retransmission time and advertised retransmission time (in ms)
Definition: ipv6.h:207
uint32_t last_ra
Timestamp in milliseconds of last unsolicited router advertisement.
Definition: ipv6.h:178
POSIX.1-2008 compliant version of the assert macro.
IPv6 component for gnrc_netif_t.
Definition: ipv6.h:79
evtimer_msg_event_t snd_mc_ra
Event for GNRC_IPV6_NIB_SND_MC_RA.
Definition: ipv6.h:136
Configuration macro definitions for neighbor information base.
IPC-based evtimer definitions.
uint8_t aac_mode
IPv6 auto-address configuration mode.
Definition: ipv6.h:251
uint32_t reach_time_base
Base for random reachable time calculation and advertised reachable time in ms (if GNRC_NETIF_FLAGS_I...
Definition: ipv6.h:190
uint16_t mtu
Maximum transmission unit (MTU) for IPv6 packets.
Definition: ipv6.h:258
Common macros and compiler attributes/pragmas configuration.
uint8_t ra_sent
number of unsolicited router advertisements sent
Definition: ipv6.h:228
uint8_t na_sent
number of unsolicited neighbor advertisements scheduled
Definition: ipv6.h:243
IPC-message event.
Definition: evtimer_msg.h:40
Data type to represent an IPv6 address.
Definition: addr.h:74
uint16_t rtr_ltime
(Advertised) Router lifetime (default 1800).
Definition: ipv6.h:216
#define CONFIG_GNRC_NETIF_IPV6_ADDRS_NUMOF
Maximum number of unicast and anycast addresses per interface.
Definition: conf.h:97