diff --git a/get-started/csi_recv_router/main/CMakeLists.txt b/get-started/csi_recv_router/main/CMakeLists.txt index e03523a..a941e22 100644 --- a/get-started/csi_recv_router/main/CMakeLists.txt +++ b/get-started/csi_recv_router/main/CMakeLists.txt @@ -1,3 +1,2 @@ idf_component_register(SRC_DIRS "." - INCLUDE_DIRS "." - REQUIRES mbedtls) + INCLUDE_DIRS ".") diff --git a/get-started/csi_recv_router/main/app_main.c b/get-started/csi_recv_router/main/app_main.c index ad9b00d..ed11865 100644 --- a/get-started/csi_recv_router/main/app_main.c +++ b/get-started/csi_recv_router/main/app_main.c @@ -149,6 +149,19 @@ static uint16_t s_target_port; /* runtime target port */ static char s_hostname[32]; /* runtime hostname (NVS or Kconfig default) */ static char s_auth_secret[65] = ""; /* empty = auth disabled */ +/* Deauth flood detection */ +#define FLOOD_WINDOW_DEFAULT 10 +#define FLOOD_THRESH_DEFAULT 5 +#define FLOOD_RING_SIZE 64 + +static int s_flood_thresh = FLOOD_THRESH_DEFAULT; +static int s_flood_window_s = FLOOD_WINDOW_DEFAULT; +static bool s_flood_active = false; +static int64_t s_flood_alert_ts = 0; +static struct { int64_t ts; } s_deauth_ring[FLOOD_RING_SIZE]; +static int s_deauth_ring_head = 0; +static int s_deauth_ring_count = 0; + /* --- NVS helpers --- */ static void config_load_nvs(void) @@ -824,19 +837,6 @@ typedef struct { uint16_t seq_ctrl; } __attribute__((packed)) wifi_ieee80211_mac_hdr_t; -/* Deauth flood detection */ -#define FLOOD_WINDOW_DEFAULT 10 -#define FLOOD_THRESH_DEFAULT 5 -#define FLOOD_RING_SIZE 64 - -static int s_flood_thresh = FLOOD_THRESH_DEFAULT; -static int s_flood_window_s = FLOOD_WINDOW_DEFAULT; -static bool s_flood_active = false; -static int64_t s_flood_alert_ts = 0; -static struct { int64_t ts; } s_deauth_ring[FLOOD_RING_SIZE]; -static int s_deauth_ring_head = 0; -static int s_deauth_ring_count = 0; - /* Probe request deduplication: report each MAC at most once per N seconds */ #define PROBE_DEDUP_SIZE 32 #define PROBE_DEDUP_DEFAULT_US 10000000LL