lwip: Added support for configurable LwIP hooks

Added lwIP hooks which could be optionally overwritten in the
application code. These three options are provided in Kconfig:
* NONE: No hook support
* DEFAULT: Default implementation is provided. If IDF doesn't
have a specific hook implementation, an empty stub is provided, which
could be overwritten by strong implementation in application code.
* CUSTOM: Hooks are declared only to be implemented in application code.

Merges https://github.com/espressif/esp-idf/pull/6034
This commit is contained in:
Paweł pidpawel Kozubal
2020-10-22 19:41:15 +02:00
committed by bot
parent fc08ff8162
commit cf60ec0ffc
9 changed files with 170 additions and 86 deletions

View File

@@ -420,17 +420,6 @@
*/
#define LWIP_TCP_RTO_TIME CONFIG_LWIP_TCP_RTO_TIME
/**
* Set TCP hook for Initial Sequence Number (ISN)
*/
#ifdef CONFIG_LWIP_TCP_ISN_HOOK
#include <lwip/arch.h>
struct ip_addr;
u32_t lwip_hook_tcp_isn(const struct ip_addr *local_ip, u16_t local_port,
const struct ip_addr *remote_ip, u16_t remote_port);
#define LWIP_HOOK_TCP_ISN lwip_hook_tcp_isn
#endif
/*
----------------------------------
---------- Pbuf options ----------
@@ -778,7 +767,9 @@ u32_t lwip_hook_tcp_isn(const struct ip_addr *local_ip, u16_t local_port,
---------- Hook options ---------------
---------------------------------------
*/
#define LWIP_HOOK_FILENAME "lwip_default_hooks.h"
#define LWIP_HOOK_IP4_ROUTE_SRC ip4_route_src_hook
/*
---------------------------------------
---------- Debugging options ----------