mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-30 03:20:28 +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
Notes:
sideshowbarker
2024-07-18 18:22:16 +09:00
Author: https://github.com/gunnarbeutner Commit: https://github.com/SerenityOS/serenity/commit/a569381037f Pull-request: https://github.com/SerenityOS/serenity/pull/6921 Reviewed-by: https://github.com/bugaevc
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…
Reference in a new issue