tor_netdoc/doc/netstatus/rs/each_variety.rs
1//! router status entries - 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
15/// A single relay's status, in a network status document.
16#[cfg_attr(
17 feature = "dangerous-expose-struct-fields",
18 visible::StructFields(pub),
19 non_exhaustive
20)]
21#[derive(Debug, Clone)]
22pub struct RouterStatus {
23 /// The nickname for this relay.
24 ///
25 /// Nicknames can be used for convenience purpose, but no more:
26 /// there is no mechanism to enforce their uniqueness.
27 #[cfg_attr(docsrs, doc(cfg(feature = "dangerous-expose-struct-fields")))]
28 pub(crate) nickname: Nickname,
29 /// Fingerprint of the old-style RSA identity for this relay.
30 #[cfg_attr(docsrs, doc(cfg(feature = "dangerous-expose-struct-fields")))]
31 pub(crate) identity: RsaIdentity,
32 /// A list of address:port values where this relay can be reached.
33 #[cfg_attr(docsrs, doc(cfg(feature = "dangerous-expose-struct-fields")))]
34 pub(crate) addrs: Vec<net::SocketAddr>,
35 /// Digest of the document for this relay.
36 #[cfg_attr(docsrs, doc(cfg(feature = "dangerous-expose-struct-fields")))]
37 pub(crate) doc_digest: DocDigest,
38 /// Flags applied by the authorities to this relay.
39 #[cfg_attr(docsrs, doc(cfg(feature = "dangerous-expose-struct-fields")))]
40 pub(crate) flags: RelayFlags,
41 /// Version of the software that this relay is running.
42 #[cfg_attr(docsrs, doc(cfg(feature = "dangerous-expose-struct-fields")))]
43 pub(crate) version: Option<Version>,
44 /// List of subprotocol versions supported by this relay.
45 #[cfg_attr(docsrs, doc(cfg(feature = "dangerous-expose-struct-fields")))]
46 pub(crate) protos: Arc<Protocols>,
47 /// Information about how to weight this relay when choosing a
48 /// relay at random.
49 #[cfg_attr(docsrs, doc(cfg(feature = "dangerous-expose-struct-fields")))]
50 pub(crate) weight: RelayWeight,
51}