[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[lwip-users] our startup sequence for the lwIP stack
From: |
Leon Woestenberg |
Subject: |
[lwip-users] our startup sequence for the lwIP stack |
Date: |
Fri, 15 Jul 2005 10:15:45 +0200 |
Hello,
a few people have asked for a startup sequence for the lwIP stack. See
the contrib module for examples.
This is what we use (see below).
Regards, Leon.
void ip_compat_init()
{
#ifdef STATS
debug_printf("stats_init\n");
stats_init();
#endif
debug_printf("sys_init\n");
sys_init();
debug_printf("mem_init\n");
mem_init();
debug_printf("memp_init");
memp_init();
debug_printf("pbuf_init\n");
pbuf_init();
debug_printf("etharp\n");
etharp_init();
debug_printf("ip\n");
ip_init();
debug_printf("udp\n");
udp_init();
#if LWIP_TCP
debug_printf("tcp\n");
tcp_init();
#endif
debug_printf("netif_add\n");
ethif = netif_add(&netif_0, &ip_my_addr, &ip_sn_mask, &ip_gw_addr,
NULL, net_if_init, ip_input);
debug_printf("netif_set_default(if=%p)\n", ethif);
netif_set_default(ethif);
debug_printf("dhcp\n");
//dhcp_init();
#ifdef HTTPSERVER
#error
debug_printf("httpd\n");
httpd_init();
#endif
acp_pcb = udp_new();
if (acp_pcb != NULL)
{
udp_recv(acp_pcb, ip_recv, (void *)2071);
udp_bind(acp_pcb, IP_ADDR_ANY, 2071);
}
#ifdef SNMPAGENT
snmp_pcb = udp_new();
if (snmp_pcb != NULL)
{
udp_recv(snmp_pcb, ip_recv, (void *)UDP_SNMP_AGENT_PORT);
udp_bind(snmp_pcb, IP_ADDR_ANY, UDP_SNMP_AGENT_PORT);
}
#endif
}
- [lwip-users] our startup sequence for the lwIP stack,
Leon Woestenberg <=