LookupServer: Handle DNS record types TXT, AAAA, SRV and CNAME

They're not being used elsewhere at the moment but this gets
rid of the debug message for incoming mDNS response packets.
This commit is contained in:
Gunnar Beutner 2021-05-07 15:03:52 +02:00 committed by Andreas Kling
parent 7b3bed7910
commit a569381037
Notes: sideshowbarker 2024-07-18 18:22:16 +09:00
3 changed files with 20 additions and 0 deletions

View file

@ -52,6 +52,15 @@ void AK::Formatter<LookupServer::DNSRecordType>::format(AK::FormatBuilder& build
case LookupServer::DNSRecordType::MX:
builder.put_string("MX");
return;
case LookupServer::DNSRecordType::TXT:
builder.put_string("TXT");
return;
case LookupServer::DNSRecordType::AAAA:
builder.put_string("AAAA");
return;
case LookupServer::DNSRecordType::SRV:
builder.put_string("SRV");
return;
}
builder.put_string("DNS record type ");

View file

@ -20,6 +20,9 @@ enum class DNSRecordType : u16 {
SOA = 6,
PTR = 12,
MX = 15,
TXT = 16,
AAAA = 28,
SRV = 33,
};
enum class DNSRecordClass : u16 {

View file

@ -152,7 +152,15 @@ Optional<DNSPacket> DNSPacket::from_raw_packet(const u8* raw_data, size_t raw_si
data = DNSName::parse(raw_data, dummy_offset, raw_size).as_string();
break;
}
case DNSRecordType::CNAME:
// Fall through
case DNSRecordType::A:
// Fall through
case DNSRecordType::TXT:
// Fall through
case DNSRecordType::AAAA:
// Fall through
case DNSRecordType::SRV:
data = { record.data(), record.data_length() };
break;
default: