Tor 0.4.9.1-alpha-dev
dir_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-2021, The Tor Project, Inc. */
5/* See LICENSE for licensing information */
6
7/**
8 * @file dir_connection_st.h
9 * @brief Client/server directory connection structure.
10 **/
11
12#ifndef DIR_CONNECTION_ST_H
13#define DIR_CONNECTION_ST_H
14
16
18
19/** Subtype of connection_t for an "directory connection" -- that is, an HTTP
20 * connection to retrieve or serve directory material. */
22 connection_t base_;
23
24 /** Which 'resource' did we ask the directory for? This is typically the part
25 * of the URL string that defines, relative to the directory conn purpose,
26 * what thing we want. For example, in router descriptor downloads by
27 * descriptor digest, it contains "d/", then one or more +-separated
28 * fingerprints.
29 **/
31 /** Is this dirconn direct, or via a multi-hop Tor circuit?
32 * Direct connections can use the DirPort, or BEGINDIR over the ORPort. */
33 unsigned int dirconn_direct:1;
34
35 /** If we're fetching descriptors, what router purpose shall we assign
36 * to them? */
38
39 /** List of spooled_resource_t for objects that we're spooling. We use
40 * it from back to front. */
42 /** The compression object doing on-the-fly compression for spooled data. */
44
45 /* Hidden service connection identifier for dir connections: Used by HS
46 client-side code to fetch HS descriptors, and by the service-side code to
47 upload descriptors. */
48 struct hs_ident_dir_conn_t *hs_ident;
49
50 /** If this is a one-hop connection, tracks the state of the directory guard
51 * for this connection (if any). */
52 struct circuit_guard_state_t *guard_state;
53
54 char identity_digest[DIGEST_LEN]; /**< Hash of the public RSA key for
55 * the directory server's signing key. */
56
57 /** Unique ID for directory requests; this used to be in connection_t, but
58 * that's going away and being used on channels instead. The dirserver still
59 * needs this for the incoming side, so it's moved here. */
60 uint64_t dirreq_id;
61
62#ifdef MEASUREMENTS_21206
63 /** Number of RELAY_DATA cells received. */
64 uint32_t data_cells_received;
65
66 /** Number of RELAY_DATA cells sent. */
67 uint32_t data_cells_sent;
68#endif /* defined(MEASUREMENTS_21206) */
69};
70
71#endif /* !defined(DIR_CONNECTION_ST_H) */
Base connection structure.
#define DIGEST_LEN
Definition: digest_sizes.h:20
unsigned int dirconn_direct
char identity_digest[DIGEST_LEN]
smartlist_t * spool
struct tor_compress_state_t * compress_state
struct circuit_guard_state_t * guard_state