aboutsummaryrefslogtreecommitdiff
path: root/src/common
diff options
context:
space:
mode:
authorDavid Goulet <dgoulet@torproject.org>2018-01-25 15:54:58 -0500
committerDavid Goulet <dgoulet@torproject.org>2018-01-30 09:18:15 -0500
commit64149353dda6336488e7d011534a7132b3f01acc (patch)
tree13a89db732985554b68897d6e9225f678980cc67 /src/common
parent93b826faaa7cca351c68256ce60a7f7e6c5fda5b (diff)
downloadtor-64149353dda6336488e7d011534a7132b3f01acc.tar.gz
tor-64149353dda6336488e7d011534a7132b3f01acc.zip
dos: Initial code of Denial of Service mitigation
This commit introduces the src/or/dos.{c|h} files that contains the code for the Denial of Service mitigation subsystem. It currently contains basic functions to initialize and free the subsystem. They are used at this commit. The torrc options and consensus parameters are defined at this commit and getters are implemented. Signed-off-by: David Goulet <dgoulet@torproject.org>
Diffstat (limited to 'src/common')
-rw-r--r--src/common/log.c2
-rw-r--r--src/common/torlog.h4
2 files changed, 4 insertions, 2 deletions
diff --git a/src/common/log.c b/src/common/log.c
index 56adc77f84..4db1c9f0d0 100644
--- a/src/common/log.c
+++ b/src/common/log.c
@@ -1177,7 +1177,7 @@ static const char *domain_list[] = {
"GENERAL", "CRYPTO", "NET", "CONFIG", "FS", "PROTOCOL", "MM",
"HTTP", "APP", "CONTROL", "CIRC", "REND", "BUG", "DIR", "DIRSERV",
"OR", "EDGE", "ACCT", "HIST", "HANDSHAKE", "HEARTBEAT", "CHANNEL",
- "SCHED", NULL
+ "SCHED", "DOS", NULL
};
/** Return a bitmask for the log domain for which <b>domain</b> is the name,
diff --git a/src/common/torlog.h b/src/common/torlog.h
index 6732a42741..20b7d938f0 100644
--- a/src/common/torlog.h
+++ b/src/common/torlog.h
@@ -99,8 +99,10 @@
#define LD_CHANNEL (1u<<21)
/** Scheduler */
#define LD_SCHED (1u<<22)
+/** Denial of Service mitigation. */
+#define LD_DOS (1u<<23)
/** Number of logging domains in the code. */
-#define N_LOGGING_DOMAINS 23
+#define N_LOGGING_DOMAINS 24
/** This log message is not safe to send to a callback-based logger
* immediately. Used as a flag, not a log domain. */