NDK_FN_CONNECT callback function

The NdkConnect (NDK_FN_CONNECT) function initiates an NDK connect request.

Syntax

NDK_FN_CONNECT NdkFnConnect;

NTSTATUS NdkFnConnect(
  NDK_CONNECTOR *pNdkConnector,
  NDK_QP *pNdkQp,
  const PSOCKADDR pSrcAddress,
  ULONG SrcAddressLength,
  const PSOCKADDR pDestAddress,
  ULONG DestAddressLength,
  ULONG InboundReadLimit,
  ULONG OutboundReadLimit,
  const PVOID pPrivateData,
  ULONG PrivateDataLength,
  NDK_FN_REQUEST_COMPLETION RequestCompletion,
  PVOID RequestContext
)
{...}

Parameters

pNdkConnector

pNdkQp

pSrcAddress

SrcAddressLength

The size, in bytes, of source address data at the pSrcAddress parameter.

pDestAddress

A destination address. For AF_INET or AF_INET6 pDestAddress is the destination IP address and the source ND port .

DestAddressLength

The size, in bytes, of destination address data at the pDestAddress parameter.

InboundReadLimit

The consumer-supplied maximum number of incoming in-progress read operations to allow on the QP. If the underlying provider has a lower MaxInboundReadLimit value in the NDK_ADAPTER_INFO structure, then the provider will cap the consumer-supplied value to the provider maximum. If the peer has a lower OutboundReadLimit value, then the provider will use that value as the effective InboundReadLimit. The consumer can retrieve the effective InboundReadLimit by calling the NdkGetConnectionData function (NDK_FN_GET_CONNECTION_DATA).

OutboundReadLimit

The consumer-supplied maximum number of outgoing in-progress read operations to allow on the QP. If the underlying provider has a lower MaxOutboundReadLimit value in the NDK_ADAPTER_INFO structure, then the provider will cap the consumer supplied value to the provider maximum. If the peer has a lower InboundReadLimit, then the provider will use that value as the effective OutboundReadLimit. The consumer can retrieve the effective OutboundReadLimit by calling the NdkGetConnectionData function (NDK_FN_GET_CONNECTION_DATA).

pPrivateData

PrivateDataLength

The length, in bytes, of the private data that is provided in the pPrivateData parameter.

RequestCompletion

A pointer to a request completion callback routine NdkRequestCompletion (NDK_FN_REQUEST_COMPLETION).

RequestContext

A context value to pass to the Context parameter of the callback function that is specified in the RequestCompletion parameter.

Return Value

The NdkConnect function returns one of the following NTSTATUS codes.

Return code Description
STATUS_SUCCESS
The connect request was completed successfully.
STATUS_PENDING
The operation is pending and will be completed later. The driver will call the specified RequestCompletion (NDK_FN_REQUEST_COMPLETION) function to complete the pending operation.
STATUS_INSUFFICIENT_RESOURCES
The request failed due to insufficient resources.
Important  The request can fail inline as well as asynchronously with this status code.
 
STATUS_NETWORK_UNREACHABLE
The request failed because the remote network was not reachable. The connection attempt can be retried.
Important  The request can fail inline as well as asynchronously with this status code.
 
STATUS_HOST_UNREACHABLE
The request failed because the remote host system was not reachable. The connection attempt can be retried.
Important  The request can fail inline as well as asynchronously with this status code.
 
STATUS_CONNECTION_REFUSED
The request failed because the remote system refused the connection request. This can be due to lack of listener, backlog limits, or the peer actively rejecting the connection request. The connection attempt can be retried.
Important  The request can fail inline as well as asynchronously with this status code.
 
STATUS_IO_TIMEOUT
The request failed because the connection request timed out. The connection attempt may be retried. Timeout values are selected by Network Direct providers to match their respective network characteristics.
Important  The request can fail inline as well as asynchronously with this status code.
 
STATUS_SHARING_VIOLATION
The request failed because the specified local address is already in use.
Important  The request can fail inline as well as asynchronously with this status code.
 
STATUS_INVALID_ADDRESS
The request failed because the specified local address is not a valid address for the adapter.
Important  The request can fail inline as well as asynchronously with this status code.
 
STATUS_TOO_MANY_ADDRESSES
The request failed because the consumer specified a local port number of zero, and the Network Direct provider was unable to allocate a port from the ephemeral port space (ports 49152-65535).
Important  The request can fail inline as well as asynchronously with this status code.
 
STATUS_ADDRESS_ALREADY_EXISTS
The request failed because a connection with the combination of local address, local port, remote address, and remote port already exists.
Important  The request can fail inline as well as asynchronously with this status code.
 
Other status codes
An error occurred.

Remarks

NdkConnect initiates a connect request from a local address to a remote address.

Requirements

   
Minimum supported client None supported,Supported in NDIS 6.30 and later.
Minimum supported server Windows Server 2012
Target Platform Windows
Header ndkpi.h (include Ndkpi.h)
IRQL <=DISPATCH_LEVEL

See Also

NDKPI Object Lifetime Requirements

NDK_ADAPTER_INFO

NDK_CONNECTOR

NDK_CONNECTOR_DISPATCH

NDK_FN_DISCONNECT

NDK_FN_GET_CONNECTION_DATA

NDK_FN_REQUEST_COMPLETION

NDK_QP