gnrc/ndp.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 
20 #ifndef NET_GNRC_NDP_H
21 #define NET_GNRC_NDP_H
22 
23 #include <stdint.h>
24 
25 #include "kernel_types.h"
26 #include "net/gnrc/pkt.h"
27 #include "net/gnrc/netif.h"
28 #include "net/ipv6/addr.h"
29 #include "net/ipv6/hdr.h"
30 
31 #ifdef __cplusplus
32 extern "C" {
33 #endif
34 
38 #ifndef GNRC_NETTYPE_NDP
39 # if defined(MODULE_GNRC_IPV6) || DOXYGEN
40 # define GNRC_NETTYPE_NDP (GNRC_NETTYPE_IPV6) /* usual configuration */
41 # else
42 # define GNRC_NETTYPE_NDP (GNRC_NETTYPE_UNDEF) /* for testing */
43 # endif
44 #endif /* GNRC_NETTYPE_NDP */
45 
62  gnrc_pktsnip_t *options);
63 
91 gnrc_pktsnip_t *gnrc_ndp_nbr_adv_build(const ipv6_addr_t *tgt, uint8_t flags,
92  gnrc_pktsnip_t *options);
93 
106 
134 gnrc_pktsnip_t *gnrc_ndp_rtr_adv_build(uint8_t cur_hl, uint8_t flags,
135  uint16_t ltime, uint32_t reach_time,
136  uint32_t retrans_timer,
137  gnrc_pktsnip_t *options);
138 
150 gnrc_pktsnip_t *gnrc_ndp_opt_build(uint8_t type, size_t size,
151  gnrc_pktsnip_t *next);
152 
172 gnrc_pktsnip_t *gnrc_ndp_opt_sl2a_build(const uint8_t *l2addr,
173  uint8_t l2addr_len,
174  gnrc_pktsnip_t *next);
175 
195 gnrc_pktsnip_t *gnrc_ndp_opt_tl2a_build(const uint8_t *l2addr,
196  uint8_t l2addr_len,
197  gnrc_pktsnip_t *next);
198 
233  uint8_t prefix_len,
234  uint32_t valid_ltime, uint32_t pref_ltime,
235  uint8_t flags, gnrc_pktsnip_t *next);
236 
252 
273 void gnrc_ndp_nbr_sol_send(const ipv6_addr_t *tgt, gnrc_netif_t *netif,
274  const ipv6_addr_t *src, const ipv6_addr_t *dst,
275  gnrc_pktsnip_t *ext_opts);
276 
319 void gnrc_ndp_nbr_adv_send(const ipv6_addr_t *tgt, gnrc_netif_t *netif,
320  const ipv6_addr_t *dst, bool supply_tl2a,
321  gnrc_pktsnip_t *ext_opts);
322 
332 void gnrc_ndp_rtr_sol_send(gnrc_netif_t *netif, const ipv6_addr_t *dst);
333 
359 void gnrc_ndp_rtr_adv_send(gnrc_netif_t *netif, const ipv6_addr_t *src,
360  const ipv6_addr_t *dst, bool fin,
361  gnrc_pktsnip_t *ext_opts);
362 
363 #ifdef __cplusplus
364 }
365 #endif
366 
367 #endif /* NET_GNRC_NDP_H */
368 
Types used by the kernel.
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.
Definitions for IPv6 addresses.
General definitions for network packets and their helper functions.
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.
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_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.
IPv6 header type and helper function definitions.
Definition for GNRC&#39;s network interfaces.
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_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_opt_tl2a_build(const uint8_t *l2addr, uint8_t l2addr_len, gnrc_pktsnip_t *next)
Builds the target link-layer address option.
Representation of a network interface.
Definition: netif.h:61
gnrc_pktsnip_t * gnrc_ndp_opt_mtu_build(uint32_t mtu, gnrc_pktsnip_t *next)
Builds the MTU option.
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.
Type to represent parts (either headers or payload) of a packet, called snips.
gnrc_pktsnip_t * gnrc_ndp_nbr_sol_build(const ipv6_addr_t *tgt, gnrc_pktsnip_t *options)
Builds a neighbor solicitation message for sending.
Data type to represent an IPv6 address.
Definition: ipv6/addr.h:74
gnrc_pktsnip_t * gnrc_ndp_opt_build(uint8_t type, size_t size, gnrc_pktsnip_t *next)
Builds a generic NDP 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.
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.