summaryrefslogtreecommitdiffstats
path: root/src/types
diff options
context:
space:
mode:
authorMathias Hall-Andersen <mathias@hall-andersen.dk>2019-08-16 12:33:10 +0200
committerMathias Hall-Andersen <mathias@hall-andersen.dk>2019-08-16 12:33:10 +0200
commit726163b7f1a788d084643926dd92f03e36fdf27a (patch)
treebe39bcf2b6701562e53f93ad114b489ea6b444e6 /src/types
parentImplement add_keypair semantics (diff)
downloadwireguard-rs-726163b7f1a788d084643926dd92f03e36fdf27a.tar.xz
wireguard-rs-726163b7f1a788d084643926dd92f03e36fdf27a.zip
Layout work on router
Diffstat (limited to '')
-rw-r--r--src/types/mod.rs7
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