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 | |
Francois Gouget | ff915d4 | 2004-03-31 19:58:46 +0000 | [diff] [blame] | 31 | /* |
| 32 | * Multicast group information |
| 33 | */ |
| 34 | |
| 35 | struct WS(ip_mreq) |
| 36 | { |
| 37 | struct WS(in_addr) imr_multiaddr; |
| 38 | struct WS(in_addr) imr_interface; |
| 39 | }; |
| 40 | |
| 41 | struct WS(ip_mreq_source) { |
| 42 | struct WS(in_addr) imr_multiaddr; |
| 43 | struct WS(in_addr) imr_sourceaddr; |
| 44 | struct WS(in_addr) imr_interface; |
| 45 | }; |
| 46 | |
| 47 | struct WS(ip_msfilter) { |
| 48 | struct WS(in_addr) imsf_multiaddr; |
| 49 | struct WS(in_addr) imsf_interface; |
| 50 | u_long imsf_fmode; |
| 51 | u_long imsf_numsrc; |
| 52 | struct WS(in_addr) imsf_slist[1]; |
| 53 | }; |
| 54 | |
Francois Gouget | 2720231 | 2001-11-14 21:26:23 +0000 | [diff] [blame] | 55 | typedef struct WS(in_addr6) |
| 56 | { |
| 57 | u_char s6_addr[16]; /* IPv6 address */ |
| 58 | } IN6_ADDR, *PIN6_ADDR, *LPIN6_ADDR; |
| 59 | |
| 60 | typedef struct WS(sockaddr_in6) |
| 61 | { |
| 62 | short sin6_family; /* AF_INET6 */ |
| 63 | u_short sin6_port; /* Transport level port number */ |
| 64 | u_long sin6_flowinfo; /* IPv6 flow information */ |
| 65 | struct WS(in_addr6) sin6_addr; /* IPv6 address */ |
| 66 | } SOCKADDR_IN6,*PSOCKADDR_IN6, *LPSOCKADDR_IN6; |
| 67 | |
| 68 | typedef union sockaddr_gen |
| 69 | { |
| 70 | struct WS(sockaddr) Address; |
| 71 | struct WS(sockaddr_in) AddressIn; |
| 72 | struct WS(sockaddr_in6) AddressIn6; |
| 73 | } WS(sockaddr_gen); |
| 74 | |
| 75 | /* Structure to keep interface specific information */ |
| 76 | typedef struct _INTERFACE_INFO |
| 77 | { |
| 78 | u_long iiFlags; /* Interface flags */ |
| 79 | WS(sockaddr_gen) iiAddress; /* Interface address */ |
| 80 | WS(sockaddr_gen) iiBroadcastAddress; /* Broadcast address */ |
| 81 | WS(sockaddr_gen) iiNetmask; /* Network mask */ |
| 82 | } INTERFACE_INFO, * LPINTERFACE_INFO; |
| 83 | |
| 84 | /* Possible flags for the iiFlags - bitmask */ |
| 85 | #ifndef USE_WS_PREFIX |
| 86 | #define IFF_UP 0x00000001 /* Interface is up */ |
| 87 | #define IFF_BROADCAST 0x00000002 /* Broadcast is supported */ |
| 88 | #define IFF_LOOPBACK 0x00000004 /* this is loopback interface */ |
| 89 | #define IFF_POINTTOPOINT 0x00000008 /* this is point-to-point interface */ |
| 90 | #define IFF_MULTICAST 0x00000010 /* multicast is supported */ |
| 91 | #else |
| 92 | #define WS_IFF_UP 0x00000001 /* Interface is up */ |
| 93 | #define WS_IFF_BROADCAST 0x00000002 /* Broadcast is supported */ |
| 94 | #define WS_IFF_LOOPBACK 0x00000004 /* this is loopback interface */ |
| 95 | #define WS_IFF_POINTTOPOINT 0x00000008 /* this is point-to-point interface */ |
| 96 | #define WS_IFF_MULTICAST 0x00000010 /* multicast is supported */ |
| 97 | #endif /* USE_WS_PREFIX */ |
| 98 | |
Mike Hearn | ceb86a9 | 2003-04-04 22:04:47 +0000 | [diff] [blame] | 99 | #ifndef USE_WS_PREFIX |
| 100 | #define IP_OPTIONS 1 |
| 101 | #define IP_HDRINCL 2 |
| 102 | #define IP_TOS 3 |
| 103 | #define IP_TTL 4 |
| 104 | #define IP_MULTICAST_IF 9 |
| 105 | #define IP_MULTICAST_TTL 10 |
| 106 | #define IP_MULTICAST_LOOP 11 |
| 107 | #define IP_ADD_MEMBERSHIP 12 |
| 108 | #define IP_DROP_MEMBERSHIP 13 |
| 109 | #define IP_DONTFRAGMENT 14 |
| 110 | #else |
| 111 | #define WS_IP_OPTIONS 1 |
| 112 | #define WS_IP_HDRINCL 2 |
| 113 | #define WS_IP_TOS 3 |
| 114 | #define WS_IP_TTL 4 |
| 115 | #define WS_IP_MULTICAST_IF 9 |
| 116 | #define WS_IP_MULTICAST_TTL 10 |
| 117 | #define WS_IP_MULTICAST_LOOP 11 |
| 118 | #define WS_IP_ADD_MEMBERSHIP 12 |
| 119 | #define WS_IP_DROP_MEMBERSHIP 13 |
| 120 | #define WS_IP_DONTFRAGMENT 14 |
| 121 | #endif /* USE_WS_PREFIX */ |
| 122 | |
Francois Gouget | 2720231 | 2001-11-14 21:26:23 +0000 | [diff] [blame] | 123 | #endif /* __WS2TCPIP__ */ |