C# Class Microsoft.Protocols.TestTools.StackSdk.FileAccessService.Smbd.SmbdClient

Mostra file Open project: Microsoft/WindowsProtocolTestSuites

Public Methods

Method Description
ConnectToServerOverRdma ( string clientIp, string serverIp, int port, AddressFamily ipFamily, uint nInboundEntries, uint nOutboundEntries, uint inboundReadLimit, uint inboundDataSize ) : NtStatus

Connection to server over RDMA, use the default parameters

DeregisterBuffer ( SmbdBufferDescriptorV1 bufferDescriptor ) : void

deregister each memory region indicated by each SMBDirect Buffer Descriptor V1 structure with the underlying RDMA provider

Disconnect ( ) : void

Disconnect

ManageCredits ( bool onlyCheck ) : int

Managing Credits Prior to Sending

Negotiate ( SmbdVersion minVersion, SmbdVersion maxVersion, ushort creditsRequested, ushort receiveCreditMax, uint preferredSendSize, uint maxReceiveSize, uint maxFragmentedSize, SmbdNegotiateResponse &smbdNegotiateResponse, ushort reserved ) : NtStatus

SMBDirect Negotiate

PostReceive ( ) : NtStatus

Post receive request

PostReceive ( uint size ) : NtStatus

Post receive request

ReadRegisteredBuffer ( byte data, SmbdBufferDescriptorV1 bufferDescriptor ) : NtStatus

Read data from registered buffer

ReceiveDataTransferMessage ( System.TimeSpan timeout, SmbdDataTransferMessage &dataTransferMessage ) : NtStatus

receive SMBDirect data transfer message

ReceiveMessage ( System.TimeSpan timeout, byte &message ) : NtStatus

receive SMBDirect message. If the fragmented message is sent as multiple segments from server, the method will reassemble the data before return.

RegisterBuffer ( uint length, SmbdBufferReadWrite flag, bool reversed, SmbdBufferDescriptorV1 &descriptor ) : NtStatus

register the memory locations indicated by the buffer with the underlying RDMA provider

SendDataTransferMessage ( SmbdDataTransferMessage dataTransferMessage ) : NtStatus

send SMBDirect data transfer message

SendDataTransferMessage ( ushort creditsRequested, ushort creditsGranted, SmbdDataTransfer_Flags flags, ushort reserved, uint remainingDataLength, uint dataOffset, uint dataLength, byte padding, byte buffer ) : NtStatus

send SMBD data transfer message, for test case to control the transfer mannually

SendMessage ( byte message ) : NtStatus

Upper layer requests that the SMBDirect Protocol sends a message. send SMBDirect message. In this function, the data will disassemble to multiple segments if the data size is greater than Connection.MaxSendSize.

Smaller ( uint value1, uint value2 ) : uint

Return smaller one of value1 and value2

SmbdClient ( SmbdLogEvent logSmbdEvent = null ) : System

constructor

SplitData2Segments ( byte message, uint segmentLength ) : List

split fragmented message to multiple SMBDirect segments

WriteRegisteredBuffer ( byte data, SmbdBufferDescriptorV1 bufferDescriptor ) : NtStatus

Write data to registered buffer

Private Methods

Method Description
LogEvent ( string log ) : void

Method Details

ConnectToServerOverRdma() public method

Connection to server over RDMA, use the default parameters
public ConnectToServerOverRdma ( string clientIp, string serverIp, int port, AddressFamily ipFamily, uint nInboundEntries, uint nOutboundEntries, uint inboundReadLimit, uint inboundDataSize ) : NtStatus
clientIp string Clinet IP address
serverIp string Server IP address
port int Port
ipFamily AddressFamily IP Family
nInboundEntries uint RDMA inbound entries
nOutboundEntries uint RDMA outbound entries
inboundReadLimit uint RDMA inbound read size
inboundDataSize uint Max Size of RDMA inbound data
return NtStatus

DeregisterBuffer() public method

deregister each memory region indicated by each SMBDirect Buffer Descriptor V1 structure with the underlying RDMA provider
public DeregisterBuffer ( SmbdBufferDescriptorV1 bufferDescriptor ) : void
bufferDescriptor SmbdBufferDescriptorV1 Buffer Descriptor point to registered buffer
return void

Disconnect() public method

Disconnect
public Disconnect ( ) : void
return void

ManageCredits() public method

Managing Credits Prior to Sending
public ManageCredits ( bool onlyCheck ) : int
onlyCheck bool Only check the credit but not modify the parameters
return int

Negotiate() public method

SMBDirect Negotiate
public Negotiate ( SmbdVersion minVersion, SmbdVersion maxVersion, ushort creditsRequested, ushort receiveCreditMax, uint preferredSendSize, uint maxReceiveSize, uint maxFragmentedSize, SmbdNegotiateResponse &smbdNegotiateResponse, ushort reserved ) : NtStatus
minVersion SmbdVersion The minimum SMBDirect Protocol version supported by the sender
maxVersion SmbdVersion The maximum SMBDirect Protocol version supported by the sender
creditsRequested ushort The number of Send Credits requested of the receiver
receiveCreditMax ushort Maximum of receive credits
preferredSendSize uint The maximum number of bytes that the sender requests to transmit in a single message
maxReceiveSize uint The maximum number of bytes that the sender can receive in a single message
maxFragmentedSize uint The maximum number of upper-layer bytes that the sender can receive as the result of a sequence of fragmented Send operations
smbdNegotiateResponse SmbdNegotiateResponse SMBDirect Negotiate response
reserved ushort The sender SHOULD set this field to 0 and the receiver MUST ignore it on receipt
return NtStatus

PostReceive() public method

Post receive request
public PostReceive ( ) : NtStatus
return NtStatus

PostReceive() public method

Post receive request
public PostReceive ( uint size ) : NtStatus
size uint Size
return NtStatus

ReadRegisteredBuffer() public method

Read data from registered buffer
public ReadRegisteredBuffer ( byte data, SmbdBufferDescriptorV1 bufferDescriptor ) : NtStatus
data byte
bufferDescriptor SmbdBufferDescriptorV1 Buffer Descriptor point to registered buffer
return NtStatus

ReceiveDataTransferMessage() public method

receive SMBDirect data transfer message
public ReceiveDataTransferMessage ( System.TimeSpan timeout, SmbdDataTransferMessage &dataTransferMessage ) : NtStatus
timeout System.TimeSpan
dataTransferMessage SmbdDataTransferMessage Received SMBDirect data transfer message
return NtStatus

ReceiveMessage() public method

receive SMBDirect message. If the fragmented message is sent as multiple segments from server, the method will reassemble the data before return.
public ReceiveMessage ( System.TimeSpan timeout, byte &message ) : NtStatus
timeout System.TimeSpan
message byte
return NtStatus

RegisterBuffer() public method

register the memory locations indicated by the buffer with the underlying RDMA provider
public RegisterBuffer ( uint length, SmbdBufferReadWrite flag, bool reversed, SmbdBufferDescriptorV1 &descriptor ) : NtStatus
length uint
flag SmbdBufferReadWrite Read or Write flag
reversed bool if it is true, little-endian and big-endian will be reversed in bufferDescriptor
descriptor SmbdBufferDescriptorV1 Buffer Descriptor point to registered buffer
return NtStatus

SendDataTransferMessage() public method

send SMBDirect data transfer message
public SendDataTransferMessage ( SmbdDataTransferMessage dataTransferMessage ) : NtStatus
dataTransferMessage SmbdDataTransferMessage SMBDirect data transfer message
return NtStatus

SendDataTransferMessage() public method

send SMBD data transfer message, for test case to control the transfer mannually
public SendDataTransferMessage ( ushort creditsRequested, ushort creditsGranted, SmbdDataTransfer_Flags flags, ushort reserved, uint remainingDataLength, uint dataOffset, uint dataLength, byte padding, byte buffer ) : NtStatus
creditsRequested ushort The total number of Send Credits requested /// of the receiver, including any Send Credits already granted. ///
creditsGranted ushort The incremental number of Send Credits /// granted by the sender. ///
flags SmbdDataTransfer_Flags The flags indicating how the operation is to be processed. /// This field MUST be constructed by using any or none of the following values: /// SMB_DIRECT_RESPONSE_REQUESTED. The Flags field MUST be set to zero if no flag /// values are specified. ///
reserved ushort The sender SHOULD set this field to 0 and the receiver /// MUST ignore it on receipt. ///
remainingDataLength uint The amount of data, in bytes, remaining in a /// sequence of fragmented messages. If this value is 0x00000000, this message is /// the final message in the sequence. ///
dataOffset uint The offset, in bytes, from the beginning of the SMBDirect /// header to the first byte of the message’s data payload. If no data payload /// is associated with this message, this value MUST be 0. This offset MUST /// be 8-byte aligned from the beginning of the message. ///
dataLength uint The length, in bytes, of the message’s data payload. /// If no data payload is associated with this message, this value MUST be 0. ///
padding byte Additional bytes for alignment
buffer byte
return NtStatus

SendMessage() public method

Upper layer requests that the SMBDirect Protocol sends a message. send SMBDirect message. In this function, the data will disassemble to multiple segments if the data size is greater than Connection.MaxSendSize.
public SendMessage ( byte message ) : NtStatus
message byte data to send
return NtStatus

Smaller() public static method

Return smaller one of value1 and value2
public static Smaller ( uint value1, uint value2 ) : uint
value1 uint
value2 uint
return uint

SmbdClient() public method

constructor
public SmbdClient ( SmbdLogEvent logSmbdEvent = null ) : System
logSmbdEvent SmbdLogEvent Delegate to log SMBD event
return System

SplitData2Segments() public static method

split fragmented message to multiple SMBDirect segments
public static SplitData2Segments ( byte message, uint segmentLength ) : List
message byte Input data
segmentLength uint length of each segment
return List

WriteRegisteredBuffer() public method

Write data to registered buffer
public WriteRegisteredBuffer ( byte data, SmbdBufferDescriptorV1 bufferDescriptor ) : NtStatus
data byte
bufferDescriptor SmbdBufferDescriptorV1 Buffer Descriptor point to registered buffer
return NtStatus