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