Rabbit Remote Control 0.0.30
Loading...
Searching...
No Matches
ParameterChannelSSH.cpp
1// Author: Kang Lin <kl222@126.com>
2
3#include "ParameterChannelSSH.h"
4#include "RabbitCommonTools.h"
5
6CParameterChannelSSH::CParameterChannelSSH(QObject *parent)
7 : QObject{parent},
8 m_nPort(22),
9 m_szUser(RabbitCommon::CTools::Instance()->GetCurrentUser()),
10 m_nAuthenticationMethod(SSH_AUTH_METHOD_PASSWORD|SSH_AUTH_METHOD_PUBLICKEY),
11 m_bUseSystemFile(true),
12 m_nRemotePort(0),
13 m_szSourceHost("localhost"),
14 m_nSourcePort(0)
15{}
16
17CParameterChannelSSH::CParameterChannelSSH(const CParameterChannelSSH &c)
18{
19 m_szServer = c.m_szServer;
20 m_nPort = c.m_nPort;
21 m_szUser = c.m_szUser;
22 m_szPassword = c.m_szPassword;
23
24 m_nAuthenticationMethod = c.m_nAuthenticationMethod;
25 m_szPublicKeyFile = c.m_szPublicKeyFile;
26 m_szPrivateKeyFile = c.m_szPrivateKeyFile;
27 m_szPassphrase = c.m_szPassphrase;
28
29 m_szRemoteHost = c.m_szRemoteHost;
30 m_nRemotePort = c.m_nRemotePort;
31
32 m_szSourceHost = c.m_szSourceHost;
33 m_nSourcePort = c.m_nSourcePort;
34
35 m_pcapFile = c.m_pcapFile;
36}
37
38QString CParameterChannelSSH::GetServer() const
39{
40 return m_szServer;
41}
42
43int CParameterChannelSSH::setServer(const QString &szServer)
44{
45 m_szServer = szServer;
46 return 0;
47}
48
49quint16 CParameterChannelSSH::GetPort() const
50{
51 return m_nPort;
52}
53
54int CParameterChannelSSH::setPort(const quint16 nPort)
55{
56 m_nPort = nPort;
57 return 0;
58}
59
60QString CParameterChannelSSH::GetUser() const
61{
62 return m_szUser;
63}
64
65int CParameterChannelSSH::SetUser(const QString &szUser)
66{
67 m_szUser = szUser;
68 return 0;
69}
70
71QString CParameterChannelSSH::GetPassword() const
72{
73 return m_szPassword;
74}
75
76int CParameterChannelSSH::SetPassword(const QString szPassword)
77{
78 m_szPassword = szPassword;
79 return 0;
80}
81
82int CParameterChannelSSH::GetAuthenticationMethod() const
83{
84 return m_nAuthenticationMethod;
85}
86
87int CParameterChannelSSH::SetAuthenticationMethod(int method)
88{
89 m_nAuthenticationMethod = method;
90 return 0;
91}
92
93QString CParameterChannelSSH::GetPassphrase() const
94{
95 return m_szPassphrase;
96}
97
98int CParameterChannelSSH::SetPassphrase(const QString passphrase)
99{
100 m_szPassphrase = passphrase;
101 return 0;
102}
103
104bool CParameterChannelSSH::GetUseSystemFile() const
105{
106 return m_bUseSystemFile;
107}
108
109int CParameterChannelSSH::SetUseSystemFile(bool use)
110{
111 if(m_bUseSystemFile == use)
112 return 0;
113 m_bUseSystemFile = use;
114 return 0;
115}
116
117QString CParameterChannelSSH::GetPublicKeyFile() const
118{
119 return m_szPublicKeyFile;
120}
121
122int CParameterChannelSSH::SetPublicKeyFile(const QString szFile)
123{
124 m_szPublicKeyFile = szFile;
125 return 0;
126}
127
128QString CParameterChannelSSH::GetPrivateKeyFile() const
129{
130 return m_szPrivateKeyFile;
131}
132
133int CParameterChannelSSH::SetPrivateKeyFile(const QString szFile)
134{
135 m_szPrivateKeyFile = szFile;
136 return 0;
137}
138
139QString CParameterChannelSSH::GetRemoteHost() const
140{
141 return m_szRemoteHost;
142}
143
144int CParameterChannelSSH::SetRemoteHost(const QString szHost)
145{
146 m_szRemoteHost = szHost;
147 return 0;
148}
149
150quint16 CParameterChannelSSH::GetRemotePort() const
151{
152 return m_nRemotePort;
153}
154
155int CParameterChannelSSH::SetRemotePort(const quint16 nPort)
156{
157 m_nRemotePort = nPort;
158 return 0;
159}
160
161QString CParameterChannelSSH::GetSourceHost() const
162{
163 return m_szSourceHost;
164}
165
166int CParameterChannelSSH::SetSourceHost(const QString szHost)
167{
168 m_szSourceHost = szHost;
169 return 0;
170}
171
172quint16 CParameterChannelSSH::GetSourcePort() const
173{
174 return m_nSourcePort;
175}
176
177int CParameterChannelSSH::SetSourcePort(const quint16 nPort)
178{
179 m_nSourcePort = nPort;
180 return 0;
181}
182
183QString CParameterChannelSSH::GetPcapFile() const
184{
185 return m_pcapFile;
186}
187
188int CParameterChannelSSH::SetPcapFile(const QString &szFile)
189{
190 m_pcapFile = szFile;
191 return 0;
192}