tor  0.4.1.0-alpha-dev
channelpadding.h
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-2019, The Tor Project, Inc. */
5 /* See LICENSE for licensing information */
6 
11 #ifndef TOR_CHANNELPADDING_H
12 #define TOR_CHANNELPADDING_H
13 
14 #include "trunnel/channelpadding_negotiation.h"
15 
16 #define CHANNELPADDING_SOS_PARAM "nf_pad_single_onion"
17 #define CHANNELPADDING_SOS_DEFAULT 1
18 
19 typedef enum {
20  CHANNELPADDING_WONTPAD,
21  CHANNELPADDING_PADLATER,
22  CHANNELPADDING_PADDING_SCHEDULED,
23  CHANNELPADDING_PADDING_ALREADY_SCHEDULED,
24  CHANNELPADDING_PADDING_SENT,
25 } channelpadding_decision_t;
26 
27 channelpadding_decision_t channelpadding_decide_to_pad_channel(channel_t
28  *chan);
29 int channelpadding_update_padding_for_channel(channel_t *,
30  const channelpadding_negotiate_t
31  *chan);
32 
33 void channelpadding_disable_padding_on_channel(channel_t *chan);
34 void channelpadding_reduce_padding_on_channel(channel_t *chan);
35 int channelpadding_send_enable_command(channel_t *chan, uint16_t low_timeout,
36  uint16_t high_timeout);
37 
38 int channelpadding_get_circuits_available_timeout(void);
39 unsigned int channelpadding_get_channel_idle_timeout(const channel_t *, int);
40 void channelpadding_new_consensus_params(networkstatus_t *ns);
41 
42 #endif /* !defined(TOR_CHANNELPADDING_H) */
43