1// Copyright (C) 2015 Intel Corporation.
2// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
3
4#ifndef QNETWORKDATAGRAM_P_H
5#define QNETWORKDATAGRAM_P_H
6
7//
8// W A R N I N G
9// -------------
10//
11// This file is not part of the Qt API. It exists for the convenience
12// of the Network Access API. This header file may change from
13// version to version without notice, or even be removed.
14//
15// We mean it.
16//
17
18#include <QtNetwork/private/qtnetworkglobal_p.h>
19#include <QtNetwork/qhostaddress.h>
20
21QT_BEGIN_NAMESPACE
22
23class QIpPacketHeader
24{
25public:
26 QIpPacketHeader(const QHostAddress &dstAddr = QHostAddress(), quint16 port = 0)
27 : destinationAddress(dstAddr), ifindex(0), hopLimit(-1), streamNumber(-1),
28 destinationPort(port), endOfRecord(false)
29 {}
30
31 void clear()
32 {
33 senderAddress.clear();
34 destinationAddress.clear();
35 ifindex = 0;
36 hopLimit = -1;
37 streamNumber = -1;
38 endOfRecord = false;
39 }
40
41 QHostAddress senderAddress;
42 QHostAddress destinationAddress;
43
44 uint ifindex;
45 int hopLimit;
46 int streamNumber;
47 quint16 senderPort;
48 quint16 destinationPort;
49 bool endOfRecord;
50};
51
52class QNetworkDatagramPrivate
53{
54public:
55 QNetworkDatagramPrivate(const QByteArray &data = QByteArray(),
56 const QHostAddress &dstAddr = QHostAddress(), quint16 port = 0)
57 : data(data), header(dstAddr, port)
58 {}
59 QNetworkDatagramPrivate(const QByteArray &data, const QIpPacketHeader &header)
60 : data(data), header(header)
61 {}
62
63 QByteArray data;
64 QIpPacketHeader header;
65};
66
67QT_END_NAMESPACE
68
69#endif // QNETWORKDATAGRAM_P_H
70

source code of qtbase/src/network/kernel/qnetworkdatagram_p.h