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 static IoUringIoOps newAccept(int fd, byte flags, int acceptFlags, long acceptedAddressMemoryAddress,
320 long acceptedAddressLengthMemoryAddress, short data) {
321
322 return new IoUringIoOps(Native.IORING_OP_ACCEPT, flags, (short) 0, fd, acceptedAddressLengthMemoryAddress,
323 acceptedAddressMemoryAddress, 0, acceptFlags, data, (short) 0, (short) 0, 0, 0);
324 }
325
326
327
328
329
330
331
332
333
334
335
336
337 static IoUringIoOps newWritev(int fd, byte flags, int writevFlags, long memoryAddress,
338 int length, short data) {
339 return new IoUringIoOps(Native.IORING_OP_WRITEV, flags, (short) 0, fd,
340 0, memoryAddress, length, writevFlags, data, (short) 0, (short) 0, 0, 0);
341 }
342
343
344
345
346
347
348
349
350
351
352
353
354 static IoUringIoOps newWrite(
355 int fd, byte flags, int writeFlags, long memoryAddress, int length, short data) {
356 return new IoUringIoOps(Native.IORING_OP_WRITE, flags, (short) 0, fd,
357 0, memoryAddress, length, writeFlags, data, (short) 0, (short) 0, 0, 0);
358 }
359
360
361
362
363
364
365
366
367
368
369
370
371 static IoUringIoOps newRecv(
372 int fd, byte flags, int recvFlags, long memoryAddress, int length, short data) {
373 return new IoUringIoOps(Native.IORING_OP_RECV, flags, (short) 0, fd,
374 0, memoryAddress, length, recvFlags, data, (short) 0, (short) 0, 0, 0);
375 }
376
377
378
379
380
381
382
383
384
385
386
387 static IoUringIoOps newRecvmsg(int fd, byte flags, int msgFlags, long memoryAddress, short data) {
388 return new IoUringIoOps(
389 Native.IORING_OP_RECVMSG, flags, (short) 0, fd, 0L, memoryAddress, 1, msgFlags, data,
390 (short) 0, (short) 0, 0, 0);
391 }
392
393
394
395
396
397
398
399
400
401
402
403
404 static IoUringIoOps newSend(
405 int fd, byte flags, int sendFlags, long memoryAddress, int length, short data) {
406 return new IoUringIoOps(Native.IORING_OP_SEND, flags, (short) 0, fd,
407 memoryAddress, 0L, length, sendFlags, data, (short) 0, (short) 0, 0, 0);
408 }
409
410
411
412
413
414
415
416
417
418
419 static IoUringIoOps newShutdown(int fd, byte flags, int how, short data) {
420 return new IoUringIoOps(Native.IORING_OP_SHUTDOWN, flags, (short) 0, fd, 0, 0, how, 0, data,
421 (short) 0, (short) 0, 0, 0);
422 }
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437 static IoUringIoOps newSplice(int fd_in, long off_in,
438 int fd_out, long off_out,
439 int nbytes,
440 int splice_flags,
441 short data) {
442 return new IoUringIoOps(
443 Native.IORING_OP_SPLICE, (byte) 0, (short) 0, fd_out, off_out, off_in,
444 nbytes, splice_flags, data, (short) 0, (short) 0, fd_in, 0
445 );
446 }
447 }