Line | Source | Count |
1 | | - |
2 | | - |
3 | | - |
4 | | - |
5 | | - |
6 | | - |
7 | | - |
8 | | - |
9 | | - |
10 | | - |
11 | | - |
12 | | - |
13 | | - |
14 | | - |
15 | | - |
16 | | - |
17 | | - |
18 | | - |
19 | | - |
20 | | - |
21 | | - |
22 | | - |
23 | | - |
24 | | - |
25 | | - |
26 | | - |
27 | | - |
28 | | - |
29 | | - |
30 | | - |
31 | | - |
32 | | - |
33 | | - |
34 | #include "qset.h" | - |
35 | #include "qnetworkinterface.h" | - |
36 | #include "qnetworkinterface_p.h" | - |
37 | #include "qalgorithms.h" | - |
38 | #include "private/qnet_unix_p.h" | - |
39 | | - |
40 | #ifndef QT_NO_NETWORKINTERFACE | - |
41 | | - |
42 | #define IP_MULTICAST // make AIX happy and define IFF_MULTICAST | - |
43 | | - |
44 | #include <sys/types.h> | - |
45 | #include <sys/socket.h> | - |
46 | | - |
47 | #ifdef Q_OS_SOLARIS | - |
48 | # include <sys/sockio.h> | - |
49 | #endif | - |
50 | #include <net/if.h> | - |
51 | | - |
52 | #if defined(QT_LINUXBASE) | - |
53 | # define QT_NO_GETIFADDRS | - |
54 | #endif | - |
55 | | - |
56 | #ifdef Q_OS_ANDROID | - |
57 | | - |
58 | # define QT_NO_IPV6IFNAME | - |
59 | #endif | - |
60 | | - |
61 | #ifdef Q_OS_HAIKU | - |
62 | # include <sys/sockio.h> | - |
63 | # define IFF_RUNNING 0x0001 | - |
64 | #endif | - |
65 | | - |
66 | #ifndef QT_NO_GETIFADDRS | - |
67 | # include <ifaddrs.h> | - |
68 | #endif | - |
69 | | - |
70 | #ifdef QT_LINUXBASE | - |
71 | # include <arpa/inet.h> | - |
72 | # ifndef SIOCGIFBRDADDR | - |
73 | # define SIOCGIFBRDADDR 0x8919 | - |
74 | # endif | - |
75 | #endif // QT_LINUXBASE | - |
76 | | - |
77 | #include <qplatformdefs.h> | - |
78 | | - |
79 | QT_BEGIN_NAMESPACE | - |
80 | | - |
81 | static QHostAddress addressFromSockaddr(sockaddr *sa, int ifindex = 0, const QString &ifname = QString()) | - |
82 | { | - |
83 | QHostAddress address; | - |
84 | if (!sa)TRUE | evaluated 408 times by 20 testsEvaluated 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
| FALSE | evaluated 3468 times by 20 testsEvaluated 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
|
| 408-3468 |
85 | return address;executed 408 times by 20 tests: return 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_qtcpsocket - unknown status
| 408 |
86 | | - |
87 | if (sa->sa_family == AF_INET)TRUE | evaluated 1632 times by 20 testsEvaluated 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
| FALSE | evaluated 1836 times by 20 testsEvaluated 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
|
| 1632-1836 |
88 | address.setAddress(htonl(((sockaddr_in *)sa)->sin_addr.s_addr));executed 1632 times by 20 tests: address.setAddress(htonl(((sockaddr_in *)sa)->sin_addr.s_addr)); 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
| 1632 |
89 | else if (sa->sa_family == AF_INET6) {TRUE | evaluated 1224 times by 20 testsEvaluated 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
| FALSE | evaluated 612 times by 20 testsEvaluated 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 |
90 | address.setAddress(((sockaddr_in6 *)sa)->sin6_addr.s6_addr); | - |
91 | int scope = ((sockaddr_in6 *)sa)->sin6_scope_id; | - |
92 | if (scope && scope == ifindex) {TRUE | evaluated 408 times by 20 testsEvaluated 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
| FALSE | evaluated 816 times by 20 testsEvaluated 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
|
TRUE | evaluated 408 times by 20 testsEvaluated 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
| FALSE | never evaluated |
| 0-816 |
93 | | - |
94 | | - |
95 | address.setScopeId(ifname); | - |
96 | } else if (scope) {executed 408 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
TRUE | never evaluated | FALSE | evaluated 816 times by 20 testsEvaluated 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-816 |
97 | #ifndef QT_NO_IPV6IFNAME | - |
98 | char scopeid[IFNAMSIZ]; | - |
99 | if (::if_indextoname(scope, scopeid)) {TRUE | never evaluated | FALSE | never evaluated |
| 0 |
100 | address.setScopeId(QLatin1String(scopeid)); | - |
101 | } else never executed: end of block | 0 |
102 | #endif | - |
103 | address.setScopeId(QString::number(uint(scope))); never executed: address.setScopeId(QString::number(uint(scope))); | 0 |
104 | } | - |
105 | }executed 1224 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
| 1224 |
106 | return address;executed 3468 times by 20 tests: return 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_qtcpsocket - unknown status
| 3468 |
107 | | - |
108 | } | - |
109 | | - |
110 | static QNetworkInterface::InterfaceFlags convertFlags(uint rawFlags) | - |
111 | { | - |
112 | QNetworkInterface::InterfaceFlags flags = 0; | - |
113 | flags |= (rawFlags & IFF_UP) ? QNetworkInterface::IsUp : QNetworkInterface::InterfaceFlag(0);TRUE | evaluated 612 times by 20 testsEvaluated 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
| FALSE | never evaluated |
| 0-612 |
114 | flags |= (rawFlags & IFF_RUNNING) ? QNetworkInterface::IsRunning : QNetworkInterface::InterfaceFlag(0);TRUE | evaluated 612 times by 20 testsEvaluated 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
| FALSE | never evaluated |
| 0-612 |
115 | flags |= (rawFlags & IFF_BROADCAST) ? QNetworkInterface::CanBroadcast : QNetworkInterface::InterfaceFlag(0);TRUE | evaluated 408 times by 20 testsEvaluated 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
| FALSE | evaluated 204 times by 20 testsEvaluated 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-408 |
116 | flags |= (rawFlags & IFF_LOOPBACK) ? QNetworkInterface::IsLoopBack : QNetworkInterface::InterfaceFlag(0);TRUE | evaluated 204 times by 20 testsEvaluated 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
| FALSE | evaluated 408 times by 20 testsEvaluated 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-408 |
117 | #ifdef IFF_POINTOPOINT //cygwin doesn't define IFF_POINTOPOINT | - |
118 | flags |= (rawFlags & IFF_POINTOPOINT) ? QNetworkInterface::IsPointToPoint : QNetworkInterface::InterfaceFlag(0);TRUE | never evaluated | FALSE | evaluated 612 times by 20 testsEvaluated 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 |
119 | #endif | - |
120 | | - |
121 | #ifdef IFF_MULTICAST | - |
122 | flags |= (rawFlags & IFF_MULTICAST) ? QNetworkInterface::CanMulticast : QNetworkInterface::InterfaceFlag(0);TRUE | evaluated 408 times by 20 testsEvaluated 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
| FALSE | evaluated 204 times by 20 testsEvaluated 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-408 |
123 | #endif | - |
124 | return flags;executed 612 times by 20 tests: return flags; 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 |
125 | } | - |
126 | | - |
127 | #ifdef QT_NO_GETIFADDRS | - |
128 | | - |
129 | | - |
130 | static QSet<QByteArray> interfaceNames(int socket) | - |
131 | { | - |
132 | QSet<QByteArray> result; | - |
133 | #ifdef QT_NO_IPV6IFNAME | - |
134 | QByteArray storageBuffer; | - |
135 | struct ifconf interfaceList; | - |
136 | static const int STORAGEBUFFER_GROWTH = 256; | - |
137 | | - |
138 | forever { | - |
139 | | - |
140 | storageBuffer.resize(storageBuffer.size() + STORAGEBUFFER_GROWTH); | - |
141 | interfaceList.ifc_buf = storageBuffer.data(); | - |
142 | interfaceList.ifc_len = storageBuffer.size(); | - |
143 | | - |
144 | | - |
145 | if (qt_safe_ioctl(socket, SIOCGIFCONF, &interfaceList) >= 0) { | - |
146 | if (int(interfaceList.ifc_len + sizeof(ifreq) + 64) < storageBuffer.size()) { | - |
147 | | - |
148 | storageBuffer.resize(interfaceList.ifc_len); | - |
149 | break; | - |
150 | } | - |
151 | } else { | - |
152 | | - |
153 | return result; | - |
154 | } | - |
155 | if (storageBuffer.size() > 100000) { | - |
156 | | - |
157 | return result; | - |
158 | } | - |
159 | } | - |
160 | | - |
161 | int interfaceCount = interfaceList.ifc_len / sizeof(ifreq); | - |
162 | for (int i = 0; i < interfaceCount; ++i) { | - |
163 | QByteArray name = QByteArray(interfaceList.ifc_req[i].ifr_name); | - |
164 | if (!name.isEmpty()) | - |
165 | result << name; | - |
166 | } | - |
167 | | - |
168 | return result; | - |
169 | #else | - |
170 | Q_UNUSED(socket); | - |
171 | | - |
172 | | - |
173 | struct if_nameindex *interfaceList = ::if_nameindex(); | - |
174 | for (struct if_nameindex *ptr = interfaceList; ptr && ptr->if_name; ++ptr) | - |
175 | result << ptr->if_name; | - |
176 | | - |
177 | if_freenameindex(interfaceList); | - |
178 | return result; | - |
179 | #endif | - |
180 | } | - |
181 | | - |
182 | static QNetworkInterfacePrivate *findInterface(int socket, QList<QNetworkInterfacePrivate *> &interfaces, | - |
183 | struct ifreq &req) | - |
184 | { | - |
185 | QNetworkInterfacePrivate *iface = 0; | - |
186 | int ifindex = 0; | - |
187 | | - |
188 | #if !defined(QT_NO_IPV6IFNAME) || defined(SIOCGIFINDEX) | - |
189 | | - |
190 | # ifdef SIOCGIFINDEX | - |
191 | if (qt_safe_ioctl(socket, SIOCGIFINDEX, &req) >= 0) | - |
192 | ifindex = req.ifr_ifindex; | - |
193 | # else | - |
194 | ifindex = if_nametoindex(req.ifr_name); | - |
195 | # endif | - |
196 | | - |
197 | | - |
198 | QList<QNetworkInterfacePrivate *>::Iterator if_it = interfaces.begin(); | - |
199 | for ( ; if_it != interfaces.end(); ++if_it) | - |
200 | if ((*if_it)->index == ifindex) { | - |
201 | | - |
202 | iface = *if_it; | - |
203 | break; | - |
204 | } | - |
205 | #else | - |
206 | | - |
207 | QList<QNetworkInterfacePrivate *>::Iterator if_it = interfaces.begin(); | - |
208 | for ( ; if_it != interfaces.end(); ++if_it) | - |
209 | if ((*if_it)->name == QLatin1String(req.ifr_name)) { | - |
210 | | - |
211 | iface = *if_it; | - |
212 | break; | - |
213 | } | - |
214 | #endif | - |
215 | | - |
216 | if (!iface) { | - |
217 | | - |
218 | iface = new QNetworkInterfacePrivate; | - |
219 | iface->index = ifindex; | - |
220 | interfaces << iface; | - |
221 | } | - |
222 | | - |
223 | return iface; | - |
224 | } | - |
225 | | - |
226 | static QList<QNetworkInterfacePrivate *> interfaceListing() | - |
227 | { | - |
228 | QList<QNetworkInterfacePrivate *> interfaces; | - |
229 | | - |
230 | int socket; | - |
231 | if ((socket = qt_safe_socket(AF_INET, SOCK_STREAM, IPPROTO_IP)) == -1) | - |
232 | return interfaces; | - |
233 | | - |
234 | QSet<QByteArray> names = interfaceNames(socket); | - |
235 | QSet<QByteArray>::ConstIterator it = names.constBegin(); | - |
236 | for ( ; it != names.constEnd(); ++it) { | - |
237 | ifreq req; | - |
238 | memset(&req, 0, sizeof(ifreq)); | - |
239 | memcpy(req.ifr_name, *it, qMin<int>(it->length() + 1, sizeof(req.ifr_name) - 1)); | - |
240 | | - |
241 | QNetworkInterfacePrivate *iface = findInterface(socket, interfaces, req); | - |
242 | | - |
243 | #ifdef SIOCGIFNAME | - |
244 | | - |
245 | QByteArray oldName = req.ifr_name; | - |
246 | if (qt_safe_ioctl(socket, SIOCGIFNAME, &req) >= 0) { | - |
247 | iface->name = QString::fromLatin1(req.ifr_name); | - |
248 | | - |
249 | | - |
250 | memcpy(req.ifr_name, oldName, qMin<int>(oldName.length() + 1, sizeof(req.ifr_name) - 1)); | - |
251 | } else | - |
252 | #endif | - |
253 | { | - |
254 | | - |
255 | iface->name = QString::fromLatin1(req.ifr_name); | - |
256 | } | - |
257 | | - |
258 | | - |
259 | if (qt_safe_ioctl(socket, SIOCGIFFLAGS, &req) >= 0) { | - |
260 | iface->flags = convertFlags(req.ifr_flags); | - |
261 | } | - |
262 | | - |
263 | #ifdef SIOCGIFHWADDR | - |
264 | | - |
265 | if (qt_safe_ioctl(socket, SIOCGIFHWADDR, &req) >= 0) { | - |
266 | uchar *addr = (uchar *)req.ifr_addr.sa_data; | - |
267 | iface->hardwareAddress = iface->makeHwAddress(6, addr); | - |
268 | } | - |
269 | #endif | - |
270 | | - |
271 | | - |
272 | QNetworkAddressEntry entry; | - |
273 | if (qt_safe_ioctl(socket, SIOCGIFADDR, &req) >= 0) { | - |
274 | sockaddr *sa = &req.ifr_addr; | - |
275 | entry.setIp(addressFromSockaddr(sa)); | - |
276 | | - |
277 | | - |
278 | if (iface->flags & QNetworkInterface::CanBroadcast) { | - |
279 | if (qt_safe_ioctl(socket, SIOCGIFBRDADDR, &req) >= 0) { | - |
280 | sockaddr *sa = &req.ifr_addr; | - |
281 | if (sa->sa_family == AF_INET) | - |
282 | entry.setBroadcast(addressFromSockaddr(sa)); | - |
283 | } | - |
284 | } | - |
285 | | - |
286 | | - |
287 | if (qt_safe_ioctl(socket, SIOCGIFNETMASK, &req) >= 0) { | - |
288 | sockaddr *sa = &req.ifr_addr; | - |
289 | entry.setNetmask(addressFromSockaddr(sa)); | - |
290 | } | - |
291 | | - |
292 | iface->addressEntries << entry; | - |
293 | } | - |
294 | } | - |
295 | | - |
296 | ::close(socket); | - |
297 | return interfaces; | - |
298 | } | - |
299 | | - |
300 | #else | - |
301 | | - |
302 | | - |
303 | | - |
304 | # ifdef Q_OS_LINUX | - |
305 | QT_BEGIN_INCLUDE_NAMESPACE | - |
306 | # include <features.h> | - |
307 | QT_END_INCLUDE_NAMESPACE | - |
308 | # endif | - |
309 | | - |
310 | # if defined(Q_OS_LINUX) && __GLIBC__ - 0 >= 2 && __GLIBC_MINOR__ - 0 >= 1 && !defined(QT_LINUXBASE) | - |
311 | # include <netpacket/packet.h> | - |
312 | | - |
313 | static QList<QNetworkInterfacePrivate *> createInterfaces(ifaddrs *rawList) | - |
314 | { | - |
315 | QList<QNetworkInterfacePrivate *> interfaces; | - |
316 | QSet<QString> seenInterfaces; | - |
317 | QVarLengthArray<int, 16> seenIndexes; | - |
318 | | - |
319 | | - |
320 | | - |
321 | | - |
322 | | - |
323 | | - |
324 | | - |
325 | | - |
326 | for (ifaddrs *ptr = rawList; ptr; ptr = ptr->ifa_next) {TRUE | evaluated 1836 times by 20 testsEvaluated 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
| FALSE | evaluated 204 times by 20 testsEvaluated 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-1836 |
327 | if (ptr->ifa_addr && ptr->ifa_addr->sa_family == AF_PACKET) {TRUE | evaluated 1836 times by 20 testsEvaluated 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
| FALSE | never evaluated |
TRUE | evaluated 612 times by 20 testsEvaluated 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
| FALSE | evaluated 1224 times by 20 testsEvaluated 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-1836 |
328 | sockaddr_ll *sll = (sockaddr_ll *)ptr->ifa_addr; | - |
329 | QNetworkInterfacePrivate *iface = new QNetworkInterfacePrivate; | - |
330 | interfaces << iface; | - |
331 | iface->index = sll->sll_ifindex; | - |
332 | iface->name = QString::fromLatin1(ptr->ifa_name); | - |
333 | iface->flags = convertFlags(ptr->ifa_flags); | - |
334 | iface->hardwareAddress = iface->makeHwAddress(sll->sll_halen, (uchar*)sll->sll_addr); | - |
335 | | - |
336 | Q_ASSERT(!seenIndexes.contains(iface->index)); | - |
337 | seenIndexes.append(iface->index); | - |
338 | seenInterfaces.insert(iface->name); | - |
339 | }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 |
340 | }executed 1836 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
| 1836 |
341 | | - |
342 | | - |
343 | | - |
344 | | - |
345 | for (ifaddrs *ptr = rawList; ptr; ptr = ptr->ifa_next) {TRUE | evaluated 1836 times by 20 testsEvaluated 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
| FALSE | evaluated 204 times by 20 testsEvaluated 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-1836 |
346 | if (!ptr->ifa_addr || ptr->ifa_addr->sa_family != AF_PACKET) {TRUE | never evaluated | FALSE | evaluated 1836 times by 20 testsEvaluated 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
|
TRUE | evaluated 1224 times by 20 testsEvaluated 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
| FALSE | evaluated 612 times by 20 testsEvaluated 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-1836 |
347 | QString name = QString::fromLatin1(ptr->ifa_name); | - |
348 | if (seenInterfaces.contains(name))TRUE | evaluated 1224 times by 20 testsEvaluated 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
| FALSE | never evaluated |
| 0-1224 |
349 | continue;executed 1224 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
| 1224 |
350 | | - |
351 | int ifindex = if_nametoindex(ptr->ifa_name); | - |
352 | if (seenIndexes.contains(ifindex))TRUE | never evaluated | FALSE | never evaluated |
| 0 |
353 | continue; never executed: continue; | 0 |
354 | | - |
355 | seenInterfaces.insert(name); | - |
356 | seenIndexes.append(ifindex); | - |
357 | | - |
358 | QNetworkInterfacePrivate *iface = new QNetworkInterfacePrivate; | - |
359 | interfaces << iface; | - |
360 | iface->name = name; | - |
361 | iface->flags = convertFlags(ptr->ifa_flags); | - |
362 | iface->index = ifindex; | - |
363 | } never executed: end of block | 0 |
364 | }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 |
365 | | - |
366 | return interfaces;executed 204 times by 20 tests: return interfaces; 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 |
367 | } | - |
368 | | - |
369 | # elif defined(Q_OS_BSD4) | - |
370 | QT_BEGIN_INCLUDE_NAMESPACE | - |
371 | # include <net/if_dl.h> | - |
372 | QT_END_INCLUDE_NAMESPACE | - |
373 | | - |
374 | static QList<QNetworkInterfacePrivate *> createInterfaces(ifaddrs *rawList) | - |
375 | { | - |
376 | QList<QNetworkInterfacePrivate *> interfaces; | - |
377 | | - |
378 | | - |
379 | | - |
380 | for (ifaddrs *ptr = rawList; ptr; ptr = ptr->ifa_next) | - |
381 | if (ptr->ifa_addr && ptr->ifa_addr->sa_family == AF_LINK) { | - |
382 | QNetworkInterfacePrivate *iface = new QNetworkInterfacePrivate; | - |
383 | interfaces << iface; | - |
384 | | - |
385 | sockaddr_dl *sdl = (sockaddr_dl *)ptr->ifa_addr; | - |
386 | iface->index = sdl->sdl_index; | - |
387 | iface->name = QString::fromLatin1(ptr->ifa_name); | - |
388 | iface->flags = convertFlags(ptr->ifa_flags); | - |
389 | iface->hardwareAddress = iface->makeHwAddress(sdl->sdl_alen, (uchar*)LLADDR(sdl)); | - |
390 | } | - |
391 | | - |
392 | return interfaces; | - |
393 | } | - |
394 | | - |
395 | # else // Generic version | - |
396 | | - |
397 | static QList<QNetworkInterfacePrivate *> createInterfaces(ifaddrs *rawList) | - |
398 | { | - |
399 | QList<QNetworkInterfacePrivate *> interfaces; | - |
400 | | - |
401 | | - |
402 | for (ifaddrs *ptr = rawList; ptr; ptr = ptr->ifa_next) { | - |
403 | | - |
404 | int ifindex = if_nametoindex(ptr->ifa_name); | - |
405 | | - |
406 | QList<QNetworkInterfacePrivate *>::Iterator if_it = interfaces.begin(); | - |
407 | for ( ; if_it != interfaces.end(); ++if_it) | - |
408 | if ((*if_it)->index == ifindex) | - |
409 | | - |
410 | break; | - |
411 | | - |
412 | if (if_it == interfaces.end()) { | - |
413 | | - |
414 | QNetworkInterfacePrivate *iface = new QNetworkInterfacePrivate; | - |
415 | interfaces << iface; | - |
416 | | - |
417 | iface->index = ifindex; | - |
418 | iface->name = QString::fromLatin1(ptr->ifa_name); | - |
419 | iface->flags = convertFlags(ptr->ifa_flags); | - |
420 | } | - |
421 | } | - |
422 | | - |
423 | return interfaces; | - |
424 | } | - |
425 | | - |
426 | # endif | - |
427 | | - |
428 | | - |
429 | static QList<QNetworkInterfacePrivate *> interfaceListing() | - |
430 | { | - |
431 | QList<QNetworkInterfacePrivate *> interfaces; | - |
432 | | - |
433 | ifaddrs *interfaceListing; | - |
434 | if (getifaddrs(&interfaceListing) == -1) {TRUE | never evaluated | FALSE | evaluated 204 times by 20 testsEvaluated 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-204 |
435 | | - |
436 | return interfaces; never executed: return interfaces; | 0 |
437 | } | - |
438 | | - |
439 | interfaces = createInterfaces(interfaceListing); | - |
440 | for (ifaddrs *ptr = interfaceListing; ptr; ptr = ptr->ifa_next) {TRUE | evaluated 1836 times by 20 testsEvaluated 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
| FALSE | evaluated 204 times by 20 testsEvaluated 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-1836 |
441 | | - |
442 | QString name = QString::fromLatin1(ptr->ifa_name); | - |
443 | QNetworkInterfacePrivate *iface = 0; | - |
444 | QList<QNetworkInterfacePrivate *>::Iterator if_it = interfaces.begin(); | - |
445 | for ( ; if_it != interfaces.end(); ++if_it)TRUE | evaluated 3672 times by 20 testsEvaluated 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
| FALSE | never evaluated |
| 0-3672 |
446 | if ((*if_it)->name == name) {TRUE | evaluated 1836 times by 20 testsEvaluated 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
| FALSE | evaluated 1836 times by 20 testsEvaluated 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
|
| 1836 |
447 | | - |
448 | iface = *if_it; | - |
449 | break;executed 1836 times by 20 tests: break; 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
| 1836 |
450 | } | - |
451 | | - |
452 | if (!iface) {TRUE | never evaluated | FALSE | evaluated 1836 times by 20 testsEvaluated 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-1836 |
453 | | - |
454 | int ifindex = if_nametoindex(ptr->ifa_name); | - |
455 | for (if_it = interfaces.begin(); if_it != interfaces.end(); ++if_it)TRUE | never evaluated | FALSE | never evaluated |
| 0 |
456 | if ((*if_it)->index == ifindex) {TRUE | never evaluated | FALSE | never evaluated |
| 0 |
457 | | - |
458 | iface = *if_it; | - |
459 | break; never executed: break; | 0 |
460 | } | - |
461 | } never executed: end of block | 0 |
462 | | - |
463 | if (!iface) {TRUE | never evaluated | FALSE | evaluated 1836 times by 20 testsEvaluated 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-1836 |
464 | | - |
465 | continue; never executed: continue; | 0 |
466 | } | - |
467 | | - |
468 | QNetworkAddressEntry entry; | - |
469 | entry.setIp(addressFromSockaddr(ptr->ifa_addr, iface->index, iface->name)); | - |
470 | if (entry.ip().isNull())TRUE | evaluated 612 times by 20 testsEvaluated 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
| FALSE | evaluated 1224 times by 20 testsEvaluated 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 |
471 | | - |
472 | 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 |
473 | | - |
474 | entry.setNetmask(addressFromSockaddr(ptr->ifa_netmask, iface->index, iface->name)); | - |
475 | if (iface->flags & QNetworkInterface::CanBroadcast)TRUE | evaluated 816 times by 20 testsEvaluated 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
| FALSE | evaluated 408 times by 20 testsEvaluated 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
|
| 408-816 |
476 | entry.setBroadcast(addressFromSockaddr(ptr->ifa_broadaddr, iface->index, iface->name));executed 816 times by 20 tests: entry.setBroadcast(addressFromSockaddr(ptr->ifa_ifu.ifu_broadaddr, iface->index, iface->name)); 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
| 816 |
477 | | - |
478 | iface->addressEntries << entry; | - |
479 | }executed 1224 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
| 1224 |
480 | | - |
481 | freeifaddrs(interfaceListing); | - |
482 | return interfaces;executed 204 times by 20 tests: return interfaces; 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 |
483 | } | - |
484 | #endif | - |
485 | | - |
486 | QList<QNetworkInterfacePrivate *> QNetworkInterfaceManager::scan() | - |
487 | { | - |
488 | return interfaceListing();executed 204 times by 20 tests: return interfaceListing(); 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 |
489 | } | - |
490 | | - |
491 | QT_END_NAMESPACE | - |
492 | | - |
493 | #endif // QT_NO_NETWORKINTERFACE | - |
| | |