Tor 0.4.9.2-alpha-dev
All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
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. Also used by the HSDir, setting only the blinded key,
48 in order to locate back the descriptor in the cache once the dir stream is
49 closed. */
50 struct hs_ident_dir_conn_t *hs_ident;
51
52 /** If this is a one-hop connection, tracks the state of the directory guard
53 * for this connection (if any). */
54 struct circuit_guard_state_t *guard_state;
55
56 char identity_digest[DIGEST_LEN]; /**< Hash of the public RSA key for
57 * the directory server's signing key. */
58
59 /** Unique ID for directory requests; this used to be in connection_t, but
60 * that's going away and being used on channels instead. The dirserver still
61 * needs this for the incoming side, so it's moved here. */
62 uint64_t dirreq_id;
63
64#ifdef MEASUREMENTS_21206
65 /** Number of RELAY_DATA cells received. */
66 uint32_t data_cells_received;
67
68 /** Number of RELAY_DATA cells sent. */
69 uint32_t data_cells_sent;
70#endif /* defined(MEASUREMENTS_21206) */
71};
72
73#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