WSAPROTOCOL_INFO
typedef struct _WSAPROTOCOL_INFOW {
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;
WCHAR szProtocol[WSAPROTOCOL_LEN+1];
} WSAPROTOCOL_INFOW, FAR * LPWSAPROTOCOL_INFOW;
Members
dwServiceFlags1
A bitmask
describing the services provided by the protocol. The following values are
possible:
XP1_CONNECTIONLESS
The protocol
provides connectionless (datagram) service. If not set, the protocol supports
connection-oriented data transfer.
XP1_GUARANTEED_DELIVERY
The protocol
guarantees that all data sent will reach the intended destination.
XP1_GUARANTEED_ORDER
The protocol
guarantees that data will only arrive in the order in which it was sent and
that it will not be duplicated. This characteristic does not necessarily mean
that the data will always be delivered, but that any data that is delivered is
delivered in the order in which it was sent.
XP1_MESSAGE_ORIENTED
The protocol
honors message boundaries, as opposed to a stream-oriented protocol where there
is no concept of message boundaries.
XP1_PSEUDO_STREAM
This is a
message oriented protocol, but message boundaries will be ignored for all
receives. This is convenient when an application does not desire message
framing to be done by the protocol.
XP1_GRACEFUL_CLOSE
The protocol
supports two-phase (graceful) close. If not set, only abortive closes are
performed.
XP1_EXPEDITED_DATA
The protocol
supports expedited (urgent) data.
XP1_CONNECT_DATA
The protocol
supports connect data.
XP1_DISCONNECT_DATA
The protocol
supports disconnect data.
XP1_SUPPORT_BROADCAST
The protocol
supports a broadcast mechanism.
XP1_SUPPORT_MULTIPOINT
The protocol
supports a multipoint or multicast mechanism. Control and data plane attributes
are indicated below. XP1_MULTIPOINT_CONTROL_PLANE
Indicates
whether the control plane is rooted (value = 1) or non-rooted (value = 0).
XP1_MULTIPOINT_DATA_PLANE
Indicates
whether the data plane is rooted (value = 1) or non-rooted (value = 0).
XP1_QOS_SUPPORTED
The protocol
supports quality of service requests.
XP1_RESERVED
This bit is
reserved.
XP1_UNI_SEND
The protocol
is unidirectional in the send direction.
XP1_UNI_RECV
the protocol
is unidirectional in the recv direction.
XP1_IFS_HANDLES
The socket
descriptors returned by the provider are operating system Installable File
System (IFS) handles.
XP1_PARTIAL_MESSAGE
The
MSG_PARTIAL flag is supported in WSASend and WSASendTo.
Note that
only one of XP1_UNI_SEND or XP1_UNI_RECV may be set. If a protocol can be
unidirectional in either direction, two WSAPROTOCOL_INFO structs should be
used. When neither bit is set, the protocol is considered to be bi-directional.
dwServiceFlags2
Reserved for
additional protocol attribute definitions.
dwServiceFlags3
Reserved for
additional protocol attribute definitions.
dwServiceFlags4
Reserved for
additional protocol attribute definitions.
dwProviderFlags
Provide
information about how this protocol is represented in the protocol catalog. The
following flag values are possible:
PFL_MULTIPLE_PROTOCOL_ENTRIES
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.
PFL_RECOMMENDED_PROTO_ENTRY
Indicates
that this is the recommended or most frequently used entry for a protocol which
is capable of implementing multiple behaviors.
PFL_HIDDEN
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.
PFL_MATCHES_PROTOCOL_ZERO
Indicates
that a value of zero in the protocol parameter of socket or WSASocket
matches this protocol entry.
ProviderId
A globally
unique identifier 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 may use the dwProviderId value
to distinguish between providers that might otherwise be indistinguishable.
dwCatalogEntryId
A unique
identifier assigned by the WS2_32.DLL for each WSAPROTOCOL_INFO structure.
WSAPROTOCOLCHAIN ProtocolChain;
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 ID is in the dwCatalogEntryId field 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 IDs 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
Protocol
version identifier.
iAddressFamily
The value to
pass as the address family parameter to the socket/WSASocket
function in order to open a socket for this protocol. This value also uniquely
defines the structure of protocol addresses (SOCKADDRs) used by the protocol.
iMaxSockAddr
The maximum
address length.
iMinSockAddr
The minimum
address length.
iSocketType
The value to
pass as the socket type parameter to the socket function in order to
open a socket for this protocol.
iProtocol
The value to
pass as the protocol parameter to the socket function in order to open a
socket for this protocol.
iProtocolMaxOffset
The maximum
value that may be added to iProtocol when supplying a value for the protocol
parameter to socket and WSASocket. Not all protocols allow a
range of values. When this is the case iProtocolMaxOffset will be zero.
iNetworkByteOrder
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
Indicates the
type of security scheme employed (if any). A value of SECURITY_PROTOCOL_NONE is
used for protocols that do not incorporate security provisions.
dwMessageSize
The maximum
message size supported by the protocol. This is the maximum size that can be
sent from any of the host s local interfaces. For protocols which do not
support message framing, the actual maximum that can be sent to a given address
may be less. The following special values are defined:
0
The protocol
is stream-oriented and hence the concept of message size is not relevant.
0x1
The maximum
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.
0xFFFFFFFF
The protocol
is message-oriented, but there is no maximum limit to the size of messages that
may be transmitted.
dwProviderReserved
Reserved for
use by service providers.
szProtocol
An array of
characters that contains a human-readable name identifying the protocol, for
example "SPX2". The maximum number of characters allowed is
WSAPROTOCOL_LEN, which is defined to be 255.