qnetworkinterface.sip 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120
  1. // qnetworkinterface.sip generated by MetaSIP
  2. //
  3. // This file is part of the QtNetwork Python extension module.
  4. //
  5. // Copyright (c) 2026 Riverbank Computing Limited <info@riverbankcomputing.com>
  6. //
  7. // This file is part of PyQt6.
  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. class QNetworkAddressEntry
  22. {
  23. %TypeHeaderCode
  24. #include <qnetworkinterface.h>
  25. %End
  26. public:
  27. QNetworkAddressEntry();
  28. QNetworkAddressEntry(const QNetworkAddressEntry &other);
  29. ~QNetworkAddressEntry();
  30. QHostAddress ip() const;
  31. void setIp(const QHostAddress &newIp);
  32. QHostAddress netmask() const;
  33. void setNetmask(const QHostAddress &newNetmask);
  34. QHostAddress broadcast() const;
  35. void setBroadcast(const QHostAddress &newBroadcast);
  36. bool operator==(const QNetworkAddressEntry &other) const;
  37. bool operator!=(const QNetworkAddressEntry &other) const;
  38. int prefixLength() const;
  39. void setPrefixLength(int length);
  40. void swap(QNetworkAddressEntry &other /Constrained/);
  41. enum DnsEligibilityStatus : qint8
  42. {
  43. DnsEligibilityUnknown,
  44. DnsIneligible,
  45. DnsEligible,
  46. };
  47. QNetworkAddressEntry::DnsEligibilityStatus dnsEligibility() const;
  48. void setDnsEligibility(QNetworkAddressEntry::DnsEligibilityStatus status);
  49. bool isLifetimeKnown() const;
  50. QDeadlineTimer preferredLifetime() const;
  51. QDeadlineTimer validityLifetime() const;
  52. void setAddressLifetime(QDeadlineTimer preferred, QDeadlineTimer validity);
  53. void clearAddressLifetime();
  54. bool isPermanent() const;
  55. bool isTemporary() const;
  56. };
  57. class QNetworkInterface
  58. {
  59. %TypeHeaderCode
  60. #include <qnetworkinterface.h>
  61. %End
  62. public:
  63. enum InterfaceFlag /BaseType=Flag/
  64. {
  65. IsUp,
  66. IsRunning,
  67. CanBroadcast,
  68. IsLoopBack,
  69. IsPointToPoint,
  70. CanMulticast,
  71. };
  72. typedef QFlags<QNetworkInterface::InterfaceFlag> InterfaceFlags;
  73. QNetworkInterface();
  74. QNetworkInterface(const QNetworkInterface &other);
  75. ~QNetworkInterface();
  76. bool isValid() const;
  77. QString name() const;
  78. QNetworkInterface::InterfaceFlags flags() const;
  79. QString hardwareAddress() const;
  80. QList<QNetworkAddressEntry> addressEntries() const;
  81. static QNetworkInterface interfaceFromName(const QString &name);
  82. static QNetworkInterface interfaceFromIndex(int index);
  83. static QList<QNetworkInterface> allInterfaces();
  84. static QList<QHostAddress> allAddresses();
  85. int index() const;
  86. QString humanReadableName() const;
  87. void swap(QNetworkInterface &other /Constrained/);
  88. static int interfaceIndexFromName(const QString &name);
  89. static QString interfaceNameFromIndex(int index);
  90. enum InterfaceType
  91. {
  92. Unknown,
  93. Loopback,
  94. Virtual,
  95. Ethernet,
  96. Slip,
  97. CanBus,
  98. Ppp,
  99. Fddi,
  100. Wifi,
  101. Ieee80211,
  102. Phonet,
  103. Ieee802154,
  104. SixLoWPAN,
  105. Ieee80216,
  106. Ieee1394,
  107. };
  108. QNetworkInterface::InterfaceType type() const;
  109. int maximumTransmissionUnit() const;
  110. };