libc_extra/android_linux/linux/ethtool/
ethtool_flow_union.rs

1// This file is part of libc-extra. It is subject to the license terms in the COPYRIGHT file found in the top-level directory of this distribution and at https://raw.githubusercontent.com/lemonrock/libc-extra/master/COPYRIGHT. No part of libc-extra, including this file, may be copied, modified, propagated, or distributed except according to the terms contained in the COPYRIGHT file.
2// Copyright © 2016-2018 The developers of libc-extra. See the COPYRIGHT file in the top-level directory of this distribution and at https://raw.githubusercontent.com/lemonrock/libc-extra/master/COPYRIGHT.
3
4
5#[repr(C)]
6#[derive(Copy)]
7#[allow(missing_debug_implementations)]
8pub struct ethtool_flow_union
9{
10	pub _bindgen_data_: [u32; 13],
11}
12
13impl ethtool_flow_union
14{
15	pub unsafe fn tcp_ip4_spec(&mut self) -> *mut ethtool_tcpip4_spec
16	{
17		let raw: *mut u8 = transmute(&self._bindgen_data_);
18		transmute(raw.offset(0))
19	}
20	
21	pub unsafe fn udp_ip4_spec(&mut self) -> *mut ethtool_tcpip4_spec
22	{
23		let raw: *mut u8 = transmute(&self._bindgen_data_);
24		transmute(raw.offset(0))
25	}
26	
27	pub unsafe fn sctp_ip4_spec(&mut self) -> *mut ethtool_tcpip4_spec
28	{
29		let raw: *mut u8 = transmute(&self._bindgen_data_);
30		transmute(raw.offset(0))
31	}
32	pub unsafe fn ah_ip4_spec(&mut self) -> *mut ethtool_ah_espip4_spec
33	{
34		let raw: *mut u8 = transmute(&self._bindgen_data_);
35		transmute(raw.offset(0))
36	}
37	
38	pub unsafe fn esp_ip4_spec(&mut self) -> *mut ethtool_ah_espip4_spec
39	{
40		let raw: *mut u8 = transmute(&self._bindgen_data_);
41		transmute(raw.offset(0))
42	}
43	
44	pub unsafe fn usr_ip4_spec(&mut self) -> *mut ethtool_usrip4_spec
45	{
46		let raw: *mut u8 = transmute(&self._bindgen_data_);
47		transmute(raw.offset(0))
48	}
49	
50	pub unsafe fn ether_spec(&mut self) -> *mut ethhdr
51	{
52		let raw: *mut u8 = transmute(&self._bindgen_data_);
53		transmute(raw.offset(0))
54	}
55	
56	pub unsafe fn hdata(&mut self) -> *mut [u8; 52]
57	{
58		let raw: *mut u8 = transmute(&self._bindgen_data_);
59		transmute(raw.offset(0))
60	}
61}
62
63impl Clone for ethtool_flow_union
64{
65	fn clone(&self) -> Self
66	{
67		*self
68	}
69}
70
71impl Default for ethtool_flow_union
72{
73	fn default() -> Self
74	{
75		unsafe { zeroed() }
76	}
77}