Qt
Internal/Contributor docs for the Qt SDK. <b>Note:</b> These are NOT official API docs; those are found <a href='https://doc.qt.io/'>here</a>.
Loading...
Searching...
No Matches
qnetworkinterface_unix.cpp File Reference

(5eecb143bcdb619a38bf2af52a8a7dae48d9ef61)

#include "qbytearray.h"
#include "qset.h"
#include "qnetworkinterface.h"
#include "qnetworkinterface_p.h"
#include "qnetworkinterface_unix_p.h"
#include "qalgorithms.h"
#include <QtCore/private/qduplicatetracker_p.h>
#include <qplatformdefs.h>
+ Include dependency graph for qnetworkinterface_unix.cpp:

Go to the source code of this file.

Functions

static QT_BEGIN_NAMESPACE QHostAddress addressFromSockaddr (sockaddr *sa, int ifindex=0, const QString &ifname=QString())
 
template<typename Req >
static auto & ifreq_index (Req &req, std::enable_if_t< sizeof(std::declval< Req >().ifr_index) !=0, int >=0)
 
template<typename Req >
static auto & ifreq_index (Req &req, std::enable_if_t< sizeof(std::declval< Req >().ifr_ifindex) !=0, int >=0)
 
static int getMtu (int socket, struct ifreq *req)
 
static QSet< QByteArrayinterfaceNames (int socket)
 
static QNetworkInterfacePrivatefindInterface (int socket, QList< QNetworkInterfacePrivate * > &interfaces, struct ifreq &req)
 
static QList< QNetworkInterfacePrivate * > interfaceListing ()
 

Function Documentation

◆ addressFromSockaddr()

static QT_BEGIN_NAMESPACE QHostAddress addressFromSockaddr ( sockaddr * sa,
int ifindex = 0,
const QString & ifname = QString() )
static

Definition at line 35 of file qnetworkinterface_unix.cpp.

References AF_INET6, QNetworkInterfaceManager::interfaceNameFromIndex(), and QHostAddress::setAddress().

Referenced by interfaceListing().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ findInterface()

static QNetworkInterfacePrivate * findInterface ( int socket,
QList< QNetworkInterfacePrivate * > & interfaces,
struct ifreq & req )
static

Definition at line 181 of file qnetworkinterface_unix.cpp.

References ifreq_index(), Q_UNUSED, qt_safe_ioctl(), and socket.

Referenced by interfaceListing().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getMtu()

static int getMtu ( int socket,
struct ifreq * req )
static

Definition at line 117 of file qnetworkinterface_unix.cpp.

References qt_safe_ioctl(), and socket.

Referenced by interfaceListing().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ ifreq_index() [1/2]

template<typename Req >
static auto & ifreq_index ( Req & req,
std::enable_if_t< sizeof(std::declval< Req >().ifr_ifindex) !=0, int > = 0 )
static

Definition at line 64 of file qnetworkinterface_unix.cpp.

◆ ifreq_index() [2/2]

template<typename Req >
static auto & ifreq_index ( Req & req,
std::enable_if_t< sizeof(std::declval< Req >().ifr_index) !=0, int > = 0 )
static

Definition at line 58 of file qnetworkinterface_unix.cpp.

Referenced by findInterface().

+ Here is the caller graph for this function:

◆ interfaceListing()

static QList< QNetworkInterfacePrivate * > interfaceListing ( )
static

Definition at line 226 of file qnetworkinterface_unix.cpp.

References addressFromSockaddr(), QNetworkInterface::CanBroadcast, QSet< T >::constBegin(), QSet< T >::constEnd(), convertFlags(), findInterface(), QString::fromLatin1(), getMtu(), interfaceNames(), it, qMin(), qt_safe_ioctl(), qt_safe_socket(), and socket.

+ Here is the call graph for this function:

◆ interfaceNames()

static QSet< QByteArray > interfaceNames ( int socket)
static

Definition at line 129 of file qnetworkinterface_unix.cpp.

References forever, i, ptr(), Q_UNUSED, QByteArray(), qt_safe_ioctl(), and socket.

Referenced by interfaceListing().

+ Here is the call graph for this function:
+ Here is the caller graph for this function: