1d4afb5ceSopenharmony_ci#ifndef LWS_HAVE_GETIFADDRS
2d4afb5ceSopenharmony_ci#define LWS_HAVE_GETIFADDRS 0
3d4afb5ceSopenharmony_ci#endif
4d4afb5ceSopenharmony_ci
5d4afb5ceSopenharmony_ci#if LWS_HAVE_GETIFADDRS
6d4afb5ceSopenharmony_ci#include <sys/types.h>
7d4afb5ceSopenharmony_ci#include <ifaddrs.h>
8d4afb5ceSopenharmony_ci#else
9d4afb5ceSopenharmony_ci#ifdef __cplusplus
10d4afb5ceSopenharmony_ciextern "C" {
11d4afb5ceSopenharmony_ci#endif
12d4afb5ceSopenharmony_ci/*
13d4afb5ceSopenharmony_ci * Copyright (c) 2000 Kungliga Tekniska H�gskolan
14d4afb5ceSopenharmony_ci * (Royal Institute of Technology, Stockholm, Sweden).
15d4afb5ceSopenharmony_ci * All rights reserved.
16d4afb5ceSopenharmony_ci *
17d4afb5ceSopenharmony_ci * Redistribution and use in source and binary forms, with or without
18d4afb5ceSopenharmony_ci * modification, are permitted provided that the following conditions
19d4afb5ceSopenharmony_ci * are met:
20d4afb5ceSopenharmony_ci *
21d4afb5ceSopenharmony_ci * 1. Redistributions of source code must retain the above copyright
22d4afb5ceSopenharmony_ci *    notice, this list of conditions and the following disclaimer.
23d4afb5ceSopenharmony_ci *
24d4afb5ceSopenharmony_ci * 2. Redistributions in binary form must reproduce the above copyright
25d4afb5ceSopenharmony_ci *    notice, this list of conditions and the following disclaimer in the
26d4afb5ceSopenharmony_ci *    documentation and/or other materials provided with the distribution.
27d4afb5ceSopenharmony_ci *
28d4afb5ceSopenharmony_ci * 3. Neither the name of the Institute nor the names of its contributors
29d4afb5ceSopenharmony_ci *    may be used to endorse or promote products derived from this software
30d4afb5ceSopenharmony_ci *    without specific prior written permission.
31d4afb5ceSopenharmony_ci *
32d4afb5ceSopenharmony_ci * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
33d4afb5ceSopenharmony_ci * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
34d4afb5ceSopenharmony_ci * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
35d4afb5ceSopenharmony_ci * ARE DISCLAIMED.  IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
36d4afb5ceSopenharmony_ci * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
37d4afb5ceSopenharmony_ci * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
38d4afb5ceSopenharmony_ci * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
39d4afb5ceSopenharmony_ci * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
40d4afb5ceSopenharmony_ci * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
41d4afb5ceSopenharmony_ci * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
42d4afb5ceSopenharmony_ci * SUCH DAMAGE.
43d4afb5ceSopenharmony_ci */
44d4afb5ceSopenharmony_ci
45d4afb5ceSopenharmony_ci/* $KTH: ifaddrs.hin,v 1.3 2000/12/11 00:01:13 assar Exp $ */
46d4afb5ceSopenharmony_ci
47d4afb5ceSopenharmony_ci#ifndef ifaddrs_h_7467027A95AD4B5C8DDD40FE7D973791
48d4afb5ceSopenharmony_ci#define ifaddrs_h_7467027A95AD4B5C8DDD40FE7D973791
49d4afb5ceSopenharmony_ci
50d4afb5ceSopenharmony_ci/*
51d4afb5ceSopenharmony_ci * the interface is defined in terms of the fields below, and this is
52d4afb5ceSopenharmony_ci * sometimes #define'd, so there seems to be no simple way of solving
53d4afb5ceSopenharmony_ci * this and this seemed the best. */
54d4afb5ceSopenharmony_ci
55d4afb5ceSopenharmony_ci#undef ifa_dstaddr
56d4afb5ceSopenharmony_ci
57d4afb5ceSopenharmony_cistruct ifaddrs {
58d4afb5ceSopenharmony_ci	struct ifaddrs *ifa_next;
59d4afb5ceSopenharmony_ci	char *ifa_name;
60d4afb5ceSopenharmony_ci	unsigned int ifa_flags;
61d4afb5ceSopenharmony_ci	struct sockaddr *ifa_addr;
62d4afb5ceSopenharmony_ci	struct sockaddr *ifa_netmask;
63d4afb5ceSopenharmony_ci	struct sockaddr *ifa_dstaddr;
64d4afb5ceSopenharmony_ci	void *ifa_data;
65d4afb5ceSopenharmony_ci};
66d4afb5ceSopenharmony_ci
67d4afb5ceSopenharmony_ci#ifndef ifa_broadaddr
68d4afb5ceSopenharmony_ci#define ifa_broadaddr ifa_dstaddr
69d4afb5ceSopenharmony_ci#endif
70d4afb5ceSopenharmony_ci
71d4afb5ceSopenharmony_ciint getifaddrs(struct ifaddrs **);
72d4afb5ceSopenharmony_ci
73d4afb5ceSopenharmony_civoid freeifaddrs(struct ifaddrs *);
74d4afb5ceSopenharmony_ci
75d4afb5ceSopenharmony_ci#endif /* __ifaddrs_h__ */
76d4afb5ceSopenharmony_ci
77d4afb5ceSopenharmony_ci#ifdef __cplusplus
78d4afb5ceSopenharmony_ci}
79d4afb5ceSopenharmony_ci#endif
80d4afb5ceSopenharmony_ci#endif
81