hs_dos.h (1083B)
1 /* Copyright (c) 2019-2021, The Tor Project, Inc. */ 2 /* See LICENSE for licensing information */ 3 4 /** 5 * \file hs_dos.h 6 * \brief Header file containing denial of service defenses for the HS 7 * subsystem for all versions. 8 **/ 9 10 #ifndef TOR_HS_DOS_H 11 #define TOR_HS_DOS_H 12 13 #include "core/or/or_circuit_st.h" 14 15 #include "feature/nodelist/networkstatus_st.h" 16 17 /* Init */ 18 void hs_dos_init(void); 19 20 /* Consensus. */ 21 void hs_dos_consensus_has_changed(const networkstatus_t *ns); 22 23 /* Introduction Point. */ 24 bool hs_dos_can_send_intro2(or_circuit_t *s_intro_circ); 25 void hs_dos_setup_default_intro2_defenses(or_circuit_t *circ); 26 27 /* Statistics. */ 28 uint64_t hs_dos_get_intro2_rejected_count(void); 29 30 #ifdef HS_DOS_PRIVATE 31 32 #ifdef TOR_UNIT_TESTS 33 34 STATIC uint32_t get_intro2_enable_consensus_param(const networkstatus_t *ns); 35 STATIC uint32_t get_intro2_rate_consensus_param(const networkstatus_t *ns); 36 STATIC uint32_t get_intro2_burst_consensus_param(const networkstatus_t *ns); 37 38 #endif /* defined(TOR_UNIT_TESTS) */ 39 40 #endif /* defined(HS_DOS_PRIVATE) */ 41 42 #endif /* !defined(TOR_HS_DOS_H) */