Rabbit Remote Control 0.1.0-bate10
Loading...
Searching...
No Matches
Classes | Public Slots | Public Member Functions | Protected Member Functions | Private Slots | Private Member Functions | Static Private Member Functions | Private Attributes | List of all members
CBackendSftpServer Class Reference

The CBackendSftpServer class. More...

#include <BackendSftpServer.h>

Inheritance diagram for CBackendSftpServer:
Inheritance graph
[legend]
Collaboration diagram for CBackendSftpServer:
Collaboration graph
[legend]

Classes

struct  sBindData
 
struct  sClientData
 

Public Slots

virtual void slotDisconnect (const QString &szIp, const quint16 port) override
 
- Public Slots inherited from CBackendServer
virtual void slotDisconnect (const QString &szIp, const quint16 port)=0
 Disconnect client.
 

Public Member Functions

 CBackendSftpServer (COperateSftpServer *pOperate=nullptr, bool bStopSignal=true)
 
- Public Member Functions inherited from CBackendServer
 CBackendServer (COperateServer *pOperate=nullptr, bool bStopSignal=true)
 
- Public Member Functions inherited from CBackend
 CBackend (COperate *pOperate=nullptr, bool bStopSignal=true)
 CBackend.
 
virtual int Start ()
 Start.
 
virtual int Stop ()
 Stop.
 

Protected Member Functions

virtual OnInitReturnValue OnInit () override
 Initialization.
 
virtual int OnClean () override
 Clean.
 
virtual int OnProcess () override
 Specific operation processing of plug-in.
 
virtual int WakeUp () override
 Wake up backend thread(background thread).
 

Private Slots

void slotNewConnection ()
 

Private Member Functions

int Listen (const QString &szIp, qint16 nPort)
 
ssh_bind GetSshBind (QSocketNotifier *notifier)
 
bool InitHostKey (ssh_bind ssdBind)
 
int DeleteClient (sClientData *pClient)
 

Static Private Member Functions

static int cbAuthPassword (ssh_session session, const char *user, const char *pass, void *userdata)
 
static int cbAuthPublickey (ssh_session session, const char *user, struct ssh_key_struct *pubkey, char signature_state, void *userdata)
 
static ssh_channel cbChannelOpen (ssh_session session, void *userdata)
 
static void SendBanner (sClientData *pClient, const QString &user)
 

Private Attributes

CParameterSftpServerm_pPara
 
ssh_event m_event
 
QList< sBindData * > m_lstListen
 
QList< sClientData * > m_lstClients
 

Additional Inherited Members

- Signals inherited from CBackendServer
void sigConnected (const QString &szIp, const quint16 port)
 emit when new client connected
 
void sigDisconnected (const QString &szIp, const quint16 port)
 emit when the client disconnected
 
- Signals inherited from CBackend
void sigRunning ()
 Emitted when the plugin is successfully started.
 
void sigStop ()
 Notify the user to stop.
 
void sigFinished ()
 Successful stopped signal.
 
void sigError (const int nError, const QString &szError=QString())
 Triggered when an error is generated.
 
void sigInformation (const QString &szInfo)
 Triggering from a background thread displays information in the main thread without blocking the background thread.
 
void sigShowMessageBox (const QString &szTitle, const QString &szMessage, const QMessageBox::Icon &icon=QMessageBox::Information)
 Trigger the display of a message dialog (QMessageBox) in the main thread from a background thread without blocking the background thread.
 
void sigBlockShowMessageBox (const QString &szTitle, const QString &szMessage, QMessageBox::StandardButtons buttons, QMessageBox::StandardButton &nRet, bool &checkBox, QString checkBoxContext=QString())
 Block background threads and display message dialogs in foreground threads (QMessageBox)
 
void sigBlockInputDialog (const QString &szTitle, const QString &szLable, const QString &szMessage, QString &szText)
 Block background threads and display input dialogs in foreground threads (QInputDialog)
 
void sigBlockShowWidget (const QString &className, int &nRet, void *pContext)
 Blocks the background thread and displays the window in the foreground thread.
 
void sigSecurityLevel (CSecurityLevel::Levels level)
 Triggered when the security level changes.
 
- Protected Types inherited from CBackend
enum class  OnInitReturnValue { Fail = -1 , Success = 0 , UseOnProcess = Success , NotUseOnProcess = 1 }
 
- Protected Slots inherited from CBackend
virtual void slotTimeOut ()
 a non-Qt event loop (that is, normal loop processing), It call OnProcess(), and start timer.
 

Detailed Description

The CBackendSftpServer class.

Definition at line 18 of file BackendSftpServer.h.

Constructor & Destructor Documentation

◆ CBackendSftpServer()

CBackendSftpServer::CBackendSftpServer ( COperateSftpServer pOperate = nullptr,
bool  bStopSignal = true 
)
explicit

Definition at line 86 of file BackendSftpServer.cpp.

◆ ~CBackendSftpServer()

CBackendSftpServer::~CBackendSftpServer ( )
virtual

Definition at line 94 of file BackendSftpServer.cpp.

Member Function Documentation

◆ cbAuthPassword()

int CBackendSftpServer::cbAuthPassword ( ssh_session  session,
const char *  user,
const char *  pass,
void *  userdata 
)
staticprivate

Definition at line 436 of file BackendSftpServer.cpp.

◆ cbAuthPublickey()

int CBackendSftpServer::cbAuthPublickey ( ssh_session  session,
const char *  user,
struct ssh_key_struct *  pubkey,
char  signature_state,
void *  userdata 
)
staticprivate

Definition at line 456 of file BackendSftpServer.cpp.

◆ cbChannelOpen()

ssh_channel CBackendSftpServer::cbChannelOpen ( ssh_session  session,
void *  userdata 
)
staticprivate

Definition at line 508 of file BackendSftpServer.cpp.

◆ DeleteClient()

int CBackendSftpServer::DeleteClient ( sClientData pClient)
private

Definition at line 521 of file BackendSftpServer.cpp.

◆ GetSshBind()

ssh_bind CBackendSftpServer::GetSshBind ( QSocketNotifier *  notifier)
private

Definition at line 312 of file BackendSftpServer.cpp.

◆ InitHostKey()

bool CBackendSftpServer::InitHostKey ( ssh_bind  ssdBind)
private

Definition at line 245 of file BackendSftpServer.cpp.

◆ Listen()

int CBackendSftpServer::Listen ( const QString &  szIp,
qint16  nPort 
)
private

Definition at line 268 of file BackendSftpServer.cpp.

◆ OnClean()

int CBackendSftpServer::OnClean ( )
overrideprotectedvirtual

Clean.

See also
Stop()

Implements CBackend.

Definition at line 139 of file BackendSftpServer.cpp.

◆ OnInit()

CBackend::OnInitReturnValue CBackendSftpServer::OnInit ( )
overrideprotectedvirtual

Initialization.

Returns
CBackend::OnInitReturnValue
  • OnInitReturnValue::Fail: error
  • OnInitReturnValue::Success/OnInitReturnValueUseOnProcess: Use OnProcess() (non-Qt event loop)
  • OnInitReturnValue::NotUseOnProcess: Don't use OnProcess() (qt event loop)
See also
Start()

Implements CBackend.

Definition at line 99 of file BackendSftpServer.cpp.

◆ OnProcess()

int CBackendSftpServer::OnProcess ( )
overrideprotectedvirtual

Specific operation processing of plug-in.

Returns
  • >= 0: continue, Interval call time (msec)
  • = -1: stop
  • < -1: error code
See also
Start() slotTimeOut()

Reimplemented from CBackend.

Definition at line 184 of file BackendSftpServer.cpp.

◆ SendBanner()

void CBackendSftpServer::SendBanner ( sClientData pClient,
const QString &  user 
)
staticprivate

Definition at line 547 of file BackendSftpServer.cpp.

◆ slotDisconnect

void CBackendSftpServer::slotDisconnect ( const QString &  szIp,
const quint16  port 
)
overridevirtualslot

Definition at line 562 of file BackendSftpServer.cpp.

◆ slotNewConnection

void CBackendSftpServer::slotNewConnection ( )
privateslot

Definition at line 321 of file BackendSftpServer.cpp.

◆ WakeUp()

int CBackendSftpServer::WakeUp ( )
overrideprotectedvirtual

Wake up backend thread(background thread).

When it is block(a non-Qt event loop)

Note
The caller is main thread(UI thread)

Reimplemented from CBackend.

Definition at line 163 of file BackendSftpServer.cpp.

Member Data Documentation

◆ m_event

ssh_event CBackendSftpServer::m_event
private

Definition at line 41 of file BackendSftpServer.h.

◆ m_lstClients

QList<sClientData*> CBackendSftpServer::m_lstClients
private

Definition at line 61 of file BackendSftpServer.h.

◆ m_lstListen

QList<sBindData*> CBackendSftpServer::m_lstListen
private

Definition at line 47 of file BackendSftpServer.h.

◆ m_pPara

CParameterSftpServer* CBackendSftpServer::m_pPara
private

Definition at line 40 of file BackendSftpServer.h.


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