_nib-arsm.h
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 
21 #ifndef PRIV_NIB_ARSM_H
22 #define PRIV_NIB_ARSM_H
23 
24 #include <stdint.h>
25 
26 #include "net/gnrc/ipv6/nib/conf.h"
27 #include "net/gnrc/netif.h"
28 #include "net/ndp.h"
29 #include "net/icmpv6.h"
30 
31 #include "_nib-internal.h"
32 
33 #ifdef __cplusplus
34 extern "C" {
35 #endif
36 
51 void _snd_ns(const ipv6_addr_t *tgt, gnrc_netif_t *netif,
52  const ipv6_addr_t *src, const ipv6_addr_t *dst);
53 
66 void _snd_uc_ns(_nib_onl_entry_t *nbr, bool reset);
67 
81 void _handle_sl2ao(gnrc_netif_t *netif, const ipv6_hdr_t *ipv6,
82  const icmpv6_hdr_t *icmpv6, const ndp_opt_t *sl2ao);
83 
84 #if GNRC_IPV6_NIB_CONF_ARSM || defined(DOXYGEN)
85 
91 void _handle_snd_ns(_nib_onl_entry_t *nbr);
92 
99 void _handle_state_timeout(_nib_onl_entry_t *nbr);
100 
107 void _probe_nbr(_nib_onl_entry_t *nbr, bool reset);
108 
124 void _handle_adv_l2(gnrc_netif_t *netif, _nib_onl_entry_t *nce,
125  const icmpv6_hdr_t *icmpv6, const ndp_opt_t *tl2ao);
126 
127 
136 void _recalc_reach_time(gnrc_netif_ipv6_t *netif);
137 
145 void _set_reachable(gnrc_netif_t *netif, _nib_onl_entry_t *nce);
146 
152 static inline void _init_iface_arsm(gnrc_netif_t *netif)
153 {
155  _recalc_reach_time(&netif->ipv6);
156 }
157 
165 static inline uint16_t _get_nud_state(_nib_onl_entry_t *nbr)
166 {
168 }
169 
178 void _set_nud_state(gnrc_netif_t *netif, _nib_onl_entry_t *nbr,
179  uint16_t state);
180 
191 bool _is_reachable(_nib_onl_entry_t *entry);
192 #else /* GNRC_IPV6_NIB_CONF_ARSM || defined(DOXYGEN) */
193 #define _handle_snd_ns(ctx) (void)ctx
194 #define _handle_state_timeout(ctx) (void)ctx
195 #define _probe_nbr(nbr, reset) (void)nbr; (void)reset
196 #define _init_iface_arsm(netif) (void)netif
197 #define _handle_adv_l2(netif, nce, icmpv6, tl2ao) (void)netif; (void)nce; \
198  (void)icmpv6; (void)tl2ao
199 #define _recalc_reach_time(netif) (void)netif
200 #define _set_reachable(netif, nce) (void)netif; (void)nce
201 #define _init_iface_arsm(netif) (void)netif
202 
203 #define _get_nud_state(nbr) (GNRC_IPV6_NIB_NC_INFO_NUD_STATE_UNMANAGED)
204 #define _set_nud_state(netif, nce, state) (void)netif; (void)nbr; (void)state
205 #define _is_reachable(entry) (true)
206 #endif /* GNRC_IPV6_NIB_CONF_ARSM || defined(DOXYGEN) */
207 
208 #ifdef __cplusplus
209 }
210 #endif
211 
212 #endif /* PRIV_NIB_ARSM_H */
213 
Data type to represent an IPv6 packet header.
Definition: ipv6/hdr.h:68
uint16_t info
Information flags.
General NDP option format.
Definition: ndp.h:265
On-link NIB entry.
Definition: _nib-internal.h:92
IPv6 component for gnrc_netif_t.
Definition for GNRC&#39;s network interfaces.
Configuration macro definitions for neighbor information base.
gnrc_netif_ipv6_t ipv6
IPv6 component.
Definition: netif.h:66
uint32_t reach_time_base
Base for random reachable time calculation and advertised reachable time in ms (if GNRC_NETIF_FLAGS_I...
#define NDP_REACH_MS
REACHABLE_TIME (in ms)
Definition: ndp.h:165
Representation of a network interface.
Definition: netif.h:61
General ICMPv6 message format.
Definition: icmpv6.h:141
ICMPv6 type and function definitions.
#define GNRC_IPV6_NIB_NC_INFO_NUD_STATE_MASK
Mask for neighbor unreachability detection (NUD) states.
Definition: nc.h:47
Data type to represent an IPv6 address.
Definition: ipv6/addr.h:74
IPv6 neighbor discovery message type definitions.
void _snd_ns(const ipv6_addr_t *tgt, gnrc_netif_t *netif, const ipv6_addr_t *src, const ipv6_addr_t *dst)
Sends neighbor solicitation (including ARO if required)