#include <or.h>
Data Fields | |
| connection_t | _base | 
| char | identity_digest [DIGEST_LEN] | 
| char * | nickname | 
| tor_tls_t * | tls | 
| int | tls_error | 
| time_t | client_used | 
| tor_addr_t | real_addr | 
| circ_id_type_t | circ_id_type:2 | 
| unsigned int | is_canonical:1 | 
| unsigned int | is_bad_for_new_circs:1 | 
| uint8_t | link_proto | 
| circid_t | next_circ_id | 
| or_handshake_state_t * | handshake_state | 
| time_t | timestamp_lastempty | 
| time_t | timestamp_last_added_nonpadding | 
| int | bandwidthrate | 
| int | bandwidthburst | 
| int | read_bucket | 
| int | write_bucket | 
| int | n_circuits | 
| struct circuit_t * | active_circuits | 
| smartlist_t * | active_circuit_pqueue | 
| unsigned | active_circuit_pqueue_last_recalibrated | 
| struct or_connection_t * | next_with_same_id | 
| char or_connection_t::identity_digest[DIGEST_LEN] | 
Hash of the public RSA key for the other side's identity key, or zeroes if the other side hasn't shown us a valid identity key.
Referenced by circuit_get_all_pending_on_or_conn(), circuit_n_conn_done(), circuit_send_next_onion_skin(), command_process_create_cell(), command_process_netinfo_cell(), connection_about_to_close_connection(), connection_exit_begin_conn(), connection_or_check_valid_tls_handshake(), connection_or_connect(), connection_or_get_for_extend(), connection_or_init_conn_from_address(), connection_or_remove_from_identity_map(), connection_or_set_identity_digest(), connection_or_set_state_open(), and orconn_target_get_name().
Nickname of OR on other side (if any).
Referenced by _connection_free(), circuit_count_pending_on_or_conn(), circuit_n_conn_done(), connection_or_check_valid_tls_handshake(), connection_or_init_conn_from_address(), connection_or_remove_from_identity_map(), connection_read_to_buf(), and getinfo_helper_events().
TLS connection state.
Referenced by _connection_free(), assert_connection_ok(), connection_handle_write_impl(), connection_or_check_valid_tls_handshake(), connection_or_nonopen_was_started_here(), connection_or_process_cells_from_inbuf(), connection_read_to_buf(), connection_tls_continue_handshake(), connection_tls_finish_handshake(), connection_tls_start_handshake(), and dumpstats().
Last tor_tls error code.
Referenced by connection_about_to_close_connection(), and connection_read_to_buf().
| time_t or_connection_t::client_used | 
When we last used this conn for any client traffic. If not recent, we can rate limit it further.
Referenced by circuit_deliver_create_cell(), command_process_relay_cell(), and relay_send_command_from_edge().
The actual address that this connection came from or went to. The addr field is prone to getting overridden by the address from the router descriptor matching identity_digest.
Referenced by command_process_netinfo_cell(), connection_exit_begin_conn(), connection_or_get_for_extend(), connection_or_group_set_badness(), and connection_or_init_conn_from_address().
When we send CREATE cells along this connection, which half of the space should we use?
Referenced by command_process_create_cell(), connection_or_check_valid_tls_handshake(), and get_unique_circ_id_by_conn().
| unsigned int or_connection_t::is_canonical | 
Should this connection be used for extending circuits to the server matching the identity_digest field? Set to true if we're pretty sure we aren't getting MITMed, either because we're connected to an address listed in a server descriptor, or because an authenticated NETINFO cell listed the address we're connected to as recognized.
Referenced by command_process_netinfo_cell(), connection_or_get_for_extend(), connection_or_group_set_badness(), connection_or_init_conn_from_address(), and connection_or_is_better().
| unsigned int or_connection_t::is_bad_for_new_circs | 
True iff this connection shouldn't get any new circs attached to it, because the connection is too old, or because there's a better one, etc.
Referenced by circuit_build_failed(), connection_or_get_for_extend(), connection_or_group_set_badness(), and run_connection_housekeeping().
| uint8_t or_connection_t::link_proto | 
What protocol version are we using? 0 for "none negotiated yet."
Referenced by append_cell_to_circuit_queue(), command_process_netinfo_cell(), command_process_versions_cell(), connection_fetch_var_cell_from_buf(), connection_or_get_for_extend(), and connection_tls_finish_handshake().
Which circ_id do we try to use next on this connection? This is always in the range 0..1<<15-1.
Referenced by get_unique_circ_id_by_conn(), and or_connection_new().
If we are setting this connection up, state information to do so.
Referenced by _connection_free(), command_process_netinfo_cell(), command_process_versions_cell(), connection_init_or_handshake_state(), connection_or_nonopen_was_started_here(), connection_or_send_versions(), and connection_or_set_state_open().
When was the outbuf last completely empty?
Referenced by run_connection_housekeeping().
When did we last add a non-padding cell to the outbuf? Bytes/s added to the bucket. (OPEN ORs only.)
Referenced by connection_bucket_refill(), and connection_or_init_conn_from_address().
Max bucket size for this conn. (OPEN ORs only.)
Referenced by connection_bucket_refill(), connection_bucket_should_increase(), and connection_or_init_conn_from_address().
When this hits 0, stop receiving. Every second we add 'bandwidthrate' to this, capping it at bandwidthburst. (OPEN ORs only)
Referenced by connection_bucket_read_limit(), connection_bucket_refill(), connection_buckets_decrement(), and connection_or_init_conn_from_address().
When this hits 0, stop writing. Like read_bucket.
Referenced by connection_bucket_refill(), connection_bucket_write_limit(), connection_buckets_decrement(), and connection_or_init_conn_from_address().
How many circuits use this connection as p_conn or n_conn ?
Referenced by connection_or_is_better(), control_event_or_conn_status(), HT_HEAD(), and run_connection_housekeeping().
struct circuit_t* or_connection_t::active_circuits [read]           | 
        
Double-linked ring of circuits with queued cells waiting for room to free up on this connection's outbuf. Every time we pull cells from a circuit, we advance this pointer to the next circuit in the ring.
Referenced by assert_active_circuits_ok(), connection_or_flush_from_first_active_circuit(), connection_or_flushed_some(), connection_or_unlink_all_active_circs(), make_circuit_active_on_conn(), and make_circuit_inactive_on_conn().
Priority queue of cell_ewma_t for circuits with queued cells waiting for room to free up on this connection's outbuf. Kept in heap order according to EWMA.
This is redundant with active_circuits; if we ever decide only to use the cell_ewma algorithm for choosing circuits, we can remove active_circuits.
Referenced by _connection_free(), add_cell_ewma_to_conn(), assert_active_circuits_ok(), connection_or_flush_from_first_active_circuit(), connection_or_unlink_all_active_circs(), or_connection_new(), pop_first_cell_ewma_from_conn(), remove_cell_ewma_from_conn(), and scale_active_circuits().
The tick on which the cell_ewma_ts in active_circuit_pqueue last had their ewma values rescaled.
Referenced by add_cell_ewma_to_conn(), connection_or_flush_from_first_active_circuit(), or_connection_new(), and scale_active_circuits().
struct or_connection_t* or_connection_t::next_with_same_id [read]           | 
        
Next connection with same identity digest as this one.
Referenced by connection_or_get_for_extend(), connection_or_group_set_badness(), connection_or_remove_from_identity_map(), and connection_or_set_identity_digest().
 1.5.6