Home | Info | Community | Development | myReactOS | Contact Us
ReactOS Development > Doxygenws2ipdef.h
Go to the documentation of this file.
00001 #pragma once 00002 00003 #define _WS2IPDEF_ 00004 00005 #ifdef __cplusplus 00006 extern "C" { 00007 #endif 00008 00009 #ifndef WS2IPDEF_ASSERT 00010 #define WS2IPDEF_ASSERT(exp) ((VOID) 0) 00011 #endif 00012 00013 #ifdef _MSC_VER 00014 #define WS2TCPIP_INLINE __inline 00015 #else 00016 #define WS2TCPIP_INLINE static inline 00017 #endif 00018 00019 #include <in6addr.h> 00020 00021 #define IFF_UP 0x00000001 00022 #define IFF_BROADCAST 0x00000002 00023 #define IFF_LOOPBACK 0x00000004 00024 #define IFF_POINTTOPOINT 0x00000008 00025 #define IFF_MULTICAST 0x00000010 00026 00027 #define IP_OPTIONS 1 00028 #define IP_HDRINCL 2 00029 #define IP_TOS 3 00030 #define IP_TTL 4 00031 #define IP_MULTICAST_IF 9 00032 #define IP_MULTICAST_TTL 10 00033 #define IP_MULTICAST_LOOP 11 00034 #define IP_ADD_MEMBERSHIP 12 00035 #define IP_DROP_MEMBERSHIP 13 00036 #define IP_DONTFRAGMENT 14 00037 #define IP_ADD_SOURCE_MEMBERSHIP 15 00038 #define IP_DROP_SOURCE_MEMBERSHIP 16 00039 #define IP_BLOCK_SOURCE 17 00040 #define IP_UNBLOCK_SOURCE 18 00041 #define IP_PKTINFO 19 00042 #define IP_HOPLIMIT 21 00043 #define IP_RECEIVE_BROADCAST 22 00044 #define IP_RECVIF 24 00045 #define IP_RECVDSTADDR 25 00046 #define IP_IFLIST 28 00047 #define IP_ADD_IFLIST 29 00048 #define IP_DEL_IFLIST 30 00049 #define IP_UNICAST_IF 31 00050 #define IP_RTHDR 32 00051 #define IP_RECVRTHDR 38 00052 #define IP_TCLASS 39 00053 #define IP_RECVTCLASS 40 00054 #define IP_ORIGINAL_ARRIVAL_IF 47 00055 00056 #define IP_UNSPECIFIED_TYPE_OF_SERVICE -1 00057 00058 #define IPV6_ADDRESS_BITS RTL_BITS_OF(IN6_ADDR) 00059 00060 #define SS_PORT(ssp) (((PSOCKADDR_IN)(ssp))->sin_port) 00061 00062 #define SIO_GET_INTERFACE_LIST _IOR('t', 127, ULONG) 00063 #define SIO_GET_INTERFACE_LIST_EX _IOR('t', 126, ULONG) 00064 #define SIO_SET_MULTICAST_FILTER _IOW('t', 125, ULONG) 00065 #define SIO_GET_MULTICAST_FILTER _IOW('t', 124 | IOC_IN, ULONG) 00066 #define SIOCSIPMSFILTER SIO_SET_MULTICAST_FILTER 00067 #define SIOCGIPMSFILTER SIO_GET_MULTICAST_FILTER 00068 00069 #define SIOCSMSFILTER _IOW('t', 126, ULONG) 00070 #define SIOCGMSFILTER _IOW('t', 127 | IOC_IN, ULONG) 00071 00072 #if (NTDDI_VERSION >= NTDDI_VISTASP1) 00073 00074 #define IDEAL_SEND_BACKLOG_IOCTLS 00075 00076 #define SIO_IDEAL_SEND_BACKLOG_QUERY _IOR('t', 123, ULONG) 00077 #define SIO_IDEAL_SEND_BACKLOG_CHANGE _IO('t', 122) 00078 00079 #endif /* (NTDDI_VERSION >= NTDDI_VISTASP1) */ 00080 00081 #define MCAST_JOIN_GROUP 41 00082 #define MCAST_LEAVE_GROUP 42 00083 #define MCAST_BLOCK_SOURCE 43 00084 #define MCAST_UNBLOCK_SOURCE 44 00085 #define MCAST_JOIN_SOURCE_GROUP 45 00086 #define MCAST_LEAVE_SOURCE_GROUP 46 00087 00088 #define IP_MSFILTER_SIZE(NumSources) \ 00089 (sizeof(IP_MSFILTER) - sizeof(IN_ADDR) + (NumSources) * sizeof(IN_ADDR)) 00090 00091 #define IPV6_HOPOPTS 1 00092 #define IPV6_HDRINCL 2 00093 #define IPV6_UNICAST_HOPS 4 00094 #define IPV6_MULTICAST_IF 9 00095 #define IPV6_MULTICAST_HOPS 10 00096 #define IPV6_MULTICAST_LOOP 11 00097 #define IPV6_ADD_MEMBERSHIP 12 00098 #define IPV6_JOIN_GROUP IPV6_ADD_MEMBERSHIP 00099 #define IPV6_DROP_MEMBERSHIP 13 00100 #define IPV6_LEAVE_GROUP IPV6_DROP_MEMBERSHIP 00101 #define IPV6_DONTFRAG 14 00102 #define IPV6_PKTINFO 19 00103 #define IPV6_HOPLIMIT 21 00104 #define IPV6_PROTECTION_LEVEL 23 00105 #define IPV6_RECVIF 24 00106 #define IPV6_RECVDSTADDR 25 00107 #define IPV6_CHECKSUM 26 00108 #define IPV6_V6ONLY 27 00109 #define IPV6_IFLIST 28 00110 #define IPV6_ADD_IFLIST 29 00111 #define IPV6_DEL_IFLIST 30 00112 #define IPV6_UNICAST_IF 31 00113 #define IPV6_RTHDR 32 00114 #define IPV6_RECVRTHDR 38 00115 #define IPV6_TCLASS 39 00116 #define IPV6_RECVTCLASS 40 00117 00118 #define IP_UNSPECIFIED_HOP_LIMIT -1 00119 00120 #define IP_PROTECTION_LEVEL IPV6_PROTECTION_LEVEL 00121 #define PROTECTION_LEVEL_UNRESTRICTED 10 00122 #define PROTECTION_LEVEL_EDGERESTRICTED 20 00123 #define PROTECTION_LEVEL_RESTRICTED 30 00124 00125 #if (NTDDI_VERSION < NTDDI_VISTA) 00126 #define PROTECTION_LEVEL_DEFAULT PROTECTION_LEVEL_EDGERESTRICTED 00127 #else 00128 #define PROTECTION_LEVEL_DEFAULT ((UINT)-1) 00129 #endif 00130 00131 #define INET_ADDRSTRLEN 22 00132 #define INET6_ADDRSTRLEN 65 00133 00134 #define TCP_OFFLOAD_NO_PREFERENCE 0 00135 #define TCP_OFFLOAD_NOT_PREFERRED 1 00136 #define TCP_OFFLOAD_PREFERRED 2 00137 00138 #define TCP_EXPEDITED_1122 0x0002 00139 #define TCP_KEEPALIVE 3 00140 #define TCP_MAXSEG 4 00141 #define TCP_MAXRT 5 00142 #define TCP_STDURG 6 00143 #define TCP_NOURG 7 00144 #define TCP_ATMARK 8 00145 #define TCP_NOSYNRETRIES 9 00146 #define TCP_TIMESTAMPS 10 00147 #define TCP_OFFLOAD_PREFERENCE 11 00148 #define TCP_CONGESTION_ALGORITHM 12 00149 #define TCP_DELAY_FIN_ACK 13 00150 00151 struct sockaddr_in6_old { 00152 SHORT sin6_family; 00153 USHORT sin6_port; 00154 ULONG sin6_flowinfo; 00155 IN6_ADDR sin6_addr; 00156 }; 00157 00158 typedef union sockaddr_gen { 00159 struct sockaddr Address; 00160 struct sockaddr_in AddressIn; 00161 struct sockaddr_in6_old AddressIn6; 00162 } sockaddr_gen; 00163 00164 typedef struct _INTERFACE_INFO { 00165 ULONG iiFlags; 00166 sockaddr_gen iiAddress; 00167 sockaddr_gen iiBroadcastAddress; 00168 sockaddr_gen iiNetmask; 00169 } INTERFACE_INFO, FAR *LPINTERFACE_INFO; 00170 00171 typedef struct _INTERFACE_INFO_EX { 00172 ULONG iiFlags; 00173 SOCKET_ADDRESS iiAddress; 00174 SOCKET_ADDRESS iiBroadcastAddress; 00175 SOCKET_ADDRESS iiNetmask; 00176 } INTERFACE_INFO_EX, FAR *LPINTERFACE_INFO_EX; 00177 00178 typedef struct sockaddr_in6 { 00179 ADDRESS_FAMILY sin6_family; 00180 USHORT sin6_port; 00181 ULONG sin6_flowinfo; 00182 IN6_ADDR sin6_addr; 00183 union { 00184 ULONG sin6_scope_id; 00185 SCOPE_ID sin6_scope_struct; 00186 }; 00187 } SOCKADDR_IN6_LH, *PSOCKADDR_IN6_LH, FAR *LPSOCKADDR_IN6_LH; 00188 00189 typedef struct sockaddr_in6_w2ksp1 { 00190 short sin6_family; 00191 USHORT sin6_port; 00192 ULONG sin6_flowinfo; 00193 struct in6_addr sin6_addr; 00194 ULONG sin6_scope_id; 00195 } SOCKADDR_IN6_W2KSP1, *PSOCKADDR_IN6_W2KSP1, FAR *LPSOCKADDR_IN6_W2KSP1; 00196 00197 #if (NTDDI_VERSION >= NTDDI_VISTA) 00198 00199 typedef SOCKADDR_IN6_LH SOCKADDR_IN6; 00200 typedef SOCKADDR_IN6_LH *PSOCKADDR_IN6; 00201 typedef SOCKADDR_IN6_LH FAR *LPSOCKADDR_IN6; 00202 00203 #elif(NTDDI_VERSION >= NTDDI_WIN2KSP1) 00204 00205 typedef SOCKADDR_IN6_W2KSP1 SOCKADDR_IN6; 00206 typedef SOCKADDR_IN6_W2KSP1 *PSOCKADDR_IN6; 00207 typedef SOCKADDR_IN6_W2KSP1 FAR *LPSOCKADDR_IN6; 00208 00209 #else 00210 00211 typedef SOCKADDR_IN6_LH SOCKADDR_IN6; 00212 typedef SOCKADDR_IN6_LH *PSOCKADDR_IN6; 00213 typedef SOCKADDR_IN6_LH FAR *LPSOCKADDR_IN6; 00214 00215 #endif /* (NTDDI_VERSION >= NTDDI_VISTA) */ 00216 00217 typedef union _SOCKADDR_INET { 00218 SOCKADDR_IN Ipv4; 00219 SOCKADDR_IN6 Ipv6; 00220 ADDRESS_FAMILY si_family; 00221 } SOCKADDR_INET, *PSOCKADDR_INET; 00222 00223 typedef struct _sockaddr_in6_pair { 00224 PSOCKADDR_IN6 SourceAddress; 00225 PSOCKADDR_IN6 DestinationAddress; 00226 } SOCKADDR_IN6_PAIR, *PSOCKADDR_IN6_PAIR; 00227 00228 #if (NTDDI_VERSION >= NTDDI_WIN2KSP1) 00229 00230 #define IN6ADDR_ANY_INIT {0} 00231 #define IN6ADDR_LOOPBACK_INIT {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1} 00232 #define IN6ADDR_ALLNODESONNODE_INIT {0xff, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01} 00233 #define IN6ADDR_ALLNODESONLINK_INIT {0xff, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01} 00234 #define IN6ADDR_ALLROUTERSONLINK_INIT {0xff, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02} 00235 #define IN6ADDR_ALLMLDV2ROUTERSONLINK_INIT {0xff, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x16} 00236 #define IN6ADDR_TEREDOINITIALLINKLOCALADDRESS_INIT {0xfe, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xfe} 00237 #define IN6ADDR_TEREDOOLDLINKLOCALADDRESSXP_INIT {0xfe, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 'T', 'E', 'R', 'E', 'D', 'O'} 00238 #define IN6ADDR_TEREDOOLDLINKLOCALADDRESSVISTA_INIT {0xfe, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff} 00239 #define IN6ADDR_LINKLOCALPREFIX_INIT {0xfe, 0x80, } 00240 #define IN6ADDR_MULTICASTPREFIX_INIT {0xff, 0x00, } 00241 #define IN6ADDR_SOLICITEDNODEMULTICASTPREFIX_INIT {0xff, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0xff, } 00242 #define IN6ADDR_V4MAPPEDPREFIX_INIT {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, } 00243 #define IN6ADDR_6TO4PREFIX_INIT {0x20, 0x02, } 00244 #define IN6ADDR_TEREDOPREFIX_INIT {0x20, 0x01, 0x00, 0x00, } 00245 #define IN6ADDR_TEREDOPREFIX_INIT_OLD {0x3f, 0xfe, 0x83, 0x1f, } 00246 00247 #define IN6ADDR_LINKLOCALPREFIX_LENGTH 64 00248 #define IN6ADDR_MULTICASTPREFIX_LENGTH 8 00249 #define IN6ADDR_SOLICITEDNODEMULTICASTPREFIX_LENGTH 104 00250 #define IN6ADDR_V4MAPPEDPREFIX_LENGTH 96 00251 #define IN6ADDR_6TO4PREFIX_LENGTH 16 00252 #define IN6ADDR_TEREDOPREFIX_LENGTH 32 00253 00254 extern CONST SCOPE_ID scopeid_unspecified; 00255 00256 extern CONST IN_ADDR in4addr_any; 00257 extern CONST IN_ADDR in4addr_loopback; 00258 extern CONST IN_ADDR in4addr_broadcast; 00259 extern CONST IN_ADDR in4addr_allnodesonlink; 00260 extern CONST IN_ADDR in4addr_allroutersonlink; 00261 extern CONST IN_ADDR in4addr_alligmpv3routersonlink; 00262 extern CONST IN_ADDR in4addr_allteredohostsonlink; 00263 extern CONST IN_ADDR in4addr_linklocalprefix; 00264 extern CONST IN_ADDR in4addr_multicastprefix; 00265 00266 extern CONST IN6_ADDR in6addr_any; 00267 extern CONST IN6_ADDR in6addr_loopback; 00268 extern CONST IN6_ADDR in6addr_allnodesonnode; 00269 extern CONST IN6_ADDR in6addr_allnodesonlink; 00270 extern CONST IN6_ADDR in6addr_allroutersonlink; 00271 extern CONST IN6_ADDR in6addr_allmldv2routersonlink; 00272 extern CONST IN6_ADDR in6addr_teredoinitiallinklocaladdress; 00273 extern CONST IN6_ADDR in6addr_linklocalprefix; 00274 extern CONST IN6_ADDR in6addr_multicastprefix; 00275 extern CONST IN6_ADDR in6addr_solicitednodemulticastprefix; 00276 extern CONST IN6_ADDR in6addr_v4mappedprefix; 00277 extern CONST IN6_ADDR in6addr_6to4prefix; 00278 extern CONST IN6_ADDR in6addr_teredoprefix; 00279 extern CONST IN6_ADDR in6addr_teredoprefix_old; 00280 00281 #ifndef __midl 00282 00283 WS2TCPIP_INLINE 00284 BOOLEAN 00285 IN6_ADDR_EQUAL(CONST IN6_ADDR *x, CONST IN6_ADDR *y) { 00286 __int64 UNALIGNED *a; 00287 __int64 UNALIGNED *b; 00288 00289 a = (__int64 UNALIGNED *)x; 00290 b = (__int64 UNALIGNED *)y; 00291 return (BOOLEAN)((a[1] == b[1]) && (a[0] == b[0])); 00292 } 00293 00294 #define IN6_ARE_ADDR_EQUAL IN6_ADDR_EQUAL 00295 00296 WS2TCPIP_INLINE 00297 BOOLEAN 00298 IN6_IS_ADDR_UNSPECIFIED(CONST IN6_ADDR *a) { 00299 return (BOOLEAN)((a->s6_words[0] == 0) && 00300 (a->s6_words[1] == 0) && 00301 (a->s6_words[2] == 0) && 00302 (a->s6_words[3] == 0) && 00303 (a->s6_words[4] == 0) && 00304 (a->s6_words[5] == 0) && 00305 (a->s6_words[6] == 0) && 00306 (a->s6_words[7] == 0)); 00307 } 00308 00309 WS2TCPIP_INLINE 00310 BOOLEAN 00311 IN6_IS_ADDR_LOOPBACK(CONST IN6_ADDR *a) { 00312 return (BOOLEAN)((a->s6_words[0] == 0) && 00313 (a->s6_words[1] == 0) && 00314 (a->s6_words[2] == 0) && 00315 (a->s6_words[3] == 0) && 00316 (a->s6_words[4] == 0) && 00317 (a->s6_words[5] == 0) && 00318 (a->s6_words[6] == 0) && 00319 (a->s6_words[7] == 0x0100)); 00320 } 00321 00322 WS2TCPIP_INLINE 00323 BOOLEAN 00324 IN6_IS_ADDR_MULTICAST(CONST IN6_ADDR *a) { 00325 return (BOOLEAN)(a->s6_bytes[0] == 0xff); 00326 } 00327 00328 WS2TCPIP_INLINE 00329 BOOLEAN 00330 IN6_IS_ADDR_EUI64(CONST IN6_ADDR *a) { 00331 return (BOOLEAN)(((a->s6_bytes[0] & 0xe0) != 0) && 00332 !IN6_IS_ADDR_MULTICAST(a)); 00333 } 00334 00335 WS2TCPIP_INLINE 00336 BOOLEAN 00337 IN6_IS_ADDR_SUBNET_ROUTER_ANYCAST(CONST IN6_ADDR *a) { 00338 return (BOOLEAN)(IN6_IS_ADDR_EUI64(a) && 00339 (a->s6_words[4] == 0) && 00340 (a->s6_words[5] == 0) && 00341 (a->s6_words[6] == 0) && 00342 (a->s6_words[7] == 0)); 00343 } 00344 00345 WS2TCPIP_INLINE 00346 BOOLEAN 00347 IN6_IS_ADDR_SUBNET_RESERVED_ANYCAST(CONST IN6_ADDR *a) { 00348 return (BOOLEAN)(IN6_IS_ADDR_EUI64(a) && 00349 (a->s6_words[4] == 0xfffd) && 00350 (a->s6_words[5] == 0xffff) && 00351 (a->s6_words[6] == 0xffff) && 00352 ((a->s6_words[7] & 0x80ff) == 0x80ff)); 00353 } 00354 00355 WS2TCPIP_INLINE 00356 BOOLEAN 00357 IN6_IS_ADDR_ANYCAST(CONST IN6_ADDR *a) { 00358 return (IN6_IS_ADDR_SUBNET_RESERVED_ANYCAST(a) || 00359 IN6_IS_ADDR_SUBNET_ROUTER_ANYCAST(a)); 00360 } 00361 00362 WS2TCPIP_INLINE 00363 BOOLEAN 00364 IN6_IS_ADDR_LINKLOCAL(CONST IN6_ADDR *a) { 00365 return (BOOLEAN)((a->s6_bytes[0] == 0xfe) && 00366 ((a->s6_bytes[1] & 0xc0) == 0x80)); 00367 } 00368 00369 WS2TCPIP_INLINE 00370 BOOLEAN 00371 IN6_IS_ADDR_SITELOCAL(CONST IN6_ADDR *a) { 00372 return (BOOLEAN)((a->s6_bytes[0] == 0xfe) && 00373 ((a->s6_bytes[1] & 0xc0) == 0xc0)); 00374 } 00375 00376 WS2TCPIP_INLINE 00377 BOOLEAN 00378 IN6_IS_ADDR_GLOBAL(CONST IN6_ADDR *a) { 00379 ULONG High = (a->s6_bytes[0] & 0xf0); 00380 return (BOOLEAN)((High != 0) && (High != 0xf0)); 00381 } 00382 00383 WS2TCPIP_INLINE 00384 BOOLEAN 00385 IN6_IS_ADDR_V4MAPPED(CONST IN6_ADDR *a) { 00386 return (BOOLEAN)((a->s6_words[0] == 0) && 00387 (a->s6_words[1] == 0) && 00388 (a->s6_words[2] == 0) && 00389 (a->s6_words[3] == 0) && 00390 (a->s6_words[4] == 0) && 00391 (a->s6_words[5] == 0xffff)); 00392 } 00393 00394 WS2TCPIP_INLINE 00395 BOOLEAN 00396 IN6_IS_ADDR_V4COMPAT(CONST IN6_ADDR *a) { 00397 return (BOOLEAN)((a->s6_words[0] == 0) && 00398 (a->s6_words[1] == 0) && 00399 (a->s6_words[2] == 0) && 00400 (a->s6_words[3] == 0) && 00401 (a->s6_words[4] == 0) && 00402 (a->s6_words[5] == 0) && 00403 !((a->s6_words[6] == 0) && 00404 (a->s6_addr[14] == 0) && 00405 ((a->s6_addr[15] == 0) || (a->s6_addr[15] == 1)))); 00406 } 00407 00408 WS2TCPIP_INLINE 00409 BOOLEAN 00410 IN6_IS_ADDR_V4TRANSLATED(CONST IN6_ADDR *a) { 00411 return (BOOLEAN)((a->s6_words[0] == 0) && 00412 (a->s6_words[1] == 0) && 00413 (a->s6_words[2] == 0) && 00414 (a->s6_words[3] == 0) && 00415 (a->s6_words[4] == 0xffff) && 00416 (a->s6_words[5] == 0)); 00417 } 00418 00419 WS2TCPIP_INLINE 00420 BOOLEAN 00421 IN6_IS_ADDR_MC_NODELOCAL(CONST IN6_ADDR *a) { 00422 return (BOOLEAN)(IN6_IS_ADDR_MULTICAST(a) && 00423 ((a->s6_bytes[1] & 0xf) == 1)); 00424 } 00425 00426 WS2TCPIP_INLINE 00427 BOOLEAN 00428 IN6_IS_ADDR_MC_LINKLOCAL(CONST IN6_ADDR *a) { 00429 return (BOOLEAN)(IN6_IS_ADDR_MULTICAST(a) && 00430 ((a->s6_bytes[1] & 0xf) == 2)); 00431 } 00432 00433 WS2TCPIP_INLINE 00434 BOOLEAN 00435 IN6_IS_ADDR_MC_SITELOCAL(CONST IN6_ADDR *a) { 00436 return (BOOLEAN)(IN6_IS_ADDR_MULTICAST(a) && 00437 ((a->s6_bytes[1] & 0xf) == 5)); 00438 } 00439 00440 WS2TCPIP_INLINE 00441 BOOLEAN 00442 IN6_IS_ADDR_MC_ORGLOCAL(CONST IN6_ADDR *a) { 00443 return (BOOLEAN)(IN6_IS_ADDR_MULTICAST(a) && 00444 ((a->s6_bytes[1] & 0xf) == 8)); 00445 } 00446 00447 WS2TCPIP_INLINE 00448 BOOLEAN 00449 IN6_IS_ADDR_MC_GLOBAL(CONST IN6_ADDR *a) { 00450 return (BOOLEAN)(IN6_IS_ADDR_MULTICAST(a) && 00451 ((a->s6_bytes[1] & 0xf) == 0xe)); 00452 } 00453 00454 WS2TCPIP_INLINE 00455 VOID 00456 IN6_SET_ADDR_UNSPECIFIED(PIN6_ADDR a) { 00457 memset(a->s6_bytes, 0, sizeof(IN6_ADDR)); 00458 } 00459 00460 WS2TCPIP_INLINE 00461 VOID 00462 IN6_SET_ADDR_LOOPBACK(PIN6_ADDR a) { 00463 memset(a->s6_bytes, 0, sizeof(IN6_ADDR)); 00464 a->s6_bytes[15] = 1; 00465 } 00466 00467 WS2TCPIP_INLINE 00468 VOID 00469 IN6ADDR_SETANY(PSOCKADDR_IN6 a) { 00470 a->sin6_family = AF_INET6; 00471 a->sin6_port = 0; 00472 a->sin6_flowinfo = 0; 00473 IN6_SET_ADDR_UNSPECIFIED(&a->sin6_addr); 00474 a->sin6_scope_id = 0; 00475 } 00476 00477 WS2TCPIP_INLINE 00478 VOID 00479 IN6ADDR_SETLOOPBACK(PSOCKADDR_IN6 a) { 00480 a->sin6_family = AF_INET6; 00481 a->sin6_port = 0; 00482 a->sin6_flowinfo = 0; 00483 IN6_SET_ADDR_LOOPBACK(&a->sin6_addr); 00484 a->sin6_scope_id = 0; 00485 } 00486 00487 WS2TCPIP_INLINE 00488 BOOLEAN 00489 IN6ADDR_ISANY(CONST SOCKADDR_IN6 *a) { 00490 WS2IPDEF_ASSERT(a->sin6_family == AF_INET6); 00491 return IN6_IS_ADDR_UNSPECIFIED(&a->sin6_addr); 00492 } 00493 00494 WS2TCPIP_INLINE 00495 BOOLEAN 00496 IN6ADDR_ISLOOPBACK(CONST SOCKADDR_IN6 *a) { 00497 WS2IPDEF_ASSERT(a->sin6_family == AF_INET6); 00498 return IN6_IS_ADDR_LOOPBACK(&a->sin6_addr); 00499 } 00500 00501 WS2TCPIP_INLINE 00502 BOOLEAN 00503 IN6ADDR_ISEQUAL(CONST SOCKADDR_IN6 *a, CONST SOCKADDR_IN6 *b) { 00504 WS2IPDEF_ASSERT(a->sin6_family == AF_INET6); 00505 return (BOOLEAN)(a->sin6_scope_id == b->sin6_scope_id && 00506 IN6_ADDR_EQUAL(&a->sin6_addr, &b->sin6_addr)); 00507 } 00508 00509 WS2TCPIP_INLINE 00510 BOOLEAN 00511 IN6ADDR_ISUNSPECIFIED(CONST SOCKADDR_IN6 *a) { 00512 WS2IPDEF_ASSERT(a->sin6_family == AF_INET6); 00513 return (BOOLEAN)(a->sin6_scope_id == 0 && 00514 IN6_IS_ADDR_UNSPECIFIED(&a->sin6_addr)); 00515 } 00516 00517 #endif /* __midl */ 00518 00519 #endif /* (NTDDI_VERSION >= NTDDI_WIN2KSP1) */ 00520 00521 typedef enum _MULTICAST_MODE_TYPE { 00522 MCAST_INCLUDE = 0, 00523 MCAST_EXCLUDE 00524 } MULTICAST_MODE_TYPE; 00525 00526 typedef struct ip_mreq { 00527 IN_ADDR imr_multiaddr; 00528 IN_ADDR imr_interface; 00529 } IP_MREQ, *PIP_MREQ; 00530 00531 typedef struct ip_mreq_source { 00532 IN_ADDR imr_multiaddr; 00533 IN_ADDR imr_sourceaddr; 00534 IN_ADDR imr_interface; 00535 } IP_MREQ_SOURCE, *PIP_MREQ_SOURCE; 00536 00537 typedef struct ip_msfilter { 00538 IN_ADDR imsf_multiaddr; 00539 IN_ADDR imsf_interface; 00540 MULTICAST_MODE_TYPE imsf_fmode; 00541 ULONG imsf_numsrc; 00542 IN_ADDR imsf_slist[1]; 00543 } IP_MSFILTER, *PIP_MSFILTER; 00544 00545 typedef struct ipv6_mreq { 00546 IN6_ADDR ipv6mr_multiaddr; 00547 ULONG ipv6mr_interface; 00548 } IPV6_MREQ, *PIPV6_MREQ; 00549 00550 #if (NTDDI_VERSION >= NTDDI_WINXP) 00551 00552 typedef struct group_req { 00553 ULONG gr_interface; 00554 SOCKADDR_STORAGE gr_group; 00555 } GROUP_REQ, *PGROUP_REQ; 00556 00557 typedef struct group_source_req { 00558 ULONG gsr_interface; 00559 SOCKADDR_STORAGE gsr_group; 00560 SOCKADDR_STORAGE gsr_source; 00561 } GROUP_SOURCE_REQ, *PGROUP_SOURCE_REQ; 00562 00563 typedef struct group_filter { 00564 ULONG gf_interface; 00565 SOCKADDR_STORAGE gf_group; 00566 MULTICAST_MODE_TYPE gf_fmode; 00567 ULONG gf_numsrc; 00568 SOCKADDR_STORAGE gf_slist[1]; 00569 } GROUP_FILTER, *PGROUP_FILTER; 00570 00571 #define GROUP_FILTER_SIZE(numsrc) \ 00572 (sizeof(GROUP_FILTER) - sizeof(SOCKADDR_STORAGE) \ 00573 + (numsrc) * sizeof(SOCKADDR_STORAGE)) 00574 00575 #endif /* (NTDDI_VERSION >= NTDDI_WINXP) */ 00576 00577 typedef struct in_pktinfo { 00578 IN_ADDR ipi_addr; 00579 ULONG ipi_ifindex; 00580 } IN_PKTINFO, *PIN_PKTINFO; 00581 00582 C_ASSERT(sizeof(IN_PKTINFO) == 8); 00583 00584 typedef struct in6_pktinfo { 00585 IN6_ADDR ipi6_addr; 00586 ULONG ipi6_ifindex; 00587 } IN6_PKTINFO, *PIN6_PKTINFO; 00588 00589 C_ASSERT(sizeof(IN6_PKTINFO) == 20); 00590 00591 #ifdef __cplusplus 00592 } 00593 #endif Generated on Sat May 26 2012 04:31:50 for ReactOS by
1.7.6.1
|