]> git.gir.st - tmk_keyboard.git/blob - tmk_core/tool/mbed/mbed-sdk/libraries/net/lwip/lwip/lwipopts.h
Merge commit '1fe4406f374291ab2e86e95a97341fd9c475fcb8'
[tmk_keyboard.git] / tmk_core / tool / mbed / mbed-sdk / libraries / net / lwip / lwip / lwipopts.h
1 /* Copyright (C) 2012 mbed.org, MIT License
2 *
3 * Permission is hereby granted, free of charge, to any person obtaining a copy of this software
4 * and associated documentation files (the "Software"), to deal in the Software without restriction,
5 * including without limitation the rights to use, copy, modify, merge, publish, distribute,
6 * sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is
7 * furnished to do so, subject to the following conditions:
8 *
9 * The above copyright notice and this permission notice shall be included in all copies or
10 * substantial portions of the Software.
11 *
12 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING
13 * BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
14 * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
15 * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
16 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
17 */
18
19 #ifndef LWIPOPTS_H
20 #define LWIPOPTS_H
21
22 #include "lwipopts_conf.h"
23
24 // Operating System
25 #define NO_SYS 0
26
27 #if NO_SYS == 0
28 #include "cmsis_os.h"
29
30 #define SYS_LIGHTWEIGHT_PROT 1
31
32 #define LWIP_RAW 0
33
34 #define TCPIP_MBOX_SIZE 8
35 #define DEFAULT_TCP_RECVMBOX_SIZE 8
36 #define DEFAULT_UDP_RECVMBOX_SIZE 8
37 #define DEFAULT_RAW_RECVMBOX_SIZE 8
38 #define DEFAULT_ACCEPTMBOX_SIZE 8
39
40 #define TCPIP_THREAD_STACKSIZE 1024
41 #define TCPIP_THREAD_PRIO (osPriorityNormal)
42
43 #define DEFAULT_THREAD_STACKSIZE 512
44
45 #define MEMP_NUM_SYS_TIMEOUT 16
46 #endif
47
48 // 32-bit alignment
49 #define MEM_ALIGNMENT 4
50
51 #define PBUF_POOL_SIZE 5
52 #define MEMP_NUM_TCP_PCB_LISTEN 4
53 #define MEMP_NUM_TCP_PCB 4
54 #define MEMP_NUM_PBUF 8
55
56 #define TCP_QUEUE_OOSEQ 0
57 #define TCP_OVERSIZE 0
58
59 #define LWIP_DHCP 1
60 #define LWIP_DNS 1
61
62 // Support Multicast
63 #include "stdlib.h"
64 #define LWIP_IGMP 1
65 #define LWIP_RAND() rand()
66
67 #define LWIP_COMPAT_SOCKETS 0
68 #define LWIP_POSIX_SOCKETS_IO_NAMES 0
69 #define LWIP_SO_RCVTIMEO 1
70 #define LWIP_TCP_KEEPALIVE 1
71
72 // Debug Options
73 // #define LWIP_DEBUG
74 #define UDP_LPC_EMAC LWIP_DBG_OFF
75 #define SYS_DEBUG LWIP_DBG_OFF
76 #define PPP_DEBUG LWIP_DBG_OFF
77 #define IP_DEBUG LWIP_DBG_OFF
78 #define MEM_DEBUG LWIP_DBG_OFF
79 #define MEMP_DEBUG LWIP_DBG_OFF
80 #define PBUF_DEBUG LWIP_DBG_OFF
81 #define API_LIB_DEBUG LWIP_DBG_OFF
82 #define API_MSG_DEBUG LWIP_DBG_OFF
83 #define TCPIP_DEBUG LWIP_DBG_OFF
84 #define SOCKETS_DEBUG LWIP_DBG_OFF
85 #define TCP_DEBUG LWIP_DBG_OFF
86 #define TCP_INPUT_DEBUG LWIP_DBG_OFF
87 #define TCP_FR_DEBUG LWIP_DBG_OFF
88 #define TCP_RTO_DEBUG LWIP_DBG_OFF
89 #define TCP_CWND_DEBUG LWIP_DBG_OFF
90 #define TCP_WND_DEBUG LWIP_DBG_OFF
91 #define TCP_OUTPUT_DEBUG LWIP_DBG_OFF
92 #define TCP_RST_DEBUG LWIP_DBG_OFF
93 #define TCP_QLEN_DEBUG LWIP_DBG_OFF
94 #define ETHARP_DEBUG LWIP_DBG_OFF
95 #define NETIF_DEBUG LWIP_DBG_OFF
96 #define DHCP_DEBUG LWIP_DBG_OFF
97
98 #ifdef LWIP_DEBUG
99 #define MEMP_OVERFLOW_CHECK 1
100 #define MEMP_SANITY_CHECK 1
101 #else
102 #define LWIP_NOASSERT 1
103 #define LWIP_STATS 0
104 #endif
105
106 #define LWIP_PLATFORM_BYTESWAP 1
107
108 #if LWIP_TRANSPORT_ETHERNET
109
110 /* MSS should match the hardware packet size */
111 #define TCP_MSS 1460
112 #define TCP_SND_BUF (2 * TCP_MSS)
113 #define TCP_WND (2 * TCP_MSS)
114 #define TCP_SND_QUEUELEN (2 * TCP_SND_BUF/TCP_MSS)
115
116 // Broadcast
117 #define IP_SOF_BROADCAST 1
118 #define IP_SOF_BROADCAST_RECV 1
119
120 #define LWIP_BROADCAST_PING 1
121
122 #define LWIP_CHECKSUM_ON_COPY 1
123
124 #define LWIP_NETIF_HOSTNAME 1
125 #define LWIP_NETIF_STATUS_CALLBACK 1
126 #define LWIP_NETIF_LINK_CALLBACK 1
127
128 #elif LWIP_TRANSPORT_PPP
129
130 #define TCP_SND_BUF (3 * 536)
131 #define TCP_WND (2 * 536)
132
133 #define LWIP_ARP 0
134
135 #define PPP_SUPPORT 1
136 #define CHAP_SUPPORT 1
137 #define PAP_SUPPORT 1
138 #define PPP_THREAD_STACKSIZE 4*192
139 #define PPP_THREAD_PRIO 0
140
141 #define MAXNAMELEN 64 /* max length of hostname or name for auth */
142 #define MAXSECRETLEN 64
143
144 #else
145 #error A transport mechanism (Ethernet or PPP) must be defined
146 #endif
147
148 #endif /* LWIPOPTS_H_ */
Imprint / Impressum