Tor  0.4.3.0-alpha-dev
networkstatus_st.h
Go to the documentation of this file.
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-2019, The Tor Project, Inc. */
5 /* See LICENSE for licensing information */
6 
7 /**
8  * @file networkstatus_st.h
9  * @brief Networkstatus consensus/vote structure.
10  **/
11 
12 #ifndef NETWORKSTATUS_ST_H
13 #define NETWORKSTATUS_ST_H
14 
16 
17 /** Enumerates the possible seriousness values of a networkstatus document. */
18 typedef enum networkstatus_type_t {
19  NS_TYPE_VOTE,
20  NS_TYPE_CONSENSUS,
21  NS_TYPE_OPINION,
23 
24 /** A common structure to hold a v3 network status vote, or a v3 network
25  * status consensus. */
27  networkstatus_type_t type; /**< Vote, consensus, or opinion? */
28  consensus_flavor_t flavor; /**< If a consensus, what kind? */
29  unsigned int has_measured_bws : 1;/**< True iff this networkstatus contains
30  * measured= bandwidth values. */
31 
32  time_t published; /**< Vote only: Time when vote was written. */
33  time_t valid_after; /**< Time after which this vote or consensus applies. */
34  time_t fresh_until; /**< Time before which this is the most recent vote or
35  * consensus. */
36  time_t valid_until; /**< Time after which this vote or consensus should not
37  * be used. */
38 
39  /** Consensus only: what method was used to produce this consensus? */
41  /** Vote only: what methods is this voter willing to use? */
43 
44  /** List of 'package' lines describing hashes of downloadable packages */
46 
47  /** How long does this vote/consensus claim that authorities take to
48  * distribute their votes to one another? */
50  /** How long does this vote/consensus claim that authorities take to
51  * distribute their consensus signatures to one another? */
53 
54  /** Comma-separated list of recommended client software, or NULL if this
55  * voter has no opinion. */
57  char *server_versions;
58 
59  /** Lists of subprotocol versions which are _recommended_ for relays and
60  * clients, or which are _require_ for relays and clients. Tor shouldn't
61  * make any more network connections if a required protocol is missing.
62  */
64  char *recommended_client_protocols;
65  char *required_relay_protocols;
66  char *required_client_protocols;
67 
68  /** List of flags that this vote/consensus applies to routers. If a flag is
69  * not listed here, the voter has no opinion on what its value should be. */
71 
72  /** List of key=value strings for the parameters in this vote or
73  * consensus, sorted by key. */
75 
76  /** List of key=value strings for the bw weight parameters in the
77  * consensus. */
79 
80  /** List of networkstatus_voter_info_t. For a vote, only one element
81  * is included. For a consensus, one element is included for every voter
82  * whose vote contributed to the consensus. */
84 
85  struct authority_cert_t *cert; /**< Vote only: the voter's certificate. */
86 
87  /** Digests of this document, as signed. */
89  /** A SHA3-256 digest of the document, not including signatures: used for
90  * consensus diffs */
92 
93  /** List of router statuses, sorted by identity digest. For a vote,
94  * the elements are vote_routerstatus_t; for a consensus, the elements
95  * are routerstatus_t. */
97 
98  /** If present, a map from descriptor digest to elements of
99  * routerstatus_list. */
100  digestmap_t *desc_digest_map;
101 
102  /** Contains the shared random protocol data from a vote or consensus. */
104 
105  /** List of key=value strings from the headers of the bandwidth list file */
107 
108  /** A SHA256 digest of the bandwidth file used in a vote. */
110 };
111 
112 #endif /* !defined(NETWORKSTATUS_ST_H) */
common_digests_t digests
smartlist_t * bw_file_headers
smartlist_t * voters
uint8_t digest_sha3_as_signed[DIGEST256_LEN]
uint8_t bw_file_digest256[DIGEST256_LEN]
smartlist_t * net_params
smartlist_t * known_flags
smartlist_t * package_lines
Shared-randomness structure.
digestmap_t * desc_digest_map
consensus_flavor_t flavor
networkstatus_sr_info_t sr_info
#define DIGEST256_LEN
Definition: digest_sizes.h:23
unsigned int has_measured_bws
networkstatus_type_t
char * recommended_relay_protocols
smartlist_t * supported_methods
smartlist_t * routerstatus_list
struct authority_cert_t * cert
consensus_flavor_t
Definition: or.h:867
smartlist_t * weight_params
networkstatus_type_t type