lwipopts.h 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643
  1. #ifndef __LWIPOPTS_H__
  2. #define __LWIPOPTS_H__
  3. #include <rtconfig.h>
  4. #define LWIP_ERRNO_STDINCLUDE
  5. #define LWIP_IPV4 1
  6. #ifdef RT_USING_LWIP_IPV6
  7. #define LWIP_IPV6 1
  8. #else
  9. #define LWIP_IPV6 0
  10. #endif /* RT_USING_LWIP_IPV6 */
  11. #define NO_SYS 0
  12. #define LWIP_SOCKET 1
  13. #define LWIP_NETCONN 1
  14. #ifdef RT_LWIP_IGMP
  15. #define LWIP_IGMP 1
  16. #else
  17. #define LWIP_IGMP 0
  18. #endif
  19. #ifdef RT_LWIP_ICMP
  20. #define LWIP_ICMP 1
  21. #else
  22. #define LWIP_ICMP 0
  23. #endif
  24. #ifdef RT_LWIP_SNMP
  25. #define LWIP_SNMP 1
  26. #else
  27. #define LWIP_SNMP 0
  28. #endif
  29. #ifdef RT_LWIP_DNS
  30. #define LWIP_DNS 1
  31. #else
  32. #define LWIP_DNS 0
  33. #endif
  34. #define LWIP_HAVE_LOOPIF 0
  35. #define LWIP_PLATFORM_BYTESWAP 0
  36. #ifndef BYTE_ORDER
  37. #define BYTE_ORDER LITTLE_ENDIAN
  38. #endif
  39. /* #define RT_LWIP_DEBUG */
  40. #ifdef RT_LWIP_DEBUG
  41. #define LWIP_DEBUG
  42. #endif
  43. /* ---------- Debug options ---------- */
  44. #ifdef LWIP_DEBUG
  45. #ifdef RT_LWIP_SYS_DEBUG
  46. #define SYS_DEBUG LWIP_DBG_ON
  47. #else
  48. #define SYS_DEBUG LWIP_DBG_OFF
  49. #endif
  50. #ifdef RT_LWIP_ETHARP_DEBUG
  51. #define ETHARP_DEBUG LWIP_DBG_ON
  52. #else
  53. #define ETHARP_DEBUG LWIP_DBG_OFF
  54. #endif
  55. #ifdef RT_LWIP_PPP_DEBUG
  56. #define PPP_DEBUG LWIP_DBG_ON
  57. #else
  58. #define PPP_DEBUG LWIP_DBG_OFF
  59. #endif
  60. #ifdef RT_LWIP_MEM_DEBUG
  61. #define MEM_DEBUG LWIP_DBG_ON
  62. #else
  63. #define MEM_DEBUG LWIP_DBG_OFF
  64. #endif
  65. #ifdef RT_LWIP_MEMP_DEBUG
  66. #define MEMP_DEBUG LWIP_DBG_ON
  67. #else
  68. #define MEMP_DEBUG LWIP_DBG_OFF
  69. #endif
  70. #ifdef RT_LWIP_PBUF_DEBUG
  71. #define PBUF_DEBUG LWIP_DBG_ON
  72. #else
  73. #define PBUF_DEBUG LWIP_DBG_OFF
  74. #endif
  75. #ifdef RT_LWIP_API_LIB_DEBUG
  76. #define API_LIB_DEBUG LWIP_DBG_ON
  77. #else
  78. #define API_LIB_DEBUG LWIP_DBG_OFF
  79. #endif
  80. #ifdef RT_LWIP_API_MSG_DEBUG
  81. #define API_MSG_DEBUG LWIP_DBG_ON
  82. #else
  83. #define API_MSG_DEBUG LWIP_DBG_OFF
  84. #endif
  85. #ifdef RT_LWIP_TCPIP_DEBUG
  86. #define TCPIP_DEBUG LWIP_DBG_ON
  87. #else
  88. #define TCPIP_DEBUG LWIP_DBG_OFF
  89. #endif
  90. #ifdef RT_LWIP_NETIF_DEBUG
  91. #define NETIF_DEBUG LWIP_DBG_ON
  92. #else
  93. #define NETIF_DEBUG LWIP_DBG_OFF
  94. #endif
  95. #ifdef RT_LWIP_SOCKETS_DEBUG
  96. #define SOCKETS_DEBUG LWIP_DBG_ON
  97. #else
  98. #define SOCKETS_DEBUG LWIP_DBG_OFF
  99. #endif
  100. #ifdef RT_LWIP_DNS_DEBUG
  101. #define DNS_DEBUG LWIP_DBG_ON
  102. #else
  103. #define DNS_DEBUG LWIP_DBG_OFF
  104. #endif
  105. #ifdef RT_LWIP_AUTOIP_DEBUG
  106. #define AUTOIP_DEBUG LWIP_DBG_ON
  107. #else
  108. #define AUTOIP_DEBUG LWIP_DBG_OFF
  109. #endif
  110. #ifdef RT_LWIP_DHCP_DEBUG
  111. #define DHCP_DEBUG LWIP_DBG_ON
  112. #else
  113. #define DHCP_DEBUG LWIP_DBG_OFF
  114. #endif
  115. #ifdef RT_LWIP_IP_DEBUG
  116. #define IP_DEBUG LWIP_DBG_ON
  117. #else
  118. #define IP_DEBUG LWIP_DBG_OFF
  119. #endif
  120. #ifdef RT_LWIP_IP_REASS_DEBUG
  121. #define IP_REASS_DEBUG LWIP_DBG_ON
  122. #else
  123. #define IP_REASS_DEBUG LWIP_DBG_OFF
  124. #endif
  125. #ifdef RT_LWIP_ICMP_DEBUG
  126. #define ICMP_DEBUG LWIP_DBG_ON
  127. #else
  128. #define ICMP_DEBUG LWIP_DBG_OFF
  129. #endif
  130. #ifdef RT_LWIP_IGMP_DEBUG
  131. #define IGMP_DEBUG LWIP_DBG_ON
  132. #else
  133. #define IGMP_DEBUG LWIP_DBG_OFF
  134. #endif
  135. #ifdef RT_LWIP_UDP_DEBUG
  136. #define UDP_DEBUG LWIP_DBG_ON
  137. #else
  138. #define UDP_DEBUG LWIP_DBG_OFF
  139. #endif
  140. #ifdef RT_LWIP_TCP_DEBUG
  141. #define TCP_DEBUG LWIP_DBG_ON
  142. #else
  143. #define TCP_DEBUG LWIP_DBG_OFF
  144. #endif
  145. #ifdef RT_LWIP_TCP_INPUT_DEBUG
  146. #define TCP_INPUT_DEBUG LWIP_DBG_ON
  147. #else
  148. #define TCP_INPUT_DEBUG LWIP_DBG_OFF
  149. #endif
  150. #ifdef RT_LWIP_TCP_OUTPUT_DEBUG
  151. #define TCP_OUTPUT_DEBUG LWIP_DBG_ON
  152. #else
  153. #define TCP_OUTPUT_DEBUG LWIP_DBG_OFF
  154. #endif
  155. #ifdef RT_LWIP_TCP_RTO_DEBUG
  156. #define TCP_RTO_DEBUG LWIP_DBG_ON
  157. #else
  158. #define TCP_RTO_DEBUG LWIP_DBG_OFF
  159. #endif
  160. #ifdef RT_LWIP_TCP_CWND_DEBUG
  161. #define TCP_CWND_DEBUG LWIP_DBG_ON
  162. #else
  163. #define TCP_CWND_DEBUG LWIP_DBG_OFF
  164. #endif
  165. #ifdef RT_LWIP_TCP_WND_DEBUG
  166. #define TCP_WND_DEBUG LWIP_DBG_ON
  167. #else
  168. #define TCP_WND_DEBUG LWIP_DBG_OFF
  169. #endif
  170. #ifdef RT_LWIP_TCP_FR_DEBUG
  171. #define TCP_FR_DEBUG LWIP_DBG_ON
  172. #else
  173. #define TCP_FR_DEBUG LWIP_DBG_OFF
  174. #endif
  175. #ifdef RT_LWIP_TCP_QLEN_DEBUG
  176. #define TCP_QLEN_DEBUG LWIP_DBG_ON
  177. #else
  178. #define TCP_QLEN_DEBUG LWIP_DBG_OFF
  179. #endif
  180. #ifdef RT_LWIP_TCP_RST_DEBUG
  181. #define TCP_RST_DEBUG LWIP_DBG_ON
  182. #else
  183. #define TCP_RST_DEBUG LWIP_DBG_OFF
  184. #endif
  185. #endif /* LWIP_DEBUG */
  186. #define LWIP_DBG_TYPES_ON (LWIP_DBG_ON|LWIP_DBG_TRACE|LWIP_DBG_STATE|LWIP_DBG_FRESH|LWIP_DBG_HALT)
  187. /* ---------- Memory options ---------- */
  188. #ifdef RT_USING_ASM_MEMCPY
  189. #define MEMCPY(dst,src,len) rt_memcpy(dst,src,len)
  190. #else
  191. #define MEMCPY(dst,src,len) memcpy(dst,src,len)
  192. #endif /* RT_USING_ASM_MEMCPY */
  193. #define SMEMCPY(dst,src,len) MEMCPY(dst,src,len)
  194. #ifdef RT_LWIP_MEM_ALIGNMENT
  195. #define MEM_ALIGNMENT RT_LWIP_MEM_ALIGNMENT
  196. #else
  197. #define MEM_ALIGNMENT 4
  198. #endif
  199. #define MEMP_OVERFLOW_CHECK 1
  200. #define LWIP_ALLOW_MEM_FREE_FROM_OTHER_CONTEXT 1
  201. //#define MEM_LIBC_MALLOC 1
  202. //#define MEM_USE_POOLS 1
  203. //#define MEMP_USE_CUSTOM_POOLS 1
  204. //#define MEM_SIZE (1024*64)
  205. #define MEMP_MEM_MALLOC 0
  206. /* MEMP_NUM_PBUF: the number of memp struct pbufs. If the application
  207. sends a lot of data out of ROM (or other static memory), this
  208. should be set high. */
  209. #define MEMP_NUM_PBUF 32 //16
  210. /* the number of struct netconns */
  211. #ifdef RT_MEMP_NUM_NETCONN
  212. #define MEMP_NUM_NETCONN RT_MEMP_NUM_NETCONN
  213. #endif
  214. /* the number of UDP protocol control blocks. One per active RAW "connection". */
  215. #ifdef RT_LWIP_RAW_PCB_NUM
  216. #define MEMP_NUM_RAW_PCB RT_LWIP_RAW_PCB_NUM
  217. #endif
  218. /* the number of UDP protocol control blocks. One per active UDP "connection". */
  219. #ifdef RT_LWIP_UDP_PCB_NUM
  220. #define MEMP_NUM_UDP_PCB RT_LWIP_UDP_PCB_NUM
  221. #endif
  222. /* the number of simulatenously active TCP connections. */
  223. #ifdef RT_LWIP_TCP_PCB_NUM
  224. #define MEMP_NUM_TCP_PCB RT_LWIP_TCP_PCB_NUM
  225. #endif
  226. /* the number of simultaneously queued TCP */
  227. #ifdef RT_LWIP_TCP_SEG_NUM
  228. #define MEMP_NUM_TCP_SEG RT_LWIP_TCP_SEG_NUM
  229. #else
  230. #define MEMP_NUM_TCP_SEG TCP_SND_QUEUELEN
  231. #endif
  232. /*
  233. * You can re-define following setting in rtcofnig.h to overwrite the default
  234. * setting in the lwip opts.h
  235. */
  236. /* MEMP_NUM_NETBUF: the number of struct netbufs. */
  237. // #define MEMP_NUM_NETBUF 2
  238. /* MEMP_NUM_NETCONN: the number of struct netconns. */
  239. // #define MEMP_NUM_NETCONN 4
  240. /* MEMP_NUM_TCPIP_MSG_*: the number of struct tcpip_msg, which is used
  241. for sequential API communication and incoming packets. Used in
  242. src/api/tcpip.c. */
  243. // #define MEMP_NUM_TCPIP_MSG_API 16
  244. // #define MEMP_NUM_TCPIP_MSG_INPKT 16
  245. /* ---------- Pbuf options ---------- */
  246. /* PBUF_POOL_SIZE: the number of buffers in the pbuf pool. */
  247. #ifdef RT_LWIP_PBUF_NUM
  248. #define PBUF_POOL_SIZE RT_LWIP_PBUF_NUM
  249. #endif
  250. /* PBUF_POOL_BUFSIZE: the size of each pbuf in the pbuf pool. */
  251. #ifdef RT_LWIP_PBUF_POOL_BUFSIZE
  252. #define PBUF_POOL_BUFSIZE RT_LWIP_PBUF_POOL_BUFSIZE
  253. #endif
  254. /* PBUF_LINK_HLEN: the number of bytes that should be allocated for a
  255. link level header. */
  256. #define PBUF_LINK_HLEN 16
  257. #ifdef RT_LWIP_ETH_PAD_SIZE
  258. #define ETH_PAD_SIZE RT_LWIP_ETH_PAD_SIZE
  259. #endif
  260. /** SYS_LIGHTWEIGHT_PROT
  261. * define SYS_LIGHTWEIGHT_PROT in lwipopts.h if you want inter-task protection
  262. * for certain critical regions during buffer allocation, deallocation and memory
  263. * allocation and deallocation.
  264. */
  265. #define SYS_LIGHTWEIGHT_PROT (NO_SYS==0)
  266. #ifdef LWIP_USING_NAT
  267. #define IP_NAT 1
  268. #else
  269. #define IP_NAT 0
  270. #endif
  271. /* ---------- TCP options ---------- */
  272. #ifdef RT_LWIP_TCP
  273. #define LWIP_TCP 1
  274. #else
  275. #define LWIP_TCP 0
  276. #endif
  277. #define TCP_TTL 255
  278. /* Controls if TCP should queue segments that arrive out of
  279. order. Define to 0 if your device is low on memory. */
  280. #define TCP_QUEUE_OOSEQ 1
  281. /* TCP Maximum segment size. */
  282. #define TCP_MSS 1460
  283. /* TCP sender buffer space (bytes). */
  284. #ifdef RT_LWIP_TCP_SND_BUF
  285. #define TCP_SND_BUF RT_LWIP_TCP_SND_BUF
  286. #else
  287. #define TCP_SND_BUF (TCP_MSS * 2)
  288. #endif
  289. /* TCP sender buffer space (pbufs). This must be at least = 2 *
  290. TCP_SND_BUF/TCP_MSS for things to work. */
  291. #define TCP_SND_QUEUELEN (4 * TCP_SND_BUF/TCP_MSS)
  292. /* TCP writable space (bytes). This must be less than or equal
  293. to TCP_SND_BUF. It is the amount of space which must be
  294. available in the tcp snd_buf for select to return writable */
  295. #define TCP_SNDLOWAT (TCP_SND_BUF/2)
  296. #define TCP_SNDQUEUELOWAT TCP_SND_QUEUELEN/2
  297. /* TCP receive window. */
  298. #ifdef RT_LWIP_TCP_WND
  299. #define TCP_WND RT_LWIP_TCP_WND
  300. #else
  301. #define TCP_WND (TCP_MSS * 2)
  302. #endif
  303. /* Maximum number of retransmissions of data segments. */
  304. #define TCP_MAXRTX 12
  305. /* Maximum number of retransmissions of SYN segments. */
  306. #define TCP_SYNMAXRTX 4
  307. /* tcpip thread options */
  308. #ifdef RT_LWIP_TCPTHREAD_PRIORITY
  309. #define TCPIP_MBOX_SIZE RT_LWIP_TCPTHREAD_MBOX_SIZE
  310. #define TCPIP_THREAD_PRIO RT_LWIP_TCPTHREAD_PRIORITY
  311. #define TCPIP_THREAD_STACKSIZE RT_LWIP_TCPTHREAD_STACKSIZE
  312. #else
  313. #define TCPIP_MBOX_SIZE 8
  314. #define TCPIP_THREAD_PRIO 128
  315. #define TCPIP_THREAD_STACKSIZE 4096
  316. #endif
  317. #define TCPIP_THREAD_NAME "tcpip"
  318. #define DEFAULT_TCP_RECVMBOX_SIZE 10
  319. /* ---------- ARP options ---------- */
  320. #define LWIP_ARP 1
  321. #define ARP_TABLE_SIZE 10
  322. #define ARP_QUEUEING 1
  323. /* ---------- Checksum options ---------- */
  324. #ifdef RT_LWIP_USING_HW_CHECKSUM
  325. #define CHECKSUM_GEN_IP 0
  326. #define CHECKSUM_GEN_UDP 0
  327. #define CHECKSUM_GEN_TCP 0
  328. #define CHECKSUM_GEN_ICMP 0
  329. #define CHECKSUM_CHECK_IP 0
  330. #define CHECKSUM_CHECK_UDP 0
  331. #define CHECKSUM_CHECK_TCP 0
  332. #define CHECKSUM_CHECK_ICMP 0
  333. #endif
  334. /* ---------- IP options ---------- */
  335. /* Define IP_FORWARD to 1 if you wish to have the ability to forward
  336. IP packets across network interfaces. If you are going to run lwIP
  337. on a device with only one network interface, define this to 0. */
  338. #define IP_FORWARD 0
  339. /* IP reassembly and segmentation.These are orthogonal even
  340. * if they both deal with IP fragments */
  341. #ifdef RT_LWIP_REASSEMBLY_FRAG
  342. #define IP_REASSEMBLY 1
  343. #define IP_FRAG 1
  344. #define IP_REASS_MAX_PBUFS 10
  345. #define MEMP_NUM_REASSDATA 10
  346. #else
  347. #define IP_REASSEMBLY 0
  348. #define IP_FRAG 0
  349. #endif
  350. /* ---------- ICMP options ---------- */
  351. #define ICMP_TTL 255
  352. /* ---------- DHCP options ---------- */
  353. /* Define LWIP_DHCP to 1 if you want DHCP configuration of
  354. interfaces. */
  355. #ifdef RT_LWIP_DHCP
  356. #define LWIP_DHCP 1
  357. #else
  358. #define LWIP_DHCP 0
  359. #endif
  360. /* 1 if you want to do an ARP check on the offered address
  361. (recommended). */
  362. #define DHCP_DOES_ARP_CHECK (LWIP_DHCP)
  363. /* ---------- AUTOIP options ------- */
  364. #define LWIP_AUTOIP 0
  365. #define LWIP_DHCP_AUTOIP_COOP (LWIP_DHCP && LWIP_AUTOIP)
  366. /* ---------- UDP options ---------- */
  367. #ifdef RT_LWIP_UDP
  368. #define LWIP_UDP 1
  369. #else
  370. #define LWIP_UDP 0
  371. #endif
  372. #define LWIP_UDPLITE 0
  373. #define UDP_TTL 255
  374. #define DEFAULT_UDP_RECVMBOX_SIZE 1
  375. /* ---------- RAW options ---------- */
  376. #ifdef RT_LWIP_RAW
  377. #define LWIP_RAW 1
  378. #else
  379. #define LWIP_RAW 0
  380. #endif
  381. #define DEFAULT_RAW_RECVMBOX_SIZE 1
  382. #define DEFAULT_ACCEPTMBOX_SIZE 10
  383. /* ---------- Statistics options ---------- */
  384. #ifdef RT_LWIP_STATS
  385. #define LWIP_STATS 1
  386. #define LWIP_STATS_DISPLAY 1
  387. #else
  388. #define LWIP_STATS 0
  389. #endif
  390. #if LWIP_STATS
  391. #define LINK_STATS 1
  392. #define IP_STATS 1
  393. #define ICMP_STATS 1
  394. #define IGMP_STATS 1
  395. #define IPFRAG_STATS 1
  396. #define UDP_STATS 1
  397. #define TCP_STATS 1
  398. #define MEM_STATS 1
  399. #define MEMP_STATS 1
  400. #define PBUF_STATS 1
  401. #define SYS_STATS 1
  402. #define MIB2_STATS 1
  403. #endif /* LWIP_STATS */
  404. /* ---------- PPP options ---------- */
  405. #ifdef RT_LWIP_PPP
  406. #define PPP_SUPPORT 1 /* Set > 0 for PPP */
  407. #else
  408. #define PPP_SUPPORT 0 /* Set > 0 for PPP */
  409. #endif
  410. #if PPP_SUPPORT
  411. #define NUM_PPP 1 /* Max PPP sessions. */
  412. /* Select modules to enable. Ideally these would be set in the makefile but
  413. * we're limited by the command line length so you need to modify the settings
  414. * in this file.
  415. */
  416. #ifdef RT_LWIP_PPPOE
  417. #define PPPOE_SUPPORT 1
  418. #else
  419. #define PPPOE_SUPPORT 0
  420. #endif
  421. #ifdef RT_LWIP_PPPOS
  422. #define PPPOS_SUPPORT 1
  423. #else
  424. #define PPPOS_SUPPORT 0
  425. #endif
  426. #define PAP_SUPPORT 1 /* Set > 0 for PAP. */
  427. #define CHAP_SUPPORT 1 /* Set > 0 for CHAP. */
  428. #define MSCHAP_SUPPORT 0 /* Set > 0 for MSCHAP (NOT FUNCTIONAL!) */
  429. #define CBCP_SUPPORT 0 /* Set > 0 for CBCP (NOT FUNCTIONAL!) */
  430. #define CCP_SUPPORT 0 /* Set > 0 for CCP (NOT FUNCTIONAL!) */
  431. #define VJ_SUPPORT 1 /* Set > 0 for VJ header compression. */
  432. #define MD5_SUPPORT 1 /* Set > 0 for MD5 (see also CHAP) */
  433. #endif /* PPP_SUPPORT */
  434. /**
  435. * LWIP_POSIX_SOCKETS_IO_NAMES==1: Enable POSIX-style sockets functions names.
  436. * Disable this option if you use a POSIX operating system that uses the same
  437. * names (read, write & close). (only used if you use sockets.c)
  438. */
  439. #ifndef LWIP_POSIX_SOCKETS_IO_NAMES
  440. #define LWIP_POSIX_SOCKETS_IO_NAMES 0
  441. #endif
  442. /**
  443. * LWIP_TCP_KEEPALIVE==1: Enable TCP_KEEPIDLE, TCP_KEEPINTVL and TCP_KEEPCNT
  444. * options processing. Note that TCP_KEEPIDLE and TCP_KEEPINTVL have to be set
  445. * in seconds. (does not require sockets.c, and will affect tcp.c)
  446. */
  447. #ifndef LWIP_TCP_KEEPALIVE
  448. #define LWIP_TCP_KEEPALIVE 1
  449. #endif
  450. /**
  451. * LWIP_NETIF_HOSTNAME==1: Support netif hostname
  452. */
  453. #ifndef LWIP_NETIF_HOSTNAME
  454. #define LWIP_NETIF_HOSTNAME 1
  455. #endif
  456. /**
  457. * LWIP_NETIF_API==1: Support netif api (in netifapi.c)
  458. */
  459. #ifndef LWIP_NETIF_API
  460. #define LWIP_NETIF_API 1
  461. #endif
  462. #ifdef LWIP_IGMP
  463. #include <stdlib.h>
  464. #define LWIP_RAND rand
  465. #endif
  466. /*
  467. ------------------------------------
  468. ---------- Socket options ----------
  469. ------------------------------------
  470. */
  471. /*
  472. * LWIP_SOCKET==1: Enable Socket API (require to use sockets.c)
  473. */
  474. #ifndef LWIP_SOCKET
  475. #define LWIP_SOCKET 1
  476. #endif
  477. /*
  478. * LWIP_COMPAT_SOCKETS==1: Enable BSD-style sockets functions names.
  479. * (only used if you use sockets.c)
  480. */
  481. #ifdef SAL_USING_POSIX
  482. #define LWIP_COMPAT_SOCKETS 0
  483. #else
  484. #ifndef LWIP_COMPAT_SOCKETS
  485. #define LWIP_COMPAT_SOCKETS 1
  486. #endif
  487. #endif
  488. /**
  489. * LWIP_SO_SNDTIMEO==1: Enable send timeout for sockets/netconns and
  490. * SO_SNDTIMEO processing.
  491. */
  492. #ifndef LWIP_SO_SNDTIMEO
  493. #define LWIP_SO_SNDTIMEO 1
  494. #endif
  495. /**
  496. * LWIP_SO_RCVTIMEO==1: Enable receive timeout for sockets/netconns and
  497. * SO_RCVTIMEO processing.
  498. */
  499. #ifndef LWIP_SO_RCVTIMEO
  500. #define LWIP_SO_RCVTIMEO 1
  501. #endif
  502. /**
  503. * LWIP_SO_RCVBUF==1: Enable SO_RCVBUF processing.
  504. */
  505. #ifndef LWIP_SO_RCVBUF
  506. #define LWIP_SO_RCVBUF 1
  507. #endif
  508. /**
  509. * If LWIP_SO_RCVBUF is used, this is the default value for recv_bufsize.
  510. */
  511. #ifndef RECV_BUFSIZE_DEFAULT
  512. #define RECV_BUFSIZE_DEFAULT 8192
  513. #endif
  514. /**
  515. * SO_REUSE==1: Enable SO_REUSEADDR option.
  516. */
  517. #ifndef SO_REUSE
  518. #define SO_REUSE 0
  519. #endif
  520. /*
  521. ------------------------------------
  522. ------- Applications options -------
  523. ------------------------------------
  524. */
  525. /**
  526. * Max. length of TFTP filename
  527. */
  528. #ifdef RT_LWIP_TFTP_MAX_FILENAME_LEN
  529. #define TFTP_MAX_FILENAME_LEN RT_LWIP_TFTP_MAX_FILENAME_LEN
  530. #elif defined(RT_DFS_ELM_MAX_LFN)
  531. #define TFTP_MAX_FILENAME_LEN RT_DFS_ELM_MAX_LFN
  532. #else
  533. #define TFTP_MAX_FILENAME_LEN 64
  534. #endif
  535. #endif /* __LWIPOPTS_H__ */