hs_dos.h 1010 B

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