haiku/headers/compatibility/bsd/ifaddrs.h
Adrien Destugues 091a80aeed Protect all BSD extensions with _BSD_SOURCE
* Do not define the symbols by default, as they are not in the default
libraries.
* Adjust jamfiles of all code using BSD extensions to define
_BSD_SOURCE.
* This makes Haiku slightly more compliant to standard C/POSIX.
2015-04-16 07:33:06 +02:00

42 lines
780 B
C

/*
* Copyright 2015, Haiku, Inc. All Rights Reserved.
* Distributed under the terms of the MIT License.
*/
#ifndef _IFADDRS_H
#define _IFADDRS_H
#ifdef _BSD_SOURCE
#ifdef __cplusplus
extern "C" {
#endif
struct ifaddrs {
struct ifaddrs *ifa_next; /* Next item in list */
const char *ifa_name; /* Name of interface */
unsigned int ifa_flags; /* Flags from SIOCGIFFLAGS */
struct sockaddr *ifa_addr; /* Address of interface */
struct sockaddr *ifa_netmask; /* Netmask of interface */
struct sockaddr *ifa_dstaddr;
#define ifa_broadaddr ifa_dstaddr
void *ifa_data; /* Address-specific data */
};
int getifaddrs(struct ifaddrs **ifap);
void freeifaddrs(struct ifaddrs *ifa);
#ifdef __cplusplus
}
#endif
#endif
#endif