aboutsummaryrefslogtreecommitdiff
path: root/src/proto.rs
diff options
context:
space:
mode:
authorAlex Auvolat <alex@adnab.me>2020-04-06 19:55:39 +0200
committerAlex Auvolat <alex@adnab.me>2020-04-06 19:55:39 +0200
commit1a5e6e39af19d572a9de7f54e66bef911bdbbf2f (patch)
tree201638e94ede125b654691953d33aeb37fa9e2f7 /src/proto.rs
parent7102db1d544bec663a8492b24c455168d0b83f08 (diff)
downloadgarage-1a5e6e39af19d572a9de7f54e66bef911bdbbf2f.tar.gz
garage-1a5e6e39af19d572a9de7f54e66bef911bdbbf2f.zip
Some more basic work
Diffstat (limited to 'src/proto.rs')
-rw-r--r--src/proto.rs20
1 files changed, 20 insertions, 0 deletions
diff --git a/src/proto.rs b/src/proto.rs
index 029a58df..6cb12598 100644
--- a/src/proto.rs
+++ b/src/proto.rs
@@ -1,8 +1,28 @@
+use std::net::SocketAddr;
use serde::{Serialize, Deserialize};
+use crate::data::*;
+
#[derive(Debug, Serialize, Deserialize)]
pub enum Message {
Ok,
Error(String),
+ Ping(PingMessage),
+ AdvertiseNode(AdvertiseNodeMessage),
+}
+
+#[derive(Debug, Serialize, Deserialize)]
+pub struct PingMessage {
+ pub id: UUID,
+ pub rpc_port: u16,
+
+ pub present_hash: Hash,
+ pub config_version: u64,
+}
+
+#[derive(Debug, Serialize, Deserialize)]
+pub struct AdvertiseNodeMessage {
+ pub id: UUID,
+ pub addr: SocketAddr,
}