|
@@ -33,13 +33,13 @@
|
|
|
|
|
|
/* 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);
|
|
|
}
|
|
|
|