Goby3  3.1.5a
2024.05.23
intervehicle.proto
Go to the documentation of this file.
1 syntax = "proto2";
2 import "dccl/option_extensions.proto";
3 import "goby/protobuf/option_extensions.proto";
4 import "goby/acomms/protobuf/driver_base.proto";
5 import "goby/acomms/protobuf/amac_config.proto";
6 import "goby/acomms/protobuf/buffer.proto";
7 import "goby/acomms/protobuf/modem_message.proto";
8 import "goby/middleware/protobuf/intervehicle_transporter_config.proto";
9 import "goby/middleware/protobuf/serializer_transporter.proto";
10 
11 package goby.middleware.intervehicle.protobuf;
12 
13 message PortalConfig
14 {
15  option (dccl.msg) = {
16  unit_system: "si"
17  };
18 
19  message LinkConfig
20  {
21  required uint32 modem_id = 1;
22  optional uint32 subnet_mask = 2 [default = 0xFFF0];
23 
24  required goby.acomms.protobuf.DriverConfig driver = 11
25  [(goby.field).description =
26  "Configure the modem driver(s) in use by this portal"];
27 
28  optional goby.acomms.protobuf.MACConfig mac = 12
29  [(goby.field).description =
30  "Configure the acoustic Medium Access Control"];
31 
32  optional goby.acomms.protobuf.DynamicBufferConfig subscription_buffer =
33  13 [(goby.field).description =
34  "Buffer configuration for subscription forwarding"];
35 
36  optional double ack_timeout = 20 [
37  default = 1.0,
38  (goby.field).description =
39  "Time to wait before resending the same data (ARQ wait).",
40  (dccl.field) = { units { base_dimensions: "T" } }
41  ];
42 
43  optional double modem_report_interval = 21 [
44  default = 10.0,
45  (goby.field).description = "Time between modem reports",
46  (dccl.field) = { units { base_dimensions: "T" } }
47  ];
48  }
49 
50  repeated LinkConfig link = 1;
51 
52  message PersistSubscriptions
53  {
54  required string name = 1
55  [(goby.field).description =
56  "Name to use when persisting subscriptions (must be unique "
57  "for each InterVehiclePortal on this machine)"];
58  required string dir = 2
59  [(goby.field).description =
60  "Directory to write subscription data file"];
61  }
62  optional PersistSubscriptions persist_subscriptions = 10
63  [(goby.field).description =
64  "Configuration for persisting intervehicle subscriptions between "
65  "restarts. If omitted, subscriptions will not be persisted, and "
66  "all remote subscribers will need to resubscribe when this Portal "
67  "restarts."];
68 }
69 
70 message Status
71 {
72  required int32 tx_queue_size = 1;
73 }
74 
75 enum SubscriptionDCCLID
76 {
77  SUBSCRIPTION_DCCL_ID__GOBY_3_0 = 2;
78  SUBSCRIPTION_DCCL_ID__GOBY_3_1 = 3;
79 }
80 
81 // when this changes, update GOBY_INTERVEHICLE_API_VERSION in
82 // goby3/CMakeLists.txt
83 message Subscription
84 {
85  option (dccl.msg) = {
86  codec_version: 3
87  id: 3 // SUBSCRIPTION_DCCL_ID__GOBY_3_1
88  max_bytes: 32
89  unit_system: "si"
90  };
91 
92  // must be first to allow us to decode this field regardless of other
93  // message changes so we can warn when its incompatible
94  required uint32 api_version = 1
95  [(dccl.field) = { min: 1 max: 16 in_head: true }];
96 
97  required Header header = 2;
98  optional uint64 time = 3 [(dccl.field) = {
99  omit: true
100  units { prefix: "micro" base_dimensions: "T" }
101  }];
102 
103  enum Action
104  {
105  SUBSCRIBE = 1;
106  UNSUBSCRIBE = 2;
107  }
108  required Action action = 4;
109 
110  required uint32 dccl_id = 5
111  [(dccl.field) = { codec: "dccl.default.id" }]; // 2-byte varint
112  required uint32 group = 6
113  [(dccl.field) = { min: 0 max: 4294967295 }]; // 4-byte
114 
115  optional TransporterConfig intervehicle = 10;
116  optional goby.middleware.protobuf.SerializerProtobufMetadata metadata = 20
117  [(dccl.field).omit = true];
118 }
119 
120 message Header
121 {
122  required int32 src = 1 [(dccl.field) = { min: 0 max: 65535 }];
123  repeated int32 dest = 2
124  [(dccl.field) = { min: 0 max: 65535 max_repeat: 4 }];
125  optional goby.acomms.protobuf.ModemTransmission modem_msg = 10
126  [(dccl.field).omit = true];
127 }
128 
129 message DCCLPacket
130 {
131  required int32 dccl_id = 1;
132  required bytes data = 2;
133 }
134 
135 // have to split this at the Portal as the Forwarders may not have all the DCCL
136 // IDs loaded
137 message DCCLForwardedData
138 {
139  required Header header = 1;
140  repeated DCCLPacket frame = 2;
141 }
142 
143 message AckData
144 {
145  option (dccl.msg) = {
146  unit_system: "si"
147  };
148  required Header header = 1
149  [(goby.field).description =
150  "src is the modem from which the ack originated. dest is the "
151  "local modem that received the ack"];
152 
153  required int64 latency = 2 [
154  (goby.field).description = "Time between queuing and acknowledgement",
155  (dccl.field) = { units { prefix: "micro" base_dimensions: "T" } }
156  ];
157 }
158 
159 message ExpireData
160 {
161  option (dccl.msg) = {
162  unit_system: "si"
163  };
164 
165  required Header header = 1
166  [(goby.field).description =
167  "dest is the local modem that expired this message"];
168 
169  required int64 latency = 2 [
170  (goby.field).description = "Time between queuing and expiration",
171  (dccl.field) = { units { prefix: "micro" base_dimensions: "T" } }
172  ];
173 
174  enum ExpireReason
175  {
176  EXPIRED_NO_SUBSCRIBERS = 1;
177  EXPIRED_TIME_TO_LIVE_EXCEEDED = 2;
178  EXPIRED_BUFFER_OVERFLOW = 3;
179  }
180  required ExpireReason reason = 3;
181 
182  // required int32 transmit_attempts = 4
183  // [(goby.field).description =
184  // "the number of times this message was transmitted"];
185 }
186 
187 message AckMessagePair
188 {
189  required goby.middleware.protobuf.SerializerTransporterMessage serializer =
190  1;
191  required AckData data = 2;
192 }
193 
194 message ExpireMessagePair
195 {
196  required goby.middleware.protobuf.SerializerTransporterMessage serializer =
197  1;
198  required ExpireData data = 2;
199 }
200 
201 message SubscriptionReport
202 {
203  required uint32 link_modem_id = 1;
204  repeated Subscription subscription = 2;
205  optional Subscription changed = 3;
206 }
207 
208 message SubscriptionPersistCollection
209 {
210  option (dccl.msg) = {
211  unit_system: "si"
212  };
213 
214  required uint64 time = 1 [(dccl.field) = {
215  omit: true
216  units { prefix: "micro" base_dimensions: "T" }
217  }];
218  repeated Subscription subscription = 2;
219 }
220 
221 message ModemTransmissionWithLinkID
222 {
223  required uint32 link_modem_id = 1;
224  required goby.acomms.protobuf.ModemTransmission data = 2;
225 }
226 
227 message ModemRawWithLinkID
228 {
229  required uint32 link_modem_id = 1;
230  required goby.acomms.protobuf.ModemRaw data = 2;
231 }
232 
233 message ModemReportWithLinkID
234 {
235  required uint32 link_modem_id = 1;
236  required goby.acomms.protobuf.ModemReport data = 2;
237 }