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 @@ -3451,7 +3451,6 @@ fn test_linux(target: &str) {
3451
3451
"netinet/ip.h" ,
3452
3452
"netinet/tcp.h" ,
3453
3453
"netinet/udp.h" ,
3454
- "netpacket/packet.h" ,
3455
3454
"poll.h" ,
3456
3455
"pthread.h" ,
3457
3456
"pty.h" ,
@@ -3554,6 +3553,7 @@ fn test_linux(target: &str) {
3554
3553
"linux/if_addr.h" ,
3555
3554
"linux/if_alg.h" ,
3556
3555
"linux/if_ether.h" ,
3556
+ "linux/if_packet.h" ,
3557
3557
"linux/if_tun.h" ,
3558
3558
"linux/if_xdp.h" ,
3559
3559
"linux/input.h" ,
@@ -3730,6 +3730,23 @@ fn test_linux(target: &str) {
3730
3730
if ( gnu && sparc64) && ( ty == "ip_mreqn" || ty == "hwtstamp_config" ) {
3731
3731
return true ;
3732
3732
}
3733
+ // FIXME(https://github.com/rust-lang/rust/issues/43894): pass by value for structs that are not an even 32/64 bits on
3734
+ // big-endian systems corrupts the value for unknown reasons.
3735
+ if ( sparc64 || ppc || ppc64 || s390x)
3736
+ && ( ty == "sockaddr_pkt"
3737
+ || ty == "tpacket_auxdata"
3738
+ || ty == "tpacket_hdr_variant1"
3739
+ || ty == "tpacket_req3"
3740
+ || ty == "tpacket_stats_v3"
3741
+ || ty == "tpacket_req_u" )
3742
+ {
3743
+ return true ;
3744
+ }
3745
+ // FIXME: musl doesn't compile with `struct fanout_args` for unknown reasons.
3746
+ if musl && ty == "fanout_args" {
3747
+ return true ;
3748
+ }
3749
+
3733
3750
match ty {
3734
3751
// These cannot be tested when "resolv.h" is included and are tested
3735
3752
// 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
@@ -3825,6 +3870,7 @@ sockaddr_alg
3825
3870
sockaddr_can
3826
3871
sockaddr_ll
3827
3872
sockaddr_nl
3873
+ sockaddr_pkt
3828
3874
sockaddr_vm
3829
3875
splice
3830
3876
spwd
@@ -3862,6 +3908,22 @@ timer_getoverrun
3862
3908
timer_gettime
3863
3909
timer_settime
3864
3910
tmpfile64
3911
+ tpacket2_hdr
3912
+ tpacket3_hdr
3913
+ tpacket_auxdata
3914
+ tpacket_bd_header_u
3915
+ tpacket_bd_ts
3916
+ tpacket_block_desc
3917
+ tpacket_hdr
3918
+ tpacket_hdr_v1
3919
+ tpacket_hdr_variant1
3920
+ tpacket_req
3921
+ tpacket_req3
3922
+ tpacket_req_u
3923
+ tpacket_rollover_stats
3924
+ tpacket_stats
3925
+ tpacket_stats_v3
3926
+ tpacket_versions
3865
3927
truncate
3866
3928
truncate64
3867
3929
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