net_sys/
iff.rs

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
11use libc::sockaddr;
12
13#[repr(C)]
14#[derive(Debug, Default, Copy, Clone)]
15pub 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)]
22pub 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)]
30pub 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)]
36pub 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)]
47pub struct fr_proto_pvc {
48    pub dlci: ::std::os::raw::c_uint,
49}
50#[repr(C)]
51#[derive(Debug, Default, Copy, Clone)]
52pub 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)]
58pub 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)]
64pub 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}
72impl net_device_flags {
73    pub const IFF_UP: net_device_flags = net_device_flags(1);
74}
75impl net_device_flags {
76    pub const IFF_BROADCAST: net_device_flags = net_device_flags(2);
77}
78impl net_device_flags {
79    pub const IFF_DEBUG: net_device_flags = net_device_flags(4);
80}
81impl net_device_flags {
82    pub const IFF_LOOPBACK: net_device_flags = net_device_flags(8);
83}
84impl net_device_flags {
85    pub const IFF_POINTOPOINT: net_device_flags = net_device_flags(16);
86}
87impl net_device_flags {
88    pub const IFF_NOTRAILERS: net_device_flags = net_device_flags(32);
89}
90impl net_device_flags {
91    pub const IFF_RUNNING: net_device_flags = net_device_flags(64);
92}
93impl net_device_flags {
94    pub const IFF_NOARP: net_device_flags = net_device_flags(128);
95}
96impl net_device_flags {
97    pub const IFF_PROMISC: net_device_flags = net_device_flags(256);
98}
99impl net_device_flags {
100    pub const IFF_ALLMULTI: net_device_flags = net_device_flags(512);
101}
102impl net_device_flags {
103    pub const IFF_MASTER: net_device_flags = net_device_flags(1024);
104}
105impl net_device_flags {
106    pub const IFF_SLAVE: net_device_flags = net_device_flags(2048);
107}
108impl net_device_flags {
109    pub const IFF_MULTICAST: net_device_flags = net_device_flags(4096);
110}
111impl net_device_flags {
112    pub const IFF_PORTSEL: net_device_flags = net_device_flags(8192);
113}
114impl net_device_flags {
115    pub const IFF_AUTOMEDIA: net_device_flags = net_device_flags(16384);
116}
117impl net_device_flags {
118    pub const IFF_DYNAMIC: net_device_flags = net_device_flags(32768);
119}
120impl net_device_flags {
121    pub const IFF_LOWER_UP: net_device_flags = net_device_flags(65536);
122}
123impl net_device_flags {
124    pub const IFF_DORMANT: net_device_flags = net_device_flags(131072);
125}
126impl net_device_flags {
127    pub const IFF_ECHO: net_device_flags = net_device_flags(262144);
128}
129impl ::std::ops::BitOr<net_device_flags> for net_device_flags {
130    type Output = Self;
131    #[inline]
132    fn bitor(self, other: Self) -> Self {
133        net_device_flags(self.0 | other.0)
134    }
135}
136impl ::std::ops::BitOrAssign for net_device_flags {
137    #[inline]
138    fn bitor_assign(&mut self, rhs: net_device_flags) {
139        self.0 |= rhs.0;
140    }
141}
142impl ::std::ops::BitAnd<net_device_flags> for net_device_flags {
143    type Output = Self;
144    #[inline]
145    fn bitand(self, other: Self) -> Self {
146        net_device_flags(self.0 & other.0)
147    }
148}
149impl ::std::ops::BitAndAssign for net_device_flags {
150    #[inline]
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)]
157pub struct net_device_flags(pub ::std::os::raw::c_uint);
158#[repr(C)]
159#[derive(Debug, Default, Copy, Clone)]
160pub 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)]
170pub 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)]
177pub 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}
187impl Default for if_settings__bindgen_ty_1 {
188    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}
196impl Default for if_settings {
197    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)]
207pub 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)]
213pub union ifreq__bindgen_ty_1 {
214    pub ifrn_name: [::std::os::raw::c_char; 16usize],
215}
216impl Default for ifreq__bindgen_ty_1 {
217    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)]
227pub 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}
242impl Default for ifreq__bindgen_ty_2 {
243    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}
251impl Default for ifreq {
252    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}