forked from sunfishcode/linux-raw-sys
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathnet.rs
More file actions
3504 lines (3503 loc) · 116 KB
/
net.rs
File metadata and controls
3504 lines (3503 loc) · 116 KB
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
/* automatically generated by rust-bindgen 0.72.1 */
pub type __s8 = crate::ctypes::c_schar;
pub type __u8 = crate::ctypes::c_uchar;
pub type __s16 = crate::ctypes::c_short;
pub type __u16 = crate::ctypes::c_ushort;
pub type __s32 = crate::ctypes::c_int;
pub type __u32 = crate::ctypes::c_uint;
pub type __s64 = crate::ctypes::c_longlong;
pub type __u64 = crate::ctypes::c_ulonglong;
pub type __kernel_key_t = crate::ctypes::c_int;
pub type __kernel_mqd_t = crate::ctypes::c_int;
pub type __kernel_old_uid_t = crate::ctypes::c_ushort;
pub type __kernel_old_gid_t = crate::ctypes::c_ushort;
pub type __kernel_long_t = crate::ctypes::c_long;
pub type __kernel_ulong_t = crate::ctypes::c_ulong;
pub type __kernel_ino_t = __kernel_ulong_t;
pub type __kernel_mode_t = crate::ctypes::c_uint;
pub type __kernel_pid_t = crate::ctypes::c_int;
pub type __kernel_ipc_pid_t = crate::ctypes::c_int;
pub type __kernel_uid_t = crate::ctypes::c_uint;
pub type __kernel_gid_t = crate::ctypes::c_uint;
pub type __kernel_suseconds_t = __kernel_long_t;
pub type __kernel_daddr_t = crate::ctypes::c_int;
pub type __kernel_uid32_t = crate::ctypes::c_uint;
pub type __kernel_gid32_t = crate::ctypes::c_uint;
pub type __kernel_old_dev_t = crate::ctypes::c_uint;
pub type __kernel_size_t = __kernel_ulong_t;
pub type __kernel_ssize_t = __kernel_long_t;
pub type __kernel_ptrdiff_t = __kernel_long_t;
pub type __kernel_off_t = __kernel_long_t;
pub type __kernel_loff_t = crate::ctypes::c_longlong;
pub type __kernel_old_time_t = __kernel_long_t;
pub type __kernel_time_t = __kernel_long_t;
pub type __kernel_time64_t = crate::ctypes::c_longlong;
pub type __kernel_clock_t = __kernel_long_t;
pub type __kernel_timer_t = crate::ctypes::c_int;
pub type __kernel_clockid_t = crate::ctypes::c_int;
pub type __kernel_caddr_t = *mut crate::ctypes::c_char;
pub type __kernel_uid16_t = crate::ctypes::c_ushort;
pub type __kernel_gid16_t = crate::ctypes::c_ushort;
pub type __s128 = i128;
pub type __u128 = u128;
pub type __le16 = __u16;
pub type __be16 = __u16;
pub type __le32 = __u32;
pub type __be32 = __u32;
pub type __le64 = __u64;
pub type __be64 = __u64;
pub type __sum16 = __u16;
pub type __wsum = __u32;
pub type __poll_t = crate::ctypes::c_uint;
pub type __kernel_sa_family_t = crate::ctypes::c_ushort;
pub type socklen_t = crate::ctypes::c_uint;
#[repr(C)]
#[derive(Copy, Clone, Debug, Default, Eq, Hash, Ord, PartialEq, PartialOrd)]
pub struct __BindgenBitfieldUnit<Storage> {
storage: Storage,
}
#[repr(C)]
#[derive(Default)]
pub struct __IncompleteArrayField<T>(::core::marker::PhantomData<T>, [T; 0]);
#[repr(C)]
pub struct __BindgenUnionField<T>(::core::marker::PhantomData<T>);
#[repr(C)]
#[derive(Copy, Clone)]
pub struct __kernel_sockaddr_storage {
pub __bindgen_anon_1: __kernel_sockaddr_storage__bindgen_ty_1,
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct __kernel_sockaddr_storage__bindgen_ty_1__bindgen_ty_1 {
pub ss_family: __kernel_sa_family_t,
pub __data: [crate::ctypes::c_char; 126usize],
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct in_addr {
pub s_addr: __be32,
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct ip_mreq {
pub imr_multiaddr: in_addr,
pub imr_interface: in_addr,
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct ip_mreqn {
pub imr_multiaddr: in_addr,
pub imr_address: in_addr,
pub imr_ifindex: crate::ctypes::c_int,
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct ip_mreq_source {
pub imr_multiaddr: __be32,
pub imr_interface: __be32,
pub imr_sourceaddr: __be32,
}
#[repr(C)]
pub struct ip_msfilter {
pub imsf_multiaddr: __be32,
pub imsf_interface: __be32,
pub imsf_fmode: __u32,
pub imsf_numsrc: __u32,
pub __bindgen_anon_1: ip_msfilter__bindgen_ty_1,
}
#[repr(C)]
pub struct ip_msfilter__bindgen_ty_1 {
pub imsf_slist: __BindgenUnionField<[__be32; 1usize]>,
pub __bindgen_anon_1: __BindgenUnionField<ip_msfilter__bindgen_ty_1__bindgen_ty_1>,
pub bindgen_union_field: u32,
}
#[repr(C)]
#[derive(Debug)]
pub struct ip_msfilter__bindgen_ty_1__bindgen_ty_1 {
pub __empty_imsf_slist_flex: ip_msfilter__bindgen_ty_1__bindgen_ty_1__bindgen_ty_1,
pub imsf_slist_flex: __IncompleteArrayField<__be32>,
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct ip_msfilter__bindgen_ty_1__bindgen_ty_1__bindgen_ty_1 {}
#[repr(C)]
#[derive(Copy, Clone)]
pub struct group_req {
pub gr_interface: __u32,
pub gr_group: __kernel_sockaddr_storage,
}
#[repr(C)]
#[derive(Copy, Clone)]
pub struct group_source_req {
pub gsr_interface: __u32,
pub gsr_group: __kernel_sockaddr_storage,
pub gsr_source: __kernel_sockaddr_storage,
}
#[repr(C)]
pub struct group_filter {
pub __bindgen_anon_1: group_filter__bindgen_ty_1,
}
#[repr(C)]
pub struct group_filter__bindgen_ty_1 {
pub __bindgen_anon_1: __BindgenUnionField<group_filter__bindgen_ty_1__bindgen_ty_1>,
pub __bindgen_anon_2: __BindgenUnionField<group_filter__bindgen_ty_1__bindgen_ty_2>,
pub bindgen_union_field: [u64; 34usize],
}
#[repr(C)]
#[derive(Copy, Clone)]
pub struct group_filter__bindgen_ty_1__bindgen_ty_1 {
pub gf_interface_aux: __u32,
pub gf_group_aux: __kernel_sockaddr_storage,
pub gf_fmode_aux: __u32,
pub gf_numsrc_aux: __u32,
pub gf_slist: [__kernel_sockaddr_storage; 1usize],
}
#[repr(C)]
pub struct group_filter__bindgen_ty_1__bindgen_ty_2 {
pub gf_interface: __u32,
pub gf_group: __kernel_sockaddr_storage,
pub gf_fmode: __u32,
pub gf_numsrc: __u32,
pub gf_slist_flex: __IncompleteArrayField<__kernel_sockaddr_storage>,
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct in_pktinfo {
pub ipi_ifindex: crate::ctypes::c_int,
pub ipi_spec_dst: in_addr,
pub ipi_addr: in_addr,
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct sockaddr_in {
pub sin_family: __kernel_sa_family_t,
pub sin_port: __be16,
pub sin_addr: in_addr,
pub __pad: [crate::ctypes::c_uchar; 8usize],
}
#[repr(C)]
#[derive(Copy, Clone)]
pub struct iphdr {
pub _bitfield_align_1: [u8; 0],
pub _bitfield_1: __BindgenBitfieldUnit<[u8; 1usize]>,
pub tos: __u8,
pub tot_len: __be16,
pub id: __be16,
pub frag_off: __be16,
pub ttl: __u8,
pub protocol: __u8,
pub check: __sum16,
pub __bindgen_anon_1: iphdr__bindgen_ty_1,
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct iphdr__bindgen_ty_1__bindgen_ty_1 {
pub saddr: __be32,
pub daddr: __be32,
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct iphdr__bindgen_ty_1__bindgen_ty_2 {
pub saddr: __be32,
pub daddr: __be32,
}
#[repr(C)]
#[derive(Debug)]
pub struct ip_auth_hdr {
pub nexthdr: __u8,
pub hdrlen: __u8,
pub reserved: __be16,
pub spi: __be32,
pub seq_no: __be32,
pub auth_data: __IncompleteArrayField<__u8>,
}
#[repr(C)]
#[derive(Debug)]
pub struct ip_esp_hdr {
pub spi: __be32,
pub seq_no: __be32,
pub enc_data: __IncompleteArrayField<__u8>,
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct ip_comp_hdr {
pub nexthdr: __u8,
pub flags: __u8,
pub cpi: __be16,
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct ip_beet_phdr {
pub nexthdr: __u8,
pub hdrlen: __u8,
pub padlen: __u8,
pub reserved: __u8,
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct ip_iptfs_hdr {
pub subtype: __u8,
pub flags: __u8,
pub block_offset: __be16,
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct ip_iptfs_cc_hdr {
pub subtype: __u8,
pub flags: __u8,
pub block_offset: __be16,
pub loss_rate: __be32,
pub rtt_adelay_xdelay: __be64,
pub tval: __be32,
pub techo: __be32,
}
#[repr(C)]
#[derive(Copy, Clone)]
pub struct in6_addr {
pub in6_u: in6_addr__bindgen_ty_1,
}
#[repr(C)]
#[derive(Copy, Clone)]
pub struct sockaddr_in6 {
pub sin6_family: crate::ctypes::c_ushort,
pub sin6_port: __be16,
pub sin6_flowinfo: __be32,
pub sin6_addr: in6_addr,
pub sin6_scope_id: __u32,
}
#[repr(C)]
#[derive(Copy, Clone)]
pub struct ipv6_mreq {
pub ipv6mr_multiaddr: in6_addr,
pub ipv6mr_ifindex: crate::ctypes::c_int,
}
#[repr(C)]
#[derive(Copy, Clone)]
pub struct in6_flowlabel_req {
pub flr_dst: in6_addr,
pub flr_label: __be32,
pub flr_action: __u8,
pub flr_share: __u8,
pub flr_flags: __u16,
pub flr_expires: __u16,
pub flr_linger: __u16,
pub __flr_pad: __u32,
}
#[repr(C)]
#[derive(Copy, Clone)]
pub struct in6_pktinfo {
pub ipi6_addr: in6_addr,
pub ipi6_ifindex: crate::ctypes::c_int,
}
#[repr(C)]
#[derive(Copy, Clone)]
pub struct ip6_mtuinfo {
pub ip6m_addr: sockaddr_in6,
pub ip6m_mtu: __u32,
}
#[repr(C)]
#[derive(Copy, Clone)]
pub struct in6_ifreq {
pub ifr6_addr: in6_addr,
pub ifr6_prefixlen: __u32,
pub ifr6_ifindex: crate::ctypes::c_int,
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct ipv6_rt_hdr {
pub nexthdr: __u8,
pub hdrlen: __u8,
pub type_: __u8,
pub segments_left: __u8,
}
#[repr(C, packed)]
#[derive(Debug, Copy, Clone)]
pub struct ipv6_opt_hdr {
pub nexthdr: __u8,
pub hdrlen: __u8,
}
#[repr(C)]
pub struct rt0_hdr {
pub rt_hdr: ipv6_rt_hdr,
pub reserved: __u32,
pub addr: __IncompleteArrayField<in6_addr>,
}
#[repr(C)]
#[derive(Copy, Clone)]
pub struct rt2_hdr {
pub rt_hdr: ipv6_rt_hdr,
pub reserved: __u32,
pub addr: in6_addr,
}
#[repr(C, packed)]
#[derive(Copy, Clone)]
pub struct ipv6_destopt_hao {
pub type_: __u8,
pub length: __u8,
pub addr: in6_addr,
}
#[repr(C)]
#[derive(Copy, Clone)]
pub struct ipv6hdr {
pub _bitfield_align_1: [u8; 0],
pub _bitfield_1: __BindgenBitfieldUnit<[u8; 1usize]>,
pub flow_lbl: [__u8; 3usize],
pub payload_len: __be16,
pub nexthdr: __u8,
pub hop_limit: __u8,
pub __bindgen_anon_1: ipv6hdr__bindgen_ty_1,
}
#[repr(C)]
#[derive(Copy, Clone)]
pub struct ipv6hdr__bindgen_ty_1__bindgen_ty_1 {
pub saddr: in6_addr,
pub daddr: in6_addr,
}
#[repr(C)]
#[derive(Copy, Clone)]
pub struct ipv6hdr__bindgen_ty_1__bindgen_ty_2 {
pub saddr: in6_addr,
pub daddr: in6_addr,
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct tcphdr {
pub source: __be16,
pub dest: __be16,
pub seq: __be32,
pub ack_seq: __be32,
pub _bitfield_align_1: [u8; 0],
pub _bitfield_1: __BindgenBitfieldUnit<[u8; 2usize]>,
pub window: __be16,
pub check: __sum16,
pub urg_ptr: __be16,
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct tcp_repair_opt {
pub opt_code: __u32,
pub opt_val: __u32,
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct tcp_repair_window {
pub snd_wl1: __u32,
pub snd_wnd: __u32,
pub max_window: __u32,
pub rcv_wnd: __u32,
pub rcv_wup: __u32,
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct tcp_info {
pub tcpi_state: __u8,
pub tcpi_ca_state: __u8,
pub tcpi_retransmits: __u8,
pub tcpi_probes: __u8,
pub tcpi_backoff: __u8,
pub tcpi_options: __u8,
pub _bitfield_align_1: [u8; 0],
pub _bitfield_1: __BindgenBitfieldUnit<[u8; 2usize]>,
pub tcpi_rto: __u32,
pub tcpi_ato: __u32,
pub tcpi_snd_mss: __u32,
pub tcpi_rcv_mss: __u32,
pub tcpi_unacked: __u32,
pub tcpi_sacked: __u32,
pub tcpi_lost: __u32,
pub tcpi_retrans: __u32,
pub tcpi_fackets: __u32,
pub tcpi_last_data_sent: __u32,
pub tcpi_last_ack_sent: __u32,
pub tcpi_last_data_recv: __u32,
pub tcpi_last_ack_recv: __u32,
pub tcpi_pmtu: __u32,
pub tcpi_rcv_ssthresh: __u32,
pub tcpi_rtt: __u32,
pub tcpi_rttvar: __u32,
pub tcpi_snd_ssthresh: __u32,
pub tcpi_snd_cwnd: __u32,
pub tcpi_advmss: __u32,
pub tcpi_reordering: __u32,
pub tcpi_rcv_rtt: __u32,
pub tcpi_rcv_space: __u32,
pub tcpi_total_retrans: __u32,
pub tcpi_pacing_rate: __u64,
pub tcpi_max_pacing_rate: __u64,
pub tcpi_bytes_acked: __u64,
pub tcpi_bytes_received: __u64,
pub tcpi_segs_out: __u32,
pub tcpi_segs_in: __u32,
pub tcpi_notsent_bytes: __u32,
pub tcpi_min_rtt: __u32,
pub tcpi_data_segs_in: __u32,
pub tcpi_data_segs_out: __u32,
pub tcpi_delivery_rate: __u64,
pub tcpi_busy_time: __u64,
pub tcpi_rwnd_limited: __u64,
pub tcpi_sndbuf_limited: __u64,
pub tcpi_delivered: __u32,
pub tcpi_delivered_ce: __u32,
pub tcpi_bytes_sent: __u64,
pub tcpi_bytes_retrans: __u64,
pub tcpi_dsack_dups: __u32,
pub tcpi_reord_seen: __u32,
pub tcpi_rcv_ooopack: __u32,
pub tcpi_snd_wnd: __u32,
pub tcpi_rcv_wnd: __u32,
pub tcpi_rehash: __u32,
pub tcpi_total_rto: __u16,
pub tcpi_total_rto_recoveries: __u16,
pub tcpi_total_rto_time: __u32,
pub tcpi_received_ce: __u32,
pub tcpi_delivered_e1_bytes: __u32,
pub tcpi_delivered_e0_bytes: __u32,
pub tcpi_delivered_ce_bytes: __u32,
pub tcpi_received_e1_bytes: __u32,
pub tcpi_received_e0_bytes: __u32,
pub tcpi_received_ce_bytes: __u32,
pub tcpi_accecn_fail_mode: __u16,
pub tcpi_accecn_opt_seen: __u16,
}
#[repr(C)]
#[derive(Copy, Clone)]
pub struct tcp_md5sig {
pub tcpm_addr: __kernel_sockaddr_storage,
pub tcpm_flags: __u8,
pub tcpm_prefixlen: __u8,
pub tcpm_keylen: __u16,
pub tcpm_ifindex: crate::ctypes::c_int,
pub tcpm_key: [__u8; 80usize],
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct tcp_diag_md5sig {
pub tcpm_family: __u8,
pub tcpm_prefixlen: __u8,
pub tcpm_keylen: __u16,
pub tcpm_addr: [__be32; 4usize],
pub tcpm_key: [__u8; 80usize],
}
#[repr(C)]
#[derive(Copy, Clone)]
pub struct tcp_ao_add {
pub addr: __kernel_sockaddr_storage,
pub alg_name: [crate::ctypes::c_char; 64usize],
pub ifindex: __s32,
pub _bitfield_align_1: [u32; 0],
pub _bitfield_1: __BindgenBitfieldUnit<[u8; 4usize]>,
pub reserved2: __u16,
pub prefix: __u8,
pub sndid: __u8,
pub rcvid: __u8,
pub maclen: __u8,
pub keyflags: __u8,
pub keylen: __u8,
pub key: [__u8; 80usize],
}
#[repr(C)]
#[derive(Copy, Clone)]
pub struct tcp_ao_del {
pub addr: __kernel_sockaddr_storage,
pub ifindex: __s32,
pub _bitfield_align_1: [u32; 0],
pub _bitfield_1: __BindgenBitfieldUnit<[u8; 4usize]>,
pub reserved2: __u16,
pub prefix: __u8,
pub sndid: __u8,
pub rcvid: __u8,
pub current_key: __u8,
pub rnext: __u8,
pub keyflags: __u8,
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct tcp_ao_info_opt {
pub _bitfield_align_1: [u32; 0],
pub _bitfield_1: __BindgenBitfieldUnit<[u8; 4usize]>,
pub reserved2: __u16,
pub current_key: __u8,
pub rnext: __u8,
pub pkt_good: __u64,
pub pkt_bad: __u64,
pub pkt_key_not_found: __u64,
pub pkt_ao_required: __u64,
pub pkt_dropped_icmp: __u64,
}
#[repr(C)]
#[derive(Copy, Clone)]
pub struct tcp_ao_getsockopt {
pub addr: __kernel_sockaddr_storage,
pub alg_name: [crate::ctypes::c_char; 64usize],
pub key: [__u8; 80usize],
pub nkeys: __u32,
pub _bitfield_align_1: [u16; 0],
pub _bitfield_1: __BindgenBitfieldUnit<[u8; 2usize]>,
pub sndid: __u8,
pub rcvid: __u8,
pub prefix: __u8,
pub maclen: __u8,
pub keyflags: __u8,
pub keylen: __u8,
pub ifindex: __s32,
pub pkt_good: __u64,
pub pkt_bad: __u64,
}
#[repr(C)]
#[repr(align(8))]
#[derive(Debug, Copy, Clone)]
pub struct tcp_ao_repair {
pub snt_isn: __be32,
pub rcv_isn: __be32,
pub snd_sne: __u32,
pub rcv_sne: __u32,
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct tcp_zerocopy_receive {
pub address: __u64,
pub length: __u32,
pub recv_skip_hint: __u32,
pub inq: __u32,
pub err: __s32,
pub copybuf_address: __u64,
pub copybuf_len: __s32,
pub flags: __u32,
pub msg_control: __u64,
pub msg_controllen: __u64,
pub msg_flags: __u32,
pub reserved: __u32,
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct sockaddr_un {
pub sun_family: __kernel_sa_family_t,
pub sun_path: [crate::ctypes::c_char; 108usize],
}
#[repr(C)]
#[derive(Copy, Clone)]
pub struct sockaddr {
pub __storage: __kernel_sockaddr_storage,
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct sync_serial_settings {
pub clock_rate: crate::ctypes::c_uint,
pub clock_type: crate::ctypes::c_uint,
pub loopback: crate::ctypes::c_ushort,
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct te1_settings {
pub clock_rate: crate::ctypes::c_uint,
pub clock_type: crate::ctypes::c_uint,
pub loopback: crate::ctypes::c_ushort,
pub slot_map: crate::ctypes::c_uint,
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct raw_hdlc_proto {
pub encoding: crate::ctypes::c_ushort,
pub parity: crate::ctypes::c_ushort,
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct fr_proto {
pub t391: crate::ctypes::c_uint,
pub t392: crate::ctypes::c_uint,
pub n391: crate::ctypes::c_uint,
pub n392: crate::ctypes::c_uint,
pub n393: crate::ctypes::c_uint,
pub lmi: crate::ctypes::c_ushort,
pub dce: crate::ctypes::c_ushort,
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct fr_proto_pvc {
pub dlci: crate::ctypes::c_uint,
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct fr_proto_pvc_info {
pub dlci: crate::ctypes::c_uint,
pub master: [crate::ctypes::c_char; 16usize],
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct cisco_proto {
pub interval: crate::ctypes::c_uint,
pub timeout: crate::ctypes::c_uint,
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct x25_hdlc_proto {
pub dce: crate::ctypes::c_ushort,
pub modulo: crate::ctypes::c_uint,
pub window: crate::ctypes::c_uint,
pub t1: crate::ctypes::c_uint,
pub t2: crate::ctypes::c_uint,
pub n2: crate::ctypes::c_uint,
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct ifmap {
pub mem_start: crate::ctypes::c_ulong,
pub mem_end: crate::ctypes::c_ulong,
pub base_addr: crate::ctypes::c_ushort,
pub irq: crate::ctypes::c_uchar,
pub dma: crate::ctypes::c_uchar,
pub port: crate::ctypes::c_uchar,
}
#[repr(C)]
#[derive(Copy, Clone)]
pub struct if_settings {
pub type_: crate::ctypes::c_uint,
pub size: crate::ctypes::c_uint,
pub ifs_ifsu: if_settings__bindgen_ty_1,
}
#[repr(C)]
#[derive(Copy, Clone)]
pub struct ifreq {
pub ifr_ifrn: ifreq__bindgen_ty_1,
pub ifr_ifru: ifreq__bindgen_ty_2,
}
#[repr(C)]
#[derive(Copy, Clone)]
pub struct ifconf {
pub ifc_len: crate::ctypes::c_int,
pub ifc_ifcu: ifconf__bindgen_ty_1,
}
#[repr(C)]
pub struct xt_entry_match {
pub u: xt_entry_match__bindgen_ty_1,
pub data: __IncompleteArrayField<crate::ctypes::c_uchar>,
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct xt_entry_match__bindgen_ty_1__bindgen_ty_1 {
pub match_size: __u16,
pub name: [crate::ctypes::c_char; 29usize],
pub revision: __u8,
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct xt_entry_match__bindgen_ty_1__bindgen_ty_2 {
pub match_size: __u16,
pub match_: *mut xt_match,
}
#[repr(C)]
pub struct xt_entry_target {
pub u: xt_entry_target__bindgen_ty_1,
pub data: __IncompleteArrayField<crate::ctypes::c_uchar>,
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct xt_entry_target__bindgen_ty_1__bindgen_ty_1 {
pub target_size: __u16,
pub name: [crate::ctypes::c_char; 29usize],
pub revision: __u8,
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct xt_entry_target__bindgen_ty_1__bindgen_ty_2 {
pub target_size: __u16,
pub target: *mut xt_target,
}
#[repr(C)]
pub struct xt_standard_target {
pub target: xt_entry_target,
pub verdict: crate::ctypes::c_int,
}
#[repr(C)]
pub struct xt_error_target {
pub target: xt_entry_target,
pub errorname: [crate::ctypes::c_char; 30usize],
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct xt_get_revision {
pub name: [crate::ctypes::c_char; 29usize],
pub revision: __u8,
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct _xt_align {
pub u8_: __u8,
pub u16_: __u16,
pub u32_: __u32,
pub u64_: __u64,
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct xt_counters {
pub pcnt: __u64,
pub bcnt: __u64,
}
#[repr(C)]
#[derive(Debug)]
pub struct xt_counters_info {
pub name: [crate::ctypes::c_char; 32usize],
pub num_counters: crate::ctypes::c_uint,
pub counters: __IncompleteArrayField<xt_counters>,
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct xt_tcp {
pub spts: [__u16; 2usize],
pub dpts: [__u16; 2usize],
pub option: __u8,
pub flg_mask: __u8,
pub flg_cmp: __u8,
pub invflags: __u8,
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct xt_udp {
pub spts: [__u16; 2usize],
pub dpts: [__u16; 2usize],
pub invflags: __u8,
}
#[repr(C)]
#[derive(Copy, Clone)]
pub struct ip6t_ip6 {
pub src: in6_addr,
pub dst: in6_addr,
pub smsk: in6_addr,
pub dmsk: in6_addr,
pub iniface: [crate::ctypes::c_char; 16usize],
pub outiface: [crate::ctypes::c_char; 16usize],
pub iniface_mask: [crate::ctypes::c_uchar; 16usize],
pub outiface_mask: [crate::ctypes::c_uchar; 16usize],
pub proto: __u16,
pub tos: __u8,
pub flags: __u8,
pub invflags: __u8,
}
#[repr(C)]
pub struct ip6t_entry {
pub ipv6: ip6t_ip6,
pub nfcache: crate::ctypes::c_uint,
pub target_offset: __u16,
pub next_offset: __u16,
pub comefrom: crate::ctypes::c_uint,
pub counters: xt_counters,
pub elems: __IncompleteArrayField<crate::ctypes::c_uchar>,
}
#[repr(C)]
pub struct ip6t_standard {
pub entry: ip6t_entry,
pub target: xt_standard_target,
}
#[repr(C)]
pub struct ip6t_error {
pub entry: ip6t_entry,
pub target: xt_error_target,
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct ip6t_icmp {
pub type_: __u8,
pub code: [__u8; 2usize],
pub invflags: __u8,
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct ip6t_getinfo {
pub name: [crate::ctypes::c_char; 32usize],
pub valid_hooks: crate::ctypes::c_uint,
pub hook_entry: [crate::ctypes::c_uint; 5usize],
pub underflow: [crate::ctypes::c_uint; 5usize],
pub num_entries: crate::ctypes::c_uint,
pub size: crate::ctypes::c_uint,
}
#[repr(C)]
pub struct ip6t_replace {
pub name: [crate::ctypes::c_char; 32usize],
pub valid_hooks: crate::ctypes::c_uint,
pub num_entries: crate::ctypes::c_uint,
pub size: crate::ctypes::c_uint,
pub hook_entry: [crate::ctypes::c_uint; 5usize],
pub underflow: [crate::ctypes::c_uint; 5usize],
pub num_counters: crate::ctypes::c_uint,
pub counters: *mut xt_counters,
pub entries: __IncompleteArrayField<ip6t_entry>,
}
#[repr(C)]
pub struct ip6t_get_entries {
pub name: [crate::ctypes::c_char; 32usize],
pub size: crate::ctypes::c_uint,
pub entrytable: __IncompleteArrayField<ip6t_entry>,
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct so_timestamping {
pub flags: crate::ctypes::c_int,
pub bind_phc: crate::ctypes::c_int,
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct hwtstamp_config {
pub flags: crate::ctypes::c_int,
pub tx_type: crate::ctypes::c_int,
pub rx_filter: crate::ctypes::c_int,
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct scm_ts_pktinfo {
pub if_index: __u32,
pub pkt_length: __u32,
pub reserved: [__u32; 2usize],
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct sock_txtime {
pub clockid: __kernel_clockid_t,
pub flags: __u32,
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct linger {
pub l_onoff: crate::ctypes::c_int,
pub l_linger: crate::ctypes::c_int,
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct msghdr {
pub msg_name: *mut crate::ctypes::c_void,
pub msg_namelen: crate::ctypes::c_int,
pub msg_iov: *mut iovec,
pub msg_iovlen: usize,
pub msg_control: *mut crate::ctypes::c_void,
pub msg_controllen: usize,
pub msg_flags: crate::ctypes::c_uint,
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct cmsghdr {
pub cmsg_len: usize,
pub cmsg_level: crate::ctypes::c_int,
pub cmsg_type: crate::ctypes::c_int,
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct ucred {
pub pid: __u32,
pub uid: __u32,
pub gid: __u32,
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct mmsghdr {
pub msg_hdr: msghdr,
pub msg_len: crate::ctypes::c_uint,
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct xt_match {
pub _address: u8,
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct xt_target {
pub _address: u8,
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct iovec {
pub _address: u8,
}
pub const __BITS_PER_LONG_LONG: u32 = 64;
pub const _K_SS_MAXSIZE: u32 = 128;
pub const SOCK_SNDBUF_LOCK: u32 = 1;
pub const SOCK_RCVBUF_LOCK: u32 = 2;
pub const SOCK_BUF_LOCK_MASK: u32 = 3;
pub const SOCK_TXREHASH_DEFAULT: u32 = 255;
pub const SOCK_TXREHASH_DISABLED: u32 = 0;
pub const SOCK_TXREHASH_ENABLED: u32 = 1;
pub const IP_TOS: u32 = 1;
pub const IP_TTL: u32 = 2;
pub const IP_HDRINCL: u32 = 3;
pub const IP_OPTIONS: u32 = 4;
pub const IP_ROUTER_ALERT: u32 = 5;
pub const IP_RECVOPTS: u32 = 6;
pub const IP_RETOPTS: u32 = 7;
pub const IP_PKTINFO: u32 = 8;
pub const IP_PKTOPTIONS: u32 = 9;
pub const IP_MTU_DISCOVER: u32 = 10;
pub const IP_RECVERR: u32 = 11;
pub const IP_RECVTTL: u32 = 12;
pub const IP_RECVTOS: u32 = 13;
pub const IP_MTU: u32 = 14;
pub const IP_FREEBIND: u32 = 15;
pub const IP_IPSEC_POLICY: u32 = 16;
pub const IP_XFRM_POLICY: u32 = 17;
pub const IP_PASSSEC: u32 = 18;
pub const IP_TRANSPARENT: u32 = 19;
pub const IP_RECVRETOPTS: u32 = 7;
pub const IP_ORIGDSTADDR: u32 = 20;
pub const IP_RECVORIGDSTADDR: u32 = 20;
pub const IP_MINTTL: u32 = 21;
pub const IP_NODEFRAG: u32 = 22;
pub const IP_CHECKSUM: u32 = 23;
pub const IP_BIND_ADDRESS_NO_PORT: u32 = 24;
pub const IP_RECVFRAGSIZE: u32 = 25;
pub const IP_RECVERR_RFC4884: u32 = 26;
pub const IP_PMTUDISC_DONT: u32 = 0;
pub const IP_PMTUDISC_WANT: u32 = 1;
pub const IP_PMTUDISC_DO: u32 = 2;
pub const IP_PMTUDISC_PROBE: u32 = 3;
pub const IP_PMTUDISC_INTERFACE: u32 = 4;
pub const IP_PMTUDISC_OMIT: u32 = 5;
pub const IP_MULTICAST_IF: u32 = 32;
pub const IP_MULTICAST_TTL: u32 = 33;
pub const IP_MULTICAST_LOOP: u32 = 34;
pub const IP_ADD_MEMBERSHIP: u32 = 35;
pub const IP_DROP_MEMBERSHIP: u32 = 36;
pub const IP_UNBLOCK_SOURCE: u32 = 37;
pub const IP_BLOCK_SOURCE: u32 = 38;
pub const IP_ADD_SOURCE_MEMBERSHIP: u32 = 39;
pub const IP_DROP_SOURCE_MEMBERSHIP: u32 = 40;
pub const IP_MSFILTER: u32 = 41;
pub const MCAST_JOIN_GROUP: u32 = 42;
pub const MCAST_BLOCK_SOURCE: u32 = 43;
pub const MCAST_UNBLOCK_SOURCE: u32 = 44;
pub const MCAST_LEAVE_GROUP: u32 = 45;
pub const MCAST_JOIN_SOURCE_GROUP: u32 = 46;
pub const MCAST_LEAVE_SOURCE_GROUP: u32 = 47;
pub const MCAST_MSFILTER: u32 = 48;
pub const IP_MULTICAST_ALL: u32 = 49;
pub const IP_UNICAST_IF: u32 = 50;
pub const IP_LOCAL_PORT_RANGE: u32 = 51;
pub const IP_PROTOCOL: u32 = 52;
pub const MCAST_EXCLUDE: u32 = 0;
pub const MCAST_INCLUDE: u32 = 1;
pub const IP_DEFAULT_MULTICAST_TTL: u32 = 1;
pub const IP_DEFAULT_MULTICAST_LOOP: u32 = 1;
pub const __SOCK_SIZE__: u32 = 16;
pub const IN_CLASSA_NET: u32 = 4278190080;
pub const IN_CLASSA_NSHIFT: u32 = 24;
pub const IN_CLASSA_HOST: u32 = 16777215;
pub const IN_CLASSA_MAX: u32 = 128;
pub const IN_CLASSB_NET: u32 = 4294901760;
pub const IN_CLASSB_NSHIFT: u32 = 16;
pub const IN_CLASSB_HOST: u32 = 65535;
pub const IN_CLASSB_MAX: u32 = 65536;
pub const IN_CLASSC_NET: u32 = 4294967040;
pub const IN_CLASSC_NSHIFT: u32 = 8;
pub const IN_CLASSC_HOST: u32 = 255;
pub const IN_MULTICAST_NET: u32 = 3758096384;
pub const IN_CLASSE_NET: u32 = 4294967295;
pub const IN_CLASSE_NSHIFT: u32 = 0;
pub const IN_LOOPBACKNET: u32 = 127;
pub const INADDR_LOOPBACK: u32 = 2130706433;
pub const INADDR_UNSPEC_GROUP: u32 = 3758096384;
pub const INADDR_ALLHOSTS_GROUP: u32 = 3758096385;
pub const INADDR_ALLRTRS_GROUP: u32 = 3758096386;
pub const INADDR_ALLSNOOPERS_GROUP: u32 = 3758096490;
pub const INADDR_MAX_LOCAL_GROUP: u32 = 3758096639;
pub const __LITTLE_ENDIAN: u32 = 1234;
pub const IPTOS_TOS_MASK: u32 = 30;