#ifndef __LWIPOPTS_H__ #define __LWIPOPTS_H__ #define TCPIP_THREAD_NAME "TCP_LwIP_Thread" #define LWIP_ARP 1 #define ARP_TABLE_SIZE 32 /* #define LWIP_SO_SNDTIMEO 10 #define LWIP_SO_RCVTIMEO 10 #define LWIP_TCP_KEEPALIVE 1 #define TCP_KEEPINTVL_DEFAULT 3000 #define TCP_KEEPCNT_DEFAULT 3 #define TCP_KEEPIDLE_DEFAULT 5000 #define TCP_MSL 3000 #define TCP_LISTEN_BACKLOG 0 //By default, TCP socket/netconn close waits 20 seconds max to send the FIN #define LWIP_TCP_CLOSE_TIMEOUT_MS_DEFAULT 1000 */ /* ---------- Statistics options ---------- */ //#define STATS #ifdef STATS //#define LINK_STATS 1 //#define IP_STATS 1 //#define ICMP_STATS 1 //#define UDP_STATS 1 //#define TCP_STATS 1 #define MEM_STATS 1 #define MEMP_STATS 1 #define PBUF_STATS 1 //#define SYS_STATS 1 #endif /* STATS */ /** * 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. */ #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 (2 * 1024 * 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 300 /* MEMP_NUM_UDP_PCB: the number of UDP protocol control blocks. One per active UDP "connection". */ #define MEMP_NUM_UDP_PCB 0 // MEMP_NUM_TCP_PCB: the number of simulatenously active TCP connections. #define MEMP_NUM_TCP_PCB 20 // MEMP_NUM_TCP_PCB_LISTEN: the number of listening TCP connections. #define MEMP_NUM_TCP_PCB_LISTEN 10 // MEMP_NUM_TCP_SEG: the number of simultaneously queued TCP segments. // Заметка: минимум 12 #define MEMP_NUM_TCP_SEG 16 // MEMP_NUM_SYS_TIMEOUT: the number of simulateously active timeouts. #define MEMP_NUM_SYS_TIMEOUT 10 #define MEMP_NUM_NETBUF 10 #define MEMP_NUM_NETCONN 10 /* ---------- Pbuf options ---------- */ /* PBUF_POOL_SIZE: the number of buffers in the pbuf pool. */ #define PBUF_POOL_SIZE 50 /* PBUF_POOL_BUFSIZE: the size of each pbuf in the pbuf pool. */ #define PBUF_POOL_BUFSIZE 16 * 1024 /* ---------- 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 1 /* TCP Maximum segment size. * TCP_MSS = (Ethernet MTU - IP header size - TCP header size) */ #define TCP_MSS (1500 - 40) /* TCP receive window. */ #define TCP_WND (4 * TCP_MSS) /* TCP sender buffer space (bytes). */ #define TCP_SND_BUF TCP_WND /* TCP sender buffer space (pbufs). This must be at least = 2 * TCP_SND_BUF/TCP_MSS for things to work. */ #define TCP_SND_QUEUELEN (4 * TCP_SND_BUF)/TCP_MSS /* ---------- ICMP options ---------- */ #define LWIP_ICMP 1 /* ---------- DHCP options ---------- */ /* Define LWIP_DHCP to 1 if you want DHCP configuration of interfaces. DHCP is not implemented in lwIP 0.5.1, however, so turning this on does currently not work. */ #define LWIP_DHCP 0 /* ---------- UDP options ---------- */ #define LWIP_UDP 0 #define UDP_TTL 255 /* -------------------------------------- ---------- Checksum options ---------- -------------------------------------- */ //#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 #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 #endif #define LWIP_TIMERS 0 #define LWIP_TCPIP_TIMEOUT 0 #define LWIP_NETIF_STATUS_CALLBACK 1 #define LWIP_PROVIDE_ERRNO 1 #define LWIP_RANDOMIZE_INITIAL_LOCAL_PORTS 1 #define ETHARP_SUPPORT_STATIC_ENTRIES 1 #define LWIP_RAW 0 #define LWIP_TCPIP_CORE_LOCKING 0 #define LWIP_TIMEVAL_PRIVATE 0 #define LWIP_NETIF_LINK_CALLBACK 1 #define ETHARP_TRUST_IP_MAC 0 /** * IP_REASSEMBLY==1: Reassemble incoming fragmented IP packets. Note that * this option does not affect outgoing packet sizes, which can be controlled * via IP_FRAG. */ #define IP_REASSEMBLY 0 /** * IP_FRAG==1: Fragment outgoing IP packets if their size exceeds MTU. Note * that this option does not affect incoming packet sizes, which can be * controlled via IP_REASSEMBLY. */ #define IP_FRAG 0 #define ARP_QUEUEING 0 #define LWIP_NETCONN_FULLDUPLEX 1 /* Define IP_FORWARD to 1 if you wish to have the ability to forward IP packets across network interfaces. If you are going to run lwIP on a device with only one network interface, define this to 0. */ //#define IP_FORWARD 1 /* ---------------------------------------------- ---------- Sequential layer options ---------- ---------------------------------------------- */ /** * LWIP_NETCONN==1: Enable Netconn API (require to use api_lib.c) */ #define LWIP_NETCONN 0 /* --------------------------------- ---------- OS options ----------- --------------------------------- */ #define TCPIP_THREAD_STACKSIZE 16 * 1024 #define TCPIP_MBOX_SIZE 5 #define DEFAULT_UDP_RECVMBOX_SIZE 2000 #define DEFAULT_TCP_RECVMBOX_SIZE 2000 #define DEFAULT_ACCEPTMBOX_SIZE 2000 #define DEFAULT_THREAD_STACKSIZE 1024 /* ------------------------------------ ---------- Socket options ---------- ------------------------------------ */ /** * LWIP_SOCKET==1: Enable Socket API (require to use sockets.c) */ #define LWIP_SOCKET 1 //#define LWIP_NETCONN_SEM_PER_THREAD 1 /* ----------------------------------- ---------- DEBUG options ---------- ----------------------------------- */ #define LWIP_DEBUG 1 #define MEM_OVERFLOW_CHECK 2 #define MEMP_SANITY_CHECK 1 /* ---------- Statistics options ---------- */ //#define LWIP_DEBUG_TIMERNAMES LWIP_DBG_ON //#define TCP_QLEN_DEBUG LWIP_DBG_ON //#define TCP_OUTPUT_DEBUG LWIP_DBG_ON //#define IP_DEBUG LWIP_DBG_ON //#define LWIP_STATS 1 //#define LWIP_STATS_DISPLAY 1 #define TCP_DEBUG LWIP_DBG_ON #define SOCKETS_DEBUG LWIP_DBG_ON //#define NETIF_DEBUG LWIP_DBG_ON #define MEM_DEBUG LWIP_DBG_ON #define MEMP_DEBUG LWIP_DBG_ON #endif /* __LWIPOPTS_H__ */