1 /**************************************************************************
3 ** This file is part of Qt Creator
5 ** Copyright (c) 2011 Nokia Corporation and/or its subsidiary(-ies).
7 ** Contact: Nokia Corporation (qt-info@nokia.com)
11 ** This file contains pre-release code and may not be distributed.
12 ** You may use this file in accordance with the terms and conditions
13 ** contained in the Technology Preview License Agreement accompanying
16 ** GNU Lesser General Public License Usage
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.
25 ** In addition, as a special exception, Nokia gives you certain additional
26 ** rights. These rights are described in the Nokia Qt LGPL Exception
27 ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
29 ** If you have questions regarding the use of this file, please contact
30 ** Nokia at qt-info@nokia.com.
32 **************************************************************************/
34 #ifndef SFTPPACKET_P_H
35 #define SFTPPACKET_P_H
37 #include <QtCore/QByteArray>
38 #include <QtCore/QList>
39 #include <QtCore/QString>
54 SSH_FXP_FSETSTAT = 10,
60 SSH_FXP_REALPATH = 16,
63 SSH_FXP_READLINK = 19,
64 SSH_FXP_SYMLINK = 20, // Removed from later protocol versions. Try not to use.
72 SSH_FXP_EXTENDED = 200,
73 SSH_FXP_EXTENDED_REPLY = 201
79 SSH_FX_NO_SUCH_FILE = 2,
80 SSH_FX_PERMISSION_DENIED = 3,
82 SSH_FX_BAD_MESSAGE = 5,
83 SSH_FX_NO_CONNECTION = 6,
84 SSH_FX_CONNECTION_LOST = 7,
85 SSH_FX_OP_UNSUPPORTED = 8
88 class AbstractSftpPacket
92 quint32 requestId() const;
93 const QByteArray &rawData() const { return m_data; }
94 SftpPacketType type() const { return static_cast<SftpPacketType>(m_data.at(TypeOffset)); }
96 static const quint32 MaxDataSize; // "Pure" data size per read/writepacket.
97 static const quint32 MaxPacketSize;
100 quint32 dataSize() const { return static_cast<quint32>(m_data.size()); }
102 static const int TypeOffset;
103 static const int RequestIdOffset;
104 static const int PayloadOffset;
109 } // namespace Internal
112 #endif // SFTPPACKET_P_H