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
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
use super::linux_time64::*;
use super::types::*;
use super::uapi_socket::*;
use super::uio::*;
pub type sa_family_t = kernel_sa_family_t;
#[repr(C)]
#[derive(Debug, Default, Clone)]
pub struct sockaddr_t {
pub sa_family: sa_family_t,
pub sa_data: [u8; 14],
}
#[repr(C)]
#[derive(Debug, Default, Clone)]
pub struct linger_t {
pub l_onoff: i32,
pub l_linger: i32,
}
pub type sockaddr_storage_t = kernel_sockaddr_storage_t;
#[repr(C)]
#[derive(Debug, Clone)]
pub struct msghdr_t {
pub msg_name: usize,
pub msg_namelen: i32,
pub msg_iov: *mut iovec_t,
pub msg_iovlen: size_t,
pub msg_control: usize,
pub msg_controllen: size_t,
pub msg_flags: u32,
}
pub type user_msghdr_t = msghdr_t;
#[repr(C)]
#[derive(Debug, Clone)]
pub struct mmsghdr_t {
pub msg_hdr: msghdr_t,
pub msg_len: u32,
}
#[repr(C)]
#[derive(Debug, Default, Clone)]
pub struct cmsghdr_t {
pub cmsg_len: size_t,
pub cmsg_level: i32,
pub cmsg_type: i32,
}
pub const SCM_RIGHTS: i32 = 0x01;
pub const SCM_CREDENTIALS: i32 = 0x02;
pub const SCM_SECURITY: i32 = 0x03;
#[repr(C)]
#[derive(Debug, Default, Clone)]
pub struct ucred_t {
pub pid: u32,
pub uid: u32,
pub gid: u32,
}
pub const AF_UNSPEC: i32 = 0;
pub const AF_UNIX: i32 = 1;
pub const AF_LOCAL: i32 = 1;
pub const AF_INET: i32 = 2;
pub const AF_AX25: i32 = 3;
pub const AF_IPX: i32 = 4;
pub const AF_APPLETALK: i32 = 5;
pub const AF_NETROM: i32 = 6;
pub const AF_BRIDGE: i32 = 7;
pub const AF_ATMPVC: i32 = 8;
pub const AF_X25: i32 = 9;
pub const AF_INET6: i32 = 10;
pub const AF_ROSE: i32 = 11;
pub const AF_DECNET: i32 = 12;
pub const AF_NETBEUI: i32 = 13;
pub const AF_SECURITY: i32 = 14;
pub const AF_KEY: i32 = 15;
pub const AF_NETLINK: i32 = 16;
pub const AF_ROUTE: i32 = AF_NETLINK;
pub const AF_PACKET: i32 = 17;
pub const AF_ASH: i32 = 18;
pub const AF_ECONET: i32 = 19;
pub const AF_ATMSVC: i32 = 20;
pub const AF_RDS: i32 = 21;
pub const AF_SNA: i32 = 22;
pub const AF_IRDA: i32 = 23;
pub const AF_PPPOX: i32 = 24;
pub const AF_WANPIPE: i32 = 25;
pub const AF_LLC: i32 = 26;
pub const AF_IB: i32 = 27;
pub const AF_MPLS: i32 = 28;
pub const AF_CAN: i32 = 29;
pub const AF_TIPC: i32 = 30;
pub const AF_BLUETOOTH: i32 = 31;
pub const AF_IUCV: i32 = 32;
pub const AF_RXRPC: i32 = 33;
pub const AF_ISDN: i32 = 34;
pub const AF_PHONET: i32 = 35;
pub const AF_IEEE802154: i32 = 36;
pub const AF_CAIF: i32 = 37;
pub const AF_ALG: i32 = 38;
pub const AF_NFC: i32 = 39;
pub const AF_VSOCK: i32 = 40;
pub const AF_KCM: i32 = 41;
pub const AF_QIPCRTR: i32 = 42;
pub const AF_SMC: i32 = 43;
pub const AF_XDP: i32 = 44;
pub const AF_MAX: i32 = 45;
pub const PF_UNSPEC: i32 = AF_UNSPEC;
pub const PF_UNIX: i32 = AF_UNIX;
pub const PF_LOCAL: i32 = AF_LOCAL;
pub const PF_INET: i32 = AF_INET;
pub const PF_AX25: i32 = AF_AX25;
pub const PF_IPX: i32 = AF_IPX;
pub const PF_APPLETALK: i32 = AF_APPLETALK;
pub const PF_NETROM: i32 = AF_NETROM;
pub const PF_BRIDGE: i32 = AF_BRIDGE;
pub const PF_ATMPVC: i32 = AF_ATMPVC;
pub const PF_X25: i32 = AF_X25;
pub const PF_INET6: i32 = AF_INET6;
pub const PF_ROSE: i32 = AF_ROSE;
pub const PF_DECNET: i32 = AF_DECNET;
pub const PF_NETBEUI: i32 = AF_NETBEUI;
pub const PF_SECURITY: i32 = AF_SECURITY;
pub const PF_KEY: i32 = AF_KEY;
pub const PF_NETLINK: i32 = AF_NETLINK;
pub const PF_ROUTE: i32 = AF_ROUTE;
pub const PF_PACKET: i32 = AF_PACKET;
pub const PF_ASH: i32 = AF_ASH;
pub const PF_ECONET: i32 = AF_ECONET;
pub const PF_ATMSVC: i32 = AF_ATMSVC;
pub const PF_RDS: i32 = AF_RDS;
pub const PF_SNA: i32 = AF_SNA;
pub const PF_IRDA: i32 = AF_IRDA;
pub const PF_PPPOX: i32 = AF_PPPOX;
pub const PF_WANPIPE: i32 = AF_WANPIPE;
pub const PF_LLC: i32 = AF_LLC;
pub const PF_IB: i32 = AF_IB;
pub const PF_MPLS: i32 = AF_MPLS;
pub const PF_CAN: i32 = AF_CAN;
pub const PF_TIPC: i32 = AF_TIPC;
pub const PF_BLUETOOTH: i32 = AF_BLUETOOTH;
pub const PF_IUCV: i32 = AF_IUCV;
pub const PF_RXRPC: i32 = AF_RXRPC;
pub const PF_ISDN: i32 = AF_ISDN;
pub const PF_PHONET: i32 = AF_PHONET;
pub const PF_IEEE802154: i32 = AF_IEEE802154;
pub const PF_CAIF: i32 = AF_CAIF;
pub const PF_ALG: i32 = AF_ALG;
pub const PF_NFC: i32 = AF_NFC;
pub const PF_VSOCK: i32 = AF_VSOCK;
pub const PF_KCM: i32 = AF_KCM;
pub const PF_QIPCRTR: i32 = AF_QIPCRTR;
pub const PF_SMC: i32 = AF_SMC;
pub const PF_XDP: i32 = AF_XDP;
pub const PF_MAX: i32 = AF_MAX;
pub const SOMAXCONN: i32 = 128;
pub const MSG_OOB: i32 = 1;
pub const MSG_PEEK: i32 = 2;
pub const MSG_DONTROUTE: i32 = 4;
pub const MSG_TRYHARD: i32 = 4;
pub const MSG_CTRUNC: i32 = 8;
pub const MSG_PROBE: i32 = 0x10;
pub const MSG_TRUNC: i32 = 0x20;
pub const MSG_DONTWAIT: i32 = 0x40;
pub const MSG_EOR: i32 = 0x80;
pub const MSG_WAITALL: i32 = 0x100;
pub const MSG_FIN: i32 = 0x200;
pub const MSG_SYN: i32 = 0x400;
pub const MSG_CONFIRM: i32 = 0x800;
pub const MSG_RST: i32 = 0x1000;
pub const MSG_ERRQUEUE: i32 = 0x2000;
pub const MSG_NOSIGNAL: i32 = 0x4000;
pub const MSG_MORE: i32 = 0x8000;
pub const MSG_WAITFORONE: i32 = 0x10_000;
pub const MSG_SENDPAGE_NOPOLICY: i32 = 0x10_000;
pub const MSG_SENDPAGE_NOTLAST: i32 = 0x20_000;
pub const MSG_BATCH: i32 = 0x40_000;
pub const MSG_EOF: i32 = MSG_FIN;
pub const MSG_NO_SHARED_FRAGS: i32 = 0x80_000;
pub const MSG_SENDPAGE_DECRYPTED: i32 = 0x100_000;
pub const MSG_ZEROCOPY: i32 = 0x400_0000;
pub const MSG_FASTOPEN: i32 = 0x2000_0000;
pub const MSG_CMSG_CLOEXEC: i32 = 0x4000_0000;
pub const MSG_CMSG_COMPAT: i32 = 0;
pub const SOL_IP: i32 = 0;
pub const SOL_TCP: i32 = 6;
pub const SOL_UDP: i32 = 17;
pub const SOL_IPV6: i32 = 41;
pub const SOL_ICMPV6: i32 = 58;
pub const SOL_SCTP: i32 = 132;
pub const SOL_UDPLITE: i32 = 136;
pub const SOL_RAW: i32 = 255;
pub const SOL_IPX: i32 = 256;
pub const SOL_AX25: i32 = 257;
pub const SOL_ATALK: i32 = 258;
pub const SOL_NETROM: i32 = 259;
pub const SOL_ROSE: i32 = 260;
pub const SOL_DECNET: i32 = 261;
pub const SOL_X25: i32 = 262;
pub const SOL_PACKET: i32 = 263;
pub const SOL_ATM: i32 = 264;
pub const SOL_AAL: i32 = 265;
pub const SOL_IRDA: i32 = 266;
pub const SOL_NETBEUI: i32 = 267;
pub const SOL_LLC: i32 = 268;
pub const SOL_DCCP: i32 = 269;
pub const SOL_NETLINK: i32 = 270;
pub const SOL_TIPC: i32 = 271;
pub const SOL_RXRPC: i32 = 272;
pub const SOL_PPPOL2TP: i32 = 273;
pub const SOL_BLUETOOTH: i32 = 274;
pub const SOL_PNPIPE: i32 = 275;
pub const SOL_RDS: i32 = 276;
pub const SOL_IUCV: i32 = 277;
pub const SOL_CAIF: i32 = 278;
pub const SOL_ALG: i32 = 279;
pub const SOL_NFC: i32 = 280;
pub const SOL_KCM: i32 = 281;
pub const SOL_TLS: i32 = 282;
pub const SOL_XDP: i32 = 283;
pub const IPX_TYPE: i32 = 1;
#[repr(C)]
#[derive(Debug, Default, Clone)]
pub struct scm_timestamping_internal_t {
pub ts: [timespec64_t; 3],
}