upleb.uk

Public git repos — served from a NIP-34 GRASP relay at git.upleb.uk

summaryrefslogtreecommitdiff
path: root/main/lwip_tollgate_hooks.h
diff options
context:
space:
mode:
authorYour Name <you@example.com>2026-05-17 16:39:31 +0530
committerYour Name <you@example.com>2026-05-17 16:39:31 +0530
commit0c2c67b463d6a90aaa0bb69bf3c91dba1d9ec3ec (patch)
treeafd9d9bca2d184825ebf7413ec31830e14131030 /main/lwip_tollgate_hooks.h
parent3342c8e7b4f645c75470d3d893d09037a672cfd2 (diff)
feat: per-client NAT filtering via LWIP_HOOK_IP4_CANFORWARD
- Add lwip_tollgate_hooks.h defining LWIP_HOOK_IP4_CANFORWARD macro - Inject hook into lwIP build via CMakeLists.txt ESP_IDF_LWIP_HOOK_FILENAME - Filter forwarded packets by source IP against firewall allowed list - Only filter packets from AP subnet (10.192.45.0/24), allow all others - Fix byte order bug: use network byte order for firewall_is_client_allowed - NAT always enabled, removed global NAT toggle functions - Remove spent-secret tracking from session.c (mint is authority) - Remove unused get_ap_netif() function - Reduce API server stack from 32KB to 16KB (fixes ESP_ERR_HTTPD_TASK) - Add esp_random.h stub for unit tests - All 186 unit tests passing - Verified on hardware: block->pay->allow->revoke->block E2E works
Diffstat (limited to 'main/lwip_tollgate_hooks.h')
-rw-r--r--main/lwip_tollgate_hooks.h10
1 files changed, 10 insertions, 0 deletions
diff --git a/main/lwip_tollgate_hooks.h b/main/lwip_tollgate_hooks.h
new file mode 100644
index 0000000..76017be
--- /dev/null
+++ b/main/lwip_tollgate_hooks.h
@@ -0,0 +1,10 @@
1#ifndef LWIP_TOLLGATE_HOOKS_H
2#define LWIP_TOLLGATE_HOOKS_H
3
4#include "lwip/pbuf.h"
5
6int tollgate_ip4_canforward_filter(struct pbuf *p, u32_t dest_addr_hostorder);
7
8#define LWIP_HOOK_IP4_CANFORWARD(p, addr) tollgate_ip4_canforward_filter(p, addr)
9
10#endif