140 ULONG bufSize =
sizeof staticBuf;
147 if (retval == ERROR_BUFFER_OVERFLOW) {
157 }
else if (retval != ERROR_SUCCESS) {
169 iface->index =
ptr->Ipv6IfIndex;
170 else if (
ptr->IfIndex != 0)
171 iface->index =
ptr->IfIndex;
181 if (
ptr->PhysicalAddressLength)
182 iface->hardwareAddress = iface->makeHwAddress(
ptr->PhysicalAddressLength,
183 ptr->PhysicalAddress);
196 pprefix =
ptr->FirstPrefix;
208 pprefix = pprefix->
Next ? pprefix->
Next : pprefix;
210 iface->addressEntries << entry;
214 if (pAdapter != staticBuf)
static QString fromWCharArray(const wchar_t *, int size=-1)
Returns a copy of the string, where the encoding of string depends on the size of wchar...
static QHash< QHostAddress, QHostAddress > ipv4Netmasks()
static QString fromLocal8Bit(const char *, int size=-1)
Returns a QString initialized with the first size characters of the 8-bit string str.
#define IP_ADAPTER_NO_MULTICAST
QHostAddress ip() const
This function returns one IPv4 or IPv6 address found, that was found in a network interface...
Q_CORE_EXPORT void qFree(void *ptr)
void setPrefixLength(int length)
Sets the prefix length of this IP address to length.
Q_CORE_EXPORT void * qMalloc(size_t size)
The QHash class is a template class that provides a hash-table-based dictionary.
static QHostAddress addressFromSockaddr(sockaddr *sa)
const T * ptr(const T &t)
#define GAA_FLAG_SKIP_MULTICAST
QAbstractSocket::NetworkLayerProtocol protocol() const
Returns the network layer protocol of the host address.
struct _IP_ADAPTER_PREFIX * Next
void setIp(const QHostAddress &newIp)
Sets the IP address the QNetworkAddressEntry object contains to newIp.
#define GAA_FLAG_INCLUDE_PREFIX
static PtrGetAdaptersAddresses ptrGetAdaptersAddresses
void setNetmask(const QHostAddress &newNetmask)
Sets the netmask that this QNetworkAddressEntry object contains to newNetmask.
#define GAA_FLAG_SKIP_DNS_SERVER
The QNetworkAddressEntry class stores one IP address supported by a network interface, along with its associated netmask and broadcast address.
The QList class is a template class that provides lists.