dir_server_st.h (2553B)
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-2021, The Tor Project, Inc. */ 5 /* See LICENSE for licensing information */ 6 7 /** 8 * @file dir_server_st.h 9 * @brief Trusted/fallback directory server structure. 10 **/ 11 12 #ifndef DIR_SERVER_ST_H 13 #define DIR_SERVER_ST_H 14 15 #include "lib/cc/torint.h" 16 #include "core/or/or.h" 17 #include "feature/nodelist/routerstatus_st.h" 18 19 struct smartlist_t; 20 21 /** Represents information about a single trusted or fallback directory 22 * server. */ 23 struct dir_server_t { 24 char *description; 25 char *nickname; 26 char *address; /**< Hostname. */ 27 /* XX/teor - why do we duplicate the address and port fields here and in 28 * fake_status? Surely we could just use fake_status (#17867). */ 29 tor_addr_t ipv4_addr; 30 uint16_t ipv4_dirport; /**< Directory port. */ 31 uint16_t ipv4_orport; /**< OR port: Used for tunneling connections. */ 32 tor_addr_t ipv6_addr; /**< IPv6 address if present; AF_UNSPEC if not */ 33 uint16_t ipv6_orport; /**< OR port corresponding to ipv6_addr. */ 34 double weight; /** Weight used when selecting this node at random */ 35 char digest[DIGEST_LEN]; /**< Digest of identity key. */ 36 char v3_identity_digest[DIGEST_LEN]; /**< Digest of v3 (authority only, 37 * high-security) identity key. */ 38 39 unsigned int is_running:1; /**< True iff we think this server is running. */ 40 unsigned int is_authority:1; /**< True iff this is a directory authority 41 * of some kind. */ 42 43 /** True iff this server has accepted the most recent server descriptor 44 * we tried to upload to it. */ 45 unsigned int has_accepted_serverdesc:1; 46 47 /** What kind of authority is this? (Bitfield.) */ 48 dirinfo_type_t type; 49 50 time_t addr_current_at; /**< When was the document that we derived the 51 * address information from published? */ 52 53 /** Authority only. Can be null. If present, a list of auth_dirport_t 54 * representing HTTP dirports for this authority. */ 55 struct smartlist_t *auth_dirports; 56 57 routerstatus_t fake_status; /**< Used when we need to pass this trusted 58 * dir_server_t to 59 * directory_request_set_routerstatus. 60 * as a routerstatus_t. Not updated by the 61 * router-status management code! 62 **/ 63 }; 64 65 #endif /* !defined(DIR_SERVER_ST_H) */