Blame view

RIOT/sys/include/net/gnrc/netif2/conf.h 3.32 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
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
  /*
   * Copyright (C) 2017 Freie Universitรคt Berlin
   *
   * 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.
   */
  
  /**
   * @ingroup net_gnrc_netif2
   * @{
   *
   * @file
   * @brief   Configuration macros for @ref net_gnrc_netif2
   *
   * @author  Martine Lenders <mlenders@inf.fu-berlin.de>
   */
  #ifndef NET_GNRC_NETIF2_CONF_H
  #define NET_GNRC_NETIF2_CONF_H
  
  #include "net/ieee802154.h"
  #include "net/ethernet/hdr.h"
  #include "thread.h"
  
  #ifdef __cplusplus
  extern "C" {
  #endif
  
  /**
   * @brief   Maximum number of network interfaces
   *
   * @note    Intentionally not calling it `GNRC_NETIF2_NUMOF` to not require
   *          rewrites throughout the stack.
   */
  #ifndef GNRC_NETIF_NUMOF
  #define GNRC_NETIF_NUMOF            (1)
  #endif
  
  /**
   * @brief   Default priority for network interface threads
   */
  #ifndef GNRC_NETIF2_PRIO
  #define GNRC_NETIF2_PRIO            (THREAD_PRIORITY_MAIN - 5)
  #endif
  
  /**
   * @brief   Number of multicast addresses needed for @ref net_gnrc_rpl "RPL".
   *
   * @note    Used for calculation of @ref GNRC_NETIF2_IPV6_GROUPS_NUMOF
   */
  #ifdef MODULE_GNRC_RPL
  #define GNRC_NETIF2_RPL_ADDR        (1)
  #else
  #define GNRC_NETIF2_RPL_ADDR        (0)
  #endif
  
  /**
   * @brief   Number of multicast addresses needed for a @ref net_gnrc_ipv6 "IPv6"
   *          router
   *
   * @note    Used for calculation of @ref GNRC_NETIF2_IPV6_GROUPS_NUMOF
   */
  #ifdef MODULE_GNRC_IPV6_ROUTER
  #define GNRC_NETIF2_IPV6_RTR_ADDR   (1)
  #else
  #define GNRC_NETIF2_IPV6_RTR_ADDR   (0)
  #endif
  
  /**
   * @brief   Maximum number of unicast and anycast addresses per interface
   *
   * Default: 2 (link-local + corresponding global address)
   */
  #ifndef GNRC_NETIF2_IPV6_ADDRS_NUMOF
  #define GNRC_NETIF2_IPV6_ADDRS_NUMOF    (2)
  #endif
  
  /**
   * @brief   Maximum number of multicast groups per interface
   *
   * Default: 2 (all-nodes + solicited-nodes of link-local and global unicast
   * address) + @ref GNRC_NETIF2_RPL_ADDR + @ref GNRC_NETIF2_IPV6_RTR_ADDR
   */
  #ifndef GNRC_NETIF2_IPV6_GROUPS_NUMOF
  #define GNRC_NETIF2_IPV6_GROUPS_NUMOF   (2 + GNRC_NETIF2_RPL_ADDR + GNRC_NETIF2_IPV6_RTR_ADDR)
  #endif
  
  /**
   * @brief   Maximum length of the link-layer address.
   *
   * The value for the maximum length of a link-layer address is dependent
   * on the @ref drivers_netdev_api "netdev" adapters compiled in:
   *  - Setting it via `CFLAGS` has the most precedence.
   *  - The default is 8.
   *  - 1, if only @ref drivers_cc110x devices are compiled in.
   *  - @ref ETHERNET_ADDR_LEN, if additionally (or only) ethernet devices are
   *    compiled in.
   *  - @ref IEEE802154_LONG_ADDRESS_LEN, if additionally (or only) IEEE802.15.4
   *    devices are compiled in.
   *
   * @note Implementers note: From longest to shortest extend, if new link-layer
   *       address types are included
   */
  #ifndef GNRC_NETIF2_L2ADDR_MAXLEN
  #if defined(MODULE_NETDEV_IEEE802154) || defined(MODULE_XBEE)
  #define GNRC_NETIF2_L2ADDR_MAXLEN   (IEEE802154_LONG_ADDRESS_LEN)
  #elif   MODULE_NETDEV_ETH
  #define GNRC_NETIF2_L2ADDR_MAXLEN   (ETHERNET_ADDR_LEN)
  #elif   MODULE_CC110X
  #define GNRC_NETIF2_L2ADDR_MAXLEN   (1U)
  #else
  #define GNRC_NETIF2_L2ADDR_MAXLEN   (8U)
  #endif
  #endif
  
  #ifndef GNRC_NETIF2_DEFAULT_HL
  #define GNRC_NETIF2_DEFAULT_HL      (64U)   /**< default hop limit */
  #endif
  
  #ifdef __cplusplus
  }
  #endif
  
  #endif /* NET_GNRC_NETIF2_CONF_H */
  /** @} */