1// Copyright (C) 2017 Witekio.
2// Copyright (C) 2018 The Qt Company Ltd.
3// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
4// Qt-Security score:significant reason:default
5
6#ifndef QCOAPINTERNALREPLY_H
7#define QCOAPINTERNALREPLY_H
8
9#include <QtCoap/qcoapglobal.h>
10#include <QtCoap/qcoapnamespace.h>
11#include <private/qcoapinternalmessage_p.h>
12#include <QtNetwork/qhostaddress.h>
13
14//
15// W A R N I N G
16// -------------
17//
18// This file is not part of the Qt API. It exists purely as an
19// implementation detail. This header file may change from version to
20// version without notice, or even be removed.
21//
22// We mean it.
23//
24
25QT_BEGIN_NAMESPACE
26
27class QCoapInternalReplyPrivate;
28class Q_AUTOTEST_EXPORT QCoapInternalReply : public QCoapInternalMessage
29{
30 Q_OBJECT
31public:
32 explicit QCoapInternalReply(QObject *parent = nullptr);
33
34 static QCoapInternalReply *createFromFrame(const QByteArray &frame, QObject *parent = nullptr);
35 void appendData(const QByteArray &data);
36 bool hasMoreBlocksToSend() const;
37 int nextBlockToSend() const;
38
39 using QCoapInternalMessage::addOption;
40 void addOption(const QCoapOption &option) override;
41 void setSenderAddress(const QHostAddress &address);
42
43 QtCoap::ResponseCode responseCode() const;
44 QHostAddress senderAddress() const;
45
46private:
47 Q_DECLARE_PRIVATE(QCoapInternalReply)
48};
49
50class Q_AUTOTEST_EXPORT QCoapInternalReplyPrivate : public QCoapInternalMessagePrivate
51{
52public:
53 QCoapInternalReplyPrivate() = default;
54
55 QtCoap::ResponseCode responseCode = QtCoap::ResponseCode::InvalidCode;
56 QHostAddress senderAddress;
57};
58
59QT_END_NAMESPACE
60
61#endif // QCOAPINTERNALREPLY_H
62

source code of qtcoap/src/coap/qcoapinternalreply_p.h