diff options
author | David Goulet <dgoulet@torproject.org> | 2019-06-11 08:28:13 -0400 |
---|---|---|
committer | David Goulet <dgoulet@torproject.org> | 2019-08-06 07:58:14 -0400 |
commit | c5b00c5a514a6b40e5245bc1fd78fe5490922739 (patch) | |
tree | 52c2c6791d959c84c7c2b0d538e8aac1d5cb913a /src/feature/hs/hs_dos.h | |
parent | fec0a7b7cbae344bd813152c8a04b6e87b6fa9a7 (diff) | |
download | tor-c5b00c5a514a6b40e5245bc1fd78fe5490922739.tar.gz tor-c5b00c5a514a6b40e5245bc1fd78fe5490922739.zip |
hs-v3: Add consensus parameters for DoS defenses
Part of #15516
Signed-off-by: David Goulet <dgoulet@torproject.org>
Diffstat (limited to 'src/feature/hs/hs_dos.h')
-rw-r--r-- | src/feature/hs/hs_dos.h | 25 |
1 files changed, 9 insertions, 16 deletions
diff --git a/src/feature/hs/hs_dos.h b/src/feature/hs/hs_dos.h index e3a83a1039..9fba00b52b 100644 --- a/src/feature/hs/hs_dos.h +++ b/src/feature/hs/hs_dos.h @@ -12,26 +12,19 @@ #include "core/or/or_circuit_st.h" -#include "lib/evloop/token_bucket.h" +#include "feature/nodelist/networkstatus_st.h" -#define HS_DOS_INTRODUCE_CELL_RATE_PER_SEC 25 -#define HS_DOS_INTRODUCE_CELL_BURST_PER_SEC 200 +/* Init */ +void hs_dos_init(void); + +/* Consensus. */ +void hs_dos_consensus_has_changed(const networkstatus_t *ns); bool hs_dos_can_send_intro2(or_circuit_t *s_intro_circ); -/* Return the INTRODUCE2 cell rate per second. */ -static inline -uint32_t hs_dos_get_intro2_rate(void) -{ - return HS_DOS_INTRODUCE_CELL_RATE_PER_SEC; -} - -/* Return the INTRODUCE2 cell burst per second. */ -static inline -uint32_t hs_dos_get_intro2_burst(void) -{ - return HS_DOS_INTRODUCE_CELL_BURST_PER_SEC; -} +/* Getters. */ +uint32_t hs_dos_get_intro2_rate(void); +uint32_t hs_dos_get_intro2_burst(void); #ifdef HS_DOS_PRIVATE |