dir_connection_st.h 2.3 KB

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