Add init.h, init.c, Change opt.h, tcpip.c: Task #7213 "Add a lwip_init function" Add lwip_init function to regroup all modules initializations, and to provide a place to add code for task #7142 "Sanity check user-configurable values". Ports maintainers should remove direct initializations calls from their code, and add init.c in their makefiles. Note that lwip_init() function is called inside tcpip_init, but can also be used by raw api users since all calls are disabled when matching options are disabled. Also note that their is new options in opt.h, you should configure in your lwipopts.h (they are enabled per default).

This commit is contained in:
fbernon
2007-08-29 08:11:06 +00:00
parent 7182fb8fb0
commit 48db3a3e92
5 changed files with 163 additions and 23 deletions

View File

@@ -46,13 +46,11 @@
#include "netif/etharp.h"
#include "netif/ppp_oe.h"
#include "lwip/ip.h"
#include "lwip/ip_frag.h"
#include "lwip/udp.h"
#include "lwip/tcp.h"
#include "lwip/igmp.h"
#include "lwip/tcpip.h"
#include "lwip/igmp.h"
#include "lwip/init.h"
#if !NO_SYS
@@ -529,32 +527,16 @@ tcpip_netifapi_lock(struct netifapi_msg* netifapimsg)
/**
* Initialize this module:
* - initialize ARP, IP, UDP and TCP
* - initialize all sub modules
* - start the tcpip_thread
*
* @param initfunc a function to call when tcpip_thread is running and
* finished initializing
* @param initfunc a function to call when tcpip_thread is running and finished initializing
* @param arg argument to pass to initfunc
*/
void
tcpip_init(void (* initfunc)(void *), void *arg)
{
#if LWIP_ARP
etharp_init();
#endif /* LWIP_ARP */
ip_init();
#if LWIP_RAW
raw_init();
#endif /* LWIP_RAW */
#if LWIP_UDP
udp_init();
#endif /* LWIP_UDP */
#if LWIP_TCP
tcp_init();
#endif /* LWIP_TCP */
#if LWIP_AUTOIP
autoip_init();
#endif /* LWIP_AUTOIP */
lwip_init();
tcpip_init_done = initfunc;
tcpip_init_done_arg = arg;