Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

example/test implementation of ip4_output hooks #76

Draft
wants to merge 1 commit into
base: 2.2.0-esp
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions src/core/ipv4/ip4.c
Original file line number Diff line number Diff line change
Expand Up @@ -1057,6 +1057,14 @@ ip4_output_if_opt_src(struct pbuf *p, const ip4_addr_t *src, const ip4_addr_t *d
LWIP_DEBUGF(IP_DEBUG, ("ip4_output_if: %c%c%"U16_F"\n", netif->name[0], netif->name[1], (u16_t)netif->num));
ip4_debug_print(p);

#ifdef LWIP_HOOK_IP4_OUTPUT
err_t err = ERR_OK;
if ((err = LWIP_HOOK_IP4_OUTPUT(p, src, dest, ttl, tos, proto, netif, ip_options, optlen)) != ERR_OK)
{
return err;
}
#endif

#if ENABLE_LOOPBACK
#if ESP_LWIP && IP_NAPT
/* doesn't work for external wifi interfaces */
Expand Down
8 changes: 8 additions & 0 deletions src/core/ipv6/ip6.c
Original file line number Diff line number Diff line change
Expand Up @@ -1243,6 +1243,14 @@ ip6_output_if_src(struct pbuf *p, const ip6_addr_t *src, const ip6_addr_t *dest,
LWIP_DEBUGF(IP6_DEBUG, ("ip6_output_if: %c%c%"U16_F"\n", netif->name[0], netif->name[1], (u16_t)netif->num));
ip6_debug_print(p);

#ifdef LWIP_HOOK_IP6_OUTPUT
err_t err = ERR_OK;
if ((err = LWIP_HOOK_IP6_OUTPUT(p, src, dest, hl, tc, nexth, netif)) != ERR_OK)
{
return err;
}
#endif

#if ENABLE_LOOPBACK
{
int i;
Expand Down