WSAPROTOCOL_INFOA Structure

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

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.

Note

  Only one of XP1_UNI_SEND or XP1_UNI_RECV values may be set. If a protocol can be unidirectional in either direction, two WSAPROTOCOL_INFOW structures should be used. When neither bit is set, the protocol is considered to be bidirectional.

dwServiceFlags2
Reserved for additional protocol-attribute definitions.

dwServiceFlags3
Reserved for additional protocol-attribute definitions.

dwServiceFlags4
Reserved for additional protocol-attribute definitions.

dwProviderFlags
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.

ProviderId
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
A unique identifier assigned by the WS2_32.DLL for each WSAPROTOCOL_INFO structure.

ProtocolChain
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
The protocol version identifier.

iAddressFamily

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 Microsoft Windows Software Development Kit (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 Software Development Kit (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.

iMaxSockAddr
The maximum address length, in bytes.

iMinSockAddr
The minimum address length, in bytes.

iSocketType

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:

iProtocol

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 Microsoft Windows Software Development Kit (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 Software Development Kit (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
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
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
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
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.

dwProviderReserved
Reserved for use by service providers.

szProtocol
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.

Requirements

Header: Declared in winsock2.h.

Library: Use ws2_32.lib.