summaryrefslogtreecommitdiff
path: root/tests/expectations/tests/layout_array_too_long.rs
blob: b68d9a33c85ff371a3d7e8ebba9ccaec59fc79fe (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
/* automatically generated by rust-bindgen */


#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)]


pub const RTE_CACHE_LINE_SIZE: ::std::os::raw::c_uint = 64;
pub const RTE_LIBRTE_IP_FRAG_MAX_FRAG: ::std::os::raw::c_uint = 4;
pub const IP_LAST_FRAG_IDX: _bindgen_ty_1 = _bindgen_ty_1::IP_LAST_FRAG_IDX;
pub const IP_FIRST_FRAG_IDX: _bindgen_ty_1 = _bindgen_ty_1::IP_FIRST_FRAG_IDX;
pub const IP_MIN_FRAG_NUM: _bindgen_ty_1 = _bindgen_ty_1::IP_MIN_FRAG_NUM;
pub const IP_MAX_FRAG_NUM: _bindgen_ty_1 = _bindgen_ty_1::IP_MAX_FRAG_NUM;
#[repr(u32)]
#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)]
pub enum _bindgen_ty_1 {
    IP_LAST_FRAG_IDX = 0,
    IP_FIRST_FRAG_IDX = 1,
    IP_MIN_FRAG_NUM = 2,
    IP_MAX_FRAG_NUM = 4,
}
/// @internal fragmented mbuf
#[repr(C)]
#[derive(Debug, Copy, Hash, PartialEq)]
pub struct ip_frag {
    /// < offset into the packet
    pub ofs: u16,
    /// < length of fragment
    pub len: u16,
    /// < fragment mbuf
    pub mb: *mut rte_mbuf,
}
#[test]
fn bindgen_test_layout_ip_frag() {
    assert_eq!(::std::mem::size_of::<ip_frag>() , 16usize , concat ! (
               "Size of: " , stringify ! ( ip_frag ) ));
    assert_eq! (::std::mem::align_of::<ip_frag>() , 8usize , concat ! (
                "Alignment of " , stringify ! ( ip_frag ) ));
    assert_eq! (unsafe {
                & ( * ( 0 as * const ip_frag ) ) . ofs as * const _ as usize }
                , 0usize , concat ! (
                "Alignment of field: " , stringify ! ( ip_frag ) , "::" ,
                stringify ! ( ofs ) ));
    assert_eq! (unsafe {
                & ( * ( 0 as * const ip_frag ) ) . len as * const _ as usize }
                , 2usize , concat ! (
                "Alignment of field: " , stringify ! ( ip_frag ) , "::" ,
                stringify ! ( len ) ));
    assert_eq! (unsafe {
                & ( * ( 0 as * const ip_frag ) ) . mb as * const _ as usize }
                , 8usize , concat ! (
                "Alignment of field: " , stringify ! ( ip_frag ) , "::" ,
                stringify ! ( mb ) ));
}
impl Clone for ip_frag {
    fn clone(&self) -> Self { *self }
}
impl Default for ip_frag {
    fn default() -> Self { unsafe { ::std::mem::zeroed() } }
}
/// @internal <src addr, dst_addr, id> to uniquely indetify fragmented datagram.
#[repr(C)]
#[derive(Debug, Default, Copy, Hash, PartialEq)]
pub struct ip_frag_key {
    /// < src address, first 8 bytes used for IPv4
    pub src_dst: [u64; 4usize],
    /// < dst address
    pub id: u32,
    /// < src/dst key length
    pub key_len: u32,
}
#[test]
fn bindgen_test_layout_ip_frag_key() {
    assert_eq!(::std::mem::size_of::<ip_frag_key>() , 40usize , concat ! (
               "Size of: " , stringify ! ( ip_frag_key ) ));
    assert_eq! (::std::mem::align_of::<ip_frag_key>() , 8usize , concat ! (
                "Alignment of " , stringify ! ( ip_frag_key ) ));
    assert_eq! (unsafe {
                & ( * ( 0 as * const ip_frag_key ) ) . src_dst as * const _ as
                usize } , 0usize , concat ! (
                "Alignment of field: " , stringify ! ( ip_frag_key ) , "::" ,
                stringify ! ( src_dst ) ));
    assert_eq! (unsafe {
                & ( * ( 0 as * const ip_frag_key ) ) . id as * const _ as
                usize } , 32usize , concat ! (
                "Alignment of field: " , stringify ! ( ip_frag_key ) , "::" ,
                stringify ! ( id ) ));
    assert_eq! (unsafe {
                & ( * ( 0 as * const ip_frag_key ) ) . key_len as * const _ as
                usize } , 36usize , concat ! (
                "Alignment of field: " , stringify ! ( ip_frag_key ) , "::" ,
                stringify ! ( key_len ) ));
}
impl Clone for ip_frag_key {
    fn clone(&self) -> Self { *self }
}
/// @internal Fragmented packet to reassemble.
/// First two entries in the frags[] array are for the last and first fragments.
#[repr(C)]
#[derive(Copy)]
pub struct ip_frag_pkt {
    /// < LRU list
    pub lru: ip_frag_pkt__bindgen_ty_1,
    /// < fragmentation key
    pub key: ip_frag_key,
    /// < creation timestamp
    pub start: u64,
    /// < expected reassembled size
    pub total_size: u32,
    /// < size of fragments received
    pub frag_size: u32,
    /// < index of next entry to fill
    pub last_idx: u32,
    /// < fragments
    pub frags: [ip_frag; 4usize],
    pub __bindgen_padding_0: [u64; 6usize],
}
#[repr(C)]
#[derive(Debug, Copy, Hash, PartialEq)]
pub struct ip_frag_pkt__bindgen_ty_1 {
    pub tqe_next: *mut ip_frag_pkt,
    pub tqe_prev: *mut *mut ip_frag_pkt,
}
#[test]
fn bindgen_test_layout_ip_frag_pkt__bindgen_ty_1() {
    assert_eq!(::std::mem::size_of::<ip_frag_pkt__bindgen_ty_1>() , 16usize ,
               concat ! (
               "Size of: " , stringify ! ( ip_frag_pkt__bindgen_ty_1 ) ));
    assert_eq! (::std::mem::align_of::<ip_frag_pkt__bindgen_ty_1>() , 8usize ,
                concat ! (
                "Alignment of " , stringify ! ( ip_frag_pkt__bindgen_ty_1 )
                ));
    assert_eq! (unsafe {
                & ( * ( 0 as * const ip_frag_pkt__bindgen_ty_1 ) ) . tqe_next
                as * const _ as usize } , 0usize , concat ! (
                "Alignment of field: " , stringify ! (
                ip_frag_pkt__bindgen_ty_1 ) , "::" , stringify ! ( tqe_next )
                ));
    assert_eq! (unsafe {
                & ( * ( 0 as * const ip_frag_pkt__bindgen_ty_1 ) ) . tqe_prev
                as * const _ as usize } , 8usize , concat ! (
                "Alignment of field: " , stringify ! (
                ip_frag_pkt__bindgen_ty_1 ) , "::" , stringify ! ( tqe_prev )
                ));
}
impl Clone for ip_frag_pkt__bindgen_ty_1 {
    fn clone(&self) -> Self { *self }
}
impl Default for ip_frag_pkt__bindgen_ty_1 {
    fn default() -> Self { unsafe { ::std::mem::zeroed() } }
}
#[test]
fn bindgen_test_layout_ip_frag_pkt() {
    assert_eq!(::std::mem::size_of::<ip_frag_pkt>() , 192usize , concat ! (
               "Size of: " , stringify ! ( ip_frag_pkt ) ));
    assert_eq! (unsafe {
                & ( * ( 0 as * const ip_frag_pkt ) ) . lru as * const _ as
                usize } , 0usize , concat ! (
                "Alignment of field: " , stringify ! ( ip_frag_pkt ) , "::" ,
                stringify ! ( lru ) ));
    assert_eq! (unsafe {
                & ( * ( 0 as * const ip_frag_pkt ) ) . key as * const _ as
                usize } , 16usize , concat ! (
                "Alignment of field: " , stringify ! ( ip_frag_pkt ) , "::" ,
                stringify ! ( key ) ));
    assert_eq! (unsafe {
                & ( * ( 0 as * const ip_frag_pkt ) ) . start as * const _ as
                usize } , 56usize , concat ! (
                "Alignment of field: " , stringify ! ( ip_frag_pkt ) , "::" ,
                stringify ! ( start ) ));
    assert_eq! (unsafe {
                & ( * ( 0 as * const ip_frag_pkt ) ) . total_size as * const _
                as usize } , 64usize , concat ! (
                "Alignment of field: " , stringify ! ( ip_frag_pkt ) , "::" ,
                stringify ! ( total_size ) ));
    assert_eq! (unsafe {
                & ( * ( 0 as * const ip_frag_pkt ) ) . frag_size as * const _
                as usize } , 68usize , concat ! (
                "Alignment of field: " , stringify ! ( ip_frag_pkt ) , "::" ,
                stringify ! ( frag_size ) ));
    assert_eq! (unsafe {
                & ( * ( 0 as * const ip_frag_pkt ) ) . last_idx as * const _
                as usize } , 72usize , concat ! (
                "Alignment of field: " , stringify ! ( ip_frag_pkt ) , "::" ,
                stringify ! ( last_idx ) ));
    assert_eq! (unsafe {
                & ( * ( 0 as * const ip_frag_pkt ) ) . frags as * const _ as
                usize } , 80usize , concat ! (
                "Alignment of field: " , stringify ! ( ip_frag_pkt ) , "::" ,
                stringify ! ( frags ) ));
}
impl Clone for ip_frag_pkt {
    fn clone(&self) -> Self { *self }
}
impl Default for ip_frag_pkt {
    fn default() -> Self { unsafe { ::std::mem::zeroed() } }
}
/// < fragment mbuf
#[repr(C)]
#[derive(Debug, Default, Copy, Hash, PartialEq)]
pub struct rte_mbuf {
    pub _address: u8,
}
impl Clone for rte_mbuf {
    fn clone(&self) -> Self { *self }
}