Skip to content

Commit

Permalink
feat(esp_netif): Add support for esp_netif with custom TCP/IP stack
Browse files Browse the repository at this point in the history
Added a new Kconfig option ESP_NETIF_PROVIDE_CUSTOM_IMPLEMENTATION which
uses only esp_netif headers, no implementation is provided and expected
to be supplied by application layer.
  • Loading branch information
david-cermak committed Aug 23, 2024
1 parent 74dc204 commit 049f6f6
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 1 deletion.
9 changes: 9 additions & 0 deletions components/esp_netif/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,18 @@ menu "ESP NETIF Adapter"
the timer expires. The IP lost timer is stopped if the station get the IP again before
the timer expires.

config ESP_NETIF_PROVIDE_CUSTOM_IMPLEMENTATION
bool "Use only ESP-NETIF headers"
default n
help
No implementation of ESP-NETIF functions is provided.
This option is used for adding a custom TCP/IP stack and defining related
esp_netif functionality

choice ESP_NETIF_USE_TCPIP_STACK_LIB
prompt "TCP/IP Stack Library"
default ESP_NETIF_TCPIP_LWIP
depends on !ESP_NETIF_PROVIDE_CUSTOM_IMPLEMENTATION
help
Choose the TCP/IP Stack to work, for example, LwIP, uIP, etc.
config ESP_NETIF_TCPIP_LWIP
Expand Down
17 changes: 16 additions & 1 deletion components/esp_netif/loopback/esp_netif_loopback.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* SPDX-FileCopyrightText: 2015-2022 Espressif Systems (Shanghai) CO LTD
* SPDX-FileCopyrightText: 2015-2024 Espressif Systems (Shanghai) CO LTD
*
* SPDX-License-Identifier: Apache-2.0
*/
Expand Down Expand Up @@ -465,4 +465,19 @@ esp_err_t esp_netif_remove_ip6_address(esp_netif_t *esp_netif, const esp_ip6_add
return ESP_ERR_NOT_SUPPORTED;
}

int esp_netif_get_all_ip6(esp_netif_t *esp_netif, esp_ip6_addr_t if_ip6[])
{
return 0;
}

esp_ip6_addr_type_t esp_netif_ip6_get_addr_type(esp_ip6_addr_t* ip6_addr)
{
return ESP_IP6_ADDR_IS_UNKNOWN;
}

esp_err_t esp_netif_tcpip_exec(esp_netif_callback_fn fn, void*ctx)
{
return fn(ctx);
}

#endif /* CONFIG_ESP_NETIF_LOOPBACK */

0 comments on commit 049f6f6

Please sign in to comment.