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 <kernel_defines.h>
22 
23 #include "evtimer_msg.h"
24 #include "net/ipv6/addr.h"
25 #ifdef MODULE_GNRC_IPV6_NIB
26 #include "net/gnrc/ipv6/nib/conf.h"
27 #endif
28 #include "net/gnrc/netapi.h"
29 #include "net/gnrc/netif/conf.h"
30 #ifdef MODULE_NETSTATS_IPV6
31 #include "net/netstats.h"
32 #endif
33 
34 #ifdef __cplusplus
35 extern "C" {
36 #endif
37 
46 #define GNRC_NETIF_IPV6_ADDRS_FLAGS_STATE_MASK (0x1fU)
47 
55 #define GNRC_NETIF_IPV6_ADDRS_FLAGS_STATE_TENTATIVE (0x07U)
56 
60 #define GNRC_NETIF_IPV6_ADDRS_FLAGS_STATE_DEPRECATED (0x08U)
61 
65 #define GNRC_NETIF_IPV6_ADDRS_FLAGS_STATE_VALID (0x10U)
66 
70 #define GNRC_NETIF_IPV6_ADDRS_FLAGS_ANYCAST (0x20U)
71 
78 typedef struct {
86  uint8_t addrs_flags[CONFIG_GNRC_NETIF_IPV6_ADDRS_NUMOF];
87 
94 
101 #ifdef MODULE_NETSTATS_IPV6
102 
107  netstats_t stats;
108 #endif
109 #if defined(MODULE_GNRC_IPV6_NIB) || DOXYGEN
110 #if IS_ACTIVE(CONFIG_GNRC_IPV6_NIB_ROUTER) || DOXYGEN
111 
126  void (*route_info_cb)(unsigned type, const ipv6_addr_t *ctx_addr,
127  const void *ctx);
136 #endif /* CONFIG_GNRC_IPV6_NIB_ROUTER */
137 #if IS_ACTIVE(CONFIG_GNRC_IPV6_NIB_ARSM) || DOXYGEN
138 
146 #endif /* CONFIG_GNRC_IPV6_NIB_ARSM */
147 
154 #if IS_ACTIVE(CONFIG_GNRC_IPV6_NIB_6LN) || IS_ACTIVE(CONFIG_GNRC_IPV6_NIB_SLAAC) || DOXYGEN
155 
166 #endif
167 
168 #if IS_ACTIVE(CONFIG_GNRC_IPV6_NIB_ROUTER) || DOXYGEN
169 
177  uint32_t last_ra;
178 #endif /* CONFIG_GNRC_IPV6_NIB_ROUTER */
179 #if IS_ACTIVE(CONFIG_GNRC_IPV6_NIB_ARSM) || defined(DOXYGEN)
180 
189  uint32_t reach_time_base;
190 
198  uint32_t reach_time;
199 #endif /* CONFIG_GNRC_IPV6_NIB_ARSM */
200 
206  uint32_t retrans_time;
207 #if IS_ACTIVE(CONFIG_GNRC_IPV6_NIB_ROUTER) || DOXYGEN
208 
215  uint16_t rtr_ltime;
227  uint8_t ra_sent;
228 #endif
229 
235  uint8_t rs_sent;
242  uint8_t na_sent;
243 #endif /* MODULE_GNRC_IPV6_NIB */
244 
250  uint8_t aac_mode;
251 
257  uint16_t mtu;
259 
260 #ifdef __cplusplus
261 }
262 #endif
263 
264 #endif /* NET_GNRC_NETIF_IPV6_H */
265 
netapi.h
Generic interface to communicate with GNRC modules.
netstats_t
Global statistics struct.
Definition: netstats.h:43
kernel_defines.h
Common macros and compiler attributes/pragmas configuration.
gnrc_netif_ipv6_t::rtr_ltime
uint16_t rtr_ltime
(Advertised) Router lifetime (default 1800).
Definition: ipv6.h:215
ipv6_addr_t
Data type to represent an IPv6 address.
Definition: addr.h:74
addr.h
Definitions for IPv6 addresses.
GNRC_NETIF_IPV6_GROUPS_NUMOF
#define GNRC_NETIF_IPV6_GROUPS_NUMOF
Maximum number of multicast groups per interface.
Definition: conf.h:124
CONFIG_GNRC_NETIF_IPV6_ADDRS_NUMOF
#define CONFIG_GNRC_NETIF_IPV6_ADDRS_NUMOF
Maximum number of unicast and anycast addresses per interface.
Definition: conf.h:114
gnrc_netif_ipv6_t
IPv6 component for gnrc_netif_t.
Definition: ipv6.h:78
evtimer_msg.h
IPC-based evtimer definitions.
gnrc_netif_ipv6_t::aac_mode
uint8_t aac_mode
IPv6 auto-address configuration mode.
Definition: ipv6.h:250
conf.h
Configuration macros for Network interface API.
gnrc_netif_ipv6_t::na_sent
uint8_t na_sent
number of unsolicited neighbor advertisements scheduled
Definition: ipv6.h:242
conf.h
Configuration macro definitions for neighbor information base.
gnrc_netif_ipv6_t::search_rtr
evtimer_msg_event_t search_rtr
Event for GNRC_IPV6_NIB_SEARCH_RTR.
Definition: ipv6.h:153
gnrc_netif_ipv6_t::ra_sent
uint8_t ra_sent
number of unsolicited router advertisements sent
Definition: ipv6.h:227
gnrc_netif_ipv6_t::last_ra
uint32_t last_ra
Timestamp in milliseconds of last unsolicited router advertisement.
Definition: ipv6.h:177
gnrc_netif_ipv6_t::reach_time
uint32_t reach_time
Reachable time (in ms)
Definition: ipv6.h:198
gnrc_netif_ipv6_t::reach_time_base
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:189
gnrc_netif_ipv6_t::rs_sent
uint8_t rs_sent
number of unsolicited router solicitations scheduled
Definition: ipv6.h:235
gnrc_netif_ipv6_t::snd_mc_ra
evtimer_msg_event_t snd_mc_ra
Event for GNRC_IPV6_NIB_SND_MC_RA.
Definition: ipv6.h:135
netstats.h
Definition of net statistics.
gnrc_netif_ipv6_t::retrans_time
uint32_t retrans_time
Retransmission time and advertised retransmission time (in ms)
Definition: ipv6.h:206
evtimer_msg_event_t
IPC-message event.
Definition: evtimer_msg.h:40
gnrc_netif_ipv6_t::recalc_reach_time
evtimer_msg_event_t recalc_reach_time
Event for GNRC_IPV6_NIB_RECALC_REACH_TIME.
Definition: ipv6.h:145
gnrc_netif_ipv6_t::mtu
uint16_t mtu
Maximum transmission unit (MTU) for IPv6 packets.
Definition: ipv6.h:257