diff options
author | Mathias Hall-Andersen <mathias@hall-andersen.dk> | 2019-10-31 17:11:09 +0100 |
---|---|---|
committer | Mathias Hall-Andersen <mathias@hall-andersen.dk> | 2019-10-31 17:11:09 +0100 |
commit | b25c21885bf97e74802549e3ac22f57bc0c44d76 (patch) | |
tree | d35eb556666846045e434e27f91648fa94bebd46 /src/wireguard/constants.rs | |
parent | Remove unused dependencies (diff) | |
download | wireguard-rs-b25c21885bf97e74802549e3ac22f57bc0c44d76.tar.xz wireguard-rs-b25c21885bf97e74802549e3ac22f57bc0c44d76.zip |
Work on timer semantics
Diffstat (limited to 'src/wireguard/constants.rs')
-rw-r--r-- | src/wireguard/constants.rs | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/wireguard/constants.rs b/src/wireguard/constants.rs index ec60801..c53c559 100644 --- a/src/wireguard/constants.rs +++ b/src/wireguard/constants.rs @@ -18,3 +18,9 @@ pub const TIMERS_SLOTS: usize = (TIMER_MAX_DURATION.as_micros() / TIMERS_TICK.as pub const TIMERS_CAPACITY: usize = 1024; pub const MESSAGE_PADDING_MULTIPLE: usize = 16; + +/* A long duration (compared to the WireGuard time constants), + * used in places to avoid Option<Instant> by instead using a long "expired" Instant: + * (Instant::now() - TIME_HORIZON) + */ +pub const TIME_HORIZON: Duration = Duration::from_secs(3600 * 24); |