Rabbit Remote Control 0.0.30
Loading...
Searching...
No Matches
ChannelSSHTunnelForward.h
1// Author: Kang Lin <kl222@126.com>
2
3#ifndef CHANNELSSHTUNNELFORWARD_H
4#define CHANNELSSHTUNNELFORWARD_H
5
6#include "ChannelSSHTunnel.h"
7
23{
24 Q_OBJECT
25public:
26 explicit CChannelSSHTunnelForward(QSharedPointer<CParameterChannelSSH> parameter,
27 QObject *parent = nullptr);
29
30 // QIODevice interface
31public:
32 virtual bool open(OpenMode mode) override;
33 virtual void close() override;
34 virtual int Process();
35
36 enum class SOCKET_TYPE{
37 UnixSocket,
38 Socket
39 };
40
41Q_SIGNALS:
42 void sigServer(QString szHost, quint16 nPort);
43 void sigServer(QString szUnixDomainSocket);
44
45private:
46 socket_t m_Listen;
47 socket_t m_Connector;
48
49 SOCKET_TYPE m_SocketType;
50
51 int CloseSocket(socket_t &s);
52 int AcceptConnect();
53 int ReadConnect();
54 int SSHReadyRead();
55 int OpenSocket();
56#if defined(HAVE_UNIX_DOMAIN_SOCKET)
57 int OpenUnixSocket();
58#endif
59 char* m_pBuffer;
60 const int m_BufferLength = 1024;
61};
62
63#endif // CHANNELSSHTUNNELFORWARD_H
Includes SSH tunneling and a local socket service for forwarding data.
virtual bool open(OpenMode mode) override
ssh tunnel class