Goby3  3.1.5a
2024.05.23
interprocess_zeromq.proto
Go to the documentation of this file.
1 syntax = "proto2";
2 import "goby/protobuf/option_extensions.proto";
3 
4 package goby.zeromq.protobuf;
5 
6 enum Request
7 {
8  PROVIDE_PUB_SUB_SOCKETS = 1; // provide sockets for publish/subscribe
9  PROVIDE_HOLD_STATE = 2; // query if hold has been released so this process
10  // can begin publishing
11 }
12 
13 message ManagerRequest
14 {
15  required Request request = 1
16  [(goby.field).description =
17  "Request to be made of the Manager (gobyd)"];
18  required string client_name = 2
19  [(goby.field).description =
20  "Unique name for the client making the request"];
21  required int32 client_pid = 3
22  [(goby.field).description =
23  "PID for the client making the request"];
24  optional bool ready = 4 [
25  default = false,
26  (goby.field).description =
27  "Client is ready to commence accepting publications (all required "
28  "subscriptions are complete"
29  ];
30 }
31 
32 message Socket
33 {
34  enum SocketType
35  {
36  PUBLISH = 1;
37  SUBSCRIBE = 2;
38  REPLY = 3;
39  REQUEST = 4;
40  // PUSH = 5;
41  // PULL = 6;
42  // DEALER = 7;
43  // ROUTER = 8;
44  }
45  enum Transport
46  {
47  INPROC = 1; // intraprocess - interthread communication
48  IPC = 2; // interprocess - uses Unix Sockets
49  TCP = 3;
50  PGM = 4; // reliable multicast
51  EPGM = 5; // encapsulated PGM over UDP
52  }
53  enum ConnectOrBind
54  {
55  CONNECT = 1;
56  BIND = 2;
57  }
58  required SocketType socket_type = 1;
59  optional uint32 socket_id = 2 [
60  default = 0,
61  (goby.field).description =
62  "defines a socket or group of sockets that are send and "
63  "receive together. Sockets with the same id that are must be "
64  "compatible (generally have the same SocketType)"
65  ];
66  optional Transport transport = 3 [default = EPGM];
67  optional ConnectOrBind connect_or_bind = 4 [default = CONNECT];
68 
69  // required for TCP, PGM, EPGM
70  optional string ethernet_address = 5 [
71  default = "127.0.0.1",
72  (goby.field).description =
73  "primary IP address of the interface to use"
74  ];
75  optional string multicast_address = 6 [
76  default = "239.255.7.15",
77  (goby.field).description =
78  "only required if `transport`=PGM or EPGM; multicast IP "
79  "address to use; 239.252.0.0-239.255.255.255 is recommended "
80  "(site-local). See also "
81  "http://www.iana.org/assignments/multicast-addresses/"
82  "multicast-addresses.ml"
83  ];
84  optional uint32 ethernet_port = 7 [default = 11142];
85 
86  // required for INPROC, IPC
87  optional string socket_name = 8;
88 
89  optional uint32 send_queue_size = 10 [default = 1000];
90  optional uint32 receive_queue_size = 11 [default = 1000];
91 }
92 
93 message ManagerResponse
94 {
95  required Request request = 1;
96  required string client_name = 2;
97  required int32 client_pid = 3;
98  optional Socket publish_socket = 4;
99  optional Socket subscribe_socket = 5;
100  optional bool hold = 6 [
101  default = true,
102  (goby.field).description =
103  "Used to synchronize start of multiple processes. If true, wait "
104  "until receiving a hold == false before publishing data"
105  ];
106 }
107 
108 message InprocControl
109 {
110  enum InprocControlType
111  {
112  PUB_CONFIGURATION = 1; // read -> main
113  SUBSCRIBE = 2; // main -> read
114  SUBSCRIBE_ACK = 3; // read -> main
115  UNSUBSCRIBE = 4; // main -> read
116  UNSUBSCRIBE_ACK = 5; // read -> main
117  RECEIVE = 6; // read -> main
118  SHUTDOWN = 7; // main -> read
119  REQUEST_HOLD_STATE = 9; // read -> main
120  NOTIFY_HOLD_STATE = 10; // main -> read
121  }
122  required InprocControlType type = 1;
123 
124  optional Socket publish_socket = 2;
125  optional bytes subscription_identifier = 3;
126  optional bytes received_data = 4;
127 
128  optional bool hold = 10;
129 }