lwipopts.h 55 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077
  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. -----------------------------------------------
  41. ---------- Platform specific locking ----------
  42. -----------------------------------------------
  43. */
  44. /**
  45. * SYS_LIGHTWEIGHT_PROT==1: if you want inter-task protection for certain
  46. * critical regions during buffer allocation, deallocation and memory
  47. * allocation and deallocation.
  48. */
  49. #ifndef SYS_LIGHTWEIGHT_PROT
  50. #define SYS_LIGHTWEIGHT_PROT 0
  51. #endif
  52. /**
  53. * NO_SYS==1: Provides VERY minimal functionality. Otherwise,
  54. * use lwIP facilities.
  55. */
  56. #ifndef NO_SYS
  57. #define NO_SYS 1
  58. #endif
  59. /**
  60. * NO_SYS_NO_TIMERS==1: Drop support for sys_timeout when NO_SYS==1
  61. * Mainly for compatibility to old versions.
  62. */
  63. #ifndef NO_SYS_NO_TIMERS
  64. #define NO_SYS_NO_TIMERS 0
  65. #endif
  66. /**
  67. * MEMCPY: override this if you have a faster implementation at hand than the
  68. * one included in your C library
  69. */
  70. #ifndef MEMCPY
  71. #define MEMCPY(dst,src,len) os_memcpy(dst,src,len)
  72. #endif
  73. /**
  74. * SMEMCPY: override this with care! Some compilers (e.g. gcc) can inline a
  75. * call to memcpy() if the length is known at compile time and is small.
  76. */
  77. #ifndef SMEMCPY
  78. #define SMEMCPY(dst,src,len) os_memcpy(dst,src,len)
  79. #endif
  80. /*
  81. ------------------------------------
  82. ---------- Memory options ----------
  83. ------------------------------------
  84. */
  85. /**
  86. * MEM_LIBC_MALLOC==1: Use malloc/free/realloc provided by your C-library
  87. * instead of the lwip internal allocator. Can save code size if you
  88. * already use it.
  89. */
  90. #ifndef MEM_LIBC_MALLOC
  91. #define MEM_LIBC_MALLOC 1
  92. #endif
  93. /**
  94. * MEMP_MEM_MALLOC==1: Use mem_malloc/mem_free instead of the lwip pool allocator.
  95. * Especially useful with MEM_LIBC_MALLOC but handle with care regarding execution
  96. * speed and usage from interrupts!
  97. */
  98. #ifndef MEMP_MEM_MALLOC
  99. #define MEMP_MEM_MALLOC 1
  100. #endif
  101. /**
  102. * MEM_ALIGNMENT: should be set to the alignment of the CPU
  103. * 4 byte alignment -> #define MEM_ALIGNMENT 4
  104. * 2 byte alignment -> #define MEM_ALIGNMENT 2
  105. */
  106. #ifndef MEM_ALIGNMENT
  107. #define MEM_ALIGNMENT 4
  108. #endif
  109. /**
  110. * MEM_SIZE: the size of the heap memory. If the application will send
  111. * a lot of data that needs to be copied, this should be set high.
  112. */
  113. #ifndef MEM_SIZE
  114. #define MEM_SIZE 16000
  115. #endif
  116. /**
  117. * MEMP_SEPARATE_POOLS: if defined to 1, each pool is placed in its own array.
  118. * This can be used to individually change the location of each pool.
  119. * Default is one big array for all pools
  120. */
  121. #ifndef MEMP_SEPARATE_POOLS
  122. #define MEMP_SEPARATE_POOLS 1
  123. #endif
  124. /**
  125. * MEMP_OVERFLOW_CHECK: memp overflow protection reserves a configurable
  126. * amount of bytes before and after each memp element in every pool and fills
  127. * it with a prominent default value.
  128. * MEMP_OVERFLOW_CHECK == 0 no checking
  129. * MEMP_OVERFLOW_CHECK == 1 checks each element when it is freed
  130. * MEMP_OVERFLOW_CHECK >= 2 checks each element in every pool every time
  131. * memp_malloc() or memp_free() is called (useful but slow!)
  132. */
  133. #ifndef MEMP_OVERFLOW_CHECK
  134. #define MEMP_OVERFLOW_CHECK 0
  135. #endif
  136. /**
  137. * MEMP_SANITY_CHECK==1: run a sanity check after each memp_free() to make
  138. * sure that there are no cycles in the linked lists.
  139. */
  140. #ifndef MEMP_SANITY_CHECK
  141. #define MEMP_SANITY_CHECK 1
  142. #endif
  143. /**
  144. * MEM_USE_POOLS==1: Use an alternative to malloc() by allocating from a set
  145. * of memory pools of various sizes. When mem_malloc is called, an element of
  146. * the smallest pool that can provide the length needed is returned.
  147. * To use this, MEMP_USE_CUSTOM_POOLS also has to be enabled.
  148. */
  149. #ifndef MEM_USE_POOLS
  150. #define MEM_USE_POOLS 0
  151. #endif
  152. /**
  153. * MEM_USE_POOLS_TRY_BIGGER_POOL==1: if one malloc-pool is empty, try the next
  154. * bigger pool - WARNING: THIS MIGHT WASTE MEMORY but it can make a system more
  155. * reliable. */
  156. #ifndef MEM_USE_POOLS_TRY_BIGGER_POOL
  157. #define MEM_USE_POOLS_TRY_BIGGER_POOL 0
  158. #endif
  159. /**
  160. * MEMP_USE_CUSTOM_POOLS==1: whether to include a user file lwippools.h
  161. * that defines additional pools beyond the "standard" ones required
  162. * by lwIP. If you set this to 1, you must have lwippools.h in your
  163. * inlude path somewhere.
  164. */
  165. #ifndef MEMP_USE_CUSTOM_POOLS
  166. #define MEMP_USE_CUSTOM_POOLS 0
  167. #endif
  168. /**
  169. * Set this to 1 if you want to free PBUF_RAM pbufs (or call mem_free()) from
  170. * interrupt context (or another context that doesn't allow waiting for a
  171. * semaphore).
  172. * If set to 1, mem_malloc will be protected by a semaphore and SYS_ARCH_PROTECT,
  173. * while mem_free will only use SYS_ARCH_PROTECT. mem_malloc SYS_ARCH_UNPROTECTs
  174. * with each loop so that mem_free can run.
  175. *
  176. * ATTENTION: As you can see from the above description, this leads to dis-/
  177. * enabling interrupts often, which can be slow! Also, on low memory, mem_malloc
  178. * can need longer.
  179. *
  180. * If you don't want that, at least for NO_SYS=0, you can still use the following
  181. * functions to enqueue a deallocation call which then runs in the tcpip_thread
  182. * context:
  183. * - pbuf_free_callback(p);
  184. * - mem_free_callback(m);
  185. */
  186. #ifndef LWIP_ALLOW_MEM_FREE_FROM_OTHER_CONTEXT
  187. #define LWIP_ALLOW_MEM_FREE_FROM_OTHER_CONTEXT 0
  188. #endif
  189. /*
  190. ------------------------------------------------
  191. ---------- Internal Memory Pool Sizes ----------
  192. ------------------------------------------------
  193. */
  194. /**
  195. * MEMP_NUM_PBUF: the number of memp struct pbufs (used for PBUF_ROM and PBUF_REF).
  196. * If the application sends a lot of data out of ROM (or other static memory),
  197. * this should be set high.
  198. */
  199. #ifndef MEMP_NUM_PBUF
  200. #define MEMP_NUM_PBUF 10
  201. #endif
  202. /**
  203. * MEMP_NUM_RAW_PCB: Number of raw connection PCBs
  204. * (requires the LWIP_RAW option)
  205. */
  206. #ifndef MEMP_NUM_RAW_PCB
  207. #define MEMP_NUM_RAW_PCB 4
  208. #endif
  209. /**
  210. * MEMP_NUM_UDP_PCB: the number of UDP protocol control blocks. One
  211. * per active UDP "connection".
  212. * (requires the LWIP_UDP option)
  213. */
  214. #ifndef MEMP_NUM_UDP_PCB
  215. #define MEMP_NUM_UDP_PCB 4
  216. #endif
  217. /**
  218. * MEMP_NUM_TCP_PCB: the number of simulatenously active TCP connections.
  219. * (requires the LWIP_TCP option)
  220. */
  221. #ifndef MEMP_NUM_TCP_PCB
  222. #define MEMP_NUM_TCP_PCB (*(volatile uint32*)0x600011FC)
  223. #endif
  224. /**
  225. * MEMP_NUM_TCP_PCB_LISTEN: the number of listening TCP connections.
  226. * (requires the LWIP_TCP option)
  227. */
  228. #ifndef MEMP_NUM_TCP_PCB_LISTEN
  229. #define MEMP_NUM_TCP_PCB_LISTEN 2
  230. #endif
  231. /**
  232. * MEMP_NUM_TCP_SEG: the number of simultaneously queued TCP segments.
  233. * (requires the LWIP_TCP option)
  234. */
  235. #ifndef MEMP_NUM_TCP_SEG
  236. #define MEMP_NUM_TCP_SEG 16
  237. #endif
  238. /**
  239. * MEMP_NUM_REASSDATA: the number of simultaneously IP packets queued for
  240. * reassembly (whole packets, not fragments!)
  241. */
  242. #ifndef MEMP_NUM_REASSDATA
  243. #define MEMP_NUM_REASSDATA 0
  244. #endif
  245. /**
  246. * MEMP_NUM_FRAG_PBUF: the number of IP fragments simultaneously sent
  247. * (fragments, not whole packets!).
  248. * This is only used with IP_FRAG_USES_STATIC_BUF==0 and
  249. * LWIP_NETIF_TX_SINGLE_PBUF==0 and only has to be > 1 with DMA-enabled MACs
  250. * where the packet is not yet sent when netif->output returns.
  251. */
  252. #ifndef MEMP_NUM_FRAG_PBUF
  253. #define MEMP_NUM_FRAG_PBUF 0
  254. #endif
  255. /**
  256. * MEMP_NUM_ARP_QUEUE: the number of simulateously queued outgoing
  257. * packets (pbufs) that are waiting for an ARP request (to resolve
  258. * their destination address) to finish.
  259. * (requires the ARP_QUEUEING option)
  260. */
  261. #ifndef MEMP_NUM_ARP_QUEUE
  262. #define MEMP_NUM_ARP_QUEUE 10
  263. #endif
  264. /**
  265. * MEMP_NUM_IGMP_GROUP: The number of multicast groups whose network interfaces
  266. * can be members et the same time (one per netif - allsystems group -, plus one
  267. * per netif membership).
  268. * (requires the LWIP_IGMP option)
  269. */
  270. #ifndef MEMP_NUM_IGMP_GROUP
  271. #define MEMP_NUM_IGMP_GROUP 8
  272. #endif
  273. /**
  274. * MEMP_NUM_SYS_TIMEOUT: the number of simulateously active timeouts.
  275. * (requires NO_SYS==0)
  276. */
  277. #ifndef MEMP_NUM_SYS_TIMEOUT
  278. #define MEMP_NUM_SYS_TIMEOUT 8
  279. #endif
  280. /**
  281. * MEMP_NUM_NETBUF: the number of struct netbufs.
  282. * (only needed if you use the sequential API, like api_lib.c)
  283. */
  284. #ifndef MEMP_NUM_NETBUF
  285. #define MEMP_NUM_NETBUF 0
  286. #endif
  287. /**
  288. * MEMP_NUM_NETCONN: the number of struct netconns.
  289. * (only needed if you use the sequential API, like api_lib.c)
  290. */
  291. #ifndef MEMP_NUM_NETCONN
  292. #define MEMP_NUM_NETCONN 0
  293. #endif
  294. /**
  295. * MEMP_NUM_TCPIP_MSG_API: the number of struct tcpip_msg, which are used
  296. * for callback/timeout API communication.
  297. * (only needed if you use tcpip.c)
  298. */
  299. #ifndef MEMP_NUM_TCPIP_MSG_API
  300. #define MEMP_NUM_TCPIP_MSG_API 4
  301. #endif
  302. /**
  303. * MEMP_NUM_TCPIP_MSG_INPKT: the number of struct tcpip_msg, which are used
  304. * for incoming packets.
  305. * (only needed if you use tcpip.c)
  306. */
  307. #ifndef MEMP_NUM_TCPIP_MSG_INPKT
  308. #define MEMP_NUM_TCPIP_MSG_INPKT 4
  309. #endif
  310. /**
  311. * MEMP_NUM_SNMP_NODE: the number of leafs in the SNMP tree.
  312. */
  313. #ifndef MEMP_NUM_SNMP_NODE
  314. #define MEMP_NUM_SNMP_NODE 0
  315. #endif
  316. /**
  317. * MEMP_NUM_SNMP_ROOTNODE: the number of branches in the SNMP tree.
  318. * Every branch has one leaf (MEMP_NUM_SNMP_NODE) at least!
  319. */
  320. #ifndef MEMP_NUM_SNMP_ROOTNODE
  321. #define MEMP_NUM_SNMP_ROOTNODE 0
  322. #endif
  323. /**
  324. * MEMP_NUM_SNMP_VARBIND: the number of concurrent requests (does not have to
  325. * be changed normally) - 2 of these are used per request (1 for input,
  326. * 1 for output)
  327. */
  328. #ifndef MEMP_NUM_SNMP_VARBIND
  329. #define MEMP_NUM_SNMP_VARBIND 0
  330. #endif
  331. /**
  332. * MEMP_NUM_SNMP_VALUE: the number of OID or values concurrently used
  333. * (does not have to be changed normally) - 3 of these are used per request
  334. * (1 for the value read and 2 for OIDs - input and output)
  335. */
  336. #ifndef MEMP_NUM_SNMP_VALUE
  337. #define MEMP_NUM_SNMP_VALUE 0
  338. #endif
  339. /**
  340. * MEMP_NUM_NETDB: the number of concurrently running lwip_addrinfo() calls
  341. * (before freeing the corresponding memory using lwip_freeaddrinfo()).
  342. */
  343. #ifndef MEMP_NUM_NETDB
  344. #define MEMP_NUM_NETDB 0
  345. #endif
  346. /**
  347. * MEMP_NUM_LOCALHOSTLIST: the number of host entries in the local host list
  348. * if DNS_LOCAL_HOSTLIST_IS_DYNAMIC==1.
  349. */
  350. #ifndef MEMP_NUM_LOCALHOSTLIST
  351. #define MEMP_NUM_LOCALHOSTLIST 0
  352. #endif
  353. /**
  354. * MEMP_NUM_PPPOE_INTERFACES: the number of concurrently active PPPoE
  355. * interfaces (only used with PPPOE_SUPPORT==1)
  356. */
  357. #ifndef MEMP_NUM_PPPOE_INTERFACES
  358. #define MEMP_NUM_PPPOE_INTERFACES 0
  359. #endif
  360. /**
  361. * PBUF_POOL_SIZE: the number of buffers in the pbuf pool.
  362. */
  363. #ifndef PBUF_POOL_SIZE
  364. #define PBUF_POOL_SIZE 10
  365. #endif
  366. /*
  367. ---------------------------------
  368. ---------- ARP options ----------
  369. ---------------------------------
  370. */
  371. /**
  372. * LWIP_ARP==1: Enable ARP functionality.
  373. */
  374. #ifndef LWIP_ARP
  375. #define LWIP_ARP 1
  376. #endif
  377. /**
  378. * ARP_TABLE_SIZE: Number of active MAC-IP address pairs cached.
  379. */
  380. #ifndef ARP_TABLE_SIZE
  381. #define ARP_TABLE_SIZE 10
  382. #endif
  383. /**
  384. * ARP_QUEUEING==1: Multiple outgoing packets are queued during hardware address
  385. * resolution. By default, only the most recent packet is queued per IP address.
  386. * This is sufficient for most protocols and mainly reduces TCP connection
  387. * startup time. Set this to 1 if you know your application sends more than one
  388. * packet in a row to an IP address that is not in the ARP cache.
  389. */
  390. #ifndef ARP_QUEUEING
  391. #define ARP_QUEUEING 1
  392. #endif
  393. /**
  394. * ETHARP_TRUST_IP_MAC==1: Incoming IP packets cause the ARP table to be
  395. * updated with the source MAC and IP addresses supplied in the packet.
  396. * You may want to disable this if you do not trust LAN peers to have the
  397. * correct addresses, or as a limited approach to attempt to handle
  398. * spoofing. If disabled, lwIP will need to make a new ARP request if
  399. * the peer is not already in the ARP table, adding a little latency.
  400. * The peer *is* in the ARP table if it requested our address before.
  401. * Also notice that this slows down input processing of every IP packet!
  402. */
  403. #ifndef ETHARP_TRUST_IP_MAC
  404. #define ETHARP_TRUST_IP_MAC 1
  405. #endif
  406. /**
  407. * ETHARP_SUPPORT_VLAN==1: support receiving ethernet packets with VLAN header.
  408. * Additionally, you can define ETHARP_VLAN_CHECK to an u16_t VLAN ID to check.
  409. * If ETHARP_VLAN_CHECK is defined, only VLAN-traffic for this VLAN is accepted.
  410. * If ETHARP_VLAN_CHECK is not defined, all traffic is accepted.
  411. */
  412. #ifndef ETHARP_SUPPORT_VLAN
  413. #define ETHARP_SUPPORT_VLAN 0
  414. #endif
  415. /** LWIP_ETHERNET==1: enable ethernet support for PPPoE even though ARP
  416. * might be disabled
  417. */
  418. #ifndef LWIP_ETHERNET
  419. #define LWIP_ETHERNET (LWIP_ARP || PPPOE_SUPPORT)
  420. #endif
  421. /** ETH_PAD_SIZE: number of bytes added before the ethernet header to ensure
  422. * alignment of payload after that header. Since the header is 14 bytes long,
  423. * without this padding e.g. addresses in the IP header will not be aligned
  424. * on a 32-bit boundary, so setting this to 2 can speed up 32-bit-platforms.
  425. */
  426. #ifndef ETH_PAD_SIZE
  427. #define ETH_PAD_SIZE 0
  428. #endif
  429. /** ETHARP_SUPPORT_STATIC_ENTRIES==1: enable code to support static ARP table
  430. * entries (using etharp_add_static_entry/etharp_remove_static_entry).
  431. */
  432. #ifndef ETHARP_SUPPORT_STATIC_ENTRIES
  433. #define ETHARP_SUPPORT_STATIC_ENTRIES 0
  434. #endif
  435. /*
  436. --------------------------------
  437. ---------- IP options ----------
  438. --------------------------------
  439. */
  440. /**
  441. * IP_FORWARD==1: Enables the ability to forward IP packets across network
  442. * interfaces. If you are going to run lwIP on a device with only one network
  443. * interface, define this to 0.
  444. */
  445. #ifndef IP_FORWARD
  446. #define IP_FORWARD 0
  447. #endif
  448. /**
  449. * IP_OPTIONS_ALLOWED: Defines the behavior for IP options.
  450. * IP_OPTIONS_ALLOWED==0: All packets with IP options are dropped.
  451. * IP_OPTIONS_ALLOWED==1: IP options are allowed (but not parsed).
  452. */
  453. #ifndef IP_OPTIONS_ALLOWED
  454. #define IP_OPTIONS_ALLOWED 1
  455. #endif
  456. /**
  457. * IP_REASSEMBLY==1: Reassemble incoming fragmented IP packets. Note that
  458. * this option does not affect outgoing packet sizes, which can be controlled
  459. * via IP_FRAG.
  460. */
  461. #ifndef IP_REASSEMBLY
  462. #define IP_REASSEMBLY 0
  463. #endif
  464. /**
  465. * IP_FRAG==1: Fragment outgoing IP packets if their size exceeds MTU. Note
  466. * that this option does not affect incoming packet sizes, which can be
  467. * controlled via IP_REASSEMBLY.
  468. */
  469. #ifndef IP_FRAG
  470. #define IP_FRAG 0
  471. #endif
  472. /**
  473. * IP_REASS_MAXAGE: Maximum time (in multiples of IP_TMR_INTERVAL - so seconds, normally)
  474. * a fragmented IP packet waits for all fragments to arrive. If not all fragments arrived
  475. * in this time, the whole packet is discarded.
  476. */
  477. #ifndef IP_REASS_MAXAGE
  478. #define IP_REASS_MAXAGE 3
  479. #endif
  480. /**
  481. * IP_REASS_MAX_PBUFS: Total maximum amount of pbufs waiting to be reassembled.
  482. * Since the received pbufs are enqueued, be sure to configure
  483. * PBUF_POOL_SIZE > IP_REASS_MAX_PBUFS so that the stack is still able to receive
  484. * packets even if the maximum amount of fragments is enqueued for reassembly!
  485. */
  486. #ifndef IP_REASS_MAX_PBUFS
  487. #define IP_REASS_MAX_PBUFS 10
  488. #endif
  489. /**
  490. * IP_FRAG_USES_STATIC_BUF==1: Use a static MTU-sized buffer for IP
  491. * fragmentation. Otherwise pbufs are allocated and reference the original
  492. * packet data to be fragmented (or with LWIP_NETIF_TX_SINGLE_PBUF==1,
  493. * new PBUF_RAM pbufs are used for fragments).
  494. * ATTENTION: IP_FRAG_USES_STATIC_BUF==1 may not be used for DMA-enabled MACs!
  495. */
  496. #ifndef IP_FRAG_USES_STATIC_BUF
  497. #define IP_FRAG_USES_STATIC_BUF 1
  498. #endif
  499. /**
  500. * IP_FRAG_MAX_MTU: Assumed max MTU on any interface for IP frag buffer
  501. * (requires IP_FRAG_USES_STATIC_BUF==1)
  502. */
  503. #if IP_FRAG_USES_STATIC_BUF && !defined(IP_FRAG_MAX_MTU)
  504. #define IP_FRAG_MAX_MTU 1500
  505. #endif
  506. /**
  507. * IP_DEFAULT_TTL: Default value for Time-To-Live used by transport layers.
  508. */
  509. #ifndef IP_DEFAULT_TTL
  510. #define IP_DEFAULT_TTL 255
  511. #endif
  512. /**
  513. * IP_SOF_BROADCAST=1: Use the SOF_BROADCAST field to enable broadcast
  514. * filter per pcb on udp and raw send operations. To enable broadcast filter
  515. * on recv operations, you also have to set IP_SOF_BROADCAST_RECV=1.
  516. */
  517. #ifndef IP_SOF_BROADCAST
  518. #define IP_SOF_BROADCAST 0
  519. #endif
  520. /**
  521. * IP_SOF_BROADCAST_RECV (requires IP_SOF_BROADCAST=1) enable the broadcast
  522. * filter on recv operations.
  523. */
  524. #ifndef IP_SOF_BROADCAST_RECV
  525. #define IP_SOF_BROADCAST_RECV 0
  526. #endif
  527. /*
  528. ----------------------------------
  529. ---------- ICMP options ----------
  530. ----------------------------------
  531. */
  532. /**
  533. * LWIP_ICMP==1: Enable ICMP module inside the IP stack.
  534. * Be careful, disable that make your product non-compliant to RFC1122
  535. */
  536. #ifndef LWIP_ICMP
  537. #define LWIP_ICMP 1
  538. #endif
  539. /**
  540. * ICMP_TTL: Default value for Time-To-Live used by ICMP packets.
  541. */
  542. #ifndef ICMP_TTL
  543. #define ICMP_TTL (IP_DEFAULT_TTL)
  544. #endif
  545. /**
  546. * LWIP_BROADCAST_PING==1: respond to broadcast pings (default is unicast only)
  547. */
  548. #ifndef LWIP_BROADCAST_PING
  549. #define LWIP_BROADCAST_PING 0
  550. #endif
  551. /**
  552. * LWIP_MULTICAST_PING==1: respond to multicast pings (default is unicast only)
  553. */
  554. #ifndef LWIP_MULTICAST_PING
  555. #define LWIP_MULTICAST_PING 0
  556. #endif
  557. /*
  558. ---------------------------------
  559. ---------- RAW options ----------
  560. ---------------------------------
  561. */
  562. /**
  563. * LWIP_RAW==1: Enable application layer to hook into the IP layer itself.
  564. */
  565. #ifndef LWIP_RAW
  566. #define LWIP_RAW 1
  567. #endif
  568. /**
  569. * LWIP_RAW==1: Enable application layer to hook into the IP layer itself.
  570. */
  571. #ifndef RAW_TTL
  572. #define RAW_TTL (IP_DEFAULT_TTL)
  573. #endif
  574. /*
  575. ----------------------------------
  576. ---------- DHCP options ----------
  577. ----------------------------------
  578. */
  579. /**
  580. * LWIP_DHCP==1: Enable DHCP module.
  581. */
  582. #ifndef LWIP_DHCP
  583. #define LWIP_DHCP 1
  584. #endif
  585. /**
  586. * DHCP_DOES_ARP_CHECK==1: Do an ARP check on the offered address.
  587. */
  588. #ifndef DHCP_DOES_ARP_CHECK
  589. #define DHCP_DOES_ARP_CHECK ((LWIP_DHCP) && (LWIP_ARP))
  590. #endif
  591. /**
  592. * DHCP_MAXRTX: Maximum number of retries of current request.
  593. */
  594. #ifndef DHCP_MAXRTX
  595. #define DHCP_MAXRTX (*(volatile uint32*)0x600011E0)
  596. #endif
  597. /*
  598. ------------------------------------
  599. ---------- AUTOIP options ----------
  600. ------------------------------------
  601. */
  602. /**
  603. * LWIP_AUTOIP==1: Enable AUTOIP module.
  604. */
  605. #ifndef LWIP_AUTOIP
  606. #define LWIP_AUTOIP 0
  607. #endif
  608. /**
  609. * LWIP_DHCP_AUTOIP_COOP==1: Allow DHCP and AUTOIP to be both enabled on
  610. * the same interface at the same time.
  611. */
  612. #ifndef LWIP_DHCP_AUTOIP_COOP
  613. #define LWIP_DHCP_AUTOIP_COOP 0
  614. #endif
  615. /**
  616. * LWIP_DHCP_AUTOIP_COOP_TRIES: Set to the number of DHCP DISCOVER probes
  617. * that should be sent before falling back on AUTOIP. This can be set
  618. * as low as 1 to get an AutoIP address very quickly, but you should
  619. * be prepared to handle a changing IP address when DHCP overrides
  620. * AutoIP.
  621. */
  622. #ifndef LWIP_DHCP_AUTOIP_COOP_TRIES
  623. #define LWIP_DHCP_AUTOIP_COOP_TRIES 9
  624. #endif
  625. /*
  626. ----------------------------------
  627. ---------- SNMP options ----------
  628. ----------------------------------
  629. */
  630. /**
  631. * LWIP_SNMP==1: Turn on SNMP module. UDP must be available for SNMP
  632. * transport.
  633. */
  634. #ifndef LWIP_SNMP
  635. #define LWIP_SNMP 0
  636. #endif
  637. /**
  638. * SNMP_CONCURRENT_REQUESTS: Number of concurrent requests the module will
  639. * allow. At least one request buffer is required.
  640. */
  641. #ifndef SNMP_CONCURRENT_REQUESTS
  642. #define SNMP_CONCURRENT_REQUESTS 0
  643. #endif
  644. /**
  645. * SNMP_TRAP_DESTINATIONS: Number of trap destinations. At least one trap
  646. * destination is required
  647. */
  648. #ifndef SNMP_TRAP_DESTINATIONS
  649. #define SNMP_TRAP_DESTINATIONS 0
  650. #endif
  651. /**
  652. * SNMP_PRIVATE_MIB:
  653. */
  654. #ifndef SNMP_PRIVATE_MIB
  655. #define SNMP_PRIVATE_MIB 0
  656. #endif
  657. /**
  658. * Only allow SNMP write actions that are 'safe' (e.g. disabeling netifs is not
  659. * a safe action and disabled when SNMP_SAFE_REQUESTS = 1).
  660. * Unsafe requests are disabled by default!
  661. */
  662. #ifndef SNMP_SAFE_REQUESTS
  663. #define SNMP_SAFE_REQUESTS 0
  664. #endif
  665. /**
  666. * The maximum length of strings used. This affects the size of
  667. * MEMP_SNMP_VALUE elements.
  668. */
  669. #ifndef SNMP_MAX_OCTET_STRING_LEN
  670. #define SNMP_MAX_OCTET_STRING_LEN 127
  671. #endif
  672. /**
  673. * The maximum depth of the SNMP tree.
  674. * With private MIBs enabled, this depends on your MIB!
  675. * This affects the size of MEMP_SNMP_VALUE elements.
  676. */
  677. #ifndef SNMP_MAX_TREE_DEPTH
  678. #define SNMP_MAX_TREE_DEPTH 15
  679. #endif
  680. /**
  681. * The size of the MEMP_SNMP_VALUE elements, normally calculated from
  682. * SNMP_MAX_OCTET_STRING_LEN and SNMP_MAX_TREE_DEPTH.
  683. */
  684. #ifndef SNMP_MAX_VALUE_SIZE
  685. #define SNMP_MAX_VALUE_SIZE LWIP_MAX((SNMP_MAX_OCTET_STRING_LEN)+1, sizeof(s32_t)*(SNMP_MAX_TREE_DEPTH))
  686. #endif
  687. /*
  688. ----------------------------------
  689. ---------- IGMP options ----------
  690. ----------------------------------
  691. */
  692. /**
  693. * LWIP_IGMP==1: Turn on IGMP module.
  694. */
  695. #ifndef LWIP_IGMP
  696. #define LWIP_IGMP 1
  697. #endif
  698. /*
  699. ----------------------------------
  700. ---------- MDNS options ----------
  701. ----------------------------------
  702. */
  703. /**
  704. * LWIP_MDNS==1: Turn on MDNS module.
  705. */
  706. #ifndef LWIP_MDNS
  707. #define LWIP_MDNS 1
  708. #endif
  709. /*
  710. ----------------------------------
  711. ---------- DNS options -----------
  712. ----------------------------------
  713. */
  714. /**
  715. * LWIP_DNS==1: Turn on DNS module. UDP must be available for DNS
  716. * transport.
  717. */
  718. #ifndef LWIP_DNS
  719. #define LWIP_DNS 1
  720. #endif
  721. /** DNS maximum number of entries to maintain locally. */
  722. #ifndef DNS_TABLE_SIZE
  723. #define DNS_TABLE_SIZE 4
  724. #endif
  725. /** DNS maximum host name length supported in the name table. */
  726. #ifndef DNS_MAX_NAME_LENGTH
  727. #define DNS_MAX_NAME_LENGTH 256
  728. #endif
  729. /** The maximum of DNS servers */
  730. #ifndef DNS_MAX_SERVERS
  731. #define DNS_MAX_SERVERS 2
  732. #endif
  733. /** DNS do a name checking between the query and the response. */
  734. #ifndef DNS_DOES_NAME_CHECK
  735. #define DNS_DOES_NAME_CHECK 1
  736. #endif
  737. /** DNS message max. size. Default value is RFC compliant. */
  738. #ifndef DNS_MSG_SIZE
  739. #define DNS_MSG_SIZE 512
  740. #endif
  741. /** DNS_LOCAL_HOSTLIST: Implements a local host-to-address list. If enabled,
  742. * you have to define
  743. * #define DNS_LOCAL_HOSTLIST_INIT {{"host1", 0x123}, {"host2", 0x234}}
  744. * (an array of structs name/address, where address is an u32_t in network
  745. * byte order).
  746. *
  747. * Instead, you can also use an external function:
  748. * #define DNS_LOOKUP_LOCAL_EXTERN(x) extern u32_t my_lookup_function(const char *name)
  749. * that returns the IP address or INADDR_NONE if not found.
  750. */
  751. #ifndef DNS_LOCAL_HOSTLIST
  752. #define DNS_LOCAL_HOSTLIST 0
  753. #endif /* DNS_LOCAL_HOSTLIST */
  754. /** If this is turned on, the local host-list can be dynamically changed
  755. * at runtime. */
  756. #ifndef DNS_LOCAL_HOSTLIST_IS_DYNAMIC
  757. #define DNS_LOCAL_HOSTLIST_IS_DYNAMIC 0
  758. #endif /* DNS_LOCAL_HOSTLIST_IS_DYNAMIC */
  759. /*
  760. ---------------------------------
  761. ---------- UDP options ----------
  762. ---------------------------------
  763. */
  764. /**
  765. * LWIP_UDP==1: Turn on UDP.
  766. */
  767. #ifndef LWIP_UDP
  768. #define LWIP_UDP 1
  769. #endif
  770. /**
  771. * LWIP_UDPLITE==1: Turn on UDP-Lite. (Requires LWIP_UDP)
  772. */
  773. #ifndef LWIP_UDPLITE
  774. #define LWIP_UDPLITE 0
  775. #endif
  776. /**
  777. * UDP_TTL: Default Time-To-Live value.
  778. */
  779. #ifndef UDP_TTL
  780. #define UDP_TTL (IP_DEFAULT_TTL)
  781. #endif
  782. /**
  783. * LWIP_NETBUF_RECVINFO==1: append destination addr and port to every netbuf.
  784. */
  785. #ifndef LWIP_NETBUF_RECVINFO
  786. #define LWIP_NETBUF_RECVINFO 0
  787. #endif
  788. /*
  789. ---------------------------------
  790. ---------- TCP options ----------
  791. ---------------------------------
  792. */
  793. /**
  794. * LWIP_TCP==1: Turn on TCP.
  795. */
  796. #ifndef LWIP_TCP
  797. #define LWIP_TCP 1
  798. #endif
  799. /**
  800. * TCP_TTL: Default Time-To-Live value.
  801. */
  802. #ifndef TCP_TTL
  803. #define TCP_TTL (IP_DEFAULT_TTL)
  804. #endif
  805. /**
  806. * TCP_MSL: Maximum segment lifetime
  807. * Override for <tcp_impl.h> file
  808. * See https://github.com/nodemcu/nodemcu-firmware/issues/1836 for details
  809. */
  810. #ifndef TCP_MSL
  811. #define TCP_MSL 5000UL
  812. #endif
  813. /**
  814. * TCP_MAXRTX: Maximum number of retransmissions of data segments.
  815. */
  816. #ifndef TCP_MAXRTX
  817. #define TCP_MAXRTX (*(volatile uint32*)0x600011E8)
  818. #endif
  819. /**
  820. * TCP_SYNMAXRTX: Maximum number of retransmissions of SYN segments.
  821. */
  822. #ifndef TCP_SYNMAXRTX
  823. #define TCP_SYNMAXRTX (*(volatile uint32*)0x600011E4)
  824. #endif
  825. /**
  826. * TCP_MAXRTO: Maximum retransmission timeout of data segments.
  827. */
  828. #ifndef TCP_MAXRTO
  829. #define TCP_MAXRTO 10
  830. #endif
  831. /**
  832. * TCP_MINRTO: Minimum retransmission timeout of data segments.
  833. */
  834. #ifndef TCP_MINRTO
  835. #define TCP_MINRTO 2
  836. #endif
  837. /**
  838. * TCP_QUEUE_OOSEQ==1: TCP will queue segments that arrive out of order.
  839. * Define to 0 if your device is low on memory.
  840. */
  841. #ifndef TCP_QUEUE_OOSEQ
  842. #define TCP_QUEUE_OOSEQ 1
  843. #endif
  844. #if 1
  845. /**
  846. * TCP_MSS: TCP Maximum segment size. (default is 536, a conservative default,
  847. * you might want to increase this.)
  848. * For the receive side, this MSS is advertised to the remote side
  849. * when opening a connection. For the transmit size, this MSS sets
  850. * an upper limit on the MSS advertised by the remote host.
  851. */
  852. #ifndef TCP_MSS
  853. #define TCP_MSS 1460
  854. #endif
  855. #endif
  856. /**
  857. * TCP_WND: The size of a TCP window. This must be at least
  858. * (2 * TCP_MSS) for things to work well
  859. */
  860. #ifndef TCP_WND
  861. #define TCP_WND (*(volatile uint32*)0x600011F0)
  862. #endif
  863. /**
  864. * TCP_CALCULATE_EFF_SEND_MSS: "The maximum size of a segment that TCP really
  865. * sends, the 'effective send MSS,' MUST be the smaller of the send MSS (which
  866. * reflects the available reassembly buffer size at the remote host) and the
  867. * largest size permitted by the IP layer" (RFC 1122)
  868. * Setting this to 1 enables code that checks TCP_MSS against the MTU of the
  869. * netif used for a connection and limits the MSS if it would be too big otherwise.
  870. */
  871. #ifndef TCP_CALCULATE_EFF_SEND_MSS
  872. #define TCP_CALCULATE_EFF_SEND_MSS 1
  873. #endif
  874. /**
  875. * TCP_SND_BUF: TCP sender buffer space (bytes).
  876. */
  877. #ifndef TCP_SND_BUF
  878. #define TCP_SND_BUF 2 * TCP_MSS
  879. #endif
  880. /**
  881. * TCP_SND_QUEUELEN: TCP sender buffer space (pbufs). This must be at least
  882. * as much as (2 * TCP_SND_BUF/TCP_MSS) for things to work.
  883. */
  884. #ifndef TCP_SND_QUEUELEN
  885. #define TCP_SND_QUEUELEN ((4 * (TCP_SND_BUF) + (TCP_MSS - 1))/(TCP_MSS))
  886. #endif
  887. /**
  888. * TCP_SNDLOWAT: TCP writable space (bytes). This must be less than
  889. * TCP_SND_BUF. It is the amount of space which must be available in the
  890. * TCP snd_buf for select to return writable (combined with TCP_SNDQUEUELOWAT).
  891. */
  892. #ifndef TCP_SNDLOWAT
  893. #define TCP_SNDLOWAT ((TCP_SND_BUF)/2)
  894. #endif
  895. /**
  896. * TCP_SNDQUEUELOWAT: TCP writable bufs (pbuf count). This must be grater
  897. * than TCP_SND_QUEUELEN. If the number of pbufs queued on a pcb drops below
  898. * this number, select returns writable (combined with TCP_SNDLOWAT).
  899. */
  900. #ifndef TCP_SNDQUEUELOWAT
  901. #define TCP_SNDQUEUELOWAT LWIP_MAX(((TCP_SND_QUEUELEN)/2), 5)
  902. #endif
  903. /**
  904. * TCP_LISTEN_BACKLOG: Enable the backlog option for tcp listen pcb.
  905. */
  906. #ifndef TCP_LISTEN_BACKLOG
  907. #define TCP_LISTEN_BACKLOG 0
  908. #endif
  909. /**
  910. * The maximum allowed backlog for TCP listen netconns.
  911. * This backlog is used unless another is explicitly specified.
  912. * 0xff is the maximum (u8_t).
  913. */
  914. #ifndef TCP_DEFAULT_LISTEN_BACKLOG
  915. #define TCP_DEFAULT_LISTEN_BACKLOG 0xff
  916. #endif
  917. /**
  918. * TCP_OVERSIZE: The maximum number of bytes that tcp_write may
  919. * allocate ahead of time in an attempt to create shorter pbuf chains
  920. * for transmission. The meaningful range is 0 to TCP_MSS. Some
  921. * suggested values are:
  922. *
  923. * 0: Disable oversized allocation. Each tcp_write() allocates a new
  924. pbuf (old behaviour).
  925. * 1: Allocate size-aligned pbufs with minimal excess. Use this if your
  926. * scatter-gather DMA requires aligned fragments.
  927. * 128: Limit the pbuf/memory overhead to 20%.
  928. * TCP_MSS: Try to create unfragmented TCP packets.
  929. * TCP_MSS/4: Try to create 4 fragments or less per TCP packet.
  930. */
  931. #ifndef TCP_OVERSIZE
  932. #define TCP_OVERSIZE TCP_MSS
  933. #endif
  934. /**
  935. * LWIP_TCP_TIMESTAMPS==1: support the TCP timestamp option.
  936. */
  937. #ifndef LWIP_TCP_TIMESTAMPS
  938. #define LWIP_TCP_TIMESTAMPS 0
  939. #endif
  940. /**
  941. * TCP_WND_UPDATE_THRESHOLD: difference in window to trigger an
  942. * explicit window update
  943. */
  944. #ifndef TCP_WND_UPDATE_THRESHOLD
  945. #define TCP_WND_UPDATE_THRESHOLD (TCP_WND / 4)
  946. #endif
  947. /**
  948. * LWIP_EVENT_API and LWIP_CALLBACK_API: Only one of these should be set to 1.
  949. * LWIP_EVENT_API==1: The user defines lwip_tcp_event() to receive all
  950. * events (accept, sent, etc) that happen in the system.
  951. * LWIP_CALLBACK_API==1: The PCB callback function is called directly
  952. * for the event.
  953. */
  954. #ifndef LWIP_EVENT_API
  955. #define LWIP_EVENT_API 0
  956. #define LWIP_CALLBACK_API 1
  957. #else
  958. #define LWIP_EVENT_API 1
  959. #define LWIP_CALLBACK_API 0
  960. #endif
  961. /*
  962. ----------------------------------
  963. ---------- Pbuf options ----------
  964. ----------------------------------
  965. */
  966. /**
  967. * PBUF_LINK_HLEN: the number of bytes that should be allocated for a
  968. * link level header. The default is 14, the standard value for
  969. * Ethernet.
  970. */
  971. #ifndef PBUF_LINK_HLEN
  972. #define PBUF_LINK_HLEN (14 + ETH_PAD_SIZE)
  973. #endif
  974. /**
  975. * PBUF_POOL_BUFSIZE: the size of each pbuf in the pbuf pool. The default is
  976. * designed to accomodate single full size TCP frame in one pbuf, including
  977. * TCP_MSS, IP header, and link header.
  978. */
  979. #ifndef PBUF_POOL_BUFSIZE
  980. #define PBUF_POOL_BUFSIZE LWIP_MEM_ALIGN_SIZE(TCP_MSS+40+PBUF_LINK_HLEN)
  981. #endif
  982. /*
  983. ------------------------------------------------
  984. ---------- Network Interfaces options ----------
  985. ------------------------------------------------
  986. */
  987. /**
  988. * LWIP_NETIF_HOSTNAME==1: use DHCP_OPTION_HOSTNAME with netif's hostname
  989. * field.
  990. */
  991. #ifndef LWIP_NETIF_HOSTNAME
  992. #define LWIP_NETIF_HOSTNAME 1
  993. #endif
  994. /**
  995. * LWIP_NETIF_API==1: Support netif api (in netifapi.c)
  996. */
  997. #ifndef LWIP_NETIF_API
  998. #define LWIP_NETIF_API 0
  999. #endif
  1000. /**
  1001. * LWIP_NETIF_STATUS_CALLBACK==1: Support a callback function whenever an interface
  1002. * changes its up/down status (i.e., due to DHCP IP acquistion)
  1003. */
  1004. #ifndef LWIP_NETIF_STATUS_CALLBACK
  1005. #define LWIP_NETIF_STATUS_CALLBACK 0
  1006. #endif
  1007. /**
  1008. * LWIP_NETIF_LINK_CALLBACK==1: Support a callback function from an interface
  1009. * whenever the link changes (i.e., link down)
  1010. */
  1011. #ifndef LWIP_NETIF_LINK_CALLBACK
  1012. #define LWIP_NETIF_LINK_CALLBACK 0
  1013. #endif
  1014. /**
  1015. * LWIP_NETIF_HWADDRHINT==1: Cache link-layer-address hints (e.g. table
  1016. * indices) in struct netif. TCP and UDP can make use of this to prevent
  1017. * scanning the ARP table for every sent packet. While this is faster for big
  1018. * ARP tables or many concurrent connections, it might be counterproductive
  1019. * if you have a tiny ARP table or if there never are concurrent connections.
  1020. */
  1021. #ifndef LWIP_NETIF_HWADDRHINT
  1022. #define LWIP_NETIF_HWADDRHINT 0
  1023. #endif
  1024. /**
  1025. * LWIP_NETIF_LOOPBACK==1: Support sending packets with a destination IP
  1026. * address equal to the netif IP address, looping them back up the stack.
  1027. */
  1028. #ifndef LWIP_NETIF_LOOPBACK
  1029. #define LWIP_NETIF_LOOPBACK 0
  1030. #endif
  1031. /**
  1032. * LWIP_LOOPBACK_MAX_PBUFS: Maximum number of pbufs on queue for loopback
  1033. * sending for each netif (0 = disabled)
  1034. */
  1035. #ifndef LWIP_LOOPBACK_MAX_PBUFS
  1036. #define LWIP_LOOPBACK_MAX_PBUFS 0
  1037. #endif
  1038. /**
  1039. * LWIP_NETIF_LOOPBACK_MULTITHREADING: Indicates whether threading is enabled in
  1040. * the system, as netifs must change how they behave depending on this setting
  1041. * for the LWIP_NETIF_LOOPBACK option to work.
  1042. * Setting this is needed to avoid reentering non-reentrant functions like
  1043. * tcp_input().
  1044. * LWIP_NETIF_LOOPBACK_MULTITHREADING==1: Indicates that the user is using a
  1045. * multithreaded environment like tcpip.c. In this case, netif->input()
  1046. * is called directly.
  1047. * LWIP_NETIF_LOOPBACK_MULTITHREADING==0: Indicates a polling (or NO_SYS) setup.
  1048. * The packets are put on a list and netif_poll() must be called in
  1049. * the main application loop.
  1050. */
  1051. #ifndef LWIP_NETIF_LOOPBACK_MULTITHREADING
  1052. #define LWIP_NETIF_LOOPBACK_MULTITHREADING (!NO_SYS)
  1053. #endif
  1054. /**
  1055. * LWIP_NETIF_TX_SINGLE_PBUF: if this is set to 1, lwIP tries to put all data
  1056. * to be sent into one single pbuf. This is for compatibility with DMA-enabled
  1057. * MACs that do not support scatter-gather.
  1058. * Beware that this might involve CPU-memcpy before transmitting that would not
  1059. * be needed without this flag! Use this only if you need to!
  1060. *
  1061. * @todo: TCP and IP-frag do not work with this, yet:
  1062. */
  1063. #ifndef LWIP_NETIF_TX_SINGLE_PBUF
  1064. #define LWIP_NETIF_TX_SINGLE_PBUF 1
  1065. #endif /* LWIP_NETIF_TX_SINGLE_PBUF */
  1066. /*
  1067. ------------------------------------
  1068. ---------- LOOPIF options ----------
  1069. ------------------------------------
  1070. */
  1071. /**
  1072. * LWIP_HAVE_LOOPIF==1: Support loop interface (127.0.0.1) and loopif.c
  1073. */
  1074. #ifndef LWIP_HAVE_LOOPIF
  1075. #define LWIP_HAVE_LOOPIF 0
  1076. #endif
  1077. /*
  1078. ------------------------------------
  1079. ---------- SLIPIF options ----------
  1080. ------------------------------------
  1081. */
  1082. /**
  1083. * LWIP_HAVE_SLIPIF==1: Support slip interface and slipif.c
  1084. */
  1085. #ifndef LWIP_HAVE_SLIPIF
  1086. #define LWIP_HAVE_SLIPIF 0
  1087. #endif
  1088. /*
  1089. ------------------------------------
  1090. ---------- Thread options ----------
  1091. ------------------------------------
  1092. */
  1093. /**
  1094. * TCPIP_THREAD_NAME: The name assigned to the main tcpip thread.
  1095. */
  1096. #ifndef TCPIP_THREAD_NAME
  1097. #define TCPIP_THREAD_NAME "tcpip_thread"
  1098. #endif
  1099. /**
  1100. * TCPIP_THREAD_STACKSIZE: The stack size used by the main tcpip thread.
  1101. * The stack size value itself is platform-dependent, but is passed to
  1102. * sys_thread_new() when the thread is created.
  1103. */
  1104. #ifndef TCPIP_THREAD_STACKSIZE
  1105. #define TCPIP_THREAD_STACKSIZE 0
  1106. #endif
  1107. /**
  1108. * TCPIP_THREAD_PRIO: The priority assigned to the main tcpip thread.
  1109. * The priority value itself is platform-dependent, but is passed to
  1110. * sys_thread_new() when the thread is created.
  1111. */
  1112. #ifndef TCPIP_THREAD_PRIO
  1113. #define TCPIP_THREAD_PRIO 1
  1114. #endif
  1115. /**
  1116. * TCPIP_MBOX_SIZE: The mailbox size for the tcpip thread messages
  1117. * The queue size value itself is platform-dependent, but is passed to
  1118. * sys_mbox_new() when tcpip_init is called.
  1119. */
  1120. #ifndef TCPIP_MBOX_SIZE
  1121. #define TCPIP_MBOX_SIZE 0
  1122. #endif
  1123. /**
  1124. * SLIPIF_THREAD_NAME: The name assigned to the slipif_loop thread.
  1125. */
  1126. #ifndef SLIPIF_THREAD_NAME
  1127. #define SLIPIF_THREAD_NAME "slipif_loop"
  1128. #endif
  1129. /**
  1130. * SLIP_THREAD_STACKSIZE: The stack size used by the slipif_loop thread.
  1131. * The stack size value itself is platform-dependent, but is passed to
  1132. * sys_thread_new() when the thread is created.
  1133. */
  1134. #ifndef SLIPIF_THREAD_STACKSIZE
  1135. #define SLIPIF_THREAD_STACKSIZE 0
  1136. #endif
  1137. /**
  1138. * SLIPIF_THREAD_PRIO: The priority assigned to the slipif_loop thread.
  1139. * The priority value itself is platform-dependent, but is passed to
  1140. * sys_thread_new() when the thread is created.
  1141. */
  1142. #ifndef SLIPIF_THREAD_PRIO
  1143. #define SLIPIF_THREAD_PRIO 1
  1144. #endif
  1145. /**
  1146. * PPP_THREAD_NAME: The name assigned to the pppInputThread.
  1147. */
  1148. #ifndef PPP_THREAD_NAME
  1149. #define PPP_THREAD_NAME "pppInputThread"
  1150. #endif
  1151. /**
  1152. * PPP_THREAD_STACKSIZE: The stack size used by the pppInputThread.
  1153. * The stack size value itself is platform-dependent, but is passed to
  1154. * sys_thread_new() when the thread is created.
  1155. */
  1156. #ifndef PPP_THREAD_STACKSIZE
  1157. #define PPP_THREAD_STACKSIZE 0
  1158. #endif
  1159. /**
  1160. * PPP_THREAD_PRIO: The priority assigned to the pppInputThread.
  1161. * The priority value itself is platform-dependent, but is passed to
  1162. * sys_thread_new() when the thread is created.
  1163. */
  1164. #ifndef PPP_THREAD_PRIO
  1165. #define PPP_THREAD_PRIO 1
  1166. #endif
  1167. /**
  1168. * DEFAULT_THREAD_NAME: The name assigned to any other lwIP thread.
  1169. */
  1170. #ifndef DEFAULT_THREAD_NAME
  1171. #define DEFAULT_THREAD_NAME "lwIP"
  1172. #endif
  1173. /**
  1174. * DEFAULT_THREAD_STACKSIZE: The stack size used by any other lwIP thread.
  1175. * The stack size value itself is platform-dependent, but is passed to
  1176. * sys_thread_new() when the thread is created.
  1177. */
  1178. #ifndef DEFAULT_THREAD_STACKSIZE
  1179. #define DEFAULT_THREAD_STACKSIZE 0
  1180. #endif
  1181. /**
  1182. * DEFAULT_THREAD_PRIO: The priority assigned to any other lwIP thread.
  1183. * The priority value itself is platform-dependent, but is passed to
  1184. * sys_thread_new() when the thread is created.
  1185. */
  1186. #ifndef DEFAULT_THREAD_PRIO
  1187. #define DEFAULT_THREAD_PRIO 1
  1188. #endif
  1189. /**
  1190. * DEFAULT_RAW_RECVMBOX_SIZE: The mailbox size for the incoming packets on a
  1191. * NETCONN_RAW. The queue size value itself is platform-dependent, but is passed
  1192. * to sys_mbox_new() when the recvmbox is created.
  1193. */
  1194. #ifndef DEFAULT_RAW_RECVMBOX_SIZE
  1195. #define DEFAULT_RAW_RECVMBOX_SIZE 0
  1196. #endif
  1197. /**
  1198. * DEFAULT_UDP_RECVMBOX_SIZE: The mailbox size for the incoming packets on a
  1199. * NETCONN_UDP. The queue size value itself is platform-dependent, but is passed
  1200. * to sys_mbox_new() when the recvmbox is created.
  1201. */
  1202. #ifndef DEFAULT_UDP_RECVMBOX_SIZE
  1203. #define DEFAULT_UDP_RECVMBOX_SIZE 0
  1204. #endif
  1205. /**
  1206. * DEFAULT_TCP_RECVMBOX_SIZE: The mailbox size for the incoming packets on a
  1207. * NETCONN_TCP. The queue size value itself is platform-dependent, but is passed
  1208. * to sys_mbox_new() when the recvmbox is created.
  1209. */
  1210. #ifndef DEFAULT_TCP_RECVMBOX_SIZE
  1211. #define DEFAULT_TCP_RECVMBOX_SIZE 0
  1212. #endif
  1213. /**
  1214. * DEFAULT_ACCEPTMBOX_SIZE: The mailbox size for the incoming connections.
  1215. * The queue size value itself is platform-dependent, but is passed to
  1216. * sys_mbox_new() when the acceptmbox is created.
  1217. */
  1218. #ifndef DEFAULT_ACCEPTMBOX_SIZE
  1219. #define DEFAULT_ACCEPTMBOX_SIZE 0
  1220. #endif
  1221. /*
  1222. ----------------------------------------------
  1223. ---------- Sequential layer options ----------
  1224. ----------------------------------------------
  1225. */
  1226. /**
  1227. * LWIP_TCPIP_CORE_LOCKING: (EXPERIMENTAL!)
  1228. * Don't use it if you're not an active lwIP project member
  1229. */
  1230. #ifndef LWIP_TCPIP_CORE_LOCKING
  1231. #define LWIP_TCPIP_CORE_LOCKING 0
  1232. #endif
  1233. /**
  1234. * LWIP_TCPIP_CORE_LOCKING_INPUT: (EXPERIMENTAL!)
  1235. * Don't use it if you're not an active lwIP project member
  1236. */
  1237. #ifndef LWIP_TCPIP_CORE_LOCKING_INPUT
  1238. #define LWIP_TCPIP_CORE_LOCKING_INPUT 0
  1239. #endif
  1240. /**
  1241. * LWIP_NETCONN==1: Enable Netconn API (require to use api_lib.c)
  1242. */
  1243. #ifndef LWIP_NETCONN
  1244. #define LWIP_NETCONN 0
  1245. #endif
  1246. /** LWIP_TCPIP_TIMEOUT==1: Enable tcpip_timeout/tcpip_untimeout tod create
  1247. * timers running in tcpip_thread from another thread.
  1248. */
  1249. #ifndef LWIP_TCPIP_TIMEOUT
  1250. #define LWIP_TCPIP_TIMEOUT 1
  1251. #endif
  1252. /*
  1253. ------------------------------------
  1254. ---------- Socket options ----------
  1255. ------------------------------------
  1256. */
  1257. /**
  1258. * LWIP_SOCKET==1: Enable Socket API (require to use sockets.c)
  1259. */
  1260. #ifndef LWIP_SOCKET
  1261. #define LWIP_SOCKET 0
  1262. #endif
  1263. /**
  1264. * LWIP_COMPAT_SOCKETS==1: Enable BSD-style sockets functions names.
  1265. * (only used if you use sockets.c)
  1266. */
  1267. #ifndef LWIP_COMPAT_SOCKETS
  1268. #define LWIP_COMPAT_SOCKETS 0
  1269. #endif
  1270. /**
  1271. * LWIP_POSIX_SOCKETS_IO_NAMES==1: Enable POSIX-style sockets functions names.
  1272. * Disable this option if you use a POSIX operating system that uses the same
  1273. * names (read, write & close). (only used if you use sockets.c)
  1274. */
  1275. #ifndef LWIP_POSIX_SOCKETS_IO_NAMES
  1276. #define LWIP_POSIX_SOCKETS_IO_NAMES 0
  1277. #endif
  1278. /**
  1279. * LWIP_TCP_KEEPALIVE==1: Enable TCP_KEEPIDLE, TCP_KEEPINTVL and TCP_KEEPCNT
  1280. * options processing. Note that TCP_KEEPIDLE and TCP_KEEPINTVL have to be set
  1281. * in seconds. (does not require sockets.c, and will affect tcp.c)
  1282. */
  1283. #ifndef LWIP_TCP_KEEPALIVE
  1284. #define LWIP_TCP_KEEPALIVE 1
  1285. #endif
  1286. /**
  1287. * LWIP_SO_RCVTIMEO==1: Enable SO_RCVTIMEO processing.
  1288. */
  1289. #ifndef LWIP_SO_RCVTIMEO
  1290. #define LWIP_SO_RCVTIMEO 0
  1291. #endif
  1292. /**
  1293. * LWIP_SO_RCVBUF==1: Enable SO_RCVBUF processing.
  1294. */
  1295. #ifndef LWIP_SO_RCVBUF
  1296. #define LWIP_SO_RCVBUF 0
  1297. #endif
  1298. /**
  1299. * If LWIP_SO_RCVBUF is used, this is the default value for recv_bufsize.
  1300. */
  1301. #ifndef RECV_BUFSIZE_DEFAULT
  1302. #define RECV_BUFSIZE_DEFAULT INT_MAX
  1303. #endif
  1304. /**
  1305. * SO_REUSE==1: Enable SO_REUSEADDR option.
  1306. */
  1307. #ifndef SO_REUSE
  1308. /* See https://github.com/nodemcu/nodemcu-firmware/issues/1836 for details */
  1309. #define SO_REUSE 1
  1310. #endif
  1311. /**
  1312. * SO_REUSE_RXTOALL==1: Pass a copy of incoming broadcast/multicast packets
  1313. * to all local matches if SO_REUSEADDR is turned on.
  1314. * WARNING: Adds a memcpy for every packet if passing to more than one pcb!
  1315. */
  1316. #ifndef SO_REUSE_RXTOALL
  1317. #define SO_REUSE_RXTOALL 0
  1318. #endif
  1319. /*
  1320. ----------------------------------------
  1321. ---------- Statistics options ----------
  1322. ----------------------------------------
  1323. */
  1324. /**
  1325. * LWIP_STATS==1: Enable statistics collection in lwip_stats.
  1326. */
  1327. #ifndef LWIP_STATS
  1328. #define LWIP_STATS 0
  1329. #endif
  1330. #if LWIP_STATS
  1331. /**
  1332. * LWIP_STATS_DISPLAY==1: Compile in the statistics output functions.
  1333. */
  1334. #ifndef LWIP_STATS_DISPLAY
  1335. #define LWIP_STATS_DISPLAY 0
  1336. #endif
  1337. /**
  1338. * LINK_STATS==1: Enable link stats.
  1339. */
  1340. #ifndef LINK_STATS
  1341. #define LINK_STATS 1
  1342. #endif
  1343. /**
  1344. * ETHARP_STATS==1: Enable etharp stats.
  1345. */
  1346. #ifndef ETHARP_STATS
  1347. #define ETHARP_STATS (LWIP_ARP)
  1348. #endif
  1349. /**
  1350. * IP_STATS==1: Enable IP stats.
  1351. */
  1352. #ifndef IP_STATS
  1353. #define IP_STATS 1
  1354. #endif
  1355. /**
  1356. * IPFRAG_STATS==1: Enable IP fragmentation stats. Default is
  1357. * on if using either frag or reass.
  1358. */
  1359. #ifndef IPFRAG_STATS
  1360. #define IPFRAG_STATS (IP_REASSEMBLY || IP_FRAG)
  1361. #endif
  1362. /**
  1363. * ICMP_STATS==1: Enable ICMP stats.
  1364. */
  1365. #ifndef ICMP_STATS
  1366. #define ICMP_STATS 1
  1367. #endif
  1368. /**
  1369. * IGMP_STATS==1: Enable IGMP stats.
  1370. */
  1371. #ifndef IGMP_STATS
  1372. #define IGMP_STATS (LWIP_IGMP)
  1373. #endif
  1374. /**
  1375. * UDP_STATS==1: Enable UDP stats. Default is on if
  1376. * UDP enabled, otherwise off.
  1377. */
  1378. #ifndef UDP_STATS
  1379. #define UDP_STATS (LWIP_UDP)
  1380. #endif
  1381. /**
  1382. * TCP_STATS==1: Enable TCP stats. Default is on if TCP
  1383. * enabled, otherwise off.
  1384. */
  1385. #ifndef TCP_STATS
  1386. #define TCP_STATS (LWIP_TCP)
  1387. #endif
  1388. /**
  1389. * MEM_STATS==1: Enable mem.c stats.
  1390. */
  1391. #ifndef MEM_STATS
  1392. #define MEM_STATS ((MEM_LIBC_MALLOC == 0) && (MEM_USE_POOLS == 0))
  1393. #endif
  1394. /**
  1395. * MEMP_STATS==1: Enable memp.c pool stats.
  1396. */
  1397. #ifndef MEMP_STATS
  1398. #define MEMP_STATS (MEMP_MEM_MALLOC == 0)
  1399. #endif
  1400. /**
  1401. * SYS_STATS==1: Enable system stats (sem and mbox counts, etc).
  1402. */
  1403. #ifndef SYS_STATS
  1404. #define SYS_STATS (NO_SYS == 0)
  1405. #endif
  1406. #else
  1407. #define ETHARP_STATS 0
  1408. #define LINK_STATS 0
  1409. #define IP_STATS 0
  1410. #define IPFRAG_STATS 0
  1411. #define ICMP_STATS 0
  1412. #define IGMP_STATS 0
  1413. #define UDP_STATS 0
  1414. #define TCP_STATS 0
  1415. #define MEM_STATS 0
  1416. #define MEMP_STATS 0
  1417. #define SYS_STATS 0
  1418. #define LWIP_STATS_DISPLAY 0
  1419. #endif /* LWIP_STATS */
  1420. /*
  1421. ---------------------------------
  1422. ---------- PPP options ----------
  1423. ---------------------------------
  1424. */
  1425. /**
  1426. * PPP_SUPPORT==1: Enable PPP.
  1427. */
  1428. #ifndef PPP_SUPPORT
  1429. #define PPP_SUPPORT 0
  1430. #endif
  1431. /**
  1432. * PPPOE_SUPPORT==1: Enable PPP Over Ethernet
  1433. */
  1434. #ifndef PPPOE_SUPPORT
  1435. #define PPPOE_SUPPORT 0
  1436. #endif
  1437. /**
  1438. * PPPOS_SUPPORT==1: Enable PPP Over Serial
  1439. */
  1440. #ifndef PPPOS_SUPPORT
  1441. #define PPPOS_SUPPORT PPP_SUPPORT
  1442. #endif
  1443. #if PPP_SUPPORT
  1444. /**
  1445. * NUM_PPP: Max PPP sessions.
  1446. */
  1447. #ifndef NUM_PPP
  1448. #define NUM_PPP 1
  1449. #endif
  1450. /**
  1451. * PAP_SUPPORT==1: Support PAP.
  1452. */
  1453. #ifndef PAP_SUPPORT
  1454. #define PAP_SUPPORT 0
  1455. #endif
  1456. /**
  1457. * CHAP_SUPPORT==1: Support CHAP.
  1458. */
  1459. #ifndef CHAP_SUPPORT
  1460. #define CHAP_SUPPORT 0
  1461. #endif
  1462. /**
  1463. * MSCHAP_SUPPORT==1: Support MSCHAP. CURRENTLY NOT SUPPORTED! DO NOT SET!
  1464. */
  1465. #ifndef MSCHAP_SUPPORT
  1466. #define MSCHAP_SUPPORT 0
  1467. #endif
  1468. /**
  1469. * CBCP_SUPPORT==1: Support CBCP. CURRENTLY NOT SUPPORTED! DO NOT SET!
  1470. */
  1471. #ifndef CBCP_SUPPORT
  1472. #define CBCP_SUPPORT 0
  1473. #endif
  1474. /**
  1475. * CCP_SUPPORT==1: Support CCP. CURRENTLY NOT SUPPORTED! DO NOT SET!
  1476. */
  1477. #ifndef CCP_SUPPORT
  1478. #define CCP_SUPPORT 0
  1479. #endif
  1480. /**
  1481. * VJ_SUPPORT==1: Support VJ header compression.
  1482. */
  1483. #ifndef VJ_SUPPORT
  1484. #define VJ_SUPPORT 0
  1485. #endif
  1486. /**
  1487. * MD5_SUPPORT==1: Support MD5 (see also CHAP).
  1488. */
  1489. #ifndef MD5_SUPPORT
  1490. #define MD5_SUPPORT 0
  1491. #endif
  1492. /*
  1493. * Timeouts
  1494. */
  1495. #ifndef FSM_DEFTIMEOUT
  1496. #define FSM_DEFTIMEOUT 6 /* Timeout time in seconds */
  1497. #endif
  1498. #ifndef FSM_DEFMAXTERMREQS
  1499. #define FSM_DEFMAXTERMREQS 2 /* Maximum Terminate-Request transmissions */
  1500. #endif
  1501. #ifndef FSM_DEFMAXCONFREQS
  1502. #define FSM_DEFMAXCONFREQS 10 /* Maximum Configure-Request transmissions */
  1503. #endif
  1504. #ifndef FSM_DEFMAXNAKLOOPS
  1505. #define FSM_DEFMAXNAKLOOPS 5 /* Maximum number of nak loops */
  1506. #endif
  1507. #ifndef UPAP_DEFTIMEOUT
  1508. #define UPAP_DEFTIMEOUT 6 /* Timeout (seconds) for retransmitting req */
  1509. #endif
  1510. #ifndef UPAP_DEFREQTIME
  1511. #define UPAP_DEFREQTIME 30 /* Time to wait for auth-req from peer */
  1512. #endif
  1513. #ifndef CHAP_DEFTIMEOUT
  1514. #define CHAP_DEFTIMEOUT 6 /* Timeout time in seconds */
  1515. #endif
  1516. #ifndef CHAP_DEFTRANSMITS
  1517. #define CHAP_DEFTRANSMITS 10 /* max # times to send challenge */
  1518. #endif
  1519. /* Interval in seconds between keepalive echo requests, 0 to disable. */
  1520. #ifndef LCP_ECHOINTERVAL
  1521. #define LCP_ECHOINTERVAL 0
  1522. #endif
  1523. /* Number of unanswered echo requests before failure. */
  1524. #ifndef LCP_MAXECHOFAILS
  1525. #define LCP_MAXECHOFAILS 3
  1526. #endif
  1527. /* Max Xmit idle time (in jiffies) before resend flag char. */
  1528. #ifndef PPP_MAXIDLEFLAG
  1529. #define PPP_MAXIDLEFLAG 100
  1530. #endif
  1531. /*
  1532. * Packet sizes
  1533. *
  1534. * Note - lcp shouldn't be allowed to negotiate stuff outside these
  1535. * limits. See lcp.h in the pppd directory.
  1536. * (XXX - these constants should simply be shared by lcp.c instead
  1537. * of living in lcp.h)
  1538. */
  1539. #define PPP_MTU 1500 /* Default MTU (size of Info field) */
  1540. #ifndef PPP_MAXMTU
  1541. /* #define PPP_MAXMTU 65535 - (PPP_HDRLEN + PPP_FCSLEN) */
  1542. #define PPP_MAXMTU 1500 /* Largest MTU we allow */
  1543. #endif
  1544. #define PPP_MINMTU 64
  1545. #define PPP_MRU 1500 /* default MRU = max length of info field */
  1546. #define PPP_MAXMRU 1500 /* Largest MRU we allow */
  1547. #ifndef PPP_DEFMRU
  1548. #define PPP_DEFMRU 296 /* Try for this */
  1549. #endif
  1550. #define PPP_MINMRU 128 /* No MRUs below this */
  1551. #ifndef MAXNAMELEN
  1552. #define MAXNAMELEN 256 /* max length of hostname or name for auth */
  1553. #endif
  1554. #ifndef MAXSECRETLEN
  1555. #define MAXSECRETLEN 256 /* max length of password or secret */
  1556. #endif
  1557. #endif /* PPP_SUPPORT */
  1558. /*
  1559. --------------------------------------
  1560. ---------- Checksum options ----------
  1561. --------------------------------------
  1562. */
  1563. /**
  1564. * CHECKSUM_GEN_IP==1: Generate checksums in software for outgoing IP packets.
  1565. */
  1566. #ifndef CHECKSUM_GEN_IP
  1567. #define CHECKSUM_GEN_IP 1
  1568. #endif
  1569. /**
  1570. * CHECKSUM_GEN_UDP==1: Generate checksums in software for outgoing UDP packets.
  1571. */
  1572. #ifndef CHECKSUM_GEN_UDP
  1573. #define CHECKSUM_GEN_UDP 1
  1574. #endif
  1575. /**
  1576. * CHECKSUM_GEN_TCP==1: Generate checksums in software for outgoing TCP packets.
  1577. */
  1578. #ifndef CHECKSUM_GEN_TCP
  1579. #define CHECKSUM_GEN_TCP 1
  1580. #endif
  1581. /**
  1582. * CHECKSUM_CHECK_IP==1: Check checksums in software for incoming IP packets.
  1583. */
  1584. #ifndef CHECKSUM_CHECK_IP
  1585. #define CHECKSUM_CHECK_IP 1
  1586. #endif
  1587. /**
  1588. * CHECKSUM_CHECK_UDP==1: Check checksums in software for incoming UDP packets.
  1589. */
  1590. #ifndef CHECKSUM_CHECK_UDP
  1591. #define CHECKSUM_CHECK_UDP 1
  1592. #endif
  1593. /**
  1594. * CHECKSUM_CHECK_TCP==1: Check checksums in software for incoming TCP packets.
  1595. */
  1596. #ifndef CHECKSUM_CHECK_TCP
  1597. #define CHECKSUM_CHECK_TCP 1
  1598. #endif
  1599. /**
  1600. * LWIP_CHECKSUM_ON_COPY==1: Calculate checksum when copying data from
  1601. * application buffers to pbufs.
  1602. */
  1603. #ifndef LWIP_CHECKSUM_ON_COPY
  1604. #define LWIP_CHECKSUM_ON_COPY 0
  1605. #endif
  1606. /*
  1607. ---------------------------------------
  1608. ---------- Debugging options ----------
  1609. ---------------------------------------
  1610. */
  1611. /**
  1612. * LWIP_DBG_MIN_LEVEL: After masking, the value of the debug is
  1613. * compared against this value. If it is smaller, then debugging
  1614. * messages are written.
  1615. */
  1616. #ifndef LWIP_DBG_MIN_LEVEL
  1617. #define LWIP_DBG_MIN_LEVEL LWIP_DBG_LEVEL_ALL
  1618. #endif
  1619. /**
  1620. * LWIP_DBG_TYPES_ON: A mask that can be used to globally enable/disable
  1621. * debug messages of certain types.
  1622. */
  1623. #ifndef LWIP_DBG_TYPES_ON
  1624. #define LWIP_DBG_TYPES_ON LWIP_DBG_OFF
  1625. #endif
  1626. /**
  1627. * ETHARP_DEBUG: Enable debugging in etharp.c.
  1628. */
  1629. #ifndef ETHARP_DEBUG
  1630. #define ETHARP_DEBUG LWIP_DBG_OFF
  1631. #endif
  1632. /**
  1633. * NETIF_DEBUG: Enable debugging in netif.c.
  1634. */
  1635. #ifndef NETIF_DEBUG
  1636. #define NETIF_DEBUG LWIP_DBG_OFF
  1637. #endif
  1638. /**
  1639. * PBUF_DEBUG: Enable debugging in pbuf.c.
  1640. */
  1641. #ifndef PBUF_DEBUG
  1642. #define PBUF_DEBUG LWIP_DBG_OFF
  1643. #endif
  1644. /**
  1645. * API_LIB_DEBUG: Enable debugging in api_lib.c.
  1646. */
  1647. #ifndef API_LIB_DEBUG
  1648. #define API_LIB_DEBUG LWIP_DBG_OFF
  1649. #endif
  1650. /**
  1651. * API_MSG_DEBUG: Enable debugging in api_msg.c.
  1652. */
  1653. #ifndef API_MSG_DEBUG
  1654. #define API_MSG_DEBUG LWIP_DBG_OFF
  1655. #endif
  1656. /**
  1657. * SOCKETS_DEBUG: Enable debugging in sockets.c.
  1658. */
  1659. #ifndef SOCKETS_DEBUG
  1660. #define SOCKETS_DEBUG LWIP_DBG_OFF
  1661. #endif
  1662. /**
  1663. * ICMP_DEBUG: Enable debugging in icmp.c.
  1664. */
  1665. #ifndef ICMP_DEBUG
  1666. #define ICMP_DEBUG LWIP_DBG_OFF
  1667. #endif
  1668. /**
  1669. * IGMP_DEBUG: Enable debugging in igmp.c.
  1670. */
  1671. #ifndef IGMP_DEBUG
  1672. #define IGMP_DEBUG LWIP_DBG_OFF
  1673. #endif
  1674. /**
  1675. * INET_DEBUG: Enable debugging in inet.c.
  1676. */
  1677. #ifndef INET_DEBUG
  1678. #define INET_DEBUG LWIP_DBG_OFF
  1679. #endif
  1680. /**
  1681. * IP_DEBUG: Enable debugging for IP.
  1682. */
  1683. #ifndef IP_DEBUG
  1684. #define IP_DEBUG LWIP_DBG_OFF
  1685. #endif
  1686. /**
  1687. * IP_REASS_DEBUG: Enable debugging in ip_frag.c for both frag & reass.
  1688. */
  1689. #ifndef IP_REASS_DEBUG
  1690. #define IP_REASS_DEBUG LWIP_DBG_OFF
  1691. #endif
  1692. /**
  1693. * RAW_DEBUG: Enable debugging in raw.c.
  1694. */
  1695. #ifndef RAW_DEBUG
  1696. #define RAW_DEBUG LWIP_DBG_OFF
  1697. #endif
  1698. /**
  1699. * MEM_DEBUG: Enable debugging in mem.c.
  1700. */
  1701. #ifndef MEM_DEBUG
  1702. #define MEM_DEBUG LWIP_DBG_OFF
  1703. #endif
  1704. /**
  1705. * MEMP_DEBUG: Enable debugging in memp.c.
  1706. */
  1707. #ifndef MEMP_DEBUG
  1708. #define MEMP_DEBUG LWIP_DBG_OFF
  1709. #endif
  1710. /**
  1711. * SYS_DEBUG: Enable debugging in sys.c.
  1712. */
  1713. #ifndef SYS_DEBUG
  1714. #define SYS_DEBUG LWIP_DBG_OFF
  1715. #endif
  1716. /**
  1717. * TIMERS_DEBUG: Enable debugging in timers.c.
  1718. */
  1719. #ifndef TIMERS_DEBUG
  1720. #define TIMERS_DEBUG LWIP_DBG_OFF
  1721. #endif
  1722. /**
  1723. * TCP_DEBUG: Enable debugging for TCP.
  1724. */
  1725. #ifndef TCP_DEBUG
  1726. #define TCP_DEBUG LWIP_DBG_OFF
  1727. #endif
  1728. /**
  1729. * TCP_INPUT_DEBUG: Enable debugging in tcp_in.c for incoming debug.
  1730. */
  1731. #ifndef TCP_INPUT_DEBUG
  1732. #define TCP_INPUT_DEBUG LWIP_DBG_OFF
  1733. #endif
  1734. /**
  1735. * TCP_FR_DEBUG: Enable debugging in tcp_in.c for fast retransmit.
  1736. */
  1737. #ifndef TCP_FR_DEBUG
  1738. #define TCP_FR_DEBUG LWIP_DBG_OFF
  1739. #endif
  1740. /**
  1741. * TCP_RTO_DEBUG: Enable debugging in TCP for retransmit
  1742. * timeout.
  1743. */
  1744. #ifndef TCP_RTO_DEBUG
  1745. #define TCP_RTO_DEBUG LWIP_DBG_OFF
  1746. #endif
  1747. /**
  1748. * TCP_CWND_DEBUG: Enable debugging for TCP congestion window.
  1749. */
  1750. #ifndef TCP_CWND_DEBUG
  1751. #define TCP_CWND_DEBUG LWIP_DBG_OFF
  1752. #endif
  1753. /**
  1754. * TCP_WND_DEBUG: Enable debugging in tcp_in.c for window updating.
  1755. */
  1756. #ifndef TCP_WND_DEBUG
  1757. #define TCP_WND_DEBUG LWIP_DBG_OFF
  1758. #endif
  1759. /**
  1760. * TCP_OUTPUT_DEBUG: Enable debugging in tcp_out.c output functions.
  1761. */
  1762. #ifndef TCP_OUTPUT_DEBUG
  1763. #define TCP_OUTPUT_DEBUG LWIP_DBG_OFF
  1764. #endif
  1765. /**
  1766. * TCP_RST_DEBUG: Enable debugging for TCP with the RST message.
  1767. */
  1768. #ifndef TCP_RST_DEBUG
  1769. #define TCP_RST_DEBUG LWIP_DBG_OFF
  1770. #endif
  1771. /**
  1772. * TCP_QLEN_DEBUG: Enable debugging for TCP queue lengths.
  1773. */
  1774. #ifndef TCP_QLEN_DEBUG
  1775. #define TCP_QLEN_DEBUG LWIP_DBG_OFF
  1776. #endif
  1777. /**
  1778. * UDP_DEBUG: Enable debugging in UDP.
  1779. */
  1780. #ifndef UDP_DEBUG
  1781. #define UDP_DEBUG LWIP_DBG_OFF
  1782. #endif
  1783. /**
  1784. * TCPIP_DEBUG: Enable debugging in tcpip.c.
  1785. */
  1786. #ifndef TCPIP_DEBUG
  1787. #define TCPIP_DEBUG LWIP_DBG_OFF
  1788. #endif
  1789. /**
  1790. * PPP_DEBUG: Enable debugging for PPP.
  1791. */
  1792. #ifndef PPP_DEBUG
  1793. #define PPP_DEBUG LWIP_DBG_OFF
  1794. #endif
  1795. /**
  1796. * SLIP_DEBUG: Enable debugging in slipif.c.
  1797. */
  1798. #ifndef SLIP_DEBUG
  1799. #define SLIP_DEBUG LWIP_DBG_OFF
  1800. #endif
  1801. /**
  1802. * DHCP_DEBUG: Enable debugging in dhcp.c.
  1803. */
  1804. #ifndef DHCP_DEBUG
  1805. #define DHCP_DEBUG LWIP_DBG_OFF
  1806. #endif
  1807. /**
  1808. * AUTOIP_DEBUG: Enable debugging in autoip.c.
  1809. */
  1810. #ifndef AUTOIP_DEBUG
  1811. #define AUTOIP_DEBUG LWIP_DBG_OFF
  1812. #endif
  1813. /**
  1814. * SNMP_MSG_DEBUG: Enable debugging for SNMP messages.
  1815. */
  1816. #ifndef SNMP_MSG_DEBUG
  1817. #define SNMP_MSG_DEBUG LWIP_DBG_OFF
  1818. #endif
  1819. /**
  1820. * SNMP_MIB_DEBUG: Enable debugging for SNMP MIBs.
  1821. */
  1822. #ifndef SNMP_MIB_DEBUG
  1823. #define SNMP_MIB_DEBUG LWIP_DBG_OFF
  1824. #endif
  1825. /**
  1826. * DNS_DEBUG: Enable debugging for DNS.
  1827. */
  1828. #ifndef DNS_DEBUG
  1829. #define DNS_DEBUG LWIP_DBG_OFF
  1830. #endif
  1831. #endif /* __LWIP_OPT_H__ */