• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 #![allow(
2     dead_code,
3     non_snake_case,
4     non_camel_case_types,
5     non_upper_case_globals
6 )]
7 
8 #[repr(C)]
9 #[derive(Default)]
10 pub struct __IncompleteArrayField<T>(::std::marker::PhantomData<T>, [T; 0]);
11 impl<T> __IncompleteArrayField<T> {
12     #[inline]
new() -> Self13     pub const fn new() -> Self {
14         __IncompleteArrayField(::std::marker::PhantomData, [])
15     }
16     #[inline]
as_ptr(&self) -> *const T17     pub fn as_ptr(&self) -> *const T {
18         self as *const _ as *const T
19     }
20     #[inline]
as_mut_ptr(&mut self) -> *mut T21     pub fn as_mut_ptr(&mut self) -> *mut T {
22         self as *mut _ as *mut T
23     }
24     #[inline]
as_slice(&self, len: usize) -> &[T]25     pub unsafe fn as_slice(&self, len: usize) -> &[T] {
26         ::std::slice::from_raw_parts(self.as_ptr(), len)
27     }
28     #[inline]
as_mut_slice(&mut self, len: usize) -> &mut [T]29     pub unsafe fn as_mut_slice(&mut self, len: usize) -> &mut [T] {
30         ::std::slice::from_raw_parts_mut(self.as_mut_ptr(), len)
31     }
32 }
33 impl<T> ::std::fmt::Debug for __IncompleteArrayField<T> {
fmt(&self, fmt: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result34     fn fmt(&self, fmt: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
35         fmt.write_str("__IncompleteArrayField")
36     }
37 }
38 #[repr(C)]
39 #[derive(Debug)]
40 pub struct rte_ring {
41     pub memzone: *mut rte_memzone,
42     pub prod: rte_ring_prod,
43     pub cons: rte_ring_cons,
44     pub ring: __IncompleteArrayField<*mut ::std::os::raw::c_void>,
45 }
46 #[repr(C)]
47 #[derive(Debug, Default, Copy, Clone)]
48 pub struct rte_ring_prod {
49     pub watermark: ::std::os::raw::c_uint,
50 }
51 #[test]
bindgen_test_layout_rte_ring_prod()52 fn bindgen_test_layout_rte_ring_prod() {
53     const UNINIT: ::std::mem::MaybeUninit<rte_ring_prod> =
54         ::std::mem::MaybeUninit::uninit();
55     let ptr = UNINIT.as_ptr();
56     assert_eq!(
57         ::std::mem::size_of::<rte_ring_prod>(),
58         4usize,
59         concat!("Size of: ", stringify!(rte_ring_prod))
60     );
61     assert_eq!(
62         ::std::mem::align_of::<rte_ring_prod>(),
63         4usize,
64         concat!("Alignment of ", stringify!(rte_ring_prod))
65     );
66     assert_eq!(
67         unsafe {
68             ::std::ptr::addr_of!((*ptr).watermark) as usize - ptr as usize
69         },
70         0usize,
71         concat!(
72             "Offset of field: ",
73             stringify!(rte_ring_prod),
74             "::",
75             stringify!(watermark)
76         )
77     );
78 }
79 #[repr(C)]
80 #[derive(Debug, Default, Copy, Clone)]
81 pub struct rte_ring_cons {
82     pub sc_dequeue: ::std::os::raw::c_uint,
83 }
84 #[test]
bindgen_test_layout_rte_ring_cons()85 fn bindgen_test_layout_rte_ring_cons() {
86     const UNINIT: ::std::mem::MaybeUninit<rte_ring_cons> =
87         ::std::mem::MaybeUninit::uninit();
88     let ptr = UNINIT.as_ptr();
89     assert_eq!(
90         ::std::mem::size_of::<rte_ring_cons>(),
91         4usize,
92         concat!("Size of: ", stringify!(rte_ring_cons))
93     );
94     assert_eq!(
95         ::std::mem::align_of::<rte_ring_cons>(),
96         4usize,
97         concat!("Alignment of ", stringify!(rte_ring_cons))
98     );
99     assert_eq!(
100         unsafe {
101             ::std::ptr::addr_of!((*ptr).sc_dequeue) as usize - ptr as usize
102         },
103         0usize,
104         concat!(
105             "Offset of field: ",
106             stringify!(rte_ring_cons),
107             "::",
108             stringify!(sc_dequeue)
109         )
110     );
111 }
112 #[test]
bindgen_test_layout_rte_ring()113 fn bindgen_test_layout_rte_ring() {
114     assert_eq!(
115         ::std::mem::size_of::<rte_ring>(),
116         16usize,
117         concat!("Size of: ", stringify!(rte_ring))
118     );
119     assert_eq!(
120         ::std::mem::align_of::<rte_ring>(),
121         8usize,
122         concat!("Alignment of ", stringify!(rte_ring))
123     );
124 }
125 impl Default for rte_ring {
default() -> Self126     fn default() -> Self {
127         let mut s = ::std::mem::MaybeUninit::<Self>::uninit();
128         unsafe {
129             ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
130             s.assume_init()
131         }
132     }
133 }
134 #[repr(C)]
135 #[derive(Debug, Default, Copy, Clone)]
136 pub struct rte_memzone {
137     pub _address: u8,
138 }
139