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-2013, The Tor Project, Inc. */
5 /* See LICENSE for licensing information */
9 * \brief Header file for circuitbuild.c.
12 #ifndef TOR_CIRCUITBUILD_H
13 #define TOR_CIRCUITBUILD_H
15 char *circuit_list_path(origin_circuit_t
*circ
, int verbose
);
16 char *circuit_list_path_for_controller(origin_circuit_t
*circ
);
17 void circuit_log_path(int severity
, unsigned int domain
,
18 origin_circuit_t
*circ
);
19 void circuit_rep_hist_note_result(origin_circuit_t
*circ
);
20 origin_circuit_t
*origin_circuit_init(uint8_t purpose
, int flags
);
21 origin_circuit_t
*circuit_establish_circuit(uint8_t purpose
,
24 int circuit_handle_first_hop(origin_circuit_t
*circ
);
25 void circuit_n_chan_done(channel_t
*chan
, int status
);
26 int inform_testing_reachability(void);
27 int circuit_timeout_want_to_count_circ(origin_circuit_t
*circ
);
28 int circuit_send_next_onion_skin(origin_circuit_t
*circ
);
29 void circuit_note_clock_jumped(int seconds_elapsed
);
30 int circuit_extend(cell_t
*cell
, circuit_t
*circ
);
31 int circuit_init_cpath_crypto(crypt_path_t
*cpath
, const char *key_data
,
33 struct created_cell_t
;
34 int circuit_finish_handshake(origin_circuit_t
*circ
,
35 const struct created_cell_t
*created_cell
);
36 int circuit_truncated(origin_circuit_t
*circ
, crypt_path_t
*layer
,
38 int onionskin_answer(or_circuit_t
*circ
,
39 const struct created_cell_t
*created_cell
,
41 const uint8_t *rend_circ_nonce
);
42 int circuit_all_predicted_ports_handled(time_t now
, int *need_uptime
,
45 int circuit_append_new_exit(origin_circuit_t
*circ
, extend_info_t
*info
);
46 int circuit_extend_to_new_exit(origin_circuit_t
*circ
, extend_info_t
*info
);
47 void onion_append_to_cpath(crypt_path_t
**head_ptr
, crypt_path_t
*new_hop
);
48 extend_info_t
*extend_info_new(const char *nickname
, const char *digest
,
49 crypto_pk_t
*onion_key
,
50 const curve25519_public_key_t
*curve25519_key
,
51 const tor_addr_t
*addr
, uint16_t port
);
52 extend_info_t
*extend_info_from_node(const node_t
*r
, int for_direct_connect
);
53 extend_info_t
*extend_info_dup(extend_info_t
*info
);
54 void extend_info_free(extend_info_t
*info
);
55 const node_t
*build_state_get_exit_node(cpath_build_state_t
*state
);
56 const char *build_state_get_exit_nickname(cpath_build_state_t
*state
);
58 const node_t
*choose_good_entry_server(uint8_t purpose
,
59 cpath_build_state_t
*state
);
61 #ifdef CIRCUITBUILD_PRIVATE
62 STATIC circid_t
get_unique_circ_id_by_chan(channel_t
*chan
);