TDI_CONNECTION_INFO

typedef struct _TDI_CONNECTION_INFO {

    ULONG          State;

    ULONG          Event;

    ULONG          TransmittedTsdus;

    ULONG          ReceivedTsdus;

    ULONG          TransmissionErrors;

    ULONG          ReceiveErrors;

    LARGE_INTEGER  Throughput;

    LARGE_INTEGER  Delay;

    ULONG          SendBufferSize;

    ULONG          ReceiveBufferSize;

    BOOLEAN        Unreliable;

} TDI_CONNECTION_INFO, *PTDI_CONNECTION_INFO;

 

TDI_CONNECTION_INFO defines the structure of the information returned for a TDI_QUERY_INFORMATION request in which the IrpSp->Parameters.QueryType is set to TDI_QUERY_CONNECTION_INFO.

Members

State

Specifies the current state of the connection on the network.

Event

Specifies the type of event the TDI driver most recently indicated to the client. The value is expressed as a TDI_EVENT_XXX code.

TransmittedTsdus

Specifies the number of TSDUs transmitted on the connection endpoint.

ReceivedTsdus

Specifies the number of TSDUs received on the connection endpoint.

TransmissionErrors

Specifies the number of TSDUs that have had an error during transmission on the connection endpoint.

ReceiveErrors

Specifies the number of TSDUs that have had an error during reception on the connection endpoint.

Throughput

Specifies the estimated throughput on the connection, expressed in bytes per second, for sends and receives. Zero indicates that the driver cannot calculate the throughput.

Delay

Specifies the estimated delay on the connection, expressed as a negative value. Delay, which is essentially constant regardless of packet size, affects the transmission time of each TSDU sent to the remote node.

SendBufferSize

If the transport buffers sends internally, specifies the size in bytes of its send buffer. Otherwise, this member is zero.

ReceiveBufferSize

If the transport buffers receives internally, specifies the size in bytes of its receive buffer. Otherwise, this member is zero.

Unreliable

Specifies TRUE if the transport determines that the connection has become unreliable. The transport is likely to send a disconnection event to its client if this member is TRUE, and sends or receives on this connection are likely to fail.

Comments

A kernel-mode client that has opened a file object representing a connection with ZwCreateFile can make a query to determine the current state of its local connection. Such a client sets up an IRP with TdiBuildQueryInformation, passing in the QType TDI_QUERY_CONNECTION_INFO, and submits the IRP to the underlying transport to get this information.

TDI_CONNECTION_INFO defines the format in which the transport returns the requested information for such a query.

Until a client has established an endpoint-to-endpoint connection with a remote-node peer, only a subset of this information is potentially useful to the client, such as the SendBufferSize and ReceiveBufferSize of an underlying transport that supports internal buffering. A TDI transport can simply return its default or initialization values for members that are not yet relevant or even fail the query-information request if an endpoint-to-endpoint connection is not yet established.

Consequently, kernel-mode clients usually submit this request to their transports after making an endpoint-to-endpoint connection with a remote-node peer. For example, the client can estimate the transmission time for sends over the network using the Delay and Throughput values returned for this query, assuming the underlying transport does not return a zero for either. The estimated time to transmit a TSDU of size n bytes can be calculated as SendTime = Delay + (n * Throughput).

See Also

TdiBuildQueryInformation, TdiDispatchInternalDeviceControl, TDI_QUERY_INFORMATION