Tor  0.4.3.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-2019, 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) */
struct edge_connection_t * next_stream
struct circuit_t * on_circuit
unsigned int edge_blocked_on_circ
struct crypt_path_t * cpath_layer
Base connection structure.
Master header file for Tor-specific functionality.
uint16_t streamid_t
Definition: or.h:610
unsigned int edge_has_sent_end
rend_data_t * rend_data
unsigned int is_dns_request
unsigned int is_reverse_dns_lookup