Blame view

RIOT/sys/include/net/gnrc/ndp/router.h 2.51 KB
a752c7ab   elopes   add first test an...
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
  /*
   * Copyright (C) 2015 Martine Lenders <mlenders@inf.fu-berlin.de>
   *
   * This file is subject to the terms and conditions of the GNU Lesser
   * General Public License v2.1. See the file LICENSE in the top level
   * directory for more details.
   */
  
  /**
   * @defgroup    net_gnrc_ndp_router Router-specific part of router discovery.
   * @ingroup     net_gnrc_ndp
   * @brief       Router-specific part for the router discovery in IPv6
   *              neighbor discovery.
   * @{
   *
   * @file
   * @brief   Router-specific router discovery definitions
   *
   * @author  Martine Lenders <mlenders@inf.fu-berlin.de>
   */
  #ifndef NET_GNRC_NDP_ROUTER_H
  #define NET_GNRC_NDP_ROUTER_H
  
  #include <stdbool.h>
  
  #include "kernel_types.h"
  #include "net/ipv6/hdr.h"
  #include "net/ndp.h"
  #include "net/gnrc/ipv6/nc.h"
  #include "timex.h"
  
  #ifdef __cplusplus
  extern "C" {
  #endif
  
  /**
   * @brief   Set @p iface to router mode.
   *
   * @details This sets/unsets the GNRC_IPV6_NETIF_FLAGS_ROUTER and
   *          GNRC_IPV6_NETIF_FLAGS_RTR_ADV and initializes or ceases router
   *          behavior for neighbor discovery.
   *
   * @param[in] iface     An IPv6 interface. Must not be NULL.
   * @param[in] enable    Status for the GNRC_IPV6_NETIF_FLAGS_ROUTER and
   *                      GNRC_IPV6_NETIF_FLAGS_RTR_ADV flags.
   */
  void gnrc_ndp_router_set_router(gnrc_ipv6_netif_t *iface, bool enable);
  
  /**
   * @brief   Set/Unset GNRC_IPV6_NETIF_FLAGS_RTR_ADV flag for @p iface.
   *
   * @see <a href="https://tools.ietf.org/html/rfc4861#section-6.2.2">
   *          RFC 4861, section 6.2.2
   *      </a>
   * @see <a href="https://tools.ietf.org/html/rfc4861#section-6.2.5">
   *          RFC 4861, section 6.2.5
   *      </a>
   *
   * @details GNRC_IPV6_NETIF_FLAGS_RTR_ADV and initializes or ceases
   *          periodic router advertising behavior for neighbor discovery.
   *
   * @param[in] iface     An IPv6 interface. Must not be NULL.
   * @param[in] enable    Status for the GNRC_IPV6_NETIF_FLAGS_RTR_ADV flags.
   */
  void gnrc_ndp_router_set_rtr_adv(gnrc_ipv6_netif_t *iface, bool enable);
  
  /**
   * @brief   Send an unsolicited router advertisement over @p iface
   *          and reset the timer for the next one if necessary.
   *
   * @param[in] iface An IPv6 interface.
   */
  void gnrc_ndp_router_retrans_rtr_adv(gnrc_ipv6_netif_t *iface);
  
  /**
   * @brief   Send an solicited router advertisement to IPv6 address of
   *          @p neighbor.
   *
   * @param[in] neighbor  A neighbor cache entry.
   */
  void gnrc_ndp_router_send_rtr_adv(gnrc_ipv6_nc_t *neighbor);
  
  #ifdef __cplusplus
  }
  #endif
  
  #endif /* NET_GNRC_NDP_ROUTER_H */
  /** @} */