Tor  0.4.3.1-alpha-dev
hs_dos.h
Go to the documentation of this file.
1 /* Copyright (c) 2019-2020, 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) */
bool hs_dos_can_send_intro2(or_circuit_t *s_intro_circ)
Definition: hs_dos.c:161
uint64_t hs_dos_get_intro2_rejected_count(void)
Definition: hs_dos.c:211
STATIC uint32_t get_intro2_burst_consensus_param(const networkstatus_t *ns)
Definition: hs_dos.c:79
#define STATIC
Definition: testsupport.h:32
STATIC uint32_t get_intro2_rate_consensus_param(const networkstatus_t *ns)
Definition: hs_dos.c:70
void hs_dos_setup_default_intro2_defenses(or_circuit_t *circ)
Definition: hs_dos.c:132
void hs_dos_consensus_has_changed(const networkstatus_t *ns)
Definition: hs_dos.c:147
void hs_dos_init(void)
Definition: hs_dos.c:218
Networkstatus consensus/vote structure.