feat: per-client bandwidth limiting with daily quota rollover - #256
Open
HakimiDev wants to merge 4 commits into
Open
feat: per-client bandwidth limiting with daily quota rollover#256HakimiDev wants to merge 4 commits into
HakimiDev wants to merge 4 commits into
Conversation
New ESP-IDF component implementing: - Token-bucket rate limiting per client (upload/download) - Daily usage tracking with automatic midnight reset via SNTP - Daily data cap with automatic blocking when exceeded - Unused quota rolls over to next day (capped at 1x daily cap) - NVS persistence for limits and accumulated usage - Background FreeRTOS task for daily reset and periodic NVS flush - Thread-safe: non-blocking mutex in hot path (1-tick timeout) - Max 8 concurrent clients tracked simultaneously Signed-off-by: HakimiDev <hakimideveloper@gmail.com>
- bw_check_upload() in ap_netif_input_hook (client -> Internet) - bw_check_download() in ap_netif_linkoutput_hook (Internet -> client) - bw_init() called on WIFI_EVENT_AP_START - Non-blocking: allows packet through if mutex unavailable Signed-off-by: HakimiDev <hakimideveloper@gmail.com>
- set_bw: set per-client upload/download rate limits and daily cap - show_bw: display all configured limits and current usage - clear_bw: remove all bandwidth entries Signed-off-by: HakimiDev <hakimideveloper@gmail.com>
- Bandwidth limits form on /mappings (set/remove per-client limits) - Usage table showing: MAC, upload/download limits, daily cap, rollover quota, actual usage, and blocked/active status - Rollover column displays carried-over unused quota Signed-off-by: HakimiDev <hakimideveloper@gmail.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds per-client bandwidth management to the ESP32 NAT Router.
Changes