blob: c056e4c9db4c2a50c10b7995d06aaf0df8a978b4 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
|
syntax = "proto3";
// package syscall_rpc is a set of networking related system calls that can be
// forwarded to a socket gofer.
//
// TODO: Document individual RPCs.
package syscall_rpc;
message SendmsgRequest {
uint32 fd = 1;
bytes data = 2 [ctype = CORD];
bytes address = 3;
bool more = 4;
bool end_of_record = 5;
}
message SendmsgResponse {
oneof result {
uint32 error_number = 1;
uint32 length = 2;
}
}
message IOCtlRequest {
uint32 fd = 1;
uint32 cmd = 2;
bytes arg = 3;
}
message IOCtlResponse {
oneof result {
uint32 error_number = 1;
bytes value = 2;
}
}
message RecvmsgRequest {
uint32 fd = 1;
uint32 length = 2;
bool sender = 3;
bool peek = 4;
bool trunc = 5;
uint32 cmsg_length = 6;
}
message OpenRequest {
bytes path = 1;
uint32 flags = 2;
uint32 mode = 3;
}
message OpenResponse {
oneof result {
uint32 error_number = 1;
uint32 fd = 2;
}
}
message ReadRequest {
uint32 fd = 1;
uint32 length = 2;
}
message ReadResponse {
oneof result {
uint32 error_number = 1;
bytes data = 2 [ctype = CORD];
}
}
message ReadFileRequest {
string path = 1;
}
message ReadFileResponse {
oneof result {
uint32 error_number = 1;
bytes data = 2 [ctype = CORD];
}
}
message WriteRequest {
uint32 fd = 1;
bytes data = 2 [ctype = CORD];
}
message WriteResponse {
oneof result {
uint32 error_number = 1;
uint32 length = 2;
}
}
message WriteFileRequest {
string path = 1;
bytes content = 2;
}
message WriteFileResponse {
uint32 error_number = 1;
uint32 written = 2;
}
message AddressResponse {
bytes address = 1;
uint32 length = 2;
}
message RecvmsgResponse {
message ResultPayload {
bytes data = 1 [ctype = CORD];
AddressResponse address = 2;
uint32 length = 3;
bytes cmsg_data = 4;
}
oneof result {
uint32 error_number = 1;
ResultPayload payload = 2;
}
}
message BindRequest {
uint32 fd = 1;
bytes address = 2;
}
message BindResponse {
uint32 error_number = 1;
}
message AcceptRequest {
uint32 fd = 1;
bool peer = 2;
int64 flags = 3;
}
message AcceptResponse {
message ResultPayload {
uint32 fd = 1;
AddressResponse address = 2;
}
oneof result {
uint32 error_number = 1;
ResultPayload payload = 2;
}
}
message ConnectRequest {
uint32 fd = 1;
bytes address = 2;
}
message ConnectResponse {
uint32 error_number = 1;
}
message ListenRequest {
uint32 fd = 1;
int64 backlog = 2;
}
message ListenResponse {
uint32 error_number = 1;
}
message ShutdownRequest {
uint32 fd = 1;
int64 how = 2;
}
message ShutdownResponse {
uint32 error_number = 1;
}
message CloseRequest {
uint32 fd = 1;
}
message CloseResponse {
uint32 error_number = 1;
}
message GetSockOptRequest {
uint32 fd = 1;
int64 level = 2;
int64 name = 3;
uint32 length = 4;
}
message GetSockOptResponse {
oneof result {
uint32 error_number = 1;
bytes opt = 2;
}
}
message SetSockOptRequest {
uint32 fd = 1;
int64 level = 2;
int64 name = 3;
bytes opt = 4;
}
message SetSockOptResponse {
uint32 error_number = 1;
}
message GetSockNameRequest {
uint32 fd = 1;
}
message GetSockNameResponse {
oneof result {
uint32 error_number = 1;
AddressResponse address = 2;
}
}
message GetPeerNameRequest {
uint32 fd = 1;
}
message GetPeerNameResponse {
oneof result {
uint32 error_number = 1;
AddressResponse address = 2;
}
}
message SocketRequest {
int64 family = 1;
int64 type = 2;
int64 protocol = 3;
}
message SocketResponse {
oneof result {
uint32 error_number = 1;
uint32 fd = 2;
}
}
message EpollWaitRequest {
uint32 fd = 1;
uint32 num_events = 2;
sint64 msec = 3;
}
message EpollEvent {
uint32 fd = 1;
uint32 events = 2;
}
message EpollEvents {
repeated EpollEvent events = 1;
}
message EpollWaitResponse {
oneof result {
uint32 error_number = 1;
EpollEvents events = 2;
}
}
message EpollCtlRequest {
uint32 epfd = 1;
int64 op = 2;
uint32 fd = 3;
EpollEvent event = 4;
}
message EpollCtlResponse {
uint32 error_number = 1;
}
message EpollCreate1Request {
int64 flag = 1;
}
message EpollCreate1Response {
oneof result {
uint32 error_number = 1;
uint32 fd = 2;
}
}
message PollRequest {
uint32 fd = 1;
uint32 events = 2;
}
message PollResponse {
oneof result {
uint32 error_number = 1;
uint32 events = 2;
}
}
message SyscallRequest {
oneof args {
SocketRequest socket = 1;
SendmsgRequest sendmsg = 2;
RecvmsgRequest recvmsg = 3;
BindRequest bind = 4;
AcceptRequest accept = 5;
ConnectRequest connect = 6;
ListenRequest listen = 7;
ShutdownRequest shutdown = 8;
CloseRequest close = 9;
GetSockOptRequest get_sock_opt = 10;
SetSockOptRequest set_sock_opt = 11;
GetSockNameRequest get_sock_name = 12;
GetPeerNameRequest get_peer_name = 13;
EpollWaitRequest epoll_wait = 14;
EpollCtlRequest epoll_ctl = 15;
EpollCreate1Request epoll_create1 = 16;
PollRequest poll = 17;
ReadRequest read = 18;
WriteRequest write = 19;
OpenRequest open = 20;
IOCtlRequest ioctl = 21;
WriteFileRequest write_file = 22;
ReadFileRequest read_file = 23;
}
}
message SyscallResponse {
oneof result {
SocketResponse socket = 1;
SendmsgResponse sendmsg = 2;
RecvmsgResponse recvmsg = 3;
BindResponse bind = 4;
AcceptResponse accept = 5;
ConnectResponse connect = 6;
ListenResponse listen = 7;
ShutdownResponse shutdown = 8;
CloseResponse close = 9;
GetSockOptResponse get_sock_opt = 10;
SetSockOptResponse set_sock_opt = 11;
GetSockNameResponse get_sock_name = 12;
GetPeerNameResponse get_peer_name = 13;
EpollWaitResponse epoll_wait = 14;
EpollCtlResponse epoll_ctl = 15;
EpollCreate1Response epoll_create1 = 16;
PollResponse poll = 17;
ReadResponse read = 18;
WriteResponse write = 19;
OpenResponse open = 20;
IOCtlResponse ioctl = 21;
WriteFileResponse write_file = 22;
ReadFileResponse read_file = 23;
}
}
|