mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 02:27:43 +00:00
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:
parent
7b3bed7910
commit
a569381037
3 changed files with 20 additions and 0 deletions
|
@ -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 ");
|
||||
|
|
|
@ -20,6 +20,9 @@ enum class DNSRecordType : u16 {
|
|||
SOA = 6,
|
||||
PTR = 12,
|
||||
MX = 15,
|
||||
TXT = 16,
|
||||
AAAA = 28,
|
||||
SRV = 33,
|
||||
};
|
||||
|
||||
enum class DNSRecordClass : u16 {
|
||||
|
|
|
@ -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:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue