Tor  0.4.4.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-2020, 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) */
networkstatus_t::package_lines
smartlist_t * package_lines
Definition: networkstatus_st.h:45
networkstatus_t::valid_until
time_t valid_until
Definition: networkstatus_st.h:36
networkstatus_t::digests
common_digests_t digests
Definition: networkstatus_st.h:88
networkstatus_t::published
time_t published
Definition: networkstatus_st.h:32
networkstatus_t::bw_file_digest256
uint8_t bw_file_digest256[DIGEST256_LEN]
Definition: networkstatus_st.h:109
networkstatus_t::type
networkstatus_type_t type
Definition: networkstatus_st.h:27
networkstatus_t::voters
smartlist_t * voters
Definition: networkstatus_st.h:83
networkstatus_t::bw_file_headers
smartlist_t * bw_file_headers
Definition: networkstatus_st.h:106
common_digests_t
Definition: crypto_digest.h:87
consensus_flavor_t
consensus_flavor_t
Definition: or.h:867
networkstatus_t::has_measured_bws
unsigned int has_measured_bws
Definition: networkstatus_st.h:29
networkstatus_t::desc_digest_map
digestmap_t * desc_digest_map
Definition: networkstatus_st.h:100
networkstatus_t::client_versions
char * client_versions
Definition: networkstatus_st.h:56
networkstatus_t::flavor
consensus_flavor_t flavor
Definition: networkstatus_st.h:28
networkstatus_type_t
networkstatus_type_t
Definition: networkstatus_st.h:18
networkstatus_t::sr_info
networkstatus_sr_info_t sr_info
Definition: networkstatus_st.h:103
networkstatus_sr_info_t
Definition: networkstatus_sr_info_st.h:15
DIGEST256_LEN
#define DIGEST256_LEN
Definition: digest_sizes.h:23
networkstatus_t::routerstatus_list
smartlist_t * routerstatus_list
Definition: networkstatus_st.h:96
networkstatus_t::cert
struct authority_cert_t * cert
Definition: networkstatus_st.h:85
authority_cert_t
Definition: authority_cert_st.h:19
networkstatus_t::dist_seconds
int dist_seconds
Definition: networkstatus_st.h:52
networkstatus_t::recommended_relay_protocols
char * recommended_relay_protocols
Definition: networkstatus_st.h:63
networkstatus_t::valid_after
time_t valid_after
Definition: networkstatus_st.h:33
networkstatus_sr_info_st.h
Shared-randomness structure.
networkstatus_t::supported_methods
smartlist_t * supported_methods
Definition: networkstatus_st.h:42
networkstatus_t::fresh_until
time_t fresh_until
Definition: networkstatus_st.h:34
networkstatus_t
Definition: networkstatus_st.h:26
smartlist_t
Definition: smartlist_core.h:26
networkstatus_t::known_flags
smartlist_t * known_flags
Definition: networkstatus_st.h:70
networkstatus_t::net_params
smartlist_t * net_params
Definition: networkstatus_st.h:74
networkstatus_t::vote_seconds
int vote_seconds
Definition: networkstatus_st.h:49
networkstatus_t::digest_sha3_as_signed
uint8_t digest_sha3_as_signed[DIGEST256_LEN]
Definition: networkstatus_st.h:91
networkstatus_t::weight_params
smartlist_t * weight_params
Definition: networkstatus_st.h:78
networkstatus_t::consensus_method
int consensus_method
Definition: networkstatus_st.h:40