Tor  0.4.6.0-alpha-dev
edge_connection_st.h
Go to the documentation of this file.
1 /* Copyright (c) 2001 Matej Pfajfar.
2  * Copyright (c) 2001-2004, Roger Dingledine.
3  * Copyright (c) 2004-2006, Roger Dingledine, Nick Mathewson.
4  * Copyright (c) 2007-2020, The Tor Project, Inc. */
5 /* See LICENSE for licensing information */
6 
7 /**
8  * @file edge_connection_st.h
9  * @brief Edge-connection structure.
10  **/
11 
12 #ifndef EDGE_CONNECTION_ST_H
13 #define EDGE_CONNECTION_ST_H
14 
15 #include "core/or/or.h"
16 
17 #include "core/or/connection_st.h"
18 
19 /** Subtype of connection_t for an "edge connection" -- that is, an entry (ap)
20  * connection, or an exit. */
22  connection_t base_;
23 
24  struct edge_connection_t *next_stream; /**< Points to the next stream at this
25  * edge, if any */
26  int package_window; /**< How many more relay cells can I send into the
27  * circuit? */
28  int deliver_window; /**< How many more relay cells can end at me? */
29 
30  struct circuit_t *on_circuit; /**< The circuit (if any) that this edge
31  * connection is using. */
32 
33  /** A pointer to which node in the circ this conn exits at. Set for AP
34  * connections and for hidden service exit connections. */
36  /** What rendezvous service are we querying for (if an AP) or providing (if
37  * an exit)? */
39 
40  /* Hidden service connection identifier for edge connections. Used by the HS
41  * client-side code to identify client SOCKS connections and by the
42  * service-side code to match HS circuits with their streams. */
43  struct hs_ident_edge_conn_t *hs_ident;
44 
45  uint32_t address_ttl; /**< TTL for address-to-addr mapping on exit
46  * connection. Exit connections only. */
47  uint32_t begincell_flags; /** Flags sent or received in the BEGIN cell
48  * for this connection */
49 
50  streamid_t stream_id; /**< The stream ID used for this edge connection on its
51  * circuit */
52 
53  /** The reason why this connection is closing; passed to the controller. */
54  uint16_t end_reason;
55 
56  /** Bytes read since last call to control_event_stream_bandwidth_used() */
57  uint32_t n_read;
58 
59  /** Bytes written since last call to control_event_stream_bandwidth_used() */
60  uint32_t n_written;
61 
62  /** True iff this connection is for a DNS request only. */
63  unsigned int is_dns_request:1;
64  /** True iff this connection is for a PTR DNS request. (exit only) */
65  unsigned int is_reverse_dns_lookup:1;
66 
67  unsigned int edge_has_sent_end:1; /**< For debugging; only used on edge
68  * connections. Set once we've set the stream end,
69  * and check in connection_about_to_close_connection().
70  */
71  /** True iff we've blocked reading until the circuit has fewer queued
72  * cells. */
73  unsigned int edge_blocked_on_circ:1;
74 
75  /** Unique ID for directory requests; this used to be in connection_t, but
76  * that's going away and being used on channels instead. We still tag
77  * edge connections with dirreq_id from circuits, so it's copied here. */
78  uint64_t dirreq_id;
79 };
80 
81 #endif /* !defined(EDGE_CONNECTION_ST_H) */
edge_connection_t::rend_data
rend_data_t * rend_data
Definition: edge_connection_st.h:38
edge_connection_t::stream_id
streamid_t stream_id
Definition: edge_connection_st.h:50
edge_connection_t::cpath_layer
struct crypt_path_t * cpath_layer
Definition: edge_connection_st.h:35
edge_connection_t::address_ttl
uint32_t address_ttl
Definition: edge_connection_st.h:45
edge_connection_t::edge_has_sent_end
unsigned int edge_has_sent_end
Definition: edge_connection_st.h:67
edge_connection_t::edge_blocked_on_circ
unsigned int edge_blocked_on_circ
Definition: edge_connection_st.h:73
edge_connection_t::n_read
uint32_t n_read
Definition: edge_connection_st.h:57
edge_connection_t::end_reason
uint16_t end_reason
Definition: edge_connection_st.h:54
crypt_path_t
Definition: crypt_path_st.h:47
edge_connection_t::is_reverse_dns_lookup
unsigned int is_reverse_dns_lookup
Definition: edge_connection_st.h:65
edge_connection_t::package_window
int package_window
Definition: edge_connection_st.h:26
circuit_t
Definition: circuit_st.h:61
edge_connection_t::deliver_window
int deliver_window
Definition: edge_connection_st.h:28
edge_connection_t::is_dns_request
unsigned int is_dns_request
Definition: edge_connection_st.h:63
connection_t
Definition: connection_st.h:45
edge_connection_t::on_circuit
struct circuit_t * on_circuit
Definition: edge_connection_st.h:30
connection_st.h
Base connection structure.
edge_connection_t
Definition: edge_connection_st.h:21
rend_data_t
Definition: or.h:419
streamid_t
uint16_t streamid_t
Definition: or.h:611
edge_connection_t::n_written
uint32_t n_written
Definition: edge_connection_st.h:60
hs_ident_edge_conn_t
Definition: hs_ident.h:103
edge_connection_t::dirreq_id
uint64_t dirreq_id
Definition: edge_connection_st.h:78
edge_connection_t::next_stream
struct edge_connection_t * next_stream
Definition: edge_connection_st.h:24
or.h
Master header file for Tor-specific functionality.