File tree 2 files changed +17
-0
lines changed
src/unix/linux_like/linux
2 files changed +17
-0
lines changed Original file line number Diff line number Diff line change @@ -3377,6 +3377,8 @@ fn test_linux(target: &str) {
3377
3377
// FIXME: This is actually a union, not a struct
3378
3378
"sigval" => true ,
3379
3379
3380
+ "fanout_args" if musl => true ,
3381
+
3380
3382
// This type is tested in the `linux_termios.rs` file since there
3381
3383
// are header conflicts when including them with all the other
3382
3384
// structs.
Original file line number Diff line number Diff line change @@ -2917,6 +2917,17 @@ pub const TP_STATUS_TS_SOFTWARE: ::__u32 = 1 << 29;
2917
2917
pub const TP_STATUS_TS_SYS_HARDWARE : :: __u32 = 1 << 30 ;
2918
2918
pub const TP_STATUS_TS_RAW_HARDWARE : :: __u32 = 1 << 31 ;
2919
2919
2920
+ pub const TPACKET_ALIGNMENT : usize = 16 ;
2921
+ pub const TPACKET_HDRLEN : usize = ( ( core:: mem:: size_of :: < :: tpacket_hdr > ( ) + TPACKET_ALIGNMENT - 1 )
2922
+ & !( TPACKET_ALIGNMENT - 1 ) )
2923
+ + core:: mem:: size_of :: < :: sockaddr_ll > ( ) ;
2924
+ pub const TPACKET2_HDRLEN : usize =
2925
+ ( ( core:: mem:: size_of :: < :: tpacket2_hdr > ( ) + TPACKET_ALIGNMENT - 1 ) & !( TPACKET_ALIGNMENT - 1 ) )
2926
+ + core:: mem:: size_of :: < :: sockaddr_ll > ( ) ;
2927
+ pub const TPACKET3_HDRLEN : usize =
2928
+ ( ( core:: mem:: size_of :: < :: tpacket3_hdr > ( ) + TPACKET_ALIGNMENT - 1 ) & !( TPACKET_ALIGNMENT - 1 ) )
2929
+ + core:: mem:: size_of :: < :: sockaddr_ll > ( ) ;
2930
+
2920
2931
// linux/netfilter.h
2921
2932
pub const NF_DROP : :: c_int = 0 ;
2922
2933
pub const NF_ACCEPT : :: c_int = 1 ;
@@ -4214,6 +4225,10 @@ f! {
4214
4225
ee. offset( 1 ) as * mut :: sockaddr
4215
4226
}
4216
4227
4228
+ pub fn TPACKET_ALIGN ( x: usize ) -> usize {
4229
+ ( x + TPACKET_ALIGNMENT - 1 ) & !( TPACKET_ALIGNMENT - 1 )
4230
+ }
4231
+
4217
4232
pub fn BPF_RVAL ( code: :: __u32) -> :: __u32 {
4218
4233
code & 0x18
4219
4234
}
You can’t perform that action at this time.
0 commit comments