mirror of
https://github.com/espressif/esp-idf.git
synced 2025-08-01 19:54:32 +02:00
lwip: add a hook for ip6 source address selection
This commit is contained in:
@@ -1024,6 +1024,26 @@ menu "LWIP"
|
|||||||
|
|
||||||
endchoice
|
endchoice
|
||||||
|
|
||||||
|
choice LWIP_HOOK_IP6_SELECT_SRC_ADDR
|
||||||
|
prompt "IPv6 source address selection Hook"
|
||||||
|
depends on LWIP_IPV6
|
||||||
|
default LWIP_HOOK_IP6_SELECT_SRC_ADDR_NONE
|
||||||
|
help
|
||||||
|
Enables custom IPv6 source address selection.
|
||||||
|
Setting this to "default" provides weak implementation
|
||||||
|
stub that could be overwritten in application code.
|
||||||
|
Setting this to "custom" provides hook's declaration
|
||||||
|
only and expects the application to implement it.
|
||||||
|
|
||||||
|
config LWIP_HOOK_IP6_SELECT_SRC_ADDR_NONE
|
||||||
|
bool "No hook declared"
|
||||||
|
config LWIP_HOOK_IP6_SELECT_SRC_ADDR_DEFAULT
|
||||||
|
bool "Default (weak) implementation"
|
||||||
|
config LWIP_HOOK_IP6_SELECT_SRC_ADDR_CUSTOM
|
||||||
|
bool "Custom implementation"
|
||||||
|
|
||||||
|
endchoice
|
||||||
|
|
||||||
choice LWIP_HOOK_NETCONN_EXTERNAL_RESOLVE
|
choice LWIP_HOOK_NETCONN_EXTERNAL_RESOLVE
|
||||||
prompt "Netconn external resolve Hook"
|
prompt "Netconn external resolve Hook"
|
||||||
default LWIP_HOOK_NETCONN_EXT_RESOLVE_DEFAULT if OPENTHREAD_DNS64_CLIENT
|
default LWIP_HOOK_NETCONN_EXT_RESOLVE_DEFAULT if OPENTHREAD_DNS64_CLIENT
|
||||||
|
Submodule components/lwip/lwip updated: dafc822531...57c29648ff
@@ -41,7 +41,17 @@ const ip6_addr_t *__weak lwip_hook_nd6_get_gw(struct netif *netif, const ip6_add
|
|||||||
LWIP_UNUSED_ARG(netif);
|
LWIP_UNUSED_ARG(netif);
|
||||||
LWIP_UNUSED_ARG(dest);
|
LWIP_UNUSED_ARG(dest);
|
||||||
|
|
||||||
return 0;
|
return NULL;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifdef CONFIG_LWIP_HOOK_IP6_SELECT_SRC_ADDR_DEFAULT
|
||||||
|
const ip_addr_t *__weak lwip_hook_ip6_select_source_address(struct netif *netif, const ip6_addr_t *dest)
|
||||||
|
{
|
||||||
|
LWIP_UNUSED_ARG(netif);
|
||||||
|
LWIP_UNUSED_ARG(dest);
|
||||||
|
|
||||||
|
return NULL;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@@ -43,6 +43,12 @@ const ip6_addr_t *lwip_hook_nd6_get_gw(struct netif *netif, const ip6_addr_t *de
|
|||||||
#define LWIP_HOOK_ND6_GET_GW lwip_hook_nd6_get_gw
|
#define LWIP_HOOK_ND6_GET_GW lwip_hook_nd6_get_gw
|
||||||
#endif /* CONFIG_LWIP_HOOK_ND6_GET_GATEWAY... */
|
#endif /* CONFIG_LWIP_HOOK_ND6_GET_GATEWAY... */
|
||||||
|
|
||||||
|
#if defined(CONFIG_LWIP_HOOK_IP6_SELECT_SRC_ADDR_CUSTOM) || defined(CONFIG_LWIP_HOOK_IP6_SELECT_SRC_ADDR_DEFAULT)
|
||||||
|
const ip_addr_t *lwip_hook_ip6_select_source_address(struct netif *netif, const ip6_addr_t *dest);
|
||||||
|
|
||||||
|
#define LWIP_HOOK_IP6_SELECT_SRC_ADDR lwip_hook_ip6_select_source_address
|
||||||
|
#endif /* CONFIG_LWIP_HOOK_IP6_SELECT_SRC_ADDR... */
|
||||||
|
|
||||||
#if defined(CONFIG_LWIP_HOOK_NETCONN_EXT_RESOLVE_CUSTOM) || defined(CONFIG_LWIP_HOOK_NETCONN_EXT_RESOLVE_DEFAULT)
|
#if defined(CONFIG_LWIP_HOOK_NETCONN_EXT_RESOLVE_CUSTOM) || defined(CONFIG_LWIP_HOOK_NETCONN_EXT_RESOLVE_DEFAULT)
|
||||||
int lwip_hook_netconn_external_resolve(const char *name, ip_addr_t *addr, u8_t addrtype, err_t *err);
|
int lwip_hook_netconn_external_resolve(const char *name, ip_addr_t *addr, u8_t addrtype, err_t *err);
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user