tor/src/feature/hs/hs_dos.h
David Goulet 82639a8c7b hs-v3: Move to hs_dos.c INTRO2 defenses initialization
A bit cleaner especially that the next commit(s) will make the consensus param
interface private to hs_dos.c so we expose as little as we can outside of the
subsystem.

Part of #30924

Signed-off-by: David Goulet <dgoulet@torproject.org>
2019-08-26 15:53:46 +03:00

39 lines
921 B
C

/* Copyright (c) 2019, The Tor Project, Inc. */
/* See LICENSE for licensing information */
/**
* \file hs_dos.h
* \brief Header file containing denial of service defenses for the HS
* subsystem for all versions.
**/
#ifndef TOR_HS_DOS_H
#define TOR_HS_DOS_H
#include "core/or/or_circuit_st.h"
#include "feature/nodelist/networkstatus_st.h"
/* Init */
void hs_dos_init(void);
/* Consensus. */
void hs_dos_consensus_has_changed(const networkstatus_t *ns);
/* Introduction Point. */
bool hs_dos_can_send_intro2(or_circuit_t *s_intro_circ);
void hs_dos_setup_default_intro2_defenses(or_circuit_t *circ);
unsigned int hs_dos_get_intro2_enabled_param(void);
uint32_t hs_dos_get_intro2_rate_param(void);
uint32_t hs_dos_get_intro2_burst_param(void);
#ifdef HS_DOS_PRIVATE
#ifdef TOR_UNIT_TESTS
#endif /* define(TOR_UNIT_TESTS) */
#endif /* defined(HS_DOS_PRIVATE) */
#endif /* !defined(TOR_HS_DOS_H) */