rend_intro_point_st.h 3.0 KB

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