File tree Expand file tree Collapse file tree 5 files changed +322
-1
lines changed
src/unix/linux_like/linux Expand file tree Collapse file tree 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) {
34513451 "netinet/ip.h" ,
34523452 "netinet/tcp.h" ,
34533453 "netinet/udp.h" ,
3454- "netpacket/packet.h" ,
34553454 "poll.h" ,
34563455 "pthread.h" ,
34573456 "pty.h" ,
@@ -3554,6 +3553,7 @@ fn test_linux(target: &str) {
35543553 "linux/if_addr.h" ,
35553554 "linux/if_alg.h" ,
35563555 "linux/if_ether.h" ,
3556+ "linux/if_packet.h" ,
35573557 "linux/if_tun.h" ,
35583558 "linux/if_xdp.h" ,
35593559 "linux/input.h" ,
@@ -3730,6 +3730,23 @@ fn test_linux(target: &str) {
37303730 if ( gnu && sparc64) && ( ty == "ip_mreqn" || ty == "hwtstamp_config" ) {
37313731 return true ;
37323732 }
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+
37333750 match ty {
37343751 // These cannot be tested when "resolv.h" is included and are tested
37353752 // in the `linux_elf.rs` file.
Original file line number Diff line number Diff line change @@ -1805,11 +1805,38 @@ O_RSYNC
18051805O_SYNC
18061806O_TMPFILE
18071807PACKET_ADD_MEMBERSHIP
1808+ PACKET_AUXDATA
1809+ PACKET_BROADCAST
18081810PACKET_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
18091826PACKET_MR_ALLMULTI
18101827PACKET_MR_MULTICAST
18111828PACKET_MR_PROMISC
18121829PACKET_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
18131840PENDIN
18141841PF_ALG
18151842PF_APPLETALK
@@ -3195,6 +3222,23 @@ TLS_GET_RECORD_TYPE
31953222TLS_RX
31963223TLS_SET_RECORD_TYPE
31973224TLS_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
31983242TUN_READQ_SIZE
31993243TUN_TAP_DEV
32003244TUN_TUN_DEV
@@ -3457,6 +3501,7 @@ fanotify_event_metadata
34573501fanotify_init
34583502fanotify_mark
34593503fanotify_response
3504+ fanout_args
34603505fchdir
34613506fdatasync
34623507fdopendir
@@ -3825,6 +3870,7 @@ sockaddr_alg
38253870sockaddr_can
38263871sockaddr_ll
38273872sockaddr_nl
3873+ sockaddr_pkt
38283874sockaddr_vm
38293875splice
38303876spwd
@@ -3862,6 +3908,22 @@ timer_getoverrun
38623908timer_gettime
38633909timer_settime
38643910tmpfile64
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
38653927truncate
38663928truncate64
38673929ttyname_r
Original file line number Diff line number Diff line change @@ -63,6 +63,24 @@ macro_rules! expand_align {
6363 pub fd: :: c_int,
6464 pub pid: :: c_int,
6565 }
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+ }
6684 }
6785
6886 s_no_extra_traits! {
You can’t perform that action at this time.
0 commit comments