Goby v2
file_transfer.proto
1 
2 import "goby/common/protobuf/option_extensions.proto";
3 import "dccl/option_extensions.proto";
4 
5 package goby.acomms.protobuf;
6 
7 message FileFragment
8 {
9  option (dccl.msg).id = 7;
10  option (dccl.msg).max_bytes = 64;
11 
12  required int32 src = 1 [
13  (dccl.field).min = -1,
14  (dccl.field).max = 62,
15  (dccl.field).in_head = true
16  ];
17  required int32 dest = 2 [
18  (dccl.field).min = -1,
19  (dccl.field).max = 62,
20  (dccl.field).in_head = true
21  ];
22 
23  required int32 fragment = 3 [
24  (dccl.field).min = 0,
25  (dccl.field).max = 18079
26  ]; // max file: 1048576 / data length: 58
27 
28  required bool is_last_fragment = 4;
29 
30  required int32 num_bytes = 5 [(dccl.field).min = 1, (dccl.field).max = 58];
31  required bytes data = 6 [(dccl.field).max_length = 58];
32 }
33 
34 message TransferRequest
35 {
36  option (dccl.msg).id = 8;
37  option (dccl.msg).max_bytes = 64;
38  required int32 src = 1 [
39  (dccl.field).min = -1,
40  (dccl.field).max = 62,
41  (dccl.field).in_head = true
42  ];
43  required int32 dest = 2 [
44  (dccl.field).min = -1,
45  (dccl.field).max = 62,
46  (dccl.field).in_head = true
47  ];
48 
49  enum PushPull
50  {
51  PUSH = 1;
52  PULL = 2;
53  }
54  required PushPull push_or_pull = 3 [(dccl.field).in_head = true];
55  required string file = 10 [(dccl.field).max_length = 60];
56 }
57 
58 message TransferResponse
59 {
60  option (dccl.msg).id = 9;
61  option (dccl.msg).max_bytes = 64;
62 
63  required int32 src = 1 [
64  (dccl.field).min = -1,
65  (dccl.field).max = 62,
66  (dccl.field).in_head = true
67  ];
68  required int32 dest = 2 [
69  (dccl.field).min = -1,
70  (dccl.field).max = 62,
71  (dccl.field).in_head = true
72  ];
73 
74  required bool transfer_successful = 3;
75 
76  enum ErrorCode
77  {
78  COULD_NOT_READ_FILE = 1;
79  FILE_TOO_LARGE = 2;
80  TIMEOUT = 3;
81  COULD_NOT_WRITE_FILE = 4;
82  ERROR_WHILE_READING = 5;
83  OTHER_ERROR = 6;
84  }
85  optional ErrorCode error = 4;
86 
87  optional int32 num_fragments = 5 [
88  (dccl.field).min = 0,
89  (dccl.field).max = 18079
90  ]; // max file: 1048576 / data length: 58
91 }