libc_extra/android_linux/linux/ethtool/
ethtool_rx_ntuple_flow_spec.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_rx_ntuple_flow_spec
9{
10	pub flow_type: u32,
11	pub h_u: Union_Unnamed1,
12	pub m_u: Union_Unnamed1,
13	pub vlan_tag: u16,
14	pub vlan_tag_mask: u16,
15	pub data: u64,
16	pub data_mask: u64,
17	pub action: i32,
18}
19
20impl Clone for ethtool_rx_ntuple_flow_spec
21{
22	fn clone(&self) -> Self
23	{
24		*self
25	}
26}
27
28impl Default for ethtool_rx_ntuple_flow_spec
29{
30	fn default() -> Self
31	{
32		unsafe { zeroed() }
33	}
34}
35
36#[repr(C)]
37#[derive(Copy)]
38#[allow(missing_debug_implementations)]
39pub struct Union_Unnamed1
40{
41	pub _bindgen_data_: [u32; 18],
42}
43
44impl Union_Unnamed1
45{
46	pub unsafe fn tcp_ip4_spec(&mut self) -> *mut ethtool_tcpip4_spec
47	{
48		let raw: *mut u8 = transmute(&self._bindgen_data_);
49		transmute(raw.offset(0))
50	}
51	
52	pub unsafe fn udp_ip4_spec(&mut self) -> *mut ethtool_tcpip4_spec
53	{
54		let raw: *mut u8 = transmute(&self._bindgen_data_);
55		transmute(raw.offset(0))
56	}
57	
58	pub unsafe fn sctp_ip4_spec(&mut self) -> *mut ethtool_tcpip4_spec
59	{
60		let raw: *mut u8 = transmute(&self._bindgen_data_);
61		transmute(raw.offset(0))
62	}
63	
64	pub unsafe fn ah_ip4_spec(&mut self) -> *mut ethtool_ah_espip4_spec
65	{
66		let raw: *mut u8 = transmute(&self._bindgen_data_);
67		transmute(raw.offset(0))
68	}
69	
70	pub unsafe fn esp_ip4_spec(&mut self) -> *mut ethtool_ah_espip4_spec
71	{
72		let raw: *mut u8 = transmute(&self._bindgen_data_);
73		transmute(raw.offset(0))
74	}
75	
76	pub unsafe fn usr_ip4_spec(&mut self) -> *mut ethtool_usrip4_spec
77	{
78		let raw: *mut u8 = transmute(&self._bindgen_data_);
79		transmute(raw.offset(0))
80	}
81	
82	pub unsafe fn ether_spec(&mut self) -> *mut ethhdr
83	{
84		let raw: *mut u8 = transmute(&self._bindgen_data_);
85		transmute(raw.offset(0))
86	}
87	
88	pub unsafe fn hdata(&mut self) -> *mut [u8; 72]
89	{
90		let raw: *mut u8 = transmute(&self._bindgen_data_);
91		transmute(raw.offset(0))
92	}
93}
94
95impl Clone for Union_Unnamed1
96{
97	fn clone(&self) -> Self
98	{
99		*self
100	}
101}
102
103impl Default for Union_Unnamed1
104{
105	fn default() -> Self
106	{
107		unsafe { zeroed() }
108	}
109}