PageRenderTime 41ms CodeModel.GetById 17ms RepoModel.GetById 0ms app.codeStats 0ms

lib/liblwip/include/lwipopts.h

http://www.minix3.org/
C Header | 460 lines | 65 code | 61 blank | 334 comment | 0 complexity | 3b83877c130de42134567ed92cda8d66 MD5 | raw file
Possible License(s): MIT, WTFPL, AGPL-1.0, BSD-3-Clause, GPL-3.0, LGPL-2.0, JSON, 0BSD
  1. /**
  2. * @file
  3. *
  4. * lwIP Options Configuration
  5. */
  6. /*
  7. * Copyright (c) 2001-2004 Swedish Institute of Computer Science.
  8. * All rights reserved.
  9. *
  10. * Redistribution and use in source and binary forms, with or without modification,
  11. * are permitted provided that the following conditions are met:
  12. *
  13. * 1. Redistributions of source code must retain the above copyright notice,
  14. * this list of conditions and the following disclaimer.
  15. * 2. Redistributions in binary form must reproduce the above copyright notice,
  16. * this list of conditions and the following disclaimer in the documentation
  17. * and/or other materials provided with the distribution.
  18. * 3. The name of the author may not be used to endorse or promote products
  19. * derived from this software without specific prior written permission.
  20. *
  21. * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED
  22. * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
  23. * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT
  24. * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
  25. * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
  26. * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
  27. * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
  28. * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
  29. * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY
  30. * OF SUCH DAMAGE.
  31. *
  32. * This file is part of the lwIP TCP/IP stack.
  33. *
  34. * Author: Adam Dunkels <adam@sics.se>
  35. *
  36. */
  37. #ifndef __LWIPOPTS_H__
  38. #define __LWIPOPTS_H__
  39. /*
  40. #define LWIP_DEBUG 1
  41. #define RAW_DEBUG LWIP_DBG_ON
  42. #define IP_DEBUG LWIP_DBG_ON
  43. #define NETIF_DEBUG LWIP_DBG_ON
  44. #define ETHARP_DEBUG LWIP_DBG_ON
  45. #define TCP_DEBUG LWIP_DBG_ON
  46. #define TCP_RST_DEBUG LWIP_DBG_ON
  47. #define TCP_DEBUG_PCB_LISTS LWIP_DBG_ON
  48. #define TCP_INPUT_DEBUG LWIP_DBG_ON
  49. #define TCP_OUTPUT_DEBUG LWIP_DBG_ON
  50. #define TCPIP_DEBUG LWIP_DBG_ON
  51. #define UDP_DEBUG LWIP_DBG_ON
  52. #define PBUF_DEBUG LWIP_DBG_ON
  53. #define TCP_CWND_DEBUG LWIP_DBG_ON
  54. */
  55. #define LWIP_DBG_TYPES_ON (LWIP_DBG_ON | LWIP_DBG_TRACE)
  56. #define LWIP_NETIF_LOOPBACK 1
  57. #define LWIP_NETIF_API 0
  58. #define CHECKSUM_GEN_IP 1
  59. #define CHECKSUM_GEN_UDP 1
  60. #define CHECKSUM_GEN_TCP 1
  61. #define CHECKSUM_CHECK_IP 1
  62. #define CHECKSUM_CHECK_UDP 1
  63. #define CHECKSUM_CHECK_TCP 1
  64. #define TCP_MSS (1460)
  65. #define TCP_SND_BUF (256 * TCP_MSS)
  66. #define TCP_SNDLOWAT (256)
  67. #define TCP_SND_QUEUELEN (512)
  68. #define TCP_WND ((1 << 16) - 1)
  69. #define PBUF_POOL_BUFSIZE (2048)
  70. /*
  71. * Include user defined options first. Anything not defined in these files
  72. * will be set to standard values. Override anything you dont like!
  73. */
  74. #include "lwip/debug.h"
  75. #define MEM_LIBC_MALLOC 1
  76. /*
  77. -----------------------------------------------
  78. ---------- Platform specific locking ----------
  79. -----------------------------------------------
  80. */
  81. /**
  82. * SYS_LIGHTWEIGHT_PROT==1: if you want inter-task protection for certain
  83. * critical regions during buffer allocation, deallocation and memory
  84. * allocation and deallocation.
  85. */
  86. #define SYS_LIGHTWEIGHT_PROT 0
  87. /**
  88. * NO_SYS==1: Provides VERY minimal functionality. Otherwise,
  89. * use lwIP facilities.
  90. */
  91. #define NO_SYS 1
  92. /*
  93. ------------------------------------
  94. ---------- Memory options ----------
  95. ------------------------------------
  96. */
  97. /**
  98. * MEM_ALIGNMENT: should be set to the alignment of the CPU
  99. * 4 byte alignment -> #define MEM_ALIGNMENT 4
  100. * 2 byte alignment -> #define MEM_ALIGNMENT 2
  101. */
  102. #define MEM_ALIGNMENT 4
  103. /**
  104. * MEM_SIZE: the size of the heap memory. If the application will send
  105. * a lot of data that needs to be copied, this should be set high.
  106. */
  107. #define MEM_SIZE (1 << 21)
  108. /*
  109. ------------------------------------------------
  110. ---------- Internal Memory Pool Sizes ----------
  111. ------------------------------------------------
  112. */
  113. /**
  114. * MEMP_NUM_PBUF: the number of memp struct pbufs (used for PBUF_ROM and PBUF_REF).
  115. * If the application sends a lot of data out of ROM (or other static memory),
  116. * this should be set high.
  117. */
  118. #define MEMP_NUM_PBUF 128
  119. /**
  120. * MEMP_NUM_RAW_PCB: Number of raw connection PCBs
  121. * (requires the LWIP_RAW option)
  122. */
  123. #define MEMP_NUM_RAW_PCB 64
  124. /**
  125. * MEMP_NUM_UDP_PCB: the number of UDP protocol control blocks. One
  126. * per active UDP "connection".
  127. * (requires the LWIP_UDP option)
  128. */
  129. #define MEMP_NUM_UDP_PCB 64
  130. /**
  131. * MEMP_NUM_TCP_PCB: the number of simulatenously active TCP connections.
  132. * (requires the LWIP_TCP option)
  133. */
  134. #define MEMP_NUM_TCP_PCB 64
  135. /**
  136. * MEMP_NUM_TCP_PCB_LISTEN: the number of listening TCP connections.
  137. * (requires the LWIP_TCP option)
  138. */
  139. #define MEMP_NUM_TCP_PCB_LISTEN 16
  140. /**
  141. * MEMP_NUM_TCP_SEG: the number of simultaneously queued TCP segments.
  142. * (requires the LWIP_TCP option)
  143. */
  144. #define MEMP_NUM_TCP_SEG 512
  145. /**
  146. * MEMP_NUM_REASSDATA: the number of simultaneously IP packets queued for
  147. * reassembly (whole packets, not fragments!)
  148. */
  149. #define MEMP_NUM_REASSDATA 4
  150. /**
  151. * MEMP_NUM_ARP_QUEUE: the number of simulateously queued outgoing
  152. * packets (pbufs) that are waiting for an ARP request (to resolve
  153. * their destination address) to finish.
  154. * (requires the ARP_QUEUEING option)
  155. */
  156. #define MEMP_NUM_ARP_QUEUE 4
  157. /**
  158. * MEMP_NUM_SYS_TIMEOUT: the number of simulateously active timeouts.
  159. * (requires NO_SYS==0)
  160. */
  161. #define MEMP_NUM_SYS_TIMEOUT 8
  162. /**
  163. * MEMP_NUM_NETBUF: the number of struct netbufs.
  164. * (only needed if you use the sequential API, like api_lib.c)
  165. */
  166. #define MEMP_NUM_NETBUF 128
  167. /**
  168. * MEMP_NUM_NETCONN: the number of struct netconns.
  169. * (only needed if you use the sequential API, like api_lib.c)
  170. */
  171. #define MEMP_NUM_NETCONN 32
  172. /**
  173. * MEMP_NUM_TCPIP_MSG_API: the number of struct tcpip_msg, which are used
  174. * for callback/timeout API communication.
  175. * (only needed if you use tcpip.c)
  176. */
  177. #define MEMP_NUM_TCPIP_MSG_API 256
  178. /**
  179. * MEMP_NUM_TCPIP_MSG_INPKT: the number of struct tcpip_msg, which are used
  180. * for incoming packets.
  181. * (only needed if you use tcpip.c)
  182. */
  183. #define MEMP_NUM_TCPIP_MSG_INPKT 256
  184. /**
  185. * PBUF_POOL_SIZE: the number of buffers in the pbuf pool.
  186. */
  187. #define PBUF_POOL_SIZE (1 << 10)
  188. /*
  189. ---------------------------------
  190. ---------- ARP options ----------
  191. ---------------------------------
  192. */
  193. /**
  194. * LWIP_ARP==1: Enable ARP functionality.
  195. */
  196. #define LWIP_ARP 1
  197. /*
  198. --------------------------------
  199. ---------- IP options ----------
  200. --------------------------------
  201. */
  202. /**
  203. * IP_FORWARD==1: Enables the ability to forward IP packets across network
  204. * interfaces. If you are going to run lwIP on a device with only one network
  205. * interface, define this to 0.
  206. */
  207. #define IP_FORWARD 0
  208. /**
  209. * IP_OPTIONS: Defines the behavior for IP options.
  210. * IP_OPTIONS_ALLOWED==0: All packets with IP options are dropped.
  211. * IP_OPTIONS_ALLOWED==1: IP options are allowed (but not parsed).
  212. */
  213. #define IP_OPTIONS_ALLOWED 1
  214. /**
  215. * IP_REASSEMBLY==1: Reassemble incoming fragmented IP packets. Note that
  216. * this option does not affect outgoing packet sizes, which can be controlled
  217. * via IP_FRAG.
  218. */
  219. #define IP_REASSEMBLY 1
  220. /**
  221. * IP_FRAG==1: Fragment outgoing IP packets if their size exceeds MTU. Note
  222. * that this option does not affect incoming packet sizes, which can be
  223. * controlled via IP_REASSEMBLY.
  224. */
  225. #define IP_FRAG 1
  226. /**
  227. * IP_REASS_MAXAGE: Maximum time (in multiples of IP_TMR_INTERVAL - so seconds, normally)
  228. * a fragmented IP packet waits for all fragments to arrive. If not all fragments arrived
  229. * in this time, the whole packet is discarded.
  230. */
  231. #define IP_REASS_MAXAGE 3
  232. /**
  233. * IP_REASS_MAX_PBUFS: Total maximum amount of pbufs waiting to be reassembled.
  234. * Since the received pbufs are enqueued, be sure to configure
  235. * PBUF_POOL_SIZE > IP_REASS_MAX_PBUFS so that the stack is still able to receive
  236. * packets even if the maximum amount of fragments is enqueued for reassembly!
  237. */
  238. #define IP_REASS_MAX_PBUFS 4
  239. /**
  240. * IP_FRAG_USES_STATIC_BUF==1: Use a static MTU-sized buffer for IP
  241. * fragmentation. Otherwise pbufs are allocated and reference the original
  242. * packet data to be fragmented.
  243. */
  244. #define IP_FRAG_USES_STATIC_BUF 1
  245. /**
  246. * IP_DEFAULT_TTL: Default value for Time-To-Live used by transport layers.
  247. */
  248. #define IP_DEFAULT_TTL 255
  249. /*
  250. ----------------------------------
  251. ---------- ICMP options ----------
  252. ----------------------------------
  253. */
  254. /**
  255. * LWIP_ICMP==1: Enable ICMP module inside the IP stack.
  256. * Be careful, disable that make your product non-compliant to RFC1122
  257. */
  258. #define LWIP_ICMP 1
  259. /*
  260. ---------------------------------
  261. ---------- RAW options ----------
  262. ---------------------------------
  263. */
  264. /**
  265. * LWIP_RAW==1: Enable application layer to hook into the IP layer itself.
  266. */
  267. #define LWIP_RAW 1
  268. /*
  269. ----------------------------------
  270. ---------- DHCP options ----------
  271. ----------------------------------
  272. */
  273. /**
  274. * LWIP_DHCP==1: Enable DHCP module.
  275. */
  276. #define LWIP_DHCP 0
  277. /*
  278. ------------------------------------
  279. ---------- AUTOIP options ----------
  280. ------------------------------------
  281. */
  282. /**
  283. * LWIP_AUTOIP==1: Enable AUTOIP module.
  284. */
  285. #define LWIP_AUTOIP 0
  286. /*
  287. ----------------------------------
  288. ---------- SNMP options ----------
  289. ----------------------------------
  290. */
  291. /**
  292. * LWIP_SNMP==1: Turn on SNMP module. UDP must be available for SNMP
  293. * transport.
  294. */
  295. #define LWIP_SNMP 0
  296. /*
  297. ----------------------------------
  298. ---------- IGMP options ----------
  299. ----------------------------------
  300. */
  301. /**
  302. * LWIP_IGMP==1: Turn on IGMP module.
  303. */
  304. #define LWIP_IGMP 0
  305. /*
  306. ----------------------------------
  307. ---------- DNS options -----------
  308. ----------------------------------
  309. */
  310. /**
  311. * LWIP_DNS==1: Turn on DNS module. UDP must be available for DNS
  312. * transport.
  313. */
  314. #define LWIP_DNS 1
  315. /*
  316. ---------------------------------
  317. ---------- UDP options ----------
  318. ---------------------------------
  319. */
  320. /**
  321. * LWIP_UDP==1: Turn on UDP.
  322. */
  323. #define LWIP_UDP 1
  324. /*
  325. ---------------------------------
  326. ---------- TCP options ----------
  327. ---------------------------------
  328. */
  329. /**
  330. * LWIP_TCP==1: Turn on TCP.
  331. */
  332. #define LWIP_TCP 1
  333. #define LWIP_LISTEN_BACKLOG 0
  334. /*
  335. ----------------------------------
  336. ---------- Pbuf options ----------
  337. ----------------------------------
  338. */
  339. /**
  340. * PBUF_LINK_HLEN: the number of bytes that should be allocated for a
  341. * link level header. The default is 14, the standard value for
  342. * Ethernet.
  343. */
  344. #define PBUF_LINK_HLEN 14
  345. /**
  346. * PBUF_POOL_BUFSIZE: the size of each pbuf in the pbuf pool. The default is
  347. * designed to accomodate single full size TCP frame in one pbuf, including
  348. * TCP_MSS, IP header, and link header.
  349. *
  350. */
  351. /*
  352. ------------------------------------
  353. ---------- LOOPIF options ----------
  354. ------------------------------------
  355. */
  356. /**
  357. * LWIP_HAVE_LOOPIF==1: Support loop interface (127.0.0.1) and loopif.c
  358. */
  359. #define LWIP_HAVE_LOOPIF 1
  360. /*
  361. ----------------------------------------------
  362. ---------- Sequential layer options ----------
  363. ----------------------------------------------
  364. */
  365. /**
  366. * LWIP_NETCONN==1: Enable Netconn API (require to use api_lib.c)
  367. */
  368. #define LWIP_NETCONN 0
  369. /*
  370. ------------------------------------
  371. ---------- Socket options ----------
  372. ------------------------------------
  373. */
  374. /**
  375. * LWIP_SOCKET==1: Enable Socket API (require to use sockets.c)
  376. */
  377. #define LWIP_SOCKET 0
  378. #define LWIP_COMPAT_SOCKETS 0
  379. /*
  380. ----------------------------------------
  381. ---------- Statistics options ----------
  382. ----------------------------------------
  383. */
  384. /**
  385. * LWIP_STATS==1: Enable statistics collection in lwip_stats.
  386. */
  387. #define LWIP_STATS 0
  388. /*
  389. ---------------------------------
  390. ---------- PPP options ----------
  391. ---------------------------------
  392. */
  393. /**
  394. * PPP_SUPPORT==1: Enable PPP.
  395. */
  396. #define PPP_SUPPORT 0
  397. /* Misc */
  398. #define LWIP_TIMEVAL_PRIVATE 0
  399. #endif /* __LWIPOPTS_H__ */