|
@@ -179,5 +179,20 @@ namespace QDns
|
179
|
179
|
m_additionalRecords = additionalRecords;
|
180
|
180
|
m_header.setAdditionalCount((quint16) m_additionalRecords.length());
|
181
|
181
|
}
|
|
182
|
+
|
|
183
|
+ QDnsPacket QDnsPacket::makeSimpleQuery(const QString& host, RecordType type)
|
|
184
|
+ {
|
|
185
|
+ QDns::Base::QDnsPacket packet;
|
|
186
|
+ auto header = packet.getHeader();
|
|
187
|
+ header.setIsQuery(true);
|
|
188
|
+ header.setIsRecursionDesired(true);
|
|
189
|
+ packet.setHeader(header);
|
|
190
|
+ QDns::Base::QDnsQuery query;
|
|
191
|
+ query.setName(host);
|
|
192
|
+ query.setClass(QDns::Base::RecordClass::IN);
|
|
193
|
+ query.setType(type);
|
|
194
|
+ packet.setQueries(QList<QDns::Base::QDnsQuery>() << query);
|
|
195
|
+ return packet;
|
|
196
|
+ }
|
182
|
197
|
}
|
183
|
198
|
}
|