Qt
Internal/Contributor docs for the Qt SDK. <b>Note:</b> These are NOT official API docs; those are found <a href='https://doc.qt.io/'>here</a>.
Loading...
Searching...
No Matches
qnetworkinterface_p.h
Go to the documentation of this file.
1// Copyright (C) 2016 The Qt Company Ltd.
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 QNETWORKINTERFACEPRIVATE_H
5#define QNETWORKINTERFACEPRIVATE_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 purely as an
12// implementation detail. This header file may change from version to
13// version without notice, or even be removed.
14//
15// We mean it.
16//
17
18#include <QtNetwork/private/qtnetworkglobal_p.h>
19#include <QtNetwork/qnetworkinterface.h>
20#include <QtCore/qatomic.h>
21#include <QtCore/qdeadlinetimer.h>
22#include <QtCore/qlist.h>
23#include <QtCore/qstring.h>
24#include <QtNetwork/qhostaddress.h>
25#include <QtNetwork/qabstractsocket.h>
26#include <private/qhostaddress_p.h>
27
28#ifndef QT_NO_NETWORKINTERFACE
29
31
44
46{
47public:
52
53 int index; // interface index, if know
54 int mtu = 0;
55 QNetworkInterface::InterfaceFlags flags;
57
61
62 QList<QNetworkAddressEntry> addressEntries;
63
64 static QString makeHwAddress(int len, uchar *data);
65 static void calculateDnsEligibility(QNetworkAddressEntry *entry, bool isTemporary,
66 bool isDeprecated)
67 {
68 // this implements an algorithm that yields the same results as Windows
69 // produces, for the same input (as far as I can test)
70 if (isTemporary || isDeprecated) {
72 } else {
74 if (cl == LoopbackAddress || cl == LinkLocalAddress)
76 else
77 entry->setDnsEligibility(QNetworkAddressEntry::DnsEligible);
78 }
79 }
80
81private:
82 // disallow copying -- avoid detaching
85};
86
88{
89public:
92
93 QSharedDataPointer<QNetworkInterfacePrivate> interfaceFromName(const QString &name);
94 QSharedDataPointer<QNetworkInterfacePrivate> interfaceFromIndex(int index);
95 QList<QSharedDataPointer<QNetworkInterfacePrivate> > allInterfaces();
96
99
100 // convenience:
101 QSharedDataPointer<QNetworkInterfacePrivate> empty;
102
103private:
104 QList<QNetworkInterfacePrivate *> scan();
105};
106
107
109
110#endif // QT_NO_NETWORKINTERFACE
111
112#endif
\inmodule QtCore
static constexpr ForeverConstant Forever
AddressClassification classify() const
The QHostAddress class provides an IP address.
QNetworkAddressEntry::DnsEligibilityStatus dnsEligibility
The QNetworkAddressEntry class stores one IP address supported by a network interface,...
QSharedDataPointer< QNetworkInterfacePrivate > interfaceFromName(const QString &name)
static uint interfaceIndexFromName(const QString &name)
QList< QSharedDataPointer< QNetworkInterfacePrivate > > allInterfaces()
QSharedDataPointer< QNetworkInterfacePrivate > empty
static QString interfaceNameFromIndex(uint index)
QSharedDataPointer< QNetworkInterfacePrivate > interfaceFromIndex(int index)
static QString makeHwAddress(int len, uchar *data)
QNetworkInterface::InterfaceFlags flags
static void calculateDnsEligibility(QNetworkAddressEntry *entry, bool isTemporary, bool isDeprecated)
QList< QNetworkAddressEntry > addressEntries
InterfaceType
Specifies the type of hardware (PHY layer, OSI level 1) this interface is, if it could be determined.
\inmodule QtCore
Definition qshareddata.h:19
\macro QT_RESTRICTED_CAST_FROM_ASCII
Definition qstring.h:129
Combined button and popup list for selecting options.
AddressClassification
@ LoopbackAddress
@ LinkLocalAddress
GLuint index
[2]
GLint GLsizei GLsizei GLenum GLenum GLsizei void * data
GLenum type
GLuint name
GLuint entry
GLenum GLsizei len
unsigned char uchar
Definition qtypes.h:32
unsigned int uint
Definition qtypes.h:34
QSharedPointer< T > other(t)
[5]