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 */
7 #ifndef DIR_CONNECTION_ST_H
8 #define DIR_CONNECTION_ST_H
10 #include "core/or/connection_st.h"
12 struct tor_compress_state_t
;
14 /** Subtype of connection_t for an "directory connection" -- that is, an HTTP
15 * connection to retrieve or serve directory material. */
16 struct dir_connection_t
{
19 /** Which 'resource' did we ask the directory for? This is typically the part
20 * of the URL string that defines, relative to the directory conn purpose,
21 * what thing we want. For example, in router descriptor downloads by
22 * descriptor digest, it contains "d/", then one or more +-separated
25 char *requested_resource
;
26 unsigned int dirconn_direct
:1; /**< Is this dirconn direct, or via Tor? */
28 /** If we're fetching descriptors, what router purpose shall we assign
30 uint8_t router_purpose
;
32 /** List of spooled_resource_t for objects that we're spooling. We use
33 * it from back to front. */
35 /** The compression object doing on-the-fly compression for spooled data. */
36 struct tor_compress_state_t
*compress_state
;
38 /** What rendezvous service are we querying for? */
39 rend_data_t
*rend_data
;
41 /* Hidden service connection identifier for dir connections: Used by HS
42 client-side code to fetch HS descriptors, and by the service-side code to
43 upload descriptors. */
44 struct hs_ident_dir_conn_t
*hs_ident
;
46 /** If this is a one-hop connection, tracks the state of the directory guard
47 * for this connection (if any). */
48 struct circuit_guard_state_t
*guard_state
;
50 char identity_digest
[DIGEST_LEN
]; /**< Hash of the public RSA key for
51 * the directory server's signing key. */
53 /** Unique ID for directory requests; this used to be in connection_t, but
54 * that's going away and being used on channels instead. The dirserver still
55 * needs this for the incoming side, so it's moved here. */
58 #ifdef MEASUREMENTS_21206
59 /** Number of RELAY_DATA cells received. */
60 uint32_t data_cells_received
;
62 /** Number of RELAY_DATA cells sent. */
63 uint32_t data_cells_sent
;
64 #endif /* defined(MEASUREMENTS_21206) */