diff options
author | Mathias Hall-Andersen <mathias@hall-andersen.dk> | 2019-08-16 12:33:10 +0200 |
---|---|---|
committer | Mathias Hall-Andersen <mathias@hall-andersen.dk> | 2019-08-16 12:33:10 +0200 |
commit | 726163b7f1a788d084643926dd92f03e36fdf27a (patch) | |
tree | be39bcf2b6701562e53f93ad114b489ea6b444e6 /src/types/mod.rs | |
parent | Implement add_keypair semantics (diff) | |
download | wireguard-rs-726163b7f1a788d084643926dd92f03e36fdf27a.tar.xz wireguard-rs-726163b7f1a788d084643926dd92f03e36fdf27a.zip |
Layout work on router
Diffstat (limited to '')
-rw-r--r-- | src/types/mod.rs | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/types/mod.rs b/src/types/mod.rs index ac6a307..ea7c570 100644 --- a/src/types/mod.rs +++ b/src/types/mod.rs @@ -1,8 +1,10 @@ +use std::time::Instant; + /* This file holds types passed between components. * Whenever a type cannot be held local to a single module. */ -#[derive(Debug)] +#[derive(Debug, Clone, Copy)] pub struct Key { pub key: [u8; 32], pub id: u32, @@ -15,8 +17,9 @@ impl PartialEq for Key { } } -#[derive(Debug)] +#[derive(Debug, Clone, Copy)] pub struct KeyPair { + pub birth: Instant, // when was the key-pair created pub confirmed: bool, // has the key-pair been confirmed? pub send: Key, // key for outbound messages pub recv: Key, // key for inbound messages |