diff options
author | Roman Smrž <roman.smrz@seznam.cz> | 2023-08-27 11:41:41 +0200 |
---|---|---|
committer | Roman Smrž <roman.smrz@seznam.cz> | 2023-08-27 16:32:21 +0200 |
commit | 3407f97096fd66aeb25f1cd26ba002d3f8a23127 (patch) | |
tree | df9e06928ee317660be1c7ce85005ad527434d8b /src/network/protocol.h | |
parent | a40f12cf820b3e11cc72f7b20046c8077ab0d0a5 (diff) |
Network: announce protocol version
Diffstat (limited to 'src/network/protocol.h')
-rw-r--r-- | src/network/protocol.h | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/network/protocol.h b/src/network/protocol.h index 51f8d59..545585e 100644 --- a/src/network/protocol.h +++ b/src/network/protocol.h @@ -32,6 +32,8 @@ public: NetworkProtocol & operator=(NetworkProtocol &&); ~NetworkProtocol(); + static constexpr char defaultVersion[] = "0.1"; + class Connection; struct Header; @@ -111,6 +113,7 @@ struct NetworkProtocol::ConnectionReadReady { Connection::Id id; }; struct NetworkProtocol::Header { struct Acknowledged { Digest value; }; + struct Version { string value; }; struct DataRequest { Digest value; }; struct DataResponse { Digest value; }; struct AnnounceSelf { Digest value; }; @@ -122,6 +125,7 @@ struct NetworkProtocol::Header using Item = variant< Acknowledged, + Version, DataRequest, DataResponse, AnnounceSelf, |