Tor  0.4.7.0-alpha-dev
hs_dos.h
Go to the documentation of this file.
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 
16 
17 /* Init */
18 void hs_dos_init(void);
19 
20 /* Consensus. */
22 
23 /* Introduction Point. */
24 bool hs_dos_can_send_intro2(or_circuit_t *s_intro_circ);
26 
27 /* Statistics. */
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);
37 
38 #endif /* defined(TOR_UNIT_TESTS) */
39 
40 #endif /* defined(HS_DOS_PRIVATE) */
41 
42 #endif /* !defined(TOR_HS_DOS_H) */
STATIC uint32_t get_intro2_rate_consensus_param(const networkstatus_t *ns)
Definition: hs_dos.c:70
STATIC uint32_t get_intro2_burst_consensus_param(const networkstatus_t *ns)
Definition: hs_dos.c:79
bool hs_dos_can_send_intro2(or_circuit_t *s_intro_circ)
Definition: hs_dos.c:166
void hs_dos_init(void)
Definition: hs_dos.c:225
void hs_dos_setup_default_intro2_defenses(or_circuit_t *circ)
Definition: hs_dos.c:137
uint64_t hs_dos_get_intro2_rejected_count(void)
Definition: hs_dos.c:218
void hs_dos_consensus_has_changed(const networkstatus_t *ns)
Definition: hs_dos.c:152
Networkstatus consensus/vote structure.
#define STATIC
Definition: testsupport.h:32