diff options
| author | Your Name <you@example.com> | 2026-05-16 04:46:32 +0530 |
|---|---|---|
| committer | Your Name <you@example.com> | 2026-05-16 04:46:32 +0530 |
| commit | 50b5975ac8793d6d820c35b5999f8a909f64e71b (patch) | |
| tree | 2592f9e7a671af2aca56e46887e50b8ad8e418b6 /main/firewall.h | |
| parent | 3f46bb83cb1041889034c88adce1895dd330793f (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.h | 5 |
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 | |||
| 9 | esp_err_t firewall_init(esp_ip4_addr_t ap_ip); | 11 | esp_err_t firewall_init(esp_ip4_addr_t ap_ip); |
| 10 | void firewall_enable_nat(void); | 12 | void firewall_enable_nat(void); |
| 11 | void firewall_disable_nat(void); | 13 | void firewall_disable_nat(void); |
| @@ -13,6 +15,9 @@ void firewall_grant_access(uint32_t client_ip); | |||
| 13 | void firewall_revoke_access(uint32_t client_ip); | 15 | void firewall_revoke_access(uint32_t client_ip); |
| 14 | void firewall_revoke_all(void); | 16 | void firewall_revoke_all(void); |
| 15 | bool firewall_is_client_allowed(uint32_t client_ip); | 17 | bool firewall_is_client_allowed(uint32_t client_ip); |
| 18 | bool firewall_is_mac_allowed(const char *mac); | ||
| 16 | int firewall_client_count(void); | 19 | int firewall_client_count(void); |
| 17 | 20 | ||
| 21 | esp_err_t firewall_get_mac_for_ip(uint32_t client_ip, char *mac_out, size_t mac_out_size); | ||
| 22 | |||
| 18 | #endif | 23 | #endif |