Implement getifaddrs.

This is a BSD extension also available in glibc, but is not POSIX.
Fixes #6279.
This commit is contained in:
Adrien Destugues
2015-01-16 13:10:57 +01:00
parent 23f1ce0756
commit e2fc7cd3c7
2 changed files with 98 additions and 1 deletions
+25
View File
@@ -0,0 +1,25 @@
/*
* Copyright 2015, Haiku, Inc. All Rights Reserved.
* Distributed under the terms of the MIT License.
*/
#ifndef _IFADDRS_H
#define _IFADDRS_H
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);
#endif