/* * rt_attack.h * Mutual exclusion for offensive operations. * * Only one attack (deauth, beacon, karma, capture) can run at a time. * Each attack calls rt_attack_start() before launching its task and * rt_attack_stop() when it finishes or is aborted. */ #pragma once #include #include "esp_err.h" #ifdef __cplusplus extern "C" { #endif typedef enum { RT_ATTACK_NONE = 0, RT_ATTACK_DEAUTH, RT_ATTACK_BEACON, RT_ATTACK_KARMA, RT_ATTACK_CAPTURE, } rt_attack_type_t; /* Initialise the attack manager (call once, idempotent). */ void rt_attack_init(void); /* * Try to start an attack. Returns ESP_OK if acquired, or * ESP_ERR_INVALID_STATE if another attack is already running. */ esp_err_t rt_attack_start(rt_attack_type_t type); /* Release the attack lock (call from the stopping attack). */ void rt_attack_stop(void); /* Current attack type (NONE if idle). */ rt_attack_type_t rt_attack_current(void); /* Human-readable name for the current attack. */ const char *rt_attack_name(void); /* True if any attack is in progress. */ bool rt_attack_is_active(void); #ifdef __cplusplus } #endif