lwipopts.h 17 KB

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