summaryrefslogtreecommitdiff
path: root/src/or/geoip.h
diff options
context:
space:
mode:
authorDavid Goulet <dgoulet@torproject.org>2018-01-25 16:05:59 -0500
committerDavid Goulet <dgoulet@torproject.org>2018-01-30 09:18:15 -0500
commitc05272783d0164363023ddd4b3ee93c2e12c8911 (patch)
tree3640c136f039852247d4cb8ec6967939512b4680 /src/or/geoip.h
parent51fda85c23e5ff2cabbc66ea19b006c4cb04b1e2 (diff)
downloadtor-c05272783d0164363023ddd4b3ee93c2e12c8911.tar.gz
tor-c05272783d0164363023ddd4b3ee93c2e12c8911.zip
dos: Track new and closed OR client connections
Implement a basic connection tracking that counts the number of concurrent connections when they open and close. This commit also adds the circuit creation mitigation data structure that will be needed at later commit to keep track of the circuit rate. Signed-off-by: David Goulet <dgoulet@torproject.org>
Diffstat (limited to 'src/or/geoip.h')
-rw-r--r--src/or/geoip.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/or/geoip.h b/src/or/geoip.h
index b80efceb35..aa0fca50f5 100644
--- a/src/or/geoip.h
+++ b/src/or/geoip.h
@@ -13,6 +13,7 @@
#define TOR_GEOIP_H
#include "testsupport.h"
+#include "dos.h"
#ifdef GEOIP_PRIVATE
STATIC int geoip_parse_entry(const char *line, sa_family_t family);
@@ -37,6 +38,10 @@ typedef struct clientmap_entry_t {
* 4000 CE, please remember to add more bits to last_seen_in_minutes.) */
unsigned int last_seen_in_minutes:30;
unsigned int action:2;
+
+ /* This object is used to keep some statistics per client address for the
+ * DoS mitigation subsystem. */
+ dos_client_stats_t dos_stats;
} clientmap_entry_t;
int should_record_bridge_info(const or_options_t *options);