mirror of
https://github.com/sshnet/SSH.NET.git
synced 2026-09-11 01:36:39 +00:00
Add some SFTP messages for future support
This commit is contained in:
@@ -645,6 +645,9 @@
|
||||
<Compile Include="..\Renci.SshNet\Sftp\Requests\ExtendedRequests\StatVfsRequest.cs">
|
||||
<Link>Sftp\Requests\ExtendedRequests\StatVfsRequest.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="..\Renci.SshNet\Sftp\Requests\SftpBlockRequest.cs">
|
||||
<Link>Sftp\Requests\SftpBlockRequest.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="..\Renci.SshNet\Sftp\Requests\SftpCloseRequest.cs">
|
||||
<Link>Sftp\Requests\SftpCloseRequest.cs</Link>
|
||||
</Compile>
|
||||
@@ -660,6 +663,9 @@
|
||||
<Compile Include="..\Renci.SshNet\Sftp\Requests\SftpInitRequest.cs">
|
||||
<Link>Sftp\Requests\SftpInitRequest.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="..\Renci.SshNet\Sftp\Requests\SftpLinkRequest.cs">
|
||||
<Link>Sftp\Requests\SftpLinkRequest.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="..\Renci.SshNet\Sftp\Requests\SftpLStatRequest.cs">
|
||||
<Link>Sftp\Requests\SftpLStatRequest.cs</Link>
|
||||
</Compile>
|
||||
@@ -705,6 +711,9 @@
|
||||
<Compile Include="..\Renci.SshNet\Sftp\Requests\SftpSymLinkRequest.cs">
|
||||
<Link>Sftp\Requests\SftpSymLinkRequest.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="..\Renci.SshNet\Sftp\Requests\SftpUnblockRequest.cs">
|
||||
<Link>Sftp\Requests\SftpUnblockRequest.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="..\Renci.SshNet\Sftp\Requests\SftpWriteRequest.cs">
|
||||
<Link>Sftp\Requests\SftpWriteRequest.cs</Link>
|
||||
</Compile>
|
||||
|
||||
@@ -612,6 +612,9 @@
|
||||
<Compile Include="..\Renci.SshNet\Sftp\Requests\ExtendedRequests\StatVfsRequest.cs">
|
||||
<Link>Sftp\Requests\ExtendedRequests\StatVfsRequest.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="..\Renci.SshNet\Sftp\Requests\SftpBlockRequest.cs">
|
||||
<Link>Sftp\Requests\SftpBlockRequest.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="..\Renci.SshNet\Sftp\Requests\SftpCloseRequest.cs">
|
||||
<Link>Sftp\Requests\SftpCloseRequest.cs</Link>
|
||||
</Compile>
|
||||
@@ -627,6 +630,9 @@
|
||||
<Compile Include="..\Renci.SshNet\Sftp\Requests\SftpInitRequest.cs">
|
||||
<Link>Sftp\Requests\SftpInitRequest.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="..\Renci.SshNet\Sftp\Requests\SftpLinkRequest.cs">
|
||||
<Link>Sftp\Requests\SftpLinkRequest.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="..\Renci.SshNet\Sftp\Requests\SftpLStatRequest.cs">
|
||||
<Link>Sftp\Requests\SftpLStatRequest.cs</Link>
|
||||
</Compile>
|
||||
@@ -672,6 +678,9 @@
|
||||
<Compile Include="..\Renci.SshNet\Sftp\Requests\SftpSymLinkRequest.cs">
|
||||
<Link>Sftp\Requests\SftpSymLinkRequest.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="..\Renci.SshNet\Sftp\Requests\SftpUnblockRequest.cs">
|
||||
<Link>Sftp\Requests\SftpUnblockRequest.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="..\Renci.SshNet\Sftp\Requests\SftpWriteRequest.cs">
|
||||
<Link>Sftp\Requests\SftpWriteRequest.cs</Link>
|
||||
</Compile>
|
||||
|
||||
@@ -618,6 +618,9 @@
|
||||
<Compile Include="..\Renci.SshNet\Sftp\Requests\ExtendedRequests\StatVfsRequest.cs">
|
||||
<Link>Sftp\Requests\ExtendedRequests\StatVfsRequest.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="..\Renci.SshNet\Sftp\Requests\SftpBlockRequest.cs">
|
||||
<Link>Sftp\Requests\SftpBlockRequest.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="..\Renci.SshNet\Sftp\Requests\SftpCloseRequest.cs">
|
||||
<Link>Sftp\Requests\SftpCloseRequest.cs</Link>
|
||||
</Compile>
|
||||
@@ -633,6 +636,9 @@
|
||||
<Compile Include="..\Renci.SshNet\Sftp\Requests\SftpInitRequest.cs">
|
||||
<Link>Sftp\Requests\SftpInitRequest.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="..\Renci.SshNet\Sftp\Requests\SftpLinkRequest.cs">
|
||||
<Link>Sftp\Requests\SftpLinkRequest.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="..\Renci.SshNet\Sftp\Requests\SftpLStatRequest.cs">
|
||||
<Link>Sftp\Requests\SftpLStatRequest.cs</Link>
|
||||
</Compile>
|
||||
@@ -678,6 +684,9 @@
|
||||
<Compile Include="..\Renci.SshNet\Sftp\Requests\SftpSymLinkRequest.cs">
|
||||
<Link>Sftp\Requests\SftpSymLinkRequest.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="..\Renci.SshNet\Sftp\Requests\SftpUnblockRequest.cs">
|
||||
<Link>Sftp\Requests\SftpUnblockRequest.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="..\Renci.SshNet\Sftp\Requests\SftpWriteRequest.cs">
|
||||
<Link>Sftp\Requests\SftpWriteRequest.cs</Link>
|
||||
</Compile>
|
||||
|
||||
@@ -616,6 +616,9 @@
|
||||
<Compile Include="..\Renci.SshNet\Sftp\Requests\ExtendedRequests\StatVfsRequest.cs">
|
||||
<Link>Sftp\Requests\ExtendedRequests\StatVfsRequest.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="..\Renci.SshNet\Sftp\Requests\SftpBlockRequest.cs">
|
||||
<Link>Sftp\Requests\SftpBlockRequest.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="..\Renci.SshNet\Sftp\Requests\SftpCloseRequest.cs">
|
||||
<Link>Sftp\Requests\SftpCloseRequest.cs</Link>
|
||||
</Compile>
|
||||
@@ -631,6 +634,9 @@
|
||||
<Compile Include="..\Renci.SshNet\Sftp\Requests\SftpInitRequest.cs">
|
||||
<Link>Sftp\Requests\SftpInitRequest.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="..\Renci.SshNet\Sftp\Requests\SftpLinkRequest.cs">
|
||||
<Link>Sftp\Requests\SftpLinkRequest.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="..\Renci.SshNet\Sftp\Requests\SftpLStatRequest.cs">
|
||||
<Link>Sftp\Requests\SftpLStatRequest.cs</Link>
|
||||
</Compile>
|
||||
@@ -676,6 +682,9 @@
|
||||
<Compile Include="..\Renci.SshNet\Sftp\Requests\SftpSymLinkRequest.cs">
|
||||
<Link>Sftp\Requests\SftpSymLinkRequest.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="..\Renci.SshNet\Sftp\Requests\SftpUnblockRequest.cs">
|
||||
<Link>Sftp\Requests\SftpUnblockRequest.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="..\Renci.SshNet\Sftp\Requests\SftpWriteRequest.cs">
|
||||
<Link>Sftp\Requests\SftpWriteRequest.cs</Link>
|
||||
</Compile>
|
||||
|
||||
@@ -659,6 +659,9 @@
|
||||
<Compile Include="..\Renci.SshNet\Sftp\Requests\ExtendedRequests\StatVfsRequest.cs">
|
||||
<Link>Sftp\Requests\ExtendedRequests\StatVfsRequest.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="..\Renci.SshNet\Sftp\Requests\SftpBlockRequest.cs">
|
||||
<Link>Sftp\Requests\SftpBlockRequest.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="..\Renci.SshNet\Sftp\Requests\SftpCloseRequest.cs">
|
||||
<Link>Sftp\Requests\SftpCloseRequest.cs</Link>
|
||||
</Compile>
|
||||
@@ -674,6 +677,9 @@
|
||||
<Compile Include="..\Renci.SshNet\Sftp\Requests\SftpInitRequest.cs">
|
||||
<Link>Sftp\Requests\SftpInitRequest.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="..\Renci.SshNet\Sftp\Requests\SftpLinkRequest.cs">
|
||||
<Link>Sftp\Requests\SftpLinkRequest.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="..\Renci.SshNet\Sftp\Requests\SftpLStatRequest.cs">
|
||||
<Link>Sftp\Requests\SftpLStatRequest.cs</Link>
|
||||
</Compile>
|
||||
@@ -719,6 +725,9 @@
|
||||
<Compile Include="..\Renci.SshNet\Sftp\Requests\SftpSymLinkRequest.cs">
|
||||
<Link>Sftp\Requests\SftpSymLinkRequest.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="..\Renci.SshNet\Sftp\Requests\SftpUnblockRequest.cs">
|
||||
<Link>Sftp\Requests\SftpUnblockRequest.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="..\Renci.SshNet\Sftp\Requests\SftpWriteRequest.cs">
|
||||
<Link>Sftp\Requests\SftpWriteRequest.cs</Link>
|
||||
</Compile>
|
||||
|
||||
@@ -358,6 +358,8 @@
|
||||
</Compile>
|
||||
<Compile Include="SftpClient.NET40.cs" />
|
||||
<Compile Include="Sftp\Flags.cs" />
|
||||
<Compile Include="Sftp\Requests\SftpUnblockRequest.cs" />
|
||||
<Compile Include="Sftp\Requests\SftpBlockRequest.cs" />
|
||||
<Compile Include="Sftp\Requests\SftpExtendedRequest.cs" />
|
||||
<Compile Include="Sftp\Requests\ExtendedRequests\PosixRenameRequest.cs">
|
||||
<SubType>Code</SubType>
|
||||
@@ -366,6 +368,7 @@
|
||||
<Compile Include="Sftp\Requests\SftpFSetStatRequest.cs" />
|
||||
<Compile Include="Sftp\Requests\SftpFStatRequest.cs" />
|
||||
<Compile Include="Sftp\Requests\SftpInitRequest.cs" />
|
||||
<Compile Include="Sftp\Requests\SftpLinkRequest.cs" />
|
||||
<Compile Include="Sftp\Requests\SftpLStatRequest.cs" />
|
||||
<Compile Include="Sftp\Requests\SftpMkDirRequest.cs" />
|
||||
<Compile Include="Sftp\Requests\SftpOpenDirRequest.cs" />
|
||||
|
||||
@@ -0,0 +1,51 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using Renci.SshNet.Sftp.Responses;
|
||||
|
||||
namespace Renci.SshNet.Sftp.Requests
|
||||
{
|
||||
internal class SftpBlockRequest : SftpRequest
|
||||
{
|
||||
public override SftpMessageTypes SftpMessageType
|
||||
{
|
||||
get { return SftpMessageTypes.Block; }
|
||||
}
|
||||
|
||||
public byte[] Handle { get; private set; }
|
||||
|
||||
public UInt64 Offset { get; private set; }
|
||||
|
||||
public UInt64 Length { get; private set; }
|
||||
|
||||
public UInt32 LockMask { get; private set; }
|
||||
|
||||
public SftpBlockRequest(uint protocolVersion, uint requestId, byte[] handle, UInt64 offset, UInt64 length, UInt32 lockMask, Action<SftpStatusResponse> statusAction)
|
||||
: base(protocolVersion, requestId, statusAction)
|
||||
{
|
||||
this.Handle = handle;
|
||||
this.Offset = offset;
|
||||
this.Length = length;
|
||||
this.LockMask = lockMask;
|
||||
}
|
||||
|
||||
protected override void LoadData()
|
||||
{
|
||||
base.LoadData();
|
||||
this.Handle = this.ReadBinaryString();
|
||||
this.Offset = this.ReadUInt64();
|
||||
this.Length = this.ReadUInt64();
|
||||
this.LockMask = this.ReadUInt32();
|
||||
}
|
||||
|
||||
protected override void SaveData()
|
||||
{
|
||||
base.SaveData();
|
||||
this.WriteBinaryString(this.Handle);
|
||||
this.Write(this.Offset);
|
||||
this.Write(this.Length);
|
||||
this.Write(this.LockMask);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,55 @@
|
||||
using Renci.SshNet.Sftp.Responses;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
|
||||
namespace Renci.SshNet.Sftp.Requests
|
||||
{
|
||||
internal class SftpLinkRequest : SftpRequest
|
||||
{
|
||||
public override SftpMessageTypes SftpMessageType
|
||||
{
|
||||
get { return SftpMessageTypes.Link; }
|
||||
}
|
||||
|
||||
public string NewLinkPath { get; private set; }
|
||||
|
||||
public string ExistingPath { get; private set; }
|
||||
|
||||
public bool IsSymLink { get; private set; }
|
||||
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="SftpLinkRequest" /> class.
|
||||
/// </summary>
|
||||
/// <param name="protocolVersion">The protocol version.</param>
|
||||
/// <param name="requestId">The request id.</param>
|
||||
/// <param name="newLinkPath">Specifies the path name of the new link to create.</param>
|
||||
/// <param name="existingPath">Specifies the path of a target object to which the newly created link will refer. In the case of a symbolic link, this path may not exist.</param>
|
||||
/// <param name="isSymLink">if set to <c>false</c> the link should be a hard link, or a second directory entry referring to the same file or directory object.</param>
|
||||
/// <param name="statusAction">The status action.</param>
|
||||
public SftpLinkRequest(uint protocolVersion, uint requestId, string newLinkPath, string existingPath, bool isSymLink, Action<SftpStatusResponse> statusAction)
|
||||
: base(protocolVersion, requestId, statusAction)
|
||||
{
|
||||
this.NewLinkPath = newLinkPath;
|
||||
this.ExistingPath = existingPath;
|
||||
this.IsSymLink = isSymLink;
|
||||
}
|
||||
|
||||
protected override void LoadData()
|
||||
{
|
||||
base.LoadData();
|
||||
this.NewLinkPath = this.ReadString();
|
||||
this.ExistingPath = this.ReadString();
|
||||
this.IsSymLink = this.ReadBoolean();
|
||||
}
|
||||
|
||||
protected override void SaveData()
|
||||
{
|
||||
base.SaveData();
|
||||
this.Write(this.NewLinkPath);
|
||||
this.Write(this.ExistingPath);
|
||||
this.Write(this.IsSymLink);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,47 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using Renci.SshNet.Sftp.Responses;
|
||||
|
||||
namespace Renci.SshNet.Sftp.Requests
|
||||
{
|
||||
internal class SftpUnblockRequest : SftpRequest
|
||||
{
|
||||
public override SftpMessageTypes SftpMessageType
|
||||
{
|
||||
get { return SftpMessageTypes.Block; }
|
||||
}
|
||||
|
||||
public byte[] Handle { get; private set; }
|
||||
|
||||
public UInt64 Offset { get; private set; }
|
||||
|
||||
public UInt64 Length { get; private set; }
|
||||
|
||||
public SftpUnblockRequest(uint protocolVersion, uint requestId, byte[] handle, UInt64 offset, UInt64 length, UInt32 lockMask, Action<SftpStatusResponse> statusAction)
|
||||
: base(protocolVersion, requestId, statusAction)
|
||||
{
|
||||
this.Handle = handle;
|
||||
this.Offset = offset;
|
||||
this.Length = length;
|
||||
this.SetAction(dataAction);
|
||||
}
|
||||
|
||||
protected override void LoadData()
|
||||
{
|
||||
base.LoadData();
|
||||
this.Handle = this.ReadBinaryString();
|
||||
this.Offset = this.ReadUInt64();
|
||||
this.Length = this.ReadUInt64();
|
||||
}
|
||||
|
||||
protected override void SaveData()
|
||||
{
|
||||
base.SaveData();
|
||||
this.WriteBinaryString(this.Handle);
|
||||
this.Write(this.Offset);
|
||||
this.Write(this.Length);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -83,6 +83,19 @@ namespace Renci.SshNet.Sftp
|
||||
/// SSH_FXP_SYMLINK
|
||||
/// </summary>
|
||||
SymLink = 20,
|
||||
/// <summary>
|
||||
/// SSH_FXP_LINK
|
||||
/// </summary>
|
||||
Link = 21,
|
||||
/// <summary>
|
||||
/// SSH_FXP_BLOCK
|
||||
/// </summary>
|
||||
Block = 22,
|
||||
/// <summary>
|
||||
/// SSH_FXP_UNBLOCK
|
||||
/// </summary>
|
||||
Unblock = 23,
|
||||
|
||||
/// <summary>
|
||||
/// SSH_FXP_STATUS
|
||||
/// </summary>
|
||||
|
||||
Reference in New Issue
Block a user