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 const UNINIT: ::std::mem::MaybeUninit<rte_ring> =
115 ::std::mem::MaybeUninit::uninit();
116 let ptr = UNINIT.as_ptr();
117 assert_eq!(
118 ::std::mem::size_of::<rte_ring>(),
119 16usize,
120 concat!("Size of: ", stringify!(rte_ring))
121 );
122 assert_eq!(
123 ::std::mem::align_of::<rte_ring>(),
124 8usize,
125 concat!("Alignment of ", stringify!(rte_ring))
126 );
127 assert_eq!(
128 unsafe { ::std::ptr::addr_of!((*ptr).memzone) as usize - ptr as usize },
129 0usize,
130 concat!(
131 "Offset of field: ",
132 stringify!(rte_ring),
133 "::",
134 stringify!(memzone)
135 )
136 );
137 assert_eq!(
138 unsafe { ::std::ptr::addr_of!((*ptr).prod) as usize - ptr as usize },
139 8usize,
140 concat!(
141 "Offset of field: ",
142 stringify!(rte_ring),
143 "::",
144 stringify!(prod)
145 )
146 );
147 assert_eq!(
148 unsafe { ::std::ptr::addr_of!((*ptr).cons) as usize - ptr as usize },
149 12usize,
150 concat!(
151 "Offset of field: ",
152 stringify!(rte_ring),
153 "::",
154 stringify!(cons)
155 )
156 );
157 assert_eq!(
158 unsafe { ::std::ptr::addr_of!((*ptr).ring) as usize - ptr as usize },
159 16usize,
160 concat!(
161 "Offset of field: ",
162 stringify!(rte_ring),
163 "::",
164 stringify!(ring)
165 )
166 );
167 }
168 impl Default for rte_ring {
default() -> Self169 fn default() -> Self {
170 let mut s = ::std::mem::MaybeUninit::<Self>::uninit();
171 unsafe {
172 ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
173 s.assume_init()
174 }
175 }
176 }
177 #[repr(C)]
178 #[derive(Debug, Default, Copy, Clone)]
179 pub struct rte_memzone {
180 pub _address: u8,
181 }
182