407 if ((socket =
qt_safe_socket(AF_INET, SOCK_STREAM, IPPROTO_IP)) == -1)
411 if (getifaddrs(&interfaceListing) == -1) {
418 for (ifaddrs *
ptr = interfaceListing;
ptr;
ptr =
ptr->ifa_next) {
420 int ifindex = if_nametoindex(
ptr->ifa_name);
423 for ( ; if_it != interfaces.
end(); ++if_it)
424 if ((*if_it)->index == ifindex) {
447 freeifaddrs(interfaceListing);
bool isNull() const
Returns true if this host address is null (INADDR_ANY or in6addr_any).
QHostAddress ip() const
This function returns one IPv4 or IPv6 address found, that was found in a network interface...
iterator begin()
Returns an STL-style iterator pointing to the first item in the list.
iterator end()
Returns an STL-style iterator pointing to the imaginary item after the last item in the list...
const T * ptr(const T &t)
The QList::iterator class provides an STL-style non-const iterator for QList and QQueue.
static QList< QNetworkInterfacePrivate * > interfaceListing()
static int qt_safe_socket(int domain, int type, int protocol, int flags=0)
void setIp(const QHostAddress &newIp)
Sets the IP address the QNetworkAddressEntry object contains to newIp.
static QList< QNetworkInterfacePrivate * > createInterfaces(ifaddrs *rawList)
QList< QNetworkAddressEntry > addressEntries
void setNetmask(const QHostAddress &newNetmask)
Sets the netmask that this QNetworkAddressEntry object contains to newNetmask.
QNetworkInterface::InterfaceFlags flags
The QNetworkAddressEntry class stores one IP address supported by a network interface, along with its associated netmask and broadcast address.
static QHostAddress addressFromSockaddr(sockaddr *sa)
The QList class is a template class that provides lists.
void setBroadcast(const QHostAddress &newBroadcast)
Sets the broadcast IP address of this QNetworkAddressEntry object to newBroadcast.