dir_server_st.h 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  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 DIR_SERVER_ST_H
  7. #define DIR_SERVER_ST_H
  8. #include "lib/cc/torint.h"
  9. #include "core/or/or.h"
  10. #include "feature/nodelist/routerstatus_st.h"
  11. /** Represents information about a single trusted or fallback directory
  12. * server. */
  13. struct dir_server_t {
  14. char *description;
  15. char *nickname;
  16. char *address; /**< Hostname. */
  17. /* XX/teor - why do we duplicate the address and port fields here and in
  18. * fake_status? Surely we could just use fake_status (#17867). */
  19. tor_addr_t ipv6_addr; /**< IPv6 address if present; AF_UNSPEC if not */
  20. uint32_t addr; /**< IPv4 address. */
  21. uint16_t dir_port; /**< Directory port. */
  22. uint16_t or_port; /**< OR port: Used for tunneling connections. */
  23. uint16_t ipv6_orport; /**< OR port corresponding to ipv6_addr. */
  24. double weight; /** Weight used when selecting this node at random */
  25. char digest[DIGEST_LEN]; /**< Digest of identity key. */
  26. char v3_identity_digest[DIGEST_LEN]; /**< Digest of v3 (authority only,
  27. * high-security) identity key. */
  28. unsigned int is_running:1; /**< True iff we think this server is running. */
  29. unsigned int is_authority:1; /**< True iff this is a directory authority
  30. * of some kind. */
  31. /** True iff this server has accepted the most recent server descriptor
  32. * we tried to upload to it. */
  33. unsigned int has_accepted_serverdesc:1;
  34. /** What kind of authority is this? (Bitfield.) */
  35. dirinfo_type_t type;
  36. time_t addr_current_at; /**< When was the document that we derived the
  37. * address information from published? */
  38. routerstatus_t fake_status; /**< Used when we need to pass this trusted
  39. * dir_server_t to
  40. * directory_request_set_routerstatus.
  41. * as a routerstatus_t. Not updated by the
  42. * router-status management code!
  43. **/
  44. };
  45. #endif