1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 22:27:35 +00:00

LookupServer: Introduce DNSName

This is a wrapper around a string representing a domain name (such as
"example.com"). It never has a trailing dot.

For now, this class doesn't do much except wrap the raw string. Subsequent
commits will add or move more functionality to it.
This commit is contained in:
Sergey Bugaev 2021-02-14 15:02:02 +03:00 committed by Andreas Kling
parent de811faf55
commit ae1e82fd2f
9 changed files with 117 additions and 38 deletions

View file

@ -27,6 +27,7 @@
#pragma once
#include "DNSPacket.h"
#include "DNSName.h"
#include <LibCore/Object.h>
namespace LookupServer {
@ -38,13 +39,13 @@ class LookupServer final : public Core::Object {
public:
static LookupServer& the();
Vector<String> lookup(const String& name, unsigned short record_type);
Vector<String> lookup(const DNSName& name, unsigned short record_type);
private:
LookupServer();
void load_etc_hosts();
Vector<String> lookup(const String& hostname, const String& nameserver, bool& did_get_response, unsigned short record_type, ShouldRandomizeCase = ShouldRandomizeCase::Yes);
Vector<String> lookup(const DNSName& hostname, const String& nameserver, bool& did_get_response, unsigned short record_type, ShouldRandomizeCase = ShouldRandomizeCase::Yes);
struct CachedLookup {
DNSQuestion question;