2015-11-15 20:58:39 +01:00
|
|
|
/*
|
|
|
|
* 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.
|
|
|
|
*/
|
|
|
|
|
|
|
|
/**
|
2018-06-01 13:18:00 +02:00
|
|
|
* @defgroup pkg_lwip_opts lwIP options
|
|
|
|
* @ingroup pkg_lwip
|
2015-11-15 20:58:39 +01:00
|
|
|
* @brief Options for the lwIP stack
|
|
|
|
* @{
|
|
|
|
*
|
|
|
|
* @file
|
|
|
|
* @brief Option definitions
|
|
|
|
*
|
|
|
|
* @author Martine Lenders <mlenders@inf.fu-berlin.de>
|
|
|
|
*/
|
2017-05-23 18:19:52 +02:00
|
|
|
#ifndef LWIPOPTS_H
|
|
|
|
#define LWIPOPTS_H
|
2015-11-15 20:58:39 +01:00
|
|
|
|
|
|
|
#include "thread.h"
|
|
|
|
#include "net/gnrc/netif/hdr.h"
|
|
|
|
|
|
|
|
#ifdef __cplusplus
|
|
|
|
extern "C" {
|
|
|
|
#endif
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @brief lwIP configuration macros.
|
|
|
|
* @see lwIP documentation
|
|
|
|
* @{
|
|
|
|
*/
|
2021-11-09 23:09:35 +01:00
|
|
|
#if defined(MODULE_LWIP_ARP) && defined(MODULE_LWIP_ETHERNET)
|
2020-07-27 19:57:49 +02:00
|
|
|
#define LWIP_ARP 1
|
2015-11-15 20:59:19 +01:00
|
|
|
#else /* MODULE_LWIP_ARP */
|
2020-07-27 19:57:49 +02:00
|
|
|
#define LWIP_ARP 0
|
2015-11-15 20:59:19 +01:00
|
|
|
#endif /* MODULE_LWIP_ARP */
|
|
|
|
|
|
|
|
#ifdef MODULE_LWIP_AUTOIP
|
2020-07-27 19:57:49 +02:00
|
|
|
#define LWIP_AUTOIP 1
|
2015-11-15 20:59:19 +01:00
|
|
|
#else /* MODULE_LWIP_AUTOIP */
|
2020-07-27 19:57:49 +02:00
|
|
|
#define LWIP_AUTOIP 0
|
2015-11-15 20:59:19 +01:00
|
|
|
#endif /* MODULE_LWIP_AUTOIP */
|
|
|
|
|
|
|
|
#ifdef MODULE_LWIP_DHCP
|
2020-07-27 19:57:49 +02:00
|
|
|
#define LWIP_DHCP 1
|
2015-11-15 20:59:19 +01:00
|
|
|
#else /* MODULE_LWIP_DHCP */
|
2020-07-27 19:57:49 +02:00
|
|
|
#define LWIP_DHCP 0
|
2015-11-15 20:59:19 +01:00
|
|
|
#endif /* MODULE_LWIP_DHCP */
|
|
|
|
|
|
|
|
#ifdef MODULE_LWIP_ETHERNET
|
2020-07-27 19:57:49 +02:00
|
|
|
#define LWIP_ETHERNET 1
|
2016-06-17 11:46:15 +02:00
|
|
|
#else /* MODULE_LWIP_ETHERNET */
|
2020-07-27 19:57:49 +02:00
|
|
|
#define LWIP_ETHERNET 0
|
2016-06-17 11:46:15 +02:00
|
|
|
#endif /* MODULE_LWIP_ETHERNET */
|
2015-11-15 20:59:19 +01:00
|
|
|
|
2021-02-13 17:35:10 +01:00
|
|
|
#ifdef MODULE_LWIP_NETIF
|
|
|
|
#define LWIP_NETIF_API 1
|
|
|
|
#else /* MODULE_LWIP_NETIF */
|
|
|
|
#define LWIP_NETIF_API 0
|
|
|
|
#endif /* MODULE_LWIP_NETIF */
|
|
|
|
|
2015-11-15 20:59:19 +01:00
|
|
|
#ifdef MODULE_LWIP_IGMP
|
2020-07-27 19:57:49 +02:00
|
|
|
#define LWIP_IGMP 1
|
2015-11-15 20:59:19 +01:00
|
|
|
#else /* MODULE_LWIP_IGMP */
|
2020-07-27 19:57:49 +02:00
|
|
|
#define LWIP_IGMP 0
|
2015-11-15 20:59:19 +01:00
|
|
|
#endif /* MODULE_LWIP_IGMP */
|
|
|
|
|
|
|
|
#ifdef MODULE_LWIP_IPV4
|
2020-07-27 19:57:49 +02:00
|
|
|
#define LWIP_IPV4 1
|
2015-11-15 20:59:19 +01:00
|
|
|
#else /* MODULE_LWIP_IPV4 */
|
2020-07-27 19:57:49 +02:00
|
|
|
#define LWIP_IPV4 0
|
2015-11-15 20:59:19 +01:00
|
|
|
#endif /* MODULE_LWIP_IPV4 */
|
|
|
|
|
|
|
|
#ifdef MODULE_LWIP_IPV6_AUTOCONFIG
|
2020-07-27 19:57:49 +02:00
|
|
|
#define LWIP_IPV6_AUTOCONFIG 1
|
2015-11-15 20:59:19 +01:00
|
|
|
#else /* MODULE_LWIP_IPV6_AUTOCONFIG */
|
2020-07-27 19:57:49 +02:00
|
|
|
#define LWIP_IPV6_AUTOCONFIG 0
|
2015-11-15 20:59:19 +01:00
|
|
|
#endif /* MODULE_LWIP_IPV6_AUTOCONFIG */
|
|
|
|
|
2016-04-28 12:22:42 +02:00
|
|
|
#ifdef MODULE_LWIP_IPV6_MLD
|
2020-07-27 19:57:49 +02:00
|
|
|
#define LWIP_IPV6_MLD 1
|
2016-04-28 12:22:42 +02:00
|
|
|
#else /* MODULE_LWIP_IPV6 */
|
2020-07-27 19:57:49 +02:00
|
|
|
#define LWIP_IPV6_MLD 0
|
2016-04-28 12:22:42 +02:00
|
|
|
#endif /* MODULE_LWIP_IPV6 */
|
|
|
|
|
2015-11-15 20:59:19 +01:00
|
|
|
#ifdef MODULE_LWIP_IPV6
|
2020-07-27 19:57:49 +02:00
|
|
|
#define LWIP_IPV6 1
|
2015-11-15 20:59:19 +01:00
|
|
|
#else /* MODULE_LWIP_IPV6 */
|
2020-07-27 19:57:49 +02:00
|
|
|
#define LWIP_IPV6 0
|
2015-11-15 20:59:19 +01:00
|
|
|
#endif /* MODULE_LWIP_IPV6 */
|
|
|
|
|
|
|
|
#ifdef MODULE_LWIP_NETIF_PPP
|
2020-07-27 19:57:49 +02:00
|
|
|
#define PPP_SUPPORT 1
|
2015-11-15 20:59:19 +01:00
|
|
|
#else /* MODULE_LWIP_NETIF_PPP */
|
2020-07-27 19:57:49 +02:00
|
|
|
#define PPP_SUPPORT 0
|
2015-11-15 20:59:19 +01:00
|
|
|
#endif /* MODULE_LWIP_NETIF_PPP */
|
|
|
|
|
|
|
|
#ifdef MODULE_LWIP_RAW
|
2020-07-27 19:57:49 +02:00
|
|
|
#define LWIP_RAW 1
|
2015-11-15 20:59:19 +01:00
|
|
|
#else /* MODULE_LWIP_RAW */
|
2020-07-27 19:57:49 +02:00
|
|
|
#define LWIP_RAW 0
|
2015-11-15 20:59:19 +01:00
|
|
|
#endif /* MODULE_LWIP_RAW */
|
|
|
|
|
|
|
|
#ifdef MODULE_LWIP_SIXLOWPAN
|
2020-07-27 19:57:49 +02:00
|
|
|
#define LWIP_6LOWPAN 1
|
2015-11-15 20:59:19 +01:00
|
|
|
#else /* MODULE_LWIP_STATS */
|
2020-07-27 19:57:49 +02:00
|
|
|
#define LWIP_6LOWPAN 0
|
2015-11-15 20:59:19 +01:00
|
|
|
#endif /* MODULE_LWIP_STATS */
|
|
|
|
|
|
|
|
#ifdef MODULE_LWIP_STATS
|
2020-07-27 19:57:49 +02:00
|
|
|
#define LWIP_STATS 1
|
2015-11-15 20:59:19 +01:00
|
|
|
#else /* MODULE_LWIP_STATS */
|
2020-07-27 19:57:49 +02:00
|
|
|
#define LWIP_STATS 0
|
2015-11-15 20:59:19 +01:00
|
|
|
#endif /* MODULE_LWIP_STATS */
|
|
|
|
|
|
|
|
#ifdef MODULE_LWIP_TCP
|
2020-07-27 19:57:49 +02:00
|
|
|
#define LWIP_TCP 1
|
2015-11-15 20:59:19 +01:00
|
|
|
#else /* MODULE_LWIP_TCP */
|
2020-07-27 19:57:49 +02:00
|
|
|
#define LWIP_TCP 0
|
2015-11-15 20:59:19 +01:00
|
|
|
#endif /* MODULE_LWIP_TCP */
|
|
|
|
|
|
|
|
#ifdef MODULE_LWIP_UDP
|
2020-07-27 19:57:49 +02:00
|
|
|
#define LWIP_UDP 1
|
2015-11-15 20:59:19 +01:00
|
|
|
#else /* MODULE_LWIP_UDP */
|
2020-07-27 19:57:49 +02:00
|
|
|
#define LWIP_UDP 0
|
2015-11-15 20:59:19 +01:00
|
|
|
#endif /* MODULE_LWIP_UDP */
|
|
|
|
|
|
|
|
#ifdef MODULE_LWIP_UDPLITE
|
2020-07-27 19:57:49 +02:00
|
|
|
#define LWIP_UDPLITE 1
|
2015-11-15 20:59:19 +01:00
|
|
|
#else /* MODULE_LWIP_UDPLITE */
|
2020-07-27 19:57:49 +02:00
|
|
|
#define LWIP_UDPLITE 0
|
2015-11-15 20:59:19 +01:00
|
|
|
#endif /* MODULE_LWIP_UDPLITE */
|
|
|
|
|
2020-07-27 21:47:37 +02:00
|
|
|
#if IS_USED(MODULE_LWIP_SOCK)
|
2020-07-27 19:57:49 +02:00
|
|
|
#define LWIP_NETCONN 1
|
2020-07-27 21:47:37 +02:00
|
|
|
#if IS_USED(MODULE_SOCK_AUX_LOCAL)
|
|
|
|
#define LWIP_NETBUF_RECVINFO 1
|
|
|
|
#endif /* MODULE_SOCK_AUX_LOCAL */
|
2015-11-15 20:59:19 +01:00
|
|
|
#else
|
2020-07-27 19:57:49 +02:00
|
|
|
#define LWIP_NETCONN 0
|
2020-07-27 21:47:37 +02:00
|
|
|
#endif /* MODULE_LWIP_SOCK */
|
|
|
|
|
2022-09-21 09:36:17 +02:00
|
|
|
#ifdef MODULE_SHELL_CMD_LWIP_NETIF
|
2021-02-08 22:35:20 +01:00
|
|
|
#define LWIP_DEBUG 1
|
|
|
|
#endif
|
2015-11-15 20:59:19 +01:00
|
|
|
|
2020-02-21 20:12:22 +01:00
|
|
|
#ifndef TCP_LISTEN_BACKLOG
|
|
|
|
# if defined(MODULE_LWIP_SOCK_TCP)
|
2020-07-27 19:57:49 +02:00
|
|
|
# define TCP_LISTEN_BACKLOG 1
|
2020-02-21 20:12:22 +01:00
|
|
|
# else
|
2020-07-27 19:57:49 +02:00
|
|
|
# define TCP_LISTEN_BACKLOG 0
|
2020-02-21 20:12:22 +01:00
|
|
|
# endif
|
|
|
|
#endif /* TCP_LISTEN_BACKLOG */
|
|
|
|
|
2020-07-27 19:57:49 +02:00
|
|
|
#define LWIP_SOCKET 0
|
2017-05-10 20:50:28 +02:00
|
|
|
|
|
|
|
#define LWIP_DONT_PROVIDE_BYTEORDER_FUNCTIONS
|
2020-07-27 19:57:49 +02:00
|
|
|
#define MEMP_MEM_MALLOC 1
|
2015-11-15 20:58:39 +01:00
|
|
|
#define NETIF_MAX_HWADDR_LEN (GNRC_NETIF_HDR_L2ADDR_MAX_LEN)
|
|
|
|
|
2019-12-14 10:39:14 +01:00
|
|
|
#ifndef TCPIP_THREAD_STACKSIZE
|
2015-11-15 20:58:39 +01:00
|
|
|
#define TCPIP_THREAD_STACKSIZE (THREAD_STACKSIZE_DEFAULT)
|
2019-12-14 10:39:14 +01:00
|
|
|
#endif
|
2015-11-15 20:58:39 +01:00
|
|
|
|
2020-07-27 19:57:49 +02:00
|
|
|
#define MEM_ALIGNMENT 4
|
2015-11-15 20:58:39 +01:00
|
|
|
#ifndef MEM_SIZE
|
|
|
|
/* packet buffer size of GNRC + stack for TCP/IP */
|
|
|
|
#define MEM_SIZE (TCPIP_THREAD_STACKSIZE + 6144)
|
|
|
|
#endif
|
|
|
|
|
2021-03-28 17:17:24 +02:00
|
|
|
#ifdef DEVELHELP
|
|
|
|
void sys_mark_tcpip_thread(void);
|
|
|
|
#define LWIP_MARK_TCPIP_THREAD sys_mark_tcpip_thread
|
|
|
|
|
|
|
|
bool sys_check_core_locked(void);
|
|
|
|
#define LWIP_ASSERT_CORE_LOCKED() \
|
|
|
|
LWIP_ASSERT("Core lock held", sys_check_core_locked())
|
|
|
|
#endif
|
|
|
|
|
2015-11-15 20:58:39 +01:00
|
|
|
/** @} */
|
|
|
|
|
|
|
|
#ifdef __cplusplus
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
2017-05-23 18:19:52 +02:00
|
|
|
#endif /* LWIPOPTS_H */
|
2015-11-15 20:58:39 +01:00
|
|
|
/** @} */
|