From d0747faf6860c825e81855e2b58cbc8298084af1 Mon Sep 17 00:00:00 2001 From: utf-4096 Date: Thu, 23 Mar 2023 00:10:14 +0100 Subject: [PATCH] Make everything required --- protobuf/2.0/Authentication.proto | 6 +++--- protobuf/2.0/Container.proto | 2 +- protobuf/2.0/Message.proto | 6 +++--- protobuf/2.0/PublishDiscover.proto | 18 +++++++++--------- 4 files changed, 16 insertions(+), 16 deletions(-) diff --git a/protobuf/2.0/Authentication.proto b/protobuf/2.0/Authentication.proto index 9f5a6ee..e2e39ef 100644 --- a/protobuf/2.0/Authentication.proto +++ b/protobuf/2.0/Authentication.proto @@ -4,7 +4,7 @@ syntax = "proto3"; // Request logging into the server // seed: the seed used to generate the address message AuthenticationRequest { - fixed64 seed = 1; + required fixed64 seed = 1; } // Server -> Client @@ -12,6 +12,6 @@ message AuthenticationRequest { // status: 0 if successful, anything else is an error // address: the address assigned to the peer message AuthenticationResponse { - uint32 status = 1; - fixed64 address = 2; + required uint32 status = 1; + required fixed64 address = 2; } diff --git a/protobuf/2.0/Container.proto b/protobuf/2.0/Container.proto index ad25cbb..b544f28 100644 --- a/protobuf/2.0/Container.proto +++ b/protobuf/2.0/Container.proto @@ -6,7 +6,7 @@ syntax = "proto3"; // Client <-> Server message Container { - uint32 id = 1; + required uint32 id = 1; oneof message { AuthenticationRequest AuthenticationRequest = 2; diff --git a/protobuf/2.0/Message.proto b/protobuf/2.0/Message.proto index eff39aa..e1894d6 100644 --- a/protobuf/2.0/Message.proto +++ b/protobuf/2.0/Message.proto @@ -6,7 +6,7 @@ syntax = "proto3"; // Server -> Client: source // data: message data message Message { - fixed64 address = 1; - fixed32 port = 2; - bytes data = 3; + required fixed64 address = 1; + required fixed32 port = 2; + required bytes data = 3; } diff --git a/protobuf/2.0/PublishDiscover.proto b/protobuf/2.0/PublishDiscover.proto index afee672..5f35ce4 100644 --- a/protobuf/2.0/PublishDiscover.proto +++ b/protobuf/2.0/PublishDiscover.proto @@ -8,16 +8,16 @@ syntax = "proto3"; // false: delete the port // flags: search flags message PublishRequest { - fixed32 port = 1; - bool publish = 2; - repeated string flags = 3; + required fixed32 port = 1; + required bool publish = 2; + repeated string flags = 3; } // Server -> Client // Acknowledge a PublishRequest // status: 0 if successful, anything else is an error message PublishResponse { - uint32 status = 1; + required uint32 status = 1; } // Client -> Server @@ -25,7 +25,7 @@ message PublishResponse { // limit: maximum number of peers to search for // flags: flags to search for message DiscoverRequest { - uint32 limit = 1; + required uint32 limit = 1; repeated string flags = 2; } @@ -35,10 +35,10 @@ message DiscoverRequest { // peers: a list of peers, empty if nothing is found message DiscoverResponse { message DiscoverPeer { - uint32 port = 1; - fixed64 address = 2; - repeated string flags = 3; + required uint32 port = 1; + required fixed64 address = 2; + repeated string flags = 3; } - uint32 status = 1; + required uint32 status = 1; repeated DiscoverPeer peers = 2; }