Tor  0.4.5.0-alpha-dev
circuitbuild.h
Go to the documentation of this file.
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-2020, The Tor Project, Inc. */
5 /* See LICENSE for licensing information */
6 
7 /**
8  * \file circuitbuild.h
9  * \brief Header file for circuitbuild.c.
10  **/
11 
12 #ifndef TOR_CIRCUITBUILD_H
13 #define TOR_CIRCUITBUILD_H
14 
17 
18 int route_len_for_purpose(uint8_t purpose, extend_info_t *exit_ei);
19 char *circuit_list_path(origin_circuit_t *circ, int verbose);
21 void circuit_log_path(int severity, unsigned int domain,
22  origin_circuit_t *circ);
23 origin_circuit_t *origin_circuit_init(uint8_t purpose, int flags);
25  extend_info_t *exit,
26  int flags);
27 struct circuit_guard_state_t *origin_circuit_get_guard_state(
28  origin_circuit_t *circ);
30 void circuit_n_chan_done(channel_t *chan, int status,
31  int close_origin_circuits);
34 void circuit_note_clock_jumped(int64_t seconds_elapsed, bool was_idle);
35 struct created_cell_t;
37  const struct created_cell_t *created_cell);
38 int circuit_truncated(origin_circuit_t *circ, int reason);
40  int *need_uptime,
41  int *need_capacity));
42 
45 int circuit_can_use_tap(const origin_circuit_t *circ);
46 int circuit_has_usable_onion_key(const origin_circuit_t *circ);
48 MOCK_DECL(const node_t *,
51 
52 struct circuit_guard_state_t;
53 
54 const node_t *choose_good_entry_server(uint8_t purpose,
55  cpath_build_state_t *state,
56  struct circuit_guard_state_t **guard_state_out);
58 
60 
61 struct create_cell_t;
62 MOCK_DECL(int,
64  const struct create_cell_t *create_cell,
65  int relayed));
66 
67 #ifdef CIRCUITBUILD_PRIVATE
69 STATIC int new_route_len(uint8_t purpose, extend_info_t *exit_ei,
70  const smartlist_t *nodes);
72  int direct));
73 
75 
76 STATIC int
78  int is_hs_v3_rp_circuit);
79 STATIC int cpath_build_state_to_crn_flags(const cpath_build_state_t *state);
80 STATIC int cpath_build_state_to_crn_ipv6_extend_flag(
81  const cpath_build_state_t *state,
82  int cur_len);
83 
84 #endif /* defined(CIRCUITBUILD_PRIVATE) */
85 
86 #endif /* !defined(TOR_CIRCUITBUILD_H) */
circuit_n_chan_done
void circuit_n_chan_done(channel_t *chan, int status, int close_origin_circuits)
Definition: circuitbuild.c:627
circuit_deliver_create_cell
int circuit_deliver_create_cell(circuit_t *circ, const struct create_cell_t *create_cell, int relayed)
Definition: circuitbuild.c:713
build_state_get_exit_node
const node_t * build_state_get_exit_node(cpath_build_state_t *state)
Definition: circuitbuild.c:2469
count_acceptable_nodes
STATIC int count_acceptable_nodes(const smartlist_t *nodes, int direct)
Definition: circuitbuild.c:2112
create_cell_t
Definition: onion.h:24
created_cell_t
Definition: onion.h:36
circuit_list_path_for_controller
char * circuit_list_path_for_controller(origin_circuit_t *circ)
Definition: circuitbuild.c:342
circuit_upgrade_circuits_from_guard_wait
void circuit_upgrade_circuits_from_guard_wait(void)
Definition: circuitbuild.c:2537
circuit_append_new_exit
int circuit_append_new_exit(origin_circuit_t *circ, extend_info_t *info)
Definition: circuitbuild.c:2062
circuit_establish_circuit
origin_circuit_t * circuit_establish_circuit(uint8_t purpose, extend_info_t *exit, int flags)
Definition: circuitbuild.c:478
node_t
Definition: node_st.h:34
origin_circuit_t
Definition: origin_circuit_st.h:79
channel_connect_for_circuit
channel_t * channel_connect_for_circuit(const extend_info_t *ei)
Definition: circuitbuild.c:99
ed25519_public_key_t
Definition: crypto_ed25519.h:23
circuit_send_next_onion_skin
int circuit_send_next_onion_skin(origin_circuit_t *circ)
Definition: circuitbuild.c:904
circuit_t
Definition: circuit_st.h:61
get_unique_circ_id_by_chan
STATIC circid_t get_unique_circ_id_by_chan(channel_t *chan)
Definition: circuitbuild.c:122
origin_circuit_get_guard_state
struct circuit_guard_state_t * origin_circuit_get_guard_state(origin_circuit_t *circ)
Definition: circuitbuild.c:509
circuit_finish_handshake
int circuit_finish_handshake(origin_circuit_t *circ, const created_cell_t *reply)
Definition: circuitbuild.c:1199
new_route_len
STATIC int new_route_len(uint8_t purpose, extend_info_t *exit_ei, const smartlist_t *nodes)
Definition: circuitbuild.c:1429
MOCK_DECL
#define MOCK_DECL(rv, funcname, arglist)
Definition: testsupport.h:127
build_state_get_exit_rsa_id
const uint8_t * build_state_get_exit_rsa_id(cpath_build_state_t *state)
Definition: circuitbuild.c:2480
circuit_list_path
char * circuit_list_path(origin_circuit_t *circ, int verbose)
Definition: circuitbuild.c:333
channel_t
Definition: channel.h:181
circuit_log_path
void circuit_log_path(int severity, unsigned int domain, origin_circuit_t *circ)
Definition: circuitbuild.c:352
onion_pick_cpath_exit
STATIC int onion_pick_cpath_exit(origin_circuit_t *circ, extend_info_t *exit_ei, int is_hs_v3_rp_circuit)
Definition: circuitbuild.c:2012
choose_good_entry_server
const node_t * choose_good_entry_server(uint8_t purpose, cpath_build_state_t *state, struct circuit_guard_state_t **guard_state_out)
Definition: circuitbuild.c:2361
curve25519_public_key_t
Definition: crypto_curve25519.h:24
circuit_truncated
int circuit_truncated(origin_circuit_t *circ, int reason)
Definition: circuitbuild.c:1257
circuit_all_predicted_ports_handled
int circuit_all_predicted_ports_handled(time_t now, int *need_uptime, int *need_capacity)
Definition: circuitbuild.c:1475
circuit_timeout_want_to_count_circ
int circuit_timeout_want_to_count_circ(const origin_circuit_t *circ)
Definition: circuitbuild.c:808
onion_extend_cpath
STATIC int onion_extend_cpath(origin_circuit_t *circ)
Definition: circuitbuild.c:2410
circuit_extend_to_new_exit
int circuit_extend_to_new_exit(origin_circuit_t *circ, extend_info_t *info)
Definition: circuitbuild.c:2083
cpath_build_state_t
Definition: cpath_build_state_st.h:16
circuit_handle_first_hop
int circuit_handle_first_hop(origin_circuit_t *circ)
Definition: circuitbuild.c:540
STATIC
#define STATIC
Definition: testsupport.h:32
build_state_get_exit_nickname
const char * build_state_get_exit_nickname(cpath_build_state_t *state)
Definition: circuitbuild.c:2492
circuit_note_clock_jumped
void circuit_note_clock_jumped(int64_t seconds_elapsed, bool was_idle)
Definition: circuitbuild.c:1159
origin_circuit_init
origin_circuit_t * origin_circuit_init(uint8_t purpose, int flags)
Definition: circuitbuild.c:449
smartlist_t
Definition: smartlist_core.h:26
route_len_for_purpose
int route_len_for_purpose(uint8_t purpose, extend_info_t *exit_ei)
Definition: circuitbuild.c:1339
extend_info_t
Definition: extend_info_st.h:27
circid_t
uint32_t circid_t
Definition: or.h:609