#include <or.h>
Data Fields | |
uint32_t | magic |
cell_queue_t | n_conn_cells |
or_connection_t * | n_conn |
circid_t | n_circ_id |
extend_info_t * | n_hop |
unsigned int | streams_blocked_on_n_conn: 1 |
unsigned int | streams_blocked_on_p_conn: 1 |
uint8_t | state |
uint8_t | purpose |
int | package_window |
int | deliver_window |
char * | n_conn_onionskin |
time_t | timestamp_created |
time_t | timestamp_dirty |
struct timeval | highres_created |
uint16_t | marked_for_close |
const char * | marked_for_close_file |
struct circuit_t * | next_active_on_n_conn |
struct circuit_t * | prev_active_on_n_conn |
struct circuit_t * | next |
uint64_t | dirreq_id |
cell_ewma_t | n_cell_ewma |
A circuit_t structure can fill one of two roles. First, a or_circuit_t links two connections together: either an edge connection and an OR connection, or two OR connections. (When joined to an OR connection, a circuit_t affects only cells sent to a particular circID on that connection. When joined to an edge connection, a circuit_t affects all data.)
Second, an origin_circuit_t holds the cipher keys and state for sending data along a given circuit. At the OP, it has a sequence of ciphers, each of which is shared with a single OR along the circuit. Separate ciphers are used for data going "forward" (away from the OP) and "backward" (towards the OP). At the OR, a circuit has only two stream ciphers: one for data going forward, and one for data going backward.
uint32_t circuit_t::magic |
For memory and type debugging: must equal ORIGIN_CIRCUIT_MAGIC or OR_CIRCUIT_MAGIC.
Referenced by assert_circuit_ok(), circuit_free(), circuit_get_by_edge_conn(), or_circuit_new(), origin_circuit_new(), TO_OR_CIRCUIT(), and TO_ORIGIN_CIRCUIT().
Queue of cells waiting to be transmitted on n_conn.
Referenced by append_cell_to_circuit_queue(), circuit_free(), circuit_set_n_circid_orconn(), connection_or_flush_from_first_active_circuit(), and dump_cell_pool_usage().
The OR connection that is next in this circuit.
Referenced by _circuit_mark_for_close(), assert_active_circuits_ok(), assert_circuit_ok(), circuit_build_failed(), circuit_deliver_create_cell(), circuit_dump_by_conn(), circuit_expire_building(), circuit_expire_old_circuits_serverside(), circuit_extend(), circuit_get_by_circid_orconn_impl(), circuit_handle_first_hop(), circuit_is_acceptable(), circuit_package_relay_cell(), circuit_receive_relay_cell(), circuit_send_next_onion_skin(), circuit_unlink_all_from_or_conn(), connection_edge_process_relay_cell(), connection_or_flush_from_first_active_circuit(), make_circuit_active_on_conn(), make_circuit_inactive_on_conn(), next_circ_on_conn_p(), prev_circ_on_conn_p(), relay_send_command_from_edge(), rend_mid_establish_intro(), rend_mid_establish_rendezvous(), rend_mid_introduce(), rend_mid_rendezvous(), and set_streams_blocked_on_circ().
The circuit_id used in the next (forward) hop of this circuit.
Referenced by _circuit_mark_for_close(), assert_circuit_ok(), circuit_deliver_create_cell(), circuit_dump_by_conn(), circuit_expire_building(), circuit_expire_old_circuits_clientside(), circuit_get_by_circid_orconn_impl(), circuit_receive_relay_cell(), command_process_created_cell(), connection_ap_handshake_attach_circuit(), connection_ap_handshake_send_begin(), connection_ap_handshake_send_resolve(), connection_edge_process_relay_cell(), link_apconn_to_circ(), relay_send_command_from_edge(), rend_client_introduction_acked(), rend_service_intro_established(), rend_service_intro_has_opened(), rend_service_introduce(), rend_service_rendezvous_has_opened(), and rend_service_set_connection_addr_port().
The hop to which we want to extend this circuit. Should be NULL if the circuit has attached to a connection.
Referenced by assert_circuit_ok(), circuit_dump_by_conn(), circuit_extend(), circuit_free(), and circuit_handle_first_hop().
unsigned int circuit_t::streams_blocked_on_n_conn |
True iff we are waiting for n_conn_cells to become less full before allowing p_streams to add any more cells. (Origin circuit only.)
Referenced by append_cell_to_circuit_queue(), connection_or_flush_from_first_active_circuit(), and set_streams_blocked_on_circ().
unsigned int circuit_t::streams_blocked_on_p_conn |
True iff we are waiting for p_conn_cells to become less full before allowing n_streams to add any more cells. (OR circuit only.)
Referenced by append_cell_to_circuit_queue(), connection_or_flush_from_first_active_circuit(), and set_streams_blocked_on_circ().
uint8_t circuit_t::state |
Current status of this circuit.
Referenced by _circuit_mark_for_close(), assert_circuit_ok(), circuit_build_failed(), circuit_dump_by_conn(), circuit_dump_details(), circuit_enough_testing_circs(), circuit_expire_building(), circuit_expire_old_circuits_clientside(), circuit_find_to_cannibalize(), circuit_get_best(), circuit_get_open_circ_or_launch(), circuit_is_acceptable(), circuit_list_path_impl(), circuit_send_next_onion_skin(), circuit_set_state(), command_process_relay_cell(), connection_ap_handshake_attach_chosen_circuit(), count_established_intro_points(), getinfo_helper_events(), handle_control_attachstream(), handle_control_extendcircuit(), rend_service_dump_stats(), rend_service_launch_establish_intro(), and router_perform_bandwidth_test().
uint8_t circuit_t::purpose |
Why are we creating this circuit?
Referenced by _circuit_mark_for_close(), assert_circuit_ok(), circuit_build_failed(), circuit_enough_testing_circs(), circuit_expire_building(), circuit_expire_old_circuits_clientside(), circuit_find_to_cannibalize(), circuit_get_by_rend_query_and_purpose(), circuit_get_by_rend_token_and_purpose(), circuit_get_next_by_pk_and_purpose(), circuit_get_open_circ_or_launch(), circuit_is_acceptable(), circuit_is_better(), circuit_launch_by_extend_info(), circuit_predict_and_launch_new(), circuit_receive_relay_cell(), circuit_stream_is_being_handled(), command_process_create_cell(), connection_ap_expire_beginning(), connection_ap_handshake_attach_circuit(), connection_ap_handshake_send_begin(), connection_ap_handshake_send_resolve(), connection_edge_end(), connection_edge_process_relay_cell(), connection_exit_begin_conn(), control_event_circuit_status(), count_established_intro_points(), getinfo_helper_events(), handle_control_setcircuitpurpose(), onion_extend_cpath(), onion_pick_cpath_exit(), origin_circuit_init(), relay_send_command_from_edge(), relay_send_end_cell_from_edge(), rend_client_introcirc_has_opened(), rend_client_introduction_acked(), rend_client_receive_rendezvous(), rend_client_rendcirc_has_opened(), rend_client_rendezvous_acked(), rend_client_send_establish_rendezvous(), rend_client_send_introduction(), rend_mid_establish_intro(), rend_mid_establish_rendezvous(), rend_mid_introduce(), rend_mid_rendezvous(), rend_service_intro_established(), rend_service_intro_has_opened(), rend_service_introduce(), rend_service_relaunch_rendezvous(), rend_service_rendezvous_has_opened(), rend_service_set_connection_addr_port(), rend_service_update_descriptor(), and warn_if_last_router_excluded().
How many relay data cells can we package (read from edge streams) on this circuit before we receive a circuit-level sendme cell asking for more?
Referenced by assert_circuit_ok(), circuit_consider_stop_edge_reading(), connection_edge_package_raw_inbuf(), connection_edge_process_relay_cell(), and init_circuit_base().
How many relay data cells will we deliver (write to edge streams) on this circuit? When deliver_window gets low, we send some circuit-level sendme cells to indicate that we're willing to accept more.
Referenced by assert_circuit_ok(), circuit_consider_sending_sendme(), connection_edge_process_relay_cell(), and init_circuit_base().
For storage while n_conn is pending (state CIRCUIT_STATE_OR_WAIT). When defined, it is always length ONIONSKIN_CHALLENGE_LEN.
Referenced by assert_circuit_ok(), circuit_extend(), circuit_free(), and circuit_set_state().
time_t circuit_t::timestamp_created |
When was this circuit created?
Referenced by circuit_dump_details(), circuit_expire_building(), circuit_expire_old_circuits_clientside(), circuit_get_best(), circuit_is_better(), circuit_launch_by_extend_info(), init_circuit_base(), and rep_hist_buffer_stats_add_circ().
time_t circuit_t::timestamp_dirty |
When the circuit was first used, or 0 if the circuit is clean.
Referenced by circuit_expire_all_dirty_circs(), circuit_expire_building(), circuit_expire_old_circuits_clientside(), circuit_find_to_cannibalize(), circuit_is_acceptable(), circuit_is_better(), circuit_mark_all_unused_circs(), circuit_predict_and_launch_new(), circuit_stream_is_being_handled(), connection_ap_expire_beginning(), connection_ap_handshake_attach_chosen_circuit(), connection_ap_handshake_attach_circuit(), connection_ap_process_end_not_open(), and router_perform_bandwidth_test().
struct timeval circuit_t::highres_created [read] |
When exactly was the circuit created?
Referenced by circuit_send_next_onion_skin(), and init_circuit_base().
uint16_t circuit_t::marked_for_close |
Should we close this circuit at the end of the main loop? (If true, holds the line number where this circuit was marked.)
Referenced by _circuit_mark_for_close(), assert_circuit_ok(), circuit_close_all_marked(), circuit_dump_by_conn(), circuit_enough_testing_circs(), circuit_expire_all_dirty_circs(), circuit_expire_building(), circuit_expire_old_circuits_clientside(), circuit_expire_old_circuits_serverside(), circuit_find_to_cannibalize(), circuit_get_by_circid_orconn(), circuit_get_by_global_id(), circuit_get_by_rend_query_and_purpose(), circuit_get_by_rend_token_and_purpose(), circuit_get_next_by_pk_and_purpose(), circuit_is_acceptable(), circuit_mark_all_unused_circs(), circuit_predict_and_launch_new(), circuit_receive_relay_cell(), circuit_stream_is_being_handled(), circuit_unlink_all_from_or_conn(), connection_ap_handshake_attach_circuit(), connection_edge_end(), count_established_intro_points(), and getinfo_helper_events().
const char* circuit_t::marked_for_close_file |
For debugging: in which file was this circuit marked for close?
Referenced by _circuit_mark_for_close().
struct circuit_t* circuit_t::next_active_on_n_conn [read] |
Next circuit in the doubly-linked ring of circuits waiting to add cells to n_conn. NULL if we have no cells pending, or if we're not linked to an OR connection.
Referenced by circuit_set_n_circid_orconn(), and next_circ_on_conn_p().
struct circuit_t* circuit_t::prev_active_on_n_conn [read] |
Previous circuit in the doubly-linked ring of circuits waiting to add cells to n_conn. NULL if we have no cells pending, or if we're not linked to an OR connection.
Referenced by prev_circ_on_conn_p().
struct circuit_t* circuit_t::next [read] |
Next circuit in linked list of all circuits.
Referenced by circuit_add(), circuit_close_all_marked(), circuit_dump_by_conn(), circuit_enough_testing_circs(), circuit_expire_all_dirty_circs(), circuit_expire_building(), circuit_expire_old_circuits_clientside(), circuit_expire_old_circuits_serverside(), circuit_find_to_cannibalize(), circuit_free_all(), circuit_get_best(), circuit_get_by_circid_orconn_impl(), circuit_get_by_global_id(), circuit_get_by_rend_query_and_purpose(), circuit_get_by_rend_token_and_purpose(), circuit_get_next_by_pk_and_purpose(), circuit_mark_all_unused_circs(), circuit_predict_and_launch_new(), circuit_stream_is_being_handled(), circuit_unlink_all_from_or_conn(), connection_ap_handshake_attach_circuit(), count_established_intro_points(), dump_cell_pool_usage(), getinfo_helper_events(), rend_config_services(), and rep_hist_buffer_stats_write().
uint64_t circuit_t::dirreq_id |
Unique ID for measuring tunneled network status requests.
Referenced by connection_edge_process_relay_cell(), connection_exit_begin_conn(), and relay_send_command_from_edge().
The EWMA count for the number of cells flushed from the n_conn_cells queue. Used to determine which circuit to flush from next.
Referenced by assert_active_circuits_ok(), init_circuit_base(), make_circuit_active_on_conn(), and make_circuit_inactive_on_conn().