STTNet
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
Public Attributes | List of all members
stt::security::RateState Struct Reference

Runtime state for one limiter key (reused by multiple strategies). More...

#include <sttnet_English.h>

Public Attributes

int counter = 0
 
int violations = 0
 
std::chrono::steady_clock::time_point lastTime {}
 
std::deque
< std::chrono::steady_clock::time_point > 
history
 
double tokens = 0.0
 
std::chrono::steady_clock::time_point lastRefill {}
 

Detailed Description

Runtime state for one limiter key (reused by multiple strategies).

Stores the live state for one limiting dimension (IP / fd / path, etc.). Different algorithms reuse different fields:

Note
  • violations counts how many times requests were rejected. This is useful for defense escalation (DROP / CLOSE / temporary ban).
  • RateState does NOT make decisions. It only stores state.

Member Data Documentation

int stt::security::RateState::counter = 0
std::deque<std::chrono::steady_clock::time_point> stt::security::RateState::history
std::chrono::steady_clock::time_point stt::security::RateState::lastRefill {}
std::chrono::steady_clock::time_point stt::security::RateState::lastTime {}
double stt::security::RateState::tokens = 0.0
int stt::security::RateState::violations = 0

The documentation for this struct was generated from the following file: