ReactOS Fundraising Campaign 2012
 
€ 4,410 / € 30,000

Information | Donate

Home | Info | Community | Development | myReactOS | Contact Us

  1. Home
  2. Community
  3. Development
  4. myReactOS
  5. Fundraiser 2012

  1. Main Page
  2. Alphabetical List
  3. Data Structures
  4. Directories
  5. File List
  6. Data Fields
  7. Globals
  8. Related Pages

ReactOS Development > Doxygen

ws2def.h
Go to the documentation of this file.
00001 #pragma once
00002 
00003 #define _WS2DEF_
00004 
00005 #ifdef __cplusplus
00006 extern "C" {
00007 #endif
00008 
00009 #if !defined(_WINSOCK2API_) && defined(_WINSOCKAPI_)
00010 #error Include only winsock2.h, not both winsock.h and ws2def.h in the same module.
00011 #endif
00012 
00013 #if (_WIN32_WINNT >= 0x0600)
00014 
00015 #ifdef _MSC_VER
00016 #define WS2DEF_INLINE __inline
00017 #else
00018 #define WS2DEF_INLINE extern inline
00019 #endif
00020 
00021 #endif/* (_WIN32_WINNT >= 0x0600) */
00022 
00023 #include <inaddr.h>
00024 
00025 typedef USHORT ADDRESS_FAMILY;
00026 
00027 #define AF_UNSPEC       0
00028 #define AF_UNIX         1
00029 #define AF_INET         2
00030 #define AF_IMPLINK      3
00031 #define AF_PUP          4
00032 #define AF_CHAOS        5
00033 #define AF_NS           6
00034 #define AF_IPX          AF_NS
00035 #define AF_ISO          7
00036 #define AF_OSI          AF_ISO
00037 #define AF_ECMA         8
00038 #define AF_DATAKIT      9
00039 #define AF_CCITT        10
00040 #define AF_SNA          11
00041 #define AF_DECnet       12
00042 #define AF_DLI          13
00043 #define AF_LAT          14
00044 #define AF_HYLINK       15
00045 #define AF_APPLETALK    16
00046 #define AF_NETBIOS      17
00047 #define AF_VOICEVIEW    18
00048 #define AF_FIREFOX      19
00049 #define AF_UNKNOWN1     20
00050 #define AF_BAN          21
00051 #define AF_ATM          22
00052 #define AF_INET6        23
00053 #define AF_CLUSTER      24
00054 #define AF_12844        25
00055 #define AF_IRDA         26
00056 #define AF_NETDES       28
00057 
00058 #if (_WIN32_WINNT < 0x0501)
00059 
00060 #define AF_MAX          29
00061 
00062 #else
00063 
00064 #define AF_TCNPROCESS   29
00065 #define AF_TCNMESSAGE   30
00066 #define AF_ICLFXBM      31
00067 
00068 #if(_WIN32_WINNT < 0x0600)
00069 
00070 #define AF_MAX          32
00071 
00072 #else
00073 
00074 #define AF_BTH          32
00075 #if (_WIN32_WINNT < 0x0601)
00076 #define AF_MAX          33
00077 #else
00078 #define AF_LINK         33
00079 #define AF_MAX          34
00080 #endif /* (_WIN32_WINNT < 0x0601) */
00081 
00082 #endif /* (_WIN32_WINNT < 0x0600) */
00083 
00084 #endif /* (_WIN32_WINNT < 0x0501) */
00085 
00086 #define SOCK_STREAM     1
00087 #define SOCK_DGRAM      2
00088 #define SOCK_RAW        3
00089 #define SOCK_RDM        4
00090 #define SOCK_SEQPACKET  5
00091 
00092 #define SOL_SOCKET      0xffff
00093 
00094 #define SO_DEBUG        0x0001
00095 #define SO_ACCEPTCONN   0x0002
00096 #define SO_REUSEADDR    0x0004
00097 #define SO_KEEPALIVE    0x0008
00098 #define SO_DONTROUTE    0x0010
00099 #define SO_BROADCAST    0x0020
00100 #define SO_USELOOPBACK  0x0040
00101 #define SO_LINGER       0x0080
00102 #define SO_OOBINLINE    0x0100
00103 
00104 #define SO_DONTLINGER (int)(~SO_LINGER)
00105 #define SO_EXCLUSIVEADDRUSE ((int)(~SO_REUSEADDR))
00106 
00107 #define SO_SNDBUF       0x1001
00108 #define SO_RCVBUF       0x1002
00109 #define SO_SNDLOWAT     0x1003
00110 #define SO_RCVLOWAT     0x1004
00111 #define SO_SNDTIMEO     0x1005
00112 #define SO_RCVTIMEO     0x1006
00113 #define SO_ERROR        0x1007
00114 #define SO_TYPE         0x1008
00115 #define SO_BSP_STATE    0x1009
00116 
00117 #define SO_GROUP_ID          0x2001
00118 #define SO_GROUP_PRIORITY    0x2002
00119 #define SO_MAX_MSG_SIZE      0x2003
00120 
00121 #define SO_CONDITIONAL_ACCEPT 0x3002
00122 #define SO_PAUSE_ACCEPT       0x3003
00123 #define SO_COMPARTMENT_ID     0x3004
00124 #if (_WIN32_WINNT >= 0x0600)
00125 #define SO_RANDOMIZE_PORT     0x3005
00126 #define SO_PORT_SCALABILITY   0x3006
00127 #endif /* (_WIN32_WINNT >= 0x0600) */
00128 
00129 #define WSK_SO_BASE           0x4000
00130 
00131 #define TCP_NODELAY           0x0001
00132 
00133 #define _SS_MAXSIZE           128
00134 #define _SS_ALIGNSIZE         (sizeof(__int64))
00135 
00136 #if (_WIN32_WINNT >= 0x0600)
00137 
00138 #define _SS_PAD1SIZE (_SS_ALIGNSIZE - sizeof(USHORT))
00139 #define _SS_PAD2SIZE (_SS_MAXSIZE - (sizeof(USHORT) + _SS_PAD1SIZE + _SS_ALIGNSIZE))
00140 
00141 #else
00142 
00143 #define _SS_PAD1SIZE (_SS_ALIGNSIZE - sizeof (short))
00144 #define _SS_PAD2SIZE (_SS_MAXSIZE - (sizeof (short) + _SS_PAD1SIZE + _SS_ALIGNSIZE))
00145 
00146 #endif /* (_WIN32_WINNT >= 0x0600) */
00147 
00148 #define IOC_UNIX                       0x00000000
00149 #define IOC_WS2                        0x08000000
00150 #define IOC_PROTOCOL                   0x10000000
00151 #define IOC_VENDOR                     0x18000000
00152 
00153 #if (_WIN32_WINNT >= 0x0600)
00154 #define IOC_WSK                        (IOC_WS2|0x07000000)
00155 #endif
00156 
00157 #define _WSAIO(x,y)                    (IOC_VOID|(x)|(y))
00158 #define _WSAIOR(x,y)                   (IOC_OUT|(x)|(y))
00159 #define _WSAIOW(x,y)                   (IOC_IN|(x)|(y))
00160 #define _WSAIORW(x,y)                  (IOC_INOUT|(x)|(y))
00161 
00162 #define SIO_ASSOCIATE_HANDLE                _WSAIOW(IOC_WS2,1)
00163 #define SIO_ENABLE_CIRCULAR_QUEUEING        _WSAIO(IOC_WS2,2)
00164 #define SIO_FIND_ROUTE                      _WSAIOR(IOC_WS2,3)
00165 #define SIO_FLUSH                           _WSAIO(IOC_WS2,4)
00166 #define SIO_GET_BROADCAST_ADDRESS           _WSAIOR(IOC_WS2,5)
00167 #define SIO_GET_EXTENSION_FUNCTION_POINTER  _WSAIORW(IOC_WS2,6)
00168 #define SIO_GET_QOS                         _WSAIORW(IOC_WS2,7)
00169 #define SIO_GET_GROUP_QOS                   _WSAIORW(IOC_WS2,8)
00170 #define SIO_MULTIPOINT_LOOPBACK             _WSAIOW(IOC_WS2,9)
00171 #define SIO_MULTICAST_SCOPE                 _WSAIOW(IOC_WS2,10)
00172 #define SIO_SET_QOS                         _WSAIOW(IOC_WS2,11)
00173 #define SIO_SET_GROUP_QOS                   _WSAIOW(IOC_WS2,12)
00174 #define SIO_TRANSLATE_HANDLE                _WSAIORW(IOC_WS2,13)
00175 #define SIO_ROUTING_INTERFACE_QUERY         _WSAIORW(IOC_WS2,20)
00176 #define SIO_ROUTING_INTERFACE_CHANGE        _WSAIOW(IOC_WS2,21)
00177 #define SIO_ADDRESS_LIST_QUERY              _WSAIOR(IOC_WS2,22)
00178 #define SIO_ADDRESS_LIST_CHANGE             _WSAIO(IOC_WS2,23)
00179 #define SIO_QUERY_TARGET_PNP_HANDLE         _WSAIOR(IOC_WS2,24)
00180 
00181 #if(_WIN32_WINNT >= 0x0501)
00182 #define SIO_ADDRESS_LIST_SORT               _WSAIORW(IOC_WS2,25)
00183 #endif
00184 
00185 #if (_WIN32_WINNT >= 0x0600)
00186 #define SIO_RESERVED_1                      _WSAIOW(IOC_WS2,26)
00187 #define SIO_RESERVED_2                      _WSAIOW(IOC_WS2,33)
00188 #endif
00189 
00190 #define IPPROTO_IP                          0
00191 
00192 #define IPPORT_TCPMUX           1
00193 #define IPPORT_ECHO             7
00194 #define IPPORT_DISCARD          9
00195 #define IPPORT_SYSTAT           11
00196 #define IPPORT_DAYTIME          13
00197 #define IPPORT_NETSTAT          15
00198 #define IPPORT_QOTD             17
00199 #define IPPORT_MSP              18
00200 #define IPPORT_CHARGEN          19
00201 #define IPPORT_FTP_DATA         20
00202 #define IPPORT_FTP              21
00203 #define IPPORT_TELNET           23
00204 #define IPPORT_SMTP             25
00205 #define IPPORT_TIMESERVER       37
00206 #define IPPORT_NAMESERVER       42
00207 #define IPPORT_WHOIS            43
00208 #define IPPORT_MTP              57
00209 
00210 #define IPPORT_TFTP             69
00211 #define IPPORT_RJE              77
00212 #define IPPORT_FINGER           79
00213 #define IPPORT_TTYLINK          87
00214 #define IPPORT_SUPDUP           95
00215 
00216 #define IPPORT_POP3             110
00217 #define IPPORT_NTP              123
00218 #define IPPORT_EPMAP            135
00219 #define IPPORT_NETBIOS_NS       137
00220 #define IPPORT_NETBIOS_DGM      138
00221 #define IPPORT_NETBIOS_SSN      139
00222 #define IPPORT_IMAP             143
00223 #define IPPORT_SNMP             161
00224 #define IPPORT_SNMP_TRAP        162
00225 #define IPPORT_IMAP3            220
00226 #define IPPORT_LDAP             389
00227 #define IPPORT_HTTPS            443
00228 #define IPPORT_MICROSOFT_DS     445
00229 #define IPPORT_EXECSERVER       512
00230 #define IPPORT_LOGINSERVER      513
00231 #define IPPORT_CMDSERVER        514
00232 #define IPPORT_EFSSERVER        520
00233 
00234 #define IPPORT_BIFFUDP          512
00235 #define IPPORT_WHOSERVER        513
00236 #define IPPORT_ROUTESERVER      520
00237 #define IPPORT_RESERVED         1024
00238 
00239 #if (_WIN32_WINNT >= 0x0600)
00240 
00241 #define IPPORT_REGISTERED_MIN   IPPORT_RESERVED
00242 #define IPPORT_REGISTERED_MAX   0xbfff
00243 #define IPPORT_DYNAMIC_MIN      0xc000
00244 #define IPPORT_DYNAMIC_MAX      0xffff
00245 
00246 #endif /* (_WIN32_WINNT >= 0x0600) */
00247 
00248 #define IN_CLASSA(i)            (((LONG)(i) & 0x80000000) == 0)
00249 #define IN_CLASSA_NET           0xff000000
00250 #define IN_CLASSA_NSHIFT        24
00251 #define IN_CLASSA_HOST          0x00ffffff
00252 #define IN_CLASSA_MAX           128
00253 
00254 #define IN_CLASSB(i)            (((LONG)(i) & 0xc0000000) == 0x80000000)
00255 #define IN_CLASSB_NET           0xffff0000
00256 #define IN_CLASSB_NSHIFT        16
00257 #define IN_CLASSB_HOST          0x0000ffff
00258 #define IN_CLASSB_MAX           65536
00259 
00260 #define IN_CLASSC(i)            (((LONG)(i) & 0xe0000000) == 0xc0000000)
00261 #define IN_CLASSC_NET           0xffffff00
00262 #define IN_CLASSC_NSHIFT        8
00263 #define IN_CLASSC_HOST          0x000000ff
00264 
00265 #define IN_CLASSD(i)            (((long)(i) & 0xf0000000) == 0xe0000000)
00266 #define IN_CLASSD_NET           0xf0000000
00267 #define IN_CLASSD_NSHIFT        28
00268 #define IN_CLASSD_HOST          0x0fffffff
00269 #define IN_MULTICAST(i)         IN_CLASSD(i)
00270 
00271 #define INADDR_ANY              (ULONG)0x00000000
00272 #define INADDR_LOOPBACK         0x7f000001
00273 #define INADDR_BROADCAST        (ULONG)0xffffffff
00274 #define INADDR_NONE             0xffffffff
00275 
00276 #define SCOPEID_UNSPECIFIED_INIT    {0}
00277 
00278 #define IOCPARM_MASK    0x7f
00279 #define IOC_VOID        0x20000000
00280 #define IOC_OUT         0x40000000
00281 #define IOC_IN          0x80000000
00282 #define IOC_INOUT       (IOC_IN|IOC_OUT)
00283 
00284 #define _IO(x,y)        (IOC_VOID|((x)<<8)|(y))
00285 #define _IOR(x,y,t)     (IOC_OUT|(((long)sizeof(t)&IOCPARM_MASK)<<16)|((x)<<8)|(y))
00286 #define _IOW(x,y,t)     (IOC_IN|(((long)sizeof(t)&IOCPARM_MASK)<<16)|((x)<<8)|(y))
00287 
00288 #define MSG_TRUNC       0x0100
00289 #define MSG_CTRUNC      0x0200
00290 #define MSG_BCAST       0x0400
00291 #define MSG_MCAST       0x0800
00292 
00293 #define AI_PASSIVE                  0x00000001
00294 #define AI_CANONNAME                0x00000002
00295 #define AI_NUMERICHOST              0x00000004
00296 #define AI_NUMERICSERV              0x00000008
00297 
00298 #define AI_ALL                      0x00000100
00299 #define AI_ADDRCONFIG               0x00000400
00300 #define AI_V4MAPPED                 0x00000800
00301 
00302 #define AI_NON_AUTHORITATIVE        0x00004000
00303 #define AI_SECURE                   0x00008000
00304 #define AI_RETURN_PREFERRED_NAMES   0x00010000
00305 
00306 #define AI_FQDN                     0x00020000
00307 #define AI_FILESERVER               0x00040000
00308 
00309 #define NS_ALL                      0
00310 
00311 #define NS_SAP                      1
00312 #define NS_NDS                      2
00313 #define NS_PEER_BROWSE              3
00314 #define NS_SLP                      5
00315 #define NS_DHCP                     6
00316 
00317 #define NS_TCPIP_LOCAL              10
00318 #define NS_TCPIP_HOSTS              11
00319 #define NS_DNS                      12
00320 #define NS_NETBT                    13
00321 #define NS_WINS                     14
00322 
00323 #if(_WIN32_WINNT >= 0x0501)
00324 #define NS_NLA                      15
00325 #endif
00326 
00327 #if(_WIN32_WINNT >= 0x0600)
00328 #define NS_BTH                      16
00329 #endif
00330 
00331 #define NS_NBP                      20
00332 
00333 #define NS_MS                       30
00334 #define NS_STDA                     31
00335 #define NS_NTDS                     32
00336 
00337 #if(_WIN32_WINNT >= 0x0600)
00338 #define NS_EMAIL                    37
00339 #define NS_PNRPNAME                 38
00340 #define NS_PNRPCLOUD                39
00341 #endif
00342 
00343 #define NS_X500                     40
00344 #define NS_NIS                      41
00345 #define NS_NISPLUS                  42
00346 
00347 #define NS_WRQ                      50
00348 
00349 #define NS_NETDES                   60
00350 
00351 #define NI_NOFQDN       0x01
00352 #define NI_NUMERICHOST  0x02
00353 #define NI_NAMEREQD     0x04
00354 #define NI_NUMERICSERV  0x08
00355 #define NI_DGRAM        0x10
00356 
00357 #define NI_MAXHOST      1025
00358 #define NI_MAXSERV      32
00359 
00360 typedef struct sockaddr {
00361 #if (_WIN32_WINNT < 0x0600)
00362   u_short sa_family;
00363 #else
00364   ADDRESS_FAMILY sa_family;
00365 #endif
00366   CHAR sa_data[14];
00367 } SOCKADDR, *PSOCKADDR, FAR *LPSOCKADDR;
00368 
00369 #ifndef __CSADDR_DEFINED__
00370 #define __CSADDR_DEFINED__
00371 
00372 typedef struct _SOCKET_ADDRESS {
00373   LPSOCKADDR lpSockaddr;
00374   INT iSockaddrLength;
00375 } SOCKET_ADDRESS, *PSOCKET_ADDRESS, *LPSOCKET_ADDRESS;
00376 
00377 typedef struct _SOCKET_ADDRESS_LIST {
00378   INT iAddressCount;
00379   SOCKET_ADDRESS Address[1];
00380 } SOCKET_ADDRESS_LIST, *PSOCKET_ADDRESS_LIST, FAR *LPSOCKET_ADDRESS_LIST;
00381 
00382 #if (_WIN32_WINNT >= 0x0600)
00383 #define SIZEOF_SOCKET_ADDRESS_LIST(AddressCount) \
00384     (FIELD_OFFSET(SOCKET_ADDRESS_LIST, Address) + \
00385      AddressCount * sizeof(SOCKET_ADDRESS))
00386 #endif
00387 
00388 typedef struct _CSADDR_INFO {
00389   SOCKET_ADDRESS LocalAddr;
00390   SOCKET_ADDRESS RemoteAddr;
00391   INT iSocketType;
00392   INT iProtocol;
00393 } CSADDR_INFO, *PCSADDR_INFO, FAR *LPCSADDR_INFO ;
00394 
00395 #endif /* __CSADDR_DEFINED__ */
00396 
00397 typedef struct sockaddr_storage {
00398   ADDRESS_FAMILY ss_family;
00399   CHAR __ss_pad1[_SS_PAD1SIZE];
00400   __int64 __ss_align;
00401   CHAR __ss_pad2[_SS_PAD2SIZE];
00402 } SOCKADDR_STORAGE_LH, *PSOCKADDR_STORAGE_LH, FAR *LPSOCKADDR_STORAGE_LH;
00403 
00404 typedef struct sockaddr_storage_xp {
00405   short ss_family;
00406   CHAR __ss_pad1[_SS_PAD1SIZE];
00407   __int64 __ss_align;
00408   CHAR __ss_pad2[_SS_PAD2SIZE];
00409 } SOCKADDR_STORAGE_XP, *PSOCKADDR_STORAGE_XP, FAR *LPSOCKADDR_STORAGE_XP;
00410 
00411 #if (_WIN32_WINNT >= 0x0600)
00412 
00413 typedef SOCKADDR_STORAGE_LH SOCKADDR_STORAGE;
00414 typedef SOCKADDR_STORAGE *PSOCKADDR_STORAGE, FAR *LPSOCKADDR_STORAGE;
00415 
00416 #elif (_WIN32_WINNT >= 0x0501)
00417 
00418 typedef SOCKADDR_STORAGE_XP SOCKADDR_STORAGE;
00419 typedef SOCKADDR_STORAGE *PSOCKADDR_STORAGE, FAR *LPSOCKADDR_STORAGE;
00420 
00421 #endif /* (_WIN32_WINNT >= 0x0600) */
00422 
00423 typedef enum {
00424 #if (_WIN32_WINNT >= 0x0501)
00425   IPPROTO_HOPOPTS = 0,
00426 #endif
00427   IPPROTO_ICMP = 1,
00428   IPPROTO_IGMP = 2,
00429   IPPROTO_GGP = 3,
00430 #if (_WIN32_WINNT >= 0x0501)
00431   IPPROTO_IPV4 = 4,
00432 #endif
00433 #if (_WIN32_WINNT >= 0x0600)
00434   IPPROTO_ST = 5,
00435 #endif
00436   IPPROTO_TCP = 6,
00437 #if (_WIN32_WINNT >= 0x0600)
00438   IPPROTO_CBT = 7,
00439   IPPROTO_EGP = 8,
00440   IPPROTO_IGP = 9,
00441 #endif
00442   IPPROTO_PUP = 12,
00443   IPPROTO_UDP = 17,
00444   IPPROTO_IDP = 22,
00445 #if (_WIN32_WINNT >= 0x0600)
00446   IPPROTO_RDP = 27,
00447 #endif
00448 #if (_WIN32_WINNT >= 0x0501)
00449   IPPROTO_IPV6 = 41,
00450   IPPROTO_ROUTING = 43,
00451   IPPROTO_FRAGMENT = 44,
00452   IPPROTO_ESP = 50,
00453   IPPROTO_AH = 51,
00454   IPPROTO_ICMPV6 = 58,
00455   IPPROTO_NONE = 59,
00456   IPPROTO_DSTOPTS = 60,
00457 #endif /* (_WIN32_WINNT >= 0x0501) */
00458   IPPROTO_ND = 77,
00459 #if(_WIN32_WINNT >= 0x0501)
00460   IPPROTO_ICLFXBM = 78,
00461 #endif
00462 #if (_WIN32_WINNT >= 0x0600)
00463   IPPROTO_PIM = 103,
00464   IPPROTO_PGM = 113,
00465   IPPROTO_L2TP = 115,
00466   IPPROTO_SCTP = 132,
00467 #endif /* (_WIN32_WINNT >= 0x0600) */
00468   IPPROTO_RAW = 255,
00469   IPPROTO_MAX = 256,
00470   IPPROTO_RESERVED_RAW = 257,
00471   IPPROTO_RESERVED_IPSEC = 258,
00472   IPPROTO_RESERVED_IPSECOFFLOAD = 259,
00473   IPPROTO_RESERVED_MAX = 260
00474 } IPPROTO, *PIPROTO;
00475 
00476 typedef enum {
00477   ScopeLevelInterface = 1,
00478   ScopeLevelLink = 2,
00479   ScopeLevelSubnet = 3,
00480   ScopeLevelAdmin = 4,
00481   ScopeLevelSite = 5,
00482   ScopeLevelOrganization = 8,
00483   ScopeLevelGlobal = 14,
00484   ScopeLevelCount = 16
00485 } SCOPE_LEVEL;
00486 
00487 typedef struct {
00488   union {
00489     struct {
00490       ULONG Zone:28;
00491       ULONG Level:4;
00492     };
00493     ULONG Value;
00494   };
00495 } SCOPE_ID, *PSCOPE_ID;
00496 
00497 typedef struct sockaddr_in {
00498 #if(_WIN32_WINNT < 0x0600)
00499   short sin_family;
00500 #else
00501   ADDRESS_FAMILY sin_family;
00502 #endif
00503   USHORT sin_port;
00504   IN_ADDR sin_addr;
00505   CHAR sin_zero[8];
00506 } SOCKADDR_IN, *PSOCKADDR_IN;
00507 
00508 #if(_WIN32_WINNT >= 0x0601)
00509 typedef struct sockaddr_dl {
00510   ADDRESS_FAMILY sdl_family;
00511   UCHAR sdl_data[8];
00512   UCHAR sdl_zero[4];
00513 } SOCKADDR_DL, *PSOCKADDR_DL;
00514 #endif
00515 
00516 typedef struct _WSABUF {
00517   ULONG len;
00518   CHAR FAR *buf;
00519 } WSABUF, FAR * LPWSABUF;
00520 
00521 typedef struct _WSAMSG {
00522   LPSOCKADDR name;
00523   INT namelen;
00524   LPWSABUF lpBuffers;
00525 #if (_WIN32_WINNT >= 0x0600)
00526   ULONG dwBufferCount;
00527 #else
00528   DWORD dwBufferCount;
00529 #endif
00530   WSABUF Control;
00531 #if (_WIN32_WINNT >= 0x0600)
00532   ULONG dwFlags;
00533 #else
00534   DWORD dwFlags;
00535 #endif
00536 } WSAMSG, *PWSAMSG, *FAR LPWSAMSG;
00537 
00538 #if (_WIN32_WINNT >= 0x0600)
00539 #define _WSACMSGHDR cmsghdr
00540 #endif
00541 
00542 typedef struct _WSACMSGHDR {
00543   SIZE_T cmsg_len;
00544   INT cmsg_level;
00545   INT cmsg_type;
00546 } WSACMSGHDR, *PWSACMSGHDR, FAR *LPWSACMSGHDR;
00547 
00548 #if (_WIN32_WINNT >= 0x0600)
00549 typedef WSACMSGHDR CMSGHDR, *PCMSGHDR;
00550 #endif
00551 
00552 #define WSA_CMSGHDR_ALIGN(length) (((length) + TYPE_ALIGNMENT(WSACMSGHDR)-1) &  \
00553                                    (~(TYPE_ALIGNMENT(WSACMSGHDR)-1)))
00554 
00555 #define WSA_CMSGDATA_ALIGN(length) (((length) + MAX_NATURAL_ALIGNMENT-1) &      \
00556                                     (~(MAX_NATURAL_ALIGNMENT-1)))
00557 
00558 #if(_WIN32_WINNT >= 0x0600)
00559 #define CMSGHDR_ALIGN WSA_CMSGHDR_ALIGN
00560 #define CMSGDATA_ALIGN WSA_CMSGDATA_ALIGN
00561 #endif
00562 
00563 /*
00564  *  WSA_CMSG_FIRSTHDR
00565  *
00566  *  Returns a pointer to the first ancillary data object, 
00567  *  or a null pointer if there is no ancillary data in the 
00568  *  control buffer of the WSAMSG structure.
00569  *
00570  *  LPCMSGHDR 
00571  *  WSA_CMSG_FIRSTHDR (
00572  *      LPWSAMSG    msg
00573  *      );
00574  */
00575 #define WSA_CMSG_FIRSTHDR(msg) (((msg)->Control.len >= sizeof(WSACMSGHDR))  \
00576                                 ? (LPWSACMSGHDR)(msg)->Control.buf          \
00577                                 : (LPWSACMSGHDR)NULL)
00578 
00579 #if(_WIN32_WINNT >= 0x0600)
00580 #define CMSG_FIRSTHDR WSA_CMSG_FIRSTHDR
00581 #endif
00582 
00583 /* 
00584  *  WSA_CMSG_NXTHDR
00585  *
00586  *  Returns a pointer to the next ancillary data object,
00587  *  or a null if there are no more data objects.
00588  *
00589  *  LPCMSGHDR 
00590  *  WSA_CMSG_NEXTHDR (
00591  *      LPWSAMSG        msg,
00592  *      LPWSACMSGHDR    cmsg
00593  *      );
00594  */
00595 #define WSA_CMSG_NXTHDR(msg, cmsg)                          \
00596     ( ((cmsg) == NULL)                                      \
00597         ? WSA_CMSG_FIRSTHDR(msg)                            \
00598         : ( ( ((PUCHAR)(cmsg) +                             \
00599                     WSA_CMSGHDR_ALIGN((cmsg)->cmsg_len) +   \
00600                     sizeof(WSACMSGHDR) ) >                  \
00601                 (PUCHAR)((msg)->Control.buf) +              \
00602                     (msg)->Control.len )                    \
00603             ? (LPWSACMSGHDR)NULL                            \
00604             : (LPWSACMSGHDR)((PUCHAR)(cmsg) +               \
00605                 WSA_CMSGHDR_ALIGN((cmsg)->cmsg_len)) ) )
00606 
00607 #if(_WIN32_WINNT >= 0x0600)
00608 #define CMSG_NXTHDR WSA_CMSG_NXTHDR
00609 #endif
00610 
00611 /* 
00612  *  WSA_CMSG_DATA
00613  *
00614  *  Returns a pointer to the first byte of data (what is referred 
00615  *  to as the cmsg_data member though it is not defined in 
00616  *  the structure).
00617  *
00618  *  Note that RFC 2292 defines this as CMSG_DATA, but that name
00619  *  is already used by wincrypt.h, and so Windows has used WSA_CMSG_DATA.
00620  *
00621  *  PUCHAR
00622  *  WSA_CMSG_DATA (
00623  *      LPWSACMSGHDR   pcmsg
00624  *      );
00625  */
00626 #define WSA_CMSG_DATA(cmsg) ((PUCHAR)(cmsg) + WSA_CMSGDATA_ALIGN(sizeof(WSACMSGHDR)))
00627 
00628 /*
00629  *  WSA_CMSG_SPACE
00630  *
00631  *  Returns total size of an ancillary data object given 
00632  *  the amount of data. Used to allocate the correct amount 
00633  *  of space.
00634  *
00635  *  SIZE_T
00636  *  WSA_CMSG_SPACE (
00637  *      SIZE_T length
00638  *      );
00639  */
00640 #define WSA_CMSG_SPACE(length) (WSA_CMSGDATA_ALIGN(sizeof(WSACMSGHDR) + WSA_CMSGHDR_ALIGN(length)))
00641 
00642 #if(_WIN32_WINNT >= 0x0600)
00643 #define CMSG_SPACE WSA_CMSG_SPACE
00644 #endif
00645 
00646 /*
00647  *  WSA_CMSG_LEN
00648  *
00649  *  Returns the value to store in cmsg_len given the amount of data.
00650  *
00651  *  SIZE_T
00652  *  WSA_CMSG_LEN (
00653  *      SIZE_T length
00654  *  );
00655  */
00656 #define WSA_CMSG_LEN(length) (WSA_CMSGDATA_ALIGN(sizeof(WSACMSGHDR)) + length)
00657 
00658 #if(_WIN32_WINNT >= 0x0600)
00659 #define CMSG_LEN WSA_CMSG_LEN
00660 #endif
00661 
00662 typedef struct addrinfo {
00663   int ai_flags;
00664   int ai_family;
00665   int ai_socktype;
00666   int ai_protocol;
00667   size_t ai_addrlen;
00668   char *ai_canonname;
00669   struct sockaddr *ai_addr;
00670   struct addrinfo *ai_next;
00671 } ADDRINFOA, *PADDRINFOA;
00672 
00673 typedef struct addrinfoW {
00674   int ai_flags;
00675   int ai_family;
00676   int ai_socktype;
00677   int ai_protocol;
00678   size_t ai_addrlen;
00679   PWSTR ai_canonname;
00680   struct sockaddr *ai_addr;
00681   struct addrinfoW *ai_next;
00682 } ADDRINFOW, *PADDRINFOW;
00683 
00684 #if (_WIN32_WINNT >= 0x0600)
00685 
00686 typedef struct addrinfoexA {
00687   int ai_flags;
00688   int ai_family;
00689   int ai_socktype;
00690   int ai_protocol;
00691   size_t ai_addrlen;
00692   char *ai_canonname;
00693   struct sockaddr *ai_addr;
00694   void *ai_blob;
00695   size_t ai_bloblen;
00696   LPGUID ai_provider;
00697   struct addrinfoexA *ai_next;
00698 } ADDRINFOEXA, *PADDRINFOEXA, *LPADDRINFOEXA;
00699 
00700 typedef struct addrinfoexW {
00701   int ai_flags;
00702   int ai_family;
00703   int ai_socktype;
00704   int ai_protocol;
00705   size_t ai_addrlen;
00706   PWSTR ai_canonname;
00707   struct sockaddr *ai_addr;
00708   void *ai_blob;
00709   size_t ai_bloblen;
00710   LPGUID ai_provider;
00711   struct addrinfoexW *ai_next;
00712 } ADDRINFOEXW, *PADDRINFOEXW, *LPADDRINFOEXW;
00713 
00714 #endif /* (_WIN32_WINNT >= 0x0600) */
00715 
00716 #ifdef __cplusplus
00717 }
00718 #endif

Generated on Fri May 25 2012 04:31:26 for ReactOS by doxygen 1.7.6.1

ReactOS is a registered trademark or a trademark of ReactOS Foundation in the United States and other countries.