Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
Toggle main menu visibility
Loading...
Searching...
No Matches
qnetworkinterface_unix_p.h
Go to the documentation of this file.
1
// Copyright (C) 2017 The Qt Company Ltd.
2
// Copyright (C) 2017 Intel Corporation.
3
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
4
// Qt-Security score:significant reason:default
5
6
#
ifndef
QNETWORKINTERFACE_UNIX_P_H
7
#
define
QNETWORKINTERFACE_UNIX_P_H
8
9
//
10
// W A R N I N G
11
// -------------
12
//
13
// This file is not part of the Qt API. It exists purely as an
14
// implementation detail. This header file may change from version to
15
// version without notice, or even be removed.
16
//
17
// We mean it.
18
//
19
20
#
include
"qnetworkinterface_p.h"
21
#
include
"private/qnet_unix_p.h"
22
23
#
ifndef
QT_NO_NETWORKINTERFACE
24
25
#
define
IP_MULTICAST
// make AIX happy and define IFF_MULTICAST
26
27
#
include
<
sys
/
types
.
h
>
28
#
include
<
sys
/
socket
.
h
>
29
#
ifdef
Q_OS_SOLARIS
30
#
include
<
sys
/
sockio
.
h
>
31
#
endif
32
#
ifdef
Q_OS_HAIKU
33
#
include
<
sys
/
sockio
.
h
>
34
#
define
IFF_RUNNING
0x0001
35
#
endif
36
#
if
QT_CONFIG
(
linux_netlink
)
37
// Same as net/if.h but contains other things we need in
38
// qnetworkinterface_linux.cpp.
39
#
include
<
linux
/
if
.
h
>
40
#
else
41
#
include
<
net
/
if
.
h
>
42
#
endif
43
44
QT_BEGIN_NAMESPACE
45
46
static
QNetworkInterface::InterfaceFlags convertFlags(uint rawFlags)
47
{
48
QNetworkInterface::InterfaceFlags flags;
49
flags |= (rawFlags & IFF_UP) ? QNetworkInterface::IsUp : QNetworkInterface::InterfaceFlag(0);
50
flags |= (rawFlags & IFF_RUNNING) ? QNetworkInterface::IsRunning : QNetworkInterface::InterfaceFlag(0);
51
flags |= (rawFlags & IFF_BROADCAST) ? QNetworkInterface::CanBroadcast : QNetworkInterface::InterfaceFlag(0);
52
flags |= (rawFlags & IFF_LOOPBACK) ? QNetworkInterface::IsLoopBack : QNetworkInterface::InterfaceFlag(0);
53
#
ifdef
IFF_POINTOPOINT
//cygwin doesn't define IFF_POINTOPOINT
54
flags |= (rawFlags & IFF_POINTOPOINT) ? QNetworkInterface::IsPointToPoint : QNetworkInterface::InterfaceFlag(0);
55
#
endif
56
57
#
ifdef
IFF_MULTICAST
58
flags |= (rawFlags & IFF_MULTICAST) ? QNetworkInterface::CanMulticast : QNetworkInterface::InterfaceFlag(0);
59
#
endif
60
return
flags;
61
}
62
63
QT_END_NAMESPACE
64
65
#
endif
// QT_NO_NETWORKINTERFACE
66
67
#
endif
// QNETWORKINTERFACE_UNIX_P_H
QByteArray::FromBase64Result
\inmodule QtCore
Definition
qbytearray.h:824
QNetworkAddressEntry
The QNetworkAddressEntry class stores one IP address supported by a network interface,...
Definition
qnetworkinterface.h:25
QNetworkInterfaceManager
Definition
qnetworkinterface_p.h:89
QNetworkInterfacePrivate
Definition
qnetworkinterface_p.h:47
QNetworkInterfacePrivate::mtu
int mtu
Definition
qnetworkinterface_p.h:55
QNetworkInterfacePrivate::index
int index
Definition
qnetworkinterface_p.h:54
std
[33]
Definition
src_corelib_tools_qhash.cpp:421
AF_INET6
#define AF_INET6
Definition
qnativesocketengine_win.cpp:111
ARPHRD_PHONET
#define ARPHRD_PHONET
Definition
qnetworkinterface_linux.cpp:26
ARPHRD_PHONET_PIPE
#define ARPHRD_PHONET_PIPE
Definition
qnetworkinterface_linux.cpp:27
getAddresses
static void getAddresses(int sock, char *buf, QList< QNetworkInterfacePrivate * > &result)
Definition
qnetworkinterface_linux.cpp:272
probeIfType
static QNetworkInterface::InterfaceType probeIfType(int socket, struct ifreq *req, short arptype)
Definition
qnetworkinterface_linux.cpp:37
ARPHRD_IEEE802154
#define ARPHRD_IEEE802154
Definition
qnetworkinterface_linux.cpp:28
ARPHRD_6LOWPAN
#define ARPHRD_6LOWPAN
Definition
qnetworkinterface_linux.cpp:29
getInterfaces
static QList< QNetworkInterfacePrivate * > getInterfaces(int sock, char *buf)
Definition
qnetworkinterface_linux.cpp:204
qtbase
src
network
kernel
qnetworkinterface_unix_p.h
Generated on
for Qt by
1.18.0