19 #define HS_DOS_PRIVATE
36 #define HS_DOS_INTRODUCE_DEFAULT_CELL_RATE_PER_SEC 25
42 #define HS_DOS_INTRODUCE_DEFAULT_CELL_BURST_PER_SEC 200
46 #define HS_DOS_INTRODUCE_ENABLED_DEFAULT 0
54 static uint32_t consensus_param_introduce_rate_per_sec =
56 static uint32_t consensus_param_introduce_burst_per_sec =
58 static uint32_t consensus_param_introduce_defense_enabled =
103 consensus_param_introduce_defense_enabled;
106 consensus_param_introduce_rate_per_sec,
107 consensus_param_introduce_burst_per_sec);
108 } SMARTLIST_FOREACH_END(circ);
110 smartlist_free(intro_circs);
117 consensus_param_introduce_rate_per_sec =
119 consensus_param_introduce_burst_per_sec =
121 consensus_param_introduce_defense_enabled =
122 get_intro2_enable_consensus_param(ns);
142 consensus_param_introduce_defense_enabled;
144 consensus_param_introduce_rate_per_sec,
145 consensus_param_introduce_burst_per_sec,
or_circuit_t * TO_OR_CIRCUIT(circuit_t *x)
Header file for circuitlist.c.
#define CIRCUIT_PURPOSE_INTRO_POINT
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)
void token_bucket_ctr_refill(token_bucket_ctr_t *bucket, uint32_t now_ts)
void token_bucket_ctr_adjust(token_bucket_ctr_t *bucket, uint32_t rate, uint32_t burst)
Headers for token_bucket.c.