1 // Copyright 2019 The Chromium OS Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 /* automatically generated by rust-bindgen */
6
7 #[repr(C)]
8 #[derive(Default)]
9 pub struct __IncompleteArrayField<T>(::std::marker::PhantomData<T>);
10 impl<T> __IncompleteArrayField<T> {
11 #[inline]
new() -> Self12 pub fn new() -> Self {
13 __IncompleteArrayField(::std::marker::PhantomData)
14 }
15 #[inline]
as_ptr(&self) -> *const T16 pub unsafe fn as_ptr(&self) -> *const T {
17 ::std::mem::transmute(self)
18 }
19 #[inline]
as_mut_ptr(&mut self) -> *mut T20 pub unsafe fn as_mut_ptr(&mut self) -> *mut T {
21 ::std::mem::transmute(self)
22 }
23 #[inline]
as_slice(&self, len: usize) -> &[T]24 pub unsafe fn as_slice(&self, len: usize) -> &[T] {
25 ::std::slice::from_raw_parts(self.as_ptr(), len)
26 }
27 #[inline]
as_mut_slice(&mut self, len: usize) -> &mut [T]28 pub unsafe fn as_mut_slice(&mut self, len: usize) -> &mut [T] {
29 ::std::slice::from_raw_parts_mut(self.as_mut_ptr(), len)
30 }
31 }
32 impl<T> ::std::fmt::Debug for __IncompleteArrayField<T> {
fmt(&self, fmt: &mut ::std::fmt::Formatter) -> ::std::fmt::Result33 fn fmt(&self, fmt: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
34 fmt.write_str("__IncompleteArrayField")
35 }
36 }
37 impl<T> ::std::clone::Clone for __IncompleteArrayField<T> {
38 #[inline]
clone(&self) -> Self39 fn clone(&self) -> Self {
40 Self::new()
41 }
42 }
43 impl<T> ::std::marker::Copy for __IncompleteArrayField<T> {}
44 pub const __BITS_PER_LONG: ::std::os::raw::c_uint = 64;
45 pub const __FD_SETSIZE: ::std::os::raw::c_uint = 1024;
46 pub const ETH_ALEN: ::std::os::raw::c_uint = 6;
47 pub const ETH_HLEN: ::std::os::raw::c_uint = 14;
48 pub const ETH_ZLEN: ::std::os::raw::c_uint = 60;
49 pub const ETH_DATA_LEN: ::std::os::raw::c_uint = 1500;
50 pub const ETH_FRAME_LEN: ::std::os::raw::c_uint = 1514;
51 pub const ETH_FCS_LEN: ::std::os::raw::c_uint = 4;
52 pub const ETH_P_LOOP: ::std::os::raw::c_uint = 96;
53 pub const ETH_P_PUP: ::std::os::raw::c_uint = 512;
54 pub const ETH_P_PUPAT: ::std::os::raw::c_uint = 513;
55 pub const ETH_P_TSN: ::std::os::raw::c_uint = 8944;
56 pub const ETH_P_IP: ::std::os::raw::c_uint = 2048;
57 pub const ETH_P_X25: ::std::os::raw::c_uint = 2053;
58 pub const ETH_P_ARP: ::std::os::raw::c_uint = 2054;
59 pub const ETH_P_BPQ: ::std::os::raw::c_uint = 2303;
60 pub const ETH_P_IEEEPUP: ::std::os::raw::c_uint = 2560;
61 pub const ETH_P_IEEEPUPAT: ::std::os::raw::c_uint = 2561;
62 pub const ETH_P_BATMAN: ::std::os::raw::c_uint = 17157;
63 pub const ETH_P_DEC: ::std::os::raw::c_uint = 24576;
64 pub const ETH_P_DNA_DL: ::std::os::raw::c_uint = 24577;
65 pub const ETH_P_DNA_RC: ::std::os::raw::c_uint = 24578;
66 pub const ETH_P_DNA_RT: ::std::os::raw::c_uint = 24579;
67 pub const ETH_P_LAT: ::std::os::raw::c_uint = 24580;
68 pub const ETH_P_DIAG: ::std::os::raw::c_uint = 24581;
69 pub const ETH_P_CUST: ::std::os::raw::c_uint = 24582;
70 pub const ETH_P_SCA: ::std::os::raw::c_uint = 24583;
71 pub const ETH_P_TEB: ::std::os::raw::c_uint = 25944;
72 pub const ETH_P_RARP: ::std::os::raw::c_uint = 32821;
73 pub const ETH_P_ATALK: ::std::os::raw::c_uint = 32923;
74 pub const ETH_P_AARP: ::std::os::raw::c_uint = 33011;
75 pub const ETH_P_8021Q: ::std::os::raw::c_uint = 33024;
76 pub const ETH_P_IPX: ::std::os::raw::c_uint = 33079;
77 pub const ETH_P_IPV6: ::std::os::raw::c_uint = 34525;
78 pub const ETH_P_PAUSE: ::std::os::raw::c_uint = 34824;
79 pub const ETH_P_SLOW: ::std::os::raw::c_uint = 34825;
80 pub const ETH_P_WCCP: ::std::os::raw::c_uint = 34878;
81 pub const ETH_P_MPLS_UC: ::std::os::raw::c_uint = 34887;
82 pub const ETH_P_MPLS_MC: ::std::os::raw::c_uint = 34888;
83 pub const ETH_P_ATMMPOA: ::std::os::raw::c_uint = 34892;
84 pub const ETH_P_PPP_DISC: ::std::os::raw::c_uint = 34915;
85 pub const ETH_P_PPP_SES: ::std::os::raw::c_uint = 34916;
86 pub const ETH_P_LINK_CTL: ::std::os::raw::c_uint = 34924;
87 pub const ETH_P_ATMFATE: ::std::os::raw::c_uint = 34948;
88 pub const ETH_P_PAE: ::std::os::raw::c_uint = 34958;
89 pub const ETH_P_AOE: ::std::os::raw::c_uint = 34978;
90 pub const ETH_P_8021AD: ::std::os::raw::c_uint = 34984;
91 pub const ETH_P_802_EX1: ::std::os::raw::c_uint = 34997;
92 pub const ETH_P_TIPC: ::std::os::raw::c_uint = 35018;
93 pub const ETH_P_8021AH: ::std::os::raw::c_uint = 35047;
94 pub const ETH_P_MVRP: ::std::os::raw::c_uint = 35061;
95 pub const ETH_P_1588: ::std::os::raw::c_uint = 35063;
96 pub const ETH_P_PRP: ::std::os::raw::c_uint = 35067;
97 pub const ETH_P_FCOE: ::std::os::raw::c_uint = 35078;
98 pub const ETH_P_TDLS: ::std::os::raw::c_uint = 35085;
99 pub const ETH_P_FIP: ::std::os::raw::c_uint = 35092;
100 pub const ETH_P_80221: ::std::os::raw::c_uint = 35095;
101 pub const ETH_P_LOOPBACK: ::std::os::raw::c_uint = 36864;
102 pub const ETH_P_QINQ1: ::std::os::raw::c_uint = 37120;
103 pub const ETH_P_QINQ2: ::std::os::raw::c_uint = 37376;
104 pub const ETH_P_QINQ3: ::std::os::raw::c_uint = 37632;
105 pub const ETH_P_EDSA: ::std::os::raw::c_uint = 56026;
106 pub const ETH_P_AF_IUCV: ::std::os::raw::c_uint = 64507;
107 pub const ETH_P_802_3_MIN: ::std::os::raw::c_uint = 1536;
108 pub const ETH_P_802_3: ::std::os::raw::c_uint = 1;
109 pub const ETH_P_AX25: ::std::os::raw::c_uint = 2;
110 pub const ETH_P_ALL: ::std::os::raw::c_uint = 3;
111 pub const ETH_P_802_2: ::std::os::raw::c_uint = 4;
112 pub const ETH_P_SNAP: ::std::os::raw::c_uint = 5;
113 pub const ETH_P_DDCMP: ::std::os::raw::c_uint = 6;
114 pub const ETH_P_WAN_PPP: ::std::os::raw::c_uint = 7;
115 pub const ETH_P_PPP_MP: ::std::os::raw::c_uint = 8;
116 pub const ETH_P_LOCALTALK: ::std::os::raw::c_uint = 9;
117 pub const ETH_P_CAN: ::std::os::raw::c_uint = 12;
118 pub const ETH_P_CANFD: ::std::os::raw::c_uint = 13;
119 pub const ETH_P_PPPTALK: ::std::os::raw::c_uint = 16;
120 pub const ETH_P_TR_802_2: ::std::os::raw::c_uint = 17;
121 pub const ETH_P_MOBITEX: ::std::os::raw::c_uint = 21;
122 pub const ETH_P_CONTROL: ::std::os::raw::c_uint = 22;
123 pub const ETH_P_IRDA: ::std::os::raw::c_uint = 23;
124 pub const ETH_P_ECONET: ::std::os::raw::c_uint = 24;
125 pub const ETH_P_HDLC: ::std::os::raw::c_uint = 25;
126 pub const ETH_P_ARCNET: ::std::os::raw::c_uint = 26;
127 pub const ETH_P_DSA: ::std::os::raw::c_uint = 27;
128 pub const ETH_P_TRAILER: ::std::os::raw::c_uint = 28;
129 pub const ETH_P_PHONET: ::std::os::raw::c_uint = 245;
130 pub const ETH_P_IEEE802154: ::std::os::raw::c_uint = 246;
131 pub const ETH_P_CAIF: ::std::os::raw::c_uint = 247;
132 pub const ETH_P_XDSA: ::std::os::raw::c_uint = 248;
133 pub const BPF_LD: ::std::os::raw::c_uint = 0;
134 pub const BPF_LDX: ::std::os::raw::c_uint = 1;
135 pub const BPF_ST: ::std::os::raw::c_uint = 2;
136 pub const BPF_STX: ::std::os::raw::c_uint = 3;
137 pub const BPF_ALU: ::std::os::raw::c_uint = 4;
138 pub const BPF_JMP: ::std::os::raw::c_uint = 5;
139 pub const BPF_RET: ::std::os::raw::c_uint = 6;
140 pub const BPF_MISC: ::std::os::raw::c_uint = 7;
141 pub const BPF_W: ::std::os::raw::c_uint = 0;
142 pub const BPF_H: ::std::os::raw::c_uint = 8;
143 pub const BPF_B: ::std::os::raw::c_uint = 16;
144 pub const BPF_IMM: ::std::os::raw::c_uint = 0;
145 pub const BPF_ABS: ::std::os::raw::c_uint = 32;
146 pub const BPF_IND: ::std::os::raw::c_uint = 64;
147 pub const BPF_MEM: ::std::os::raw::c_uint = 96;
148 pub const BPF_LEN: ::std::os::raw::c_uint = 128;
149 pub const BPF_MSH: ::std::os::raw::c_uint = 160;
150 pub const BPF_ADD: ::std::os::raw::c_uint = 0;
151 pub const BPF_SUB: ::std::os::raw::c_uint = 16;
152 pub const BPF_MUL: ::std::os::raw::c_uint = 32;
153 pub const BPF_DIV: ::std::os::raw::c_uint = 48;
154 pub const BPF_OR: ::std::os::raw::c_uint = 64;
155 pub const BPF_AND: ::std::os::raw::c_uint = 80;
156 pub const BPF_LSH: ::std::os::raw::c_uint = 96;
157 pub const BPF_RSH: ::std::os::raw::c_uint = 112;
158 pub const BPF_NEG: ::std::os::raw::c_uint = 128;
159 pub const BPF_MOD: ::std::os::raw::c_uint = 144;
160 pub const BPF_XOR: ::std::os::raw::c_uint = 160;
161 pub const BPF_JA: ::std::os::raw::c_uint = 0;
162 pub const BPF_JEQ: ::std::os::raw::c_uint = 16;
163 pub const BPF_JGT: ::std::os::raw::c_uint = 32;
164 pub const BPF_JGE: ::std::os::raw::c_uint = 48;
165 pub const BPF_JSET: ::std::os::raw::c_uint = 64;
166 pub const BPF_K: ::std::os::raw::c_uint = 0;
167 pub const BPF_X: ::std::os::raw::c_uint = 8;
168 pub const BPF_MAXINSNS: ::std::os::raw::c_uint = 4096;
169 pub const BPF_MAJOR_VERSION: ::std::os::raw::c_uint = 1;
170 pub const BPF_MINOR_VERSION: ::std::os::raw::c_uint = 1;
171 pub const BPF_A: ::std::os::raw::c_uint = 16;
172 pub const BPF_TAX: ::std::os::raw::c_uint = 0;
173 pub const BPF_TXA: ::std::os::raw::c_uint = 128;
174 pub const BPF_MEMWORDS: ::std::os::raw::c_uint = 16;
175 pub const SKF_AD_OFF: ::std::os::raw::c_int = -4096;
176 pub const SKF_AD_PROTOCOL: ::std::os::raw::c_uint = 0;
177 pub const SKF_AD_PKTTYPE: ::std::os::raw::c_uint = 4;
178 pub const SKF_AD_IFINDEX: ::std::os::raw::c_uint = 8;
179 pub const SKF_AD_NLATTR: ::std::os::raw::c_uint = 12;
180 pub const SKF_AD_NLATTR_NEST: ::std::os::raw::c_uint = 16;
181 pub const SKF_AD_MARK: ::std::os::raw::c_uint = 20;
182 pub const SKF_AD_QUEUE: ::std::os::raw::c_uint = 24;
183 pub const SKF_AD_HATYPE: ::std::os::raw::c_uint = 28;
184 pub const SKF_AD_RXHASH: ::std::os::raw::c_uint = 32;
185 pub const SKF_AD_CPU: ::std::os::raw::c_uint = 36;
186 pub const SKF_AD_ALU_XOR_X: ::std::os::raw::c_uint = 40;
187 pub const SKF_AD_VLAN_TAG: ::std::os::raw::c_uint = 44;
188 pub const SKF_AD_VLAN_TAG_PRESENT: ::std::os::raw::c_uint = 48;
189 pub const SKF_AD_PAY_OFFSET: ::std::os::raw::c_uint = 52;
190 pub const SKF_AD_RANDOM: ::std::os::raw::c_uint = 56;
191 pub const SKF_AD_VLAN_TPID: ::std::os::raw::c_uint = 60;
192 pub const SKF_AD_MAX: ::std::os::raw::c_uint = 64;
193 pub const SKF_NET_OFF: ::std::os::raw::c_int = -1048576;
194 pub const SKF_LL_OFF: ::std::os::raw::c_int = -2097152;
195 pub const BPF_NET_OFF: ::std::os::raw::c_int = -1048576;
196 pub const BPF_LL_OFF: ::std::os::raw::c_int = -2097152;
197 pub const TUN_READQ_SIZE: ::std::os::raw::c_uint = 500;
198 pub const TUN_TYPE_MASK: ::std::os::raw::c_uint = 15;
199 pub const IFF_TUN: ::std::os::raw::c_uint = 1;
200 pub const IFF_TAP: ::std::os::raw::c_uint = 2;
201 pub const IFF_NO_PI: ::std::os::raw::c_uint = 4096;
202 pub const IFF_ONE_QUEUE: ::std::os::raw::c_uint = 8192;
203 pub const IFF_VNET_HDR: ::std::os::raw::c_uint = 16384;
204 pub const IFF_TUN_EXCL: ::std::os::raw::c_uint = 32768;
205 pub const IFF_MULTI_QUEUE: ::std::os::raw::c_uint = 256;
206 pub const IFF_ATTACH_QUEUE: ::std::os::raw::c_uint = 512;
207 pub const IFF_DETACH_QUEUE: ::std::os::raw::c_uint = 1024;
208 pub const IFF_PERSIST: ::std::os::raw::c_uint = 2048;
209 pub const IFF_NOFILTER: ::std::os::raw::c_uint = 4096;
210 pub const TUN_TX_TIMESTAMP: ::std::os::raw::c_uint = 1;
211 pub const TUN_F_CSUM: ::std::os::raw::c_uint = 1;
212 pub const TUN_F_TSO4: ::std::os::raw::c_uint = 2;
213 pub const TUN_F_TSO6: ::std::os::raw::c_uint = 4;
214 pub const TUN_F_TSO_ECN: ::std::os::raw::c_uint = 8;
215 pub const TUN_F_UFO: ::std::os::raw::c_uint = 16;
216 pub const TUN_PKT_STRIP: ::std::os::raw::c_uint = 1;
217 pub const TUN_FLT_ALLMULTI: ::std::os::raw::c_uint = 1;
218 pub type __s8 = ::std::os::raw::c_schar;
219 pub type __u8 = ::std::os::raw::c_uchar;
220 pub type __s16 = ::std::os::raw::c_short;
221 pub type __u16 = ::std::os::raw::c_ushort;
222 pub type __s32 = ::std::os::raw::c_int;
223 pub type __u32 = ::std::os::raw::c_uint;
224 pub type __s64 = ::std::os::raw::c_longlong;
225 pub type __u64 = ::std::os::raw::c_ulonglong;
226 #[repr(C)]
227 #[derive(Debug, Default, Copy)]
228 pub struct __kernel_fd_set {
229 pub fds_bits: [::std::os::raw::c_ulong; 16usize],
230 }
231 #[test]
bindgen_test_layout___kernel_fd_set()232 fn bindgen_test_layout___kernel_fd_set() {
233 assert_eq!(
234 ::std::mem::size_of::<__kernel_fd_set>(),
235 128usize,
236 concat!("Size of: ", stringify!(__kernel_fd_set))
237 );
238 assert_eq!(
239 ::std::mem::align_of::<__kernel_fd_set>(),
240 8usize,
241 concat!("Alignment of ", stringify!(__kernel_fd_set))
242 );
243 assert_eq!(
244 unsafe { &(*(0 as *const __kernel_fd_set)).fds_bits as *const _ as usize },
245 0usize,
246 concat!(
247 "Alignment of field: ",
248 stringify!(__kernel_fd_set),
249 "::",
250 stringify!(fds_bits)
251 )
252 );
253 }
254 impl Clone for __kernel_fd_set {
clone(&self) -> Self255 fn clone(&self) -> Self {
256 *self
257 }
258 }
259 pub type __kernel_sighandler_t =
260 ::std::option::Option<unsafe extern "C" fn(arg1: ::std::os::raw::c_int)>;
261 pub type __kernel_key_t = ::std::os::raw::c_int;
262 pub type __kernel_mqd_t = ::std::os::raw::c_int;
263 pub type __kernel_old_uid_t = ::std::os::raw::c_ushort;
264 pub type __kernel_old_gid_t = ::std::os::raw::c_ushort;
265 pub type __kernel_old_dev_t = ::std::os::raw::c_ulong;
266 pub type __kernel_long_t = ::std::os::raw::c_long;
267 pub type __kernel_ulong_t = ::std::os::raw::c_ulong;
268 pub type __kernel_ino_t = __kernel_ulong_t;
269 pub type __kernel_mode_t = ::std::os::raw::c_uint;
270 pub type __kernel_pid_t = ::std::os::raw::c_int;
271 pub type __kernel_ipc_pid_t = ::std::os::raw::c_int;
272 pub type __kernel_uid_t = ::std::os::raw::c_uint;
273 pub type __kernel_gid_t = ::std::os::raw::c_uint;
274 pub type __kernel_suseconds_t = __kernel_long_t;
275 pub type __kernel_daddr_t = ::std::os::raw::c_int;
276 pub type __kernel_uid32_t = ::std::os::raw::c_uint;
277 pub type __kernel_gid32_t = ::std::os::raw::c_uint;
278 pub type __kernel_size_t = __kernel_ulong_t;
279 pub type __kernel_ssize_t = __kernel_long_t;
280 pub type __kernel_ptrdiff_t = __kernel_long_t;
281 #[repr(C)]
282 #[derive(Debug, Default, Copy)]
283 pub struct __kernel_fsid_t {
284 pub val: [::std::os::raw::c_int; 2usize],
285 }
286 #[test]
bindgen_test_layout___kernel_fsid_t()287 fn bindgen_test_layout___kernel_fsid_t() {
288 assert_eq!(
289 ::std::mem::size_of::<__kernel_fsid_t>(),
290 8usize,
291 concat!("Size of: ", stringify!(__kernel_fsid_t))
292 );
293 assert_eq!(
294 ::std::mem::align_of::<__kernel_fsid_t>(),
295 4usize,
296 concat!("Alignment of ", stringify!(__kernel_fsid_t))
297 );
298 assert_eq!(
299 unsafe { &(*(0 as *const __kernel_fsid_t)).val as *const _ as usize },
300 0usize,
301 concat!(
302 "Alignment of field: ",
303 stringify!(__kernel_fsid_t),
304 "::",
305 stringify!(val)
306 )
307 );
308 }
309 impl Clone for __kernel_fsid_t {
clone(&self) -> Self310 fn clone(&self) -> Self {
311 *self
312 }
313 }
314 pub type __kernel_off_t = __kernel_long_t;
315 pub type __kernel_loff_t = ::std::os::raw::c_longlong;
316 pub type __kernel_time_t = __kernel_long_t;
317 pub type __kernel_clock_t = __kernel_long_t;
318 pub type __kernel_timer_t = ::std::os::raw::c_int;
319 pub type __kernel_clockid_t = ::std::os::raw::c_int;
320 pub type __kernel_caddr_t = *mut ::std::os::raw::c_char;
321 pub type __kernel_uid16_t = ::std::os::raw::c_ushort;
322 pub type __kernel_gid16_t = ::std::os::raw::c_ushort;
323 pub type __le16 = __u16;
324 pub type __be16 = __u16;
325 pub type __le32 = __u32;
326 pub type __be32 = __u32;
327 pub type __le64 = __u64;
328 pub type __be64 = __u64;
329 pub type __sum16 = __u16;
330 pub type __wsum = __u32;
331 #[repr(C, packed)]
332 #[derive(Debug, Default, Copy)]
333 pub struct ethhdr {
334 pub h_dest: [::std::os::raw::c_uchar; 6usize],
335 pub h_source: [::std::os::raw::c_uchar; 6usize],
336 pub h_proto: __be16,
337 }
338 #[test]
bindgen_test_layout_ethhdr()339 fn bindgen_test_layout_ethhdr() {
340 assert_eq!(
341 ::std::mem::size_of::<ethhdr>(),
342 14usize,
343 concat!("Size of: ", stringify!(ethhdr))
344 );
345 assert_eq!(
346 ::std::mem::align_of::<ethhdr>(),
347 1usize,
348 concat!("Alignment of ", stringify!(ethhdr))
349 );
350 assert_eq!(
351 unsafe { &(*(0 as *const ethhdr)).h_dest as *const _ as usize },
352 0usize,
353 concat!(
354 "Alignment of field: ",
355 stringify!(ethhdr),
356 "::",
357 stringify!(h_dest)
358 )
359 );
360 assert_eq!(
361 unsafe { &(*(0 as *const ethhdr)).h_source as *const _ as usize },
362 6usize,
363 concat!(
364 "Alignment of field: ",
365 stringify!(ethhdr),
366 "::",
367 stringify!(h_source)
368 )
369 );
370 assert_eq!(
371 unsafe { &(*(0 as *const ethhdr)).h_proto as *const _ as usize },
372 12usize,
373 concat!(
374 "Alignment of field: ",
375 stringify!(ethhdr),
376 "::",
377 stringify!(h_proto)
378 )
379 );
380 }
381 impl Clone for ethhdr {
clone(&self) -> Self382 fn clone(&self) -> Self {
383 *self
384 }
385 }
386 #[repr(C)]
387 #[derive(Debug, Default, Copy)]
388 pub struct sock_filter {
389 pub code: __u16,
390 pub jt: __u8,
391 pub jf: __u8,
392 pub k: __u32,
393 }
394 #[test]
bindgen_test_layout_sock_filter()395 fn bindgen_test_layout_sock_filter() {
396 assert_eq!(
397 ::std::mem::size_of::<sock_filter>(),
398 8usize,
399 concat!("Size of: ", stringify!(sock_filter))
400 );
401 assert_eq!(
402 ::std::mem::align_of::<sock_filter>(),
403 4usize,
404 concat!("Alignment of ", stringify!(sock_filter))
405 );
406 assert_eq!(
407 unsafe { &(*(0 as *const sock_filter)).code as *const _ as usize },
408 0usize,
409 concat!(
410 "Alignment of field: ",
411 stringify!(sock_filter),
412 "::",
413 stringify!(code)
414 )
415 );
416 assert_eq!(
417 unsafe { &(*(0 as *const sock_filter)).jt as *const _ as usize },
418 2usize,
419 concat!(
420 "Alignment of field: ",
421 stringify!(sock_filter),
422 "::",
423 stringify!(jt)
424 )
425 );
426 assert_eq!(
427 unsafe { &(*(0 as *const sock_filter)).jf as *const _ as usize },
428 3usize,
429 concat!(
430 "Alignment of field: ",
431 stringify!(sock_filter),
432 "::",
433 stringify!(jf)
434 )
435 );
436 assert_eq!(
437 unsafe { &(*(0 as *const sock_filter)).k as *const _ as usize },
438 4usize,
439 concat!(
440 "Alignment of field: ",
441 stringify!(sock_filter),
442 "::",
443 stringify!(k)
444 )
445 );
446 }
447 impl Clone for sock_filter {
clone(&self) -> Self448 fn clone(&self) -> Self {
449 *self
450 }
451 }
452 #[repr(C)]
453 #[derive(Debug, Copy)]
454 pub struct sock_fprog {
455 pub len: ::std::os::raw::c_ushort,
456 pub filter: *mut sock_filter,
457 }
458 #[test]
bindgen_test_layout_sock_fprog()459 fn bindgen_test_layout_sock_fprog() {
460 assert_eq!(
461 ::std::mem::size_of::<sock_fprog>(),
462 16usize,
463 concat!("Size of: ", stringify!(sock_fprog))
464 );
465 assert_eq!(
466 ::std::mem::align_of::<sock_fprog>(),
467 8usize,
468 concat!("Alignment of ", stringify!(sock_fprog))
469 );
470 assert_eq!(
471 unsafe { &(*(0 as *const sock_fprog)).len as *const _ as usize },
472 0usize,
473 concat!(
474 "Alignment of field: ",
475 stringify!(sock_fprog),
476 "::",
477 stringify!(len)
478 )
479 );
480 assert_eq!(
481 unsafe { &(*(0 as *const sock_fprog)).filter as *const _ as usize },
482 8usize,
483 concat!(
484 "Alignment of field: ",
485 stringify!(sock_fprog),
486 "::",
487 stringify!(filter)
488 )
489 );
490 }
491 impl Clone for sock_fprog {
clone(&self) -> Self492 fn clone(&self) -> Self {
493 *self
494 }
495 }
496 impl Default for sock_fprog {
default() -> Self497 fn default() -> Self {
498 unsafe { ::std::mem::zeroed() }
499 }
500 }
501 #[repr(C)]
502 #[derive(Debug, Default, Copy)]
503 pub struct tun_pi {
504 pub flags: __u16,
505 pub proto: __be16,
506 }
507 #[test]
bindgen_test_layout_tun_pi()508 fn bindgen_test_layout_tun_pi() {
509 assert_eq!(
510 ::std::mem::size_of::<tun_pi>(),
511 4usize,
512 concat!("Size of: ", stringify!(tun_pi))
513 );
514 assert_eq!(
515 ::std::mem::align_of::<tun_pi>(),
516 2usize,
517 concat!("Alignment of ", stringify!(tun_pi))
518 );
519 assert_eq!(
520 unsafe { &(*(0 as *const tun_pi)).flags as *const _ as usize },
521 0usize,
522 concat!(
523 "Alignment of field: ",
524 stringify!(tun_pi),
525 "::",
526 stringify!(flags)
527 )
528 );
529 assert_eq!(
530 unsafe { &(*(0 as *const tun_pi)).proto as *const _ as usize },
531 2usize,
532 concat!(
533 "Alignment of field: ",
534 stringify!(tun_pi),
535 "::",
536 stringify!(proto)
537 )
538 );
539 }
540 impl Clone for tun_pi {
clone(&self) -> Self541 fn clone(&self) -> Self {
542 *self
543 }
544 }
545 #[repr(C)]
546 #[derive(Debug, Default, Copy)]
547 pub struct tun_filter {
548 pub flags: __u16,
549 pub count: __u16,
550 pub addr: __IncompleteArrayField<[__u8; 6usize]>,
551 }
552 #[test]
bindgen_test_layout_tun_filter()553 fn bindgen_test_layout_tun_filter() {
554 assert_eq!(
555 ::std::mem::size_of::<tun_filter>(),
556 4usize,
557 concat!("Size of: ", stringify!(tun_filter))
558 );
559 assert_eq!(
560 ::std::mem::align_of::<tun_filter>(),
561 2usize,
562 concat!("Alignment of ", stringify!(tun_filter))
563 );
564 assert_eq!(
565 unsafe { &(*(0 as *const tun_filter)).flags as *const _ as usize },
566 0usize,
567 concat!(
568 "Alignment of field: ",
569 stringify!(tun_filter),
570 "::",
571 stringify!(flags)
572 )
573 );
574 assert_eq!(
575 unsafe { &(*(0 as *const tun_filter)).count as *const _ as usize },
576 2usize,
577 concat!(
578 "Alignment of field: ",
579 stringify!(tun_filter),
580 "::",
581 stringify!(count)
582 )
583 );
584 assert_eq!(
585 unsafe { &(*(0 as *const tun_filter)).addr as *const _ as usize },
586 4usize,
587 concat!(
588 "Alignment of field: ",
589 stringify!(tun_filter),
590 "::",
591 stringify!(addr)
592 )
593 );
594 }
595 impl Clone for tun_filter {
clone(&self) -> Self596 fn clone(&self) -> Self {
597 *self
598 }
599 }
600