Initial commit of the HEAD branch of the ELinks CVS repository, as of
[elinks/images.git] / src / osdep / getifaddrs.h
blob246b5a2e28cc4b5536e32c3a087fe0e378105e62
1 /* $Id: getifaddrs.h,v 1.2 2004/04/13 10:15:40 zas Exp $ */
3 #ifndef EL__OSDEP_GETIFADDRS_H
4 #define EL__OSDEP_GETIFADDRS_H
6 #ifdef HAVE_CONFIG_H
7 #include "config.h"
8 #endif
10 #ifndef HAVE_GETIFADDRS
11 /* ELinksification by Zas.
12 * This file was borrowed from dkftpbench-0.45 sources (http://www.kegel.com/dkftpbench). */
15 * Copyright (c) 2000 Kungliga Tekniska Högskolan
16 * (Royal Institute of Technology, Stockholm, Sweden).
17 * All rights reserved.
19 * Redistribution and use in source and binary forms, with or without
20 * modification, are permitted provided that the following conditions
21 * are met:
23 * 1. Redistributions of source code must retain the above copyright
24 * notice, this list of conditions and the following disclaimer.
26 * 2. Redistributions in binary form must reproduce the above copyright
27 * notice, this list of conditions and the following disclaimer in the
28 * documentation and/or other materials provided with the distribution.
30 * 3. Neither the name of the Institute nor the names of its contributors
31 * may be used to endorse or promote products derived from this software
32 * without specific prior written permission.
34 * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
35 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
36 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
37 * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
38 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
39 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
40 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
41 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
42 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
43 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
44 * SUCH DAMAGE.
49 * the interface is defined in terms of the fields below, and this is
50 * sometimes #define'd, so there seems to be no simple way of solving
51 * this and this seemed the best. */
53 #undef ifa_dstaddr
55 struct ifaddrs {
56 struct ifaddrs *ifa_next;
57 char *ifa_name;
58 unsigned int ifa_flags;
59 struct sockaddr *ifa_addr;
60 struct sockaddr *ifa_netmask;
61 struct sockaddr *ifa_dstaddr;
62 void *ifa_data;
65 #ifndef ifa_broadaddr
66 #define ifa_broadaddr ifa_dstaddr
67 #endif
69 int getifaddrs(struct ifaddrs **);
70 void freeifaddrs(struct ifaddrs *);
72 #endif /* HAVE_GETIFADDRS */
74 #endif /* EL__OSDEP_GETIFADDRS_H */