cpath_build_state_st.h 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738
  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. #ifndef CIRCUIT_BUILD_STATE_ST_ST_H
  7. #define CIRCUIT_BUILD_STATE_ST_ST_H
  8. /** Information used to build a circuit. */
  9. struct cpath_build_state_t {
  10. /** Intended length of the final circuit. */
  11. int desired_path_len;
  12. /** How to extend to the planned exit node. */
  13. extend_info_t *chosen_exit;
  14. /** Whether every node in the circ must have adequate uptime. */
  15. unsigned int need_uptime : 1;
  16. /** Whether every node in the circ must have adequate capacity. */
  17. unsigned int need_capacity : 1;
  18. /** Whether the last hop was picked with exiting in mind. */
  19. unsigned int is_internal : 1;
  20. /** Did we pick this as a one-hop tunnel (not safe for other streams)?
  21. * These are for encrypted dir conns that exit to this router, not
  22. * for arbitrary exits from the circuit. */
  23. unsigned int onehop_tunnel : 1;
  24. /** The crypt_path_t to append after rendezvous: used for rendezvous. */
  25. crypt_path_t *pending_final_cpath;
  26. /** A ref-counted reference to the crypt_path_t to append after
  27. * rendezvous; used on the service side. */
  28. crypt_path_reference_t *service_pending_final_cpath_ref;
  29. /** How many times has building a circuit for this task failed? */
  30. int failure_count;
  31. /** At what time should we give up on this task? */
  32. time_t expiry_time;
  33. };
  34. #endif