1use crate::prelude::*;
3use crate::{
4 sock_filter,
5 _IO,
6 _IOR,
7 _IOW,
8 _IOWR,
9};
10
11pub type dev_t = u64;
12pub type socklen_t = u32;
13pub type mode_t = u32;
14pub type ino64_t = u64;
15pub type off64_t = i64;
16pub type blkcnt64_t = i64;
17pub type rlim64_t = u64;
18pub type mqd_t = c_int;
19pub type nfds_t = c_ulong;
20pub type nl_item = c_int;
21pub type idtype_t = c_uint;
22pub type loff_t = c_longlong;
23pub type pthread_key_t = c_uint;
24pub type pthread_once_t = c_int;
25pub type pthread_spinlock_t = c_int;
26pub type __kernel_fsid_t = __c_anonymous__kernel_fsid_t;
27pub type __kernel_clockid_t = c_int;
28
29pub type __u8 = c_uchar;
30pub type __u16 = c_ushort;
31pub type __s16 = c_short;
32pub type __u32 = c_uint;
33pub type __s32 = c_int;
34
35pub type sctp_assoc_t = __s32;
37
38pub type eventfd_t = u64;
39
40#[automatically_derived]
impl ::core::clone::Clone for tpacket_versions {
#[inline]
fn clone(&self) -> tpacket_versions { *self }
}
#[automatically_derived]
impl ::core::marker::Copy for tpacket_versions { }
#[automatically_derived]
impl ::core::fmt::Debug for tpacket_versions {
#[inline]
fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result {
::core::fmt::Formatter::write_str(f,
match self {
tpacket_versions::TPACKET_V1 => "TPACKET_V1",
tpacket_versions::TPACKET_V2 => "TPACKET_V2",
tpacket_versions::TPACKET_V3 => "TPACKET_V3",
})
}
}e! {
41 #[repr(u32)]
42 pub enum tpacket_versions {
43 TPACKET_V1,
44 TPACKET_V2,
45 TPACKET_V3,
46 }
47}
48
49pub type pid_type = crate::prelude::CEnumRepr;
pub const PIDTYPE_PID: pid_type =
{
#[allow(unused_variables)]
let r = 0;
r
};
pub const PIDTYPE_TGID: pid_type =
{
#[allow(unused_variables)]
let r = PIDTYPE_PID + 1;
r
};
pub const PIDTYPE_PGID: pid_type =
{
#[allow(unused_variables)]
let r = PIDTYPE_TGID + 1;
r
};
pub const PIDTYPE_SID: pid_type =
{
#[allow(unused_variables)]
let r = PIDTYPE_PGID + 1;
r
};
pub const PIDTYPE_MAX: pid_type =
{
#[allow(unused_variables)]
let r = PIDTYPE_SID + 1;
r
};c_enum! {
50 pub enum pid_type {
51 pub PIDTYPE_PID,
52 pub PIDTYPE_TGID,
53 pub PIDTYPE_PGID,
54 pub PIDTYPE_SID,
55 pub PIDTYPE_MAX,
56 }
57}
58
59#[automatically_derived]
#[allow(deprecated)]
impl ::core::clone::Clone for sched_attr {
#[inline]
fn clone(&self) -> sched_attr {
let _: ::core::clone::AssertParamIsClone<__u32>;
let _: ::core::clone::AssertParamIsClone<crate::__u64>;
let _: ::core::clone::AssertParamIsClone<__s32>;
let _: ::core::clone::AssertParamIsClone<crate::__u64>;
let _: ::core::clone::AssertParamIsClone<crate::__u64>;
let _: ::core::clone::AssertParamIsClone<crate::__u64>;
*self
}
}
#[automatically_derived]
#[allow(deprecated)]
impl ::core::marker::Copy for sched_attr { }
#[automatically_derived]
#[allow(deprecated)]
impl ::core::fmt::Debug for sched_attr {
#[inline]
fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result {
let names: &'static _ =
&["size", "sched_policy", "sched_flags", "sched_nice",
"sched_priority", "sched_runtime", "sched_deadline",
"sched_period"];
let values: &[&dyn ::core::fmt::Debug] =
&[&self.size, &self.sched_policy, &self.sched_flags,
&self.sched_nice, &self.sched_priority, &self.sched_runtime,
&self.sched_deadline, &&self.sched_period];
::core::fmt::Formatter::debug_struct_fields_finish(f, "sched_attr",
names, values)
}
}s! {
60 pub struct dqblk {
61 pub dqb_bhardlimit: u64,
62 pub dqb_bsoftlimit: u64,
63 pub dqb_curspace: u64,
64 pub dqb_ihardlimit: u64,
65 pub dqb_isoftlimit: u64,
66 pub dqb_curinodes: u64,
67 pub dqb_btime: u64,
68 pub dqb_itime: u64,
69 pub dqb_valid: u32,
70 }
71
72 pub struct signalfd_siginfo {
73 pub ssi_signo: u32,
74 pub ssi_errno: i32,
75 pub ssi_code: i32,
76 pub ssi_pid: u32,
77 pub ssi_uid: u32,
78 pub ssi_fd: i32,
79 pub ssi_tid: u32,
80 pub ssi_band: u32,
81 pub ssi_overrun: u32,
82 pub ssi_trapno: u32,
83 pub ssi_status: i32,
84 pub ssi_int: i32,
85 pub ssi_ptr: u64,
86 pub ssi_utime: u64,
87 pub ssi_stime: u64,
88 pub ssi_addr: u64,
89 pub ssi_addr_lsb: u16,
90 _pad2: Padding<u16>,
91 pub ssi_syscall: i32,
92 pub ssi_call_addr: u64,
93 pub ssi_arch: u32,
94 _pad: Padding<[u8; 28]>,
95 }
96
97 pub struct fanout_args {
98 #[cfg(target_endian = "little")]
99 pub id: __u16,
100 pub type_flags: __u16,
101 #[cfg(target_endian = "big")]
102 pub id: __u16,
103 pub max_num_members: __u32,
104 }
105
106 #[deprecated(since = "0.2.70", note = "sockaddr_ll type must be used instead")]
107 pub struct sockaddr_pkt {
108 pub spkt_family: c_ushort,
109 pub spkt_device: [c_uchar; 14],
110 pub spkt_protocol: c_ushort,
111 }
112
113 pub struct tpacket_auxdata {
114 pub tp_status: __u32,
115 pub tp_len: __u32,
116 pub tp_snaplen: __u32,
117 pub tp_mac: __u16,
118 pub tp_net: __u16,
119 pub tp_vlan_tci: __u16,
120 pub tp_vlan_tpid: __u16,
121 }
122
123 pub struct tpacket_hdr {
124 pub tp_status: c_ulong,
125 pub tp_len: c_uint,
126 pub tp_snaplen: c_uint,
127 pub tp_mac: c_ushort,
128 pub tp_net: c_ushort,
129 pub tp_sec: c_uint,
130 pub tp_usec: c_uint,
131 }
132
133 pub struct tpacket_hdr_variant1 {
134 pub tp_rxhash: __u32,
135 pub tp_vlan_tci: __u32,
136 pub tp_vlan_tpid: __u16,
137 pub tp_padding: __u16,
138 }
139
140 pub struct tpacket2_hdr {
141 pub tp_status: __u32,
142 pub tp_len: __u32,
143 pub tp_snaplen: __u32,
144 pub tp_mac: __u16,
145 pub tp_net: __u16,
146 pub tp_sec: __u32,
147 pub tp_nsec: __u32,
148 pub tp_vlan_tci: __u16,
149 pub tp_vlan_tpid: __u16,
150 pub tp_padding: [__u8; 4],
151 }
152
153 pub struct tpacket_req {
154 pub tp_block_size: c_uint,
155 pub tp_block_nr: c_uint,
156 pub tp_frame_size: c_uint,
157 pub tp_frame_nr: c_uint,
158 }
159
160 pub struct tpacket_req3 {
161 pub tp_block_size: c_uint,
162 pub tp_block_nr: c_uint,
163 pub tp_frame_size: c_uint,
164 pub tp_frame_nr: c_uint,
165 pub tp_retire_blk_tov: c_uint,
166 pub tp_sizeof_priv: c_uint,
167 pub tp_feature_req_word: c_uint,
168 }
169
170 #[repr(align(8))]
171 pub struct tpacket_rollover_stats {
172 pub tp_all: crate::__u64,
173 pub tp_huge: crate::__u64,
174 pub tp_failed: crate::__u64,
175 }
176
177 pub struct tpacket_stats {
178 pub tp_packets: c_uint,
179 pub tp_drops: c_uint,
180 }
181
182 pub struct tpacket_stats_v3 {
183 pub tp_packets: c_uint,
184 pub tp_drops: c_uint,
185 pub tp_freeze_q_cnt: c_uint,
186 }
187
188 pub struct tpacket3_hdr {
189 pub tp_next_offset: __u32,
190 pub tp_sec: __u32,
191 pub tp_nsec: __u32,
192 pub tp_snaplen: __u32,
193 pub tp_len: __u32,
194 pub tp_status: __u32,
195 pub tp_mac: __u16,
196 pub tp_net: __u16,
197 pub hv1: crate::tpacket_hdr_variant1,
198 pub tp_padding: [__u8; 8],
199 }
200
201 pub struct tpacket_bd_ts {
202 pub ts_sec: c_uint,
203 pub ts_usec: c_uint,
204 }
205
206 #[repr(align(8))]
207 pub struct tpacket_hdr_v1 {
208 pub block_status: __u32,
209 pub num_pkts: __u32,
210 pub offset_to_first_pkt: __u32,
211 pub blk_len: __u32,
212 pub seq_num: crate::__u64,
213 pub ts_first_pkt: crate::tpacket_bd_ts,
214 pub ts_last_pkt: crate::tpacket_bd_ts,
215 }
216
217 pub struct msginfo {
219 pub msgpool: c_int,
220 pub msgmap: c_int,
221 pub msgmax: c_int,
222 pub msgmnb: c_int,
223 pub msgmni: c_int,
224 pub msgssz: c_int,
225 pub msgtql: c_int,
226 pub msgseg: c_ushort,
227 }
228
229 pub struct input_event {
230 #[cfg(any(target_pointer_width = "64", not(linux_time_bits64)))]
232 pub time: crate::timeval,
233 #[cfg(all(target_pointer_width = "32", linux_time_bits64))]
240 pub input_event_sec: c_ulong,
241
242 #[cfg(all(target_pointer_width = "32", linux_time_bits64))]
243 pub input_event_usec: c_ulong,
244
245 pub type_: __u16,
246 pub code: __u16,
247 pub value: __s32,
248 }
249
250 pub struct input_id {
251 pub bustype: __u16,
252 pub vendor: __u16,
253 pub product: __u16,
254 pub version: __u16,
255 }
256
257 pub struct input_absinfo {
258 pub value: __s32,
259 pub minimum: __s32,
260 pub maximum: __s32,
261 pub fuzz: __s32,
262 pub flat: __s32,
263 pub resolution: __s32,
264 }
265
266 pub struct input_keymap_entry {
267 pub flags: __u8,
268 pub len: __u8,
269 pub index: __u16,
270 pub keycode: __u32,
271 pub scancode: [__u8; 32],
272 }
273
274 pub struct input_mask {
275 pub type_: __u32,
276 pub codes_size: __u32,
277 pub codes_ptr: crate::__u64,
278 }
279
280 pub struct ff_replay {
281 pub length: __u16,
282 pub delay: __u16,
283 }
284
285 pub struct ff_trigger {
286 pub button: __u16,
287 pub interval: __u16,
288 }
289
290 pub struct ff_envelope {
291 pub attack_length: __u16,
292 pub attack_level: __u16,
293 pub fade_length: __u16,
294 pub fade_level: __u16,
295 }
296
297 pub struct ff_constant_effect {
298 pub level: __s16,
299 pub envelope: ff_envelope,
300 }
301
302 pub struct ff_ramp_effect {
303 pub start_level: __s16,
304 pub end_level: __s16,
305 pub envelope: ff_envelope,
306 }
307
308 pub struct ff_condition_effect {
309 pub right_saturation: __u16,
310 pub left_saturation: __u16,
311
312 pub right_coeff: __s16,
313 pub left_coeff: __s16,
314
315 pub deadband: __u16,
316 pub center: __s16,
317 }
318
319 pub struct ff_periodic_effect {
320 pub waveform: __u16,
321 pub period: __u16,
322 pub magnitude: __s16,
323 pub offset: __s16,
324 pub phase: __u16,
325
326 pub envelope: ff_envelope,
327
328 pub custom_len: __u32,
329 pub custom_data: *mut __s16,
330 }
331
332 pub struct ff_rumble_effect {
333 pub strong_magnitude: __u16,
334 pub weak_magnitude: __u16,
335 }
336
337 pub struct ff_effect {
338 pub type_: __u16,
339 pub id: __s16,
340 pub direction: __u16,
341 pub trigger: ff_trigger,
342 pub replay: ff_replay,
343 #[cfg(target_pointer_width = "64")]
345 pub u: [u64; 4],
346 #[cfg(target_pointer_width = "32")]
347 pub u: [u32; 7],
348 }
349
350 pub struct uinput_ff_upload {
351 pub request_id: __u32,
352 pub retval: __s32,
353 pub effect: ff_effect,
354 pub old: ff_effect,
355 }
356
357 pub struct uinput_ff_erase {
358 pub request_id: __u32,
359 pub retval: __s32,
360 pub effect_id: __u32,
361 }
362
363 pub struct uinput_abs_setup {
364 pub code: __u16,
365 pub absinfo: input_absinfo,
366 }
367
368 pub struct __c_anonymous__kernel_fsid_t {
369 pub val: [c_int; 2],
370 }
371
372 pub struct posix_spawn_file_actions_t {
373 __allocated: c_int,
374 __used: c_int,
375 __actions: *mut c_int,
376 __pad: Padding<[c_int; 16]>,
377 }
378
379 pub struct posix_spawnattr_t {
380 __flags: c_short,
381 __pgrp: crate::pid_t,
382 __sd: crate::sigset_t,
383 __ss: crate::sigset_t,
384 #[cfg(any(target_env = "musl", target_env = "ohos"))]
385 __prio: c_int,
386 #[cfg(not(any(target_env = "musl", target_env = "ohos")))]
387 __sp: crate::sched_param,
388 __policy: c_int,
389 __pad: Padding<[c_int; 16]>,
390 }
391
392 pub struct genlmsghdr {
393 pub cmd: u8,
394 pub version: u8,
395 pub reserved: u16,
396 }
397
398 pub struct inotify_event {
399 pub wd: c_int,
400 pub mask: u32,
401 pub cookie: u32,
402 pub len: u32,
403 }
404
405 pub struct fanotify_response {
406 pub fd: c_int,
407 pub response: __u32,
408 }
409
410 pub struct fanotify_event_info_header {
411 pub info_type: __u8,
412 pub pad: __u8,
413 pub len: __u16,
414 }
415
416 pub struct fanotify_event_info_fid {
417 pub hdr: fanotify_event_info_header,
418 pub fsid: __kernel_fsid_t,
419 pub handle: [c_uchar; 0],
420 }
421
422 pub struct sockaddr_vm {
423 pub svm_family: crate::sa_family_t,
424 pub svm_reserved1: c_ushort,
425 pub svm_port: c_uint,
426 pub svm_cid: c_uint,
427 pub svm_zero: [u8; 4],
428 }
429
430 pub struct sock_extended_err {
431 pub ee_errno: u32,
432 pub ee_origin: u8,
433 pub ee_type: u8,
434 pub ee_code: u8,
435 pub ee_pad: u8,
436 pub ee_info: u32,
437 pub ee_data: u32,
438 }
439
440 pub struct seccomp_data {
442 pub nr: c_int,
443 pub arch: __u32,
444 pub instruction_pointer: crate::__u64,
445 pub args: [crate::__u64; 6],
446 }
447
448 pub struct seccomp_notif_sizes {
449 pub seccomp_notif: __u16,
450 pub seccomp_notif_resp: __u16,
451 pub seccomp_data: __u16,
452 }
453
454 pub struct seccomp_notif {
455 pub id: crate::__u64,
456 pub pid: __u32,
457 pub flags: __u32,
458 pub data: seccomp_data,
459 }
460
461 pub struct seccomp_notif_resp {
462 pub id: crate::__u64,
463 pub val: crate::__s64,
464 pub error: __s32,
465 pub flags: __u32,
466 }
467
468 pub struct seccomp_notif_addfd {
469 pub id: crate::__u64,
470 pub flags: __u32,
471 pub srcfd: __u32,
472 pub newfd: __u32,
473 pub newfd_flags: __u32,
474 }
475
476 pub struct in6_ifreq {
477 pub ifr6_addr: crate::in6_addr,
478 pub ifr6_prefixlen: u32,
479 pub ifr6_ifindex: c_int,
480 }
481
482 #[non_exhaustive]
484 pub struct open_how {
485 pub flags: crate::__u64,
486 pub mode: crate::__u64,
487 pub resolve: crate::__u64,
488 }
489
490 pub struct ptp_clock_time {
492 pub sec: crate::__s64,
493 pub nsec: __u32,
494 pub reserved: __u32,
495 }
496
497 pub struct ptp_extts_request {
498 pub index: c_uint,
499 pub flags: c_uint,
500 pub rsv: [c_uint; 2],
501 }
502
503 pub struct ptp_sys_offset_extended {
504 pub n_samples: c_uint,
505 pub clockid: __kernel_clockid_t,
506 pub rsv: [c_uint; 2],
507 pub ts: [[ptp_clock_time; 3]; PTP_MAX_SAMPLES as usize],
508 }
509
510 pub struct ptp_sys_offset_precise {
511 pub device: ptp_clock_time,
512 pub sys_realtime: ptp_clock_time,
513 pub sys_monoraw: ptp_clock_time,
514 pub rsv: [c_uint; 4],
515 }
516
517 pub struct ptp_extts_event {
518 pub t: ptp_clock_time,
519 index: c_uint,
520 flags: c_uint,
521 rsv: [c_uint; 2],
522 }
523
524 pub struct sctp_initmsg {
527 pub sinit_num_ostreams: __u16,
528 pub sinit_max_instreams: __u16,
529 pub sinit_max_attempts: __u16,
530 pub sinit_max_init_timeo: __u16,
531 }
532
533 pub struct sctp_sndrcvinfo {
534 pub sinfo_stream: __u16,
535 pub sinfo_ssn: __u16,
536 pub sinfo_flags: __u16,
537 pub sinfo_ppid: __u32,
538 pub sinfo_context: __u32,
539 pub sinfo_timetolive: __u32,
540 pub sinfo_tsn: __u32,
541 pub sinfo_cumtsn: __u32,
542 pub sinfo_assoc_id: crate::sctp_assoc_t,
543 }
544
545 pub struct sctp_sndinfo {
546 pub snd_sid: __u16,
547 pub snd_flags: __u16,
548 pub snd_ppid: __u32,
549 pub snd_context: __u32,
550 pub snd_assoc_id: crate::sctp_assoc_t,
551 }
552
553 pub struct sctp_rcvinfo {
554 pub rcv_sid: __u16,
555 pub rcv_ssn: __u16,
556 pub rcv_flags: __u16,
557 pub rcv_ppid: __u32,
558 pub rcv_tsn: __u32,
559 pub rcv_cumtsn: __u32,
560 pub rcv_context: __u32,
561 pub rcv_assoc_id: crate::sctp_assoc_t,
562 }
563
564 pub struct sctp_nxtinfo {
565 pub nxt_sid: __u16,
566 pub nxt_flags: __u16,
567 pub nxt_ppid: __u32,
568 pub nxt_length: __u32,
569 pub nxt_assoc_id: crate::sctp_assoc_t,
570 }
571
572 pub struct sctp_prinfo {
573 pub pr_policy: __u16,
574 pub pr_value: __u32,
575 }
576
577 pub struct sctp_authinfo {
578 pub auth_keynumber: __u16,
579 }
580
581 pub struct tls_crypto_info {
584 pub version: __u16,
585 pub cipher_type: __u16,
586 }
587
588 pub struct tls12_crypto_info_aes_gcm_128 {
589 pub info: tls_crypto_info,
590 pub iv: [c_uchar; TLS_CIPHER_AES_GCM_128_IV_SIZE],
591 pub key: [c_uchar; TLS_CIPHER_AES_GCM_128_KEY_SIZE],
592 pub salt: [c_uchar; TLS_CIPHER_AES_GCM_128_SALT_SIZE],
593 pub rec_seq: [c_uchar; TLS_CIPHER_AES_GCM_128_REC_SEQ_SIZE],
594 }
595
596 pub struct tls12_crypto_info_aes_gcm_256 {
597 pub info: tls_crypto_info,
598 pub iv: [c_uchar; TLS_CIPHER_AES_GCM_256_IV_SIZE],
599 pub key: [c_uchar; TLS_CIPHER_AES_GCM_256_KEY_SIZE],
600 pub salt: [c_uchar; TLS_CIPHER_AES_GCM_256_SALT_SIZE],
601 pub rec_seq: [c_uchar; TLS_CIPHER_AES_GCM_256_REC_SEQ_SIZE],
602 }
603
604 pub struct tls12_crypto_info_aes_ccm_128 {
605 pub info: tls_crypto_info,
606 pub iv: [c_uchar; TLS_CIPHER_AES_CCM_128_IV_SIZE],
607 pub key: [c_uchar; TLS_CIPHER_AES_CCM_128_KEY_SIZE],
608 pub salt: [c_uchar; TLS_CIPHER_AES_CCM_128_SALT_SIZE],
609 pub rec_seq: [c_uchar; TLS_CIPHER_AES_CCM_128_REC_SEQ_SIZE],
610 }
611
612 pub struct tls12_crypto_info_chacha20_poly1305 {
613 pub info: tls_crypto_info,
614 pub iv: [c_uchar; TLS_CIPHER_CHACHA20_POLY1305_IV_SIZE],
615 pub key: [c_uchar; TLS_CIPHER_CHACHA20_POLY1305_KEY_SIZE],
616 pub salt: [c_uchar; TLS_CIPHER_CHACHA20_POLY1305_SALT_SIZE],
617 pub rec_seq: [c_uchar; TLS_CIPHER_CHACHA20_POLY1305_REC_SEQ_SIZE],
618 }
619
620 pub struct tls12_crypto_info_sm4_gcm {
621 pub info: tls_crypto_info,
622 pub iv: [c_uchar; TLS_CIPHER_SM4_GCM_IV_SIZE],
623 pub key: [c_uchar; TLS_CIPHER_SM4_GCM_KEY_SIZE],
624 pub salt: [c_uchar; TLS_CIPHER_SM4_GCM_SALT_SIZE],
625 pub rec_seq: [c_uchar; TLS_CIPHER_SM4_GCM_REC_SEQ_SIZE],
626 }
627
628 pub struct tls12_crypto_info_sm4_ccm {
629 pub info: tls_crypto_info,
630 pub iv: [c_uchar; TLS_CIPHER_SM4_CCM_IV_SIZE],
631 pub key: [c_uchar; TLS_CIPHER_SM4_CCM_KEY_SIZE],
632 pub salt: [c_uchar; TLS_CIPHER_SM4_CCM_SALT_SIZE],
633 pub rec_seq: [c_uchar; TLS_CIPHER_SM4_CCM_REC_SEQ_SIZE],
634 }
635
636 pub struct tls12_crypto_info_aria_gcm_128 {
637 pub info: tls_crypto_info,
638 pub iv: [c_uchar; TLS_CIPHER_ARIA_GCM_128_IV_SIZE],
639 pub key: [c_uchar; TLS_CIPHER_ARIA_GCM_128_KEY_SIZE],
640 pub salt: [c_uchar; TLS_CIPHER_ARIA_GCM_128_SALT_SIZE],
641 pub rec_seq: [c_uchar; TLS_CIPHER_ARIA_GCM_128_REC_SEQ_SIZE],
642 }
643
644 pub struct tls12_crypto_info_aria_gcm_256 {
645 pub info: tls_crypto_info,
646 pub iv: [c_uchar; TLS_CIPHER_ARIA_GCM_256_IV_SIZE],
647 pub key: [c_uchar; TLS_CIPHER_ARIA_GCM_256_KEY_SIZE],
648 pub salt: [c_uchar; TLS_CIPHER_ARIA_GCM_256_SALT_SIZE],
649 pub rec_seq: [c_uchar; TLS_CIPHER_ARIA_GCM_256_REC_SEQ_SIZE],
650 }
651
652 pub struct iw_param {
655 pub value: __s32,
656 pub fixed: __u8,
657 pub disabled: __u8,
658 pub flags: __u16,
659 }
660
661 pub struct iw_point {
662 pub pointer: *mut c_void,
663 pub length: __u16,
664 pub flags: __u16,
665 }
666
667 pub struct iw_freq {
668 pub m: __s32,
669 pub e: __s16,
670 pub i: __u8,
671 pub flags: __u8,
672 }
673
674 pub struct iw_quality {
675 pub qual: __u8,
676 pub level: __u8,
677 pub noise: __u8,
678 pub updated: __u8,
679 }
680
681 pub struct iw_discarded {
682 pub nwid: __u32,
683 pub code: __u32,
684 pub fragment: __u32,
685 pub retries: __u32,
686 pubmisc: __u32,
687 }
688
689 pub struct iw_missed {
690 pub beacon: __u32,
691 }
692
693 pub struct iw_scan_req {
694 pub scan_type: __u8,
695 pub essid_len: __u8,
696 pub num_channels: __u8,
697 pub flags: __u8,
698 pub bssid: crate::sockaddr,
699 pub essid: [__u8; IW_ESSID_MAX_SIZE],
700 pub min_channel_time: __u32,
701 pub max_channel_time: __u32,
702 pub channel_list: [iw_freq; IW_MAX_FREQUENCIES],
703 }
704
705 pub struct iw_encode_ext {
706 pub ext_flags: __u32,
707 pub tx_seq: [__u8; IW_ENCODE_SEQ_MAX_SIZE],
708 pub rx_seq: [__u8; IW_ENCODE_SEQ_MAX_SIZE],
709 pub addr: crate::sockaddr,
710 pub alg: __u16,
711 pub key_len: __u16,
712 pub key: [__u8; 0],
713 }
714
715 pub struct iw_pmksa {
716 pub cmd: __u32,
717 pub bssid: crate::sockaddr,
718 pub pmkid: [__u8; IW_PMKID_LEN],
719 }
720
721 pub struct iw_pmkid_cand {
722 pub flags: __u32,
723 pub index: __u32,
724 pub bssid: crate::sockaddr,
725 }
726
727 pub struct iw_statistics {
728 pub status: __u16,
729 pub qual: iw_quality,
730 pub discard: iw_discarded,
731 pub miss: iw_missed,
732 }
733
734 pub struct iw_range {
735 pub throughput: __u32,
736 pub min_nwid: __u32,
737 pub max_nwid: __u32,
738 pub old_num_channels: __u16,
739 pub old_num_frequency: __u8,
740 pub scan_capa: __u8,
741 pub event_capa: [__u32; 6],
742 pub sensitivity: __s32,
743 pub max_qual: iw_quality,
744 pub avg_qual: iw_quality,
745 pub num_bitrates: __u8,
746 pub bitrate: [__s32; IW_MAX_BITRATES],
747 pub min_rts: __s32,
748 pub max_rts: __s32,
749 pub min_frag: __s32,
750 pub max_frag: __s32,
751 pub min_pmp: __s32,
752 pub max_pmp: __s32,
753 pub min_pmt: __s32,
754 pub max_pmt: __s32,
755 pub pmp_flags: __u16,
756 pub pmt_flags: __u16,
757 pub pm_capa: __u16,
758 pub encoding_size: [__u16; IW_MAX_ENCODING_SIZES],
759 pub num_encoding_sizes: __u8,
760 pub max_encoding_tokens: __u8,
761 pub encoding_login_index: __u8,
762 pub txpower_capa: __u16,
763 pub num_txpower: __u8,
764 pub txpower: [__s32; IW_MAX_TXPOWER],
765 pub we_version_compiled: __u8,
766 pub we_version_source: __u8,
767 pub retry_capa: __u16,
768 pub retry_flags: __u16,
769 pub r_time_flags: __u16,
770 pub min_retry: __s32,
771 pub max_retry: __s32,
772 pub min_r_time: __s32,
773 pub max_r_time: __s32,
774 pub num_channels: __u16,
775 pub num_frequency: __u8,
776 pub freq: [iw_freq; IW_MAX_FREQUENCIES],
777 pub enc_capa: __u32,
778 }
779
780 pub struct iw_priv_args {
781 pub cmd: __u32,
782 pub set_args: __u16,
783 pub get_args: __u16,
784 pub name: [c_char; crate::IFNAMSIZ],
785 }
786
787 pub struct epoll_params {
790 pub busy_poll_usecs: u32,
791 pub busy_poll_budget: u16,
792 pub prefer_busy_poll: u8,
793 pub __pad: u8, }
795
796 #[cfg_attr(
797 any(
798 target_pointer_width = "32",
799 target_arch = "x86_64",
800 target_arch = "powerpc64",
801 target_arch = "mips64",
802 target_arch = "mips64r6",
803 target_arch = "s390x",
804 target_arch = "sparc64",
805 target_arch = "aarch64",
806 target_arch = "riscv64",
807 target_arch = "riscv32",
808 target_arch = "loongarch64"
809 ),
810 repr(align(4))
811 )]
812 #[cfg_attr(
813 not(any(
814 target_pointer_width = "32",
815 target_arch = "x86_64",
816 target_arch = "powerpc64",
817 target_arch = "mips64",
818 target_arch = "mips64r6",
819 target_arch = "s390x",
820 target_arch = "sparc64",
821 target_arch = "aarch64",
822 target_arch = "riscv64",
823 target_arch = "riscv32",
824 target_arch = "loongarch64"
825 )),
826 repr(align(8))
827 )]
828 pub struct pthread_mutexattr_t {
829 #[doc(hidden)]
830 size: [u8; crate::__SIZEOF_PTHREAD_MUTEXATTR_T],
831 }
832
833 #[cfg_attr(
834 any(
835 target_env = "musl",
836 target_env = "ohos",
837 target_env = "uclibc",
838 target_pointer_width = "32"
839 ),
840 repr(align(4))
841 )]
842 #[cfg_attr(
843 all(
844 not(target_env = "musl"),
845 not(target_env = "ohos"),
846 not(target_env = "uclibc"),
847 target_pointer_width = "64"
848 ),
849 repr(align(8))
850 )]
851 pub struct pthread_rwlockattr_t {
852 #[doc(hidden)]
853 size: [u8; crate::__SIZEOF_PTHREAD_RWLOCKATTR_T],
854 }
855
856 #[repr(align(4))]
857 pub struct pthread_condattr_t {
858 #[doc(hidden)]
859 size: [u8; crate::__SIZEOF_PTHREAD_CONDATTR_T],
860 }
861
862 #[repr(align(4))]
863 pub struct pthread_barrierattr_t {
864 #[doc(hidden)]
865 size: [u8; crate::__SIZEOF_PTHREAD_BARRIERATTR_T],
866 }
867
868 #[cfg(not(any(target_env = "musl", target_env = "ohos")))]
869 #[repr(align(8))]
870 pub struct fanotify_event_metadata {
871 pub event_len: __u32,
872 pub vers: __u8,
873 pub reserved: __u8,
874 pub metadata_len: __u16,
875 pub mask: __u64,
876 pub fd: c_int,
877 pub pid: c_int,
878 }
879
880 pub struct ptp_sys_offset {
883 pub n_samples: c_uint,
884 pub rsv: [c_uint; 3],
885 pub ts: [ptp_clock_time; 51],
887 }
888
889 pub struct ptp_pin_desc {
890 pub name: [c_char; 64],
891 pub index: c_uint,
892 pub func: c_uint,
893 pub chan: c_uint,
894 pub rsv: [c_uint; 5],
895 }
896
897 pub struct ptp_clock_caps {
898 pub max_adj: c_int,
899 pub n_alarm: c_int,
900 pub n_ext_ts: c_int,
901 pub n_per_out: c_int,
902 pub pps: c_int,
903 pub n_pins: c_int,
904 pub cross_timestamping: c_int,
905 pub adjust_phase: c_int,
906 pub max_phase_adj: c_int,
907 pub rsv: [c_int; 11],
908 }
909
910 pub struct sockaddr_xdp {
913 pub sxdp_family: crate::__u16,
914 pub sxdp_flags: crate::__u16,
915 pub sxdp_ifindex: crate::__u32,
916 pub sxdp_queue_id: crate::__u32,
917 pub sxdp_shared_umem_fd: crate::__u32,
918 }
919
920 pub struct xdp_ring_offset {
921 pub producer: crate::__u64,
922 pub consumer: crate::__u64,
923 pub desc: crate::__u64,
924 pub flags: crate::__u64,
925 }
926
927 pub struct xdp_mmap_offsets {
928 pub rx: xdp_ring_offset,
929 pub tx: xdp_ring_offset,
930 pub fr: xdp_ring_offset,
931 pub cr: xdp_ring_offset,
932 }
933
934 pub struct xdp_ring_offset_v1 {
935 pub producer: crate::__u64,
936 pub consumer: crate::__u64,
937 pub desc: crate::__u64,
938 }
939
940 pub struct xdp_mmap_offsets_v1 {
941 pub rx: xdp_ring_offset_v1,
942 pub tx: xdp_ring_offset_v1,
943 pub fr: xdp_ring_offset_v1,
944 pub cr: xdp_ring_offset_v1,
945 }
946
947 pub struct xdp_umem_reg {
948 pub addr: crate::__u64,
949 pub len: crate::__u64,
950 pub chunk_size: crate::__u32,
951 pub headroom: crate::__u32,
952 pub flags: crate::__u32,
953 pub tx_metadata_len: crate::__u32,
954 }
955
956 pub struct xdp_umem_reg_v1 {
957 pub addr: crate::__u64,
958 pub len: crate::__u64,
959 pub chunk_size: crate::__u32,
960 pub headroom: crate::__u32,
961 }
962
963 pub struct xdp_statistics {
964 pub rx_dropped: crate::__u64,
965 pub rx_invalid_descs: crate::__u64,
966 pub tx_invalid_descs: crate::__u64,
967 pub rx_ring_full: crate::__u64,
968 pub rx_fill_ring_empty_descs: crate::__u64,
969 pub tx_ring_empty_descs: crate::__u64,
970 }
971
972 pub struct xdp_statistics_v1 {
973 pub rx_dropped: crate::__u64,
974 pub rx_invalid_descs: crate::__u64,
975 pub tx_invalid_descs: crate::__u64,
976 }
977
978 pub struct xdp_options {
979 pub flags: crate::__u32,
980 }
981
982 pub struct xdp_desc {
983 pub addr: crate::__u64,
984 pub len: crate::__u32,
985 pub options: crate::__u32,
986 }
987
988 pub struct xsk_tx_metadata_completion {
989 pub tx_timestamp: crate::__u64,
990 }
991
992 pub struct xsk_tx_metadata_request {
993 pub csum_start: __u16,
994 pub csum_offset: __u16,
995 }
996
997 pub struct mount_attr {
1000 pub attr_set: crate::__u64,
1001 pub attr_clr: crate::__u64,
1002 pub propagation: crate::__u64,
1003 pub userns_fd: crate::__u64,
1004 }
1005
1006 pub struct mnt_ns_info {
1008 pub size: crate::__u32,
1009 pub nr_mounts: crate::__u32,
1010 pub mnt_ns_id: crate::__u64,
1011 }
1012
1013 #[non_exhaustive]
1016 pub struct pidfd_info {
1017 pub mask: crate::__u64,
1018 pub cgroupid: crate::__u64,
1019 pub pid: crate::__u32,
1020 pub tgid: crate::__u32,
1021 pub ppid: crate::__u32,
1022 pub ruid: crate::__u32,
1023 pub rgid: crate::__u32,
1024 pub euid: crate::__u32,
1025 pub egid: crate::__u32,
1026 pub suid: crate::__u32,
1027 pub sgid: crate::__u32,
1028 pub fsuid: crate::__u32,
1029 pub fsgid: crate::__u32,
1030 pub exit_code: crate::__s32,
1031 }
1032
1033 pub struct dmabuf_cmsg {
1036 pub frag_offset: crate::__u64,
1037 pub frag_size: crate::__u32,
1038 pub frag_token: crate::__u32,
1039 pub dmabuf_id: crate::__u32,
1040 pub flags: crate::__u32,
1041 }
1042
1043 pub struct dmabuf_token {
1044 pub token_start: crate::__u32,
1045 pub token_count: crate::__u32,
1046 }
1047
1048 pub struct sockaddr_alg {
1049 pub salg_family: crate::sa_family_t,
1050 pub salg_type: [c_uchar; 14],
1051 pub salg_feat: u32,
1052 pub salg_mask: u32,
1053 pub salg_name: [c_uchar; 64],
1054 }
1055
1056 #[cfg_attr(
1057 all(
1058 any(target_env = "musl", target_env = "ohos"),
1059 target_pointer_width = "32"
1060 ),
1061 repr(align(4))
1062 )]
1063 #[cfg_attr(
1064 all(
1065 any(target_env = "musl", target_env = "ohos"),
1066 target_pointer_width = "64"
1067 ),
1068 repr(align(8))
1069 )]
1070 #[cfg_attr(
1071 all(
1072 not(any(target_env = "musl", target_env = "ohos")),
1073 target_arch = "x86"
1074 ),
1075 repr(align(4))
1076 )]
1077 #[cfg_attr(
1078 all(
1079 not(any(target_env = "musl", target_env = "ohos")),
1080 not(target_arch = "x86")
1081 ),
1082 repr(align(8))
1083 )]
1084 pub struct pthread_cond_t {
1085 #[doc(hidden)]
1086 size: [u8; crate::__SIZEOF_PTHREAD_COND_T],
1087 }
1088
1089 #[cfg_attr(
1090 all(
1091 target_pointer_width = "32",
1092 any(
1093 target_arch = "mips",
1094 target_arch = "mips32r6",
1095 target_arch = "arm",
1096 target_arch = "hexagon",
1097 target_arch = "m68k",
1098 target_arch = "csky",
1099 target_arch = "powerpc",
1100 target_arch = "sparc",
1101 target_arch = "x86_64",
1102 target_arch = "x86",
1103 )
1104 ),
1105 repr(align(4))
1106 )]
1107 #[cfg_attr(
1108 any(
1109 target_pointer_width = "64",
1110 not(any(
1111 target_arch = "mips",
1112 target_arch = "mips32r6",
1113 target_arch = "arm",
1114 target_arch = "hexagon",
1115 target_arch = "m68k",
1116 target_arch = "csky",
1117 target_arch = "powerpc",
1118 target_arch = "sparc",
1119 target_arch = "x86_64",
1120 target_arch = "x86",
1121 ))
1122 ),
1123 repr(align(8))
1124 )]
1125 pub struct pthread_mutex_t {
1126 #[doc(hidden)]
1127 size: [c_char; crate::__SIZEOF_PTHREAD_MUTEX_T],
1128 }
1129
1130 #[cfg_attr(
1131 all(
1132 target_pointer_width = "32",
1133 any(
1134 target_arch = "mips",
1135 target_arch = "mips32r6",
1136 target_arch = "arm",
1137 target_arch = "hexagon",
1138 target_arch = "m68k",
1139 target_arch = "csky",
1140 target_arch = "powerpc",
1141 target_arch = "sparc",
1142 target_arch = "x86_64",
1143 target_arch = "x86"
1144 )
1145 ),
1146 repr(align(4))
1147 )]
1148 #[cfg_attr(
1149 any(
1150 target_pointer_width = "64",
1151 not(any(
1152 target_arch = "mips",
1153 target_arch = "mips32r6",
1154 target_arch = "arm",
1155 target_arch = "hexagon",
1156 target_arch = "m68k",
1157 target_arch = "powerpc",
1158 target_arch = "sparc",
1159 target_arch = "x86_64",
1160 target_arch = "x86"
1161 ))
1162 ),
1163 repr(align(8))
1164 )]
1165 pub struct pthread_rwlock_t {
1166 size: [u8; crate::__SIZEOF_PTHREAD_RWLOCK_T],
1167 }
1168
1169 #[cfg_attr(
1170 all(
1171 target_pointer_width = "32",
1172 any(
1173 target_arch = "mips",
1174 target_arch = "mips32r6",
1175 target_arch = "arm",
1176 target_arch = "hexagon",
1177 target_arch = "m68k",
1178 target_arch = "csky",
1179 target_arch = "powerpc",
1180 target_arch = "sparc",
1181 target_arch = "x86_64",
1182 target_arch = "x86"
1183 )
1184 ),
1185 repr(align(4))
1186 )]
1187 #[cfg_attr(
1188 any(
1189 target_pointer_width = "64",
1190 not(any(
1191 target_arch = "mips",
1192 target_arch = "mips32r6",
1193 target_arch = "arm",
1194 target_arch = "hexagon",
1195 target_arch = "m68k",
1196 target_arch = "csky",
1197 target_arch = "powerpc",
1198 target_arch = "sparc",
1199 target_arch = "x86_64",
1200 target_arch = "x86"
1201 ))
1202 ),
1203 repr(align(8))
1204 )]
1205 pub struct pthread_barrier_t {
1206 size: [u8; crate::__SIZEOF_PTHREAD_BARRIER_T],
1207 }
1208
1209 pub struct uinput_setup {
1210 pub id: input_id,
1211 pub name: [c_char; UINPUT_MAX_NAME_SIZE],
1212 pub ff_effects_max: __u32,
1213 }
1214
1215 pub struct uinput_user_dev {
1216 pub name: [c_char; UINPUT_MAX_NAME_SIZE],
1217 pub id: input_id,
1218 pub ff_effects_max: __u32,
1219 pub absmax: [__s32; ABS_CNT],
1220 pub absmin: [__s32; ABS_CNT],
1221 pub absfuzz: [__s32; ABS_CNT],
1222 pub absflat: [__s32; ABS_CNT],
1223 }
1224
1225 pub struct mq_attr {
1228 #[cfg(all(target_arch = "x86_64", target_pointer_width = "32"))]
1229 pub mq_flags: i64,
1230 #[cfg(all(target_arch = "x86_64", target_pointer_width = "32"))]
1231 pub mq_maxmsg: i64,
1232 #[cfg(all(target_arch = "x86_64", target_pointer_width = "32"))]
1233 pub mq_msgsize: i64,
1234 #[cfg(all(target_arch = "x86_64", target_pointer_width = "32"))]
1235 pub mq_curmsgs: i64,
1236 #[cfg(all(target_arch = "x86_64", target_pointer_width = "32"))]
1237 pad: Padding<[i64; 4]>,
1238
1239 #[cfg(not(all(target_arch = "x86_64", target_pointer_width = "32")))]
1240 pub mq_flags: c_long,
1241 #[cfg(not(all(target_arch = "x86_64", target_pointer_width = "32")))]
1242 pub mq_maxmsg: c_long,
1243 #[cfg(not(all(target_arch = "x86_64", target_pointer_width = "32")))]
1244 pub mq_msgsize: c_long,
1245 #[cfg(not(all(target_arch = "x86_64", target_pointer_width = "32")))]
1246 pub mq_curmsgs: c_long,
1247 #[cfg(not(all(target_arch = "x86_64", target_pointer_width = "32")))]
1248 pad: Padding<[c_long; 4]>,
1249 }
1250
1251 pub struct hwtstamp_config {
1252 pub flags: c_int,
1253 pub tx_type: c_int,
1254 pub rx_filter: c_int,
1255 }
1256
1257 pub struct sched_attr {
1258 pub size: __u32,
1259 pub sched_policy: __u32,
1260 pub sched_flags: crate::__u64,
1261 pub sched_nice: __s32,
1262 pub sched_priority: __u32,
1263 pub sched_runtime: crate::__u64,
1264 pub sched_deadline: crate::__u64,
1265 pub sched_period: crate::__u64,
1266 }
1267}
1268
1269cfg_if! {
1270 if #[cfg(not(target_arch = "sparc64"))] {
1271 #[automatically_derived]
#[allow(deprecated)]
impl ::core::clone::Clone for iw_michaelmicfailure {
#[inline]
fn clone(&self) -> iw_michaelmicfailure {
let _: ::core::clone::AssertParamIsClone<__u32>;
let _: ::core::clone::AssertParamIsClone<crate::sockaddr>;
let _:
::core::clone::AssertParamIsClone<[__u8; IW_ENCODE_SEQ_MAX_SIZE]>;
*self
}
}
#[automatically_derived]
#[allow(deprecated)]
impl ::core::marker::Copy for iw_michaelmicfailure { }
#[automatically_derived]
#[allow(deprecated)]
impl ::core::fmt::Debug for iw_michaelmicfailure {
#[inline]
fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result {
::core::fmt::Formatter::debug_struct_field3_finish(f,
"iw_michaelmicfailure", "flags", &self.flags, "src_addr",
&self.src_addr, "tsc", &&self.tsc)
}
}s! {
1272 pub struct iw_thrspy {
1273 pub addr: crate::sockaddr,
1274 pub qual: iw_quality,
1275 pub low: iw_quality,
1276 pub high: iw_quality,
1277 }
1278
1279 pub struct iw_mlme {
1280 pub cmd: __u16,
1281 pub reason_code: __u16,
1282 pub addr: crate::sockaddr,
1283 }
1284
1285 pub struct iw_michaelmicfailure {
1286 pub flags: __u32,
1287 pub src_addr: crate::sockaddr,
1288 pub tsc: [__u8; IW_ENCODE_SEQ_MAX_SIZE],
1289 }
1290 }
1291 }
1292}
1293
1294#[automatically_derived]
impl ::core::clone::Clone for __c_anonymous_xsk_tx_metadata_union {
#[inline]
fn clone(&self) -> __c_anonymous_xsk_tx_metadata_union {
let _: ::core::clone::AssertParamIsCopy<Self>;
*self
}
}
#[automatically_derived]
impl ::core::marker::Copy for __c_anonymous_xsk_tx_metadata_union { }
impl ::core::fmt::Debug for __c_anonymous_xsk_tx_metadata_union {
fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
f.debug_struct("__c_anonymous_xsk_tx_metadata_union").finish_non_exhaustive()
}
}s_no_extra_traits! {
1295 #[deprecated(
1298 note = "this struct has unsafe trait implementations that will be \
1299 removed in the future",
1300 since = "0.2.80"
1301 )]
1302 pub struct af_alg_iv {
1303 pub ivlen: u32,
1304 pub iv: [c_uchar; 0],
1305 }
1306
1307 pub union tpacket_req_u {
1308 pub req: crate::tpacket_req,
1309 pub req3: crate::tpacket_req3,
1310 }
1311
1312 pub union tpacket_bd_header_u {
1313 pub bh1: crate::tpacket_hdr_v1,
1314 }
1315
1316 pub struct tpacket_block_desc {
1317 pub version: __u32,
1318 pub offset_to_priv: __u32,
1319 pub hdr: crate::tpacket_bd_header_u,
1320 }
1321
1322 pub struct sock_txtime {
1324 pub clockid: crate::clockid_t,
1325 pub flags: __u32,
1326 }
1327
1328 pub union iwreq_data {
1330 pub name: [c_char; crate::IFNAMSIZ],
1331 pub essid: iw_point,
1332 pub nwid: iw_param,
1333 pub freq: iw_freq,
1334 pub sens: iw_param,
1335 pub bitrate: iw_param,
1336 pub txpower: iw_param,
1337 pub rts: iw_param,
1338 pub frag: iw_param,
1339 pub mode: __u32,
1340 pub retry: iw_param,
1341 pub encoding: iw_point,
1342 pub power: iw_param,
1343 pub qual: iw_quality,
1344 pub ap_addr: crate::sockaddr,
1345 pub addr: crate::sockaddr,
1346 pub param: iw_param,
1347 pub data: iw_point,
1348 }
1349
1350 pub struct iw_event {
1351 pub len: __u16,
1352 pub cmd: __u16,
1353 pub u: iwreq_data,
1354 }
1355
1356 pub union __c_anonymous_iwreq {
1357 pub ifrn_name: [c_char; crate::IFNAMSIZ],
1358 }
1359
1360 pub struct iwreq {
1361 pub ifr_ifrn: __c_anonymous_iwreq,
1362 pub u: iwreq_data,
1363 }
1364
1365 pub union __c_anonymous_ptp_perout_request_1 {
1367 pub start: ptp_clock_time,
1368 pub phase: ptp_clock_time,
1369 }
1370
1371 pub union __c_anonymous_ptp_perout_request_2 {
1372 pub on: ptp_clock_time,
1373 pub rsv: [c_uint; 4],
1374 }
1375
1376 pub struct ptp_perout_request {
1377 pub anonymous_1: __c_anonymous_ptp_perout_request_1,
1378 pub period: ptp_clock_time,
1379 pub index: c_uint,
1380 pub flags: c_uint,
1381 pub anonymous_2: __c_anonymous_ptp_perout_request_2,
1382 }
1383
1384 pub struct xsk_tx_metadata {
1386 pub flags: crate::__u64,
1387 pub xsk_tx_metadata_union: __c_anonymous_xsk_tx_metadata_union,
1388 }
1389
1390 pub union __c_anonymous_xsk_tx_metadata_union {
1391 pub request: xsk_tx_metadata_request,
1392 pub completion: xsk_tx_metadata_completion,
1393 }
1394}
1395
1396cfg_if! {
1397 if #[cfg(feature = "extra_traits")] {
1398 #[allow(deprecated)]
1399 impl af_alg_iv {
1400 fn as_slice(&self) -> &[u8] {
1401 unsafe { ::core::slice::from_raw_parts(self.iv.as_ptr(), self.ivlen as usize) }
1402 }
1403 }
1404
1405 #[allow(deprecated)]
1406 impl PartialEq for af_alg_iv {
1407 fn eq(&self, other: &af_alg_iv) -> bool {
1408 *self.as_slice() == *other.as_slice()
1409 }
1410 }
1411
1412 #[allow(deprecated)]
1413 impl Eq for af_alg_iv {}
1414
1415 #[allow(deprecated)]
1416 impl hash::Hash for af_alg_iv {
1417 fn hash<H: hash::Hasher>(&self, state: &mut H) {
1418 self.as_slice().hash(state);
1419 }
1420 }
1421 }
1422}
1423
1424pub const POSIX_SPAWN_USEVFORK: c_int = 64;
1425pub const POSIX_SPAWN_SETSID: c_int = 128;
1426
1427pub const F_SEAL_FUTURE_WRITE: c_int = 0x0010;
1428pub const F_SEAL_EXEC: c_int = 0x0020;
1429
1430pub const IFF_LOWER_UP: c_int = 0x10000;
1431pub const IFF_DORMANT: c_int = 0x20000;
1432pub const IFF_ECHO: c_int = 0x40000;
1433
1434pub const AT_EXECVE_CHECK: c_int = 0x10000;
1436
1437pub const IFA_UNSPEC: c_ushort = 0;
1439pub const IFA_ADDRESS: c_ushort = 1;
1440pub const IFA_LOCAL: c_ushort = 2;
1441pub const IFA_LABEL: c_ushort = 3;
1442pub const IFA_BROADCAST: c_ushort = 4;
1443pub const IFA_ANYCAST: c_ushort = 5;
1444pub const IFA_CACHEINFO: c_ushort = 6;
1445pub const IFA_MULTICAST: c_ushort = 7;
1446pub const IFA_FLAGS: c_ushort = 8;
1447
1448pub const IFA_F_SECONDARY: u32 = 0x01;
1449pub const IFA_F_TEMPORARY: u32 = 0x01;
1450pub const IFA_F_NODAD: u32 = 0x02;
1451pub const IFA_F_OPTIMISTIC: u32 = 0x04;
1452pub const IFA_F_DADFAILED: u32 = 0x08;
1453pub const IFA_F_HOMEADDRESS: u32 = 0x10;
1454pub const IFA_F_DEPRECATED: u32 = 0x20;
1455pub const IFA_F_TENTATIVE: u32 = 0x40;
1456pub const IFA_F_PERMANENT: u32 = 0x80;
1457pub const IFA_F_MANAGETEMPADDR: u32 = 0x100;
1458pub const IFA_F_NOPREFIXROUTE: u32 = 0x200;
1459pub const IFA_F_MCAUTOJOIN: u32 = 0x400;
1460pub const IFA_F_STABLE_PRIVACY: u32 = 0x800;
1461
1462pub const RWF_HIPRI: c_int = 0x00000001;
1466pub const RWF_DSYNC: c_int = 0x00000002;
1467pub const RWF_SYNC: c_int = 0x00000004;
1468pub const RWF_NOWAIT: c_int = 0x00000008;
1469pub const RWF_APPEND: c_int = 0x00000010;
1470pub const RWF_NOAPPEND: c_int = 0x00000020;
1471pub const RWF_ATOMIC: c_int = 0x00000040;
1472pub const RWF_DONTCACHE: c_int = 0x00000080;
1473
1474pub const IFLA_UNSPEC: c_ushort = 0;
1476pub const IFLA_ADDRESS: c_ushort = 1;
1477pub const IFLA_BROADCAST: c_ushort = 2;
1478pub const IFLA_IFNAME: c_ushort = 3;
1479pub const IFLA_MTU: c_ushort = 4;
1480pub const IFLA_LINK: c_ushort = 5;
1481pub const IFLA_QDISC: c_ushort = 6;
1482pub const IFLA_STATS: c_ushort = 7;
1483pub const IFLA_COST: c_ushort = 8;
1484pub const IFLA_PRIORITY: c_ushort = 9;
1485pub const IFLA_MASTER: c_ushort = 10;
1486pub const IFLA_WIRELESS: c_ushort = 11;
1487pub const IFLA_PROTINFO: c_ushort = 12;
1488pub const IFLA_TXQLEN: c_ushort = 13;
1489pub const IFLA_MAP: c_ushort = 14;
1490pub const IFLA_WEIGHT: c_ushort = 15;
1491pub const IFLA_OPERSTATE: c_ushort = 16;
1492pub const IFLA_LINKMODE: c_ushort = 17;
1493pub const IFLA_LINKINFO: c_ushort = 18;
1494pub const IFLA_NET_NS_PID: c_ushort = 19;
1495pub const IFLA_IFALIAS: c_ushort = 20;
1496pub const IFLA_NUM_VF: c_ushort = 21;
1497pub const IFLA_VFINFO_LIST: c_ushort = 22;
1498pub const IFLA_STATS64: c_ushort = 23;
1499pub const IFLA_VF_PORTS: c_ushort = 24;
1500pub const IFLA_PORT_SELF: c_ushort = 25;
1501pub const IFLA_AF_SPEC: c_ushort = 26;
1502pub const IFLA_GROUP: c_ushort = 27;
1503pub const IFLA_NET_NS_FD: c_ushort = 28;
1504pub const IFLA_EXT_MASK: c_ushort = 29;
1505pub const IFLA_PROMISCUITY: c_ushort = 30;
1506pub const IFLA_NUM_TX_QUEUES: c_ushort = 31;
1507pub const IFLA_NUM_RX_QUEUES: c_ushort = 32;
1508pub const IFLA_CARRIER: c_ushort = 33;
1509pub const IFLA_PHYS_PORT_ID: c_ushort = 34;
1510pub const IFLA_CARRIER_CHANGES: c_ushort = 35;
1511pub const IFLA_PHYS_SWITCH_ID: c_ushort = 36;
1512pub const IFLA_LINK_NETNSID: c_ushort = 37;
1513pub const IFLA_PHYS_PORT_NAME: c_ushort = 38;
1514pub const IFLA_PROTO_DOWN: c_ushort = 39;
1515pub const IFLA_GSO_MAX_SEGS: c_ushort = 40;
1516pub const IFLA_GSO_MAX_SIZE: c_ushort = 41;
1517pub const IFLA_PAD: c_ushort = 42;
1518pub const IFLA_XDP: c_ushort = 43;
1519pub const IFLA_EVENT: c_ushort = 44;
1520pub const IFLA_NEW_NETNSID: c_ushort = 45;
1521pub const IFLA_IF_NETNSID: c_ushort = 46;
1522pub const IFLA_TARGET_NETNSID: c_ushort = IFLA_IF_NETNSID;
1523pub const IFLA_CARRIER_UP_COUNT: c_ushort = 47;
1524pub const IFLA_CARRIER_DOWN_COUNT: c_ushort = 48;
1525pub const IFLA_NEW_IFINDEX: c_ushort = 49;
1526pub const IFLA_MIN_MTU: c_ushort = 50;
1527pub const IFLA_MAX_MTU: c_ushort = 51;
1528pub const IFLA_PROP_LIST: c_ushort = 52;
1529pub const IFLA_ALT_IFNAME: c_ushort = 53;
1530pub const IFLA_PERM_ADDRESS: c_ushort = 54;
1531pub const IFLA_PROTO_DOWN_REASON: c_ushort = 55;
1532pub const IFLA_PARENT_DEV_NAME: c_ushort = 56;
1533pub const IFLA_PARENT_DEV_BUS_NAME: c_ushort = 57;
1534pub const IFLA_GRO_MAX_SIZE: c_ushort = 58;
1535pub const IFLA_TSO_MAX_SIZE: c_ushort = 59;
1536pub const IFLA_TSO_MAX_SEGS: c_ushort = 60;
1537pub const IFLA_ALLMULTI: c_ushort = 61;
1538
1539pub const IFLA_INFO_UNSPEC: c_ushort = 0;
1540pub const IFLA_INFO_KIND: c_ushort = 1;
1541pub const IFLA_INFO_DATA: c_ushort = 2;
1542pub const IFLA_INFO_XSTATS: c_ushort = 3;
1543pub const IFLA_INFO_SLAVE_KIND: c_ushort = 4;
1544pub const IFLA_INFO_SLAVE_DATA: c_ushort = 5;
1545
1546pub const SEEK_DATA: c_int = 3;
1548pub const SEEK_HOLE: c_int = 4;
1549
1550pub const MPOL_DEFAULT: c_int = 0;
1552pub const MPOL_PREFERRED: c_int = 1;
1553pub const MPOL_BIND: c_int = 2;
1554pub const MPOL_INTERLEAVE: c_int = 3;
1555pub const MPOL_LOCAL: c_int = 4;
1556pub const MPOL_F_NUMA_BALANCING: c_int = 1 << 13;
1557pub const MPOL_F_RELATIVE_NODES: c_int = 1 << 14;
1558pub const MPOL_F_STATIC_NODES: c_int = 1 << 15;
1559
1560pub const PTHREAD_MUTEX_INITIALIZER: crate::pthread_mutex_t = crate::pthread_mutex_t {
1561 size: [0; crate::__SIZEOF_PTHREAD_MUTEX_T],
1562};
1563pub const PTHREAD_COND_INITIALIZER: crate::pthread_cond_t = crate::pthread_cond_t {
1564 size: [0; crate::__SIZEOF_PTHREAD_COND_T],
1565};
1566pub const PTHREAD_RWLOCK_INITIALIZER: crate::pthread_rwlock_t = crate::pthread_rwlock_t {
1567 size: [0; crate::__SIZEOF_PTHREAD_RWLOCK_T],
1568};
1569
1570pub const RENAME_NOREPLACE: c_uint = 1;
1571pub const RENAME_EXCHANGE: c_uint = 2;
1572pub const RENAME_WHITEOUT: c_uint = 4;
1573
1574pub const MSG_STAT: c_int = 11 | (crate::IPC_STAT & 0x100);
1575pub const MSG_INFO: c_int = 12;
1576pub const MSG_NOTIFICATION: c_int = 0x8000;
1577
1578pub const MSG_NOERROR: c_int = 0o10000;
1579pub const MSG_EXCEPT: c_int = 0o20000;
1580pub const MSG_ZEROCOPY: c_int = 0x4000000;
1581
1582pub const SEM_UNDO: c_int = 0x1000;
1583
1584pub const GETPID: c_int = 11;
1585pub const GETVAL: c_int = 12;
1586pub const GETALL: c_int = 13;
1587pub const GETNCNT: c_int = 14;
1588pub const GETZCNT: c_int = 15;
1589pub const SETVAL: c_int = 16;
1590pub const SETALL: c_int = 17;
1591pub const SEM_STAT: c_int = 18 | (crate::IPC_STAT & 0x100);
1592pub const SEM_INFO: c_int = 19;
1593pub const SEM_STAT_ANY: c_int = 20 | (crate::IPC_STAT & 0x100);
1594
1595pub const QFMT_VFS_OLD: c_int = 1;
1596pub const QFMT_VFS_V0: c_int = 2;
1597pub const QFMT_VFS_V1: c_int = 4;
1598
1599pub const EFD_SEMAPHORE: c_int = 0x1;
1600
1601pub const RB_AUTOBOOT: c_int = 0x01234567u32 as i32;
1602pub const RB_HALT_SYSTEM: c_int = 0xcdef0123u32 as i32;
1603pub const RB_ENABLE_CAD: c_int = 0x89abcdefu32 as i32;
1604pub const RB_DISABLE_CAD: c_int = 0x00000000u32 as i32;
1605pub const RB_POWER_OFF: c_int = 0x4321fedcu32 as i32;
1606pub const RB_SW_SUSPEND: c_int = 0xd000fce2u32 as i32;
1607pub const RB_KEXEC: c_int = 0x45584543u32 as i32;
1608
1609pub const SYNC_FILE_RANGE_WAIT_BEFORE: c_uint = 1;
1610pub const SYNC_FILE_RANGE_WRITE: c_uint = 2;
1611pub const SYNC_FILE_RANGE_WAIT_AFTER: c_uint = 4;
1612
1613pub const MREMAP_MAYMOVE: c_int = 1;
1614pub const MREMAP_FIXED: c_int = 2;
1615pub const MREMAP_DONTUNMAP: c_int = 4;
1616
1617const NSIO: c_uint = 0xb7;
1619
1620pub const NS_GET_USERNS: Ioctl = _IO(NSIO, 0x1);
1621pub const NS_GET_PARENT: Ioctl = _IO(NSIO, 0x2);
1622pub const NS_GET_NSTYPE: Ioctl = _IO(NSIO, 0x3);
1623pub const NS_GET_OWNER_UID: Ioctl = _IO(NSIO, 0x4);
1624
1625pub const NS_GET_MNTNS_ID: Ioctl = _IOR::<__u64>(NSIO, 0x5);
1626
1627pub const NS_GET_PID_FROM_PIDNS: Ioctl = _IOR::<c_int>(NSIO, 0x6);
1628pub const NS_GET_TGID_FROM_PIDNS: Ioctl = _IOR::<c_int>(NSIO, 0x7);
1629pub const NS_GET_PID_IN_PIDNS: Ioctl = _IOR::<c_int>(NSIO, 0x8);
1630pub const NS_GET_TGID_IN_PIDNS: Ioctl = _IOR::<c_int>(NSIO, 0x9);
1631
1632pub const MNT_NS_INFO_SIZE_VER0: Ioctl = 16;
1633
1634pub const NS_MNT_GET_INFO: Ioctl = _IOR::<mnt_ns_info>(NSIO, 10);
1635pub const NS_MNT_GET_NEXT: Ioctl = _IOR::<mnt_ns_info>(NSIO, 11);
1636pub const NS_MNT_GET_PREV: Ioctl = _IOR::<mnt_ns_info>(NSIO, 12);
1637
1638pub const PIDFD_NONBLOCK: c_uint = O_NONBLOCK as c_uint;
1640pub const PIDFD_THREAD: c_uint = O_EXCL as c_uint;
1641
1642pub const PIDFD_SIGNAL_THREAD: c_uint = 1 << 0;
1643pub const PIDFD_SIGNAL_THREAD_GROUP: c_uint = 1 << 1;
1644pub const PIDFD_SIGNAL_PROCESS_GROUP: c_uint = 1 << 2;
1645
1646pub const PIDFD_INFO_PID: c_uint = 1 << 0;
1647pub const PIDFD_INFO_CREDS: c_uint = 1 << 1;
1648pub const PIDFD_INFO_CGROUPID: c_uint = 1 << 2;
1649pub const PIDFD_INFO_EXIT: c_uint = 1 << 3;
1650
1651pub const PIDFD_INFO_SIZE_VER0: c_uint = 64;
1652
1653const PIDFS_IOCTL_MAGIC: c_uint = 0xFF;
1654pub const PIDFD_GET_CGROUP_NAMESPACE: Ioctl = _IO(PIDFS_IOCTL_MAGIC, 1);
1655pub const PIDFD_GET_IPC_NAMESPACE: Ioctl = _IO(PIDFS_IOCTL_MAGIC, 2);
1656pub const PIDFD_GET_MNT_NAMESPACE: Ioctl = _IO(PIDFS_IOCTL_MAGIC, 3);
1657pub const PIDFD_GET_NET_NAMESPACE: Ioctl = _IO(PIDFS_IOCTL_MAGIC, 4);
1658pub const PIDFD_GET_PID_NAMESPACE: Ioctl = _IO(PIDFS_IOCTL_MAGIC, 5);
1659pub const PIDFD_GET_PID_FOR_CHILDREN_NAMESPACE: Ioctl = _IO(PIDFS_IOCTL_MAGIC, 6);
1660pub const PIDFD_GET_TIME_NAMESPACE: Ioctl = _IO(PIDFS_IOCTL_MAGIC, 7);
1661pub const PIDFD_GET_TIME_FOR_CHILDREN_NAMESPACE: Ioctl = _IO(PIDFS_IOCTL_MAGIC, 8);
1662pub const PIDFD_GET_USER_NAMESPACE: Ioctl = _IO(PIDFS_IOCTL_MAGIC, 9);
1663pub const PIDFD_GET_UTS_NAMESPACE: Ioctl = _IO(PIDFS_IOCTL_MAGIC, 10);
1664pub const PIDFD_GET_INFO: Ioctl = _IOWR::<pidfd_info>(PIDFS_IOCTL_MAGIC, 11);
1665
1666pub const PR_SET_MDWE: c_int = 65;
1667pub const PR_GET_MDWE: c_int = 66;
1668pub const PR_MDWE_REFUSE_EXEC_GAIN: c_uint = 1 << 0;
1669pub const PR_MDWE_NO_INHERIT: c_uint = 1 << 1;
1670
1671pub const GRND_NONBLOCK: c_uint = 0x0001;
1672pub const GRND_RANDOM: c_uint = 0x0002;
1673pub const GRND_INSECURE: c_uint = 0x0004;
1674
1675pub const SECCOMP_MODE_DISABLED: c_uint = 0;
1677pub const SECCOMP_MODE_STRICT: c_uint = 1;
1678pub const SECCOMP_MODE_FILTER: c_uint = 2;
1679
1680pub const SECCOMP_SET_MODE_STRICT: c_uint = 0;
1681pub const SECCOMP_SET_MODE_FILTER: c_uint = 1;
1682pub const SECCOMP_GET_ACTION_AVAIL: c_uint = 2;
1683pub const SECCOMP_GET_NOTIF_SIZES: c_uint = 3;
1684
1685pub const SECCOMP_FILTER_FLAG_TSYNC: c_ulong = 1 << 0;
1686pub const SECCOMP_FILTER_FLAG_LOG: c_ulong = 1 << 1;
1687pub const SECCOMP_FILTER_FLAG_SPEC_ALLOW: c_ulong = 1 << 2;
1688pub const SECCOMP_FILTER_FLAG_NEW_LISTENER: c_ulong = 1 << 3;
1689pub const SECCOMP_FILTER_FLAG_TSYNC_ESRCH: c_ulong = 1 << 4;
1690pub const SECCOMP_FILTER_FLAG_WAIT_KILLABLE_RECV: c_ulong = 1 << 5;
1691
1692pub const SECCOMP_RET_KILL_PROCESS: c_uint = 0x80000000;
1693pub const SECCOMP_RET_KILL_THREAD: c_uint = 0x00000000;
1694pub const SECCOMP_RET_KILL: c_uint = SECCOMP_RET_KILL_THREAD;
1695pub const SECCOMP_RET_TRAP: c_uint = 0x00030000;
1696pub const SECCOMP_RET_ERRNO: c_uint = 0x00050000;
1697pub const SECCOMP_RET_USER_NOTIF: c_uint = 0x7fc00000;
1698pub const SECCOMP_RET_TRACE: c_uint = 0x7ff00000;
1699pub const SECCOMP_RET_LOG: c_uint = 0x7ffc0000;
1700pub const SECCOMP_RET_ALLOW: c_uint = 0x7fff0000;
1701
1702pub const SECCOMP_RET_ACTION_FULL: c_uint = 0xffff0000;
1703pub const SECCOMP_RET_ACTION: c_uint = 0x7fff0000;
1704pub const SECCOMP_RET_DATA: c_uint = 0x0000ffff;
1705
1706pub const SECCOMP_USER_NOTIF_FLAG_CONTINUE: c_ulong = 1;
1707
1708pub const SECCOMP_ADDFD_FLAG_SETFD: c_ulong = 1;
1709pub const SECCOMP_ADDFD_FLAG_SEND: c_ulong = 2;
1710
1711pub const TFD_CLOEXEC: c_int = O_CLOEXEC;
1712pub const TFD_NONBLOCK: c_int = O_NONBLOCK;
1713pub const TFD_TIMER_ABSTIME: c_int = 1;
1714pub const TFD_TIMER_CANCEL_ON_SET: c_int = 2;
1715
1716pub const FALLOC_FL_KEEP_SIZE: c_int = 0x01;
1717pub const FALLOC_FL_PUNCH_HOLE: c_int = 0x02;
1718pub const FALLOC_FL_COLLAPSE_RANGE: c_int = 0x08;
1719pub const FALLOC_FL_ZERO_RANGE: c_int = 0x10;
1720pub const FALLOC_FL_INSERT_RANGE: c_int = 0x20;
1721pub const FALLOC_FL_UNSHARE_RANGE: c_int = 0x40;
1722
1723#[deprecated(
1724 since = "0.2.55",
1725 note = "ENOATTR is not available on Linux; use ENODATA instead"
1726)]
1727pub const ENOATTR: c_int = crate::ENODATA;
1728
1729pub const SO_ORIGINAL_DST: c_int = 80;
1730
1731pub const IP_RECVFRAGSIZE: c_int = 25;
1732
1733pub const IPV6_FLOWINFO: c_int = 11;
1734pub const IPV6_FLOWLABEL_MGR: c_int = 32;
1735pub const IPV6_FLOWINFO_SEND: c_int = 33;
1736pub const IPV6_RECVFRAGSIZE: c_int = 77;
1737pub const IPV6_FREEBIND: c_int = 78;
1738pub const IPV6_FLOWINFO_FLOWLABEL: c_int = 0x000fffff;
1739pub const IPV6_FLOWINFO_PRIORITY: c_int = 0x0ff00000;
1740
1741pub const SK_MEMINFO_RMEM_ALLOC: c_int = 0;
1743pub const SK_MEMINFO_RCVBUF: c_int = 1;
1744pub const SK_MEMINFO_WMEM_ALLOC: c_int = 2;
1745pub const SK_MEMINFO_SNDBUF: c_int = 3;
1746pub const SK_MEMINFO_FWD_ALLOC: c_int = 4;
1747pub const SK_MEMINFO_WMEM_QUEUED: c_int = 5;
1748pub const SK_MEMINFO_OPTMEM: c_int = 6;
1749pub const SK_MEMINFO_BACKLOG: c_int = 7;
1750pub const SK_MEMINFO_DROPS: c_int = 8;
1751
1752pub const CLOSE_RANGE_UNSHARE: c_uint = 1 << 1;
1754pub const CLOSE_RANGE_CLOEXEC: c_uint = 1 << 2;
1755
1756pub const SKF_AD_OFF: c_int = -0x1000;
1758pub const SKF_AD_PROTOCOL: c_int = 0;
1759pub const SKF_AD_PKTTYPE: c_int = 4;
1760pub const SKF_AD_IFINDEX: c_int = 8;
1761pub const SKF_AD_NLATTR: c_int = 12;
1762pub const SKF_AD_NLATTR_NEST: c_int = 16;
1763pub const SKF_AD_MARK: c_int = 20;
1764pub const SKF_AD_QUEUE: c_int = 24;
1765pub const SKF_AD_HATYPE: c_int = 28;
1766pub const SKF_AD_RXHASH: c_int = 32;
1767pub const SKF_AD_CPU: c_int = 36;
1768pub const SKF_AD_ALU_XOR_X: c_int = 40;
1769pub const SKF_AD_VLAN_TAG: c_int = 44;
1770pub const SKF_AD_VLAN_TAG_PRESENT: c_int = 48;
1771pub const SKF_AD_PAY_OFFSET: c_int = 52;
1772pub const SKF_AD_RANDOM: c_int = 56;
1773pub const SKF_AD_VLAN_TPID: c_int = 60;
1774pub const SKF_AD_MAX: c_int = 64;
1775pub const SKF_NET_OFF: c_int = -0x100000;
1776pub const SKF_LL_OFF: c_int = -0x200000;
1777pub const BPF_NET_OFF: c_int = SKF_NET_OFF;
1778pub const BPF_LL_OFF: c_int = SKF_LL_OFF;
1779pub const BPF_MEMWORDS: c_int = 16;
1780pub const BPF_MAXINSNS: c_int = 4096;
1781
1782pub const BPF_LD: __u32 = 0x00;
1784pub const BPF_LDX: __u32 = 0x01;
1785pub const BPF_ST: __u32 = 0x02;
1786pub const BPF_STX: __u32 = 0x03;
1787pub const BPF_ALU: __u32 = 0x04;
1788pub const BPF_JMP: __u32 = 0x05;
1789pub const BPF_RET: __u32 = 0x06;
1790pub const BPF_MISC: __u32 = 0x07;
1791pub const BPF_W: __u32 = 0x00;
1792pub const BPF_H: __u32 = 0x08;
1793pub const BPF_B: __u32 = 0x10;
1794pub const BPF_IMM: __u32 = 0x00;
1795pub const BPF_ABS: __u32 = 0x20;
1796pub const BPF_IND: __u32 = 0x40;
1797pub const BPF_MEM: __u32 = 0x60;
1798pub const BPF_LEN: __u32 = 0x80;
1799pub const BPF_MSH: __u32 = 0xa0;
1800pub const BPF_ADD: __u32 = 0x00;
1801pub const BPF_SUB: __u32 = 0x10;
1802pub const BPF_MUL: __u32 = 0x20;
1803pub const BPF_DIV: __u32 = 0x30;
1804pub const BPF_OR: __u32 = 0x40;
1805pub const BPF_AND: __u32 = 0x50;
1806pub const BPF_LSH: __u32 = 0x60;
1807pub const BPF_RSH: __u32 = 0x70;
1808pub const BPF_NEG: __u32 = 0x80;
1809pub const BPF_MOD: __u32 = 0x90;
1810pub const BPF_XOR: __u32 = 0xa0;
1811pub const BPF_JA: __u32 = 0x00;
1812pub const BPF_JEQ: __u32 = 0x10;
1813pub const BPF_JGT: __u32 = 0x20;
1814pub const BPF_JGE: __u32 = 0x30;
1815pub const BPF_JSET: __u32 = 0x40;
1816pub const BPF_K: __u32 = 0x00;
1817pub const BPF_X: __u32 = 0x08;
1818
1819pub const BPF_A: __u32 = 0x10;
1822pub const BPF_TAX: __u32 = 0x00;
1823pub const BPF_TXA: __u32 = 0x80;
1824
1825pub const RESOLVE_NO_XDEV: crate::__u64 = 0x01;
1827pub const RESOLVE_NO_MAGICLINKS: crate::__u64 = 0x02;
1828pub const RESOLVE_NO_SYMLINKS: crate::__u64 = 0x04;
1829pub const RESOLVE_BENEATH: crate::__u64 = 0x08;
1830pub const RESOLVE_IN_ROOT: crate::__u64 = 0x10;
1831pub const RESOLVE_CACHED: crate::__u64 = 0x20;
1832
1833pub const ETH_ALEN: c_int = 6;
1835pub const ETH_HLEN: c_int = 14;
1836pub const ETH_ZLEN: c_int = 60;
1837pub const ETH_DATA_LEN: c_int = 1500;
1838pub const ETH_FRAME_LEN: c_int = 1514;
1839pub const ETH_FCS_LEN: c_int = 4;
1840
1841pub const ETH_P_LOOP: c_int = 0x0060;
1843pub const ETH_P_PUP: c_int = 0x0200;
1844pub const ETH_P_PUPAT: c_int = 0x0201;
1845pub const ETH_P_IP: c_int = 0x0800;
1846pub const ETH_P_X25: c_int = 0x0805;
1847pub const ETH_P_ARP: c_int = 0x0806;
1848pub const ETH_P_BPQ: c_int = 0x08FF;
1849pub const ETH_P_IEEEPUP: c_int = 0x0a00;
1850pub const ETH_P_IEEEPUPAT: c_int = 0x0a01;
1851pub const ETH_P_BATMAN: c_int = 0x4305;
1852pub const ETH_P_DEC: c_int = 0x6000;
1853pub const ETH_P_DNA_DL: c_int = 0x6001;
1854pub const ETH_P_DNA_RC: c_int = 0x6002;
1855pub const ETH_P_DNA_RT: c_int = 0x6003;
1856pub const ETH_P_LAT: c_int = 0x6004;
1857pub const ETH_P_DIAG: c_int = 0x6005;
1858pub const ETH_P_CUST: c_int = 0x6006;
1859pub const ETH_P_SCA: c_int = 0x6007;
1860pub const ETH_P_TEB: c_int = 0x6558;
1861pub const ETH_P_RARP: c_int = 0x8035;
1862pub const ETH_P_ATALK: c_int = 0x809B;
1863pub const ETH_P_AARP: c_int = 0x80F3;
1864pub const ETH_P_8021Q: c_int = 0x8100;
1865pub const ETH_P_IPX: c_int = 0x8137;
1866pub const ETH_P_IPV6: c_int = 0x86DD;
1867pub const ETH_P_PAUSE: c_int = 0x8808;
1868pub const ETH_P_SLOW: c_int = 0x8809;
1869pub const ETH_P_WCCP: c_int = 0x883E;
1870pub const ETH_P_MPLS_UC: c_int = 0x8847;
1871pub const ETH_P_MPLS_MC: c_int = 0x8848;
1872pub const ETH_P_ATMMPOA: c_int = 0x884c;
1873pub const ETH_P_PPP_DISC: c_int = 0x8863;
1874pub const ETH_P_PPP_SES: c_int = 0x8864;
1875pub const ETH_P_LINK_CTL: c_int = 0x886c;
1876pub const ETH_P_ATMFATE: c_int = 0x8884;
1877pub const ETH_P_PAE: c_int = 0x888E;
1878pub const ETH_P_AOE: c_int = 0x88A2;
1879pub const ETH_P_8021AD: c_int = 0x88A8;
1880pub const ETH_P_802_EX1: c_int = 0x88B5;
1881pub const ETH_P_TIPC: c_int = 0x88CA;
1882pub const ETH_P_MACSEC: c_int = 0x88E5;
1883pub const ETH_P_8021AH: c_int = 0x88E7;
1884pub const ETH_P_MVRP: c_int = 0x88F5;
1885pub const ETH_P_1588: c_int = 0x88F7;
1886pub const ETH_P_PRP: c_int = 0x88FB;
1887pub const ETH_P_FCOE: c_int = 0x8906;
1888pub const ETH_P_TDLS: c_int = 0x890D;
1889pub const ETH_P_FIP: c_int = 0x8914;
1890pub const ETH_P_80221: c_int = 0x8917;
1891pub const ETH_P_LOOPBACK: c_int = 0x9000;
1892pub const ETH_P_QINQ1: c_int = 0x9100;
1893pub const ETH_P_QINQ2: c_int = 0x9200;
1894pub const ETH_P_QINQ3: c_int = 0x9300;
1895pub const ETH_P_EDSA: c_int = 0xDADA;
1896pub const ETH_P_AF_IUCV: c_int = 0xFBFB;
1897
1898pub const ETH_P_802_3_MIN: c_int = 0x0600;
1899
1900pub const ETH_P_802_3: c_int = 0x0001;
1902pub const ETH_P_AX25: c_int = 0x0002;
1903pub const ETH_P_ALL: c_int = 0x0003;
1904pub const ETH_P_802_2: c_int = 0x0004;
1905pub const ETH_P_SNAP: c_int = 0x0005;
1906pub const ETH_P_DDCMP: c_int = 0x0006;
1907pub const ETH_P_WAN_PPP: c_int = 0x0007;
1908pub const ETH_P_PPP_MP: c_int = 0x0008;
1909pub const ETH_P_LOCALTALK: c_int = 0x0009;
1910pub const ETH_P_CANFD: c_int = 0x000D;
1911pub const ETH_P_PPPTALK: c_int = 0x0010;
1912pub const ETH_P_TR_802_2: c_int = 0x0011;
1913pub const ETH_P_MOBITEX: c_int = 0x0015;
1914pub const ETH_P_CONTROL: c_int = 0x0016;
1915pub const ETH_P_IRDA: c_int = 0x0017;
1916pub const ETH_P_ECONET: c_int = 0x0018;
1917pub const ETH_P_HDLC: c_int = 0x0019;
1918pub const ETH_P_ARCNET: c_int = 0x001A;
1919pub const ETH_P_DSA: c_int = 0x001B;
1920pub const ETH_P_TRAILER: c_int = 0x001C;
1921pub const ETH_P_PHONET: c_int = 0x00F5;
1922pub const ETH_P_IEEE802154: c_int = 0x00F6;
1923pub const ETH_P_CAIF: c_int = 0x00F7;
1924
1925pub const POSIX_SPAWN_RESETIDS: c_int = 0x01;
1927pub const POSIX_SPAWN_SETPGROUP: c_int = 0x02;
1928pub const POSIX_SPAWN_SETSIGDEF: c_int = 0x04;
1929pub const POSIX_SPAWN_SETSIGMASK: c_int = 0x08;
1930pub const POSIX_SPAWN_SETSCHEDPARAM: c_int = 0x10;
1931pub const POSIX_SPAWN_SETSCHEDULER: c_int = 0x20;
1932
1933pub const NFNLGRP_NONE: c_int = 0;
1935pub const NFNLGRP_CONNTRACK_NEW: c_int = 1;
1936pub const NFNLGRP_CONNTRACK_UPDATE: c_int = 2;
1937pub const NFNLGRP_CONNTRACK_DESTROY: c_int = 3;
1938pub const NFNLGRP_CONNTRACK_EXP_NEW: c_int = 4;
1939pub const NFNLGRP_CONNTRACK_EXP_UPDATE: c_int = 5;
1940pub const NFNLGRP_CONNTRACK_EXP_DESTROY: c_int = 6;
1941pub const NFNLGRP_NFTABLES: c_int = 7;
1942pub const NFNLGRP_ACCT_QUOTA: c_int = 8;
1943pub const NFNLGRP_NFTRACE: c_int = 9;
1944
1945pub const NFNETLINK_V0: c_int = 0;
1946
1947pub const NFNL_SUBSYS_NONE: c_int = 0;
1948pub const NFNL_SUBSYS_CTNETLINK: c_int = 1;
1949pub const NFNL_SUBSYS_CTNETLINK_EXP: c_int = 2;
1950pub const NFNL_SUBSYS_QUEUE: c_int = 3;
1951pub const NFNL_SUBSYS_ULOG: c_int = 4;
1952pub const NFNL_SUBSYS_OSF: c_int = 5;
1953pub const NFNL_SUBSYS_IPSET: c_int = 6;
1954pub const NFNL_SUBSYS_ACCT: c_int = 7;
1955pub const NFNL_SUBSYS_CTNETLINK_TIMEOUT: c_int = 8;
1956pub const NFNL_SUBSYS_CTHELPER: c_int = 9;
1957pub const NFNL_SUBSYS_NFTABLES: c_int = 10;
1958pub const NFNL_SUBSYS_NFT_COMPAT: c_int = 11;
1959pub const NFNL_SUBSYS_HOOK: c_int = 12;
1960pub const NFNL_SUBSYS_COUNT: c_int = 13;
1961
1962pub const NFNL_MSG_BATCH_BEGIN: c_int = crate::NLMSG_MIN_TYPE;
1963pub const NFNL_MSG_BATCH_END: c_int = crate::NLMSG_MIN_TYPE + 1;
1964
1965pub const NFNL_BATCH_UNSPEC: c_int = 0;
1966pub const NFNL_BATCH_GENID: c_int = 1;
1967
1968pub const NFULNL_MSG_PACKET: c_int = 0;
1970pub const NFULNL_MSG_CONFIG: c_int = 1;
1971
1972pub const NFULA_VLAN_UNSPEC: c_int = 0;
1973pub const NFULA_VLAN_PROTO: c_int = 1;
1974pub const NFULA_VLAN_TCI: c_int = 2;
1975
1976pub const NFULA_UNSPEC: c_int = 0;
1977pub const NFULA_PACKET_HDR: c_int = 1;
1978pub const NFULA_MARK: c_int = 2;
1979pub const NFULA_TIMESTAMP: c_int = 3;
1980pub const NFULA_IFINDEX_INDEV: c_int = 4;
1981pub const NFULA_IFINDEX_OUTDEV: c_int = 5;
1982pub const NFULA_IFINDEX_PHYSINDEV: c_int = 6;
1983pub const NFULA_IFINDEX_PHYSOUTDEV: c_int = 7;
1984pub const NFULA_HWADDR: c_int = 8;
1985pub const NFULA_PAYLOAD: c_int = 9;
1986pub const NFULA_PREFIX: c_int = 10;
1987pub const NFULA_UID: c_int = 11;
1988pub const NFULA_SEQ: c_int = 12;
1989pub const NFULA_SEQ_GLOBAL: c_int = 13;
1990pub const NFULA_GID: c_int = 14;
1991pub const NFULA_HWTYPE: c_int = 15;
1992pub const NFULA_HWHEADER: c_int = 16;
1993pub const NFULA_HWLEN: c_int = 17;
1994pub const NFULA_CT: c_int = 18;
1995pub const NFULA_CT_INFO: c_int = 19;
1996pub const NFULA_VLAN: c_int = 20;
1997pub const NFULA_L2HDR: c_int = 21;
1998
1999pub const NFULNL_CFG_CMD_NONE: c_int = 0;
2000pub const NFULNL_CFG_CMD_BIND: c_int = 1;
2001pub const NFULNL_CFG_CMD_UNBIND: c_int = 2;
2002pub const NFULNL_CFG_CMD_PF_BIND: c_int = 3;
2003pub const NFULNL_CFG_CMD_PF_UNBIND: c_int = 4;
2004
2005pub const NFULA_CFG_UNSPEC: c_int = 0;
2006pub const NFULA_CFG_CMD: c_int = 1;
2007pub const NFULA_CFG_MODE: c_int = 2;
2008pub const NFULA_CFG_NLBUFSIZ: c_int = 3;
2009pub const NFULA_CFG_TIMEOUT: c_int = 4;
2010pub const NFULA_CFG_QTHRESH: c_int = 5;
2011pub const NFULA_CFG_FLAGS: c_int = 6;
2012
2013pub const NFULNL_COPY_NONE: c_int = 0x00;
2014pub const NFULNL_COPY_META: c_int = 0x01;
2015pub const NFULNL_COPY_PACKET: c_int = 0x02;
2016
2017pub const NFULNL_CFG_F_SEQ: c_int = 0x0001;
2018pub const NFULNL_CFG_F_SEQ_GLOBAL: c_int = 0x0002;
2019pub const NFULNL_CFG_F_CONNTRACK: c_int = 0x0004;
2020
2021pub const NFQNL_MSG_PACKET: c_int = 0;
2023pub const NFQNL_MSG_VERDICT: c_int = 1;
2024pub const NFQNL_MSG_CONFIG: c_int = 2;
2025pub const NFQNL_MSG_VERDICT_BATCH: c_int = 3;
2026
2027pub const NFQA_UNSPEC: c_int = 0;
2028pub const NFQA_PACKET_HDR: c_int = 1;
2029pub const NFQA_VERDICT_HDR: c_int = 2;
2030pub const NFQA_MARK: c_int = 3;
2031pub const NFQA_TIMESTAMP: c_int = 4;
2032pub const NFQA_IFINDEX_INDEV: c_int = 5;
2033pub const NFQA_IFINDEX_OUTDEV: c_int = 6;
2034pub const NFQA_IFINDEX_PHYSINDEV: c_int = 7;
2035pub const NFQA_IFINDEX_PHYSOUTDEV: c_int = 8;
2036pub const NFQA_HWADDR: c_int = 9;
2037pub const NFQA_PAYLOAD: c_int = 10;
2038pub const NFQA_CT: c_int = 11;
2039pub const NFQA_CT_INFO: c_int = 12;
2040pub const NFQA_CAP_LEN: c_int = 13;
2041pub const NFQA_SKB_INFO: c_int = 14;
2042pub const NFQA_EXP: c_int = 15;
2043pub const NFQA_UID: c_int = 16;
2044pub const NFQA_GID: c_int = 17;
2045pub const NFQA_SECCTX: c_int = 18;
2046pub const NFQA_VLAN: c_int = 19;
2047pub const NFQA_L2HDR: c_int = 20;
2048pub const NFQA_PRIORITY: c_int = 21;
2049
2050pub const NFQA_VLAN_UNSPEC: c_int = 0;
2051pub const NFQA_VLAN_PROTO: c_int = 1;
2052pub const NFQA_VLAN_TCI: c_int = 2;
2053
2054pub const NFQNL_CFG_CMD_NONE: c_int = 0;
2055pub const NFQNL_CFG_CMD_BIND: c_int = 1;
2056pub const NFQNL_CFG_CMD_UNBIND: c_int = 2;
2057pub const NFQNL_CFG_CMD_PF_BIND: c_int = 3;
2058pub const NFQNL_CFG_CMD_PF_UNBIND: c_int = 4;
2059
2060pub const NFQNL_COPY_NONE: c_int = 0;
2061pub const NFQNL_COPY_META: c_int = 1;
2062pub const NFQNL_COPY_PACKET: c_int = 2;
2063
2064pub const NFQA_CFG_UNSPEC: c_int = 0;
2065pub const NFQA_CFG_CMD: c_int = 1;
2066pub const NFQA_CFG_PARAMS: c_int = 2;
2067pub const NFQA_CFG_QUEUE_MAXLEN: c_int = 3;
2068pub const NFQA_CFG_MASK: c_int = 4;
2069pub const NFQA_CFG_FLAGS: c_int = 5;
2070
2071pub const NFQA_CFG_F_FAIL_OPEN: c_int = 0x0001;
2072pub const NFQA_CFG_F_CONNTRACK: c_int = 0x0002;
2073pub const NFQA_CFG_F_GSO: c_int = 0x0004;
2074pub const NFQA_CFG_F_UID_GID: c_int = 0x0008;
2075pub const NFQA_CFG_F_SECCTX: c_int = 0x0010;
2076pub const NFQA_CFG_F_MAX: c_int = 0x0020;
2077
2078pub const NFQA_SKB_CSUMNOTREADY: c_int = 0x0001;
2079pub const NFQA_SKB_GSO: c_int = 0x0002;
2080pub const NFQA_SKB_CSUM_NOTVERIFIED: c_int = 0x0004;
2081
2082pub const GENL_NAMSIZ: c_int = 16;
2085
2086pub const GENL_MIN_ID: c_int = crate::NLMSG_MIN_TYPE;
2087pub const GENL_MAX_ID: c_int = 1023;
2088
2089pub const GENL_ADMIN_PERM: c_int = 0x01;
2090pub const GENL_CMD_CAP_DO: c_int = 0x02;
2091pub const GENL_CMD_CAP_DUMP: c_int = 0x04;
2092pub const GENL_CMD_CAP_HASPOL: c_int = 0x08;
2093
2094pub const GENL_ID_CTRL: c_int = crate::NLMSG_MIN_TYPE;
2095
2096pub const CTRL_CMD_UNSPEC: c_int = 0;
2097pub const CTRL_CMD_NEWFAMILY: c_int = 1;
2098pub const CTRL_CMD_DELFAMILY: c_int = 2;
2099pub const CTRL_CMD_GETFAMILY: c_int = 3;
2100pub const CTRL_CMD_NEWOPS: c_int = 4;
2101pub const CTRL_CMD_DELOPS: c_int = 5;
2102pub const CTRL_CMD_GETOPS: c_int = 6;
2103pub const CTRL_CMD_NEWMCAST_GRP: c_int = 7;
2104pub const CTRL_CMD_DELMCAST_GRP: c_int = 8;
2105pub const CTRL_CMD_GETMCAST_GRP: c_int = 9;
2106
2107pub const CTRL_ATTR_UNSPEC: c_int = 0;
2108pub const CTRL_ATTR_FAMILY_ID: c_int = 1;
2109pub const CTRL_ATTR_FAMILY_NAME: c_int = 2;
2110pub const CTRL_ATTR_VERSION: c_int = 3;
2111pub const CTRL_ATTR_HDRSIZE: c_int = 4;
2112pub const CTRL_ATTR_MAXATTR: c_int = 5;
2113pub const CTRL_ATTR_OPS: c_int = 6;
2114pub const CTRL_ATTR_MCAST_GROUPS: c_int = 7;
2115
2116pub const CTRL_ATTR_OP_UNSPEC: c_int = 0;
2117pub const CTRL_ATTR_OP_ID: c_int = 1;
2118pub const CTRL_ATTR_OP_FLAGS: c_int = 2;
2119
2120pub const CTRL_ATTR_MCAST_GRP_UNSPEC: c_int = 0;
2121pub const CTRL_ATTR_MCAST_GRP_NAME: c_int = 1;
2122pub const CTRL_ATTR_MCAST_GRP_ID: c_int = 2;
2123
2124pub const PACKET_FANOUT: c_int = 18;
2125pub const PACKET_TX_HAS_OFF: c_int = 19;
2126pub const PACKET_QDISC_BYPASS: c_int = 20;
2127pub const PACKET_ROLLOVER_STATS: c_int = 21;
2128pub const PACKET_FANOUT_DATA: c_int = 22;
2129pub const PACKET_IGNORE_OUTGOING: c_int = 23;
2130pub const PACKET_VNET_HDR_SZ: c_int = 24;
2131
2132pub const PACKET_FANOUT_HASH: c_uint = 0;
2133pub const PACKET_FANOUT_LB: c_uint = 1;
2134pub const PACKET_FANOUT_CPU: c_uint = 2;
2135pub const PACKET_FANOUT_ROLLOVER: c_uint = 3;
2136pub const PACKET_FANOUT_RND: c_uint = 4;
2137pub const PACKET_FANOUT_QM: c_uint = 5;
2138pub const PACKET_FANOUT_CBPF: c_uint = 6;
2139pub const PACKET_FANOUT_EBPF: c_uint = 7;
2140pub const PACKET_FANOUT_FLAG_ROLLOVER: c_uint = 0x1000;
2141pub const PACKET_FANOUT_FLAG_UNIQUEID: c_uint = 0x2000;
2142pub const PACKET_FANOUT_FLAG_IGNORE_OUTGOING: c_uint = 0x4000;
2143pub const PACKET_FANOUT_FLAG_DEFRAG: c_uint = 0x8000;
2144
2145pub const TP_STATUS_KERNEL: __u32 = 0;
2146pub const TP_STATUS_USER: __u32 = 1 << 0;
2147pub const TP_STATUS_COPY: __u32 = 1 << 1;
2148pub const TP_STATUS_LOSING: __u32 = 1 << 2;
2149pub const TP_STATUS_CSUMNOTREADY: __u32 = 1 << 3;
2150pub const TP_STATUS_VLAN_VALID: __u32 = 1 << 4;
2151pub const TP_STATUS_BLK_TMO: __u32 = 1 << 5;
2152pub const TP_STATUS_VLAN_TPID_VALID: __u32 = 1 << 6;
2153pub const TP_STATUS_CSUM_VALID: __u32 = 1 << 7;
2154
2155pub const TP_STATUS_AVAILABLE: __u32 = 0;
2156pub const TP_STATUS_SEND_REQUEST: __u32 = 1 << 0;
2157pub const TP_STATUS_SENDING: __u32 = 1 << 1;
2158pub const TP_STATUS_WRONG_FORMAT: __u32 = 1 << 2;
2159
2160pub const TP_STATUS_TS_SOFTWARE: __u32 = 1 << 29;
2161pub const TP_STATUS_TS_SYS_HARDWARE: __u32 = 1 << 30;
2162pub const TP_STATUS_TS_RAW_HARDWARE: __u32 = 1 << 31;
2163
2164pub const TP_FT_REQ_FILL_RXHASH: __u32 = 1;
2165
2166pub const TPACKET_ALIGNMENT: usize = 16;
2167
2168pub const TPACKET_HDRLEN: usize = ((size_of::<crate::tpacket_hdr>() + TPACKET_ALIGNMENT - 1)
2169 & !(TPACKET_ALIGNMENT - 1))
2170 + size_of::<crate::sockaddr_ll>();
2171pub const TPACKET2_HDRLEN: usize = ((size_of::<crate::tpacket2_hdr>() + TPACKET_ALIGNMENT - 1)
2172 & !(TPACKET_ALIGNMENT - 1))
2173 + size_of::<crate::sockaddr_ll>();
2174pub const TPACKET3_HDRLEN: usize = ((size_of::<crate::tpacket3_hdr>() + TPACKET_ALIGNMENT - 1)
2175 & !(TPACKET_ALIGNMENT - 1))
2176 + size_of::<crate::sockaddr_ll>();
2177
2178pub const NF_DROP: c_int = 0;
2180pub const NF_ACCEPT: c_int = 1;
2181pub const NF_STOLEN: c_int = 2;
2182pub const NF_QUEUE: c_int = 3;
2183pub const NF_REPEAT: c_int = 4;
2184pub const NF_STOP: c_int = 5;
2185pub const NF_MAX_VERDICT: c_int = NF_STOP;
2186
2187pub const NF_VERDICT_MASK: c_int = 0x000000ff;
2188pub const NF_VERDICT_FLAG_QUEUE_BYPASS: c_int = 0x00008000;
2189
2190pub const NF_VERDICT_QMASK: c_int = 0xffff0000;
2191pub const NF_VERDICT_QBITS: c_int = 16;
2192
2193pub const NF_VERDICT_BITS: c_int = 16;
2194
2195pub const NF_INET_PRE_ROUTING: c_int = 0;
2196pub const NF_INET_LOCAL_IN: c_int = 1;
2197pub const NF_INET_FORWARD: c_int = 2;
2198pub const NF_INET_LOCAL_OUT: c_int = 3;
2199pub const NF_INET_POST_ROUTING: c_int = 4;
2200pub const NF_INET_NUMHOOKS: c_int = 5;
2201pub const NF_INET_INGRESS: c_int = NF_INET_NUMHOOKS;
2202
2203pub const NF_NETDEV_INGRESS: c_int = 0;
2204pub const NF_NETDEV_EGRESS: c_int = 1;
2205pub const NF_NETDEV_NUMHOOKS: c_int = 2;
2206
2207pub const NFPROTO_UNSPEC: c_int = 0;
2209pub const NFPROTO_INET: c_int = 1;
2210pub const NFPROTO_IPV4: c_int = 2;
2211pub const NFPROTO_ARP: c_int = 3;
2212pub const NFPROTO_NETDEV: c_int = 5;
2213pub const NFPROTO_BRIDGE: c_int = 7;
2214pub const NFPROTO_IPV6: c_int = 10;
2215pub const NFPROTO_DECNET: c_int = 12;
2216pub const NFPROTO_NUMPROTO: c_int = 13;
2217
2218pub const NF_ARP: c_int = 0;
2220pub const NF_ARP_IN: c_int = 0;
2221pub const NF_ARP_OUT: c_int = 1;
2222pub const NF_ARP_FORWARD: c_int = 2;
2223pub const NF_ARP_NUMHOOKS: c_int = 3;
2224
2225pub const NF_BR_PRE_ROUTING: c_int = 0;
2227pub const NF_BR_LOCAL_IN: c_int = 1;
2228pub const NF_BR_FORWARD: c_int = 2;
2229pub const NF_BR_LOCAL_OUT: c_int = 3;
2230pub const NF_BR_POST_ROUTING: c_int = 4;
2231pub const NF_BR_BROUTING: c_int = 5;
2232pub const NF_BR_NUMHOOKS: c_int = 6;
2233
2234pub const NF_BR_PRI_FIRST: c_int = crate::INT_MIN;
2235pub const NF_BR_PRI_NAT_DST_BRIDGED: c_int = -300;
2236pub const NF_BR_PRI_FILTER_BRIDGED: c_int = -200;
2237pub const NF_BR_PRI_BRNF: c_int = 0;
2238pub const NF_BR_PRI_NAT_DST_OTHER: c_int = 100;
2239pub const NF_BR_PRI_FILTER_OTHER: c_int = 200;
2240pub const NF_BR_PRI_NAT_SRC: c_int = 300;
2241pub const NF_BR_PRI_LAST: c_int = crate::INT_MAX;
2242
2243pub const NF_IP_PRE_ROUTING: c_int = 0;
2245pub const NF_IP_LOCAL_IN: c_int = 1;
2246pub const NF_IP_FORWARD: c_int = 2;
2247pub const NF_IP_LOCAL_OUT: c_int = 3;
2248pub const NF_IP_POST_ROUTING: c_int = 4;
2249pub const NF_IP_NUMHOOKS: c_int = 5;
2250
2251pub const NF_IP_PRI_FIRST: c_int = crate::INT_MIN;
2252pub const NF_IP_PRI_RAW_BEFORE_DEFRAG: c_int = -450;
2253pub const NF_IP_PRI_CONNTRACK_DEFRAG: c_int = -400;
2254pub const NF_IP_PRI_RAW: c_int = -300;
2255pub const NF_IP_PRI_SELINUX_FIRST: c_int = -225;
2256pub const NF_IP_PRI_CONNTRACK: c_int = -200;
2257pub const NF_IP_PRI_MANGLE: c_int = -150;
2258pub const NF_IP_PRI_NAT_DST: c_int = -100;
2259pub const NF_IP_PRI_FILTER: c_int = 0;
2260pub const NF_IP_PRI_SECURITY: c_int = 50;
2261pub const NF_IP_PRI_NAT_SRC: c_int = 100;
2262pub const NF_IP_PRI_SELINUX_LAST: c_int = 225;
2263pub const NF_IP_PRI_CONNTRACK_HELPER: c_int = 300;
2264pub const NF_IP_PRI_CONNTRACK_CONFIRM: c_int = crate::INT_MAX;
2265pub const NF_IP_PRI_LAST: c_int = crate::INT_MAX;
2266
2267pub const NF_IP6_PRE_ROUTING: c_int = 0;
2269pub const NF_IP6_LOCAL_IN: c_int = 1;
2270pub const NF_IP6_FORWARD: c_int = 2;
2271pub const NF_IP6_LOCAL_OUT: c_int = 3;
2272pub const NF_IP6_POST_ROUTING: c_int = 4;
2273pub const NF_IP6_NUMHOOKS: c_int = 5;
2274
2275pub const NF_IP6_PRI_FIRST: c_int = crate::INT_MIN;
2276pub const NF_IP6_PRI_RAW_BEFORE_DEFRAG: c_int = -450;
2277pub const NF_IP6_PRI_CONNTRACK_DEFRAG: c_int = -400;
2278pub const NF_IP6_PRI_RAW: c_int = -300;
2279pub const NF_IP6_PRI_SELINUX_FIRST: c_int = -225;
2280pub const NF_IP6_PRI_CONNTRACK: c_int = -200;
2281pub const NF_IP6_PRI_MANGLE: c_int = -150;
2282pub const NF_IP6_PRI_NAT_DST: c_int = -100;
2283pub const NF_IP6_PRI_FILTER: c_int = 0;
2284pub const NF_IP6_PRI_SECURITY: c_int = 50;
2285pub const NF_IP6_PRI_NAT_SRC: c_int = 100;
2286pub const NF_IP6_PRI_SELINUX_LAST: c_int = 225;
2287pub const NF_IP6_PRI_CONNTRACK_HELPER: c_int = 300;
2288pub const NF_IP6_PRI_LAST: c_int = crate::INT_MAX;
2289
2290pub const IP6T_SO_ORIGINAL_DST: c_int = 80;
2292
2293pub const SIOCSHWTSTAMP: c_ulong = 0x000089b0;
2294pub const SIOCGHWTSTAMP: c_ulong = 0x000089b1;
2295
2296pub const WIRELESS_EXT: c_ulong = 0x16;
2298
2299pub const SIOCSIWCOMMIT: c_ulong = 0x8B00;
2300pub const SIOCGIWNAME: c_ulong = 0x8B01;
2301
2302pub const SIOCSIWNWID: c_ulong = 0x8B02;
2303pub const SIOCGIWNWID: c_ulong = 0x8B03;
2304pub const SIOCSIWFREQ: c_ulong = 0x8B04;
2305pub const SIOCGIWFREQ: c_ulong = 0x8B05;
2306pub const SIOCSIWMODE: c_ulong = 0x8B06;
2307pub const SIOCGIWMODE: c_ulong = 0x8B07;
2308pub const SIOCSIWSENS: c_ulong = 0x8B08;
2309pub const SIOCGIWSENS: c_ulong = 0x8B09;
2310
2311pub const SIOCSIWRANGE: c_ulong = 0x8B0A;
2312pub const SIOCGIWRANGE: c_ulong = 0x8B0B;
2313pub const SIOCSIWPRIV: c_ulong = 0x8B0C;
2314pub const SIOCGIWPRIV: c_ulong = 0x8B0D;
2315pub const SIOCSIWSTATS: c_ulong = 0x8B0E;
2316pub const SIOCGIWSTATS: c_ulong = 0x8B0F;
2317
2318pub const SIOCSIWSPY: c_ulong = 0x8B10;
2319pub const SIOCGIWSPY: c_ulong = 0x8B11;
2320pub const SIOCSIWTHRSPY: c_ulong = 0x8B12;
2321pub const SIOCGIWTHRSPY: c_ulong = 0x8B13;
2322
2323pub const SIOCSIWAP: c_ulong = 0x8B14;
2324pub const SIOCGIWAP: c_ulong = 0x8B15;
2325pub const SIOCGIWAPLIST: c_ulong = 0x8B17;
2326pub const SIOCSIWSCAN: c_ulong = 0x8B18;
2327pub const SIOCGIWSCAN: c_ulong = 0x8B19;
2328
2329pub const SIOCSIWESSID: c_ulong = 0x8B1A;
2330pub const SIOCGIWESSID: c_ulong = 0x8B1B;
2331pub const SIOCSIWNICKN: c_ulong = 0x8B1C;
2332pub const SIOCGIWNICKN: c_ulong = 0x8B1D;
2333
2334pub const SIOCSIWRATE: c_ulong = 0x8B20;
2335pub const SIOCGIWRATE: c_ulong = 0x8B21;
2336pub const SIOCSIWRTS: c_ulong = 0x8B22;
2337pub const SIOCGIWRTS: c_ulong = 0x8B23;
2338pub const SIOCSIWFRAG: c_ulong = 0x8B24;
2339pub const SIOCGIWFRAG: c_ulong = 0x8B25;
2340pub const SIOCSIWTXPOW: c_ulong = 0x8B26;
2341pub const SIOCGIWTXPOW: c_ulong = 0x8B27;
2342pub const SIOCSIWRETRY: c_ulong = 0x8B28;
2343pub const SIOCGIWRETRY: c_ulong = 0x8B29;
2344
2345pub const SIOCSIWENCODE: c_ulong = 0x8B2A;
2346pub const SIOCGIWENCODE: c_ulong = 0x8B2B;
2347
2348pub const SIOCSIWPOWER: c_ulong = 0x8B2C;
2349pub const SIOCGIWPOWER: c_ulong = 0x8B2D;
2350
2351pub const SIOCSIWGENIE: c_ulong = 0x8B30;
2352pub const SIOCGIWGENIE: c_ulong = 0x8B31;
2353
2354pub const SIOCSIWMLME: c_ulong = 0x8B16;
2355
2356pub const SIOCSIWAUTH: c_ulong = 0x8B32;
2357pub const SIOCGIWAUTH: c_ulong = 0x8B33;
2358
2359pub const SIOCSIWENCODEEXT: c_ulong = 0x8B34;
2360pub const SIOCGIWENCODEEXT: c_ulong = 0x8B35;
2361
2362pub const SIOCSIWPMKSA: c_ulong = 0x8B36;
2363
2364pub const SIOCIWFIRSTPRIV: c_ulong = 0x8BE0;
2365pub const SIOCIWLASTPRIV: c_ulong = 0x8BFF;
2366
2367pub const SIOCIWFIRST: c_ulong = 0x8B00;
2368pub const SIOCIWLAST: c_ulong = SIOCIWLASTPRIV;
2369
2370pub const IWEVTXDROP: c_ulong = 0x8C00;
2371pub const IWEVQUAL: c_ulong = 0x8C01;
2372pub const IWEVCUSTOM: c_ulong = 0x8C02;
2373pub const IWEVREGISTERED: c_ulong = 0x8C03;
2374pub const IWEVEXPIRED: c_ulong = 0x8C04;
2375pub const IWEVGENIE: c_ulong = 0x8C05;
2376pub const IWEVMICHAELMICFAILURE: c_ulong = 0x8C06;
2377pub const IWEVASSOCREQIE: c_ulong = 0x8C07;
2378pub const IWEVASSOCRESPIE: c_ulong = 0x8C08;
2379pub const IWEVPMKIDCAND: c_ulong = 0x8C09;
2380pub const IWEVFIRST: c_ulong = 0x8C00;
2381
2382pub const IW_PRIV_TYPE_MASK: c_ulong = 0x7000;
2383pub const IW_PRIV_TYPE_NONE: c_ulong = 0x0000;
2384pub const IW_PRIV_TYPE_BYTE: c_ulong = 0x1000;
2385pub const IW_PRIV_TYPE_CHAR: c_ulong = 0x2000;
2386pub const IW_PRIV_TYPE_INT: c_ulong = 0x4000;
2387pub const IW_PRIV_TYPE_FLOAT: c_ulong = 0x5000;
2388pub const IW_PRIV_TYPE_ADDR: c_ulong = 0x6000;
2389
2390pub const IW_PRIV_SIZE_FIXED: c_ulong = 0x0800;
2391
2392pub const IW_PRIV_SIZE_MASK: c_ulong = 0x07FF;
2393
2394pub const IW_MAX_FREQUENCIES: usize = 32;
2395pub const IW_MAX_BITRATES: usize = 32;
2396pub const IW_MAX_TXPOWER: usize = 8;
2397pub const IW_MAX_SPY: usize = 8;
2398pub const IW_MAX_AP: usize = 64;
2399pub const IW_ESSID_MAX_SIZE: usize = 32;
2400
2401pub const IW_MODE_AUTO: usize = 0;
2402pub const IW_MODE_ADHOC: usize = 1;
2403pub const IW_MODE_INFRA: usize = 2;
2404pub const IW_MODE_MASTER: usize = 3;
2405pub const IW_MODE_REPEAT: usize = 4;
2406pub const IW_MODE_SECOND: usize = 5;
2407pub const IW_MODE_MONITOR: usize = 6;
2408pub const IW_MODE_MESH: usize = 7;
2409
2410pub const IW_QUAL_QUAL_UPDATED: c_ulong = 0x01;
2411pub const IW_QUAL_LEVEL_UPDATED: c_ulong = 0x02;
2412pub const IW_QUAL_NOISE_UPDATED: c_ulong = 0x04;
2413pub const IW_QUAL_ALL_UPDATED: c_ulong = 0x07;
2414pub const IW_QUAL_DBM: c_ulong = 0x08;
2415pub const IW_QUAL_QUAL_INVALID: c_ulong = 0x10;
2416pub const IW_QUAL_LEVEL_INVALID: c_ulong = 0x20;
2417pub const IW_QUAL_NOISE_INVALID: c_ulong = 0x40;
2418pub const IW_QUAL_RCPI: c_ulong = 0x80;
2419pub const IW_QUAL_ALL_INVALID: c_ulong = 0x70;
2420
2421pub const IW_FREQ_AUTO: c_ulong = 0x00;
2422pub const IW_FREQ_FIXED: c_ulong = 0x01;
2423
2424pub const IW_MAX_ENCODING_SIZES: usize = 8;
2425pub const IW_ENCODING_TOKEN_MAX: usize = 64;
2426
2427pub const IW_ENCODE_INDEX: c_ulong = 0x00FF;
2428pub const IW_ENCODE_FLAGS: c_ulong = 0xFF00;
2429pub const IW_ENCODE_MODE: c_ulong = 0xF000;
2430pub const IW_ENCODE_DISABLED: c_ulong = 0x8000;
2431pub const IW_ENCODE_ENABLED: c_ulong = 0x0000;
2432pub const IW_ENCODE_RESTRICTED: c_ulong = 0x4000;
2433pub const IW_ENCODE_OPEN: c_ulong = 0x2000;
2434pub const IW_ENCODE_NOKEY: c_ulong = 0x0800;
2435pub const IW_ENCODE_TEMP: c_ulong = 0x0400;
2436
2437pub const IW_POWER_ON: c_ulong = 0x0000;
2438pub const IW_POWER_TYPE: c_ulong = 0xF000;
2439pub const IW_POWER_PERIOD: c_ulong = 0x1000;
2440pub const IW_POWER_TIMEOUT: c_ulong = 0x2000;
2441pub const IW_POWER_MODE: c_ulong = 0x0F00;
2442pub const IW_POWER_UNICAST_R: c_ulong = 0x0100;
2443pub const IW_POWER_MULTICAST_R: c_ulong = 0x0200;
2444pub const IW_POWER_ALL_R: c_ulong = 0x0300;
2445pub const IW_POWER_FORCE_S: c_ulong = 0x0400;
2446pub const IW_POWER_REPEATER: c_ulong = 0x0800;
2447pub const IW_POWER_MODIFIER: c_ulong = 0x000F;
2448pub const IW_POWER_MIN: c_ulong = 0x0001;
2449pub const IW_POWER_MAX: c_ulong = 0x0002;
2450pub const IW_POWER_RELATIVE: c_ulong = 0x0004;
2451
2452pub const IW_TXPOW_TYPE: c_ulong = 0x00FF;
2453pub const IW_TXPOW_DBM: c_ulong = 0x0000;
2454pub const IW_TXPOW_MWATT: c_ulong = 0x0001;
2455pub const IW_TXPOW_RELATIVE: c_ulong = 0x0002;
2456pub const IW_TXPOW_RANGE: c_ulong = 0x1000;
2457
2458pub const IW_RETRY_ON: c_ulong = 0x0000;
2459pub const IW_RETRY_TYPE: c_ulong = 0xF000;
2460pub const IW_RETRY_LIMIT: c_ulong = 0x1000;
2461pub const IW_RETRY_LIFETIME: c_ulong = 0x2000;
2462pub const IW_RETRY_MODIFIER: c_ulong = 0x00FF;
2463pub const IW_RETRY_MIN: c_ulong = 0x0001;
2464pub const IW_RETRY_MAX: c_ulong = 0x0002;
2465pub const IW_RETRY_RELATIVE: c_ulong = 0x0004;
2466pub const IW_RETRY_SHORT: c_ulong = 0x0010;
2467pub const IW_RETRY_LONG: c_ulong = 0x0020;
2468
2469pub const IW_SCAN_DEFAULT: c_ulong = 0x0000;
2470pub const IW_SCAN_ALL_ESSID: c_ulong = 0x0001;
2471pub const IW_SCAN_THIS_ESSID: c_ulong = 0x0002;
2472pub const IW_SCAN_ALL_FREQ: c_ulong = 0x0004;
2473pub const IW_SCAN_THIS_FREQ: c_ulong = 0x0008;
2474pub const IW_SCAN_ALL_MODE: c_ulong = 0x0010;
2475pub const IW_SCAN_THIS_MODE: c_ulong = 0x0020;
2476pub const IW_SCAN_ALL_RATE: c_ulong = 0x0040;
2477pub const IW_SCAN_THIS_RATE: c_ulong = 0x0080;
2478
2479pub const IW_SCAN_TYPE_ACTIVE: usize = 0;
2480pub const IW_SCAN_TYPE_PASSIVE: usize = 1;
2481
2482pub const IW_SCAN_MAX_DATA: usize = 4096;
2483
2484pub const IW_SCAN_CAPA_NONE: c_ulong = 0x00;
2485pub const IW_SCAN_CAPA_ESSID: c_ulong = 0x01;
2486pub const IW_SCAN_CAPA_BSSID: c_ulong = 0x02;
2487pub const IW_SCAN_CAPA_CHANNEL: c_ulong = 0x04;
2488pub const IW_SCAN_CAPA_MODE: c_ulong = 0x08;
2489pub const IW_SCAN_CAPA_RATE: c_ulong = 0x10;
2490pub const IW_SCAN_CAPA_TYPE: c_ulong = 0x20;
2491pub const IW_SCAN_CAPA_TIME: c_ulong = 0x40;
2492
2493pub const IW_CUSTOM_MAX: c_ulong = 256;
2494
2495pub const IW_GENERIC_IE_MAX: c_ulong = 1024;
2496
2497pub const IW_MLME_DEAUTH: c_ulong = 0;
2498pub const IW_MLME_DISASSOC: c_ulong = 1;
2499pub const IW_MLME_AUTH: c_ulong = 2;
2500pub const IW_MLME_ASSOC: c_ulong = 3;
2501
2502pub const IW_AUTH_INDEX: c_ulong = 0x0FFF;
2503pub const IW_AUTH_FLAGS: c_ulong = 0xF000;
2504
2505pub const IW_AUTH_WPA_VERSION: usize = 0;
2506pub const IW_AUTH_CIPHER_PAIRWISE: usize = 1;
2507pub const IW_AUTH_CIPHER_GROUP: usize = 2;
2508pub const IW_AUTH_KEY_MGMT: usize = 3;
2509pub const IW_AUTH_TKIP_COUNTERMEASURES: usize = 4;
2510pub const IW_AUTH_DROP_UNENCRYPTED: usize = 5;
2511pub const IW_AUTH_80211_AUTH_ALG: usize = 6;
2512pub const IW_AUTH_WPA_ENABLED: usize = 7;
2513pub const IW_AUTH_RX_UNENCRYPTED_EAPOL: usize = 8;
2514pub const IW_AUTH_ROAMING_CONTROL: usize = 9;
2515pub const IW_AUTH_PRIVACY_INVOKED: usize = 10;
2516pub const IW_AUTH_CIPHER_GROUP_MGMT: usize = 11;
2517pub const IW_AUTH_MFP: usize = 12;
2518
2519pub const IW_AUTH_WPA_VERSION_DISABLED: c_ulong = 0x00000001;
2520pub const IW_AUTH_WPA_VERSION_WPA: c_ulong = 0x00000002;
2521pub const IW_AUTH_WPA_VERSION_WPA2: c_ulong = 0x00000004;
2522
2523pub const IW_AUTH_CIPHER_NONE: c_ulong = 0x00000001;
2524pub const IW_AUTH_CIPHER_WEP40: c_ulong = 0x00000002;
2525pub const IW_AUTH_CIPHER_TKIP: c_ulong = 0x00000004;
2526pub const IW_AUTH_CIPHER_CCMP: c_ulong = 0x00000008;
2527pub const IW_AUTH_CIPHER_WEP104: c_ulong = 0x00000010;
2528pub const IW_AUTH_CIPHER_AES_CMAC: c_ulong = 0x00000020;
2529
2530pub const IW_AUTH_KEY_MGMT_802_1X: usize = 1;
2531pub const IW_AUTH_KEY_MGMT_PSK: usize = 2;
2532
2533pub const IW_AUTH_ALG_OPEN_SYSTEM: c_ulong = 0x00000001;
2534pub const IW_AUTH_ALG_SHARED_KEY: c_ulong = 0x00000002;
2535pub const IW_AUTH_ALG_LEAP: c_ulong = 0x00000004;
2536
2537pub const IW_AUTH_ROAMING_ENABLE: usize = 0;
2538pub const IW_AUTH_ROAMING_DISABLE: usize = 1;
2539
2540pub const IW_AUTH_MFP_DISABLED: usize = 0;
2541pub const IW_AUTH_MFP_OPTIONAL: usize = 1;
2542pub const IW_AUTH_MFP_REQUIRED: usize = 2;
2543
2544pub const IW_ENCODE_SEQ_MAX_SIZE: usize = 8;
2545
2546pub const IW_ENCODE_ALG_NONE: usize = 0;
2547pub const IW_ENCODE_ALG_WEP: usize = 1;
2548pub const IW_ENCODE_ALG_TKIP: usize = 2;
2549pub const IW_ENCODE_ALG_CCMP: usize = 3;
2550pub const IW_ENCODE_ALG_PMK: usize = 4;
2551pub const IW_ENCODE_ALG_AES_CMAC: usize = 5;
2552
2553pub const IW_ENCODE_EXT_TX_SEQ_VALID: c_ulong = 0x00000001;
2554pub const IW_ENCODE_EXT_RX_SEQ_VALID: c_ulong = 0x00000002;
2555pub const IW_ENCODE_EXT_GROUP_KEY: c_ulong = 0x00000004;
2556pub const IW_ENCODE_EXT_SET_TX_KEY: c_ulong = 0x00000008;
2557
2558pub const IW_MICFAILURE_KEY_ID: c_ulong = 0x00000003;
2559pub const IW_MICFAILURE_GROUP: c_ulong = 0x00000004;
2560pub const IW_MICFAILURE_PAIRWISE: c_ulong = 0x00000008;
2561pub const IW_MICFAILURE_STAKEY: c_ulong = 0x00000010;
2562pub const IW_MICFAILURE_COUNT: c_ulong = 0x00000060;
2563
2564pub const IW_ENC_CAPA_WPA: c_ulong = 0x00000001;
2565pub const IW_ENC_CAPA_WPA2: c_ulong = 0x00000002;
2566pub const IW_ENC_CAPA_CIPHER_TKIP: c_ulong = 0x00000004;
2567pub const IW_ENC_CAPA_CIPHER_CCMP: c_ulong = 0x00000008;
2568pub const IW_ENC_CAPA_4WAY_HANDSHAKE: c_ulong = 0x00000010;
2569
2570pub const IW_EVENT_CAPA_K_0: c_ulong = 0x4000050; pub const IW_EVENT_CAPA_K_1: c_ulong = 0x400; pub const IW_PMKSA_ADD: usize = 1;
2574pub const IW_PMKSA_REMOVE: usize = 2;
2575pub const IW_PMKSA_FLUSH: usize = 3;
2576
2577pub const IW_PMKID_LEN: usize = 16;
2578
2579pub const IW_PMKID_CAND_PREAUTH: c_ulong = 0x00000001;
2580
2581pub const IW_EV_LCP_PK_LEN: usize = 4;
2582
2583pub const IW_EV_CHAR_PK_LEN: usize = 20; pub const IW_EV_UINT_PK_LEN: usize = 8; pub const IW_EV_FREQ_PK_LEN: usize = 12; pub const IW_EV_PARAM_PK_LEN: usize = 12; pub const IW_EV_ADDR_PK_LEN: usize = 20; pub const IW_EV_QUAL_PK_LEN: usize = 8; pub const IW_EV_POINT_PK_LEN: usize = 8; pub const NUD_NONE: u16 = 0x00;
2593pub const NUD_INCOMPLETE: u16 = 0x01;
2594pub const NUD_REACHABLE: u16 = 0x02;
2595pub const NUD_STALE: u16 = 0x04;
2596pub const NUD_DELAY: u16 = 0x08;
2597pub const NUD_PROBE: u16 = 0x10;
2598pub const NUD_FAILED: u16 = 0x20;
2599pub const NUD_NOARP: u16 = 0x40;
2600pub const NUD_PERMANENT: u16 = 0x80;
2601
2602pub const NTF_USE: u8 = 0x01;
2603pub const NTF_SELF: u8 = 0x02;
2604pub const NTF_MASTER: u8 = 0x04;
2605pub const NTF_PROXY: u8 = 0x08;
2606pub const NTF_ROUTER: u8 = 0x80;
2607
2608pub const NDA_UNSPEC: c_ushort = 0;
2609pub const NDA_DST: c_ushort = 1;
2610pub const NDA_LLADDR: c_ushort = 2;
2611pub const NDA_CACHEINFO: c_ushort = 3;
2612pub const NDA_PROBES: c_ushort = 4;
2613pub const NDA_VLAN: c_ushort = 5;
2614pub const NDA_PORT: c_ushort = 6;
2615pub const NDA_VNI: c_ushort = 7;
2616pub const NDA_IFINDEX: c_ushort = 8;
2617
2618pub const NLM_F_BULK: c_int = 0x200;
2621
2622pub const TCA_UNSPEC: c_ushort = 0;
2624pub const TCA_KIND: c_ushort = 1;
2625pub const TCA_OPTIONS: c_ushort = 2;
2626pub const TCA_STATS: c_ushort = 3;
2627pub const TCA_XSTATS: c_ushort = 4;
2628pub const TCA_RATE: c_ushort = 5;
2629pub const TCA_FCNT: c_ushort = 6;
2630pub const TCA_STATS2: c_ushort = 7;
2631pub const TCA_STAB: c_ushort = 8;
2632
2633pub const RTM_NEWLINK: u16 = 16;
2634pub const RTM_DELLINK: u16 = 17;
2635pub const RTM_GETLINK: u16 = 18;
2636pub const RTM_SETLINK: u16 = 19;
2637pub const RTM_NEWADDR: u16 = 20;
2638pub const RTM_DELADDR: u16 = 21;
2639pub const RTM_GETADDR: u16 = 22;
2640pub const RTM_NEWROUTE: u16 = 24;
2641pub const RTM_DELROUTE: u16 = 25;
2642pub const RTM_GETROUTE: u16 = 26;
2643pub const RTM_NEWNEIGH: u16 = 28;
2644pub const RTM_DELNEIGH: u16 = 29;
2645pub const RTM_GETNEIGH: u16 = 30;
2646pub const RTM_NEWRULE: u16 = 32;
2647pub const RTM_DELRULE: u16 = 33;
2648pub const RTM_GETRULE: u16 = 34;
2649pub const RTM_NEWQDISC: u16 = 36;
2650pub const RTM_DELQDISC: u16 = 37;
2651pub const RTM_GETQDISC: u16 = 38;
2652pub const RTM_NEWTCLASS: u16 = 40;
2653pub const RTM_DELTCLASS: u16 = 41;
2654pub const RTM_GETTCLASS: u16 = 42;
2655pub const RTM_NEWTFILTER: u16 = 44;
2656pub const RTM_DELTFILTER: u16 = 45;
2657pub const RTM_GETTFILTER: u16 = 46;
2658pub const RTM_NEWACTION: u16 = 48;
2659pub const RTM_DELACTION: u16 = 49;
2660pub const RTM_GETACTION: u16 = 50;
2661pub const RTM_NEWPREFIX: u16 = 52;
2662pub const RTM_GETMULTICAST: u16 = 58;
2663pub const RTM_GETANYCAST: u16 = 62;
2664pub const RTM_NEWNEIGHTBL: u16 = 64;
2665pub const RTM_GETNEIGHTBL: u16 = 66;
2666pub const RTM_SETNEIGHTBL: u16 = 67;
2667pub const RTM_NEWNDUSEROPT: u16 = 68;
2668pub const RTM_NEWADDRLABEL: u16 = 72;
2669pub const RTM_DELADDRLABEL: u16 = 73;
2670pub const RTM_GETADDRLABEL: u16 = 74;
2671pub const RTM_GETDCB: u16 = 78;
2672pub const RTM_SETDCB: u16 = 79;
2673pub const RTM_NEWNETCONF: u16 = 80;
2674pub const RTM_GETNETCONF: u16 = 82;
2675pub const RTM_NEWMDB: u16 = 84;
2676pub const RTM_DELMDB: u16 = 85;
2677pub const RTM_GETMDB: u16 = 86;
2678pub const RTM_NEWNSID: u16 = 88;
2679pub const RTM_DELNSID: u16 = 89;
2680pub const RTM_GETNSID: u16 = 90;
2681
2682pub const RTM_F_NOTIFY: c_uint = 0x100;
2683pub const RTM_F_CLONED: c_uint = 0x200;
2684pub const RTM_F_EQUALIZE: c_uint = 0x400;
2685pub const RTM_F_PREFIX: c_uint = 0x800;
2686
2687pub const RTA_UNSPEC: c_ushort = 0;
2688pub const RTA_DST: c_ushort = 1;
2689pub const RTA_SRC: c_ushort = 2;
2690pub const RTA_IIF: c_ushort = 3;
2691pub const RTA_OIF: c_ushort = 4;
2692pub const RTA_GATEWAY: c_ushort = 5;
2693pub const RTA_PRIORITY: c_ushort = 6;
2694pub const RTA_PREFSRC: c_ushort = 7;
2695pub const RTA_METRICS: c_ushort = 8;
2696pub const RTA_MULTIPATH: c_ushort = 9;
2697pub const RTA_PROTOINFO: c_ushort = 10; pub const RTA_FLOW: c_ushort = 11;
2699pub const RTA_CACHEINFO: c_ushort = 12;
2700pub const RTA_SESSION: c_ushort = 13; pub const RTA_MP_ALGO: c_ushort = 14; pub const RTA_TABLE: c_ushort = 15;
2703pub const RTA_MARK: c_ushort = 16;
2704pub const RTA_MFC_STATS: c_ushort = 17;
2705
2706pub const RTN_UNSPEC: c_uchar = 0;
2707pub const RTN_UNICAST: c_uchar = 1;
2708pub const RTN_LOCAL: c_uchar = 2;
2709pub const RTN_BROADCAST: c_uchar = 3;
2710pub const RTN_ANYCAST: c_uchar = 4;
2711pub const RTN_MULTICAST: c_uchar = 5;
2712pub const RTN_BLACKHOLE: c_uchar = 6;
2713pub const RTN_UNREACHABLE: c_uchar = 7;
2714pub const RTN_PROHIBIT: c_uchar = 8;
2715pub const RTN_THROW: c_uchar = 9;
2716pub const RTN_NAT: c_uchar = 10;
2717pub const RTN_XRESOLVE: c_uchar = 11;
2718
2719pub const RTPROT_UNSPEC: c_uchar = 0;
2720pub const RTPROT_REDIRECT: c_uchar = 1;
2721pub const RTPROT_KERNEL: c_uchar = 2;
2722pub const RTPROT_BOOT: c_uchar = 3;
2723pub const RTPROT_STATIC: c_uchar = 4;
2724
2725pub const RT_SCOPE_UNIVERSE: c_uchar = 0;
2726pub const RT_SCOPE_SITE: c_uchar = 200;
2727pub const RT_SCOPE_LINK: c_uchar = 253;
2728pub const RT_SCOPE_HOST: c_uchar = 254;
2729pub const RT_SCOPE_NOWHERE: c_uchar = 255;
2730
2731pub const RT_TABLE_UNSPEC: c_uchar = 0;
2732pub const RT_TABLE_COMPAT: c_uchar = 252;
2733pub const RT_TABLE_DEFAULT: c_uchar = 253;
2734pub const RT_TABLE_MAIN: c_uchar = 254;
2735pub const RT_TABLE_LOCAL: c_uchar = 255;
2736
2737pub const RTMSG_OVERRUN: u32 = crate::NLMSG_OVERRUN as u32;
2738pub const RTMSG_NEWDEVICE: u32 = 0x11;
2739pub const RTMSG_DELDEVICE: u32 = 0x12;
2740pub const RTMSG_NEWROUTE: u32 = 0x21;
2741pub const RTMSG_DELROUTE: u32 = 0x22;
2742pub const RTMSG_NEWRULE: u32 = 0x31;
2743pub const RTMSG_DELRULE: u32 = 0x32;
2744pub const RTMSG_CONTROL: u32 = 0x40;
2745pub const RTMSG_AR_FAILED: u32 = 0x51;
2746
2747pub const RTEXT_FILTER_VF: c_int = 1 << 0;
2748pub const RTEXT_FILTER_BRVLAN: c_int = 1 << 1;
2749pub const RTEXT_FILTER_BRVLAN_COMPRESSED: c_int = 1 << 2;
2750pub const RTEXT_FILTER_SKIP_STATS: c_int = 1 << 3;
2751pub const RTEXT_FILTER_MRP: c_int = 1 << 4;
2752pub const RTEXT_FILTER_CFM_CONFIG: c_int = 1 << 5;
2753pub const RTEXT_FILTER_CFM_STATUS: c_int = 1 << 6;
2754
2755pub const RTMGRP_LINK: c_int = 0x00001;
2757pub const RTMGRP_NOTIFY: c_int = 0x00002;
2758pub const RTMGRP_NEIGH: c_int = 0x00004;
2759pub const RTMGRP_TC: c_int = 0x00008;
2760pub const RTMGRP_IPV4_IFADDR: c_int = 0x00010;
2761pub const RTMGRP_IPV4_MROUTE: c_int = 0x00020;
2762pub const RTMGRP_IPV4_ROUTE: c_int = 0x00040;
2763pub const RTMGRP_IPV4_RULE: c_int = 0x00080;
2764pub const RTMGRP_IPV6_IFADDR: c_int = 0x00100;
2765pub const RTMGRP_IPV6_MROUTE: c_int = 0x00200;
2766pub const RTMGRP_IPV6_ROUTE: c_int = 0x00400;
2767pub const RTMGRP_IPV6_IFINFO: c_int = 0x00800;
2768pub const RTMGRP_DECnet_IFADDR: c_int = 0x01000;
2769pub const RTMGRP_DECnet_ROUTE: c_int = 0x04000;
2770pub const RTMGRP_IPV6_PREFIX: c_int = 0x20000;
2771
2772pub const RTNLGRP_NONE: c_uint = 0x00;
2774pub const RTNLGRP_LINK: c_uint = 0x01;
2775pub const RTNLGRP_NOTIFY: c_uint = 0x02;
2776pub const RTNLGRP_NEIGH: c_uint = 0x03;
2777pub const RTNLGRP_TC: c_uint = 0x04;
2778pub const RTNLGRP_IPV4_IFADDR: c_uint = 0x05;
2779pub const RTNLGRP_IPV4_MROUTE: c_uint = 0x06;
2780pub const RTNLGRP_IPV4_ROUTE: c_uint = 0x07;
2781pub const RTNLGRP_IPV4_RULE: c_uint = 0x08;
2782pub const RTNLGRP_IPV6_IFADDR: c_uint = 0x09;
2783pub const RTNLGRP_IPV6_MROUTE: c_uint = 0x0a;
2784pub const RTNLGRP_IPV6_ROUTE: c_uint = 0x0b;
2785pub const RTNLGRP_IPV6_IFINFO: c_uint = 0x0c;
2786pub const RTNLGRP_DECnet_IFADDR: c_uint = 0x0d;
2787pub const RTNLGRP_NOP2: c_uint = 0x0e;
2788pub const RTNLGRP_DECnet_ROUTE: c_uint = 0x0f;
2789pub const RTNLGRP_DECnet_RULE: c_uint = 0x10;
2790pub const RTNLGRP_NOP4: c_uint = 0x11;
2791pub const RTNLGRP_IPV6_PREFIX: c_uint = 0x12;
2792pub const RTNLGRP_IPV6_RULE: c_uint = 0x13;
2793pub const RTNLGRP_ND_USEROPT: c_uint = 0x14;
2794pub const RTNLGRP_PHONET_IFADDR: c_uint = 0x15;
2795pub const RTNLGRP_PHONET_ROUTE: c_uint = 0x16;
2796pub const RTNLGRP_DCB: c_uint = 0x17;
2797pub const RTNLGRP_IPV4_NETCONF: c_uint = 0x18;
2798pub const RTNLGRP_IPV6_NETCONF: c_uint = 0x19;
2799pub const RTNLGRP_MDB: c_uint = 0x1a;
2800pub const RTNLGRP_MPLS_ROUTE: c_uint = 0x1b;
2801pub const RTNLGRP_NSID: c_uint = 0x1c;
2802pub const RTNLGRP_MPLS_NETCONF: c_uint = 0x1d;
2803pub const RTNLGRP_IPV4_MROUTE_R: c_uint = 0x1e;
2804pub const RTNLGRP_IPV6_MROUTE_R: c_uint = 0x1f;
2805pub const RTNLGRP_NEXTHOP: c_uint = 0x20;
2806pub const RTNLGRP_BRVLAN: c_uint = 0x21;
2807pub const RTNLGRP_MCTP_IFADDR: c_uint = 0x22;
2808pub const RTNLGRP_TUNNEL: c_uint = 0x23;
2809pub const RTNLGRP_STATS: c_uint = 0x24;
2810
2811pub type proc_cn_event = crate::prelude::CEnumRepr;
pub const PROC_EVENT_NONE: proc_cn_event =
{
#[allow(unused_variables)]
let r = 0;
let r = 0x00000000;
r
};
pub const PROC_EVENT_FORK: proc_cn_event =
{
#[allow(unused_variables)]
let r = PROC_EVENT_NONE + 1;
let r = 0x00000001;
r
};
pub const PROC_EVENT_EXEC: proc_cn_event =
{
#[allow(unused_variables)]
let r = PROC_EVENT_FORK + 1;
let r = 0x00000002;
r
};
pub const PROC_EVENT_UID: proc_cn_event =
{
#[allow(unused_variables)]
let r = PROC_EVENT_EXEC + 1;
let r = 0x00000004;
r
};
pub const PROC_EVENT_GID: proc_cn_event =
{
#[allow(unused_variables)]
let r = PROC_EVENT_UID + 1;
let r = 0x00000040;
r
};
pub const PROC_EVENT_SID: proc_cn_event =
{
#[allow(unused_variables)]
let r = PROC_EVENT_GID + 1;
let r = 0x00000080;
r
};
pub const PROC_EVENT_PTRACE: proc_cn_event =
{
#[allow(unused_variables)]
let r = PROC_EVENT_SID + 1;
let r = 0x00000100;
r
};
pub const PROC_EVENT_COMM: proc_cn_event =
{
#[allow(unused_variables)]
let r = PROC_EVENT_PTRACE + 1;
let r = 0x00000200;
r
};
pub const PROC_EVENT_NONZERO_EXIT: proc_cn_event =
{
#[allow(unused_variables)]
let r = PROC_EVENT_COMM + 1;
let r = 0x20000000;
r
};
pub const PROC_EVENT_COREDUMP: proc_cn_event =
{
#[allow(unused_variables)]
let r = PROC_EVENT_NONZERO_EXIT + 1;
let r = 0x40000000;
r
};
pub const PROC_EVENT_EXIT: proc_cn_event =
{
#[allow(unused_variables)]
let r = PROC_EVENT_COREDUMP + 1;
let r = 0x80000000;
r
};c_enum! {
2813 pub enum proc_cn_mcast_op {
2814 pub PROC_CN_MCAST_LISTEN = 1,
2815 pub PROC_CN_MCAST_IGNORE = 2,
2816 }
2817
2818 pub enum proc_cn_event {
2819 pub PROC_EVENT_NONE = 0x00000000,
2820 pub PROC_EVENT_FORK = 0x00000001,
2821 pub PROC_EVENT_EXEC = 0x00000002,
2822 pub PROC_EVENT_UID = 0x00000004,
2823 pub PROC_EVENT_GID = 0x00000040,
2824 pub PROC_EVENT_SID = 0x00000080,
2825 pub PROC_EVENT_PTRACE = 0x00000100,
2826 pub PROC_EVENT_COMM = 0x00000200,
2827 pub PROC_EVENT_NONZERO_EXIT = 0x20000000,
2828 pub PROC_EVENT_COREDUMP = 0x40000000,
2829 pub PROC_EVENT_EXIT = 0x80000000,
2830 }
2831}
2832
2833pub const CN_IDX_PROC: c_uint = 0x1;
2835pub const CN_VAL_PROC: c_uint = 0x1;
2836pub const CN_IDX_CIFS: c_uint = 0x2;
2837pub const CN_VAL_CIFS: c_uint = 0x1;
2838pub const CN_W1_IDX: c_uint = 0x3;
2839pub const CN_W1_VAL: c_uint = 0x1;
2840pub const CN_IDX_V86D: c_uint = 0x4;
2841pub const CN_VAL_V86D_UVESAFB: c_uint = 0x1;
2842pub const CN_IDX_BB: c_uint = 0x5;
2843pub const CN_DST_IDX: c_uint = 0x6;
2844pub const CN_DST_VAL: c_uint = 0x1;
2845pub const CN_IDX_DM: c_uint = 0x7;
2846pub const CN_VAL_DM_USERSPACE_LOG: c_uint = 0x1;
2847pub const CN_IDX_DRBD: c_uint = 0x8;
2848pub const CN_VAL_DRBD: c_uint = 0x1;
2849pub const CN_KVP_IDX: c_uint = 0x9;
2850pub const CN_KVP_VAL: c_uint = 0x1;
2851pub const CN_VSS_IDX: c_uint = 0xA;
2852pub const CN_VSS_VAL: c_uint = 0x1;
2853
2854pub const MODULE_INIT_IGNORE_MODVERSIONS: c_uint = 0x0001;
2856pub const MODULE_INIT_IGNORE_VERMAGIC: c_uint = 0x0002;
2857
2858pub const SOF_TIMESTAMPING_TX_HARDWARE: c_uint = 1 << 0;
2860pub const SOF_TIMESTAMPING_TX_SOFTWARE: c_uint = 1 << 1;
2861pub const SOF_TIMESTAMPING_RX_HARDWARE: c_uint = 1 << 2;
2862pub const SOF_TIMESTAMPING_RX_SOFTWARE: c_uint = 1 << 3;
2863pub const SOF_TIMESTAMPING_SOFTWARE: c_uint = 1 << 4;
2864pub const SOF_TIMESTAMPING_SYS_HARDWARE: c_uint = 1 << 5;
2865pub const SOF_TIMESTAMPING_RAW_HARDWARE: c_uint = 1 << 6;
2866pub const SOF_TIMESTAMPING_OPT_ID: c_uint = 1 << 7;
2867pub const SOF_TIMESTAMPING_TX_SCHED: c_uint = 1 << 8;
2868pub const SOF_TIMESTAMPING_TX_ACK: c_uint = 1 << 9;
2869pub const SOF_TIMESTAMPING_OPT_CMSG: c_uint = 1 << 10;
2870pub const SOF_TIMESTAMPING_OPT_TSONLY: c_uint = 1 << 11;
2871pub const SOF_TIMESTAMPING_OPT_STATS: c_uint = 1 << 12;
2872pub const SOF_TIMESTAMPING_OPT_PKTINFO: c_uint = 1 << 13;
2873pub const SOF_TIMESTAMPING_OPT_TX_SWHW: c_uint = 1 << 14;
2874pub const SOF_TIMESTAMPING_BIND_PHC: c_uint = 1 << 15;
2875pub const SOF_TIMESTAMPING_OPT_ID_TCP: c_uint = 1 << 16;
2876pub const SOF_TIMESTAMPING_OPT_RX_FILTER: c_uint = 1 << 17;
2877pub const SOF_TXTIME_DEADLINE_MODE: u32 = 1 << 0;
2878pub const SOF_TXTIME_REPORT_ERRORS: u32 = 1 << 1;
2879
2880pub const HWTSTAMP_TX_OFF: c_uint = 0;
2881pub const HWTSTAMP_TX_ON: c_uint = 1;
2882pub const HWTSTAMP_TX_ONESTEP_SYNC: c_uint = 2;
2883pub const HWTSTAMP_TX_ONESTEP_P2P: c_uint = 3;
2884
2885pub const HWTSTAMP_FILTER_NONE: c_uint = 0;
2886pub const HWTSTAMP_FILTER_ALL: c_uint = 1;
2887pub const HWTSTAMP_FILTER_SOME: c_uint = 2;
2888pub const HWTSTAMP_FILTER_PTP_V1_L4_EVENT: c_uint = 3;
2889pub const HWTSTAMP_FILTER_PTP_V1_L4_SYNC: c_uint = 4;
2890pub const HWTSTAMP_FILTER_PTP_V1_L4_DELAY_REQ: c_uint = 5;
2891pub const HWTSTAMP_FILTER_PTP_V2_L4_EVENT: c_uint = 6;
2892pub const HWTSTAMP_FILTER_PTP_V2_L4_SYNC: c_uint = 7;
2893pub const HWTSTAMP_FILTER_PTP_V2_L4_DELAY_REQ: c_uint = 8;
2894pub const HWTSTAMP_FILTER_PTP_V2_L2_EVENT: c_uint = 9;
2895pub const HWTSTAMP_FILTER_PTP_V2_L2_SYNC: c_uint = 10;
2896pub const HWTSTAMP_FILTER_PTP_V2_L2_DELAY_REQ: c_uint = 11;
2897pub const HWTSTAMP_FILTER_PTP_V2_EVENT: c_uint = 12;
2898pub const HWTSTAMP_FILTER_PTP_V2_SYNC: c_uint = 13;
2899pub const HWTSTAMP_FILTER_PTP_V2_DELAY_REQ: c_uint = 14;
2900pub const HWTSTAMP_FILTER_NTP_ALL: c_uint = 15;
2901
2902pub const PTP_MAX_SAMPLES: c_uint = 25; const PTP_CLK_MAGIC: u32 = b'=' as u32;
2906
2907pub const PTP_CLOCK_GETCAPS: Ioctl = _IOR::<ptp_clock_caps>(PTP_CLK_MAGIC, 1);
2908pub const PTP_EXTTS_REQUEST: Ioctl = _IOW::<ptp_extts_request>(PTP_CLK_MAGIC, 2);
2909pub const PTP_PEROUT_REQUEST: Ioctl = _IOW::<ptp_perout_request>(PTP_CLK_MAGIC, 3);
2910pub const PTP_ENABLE_PPS: Ioctl = _IOW::<c_int>(PTP_CLK_MAGIC, 4);
2911pub const PTP_SYS_OFFSET: Ioctl = _IOW::<ptp_sys_offset>(PTP_CLK_MAGIC, 5);
2912pub const PTP_PIN_GETFUNC: Ioctl = _IOWR::<ptp_pin_desc>(PTP_CLK_MAGIC, 6);
2913pub const PTP_PIN_SETFUNC: Ioctl = _IOW::<ptp_pin_desc>(PTP_CLK_MAGIC, 7);
2914pub const PTP_SYS_OFFSET_PRECISE: Ioctl = _IOWR::<ptp_sys_offset_precise>(PTP_CLK_MAGIC, 8);
2915pub const PTP_SYS_OFFSET_EXTENDED: Ioctl = _IOWR::<ptp_sys_offset_extended>(PTP_CLK_MAGIC, 9);
2916
2917pub const PTP_CLOCK_GETCAPS2: Ioctl = _IOR::<ptp_clock_caps>(PTP_CLK_MAGIC, 10);
2918pub const PTP_EXTTS_REQUEST2: Ioctl = _IOW::<ptp_extts_request>(PTP_CLK_MAGIC, 11);
2919pub const PTP_PEROUT_REQUEST2: Ioctl = _IOW::<ptp_perout_request>(PTP_CLK_MAGIC, 12);
2920pub const PTP_ENABLE_PPS2: Ioctl = _IOW::<c_int>(PTP_CLK_MAGIC, 13);
2921pub const PTP_SYS_OFFSET2: Ioctl = _IOW::<ptp_sys_offset>(PTP_CLK_MAGIC, 14);
2922pub const PTP_PIN_GETFUNC2: Ioctl = _IOWR::<ptp_pin_desc>(PTP_CLK_MAGIC, 15);
2923pub const PTP_PIN_SETFUNC2: Ioctl = _IOW::<ptp_pin_desc>(PTP_CLK_MAGIC, 16);
2924pub const PTP_SYS_OFFSET_PRECISE2: Ioctl = _IOWR::<ptp_sys_offset_precise>(PTP_CLK_MAGIC, 17);
2925pub const PTP_SYS_OFFSET_EXTENDED2: Ioctl = _IOWR::<ptp_sys_offset_extended>(PTP_CLK_MAGIC, 18);
2926
2927pub const PTP_PF_NONE: c_uint = 0;
2929pub const PTP_PF_EXTTS: c_uint = 1;
2930pub const PTP_PF_PEROUT: c_uint = 2;
2931pub const PTP_PF_PHYSYNC: c_uint = 3;
2932
2933pub const TLS_TX: c_int = 1;
2935pub const TLS_RX: c_int = 2;
2936
2937pub const TLS_TX_ZEROCOPY_RO: c_int = 3;
2938pub const TLS_RX_EXPECT_NO_PAD: c_int = 4;
2939
2940pub const TLS_1_2_VERSION_MAJOR: __u8 = 0x3;
2941pub const TLS_1_2_VERSION_MINOR: __u8 = 0x3;
2942pub const TLS_1_2_VERSION: __u16 =
2943 ((TLS_1_2_VERSION_MAJOR as __u16) << 8) | (TLS_1_2_VERSION_MINOR as __u16);
2944
2945pub const TLS_1_3_VERSION_MAJOR: __u8 = 0x3;
2946pub const TLS_1_3_VERSION_MINOR: __u8 = 0x4;
2947pub const TLS_1_3_VERSION: __u16 =
2948 ((TLS_1_3_VERSION_MAJOR as __u16) << 8) | (TLS_1_3_VERSION_MINOR as __u16);
2949
2950pub const TLS_CIPHER_AES_GCM_128: __u16 = 51;
2951pub const TLS_CIPHER_AES_GCM_128_IV_SIZE: usize = 8;
2952pub const TLS_CIPHER_AES_GCM_128_KEY_SIZE: usize = 16;
2953pub const TLS_CIPHER_AES_GCM_128_SALT_SIZE: usize = 4;
2954pub const TLS_CIPHER_AES_GCM_128_TAG_SIZE: usize = 16;
2955pub const TLS_CIPHER_AES_GCM_128_REC_SEQ_SIZE: usize = 8;
2956
2957pub const TLS_CIPHER_AES_GCM_256: __u16 = 52;
2958pub const TLS_CIPHER_AES_GCM_256_IV_SIZE: usize = 8;
2959pub const TLS_CIPHER_AES_GCM_256_KEY_SIZE: usize = 32;
2960pub const TLS_CIPHER_AES_GCM_256_SALT_SIZE: usize = 4;
2961pub const TLS_CIPHER_AES_GCM_256_TAG_SIZE: usize = 16;
2962pub const TLS_CIPHER_AES_GCM_256_REC_SEQ_SIZE: usize = 8;
2963
2964pub const TLS_CIPHER_AES_CCM_128: __u16 = 53;
2965pub const TLS_CIPHER_AES_CCM_128_IV_SIZE: usize = 8;
2966pub const TLS_CIPHER_AES_CCM_128_KEY_SIZE: usize = 16;
2967pub const TLS_CIPHER_AES_CCM_128_SALT_SIZE: usize = 4;
2968pub const TLS_CIPHER_AES_CCM_128_TAG_SIZE: usize = 16;
2969pub const TLS_CIPHER_AES_CCM_128_REC_SEQ_SIZE: usize = 8;
2970
2971pub const TLS_CIPHER_CHACHA20_POLY1305: __u16 = 54;
2972pub const TLS_CIPHER_CHACHA20_POLY1305_IV_SIZE: usize = 12;
2973pub const TLS_CIPHER_CHACHA20_POLY1305_KEY_SIZE: usize = 32;
2974pub const TLS_CIPHER_CHACHA20_POLY1305_SALT_SIZE: usize = 0;
2975pub const TLS_CIPHER_CHACHA20_POLY1305_TAG_SIZE: usize = 16;
2976pub const TLS_CIPHER_CHACHA20_POLY1305_REC_SEQ_SIZE: usize = 8;
2977
2978pub const TLS_CIPHER_SM4_GCM: __u16 = 55;
2979pub const TLS_CIPHER_SM4_GCM_IV_SIZE: usize = 8;
2980pub const TLS_CIPHER_SM4_GCM_KEY_SIZE: usize = 16;
2981pub const TLS_CIPHER_SM4_GCM_SALT_SIZE: usize = 4;
2982pub const TLS_CIPHER_SM4_GCM_TAG_SIZE: usize = 16;
2983pub const TLS_CIPHER_SM4_GCM_REC_SEQ_SIZE: usize = 8;
2984
2985pub const TLS_CIPHER_SM4_CCM: __u16 = 56;
2986pub const TLS_CIPHER_SM4_CCM_IV_SIZE: usize = 8;
2987pub const TLS_CIPHER_SM4_CCM_KEY_SIZE: usize = 16;
2988pub const TLS_CIPHER_SM4_CCM_SALT_SIZE: usize = 4;
2989pub const TLS_CIPHER_SM4_CCM_TAG_SIZE: usize = 16;
2990pub const TLS_CIPHER_SM4_CCM_REC_SEQ_SIZE: usize = 8;
2991
2992pub const TLS_CIPHER_ARIA_GCM_128: __u16 = 57;
2993pub const TLS_CIPHER_ARIA_GCM_128_IV_SIZE: usize = 8;
2994pub const TLS_CIPHER_ARIA_GCM_128_KEY_SIZE: usize = 16;
2995pub const TLS_CIPHER_ARIA_GCM_128_SALT_SIZE: usize = 4;
2996pub const TLS_CIPHER_ARIA_GCM_128_TAG_SIZE: usize = 16;
2997pub const TLS_CIPHER_ARIA_GCM_128_REC_SEQ_SIZE: usize = 8;
2998
2999pub const TLS_CIPHER_ARIA_GCM_256: __u16 = 58;
3000pub const TLS_CIPHER_ARIA_GCM_256_IV_SIZE: usize = 8;
3001pub const TLS_CIPHER_ARIA_GCM_256_KEY_SIZE: usize = 32;
3002pub const TLS_CIPHER_ARIA_GCM_256_SALT_SIZE: usize = 4;
3003pub const TLS_CIPHER_ARIA_GCM_256_TAG_SIZE: usize = 16;
3004pub const TLS_CIPHER_ARIA_GCM_256_REC_SEQ_SIZE: usize = 8;
3005
3006pub const TLS_SET_RECORD_TYPE: c_int = 1;
3007pub const TLS_GET_RECORD_TYPE: c_int = 2;
3008
3009pub const SOL_TLS: c_int = 282;
3010
3011pub const TLS_INFO_UNSPEC: c_int = 0x00;
3013pub const TLS_INFO_VERSION: c_int = 0x01;
3014pub const TLS_INFO_CIPHER: c_int = 0x02;
3015pub const TLS_INFO_TXCONF: c_int = 0x03;
3016pub const TLS_INFO_RXCONF: c_int = 0x04;
3017pub const TLS_INFO_ZC_RO_TX: c_int = 0x05;
3018pub const TLS_INFO_RX_NO_PAD: c_int = 0x06;
3019
3020pub const TLS_CONF_BASE: c_int = 1;
3021pub const TLS_CONF_SW: c_int = 2;
3022pub const TLS_CONF_HW: c_int = 3;
3023pub const TLS_CONF_HW_RECORD: c_int = 4;
3024
3025pub const ALG_SET_KEY: c_int = 1;
3027pub const ALG_SET_IV: c_int = 2;
3028pub const ALG_SET_OP: c_int = 3;
3029pub const ALG_SET_AEAD_ASSOCLEN: c_int = 4;
3030pub const ALG_SET_AEAD_AUTHSIZE: c_int = 5;
3031pub const ALG_SET_DRBG_ENTROPY: c_int = 6;
3032pub const ALG_SET_KEY_BY_KEY_SERIAL: c_int = 7;
3033
3034pub const ALG_OP_DECRYPT: c_int = 0;
3035pub const ALG_OP_ENCRYPT: c_int = 1;
3036
3037pub const IF_OPER_UNKNOWN: c_int = 0;
3039pub const IF_OPER_NOTPRESENT: c_int = 1;
3040pub const IF_OPER_DOWN: c_int = 2;
3041pub const IF_OPER_LOWERLAYERDOWN: c_int = 3;
3042pub const IF_OPER_TESTING: c_int = 4;
3043pub const IF_OPER_DORMANT: c_int = 5;
3044pub const IF_OPER_UP: c_int = 6;
3045
3046pub const IF_LINK_MODE_DEFAULT: c_int = 0;
3047pub const IF_LINK_MODE_DORMANT: c_int = 1;
3048pub const IF_LINK_MODE_TESTING: c_int = 2;
3049
3050pub const MAP_SHARED_VALIDATE: c_int = 0x3;
3052pub const MAP_DROPPABLE: c_int = 0x8;
3053
3054pub const VMADDR_CID_ANY: c_uint = 0xFFFFFFFF;
3056pub const VMADDR_CID_HYPERVISOR: c_uint = 0;
3057#[deprecated(
3058 since = "0.2.74",
3059 note = "VMADDR_CID_RESERVED is removed since Linux v5.6 and \
3060 replaced with VMADDR_CID_LOCAL"
3061)]
3062pub const VMADDR_CID_RESERVED: c_uint = 1;
3063pub const VMADDR_CID_LOCAL: c_uint = 1;
3064pub const VMADDR_CID_HOST: c_uint = 2;
3065pub const VMADDR_PORT_ANY: c_uint = 0xFFFFFFFF;
3066
3067pub const IN_ACCESS: u32 = 0x0000_0001;
3069pub const IN_MODIFY: u32 = 0x0000_0002;
3070pub const IN_ATTRIB: u32 = 0x0000_0004;
3071pub const IN_CLOSE_WRITE: u32 = 0x0000_0008;
3072pub const IN_CLOSE_NOWRITE: u32 = 0x0000_0010;
3073pub const IN_CLOSE: u32 = IN_CLOSE_WRITE | IN_CLOSE_NOWRITE;
3074pub const IN_OPEN: u32 = 0x0000_0020;
3075pub const IN_MOVED_FROM: u32 = 0x0000_0040;
3076pub const IN_MOVED_TO: u32 = 0x0000_0080;
3077pub const IN_MOVE: u32 = IN_MOVED_FROM | IN_MOVED_TO;
3078pub const IN_CREATE: u32 = 0x0000_0100;
3079pub const IN_DELETE: u32 = 0x0000_0200;
3080pub const IN_DELETE_SELF: u32 = 0x0000_0400;
3081pub const IN_MOVE_SELF: u32 = 0x0000_0800;
3082pub const IN_UNMOUNT: u32 = 0x0000_2000;
3083pub const IN_Q_OVERFLOW: u32 = 0x0000_4000;
3084pub const IN_IGNORED: u32 = 0x0000_8000;
3085pub const IN_ONLYDIR: u32 = 0x0100_0000;
3086pub const IN_DONT_FOLLOW: u32 = 0x0200_0000;
3087pub const IN_EXCL_UNLINK: u32 = 0x0400_0000;
3088
3089const SECURE_NOROOT: c_int = 0;
3091const SECURE_NOROOT_LOCKED: c_int = 1;
3092
3093pub const SECBIT_NOROOT: c_int = issecure_mask(SECURE_NOROOT);
3094pub const SECBIT_NOROOT_LOCKED: c_int = issecure_mask(SECURE_NOROOT_LOCKED);
3095
3096const SECURE_NO_SETUID_FIXUP: c_int = 2;
3097const SECURE_NO_SETUID_FIXUP_LOCKED: c_int = 3;
3098
3099pub const SECBIT_NO_SETUID_FIXUP: c_int = issecure_mask(SECURE_NO_SETUID_FIXUP);
3100pub const SECBIT_NO_SETUID_FIXUP_LOCKED: c_int = issecure_mask(SECURE_NO_SETUID_FIXUP_LOCKED);
3101
3102const SECURE_KEEP_CAPS: c_int = 4;
3103const SECURE_KEEP_CAPS_LOCKED: c_int = 5;
3104
3105pub const SECBIT_KEEP_CAPS: c_int = issecure_mask(SECURE_KEEP_CAPS);
3106pub const SECBIT_KEEP_CAPS_LOCKED: c_int = issecure_mask(SECURE_KEEP_CAPS_LOCKED);
3107
3108const SECURE_NO_CAP_AMBIENT_RAISE: c_int = 6;
3109const SECURE_NO_CAP_AMBIENT_RAISE_LOCKED: c_int = 7;
3110
3111pub const SECBIT_NO_CAP_AMBIENT_RAISE: c_int = issecure_mask(SECURE_NO_CAP_AMBIENT_RAISE);
3112pub const SECBIT_NO_CAP_AMBIENT_RAISE_LOCKED: c_int =
3113 issecure_mask(SECURE_NO_CAP_AMBIENT_RAISE_LOCKED);
3114
3115const SECURE_EXEC_RESTRICT_FILE: c_int = 8;
3116const SECURE_EXEC_RESTRICT_FILE_LOCKED: c_int = 9;
3117
3118pub const SECBIT_EXEC_RESTRICT_FILE: c_int = issecure_mask(SECURE_EXEC_RESTRICT_FILE);
3119pub const SECBIT_EXEC_RESTRICT_FILE_LOCKED: c_int = issecure_mask(SECURE_EXEC_RESTRICT_FILE_LOCKED);
3120
3121const SECURE_EXEC_DENY_INTERACTIVE: c_int = 10;
3122const SECURE_EXEC_DENY_INTERACTIVE_LOCKED: c_int = 11;
3123
3124pub const SECBIT_EXEC_DENY_INTERACTIVE: c_int = issecure_mask(SECURE_EXEC_DENY_INTERACTIVE);
3125pub const SECBIT_EXEC_DENY_INTERACTIVE_LOCKED: c_int =
3126 issecure_mask(SECURE_EXEC_DENY_INTERACTIVE_LOCKED);
3127
3128pub const SECUREBITS_DEFAULT: c_int = 0x00000000;
3129pub const SECURE_ALL_BITS: c_int = SECBIT_NOROOT
3130 | SECBIT_NO_SETUID_FIXUP
3131 | SECBIT_KEEP_CAPS
3132 | SECBIT_NO_CAP_AMBIENT_RAISE
3133 | SECBIT_EXEC_RESTRICT_FILE
3134 | SECBIT_EXEC_DENY_INTERACTIVE;
3135pub const SECURE_ALL_LOCKS: c_int = SECURE_ALL_BITS << 1;
3136
3137pub const SECURE_ALL_UNPRIVILEGED: c_int =
3138 issecure_mask(SECURE_EXEC_RESTRICT_FILE) | issecure_mask(SECURE_EXEC_DENY_INTERACTIVE);
3139
3140const fn issecure_mask(x: c_int) -> c_int {
3141 1 << x
3142}
3143
3144pub const IN_MASK_CREATE: u32 = 0x1000_0000;
3145pub const IN_MASK_ADD: u32 = 0x2000_0000;
3146pub const IN_ISDIR: u32 = 0x4000_0000;
3147pub const IN_ONESHOT: u32 = 0x8000_0000;
3148
3149pub const IN_ALL_EVENTS: u32 = IN_ACCESS
3150 | IN_MODIFY
3151 | IN_ATTRIB
3152 | IN_CLOSE_WRITE
3153 | IN_CLOSE_NOWRITE
3154 | IN_OPEN
3155 | IN_MOVED_FROM
3156 | IN_MOVED_TO
3157 | IN_DELETE
3158 | IN_CREATE
3159 | IN_DELETE_SELF
3160 | IN_MOVE_SELF;
3161
3162pub const IN_CLOEXEC: c_int = O_CLOEXEC;
3163pub const IN_NONBLOCK: c_int = O_NONBLOCK;
3164
3165pub const OPEN_TREE_CLONE: c_uint = 0x01;
3167pub const OPEN_TREE_CLOEXEC: c_uint = O_CLOEXEC as c_uint;
3168
3169pub const NFT_TABLE_MAXNAMELEN: c_int = 256;
3171pub const NFT_CHAIN_MAXNAMELEN: c_int = 256;
3172pub const NFT_SET_MAXNAMELEN: c_int = 256;
3173pub const NFT_OBJ_MAXNAMELEN: c_int = 256;
3174pub const NFT_USERDATA_MAXLEN: c_int = 256;
3175
3176pub const NFT_REG_VERDICT: c_int = 0;
3177pub const NFT_REG_1: c_int = 1;
3178pub const NFT_REG_2: c_int = 2;
3179pub const NFT_REG_3: c_int = 3;
3180pub const NFT_REG_4: c_int = 4;
3181pub const __NFT_REG_MAX: c_int = 5;
3182pub const NFT_REG32_00: c_int = 8;
3183pub const NFT_REG32_01: c_int = 9;
3184pub const NFT_REG32_02: c_int = 10;
3185pub const NFT_REG32_03: c_int = 11;
3186pub const NFT_REG32_04: c_int = 12;
3187pub const NFT_REG32_05: c_int = 13;
3188pub const NFT_REG32_06: c_int = 14;
3189pub const NFT_REG32_07: c_int = 15;
3190pub const NFT_REG32_08: c_int = 16;
3191pub const NFT_REG32_09: c_int = 17;
3192pub const NFT_REG32_10: c_int = 18;
3193pub const NFT_REG32_11: c_int = 19;
3194pub const NFT_REG32_12: c_int = 20;
3195pub const NFT_REG32_13: c_int = 21;
3196pub const NFT_REG32_14: c_int = 22;
3197pub const NFT_REG32_15: c_int = 23;
3198
3199pub const NFT_REG_SIZE: c_int = 16;
3200pub const NFT_REG32_SIZE: c_int = 4;
3201
3202pub const NFT_CONTINUE: c_int = -1;
3203pub const NFT_BREAK: c_int = -2;
3204pub const NFT_JUMP: c_int = -3;
3205pub const NFT_GOTO: c_int = -4;
3206pub const NFT_RETURN: c_int = -5;
3207
3208pub const NFT_MSG_NEWTABLE: c_int = 0;
3209pub const NFT_MSG_GETTABLE: c_int = 1;
3210pub const NFT_MSG_DELTABLE: c_int = 2;
3211pub const NFT_MSG_NEWCHAIN: c_int = 3;
3212pub const NFT_MSG_GETCHAIN: c_int = 4;
3213pub const NFT_MSG_DELCHAIN: c_int = 5;
3214pub const NFT_MSG_NEWRULE: c_int = 6;
3215pub const NFT_MSG_GETRULE: c_int = 7;
3216pub const NFT_MSG_DELRULE: c_int = 8;
3217pub const NFT_MSG_NEWSET: c_int = 9;
3218pub const NFT_MSG_GETSET: c_int = 10;
3219pub const NFT_MSG_DELSET: c_int = 11;
3220pub const NFT_MSG_NEWSETELEM: c_int = 12;
3221pub const NFT_MSG_GETSETELEM: c_int = 13;
3222pub const NFT_MSG_DELSETELEM: c_int = 14;
3223pub const NFT_MSG_NEWGEN: c_int = 15;
3224pub const NFT_MSG_GETGEN: c_int = 16;
3225pub const NFT_MSG_TRACE: c_int = 17;
3226cfg_if! {
3227 if #[cfg(not(target_arch = "sparc64"))] {
3228 pub const NFT_MSG_NEWOBJ: c_int = 18;
3229 pub const NFT_MSG_GETOBJ: c_int = 19;
3230 pub const NFT_MSG_DELOBJ: c_int = 20;
3231 pub const NFT_MSG_GETOBJ_RESET: c_int = 21;
3232 }
3233}
3234
3235pub const NFT_MSG_MAX: c_int = 34;
3236
3237pub const NFT_SET_ANONYMOUS: c_int = 0x1;
3238pub const NFT_SET_CONSTANT: c_int = 0x2;
3239pub const NFT_SET_INTERVAL: c_int = 0x4;
3240pub const NFT_SET_MAP: c_int = 0x8;
3241pub const NFT_SET_TIMEOUT: c_int = 0x10;
3242pub const NFT_SET_EVAL: c_int = 0x20;
3243
3244pub const NFT_SET_POL_PERFORMANCE: c_int = 0;
3245pub const NFT_SET_POL_MEMORY: c_int = 1;
3246
3247pub const NFT_SET_ELEM_INTERVAL_END: c_int = 0x1;
3248
3249pub const NFT_DATA_VALUE: c_uint = 0;
3250pub const NFT_DATA_VERDICT: c_uint = 0xffffff00;
3251
3252pub const NFT_DATA_RESERVED_MASK: c_uint = 0xffffff00;
3253
3254pub const NFT_DATA_VALUE_MAXLEN: c_int = 64;
3255
3256pub const NFT_BYTEORDER_NTOH: c_int = 0;
3257pub const NFT_BYTEORDER_HTON: c_int = 1;
3258
3259pub const NFT_CMP_EQ: c_int = 0;
3260pub const NFT_CMP_NEQ: c_int = 1;
3261pub const NFT_CMP_LT: c_int = 2;
3262pub const NFT_CMP_LTE: c_int = 3;
3263pub const NFT_CMP_GT: c_int = 4;
3264pub const NFT_CMP_GTE: c_int = 5;
3265
3266pub const NFT_RANGE_EQ: c_int = 0;
3267pub const NFT_RANGE_NEQ: c_int = 1;
3268
3269pub const NFT_LOOKUP_F_INV: c_int = 1 << 0;
3270
3271pub const NFT_DYNSET_OP_ADD: c_int = 0;
3272pub const NFT_DYNSET_OP_UPDATE: c_int = 1;
3273
3274pub const NFT_DYNSET_F_INV: c_int = 1 << 0;
3275
3276pub const NFT_PAYLOAD_LL_HEADER: c_int = 0;
3277pub const NFT_PAYLOAD_NETWORK_HEADER: c_int = 1;
3278pub const NFT_PAYLOAD_TRANSPORT_HEADER: c_int = 2;
3279
3280pub const NFT_PAYLOAD_CSUM_NONE: c_int = 0;
3281pub const NFT_PAYLOAD_CSUM_INET: c_int = 1;
3282
3283pub const NFT_META_LEN: c_int = 0;
3284pub const NFT_META_PROTOCOL: c_int = 1;
3285pub const NFT_META_PRIORITY: c_int = 2;
3286pub const NFT_META_MARK: c_int = 3;
3287pub const NFT_META_IIF: c_int = 4;
3288pub const NFT_META_OIF: c_int = 5;
3289pub const NFT_META_IIFNAME: c_int = 6;
3290pub const NFT_META_OIFNAME: c_int = 7;
3291pub const NFT_META_IIFTYPE: c_int = 8;
3292pub const NFT_META_OIFTYPE: c_int = 9;
3293pub const NFT_META_SKUID: c_int = 10;
3294pub const NFT_META_SKGID: c_int = 11;
3295pub const NFT_META_NFTRACE: c_int = 12;
3296pub const NFT_META_RTCLASSID: c_int = 13;
3297pub const NFT_META_SECMARK: c_int = 14;
3298pub const NFT_META_NFPROTO: c_int = 15;
3299pub const NFT_META_L4PROTO: c_int = 16;
3300pub const NFT_META_BRI_IIFNAME: c_int = 17;
3301pub const NFT_META_BRI_OIFNAME: c_int = 18;
3302pub const NFT_META_PKTTYPE: c_int = 19;
3303pub const NFT_META_CPU: c_int = 20;
3304pub const NFT_META_IIFGROUP: c_int = 21;
3305pub const NFT_META_OIFGROUP: c_int = 22;
3306pub const NFT_META_CGROUP: c_int = 23;
3307pub const NFT_META_PRANDOM: c_int = 24;
3308
3309pub const NFT_CT_STATE: c_int = 0;
3310pub const NFT_CT_DIRECTION: c_int = 1;
3311pub const NFT_CT_STATUS: c_int = 2;
3312pub const NFT_CT_MARK: c_int = 3;
3313pub const NFT_CT_SECMARK: c_int = 4;
3314pub const NFT_CT_EXPIRATION: c_int = 5;
3315pub const NFT_CT_HELPER: c_int = 6;
3316pub const NFT_CT_L3PROTOCOL: c_int = 7;
3317pub const NFT_CT_SRC: c_int = 8;
3318pub const NFT_CT_DST: c_int = 9;
3319pub const NFT_CT_PROTOCOL: c_int = 10;
3320pub const NFT_CT_PROTO_SRC: c_int = 11;
3321pub const NFT_CT_PROTO_DST: c_int = 12;
3322pub const NFT_CT_LABELS: c_int = 13;
3323pub const NFT_CT_PKTS: c_int = 14;
3324pub const NFT_CT_BYTES: c_int = 15;
3325pub const NFT_CT_AVGPKT: c_int = 16;
3326pub const NFT_CT_ZONE: c_int = 17;
3327pub const NFT_CT_EVENTMASK: c_int = 18;
3328pub const NFT_CT_SRC_IP: c_int = 19;
3329pub const NFT_CT_DST_IP: c_int = 20;
3330pub const NFT_CT_SRC_IP6: c_int = 21;
3331pub const NFT_CT_DST_IP6: c_int = 22;
3332
3333pub const NFT_LIMIT_PKTS: c_int = 0;
3334pub const NFT_LIMIT_PKT_BYTES: c_int = 1;
3335
3336pub const NFT_LIMIT_F_INV: c_int = 1 << 0;
3337
3338pub const NFT_QUEUE_FLAG_BYPASS: c_int = 0x01;
3339pub const NFT_QUEUE_FLAG_CPU_FANOUT: c_int = 0x02;
3340pub const NFT_QUEUE_FLAG_MASK: c_int = 0x03;
3341
3342pub const NFT_QUOTA_F_INV: c_int = 1 << 0;
3343
3344pub const NFT_REJECT_ICMP_UNREACH: c_int = 0;
3345pub const NFT_REJECT_TCP_RST: c_int = 1;
3346pub const NFT_REJECT_ICMPX_UNREACH: c_int = 2;
3347
3348pub const NFT_REJECT_ICMPX_NO_ROUTE: c_int = 0;
3349pub const NFT_REJECT_ICMPX_PORT_UNREACH: c_int = 1;
3350pub const NFT_REJECT_ICMPX_HOST_UNREACH: c_int = 2;
3351pub const NFT_REJECT_ICMPX_ADMIN_PROHIBITED: c_int = 3;
3352
3353pub const NFT_NAT_SNAT: c_int = 0;
3354pub const NFT_NAT_DNAT: c_int = 1;
3355
3356pub const NFT_TRACETYPE_UNSPEC: c_int = 0;
3357pub const NFT_TRACETYPE_POLICY: c_int = 1;
3358pub const NFT_TRACETYPE_RETURN: c_int = 2;
3359pub const NFT_TRACETYPE_RULE: c_int = 3;
3360
3361pub const NFT_NG_INCREMENTAL: c_int = 0;
3362pub const NFT_NG_RANDOM: c_int = 1;
3363
3364pub const FF_MAX: __u16 = 0x7f;
3366pub const FF_CNT: usize = FF_MAX as usize + 1;
3367
3368pub const INPUT_PROP_POINTER: __u16 = 0x00;
3370pub const INPUT_PROP_DIRECT: __u16 = 0x01;
3371pub const INPUT_PROP_BUTTONPAD: __u16 = 0x02;
3372pub const INPUT_PROP_SEMI_MT: __u16 = 0x03;
3373pub const INPUT_PROP_TOPBUTTONPAD: __u16 = 0x04;
3374pub const INPUT_PROP_POINTING_STICK: __u16 = 0x05;
3375pub const INPUT_PROP_ACCELEROMETER: __u16 = 0x06;
3376pub const INPUT_PROP_MAX: __u16 = 0x1f;
3377pub const INPUT_PROP_CNT: usize = INPUT_PROP_MAX as usize + 1;
3378pub const EV_MAX: __u16 = 0x1f;
3379pub const EV_CNT: usize = EV_MAX as usize + 1;
3380pub const SYN_MAX: __u16 = 0xf;
3381pub const SYN_CNT: usize = SYN_MAX as usize + 1;
3382pub const KEY_MAX: __u16 = 0x2ff;
3383pub const KEY_CNT: usize = KEY_MAX as usize + 1;
3384pub const REL_MAX: __u16 = 0x0f;
3385pub const REL_CNT: usize = REL_MAX as usize + 1;
3386pub const ABS_MAX: __u16 = 0x3f;
3387pub const ABS_CNT: usize = ABS_MAX as usize + 1;
3388pub const SW_MAX: __u16 = 0x10;
3389pub const SW_CNT: usize = SW_MAX as usize + 1;
3390pub const MSC_MAX: __u16 = 0x07;
3391pub const MSC_CNT: usize = MSC_MAX as usize + 1;
3392pub const LED_MAX: __u16 = 0x0f;
3393pub const LED_CNT: usize = LED_MAX as usize + 1;
3394pub const REP_MAX: __u16 = 0x01;
3395pub const REP_CNT: usize = REP_MAX as usize + 1;
3396pub const SND_MAX: __u16 = 0x07;
3397pub const SND_CNT: usize = SND_MAX as usize + 1;
3398
3399pub const UINPUT_VERSION: c_uint = 5;
3401pub const UINPUT_MAX_NAME_SIZE: usize = 80;
3402
3403pub const FAN_ACCESS: u64 = 0x0000_0001;
3405pub const FAN_MODIFY: u64 = 0x0000_0002;
3406pub const FAN_ATTRIB: u64 = 0x0000_0004;
3407pub const FAN_CLOSE_WRITE: u64 = 0x0000_0008;
3408pub const FAN_CLOSE_NOWRITE: u64 = 0x0000_0010;
3409pub const FAN_OPEN: u64 = 0x0000_0020;
3410pub const FAN_MOVED_FROM: u64 = 0x0000_0040;
3411pub const FAN_MOVED_TO: u64 = 0x0000_0080;
3412pub const FAN_CREATE: u64 = 0x0000_0100;
3413pub const FAN_DELETE: u64 = 0x0000_0200;
3414pub const FAN_DELETE_SELF: u64 = 0x0000_0400;
3415pub const FAN_MOVE_SELF: u64 = 0x0000_0800;
3416pub const FAN_OPEN_EXEC: u64 = 0x0000_1000;
3417
3418pub const FAN_Q_OVERFLOW: u64 = 0x0000_4000;
3419pub const FAN_FS_ERROR: u64 = 0x0000_8000;
3420
3421pub const FAN_OPEN_PERM: u64 = 0x0001_0000;
3422pub const FAN_ACCESS_PERM: u64 = 0x0002_0000;
3423pub const FAN_OPEN_EXEC_PERM: u64 = 0x0004_0000;
3424
3425pub const FAN_EVENT_ON_CHILD: u64 = 0x0800_0000;
3426
3427pub const FAN_RENAME: u64 = 0x1000_0000;
3428
3429pub const FAN_ONDIR: u64 = 0x4000_0000;
3430
3431pub const FAN_CLOSE: u64 = FAN_CLOSE_WRITE | FAN_CLOSE_NOWRITE;
3432pub const FAN_MOVE: u64 = FAN_MOVED_FROM | FAN_MOVED_TO;
3433
3434pub const FAN_CLOEXEC: c_uint = 0x0000_0001;
3435pub const FAN_NONBLOCK: c_uint = 0x0000_0002;
3436
3437pub const FAN_CLASS_NOTIF: c_uint = 0x0000_0000;
3438pub const FAN_CLASS_CONTENT: c_uint = 0x0000_0004;
3439pub const FAN_CLASS_PRE_CONTENT: c_uint = 0x0000_0008;
3440
3441pub const FAN_UNLIMITED_QUEUE: c_uint = 0x0000_0010;
3442pub const FAN_UNLIMITED_MARKS: c_uint = 0x0000_0020;
3443pub const FAN_ENABLE_AUDIT: c_uint = 0x0000_0040;
3444
3445pub const FAN_REPORT_PIDFD: c_uint = 0x0000_0080;
3446pub const FAN_REPORT_TID: c_uint = 0x0000_0100;
3447pub const FAN_REPORT_FID: c_uint = 0x0000_0200;
3448pub const FAN_REPORT_DIR_FID: c_uint = 0x0000_0400;
3449pub const FAN_REPORT_NAME: c_uint = 0x0000_0800;
3450pub const FAN_REPORT_TARGET_FID: c_uint = 0x0000_1000;
3451
3452pub const FAN_REPORT_DFID_NAME: c_uint = FAN_REPORT_DIR_FID | FAN_REPORT_NAME;
3453pub const FAN_REPORT_DFID_NAME_TARGET: c_uint =
3454 FAN_REPORT_DFID_NAME | FAN_REPORT_FID | FAN_REPORT_TARGET_FID;
3455
3456pub const FAN_MARK_ADD: c_uint = 0x0000_0001;
3457pub const FAN_MARK_REMOVE: c_uint = 0x0000_0002;
3458pub const FAN_MARK_DONT_FOLLOW: c_uint = 0x0000_0004;
3459pub const FAN_MARK_ONLYDIR: c_uint = 0x0000_0008;
3460pub const FAN_MARK_IGNORED_MASK: c_uint = 0x0000_0020;
3461pub const FAN_MARK_IGNORED_SURV_MODIFY: c_uint = 0x0000_0040;
3462pub const FAN_MARK_FLUSH: c_uint = 0x0000_0080;
3463pub const FAN_MARK_EVICTABLE: c_uint = 0x0000_0200;
3464pub const FAN_MARK_IGNORE: c_uint = 0x0000_0400;
3465
3466pub const FAN_MARK_INODE: c_uint = 0x0000_0000;
3467pub const FAN_MARK_MOUNT: c_uint = 0x0000_0010;
3468pub const FAN_MARK_FILESYSTEM: c_uint = 0x0000_0100;
3469
3470pub const FAN_MARK_IGNORE_SURV: c_uint = FAN_MARK_IGNORE | FAN_MARK_IGNORED_SURV_MODIFY;
3471
3472pub const FANOTIFY_METADATA_VERSION: u8 = 3;
3473
3474pub const FAN_EVENT_INFO_TYPE_FID: u8 = 1;
3475pub const FAN_EVENT_INFO_TYPE_DFID_NAME: u8 = 2;
3476pub const FAN_EVENT_INFO_TYPE_DFID: u8 = 3;
3477pub const FAN_EVENT_INFO_TYPE_PIDFD: u8 = 4;
3478pub const FAN_EVENT_INFO_TYPE_ERROR: u8 = 5;
3479
3480pub const FAN_EVENT_INFO_TYPE_OLD_DFID_NAME: u8 = 10;
3481pub const FAN_EVENT_INFO_TYPE_NEW_DFID_NAME: u8 = 12;
3482
3483pub const FAN_RESPONSE_INFO_NONE: u8 = 0;
3484pub const FAN_RESPONSE_INFO_AUDIT_RULE: u8 = 1;
3485
3486pub const FAN_ALLOW: u32 = 0x01;
3487pub const FAN_DENY: u32 = 0x02;
3488pub const FAN_AUDIT: u32 = 0x10;
3489pub const FAN_INFO: u32 = 0x20;
3490
3491pub const FAN_NOFD: c_int = -1;
3492pub const FAN_NOPIDFD: c_int = FAN_NOFD;
3493pub const FAN_EPIDFD: c_int = -2;
3494
3495pub const FUTEX_WAIT: c_int = 0;
3497pub const FUTEX_WAKE: c_int = 1;
3498pub const FUTEX_FD: c_int = 2;
3499pub const FUTEX_REQUEUE: c_int = 3;
3500pub const FUTEX_CMP_REQUEUE: c_int = 4;
3501pub const FUTEX_WAKE_OP: c_int = 5;
3502pub const FUTEX_LOCK_PI: c_int = 6;
3503pub const FUTEX_UNLOCK_PI: c_int = 7;
3504pub const FUTEX_TRYLOCK_PI: c_int = 8;
3505pub const FUTEX_WAIT_BITSET: c_int = 9;
3506pub const FUTEX_WAKE_BITSET: c_int = 10;
3507pub const FUTEX_WAIT_REQUEUE_PI: c_int = 11;
3508pub const FUTEX_CMP_REQUEUE_PI: c_int = 12;
3509pub const FUTEX_LOCK_PI2: c_int = 13;
3510
3511pub const FUTEX_PRIVATE_FLAG: c_int = 128;
3512pub const FUTEX_CLOCK_REALTIME: c_int = 256;
3513pub const FUTEX_CMD_MASK: c_int = !(FUTEX_PRIVATE_FLAG | FUTEX_CLOCK_REALTIME);
3514
3515pub const FUTEX_WAITERS: u32 = 0x80000000;
3516pub const FUTEX_OWNER_DIED: u32 = 0x40000000;
3517pub const FUTEX_TID_MASK: u32 = 0x3fffffff;
3518
3519pub const FUTEX_BITSET_MATCH_ANY: c_int = 0xffffffff;
3520
3521pub const FUTEX_OP_SET: c_int = 0;
3522pub const FUTEX_OP_ADD: c_int = 1;
3523pub const FUTEX_OP_OR: c_int = 2;
3524pub const FUTEX_OP_ANDN: c_int = 3;
3525pub const FUTEX_OP_XOR: c_int = 4;
3526
3527pub const FUTEX_OP_OPARG_SHIFT: c_int = 8;
3528
3529pub const FUTEX_OP_CMP_EQ: c_int = 0;
3530pub const FUTEX_OP_CMP_NE: c_int = 1;
3531pub const FUTEX_OP_CMP_LT: c_int = 2;
3532pub const FUTEX_OP_CMP_LE: c_int = 3;
3533pub const FUTEX_OP_CMP_GT: c_int = 4;
3534pub const FUTEX_OP_CMP_GE: c_int = 5;
3535
3536pub fn FUTEX_OP(op: c_int, oparg: c_int, cmp: c_int, cmparg: c_int) -> c_int {
3537 ((op & 0xf) << 28) | ((cmp & 0xf) << 24) | ((oparg & 0xfff) << 12) | (cmparg & 0xfff)
3538}
3539
3540pub const KEXEC_ON_CRASH: c_int = 0x00000001;
3542pub const KEXEC_PRESERVE_CONTEXT: c_int = 0x00000002;
3543pub const KEXEC_ARCH_MASK: c_int = 0xffff0000;
3544pub const KEXEC_FILE_UNLOAD: c_int = 0x00000001;
3545pub const KEXEC_FILE_ON_CRASH: c_int = 0x00000002;
3546pub const KEXEC_FILE_NO_INITRAMFS: c_int = 0x00000004;
3547
3548pub const LINUX_REBOOT_MAGIC1: c_int = 0xfee1dead;
3550pub const LINUX_REBOOT_MAGIC2: c_int = 672274793;
3551pub const LINUX_REBOOT_MAGIC2A: c_int = 85072278;
3552pub const LINUX_REBOOT_MAGIC2B: c_int = 369367448;
3553pub const LINUX_REBOOT_MAGIC2C: c_int = 537993216;
3554
3555pub const LINUX_REBOOT_CMD_RESTART: c_int = 0x01234567;
3556pub const LINUX_REBOOT_CMD_HALT: c_int = 0xCDEF0123;
3557pub const LINUX_REBOOT_CMD_CAD_ON: c_int = 0x89ABCDEF;
3558pub const LINUX_REBOOT_CMD_CAD_OFF: c_int = 0x00000000;
3559pub const LINUX_REBOOT_CMD_POWER_OFF: c_int = 0x4321FEDC;
3560pub const LINUX_REBOOT_CMD_RESTART2: c_int = 0xA1B2C3D4;
3561pub const LINUX_REBOOT_CMD_SW_SUSPEND: c_int = 0xD000FCE2;
3562pub const LINUX_REBOOT_CMD_KEXEC: c_int = 0x45584543;
3563
3564pub const SO_EE_ORIGIN_NONE: u8 = 0;
3566pub const SO_EE_ORIGIN_LOCAL: u8 = 1;
3567pub const SO_EE_ORIGIN_ICMP: u8 = 2;
3568pub const SO_EE_ORIGIN_ICMP6: u8 = 3;
3569pub const SO_EE_ORIGIN_TXSTATUS: u8 = 4;
3570pub const SO_EE_ORIGIN_TIMESTAMPING: u8 = SO_EE_ORIGIN_TXSTATUS;
3571
3572pub const SCTP_FUTURE_ASSOC: c_int = 0;
3574pub const SCTP_CURRENT_ASSOC: c_int = 1;
3575pub const SCTP_ALL_ASSOC: c_int = 2;
3576pub const SCTP_RTOINFO: c_int = 0;
3577pub const SCTP_ASSOCINFO: c_int = 1;
3578pub const SCTP_INITMSG: c_int = 2;
3579pub const SCTP_NODELAY: c_int = 3;
3580pub const SCTP_AUTOCLOSE: c_int = 4;
3581pub const SCTP_SET_PEER_PRIMARY_ADDR: c_int = 5;
3582pub const SCTP_PRIMARY_ADDR: c_int = 6;
3583pub const SCTP_ADAPTATION_LAYER: c_int = 7;
3584pub const SCTP_DISABLE_FRAGMENTS: c_int = 8;
3585pub const SCTP_PEER_ADDR_PARAMS: c_int = 9;
3586pub const SCTP_DEFAULT_SEND_PARAM: c_int = 10;
3587pub const SCTP_EVENTS: c_int = 11;
3588pub const SCTP_I_WANT_MAPPED_V4_ADDR: c_int = 12;
3589pub const SCTP_MAXSEG: c_int = 13;
3590pub const SCTP_STATUS: c_int = 14;
3591pub const SCTP_GET_PEER_ADDR_INFO: c_int = 15;
3592pub const SCTP_DELAYED_ACK_TIME: c_int = 16;
3593pub const SCTP_DELAYED_ACK: c_int = SCTP_DELAYED_ACK_TIME;
3594pub const SCTP_DELAYED_SACK: c_int = SCTP_DELAYED_ACK_TIME;
3595pub const SCTP_CONTEXT: c_int = 17;
3596pub const SCTP_FRAGMENT_INTERLEAVE: c_int = 18;
3597pub const SCTP_PARTIAL_DELIVERY_POINT: c_int = 19;
3598pub const SCTP_MAX_BURST: c_int = 20;
3599pub const SCTP_AUTH_CHUNK: c_int = 21;
3600pub const SCTP_HMAC_IDENT: c_int = 22;
3601pub const SCTP_AUTH_KEY: c_int = 23;
3602pub const SCTP_AUTH_ACTIVE_KEY: c_int = 24;
3603pub const SCTP_AUTH_DELETE_KEY: c_int = 25;
3604pub const SCTP_PEER_AUTH_CHUNKS: c_int = 26;
3605pub const SCTP_LOCAL_AUTH_CHUNKS: c_int = 27;
3606pub const SCTP_GET_ASSOC_NUMBER: c_int = 28;
3607pub const SCTP_GET_ASSOC_ID_LIST: c_int = 29;
3608pub const SCTP_AUTO_ASCONF: c_int = 30;
3609pub const SCTP_PEER_ADDR_THLDS: c_int = 31;
3610pub const SCTP_RECVRCVINFO: c_int = 32;
3611pub const SCTP_RECVNXTINFO: c_int = 33;
3612pub const SCTP_DEFAULT_SNDINFO: c_int = 34;
3613pub const SCTP_AUTH_DEACTIVATE_KEY: c_int = 35;
3614pub const SCTP_REUSE_PORT: c_int = 36;
3615pub const SCTP_PEER_ADDR_THLDS_V2: c_int = 37;
3616pub const SCTP_PR_SCTP_NONE: c_int = 0x0000;
3617pub const SCTP_PR_SCTP_TTL: c_int = 0x0010;
3618pub const SCTP_PR_SCTP_RTX: c_int = 0x0020;
3619pub const SCTP_PR_SCTP_PRIO: c_int = 0x0030;
3620pub const SCTP_PR_SCTP_MAX: c_int = SCTP_PR_SCTP_PRIO;
3621pub const SCTP_PR_SCTP_MASK: c_int = 0x0030;
3622pub const SCTP_ENABLE_RESET_STREAM_REQ: c_int = 0x01;
3623pub const SCTP_ENABLE_RESET_ASSOC_REQ: c_int = 0x02;
3624pub const SCTP_ENABLE_CHANGE_ASSOC_REQ: c_int = 0x04;
3625pub const SCTP_ENABLE_STRRESET_MASK: c_int = 0x07;
3626pub const SCTP_STREAM_RESET_INCOMING: c_int = 0x01;
3627pub const SCTP_STREAM_RESET_OUTGOING: c_int = 0x02;
3628
3629pub const SCTP_INIT: c_int = 0;
3630pub const SCTP_SNDRCV: c_int = 1;
3631pub const SCTP_SNDINFO: c_int = 2;
3632pub const SCTP_RCVINFO: c_int = 3;
3633pub const SCTP_NXTINFO: c_int = 4;
3634pub const SCTP_PRINFO: c_int = 5;
3635pub const SCTP_AUTHINFO: c_int = 6;
3636pub const SCTP_DSTADDRV4: c_int = 7;
3637pub const SCTP_DSTADDRV6: c_int = 8;
3638
3639pub const SCTP_UNORDERED: c_int = 1 << 0;
3640pub const SCTP_ADDR_OVER: c_int = 1 << 1;
3641pub const SCTP_ABORT: c_int = 1 << 2;
3642pub const SCTP_SACK_IMMEDIATELY: c_int = 1 << 3;
3643pub const SCTP_SENDALL: c_int = 1 << 6;
3644pub const SCTP_PR_SCTP_ALL: c_int = 1 << 7;
3645pub const SCTP_NOTIFICATION: c_int = MSG_NOTIFICATION;
3646pub const SCTP_EOF: c_int = crate::MSG_FIN;
3647
3648pub const DCCP_SOCKOPT_PACKET_SIZE: c_int = 1;
3650pub const DCCP_SOCKOPT_SERVICE: c_int = 2;
3651pub const DCCP_SOCKOPT_CHANGE_L: c_int = 3;
3652pub const DCCP_SOCKOPT_CHANGE_R: c_int = 4;
3653pub const DCCP_SOCKOPT_GET_CUR_MPS: c_int = 5;
3654pub const DCCP_SOCKOPT_SERVER_TIMEWAIT: c_int = 6;
3655pub const DCCP_SOCKOPT_SEND_CSCOV: c_int = 10;
3656pub const DCCP_SOCKOPT_RECV_CSCOV: c_int = 11;
3657pub const DCCP_SOCKOPT_AVAILABLE_CCIDS: c_int = 12;
3658pub const DCCP_SOCKOPT_CCID: c_int = 13;
3659pub const DCCP_SOCKOPT_TX_CCID: c_int = 14;
3660pub const DCCP_SOCKOPT_RX_CCID: c_int = 15;
3661pub const DCCP_SOCKOPT_QPOLICY_ID: c_int = 16;
3662pub const DCCP_SOCKOPT_QPOLICY_TXQLEN: c_int = 17;
3663pub const DCCP_SOCKOPT_CCID_RX_INFO: c_int = 128;
3664pub const DCCP_SOCKOPT_CCID_TX_INFO: c_int = 192;
3665
3666pub const DCCP_SERVICE_LIST_MAX_LEN: c_int = 32;
3668
3669pub const CTL_KERN: c_int = 1;
3670pub const CTL_VM: c_int = 2;
3671pub const CTL_NET: c_int = 3;
3672pub const CTL_FS: c_int = 5;
3673pub const CTL_DEBUG: c_int = 6;
3674pub const CTL_DEV: c_int = 7;
3675pub const CTL_BUS: c_int = 8;
3676pub const CTL_ABI: c_int = 9;
3677pub const CTL_CPU: c_int = 10;
3678
3679pub const CTL_BUS_ISA: c_int = 1;
3680
3681pub const INOTIFY_MAX_USER_INSTANCES: c_int = 1;
3682pub const INOTIFY_MAX_USER_WATCHES: c_int = 2;
3683pub const INOTIFY_MAX_QUEUED_EVENTS: c_int = 3;
3684
3685pub const KERN_OSTYPE: c_int = 1;
3686pub const KERN_OSRELEASE: c_int = 2;
3687pub const KERN_OSREV: c_int = 3;
3688pub const KERN_VERSION: c_int = 4;
3689pub const KERN_SECUREMASK: c_int = 5;
3690pub const KERN_PROF: c_int = 6;
3691pub const KERN_NODENAME: c_int = 7;
3692pub const KERN_DOMAINNAME: c_int = 8;
3693pub const KERN_PANIC: c_int = 15;
3694pub const KERN_REALROOTDEV: c_int = 16;
3695pub const KERN_SPARC_REBOOT: c_int = 21;
3696pub const KERN_CTLALTDEL: c_int = 22;
3697pub const KERN_PRINTK: c_int = 23;
3698pub const KERN_NAMETRANS: c_int = 24;
3699pub const KERN_PPC_HTABRECLAIM: c_int = 25;
3700pub const KERN_PPC_ZEROPAGED: c_int = 26;
3701pub const KERN_PPC_POWERSAVE_NAP: c_int = 27;
3702pub const KERN_MODPROBE: c_int = 28;
3703pub const KERN_SG_BIG_BUFF: c_int = 29;
3704pub const KERN_ACCT: c_int = 30;
3705pub const KERN_PPC_L2CR: c_int = 31;
3706pub const KERN_RTSIGNR: c_int = 32;
3707pub const KERN_RTSIGMAX: c_int = 33;
3708pub const KERN_SHMMAX: c_int = 34;
3709pub const KERN_MSGMAX: c_int = 35;
3710pub const KERN_MSGMNB: c_int = 36;
3711pub const KERN_MSGPOOL: c_int = 37;
3712pub const KERN_SYSRQ: c_int = 38;
3713pub const KERN_MAX_THREADS: c_int = 39;
3714pub const KERN_RANDOM: c_int = 40;
3715pub const KERN_SHMALL: c_int = 41;
3716pub const KERN_MSGMNI: c_int = 42;
3717pub const KERN_SEM: c_int = 43;
3718pub const KERN_SPARC_STOP_A: c_int = 44;
3719pub const KERN_SHMMNI: c_int = 45;
3720pub const KERN_OVERFLOWUID: c_int = 46;
3721pub const KERN_OVERFLOWGID: c_int = 47;
3722pub const KERN_SHMPATH: c_int = 48;
3723pub const KERN_HOTPLUG: c_int = 49;
3724pub const KERN_IEEE_EMULATION_WARNINGS: c_int = 50;
3725pub const KERN_S390_USER_DEBUG_LOGGING: c_int = 51;
3726pub const KERN_CORE_USES_PID: c_int = 52;
3727pub const KERN_TAINTED: c_int = 53;
3728pub const KERN_CADPID: c_int = 54;
3729pub const KERN_PIDMAX: c_int = 55;
3730pub const KERN_CORE_PATTERN: c_int = 56;
3731pub const KERN_PANIC_ON_OOPS: c_int = 57;
3732pub const KERN_HPPA_PWRSW: c_int = 58;
3733pub const KERN_HPPA_UNALIGNED: c_int = 59;
3734pub const KERN_PRINTK_RATELIMIT: c_int = 60;
3735pub const KERN_PRINTK_RATELIMIT_BURST: c_int = 61;
3736pub const KERN_PTY: c_int = 62;
3737pub const KERN_NGROUPS_MAX: c_int = 63;
3738pub const KERN_SPARC_SCONS_PWROFF: c_int = 64;
3739pub const KERN_HZ_TIMER: c_int = 65;
3740pub const KERN_UNKNOWN_NMI_PANIC: c_int = 66;
3741pub const KERN_BOOTLOADER_TYPE: c_int = 67;
3742pub const KERN_RANDOMIZE: c_int = 68;
3743pub const KERN_SETUID_DUMPABLE: c_int = 69;
3744pub const KERN_SPIN_RETRY: c_int = 70;
3745pub const KERN_ACPI_VIDEO_FLAGS: c_int = 71;
3746pub const KERN_IA64_UNALIGNED: c_int = 72;
3747pub const KERN_COMPAT_LOG: c_int = 73;
3748pub const KERN_MAX_LOCK_DEPTH: c_int = 74;
3749pub const KERN_NMI_WATCHDOG: c_int = 75;
3750pub const KERN_PANIC_ON_NMI: c_int = 76;
3751
3752pub const VM_OVERCOMMIT_MEMORY: c_int = 5;
3753pub const VM_PAGE_CLUSTER: c_int = 10;
3754pub const VM_DIRTY_BACKGROUND: c_int = 11;
3755pub const VM_DIRTY_RATIO: c_int = 12;
3756pub const VM_DIRTY_WB_CS: c_int = 13;
3757pub const VM_DIRTY_EXPIRE_CS: c_int = 14;
3758pub const VM_NR_PDFLUSH_THREADS: c_int = 15;
3759pub const VM_OVERCOMMIT_RATIO: c_int = 16;
3760pub const VM_PAGEBUF: c_int = 17;
3761pub const VM_HUGETLB_PAGES: c_int = 18;
3762pub const VM_SWAPPINESS: c_int = 19;
3763pub const VM_LOWMEM_RESERVE_RATIO: c_int = 20;
3764pub const VM_MIN_FREE_KBYTES: c_int = 21;
3765pub const VM_MAX_MAP_COUNT: c_int = 22;
3766pub const VM_LAPTOP_MODE: c_int = 23;
3767pub const VM_BLOCK_DUMP: c_int = 24;
3768pub const VM_HUGETLB_GROUP: c_int = 25;
3769pub const VM_VFS_CACHE_PRESSURE: c_int = 26;
3770pub const VM_LEGACY_VA_LAYOUT: c_int = 27;
3771pub const VM_SWAP_TOKEN_TIMEOUT: c_int = 28;
3772pub const VM_DROP_PAGECACHE: c_int = 29;
3773pub const VM_PERCPU_PAGELIST_FRACTION: c_int = 30;
3774pub const VM_ZONE_RECLAIM_MODE: c_int = 31;
3775pub const VM_MIN_UNMAPPED: c_int = 32;
3776pub const VM_PANIC_ON_OOM: c_int = 33;
3777pub const VM_VDSO_ENABLED: c_int = 34;
3778pub const VM_MIN_SLAB: c_int = 35;
3779
3780pub const NET_CORE: c_int = 1;
3781pub const NET_ETHER: c_int = 2;
3782pub const NET_802: c_int = 3;
3783pub const NET_UNIX: c_int = 4;
3784pub const NET_IPV4: c_int = 5;
3785pub const NET_IPX: c_int = 6;
3786pub const NET_ATALK: c_int = 7;
3787pub const NET_NETROM: c_int = 8;
3788pub const NET_AX25: c_int = 9;
3789pub const NET_BRIDGE: c_int = 10;
3790pub const NET_ROSE: c_int = 11;
3791pub const NET_IPV6: c_int = 12;
3792pub const NET_X25: c_int = 13;
3793pub const NET_TR: c_int = 14;
3794pub const NET_DECNET: c_int = 15;
3795pub const NET_ECONET: c_int = 16;
3796pub const NET_SCTP: c_int = 17;
3797pub const NET_LLC: c_int = 18;
3798pub const NET_NETFILTER: c_int = 19;
3799pub const NET_DCCP: c_int = 20;
3800pub const NET_IRDA: c_int = 412;
3801
3802pub const PF_VCPU: c_int = 0x00000001;
3805pub const PF_IDLE: c_int = 0x00000002;
3807pub const PF_EXITING: c_int = 0x00000004;
3809pub const PF_POSTCOREDUMP: c_int = 0x00000008;
3811pub const PF_IO_WORKER: c_int = 0x00000010;
3813pub const PF_WQ_WORKER: c_int = 0x00000020;
3815pub const PF_FORKNOEXEC: c_int = 0x00000040;
3817pub const PF_MCE_PROCESS: c_int = 0x00000080;
3819pub const PF_SUPERPRIV: c_int = 0x00000100;
3821pub const PF_DUMPCORE: c_int = 0x00000200;
3823pub const PF_SIGNALED: c_int = 0x00000400;
3825pub const PF_MEMALLOC: c_int = 0x00000800;
3829pub const PF_NPROC_EXCEEDED: c_int = 0x00001000;
3831pub const PF_USED_MATH: c_int = 0x00002000;
3833pub const PF_USER_WORKER: c_int = 0x00004000;
3835pub const PF_NOFREEZE: c_int = 0x00008000;
3837pub const PF_KSWAPD: c_int = 0x00020000;
3839pub const PF_MEMALLOC_NOFS: c_int = 0x00040000;
3843pub const PF_MEMALLOC_NOIO: c_int = 0x00080000;
3847pub const PF_LOCAL_THROTTLE: c_int = 0x00100000;
3850pub const PF_KTHREAD: c_int = 0x00200000;
3852pub const PF_RANDOMIZE: c_int = 0x00400000;
3854pub const PF_NO_SETAFFINITY: c_int = 0x04000000;
3856pub const PF_MCE_EARLY: c_int = 0x08000000;
3858pub const PF_MEMALLOC_PIN: c_int = 0x10000000;
3862pub const PF_BLOCK_TS: c_int = 0x20000000;
3864pub const PF_SUSPEND_TASK: c_int = PF_SUSPEND_TASK_UINT as _;
3866const PF_SUSPEND_TASK_UINT: c_uint = 0x80000000;
3872
3873pub const CLONE_PIDFD: c_int = 0x1000;
3874
3875pub const SCHED_FLAG_RESET_ON_FORK: c_int = 0x01;
3876pub const SCHED_FLAG_RECLAIM: c_int = 0x02;
3877pub const SCHED_FLAG_DL_OVERRUN: c_int = 0x04;
3878pub const SCHED_FLAG_KEEP_POLICY: c_int = 0x08;
3879pub const SCHED_FLAG_KEEP_PARAMS: c_int = 0x10;
3880pub const SCHED_FLAG_UTIL_CLAMP_MIN: c_int = 0x20;
3881pub const SCHED_FLAG_UTIL_CLAMP_MAX: c_int = 0x40;
3882
3883pub const XDP_SHARED_UMEM: crate::__u16 = 1 << 0;
3885pub const XDP_COPY: crate::__u16 = 1 << 1;
3886pub const XDP_ZEROCOPY: crate::__u16 = 1 << 2;
3887pub const XDP_USE_NEED_WAKEUP: crate::__u16 = 1 << 3;
3888pub const XDP_USE_SG: crate::__u16 = 1 << 4;
3889
3890pub const XDP_UMEM_UNALIGNED_CHUNK_FLAG: crate::__u32 = 1 << 0;
3891
3892pub const XDP_RING_NEED_WAKEUP: crate::__u32 = 1 << 0;
3893
3894pub const XDP_MMAP_OFFSETS: c_int = 1;
3895pub const XDP_RX_RING: c_int = 2;
3896pub const XDP_TX_RING: c_int = 3;
3897pub const XDP_UMEM_REG: c_int = 4;
3898pub const XDP_UMEM_FILL_RING: c_int = 5;
3899pub const XDP_UMEM_COMPLETION_RING: c_int = 6;
3900pub const XDP_STATISTICS: c_int = 7;
3901pub const XDP_OPTIONS: c_int = 8;
3902
3903pub const XDP_OPTIONS_ZEROCOPY: crate::__u32 = 1 << 0;
3904
3905pub const XDP_PGOFF_RX_RING: crate::off_t = 0;
3906pub const XDP_PGOFF_TX_RING: crate::off_t = 0x80000000;
3907pub const XDP_UMEM_PGOFF_FILL_RING: crate::c_ulonglong = 0x100000000;
3908pub const XDP_UMEM_PGOFF_COMPLETION_RING: crate::c_ulonglong = 0x180000000;
3909
3910pub const XSK_UNALIGNED_BUF_OFFSET_SHIFT: crate::c_int = 48;
3911pub const XSK_UNALIGNED_BUF_ADDR_MASK: crate::c_ulonglong =
3912 (1 << XSK_UNALIGNED_BUF_OFFSET_SHIFT) - 1;
3913
3914pub const XDP_PKT_CONTD: crate::__u32 = 1 << 0;
3915
3916pub const XDP_UMEM_TX_SW_CSUM: crate::__u32 = 1 << 1;
3917pub const XDP_UMEM_TX_METADATA_LEN: crate::__u32 = 1 << 2;
3918
3919pub const XDP_TXMD_FLAGS_TIMESTAMP: crate::__u32 = 1 << 0;
3920pub const XDP_TXMD_FLAGS_CHECKSUM: crate::__u32 = 1 << 1;
3921
3922pub const XDP_TX_METADATA: crate::__u32 = 1 << 1;
3923
3924pub const SOL_XDP: c_int = 283;
3925
3926pub const MOUNT_ATTR_RDONLY: crate::__u64 = 0x00000001;
3928pub const MOUNT_ATTR_NOSUID: crate::__u64 = 0x00000002;
3929pub const MOUNT_ATTR_NODEV: crate::__u64 = 0x00000004;
3930pub const MOUNT_ATTR_NOEXEC: crate::__u64 = 0x00000008;
3931pub const MOUNT_ATTR__ATIME: crate::__u64 = 0x00000070;
3932pub const MOUNT_ATTR_RELATIME: crate::__u64 = 0x00000000;
3933pub const MOUNT_ATTR_NOATIME: crate::__u64 = 0x00000010;
3934pub const MOUNT_ATTR_STRICTATIME: crate::__u64 = 0x00000020;
3935pub const MOUNT_ATTR_NODIRATIME: crate::__u64 = 0x00000080;
3936pub const MOUNT_ATTR_IDMAP: crate::__u64 = 0x00100000;
3937pub const MOUNT_ATTR_NOSYMFOLLOW: crate::__u64 = 0x00200000;
3938
3939pub const MOUNT_ATTR_SIZE_VER0: c_int = 32;
3940
3941pub const SCHED_FLAG_KEEP_ALL: c_int = SCHED_FLAG_KEEP_POLICY | SCHED_FLAG_KEEP_PARAMS;
3942
3943pub const SCHED_FLAG_UTIL_CLAMP: c_int = SCHED_FLAG_UTIL_CLAMP_MIN | SCHED_FLAG_UTIL_CLAMP_MAX;
3944
3945pub const SCHED_FLAG_ALL: c_int = SCHED_FLAG_RESET_ON_FORK
3946 | SCHED_FLAG_RECLAIM
3947 | SCHED_FLAG_DL_OVERRUN
3948 | SCHED_FLAG_KEEP_ALL
3949 | SCHED_FLAG_UTIL_CLAMP;
3950
3951pub const EPIOCSPARAMS: Ioctl = 0x40088a01;
3953pub const EPIOCGPARAMS: Ioctl = 0x80088a02;
3954
3955pub const SI_DETHREAD: c_int = -7;
3957pub const TRAP_PERF: c_int = 6;
3958
3959#[inline]
pub unsafe extern "C" fn SUN_LEN(s: crate::sockaddr_un) -> usize {
({
#[allow(clippy :: unneeded_field_pattern)]
let crate::sockaddr_un { sun_path: _, .. };
let data = core::mem::MaybeUninit::<crate::sockaddr_un>::uninit();
let ptr = data.as_ptr();
#[allow(unused_unsafe)]
let fptr = unsafe { &raw const (*ptr).sun_path };
let off = (fptr as usize).checked_sub(ptr as usize).unwrap();
if !(off <= core::mem::size_of::<crate::sockaddr_un>()) {
::core::panicking::panic("assertion failed: off <= core::mem::size_of::<crate::sockaddr_un>()")
};
off
}) + crate::strlen(s.sun_path.as_ptr())
}f! {
3960 pub fn SCTP_PR_INDEX(policy: c_int) -> c_int {
3961 policy >> (4 - 1)
3962 }
3963
3964 pub fn SCTP_PR_POLICY(policy: c_int) -> c_int {
3965 policy & SCTP_PR_SCTP_MASK
3966 }
3967
3968 pub fn SCTP_PR_SET_POLICY(flags: &mut c_int, policy: c_int) -> () {
3969 *flags &= !SCTP_PR_SCTP_MASK;
3970 *flags |= policy;
3971 }
3972
3973 pub fn SO_EE_OFFENDER(ee: *const crate::sock_extended_err) -> *mut crate::sockaddr {
3974 ee.offset(1) as *mut crate::sockaddr
3975 }
3976
3977 pub fn TPACKET_ALIGN(x: usize) -> usize {
3978 (x + TPACKET_ALIGNMENT - 1) & !(TPACKET_ALIGNMENT - 1)
3979 }
3980
3981 pub fn BPF_CLASS(code: __u32) -> __u32 {
3982 code & 0x07
3983 }
3984
3985 pub fn BPF_SIZE(code: __u32) -> __u32 {
3986 code & 0x18
3987 }
3988
3989 pub fn BPF_MODE(code: __u32) -> __u32 {
3990 code & 0xe0
3991 }
3992
3993 pub fn BPF_OP(code: __u32) -> __u32 {
3994 code & 0xf0
3995 }
3996
3997 pub fn BPF_SRC(code: __u32) -> __u32 {
3998 code & 0x08
3999 }
4000
4001 pub fn BPF_RVAL(code: __u32) -> __u32 {
4002 code & 0x18
4003 }
4004
4005 pub fn BPF_MISCOP(code: __u32) -> __u32 {
4006 code & 0xf8
4007 }
4008
4009 pub fn BPF_STMT(code: __u16, k: __u32) -> sock_filter {
4010 sock_filter {
4011 code,
4012 jt: 0,
4013 jf: 0,
4014 k,
4015 }
4016 }
4017
4018 pub fn BPF_JUMP(code: __u16, k: __u32, jt: __u8, jf: __u8) -> sock_filter {
4019 sock_filter { code, jt, jf, k }
4020 }
4021
4022 #[cfg(target_env = "gnu")]
4023 pub fn SUN_LEN(s: crate::sockaddr_un) -> usize {
4024 offset_of!(crate::sockaddr_un, sun_path) + crate::strlen(s.sun_path.as_ptr())
4025 }
4026
4027 #[cfg(target_env = "musl")]
4028 pub fn SUN_LEN(s: crate::sockaddr_un) -> usize {
4029 2 * crate::strlen(s.sun_path.as_ptr())
4030 }
4031}
4032
4033#[inline]
pub const extern "C" fn SCTP_PR_PRIO_ENABLED(policy: c_int) -> bool {
policy == SCTP_PR_SCTP_PRIO
}safe_f! {
4034 pub const fn SCTP_PR_TTL_ENABLED(policy: c_int) -> bool {
4035 policy == SCTP_PR_SCTP_TTL
4036 }
4037
4038 pub const fn SCTP_PR_RTX_ENABLED(policy: c_int) -> bool {
4039 policy == SCTP_PR_SCTP_RTX
4040 }
4041
4042 pub const fn SCTP_PR_PRIO_ENABLED(policy: c_int) -> bool {
4043 policy == SCTP_PR_SCTP_PRIO
4044 }
4045}
4046
4047cfg_if! {
4049 if #[cfg(not(target_env = "ohos"))] {
4050 extern "C" {
4051 pub fn getspnam_r(
4055 name: *const c_char,
4056 spbuf: *mut crate::spwd,
4057 buf: *mut c_char,
4058 buflen: size_t,
4059 spbufp: *mut *mut crate::spwd,
4060 ) -> c_int;
4061
4062 pub fn mq_open(name: *const c_char, oflag: c_int, ...) -> mqd_t;
4063 pub fn mq_close(mqd: mqd_t) -> c_int;
4064 pub fn mq_unlink(name: *const c_char) -> c_int;
4065 pub fn mq_receive(
4066 mqd: mqd_t,
4067 msg_ptr: *mut c_char,
4068 msg_len: size_t,
4069 msg_prio: *mut c_uint,
4070 ) -> ssize_t;
4071 #[cfg_attr(
4072 any(gnu_time_bits64, musl32_time64),
4073 link_name = "__mq_timedreceive_time64"
4074 )]
4075 pub fn mq_timedreceive(
4076 mqd: mqd_t,
4077 msg_ptr: *mut c_char,
4078 msg_len: size_t,
4079 msg_prio: *mut c_uint,
4080 abs_timeout: *const crate::timespec,
4081 ) -> ssize_t;
4082 pub fn mq_send(
4083 mqd: mqd_t,
4084 msg_ptr: *const c_char,
4085 msg_len: size_t,
4086 msg_prio: c_uint,
4087 ) -> c_int;
4088 #[cfg_attr(
4089 any(gnu_time_bits64, musl32_time64),
4090 link_name = "__mq_timedsend_time64"
4091 )]
4092 pub fn mq_timedsend(
4093 mqd: mqd_t,
4094 msg_ptr: *const c_char,
4095 msg_len: size_t,
4096 msg_prio: c_uint,
4097 abs_timeout: *const crate::timespec,
4098 ) -> c_int;
4099 pub fn mq_getattr(mqd: mqd_t, attr: *mut crate::mq_attr) -> c_int;
4100 pub fn mq_setattr(
4101 mqd: mqd_t,
4102 newattr: *const crate::mq_attr,
4103 oldattr: *mut crate::mq_attr,
4104 ) -> c_int;
4105 }
4106 }
4107}
4108
4109extern "C" {
4110 pub fn mrand48() -> c_long;
4111 pub fn seed48(xseed: *mut c_ushort) -> *mut c_ushort;
4112 pub fn lcong48(p: *mut c_ushort);
4113
4114 #[cfg_attr(gnu_time_bits64, link_name = "__lutimes64")]
4115 #[cfg_attr(musl32_time64, link_name = "__lutimes_time64")]
4116 pub fn lutimes(file: *const c_char, times: *const crate::timeval) -> c_int;
4117
4118 pub fn shm_open(name: *const c_char, oflag: c_int, mode: mode_t) -> c_int;
4119 pub fn shm_unlink(name: *const c_char) -> c_int;
4120
4121 pub fn ftok(pathname: *const c_char, proj_id: c_int) -> crate::key_t;
4123 pub fn semget(key: crate::key_t, nsems: c_int, semflag: c_int) -> c_int;
4124 pub fn semop(semid: c_int, sops: *mut crate::sembuf, nsops: size_t) -> c_int;
4125 #[cfg_attr(gnu_time_bits64, link_name = "__semctl64")]
4126 pub fn semctl(semid: c_int, semnum: c_int, cmd: c_int, ...) -> c_int;
4127 #[cfg_attr(gnu_time_bits64, link_name = "__msgctl64")]
4128 pub fn msgctl(msqid: c_int, cmd: c_int, buf: *mut msqid_ds) -> c_int;
4129 pub fn msgget(key: crate::key_t, msgflg: c_int) -> c_int;
4130 pub fn msgrcv(
4131 msqid: c_int,
4132 msgp: *mut c_void,
4133 msgsz: size_t,
4134 msgtyp: c_long,
4135 msgflg: c_int,
4136 ) -> ssize_t;
4137 pub fn msgsnd(msqid: c_int, msgp: *const c_void, msgsz: size_t, msgflg: c_int) -> c_int;
4138
4139 #[cfg_attr(gnu_file_offset_bits64, link_name = "fallocate64")]
4140 pub fn fallocate(fd: c_int, mode: c_int, offset: off_t, len: off_t) -> c_int;
4141 #[cfg_attr(gnu_file_offset_bits64, link_name = "posix_fallocate64")]
4142 pub fn posix_fallocate(fd: c_int, offset: off_t, len: off_t) -> c_int;
4143 pub fn readahead(fd: c_int, offset: off64_t, count: size_t) -> ssize_t;
4144 pub fn getxattr(
4145 path: *const c_char,
4146 name: *const c_char,
4147 value: *mut c_void,
4148 size: size_t,
4149 ) -> ssize_t;
4150 pub fn lgetxattr(
4151 path: *const c_char,
4152 name: *const c_char,
4153 value: *mut c_void,
4154 size: size_t,
4155 ) -> ssize_t;
4156 pub fn fgetxattr(
4157 filedes: c_int,
4158 name: *const c_char,
4159 value: *mut c_void,
4160 size: size_t,
4161 ) -> ssize_t;
4162 pub fn setxattr(
4163 path: *const c_char,
4164 name: *const c_char,
4165 value: *const c_void,
4166 size: size_t,
4167 flags: c_int,
4168 ) -> c_int;
4169 pub fn lsetxattr(
4170 path: *const c_char,
4171 name: *const c_char,
4172 value: *const c_void,
4173 size: size_t,
4174 flags: c_int,
4175 ) -> c_int;
4176 pub fn fsetxattr(
4177 filedes: c_int,
4178 name: *const c_char,
4179 value: *const c_void,
4180 size: size_t,
4181 flags: c_int,
4182 ) -> c_int;
4183 pub fn listxattr(path: *const c_char, list: *mut c_char, size: size_t) -> ssize_t;
4184 pub fn llistxattr(path: *const c_char, list: *mut c_char, size: size_t) -> ssize_t;
4185 pub fn flistxattr(filedes: c_int, list: *mut c_char, size: size_t) -> ssize_t;
4186 pub fn removexattr(path: *const c_char, name: *const c_char) -> c_int;
4187 pub fn lremovexattr(path: *const c_char, name: *const c_char) -> c_int;
4188 pub fn fremovexattr(filedes: c_int, name: *const c_char) -> c_int;
4189 pub fn signalfd(fd: c_int, mask: *const crate::sigset_t, flags: c_int) -> c_int;
4190 pub fn timerfd_create(clockid: crate::clockid_t, flags: c_int) -> c_int;
4191 #[cfg_attr(any(gnu_time_bits64, musl32_time64), link_name = "__timerfd_gettime64")]
4192 pub fn timerfd_gettime(fd: c_int, curr_value: *mut crate::itimerspec) -> c_int;
4193 #[cfg_attr(any(gnu_time_bits64, musl32_time64), link_name = "__timerfd_settime64")]
4194 pub fn timerfd_settime(
4195 fd: c_int,
4196 flags: c_int,
4197 new_value: *const crate::itimerspec,
4198 old_value: *mut crate::itimerspec,
4199 ) -> c_int;
4200 pub fn quotactl(cmd: c_int, special: *const c_char, id: c_int, data: *mut c_char) -> c_int;
4201 pub fn epoll_pwait(
4202 epfd: c_int,
4203 events: *mut crate::epoll_event,
4204 maxevents: c_int,
4205 timeout: c_int,
4206 sigmask: *const crate::sigset_t,
4207 ) -> c_int;
4208 pub fn dup3(oldfd: c_int, newfd: c_int, flags: c_int) -> c_int;
4209 #[cfg_attr(gnu_time_bits64, link_name = "__sigtimedwait64")]
4210 #[cfg_attr(musl32_time64, link_name = "__sigtimedwait_time64")]
4211 pub fn sigtimedwait(
4212 set: *const sigset_t,
4213 info: *mut siginfo_t,
4214 timeout: *const crate::timespec,
4215 ) -> c_int;
4216 pub fn sigwaitinfo(set: *const sigset_t, info: *mut siginfo_t) -> c_int;
4217 pub fn accept4(fd: c_int, addr: *mut crate::sockaddr, len: *mut socklen_t, flg: c_int)
4218 -> c_int;
4219 pub fn reboot(how_to: c_int) -> c_int;
4220 pub fn setfsgid(gid: crate::gid_t) -> c_int;
4221 pub fn setfsuid(uid: crate::uid_t) -> c_int;
4222
4223 pub fn mkfifoat(dirfd: c_int, pathname: *const c_char, mode: mode_t) -> c_int;
4225 pub fn sync_file_range(fd: c_int, offset: off64_t, nbytes: off64_t, flags: c_uint) -> c_int;
4226
4227 pub fn posix_madvise(addr: *mut c_void, len: size_t, advice: c_int) -> c_int;
4228
4229 pub fn remap_file_pages(
4230 addr: *mut c_void,
4231 size: size_t,
4232 prot: c_int,
4233 pgoff: size_t,
4234 flags: c_int,
4235 ) -> c_int;
4236 #[cfg_attr(gnu_file_offset_bits64, link_name = "mkstemps64")]
4237 pub fn mkstemps(template: *mut c_char, suffixlen: c_int) -> c_int;
4238
4239 pub fn vhangup() -> c_int;
4240 pub fn sync();
4241 pub fn syncfs(fd: c_int) -> c_int;
4242 pub fn syscall(num: c_long, ...) -> c_long;
4243 pub fn sched_setaffinity(
4244 pid: crate::pid_t,
4245 cpusetsize: size_t,
4246 cpuset: *const crate::cpu_set_t,
4247 ) -> c_int;
4248 pub fn epoll_create(size: c_int) -> c_int;
4249 pub fn epoll_create1(flags: c_int) -> c_int;
4250 pub fn epoll_wait(
4251 epfd: c_int,
4252 events: *mut crate::epoll_event,
4253 maxevents: c_int,
4254 timeout: c_int,
4255 ) -> c_int;
4256 pub fn epoll_ctl(epfd: c_int, op: c_int, fd: c_int, event: *mut crate::epoll_event) -> c_int;
4257 pub fn unshare(flags: c_int) -> c_int;
4258 pub fn umount(target: *const c_char) -> c_int;
4259 pub fn tee(fd_in: c_int, fd_out: c_int, len: size_t, flags: c_uint) -> ssize_t;
4260 pub fn splice(
4261 fd_in: c_int,
4262 off_in: *mut loff_t,
4263 fd_out: c_int,
4264 off_out: *mut loff_t,
4265 len: size_t,
4266 flags: c_uint,
4267 ) -> ssize_t;
4268 pub fn eventfd(initval: c_uint, flags: c_int) -> c_int;
4269 pub fn eventfd_read(fd: c_int, value: *mut eventfd_t) -> c_int;
4270 pub fn eventfd_write(fd: c_int, value: eventfd_t) -> c_int;
4271
4272 #[cfg_attr(gnu_time_bits64, link_name = "__sched_rr_get_interval64")]
4273 #[cfg_attr(musl32_time64, link_name = "__sched_rr_get_interval_time64")]
4274 pub fn sched_rr_get_interval(pid: crate::pid_t, tp: *mut crate::timespec) -> c_int;
4275 pub fn sched_setparam(pid: crate::pid_t, param: *const crate::sched_param) -> c_int;
4276 pub fn setns(fd: c_int, nstype: c_int) -> c_int;
4277 pub fn swapoff(path: *const c_char) -> c_int;
4278 pub fn vmsplice(fd: c_int, iov: *const crate::iovec, nr_segs: size_t, flags: c_uint)
4279 -> ssize_t;
4280 pub fn personality(persona: c_ulong) -> c_int;
4281 pub fn sched_getparam(pid: crate::pid_t, param: *mut crate::sched_param) -> c_int;
4282 pub fn clone(
4283 cb: extern "C" fn(*mut c_void) -> c_int,
4284 child_stack: *mut c_void,
4285 flags: c_int,
4286 arg: *mut c_void,
4287 ...
4288 ) -> c_int;
4289 pub fn sched_getscheduler(pid: crate::pid_t) -> c_int;
4290 #[cfg_attr(
4291 any(gnu_time_bits64, musl32_time64),
4292 link_name = "__clock_nanosleep_time64"
4293 )]
4294 pub fn clock_nanosleep(
4295 clk_id: crate::clockid_t,
4296 flags: c_int,
4297 rqtp: *const crate::timespec,
4298 rmtp: *mut crate::timespec,
4299 ) -> c_int;
4300 pub fn umount2(target: *const c_char, flags: c_int) -> c_int;
4301 pub fn swapon(path: *const c_char, swapflags: c_int) -> c_int;
4302 pub fn sched_setscheduler(
4303 pid: crate::pid_t,
4304 policy: c_int,
4305 param: *const crate::sched_param,
4306 ) -> c_int;
4307 #[cfg_attr(gnu_file_offset_bits64, link_name = "sendfile64")]
4308 pub fn sendfile(out_fd: c_int, in_fd: c_int, offset: *mut off_t, count: size_t) -> ssize_t;
4309 pub fn sigaltstack(ss: *const stack_t, oss: *mut stack_t) -> c_int;
4310 pub fn getdtablesize() -> c_int;
4311 pub fn getgrouplist(
4312 user: *const c_char,
4313 group: crate::gid_t,
4314 groups: *mut crate::gid_t,
4315 ngroups: *mut c_int,
4316 ) -> c_int;
4317 pub fn posix_spawn(
4318 pid: *mut crate::pid_t,
4319 path: *const c_char,
4320 file_actions: *const crate::posix_spawn_file_actions_t,
4321 attrp: *const crate::posix_spawnattr_t,
4322 argv: *const *mut c_char,
4323 envp: *const *mut c_char,
4324 ) -> c_int;
4325 pub fn posix_spawnp(
4326 pid: *mut crate::pid_t,
4327 file: *const c_char,
4328 file_actions: *const crate::posix_spawn_file_actions_t,
4329 attrp: *const crate::posix_spawnattr_t,
4330 argv: *const *mut c_char,
4331 envp: *const *mut c_char,
4332 ) -> c_int;
4333 pub fn posix_spawnattr_init(attr: *mut posix_spawnattr_t) -> c_int;
4334 pub fn posix_spawnattr_destroy(attr: *mut posix_spawnattr_t) -> c_int;
4335 pub fn posix_spawnattr_getsigdefault(
4336 attr: *const posix_spawnattr_t,
4337 default: *mut crate::sigset_t,
4338 ) -> c_int;
4339 pub fn posix_spawnattr_setsigdefault(
4340 attr: *mut posix_spawnattr_t,
4341 default: *const crate::sigset_t,
4342 ) -> c_int;
4343 pub fn posix_spawnattr_getsigmask(
4344 attr: *const posix_spawnattr_t,
4345 default: *mut crate::sigset_t,
4346 ) -> c_int;
4347 pub fn posix_spawnattr_setsigmask(
4348 attr: *mut posix_spawnattr_t,
4349 default: *const crate::sigset_t,
4350 ) -> c_int;
4351 pub fn posix_spawnattr_getflags(attr: *const posix_spawnattr_t, flags: *mut c_short) -> c_int;
4352 pub fn posix_spawnattr_setflags(attr: *mut posix_spawnattr_t, flags: c_short) -> c_int;
4353 pub fn posix_spawnattr_getpgroup(
4354 attr: *const posix_spawnattr_t,
4355 flags: *mut crate::pid_t,
4356 ) -> c_int;
4357 pub fn posix_spawnattr_setpgroup(attr: *mut posix_spawnattr_t, flags: crate::pid_t) -> c_int;
4358 pub fn posix_spawnattr_getschedpolicy(
4359 attr: *const posix_spawnattr_t,
4360 flags: *mut c_int,
4361 ) -> c_int;
4362 pub fn posix_spawnattr_setschedpolicy(attr: *mut posix_spawnattr_t, flags: c_int) -> c_int;
4363 pub fn posix_spawnattr_getschedparam(
4364 attr: *const posix_spawnattr_t,
4365 param: *mut crate::sched_param,
4366 ) -> c_int;
4367 pub fn posix_spawnattr_setschedparam(
4368 attr: *mut posix_spawnattr_t,
4369 param: *const crate::sched_param,
4370 ) -> c_int;
4371
4372 pub fn posix_spawn_file_actions_init(actions: *mut posix_spawn_file_actions_t) -> c_int;
4373 pub fn posix_spawn_file_actions_destroy(actions: *mut posix_spawn_file_actions_t) -> c_int;
4374 pub fn posix_spawn_file_actions_addopen(
4375 actions: *mut posix_spawn_file_actions_t,
4376 fd: c_int,
4377 path: *const c_char,
4378 oflag: c_int,
4379 mode: mode_t,
4380 ) -> c_int;
4381 pub fn posix_spawn_file_actions_addclose(
4382 actions: *mut posix_spawn_file_actions_t,
4383 fd: c_int,
4384 ) -> c_int;
4385 pub fn posix_spawn_file_actions_adddup2(
4386 actions: *mut posix_spawn_file_actions_t,
4387 fd: c_int,
4388 newfd: c_int,
4389 ) -> c_int;
4390 pub fn fread_unlocked(
4391 buf: *mut c_void,
4392 size: size_t,
4393 nobj: size_t,
4394 stream: *mut crate::FILE,
4395 ) -> size_t;
4396 pub fn inotify_rm_watch(fd: c_int, wd: c_int) -> c_int;
4397 pub fn inotify_init() -> c_int;
4398 pub fn inotify_init1(flags: c_int) -> c_int;
4399 pub fn inotify_add_watch(fd: c_int, path: *const c_char, mask: u32) -> c_int;
4400 pub fn fanotify_init(flags: c_uint, event_f_flags: c_uint) -> c_int;
4401
4402 pub fn gethostid() -> c_long;
4403
4404 pub fn klogctl(syslog_type: c_int, bufp: *mut c_char, len: c_int) -> c_int;
4405}
4406
4407cfg_if! {
4411 if #[cfg(not(any(target_env = "musl", target_env = "ohos")))] {
4412 extern "C" {
4413 pub fn fallocate64(fd: c_int, mode: c_int, offset: off64_t, len: off64_t) -> c_int;
4414 pub fn fgetpos64(stream: *mut crate::FILE, ptr: *mut crate::fpos64_t) -> c_int;
4415 pub fn fopen64(filename: *const c_char, mode: *const c_char) -> *mut crate::FILE;
4416 pub fn posix_fallocate64(fd: c_int, offset: off64_t, len: off64_t) -> c_int;
4417 pub fn sendfile64(
4418 out_fd: c_int,
4419 in_fd: c_int,
4420 offset: *mut off64_t,
4421 count: size_t,
4422 ) -> ssize_t;
4423 pub fn tmpfile64() -> *mut crate::FILE;
4424 }
4425 }
4426}
4427
4428cfg_if! {
4429 if #[cfg(target_env = "uclibc")] {
4430 mod uclibc;
4431 pub use self::uclibc::*;
4432 } else if #[cfg(any(target_env = "musl", target_env = "ohos"))] {
4433 mod musl;
4434 pub use self::musl::*;
4435 } else if #[cfg(target_env = "gnu")] {
4436 mod gnu;
4437 pub use self::gnu::*;
4438 }
4439}
4440
4441mod arch;
4442pub use self::arch::*;