net_sys/
iff.rs

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