Stun Server
Compliant with the latest RFCs including 5389, 5769, and 5780
discover the local host's own external IP address
|
#include <ratelimiter.h>
Public Member Functions | |
bool | RateCheck (const CSocketAddress &addr) |
RateLimiter (size_t tablesize, bool isUsingLock) | |
virtual | ~RateLimiter () |
Static Public Attributes | |
static const uint64_t | MAX_RATE = 3600 |
static const uint64_t | MIN_COUNT_FOR_CONSIDERATION = 60 |
static const time_t | RESET_INTERVAL_SECONDS = 120 |
static const time_t | PENALTY_TIME_SECONDS = 3600 |
Protected Member Functions | |
virtual time_t | get_time () |
uint64_t | get_rate (const RateTracker *pRT) |
bool | RateCheckImpl (const CSocketAddress &addr) |
Protected Attributes | |
FastHashDynamic< RateTrackerAddress, RateTracker > | _table |
bool | _isUsingLock |
pthread_mutex_t | _mutex |
Definition at line 41 of file ratelimiter.h.
RateLimiter::RateLimiter | ( | size_t | tablesize, |
bool | isUsingLock | ||
) |
Definition at line 7 of file ratelimiter.cpp.
|
virtual |
Definition at line 14 of file ratelimiter.cpp.
|
protected |
Definition at line 25 of file ratelimiter.cpp.
|
protectedvirtual |
Reimplemented in RateLimiterMockTime.
Definition at line 20 of file ratelimiter.cpp.
bool RateLimiter::RateCheck | ( | const CSocketAddress & | addr | ) |
Definition at line 44 of file ratelimiter.cpp.
|
protected |
Definition at line 62 of file ratelimiter.cpp.
|
protected |
Definition at line 50 of file ratelimiter.h.
|
protected |
Definition at line 52 of file ratelimiter.h.
|
protected |
Definition at line 48 of file ratelimiter.h.
|
static |
Definition at line 58 of file ratelimiter.h.
|
static |
Definition at line 59 of file ratelimiter.h.
|
static |
Definition at line 61 of file ratelimiter.h.
|
static |
Definition at line 60 of file ratelimiter.h.