summaryrefslogtreecommitdiffstats
path: root/winsup/cygwin/include/ifaddrs.h
diff options
context:
space:
mode:
authorCorinna Vinschen <corinna@vinschen.de>2007-06-21 15:57:54 +0000
committerCorinna Vinschen <corinna@vinschen.de>2007-06-21 15:57:54 +0000
commita71ecb55de2f98588febdef5b69d606abe2a775f (patch)
tree08ab881b256540b1f29a2d380b12ce926dc770b0 /winsup/cygwin/include/ifaddrs.h
parentd3c73d49994d4539fc25ad2d6c84c335283d32d6 (diff)
downloadcygnal-a71ecb55de2f98588febdef5b69d606abe2a775f.tar.gz
cygnal-a71ecb55de2f98588febdef5b69d606abe2a775f.tar.bz2
cygnal-a71ecb55de2f98588febdef5b69d606abe2a775f.zip
* autoload.cc (WSAIoctl): Remove.
* cygwin.din: Export freeifaddrs, getifaddrs. * fhandler_socket.cc (fhandler_socket::ioctl): Drop SOCKET parameter from get_ifconf. * net.cc: Include ifaddrs.h. (in_are_prefix_equal): Match addresses in network byte order. (ip_addr_prefix): Convert address into host byte order before testing with IN_LOOPBACK. (struct ifall): Define. (get_xp_ifs): Replace get_xp_ifconf. Return struct ifall array. (get_2k_ifs): Ditto, replace get_2k_ifconf. (get_nt_ifs): Ditto, replace get_nt_ifconf. (getifaddrs): New function. (freeifaddrs): New function. (get_ifconf): Call matching get_XX_ifs function and create ifc content from here. Drop lo fake since it's now in get_nt_ifs. * posix.sgml: Add freeifaddrs and getifaddrs to list of implemented BSD functions. * wincap.h (wincapc::has_broken_if_oper_status): New element. * wincap.cc: Implement above element throughout. * include/ifaddrs.h: New file. * include/cygwin/version.h: Bump API minor number.
Diffstat (limited to 'winsup/cygwin/include/ifaddrs.h')
-rw-r--r--winsup/cygwin/include/ifaddrs.h57
1 files changed, 57 insertions, 0 deletions
diff --git a/winsup/cygwin/include/ifaddrs.h b/winsup/cygwin/include/ifaddrs.h
new file mode 100644
index 000000000..f6c28e798
--- /dev/null
+++ b/winsup/cygwin/include/ifaddrs.h
@@ -0,0 +1,57 @@
+/* $OpenBSD: ifaddrs.h,v 1.4 2004/01/22 21:48:02 espie Exp $ */
+
+/*
+ * Copyright (c) 1995, 1999
+ * Berkeley Software Design, Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * THIS SOFTWARE IS PROVIDED BY Berkeley Software Design, Inc. ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL Berkeley Software Design, Inc. BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ * BSDI ifaddrs.h,v 2.5 2000/02/23 14:51:59 dab Exp
+ */
+
+#ifndef _IFADDRS_H_
+#define _IFADDRS_H_
+
+struct ifaddrs {
+ struct ifaddrs *ifa_next;
+ char *ifa_name;
+ unsigned int ifa_flags;
+ struct sockaddr *ifa_addr;
+ struct sockaddr *ifa_netmask;
+ struct sockaddr *ifa_dstaddr;
+ void *ifa_data;
+};
+
+/*
+ * This may have been defined in <net/if.h>. Note that if <net/if.h> is
+ * to be included it must be included before this header file.
+ */
+/* CV 2007-06-20: Not a problem on Cygwin right now. */
+#ifndef ifa_broadaddr
+#define ifa_broadaddr ifa_dstaddr /* broadcast address interface */
+#endif
+
+#include <sys/cdefs.h>
+
+__BEGIN_DECLS
+extern int getifaddrs(struct ifaddrs **);
+extern void freeifaddrs(struct ifaddrs *);
+__END_DECLS
+
+#endif