summaryrefslogtreecommitdiff
path: root/crates/tor-netdir/src/params.rs
diff options
context:
space:
mode:
Diffstat (limited to 'crates/tor-netdir/src/params.rs')
-rw-r--r--crates/tor-netdir/src/params.rs70
1 files changed, 70 insertions, 0 deletions
diff --git a/crates/tor-netdir/src/params.rs b/crates/tor-netdir/src/params.rs
index d79398e38..910376304 100644
--- a/crates/tor-netdir/src/params.rs
+++ b/crates/tor-netdir/src/params.rs
@@ -413,6 +413,76 @@ pub struct NetParameters {
/// <https://spec.torproject.org/param-spec.md#HiddenServiceEnableIntroDoSRatePerSec>
pub hs_intro_dos_rate: BoundedInt32<0, {i32::MAX}> = (25)
from "HiddenServiceEnableIntroDoSRatePerSec",
+
+ /// The type of vanguards to use by default when building onion service circuits:
+ ///
+ /// ```text
+ /// 0: No vanguards.
+ /// 1: Lite vanguards.
+ /// 2: Full vanguards.
+ /// ```
+ ///
+ /// See
+ /// <https://spec.torproject.org/param-spec.html#vanguards>
+ pub vanguards_enabled: BoundedInt32<0, 2> = (1)
+ from "vanguards-enabled",
+
+ /// If higher than `vanguards-enabled`,
+ /// and we are running an onion service,
+ /// we use this level for all our onion service circuits:
+ ///
+ /// ```text
+ /// 0: No vanguards.
+ /// 1: Lite vanguards.
+ /// 2: Full vanguards.
+ /// ```
+ ///
+ /// See
+ /// <https://spec.torproject.org/param-spec.html#vanguards>
+ pub vanguards_hs_service: BoundedInt32<0, 2> = (2)
+ from "vanguards-hs-service",
+
+ /// The number of vanguards in the L2 vanguard set.
+ ///
+ /// See
+ /// <https://spec.torproject.org/param-spec.html#vanguards>
+ pub guard_hs_l2_number: BoundedInt32<1, {i32::MAX}> = (4)
+ from "guard-hs-l2-number",
+
+ /// The minimum lifetime of L2 vanguards.
+ ///
+ /// See
+ /// <https://spec.torproject.org/param-spec.html#vanguards>
+ pub guard_hs_l2_lifetime_min: IntegerSeconds<BoundedInt32<1, {i32::MAX}>> = (86400)
+ from "guard-hs-l2-lifetime-min",
+
+ /// The maximum lifetime of L2 vanguards.
+ ///
+ /// See
+ /// <https://spec.torproject.org/param-spec.html#vanguards>
+ pub guard_hs_l2_lifetime_max: IntegerSeconds<BoundedInt32<1, {i32::MAX}>> = (1036800)
+ from "guard-hs-l2-lifetime-max",
+
+ /// The number of vanguards in the L3 vanguard set.
+ ///
+ /// See
+ /// <https://spec.torproject.org/param-spec.html#vanguards>
+ pub guard_hs_l3_number: BoundedInt32<1, {i32::MAX}> = (8)
+ from "guard-hs-l3-number",
+
+ /// The minimum lifetime of L3 vanguards.
+ ///
+ /// See
+ /// <https://spec.torproject.org/param-spec.html#vanguards>
+ pub guard_hs_l3_lifetime_min: IntegerSeconds<BoundedInt32<1, {i32::MAX}>> = (3600)
+ from "guard-hs-l3-lifetime-min",
+
+ /// The maximum lifetime of L3 vanguards.
+ ///
+ /// See
+ /// <https://spec.torproject.org/param-spec.html#vanguards>
+ pub guard_hs_l3_lifetime_max: IntegerSeconds<BoundedInt32<1, {i32::MAX}>> = (172800)
+ from "guard-hs-l3-lifetime-max",
}
}