37#define HS_DOS_INTRODUCE_DEFAULT_CELL_RATE_PER_SEC 25
43#define HS_DOS_INTRODUCE_DEFAULT_CELL_BURST_PER_SEC 200
47#define HS_DOS_INTRODUCE_ENABLED_DEFAULT 0
55static uint32_t consensus_param_introduce_rate_per_sec =
57static uint32_t consensus_param_introduce_burst_per_sec =
59static uint32_t consensus_param_introduce_defense_enabled =
104 consensus_param_introduce_defense_enabled;
107 consensus_param_introduce_rate_per_sec,
108 consensus_param_introduce_burst_per_sec);
109 } SMARTLIST_FOREACH_END(circ);
111 smartlist_free(intro_circs);
118 consensus_param_introduce_rate_per_sec =
120 consensus_param_introduce_burst_per_sec =
122 consensus_param_introduce_defense_enabled =
123 get_intro2_enable_consensus_param(ns);
143 consensus_param_introduce_defense_enabled;
145 consensus_param_introduce_rate_per_sec,
146 consensus_param_introduce_burst_per_sec,
147 (uint32_t) monotime_coarse_absolute_sec());
192 (uint32_t) monotime_coarse_absolute_sec());
or_circuit_t * TO_OR_CIRCUIT(circuit_t *x)
Header file for circuitlist.c.
#define CIRCUIT_PURPOSE_INTRO_POINT
Functions and types for monotonic times.
const or_options_t * get_options(void)
Header file for config.c.
smartlist_t * hs_circuitmap_get_all_intro_circ_relay_side(void)
Header file for hs_circuitmap.c.
static void set_consensus_parameters(const networkstatus_t *ns)
bool hs_dos_can_send_intro2(or_circuit_t *s_intro_circ)
static uint64_t intro2_rejected_count
void hs_dos_setup_default_intro2_defenses(or_circuit_t *circ)
static void update_intro_circuits(void)
uint64_t hs_dos_get_intro2_rejected_count(void)
STATIC uint32_t get_intro2_rate_consensus_param(const networkstatus_t *ns)
#define HS_DOS_INTRODUCE_DEFAULT_CELL_BURST_PER_SEC
void hs_dos_consensus_has_changed(const networkstatus_t *ns)
#define HS_DOS_INTRODUCE_DEFAULT_CELL_RATE_PER_SEC
STATIC uint32_t get_intro2_burst_consensus_param(const networkstatus_t *ns)
#define HS_DOS_INTRODUCE_ENABLED_DEFAULT
Header file containing denial of service defenses for the HS subsystem for all versions.
int32_t networkstatus_get_param(const networkstatus_t *ns, const char *param_name, int32_t default_val, int32_t min_val, int32_t max_val)
Header file for networkstatus.c.
Master header file for Tor-specific functionality.
int public_server_mode(const or_options_t *options)
Header file for routermode.c.
#define SMARTLIST_FOREACH_BEGIN(sl, type, var)
unsigned int introduce2_dos_defense_enabled
token_bucket_ctr_t introduce2_bucket
void token_bucket_ctr_init(token_bucket_ctr_t *bucket, uint32_t rate, uint32_t burst, uint32_t now_ts_sec)
void token_bucket_ctr_adjust(token_bucket_ctr_t *bucket, uint32_t rate, uint32_t burst)
void token_bucket_ctr_refill(token_bucket_ctr_t *bucket, uint32_t now_ts_sec)
Headers for token_bucket.c.