tor_netdoc/doc/netstatus/each_variety.rs
1//! network status documents - items for all varieties, that vary
2//!
3//! **This file is reincluded multiple times**,
4//! by the macros in [`crate::doc::ns_variety_definition_macros`],
5//! once for votes, and once for each consensus flavour.
6//! It is *not* a module `crate::doc::netstatus::rs::each_variety`.
7//!
8//! Each time this file is included by one of the macros mentioned above,
9//! the `ns_***` macros (such as `ns_const_name!`) may expand to different values.
10//!
11//! See [`crate::doc::ns_variety_definition_macros`].
12
13use super::*;
14
15ns_use_this_variety! {
16 pub use [crate::doc::netstatus::rs]::?::{RouterStatus};
17}
18
19/// The header of a networkstatus.
20#[derive(Debug, Clone)]
21#[non_exhaustive]
22pub struct Header {
23 /// What kind of consensus document is this? Absent in votes and
24 /// in ns-flavored consensuses.
25 pub flavor: ConsensusFlavor,
26 /// Over what time is this consensus valid? (For votes, this is
27 /// the time over which the voted-upon consensus should be valid.)
28 pub lifetime: Lifetime,
29 /// List of recommended Tor client versions.
30 pub client_versions: Vec<String>,
31 /// List of recommended Tor relay versions.
32 pub relay_versions: Vec<String>,
33 /// Lists of recommended and required subprotocols.
34 pub proto_statuses: Arc<ProtoStatuses>,
35 /// Declared parameters for tunable settings about how to the
36 /// network should operator. Some of these adjust timeouts and
37 /// whatnot; some features things on and off.
38 pub params: NetParams<i32>,
39 /// How long in seconds should voters wait for votes and
40 /// signatures (respectively) to propagate?
41 pub voting_delay: Option<(u32, u32)>,
42 /// What "method" was used to produce this consensus? (A
43 /// consensus method is a version number used by authorities to
44 /// upgrade the consensus algorithm.)
45 pub consensus_method: u32,
46 /// Global shared-random value for the previous shared-random period.
47 pub shared_rand_prev: Option<SharedRandStatus>,
48 /// Global shared-random value for the current shared-random period.
49 pub shared_rand_cur: Option<SharedRandStatus>,
50}