pub struct ExtraInfoDescriptor {Show 66 fields
pub nickname: String,
pub fingerprint: String,
pub published: DateTime<Utc>,
pub geoip_db_digest: Option<String>,
pub geoip6_db_digest: Option<String>,
pub transports: HashMap<String, Transport>,
pub read_history: Option<BandwidthHistory>,
pub write_history: Option<BandwidthHistory>,
pub dir_read_history: Option<BandwidthHistory>,
pub dir_write_history: Option<BandwidthHistory>,
pub conn_bi_direct_end: Option<DateTime<Utc>>,
pub conn_bi_direct_interval: Option<u32>,
pub conn_bi_direct_below: Option<u32>,
pub conn_bi_direct_read: Option<u32>,
pub conn_bi_direct_write: Option<u32>,
pub conn_bi_direct_both: Option<u32>,
pub cell_stats_end: Option<DateTime<Utc>>,
pub cell_stats_interval: Option<u32>,
pub cell_processed_cells: Vec<f64>,
pub cell_queued_cells: Vec<f64>,
pub cell_time_in_queue: Vec<f64>,
pub cell_circuits_per_decile: Option<u32>,
pub dir_stats_end: Option<DateTime<Utc>>,
pub dir_stats_interval: Option<u32>,
pub dir_v3_ips: HashMap<String, u32>,
pub dir_v3_requests: HashMap<String, u32>,
pub dir_v3_responses: HashMap<DirResponse, u32>,
pub dir_v3_responses_unknown: HashMap<String, u32>,
pub dir_v3_direct_dl: HashMap<DirStat, u32>,
pub dir_v3_direct_dl_unknown: HashMap<String, u32>,
pub dir_v3_tunneled_dl: HashMap<DirStat, u32>,
pub dir_v3_tunneled_dl_unknown: HashMap<String, u32>,
pub dir_v2_ips: HashMap<String, u32>,
pub dir_v2_requests: HashMap<String, u32>,
pub dir_v2_responses: HashMap<DirResponse, u32>,
pub dir_v2_responses_unknown: HashMap<String, u32>,
pub dir_v2_direct_dl: HashMap<DirStat, u32>,
pub dir_v2_direct_dl_unknown: HashMap<String, u32>,
pub dir_v2_tunneled_dl: HashMap<DirStat, u32>,
pub dir_v2_tunneled_dl_unknown: HashMap<String, u32>,
pub entry_stats_end: Option<DateTime<Utc>>,
pub entry_stats_interval: Option<u32>,
pub entry_ips: HashMap<String, u32>,
pub exit_stats_end: Option<DateTime<Utc>>,
pub exit_stats_interval: Option<u32>,
pub exit_kibibytes_written: HashMap<PortKey, u64>,
pub exit_kibibytes_read: HashMap<PortKey, u64>,
pub exit_streams_opened: HashMap<PortKey, u64>,
pub bridge_stats_end: Option<DateTime<Utc>>,
pub bridge_stats_interval: Option<u32>,
pub bridge_ips: HashMap<String, u32>,
pub ip_versions: HashMap<String, u32>,
pub ip_transports: HashMap<String, u32>,
pub hs_stats_end: Option<DateTime<Utc>>,
pub hs_rend_cells: Option<u64>,
pub hs_rend_cells_attr: HashMap<String, String>,
pub hs_dir_onions_seen: Option<u64>,
pub hs_dir_onions_seen_attr: HashMap<String, String>,
pub padding_counts_end: Option<DateTime<Utc>>,
pub padding_counts_interval: Option<u32>,
pub padding_counts: HashMap<String, String>,
pub ed25519_certificate: Option<String>,
pub ed25519_signature: Option<String>,
pub signature: Option<String>,
pub router_digest: Option<String>,
pub router_digest_sha256: Option<String>,
/* private fields */
}Expand description
Extra-info descriptor containing relay statistics and metadata.
Extra-info descriptors are published alongside server descriptors and contain detailed statistics about relay operation. They are not required for Tor clients to function but provide valuable metrics for network analysis.
§Overview
The descriptor contains several categories of information:
- Identity - Nickname, fingerprint, publication time
- Bandwidth history - Read/write traffic over time
- Directory statistics - Request counts and download speeds
- Cell statistics - Circuit cell processing metrics
- Exit statistics - Traffic per destination port
- Bridge statistics - Client connection data
- Hidden service statistics - Onion service activity
- Cryptographic data - Ed25519 certificates and signatures
§Relay vs Bridge
Use is_bridge() to distinguish between relay and
bridge extra-info descriptors:
- Relay: Has
router-signatureline with RSA signature - Bridge: Has
router-digestline instead of signature
§Example
use stem_rs::descriptor::extra_info::ExtraInfoDescriptor;
use stem_rs::descriptor::Descriptor;
let content = r#"extra-info MyRelay B2289C3EAB83ECD6EB916A2F481A02E6B76A0A48
published 2024-01-15 12:00:00
write-history 2024-01-15 12:00:00 (900 s) 1000000,2000000
read-history 2024-01-15 12:00:00 (900 s) 500000,1000000
"#;
let desc = ExtraInfoDescriptor::parse(content).unwrap();
// Check identity
assert_eq!(desc.nickname, "MyRelay");
assert_eq!(desc.fingerprint.len(), 40);
// Check bandwidth history
if let Some(ref history) = desc.write_history {
println!("Write interval: {} seconds", history.interval);
println!("Values: {:?}", history.values);
}§Statistics Fields
§Bandwidth History
read_history/write_history- Relay trafficdir_read_history/dir_write_history- Directory traffic
§Directory Statistics
dir_v3_ips/dir_v3_requests- Client counts by countrydir_v3_responses- Response status countsdir_v3_direct_dl/dir_v3_tunneled_dl- Download speed stats
§Exit Statistics
exit_kibibytes_written/exit_kibibytes_read- Traffic per portexit_streams_opened- Connection counts per port
§Bridge Statistics
bridge_ips- Client counts by countryip_versions- IPv4 vs IPv6 client countsip_transports- Pluggable transport usage
§Thread Safety
ExtraInfoDescriptor is Send and Sync, making it safe to share
across threads.
§See Also
crate::descriptor::server::ServerDescriptor- Published alongside extra-infoBandwidthHistory- Bandwidth history data structureDirResponse- Directory response status codesDirStat- Directory download statistics
Fields§
§nickname: StringThe relay’s nickname (1-19 alphanumeric characters).
fingerprint: StringThe relay’s identity fingerprint (40 uppercase hex characters).
This is the SHA-1 hash of the relay’s identity key.
published: DateTime<Utc>When this descriptor was published (UTC).
geoip_db_digest: Option<String>SHA-1 digest of the GeoIP database for IPv4 addresses.
geoip6_db_digest: Option<String>SHA-1 digest of the GeoIP database for IPv6 addresses.
transports: HashMap<String, Transport>Pluggable transports available on this relay (bridges only).
Maps transport name to transport details.
read_history: Option<BandwidthHistory>Bytes read by the relay over time.
write_history: Option<BandwidthHistory>Bytes written by the relay over time.
dir_read_history: Option<BandwidthHistory>Bytes read for directory requests over time.
dir_write_history: Option<BandwidthHistory>Bytes written for directory requests over time.
conn_bi_direct_end: Option<DateTime<Utc>>End time for bi-directional connection statistics.
conn_bi_direct_interval: Option<u32>Interval for bi-directional connection statistics (seconds).
conn_bi_direct_below: Option<u32>Connections that read/wrote less than 20 KiB.
conn_bi_direct_read: Option<u32>Connections that read at least 10x more than wrote.
conn_bi_direct_write: Option<u32>Connections that wrote at least 10x more than read.
conn_bi_direct_both: Option<u32>Connections with balanced read/write (remaining).
cell_stats_end: Option<DateTime<Utc>>End time for cell statistics collection.
cell_stats_interval: Option<u32>Interval for cell statistics (seconds).
cell_processed_cells: Vec<f64>Mean processed cells per circuit, by decile.
cell_queued_cells: Vec<f64>Mean queued cells per circuit, by decile.
cell_time_in_queue: Vec<f64>Mean time cells spent in queue (milliseconds), by decile.
cell_circuits_per_decile: Option<u32>Mean number of circuits in a decile.
dir_stats_end: Option<DateTime<Utc>>End time for directory statistics collection.
dir_stats_interval: Option<u32>Interval for directory statistics (seconds).
dir_v3_ips: HashMap<String, u32>V3 directory request client IPs by country code.
dir_v3_requests: HashMap<String, u32>V3 directory request counts by country code.
dir_v3_responses: HashMap<DirResponse, u32>V3 directory response status counts.
dir_v3_responses_unknown: HashMap<String, u32>Unrecognized V3 directory response statuses.
dir_v3_direct_dl: HashMap<DirStat, u32>V3 direct download statistics (via DirPort).
dir_v3_direct_dl_unknown: HashMap<String, u32>Unrecognized V3 direct download statistics.
dir_v3_tunneled_dl: HashMap<DirStat, u32>V3 tunneled download statistics (via ORPort).
dir_v3_tunneled_dl_unknown: HashMap<String, u32>Unrecognized V3 tunneled download statistics.
dir_v2_ips: HashMap<String, u32>V2 directory request client IPs by country code (deprecated).
dir_v2_requests: HashMap<String, u32>V2 directory request counts by country code (deprecated).
dir_v2_responses: HashMap<DirResponse, u32>V2 directory response status counts (deprecated).
dir_v2_responses_unknown: HashMap<String, u32>Unrecognized V2 directory response statuses (deprecated).
dir_v2_direct_dl: HashMap<DirStat, u32>V2 direct download statistics (deprecated).
dir_v2_direct_dl_unknown: HashMap<String, u32>Unrecognized V2 direct download statistics (deprecated).
dir_v2_tunneled_dl: HashMap<DirStat, u32>V2 tunneled download statistics (deprecated).
dir_v2_tunneled_dl_unknown: HashMap<String, u32>Unrecognized V2 tunneled download statistics (deprecated).
entry_stats_end: Option<DateTime<Utc>>End time for entry guard statistics.
entry_stats_interval: Option<u32>Interval for entry guard statistics (seconds).
entry_ips: HashMap<String, u32>Entry guard client IPs by country code.
exit_stats_end: Option<DateTime<Utc>>End time for exit statistics.
exit_stats_interval: Option<u32>Interval for exit statistics (seconds).
exit_kibibytes_written: HashMap<PortKey, u64>Kibibytes written per destination port.
exit_kibibytes_read: HashMap<PortKey, u64>Kibibytes read per destination port.
exit_streams_opened: HashMap<PortKey, u64>Streams opened per destination port.
bridge_stats_end: Option<DateTime<Utc>>End time for bridge statistics.
bridge_stats_interval: Option<u32>Interval for bridge statistics (seconds).
bridge_ips: HashMap<String, u32>Bridge client IPs by country code.
ip_versions: HashMap<String, u32>Bridge client counts by IP version (v4, v6).
ip_transports: HashMap<String, u32>Bridge client counts by transport method.
hs_stats_end: Option<DateTime<Utc>>End time for hidden service statistics.
hs_rend_cells: Option<u64>Rounded count of RENDEZVOUS1 cells relayed.
hs_rend_cells_attr: HashMap<String, String>Additional attributes for hs_rend_cells.
hs_dir_onions_seen: Option<u64>Rounded count of unique onion service identities seen.
hs_dir_onions_seen_attr: HashMap<String, String>Additional attributes for hs_dir_onions_seen.
padding_counts_end: Option<DateTime<Utc>>End time for padding count statistics.
padding_counts_interval: Option<u32>Interval for padding count statistics (seconds).
padding_counts: HashMap<String, String>Padding-related statistics.
ed25519_certificate: Option<String>Ed25519 certificate (PEM-encoded).
ed25519_signature: Option<String>Ed25519 signature of the descriptor.
signature: Option<String>RSA signature of the descriptor (relay extra-info only).
router_digest: Option<String>Router digest for bridge extra-info descriptors.
Present only in bridge descriptors; indicates this is a bridge.
router_digest_sha256: Option<String>SHA-256 router digest (base64).
Implementations§
Source§impl ExtraInfoDescriptor
impl ExtraInfoDescriptor
Sourcepub fn is_bridge(&self) -> bool
pub fn is_bridge(&self) -> bool
Returns whether this is a bridge extra-info descriptor.
Bridge descriptors have a router-digest line instead of a
router-signature line.
§Example
use stem_rs::descriptor::extra_info::ExtraInfoDescriptor;
use stem_rs::descriptor::Descriptor;
let relay_content = r#"extra-info relay B2289C3EAB83ECD6EB916A2F481A02E6B76A0A48
published 2024-01-15 12:00:00
"#;
let bridge_content = r#"extra-info bridge B2289C3EAB83ECD6EB916A2F481A02E6B76A0A48
published 2024-01-15 12:00:00
router-digest 00A2AECCEAD3FEE033CFE29893387143146728EC
"#;
let relay = ExtraInfoDescriptor::parse(relay_content).unwrap();
let bridge = ExtraInfoDescriptor::parse(bridge_content).unwrap();
assert!(!relay.is_bridge());
assert!(bridge.is_bridge());Trait Implementations§
Source§impl Clone for ExtraInfoDescriptor
impl Clone for ExtraInfoDescriptor
Source§fn clone(&self) -> ExtraInfoDescriptor
fn clone(&self) -> ExtraInfoDescriptor
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more