ipv6.h
Go to the documentation of this file.
1 /*
2  * SPDX-FileCopyrightText: 2017 Freie Universität Berlin
3  * SPDX-License-Identifier: LGPL-2.1-only
4  */
5 
6 #pragma once
7 
18 #include "modules.h"
19 
20 #include "evtimer_msg.h"
21 #include "net/ipv6/addr.h"
22 #ifdef MODULE_GNRC_IPV6_NIB
23 #include "net/gnrc/ipv6/nib/conf.h"
24 #endif
25 #include "net/gnrc/netapi.h"
26 #include "net/gnrc/netif/conf.h"
27 #ifdef MODULE_NETSTATS_IPV6
28 #include "net/netstats.h"
29 #endif
30 
31 #ifdef __cplusplus
32 extern "C" {
33 #endif
34 
43 #define GNRC_NETIF_IPV6_ADDRS_FLAGS_STATE_MASK (0x1fU)
44 
52 #define GNRC_NETIF_IPV6_ADDRS_FLAGS_STATE_TENTATIVE (0x07U)
53 
57 #define GNRC_NETIF_IPV6_ADDRS_FLAGS_STATE_DEPRECATED (0x08U)
58 
62 #define GNRC_NETIF_IPV6_ADDRS_FLAGS_STATE_VALID (0x10U)
63 
67 #define GNRC_NETIF_IPV6_ADDRS_FLAGS_ANYCAST (0x20U)
75 typedef struct {
83  uint8_t addrs_flags[CONFIG_GNRC_NETIF_IPV6_ADDRS_NUMOF];
84 
91 
98 #ifdef MODULE_NETSTATS_IPV6
104  netstats_t stats;
105 #endif
106 #if defined(MODULE_GNRC_IPV6_NIB) || DOXYGEN
107 #if IS_ACTIVE(CONFIG_GNRC_IPV6_NIB_ROUTER) || DOXYGEN
123  void (*route_info_cb)(unsigned type, const ipv6_addr_t *ctx_addr,
124  const void *ctx);
133 #endif /* CONFIG_GNRC_IPV6_NIB_ROUTER */
134 #if IS_ACTIVE(CONFIG_GNRC_IPV6_NIB_ARSM) || DOXYGEN
143 #endif /* CONFIG_GNRC_IPV6_NIB_ARSM */
151 #if IS_ACTIVE(CONFIG_GNRC_IPV6_NIB_6LN) || IS_ACTIVE(CONFIG_GNRC_IPV6_NIB_SLAAC) || DOXYGEN
163 #endif
164 
165 #if IS_ACTIVE(CONFIG_GNRC_IPV6_NIB_ROUTER) || DOXYGEN
174  uint32_t last_ra;
175 #endif /* CONFIG_GNRC_IPV6_NIB_ROUTER */
176 #if IS_ACTIVE(CONFIG_GNRC_IPV6_NIB_ARSM) || defined(DOXYGEN)
186  uint32_t reach_time_base;
187 
195  uint32_t reach_time;
196 #endif /* CONFIG_GNRC_IPV6_NIB_ARSM */
203  uint32_t retrans_time;
204 #if IS_ACTIVE(CONFIG_GNRC_IPV6_NIB_ROUTER) || DOXYGEN
212  uint16_t rtr_ltime;
224  uint8_t ra_sent;
225 #endif
232  uint8_t rs_sent;
239  uint8_t na_sent;
240 #endif /* MODULE_GNRC_IPV6_NIB */
241 
247  uint8_t aac_mode;
248 
254  uint16_t mtu;
256 
257 #ifdef __cplusplus
258 }
259 #endif
260 
IPC-based evtimer definitions.
#define CONFIG_GNRC_NETIF_IPV6_ADDRS_NUMOF
Maximum number of unicast and anycast addresses per interface.
Definition: conf.h:113
#define GNRC_NETIF_IPV6_GROUPS_NUMOF
Maximum number of multicast groups per interface.
Definition: conf.h:124
Definition of net statistics.
Definitions for IPv6 addresses.
Configuration macro definitions for neighbor information base.
Common macros and compiler attributes/pragmas configuration.
Generic interface to communicate with GNRC modules.
Configuration macros for Network interface API.
IPC-message event.
Definition: evtimer_msg.h:37
IPv6 component for gnrc_netif_t.
Definition: ipv6.h:75
uint32_t reach_time
Reachable time (in ms)
Definition: ipv6.h:195
uint8_t na_sent
number of unsolicited neighbor advertisements scheduled
Definition: ipv6.h:239
evtimer_msg_event_t search_rtr
Event for GNRC_IPV6_NIB_SEARCH_RTR.
Definition: ipv6.h:150
uint8_t aac_mode
IPv6 auto-address configuration mode flags.
Definition: ipv6.h:247
uint8_t rs_sent
number of unsolicited router solicitations scheduled
Definition: ipv6.h:232
evtimer_msg_event_t recalc_reach_time
Event for GNRC_IPV6_NIB_RECALC_REACH_TIME.
Definition: ipv6.h:142
uint8_t ra_sent
number of unsolicited router advertisements sent
Definition: ipv6.h:224
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:186
uint16_t mtu
Maximum transmission unit (MTU) for IPv6 packets.
Definition: ipv6.h:254
uint32_t retrans_time
Retransmission time and advertised retransmission time (in ms)
Definition: ipv6.h:203
uint16_t rtr_ltime
(Advertised) Router lifetime (default 1800).
Definition: ipv6.h:212
evtimer_msg_event_t snd_mc_ra
Event for GNRC_IPV6_NIB_SND_MC_RA.
Definition: ipv6.h:132
uint32_t last_ra
Timestamp in milliseconds of last unsolicited router advertisement.
Definition: ipv6.h:174
Global statistics struct.
Definition: netstats.h:56
Data type to represent an IPv6 address.
Definition: addr.h:64