1e2fc7cd3SAdrien Destugues/*
2e2fc7cd3SAdrien Destugues * Copyright 2015, Haiku, Inc. All Rights Reserved.
3e2fc7cd3SAdrien Destugues * Distributed under the terms of the MIT License.
4e2fc7cd3SAdrien Destugues */
5e2fc7cd3SAdrien Destugues#ifndef _IFADDRS_H
6e2fc7cd3SAdrien Destugues#define _IFADDRS_H
7e2fc7cd3SAdrien Destugues
849506076SAdrien Destugues#include <features.h>
9e2fc7cd3SAdrien Destugues
1049506076SAdrien Destugues#ifdef _DEFAULT_SOURCE
11091a80aeSAdrien Destugues
12091a80aeSAdrien Destugues
13e3468ef6SAdrien Destugues#ifdef __cplusplus
14e3468ef6SAdrien Destuguesextern "C" {
15e3468ef6SAdrien Destugues#endif
16e3468ef6SAdrien Destugues
17e3468ef6SAdrien Destugues
18e2fc7cd3SAdrien Destuguesstruct ifaddrs {
19e2fc7cd3SAdrien Destugues	struct ifaddrs  *ifa_next;    /* Next item in list */
20e2fc7cd3SAdrien Destugues	const char      *ifa_name;    /* Name of interface */
21e2fc7cd3SAdrien Destugues	unsigned int     ifa_flags;   /* Flags from SIOCGIFFLAGS */
22e2fc7cd3SAdrien Destugues	struct sockaddr *ifa_addr;    /* Address of interface */
23e2fc7cd3SAdrien Destugues	struct sockaddr *ifa_netmask; /* Netmask of interface */
24e2fc7cd3SAdrien Destugues	struct sockaddr *ifa_dstaddr;
25e2fc7cd3SAdrien Destugues	#define         ifa_broadaddr ifa_dstaddr
26e2fc7cd3SAdrien Destugues	void            *ifa_data;    /* Address-specific data */
27e2fc7cd3SAdrien Destugues};
28e2fc7cd3SAdrien Destugues
29e2fc7cd3SAdrien Destugues
30e2fc7cd3SAdrien Destuguesint getifaddrs(struct ifaddrs **ifap);
31e2fc7cd3SAdrien Destuguesvoid freeifaddrs(struct ifaddrs *ifa);
32e2fc7cd3SAdrien Destugues
33e2fc7cd3SAdrien Destugues
34e3468ef6SAdrien Destugues#ifdef __cplusplus
35e3468ef6SAdrien Destugues}
36e3468ef6SAdrien Destugues#endif
37e3468ef6SAdrien Destugues
38e3468ef6SAdrien Destugues
39091a80aeSAdrien Destugues#endif
40091a80aeSAdrien Destugues
41091a80aeSAdrien Destugues
42e2fc7cd3SAdrien Destugues#endif
43