circuitbuild.h 3.35 KB
Newer Older
Sebastian Hahn's avatar
Sebastian Hahn committed
1
2
3
/* Copyright (c) 2001 Matej Pfajfar.
 * Copyright (c) 2001-2004, Roger Dingledine.
 * Copyright (c) 2004-2006, Roger Dingledine, Nick Mathewson.
4
 * Copyright (c) 2007-2013, The Tor Project, Inc. */
Sebastian Hahn's avatar
Sebastian Hahn committed
5
6
7
/* See LICENSE for licensing information */

/**
8
 * \file circuitbuild.h
Sebastian Hahn's avatar
Sebastian Hahn committed
9
10
11
 * \brief Header file for circuitbuild.c.
 **/

12
13
#ifndef TOR_CIRCUITBUILD_H
#define TOR_CIRCUITBUILD_H
Sebastian Hahn's avatar
Sebastian Hahn committed
14
15
16
17
18
19
20
21
22
23
24

char *circuit_list_path(origin_circuit_t *circ, int verbose);
char *circuit_list_path_for_controller(origin_circuit_t *circ);
void circuit_log_path(int severity, unsigned int domain,
                      origin_circuit_t *circ);
void circuit_rep_hist_note_result(origin_circuit_t *circ);
origin_circuit_t *origin_circuit_init(uint8_t purpose, int flags);
origin_circuit_t *circuit_establish_circuit(uint8_t purpose,
                                            extend_info_t *exit,
                                            int flags);
int circuit_handle_first_hop(origin_circuit_t *circ);
25
void circuit_n_chan_done(channel_t *chan, int status);
Sebastian Hahn's avatar
Sebastian Hahn committed
26
int inform_testing_reachability(void);
27
int circuit_timeout_want_to_count_circ(origin_circuit_t *circ);
Sebastian Hahn's avatar
Sebastian Hahn committed
28
29
30
31
32
int circuit_send_next_onion_skin(origin_circuit_t *circ);
void circuit_note_clock_jumped(int seconds_elapsed);
int circuit_extend(cell_t *cell, circuit_t *circ);
int circuit_init_cpath_crypto(crypt_path_t *cpath, const char *key_data,
                              int reverse);
33
34
35
struct created_cell_t;
int circuit_finish_handshake(origin_circuit_t *circ,
                             const struct created_cell_t *created_cell);
36
37
int circuit_truncated(origin_circuit_t *circ, crypt_path_t *layer,
                      int reason);
38
39
int onionskin_answer(or_circuit_t *circ,
                     const struct created_cell_t *created_cell,
40
41
                     const char *keys,
                     const uint8_t *rend_circ_nonce);
Sebastian Hahn's avatar
Sebastian Hahn committed
42
43
44
45
46
47
int circuit_all_predicted_ports_handled(time_t now, int *need_uptime,
                                        int *need_capacity);

int circuit_append_new_exit(origin_circuit_t *circ, extend_info_t *info);
int circuit_extend_to_new_exit(origin_circuit_t *circ, extend_info_t *info);
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
50
51
                               crypto_pk_t *onion_key,
                               const curve25519_public_key_t *curve25519_key,
                               const tor_addr_t *addr, uint16_t port);
52
extend_info_t *extend_info_from_node(const node_t *r, int for_direct_connect);
Sebastian Hahn's avatar
Sebastian Hahn committed
53
54
extend_info_t *extend_info_dup(extend_info_t *info);
void extend_info_free(extend_info_t *info);
55
const node_t *build_state_get_exit_node(cpath_build_state_t *state);
Sebastian Hahn's avatar
Sebastian Hahn committed
56
57
const char *build_state_get_exit_nickname(cpath_build_state_t *state);

58
59
const node_t *choose_good_entry_server(uint8_t purpose,
                                       cpath_build_state_t *state);
60
double pathbias_get_extreme_rate(const or_options_t *options);
61
double pathbias_get_extreme_use_rate(const or_options_t *options);
62
int pathbias_get_dropguards(const or_options_t *options);
63
void pathbias_count_timeout(origin_circuit_t *circ);
64
int pathbias_check_close(origin_circuit_t *circ, int reason);
Mike Perry's avatar
Mike Perry committed
65
int pathbias_check_probe_response(circuit_t *circ, const cell_t *cell);
66
67
void pathbias_count_use_attempt(origin_circuit_t *circ);
void pathbias_mark_use_success(origin_circuit_t *circ);
68

Sebastian Hahn's avatar
Sebastian Hahn committed
69
#endif
Mike Perry's avatar
Mike Perry committed
70