Struct tor_netdir::params::NetParameters
source · #[non_exhaustive]pub struct NetParameters {Show 65 fields
pub bw_weight_scale: BoundedInt32<1, { i32::MAX }>,
pub cbt_learning_disabled: BoundedInt32<0, 1>,
pub cbt_num_xm_modes: BoundedInt32<1, 20>,
pub cbt_success_count: BoundedInt32<3, 1_000>,
pub cbt_max_timeouts: BoundedInt32<3, 10_000>,
pub cbt_min_circs_for_estimate: BoundedInt32<1, 10_000>,
pub cbt_timeout_quantile: Percentage<BoundedInt32<10, 99>>,
pub cbt_abandon_quantile: Percentage<BoundedInt32<10, 99>>,
pub cbt_min_timeout: IntegerMilliseconds<BoundedInt32<10, { i32::MAX }>>,
pub cbt_initial_timeout: IntegerMilliseconds<BoundedInt32<10, { i32::MAX }>>,
pub cbt_testing_delay: IntegerSeconds<BoundedInt32<1, { i32::MAX }>>,
pub cbt_max_open_circuits_for_testing: BoundedInt32<0, 14>,
pub circuit_window: BoundedInt32<100, 1000>,
pub circuit_priority_half_life: IntegerMilliseconds<BoundedInt32<1, { i32::MAX }>>,
pub extend_by_ed25519_id: BoundedInt32<0, 1>,
pub guard_meaningful_restriction: Percentage<BoundedInt32<1, 100>>,
pub guard_extreme_restriction: Percentage<BoundedInt32<1, 100>>,
pub guard_lifetime_unconfirmed: IntegerDays<BoundedInt32<1, 3650>>,
pub guard_lifetime_confirmed: IntegerDays<BoundedInt32<1, 3650>>,
pub guard_internet_likely_down: IntegerSeconds<BoundedInt32<1, { i32::MAX }>>,
pub guard_max_sample_size: BoundedInt32<1, { i32::MAX }>,
pub guard_max_sample_threshold: Percentage<BoundedInt32<1, 100>>,
pub guard_filtered_min_sample_size: BoundedInt32<1, { i32::MAX }>,
pub guard_n_primary: BoundedInt32<1, { i32::MAX }>,
pub guard_use_parallelism: BoundedInt32<1, { i32::MAX }>,
pub guard_dir_use_parallelism: BoundedInt32<1, { i32::MAX }>,
pub guard_nonprimary_connect_timeout: IntegerSeconds<BoundedInt32<1, { i32::MAX }>>,
pub guard_nonprimary_idle_timeout: IntegerSeconds<BoundedInt32<1, { i32::MAX }>>,
pub guard_remove_unlisted_after: IntegerDays<BoundedInt32<1, 3650>>,
pub min_circuit_path_threshold: Percentage<BoundedInt32<25, 95>>,
pub nf_ito_low: IntegerMilliseconds<BoundedInt32<0, CHANNEL_PADDING_TIMEOUT_UPPER_BOUND>>,
pub nf_ito_high: IntegerMilliseconds<BoundedInt32<0, CHANNEL_PADDING_TIMEOUT_UPPER_BOUND>>,
pub nf_ito_low_reduced: IntegerMilliseconds<BoundedInt32<0, CHANNEL_PADDING_TIMEOUT_UPPER_BOUND>>,
pub nf_ito_high_reduced: IntegerMilliseconds<BoundedInt32<0, CHANNEL_PADDING_TIMEOUT_UPPER_BOUND>>,
pub sendme_accept_min_version: SendMeVersion,
pub sendme_emit_min_version: SendMeVersion,
pub unused_client_circ_timeout: IntegerSeconds<BoundedInt32<60, 86_400>>,
pub unused_client_circ_timeout_while_learning_cbt: IntegerSeconds<BoundedInt32<10, 60_000>>,
pub cc_min_sendme_acks: BoundedInt32<2, 20>,
pub cc_ewma_n_by_sendme_acks: Percentage<BoundedInt32<1, 255>>,
pub cc_ewma_n_max: BoundedInt32<2, { i32::MAX }>,
pub cc_sendme_cell_ack_count: BoundedInt32<1, 255>,
pub cc_cwnd_inc_rate: BoundedInt32<1, 250>,
pub hs_introcirc_requests_min: BoundedInt32<0, { i32::MAX }>,
pub hs_introcirc_requests_max: BoundedInt32<0, { i32::MAX }>,
pub hs_intro_min_lifetime: IntegerSeconds<BoundedInt32<0, { i32::MAX }>>,
pub hs_intro_max_lifetime: IntegerSeconds<BoundedInt32<0, { i32::MAX }>>,
pub hs_intro_num_extra_intropoints: BoundedInt32<0, 128>,
pub hsdir_timeperiod_length: IntegerMinutes<BoundedInt32<30, 14400>>,
pub hsdir_n_replicas: BoundedInt32<1, 16>,
pub hsdir_spread_fetch: BoundedInt32<1, 128>,
pub hsdir_spread_store: BoundedInt32<1, 128>,
pub hsdir_max_desc_size: BoundedInt32<1, { i32::MAX }>,
pub hs_service_rendezvous_failures_max: BoundedInt32<1, 10>,
pub hs_intro_dos_enabled: BoundedInt32<0, 1>,
pub hs_intro_dos_max_burst: BoundedInt32<0, { i32::MAX }>,
pub hs_intro_dos_rate: BoundedInt32<0, { i32::MAX }>,
pub vanguards_enabled: BoundedInt32<0, 2>,
pub vanguards_hs_service: BoundedInt32<0, 2>,
pub guard_hs_l2_number: BoundedInt32<1, { i32::MAX }>,
pub guard_hs_l2_lifetime_min: IntegerSeconds<BoundedInt32<1, { i32::MAX }>>,
pub guard_hs_l2_lifetime_max: IntegerSeconds<BoundedInt32<1, { i32::MAX }>>,
pub guard_hs_l3_number: BoundedInt32<1, { i32::MAX }>,
pub guard_hs_l3_lifetime_min: IntegerSeconds<BoundedInt32<1, { i32::MAX }>>,
pub guard_hs_l3_lifetime_max: IntegerSeconds<BoundedInt32<1, { i32::MAX }>>,
}Expand description
This structure holds recognized configuration parameters. All values are type-safe, and where applicable clamped to be within range.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.bw_weight_scale: BoundedInt32<1, { i32::MAX }>A weighting factor for bandwidth calculations
cbt_learning_disabled: BoundedInt32<0, 1>If true, do not attempt to learn circuit-build timeouts at all.
cbt_num_xm_modes: BoundedInt32<1, 20>Number of histograms bins to consider when estimating Xm for a Pareto-based circuit timeout estimator.
cbt_success_count: BoundedInt32<3, 1_000>How many recent circuit success/timeout statuses do we remember when trying to tell if our circuit timeouts are too low?
cbt_max_timeouts: BoundedInt32<3, 10_000>How many timeouts (in the last cbt_success_count observations)
indicates that our circuit timeouts are too low?
cbt_min_circs_for_estimate: BoundedInt32<1, 10_000>Smallest number of circuit build times we have to view in order to use our Pareto-based circuit timeout estimator.
cbt_timeout_quantile: Percentage<BoundedInt32<10, 99>>Quantile to use when determining the correct circuit timeout value with our Pareto estimator.
(We continue building circuits after this timeout, but only for build-time measurement purposes.)
cbt_abandon_quantile: Percentage<BoundedInt32<10, 99>>Quantile to use when determining when to abandon circuits completely with our Pareto estimator.
cbt_min_timeout: IntegerMilliseconds<BoundedInt32<10, { i32::MAX }>>Lowest permissible timeout value for Pareto timeout estimator.
cbt_initial_timeout: IntegerMilliseconds<BoundedInt32<10, { i32::MAX }>>Timeout value to use for our Pareto timeout estimator when we have no initial estimate.
cbt_testing_delay: IntegerSeconds<BoundedInt32<1, { i32::MAX }>>When we don’t have a good build-time estimate yet, how long (in seconds) do we wait between trying to launch build-time testing circuits through the network?
cbt_max_open_circuits_for_testing: BoundedInt32<0, 14>How many circuits can be open before we will no longer consider launching testing circuits to learn average build times?
circuit_window: BoundedInt32<100, 1000>The maximum cell window size?
circuit_priority_half_life: IntegerMilliseconds<BoundedInt32<1, { i32::MAX }>>The decay parameter for circuit priority
extend_by_ed25519_id: BoundedInt32<0, 1>Whether to perform circuit extensions by Ed25519 ID
guard_meaningful_restriction: Percentage<BoundedInt32<1, 100>>If we have excluded so many possible guards that the available fraction is below this threshold, we should use a different guard sample.
guard_extreme_restriction: Percentage<BoundedInt32<1, 100>>We should warn the user if they have excluded so many guards that the available fraction is below this threshold.
guard_lifetime_unconfirmed: IntegerDays<BoundedInt32<1, 3650>>How long should we keep an unconfirmed guard (one we have not contacted) before removing it from the guard sample?
guard_lifetime_confirmed: IntegerDays<BoundedInt32<1, 3650>>How long should we keep a confirmed guard (one we have contacted) before removing it from the guard sample?
guard_internet_likely_down: IntegerSeconds<BoundedInt32<1, { i32::MAX }>>If all circuits have failed for this interval, then treat the internet as “probably down”, and treat any guard failures in that interval as unproven.
guard_max_sample_size: BoundedInt32<1, { i32::MAX }>Largest number of guards that a client should try to maintain in a sample of possible guards.
guard_max_sample_threshold: Percentage<BoundedInt32<1, 100>>Largest fraction of guard bandwidth on the network that a client should try to remain in a sample of possible guards.
guard_filtered_min_sample_size: BoundedInt32<1, { i32::MAX }>If the client ever has fewer than this many guards in their sample, after filtering out unusable guards, they should try to add more guards to the sample (if allowed).
guard_n_primary: BoundedInt32<1, { i32::MAX }>The number of confirmed guards that the client should treat as “primary guards”.
guard_use_parallelism: BoundedInt32<1, { i32::MAX }>The number of primary guards that the client should use in parallel. Other primary guards won’t get used unless earlier ones are down.
guard_dir_use_parallelism: BoundedInt32<1, { i32::MAX }>The number of primary guards that the client should use in parallel. Other primary directory guards won’t get used unless earlier ones are down.
guard_nonprimary_connect_timeout: IntegerSeconds<BoundedInt32<1, { i32::MAX }>>When trying to confirm nonprimary guards, if a guard doesn’t answer for more than this long in seconds, treat any lower- priority guards as possibly usable.
guard_nonprimary_idle_timeout: IntegerSeconds<BoundedInt32<1, { i32::MAX }>>When trying to confirm nonprimary guards, if a guard doesn’t answer for more than this long in seconds, treat it as down.
guard_remove_unlisted_after: IntegerDays<BoundedInt32<1, 3650>>If a guard has been unlisted in the consensus for at least this long, remove it from the consensus.
min_circuit_path_threshold: Percentage<BoundedInt32<25, 95>>The minimum threshold for circuit patch construction
nf_ito_low: IntegerMilliseconds<BoundedInt32<0, CHANNEL_PADDING_TIMEOUT_UPPER_BOUND>>Channel padding, low end of random padding interval, milliseconds
nf_ito stands for “netflow inactive timeout”.
nf_ito_high: IntegerMilliseconds<BoundedInt32<0, CHANNEL_PADDING_TIMEOUT_UPPER_BOUND>>Channel padding, high end of random padding interval, milliseconds
nf_ito_low_reduced: IntegerMilliseconds<BoundedInt32<0, CHANNEL_PADDING_TIMEOUT_UPPER_BOUND>>Channel padding, low end of random padding interval (reduced padding) milliseconds
nf_ito_high_reduced: IntegerMilliseconds<BoundedInt32<0, CHANNEL_PADDING_TIMEOUT_UPPER_BOUND>>Channel padding, high end of random padding interval (reduced padding) , milliseconds
sendme_accept_min_version: SendMeVersionThe minimum sendme version to accept.
sendme_emit_min_version: SendMeVersionThe minimum sendme version to transmit.
unused_client_circ_timeout: IntegerSeconds<BoundedInt32<60, 86_400>>How long should never-used client circuits stay available, in the steady state?
unused_client_circ_timeout_while_learning_cbt: IntegerSeconds<BoundedInt32<10, 60_000>>When we’re learning circuit timeouts, how long should never-used client circuits stay available?
cc_min_sendme_acks: BoundedInt32<2, 20>The minimum number of SENDME acks required to estimate RTT and/or bandwidth.
cc_ewma_n_by_sendme_acks: Percentage<BoundedInt32<1, 255>>The “N” parameter in N-EWMA smoothing of RTT and/or bandwidth estimation, specified as a percentage of the number of SENDME acks in a congestion window.
A percentage over 100% indicates smoothing with more than one congestion window’s worth of SENDMEs.
cc_ewma_n_max: BoundedInt32<2, { i32::MAX }>The maximum value of the “N” parameter in N-EWMA smoothing of RTT and/or bandwidth estimation.
cc_sendme_cell_ack_count: BoundedInt32<1, 255>How many cells a SENDME acks under the congestion-control regime.
cc_cwnd_inc_rate: BoundedInt32<1, 250>How often we update our congestion window, per congestion window worth of packets. (For example, if this is 2, we will update the window twice every window.)
hs_introcirc_requests_min: BoundedInt32<0, { i32::MAX }>Lower bound on the number of INTRODUCE2 cells to allow per introduction circuit before the service decides to rotate to a new introduction circuit.
hs_introcirc_requests_max: BoundedInt32<0, { i32::MAX }>Upper bound on the number of INTRODUCE2 cells to allow per introduction circuit before the service decides to rotate to a new introduction circuit.
hs_intro_min_lifetime: IntegerSeconds<BoundedInt32<0, { i32::MAX }>>Lower bound on the lifetime of an introduction point.
hs_intro_max_lifetime: IntegerSeconds<BoundedInt32<0, { i32::MAX }>>Upper bound on the lifetime of an introduction point.
hs_intro_num_extra_intropoints: BoundedInt32<0, 128>Number of “extra” introduction points that an onion service is allowed to open based on demand.
hsdir_timeperiod_length: IntegerMinutes<BoundedInt32<30, 14400>>The duration of a time period, as used in the onion service directory protocol.
During each “time period”, each onion service gets a different blinded ID, and the hash ring gets a new layout.
hsdir_n_replicas: BoundedInt32<1, 16>The number of positions at the hash ring where an onion service descriptor should be stored.
hsdir_spread_fetch: BoundedInt32<1, 128>The number of HSDir instances, at each position in the hash ring, that should be considered when downloading an onion service descriptor.
hsdir_spread_store: BoundedInt32<1, 128>The number of HSDir instances, at each position in the hash ring, that should be considered when uploading an onion service descriptor.
hsdir_max_desc_size: BoundedInt32<1, { i32::MAX }>Largest allowable v3 onion service size (in bytes).
hs_service_rendezvous_failures_max: BoundedInt32<1, 10>Largest number of failures to rendezvous that an onion service should allow for a request.
hs_intro_dos_enabled: BoundedInt32<0, 1>If set to 1, introduction points use the INTRODUCE1 rate limiting
defense when no DosParams are sent.
See https://spec.torproject.org/param-spec.html#HiddenServiceEnableIntroDoSDefense
hs_intro_dos_max_burst: BoundedInt32<0, { i32::MAX }>Default rate value for an introduction point to use for INTRODUCE1 rate
limiting when no DosParams value is sent, in messages per second.
See https://spec.torproject.org/param-spec.html#HiddenServiceEnableIntroDoSBurstPerSec
hs_intro_dos_rate: BoundedInt32<0, { i32::MAX }>Default burst value for an introduction point to use for INTRODUCE1 rate
limiting when no DosParams value is sent.
See https://spec.torproject.org/param-spec.html#HiddenServiceEnableIntroDoSRatePerSec
vanguards_enabled: BoundedInt32<0, 2>The type of vanguards to use by default when building onion service circuits:
0: No vanguards.
1: Lite vanguards.
2: Full vanguards.
vanguards_hs_service: BoundedInt32<0, 2>If higher than vanguards-enabled,
and we are running an onion service,
we use this level for all our onion service circuits:
0: No vanguards.
1: Lite vanguards.
2: Full vanguards.
guard_hs_l2_number: BoundedInt32<1, { i32::MAX }>The number of vanguards in the L2 vanguard set.
guard_hs_l2_lifetime_min: IntegerSeconds<BoundedInt32<1, { i32::MAX }>>The minimum lifetime of L2 vanguards.
guard_hs_l2_lifetime_max: IntegerSeconds<BoundedInt32<1, { i32::MAX }>>The maximum lifetime of L2 vanguards.
guard_hs_l3_number: BoundedInt32<1, { i32::MAX }>The number of vanguards in the L3 vanguard set.
guard_hs_l3_lifetime_min: IntegerSeconds<BoundedInt32<1, { i32::MAX }>>The minimum lifetime of L3 vanguards.
guard_hs_l3_lifetime_max: IntegerSeconds<BoundedInt32<1, { i32::MAX }>>The maximum lifetime of L3 vanguards.
Implementations§
Trait Implementations§
source§impl AsRef<NetParameters> for NetDir
impl AsRef<NetParameters> for NetDir
source§fn as_ref(&self) -> &NetParameters
fn as_ref(&self) -> &NetParameters
source§impl AsRef<NetParameters> for NetParameters
impl AsRef<NetParameters> for NetParameters
source§fn as_ref(&self) -> &NetParameters
fn as_ref(&self) -> &NetParameters
source§impl Clone for NetParameters
impl Clone for NetParameters
source§fn clone(&self) -> NetParameters
fn clone(&self) -> NetParameters
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moresource§impl Debug for NetParameters
impl Debug for NetParameters
Auto Trait Implementations§
impl Freeze for NetParameters
impl RefUnwindSafe for NetParameters
impl Send for NetParameters
impl Sync for NetParameters
impl Unpin for NetParameters
impl UnwindSafe for NetParameters
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit)source§impl<T> Instrument for T
impl<T> Instrument for T
source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
source§impl<T> IntoEither for T
impl<T> IntoEither for T
source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moresource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more