1
0
mirror of https://github.com/mfontanini/libtins synced 2026-01-28 12:44:25 +01:00

Use lower case names for DNS query/record and change type to query_type

This commit is contained in:
Matias Fontanini
2016-01-14 12:40:00 -08:00
parent ced645fb02
commit 757e54dc08
5 changed files with 148 additions and 96 deletions

View File

@@ -37,8 +37,7 @@ using namespace Tins;
PacketSender sender;
bool callback(const PDU& pdu)
{
bool callback(const PDU& pdu) {
// The packet probably looks like this:
//
// EthernetII / IP / UDP / RawPDU
@@ -54,7 +53,7 @@ bool callback(const PDU& pdu)
if (dns.type() == DNS::QUERY) {
// Let's see if there's any query for an "A" record.
for (const auto& query : dns.queries()) {
if (query.type() == DNS::A) {
if (query.query_type() == DNS::A) {
// Here's one! Let's add an answer.
dns.add_answer(
DNS::Resource(