xref: /aosp_15_r20/external/crosvm/net_sys/src/iff.rs (revision bb4ee6a4ae7042d18b07a98463b9c8b875e44b39)
1 /* automatically generated by tools/bindgen-all-the-things */
2 
3 #![allow(clippy::missing_safety_doc)]
4 #![allow(clippy::undocumented_unsafe_blocks)]
5 #![allow(clippy::upper_case_acronyms)]
6 #![allow(non_upper_case_globals)]
7 #![allow(non_camel_case_types)]
8 #![allow(non_snake_case)]
9 #![allow(dead_code)]
10 
11 use libc::sockaddr;
12 
13 #[repr(C)]
14 #[derive(Debug, Default, Copy, Clone)]
15 pub struct sync_serial_settings {
16     pub clock_rate: ::std::os::raw::c_uint,
17     pub clock_type: ::std::os::raw::c_uint,
18     pub loopback: ::std::os::raw::c_ushort,
19 }
20 #[repr(C)]
21 #[derive(Debug, Default, Copy, Clone)]
22 pub struct te1_settings {
23     pub clock_rate: ::std::os::raw::c_uint,
24     pub clock_type: ::std::os::raw::c_uint,
25     pub loopback: ::std::os::raw::c_ushort,
26     pub slot_map: ::std::os::raw::c_uint,
27 }
28 #[repr(C)]
29 #[derive(Debug, Default, Copy, Clone)]
30 pub struct raw_hdlc_proto {
31     pub encoding: ::std::os::raw::c_ushort,
32     pub parity: ::std::os::raw::c_ushort,
33 }
34 #[repr(C)]
35 #[derive(Debug, Default, Copy, Clone)]
36 pub struct fr_proto {
37     pub t391: ::std::os::raw::c_uint,
38     pub t392: ::std::os::raw::c_uint,
39     pub n391: ::std::os::raw::c_uint,
40     pub n392: ::std::os::raw::c_uint,
41     pub n393: ::std::os::raw::c_uint,
42     pub lmi: ::std::os::raw::c_ushort,
43     pub dce: ::std::os::raw::c_ushort,
44 }
45 #[repr(C)]
46 #[derive(Debug, Default, Copy, Clone)]
47 pub struct fr_proto_pvc {
48     pub dlci: ::std::os::raw::c_uint,
49 }
50 #[repr(C)]
51 #[derive(Debug, Default, Copy, Clone)]
52 pub struct fr_proto_pvc_info {
53     pub dlci: ::std::os::raw::c_uint,
54     pub master: [::std::os::raw::c_char; 16usize],
55 }
56 #[repr(C)]
57 #[derive(Debug, Default, Copy, Clone)]
58 pub struct cisco_proto {
59     pub interval: ::std::os::raw::c_uint,
60     pub timeout: ::std::os::raw::c_uint,
61 }
62 #[repr(C)]
63 #[derive(Debug, Default, Copy, Clone)]
64 pub struct x25_hdlc_proto {
65     pub dce: ::std::os::raw::c_ushort,
66     pub modulo: ::std::os::raw::c_uint,
67     pub window: ::std::os::raw::c_uint,
68     pub t1: ::std::os::raw::c_uint,
69     pub t2: ::std::os::raw::c_uint,
70     pub n2: ::std::os::raw::c_uint,
71 }
72 impl net_device_flags {
73     pub const IFF_UP: net_device_flags = net_device_flags(1);
74 }
75 impl net_device_flags {
76     pub const IFF_BROADCAST: net_device_flags = net_device_flags(2);
77 }
78 impl net_device_flags {
79     pub const IFF_DEBUG: net_device_flags = net_device_flags(4);
80 }
81 impl net_device_flags {
82     pub const IFF_LOOPBACK: net_device_flags = net_device_flags(8);
83 }
84 impl net_device_flags {
85     pub const IFF_POINTOPOINT: net_device_flags = net_device_flags(16);
86 }
87 impl net_device_flags {
88     pub const IFF_NOTRAILERS: net_device_flags = net_device_flags(32);
89 }
90 impl net_device_flags {
91     pub const IFF_RUNNING: net_device_flags = net_device_flags(64);
92 }
93 impl net_device_flags {
94     pub const IFF_NOARP: net_device_flags = net_device_flags(128);
95 }
96 impl net_device_flags {
97     pub const IFF_PROMISC: net_device_flags = net_device_flags(256);
98 }
99 impl net_device_flags {
100     pub const IFF_ALLMULTI: net_device_flags = net_device_flags(512);
101 }
102 impl net_device_flags {
103     pub const IFF_MASTER: net_device_flags = net_device_flags(1024);
104 }
105 impl net_device_flags {
106     pub const IFF_SLAVE: net_device_flags = net_device_flags(2048);
107 }
108 impl net_device_flags {
109     pub const IFF_MULTICAST: net_device_flags = net_device_flags(4096);
110 }
111 impl net_device_flags {
112     pub const IFF_PORTSEL: net_device_flags = net_device_flags(8192);
113 }
114 impl net_device_flags {
115     pub const IFF_AUTOMEDIA: net_device_flags = net_device_flags(16384);
116 }
117 impl net_device_flags {
118     pub const IFF_DYNAMIC: net_device_flags = net_device_flags(32768);
119 }
120 impl net_device_flags {
121     pub const IFF_LOWER_UP: net_device_flags = net_device_flags(65536);
122 }
123 impl net_device_flags {
124     pub const IFF_DORMANT: net_device_flags = net_device_flags(131072);
125 }
126 impl net_device_flags {
127     pub const IFF_ECHO: net_device_flags = net_device_flags(262144);
128 }
129 impl ::std::ops::BitOr<net_device_flags> for net_device_flags {
130     type Output = Self;
131     #[inline]
bitor(self, other: Self) -> Self132     fn bitor(self, other: Self) -> Self {
133         net_device_flags(self.0 | other.0)
134     }
135 }
136 impl ::std::ops::BitOrAssign for net_device_flags {
137     #[inline]
bitor_assign(&mut self, rhs: net_device_flags)138     fn bitor_assign(&mut self, rhs: net_device_flags) {
139         self.0 |= rhs.0;
140     }
141 }
142 impl ::std::ops::BitAnd<net_device_flags> for net_device_flags {
143     type Output = Self;
144     #[inline]
bitand(self, other: Self) -> Self145     fn bitand(self, other: Self) -> Self {
146         net_device_flags(self.0 & other.0)
147     }
148 }
149 impl ::std::ops::BitAndAssign for net_device_flags {
150     #[inline]
bitand_assign(&mut self, rhs: net_device_flags)151     fn bitand_assign(&mut self, rhs: net_device_flags) {
152         self.0 &= rhs.0;
153     }
154 }
155 #[repr(transparent)]
156 #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
157 pub struct net_device_flags(pub ::std::os::raw::c_uint);
158 #[repr(C)]
159 #[derive(Debug, Default, Copy, Clone)]
160 pub struct ifmap {
161     pub mem_start: ::std::os::raw::c_ulong,
162     pub mem_end: ::std::os::raw::c_ulong,
163     pub base_addr: ::std::os::raw::c_ushort,
164     pub irq: ::std::os::raw::c_uchar,
165     pub dma: ::std::os::raw::c_uchar,
166     pub port: ::std::os::raw::c_uchar,
167 }
168 #[repr(C)]
169 #[derive(Copy, Clone)]
170 pub struct if_settings {
171     pub type_: ::std::os::raw::c_uint,
172     pub size: ::std::os::raw::c_uint,
173     pub ifs_ifsu: if_settings__bindgen_ty_1,
174 }
175 #[repr(C)]
176 #[derive(Copy, Clone)]
177 pub union if_settings__bindgen_ty_1 {
178     pub raw_hdlc: *mut raw_hdlc_proto,
179     pub cisco: *mut cisco_proto,
180     pub fr: *mut fr_proto,
181     pub fr_pvc: *mut fr_proto_pvc,
182     pub fr_pvc_info: *mut fr_proto_pvc_info,
183     pub x25: *mut x25_hdlc_proto,
184     pub sync: *mut sync_serial_settings,
185     pub te1: *mut te1_settings,
186 }
187 impl Default for if_settings__bindgen_ty_1 {
default() -> Self188     fn default() -> Self {
189         let mut s = ::std::mem::MaybeUninit::<Self>::uninit();
190         unsafe {
191             ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
192             s.assume_init()
193         }
194     }
195 }
196 impl Default for if_settings {
default() -> Self197     fn default() -> Self {
198         let mut s = ::std::mem::MaybeUninit::<Self>::uninit();
199         unsafe {
200             ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
201             s.assume_init()
202         }
203     }
204 }
205 #[repr(C)]
206 #[derive(Copy, Clone)]
207 pub struct ifreq {
208     pub ifr_ifrn: ifreq__bindgen_ty_1,
209     pub ifr_ifru: ifreq__bindgen_ty_2,
210 }
211 #[repr(C)]
212 #[derive(Copy, Clone)]
213 pub union ifreq__bindgen_ty_1 {
214     pub ifrn_name: [::std::os::raw::c_char; 16usize],
215 }
216 impl Default for ifreq__bindgen_ty_1 {
default() -> Self217     fn default() -> Self {
218         let mut s = ::std::mem::MaybeUninit::<Self>::uninit();
219         unsafe {
220             ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
221             s.assume_init()
222         }
223     }
224 }
225 #[repr(C)]
226 #[derive(Copy, Clone)]
227 pub union ifreq__bindgen_ty_2 {
228     pub ifru_addr: sockaddr,
229     pub ifru_dstaddr: sockaddr,
230     pub ifru_broadaddr: sockaddr,
231     pub ifru_netmask: sockaddr,
232     pub ifru_hwaddr: sockaddr,
233     pub ifru_flags: ::std::os::raw::c_short,
234     pub ifru_ivalue: ::std::os::raw::c_int,
235     pub ifru_mtu: ::std::os::raw::c_int,
236     pub ifru_map: ifmap,
237     pub ifru_slave: [::std::os::raw::c_char; 16usize],
238     pub ifru_newname: [::std::os::raw::c_char; 16usize],
239     pub ifru_data: *mut ::std::os::raw::c_void,
240     pub ifru_settings: if_settings,
241 }
242 impl Default for ifreq__bindgen_ty_2 {
default() -> Self243     fn default() -> Self {
244         let mut s = ::std::mem::MaybeUninit::<Self>::uninit();
245         unsafe {
246             ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
247             s.assume_init()
248         }
249     }
250 }
251 impl Default for ifreq {
default() -> Self252     fn default() -> Self {
253         let mut s = ::std::mem::MaybeUninit::<Self>::uninit();
254         unsafe {
255             ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
256             s.assume_init()
257         }
258     }
259 }
260