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

#include <session.hpp>

Public Member Functions

 Session ()
 
 Session (const SessionOptions &)
 
 ~Session ()
 
 Session (Session &&) noexcept
 
Sessionoperator= (Session &&) noexcept
 
 Session (const Session &)=delete
 
Sessionoperator= (const Session &)=delete
 
 operator bool () const noexcept
 
native_session native_handle () const noexcept
 
Result< void > try_set_options (const SessionOptions &)
 
void set_options (const SessionOptions &)
 
const SessionOptionsconfigured_options () const noexcept
 
Result< void > try_connect ()
 
void connect ()
 
void disconnect () noexcept
 
bool is_connected () const noexcept
 
int socket_fd () const noexcept
 
void request_cancel () noexcept
 
void clear_cancel () noexcept
 
bool cancel_requested () const noexcept
 
Result< std::string > try_server_banner () const
 
Result< std::string > try_client_banner () const
 
NegotiatedAlgorithms negotiated () const
 
Result< PublicKeytry_server_public_key () const
 
Result< KnownHostsStatustry_check_known_host () const
 
Result< void > try_update_known_hosts ()
 
Result< void > try_verify_host_key (const HostKeyVerifier &)
 
void verify_host_key (const HostKeyVerifier &)
 
Result< AuthMethodstry_auth_methods ()
 
Result< AuthStatustry_authenticate (const Authenticator &)
 
void authenticate (const Authenticator &)
 
Result< AuthStatustry_authenticate (std::initializer_list< const Authenticator * >)
 
bool authenticated () const noexcept
 
Result< Channeltry_open_channel ()
 
Channel open_channel ()
 
void set_log_level (LogLevel)
 

Friends

class HostKeyVerifier
 
class Channel
 

Detailed Description

The SSH client session. Owns a shared SessionCore so derived objects (Channel, ...) can never dangle. See docs/design/04 §4.3 and docs/design/02 §2.2.

Constructor & Destructor Documentation

◆ Session() [1/4]

SSHPP_INLINE sshpp::Session::Session ( )
default

◆ Session() [2/4]

SSHPP_INLINE sshpp::Session::Session ( const SessionOptions opts)
explicit

◆ ~Session()

SSHPP_INLINE sshpp::Session::~Session ( )
default

◆ Session() [3/4]

SSHPP_INLINE sshpp::Session::Session ( Session &&  )
defaultnoexcept

◆ Session() [4/4]

sshpp::Session::Session ( const Session )
delete

Member Function Documentation

◆ operator=() [1/2]

SSHPP_INLINE Session & sshpp::Session::operator= ( Session &&  )
defaultnoexcept

◆ operator=() [2/2]

Session & sshpp::Session::operator= ( const Session )
delete

◆ operator bool()

sshpp::Session::operator bool ( ) const
inlineexplicitnoexcept

◆ native_handle()

native_session sshpp::Session::native_handle ( ) const
inlinenoexcept

◆ try_set_options()

SSHPP_INLINE Result< void > sshpp::Session::try_set_options ( const SessionOptions opts)

◆ set_options()

SSHPP_INLINE void sshpp::Session::set_options ( const SessionOptions opts)

◆ configured_options()

const SessionOptions & sshpp::Session::configured_options ( ) const
inlinenoexcept

◆ try_connect()

SSHPP_INLINE Result< void > sshpp::Session::try_connect ( )

◆ connect()

SSHPP_INLINE void sshpp::Session::connect ( )

◆ disconnect()

SSHPP_INLINE void sshpp::Session::disconnect ( )
noexcept

◆ is_connected()

SSHPP_INLINE bool sshpp::Session::is_connected ( ) const
noexcept

◆ socket_fd()

SSHPP_INLINE int sshpp::Session::socket_fd ( ) const
noexcept

◆ request_cancel()

void sshpp::Session::request_cancel ( )
inlinenoexcept

◆ clear_cancel()

void sshpp::Session::clear_cancel ( )
inlinenoexcept

◆ cancel_requested()

bool sshpp::Session::cancel_requested ( ) const
inlinenoexcept

◆ try_server_banner()

SSHPP_INLINE Result< std::string > sshpp::Session::try_server_banner ( ) const

◆ try_client_banner()

SSHPP_INLINE Result< std::string > sshpp::Session::try_client_banner ( ) const

◆ negotiated()

SSHPP_INLINE NegotiatedAlgorithms sshpp::Session::negotiated ( ) const

◆ try_server_public_key()

SSHPP_INLINE Result< PublicKey > sshpp::Session::try_server_public_key ( ) const

◆ try_check_known_host()

SSHPP_INLINE Result< KnownHostsStatus > sshpp::Session::try_check_known_host ( ) const

◆ try_update_known_hosts()

SSHPP_INLINE Result< void > sshpp::Session::try_update_known_hosts ( )

◆ try_verify_host_key()

SSHPP_INLINE Result< void > sshpp::Session::try_verify_host_key ( const HostKeyVerifier verifier)

◆ verify_host_key()

SSHPP_INLINE void sshpp::Session::verify_host_key ( const HostKeyVerifier verifier)

◆ try_auth_methods()

SSHPP_INLINE Result< AuthMethods > sshpp::Session::try_auth_methods ( )

◆ try_authenticate() [1/2]

SSHPP_INLINE Result< AuthStatus > sshpp::Session::try_authenticate ( const Authenticator authenticator)

◆ authenticate()

SSHPP_INLINE void sshpp::Session::authenticate ( const Authenticator authenticator)

◆ try_authenticate() [2/2]

SSHPP_INLINE Result< AuthStatus > sshpp::Session::try_authenticate ( std::initializer_list< const Authenticator * >  chain)

◆ authenticated()

bool sshpp::Session::authenticated ( ) const
inlinenoexcept

◆ try_open_channel()

SSHPP_INLINE Result< Channel > sshpp::Session::try_open_channel ( )

◆ open_channel()

SSHPP_INLINE Channel sshpp::Session::open_channel ( )

◆ set_log_level()

SSHPP_INLINE void sshpp::Session::set_log_level ( LogLevel  level)

Friends And Related Symbol Documentation

◆ HostKeyVerifier

friend class HostKeyVerifier
friend

◆ Channel

friend class Channel
friend

The documentation for this class was generated from the following files: