/// <summary> /// decode the batched request packet /// </summary> /// <param name="channel">the channel of bytes to read</param> /// <param name="smbBatchedRequest">the batched request</param> /// <returns>the consumed length of batched response packet</returns> protected virtual int DecodeBatchedRequest( Channel channel, SmbBatchedRequestPacket smbBatchedRequest) { int batchedConsumedLength = 0; batchedConsumedLength += smbBatchedRequest.ReadAndxFromChannel(channel); return(batchedConsumedLength); }
/// <summary> /// to read the andx packet from the channel /// </summary> /// <param name="channel">the channel started with the SmbParameters of the andx.</param> /// <returns>the size in bytes of the SmbParameters, SmbData and andx if existed of the andx.</returns> internal int ReadAndxFromChannel(Channel channel) { int consumedLen = 0; if (this.AndxCommand != SmbCommand.SMB_COM_NO_ANDX_COMMAND) { SmbHeader andxHeader = this.SmbHeader; andxHeader.Protocol = CifsMessageUtils.SMB_PROTOCOL_ANDXPACKET; andxHeader.Command = this.AndxCommand; this.andxPacket = CifsMessageUtils.CreateSmbRequestPacket(andxHeader, channel); this.andxPacket.SmbHeader = andxHeader; consumedLen += this.andxPacket.ReadParametersFromChannel(channel); consumedLen += this.andxPacket.ReadDataFromChannel(channel); SmbBatchedRequestPacket batchedRequest = this.andxPacket as SmbBatchedRequestPacket; if (batchedRequest != null) { consumedLen += batchedRequest.ReadAndxFromChannel(channel); } } return(consumedLen); }
/// <summary> /// decode the batched request packet /// </summary> /// <param name="channel">the channel of bytes to read</param> /// <param name="smbBatchedRequest">the batched request</param> /// <returns>the consumed length of batched response packet</returns> protected virtual int DecodeBatchedRequest( Channel channel, SmbBatchedRequestPacket smbBatchedRequest) { int batchedConsumedLength = 0; batchedConsumedLength += smbBatchedRequest.ReadAndxFromChannel(channel); return batchedConsumedLength; }