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