ndp.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 
20 #include <stdint.h>
21 
22 #include "net/gnrc/pkt.h"
23 #include "net/gnrc/netif.h"
24 #include "net/ipv6/addr.h"
25 #include "net/ipv6/hdr.h"
26 
27 #ifdef __cplusplus
28 extern "C" {
29 #endif
30 
34 #ifndef GNRC_NETTYPE_NDP
35 # if defined(MODULE_GNRC_IPV6) || DOXYGEN
36 # define GNRC_NETTYPE_NDP (GNRC_NETTYPE_IPV6) /* usual configuration */
37 # else
38 # define GNRC_NETTYPE_NDP (GNRC_NETTYPE_UNDEF) /* for testing */
39 # endif
40 #endif /* GNRC_NETTYPE_NDP */
41 
58  gnrc_pktsnip_t *options);
59 
88  gnrc_pktsnip_t *options);
89 
102 
130 gnrc_pktsnip_t *gnrc_ndp_rtr_adv_build(uint8_t cur_hl, uint8_t flags,
131  uint16_t ltime, uint32_t reach_time,
132  uint32_t retrans_timer,
133  gnrc_pktsnip_t *options);
134 
146 gnrc_pktsnip_t *gnrc_ndp_opt_build(uint8_t type, size_t size,
147  gnrc_pktsnip_t *next);
148 
169  uint8_t l2addr_len,
170  gnrc_pktsnip_t *next);
171 
192  uint8_t l2addr_len,
193  gnrc_pktsnip_t *next);
194 
229  uint8_t prefix_len,
230  uint32_t valid_ltime, uint32_t pref_ltime,
231  uint8_t flags, gnrc_pktsnip_t *next);
258  uint8_t prefix_len,
259  uint32_t route_ltime,
260  uint8_t flags, gnrc_pktsnip_t *next);
261 
277 
298  unsigned addrs_num,
299  gnrc_pktsnip_t *next);
300 
322  const ipv6_addr_t *src, const ipv6_addr_t *dst,
323  gnrc_pktsnip_t *ext_opts);
324 
368  const ipv6_addr_t *dst, bool supply_tl2a,
369  gnrc_pktsnip_t *ext_opts);
370 
381 
408  const ipv6_addr_t *dst, bool fin,
409  gnrc_pktsnip_t *ext_opts);
410 
411 #ifdef __cplusplus
412 }
413 #endif
414 
Definition for GNRC's network interfaces.
gnrc_pktsnip_t * gnrc_ndp_opt_rdnss_build(uint32_t lifetime, ipv6_addr_t *addrs, unsigned addrs_num, gnrc_pktsnip_t *next)
Builts the recursive DNS server option.
gnrc_pktsnip_t * gnrc_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.
void gnrc_ndp_nbr_sol_send(const ipv6_addr_t *tgt, gnrc_netif_t *netif, const ipv6_addr_t *src, const ipv6_addr_t *dst, gnrc_pktsnip_t *ext_opts)
Send pre-compiled neighbor solicitation depending on a given network interface.
gnrc_pktsnip_t * gnrc_ndp_opt_sl2a_build(const uint8_t *l2addr, uint8_t l2addr_len, gnrc_pktsnip_t *next)
Builds the source link-layer address option.
gnrc_pktsnip_t * gnrc_ndp_rtr_sol_build(gnrc_pktsnip_t *options)
Builds a router solicitation message for sending.
gnrc_pktsnip_t * gnrc_ndp_opt_mtu_build(uint32_t mtu, gnrc_pktsnip_t *next)
Builds the MTU option.
void gnrc_ndp_rtr_sol_send(gnrc_netif_t *netif, const ipv6_addr_t *dst)
Send pre-compiled router solicitation depending on a given network interface.
gnrc_pktsnip_t * gnrc_ndp_nbr_sol_build(const ipv6_addr_t *tgt, gnrc_pktsnip_t *options)
Builds a neighbor solicitation message for sending.
gnrc_pktsnip_t * gnrc_ndp_opt_build(uint8_t type, size_t size, gnrc_pktsnip_t *next)
Builds a generic NDP option.
void gnrc_ndp_rtr_adv_send(gnrc_netif_t *netif, const ipv6_addr_t *src, const ipv6_addr_t *dst, bool fin, gnrc_pktsnip_t *ext_opts)
Send pre-compiled router advertisement depending on a given network interface.
gnrc_pktsnip_t * gnrc_ndp_opt_tl2a_build(const uint8_t *l2addr, uint8_t l2addr_len, gnrc_pktsnip_t *next)
Builds the target link-layer address option.
void gnrc_ndp_nbr_adv_send(const ipv6_addr_t *tgt, gnrc_netif_t *netif, const ipv6_addr_t *dst, bool supply_tl2a, gnrc_pktsnip_t *ext_opts)
Send pre-compiled neighbor advertisement depending on a given network interface.
gnrc_pktsnip_t * gnrc_ndp_opt_ri_build(const ipv6_addr_t *prefix, uint8_t prefix_len, uint32_t route_ltime, uint8_t flags, gnrc_pktsnip_t *next)
Builds the route information option.
gnrc_pktsnip_t * gnrc_ndp_opt_pi_build(const ipv6_addr_t *prefix, uint8_t prefix_len, uint32_t valid_ltime, uint32_t pref_ltime, uint8_t flags, gnrc_pktsnip_t *next)
Builds the prefix information option.
gnrc_pktsnip_t * gnrc_ndp_nbr_adv_build(const ipv6_addr_t *tgt, uint8_t flags, gnrc_pktsnip_t *options)
Builds a neighbor advertisement message for sending.
Definitions for IPv6 addresses.
General definitions for network packets and their helper functions.
IPv6 header type and helper function definitions.
Representation of a network interface.
Definition: netif.h:129
Type to represent parts (either headers or payload) of a packet, called snips.
Definition: pkt.h:105
Data type to represent an IPv6 address.
Definition: addr.h:64