qdnslookup.sip 7.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310
  1. // qdnslookup.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 QDnsDomainNameRecord
  22. {
  23. %TypeHeaderCode
  24. #include <qdnslookup.h>
  25. %End
  26. public:
  27. QDnsDomainNameRecord();
  28. QDnsDomainNameRecord(const QDnsDomainNameRecord &other);
  29. ~QDnsDomainNameRecord();
  30. void swap(QDnsDomainNameRecord &other /Constrained/);
  31. QString name() const;
  32. quint32 timeToLive() const;
  33. QString value() const;
  34. };
  35. class QDnsHostAddressRecord
  36. {
  37. %TypeHeaderCode
  38. #include <qdnslookup.h>
  39. %End
  40. public:
  41. QDnsHostAddressRecord();
  42. QDnsHostAddressRecord(const QDnsHostAddressRecord &other);
  43. ~QDnsHostAddressRecord();
  44. void swap(QDnsHostAddressRecord &other /Constrained/);
  45. QString name() const;
  46. quint32 timeToLive() const;
  47. QHostAddress value() const;
  48. };
  49. class QDnsMailExchangeRecord
  50. {
  51. %TypeHeaderCode
  52. #include <qdnslookup.h>
  53. %End
  54. public:
  55. QDnsMailExchangeRecord();
  56. QDnsMailExchangeRecord(const QDnsMailExchangeRecord &other);
  57. ~QDnsMailExchangeRecord();
  58. void swap(QDnsMailExchangeRecord &other /Constrained/);
  59. QString exchange() const;
  60. QString name() const;
  61. quint16 preference() const;
  62. quint32 timeToLive() const;
  63. };
  64. class QDnsServiceRecord
  65. {
  66. %TypeHeaderCode
  67. #include <qdnslookup.h>
  68. %End
  69. public:
  70. QDnsServiceRecord();
  71. QDnsServiceRecord(const QDnsServiceRecord &other);
  72. ~QDnsServiceRecord();
  73. void swap(QDnsServiceRecord &other /Constrained/);
  74. QString name() const;
  75. quint16 port() const;
  76. quint16 priority() const;
  77. QString target() const;
  78. quint32 timeToLive() const;
  79. quint16 weight() const;
  80. };
  81. class QDnsTextRecord
  82. {
  83. %TypeHeaderCode
  84. #include <qdnslookup.h>
  85. %End
  86. public:
  87. QDnsTextRecord();
  88. QDnsTextRecord(const QDnsTextRecord &other);
  89. ~QDnsTextRecord();
  90. void swap(QDnsTextRecord &other /Constrained/);
  91. QString name() const;
  92. quint32 timeToLive() const;
  93. QList<QByteArray> values() const;
  94. };
  95. %If (Qt_6_8_0 -)
  96. class QDnsTlsAssociationRecord
  97. {
  98. %TypeHeaderCode
  99. #include <qdnslookup.h>
  100. %End
  101. public:
  102. enum class CertificateUsage : quint8
  103. {
  104. CertificateAuthorityConstrait,
  105. ServiceCertificateConstraint,
  106. TrustAnchorAssertion,
  107. DomainIssuedCertificate,
  108. PrivateUse,
  109. PKIX_TA,
  110. PKIX_EE,
  111. DANE_TA,
  112. DANE_EE,
  113. PrivCert,
  114. };
  115. enum class Selector : quint8
  116. {
  117. FullCertificate,
  118. SubjectPublicKeyInfo,
  119. PrivateUse,
  120. Cert,
  121. SPKI,
  122. PrivSel,
  123. };
  124. enum class MatchingType : quint8
  125. {
  126. Exact,
  127. Sha256,
  128. Sha512,
  129. PrivateUse,
  130. PrivMatch,
  131. };
  132. QDnsTlsAssociationRecord();
  133. QDnsTlsAssociationRecord(const QDnsTlsAssociationRecord &other);
  134. ~QDnsTlsAssociationRecord();
  135. void swap(QDnsTlsAssociationRecord &other /Constrained/);
  136. QString name() const;
  137. quint32 timeToLive() const;
  138. QDnsTlsAssociationRecord::CertificateUsage usage() const;
  139. QDnsTlsAssociationRecord::Selector selector() const;
  140. QDnsTlsAssociationRecord::MatchingType matchType() const;
  141. QByteArray value() const;
  142. };
  143. %End
  144. class QDnsLookup : public QObject
  145. {
  146. %TypeHeaderCode
  147. #include <qdnslookup.h>
  148. %End
  149. public:
  150. enum Error
  151. {
  152. NoError,
  153. ResolverError,
  154. OperationCancelledError,
  155. InvalidRequestError,
  156. InvalidReplyError,
  157. ServerFailureError,
  158. ServerRefusedError,
  159. NotFoundError,
  160. %If (Qt_6_6_0 -)
  161. TimeoutError,
  162. %End
  163. };
  164. %If (Qt_6_8_0 -)
  165. enum Protocol : quint8
  166. {
  167. Standard,
  168. DnsOverTls,
  169. };
  170. %End
  171. enum Type
  172. {
  173. A,
  174. AAAA,
  175. ANY,
  176. CNAME,
  177. MX,
  178. NS,
  179. PTR,
  180. SRV,
  181. TXT,
  182. %If (Qt_6_8_0 -)
  183. TLSA,
  184. %End
  185. };
  186. explicit QDnsLookup(QObject *parent /TransferThis/ = 0);
  187. QDnsLookup(QDnsLookup::Type type, const QString &name, QObject *parent /TransferThis/ = 0);
  188. QDnsLookup(QDnsLookup::Type type, const QString &name, const QHostAddress &nameserver, QObject *parent /TransferThis/ = 0);
  189. %If (Qt_6_6_0 -)
  190. QDnsLookup(QDnsLookup::Type type, const QString &name, const QHostAddress &nameserver, quint16 port, QObject *parent /TransferThis/ = 0);
  191. %End
  192. %If (Qt_6_8_0 -)
  193. QDnsLookup(QDnsLookup::Type type, const QString &name, QDnsLookup::Protocol protocol, const QHostAddress &nameserver, quint16 port = 0, QObject *parent /TransferThis/ = 0);
  194. %End
  195. virtual ~QDnsLookup();
  196. QDnsLookup::Error error() const;
  197. QString errorString() const;
  198. bool isFinished() const;
  199. QString name() const;
  200. void setName(const QString &name);
  201. QDnsLookup::Type type() const;
  202. void setType(QDnsLookup::Type);
  203. QList<QDnsDomainNameRecord> canonicalNameRecords() const;
  204. QList<QDnsHostAddressRecord> hostAddressRecords() const;
  205. QList<QDnsMailExchangeRecord> mailExchangeRecords() const;
  206. QList<QDnsDomainNameRecord> nameServerRecords() const;
  207. QList<QDnsDomainNameRecord> pointerRecords() const;
  208. QList<QDnsServiceRecord> serviceRecords() const;
  209. QList<QDnsTextRecord> textRecords() const;
  210. public slots:
  211. void abort() /ReleaseGIL/;
  212. void lookup() /ReleaseGIL/;
  213. signals:
  214. void finished();
  215. void nameChanged(const QString &name);
  216. %If (Qt_6_8_0 -)
  217. void typeChanged(QDnsLookup::Type type);
  218. %End
  219. %If (- Qt_6_8_0)
  220. void typeChanged(QDnsLookup::Type type /ScopesStripped=1/);
  221. %End
  222. public:
  223. QHostAddress nameserver() const;
  224. void setNameserver(const QHostAddress &nameserver);
  225. %If (Qt_6_6_0 -)
  226. void setNameserver(const QHostAddress &nameserver, quint16 port);
  227. %End
  228. %If (Qt_6_8_0 -)
  229. void setNameserver(QDnsLookup::Protocol protocol, const QHostAddress &nameserver, quint16 port = 0);
  230. %End
  231. signals:
  232. void nameserverChanged(const QHostAddress &nameserver);
  233. public:
  234. %If (Qt_6_6_0 -)
  235. quint16 nameserverPort() const;
  236. %End
  237. %If (Qt_6_6_0 -)
  238. void setNameserverPort(quint16 port);
  239. %End
  240. signals:
  241. %If (Qt_6_6_0 -)
  242. void nameserverPortChanged(quint16 port);
  243. %End
  244. public:
  245. %If (Qt_6_8_0 -)
  246. bool isAuthenticData() const;
  247. %End
  248. %If (Qt_6_8_0 -)
  249. QDnsLookup::Protocol nameserverProtocol() const;
  250. %End
  251. %If (Qt_6_8_0 -)
  252. void setNameserverProtocol(QDnsLookup::Protocol protocol);
  253. %End
  254. %If (Qt_6_8_0 -)
  255. QList<QDnsTlsAssociationRecord> tlsAssociationRecords() const;
  256. %End
  257. %If (Qt_6_8_0 -)
  258. %If (PyQt_SSL)
  259. void setSslConfiguration(const QSslConfiguration &sslConfiguration);
  260. %End
  261. %End
  262. %If (Qt_6_8_0 -)
  263. %If (PyQt_SSL)
  264. QSslConfiguration sslConfiguration() const;
  265. %End
  266. %End
  267. %If (Qt_6_8_0 -)
  268. static bool isProtocolSupported(QDnsLookup::Protocol protocol);
  269. %End
  270. %If (Qt_6_8_0 -)
  271. static quint16 defaultPortForProtocol(QDnsLookup::Protocol protocol);
  272. %End
  273. signals:
  274. %If (Qt_6_8_0 -)
  275. void nameserverProtocolChanged(QDnsLookup::Protocol protocol);
  276. %End
  277. };