Tor  0.4.3.0-alpha-dev
Data Fields
origin_circuit_t Struct Reference

#include <origin_circuit_st.h>

Data Fields

circuit_t base_
 
edge_connection_tp_streams
 
smartlist_thalf_streams
 
uint32_t n_read_circ_bw
 
uint32_t n_written_circ_bw
 
uint32_t n_delivered_read_circ_bw
 
uint32_t n_delivered_written_circ_bw
 
uint32_t n_overhead_read_circ_bw
 
uint32_t n_overhead_written_circ_bw
 
cpath_build_state_tbuild_state
 
crypt_path_tcpath
 
rend_data_trend_data
 
struct hs_ident_circuit_ths_ident
 
struct circuit_guard_state_t * guard_state
 
int global_origin_circuit_list_idx
 
unsigned int remaining_relay_early_cells: 4
 
unsigned int is_ancient: 1
 
unsigned int has_opened: 1
 
path_state_bitfield_t path_state: 3
 
unsigned int unusable_for_new_conns: 1
 
unsigned padding_negotiation_failed: 1
 
uint8_t pathbias_shouldcount
 
streamid_t pathbias_probe_id
 
uint32_t pathbias_probe_nonce
 
unsigned int hs_circ_has_timed_out: 1
 
unsigned int relaxed_timeout: 1
 
unsigned int hs_service_side_rend_circ_has_been_relaunched: 1
 
uint8_t relay_early_commands [MAX_RELAY_EARLY_CELLS_PER_CIRCUIT]
 
int relay_early_cells_sent
 
streamid_t next_stream_id
 
crypto_pk_tintro_key
 
uint32_t global_identifier
 
unsigned int isolation_values_set: 1
 
unsigned int isolation_any_streams_attached: 1
 
uint8_t isolation_flags_mixed
 
smartlist_tprepend_policy
 
int circuit_idle_timeout
 
Isolation parameters

If any streams have been associated with this circ (isolation_values_set == 1), and all streams associated with the circuit have had the same value for some field ((isolation_flags_mixed & ISO_FOO) == 0), then these elements hold the value for that field.

Note again that "associated" is not the same as "attached": we preliminarily associate streams with a circuit while the circuit is being launched, so that we can tell whether we need to launch more circuits.

uint8_t client_proto_type
 
uint8_t client_proto_socksver
 
uint16_t dest_port
 
tor_addr_t client_addr
 
char * dest_address
 
int session_group
 
unsigned nym_epoch
 
size_t socks_username_len
 
uint8_t socks_password_len
 
char * socks_username
 
char * socks_password
 
uint64_t associated_isolated_stream_global_id
 

Detailed Description

An origin_circuit_t holds data necessary to build and use a circuit.

Definition at line 79 of file origin_circuit_st.h.

Field Documentation

◆ associated_isolated_stream_global_id

uint64_t associated_isolated_stream_global_id

Global identifier for the first stream attached here; used by ISO_STREAM.

Definition at line 288 of file origin_circuit_st.h.

◆ build_state

cpath_build_state_t* build_state

◆ circuit_idle_timeout

int circuit_idle_timeout

How long do we wait before closing this circuit if it remains completely idle after it was built, in seconds? This value is randomized on a per-circuit basis from CircuitsAvailableTimoeut to 2*CircuitsAvailableTimoeut.

Definition at line 299 of file origin_circuit_st.h.

Referenced by circuit_expire_old_circuits_clientside().

◆ cpath

crypt_path_t* cpath

◆ global_identifier

uint32_t global_identifier

Quasi-global identifier for this circuit; used for control.c

Definition at line 240 of file origin_circuit_st.h.

Referenced by circpad_send_command_to_hop(), circpad_send_padding_cell_for_callback(), and format_cell_stats().

◆ global_origin_circuit_list_idx

int global_origin_circuit_list_idx

Index into global_origin_circuit_list for this circuit. -1 if not present.

Definition at line 145 of file origin_circuit_st.h.

Referenced by circuit_add_to_origin_circuit_list(), and circuit_remove_from_origin_circuit_list().

◆ guard_state

struct circuit_guard_state_t* guard_state

Holds the data that the entry guard system uses to track the status of the guard this circuit is using, and thereby to determine whether this circuit can be used.

Definition at line 141 of file origin_circuit_st.h.

Referenced by circuit_build_no_more_hops(), circuit_expire_waiting_for_better_guard(), entry_guard_chan_failed(), and origin_circuit_get_guard_state().

◆ half_streams

smartlist_t* half_streams

Smartlist of half-closed streams (half_edge_t*) that still have pending activity

Definition at line 88 of file origin_circuit_st.h.

Referenced by circuit_free_(), and connection_half_edge_add().

◆ has_opened

unsigned int has_opened

Set if this circuit has already been opened. Used to detect cannibalized circuits.

Definition at line 156 of file origin_circuit_st.h.

Referenced by circuit_timeout_want_to_count_circ().

◆ hs_circ_has_timed_out

unsigned int hs_circ_has_timed_out

Set iff this is a hidden-service circuit which has timed out according to our current circuit-build timeout, but which has been kept around because it might still succeed in connecting to its destination, and which is not a fully-connected rendezvous circuit.

(We clear this flag for client-side rendezvous circuits when they are 'joined' to the other side's rendezvous circuit, so that connection_ap_handshake_attach_circuit can put client streams on the circuit. We also clear this flag for service-side rendezvous circuits when they are 'joined' to a client's rend circ, but only for symmetry with the client case. Client-side introduction circuits are closed when we get a joined rend circ, and service-side introduction circuits never have this flag set.)

Definition at line 207 of file origin_circuit_st.h.

Referenced by circuit_get_best(), and circuit_is_acceptable().

◆ hs_ident

struct hs_ident_circuit_t* hs_ident

◆ hs_service_side_rend_circ_has_been_relaunched

unsigned int hs_service_side_rend_circ_has_been_relaunched

Set iff this is a service-side rendezvous circuit for which a new connection attempt has been launched. We consider launching a new service-side rend circ to a client when the previous one fails; now that we don't necessarily close a service-side rend circ when we launch a new one to the same client, this flag keeps us from launching two retries for the same failed rend circ.

Definition at line 219 of file origin_circuit_st.h.

Referenced by can_relaunch_service_rendezvous_point(), and hs_circ_retry_service_rendezvous_point().

◆ is_ancient

unsigned int is_ancient

Set if this circuit is insanely old and we already informed the user

Definition at line 152 of file origin_circuit_st.h.

◆ isolation_any_streams_attached

unsigned int isolation_any_streams_attached

True iff any stream has ever been attached to this circuit.

In a better world we could use timestamp_dirty for this, but timestamp_dirty is far too overloaded at the moment.

Definition at line 253 of file origin_circuit_st.h.

Referenced by circuit_clear_isolation(), and circuit_try_clearing_isolation_state().

◆ isolation_flags_mixed

uint8_t isolation_flags_mixed

A bitfield of ISO_* flags for every isolation field such that this circuit has had streams with more than one value for that field attached to it.

Definition at line 258 of file origin_circuit_st.h.

Referenced by connection_edge_compatible_with_circuit().

◆ isolation_values_set

unsigned int isolation_values_set

True if we have associated one stream to this circuit, thereby setting the isolation parameters for this circuit. Note that this doesn't necessarily mean that we've attached any streams to the circuit: we may only have marked up this circuit during the launch process.

Definition at line 247 of file origin_circuit_st.h.

Referenced by circuit_stream_is_being_handled(), circuit_try_clearing_isolation_state(), and connection_edge_compatible_with_circuit().

◆ n_delivered_read_circ_bw

uint32_t n_delivered_read_circ_bw

Total known-valid relay cell bytes since last call to control_event_circ_bandwidth_used(). Only used if we're configured to emit CIRC_BW events.

Definition at line 103 of file origin_circuit_st.h.

Referenced by clear_circ_bw_fields().

◆ n_delivered_written_circ_bw

uint32_t n_delivered_written_circ_bw

Total written relay cell bytes since last call to control_event_circ_bandwidth_used(). Only used if we're configured to emit CIRC_BW events.

Definition at line 108 of file origin_circuit_st.h.

Referenced by clear_circ_bw_fields().

◆ n_overhead_read_circ_bw

uint32_t n_overhead_read_circ_bw

Total overhead data in all known-valid relay data cells since last call to control_event_circ_bandwidth_used(). Only used if we're configured to emit CIRC_BW events.

Definition at line 113 of file origin_circuit_st.h.

Referenced by clear_circ_bw_fields().

◆ n_overhead_written_circ_bw

uint32_t n_overhead_written_circ_bw

Total written overhead data in all relay data cells since last call to control_event_circ_bandwidth_used(). Only used if we're configured to emit CIRC_BW events.

Definition at line 118 of file origin_circuit_st.h.

Referenced by clear_circ_bw_fields().

◆ n_read_circ_bw

uint32_t n_read_circ_bw

Bytes read on this circuit since last call to control_event_circ_bandwidth_used(). Only used if we're configured to emit CIRC_BW events.

Definition at line 93 of file origin_circuit_st.h.

Referenced by clear_circ_bw_fields().

◆ n_written_circ_bw

uint32_t n_written_circ_bw

Bytes written to on this circuit since last call to control_event_circ_bandwidth_used(). Only used if we're configured to emit CIRC_BW events.

Definition at line 98 of file origin_circuit_st.h.

Referenced by clear_circ_bw_fields().

◆ next_stream_id

streamid_t next_stream_id

The next stream_id that will be tried when we're attempting to construct a new AP stream originating at this circuit.

Definition at line 231 of file origin_circuit_st.h.

Referenced by get_unique_stream_id_by_circ().

◆ p_streams

edge_connection_t* p_streams

Linked list of AP streams (or EXIT streams if hidden service) associated with this circuit.

Definition at line 84 of file origin_circuit_st.h.

Referenced by circpad_circuit_state(), and set_streams_blocked_on_circ().

◆ path_state

path_state_bitfield_t path_state

Path bias state machine. Used to ensure integrity of our circuit building and usage accounting. See path_state_t for more details.

Definition at line 163 of file origin_circuit_st.h.

Referenced by pathbias_check_close(), pathbias_count_circs_in_states(), pathbias_count_timeout(), pathbias_count_use_attempt(), pathbias_count_use_success(), pathbias_mark_use_rollback(), and pathbias_mark_use_success().

◆ pathbias_probe_id

streamid_t pathbias_probe_id

For path probing. Store the temporary probe stream ID for response comparison

Definition at line 187 of file origin_circuit_st.h.

◆ pathbias_probe_nonce

uint32_t pathbias_probe_nonce

For path probing. Store the temporary probe address nonce (in host byte order) for response comparison.

Definition at line 191 of file origin_circuit_st.h.

◆ pathbias_shouldcount

uint8_t pathbias_shouldcount

Tristate variable to guard against pathbias miscounting due to circuit purpose transitions changing the decision of pathbias_should_count(). This variable is informational only. The current results of pathbias_should_count() are the official decision for pathbias accounting.

Definition at line 180 of file origin_circuit_st.h.

◆ prepend_policy

smartlist_t* prepend_policy

A list of addr_policy_t for this circuit in particular. Used by adjust_exit_policy_from_exitpolicy_failure.

Definition at line 293 of file origin_circuit_st.h.

◆ relaxed_timeout

unsigned int relaxed_timeout

Set iff this circuit has been given a relaxed timeout because no circuits have opened. Used to prevent spamming logs.

Definition at line 211 of file origin_circuit_st.h.

Referenced by circuit_is_better().

◆ relay_early_cells_sent

int relay_early_cells_sent

How many RELAY_EARLY cells have been sent over this circuit? This is for debugging task 878, too.

Definition at line 227 of file origin_circuit_st.h.

◆ relay_early_commands

uint8_t relay_early_commands[MAX_RELAY_EARLY_CELLS_PER_CIRCUIT]

What commands were sent over this circuit that decremented the RELAY_EARLY counter? This is for debugging task 878.

Definition at line 223 of file origin_circuit_st.h.

◆ remaining_relay_early_cells

unsigned int remaining_relay_early_cells

How many more relay_early cells can we send on this circuit, according to the specification?

Definition at line 149 of file origin_circuit_st.h.

◆ rend_data

rend_data_t* rend_data

The documentation for this struct was generated from the following file: