lwip: Add CONFIG_LWIP_ICMP and CONFIG_LWIP_ICMP6 to sperate the code

This commit is contained in:
liuhan
2021-04-15 20:48:52 +08:00
committed by yuanjm
parent 0f2052ca36
commit 2d80c122b1
4 changed files with 21 additions and 4 deletions

View File

@@ -8,9 +8,6 @@ set(include_dirs
set(srcs set(srcs
"apps/dhcpserver/dhcpserver.c" "apps/dhcpserver/dhcpserver.c"
"apps/ping/esp_ping.c"
"apps/ping/ping.c"
"apps/ping/ping_sock.c"
"apps/sntp/sntp.c" "apps/sntp/sntp.c"
"lwip/src/api/api_lib.c" "lwip/src/api/api_lib.c"
"lwip/src/api/api_msg.c" "lwip/src/api/api_msg.c"
@@ -141,6 +138,13 @@ if(CONFIG_OPENTHREAD_ENABLED)
list(APPEND srcs "port/esp32/netif/openthreadif.c") list(APPEND srcs "port/esp32/netif/openthreadif.c")
endif() endif()
if(CONFIG_LWIP_ICMP)
list(APPEND srcs
"apps/ping/esp_ping.c"
"apps/ping/ping.c"
"apps/ping/ping_sock.c")
endif()
idf_component_register(SRCS "${srcs}" idf_component_register(SRCS "${srcs}"
INCLUDE_DIRS "${include_dirs}" INCLUDE_DIRS "${include_dirs}"
LDFRAGMENTS linker.lf LDFRAGMENTS linker.lf

View File

@@ -785,13 +785,21 @@ menu "LWIP"
menu "ICMP" menu "ICMP"
config LWIP_ICMP
bool "ICMP: Enable ICMP"
default y
help
Enable ICMP module for check network stability
config LWIP_MULTICAST_PING config LWIP_MULTICAST_PING
bool "Respond to multicast pings" bool "Respond to multicast pings"
default n default n
depends on LWIP_ICMP6 || LWIP_ICMP
config LWIP_BROADCAST_PING config LWIP_BROADCAST_PING
bool "Respond to broadcast pings" bool "Respond to broadcast pings"
default n default n
depends on LWIP_ICMP
endmenu # ICMP endmenu # ICMP
@@ -970,7 +978,7 @@ menu "LWIP"
config LWIP_ICMP_DEBUG config LWIP_ICMP_DEBUG
bool "Enable ICMP debug messages" bool "Enable ICMP debug messages"
depends on LWIP_DEBUG depends on LWIP_DEBUG && LWIP_ICMP
default n default n
config LWIP_DHCP_STATE_DEBUG config LWIP_DHCP_STATE_DEBUG

View File

@@ -39,6 +39,10 @@ ifndef CONFIG_OPENTHREAD_ENABLED
COMPONENT_OBJEXCLUDE += port/esp32/netif/openthreadif.o COMPONENT_OBJEXCLUDE += port/esp32/netif/openthreadif.o
endif endif
ifndef CONFIG_LWIP_ICMP
COMPONENT_OBJEXCLUDE += apps/ping/esp_ping.o apps/ping/ping.o apps/ping/ping_sock.o
endif
ifdef CONFIG_LWIP_PPP_SUPPORT ifdef CONFIG_LWIP_PPP_SUPPORT
COMPONENT_SRCDIRS += lwip/src/netif/ppp lwip/src/netif/ppp/polarssl COMPONENT_SRCDIRS += lwip/src/netif/ppp lwip/src/netif/ppp/polarssl
endif endif

View File

@@ -217,6 +217,7 @@
---------- ICMP options ---------- ---------- ICMP options ----------
---------------------------------- ----------------------------------
*/ */
#define LWIP_ICMP CONFIG_LWIP_ICMP
#define LWIP_BROADCAST_PING CONFIG_LWIP_BROADCAST_PING #define LWIP_BROADCAST_PING CONFIG_LWIP_BROADCAST_PING