Microchip® Advanced Software Framework

lwipopts.h File Reference

LwIP configuration.

Copyright (c) 2018 Microchip Technology Inc. and its subsidiaries.

#include "compiler.h"
#include "FreeRTOS.h"

Macros

#define API_LIB_DEBUG   LWIP_DBG_OFF
 
#define API_MSG_DEBUG   LWIP_DBG_OFF
 
#define AUTOIP_DEBUG   LWIP_DBG_OFF
 
#define DEFAULT_ACCEPTMBOX_SIZE   6
 DEFAULT_ACCEPTMBOX_SIZE: The mailbox size for the incoming connections. More...
 
#define DEFAULT_RAW_RECVMBOX_SIZE   6
 DEFAULT_RAW_RECVMBOX_SIZE: The mailbox size for the incoming packets on a NETCONN_RAW. More...
 
#define DEFAULT_TCP_RECVMBOX_SIZE   16
 DEFAULT_TCP_RECVMBOX_SIZE: The mailbox size for the incoming packets on a NETCONN_TCP. More...
 
#define DEFAULT_THREAD_NAME   "lwIP"
 DEFAULT_THREAD_NAME: The name assigned to any other lwIP thread. More...
 
#define DEFAULT_THREAD_PRIO   1
 DEFAULT_THREAD_PRIO: The priority assigned to any other lwIP thread. More...
 
#define DEFAULT_THREAD_STACKSIZE   configMINIMAL_STACK_SIZE
 DEFAULT_THREAD_STACKSIZE: The stack size used by any other lwIP thread. More...
 
#define DEFAULT_UDP_RECVMBOX_SIZE   16
 DEFAULT_UDP_RECVMBOX_SIZE: The mailbox size for the incoming packets on a NETCONN_UDP. More...
 
#define DHCP_DEBUG   LWIP_DBG_OFF
 
#define DNS_DEBUG   LWIP_DBG_OFF
 
#define ETH_PAD_SIZE   2
 ETH_PAD_SIZE: number of bytes added before the ethernet header to ensure alignment of payload after that header. More...
 
#define ETHARP_DEBUG   LWIP_DBG_OFF
 
#define ICMP_DEBUG   LWIP_DBG_OFF
 
#define ICMP_STATS   1
 
#define IGMP_DEBUG   LWIP_DBG_OFF
 
#define INET_DEBUG   LWIP_DBG_OFF
 
#define IP_DEBUG   LWIP_DBG_OFF
 
#define IP_REASS_DEBUG   LWIP_DBG_OFF
 
#define IP_STATS   1
 
#define LINK_STATS   1
 
#define LWIP_AUTOIP   1
 LWIP_AUTOIP==1: Enable AUTOIP module. More...
 
#define LWIP_DBG_MIN_LEVEL   LWIP_DBG_LEVEL_ALL
 
#define LWIP_DBG_TYPES_ON   LWIP_DBG_ON
 
#define LWIP_DEBUG
 
#define LWIP_DHCP   1
 LWIP_DHCP==1: Enable DHCP module. More...
 
#define LWIP_DHCP_AUTOIP_COOP   1
 LWIP_DHCP_AUTOIP_COOP==1: Allow DHCP and AUTOIP to be both enabled on the same interface at the same time. More...
 
#define LWIP_DNS   1
 LWIP_DNS==1: Turn on DNS module. More...
 
#define LWIP_IGMP   0
 LWIP_IGMP==1: Turn on IGMP module. More...
 
#define LWIP_IPV6   1
 LWIP_IPV6==1: Enable IPv6. More...
 
#define LWIP_NETCONN   1
 LWIP_NETCONN==1: Enable Netconn API (require to use api_lib.c) More...
 
#define LWIP_NETIF_STATUS_CALLBACK   1
 LWIP_NETIF_STATUS_CALLBACK==1: Support a callback function whenever an interface changes its up/down status (i.e., due to DHCP IP acquisition) More...
 
#define LWIP_RAND   random_number
 
#define LWIP_SO_RCVTIMEO   1
 LWIP_SO_RCVTIMEO==1: Enable recv timeout. More...
 
#define LWIP_SOCKET   1
 LWIP_SOCKET==1: Enable Socket API (require to use sockets.c) More...
 
#define LWIP_STATS   1
 LWIP_STATS==1: Enable statistics collection in lwip_stats. More...
 
#define LWIP_STATS_DISPLAY   0
 LWIP_STATS_DISPLAY==1: Compile in the statistics output functions. More...
 
#define LWIP_STATS_LARGE   1
 LWIP_STATS_LARGE==1: Use 32 bits counter instead of 16. More...
 
#define LWIP_TCP   1
 LWIP_TCP==1: Turn on TCP. More...
 
#define LWIP_TIMEVAL_PRIVATE   0
 
#define LWIP_UDP   1
 LWIP_UDP==1: Turn on UDP. More...
 
#define MEM_ALIGNMENT   4
 MEM_ALIGNMENT: should be set to the alignment of the CPU 4 byte alignment -> #define MEM_ALIGNMENT 4 2 byte alignment -> #define MEM_ALIGNMENT 2. More...
 
#define MEM_DEBUG   LWIP_DBG_OFF
 
#define mem_free   vPortFree
 
#define MEM_LIBC_MALLOC   1
 MEM_LIBC_MALLOC==1: Use malloc/free/realloc provided by your C-library instead of the lwip internal allocator. More...
 
#define mem_malloc   pvPortMalloc
 
#define MEM_STATS   1
 
#define MEMP_DEBUG   LWIP_DBG_OFF
 
#define MEMP_NUM_NETBUF   8
 MEMP_NUM_NETBUF: the number of struct netbufs. More...
 
#define MEMP_NUM_NETCONN   16
 MEMP_NUM_NETCONN: the number of struct netconns. More...
 
#define MEMP_NUM_RAW_PCB   1
 MEMP_NUM_RAW_PCB: Number of raw connection PCBs (requires the LWIP_RAW option) More...
 
#define MEMP_NUM_SYS_TIMEOUT   12
 MEMP_NUM_SYS_TIMEOUT: the number of simultaneously active timeouts. More...
 
#define MEMP_NUM_TCP_PCB   8
 MEMP_NUM_TCP_PCB: the number of simultaneously active TCP connections. More...
 
#define MEMP_NUM_TCP_PCB_LISTEN   1
 MEMP_NUM_TCP_PCB_LISTEN: the number of listening TCP connections. More...
 
#define MEMP_NUM_TCP_SEG   32
 MEMP_NUM_TCP_SEG: the number of simultaneously queued TCP segments. More...
 
#define MEMP_NUM_UDP_PCB   8
 MEMP_NUM_UDP_PCB: the number of UDP protocol control blocks. More...
 
#define MEMP_STATS   1
 
#define NETIF_DEBUG   LWIP_DBG_OFF
 
#define PBUF_DEBUG   LWIP_DBG_OFF
 
#define PBUF_POOL_BUFSIZE   1610
 PBUF_POOL_BUFSIZE: the size of each pbuf in the pbuf pool. More...
 
#define PBUF_POOL_SIZE   MEMP_NUM_TCP_SEG
 PBUF_POOL_SIZE: the number of buffers in the pbuf pool. More...
 
#define PBUF_STATS   1
 
#define PPP_DEBUG   LWIP_DBG_OFF
 
#define PPP_THREAD_NAME   "pppInputThread"
 PPP_THREAD_NAME: The name assigned to the pppMain thread. More...
 
#define PPP_THREAD_PRIO   1
 PPP_THREAD_PRIO: The priority assigned to the pppMain thread. More...
 
#define PPP_THREAD_STACKSIZE   configMINIMAL_STACK_SIZE
 PPP_THREAD_STACKSIZE: The stack size used by the pppMain thread. More...
 
#define RAW_DEBUG   LWIP_DBG_OFF
 
#define SLIP_DEBUG   LWIP_DBG_OFF
 
#define SLIPIF_THREAD_NAME   "slipif"
 SLIPIF_THREAD_NAME: The name assigned to the slipif_loop thread. More...
 
#define SLIPIF_THREAD_PRIO   1
 SLIPIF_THREAD_PRIO: The priority assigned to the slipif_loop thread. More...
 
#define SLIPIF_THREAD_STACKSIZE   configMINIMAL_STACK_SIZE
 SLIP_THREAD_STACKSIZE: The stack size used by the slipif_loop thread. More...
 
#define SNMP_MIB_DEBUG   LWIP_DBG_OFF
 
#define SNMP_MSG_DEBUG   LWIP_DBG_OFF
 
#define SOCKETS_DEBUG   LWIP_DBG_OFF
 
#define SYS_DEBUG   LWIP_DBG_OFF
 
#define SYS_LIGHTWEIGHT_PROT   1
 SYS_LIGHTWEIGHT_PROT==1: if you want inter-task protection for certain critical regions during buffer allocation, deallocation and memory allocation and deallocation. More...
 
#define SYS_STATS   1
 
#define TCP_CWND_DEBUG   LWIP_DBG_OFF
 
#define TCP_DEBUG   LWIP_DBG_OFF
 
#define TCP_FR_DEBUG   LWIP_DBG_OFF
 
#define TCP_INPUT_DEBUG   LWIP_DBG_OFF
 
#define TCP_MSS   1400
 TCP_MSS: TCP Maximum segment size. More...
 
#define TCP_OUTPUT_DEBUG   LWIP_DBG_OFF
 
#define TCP_QLEN_DEBUG   LWIP_DBG_OFF
 
#define TCP_RST_DEBUG   LWIP_DBG_OFF
 
#define TCP_RTO_DEBUG   LWIP_DBG_OFF
 
#define TCP_SND_BUF   TCP_WND
 TCP_SND_BUF: TCP sender buffer space (bytes). More...
 
#define TCP_SND_QUEUELEN   (4 * TCP_SND_BUF / TCP_MSS)
 TCP_SND_QUEUELEN: TCP sender buffer space (pbufs). More...
 
#define TCP_STATS   1
 
#define TCP_WND   (8 * TCP_MSS)
 TCP_WND: The size of a TCP window. More...
 
#define TCP_WND_DEBUG   LWIP_DBG_OFF
 
#define TCPIP_DEBUG   LWIP_DBG_OFF
 
#define TCPIP_MBOX_SIZE   64
 TCPIP_MBOX_SIZE: The mailbox size for the tcpip thread messages The queue size value itself is platform-dependent, but is passed to sys_mbox_new() when tcpip_init is called. More...
 
#define TCPIP_THREAD_NAME   "TCP/IP"
 TCPIP_THREAD_NAME: The name assigned to the main tcpip thread. More...
 
#define TCPIP_THREAD_PRIO   (configMAX_PRIORITIES - 2)
 TCPIP_THREAD_PRIO: The priority assigned to the main tcpip thread. More...
 
#define TCPIP_THREAD_STACKSIZE   (8192 / sizeof(portSTACK_TYPE))
 TCPIP_THREAD_STACKSIZE: The stack size used by the main tcpip thread. More...
 
#define TIMERS_DEBUG   LWIP_DBG_OFF
 
#define UDP_DEBUG   LWIP_DBG_OFF
 
#define UDP_STATS   1
 

Functions

int random_number (void)
 

#define API_LIB_DEBUG   LWIP_DBG_OFF

Referenced by netconn_recv_data(), and netconn_send().

#define API_MSG_DEBUG   LWIP_DBG_OFF

Referenced by accept_function().

#define DEFAULT_ACCEPTMBOX_SIZE   6

DEFAULT_ACCEPTMBOX_SIZE: The mailbox size for the incoming connections.

The queue size value itself is platform-dependent, but is passed to sys_mbox_new() when the acceptmbox is created.

Referenced by lwip_netconn_do_listen().

#define DEFAULT_RAW_RECVMBOX_SIZE   6

DEFAULT_RAW_RECVMBOX_SIZE: The mailbox size for the incoming packets on a NETCONN_RAW.

The queue size value itself is platform-dependent, but is passed to sys_mbox_new() when the recvmbox is created.

Referenced by netconn_alloc().

#define DEFAULT_TCP_RECVMBOX_SIZE   16

DEFAULT_TCP_RECVMBOX_SIZE: The mailbox size for the incoming packets on a NETCONN_TCP.

The queue size value itself is platform-dependent, but is passed to sys_mbox_new() when the recvmbox is created.

Referenced by netconn_alloc().

#define DEFAULT_THREAD_NAME   "lwIP"

DEFAULT_THREAD_NAME: The name assigned to any other lwIP thread.

#define DEFAULT_THREAD_PRIO   1

DEFAULT_THREAD_PRIO: The priority assigned to any other lwIP thread.

The priority value itself is platform-dependent, but is passed to sys_thread_new() when the thread is created.

#define DEFAULT_THREAD_STACKSIZE   configMINIMAL_STACK_SIZE

DEFAULT_THREAD_STACKSIZE: The stack size used by any other lwIP thread.

The stack size value itself is platform-dependent, but is passed to sys_thread_new() when the thread is created.

#define DEFAULT_UDP_RECVMBOX_SIZE   16

DEFAULT_UDP_RECVMBOX_SIZE: The mailbox size for the incoming packets on a NETCONN_UDP.

The queue size value itself is platform-dependent, but is passed to sys_mbox_new() when the recvmbox is created.

Referenced by netconn_alloc().

#define ETH_PAD_SIZE   2

ETH_PAD_SIZE: number of bytes added before the ethernet header to ensure alignment of payload after that header.

Since the header is 14 bytes long, without this padding e.g. addresses in the IP header will not be aligned on a 32-bit boundary, so setting this to 2 can speed up 32-bit-platforms.

Referenced by wilc_netif_rx_callback(), and wilc_netif_tx().

#define ICMP_DEBUG   LWIP_DBG_OFF
#define ICMP_STATS   1
#define IGMP_DEBUG   LWIP_DBG_OFF
#define INET_DEBUG   LWIP_DBG_OFF
#define IP_DEBUG   LWIP_DBG_OFF

Referenced by ip_input(), ip_output(), and ip_route().

#define IP_REASS_DEBUG   LWIP_DBG_OFF
#define IP_STATS   1
#define LINK_STATS   1
#define LWIP_AUTOIP   1

LWIP_AUTOIP==1: Enable AUTOIP module.

Referenced by netif_set_ipaddr().

#define LWIP_DBG_MIN_LEVEL   LWIP_DBG_LEVEL_ALL
#define LWIP_DBG_TYPES_ON   LWIP_DBG_ON
#define LWIP_DEBUG
#define LWIP_DHCP   1

LWIP_DHCP==1: Enable DHCP module.

#define LWIP_DHCP_AUTOIP_COOP   1

LWIP_DHCP_AUTOIP_COOP==1: Allow DHCP and AUTOIP to be both enabled on the same interface at the same time.

#define LWIP_DNS   1

LWIP_DNS==1: Turn on DNS module.

UDP must be available for DNS transport.

#define LWIP_IGMP   0

LWIP_IGMP==1: Turn on IGMP module.

Referenced by udp_input().

#define LWIP_IPV6   1

LWIP_IPV6==1: Enable IPv6.

Referenced by ip_route(), netbuf_new(), netconn_recv(), raw_input(), and udp_input().

#define LWIP_NETCONN   1

LWIP_NETCONN==1: Enable Netconn API (require to use api_lib.c)

#define LWIP_NETIF_STATUS_CALLBACK   1

LWIP_NETIF_STATUS_CALLBACK==1: Support a callback function whenever an interface changes its up/down status (i.e., due to DHCP IP acquisition)

#define LWIP_RAND   random_number
#define LWIP_SO_RCVTIMEO   1

LWIP_SO_RCVTIMEO==1: Enable recv timeout.

#define LWIP_SOCKET   1

LWIP_SOCKET==1: Enable Socket API (require to use sockets.c)

#define LWIP_STATS   1

LWIP_STATS==1: Enable statistics collection in lwip_stats.

#define LWIP_STATS_DISPLAY   0

LWIP_STATS_DISPLAY==1: Compile in the statistics output functions.

#define LWIP_STATS_LARGE   1

LWIP_STATS_LARGE==1: Use 32 bits counter instead of 16.

#define LWIP_TCP   1

LWIP_TCP==1: Turn on TCP.

#define LWIP_TIMEVAL_PRIVATE   0
#define LWIP_UDP   1

LWIP_UDP==1: Turn on UDP.

#define MEM_ALIGNMENT   4

MEM_ALIGNMENT: should be set to the alignment of the CPU 4 byte alignment -> #define MEM_ALIGNMENT 4 2 byte alignment -> #define MEM_ALIGNMENT 2.

Referenced by if(), lwip_gethostbyname_r(), memp_free(), and pbuf_alloc().

#define MEM_DEBUG   LWIP_DBG_OFF
#define mem_free   vPortFree
#define MEM_LIBC_MALLOC   1

MEM_LIBC_MALLOC==1: Use malloc/free/realloc provided by your C-library instead of the lwip internal allocator.

Can save code size if you already use it.

#define mem_malloc   pvPortMalloc
#define MEM_STATS   1
#define MEMP_DEBUG   LWIP_DBG_OFF
#define MEMP_NUM_NETBUF   8

MEMP_NUM_NETBUF: the number of struct netbufs.

(only needed if you use the sequential API, like api_lib.c)

#define MEMP_NUM_NETCONN   16

MEMP_NUM_NETCONN: the number of struct netconns.

(only needed if you use the sequential API, like api_lib.c)

#define MEMP_NUM_RAW_PCB   1

MEMP_NUM_RAW_PCB: Number of raw connection PCBs (requires the LWIP_RAW option)

#define MEMP_NUM_SYS_TIMEOUT   12

MEMP_NUM_SYS_TIMEOUT: the number of simultaneously active timeouts.

#define MEMP_NUM_TCP_PCB   8

MEMP_NUM_TCP_PCB: the number of simultaneously active TCP connections.

(requires the LWIP_TCP option)

#define MEMP_NUM_TCP_PCB_LISTEN   1

MEMP_NUM_TCP_PCB_LISTEN: the number of listening TCP connections.

(requires the LWIP_TCP option)

#define MEMP_NUM_TCP_SEG   32

MEMP_NUM_TCP_SEG: the number of simultaneously queued TCP segments.

(requires the LWIP_TCP option)

#define MEMP_NUM_UDP_PCB   8

MEMP_NUM_UDP_PCB: the number of UDP protocol control blocks.

One per active UDP "connection". (requires the LWIP_UDP option)

#define MEMP_STATS   1
#define PBUF_POOL_BUFSIZE   1610

PBUF_POOL_BUFSIZE: the size of each pbuf in the pbuf pool.

#define PBUF_POOL_SIZE   MEMP_NUM_TCP_SEG

PBUF_POOL_SIZE: the number of buffers in the pbuf pool.

#define PBUF_STATS   1
#define PPP_DEBUG   LWIP_DBG_OFF
#define PPP_THREAD_NAME   "pppInputThread"

PPP_THREAD_NAME: The name assigned to the pppMain thread.

#define PPP_THREAD_PRIO   1

PPP_THREAD_PRIO: The priority assigned to the pppMain thread.

The priority value itself is platform-dependent, but is passed to sys_thread_new() when the thread is created.

#define PPP_THREAD_STACKSIZE   configMINIMAL_STACK_SIZE

PPP_THREAD_STACKSIZE: The stack size used by the pppMain thread.

The stack size value itself is platform-dependent, but is passed to sys_thread_new() when the thread is created.

#define RAW_DEBUG   LWIP_DBG_OFF

Referenced by raw_new(), and raw_sendto().

#define SLIP_DEBUG   LWIP_DBG_OFF
#define SLIPIF_THREAD_NAME   "slipif"

SLIPIF_THREAD_NAME: The name assigned to the slipif_loop thread.

#define SLIPIF_THREAD_PRIO   1

SLIPIF_THREAD_PRIO: The priority assigned to the slipif_loop thread.

The priority value itself is platform-dependent, but is passed to sys_thread_new() when the thread is created.

#define SLIPIF_THREAD_STACKSIZE   configMINIMAL_STACK_SIZE

SLIP_THREAD_STACKSIZE: The stack size used by the slipif_loop thread.

The stack size value itself is platform-dependent, but is passed to sys_thread_new() when the thread is created.

#define SNMP_MIB_DEBUG   LWIP_DBG_OFF
#define SNMP_MSG_DEBUG   LWIP_DBG_OFF
#define SYS_DEBUG   LWIP_DBG_OFF
#define SYS_LIGHTWEIGHT_PROT   1

SYS_LIGHTWEIGHT_PROT==1: if you want inter-task protection for certain critical regions during buffer allocation, deallocation and memory allocation and deallocation.

#define SYS_STATS   1
#define TCP_CWND_DEBUG   LWIP_DBG_OFF
#define TCP_FR_DEBUG   LWIP_DBG_OFF

Referenced by tcp_rexmit_fast().

#define TCP_MSS   1400

TCP_MSS: TCP Maximum segment size.

Referenced by tcp_alloc(), tcp_connect(), tcp_output_segment(), and tcp_parseopt().

#define TCP_QLEN_DEBUG   LWIP_DBG_OFF
#define TCP_RST_DEBUG   LWIP_DBG_OFF
#define TCP_RTO_DEBUG   LWIP_DBG_OFF
#define TCP_SND_BUF   TCP_WND

TCP_SND_BUF: TCP sender buffer space (bytes).

To achieve good performance, this should be at least 2 * TCP_MSS.

Referenced by iperf_tcp_send(), and tcp_alloc().

#define TCP_SND_QUEUELEN   (4 * TCP_SND_BUF / TCP_MSS)

TCP_SND_QUEUELEN: TCP sender buffer space (pbufs).

This must be at least as much as (2 * TCP_SND_BUF/TCP_MSS) for things to work.

Referenced by tcp_enqueue_flags(), tcp_write(), and tcp_write_checks().

#define TCP_STATS   1
#define TCP_WND   (8 * TCP_MSS)

TCP_WND: The size of a TCP window.

This must be at least (2 * TCP_MSS) for things to work well

Referenced by iperf_tcp_server(), tcp_alloc(), tcp_close_shutdown(), tcp_connect(), tcp_input(), tcp_process_refused_data(), tcp_recved(), tcp_rst_impl(), and tcp_update_rcv_ann_wnd().

#define TCP_WND_DEBUG   LWIP_DBG_OFF

Referenced by tcp_receive().

#define TCPIP_DEBUG   LWIP_DBG_OFF

Referenced by tcpip_input(), and tcpip_thread().

#define TCPIP_MBOX_SIZE   64

TCPIP_MBOX_SIZE: The mailbox size for the tcpip thread messages The queue size value itself is platform-dependent, but is passed to sys_mbox_new() when tcpip_init is called.

Referenced by tcpip_init().

#define TCPIP_THREAD_NAME   "TCP/IP"

TCPIP_THREAD_NAME: The name assigned to the main tcpip thread.

Referenced by tcpip_init().

#define TCPIP_THREAD_PRIO   (configMAX_PRIORITIES - 2)

TCPIP_THREAD_PRIO: The priority assigned to the main tcpip thread.

The priority value itself is platform-dependent, but is passed to sys_thread_new() when the thread is created.

Referenced by tcpip_init().

#define TCPIP_THREAD_STACKSIZE   (8192 / sizeof(portSTACK_TYPE))

TCPIP_THREAD_STACKSIZE: The stack size used by the main tcpip thread.

The stack size value itself is platform-dependent, but is passed to sys_thread_new() when the thread is created.

Referenced by tcpip_init().

#define UDP_DEBUG   LWIP_DBG_OFF

Referenced by udp_bind(), udp_connect(), and udp_input().

#define UDP_STATS   1

int random_number ( void  )