upleb.uk

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

summaryrefslogtreecommitdiff
path: root/main/firewall.h
diff options
context:
space:
mode:
authorYour Name <you@example.com>2026-05-16 04:46:32 +0530
committerYour Name <you@example.com>2026-05-16 04:46:32 +0530
commit50b5975ac8793d6d820c35b5999f8a909f64e71b (patch)
tree2592f9e7a671af2aca56e46887e50b8ad8e418b6 /main/firewall.h
parent3f46bb83cb1041889034c88adce1895dd330793f (diff)
Captive portal detection fix + Phase 2 tests 16-18,20 passing (17/17)
- Add DoT reject server on port 853 (TCP RST forces DNS-over-TLS fallback) - DNS hijack returns NXDOMAIN for all non-A query types (no forwarding for unauthed) - Shorter TTL on hijack responses (10s) for faster captive detection - Explicit 302 redirect handlers for /generate_204, /hotspot-detect.html, etc. - HTTP and DNS request logging for debugging captive detection - Per-MAC tracking in firewall (find_by_mac, get_mac_for_ip with ARP fallback) - Session MAC tracking (session_find_by_mac) - Phase 2 test 18: add route through TollGate before ping test - All 17 Phase 2 tests pass (15-21 + whoami + portal form)
Diffstat (limited to 'main/firewall.h')
-rw-r--r--main/firewall.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/main/firewall.h b/main/firewall.h
index 91a89b0..e5d492a 100644
--- a/main/firewall.h
+++ b/main/firewall.h
@@ -6,6 +6,8 @@
6#include <stdbool.h> 6#include <stdbool.h>
7#include <stdint.h> 7#include <stdint.h>
8 8
9#define FW_MAX_MAC_LEN 18
10
9esp_err_t firewall_init(esp_ip4_addr_t ap_ip); 11esp_err_t firewall_init(esp_ip4_addr_t ap_ip);
10void firewall_enable_nat(void); 12void firewall_enable_nat(void);
11void firewall_disable_nat(void); 13void firewall_disable_nat(void);
@@ -13,6 +15,9 @@ void firewall_grant_access(uint32_t client_ip);
13void firewall_revoke_access(uint32_t client_ip); 15void firewall_revoke_access(uint32_t client_ip);
14void firewall_revoke_all(void); 16void firewall_revoke_all(void);
15bool firewall_is_client_allowed(uint32_t client_ip); 17bool firewall_is_client_allowed(uint32_t client_ip);
18bool firewall_is_mac_allowed(const char *mac);
16int firewall_client_count(void); 19int firewall_client_count(void);
17 20
21esp_err_t firewall_get_mac_for_ip(uint32_t client_ip, char *mac_out, size_t mac_out_size);
22
18#endif 23#endif