Goby3 3.7.0
2026.11.12
Loading...
Searching...
No Matches
intervehicle.proto
Go to the documentation of this file.
1syntax = "proto2";
2import "dccl/option_extensions.proto";
3import "goby/protobuf/option_extensions.proto";
4import "goby/acomms/protobuf/driver_base.proto";
5import "goby/acomms/protobuf/amac_config.proto";
6import "goby/acomms/protobuf/buffer.proto";
7import "goby/acomms/protobuf/modem_message.proto";
8import "goby/middleware/protobuf/intervehicle_transporter_config.proto";
9import "goby/middleware/protobuf/serializer_transporter.proto";
10
11package goby.middleware.intervehicle.protobuf;
12
13message 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 message RestartOnFailure
50 {
51 optional double interval = 1 [
52 default = 60,
53 (goby.field).description =
54 "Time from a driver failure to the next attempt to "
55 "start a new driver",
56 (dccl.field) = { units { base_dimensions: "T" } }
57 ];
58 }
59 optional RestartOnFailure restart_on_failure = 22
60 [(goby.field).description =
61 "If set, a driver that fails, at startup or while running, is "
62 "replaced by a new one after restart_on_failure.interval, "
63 "while the portal's other links keep running. If omitted, a "
64 "driver failure terminates the portal."];
65
66 optional bool shutdown_driver_on_exit = 23 [
67 default = true,
68 (goby.field).description =
69 "Call the driver's shutdown() when the portal exits, so the "
70 "driver can finish what is in progress (e.g. an Iridium SBD "
71 "session) before the modem is released"
72 ];
73 }
74
75 repeated LinkConfig link = 1;
76
77 message PersistSubscriptions
78 {
79 required string name = 1
80 [(goby.field).description =
81 "Name to use when persisting subscriptions (must be unique "
82 "for each InterVehiclePortal on this machine)"];
83 required string dir = 2
84 [(goby.field).description =
85 "Directory to write subscription data file"];
86 }
87 optional PersistSubscriptions persist_subscriptions = 10
88 [(goby.field).description =
89 "Configuration for persisting intervehicle subscriptions between "
90 "restarts. If omitted, subscriptions will not be persisted, and "
91 "all remote subscribers will need to resubscribe when this Portal "
92 "restarts."];
93}
94
95message Status
96{
97 required int32 tx_queue_size = 1;
98}
99
100enum SubscriptionDCCLID
101{
102 SUBSCRIPTION_DCCL_ID__GOBY_3_0 = 2;
103 SUBSCRIPTION_DCCL_ID__GOBY_3_1 = 3;
104}
105
106// when this changes, update GOBY_INTERVEHICLE_API_VERSION in
107// goby3/CMakeLists.txt
108message Subscription
109{
110 option (dccl.msg) = {
111 codec_version: 3
112 id: 3 // SUBSCRIPTION_DCCL_ID__GOBY_3_1
113 max_bytes: 32
114 unit_system: "si"
115 };
116
117 // must be first to allow us to decode this field regardless of other
118 // message changes so we can warn when its incompatible
119 required uint32 api_version = 1
120 [(dccl.field) = { min: 1 max: 16 in_head: true }];
121
122 required Header header = 2;
123 optional uint64 time = 3 [(dccl.field) = {
124 omit: true
125 units { prefix: "micro" base_dimensions: "T" }
126 }];
127
128 enum Action
129 {
130 SUBSCRIBE = 1;
131 UNSUBSCRIBE = 2;
132 }
133 required Action action = 4;
134
135 required uint32 dccl_id = 5
136 [(dccl.field) = { codec: "dccl.default.id" }]; // 2-byte varint
137 required uint32 group = 6
138 [(dccl.field) = { min: 0 max: 4294967295 }]; // 4-byte
139
140 optional TransporterConfig intervehicle = 10;
141 optional goby.middleware.protobuf.SerializerProtobufMetadata metadata = 20
142 [(dccl.field).omit = true];
143}
144
145message Header
146{
147 required int32 src = 1 [(dccl.field) = { min: 0 max: 65535 }];
148 repeated int32 dest = 2
149 [(dccl.field) = { min: 0 max: 65535 max_repeat: 4 }];
150 optional goby.acomms.protobuf.ModemTransmission modem_msg = 10
151 [(dccl.field).omit = true];
152}
153
154message DCCLPacket
155{
156 required int32 dccl_id = 1;
157 required bytes data = 2;
158}
159
160// have to split this at the Portal as the Forwarders may not have all the DCCL
161// IDs loaded
162message DCCLForwardedData
163{
164 required Header header = 1;
165 repeated DCCLPacket frame = 2;
166}
167
168message AckData
169{
170 option (dccl.msg) = {
171 unit_system: "si"
172 };
173 required Header header = 1
174 [(goby.field).description =
175 "src is the modem from which the ack originated. dest is the "
176 "local modem that received the ack"];
177
178 required int64 latency = 2 [
179 (goby.field).description = "Time between queuing and acknowledgement",
180 (dccl.field) = { units { prefix: "micro" base_dimensions: "T" } }
181 ];
182}
183
184message ExpireData
185{
186 option (dccl.msg) = {
187 unit_system: "si"
188 };
189
190 required Header header = 1
191 [(goby.field).description =
192 "dest is the local modem that expired this message"];
193
194 required int64 latency = 2 [
195 (goby.field).description = "Time between queuing and expiration",
196 (dccl.field) = { units { prefix: "micro" base_dimensions: "T" } }
197 ];
198
199 enum ExpireReason
200 {
201 EXPIRED_NO_SUBSCRIBERS = 1;
202 EXPIRED_TIME_TO_LIVE_EXCEEDED = 2;
203 EXPIRED_BUFFER_OVERFLOW = 3;
204 // replaced before transmission: a publication by a newer one with
205 // clear_pending, or a queued subscription by one with the opposite
206 // action for the same type, group and configuration. A queued
207 // subscription replaced by an equivalent one (possibly from another
208 // local subscriber) is not expired but acked or expired with it.
209 EXPIRED_SUPERSEDED = 4;
210 }
211 required ExpireReason reason = 3;
212
213 // required int32 transmit_attempts = 4
214 // [(goby.field).description =
215 // "the number of times this message was transmitted"];
216}
217
218message AckMessagePair
219{
220 required goby.middleware.protobuf.SerializerTransporterMessage serializer =
221 1;
222 required AckData data = 2;
223}
224
225message ExpireMessagePair
226{
227 required goby.middleware.protobuf.SerializerTransporterMessage serializer =
228 1;
229 required ExpireData data = 2;
230}
231
232message SubscriptionReport
233{
234 required uint32 link_modem_id = 1;
235 repeated Subscription subscription = 2;
236 optional Subscription changed = 3;
237}
238
239message SubscriptionPersistCollection
240{
241 option (dccl.msg) = {
242 unit_system: "si"
243 };
244
245 required uint64 time = 1 [(dccl.field) = {
246 omit: true
247 units { prefix: "micro" base_dimensions: "T" }
248 }];
249 repeated Subscription subscription = 2;
250}
251
252message ModemTransmissionWithLinkID
253{
254 required uint32 link_modem_id = 1;
255 required goby.acomms.protobuf.ModemTransmission data = 2;
256}
257
258message ModemRawWithLinkID
259{
260 required uint32 link_modem_id = 1;
261 required goby.acomms.protobuf.ModemRaw data = 2;
262}
263
264message ModemReportWithLinkID
265{
266 required uint32 link_modem_id = 1;
267 required goby.acomms.protobuf.ModemReport data = 2;
268}