Definitions for GNRC's IPv6 Neighbor Discovery. More...

Detailed Description

#include <inttypes.h>
#include <stdlib.h>
#include "byteorder.h"
#include "net/ndp.h"
#include "net/gnrc/pkt.h"
#include "net/gnrc/icmpv6.h"
#include "net/ipv6/addr.h"
#include "net/gnrc/ipv6/nc.h"
#include "net/gnrc/ipv6/netif.h"
#include "net/gnrc/ndp/host.h"
#include "net/gnrc/ndp/internal.h"
#include "net/gnrc/ndp/router.h"
#include "net/gnrc/ndp/node.h"
+ Include dependency graph for gnrc/ndp.h:

Go to the source code of this file.

Macros

#define GNRC_NDP_MSG_RTR_TIMEOUT   (0x0210)
 Message type for router timeouts.
 
#define GNRC_NDP_MSG_ADDR_TIMEOUT   (0x0211)
 Message type for address timeouts.
 
#define GNRC_NDP_MSG_NBR_SOL_RETRANS   (0x0212)
 Message type for multicast neighbor solicitation retransmissions.
 
#define GNRC_NDP_MSG_RTR_ADV_RETRANS   (0x0213)
 Message type for periodic router advertisements.
 
#define GNRC_NDP_MSG_RTR_ADV_DELAY   (0x0214)
 Message type for delayed router advertisements.
 
#define GNRC_NDP_MSG_RTR_ADV_SIXLOWPAN_DELAY   (0x0215)
 Message type for delayed router advertisements in a 6LoWPAN 6LoWPAN needs a special handling, because router advertisements are only sent after a short randomized delay, but not periodically. More...
 
#define GNRC_NDP_MSG_RTR_SOL_RETRANS   (0x0216)
 Message type for periodic router solicitations.
 
#define GNRC_NDP_MSG_NC_STATE_TIMEOUT   (0x0217)
 Message type for neighbor cache state timeouts.
 
Host constants
#define GNRC_NDP_MAX_RTR_SOL_DELAY   (1U)
 Upper bound for randomised delay in seconds for initial router solicitation transmissions.
 
#define GNRC_NDP_MAX_RTR_SOL_INT   (4U)
 Interval in seconds between initial router solicitation transmissions.
 
#define GNRC_NDP_MAX_RTR_SOL_NUMOF   (3U)
 Maximum number of initial router solicitation transmissions.
 
Node constants
#define GNRC_NDP_MAX_MC_NBR_SOL_NUMOF   (3U)
 Maximum number of unanswered multicast neighbor solicitations before address resolution is considered failed.
 
#define GNRC_NDP_MAX_UC_NBR_SOL_NUMOF   (3U)
 Maximum number of unanswered unicast neighbor solicitations before an address is considered unreachable.
 
#define GNRC_NDP_MAX_AC_TGT_DELAY   (1U)
 Upper bound of randomized delay in seconds for a solicited neighbor advertisement transmission for an anycast target.
 
#define GNRC_NDP_MAX_NBR_ADV_NUMOF   (3U)
 Maximum number of unsolicited neighbor advertisements before on link-layer address change.
 
#define GNRC_NDP_REACH_TIME   (30U * US_PER_SEC)
 Base value in mircoseconds for computing randomised reachable time.
 
#define GNRC_NDP_RETRANS_TIMER   (1U * US_PER_SEC)
 Time in mircoseconds between retransmissions of neighbor solicitations to a neighbor.
 
#define GNRC_NDP_FIRST_PROBE_DELAY   (5U)
 Delay in seconds for neighbor cache entry between entering DELAY state and entering PROBE state if no reachability confirmation has been received.
 
#define GNRC_NDP_MIN_RAND   (5U)
 Lower bound for randomised reachable time calculation.
 
#define GNRC_NDP_MAX_RAND   (15U)
 Upper bound for randomised reachable time calculation.
 
Router constants
#define GNRC_NDP_MAX_INIT_RTR_ADV_INT   (16U)
 Initial router advertisement interval in seconds.
 
#define GNRC_NDP_MAX_INIT_RTR_ADV_NUMOF   (3U)
 Maximum number of initial router advertisement transmissions.
 
#define GNRC_NDP_MAX_FIN_RTR_ADV_NUMOF   (3U)
 Maximum number of final router advertisement transmissions.
 
#define GNRC_NDP_MIN_RTR_ADV_DELAY   (3U)
 Minimum delay in seconds between router advertisement transmissions.
 
#define GNRC_NDP_MAX_RTR_ADV_DELAY   (500U * US_PER_MS)
 Upper bound for randomised delay in microseconds between router solicitation reception and responding router advertisement transmission.
 

Functions

void gnrc_ndp_nbr_sol_handle (kernel_pid_t iface, gnrc_pktsnip_t *pkt, ipv6_hdr_t *ipv6, ndp_nbr_sol_t *nbr_sol, size_t icmpv6_size)
 Handles received neighbor solicitations. More...
 
void gnrc_ndp_nbr_adv_handle (kernel_pid_t iface, gnrc_pktsnip_t *pkt, ipv6_hdr_t *ipv6, ndp_nbr_adv_t *nbr_adv, size_t icmpv6_size)
 Handles received neighbor advertisements. More...
 
void gnrc_ndp_rtr_sol_handle (kernel_pid_t iface, gnrc_pktsnip_t *pkt, ipv6_hdr_t *ipv6, ndp_rtr_sol_t *rtr_sol, size_t icmpv6_size)
 Handles received router solicitations. More...
 
void gnrc_ndp_rtr_adv_handle (kernel_pid_t iface, gnrc_pktsnip_t *pkt, ipv6_hdr_t *ipv6, ndp_rtr_adv_t *rtr_adv, size_t icmpv6_size)
 Handles received router advertisements. More...
 
void gnrc_ndp_retrans_nbr_sol (gnrc_ipv6_nc_t *nc_entry)
 Retransmits a multicast neighbor solicitation for an incomplete or probing neighbor cache entry nc_entry, if nc_entry::probes_remaining > 0. More...
 
void gnrc_ndp_state_timeout (gnrc_ipv6_nc_t *nc_entry)
 Event handler for a neighbor cache state timeout. More...
 
void gnrc_ndp_netif_add (gnrc_ipv6_netif_t *iface)
 NDP interface initialization. More...
 
void gnrc_ndp_netif_remove (gnrc_ipv6_netif_t *iface)
 NDP interface removal. More...
 
kernel_pid_t gnrc_ndp_next_hop_l2addr (uint8_t *l2addr, uint8_t *l2addr_len, kernel_pid_t iface, ipv6_addr_t *dst, gnrc_pktsnip_t *pkt)
 Get link-layer address and interface for next hop to destination IPv6 address. More...
 
gnrc_pktsnip_tgnrc_ndp_nbr_sol_build (ipv6_addr_t *tgt, gnrc_pktsnip_t *options)
 Builds a neighbor solicitation message for sending. More...
 
gnrc_pktsnip_tgnrc_ndp_nbr_adv_build (uint8_t flags, ipv6_addr_t *tgt, gnrc_pktsnip_t *options)
 Builds a neighbor advertisement message for sending. More...
 
gnrc_pktsnip_tgnrc_ndp_rtr_sol_build (gnrc_pktsnip_t *options)
 Builds a router solicitation message for sending. More...
 
gnrc_pktsnip_tgnrc_ndp_rtr_adv_build (uint8_t cur_hl, uint8_t flags, uint16_t ltime, uint32_t reach_time, uint32_t retrans_timer, gnrc_pktsnip_t *options)
 Builds a router advertisement message for sending. More...
 
gnrc_pktsnip_tgnrc_ndp_opt_build (uint8_t type, size_t size, gnrc_pktsnip_t *next)
 Builds a generic NDP option. More...
 
gnrc_pktsnip_tgnrc_ndp_opt_sl2a_build (const uint8_t *l2addr, uint8_t l2addr_len, gnrc_pktsnip_t *next)
 Builds the source link-layer address option. More...
 
gnrc_pktsnip_tgnrc_ndp_opt_tl2a_build (const uint8_t *l2addr, uint8_t l2addr_len, gnrc_pktsnip_t *next)
 Builds the target link-layer address option. More...
 
gnrc_pktsnip_tgnrc_ndp_opt_pi_build (uint8_t prefix_len, uint8_t flags, uint32_t valid_ltime, uint32_t pref_ltime, ipv6_addr_t *prefix, gnrc_pktsnip_t *next)
 Builds the prefix information option. More...
 
gnrc_pktsnip_tgnrc_ndp_opt_mtu_build (uint32_t mtu, gnrc_pktsnip_t *next)
 Builds the MTU option. More...