NDK_FN_CONNECT_WITH_SHARED_ENDPOINT routine

The NdkConnectWithSharedEndpoint (NDK_FN_CONNECT_WITH_SHARED_ENDPOINT) function initiates an NDK connect request from a shared local address to a remote address.

Syntax


NDK_FN_CONNECT_WITH_SHARED_ENDPOINT NdkConnectWithSharedEndpoint;

NTSTATUS NdkConnectWithSharedEndpoint(
  _In_      NDK_CONNECTOR *pNdkConnector,
  _In_      NDK_QP *pNdkQp,
  _In_      NDK_SHARED_ENDPOINT *pNdkSharedEndpoint,
   _In_reads_bytes_(DestAddressLength) CONST PSOCKADDR pDestAddress,
  _In_      ULONG DestAddressLength,
  _In_      ULONG InboundReadLimit,
  _In_      ULONG OutboundReadLimit,
  _In_reads_bytes_opt_(PrivateDataLength) CONST PVOID pPrivateData,
  _In_      ULONG PrivateDataLength,
  _In_      NDK_FN_REQUEST_COMPLETION RequestCompletion,
  _In_opt_  PVOID RequestContext
)
{ ... }

Parameters

pNdkConnector [in]

A pointer to an NDK connector object (NDK_CONNECTOR).

pNdkQp [in]

A pointer to an NDK queue pair (QP) object (NDK_QP) to be associated with the connection.

pNdkSharedEndpoint [in]

A pointer to an NDK shared endpoint object (NDK_SHARED_ENDPOINT) that determines the local address for the connection.

pDestAddress

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

DestAddressLength [in]

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

InboundReadLimit [in]

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 [in]

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

A pointer to private data that is sent with the connect request.

PrivateDataLength [in]

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

RequestCompletion [in]

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

RequestContext [in, optional]

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

Return value

The NdkConnectWithSharedEndpoint function returns one of the following NTSTATUS codes.

Return codeDescription
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 may 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 system was not reachable. The connection attempt may 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 may 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_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

NdkConnectWithSharedEndpoint initiates a connect request from a shared local address to a specific remote address. NdkConnectWithSharedEndpoint allows an NDK consumer to use the same local address (for example, 10.1.1.1:9999) for many outgoing connections when the destination addresses for the connections are different.

Requirements

Minimum supported client

None supported

Minimum supported server

Windows Server 2012

Version

Supported in NDIS 6.30 and later.

Header

Ndkpi.h (include Ndkpi.h)

IRQL

<=DISPATCH_LEVEL

See also

NDK_ADAPTER_INFO
NDK_CONNECTOR
NDK_CONNECTOR_DISPATCH
NDK_FN_GET_CONNECTION_DATA
NDK_FN_REQUEST_COMPLETION
NDK_QP
NDK_SHARED_ENDPOINT
NDKPI Object Lifetime Requirements

 

 

Send comments about this topic to Microsoft

Show:
© 2014 Microsoft