summaryrefslogtreecommitdiff
path: root/src/server/server.h
diff options
context:
space:
mode:
authorTim Angus <tim@ngus.net>2013-06-10 20:30:48 +0100
committerTim Angus <tim@ngus.net>2014-06-17 17:43:32 +0100
commitfd7072f74ce183c840dd65d8983dfa159374c7c0 (patch)
tree1c7cbe5bdda98a8d752bac9460ed2ea8e30bb848 /src/server/server.h
parent92844d4646be3fa958e5d9e1ce2ff4b282018b20 (diff)
Rate limit getchallenge
Diffstat (limited to 'src/server/server.h')
-rw-r--r--src/server/server.h22
1 files changed, 22 insertions, 0 deletions
diff --git a/src/server/server.h b/src/server/server.h
index f562a245..2989eb4e 100644
--- a/src/server/server.h
+++ b/src/server/server.h
@@ -290,6 +290,28 @@ extern cvar_t *sv_voip;
//
// sv_main.c
//
+typedef struct leakyBucket_s leakyBucket_t;
+struct leakyBucket_s {
+ netadrtype_t type;
+
+ union {
+ byte _4[4];
+ byte _6[16];
+ } ipv;
+
+ int lastTime;
+ signed char burst;
+
+ long hash;
+
+ leakyBucket_t *prev, *next;
+};
+
+extern leakyBucket_t outboundLeakyBucket;
+
+qboolean SVC_RateLimit( leakyBucket_t *bucket, int burst, int period );
+qboolean SVC_RateLimitAddress( netadr_t from, int burst, int period );
+
void SV_FinalMessage (char *message);
void QDECL SV_SendServerCommand( client_t *cl, const char *fmt, ...) __attribute__ ((format (printf, 2, 3)));