libsshpp v0.1.7
Modern C++17 wrapper for libssh
Loading...
Searching...
No Matches
sshpp::scp Namespace Reference

Classes

struct  Progress
 
class  Reader
 Pull side of an SCP transfer: scp -f as seen by the client. More...
 
struct  Request
 
class  Writer
 Push side of an SCP transfer: scp -t as seen by the client. More...
 

Typedefs

using ProgressCallback = std::function< bool(const Progress &)>
 Return false to abort the transfer (yields errc::cancelled).
 

Enumerations

enum class  Mode { read , write , read_recursive , write_recursive }
 
enum class  RequestType {
  new_file , new_directory , end_directory , eof ,
  warning
}
 

Functions

SSHPP_INLINE Result< std::uint64_t > try_download (Session &session, const RemotePath &remote, const std::filesystem::path &local, ProgressCallback progress)
 
SSHPP_INLINE Result< std::uint64_t > try_upload (Session &session, const std::filesystem::path &local, const RemotePath &remote, ProgressCallback progress)
 

Typedef Documentation

◆ ProgressCallback

using sshpp::scp::ProgressCallback = typedef std::function<bool(const Progress&)>

Return false to abort the transfer (yields errc::cancelled).

Enumeration Type Documentation

◆ Mode

enum class sshpp::scp::Mode
strong
Enumerator
read 
write 
read_recursive 
write_recursive 

◆ RequestType

enum class sshpp::scp::RequestType
strong
Enumerator
new_file 
new_directory 
end_directory 
eof 
warning 

Function Documentation

◆ try_download()

SSHPP_API Result< std::uint64_t > sshpp::scp::try_download ( Session ,
const RemotePath ,
const std::filesystem::path &  ,
ProgressCallback  = {} 
)

Layer-4 one-liners with the same name-validation hardening as the SFTP tree helpers (cf. CVE-2019-6111: a malicious server sending unexpected filenames).

◆ try_upload()

SSHPP_API Result< std::uint64_t > sshpp::scp::try_upload ( Session session,
const std::filesystem::path &  local,
const RemotePath remote,
ProgressCallback  progress 
)