ifaddrs.h revision 091a80ae
1/*
2 * Copyright 2015, Haiku, Inc. All Rights Reserved.
3 * Distributed under the terms of the MIT License.
4 */
5#ifndef _IFADDRS_H
6#define _IFADDRS_H
7
8
9#ifdef _BSD_SOURCE
10
11
12#ifdef __cplusplus
13extern "C" {
14#endif
15
16
17struct ifaddrs {
18	struct ifaddrs  *ifa_next;    /* Next item in list */
19	const char      *ifa_name;    /* Name of interface */
20	unsigned int     ifa_flags;   /* Flags from SIOCGIFFLAGS */
21	struct sockaddr *ifa_addr;    /* Address of interface */
22	struct sockaddr *ifa_netmask; /* Netmask of interface */
23	struct sockaddr *ifa_dstaddr;
24	#define         ifa_broadaddr ifa_dstaddr
25	void            *ifa_data;    /* Address-specific data */
26};
27
28
29int getifaddrs(struct ifaddrs **ifap);
30void freeifaddrs(struct ifaddrs *ifa);
31
32
33#ifdef __cplusplus
34}
35#endif
36
37
38#endif
39
40
41#endif
42