Back to index

tor  0.2.3.19-rc
circuitlist.h
Go to the documentation of this file.
00001 /* Copyright (c) 2001 Matej Pfajfar.
00002  * Copyright (c) 2001-2004, Roger Dingledine.
00003  * Copyright (c) 2004-2006, Roger Dingledine, Nick Mathewson.
00004  * Copyright (c) 2007-2012, The Tor Project, Inc. */
00005 /* See LICENSE for licensing information */
00006 
00012 #ifndef _TOR_CIRCUITLIST_H
00013 #define _TOR_CIRCUITLIST_H
00014 
00015 circuit_t * _circuit_get_global_list(void);
00016 const char *circuit_state_to_string(int state);
00017 const char *circuit_purpose_to_controller_string(uint8_t purpose);
00018 const char *circuit_purpose_to_controller_hs_state_string(uint8_t purpose);
00019 const char *circuit_purpose_to_string(uint8_t purpose);
00020 void circuit_dump_by_conn(connection_t *conn, int severity);
00021 void circuit_set_p_circid_orconn(or_circuit_t *circ, circid_t id,
00022                                  or_connection_t *conn);
00023 void circuit_set_n_circid_orconn(circuit_t *circ, circid_t id,
00024                                  or_connection_t *conn);
00025 void circuit_set_state(circuit_t *circ, uint8_t state);
00026 void circuit_close_all_marked(void);
00027 int32_t circuit_initial_package_window(void);
00028 origin_circuit_t *origin_circuit_new(void);
00029 or_circuit_t *or_circuit_new(circid_t p_circ_id, or_connection_t *p_conn);
00030 circuit_t *circuit_get_by_circid_orconn(circid_t circ_id,
00031                                         or_connection_t *conn);
00032 int circuit_id_in_use_on_orconn(circid_t circ_id, or_connection_t *conn);
00033 circuit_t *circuit_get_by_edge_conn(edge_connection_t *conn);
00034 void circuit_unlink_all_from_or_conn(or_connection_t *conn, int reason);
00035 origin_circuit_t *circuit_get_by_global_id(uint32_t id);
00036 origin_circuit_t *circuit_get_ready_rend_circ_by_rend_data(
00037   const rend_data_t *rend_data);
00038 origin_circuit_t *circuit_get_next_by_pk_and_purpose(origin_circuit_t *start,
00039                                          const char *digest, uint8_t purpose);
00040 or_circuit_t *circuit_get_rendezvous(const char *cookie);
00041 or_circuit_t *circuit_get_intro_point(const char *digest);
00042 origin_circuit_t *circuit_find_to_cannibalize(uint8_t purpose,
00043                                               extend_info_t *info, int flags);
00044 void circuit_mark_all_unused_circs(void);
00045 void circuit_expire_all_dirty_circs(void);
00046 void _circuit_mark_for_close(circuit_t *circ, int reason,
00047                              int line, const char *file);
00048 int circuit_get_cpath_len(origin_circuit_t *circ);
00049 crypt_path_t *circuit_get_cpath_hop(origin_circuit_t *circ, int hopnum);
00050 void circuit_get_all_pending_on_or_conn(smartlist_t *out,
00051                                         or_connection_t *or_conn);
00052 int circuit_count_pending_on_or_conn(or_connection_t *or_conn);
00053 
00054 #define circuit_mark_for_close(c, reason)                               \
00055   _circuit_mark_for_close((c), (reason), __LINE__, _SHORT_FILE_)
00056 
00057 void assert_cpath_layer_ok(const crypt_path_t *cp);
00058 void assert_circuit_ok(const circuit_t *c);
00059 void circuit_free_all(void);
00060 
00061 #endif
00062