From 2d36e41641ae8a05e22b6874398df852cb512b2a Mon Sep 17 00:00:00 2001 From: Florian Hoss Date: Mon, 25 Jul 2022 15:48:30 +0200 Subject: [PATCH] Working hook in platformio.ini --- ESPFirewall/lib/Firewall/docs/firewall/firewall.tex | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/ESPFirewall/lib/Firewall/docs/firewall/firewall.tex b/ESPFirewall/lib/Firewall/docs/firewall/firewall.tex index 62f4130..0b3df8a 100644 --- a/ESPFirewall/lib/Firewall/docs/firewall/firewall.tex +++ b/ESPFirewall/lib/Firewall/docs/firewall/firewall.tex @@ -116,4 +116,11 @@ Looking at the printed protocols this means 6 == "TCP" and 17 == "UDP". After learning the protocols that need to be filtered and looked out for, a hook needs to be registered in order to filter the packets based on our rules. +To register a hook \verb|LWIP_HOOK_IP4_INPUT| needs to be set as \verb|build_flag| in the \verb|platformio.ini| file to overwrite it in LwIP. This is an easy way of testing if it works as expected, but should be written in a function for any other use-case. + +\begin{verbatim} +build_flags = + '-DLWIP_HOOK_IP4_INPUT(pbuf, input_netif)=({ESP_LOGI("HOOK","TEST");0;})' +\end{verbatim} + \subsection{Benchmark}