Tor
0.4.8.0-alpha-dev
|
#include <edge_connection_st.h>
Data Fields | |
connection_t | base_ |
struct edge_connection_t * | next_stream |
int | package_window |
int | deliver_window |
struct circuit_t * | on_circuit |
struct crypt_path_t * | cpath_layer |
struct hs_ident_edge_conn_t * | hs_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 |
unsigned int | edge_blocked_on_circ:1 |
uint64_t | dirreq_id |
token_bucket_rw_t | bucket |
uint64_t | drain_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 |
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.
uint32_t address_ttl |
TTL for address-to-addr mapping on exit connection. Exit connections only.
Definition at line 43 of file edge_connection_st.h.
Referenced by send_resolved_cell(), and set_exitconn_info_from_resolve().
token_bucket_rw_t 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 83 of file edge_connection_st.h.
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.
Definition at line 36 of file edge_connection_st.h.
Referenced by circuit_detach_stream(), circuit_resume_edge_reading_helper(), connection_ap_get_begincell_flags(), connection_edge_send_command(), edge_get_ccontrol(), edge_get_max_rtt(), edge_uses_flow_control(), and relay_lookup_conn().
int deliver_window |
How many more relay cells can end at me?
Definition at line 29 of file edge_connection_st.h.
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 76 of file edge_connection_st.h.
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 88 of file edge_connection_st.h.
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 95 of file edge_connection_st.h.
unsigned int edge_blocked_on_circ |
True iff we've blocked reading until the circuit has fewer queued cells.
Definition at line 71 of file edge_connection_st.h.
Referenced by set_streams_blocked_on_circ().
unsigned int edge_has_sent_end |
For debugging; only used on edge connections. Set once we've set the stream end, and check in connection_about_to_close_connection().
Definition at line 65 of file edge_connection_st.h.
Referenced by connection_edge_about_to_close(), and connection_edge_end().
uint16_t end_reason |
The reason why this connection is closing; passed to the controller.
Definition at line 52 of file edge_connection_st.h.
uint32_t ewma_drain_rate |
N_EWMA of the drain rate of writes on this edge conn while buffers were present.
Definition at line 102 of file edge_connection_st.h.
Referenced by circuit_send_stream_xon(), and stream_drain_rate_changed().
uint32_t ewma_rate_last_sent |
The ewma drain rate the last time we sent an xon.
Definition at line 107 of file edge_connection_st.h.
Referenced by stream_drain_rate_changed().
unsigned int is_dns_request |
True iff this connection is for a DNS request only.
Definition at line 61 of file edge_connection_st.h.
unsigned int is_reverse_dns_lookup |
True iff this connection is for a PTR DNS request. (exit only)
Definition at line 63 of file edge_connection_st.h.
Referenced by set_exitconn_info_from_resolve().
uint32_t n_read |
Bytes read since last call to control_event_stream_bandwidth_used()
Definition at line 55 of file edge_connection_st.h.
uint32_t n_written |
Bytes written since last call to control_event_stream_bandwidth_used()
Definition at line 58 of file edge_connection_st.h.
struct edge_connection_t* next_stream |
Points to the next stream at this edge, if any
Definition at line 25 of file edge_connection_st.h.
Referenced by circuit_detach_stream(), circuit_dump_by_conn(), circuit_free_all(), circuit_get_streams_max_data_age(), circuit_resume_edge_reading_helper(), marked_circuit_streams_free_bytes(), relay_lookup_conn(), set_streams_blocked_on_circ(), and socks_mark_rend_circuit_timed_out().
uint8_t num_xoff_recv |
Number of XOFFs received
Definition at line 117 of file edge_connection_st.h.
uint8_t num_xon_recv |
Number of XONs received
Definition at line 120 of file edge_connection_st.h.
struct circuit_t* on_circuit |
The circuit (if any) that this edge connection is using.
Definition at line 31 of file edge_connection_st.h.
Referenced by circuit_detach_stream(), circuit_get_by_edge_conn(), connection_ap_get_begincell_flags(), connection_ap_handshake_send_begin(), connection_ap_handshake_send_resolve(), connection_ap_supports_optimistic_data(), connection_edge_send_command(), connection_exit_connect_dir(), dns_resolve(), edge_get_ccontrol(), edge_get_max_rtt(), and edge_uses_flow_control().
int package_window |
How many more relay cells can I send into the circuit?
Definition at line 27 of file edge_connection_st.h.
Referenced by circuit_resume_edge_reading_helper().
streamid_t stream_id |
Flags sent or received in the BEGIN cell for this connection The stream ID used for this edge connection on its circuit
Definition at line 48 of file edge_connection_st.h.
Referenced by connection_half_edge_add(), relay_lookup_conn(), and set_streams_blocked_on_circ().
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 114 of file edge_connection_st.h.
Referenced by flow_control_note_sent_data().
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 130 of file edge_connection_st.h.
Referenced by circuit_resume_edge_reading_helper().
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 125 of file edge_connection_st.h.