libc_extra/android_linux/net/if_/
ifaddr.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#[allow(missing_debug_implementations)]
7#[allow(missing_copy_implementations)]
8pub struct ifaddr
9{
10	pub ifa_addr: sockaddr,
11	pub ifa_ifu: Union_Unnamed1,
12	pub ifa_ifp: *mut iface,
13	pub ifa_next: *mut ifaddr,
14}
15
16impl Default for ifaddr
17{
18	fn default() -> Self
19	{
20		unsafe { zeroed() }
21	}
22}
23
24#[repr(C)]
25#[derive(Debug, Copy, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
26pub struct Union_Unnamed1
27{
28	pub _bindgen_data_: [u16; 8],
29}
30
31impl Union_Unnamed1
32{
33	pub unsafe fn ifu_broadaddr(&mut self) -> *mut sockaddr
34	{
35		let raw: *mut u8 = transmute(&self._bindgen_data_);
36		transmute(raw.offset(0))
37	}
38	
39	pub unsafe fn ifu_dstaddr(&mut self) -> *mut sockaddr
40	{
41		let raw: *mut u8 = transmute(&self._bindgen_data_);
42		transmute(raw.offset(0))
43	}
44}
45
46impl Default for Union_Unnamed1
47{
48	fn default() -> Self
49	{
50		unsafe { zeroed() }
51	}
52}