Tor  0.4.3.0-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-2019, 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 
15 #include "core/or/connection_st.h"
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  unsigned int dirconn_direct:1; /**< Is this dirconn direct, or via Tor? */
32 
33  /** If we're fetching descriptors, what router purpose shall we assign
34  * to them? */
35  uint8_t router_purpose;
36 
37  /** List of spooled_resource_t for objects that we're spooling. We use
38  * it from back to front. */
40  /** The compression object doing on-the-fly compression for spooled data. */
42 
43  /** What rendezvous service are we querying for? */
45 
46  /* Hidden service connection identifier for dir connections: Used by HS
47  client-side code to fetch HS descriptors, and by the service-side code to
48  upload descriptors. */
49  struct hs_ident_dir_conn_t *hs_ident;
50 
51  /** If this is a one-hop connection, tracks the state of the directory guard
52  * for this connection (if any). */
53  struct circuit_guard_state_t *guard_state;
54 
55  char identity_digest[DIGEST_LEN]; /**< Hash of the public RSA key for
56  * the directory server's signing key. */
57 
58  /** Unique ID for directory requests; this used to be in connection_t, but
59  * that's going away and being used on channels instead. The dirserver still
60  * needs this for the incoming side, so it's moved here. */
61  uint64_t dirreq_id;
62 
63 #ifdef MEASUREMENTS_21206
64  /** Number of RELAY_DATA cells received. */
65  uint32_t data_cells_received;
66 
67  /** Number of RELAY_DATA cells sent. */
68  uint32_t data_cells_sent;
69 #endif /* defined(MEASUREMENTS_21206) */
70 };
71 
72 #endif /* !defined(DIR_CONNECTION_ST_H) */
struct tor_compress_state_t * compress_state
unsigned int dirconn_direct
Base connection structure.
#define DIGEST_LEN
Definition: digest_sizes.h:20
rend_data_t * rend_data
struct circuit_guard_state_t * guard_state
char identity_digest[DIGEST_LEN]
smartlist_t * spool