if_addrs_sys/
lib.rs

1// Copyright 2018 MaidSafe.net limited.
2//
3// This SAFE Network Software is licensed to you under the MIT license <LICENSE-MIT
4// http://opensource.org/licenses/MIT> or the Modified BSD license <LICENSE-BSD
5// https://opensource.org/licenses/BSD-3-Clause>, at your option. This file may not be copied,
6// modified, or distributed except according to those terms. Please review the Licences for the
7// specific language governing permissions and limitations relating to use of the SAFE Network
8// Software.
9use libc::{c_char, c_int, c_uint, c_void, sockaddr};
10
11#[repr(C)]
12#[derive(Debug, Clone, Copy)]
13pub struct ifaddrs {
14    pub ifa_next: *mut ifaddrs,
15    pub ifa_name: *mut c_char,
16    pub ifa_flags: c_uint,
17    pub ifa_addr: *mut sockaddr,
18    pub ifa_netmask: *mut sockaddr,
19    pub ifa_ifu: *mut sockaddr,
20    pub ifa_data: *mut c_void,
21}
22
23extern "C" {
24    pub fn getifaddrs(ifap: *mut *mut ifaddrs) -> c_int;
25    pub fn freeifaddrs(ifa: *mut ifaddrs);
26}