channelpadding.h 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. /* Copyright (c) 2001 Matej Pfajfar.
  2. * Copyright (c) 2001-2004, Roger Dingledine.
  3. * Copyright (c) 2004-2006, Roger Dingledine, Nick Mathewson.
  4. * Copyright (c) 2007-2015, The Tor Project, Inc. */
  5. /* See LICENSE for licensing information */
  6. /**
  7. * \file circuitbuild.h
  8. * \brief Header file for circuitbuild.c.
  9. **/
  10. #ifndef TOR_CHANNELPADDING_H
  11. #define TOR_CHANNELPADDING_H
  12. #include "channelpadding_negotiation.h"
  13. #define CHANNELPADDING_TOR2WEB_PARAM "nf_pad_tor2web"
  14. #define CHANNELPADDING_TOR2WEB_DEFAULT 1
  15. #define CHANNELPADDING_SOS_PARAM "nf_pad_single_onion"
  16. #define CHANNELPADDING_SOS_DEFAULT 1
  17. typedef enum {
  18. CHANNELPADDING_WONTPAD,
  19. CHANNELPADDING_PADLATER,
  20. CHANNELPADDING_PADDING_SCHEDULED,
  21. CHANNELPADDING_PADDING_ALREADY_SCHEDULED,
  22. CHANNELPADDING_PADDING_SENT,
  23. } channelpadding_decision_t;
  24. channelpadding_decision_t channelpadding_decide_to_pad_channel(channel_t
  25. *chan);
  26. int channelpadding_update_padding_for_channel(channel_t *,
  27. const channelpadding_negotiate_t
  28. *chan);
  29. void channelpadding_disable_padding_on_channel(channel_t *chan);
  30. void channelpadding_reduce_padding_on_channel(channel_t *chan);
  31. int channelpadding_send_enable_command(channel_t *chan, uint16_t low_timeout,
  32. uint16_t high_timeout);
  33. int channelpadding_get_circuits_available_timeout(void);
  34. unsigned int channelpadding_get_channel_idle_timeout(const channel_t *, int);
  35. void channelpadding_new_consensus_params(networkstatus_t *ns);
  36. #endif /* !defined(TOR_CHANNELPADDING_H) */