Tor 0.4.9.3-alpha-dev
Loading...
Searching...
No Matches
Data Fields
edge_connection_t Struct Reference

#include <edge_connection_st.h>

Data Fields

connection_t base_
 
struct edge_connection_tnext_stream
 
int package_window
 
int deliver_window
 
struct circuit_ton_circuit
 
struct crypt_path_tcpath_layer
 
struct hs_ident_edge_conn_ths_ident
 
uint32_t address_ttl
 
uint32_t begincell_flags
 
streamid_t stream_id
 
uint16_t end_reason
 
uint32_t n_read
 
uint32_t n_written
 
unsigned int is_dns_request:1
 
unsigned int is_reverse_dns_lookup:1
 
unsigned int edge_has_sent_end:1
 
uint64_t dirreq_id
 
token_bucket_rw_t bucket
 
uint64_t drain_start_usec
 
uint64_t xoff_grace_period_start_usec
 
uint32_t drained_bytes
 
uint32_t prev_drained_bytes
 
uint32_t ewma_drain_rate
 
uint32_t ewma_rate_last_sent
 
uint32_t total_bytes_xmit
 
uint8_t num_xoff_recv
 
uint8_t num_xon_recv
 
uint8_t xoff_sent: 1
 
uint8_t xoff_received: 1
 

Detailed Description

Subtype of connection_t for an "edge connection" – that is, an entry (ap) connection, or an exit.

Definition at line 22 of file edge_connection_st.h.

Field Documentation

◆ address_ttl

uint32_t address_ttl

TTL for address-to-addr mapping on exit connection. Exit connections only.

Definition at line 47 of file edge_connection_st.h.

Referenced by connection_edge_end(), connection_edge_finished_connecting(), connection_exit_connect(), dns_resolve_impl(), send_resolved_cell(), send_resolved_hostname_cell(), and set_exitconn_info_from_resolve().

◆ base_

connection_t base_

Definition at line 23 of file edge_connection_st.h.

◆ begincell_flags

uint32_t begincell_flags

Definition at line 49 of file edge_connection_st.h.

◆ bucket

Used for rate limiting the read side of this edge connection when congestion control is enabled on its circuit. The XON cell ewma_drain_rate parameter is used to set the bucket limits.

Definition at line 84 of file edge_connection_st.h.

Referenced by circuit_process_stream_xon(), connection_bucket_read_limit(), connection_buckets_decrement(), and edge_connection_new().

◆ cpath_layer

struct crypt_path_t* cpath_layer

A pointer to which node in the circ this conn exits at. Set for AP connections and for hidden service exit connections. Note that edges that use conflux should use the helpers in conflux_util.c instead of accessing this directly.

Definition at line 40 of file edge_connection_st.h.

Referenced by circuit_detach_stream(), connection_ap_expire_beginning(), connection_ap_get_begincell_flags(), connection_ap_handshake_send_begin(), connection_edge_destroy(), connection_edge_package_raw_inbuf(), connection_edge_send_command(), edge_get_max_rtt(), edge_uses_cpath(), edge_uses_flow_control(), and handle_hs_exit_conn().

◆ deliver_window

int deliver_window

◆ dirreq_id

uint64_t dirreq_id

Unique ID for directory requests; this used to be in connection_t, but that's going away and being used on channels instead. We still tag edge connections with dirreq_id from circuits, so it's copied here.

Definition at line 77 of file edge_connection_st.h.

Referenced by connection_exit_begin_conn(), and connection_exit_connect_dir().

◆ drain_start_usec

uint64_t drain_start_usec

Monotime timestamp of the last time we sent a flow control message for this edge, used to compute advisory rates

Definition at line 89 of file edge_connection_st.h.

Referenced by compute_drain_rate(), and flow_control_decide_xon().

◆ drained_bytes

uint32_t drained_bytes

Number of bytes written since we either emptied our buffers, or sent an advisory drate rate. Can wrap, buf if so, we must reset the usec timestamp above. (Or make this u64, idk).

Definition at line 108 of file edge_connection_st.h.

Referenced by flow_control_decide_xon().

◆ edge_has_sent_end

unsigned int edge_has_sent_end

◆ end_reason

uint16_t end_reason

◆ ewma_drain_rate

uint32_t ewma_drain_rate

N_EWMA of the drain rate of writes on this edge conn while buffers were present.

Definition at line 115 of file edge_connection_st.h.

Referenced by circuit_send_stream_xon(), flow_control_decide_xoff(), flow_control_decide_xon(), and stream_drain_rate_changed().

◆ ewma_rate_last_sent

uint32_t ewma_rate_last_sent

The ewma drain rate the last time we sent an xon.

Definition at line 120 of file edge_connection_st.h.

Referenced by circuit_send_stream_xon(), flow_control_decide_xon(), and stream_drain_rate_changed().

◆ hs_ident

struct hs_ident_edge_conn_t* hs_ident

Definition at line 45 of file edge_connection_st.h.

◆ is_dns_request

unsigned int is_dns_request

True iff this connection is for a DNS request only.

Definition at line 65 of file edge_connection_st.h.

Referenced by dnsserv_launch_request(), and evdns_server_callback().

◆ is_reverse_dns_lookup

unsigned int is_reverse_dns_lookup

True iff this connection is for a PTR DNS request. (exit only)

Definition at line 67 of file edge_connection_st.h.

Referenced by dns_resolve_impl(), inform_pending_connections(), and set_exitconn_info_from_resolve().

◆ n_read

uint32_t n_read

◆ n_written

uint32_t n_written

◆ next_stream

struct edge_connection_t* next_stream

◆ num_xoff_recv

uint8_t num_xoff_recv

Number of XOFFs received

Definition at line 130 of file edge_connection_st.h.

Referenced by circuit_process_stream_xoff(), circuit_process_stream_xon(), and flow_control_note_sent_data().

◆ num_xon_recv

uint8_t num_xon_recv

Number of XONs received

Definition at line 133 of file edge_connection_st.h.

Referenced by circuit_process_stream_xoff(), circuit_process_stream_xon(), and flow_control_note_sent_data().

◆ on_circuit

struct circuit_t* on_circuit

◆ package_window

int package_window

◆ prev_drained_bytes

uint32_t prev_drained_bytes

Definition at line 109 of file edge_connection_st.h.

◆ stream_id

streamid_t stream_id

◆ total_bytes_xmit

uint32_t total_bytes_xmit

The following fields are used to count the total bytes sent on this stream, and compare them to the number of XON and XOFFs received, so that clients can check rate limits of XOFF/XON to prevent dropmark attacks.

Definition at line 127 of file edge_connection_st.h.

Referenced by circuit_process_stream_xoff(), circuit_process_stream_xon(), and flow_control_note_sent_data().

◆ xoff_grace_period_start_usec

uint64_t xoff_grace_period_start_usec

Monotime timestamp of when we started the XOFF grace period for this edge.

See the comments on XOFF_GRACE_PERIOD_USEC for an explanation on how this is used.

A value of 0 is considered "unset". This isn't great, but we set this field as the output from monotime_absolute_usec() which should only ever be 0 within the first 1 microsecond of initializing the monotonic timer subsystem.

Definition at line 101 of file edge_connection_st.h.

Referenced by flow_control_decide_xoff().

◆ xoff_received

uint8_t xoff_received

Flag that tells us if an XOFF has been received; cleared when we get an XON. Used to ensure that this edge keeps reads on its edge socket disabled.

Definition at line 143 of file edge_connection_st.h.

Referenced by circuit_process_stream_xoff(), circuit_process_stream_xon(), circuit_resume_edge_reading_helper(), and connection_read_bw_exhausted().

◆ xoff_sent

uint8_t xoff_sent

Flag that tells us if an XOFF has been sent; cleared when we send an XON. Used to avoid sending multiple

Definition at line 138 of file edge_connection_st.h.

Referenced by circuit_send_stream_xoff(), circuit_send_stream_xon(), flow_control_decide_xoff(), and flow_control_decide_xon().


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