21 uint32_t circuit_bucket;
26 time_t last_circ_bucket_refill_ts;
32 time_t marked_until_ts;
39 uint32_t concurrent_count;
48 time_t marked_until_ts;
69 void dos_free_all(
void);
71 int dos_enabled(
void);
72 void dos_log_heartbeat(
void);
77 const char *transport_name);
80 int dos_should_refuse_single_hop_client(
void);
81 void dos_note_refuse_single_hop_client(
void);
88 #define DOS_CC_ENABLED_DEFAULT 0
90 #define DOS_CC_DEFENSE_TYPE_DEFAULT DOS_CC_DEFENSE_REFUSE_CELL
92 #define DOS_CC_MIN_CONCURRENT_CONN_DEFAULT 3
94 #define DOS_CC_CIRCUIT_RATE_DEFAULT 3
96 #define DOS_CC_CIRCUIT_BURST_DEFAULT 90
98 #define DOS_CC_DEFENSE_TIME_PERIOD_DEFAULT (60 * 60)
101 typedef enum dos_cc_defense_type_t {
103 DOS_CC_DEFENSE_NONE = 1,
105 DOS_CC_DEFENSE_REFUSE_CELL = 2,
109 DOS_CC_DEFENSE_MAX = 2,
110 } dos_cc_defense_type_t;
112 void dos_cc_new_create_cell(
channel_t *channel);
113 dos_cc_defense_type_t dos_cc_get_defense_type(
channel_t *chan);
120 #define DOS_CONN_ENABLED_DEFAULT 0
122 #define DOS_CONN_MAX_CONCURRENT_COUNT_DEFAULT 100
124 #define DOS_CONN_DEFENSE_TYPE_DEFAULT DOS_CONN_DEFENSE_CLOSE
126 #define DOS_CONN_CONNECT_RATE_DEFAULT 20
128 #define DOS_CONN_CONNECT_BURST_DEFAULT 40
130 #define DOS_CONN_CONNECT_DEFENSE_TIME_PERIOD_DEFAULT (24 * 60 * 60)
134 #define DOS_CONN_CONNECT_DEFENSE_TIME_PERIOD_MIN (10)
138 typedef enum dos_conn_defense_type_t {
140 DOS_CONN_DEFENSE_NONE = 1,
142 DOS_CONN_DEFENSE_CLOSE = 2,
146 DOS_CONN_DEFENSE_MAX = 2,
147 } dos_conn_defense_type_t;
149 dos_conn_defense_type_t dos_conn_addr_get_defense_type(
const tor_addr_t *addr);
153 STATIC uint32_t get_param_conn_max_concurrent_count(
156 STATIC uint32_t get_param_cc_min_concurrent_connection(
160 STATIC uint64_t get_circuit_rate_per_second(
void);
Master header file for Tor-specific functionality.
#define MOCK_DECL(rv, funcname, arglist)
Headers for token_bucket.c.