]> git.ipfire.org Git - thirdparty/tor.git/commitdiff
hs-v3: Rename HS DoS default defines
authorDavid Goulet <dgoulet@torproject.org>
Tue, 2 Jul 2019 11:36:36 +0000 (07:36 -0400)
committerDavid Goulet <dgoulet@torproject.org>
Tue, 6 Aug 2019 11:58:14 +0000 (07:58 -0400)
Signed-off-by: David Goulet <dgoulet@torproject.org>
src/feature/hs/hs_dos.c

index da898dc3a0f5cef01384249f6ee213474ec670da..a4586dd7007bcbb88756beca7e3300b1788f7717 100644 (file)
 
 /* Default value of the allowed INTRODUCE2 cell rate per second. Above that
  * value per second, the introduction is denied. */
-#define HS_DOS_INTRODUCE_CELL_RATE_PER_SEC 25
+#define HS_DOS_INTRODUCE_DEFAULT_CELL_RATE_PER_SEC 25
 
 /* Default value of the allowed INTRODUCE2 cell burst per second. This is the
  * maximum value a token bucket has per second. We thus allow up to this value
  * of INTRODUCE2 cell per second but the bucket is refilled by the rate value
  * but never goes above that burst value. */
-#define HS_DOS_INTRODUCE_CELL_BURST_PER_SEC 200
+#define HS_DOS_INTRODUCE_DEFAULT_CELL_BURST_PER_SEC 200
 
 /* Default value of the consensus parameter enabling or disabling the
  * introduction DoS defense. Disabled by default. */
@@ -47,9 +47,9 @@
 
 /* Consensus parameters. */
 static uint32_t hs_dos_introduce_rate_per_sec =
-  HS_DOS_INTRODUCE_CELL_RATE_PER_SEC;
+  HS_DOS_INTRODUCE_DEFAULT_CELL_RATE_PER_SEC;
 static uint32_t hs_dos_introduce_burst_per_sec =
-  HS_DOS_INTRODUCE_CELL_BURST_PER_SEC;
+  HS_DOS_INTRODUCE_DEFAULT_CELL_BURST_PER_SEC;
 static uint32_t hs_dos_introduce_enabled =
   HS_DOS_INTRODUCE_ENABLED_DEFAULT;
 
@@ -65,7 +65,7 @@ static uint32_t
 get_param_rate_per_sec(const networkstatus_t *ns)
 {
   return networkstatus_get_param(ns, "HiddenServiceEnableIntroDoSRatePerSec",
-                                 HS_DOS_INTRODUCE_CELL_RATE_PER_SEC,
+                                 HS_DOS_INTRODUCE_DEFAULT_CELL_RATE_PER_SEC,
                                  0, INT32_MAX);
 }
 
@@ -74,7 +74,7 @@ static uint32_t
 get_param_burst_per_sec(const networkstatus_t *ns)
 {
   return networkstatus_get_param(ns, "HiddenServiceEnableIntroDoSBurstPerSec",
-                                 HS_DOS_INTRODUCE_CELL_BURST_PER_SEC,
+                                 HS_DOS_INTRODUCE_DEFAULT_CELL_BURST_PER_SEC,
                                  0, INT32_MAX);
 }