tor  0.4.2.0-alpha-dev
origin_circuit_st.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 
7 #ifndef ORIGIN_CIRCUIT_ST_H
8 #define ORIGIN_CIRCUIT_ST_H
9 
10 #include "core/or/or.h"
11 
12 #include "core/or/circuit_st.h"
13 
14 struct onion_queue_t;
15 
31 enum path_state_t {
34  PATH_STATE_NEW_CIRC = 0,
37  PATH_STATE_BUILD_ATTEMPTED = 1,
39  PATH_STATE_BUILD_SUCCEEDED = 2,
48  PATH_STATE_USE_ATTEMPTED = 3,
56  PATH_STATE_USE_SUCCEEDED = 4,
57 
62  PATH_STATE_USE_FAILED = 5,
63 
69  PATH_STATE_ALREADY_COUNTED = 6,
70 };
71 
75  circuit_t base_;
76 
80 
84 
88  uint32_t n_read_circ_bw;
89 
94 
99 
104 
109 
114 
125 
128 
132 
136  struct circuit_guard_state_t *guard_state;
137 
141 
144  unsigned int remaining_relay_early_cells : 4;
145 
147  unsigned int is_ancient : 1;
148 
151  unsigned int has_opened : 1;
152 
158  path_state_bitfield_t path_state : 3;
159 
160  /* If this flag is set, we should not consider attaching any more
161  * connections to this circuit. */
162  unsigned int unusable_for_new_conns : 1;
163 
164  /* If this flag is set (due to padding negotiation failure), we should
165  * not try to negotiate further circuit padding. */
166  unsigned padding_negotiation_failed : 1;
167 
176 #define PATHBIAS_SHOULDCOUNT_UNDECIDED 0
177 #define PATHBIAS_SHOULDCOUNT_IGNORED 1
178 #define PATHBIAS_SHOULDCOUNT_COUNTED 2
179 
183 
187 
202  unsigned int hs_circ_has_timed_out : 1;
203 
206  unsigned int relaxed_timeout : 1;
207 
215 
219 
223 
227 
228  /* The intro key replaces the hidden service's public key if purpose is
229  * S_ESTABLISH_INTRO or S_INTRO, provided that no unversioned rendezvous
230  * descriptor is used. */
231  crypto_pk_t *intro_key;
232 
234  /* XXXX NM This can get re-used after 2**32 circuits. */
236 
242  unsigned int isolation_values_set : 1;
249 
254 
268  uint8_t client_proto_type;
269  uint8_t client_proto_socksver;
270  uint16_t dest_port;
271  tor_addr_t client_addr;
272  char *dest_address;
273  int session_group;
274  unsigned nym_epoch;
275  size_t socks_username_len;
276  uint8_t socks_password_len;
277  /* Note that the next two values are NOT NUL-terminated; see
278  socks_username_len and socks_password_len for their lengths. */
279  char *socks_username;
280  char *socks_password;
289 
295 
296 };
297 
298 #endif /* !defined(ORIGIN_CIRCUIT_ST_H) */
rend_data_t * rend_data
struct circuit_guard_state_t * guard_state
unsigned int hs_circ_has_timed_out
uint32_t n_delivered_written_circ_bw
path_state_bitfield_t path_state
uint64_t associated_isolated_stream_global_id
crypt_path_t * cpath
uint32_t pathbias_probe_nonce
unsigned int hs_service_side_rend_circ_has_been_relaunched
unsigned int relaxed_timeout
unsigned int is_ancient
uint32_t n_overhead_read_circ_bw
unsigned int remaining_relay_early_cells
#define MAX_RELAY_EARLY_CELLS_PER_CIRCUIT
Definition: or.h:936
streamid_t pathbias_probe_id
uint32_t n_delivered_read_circ_bw
Master header file for Tor-specific functionality.
uint16_t streamid_t
Definition: or.h:610
uint8_t relay_early_commands[MAX_RELAY_EARLY_CELLS_PER_CIRCUIT]
smartlist_t * half_streams
uint32_t n_written_circ_bw
cpath_build_state_t * build_state
struct hs_ident_circuit_t * hs_ident
streamid_t next_stream_id
edge_connection_t * p_streams
unsigned int has_opened
unsigned int isolation_values_set
unsigned int isolation_any_streams_attached
smartlist_t * prepend_policy
uint32_t n_overhead_written_circ_bw