1// qnetworkinterface.sip generated by MetaSIP
2//
3// This file is part of the QtNetwork Python extension module.
4//
5// Copyright (c) 2021 Riverbank Computing Limited <info@riverbankcomputing.com>
6//
7// This file is part of PyQt5.
8//
9// This file may be used under the terms of the GNU General Public License
10// version 3.0 as published by the Free Software Foundation and appearing in
11// the file LICENSE included in the packaging of this file.  Please review the
12// following information to ensure the GNU General Public License version 3.0
13// requirements will be met: http://www.gnu.org/copyleft/gpl.html.
14//
15// If you do not wish to use this file under the terms of the GPL version 3.0
16// then you may purchase a commercial license.  For more information contact
17// info@riverbankcomputing.com.
18//
19// This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
20// WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
21
22
23class QNetworkAddressEntry
24{
25%TypeHeaderCode
26#include <qnetworkinterface.h>
27%End
28
29public:
30    QNetworkAddressEntry();
31    QNetworkAddressEntry(const QNetworkAddressEntry &other);
32    ~QNetworkAddressEntry();
33    QHostAddress ip() const;
34    void setIp(const QHostAddress &newIp);
35    QHostAddress netmask() const;
36    void setNetmask(const QHostAddress &newNetmask);
37    QHostAddress broadcast() const;
38    void setBroadcast(const QHostAddress &newBroadcast);
39    bool operator==(const QNetworkAddressEntry &other) const;
40    bool operator!=(const QNetworkAddressEntry &other) const;
41    int prefixLength() const;
42    void setPrefixLength(int length);
43    void swap(QNetworkAddressEntry &other /Constrained/);
44%If (Qt_5_11_0 -)
45
46    enum DnsEligibilityStatus
47    {
48        DnsEligibilityUnknown,
49        DnsIneligible,
50        DnsEligible,
51    };
52
53%End
54%If (Qt_5_11_0 -)
55    QNetworkAddressEntry::DnsEligibilityStatus dnsEligibility() const;
56%End
57%If (Qt_5_11_0 -)
58    void setDnsEligibility(QNetworkAddressEntry::DnsEligibilityStatus status);
59%End
60%If (Qt_5_11_0 -)
61    bool isLifetimeKnown() const;
62%End
63%If (Qt_5_11_0 -)
64    QDeadlineTimer preferredLifetime() const;
65%End
66%If (Qt_5_11_0 -)
67    QDeadlineTimer validityLifetime() const;
68%End
69%If (Qt_5_11_0 -)
70    void setAddressLifetime(QDeadlineTimer preferred, QDeadlineTimer validity);
71%End
72%If (Qt_5_11_0 -)
73    void clearAddressLifetime();
74%End
75%If (Qt_5_11_0 -)
76    bool isPermanent() const;
77%End
78%If (Qt_5_11_0 -)
79    bool isTemporary() const;
80%End
81};
82
83class QNetworkInterface
84{
85%TypeHeaderCode
86#include <qnetworkinterface.h>
87%End
88
89public:
90    enum InterfaceFlag
91    {
92        IsUp,
93        IsRunning,
94        CanBroadcast,
95        IsLoopBack,
96        IsPointToPoint,
97        CanMulticast,
98    };
99
100    typedef QFlags<QNetworkInterface::InterfaceFlag> InterfaceFlags;
101    QNetworkInterface();
102    QNetworkInterface(const QNetworkInterface &other);
103    ~QNetworkInterface();
104    bool isValid() const;
105    QString name() const;
106    QNetworkInterface::InterfaceFlags flags() const;
107    QString hardwareAddress() const;
108    QList<QNetworkAddressEntry> addressEntries() const;
109    static QNetworkInterface interfaceFromName(const QString &name);
110    static QNetworkInterface interfaceFromIndex(int index);
111    static QList<QNetworkInterface> allInterfaces();
112    static QList<QHostAddress> allAddresses();
113    int index() const;
114    QString humanReadableName() const;
115    void swap(QNetworkInterface &other /Constrained/);
116%If (Qt_5_7_0 -)
117    static int interfaceIndexFromName(const QString &name);
118%End
119%If (Qt_5_7_0 -)
120    static QString interfaceNameFromIndex(int index);
121%End
122%If (Qt_5_11_0 -)
123
124    enum InterfaceType
125    {
126        Unknown,
127        Loopback,
128        Virtual,
129        Ethernet,
130        Slip,
131        CanBus,
132        Ppp,
133        Fddi,
134        Wifi,
135        Ieee80211,
136        Phonet,
137        Ieee802154,
138        SixLoWPAN,
139        Ieee80216,
140        Ieee1394,
141    };
142
143%End
144%If (Qt_5_11_0 -)
145    QNetworkInterface::InterfaceType type() const;
146%End
147%If (Qt_5_11_0 -)
148    int maximumTransmissionUnit() const;
149%End
150};
151
152QFlags<QNetworkInterface::InterfaceFlag> operator|(QNetworkInterface::InterfaceFlag f1, QFlags<QNetworkInterface::InterfaceFlag> f2);
153