Skip to content

Instantly share code, notes, and snippets.

@kornelski
Created February 8, 2017 17:20
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kornelski/ffee1e2a0448ea37accc15e34ad90088 to your computer and use it in GitHub Desktop.
Save kornelski/ffee1e2a0448ea37accc15e34ad90088 to your computer and use it in GitHub Desktop.
running 71 tests
test header_blocks_h ... ok
test header_anon_enum_whitelist_h ... ok
test header_bitfield_method_mangling_h ... ok
test header_complex_global_h ... ok
test header_const_resolved_ty_h ... ok
test header_complex_h ... FAILED
test header_constant_evaluate_h ... FAILED
test header_constify_all_enums_h ... FAILED
test header_constify_enum_h ... ok
test header_convert_floats_h ... FAILED
test header_dash_language_h ... ok
test header_decl_extern_int_twice_h ... ok
test header_decl_ptr_to_array_h ... ok
test header_enum_dupe_h ... ok
test header_16_byte_alignment_h ... FAILED
test header_enum_h ... ok
test header_enum_negative_h ... ok
test header_enum_packed_h ... ok
test header_forward_declared_struct_h ... FAILED
test header_func_proto_h ... ok
test header_func_ptr_h ... ok
test header_func_with_array_arg_h ... ok
test header_func_ptr_in_struct_h ... FAILED
test header_func_with_func_ptr_arg_h ... ok
test header_inline_function_h ... ok
test header_int128_t_h ... ok
test header_keywords_h ... ok
test header_layout_align_h ... FAILED
test header_layout_arp_h ... FAILED
test header_layout_h ... ok
test header_layout_kni_mbuf_h ... FAILED
test header_layout_cmdline_token_h ... FAILED
test header_layout_array_h ... FAILED
test header_macro_const_h ... ok
test header_macro_redef_h ... ok
test header_macro_expr_basic_h ... ok
test header_no_comments_h ... FAILED
test header_no_derive_debug_h ... FAILED
test header_no_derive_default_h ... FAILED
test header_no_recursive_whitelisting_h ... FAILED
test header_no_std_h ... FAILED
test header_objc_interface_h ... ok
test header_objc_interface_type_h ... FAILED
test header_objc_method_h ... ok
test header_resolved_type_def_function_h ... ok
test header_struct_containing_forward_declared_struct_h ... FAILED
test header_struct_with_anon_struct_h ... FAILED
test header_struct_with_anon_struct_array_h ... FAILED
test header_struct_with_anon_struct_pointer_h ... FAILED
test header_struct_with_anon_union_h ... FAILED
test header_struct_with_anon_unnamed_struct_h ... FAILED
test header_struct_with_anon_unnamed_union_h ... FAILED
test header_struct_with_bitfields_h ... FAILED
test header_struct_with_derive_debug_h ... FAILED
test header_struct_with_packing_h ... FAILED
test header_struct_with_nesting_h ... FAILED
test header_struct_with_struct_h ... FAILED
test header_type_referenced_by_whitelisted_function_h ... FAILED
test header_typedefd_array_as_function_arg_h ... ok
test header_union_with_anon_struct_h ... FAILED
test header_union_with_anon_struct_bitfield_h ... FAILED
test header_union_with_anon_union_h ... FAILED
test header_union_with_anon_unnamed_struct_h ... FAILED
test header_union_with_anon_unnamed_union_h ... FAILED
test header_union_with_big_member_h ... FAILED
test header_unknown_attr_h ... FAILED
test header_union_with_nesting_h ... FAILED
test header_use_core_h ... FAILED
test header_whitelist_vars_h ... ok
test header_layout_mbuf_h ... FAILED
test header_layout_eth_conf_h ... FAILED
failures:
---- header_complex_h stdout ----
diff expected generated
--- expected: "/bindgen/tests/expectations/tests/complex.rs"
+++ generated from: "/bindgen/tests/headers/complex.h"
/* automatically generated by rust-bindgen */
#![allow(non_snake_case)]
#[derive(PartialEq, Copy, Clone, Hash, Debug, Default)]
#[repr(C)]
pub struct __BindgenComplex<T> {
pub re: T,
pub im: T,
}
#[repr(C)]
#[derive(Debug, Default, Copy)]
pub struct TestDouble {
pub mMember: __BindgenComplex<f64>,
}
#[test]
fn bindgen_test_layout_TestDouble() {
assert_eq!(::std::mem::size_of::<TestDouble>() , 16usize , concat ! (
"Size of: " , stringify ! ( TestDouble ) ));
assert_eq! (::std::mem::align_of::<TestDouble>() , 8usize , concat ! (
"Alignment of " , stringify ! ( TestDouble ) ));
- assert_eq! (unsafe {
- & ( * ( 0 as * const TestDouble ) ) . mMember as * const _ as
- usize } , 0usize , concat ! (
- "Alignment of field: " , stringify ! ( TestDouble ) , "::" ,
- stringify ! ( mMember ) ));
}
impl Clone for TestDouble {
fn clone(&self) -> Self { *self }
}
#[repr(C)]
#[derive(Debug, Copy)]
pub struct TestDoublePtr {
pub mMember: *mut __BindgenComplex<f64>,
}
#[test]
fn bindgen_test_layout_TestDoublePtr() {
assert_eq!(::std::mem::size_of::<TestDoublePtr>() , 8usize , concat ! (
"Size of: " , stringify ! ( TestDoublePtr ) ));
assert_eq! (::std::mem::align_of::<TestDoublePtr>() , 8usize , concat ! (
"Alignment of " , stringify ! ( TestDoublePtr ) ));
- assert_eq! (unsafe {
- & ( * ( 0 as * const TestDoublePtr ) ) . mMember as * const _
- as usize } , 0usize , concat ! (
- "Alignment of field: " , stringify ! ( TestDoublePtr ) , "::"
- , stringify ! ( mMember ) ));
}
impl Clone for TestDoublePtr {
fn clone(&self) -> Self { *self }
}
impl Default for TestDoublePtr {
fn default() -> Self { unsafe { ::std::mem::zeroed() } }
}
#[repr(C)]
#[derive(Debug, Default, Copy)]
pub struct TestFloat {
pub mMember: __BindgenComplex<f32>,
}
#[test]
fn bindgen_test_layout_TestFloat() {
assert_eq!(::std::mem::size_of::<TestFloat>() , 8usize , concat ! (
"Size of: " , stringify ! ( TestFloat ) ));
assert_eq! (::std::mem::align_of::<TestFloat>() , 4usize , concat ! (
"Alignment of " , stringify ! ( TestFloat ) ));
- assert_eq! (unsafe {
- & ( * ( 0 as * const TestFloat ) ) . mMember as * const _ as
- usize } , 0usize , concat ! (
- "Alignment of field: " , stringify ! ( TestFloat ) , "::" ,
- stringify ! ( mMember ) ));
}
impl Clone for TestFloat {
fn clone(&self) -> Self { *self }
}
#[repr(C)]
#[derive(Debug, Copy)]
pub struct TestFloatPtr {
pub mMember: *mut __BindgenComplex<f32>,
}
#[test]
fn bindgen_test_layout_TestFloatPtr() {
assert_eq!(::std::mem::size_of::<TestFloatPtr>() , 8usize , concat ! (
"Size of: " , stringify ! ( TestFloatPtr ) ));
assert_eq! (::std::mem::align_of::<TestFloatPtr>() , 8usize , concat ! (
"Alignment of " , stringify ! ( TestFloatPtr ) ));
- assert_eq! (unsafe {
- & ( * ( 0 as * const TestFloatPtr ) ) . mMember as * const _
- as usize } , 0usize , concat ! (
- "Alignment of field: " , stringify ! ( TestFloatPtr ) , "::" ,
- stringify ! ( mMember ) ));
}
impl Clone for TestFloatPtr {
fn clone(&self) -> Self { *self }
}
impl Default for TestFloatPtr {
fn default() -> Self { unsafe { ::std::mem::zeroed() } }
}
thread 'header_complex_h' panicked at 'Header and binding differ!', /bindgen/target/debug/build/bindgen-f6fdd37f3e51109e/out/tests.rs:4
note: Run with `RUST_BACKTRACE=1` for a backtrace.
---- header_constant_evaluate_h stdout ----
diff expected generated
--- expected: "/bindgen/tests/expectations/tests/constant-evaluate.rs"
+++ generated from: "/bindgen/tests/headers/constant-evaluate.h"
/* automatically generated by rust-bindgen */
#![allow(non_snake_case)]
pub const foo: _bindgen_ty_1 = _bindgen_ty_1::foo;
pub const bar: _bindgen_ty_1 = _bindgen_ty_1::bar;
#[repr(u32)]
#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)]
pub enum _bindgen_ty_1 { foo = 4, bar = 8, }
pub type EasyToOverflow = ::std::os::raw::c_ulonglong;
pub const k: EasyToOverflow = 2147483648;
-pub const k_expr: EasyToOverflow = 0;
-pub const BAZ: ::std::os::raw::c_longlong = 24;
-pub const fuzz: f64 = 51.;
-pub const BAZZ: ::std::os::raw::c_char = 53;
-pub const WAT: ::std::os::raw::c_char = 0;
-pub const bytestring: &'static [u8; 4usize] = b"Foo\x00";
-pub const NOT_UTF8: [u8; 5usize] = [240, 40, 140, 40, 0];
+extern "C" {
+ #[link_name = "k_expr"]
+ pub static k_expr: EasyToOverflow;
+}
+extern "C" {
+ #[link_name = "BAZ"]
+ pub static BAZ: ::std::os::raw::c_longlong;
+}
+extern "C" {
+ #[link_name = "fuzz"]
+ pub static fuzz: f64;
+}
+extern "C" {
+ #[link_name = "BAZZ"]
+ pub static BAZZ: ::std::os::raw::c_char;
+}
+extern "C" {
+ #[link_name = "WAT"]
+ pub static WAT: ::std::os::raw::c_char;
+}
+extern "C" {
+ #[link_name = "bytestring"]
+ pub static mut bytestring: *const ::std::os::raw::c_char;
+}
+extern "C" {
+ #[link_name = "NOT_UTF8"]
+ pub static mut NOT_UTF8: *const ::std::os::raw::c_char;
+}
thread 'header_constant_evaluate_h' panicked at 'Header and binding differ!', /bindgen/target/debug/build/bindgen-f6fdd37f3e51109e/out/tests.rs:19
---- header_constify_all_enums_h stdout ----
diff expected generated
--- expected: "/bindgen/tests/expectations/tests/constify-all-enums.rs"
+++ generated from: "/bindgen/tests/headers/constify-all-enums.h"
/* automatically generated by rust-bindgen */
#![allow(non_snake_case)]
pub const foo_THIS: foo = 0;
pub const foo_SHOULD_BE: foo = 1;
pub const foo_A_CONSTANT: foo = 2;
pub type foo = ::std::os::raw::c_uint;
#[repr(C)]
#[derive(Debug, Copy)]
pub struct bar {
pub this_should_work: foo,
}
#[test]
fn bindgen_test_layout_bar() {
assert_eq!(::std::mem::size_of::<bar>() , 4usize , concat ! (
"Size of: " , stringify ! ( bar ) ));
assert_eq! (::std::mem::align_of::<bar>() , 4usize , concat ! (
"Alignment of " , stringify ! ( bar ) ));
- assert_eq! (unsafe {
- & ( * ( 0 as * const bar ) ) . this_should_work as * const _
- as usize } , 0usize , concat ! (
- "Alignment of field: " , stringify ! ( bar ) , "::" ,
- stringify ! ( this_should_work ) ));
}
impl Clone for bar {
fn clone(&self) -> Self { *self }
}
impl Default for bar {
fn default() -> Self { unsafe { ::std::mem::zeroed() } }
}
thread 'header_constify_all_enums_h' panicked at 'Header and binding differ!', /bindgen/target/debug/build/bindgen-f6fdd37f3e51109e/out/tests.rs:69
---- header_convert_floats_h stdout ----
diff expected generated
--- expected: "/bindgen/tests/expectations/tests/convert-floats.rs"
+++ generated from: "/bindgen/tests/headers/convert-floats.h"
/* automatically generated by rust-bindgen */
#![allow(non_snake_case)]
#[derive(PartialEq, Copy, Clone, Hash, Debug, Default)]
#[repr(C)]
pub struct __BindgenComplex<T> {
pub re: T,
pub im: T,
}
#[repr(C)]
#[derive(Debug, Copy)]
pub struct foo {
pub bar: ::std::os::raw::c_float,
pub baz: ::std::os::raw::c_float,
pub bazz: ::std::os::raw::c_double,
pub bazzz: *mut ::std::os::raw::c_double,
pub complexFloat: __BindgenComplex<::std::os::raw::c_float>,
pub complexDouble: __BindgenComplex<::std::os::raw::c_double>,
}
#[test]
fn bindgen_test_layout_foo() {
assert_eq!(::std::mem::size_of::<foo>() , 48usize , concat ! (
"Size of: " , stringify ! ( foo ) ));
assert_eq! (::std::mem::align_of::<foo>() , 8usize , concat ! (
"Alignment of " , stringify ! ( foo ) ));
- assert_eq! (unsafe {
- & ( * ( 0 as * const foo ) ) . bar as * const _ as usize } ,
- 0usize , concat ! (
- "Alignment of field: " , stringify ! ( foo ) , "::" ,
- stringify ! ( bar ) ));
- assert_eq! (unsafe {
- & ( * ( 0 as * const foo ) ) . baz as * const _ as usize } ,
- 4usize , concat ! (
- "Alignment of field: " , stringify ! ( foo ) , "::" ,
- stringify ! ( baz ) ));
- assert_eq! (unsafe {
- & ( * ( 0 as * const foo ) ) . bazz as * const _ as usize } ,
- 8usize , concat ! (
- "Alignment of field: " , stringify ! ( foo ) , "::" ,
- stringify ! ( bazz ) ));
- assert_eq! (unsafe {
- & ( * ( 0 as * const foo ) ) . bazzz as * const _ as usize } ,
- 16usize , concat ! (
- "Alignment of field: " , stringify ! ( foo ) , "::" ,
- stringify ! ( bazzz ) ));
- assert_eq! (unsafe {
- & ( * ( 0 as * const foo ) ) . complexFloat as * const _ as
- usize } , 24usize , concat ! (
- "Alignment of field: " , stringify ! ( foo ) , "::" ,
- stringify ! ( complexFloat ) ));
- assert_eq! (unsafe {
- & ( * ( 0 as * const foo ) ) . complexDouble as * const _ as
- usize } , 32usize , concat ! (
- "Alignment of field: " , stringify ! ( foo ) , "::" ,
- stringify ! ( complexDouble ) ));
}
impl Clone for foo {
fn clone(&self) -> Self { *self }
}
impl Default for foo {
fn default() -> Self { unsafe { ::std::mem::zeroed() } }
}
thread 'header_convert_floats_h' panicked at 'Header and binding differ!', /bindgen/target/debug/build/bindgen-f6fdd37f3e51109e/out/tests.rs:50
---- header_16_byte_alignment_h stdout ----
diff expected generated
--- expected: "/bindgen/tests/expectations/tests/16-byte-alignment.rs"
+++ generated from: "/bindgen/tests/headers/16-byte-alignment.h"
/* automatically generated by rust-bindgen */
#![allow(non_snake_case)]
#[repr(C)]
pub struct __BindgenUnionField<T>(::std::marker::PhantomData<T>);
impl <T> __BindgenUnionField<T> {
#[inline]
pub fn new() -> Self { __BindgenUnionField(::std::marker::PhantomData) }
#[inline]
pub unsafe fn as_ref(&self) -> &T { ::std::mem::transmute(self) }
#[inline]
pub unsafe fn as_mut(&mut self) -> &mut T { ::std::mem::transmute(self) }
}
impl <T> ::std::default::Default for __BindgenUnionField<T> {
#[inline]
fn default() -> Self { Self::new() }
}
impl <T> ::std::clone::Clone for __BindgenUnionField<T> {
#[inline]
fn clone(&self) -> Self { Self::new() }
}
impl <T> ::std::marker::Copy for __BindgenUnionField<T> { }
impl <T> ::std::fmt::Debug for __BindgenUnionField<T> {
fn fmt(&self, fmt: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
fmt.write_str("__BindgenUnionField")
}
}
#[repr(C)]
#[derive(Debug, Default, Copy)]
pub struct rte_ipv4_tuple {
pub src_addr: u32,
pub dst_addr: u32,
pub __bindgen_anon_1: rte_ipv4_tuple__bindgen_ty_1,
}
#[repr(C)]
#[derive(Debug, Default, Copy)]
pub struct rte_ipv4_tuple__bindgen_ty_1 {
pub __bindgen_anon_1: __BindgenUnionField<rte_ipv4_tuple__bindgen_ty_1__bindgen_ty_1>,
pub sctp_tag: __BindgenUnionField<u32>,
pub bindgen_union_field: u32,
}
#[repr(C)]
#[derive(Debug, Default, Copy)]
pub struct rte_ipv4_tuple__bindgen_ty_1__bindgen_ty_1 {
pub dport: u16,
pub sport: u16,
}
#[test]
fn bindgen_test_layout_rte_ipv4_tuple__bindgen_ty_1__bindgen_ty_1() {
assert_eq!(::std::mem::size_of::<rte_ipv4_tuple__bindgen_ty_1__bindgen_ty_1>()
, 4usize , concat ! (
"Size of: " , stringify ! (
rte_ipv4_tuple__bindgen_ty_1__bindgen_ty_1 ) ));
assert_eq! (::std::mem::align_of::<rte_ipv4_tuple__bindgen_ty_1__bindgen_ty_1>()
, 2usize , concat ! (
"Alignment of " , stringify ! (
rte_ipv4_tuple__bindgen_ty_1__bindgen_ty_1 ) ));
- assert_eq! (unsafe {
- & (
- * ( 0 as * const rte_ipv4_tuple__bindgen_ty_1__bindgen_ty_1 )
- ) . dport as * const _ as usize } , 0usize , concat ! (
- "Alignment of field: " , stringify ! (
- rte_ipv4_tuple__bindgen_ty_1__bindgen_ty_1 ) , "::" ,
- stringify ! ( dport ) ));
- assert_eq! (unsafe {
- & (
- * ( 0 as * const rte_ipv4_tuple__bindgen_ty_1__bindgen_ty_1 )
- ) . sport as * const _ as usize } , 2usize , concat ! (
- "Alignment of field: " , stringify ! (
- rte_ipv4_tuple__bindgen_ty_1__bindgen_ty_1 ) , "::" ,
- stringify ! ( sport ) ));
}
impl Clone for rte_ipv4_tuple__bindgen_ty_1__bindgen_ty_1 {
fn clone(&self) -> Self { *self }
}
#[test]
fn bindgen_test_layout_rte_ipv4_tuple__bindgen_ty_1() {
assert_eq!(::std::mem::size_of::<rte_ipv4_tuple__bindgen_ty_1>() , 4usize
, concat ! (
"Size of: " , stringify ! ( rte_ipv4_tuple__bindgen_ty_1 ) ));
assert_eq! (::std::mem::align_of::<rte_ipv4_tuple__bindgen_ty_1>() ,
4usize , concat ! (
"Alignment of " , stringify ! ( rte_ipv4_tuple__bindgen_ty_1 )
));
- assert_eq! (unsafe {
- & ( * ( 0 as * const rte_ipv4_tuple__bindgen_ty_1 ) ) .
- sctp_tag as * const _ as usize } , 0usize , concat ! (
- "Alignment of field: " , stringify ! (
- rte_ipv4_tuple__bindgen_ty_1 ) , "::" , stringify ! ( sctp_tag
- ) ));
}
impl Clone for rte_ipv4_tuple__bindgen_ty_1 {
fn clone(&self) -> Self { *self }
}
#[test]
fn bindgen_test_layout_rte_ipv4_tuple() {
assert_eq!(::std::mem::size_of::<rte_ipv4_tuple>() , 12usize , concat ! (
"Size of: " , stringify ! ( rte_ipv4_tuple ) ));
assert_eq! (::std::mem::align_of::<rte_ipv4_tuple>() , 4usize , concat ! (
"Alignment of " , stringify ! ( rte_ipv4_tuple ) ));
- assert_eq! (unsafe {
- & ( * ( 0 as * const rte_ipv4_tuple ) ) . src_addr as * const
- _ as usize } , 0usize , concat ! (
- "Alignment of field: " , stringify ! ( rte_ipv4_tuple ) , "::"
- , stringify ! ( src_addr ) ));
- assert_eq! (unsafe {
- & ( * ( 0 as * const rte_ipv4_tuple ) ) . dst_addr as * const
- _ as usize } , 4usize , concat ! (
- "Alignment of field: " , stringify ! ( rte_ipv4_tuple ) , "::"
- , stringify ! ( dst_addr ) ));
}
impl Clone for rte_ipv4_tuple {
fn clone(&self) -> Self { *self }
}
#[repr(C)]
#[derive(Debug, Default, Copy)]
pub struct rte_ipv6_tuple {
pub src_addr: [u8; 16usize],
pub dst_addr: [u8; 16usize],
pub __bindgen_anon_1: rte_ipv6_tuple__bindgen_ty_1,
}
#[repr(C)]
#[derive(Debug, Default, Copy)]
pub struct rte_ipv6_tuple__bindgen_ty_1 {
pub __bindgen_anon_1: __BindgenUnionField<rte_ipv6_tuple__bindgen_ty_1__bindgen_ty_1>,
pub sctp_tag: __BindgenUnionField<u32>,
pub bindgen_union_field: u32,
}
#[repr(C)]
#[derive(Debug, Default, Copy)]
pub struct rte_ipv6_tuple__bindgen_ty_1__bindgen_ty_1 {
pub dport: u16,
pub sport: u16,
}
#[test]
fn bindgen_test_layout_rte_ipv6_tuple__bindgen_ty_1__bindgen_ty_1() {
assert_eq!(::std::mem::size_of::<rte_ipv6_tuple__bindgen_ty_1__bindgen_ty_1>()
, 4usize , concat ! (
"Size of: " , stringify ! (
rte_ipv6_tuple__bindgen_ty_1__bindgen_ty_1 ) ));
assert_eq! (::std::mem::align_of::<rte_ipv6_tuple__bindgen_ty_1__bindgen_ty_1>()
, 2usize , concat ! (
"Alignment of " , stringify ! (
rte_ipv6_tuple__bindgen_ty_1__bindgen_ty_1 ) ));
- assert_eq! (unsafe {
- & (
- * ( 0 as * const rte_ipv6_tuple__bindgen_ty_1__bindgen_ty_1 )
- ) . dport as * const _ as usize } , 0usize , concat ! (
- "Alignment of field: " , stringify ! (
- rte_ipv6_tuple__bindgen_ty_1__bindgen_ty_1 ) , "::" ,
- stringify ! ( dport ) ));
- assert_eq! (unsafe {
- & (
- * ( 0 as * const rte_ipv6_tuple__bindgen_ty_1__bindgen_ty_1 )
- ) . sport as * const _ as usize } , 2usize , concat ! (
- "Alignment of field: " , stringify ! (
- rte_ipv6_tuple__bindgen_ty_1__bindgen_ty_1 ) , "::" ,
- stringify ! ( sport ) ));
}
impl Clone for rte_ipv6_tuple__bindgen_ty_1__bindgen_ty_1 {
fn clone(&self) -> Self { *self }
}
#[test]
fn bindgen_test_layout_rte_ipv6_tuple__bindgen_ty_1() {
assert_eq!(::std::mem::size_of::<rte_ipv6_tuple__bindgen_ty_1>() , 4usize
, concat ! (
"Size of: " , stringify ! ( rte_ipv6_tuple__bindgen_ty_1 ) ));
assert_eq! (::std::mem::align_of::<rte_ipv6_tuple__bindgen_ty_1>() ,
4usize , concat ! (
"Alignment of " , stringify ! ( rte_ipv6_tuple__bindgen_ty_1 )
));
- assert_eq! (unsafe {
- & ( * ( 0 as * const rte_ipv6_tuple__bindgen_ty_1 ) ) .
- sctp_tag as * const _ as usize } , 0usize , concat ! (
- "Alignment of field: " , stringify ! (
- rte_ipv6_tuple__bindgen_ty_1 ) , "::" , stringify ! ( sctp_tag
- ) ));
}
impl Clone for rte_ipv6_tuple__bindgen_ty_1 {
fn clone(&self) -> Self { *self }
}
#[test]
fn bindgen_test_layout_rte_ipv6_tuple() {
assert_eq!(::std::mem::size_of::<rte_ipv6_tuple>() , 36usize , concat ! (
"Size of: " , stringify ! ( rte_ipv6_tuple ) ));
assert_eq! (::std::mem::align_of::<rte_ipv6_tuple>() , 4usize , concat ! (
"Alignment of " , stringify ! ( rte_ipv6_tuple ) ));
- assert_eq! (unsafe {
- & ( * ( 0 as * const rte_ipv6_tuple ) ) . src_addr as * const
- _ as usize } , 0usize , concat ! (
- "Alignment of field: " , stringify ! ( rte_ipv6_tuple ) , "::"
- , stringify ! ( src_addr ) ));
- assert_eq! (unsafe {
- & ( * ( 0 as * const rte_ipv6_tuple ) ) . dst_addr as * const
- _ as usize } , 16usize , concat ! (
- "Alignment of field: " , stringify ! ( rte_ipv6_tuple ) , "::"
- , stringify ! ( dst_addr ) ));
}
impl Clone for rte_ipv6_tuple {
fn clone(&self) -> Self { *self }
}
#[repr(C)]
#[derive(Copy)]
pub struct rte_thash_tuple {
pub v4: __BindgenUnionField<rte_ipv4_tuple>,
pub v6: __BindgenUnionField<rte_ipv6_tuple>,
pub bindgen_union_field: [u8; 48usize],
}
#[test]
fn bindgen_test_layout_rte_thash_tuple() {
assert_eq!(::std::mem::size_of::<rte_thash_tuple>() , 48usize , concat ! (
"Size of: " , stringify ! ( rte_thash_tuple ) ));
- assert_eq! (unsafe {
- & ( * ( 0 as * const rte_thash_tuple ) ) . v4 as * const _ as
- usize } , 0usize , concat ! (
- "Alignment of field: " , stringify ! ( rte_thash_tuple ) ,
- "::" , stringify ! ( v4 ) ));
- assert_eq! (unsafe {
- & ( * ( 0 as * const rte_thash_tuple ) ) . v6 as * const _ as
- usize } , 0usize , concat ! (
- "Alignment of field: " , stringify ! ( rte_thash_tuple ) ,
- "::" , stringify ! ( v6 ) ));
}
impl Clone for rte_thash_tuple {
fn clone(&self) -> Self { *self }
}
impl Default for rte_thash_tuple {
fn default() -> Self { unsafe { ::std::mem::zeroed() } }
}
thread 'header_16_byte_alignment_h' panicked at 'Header and binding differ!', /bindgen/target/debug/build/bindgen-f6fdd37f3e51109e/out/tests.rs:36
---- header_forward_declared_struct_h stdout ----
diff expected generated
--- expected: "/bindgen/tests/expectations/tests/forward_declared_struct.rs"
+++ generated from: "/bindgen/tests/headers/forward_declared_struct.h"
/* automatically generated by rust-bindgen */
#![allow(non_snake_case)]
#[repr(C)]
#[derive(Debug, Default, Copy)]
pub struct a {
pub b: ::std::os::raw::c_int,
}
#[test]
fn bindgen_test_layout_a() {
assert_eq!(::std::mem::size_of::<a>() , 4usize , concat ! (
"Size of: " , stringify ! ( a ) ));
assert_eq! (::std::mem::align_of::<a>() , 4usize , concat ! (
"Alignment of " , stringify ! ( a ) ));
- assert_eq! (unsafe { & ( * ( 0 as * const a ) ) . b as * const _ as usize
- } , 0usize , concat ! (
- "Alignment of field: " , stringify ! ( a ) , "::" , stringify
- ! ( b ) ));
}
impl Clone for a {
fn clone(&self) -> Self { *self }
}
#[repr(C)]
#[derive(Debug, Default, Copy)]
pub struct c {
pub d: ::std::os::raw::c_int,
}
#[test]
fn bindgen_test_layout_c() {
assert_eq!(::std::mem::size_of::<c>() , 4usize , concat ! (
"Size of: " , stringify ! ( c ) ));
assert_eq! (::std::mem::align_of::<c>() , 4usize , concat ! (
"Alignment of " , stringify ! ( c ) ));
- assert_eq! (unsafe { & ( * ( 0 as * const c ) ) . d as * const _ as usize
- } , 0usize , concat ! (
- "Alignment of field: " , stringify ! ( c ) , "::" , stringify
- ! ( d ) ));
}
impl Clone for c {
fn clone(&self) -> Self { *self }
}
thread 'header_forward_declared_struct_h' panicked at 'Header and binding differ!', /bindgen/target/debug/build/bindgen-f6fdd37f3e51109e/out/tests.rs:58
---- header_func_ptr_in_struct_h stdout ----
diff expected generated
--- expected: "/bindgen/tests/expectations/tests/func_ptr_in_struct.rs"
+++ generated from: "/bindgen/tests/headers/func_ptr_in_struct.h"
/* automatically generated by rust-bindgen */
#![allow(non_snake_case)]
#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)]
pub enum baz { }
#[repr(C)]
#[derive(Debug, Copy)]
pub struct Foo {
pub bar: ::std::option::Option<unsafe extern "C" fn(x:
::std::os::raw::c_int,
y:
::std::os::raw::c_int)
-> baz>,
}
#[test]
fn bindgen_test_layout_Foo() {
assert_eq!(::std::mem::size_of::<Foo>() , 8usize , concat ! (
"Size of: " , stringify ! ( Foo ) ));
assert_eq! (::std::mem::align_of::<Foo>() , 8usize , concat ! (
"Alignment of " , stringify ! ( Foo ) ));
- assert_eq! (unsafe {
- & ( * ( 0 as * const Foo ) ) . bar as * const _ as usize } ,
- 0usize , concat ! (
- "Alignment of field: " , stringify ! ( Foo ) , "::" ,
- stringify ! ( bar ) ));
}
impl Clone for Foo {
fn clone(&self) -> Self { *self }
}
impl Default for Foo {
fn default() -> Self { unsafe { ::std::mem::zeroed() } }
}
thread 'header_func_ptr_in_struct_h' panicked at 'Header and binding differ!', /bindgen/target/debug/build/bindgen-f6fdd37f3e51109e/out/tests.rs:66
---- header_layout_align_h stdout ----
diff expected generated
--- expected: "/bindgen/tests/expectations/tests/layout_align.rs"
+++ generated from: "/bindgen/tests/headers/layout_align.h"
/* automatically generated by rust-bindgen */
#![allow(non_snake_case)]
#[repr(C)]
#[derive(Default)]
pub struct __IncompleteArrayField<T>(::std::marker::PhantomData<T>);
impl <T> __IncompleteArrayField<T> {
#[inline]
pub fn new() -> Self {
__IncompleteArrayField(::std::marker::PhantomData)
}
#[inline]
pub unsafe fn as_ptr(&self) -> *const T { ::std::mem::transmute(self) }
#[inline]
pub unsafe fn as_mut_ptr(&mut self) -> *mut T {
::std::mem::transmute(self)
}
#[inline]
pub unsafe fn as_slice(&self, len: usize) -> &[T] {
::std::slice::from_raw_parts(self.as_ptr(), len)
}
#[inline]
pub unsafe fn as_mut_slice(&mut self, len: usize) -> &mut [T] {
::std::slice::from_raw_parts_mut(self.as_mut_ptr(), len)
}
}
impl <T> ::std::fmt::Debug for __IncompleteArrayField<T> {
fn fmt(&self, fmt: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
fmt.write_str("__IncompleteArrayField")
}
}
impl <T> ::std::clone::Clone for __IncompleteArrayField<T> {
#[inline]
fn clone(&self) -> Self { Self::new() }
}
impl <T> ::std::marker::Copy for __IncompleteArrayField<T> { }
#[repr(C)]
#[derive(Debug, Copy)]
pub struct rte_kni_fifo {
/**< Next position to be written*/
pub write: ::std::os::raw::c_uint,
/**< Next position to be read */
pub read: ::std::os::raw::c_uint,
/**< Circular buffer length */
pub len: ::std::os::raw::c_uint,
/**< Pointer size - for 32/64 bit OS */
pub elem_size: ::std::os::raw::c_uint,
/**< The buffer contains mbuf pointers */
pub buffer: __IncompleteArrayField<*mut ::std::os::raw::c_void>,
pub __bindgen_align: [u64; 0usize],
}
#[test]
fn bindgen_test_layout_rte_kni_fifo() {
assert_eq!(::std::mem::size_of::<rte_kni_fifo>() , 16usize , concat ! (
"Size of: " , stringify ! ( rte_kni_fifo ) ));
assert_eq! (::std::mem::align_of::<rte_kni_fifo>() , 8usize , concat ! (
"Alignment of " , stringify ! ( rte_kni_fifo ) ));
}
impl Clone for rte_kni_fifo {
fn clone(&self) -> Self { *self }
}
impl Default for rte_kni_fifo {
fn default() -> Self { unsafe { ::std::mem::zeroed() } }
}
#[repr(C)]
#[derive(Debug, Default, Copy)]
pub struct rte_eth_link {
/**< ETH_SPEED_NUM_ */
pub link_speed: u32,
pub _bitfield_1: u8,
pub __bindgen_align: [u64; 0usize],
}
#[test]
fn bindgen_test_layout_rte_eth_link() {
assert_eq!(::std::mem::size_of::<rte_eth_link>() , 8usize , concat ! (
"Size of: " , stringify ! ( rte_eth_link ) ));
assert_eq! (::std::mem::align_of::<rte_eth_link>() , 8usize , concat ! (
"Alignment of " , stringify ! ( rte_eth_link ) ));
- assert_eq! (unsafe {
- & ( * ( 0 as * const rte_eth_link ) ) . link_speed as * const
- _ as usize } , 0usize , concat ! (
- "Alignment of field: " , stringify ! ( rte_eth_link ) , "::" ,
- stringify ! ( link_speed ) ));
}
impl Clone for rte_eth_link {
fn clone(&self) -> Self { *self }
}
impl rte_eth_link {
#[inline]
pub fn link_duplex(&self) -> u16 {
unsafe {
::std::mem::transmute(((self._bitfield_1 & (1usize as u8)) >>
0u32) as u16)
}
}
#[inline]
pub fn set_link_duplex(&mut self, val: u16) {
self._bitfield_1 &= !(1usize as u8);
self._bitfield_1 |= ((val as u16 as u8) << 0u32) & (1usize as u8);
}
#[inline]
pub fn link_autoneg(&self) -> u16 {
unsafe {
::std::mem::transmute(((self._bitfield_1 & (2usize as u8)) >>
1u32) as u16)
}
}
#[inline]
pub fn set_link_autoneg(&mut self, val: u16) {
self._bitfield_1 &= !(2usize as u8);
self._bitfield_1 |= ((val as u16 as u8) << 1u32) & (2usize as u8);
}
#[inline]
pub fn link_status(&self) -> u16 {
unsafe {
::std::mem::transmute(((self._bitfield_1 & (4usize as u8)) >>
2u32) as u16)
}
}
#[inline]
pub fn set_link_status(&mut self, val: u16) {
self._bitfield_1 &= !(4usize as u8);
self._bitfield_1 |= ((val as u16 as u8) << 2u32) & (4usize as u8);
}
}
thread 'header_layout_align_h' panicked at 'Header and binding differ!', /bindgen/target/debug/build/bindgen-f6fdd37f3e51109e/out/tests.rs:1
---- header_layout_arp_h stdout ----
diff expected generated
--- expected: "/bindgen/tests/expectations/tests/layout_arp.rs"
+++ generated from: "/bindgen/tests/headers/layout_arp.h"
/* automatically generated by rust-bindgen */
#![allow(non_snake_case)]
pub const ETHER_ADDR_LEN: ::std::os::raw::c_uint = 6;
pub const ARP_HRD_ETHER: ::std::os::raw::c_uint = 1;
pub const ARP_OP_REQUEST: ::std::os::raw::c_uint = 1;
pub const ARP_OP_REPLY: ::std::os::raw::c_uint = 2;
pub const ARP_OP_REVREQUEST: ::std::os::raw::c_uint = 3;
pub const ARP_OP_REVREPLY: ::std::os::raw::c_uint = 4;
pub const ARP_OP_INVREQUEST: ::std::os::raw::c_uint = 8;
pub const ARP_OP_INVREPLY: ::std::os::raw::c_uint = 9;
/**
* Ethernet address:
* A universally administered address is uniquely assigned to a device by its
* manufacturer. The first three octets (in transmission order) contain the
* Organizationally Unique Identifier (OUI). The following three (MAC-48 and
* EUI-48) octets are assigned by that organization with the only constraint
* of uniqueness.
* A locally administered address is assigned to a device by a network
* administrator and does not contain OUIs.
* See http://standards.ieee.org/regauth/groupmac/tutorial.html
*/
#[repr(C, packed)]
#[derive(Debug, Default, Copy)]
pub struct ether_addr {
/**< Addr bytes in tx order */
pub addr_bytes: [u8; 6usize],
}
#[test]
fn bindgen_test_layout_ether_addr() {
assert_eq!(::std::mem::size_of::<ether_addr>() , 6usize , concat ! (
"Size of: " , stringify ! ( ether_addr ) ));
assert_eq! (::std::mem::align_of::<ether_addr>() , 1usize , concat ! (
"Alignment of " , stringify ! ( ether_addr ) ));
- assert_eq! (unsafe {
- & ( * ( 0 as * const ether_addr ) ) . addr_bytes as * const _
- as usize } , 0usize , concat ! (
- "Alignment of field: " , stringify ! ( ether_addr ) , "::" ,
- stringify ! ( addr_bytes ) ));
}
impl Clone for ether_addr {
fn clone(&self) -> Self { *self }
}
/**
* ARP header IPv4 payload.
*/
#[repr(C, packed)]
#[derive(Debug, Default, Copy)]
pub struct arp_ipv4 {
/**< sender hardware address */
pub arp_sha: ether_addr,
/**< sender IP address */
pub arp_sip: u32,
/**< target hardware address */
pub arp_tha: ether_addr,
/**< target IP address */
pub arp_tip: u32,
}
#[test]
fn bindgen_test_layout_arp_ipv4() {
assert_eq!(::std::mem::size_of::<arp_ipv4>() , 20usize , concat ! (
"Size of: " , stringify ! ( arp_ipv4 ) ));
assert_eq! (::std::mem::align_of::<arp_ipv4>() , 1usize , concat ! (
"Alignment of " , stringify ! ( arp_ipv4 ) ));
- assert_eq! (unsafe {
- & ( * ( 0 as * const arp_ipv4 ) ) . arp_sha as * const _ as
- usize } , 0usize , concat ! (
- "Alignment of field: " , stringify ! ( arp_ipv4 ) , "::" ,
- stringify ! ( arp_sha ) ));
- assert_eq! (unsafe {
- & ( * ( 0 as * const arp_ipv4 ) ) . arp_sip as * const _ as
- usize } , 6usize , concat ! (
- "Alignment of field: " , stringify ! ( arp_ipv4 ) , "::" ,
- stringify ! ( arp_sip ) ));
- assert_eq! (unsafe {
- & ( * ( 0 as * const arp_ipv4 ) ) . arp_tha as * const _ as
- usize } , 10usize , concat ! (
- "Alignment of field: " , stringify ! ( arp_ipv4 ) , "::" ,
- stringify ! ( arp_tha ) ));
- assert_eq! (unsafe {
- & ( * ( 0 as * const arp_ipv4 ) ) . arp_tip as * const _ as
- usize } , 16usize , concat ! (
- "Alignment of field: " , stringify ! ( arp_ipv4 ) , "::" ,
- stringify ! ( arp_tip ) ));
}
impl Clone for arp_ipv4 {
fn clone(&self) -> Self { *self }
}
/**
* ARP header.
*/
#[repr(C, packed)]
#[derive(Debug, Default, Copy)]
pub struct arp_hdr {
pub arp_hrd: u16,
pub arp_pro: u16,
pub arp_hln: u8,
pub arp_pln: u8,
pub arp_op: u16,
pub arp_data: arp_ipv4,
}
#[test]
fn bindgen_test_layout_arp_hdr() {
assert_eq!(::std::mem::size_of::<arp_hdr>() , 28usize , concat ! (
"Size of: " , stringify ! ( arp_hdr ) ));
assert_eq! (::std::mem::align_of::<arp_hdr>() , 1usize , concat ! (
"Alignment of " , stringify ! ( arp_hdr ) ));
- assert_eq! (unsafe {
- & ( * ( 0 as * const arp_hdr ) ) . arp_hrd as * const _ as
- usize } , 0usize , concat ! (
- "Alignment of field: " , stringify ! ( arp_hdr ) , "::" ,
- stringify ! ( arp_hrd ) ));
- assert_eq! (unsafe {
- & ( * ( 0 as * const arp_hdr ) ) . arp_pro as * const _ as
- usize } , 2usize , concat ! (
- "Alignment of field: " , stringify ! ( arp_hdr ) , "::" ,
- stringify ! ( arp_pro ) ));
- assert_eq! (unsafe {
- & ( * ( 0 as * const arp_hdr ) ) . arp_hln as * const _ as
- usize } , 4usize , concat ! (
- "Alignment of field: " , stringify ! ( arp_hdr ) , "::" ,
- stringify ! ( arp_hln ) ));
- assert_eq! (unsafe {
- & ( * ( 0 as * const arp_hdr ) ) . arp_pln as * const _ as
- usize } , 5usize , concat ! (
- "Alignment of field: " , stringify ! ( arp_hdr ) , "::" ,
- stringify ! ( arp_pln ) ));
- assert_eq! (unsafe {
- & ( * ( 0 as * const arp_hdr ) ) . arp_op as * const _ as
- usize } , 6usize , concat ! (
- "Alignment of field: " , stringify ! ( arp_hdr ) , "::" ,
- stringify ! ( arp_op ) ));
- assert_eq! (unsafe {
- & ( * ( 0 as * const arp_hdr ) ) . arp_data as * const _ as
- usize } , 8usize , concat ! (
- "Alignment of field: " , stringify ! ( arp_hdr ) , "::" ,
- stringify ! ( arp_data ) ));
}
impl Clone for arp_hdr {
fn clone(&self) -> Self { *self }
}
thread 'header_layout_arp_h' panicked at 'Header and binding differ!', /bindgen/target/debug/build/bindgen-f6fdd37f3e51109e/out/tests.rs:9
---- header_layout_kni_mbuf_h stdout ----
diff expected generated
--- expected: "/bindgen/tests/expectations/tests/layout_kni_mbuf.rs"
+++ generated from: "/bindgen/tests/headers/layout_kni_mbuf.h"
/* automatically generated by rust-bindgen */
#![allow(non_snake_case)]
pub const RTE_CACHE_LINE_MIN_SIZE: ::std::os::raw::c_uint = 64;
pub const RTE_CACHE_LINE_SIZE: ::std::os::raw::c_uint = 64;
#[repr(C)]
#[derive(Debug, Copy)]
pub struct rte_kni_mbuf {
pub buf_addr: *mut ::std::os::raw::c_void,
pub buf_physaddr: u64,
pub pad0: [::std::os::raw::c_char; 2usize],
/**< Start address of data in segment buffer. */
pub data_off: u16,
pub pad1: [::std::os::raw::c_char; 2usize],
/**< Number of segments. */
pub nb_segs: u8,
pub pad4: [::std::os::raw::c_char; 1usize],
/**< Offload features. */
pub ol_flags: u64,
pub pad2: [::std::os::raw::c_char; 4usize],
/**< Total pkt len: sum of all segment data_len. */
pub pkt_len: u32,
/**< Amount of data in segment buffer. */
pub data_len: u16,
- pub __bindgen_padding_0: [u8; 22usize],
pub pad3: [::std::os::raw::c_char; 8usize],
pub pool: *mut ::std::os::raw::c_void,
pub next: *mut ::std::os::raw::c_void,
- pub __bindgen_padding_1: [u64; 5usize],
+ pub __bindgen_padding_0: [u64; 7usize],
}
#[test]
fn bindgen_test_layout_rte_kni_mbuf() {
assert_eq!(::std::mem::size_of::<rte_kni_mbuf>() , 128usize , concat ! (
"Size of: " , stringify ! ( rte_kni_mbuf ) ));
- assert_eq! (unsafe {
- & ( * ( 0 as * const rte_kni_mbuf ) ) . buf_addr as * const _
- as usize } , 0usize , concat ! (
- "Alignment of field: " , stringify ! ( rte_kni_mbuf ) , "::" ,
- stringify ! ( buf_addr ) ));
- assert_eq! (unsafe {
- & ( * ( 0 as * const rte_kni_mbuf ) ) . buf_physaddr as *
- const _ as usize } , 8usize , concat ! (
- "Alignment of field: " , stringify ! ( rte_kni_mbuf ) , "::" ,
- stringify ! ( buf_physaddr ) ));
- assert_eq! (unsafe {
- & ( * ( 0 as * const rte_kni_mbuf ) ) . pad0 as * const _ as
- usize } , 16usize , concat ! (
- "Alignment of field: " , stringify ! ( rte_kni_mbuf ) , "::" ,
- stringify ! ( pad0 ) ));
- assert_eq! (unsafe {
- & ( * ( 0 as * const rte_kni_mbuf ) ) . data_off as * const _
- as usize } , 18usize , concat ! (
- "Alignment of field: " , stringify ! ( rte_kni_mbuf ) , "::" ,
- stringify ! ( data_off ) ));
- assert_eq! (unsafe {
- & ( * ( 0 as * const rte_kni_mbuf ) ) . pad1 as * const _ as
- usize } , 20usize , concat ! (
- "Alignment of field: " , stringify ! ( rte_kni_mbuf ) , "::" ,
- stringify ! ( pad1 ) ));
- assert_eq! (unsafe {
- & ( * ( 0 as * const rte_kni_mbuf ) ) . nb_segs as * const _
- as usize } , 22usize , concat ! (
- "Alignment of field: " , stringify ! ( rte_kni_mbuf ) , "::" ,
- stringify ! ( nb_segs ) ));
- assert_eq! (unsafe {
- & ( * ( 0 as * const rte_kni_mbuf ) ) . pad4 as * const _ as
- usize } , 23usize , concat ! (
- "Alignment of field: " , stringify ! ( rte_kni_mbuf ) , "::" ,
- stringify ! ( pad4 ) ));
- assert_eq! (unsafe {
- & ( * ( 0 as * const rte_kni_mbuf ) ) . ol_flags as * const _
- as usize } , 24usize , concat ! (
- "Alignment of field: " , stringify ! ( rte_kni_mbuf ) , "::" ,
- stringify ! ( ol_flags ) ));
- assert_eq! (unsafe {
- & ( * ( 0 as * const rte_kni_mbuf ) ) . pad2 as * const _ as
- usize } , 32usize , concat ! (
- "Alignment of field: " , stringify ! ( rte_kni_mbuf ) , "::" ,
- stringify ! ( pad2 ) ));
- assert_eq! (unsafe {
- & ( * ( 0 as * const rte_kni_mbuf ) ) . pkt_len as * const _
- as usize } , 36usize , concat ! (
- "Alignment of field: " , stringify ! ( rte_kni_mbuf ) , "::" ,
- stringify ! ( pkt_len ) ));
- assert_eq! (unsafe {
- & ( * ( 0 as * const rte_kni_mbuf ) ) . data_len as * const _
- as usize } , 40usize , concat ! (
- "Alignment of field: " , stringify ! ( rte_kni_mbuf ) , "::" ,
- stringify ! ( data_len ) ));
- assert_eq! (unsafe {
- & ( * ( 0 as * const rte_kni_mbuf ) ) . pad3 as * const _ as
- usize } , 64usize , concat ! (
- "Alignment of field: " , stringify ! ( rte_kni_mbuf ) , "::" ,
- stringify ! ( pad3 ) ));
- assert_eq! (unsafe {
- & ( * ( 0 as * const rte_kni_mbuf ) ) . pool as * const _ as
- usize } , 72usize , concat ! (
- "Alignment of field: " , stringify ! ( rte_kni_mbuf ) , "::" ,
- stringify ! ( pool ) ));
- assert_eq! (unsafe {
- & ( * ( 0 as * const rte_kni_mbuf ) ) . next as * const _ as
- usize } , 80usize , concat ! (
- "Alignment of field: " , stringify ! ( rte_kni_mbuf ) , "::" ,
- stringify ! ( next ) ));
}
impl Clone for rte_kni_mbuf {
fn clone(&self) -> Self { *self }
}
impl Default for rte_kni_mbuf {
fn default() -> Self { unsafe { ::std::mem::zeroed() } }
}
thread 'header_layout_kni_mbuf_h' panicked at 'Header and binding differ!', /bindgen/target/debug/build/bindgen-f6fdd37f3e51109e/out/tests.rs:68
---- header_layout_cmdline_token_h stdout ----
diff expected generated
--- expected: "/bindgen/tests/expectations/tests/layout_cmdline_token.rs"
+++ generated from: "/bindgen/tests/headers/layout_cmdline_token.h"
/* automatically generated by rust-bindgen */
#![allow(non_snake_case)]
/**
* Stores a pointer to the ops struct, and the offset: the place to
* write the parsed result in the destination structure.
*/
#[repr(C)]
#[derive(Debug, Copy)]
pub struct cmdline_token_hdr {
pub ops: *mut cmdline_token_hdr_cmdline_token_ops,
pub offset: ::std::os::raw::c_uint,
}
/**
* A token is defined by this structure.
*
* parse() takes the token as first argument, then the source buffer
* starting at the token we want to parse. The 3rd arg is a pointer
* where we store the parsed data (as binary). It returns the number of
* parsed chars on success and a negative value on error.
*
* complete_get_nb() returns the number of possible values for this
* token if completion is possible. If it is NULL or if it returns 0,
* no completion is possible.
*
* complete_get_elt() copy in dstbuf (the size is specified in the
* parameter) the i-th possible completion for this token. returns 0
* on success or and a negative value on error.
*
* get_help() fills the dstbuf with the help for the token. It returns
* -1 on error and 0 on success.
*/
#[repr(C)]
#[derive(Debug, Copy)]
pub struct cmdline_token_hdr_cmdline_token_ops {
/** parse(token ptr, buf, res pts, buf len) */
pub parse: ::std::option::Option<unsafe extern "C" fn(arg1:
*mut cmdline_parse_token_hdr_t,
arg2:
*const ::std::os::raw::c_char,
arg3:
*mut ::std::os::raw::c_void,
arg4:
::std::os::raw::c_uint)
-> ::std::os::raw::c_int>,
/** return the num of possible choices for this token */
pub complete_get_nb: ::std::option::Option<unsafe extern "C" fn(arg1:
*mut cmdline_parse_token_hdr_t)
-> ::std::os::raw::c_int>,
/** return the elt x for this token (token, idx, dstbuf, size) */
pub complete_get_elt: ::std::option::Option<unsafe extern "C" fn(arg1:
*mut cmdline_parse_token_hdr_t,
arg2:
::std::os::raw::c_int,
arg3:
*mut ::std::os::raw::c_char,
arg4:
::std::os::raw::c_uint)
-> ::std::os::raw::c_int>,
/** get help for this token (token, dstbuf, size) */
pub get_help: ::std::option::Option<unsafe extern "C" fn(arg1:
*mut cmdline_parse_token_hdr_t,
arg2:
*mut ::std::os::raw::c_char,
arg3:
::std::os::raw::c_uint)
-> ::std::os::raw::c_int>,
}
#[test]
fn bindgen_test_layout_cmdline_token_hdr_cmdline_token_ops() {
assert_eq!(::std::mem::size_of::<cmdline_token_hdr_cmdline_token_ops>() ,
32usize , concat ! (
"Size of: " , stringify ! ( cmdline_token_hdr_cmdline_token_ops
) ));
assert_eq! (::std::mem::align_of::<cmdline_token_hdr_cmdline_token_ops>()
, 8usize , concat ! (
"Alignment of " , stringify ! (
cmdline_token_hdr_cmdline_token_ops ) ));
- assert_eq! (unsafe {
- & ( * ( 0 as * const cmdline_token_hdr_cmdline_token_ops ) ) .
- parse as * const _ as usize } , 0usize , concat ! (
- "Alignment of field: " , stringify ! (
- cmdline_token_hdr_cmdline_token_ops ) , "::" , stringify ! (
- parse ) ));
- assert_eq! (unsafe {
- & ( * ( 0 as * const cmdline_token_hdr_cmdline_token_ops ) ) .
- complete_get_nb as * const _ as usize } , 8usize , concat ! (
- "Alignment of field: " , stringify ! (
- cmdline_token_hdr_cmdline_token_ops ) , "::" , stringify ! (
- complete_get_nb ) ));
- assert_eq! (unsafe {
- & ( * ( 0 as * const cmdline_token_hdr_cmdline_token_ops ) ) .
- complete_get_elt as * const _ as usize } , 16usize , concat !
- (
- "Alignment of field: " , stringify ! (
- cmdline_token_hdr_cmdline_token_ops ) , "::" , stringify ! (
- complete_get_elt ) ));
- assert_eq! (unsafe {
- & ( * ( 0 as * const cmdline_token_hdr_cmdline_token_ops ) ) .
- get_help as * const _ as usize } , 24usize , concat ! (
- "Alignment of field: " , stringify ! (
- cmdline_token_hdr_cmdline_token_ops ) , "::" , stringify ! (
- get_help ) ));
}
impl Clone for cmdline_token_hdr_cmdline_token_ops {
fn clone(&self) -> Self { *self }
}
impl Default for cmdline_token_hdr_cmdline_token_ops {
fn default() -> Self { unsafe { ::std::mem::zeroed() } }
}
#[test]
fn bindgen_test_layout_cmdline_token_hdr() {
assert_eq!(::std::mem::size_of::<cmdline_token_hdr>() , 16usize , concat !
( "Size of: " , stringify ! ( cmdline_token_hdr ) ));
assert_eq! (::std::mem::align_of::<cmdline_token_hdr>() , 8usize , concat
! ( "Alignment of " , stringify ! ( cmdline_token_hdr ) ));
- assert_eq! (unsafe {
- & ( * ( 0 as * const cmdline_token_hdr ) ) . ops as * const _
- as usize } , 0usize , concat ! (
- "Alignment of field: " , stringify ! ( cmdline_token_hdr ) ,
- "::" , stringify ! ( ops ) ));
- assert_eq! (unsafe {
- & ( * ( 0 as * const cmdline_token_hdr ) ) . offset as * const
- _ as usize } , 8usize , concat ! (
- "Alignment of field: " , stringify ! ( cmdline_token_hdr ) ,
- "::" , stringify ! ( offset ) ));
}
impl Clone for cmdline_token_hdr {
fn clone(&self) -> Self { *self }
}
impl Default for cmdline_token_hdr {
fn default() -> Self { unsafe { ::std::mem::zeroed() } }
}
pub type cmdline_parse_token_hdr_t = cmdline_token_hdr;
#[repr(u32)]
#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)]
pub enum cmdline_numtype {
UINT8 = 0,
UINT16 = 1,
UINT32 = 2,
UINT64 = 3,
INT8 = 4,
INT16 = 5,
INT32 = 6,
INT64 = 7,
}
#[repr(C)]
#[derive(Debug, Copy)]
pub struct cmdline_token_num_data {
pub type_: cmdline_numtype,
}
#[test]
fn bindgen_test_layout_cmdline_token_num_data() {
assert_eq!(::std::mem::size_of::<cmdline_token_num_data>() , 4usize ,
concat ! ( "Size of: " , stringify ! ( cmdline_token_num_data )
));
assert_eq! (::std::mem::align_of::<cmdline_token_num_data>() , 4usize ,
concat ! (
"Alignment of " , stringify ! ( cmdline_token_num_data ) ));
- assert_eq! (unsafe {
- & ( * ( 0 as * const cmdline_token_num_data ) ) . type_ as *
- const _ as usize } , 0usize , concat ! (
- "Alignment of field: " , stringify ! ( cmdline_token_num_data
- ) , "::" , stringify ! ( type_ ) ));
}
impl Clone for cmdline_token_num_data {
fn clone(&self) -> Self { *self }
}
impl Default for cmdline_token_num_data {
fn default() -> Self { unsafe { ::std::mem::zeroed() } }
}
#[repr(C)]
#[derive(Debug, Copy)]
pub struct cmdline_token_num {
pub hdr: cmdline_token_hdr,
pub num_data: cmdline_token_num_data,
}
#[test]
fn bindgen_test_layout_cmdline_token_num() {
assert_eq!(::std::mem::size_of::<cmdline_token_num>() , 24usize , concat !
( "Size of: " , stringify ! ( cmdline_token_num ) ));
assert_eq! (::std::mem::align_of::<cmdline_token_num>() , 8usize , concat
! ( "Alignment of " , stringify ! ( cmdline_token_num ) ));
- assert_eq! (unsafe {
- & ( * ( 0 as * const cmdline_token_num ) ) . hdr as * const _
- as usize } , 0usize , concat ! (
- "Alignment of field: " , stringify ! ( cmdline_token_num ) ,
- "::" , stringify ! ( hdr ) ));
- assert_eq! (unsafe {
- & ( * ( 0 as * const cmdline_token_num ) ) . num_data as *
- const _ as usize } , 16usize , concat ! (
- "Alignment of field: " , stringify ! ( cmdline_token_num ) ,
- "::" , stringify ! ( num_data ) ));
}
impl Clone for cmdline_token_num {
fn clone(&self) -> Self { *self }
}
impl Default for cmdline_token_num {
fn default() -> Self { unsafe { ::std::mem::zeroed() } }
}
pub type cmdline_parse_token_num_t = cmdline_token_num;
thread 'header_layout_cmdline_token_h' panicked at 'Header and binding differ!', /bindgen/target/debug/build/bindgen-f6fdd37f3e51109e/out/tests.rs:44
---- header_layout_array_h stdout ----
/bindgen/tests/headers/layout_array.h:32:43: warning: declaration of 'struct rte_mempool' will not be visible outside of this function [-Wvisibility], err: false
/bindgen/tests/headers/layout_array.h:37:43: warning: declaration of 'struct rte_mempool' will not be visible outside of this function [-Wvisibility], err: false
/bindgen/tests/headers/layout_array.h:42:45: warning: declaration of 'struct rte_mempool' will not be visible outside of this function [-Wvisibility], err: false
/bindgen/tests/headers/layout_array.h:48:45: warning: declaration of 'struct rte_mempool' will not be visible outside of this function [-Wvisibility], err: false
/bindgen/tests/headers/layout_array.h:54:56: warning: declaration of 'struct rte_mempool' will not be visible outside of this function [-Wvisibility], err: false
diff expected generated
--- expected: "/bindgen/tests/expectations/tests/layout_array.rs"
+++ generated from: "/bindgen/tests/headers/layout_array.h"
/* automatically generated by rust-bindgen */
#![allow(non_snake_case)]
pub const RTE_CACHE_LINE_SIZE: ::std::os::raw::c_uint = 64;
pub const RTE_MEMPOOL_OPS_NAMESIZE: ::std::os::raw::c_uint = 32;
pub const RTE_MEMPOOL_MAX_OPS_IDX: ::std::os::raw::c_uint = 16;
pub const RTE_HEAP_NUM_FREELISTS: ::std::os::raw::c_uint = 13;
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct rte_mempool([u8; 0]);
/**
* Prototype for implementation specific data provisioning function.
*
* The function should provide the implementation specific memory for
* for use by the other mempool ops functions in a given mempool ops struct.
* E.g. the default ops provides an instance of the rte_ring for this purpose.
* it will most likely point to a different type of data structure, and
* will be transparent to the application programmer.
* This function should set mp->pool_data.
*/
pub type rte_mempool_alloc_t =
::std::option::Option<unsafe extern "C" fn(mp: *mut rte_mempool)
-> ::std::os::raw::c_int>;
/**
* Free the opaque private data pointed to by mp->pool_data pointer.
*/
pub type rte_mempool_free_t =
::std::option::Option<unsafe extern "C" fn(mp: *mut rte_mempool)>;
/**
* Enqueue an object into the external pool.
*/
pub type rte_mempool_enqueue_t =
::std::option::Option<unsafe extern "C" fn(mp: *mut rte_mempool,
obj_table:
*const *const ::std::os::raw::c_void,
n: ::std::os::raw::c_uint)
-> ::std::os::raw::c_int>;
/**
* Dequeue an object from the external pool.
*/
pub type rte_mempool_dequeue_t =
::std::option::Option<unsafe extern "C" fn(mp: *mut rte_mempool,
obj_table:
*mut *mut ::std::os::raw::c_void,
n: ::std::os::raw::c_uint)
-> ::std::os::raw::c_int>;
/**
* Return the number of available objects in the external pool.
*/
pub type rte_mempool_get_count =
::std::option::Option<unsafe extern "C" fn(mp: *const rte_mempool)
-> ::std::os::raw::c_uint>;
/** Structure defining mempool operations structure */
#[repr(C)]
#[derive(Debug, Copy)]
pub struct rte_mempool_ops {
/**< Name of mempool ops struct. */
pub name: [::std::os::raw::c_char; 32usize],
/**< Allocate private data. */
pub alloc: rte_mempool_alloc_t,
/**< Free the external pool. */
pub free: rte_mempool_free_t,
/**< Enqueue an object. */
pub enqueue: rte_mempool_enqueue_t,
/**< Dequeue an object. */
pub dequeue: rte_mempool_dequeue_t,
/**< Get qty of available objs. */
pub get_count: rte_mempool_get_count,
pub __bindgen_padding_0: [u64; 7usize],
}
#[test]
fn bindgen_test_layout_rte_mempool_ops() {
assert_eq!(::std::mem::size_of::<rte_mempool_ops>() , 128usize , concat !
( "Size of: " , stringify ! ( rte_mempool_ops ) ));
- assert_eq! (unsafe {
- & ( * ( 0 as * const rte_mempool_ops ) ) . name as * const _
- as usize } , 0usize , concat ! (
- "Alignment of field: " , stringify ! ( rte_mempool_ops ) ,
- "::" , stringify ! ( name ) ));
- assert_eq! (unsafe {
- & ( * ( 0 as * const rte_mempool_ops ) ) . alloc as * const _
- as usize } , 32usize , concat ! (
- "Alignment of field: " , stringify ! ( rte_mempool_ops ) ,
- "::" , stringify ! ( alloc ) ));
- assert_eq! (unsafe {
- & ( * ( 0 as * const rte_mempool_ops ) ) . free as * const _
- as usize } , 40usize , concat ! (
- "Alignment of field: " , stringify ! ( rte_mempool_ops ) ,
- "::" , stringify ! ( free ) ));
- assert_eq! (unsafe {
- & ( * ( 0 as * const rte_mempool_ops ) ) . enqueue as * const
- _ as usize } , 48usize , concat ! (
- "Alignment of field: " , stringify ! ( rte_mempool_ops ) ,
- "::" , stringify ! ( enqueue ) ));
- assert_eq! (unsafe {
- & ( * ( 0 as * const rte_mempool_ops ) ) . dequeue as * const
- _ as usize } , 56usize , concat ! (
- "Alignment of field: " , stringify ! ( rte_mempool_ops ) ,
- "::" , stringify ! ( dequeue ) ));
- assert_eq! (unsafe {
- & ( * ( 0 as * const rte_mempool_ops ) ) . get_count as *
- const _ as usize } , 64usize , concat ! (
- "Alignment of field: " , stringify ! ( rte_mempool_ops ) ,
- "::" , stringify ! ( get_count ) ));
}
impl Clone for rte_mempool_ops {
fn clone(&self) -> Self { *self }
}
impl Default for rte_mempool_ops {
fn default() -> Self { unsafe { ::std::mem::zeroed() } }
}
/**
* The rte_spinlock_t type.
*/
#[repr(C)]
#[derive(Debug, Default, Copy)]
pub struct _bindgen_ty_1 {
/**< lock status 0 = unlocked, 1 = locked */
pub locked: ::std::os::raw::c_int,
}
#[test]
fn bindgen_test_layout__bindgen_ty_1() {
assert_eq!(::std::mem::size_of::<_bindgen_ty_1>() , 4usize , concat ! (
"Size of: " , stringify ! ( _bindgen_ty_1 ) ));
assert_eq! (::std::mem::align_of::<_bindgen_ty_1>() , 4usize , concat ! (
"Alignment of " , stringify ! ( _bindgen_ty_1 ) ));
- assert_eq! (unsafe {
- & ( * ( 0 as * const _bindgen_ty_1 ) ) . locked as * const _
- as usize } , 0usize , concat ! (
- "Alignment of field: " , stringify ! ( _bindgen_ty_1 ) , "::"
- , stringify ! ( locked ) ));
}
impl Clone for _bindgen_ty_1 {
fn clone(&self) -> Self { *self }
}
pub type rte_spinlock_t = _bindgen_ty_1;
/**
* Structure storing the table of registered ops structs, each of which contain
* the function pointers for the mempool ops functions.
* Each process has its own storage for this ops struct array so that
* the mempools can be shared across primary and secondary processes.
* The indices used to access the array are valid across processes, whereas
* any function pointers stored directly in the mempool struct would not be.
* This results in us simply having "ops_index" in the mempool struct.
*/
#[repr(C)]
#[derive(Debug, Copy)]
pub struct rte_mempool_ops_table {
/**< Spinlock for add/delete. */
pub sl: rte_spinlock_t,
/**< Number of used ops structs in the table. */
pub num_ops: u32,
pub __bindgen_padding_0: [u64; 7usize],
/**
* Storage for all possible ops structs.
*/
pub ops: [rte_mempool_ops; 16usize],
}
#[test]
fn bindgen_test_layout_rte_mempool_ops_table() {
assert_eq!(::std::mem::size_of::<rte_mempool_ops_table>() , 2112usize ,
concat ! ( "Size of: " , stringify ! ( rte_mempool_ops_table )
));
- assert_eq! (unsafe {
- & ( * ( 0 as * const rte_mempool_ops_table ) ) . sl as * const
- _ as usize } , 0usize , concat ! (
- "Alignment of field: " , stringify ! ( rte_mempool_ops_table )
- , "::" , stringify ! ( sl ) ));
- assert_eq! (unsafe {
- & ( * ( 0 as * const rte_mempool_ops_table ) ) . num_ops as *
- const _ as usize } , 4usize , concat ! (
- "Alignment of field: " , stringify ! ( rte_mempool_ops_table )
- , "::" , stringify ! ( num_ops ) ));
- assert_eq! (unsafe {
- & ( * ( 0 as * const rte_mempool_ops_table ) ) . ops as *
- const _ as usize } , 64usize , concat ! (
- "Alignment of field: " , stringify ! ( rte_mempool_ops_table )
- , "::" , stringify ! ( ops ) ));
}
impl Clone for rte_mempool_ops_table {
fn clone(&self) -> Self { *self }
}
impl Default for rte_mempool_ops_table {
fn default() -> Self { unsafe { ::std::mem::zeroed() } }
}
/**
* Structure to hold malloc heap
*/
#[repr(C)]
#[derive(Debug, Copy)]
pub struct malloc_heap {
pub lock: rte_spinlock_t,
pub free_head: [malloc_heap__bindgen_ty_1; 13usize],
pub alloc_count: ::std::os::raw::c_uint,
pub total_size: usize,
}
#[repr(C)]
#[derive(Debug, Copy)]
pub struct malloc_heap__bindgen_ty_1 {
pub lh_first: *mut malloc_heap__bindgen_ty_1_malloc_elem,
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct malloc_heap__bindgen_ty_1_malloc_elem([u8; 0]);
#[test]
fn bindgen_test_layout_malloc_heap__bindgen_ty_1() {
assert_eq!(::std::mem::size_of::<malloc_heap__bindgen_ty_1>() , 8usize ,
concat ! (
"Size of: " , stringify ! ( malloc_heap__bindgen_ty_1 ) ));
assert_eq! (::std::mem::align_of::<malloc_heap__bindgen_ty_1>() , 8usize ,
concat ! (
"Alignment of " , stringify ! ( malloc_heap__bindgen_ty_1 )
));
- assert_eq! (unsafe {
- & ( * ( 0 as * const malloc_heap__bindgen_ty_1 ) ) . lh_first
- as * const _ as usize } , 0usize , concat ! (
- "Alignment of field: " , stringify ! (
- malloc_heap__bindgen_ty_1 ) , "::" , stringify ! ( lh_first )
- ));
}
impl Clone for malloc_heap__bindgen_ty_1 {
fn clone(&self) -> Self { *self }
}
impl Default for malloc_heap__bindgen_ty_1 {
fn default() -> Self { unsafe { ::std::mem::zeroed() } }
}
#[test]
fn bindgen_test_layout_malloc_heap() {
assert_eq!(::std::mem::size_of::<malloc_heap>() , 128usize , concat ! (
"Size of: " , stringify ! ( malloc_heap ) ));
- assert_eq! (unsafe {
- & ( * ( 0 as * const malloc_heap ) ) . lock as * const _ as
- usize } , 0usize , concat ! (
- "Alignment of field: " , stringify ! ( malloc_heap ) , "::" ,
- stringify ! ( lock ) ));
- assert_eq! (unsafe {
- & ( * ( 0 as * const malloc_heap ) ) . free_head as * const _
- as usize } , 8usize , concat ! (
- "Alignment of field: " , stringify ! ( malloc_heap ) , "::" ,
- stringify ! ( free_head ) ));
- assert_eq! (unsafe {
- & ( * ( 0 as * const malloc_heap ) ) . alloc_count as * const
- _ as usize } , 112usize , concat ! (
- "Alignment of field: " , stringify ! ( malloc_heap ) , "::" ,
- stringify ! ( alloc_count ) ));
- assert_eq! (unsafe {
- & ( * ( 0 as * const malloc_heap ) ) . total_size as * const _
- as usize } , 120usize , concat ! (
- "Alignment of field: " , stringify ! ( malloc_heap ) , "::" ,
- stringify ! ( total_size ) ));
}
impl Clone for malloc_heap {
fn clone(&self) -> Self { *self }
}
impl Default for malloc_heap {
fn default() -> Self { unsafe { ::std::mem::zeroed() } }
}
thread 'header_layout_array_h' panicked at 'Header and binding differ!', /bindgen/target/debug/build/bindgen-f6fdd37f3e51109e/out/tests.rs:7
---- header_no_comments_h stdout ----
diff expected generated
--- expected: "/bindgen/tests/expectations/tests/no-comments.rs"
+++ generated from: "/bindgen/tests/headers/no-comments.h"
/* automatically generated by rust-bindgen */
#![allow(non_snake_case)]
#[repr(C)]
#[derive(Debug, Default, Copy)]
pub struct Foo {
pub s: ::std::os::raw::c_int,
}
#[test]
fn bindgen_test_layout_Foo() {
assert_eq!(::std::mem::size_of::<Foo>() , 4usize , concat ! (
"Size of: " , stringify ! ( Foo ) ));
assert_eq! (::std::mem::align_of::<Foo>() , 4usize , concat ! (
"Alignment of " , stringify ! ( Foo ) ));
- assert_eq! (unsafe {
- & ( * ( 0 as * const Foo ) ) . s as * const _ as usize } ,
- 0usize , concat ! (
- "Alignment of field: " , stringify ! ( Foo ) , "::" ,
- stringify ! ( s ) ));
}
impl Clone for Foo {
fn clone(&self) -> Self { *self }
}
thread 'header_no_comments_h' panicked at 'Header and binding differ!', /bindgen/target/debug/build/bindgen-f6fdd37f3e51109e/out/tests.rs:32
---- header_no_derive_debug_h stdout ----
diff expected generated
--- expected: "/bindgen/tests/expectations/tests/no-derive-debug.rs"
+++ generated from: "/bindgen/tests/headers/no-derive-debug.h"
/* automatically generated by rust-bindgen */
#![allow(non_snake_case)]
#[repr(C)] #[derive(Copy, Clone, Default)] pub struct foo { bar: ::std::os::raw::c_int, }
/**
* bar should compile. It will normally derive debug, but our blacklist of foo
* and replacement for another type that doesn't implement it would prevent it
* from building if --no-derive-debug didn't work.
*/
#[repr(C)]
#[derive(Default, Copy)]
pub struct bar {
pub foo: foo,
pub baz: ::std::os::raw::c_int,
}
#[test]
fn bindgen_test_layout_bar() {
assert_eq!(::std::mem::size_of::<bar>() , 8usize , concat ! (
"Size of: " , stringify ! ( bar ) ));
assert_eq! (::std::mem::align_of::<bar>() , 4usize , concat ! (
"Alignment of " , stringify ! ( bar ) ));
- assert_eq! (unsafe {
- & ( * ( 0 as * const bar ) ) . foo as * const _ as usize } ,
- 0usize , concat ! (
- "Alignment of field: " , stringify ! ( bar ) , "::" ,
- stringify ! ( foo ) ));
- assert_eq! (unsafe {
- & ( * ( 0 as * const bar ) ) . baz as * const _ as usize } ,
- 4usize , concat ! (
- "Alignment of field: " , stringify ! ( bar ) , "::" ,
- stringify ! ( baz ) ));
}
impl Clone for bar {
fn clone(&self) -> Self { *self }
}
thread 'header_no_derive_debug_h' panicked at 'Header and binding differ!', /bindgen/target/debug/build/bindgen-f6fdd37f3e51109e/out/tests.rs:27
---- header_no_derive_default_h stdout ----
diff expected generated
--- expected: "/bindgen/tests/expectations/tests/no-derive-default.rs"
+++ generated from: "/bindgen/tests/headers/no-derive-default.h"
/* automatically generated by rust-bindgen */
#![allow(non_snake_case)]
#[repr(C)] #[derive(Copy, Clone, Debug)] pub struct foo { bar: ::std::os::raw::c_int, }
/**
* bar should compile. It will normally derive default, but our blacklist of foo
* and replacement for another type that doesn't implement it would prevent it
* from building if --no-derive-default didn't work.
*/
#[repr(C)]
#[derive(Debug, Copy)]
pub struct bar {
pub foo: foo,
pub baz: ::std::os::raw::c_int,
}
#[test]
fn bindgen_test_layout_bar() {
assert_eq!(::std::mem::size_of::<bar>() , 8usize , concat ! (
"Size of: " , stringify ! ( bar ) ));
assert_eq! (::std::mem::align_of::<bar>() , 4usize , concat ! (
"Alignment of " , stringify ! ( bar ) ));
- assert_eq! (unsafe {
- & ( * ( 0 as * const bar ) ) . foo as * const _ as usize } ,
- 0usize , concat ! (
- "Alignment of field: " , stringify ! ( bar ) , "::" ,
- stringify ! ( foo ) ));
- assert_eq! (unsafe {
- & ( * ( 0 as * const bar ) ) . baz as * const _ as usize } ,
- 4usize , concat ! (
- "Alignment of field: " , stringify ! ( bar ) , "::" ,
- stringify ! ( baz ) ));
}
impl Clone for bar {
fn clone(&self) -> Self { *self }
}
thread 'header_no_derive_default_h' panicked at 'Header and binding differ!', /bindgen/target/debug/build/bindgen-f6fdd37f3e51109e/out/tests.rs:34
---- header_no_recursive_whitelisting_h stdout ----
diff expected generated
--- expected: "/bindgen/tests/expectations/tests/no-recursive-whitelisting.rs"
+++ generated from: "/bindgen/tests/headers/no-recursive-whitelisting.h"
/* automatically generated by rust-bindgen */
#![allow(non_snake_case)]
pub enum Bar {}
#[repr(C)]
#[derive(Debug, Copy)]
pub struct Foo {
pub baz: *mut Bar,
}
#[test]
fn bindgen_test_layout_Foo() {
assert_eq!(::std::mem::size_of::<Foo>() , 8usize , concat ! (
"Size of: " , stringify ! ( Foo ) ));
assert_eq! (::std::mem::align_of::<Foo>() , 8usize , concat ! (
"Alignment of " , stringify ! ( Foo ) ));
- assert_eq! (unsafe {
- & ( * ( 0 as * const Foo ) ) . baz as * const _ as usize } ,
- 0usize , concat ! (
- "Alignment of field: " , stringify ! ( Foo ) , "::" ,
- stringify ! ( baz ) ));
}
impl Clone for Foo {
fn clone(&self) -> Self { *self }
}
impl Default for Foo {
fn default() -> Self { unsafe { ::std::mem::zeroed() } }
}
thread 'header_no_recursive_whitelisting_h' panicked at 'Header and binding differ!', /bindgen/target/debug/build/bindgen-f6fdd37f3e51109e/out/tests.rs:49
---- header_no_std_h stdout ----
diff expected generated
--- expected: "/bindgen/tests/expectations/tests/no-std.rs"
+++ generated from: "/bindgen/tests/headers/no-std.h"
/* automatically generated by rust-bindgen */
#![allow(non_snake_case)]
#![no_std]
mod libc { pub type c_int = i32; pub enum c_void {} }
#[repr(C)]
#[derive(Debug, Copy)]
pub struct foo {
pub a: libc::c_int,
pub b: libc::c_int,
pub bar: *mut libc::c_void,
}
#[test]
fn bindgen_test_layout_foo() {
assert_eq!(::core::mem::size_of::<foo>() , 16usize , concat ! (
"Size of: " , stringify ! ( foo ) ));
assert_eq! (::core::mem::align_of::<foo>() , 8usize , concat ! (
"Alignment of " , stringify ! ( foo ) ));
- assert_eq! (unsafe {
- & ( * ( 0 as * const foo ) ) . a as * const _ as usize } ,
- 0usize , concat ! (
- "Alignment of field: " , stringify ! ( foo ) , "::" ,
- stringify ! ( a ) ));
- assert_eq! (unsafe {
- & ( * ( 0 as * const foo ) ) . b as * const _ as usize } ,
- 4usize , concat ! (
- "Alignment of field: " , stringify ! ( foo ) , "::" ,
- stringify ! ( b ) ));
- assert_eq! (unsafe {
- & ( * ( 0 as * const foo ) ) . bar as * const _ as usize } ,
- 8usize , concat ! (
- "Alignment of field: " , stringify ! ( foo ) , "::" ,
- stringify ! ( bar ) ));
}
impl Clone for foo {
fn clone(&self) -> Self { *self }
}
impl Default for foo {
fn default() -> Self { unsafe { ::core::mem::zeroed() } }
}
thread 'header_no_std_h' panicked at 'Header and binding differ!', /bindgen/target/debug/build/bindgen-f6fdd37f3e51109e/out/tests.rs:60
---- header_objc_interface_type_h stdout ----
diff expected generated
--- expected: "/bindgen/tests/expectations/tests/objc_interface_type.rs"
+++ generated from: "/bindgen/tests/headers/objc_interface_type.h"
/* automatically generated by rust-bindgen */
#![allow(non_snake_case)]
#![cfg(target_os="macos")]
#[macro_use]
extern crate objc;
#[allow(non_camel_case_types)]
pub type id = *mut objc::runtime::Object;
pub trait Foo { }
impl Foo for id { }
#[repr(C)]
#[derive(Debug, Copy)]
pub struct FooStruct {
pub foo: *mut id,
}
#[test]
fn bindgen_test_layout_FooStruct() {
assert_eq!(::std::mem::size_of::<FooStruct>() , 8usize , concat ! (
"Size of: " , stringify ! ( FooStruct ) ));
assert_eq! (::std::mem::align_of::<FooStruct>() , 8usize , concat ! (
"Alignment of " , stringify ! ( FooStruct ) ));
- assert_eq! (unsafe {
- & ( * ( 0 as * const FooStruct ) ) . foo as * const _ as usize
- } , 0usize , concat ! (
- "Alignment of field: " , stringify ! ( FooStruct ) , "::" ,
- stringify ! ( foo ) ));
}
impl Clone for FooStruct {
fn clone(&self) -> Self { *self }
}
impl Default for FooStruct {
fn default() -> Self { unsafe { ::std::mem::zeroed() } }
}
extern "C" {
pub fn fooFunc(foo: id);
}
extern "C" {
#[link_name = "kFoo"]
pub static mut kFoo: *const id;
}
thread 'header_objc_interface_type_h' panicked at 'Header and binding differ!', /bindgen/target/debug/build/bindgen-f6fdd37f3e51109e/out/tests.rs:47
---- header_struct_containing_forward_declared_struct_h stdout ----
diff expected generated
--- expected: "/bindgen/tests/expectations/tests/struct_containing_forward_declared_struct.rs"
+++ generated from: "/bindgen/tests/headers/struct_containing_forward_declared_struct.h"
/* automatically generated by rust-bindgen */
#![allow(non_snake_case)]
#[repr(C)]
#[derive(Debug, Copy)]
pub struct a {
pub val_a: *mut a_b,
}
#[repr(C)]
#[derive(Debug, Default, Copy)]
pub struct a_b {
pub val_b: ::std::os::raw::c_int,
}
#[test]
fn bindgen_test_layout_a_b() {
assert_eq!(::std::mem::size_of::<a_b>() , 4usize , concat ! (
"Size of: " , stringify ! ( a_b ) ));
assert_eq! (::std::mem::align_of::<a_b>() , 4usize , concat ! (
"Alignment of " , stringify ! ( a_b ) ));
- assert_eq! (unsafe {
- & ( * ( 0 as * const a_b ) ) . val_b as * const _ as usize } ,
- 0usize , concat ! (
- "Alignment of field: " , stringify ! ( a_b ) , "::" ,
- stringify ! ( val_b ) ));
}
impl Clone for a_b {
fn clone(&self) -> Self { *self }
}
#[test]
fn bindgen_test_layout_a() {
assert_eq!(::std::mem::size_of::<a>() , 8usize , concat ! (
"Size of: " , stringify ! ( a ) ));
assert_eq! (::std::mem::align_of::<a>() , 8usize , concat ! (
"Alignment of " , stringify ! ( a ) ));
- assert_eq! (unsafe {
- & ( * ( 0 as * const a ) ) . val_a as * const _ as usize } ,
- 0usize , concat ! (
- "Alignment of field: " , stringify ! ( a ) , "::" , stringify
- ! ( val_a ) ));
}
impl Clone for a {
fn clone(&self) -> Self { *self }
}
impl Default for a {
fn default() -> Self { unsafe { ::std::mem::zeroed() } }
}
thread 'header_struct_containing_forward_declared_struct_h' panicked at 'Header and binding differ!', /bindgen/target/debug/build/bindgen-f6fdd37f3e51109e/out/tests.rs:13
---- header_struct_with_anon_struct_h stdout ----
diff expected generated
--- expected: "/bindgen/tests/expectations/tests/struct_with_anon_struct.rs"
+++ generated from: "/bindgen/tests/headers/struct_with_anon_struct.h"
/* automatically generated by rust-bindgen */
#![allow(non_snake_case)]
#[repr(C)]
#[derive(Debug, Default, Copy)]
pub struct foo {
pub bar: foo__bindgen_ty_1,
}
#[repr(C)]
#[derive(Debug, Default, Copy)]
pub struct foo__bindgen_ty_1 {
pub a: ::std::os::raw::c_int,
pub b: ::std::os::raw::c_int,
}
#[test]
fn bindgen_test_layout_foo__bindgen_ty_1() {
assert_eq!(::std::mem::size_of::<foo__bindgen_ty_1>() , 8usize , concat !
( "Size of: " , stringify ! ( foo__bindgen_ty_1 ) ));
assert_eq! (::std::mem::align_of::<foo__bindgen_ty_1>() , 4usize , concat
! ( "Alignment of " , stringify ! ( foo__bindgen_ty_1 ) ));
- assert_eq! (unsafe {
- & ( * ( 0 as * const foo__bindgen_ty_1 ) ) . a as * const _ as
- usize } , 0usize , concat ! (
- "Alignment of field: " , stringify ! ( foo__bindgen_ty_1 ) ,
- "::" , stringify ! ( a ) ));
- assert_eq! (unsafe {
- & ( * ( 0 as * const foo__bindgen_ty_1 ) ) . b as * const _ as
- usize } , 4usize , concat ! (
- "Alignment of field: " , stringify ! ( foo__bindgen_ty_1 ) ,
- "::" , stringify ! ( b ) ));
}
impl Clone for foo__bindgen_ty_1 {
fn clone(&self) -> Self { *self }
}
#[test]
fn bindgen_test_layout_foo() {
assert_eq!(::std::mem::size_of::<foo>() , 8usize , concat ! (
"Size of: " , stringify ! ( foo ) ));
assert_eq! (::std::mem::align_of::<foo>() , 4usize , concat ! (
"Alignment of " , stringify ! ( foo ) ));
- assert_eq! (unsafe {
- & ( * ( 0 as * const foo ) ) . bar as * const _ as usize } ,
- 0usize , concat ! (
- "Alignment of field: " , stringify ! ( foo ) , "::" ,
- stringify ! ( bar ) ));
}
impl Clone for foo {
fn clone(&self) -> Self { *self }
}
thread 'header_struct_with_anon_struct_h' panicked at 'Header and binding differ!', /bindgen/target/debug/build/bindgen-f6fdd37f3e51109e/out/tests.rs:61
---- header_struct_with_anon_struct_array_h stdout ----
diff expected generated
--- expected: "/bindgen/tests/expectations/tests/struct_with_anon_struct_array.rs"
+++ generated from: "/bindgen/tests/headers/struct_with_anon_struct_array.h"
/* automatically generated by rust-bindgen */
#![allow(non_snake_case)]
#[repr(C)]
#[derive(Debug, Default, Copy)]
pub struct foo {
pub bar: [foo__bindgen_ty_1; 2usize],
pub baz: [[[foo__bindgen_ty_2; 4usize]; 3usize]; 2usize],
}
#[repr(C)]
#[derive(Debug, Default, Copy)]
pub struct foo__bindgen_ty_1 {
pub a: ::std::os::raw::c_int,
pub b: ::std::os::raw::c_int,
}
#[test]
fn bindgen_test_layout_foo__bindgen_ty_1() {
assert_eq!(::std::mem::size_of::<foo__bindgen_ty_1>() , 8usize , concat !
( "Size of: " , stringify ! ( foo__bindgen_ty_1 ) ));
assert_eq! (::std::mem::align_of::<foo__bindgen_ty_1>() , 4usize , concat
! ( "Alignment of " , stringify ! ( foo__bindgen_ty_1 ) ));
- assert_eq! (unsafe {
- & ( * ( 0 as * const foo__bindgen_ty_1 ) ) . a as * const _ as
- usize } , 0usize , concat ! (
- "Alignment of field: " , stringify ! ( foo__bindgen_ty_1 ) ,
- "::" , stringify ! ( a ) ));
- assert_eq! (unsafe {
- & ( * ( 0 as * const foo__bindgen_ty_1 ) ) . b as * const _ as
- usize } , 4usize , concat ! (
- "Alignment of field: " , stringify ! ( foo__bindgen_ty_1 ) ,
- "::" , stringify ! ( b ) ));
}
impl Clone for foo__bindgen_ty_1 {
fn clone(&self) -> Self { *self }
}
#[repr(C)]
#[derive(Debug, Default, Copy)]
pub struct foo__bindgen_ty_2 {
pub a: ::std::os::raw::c_int,
pub b: ::std::os::raw::c_int,
}
#[test]
fn bindgen_test_layout_foo__bindgen_ty_2() {
assert_eq!(::std::mem::size_of::<foo__bindgen_ty_2>() , 8usize , concat !
( "Size of: " , stringify ! ( foo__bindgen_ty_2 ) ));
assert_eq! (::std::mem::align_of::<foo__bindgen_ty_2>() , 4usize , concat
! ( "Alignment of " , stringify ! ( foo__bindgen_ty_2 ) ));
- assert_eq! (unsafe {
- & ( * ( 0 as * const foo__bindgen_ty_2 ) ) . a as * const _ as
- usize } , 0usize , concat ! (
- "Alignment of field: " , stringify ! ( foo__bindgen_ty_2 ) ,
- "::" , stringify ! ( a ) ));
- assert_eq! (unsafe {
- & ( * ( 0 as * const foo__bindgen_ty_2 ) ) . b as * const _ as
- usize } , 4usize , concat ! (
- "Alignment of field: " , stringify ! ( foo__bindgen_ty_2 ) ,
- "::" , stringify ! ( b ) ));
}
impl Clone for foo__bindgen_ty_2 {
fn clone(&self) -> Self { *self }
}
#[test]
fn bindgen_test_layout_foo() {
assert_eq!(::std::mem::size_of::<foo>() , 208usize , concat ! (
"Size of: " , stringify ! ( foo ) ));
assert_eq! (::std::mem::align_of::<foo>() , 4usize , concat ! (
"Alignment of " , stringify ! ( foo ) ));
- assert_eq! (unsafe {
- & ( * ( 0 as * const foo ) ) . bar as * const _ as usize } ,
- 0usize , concat ! (
- "Alignment of field: " , stringify ! ( foo ) , "::" ,
- stringify ! ( bar ) ));
- assert_eq! (unsafe {
- & ( * ( 0 as * const foo ) ) . baz as * const _ as usize } ,
- 16usize , concat ! (
- "Alignment of field: " , stringify ! ( foo ) , "::" ,
- stringify ! ( baz ) ));
}
impl Clone for foo {
fn clone(&self) -> Self { *self }
}
thread 'header_struct_with_anon_struct_array_h' panicked at 'Header and binding differ!', /bindgen/target/debug/build/bindgen-f6fdd37f3e51109e/out/tests.rs:51
---- header_struct_with_anon_struct_pointer_h stdout ----
diff expected generated
--- expected: "/bindgen/tests/expectations/tests/struct_with_anon_struct_pointer.rs"
+++ generated from: "/bindgen/tests/headers/struct_with_anon_struct_pointer.h"
/* automatically generated by rust-bindgen */
#![allow(non_snake_case)]
#[repr(C)]
#[derive(Debug, Copy)]
pub struct foo {
pub bar: *mut foo__bindgen_ty_1,
}
#[repr(C)]
#[derive(Debug, Default, Copy)]
pub struct foo__bindgen_ty_1 {
pub a: ::std::os::raw::c_int,
pub b: ::std::os::raw::c_int,
}
#[test]
fn bindgen_test_layout_foo__bindgen_ty_1() {
assert_eq!(::std::mem::size_of::<foo__bindgen_ty_1>() , 8usize , concat !
( "Size of: " , stringify ! ( foo__bindgen_ty_1 ) ));
assert_eq! (::std::mem::align_of::<foo__bindgen_ty_1>() , 4usize , concat
! ( "Alignment of " , stringify ! ( foo__bindgen_ty_1 ) ));
- assert_eq! (unsafe {
- & ( * ( 0 as * const foo__bindgen_ty_1 ) ) . a as * const _ as
- usize } , 0usize , concat ! (
- "Alignment of field: " , stringify ! ( foo__bindgen_ty_1 ) ,
- "::" , stringify ! ( a ) ));
- assert_eq! (unsafe {
- & ( * ( 0 as * const foo__bindgen_ty_1 ) ) . b as * const _ as
- usize } , 4usize , concat ! (
- "Alignment of field: " , stringify ! ( foo__bindgen_ty_1 ) ,
- "::" , stringify ! ( b ) ));
}
impl Clone for foo__bindgen_ty_1 {
fn clone(&self) -> Self { *self }
}
#[test]
fn bindgen_test_layout_foo() {
assert_eq!(::std::mem::size_of::<foo>() , 8usize , concat ! (
"Size of: " , stringify ! ( foo ) ));
assert_eq! (::std::mem::align_of::<foo>() , 8usize , concat ! (
"Alignment of " , stringify ! ( foo ) ));
- assert_eq! (unsafe {
- & ( * ( 0 as * const foo ) ) . bar as * const _ as usize } ,
- 0usize , concat ! (
- "Alignment of field: " , stringify ! ( foo ) , "::" ,
- stringify ! ( bar ) ));
}
impl Clone for foo {
fn clone(&self) -> Self { *self }
}
impl Default for foo {
fn default() -> Self { unsafe { ::std::mem::zeroed() } }
}
thread 'header_struct_with_anon_struct_pointer_h' panicked at 'Header and binding differ!', /bindgen/target/debug/build/bindgen-f6fdd37f3e51109e/out/tests.rs:16
---- header_struct_with_anon_union_h stdout ----
diff expected generated
--- expected: "/bindgen/tests/expectations/tests/struct_with_anon_union.rs"
+++ generated from: "/bindgen/tests/headers/struct_with_anon_union.h"
/* automatically generated by rust-bindgen */
#![allow(non_snake_case)]
#[repr(C)]
pub struct __BindgenUnionField<T>(::std::marker::PhantomData<T>);
impl <T> __BindgenUnionField<T> {
#[inline]
pub fn new() -> Self { __BindgenUnionField(::std::marker::PhantomData) }
#[inline]
pub unsafe fn as_ref(&self) -> &T { ::std::mem::transmute(self) }
#[inline]
pub unsafe fn as_mut(&mut self) -> &mut T { ::std::mem::transmute(self) }
}
impl <T> ::std::default::Default for __BindgenUnionField<T> {
#[inline]
fn default() -> Self { Self::new() }
}
impl <T> ::std::clone::Clone for __BindgenUnionField<T> {
#[inline]
fn clone(&self) -> Self { Self::new() }
}
impl <T> ::std::marker::Copy for __BindgenUnionField<T> { }
impl <T> ::std::fmt::Debug for __BindgenUnionField<T> {
fn fmt(&self, fmt: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
fmt.write_str("__BindgenUnionField")
}
}
#[repr(C)]
#[derive(Debug, Default, Copy)]
pub struct foo {
pub bar: foo__bindgen_ty_1,
}
#[repr(C)]
#[derive(Debug, Default, Copy)]
pub struct foo__bindgen_ty_1 {
pub a: __BindgenUnionField<::std::os::raw::c_uint>,
pub b: __BindgenUnionField<::std::os::raw::c_ushort>,
pub bindgen_union_field: u32,
}
#[test]
fn bindgen_test_layout_foo__bindgen_ty_1() {
assert_eq!(::std::mem::size_of::<foo__bindgen_ty_1>() , 4usize , concat !
( "Size of: " , stringify ! ( foo__bindgen_ty_1 ) ));
assert_eq! (::std::mem::align_of::<foo__bindgen_ty_1>() , 4usize , concat
! ( "Alignment of " , stringify ! ( foo__bindgen_ty_1 ) ));
- assert_eq! (unsafe {
- & ( * ( 0 as * const foo__bindgen_ty_1 ) ) . a as * const _ as
- usize } , 0usize , concat ! (
- "Alignment of field: " , stringify ! ( foo__bindgen_ty_1 ) ,
- "::" , stringify ! ( a ) ));
- assert_eq! (unsafe {
- & ( * ( 0 as * const foo__bindgen_ty_1 ) ) . b as * const _ as
- usize } , 0usize , concat ! (
- "Alignment of field: " , stringify ! ( foo__bindgen_ty_1 ) ,
- "::" , stringify ! ( b ) ));
}
impl Clone for foo__bindgen_ty_1 {
fn clone(&self) -> Self { *self }
}
#[test]
fn bindgen_test_layout_foo() {
assert_eq!(::std::mem::size_of::<foo>() , 4usize , concat ! (
"Size of: " , stringify ! ( foo ) ));
assert_eq! (::std::mem::align_of::<foo>() , 4usize , concat ! (
"Alignment of " , stringify ! ( foo ) ));
- assert_eq! (unsafe {
- & ( * ( 0 as * const foo ) ) . bar as * const _ as usize } ,
- 0usize , concat ! (
- "Alignment of field: " , stringify ! ( foo ) , "::" ,
- stringify ! ( bar ) ));
}
impl Clone for foo {
fn clone(&self) -> Self { *self }
}
thread 'header_struct_with_anon_union_h' panicked at 'Header and binding differ!', /bindgen/target/debug/build/bindgen-f6fdd37f3e51109e/out/tests.rs:54
---- header_struct_with_anon_unnamed_struct_h stdout ----
diff expected generated
--- expected: "/bindgen/tests/expectations/tests/struct_with_anon_unnamed_struct.rs"
+++ generated from: "/bindgen/tests/headers/struct_with_anon_unnamed_struct.h"
/* automatically generated by rust-bindgen */
#![allow(non_snake_case)]
#[repr(C)]
#[derive(Debug, Default, Copy)]
pub struct foo {
pub __bindgen_anon_1: foo__bindgen_ty_1,
}
#[repr(C)]
#[derive(Debug, Default, Copy)]
pub struct foo__bindgen_ty_1 {
pub a: ::std::os::raw::c_uint,
pub b: ::std::os::raw::c_uint,
}
#[test]
fn bindgen_test_layout_foo__bindgen_ty_1() {
assert_eq!(::std::mem::size_of::<foo__bindgen_ty_1>() , 8usize , concat !
( "Size of: " , stringify ! ( foo__bindgen_ty_1 ) ));
assert_eq! (::std::mem::align_of::<foo__bindgen_ty_1>() , 4usize , concat
! ( "Alignment of " , stringify ! ( foo__bindgen_ty_1 ) ));
- assert_eq! (unsafe {
- & ( * ( 0 as * const foo__bindgen_ty_1 ) ) . a as * const _ as
- usize } , 0usize , concat ! (
- "Alignment of field: " , stringify ! ( foo__bindgen_ty_1 ) ,
- "::" , stringify ! ( a ) ));
- assert_eq! (unsafe {
- & ( * ( 0 as * const foo__bindgen_ty_1 ) ) . b as * const _ as
- usize } , 4usize , concat ! (
- "Alignment of field: " , stringify ! ( foo__bindgen_ty_1 ) ,
- "::" , stringify ! ( b ) ));
}
impl Clone for foo__bindgen_ty_1 {
fn clone(&self) -> Self { *self }
}
#[test]
fn bindgen_test_layout_foo() {
assert_eq!(::std::mem::size_of::<foo>() , 8usize , concat ! (
"Size of: " , stringify ! ( foo ) ));
assert_eq! (::std::mem::align_of::<foo>() , 4usize , concat ! (
"Alignment of " , stringify ! ( foo ) ));
}
impl Clone for foo {
fn clone(&self) -> Self { *self }
}
thread 'header_struct_with_anon_unnamed_struct_h' panicked at 'Header and binding differ!', /bindgen/target/debug/build/bindgen-f6fdd37f3e51109e/out/tests.rs:35
---- header_struct_with_anon_unnamed_union_h stdout ----
diff expected generated
--- expected: "/bindgen/tests/expectations/tests/struct_with_anon_unnamed_union.rs"
+++ generated from: "/bindgen/tests/headers/struct_with_anon_unnamed_union.h"
/* automatically generated by rust-bindgen */
#![allow(non_snake_case)]
#[repr(C)]
pub struct __BindgenUnionField<T>(::std::marker::PhantomData<T>);
impl <T> __BindgenUnionField<T> {
#[inline]
pub fn new() -> Self { __BindgenUnionField(::std::marker::PhantomData) }
#[inline]
pub unsafe fn as_ref(&self) -> &T { ::std::mem::transmute(self) }
#[inline]
pub unsafe fn as_mut(&mut self) -> &mut T { ::std::mem::transmute(self) }
}
impl <T> ::std::default::Default for __BindgenUnionField<T> {
#[inline]
fn default() -> Self { Self::new() }
}
impl <T> ::std::clone::Clone for __BindgenUnionField<T> {
#[inline]
fn clone(&self) -> Self { Self::new() }
}
impl <T> ::std::marker::Copy for __BindgenUnionField<T> { }
impl <T> ::std::fmt::Debug for __BindgenUnionField<T> {
fn fmt(&self, fmt: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
fmt.write_str("__BindgenUnionField")
}
}
#[repr(C)]
#[derive(Debug, Default, Copy)]
pub struct foo {
pub __bindgen_anon_1: foo__bindgen_ty_1,
}
#[repr(C)]
#[derive(Debug, Default, Copy)]
pub struct foo__bindgen_ty_1 {
pub a: __BindgenUnionField<::std::os::raw::c_uint>,
pub b: __BindgenUnionField<::std::os::raw::c_ushort>,
pub bindgen_union_field: u32,
}
#[test]
fn bindgen_test_layout_foo__bindgen_ty_1() {
assert_eq!(::std::mem::size_of::<foo__bindgen_ty_1>() , 4usize , concat !
( "Size of: " , stringify ! ( foo__bindgen_ty_1 ) ));
assert_eq! (::std::mem::align_of::<foo__bindgen_ty_1>() , 4usize , concat
! ( "Alignment of " , stringify ! ( foo__bindgen_ty_1 ) ));
- assert_eq! (unsafe {
- & ( * ( 0 as * const foo__bindgen_ty_1 ) ) . a as * const _ as
- usize } , 0usize , concat ! (
- "Alignment of field: " , stringify ! ( foo__bindgen_ty_1 ) ,
- "::" , stringify ! ( a ) ));
- assert_eq! (unsafe {
- & ( * ( 0 as * const foo__bindgen_ty_1 ) ) . b as * const _ as
- usize } , 0usize , concat ! (
- "Alignment of field: " , stringify ! ( foo__bindgen_ty_1 ) ,
- "::" , stringify ! ( b ) ));
}
impl Clone for foo__bindgen_ty_1 {
fn clone(&self) -> Self { *self }
}
#[test]
fn bindgen_test_layout_foo() {
assert_eq!(::std::mem::size_of::<foo>() , 4usize , concat ! (
"Size of: " , stringify ! ( foo ) ));
assert_eq! (::std::mem::align_of::<foo>() , 4usize , concat ! (
"Alignment of " , stringify ! ( foo ) ));
}
impl Clone for foo {
fn clone(&self) -> Self { *self }
}
thread 'header_struct_with_anon_unnamed_union_h' panicked at 'Header and binding differ!', /bindgen/target/debug/build/bindgen-f6fdd37f3e51109e/out/tests.rs:20
---- header_struct_with_bitfields_h stdout ----
diff expected generated
--- expected: "/bindgen/tests/expectations/tests/struct_with_bitfields.rs"
+++ generated from: "/bindgen/tests/headers/struct_with_bitfields.h"
/* automatically generated by rust-bindgen */
#![allow(non_snake_case)]
#[repr(C)]
#[derive(Debug, Default, Copy)]
pub struct bitfield {
pub _bitfield_1: u8,
pub e: ::std::os::raw::c_int,
pub _bitfield_2: u8,
pub _bitfield_3: u32,
}
#[test]
fn bindgen_test_layout_bitfield() {
assert_eq!(::std::mem::size_of::<bitfield>() , 16usize , concat ! (
"Size of: " , stringify ! ( bitfield ) ));
assert_eq! (::std::mem::align_of::<bitfield>() , 4usize , concat ! (
"Alignment of " , stringify ! ( bitfield ) ));
- assert_eq! (unsafe {
- & ( * ( 0 as * const bitfield ) ) . e as * const _ as usize }
- , 4usize , concat ! (
- "Alignment of field: " , stringify ! ( bitfield ) , "::" ,
- stringify ! ( e ) ));
}
impl Clone for bitfield {
fn clone(&self) -> Self { *self }
}
impl bitfield {
#[inline]
pub fn a(&self) -> ::std::os::raw::c_ushort {
unsafe {
::std::mem::transmute(((self._bitfield_1 & (1usize as u8)) >>
0u32) as u16)
}
}
#[inline]
pub fn set_a(&mut self, val: ::std::os::raw::c_ushort) {
self._bitfield_1 &= !(1usize as u8);
self._bitfield_1 |= ((val as u16 as u8) << 0u32) & (1usize as u8);
}
#[inline]
pub fn b(&self) -> ::std::os::raw::c_ushort {
unsafe {
::std::mem::transmute(((self._bitfield_1 & (2usize as u8)) >>
1u32) as u16)
}
}
#[inline]
pub fn set_b(&mut self, val: ::std::os::raw::c_ushort) {
self._bitfield_1 &= !(2usize as u8);
self._bitfield_1 |= ((val as u16 as u8) << 1u32) & (2usize as u8);
}
#[inline]
pub fn c(&self) -> ::std::os::raw::c_ushort {
unsafe {
::std::mem::transmute(((self._bitfield_1 & (4usize as u8)) >>
2u32) as u16)
}
}
#[inline]
pub fn set_c(&mut self, val: ::std::os::raw::c_ushort) {
self._bitfield_1 &= !(4usize as u8);
self._bitfield_1 |= ((val as u16 as u8) << 2u32) & (4usize as u8);
}
#[inline]
pub fn at_offset_3(&self) -> ::std::os::raw::c_ushort {
unsafe {
::std::mem::transmute(((self._bitfield_1 & (8usize as u8)) >>
3u32) as u16)
}
}
#[inline]
pub fn set_at_offset_3(&mut self, val: ::std::os::raw::c_ushort) {
self._bitfield_1 &= !(8usize as u8);
self._bitfield_1 |= ((val as u16 as u8) << 3u32) & (8usize as u8);
}
#[inline]
pub fn at_offset_4(&self) -> ::std::os::raw::c_ushort {
unsafe {
::std::mem::transmute(((self._bitfield_1 & (48usize as u8)) >>
4u32) as u16)
}
}
#[inline]
pub fn set_at_offset_4(&mut self, val: ::std::os::raw::c_ushort) {
self._bitfield_1 &= !(48usize as u8);
self._bitfield_1 |= ((val as u16 as u8) << 4u32) & (48usize as u8);
}
#[inline]
pub fn d(&self) -> ::std::os::raw::c_ushort {
unsafe {
::std::mem::transmute(((self._bitfield_1 & (192usize as u8)) >>
6u32) as u16)
}
}
#[inline]
pub fn set_d(&mut self, val: ::std::os::raw::c_ushort) {
self._bitfield_1 &= !(192usize as u8);
self._bitfield_1 |= ((val as u16 as u8) << 6u32) & (192usize as u8);
}
#[inline]
pub fn f(&self) -> ::std::os::raw::c_uint {
unsafe {
::std::mem::transmute(((self._bitfield_2 & (3usize as u8)) >>
0u32) as u32)
}
}
#[inline]
pub fn set_f(&mut self, val: ::std::os::raw::c_uint) {
self._bitfield_2 &= !(3usize as u8);
self._bitfield_2 |= ((val as u32 as u8) << 0u32) & (3usize as u8);
}
#[inline]
pub fn g(&self) -> ::std::os::raw::c_uint {
unsafe {
::std::mem::transmute(((self._bitfield_3 &
(4294967295usize as u32)) >> 0u32) as
u32)
}
}
#[inline]
pub fn set_g(&mut self, val: ::std::os::raw::c_uint) {
self._bitfield_3 &= !(4294967295usize as u32);
self._bitfield_3 |=
((val as u32 as u32) << 0u32) & (4294967295usize as u32);
}
}
thread 'header_struct_with_bitfields_h' panicked at 'Header and binding differ!', /bindgen/target/debug/build/bindgen-f6fdd37f3e51109e/out/tests.rs:40
---- header_struct_with_derive_debug_h stdout ----
diff expected generated
--- expected: "/bindgen/tests/expectations/tests/struct_with_derive_debug.rs"
+++ generated from: "/bindgen/tests/headers/struct_with_derive_debug.h"
/* automatically generated by rust-bindgen */
#![allow(non_snake_case)]
#[repr(C)]
#[derive(Debug, Default, Copy)]
pub struct LittleArray {
pub a: [::std::os::raw::c_int; 32usize],
}
#[test]
fn bindgen_test_layout_LittleArray() {
assert_eq!(::std::mem::size_of::<LittleArray>() , 128usize , concat ! (
"Size of: " , stringify ! ( LittleArray ) ));
assert_eq! (::std::mem::align_of::<LittleArray>() , 4usize , concat ! (
"Alignment of " , stringify ! ( LittleArray ) ));
- assert_eq! (unsafe {
- & ( * ( 0 as * const LittleArray ) ) . a as * const _ as usize
- } , 0usize , concat ! (
- "Alignment of field: " , stringify ! ( LittleArray ) , "::" ,
- stringify ! ( a ) ));
}
impl Clone for LittleArray {
fn clone(&self) -> Self { *self }
}
#[repr(C)]
pub struct BigArray {
pub a: [::std::os::raw::c_int; 33usize],
}
#[test]
fn bindgen_test_layout_BigArray() {
assert_eq!(::std::mem::size_of::<BigArray>() , 132usize , concat ! (
"Size of: " , stringify ! ( BigArray ) ));
assert_eq! (::std::mem::align_of::<BigArray>() , 4usize , concat ! (
"Alignment of " , stringify ! ( BigArray ) ));
- assert_eq! (unsafe {
- & ( * ( 0 as * const BigArray ) ) . a as * const _ as usize }
- , 0usize , concat ! (
- "Alignment of field: " , stringify ! ( BigArray ) , "::" ,
- stringify ! ( a ) ));
}
impl Default for BigArray {
fn default() -> Self { unsafe { ::std::mem::zeroed() } }
}
#[repr(C)]
#[derive(Debug, Default, Copy)]
pub struct WithLittleArray {
pub a: LittleArray,
}
#[test]
fn bindgen_test_layout_WithLittleArray() {
assert_eq!(::std::mem::size_of::<WithLittleArray>() , 128usize , concat !
( "Size of: " , stringify ! ( WithLittleArray ) ));
assert_eq! (::std::mem::align_of::<WithLittleArray>() , 4usize , concat !
( "Alignment of " , stringify ! ( WithLittleArray ) ));
- assert_eq! (unsafe {
- & ( * ( 0 as * const WithLittleArray ) ) . a as * const _ as
- usize } , 0usize , concat ! (
- "Alignment of field: " , stringify ! ( WithLittleArray ) ,
- "::" , stringify ! ( a ) ));
}
impl Clone for WithLittleArray {
fn clone(&self) -> Self { *self }
}
#[repr(C)]
pub struct WithBigArray {
pub a: BigArray,
}
#[test]
fn bindgen_test_layout_WithBigArray() {
assert_eq!(::std::mem::size_of::<WithBigArray>() , 132usize , concat ! (
"Size of: " , stringify ! ( WithBigArray ) ));
assert_eq! (::std::mem::align_of::<WithBigArray>() , 4usize , concat ! (
"Alignment of " , stringify ! ( WithBigArray ) ));
- assert_eq! (unsafe {
- & ( * ( 0 as * const WithBigArray ) ) . a as * const _ as
- usize } , 0usize , concat ! (
- "Alignment of field: " , stringify ! ( WithBigArray ) , "::" ,
- stringify ! ( a ) ));
}
impl Default for WithBigArray {
fn default() -> Self { unsafe { ::std::mem::zeroed() } }
}
thread 'header_struct_with_derive_debug_h' panicked at 'Header and binding differ!', /bindgen/target/debug/build/bindgen-f6fdd37f3e51109e/out/tests.rs:10
---- header_struct_with_packing_h stdout ----
diff expected generated
--- expected: "/bindgen/tests/expectations/tests/struct_with_packing.rs"
+++ generated from: "/bindgen/tests/headers/struct_with_packing.h"
/* automatically generated by rust-bindgen */
#![allow(non_snake_case)]
#[repr(C, packed)]
#[derive(Debug, Default, Copy)]
pub struct a {
pub b: ::std::os::raw::c_char,
pub c: ::std::os::raw::c_short,
}
#[test]
fn bindgen_test_layout_a() {
assert_eq!(::std::mem::size_of::<a>() , 3usize , concat ! (
"Size of: " , stringify ! ( a ) ));
assert_eq! (::std::mem::align_of::<a>() , 1usize , concat ! (
"Alignment of " , stringify ! ( a ) ));
- assert_eq! (unsafe { & ( * ( 0 as * const a ) ) . b as * const _ as usize
- } , 0usize , concat ! (
- "Alignment of field: " , stringify ! ( a ) , "::" , stringify
- ! ( b ) ));
- assert_eq! (unsafe { & ( * ( 0 as * const a ) ) . c as * const _ as usize
- } , 1usize , concat ! (
- "Alignment of field: " , stringify ! ( a ) , "::" , stringify
- ! ( c ) ));
}
impl Clone for a {
fn clone(&self) -> Self { *self }
}
thread 'header_struct_with_packing_h' panicked at 'Header and binding differ!', /bindgen/target/debug/build/bindgen-f6fdd37f3e51109e/out/tests.rs:25
---- header_struct_with_nesting_h stdout ----
diff expected generated
--- expected: "/bindgen/tests/expectations/tests/struct_with_nesting.rs"
+++ generated from: "/bindgen/tests/headers/struct_with_nesting.h"
/* automatically generated by rust-bindgen */
#![allow(non_snake_case)]
#[repr(C)]
pub struct __BindgenUnionField<T>(::std::marker::PhantomData<T>);
impl <T> __BindgenUnionField<T> {
#[inline]
pub fn new() -> Self { __BindgenUnionField(::std::marker::PhantomData) }
#[inline]
pub unsafe fn as_ref(&self) -> &T { ::std::mem::transmute(self) }
#[inline]
pub unsafe fn as_mut(&mut self) -> &mut T { ::std::mem::transmute(self) }
}
impl <T> ::std::default::Default for __BindgenUnionField<T> {
#[inline]
fn default() -> Self { Self::new() }
}
impl <T> ::std::clone::Clone for __BindgenUnionField<T> {
#[inline]
fn clone(&self) -> Self { Self::new() }
}
impl <T> ::std::marker::Copy for __BindgenUnionField<T> { }
impl <T> ::std::fmt::Debug for __BindgenUnionField<T> {
fn fmt(&self, fmt: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
fmt.write_str("__BindgenUnionField")
}
}
#[repr(C)]
#[derive(Debug, Default, Copy)]
pub struct foo {
pub a: ::std::os::raw::c_uint,
pub __bindgen_anon_1: foo__bindgen_ty_1,
}
#[repr(C)]
#[derive(Debug, Default, Copy)]
pub struct foo__bindgen_ty_1 {
pub b: __BindgenUnionField<::std::os::raw::c_uint>,
pub __bindgen_anon_1: __BindgenUnionField<foo__bindgen_ty_1__bindgen_ty_1>,
pub __bindgen_anon_2: __BindgenUnionField<foo__bindgen_ty_1__bindgen_ty_2>,
pub bindgen_union_field: u32,
}
#[repr(C)]
#[derive(Debug, Default, Copy)]
pub struct foo__bindgen_ty_1__bindgen_ty_1 {
pub c1: ::std::os::raw::c_ushort,
pub c2: ::std::os::raw::c_ushort,
}
#[test]
fn bindgen_test_layout_foo__bindgen_ty_1__bindgen_ty_1() {
assert_eq!(::std::mem::size_of::<foo__bindgen_ty_1__bindgen_ty_1>() ,
4usize , concat ! (
"Size of: " , stringify ! ( foo__bindgen_ty_1__bindgen_ty_1 )
));
assert_eq! (::std::mem::align_of::<foo__bindgen_ty_1__bindgen_ty_1>() ,
2usize , concat ! (
"Alignment of " , stringify ! (
foo__bindgen_ty_1__bindgen_ty_1 ) ));
- assert_eq! (unsafe {
- & ( * ( 0 as * const foo__bindgen_ty_1__bindgen_ty_1 ) ) . c1
- as * const _ as usize } , 0usize , concat ! (
- "Alignment of field: " , stringify ! (
- foo__bindgen_ty_1__bindgen_ty_1 ) , "::" , stringify ! ( c1 )
- ));
- assert_eq! (unsafe {
- & ( * ( 0 as * const foo__bindgen_ty_1__bindgen_ty_1 ) ) . c2
- as * const _ as usize } , 2usize , concat ! (
- "Alignment of field: " , stringify ! (
- foo__bindgen_ty_1__bindgen_ty_1 ) , "::" , stringify ! ( c2 )
- ));
}
impl Clone for foo__bindgen_ty_1__bindgen_ty_1 {
fn clone(&self) -> Self { *self }
}
#[repr(C)]
#[derive(Debug, Default, Copy)]
pub struct foo__bindgen_ty_1__bindgen_ty_2 {
pub d1: ::std::os::raw::c_uchar,
pub d2: ::std::os::raw::c_uchar,
pub d3: ::std::os::raw::c_uchar,
pub d4: ::std::os::raw::c_uchar,
}
#[test]
fn bindgen_test_layout_foo__bindgen_ty_1__bindgen_ty_2() {
assert_eq!(::std::mem::size_of::<foo__bindgen_ty_1__bindgen_ty_2>() ,
4usize , concat ! (
"Size of: " , stringify ! ( foo__bindgen_ty_1__bindgen_ty_2 )
));
assert_eq! (::std::mem::align_of::<foo__bindgen_ty_1__bindgen_ty_2>() ,
1usize , concat ! (
"Alignment of " , stringify ! (
foo__bindgen_ty_1__bindgen_ty_2 ) ));
- assert_eq! (unsafe {
- & ( * ( 0 as * const foo__bindgen_ty_1__bindgen_ty_2 ) ) . d1
- as * const _ as usize } , 0usize , concat ! (
- "Alignment of field: " , stringify ! (
- foo__bindgen_ty_1__bindgen_ty_2 ) , "::" , stringify ! ( d1 )
- ));
- assert_eq! (unsafe {
- & ( * ( 0 as * const foo__bindgen_ty_1__bindgen_ty_2 ) ) . d2
- as * const _ as usize } , 1usize , concat ! (
- "Alignment of field: " , stringify ! (
- foo__bindgen_ty_1__bindgen_ty_2 ) , "::" , stringify ! ( d2 )
- ));
- assert_eq! (unsafe {
- & ( * ( 0 as * const foo__bindgen_ty_1__bindgen_ty_2 ) ) . d3
- as * const _ as usize } , 2usize , concat ! (
- "Alignment of field: " , stringify ! (
- foo__bindgen_ty_1__bindgen_ty_2 ) , "::" , stringify ! ( d3 )
- ));
- assert_eq! (unsafe {
- & ( * ( 0 as * const foo__bindgen_ty_1__bindgen_ty_2 ) ) . d4
- as * const _ as usize } , 3usize , concat ! (
- "Alignment of field: " , stringify ! (
- foo__bindgen_ty_1__bindgen_ty_2 ) , "::" , stringify ! ( d4 )
- ));
}
impl Clone for foo__bindgen_ty_1__bindgen_ty_2 {
fn clone(&self) -> Self { *self }
}
#[test]
fn bindgen_test_layout_foo__bindgen_ty_1() {
assert_eq!(::std::mem::size_of::<foo__bindgen_ty_1>() , 4usize , concat !
( "Size of: " , stringify ! ( foo__bindgen_ty_1 ) ));
assert_eq! (::std::mem::align_of::<foo__bindgen_ty_1>() , 4usize , concat
! ( "Alignment of " , stringify ! ( foo__bindgen_ty_1 ) ));
- assert_eq! (unsafe {
- & ( * ( 0 as * const foo__bindgen_ty_1 ) ) . b as * const _ as
- usize } , 0usize , concat ! (
- "Alignment of field: " , stringify ! ( foo__bindgen_ty_1 ) ,
- "::" , stringify ! ( b ) ));
}
impl Clone for foo__bindgen_ty_1 {
fn clone(&self) -> Self { *self }
}
#[test]
fn bindgen_test_layout_foo() {
assert_eq!(::std::mem::size_of::<foo>() , 8usize , concat ! (
"Size of: " , stringify ! ( foo ) ));
assert_eq! (::std::mem::align_of::<foo>() , 4usize , concat ! (
"Alignment of " , stringify ! ( foo ) ));
- assert_eq! (unsafe {
- & ( * ( 0 as * const foo ) ) . a as * const _ as usize } ,
- 0usize , concat ! (
- "Alignment of field: " , stringify ! ( foo ) , "::" ,
- stringify ! ( a ) ));
}
impl Clone for foo {
fn clone(&self) -> Self { *self }
}
thread 'header_struct_with_nesting_h' panicked at 'Header and binding differ!', /bindgen/target/debug/build/bindgen-f6fdd37f3e51109e/out/tests.rs:37
---- header_struct_with_struct_h stdout ----
diff expected generated
--- expected: "/bindgen/tests/expectations/tests/struct_with_struct.rs"
+++ generated from: "/bindgen/tests/headers/struct_with_struct.h"
/* automatically generated by rust-bindgen */
#![allow(non_snake_case)]
#[repr(C)]
#[derive(Debug, Default, Copy)]
pub struct foo {
pub bar: foo__bindgen_ty_1,
}
#[repr(C)]
#[derive(Debug, Default, Copy)]
pub struct foo__bindgen_ty_1 {
pub x: ::std::os::raw::c_uint,
pub y: ::std::os::raw::c_uint,
}
#[test]
fn bindgen_test_layout_foo__bindgen_ty_1() {
assert_eq!(::std::mem::size_of::<foo__bindgen_ty_1>() , 8usize , concat !
( "Size of: " , stringify ! ( foo__bindgen_ty_1 ) ));
assert_eq! (::std::mem::align_of::<foo__bindgen_ty_1>() , 4usize , concat
! ( "Alignment of " , stringify ! ( foo__bindgen_ty_1 ) ));
- assert_eq! (unsafe {
- & ( * ( 0 as * const foo__bindgen_ty_1 ) ) . x as * const _ as
- usize } , 0usize , concat ! (
- "Alignment of field: " , stringify ! ( foo__bindgen_ty_1 ) ,
- "::" , stringify ! ( x ) ));
- assert_eq! (unsafe {
- & ( * ( 0 as * const foo__bindgen_ty_1 ) ) . y as * const _ as
- usize } , 4usize , concat ! (
- "Alignment of field: " , stringify ! ( foo__bindgen_ty_1 ) ,
- "::" , stringify ! ( y ) ));
}
impl Clone for foo__bindgen_ty_1 {
fn clone(&self) -> Self { *self }
}
#[test]
fn bindgen_test_layout_foo() {
assert_eq!(::std::mem::size_of::<foo>() , 8usize , concat ! (
"Size of: " , stringify ! ( foo ) ));
assert_eq! (::std::mem::align_of::<foo>() , 4usize , concat ! (
"Alignment of " , stringify ! ( foo ) ));
- assert_eq! (unsafe {
- & ( * ( 0 as * const foo ) ) . bar as * const _ as usize } ,
- 0usize , concat ! (
- "Alignment of field: " , stringify ! ( foo ) , "::" ,
- stringify ! ( bar ) ));
}
impl Clone for foo {
fn clone(&self) -> Self { *self }
}
thread 'header_struct_with_struct_h' panicked at 'Header and binding differ!', /bindgen/target/debug/build/bindgen-f6fdd37f3e51109e/out/tests.rs:17
---- header_type_referenced_by_whitelisted_function_h stdout ----
diff expected generated
--- expected: "/bindgen/tests/expectations/tests/type-referenced-by-whitelisted-function.rs"
+++ generated from: "/bindgen/tests/headers/type-referenced-by-whitelisted-function.h"
/* automatically generated by rust-bindgen */
#![allow(non_snake_case)]
#[repr(C)]
#[derive(Debug, Default, Copy)]
pub struct dl_phdr_info {
pub x: ::std::os::raw::c_int,
}
#[test]
fn bindgen_test_layout_dl_phdr_info() {
assert_eq!(::std::mem::size_of::<dl_phdr_info>() , 4usize , concat ! (
"Size of: " , stringify ! ( dl_phdr_info ) ));
assert_eq! (::std::mem::align_of::<dl_phdr_info>() , 4usize , concat ! (
"Alignment of " , stringify ! ( dl_phdr_info ) ));
- assert_eq! (unsafe {
- & ( * ( 0 as * const dl_phdr_info ) ) . x as * const _ as
- usize } , 0usize , concat ! (
- "Alignment of field: " , stringify ! ( dl_phdr_info ) , "::" ,
- stringify ! ( x ) ));
}
impl Clone for dl_phdr_info {
fn clone(&self) -> Self { *self }
}
extern "C" {
pub fn dl_iterate_phdr(arg1: *mut dl_phdr_info) -> ::std::os::raw::c_int;
}
thread 'header_type_referenced_by_whitelisted_function_h' panicked at 'Header and binding differ!', /bindgen/target/debug/build/bindgen-f6fdd37f3e51109e/out/tests.rs:67
---- header_union_with_anon_struct_h stdout ----
diff expected generated
--- expected: "/bindgen/tests/expectations/tests/union_with_anon_struct.rs"
+++ generated from: "/bindgen/tests/headers/union_with_anon_struct.h"
/* automatically generated by rust-bindgen */
#![allow(non_snake_case)]
#[repr(C)]
pub struct __BindgenUnionField<T>(::std::marker::PhantomData<T>);
impl <T> __BindgenUnionField<T> {
#[inline]
pub fn new() -> Self { __BindgenUnionField(::std::marker::PhantomData) }
#[inline]
pub unsafe fn as_ref(&self) -> &T { ::std::mem::transmute(self) }
#[inline]
pub unsafe fn as_mut(&mut self) -> &mut T { ::std::mem::transmute(self) }
}
impl <T> ::std::default::Default for __BindgenUnionField<T> {
#[inline]
fn default() -> Self { Self::new() }
}
impl <T> ::std::clone::Clone for __BindgenUnionField<T> {
#[inline]
fn clone(&self) -> Self { Self::new() }
}
impl <T> ::std::marker::Copy for __BindgenUnionField<T> { }
impl <T> ::std::fmt::Debug for __BindgenUnionField<T> {
fn fmt(&self, fmt: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
fmt.write_str("__BindgenUnionField")
}
}
#[repr(C)]
#[derive(Debug, Default, Copy)]
pub struct foo {
pub bar: __BindgenUnionField<foo__bindgen_ty_1>,
pub bindgen_union_field: [u32; 2usize],
}
#[repr(C)]
#[derive(Debug, Default, Copy)]
pub struct foo__bindgen_ty_1 {
pub a: ::std::os::raw::c_uint,
pub b: ::std::os::raw::c_uint,
}
#[test]
fn bindgen_test_layout_foo__bindgen_ty_1() {
assert_eq!(::std::mem::size_of::<foo__bindgen_ty_1>() , 8usize , concat !
( "Size of: " , stringify ! ( foo__bindgen_ty_1 ) ));
assert_eq! (::std::mem::align_of::<foo__bindgen_ty_1>() , 4usize , concat
! ( "Alignment of " , stringify ! ( foo__bindgen_ty_1 ) ));
- assert_eq! (unsafe {
- & ( * ( 0 as * const foo__bindgen_ty_1 ) ) . a as * const _ as
- usize } , 0usize , concat ! (
- "Alignment of field: " , stringify ! ( foo__bindgen_ty_1 ) ,
- "::" , stringify ! ( a ) ));
- assert_eq! (unsafe {
- & ( * ( 0 as * const foo__bindgen_ty_1 ) ) . b as * const _ as
- usize } , 4usize , concat ! (
- "Alignment of field: " , stringify ! ( foo__bindgen_ty_1 ) ,
- "::" , stringify ! ( b ) ));
}
impl Clone for foo__bindgen_ty_1 {
fn clone(&self) -> Self { *self }
}
#[test]
fn bindgen_test_layout_foo() {
assert_eq!(::std::mem::size_of::<foo>() , 8usize , concat ! (
"Size of: " , stringify ! ( foo ) ));
assert_eq! (::std::mem::align_of::<foo>() , 4usize , concat ! (
"Alignment of " , stringify ! ( foo ) ));
- assert_eq! (unsafe {
- & ( * ( 0 as * const foo ) ) . bar as * const _ as usize } ,
- 0usize , concat ! (
- "Alignment of field: " , stringify ! ( foo ) , "::" ,
- stringify ! ( bar ) ));
}
impl Clone for foo {
fn clone(&self) -> Self { *self }
}
thread 'header_union_with_anon_struct_h' panicked at 'Header and binding differ!', /bindgen/target/debug/build/bindgen-f6fdd37f3e51109e/out/tests.rs:2
---- header_union_with_anon_struct_bitfield_h stdout ----
diff expected generated
--- expected: "/bindgen/tests/expectations/tests/union_with_anon_struct_bitfield.rs"
+++ generated from: "/bindgen/tests/headers/union_with_anon_struct_bitfield.h"
/* automatically generated by rust-bindgen */
#![allow(non_snake_case)]
#[repr(C)]
pub struct __BindgenUnionField<T>(::std::marker::PhantomData<T>);
impl <T> __BindgenUnionField<T> {
#[inline]
pub fn new() -> Self { __BindgenUnionField(::std::marker::PhantomData) }
#[inline]
pub unsafe fn as_ref(&self) -> &T { ::std::mem::transmute(self) }
#[inline]
pub unsafe fn as_mut(&mut self) -> &mut T { ::std::mem::transmute(self) }
}
impl <T> ::std::default::Default for __BindgenUnionField<T> {
#[inline]
fn default() -> Self { Self::new() }
}
impl <T> ::std::clone::Clone for __BindgenUnionField<T> {
#[inline]
fn clone(&self) -> Self { Self::new() }
}
impl <T> ::std::marker::Copy for __BindgenUnionField<T> { }
impl <T> ::std::fmt::Debug for __BindgenUnionField<T> {
fn fmt(&self, fmt: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
fmt.write_str("__BindgenUnionField")
}
}
#[repr(C)]
#[derive(Debug, Default, Copy)]
pub struct foo {
pub a: __BindgenUnionField<::std::os::raw::c_int>,
pub __bindgen_anon_1: __BindgenUnionField<foo__bindgen_ty_1>,
pub bindgen_union_field: u32,
}
#[repr(C)]
#[derive(Debug, Default, Copy)]
pub struct foo__bindgen_ty_1 {
pub _bitfield_1: u32,
}
#[test]
fn bindgen_test_layout_foo__bindgen_ty_1() {
assert_eq!(::std::mem::size_of::<foo__bindgen_ty_1>() , 4usize , concat !
( "Size of: " , stringify ! ( foo__bindgen_ty_1 ) ));
assert_eq! (::std::mem::align_of::<foo__bindgen_ty_1>() , 4usize , concat
! ( "Alignment of " , stringify ! ( foo__bindgen_ty_1 ) ));
}
impl Clone for foo__bindgen_ty_1 {
fn clone(&self) -> Self { *self }
}
impl foo__bindgen_ty_1 {
#[inline]
pub fn b(&self) -> ::std::os::raw::c_int {
unsafe {
::std::mem::transmute(((self._bitfield_1 & (127usize as u32)) >>
0u32) as u32)
}
}
#[inline]
pub fn set_b(&mut self, val: ::std::os::raw::c_int) {
self._bitfield_1 &= !(127usize as u32);
self._bitfield_1 |= ((val as u32 as u32) << 0u32) & (127usize as u32);
}
#[inline]
pub fn c(&self) -> ::std::os::raw::c_int {
unsafe {
::std::mem::transmute(((self._bitfield_1 &
(4294967168usize as u32)) >> 7u32) as
u32)
}
}
#[inline]
pub fn set_c(&mut self, val: ::std::os::raw::c_int) {
self._bitfield_1 &= !(4294967168usize as u32);
self._bitfield_1 |=
((val as u32 as u32) << 7u32) & (4294967168usize as u32);
}
}
#[test]
fn bindgen_test_layout_foo() {
assert_eq!(::std::mem::size_of::<foo>() , 4usize , concat ! (
"Size of: " , stringify ! ( foo ) ));
assert_eq! (::std::mem::align_of::<foo>() , 4usize , concat ! (
"Alignment of " , stringify ! ( foo ) ));
- assert_eq! (unsafe {
- & ( * ( 0 as * const foo ) ) . a as * const _ as usize } ,
- 0usize , concat ! (
- "Alignment of field: " , stringify ! ( foo ) , "::" ,
- stringify ! ( a ) ));
}
impl Clone for foo {
fn clone(&self) -> Self { *self }
}
thread 'header_union_with_anon_struct_bitfield_h' panicked at 'Header and binding differ!', /bindgen/target/debug/build/bindgen-f6fdd37f3e51109e/out/tests.rs:65
---- header_union_with_anon_union_h stdout ----
diff expected generated
--- expected: "/bindgen/tests/expectations/tests/union_with_anon_union.rs"
+++ generated from: "/bindgen/tests/headers/union_with_anon_union.h"
/* automatically generated by rust-bindgen */
#![allow(non_snake_case)]
#[repr(C)]
pub struct __BindgenUnionField<T>(::std::marker::PhantomData<T>);
impl <T> __BindgenUnionField<T> {
#[inline]
pub fn new() -> Self { __BindgenUnionField(::std::marker::PhantomData) }
#[inline]
pub unsafe fn as_ref(&self) -> &T { ::std::mem::transmute(self) }
#[inline]
pub unsafe fn as_mut(&mut self) -> &mut T { ::std::mem::transmute(self) }
}
impl <T> ::std::default::Default for __BindgenUnionField<T> {
#[inline]
fn default() -> Self { Self::new() }
}
impl <T> ::std::clone::Clone for __BindgenUnionField<T> {
#[inline]
fn clone(&self) -> Self { Self::new() }
}
impl <T> ::std::marker::Copy for __BindgenUnionField<T> { }
impl <T> ::std::fmt::Debug for __BindgenUnionField<T> {
fn fmt(&self, fmt: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
fmt.write_str("__BindgenUnionField")
}
}
#[repr(C)]
#[derive(Debug, Default, Copy)]
pub struct foo {
pub bar: __BindgenUnionField<foo__bindgen_ty_1>,
pub bindgen_union_field: u32,
}
#[repr(C)]
#[derive(Debug, Default, Copy)]
pub struct foo__bindgen_ty_1 {
pub a: __BindgenUnionField<::std::os::raw::c_uint>,
pub b: __BindgenUnionField<::std::os::raw::c_ushort>,
pub bindgen_union_field: u32,
}
#[test]
fn bindgen_test_layout_foo__bindgen_ty_1() {
assert_eq!(::std::mem::size_of::<foo__bindgen_ty_1>() , 4usize , concat !
( "Size of: " , stringify ! ( foo__bindgen_ty_1 ) ));
assert_eq! (::std::mem::align_of::<foo__bindgen_ty_1>() , 4usize , concat
! ( "Alignment of " , stringify ! ( foo__bindgen_ty_1 ) ));
- assert_eq! (unsafe {
- & ( * ( 0 as * const foo__bindgen_ty_1 ) ) . a as * const _ as
- usize } , 0usize , concat ! (
- "Alignment of field: " , stringify ! ( foo__bindgen_ty_1 ) ,
- "::" , stringify ! ( a ) ));
- assert_eq! (unsafe {
- & ( * ( 0 as * const foo__bindgen_ty_1 ) ) . b as * const _ as
- usize } , 0usize , concat ! (
- "Alignment of field: " , stringify ! ( foo__bindgen_ty_1 ) ,
- "::" , stringify ! ( b ) ));
}
impl Clone for foo__bindgen_ty_1 {
fn clone(&self) -> Self { *self }
}
#[test]
fn bindgen_test_layout_foo() {
assert_eq!(::std::mem::size_of::<foo>() , 4usize , concat ! (
"Size of: " , stringify ! ( foo ) ));
assert_eq! (::std::mem::align_of::<foo>() , 4usize , concat ! (
"Alignment of " , stringify ! ( foo ) ));
- assert_eq! (unsafe {
- & ( * ( 0 as * const foo ) ) . bar as * const _ as usize } ,
- 0usize , concat ! (
- "Alignment of field: " , stringify ! ( foo ) , "::" ,
- stringify ! ( bar ) ));
}
impl Clone for foo {
fn clone(&self) -> Self { *self }
}
thread 'header_union_with_anon_union_h' panicked at 'Header and binding differ!', /bindgen/target/debug/build/bindgen-f6fdd37f3e51109e/out/tests.rs:12
---- header_union_with_anon_unnamed_struct_h stdout ----
diff expected generated
--- expected: "/bindgen/tests/expectations/tests/union_with_anon_unnamed_struct.rs"
+++ generated from: "/bindgen/tests/headers/union_with_anon_unnamed_struct.h"
/* automatically generated by rust-bindgen */
#![allow(non_snake_case)]
#[repr(C)]
pub struct __BindgenUnionField<T>(::std::marker::PhantomData<T>);
impl <T> __BindgenUnionField<T> {
#[inline]
pub fn new() -> Self { __BindgenUnionField(::std::marker::PhantomData) }
#[inline]
pub unsafe fn as_ref(&self) -> &T { ::std::mem::transmute(self) }
#[inline]
pub unsafe fn as_mut(&mut self) -> &mut T { ::std::mem::transmute(self) }
}
impl <T> ::std::default::Default for __BindgenUnionField<T> {
#[inline]
fn default() -> Self { Self::new() }
}
impl <T> ::std::clone::Clone for __BindgenUnionField<T> {
#[inline]
fn clone(&self) -> Self { Self::new() }
}
impl <T> ::std::marker::Copy for __BindgenUnionField<T> { }
impl <T> ::std::fmt::Debug for __BindgenUnionField<T> {
fn fmt(&self, fmt: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
fmt.write_str("__BindgenUnionField")
}
}
#[repr(C)]
#[derive(Debug, Default, Copy)]
pub struct pixel {
pub rgba: __BindgenUnionField<::std::os::raw::c_uint>,
pub __bindgen_anon_1: __BindgenUnionField<pixel__bindgen_ty_1>,
pub bindgen_union_field: u32,
}
#[repr(C)]
#[derive(Debug, Default, Copy)]
pub struct pixel__bindgen_ty_1 {
pub r: ::std::os::raw::c_uchar,
pub g: ::std::os::raw::c_uchar,
pub b: ::std::os::raw::c_uchar,
pub a: ::std::os::raw::c_uchar,
}
#[test]
fn bindgen_test_layout_pixel__bindgen_ty_1() {
assert_eq!(::std::mem::size_of::<pixel__bindgen_ty_1>() , 4usize , concat
! ( "Size of: " , stringify ! ( pixel__bindgen_ty_1 ) ));
assert_eq! (::std::mem::align_of::<pixel__bindgen_ty_1>() , 1usize ,
concat ! (
"Alignment of " , stringify ! ( pixel__bindgen_ty_1 ) ));
- assert_eq! (unsafe {
- & ( * ( 0 as * const pixel__bindgen_ty_1 ) ) . r as * const _
- as usize } , 0usize , concat ! (
- "Alignment of field: " , stringify ! ( pixel__bindgen_ty_1 ) ,
- "::" , stringify ! ( r ) ));
- assert_eq! (unsafe {
- & ( * ( 0 as * const pixel__bindgen_ty_1 ) ) . g as * const _
- as usize } , 1usize , concat ! (
- "Alignment of field: " , stringify ! ( pixel__bindgen_ty_1 ) ,
- "::" , stringify ! ( g ) ));
- assert_eq! (unsafe {
- & ( * ( 0 as * const pixel__bindgen_ty_1 ) ) . b as * const _
- as usize } , 2usize , concat ! (
- "Alignment of field: " , stringify ! ( pixel__bindgen_ty_1 ) ,
- "::" , stringify ! ( b ) ));
- assert_eq! (unsafe {
- & ( * ( 0 as * const pixel__bindgen_ty_1 ) ) . a as * const _
- as usize } , 3usize , concat ! (
- "Alignment of field: " , stringify ! ( pixel__bindgen_ty_1 ) ,
- "::" , stringify ! ( a ) ));
}
impl Clone for pixel__bindgen_ty_1 {
fn clone(&self) -> Self { *self }
}
#[test]
fn bindgen_test_layout_pixel() {
assert_eq!(::std::mem::size_of::<pixel>() , 4usize , concat ! (
"Size of: " , stringify ! ( pixel ) ));
assert_eq! (::std::mem::align_of::<pixel>() , 4usize , concat ! (
"Alignment of " , stringify ! ( pixel ) ));
- assert_eq! (unsafe {
- & ( * ( 0 as * const pixel ) ) . rgba as * const _ as usize }
- , 0usize , concat ! (
- "Alignment of field: " , stringify ! ( pixel ) , "::" ,
- stringify ! ( rgba ) ));
}
impl Clone for pixel {
fn clone(&self) -> Self { *self }
}
thread 'header_union_with_anon_unnamed_struct_h' panicked at 'Header and binding differ!', /bindgen/target/debug/build/bindgen-f6fdd37f3e51109e/out/tests.rs:48
---- header_union_with_anon_unnamed_union_h stdout ----
diff expected generated
--- expected: "/bindgen/tests/expectations/tests/union_with_anon_unnamed_union.rs"
+++ generated from: "/bindgen/tests/headers/union_with_anon_unnamed_union.h"
/* automatically generated by rust-bindgen */
#![allow(non_snake_case)]
#[repr(C)]
pub struct __BindgenUnionField<T>(::std::marker::PhantomData<T>);
impl <T> __BindgenUnionField<T> {
#[inline]
pub fn new() -> Self { __BindgenUnionField(::std::marker::PhantomData) }
#[inline]
pub unsafe fn as_ref(&self) -> &T { ::std::mem::transmute(self) }
#[inline]
pub unsafe fn as_mut(&mut self) -> &mut T { ::std::mem::transmute(self) }
}
impl <T> ::std::default::Default for __BindgenUnionField<T> {
#[inline]
fn default() -> Self { Self::new() }
}
impl <T> ::std::clone::Clone for __BindgenUnionField<T> {
#[inline]
fn clone(&self) -> Self { Self::new() }
}
impl <T> ::std::marker::Copy for __BindgenUnionField<T> { }
impl <T> ::std::fmt::Debug for __BindgenUnionField<T> {
fn fmt(&self, fmt: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
fmt.write_str("__BindgenUnionField")
}
}
#[repr(C)]
#[derive(Debug, Default, Copy)]
pub struct foo {
pub a: __BindgenUnionField<::std::os::raw::c_uint>,
pub __bindgen_anon_1: __BindgenUnionField<foo__bindgen_ty_1>,
pub bindgen_union_field: u32,
}
#[repr(C)]
#[derive(Debug, Default, Copy)]
pub struct foo__bindgen_ty_1 {
pub b: __BindgenUnionField<::std::os::raw::c_ushort>,
pub c: __BindgenUnionField<::std::os::raw::c_uchar>,
pub bindgen_union_field: u16,
}
#[test]
fn bindgen_test_layout_foo__bindgen_ty_1() {
assert_eq!(::std::mem::size_of::<foo__bindgen_ty_1>() , 2usize , concat !
( "Size of: " , stringify ! ( foo__bindgen_ty_1 ) ));
assert_eq! (::std::mem::align_of::<foo__bindgen_ty_1>() , 2usize , concat
! ( "Alignment of " , stringify ! ( foo__bindgen_ty_1 ) ));
- assert_eq! (unsafe {
- & ( * ( 0 as * const foo__bindgen_ty_1 ) ) . b as * const _ as
- usize } , 0usize , concat ! (
- "Alignment of field: " , stringify ! ( foo__bindgen_ty_1 ) ,
- "::" , stringify ! ( b ) ));
- assert_eq! (unsafe {
- & ( * ( 0 as * const foo__bindgen_ty_1 ) ) . c as * const _ as
- usize } , 0usize , concat ! (
- "Alignment of field: " , stringify ! ( foo__bindgen_ty_1 ) ,
- "::" , stringify ! ( c ) ));
}
impl Clone for foo__bindgen_ty_1 {
fn clone(&self) -> Self { *self }
}
#[test]
fn bindgen_test_layout_foo() {
assert_eq!(::std::mem::size_of::<foo>() , 4usize , concat ! (
"Size of: " , stringify ! ( foo ) ));
assert_eq! (::std::mem::align_of::<foo>() , 4usize , concat ! (
"Alignment of " , stringify ! ( foo ) ));
- assert_eq! (unsafe {
- & ( * ( 0 as * const foo ) ) . a as * const _ as usize } ,
- 0usize , concat ! (
- "Alignment of field: " , stringify ! ( foo ) , "::" ,
- stringify ! ( a ) ));
}
impl Clone for foo {
fn clone(&self) -> Self { *self }
}
thread 'header_union_with_anon_unnamed_union_h' panicked at 'Header and binding differ!', /bindgen/target/debug/build/bindgen-f6fdd37f3e51109e/out/tests.rs:28
---- header_union_with_big_member_h stdout ----
diff expected generated
--- expected: "/bindgen/tests/expectations/tests/union_with_big_member.rs"
+++ generated from: "/bindgen/tests/headers/union_with_big_member.h"
/* automatically generated by rust-bindgen */
#![allow(non_snake_case)]
#[repr(C)]
pub struct __BindgenUnionField<T>(::std::marker::PhantomData<T>);
impl <T> __BindgenUnionField<T> {
#[inline]
pub fn new() -> Self { __BindgenUnionField(::std::marker::PhantomData) }
#[inline]
pub unsafe fn as_ref(&self) -> &T { ::std::mem::transmute(self) }
#[inline]
pub unsafe fn as_mut(&mut self) -> &mut T { ::std::mem::transmute(self) }
}
impl <T> ::std::default::Default for __BindgenUnionField<T> {
#[inline]
fn default() -> Self { Self::new() }
}
impl <T> ::std::clone::Clone for __BindgenUnionField<T> {
#[inline]
fn clone(&self) -> Self { Self::new() }
}
impl <T> ::std::marker::Copy for __BindgenUnionField<T> { }
impl <T> ::std::fmt::Debug for __BindgenUnionField<T> {
fn fmt(&self, fmt: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
fmt.write_str("__BindgenUnionField")
}
}
#[repr(C)]
#[derive(Copy)]
pub struct WithBigArray {
pub a: __BindgenUnionField<::std::os::raw::c_int>,
pub b: __BindgenUnionField<[::std::os::raw::c_int; 33usize]>,
pub bindgen_union_field: [u32; 33usize],
}
#[test]
fn bindgen_test_layout_WithBigArray() {
assert_eq!(::std::mem::size_of::<WithBigArray>() , 132usize , concat ! (
"Size of: " , stringify ! ( WithBigArray ) ));
assert_eq! (::std::mem::align_of::<WithBigArray>() , 4usize , concat ! (
"Alignment of " , stringify ! ( WithBigArray ) ));
- assert_eq! (unsafe {
- & ( * ( 0 as * const WithBigArray ) ) . a as * const _ as
- usize } , 0usize , concat ! (
- "Alignment of field: " , stringify ! ( WithBigArray ) , "::" ,
- stringify ! ( a ) ));
- assert_eq! (unsafe {
- & ( * ( 0 as * const WithBigArray ) ) . b as * const _ as
- usize } , 0usize , concat ! (
- "Alignment of field: " , stringify ! ( WithBigArray ) , "::" ,
- stringify ! ( b ) ));
}
impl Clone for WithBigArray {
fn clone(&self) -> Self { *self }
}
impl Default for WithBigArray {
fn default() -> Self { unsafe { ::std::mem::zeroed() } }
}
#[repr(C)]
#[derive(Debug, Default, Copy)]
pub struct WithBigArray2 {
pub a: __BindgenUnionField<::std::os::raw::c_int>,
pub b: __BindgenUnionField<[::std::os::raw::c_char; 33usize]>,
pub bindgen_union_field: [u32; 9usize],
}
#[test]
fn bindgen_test_layout_WithBigArray2() {
assert_eq!(::std::mem::size_of::<WithBigArray2>() , 36usize , concat ! (
"Size of: " , stringify ! ( WithBigArray2 ) ));
assert_eq! (::std::mem::align_of::<WithBigArray2>() , 4usize , concat ! (
"Alignment of " , stringify ! ( WithBigArray2 ) ));
- assert_eq! (unsafe {
- & ( * ( 0 as * const WithBigArray2 ) ) . a as * const _ as
- usize } , 0usize , concat ! (
- "Alignment of field: " , stringify ! ( WithBigArray2 ) , "::"
- , stringify ! ( a ) ));
- assert_eq! (unsafe {
- & ( * ( 0 as * const WithBigArray2 ) ) . b as * const _ as
- usize } , 0usize , concat ! (
- "Alignment of field: " , stringify ! ( WithBigArray2 ) , "::"
- , stringify ! ( b ) ));
}
impl Clone for WithBigArray2 {
fn clone(&self) -> Self { *self }
}
#[repr(C)]
#[derive(Copy)]
pub struct WithBigMember {
pub a: __BindgenUnionField<::std::os::raw::c_int>,
pub b: __BindgenUnionField<WithBigArray>,
pub bindgen_union_field: [u32; 33usize],
}
#[test]
fn bindgen_test_layout_WithBigMember() {
assert_eq!(::std::mem::size_of::<WithBigMember>() , 132usize , concat ! (
"Size of: " , stringify ! ( WithBigMember ) ));
assert_eq! (::std::mem::align_of::<WithBigMember>() , 4usize , concat ! (
"Alignment of " , stringify ! ( WithBigMember ) ));
- assert_eq! (unsafe {
- & ( * ( 0 as * const WithBigMember ) ) . a as * const _ as
- usize } , 0usize , concat ! (
- "Alignment of field: " , stringify ! ( WithBigMember ) , "::"
- , stringify ! ( a ) ));
- assert_eq! (unsafe {
- & ( * ( 0 as * const WithBigMember ) ) . b as * const _ as
- usize } , 0usize , concat ! (
- "Alignment of field: " , stringify ! ( WithBigMember ) , "::"
- , stringify ! ( b ) ));
}
impl Clone for WithBigMember {
fn clone(&self) -> Self { *self }
}
impl Default for WithBigMember {
fn default() -> Self { unsafe { ::std::mem::zeroed() } }
}
thread 'header_union_with_big_member_h' panicked at 'Header and binding differ!', /bindgen/target/debug/build/bindgen-f6fdd37f3e51109e/out/tests.rs:43
---- header_unknown_attr_h stdout ----
diff expected generated
--- expected: "/bindgen/tests/expectations/tests/unknown_attr.rs"
+++ generated from: "/bindgen/tests/headers/unknown_attr.h"
/* automatically generated by rust-bindgen */
#![allow(non_snake_case)]
#[repr(C)]
#[derive(Debug, Default, Copy)]
pub struct _bindgen_ty_1 {
pub __clang_max_align_nonce1: ::std::os::raw::c_longlong,
pub __bindgen_padding_0: u64,
pub __clang_max_align_nonce2: f64,
pub __bindgen_padding_1: u64,
}
#[test]
fn bindgen_test_layout__bindgen_ty_1() {
assert_eq!(::std::mem::size_of::<_bindgen_ty_1>() , 32usize , concat ! (
"Size of: " , stringify ! ( _bindgen_ty_1 ) ));
- assert_eq! (unsafe {
- & ( * ( 0 as * const _bindgen_ty_1 ) ) .
- __clang_max_align_nonce1 as * const _ as usize } , 0usize ,
- concat ! (
- "Alignment of field: " , stringify ! ( _bindgen_ty_1 ) , "::"
- , stringify ! ( __clang_max_align_nonce1 ) ));
- assert_eq! (unsafe {
- & ( * ( 0 as * const _bindgen_ty_1 ) ) .
- __clang_max_align_nonce2 as * const _ as usize } , 16usize ,
- concat ! (
- "Alignment of field: " , stringify ! ( _bindgen_ty_1 ) , "::"
- , stringify ! ( __clang_max_align_nonce2 ) ));
}
impl Clone for _bindgen_ty_1 {
fn clone(&self) -> Self { *self }
}
pub type max_align_t = _bindgen_ty_1;
thread 'header_unknown_attr_h' panicked at 'Header and binding differ!', /bindgen/target/debug/build/bindgen-f6fdd37f3e51109e/out/tests.rs:24
---- header_union_with_nesting_h stdout ----
diff expected generated
--- expected: "/bindgen/tests/expectations/tests/union_with_nesting.rs"
+++ generated from: "/bindgen/tests/headers/union_with_nesting.h"
/* automatically generated by rust-bindgen */
#![allow(non_snake_case)]
#[repr(C)]
pub struct __BindgenUnionField<T>(::std::marker::PhantomData<T>);
impl <T> __BindgenUnionField<T> {
#[inline]
pub fn new() -> Self { __BindgenUnionField(::std::marker::PhantomData) }
#[inline]
pub unsafe fn as_ref(&self) -> &T { ::std::mem::transmute(self) }
#[inline]
pub unsafe fn as_mut(&mut self) -> &mut T { ::std::mem::transmute(self) }
}
impl <T> ::std::default::Default for __BindgenUnionField<T> {
#[inline]
fn default() -> Self { Self::new() }
}
impl <T> ::std::clone::Clone for __BindgenUnionField<T> {
#[inline]
fn clone(&self) -> Self { Self::new() }
}
impl <T> ::std::marker::Copy for __BindgenUnionField<T> { }
impl <T> ::std::fmt::Debug for __BindgenUnionField<T> {
fn fmt(&self, fmt: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
fmt.write_str("__BindgenUnionField")
}
}
#[repr(C)]
#[derive(Debug, Default, Copy)]
pub struct foo {
pub a: __BindgenUnionField<::std::os::raw::c_uint>,
pub __bindgen_anon_1: __BindgenUnionField<foo__bindgen_ty_1>,
pub bindgen_union_field: u32,
}
#[repr(C)]
#[derive(Debug, Default, Copy)]
pub struct foo__bindgen_ty_1 {
pub __bindgen_anon_1: foo__bindgen_ty_1__bindgen_ty_1,
pub __bindgen_anon_2: foo__bindgen_ty_1__bindgen_ty_2,
}
#[repr(C)]
#[derive(Debug, Default, Copy)]
pub struct foo__bindgen_ty_1__bindgen_ty_1 {
pub b1: __BindgenUnionField<::std::os::raw::c_ushort>,
pub b2: __BindgenUnionField<::std::os::raw::c_ushort>,
pub bindgen_union_field: u16,
}
#[test]
fn bindgen_test_layout_foo__bindgen_ty_1__bindgen_ty_1() {
assert_eq!(::std::mem::size_of::<foo__bindgen_ty_1__bindgen_ty_1>() ,
2usize , concat ! (
"Size of: " , stringify ! ( foo__bindgen_ty_1__bindgen_ty_1 )
));
assert_eq! (::std::mem::align_of::<foo__bindgen_ty_1__bindgen_ty_1>() ,
2usize , concat ! (
"Alignment of " , stringify ! (
foo__bindgen_ty_1__bindgen_ty_1 ) ));
- assert_eq! (unsafe {
- & ( * ( 0 as * const foo__bindgen_ty_1__bindgen_ty_1 ) ) . b1
- as * const _ as usize } , 0usize , concat ! (
- "Alignment of field: " , stringify ! (
- foo__bindgen_ty_1__bindgen_ty_1 ) , "::" , stringify ! ( b1 )
- ));
- assert_eq! (unsafe {
- & ( * ( 0 as * const foo__bindgen_ty_1__bindgen_ty_1 ) ) . b2
- as * const _ as usize } , 0usize , concat ! (
- "Alignment of field: " , stringify ! (
- foo__bindgen_ty_1__bindgen_ty_1 ) , "::" , stringify ! ( b2 )
- ));
}
impl Clone for foo__bindgen_ty_1__bindgen_ty_1 {
fn clone(&self) -> Self { *self }
}
#[repr(C)]
#[derive(Debug, Default, Copy)]
pub struct foo__bindgen_ty_1__bindgen_ty_2 {
pub c1: __BindgenUnionField<::std::os::raw::c_ushort>,
pub c2: __BindgenUnionField<::std::os::raw::c_ushort>,
pub bindgen_union_field: u16,
}
#[test]
fn bindgen_test_layout_foo__bindgen_ty_1__bindgen_ty_2() {
assert_eq!(::std::mem::size_of::<foo__bindgen_ty_1__bindgen_ty_2>() ,
2usize , concat ! (
"Size of: " , stringify ! ( foo__bindgen_ty_1__bindgen_ty_2 )
));
assert_eq! (::std::mem::align_of::<foo__bindgen_ty_1__bindgen_ty_2>() ,
2usize , concat ! (
"Alignment of " , stringify ! (
foo__bindgen_ty_1__bindgen_ty_2 ) ));
- assert_eq! (unsafe {
- & ( * ( 0 as * const foo__bindgen_ty_1__bindgen_ty_2 ) ) . c1
- as * const _ as usize } , 0usize , concat ! (
- "Alignment of field: " , stringify ! (
- foo__bindgen_ty_1__bindgen_ty_2 ) , "::" , stringify ! ( c1 )
- ));
- assert_eq! (unsafe {
- & ( * ( 0 as * const foo__bindgen_ty_1__bindgen_ty_2 ) ) . c2
- as * const _ as usize } , 0usize , concat ! (
- "Alignment of field: " , stringify ! (
- foo__bindgen_ty_1__bindgen_ty_2 ) , "::" , stringify ! ( c2 )
- ));
}
impl Clone for foo__bindgen_ty_1__bindgen_ty_2 {
fn clone(&self) -> Self { *self }
}
#[test]
fn bindgen_test_layout_foo__bindgen_ty_1() {
assert_eq!(::std::mem::size_of::<foo__bindgen_ty_1>() , 4usize , concat !
( "Size of: " , stringify ! ( foo__bindgen_ty_1 ) ));
assert_eq! (::std::mem::align_of::<foo__bindgen_ty_1>() , 2usize , concat
! ( "Alignment of " , stringify ! ( foo__bindgen_ty_1 ) ));
}
impl Clone for foo__bindgen_ty_1 {
fn clone(&self) -> Self { *self }
}
#[test]
fn bindgen_test_layout_foo() {
assert_eq!(::std::mem::size_of::<foo>() , 4usize , concat ! (
"Size of: " , stringify ! ( foo ) ));
assert_eq! (::std::mem::align_of::<foo>() , 4usize , concat ! (
"Alignment of " , stringify ! ( foo ) ));
- assert_eq! (unsafe {
- & ( * ( 0 as * const foo ) ) . a as * const _ as usize } ,
- 0usize , concat ! (
- "Alignment of field: " , stringify ! ( foo ) , "::" ,
- stringify ! ( a ) ));
}
impl Clone for foo {
fn clone(&self) -> Self { *self }
}
thread 'header_union_with_nesting_h' panicked at 'Header and binding differ!', /bindgen/target/debug/build/bindgen-f6fdd37f3e51109e/out/tests.rs:26
---- header_use_core_h stdout ----
diff expected generated
--- expected: "/bindgen/tests/expectations/tests/use-core.rs"
+++ generated from: "/bindgen/tests/headers/use-core.h"
/* automatically generated by rust-bindgen */
#![allow(non_snake_case)]
extern crate core;
#[repr(C)]
pub struct __BindgenUnionField<T>(::core::marker::PhantomData<T>);
impl <T> __BindgenUnionField<T> {
#[inline]
pub fn new() -> Self { __BindgenUnionField(::core::marker::PhantomData) }
#[inline]
pub unsafe fn as_ref(&self) -> &T { ::core::mem::transmute(self) }
#[inline]
pub unsafe fn as_mut(&mut self) -> &mut T { ::core::mem::transmute(self) }
}
impl <T> ::core::default::Default for __BindgenUnionField<T> {
#[inline]
fn default() -> Self { Self::new() }
}
impl <T> ::core::clone::Clone for __BindgenUnionField<T> {
#[inline]
fn clone(&self) -> Self { Self::new() }
}
impl <T> ::core::marker::Copy for __BindgenUnionField<T> { }
impl <T> ::core::fmt::Debug for __BindgenUnionField<T> {
fn fmt(&self, fmt: &mut ::core::fmt::Formatter) -> ::core::fmt::Result {
fmt.write_str("__BindgenUnionField")
}
}
#[repr(C)]
#[derive(Debug, Copy)]
pub struct foo {
pub a: ::std::os::raw::c_int,
pub b: ::std::os::raw::c_int,
pub bar: *mut ::std::os::raw::c_void,
}
#[test]
fn bindgen_test_layout_foo() {
assert_eq!(::core::mem::size_of::<foo>() , 16usize , concat ! (
"Size of: " , stringify ! ( foo ) ));
assert_eq! (::core::mem::align_of::<foo>() , 8usize , concat ! (
"Alignment of " , stringify ! ( foo ) ));
- assert_eq! (unsafe {
- & ( * ( 0 as * const foo ) ) . a as * const _ as usize } ,
- 0usize , concat ! (
- "Alignment of field: " , stringify ! ( foo ) , "::" ,
- stringify ! ( a ) ));
- assert_eq! (unsafe {
- & ( * ( 0 as * const foo ) ) . b as * const _ as usize } ,
- 4usize , concat ! (
- "Alignment of field: " , stringify ! ( foo ) , "::" ,
- stringify ! ( b ) ));
- assert_eq! (unsafe {
- & ( * ( 0 as * const foo ) ) . bar as * const _ as usize } ,
- 8usize , concat ! (
- "Alignment of field: " , stringify ! ( foo ) , "::" ,
- stringify ! ( bar ) ));
}
impl Clone for foo {
fn clone(&self) -> Self { *self }
}
impl Default for foo {
fn default() -> Self { unsafe { ::core::mem::zeroed() } }
}
#[repr(C)]
#[derive(Debug, Default, Copy)]
pub struct _bindgen_ty_1 {
pub bar: __BindgenUnionField<::std::os::raw::c_int>,
pub baz: __BindgenUnionField<::std::os::raw::c_long>,
pub bindgen_union_field: u64,
}
#[test]
fn bindgen_test_layout__bindgen_ty_1() {
assert_eq!(::core::mem::size_of::<_bindgen_ty_1>() , 8usize , concat ! (
"Size of: " , stringify ! ( _bindgen_ty_1 ) ));
assert_eq! (::core::mem::align_of::<_bindgen_ty_1>() , 8usize , concat ! (
"Alignment of " , stringify ! ( _bindgen_ty_1 ) ));
- assert_eq! (unsafe {
- & ( * ( 0 as * const _bindgen_ty_1 ) ) . bar as * const _ as
- usize } , 0usize , concat ! (
- "Alignment of field: " , stringify ! ( _bindgen_ty_1 ) , "::"
- , stringify ! ( bar ) ));
- assert_eq! (unsafe {
- & ( * ( 0 as * const _bindgen_ty_1 ) ) . baz as * const _ as
- usize } , 0usize , concat ! (
- "Alignment of field: " , stringify ! ( _bindgen_ty_1 ) , "::"
- , stringify ! ( baz ) ));
}
impl Clone for _bindgen_ty_1 {
fn clone(&self) -> Self { *self }
}
extern "C" {
#[link_name = "bazz"]
pub static mut bazz: _bindgen_ty_1;
}
pub type fooFunction =
::core::option::Option<unsafe extern "C" fn(bar: ::std::os::raw::c_int)>;
thread 'header_use_core_h' panicked at 'Header and binding differ!', /bindgen/target/debug/build/bindgen-f6fdd37f3e51109e/out/tests.rs:6
---- header_layout_mbuf_h stdout ----
diff expected generated
--- expected: "/bindgen/tests/expectations/tests/layout_mbuf.rs"
+++ generated from: "/bindgen/tests/headers/layout_mbuf.h"
/* automatically generated by rust-bindgen */
#![allow(non_snake_case)]
#[repr(C)]
pub struct __BindgenUnionField<T>(::std::marker::PhantomData<T>);
impl <T> __BindgenUnionField<T> {
#[inline]
pub fn new() -> Self { __BindgenUnionField(::std::marker::PhantomData) }
#[inline]
pub unsafe fn as_ref(&self) -> &T { ::std::mem::transmute(self) }
#[inline]
pub unsafe fn as_mut(&mut self) -> &mut T { ::std::mem::transmute(self) }
}
impl <T> ::std::default::Default for __BindgenUnionField<T> {
#[inline]
fn default() -> Self { Self::new() }
}
impl <T> ::std::clone::Clone for __BindgenUnionField<T> {
#[inline]
fn clone(&self) -> Self { Self::new() }
}
impl <T> ::std::marker::Copy for __BindgenUnionField<T> { }
impl <T> ::std::fmt::Debug for __BindgenUnionField<T> {
fn fmt(&self, fmt: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
fmt.write_str("__BindgenUnionField")
}
}
pub const RTE_CACHE_LINE_MIN_SIZE: ::std::os::raw::c_uint = 64;
pub const RTE_CACHE_LINE_SIZE: ::std::os::raw::c_uint = 64;
pub type phys_addr_t = u64;
pub type MARKER = [*mut ::std::os::raw::c_void; 0usize];
pub type MARKER8 = [u8; 0usize];
pub type MARKER64 = [u64; 0usize];
/**
* The atomic counter structure.
*/
#[repr(C)]
#[derive(Debug, Default, Copy)]
pub struct _bindgen_ty_1 {
/**< An internal counter value. */
pub cnt: i16,
}
#[test]
fn bindgen_test_layout__bindgen_ty_1() {
assert_eq!(::std::mem::size_of::<_bindgen_ty_1>() , 2usize , concat ! (
"Size of: " , stringify ! ( _bindgen_ty_1 ) ));
assert_eq! (::std::mem::align_of::<_bindgen_ty_1>() , 2usize , concat ! (
"Alignment of " , stringify ! ( _bindgen_ty_1 ) ));
- assert_eq! (unsafe {
- & ( * ( 0 as * const _bindgen_ty_1 ) ) . cnt as * const _ as
- usize } , 0usize , concat ! (
- "Alignment of field: " , stringify ! ( _bindgen_ty_1 ) , "::"
- , stringify ! ( cnt ) ));
}
impl Clone for _bindgen_ty_1 {
fn clone(&self) -> Self { *self }
}
pub type rte_atomic16_t = _bindgen_ty_1;
/**
* The generic rte_mbuf, containing a packet mbuf.
*/
#[repr(C)]
#[derive(Debug, Copy)]
pub struct rte_mbuf {
pub cacheline0: MARKER,
/**< Virtual address of segment buffer. */
pub buf_addr: *mut ::std::os::raw::c_void,
/**< Physical address of segment buffer. */
pub buf_physaddr: phys_addr_t,
/**< Length of segment buffer. */
pub buf_len: u16,
pub rearm_data: MARKER8,
pub data_off: u16,
pub __bindgen_anon_1: rte_mbuf__bindgen_ty_1,
/**< Number of segments. */
pub nb_segs: u8,
/**< Input port. */
pub port: u8,
/**< Offload features. */
pub ol_flags: u64,
pub rx_descriptor_fields1: MARKER,
pub __bindgen_anon_2: rte_mbuf__bindgen_ty_2,
/**< Total pkt len: sum of all segments. */
pub pkt_len: u32,
/**< Amount of data in segment buffer. */
pub data_len: u16,
/** VLAN TCI (CPU order), valid if PKT_RX_VLAN_STRIPPED is set. */
pub vlan_tci: u16,
/**< hash information */
pub hash: rte_mbuf__bindgen_ty_3,
/**< Sequence number. See also rte_reorder_insert() */
pub seqn: u32,
/** Outer VLAN TCI (CPU order), valid if PKT_RX_QINQ_STRIPPED is set. */
pub vlan_tci_outer: u16,
pub cacheline1: MARKER,
pub __bindgen_anon_3: rte_mbuf__bindgen_ty_4,
/**< Pool from which mbuf was allocated. */
pub pool: *mut rte_mbuf_rte_mempool,
/**< Next segment of scattered packet. */
pub next: *mut rte_mbuf,
pub __bindgen_anon_4: rte_mbuf__bindgen_ty_5,
/** Size of the application private data. In case of an indirect
* mbuf, it stores the direct mbuf private data size. */
pub priv_size: u16,
/** Timesync flags for use with IEEE1588. */
pub timesync: u16,
pub __bindgen_padding_0: [u32; 7usize],
}
/**
* 16-bit Reference counter.
* It should only be accessed using the following functions:
* rte_mbuf_refcnt_update(), rte_mbuf_refcnt_read(), and
* rte_mbuf_refcnt_set(). The functionality of these functions (atomic,
* or non-atomic) is controlled by the CONFIG_RTE_MBUF_REFCNT_ATOMIC
* config option.
*/
#[repr(C)]
#[derive(Debug, Default, Copy)]
pub struct rte_mbuf__bindgen_ty_1 {
/**< Atomically accessed refcnt */
pub refcnt_atomic: __BindgenUnionField<rte_atomic16_t>,
/**< Non-atomically accessed refcnt */
pub refcnt: __BindgenUnionField<u16>,
pub bindgen_union_field: u16,
}
#[test]
fn bindgen_test_layout_rte_mbuf__bindgen_ty_1() {
assert_eq!(::std::mem::size_of::<rte_mbuf__bindgen_ty_1>() , 2usize ,
concat ! ( "Size of: " , stringify ! ( rte_mbuf__bindgen_ty_1 )
));
assert_eq! (::std::mem::align_of::<rte_mbuf__bindgen_ty_1>() , 2usize ,
concat ! (
"Alignment of " , stringify ! ( rte_mbuf__bindgen_ty_1 ) ));
- assert_eq! (unsafe {
- & ( * ( 0 as * const rte_mbuf__bindgen_ty_1 ) ) .
- refcnt_atomic as * const _ as usize } , 0usize , concat ! (
- "Alignment of field: " , stringify ! ( rte_mbuf__bindgen_ty_1
- ) , "::" , stringify ! ( refcnt_atomic ) ));
- assert_eq! (unsafe {
- & ( * ( 0 as * const rte_mbuf__bindgen_ty_1 ) ) . refcnt as *
- const _ as usize } , 0usize , concat ! (
- "Alignment of field: " , stringify ! ( rte_mbuf__bindgen_ty_1
- ) , "::" , stringify ! ( refcnt ) ));
}
impl Clone for rte_mbuf__bindgen_ty_1 {
fn clone(&self) -> Self { *self }
}
#[repr(C)]
#[derive(Debug, Default, Copy)]
pub struct rte_mbuf__bindgen_ty_2 {
/**< L2/L3/L4 and tunnel information. */
pub packet_type: __BindgenUnionField<u32>,
pub __bindgen_anon_1: __BindgenUnionField<rte_mbuf__bindgen_ty_2__bindgen_ty_1>,
pub bindgen_union_field: u32,
}
#[repr(C)]
#[derive(Debug, Default, Copy)]
pub struct rte_mbuf__bindgen_ty_2__bindgen_ty_1 {
pub _bitfield_1: u32,
}
#[test]
fn bindgen_test_layout_rte_mbuf__bindgen_ty_2__bindgen_ty_1() {
assert_eq!(::std::mem::size_of::<rte_mbuf__bindgen_ty_2__bindgen_ty_1>() ,
4usize , concat ! (
"Size of: " , stringify ! (
rte_mbuf__bindgen_ty_2__bindgen_ty_1 ) ));
assert_eq! (::std::mem::align_of::<rte_mbuf__bindgen_ty_2__bindgen_ty_1>()
, 4usize , concat ! (
"Alignment of " , stringify ! (
rte_mbuf__bindgen_ty_2__bindgen_ty_1 ) ));
}
impl Clone for rte_mbuf__bindgen_ty_2__bindgen_ty_1 {
fn clone(&self) -> Self { *self }
}
impl rte_mbuf__bindgen_ty_2__bindgen_ty_1 {
#[inline]
pub fn l2_type(&self) -> u32 {
unsafe {
::std::mem::transmute(((self._bitfield_1 & (15usize as u32)) >>
0u32) as u32)
}
}
#[inline]
pub fn set_l2_type(&mut self, val: u32) {
self._bitfield_1 &= !(15usize as u32);
self._bitfield_1 |= ((val as u32 as u32) << 0u32) & (15usize as u32);
}
#[inline]
pub fn l3_type(&self) -> u32 {
unsafe {
::std::mem::transmute(((self._bitfield_1 & (240usize as u32)) >>
4u32) as u32)
}
}
#[inline]
pub fn set_l3_type(&mut self, val: u32) {
self._bitfield_1 &= !(240usize as u32);
self._bitfield_1 |= ((val as u32 as u32) << 4u32) & (240usize as u32);
}
#[inline]
pub fn l4_type(&self) -> u32 {
unsafe {
::std::mem::transmute(((self._bitfield_1 & (3840usize as u32)) >>
8u32) as u32)
}
}
#[inline]
pub fn set_l4_type(&mut self, val: u32) {
self._bitfield_1 &= !(3840usize as u32);
self._bitfield_1 |=
((val as u32 as u32) << 8u32) & (3840usize as u32);
}
#[inline]
pub fn tun_type(&self) -> u32 {
unsafe {
::std::mem::transmute(((self._bitfield_1 & (61440usize as u32)) >>
12u32) as u32)
}
}
#[inline]
pub fn set_tun_type(&mut self, val: u32) {
self._bitfield_1 &= !(61440usize as u32);
self._bitfield_1 |=
((val as u32 as u32) << 12u32) & (61440usize as u32);
}
#[inline]
pub fn inner_l2_type(&self) -> u32 {
unsafe {
::std::mem::transmute(((self._bitfield_1 & (983040usize as u32))
>> 16u32) as u32)
}
}
#[inline]
pub fn set_inner_l2_type(&mut self, val: u32) {
self._bitfield_1 &= !(983040usize as u32);
self._bitfield_1 |=
((val as u32 as u32) << 16u32) & (983040usize as u32);
}
#[inline]
pub fn inner_l3_type(&self) -> u32 {
unsafe {
::std::mem::transmute(((self._bitfield_1 & (15728640usize as u32))
>> 20u32) as u32)
}
}
#[inline]
pub fn set_inner_l3_type(&mut self, val: u32) {
self._bitfield_1 &= !(15728640usize as u32);
self._bitfield_1 |=
((val as u32 as u32) << 20u32) & (15728640usize as u32);
}
#[inline]
pub fn inner_l4_type(&self) -> u32 {
unsafe {
::std::mem::transmute(((self._bitfield_1 &
(251658240usize as u32)) >> 24u32) as
u32)
}
}
#[inline]
pub fn set_inner_l4_type(&mut self, val: u32) {
self._bitfield_1 &= !(251658240usize as u32);
self._bitfield_1 |=
((val as u32 as u32) << 24u32) & (251658240usize as u32);
}
}
#[test]
fn bindgen_test_layout_rte_mbuf__bindgen_ty_2() {
assert_eq!(::std::mem::size_of::<rte_mbuf__bindgen_ty_2>() , 4usize ,
concat ! ( "Size of: " , stringify ! ( rte_mbuf__bindgen_ty_2 )
));
assert_eq! (::std::mem::align_of::<rte_mbuf__bindgen_ty_2>() , 4usize ,
concat ! (
"Alignment of " , stringify ! ( rte_mbuf__bindgen_ty_2 ) ));
- assert_eq! (unsafe {
- & ( * ( 0 as * const rte_mbuf__bindgen_ty_2 ) ) . packet_type
- as * const _ as usize } , 0usize , concat ! (
- "Alignment of field: " , stringify ! ( rte_mbuf__bindgen_ty_2
- ) , "::" , stringify ! ( packet_type ) ));
}
impl Clone for rte_mbuf__bindgen_ty_2 {
fn clone(&self) -> Self { *self }
}
#[repr(C)]
#[derive(Debug, Default, Copy)]
pub struct rte_mbuf__bindgen_ty_3 {
/**< RSS hash result if RSS enabled */
pub rss: __BindgenUnionField<u32>,
/**< Filter identifier if FDIR enabled */
pub fdir: __BindgenUnionField<rte_mbuf__bindgen_ty_3__bindgen_ty_1>,
/**< Hierarchical scheduler */
pub sched: __BindgenUnionField<rte_mbuf__bindgen_ty_3__bindgen_ty_2>,
/**< User defined tags. See rte_distributor_process() */
pub usr: __BindgenUnionField<u32>,
pub bindgen_union_field: [u32; 2usize],
}
#[repr(C)]
#[derive(Debug, Default, Copy)]
pub struct rte_mbuf__bindgen_ty_3__bindgen_ty_1 {
pub __bindgen_anon_1: rte_mbuf__bindgen_ty_3__bindgen_ty_1__bindgen_ty_1,
pub hi: u32,
}
#[repr(C)]
#[derive(Debug, Default, Copy)]
pub struct rte_mbuf__bindgen_ty_3__bindgen_ty_1__bindgen_ty_1 {
pub __bindgen_anon_1: __BindgenUnionField<rte_mbuf__bindgen_ty_3__bindgen_ty_1__bindgen_ty_1__bindgen_ty_1>,
pub lo: __BindgenUnionField<u32>,
pub bindgen_union_field: u32,
}
#[repr(C)]
#[derive(Debug, Default, Copy)]
pub struct rte_mbuf__bindgen_ty_3__bindgen_ty_1__bindgen_ty_1__bindgen_ty_1 {
pub hash: u16,
pub id: u16,
}
#[test]
fn bindgen_test_layout_rte_mbuf__bindgen_ty_3__bindgen_ty_1__bindgen_ty_1__bindgen_ty_1() {
assert_eq!(::std::mem::size_of::<rte_mbuf__bindgen_ty_3__bindgen_ty_1__bindgen_ty_1__bindgen_ty_1>()
, 4usize , concat ! (
"Size of: " , stringify ! (
rte_mbuf__bindgen_ty_3__bindgen_ty_1__bindgen_ty_1__bindgen_ty_1
) ));
assert_eq! (::std::mem::align_of::<rte_mbuf__bindgen_ty_3__bindgen_ty_1__bindgen_ty_1__bindgen_ty_1>()
, 2usize , concat ! (
"Alignment of " , stringify ! (
rte_mbuf__bindgen_ty_3__bindgen_ty_1__bindgen_ty_1__bindgen_ty_1
) ));
- assert_eq! (unsafe {
- & (
- * (
- 0 as * const
- rte_mbuf__bindgen_ty_3__bindgen_ty_1__bindgen_ty_1__bindgen_ty_1
- ) ) . hash as * const _ as usize } , 0usize , concat ! (
- "Alignment of field: " , stringify ! (
- rte_mbuf__bindgen_ty_3__bindgen_ty_1__bindgen_ty_1__bindgen_ty_1
- ) , "::" , stringify ! ( hash ) ));
- assert_eq! (unsafe {
- & (
- * (
- 0 as * const
- rte_mbuf__bindgen_ty_3__bindgen_ty_1__bindgen_ty_1__bindgen_ty_1
- ) ) . id as * const _ as usize } , 2usize , concat ! (
- "Alignment of field: " , stringify ! (
- rte_mbuf__bindgen_ty_3__bindgen_ty_1__bindgen_ty_1__bindgen_ty_1
- ) , "::" , stringify ! ( id ) ));
}
impl Clone for
rte_mbuf__bindgen_ty_3__bindgen_ty_1__bindgen_ty_1__bindgen_ty_1 {
fn clone(&self) -> Self { *self }
}
#[test]
fn bindgen_test_layout_rte_mbuf__bindgen_ty_3__bindgen_ty_1__bindgen_ty_1() {
assert_eq!(::std::mem::size_of::<rte_mbuf__bindgen_ty_3__bindgen_ty_1__bindgen_ty_1>()
, 4usize , concat ! (
"Size of: " , stringify ! (
rte_mbuf__bindgen_ty_3__bindgen_ty_1__bindgen_ty_1 ) ));
assert_eq! (::std::mem::align_of::<rte_mbuf__bindgen_ty_3__bindgen_ty_1__bindgen_ty_1>()
, 4usize , concat ! (
"Alignment of " , stringify ! (
rte_mbuf__bindgen_ty_3__bindgen_ty_1__bindgen_ty_1 ) ));
- assert_eq! (unsafe {
- & (
- * (
- 0 as * const
- rte_mbuf__bindgen_ty_3__bindgen_ty_1__bindgen_ty_1 ) ) . lo as
- * const _ as usize } , 0usize , concat ! (
- "Alignment of field: " , stringify ! (
- rte_mbuf__bindgen_ty_3__bindgen_ty_1__bindgen_ty_1 ) , "::" ,
- stringify ! ( lo ) ));
}
impl Clone for rte_mbuf__bindgen_ty_3__bindgen_ty_1__bindgen_ty_1 {
fn clone(&self) -> Self { *self }
}
#[test]
fn bindgen_test_layout_rte_mbuf__bindgen_ty_3__bindgen_ty_1() {
assert_eq!(::std::mem::size_of::<rte_mbuf__bindgen_ty_3__bindgen_ty_1>() ,
8usize , concat ! (
"Size of: " , stringify ! (
rte_mbuf__bindgen_ty_3__bindgen_ty_1 ) ));
assert_eq! (::std::mem::align_of::<rte_mbuf__bindgen_ty_3__bindgen_ty_1>()
, 4usize , concat ! (
"Alignment of " , stringify ! (
rte_mbuf__bindgen_ty_3__bindgen_ty_1 ) ));
- assert_eq! (unsafe {
- & ( * ( 0 as * const rte_mbuf__bindgen_ty_3__bindgen_ty_1 ) )
- . hi as * const _ as usize } , 4usize , concat ! (
- "Alignment of field: " , stringify ! (
- rte_mbuf__bindgen_ty_3__bindgen_ty_1 ) , "::" , stringify ! (
- hi ) ));
}
impl Clone for rte_mbuf__bindgen_ty_3__bindgen_ty_1 {
fn clone(&self) -> Self { *self }
}
#[repr(C)]
#[derive(Debug, Default, Copy)]
pub struct rte_mbuf__bindgen_ty_3__bindgen_ty_2 {
pub lo: u32,
pub hi: u32,
}
#[test]
fn bindgen_test_layout_rte_mbuf__bindgen_ty_3__bindgen_ty_2() {
assert_eq!(::std::mem::size_of::<rte_mbuf__bindgen_ty_3__bindgen_ty_2>() ,
8usize , concat ! (
"Size of: " , stringify ! (
rte_mbuf__bindgen_ty_3__bindgen_ty_2 ) ));
assert_eq! (::std::mem::align_of::<rte_mbuf__bindgen_ty_3__bindgen_ty_2>()
, 4usize , concat ! (
"Alignment of " , stringify ! (
rte_mbuf__bindgen_ty_3__bindgen_ty_2 ) ));
- assert_eq! (unsafe {
- & ( * ( 0 as * const rte_mbuf__bindgen_ty_3__bindgen_ty_2 ) )
- . lo as * const _ as usize } , 0usize , concat ! (
- "Alignment of field: " , stringify ! (
- rte_mbuf__bindgen_ty_3__bindgen_ty_2 ) , "::" , stringify ! (
- lo ) ));
- assert_eq! (unsafe {
- & ( * ( 0 as * const rte_mbuf__bindgen_ty_3__bindgen_ty_2 ) )
- . hi as * const _ as usize } , 4usize , concat ! (
- "Alignment of field: " , stringify ! (
- rte_mbuf__bindgen_ty_3__bindgen_ty_2 ) , "::" , stringify ! (
- hi ) ));
}
impl Clone for rte_mbuf__bindgen_ty_3__bindgen_ty_2 {
fn clone(&self) -> Self { *self }
}
#[test]
fn bindgen_test_layout_rte_mbuf__bindgen_ty_3() {
assert_eq!(::std::mem::size_of::<rte_mbuf__bindgen_ty_3>() , 8usize ,
concat ! ( "Size of: " , stringify ! ( rte_mbuf__bindgen_ty_3 )
));
assert_eq! (::std::mem::align_of::<rte_mbuf__bindgen_ty_3>() , 4usize ,
concat ! (
"Alignment of " , stringify ! ( rte_mbuf__bindgen_ty_3 ) ));
- assert_eq! (unsafe {
- & ( * ( 0 as * const rte_mbuf__bindgen_ty_3 ) ) . rss as *
- const _ as usize } , 0usize , concat ! (
- "Alignment of field: " , stringify ! ( rte_mbuf__bindgen_ty_3
- ) , "::" , stringify ! ( rss ) ));
- assert_eq! (unsafe {
- & ( * ( 0 as * const rte_mbuf__bindgen_ty_3 ) ) . fdir as *
- const _ as usize } , 0usize , concat ! (
- "Alignment of field: " , stringify ! ( rte_mbuf__bindgen_ty_3
- ) , "::" , stringify ! ( fdir ) ));
- assert_eq! (unsafe {
- & ( * ( 0 as * const rte_mbuf__bindgen_ty_3 ) ) . sched as *
- const _ as usize } , 0usize , concat ! (
- "Alignment of field: " , stringify ! ( rte_mbuf__bindgen_ty_3
- ) , "::" , stringify ! ( sched ) ));
- assert_eq! (unsafe {
- & ( * ( 0 as * const rte_mbuf__bindgen_ty_3 ) ) . usr as *
- const _ as usize } , 0usize , concat ! (
- "Alignment of field: " , stringify ! ( rte_mbuf__bindgen_ty_3
- ) , "::" , stringify ! ( usr ) ));
}
impl Clone for rte_mbuf__bindgen_ty_3 {
fn clone(&self) -> Self { *self }
}
#[repr(C)]
#[derive(Debug, Default, Copy)]
pub struct rte_mbuf__bindgen_ty_4 {
/**< Can be used for external metadata */
pub userdata: __BindgenUnionField<*mut ::std::os::raw::c_void>,
/**< Allow 8-byte userdata on 32-bit */
pub udata64: __BindgenUnionField<u64>,
pub bindgen_union_field: u64,
}
#[test]
fn bindgen_test_layout_rte_mbuf__bindgen_ty_4() {
assert_eq!(::std::mem::size_of::<rte_mbuf__bindgen_ty_4>() , 8usize ,
concat ! ( "Size of: " , stringify ! ( rte_mbuf__bindgen_ty_4 )
));
assert_eq! (::std::mem::align_of::<rte_mbuf__bindgen_ty_4>() , 8usize ,
concat ! (
"Alignment of " , stringify ! ( rte_mbuf__bindgen_ty_4 ) ));
- assert_eq! (unsafe {
- & ( * ( 0 as * const rte_mbuf__bindgen_ty_4 ) ) . userdata as
- * const _ as usize } , 0usize , concat ! (
- "Alignment of field: " , stringify ! ( rte_mbuf__bindgen_ty_4
- ) , "::" , stringify ! ( userdata ) ));
- assert_eq! (unsafe {
- & ( * ( 0 as * const rte_mbuf__bindgen_ty_4 ) ) . udata64 as *
- const _ as usize } , 0usize , concat ! (
- "Alignment of field: " , stringify ! ( rte_mbuf__bindgen_ty_4
- ) , "::" , stringify ! ( udata64 ) ));
}
impl Clone for rte_mbuf__bindgen_ty_4 {
fn clone(&self) -> Self { *self }
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct rte_mbuf_rte_mempool([u8; 0]);
#[repr(C)]
#[derive(Debug, Default, Copy)]
pub struct rte_mbuf__bindgen_ty_5 {
/**< combined for easy fetch */
pub tx_offload: __BindgenUnionField<u64>,
pub __bindgen_anon_1: __BindgenUnionField<rte_mbuf__bindgen_ty_5__bindgen_ty_1>,
pub bindgen_union_field: u64,
}
#[repr(C)]
#[derive(Debug, Default, Copy)]
pub struct rte_mbuf__bindgen_ty_5__bindgen_ty_1 {
pub _bitfield_1: u64,
}
#[test]
fn bindgen_test_layout_rte_mbuf__bindgen_ty_5__bindgen_ty_1() {
assert_eq!(::std::mem::size_of::<rte_mbuf__bindgen_ty_5__bindgen_ty_1>() ,
8usize , concat ! (
"Size of: " , stringify ! (
rte_mbuf__bindgen_ty_5__bindgen_ty_1 ) ));
assert_eq! (::std::mem::align_of::<rte_mbuf__bindgen_ty_5__bindgen_ty_1>()
, 8usize , concat ! (
"Alignment of " , stringify ! (
rte_mbuf__bindgen_ty_5__bindgen_ty_1 ) ));
}
impl Clone for rte_mbuf__bindgen_ty_5__bindgen_ty_1 {
fn clone(&self) -> Self { *self }
}
impl rte_mbuf__bindgen_ty_5__bindgen_ty_1 {
#[inline]
pub fn l2_len(&self) -> u64 {
unsafe {
::std::mem::transmute(((self._bitfield_1 & (127usize as u64)) >>
0u32) as u64)
}
}
#[inline]
pub fn set_l2_len(&mut self, val: u64) {
self._bitfield_1 &= !(127usize as u64);
self._bitfield_1 |= ((val as u64 as u64) << 0u32) & (127usize as u64);
}
#[inline]
pub fn l3_len(&self) -> u64 {
unsafe {
::std::mem::transmute(((self._bitfield_1 & (65408usize as u64)) >>
7u32) as u64)
}
}
#[inline]
pub fn set_l3_len(&mut self, val: u64) {
self._bitfield_1 &= !(65408usize as u64);
self._bitfield_1 |=
((val as u64 as u64) << 7u32) & (65408usize as u64);
}
#[inline]
pub fn l4_len(&self) -> u64 {
unsafe {
::std::mem::transmute(((self._bitfield_1 & (16711680usize as u64))
>> 16u32) as u64)
}
}
#[inline]
pub fn set_l4_len(&mut self, val: u64) {
self._bitfield_1 &= !(16711680usize as u64);
self._bitfield_1 |=
((val as u64 as u64) << 16u32) & (16711680usize as u64);
}
#[inline]
pub fn tso_segsz(&self) -> u64 {
unsafe {
::std::mem::transmute(((self._bitfield_1 &
(1099494850560usize as u64)) >> 24u32)
as u64)
}
}
#[inline]
pub fn set_tso_segsz(&mut self, val: u64) {
self._bitfield_1 &= !(1099494850560usize as u64);
self._bitfield_1 |=
((val as u64 as u64) << 24u32) & (1099494850560usize as u64);
}
#[inline]
pub fn outer_l3_len(&self) -> u64 {
unsafe {
::std::mem::transmute(((self._bitfield_1 &
(561850441793536usize as u64)) >>
40u32) as u64)
}
}
#[inline]
pub fn set_outer_l3_len(&mut self, val: u64) {
self._bitfield_1 &= !(561850441793536usize as u64);
self._bitfield_1 |=
((val as u64 as u64) << 40u32) & (561850441793536usize as u64);
}
#[inline]
pub fn outer_l2_len(&self) -> u64 {
unsafe {
::std::mem::transmute(((self._bitfield_1 &
(71494644084506624usize as u64)) >>
49u32) as u64)
}
}
#[inline]
pub fn set_outer_l2_len(&mut self, val: u64) {
self._bitfield_1 &= !(71494644084506624usize as u64);
self._bitfield_1 |=
((val as u64 as u64) << 49u32) & (71494644084506624usize as u64);
}
}
#[test]
fn bindgen_test_layout_rte_mbuf__bindgen_ty_5() {
assert_eq!(::std::mem::size_of::<rte_mbuf__bindgen_ty_5>() , 8usize ,
concat ! ( "Size of: " , stringify ! ( rte_mbuf__bindgen_ty_5 )
));
assert_eq! (::std::mem::align_of::<rte_mbuf__bindgen_ty_5>() , 8usize ,
concat ! (
"Alignment of " , stringify ! ( rte_mbuf__bindgen_ty_5 ) ));
- assert_eq! (unsafe {
- & ( * ( 0 as * const rte_mbuf__bindgen_ty_5 ) ) . tx_offload
- as * const _ as usize } , 0usize , concat ! (
- "Alignment of field: " , stringify ! ( rte_mbuf__bindgen_ty_5
- ) , "::" , stringify ! ( tx_offload ) ));
}
impl Clone for rte_mbuf__bindgen_ty_5 {
fn clone(&self) -> Self { *self }
}
#[test]
fn bindgen_test_layout_rte_mbuf() {
assert_eq!(::std::mem::size_of::<rte_mbuf>() , 128usize , concat ! (
"Size of: " , stringify ! ( rte_mbuf ) ));
- assert_eq! (unsafe {
- & ( * ( 0 as * const rte_mbuf ) ) . cacheline0 as * const _ as
- usize } , 0usize , concat ! (
- "Alignment of field: " , stringify ! ( rte_mbuf ) , "::" ,
- stringify ! ( cacheline0 ) ));
- assert_eq! (unsafe {
- & ( * ( 0 as * const rte_mbuf ) ) . buf_addr as * const _ as
- usize } , 0usize , concat ! (
- "Alignment of field: " , stringify ! ( rte_mbuf ) , "::" ,
- stringify ! ( buf_addr ) ));
- assert_eq! (unsafe {
- & ( * ( 0 as * const rte_mbuf ) ) . buf_physaddr as * const _
- as usize } , 8usize , concat ! (
- "Alignment of field: " , stringify ! ( rte_mbuf ) , "::" ,
- stringify ! ( buf_physaddr ) ));
- assert_eq! (unsafe {
- & ( * ( 0 as * const rte_mbuf ) ) . buf_len as * const _ as
- usize } , 16usize , concat ! (
- "Alignment of field: " , stringify ! ( rte_mbuf ) , "::" ,
- stringify ! ( buf_len ) ));
- assert_eq! (unsafe {
- & ( * ( 0 as * const rte_mbuf ) ) . rearm_data as * const _ as
- usize } , 18usize , concat ! (
- "Alignment of field: " , stringify ! ( rte_mbuf ) , "::" ,
- stringify ! ( rearm_data ) ));
- assert_eq! (unsafe {
- & ( * ( 0 as * const rte_mbuf ) ) . data_off as * const _ as
- usize } , 18usize , concat ! (
- "Alignment of field: " , stringify ! ( rte_mbuf ) , "::" ,
- stringify ! ( data_off ) ));
- assert_eq! (unsafe {
- & ( * ( 0 as * const rte_mbuf ) ) . nb_segs as * const _ as
- usize } , 22usize , concat ! (
- "Alignment of field: " , stringify ! ( rte_mbuf ) , "::" ,
- stringify ! ( nb_segs ) ));
- assert_eq! (unsafe {
- & ( * ( 0 as * const rte_mbuf ) ) . port as * const _ as usize
- } , 23usize , concat ! (
- "Alignment of field: " , stringify ! ( rte_mbuf ) , "::" ,
- stringify ! ( port ) ));
- assert_eq! (unsafe {
- & ( * ( 0 as * const rte_mbuf ) ) . ol_flags as * const _ as
- usize } , 24usize , concat ! (
- "Alignment of field: " , stringify ! ( rte_mbuf ) , "::" ,
- stringify ! ( ol_flags ) ));
- assert_eq! (unsafe {
- & ( * ( 0 as * const rte_mbuf ) ) . rx_descriptor_fields1 as *
- const _ as usize } , 32usize , concat ! (
- "Alignment of field: " , stringify ! ( rte_mbuf ) , "::" ,
- stringify ! ( rx_descriptor_fields1 ) ));
- assert_eq! (unsafe {
- & ( * ( 0 as * const rte_mbuf ) ) . pkt_len as * const _ as
- usize } , 36usize , concat ! (
- "Alignment of field: " , stringify ! ( rte_mbuf ) , "::" ,
- stringify ! ( pkt_len ) ));
- assert_eq! (unsafe {
- & ( * ( 0 as * const rte_mbuf ) ) . data_len as * const _ as
- usize } , 40usize , concat ! (
- "Alignment of field: " , stringify ! ( rte_mbuf ) , "::" ,
- stringify ! ( data_len ) ));
- assert_eq! (unsafe {
- & ( * ( 0 as * const rte_mbuf ) ) . vlan_tci as * const _ as
- usize } , 42usize , concat ! (
- "Alignment of field: " , stringify ! ( rte_mbuf ) , "::" ,
- stringify ! ( vlan_tci ) ));
- assert_eq! (unsafe {
- & ( * ( 0 as * const rte_mbuf ) ) . hash as * const _ as usize
- } , 44usize , concat ! (
- "Alignment of field: " , stringify ! ( rte_mbuf ) , "::" ,
- stringify ! ( hash ) ));
- assert_eq! (unsafe {
- & ( * ( 0 as * const rte_mbuf ) ) . seqn as * const _ as usize
- } , 52usize , concat ! (
- "Alignment of field: " , stringify ! ( rte_mbuf ) , "::" ,
- stringify ! ( seqn ) ));
- assert_eq! (unsafe {
- & ( * ( 0 as * const rte_mbuf ) ) . vlan_tci_outer as * const
- _ as usize } , 56usize , concat ! (
- "Alignment of field: " , stringify ! ( rte_mbuf ) , "::" ,
- stringify ! ( vlan_tci_outer ) ));
- assert_eq! (unsafe {
- & ( * ( 0 as * const rte_mbuf ) ) . cacheline1 as * const _ as
- usize } , 64usize , concat ! (
- "Alignment of field: " , stringify ! ( rte_mbuf ) , "::" ,
- stringify ! ( cacheline1 ) ));
- assert_eq! (unsafe {
- & ( * ( 0 as * const rte_mbuf ) ) . pool as * const _ as usize
- } , 72usize , concat ! (
- "Alignment of field: " , stringify ! ( rte_mbuf ) , "::" ,
- stringify ! ( pool ) ));
- assert_eq! (unsafe {
- & ( * ( 0 as * const rte_mbuf ) ) . next as * const _ as usize
- } , 80usize , concat ! (
- "Alignment of field: " , stringify ! ( rte_mbuf ) , "::" ,
- stringify ! ( next ) ));
- assert_eq! (unsafe {
- & ( * ( 0 as * const rte_mbuf ) ) . priv_size as * const _ as
- usize } , 96usize , concat ! (
- "Alignment of field: " , stringify ! ( rte_mbuf ) , "::" ,
- stringify ! ( priv_size ) ));
- assert_eq! (unsafe {
- & ( * ( 0 as * const rte_mbuf ) ) . timesync as * const _ as
- usize } , 98usize , concat ! (
- "Alignment of field: " , stringify ! ( rte_mbuf ) , "::" ,
- stringify ! ( timesync ) ));
}
impl Clone for rte_mbuf {
fn clone(&self) -> Self { *self }
}
impl Default for rte_mbuf {
fn default() -> Self { unsafe { ::std::mem::zeroed() } }
}
thread 'header_layout_mbuf_h' panicked at 'Header and binding differ!', /bindgen/target/debug/build/bindgen-f6fdd37f3e51109e/out/tests.rs:55
---- header_layout_eth_conf_h stdout ----
diff expected generated
--- expected: "/bindgen/tests/expectations/tests/layout_eth_conf.rs"
+++ generated from: "/bindgen/tests/headers/layout_eth_conf.h"
/* automatically generated by rust-bindgen */
#![allow(non_snake_case)]
#[repr(C)]
pub struct __BindgenUnionField<T>(::std::marker::PhantomData<T>);
impl <T> __BindgenUnionField<T> {
#[inline]
pub fn new() -> Self { __BindgenUnionField(::std::marker::PhantomData) }
#[inline]
pub unsafe fn as_ref(&self) -> &T { ::std::mem::transmute(self) }
#[inline]
pub unsafe fn as_mut(&mut self) -> &mut T { ::std::mem::transmute(self) }
}
impl <T> ::std::default::Default for __BindgenUnionField<T> {
#[inline]
fn default() -> Self { Self::new() }
}
impl <T> ::std::clone::Clone for __BindgenUnionField<T> {
#[inline]
fn clone(&self) -> Self { Self::new() }
}
impl <T> ::std::marker::Copy for __BindgenUnionField<T> { }
impl <T> ::std::fmt::Debug for __BindgenUnionField<T> {
fn fmt(&self, fmt: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
fmt.write_str("__BindgenUnionField")
}
}
pub const ETH_MQ_RX_RSS_FLAG: ::std::os::raw::c_uint = 1;
pub const ETH_MQ_RX_DCB_FLAG: ::std::os::raw::c_uint = 2;
pub const ETH_MQ_RX_VMDQ_FLAG: ::std::os::raw::c_uint = 4;
pub const ETH_VMDQ_MAX_VLAN_FILTERS: ::std::os::raw::c_uint = 64;
pub const ETH_DCB_NUM_USER_PRIORITIES: ::std::os::raw::c_uint = 8;
pub const ETH_VMDQ_DCB_NUM_QUEUES: ::std::os::raw::c_uint = 128;
pub const ETH_DCB_NUM_QUEUES: ::std::os::raw::c_uint = 128;
pub const RTE_ETH_FDIR_MAX_FLEXLEN: ::std::os::raw::c_uint = 16;
pub const RTE_ETH_INSET_SIZE_MAX: ::std::os::raw::c_uint = 128;
pub const RTE_ETH_FLOW_UNKNOWN: ::std::os::raw::c_uint = 0;
pub const RTE_ETH_FLOW_RAW: ::std::os::raw::c_uint = 1;
pub const RTE_ETH_FLOW_IPV4: ::std::os::raw::c_uint = 2;
pub const RTE_ETH_FLOW_FRAG_IPV4: ::std::os::raw::c_uint = 3;
pub const RTE_ETH_FLOW_NONFRAG_IPV4_TCP: ::std::os::raw::c_uint = 4;
pub const RTE_ETH_FLOW_NONFRAG_IPV4_UDP: ::std::os::raw::c_uint = 5;
pub const RTE_ETH_FLOW_NONFRAG_IPV4_SCTP: ::std::os::raw::c_uint = 6;
pub const RTE_ETH_FLOW_NONFRAG_IPV4_OTHER: ::std::os::raw::c_uint = 7;
pub const RTE_ETH_FLOW_IPV6: ::std::os::raw::c_uint = 8;
pub const RTE_ETH_FLOW_FRAG_IPV6: ::std::os::raw::c_uint = 9;
pub const RTE_ETH_FLOW_NONFRAG_IPV6_TCP: ::std::os::raw::c_uint = 10;
pub const RTE_ETH_FLOW_NONFRAG_IPV6_UDP: ::std::os::raw::c_uint = 11;
pub const RTE_ETH_FLOW_NONFRAG_IPV6_SCTP: ::std::os::raw::c_uint = 12;
pub const RTE_ETH_FLOW_NONFRAG_IPV6_OTHER: ::std::os::raw::c_uint = 13;
pub const RTE_ETH_FLOW_L2_PAYLOAD: ::std::os::raw::c_uint = 14;
pub const RTE_ETH_FLOW_IPV6_EX: ::std::os::raw::c_uint = 15;
pub const RTE_ETH_FLOW_IPV6_TCP_EX: ::std::os::raw::c_uint = 16;
pub const RTE_ETH_FLOW_IPV6_UDP_EX: ::std::os::raw::c_uint = 17;
pub const RTE_ETH_FLOW_PORT: ::std::os::raw::c_uint = 18;
pub const RTE_ETH_FLOW_VXLAN: ::std::os::raw::c_uint = 19;
pub const RTE_ETH_FLOW_GENEVE: ::std::os::raw::c_uint = 20;
pub const RTE_ETH_FLOW_NVGRE: ::std::os::raw::c_uint = 21;
pub const RTE_ETH_FLOW_MAX: ::std::os::raw::c_uint = 22;
#[repr(u32)]
/**
* A set of values to identify what method is to be used to route
* packets to multiple queues.
*/
#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)]
pub enum rte_eth_rx_mq_mode {
ETH_MQ_RX_NONE = 0,
ETH_MQ_RX_RSS = 1,
ETH_MQ_RX_DCB = 2,
ETH_MQ_RX_DCB_RSS = 3,
ETH_MQ_RX_VMDQ_ONLY = 4,
ETH_MQ_RX_VMDQ_RSS = 5,
ETH_MQ_RX_VMDQ_DCB = 6,
ETH_MQ_RX_VMDQ_DCB_RSS = 7,
}
/**
* A structure used to configure the RX features of an Ethernet port.
*/
#[repr(C)]
#[derive(Debug, Copy)]
pub struct rte_eth_rxmode {
/** The multi-queue packet distribution mode to be used, e.g. RSS. */
pub mq_mode: rte_eth_rx_mq_mode,
/**< Only used if jumbo_frame enabled. */
pub max_rx_pkt_len: u32,
/**< hdr buf size (header_split enabled).*/
pub split_hdr_size: u16,
pub _bitfield_1: u16,
}
#[test]
fn bindgen_test_layout_rte_eth_rxmode() {
assert_eq!(::std::mem::size_of::<rte_eth_rxmode>() , 12usize , concat ! (
"Size of: " , stringify ! ( rte_eth_rxmode ) ));
assert_eq! (::std::mem::align_of::<rte_eth_rxmode>() , 4usize , concat ! (
"Alignment of " , stringify ! ( rte_eth_rxmode ) ));
- assert_eq! (unsafe {
- & ( * ( 0 as * const rte_eth_rxmode ) ) . mq_mode as * const _
- as usize } , 0usize , concat ! (
- "Alignment of field: " , stringify ! ( rte_eth_rxmode ) , "::"
- , stringify ! ( mq_mode ) ));
- assert_eq! (unsafe {
- & ( * ( 0 as * const rte_eth_rxmode ) ) . max_rx_pkt_len as *
- const _ as usize } , 4usize , concat ! (
- "Alignment of field: " , stringify ! ( rte_eth_rxmode ) , "::"
- , stringify ! ( max_rx_pkt_len ) ));
- assert_eq! (unsafe {
- & ( * ( 0 as * const rte_eth_rxmode ) ) . split_hdr_size as *
- const _ as usize } , 8usize , concat ! (
- "Alignment of field: " , stringify ! ( rte_eth_rxmode ) , "::"
- , stringify ! ( split_hdr_size ) ));
}
impl Clone for rte_eth_rxmode {
fn clone(&self) -> Self { *self }
}
impl Default for rte_eth_rxmode {
fn default() -> Self { unsafe { ::std::mem::zeroed() } }
}
impl rte_eth_rxmode {
#[inline]
pub fn header_split(&self) -> u16 {
unsafe {
::std::mem::transmute(((self._bitfield_1 & (1usize as u16)) >>
0u32) as u16)
}
}
#[inline]
pub fn set_header_split(&mut self, val: u16) {
self._bitfield_1 &= !(1usize as u16);
self._bitfield_1 |= ((val as u16 as u16) << 0u32) & (1usize as u16);
}
#[inline]
pub fn hw_ip_checksum(&self) -> u16 {
unsafe {
::std::mem::transmute(((self._bitfield_1 & (2usize as u16)) >>
1u32) as u16)
}
}
#[inline]
pub fn set_hw_ip_checksum(&mut self, val: u16) {
self._bitfield_1 &= !(2usize as u16);
self._bitfield_1 |= ((val as u16 as u16) << 1u32) & (2usize as u16);
}
#[inline]
pub fn hw_vlan_filter(&self) -> u16 {
unsafe {
::std::mem::transmute(((self._bitfield_1 & (4usize as u16)) >>
2u32) as u16)
}
}
#[inline]
pub fn set_hw_vlan_filter(&mut self, val: u16) {
self._bitfield_1 &= !(4usize as u16);
self._bitfield_1 |= ((val as u16 as u16) << 2u32) & (4usize as u16);
}
#[inline]
pub fn hw_vlan_strip(&self) -> u16 {
unsafe {
::std::mem::transmute(((self._bitfield_1 & (8usize as u16)) >>
3u32) as u16)
}
}
#[inline]
pub fn set_hw_vlan_strip(&mut self, val: u16) {
self._bitfield_1 &= !(8usize as u16);
self._bitfield_1 |= ((val as u16 as u16) << 3u32) & (8usize as u16);
}
#[inline]
pub fn hw_vlan_extend(&self) -> u16 {
unsafe {
::std::mem::transmute(((self._bitfield_1 & (16usize as u16)) >>
4u32) as u16)
}
}
#[inline]
pub fn set_hw_vlan_extend(&mut self, val: u16) {
self._bitfield_1 &= !(16usize as u16);
self._bitfield_1 |= ((val as u16 as u16) << 4u32) & (16usize as u16);
}
#[inline]
pub fn jumbo_frame(&self) -> u16 {
unsafe {
::std::mem::transmute(((self._bitfield_1 & (32usize as u16)) >>
5u32) as u16)
}
}
#[inline]
pub fn set_jumbo_frame(&mut self, val: u16) {
self._bitfield_1 &= !(32usize as u16);
self._bitfield_1 |= ((val as u16 as u16) << 5u32) & (32usize as u16);
}
#[inline]
pub fn hw_strip_crc(&self) -> u16 {
unsafe {
::std::mem::transmute(((self._bitfield_1 & (64usize as u16)) >>
6u32) as u16)
}
}
#[inline]
pub fn set_hw_strip_crc(&mut self, val: u16) {
self._bitfield_1 &= !(64usize as u16);
self._bitfield_1 |= ((val as u16 as u16) << 6u32) & (64usize as u16);
}
#[inline]
pub fn enable_scatter(&self) -> u16 {
unsafe {
::std::mem::transmute(((self._bitfield_1 & (128usize as u16)) >>
7u32) as u16)
}
}
#[inline]
pub fn set_enable_scatter(&mut self, val: u16) {
self._bitfield_1 &= !(128usize as u16);
self._bitfield_1 |= ((val as u16 as u16) << 7u32) & (128usize as u16);
}
#[inline]
pub fn enable_lro(&self) -> u16 {
unsafe {
::std::mem::transmute(((self._bitfield_1 & (256usize as u16)) >>
8u32) as u16)
}
}
#[inline]
pub fn set_enable_lro(&mut self, val: u16) {
self._bitfield_1 &= !(256usize as u16);
self._bitfield_1 |= ((val as u16 as u16) << 8u32) & (256usize as u16);
}
}
#[repr(u32)]
/**
* A set of values to identify what method is to be used to transmit
* packets using multi-TCs.
*/
#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)]
pub enum rte_eth_tx_mq_mode {
ETH_MQ_TX_NONE = 0,
ETH_MQ_TX_DCB = 1,
ETH_MQ_TX_VMDQ_DCB = 2,
ETH_MQ_TX_VMDQ_ONLY = 3,
}
/**
* A structure used to configure the TX features of an Ethernet port.
*/
#[repr(C)]
#[derive(Debug, Copy)]
pub struct rte_eth_txmode {
/**< TX multi-queues mode. */
pub mq_mode: rte_eth_tx_mq_mode,
pub pvid: u16,
pub _bitfield_1: u8,
}
#[test]
fn bindgen_test_layout_rte_eth_txmode() {
assert_eq!(::std::mem::size_of::<rte_eth_txmode>() , 8usize , concat ! (
"Size of: " , stringify ! ( rte_eth_txmode ) ));
assert_eq! (::std::mem::align_of::<rte_eth_txmode>() , 4usize , concat ! (
"Alignment of " , stringify ! ( rte_eth_txmode ) ));
- assert_eq! (unsafe {
- & ( * ( 0 as * const rte_eth_txmode ) ) . mq_mode as * const _
- as usize } , 0usize , concat ! (
- "Alignment of field: " , stringify ! ( rte_eth_txmode ) , "::"
- , stringify ! ( mq_mode ) ));
- assert_eq! (unsafe {
- & ( * ( 0 as * const rte_eth_txmode ) ) . pvid as * const _ as
- usize } , 4usize , concat ! (
- "Alignment of field: " , stringify ! ( rte_eth_txmode ) , "::"
- , stringify ! ( pvid ) ));
}
impl Clone for rte_eth_txmode {
fn clone(&self) -> Self { *self }
}
impl Default for rte_eth_txmode {
fn default() -> Self { unsafe { ::std::mem::zeroed() } }
}
impl rte_eth_txmode {
#[inline]
pub fn hw_vlan_reject_tagged(&self) -> u8 {
unsafe {
::std::mem::transmute(((self._bitfield_1 & (1usize as u8)) >>
0u32) as u8)
}
}
#[inline]
pub fn set_hw_vlan_reject_tagged(&mut self, val: u8) {
self._bitfield_1 &= !(1usize as u8);
self._bitfield_1 |= ((val as u8 as u8) << 0u32) & (1usize as u8);
}
#[inline]
pub fn hw_vlan_reject_untagged(&self) -> u8 {
unsafe {
::std::mem::transmute(((self._bitfield_1 & (2usize as u8)) >>
1u32) as u8)
}
}
#[inline]
pub fn set_hw_vlan_reject_untagged(&mut self, val: u8) {
self._bitfield_1 &= !(2usize as u8);
self._bitfield_1 |= ((val as u8 as u8) << 1u32) & (2usize as u8);
}
#[inline]
pub fn hw_vlan_insert_pvid(&self) -> u8 {
unsafe {
::std::mem::transmute(((self._bitfield_1 & (4usize as u8)) >>
2u32) as u8)
}
}
#[inline]
pub fn set_hw_vlan_insert_pvid(&mut self, val: u8) {
self._bitfield_1 &= !(4usize as u8);
self._bitfield_1 |= ((val as u8 as u8) << 2u32) & (4usize as u8);
}
}
/**
* A structure used to configure the Receive Side Scaling (RSS) feature
* of an Ethernet port.
* If not NULL, the *rss_key* pointer of the *rss_conf* structure points
* to an array holding the RSS key to use for hashing specific header
* fields of received packets. The length of this array should be indicated
* by *rss_key_len* below. Otherwise, a default random hash key is used by
* the device driver.
*
* The *rss_key_len* field of the *rss_conf* structure indicates the length
* in bytes of the array pointed by *rss_key*. To be compatible, this length
* will be checked in i40e only. Others assume 40 bytes to be used as before.
*
* The *rss_hf* field of the *rss_conf* structure indicates the different
* types of IPv4/IPv6 packets to which the RSS hashing must be applied.
* Supplying an *rss_hf* equal to zero disables the RSS feature.
*/
#[repr(C)]
#[derive(Debug, Copy)]
pub struct rte_eth_rss_conf {
/**< If not NULL, 40-byte hash key. */
pub rss_key: *mut u8,
/**< hash key length in bytes. */
pub rss_key_len: u8,
/**< Hash functions to apply - see below. */
pub rss_hf: u64,
}
#[test]
fn bindgen_test_layout_rte_eth_rss_conf() {
assert_eq!(::std::mem::size_of::<rte_eth_rss_conf>() , 24usize , concat !
( "Size of: " , stringify ! ( rte_eth_rss_conf ) ));
assert_eq! (::std::mem::align_of::<rte_eth_rss_conf>() , 8usize , concat !
( "Alignment of " , stringify ! ( rte_eth_rss_conf ) ));
- assert_eq! (unsafe {
- & ( * ( 0 as * const rte_eth_rss_conf ) ) . rss_key as * const
- _ as usize } , 0usize , concat ! (
- "Alignment of field: " , stringify ! ( rte_eth_rss_conf ) ,
- "::" , stringify ! ( rss_key ) ));
- assert_eq! (unsafe {
- & ( * ( 0 as * const rte_eth_rss_conf ) ) . rss_key_len as *
- const _ as usize } , 8usize , concat ! (
- "Alignment of field: " , stringify ! ( rte_eth_rss_conf ) ,
- "::" , stringify ! ( rss_key_len ) ));
- assert_eq! (unsafe {
- & ( * ( 0 as * const rte_eth_rss_conf ) ) . rss_hf as * const
- _ as usize } , 16usize , concat ! (
- "Alignment of field: " , stringify ! ( rte_eth_rss_conf ) ,
- "::" , stringify ! ( rss_hf ) ));
}
impl Clone for rte_eth_rss_conf {
fn clone(&self) -> Self { *self }
}
impl Default for rte_eth_rss_conf {
fn default() -> Self { unsafe { ::std::mem::zeroed() } }
}
#[repr(u32)]
/**
* This enum indicates the possible number of traffic classes
* in DCB configratioins
*/
#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)]
pub enum rte_eth_nb_tcs { ETH_4_TCS = 4, ETH_8_TCS = 8, }
#[repr(u32)]
/**
* This enum indicates the possible number of queue pools
* in VMDQ configurations.
*/
#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)]
pub enum rte_eth_nb_pools {
ETH_8_POOLS = 8,
ETH_16_POOLS = 16,
ETH_32_POOLS = 32,
ETH_64_POOLS = 64,
}
/**
* A structure used to configure the VMDQ+DCB feature
* of an Ethernet port.
*
* Using this feature, packets are routed to a pool of queues, based
* on the vlan id in the vlan tag, and then to a specific queue within
* that pool, using the user priority vlan tag field.
*
* A default pool may be used, if desired, to route all traffic which
* does not match the vlan filter rules.
*/
#[repr(C)]
pub struct rte_eth_vmdq_dcb_conf {
/**< With DCB, 16 or 32 pools */
pub nb_queue_pools: rte_eth_nb_pools,
/**< If non-zero, use a default pool */
pub enable_default_pool: u8,
/**< The default pool, if applicable */
pub default_pool: u8,
/**< We can have up to 64 filters/mappings */
pub nb_pool_maps: u8,
/**< VMDq vlan pool maps. */
pub pool_map: [rte_eth_vmdq_dcb_conf__bindgen_ty_1; 64usize],
pub dcb_tc: [u8; 8usize],
}
#[repr(C)]
#[derive(Debug, Default, Copy)]
pub struct rte_eth_vmdq_dcb_conf__bindgen_ty_1 {
/**< The vlan id of the received frame */
pub vlan_id: u16,
/**< Bitmask of pools for packet rx */
pub pools: u64,
}
#[test]
fn bindgen_test_layout_rte_eth_vmdq_dcb_conf__bindgen_ty_1() {
assert_eq!(::std::mem::size_of::<rte_eth_vmdq_dcb_conf__bindgen_ty_1>() ,
16usize , concat ! (
"Size of: " , stringify ! ( rte_eth_vmdq_dcb_conf__bindgen_ty_1
) ));
assert_eq! (::std::mem::align_of::<rte_eth_vmdq_dcb_conf__bindgen_ty_1>()
, 8usize , concat ! (
"Alignment of " , stringify ! (
rte_eth_vmdq_dcb_conf__bindgen_ty_1 ) ));
- assert_eq! (unsafe {
- & ( * ( 0 as * const rte_eth_vmdq_dcb_conf__bindgen_ty_1 ) ) .
- vlan_id as * const _ as usize } , 0usize , concat ! (
- "Alignment of field: " , stringify ! (
- rte_eth_vmdq_dcb_conf__bindgen_ty_1 ) , "::" , stringify ! (
- vlan_id ) ));
- assert_eq! (unsafe {
- & ( * ( 0 as * const rte_eth_vmdq_dcb_conf__bindgen_ty_1 ) ) .
- pools as * const _ as usize } , 8usize , concat ! (
- "Alignment of field: " , stringify ! (
- rte_eth_vmdq_dcb_conf__bindgen_ty_1 ) , "::" , stringify ! (
- pools ) ));
}
impl Clone for rte_eth_vmdq_dcb_conf__bindgen_ty_1 {
fn clone(&self) -> Self { *self }
}
#[test]
fn bindgen_test_layout_rte_eth_vmdq_dcb_conf() {
assert_eq!(::std::mem::size_of::<rte_eth_vmdq_dcb_conf>() , 1040usize ,
concat ! ( "Size of: " , stringify ! ( rte_eth_vmdq_dcb_conf )
));
assert_eq! (::std::mem::align_of::<rte_eth_vmdq_dcb_conf>() , 8usize ,
concat ! (
"Alignment of " , stringify ! ( rte_eth_vmdq_dcb_conf ) ));
- assert_eq! (unsafe {
- & ( * ( 0 as * const rte_eth_vmdq_dcb_conf ) ) .
- nb_queue_pools as * const _ as usize } , 0usize , concat ! (
- "Alignment of field: " , stringify ! ( rte_eth_vmdq_dcb_conf )
- , "::" , stringify ! ( nb_queue_pools ) ));
- assert_eq! (unsafe {
- & ( * ( 0 as * const rte_eth_vmdq_dcb_conf ) ) .
- enable_default_pool as * const _ as usize } , 4usize , concat
- ! (
- "Alignment of field: " , stringify ! ( rte_eth_vmdq_dcb_conf )
- , "::" , stringify ! ( enable_default_pool ) ));
- assert_eq! (unsafe {
- & ( * ( 0 as * const rte_eth_vmdq_dcb_conf ) ) . default_pool
- as * const _ as usize } , 5usize , concat ! (
- "Alignment of field: " , stringify ! ( rte_eth_vmdq_dcb_conf )
- , "::" , stringify ! ( default_pool ) ));
- assert_eq! (unsafe {
- & ( * ( 0 as * const rte_eth_vmdq_dcb_conf ) ) . nb_pool_maps
- as * const _ as usize } , 6usize , concat ! (
- "Alignment of field: " , stringify ! ( rte_eth_vmdq_dcb_conf )
- , "::" , stringify ! ( nb_pool_maps ) ));
- assert_eq! (unsafe {
- & ( * ( 0 as * const rte_eth_vmdq_dcb_conf ) ) . pool_map as *
- const _ as usize } , 8usize , concat ! (
- "Alignment of field: " , stringify ! ( rte_eth_vmdq_dcb_conf )
- , "::" , stringify ! ( pool_map ) ));
- assert_eq! (unsafe {
- & ( * ( 0 as * const rte_eth_vmdq_dcb_conf ) ) . dcb_tc as *
- const _ as usize } , 1032usize , concat ! (
- "Alignment of field: " , stringify ! ( rte_eth_vmdq_dcb_conf )
- , "::" , stringify ! ( dcb_tc ) ));
}
impl Default for rte_eth_vmdq_dcb_conf {
fn default() -> Self { unsafe { ::std::mem::zeroed() } }
}
#[repr(C)]
#[derive(Debug, Copy)]
pub struct rte_eth_dcb_rx_conf {
/**< Possible DCB TCs, 4 or 8 TCs */
pub nb_tcs: rte_eth_nb_tcs,
/** Traffic class each UP mapped to. */
pub dcb_tc: [u8; 8usize],
}
#[test]
fn bindgen_test_layout_rte_eth_dcb_rx_conf() {
assert_eq!(::std::mem::size_of::<rte_eth_dcb_rx_conf>() , 12usize , concat
! ( "Size of: " , stringify ! ( rte_eth_dcb_rx_conf ) ));
assert_eq! (::std::mem::align_of::<rte_eth_dcb_rx_conf>() , 4usize ,
concat ! (
"Alignment of " , stringify ! ( rte_eth_dcb_rx_conf ) ));
- assert_eq! (unsafe {
- & ( * ( 0 as * const rte_eth_dcb_rx_conf ) ) . nb_tcs as *
- const _ as usize } , 0usize , concat ! (
- "Alignment of field: " , stringify ! ( rte_eth_dcb_rx_conf ) ,
- "::" , stringify ! ( nb_tcs ) ));
- assert_eq! (unsafe {
- & ( * ( 0 as * const rte_eth_dcb_rx_conf ) ) . dcb_tc as *
- const _ as usize } , 4usize , concat ! (
- "Alignment of field: " , stringify ! ( rte_eth_dcb_rx_conf ) ,
- "::" , stringify ! ( dcb_tc ) ));
}
impl Clone for rte_eth_dcb_rx_conf {
fn clone(&self) -> Self { *self }
}
impl Default for rte_eth_dcb_rx_conf {
fn default() -> Self { unsafe { ::std::mem::zeroed() } }
}
#[repr(C)]
#[derive(Debug, Copy)]
pub struct rte_eth_vmdq_dcb_tx_conf {
/**< With DCB, 16 or 32 pools. */
pub nb_queue_pools: rte_eth_nb_pools,
/** Traffic class each UP mapped to. */
pub dcb_tc: [u8; 8usize],
}
#[test]
fn bindgen_test_layout_rte_eth_vmdq_dcb_tx_conf() {
assert_eq!(::std::mem::size_of::<rte_eth_vmdq_dcb_tx_conf>() , 12usize ,
concat ! (
"Size of: " , stringify ! ( rte_eth_vmdq_dcb_tx_conf ) ));
assert_eq! (::std::mem::align_of::<rte_eth_vmdq_dcb_tx_conf>() , 4usize ,
concat ! (
"Alignment of " , stringify ! ( rte_eth_vmdq_dcb_tx_conf ) ));
- assert_eq! (unsafe {
- & ( * ( 0 as * const rte_eth_vmdq_dcb_tx_conf ) ) .
- nb_queue_pools as * const _ as usize } , 0usize , concat ! (
- "Alignment of field: " , stringify ! (
- rte_eth_vmdq_dcb_tx_conf ) , "::" , stringify ! (
- nb_queue_pools ) ));
- assert_eq! (unsafe {
- & ( * ( 0 as * const rte_eth_vmdq_dcb_tx_conf ) ) . dcb_tc as
- * const _ as usize } , 4usize , concat ! (
- "Alignment of field: " , stringify ! (
- rte_eth_vmdq_dcb_tx_conf ) , "::" , stringify ! ( dcb_tc ) ));
}
impl Clone for rte_eth_vmdq_dcb_tx_conf {
fn clone(&self) -> Self { *self }
}
impl Default for rte_eth_vmdq_dcb_tx_conf {
fn default() -> Self { unsafe { ::std::mem::zeroed() } }
}
#[repr(C)]
#[derive(Debug, Copy)]
pub struct rte_eth_dcb_tx_conf {
/**< Possible DCB TCs, 4 or 8 TCs. */
pub nb_tcs: rte_eth_nb_tcs,
/** Traffic class each UP mapped to. */
pub dcb_tc: [u8; 8usize],
}
#[test]
fn bindgen_test_layout_rte_eth_dcb_tx_conf() {
assert_eq!(::std::mem::size_of::<rte_eth_dcb_tx_conf>() , 12usize , concat
! ( "Size of: " , stringify ! ( rte_eth_dcb_tx_conf ) ));
assert_eq! (::std::mem::align_of::<rte_eth_dcb_tx_conf>() , 4usize ,
concat ! (
"Alignment of " , stringify ! ( rte_eth_dcb_tx_conf ) ));
- assert_eq! (unsafe {
- & ( * ( 0 as * const rte_eth_dcb_tx_conf ) ) . nb_tcs as *
- const _ as usize } , 0usize , concat ! (
- "Alignment of field: " , stringify ! ( rte_eth_dcb_tx_conf ) ,
- "::" , stringify ! ( nb_tcs ) ));
- assert_eq! (unsafe {
- & ( * ( 0 as * const rte_eth_dcb_tx_conf ) ) . dcb_tc as *
- const _ as usize } , 4usize , concat ! (
- "Alignment of field: " , stringify ! ( rte_eth_dcb_tx_conf ) ,
- "::" , stringify ! ( dcb_tc ) ));
}
impl Clone for rte_eth_dcb_tx_conf {
fn clone(&self) -> Self { *self }
}
impl Default for rte_eth_dcb_tx_conf {
fn default() -> Self { unsafe { ::std::mem::zeroed() } }
}
#[repr(C)]
#[derive(Debug, Copy)]
pub struct rte_eth_vmdq_tx_conf {
/**< VMDq mode, 64 pools. */
pub nb_queue_pools: rte_eth_nb_pools,
}
#[test]
fn bindgen_test_layout_rte_eth_vmdq_tx_conf() {
assert_eq!(::std::mem::size_of::<rte_eth_vmdq_tx_conf>() , 4usize , concat
! ( "Size of: " , stringify ! ( rte_eth_vmdq_tx_conf ) ));
assert_eq! (::std::mem::align_of::<rte_eth_vmdq_tx_conf>() , 4usize ,
concat ! (
"Alignment of " , stringify ! ( rte_eth_vmdq_tx_conf ) ));
- assert_eq! (unsafe {
- & ( * ( 0 as * const rte_eth_vmdq_tx_conf ) ) . nb_queue_pools
- as * const _ as usize } , 0usize , concat ! (
- "Alignment of field: " , stringify ! ( rte_eth_vmdq_tx_conf )
- , "::" , stringify ! ( nb_queue_pools ) ));
}
impl Clone for rte_eth_vmdq_tx_conf {
fn clone(&self) -> Self { *self }
}
impl Default for rte_eth_vmdq_tx_conf {
fn default() -> Self { unsafe { ::std::mem::zeroed() } }
}
#[repr(C)]
pub struct rte_eth_vmdq_rx_conf {
/**< VMDq only mode, 8 or 64 pools */
pub nb_queue_pools: rte_eth_nb_pools,
/**< If non-zero, use a default pool */
pub enable_default_pool: u8,
/**< The default pool, if applicable */
pub default_pool: u8,
/**< Enable VT loop back */
pub enable_loop_back: u8,
/**< We can have up to 64 filters/mappings */
pub nb_pool_maps: u8,
/**< Flags from ETH_VMDQ_ACCEPT_* */
pub rx_mode: u32,
/**< VMDq vlan pool maps. */
pub pool_map: [rte_eth_vmdq_rx_conf__bindgen_ty_1; 64usize],
}
#[repr(C)]
#[derive(Debug, Default, Copy)]
pub struct rte_eth_vmdq_rx_conf__bindgen_ty_1 {
/**< The vlan id of the received frame */
pub vlan_id: u16,
/**< Bitmask of pools for packet rx */
pub pools: u64,
}
#[test]
fn bindgen_test_layout_rte_eth_vmdq_rx_conf__bindgen_ty_1() {
assert_eq!(::std::mem::size_of::<rte_eth_vmdq_rx_conf__bindgen_ty_1>() ,
16usize , concat ! (
"Size of: " , stringify ! ( rte_eth_vmdq_rx_conf__bindgen_ty_1
) ));
assert_eq! (::std::mem::align_of::<rte_eth_vmdq_rx_conf__bindgen_ty_1>() ,
8usize , concat ! (
"Alignment of " , stringify ! (
rte_eth_vmdq_rx_conf__bindgen_ty_1 ) ));
- assert_eq! (unsafe {
- & ( * ( 0 as * const rte_eth_vmdq_rx_conf__bindgen_ty_1 ) ) .
- vlan_id as * const _ as usize } , 0usize , concat ! (
- "Alignment of field: " , stringify ! (
- rte_eth_vmdq_rx_conf__bindgen_ty_1 ) , "::" , stringify ! (
- vlan_id ) ));
- assert_eq! (unsafe {
- & ( * ( 0 as * const rte_eth_vmdq_rx_conf__bindgen_ty_1 ) ) .
- pools as * const _ as usize } , 8usize , concat ! (
- "Alignment of field: " , stringify ! (
- rte_eth_vmdq_rx_conf__bindgen_ty_1 ) , "::" , stringify ! (
- pools ) ));
}
impl Clone for rte_eth_vmdq_rx_conf__bindgen_ty_1 {
fn clone(&self) -> Self { *self }
}
#[test]
fn bindgen_test_layout_rte_eth_vmdq_rx_conf() {
assert_eq!(::std::mem::size_of::<rte_eth_vmdq_rx_conf>() , 1040usize ,
concat ! ( "Size of: " , stringify ! ( rte_eth_vmdq_rx_conf )
));
assert_eq! (::std::mem::align_of::<rte_eth_vmdq_rx_conf>() , 8usize ,
concat ! (
"Alignment of " , stringify ! ( rte_eth_vmdq_rx_conf ) ));
- assert_eq! (unsafe {
- & ( * ( 0 as * const rte_eth_vmdq_rx_conf ) ) . nb_queue_pools
- as * const _ as usize } , 0usize , concat ! (
- "Alignment of field: " , stringify ! ( rte_eth_vmdq_rx_conf )
- , "::" , stringify ! ( nb_queue_pools ) ));
- assert_eq! (unsafe {
- & ( * ( 0 as * const rte_eth_vmdq_rx_conf ) ) .
- enable_default_pool as * const _ as usize } , 4usize , concat
- ! (
- "Alignment of field: " , stringify ! ( rte_eth_vmdq_rx_conf )
- , "::" , stringify ! ( enable_default_pool ) ));
- assert_eq! (unsafe {
- & ( * ( 0 as * const rte_eth_vmdq_rx_conf ) ) . default_pool
- as * const _ as usize } , 5usize , concat ! (
- "Alignment of field: " , stringify ! ( rte_eth_vmdq_rx_conf )
- , "::" , stringify ! ( default_pool ) ));
- assert_eq! (unsafe {
- & ( * ( 0 as * const rte_eth_vmdq_rx_conf ) ) .
- enable_loop_back as * const _ as usize } , 6usize , concat ! (
- "Alignment of field: " , stringify ! ( rte_eth_vmdq_rx_conf )
- , "::" , stringify ! ( enable_loop_back ) ));
- assert_eq! (unsafe {
- & ( * ( 0 as * const rte_eth_vmdq_rx_conf ) ) . nb_pool_maps
- as * const _ as usize } , 7usize , concat ! (
- "Alignment of field: " , stringify ! ( rte_eth_vmdq_rx_conf )
- , "::" , stringify ! ( nb_pool_maps ) ));
- assert_eq! (unsafe {
- & ( * ( 0 as * const rte_eth_vmdq_rx_conf ) ) . rx_mode as *
- const _ as usize } , 8usize , concat ! (
- "Alignment of field: " , stringify ! ( rte_eth_vmdq_rx_conf )
- , "::" , stringify ! ( rx_mode ) ));
- assert_eq! (unsafe {
- & ( * ( 0 as * const rte_eth_vmdq_rx_conf ) ) . pool_map as *
- const _ as usize } , 16usize , concat ! (
- "Alignment of field: " , stringify ! ( rte_eth_vmdq_rx_conf )
- , "::" , stringify ! ( pool_map ) ));
}
impl Default for rte_eth_vmdq_rx_conf {
fn default() -> Self { unsafe { ::std::mem::zeroed() } }
}
#[repr(u32)]
/**
* Flow Director setting modes: none, signature or perfect.
*/
#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)]
pub enum rte_fdir_mode {
RTE_FDIR_MODE_NONE = 0,
RTE_FDIR_MODE_SIGNATURE = 1,
RTE_FDIR_MODE_PERFECT = 2,
RTE_FDIR_MODE_PERFECT_MAC_VLAN = 3,
RTE_FDIR_MODE_PERFECT_TUNNEL = 4,
}
#[repr(u32)]
/**
* Memory space that can be configured to store Flow Director filters
* in the board memory.
*/
#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)]
pub enum rte_fdir_pballoc_type {
RTE_FDIR_PBALLOC_64K = 0,
RTE_FDIR_PBALLOC_128K = 1,
RTE_FDIR_PBALLOC_256K = 2,
}
#[repr(u32)]
/**
* Select report mode of FDIR hash information in RX descriptors.
*/
#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)]
pub enum rte_fdir_status_mode {
RTE_FDIR_NO_REPORT_STATUS = 0,
RTE_FDIR_REPORT_STATUS = 1,
RTE_FDIR_REPORT_STATUS_ALWAYS = 2,
}
/**
* A structure used to define the input for IPV4 flow
*/
#[repr(C)]
#[derive(Debug, Default, Copy)]
pub struct rte_eth_ipv4_flow {
/**< IPv4 source address in big endian. */
pub src_ip: u32,
/**< IPv4 destination address in big endian. */
pub dst_ip: u32,
/**< Type of service to match. */
pub tos: u8,
/**< Time to live to match. */
pub ttl: u8,
/**< Protocol, next header in big endian. */
pub proto: u8,
}
#[test]
fn bindgen_test_layout_rte_eth_ipv4_flow() {
assert_eq!(::std::mem::size_of::<rte_eth_ipv4_flow>() , 12usize , concat !
( "Size of: " , stringify ! ( rte_eth_ipv4_flow ) ));
assert_eq! (::std::mem::align_of::<rte_eth_ipv4_flow>() , 4usize , concat
! ( "Alignment of " , stringify ! ( rte_eth_ipv4_flow ) ));
- assert_eq! (unsafe {
- & ( * ( 0 as * const rte_eth_ipv4_flow ) ) . src_ip as * const
- _ as usize } , 0usize , concat ! (
- "Alignment of field: " , stringify ! ( rte_eth_ipv4_flow ) ,
- "::" , stringify ! ( src_ip ) ));
- assert_eq! (unsafe {
- & ( * ( 0 as * const rte_eth_ipv4_flow ) ) . dst_ip as * const
- _ as usize } , 4usize , concat ! (
- "Alignment of field: " , stringify ! ( rte_eth_ipv4_flow ) ,
- "::" , stringify ! ( dst_ip ) ));
- assert_eq! (unsafe {
- & ( * ( 0 as * const rte_eth_ipv4_flow ) ) . tos as * const _
- as usize } , 8usize , concat ! (
- "Alignment of field: " , stringify ! ( rte_eth_ipv4_flow ) ,
- "::" , stringify ! ( tos ) ));
- assert_eq! (unsafe {
- & ( * ( 0 as * const rte_eth_ipv4_flow ) ) . ttl as * const _
- as usize } , 9usize , concat ! (
- "Alignment of field: " , stringify ! ( rte_eth_ipv4_flow ) ,
- "::" , stringify ! ( ttl ) ));
- assert_eq! (unsafe {
- & ( * ( 0 as * const rte_eth_ipv4_flow ) ) . proto as * const
- _ as usize } , 10usize , concat ! (
- "Alignment of field: " , stringify ! ( rte_eth_ipv4_flow ) ,
- "::" , stringify ! ( proto ) ));
}
impl Clone for rte_eth_ipv4_flow {
fn clone(&self) -> Self { *self }
}
/**
* A structure used to define the input for IPV6 flow
*/
#[repr(C)]
#[derive(Debug, Default, Copy)]
pub struct rte_eth_ipv6_flow {
/**< IPv6 source address in big endian. */
pub src_ip: [u32; 4usize],
/**< IPv6 destination address in big endian. */
pub dst_ip: [u32; 4usize],
/**< Traffic class to match. */
pub tc: u8,
/**< Protocol, next header to match. */
pub proto: u8,
/**< Hop limits to match. */
pub hop_limits: u8,
}
#[test]
fn bindgen_test_layout_rte_eth_ipv6_flow() {
assert_eq!(::std::mem::size_of::<rte_eth_ipv6_flow>() , 36usize , concat !
( "Size of: " , stringify ! ( rte_eth_ipv6_flow ) ));
assert_eq! (::std::mem::align_of::<rte_eth_ipv6_flow>() , 4usize , concat
! ( "Alignment of " , stringify ! ( rte_eth_ipv6_flow ) ));
- assert_eq! (unsafe {
- & ( * ( 0 as * const rte_eth_ipv6_flow ) ) . src_ip as * const
- _ as usize } , 0usize , concat ! (
- "Alignment of field: " , stringify ! ( rte_eth_ipv6_flow ) ,
- "::" , stringify ! ( src_ip ) ));
- assert_eq! (unsafe {
- & ( * ( 0 as * const rte_eth_ipv6_flow ) ) . dst_ip as * const
- _ as usize } , 16usize , concat ! (
- "Alignment of field: " , stringify ! ( rte_eth_ipv6_flow ) ,
- "::" , stringify ! ( dst_ip ) ));
- assert_eq! (unsafe {
- & ( * ( 0 as * const rte_eth_ipv6_flow ) ) . tc as * const _
- as usize } , 32usize , concat ! (
- "Alignment of field: " , stringify ! ( rte_eth_ipv6_flow ) ,
- "::" , stringify ! ( tc ) ));
- assert_eq! (unsafe {
- & ( * ( 0 as * const rte_eth_ipv6_flow ) ) . proto as * const
- _ as usize } , 33usize , concat ! (
- "Alignment of field: " , stringify ! ( rte_eth_ipv6_flow ) ,
- "::" , stringify ! ( proto ) ));
- assert_eq! (unsafe {
- & ( * ( 0 as * const rte_eth_ipv6_flow ) ) . hop_limits as *
- const _ as usize } , 34usize , concat ! (
- "Alignment of field: " , stringify ! ( rte_eth_ipv6_flow ) ,
- "::" , stringify ! ( hop_limits ) ));
}
impl Clone for rte_eth_ipv6_flow {
fn clone(&self) -> Self { *self }
}
/**
* A structure used to configure FDIR masks that are used by the device
* to match the various fields of RX packet headers.
*/
#[repr(C)]
#[derive(Debug, Default, Copy)]
pub struct rte_eth_fdir_masks {
/**< Bit mask for vlan_tci in big endian */
pub vlan_tci_mask: u16,
/** Bit mask for ipv4 flow in big endian. */
pub ipv4_mask: rte_eth_ipv4_flow,
/** Bit maks for ipv6 flow in big endian. */
pub ipv6_mask: rte_eth_ipv6_flow,
/** Bit mask for L4 source port in big endian. */
pub src_port_mask: u16,
/** Bit mask for L4 destination port in big endian. */
pub dst_port_mask: u16,
/** 6 bit mask for proper 6 bytes of Mac address, bit 0 matches the
first byte on the wire */
pub mac_addr_byte_mask: u8,
/** Bit mask for tunnel ID in big endian. */
pub tunnel_id_mask: u32,
/**< 1 - Match tunnel type,
0 - Ignore tunnel type. */
pub tunnel_type_mask: u8,
}
#[test]
fn bindgen_test_layout_rte_eth_fdir_masks() {
assert_eq!(::std::mem::size_of::<rte_eth_fdir_masks>() , 68usize , concat
! ( "Size of: " , stringify ! ( rte_eth_fdir_masks ) ));
assert_eq! (::std::mem::align_of::<rte_eth_fdir_masks>() , 4usize , concat
! ( "Alignment of " , stringify ! ( rte_eth_fdir_masks ) ));
- assert_eq! (unsafe {
- & ( * ( 0 as * const rte_eth_fdir_masks ) ) . vlan_tci_mask as
- * const _ as usize } , 0usize , concat ! (
- "Alignment of field: " , stringify ! ( rte_eth_fdir_masks ) ,
- "::" , stringify ! ( vlan_tci_mask ) ));
- assert_eq! (unsafe {
- & ( * ( 0 as * const rte_eth_fdir_masks ) ) . ipv4_mask as *
- const _ as usize } , 4usize , concat ! (
- "Alignment of field: " , stringify ! ( rte_eth_fdir_masks ) ,
- "::" , stringify ! ( ipv4_mask ) ));
- assert_eq! (unsafe {
- & ( * ( 0 as * const rte_eth_fdir_masks ) ) . ipv6_mask as *
- const _ as usize } , 16usize , concat ! (
- "Alignment of field: " , stringify ! ( rte_eth_fdir_masks ) ,
- "::" , stringify ! ( ipv6_mask ) ));
- assert_eq! (unsafe {
- & ( * ( 0 as * const rte_eth_fdir_masks ) ) . src_port_mask as
- * const _ as usize } , 52usize , concat ! (
- "Alignment of field: " , stringify ! ( rte_eth_fdir_masks ) ,
- "::" , stringify ! ( src_port_mask ) ));
- assert_eq! (unsafe {
- & ( * ( 0 as * const rte_eth_fdir_masks ) ) . dst_port_mask as
- * const _ as usize } , 54usize , concat ! (
- "Alignment of field: " , stringify ! ( rte_eth_fdir_masks ) ,
- "::" , stringify ! ( dst_port_mask ) ));
- assert_eq! (unsafe {
- & ( * ( 0 as * const rte_eth_fdir_masks ) ) .
- mac_addr_byte_mask as * const _ as usize } , 56usize , concat
- ! (
- "Alignment of field: " , stringify ! ( rte_eth_fdir_masks ) ,
- "::" , stringify ! ( mac_addr_byte_mask ) ));
- assert_eq! (unsafe {
- & ( * ( 0 as * const rte_eth_fdir_masks ) ) . tunnel_id_mask
- as * const _ as usize } , 60usize , concat ! (
- "Alignment of field: " , stringify ! ( rte_eth_fdir_masks ) ,
- "::" , stringify ! ( tunnel_id_mask ) ));
- assert_eq! (unsafe {
- & ( * ( 0 as * const rte_eth_fdir_masks ) ) . tunnel_type_mask
- as * const _ as usize } , 64usize , concat ! (
- "Alignment of field: " , stringify ! ( rte_eth_fdir_masks ) ,
- "::" , stringify ! ( tunnel_type_mask ) ));
}
impl Clone for rte_eth_fdir_masks {
fn clone(&self) -> Self { *self }
}
#[repr(u32)]
/**
* Payload type
*/
#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)]
pub enum rte_eth_payload_type {
RTE_ETH_PAYLOAD_UNKNOWN = 0,
RTE_ETH_RAW_PAYLOAD = 1,
RTE_ETH_L2_PAYLOAD = 2,
RTE_ETH_L3_PAYLOAD = 3,
RTE_ETH_L4_PAYLOAD = 4,
RTE_ETH_PAYLOAD_MAX = 8,
}
/**
* A structure used to select bytes extracted from the protocol layers to
* flexible payload for filter
*/
#[repr(C)]
#[derive(Debug, Copy)]
pub struct rte_eth_flex_payload_cfg {
/**< Payload type */
pub type_: rte_eth_payload_type,
pub src_offset: [u16; 16usize],
}
#[test]
fn bindgen_test_layout_rte_eth_flex_payload_cfg() {
assert_eq!(::std::mem::size_of::<rte_eth_flex_payload_cfg>() , 36usize ,
concat ! (
"Size of: " , stringify ! ( rte_eth_flex_payload_cfg ) ));
assert_eq! (::std::mem::align_of::<rte_eth_flex_payload_cfg>() , 4usize ,
concat ! (
"Alignment of " , stringify ! ( rte_eth_flex_payload_cfg ) ));
- assert_eq! (unsafe {
- & ( * ( 0 as * const rte_eth_flex_payload_cfg ) ) . type_ as *
- const _ as usize } , 0usize , concat ! (
- "Alignment of field: " , stringify ! (
- rte_eth_flex_payload_cfg ) , "::" , stringify ! ( type_ ) ));
- assert_eq! (unsafe {
- & ( * ( 0 as * const rte_eth_flex_payload_cfg ) ) . src_offset
- as * const _ as usize } , 4usize , concat ! (
- "Alignment of field: " , stringify ! (
- rte_eth_flex_payload_cfg ) , "::" , stringify ! ( src_offset )
- ));
}
impl Clone for rte_eth_flex_payload_cfg {
fn clone(&self) -> Self { *self }
}
impl Default for rte_eth_flex_payload_cfg {
fn default() -> Self { unsafe { ::std::mem::zeroed() } }
}
/**
* A structure used to define FDIR masks for flexible payload
* for each flow type
*/
#[repr(C)]
#[derive(Debug, Default, Copy)]
pub struct rte_eth_fdir_flex_mask {
pub flow_type: u16,
pub mask: [u8; 16usize],
}
#[test]
fn bindgen_test_layout_rte_eth_fdir_flex_mask() {
assert_eq!(::std::mem::size_of::<rte_eth_fdir_flex_mask>() , 18usize ,
concat ! ( "Size of: " , stringify ! ( rte_eth_fdir_flex_mask )
));
assert_eq! (::std::mem::align_of::<rte_eth_fdir_flex_mask>() , 2usize ,
concat ! (
"Alignment of " , stringify ! ( rte_eth_fdir_flex_mask ) ));
- assert_eq! (unsafe {
- & ( * ( 0 as * const rte_eth_fdir_flex_mask ) ) . flow_type as
- * const _ as usize } , 0usize , concat ! (
- "Alignment of field: " , stringify ! ( rte_eth_fdir_flex_mask
- ) , "::" , stringify ! ( flow_type ) ));
- assert_eq! (unsafe {
- & ( * ( 0 as * const rte_eth_fdir_flex_mask ) ) . mask as *
- const _ as usize } , 2usize , concat ! (
- "Alignment of field: " , stringify ! ( rte_eth_fdir_flex_mask
- ) , "::" , stringify ! ( mask ) ));
}
impl Clone for rte_eth_fdir_flex_mask {
fn clone(&self) -> Self { *self }
}
/**
* A structure used to define all flexible payload related setting
* include flex payload and flex mask
*/
#[repr(C)]
#[derive(Debug, Copy)]
pub struct rte_eth_fdir_flex_conf {
/**< The number of following payload cfg */
pub nb_payloads: u16,
/**< The number of following mask */
pub nb_flexmasks: u16,
pub flex_set: [rte_eth_flex_payload_cfg; 8usize],
pub flex_mask: [rte_eth_fdir_flex_mask; 22usize],
}
#[test]
fn bindgen_test_layout_rte_eth_fdir_flex_conf() {
assert_eq!(::std::mem::size_of::<rte_eth_fdir_flex_conf>() , 688usize ,
concat ! ( "Size of: " , stringify ! ( rte_eth_fdir_flex_conf )
));
assert_eq! (::std::mem::align_of::<rte_eth_fdir_flex_conf>() , 4usize ,
concat ! (
"Alignment of " , stringify ! ( rte_eth_fdir_flex_conf ) ));
- assert_eq! (unsafe {
- & ( * ( 0 as * const rte_eth_fdir_flex_conf ) ) . nb_payloads
- as * const _ as usize } , 0usize , concat ! (
- "Alignment of field: " , stringify ! ( rte_eth_fdir_flex_conf
- ) , "::" , stringify ! ( nb_payloads ) ));
- assert_eq! (unsafe {
- & ( * ( 0 as * const rte_eth_fdir_flex_conf ) ) . nb_flexmasks
- as * const _ as usize } , 2usize , concat ! (
- "Alignment of field: " , stringify ! ( rte_eth_fdir_flex_conf
- ) , "::" , stringify ! ( nb_flexmasks ) ));
- assert_eq! (unsafe {
- & ( * ( 0 as * const rte_eth_fdir_flex_conf ) ) . flex_set as
- * const _ as usize } , 4usize , concat ! (
- "Alignment of field: " , stringify ! ( rte_eth_fdir_flex_conf
- ) , "::" , stringify ! ( flex_set ) ));
- assert_eq! (unsafe {
- & ( * ( 0 as * const rte_eth_fdir_flex_conf ) ) . flex_mask as
- * const _ as usize } , 292usize , concat ! (
- "Alignment of field: " , stringify ! ( rte_eth_fdir_flex_conf
- ) , "::" , stringify ! ( flex_mask ) ));
}
impl Clone for rte_eth_fdir_flex_conf {
fn clone(&self) -> Self { *self }
}
impl Default for rte_eth_fdir_flex_conf {
fn default() -> Self { unsafe { ::std::mem::zeroed() } }
}
/**
* A structure used to configure the Flow Director (FDIR) feature
* of an Ethernet port.
*
* If mode is RTE_FDIR_DISABLE, the pballoc value is ignored.
*/
#[repr(C)]
#[derive(Debug, Copy)]
pub struct rte_fdir_conf {
/**< Flow Director mode. */
pub mode: rte_fdir_mode,
/**< Space for FDIR filters. */
pub pballoc: rte_fdir_pballoc_type,
/**< How to report FDIR hash. */
pub status: rte_fdir_status_mode,
/** RX queue of packets matching a "drop" filter in perfect mode. */
pub drop_queue: u8,
pub mask: rte_eth_fdir_masks,
pub flex_conf: rte_eth_fdir_flex_conf,
}
#[test]
fn bindgen_test_layout_rte_fdir_conf() {
assert_eq!(::std::mem::size_of::<rte_fdir_conf>() , 772usize , concat ! (
"Size of: " , stringify ! ( rte_fdir_conf ) ));
assert_eq! (::std::mem::align_of::<rte_fdir_conf>() , 4usize , concat ! (
"Alignment of " , stringify ! ( rte_fdir_conf ) ));
- assert_eq! (unsafe {
- & ( * ( 0 as * const rte_fdir_conf ) ) . mode as * const _ as
- usize } , 0usize , concat ! (
- "Alignment of field: " , stringify ! ( rte_fdir_conf ) , "::"
- , stringify ! ( mode ) ));
- assert_eq! (unsafe {
- & ( * ( 0 as * const rte_fdir_conf ) ) . pballoc as * const _
- as usize } , 4usize , concat ! (
- "Alignment of field: " , stringify ! ( rte_fdir_conf ) , "::"
- , stringify ! ( pballoc ) ));
- assert_eq! (unsafe {
- & ( * ( 0 as * const rte_fdir_conf ) ) . status as * const _
- as usize } , 8usize , concat ! (
- "Alignment of field: " , stringify ! ( rte_fdir_conf ) , "::"
- , stringify ! ( status ) ));
- assert_eq! (unsafe {
- & ( * ( 0 as * const rte_fdir_conf ) ) . drop_queue as * const
- _ as usize } , 12usize , concat ! (
- "Alignment of field: " , stringify ! ( rte_fdir_conf ) , "::"
- , stringify ! ( drop_queue ) ));
- assert_eq! (unsafe {
- & ( * ( 0 as * const rte_fdir_conf ) ) . mask as * const _ as
- usize } , 16usize , concat ! (
- "Alignment of field: " , stringify ! ( rte_fdir_conf ) , "::"
- , stringify ! ( mask ) ));
- assert_eq! (unsafe {
- & ( * ( 0 as * const rte_fdir_conf ) ) . flex_conf as * const
- _ as usize } , 84usize , concat ! (
- "Alignment of field: " , stringify ! ( rte_fdir_conf ) , "::"
- , stringify ! ( flex_conf ) ));
}
impl Clone for rte_fdir_conf {
fn clone(&self) -> Self { *self }
}
impl Default for rte_fdir_conf {
fn default() -> Self { unsafe { ::std::mem::zeroed() } }
}
/**
* A structure used to enable/disable specific device interrupts.
*/
#[repr(C)]
#[derive(Debug, Default, Copy)]
pub struct rte_intr_conf {
/** enable/disable lsc interrupt. 0 (default) - disable, 1 enable */
pub lsc: u16,
/** enable/disable rxq interrupt. 0 (default) - disable, 1 enable */
pub rxq: u16,
}
#[test]
fn bindgen_test_layout_rte_intr_conf() {
assert_eq!(::std::mem::size_of::<rte_intr_conf>() , 4usize , concat ! (
"Size of: " , stringify ! ( rte_intr_conf ) ));
assert_eq! (::std::mem::align_of::<rte_intr_conf>() , 2usize , concat ! (
"Alignment of " , stringify ! ( rte_intr_conf ) ));
- assert_eq! (unsafe {
- & ( * ( 0 as * const rte_intr_conf ) ) . lsc as * const _ as
- usize } , 0usize , concat ! (
- "Alignment of field: " , stringify ! ( rte_intr_conf ) , "::"
- , stringify ! ( lsc ) ));
- assert_eq! (unsafe {
- & ( * ( 0 as * const rte_intr_conf ) ) . rxq as * const _ as
- usize } , 2usize , concat ! (
- "Alignment of field: " , stringify ! ( rte_intr_conf ) , "::"
- , stringify ! ( rxq ) ));
}
impl Clone for rte_intr_conf {
fn clone(&self) -> Self { *self }
}
/**
* A structure used to configure an Ethernet port.
* Depending upon the RX multi-queue mode, extra advanced
* configuration settings may be needed.
*/
#[repr(C)]
pub struct rte_eth_conf {
/**< bitmap of ETH_LINK_SPEED_XXX of speeds to be
used. ETH_LINK_SPEED_FIXED disables link
autonegotiation, and a unique speed shall be
set. Otherwise, the bitmap defines the set of
speeds to be advertised. If the special value
ETH_LINK_SPEED_AUTONEG (0) is used, all speeds
supported are advertised. */
pub link_speeds: u32,
/**< Port RX configuration. */
pub rxmode: rte_eth_rxmode,
/**< Port TX configuration. */
pub txmode: rte_eth_txmode,
/**< Loopback operation mode. By default the value
is 0, meaning the loopback mode is disabled.
Read the datasheet of given ethernet controller
for details. The possible values of this field
are defined in implementation of each driver. */
pub lpbk_mode: u32,
/**< Port RX filtering configuration (union). */
pub rx_adv_conf: rte_eth_conf__bindgen_ty_1,
/**< Port TX DCB configuration (union). */
pub tx_adv_conf: rte_eth_conf__bindgen_ty_2,
/** Currently,Priority Flow Control(PFC) are supported,if DCB with PFC
is needed,and the variable must be set ETH_DCB_PFC_SUPPORT. */
pub dcb_capability_en: u32,
/**< FDIR configuration. */
pub fdir_conf: rte_fdir_conf,
/**< Interrupt mode configuration. */
pub intr_conf: rte_intr_conf,
}
#[repr(C)]
pub struct rte_eth_conf__bindgen_ty_1 {
/**< Port RSS configuration */
pub rss_conf: rte_eth_rss_conf,
pub vmdq_dcb_conf: rte_eth_vmdq_dcb_conf,
pub dcb_rx_conf: rte_eth_dcb_rx_conf,
pub vmdq_rx_conf: rte_eth_vmdq_rx_conf,
}
#[test]
fn bindgen_test_layout_rte_eth_conf__bindgen_ty_1() {
assert_eq!(::std::mem::size_of::<rte_eth_conf__bindgen_ty_1>() , 2120usize
, concat ! (
"Size of: " , stringify ! ( rte_eth_conf__bindgen_ty_1 ) ));
assert_eq! (::std::mem::align_of::<rte_eth_conf__bindgen_ty_1>() , 8usize
, concat ! (
"Alignment of " , stringify ! ( rte_eth_conf__bindgen_ty_1 )
));
- assert_eq! (unsafe {
- & ( * ( 0 as * const rte_eth_conf__bindgen_ty_1 ) ) . rss_conf
- as * const _ as usize } , 0usize , concat ! (
- "Alignment of field: " , stringify ! (
- rte_eth_conf__bindgen_ty_1 ) , "::" , stringify ! ( rss_conf )
- ));
- assert_eq! (unsafe {
- & ( * ( 0 as * const rte_eth_conf__bindgen_ty_1 ) ) .
- vmdq_dcb_conf as * const _ as usize } , 24usize , concat ! (
- "Alignment of field: " , stringify ! (
- rte_eth_conf__bindgen_ty_1 ) , "::" , stringify ! (
- vmdq_dcb_conf ) ));
- assert_eq! (unsafe {
- & ( * ( 0 as * const rte_eth_conf__bindgen_ty_1 ) ) .
- dcb_rx_conf as * const _ as usize } , 1064usize , concat ! (
- "Alignment of field: " , stringify ! (
- rte_eth_conf__bindgen_ty_1 ) , "::" , stringify ! (
- dcb_rx_conf ) ));
- assert_eq! (unsafe {
- & ( * ( 0 as * const rte_eth_conf__bindgen_ty_1 ) ) .
- vmdq_rx_conf as * const _ as usize } , 1080usize , concat ! (
- "Alignment of field: " , stringify ! (
- rte_eth_conf__bindgen_ty_1 ) , "::" , stringify ! (
- vmdq_rx_conf ) ));
}
impl Default for rte_eth_conf__bindgen_ty_1 {
fn default() -> Self { unsafe { ::std::mem::zeroed() } }
}
#[repr(C)]
#[derive(Debug, Default, Copy)]
pub struct rte_eth_conf__bindgen_ty_2 {
pub vmdq_dcb_tx_conf: __BindgenUnionField<rte_eth_vmdq_dcb_tx_conf>,
pub dcb_tx_conf: __BindgenUnionField<rte_eth_dcb_tx_conf>,
pub vmdq_tx_conf: __BindgenUnionField<rte_eth_vmdq_tx_conf>,
pub bindgen_union_field: [u32; 3usize],
}
#[test]
fn bindgen_test_layout_rte_eth_conf__bindgen_ty_2() {
assert_eq!(::std::mem::size_of::<rte_eth_conf__bindgen_ty_2>() , 12usize ,
concat ! (
"Size of: " , stringify ! ( rte_eth_conf__bindgen_ty_2 ) ));
assert_eq! (::std::mem::align_of::<rte_eth_conf__bindgen_ty_2>() , 4usize
, concat ! (
"Alignment of " , stringify ! ( rte_eth_conf__bindgen_ty_2 )
));
- assert_eq! (unsafe {
- & ( * ( 0 as * const rte_eth_conf__bindgen_ty_2 ) ) .
- vmdq_dcb_tx_conf as * const _ as usize } , 0usize , concat ! (
- "Alignment of field: " , stringify ! (
- rte_eth_conf__bindgen_ty_2 ) , "::" , stringify ! (
- vmdq_dcb_tx_conf ) ));
- assert_eq! (unsafe {
- & ( * ( 0 as * const rte_eth_conf__bindgen_ty_2 ) ) .
- dcb_tx_conf as * const _ as usize } , 0usize , concat ! (
- "Alignment of field: " , stringify ! (
- rte_eth_conf__bindgen_ty_2 ) , "::" , stringify ! (
- dcb_tx_conf ) ));
- assert_eq! (unsafe {
- & ( * ( 0 as * const rte_eth_conf__bindgen_ty_2 ) ) .
- vmdq_tx_conf as * const _ as usize } , 0usize , concat ! (
- "Alignment of field: " , stringify ! (
- rte_eth_conf__bindgen_ty_2 ) , "::" , stringify ! (
- vmdq_tx_conf ) ));
}
impl Clone for rte_eth_conf__bindgen_ty_2 {
fn clone(&self) -> Self { *self }
}
#[test]
fn bindgen_test_layout_rte_eth_conf() {
assert_eq!(::std::mem::size_of::<rte_eth_conf>() , 2944usize , concat ! (
"Size of: " , stringify ! ( rte_eth_conf ) ));
assert_eq! (::std::mem::align_of::<rte_eth_conf>() , 8usize , concat ! (
"Alignment of " , stringify ! ( rte_eth_conf ) ));
- assert_eq! (unsafe {
- & ( * ( 0 as * const rte_eth_conf ) ) . link_speeds as * const
- _ as usize } , 0usize , concat ! (
- "Alignment of field: " , stringify ! ( rte_eth_conf ) , "::" ,
- stringify ! ( link_speeds ) ));
- assert_eq! (unsafe {
- & ( * ( 0 as * const rte_eth_conf ) ) . rxmode as * const _ as
- usize } , 4usize , concat ! (
- "Alignment of field: " , stringify ! ( rte_eth_conf ) , "::" ,
- stringify ! ( rxmode ) ));
- assert_eq! (unsafe {
- & ( * ( 0 as * const rte_eth_conf ) ) . txmode as * const _ as
- usize } , 16usize , concat ! (
- "Alignment of field: " , stringify ! ( rte_eth_conf ) , "::" ,
- stringify ! ( txmode ) ));
- assert_eq! (unsafe {
- & ( * ( 0 as * const rte_eth_conf ) ) . lpbk_mode as * const _
- as usize } , 24usize , concat ! (
- "Alignment of field: " , stringify ! ( rte_eth_conf ) , "::" ,
- stringify ! ( lpbk_mode ) ));
- assert_eq! (unsafe {
- & ( * ( 0 as * const rte_eth_conf ) ) . rx_adv_conf as * const
- _ as usize } , 32usize , concat ! (
- "Alignment of field: " , stringify ! ( rte_eth_conf ) , "::" ,
- stringify ! ( rx_adv_conf ) ));
- assert_eq! (unsafe {
- & ( * ( 0 as * const rte_eth_conf ) ) . tx_adv_conf as * const
- _ as usize } , 2152usize , concat ! (
- "Alignment of field: " , stringify ! ( rte_eth_conf ) , "::" ,
- stringify ! ( tx_adv_conf ) ));
- assert_eq! (unsafe {
- & ( * ( 0 as * const rte_eth_conf ) ) . dcb_capability_en as *
- const _ as usize } , 2164usize , concat ! (
- "Alignment of field: " , stringify ! ( rte_eth_conf ) , "::" ,
- stringify ! ( dcb_capability_en ) ));
- assert_eq! (unsafe {
- & ( * ( 0 as * const rte_eth_conf ) ) . fdir_conf as * const _
- as usize } , 2168usize , concat ! (
- "Alignment of field: " , stringify ! ( rte_eth_conf ) , "::" ,
- stringify ! ( fdir_conf ) ));
- assert_eq! (unsafe {
- & ( * ( 0 as * const rte_eth_conf ) ) . intr_conf as * const _
- as usize } , 2940usize , concat ! (
- "Alignment of field: " , stringify ! ( rte_eth_conf ) , "::" ,
- stringify ! ( intr_conf ) ));
}
impl Default for rte_eth_conf {
fn default() -> Self { unsafe { ::std::mem::zeroed() } }
}
thread 'header_layout_eth_conf_h' panicked at 'Header and binding differ!', /bindgen/target/debug/build/bindgen-f6fdd37f3e51109e/out/tests.rs:38
failures:
header_16_byte_alignment_h
header_complex_h
header_constant_evaluate_h
header_constify_all_enums_h
header_convert_floats_h
header_forward_declared_struct_h
header_func_ptr_in_struct_h
header_layout_align_h
header_layout_arp_h
header_layout_array_h
header_layout_cmdline_token_h
header_layout_eth_conf_h
header_layout_kni_mbuf_h
header_layout_mbuf_h
header_no_comments_h
header_no_derive_debug_h
header_no_derive_default_h
header_no_recursive_whitelisting_h
header_no_std_h
header_objc_interface_type_h
header_struct_containing_forward_declared_struct_h
header_struct_with_anon_struct_array_h
header_struct_with_anon_struct_h
header_struct_with_anon_struct_pointer_h
header_struct_with_anon_union_h
header_struct_with_anon_unnamed_struct_h
header_struct_with_anon_unnamed_union_h
header_struct_with_bitfields_h
header_struct_with_derive_debug_h
header_struct_with_nesting_h
header_struct_with_packing_h
header_struct_with_struct_h
header_type_referenced_by_whitelisted_function_h
header_union_with_anon_struct_bitfield_h
header_union_with_anon_struct_h
header_union_with_anon_union_h
header_union_with_anon_unnamed_struct_h
header_union_with_anon_unnamed_union_h
header_union_with_big_member_h
header_union_with_nesting_h
header_unknown_attr_h
header_use_core_h
test result: FAILED. 29 passed; 42 failed; 0 ignored; 0 measured
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment