@@ -17,31 +17,31 @@ package vpn;
17
17
// msg_id which it sets on the request, the responder sets response_to that msg_id on the response
18
18
// message
19
19
message RPC {
20
- uint64 msg_id = 1 ;
21
- uint64 response_to = 2 ;
20
+ uint64 msg_id = 1 ;
21
+ uint64 response_to = 2 ;
22
22
}
23
23
24
24
// ManagerMessage is a message from the manager (to the tunnel).
25
25
message ManagerMessage {
26
- RPC rpc = 1 ;
27
- oneof msg {
28
- GetPeerUpdate get_peer_update = 2 ;
29
- NetworkSettingsResponse network_settings = 3 ;
30
- StartRequest start = 4 ;
31
- StopRequest stop = 5 ;
32
- }
26
+ RPC rpc = 1 ;
27
+ oneof msg {
28
+ GetPeerUpdate get_peer_update = 2 ;
29
+ NetworkSettingsResponse network_settings = 3 ;
30
+ StartRequest start = 4 ;
31
+ StopRequest stop = 5 ;
32
+ }
33
33
}
34
34
35
35
// TunnelMessage is a message from the tunnel (to the manager).
36
36
message TunnelMessage {
37
- RPC rpc = 1 ;
38
- oneof msg {
39
- Log log = 2 ;
40
- PeerUpdate peer_update = 3 ;
41
- NetworkSettingsRequest network_settings = 4 ;
42
- StartResponse start = 5 ;
43
- StopResponse stop = 6 ;
44
- }
37
+ RPC rpc = 1 ;
38
+ oneof msg {
39
+ Log log = 2 ;
40
+ PeerUpdate peer_update = 3 ;
41
+ NetworkSettingsRequest network_settings = 4 ;
42
+ StartResponse start = 5 ;
43
+ StopResponse stop = 6 ;
44
+ }
45
45
}
46
46
47
47
// ClientMessage is a message from the client (to the service). Windows only.
@@ -50,7 +50,7 @@ message ClientMessage {
50
50
oneof msg {
51
51
StartRequest start = 2 ;
52
52
StopRequest stop = 3 ;
53
- StatusRequest status = 4 ;
53
+ StatusRequest status = 4 ;
54
54
}
55
55
}
56
56
@@ -60,32 +60,32 @@ message ServiceMessage {
60
60
oneof msg {
61
61
StartResponse start = 2 ;
62
62
StopResponse stop = 3 ;
63
- Status status = 4 ; // either in reply to a StatusRequest or broadcasted
63
+ Status status = 4 ; // either in reply to a StatusRequest or broadcasted
64
64
}
65
65
}
66
66
67
67
// Log is a log message generated by the tunnel. The manager should log it to the system log. It is
68
68
// one-way tunnel -> manager with no response.
69
69
message Log {
70
- enum Level {
71
- // these are designed to match slog levels
72
- DEBUG = 0 ;
73
- INFO = 1 ;
74
- WARN = 2 ;
75
- ERROR = 3 ;
76
- CRITICAL = 4 ;
77
- FATAL = 5 ;
78
- }
79
- Level level = 1 ;
80
-
81
- string message = 2 ;
82
- repeated string logger_names = 3 ;
83
-
84
- message Field {
85
- string name = 1 ;
86
- string value = 2 ;
87
- }
88
- repeated Field fields = 4 ;
70
+ enum Level {
71
+ // these are designed to match slog levels
72
+ DEBUG = 0 ;
73
+ INFO = 1 ;
74
+ WARN = 2 ;
75
+ ERROR = 3 ;
76
+ CRITICAL = 4 ;
77
+ FATAL = 5 ;
78
+ }
79
+ Level level = 1 ;
80
+
81
+ string message = 2 ;
82
+ repeated string logger_names = 3 ;
83
+
84
+ message Field {
85
+ string name = 1 ;
86
+ string value = 2 ;
87
+ }
88
+ repeated Field fields = 4 ;
89
89
}
90
90
91
91
// GetPeerUpdate asks for a PeerUpdate with a full set of data.
@@ -95,121 +95,121 @@ message GetPeerUpdate {}
95
95
// response to GetPeerUpdate (which dumps the full set). It is also generated on any changes (not in
96
96
// response to any request).
97
97
message PeerUpdate {
98
- repeated Workspace upserted_workspaces = 1 ;
99
- repeated Agent upserted_agents = 2 ;
100
- repeated Workspace deleted_workspaces = 3 ;
101
- repeated Agent deleted_agents = 4 ;
98
+ repeated Workspace upserted_workspaces = 1 ;
99
+ repeated Agent upserted_agents = 2 ;
100
+ repeated Workspace deleted_workspaces = 3 ;
101
+ repeated Agent deleted_agents = 4 ;
102
102
}
103
103
104
104
message Workspace {
105
- bytes id = 1 ; // UUID
106
- string name = 2 ;
107
-
108
- enum Status {
109
- UNKNOWN = 0 ;
110
- PENDING = 1 ;
111
- STARTING = 2 ;
112
- RUNNING = 3 ;
113
- STOPPING = 4 ;
114
- STOPPED = 5 ;
115
- FAILED = 6 ;
116
- CANCELING = 7 ;
117
- CANCELED = 8 ;
118
- DELETING = 9 ;
119
- DELETED = 10 ;
120
- }
121
- Status status = 3 ;
105
+ bytes id = 1 ; // UUID
106
+ string name = 2 ;
107
+
108
+ enum Status {
109
+ UNKNOWN = 0 ;
110
+ PENDING = 1 ;
111
+ STARTING = 2 ;
112
+ RUNNING = 3 ;
113
+ STOPPING = 4 ;
114
+ STOPPED = 5 ;
115
+ FAILED = 6 ;
116
+ CANCELING = 7 ;
117
+ CANCELED = 8 ;
118
+ DELETING = 9 ;
119
+ DELETED = 10 ;
120
+ }
121
+ Status status = 3 ;
122
122
}
123
123
124
124
message Agent {
125
- bytes id = 1 ; // UUID
126
- string name = 2 ;
127
- bytes workspace_id = 3 ; // UUID
128
- repeated string fqdn = 4 ;
129
- repeated string ip_addrs = 5 ;
130
- // last_handshake is the primary indicator of whether we are connected to a peer. Zero value or
131
- // anything longer than 5 minutes ago means there is a problem.
132
- google.protobuf.Timestamp last_handshake = 6 ;
125
+ bytes id = 1 ; // UUID
126
+ string name = 2 ;
127
+ bytes workspace_id = 3 ; // UUID
128
+ repeated string fqdn = 4 ;
129
+ repeated string ip_addrs = 5 ;
130
+ // last_handshake is the primary indicator of whether we are connected to a peer. Zero value or
131
+ // anything longer than 5 minutes ago means there is a problem.
132
+ google.protobuf.Timestamp last_handshake = 6 ;
133
133
}
134
134
135
135
// NetworkSettingsRequest is based on
136
136
// https://developer.apple.com/documentation/networkextension/nepackettunnelnetworksettings for
137
137
// macOS. It is a request/response message with response NetworkSettingsResponse
138
138
message NetworkSettingsRequest {
139
- uint32 tunnel_overhead_bytes = 1 ;
140
- uint32 mtu = 2 ;
141
-
142
- message DNSSettings {
143
- repeated string servers = 1 ;
144
- repeated string search_domains = 2 ;
145
- // domain_name is the primary domain name of the tunnel
146
- string domain_name = 3 ;
147
- repeated string match_domains = 4 ;
148
- // match_domains_no_search specifies if the domains in the matchDomains list should not be
149
- // appended to the resolver’s list of search domains.
150
- bool match_domains_no_search = 5 ;
151
- }
152
- DNSSettings dns_settings = 3 ;
153
-
154
- string tunnel_remote_address = 4 ;
155
-
156
- message IPv4Settings {
157
- repeated string addrs = 1 ;
158
- repeated string subnet_masks = 2 ;
159
- // router is the next-hop router in dotted-decimal format
160
- string router = 3 ;
161
-
162
- message IPv4Route {
163
- string destination = 1 ;
164
- string mask = 2 ;
165
- // router is the next-hop router in dotted-decimal format
166
- string router = 3 ;
167
- }
168
- repeated IPv4Route included_routes = 4 ;
169
- repeated IPv4Route excluded_routes = 5 ;
170
- }
171
- IPv4Settings ipv4_settings = 5 ;
172
-
173
- message IPv6Settings {
174
- repeated string addrs = 1 ;
175
- repeated uint32 prefix_lengths = 2 ;
176
-
177
- message IPv6Route {
178
- string destination = 1 ;
179
- uint32 prefix_length = 2 ;
180
- // router is the address of the next-hop
181
- string router = 3 ;
182
- }
183
- repeated IPv6Route included_routes = 3 ;
184
- repeated IPv6Route excluded_routes = 4 ;
185
- }
186
- IPv6Settings ipv6_settings = 6 ;
139
+ uint32 tunnel_overhead_bytes = 1 ;
140
+ uint32 mtu = 2 ;
141
+
142
+ message DNSSettings {
143
+ repeated string servers = 1 ;
144
+ repeated string search_domains = 2 ;
145
+ // domain_name is the primary domain name of the tunnel
146
+ string domain_name = 3 ;
147
+ repeated string match_domains = 4 ;
148
+ // match_domains_no_search specifies if the domains in the matchDomains list should not be
149
+ // appended to the resolver’s list of search domains.
150
+ bool match_domains_no_search = 5 ;
151
+ }
152
+ DNSSettings dns_settings = 3 ;
153
+
154
+ string tunnel_remote_address = 4 ;
155
+
156
+ message IPv4Settings {
157
+ repeated string addrs = 1 ;
158
+ repeated string subnet_masks = 2 ;
159
+ // router is the next-hop router in dotted-decimal format
160
+ string router = 3 ;
161
+
162
+ message IPv4Route {
163
+ string destination = 1 ;
164
+ string mask = 2 ;
165
+ // router is the next-hop router in dotted-decimal format
166
+ string router = 3 ;
167
+ }
168
+ repeated IPv4Route included_routes = 4 ;
169
+ repeated IPv4Route excluded_routes = 5 ;
170
+ }
171
+ IPv4Settings ipv4_settings = 5 ;
172
+
173
+ message IPv6Settings {
174
+ repeated string addrs = 1 ;
175
+ repeated uint32 prefix_lengths = 2 ;
176
+
177
+ message IPv6Route {
178
+ string destination = 1 ;
179
+ uint32 prefix_length = 2 ;
180
+ // router is the address of the next-hop
181
+ string router = 3 ;
182
+ }
183
+ repeated IPv6Route included_routes = 3 ;
184
+ repeated IPv6Route excluded_routes = 4 ;
185
+ }
186
+ IPv6Settings ipv6_settings = 6 ;
187
187
}
188
188
189
189
// NetworkSettingsResponse is the response from the manager to the tunnel for a
190
190
// NetworkSettingsRequest
191
191
message NetworkSettingsResponse {
192
- bool success = 1 ;
193
- string error_message = 2 ;
192
+ bool success = 1 ;
193
+ string error_message = 2 ;
194
194
}
195
195
196
196
// StartRequest is a request from the manager to start the tunnel. The tunnel replies with a
197
197
// StartResponse.
198
198
message StartRequest {
199
- int32 tunnel_file_descriptor = 1 ;
200
- string coder_url = 2 ;
201
- string api_token = 3 ;
202
- // Additional HTTP headers added to all requests
203
- message Header {
204
- string name = 1 ;
205
- string value = 2 ;
206
- }
207
- repeated Header headers = 4 ;
199
+ int32 tunnel_file_descriptor = 1 ;
200
+ string coder_url = 2 ;
201
+ string api_token = 3 ;
202
+ // Additional HTTP headers added to all requests
203
+ message Header {
204
+ string name = 1 ;
205
+ string value = 2 ;
206
+ }
207
+ repeated Header headers = 4 ;
208
208
}
209
209
210
210
message StartResponse {
211
- bool success = 1 ;
212
- string error_message = 2 ;
211
+ bool success = 1 ;
212
+ string error_message = 2 ;
213
213
}
214
214
215
215
// StopRequest is a request to stop the tunnel. The tunnel replies with a
@@ -219,8 +219,8 @@ message StopRequest {}
219
219
// StopResponse is a response to stopping the tunnel. After sending this response, the tunnel closes
220
220
// its side of the bidirectional stream for writing.
221
221
message StopResponse {
222
- bool success = 1 ;
223
- string error_message = 2 ;
222
+ bool success = 1 ;
223
+ string error_message = 2 ;
224
224
}
225
225
226
226
// StatusRequest is a request to get the status of the tunnel. The manager
@@ -230,18 +230,18 @@ message StatusRequest {}
230
230
// Status is sent in response to a StatusRequest or broadcasted to all clients
231
231
// when the status changes.
232
232
message Status {
233
- enum Lifecycle {
234
- UNKNOWN = 0 ;
235
- STARTING = 1 ;
236
- STARTED = 2 ;
237
- STOPPING = 3 ;
238
- STOPPED = 4 ;
239
- }
240
- Lifecycle lifecycle = 1 ;
241
- string error_message = 2 ;
242
-
243
- // This will be a FULL update with all workspaces and agents, so clients
244
- // should replace their current peer state. Only the Upserted fields will
245
- // be populated.
246
- PeerUpdate peer_update = 3 ;
233
+ enum Lifecycle {
234
+ UNKNOWN = 0 ;
235
+ STARTING = 1 ;
236
+ STARTED = 2 ;
237
+ STOPPING = 3 ;
238
+ STOPPED = 4 ;
239
+ }
240
+ Lifecycle lifecycle = 1 ;
241
+ string error_message = 2 ;
242
+
243
+ // This will be a FULL update with all workspaces and agents, so clients
244
+ // should replace their current peer state. Only the Upserted fields will
245
+ // be populated.
246
+ PeerUpdate peer_update = 3 ;
247
247
}
0 commit comments