From f1434bb04c062ed70f1b9dabbeb971042130647e Mon Sep 17 00:00:00 2001 From: iphydf Date: Wed, 29 Nov 2023 15:48:26 +0000 Subject: [PATCH 1/3] test: Make esp32 build actually try to instantiate tox. It doesn't work, because esp32 has too little RAM (320KB). DHT is a 240KB struct, so even just allocating that immediately fails. We'll need to think carefully about trimming that if we ever want this to work on embedded devices. --- CMakeLists.txt | 2 + auto_tests/onion_test.c | 8 +- .../docker/tox-bootstrapd.sha256 | 2 +- other/docker/esp32/BUILD.bazel | 15 + other/docker/esp32/Dockerfile | 72 +- other/docker/esp32/bootstrap/CMakeLists.txt | 4 + other/docker/esp32/bootstrap/hello_main.cc | 7 + .../docker/esp32/bootstrap/idf_component.yml | 2 + other/docker/esp32/hello/CMakeLists.txt | 4 - other/docker/esp32/hello/hello_main.c | 6 - other/docker/esp32/host_main.cc | 6 + other/docker/esp32/main/CMakeLists.txt | 16 + other/docker/esp32/main/app_main.cc | 67 + other/docker/esp32/main/tox_main.cc | 122 ++ other/docker/esp32/main/tox_main.h | 6 + other/docker/esp32/qemu-test | 17 + other/docker/esp32/run | 1 - other/docker/esp32/run-host | 5 + other/docker/esp32/sdkconfig | 1937 +++++++++++++++++ other/docker/esp32/toxcore/CMakeLists.txt | 12 - other/docker/esp32/toxcore/toxcore_main.cc | 14 - toxcore/BUILD.bazel | 15 + toxcore/DHT.c | 58 +- toxcore/DHT.h | 3 + toxcore/Makefile.inc | 2 + toxcore/Messenger.c | 11 + toxcore/TCP_connection.h | 2 +- toxcore/announce.c | 2 +- toxcore/mono_time.c | 3 +- toxcore/network.c | 8 +- toxcore/onion.c | 54 +- toxcore/onion.h | 3 +- toxcore/onion_announce.c | 24 +- toxcore/onion_announce.h | 18 +- toxcore/onion_client.c | 65 +- toxcore/pk_set.c | 97 + toxcore/pk_set.h | 34 + toxcore/shared_key_cache.c | 21 +- toxcore/shared_key_cache.h | 8 +- toxcore/tox.c | 4 +- 40 files changed, 2607 insertions(+), 150 deletions(-) create mode 100644 other/docker/esp32/BUILD.bazel create mode 100644 other/docker/esp32/bootstrap/CMakeLists.txt create mode 100644 other/docker/esp32/bootstrap/hello_main.cc create mode 100644 other/docker/esp32/bootstrap/idf_component.yml delete mode 100644 other/docker/esp32/hello/CMakeLists.txt delete mode 100644 other/docker/esp32/hello/hello_main.c create mode 100644 other/docker/esp32/host_main.cc create mode 100644 other/docker/esp32/main/CMakeLists.txt create mode 100644 other/docker/esp32/main/app_main.cc create mode 100644 other/docker/esp32/main/tox_main.cc create mode 100644 other/docker/esp32/main/tox_main.h create mode 100755 other/docker/esp32/qemu-test create mode 100755 other/docker/esp32/run-host create mode 100644 other/docker/esp32/sdkconfig delete mode 100644 other/docker/esp32/toxcore/CMakeLists.txt delete mode 100644 other/docker/esp32/toxcore/toxcore_main.cc create mode 100644 toxcore/pk_set.c create mode 100644 toxcore/pk_set.h diff --git a/CMakeLists.txt b/CMakeLists.txt index e663432263..84f773e8be 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -284,6 +284,8 @@ set(toxcore_SOURCES toxcore/ping_array.h toxcore/ping.c toxcore/ping.h + toxcore/pk_set.c + toxcore/pk_set.h toxcore/shared_key_cache.c toxcore/shared_key_cache.h toxcore/state.c diff --git a/auto_tests/onion_test.c b/auto_tests/onion_test.c index 6975c3ec30..8a5a821c98 100644 --- a/auto_tests/onion_test.c +++ b/auto_tests/onion_test.c @@ -53,7 +53,7 @@ static int handle_test_1(void *object, const IP_Port *source, const uint8_t *pac res_packet[0] = NET_PACKET_ANNOUNCE_RESPONSE; memcpy(res_packet + 1, res_message, sizeof(res_message)); - if (send_onion_response(onion->net, source, res_packet, sizeof(res_packet), + if (send_onion_response(onion->log, onion->net, source, res_packet, sizeof(res_packet), packet + sizeof(res_packet)) == -1) { return 1; } @@ -293,7 +293,7 @@ static void test_basic(void) uint64_t s; memcpy(&s, sb_data, sizeof(uint64_t)); memcpy(test_3_pub_key, nodes[3].public_key, CRYPTO_PUBLIC_KEY_SIZE); - int ret = send_announce_request(onion1->net, rng, &path, &nodes[3], + int ret = send_announce_request(log1, onion1->net, rng, &path, &nodes[3], dht_get_self_public_key(onion1->dht), dht_get_self_secret_key(onion1->dht), zeroes, @@ -315,7 +315,7 @@ static void test_basic(void) memcpy(onion_announce_entry_public_key(onion2_a, 1), dht_get_self_public_key(onion2->dht), CRYPTO_PUBLIC_KEY_SIZE); onion_announce_entry_set_time(onion2_a, 1, mono_time_get(mono_time2)); networking_registerhandler(onion1->net, NET_PACKET_ONION_DATA_RESPONSE, &handle_test_4, onion1); - send_announce_request(onion1->net, rng, &path, &nodes[3], + send_announce_request(log1, onion1->net, rng, &path, &nodes[3], dht_get_self_public_key(onion1->dht), dht_get_self_secret_key(onion1->dht), test_3_ping_id, @@ -340,7 +340,7 @@ static void test_basic(void) ck_assert_msg((onion3 != nullptr), "Onion failed initializing."); random_nonce(rng, nonce); - ret = send_data_request(onion3->net, rng, &path, &nodes[3].ip_port, + ret = send_data_request(log3, onion3->net, rng, &path, &nodes[3].ip_port, dht_get_self_public_key(onion1->dht), dht_get_self_public_key(onion1->dht), nonce, (const uint8_t *)"Install gentoo", sizeof("Install gentoo")); diff --git a/other/bootstrap_daemon/docker/tox-bootstrapd.sha256 b/other/bootstrap_daemon/docker/tox-bootstrapd.sha256 index f212827744..0f8bcef762 100644 --- a/other/bootstrap_daemon/docker/tox-bootstrapd.sha256 +++ b/other/bootstrap_daemon/docker/tox-bootstrapd.sha256 @@ -1 +1 @@ -1608abb52cd16775216d01d06569e6437d86ed11e9fc8dc6dc9c1c28668ccd8b /usr/local/bin/tox-bootstrapd +bc9e2100e1b8951932a4b82b322983e0b40ba9bbe8b505769aa974b8b4116247 /usr/local/bin/tox-bootstrapd diff --git a/other/docker/esp32/BUILD.bazel b/other/docker/esp32/BUILD.bazel new file mode 100644 index 0000000000..5a4009e99f --- /dev/null +++ b/other/docker/esp32/BUILD.bazel @@ -0,0 +1,15 @@ +load("@rules_cc//cc:defs.bzl", "cc_binary") + +cc_binary( + name = "host_main", + testonly = 1, + srcs = [ + "host_main.cc", + "main/tox_main.cc", + "main/tox_main.h", + ], + deps = [ + "//c-toxcore/toxcore:tox", + "//c-toxcore/toxcore:tox_events", + ], +) diff --git a/other/docker/esp32/Dockerfile b/other/docker/esp32/Dockerfile index 9b6ad76c34..71e2afe2ed 100644 --- a/other/docker/esp32/Dockerfile +++ b/other/docker/esp32/Dockerfile @@ -1,48 +1,32 @@ -FROM toxchat/c-toxcore:sources AS src -FROM ubuntu:18.04 +FROM mluis/qemu-esp32:latest +SHELL ["/bin/bash", "-o", "pipefail", "-c"] +ENV IDF_TARGET=esp32 -RUN apt-get update && \ - DEBIAN_FRONTEND="noninteractive" apt-get install -y --no-install-recommends \ - bison \ - ccache \ - cmake \ - flex \ - git \ - gperf \ - libncurses-dev \ - ninja-build \ - python \ - python-cryptography \ - python-future \ - python-pip \ - python-pyparsing \ - python-serial \ - python-setuptools \ - wget \ - && apt-get clean \ - && rm -rf /var/lib/apt/lists/* +WORKDIR /root/toxcore -ENV ESP32_TARBALL=xtensa-esp32-elf-linux64-1.22.0-80-g6c4433a-5.2.0 \ - IDF_PATH="/root/esp/esp-idf" \ - PATH="/root/esp/esp-idf/tools:/root/esp/xtensa-esp32-elf/bin:$PATH" -WORKDIR /root/esp -RUN wget -q https://dl.espressif.com/dl/$ESP32_TARBALL.tar.gz \ - && tar zxf $ESP32_TARBALL.tar.gz \ - && rm -f $ESP32_TARBALL.tar.gz \ - && git clone -b v3.3 --recursive --depth=1 --shallow-submodules https://github.com/espressif/esp-idf +# Build an initial bootstrap hello world just to compile libsodium and other +# system level dependencies. +COPY other/docker/esp32/sdkconfig \ + other/docker/esp32/CMakeLists.txt \ + /root/toxcore/ +COPY other/docker/esp32/bootstrap/ \ + /root/toxcore/main/ +RUN . /root/esp/esp-idf/export.sh && idf.py build -# Build a hello world first, so the OS and libsodium etc. are compiled. -WORKDIR /root/esp/toxcore -COPY other/docker/esp32/CMakeLists.txt /root/esp/toxcore/ -COPY other/docker/esp32/hello/ /root/esp/toxcore/main/ -RUN idf.py build - -# Then copy over the actual toxcore sources and build those. -COPY --from=src /src/third_party/cmp/ /root/esp/toxcore/main/third_party/cmp/ -COPY --from=src /src/toxencryptsave/defines.h /root/esp/toxcore/main/toxencryptsave/ -COPY --from=src /src/toxcore/ /root/esp/toxcore/main/toxcore/ -COPY other/docker/esp32/toxcore/CMakeLists.txt /root/esp/toxcore/main/ -COPY other/docker/esp32/toxcore/toxcore_main.cc /root/esp/toxcore/main/other/docker/esp32/main/ -RUN idf.py build +# Copy over toxcore sources and build those. +COPY third_party/cmp/ /root/toxcore/main/third_party/cmp/ +COPY toxencryptsave/defines.h /root/toxcore/main/toxencryptsave/ +COPY toxcore/ /root/toxcore/main/toxcore/ +COPY other/docker/esp32/main/CMakeLists.txt \ + /root/toxcore/main/ +COPY other/docker/esp32/main/*.cc \ + other/docker/esp32/main/*.h \ + /root/toxcore/main/other/docker/esp32/main/ +RUN touch /root/toxcore/main/CMakeLists.txt \ + && . /root/esp/esp-idf/export.sh && idf.py build RUN ls -lh build/toxcore.bin \ - && shasum build/toxcore.bin + && sha512sum build/toxcore.bin +RUN /root/flash.sh build/toxcore.bin + +COPY other/docker/esp32/qemu-test /root/toxcore/ +RUN ["/root/toxcore/qemu-test"] diff --git a/other/docker/esp32/bootstrap/CMakeLists.txt b/other/docker/esp32/bootstrap/CMakeLists.txt new file mode 100644 index 0000000000..3276b2a026 --- /dev/null +++ b/other/docker/esp32/bootstrap/CMakeLists.txt @@ -0,0 +1,4 @@ +idf_component_register( + SRCS hello_main.cc + INCLUDE_DIRS "." + REQUIRES esp_netif lwip) diff --git a/other/docker/esp32/bootstrap/hello_main.cc b/other/docker/esp32/bootstrap/hello_main.cc new file mode 100644 index 0000000000..a55acc70b5 --- /dev/null +++ b/other/docker/esp32/bootstrap/hello_main.cc @@ -0,0 +1,7 @@ +#include + +// Bootstrap main. Only writes hello world. See ../main/* for the real thing. +extern "C" void app_main(void) +{ + printf("Hello world!\n"); +} diff --git a/other/docker/esp32/bootstrap/idf_component.yml b/other/docker/esp32/bootstrap/idf_component.yml new file mode 100644 index 0000000000..6d04f9bf19 --- /dev/null +++ b/other/docker/esp32/bootstrap/idf_component.yml @@ -0,0 +1,2 @@ +dependencies: + espressif/libsodium: "==1.0.20" diff --git a/other/docker/esp32/hello/CMakeLists.txt b/other/docker/esp32/hello/CMakeLists.txt deleted file mode 100644 index 0a8bbce165..0000000000 --- a/other/docker/esp32/hello/CMakeLists.txt +++ /dev/null @@ -1,4 +0,0 @@ -set(COMPONENT_SRCS "hello_main.c") -set(COMPONENT_ADD_INCLUDEDIRS "") - -register_component() diff --git a/other/docker/esp32/hello/hello_main.c b/other/docker/esp32/hello/hello_main.c deleted file mode 100644 index 1c961d6cdf..0000000000 --- a/other/docker/esp32/hello/hello_main.c +++ /dev/null @@ -1,6 +0,0 @@ -#include - -void app_main(void) -{ - printf("Hello world!\n"); -} diff --git a/other/docker/esp32/host_main.cc b/other/docker/esp32/host_main.cc new file mode 100644 index 0000000000..f360e7727b --- /dev/null +++ b/other/docker/esp32/host_main.cc @@ -0,0 +1,6 @@ +#include "main/tox_main.h" + +int main() +{ + tox_main(); +} diff --git a/other/docker/esp32/main/CMakeLists.txt b/other/docker/esp32/main/CMakeLists.txt new file mode 100644 index 0000000000..c81c1244ca --- /dev/null +++ b/other/docker/esp32/main/CMakeLists.txt @@ -0,0 +1,16 @@ +set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wno-missing-field-initializers -Wno-format -DMIN_LOGGER_LEVEL=LOGGER_LEVEL_TRACE") + +file(GLOB toxcore_SRCS "toxcore/*.[ch]" "toxcore/*/*.[ch]") +set(COMPONENT_SRCS + ${toxcore_SRCS} + other/docker/esp32/main/app_main.cc + other/docker/esp32/main/tox_main.cc + other/docker/esp32/main/tox_main.h + third_party/cmp/cmp.c + third_party/cmp/cmp.h + toxencryptsave/defines.h) + +idf_component_register( + SRCS ${COMPONENT_SRCS} + INCLUDE_DIRS "." + REQUIRES esp_eth esp_netif lwip) diff --git a/other/docker/esp32/main/app_main.cc b/other/docker/esp32/main/app_main.cc new file mode 100644 index 0000000000..f56addeef8 --- /dev/null +++ b/other/docker/esp32/main/app_main.cc @@ -0,0 +1,67 @@ +#include +#include + +#include +#include +#include +#include +#include + +#include "tox_main.h" + +static const char *MAIN_TAG = "app_main"; +static constexpr int NTP_TIMEOUT = 60; // 1 minute + +static esp_eth_handle_t eth_handle = nullptr; +static esp_netif_t *eth_netif = nullptr; + +static void event_handler(void *arg, esp_event_base_t event_base, + int32_t event_id, void *event_data) +{ + if (event_base == ETH_EVENT) { + if (event_id == ETHERNET_EVENT_START) return; + if (event_id == ETHERNET_EVENT_STOP) return; + } + if (event_base == IP_EVENT) + if (event_id == IP_EVENT_ETH_GOT_IP) + return; +} + +static void register_ethernet(void) +{ + ESP_ERROR_CHECK(esp_netif_init()); + ESP_ERROR_CHECK(esp_event_loop_create_default()); + esp_netif_config_t cfg = ESP_NETIF_DEFAULT_ETH(); + eth_netif = esp_netif_new(&cfg); + + eth_mac_config_t mac_config = ETH_MAC_DEFAULT_CONFIG(); + eth_phy_config_t phy_config = ETH_PHY_DEFAULT_CONFIG(); + esp_eth_mac_t *mac = esp_eth_mac_new_openeth(&mac_config); + + esp_eth_phy_t *phy = esp_eth_phy_new_dp83848(&phy_config); + + esp_eth_config_t config = ETH_DEFAULT_CONFIG(mac, phy); + ESP_ERROR_CHECK(esp_eth_driver_install(&config, ð_handle)); + ESP_ERROR_CHECK(esp_netif_attach(eth_netif, esp_eth_new_netif_glue(eth_handle))); + ESP_ERROR_CHECK(esp_event_handler_register(ETH_EVENT, ESP_EVENT_ANY_ID, &event_handler, NULL)); + ESP_ERROR_CHECK(esp_event_handler_register(IP_EVENT, IP_EVENT_ETH_GOT_IP, &event_handler, NULL)); + ESP_ERROR_CHECK(esp_eth_start(eth_handle)); +} + +// Does all the esp32-specific init before running generic tox code. +extern "C" void app_main(void) +{ + register_ethernet(); + + esp_sntp_config_t config = ESP_NETIF_SNTP_DEFAULT_CONFIG("pool.ntp.org"); + ESP_ERROR_CHECK(esp_netif_sntp_init(&config)); + + if (esp_netif_sntp_sync_wait(pdMS_TO_TICKS(NTP_TIMEOUT * 1000)) != ESP_OK) { + ESP_LOGE(MAIN_TAG, "failed to update system time within 10s timeout"); + return; + } + + ESP_LOGI(MAIN_TAG, "time is updated: %lld", time(nullptr)); + + tox_main(); +} diff --git a/other/docker/esp32/main/tox_main.cc b/other/docker/esp32/main/tox_main.cc new file mode 100644 index 0000000000..1c8b85aefa --- /dev/null +++ b/other/docker/esp32/main/tox_main.cc @@ -0,0 +1,122 @@ +#include "../main/tox_main.h" + +#include +#include +#include +#include +#include + +#include "../../../../toxcore/ccompat.h" +#include "../../../../toxcore/tox.h" +#include "../../../../toxcore/tox_events.h" + +static char tox_log_level_name(Tox_Log_Level level) +{ + switch (level) { + case TOX_LOG_LEVEL_TRACE: return 'T'; + case TOX_LOG_LEVEL_DEBUG: return 'D'; + case TOX_LOG_LEVEL_INFO: return 'I'; + case TOX_LOG_LEVEL_WARNING: return 'W'; + case TOX_LOG_LEVEL_ERROR: return 'E'; + } + + return '?'; +} + +static const char *tox_err_new_name(Tox_Err_New err) +{ + switch (err) { + case TOX_ERR_NEW_OK: return "OK"; + case TOX_ERR_NEW_NULL: return "NULL"; + case TOX_ERR_NEW_MALLOC: return "MALLOC"; + case TOX_ERR_NEW_PORT_ALLOC: return "PORT_ALLOC"; + case TOX_ERR_NEW_PROXY_BAD_TYPE: return "PROXY_BAD_TYPE"; + case TOX_ERR_NEW_PROXY_BAD_HOST: return "PROXY_BAD_HOST"; + case TOX_ERR_NEW_PROXY_BAD_PORT: return "PROXY_BAD_PORT"; + case TOX_ERR_NEW_PROXY_NOT_FOUND: return "PROXY_NOT_FOUND"; + case TOX_ERR_NEW_LOAD_ENCRYPTED: return "LOAD_ENCRYPTED"; + case TOX_ERR_NEW_LOAD_BAD_FORMAT: return "LOAD_BAD_FORMAT"; + } + + return ""; +} + +static const char *color(int index) +{ + switch (index) { + case 0: return "\033[35m"; + case 1: return "\033[36m"; + } + + return "\033[0m"; +} + +static tox_log_cb log_handler; +static void log_handler(Tox *tox, Tox_Log_Level level, const char *file, uint32_t line, const char *func, const char *msg, void *user_data) +{ + const int *index = (const int *)user_data; + const uint16_t udp_port = tox_self_get_udp_port(tox, nullptr); + printf("%s#%d (:%d) [%c] %s:%u(%s): %s\n", color(*index), *index, udp_port, + tox_log_level_name(level), file, (unsigned int)line, func, msg); +} + +using Tox_Options_Ptr = std::unique_ptr; +using Tox_Ptr = std::unique_ptr; + +void tox_main() +{ + printf("Hello Tox!\n"); + + Tox_Options_Ptr opts(tox_options_new(nullptr), tox_options_free); + assert(opts != nullptr); + + tox_options_set_ipv6_enabled(opts.get(), false); + tox_options_set_local_discovery_enabled(opts.get(), false); + + tox_options_set_log_callback(opts.get(), log_handler); + + Tox_Err_New err; + + int index[] = {0, 1}; + + tox_options_set_log_user_data(opts.get(), &index[0]); + Tox_Ptr tox0(tox_new(opts.get(), &err), tox_kill); + printf("tox_new(#0): %p\n", (void *)tox0.get()); + + if (err != TOX_ERR_NEW_OK) { + printf("tox_new(#0): %s\n", tox_err_new_name(err)); + return; + } + + tox_options_set_log_user_data(opts.get(), &index[1]); + Tox_Ptr tox1(tox_new(opts.get(), &err), tox_kill); + printf("tox_new(#1): %p\n", (void *)tox1.get()); + + if (err != TOX_ERR_NEW_OK) { + printf("tox_new(#1): %s\n", tox_err_new_name(err)); + return; + } + + uint8_t pk[TOX_PUBLIC_KEY_SIZE]; + tox_self_get_dht_id(tox0.get(), pk); + tox_bootstrap(tox1.get(), "localhost", tox_self_get_udp_port(tox0.get(), nullptr), pk, nullptr); + +#if 0 + tox_self_get_public_key(tox0.get(), pk); + tox_friend_add_norequest(tox1.get(), pk, nullptr); + + tox_self_get_public_key(tox1.get(), pk); + tox_friend_add_norequest(tox0.get(), pk, nullptr); +#endif + + printf("bootstrapping and connecting 2 toxes\n"); + + while (tox_self_get_connection_status(tox1.get()) == TOX_CONNECTION_NONE || + tox_self_get_connection_status(tox0.get()) == TOX_CONNECTION_NONE) { + tox_events_free(tox_events_iterate(tox0.get(), true, nullptr)); + tox_events_free(tox_events_iterate(tox1.get(), true, nullptr)); + + usleep(tox_iteration_interval(tox0.get()) * 1000); + usleep(250); // a bit less noise in the log + } +} diff --git a/other/docker/esp32/main/tox_main.h b/other/docker/esp32/main/tox_main.h new file mode 100644 index 0000000000..29d30a300c --- /dev/null +++ b/other/docker/esp32/main/tox_main.h @@ -0,0 +1,6 @@ +#ifndef TOX_MAIN_H +#define TOX_MAIN_H + +void tox_main(); + +#endif // TOX_MAIN_H diff --git a/other/docker/esp32/qemu-test b/other/docker/esp32/qemu-test new file mode 100755 index 0000000000..eac608f2d1 --- /dev/null +++ b/other/docker/esp32/qemu-test @@ -0,0 +1,17 @@ +#!/bin/bash + +set -eu + +qemu-system-xtensa \ + -nographic \ + -M esp32 \ + -m 4 \ + -drive file=flash.bin,if=mtd,format=raw \ + -nic user,model=open_eth,hostfwd=tcp::80-:80 \ + -s \ + | tee qemu.log & + +echo "Waiting for program to complete" +while ! grep 'Returned from app_main' qemu.log > /dev/null; do + sleep 1 +done diff --git a/other/docker/esp32/run b/other/docker/esp32/run index c611413f3d..2f98996065 100755 --- a/other/docker/esp32/run +++ b/other/docker/esp32/run @@ -1,4 +1,3 @@ #!/bin/sh -docker build -t toxchat/c-toxcore:sources -f other/docker/sources/Dockerfile . docker build -t toxchat/c-toxcore:esp32 -f other/docker/esp32/Dockerfile . diff --git a/other/docker/esp32/run-host b/other/docker/esp32/run-host new file mode 100755 index 0000000000..66c52587b6 --- /dev/null +++ b/other/docker/esp32/run-host @@ -0,0 +1,5 @@ +#!/bin/sh + +set -eux + +bazel run //c-toxcore/other/docker/esp32:host_main diff --git a/other/docker/esp32/sdkconfig b/other/docker/esp32/sdkconfig new file mode 100644 index 0000000000..a87ad906cd --- /dev/null +++ b/other/docker/esp32/sdkconfig @@ -0,0 +1,1937 @@ +# +# Automatically generated file. DO NOT EDIT. +# Espressif IoT Development Framework (ESP-IDF) 5.2.0 Project Configuration +# +CONFIG_SOC_BROWNOUT_RESET_SUPPORTED="Not determined" +CONFIG_SOC_TWAI_BRP_DIV_SUPPORTED="Not determined" +CONFIG_SOC_DPORT_WORKAROUND="Not determined" +CONFIG_SOC_CAPS_ECO_VER_MAX=301 +CONFIG_SOC_ADC_SUPPORTED=y +CONFIG_SOC_DAC_SUPPORTED=y +CONFIG_SOC_UART_SUPPORTED=y +CONFIG_SOC_MCPWM_SUPPORTED=y +CONFIG_SOC_GPTIMER_SUPPORTED=y +CONFIG_SOC_SDMMC_HOST_SUPPORTED=y +CONFIG_SOC_BT_SUPPORTED=y +CONFIG_SOC_PCNT_SUPPORTED=y +CONFIG_SOC_WIFI_SUPPORTED=y +CONFIG_SOC_SDIO_SLAVE_SUPPORTED=y +CONFIG_SOC_TWAI_SUPPORTED=y +CONFIG_SOC_EFUSE_SUPPORTED=y +CONFIG_SOC_EMAC_SUPPORTED=y +CONFIG_SOC_ULP_SUPPORTED=y +CONFIG_SOC_CCOMP_TIMER_SUPPORTED=y +CONFIG_SOC_RTC_FAST_MEM_SUPPORTED=y +CONFIG_SOC_RTC_SLOW_MEM_SUPPORTED=y +CONFIG_SOC_RTC_MEM_SUPPORTED=y +CONFIG_SOC_I2S_SUPPORTED=y +CONFIG_SOC_RMT_SUPPORTED=y +CONFIG_SOC_SDM_SUPPORTED=y +CONFIG_SOC_GPSPI_SUPPORTED=y +CONFIG_SOC_LEDC_SUPPORTED=y +CONFIG_SOC_I2C_SUPPORTED=y +CONFIG_SOC_SUPPORT_COEXISTENCE=y +CONFIG_SOC_AES_SUPPORTED=y +CONFIG_SOC_MPI_SUPPORTED=y +CONFIG_SOC_SHA_SUPPORTED=y +CONFIG_SOC_FLASH_ENC_SUPPORTED=y +CONFIG_SOC_SECURE_BOOT_SUPPORTED=y +CONFIG_SOC_TOUCH_SENSOR_SUPPORTED=y +CONFIG_SOC_BOD_SUPPORTED=y +CONFIG_SOC_ULP_FSM_SUPPORTED=y +CONFIG_SOC_CLK_TREE_SUPPORTED=y +CONFIG_SOC_DPORT_WORKAROUND_DIS_INTERRUPT_LVL=5 +CONFIG_SOC_XTAL_SUPPORT_26M=y +CONFIG_SOC_XTAL_SUPPORT_40M=y +CONFIG_SOC_XTAL_SUPPORT_AUTO_DETECT=y +CONFIG_SOC_ADC_RTC_CTRL_SUPPORTED=y +CONFIG_SOC_ADC_DIG_CTRL_SUPPORTED=y +CONFIG_SOC_ADC_DMA_SUPPORTED=y +CONFIG_SOC_ADC_PERIPH_NUM=2 +CONFIG_SOC_ADC_MAX_CHANNEL_NUM=10 +CONFIG_SOC_ADC_ATTEN_NUM=4 +CONFIG_SOC_ADC_DIGI_CONTROLLER_NUM=2 +CONFIG_SOC_ADC_PATT_LEN_MAX=16 +CONFIG_SOC_ADC_DIGI_MIN_BITWIDTH=9 +CONFIG_SOC_ADC_DIGI_MAX_BITWIDTH=12 +CONFIG_SOC_ADC_DIGI_RESULT_BYTES=2 +CONFIG_SOC_ADC_DIGI_DATA_BYTES_PER_CONV=4 +CONFIG_SOC_ADC_DIGI_MONITOR_NUM=0 +CONFIG_SOC_ADC_SAMPLE_FREQ_THRES_HIGH=2 +CONFIG_SOC_ADC_SAMPLE_FREQ_THRES_LOW=20 +CONFIG_SOC_ADC_RTC_MIN_BITWIDTH=9 +CONFIG_SOC_ADC_RTC_MAX_BITWIDTH=12 +CONFIG_SOC_ADC_SHARED_POWER=y +CONFIG_SOC_SHARED_IDCACHE_SUPPORTED=y +CONFIG_SOC_IDCACHE_PER_CORE=y +CONFIG_SOC_CPU_CORES_NUM=2 +CONFIG_SOC_CPU_INTR_NUM=32 +CONFIG_SOC_CPU_HAS_FPU=y +CONFIG_SOC_CPU_BREAKPOINTS_NUM=2 +CONFIG_SOC_CPU_WATCHPOINTS_NUM=2 +CONFIG_SOC_CPU_WATCHPOINT_SIZE=64 +CONFIG_SOC_DAC_CHAN_NUM=2 +CONFIG_SOC_DAC_RESOLUTION=8 +CONFIG_SOC_DAC_DMA_16BIT_ALIGN=y +CONFIG_SOC_GPIO_PORT=1 +CONFIG_SOC_GPIO_PIN_COUNT=40 +CONFIG_SOC_GPIO_VALID_GPIO_MASK=0xFFFFFFFFFF +CONFIG_SOC_GPIO_VALID_DIGITAL_IO_PAD_MASK=0xEF0FEA +CONFIG_SOC_I2C_NUM=2 +CONFIG_SOC_I2C_FIFO_LEN=32 +CONFIG_SOC_I2C_CMD_REG_NUM=16 +CONFIG_SOC_I2C_SUPPORT_SLAVE=y +CONFIG_SOC_I2C_SUPPORT_APB=y +CONFIG_SOC_I2C_STOP_INDEPENDENT=y +CONFIG_SOC_I2S_NUM=2 +CONFIG_SOC_I2S_HW_VERSION_1=y +CONFIG_SOC_I2S_SUPPORTS_APLL=y +CONFIG_SOC_I2S_SUPPORTS_PLL_F160M=y +CONFIG_SOC_I2S_SUPPORTS_PDM=y +CONFIG_SOC_I2S_SUPPORTS_PDM_TX=y +CONFIG_SOC_I2S_PDM_MAX_TX_LINES=1 +CONFIG_SOC_I2S_SUPPORTS_PDM_RX=y +CONFIG_SOC_I2S_PDM_MAX_RX_LINES=1 +CONFIG_SOC_I2S_SUPPORTS_ADC_DAC=y +CONFIG_SOC_I2S_SUPPORTS_ADC=y +CONFIG_SOC_I2S_SUPPORTS_DAC=y +CONFIG_SOC_I2S_SUPPORTS_LCD_CAMERA=y +CONFIG_SOC_I2S_TRANS_SIZE_ALIGN_WORD=y +CONFIG_SOC_I2S_LCD_I80_VARIANT=y +CONFIG_SOC_LCD_I80_SUPPORTED=y +CONFIG_SOC_LCD_I80_BUSES=2 +CONFIG_SOC_LCD_I80_BUS_WIDTH=24 +CONFIG_SOC_LEDC_HAS_TIMER_SPECIFIC_MUX=y +CONFIG_SOC_LEDC_SUPPORT_APB_CLOCK=y +CONFIG_SOC_LEDC_SUPPORT_REF_TICK=y +CONFIG_SOC_LEDC_SUPPORT_HS_MODE=y +CONFIG_SOC_LEDC_CHANNEL_NUM=8 +CONFIG_SOC_LEDC_TIMER_BIT_WIDTH=20 +CONFIG_SOC_MCPWM_GROUPS=2 +CONFIG_SOC_MCPWM_TIMERS_PER_GROUP=3 +CONFIG_SOC_MCPWM_OPERATORS_PER_GROUP=3 +CONFIG_SOC_MCPWM_COMPARATORS_PER_OPERATOR=2 +CONFIG_SOC_MCPWM_GENERATORS_PER_OPERATOR=2 +CONFIG_SOC_MCPWM_TRIGGERS_PER_OPERATOR=2 +CONFIG_SOC_MCPWM_GPIO_FAULTS_PER_GROUP=3 +CONFIG_SOC_MCPWM_CAPTURE_TIMERS_PER_GROUP=y +CONFIG_SOC_MCPWM_CAPTURE_CHANNELS_PER_TIMER=3 +CONFIG_SOC_MCPWM_GPIO_SYNCHROS_PER_GROUP=3 +CONFIG_SOC_MMU_PERIPH_NUM=2 +CONFIG_SOC_MMU_LINEAR_ADDRESS_REGION_NUM=3 +CONFIG_SOC_MPU_MIN_REGION_SIZE=0x20000000 +CONFIG_SOC_MPU_REGIONS_MAX_NUM=8 +CONFIG_SOC_PCNT_GROUPS=1 +CONFIG_SOC_PCNT_UNITS_PER_GROUP=8 +CONFIG_SOC_PCNT_CHANNELS_PER_UNIT=2 +CONFIG_SOC_PCNT_THRES_POINT_PER_UNIT=2 +CONFIG_SOC_RMT_GROUPS=1 +CONFIG_SOC_RMT_TX_CANDIDATES_PER_GROUP=8 +CONFIG_SOC_RMT_RX_CANDIDATES_PER_GROUP=8 +CONFIG_SOC_RMT_CHANNELS_PER_GROUP=8 +CONFIG_SOC_RMT_MEM_WORDS_PER_CHANNEL=64 +CONFIG_SOC_RMT_SUPPORT_REF_TICK=y +CONFIG_SOC_RMT_SUPPORT_APB=y +CONFIG_SOC_RMT_CHANNEL_CLK_INDEPENDENT=y +CONFIG_SOC_RTCIO_PIN_COUNT=18 +CONFIG_SOC_RTCIO_INPUT_OUTPUT_SUPPORTED=y +CONFIG_SOC_RTCIO_HOLD_SUPPORTED=y +CONFIG_SOC_RTCIO_WAKE_SUPPORTED=y +CONFIG_SOC_SDM_GROUPS=1 +CONFIG_SOC_SDM_CHANNELS_PER_GROUP=8 +CONFIG_SOC_SDM_CLK_SUPPORT_APB=y +CONFIG_SOC_SPI_HD_BOTH_INOUT_SUPPORTED=y +CONFIG_SOC_SPI_AS_CS_SUPPORTED=y +CONFIG_SOC_SPI_PERIPH_NUM=3 +CONFIG_SOC_SPI_DMA_CHAN_NUM=2 +CONFIG_SOC_SPI_MAX_CS_NUM=3 +CONFIG_SOC_SPI_SUPPORT_CLK_APB=y +CONFIG_SOC_SPI_MAXIMUM_BUFFER_SIZE=64 +CONFIG_SOC_SPI_MAX_PRE_DIVIDER=8192 +CONFIG_SOC_MEMSPI_SRC_FREQ_80M_SUPPORTED=y +CONFIG_SOC_MEMSPI_SRC_FREQ_40M_SUPPORTED=y +CONFIG_SOC_MEMSPI_SRC_FREQ_26M_SUPPORTED=y +CONFIG_SOC_MEMSPI_SRC_FREQ_20M_SUPPORTED=y +CONFIG_SOC_TIMER_GROUPS=2 +CONFIG_SOC_TIMER_GROUP_TIMERS_PER_GROUP=2 +CONFIG_SOC_TIMER_GROUP_COUNTER_BIT_WIDTH=64 +CONFIG_SOC_TIMER_GROUP_TOTAL_TIMERS=4 +CONFIG_SOC_TIMER_GROUP_SUPPORT_APB=y +CONFIG_SOC_TOUCH_VERSION_1=y +CONFIG_SOC_TOUCH_SENSOR_NUM=10 +CONFIG_SOC_TOUCH_PAD_MEASURE_WAIT_MAX=0xFF +CONFIG_SOC_TWAI_CONTROLLER_NUM=1 +CONFIG_SOC_TWAI_BRP_MIN=2 +CONFIG_SOC_TWAI_CLK_SUPPORT_APB=y +CONFIG_SOC_TWAI_SUPPORT_MULTI_ADDRESS_LAYOUT=y +CONFIG_SOC_UART_NUM=3 +CONFIG_SOC_UART_HP_NUM=3 +CONFIG_SOC_UART_SUPPORT_APB_CLK=y +CONFIG_SOC_UART_SUPPORT_REF_TICK=y +CONFIG_SOC_UART_FIFO_LEN=128 +CONFIG_SOC_UART_BITRATE_MAX=5000000 +CONFIG_SOC_SPIRAM_SUPPORTED=y +CONFIG_SOC_SPI_MEM_SUPPORT_CONFIG_GPIO_BY_EFUSE=y +CONFIG_SOC_SHA_SUPPORT_PARALLEL_ENG=y +CONFIG_SOC_SHA_ENDIANNESS_BE=y +CONFIG_SOC_SHA_SUPPORT_SHA1=y +CONFIG_SOC_SHA_SUPPORT_SHA256=y +CONFIG_SOC_SHA_SUPPORT_SHA384=y +CONFIG_SOC_SHA_SUPPORT_SHA512=y +CONFIG_SOC_MPI_MEM_BLOCKS_NUM=4 +CONFIG_SOC_MPI_OPERATIONS_NUM=y +CONFIG_SOC_RSA_MAX_BIT_LEN=4096 +CONFIG_SOC_AES_SUPPORT_AES_128=y +CONFIG_SOC_AES_SUPPORT_AES_192=y +CONFIG_SOC_AES_SUPPORT_AES_256=y +CONFIG_SOC_SECURE_BOOT_V1=y +CONFIG_SOC_EFUSE_SECURE_BOOT_KEY_DIGESTS=y +CONFIG_SOC_FLASH_ENCRYPTED_XTS_AES_BLOCK_MAX=32 +CONFIG_SOC_PHY_DIG_REGS_MEM_SIZE=21 +CONFIG_SOC_PM_SUPPORT_EXT0_WAKEUP=y +CONFIG_SOC_PM_SUPPORT_EXT1_WAKEUP=y +CONFIG_SOC_PM_SUPPORT_EXT_WAKEUP=y +CONFIG_SOC_PM_SUPPORT_TOUCH_SENSOR_WAKEUP=y +CONFIG_SOC_PM_SUPPORT_RTC_PERIPH_PD=y +CONFIG_SOC_PM_SUPPORT_RTC_FAST_MEM_PD=y +CONFIG_SOC_PM_SUPPORT_RTC_SLOW_MEM_PD=y +CONFIG_SOC_PM_SUPPORT_RC_FAST_PD=y +CONFIG_SOC_PM_SUPPORT_VDDSDIO_PD=y +CONFIG_SOC_PM_SUPPORT_MODEM_PD=y +CONFIG_SOC_CONFIGURABLE_VDDSDIO_SUPPORTED=y +CONFIG_SOC_CLK_APLL_SUPPORTED=y +CONFIG_SOC_APLL_MULTIPLIER_OUT_MIN_HZ=350000000 +CONFIG_SOC_APLL_MULTIPLIER_OUT_MAX_HZ=500000000 +CONFIG_SOC_APLL_MIN_HZ=5303031 +CONFIG_SOC_APLL_MAX_HZ=125000000 +CONFIG_SOC_CLK_RC_FAST_D256_SUPPORTED=y +CONFIG_SOC_RTC_SLOW_CLK_SUPPORT_RC_FAST_D256=y +CONFIG_SOC_CLK_RC_FAST_SUPPORT_CALIBRATION=y +CONFIG_SOC_CLK_XTAL32K_SUPPORTED=y +CONFIG_SOC_SDMMC_USE_IOMUX=y +CONFIG_SOC_SDMMC_NUM_SLOTS=2 +CONFIG_SOC_WIFI_WAPI_SUPPORT=y +CONFIG_SOC_WIFI_CSI_SUPPORT=y +CONFIG_SOC_WIFI_MESH_SUPPORT=y +CONFIG_SOC_WIFI_SUPPORT_VARIABLE_BEACON_WINDOW=y +CONFIG_SOC_WIFI_NAN_SUPPORT=y +CONFIG_SOC_BLE_SUPPORTED=y +CONFIG_SOC_BLE_MESH_SUPPORTED=y +CONFIG_SOC_BT_CLASSIC_SUPPORTED=y +CONFIG_SOC_BLUFI_SUPPORTED=y +CONFIG_SOC_ULP_HAS_ADC=y +CONFIG_IDF_CMAKE=y +CONFIG_IDF_TOOLCHAIN="gcc" +CONFIG_IDF_TARGET_ARCH_XTENSA=y +CONFIG_IDF_TARGET_ARCH="xtensa" +CONFIG_IDF_TARGET="esp32" +CONFIG_IDF_INIT_VERSION="5.2.0" +CONFIG_IDF_TARGET_ESP32=y +CONFIG_IDF_FIRMWARE_CHIP_ID=0x0000 + +# +# Build type +# +CONFIG_APP_BUILD_TYPE_APP_2NDBOOT=y +# CONFIG_APP_BUILD_TYPE_RAM is not set +CONFIG_APP_BUILD_GENERATE_BINARIES=y +CONFIG_APP_BUILD_BOOTLOADER=y +CONFIG_APP_BUILD_USE_FLASH_SECTIONS=y +CONFIG_APP_REPRODUCIBLE_BUILD=y +# CONFIG_APP_NO_BLOBS is not set +# CONFIG_APP_COMPATIBLE_PRE_V2_1_BOOTLOADERS is not set +# CONFIG_APP_COMPATIBLE_PRE_V3_1_BOOTLOADERS is not set +# end of Build type + +# +# Bootloader config +# + +# +# Bootloader manager +# +CONFIG_BOOTLOADER_PROJECT_VER=1 +# end of Bootloader manager + +CONFIG_BOOTLOADER_OFFSET_IN_FLASH=0x1000 +CONFIG_BOOTLOADER_COMPILER_OPTIMIZATION_SIZE=y +# CONFIG_BOOTLOADER_COMPILER_OPTIMIZATION_DEBUG is not set +# CONFIG_BOOTLOADER_COMPILER_OPTIMIZATION_PERF is not set +# CONFIG_BOOTLOADER_COMPILER_OPTIMIZATION_NONE is not set +# CONFIG_BOOTLOADER_LOG_LEVEL_NONE is not set +# CONFIG_BOOTLOADER_LOG_LEVEL_ERROR is not set +# CONFIG_BOOTLOADER_LOG_LEVEL_WARN is not set +CONFIG_BOOTLOADER_LOG_LEVEL_INFO=y +# CONFIG_BOOTLOADER_LOG_LEVEL_DEBUG is not set +# CONFIG_BOOTLOADER_LOG_LEVEL_VERBOSE is not set +CONFIG_BOOTLOADER_LOG_LEVEL=3 +# CONFIG_BOOTLOADER_VDDSDIO_BOOST_1_8V is not set +CONFIG_BOOTLOADER_VDDSDIO_BOOST_1_9V=y +# CONFIG_BOOTLOADER_FACTORY_RESET is not set +# CONFIG_BOOTLOADER_APP_TEST is not set +CONFIG_BOOTLOADER_REGION_PROTECTION_ENABLE=y +CONFIG_BOOTLOADER_WDT_ENABLE=y +# CONFIG_BOOTLOADER_WDT_DISABLE_IN_USER_CODE is not set +CONFIG_BOOTLOADER_WDT_TIME_MS=9000 +# CONFIG_BOOTLOADER_APP_ROLLBACK_ENABLE is not set +# CONFIG_BOOTLOADER_SKIP_VALIDATE_IN_DEEP_SLEEP is not set +# CONFIG_BOOTLOADER_SKIP_VALIDATE_ON_POWER_ON is not set +# CONFIG_BOOTLOADER_SKIP_VALIDATE_ALWAYS is not set +CONFIG_BOOTLOADER_RESERVE_RTC_SIZE=0 +# CONFIG_BOOTLOADER_CUSTOM_RESERVE_RTC is not set +CONFIG_BOOTLOADER_FLASH_XMC_SUPPORT=y +# end of Bootloader config + +# +# Security features +# +CONFIG_SECURE_BOOT_V1_SUPPORTED=y +# CONFIG_SECURE_SIGNED_APPS_NO_SECURE_BOOT is not set +# CONFIG_SECURE_BOOT is not set +# CONFIG_SECURE_FLASH_ENC_ENABLED is not set +# end of Security features + +# +# Application manager +# +# CONFIG_APP_EXCLUDE_PROJECT_VER_VAR is not set +# CONFIG_APP_EXCLUDE_PROJECT_NAME_VAR is not set +# CONFIG_APP_PROJECT_VER_FROM_CONFIG is not set +CONFIG_APP_RETRIEVE_LEN_ELF_SHA=9 +# end of Application manager + +CONFIG_ESP_ROM_HAS_CRC_LE=y +CONFIG_ESP_ROM_HAS_CRC_BE=y +CONFIG_ESP_ROM_HAS_MZ_CRC32=y +CONFIG_ESP_ROM_HAS_JPEG_DECODE=y +CONFIG_ESP_ROM_HAS_UART_BUF_SWITCH=y +CONFIG_ESP_ROM_NEEDS_SWSETUP_WORKAROUND=y +CONFIG_ESP_ROM_HAS_NEWLIB_NANO_FORMAT=y + +# +# Serial flasher config +# +# CONFIG_ESPTOOLPY_NO_STUB is not set +# CONFIG_ESPTOOLPY_FLASHMODE_QIO is not set +# CONFIG_ESPTOOLPY_FLASHMODE_QOUT is not set +CONFIG_ESPTOOLPY_FLASHMODE_DIO=y +# CONFIG_ESPTOOLPY_FLASHMODE_DOUT is not set +CONFIG_ESPTOOLPY_FLASH_SAMPLE_MODE_STR=y +CONFIG_ESPTOOLPY_FLASHMODE="dio" +# CONFIG_ESPTOOLPY_FLASHFREQ_80M is not set +CONFIG_ESPTOOLPY_FLASHFREQ_40M=y +# CONFIG_ESPTOOLPY_FLASHFREQ_26M is not set +# CONFIG_ESPTOOLPY_FLASHFREQ_20M is not set +CONFIG_ESPTOOLPY_FLASHFREQ="40m" +# CONFIG_ESPTOOLPY_FLASHSIZE_1MB is not set +# CONFIG_ESPTOOLPY_FLASHSIZE_2MB is not set +CONFIG_ESPTOOLPY_FLASHSIZE_4MB=y +# CONFIG_ESPTOOLPY_FLASHSIZE_8MB is not set +# CONFIG_ESPTOOLPY_FLASHSIZE_16MB is not set +# CONFIG_ESPTOOLPY_FLASHSIZE_32MB is not set +# CONFIG_ESPTOOLPY_FLASHSIZE_64MB is not set +# CONFIG_ESPTOOLPY_FLASHSIZE_128MB is not set +CONFIG_ESPTOOLPY_FLASHSIZE="4MB" +# CONFIG_ESPTOOLPY_HEADER_FLASHSIZE_UPDATE is not set +CONFIG_ESPTOOLPY_BEFORE_RESET=y +# CONFIG_ESPTOOLPY_BEFORE_NORESET is not set +CONFIG_ESPTOOLPY_BEFORE="default_reset" +CONFIG_ESPTOOLPY_AFTER_RESET=y +# CONFIG_ESPTOOLPY_AFTER_NORESET is not set +CONFIG_ESPTOOLPY_AFTER="hard_reset" +CONFIG_ESPTOOLPY_MONITOR_BAUD=115200 +# end of Serial flasher config + +# +# Partition Table +# +CONFIG_PARTITION_TABLE_SINGLE_APP=y +# CONFIG_PARTITION_TABLE_SINGLE_APP_LARGE is not set +# CONFIG_PARTITION_TABLE_TWO_OTA is not set +# CONFIG_PARTITION_TABLE_CUSTOM is not set +CONFIG_PARTITION_TABLE_CUSTOM_FILENAME="partitions.csv" +CONFIG_PARTITION_TABLE_FILENAME="partitions_singleapp.csv" +CONFIG_PARTITION_TABLE_OFFSET=0x8000 +CONFIG_PARTITION_TABLE_MD5=y +# end of Partition Table + +# +# Compiler options +# +CONFIG_COMPILER_OPTIMIZATION_DEBUG=y +# CONFIG_COMPILER_OPTIMIZATION_SIZE is not set +# CONFIG_COMPILER_OPTIMIZATION_PERF is not set +# CONFIG_COMPILER_OPTIMIZATION_NONE is not set +CONFIG_COMPILER_OPTIMIZATION_ASSERTIONS_ENABLE=y +# CONFIG_COMPILER_OPTIMIZATION_ASSERTIONS_SILENT is not set +# CONFIG_COMPILER_OPTIMIZATION_ASSERTIONS_DISABLE is not set +CONFIG_COMPILER_FLOAT_LIB_FROM_GCCLIB=y +CONFIG_COMPILER_OPTIMIZATION_ASSERTION_LEVEL=2 +# CONFIG_COMPILER_OPTIMIZATION_CHECKS_SILENT is not set +CONFIG_COMPILER_HIDE_PATHS_MACROS=y +# CONFIG_COMPILER_CXX_EXCEPTIONS is not set +# CONFIG_COMPILER_CXX_RTTI is not set +# CONFIG_COMPILER_STACK_CHECK_MODE_NONE is not set +# CONFIG_COMPILER_STACK_CHECK_MODE_NORM is not set +CONFIG_COMPILER_STACK_CHECK_MODE_STRONG=y +# CONFIG_COMPILER_STACK_CHECK_MODE_ALL is not set +CONFIG_COMPILER_STACK_CHECK=y +# CONFIG_COMPILER_WARN_WRITE_STRINGS is not set +CONFIG_COMPILER_DISABLE_GCC12_WARNINGS=y +# CONFIG_COMPILER_DUMP_RTL_FILES is not set +CONFIG_COMPILER_RT_LIB_GCCLIB=y +CONFIG_COMPILER_RT_LIB_NAME="gcc" +# end of Compiler options + +# +# Component config +# + +# +# Application Level Tracing +# +# CONFIG_APPTRACE_DEST_JTAG is not set +CONFIG_APPTRACE_DEST_NONE=y +# CONFIG_APPTRACE_DEST_UART1 is not set +# CONFIG_APPTRACE_DEST_UART2 is not set +CONFIG_APPTRACE_DEST_UART_NONE=y +CONFIG_APPTRACE_UART_TASK_PRIO=1 +CONFIG_APPTRACE_LOCK_ENABLE=y +# end of Application Level Tracing + +# +# Bluetooth +# +# CONFIG_BT_ENABLED is not set +# end of Bluetooth + +# +# Driver Configurations +# + +# +# Legacy ADC Configuration +# +CONFIG_ADC_DISABLE_DAC=y +# CONFIG_ADC_SUPPRESS_DEPRECATE_WARN is not set + +# +# Legacy ADC Calibration Configuration +# +CONFIG_ADC_CAL_EFUSE_TP_ENABLE=y +CONFIG_ADC_CAL_EFUSE_VREF_ENABLE=y +CONFIG_ADC_CAL_LUT_ENABLE=y +# CONFIG_ADC_CALI_SUPPRESS_DEPRECATE_WARN is not set +# end of Legacy ADC Calibration Configuration +# end of Legacy ADC Configuration + +# +# SPI Configuration +# +# CONFIG_SPI_MASTER_IN_IRAM is not set +CONFIG_SPI_MASTER_ISR_IN_IRAM=y +# CONFIG_SPI_SLAVE_IN_IRAM is not set +CONFIG_SPI_SLAVE_ISR_IN_IRAM=y +# end of SPI Configuration + +# +# TWAI Configuration +# +# CONFIG_TWAI_ISR_IN_IRAM is not set +CONFIG_TWAI_ERRATA_FIX_BUS_OFF_REC=y +CONFIG_TWAI_ERRATA_FIX_TX_INTR_LOST=y +CONFIG_TWAI_ERRATA_FIX_RX_FRAME_INVALID=y +CONFIG_TWAI_ERRATA_FIX_RX_FIFO_CORRUPT=y +CONFIG_TWAI_ERRATA_FIX_LISTEN_ONLY_DOM=y +# end of TWAI Configuration + +# +# UART Configuration +# +# CONFIG_UART_ISR_IN_IRAM is not set +# end of UART Configuration + +# +# GPIO Configuration +# +# CONFIG_GPIO_ESP32_SUPPORT_SWITCH_SLP_PULL is not set +# CONFIG_GPIO_CTRL_FUNC_IN_IRAM is not set +# end of GPIO Configuration + +# +# Sigma Delta Modulator Configuration +# +# CONFIG_SDM_CTRL_FUNC_IN_IRAM is not set +# CONFIG_SDM_SUPPRESS_DEPRECATE_WARN is not set +# CONFIG_SDM_ENABLE_DEBUG_LOG is not set +# end of Sigma Delta Modulator Configuration + +# +# GPTimer Configuration +# +CONFIG_GPTIMER_ISR_HANDLER_IN_IRAM=y +# CONFIG_GPTIMER_CTRL_FUNC_IN_IRAM is not set +# CONFIG_GPTIMER_ISR_IRAM_SAFE is not set +# CONFIG_GPTIMER_SUPPRESS_DEPRECATE_WARN is not set +# CONFIG_GPTIMER_ENABLE_DEBUG_LOG is not set +# end of GPTimer Configuration + +# +# PCNT Configuration +# +# CONFIG_PCNT_CTRL_FUNC_IN_IRAM is not set +# CONFIG_PCNT_ISR_IRAM_SAFE is not set +# CONFIG_PCNT_SUPPRESS_DEPRECATE_WARN is not set +# CONFIG_PCNT_ENABLE_DEBUG_LOG is not set +# end of PCNT Configuration + +# +# RMT Configuration +# +# CONFIG_RMT_ISR_IRAM_SAFE is not set +# CONFIG_RMT_SUPPRESS_DEPRECATE_WARN is not set +# CONFIG_RMT_ENABLE_DEBUG_LOG is not set +# end of RMT Configuration + +# +# MCPWM Configuration +# +# CONFIG_MCPWM_ISR_IRAM_SAFE is not set +# CONFIG_MCPWM_CTRL_FUNC_IN_IRAM is not set +# CONFIG_MCPWM_SUPPRESS_DEPRECATE_WARN is not set +# CONFIG_MCPWM_ENABLE_DEBUG_LOG is not set +# end of MCPWM Configuration + +# +# I2S Configuration +# +# CONFIG_I2S_ISR_IRAM_SAFE is not set +# CONFIG_I2S_SUPPRESS_DEPRECATE_WARN is not set +# CONFIG_I2S_ENABLE_DEBUG_LOG is not set +# end of I2S Configuration + +# +# DAC Configuration +# +# CONFIG_DAC_CTRL_FUNC_IN_IRAM is not set +# CONFIG_DAC_ISR_IRAM_SAFE is not set +# CONFIG_DAC_SUPPRESS_DEPRECATE_WARN is not set +# CONFIG_DAC_ENABLE_DEBUG_LOG is not set +CONFIG_DAC_DMA_AUTO_16BIT_ALIGN=y +# end of DAC Configuration + +# +# LEDC Configuration +# +# CONFIG_LEDC_CTRL_FUNC_IN_IRAM is not set +# end of LEDC Configuration + +# +# I2C Configuration +# +# CONFIG_I2C_ISR_IRAM_SAFE is not set +# CONFIG_I2C_ENABLE_DEBUG_LOG is not set +# end of I2C Configuration +# end of Driver Configurations + +# +# eFuse Bit Manager +# +# CONFIG_EFUSE_CUSTOM_TABLE is not set +# CONFIG_EFUSE_VIRTUAL is not set +# CONFIG_EFUSE_CODE_SCHEME_COMPAT_NONE is not set +CONFIG_EFUSE_CODE_SCHEME_COMPAT_3_4=y +# CONFIG_EFUSE_CODE_SCHEME_COMPAT_REPEAT is not set +CONFIG_EFUSE_MAX_BLK_LEN=192 +# end of eFuse Bit Manager + +# +# ESP-TLS +# +CONFIG_ESP_TLS_USING_MBEDTLS=y +# CONFIG_ESP_TLS_USE_SECURE_ELEMENT is not set +# CONFIG_ESP_TLS_CLIENT_SESSION_TICKETS is not set +# CONFIG_ESP_TLS_SERVER is not set +# CONFIG_ESP_TLS_PSK_VERIFICATION is not set +# CONFIG_ESP_TLS_INSECURE is not set +# end of ESP-TLS + +# +# ADC and ADC Calibration +# +# CONFIG_ADC_ONESHOT_CTRL_FUNC_IN_IRAM is not set +# CONFIG_ADC_CONTINUOUS_ISR_IRAM_SAFE is not set + +# +# ADC Calibration Configurations +# +CONFIG_ADC_CALI_EFUSE_TP_ENABLE=y +CONFIG_ADC_CALI_EFUSE_VREF_ENABLE=y +CONFIG_ADC_CALI_LUT_ENABLE=y +# end of ADC Calibration Configurations + +CONFIG_ADC_DISABLE_DAC_OUTPUT=y +# end of ADC and ADC Calibration + +# +# Wireless Coexistence +# +# end of Wireless Coexistence + +# +# Common ESP-related +# +CONFIG_ESP_ERR_TO_NAME_LOOKUP=y +# end of Common ESP-related + +# +# Ethernet +# +CONFIG_ETH_ENABLED=y +CONFIG_ETH_USE_ESP32_EMAC=y +CONFIG_ETH_PHY_INTERFACE_RMII=y +CONFIG_ETH_RMII_CLK_INPUT=y +# CONFIG_ETH_RMII_CLK_OUTPUT is not set +CONFIG_ETH_RMII_CLK_IN_GPIO=0 +CONFIG_ETH_DMA_BUFFER_SIZE=512 +CONFIG_ETH_DMA_RX_BUFFER_NUM=10 +CONFIG_ETH_DMA_TX_BUFFER_NUM=10 +# CONFIG_ETH_IRAM_OPTIMIZATION is not set +CONFIG_ETH_USE_SPI_ETHERNET=y +# CONFIG_ETH_SPI_ETHERNET_DM9051 is not set +# CONFIG_ETH_SPI_ETHERNET_W5500 is not set +# CONFIG_ETH_SPI_ETHERNET_KSZ8851SNL is not set +CONFIG_ETH_USE_OPENETH=y +# CONFIG_ETH_TRANSMIT_MUTEX is not set +# end of Ethernet + +# +# Event Loop Library +# +# CONFIG_ESP_EVENT_LOOP_PROFILING is not set +CONFIG_ESP_EVENT_POST_FROM_ISR=y +CONFIG_ESP_EVENT_POST_FROM_IRAM_ISR=y +# end of Event Loop Library + +# +# GDB Stub +# +# CONFIG_ESP_SYSTEM_GDBSTUB_RUNTIME is not set +# end of GDB Stub + +# +# ESP HTTP client +# +# CONFIG_ESP_HTTP_CLIENT_ENABLE_HTTPS is not set +# CONFIG_ESP_HTTP_CLIENT_ENABLE_BASIC_AUTH is not set +# CONFIG_ESP_HTTP_CLIENT_ENABLE_DIGEST_AUTH is not set +# end of ESP HTTP client + +# +# HTTP Server +# +CONFIG_HTTPD_MAX_REQ_HDR_LEN=512 +CONFIG_HTTPD_MAX_URI_LEN=512 +CONFIG_HTTPD_ERR_RESP_NO_DELAY=y +CONFIG_HTTPD_PURGE_BUF_LEN=32 +# CONFIG_HTTPD_LOG_PURGE_DATA is not set +# CONFIG_HTTPD_WS_SUPPORT is not set +# CONFIG_HTTPD_QUEUE_WORK_BLOCKING is not set +# end of HTTP Server + +# +# ESP HTTPS OTA +# +# CONFIG_ESP_HTTPS_OTA_DECRYPT_CB is not set +# CONFIG_ESP_HTTPS_OTA_ALLOW_HTTP is not set +# end of ESP HTTPS OTA + +# +# ESP HTTPS server +# +# CONFIG_ESP_HTTPS_SERVER_ENABLE is not set +# end of ESP HTTPS server + +# +# Hardware Settings +# + +# +# Chip revision +# +CONFIG_ESP32_REV_MIN_0=y +# CONFIG_ESP32_REV_MIN_1 is not set +# CONFIG_ESP32_REV_MIN_1_1 is not set +# CONFIG_ESP32_REV_MIN_2 is not set +# CONFIG_ESP32_REV_MIN_3 is not set +# CONFIG_ESP32_REV_MIN_3_1 is not set +CONFIG_ESP32_REV_MIN=0 +CONFIG_ESP32_REV_MIN_FULL=0 +CONFIG_ESP_REV_MIN_FULL=0 + +# +# Maximum Supported ESP32 Revision (Rev v3.99) +# +CONFIG_ESP32_REV_MAX_FULL=399 +CONFIG_ESP_REV_MAX_FULL=399 +# end of Chip revision + +# +# MAC Config +# +CONFIG_ESP_MAC_ADDR_UNIVERSE_WIFI_STA=y +CONFIG_ESP_MAC_ADDR_UNIVERSE_WIFI_AP=y +CONFIG_ESP_MAC_ADDR_UNIVERSE_BT=y +CONFIG_ESP_MAC_ADDR_UNIVERSE_ETH=y +CONFIG_ESP_MAC_UNIVERSAL_MAC_ADDRESSES_FOUR=y +# CONFIG_ESP32_UNIVERSAL_MAC_ADDRESSES_TWO is not set +CONFIG_ESP32_UNIVERSAL_MAC_ADDRESSES_FOUR=y +CONFIG_ESP32_UNIVERSAL_MAC_ADDRESSES=4 +# CONFIG_ESP_MAC_IGNORE_MAC_CRC_ERROR is not set +# end of MAC Config + +# +# Sleep Config +# +CONFIG_ESP_SLEEP_FLASH_LEAKAGE_WORKAROUND=y +CONFIG_ESP_SLEEP_PSRAM_LEAKAGE_WORKAROUND=y +# CONFIG_ESP_SLEEP_MSPI_NEED_ALL_IO_PU is not set +CONFIG_ESP_SLEEP_RTC_BUS_ISO_WORKAROUND=y +# CONFIG_ESP_SLEEP_GPIO_RESET_WORKAROUND is not set +CONFIG_ESP_SLEEP_DEEP_SLEEP_WAKEUP_DELAY=2000 +# CONFIG_ESP_SLEEP_CACHE_SAFE_ASSERTION is not set +# CONFIG_ESP_SLEEP_DEBUG is not set +# end of Sleep Config + +# +# RTC Clock Config +# +CONFIG_RTC_CLK_SRC_INT_RC=y +# CONFIG_RTC_CLK_SRC_EXT_CRYS is not set +# CONFIG_RTC_CLK_SRC_EXT_OSC is not set +# CONFIG_RTC_CLK_SRC_INT_8MD256 is not set +CONFIG_RTC_CLK_CAL_CYCLES=1024 +# end of RTC Clock Config + +# +# Peripheral Control +# +CONFIG_PERIPH_CTRL_FUNC_IN_IRAM=y +# end of Peripheral Control + +# +# Main XTAL Config +# +# CONFIG_XTAL_FREQ_26 is not set +CONFIG_XTAL_FREQ_40=y +# CONFIG_XTAL_FREQ_AUTO is not set +CONFIG_XTAL_FREQ=40 +# end of Main XTAL Config +# end of Hardware Settings + +# +# LCD and Touch Panel +# + +# +# LCD Touch Drivers are maintained in the IDF Component Registry +# + +# +# LCD Peripheral Configuration +# +CONFIG_LCD_PANEL_IO_FORMAT_BUF_SIZE=32 +# CONFIG_LCD_ENABLE_DEBUG_LOG is not set +# end of LCD Peripheral Configuration +# end of LCD and Touch Panel + +# +# ESP NETIF Adapter +# +CONFIG_ESP_NETIF_IP_LOST_TIMER_INTERVAL=120 +CONFIG_ESP_NETIF_TCPIP_LWIP=y +# CONFIG_ESP_NETIF_LOOPBACK is not set +CONFIG_ESP_NETIF_USES_TCPIP_WITH_BSD_API=y +# CONFIG_ESP_NETIF_RECEIVE_REPORT_ERRORS is not set +# CONFIG_ESP_NETIF_L2_TAP is not set +# CONFIG_ESP_NETIF_BRIDGE_EN is not set +# end of ESP NETIF Adapter + +# +# Partition API Configuration +# +# end of Partition API Configuration + +# +# PHY +# +CONFIG_ESP_PHY_CALIBRATION_AND_DATA_STORAGE=y +# CONFIG_ESP_PHY_INIT_DATA_IN_PARTITION is not set +CONFIG_ESP_PHY_MAX_WIFI_TX_POWER=20 +CONFIG_ESP_PHY_MAX_TX_POWER=20 +# CONFIG_ESP_PHY_REDUCE_TX_POWER is not set +CONFIG_ESP_PHY_RF_CAL_PARTIAL=y +# CONFIG_ESP_PHY_RF_CAL_NONE is not set +# CONFIG_ESP_PHY_RF_CAL_FULL is not set +CONFIG_ESP_PHY_CALIBRATION_MODE=0 +# end of PHY + +# +# Power Management +# +# CONFIG_PM_ENABLE is not set +# end of Power Management + +# +# ESP PSRAM +# +CONFIG_SPIRAM=y + +# +# SPI RAM config +# +CONFIG_SPIRAM_MODE_QUAD=y +CONFIG_SPIRAM_TYPE_AUTO=y +# CONFIG_SPIRAM_TYPE_ESPPSRAM16 is not set +# CONFIG_SPIRAM_TYPE_ESPPSRAM32 is not set +# CONFIG_SPIRAM_TYPE_ESPPSRAM64 is not set +CONFIG_SPIRAM_SPEED_40M=y +CONFIG_SPIRAM_SPEED=40 +CONFIG_SPIRAM_BOOT_INIT=y +# CONFIG_SPIRAM_IGNORE_NOTFOUND is not set +# CONFIG_SPIRAM_USE_MEMMAP is not set +# CONFIG_SPIRAM_USE_CAPS_ALLOC is not set +CONFIG_SPIRAM_USE_MALLOC=y +CONFIG_SPIRAM_MEMTEST=y +CONFIG_SPIRAM_MALLOC_ALWAYSINTERNAL=16384 +# CONFIG_SPIRAM_TRY_ALLOCATE_WIFI_LWIP is not set +CONFIG_SPIRAM_MALLOC_RESERVE_INTERNAL=32768 +# CONFIG_SPIRAM_ALLOW_BSS_SEG_EXTERNAL_MEMORY is not set +# CONFIG_SPIRAM_ALLOW_NOINIT_SEG_EXTERNAL_MEMORY is not set +CONFIG_SPIRAM_CACHE_WORKAROUND=y + +# +# SPIRAM cache workaround debugging +# +CONFIG_SPIRAM_CACHE_WORKAROUND_STRATEGY_MEMW=y +# CONFIG_SPIRAM_CACHE_WORKAROUND_STRATEGY_DUPLDST is not set +# CONFIG_SPIRAM_CACHE_WORKAROUND_STRATEGY_NOPS is not set +# end of SPIRAM cache workaround debugging + +# +# SPIRAM workaround libraries placement +# +CONFIG_SPIRAM_CACHE_LIBJMP_IN_IRAM=y +CONFIG_SPIRAM_CACHE_LIBMATH_IN_IRAM=y +CONFIG_SPIRAM_CACHE_LIBNUMPARSER_IN_IRAM=y +CONFIG_SPIRAM_CACHE_LIBIO_IN_IRAM=y +CONFIG_SPIRAM_CACHE_LIBTIME_IN_IRAM=y +CONFIG_SPIRAM_CACHE_LIBCHAR_IN_IRAM=y +CONFIG_SPIRAM_CACHE_LIBMEM_IN_IRAM=y +CONFIG_SPIRAM_CACHE_LIBSTR_IN_IRAM=y +CONFIG_SPIRAM_CACHE_LIBRAND_IN_IRAM=y +CONFIG_SPIRAM_CACHE_LIBENV_IN_IRAM=y +CONFIG_SPIRAM_CACHE_LIBFILE_IN_IRAM=y +CONFIG_SPIRAM_CACHE_LIBMISC_IN_IRAM=y +# end of SPIRAM workaround libraries placement + +CONFIG_SPIRAM_BANKSWITCH_ENABLE=y +CONFIG_SPIRAM_BANKSWITCH_RESERVE=8 +# CONFIG_SPIRAM_ALLOW_STACK_EXTERNAL_MEMORY is not set + +# +# PSRAM clock and cs IO for ESP32-DOWD +# +CONFIG_D0WD_PSRAM_CLK_IO=17 +CONFIG_D0WD_PSRAM_CS_IO=16 +# end of PSRAM clock and cs IO for ESP32-DOWD + +# +# PSRAM clock and cs IO for ESP32-D2WD +# +CONFIG_D2WD_PSRAM_CLK_IO=9 +CONFIG_D2WD_PSRAM_CS_IO=10 +# end of PSRAM clock and cs IO for ESP32-D2WD + +# +# PSRAM clock and cs IO for ESP32-PICO-D4 +# +CONFIG_PICO_PSRAM_CS_IO=10 +# end of PSRAM clock and cs IO for ESP32-PICO-D4 + +# CONFIG_SPIRAM_CUSTOM_SPIWP_SD3_PIN is not set +CONFIG_SPIRAM_SPIWP_SD3_PIN=7 +# CONFIG_SPIRAM_2T_MODE is not set +# end of SPI RAM config +# end of ESP PSRAM + +# +# ESP Ringbuf +# +# CONFIG_RINGBUF_PLACE_FUNCTIONS_INTO_FLASH is not set +# end of ESP Ringbuf + +# +# ESP System Settings +# +# CONFIG_ESP_DEFAULT_CPU_FREQ_MHZ_80 is not set +CONFIG_ESP_DEFAULT_CPU_FREQ_MHZ_160=y +# CONFIG_ESP_DEFAULT_CPU_FREQ_MHZ_240 is not set +CONFIG_ESP_DEFAULT_CPU_FREQ_MHZ=160 + +# +# Memory +# +# CONFIG_ESP32_USE_FIXED_STATIC_RAM_SIZE is not set + +# +# Non-backward compatible options +# +# CONFIG_ESP_SYSTEM_ESP32_SRAM1_REGION_AS_IRAM is not set +# end of Non-backward compatible options +# end of Memory + +# +# Trace memory +# +# CONFIG_ESP32_TRAX is not set +CONFIG_ESP32_TRACEMEM_RESERVE_DRAM=0x0 +# end of Trace memory + +# CONFIG_ESP_SYSTEM_PANIC_PRINT_HALT is not set +CONFIG_ESP_SYSTEM_PANIC_PRINT_REBOOT=y +# CONFIG_ESP_SYSTEM_PANIC_SILENT_REBOOT is not set +# CONFIG_ESP_SYSTEM_PANIC_GDBSTUB is not set +CONFIG_ESP_SYSTEM_PANIC_REBOOT_DELAY_SECONDS=0 + +# +# Memory protection +# +# end of Memory protection + +CONFIG_ESP_SYSTEM_EVENT_QUEUE_SIZE=32 +CONFIG_ESP_SYSTEM_EVENT_TASK_STACK_SIZE=2304 +CONFIG_ESP_MAIN_TASK_STACK_SIZE=10000 +CONFIG_ESP_MAIN_TASK_AFFINITY_CPU0=y +# CONFIG_ESP_MAIN_TASK_AFFINITY_CPU1 is not set +# CONFIG_ESP_MAIN_TASK_AFFINITY_NO_AFFINITY is not set +CONFIG_ESP_MAIN_TASK_AFFINITY=0x0 +CONFIG_ESP_MINIMAL_SHARED_STACK_SIZE=2048 +CONFIG_ESP_CONSOLE_UART_DEFAULT=y +# CONFIG_ESP_CONSOLE_UART_CUSTOM is not set +# CONFIG_ESP_CONSOLE_NONE is not set +CONFIG_ESP_CONSOLE_UART=y +CONFIG_ESP_CONSOLE_MULTIPLE_UART=y +CONFIG_ESP_CONSOLE_UART_NUM=0 +CONFIG_ESP_CONSOLE_UART_BAUDRATE=115200 +CONFIG_ESP_INT_WDT=y +CONFIG_ESP_INT_WDT_TIMEOUT_MS=300 +CONFIG_ESP_INT_WDT_CHECK_CPU1=y +CONFIG_ESP_TASK_WDT_EN=y +CONFIG_ESP_TASK_WDT_INIT=y +# CONFIG_ESP_TASK_WDT_PANIC is not set +CONFIG_ESP_TASK_WDT_TIMEOUT_S=5 +CONFIG_ESP_TASK_WDT_CHECK_IDLE_TASK_CPU0=y +CONFIG_ESP_TASK_WDT_CHECK_IDLE_TASK_CPU1=y +# CONFIG_ESP_PANIC_HANDLER_IRAM is not set +# CONFIG_ESP_DEBUG_STUBS_ENABLE is not set +CONFIG_ESP_DEBUG_OCDAWARE=y +# CONFIG_ESP_SYSTEM_CHECK_INT_LEVEL_5 is not set +CONFIG_ESP_SYSTEM_CHECK_INT_LEVEL_4=y + +# +# Brownout Detector +# +CONFIG_ESP_BROWNOUT_DET=y +CONFIG_ESP_BROWNOUT_DET_LVL_SEL_0=y +# CONFIG_ESP_BROWNOUT_DET_LVL_SEL_1 is not set +# CONFIG_ESP_BROWNOUT_DET_LVL_SEL_2 is not set +# CONFIG_ESP_BROWNOUT_DET_LVL_SEL_3 is not set +# CONFIG_ESP_BROWNOUT_DET_LVL_SEL_4 is not set +# CONFIG_ESP_BROWNOUT_DET_LVL_SEL_5 is not set +# CONFIG_ESP_BROWNOUT_DET_LVL_SEL_6 is not set +# CONFIG_ESP_BROWNOUT_DET_LVL_SEL_7 is not set +CONFIG_ESP_BROWNOUT_DET_LVL=0 +# end of Brownout Detector + +# CONFIG_ESP32_DISABLE_BASIC_ROM_CONSOLE is not set +CONFIG_ESP32_ECO3_CACHE_LOCK_FIX=y +CONFIG_ESP_SYSTEM_BROWNOUT_INTR=y +# end of ESP System Settings + +# +# IPC (Inter-Processor Call) +# +CONFIG_ESP_IPC_TASK_STACK_SIZE=1024 +CONFIG_ESP_IPC_USES_CALLERS_PRIORITY=y +CONFIG_ESP_IPC_ISR_ENABLE=y +# end of IPC (Inter-Processor Call) + +# +# High resolution timer (esp_timer) +# +# CONFIG_ESP_TIMER_PROFILING is not set +CONFIG_ESP_TIME_FUNCS_USE_RTC_TIMER=y +CONFIG_ESP_TIME_FUNCS_USE_ESP_TIMER=y +CONFIG_ESP_TIMER_TASK_STACK_SIZE=3584 +CONFIG_ESP_TIMER_INTERRUPT_LEVEL=1 +# CONFIG_ESP_TIMER_SHOW_EXPERIMENTAL is not set +CONFIG_ESP_TIMER_TASK_AFFINITY=0x0 +CONFIG_ESP_TIMER_TASK_AFFINITY_CPU0=y +CONFIG_ESP_TIMER_ISR_AFFINITY=0x1 +CONFIG_ESP_TIMER_ISR_AFFINITY_CPU0=y +# CONFIG_ESP_TIMER_SUPPORTS_ISR_DISPATCH_METHOD is not set +CONFIG_ESP_TIMER_IMPL_TG0_LAC=y +# end of High resolution timer (esp_timer) + +# +# Wi-Fi +# +CONFIG_ESP_WIFI_ENABLED=y +CONFIG_ESP_WIFI_STATIC_RX_BUFFER_NUM=10 +CONFIG_ESP_WIFI_DYNAMIC_RX_BUFFER_NUM=32 +CONFIG_ESP_WIFI_STATIC_TX_BUFFER=y +CONFIG_ESP_WIFI_TX_BUFFER_TYPE=0 +CONFIG_ESP_WIFI_STATIC_TX_BUFFER_NUM=16 +CONFIG_ESP_WIFI_CACHE_TX_BUFFER_NUM=32 +# CONFIG_ESP_WIFI_CSI_ENABLED is not set +CONFIG_ESP_WIFI_AMPDU_TX_ENABLED=y +CONFIG_ESP_WIFI_TX_BA_WIN=6 +CONFIG_ESP_WIFI_AMPDU_RX_ENABLED=y +CONFIG_ESP_WIFI_RX_BA_WIN=6 +# CONFIG_ESP_WIFI_AMSDU_TX_ENABLED is not set +CONFIG_ESP_WIFI_NVS_ENABLED=y +CONFIG_ESP_WIFI_TASK_PINNED_TO_CORE_0=y +# CONFIG_ESP_WIFI_TASK_PINNED_TO_CORE_1 is not set +CONFIG_ESP_WIFI_SOFTAP_BEACON_MAX_LEN=752 +CONFIG_ESP_WIFI_MGMT_SBUF_NUM=32 +CONFIG_ESP_WIFI_IRAM_OPT=y +# CONFIG_ESP_WIFI_EXTRA_IRAM_OPT is not set +CONFIG_ESP_WIFI_RX_IRAM_OPT=y +CONFIG_ESP_WIFI_ENABLE_WPA3_SAE=y +CONFIG_ESP_WIFI_ENABLE_SAE_PK=y +CONFIG_ESP_WIFI_SOFTAP_SAE_SUPPORT=y +CONFIG_ESP_WIFI_ENABLE_WPA3_OWE_STA=y +# CONFIG_ESP_WIFI_SLP_IRAM_OPT is not set +CONFIG_ESP_WIFI_STA_DISCONNECTED_PM_ENABLE=y +# CONFIG_ESP_WIFI_GMAC_SUPPORT is not set +CONFIG_ESP_WIFI_SOFTAP_SUPPORT=y +# CONFIG_ESP_WIFI_SLP_BEACON_LOST_OPT is not set +CONFIG_ESP_WIFI_ESPNOW_MAX_ENCRYPT_NUM=7 +# CONFIG_ESP_WIFI_NAN_ENABLE is not set +CONFIG_ESP_WIFI_MBEDTLS_CRYPTO=y +CONFIG_ESP_WIFI_MBEDTLS_TLS_CLIENT=y +# CONFIG_ESP_WIFI_WAPI_PSK is not set +# CONFIG_ESP_WIFI_SUITE_B_192 is not set +# CONFIG_ESP_WIFI_11KV_SUPPORT is not set +# CONFIG_ESP_WIFI_MBO_SUPPORT is not set +# CONFIG_ESP_WIFI_DPP_SUPPORT is not set +# CONFIG_ESP_WIFI_11R_SUPPORT is not set +# CONFIG_ESP_WIFI_WPS_SOFTAP_REGISTRAR is not set + +# +# WPS Configuration Options +# +# CONFIG_ESP_WIFI_WPS_STRICT is not set +# CONFIG_ESP_WIFI_WPS_PASSPHRASE is not set +# end of WPS Configuration Options + +# CONFIG_ESP_WIFI_DEBUG_PRINT is not set +# CONFIG_ESP_WIFI_TESTING_OPTIONS is not set +# end of Wi-Fi + +# +# Core dump +# +# CONFIG_ESP_COREDUMP_ENABLE_TO_FLASH is not set +# CONFIG_ESP_COREDUMP_ENABLE_TO_UART is not set +CONFIG_ESP_COREDUMP_ENABLE_TO_NONE=y +# end of Core dump + +# +# FAT Filesystem support +# +CONFIG_FATFS_VOLUME_COUNT=2 +CONFIG_FATFS_LFN_NONE=y +# CONFIG_FATFS_LFN_HEAP is not set +# CONFIG_FATFS_LFN_STACK is not set +# CONFIG_FATFS_SECTOR_512 is not set +CONFIG_FATFS_SECTOR_4096=y +# CONFIG_FATFS_CODEPAGE_DYNAMIC is not set +CONFIG_FATFS_CODEPAGE_437=y +# CONFIG_FATFS_CODEPAGE_720 is not set +# CONFIG_FATFS_CODEPAGE_737 is not set +# CONFIG_FATFS_CODEPAGE_771 is not set +# CONFIG_FATFS_CODEPAGE_775 is not set +# CONFIG_FATFS_CODEPAGE_850 is not set +# CONFIG_FATFS_CODEPAGE_852 is not set +# CONFIG_FATFS_CODEPAGE_855 is not set +# CONFIG_FATFS_CODEPAGE_857 is not set +# CONFIG_FATFS_CODEPAGE_860 is not set +# CONFIG_FATFS_CODEPAGE_861 is not set +# CONFIG_FATFS_CODEPAGE_862 is not set +# CONFIG_FATFS_CODEPAGE_863 is not set +# CONFIG_FATFS_CODEPAGE_864 is not set +# CONFIG_FATFS_CODEPAGE_865 is not set +# CONFIG_FATFS_CODEPAGE_866 is not set +# CONFIG_FATFS_CODEPAGE_869 is not set +# CONFIG_FATFS_CODEPAGE_932 is not set +# CONFIG_FATFS_CODEPAGE_936 is not set +# CONFIG_FATFS_CODEPAGE_949 is not set +# CONFIG_FATFS_CODEPAGE_950 is not set +CONFIG_FATFS_CODEPAGE=437 +CONFIG_FATFS_FS_LOCK=0 +CONFIG_FATFS_TIMEOUT_MS=10000 +CONFIG_FATFS_PER_FILE_CACHE=y +CONFIG_FATFS_ALLOC_PREFER_EXTRAM=y +# CONFIG_FATFS_USE_FASTSEEK is not set +CONFIG_FATFS_VFS_FSTAT_BLKSIZE=0 +# end of FAT Filesystem support + +# +# FreeRTOS +# + +# +# Kernel +# +# CONFIG_FREERTOS_SMP is not set +# CONFIG_FREERTOS_UNICORE is not set +CONFIG_FREERTOS_HZ=100 +# CONFIG_FREERTOS_CHECK_STACKOVERFLOW_NONE is not set +# CONFIG_FREERTOS_CHECK_STACKOVERFLOW_PTRVAL is not set +CONFIG_FREERTOS_CHECK_STACKOVERFLOW_CANARY=y +CONFIG_FREERTOS_THREAD_LOCAL_STORAGE_POINTERS=1 +CONFIG_FREERTOS_IDLE_TASK_STACKSIZE=1536 +# CONFIG_FREERTOS_USE_IDLE_HOOK is not set +# CONFIG_FREERTOS_USE_TICK_HOOK is not set +CONFIG_FREERTOS_MAX_TASK_NAME_LEN=16 +# CONFIG_FREERTOS_ENABLE_BACKWARD_COMPATIBILITY is not set +CONFIG_FREERTOS_TIMER_TASK_PRIORITY=1 +CONFIG_FREERTOS_TIMER_TASK_STACK_DEPTH=2048 +CONFIG_FREERTOS_TIMER_QUEUE_LENGTH=10 +CONFIG_FREERTOS_QUEUE_REGISTRY_SIZE=0 +CONFIG_FREERTOS_TASK_NOTIFICATION_ARRAY_ENTRIES=1 +# CONFIG_FREERTOS_USE_TRACE_FACILITY is not set +# CONFIG_FREERTOS_GENERATE_RUN_TIME_STATS is not set +# end of Kernel + +# +# Port +# +CONFIG_FREERTOS_TASK_FUNCTION_WRAPPER=y +# CONFIG_FREERTOS_WATCHPOINT_END_OF_STACK is not set +CONFIG_FREERTOS_TLSP_DELETION_CALLBACKS=y +# CONFIG_FREERTOS_TASK_PRE_DELETION_HOOK is not set +# CONFIG_FREERTOS_ENABLE_STATIC_TASK_CLEAN_UP is not set +CONFIG_FREERTOS_CHECK_MUTEX_GIVEN_BY_OWNER=y +CONFIG_FREERTOS_ISR_STACKSIZE=1536 +CONFIG_FREERTOS_INTERRUPT_BACKTRACE=y +# CONFIG_FREERTOS_FPU_IN_ISR is not set +CONFIG_FREERTOS_TICK_SUPPORT_CORETIMER=y +CONFIG_FREERTOS_CORETIMER_0=y +# CONFIG_FREERTOS_CORETIMER_1 is not set +CONFIG_FREERTOS_SYSTICK_USES_CCOUNT=y +# CONFIG_FREERTOS_PLACE_FUNCTIONS_INTO_FLASH is not set +# CONFIG_FREERTOS_PLACE_SNAPSHOT_FUNS_INTO_FLASH is not set +# CONFIG_FREERTOS_CHECK_PORT_CRITICAL_COMPLIANCE is not set +# end of Port + +CONFIG_FREERTOS_PORT=y +CONFIG_FREERTOS_NO_AFFINITY=0x7FFFFFFF +CONFIG_FREERTOS_SUPPORT_STATIC_ALLOCATION=y +CONFIG_FREERTOS_DEBUG_OCDAWARE=y +CONFIG_FREERTOS_ENABLE_TASK_SNAPSHOT=y +# end of FreeRTOS + +# +# Hardware Abstraction Layer (HAL) and Low Level (LL) +# +CONFIG_HAL_ASSERTION_EQUALS_SYSTEM=y +# CONFIG_HAL_ASSERTION_DISABLE is not set +# CONFIG_HAL_ASSERTION_SILENT is not set +# CONFIG_HAL_ASSERTION_ENABLE is not set +CONFIG_HAL_DEFAULT_ASSERTION_LEVEL=2 +CONFIG_HAL_SPI_MASTER_FUNC_IN_IRAM=y +CONFIG_HAL_SPI_SLAVE_FUNC_IN_IRAM=y +# end of Hardware Abstraction Layer (HAL) and Low Level (LL) + +# +# Heap memory debugging +# +CONFIG_HEAP_POISONING_DISABLED=y +# CONFIG_HEAP_POISONING_LIGHT is not set +# CONFIG_HEAP_POISONING_COMPREHENSIVE is not set +CONFIG_HEAP_TRACING_OFF=y +# CONFIG_HEAP_TRACING_STANDALONE is not set +# CONFIG_HEAP_TRACING_TOHOST is not set +# CONFIG_HEAP_USE_HOOKS is not set +# CONFIG_HEAP_ABORT_WHEN_ALLOCATION_FAILS is not set +# CONFIG_HEAP_PLACE_FUNCTION_INTO_FLASH is not set +# end of Heap memory debugging + +CONFIG_IEEE802154_CCA_THRESHOLD=-60 +CONFIG_IEEE802154_PENDING_TABLE_SIZE=20 + +# +# Log output +# +# CONFIG_LOG_DEFAULT_LEVEL_NONE is not set +# CONFIG_LOG_DEFAULT_LEVEL_ERROR is not set +# CONFIG_LOG_DEFAULT_LEVEL_WARN is not set +CONFIG_LOG_DEFAULT_LEVEL_INFO=y +# CONFIG_LOG_DEFAULT_LEVEL_DEBUG is not set +# CONFIG_LOG_DEFAULT_LEVEL_VERBOSE is not set +CONFIG_LOG_DEFAULT_LEVEL=3 +CONFIG_LOG_MAXIMUM_EQUALS_DEFAULT=y +# CONFIG_LOG_MAXIMUM_LEVEL_DEBUG is not set +# CONFIG_LOG_MAXIMUM_LEVEL_VERBOSE is not set +CONFIG_LOG_MAXIMUM_LEVEL=3 +# CONFIG_LOG_MASTER_LEVEL is not set +CONFIG_LOG_COLORS=y +CONFIG_LOG_TIMESTAMP_SOURCE_RTOS=y +# CONFIG_LOG_TIMESTAMP_SOURCE_SYSTEM is not set +# end of Log output + +# +# LWIP +# +CONFIG_LWIP_LOCAL_HOSTNAME="espressif" +# CONFIG_LWIP_NETIF_API is not set +CONFIG_LWIP_TCPIP_TASK_PRIO=18 +# CONFIG_LWIP_TCPIP_CORE_LOCKING is not set +# CONFIG_LWIP_CHECK_THREAD_SAFETY is not set +CONFIG_LWIP_DNS_SUPPORT_MDNS_QUERIES=y +# CONFIG_LWIP_L2_TO_L3_COPY is not set +# CONFIG_LWIP_IRAM_OPTIMIZATION is not set +# CONFIG_LWIP_EXTRA_IRAM_OPTIMIZATION is not set +CONFIG_LWIP_TIMERS_ONDEMAND=y +CONFIG_LWIP_ND6=y +CONFIG_LWIP_MAX_SOCKETS=10 +# CONFIG_LWIP_USE_ONLY_LWIP_SELECT is not set +# CONFIG_LWIP_SO_LINGER is not set +CONFIG_LWIP_SO_REUSE=y +CONFIG_LWIP_SO_REUSE_RXTOALL=y +# CONFIG_LWIP_SO_RCVBUF is not set +# CONFIG_LWIP_NETBUF_RECVINFO is not set +CONFIG_LWIP_IP4_FRAG=y +CONFIG_LWIP_IP6_FRAG=y +# CONFIG_LWIP_IP4_REASSEMBLY is not set +# CONFIG_LWIP_IP6_REASSEMBLY is not set +CONFIG_LWIP_IP_REASS_MAX_PBUFS=10 +# CONFIG_LWIP_IP_FORWARD is not set +# CONFIG_LWIP_STATS is not set +CONFIG_LWIP_ESP_GRATUITOUS_ARP=y +CONFIG_LWIP_GARP_TMR_INTERVAL=60 +CONFIG_LWIP_ESP_MLDV6_REPORT=y +CONFIG_LWIP_MLDV6_TMR_INTERVAL=40 +CONFIG_LWIP_TCPIP_RECVMBOX_SIZE=32 +CONFIG_LWIP_DHCP_DOES_ARP_CHECK=y +# CONFIG_LWIP_DHCP_DISABLE_CLIENT_ID is not set +CONFIG_LWIP_DHCP_DISABLE_VENDOR_CLASS_ID=y +# CONFIG_LWIP_DHCP_RESTORE_LAST_IP is not set +CONFIG_LWIP_DHCP_OPTIONS_LEN=68 +CONFIG_LWIP_NUM_NETIF_CLIENT_DATA=0 +CONFIG_LWIP_DHCP_COARSE_TIMER_SECS=1 + +# +# DHCP server +# +CONFIG_LWIP_DHCPS=y +CONFIG_LWIP_DHCPS_LEASE_UNIT=60 +CONFIG_LWIP_DHCPS_MAX_STATION_NUM=8 +# end of DHCP server + +# CONFIG_LWIP_AUTOIP is not set +CONFIG_LWIP_IPV4=y +CONFIG_LWIP_IPV6=y +# CONFIG_LWIP_IPV6_AUTOCONFIG is not set +CONFIG_LWIP_IPV6_NUM_ADDRESSES=3 +# CONFIG_LWIP_IPV6_FORWARD is not set +# CONFIG_LWIP_NETIF_STATUS_CALLBACK is not set +CONFIG_LWIP_NETIF_LOOPBACK=y +CONFIG_LWIP_LOOPBACK_MAX_PBUFS=8 + +# +# TCP +# +CONFIG_LWIP_MAX_ACTIVE_TCP=16 +CONFIG_LWIP_MAX_LISTENING_TCP=16 +CONFIG_LWIP_TCP_HIGH_SPEED_RETRANSMISSION=y +CONFIG_LWIP_TCP_MAXRTX=12 +CONFIG_LWIP_TCP_SYNMAXRTX=12 +CONFIG_LWIP_TCP_MSS=1440 +CONFIG_LWIP_TCP_TMR_INTERVAL=250 +CONFIG_LWIP_TCP_MSL=60000 +CONFIG_LWIP_TCP_FIN_WAIT_TIMEOUT=20000 +CONFIG_LWIP_TCP_SND_BUF_DEFAULT=5744 +CONFIG_LWIP_TCP_WND_DEFAULT=5744 +CONFIG_LWIP_TCP_RECVMBOX_SIZE=6 +CONFIG_LWIP_TCP_QUEUE_OOSEQ=y +# CONFIG_LWIP_TCP_SACK_OUT is not set +CONFIG_LWIP_TCP_OVERSIZE_MSS=y +# CONFIG_LWIP_TCP_OVERSIZE_QUARTER_MSS is not set +# CONFIG_LWIP_TCP_OVERSIZE_DISABLE is not set +CONFIG_LWIP_TCP_RTO_TIME=1500 +# end of TCP + +# +# UDP +# +CONFIG_LWIP_MAX_UDP_PCBS=16 +CONFIG_LWIP_UDP_RECVMBOX_SIZE=6 +# end of UDP + +# +# Checksums +# +# CONFIG_LWIP_CHECKSUM_CHECK_IP is not set +# CONFIG_LWIP_CHECKSUM_CHECK_UDP is not set +CONFIG_LWIP_CHECKSUM_CHECK_ICMP=y +# end of Checksums + +CONFIG_LWIP_TCPIP_TASK_STACK_SIZE=3072 +CONFIG_LWIP_TCPIP_TASK_AFFINITY_NO_AFFINITY=y +# CONFIG_LWIP_TCPIP_TASK_AFFINITY_CPU0 is not set +# CONFIG_LWIP_TCPIP_TASK_AFFINITY_CPU1 is not set +CONFIG_LWIP_TCPIP_TASK_AFFINITY=0x7FFFFFFF +# CONFIG_LWIP_PPP_SUPPORT is not set +CONFIG_LWIP_IPV6_MEMP_NUM_ND6_QUEUE=3 +CONFIG_LWIP_IPV6_ND6_NUM_NEIGHBORS=5 +# CONFIG_LWIP_SLIP_SUPPORT is not set + +# +# ICMP +# +CONFIG_LWIP_ICMP=y +# CONFIG_LWIP_MULTICAST_PING is not set +# CONFIG_LWIP_BROADCAST_PING is not set +# end of ICMP + +# +# LWIP RAW API +# +CONFIG_LWIP_MAX_RAW_PCBS=16 +# end of LWIP RAW API + +# +# SNTP +# +CONFIG_LWIP_SNTP_MAX_SERVERS=1 +# CONFIG_LWIP_DHCP_GET_NTP_SRV is not set +CONFIG_LWIP_SNTP_UPDATE_DELAY=3600000 +# end of SNTP + +CONFIG_LWIP_BRIDGEIF_MAX_PORTS=7 +CONFIG_LWIP_ESP_LWIP_ASSERT=y + +# +# Hooks +# +# CONFIG_LWIP_HOOK_TCP_ISN_NONE is not set +CONFIG_LWIP_HOOK_TCP_ISN_DEFAULT=y +# CONFIG_LWIP_HOOK_TCP_ISN_CUSTOM is not set +CONFIG_LWIP_HOOK_IP6_ROUTE_NONE=y +# CONFIG_LWIP_HOOK_IP6_ROUTE_DEFAULT is not set +# CONFIG_LWIP_HOOK_IP6_ROUTE_CUSTOM is not set +CONFIG_LWIP_HOOK_ND6_GET_GW_NONE=y +# CONFIG_LWIP_HOOK_ND6_GET_GW_DEFAULT is not set +# CONFIG_LWIP_HOOK_ND6_GET_GW_CUSTOM is not set +CONFIG_LWIP_HOOK_IP6_SELECT_SRC_ADDR_NONE=y +# CONFIG_LWIP_HOOK_IP6_SELECT_SRC_ADDR_DEFAULT is not set +# CONFIG_LWIP_HOOK_IP6_SELECT_SRC_ADDR_CUSTOM is not set +CONFIG_LWIP_HOOK_NETCONN_EXT_RESOLVE_NONE=y +# CONFIG_LWIP_HOOK_NETCONN_EXT_RESOLVE_DEFAULT is not set +# CONFIG_LWIP_HOOK_NETCONN_EXT_RESOLVE_CUSTOM is not set +CONFIG_LWIP_HOOK_IP6_INPUT_NONE=y +# CONFIG_LWIP_HOOK_IP6_INPUT_DEFAULT is not set +# CONFIG_LWIP_HOOK_IP6_INPUT_CUSTOM is not set +# end of Hooks + +# CONFIG_LWIP_DEBUG is not set +# end of LWIP + +# +# mbedTLS +# +CONFIG_MBEDTLS_INTERNAL_MEM_ALLOC=y +# CONFIG_MBEDTLS_EXTERNAL_MEM_ALLOC is not set +# CONFIG_MBEDTLS_DEFAULT_MEM_ALLOC is not set +# CONFIG_MBEDTLS_CUSTOM_MEM_ALLOC is not set +CONFIG_MBEDTLS_ASYMMETRIC_CONTENT_LEN=y +CONFIG_MBEDTLS_SSL_IN_CONTENT_LEN=16384 +CONFIG_MBEDTLS_SSL_OUT_CONTENT_LEN=4096 +# CONFIG_MBEDTLS_DYNAMIC_BUFFER is not set +# CONFIG_MBEDTLS_DEBUG is not set + +# +# mbedTLS v3.x related +# +# CONFIG_MBEDTLS_SSL_PROTO_TLS1_3 is not set +# CONFIG_MBEDTLS_SSL_VARIABLE_BUFFER_LENGTH is not set +# CONFIG_MBEDTLS_X509_TRUSTED_CERT_CALLBACK is not set +# CONFIG_MBEDTLS_SSL_CONTEXT_SERIALIZATION is not set +CONFIG_MBEDTLS_SSL_KEEP_PEER_CERTIFICATE=y +CONFIG_MBEDTLS_PKCS7_C=y +# end of mbedTLS v3.x related + +# +# Certificate Bundle +# +CONFIG_MBEDTLS_CERTIFICATE_BUNDLE=y +CONFIG_MBEDTLS_CERTIFICATE_BUNDLE_DEFAULT_FULL=y +# CONFIG_MBEDTLS_CERTIFICATE_BUNDLE_DEFAULT_CMN is not set +# CONFIG_MBEDTLS_CERTIFICATE_BUNDLE_DEFAULT_NONE is not set +# CONFIG_MBEDTLS_CUSTOM_CERTIFICATE_BUNDLE is not set +CONFIG_MBEDTLS_CERTIFICATE_BUNDLE_MAX_CERTS=200 +# end of Certificate Bundle + +# CONFIG_MBEDTLS_ECP_RESTARTABLE is not set +# CONFIG_MBEDTLS_CMAC_C is not set +CONFIG_MBEDTLS_HARDWARE_AES=y +CONFIG_MBEDTLS_HARDWARE_MPI=y +CONFIG_MBEDTLS_HARDWARE_SHA=y +CONFIG_MBEDTLS_ROM_MD5=y +# CONFIG_MBEDTLS_ATCA_HW_ECDSA_SIGN is not set +# CONFIG_MBEDTLS_ATCA_HW_ECDSA_VERIFY is not set +CONFIG_MBEDTLS_HAVE_TIME=y +# CONFIG_MBEDTLS_PLATFORM_TIME_ALT is not set +# CONFIG_MBEDTLS_HAVE_TIME_DATE is not set +CONFIG_MBEDTLS_ECDSA_DETERMINISTIC=y +CONFIG_MBEDTLS_SHA512_C=y +CONFIG_MBEDTLS_TLS_SERVER_AND_CLIENT=y +# CONFIG_MBEDTLS_TLS_SERVER_ONLY is not set +# CONFIG_MBEDTLS_TLS_CLIENT_ONLY is not set +# CONFIG_MBEDTLS_TLS_DISABLED is not set +CONFIG_MBEDTLS_TLS_SERVER=y +CONFIG_MBEDTLS_TLS_CLIENT=y +CONFIG_MBEDTLS_TLS_ENABLED=y + +# +# TLS Key Exchange Methods +# +# CONFIG_MBEDTLS_PSK_MODES is not set +CONFIG_MBEDTLS_KEY_EXCHANGE_RSA=y +CONFIG_MBEDTLS_KEY_EXCHANGE_ELLIPTIC_CURVE=y +CONFIG_MBEDTLS_KEY_EXCHANGE_ECDHE_RSA=y +CONFIG_MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA=y +CONFIG_MBEDTLS_KEY_EXCHANGE_ECDH_ECDSA=y +CONFIG_MBEDTLS_KEY_EXCHANGE_ECDH_RSA=y +# end of TLS Key Exchange Methods + +CONFIG_MBEDTLS_SSL_RENEGOTIATION=y +CONFIG_MBEDTLS_SSL_PROTO_TLS1_2=y +# CONFIG_MBEDTLS_SSL_PROTO_GMTSSL1_1 is not set +# CONFIG_MBEDTLS_SSL_PROTO_DTLS is not set +CONFIG_MBEDTLS_SSL_ALPN=y +CONFIG_MBEDTLS_CLIENT_SSL_SESSION_TICKETS=y +CONFIG_MBEDTLS_SERVER_SSL_SESSION_TICKETS=y + +# +# Symmetric Ciphers +# +CONFIG_MBEDTLS_AES_C=y +# CONFIG_MBEDTLS_CAMELLIA_C is not set +# CONFIG_MBEDTLS_DES_C is not set +# CONFIG_MBEDTLS_BLOWFISH_C is not set +# CONFIG_MBEDTLS_XTEA_C is not set +CONFIG_MBEDTLS_CCM_C=y +CONFIG_MBEDTLS_GCM_C=y +# CONFIG_MBEDTLS_NIST_KW_C is not set +# end of Symmetric Ciphers + +# CONFIG_MBEDTLS_RIPEMD160_C is not set + +# +# Certificates +# +CONFIG_MBEDTLS_PEM_PARSE_C=y +CONFIG_MBEDTLS_PEM_WRITE_C=y +CONFIG_MBEDTLS_X509_CRL_PARSE_C=y +CONFIG_MBEDTLS_X509_CSR_PARSE_C=y +# end of Certificates + +CONFIG_MBEDTLS_ECP_C=y +# CONFIG_MBEDTLS_DHM_C is not set +CONFIG_MBEDTLS_ECDH_C=y +CONFIG_MBEDTLS_ECDSA_C=y +# CONFIG_MBEDTLS_ECJPAKE_C is not set +CONFIG_MBEDTLS_ECP_DP_SECP192R1_ENABLED=y +CONFIG_MBEDTLS_ECP_DP_SECP224R1_ENABLED=y +CONFIG_MBEDTLS_ECP_DP_SECP256R1_ENABLED=y +CONFIG_MBEDTLS_ECP_DP_SECP384R1_ENABLED=y +CONFIG_MBEDTLS_ECP_DP_SECP521R1_ENABLED=y +CONFIG_MBEDTLS_ECP_DP_SECP192K1_ENABLED=y +CONFIG_MBEDTLS_ECP_DP_SECP224K1_ENABLED=y +CONFIG_MBEDTLS_ECP_DP_SECP256K1_ENABLED=y +CONFIG_MBEDTLS_ECP_DP_BP256R1_ENABLED=y +CONFIG_MBEDTLS_ECP_DP_BP384R1_ENABLED=y +CONFIG_MBEDTLS_ECP_DP_BP512R1_ENABLED=y +CONFIG_MBEDTLS_ECP_DP_CURVE25519_ENABLED=y +CONFIG_MBEDTLS_ECP_NIST_OPTIM=y +CONFIG_MBEDTLS_ECP_FIXED_POINT_OPTIM=y +# CONFIG_MBEDTLS_POLY1305_C is not set +# CONFIG_MBEDTLS_CHACHA20_C is not set +# CONFIG_MBEDTLS_HKDF_C is not set +# CONFIG_MBEDTLS_THREADING_C is not set +# CONFIG_MBEDTLS_LARGE_KEY_SOFTWARE_MPI is not set +# CONFIG_MBEDTLS_SECURITY_RISKS is not set +# end of mbedTLS + +# +# ESP-MQTT Configurations +# +CONFIG_MQTT_PROTOCOL_311=y +# CONFIG_MQTT_PROTOCOL_5 is not set +CONFIG_MQTT_TRANSPORT_SSL=y +CONFIG_MQTT_TRANSPORT_WEBSOCKET=y +CONFIG_MQTT_TRANSPORT_WEBSOCKET_SECURE=y +# CONFIG_MQTT_MSG_ID_INCREMENTAL is not set +# CONFIG_MQTT_SKIP_PUBLISH_IF_DISCONNECTED is not set +# CONFIG_MQTT_REPORT_DELETED_MESSAGES is not set +# CONFIG_MQTT_USE_CUSTOM_CONFIG is not set +# CONFIG_MQTT_TASK_CORE_SELECTION_ENABLED is not set +# CONFIG_MQTT_CUSTOM_OUTBOX is not set +# end of ESP-MQTT Configurations + +# +# Newlib +# +CONFIG_NEWLIB_STDOUT_LINE_ENDING_CRLF=y +# CONFIG_NEWLIB_STDOUT_LINE_ENDING_LF is not set +# CONFIG_NEWLIB_STDOUT_LINE_ENDING_CR is not set +# CONFIG_NEWLIB_STDIN_LINE_ENDING_CRLF is not set +# CONFIG_NEWLIB_STDIN_LINE_ENDING_LF is not set +CONFIG_NEWLIB_STDIN_LINE_ENDING_CR=y +# CONFIG_NEWLIB_NANO_FORMAT is not set +CONFIG_NEWLIB_TIME_SYSCALL_USE_RTC_HRT=y +# CONFIG_NEWLIB_TIME_SYSCALL_USE_RTC is not set +# CONFIG_NEWLIB_TIME_SYSCALL_USE_HRT is not set +# CONFIG_NEWLIB_TIME_SYSCALL_USE_NONE is not set +# end of Newlib + +# +# NVS +# +# CONFIG_NVS_ASSERT_ERROR_CHECK is not set +# end of NVS + +# +# OpenThread +# +# CONFIG_OPENTHREAD_ENABLED is not set + +# +# Thread Operational Dataset +# +CONFIG_OPENTHREAD_NETWORK_NAME="OpenThread-ESP" +CONFIG_OPENTHREAD_MESH_LOCAL_PREFIX="fd00:db8:a0:0::/64" +CONFIG_OPENTHREAD_NETWORK_CHANNEL=15 +CONFIG_OPENTHREAD_NETWORK_PANID=0x1234 +CONFIG_OPENTHREAD_NETWORK_EXTPANID="dead00beef00cafe" +CONFIG_OPENTHREAD_NETWORK_MASTERKEY="00112233445566778899aabbccddeeff" +CONFIG_OPENTHREAD_NETWORK_PSKC="104810e2315100afd6bc9215a6bfac53" +# end of Thread Operational Dataset +# end of OpenThread + +# +# Protocomm +# +CONFIG_ESP_PROTOCOMM_SUPPORT_SECURITY_VERSION_0=y +CONFIG_ESP_PROTOCOMM_SUPPORT_SECURITY_VERSION_1=y +CONFIG_ESP_PROTOCOMM_SUPPORT_SECURITY_VERSION_2=y +# end of Protocomm + +# +# PThreads +# +CONFIG_PTHREAD_TASK_PRIO_DEFAULT=5 +CONFIG_PTHREAD_TASK_STACK_SIZE_DEFAULT=3072 +CONFIG_PTHREAD_STACK_MIN=768 +CONFIG_PTHREAD_DEFAULT_CORE_NO_AFFINITY=y +# CONFIG_PTHREAD_DEFAULT_CORE_0 is not set +# CONFIG_PTHREAD_DEFAULT_CORE_1 is not set +CONFIG_PTHREAD_TASK_CORE_DEFAULT=-1 +CONFIG_PTHREAD_TASK_NAME_DEFAULT="pthread" +# end of PThreads + +# +# MMU Config +# +CONFIG_MMU_PAGE_SIZE_64KB=y +CONFIG_MMU_PAGE_MODE="64KB" +CONFIG_MMU_PAGE_SIZE=0x10000 +# end of MMU Config + +# +# SPI Flash driver +# +# CONFIG_SPI_FLASH_VERIFY_WRITE is not set +# CONFIG_SPI_FLASH_ENABLE_COUNTERS is not set +CONFIG_SPI_FLASH_ROM_DRIVER_PATCH=y +CONFIG_SPI_FLASH_DANGEROUS_WRITE_ABORTS=y +# CONFIG_SPI_FLASH_DANGEROUS_WRITE_FAILS is not set +# CONFIG_SPI_FLASH_DANGEROUS_WRITE_ALLOWED is not set +# CONFIG_SPI_FLASH_SHARE_SPI1_BUS is not set +# CONFIG_SPI_FLASH_BYPASS_BLOCK_ERASE is not set +CONFIG_SPI_FLASH_YIELD_DURING_ERASE=y +CONFIG_SPI_FLASH_ERASE_YIELD_DURATION_MS=20 +CONFIG_SPI_FLASH_ERASE_YIELD_TICKS=1 +CONFIG_SPI_FLASH_WRITE_CHUNK_SIZE=8192 +# CONFIG_SPI_FLASH_SIZE_OVERRIDE is not set +# CONFIG_SPI_FLASH_CHECK_ERASE_TIMEOUT_DISABLED is not set +# CONFIG_SPI_FLASH_OVERRIDE_CHIP_DRIVER_LIST is not set + +# +# SPI Flash behavior when brownout +# +CONFIG_SPI_FLASH_BROWNOUT_RESET_XMC=y +CONFIG_SPI_FLASH_BROWNOUT_RESET=y +# end of SPI Flash behavior when brownout + +# +# Auto-detect flash chips +# +CONFIG_SPI_FLASH_VENDOR_XMC_SUPPORTED=y +CONFIG_SPI_FLASH_VENDOR_GD_SUPPORTED=y +CONFIG_SPI_FLASH_VENDOR_ISSI_SUPPORTED=y +CONFIG_SPI_FLASH_VENDOR_MXIC_SUPPORTED=y +CONFIG_SPI_FLASH_VENDOR_WINBOND_SUPPORTED=y +CONFIG_SPI_FLASH_SUPPORT_ISSI_CHIP=y +CONFIG_SPI_FLASH_SUPPORT_MXIC_CHIP=y +CONFIG_SPI_FLASH_SUPPORT_GD_CHIP=y +CONFIG_SPI_FLASH_SUPPORT_WINBOND_CHIP=y +# CONFIG_SPI_FLASH_SUPPORT_BOYA_CHIP is not set +# CONFIG_SPI_FLASH_SUPPORT_TH_CHIP is not set +# end of Auto-detect flash chips + +CONFIG_SPI_FLASH_ENABLE_ENCRYPTED_READ_WRITE=y +# end of SPI Flash driver + +# +# SPIFFS Configuration +# +CONFIG_SPIFFS_MAX_PARTITIONS=3 + +# +# SPIFFS Cache Configuration +# +CONFIG_SPIFFS_CACHE=y +CONFIG_SPIFFS_CACHE_WR=y +# CONFIG_SPIFFS_CACHE_STATS is not set +# end of SPIFFS Cache Configuration + +CONFIG_SPIFFS_PAGE_CHECK=y +CONFIG_SPIFFS_GC_MAX_RUNS=10 +# CONFIG_SPIFFS_GC_STATS is not set +CONFIG_SPIFFS_PAGE_SIZE=256 +CONFIG_SPIFFS_OBJ_NAME_LEN=32 +# CONFIG_SPIFFS_FOLLOW_SYMLINKS is not set +CONFIG_SPIFFS_USE_MAGIC=y +CONFIG_SPIFFS_USE_MAGIC_LENGTH=y +CONFIG_SPIFFS_META_LENGTH=4 +CONFIG_SPIFFS_USE_MTIME=y + +# +# Debug Configuration +# +# CONFIG_SPIFFS_DBG is not set +# CONFIG_SPIFFS_API_DBG is not set +# CONFIG_SPIFFS_GC_DBG is not set +# CONFIG_SPIFFS_CACHE_DBG is not set +# CONFIG_SPIFFS_CHECK_DBG is not set +# CONFIG_SPIFFS_TEST_VISUALISATION is not set +# end of Debug Configuration +# end of SPIFFS Configuration + +# +# TCP Transport +# + +# +# Websocket +# +CONFIG_WS_TRANSPORT=y +CONFIG_WS_BUFFER_SIZE=1024 +# CONFIG_WS_DYNAMIC_BUFFER is not set +# end of Websocket +# end of TCP Transport + +# +# Ultra Low Power (ULP) Co-processor +# +# CONFIG_ULP_COPROC_ENABLED is not set +# end of Ultra Low Power (ULP) Co-processor + +# +# Unity unit testing library +# +CONFIG_UNITY_ENABLE_FLOAT=y +CONFIG_UNITY_ENABLE_DOUBLE=y +# CONFIG_UNITY_ENABLE_64BIT is not set +# CONFIG_UNITY_ENABLE_COLOR is not set +CONFIG_UNITY_ENABLE_IDF_TEST_RUNNER=y +# CONFIG_UNITY_ENABLE_FIXTURE is not set +# CONFIG_UNITY_ENABLE_BACKTRACE_ON_FAIL is not set +# end of Unity unit testing library + +# +# Root Hub configuration +# +# end of Root Hub configuration + +# +# Virtual file system +# +CONFIG_VFS_SUPPORT_IO=y +CONFIG_VFS_SUPPORT_DIR=y +CONFIG_VFS_SUPPORT_SELECT=y +CONFIG_VFS_SUPPRESS_SELECT_DEBUG_OUTPUT=y +CONFIG_VFS_SUPPORT_TERMIOS=y +CONFIG_VFS_MAX_COUNT=8 + +# +# Host File System I/O (Semihosting) +# +CONFIG_VFS_SEMIHOSTFS_MAX_MOUNT_POINTS=1 +# end of Host File System I/O (Semihosting) +# end of Virtual file system + +# +# Wear Levelling +# +# CONFIG_WL_SECTOR_SIZE_512 is not set +CONFIG_WL_SECTOR_SIZE_4096=y +CONFIG_WL_SECTOR_SIZE=4096 +# end of Wear Levelling + +# +# Wi-Fi Provisioning Manager +# +CONFIG_WIFI_PROV_SCAN_MAX_ENTRIES=16 +CONFIG_WIFI_PROV_AUTOSTOP_TIMEOUT=30 +# CONFIG_WIFI_PROV_BLE_FORCE_ENCRYPTION is not set +CONFIG_WIFI_PROV_STA_ALL_CHANNEL_SCAN=y +# CONFIG_WIFI_PROV_STA_FAST_SCAN is not set +# end of Wi-Fi Provisioning Manager + +# +# libsodium +# +# end of libsodium +# end of Component config + +# CONFIG_IDF_EXPERIMENTAL_FEATURES is not set + +# Deprecated options for backward compatibility +# CONFIG_APP_BUILD_TYPE_ELF_RAM is not set +# CONFIG_NO_BLOBS is not set +# CONFIG_ESP32_NO_BLOBS is not set +# CONFIG_ESP32_COMPATIBLE_PRE_V2_1_BOOTLOADERS is not set +# CONFIG_ESP32_COMPATIBLE_PRE_V3_1_BOOTLOADERS is not set +# CONFIG_LOG_BOOTLOADER_LEVEL_NONE is not set +# CONFIG_LOG_BOOTLOADER_LEVEL_ERROR is not set +# CONFIG_LOG_BOOTLOADER_LEVEL_WARN is not set +CONFIG_LOG_BOOTLOADER_LEVEL_INFO=y +# CONFIG_LOG_BOOTLOADER_LEVEL_DEBUG is not set +# CONFIG_LOG_BOOTLOADER_LEVEL_VERBOSE is not set +CONFIG_LOG_BOOTLOADER_LEVEL=3 +# CONFIG_APP_ROLLBACK_ENABLE is not set +# CONFIG_FLASH_ENCRYPTION_ENABLED is not set +# CONFIG_FLASHMODE_QIO is not set +# CONFIG_FLASHMODE_QOUT is not set +CONFIG_FLASHMODE_DIO=y +# CONFIG_FLASHMODE_DOUT is not set +CONFIG_MONITOR_BAUD=115200 +CONFIG_OPTIMIZATION_LEVEL_DEBUG=y +CONFIG_COMPILER_OPTIMIZATION_LEVEL_DEBUG=y +CONFIG_COMPILER_OPTIMIZATION_DEFAULT=y +# CONFIG_OPTIMIZATION_LEVEL_RELEASE is not set +# CONFIG_COMPILER_OPTIMIZATION_LEVEL_RELEASE is not set +CONFIG_OPTIMIZATION_ASSERTIONS_ENABLED=y +# CONFIG_OPTIMIZATION_ASSERTIONS_SILENT is not set +# CONFIG_OPTIMIZATION_ASSERTIONS_DISABLED is not set +CONFIG_OPTIMIZATION_ASSERTION_LEVEL=2 +# CONFIG_CXX_EXCEPTIONS is not set +# CONFIG_STACK_CHECK_NONE is not set +# CONFIG_STACK_CHECK_NORM is not set +CONFIG_STACK_CHECK_STRONG=y +# CONFIG_STACK_CHECK_ALL is not set +CONFIG_STACK_CHECK=y +# CONFIG_WARN_WRITE_STRINGS is not set +# CONFIG_ESP32_APPTRACE_DEST_TRAX is not set +CONFIG_ESP32_APPTRACE_DEST_NONE=y +CONFIG_ESP32_APPTRACE_LOCK_ENABLE=y +CONFIG_ADC2_DISABLE_DAC=y +# CONFIG_MCPWM_ISR_IN_IRAM is not set +# CONFIG_EVENT_LOOP_PROFILING is not set +CONFIG_POST_EVENTS_FROM_ISR=y +CONFIG_POST_EVENTS_FROM_IRAM_ISR=y +# CONFIG_OTA_ALLOW_HTTP is not set +# CONFIG_TWO_UNIVERSAL_MAC_ADDRESS is not set +CONFIG_FOUR_UNIVERSAL_MAC_ADDRESS=y +CONFIG_NUMBER_OF_UNIVERSAL_MAC_ADDRESS=4 +CONFIG_ESP32_DEEP_SLEEP_WAKEUP_DELAY=2000 +CONFIG_ESP32_RTC_CLK_SRC_INT_RC=y +CONFIG_ESP32_RTC_CLOCK_SOURCE_INTERNAL_RC=y +# CONFIG_ESP32_RTC_CLK_SRC_EXT_CRYS is not set +# CONFIG_ESP32_RTC_CLOCK_SOURCE_EXTERNAL_CRYSTAL is not set +# CONFIG_ESP32_RTC_CLK_SRC_EXT_OSC is not set +# CONFIG_ESP32_RTC_CLOCK_SOURCE_EXTERNAL_OSC is not set +# CONFIG_ESP32_RTC_CLK_SRC_INT_8MD256 is not set +# CONFIG_ESP32_RTC_CLOCK_SOURCE_INTERNAL_8MD256 is not set +CONFIG_ESP32_RTC_CLK_CAL_CYCLES=1024 +# CONFIG_ESP32_XTAL_FREQ_26 is not set +CONFIG_ESP32_XTAL_FREQ_40=y +# CONFIG_ESP32_XTAL_FREQ_AUTO is not set +CONFIG_ESP32_XTAL_FREQ=40 +CONFIG_ESP32_PHY_CALIBRATION_AND_DATA_STORAGE=y +# CONFIG_ESP32_PHY_INIT_DATA_IN_PARTITION is not set +CONFIG_ESP32_PHY_MAX_WIFI_TX_POWER=20 +CONFIG_ESP32_PHY_MAX_TX_POWER=20 +# CONFIG_REDUCE_PHY_TX_POWER is not set +# CONFIG_ESP32_REDUCE_PHY_TX_POWER is not set +CONFIG_SPIRAM_SUPPORT=y +CONFIG_ESP32_SPIRAM_SUPPORT=y +# CONFIG_WIFI_LWIP_ALLOCATION_FROM_SPIRAM_FIRST is not set +# CONFIG_ESP32_DEFAULT_CPU_FREQ_80 is not set +CONFIG_ESP32_DEFAULT_CPU_FREQ_160=y +# CONFIG_ESP32_DEFAULT_CPU_FREQ_240 is not set +CONFIG_ESP32_DEFAULT_CPU_FREQ_MHZ=160 +CONFIG_TRACEMEM_RESERVE_DRAM=0x0 +# CONFIG_ESP32_PANIC_PRINT_HALT is not set +CONFIG_ESP32_PANIC_PRINT_REBOOT=y +# CONFIG_ESP32_PANIC_SILENT_REBOOT is not set +# CONFIG_ESP32_PANIC_GDBSTUB is not set +CONFIG_SYSTEM_EVENT_QUEUE_SIZE=32 +CONFIG_SYSTEM_EVENT_TASK_STACK_SIZE=2304 +CONFIG_MAIN_TASK_STACK_SIZE=3584 +CONFIG_CONSOLE_UART_DEFAULT=y +# CONFIG_CONSOLE_UART_CUSTOM is not set +# CONFIG_CONSOLE_UART_NONE is not set +# CONFIG_ESP_CONSOLE_UART_NONE is not set +CONFIG_CONSOLE_UART=y +CONFIG_CONSOLE_UART_NUM=0 +CONFIG_CONSOLE_UART_BAUDRATE=115200 +CONFIG_INT_WDT=y +CONFIG_INT_WDT_TIMEOUT_MS=300 +CONFIG_INT_WDT_CHECK_CPU1=y +CONFIG_TASK_WDT=y +CONFIG_ESP_TASK_WDT=y +# CONFIG_TASK_WDT_PANIC is not set +CONFIG_TASK_WDT_TIMEOUT_S=5 +CONFIG_TASK_WDT_CHECK_IDLE_TASK_CPU0=y +CONFIG_TASK_WDT_CHECK_IDLE_TASK_CPU1=y +# CONFIG_ESP32_DEBUG_STUBS_ENABLE is not set +CONFIG_ESP32_DEBUG_OCDAWARE=y +CONFIG_BROWNOUT_DET=y +CONFIG_ESP32_BROWNOUT_DET=y +CONFIG_BROWNOUT_DET_LVL_SEL_0=y +CONFIG_ESP32_BROWNOUT_DET_LVL_SEL_0=y +# CONFIG_BROWNOUT_DET_LVL_SEL_1 is not set +# CONFIG_ESP32_BROWNOUT_DET_LVL_SEL_1 is not set +# CONFIG_BROWNOUT_DET_LVL_SEL_2 is not set +# CONFIG_ESP32_BROWNOUT_DET_LVL_SEL_2 is not set +# CONFIG_BROWNOUT_DET_LVL_SEL_3 is not set +# CONFIG_ESP32_BROWNOUT_DET_LVL_SEL_3 is not set +# CONFIG_BROWNOUT_DET_LVL_SEL_4 is not set +# CONFIG_ESP32_BROWNOUT_DET_LVL_SEL_4 is not set +# CONFIG_BROWNOUT_DET_LVL_SEL_5 is not set +# CONFIG_ESP32_BROWNOUT_DET_LVL_SEL_5 is not set +# CONFIG_BROWNOUT_DET_LVL_SEL_6 is not set +# CONFIG_ESP32_BROWNOUT_DET_LVL_SEL_6 is not set +# CONFIG_BROWNOUT_DET_LVL_SEL_7 is not set +# CONFIG_ESP32_BROWNOUT_DET_LVL_SEL_7 is not set +CONFIG_BROWNOUT_DET_LVL=0 +CONFIG_ESP32_BROWNOUT_DET_LVL=0 +# CONFIG_DISABLE_BASIC_ROM_CONSOLE is not set +CONFIG_IPC_TASK_STACK_SIZE=1024 +CONFIG_TIMER_TASK_STACK_SIZE=3584 +CONFIG_ESP32_WIFI_ENABLED=y +CONFIG_ESP32_WIFI_STATIC_RX_BUFFER_NUM=10 +CONFIG_ESP32_WIFI_DYNAMIC_RX_BUFFER_NUM=32 +CONFIG_ESP32_WIFI_STATIC_TX_BUFFER=y +CONFIG_ESP32_WIFI_TX_BUFFER_TYPE=0 +CONFIG_ESP32_WIFI_STATIC_TX_BUFFER_NUM=16 +CONFIG_ESP32_WIFI_CACHE_TX_BUFFER_NUM=32 +# CONFIG_ESP32_WIFI_CSI_ENABLED is not set +CONFIG_ESP32_WIFI_AMPDU_TX_ENABLED=y +CONFIG_ESP32_WIFI_TX_BA_WIN=6 +CONFIG_ESP32_WIFI_AMPDU_RX_ENABLED=y +CONFIG_ESP32_WIFI_AMPDU_RX_ENABLED=y +CONFIG_ESP32_WIFI_RX_BA_WIN=6 +CONFIG_ESP32_WIFI_RX_BA_WIN=6 +# CONFIG_ESP32_WIFI_AMSDU_TX_ENABLED is not set +CONFIG_ESP32_WIFI_NVS_ENABLED=y +CONFIG_ESP32_WIFI_TASK_PINNED_TO_CORE_0=y +# CONFIG_ESP32_WIFI_TASK_PINNED_TO_CORE_1 is not set +CONFIG_ESP32_WIFI_SOFTAP_BEACON_MAX_LEN=752 +CONFIG_ESP32_WIFI_MGMT_SBUF_NUM=32 +CONFIG_ESP32_WIFI_IRAM_OPT=y +CONFIG_ESP32_WIFI_RX_IRAM_OPT=y +CONFIG_ESP32_WIFI_ENABLE_WPA3_SAE=y +CONFIG_ESP32_WIFI_ENABLE_WPA3_OWE_STA=y +CONFIG_WPA_MBEDTLS_CRYPTO=y +CONFIG_WPA_MBEDTLS_TLS_CLIENT=y +# CONFIG_WPA_WAPI_PSK is not set +# CONFIG_WPA_SUITE_B_192 is not set +# CONFIG_WPA_11KV_SUPPORT is not set +# CONFIG_WPA_MBO_SUPPORT is not set +# CONFIG_WPA_DPP_SUPPORT is not set +# CONFIG_WPA_11R_SUPPORT is not set +# CONFIG_WPA_WPS_SOFTAP_REGISTRAR is not set +# CONFIG_WPA_WPS_STRICT is not set +# CONFIG_WPA_DEBUG_PRINT is not set +# CONFIG_WPA_TESTING_OPTIONS is not set +# CONFIG_ESP32_ENABLE_COREDUMP_TO_FLASH is not set +# CONFIG_ESP32_ENABLE_COREDUMP_TO_UART is not set +CONFIG_ESP32_ENABLE_COREDUMP_TO_NONE=y +CONFIG_TIMER_TASK_PRIORITY=1 +CONFIG_TIMER_TASK_STACK_DEPTH=2048 +CONFIG_TIMER_QUEUE_LENGTH=10 +# CONFIG_ENABLE_STATIC_TASK_CLEAN_UP_HOOK is not set +# CONFIG_HAL_ASSERTION_SILIENT is not set +# CONFIG_L2_TO_L3_COPY is not set +CONFIG_ESP_GRATUITOUS_ARP=y +CONFIG_GARP_TMR_INTERVAL=60 +CONFIG_TCPIP_RECVMBOX_SIZE=32 +CONFIG_TCP_MAXRTX=12 +CONFIG_TCP_SYNMAXRTX=12 +CONFIG_TCP_MSS=1440 +CONFIG_TCP_MSL=60000 +CONFIG_TCP_SND_BUF_DEFAULT=5744 +CONFIG_TCP_WND_DEFAULT=5744 +CONFIG_TCP_RECVMBOX_SIZE=6 +CONFIG_TCP_QUEUE_OOSEQ=y +CONFIG_TCP_OVERSIZE_MSS=y +# CONFIG_TCP_OVERSIZE_QUARTER_MSS is not set +# CONFIG_TCP_OVERSIZE_DISABLE is not set +CONFIG_UDP_RECVMBOX_SIZE=6 +CONFIG_TCPIP_TASK_STACK_SIZE=3072 +CONFIG_TCPIP_TASK_AFFINITY_NO_AFFINITY=y +# CONFIG_TCPIP_TASK_AFFINITY_CPU0 is not set +# CONFIG_TCPIP_TASK_AFFINITY_CPU1 is not set +CONFIG_TCPIP_TASK_AFFINITY=0x7FFFFFFF +# CONFIG_PPP_SUPPORT is not set +CONFIG_ESP32_TIME_SYSCALL_USE_RTC_HRT=y +CONFIG_ESP32_TIME_SYSCALL_USE_RTC_FRC1=y +# CONFIG_ESP32_TIME_SYSCALL_USE_RTC is not set +# CONFIG_ESP32_TIME_SYSCALL_USE_HRT is not set +# CONFIG_ESP32_TIME_SYSCALL_USE_FRC1 is not set +# CONFIG_ESP32_TIME_SYSCALL_USE_NONE is not set +CONFIG_ESP32_PTHREAD_TASK_PRIO_DEFAULT=5 +CONFIG_ESP32_PTHREAD_TASK_STACK_SIZE_DEFAULT=3072 +CONFIG_ESP32_PTHREAD_STACK_MIN=768 +CONFIG_ESP32_DEFAULT_PTHREAD_CORE_NO_AFFINITY=y +# CONFIG_ESP32_DEFAULT_PTHREAD_CORE_0 is not set +# CONFIG_ESP32_DEFAULT_PTHREAD_CORE_1 is not set +CONFIG_ESP32_PTHREAD_TASK_CORE_DEFAULT=-1 +CONFIG_ESP32_PTHREAD_TASK_NAME_DEFAULT="pthread" +CONFIG_SPI_FLASH_WRITING_DANGEROUS_REGIONS_ABORTS=y +# CONFIG_SPI_FLASH_WRITING_DANGEROUS_REGIONS_FAILS is not set +# CONFIG_SPI_FLASH_WRITING_DANGEROUS_REGIONS_ALLOWED is not set +# CONFIG_ESP32_ULP_COPROC_ENABLED is not set +CONFIG_SUPPRESS_SELECT_DEBUG_OUTPUT=y +CONFIG_SUPPORT_TERMIOS=y +CONFIG_SEMIHOSTFS_MAX_MOUNT_POINTS=1 +# End of deprecated options diff --git a/other/docker/esp32/toxcore/CMakeLists.txt b/other/docker/esp32/toxcore/CMakeLists.txt deleted file mode 100644 index 0b844e5e96..0000000000 --- a/other/docker/esp32/toxcore/CMakeLists.txt +++ /dev/null @@ -1,12 +0,0 @@ -set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wno-missing-field-initializers") - -file(GLOB toxcore_SRCS "toxcore/*.[ch]" "toxcore/*/*.[ch]") -set(COMPONENT_SRCS - ${toxcore_SRCS} - other/docker/esp32/main/toxcore_main.cc - third_party/cmp/cmp.c - third_party/cmp/cmp.h - toxencryptsave/defines.h) -set(COMPONENT_ADD_INCLUDEDIRS "") - -register_component() diff --git a/other/docker/esp32/toxcore/toxcore_main.cc b/other/docker/esp32/toxcore/toxcore_main.cc deleted file mode 100644 index 0ddec81a22..0000000000 --- a/other/docker/esp32/toxcore/toxcore_main.cc +++ /dev/null @@ -1,14 +0,0 @@ -#include - -#include "../../../../toxcore/ccompat.h" -#include "../../../../toxcore/tox.h" -#include "../../../../toxcore/tox_events.h" - -extern "C" void app_main(void) -{ - printf("Hello Tox!\n"); - - Tox *tox = tox_new(nullptr, nullptr); - tox_events_free(tox_events_iterate(tox, true, nullptr)); - tox_kill(tox); -} diff --git a/toxcore/BUILD.bazel b/toxcore/BUILD.bazel index 9cf548c662..f8351fd024 100644 --- a/toxcore/BUILD.bazel +++ b/toxcore/BUILD.bazel @@ -135,6 +135,18 @@ cc_test( ], ) +cc_library( + name = "pk_set", + srcs = ["pk_set.c"], + hdrs = ["pk_set.h"], + deps = [ + ":attributes", + ":ccompat", + ":crypto_core", + ":mem", + ], +) + cc_library( name = "list", srcs = ["list.c"], @@ -197,6 +209,7 @@ cc_library( ":attributes", ":ccompat", ":mem", + ":util", "@pthread", ], ) @@ -226,6 +239,7 @@ cc_library( deps = [ ":ccompat", ":crypto_core", + ":logger", ":mem", ":mono_time", ], @@ -344,6 +358,7 @@ cc_library( ":mono_time", ":network", ":ping_array", + ":pk_set", ":shared_key_cache", ":state", ":util", diff --git a/toxcore/DHT.c b/toxcore/DHT.c index 80f477ca85..6f826c6e53 100644 --- a/toxcore/DHT.c +++ b/toxcore/DHT.c @@ -18,6 +18,7 @@ #include "mono_time.h" #include "network.h" #include "ping.h" +#include "pk_set.h" #include "shared_key_cache.h" #include "state.h" #include "util.h" @@ -212,6 +213,17 @@ static IP_Port ip_port_normalize(const IP_Port *ip_port) return res; } +bool node_list_contains(const Node_format *const *nodes, uint16_t nodes_size, const uint8_t *public_key) +{ + for (uint16_t i = 0; i < nodes_size; ++i) { + if (pk_equal(nodes[i]->public_key, public_key)) { + return true; + } + } + + return false; +} + int id_closest(const uint8_t *pk, const uint8_t *pk1, const uint8_t *pk2) { for (size_t i = 0; i < CRYPTO_PUBLIC_KEY_SIZE; ++i) { @@ -1792,7 +1804,16 @@ static uint8_t do_ping_and_sendnode_requests(DHT *dht, uint64_t *lastgetnode, co unsigned int sort = 0; bool sort_ok = false; - if (client_list == nullptr || assoc_list == nullptr) { + // Keep track of which public keys we've sent GET_NODES to in this iteration, + // so we don't send GET_NODES to the same node twice. We may send it again next + // iteration, but this avoids a bit of wasted bandwidth. + // + // We can't share this across all calls within an iteration, because we're + // potentially requesting different public_keys in each GET_NODES packet. + Pk_Set *sent = pk_set_new(dht->mem, list_count * 2); + + if (client_list == nullptr || assoc_list == nullptr || sent == nullptr) { + pk_set_free(sent); mem_delete(dht->mem, assoc_list); mem_delete(dht->mem, client_list); return 0; @@ -1812,7 +1833,16 @@ static uint8_t do_ping_and_sendnode_requests(DHT *dht, uint64_t *lastgetnode, co ++not_kill; if (mono_time_is_timeout(dht->mono_time, assoc->last_pinged, PING_INTERVAL)) { - dht_getnodes(dht, &assoc->ip_port, client->public_key, public_key); + const IP_Port *target = &assoc->ip_port; + const uint8_t *target_key = client->public_key; + if (!pk_set_contains(sent, target_key)) { + dht_getnodes(dht, target, target_key, public_key); + pk_set_add(sent, target_key); + } else { + Ip_Ntoa ip_str; + LOGGER_TRACE(dht->log, "not sending repeated GET_NODES to %s:%d", + net_ip_ntoa(&target->ip, &ip_str), net_ntohs(target->port)); + } assoc->last_pinged = temp_time; } @@ -1845,12 +1875,22 @@ static uint8_t do_ping_and_sendnode_requests(DHT *dht, uint64_t *lastgetnode, co rand_node += random_range_u32(dht->rng, num_nodes - (rand_node + 1)); } - dht_getnodes(dht, &assoc_list[rand_node]->ip_port, client_list[rand_node]->public_key, public_key); + const IP_Port *target = &assoc_list[rand_node]->ip_port; + const uint8_t *target_key = client_list[rand_node]->public_key; + if (!pk_set_contains(sent, target_key)) { + dht_getnodes(dht, target, target_key, public_key); + pk_set_add(sent, target_key); + } else { + Ip_Ntoa ip_str; + LOGGER_TRACE(dht->log, "not sending repeated GET_NODES to %s:%d", + net_ip_ntoa(&target->ip, &ip_str), net_ntohs(target->port)); + } *lastgetnode = temp_time; ++*bootstrap_times; } + pk_set_free(sent); mem_delete(dht->mem, assoc_list); mem_delete(dht->mem, client_list); return not_kill; @@ -1874,8 +1914,7 @@ static void do_dht_friends(DHT *dht) dht_friend->num_to_bootstrap = 0; do_ping_and_sendnode_requests(dht, &dht_friend->lastgetnode, dht_friend->public_key, dht_friend->client_list, - MAX_FRIEND_CLIENTS, - &dht_friend->bootstrap_times, true); + MAX_FRIEND_CLIENTS, &dht_friend->bootstrap_times, true); } } @@ -2618,6 +2657,7 @@ DHT *new_dht(const Logger *log, const Memory *mem, const Random *rng, const Netw DHT *const dht = (DHT *)mem_alloc(mem, sizeof(DHT)); if (dht == nullptr) { + LOGGER_ERROR(log, "failed to allocate DHT struct (%ld bytes)", (unsigned long)sizeof(DHT)); return nullptr; } @@ -2635,6 +2675,7 @@ DHT *new_dht(const Logger *log, const Memory *mem, const Random *rng, const Netw dht->ping = ping_new(mem, mono_time, rng, dht); if (dht->ping == nullptr) { + LOGGER_ERROR(log, "failed to initialise ping"); kill_dht(dht); return nullptr; } @@ -2651,10 +2692,11 @@ DHT *new_dht(const Logger *log, const Memory *mem, const Random *rng, const Netw crypto_new_keypair(rng, dht->self_public_key, dht->self_secret_key); - dht->shared_keys_recv = shared_key_cache_new(mono_time, mem, dht->self_secret_key, KEYS_TIMEOUT, MAX_KEYS_PER_SLOT); - dht->shared_keys_sent = shared_key_cache_new(mono_time, mem, dht->self_secret_key, KEYS_TIMEOUT, MAX_KEYS_PER_SLOT); + dht->shared_keys_recv = shared_key_cache_new(log, mono_time, mem, dht->self_secret_key, KEYS_TIMEOUT, MAX_KEYS_PER_SLOT); + dht->shared_keys_sent = shared_key_cache_new(log, mono_time, mem, dht->self_secret_key, KEYS_TIMEOUT, MAX_KEYS_PER_SLOT); if (dht->shared_keys_recv == nullptr || dht->shared_keys_sent == nullptr) { + LOGGER_ERROR(log, "failed to initialise shared key cache"); kill_dht(dht); return nullptr; } @@ -2663,6 +2705,7 @@ DHT *new_dht(const Logger *log, const Memory *mem, const Random *rng, const Netw dht->dht_ping_array = ping_array_new(mem, DHT_PING_ARRAY_SIZE, PING_TIMEOUT); if (dht->dht_ping_array == nullptr) { + LOGGER_ERROR(log, "failed to initialise ping array"); kill_dht(dht); return nullptr; } @@ -2675,6 +2718,7 @@ DHT *new_dht(const Logger *log, const Memory *mem, const Random *rng, const Netw uint32_t token; // We don't intend to delete these ever, but need to pass the token if (dht_addfriend(dht, random_public_key_bytes, nullptr, nullptr, 0, &token) != 0) { + LOGGER_ERROR(log, "failed to add initial random seed DHT friends"); kill_dht(dht); return nullptr; } diff --git a/toxcore/DHT.h b/toxcore/DHT.h index 6021958fb0..1da2bb4e95 100644 --- a/toxcore/DHT.h +++ b/toxcore/DHT.h @@ -194,6 +194,9 @@ typedef struct Node_format { extern const Node_format empty_node_format; +non_null() +bool node_list_contains(const Node_format *const *nodes, uint16_t nodes_size, const uint8_t *public_key); + typedef struct DHT_Friend DHT_Friend; non_null() const uint8_t *dht_friend_public_key(const DHT_Friend *dht_friend); diff --git a/toxcore/Makefile.inc b/toxcore/Makefile.inc index 70df82b39e..84ec9c8f01 100644 --- a/toxcore/Makefile.inc +++ b/toxcore/Makefile.inc @@ -51,6 +51,8 @@ libtoxcore_la_SOURCES = ../third_party/cmp/cmp.c \ ../toxcore/timed_auth.c \ ../toxcore/ping_array.h \ ../toxcore/ping_array.c \ + ../toxcore/pk_set.h \ + ../toxcore/pk_set.c \ ../toxcore/net_crypto.h \ ../toxcore/net_crypto.c \ ../toxcore/friend_requests.h \ diff --git a/toxcore/Messenger.c b/toxcore/Messenger.c index 8ee9842b64..5622403709 100644 --- a/toxcore/Messenger.c +++ b/toxcore/Messenger.c @@ -3569,6 +3569,7 @@ Messenger *new_messenger(Mono_Time *mono_time, const Memory *mem, const Random * mem_delete(mem, m); if (error != nullptr && net_err == 1) { + LOGGER_WARNING(m->log, "network initialisation failed (no ports available)"); *error = MESSENGER_ERROR_PORT; } @@ -3588,6 +3589,8 @@ Messenger *new_messenger(Mono_Time *mono_time, const Memory *mem, const Random * m->net_crypto = new_net_crypto(m->log, m->mem, m->rng, m->ns, m->mono_time, m->dht, &options->proxy_info); if (m->net_crypto == nullptr) { + LOGGER_WARNING(m->log, "net_crypto initialisation failed"); + kill_dht(m->dht); kill_networking(m->net); friendreq_kill(m->fr); @@ -3600,6 +3603,8 @@ Messenger *new_messenger(Mono_Time *mono_time, const Memory *mem, const Random * m->group_announce = new_gca_list(); if (m->group_announce == nullptr) { + LOGGER_WARNING(m->log, "DHT group chats initialisation failed"); + kill_net_crypto(m->net_crypto); kill_dht(m->dht); kill_networking(m->net); @@ -3626,6 +3631,8 @@ Messenger *new_messenger(Mono_Time *mono_time, const Memory *mem, const Random * if ((options->dht_announcements_enabled && (m->forwarding == nullptr || m->announce == nullptr)) || m->onion == nullptr || m->onion_a == nullptr || m->onion_c == nullptr || m->fr_c == nullptr) { + LOGGER_WARNING(m->log, "onion initialisation failed"); + kill_onion(m->onion); kill_onion_announce(m->onion_a); kill_onion_client(m->onion_c); @@ -3650,6 +3657,8 @@ Messenger *new_messenger(Mono_Time *mono_time, const Memory *mem, const Random * m->group_handler = new_dht_groupchats(m); if (m->group_handler == nullptr) { + LOGGER_WARNING(m->log, "conferences initialisation failed"); + kill_onion(m->onion); kill_onion_announce(m->onion_a); kill_onion_client(m->onion_c); @@ -3674,6 +3683,8 @@ Messenger *new_messenger(Mono_Time *mono_time, const Memory *mem, const Random * m->onion, m->forwarding); if (m->tcp_server == nullptr) { + LOGGER_WARNING(m->log, "TCP server initialisation failed"); + kill_onion(m->onion); kill_onion_announce(m->onion_a); #ifndef VANILLA_NACL diff --git a/toxcore/TCP_connection.h b/toxcore/TCP_connection.h index f01e705445..04b48525d0 100644 --- a/toxcore/TCP_connection.h +++ b/toxcore/TCP_connection.h @@ -120,7 +120,7 @@ bool tcp_get_random_conn_ip_port(const TCP_Connections *tcp_c, IP_Port *ip_port) * return -1 on failure. */ non_null() -int tcp_send_onion_request(TCP_Connections *tcp_c, unsigned int tcp_connections_number, const uint8_t *data, +int tcp_send_onion_request(TCP_Connections *tcp_c, uint32_t tcp_connections_number, const uint8_t *data, uint16_t length); /** @brief Set if we want TCP_connection to allocate some connection for onion use. diff --git a/toxcore/announce.c b/toxcore/announce.c index fbbb2350c6..402d1136de 100644 --- a/toxcore/announce.c +++ b/toxcore/announce.c @@ -660,7 +660,7 @@ Announcements *new_announcements(const Logger *log, const Memory *mem, const Ran announce->public_key = dht_get_self_public_key(announce->dht); announce->secret_key = dht_get_self_secret_key(announce->dht); new_hmac_key(announce->rng, announce->hmac_key); - announce->shared_keys = shared_key_cache_new(mono_time, mem, announce->secret_key, KEYS_TIMEOUT, MAX_KEYS_PER_SLOT); + announce->shared_keys = shared_key_cache_new(log, mono_time, mem, announce->secret_key, KEYS_TIMEOUT, MAX_KEYS_PER_SLOT); if (announce->shared_keys == nullptr) { free(announce); return nullptr; diff --git a/toxcore/mono_time.c b/toxcore/mono_time.c index 2ce817f67e..ff2637efa6 100644 --- a/toxcore/mono_time.c +++ b/toxcore/mono_time.c @@ -32,6 +32,7 @@ #include #include "ccompat.h" +#include "util.h" /** don't call into system billions of times for no reason */ struct Mono_Time { @@ -165,7 +166,7 @@ Mono_Time *mono_time_new(const Memory *mem, mono_time_current_time_cb *current_t // Maximum reproducibility. Never return time = 0. mono_time->base_time = 1; #else - mono_time->base_time = (uint64_t)time(nullptr) * 1000ULL - current_time_monotonic(mono_time); + mono_time->base_time = max_u64(1, (uint64_t)time(nullptr)) * 1000ULL - current_time_monotonic(mono_time); #endif mono_time_update(mono_time); diff --git a/toxcore/network.c b/toxcore/network.c index 3e0e6f49c7..6228317ae5 100644 --- a/toxcore/network.c +++ b/toxcore/network.c @@ -1,5 +1,5 @@ /* SPDX-License-Identifier: GPL-3.0-or-later - * Copyright © 2016-2018 The TokTok team. + * Copyright © 2016-2023 The TokTok team. * Copyright © 2013 Tox project. */ @@ -778,7 +778,7 @@ static void loglogdata(const Logger *log, const char *message, const uint8_t *bu Ip_Ntoa ip_str; const int error = net_error(); char *strerror = net_new_strerror(error); - LOGGER_TRACE(log, "[%02x = %-20s] %s %3u%c %s:%u (%u: %s) | %08x%08x...%02x", + LOGGER_TRACE(log, "[%02x = %-21s] %s %3u%c %s:%u (%u: %s) | %08x%08x...%02x", buffer[0], net_packet_type_name((Net_Packet_Type)buffer[0]), message, min_u16(buflen, 999), 'E', net_ip_ntoa(&ip_port->ip, &ip_str), net_ntohs(ip_port->port), error, @@ -786,14 +786,14 @@ static void loglogdata(const Logger *log, const char *message, const uint8_t *bu net_kill_strerror(strerror); } else if ((res > 0) && ((size_t)res <= buflen)) { Ip_Ntoa ip_str; - LOGGER_TRACE(log, "[%02x = %-20s] %s %3u%c %s:%u (%u: %s) | %08x%08x...%02x", + LOGGER_TRACE(log, "[%02x = %-21s] %s %3u%c %s:%u (%u: %s) | %08x%08x...%02x", buffer[0], net_packet_type_name((Net_Packet_Type)buffer[0]), message, min_u16(res, 999), (size_t)res < buflen ? '<' : '=', net_ip_ntoa(&ip_port->ip, &ip_str), net_ntohs(ip_port->port), 0, "OK", data_0(buflen, buffer), data_1(buflen, buffer), buffer[buflen - 1]); } else { /* empty or overwrite */ Ip_Ntoa ip_str; - LOGGER_TRACE(log, "[%02x = %-20s] %s %lu%c%u %s:%u (%u: %s) | %08x%08x...%02x", + LOGGER_TRACE(log, "[%02x = %-21s] %s %lu%c%u %s:%u (%u: %s) | %08x%08x...%02x", buffer[0], net_packet_type_name((Net_Packet_Type)buffer[0]), message, res, res == 0 ? '!' : '>', buflen, net_ip_ntoa(&ip_port->ip, &ip_str), net_ntohs(ip_port->port), 0, "OK", diff --git a/toxcore/onion.c b/toxcore/onion.c index d7ec8bfd78..42934ac432 100644 --- a/toxcore/onion.c +++ b/toxcore/onion.c @@ -283,22 +283,27 @@ int create_onion_packet_tcp(const Random *rng, uint8_t *packet, uint16_t max_pac * return -1 on failure. * return 0 on success. */ -int send_onion_response(const Networking_Core *net, const IP_Port *dest, const uint8_t *data, uint16_t length, +int send_onion_response(const Logger *log, const Networking_Core *net, + const IP_Port *dest, const uint8_t *data, uint16_t length, const uint8_t *ret) { if (length > ONION_RESPONSE_MAX_DATA_SIZE || length == 0) { return -1; } - VLA(uint8_t, packet, 1 + RETURN_3 + length); + const uint16_t packet_size = 1 + RETURN_3 + length; + VLA(uint8_t, packet, packet_size); packet[0] = NET_PACKET_ONION_RECV_3; memcpy(packet + 1, ret, RETURN_3); memcpy(packet + 1 + RETURN_3, data, length); - if ((uint32_t)sendpacket(net, dest, packet, SIZEOF_VLA(packet)) != SIZEOF_VLA(packet)) { + if ((uint16_t)sendpacket(net, dest, packet, packet_size) != packet_size) { return -1; } + Ip_Ntoa ip_str; + LOGGER_TRACE(log, "forwarded onion RECV_3 to %s:%d (%02x in %02x, %d bytes)", + net_ip_ntoa(&dest->ip, &ip_str), net_ntohs(dest->port), data[0], packet[0], packet_size); return 0; } @@ -309,10 +314,14 @@ static int handle_send_initial(void *object, const IP_Port *source, const uint8_ Onion *onion = (Onion *)object; if (length > ONION_MAX_PACKET_SIZE) { + LOGGER_TRACE(onion->log, "invalid initial onion packet length: %u (max: %u)", + length, ONION_MAX_PACKET_SIZE); return 1; } if (length <= 1 + SEND_1) { + LOGGER_TRACE(onion->log, "initial onion packet cannot contain SEND_1 packet: %u <= %u", + length, 1 + SEND_1); return 1; } @@ -324,13 +333,19 @@ static int handle_send_initial(void *object, const IP_Port *source, const uint8_ if (shared_key == nullptr) { /* Error looking up/deriving the shared key */ + LOGGER_TRACE(onion->log, "shared onion key lookup failed for pk %02x%02x...", + public_key[0], public_key[1]); return 1; } - const int len = decrypt_data_symmetric(shared_key, packet + 1, packet + 1 + CRYPTO_NONCE_SIZE + CRYPTO_PUBLIC_KEY_SIZE, - length - (1 + CRYPTO_NONCE_SIZE + CRYPTO_PUBLIC_KEY_SIZE), plain); + const int encrypted_start = 1; + const int encrypted_end = encrypted_start + CRYPTO_NONCE_SIZE + CRYPTO_PUBLIC_KEY_SIZE; + const int len = decrypt_data_symmetric( + shared_key, packet + encrypted_start, packet + encrypted_end, length - encrypted_end, plain); - if (len != length - (1 + CRYPTO_NONCE_SIZE + CRYPTO_PUBLIC_KEY_SIZE + CRYPTO_MAC_SIZE)) { + const int expected_len = length - (encrypted_end + CRYPTO_MAC_SIZE); + if (len != expected_len) { + LOGGER_TRACE(onion->log, "decrypt failed: %d != %d", len, expected_len); return 1; } @@ -339,7 +354,9 @@ static int handle_send_initial(void *object, const IP_Port *source, const uint8_ int onion_send_1(const Onion *onion, const uint8_t *plain, uint16_t len, const IP_Port *source, const uint8_t *nonce) { - if (len > ONION_MAX_PACKET_SIZE + SIZE_IPPORT - (1 + CRYPTO_NONCE_SIZE + ONION_RETURN_1)) { + const uint16_t max_len = ONION_MAX_PACKET_SIZE + SIZE_IPPORT - (1 + CRYPTO_NONCE_SIZE + ONION_RETURN_1); + if (len > max_len) { + LOGGER_TRACE(onion->log, "invalid SEND_1 length: %d > %d", len, max_len); return 1; } @@ -376,6 +393,9 @@ int onion_send_1(const Onion *onion, const uint8_t *plain, uint16_t len, const I return 1; } + Ip_Ntoa ip_str; + LOGGER_TRACE(onion->log, "forwarded onion packet to %s:%d, level 1 (%02x in %02x, %d bytes)", + net_ip_ntoa(&send_to.ip, &ip_str), net_ntohs(send_to.port), plain[0], data[0], data_len); return 0; } @@ -439,6 +459,9 @@ static int handle_send_1(void *object, const IP_Port *source, const uint8_t *pac return 1; } + Ip_Ntoa ip_str; + LOGGER_TRACE(onion->log, "forwarded onion packet to %s:%d, level 2 (%02x in %02x, %d bytes)", + net_ip_ntoa(&send_to.ip, &ip_str), net_ntohs(send_to.port), packet[0], data[0], data_len); return 0; } @@ -509,6 +532,9 @@ static int handle_send_2(void *object, const IP_Port *source, const uint8_t *pac return 1; } + Ip_Ntoa ip_str; + LOGGER_TRACE(onion->log, "forwarded onion packet to %s:%d, level 3 (%02x in %02x, %d bytes)", + net_ip_ntoa(&send_to.ip, &ip_str), net_ntohs(send_to.port), packet[0], data[0], data_len); return 0; } @@ -546,6 +572,7 @@ static int handle_recv_3(void *object, const IP_Port *source, const uint8_t *pac IP_Port send_to; if (ipport_unpack(&send_to, plain, len, false) == -1) { + LOGGER_DEBUG(onion->log, "failed to unpack IP/Port"); return 1; } @@ -559,6 +586,9 @@ static int handle_recv_3(void *object, const IP_Port *source, const uint8_t *pac return 1; } + Ip_Ntoa ip_str; + LOGGER_TRACE(onion->log, "forwarded onion RECV_2 to %s:%d (%02x in %02x, %d bytes)", + net_ip_ntoa(&send_to.ip, &ip_str), net_ntohs(send_to.port), packet[0], data[0], data_len); return 0; } @@ -608,6 +638,9 @@ static int handle_recv_2(void *object, const IP_Port *source, const uint8_t *pac return 1; } + Ip_Ntoa ip_str; + LOGGER_TRACE(onion->log, "forwarded onion RECV_1 to %s:%d (%02x in %02x, %d bytes)", + net_ip_ntoa(&send_to.ip, &ip_str), net_ntohs(send_to.port), packet[0], data[0], data_len); return 0; } @@ -644,6 +677,7 @@ static int handle_recv_1(void *object, const IP_Port *source, const uint8_t *pac IP_Port send_to; if (ipport_unpack(&send_to, plain, len, true) == -1) { + LOGGER_DEBUG(onion->log, "failed to unpack IP/Port"); return 1; } @@ -690,9 +724,9 @@ Onion *new_onion(const Logger *log, const Memory *mem, const Mono_Time *mono_tim onion->timestamp = mono_time_get(onion->mono_time); const uint8_t *secret_key = dht_get_self_secret_key(dht); - onion->shared_keys_1 = shared_key_cache_new(mono_time, mem, secret_key, KEYS_TIMEOUT, MAX_KEYS_PER_SLOT); - onion->shared_keys_2 = shared_key_cache_new(mono_time, mem, secret_key, KEYS_TIMEOUT, MAX_KEYS_PER_SLOT); - onion->shared_keys_3 = shared_key_cache_new(mono_time, mem, secret_key, KEYS_TIMEOUT, MAX_KEYS_PER_SLOT); + onion->shared_keys_1 = shared_key_cache_new(log, mono_time, mem, secret_key, KEYS_TIMEOUT, MAX_KEYS_PER_SLOT); + onion->shared_keys_2 = shared_key_cache_new(log, mono_time, mem, secret_key, KEYS_TIMEOUT, MAX_KEYS_PER_SLOT); + onion->shared_keys_3 = shared_key_cache_new(log, mono_time, mem, secret_key, KEYS_TIMEOUT, MAX_KEYS_PER_SLOT); if (onion->shared_keys_1 == nullptr || onion->shared_keys_2 == nullptr || diff --git a/toxcore/onion.h b/toxcore/onion.h index 7f71c2493d..732d926ca7 100644 --- a/toxcore/onion.h +++ b/toxcore/onion.h @@ -127,7 +127,8 @@ int create_onion_packet_tcp(const Random *rng, uint8_t *packet, uint16_t max_pac * return 0 on success. */ non_null() -int send_onion_response(const Networking_Core *net, const IP_Port *dest, const uint8_t *data, uint16_t length, +int send_onion_response(const Logger *log, const Networking_Core *net, + const IP_Port *dest, const uint8_t *data, uint16_t length, const uint8_t *ret); /** @brief Function to handle/send received decrypted versions of the packet created by create_onion_packet. diff --git a/toxcore/onion_announce.c b/toxcore/onion_announce.c index 551e7b1fae..d4a37ad93b 100644 --- a/toxcore/onion_announce.c +++ b/toxcore/onion_announce.c @@ -186,11 +186,12 @@ int create_data_request(const Random *rng, uint8_t *packet, uint16_t max_packet_ * return -1 on failure. * return 0 on success. */ -int send_announce_request(const Networking_Core *net, const Random *rng, - const Onion_Path *path, const Node_format *dest, - const uint8_t *public_key, const uint8_t *secret_key, - const uint8_t *ping_id, const uint8_t *client_id, - const uint8_t *data_public_key, uint64_t sendback_data) +int send_announce_request( + const Logger *log, const Networking_Core *net, const Random *rng, + const Onion_Path *path, const Node_format *dest, + const uint8_t *public_key, const uint8_t *secret_key, + const uint8_t *ping_id, const uint8_t *client_id, + const uint8_t *data_public_key, uint64_t sendback_data) { uint8_t request[ONION_ANNOUNCE_REQUEST_MIN_SIZE]; int len = create_announce_request(rng, request, sizeof(request), dest->public_key, public_key, secret_key, ping_id, @@ -230,9 +231,10 @@ int send_announce_request(const Networking_Core *net, const Random *rng, * return -1 on failure. * return 0 on success. */ -int send_data_request(const Networking_Core *net, const Random *rng, const Onion_Path *path, const IP_Port *dest, - const uint8_t *public_key, const uint8_t *encrypt_public_key, const uint8_t *nonce, - const uint8_t *data, uint16_t length) +int send_data_request( + const Logger *log, const Networking_Core *net, const Random *rng, const Onion_Path *path, const IP_Port *dest, + const uint8_t *public_key, const uint8_t *encrypt_public_key, const uint8_t *nonce, + const uint8_t *data, uint16_t length) { uint8_t request[ONION_MAX_DATA_SIZE]; int len = create_data_request(rng, request, sizeof(request), public_key, encrypt_public_key, nonce, data, length); @@ -549,7 +551,7 @@ static int handle_announce_request_common( ONION_ANNOUNCE_SENDBACK_DATA_LENGTH); memcpy(data + 1 + ONION_ANNOUNCE_SENDBACK_DATA_LENGTH, nonce, CRYPTO_NONCE_SIZE); - if (send_onion_response(onion_a->net, source, data, + if (send_onion_response(onion_a->log, onion_a->net, source, data, 1 + ONION_ANNOUNCE_SENDBACK_DATA_LENGTH + CRYPTO_NONCE_SIZE + len, packet + (length - ONION_RETURN_3)) == -1) { mem_delete(onion_a->mem, response); @@ -634,7 +636,7 @@ static int handle_data_request(void *object, const IP_Port *source, const uint8_ data[0] = NET_PACKET_ONION_DATA_RESPONSE; memcpy(data + 1, packet + 1 + CRYPTO_PUBLIC_KEY_SIZE, length - (1 + CRYPTO_PUBLIC_KEY_SIZE + ONION_RETURN_3)); - if (send_onion_response(onion_a->net, &onion_a->entries[index].ret_ip_port, data, SIZEOF_VLA(data), + if (send_onion_response(onion_a->log, onion_a->net, &onion_a->entries[index].ret_ip_port, data, SIZEOF_VLA(data), onion_a->entries[index].ret) == -1) { return 1; } @@ -665,7 +667,7 @@ Onion_Announce *new_onion_announce(const Logger *log, const Memory *mem, const R onion_a->extra_data_object = nullptr; new_hmac_key(rng, onion_a->hmac_key); - onion_a->shared_keys_recv = shared_key_cache_new(mono_time, mem, dht_get_self_secret_key(dht), KEYS_TIMEOUT, MAX_KEYS_PER_SLOT); + onion_a->shared_keys_recv = shared_key_cache_new(log, mono_time, mem, dht_get_self_secret_key(dht), KEYS_TIMEOUT, MAX_KEYS_PER_SLOT); if (onion_a->shared_keys_recv == nullptr) { kill_onion_announce(onion_a); return nullptr; diff --git a/toxcore/onion_announce.h b/toxcore/onion_announce.h index 857f4706ac..90195351c6 100644 --- a/toxcore/onion_announce.h +++ b/toxcore/onion_announce.h @@ -94,11 +94,12 @@ int create_data_request(const Random *rng, uint8_t *packet, uint16_t max_packet_ * return 0 on success. */ non_null() -int send_announce_request(const Networking_Core *net, const Random *rng, - const Onion_Path *path, const Node_format *dest, - const uint8_t *public_key, const uint8_t *secret_key, - const uint8_t *ping_id, const uint8_t *client_id, - const uint8_t *data_public_key, uint64_t sendback_data); +int send_announce_request( + const Logger *log, const Networking_Core *net, const Random *rng, + const Onion_Path *path, const Node_format *dest, + const uint8_t *public_key, const uint8_t *secret_key, + const uint8_t *ping_id, const uint8_t *client_id, + const uint8_t *data_public_key, uint64_t sendback_data); /** @brief Create and send an onion data request packet. * @@ -117,9 +118,10 @@ int send_announce_request(const Networking_Core *net, const Random *rng, * return 0 on success. */ non_null() -int send_data_request(const Networking_Core *net, const Random *rng, const Onion_Path *path, const IP_Port *dest, - const uint8_t *public_key, const uint8_t *encrypt_public_key, const uint8_t *nonce, - const uint8_t *data, uint16_t length); +int send_data_request( + const Logger *log, const Networking_Core *net, const Random *rng, const Onion_Path *path, const IP_Port *dest, + const uint8_t *public_key, const uint8_t *encrypt_public_key, const uint8_t *nonce, + const uint8_t *data, uint16_t length); typedef int pack_extra_data_cb(void *object, const Logger *logger, const Mono_Time *mono_time, diff --git a/toxcore/onion_client.c b/toxcore/onion_client.c index c15eb55564..2199b0afbf 100644 --- a/toxcore/onion_client.c +++ b/toxcore/onion_client.c @@ -582,6 +582,7 @@ static int new_sendback(Onion_Client *onion_c, uint32_t num, const uint8_t *publ *sendback = ping_array_add(onion_c->announce_ping_array, onion_c->mono_time, onion_c->rng, data, sizeof(data)); if (*sendback == 0) { + LOGGER_TRACE(onion_c->logger, "generating sendback in announce ping array failed"); return -1; } @@ -624,6 +625,7 @@ static int client_send_announce_request(Onion_Client *onion_c, uint32_t num, con const uint8_t *dest_pubkey, const uint8_t *ping_id, uint32_t pathnum) { if (num > onion_c->num_friends) { + LOGGER_TRACE(onion_c->logger, "not sending announce to out of bounds friend %u (num friends: %u)", num, onion_c->num_friends); return -1; } @@ -632,10 +634,12 @@ static int client_send_announce_request(Onion_Client *onion_c, uint32_t num, con if (num == 0) { if (random_path(onion_c, &onion_c->onion_paths_self, pathnum, &path) == -1) { + LOGGER_TRACE(onion_c->logger, "cannot find path to self"); return -1; } } else { if (random_path(onion_c, &onion_c->onion_paths_friends, pathnum, &path) == -1) { + LOGGER_TRACE(onion_c->logger, "cannot find path to friend"); return -1; } } @@ -682,9 +686,13 @@ static int client_send_announce_request(Onion_Client *onion_c, uint32_t num, con } if (len == -1) { + LOGGER_TRACE(onion_c->logger, "failed to create announce request"); return -1; } + Ip_Ntoa ip_str; + LOGGER_TRACE(onion_c->logger, "sending onion packet to %s:%d (%02x, %d bytes)", + net_ip_ntoa(&dest->ip, &ip_str), net_ntohs(dest->port), request[0], len); return send_onion_packet_tcp_udp(onion_c, &path, dest, request, len); } @@ -934,6 +942,8 @@ static int handle_announce_response(void *object, const IP_Port *source, const u Onion_Client *onion_c = (Onion_Client *)object; if (length < ONION_ANNOUNCE_RESPONSE_MIN_SIZE || length > ONION_ANNOUNCE_RESPONSE_MAX_SIZE) { + LOGGER_TRACE(onion_c->logger, "invalid announce response length: %u (min: %u, max: %u)", + length, (unsigned int)ONION_ANNOUNCE_RESPONSE_MIN_SIZE, (unsigned int)ONION_ANNOUNCE_RESPONSE_MAX_SIZE); return 1; } @@ -943,6 +953,8 @@ static int handle_announce_response(void *object, const IP_Port *source, const u const uint32_t num = check_sendback(onion_c, packet + 1, public_key, &ip_port, &path_num); if (num > onion_c->num_friends) { + LOGGER_WARNING(onion_c->logger, "invalid announce response: sendback number wrong or sendback check failed: %lu > %u", + (unsigned long)num, (unsigned int)onion_c->num_friends); return 1; } @@ -957,6 +969,7 @@ static int handle_announce_response(void *object, const IP_Port *source, const u length - (1 + ONION_ANNOUNCE_SENDBACK_DATA_LENGTH + CRYPTO_NONCE_SIZE), plain); } else { if (!onion_c->friends_list[num - 1].is_valid) { + LOGGER_WARNING(onion_c->logger, "friend number %lu is invalid", (unsigned long)(num - 1)); return 1; } @@ -967,12 +980,14 @@ static int handle_announce_response(void *object, const IP_Port *source, const u } if ((uint32_t)len != plain_size) { + LOGGER_WARNING(onion_c->logger, "decrypted size (%lu) is not the expected plain text size (%lu)", (unsigned long)len, (unsigned long)plain_size); return 1; } const uint32_t path_used = set_path_timeouts(onion_c, num, path_num); if (client_add_to_list(onion_c, num, public_key, &ip_port, plain[0], plain + 1, path_used) == -1) { + LOGGER_WARNING(onion_c->logger, "failed to add client to list"); return 1; } @@ -989,10 +1004,12 @@ static int handle_announce_response(void *object, const IP_Port *source, const u plain_size - 2 - ONION_PING_ID_SIZE, false); if (num_nodes < 0) { + LOGGER_WARNING(onion_c->logger, "no nodes to unpack in onion response"); return 1; } if (client_ping_nodes(onion_c, num, nodes, num_nodes, source) == -1) { + LOGGER_WARNING(onion_c->logger, "pinging %d nodes failed", num_nodes); return 1; } } @@ -1011,6 +1028,8 @@ static int handle_announce_response(void *object, const IP_Port *source, const u // TODO(irungentoo): LAN vs non LAN ips?, if we are connected only to LAN, are we offline? onion_c->last_packet_recv = mono_time_get(onion_c->mono_time); + LOGGER_TRACE(onion_c->logger, "onion has received a packet at %llu", + (unsigned long long)onion_c->last_packet_recv); return 0; } @@ -1023,6 +1042,8 @@ static int handle_announce_response_old(void *object, const IP_Port *source, con Onion_Client *onion_c = (Onion_Client *)object; if (length < ONION_ANNOUNCE_RESPONSE_MIN_SIZE || length > ONION_ANNOUNCE_RESPONSE_MAX_SIZE) { + LOGGER_TRACE(onion_c->logger, "invalid announce response length: %u (min: %u, max: %u)", + length, (unsigned int)ONION_ANNOUNCE_RESPONSE_MIN_SIZE, (unsigned int)ONION_ANNOUNCE_RESPONSE_MAX_SIZE); return 1; } @@ -1034,6 +1055,8 @@ static int handle_announce_response_old(void *object, const IP_Port *source, con const uint32_t num = check_sendback(onion_c, packet + 1, public_key, &ip_port, &path_num); if (num > onion_c->num_friends) { + LOGGER_WARNING(onion_c->logger, "invalid announce response: sendback number wrong or sendback check failed: %lu > %u", + (unsigned long)num, (unsigned int)onion_c->num_friends); return 1; } @@ -1047,6 +1070,7 @@ static int handle_announce_response_old(void *object, const IP_Port *source, con length - (1 + ONION_ANNOUNCE_SENDBACK_DATA_LENGTH + CRYPTO_NONCE_SIZE), plain); } else { if (!onion_c->friends_list[num - 1].is_valid) { + LOGGER_WARNING(onion_c->logger, "friend number %lu is invalid", (unsigned long)(num - 1)); return 1; } @@ -1057,12 +1081,14 @@ static int handle_announce_response_old(void *object, const IP_Port *source, con } if ((uint32_t)len != SIZEOF_VLA(plain)) { + LOGGER_WARNING(onion_c->logger, "decrypted size (%lu) is not the expected plain text size (%lu)", (unsigned long)len, (unsigned long)SIZEOF_VLA(plain)); return 1; } const uint32_t path_used = set_path_timeouts(onion_c, num, path_num); if (client_add_to_list(onion_c, num, public_key, &ip_port, plain[0], plain + 1, path_used) == -1) { + LOGGER_WARNING(onion_c->logger, "failed to add client to list"); return 1; } @@ -1071,16 +1097,21 @@ static int handle_announce_response_old(void *object, const IP_Port *source, con const int num_nodes = unpack_nodes(nodes, MAX_SENT_NODES, nullptr, plain + 1 + ONION_PING_ID_SIZE, len_nodes, false); if (num_nodes <= 0) { + LOGGER_WARNING(onion_c->logger, "no nodes to unpack in onion response"); return 1; } if (client_ping_nodes(onion_c, num, nodes, num_nodes, source) == -1) { + LOGGER_WARNING(onion_c->logger, "pinging %d nodes failed", num_nodes); return 1; } } // TODO(irungentoo): LAN vs non LAN ips?, if we are connected only to LAN, are we offline? onion_c->last_packet_recv = mono_time_get(onion_c->mono_time); + LOGGER_TRACE(onion_c->logger, "onion has received a packet at %llu", + (unsigned long long)onion_c->last_packet_recv); + return 0; } @@ -1378,6 +1409,7 @@ static int handle_dht_dhtpk(void *object, const IP_Port *source, const uint8_t * return handle_dhtpk_announce(onion_c, packet, plain, len, userdata); } + /** @brief Send the packets to tell our friends what our DHT public key is. * * if onion_dht_both is 0, use only the onion to send the packet. @@ -1945,9 +1977,23 @@ static void do_announce(Onion_Client *onion_c) return; } - for (unsigned int i = 0; i < (MAX_ONION_CLIENTS_ANNOUNCE / 2); ++i) { + // Don't send announces to the same node twice. If we don't have many nodes, + // the random selection below may have overlaps. This ensures that we deduplicate + // nodes before sending packets to save some bandwidth. + const Node_format *targets[MAX_ONION_CLIENTS_ANNOUNCE / 2]; + unsigned int targets_count = 0; + + for (unsigned int i = 0; i < MAX_ONION_CLIENTS_ANNOUNCE / 2; ++i) { const uint32_t num = random_range_u32(onion_c->rng, num_nodes); - client_send_announce_request(onion_c, 0, &path_nodes[num].ip_port, path_nodes[num].public_key, nullptr, -1); + const Node_format *target = &path_nodes[num]; + + if (!node_list_contains(targets, targets_count, path_nodes[num].public_key)) { + client_send_announce_request(onion_c, 0, &target->ip_port, target->public_key, nullptr, -1); + + targets[targets_count] = target; + ++targets_count; + assert(targets_count <= MAX_ONION_CLIENTS_ANNOUNCE / 2); + } } } } @@ -1959,22 +2005,25 @@ static void do_announce(Onion_Client *onion_c) non_null() static bool onion_isconnected(Onion_Client *onion_c) { - unsigned int num = 0; + unsigned int live = 0; unsigned int announced = 0; if (mono_time_is_timeout(onion_c->mono_time, onion_c->last_packet_recv, ONION_OFFLINE_TIMEOUT)) { + LOGGER_TRACE(onion_c->logger, "onion is NOT connected: last packet received at %llu (timeout=%u)", + (unsigned long long)onion_c->last_packet_recv, ONION_OFFLINE_TIMEOUT); onion_c->last_populated = 0; return false; } if (onion_c->path_nodes_index == 0) { + LOGGER_TRACE(onion_c->logger, "onion is NOT connected: no path nodes available"); onion_c->last_populated = 0; return false; } for (unsigned int i = 0; i < MAX_ONION_CLIENTS_ANNOUNCE; ++i) { if (!onion_node_timed_out(&onion_c->clients_announce_list[i], onion_c->mono_time)) { - ++num; + ++live; if (onion_c->clients_announce_list[i].is_stored != 0) { ++announced; @@ -1990,14 +2039,18 @@ static bool onion_isconnected(Onion_Client *onion_c) /* Consider ourselves online if we are announced to half or more nodes * we are connected to */ - if (num != 0 && announced != 0) { - if ((num / 2) <= announced && (pnodes / 2) <= num) { + if (live != 0 && announced != 0) { + if ((live / 2) <= announced && (pnodes / 2) <= live) { + LOGGER_TRACE(onion_c->logger, "onion is connected: %u live nodes, %u announced, %d path nodes", + live, announced, pnodes); return true; } } onion_c->last_populated = 0; + LOGGER_TRACE(onion_c->logger, "onion is NOT connected: %u live nodes, %u announced, %d path nodes", + live, announced, pnodes); return false; } diff --git a/toxcore/pk_set.c b/toxcore/pk_set.c new file mode 100644 index 0000000000..cc771a25f2 --- /dev/null +++ b/toxcore/pk_set.c @@ -0,0 +1,97 @@ +/* SPDX-License-Identifier: GPL-3.0-or-later + * Copyright © 2023 The TokTok team. + */ +#include "pk_set.h" + +#include + +#include "ccompat.h" +#include "crypto_core.h" + +typedef struct Public_Key_Ptr { + const uint8_t *data; +} Public_Key_Ptr; + +struct Pk_Set { + const Memory *mem; + + Public_Key_Ptr *data; + uint16_t size; + uint16_t capacity; +}; + +Pk_Set *pk_set_new(const Memory *mem, uint16_t initial_capacity) +{ + Pk_Set *pks = (Pk_Set *)mem_alloc(mem, sizeof(Pk_Set)); + + if (pks == nullptr) { + return nullptr; + } + + Public_Key_Ptr *data = (Public_Key_Ptr *)mem_valloc(mem, initial_capacity, sizeof(Public_Key_Ptr)); + + if (data == nullptr) { + mem_delete(mem, pks); + return nullptr; + } + + pks->mem = mem; + + pks->data = data; + pks->size = 0; + pks->capacity = initial_capacity; + + return pks; +} + +void pk_set_free(Pk_Set *pks) +{ + if (pks == nullptr) { + return; + } + + mem_delete(pks->mem, pks->data); + mem_delete(pks->mem, pks); +} + +bool pk_set_add(Pk_Set *pks, const uint8_t *pk) +{ + if (pk_set_contains(pks, pk)) { + return false; + } + + if (pks->size == pks->capacity) { + // If doubling the capacity would grow the array beyond 16 bits, max out at 16 bits. + const uint16_t new_capacity = pks->capacity > UINT16_MAX / 2 ? UINT16_MAX : pks->capacity * 2; + Public_Key_Ptr *new_data = (Public_Key_Ptr *)mem_valloc(pks->mem, new_capacity, sizeof(Public_Key_Ptr)); + + if (new_data == nullptr) { + return false; + } + + for (uint16_t i = 0; i < pks->size; ++i) { + new_data[i] = pks->data[i]; + } + + mem_delete(pks->mem, pks->data); + pks->capacity = new_capacity; + pks->data = new_data; + } + + assert(pks->size + 1 <= pks->capacity); + pks->data[pks->size].data = pk; + ++pks->size; + + return true; +} + +bool pk_set_contains(Pk_Set *pks, const uint8_t *pk) +{ + for (uint16_t i = 0; i < pks->size; ++i) { + if (pk_equal(pks->data[i].data, pk)) { + return true; + } + } + + return false; +} diff --git a/toxcore/pk_set.h b/toxcore/pk_set.h new file mode 100644 index 0000000000..4b94386c6f --- /dev/null +++ b/toxcore/pk_set.h @@ -0,0 +1,34 @@ +/* SPDX-License-Identifier: GPL-3.0-or-later + * Copyright © 2023 The TokTok team. + */ + +/** + * Public Key set. + */ +#ifndef C_TOXCORE_TOXCORE_PK_SET_H +#define C_TOXCORE_TOXCORE_PK_SET_H + +#include +#include +#include + +#include "attributes.h" +#include "mem.h" + +#ifdef __cplusplus +extern "C" { +#endif + +typedef struct Pk_Set Pk_Set; + +non_null() Pk_Set *pk_set_new(const Memory *mem, uint16_t initial_capacity); +nullable(1) void pk_set_free(Pk_Set *pks); + +non_null() bool pk_set_add(Pk_Set *pks, const uint8_t *pk); +non_null() bool pk_set_contains(Pk_Set *pks, const uint8_t *pk); + +#ifdef __cplusplus +} // extern "C" +#endif + +#endif // C_TOXCORE_TOXCORE_PK_SET_H diff --git a/toxcore/shared_key_cache.c b/toxcore/shared_key_cache.c index 4b87945ccb..985fc95e68 100644 --- a/toxcore/shared_key_cache.c +++ b/toxcore/shared_key_cache.c @@ -6,6 +6,7 @@ #include #include +#include #include // memcpy(...) #include "ccompat.h" @@ -24,12 +25,13 @@ struct Shared_Key_Cache { uint64_t timeout; /** After this time (in seconds), a key is erased on the next housekeeping cycle */ const Mono_Time *mono_time; const Memory *mem; + const Logger *log; uint8_t keys_per_slot; }; non_null() -static bool shared_key_is_empty(const Shared_Key *k) { - assert(k != nullptr); +static bool shared_key_is_empty(const Logger *log, const Shared_Key *k) { + LOGGER_ASSERT(log, k != nullptr, "shared key must not be NULL"); /* * Since time can never be 0, we use that to determine if a key slot is empty. * Additionally this allows us to use crypto_memzero and leave the slot in a valid state. @@ -38,12 +40,12 @@ static bool shared_key_is_empty(const Shared_Key *k) { } non_null() -static void shared_key_set_empty(Shared_Key *k) { +static void shared_key_set_empty(const Logger *log, Shared_Key *k) { crypto_memzero(k, sizeof (Shared_Key)); - assert(shared_key_is_empty(k)); + LOGGER_ASSERT(log, shared_key_is_empty(log, k), "shared key must be empty after clearing it"); } -Shared_Key_Cache *shared_key_cache_new(const Mono_Time *mono_time, const Memory *mem, const uint8_t *self_secret_key, uint64_t timeout, uint8_t keys_per_slot) +Shared_Key_Cache *shared_key_cache_new(const Logger *log, const Mono_Time *mono_time, const Memory *mem, const uint8_t *self_secret_key, uint64_t timeout, uint8_t keys_per_slot) { if (mono_time == nullptr || self_secret_key == nullptr || timeout == 0 || keys_per_slot == 0) { return nullptr; @@ -52,7 +54,7 @@ Shared_Key_Cache *shared_key_cache_new(const Mono_Time *mono_time, const Memory // Time must not be zero, since we use that as special value for empty slots if (mono_time_get(mono_time) == 0) { // Fail loudly in debug environments - assert(false); + LOGGER_FATAL(log, "time must not be zero (mono_time not initialised?)"); return nullptr; } @@ -64,6 +66,7 @@ Shared_Key_Cache *shared_key_cache_new(const Mono_Time *mono_time, const Memory res->self_secret_key = self_secret_key; res->mono_time = mono_time; res->mem = mem; + res->log = log; res->keys_per_slot = keys_per_slot; // We take one byte from the public key for each bucket and store keys_per_slot elements there const size_t cache_size = 256 * keys_per_slot; @@ -106,7 +109,7 @@ const uint8_t *shared_key_cache_lookup(Shared_Key_Cache *cache, const uint8_t pu // Perform lookup for(size_t i = 0; i < cache->keys_per_slot; ++i) { - if (shared_key_is_empty(&bucket_start[i])) { + if (shared_key_is_empty(cache->log, &bucket_start[i])) { continue; } @@ -119,13 +122,13 @@ const uint8_t *shared_key_cache_lookup(Shared_Key_Cache *cache, const uint8_t pu // Perform housekeeping for this bucket for (size_t i = 0; i < cache->keys_per_slot; ++i) { - if (shared_key_is_empty(&bucket_start[i])) { + if (shared_key_is_empty(cache->log, &bucket_start[i])) { continue; } const bool timed_out = (bucket_start[i].time_last_requested + cache->timeout) < cur_time; if (timed_out) { - shared_key_set_empty(&bucket_start[i]); + shared_key_set_empty(cache->log, &bucket_start[i]); } } diff --git a/toxcore/shared_key_cache.h b/toxcore/shared_key_cache.h index dc42b38058..b7112720e6 100644 --- a/toxcore/shared_key_cache.h +++ b/toxcore/shared_key_cache.h @@ -8,6 +8,7 @@ #include // uint*_t #include "crypto_core.h" +#include "logger.h" #include "mem.h" #include "mono_time.h" @@ -27,9 +28,10 @@ typedef struct Shared_Key_Cache Shared_Key_Cache; * @return nullptr on error. */ non_null() -Shared_Key_Cache *shared_key_cache_new(const Mono_Time *mono_time, const Memory *mem, - const uint8_t *self_secret_key, - uint64_t timeout, uint8_t keys_per_slot); +Shared_Key_Cache *shared_key_cache_new( + const Logger *log, const Mono_Time *mono_time, const Memory *mem, + const uint8_t *self_secret_key, + uint64_t timeout, uint8_t keys_per_slot); /** * @brief Deletes the cache and frees all resources. diff --git a/toxcore/tox.c b/toxcore/tox.c index 768d5f9efd..05d9401325 100644 --- a/toxcore/tox.c +++ b/toxcore/tox.c @@ -2810,7 +2810,7 @@ uint16_t tox_self_get_udp_port(const Tox *tox, Tox_Err_Get_Port *error) { assert(tox != nullptr); tox_lock(tox); - const uint16_t port = net_htons(net_port(tox->m->net)); + const uint16_t port = tox->m == nullptr || tox->m->net == nullptr ? 0 : net_htons(net_port(tox->m->net)); tox_unlock(tox); if (port == 0) { @@ -2827,7 +2827,7 @@ uint16_t tox_self_get_tcp_port(const Tox *tox, Tox_Err_Get_Port *error) assert(tox != nullptr); tox_lock(tox); - if (tox->m->tcp_server != nullptr) { + if (tox->m != nullptr && tox->m->tcp_server != nullptr) { SET_ERROR_PARAMETER(error, TOX_ERR_GET_PORT_OK); const uint16_t ret = tox->m->options.tcp_server_port; tox_unlock(tox); From 43affd0d10df1104b598f330f7b897d72569456a Mon Sep 17 00:00:00 2001 From: "Restyled.io" Date: Fri, 1 Dec 2023 13:04:34 +0000 Subject: [PATCH 2/3] Restyled by clang-format --- other/docker/esp32/bootstrap/hello_main.cc | 5 +- other/docker/esp32/host_main.cc | 5 +- other/docker/esp32/main/app_main.cc | 24 ++++---- other/docker/esp32/main/tox_main.cc | 67 ++++++++++++++-------- 4 files changed, 58 insertions(+), 43 deletions(-) diff --git a/other/docker/esp32/bootstrap/hello_main.cc b/other/docker/esp32/bootstrap/hello_main.cc index a55acc70b5..c371b479fd 100644 --- a/other/docker/esp32/bootstrap/hello_main.cc +++ b/other/docker/esp32/bootstrap/hello_main.cc @@ -1,7 +1,4 @@ #include // Bootstrap main. Only writes hello world. See ../main/* for the real thing. -extern "C" void app_main(void) -{ - printf("Hello world!\n"); -} +extern "C" void app_main(void) { printf("Hello world!\n"); } diff --git a/other/docker/esp32/host_main.cc b/other/docker/esp32/host_main.cc index f360e7727b..a878d2148a 100644 --- a/other/docker/esp32/host_main.cc +++ b/other/docker/esp32/host_main.cc @@ -1,6 +1,3 @@ #include "main/tox_main.h" -int main() -{ - tox_main(); -} +int main() { tox_main(); } diff --git a/other/docker/esp32/main/app_main.cc b/other/docker/esp32/main/app_main.cc index f56addeef8..1c7f0d85b4 100644 --- a/other/docker/esp32/main/app_main.cc +++ b/other/docker/esp32/main/app_main.cc @@ -1,30 +1,31 @@ -#include -#include - -#include #include +#include #include #include #include +#include +#include #include "tox_main.h" static const char *MAIN_TAG = "app_main"; -static constexpr int NTP_TIMEOUT = 60; // 1 minute +static constexpr int NTP_TIMEOUT = 60; // 1 minute static esp_eth_handle_t eth_handle = nullptr; static esp_netif_t *eth_netif = nullptr; -static void event_handler(void *arg, esp_event_base_t event_base, - int32_t event_id, void *event_data) +static void event_handler( + void *arg, esp_event_base_t event_base, int32_t event_id, void *event_data) { if (event_base == ETH_EVENT) { - if (event_id == ETHERNET_EVENT_START) return; - if (event_id == ETHERNET_EVENT_STOP) return; + if (event_id == ETHERNET_EVENT_START) + return; + if (event_id == ETHERNET_EVENT_STOP) + return; } if (event_base == IP_EVENT) if (event_id == IP_EVENT_ETH_GOT_IP) - return; + return; } static void register_ethernet(void) @@ -44,7 +45,8 @@ static void register_ethernet(void) ESP_ERROR_CHECK(esp_eth_driver_install(&config, ð_handle)); ESP_ERROR_CHECK(esp_netif_attach(eth_netif, esp_eth_new_netif_glue(eth_handle))); ESP_ERROR_CHECK(esp_event_handler_register(ETH_EVENT, ESP_EVENT_ANY_ID, &event_handler, NULL)); - ESP_ERROR_CHECK(esp_event_handler_register(IP_EVENT, IP_EVENT_ETH_GOT_IP, &event_handler, NULL)); + ESP_ERROR_CHECK( + esp_event_handler_register(IP_EVENT, IP_EVENT_ETH_GOT_IP, &event_handler, NULL)); ESP_ERROR_CHECK(esp_eth_start(eth_handle)); } diff --git a/other/docker/esp32/main/tox_main.cc b/other/docker/esp32/main/tox_main.cc index 1c8b85aefa..be6610a420 100644 --- a/other/docker/esp32/main/tox_main.cc +++ b/other/docker/esp32/main/tox_main.cc @@ -1,11 +1,12 @@ #include "../main/tox_main.h" #include -#include #include #include #include +#include + #include "../../../../toxcore/ccompat.h" #include "../../../../toxcore/tox.h" #include "../../../../toxcore/tox_events.h" @@ -13,11 +14,16 @@ static char tox_log_level_name(Tox_Log_Level level) { switch (level) { - case TOX_LOG_LEVEL_TRACE: return 'T'; - case TOX_LOG_LEVEL_DEBUG: return 'D'; - case TOX_LOG_LEVEL_INFO: return 'I'; - case TOX_LOG_LEVEL_WARNING: return 'W'; - case TOX_LOG_LEVEL_ERROR: return 'E'; + case TOX_LOG_LEVEL_TRACE: + return 'T'; + case TOX_LOG_LEVEL_DEBUG: + return 'D'; + case TOX_LOG_LEVEL_INFO: + return 'I'; + case TOX_LOG_LEVEL_WARNING: + return 'W'; + case TOX_LOG_LEVEL_ERROR: + return 'E'; } return '?'; @@ -26,16 +32,26 @@ static char tox_log_level_name(Tox_Log_Level level) static const char *tox_err_new_name(Tox_Err_New err) { switch (err) { - case TOX_ERR_NEW_OK: return "OK"; - case TOX_ERR_NEW_NULL: return "NULL"; - case TOX_ERR_NEW_MALLOC: return "MALLOC"; - case TOX_ERR_NEW_PORT_ALLOC: return "PORT_ALLOC"; - case TOX_ERR_NEW_PROXY_BAD_TYPE: return "PROXY_BAD_TYPE"; - case TOX_ERR_NEW_PROXY_BAD_HOST: return "PROXY_BAD_HOST"; - case TOX_ERR_NEW_PROXY_BAD_PORT: return "PROXY_BAD_PORT"; - case TOX_ERR_NEW_PROXY_NOT_FOUND: return "PROXY_NOT_FOUND"; - case TOX_ERR_NEW_LOAD_ENCRYPTED: return "LOAD_ENCRYPTED"; - case TOX_ERR_NEW_LOAD_BAD_FORMAT: return "LOAD_BAD_FORMAT"; + case TOX_ERR_NEW_OK: + return "OK"; + case TOX_ERR_NEW_NULL: + return "NULL"; + case TOX_ERR_NEW_MALLOC: + return "MALLOC"; + case TOX_ERR_NEW_PORT_ALLOC: + return "PORT_ALLOC"; + case TOX_ERR_NEW_PROXY_BAD_TYPE: + return "PROXY_BAD_TYPE"; + case TOX_ERR_NEW_PROXY_BAD_HOST: + return "PROXY_BAD_HOST"; + case TOX_ERR_NEW_PROXY_BAD_PORT: + return "PROXY_BAD_PORT"; + case TOX_ERR_NEW_PROXY_NOT_FOUND: + return "PROXY_NOT_FOUND"; + case TOX_ERR_NEW_LOAD_ENCRYPTED: + return "LOAD_ENCRYPTED"; + case TOX_ERR_NEW_LOAD_BAD_FORMAT: + return "LOAD_BAD_FORMAT"; } return ""; @@ -44,24 +60,27 @@ static const char *tox_err_new_name(Tox_Err_New err) static const char *color(int index) { switch (index) { - case 0: return "\033[35m"; - case 1: return "\033[36m"; + case 0: + return "\033[35m"; + case 1: + return "\033[36m"; } return "\033[0m"; } static tox_log_cb log_handler; -static void log_handler(Tox *tox, Tox_Log_Level level, const char *file, uint32_t line, const char *func, const char *msg, void *user_data) +static void log_handler(Tox *tox, Tox_Log_Level level, const char *file, uint32_t line, + const char *func, const char *msg, void *user_data) { const int *index = (const int *)user_data; const uint16_t udp_port = tox_self_get_udp_port(tox, nullptr); printf("%s#%d (:%d) [%c] %s:%u(%s): %s\n", color(*index), *index, udp_port, - tox_log_level_name(level), file, (unsigned int)line, func, msg); + tox_log_level_name(level), file, (unsigned int)line, func, msg); } -using Tox_Options_Ptr = std::unique_ptr; -using Tox_Ptr = std::unique_ptr; +using Tox_Options_Ptr = std::unique_ptr; +using Tox_Ptr = std::unique_ptr; void tox_main() { @@ -111,8 +130,8 @@ void tox_main() printf("bootstrapping and connecting 2 toxes\n"); - while (tox_self_get_connection_status(tox1.get()) == TOX_CONNECTION_NONE || - tox_self_get_connection_status(tox0.get()) == TOX_CONNECTION_NONE) { + while (tox_self_get_connection_status(tox1.get()) == TOX_CONNECTION_NONE + || tox_self_get_connection_status(tox0.get()) == TOX_CONNECTION_NONE) { tox_events_free(tox_events_iterate(tox0.get(), true, nullptr)); tox_events_free(tox_events_iterate(tox1.get(), true, nullptr)); From 83010e42e217f389f9f7dc41f9bbadba13257a40 Mon Sep 17 00:00:00 2001 From: "Restyled.io" Date: Fri, 1 Dec 2023 13:04:37 +0000 Subject: [PATCH 3/3] Restyled by shfmt --- other/docker/esp32/qemu-test | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/other/docker/esp32/qemu-test b/other/docker/esp32/qemu-test index eac608f2d1..27e4b2f87b 100755 --- a/other/docker/esp32/qemu-test +++ b/other/docker/esp32/qemu-test @@ -8,10 +8,10 @@ qemu-system-xtensa \ -m 4 \ -drive file=flash.bin,if=mtd,format=raw \ -nic user,model=open_eth,hostfwd=tcp::80-:80 \ - -s \ - | tee qemu.log & + -s | + tee qemu.log & echo "Waiting for program to complete" -while ! grep 'Returned from app_main' qemu.log > /dev/null; do +while ! grep 'Returned from app_main' qemu.log >/dev/null; do sleep 1 done