Alexandre Julliard | 0799c1a | 2002-03-09 23:29:33 +0000 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (C) 2001 Francois Gouget |
| 3 | * |
| 4 | * This library is free software; you can redistribute it and/or |
| 5 | * modify it under the terms of the GNU Lesser General Public |
| 6 | * License as published by the Free Software Foundation; either |
| 7 | * version 2.1 of the License, or (at your option) any later version. |
| 8 | * |
| 9 | * This library is distributed in the hope that it will be useful, |
| 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
| 12 | * Lesser General Public License for more details. |
| 13 | * |
| 14 | * You should have received a copy of the GNU Lesser General Public |
| 15 | * License along with this library; if not, write to the Free Software |
| 16 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
| 17 | */ |
| 18 | |
Francois Gouget | 2720231 | 2001-11-14 21:26:23 +0000 | [diff] [blame] | 19 | #ifndef __WS2TCPIP__ |
| 20 | #define __WS2TCPIP__ |
| 21 | |
| 22 | #ifdef USE_WS_PREFIX |
| 23 | #define WS(x) WS_##x |
| 24 | #else |
| 25 | #define WS(x) x |
| 26 | #endif |
| 27 | |
| 28 | /* FIXME: This gets defined by some Unix (Linux) header and messes things */ |
| 29 | #undef s6_addr |
| 30 | |
| 31 | typedef struct WS(in_addr6) |
| 32 | { |
| 33 | u_char s6_addr[16]; /* IPv6 address */ |
| 34 | } IN6_ADDR, *PIN6_ADDR, *LPIN6_ADDR; |
| 35 | |
| 36 | typedef struct WS(sockaddr_in6) |
| 37 | { |
| 38 | short sin6_family; /* AF_INET6 */ |
| 39 | u_short sin6_port; /* Transport level port number */ |
| 40 | u_long sin6_flowinfo; /* IPv6 flow information */ |
| 41 | struct WS(in_addr6) sin6_addr; /* IPv6 address */ |
| 42 | } SOCKADDR_IN6,*PSOCKADDR_IN6, *LPSOCKADDR_IN6; |
| 43 | |
| 44 | typedef union sockaddr_gen |
| 45 | { |
| 46 | struct WS(sockaddr) Address; |
| 47 | struct WS(sockaddr_in) AddressIn; |
| 48 | struct WS(sockaddr_in6) AddressIn6; |
| 49 | } WS(sockaddr_gen); |
| 50 | |
| 51 | /* Structure to keep interface specific information */ |
| 52 | typedef struct _INTERFACE_INFO |
| 53 | { |
| 54 | u_long iiFlags; /* Interface flags */ |
| 55 | WS(sockaddr_gen) iiAddress; /* Interface address */ |
| 56 | WS(sockaddr_gen) iiBroadcastAddress; /* Broadcast address */ |
| 57 | WS(sockaddr_gen) iiNetmask; /* Network mask */ |
| 58 | } INTERFACE_INFO, * LPINTERFACE_INFO; |
| 59 | |
| 60 | /* Possible flags for the iiFlags - bitmask */ |
| 61 | #ifndef USE_WS_PREFIX |
| 62 | #define IFF_UP 0x00000001 /* Interface is up */ |
| 63 | #define IFF_BROADCAST 0x00000002 /* Broadcast is supported */ |
| 64 | #define IFF_LOOPBACK 0x00000004 /* this is loopback interface */ |
| 65 | #define IFF_POINTTOPOINT 0x00000008 /* this is point-to-point interface */ |
| 66 | #define IFF_MULTICAST 0x00000010 /* multicast is supported */ |
| 67 | #else |
| 68 | #define WS_IFF_UP 0x00000001 /* Interface is up */ |
| 69 | #define WS_IFF_BROADCAST 0x00000002 /* Broadcast is supported */ |
| 70 | #define WS_IFF_LOOPBACK 0x00000004 /* this is loopback interface */ |
| 71 | #define WS_IFF_POINTTOPOINT 0x00000008 /* this is point-to-point interface */ |
| 72 | #define WS_IFF_MULTICAST 0x00000010 /* multicast is supported */ |
| 73 | #endif /* USE_WS_PREFIX */ |
| 74 | |
| 75 | #endif /* __WS2TCPIP__ */ |