Tor 0.4.9.0-alpha-dev
or_circuit_st.h
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-2021, The Tor Project, Inc. */
5/* See LICENSE for licensing information */
6
7#ifndef OR_CIRCUIT_ST_H
8#define OR_CIRCUIT_ST_H
9
10#include "core/or/or.h"
11
12#include "core/or/circuit_st.h"
14
16
17struct onion_queue_t;
18
19/** An or_circuit_t holds information needed to implement a circuit at an
20 * OR. */
22 circuit_t base_;
23
24 /** Pointer to an entry on the onion queue, if this circuit is waiting for a
25 * chance to give an onionskin to a cpuworker. Used only in onion.c */
27 /** Pointer to a workqueue entry, if this circuit has given an onionskin to
28 * a cpuworker and is waiting for a response. Used to decide whether it is
29 * safe to free a circuit or if it is still in use by a cpuworker. */
31
32 /** The circuit_id used in the previous (backward) hop of this circuit. */
34 /** Queue of cells waiting to be transmitted on p_conn. */
36 /** The channel that is previous in this circuit. */
38 /** Linked list of Exit streams associated with this circuit.
39 *
40 * Note that any updates to this pointer must be followed with
41 * conflux_update_n_streams() to keep the other legs n_streams
42 * in sync. */
44 /** Linked list of Exit streams associated with this circuit that are
45 * still being resolved.
46 *
47 * Just like with n_streams, any updates to this pointer must
48 * be followed with conflux_update_resolving_streams().
49 */
51
52 /** Cryptographic state used for encrypting and authenticating relay
53 * cells to and from this hop. */
55
56 /** Points to spliced circuit if purpose is REND_ESTABLISHED, and circuit
57 * is not marked for close. */
59
60 /** Stores KH for the handshake. */
61 char rend_circ_nonce[DIGEST_LEN];/* KH in tor-spec.txt */
62
63 /** Number of cells which we have discarded because of having no next hop,
64 * despite not recognizing the cell. */
66
67 /** How many more relay_early cells can we send on this circuit, according
68 * to the specification? */
70
71 /* We have already received an INTRODUCE1 cell on this circuit. */
72 unsigned int already_received_introduce1 : 1;
73
74 /** If set, this circuit carries HS traffic. Consider it in any HS
75 * statistics. */
77
78 /** True iff this circuit was made with a CREATE_FAST cell, or a CREATE[2]
79 * cell with a TAP handshake. If this is the case and this is a rend circuit,
80 * this is a v2 circuit, otherwise if this is a rend circuit it's a v3
81 * circuit. */
83
84 /** Number of cells that were removed from circuit queue; reset every
85 * time when writing buffer stats to disk. */
87
88 /** Total time in milliseconds that cells spent in both app-ward and
89 * exit-ward queues of this circuit; reset every time when writing
90 * buffer stats to disk. */
92
93 /** If set, the DoS defenses are enabled on this circuit meaning that the
94 * introduce2_bucket is initialized and used. */
96 /** If set, the DoS defenses were explicitly enabled through the
97 * ESTABLISH_INTRO cell extension. If unset, the consensus is used to learn
98 * if the defenses can be enabled or not. */
100
101 /** INTRODUCE2 cell bucket controlling how much can go on this circuit. Only
102 * used if this is a service introduction circuit at the intro point
103 * (purpose = CIRCUIT_PURPOSE_INTRO_POINT). */
105
106 /** RELAY_BEGIN and RELAY_RESOLVE cell bucket controlling how much can go on
107 * this circuit. Only used if this is the end of a circuit on an exit node.*/
109};
110
111#endif /* !defined(OR_CIRCUIT_ST_H) */
Base circuit structure.
Path structures for origin circuits.
#define DIGEST_LEN
Definition: digest_sizes.h:20
Master header file for Tor-specific functionality.
uint32_t circid_t
Definition: or.h:497
edge_connection_t * resolving_streams
Definition: or_circuit_st.h:50
struct onion_queue_t * onionqueue_entry
Definition: or_circuit_st.h:26
uint64_t total_cell_waiting_time
Definition: or_circuit_st.h:91
unsigned int circuit_carries_hs_traffic_stats
Definition: or_circuit_st.h:76
channel_t * p_chan
Definition: or_circuit_st.h:37
unsigned int remaining_relay_early_cells
Definition: or_circuit_st.h:69
struct workqueue_entry_t * workqueue_entry
Definition: or_circuit_st.h:30
unsigned int introduce2_dos_defense_enabled
Definition: or_circuit_st.h:95
uint32_t n_cells_discarded_at_end
Definition: or_circuit_st.h:65
token_bucket_ctr_t stream_limiter
circid_t p_circ_id
Definition: or_circuit_st.h:33
bool used_legacy_circuit_handshake
Definition: or_circuit_st.h:82
cell_queue_t p_chan_cells
Definition: or_circuit_st.h:35
unsigned int introduce2_dos_defense_explicit
Definition: or_circuit_st.h:99
token_bucket_ctr_t introduce2_bucket
struct or_circuit_t * rend_splice
Definition: or_circuit_st.h:58
edge_connection_t * n_streams
Definition: or_circuit_st.h:43
uint32_t processed_cells
Definition: or_circuit_st.h:86
char rend_circ_nonce[DIGEST_LEN]
Definition: or_circuit_st.h:61
relay_crypto_t crypto
Definition: or_circuit_st.h:54
Definition: workqueue.c:98
Headers for token_bucket.c.