diff options
author | Mathias Hall-Andersen <mathias@hall-andersen.dk> | 2019-07-28 17:09:27 +0200 |
---|---|---|
committer | Mathias Hall-Andersen <mathias@hall-andersen.dk> | 2019-07-28 17:09:27 +0200 |
commit | 2c81abbe7973dfbe6113d66f9d92b6b4ad3b0afa (patch) | |
tree | 62f32c732564544edf1ca5456cbd84e87385ae38 /src/types | |
parent | Added ability to remove peer from device (diff) | |
download | wireguard-rs-2c81abbe7973dfbe6113d66f9d92b6b4ad3b0afa.tar.xz wireguard-rs-2c81abbe7973dfbe6113d66f9d92b6b4ad3b0afa.zip |
Restructured for wireguard-rs
Diffstat (limited to 'src/types')
-rw-r--r-- | src/types/mod.rs | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/src/types/mod.rs b/src/types/mod.rs new file mode 100644 index 0000000..ac6a307 --- /dev/null +++ b/src/types/mod.rs @@ -0,0 +1,23 @@ +/* This file holds types passed between components. + * Whenever a type cannot be held local to a single module. + */ + +#[derive(Debug)] +pub struct Key { + pub key: [u8; 32], + pub id: u32, +} + +#[cfg(test)] +impl PartialEq for Key { + fn eq(&self, other: &Self) -> bool { + self.id == other.id && self.key[..] == other.key[..] + } +} + +#[derive(Debug)] +pub struct KeyPair { + pub confirmed: bool, // has the key-pair been confirmed? + pub send: Key, // key for outbound messages + pub recv: Key, // key for inbound messages +} |