dir_connection_st.h 2.4 KB

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