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

Add hooks to ip4 and ip6 output functions #75

Open
3 tasks done
tp-qomodo opened this issue Feb 6, 2025 · 0 comments
Open
3 tasks done

Add hooks to ip4 and ip6 output functions #75

tp-qomodo opened this issue Feb 6, 2025 · 0 comments

Comments

@tp-qomodo
Copy link

Checklist

  • Checked the issue tracker for similar issues to ensure this is not a duplicate.
  • Described the feature in detail and justified the reason for the request.
  • Provided specific use cases and examples.

Feature description

In LWIP there is currently hooks for the ip(x)_input functions which allow the app developer to view when packets are received and potentially filter them if required. I would like to propose an equivalent for the ip(x)_output functions so that an application developer is also able to view the packets that have been sent out, as well as potentially drop them before transmission.

Use cases

  • Monitoring of network traffic produced by the device.
  • Preventing unwanted outbound traffic.

Alternatives

No response

Additional context

An example solution for ip4 in ip4.c:1057 (in ip4_output_if_opt_src() - depending on project config)

#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

The user could then use ESP_IDF_LWIP_HOOK_FILENAME to include the definition of this macro.

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant