WSAPROTOCOL_INFOA structure (winsock2.h)
The WSAPROTOCOL_INFO structure is used to store or retrieve complete information for a given protocol.
Syntax
typedef struct _WSAPROTOCOL_INFOA {
DWORD dwServiceFlags1;
DWORD dwServiceFlags2;
DWORD dwServiceFlags3;
DWORD dwServiceFlags4;
DWORD dwProviderFlags;
GUID ProviderId;
DWORD dwCatalogEntryId;
WSAPROTOCOLCHAIN ProtocolChain;
int iVersion;
int iAddressFamily;
int iMaxSockAddr;
int iMinSockAddr;
int iSocketType;
int iProtocol;
int iProtocolMaxOffset;
int iNetworkByteOrder;
int iSecurityScheme;
DWORD dwMessageSize;
DWORD dwProviderReserved;
CHAR szProtocol[WSAPROTOCOL_LEN + 1];
} WSAPROTOCOL_INFOA, *LPWSAPROTOCOL_INFOA;
Members
dwServiceFlags1
Type: DWORD
A bitmask that describes the services provided by the protocol. The possible values for this member are defined in the Winsock2.h header file.
The following values are possible.
Value | Meaning |
---|---|
|
Provides connectionless (datagram) service. If not set, the protocol supports connection-oriented data transfer. |
|
Guarantees that all data sent will reach the intended destination. |
|
Guarantees that data only arrives in the order in which it was sent and that it is not duplicated. This characteristic does not necessarily mean that the data is always delivered, but that any data that is delivered is delivered in the order in which it was sent. |
|
Honors message boundaries—as opposed to a stream-oriented protocol where there is no concept of message boundaries. |
|
A message-oriented protocol, but message boundaries are ignored for all receipts. This is convenient when an application does not desire message framing to be done by the protocol. |
|
Supports two-phase (graceful) close. If not set, only abortive closes are performed. |
|
Supports expedited (urgent) data. |
|
Supports connect data. |
|
Supports disconnect data. |
|
Supports a broadcast mechanism. |
|
Supports a multipoint or multicast mechanism. Control and data plane attributes are indicated below. |
|
Indicates whether the control plane is rooted (value = 1) or nonrooted (value = 0). |
|
Indicates whether the data plane is rooted (value = 1) or nonrooted (value = 0). |
|
Supports quality of service requests. |
|
Bit is reserved. |
|
Protocol is unidirectional in the send direction. |
|
Protocol is unidirectional in the recv direction. |
|
Socket descriptors returned by the provider are operating system Installable File System (IFS) handles. |
|
The MSG_PARTIAL flag is supported in WSASend and WSASendTo. |
|
The protocol provides support for SAN.
This value is supported on Windows 7 and Windows Server 2008 R2. |
dwServiceFlags2
Type: DWORD
Reserved for additional protocol-attribute definitions.
dwServiceFlags3
Type: DWORD
Reserved for additional protocol-attribute definitions.
dwServiceFlags4
Type: DWORD
Reserved for additional protocol-attribute definitions.
dwProviderFlags
Type: DWORD
A set of flags that provides information on how this protocol is represented in the Winsock catalog. The possible values for this member are defined in the Winsock2.h header file.
The following flag values are possible.
Value | Meaning |
---|---|
|
Indicates that this is one of two or more entries for a single protocol (from a given provider) which is capable of implementing multiple behaviors. An example of this is SPX which, on the receiving side, can behave either as a message-oriented or a stream-oriented protocol. |
|
Indicates that this is the recommended or most frequently used entry for a protocol that is capable of implementing multiple behaviors. |
|
Set by a provider to indicate to the Ws2_32.dll that this protocol should not be returned in the result buffer generated by WSAEnumProtocols. Obviously, a Windows Sockets 2 application should never see an entry with this bit set. |
|
Indicates that a value of zero in the protocol parameter of socket or WSASocket matches this protocol entry. |
|
Set by a provider to indicate support for network direct access.
This value is supported on Windows 7 and Windows Server 2008 R2. |
ProviderId
Type: GUID
A globally unique identifier (GUID) assigned to the provider by the service provider vendor. This value is useful for instances where more than one service provider is able to implement a particular protocol. An application can use the ProviderId member to distinguish between providers that might otherwise be indistinguishable.
dwCatalogEntryId
Type: DWORD
A unique identifier assigned by the WS2_32.DLL for each WSAPROTOCOL_INFO structure.
ProtocolChain
Type: WSAPROTOCOLCHAIN
The WSAPROTOCOLCHAIN structure associated with the protocol. If the length of the chain is 0, this WSAPROTOCOL_INFO entry represents a layered protocol which has Windows Sockets 2 SPI as both its top and bottom edges. If the length of the chain equals 1, this entry represents a base protocol whose Catalog Entry identifier is in the dwCatalogEntryId member of the WSAPROTOCOL_INFO structure. If the length of the chain is larger than 1, this entry represents a protocol chain which consists of one or more layered protocols on top of a base protocol. The corresponding Catalog Entry identifiers are in the ProtocolChain.ChainEntries array starting with the layered protocol at the top (the zero element in the ProtocolChain.ChainEntries array) and ending with the base protocol. Refer to the Windows Sockets 2 Service Provider Interface specification for more information on protocol chains.
iVersion
Type: int
The protocol version identifier.
iAddressFamily
Type: int
A value to pass as the address family parameter to the socket or WSASocket function in order to open a socket for this protocol. This value also uniquely defines the structure of a protocol address for a sockaddr used by the protocol.
On the Windows SDK released for Windows Vista and later, the possible values for the address family are defined in the Ws2def.h header file. Note that the Ws2def.h header file is automatically included in Winsock2.h, and should never be used directly.
On versions of the Platform SDK for Windows Server 2003 and older, the possible values for the address family are defined in the Winsock2.h header file.
The values currently supported are AF_INET or AF_INET6, which are the Internet address family formats for IPv4 and IPv6. Other options for address family (AF_NETBIOS for use with NetBIOS, for example) are supported if a Windows Sockets service provider for the address family is installed. Note that the values for the AF_ address family and PF_ protocol family constants are identical (for example, AF_INET and PF_INET), so either constant can be used.
The table below lists common values for address family although many other values are possible.
iAddressFamily | Meaning |
---|---|
|
The Internet Protocol version 4 (IPv4) address family. |
|
The IPX/SPX address family. This address family is only supported if the NWLink IPX/SPX NetBIOS Compatible Transport protocol is installed.
This address family is not supported on Windows Vista and later. |
|
The AppleTalk address family. This address family is only supported if the AppleTalk protocol is installed.
This address family is not supported on Windows Vista and later. |
|
The NetBIOS address family. This address family is only supported if the Windows Sockets provider for NetBIOS is installed.
The Windows Sockets provider for NetBIOS is supported on 32-bit versions of Windows. This provider is installed by default on 32-bit versions of Windows. The Windows Sockets provider for NetBIOS is not supported on 64-bit versions of windows including Windows 7, Windows Server 2008, Windows Vista, Windows Server 2003, or Windows XP. The Windows Sockets provider for NetBIOS only supports sockets where the type parameter is set to SOCK_DGRAM. The Windows Sockets provider for NetBIOS is not directly related to the NetBIOS programming interface. The NetBIOS programming interface is not supported on Windows Vista, Windows Server 2008, and later. |
|
The Internet Protocol version 6 (IPv6) address family. |
|
The Infrared Data Association (IrDA) address family.
This address family is only supported if the computer has an infrared port and driver installed. |
|
The Bluetooth address family.
This address family is supported on Windows XP with SP2 or later if the computer has a Bluetooth adapter and driver installed. |
iMaxSockAddr
Type: int
The maximum address length, in bytes.
iMinSockAddr
Type: int
The minimum address length, in bytes.
iSocketType
Type: int
A value to pass as the socket type parameter to the socket or WSASocket function in order to open a socket for this protocol. Possible values for the socket type are defined in the Winsock2.h header file.
The following table lists the possible values for the iSocketType member supported for Windows Sockets 2:
iSocketType | Meaning |
---|---|
|
A socket type that provides sequenced, reliable, two-way, connection-based byte streams with an OOB data transmission mechanism. This socket type uses the Transmission Control Protocol (TCP) for the Internet address family (AF_INET or AF_INET6). |
|
A socket type that supports datagrams, which are connectionless, unreliable buffers of a fixed (typically small) maximum length. This socket type uses the User Datagram Protocol (UDP) for the Internet address family (AF_INET or AF_INET6). |
|
A socket type that provides a raw socket that allows an application to manipulate the next upper-layer protocol header. To manipulate the IPv4 header, the IP_HDRINCL socket option must be set on the socket. To manipulate the IPv6 header, the IPV6_HDRINCL socket option must be set on the socket. |
|
A socket type that provides a reliable message datagram. An example of this type is the Pragmatic General Multicast (PGM) multicast protocol implementation in Windows, often referred to as reliable multicast programming.
This value is only supported if the Reliable Multicast Protocol is installed. |
|
A socket type that provides a pseudo-stream packet based on datagrams. |
iProtocol
Type: int
A value to pass as the protocol parameter to the socket or WSASocket function in order to open a socket for this protocol. The possible options for the iProtocol member are specific to the address family and socket type specified.
On the Windows SDK released for Windows Vista and later, this member can be one of the values from the IPPROTO enumeration type defined in the Ws2def.h header file. Note that the Ws2def.h header file is automatically included in Winsock2.h, and should never be used directly.
On versions of the Platform SDK for Windows Server 2003 and earlier, the possible values for the iProtocol member are defined in the Winsock2.h and Wsrm.h header files.
The table below lists common values for the iProtocol although many other values are possible.
iProtocolMaxOffset
Type: int
The maximum value that may be added to iProtocol when supplying a value for the protocol parameter to socket or WSASocket function. Not all protocols allow a range of values. When this is the case iProtocolMaxOffset is zero.
iNetworkByteOrder
Type: int
Currently these values are manifest constants (BIGENDIAN and LITTLEENDIAN) that indicate either big-endian or little-endian with the values 0 and 1 respectively.
iSecurityScheme
Type: int
The type of security scheme employed (if any). A value of SECURITY_PROTOCOL_NONE (0) is used for protocols that do not incorporate security provisions.
dwMessageSize
Type: DWORD
The maximum message size, in bytes, supported by the protocol. This is the maximum size that can be sent from any of the host's local interfaces. For protocols that do not support message framing, the actual maximum that can be sent to a given address may be less. There is no standard provision to determine the maximum inbound message size. The following special values are defined.
Value | Meaning |
---|---|
|
The protocol is stream-oriented and hence the concept of message size is not relevant. |
|
The maximum outbound (send) message size is dependent on the underlying network MTU (maximum sized transmission unit) and hence cannot be known until after a socket is bound. Applications should use getsockopt to retrieve the value of SO_MAX_MSG_SIZE after the socket has been bound to a local address. |
|
The protocol is message-oriented, but there is no maximum limit to the size of messages that may be transmitted. |
dwProviderReserved
Type: DWORD
Reserved for use by service providers.
szProtocol[WSAPROTOCOL_LEN + 1]
Type: TCHAR[WSAPROTOCOL_LEN+1]
An array of characters that contains a human-readable name identifying the protocol, for example "MSAFD Tcpip [UDP/IP]". The maximum number of characters allowed is WSAPROTOCOL_LEN, which is defined to be 255.
Remarks
Note
The winsock2.h header defines WSAPROTOCOL_INFO as an alias that automatically selects the ANSI or Unicode version of this function based on the definition of the UNICODE preprocessor constant. Mixing usage of the encoding-neutral alias with code that is not encoding-neutral can lead to mismatches that result in compilation or runtime errors. For more information, see Conventions for Function Prototypes.
Requirements
Requirement | Value |
---|---|
Minimum supported client | Windows 2000 Professional [desktop apps only] |
Minimum supported server | Windows 2000 Server [desktop apps only] |
Header | winsock2.h |