qnetworkinterface.cpp

Absolute File Name:/home/qt/qt5_coco/qt5/qtbase/src/network/kernel/qnetworkinterface.cpp
Source codeSwitch to Preprocessed file
LineSourceCount
1/****************************************************************************-
2**-
3** Copyright (C) 2015 The Qt Company Ltd.-
4** Contact: http://www.qt.io/licensing/-
5**-
6** This file is part of the QtNetwork module of the Qt Toolkit.-
7**-
8** $QT_BEGIN_LICENSE:LGPL21$-
9** Commercial License Usage-
10** Licensees holding valid commercial Qt licenses may use this file in-
11** accordance with the commercial license agreement provided with the-
12** Software or, alternatively, in accordance with the terms contained in-
13** a written agreement between you and The Qt Company. For licensing terms-
14** and conditions see http://www.qt.io/terms-conditions. For further-
15** information use the contact form at http://www.qt.io/contact-us.-
16**-
17** GNU Lesser General Public License Usage-
18** Alternatively, this file may be used under the terms of the GNU Lesser-
19** General Public License version 2.1 or version 3 as published by the Free-
20** Software Foundation and appearing in the file LICENSE.LGPLv21 and-
21** LICENSE.LGPLv3 included in the packaging of this file. Please review the-
22** following information to ensure the GNU Lesser General Public License-
23** requirements will be met: https://www.gnu.org/licenses/lgpl.html and-
24** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.-
25**-
26** As a special exception, The Qt Company gives you certain additional-
27** rights. These rights are described in The Qt Company LGPL Exception-
28** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.-
29**-
30** $QT_END_LICENSE$-
31**-
32****************************************************************************/-
33-
34#include "qnetworkinterface.h"-
35#include "qnetworkinterface_p.h"-
36-
37#include "qdebug.h"-
38#include "qendian.h"-
39#include "private/qtools_p.h"-
40-
41#ifndef QT_NO_NETWORKINTERFACE-
42-
43QT_BEGIN_NAMESPACE-
44-
45static QList<QNetworkInterfacePrivate *> postProcess(QList<QNetworkInterfacePrivate *> list)-
46{-
47 // Some platforms report a netmask but don't report a broadcast address-
48 // Go through all available addresses and calculate the broadcast address-
49 // from the IP and the netmask-
50 //-
51 // This is an IPv4-only thing -- IPv6 has no concept of broadcasts-
52 // The math is:-
53 // broadcast = IP | ~netmask-
54-
55 QList<QNetworkInterfacePrivate *>::Iterator it = list.begin();-
56 const QList<QNetworkInterfacePrivate *>::Iterator end = list.end();-
57 for ( ; it != end; ++it) {
it != endDescription
TRUEevaluated 612 times by 20 tests
Evaluated by:
  • tst_NetworkSelfTest
  • tst_QAbstractNetworkCache
  • tst_QFtp
  • tst_QHostInfo
  • tst_QHttpNetworkConnection
  • tst_QNetworkAccessManager
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkConfiguration
  • tst_QNetworkConfigurationManager
  • tst_QNetworkDiskCache
  • tst_QNetworkInterface
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
  • tst_QNetworkSession
  • tst_QTcpServer
  • tst_QUdpSocket
  • tst_QXmlInputSource
  • tst_QXmlStream
  • tst_qnetworkaccessmanager - unknown status
  • tst_qtcpsocket - unknown status
FALSEevaluated 204 times by 20 tests
Evaluated by:
  • tst_NetworkSelfTest
  • tst_QAbstractNetworkCache
  • tst_QFtp
  • tst_QHostInfo
  • tst_QHttpNetworkConnection
  • tst_QNetworkAccessManager
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkConfiguration
  • tst_QNetworkConfigurationManager
  • tst_QNetworkDiskCache
  • tst_QNetworkInterface
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
  • tst_QNetworkSession
  • tst_QTcpServer
  • tst_QUdpSocket
  • tst_QXmlInputSource
  • tst_QXmlStream
  • tst_qnetworkaccessmanager - unknown status
  • tst_qtcpsocket - unknown status
204-612
58 QList<QNetworkAddressEntry>::Iterator addr_it = (*it)->addressEntries.begin();-
59 const QList<QNetworkAddressEntry>::Iterator addr_end = (*it)->addressEntries.end();-
60 for ( ; addr_it != addr_end; ++addr_it) {
addr_it != addr_endDescription
TRUEevaluated 1224 times by 20 tests
Evaluated by:
  • tst_NetworkSelfTest
  • tst_QAbstractNetworkCache
  • tst_QFtp
  • tst_QHostInfo
  • tst_QHttpNetworkConnection
  • tst_QNetworkAccessManager
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkConfiguration
  • tst_QNetworkConfigurationManager
  • tst_QNetworkDiskCache
  • tst_QNetworkInterface
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
  • tst_QNetworkSession
  • tst_QTcpServer
  • tst_QUdpSocket
  • tst_QXmlInputSource
  • tst_QXmlStream
  • tst_qnetworkaccessmanager - unknown status
  • tst_qtcpsocket - unknown status
FALSEevaluated 612 times by 20 tests
Evaluated by:
  • tst_NetworkSelfTest
  • tst_QAbstractNetworkCache
  • tst_QFtp
  • tst_QHostInfo
  • tst_QHttpNetworkConnection
  • tst_QNetworkAccessManager
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkConfiguration
  • tst_QNetworkConfigurationManager
  • tst_QNetworkDiskCache
  • tst_QNetworkInterface
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
  • tst_QNetworkSession
  • tst_QTcpServer
  • tst_QUdpSocket
  • tst_QXmlInputSource
  • tst_QXmlStream
  • tst_qnetworkaccessmanager - unknown status
  • tst_qtcpsocket - unknown status
612-1224
61 if (addr_it->ip().protocol() != QAbstractSocket::IPv4Protocol)
addr_it->ip()....::IPv4ProtocolDescription
TRUEevaluated 612 times by 20 tests
Evaluated by:
  • tst_NetworkSelfTest
  • tst_QAbstractNetworkCache
  • tst_QFtp
  • tst_QHostInfo
  • tst_QHttpNetworkConnection
  • tst_QNetworkAccessManager
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkConfiguration
  • tst_QNetworkConfigurationManager
  • tst_QNetworkDiskCache
  • tst_QNetworkInterface
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
  • tst_QNetworkSession
  • tst_QTcpServer
  • tst_QUdpSocket
  • tst_QXmlInputSource
  • tst_QXmlStream
  • tst_qnetworkaccessmanager - unknown status
  • tst_qtcpsocket - unknown status
FALSEevaluated 612 times by 20 tests
Evaluated by:
  • tst_NetworkSelfTest
  • tst_QAbstractNetworkCache
  • tst_QFtp
  • tst_QHostInfo
  • tst_QHttpNetworkConnection
  • tst_QNetworkAccessManager
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkConfiguration
  • tst_QNetworkConfigurationManager
  • tst_QNetworkDiskCache
  • tst_QNetworkInterface
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
  • tst_QNetworkSession
  • tst_QTcpServer
  • tst_QUdpSocket
  • tst_QXmlInputSource
  • tst_QXmlStream
  • tst_qnetworkaccessmanager - unknown status
  • tst_qtcpsocket - unknown status
612
62 continue;
executed 612 times by 20 tests: continue;
Executed by:
  • tst_NetworkSelfTest
  • tst_QAbstractNetworkCache
  • tst_QFtp
  • tst_QHostInfo
  • tst_QHttpNetworkConnection
  • tst_QNetworkAccessManager
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkConfiguration
  • tst_QNetworkConfigurationManager
  • tst_QNetworkDiskCache
  • tst_QNetworkInterface
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
  • tst_QNetworkSession
  • tst_QTcpServer
  • tst_QUdpSocket
  • tst_QXmlInputSource
  • tst_QXmlStream
  • tst_qnetworkaccessmanager - unknown status
  • tst_qtcpsocket - unknown status
612
63-
64 if (!addr_it->netmask().isNull() && addr_it->broadcast().isNull()) {
!addr_it->netmask().isNull()Description
TRUEevaluated 612 times by 20 tests
Evaluated by:
  • tst_NetworkSelfTest
  • tst_QAbstractNetworkCache
  • tst_QFtp
  • tst_QHostInfo
  • tst_QHttpNetworkConnection
  • tst_QNetworkAccessManager
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkConfiguration
  • tst_QNetworkConfigurationManager
  • tst_QNetworkDiskCache
  • tst_QNetworkInterface
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
  • tst_QNetworkSession
  • tst_QTcpServer
  • tst_QUdpSocket
  • tst_QXmlInputSource
  • tst_QXmlStream
  • tst_qnetworkaccessmanager - unknown status
  • tst_qtcpsocket - unknown status
FALSEnever evaluated
addr_it->broadcast().isNull()Description
TRUEevaluated 204 times by 20 tests
Evaluated by:
  • tst_NetworkSelfTest
  • tst_QAbstractNetworkCache
  • tst_QFtp
  • tst_QHostInfo
  • tst_QHttpNetworkConnection
  • tst_QNetworkAccessManager
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkConfiguration
  • tst_QNetworkConfigurationManager
  • tst_QNetworkDiskCache
  • tst_QNetworkInterface
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
  • tst_QNetworkSession
  • tst_QTcpServer
  • tst_QUdpSocket
  • tst_QXmlInputSource
  • tst_QXmlStream
  • tst_qnetworkaccessmanager - unknown status
  • tst_qtcpsocket - unknown status
FALSEevaluated 408 times by 20 tests
Evaluated by:
  • tst_NetworkSelfTest
  • tst_QAbstractNetworkCache
  • tst_QFtp
  • tst_QHostInfo
  • tst_QHttpNetworkConnection
  • tst_QNetworkAccessManager
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkConfiguration
  • tst_QNetworkConfigurationManager
  • tst_QNetworkDiskCache
  • tst_QNetworkInterface
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
  • tst_QNetworkSession
  • tst_QTcpServer
  • tst_QUdpSocket
  • tst_QXmlInputSource
  • tst_QXmlStream
  • tst_qnetworkaccessmanager - unknown status
  • tst_qtcpsocket - unknown status
0-612
65 QHostAddress bcast = addr_it->ip();-
66 bcast = QHostAddress(bcast.toIPv4Address() | ~addr_it->netmask().toIPv4Address());-
67 addr_it->setBroadcast(bcast);-
68 }
executed 204 times by 20 tests: end of block
Executed by:
  • tst_NetworkSelfTest
  • tst_QAbstractNetworkCache
  • tst_QFtp
  • tst_QHostInfo
  • tst_QHttpNetworkConnection
  • tst_QNetworkAccessManager
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkConfiguration
  • tst_QNetworkConfigurationManager
  • tst_QNetworkDiskCache
  • tst_QNetworkInterface
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
  • tst_QNetworkSession
  • tst_QTcpServer
  • tst_QUdpSocket
  • tst_QXmlInputSource
  • tst_QXmlStream
  • tst_qnetworkaccessmanager - unknown status
  • tst_qtcpsocket - unknown status
204
69 }
executed 612 times by 20 tests: end of block
Executed by:
  • tst_NetworkSelfTest
  • tst_QAbstractNetworkCache
  • tst_QFtp
  • tst_QHostInfo
  • tst_QHttpNetworkConnection
  • tst_QNetworkAccessManager
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkConfiguration
  • tst_QNetworkConfigurationManager
  • tst_QNetworkDiskCache
  • tst_QNetworkInterface
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
  • tst_QNetworkSession
  • tst_QTcpServer
  • tst_QUdpSocket
  • tst_QXmlInputSource
  • tst_QXmlStream
  • tst_qnetworkaccessmanager - unknown status
  • tst_qtcpsocket - unknown status
612
70 }
executed 612 times by 20 tests: end of block
Executed by:
  • tst_NetworkSelfTest
  • tst_QAbstractNetworkCache
  • tst_QFtp
  • tst_QHostInfo
  • tst_QHttpNetworkConnection
  • tst_QNetworkAccessManager
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkConfiguration
  • tst_QNetworkConfigurationManager
  • tst_QNetworkDiskCache
  • tst_QNetworkInterface
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
  • tst_QNetworkSession
  • tst_QTcpServer
  • tst_QUdpSocket
  • tst_QXmlInputSource
  • tst_QXmlStream
  • tst_qnetworkaccessmanager - unknown status
  • tst_qtcpsocket - unknown status
612
71-
72 return list;
executed 204 times by 20 tests: return list;
Executed by:
  • tst_NetworkSelfTest
  • tst_QAbstractNetworkCache
  • tst_QFtp
  • tst_QHostInfo
  • tst_QHttpNetworkConnection
  • tst_QNetworkAccessManager
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkConfiguration
  • tst_QNetworkConfigurationManager
  • tst_QNetworkDiskCache
  • tst_QNetworkInterface
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
  • tst_QNetworkSession
  • tst_QTcpServer
  • tst_QUdpSocket
  • tst_QXmlInputSource
  • tst_QXmlStream
  • tst_qnetworkaccessmanager - unknown status
  • tst_qtcpsocket - unknown status
204
73}-
74-
75Q_GLOBAL_STATIC(QNetworkInterfaceManager, manager)
executed 20 times by 20 tests: end of block
Executed by:
  • tst_networkselftest - unknown status
  • tst_qabstractnetworkcache - unknown status
  • tst_qftp - unknown status
  • tst_qhostinfo - unknown status
  • tst_qhttpnetworkconnection - unknown status
  • tst_qnetworkaccessmanager - unknown status
  • tst_qnetworkaccessmanager_and_qprogressdialog - unknown status
  • tst_qnetworkconfiguration - unknown status
  • tst_qnetworkconfigurationmanager - unknown status
  • tst_qnetworkconfigurationmanagerqappless - unknown status
  • tst_qnetworkdiskcache - unknown status
  • tst_qnetworkinterface - unknown status
  • tst_qnetworkproxyfactory - unknown status
  • tst_qnetworksession - unknown status
  • tst_qtcpserver - unknown status
  • tst_qtcpsocket - unknown status
  • tst_qudpsocket - unknown status
  • tst_qxmlinputsource - unknown status
  • tst_qxmlstream - unknown status
  • tst_spdy - unknown status
executed 20 times by 20 tests: guard.store(QtGlobalStatic::Destroyed);
Executed by:
  • tst_networkselftest - unknown status
  • tst_qabstractnetworkcache - unknown status
  • tst_qftp - unknown status
  • tst_qhostinfo - unknown status
  • tst_qhttpnetworkconnection - unknown status
  • tst_qnetworkaccessmanager - unknown status
  • tst_qnetworkaccessmanager_and_qprogressdialog - unknown status
  • tst_qnetworkconfiguration - unknown status
  • tst_qnetworkconfigurationmanager - unknown status
  • tst_qnetworkconfigurationmanagerqappless - unknown status
  • tst_qnetworkdiskcache - unknown status
  • tst_qnetworkinterface - unknown status
  • tst_qnetworkproxyfactory - unknown status
  • tst_qnetworksession - unknown status
  • tst_qtcpserver - unknown status
  • tst_qtcpsocket - unknown status
  • tst_qudpsocket - unknown status
  • tst_qxmlinputsource - unknown status
  • tst_qxmlstream - unknown status
  • tst_spdy - unknown status
executed 204 times by 20 tests: return &holder.value;
Executed by:
  • tst_NetworkSelfTest
  • tst_QAbstractNetworkCache
  • tst_QFtp
  • tst_QHostInfo
  • tst_QHttpNetworkConnection
  • tst_QNetworkAccessManager
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkConfiguration
  • tst_QNetworkConfigurationManager
  • tst_QNetworkDiskCache
  • tst_QNetworkInterface
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
  • tst_QNetworkSession
  • tst_QTcpServer
  • tst_QUdpSocket
  • tst_QXmlInputSource
  • tst_QXmlStream
  • tst_qnetworkaccessmanager - unknown status
  • tst_qtcpsocket - unknown status
guard.load() =...c::InitializedDescription
TRUEevaluated 20 times by 20 tests
Evaluated by:
  • tst_networkselftest - unknown status
  • tst_qabstractnetworkcache - unknown status
  • tst_qftp - unknown status
  • tst_qhostinfo - unknown status
  • tst_qhttpnetworkconnection - unknown status
  • tst_qnetworkaccessmanager - unknown status
  • tst_qnetworkaccessmanager_and_qprogressdialog - unknown status
  • tst_qnetworkconfiguration - unknown status
  • tst_qnetworkconfigurationmanager - unknown status
  • tst_qnetworkconfigurationmanagerqappless - unknown status
  • tst_qnetworkdiskcache - unknown status
  • tst_qnetworkinterface - unknown status
  • tst_qnetworkproxyfactory - unknown status
  • tst_qnetworksession - unknown status
  • tst_qtcpserver - unknown status
  • tst_qtcpsocket - unknown status
  • tst_qudpsocket - unknown status
  • tst_qxmlinputsource - unknown status
  • tst_qxmlstream - unknown status
  • tst_spdy - unknown status
FALSEnever evaluated
0-204
76-
77QNetworkInterfaceManager::QNetworkInterfaceManager()-
78{-
79}-
80-
81QNetworkInterfaceManager::~QNetworkInterfaceManager()-
82{-
83}-
84-
85QSharedDataPointer<QNetworkInterfacePrivate> QNetworkInterfaceManager::interfaceFromName(const QString &name)-
86{-
87 QList<QSharedDataPointer<QNetworkInterfacePrivate> > interfaceList = allInterfaces();-
88 QList<QSharedDataPointer<QNetworkInterfacePrivate> >::ConstIterator it = interfaceList.constBegin();-
89-
90 bool ok;-
91 uint index = name.toUInt(&ok);-
92-
93 for ( ; it != interfaceList.constEnd(); ++it) {
it != interfaceList.constEnd()Description
TRUEevaluated 16 times by 2 tests
Evaluated by:
  • tst_QNetworkInterface
  • tst_QNetworkSession
FALSEevaluated 1 time by 1 test
Evaluated by:
  • tst_QNetworkInterface
1-16
94 if (ok && (*it)->index == int(index))
okDescription
TRUEnever evaluated
FALSEevaluated 16 times by 2 tests
Evaluated by:
  • tst_QNetworkInterface
  • tst_QNetworkSession
(*it)->index == int(index)Description
TRUEnever evaluated
FALSEnever evaluated
0-16
95 return *it;
never executed: return *it;
0
96 else if ((*it)->name == name)
(*it)->name == nameDescription
TRUEevaluated 6 times by 2 tests
Evaluated by:
  • tst_QNetworkInterface
  • tst_QNetworkSession
FALSEevaluated 10 times by 2 tests
Evaluated by:
  • tst_QNetworkInterface
  • tst_QNetworkSession
6-10
97 return *it;
executed 6 times by 2 tests: return *it;
Executed by:
  • tst_QNetworkInterface
  • tst_QNetworkSession
6
98 }
executed 10 times by 2 tests: end of block
Executed by:
  • tst_QNetworkInterface
  • tst_QNetworkSession
10
99-
100 return empty;
executed 1 time by 1 test: return empty;
Executed by:
  • tst_QNetworkInterface
1
101}-
102-
103QSharedDataPointer<QNetworkInterfacePrivate> QNetworkInterfaceManager::interfaceFromIndex(int index)-
104{-
105 QList<QSharedDataPointer<QNetworkInterfacePrivate> > interfaceList = allInterfaces();-
106 QList<QSharedDataPointer<QNetworkInterfacePrivate> >::ConstIterator it = interfaceList.constBegin();-
107 for ( ; it != interfaceList.constEnd(); ++it)
it != interfaceList.constEnd()Description
TRUEevaluated 60 times by 16 tests
Evaluated by:
  • tst_NetworkSelfTest
  • tst_QAbstractNetworkCache
  • tst_QFtp
  • tst_QHostInfo
  • tst_QHttpNetworkConnection
  • tst_QNetworkAccessManager
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkConfiguration
  • tst_QNetworkConfigurationManager
  • tst_QNetworkDiskCache
  • tst_QNetworkInterface
  • tst_QNetworkProxyFactory
  • tst_QTcpServer
  • tst_QUdpSocket
  • tst_QXmlInputSource
  • tst_QXmlStream
FALSEevaluated 18 times by 16 tests
Evaluated by:
  • tst_NetworkSelfTest
  • tst_QAbstractNetworkCache
  • tst_QFtp
  • tst_QHostInfo
  • tst_QHttpNetworkConnection
  • tst_QNetworkAccessManager
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkConfiguration
  • tst_QNetworkConfigurationManager
  • tst_QNetworkDiskCache
  • tst_QNetworkInterface
  • tst_QNetworkProxyFactory
  • tst_QTcpServer
  • tst_QUdpSocket
  • tst_QXmlInputSource
  • tst_QXmlStream
18-60
108 if ((*it)->index == index)
(*it)->index == indexDescription
TRUEevaluated 3 times by 1 test
Evaluated by:
  • tst_QUdpSocket
FALSEevaluated 57 times by 16 tests
Evaluated by:
  • tst_NetworkSelfTest
  • tst_QAbstractNetworkCache
  • tst_QFtp
  • tst_QHostInfo
  • tst_QHttpNetworkConnection
  • tst_QNetworkAccessManager
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkConfiguration
  • tst_QNetworkConfigurationManager
  • tst_QNetworkDiskCache
  • tst_QNetworkInterface
  • tst_QNetworkProxyFactory
  • tst_QTcpServer
  • tst_QUdpSocket
  • tst_QXmlInputSource
  • tst_QXmlStream
3-57
109 return *it;
executed 3 times by 1 test: return *it;
Executed by:
  • tst_QUdpSocket
3
110-
111 return empty;
executed 18 times by 16 tests: return empty;
Executed by:
  • tst_NetworkSelfTest
  • tst_QAbstractNetworkCache
  • tst_QFtp
  • tst_QHostInfo
  • tst_QHttpNetworkConnection
  • tst_QNetworkAccessManager
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkConfiguration
  • tst_QNetworkConfigurationManager
  • tst_QNetworkDiskCache
  • tst_QNetworkInterface
  • tst_QNetworkProxyFactory
  • tst_QTcpServer
  • tst_QUdpSocket
  • tst_QXmlInputSource
  • tst_QXmlStream
18
112}-
113-
114QList<QSharedDataPointer<QNetworkInterfacePrivate> > QNetworkInterfaceManager::allInterfaces()-
115{-
116 QList<QNetworkInterfacePrivate *> list = postProcess(scan());-
117 QList<QSharedDataPointer<QNetworkInterfacePrivate> > result;-
118 result.reserve(list.size());-
119-
120 foreach (QNetworkInterfacePrivate *ptr, list)-
121 result << QSharedDataPointer<QNetworkInterfacePrivate>(ptr);
executed 612 times by 20 tests: result << QSharedDataPointer<QNetworkInterfacePrivate>(ptr);
Executed by:
  • tst_NetworkSelfTest
  • tst_QAbstractNetworkCache
  • tst_QFtp
  • tst_QHostInfo
  • tst_QHttpNetworkConnection
  • tst_QNetworkAccessManager
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkConfiguration
  • tst_QNetworkConfigurationManager
  • tst_QNetworkDiskCache
  • tst_QNetworkInterface
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
  • tst_QNetworkSession
  • tst_QTcpServer
  • tst_QUdpSocket
  • tst_QXmlInputSource
  • tst_QXmlStream
  • tst_qnetworkaccessmanager - unknown status
  • tst_qtcpsocket - unknown status
612
122-
123 return result;
executed 204 times by 20 tests: return result;
Executed by:
  • tst_NetworkSelfTest
  • tst_QAbstractNetworkCache
  • tst_QFtp
  • tst_QHostInfo
  • tst_QHttpNetworkConnection
  • tst_QNetworkAccessManager
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkConfiguration
  • tst_QNetworkConfigurationManager
  • tst_QNetworkDiskCache
  • tst_QNetworkInterface
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
  • tst_QNetworkSession
  • tst_QTcpServer
  • tst_QUdpSocket
  • tst_QXmlInputSource
  • tst_QXmlStream
  • tst_qnetworkaccessmanager - unknown status
  • tst_qtcpsocket - unknown status
204
124}-
125-
126QString QNetworkInterfacePrivate::makeHwAddress(int len, uchar *data)-
127{-
128 const int outLen = qMax(len * 2 + (len - 1) * 1, 0);-
129 QString result(outLen, Qt::Uninitialized);-
130 QChar *out = result.data();-
131 for (int i = 0; i < len; ++i) {
i < lenDescription
TRUEevaluated 3672 times by 20 tests
Evaluated by:
  • tst_NetworkSelfTest
  • tst_QAbstractNetworkCache
  • tst_QFtp
  • tst_QHostInfo
  • tst_QHttpNetworkConnection
  • tst_QNetworkAccessManager
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkConfiguration
  • tst_QNetworkConfigurationManager
  • tst_QNetworkDiskCache
  • tst_QNetworkInterface
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
  • tst_QNetworkSession
  • tst_QTcpServer
  • tst_QUdpSocket
  • tst_QXmlInputSource
  • tst_QXmlStream
  • tst_qnetworkaccessmanager - unknown status
  • tst_qtcpsocket - unknown status
FALSEevaluated 612 times by 20 tests
Evaluated by:
  • tst_NetworkSelfTest
  • tst_QAbstractNetworkCache
  • tst_QFtp
  • tst_QHostInfo
  • tst_QHttpNetworkConnection
  • tst_QNetworkAccessManager
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkConfiguration
  • tst_QNetworkConfigurationManager
  • tst_QNetworkDiskCache
  • tst_QNetworkInterface
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
  • tst_QNetworkSession
  • tst_QTcpServer
  • tst_QUdpSocket
  • tst_QXmlInputSource
  • tst_QXmlStream
  • tst_qnetworkaccessmanager - unknown status
  • tst_qtcpsocket - unknown status
612-3672
132 if (i)
iDescription
TRUEevaluated 3060 times by 20 tests
Evaluated by:
  • tst_NetworkSelfTest
  • tst_QAbstractNetworkCache
  • tst_QFtp
  • tst_QHostInfo
  • tst_QHttpNetworkConnection
  • tst_QNetworkAccessManager
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkConfiguration
  • tst_QNetworkConfigurationManager
  • tst_QNetworkDiskCache
  • tst_QNetworkInterface
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
  • tst_QNetworkSession
  • tst_QTcpServer
  • tst_QUdpSocket
  • tst_QXmlInputSource
  • tst_QXmlStream
  • tst_qnetworkaccessmanager - unknown status
  • tst_qtcpsocket - unknown status
FALSEevaluated 612 times by 20 tests
Evaluated by:
  • tst_NetworkSelfTest
  • tst_QAbstractNetworkCache
  • tst_QFtp
  • tst_QHostInfo
  • tst_QHttpNetworkConnection
  • tst_QNetworkAccessManager
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkConfiguration
  • tst_QNetworkConfigurationManager
  • tst_QNetworkDiskCache
  • tst_QNetworkInterface
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
  • tst_QNetworkSession
  • tst_QTcpServer
  • tst_QUdpSocket
  • tst_QXmlInputSource
  • tst_QXmlStream
  • tst_qnetworkaccessmanager - unknown status
  • tst_qtcpsocket - unknown status
612-3060
133 *out++ = QLatin1Char(':');
executed 3060 times by 20 tests: *out++ = QLatin1Char(':');
Executed by:
  • tst_NetworkSelfTest
  • tst_QAbstractNetworkCache
  • tst_QFtp
  • tst_QHostInfo
  • tst_QHttpNetworkConnection
  • tst_QNetworkAccessManager
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkConfiguration
  • tst_QNetworkConfigurationManager
  • tst_QNetworkDiskCache
  • tst_QNetworkInterface
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
  • tst_QNetworkSession
  • tst_QTcpServer
  • tst_QUdpSocket
  • tst_QXmlInputSource
  • tst_QXmlStream
  • tst_qnetworkaccessmanager - unknown status
  • tst_qtcpsocket - unknown status
3060
134 *out++ = QLatin1Char(QtMiscUtils::toHexUpper(data[i] / 16));-
135 *out++ = QLatin1Char(QtMiscUtils::toHexUpper(data[i] % 16));-
136 }
executed 3672 times by 20 tests: end of block
Executed by:
  • tst_NetworkSelfTest
  • tst_QAbstractNetworkCache
  • tst_QFtp
  • tst_QHostInfo
  • tst_QHttpNetworkConnection
  • tst_QNetworkAccessManager
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkConfiguration
  • tst_QNetworkConfigurationManager
  • tst_QNetworkDiskCache
  • tst_QNetworkInterface
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
  • tst_QNetworkSession
  • tst_QTcpServer
  • tst_QUdpSocket
  • tst_QXmlInputSource
  • tst_QXmlStream
  • tst_qnetworkaccessmanager - unknown status
  • tst_qtcpsocket - unknown status
3672
137 return result;
executed 612 times by 20 tests: return result;
Executed by:
  • tst_NetworkSelfTest
  • tst_QAbstractNetworkCache
  • tst_QFtp
  • tst_QHostInfo
  • tst_QHttpNetworkConnection
  • tst_QNetworkAccessManager
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkConfiguration
  • tst_QNetworkConfigurationManager
  • tst_QNetworkDiskCache
  • tst_QNetworkInterface
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
  • tst_QNetworkSession
  • tst_QTcpServer
  • tst_QUdpSocket
  • tst_QXmlInputSource
  • tst_QXmlStream
  • tst_qnetworkaccessmanager - unknown status
  • tst_qtcpsocket - unknown status
612
138}-
139-
140/*!-
141 \class QNetworkAddressEntry-
142 \brief The QNetworkAddressEntry class stores one IP address-
143 supported by a network interface, along with its associated-
144 netmask and broadcast address.-
145-
146 \since 4.2-
147 \reentrant-
148 \ingroup network-
149 \ingroup shared-
150 \inmodule QtNetwork-
151-
152 Each network interface can contain zero or more IP addresses, which-
153 in turn can be associated with a netmask and/or a broadcast-
154 address (depending on support from the operating system).-
155-
156 This class represents one such group.-
157*/-
158-
159/*!-
160 Constructs an empty QNetworkAddressEntry object.-
161*/-
162QNetworkAddressEntry::QNetworkAddressEntry()-
163 : d(new QNetworkAddressEntryPrivate)-
164{-
165}
executed 1860 times by 21 tests: end of block
Executed by:
  • tst_NetworkSelfTest
  • tst_QAbstractNetworkCache
  • tst_QFtp
  • tst_QHostInfo
  • tst_QHttpNetworkConnection
  • tst_QNetworkAccessManager
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkConfiguration
  • tst_QNetworkConfigurationManager
  • tst_QNetworkDiskCache
  • tst_QNetworkInterface
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
  • tst_QNetworkSession
  • tst_QTcpServer
  • tst_QUdpSocket
  • tst_QXmlInputSource
  • tst_QXmlStream
  • tst_qnetworkaccessmanager - unknown status
  • tst_qnetworkaddressentry - unknown status
  • tst_qtcpsocket - unknown status
1860
166-
167/*!-
168 Constructs a QNetworkAddressEntry object that is a copy of the-
169 object \a other.-
170*/-
171QNetworkAddressEntry::QNetworkAddressEntry(const QNetworkAddressEntry &other)-
172 : d(new QNetworkAddressEntryPrivate(*other.d.data()))-
173{-
174}
executed 1248 times by 20 tests: end of block
Executed by:
  • tst_NetworkSelfTest
  • tst_QAbstractNetworkCache
  • tst_QFtp
  • tst_QHostInfo
  • tst_QHttpNetworkConnection
  • tst_QNetworkAccessManager
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkConfiguration
  • tst_QNetworkConfigurationManager
  • tst_QNetworkDiskCache
  • tst_QNetworkInterface
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
  • tst_QNetworkSession
  • tst_QTcpServer
  • tst_QUdpSocket
  • tst_QXmlInputSource
  • tst_QXmlStream
  • tst_qnetworkaccessmanager - unknown status
  • tst_qtcpsocket - unknown status
1248
175-
176/*!-
177 Makes a copy of the QNetworkAddressEntry object \a other.-
178*/-
179QNetworkAddressEntry &QNetworkAddressEntry::operator=(const QNetworkAddressEntry &other)-
180{-
181 *d.data() = *other.d.data();-
182 return *this;
executed 1 time by 1 test: return *this;
Executed by:
  • tst_qnetworkaddressentry - unknown status
1
183}-
184-
185/*!-
186 \fn void QNetworkAddressEntry::swap(QNetworkAddressEntry &other)-
187 \since 5.0-
188-
189 Swaps this network address entry instance with \a other. This-
190 function is very fast and never fails.-
191*/-
192-
193/*!-
194 Destroys this QNetworkAddressEntry object.-
195*/-
196QNetworkAddressEntry::~QNetworkAddressEntry()-
197{-
198}-
199-
200/*!-
201 Returns \c true if this network address entry is the same as \a-
202 other.-
203*/-
204bool QNetworkAddressEntry::operator==(const QNetworkAddressEntry &other) const-
205{-
206 if (d == other.d) return true;
executed 1 time by 1 test: return true;
Executed by:
  • tst_qnetworkaddressentry - unknown status
d == other.dDescription
TRUEevaluated 1 time by 1 test
Evaluated by:
  • tst_qnetworkaddressentry - unknown status
FALSEevaluated 4 times by 1 test
Evaluated by:
  • tst_qnetworkaddressentry - unknown status
1-4
207 if (!d || !other.d) return false;
never executed: return false;
!dDescription
TRUEnever evaluated
FALSEevaluated 4 times by 1 test
Evaluated by:
  • tst_qnetworkaddressentry - unknown status
!other.dDescription
TRUEnever evaluated
FALSEevaluated 4 times by 1 test
Evaluated by:
  • tst_qnetworkaddressentry - unknown status
0-4
208 return d->address == other.d->address &&
executed 4 times by 1 test: return d->address == other.d->address && d->netmask == other.d->netmask && d->broadcast == other.d->broadcast;
Executed by:
  • tst_qnetworkaddressentry - unknown status
d->address == other.d->addressDescription
TRUEevaluated 2 times by 1 test
Evaluated by:
  • tst_qnetworkaddressentry - unknown status
FALSEevaluated 2 times by 1 test
Evaluated by:
  • tst_qnetworkaddressentry - unknown status
2-4
209 d->netmask == other.d->netmask &&
executed 4 times by 1 test: return d->address == other.d->address && d->netmask == other.d->netmask && d->broadcast == other.d->broadcast;
Executed by:
  • tst_qnetworkaddressentry - unknown status
d->netmask == other.d->netmaskDescription
TRUEevaluated 2 times by 1 test
Evaluated by:
  • tst_qnetworkaddressentry - unknown status
FALSEnever evaluated
0-4
210 d->broadcast == other.d->broadcast;
executed 4 times by 1 test: return d->address == other.d->address && d->netmask == other.d->netmask && d->broadcast == other.d->broadcast;
Executed by:
  • tst_qnetworkaddressentry - unknown status
d->broadcast =...r.d->broadcastDescription
TRUEevaluated 2 times by 1 test
Evaluated by:
  • tst_qnetworkaddressentry - unknown status
FALSEnever evaluated
0-4
211}-
212-
213/*!-
214 \fn bool QNetworkAddressEntry::operator!=(const QNetworkAddressEntry &other) const-
215-
216 Returns \c true if this network address entry is different from \a-
217 other.-
218*/-
219-
220/*!-
221 This function returns one IPv4 or IPv6 address found, that was-
222 found in a network interface.-
223*/-
224QHostAddress QNetworkAddressEntry::ip() const-
225{-
226 return d->address;
executed 4698 times by 21 tests: return d->address;
Executed by:
  • tst_NetworkSelfTest
  • tst_QAbstractNetworkCache
  • tst_QFtp
  • tst_QHostInfo
  • tst_QHttpNetworkConnection
  • tst_QNetworkAccessManager
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkConfiguration
  • tst_QNetworkConfigurationManager
  • tst_QNetworkDiskCache
  • tst_QNetworkInterface
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
  • tst_QNetworkSession
  • tst_QTcpServer
  • tst_QUdpSocket
  • tst_QXmlInputSource
  • tst_QXmlStream
  • tst_qnetworkaccessmanager - unknown status
  • tst_qnetworkaddressentry - unknown status
  • tst_qtcpsocket - unknown status
4698
227}-
228-
229/*!-
230 Sets the IP address the QNetworkAddressEntry object contains to \a-
231 newIp.-
232*/-
233void QNetworkAddressEntry::setIp(const QHostAddress &newIp)-
234{-
235 d->address = newIp;-
236}
executed 1861 times by 21 tests: end of block
Executed by:
  • tst_NetworkSelfTest
  • tst_QAbstractNetworkCache
  • tst_QFtp
  • tst_QHostInfo
  • tst_QHttpNetworkConnection
  • tst_QNetworkAccessManager
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkConfiguration
  • tst_QNetworkConfigurationManager
  • tst_QNetworkDiskCache
  • tst_QNetworkInterface
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
  • tst_QNetworkSession
  • tst_QTcpServer
  • tst_QUdpSocket
  • tst_QXmlInputSource
  • tst_QXmlStream
  • tst_qnetworkaccessmanager - unknown status
  • tst_qnetworkaddressentry - unknown status
  • tst_qtcpsocket - unknown status
1861
237-
238/*!-
239 Returns the netmask associated with the IP address. The-
240 netmask is expressed in the form of an IP address, such as-
241 255.255.0.0.-
242-
243 For IPv6 addresses, the prefix length is converted to an address-
244 where the number of bits set to 1 is equal to the prefix-
245 length. For a prefix length of 64 bits (the most common value),-
246 the netmask will be expressed as a QHostAddress holding the-
247 address FFFF:FFFF:FFFF:FFFF::-
248-
249 \sa prefixLength()-
250*/-
251QHostAddress QNetworkAddressEntry::netmask() const-
252{-
253 return d->netmask;
executed 965 times by 21 tests: return d->netmask;
Executed by:
  • tst_NetworkSelfTest
  • tst_QAbstractNetworkCache
  • tst_QFtp
  • tst_QHostInfo
  • tst_QHttpNetworkConnection
  • tst_QNetworkAccessManager
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkConfiguration
  • tst_QNetworkConfigurationManager
  • tst_QNetworkDiskCache
  • tst_QNetworkInterface
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
  • tst_QNetworkSession
  • tst_QTcpServer
  • tst_QUdpSocket
  • tst_QXmlInputSource
  • tst_QXmlStream
  • tst_qnetworkaccessmanager - unknown status
  • tst_qnetworkaddressentry - unknown status
  • tst_qtcpsocket - unknown status
965
254}-
255-
256/*!-
257 Sets the netmask that this QNetworkAddressEntry object contains to-
258 \a newNetmask. Setting the netmask also sets the prefix length to-
259 match the new netmask.-
260-
261 \sa setPrefixLength()-
262*/-
263void QNetworkAddressEntry::setNetmask(const QHostAddress &newNetmask)-
264{-
265 if (newNetmask.protocol() != ip().protocol()) {
newNetmask.pro...p().protocol()Description
TRUEevaluated 42 times by 1 test
Evaluated by:
  • tst_qnetworkaddressentry - unknown status
FALSEevaluated 1244 times by 21 tests
Evaluated by:
  • tst_NetworkSelfTest
  • tst_QAbstractNetworkCache
  • tst_QFtp
  • tst_QHostInfo
  • tst_QHttpNetworkConnection
  • tst_QNetworkAccessManager
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkConfiguration
  • tst_QNetworkConfigurationManager
  • tst_QNetworkDiskCache
  • tst_QNetworkInterface
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
  • tst_QNetworkSession
  • tst_QTcpServer
  • tst_QUdpSocket
  • tst_QXmlInputSource
  • tst_QXmlStream
  • tst_qnetworkaccessmanager - unknown status
  • tst_qnetworkaddressentry - unknown status
  • tst_qtcpsocket - unknown status
42-1244
266 d->netmask = QNetmaskAddress();-
267 return;
executed 42 times by 1 test: return;
Executed by:
  • tst_qnetworkaddressentry - unknown status
42
268 }-
269-
270 d->netmask.setAddress(newNetmask);-
271}
executed 1244 times by 21 tests: end of block
Executed by:
  • tst_NetworkSelfTest
  • tst_QAbstractNetworkCache
  • tst_QFtp
  • tst_QHostInfo
  • tst_QHttpNetworkConnection
  • tst_QNetworkAccessManager
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkConfiguration
  • tst_QNetworkConfigurationManager
  • tst_QNetworkDiskCache
  • tst_QNetworkInterface
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
  • tst_QNetworkSession
  • tst_QTcpServer
  • tst_QUdpSocket
  • tst_QXmlInputSource
  • tst_QXmlStream
  • tst_qnetworkaccessmanager - unknown status
  • tst_qnetworkaddressentry - unknown status
  • tst_qtcpsocket - unknown status
1244
272-
273/*!-
274 \since 4.5-
275 Returns the prefix length of this IP address. The prefix length-
276 matches the number of bits set to 1 in the netmask (see-
277 netmask()). For IPv4 addresses, the value is between 0 and 32. For-
278 IPv6 addresses, it's contained between 0 and 128 and is the-
279 preferred form of representing addresses.-
280-
281 This function returns -1 if the prefix length could not be-
282 determined (i.e., netmask() returns a null QHostAddress()).-
283-
284 \sa netmask()-
285*/-
286int QNetworkAddressEntry::prefixLength() const-
287{-
288 return d->netmask.prefixLength();
executed 107 times by 2 tests: return d->netmask.prefixLength();
Executed by:
  • tst_QNetworkInterface
  • tst_qnetworkaddressentry - unknown status
107
289}-
290-
291/*!-
292 \since 4.5-
293 Sets the prefix length of this IP address to \a length. The value-
294 of \a length must be valid for this type of IP address: between 0-
295 and 32 for IPv4 addresses, between 0 and 128 for IPv6-
296 addresses. Setting to any invalid value is equivalent to setting-
297 to -1, which means "no prefix length".-
298-
299 Setting the prefix length also sets the netmask (see netmask()).-
300-
301 \sa setNetmask()-
302*/-
303void QNetworkAddressEntry::setPrefixLength(int length)-
304{-
305 d->netmask.setPrefixLength(d->address.protocol(), length);-
306}
executed 60 times by 1 test: end of block
Executed by:
  • tst_qnetworkaddressentry - unknown status
60
307-
308/*!-
309 Returns the broadcast address associated with the IPv4-
310 address and netmask. It can usually be derived from those two by-
311 setting to 1 the bits of the IP address where the netmask contains-
312 a 0. (In other words, by bitwise-OR'ing the IP address with the-
313 inverse of the netmask)-
314-
315 This member is always empty for IPv6 addresses, since the concept-
316 of broadcast has been abandoned in that system in favor of-
317 multicast. In particular, the group of hosts corresponding to all-
318 the nodes in the local network can be reached by the "all-nodes"-
319 special multicast group (address FF02::1).-
320*/-
321QHostAddress QNetworkAddressEntry::broadcast() const-
322{-
323 return d->broadcast;
executed 640 times by 21 tests: return d->broadcast;
Executed by:
  • tst_NetworkSelfTest
  • tst_QAbstractNetworkCache
  • tst_QFtp
  • tst_QHostInfo
  • tst_QHttpNetworkConnection
  • tst_QNetworkAccessManager
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkConfiguration
  • tst_QNetworkConfigurationManager
  • tst_QNetworkDiskCache
  • tst_QNetworkInterface
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
  • tst_QNetworkSession
  • tst_QTcpServer
  • tst_QUdpSocket
  • tst_QXmlInputSource
  • tst_QXmlStream
  • tst_qnetworkaccessmanager - unknown status
  • tst_qnetworkaddressentry - unknown status
  • tst_qtcpsocket - unknown status
640
324}-
325-
326/*!-
327 Sets the broadcast IP address of this QNetworkAddressEntry object-
328 to \a newBroadcast.-
329*/-
330void QNetworkAddressEntry::setBroadcast(const QHostAddress &newBroadcast)-
331{-
332 d->broadcast = newBroadcast;-
333}
executed 1023 times by 21 tests: end of block
Executed by:
  • tst_NetworkSelfTest
  • tst_QAbstractNetworkCache
  • tst_QFtp
  • tst_QHostInfo
  • tst_QHttpNetworkConnection
  • tst_QNetworkAccessManager
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkConfiguration
  • tst_QNetworkConfigurationManager
  • tst_QNetworkDiskCache
  • tst_QNetworkInterface
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
  • tst_QNetworkSession
  • tst_QTcpServer
  • tst_QUdpSocket
  • tst_QXmlInputSource
  • tst_QXmlStream
  • tst_qnetworkaccessmanager - unknown status
  • tst_qnetworkaddressentry - unknown status
  • tst_qtcpsocket - unknown status
1023
334-
335/*!-
336 \class QNetworkInterface-
337 \brief The QNetworkInterface class provides a listing of the host's IP-
338 addresses and network interfaces.-
339-
340 \since 4.2-
341 \reentrant-
342 \ingroup network-
343 \ingroup shared-
344 \inmodule QtNetwork-
345-
346 QNetworkInterface represents one network interface attached to the-
347 host where the program is being run. Each network interface may-
348 contain zero or more IP addresses, each of which is optionally-
349 associated with a netmask and/or a broadcast address. The list of-
350 such trios can be obtained with addressEntries(). Alternatively,-
351 when the netmask or the broadcast addresses aren't necessary, use-
352 the allAddresses() convenience function to obtain just the IP-
353 addresses.-
354-
355 QNetworkInterface also reports the interface's hardware address with-
356 hardwareAddress().-
357-
358 Not all operating systems support reporting all features. Only the-
359 IPv4 addresses are guaranteed to be listed by this class in all-
360 platforms. In particular, IPv6 address listing is only supported-
361 on Windows, Linux, \macos and the BSDs.-
362-
363 \sa QNetworkAddressEntry-
364*/-
365-
366/*!-
367 \enum QNetworkInterface::InterfaceFlag-
368 Specifies the flags associated with this network interface. The-
369 possible values are:-
370-
371 \value IsUp the network interface is active-
372 \value IsRunning the network interface has resources-
373 allocated-
374 \value CanBroadcast the network interface works in-
375 broadcast mode-
376 \value IsLoopBack the network interface is a loopback-
377 interface: that is, it's a virtual-
378 interface whose destination is the-
379 host computer itself-
380 \value IsPointToPoint the network interface is a-
381 point-to-point interface: that is,-
382 there is one, single other address-
383 that can be directly reached by it.-
384 \value CanMulticast the network interface supports-
385 multicasting-
386-
387 Note that one network interface cannot be both broadcast-based and-
388 point-to-point.-
389*/-
390-
391/*!-
392 Constructs an empty network interface object.-
393*/-
394QNetworkInterface::QNetworkInterface()-
395 : d(0)-
396{-
397}
executed 564 times by 20 tests: end of block
Executed by:
  • tst_NetworkSelfTest
  • tst_QAbstractNetworkCache
  • tst_QFtp
  • tst_QHostInfo
  • tst_QHttpNetworkConnection
  • tst_QNetworkAccessManager
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkConfiguration
  • tst_QNetworkConfigurationManager
  • tst_QNetworkDiskCache
  • tst_QNetworkInterface
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
  • tst_QNetworkSession
  • tst_QTcpServer
  • tst_QUdpSocket
  • tst_QXmlInputSource
  • tst_QXmlStream
  • tst_qnetworkaccessmanager - unknown status
  • tst_qtcpsocket - unknown status
564
398-
399/*!-
400 Frees the resources associated with the QNetworkInterface object.-
401*/-
402QNetworkInterface::~QNetworkInterface()-
403{-
404}-
405-
406/*!-
407 Creates a copy of the QNetworkInterface object contained in \a-
408 other.-
409*/-
410QNetworkInterface::QNetworkInterface(const QNetworkInterface &other)-
411 : d(other.d)-
412{-
413}
executed 1017 times by 20 tests: end of block
Executed by:
  • tst_NetworkSelfTest
  • tst_QAbstractNetworkCache
  • tst_QFtp
  • tst_QHostInfo
  • tst_QHttpNetworkConnection
  • tst_QNetworkAccessManager
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkConfiguration
  • tst_QNetworkConfigurationManager
  • tst_QNetworkDiskCache
  • tst_QNetworkInterface
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
  • tst_QNetworkSession
  • tst_QTcpServer
  • tst_QUdpSocket
  • tst_QXmlInputSource
  • tst_QXmlStream
  • tst_qnetworkaccessmanager - unknown status
  • tst_qtcpsocket - unknown status
1017
414-
415/*!-
416 Copies the contents of the QNetworkInterface object contained in \a-
417 other into this one.-
418*/-
419QNetworkInterface &QNetworkInterface::operator=(const QNetworkInterface &other)-
420{-
421 d = other.d;-
422 return *this;
never executed: return *this;
0
423}-
424-
425/*!-
426 \fn void QNetworkInterface::swap(QNetworkInterface &other)-
427 \since 5.0-
428-
429 Swaps this network interface instance with \a other. This function-
430 is very fast and never fails.-
431*/-
432-
433/*!-
434 Returns \c true if this QNetworkInterface object contains valid-
435 information about a network interface.-
436*/-
437bool QNetworkInterface::isValid() const-
438{-
439 return !name().isEmpty();
executed 503 times by 20 tests: return !name().isEmpty();
Executed by:
  • tst_NetworkSelfTest
  • tst_QAbstractNetworkCache
  • tst_QFtp
  • tst_QHostInfo
  • tst_QHttpNetworkConnection
  • tst_QNetworkAccessManager
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkConfiguration
  • tst_QNetworkConfigurationManager
  • tst_QNetworkDiskCache
  • tst_QNetworkInterface
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
  • tst_QNetworkSession
  • tst_QTcpServer
  • tst_QUdpSocket
  • tst_QXmlInputSource
  • tst_QXmlStream
  • tst_qnetworkaccessmanager - unknown status
  • tst_qtcpsocket - unknown status
503
440}-
441-
442/*!-
443 \since 4.5-
444 Returns the interface system index, if known. This is an integer-
445 assigned by the operating system to identify this interface and it-
446 generally doesn't change. It matches the scope ID field in IPv6-
447 addresses.-
448-
449 If the index isn't known, this function returns 0.-
450*/-
451int QNetworkInterface::index() const-
452{-
453 return d ? d->index : 0;
executed 657 times by 19 tests: return d ? d->index : 0;
Executed by:
  • tst_NetworkSelfTest
  • tst_QAbstractNetworkCache
  • tst_QFtp
  • tst_QHostInfo
  • tst_QHttpNetworkConnection
  • tst_QNetworkAccessManager
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkConfiguration
  • tst_QNetworkConfigurationManager
  • tst_QNetworkDiskCache
  • tst_QNetworkInterface
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
  • tst_QNetworkSession
  • tst_QTcpServer
  • tst_QUdpSocket
  • tst_QXmlInputSource
  • tst_QXmlStream
  • tst_qnetworkaccessmanager - unknown status
dDescription
TRUEevaluated 650 times by 19 tests
Evaluated by:
  • tst_NetworkSelfTest
  • tst_QAbstractNetworkCache
  • tst_QFtp
  • tst_QHostInfo
  • tst_QHttpNetworkConnection
  • tst_QNetworkAccessManager
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkConfiguration
  • tst_QNetworkConfigurationManager
  • tst_QNetworkDiskCache
  • tst_QNetworkInterface
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
  • tst_QNetworkSession
  • tst_QTcpServer
  • tst_QUdpSocket
  • tst_QXmlInputSource
  • tst_QXmlStream
  • tst_qnetworkaccessmanager - unknown status
FALSEevaluated 7 times by 2 tests
Evaluated by:
  • tst_QNetworkInterface
  • tst_QUdpSocket
7-657
454}-
455-
456/*!-
457 Returns the name of this network interface. On Unix systems, this-
458 is a string containing the type of the interface and optionally a-
459 sequence number, such as "eth0", "lo" or "pcn0". On Windows, it's-
460 an internal ID that cannot be changed by the user.-
461*/-
462QString QNetworkInterface::name() const-
463{-
464 return d ? d->name : QString();
executed 1250 times by 20 tests: return d ? d->name : QString();
Executed by:
  • tst_NetworkSelfTest
  • tst_QAbstractNetworkCache
  • tst_QFtp
  • tst_QHostInfo
  • tst_QHttpNetworkConnection
  • tst_QNetworkAccessManager
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkConfiguration
  • tst_QNetworkConfigurationManager
  • tst_QNetworkDiskCache
  • tst_QNetworkInterface
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
  • tst_QNetworkSession
  • tst_QTcpServer
  • tst_QUdpSocket
  • tst_QXmlInputSource
  • tst_QXmlStream
  • tst_qnetworkaccessmanager - unknown status
  • tst_qtcpsocket - unknown status
dDescription
TRUEevaluated 1241 times by 20 tests
Evaluated by:
  • tst_NetworkSelfTest
  • tst_QAbstractNetworkCache
  • tst_QFtp
  • tst_QHostInfo
  • tst_QHttpNetworkConnection
  • tst_QNetworkAccessManager
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkConfiguration
  • tst_QNetworkConfigurationManager
  • tst_QNetworkDiskCache
  • tst_QNetworkInterface
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
  • tst_QNetworkSession
  • tst_QTcpServer
  • tst_QUdpSocket
  • tst_QXmlInputSource
  • tst_QXmlStream
  • tst_qnetworkaccessmanager - unknown status
  • tst_qtcpsocket - unknown status
FALSEevaluated 9 times by 3 tests
Evaluated by:
  • tst_QNetworkInterface
  • tst_QNetworkSession
  • tst_QUdpSocket
9-1250
465}-
466-
467/*!-
468 \since 4.5-
469-
470 Returns the human-readable name of this network interface on-
471 Windows, such as "Local Area Connection", if the name could be-
472 determined. If it couldn't, this function returns the same as-
473 name(). The human-readable name is a name that the user can modify-
474 in the Windows Control Panel, so it may change during the-
475 execution of the program.-
476-
477 On Unix, this function currently always returns the same as-
478 name(), since Unix systems don't store a configuration for-
479 human-readable names.-
480*/-
481QString QNetworkInterface::humanReadableName() const-
482{-
483 return d ? !d->friendlyName.isEmpty() ? d->friendlyName : name() : QString();
executed 320 times by 19 tests: return d ? !d->friendlyName.isEmpty() ? d->friendlyName : name() : QString();
Executed by:
  • tst_NetworkSelfTest
  • tst_QAbstractNetworkCache
  • tst_QFtp
  • tst_QHostInfo
  • tst_QHttpNetworkConnection
  • tst_QNetworkAccessManager
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkConfiguration
  • tst_QNetworkConfigurationManager
  • tst_QNetworkDiskCache
  • tst_QNetworkInterface
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
  • tst_QNetworkSession
  • tst_QTcpServer
  • tst_QUdpSocket
  • tst_QXmlInputSource
  • tst_QXmlStream
  • tst_qnetworkaccessmanager - unknown status
dDescription
TRUEevaluated 319 times by 19 tests
Evaluated by:
  • tst_NetworkSelfTest
  • tst_QAbstractNetworkCache
  • tst_QFtp
  • tst_QHostInfo
  • tst_QHttpNetworkConnection
  • tst_QNetworkAccessManager
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkConfiguration
  • tst_QNetworkConfigurationManager
  • tst_QNetworkDiskCache
  • tst_QNetworkInterface
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
  • tst_QNetworkSession
  • tst_QTcpServer
  • tst_QUdpSocket
  • tst_QXmlInputSource
  • tst_QXmlStream
  • tst_qnetworkaccessmanager - unknown status
FALSEevaluated 1 time by 1 test
Evaluated by:
  • tst_QNetworkInterface
!d->friendlyName.isEmpty()Description
TRUEnever evaluated
FALSEevaluated 319 times by 19 tests
Evaluated by:
  • tst_NetworkSelfTest
  • tst_QAbstractNetworkCache
  • tst_QFtp
  • tst_QHostInfo
  • tst_QHttpNetworkConnection
  • tst_QNetworkAccessManager
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkConfiguration
  • tst_QNetworkConfigurationManager
  • tst_QNetworkDiskCache
  • tst_QNetworkInterface
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
  • tst_QNetworkSession
  • tst_QTcpServer
  • tst_QUdpSocket
  • tst_QXmlInputSource
  • tst_QXmlStream
  • tst_qnetworkaccessmanager - unknown status
0-320
484}-
485-
486/*!-
487 Returns the flags associated with this network interface.-
488*/-
489QNetworkInterface::InterfaceFlags QNetworkInterface::flags() const-
490{-
491 return d ? d->flags : InterfaceFlags(0);
executed 832 times by 19 tests: return d ? d->flags : InterfaceFlags(0);
Executed by:
  • tst_NetworkSelfTest
  • tst_QAbstractNetworkCache
  • tst_QFtp
  • tst_QHostInfo
  • tst_QHttpNetworkConnection
  • tst_QNetworkAccessManager
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkConfiguration
  • tst_QNetworkConfigurationManager
  • tst_QNetworkDiskCache
  • tst_QNetworkInterface
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
  • tst_QNetworkSession
  • tst_QTcpServer
  • tst_QUdpSocket
  • tst_QXmlInputSource
  • tst_QXmlStream
  • tst_qnetworkaccessmanager - unknown status
dDescription
TRUEevaluated 831 times by 19 tests
Evaluated by:
  • tst_NetworkSelfTest
  • tst_QAbstractNetworkCache
  • tst_QFtp
  • tst_QHostInfo
  • tst_QHttpNetworkConnection
  • tst_QNetworkAccessManager
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkConfiguration
  • tst_QNetworkConfigurationManager
  • tst_QNetworkDiskCache
  • tst_QNetworkInterface
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
  • tst_QNetworkSession
  • tst_QTcpServer
  • tst_QUdpSocket
  • tst_QXmlInputSource
  • tst_QXmlStream
  • tst_qnetworkaccessmanager - unknown status
FALSEevaluated 1 time by 1 test
Evaluated by:
  • tst_QNetworkInterface
1-832
492}-
493-
494/*!-
495 Returns the low-level hardware address for this interface. On-
496 Ethernet interfaces, this will be a MAC address in string-
497 representation, separated by colons.-
498-
499 Other interface types may have other types of hardware-
500 addresses. Implementations should not depend on this function-
501 returning a valid MAC address.-
502*/-
503QString QNetworkInterface::hardwareAddress() const-
504{-
505 return d ? d->hardwareAddress : QString();
executed 4 times by 1 test: return d ? d->hardwareAddress : QString();
Executed by:
  • tst_QNetworkInterface
dDescription
TRUEevaluated 3 times by 1 test
Evaluated by:
  • tst_QNetworkInterface
FALSEevaluated 1 time by 1 test
Evaluated by:
  • tst_QNetworkInterface
1-4
506}-
507-
508/*!-
509 Returns the list of IP addresses that this interface possesses-
510 along with their associated netmasks and broadcast addresses.-
511-
512 If the netmask or broadcast address information is not necessary,-
513 you can call the allAddresses() function to obtain just the IP-
514 addresses.-
515*/-
516QList<QNetworkAddressEntry> QNetworkInterface::addressEntries() const-
517{-
518 return d ? d->addressEntries : QList<QNetworkAddressEntry>();
executed 363 times by 20 tests: return d ? d->addressEntries : QList<QNetworkAddressEntry>();
Executed by:
  • tst_NetworkSelfTest
  • tst_QAbstractNetworkCache
  • tst_QFtp
  • tst_QHostInfo
  • tst_QHttpNetworkConnection
  • tst_QNetworkAccessManager
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkConfiguration
  • tst_QNetworkConfigurationManager
  • tst_QNetworkDiskCache
  • tst_QNetworkInterface
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
  • tst_QNetworkSession
  • tst_QTcpServer
  • tst_QUdpSocket
  • tst_QXmlInputSource
  • tst_QXmlStream
  • tst_qnetworkaccessmanager - unknown status
  • tst_qtcpsocket - unknown status
dDescription
TRUEevaluated 362 times by 20 tests
Evaluated by:
  • tst_NetworkSelfTest
  • tst_QAbstractNetworkCache
  • tst_QFtp
  • tst_QHostInfo
  • tst_QHttpNetworkConnection
  • tst_QNetworkAccessManager
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkConfiguration
  • tst_QNetworkConfigurationManager
  • tst_QNetworkDiskCache
  • tst_QNetworkInterface
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
  • tst_QNetworkSession
  • tst_QTcpServer
  • tst_QUdpSocket
  • tst_QXmlInputSource
  • tst_QXmlStream
  • tst_qnetworkaccessmanager - unknown status
  • tst_qtcpsocket - unknown status
FALSEevaluated 1 time by 1 test
Evaluated by:
  • tst_QNetworkInterface
1-363
519}-
520-
521/*!-
522 Returns a QNetworkInterface object for the interface named \a-
523 name. If no such interface exists, this function returns an-
524 invalid QNetworkInterface object.-
525-
526 The string \a name may be either an actual interface name (such as "eth0"-
527 or "en1") or an interface index in string form ("1", "2", etc.).-
528-
529 \sa name(), isValid()-
530*/-
531QNetworkInterface QNetworkInterface::interfaceFromName(const QString &name)-
532{-
533 QNetworkInterface result;-
534 result.d = manager()->interfaceFromName(name);-
535 return result;
executed 7 times by 2 tests: return result;
Executed by:
  • tst_QNetworkInterface
  • tst_QNetworkSession
7
536}-
537-
538/*!-
539 Returns a QNetworkInterface object for the interface whose internal-
540 ID is \a index. Network interfaces have a unique identifier called-
541 the "interface index" to distinguish it from other interfaces on-
542 the system. Often, this value is assigned progressively and-
543 interfaces being removed and then added again get a different-
544 value every time.-
545-
546 This index is also found in the IPv6 address' scope ID field.-
547*/-
548QNetworkInterface QNetworkInterface::interfaceFromIndex(int index)-
549{-
550 QNetworkInterface result;-
551 result.d = manager()->interfaceFromIndex(index);-
552 return result;
executed 21 times by 16 tests: return result;
Executed by:
  • tst_NetworkSelfTest
  • tst_QAbstractNetworkCache
  • tst_QFtp
  • tst_QHostInfo
  • tst_QHttpNetworkConnection
  • tst_QNetworkAccessManager
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkConfiguration
  • tst_QNetworkConfigurationManager
  • tst_QNetworkDiskCache
  • tst_QNetworkInterface
  • tst_QNetworkProxyFactory
  • tst_QTcpServer
  • tst_QUdpSocket
  • tst_QXmlInputSource
  • tst_QXmlStream
21
553}-
554-
555/*!-
556 Returns a listing of all the network interfaces found on the host-
557 machine. In case of failure it returns a list with zero elements.-
558*/-
559QList<QNetworkInterface> QNetworkInterface::allInterfaces()-
560{-
561 QList<QSharedDataPointer<QNetworkInterfacePrivate> > privs = manager()->allInterfaces();-
562 QList<QNetworkInterface> result;-
563 result.reserve(privs.size());-
564 foreach (const QSharedDataPointer<QNetworkInterfacePrivate> &p, privs) {-
565 QNetworkInterface item;-
566 item.d = p;-
567 result << item;-
568 }
executed 516 times by 20 tests: end of block
Executed by:
  • tst_NetworkSelfTest
  • tst_QAbstractNetworkCache
  • tst_QFtp
  • tst_QHostInfo
  • tst_QHttpNetworkConnection
  • tst_QNetworkAccessManager
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkConfiguration
  • tst_QNetworkConfigurationManager
  • tst_QNetworkDiskCache
  • tst_QNetworkInterface
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
  • tst_QNetworkSession
  • tst_QTcpServer
  • tst_QUdpSocket
  • tst_QXmlInputSource
  • tst_QXmlStream
  • tst_qnetworkaccessmanager - unknown status
  • tst_qtcpsocket - unknown status
516
569-
570 return result;
executed 172 times by 20 tests: return result;
Executed by:
  • tst_NetworkSelfTest
  • tst_QAbstractNetworkCache
  • tst_QFtp
  • tst_QHostInfo
  • tst_QHttpNetworkConnection
  • tst_QNetworkAccessManager
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkConfiguration
  • tst_QNetworkConfigurationManager
  • tst_QNetworkDiskCache
  • tst_QNetworkInterface
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
  • tst_QNetworkSession
  • tst_QTcpServer
  • tst_QUdpSocket
  • tst_QXmlInputSource
  • tst_QXmlStream
  • tst_qnetworkaccessmanager - unknown status
  • tst_qtcpsocket - unknown status
172
571}-
572-
573/*!-
574 This convenience function returns all IP addresses found on the-
575 host machine. It is equivalent to calling addressEntries() on all the-
576 objects returned by allInterfaces() to obtain lists of QHostAddress-
577 objects then calling QHostAddress::ip() on each of these.-
578*/-
579QList<QHostAddress> QNetworkInterface::allAddresses()-
580{-
581 QList<QSharedDataPointer<QNetworkInterfacePrivate> > privs = manager()->allInterfaces();-
582 QList<QHostAddress> result;-
583 foreach (const QSharedDataPointer<QNetworkInterfacePrivate> &p, privs) {-
584 foreach (const QNetworkAddressEntry &entry, p->addressEntries)-
585 result += entry.ip();
executed 24 times by 2 tests: result += entry.ip();
Executed by:
  • tst_QNetworkInterface
  • tst_QNetworkProxyFactory
24
586 }
executed 12 times by 2 tests: end of block
Executed by:
  • tst_QNetworkInterface
  • tst_QNetworkProxyFactory
12
587-
588 return result;
executed 4 times by 2 tests: return result;
Executed by:
  • tst_QNetworkInterface
  • tst_QNetworkProxyFactory
4
589}-
590-
591#ifndef QT_NO_DEBUG_STREAM-
592static inline QDebug flagsDebug(QDebug debug, QNetworkInterface::InterfaceFlags flags)-
593{-
594 if (flags & QNetworkInterface::IsUp)
flags & QNetwo...nterface::IsUpDescription
TRUEnever evaluated
FALSEnever evaluated
0
595 debug << "IsUp ";
never executed: debug << "IsUp ";
0
596 if (flags & QNetworkInterface::IsRunning)
flags & QNetwo...ace::IsRunningDescription
TRUEnever evaluated
FALSEnever evaluated
0
597 debug << "IsRunning ";
never executed: debug << "IsRunning ";
0
598 if (flags & QNetworkInterface::CanBroadcast)
flags & QNetwo...::CanBroadcastDescription
TRUEnever evaluated
FALSEnever evaluated
0
599 debug << "CanBroadcast ";
never executed: debug << "CanBroadcast ";
0
600 if (flags & QNetworkInterface::IsLoopBack)
flags & QNetwo...ce::IsLoopBackDescription
TRUEnever evaluated
FALSEnever evaluated
0
601 debug << "IsLoopBack ";
never executed: debug << "IsLoopBack ";
0
602 if (flags & QNetworkInterface::IsPointToPoint)
flags & QNetwo...IsPointToPointDescription
TRUEnever evaluated
FALSEnever evaluated
0
603 debug << "IsPointToPoint ";
never executed: debug << "IsPointToPoint ";
0
604 if (flags & QNetworkInterface::CanMulticast)
flags & QNetwo...::CanMulticastDescription
TRUEnever evaluated
FALSEnever evaluated
0
605 debug << "CanMulticast ";
never executed: debug << "CanMulticast ";
0
606 return debug;
never executed: return debug;
0
607}-
608-
609static inline QDebug operator<<(QDebug debug, const QNetworkAddressEntry &entry)-
610{-
611 debug << "(address = " << entry.ip();-
612 if (!entry.netmask().isNull())
!entry.netmask().isNull()Description
TRUEnever evaluated
FALSEnever evaluated
0
613 debug << ", netmask = " << entry.netmask();
never executed: debug << ", netmask = " << entry.netmask();
0
614 if (!entry.broadcast().isNull())
!entry.broadcast().isNull()Description
TRUEnever evaluated
FALSEnever evaluated
0
615 debug << ", broadcast = " << entry.broadcast();
never executed: debug << ", broadcast = " << entry.broadcast();
0
616 debug << ')';-
617 return debug;
never executed: return debug;
0
618}-
619-
620QDebug operator<<(QDebug debug, const QNetworkInterface &networkInterface)-
621{-
622 QDebugStateSaver saver(debug);-
623 debug.resetFormat().nospace();-
624 debug << "QNetworkInterface(name = " << networkInterface.name()-
625 << ", hardware address = " << networkInterface.hardwareAddress()-
626 << ", flags = ";-
627 flagsDebug(debug, networkInterface.flags());-
628 debug << ", entries = " << networkInterface.addressEntries()-
629 << ")\n";-
630 return debug;
never executed: return debug;
0
631}-
632#endif-
633-
634QT_END_NAMESPACE-
635-
636#endif // QT_NO_NETWORKINTERFACE-
Source codeSwitch to Preprocessed file

Generated by Squish Coco Non-Commercial 4.3.0-BETA-master-30-08-2018-4cb69e9