Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
Loading...
Searching...
No Matches
qnetworkdatagram_p.h
Go to the documentation of this file.
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// Qt-Security score:significant reason:default
4
5#ifndef QNETWORKDATAGRAM_P_H
6#define QNETWORKDATAGRAM_P_H
7
8//
9// W A R N I N G
10// -------------
11//
12// This file is not part of the Qt API. It exists for the convenience
13// of the Network Access API. This header file may change from
14// version to version without notice, or even be removed.
15//
16// We mean it.
17//
18
19#include <QtNetwork/private/qtnetworkglobal_p.h>
20#include <QtNetwork/qhostaddress.h>
21
22QT_BEGIN_NAMESPACE
23
24class QIpPacketHeader
25{
26public:
27 QIpPacketHeader(const QHostAddress &dstAddr = QHostAddress(), quint16 port = 0)
28 : destinationAddress(dstAddr), destinationPort(port)
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 = 0;
45 int hopLimit = -1;
46 int streamNumber = -1;
47 quint16 senderPort = 0;
48 quint16 destinationPort;
49 bool endOfRecord = false;
50};
51
53{
54public:
55 QNetworkDatagramPrivate(const QByteArray &data = QByteArray(),
56 const QHostAddress &dstAddr = QHostAddress(), quint16 port = 0)
58 {}
59 QNetworkDatagramPrivate(const QByteArray &data, const QIpPacketHeader &header)
61 {}
62
65};
66
67QT_END_NAMESPACE
68
69#endif // QNETWORKDATAGRAM_P_H
QNetworkDatagramPrivate(const QByteArray &data=QByteArray(), const QHostAddress &dstAddr=QHostAddress(), quint16 port=0)
QNetworkDatagramPrivate(const QByteArray &data, const QIpPacketHeader &header)
The QNetworkDatagram class provides the data and metadata of a UDP datagram.
static bool isNonMulticast(const QHostAddress &addr)