init.c 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376
  1. /**
  2. * @file
  3. * Modules initialization
  4. *
  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. #include "lwip/opt.h"
  38. #include "lwip/init.h"
  39. #include "lwip/stats.h"
  40. #include "lwip/sys.h"
  41. #include "lwip/mem.h"
  42. #include "lwip/memp.h"
  43. #include "lwip/pbuf.h"
  44. #include "lwip/netif.h"
  45. #include "lwip/sockets.h"
  46. #include "lwip/ip.h"
  47. #include "lwip/raw.h"
  48. #include "lwip/udp.h"
  49. #include "lwip/priv/tcp_priv.h"
  50. #include "lwip/autoip.h"
  51. #include "lwip/igmp.h"
  52. #include "lwip/dns.h"
  53. #include "lwip/timers.h"
  54. #include "netif/etharp.h"
  55. #include "lwip/ip6.h"
  56. #include "lwip/nd6.h"
  57. #include "lwip/mld6.h"
  58. #include "lwip/api.h"
  59. #include "netif/ppp/ppp_impl.h"
  60. #if ! ESP_PERF
  61. /* Compile-time sanity checks for configuration errors.
  62. * These can be done independently of LWIP_DEBUG, without penalty.
  63. */
  64. #ifndef BYTE_ORDER
  65. #error "BYTE_ORDER is not defined, you have to define it in your cc.h"
  66. #endif
  67. #if (!IP_SOF_BROADCAST && IP_SOF_BROADCAST_RECV)
  68. #error "If you want to use broadcast filter per pcb on recv operations, you have to define IP_SOF_BROADCAST=1 in your lwipopts.h"
  69. #endif
  70. #if (!LWIP_UDP && LWIP_UDPLITE)
  71. #error "If you want to use UDP Lite, you have to define LWIP_UDP=1 in your lwipopts.h"
  72. #endif
  73. #if (!LWIP_UDP && LWIP_DHCP)
  74. #error "If you want to use DHCP, you have to define LWIP_UDP=1 in your lwipopts.h"
  75. #endif
  76. #if (!LWIP_UDP && LWIP_MULTICAST_TX_OPTIONS)
  77. #error "If you want to use IGMP/LWIP_MULTICAST_TX_OPTIONS, you have to define LWIP_UDP=1 in your lwipopts.h"
  78. #endif
  79. #if (!LWIP_UDP && LWIP_DNS)
  80. #error "If you want to use DNS, you have to define LWIP_UDP=1 in your lwipopts.h"
  81. #endif
  82. #if !MEMP_MEM_MALLOC /* MEMP_NUM_* checks are disabled when not using the pool allocator */
  83. #if (LWIP_ARP && ARP_QUEUEING && (MEMP_NUM_ARP_QUEUE<=0))
  84. #error "If you want to use ARP Queueing, you have to define MEMP_NUM_ARP_QUEUE>=1 in your lwipopts.h"
  85. #endif
  86. #if (LWIP_RAW && (MEMP_NUM_RAW_PCB<=0))
  87. #error "If you want to use RAW, you have to define MEMP_NUM_RAW_PCB>=1 in your lwipopts.h"
  88. #endif
  89. #if (LWIP_UDP && (MEMP_NUM_UDP_PCB<=0))
  90. #error "If you want to use UDP, you have to define MEMP_NUM_UDP_PCB>=1 in your lwipopts.h"
  91. #endif
  92. #if (LWIP_TCP && (MEMP_NUM_TCP_PCB<=0))
  93. #error "If you want to use TCP, you have to define MEMP_NUM_TCP_PCB>=1 in your lwipopts.h"
  94. #endif
  95. #if (LWIP_IGMP && (MEMP_NUM_IGMP_GROUP<=1))
  96. #error "If you want to use IGMP, you have to define MEMP_NUM_IGMP_GROUP>1 in your lwipopts.h"
  97. #endif
  98. #if (LWIP_IGMP && !LWIP_MULTICAST_TX_OPTIONS)
  99. #error "If you want to use IGMP, you have to define LWIP_MULTICAST_TX_OPTIONS==1 in your lwipopts.h"
  100. #endif
  101. #if (LWIP_IGMP && !LWIP_IPV4)
  102. #error "IGMP needs LWIP_IPV4 enabled in your lwipopts.h"
  103. #endif
  104. #if (LWIP_MULTICAST_TX_OPTIONS && !LWIP_IPV4)
  105. #error "LWIP_MULTICAST_TX_OPTIONS needs LWIP_IPV4 enabled in your lwipopts.h"
  106. #endif
  107. #if ((LWIP_NETCONN || LWIP_SOCKET) && (MEMP_NUM_TCPIP_MSG_API<=0))
  108. #error "If you want to use Sequential API, you have to define MEMP_NUM_TCPIP_MSG_API>=1 in your lwipopts.h"
  109. #endif
  110. /* There must be sufficient timeouts, taking into account requirements of the subsystems. */
  111. #if LWIP_TIMERS && (MEMP_NUM_SYS_TIMEOUT < (LWIP_TCP + IP_REASSEMBLY + LWIP_ARP + (2*LWIP_DHCP) + LWIP_AUTOIP + LWIP_IGMP + LWIP_DNS + PPP_SUPPORT + (LWIP_IPV6 ? (1 + LWIP_IPV6_REASS + LWIP_IPV6_MLD) : 0)))
  112. #error "MEMP_NUM_SYS_TIMEOUT is too low to accomodate all required timeouts"
  113. #endif
  114. #if (IP_REASSEMBLY && (MEMP_NUM_REASSDATA > IP_REASS_MAX_PBUFS))
  115. #error "MEMP_NUM_REASSDATA > IP_REASS_MAX_PBUFS doesn't make sense since each struct ip_reassdata must hold 2 pbufs at least!"
  116. #endif
  117. #endif /* !MEMP_MEM_MALLOC */
  118. #if LWIP_WND_SCALE
  119. //#if (LWIP_TCP && (TCP_WND > 0xffffffff))
  120. //#error "If you want to use TCP, TCP_WND must fit in an u32_t, so, you have to reduce it in your lwipopts.h"
  121. //#endif
  122. #if (LWIP_TCP && LWIP_WND_SCALE && (TCP_RCV_SCALE > 14))
  123. #error "The maximum valid window scale value is 14!"
  124. #endif
  125. //#if (LWIP_TCP && (TCP_WND > (0xFFFFU << TCP_RCV_SCALE)))
  126. //#error "TCP_WND is bigger than the configured LWIP_WND_SCALE allows!"
  127. //#endif
  128. //#if (LWIP_TCP && ((TCP_WND >> TCP_RCV_SCALE) == 0))
  129. //#error "TCP_WND is too small for the configured LWIP_WND_SCALE (results in zero window)!"
  130. //#endif
  131. #else /* LWIP_WND_SCALE */
  132. #if ! ESP_PER_SOC_TCP_WND
  133. #if (LWIP_TCP && (TCP_WND > 0xffff))
  134. #error "If you want to use TCP, TCP_WND must fit in an u16_t, so, you have to reduce it in your lwipopts.h (or enable window scaling)"
  135. #endif
  136. #endif
  137. #endif /* LWIP_WND_SCALE */
  138. #if ! ESP_PER_SOC_TCP_WND
  139. #if (LWIP_TCP && (TCP_SND_QUEUELEN(0) > 0xffff))
  140. #error "If you want to use TCP, TCP_SND_QUEUELEN must fit in an u16_t, so, you have to reduce it in your lwipopts.h"
  141. #endif
  142. #if (LWIP_TCP && (TCP_SND_QUEUELEN(0) < 2))
  143. #error "TCP_SND_QUEUELEN must be at least 2 for no-copy TCP writes to work"
  144. #endif
  145. #if (LWIP_TCP && ((TCP_MAXRTX > 12) || (TCP_SYNMAXRTX > 12)))
  146. #error "If you want to use TCP, TCP_MAXRTX and TCP_SYNMAXRTX must less or equal to 12 (due to tcp_backoff table), so, you have to reduce them in your lwipopts.h"
  147. #endif
  148. #endif
  149. #if (LWIP_TCP && TCP_LISTEN_BACKLOG && ((TCP_DEFAULT_LISTEN_BACKLOG < 0) || (TCP_DEFAULT_LISTEN_BACKLOG > 0xff)))
  150. #error "If you want to use TCP backlog, TCP_DEFAULT_LISTEN_BACKLOG must fit into an u8_t"
  151. #endif
  152. #if (LWIP_NETIF_API && (NO_SYS==1))
  153. #error "If you want to use NETIF API, you have to define NO_SYS=0 in your lwipopts.h"
  154. #endif
  155. #if ((LWIP_SOCKET || LWIP_NETCONN) && (NO_SYS==1))
  156. #error "If you want to use Sequential API, you have to define NO_SYS=0 in your lwipopts.h"
  157. #endif
  158. #if (LWIP_PPP_API && (NO_SYS==1))
  159. #error "If you want to use PPP API, you have to define NO_SYS=0 in your lwipopts.h"
  160. #endif
  161. #if (LWIP_PPP_API && (PPP_SUPPORT==0))
  162. #error "If you want to use PPP API, you have to enable PPP_SUPPORT in your lwipopts.h"
  163. #endif
  164. #if (((!LWIP_DHCP) || (!LWIP_AUTOIP)) && LWIP_DHCP_AUTOIP_COOP)
  165. #error "If you want to use DHCP/AUTOIP cooperation mode, you have to define LWIP_DHCP=1 and LWIP_AUTOIP=1 in your lwipopts.h"
  166. #endif
  167. #if (((!LWIP_DHCP) || (!LWIP_ARP)) && DHCP_DOES_ARP_CHECK)
  168. #error "If you want to use DHCP ARP checking, you have to define LWIP_DHCP=1 and LWIP_ARP=1 in your lwipopts.h"
  169. #endif
  170. #if (!LWIP_ARP && LWIP_AUTOIP)
  171. #error "If you want to use AUTOIP, you have to define LWIP_ARP=1 in your lwipopts.h"
  172. #endif
  173. #if (LWIP_TCP && ((LWIP_EVENT_API && LWIP_CALLBACK_API) || (!LWIP_EVENT_API && !LWIP_CALLBACK_API)))
  174. #error "One and exactly one of LWIP_EVENT_API and LWIP_CALLBACK_API has to be enabled in your lwipopts.h"
  175. #endif
  176. #if (MEM_LIBC_MALLOC && MEM_USE_POOLS)
  177. #error "MEM_LIBC_MALLOC and MEM_USE_POOLS may not both be simultaneously enabled in your lwipopts.h"
  178. #endif
  179. #if (MEM_USE_POOLS && !MEMP_USE_CUSTOM_POOLS)
  180. #error "MEM_USE_POOLS requires custom pools (MEMP_USE_CUSTOM_POOLS) to be enabled in your lwipopts.h"
  181. #endif
  182. #if (PBUF_POOL_BUFSIZE <= MEM_ALIGNMENT)
  183. #error "PBUF_POOL_BUFSIZE must be greater than MEM_ALIGNMENT or the offset may take the full first pbuf"
  184. #endif
  185. #if (DNS_LOCAL_HOSTLIST && !DNS_LOCAL_HOSTLIST_IS_DYNAMIC && !(defined(DNS_LOCAL_HOSTLIST_INIT)))
  186. #error "you have to define define DNS_LOCAL_HOSTLIST_INIT {{'host1', 0x123}, {'host2', 0x234}} to initialize DNS_LOCAL_HOSTLIST"
  187. #endif
  188. #if PPP_SUPPORT && !PPPOS_SUPPORT && !PPPOE_SUPPORT && !PPPOL2TP_SUPPORT
  189. #error "PPP_SUPPORT needs at least one of PPPOS_SUPPORT, PPPOE_SUPPORT or PPPOL2TP_SUPPORT turned on"
  190. #endif
  191. #if PPP_SUPPORT && !PPP_IPV4_SUPPORT && !PPP_IPV6_SUPPORT
  192. #error "PPP_SUPPORT needs PPP_IPV4_SUPPORT and/or PPP_IPV6_SUPPORT turned on"
  193. #endif
  194. #if PPP_SUPPORT && PPP_IPV4_SUPPORT && !LWIP_IPV4
  195. #error "PPP_IPV4_SUPPORT needs LWIP_IPV4 turned on"
  196. #endif
  197. #if PPP_SUPPORT && PPP_IPV6_SUPPORT && !LWIP_IPV6
  198. #error "PPP_IPV6_SUPPORT needs LWIP_IPV6 turned on"
  199. #endif
  200. #if !LWIP_ETHERNET && (LWIP_ARP || PPPOE_SUPPORT)
  201. #error "LWIP_ETHERNET needs to be turned on for LWIP_ARP or PPPOE_SUPPORT"
  202. #endif
  203. #if (LWIP_IGMP || LWIP_IPV6) && !defined(LWIP_RAND)
  204. #error "When using IGMP or IPv6, LWIP_RAND() needs to be defined to a random-function returning an u32_t random value"
  205. #endif
  206. #if LWIP_TCPIP_CORE_LOCKING_INPUT && !LWIP_TCPIP_CORE_LOCKING
  207. #error "When using LWIP_TCPIP_CORE_LOCKING_INPUT, LWIP_TCPIP_CORE_LOCKING must be enabled, too"
  208. #endif
  209. #if LWIP_TCP && LWIP_NETIF_TX_SINGLE_PBUF && !TCP_OVERSIZE
  210. #error "LWIP_NETIF_TX_SINGLE_PBUF needs TCP_OVERSIZE enabled to create single-pbuf TCP packets"
  211. #endif
  212. #if IP_FRAG && IP_FRAG_USES_STATIC_BUF && LWIP_NETIF_TX_SINGLE_PBUF
  213. #error "LWIP_NETIF_TX_SINGLE_PBUF does not work with IP_FRAG_USES_STATIC_BUF==1 as that creates pbuf queues"
  214. #endif
  215. #if LWIP_NETCONN && LWIP_TCP
  216. #if NETCONN_COPY != TCP_WRITE_FLAG_COPY
  217. #error "NETCONN_COPY != TCP_WRITE_FLAG_COPY"
  218. #endif
  219. #if NETCONN_MORE != TCP_WRITE_FLAG_MORE
  220. #error "NETCONN_MORE != TCP_WRITE_FLAG_MORE"
  221. #endif
  222. #endif /* LWIP_NETCONN && LWIP_TCP */
  223. #if LWIP_SOCKET
  224. /* Check that the SO_* socket options and SOF_* lwIP-internal flags match */
  225. #if SO_REUSEADDR != SOF_REUSEADDR
  226. #error "WARNING: SO_REUSEADDR != SOF_REUSEADDR"
  227. #endif
  228. #if SO_KEEPALIVE != SOF_KEEPALIVE
  229. #error "WARNING: SO_KEEPALIVE != SOF_KEEPALIVE"
  230. #endif
  231. #if SO_BROADCAST != SOF_BROADCAST
  232. #error "WARNING: SO_BROADCAST != SOF_BROADCAST"
  233. #endif
  234. #endif /* LWIP_SOCKET */
  235. /* Compile-time checks for deprecated options.
  236. */
  237. #ifdef MEMP_NUM_TCPIP_MSG
  238. #error "MEMP_NUM_TCPIP_MSG option is deprecated. Remove it from your lwipopts.h."
  239. #endif
  240. #ifdef TCP_REXMIT_DEBUG
  241. #error "TCP_REXMIT_DEBUG option is deprecated. Remove it from your lwipopts.h."
  242. #endif
  243. #ifdef RAW_STATS
  244. #error "RAW_STATS option is deprecated. Remove it from your lwipopts.h."
  245. #endif
  246. #ifdef ETHARP_QUEUE_FIRST
  247. #error "ETHARP_QUEUE_FIRST option is deprecated. Remove it from your lwipopts.h."
  248. #endif
  249. #ifdef ETHARP_ALWAYS_INSERT
  250. #error "ETHARP_ALWAYS_INSERT option is deprecated. Remove it from your lwipopts.h."
  251. #endif
  252. #ifndef LWIP_DISABLE_TCP_SANITY_CHECKS
  253. #define LWIP_DISABLE_TCP_SANITY_CHECKS 0
  254. #endif
  255. #ifndef LWIP_DISABLE_MEMP_SANITY_CHECKS
  256. #define LWIP_DISABLE_MEMP_SANITY_CHECKS 0
  257. #endif
  258. /* MEMP sanity checks */
  259. #if !LWIP_DISABLE_MEMP_SANITY_CHECKS
  260. #if LWIP_NETCONN
  261. #if MEMP_MEM_MALLOC
  262. #if !MEMP_NUM_NETCONN && LWIP_SOCKET
  263. #error "lwip_sanity_check: WARNING: MEMP_NUM_NETCONN cannot be 0 when using sockets!"
  264. #endif
  265. #else /* MEMP_MEM_MALLOC */
  266. #if MEMP_NUM_NETCONN > (MEMP_NUM_TCP_PCB+MEMP_NUM_TCP_PCB_LISTEN+MEMP_NUM_UDP_PCB+MEMP_NUM_RAW_PCB)
  267. #error "lwip_sanity_check: WARNING: MEMP_NUM_NETCONN should be less than the sum of MEMP_NUM_{TCP,RAW,UDP}_PCB+MEMP_NUM_TCP_PCB_LISTEN. If you know what you are doing, define LWIP_DISABLE_MEMP_SANITY_CHECKS to 1 to disable this error."
  268. #endif
  269. #endif /* MEMP_MEM_MALLOC */
  270. #endif /* LWIP_NETCONN */
  271. #endif /* !LWIP_DISABLE_MEMP_SANITY_CHECKS */
  272. /* TCP sanity checks */
  273. #if !LWIP_DISABLE_TCP_SANITY_CHECKS
  274. #if ! ESP_PER_SOC_TCP_WND
  275. #if LWIP_TCP
  276. #if !MEMP_MEM_MALLOC && (MEMP_NUM_TCP_SEG < TCP_SND_QUEUELEN(0))
  277. #error "lwip_sanity_check: WARNING: MEMP_NUM_TCP_SEG should be at least as big as TCP_SND_QUEUELEN. If you know what you are doing, define LWIP_DISABLE_TCP_SANITY_CHECKS to 1 to disable this error."
  278. #endif
  279. #if TCP_SND_BUF(0) < (2 * TCP_MSS)
  280. #error "lwip_sanity_check: WARNING: TCP_SND_BUF must be at least as much as (2 * TCP_MSS) for things to work smoothly. If you know what you are doing, define LWIP_DISABLE_TCP_SANITY_CHECKS to 1 to disable this error."
  281. #endif
  282. #if TCP_SND_QUEUELEN(0) < (2 * (TCP_SND_BUF(0) / TCP_MSS))
  283. #error "lwip_sanity_check: WARNING: TCP_SND_QUEUELEN must be at least as much as (2 * TCP_SND_BUF(0)/TCP_MSS) for things to work. If you know what you are doing, define LWIP_DISABLE_TCP_SANITY_CHECKS to 1 to disable this error."
  284. #endif
  285. #if TCP_SNDLOWAT >= TCP_SND_BUF(0)
  286. #error "lwip_sanity_check: WARNING: TCP_SNDLOWAT must be less than TCP_SND_BUF. If you know what you are doing, define LWIP_DISABLE_TCP_SANITY_CHECKS to 1 to disable this error."
  287. #endif
  288. #if TCP_SNDLOWAT >= (0xFFFF - (4 * TCP_MSS))
  289. #error "lwip_sanity_check: WARNING: TCP_SNDLOWAT must at least be 4*MSS below u16_t overflow!"
  290. #endif
  291. #if TCP_SNDQUEUELOWAT >= TCP_SND_QUEUELEN(0)
  292. #error "lwip_sanity_check: WARNING: TCP_SNDQUEUELOWAT must be less than TCP_SND_QUEUELEN. If you know what you are doing, define LWIP_DISABLE_TCP_SANITY_CHECKS to 1 to disable this error."
  293. #endif
  294. #endif
  295. #if !MEMP_MEM_MALLOC && (PBUF_POOL_BUFSIZE <= (PBUF_LINK_ENCAPSULATION_HLEN + PBUF_LINK_HLEN + PBUF_IP_HLEN + PBUF_TRANSPORT_HLEN))
  296. #error "lwip_sanity_check: WARNING: PBUF_POOL_BUFSIZE does not provide enough space for protocol headers. If you know what you are doing, define LWIP_DISABLE_TCP_SANITY_CHECKS to 1 to disable this error."
  297. #endif
  298. #if ! ESP_LWIP
  299. #if !MEMP_MEM_MALLOC && (TCP_WND > (PBUF_POOL_SIZE * (PBUF_POOL_BUFSIZE - (PBUF_LINK_ENCAPSULATION_HLEN + PBUF_LINK_HLEN + PBUF_IP_HLEN + PBUF_TRANSPORT_HLEN))))
  300. #error "lwip_sanity_check: WARNING: TCP_WND is larger than space provided by PBUF_POOL_SIZE * (PBUF_POOL_BUFSIZE - protocol headers). If you know what you are doing, define LWIP_DISABLE_TCP_SANITY_CHECKS to 1 to disable this error."
  301. #endif
  302. #if TCP_WND < TCP_MSS
  303. #error "lwip_sanity_check: WARNING: TCP_WND is smaller than MSS. If you know what you are doing, define LWIP_DISABLE_TCP_SANITY_CHECKS to 1 to disable this error."
  304. #endif
  305. #endif
  306. #endif /* LWIP_TCP */
  307. #endif /* !LWIP_DISABLE_TCP_SANITY_CHECKS */
  308. #endif
  309. /**
  310. * Initialize all modules.
  311. */
  312. void
  313. lwip_init(void)
  314. {
  315. /* Modules initialization */
  316. stats_init();
  317. #if !NO_SYS
  318. sys_init();
  319. #endif /* !NO_SYS */
  320. mem_init();
  321. memp_init();
  322. pbuf_init();
  323. netif_init();
  324. #if LWIP_IPV4
  325. ip_init();
  326. #if LWIP_ARP
  327. etharp_init();
  328. #endif /* LWIP_ARP */
  329. #endif /* LWIP_IPV4 */
  330. #if LWIP_RAW
  331. raw_init();
  332. #endif /* LWIP_RAW */
  333. #if LWIP_UDP
  334. udp_init();
  335. #endif /* LWIP_UDP */
  336. #if LWIP_TCP
  337. tcp_init();
  338. #endif /* LWIP_TCP */
  339. #if LWIP_AUTOIP
  340. autoip_init();
  341. #endif /* LWIP_AUTOIP */
  342. #if LWIP_IGMP
  343. igmp_init();
  344. #endif /* LWIP_IGMP */
  345. #if LWIP_DNS
  346. dns_init();
  347. #endif /* LWIP_DNS */
  348. #if PPP_SUPPORT
  349. ppp_init();
  350. #endif
  351. #if LWIP_TIMERS
  352. sys_timeouts_init();
  353. #endif /* LWIP_TIMERS */
  354. }