/******************************************************************************************************** * lwipopts.h * * NOTICE: All information contained herein is, and remains the property of Henny Penny. The * intellectual and technical concepts contained herein are proprietary to Henny Penny and may be covered * by U.S. and Foreign Patents, patents in process, and are protected by trade secret or copyright law. * Dissemination of this information or reproduction of this material, in whole or in part, is strictly * forbidden unless prior written permission is obtained from Henny Penny. * Copyright © 2015-2016 Henny Penny Corporation, Eaton, OH 45320, USA. All Rights Reserved. * ******************************************************************************************************** * * DESCRIPTION/USAGE: * * Describes the lwIP user-configurable options for this implementation. Modify options in this file * only. Do not modify anything in the opts.h file directly, as those are the system defaults common * across all lwIP implementations. * *******************************************************************************************************/ #ifndef LWIPOPTS_H_ #define LWIPOPTS_H_ /** * 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_LIGHTWEIGHT_PROT 1 /** * NO_SYS==1: Provides VERY minimal functionality. * Otherwise, use lwIP facilities by assuming an (RT)OS. */ #define NO_SYS 0 /* ---------- Memory options ---------- */ /* MEM_ALIGNMENT: should be set to the alignment of the CPU for which lwIP is compiled. 4 byte alignment -> define MEM_ALIGNMENT to 4, 2 byte alignment -> define MEM_ALIGNMENT to 2. */ #define MEM_ALIGNMENT 4 /* MEM_SIZE: the size of the heap memory. If the application will send a lot of data that needs to be copied, this should be set high. */ #define MEM_SIZE (15*1024) /* MEMP_NUM_PBUF: the number of memp struct pbufs. If the application sends a lot of data out of ROM (or * other static memory), this should be set high. */ #define MEMP_NUM_PBUF 15 // Adds about 10 bytes per unit. i.e. 15 = 150 bytes. /* MEMP_NUM_UDP_PCB: the number of UDP protocol control blocks. One per active UDP "connection". */ #define MEMP_NUM_UDP_PCB 6 /* MEMP_NUM_TCP_PCB: the number of simultaneously active TCP connections. */ #define MEMP_NUM_TCP_PCB 6 /* MEMP_NUM_TCP_PCB_LISTEN: the number of listening TCP connections. */ #define MEMP_NUM_TCP_PCB_LISTEN 6 /* MEMP_NUM_TCP_SEG: the number of simultaneously queued TCP segments. */ #define MEMP_NUM_TCP_SEG 12 /* MEMP_NUM_SYS_TIMEOUT: the number of simulateously active timeouts. */ //#define MEMP_NUM_SYS_TIMEOUT 10 //#define MEM_USE_POOLS 1 //#define MEMP_USE_CUSTOM_POOLS 1 /* ---------- Pbuf options ---------- */ /* PBUF_POOL_SIZE: the number of buffers in the pbuf pool. */ #define PBUF_POOL_SIZE 20 /* PBUF_POOL_BUFSIZE: the size of each pbuf in the pbuf pool. */ #define PBUF_POOL_BUFSIZE (600) //#define PBUF_POOL_BUFSIZE (1536) /* ---------- TCP options ---------- */ #define LWIP_TCP 1 #define TCP_TTL 255 /* Controls if TCP should queue segments that arrive out of order. Define to 0 if your device is low on memory. */ #define TCP_QUEUE_OOSEQ 0 /* TCP Maximum segment size. */ #define TCP_MSS (1500 - 40) /* TCP_MSS = (Ethernet MTU - IP header size - TCP header size) */ /* TCP receive window. */ #define TCP_WND (2*TCP_MSS) /* TCP sender buffer space (bytes). */ #define TCP_SND_BUF (2*TCP_WND) //(4*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. */ #define TCP_SND_QUEUELEN (2* TCP_SND_BUF/TCP_MSS) #define TCP_OVERSIZE TCP_MSS /* ---------- ICMP options ---------- */ #define LWIP_ICMP 1 /* ---------- DHCP options ---------- */ // Define LWIP_DHCP to 1 if you want DHCP configuration of interfaces. #define LWIP_DHCP 0 /* ---------- UDP options ---------- */ #define LWIP_UDP 1 #define UDP_TTL 25 /* ---------- Statistics options ---------- */ #ifdef DEBUG_ #define LWIP_STATS 1 #define LINK_STATS 1 #define IP_STATS 1 #define IPFRAG_STATS 1 #define UDP_STATS 1 #define MEM_STATS 1 #define MEMP_STATS 1 #define SYS_STATS 1 #define LWIP_PROVIDE_ERRNO 1 #else #define LWIP_STATS 0 #endif /* ---------- link callback options ---------- */ /* LWIP_NETIF_LINK_CALLBACK==1: Support a callback function from an interface * whenever the link changes (i.e., link down) */ #define LWIP_NETIF_LINK_CALLBACK 0 /* -------------------------------------- ---------- Checksum options ---------- -------------------------------------- */ /* * The STM32F2xx allows computing and verifying the IP, UDP, TCP, and ICMP checksums in hardware for * Ethernet interface. So: * - To let the hardware calculate the CRCs, uncomment the following CHECKSUM_BY_HARDWARE #define. * - To force the CPU calculate CRCs, comment out the CHECKSUM_BY_HARDWARE #define. * * (When not using the Ethernet hardware, such as the RS485 interface, the checksum will need to be * calculated in the software; therefore, the following #define needs to be undefined (commented out). */ //#define CHECKSUM_BY_HARDWARE #ifdef CHECKSUM_BY_HARDWARE /* CHECKSUM_GEN_IP==0: Generate checksums by hardware for outgoing IP packets.*/ #define CHECKSUM_GEN_IP 0 /* CHECKSUM_GEN_UDP==0: Generate checksums by hardware for outgoing UDP packets.*/ #define CHECKSUM_GEN_UDP 0 /* CHECKSUM_GEN_TCP==0: Generate checksums by hardware for outgoing TCP packets.*/ #define CHECKSUM_GEN_TCP 0 /* CHECKSUM_CHECK_IP==0: Check checksums by hardware for incoming IP packets.*/ #define CHECKSUM_CHECK_IP 0 /* CHECKSUM_CHECK_UDP==0: Check checksums by hardware for incoming UDP packets.*/ #define CHECKSUM_CHECK_UDP 0 /* CHECKSUM_CHECK_TCP==0: Check checksums by hardware for incoming TCP packets.*/ #define CHECKSUM_CHECK_TCP 0 /* CHECKSUM_CHECK_ICMP==0: Check checksums by hardware for incoming ICMP packets.*/ #define CHECKSUM_GEN_ICMP 0 #else /* CHECKSUM_GEN_IP==1: Generate checksums in software for outgoing IP packets.*/ #define CHECKSUM_GEN_IP 1 /* CHECKSUM_GEN_UDP==1: Generate checksums in software for outgoing UDP packets.*/ #define CHECKSUM_GEN_UDP 1 /* CHECKSUM_GEN_TCP==1: Generate checksums in software for outgoing TCP packets.*/ #define CHECKSUM_GEN_TCP 1 /* CHECKSUM_CHECK_IP==1: Check checksums in software for incoming IP packets.*/ #define CHECKSUM_CHECK_IP 1 /* CHECKSUM_CHECK_UDP==1: Check checksums in software for incoming UDP packets.*/ #define CHECKSUM_CHECK_UDP 1 /* CHECKSUM_CHECK_TCP==1: Check checksums in software for incoming TCP packets.*/ #define CHECKSUM_CHECK_TCP 1 /* CHECKSUM_CHECK_ICMP==1: Check checksums by hardware for incoming ICMP packets.*/ #define CHECKSUM_GEN_ICMP 1 #endif /* -------------------------------------- ---------- Ethernet options ---------- -------------------------------------- */ /** LWIP_ETHERNET==1: enable ethernet support for PPPoE even though ARP might be disabled */ #define LWIP_ETHERNET 0 /** * LWIP_ARP==1: Enable ARP functionality. */ #define LWIP_ARP 0 /* ------------------------------------ ---------- Socket options ---------- ------------------------------------ */ #define LWIP_RAW 0 /** * LWIP_NETCONN==1: Enable Netconn API (require to use api_lib.c) * Also required to be 1 if want to use LWIP_SOCKET. */ #define LWIP_NETCONN 1 /** * LWIP_SOCKET==1: Enable Socket API (require to use sockets.c) */ #define LWIP_SOCKET 1 /** * LWIP_NETIF_API==1: Support netif api (in netifapi.c) */ #define LWIP_NETIF_API 1 /** * LWIP_COMPAT_SOCKETS==1: Enable BSD-style sockets functions names through defines. * LWIP_COMPAT_SOCKETS==2: Same as ==1 but correctly named functions are created. * While this helps code completion, it might conflict with existing libraries. * (only used if you use sockets.c) */ #define LWIP_COMPAT_SOCKETS 2 /** * LWIP_POSIX_SOCKETS_IO_NAMES==1: Enable POSIX-style sockets functions names. * Disable this option if you use a POSIX operating system that uses the same * names (read, write & close). (only used if you use sockets.c) */ #define LWIP_POSIX_SOCKETS_IO_NAMES 1 /* ------------------------------------ ----------- PPP options ------------ ------------------------------------ */ /** * PPP_SUPPORT==1: Enable PPP. */ #define PPP_SUPPORT 1 #if PPP_SUPPORT /** * PPPOE_SUPPORT==1: Enable PPP over Ethernet. */ #define PPPOE_SUPPORT 0 /** * PPPOS_SUPPORT==1: Enable PPP Over Serial */ #define PPPOS_SUPPORT 1 #define PPP_THREAD_NAME "PPP Daemon" #define PPP_THREAD_STACKSIZE (configMINIMAL_STACK_SIZE + 900) #define PPP_THREAD_PRIO 4 /** * CHAP_SUPPORT==1: Support CHAP. */ #define CHAP_SUPPORT 0 /** * MD5_SUPPORT==1: Support MD5 (see also CHAP). * * GJS: May be needed for CHAP?? Need to do more investigation. */ #define MD5_SUPPORT 0 /** * VJ_SUPPORT==1: Support VJ header compression. * * From Wikipedia (https://en.wikipedia.org/wiki/Van_Jacobson_TCP/IP_Header_Compression): * "Van Jacobson TCP/IP Header Compression is a data compression protocol described in RFC 1144, * specifically designed by Van Jacobson to improve TCP/IP performance over slow serial links. Van * Jacobson compression reduces the normal 40 byte TCP/IP packet headers down to 3-4 bytes for the * average case. It does this by saving the state of TCP connections at both ends of a link, and only * sending the differences in the header fields that change." */ #define VJ_SUPPORT 1 // #define FSM_DEFTIMEOUT 10 /* Timeout time in seconds */ // #define FSM_DEFMAXCONFREQS 12 /* Maximum Configure-Request transmissions */ /** * PPP_SERVER==1: Enable PPP server support (waiting for incoming PPP session). * * Currently only supported for PPPoS. */ #define PPP_SERVER 1 #define PPP_USE_PBUF_RAM 0 /** * MAXNAMELEN: max length of hostname or name for auth */ #define MAXNAMELEN 64 /** * MAXSECRETLEN: max length of password or secret */ #define MAXSECRETLEN 64 /** * PPP_INPROC_IRQ_SAFE==1 call pppos_input() using tcpip_callback(). * * Please read the "PPPoS input path" chapter in the PPP documentation about this option. */ #define PPP_INPROC_IRQ_SAFE 0 #endif // PPP_SUPPORT /* ------------------------------------ ---------- TCP/IP options ---------- ------------------------------------ */ #define TCPIP_THREAD_STACKSIZE (configMINIMAL_STACK_SIZE + 600) #define TCPIP_THREAD_PRIO 4 /** * LWIP_CHECKSUM_ON_COPY==1: Calculate checksum when copying data from * application buffers to pbufs. */ #define LWIP_CHECKSUM_ON_COPY 0 /* ---------------------------------------- ---------- Lwip Debug options ---------- ---------------------------------------- */ #ifdef DEBUG_ #define LWIP_DEBUG LWIP_DBG_ON #define LWIP_DBG_MIN_LEVEL LWIP_DBG_LEVEL_ALL #define LWIP_DBG_TYPES_ON LWIP_DBG_ON #define NETIF_DEBUG LWIP_DBG_ON #define PPP_DEBUG LWIP_DBG_ON #define PBUF_DEBUG LWIP_DBG_ON #define SYS_DEBUG LWIP_DBG_ON #define UDP_DEBUG LWIP_DBG_ON #define TCPIP_DEBUG LWIP_DBG_ON #define MEM_DEBUG LWIP_DBG_ON #define MEMP_DEBUG LWIP_DBG_ON #define ICMP_DEBUG LWIP_DBG_ON /** * PRINTPKT_SUPPORT==1: Enable PPP print packet support * * Mandatory for debugging, it displays exchanged packet content in debug trace. */ #define PRINTPKT_SUPPORT 1 #else #define LWIP_DEBUG LWIP_DBG_OFF #endif #endif // LWIPOPTS_H_