1
/**************************************************************************
2
* Copyright (C) 2005-2015 by Oleksandr Shneyder *
3
* o.shneyder@phoca-gmbh.de *
5
* This program is free software; you can redistribute it and/or modify *
6
* it under the terms of the GNU General Public License as published by *
7
* the Free Software Foundation; either version 2 of the License, or *
8
* (at your option) any later version. *
9
* This program is distributed in the hope that it will be useful, *
10
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
11
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
12
* GNU General Public License for more details. *
14
* You should have received a copy of the GNU General Public License *
15
* along with this program. If not, see <http://www.gnu.org/licenses/>. *
16
***************************************************************************/
21
#include <libssh/libssh.h>
25
#include <netinet/in.h>
28
#include "sshmasterconnection.h"
30
class SshProcess : public QObject
33
friend class SshMasterConnection;
36
SshProcess(SshMasterConnection* master, int pid);
39
void startNormal(const QString& cmd);
40
void startTunnel(const QString& forwardHost, uint forwardPort, const QString& localHost,
41
uint localPort, bool reverse=false);
42
void start_cp(QString src, QString dst);
50
void addPuttyReg(QString host, QString uuidStr);
51
void rmPuttyReg(QString uuidStr);
55
SshMasterConnection* masterCon;
56
SshMasterConnection* tunnelConnection;
65
struct sockaddr_in address;
76
//only to use with krb (until no GSSAPI support in libssh)
83
void slotCheckNewConnection();
84
void slotStdErr(SshProcess* creator, QByteArray data);
85
void slotStdOut(SshProcess* creator, QByteArray data);
86
void slotIOerr(SshProcess* creator,QString message, QString sshSessionErr);
87
void slotChannelClosed(SshProcess* creator, QString uuid);
88
void slotReverseTunnelOk(SshProcess* creator);
89
void slotReverseTunnelFailed(SshProcess* creator, QString error);
90
void slotCopyOk(SshProcess* creator);
91
void slotCopyErr(SshProcess* creator,QString message, QString sshSessionErr);
93
void slotSshProcFinished( int exitCode, QProcess::ExitStatus exitStatus);
94
void slotSshProcStdErr();
95
void slotSshProcStdOut();
97
void sshFinished ( bool result, QString output, int processId);
98
void sshTunnelOk(int processId);
101
#endif // SSHPROCESS_H