File tree 5 files changed +322
-1
lines changed
src/unix/linux_like/linux
5 files changed +322
-1
lines changed Original file line number Diff line number Diff line change @@ -3412,7 +3412,6 @@ fn test_linux(target: &str) {
3412
3412
"netinet/ip.h" ,
3413
3413
"netinet/tcp.h" ,
3414
3414
"netinet/udp.h" ,
3415
- "netpacket/packet.h" ,
3416
3415
"poll.h" ,
3417
3416
"pthread.h" ,
3418
3417
"pty.h" ,
@@ -3514,6 +3513,7 @@ fn test_linux(target: &str) {
3514
3513
"linux/if_addr.h" ,
3515
3514
"linux/if_alg.h" ,
3516
3515
"linux/if_ether.h" ,
3516
+ "linux/if_packet.h" ,
3517
3517
"linux/if_tun.h" ,
3518
3518
"linux/if_xdp.h" ,
3519
3519
"linux/input.h" ,
@@ -3690,6 +3690,23 @@ fn test_linux(target: &str) {
3690
3690
if ( gnu && sparc64) && ( ty == "ip_mreqn" || ty == "hwtstamp_config" ) {
3691
3691
return true ;
3692
3692
}
3693
+ // FIXME(https://github.com/rust-lang/rust/issues/43894): pass by value for structs that are not an even 32/64 bits on
3694
+ // big-endian systems corrupts the value for unknown reasons.
3695
+ if ( sparc64 || ppc || ppc64 || s390x)
3696
+ && ( ty == "sockaddr_pkt"
3697
+ || ty == "tpacket_auxdata"
3698
+ || ty == "tpacket_hdr_variant1"
3699
+ || ty == "tpacket_req3"
3700
+ || ty == "tpacket_stats_v3"
3701
+ || ty == "tpacket_req_u" )
3702
+ {
3703
+ return true ;
3704
+ }
3705
+ // FIXME: musl doesn't compile with `struct fanout_args` for unknown reasons.
3706
+ if musl && ty == "fanout_args" {
3707
+ return true ;
3708
+ }
3709
+
3693
3710
match ty {
3694
3711
// These cannot be tested when "resolv.h" is included and are tested
3695
3712
// in the `linux_elf.rs` file.
Original file line number Diff line number Diff line change @@ -1805,11 +1805,38 @@ O_RSYNC
1805
1805
O_SYNC
1806
1806
O_TMPFILE
1807
1807
PACKET_ADD_MEMBERSHIP
1808
+ PACKET_AUXDATA
1809
+ PACKET_BROADCAST
1808
1810
PACKET_DROP_MEMBERSHIP
1811
+ PACKET_FANOUT
1812
+ PACKET_FANOUT_CBPF
1813
+ PACKET_FANOUT_CPU
1814
+ PACKET_FANOUT_FLAG_DEFRAG
1815
+ PACKET_FANOUT_FLAG_ROLLOVER
1816
+ PACKET_FANOUT_FLAG_UNIQUEID
1817
+ PACKET_FANOUT_HASH
1818
+ PACKET_FANOUT_LB
1819
+ PACKET_FANOUT_QM
1820
+ PACKET_FANOUT_RND
1821
+ PACKET_FANOUT_ROLLOVER
1822
+ PACKET_HOST
1823
+ PACKET_KERNEL
1824
+ PACKET_LOOPBACK
1825
+ PACKET_LOSS
1809
1826
PACKET_MR_ALLMULTI
1810
1827
PACKET_MR_MULTICAST
1811
1828
PACKET_MR_PROMISC
1812
1829
PACKET_MR_UNICAST
1830
+ PACKET_MULTICAST
1831
+ PACKET_OTHERHOST
1832
+ PACKET_OUTGOING
1833
+ PACKET_QDISC_BYPASS
1834
+ PACKET_RESERVE
1835
+ PACKET_RX_RING
1836
+ PACKET_STATISTICS
1837
+ PACKET_TIMESTAMP
1838
+ PACKET_USER
1839
+ PACKET_VERSION
1813
1840
PENDIN
1814
1841
PF_ALG
1815
1842
PF_APPLETALK
@@ -3195,6 +3222,23 @@ TLS_GET_RECORD_TYPE
3195
3222
TLS_RX
3196
3223
TLS_SET_RECORD_TYPE
3197
3224
TLS_TX
3225
+ TP_FT_REQ_FILL_RXHASH
3226
+ TP_STATUS_AVAILABLE
3227
+ TP_STATUS_BLK_TMO
3228
+ TP_STATUS_COPY
3229
+ TP_STATUS_CSUMNOTREADY
3230
+ TP_STATUS_CSUM_VALID
3231
+ TP_STATUS_KERNEL
3232
+ TP_STATUS_LOSING
3233
+ TP_STATUS_SENDING
3234
+ TP_STATUS_SEND_REQUEST
3235
+ TP_STATUS_TS_RAW_HARDWARE
3236
+ TP_STATUS_TS_SOFTWARE
3237
+ TP_STATUS_TS_SYS_HARDWARE
3238
+ TP_STATUS_USER
3239
+ TP_STATUS_VLAN_TPID_VALID
3240
+ TP_STATUS_VLAN_VALID
3241
+ TP_STATUS_WRONG_FORMAT
3198
3242
TUN_READQ_SIZE
3199
3243
TUN_TAP_DEV
3200
3244
TUN_TUN_DEV
@@ -3457,6 +3501,7 @@ fanotify_event_metadata
3457
3501
fanotify_init
3458
3502
fanotify_mark
3459
3503
fanotify_response
3504
+ fanout_args
3460
3505
fchdir
3461
3506
fdatasync
3462
3507
fdopendir
@@ -3824,6 +3869,7 @@ sockaddr_alg
3824
3869
sockaddr_can
3825
3870
sockaddr_ll
3826
3871
sockaddr_nl
3872
+ sockaddr_pkt
3827
3873
sockaddr_vm
3828
3874
splice
3829
3875
spwd
@@ -3861,6 +3907,22 @@ timer_getoverrun
3861
3907
timer_gettime
3862
3908
timer_settime
3863
3909
tmpfile64
3910
+ tpacket2_hdr
3911
+ tpacket3_hdr
3912
+ tpacket_auxdata
3913
+ tpacket_bd_header_u
3914
+ tpacket_bd_ts
3915
+ tpacket_block_desc
3916
+ tpacket_hdr
3917
+ tpacket_hdr_v1
3918
+ tpacket_hdr_variant1
3919
+ tpacket_req
3920
+ tpacket_req3
3921
+ tpacket_req_u
3922
+ tpacket_rollover_stats
3923
+ tpacket_stats
3924
+ tpacket_stats_v3
3925
+ tpacket_versions
3864
3926
truncate
3865
3927
truncate64
3866
3928
ttyname_r
Original file line number Diff line number Diff line change @@ -63,6 +63,24 @@ macro_rules! expand_align {
63
63
pub fd: :: c_int,
64
64
pub pid: :: c_int,
65
65
}
66
+
67
+ #[ repr( align( 8 ) ) ]
68
+ pub struct tpacket_rollover_stats {
69
+ pub tp_all: :: __u64,
70
+ pub tp_huge: :: __u64,
71
+ pub tp_failed: :: __u64,
72
+ }
73
+
74
+ #[ repr( align( 8 ) ) ]
75
+ pub struct tpacket_hdr_v1 {
76
+ pub block_status: :: __u32,
77
+ pub num_pkts: :: __u32,
78
+ pub offset_to_first_pkt: :: __u32,
79
+ pub blk_len: :: __u32,
80
+ pub seq_num: :: __u64,
81
+ pub ts_first_pkt: :: tpacket_bd_ts,
82
+ pub ts_last_pkt: :: tpacket_bd_ts,
83
+ }
66
84
}
67
85
68
86
s_no_extra_traits! {
You can’t perform that action at this time.
0 commit comments