1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 package io.netty.channel.uring;
17
18 import io.netty.channel.IoOps;
19
20
21
22
23
24 public final class IoUringIoOps implements IoOps {
25
26 private final byte opcode;
27 private final byte flags;
28 private final short ioPrio;
29 private final int fd;
30 private final long union1;
31 private final long union2;
32 private final int len;
33 private final int union3;
34 private final short data;
35 private final short personality;
36 private final short union4;
37 private final int union5;
38 private final long union6;
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 public IoUringIoOps(byte opcode, byte flags, short ioPrio, int fd, long union1, long union2, int len, int union3,
135 short data, short union4, short personality, int union5, long union6) {
136 this.opcode = opcode;
137 this.flags = flags;
138 this.ioPrio = ioPrio;
139 this.fd = fd;
140 this.union1 = union1;
141 this.union2 = union2;
142 this.len = len;
143 this.union3 = union3;
144 this.data = data;
145 this.union4 = union4;
146 this.personality = personality;
147 this.union5 = union5;
148 this.union6 = union6;
149 }
150
151 byte opcode() {
152 return opcode;
153 }
154
155 byte flags() {
156 return flags;
157 }
158
159 short ioPrio() {
160 return ioPrio;
161 }
162
163 int fd() {
164 return fd;
165 }
166
167 long union1() {
168 return union1;
169 }
170
171 long union2() {
172 return union2;
173 }
174
175 int len() {
176 return len;
177 }
178
179 int union3() {
180 return union3;
181 }
182
183 short data() {
184 return data;
185 }
186
187 short personality() {
188 return personality;
189 }
190
191 short union4() {
192 return union4;
193 }
194
195 int union5() {
196 return union5;
197 }
198
199 long union6() {
200 return union6;
201 }
202
203 @Override
204 public String toString() {
205 return "IOUringIoOps{" +
206 "opcode=" + opcode +
207 ", flags=" + flags +
208 ", ioPrio=" + ioPrio +
209 ", fd=" + fd +
210 ", union1=" + union1 +
211 ", union2=" + union2 +
212 ", len=" + len +
213 ", union3=" + union3 +
214 ", data=" + data +
215 ", union4=" + union4 +
216 ", personality=" + personality +
217 ", union5=" + union5 +
218 ", union6=" + union6 +
219 '}';
220 }
221
222
223
224
225
226
227
228
229
230
231
232 static IoUringIoOps newAsyncCancel(int fd, byte flags, long userData, short data) {
233
234 return new IoUringIoOps(Native.IORING_OP_ASYNC_CANCEL, flags, (short) 0, fd, 0, userData, 0, 0,
235 data, (short) 0, (short) 0, 0, 0);
236 }
237
238
239
240
241
242
243
244
245
246 static IoUringIoOps newClose(int fd, byte flags, short data) {
247 return new IoUringIoOps(Native.IORING_OP_CLOSE, flags, (short) 0, fd, 0L, 0L, 0, 0, data,
248 (short) 0, (short) 0, 0, 0);
249 }
250
251
252
253
254
255
256
257
258
259
260 static IoUringIoOps newPollAdd(int fd, byte flags, int mask, short data) {
261 return new IoUringIoOps(Native.IORING_OP_POLL_ADD, flags, (short) 0, fd, 0L, 0L, 0, mask, data,
262 (short) 0, (short) 0, 0, 0);
263 }
264
265
266
267
268
269
270
271
272
273
274 static IoUringIoOps newSendmsg(int fd, byte flags, int msgFlags, long address, short data) {
275 return new IoUringIoOps(Native.IORING_OP_SENDMSG, flags, (short) 0, fd, 0L, address, 1, msgFlags, data,
276 (short) 0, (short) 0, 0, 0);
277 }
278
279
280
281
282
283
284
285
286
287
288 static IoUringIoOps newConnect(int fd, byte flags, long remoteMemoryAddress, short data) {
289 return new IoUringIoOps(Native.IORING_OP_CONNECT, flags, (short) 0, fd, Native.SIZEOF_SOCKADDR_STORAGE,
290 remoteMemoryAddress, 0, 0, data, (short) 0, (short) 0, 0, 0);
291 }
292
293
294
295
296
297
298
299
300
301
302
303 static IoUringIoOps newPollRemove(int fd, byte flags, long userData, short data) {
304 return new IoUringIoOps(Native.IORING_OP_POLL_REMOVE, flags, (short) 0, fd, 0, userData, 0, 0, data,
305 (short) 0, (short) 0, 0, 0);
306 }
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321 static IoUringIoOps newAccept(int fd, byte flags, int acceptFlags, short ioPrio, long acceptedAddressMemoryAddress,
322 long acceptedAddressLengthMemoryAddress, short data) {
323
324 return new IoUringIoOps(Native.IORING_OP_ACCEPT, flags, ioPrio, fd, acceptedAddressLengthMemoryAddress,
325 acceptedAddressMemoryAddress, 0, acceptFlags, data, (short) 0, (short) 0, 0, 0);
326 }
327
328
329
330
331
332
333
334
335
336
337
338
339 static IoUringIoOps newWritev(int fd, byte flags, int writevFlags, long memoryAddress,
340 int length, short data) {
341 return new IoUringIoOps(Native.IORING_OP_WRITEV, flags, (short) 0, fd,
342 0, memoryAddress, length, writevFlags, data, (short) 0, (short) 0, 0, 0);
343 }
344
345
346
347
348
349
350
351
352
353
354
355
356 static IoUringIoOps newWrite(
357 int fd, byte flags, int writeFlags, long memoryAddress, int length, short data) {
358 return new IoUringIoOps(Native.IORING_OP_WRITE, flags, (short) 0, fd,
359 0, memoryAddress, length, writeFlags, data, (short) 0, (short) 0, 0, 0);
360 }
361
362
363
364
365
366
367
368
369
370
371
372
373
374 static IoUringIoOps newRecv(
375 int fd, byte flags, short ioPrio, int recvFlags, long memoryAddress, int length, short data) {
376 return new IoUringIoOps(Native.IORING_OP_RECV, flags, ioPrio, fd,
377 0, memoryAddress, length, recvFlags, data, (short) 0, (short) 0, 0, 0);
378 }
379
380
381
382
383
384
385
386
387
388
389
390 static IoUringIoOps newRecvmsg(int fd, byte flags, int msgFlags, long memoryAddress, short data) {
391 return new IoUringIoOps(
392 Native.IORING_OP_RECVMSG, flags, (short) 0, fd, 0L, memoryAddress, 1, msgFlags, data,
393 (short) 0, (short) 0, 0, 0);
394 }
395
396
397
398
399
400
401
402
403
404
405
406
407 static IoUringIoOps newSend(
408 int fd, byte flags, int sendFlags, long memoryAddress, int length, short data) {
409 return new IoUringIoOps(Native.IORING_OP_SEND, flags, (short) 0, fd,
410 0, memoryAddress, length, sendFlags, data, (short) 0, (short) 0, 0, 0);
411 }
412
413
414
415
416
417
418
419
420
421
422 static IoUringIoOps newShutdown(int fd, byte flags, int how, short data) {
423 return new IoUringIoOps(Native.IORING_OP_SHUTDOWN, flags, (short) 0, fd, 0, 0, how, 0, data,
424 (short) 0, (short) 0, 0, 0);
425 }
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440 static IoUringIoOps newSplice(int fd_in, long off_in,
441 int fd_out, long off_out,
442 int nbytes,
443 int splice_flags,
444 short data) {
445 return new IoUringIoOps(
446 Native.IORING_OP_SPLICE, (byte) 0, (short) 0, fd_out, off_out, off_in,
447 nbytes, splice_flags, data, (short) 0, (short) 0, fd_in, 0
448 );
449 }
450 }