OSDN Git Service

Merge branch 'master' of scm.dev.nokia.troll.no:creator/mainline
[qt-creator-jp/qt-creator-jp.git] / src / plugins / coreplugin / ssh / sshsendfacility_p.h
1 /**************************************************************************
2 **
3 ** This file is part of Qt Creator
4 **
5 ** Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
6 **
7 ** Contact: Nokia Corporation (qt-info@nokia.com)
8 **
9 ** Commercial Usage
10 **
11 ** Licensees holding valid Qt Commercial licenses may use this file in
12 ** accordance with the Qt Commercial License Agreement provided with the
13 ** Software or, alternatively, in accordance with the terms contained in
14 ** a written agreement between you and Nokia.
15 **
16 ** GNU Lesser General Public License Usage
17 **
18 ** Alternatively, this file may be used under the terms of the GNU Lesser
19 ** General Public License version 2.1 as published by the Free Software
20 ** Foundation and appearing in the file LICENSE.LGPL included in the
21 ** packaging of this file.  Please review the following information to
22 ** ensure the GNU Lesser General Public License version 2.1 requirements
23 ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
24 **
25 ** If you are unsure which license is appropriate for your use, please
26 ** contact the sales department at http://qt.nokia.com/contact.
27 **
28 **************************************************************************/
29
30 #ifndef SSHCONNECTIONOUTSTATE_P_H
31 #define SSHCONNECTIONOUTSTATE_P_H
32
33 #include "sshcryptofacility_p.h"
34 #include "sshoutgoingpacket_p.h"
35
36 QT_BEGIN_NAMESPACE
37 class QTcpSocket;
38 QT_END_NAMESPACE
39
40
41 namespace Core {
42 namespace Internal {
43 class SshKeyExchange;
44
45 class SshSendFacility
46 {
47 public:
48     SshSendFacility(QTcpSocket *socket);
49     void reset();
50     void recreateKeys(const SshKeyExchange &keyExchange);
51     void createAuthenticationKey(const QByteArray &privKeyFileContents);
52
53     SshOutgoingPacket::Payload sendKeyExchangeInitPacket();
54     void sendKeyDhInitPacket(const Botan::BigInt &e);
55     void sendNewKeysPacket();
56     void sendDisconnectPacket(SshErrorCode reason,
57         const QByteArray &reasonString);
58     void sendMsgUnimplementedPacket(quint32 serverSeqNr);
59     void sendUserAuthServiceRequestPacket();
60     void sendUserAuthByPwdRequestPacket(const QByteArray &user,
61         const QByteArray &service, const QByteArray &pwd);
62     void sendUserAuthByKeyRequestPacket(const QByteArray &user,
63         const QByteArray &service);
64     void sendRequestFailurePacket();
65     void sendSessionPacket(quint32 channelId, quint32 windowSize,
66         quint32 maxPacketSize);
67     void sendEnvPacket(quint32 remoteChannel, const QByteArray &var,
68         const QByteArray &value);
69     void sendExecPacket(quint32 remoteChannel, const QByteArray &command);
70     void sendSftpPacket(quint32 remoteChannel);
71     void sendWindowAdjustPacket(quint32 remoteChannel, quint32 bytesToAdd);
72     void sendChannelDataPacket(quint32 remoteChannel, const QByteArray &data);
73     void sendChannelSignalPacket(quint32 remoteChannel,
74         const QByteArray &signalName);
75     void sendChannelEofPacket(quint32 remoteChannel);
76     void sendChannelClosePacket(quint32 remoteChannel);
77
78 private:
79     void sendPacket();
80
81     quint32 m_clientSeqNr;
82     SshEncryptionFacility m_encrypter;
83     QTcpSocket *m_socket;
84     SshOutgoingPacket m_outgoingPacket;
85 };
86
87 } // namespace Internal
88 } // namespace Core
89
90 #endif // SSHCONNECTIONOUTSTATE_P_H