diff --git a/BUILD.gn b/BUILD.gn index 9d5921bf8e02f7..496d109b9887be 100644 --- a/BUILD.gn +++ b/BUILD.gn @@ -95,7 +95,7 @@ if (current_toolchain != "${dir_pw_toolchain}/default:default") { } if (chip_with_lwip) { - deps += [ "${chip_root}/src/lwip:all" ] + deps += [ "${chip_root}/src/lwip" ] } if (chip_build_tools) { diff --git a/examples/lighting-app/nrfconnect/CMakeLists.txt b/examples/lighting-app/nrfconnect/CMakeLists.txt index 524b8a72ec72c6..14e2fe43bf6af0 100644 --- a/examples/lighting-app/nrfconnect/CMakeLists.txt +++ b/examples/lighting-app/nrfconnect/CMakeLists.txt @@ -151,7 +151,6 @@ target_sources(app PRIVATE ) target_include_directories(app PRIVATE - ${ZEPHYR_BASE}/subsys // required to get access to `log_output_std.h` ${PIGWEED_ROOT}/pw_sys_io/public ${CHIP_ROOT}/src/lib/support ${CHIP_ROOT}/src/system @@ -168,4 +167,6 @@ target_link_libraries(app PRIVATE pw_rpc.server ) +target_link_libraries(pw_build INTERFACE zephyr_interface) + endif(CONFIG_CHIP_PW_RPC) diff --git a/examples/pigweed-app/nrfconnect/CMakeLists.txt b/examples/pigweed-app/nrfconnect/CMakeLists.txt index f87a5485af315b..cd1834cd044bd9 100644 --- a/examples/pigweed-app/nrfconnect/CMakeLists.txt +++ b/examples/pigweed-app/nrfconnect/CMakeLists.txt @@ -48,7 +48,6 @@ add_subdirectory(third_party/connectedhomeip/third_party/nanopb/repo) add_subdirectory(third_party/connectedhomeip/third_party/pigweed/repo) target_include_directories(app PRIVATE main/include - ${ZEPHYR_BASE}/subsys // required to get access to `log_output_std.h` ${NRFCONNECT_COMMON}/util/include ${CHIP_ROOT}/src/lib/support ${PIGWEED_ROOT}/pw_sys_io/public @@ -78,3 +77,5 @@ target_link_libraries(app PUBLIC pw_rpc.nanopb.echo_service pw_rpc.server ) + +target_link_libraries(pw_build INTERFACE zephyr_interface) diff --git a/examples/pigweed-app/nrfconnect/README.md b/examples/pigweed-app/nrfconnect/README.md index c834d06db40767..1553d1d2363a56 100644 --- a/examples/pigweed-app/nrfconnect/README.md +++ b/examples/pigweed-app/nrfconnect/README.md @@ -325,7 +325,7 @@ to read more about flashing on the nRF52840 Dongle. Run the following command to start an interactive Python shell, where the Echo RPC commands can be invoked: - python -m pw_hdlc.rpc_console --device /dev/ttyACM0 -b 115200 $CHIP_ROOT/third_party/pigweed/repo/pw_rpc/pw_rpc_protos/echo.proto -o /tmp/pw_rpc.out + python -m pw_hdlc.rpc_console --device /dev/ttyACM0 -b 115200 $CHIP_ROOT/third_party/pigweed/repo/pw_rpc/echo.proto -o /tmp/pw_rpc.out To send an Echo RPC message, type the following command, where the actual message is the text in quotation marks after the `msg=` phrase: diff --git a/examples/pigweed-app/nrfconnect/main/main.cpp b/examples/pigweed-app/nrfconnect/main/main.cpp index ba8933ebfd0c44..29947a8fef1959 100644 --- a/examples/pigweed-app/nrfconnect/main/main.cpp +++ b/examples/pigweed-app/nrfconnect/main/main.cpp @@ -30,25 +30,13 @@ LOG_MODULE_REGISTER(app); -static LEDWidget sStatusLED; - namespace { -#define RPC_STACK_SIZE (8 * 1024) -#define RPC_PRIORITY 7 - -K_THREAD_STACK_DEFINE(rpc_stack_area, RPC_STACK_SIZE); -struct k_thread rpc_thread_data; - -pw::rpc::EchoService echo_service; +LEDWidget sStatusLED; +pw::rpc::EchoService sEchoService; void RegisterServices(pw::rpc::Server & server) { - server.RegisterService(echo_service); -} - -void RunRpcService(void *, void *, void *) -{ - Start(RegisterServices, &::chip::rpc::logger_mutex); + server.RegisterService(sEchoService); } } // namespace @@ -72,8 +60,6 @@ int main() sStatusLED.Init(SYSTEM_STATE_LED); sStatusLED.Set(true); - k_thread_create(&rpc_thread_data, rpc_stack_area, K_THREAD_STACK_SIZEOF(rpc_stack_area), RunRpcService, NULL, NULL, NULL, - RPC_PRIORITY, 0, K_NO_WAIT); - k_thread_join(&rpc_thread_data, K_FOREVER); + Start(RegisterServices, &::chip::rpc::logger_mutex); return 0; } diff --git a/examples/platform/nrfconnect/pw_sys_io/CMakeLists.txt b/examples/platform/nrfconnect/pw_sys_io/CMakeLists.txt index 62b43a103e7394..84b78c3ebd31ed 100644 --- a/examples/platform/nrfconnect/pw_sys_io/CMakeLists.txt +++ b/examples/platform/nrfconnect/pw_sys_io/CMakeLists.txt @@ -10,7 +10,6 @@ pw_add_module_library(pw_sys_io.nrfconnect SOURCES sys_io_nrfconnect.cc PRIVATE_DEPS - zephyr_interface pw_sys_io suppress_zephyr_warnings ) diff --git a/scripts/tools/linux_ip_namespace_setup.sh b/scripts/tools/linux_ip_namespace_setup.sh new file mode 100755 index 00000000000000..1520efe1bc3368 --- /dev/null +++ b/scripts/tools/linux_ip_namespace_setup.sh @@ -0,0 +1,233 @@ +#!/usr/bin/env bash +# +# +# Copyright (c) 2021 Project CHIP Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# +# Description: +# This is a utility script that can be used by developers to do +# simulate a device and controller on the same linux machine. This +# script is not intended to be used in a testing framework as-is +# because it requires root access to set up network namespaces. +# +# To use this script, compile the required device example, and +# run inside the namespace using +# sudo /linux_ip_namespace_setup.sh -r +# +# The controller can then be started in a new terminal and will +# be able to communicate with the application as if it were on +# a separate network. +# + +NAMESPACE="MatterTester" +HOST_SIDE_IF_NAME="heth0" +NAMESPACE_SIDE_IF_NAME="neth0" +BRIDGE_NAME="nbridge" +BRIDGE_ADDR="192.168.4.50" +NAMESPACE_ADDR="192.168.4.45" +HOST_IPV6_ADDR=fc00::1 +BRIDGE_IPV6_ADDR=fc00::b +NAMESPACE_IPV6_ADDR=fc00::a + +function run_setup() { + # Create namespace. + ip netns add "$NAMESPACE" + + # Create two virtual interfaces and link them - one on host side, one on namespace side. + ip link add "$HOST_SIDE_IF_NAME" type veth peer name "$NAMESPACE_SIDE_IF_NAME" + + # Give the host a known IPv6 addr and set the host side up + ip -6 addr add "$HOST_IPV6_ADDR"/64 dev "$HOST_SIDE_IF_NAME" + ip link set "$HOST_SIDE_IF_NAME" up + + # Associate namespace IF with the namespace + ip link set "$NAMESPACE_SIDE_IF_NAME" netns "$NAMESPACE" + + # Give the namespace IF an address (something nothing else is using) and set it up + echo "Adding address for namespace IF" + ip netns exec "$NAMESPACE" ip -6 addr add "$NAMESPACE_IPV6_ADDR"/64 dev "$NAMESPACE_SIDE_IF_NAME" + ip netns exec "$NAMESPACE" ip link set dev "$NAMESPACE_SIDE_IF_NAME" up + + # Add a route to the namespace to go through the bridge + echo "Setting routes for namespace" + ip netns exec "$NAMESPACE" ip -6 route add default dev "$NAMESPACE_SIDE_IF_NAME" + + echo "Setup complete." +} + +function run_add_ipv4() { + # Give the namespace an IPv4 address + ip netns exec "$NAMESPACE" ip addr add "$NAMESPACE_ADDR"/24 dev "$NAMESPACE_SIDE_IF_NAME" + + # Add a bridge, give it an address (something nothing else is using) + echo "Setting up bridge" + ip link add name "$BRIDGE_NAME" type bridge + ip -6 addr add "$BRIDGE_IPV6_ADDR"/64 dev "$BRIDGE_NAME" + ip addr add "$BRIDGE_ADDR"/24 brd + dev "$BRIDGE_NAME" + + # For ipv6 and ipv4 to work together, need the bridge to ignore the ipv6 packets (DROP here means don't bridge) + ebtables-legacy -t broute -A BROUTING -p ipv6 -j DROP -i "$HOST_SIDE_IF_NAME" + ip link set "$BRIDGE_NAME" up + + # Connect the host side to the bridge, so now we have bridge <-> host_side_if <-> namespace_if + echo "Connecting host virtual IF to bridge" + ip link set "$HOST_SIDE_IF_NAME" master "$BRIDGE_NAME" + + #ip netns exec ${NAMESPACE} ip route add default via ${BRIDGE_ADDR} dev ${NAMESPACE_SIDE_IF_NAME} +} + +function run_cmd() { + # Start the app in the namespace + echo "Running $1 in namespace." + ip netns exec "$NAMESPACE" "$1" +} + +function run_cleanup() { + # Deleting the namespace will remove the namespace and peer'd interfaces to + have_ebtables_legacy=$1 + ip netns delete "$NAMESPACE" + if ifconfig | grep "$BRIDGE_NAME"; then + if [ "$have_ebtables_legacy" = true ]; then + # Just try to drop the additional rule - it references our interface + # so if it's there, we added it. + ebtables-legacy -t broute -D BROUTING -p ipv6 -j DROP -i "$HOST_SIDE_IF_NAME" >/dev/null + fi + ip link delete dev "$BRIDGE_NAME" type bridge + fi +} + +function help() { + echo "Usage: $file_name [ options ... ]" + echo "" + + echo "This script is used to set up linux namespaces for Matter device testing" + echo "between a controller and device on the same linux machine." + echo "" + echo "To use this script, run the device code in a namespace using the -r command" + echo "and a controller in a seperate terminal to simulate two devices communicating" + echo "across a network." + echo "Example:" + echo "--------" + echo "Terminal 1:" + echo "sudo /$file_name -r /" + echo "" + echo "Terminal 2:" + echo "/chip-device-ctrl" + echo "" + echo "This script requires sudo for setup and requires access to ebtables-legacy" + echo "to set up dual ipv4/ipv6 namespaces. Defaults to ipv6 only." + echo "" + + echo "Options: + -h, --help Display this information. + -s, --setup Setup an IP namespace. Will run cleanup if namespace exists. + -4, --ipv4 Add ipv4 support. + -r, --run filename Run file in the namespace. Will setup namespace if required. + -c, --cleanup Delete namespace and routes +" +} + +declare setup=false +declare filename="" +declare run=false +declare cleanup=false +declare ipv4=false + +file_name=${0##*/} + +while (($#)); do + case $1 in + --help | -h) + help + exit 1 + ;; + --setup | -s) + setup=true + ;; + --run | -r) + run=true + filename=$2 + shift + ;; + --cleanup | -c) + cleanup=true + ;; + --ipv4 | -4) + ipv4=true + ;; + -*) + help + echo "Unknown Option \"$1\"" + exit 1 + ;; + esac + shift +done + +if [[ $EUID -ne 0 ]]; then + echo "You must run this script with superuser privileges." + exit 1 +fi + +if ifconfig | grep "$HOST_SIDE_IF_NAME"; then + issetup=true +else + issetup=false +fi + +if [ "$setup" = false ] && [ "$run" = false ] && [ "$cleanup" = false ]; then + echo "Must specify one or more of -s, -r, -c." + exit 1 +fi + +if command -v ebtables-legacy >/dev/null; then + have_ebtables_legacy=true +else + have_ebtables_legacy=false +fi + +if [ "$ipv4" = true ] && [ "$have_ebtables_legacy" = false ]; then + echo "To set up namespaces with ipv4/ipv6 connectivity, ebtables-legacy" + echo "is required. For example, to install on machines using APT:" + echo "sudo apt-get install ebtables" + exit 1 +fi + +if [ "$run" = true ]; then + if [ "$issetup" = false ]; then + setup=true + fi +fi + +if [ "$setup" = true ]; then + if [ "$issetup" = true ]; then + cleanup=true + fi +fi + +if [ "$cleanup" = true ]; then + run_cleanup "$have_ebtables_legacy" +fi + +if [ "$setup" = true ]; then + run_setup + if [ "$ipv4" = true ]; then + run_add_ipv4 + fi +fi + +if [ "$run" = true ]; then + run_cmd "$filename" +fi diff --git a/src/controller/java/AndroidDeviceControllerWrapper.cpp b/src/controller/java/AndroidDeviceControllerWrapper.cpp index 980200b041f3b7..da23a38fad6f93 100644 --- a/src/controller/java/AndroidDeviceControllerWrapper.cpp +++ b/src/controller/java/AndroidDeviceControllerWrapper.cpp @@ -156,7 +156,7 @@ CHIP_ERROR AndroidDeviceControllerWrapper::GenerateNodeOperationalCertificate(co { jmethodID method; CHIP_ERROR err = CHIP_NO_ERROR; - err = FindMethod(GetEnvForCurrentThread(), mJavaObjectRef, "onOpCSRGenerationComplete", "([B)V", &method); + err = FindMethod(JniReferences::GetEnvForCurrentThread(), mJavaObjectRef, "onOpCSRGenerationComplete", "([B)V", &method); if (err != CHIP_NO_ERROR) { ChipLogError(Controller, "Error invoking onOpCSRGenerationComplete: %d", err); @@ -178,9 +178,9 @@ CHIP_ERROR AndroidDeviceControllerWrapper::GenerateNodeOperationalCertificate(co CHIP_ERROR generateCert = NewNodeOperationalX509Cert(request, chip::CertificateIssuerLevel::kIssuerIsRootCA, pubkey, mIssuer, certBuf, certBufSize, outCertLen); jbyteArray argument; - GetEnvForCurrentThread()->ExceptionClear(); - N2J_ByteArray(GetEnvForCurrentThread(), csr.data(),csr.size(),argument); - GetEnvForCurrentThread()->CallVoidMethod(mJavaObjectRef, method, argument); + JniReferences::GetEnvForCurrentThread()->ExceptionClear(); + N2J_ByteArray(JniReferences::GetEnvForCurrentThread(), csr.data(),csr.size(),argument); + JniReferences::GetEnvForCurrentThread()->CallVoidMethod(mJavaObjectRef, method, argument); return generateCert; } diff --git a/src/inet/BUILD.gn b/src/inet/BUILD.gn index 632958b4b710c3..811ac5d5c5fb96 100644 --- a/src/inet/BUILD.gn +++ b/src/inet/BUILD.gn @@ -103,7 +103,7 @@ static_library("inet") { "${nlio_root}:nlio", ] - if (chip_with_lwip) { + if (chip_system_config_use_lwip) { public_deps += [ "${chip_root}/src/lwip" ] } diff --git a/src/inet/RawEndPoint.cpp b/src/inet/RawEndPoint.cpp index 4fe3c1db997c7b..d11d24cf09d00b 100644 --- a/src/inet/RawEndPoint.cpp +++ b/src/inet/RawEndPoint.cpp @@ -43,9 +43,9 @@ #include #include #if CHIP_HAVE_CONFIG_H -#include -#endif // CHIP_HAVE_CONFIG_H -#endif // CHIP_SYSTEM_CONFIG_USE_LWIP +#include // nogncheck +#endif // CHIP_HAVE_CONFIG_H +#endif // CHIP_SYSTEM_CONFIG_USE_LWIP #if CHIP_SYSTEM_CONFIG_USE_SOCKETS #include diff --git a/src/inet/UDPEndPoint.cpp b/src/inet/UDPEndPoint.cpp index c1bd4edea63c46..e85da7edf4237a 100644 --- a/src/inet/UDPEndPoint.cpp +++ b/src/inet/UDPEndPoint.cpp @@ -42,9 +42,9 @@ #include #include #if CHIP_HAVE_CONFIG_H -#include -#endif // CHIP_HAVE_CONFIG_H -#endif // CHIP_SYSTEM_CONFIG_USE_LWIP +#include // nogncheck +#endif // CHIP_HAVE_CONFIG_H +#endif // CHIP_SYSTEM_CONFIG_USE_LWIP #if CHIP_SYSTEM_CONFIG_USE_SOCKETS #if HAVE_SYS_SOCKET_H diff --git a/src/lwip/BUILD.gn b/src/lwip/BUILD.gn index 8a78c88fefdbbb..18521824976345 100644 --- a/src/lwip/BUILD.gn +++ b/src/lwip/BUILD.gn @@ -125,7 +125,4 @@ if (current_os == "zephyr") { "${chip_root}/src:includes", ] } - group("all") { - deps = [ ":lwip_all" ] - } } diff --git a/src/platform/EFR32/args.gni b/src/platform/EFR32/args.gni index 90620e5d6f52f5..0e96994af4b6d9 100644 --- a/src/platform/EFR32/args.gni +++ b/src/platform/EFR32/args.gni @@ -29,9 +29,6 @@ chip_device_platform = "efr32" chip_mdns = "platform" lwip_platform = "efr32" -lwip_ipv6 = true -lwip_ipv4 = false -lwip_api = true chip_inet_config_enable_ipv4 = false chip_inet_config_enable_dns_resolver = false diff --git a/src/platform/K32W/args.gni b/src/platform/K32W/args.gni index 6d9c80f72bf51e..32c9b4fdb92082 100644 --- a/src/platform/K32W/args.gni +++ b/src/platform/K32W/args.gni @@ -19,9 +19,6 @@ import("//build_overrides/openthread.gni") chip_device_platform = "k32w" lwip_platform = "k32w" -lwip_ipv6 = true -lwip_ipv4 = false -lwip_api = true chip_inet_config_enable_ipv4 = false chip_inet_config_enable_dns_resolver = false diff --git a/src/platform/cc13x2_26x2/args.gni b/src/platform/cc13x2_26x2/args.gni index d32cae2b69690c..3669b05afacfb8 100644 --- a/src/platform/cc13x2_26x2/args.gni +++ b/src/platform/cc13x2_26x2/args.gni @@ -27,9 +27,6 @@ openthread_external_platform = "${ti_simplelink_sdk_build_root}:ti_simplelink_sdk" lwip_platform = "cc13x2_26x2" -lwip_ipv6 = true -lwip_ipv4 = false -lwip_api = true chip_inet_config_enable_ipv4 = false chip_inet_config_enable_dns_resolver = false diff --git a/src/platform/qpg6100/args.gni b/src/platform/qpg6100/args.gni index 82e8b6e93a2439..0b351c7ad9ded6 100644 --- a/src/platform/qpg6100/args.gni +++ b/src/platform/qpg6100/args.gni @@ -24,9 +24,6 @@ chip_device_platform = "qpg6100" chip_mdns = "platform" lwip_platform = "qpg6100" -lwip_ipv6 = true -lwip_ipv4 = false -lwip_api = true chip_inet_config_enable_ipv4 = false chip_inet_config_enable_dns_resolver = false diff --git a/third_party/lwip/lwip.gni b/third_party/lwip/lwip.gni index 53ece77d19808c..dd883df063f428 100644 --- a/third_party/lwip/lwip.gni +++ b/third_party/lwip/lwip.gni @@ -14,65 +14,6 @@ import("//build_overrides/lwip.gni") -declare_args() { - # Default enablement for lwIP library components. - # This has no effect on its own; it only changes between opt-out and opt-in. - lwip_default = current_os != "freertos" -} - -declare_args() { - # Build IPv4 support in lwIP. - lwip_ipv4 = lwip_default - - # Enable IPv6 support in lwIP. - lwip_ipv6 = lwip_default - - # Enable sequential & socket API support in lwIP. - lwip_api = lwip_default - - # Enable ethernet support in lwIP. - lwip_ethernet = lwip_default - - # Enable SLIP interface support in lwIP. - lwip_slip = false - - # Enable 6LoWPAN support in lwIP. - lwip_6lowpan = lwip_default - - # Enable PPP support in lwIP. - lwip_ppp = lwip_default - - # Default enablement for lwIP application components. - # This has no effect on its own; it only changes between opt-out and opt-in. - lwip_apps_default = false -} - -declare_args() { - # Enable SNMPv2c agent application. - lwip_snmp = lwip_apps_default - - # Enable HTTP server. - lwip_httpd = lwip_apps_default - - # Enable IPERF server. - lwip_iperf = lwip_apps_default - - # Enable SNTP client. - lwip_sntp = lwip_apps_default - - # Enable MDNS responder. - lwip_mdns = lwip_apps_default - - # Enable NetBIOS name server. - lwip_netbiosns = lwip_apps_default - - # Enable TFTP server. - lwip_tftp = lwip_apps_default - - # Enable MQTT client. - lwip_mqtt = lwip_apps_default -} - # Defines a lwIP build target. # # lwIP depends on external header files to compile. This template defines @@ -82,6 +23,36 @@ template("lwip_target") { lwip_target_name = target_name + # Apply overrides for lwIP features. + forward_variables_from(invoker, + [ + "lwip_ipv4", + "lwip_ipv6", + "lwip_api", + "lwip_ethernet", + "lwip_slip", + "lwip_6lowpan", + ]) + + if (!defined(lwip_ipv4)) { + lwip_ipv4 = true + } + if (!defined(lwip_ipv6)) { + lwip_ipv6 = true + } + if (!defined(lwip_api)) { + lwip_api = true + } + if (!defined(lwip_ethernet)) { + lwip_ethernet = true + } + if (!defined(lwip_slip)) { + lwip_slip = false + } + if (!defined(lwip_6lowpan)) { + lwip_6lowpan = false + } + config("${lwip_target_name}_warnings") { cflags = [ "-Wno-address", @@ -94,54 +65,6 @@ template("lwip_target") { config("${lwip_target_name}_base_config") { include_dirs = [ "${lwip_root}/repo/lwip/src/include" ] - - # These options may have overlap with lwipopts.h, however this is harmless - # as long the options are the same and if they are not the same it's a - # compile error. - if (lwip_ipv4) { - enable_ipv4 = 1 - } else { - enable_ipv4 = 0 - } - if (lwip_ipv6) { - enable_ipv6 = 1 - } else { - enable_ipv6 = 0 - } - if (lwip_api) { - enable_api = 1 - } else { - enable_api = 0 - } - if (lwip_ethernet) { - enable_ethernet = 1 - } else { - enable_ethernet = 0 - } - if (lwip_slip) { - enable_slip = 1 - } else { - enable_slip = 0 - } - if (lwip_6lowpan) { - enable_6lowpan = 1 - } else { - enable_6lowpan = 0 - } - if (lwip_ppp) { - enable_ppp = 1 - } else { - enable_ppp = 0 - } - defines = [ - "LWIP_IPV4=${enable_ipv4}", - "LWIP_IPV6=${enable_ipv6}", - "LWIP_API=${enable_api}", - "LWIP_ETHERNET=${enable_ethernet}", - "LWIP_SLIP=${enable_slip}", - "LWIP_6LOWPAN=${enable_6lowpan}", - "LWIP_PPP=${enable_ppp}", - ] } source_set(lwip_target_name) { @@ -293,119 +216,4 @@ template("lwip_target") { public_configs += [ ":${lwip_target_name}_base_config" ] } - - lwip_apps = [] - - template("lwip_app") { - app_name = target_name - - static_library("${lwip_target_name}_${app_name}") { - forward_variables_from(invoker, [ "sources" ]) - - deps = [ ":lwip" ] - - # Relax warnings for third_party code. - configs += [ ":${lwip_target_name}_warnings" ] - } - } - - if (lwip_snmp) { - lwip_app("snmp") { - sources = [ - "${_lwip_root}/src/apps/snmp/snmp_asn1.c", - "${_lwip_root}/src/apps/snmp/snmp_core.c", - "${_lwip_root}/src/apps/snmp/snmp_mib2.c", - "${_lwip_root}/src/apps/snmp/snmp_mib2_icmp.c", - "${_lwip_root}/src/apps/snmp/snmp_mib2_interfaces.c", - "${_lwip_root}/src/apps/snmp/snmp_mib2_ip.c", - "${_lwip_root}/src/apps/snmp/snmp_mib2_snmp.c", - "${_lwip_root}/src/apps/snmp/snmp_mib2_system.c", - "${_lwip_root}/src/apps/snmp/snmp_mib2_tcp.c", - "${_lwip_root}/src/apps/snmp/snmp_mib2_udp.c", - "${_lwip_root}/src/apps/snmp/snmp_msg.c", - "${_lwip_root}/src/apps/snmp/snmp_netconn.c", - "${_lwip_root}/src/apps/snmp/snmp_pbuf_stream.c", - "${_lwip_root}/src/apps/snmp/snmp_raw.c", - "${_lwip_root}/src/apps/snmp/snmp_scalar.c", - "${_lwip_root}/src/apps/snmp/snmp_table.c", - "${_lwip_root}/src/apps/snmp/snmp_threadsync.c", - "${_lwip_root}/src/apps/snmp/snmp_traps.c", - "${_lwip_root}/src/apps/snmp/snmpv3.c", - "${_lwip_root}/src/apps/snmp/snmpv3_dummy.c", - "${_lwip_root}/src/apps/snmp/snmpv3_mbedtls.c", - ] - } - - lwip_apps += [ ":${lwip_target_name}_snmp" ] - } - - if (lwip_httpd) { - lwip_app("httpd") { - sources = [ - "${_lwip_root}/src/apps/httpd/fs.c", - "${_lwip_root}/src/apps/httpd/httpd.c", - ] - } - - lwip_apps += [ ":${lwip_target_name}_httpd" ] - } - - if (lwip_iperf) { - lwip_app("lwiperf") { - sources = [ "${_lwip_root}/src/apps/lwiperf/lwiperf.c" ] - } - - lwip_apps += [ ":${lwip_target_name}_lwiperf" ] - } - - if (lwip_sntp) { - lwip_app("sntp") { - sources = [ "${_lwip_root}/src/apps/sntp/sntp.c" ] - } - - lwip_apps += [ ":${lwip_target_name}_sntp" ] - } - - if (lwip_mdns) { - lwip_app("mdns") { - sources = [ "${_lwip_root}/src/apps/mdns/mdns.c" ] - } - - lwip_apps += [ ":${lwip_target_name}_mdns" ] - } - - if (lwip_netbiosns) { - lwip_app("netbiosns") { - sources = [ "${_lwip_root}/src/apps/netbiosns/netbiosns.c" ] - } - - lwip_apps += [ ":${lwip_target_name}_netbiosns" ] - } - - if (lwip_tftp) { - lwip_app("tftp") { - sources = [ "${_lwip_root}/src/apps/tftp/tftp_server.c" ] - } - - lwip_apps += [ ":${lwip_target_name}_tftp" ] - } - - if (lwip_mqtt) { - lwip_app("mqtt") { - sources = [ "${_lwip_root}/src/apps/mqtt/mqtt.c" ] - } - - lwip_apps += [ ":${lwip_target_name}_mqtt" ] - } - - group("${lwip_target_name}_apps") { - deps = lwip_apps - } - - group("${lwip_target_name}_all") { - deps = [ - ":${lwip_target_name}", - ":${lwip_target_name}_apps", - ] - } }