Adapted to Lora Semtech + Nucleo

Dependencies:   DebugLib

Dependents:   LoRaWAN-lmic-app LoRaWAN-lmic-app LoRaWAN-test-10secs LoRaPersonalizedDeviceForEverynet ... more

Fork of lwip_ppp_ethernet by Donatien Garnier

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers lwipopts.h Source File

lwipopts.h

00001 /* lwipopts.h */
00002 /*
00003  Copyright (C) 2012 ARM Limited.
00004 
00005  Permission is hereby granted, free of charge, to any person obtaining a copy of
00006  this software and associated documentation files (the "Software"), to deal in
00007  the Software without restriction, including without limitation the rights to
00008  use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
00009  of the Software, and to permit persons to whom the Software is furnished to do
00010  so, subject to the following conditions:
00011 
00012  The above copyright notice and this permission notice shall be included in all
00013  copies or substantial portions of the Software.
00014 
00015  THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
00016  IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
00017  FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
00018  AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
00019  LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
00020  OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
00021  SOFTWARE.
00022  */
00023 
00024 #ifndef LWIPOPTS_H_
00025 #define LWIPOPTS_H_
00026 
00027 //#include "networking_conf.h" //Basically a #define NET_PPP 1 or #define NET_ETHERNET 1 file
00028 
00029 #define NO_SYS                          0
00030 
00031 //For now only PPP is supported
00032 //Ethernet is in pre-alpha
00033 //Memory
00034 #define MEM_ALIGNMENT 4
00035 
00036 #define MEMP_OVERFLOW_CHECK             0 //For debug, must be removed once everything is validated to reduce mem consumption and improve performance
00037 #define MEMP_SANITY_CHECK               0 //Same here
00038 #define MEMP_NUM_SYS_TIMEOUT            16
00039 
00040 //Debug
00041 #define LWIP_DEBUG                      0
00042 #define PPP_DEBUG                       LWIP_DBG_OFF
00043 #define IP_DEBUG                        LWIP_DBG_OFF
00044 #define MEM_DEBUG                       LWIP_DBG_OFF
00045 #define MEMP_DEBUG                      LWIP_DBG_OFF
00046 #define PBUF_DEBUG                      LWIP_DBG_OFF
00047 #define API_LIB_DEBUG                   LWIP_DBG_OFF
00048 #define API_MSG_DEBUG                   LWIP_DBG_OFF
00049 #define TCPIP_DEBUG                     LWIP_DBG_OFF
00050 #define SOCKETS_DEBUG                   LWIP_DBG_OFF
00051 #define TCP_DEBUG                       LWIP_DBG_OFF
00052 #define TCP_INPUT_DEBUG                 LWIP_DBG_OFF
00053 #define TCP_FR_DEBUG                    LWIP_DBG_OFF
00054 #define TCP_RTO_DEBUG                   LWIP_DBG_OFF
00055 #define TCP_CWND_DEBUG                  LWIP_DBG_OFF
00056 #define TCP_WND_DEBUG                   LWIP_DBG_OFF
00057 #define TCP_OUTPUT_DEBUG                LWIP_DBG_OFF
00058 #define TCP_RST_DEBUG                   LWIP_DBG_OFF
00059 #define TCP_QLEN_DEBUG                  LWIP_DBG_OFF
00060 #define ETHARP_DEBUG                    LWIP_DBG_OFF
00061 #define NETIF_DEBUG                     LWIP_DBG_OFF
00062 #define DHCP_DEBUG                      LWIP_DBG_OFF
00063 
00064 //Modules to enable
00065 #define LWIP_NETCONN 1
00066 #define LWIP_SOCKET 1
00067 #define TCP_QUEUE_OOSEQ 0
00068 #define LWIP_STATS 0
00069 #define TCP_STATS 0
00070 #define IP_STATS 0
00071 #define LINK_STATS 0
00072 #define MEM_STATS 0
00073 #define MEMP_STATS 0
00074 #define SYS_STATS 0
00075 #define LWIP_STATS_DISPLAY 0
00076 
00077 //Mailboxes
00078 #define TCPIP_MBOX_SIZE 6
00079 #define DEFAULT_TCP_RECVMBOX_SIZE 6
00080 #define DEFAULT_UDP_RECVMBOX_SIZE 6
00081 #define DEFAULT_RAW_RECVMBOX_SIZE 6
00082 #define DEFAULT_ACCEPTMBOX_SIZE 6
00083 
00084 //TCP/IP Thread
00085 #define TCPIP_THREAD_STACKSIZE          1024
00086 #define TCPIP_THREAD_PRIO               1
00087 
00088 //Buffers
00089 #define PBUF_POOL_SIZE                  5
00090 #define MEMP_NUM_TCP_PCB_LISTEN         4
00091 #define MEMP_NUM_TCP_PCB                4
00092 #define MEMP_NUM_PBUF                   8
00093 
00094 #define TCP_OVERSIZE                    0 //Disable until it gets fixed in mainline LwIP
00095 #define DEFAULT_THREAD_STACKSIZE        512
00096 #if NET_PPP
00097 ///PPP Options
00098 
00099 #define TCP_SND_BUF                     (3 * 536)
00100 #define TCP_WND                         (2 * 536)
00101 
00102 #define LWIP_ARP 0
00103 
00104 #define PPP_SUPPORT 1
00105 #define CHAP_SUPPORT                    1
00106 #define PAP_SUPPORT                     1
00107 #define PPP_THREAD_STACKSIZE            4*192
00108 #define PPP_THREAD_PRIO 0
00109 
00110 #define MAXNAMELEN                      64     /* max length of hostname or name for auth */
00111 #define MAXSECRETLEN                    64
00112 #elif NET_ETHERNET
00113 
00114 #define MEM_SIZE 16362 //Needs a huge buffer pool
00115 
00116 #define LWIP_ARP 1 //Enable ARP
00117 
00118 /* This define is custom for the LPC EMAC driver. Enabled it to
00119  get debug messages for the driver. */
00120 #define UDP_LPC_EMAC                    LWIP_DBG_OFF
00121 
00122 /* No padding needed */
00123 #define ETH_PAD_SIZE                    0
00124 
00125 /* MSS should match the hardware packet size */
00126 #define TCP_MSS                        1460
00127 #define TCP_SND_BUF           (2 * TCP_MSS)
00128 #define TCP_WND               (2 * TCP_MSS)
00129 #define TCP_SND_QUEUELEN      (2 * TCP_SND_BUF/TCP_MSS)
00130 
00131 #define IP_SOF_BROADCAST        1
00132 #define IP_SOF_BROADCAST_RECV     1
00133 
00134 /* The ethernet FCS is performed in hardware. The IP, TCP, and UDP
00135  CRCs still need to be done in hardware. */
00136 #define CHECKSUM_GEN_IP                 1
00137 #define CHECKSUM_GEN_UDP                1
00138 #define CHECKSUM_GEN_TCP                1
00139 #define CHECKSUM_CHECK_IP               1
00140 #define CHECKSUM_CHECK_UDP              1
00141 #define CHECKSUM_CHECK_TCP              1
00142 #define LWIP_CHECKSUM_ON_COPY           1
00143 
00144 /* DHCP is ok, UDP is required with DHCP */
00145 #define LWIP_DHCP                       1
00146 #define LWIP_UDP                        1
00147 
00148 /* Hostname can be used */
00149 #define LWIP_NETIF_HOSTNAME             1
00150 
00151 #define LWIP_BROADCAST_PING       1
00152 
00153 #else
00154 
00155 #warning Application code only
00156 
00157 #endif
00158 
00159 //DNS
00160 #define LWIP_DNS                        1
00161 
00162 //Do not use LwIP's ugly macro-based renaming
00163 #define LWIP_COMPAT_SOCKETS 0
00164 #define LWIP_POSIX_SOCKETS_IO_NAMES 0
00165 #define LWIP_SO_RCVTIMEO 1
00166 #define LWIP_TCP_KEEPALIVE 1
00167 
00168 #endif /* LWIPOPTS_H_ */