rend_intro_point_st.h 3.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  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 REND_INTRO_POINT_ST_H
  7. #define REND_INTRO_POINT_ST_H
  8. struct replaycache_t;
  9. struct crypto_pk_t;
  10. /** Introduction point information. Used both in rend_service_t (on
  11. * the service side) and in rend_service_descriptor_t (on both the
  12. * client and service side). */
  13. struct rend_intro_point_t {
  14. extend_info_t *extend_info; /**< Extend info for connecting to this
  15. * introduction point via a multi-hop path. */
  16. struct crypto_pk_t *intro_key; /**< Introduction key that replaces the
  17. * service key, if this descriptor is V2. */
  18. /** (Client side only) Flag indicating that a timeout has occurred
  19. * after sending an INTRODUCE cell to this intro point. After a
  20. * timeout, an intro point should not be tried again during the same
  21. * hidden service connection attempt, but it may be tried again
  22. * during a future connection attempt. */
  23. unsigned int timed_out : 1;
  24. /** (Client side only) The number of times we have failed to build a
  25. * circuit to this intro point for some reason other than our
  26. * circuit-build timeout. See also MAX_INTRO_POINT_REACHABILITY_FAILURES. */
  27. unsigned int unreachable_count : 3;
  28. /** (Service side only) Flag indicating that this intro point was
  29. * included in the last HS descriptor we generated. */
  30. unsigned int listed_in_last_desc : 1;
  31. /** (Service side only) A replay cache recording the RSA-encrypted parts
  32. * of INTRODUCE2 cells this intro point's circuit has received. This is
  33. * used to prevent replay attacks. */
  34. struct replaycache_t *accepted_intro_rsa_parts;
  35. /** (Service side only) Count of INTRODUCE2 cells accepted from this
  36. * intro point.
  37. */
  38. int accepted_introduce2_count;
  39. /** (Service side only) Maximum number of INTRODUCE2 cells that this IP
  40. * will accept. This is a random value between
  41. * INTRO_POINT_MIN_LIFETIME_INTRODUCTIONS and
  42. * INTRO_POINT_MAX_LIFETIME_INTRODUCTIONS. */
  43. int max_introductions;
  44. /** (Service side only) The time at which this intro point was first
  45. * published, or -1 if this intro point has not yet been
  46. * published. */
  47. time_t time_published;
  48. /** (Service side only) The time at which this intro point should
  49. * (start to) expire, or -1 if we haven't decided when this intro
  50. * point should expire. */
  51. time_t time_to_expire;
  52. /** (Service side only) The amount of circuit creation we've made to this
  53. * intro point. This is incremented every time we do a circuit relaunch on
  54. * this object which is triggered when the circuit dies but the node is
  55. * still in the consensus. After MAX_INTRO_POINT_CIRCUIT_RETRIES, we give
  56. * up on it. */
  57. unsigned int circuit_retries;
  58. /** (Service side only) Set if this intro point has an established circuit
  59. * and unset if it doesn't. */
  60. unsigned int circuit_established:1;
  61. };
  62. #endif