lwipopts.h 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636
  1. #ifndef __LWIPOPTS_H__
  2. #define __LWIPOPTS_H__
  3. #include <rtconfig.h>
  4. #define ERRNO 1
  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_LWIP_MEM_ALIGNMENT
  189. #define MEM_ALIGNMENT RT_LWIP_MEM_ALIGNMENT
  190. #else
  191. #define MEM_ALIGNMENT 4
  192. #endif
  193. #define MEMP_OVERFLOW_CHECK 1 ////
  194. #define LWIP_ALLOW_MEM_FREE_FROM_OTHER_CONTEXT 1 ////
  195. //#define MEM_LIBC_MALLOC 1
  196. //#define MEM_USE_POOLS 1
  197. //#define MEMP_USE_CUSTOM_POOLS 1
  198. //#define MEM_SIZE (1024*64)
  199. #define MEMP_MEM_MALLOC 0
  200. /* MEMP_NUM_PBUF: the number of memp struct pbufs. If the application
  201. sends a lot of data out of ROM (or other static memory), this
  202. should be set high. */
  203. #define MEMP_NUM_PBUF 32 //16
  204. /* the number of struct netconns */
  205. #ifdef RT_MEMP_NUM_NETCONN
  206. #define MEMP_NUM_NETCONN RT_MEMP_NUM_NETCONN
  207. #endif
  208. /* the number of UDP protocol control blocks. One per active RAW "connection". */
  209. #ifdef RT_LWIP_RAW_PCB_NUM
  210. #define MEMP_NUM_RAW_PCB RT_LWIP_RAW_PCB_NUM
  211. #endif
  212. /* the number of UDP protocol control blocks. One per active UDP "connection". */
  213. #ifdef RT_LWIP_UDP_PCB_NUM
  214. #define MEMP_NUM_UDP_PCB RT_LWIP_UDP_PCB_NUM
  215. #endif
  216. /* the number of simulatenously active TCP connections. */
  217. #ifdef RT_LWIP_TCP_PCB_NUM
  218. #define MEMP_NUM_TCP_PCB RT_LWIP_TCP_PCB_NUM
  219. #endif
  220. /* the number of simultaneously queued TCP */
  221. #ifdef RT_LWIP_TCP_SEG_NUM
  222. #define MEMP_NUM_TCP_SEG RT_LWIP_TCP_SEG_NUM
  223. #else
  224. #define MEMP_NUM_TCP_SEG TCP_SND_QUEUELEN
  225. #endif
  226. /*
  227. * You can re-define following setting in rtcofnig.h to overwrite the default
  228. * setting in the lwip opts.h
  229. */
  230. /* MEMP_NUM_NETBUF: the number of struct netbufs. */
  231. // #define MEMP_NUM_NETBUF 2
  232. /* MEMP_NUM_NETCONN: the number of struct netconns. */
  233. // #define MEMP_NUM_NETCONN 4
  234. /* MEMP_NUM_TCPIP_MSG_*: the number of struct tcpip_msg, which is used
  235. for sequential API communication and incoming packets. Used in
  236. src/api/tcpip.c. */
  237. // #define MEMP_NUM_TCPIP_MSG_API 16
  238. // #define MEMP_NUM_TCPIP_MSG_INPKT 16
  239. /* ---------- Pbuf options ---------- */
  240. /* PBUF_POOL_SIZE: the number of buffers in the pbuf pool. */
  241. #ifdef RT_LWIP_PBUF_NUM
  242. #define PBUF_POOL_SIZE RT_LWIP_PBUF_NUM
  243. #endif
  244. /* PBUF_POOL_BUFSIZE: the size of each pbuf in the pbuf pool. */
  245. #ifdef RT_LWIP_PBUF_POOL_BUFSIZE
  246. #define PBUF_POOL_BUFSIZE RT_LWIP_PBUF_POOL_BUFSIZE
  247. #endif
  248. /* PBUF_LINK_HLEN: the number of bytes that should be allocated for a
  249. link level header. */
  250. #define PBUF_LINK_HLEN 16
  251. #ifdef RT_LWIP_ETH_PAD_SIZE
  252. #define ETH_PAD_SIZE RT_LWIP_ETH_PAD_SIZE
  253. #endif
  254. /** SYS_LIGHTWEIGHT_PROT
  255. * define SYS_LIGHTWEIGHT_PROT in lwipopts.h if you want inter-task protection
  256. * for certain critical regions during buffer allocation, deallocation and memory
  257. * allocation and deallocation.
  258. */
  259. #define SYS_LIGHTWEIGHT_PROT (NO_SYS==0)
  260. #ifdef LWIP_USING_NAT
  261. #define IP_NAT 1
  262. #else
  263. #define IP_NAT 0
  264. #endif
  265. /* ---------- TCP options ---------- */
  266. #ifdef RT_LWIP_TCP
  267. #define LWIP_TCP 1
  268. #else
  269. #define LWIP_TCP 0
  270. #endif
  271. #define TCP_TTL 255
  272. /* Controls if TCP should queue segments that arrive out of
  273. order. Define to 0 if your device is low on memory. */
  274. #define TCP_QUEUE_OOSEQ 1
  275. /* TCP Maximum segment size. */
  276. #define TCP_MSS 1460
  277. /* TCP sender buffer space (bytes). */
  278. #ifdef RT_LWIP_TCP_SND_BUF
  279. #define TCP_SND_BUF RT_LWIP_TCP_SND_BUF
  280. #else
  281. #define TCP_SND_BUF (TCP_MSS * 2)
  282. #endif
  283. /* TCP sender buffer space (pbufs). This must be at least = 2 *
  284. TCP_SND_BUF/TCP_MSS for things to work. */
  285. #define TCP_SND_QUEUELEN (4 * TCP_SND_BUF/TCP_MSS)
  286. /* TCP writable space (bytes). This must be less than or equal
  287. to TCP_SND_BUF. It is the amount of space which must be
  288. available in the tcp snd_buf for select to return writable */
  289. #define TCP_SNDLOWAT (TCP_SND_BUF/2)
  290. #define TCP_SNDQUEUELOWAT TCP_SND_QUEUELEN/2
  291. /* TCP receive window. */
  292. #ifdef RT_LWIP_TCP_WND
  293. #define TCP_WND RT_LWIP_TCP_WND
  294. #else
  295. #define TCP_WND (TCP_MSS * 2)
  296. #endif
  297. /* Maximum number of retransmissions of data segments. */
  298. #define TCP_MAXRTX 12
  299. /* Maximum number of retransmissions of SYN segments. */
  300. #define TCP_SYNMAXRTX 4
  301. /* tcpip thread options */
  302. #ifdef RT_LWIP_TCPTHREAD_PRIORITY
  303. #define TCPIP_MBOX_SIZE RT_LWIP_TCPTHREAD_MBOX_SIZE
  304. #define TCPIP_THREAD_PRIO RT_LWIP_TCPTHREAD_PRIORITY
  305. #define TCPIP_THREAD_STACKSIZE RT_LWIP_TCPTHREAD_STACKSIZE
  306. #else
  307. #define TCPIP_MBOX_SIZE 8
  308. #define TCPIP_THREAD_PRIO 128
  309. #define TCPIP_THREAD_STACKSIZE 4096
  310. #endif
  311. #define TCPIP_THREAD_NAME "tcpip"
  312. #define DEFAULT_TCP_RECVMBOX_SIZE 10
  313. /* ---------- ARP options ---------- */
  314. #define LWIP_ARP 1
  315. #define ARP_TABLE_SIZE 10
  316. #define ARP_QUEUEING 1
  317. /* ---------- Checksum options ---------- */
  318. #ifdef RT_LWIP_USING_HW_CHECKSUM
  319. #define CHECKSUM_GEN_IP 0
  320. #define CHECKSUM_GEN_UDP 0
  321. #define CHECKSUM_GEN_TCP 0
  322. #define CHECKSUM_GEN_ICMP 0
  323. #define CHECKSUM_CHECK_IP 0
  324. #define CHECKSUM_CHECK_UDP 0
  325. #define CHECKSUM_CHECK_TCP 0
  326. #define CHECKSUM_CHECK_ICMP 0
  327. #endif
  328. /* ---------- IP options ---------- */
  329. /* Define IP_FORWARD to 1 if you wish to have the ability to forward
  330. IP packets across network interfaces. If you are going to run lwIP
  331. on a device with only one network interface, define this to 0. */
  332. #define IP_FORWARD 0
  333. /* IP reassembly and segmentation.These are orthogonal even
  334. * if they both deal with IP fragments */
  335. #ifdef RT_LWIP_REASSEMBLY_FRAG
  336. #define IP_REASSEMBLY 1
  337. #define IP_FRAG 1
  338. #define IP_REASS_MAX_PBUFS 10
  339. #define MEMP_NUM_REASSDATA 10
  340. #else
  341. #define IP_REASSEMBLY 0
  342. #define IP_FRAG 0
  343. #endif
  344. /* ---------- ICMP options ---------- */
  345. #define ICMP_TTL 255
  346. /* ---------- DHCP options ---------- */
  347. /* Define LWIP_DHCP to 1 if you want DHCP configuration of
  348. interfaces. */
  349. #ifdef RT_LWIP_DHCP
  350. #define LWIP_DHCP 1
  351. #else
  352. #define LWIP_DHCP 0
  353. #endif
  354. /* 1 if you want to do an ARP check on the offered address
  355. (recommended). */
  356. #define DHCP_DOES_ARP_CHECK (LWIP_DHCP)
  357. /* ---------- AUTOIP options ------- */
  358. #define LWIP_AUTOIP 0
  359. #define LWIP_DHCP_AUTOIP_COOP (LWIP_DHCP && LWIP_AUTOIP)
  360. /* ---------- UDP options ---------- */
  361. #ifdef RT_LWIP_UDP
  362. #define LWIP_UDP 1
  363. #else
  364. #define LWIP_UDP 0
  365. #endif
  366. #define LWIP_UDPLITE 0
  367. #define UDP_TTL 255
  368. #define DEFAULT_UDP_RECVMBOX_SIZE 1
  369. /* ---------- RAW options ---------- */
  370. #ifdef RT_LWIP_RAW
  371. #define LWIP_RAW 1
  372. #else
  373. #define LWIP_RAW 0
  374. #endif
  375. #define DEFAULT_RAW_RECVMBOX_SIZE 1
  376. #define DEFAULT_ACCEPTMBOX_SIZE 10
  377. /* ---------- Statistics options ---------- */
  378. #ifdef RT_LWIP_STATS
  379. #define LWIP_STATS 1
  380. #define LWIP_STATS_DISPLAY 1
  381. #else
  382. #define LWIP_STATS 0
  383. #endif
  384. #if LWIP_STATS
  385. #define LINK_STATS 1
  386. #define IP_STATS 1
  387. #define ICMP_STATS 1
  388. #define IGMP_STATS 1
  389. #define IPFRAG_STATS 1
  390. #define UDP_STATS 1
  391. #define TCP_STATS 1
  392. #define MEM_STATS 1
  393. #define MEMP_STATS 1
  394. #define PBUF_STATS 1
  395. #define SYS_STATS 1
  396. #define MIB2_STATS 1
  397. #endif /* LWIP_STATS */
  398. /* ---------- PPP options ---------- */
  399. #ifdef RT_LWIP_PPP
  400. #define PPP_SUPPORT 1 /* Set > 0 for PPP */
  401. #else
  402. #define PPP_SUPPORT 0 /* Set > 0 for PPP */
  403. #endif
  404. #if PPP_SUPPORT
  405. #define NUM_PPP 1 /* Max PPP sessions. */
  406. /* Select modules to enable. Ideally these would be set in the makefile but
  407. * we're limited by the command line length so you need to modify the settings
  408. * in this file.
  409. */
  410. #ifdef RT_LWIP_PPPOE
  411. #define PPPOE_SUPPORT 1
  412. #else
  413. #define PPPOE_SUPPORT 0
  414. #endif
  415. #ifdef RT_LWIP_PPPOS
  416. #define PPPOS_SUPPORT 1
  417. #else
  418. #define PPPOS_SUPPORT 0
  419. #endif
  420. #define PAP_SUPPORT 1 /* Set > 0 for PAP. */
  421. #define CHAP_SUPPORT 1 /* Set > 0 for CHAP. */
  422. #define MSCHAP_SUPPORT 0 /* Set > 0 for MSCHAP (NOT FUNCTIONAL!) */
  423. #define CBCP_SUPPORT 0 /* Set > 0 for CBCP (NOT FUNCTIONAL!) */
  424. #define CCP_SUPPORT 0 /* Set > 0 for CCP (NOT FUNCTIONAL!) */
  425. #define VJ_SUPPORT 1 /* Set > 0 for VJ header compression. */
  426. #define MD5_SUPPORT 1 /* Set > 0 for MD5 (see also CHAP) */
  427. #endif /* PPP_SUPPORT */
  428. /**
  429. * LWIP_POSIX_SOCKETS_IO_NAMES==1: Enable POSIX-style sockets functions names.
  430. * Disable this option if you use a POSIX operating system that uses the same
  431. * names (read, write & close). (only used if you use sockets.c)
  432. */
  433. #ifndef LWIP_POSIX_SOCKETS_IO_NAMES
  434. #define LWIP_POSIX_SOCKETS_IO_NAMES 0
  435. #endif
  436. /**
  437. * LWIP_TCP_KEEPALIVE==1: Enable TCP_KEEPIDLE, TCP_KEEPINTVL and TCP_KEEPCNT
  438. * options processing. Note that TCP_KEEPIDLE and TCP_KEEPINTVL have to be set
  439. * in seconds. (does not require sockets.c, and will affect tcp.c)
  440. */
  441. #ifndef LWIP_TCP_KEEPALIVE
  442. #define LWIP_TCP_KEEPALIVE 1
  443. #endif
  444. /**
  445. * LWIP_NETIF_HOSTNAME==1: Support netif hostname
  446. */
  447. #ifndef LWIP_NETIF_HOSTNAME
  448. #define LWIP_NETIF_HOSTNAME 1
  449. #endif
  450. /**
  451. * LWIP_NETIF_API==1: Support netif api (in netifapi.c)
  452. */
  453. #ifndef LWIP_NETIF_API
  454. #define LWIP_NETIF_API 1
  455. #endif
  456. #ifdef LWIP_IGMP
  457. #include <stdlib.h>
  458. #define LWIP_RAND rand
  459. #endif
  460. /*
  461. ------------------------------------
  462. ---------- Socket options ----------
  463. ------------------------------------
  464. */
  465. /*
  466. * LWIP_SOCKET==1: Enable Socket API (require to use sockets.c)
  467. */
  468. #ifndef LWIP_SOCKET
  469. #define LWIP_SOCKET 1
  470. #endif
  471. /*
  472. * LWIP_COMPAT_SOCKETS==1: Enable BSD-style sockets functions names.
  473. * (only used if you use sockets.c)
  474. */
  475. #ifdef SAL_USING_POSIX
  476. #define LWIP_COMPAT_SOCKETS 0
  477. #else
  478. #ifndef LWIP_COMPAT_SOCKETS
  479. #define LWIP_COMPAT_SOCKETS 1
  480. #endif
  481. #endif
  482. /**
  483. * LWIP_SO_SNDTIMEO==1: Enable send timeout for sockets/netconns and
  484. * SO_SNDTIMEO processing.
  485. */
  486. #ifndef LWIP_SO_SNDTIMEO
  487. #define LWIP_SO_SNDTIMEO 1
  488. #endif
  489. /**
  490. * LWIP_SO_RCVTIMEO==1: Enable receive timeout for sockets/netconns and
  491. * SO_RCVTIMEO processing.
  492. */
  493. #ifndef LWIP_SO_RCVTIMEO
  494. #define LWIP_SO_RCVTIMEO 1
  495. #endif
  496. /**
  497. * LWIP_SO_RCVBUF==1: Enable SO_RCVBUF processing.
  498. */
  499. #ifndef LWIP_SO_RCVBUF
  500. #define LWIP_SO_RCVBUF 1
  501. #endif
  502. /**
  503. * If LWIP_SO_RCVBUF is used, this is the default value for recv_bufsize.
  504. */
  505. #ifndef RECV_BUFSIZE_DEFAULT
  506. #define RECV_BUFSIZE_DEFAULT 8192
  507. #endif
  508. /**
  509. * SO_REUSE==1: Enable SO_REUSEADDR option.
  510. */
  511. #ifndef SO_REUSE
  512. #define SO_REUSE 0
  513. #endif
  514. /*
  515. ------------------------------------
  516. ------- Applications options -------
  517. ------------------------------------
  518. */
  519. /**
  520. * Max. length of TFTP filename
  521. */
  522. #ifdef RT_LWIP_TFTP_MAX_FILENAME_LEN
  523. #define TFTP_MAX_FILENAME_LEN RT_LWIP_TFTP_MAX_FILENAME_LEN
  524. #elif defined(RT_DFS_ELM_MAX_LFN)
  525. #define TFTP_MAX_FILENAME_LEN RT_DFS_ELM_MAX_LFN
  526. #else
  527. #define TFTP_MAX_FILENAME_LEN 64
  528. #endif
  529. #endif /* __LWIPOPTS_H__ */