-
Notifications
You must be signed in to change notification settings - Fork 1.1k
/
Copy pathmod.rs
5679 lines (5208 loc) · 191 KB
/
mod.rs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
pub type fflags_t = u32;
pub type clock_t = i32;
pub type vm_prot_t = u_char;
pub type kvaddr_t = u64;
pub type segsz_t = isize;
pub type __fixpt_t = u32;
pub type fixpt_t = __fixpt_t;
pub type __lwpid_t = i32;
pub type lwpid_t = __lwpid_t;
pub type blksize_t = i32;
pub type clockid_t = ::c_int;
pub type sem_t = _sem;
pub type timer_t = *mut __c_anonymous__timer;
pub type fsblkcnt_t = u64;
pub type fsfilcnt_t = u64;
pub type idtype_t = ::c_uint;
pub type msglen_t = ::c_ulong;
pub type msgqnum_t = ::c_ulong;
pub type cpulevel_t = ::c_int;
pub type cpuwhich_t = ::c_int;
pub type mqd_t = *mut ::c_void;
pub type posix_spawnattr_t = *mut ::c_void;
pub type posix_spawn_file_actions_t = *mut ::c_void;
pub type pthread_spinlock_t = *mut __c_anonymous_pthread_spinlock;
pub type pthread_barrierattr_t = *mut __c_anonymous_pthread_barrierattr;
pub type pthread_barrier_t = *mut __c_anonymous_pthread_barrier;
pub type uuid_t = ::uuid;
pub type u_int = ::c_uint;
pub type u_char = ::c_uchar;
pub type u_long = ::c_ulong;
pub type u_short = ::c_ushort;
pub type caddr_t = *mut ::c_char;
pub type fhandle_t = fhandle;
pub type au_id_t = ::uid_t;
pub type au_asid_t = ::pid_t;
pub type cpusetid_t = ::c_int;
pub type sctp_assoc_t = u32;
#[cfg_attr(feature = "extra_traits", derive(Debug, Hash, PartialEq, Eq))]
#[repr(u32)]
pub enum devstat_support_flags {
DEVSTAT_ALL_SUPPORTED = 0x00,
DEVSTAT_NO_BLOCKSIZE = 0x01,
DEVSTAT_NO_ORDERED_TAGS = 0x02,
DEVSTAT_BS_UNAVAILABLE = 0x04,
}
impl ::Copy for devstat_support_flags {}
impl ::Clone for devstat_support_flags {
fn clone(&self) -> devstat_support_flags {
*self
}
}
#[cfg_attr(feature = "extra_traits", derive(Debug, Hash, PartialEq, Eq))]
#[repr(u32)]
pub enum devstat_trans_flags {
DEVSTAT_NO_DATA = 0x00,
DEVSTAT_READ = 0x01,
DEVSTAT_WRITE = 0x02,
DEVSTAT_FREE = 0x03,
}
impl ::Copy for devstat_trans_flags {}
impl ::Clone for devstat_trans_flags {
fn clone(&self) -> devstat_trans_flags {
*self
}
}
#[cfg_attr(feature = "extra_traits", derive(Debug, Hash, PartialEq, Eq))]
#[repr(u32)]
pub enum devstat_tag_type {
DEVSTAT_TAG_SIMPLE = 0x00,
DEVSTAT_TAG_HEAD = 0x01,
DEVSTAT_TAG_ORDERED = 0x02,
DEVSTAT_TAG_NONE = 0x03,
}
impl ::Copy for devstat_tag_type {}
impl ::Clone for devstat_tag_type {
fn clone(&self) -> devstat_tag_type {
*self
}
}
#[cfg_attr(feature = "extra_traits", derive(Debug, Hash, PartialEq, Eq))]
#[repr(u32)]
pub enum devstat_match_flags {
DEVSTAT_MATCH_NONE = 0x00,
DEVSTAT_MATCH_TYPE = 0x01,
DEVSTAT_MATCH_IF = 0x02,
DEVSTAT_MATCH_PASS = 0x04,
}
impl ::Copy for devstat_match_flags {}
impl ::Clone for devstat_match_flags {
fn clone(&self) -> devstat_match_flags {
*self
}
}
#[cfg_attr(feature = "extra_traits", derive(Debug, Hash, PartialEq, Eq))]
#[repr(u32)]
pub enum devstat_priority {
DEVSTAT_PRIORITY_MIN = 0x000,
DEVSTAT_PRIORITY_OTHER = 0x020,
DEVSTAT_PRIORITY_PASS = 0x030,
DEVSTAT_PRIORITY_FD = 0x040,
DEVSTAT_PRIORITY_WFD = 0x050,
DEVSTAT_PRIORITY_TAPE = 0x060,
DEVSTAT_PRIORITY_CD = 0x090,
DEVSTAT_PRIORITY_DISK = 0x110,
DEVSTAT_PRIORITY_ARRAY = 0x120,
DEVSTAT_PRIORITY_MAX = 0xfff,
}
impl ::Copy for devstat_priority {}
impl ::Clone for devstat_priority {
fn clone(&self) -> devstat_priority {
*self
}
}
#[cfg_attr(feature = "extra_traits", derive(Debug, Hash, PartialEq, Eq))]
#[repr(u32)]
pub enum devstat_type_flags {
DEVSTAT_TYPE_DIRECT = 0x000,
DEVSTAT_TYPE_SEQUENTIAL = 0x001,
DEVSTAT_TYPE_PRINTER = 0x002,
DEVSTAT_TYPE_PROCESSOR = 0x003,
DEVSTAT_TYPE_WORM = 0x004,
DEVSTAT_TYPE_CDROM = 0x005,
DEVSTAT_TYPE_SCANNER = 0x006,
DEVSTAT_TYPE_OPTICAL = 0x007,
DEVSTAT_TYPE_CHANGER = 0x008,
DEVSTAT_TYPE_COMM = 0x009,
DEVSTAT_TYPE_ASC0 = 0x00a,
DEVSTAT_TYPE_ASC1 = 0x00b,
DEVSTAT_TYPE_STORARRAY = 0x00c,
DEVSTAT_TYPE_ENCLOSURE = 0x00d,
DEVSTAT_TYPE_FLOPPY = 0x00e,
DEVSTAT_TYPE_MASK = 0x00f,
DEVSTAT_TYPE_IF_SCSI = 0x010,
DEVSTAT_TYPE_IF_IDE = 0x020,
DEVSTAT_TYPE_IF_OTHER = 0x030,
DEVSTAT_TYPE_IF_MASK = 0x0f0,
DEVSTAT_TYPE_PASS = 0x100,
}
impl ::Copy for devstat_type_flags {}
impl ::Clone for devstat_type_flags {
fn clone(&self) -> devstat_type_flags {
*self
}
}
#[cfg_attr(feature = "extra_traits", derive(Debug, Hash, PartialEq, Eq))]
#[repr(u32)]
pub enum devstat_metric {
DSM_NONE,
DSM_TOTAL_BYTES,
DSM_TOTAL_BYTES_READ,
DSM_TOTAL_BYTES_WRITE,
DSM_TOTAL_TRANSFERS,
DSM_TOTAL_TRANSFERS_READ,
DSM_TOTAL_TRANSFERS_WRITE,
DSM_TOTAL_TRANSFERS_OTHER,
DSM_TOTAL_BLOCKS,
DSM_TOTAL_BLOCKS_READ,
DSM_TOTAL_BLOCKS_WRITE,
DSM_KB_PER_TRANSFER,
DSM_KB_PER_TRANSFER_READ,
DSM_KB_PER_TRANSFER_WRITE,
DSM_TRANSFERS_PER_SECOND,
DSM_TRANSFERS_PER_SECOND_READ,
DSM_TRANSFERS_PER_SECOND_WRITE,
DSM_TRANSFERS_PER_SECOND_OTHER,
DSM_MB_PER_SECOND,
DSM_MB_PER_SECOND_READ,
DSM_MB_PER_SECOND_WRITE,
DSM_BLOCKS_PER_SECOND,
DSM_BLOCKS_PER_SECOND_READ,
DSM_BLOCKS_PER_SECOND_WRITE,
DSM_MS_PER_TRANSACTION,
DSM_MS_PER_TRANSACTION_READ,
DSM_MS_PER_TRANSACTION_WRITE,
DSM_SKIP,
DSM_TOTAL_BYTES_FREE,
DSM_TOTAL_TRANSFERS_FREE,
DSM_TOTAL_BLOCKS_FREE,
DSM_KB_PER_TRANSFER_FREE,
DSM_MB_PER_SECOND_FREE,
DSM_TRANSFERS_PER_SECOND_FREE,
DSM_BLOCKS_PER_SECOND_FREE,
DSM_MS_PER_TRANSACTION_OTHER,
DSM_MS_PER_TRANSACTION_FREE,
DSM_BUSY_PCT,
DSM_QUEUE_LENGTH,
DSM_TOTAL_DURATION,
DSM_TOTAL_DURATION_READ,
DSM_TOTAL_DURATION_WRITE,
DSM_TOTAL_DURATION_FREE,
DSM_TOTAL_DURATION_OTHER,
DSM_TOTAL_BUSY_TIME,
DSM_MAX,
}
impl ::Copy for devstat_metric {}
impl ::Clone for devstat_metric {
fn clone(&self) -> devstat_metric {
*self
}
}
#[cfg_attr(feature = "extra_traits", derive(Debug, Hash, PartialEq, Eq))]
#[repr(u32)]
pub enum devstat_select_mode {
DS_SELECT_ADD,
DS_SELECT_ONLY,
DS_SELECT_REMOVE,
DS_SELECT_ADDONLY,
}
impl ::Copy for devstat_select_mode {}
impl ::Clone for devstat_select_mode {
fn clone(&self) -> devstat_select_mode {
*self
}
}
s! {
pub struct aiocb {
pub aio_fildes: ::c_int,
pub aio_offset: ::off_t,
pub aio_buf: *mut ::c_void,
pub aio_nbytes: ::size_t,
__unused1: [::c_int; 2],
__unused2: *mut ::c_void,
pub aio_lio_opcode: ::c_int,
pub aio_reqprio: ::c_int,
// unused 3 through 5 are the __aiocb_private structure
__unused3: ::c_long,
__unused4: ::c_long,
__unused5: *mut ::c_void,
pub aio_sigevent: sigevent
}
pub struct jail {
pub version: u32,
pub path: *mut ::c_char,
pub hostname: *mut ::c_char,
pub jailname: *mut ::c_char,
pub ip4s: ::c_uint,
pub ip6s: ::c_uint,
pub ip4: *mut ::in_addr,
pub ip6: *mut ::in6_addr,
}
pub struct statvfs {
pub f_bavail: ::fsblkcnt_t,
pub f_bfree: ::fsblkcnt_t,
pub f_blocks: ::fsblkcnt_t,
pub f_favail: ::fsfilcnt_t,
pub f_ffree: ::fsfilcnt_t,
pub f_files: ::fsfilcnt_t,
pub f_bsize: ::c_ulong,
pub f_flag: ::c_ulong,
pub f_frsize: ::c_ulong,
pub f_fsid: ::c_ulong,
pub f_namemax: ::c_ulong,
}
// internal structure has changed over time
pub struct _sem {
data: [u32; 4],
}
pub struct sembuf {
pub sem_num: ::c_ushort,
pub sem_op: ::c_short,
pub sem_flg: ::c_short,
}
pub struct msqid_ds {
pub msg_perm: ::ipc_perm,
__unused1: *mut ::c_void,
__unused2: *mut ::c_void,
pub msg_cbytes: ::msglen_t,
pub msg_qnum: ::msgqnum_t,
pub msg_qbytes: ::msglen_t,
pub msg_lspid: ::pid_t,
pub msg_lrpid: ::pid_t,
pub msg_stime: ::time_t,
pub msg_rtime: ::time_t,
pub msg_ctime: ::time_t,
}
pub struct stack_t {
pub ss_sp: *mut ::c_void,
pub ss_size: ::size_t,
pub ss_flags: ::c_int,
}
pub struct mmsghdr {
pub msg_hdr: ::msghdr,
pub msg_len: ::ssize_t,
}
pub struct sockcred {
pub sc_uid: ::uid_t,
pub sc_euid: ::uid_t,
pub sc_gid: ::gid_t,
pub sc_egid: ::gid_t,
pub sc_ngroups: ::c_int,
pub sc_groups: [::gid_t; 1],
}
pub struct ptrace_vm_entry {
pub pve_entry: ::c_int,
pub pve_timestamp: ::c_int,
pub pve_start: ::c_ulong,
pub pve_end: ::c_ulong,
pub pve_offset: ::c_ulong,
pub pve_prot: ::c_uint,
pub pve_pathlen: ::c_uint,
pub pve_fileid: ::c_long,
pub pve_fsid: u32,
pub pve_path: *mut ::c_char,
}
pub struct ptrace_lwpinfo {
pub pl_lwpid: lwpid_t,
pub pl_event: ::c_int,
pub pl_flags: ::c_int,
pub pl_sigmask: ::sigset_t,
pub pl_siglist: ::sigset_t,
pub pl_siginfo: ::siginfo_t,
pub pl_tdname: [::c_char; ::MAXCOMLEN as usize + 1],
pub pl_child_pid: ::pid_t,
pub pl_syscall_code: ::c_uint,
pub pl_syscall_narg: ::c_uint,
}
pub struct ptrace_sc_ret {
pub sr_retval: [::register_t; 2],
pub sr_error: ::c_int,
}
pub struct ptrace_coredump {
pub pc_fd: ::c_int,
pub pc_flags: u32,
pub pc_limit: ::off_t,
}
pub struct ptrace_sc_remote {
pub pscr_ret: ptrace_sc_ret,
pub pscr_syscall: ::c_uint,
pub pscr_nargs: ::c_uint,
pub pscr_args: *mut ::register_t,
}
pub struct cpuset_t {
#[cfg(target_pointer_width = "64")]
__bits: [::c_long; 4],
#[cfg(target_pointer_width = "32")]
__bits: [::c_long; 8],
}
pub struct cap_rights_t {
cr_rights: [u64; 2],
}
pub struct umutex {
m_owner: ::lwpid_t,
m_flags: u32,
m_ceilings: [u32; 2],
m_rb_link: ::uintptr_t,
#[cfg(target_pointer_width = "32")]
m_pad: u32,
m_spare: [u32; 2],
}
pub struct ucond {
c_has_waiters: u32,
c_flags: u32,
c_clockid: u32,
c_spare: [u32; 1],
}
pub struct uuid {
pub time_low: u32,
pub time_mid: u16,
pub time_hi_and_version: u16,
pub clock_seq_hi_and_reserved: u8,
pub clock_seq_low: u8,
pub node: [u8; _UUID_NODE_LEN],
}
pub struct __c_anonymous_pthread_spinlock {
s_clock: umutex,
}
pub struct __c_anonymous_pthread_barrierattr {
pshared: ::c_int,
}
pub struct __c_anonymous_pthread_barrier {
b_lock: umutex,
b_cv: ucond,
b_cycle: i64,
b_count: ::c_int,
b_waiters: ::c_int,
b_refcount: ::c_int,
b_destroying: ::c_int,
}
pub struct kinfo_vmentry {
pub kve_structsize: ::c_int,
pub kve_type: ::c_int,
pub kve_start: u64,
pub kve_end: u64,
pub kve_offset: u64,
pub kve_vn_fileid: u64,
#[cfg(not(freebsd11))]
pub kve_vn_fsid_freebsd11: u32,
#[cfg(freebsd11)]
pub kve_vn_fsid: u32,
pub kve_flags: ::c_int,
pub kve_resident: ::c_int,
pub kve_private_resident: ::c_int,
pub kve_protection: ::c_int,
pub kve_ref_count: ::c_int,
pub kve_shadow_count: ::c_int,
pub kve_vn_type: ::c_int,
pub kve_vn_size: u64,
#[cfg(not(freebsd11))]
pub kve_vn_rdev_freebsd11: u32,
#[cfg(freebsd11)]
pub kve_vn_rdev: u32,
pub kve_vn_mode: u16,
pub kve_status: u16,
#[cfg(not(freebsd11))]
pub kve_vn_fsid: u64,
#[cfg(not(freebsd11))]
pub kve_vn_rdev: u64,
#[cfg(not(freebsd11))]
_kve_is_spare: [::c_int; 8],
#[cfg(freebsd11)]
_kve_is_spare: [::c_int; 12],
pub kve_path: [[::c_char; 32]; 32],
}
pub struct __c_anonymous_filestat {
pub stqe_next: *mut filestat,
}
pub struct filestat {
pub fs_type: ::c_int,
pub fs_flags: ::c_int,
pub fs_fflags: ::c_int,
pub fs_uflags: ::c_int,
pub fs_fd: ::c_int,
pub fs_ref_count: ::c_int,
pub fs_offset: ::off_t,
pub fs_typedep: *mut ::c_void,
pub fs_path: *mut ::c_char,
pub next: __c_anonymous_filestat,
pub fs_cap_rights: cap_rights_t,
}
pub struct filestat_list {
pub stqh_first: *mut filestat,
pub stqh_last: *mut *mut filestat,
}
pub struct procstat {
pub tpe: ::c_int,
pub kd: ::uintptr_t,
pub vmentries: *mut ::c_void,
pub files: *mut ::c_void,
pub argv: *mut ::c_void,
pub envv: *mut ::c_void,
pub core: ::uintptr_t,
}
pub struct itimerspec {
pub it_interval: ::timespec,
pub it_value: ::timespec,
}
pub struct __c_anonymous__timer {
_priv: [::c_int; 3],
}
/// Used to hold a copy of the command line, if it had a sane length.
pub struct pargs {
/// Reference count.
pub ar_ref: u_int,
/// Length.
pub ar_length: u_int,
/// Arguments.
pub ar_args: [::c_uchar; 1],
}
pub struct priority {
/// Scheduling class.
pub pri_class: u_char,
/// Normal priority level.
pub pri_level: u_char,
/// Priority before propagation.
pub pri_native: u_char,
/// User priority based on p_cpu and p_nice.
pub pri_user: u_char,
}
pub struct kvm_swap {
pub ksw_devname: [::c_char; 32],
pub ksw_used: u_int,
pub ksw_total: u_int,
pub ksw_flags: ::c_int,
pub ksw_reserved1: u_int,
pub ksw_reserved2: u_int,
}
pub struct nlist {
/// symbol name (in memory)
pub n_name: *const ::c_char,
/// type defines
pub n_type: ::c_uchar,
/// "type" and binding information
pub n_other: ::c_char,
/// used by stab entries
pub n_desc: ::c_short,
pub n_value: ::c_ulong,
}
pub struct kvm_nlist {
pub n_name: *const ::c_char,
pub n_type: ::c_uchar,
pub n_value: ::kvaddr_t,
}
pub struct __c_anonymous_sem {
_priv: ::uintptr_t,
}
pub struct semid_ds {
pub sem_perm: ::ipc_perm,
pub __sem_base: *mut __c_anonymous_sem,
pub sem_nsems: ::c_ushort,
pub sem_otime: ::time_t,
pub sem_ctime: ::time_t,
}
pub struct vmtotal {
pub t_vm: u64,
pub t_avm: u64,
pub t_rm: u64,
pub t_arm: u64,
pub t_vmshr: u64,
pub t_avmshr: u64,
pub t_rmshr: u64,
pub t_armshr: u64,
pub t_free: u64,
pub t_rq: i16,
pub t_dw: i16,
pub t_pw: i16,
pub t_sl: i16,
pub t_sw: i16,
pub t_pad: [u16; 3],
}
pub struct sockstat {
pub inp_ppcb: u64,
pub so_addr: u64,
pub so_pcb: u64,
pub unp_conn: u64,
pub dom_family: ::c_int,
pub proto: ::c_int,
pub so_rcv_sb_state: ::c_int,
pub so_snd_sb_state: ::c_int,
/// Socket address.
pub sa_local: ::sockaddr_storage,
/// Peer address.
pub sa_peer: ::sockaddr_storage,
pub type_: ::c_int,
pub dname: [::c_char; 32],
#[cfg(any(freebsd12, freebsd13, freebsd14))]
pub sendq: ::c_uint,
#[cfg(any(freebsd12, freebsd13, freebsd14))]
pub recvq: ::c_uint,
}
pub struct shmstat {
pub size: u64,
pub mode: u16,
}
pub struct spacectl_range {
pub r_offset: ::off_t,
pub r_len: ::off_t
}
pub struct rusage_ext {
pub rux_runtime: u64,
pub rux_uticks: u64,
pub rux_sticks: u64,
pub rux_iticks: u64,
pub rux_uu: u64,
pub rux_su: u64,
pub rux_tu: u64,
}
pub struct if_clonereq {
pub ifcr_total: ::c_int,
pub ifcr_count: ::c_int,
pub ifcr_buffer: *mut ::c_char,
}
pub struct if_msghdr {
/// to skip over non-understood messages
pub ifm_msglen: ::c_ushort,
/// future binary compatibility
pub ifm_version: ::c_uchar,
/// message type
pub ifm_type: ::c_uchar,
/// like rtm_addrs
pub ifm_addrs: ::c_int,
/// value of if_flags
pub ifm_flags: ::c_int,
/// index for associated ifp
pub ifm_index: ::c_ushort,
pub _ifm_spare1: ::c_ushort,
/// statistics and other data about if
pub ifm_data: if_data,
}
pub struct if_msghdrl {
/// to skip over non-understood messages
pub ifm_msglen: ::c_ushort,
/// future binary compatibility
pub ifm_version: ::c_uchar,
/// message type
pub ifm_type: ::c_uchar,
/// like rtm_addrs
pub ifm_addrs: ::c_int,
/// value of if_flags
pub ifm_flags: ::c_int,
/// index for associated ifp
pub ifm_index: ::c_ushort,
/// spare space to grow if_index, see if_var.h
pub _ifm_spare1: ::c_ushort,
/// length of if_msghdrl incl. if_data
pub ifm_len: ::c_ushort,
/// offset of if_data from beginning
pub ifm_data_off: ::c_ushort,
pub _ifm_spare2: ::c_int,
/// statistics and other data about if
pub ifm_data: if_data,
}
pub struct ifa_msghdr {
/// to skip over non-understood messages
pub ifam_msglen: ::c_ushort,
/// future binary compatibility
pub ifam_version: ::c_uchar,
/// message type
pub ifam_type: ::c_uchar,
/// like rtm_addrs
pub ifam_addrs: ::c_int,
/// value of ifa_flags
pub ifam_flags: ::c_int,
/// index for associated ifp
pub ifam_index: ::c_ushort,
pub _ifam_spare1: ::c_ushort,
/// value of ifa_ifp->if_metric
pub ifam_metric: ::c_int,
}
pub struct ifa_msghdrl {
/// to skip over non-understood messages
pub ifam_msglen: ::c_ushort,
/// future binary compatibility
pub ifam_version: ::c_uchar,
/// message type
pub ifam_type: ::c_uchar,
/// like rtm_addrs
pub ifam_addrs: ::c_int,
/// value of ifa_flags
pub ifam_flags: ::c_int,
/// index for associated ifp
pub ifam_index: ::c_ushort,
/// spare space to grow if_index, see if_var.h
pub _ifam_spare1: ::c_ushort,
/// length of ifa_msghdrl incl. if_data
pub ifam_len: ::c_ushort,
/// offset of if_data from beginning
pub ifam_data_off: ::c_ushort,
/// value of ifa_ifp->if_metric
pub ifam_metric: ::c_int,
/// statistics and other data about if or address
pub ifam_data: if_data,
}
pub struct ifma_msghdr {
/// to skip over non-understood messages
pub ifmam_msglen: ::c_ushort,
/// future binary compatibility
pub ifmam_version: ::c_uchar,
/// message type
pub ifmam_type: ::c_uchar,
/// like rtm_addrs
pub ifmam_addrs: ::c_int,
/// value of ifa_flags
pub ifmam_flags: ::c_int,
/// index for associated ifp
pub ifmam_index: ::c_ushort,
pub _ifmam_spare1: ::c_ushort,
}
pub struct if_announcemsghdr {
/// to skip over non-understood messages
pub ifan_msglen: ::c_ushort,
/// future binary compatibility
pub ifan_version: ::c_uchar,
/// message type
pub ifan_type: ::c_uchar,
/// index for associated ifp
pub ifan_index: ::c_ushort,
/// if name, e.g. "en0"
pub ifan_name: [::c_char; ::IFNAMSIZ as usize],
/// what type of announcement
pub ifan_what: ::c_ushort,
}
pub struct ifreq_buffer {
pub length: ::size_t,
pub buffer: *mut ::c_void,
}
pub struct ifaliasreq {
/// if name, e.g. "en0"
pub ifra_name: [::c_char; ::IFNAMSIZ as usize],
pub ifra_addr: ::sockaddr,
pub ifra_broadaddr: ::sockaddr,
pub ifra_mask: ::sockaddr,
pub ifra_vhid: ::c_int,
}
/// 9.x compat
pub struct oifaliasreq {
/// if name, e.g. "en0"
pub ifra_name: [::c_char; ::IFNAMSIZ as usize],
pub ifra_addr: ::sockaddr,
pub ifra_broadaddr: ::sockaddr,
pub ifra_mask: ::sockaddr,
}
pub struct ifmediareq {
/// if name, e.g. "en0"
pub ifm_name: [::c_char; ::IFNAMSIZ as usize],
/// current media options
pub ifm_current: ::c_int,
/// don't care mask
pub ifm_mask: ::c_int,
/// media status
pub ifm_status: ::c_int,
/// active options
pub ifm_active: ::c_int,
/// # entries in ifm_ulist array
pub ifm_count: ::c_int,
/// media words
pub ifm_ulist: *mut ::c_int,
}
pub struct ifdrv {
/// if name, e.g. "en0"
pub ifd_name: [::c_char; ::IFNAMSIZ as usize],
pub ifd_cmd: ::c_ulong,
pub ifd_len: ::size_t,
pub ifd_data: *mut ::c_void,
}
pub struct ifi2creq {
/// i2c address (0xA0, 0xA2)
pub dev_addr: u8,
/// read offset
pub offset: u8,
/// read length
pub len: u8,
pub spare0: u8,
pub spare1: u32,
/// read buffer
pub data: [u8; 8],
}
pub struct ifrsshash {
/// if name, e.g. "en0"
pub ifrh_name: [::c_char; ::IFNAMSIZ as usize],
/// RSS_FUNC_
pub ifrh_func: u8,
pub ifrh_spare0: u8,
pub ifrh_spare1: u16,
/// RSS_TYPE_
pub ifrh_types: u32,
}
pub struct ifmibdata {
/// name of interface
pub ifmd_name: [::c_char; ::IFNAMSIZ as usize],
/// number of promiscuous listeners
pub ifmd_pcount: ::c_int,
/// interface flags
pub ifmd_flags: ::c_int,
/// instantaneous length of send queue
pub ifmd_snd_len: ::c_int,
/// maximum length of send queue
pub ifmd_snd_maxlen: ::c_int,
/// number of drops in send queue
pub ifmd_snd_drops: ::c_int,
/// for future expansion
pub ifmd_filler: [::c_int; 4],
/// generic information and statistics
pub ifmd_data: if_data,
}
pub struct ifmib_iso_8802_3 {
pub dot3StatsAlignmentErrors: u32,
pub dot3StatsFCSErrors: u32,
pub dot3StatsSingleCollisionFrames: u32,
pub dot3StatsMultipleCollisionFrames: u32,
pub dot3StatsSQETestErrors: u32,
pub dot3StatsDeferredTransmissions: u32,
pub dot3StatsLateCollisions: u32,
pub dot3StatsExcessiveCollisions: u32,
pub dot3StatsInternalMacTransmitErrors: u32,
pub dot3StatsCarrierSenseErrors: u32,
pub dot3StatsFrameTooLongs: u32,
pub dot3StatsInternalMacReceiveErrors: u32,
pub dot3StatsEtherChipSet: u32,
pub dot3StatsMissedFrames: u32,
pub dot3StatsCollFrequencies: [u32; 16],
pub dot3Compliance: u32,
}
pub struct __c_anonymous_ph {
pub ph1: u64,
pub ph2: u64,
}
pub struct fid {
pub fid_len: ::c_ushort,
pub fid_data0: ::c_ushort,
pub fid_data: [::c_char; ::MAXFIDSZ as usize],
}
pub struct fhandle {
pub fh_fsid: ::fsid_t,
pub fh_fid: fid,
}
pub struct bintime {
pub sec: ::time_t,
pub frac: u64,
}
pub struct clockinfo {
/// clock frequency
pub hz: ::c_int,
/// micro-seconds per hz tick
pub tick: ::c_int,
pub spare: ::c_int,
/// statistics clock frequency
pub stathz: ::c_int,
/// profiling clock frequency
pub profhz: ::c_int,
}
pub struct __c_anonymous_stailq_entry_devstat {
pub stqe_next: *mut devstat,
}
pub struct devstat {
/// Update sequence
pub sequence0: ::u_int,
/// Allocated entry
pub allocated: ::c_int,
/// started ops
pub start_count: ::u_int,
/// completed ops
pub end_count: ::u_int,
/// busy time unaccounted for since this time
pub busy_from: bintime,
pub dev_links: __c_anonymous_stailq_entry_devstat,
/// Devstat device number.
pub device_number: u32,
pub device_name: [::c_char; DEVSTAT_NAME_LEN as usize],
pub unit_number: ::c_int,
pub bytes: [u64; DEVSTAT_N_TRANS_FLAGS as usize],
pub operations: [u64; DEVSTAT_N_TRANS_FLAGS as usize],
pub duration: [bintime; DEVSTAT_N_TRANS_FLAGS as usize],
pub busy_time: bintime,
/// Time the device was created.
pub creation_time: bintime,
/// Block size, bytes
pub block_size: u32,
/// The number of simple, ordered, and head of queue tags sent.
pub tag_types: [u64; 3],
/// Which statistics are supported by a given device.
pub flags: devstat_support_flags,
/// Device type
pub device_type: devstat_type_flags,
/// Controls list pos.
pub priority: devstat_priority,
/// Identification for GEOM nodes
pub id: *const ::c_void,
/// Update sequence
pub sequence1: ::u_int,
}
pub struct devstat_match {
pub match_fields: devstat_match_flags,
pub device_type: devstat_type_flags,
pub num_match_categories: ::c_int,
}
pub struct devstat_match_table {
pub match_str: *const ::c_char,
pub type_: devstat_type_flags,
pub match_field: devstat_match_flags,
}
pub struct device_selection {
pub device_number: u32,
pub device_name: [::c_char; DEVSTAT_NAME_LEN as usize],
pub unit_number: ::c_int,
pub selected: ::c_int,
pub bytes: u64,
pub position: ::c_int,
}
pub struct devinfo {
pub devices: *mut devstat,
pub mem_ptr: *mut u8,
pub generation: ::c_long,
pub numdevs: ::c_int,
}
pub struct sockcred2 {
pub sc_version: ::c_int,
pub sc_pid: ::pid_t,
pub sc_uid: ::uid_t,
pub sc_euid: ::uid_t,
pub sc_gid: ::gid_t,
pub sc_egid: ::gid_t,
pub sc_ngroups: ::c_int,
pub sc_groups: [::gid_t; 1],
}
pub struct ifconf {
pub ifc_len: ::c_int,
#[cfg(libc_union)]
pub ifc_ifcu: __c_anonymous_ifc_ifcu,
}
pub struct au_mask_t {
pub am_success: ::c_uint,
pub am_failure: ::c_uint,
}
pub struct au_tid_t {
pub port: u32,
pub machine: u32,
}
pub struct auditinfo_t {
pub ai_auid: ::au_id_t,
pub ai_mask: ::au_mask_t,
pub ai_termid: au_tid_t,
pub ai_asid: ::au_asid_t,
}
pub struct tcp_fastopen {
pub enable: ::c_int,
pub psk: [u8; ::TCP_FASTOPEN_PSK_LEN as usize],
}
pub struct tcp_function_set {
pub function_set_name: [::c_char; ::TCP_FUNCTION_NAME_LEN_MAX as usize],
pub pcbcnt: u32,
}
pub struct tcp_info {
pub tcpi_state: u8,