1 // Copyright 2020 Espressif Systems (Shanghai) PTE LTD 2 // 3 // Licensed under the Apache License, Version 2.0 (the "License"); 4 // you may not use this file except in compliance with the License. 5 // You may obtain a copy of the License at 6 7 // http://www.apache.org/licenses/LICENSE-2.0 8 // 9 // Unless required by applicable law or agreed to in writing, software 10 // distributed under the License is distributed on an "AS IS" BASIS, 11 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 // See the License for the specific language governing permissions and 13 // limitations under the License. 14 15 #ifndef _LWIP_DEFAULT_HOOKS_H_ 16 #define _LWIP_DEFAULT_HOOKS_H_ 17 #include "lwip/ip_addr.h" 18 #include "lwip/arch.h" 19 #include "lwip/err.h" 20 21 #ifdef ESP_IDF_LWIP_HOOK_FILENAME 22 #include ESP_IDF_LWIP_HOOK_FILENAME 23 #endif 24 25 #ifdef __cplusplus 26 extern "C" { 27 #endif 28 29 #ifdef CONFIG_LWIP_HOOK_TCP_ISN_DEFAULT 30 void lwip_init_tcp_isn(u32_t boot_time, const u8_t *secret_16_bytes); 31 #endif 32 #if defined(CONFIG_LWIP_HOOK_TCP_ISN_CUSTOM) || defined(CONFIG_LWIP_HOOK_TCP_ISN_DEFAULT) 33 u32_t lwip_hook_tcp_isn(const ip_addr_t *local_ip, u16_t local_port, 34 const ip_addr_t *remote_ip, u16_t remote_port); 35 #define LWIP_HOOK_TCP_ISN lwip_hook_tcp_isn 36 #endif /* CONFIG_LWIP_HOOK_TCP_ISN... */ 37 38 #if defined(CONFIG_LWIP_HOOK_IP6_ROUTE_CUSTOM) || defined(CONFIG_LWIP_HOOK_IP6_ROUTE_DEFAULT) 39 struct netif * 40 lwip_hook_ip6_route(const ip6_addr_t *src, const ip6_addr_t *dest); 41 42 #define LWIP_HOOK_IP6_ROUTE lwip_hook_ip6_route 43 #endif /* CONFIG_LWIP_HOOK_IP6_ROUTE... */ 44 45 #if defined(CONFIG_LWIP_HOOK_ND6_GET_GW_CUSTOM) || defined(CONFIG_LWIP_HOOK_ND6_GET_GW_DEFAULT) 46 const ip6_addr_t *lwip_hook_nd6_get_gw(struct netif *netif, const ip6_addr_t *dest); 47 48 #define LWIP_HOOK_ND6_GET_GW lwip_hook_nd6_get_gw 49 #endif /* CONFIG_LWIP_HOOK_ND6_GET_GATEWAY... */ 50 51 #if defined(CONFIG_LWIP_HOOK_NETCONN_EXT_RESOLVE_CUSTOM) || defined(CONFIG_LWIP_HOOK_NETCONN_EXT_RESOLVE_DEFAULT) 52 int lwip_hook_netconn_external_resolve(const char *name, ip_addr_t *addr, u8_t addrtype, err_t *err); 53 54 #define LWIP_HOOK_NETCONN_EXTERNAL_RESOLVE lwip_hook_netconn_external_resolve 55 #endif /* CONFIG_LWIP_HOOK_NETCONN_EXTERNAL_RESOLVE... */ 56 57 #ifdef __cplusplus 58 } 59 #endif 60 61 #endif /* _LWIP_DEFAULT_HOOKS_H_ */ 62