From 19338d2774ff2f13594e5b69cef15c706a9169d1 Mon Sep 17 00:00:00 2001 From: fbernon Date: Mon, 26 Mar 2007 16:13:46 +0000 Subject: [PATCH] opt.h, tcpip.c: New configuration option LWIP_ARP allow to disable ARP init at build time if you only use PPP or SLIP. The default is enable. Note we don't have to call etharp_init in your port's initilization sequence if you use tcpip.c, because this call is done in tcpip_init function. --- CHANGELOG | 6 ++++++ src/api/tcpip.c | 21 ++++++++++++++------- src/include/lwip/opt.h | 4 ++++ 3 files changed, 24 insertions(+), 7 deletions(-) diff --git a/CHANGELOG b/CHANGELOG index a88344c7..ef4a6b9c 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -23,6 +23,12 @@ HISTORY ++ New features: + 2007-03-26 Frédéric Bernon, Jonathan Larmour + * opt.h, tcpip.c: New configuration option LWIP_ARP allow to disable ARP init at build + time if you only use PPP or SLIP. The default is enable. Note we don't have to call + etharp_init in your port's initilization sequence if you use tcpip.c, because this call + is done in tcpip_init function. + 2007-03-22 Frédéric Bernon * stats.h, stats.c, msg_in.c: Stats counters can be change to u32_t if necessary with the new option LWIP_STATS_LARGE. If you need this option, define LWIP_STATS_LARGE to 1 in diff --git a/src/api/tcpip.c b/src/api/tcpip.c index 7ebe05eb..3b635600 100644 --- a/src/api/tcpip.c +++ b/src/api/tcpip.c @@ -93,8 +93,9 @@ ip_timer(void *data) ip_reass_tmr(); sys_timeout( IP_TMR_INTERVAL, ip_timer, NULL); } -#endif +#endif /* IP_REASSEMBLY */ +#if LWIP_ARP static void arp_timer(void *arg) { @@ -102,6 +103,7 @@ arp_timer(void *arg) etharp_tmr(); sys_timeout( ARP_TMR_INTERVAL, arp_timer, NULL); } +#endif /* LWIP_ARP */ #if LWIP_DHCP static void @@ -119,7 +121,7 @@ dhcp_timer_fine(void *arg) dhcp_fine_tmr(); sys_timeout(DHCP_FINE_TIMER_MSECS, dhcp_timer_fine, NULL); } -#endif +#endif /* LWIP_DHCP */ #if ETHARP_TCPIP_ETHINPUT static void @@ -168,15 +170,17 @@ tcpip_thread(void *arg) #if IP_REASSEMBLY sys_timeout( IP_TMR_INTERVAL, ip_timer, NULL); -#endif +#endif /* IP_REASSEMBLY */ +#if LWIP_ARP sys_timeout( ARP_TMR_INTERVAL, arp_timer, NULL); +#endif /* LWIP_ARP */ #if LWIP_DHCP sys_timeout(DHCP_COARSE_TIMER_SECS*1000, dhcp_timer_coarse, NULL); sys_timeout(DHCP_FINE_TIMER_MSECS, dhcp_timer_fine, NULL); -#endif +#endif /* LWIP_DHCP */ #if LWIP_IGMP igmp_init(); -#endif +#endif /* LWIP_IGMP */ if (tcpip_init_done != NULL) { tcpip_init_done(tcpip_init_done_arg); @@ -302,13 +306,16 @@ tcpip_apimsg(struct api_msg *apimsg) void tcpip_init(void (* initfunc)(void *), void *arg) { +#if LWIP_ARP + etharp_init(); +#endif /*LWIP_ARP */ ip_init(); #if LWIP_UDP udp_init(); -#endif +#endif /* LWIP_UDP */ #if LWIP_TCP tcp_init(); -#endif +#endif /* LWIP_TCP */ tcpip_init_done = initfunc; tcpip_init_done_arg = arg; diff --git a/src/include/lwip/opt.h b/src/include/lwip/opt.h index 60ce08ff..aa9ff5dc 100644 --- a/src/include/lwip/opt.h +++ b/src/include/lwip/opt.h @@ -165,6 +165,10 @@ a lot of data that needs to be copied, this should be set high. */ #endif /* ---------- ARP options ---------- */ +#ifndef LWIP_ARP +#define LWIP_ARP 1 +#endif + /** Number of active hardware address, IP address pairs cached */ #ifndef ARP_TABLE_SIZE #define ARP_TABLE_SIZE 10