File tree 6 files changed +347
-2
lines changed
src/unix/linux_like/linux
6 files changed +347
-2
lines changed Original file line number Diff line number Diff line change @@ -3387,7 +3387,6 @@ fn test_linux(target: &str) {
3387
3387
"netinet/ip.h" ,
3388
3388
"netinet/tcp.h" ,
3389
3389
"netinet/udp.h" ,
3390
- "netpacket/packet.h" ,
3391
3390
"poll.h" ,
3392
3391
"pthread.h" ,
3393
3392
"pty.h" ,
@@ -3489,6 +3488,7 @@ fn test_linux(target: &str) {
3489
3488
"linux/if_addr.h" ,
3490
3489
"linux/if_alg.h" ,
3491
3490
"linux/if_ether.h" ,
3491
+ "linux/if_packet.h" ,
3492
3492
"linux/if_tun.h" ,
3493
3493
"linux/if_xdp.h" ,
3494
3494
"linux/input.h" ,
@@ -3669,6 +3669,23 @@ fn test_linux(target: &str) {
3669
3669
if ( gnu && sparc64) && ( ty == "ip_mreqn" || ty == "hwtstamp_config" ) {
3670
3670
return true ;
3671
3671
}
3672
+ // FIXME: pass by value for structs that are not an even 32/64 bits on
3673
+ // big-endian systems corrupts the value for unknown reasons.
3674
+ if ( sparc64 || ppc || ppc64 || s390x)
3675
+ && ( ty == "sockaddr_pkt"
3676
+ || ty == "tpacket_auxdata"
3677
+ || ty == "tpacket_hdr_variant1"
3678
+ || ty == "tpacket_req3"
3679
+ || ty == "tpacket_stats_v3"
3680
+ || ty == "tpacket_req_u" )
3681
+ {
3682
+ return true ;
3683
+ }
3684
+ // FIXME: musl doesn't compile with `struct fanout_args` for unknown reasons.
3685
+ if musl && ty == "fanout_args" {
3686
+ return true ;
3687
+ }
3688
+
3672
3689
match ty {
3673
3690
// These cannot be tested when "resolv.h" is included and are tested
3674
3691
// in the `linux_elf.rs` file.
Original file line number Diff line number Diff line change @@ -1802,11 +1802,38 @@ O_RSYNC
1802
1802
O_SYNC
1803
1803
O_TMPFILE
1804
1804
PACKET_ADD_MEMBERSHIP
1805
+ PACKET_AUXDATA
1806
+ PACKET_BROADCAST
1805
1807
PACKET_DROP_MEMBERSHIP
1808
+ PACKET_FANOUT
1809
+ PACKET_FANOUT_CBPF
1810
+ PACKET_FANOUT_CPU
1811
+ PACKET_FANOUT_FLAG_DEFRAG
1812
+ PACKET_FANOUT_FLAG_ROLLOVER
1813
+ PACKET_FANOUT_FLAG_UNIQUEID
1814
+ PACKET_FANOUT_HASH
1815
+ PACKET_FANOUT_LB
1816
+ PACKET_FANOUT_QM
1817
+ PACKET_FANOUT_RND
1818
+ PACKET_FANOUT_ROLLOVER
1819
+ PACKET_HOST
1820
+ PACKET_KERNEL
1821
+ PACKET_LOOPBACK
1822
+ PACKET_LOSS
1806
1823
PACKET_MR_ALLMULTI
1807
1824
PACKET_MR_MULTICAST
1808
1825
PACKET_MR_PROMISC
1809
1826
PACKET_MR_UNICAST
1827
+ PACKET_MULTICAST
1828
+ PACKET_OTHERHOST
1829
+ PACKET_OUTGOING
1830
+ PACKET_QDISC_BYPASS
1831
+ PACKET_RESERVE
1832
+ PACKET_RX_RING
1833
+ PACKET_STATISTICS
1834
+ PACKET_TIMESTAMP
1835
+ PACKET_USER
1836
+ PACKET_VERSION
1810
1837
PENDIN
1811
1838
PF_ALG
1812
1839
PF_APPLETALK
@@ -3191,6 +3218,23 @@ TLS_GET_RECORD_TYPE
3191
3218
TLS_RX
3192
3219
TLS_SET_RECORD_TYPE
3193
3220
TLS_TX
3221
+ TP_FT_REQ_FILL_RXHASH
3222
+ TP_STATUS_AVAILABLE
3223
+ TP_STATUS_BLK_TMO
3224
+ TP_STATUS_COPY
3225
+ TP_STATUS_CSUMNOTREADY
3226
+ TP_STATUS_CSUM_VALID
3227
+ TP_STATUS_KERNEL
3228
+ TP_STATUS_LOSING
3229
+ TP_STATUS_SENDING
3230
+ TP_STATUS_SEND_REQUEST
3231
+ TP_STATUS_TS_RAW_HARDWARE
3232
+ TP_STATUS_TS_SOFTWARE
3233
+ TP_STATUS_TS_SYS_HARDWARE
3234
+ TP_STATUS_USER
3235
+ TP_STATUS_VLAN_TPID_VALID
3236
+ TP_STATUS_VLAN_VALID
3237
+ TP_STATUS_WRONG_FORMAT
3194
3238
TUN_READQ_SIZE
3195
3239
TUN_TAP_DEV
3196
3240
TUN_TUN_DEV
@@ -3453,6 +3497,7 @@ fanotify_event_metadata
3453
3497
fanotify_init
3454
3498
fanotify_mark
3455
3499
fanotify_response
3500
+ fanout_args
3456
3501
fchdir
3457
3502
fdatasync
3458
3503
fdopendir
@@ -3820,6 +3865,7 @@ sockaddr_alg
3820
3865
sockaddr_can
3821
3866
sockaddr_ll
3822
3867
sockaddr_nl
3868
+ sockaddr_pkt
3823
3869
sockaddr_vm
3824
3870
splice
3825
3871
spwd
@@ -3857,6 +3903,22 @@ timer_getoverrun
3857
3903
timer_gettime
3858
3904
timer_settime
3859
3905
tmpfile64
3906
+ tpacket2_hdr
3907
+ tpacket3_hdr
3908
+ tpacket_auxdata
3909
+ tpacket_bd_header_u
3910
+ tpacket_bd_ts
3911
+ tpacket_block_desc
3912
+ tpacket_hdr
3913
+ tpacket_hdr_v1
3914
+ tpacket_hdr_variant1
3915
+ tpacket_req
3916
+ tpacket_req3
3917
+ tpacket_req_u
3918
+ tpacket_rollover_stats
3919
+ tpacket_stats
3920
+ tpacket_stats_v3
3921
+ tpacket_versions
3860
3922
truncate
3861
3923
truncate64
3862
3924
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! {
@@ -200,6 +218,8 @@ macro_rules! expand_align {
200
218
pub af: u32 ,
201
219
pub data: [ u8 ; CANXL_MAX_DLEN ] ,
202
220
}
221
+
222
+
203
223
}
204
224
} ;
205
225
}
You can’t perform that action at this time.
0 commit comments