2017-05-16 13:23:54 +02:00
|
|
|
/*
|
|
|
|
* 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.
|
|
|
|
*/
|
|
|
|
|
|
|
|
/**
|
2018-12-14 15:12:13 +01:00
|
|
|
* @defgroup net_gnrc_netif_conf GNRC network interface configurations
|
|
|
|
* @ingroup net_gnrc_netif
|
2019-12-06 12:23:34 +01:00
|
|
|
* @ingroup net_gnrc_conf
|
2017-05-16 13:23:54 +02:00
|
|
|
* @{
|
|
|
|
*
|
|
|
|
* @file
|
2017-11-16 18:06:46 +01:00
|
|
|
* @brief Configuration macros for @ref net_gnrc_netif
|
2017-05-16 13:23:54 +02:00
|
|
|
*
|
|
|
|
* @author Martine Lenders <mlenders@inf.fu-berlin.de>
|
|
|
|
*/
|
2017-11-16 18:06:46 +01:00
|
|
|
#ifndef NET_GNRC_NETIF_CONF_H
|
|
|
|
#define NET_GNRC_NETIF_CONF_H
|
2017-05-16 13:23:54 +02:00
|
|
|
|
2020-03-12 13:50:13 +01:00
|
|
|
#include <kernel_defines.h>
|
|
|
|
|
2017-05-16 13:23:54 +02:00
|
|
|
#include "net/ieee802154.h"
|
|
|
|
#include "net/ethernet/hdr.h"
|
2017-07-31 17:51:20 +02:00
|
|
|
#include "net/gnrc/ipv6/nib/conf.h"
|
2017-05-16 13:23:54 +02:00
|
|
|
#include "thread.h"
|
|
|
|
|
|
|
|
#ifdef __cplusplus
|
|
|
|
extern "C" {
|
|
|
|
#endif
|
|
|
|
|
2020-03-17 12:32:34 +01:00
|
|
|
/**
|
|
|
|
* @brief Single interface optimizations
|
|
|
|
*
|
|
|
|
* Define to 1 to allow GNRC optimizations when only one interface
|
|
|
|
* is available.
|
|
|
|
*
|
|
|
|
* @note This MUST NOT be enabled if there's more than one interface.
|
|
|
|
*/
|
|
|
|
#if DOXYGEN
|
|
|
|
#define GNRC_NETIF_SINGLE
|
|
|
|
#endif
|
|
|
|
|
2017-05-16 13:23:54 +02:00
|
|
|
/**
|
|
|
|
* @brief Default priority for network interface threads
|
|
|
|
*/
|
2017-11-16 18:06:46 +01:00
|
|
|
#ifndef GNRC_NETIF_PRIO
|
|
|
|
#define GNRC_NETIF_PRIO (THREAD_PRIORITY_MAIN - 5)
|
2017-05-16 13:23:54 +02:00
|
|
|
#endif
|
|
|
|
|
2019-02-26 11:29:19 +01:00
|
|
|
/**
|
|
|
|
* @brief Message queue size for network interface threads
|
|
|
|
*
|
|
|
|
* @attention This has influence on the used stack memory of the thread, so
|
|
|
|
* the thread's stack size might need to be adapted if this is
|
|
|
|
* changed.
|
|
|
|
*/
|
2020-01-08 11:00:16 +01:00
|
|
|
#ifndef CONFIG_GNRC_NETIF_MSG_QUEUE_SIZE
|
|
|
|
#define CONFIG_GNRC_NETIF_MSG_QUEUE_SIZE (16U)
|
2019-02-26 11:29:19 +01:00
|
|
|
#endif
|
|
|
|
|
2017-05-16 13:23:54 +02:00
|
|
|
/**
|
|
|
|
* @brief Number of multicast addresses needed for @ref net_gnrc_rpl "RPL".
|
|
|
|
*
|
2017-11-16 18:06:46 +01:00
|
|
|
* @note Used for calculation of @ref GNRC_NETIF_IPV6_GROUPS_NUMOF
|
2017-05-16 13:23:54 +02:00
|
|
|
*/
|
|
|
|
#ifdef MODULE_GNRC_RPL
|
2017-11-16 18:06:46 +01:00
|
|
|
#define GNRC_NETIF_RPL_ADDR (1)
|
2017-05-16 13:23:54 +02:00
|
|
|
#else
|
2017-11-16 18:06:46 +01:00
|
|
|
#define GNRC_NETIF_RPL_ADDR (0)
|
2017-05-16 13:23:54 +02:00
|
|
|
#endif
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @brief Number of multicast addresses needed for a @ref net_gnrc_ipv6 "IPv6"
|
|
|
|
* router
|
|
|
|
*
|
2017-11-16 18:06:46 +01:00
|
|
|
* @note Used for calculation of @ref GNRC_NETIF_IPV6_GROUPS_NUMOF
|
2017-05-16 13:23:54 +02:00
|
|
|
*/
|
2020-03-12 13:50:13 +01:00
|
|
|
#if IS_ACTIVE(CONFIG_GNRC_IPV6_NIB_ROUTER)
|
2017-11-16 18:06:46 +01:00
|
|
|
#define GNRC_NETIF_IPV6_RTR_ADDR (1)
|
2017-05-16 13:23:54 +02:00
|
|
|
#else
|
2017-11-16 18:06:46 +01:00
|
|
|
#define GNRC_NETIF_IPV6_RTR_ADDR (0)
|
2017-05-16 13:23:54 +02:00
|
|
|
#endif
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @brief Maximum number of unicast and anycast addresses per interface
|
|
|
|
*
|
2018-05-29 15:50:48 +02:00
|
|
|
* @note If you change this, please make sure that
|
|
|
|
* @ref GNRC_NETIF_IPV6_GROUPS_NUMOF is also large enough to fit the
|
|
|
|
* addresses' solicited nodes multicast addresses.
|
|
|
|
*
|
2018-06-07 10:14:52 +02:00
|
|
|
* Default: 2 (1 link-local + 1 global address)
|
2017-05-16 13:23:54 +02:00
|
|
|
*/
|
2020-01-08 11:05:46 +01:00
|
|
|
#ifndef CONFIG_GNRC_NETIF_IPV6_ADDRS_NUMOF
|
|
|
|
#define CONFIG_GNRC_NETIF_IPV6_ADDRS_NUMOF (2)
|
2017-05-16 13:23:54 +02:00
|
|
|
#endif
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @brief Maximum number of multicast groups per interface
|
|
|
|
*
|
2018-06-07 10:14:52 +02:00
|
|
|
* Default: 3 (all-nodes + solicited-nodes of link-local and global unicast
|
2017-11-16 18:06:46 +01:00
|
|
|
* address) + @ref GNRC_NETIF_RPL_ADDR + @ref GNRC_NETIF_IPV6_RTR_ADDR
|
2017-05-16 13:23:54 +02:00
|
|
|
*/
|
2017-11-16 18:06:46 +01:00
|
|
|
#ifndef GNRC_NETIF_IPV6_GROUPS_NUMOF
|
2020-01-08 11:05:46 +01:00
|
|
|
#define GNRC_NETIF_IPV6_GROUPS_NUMOF (CONFIG_GNRC_NETIF_IPV6_ADDRS_NUMOF + \
|
2018-06-07 10:14:52 +02:00
|
|
|
GNRC_NETIF_RPL_ADDR + \
|
|
|
|
GNRC_NETIF_IPV6_RTR_ADDR + 1)
|
2017-05-16 13:23:54 +02:00
|
|
|
#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
|
|
|
|
*/
|
2017-11-16 18:06:46 +01:00
|
|
|
#ifndef GNRC_NETIF_L2ADDR_MAXLEN
|
2017-05-16 13:23:54 +02:00
|
|
|
#if defined(MODULE_NETDEV_IEEE802154) || defined(MODULE_XBEE)
|
2017-11-16 18:06:46 +01:00
|
|
|
#define GNRC_NETIF_L2ADDR_MAXLEN (IEEE802154_LONG_ADDRESS_LEN)
|
2017-05-16 13:23:54 +02:00
|
|
|
#elif MODULE_NETDEV_ETH
|
2017-11-16 18:06:46 +01:00
|
|
|
#define GNRC_NETIF_L2ADDR_MAXLEN (ETHERNET_ADDR_LEN)
|
2017-05-16 13:23:54 +02:00
|
|
|
#elif MODULE_CC110X
|
2017-11-16 18:06:46 +01:00
|
|
|
#define GNRC_NETIF_L2ADDR_MAXLEN (1U)
|
2017-05-16 13:23:54 +02:00
|
|
|
#else
|
2020-03-12 17:20:38 +01:00
|
|
|
#define GNRC_NETIF_L2ADDR_MAXLEN (CONFIG_GNRC_IPV6_NIB_L2ADDR_MAX_LEN)
|
2017-05-16 13:23:54 +02:00
|
|
|
#endif
|
|
|
|
#endif
|
|
|
|
|
2020-01-08 10:57:19 +01:00
|
|
|
#ifndef CONFIG_GNRC_NETIF_DEFAULT_HL
|
|
|
|
#define CONFIG_GNRC_NETIF_DEFAULT_HL (64U) /**< default hop limit */
|
2017-05-16 13:23:54 +02:00
|
|
|
#endif
|
|
|
|
|
2019-04-25 10:28:39 +02:00
|
|
|
/**
|
|
|
|
* @brief Minimum wait time in microseconds after a send operation
|
|
|
|
*
|
|
|
|
* @experimental
|
|
|
|
*
|
|
|
|
* This is purely meant as a debugging feature to slow down a radios sending.
|
|
|
|
*/
|
2020-01-09 17:34:07 +01:00
|
|
|
#ifndef CONFIG_GNRC_NETIF_MIN_WAIT_AFTER_SEND_US
|
|
|
|
#define CONFIG_GNRC_NETIF_MIN_WAIT_AFTER_SEND_US (0U)
|
2019-04-25 10:28:39 +02:00
|
|
|
#endif
|
|
|
|
|
2020-06-06 16:18:31 +02:00
|
|
|
/**
|
|
|
|
* @brief Enable the usage of non standard MTU for 6LoWPAN network interfaces
|
|
|
|
*
|
|
|
|
* @experimental
|
|
|
|
*
|
|
|
|
* This feature is non compliant with RFC 4944 and might not be supported by
|
|
|
|
* other implementations.
|
|
|
|
*/
|
|
|
|
#ifndef CONFIG_GNRC_NETIF_NONSTANDARD_6LO_MTU
|
|
|
|
#define CONFIG_GNRC_NETIF_NONSTANDARD_6LO_MTU 0
|
|
|
|
#endif
|
|
|
|
|
2017-05-16 13:23:54 +02:00
|
|
|
#ifdef __cplusplus
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
2017-11-16 18:06:46 +01:00
|
|
|
#endif /* NET_GNRC_NETIF_CONF_H */
|
2017-05-16 13:23:54 +02:00
|
|
|
/** @} */
|