dir_connection_st.h 2.3 KB

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