mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 13:47:35 +00:00
LookupServer: Minor overhaul
- Break out request building into a DNSRequest class. - Break out response parsing into a DNSResponse class. A DNSRequest contains one or more DNSQuestion objects. A DNSResponse contains all the DNSQuestions asked, and a DNSAnswer object for each answer.
This commit is contained in:
parent
f24173b0f1
commit
871b6b4e1a
10 changed files with 343 additions and 181 deletions
23
Servers/LookupServer/DNSQuestion.h
Normal file
23
Servers/LookupServer/DNSQuestion.h
Normal file
|
@ -0,0 +1,23 @@
|
|||
#pragma once
|
||||
|
||||
#include <AK/String.h>
|
||||
#include <AK/Types.h>
|
||||
|
||||
class DNSQuestion {
|
||||
public:
|
||||
DNSQuestion(const String& name, u16 record_type, u16 class_code)
|
||||
: m_name(name)
|
||||
, m_record_type(record_type)
|
||||
, m_class_code(class_code)
|
||||
{
|
||||
}
|
||||
|
||||
u16 record_type() const { return m_record_type; }
|
||||
u16 class_code() const { return m_class_code; }
|
||||
const String& name() const { return m_name; }
|
||||
|
||||
private:
|
||||
String m_name;
|
||||
u16 m_record_type { 0 };
|
||||
u16 m_class_code { 0 };
|
||||
};
|
Loading…
Add table
Add a link
Reference in a new issue