ladybird/Servers/LookupServer/DNSRecord.h
Robin Burchell 0dc9af5f7e Add clang-format file
Also run it across the whole tree to get everything using the One True Style.
We don't yet run this in an automated fashion as it's a little slow, but
there is a snippet to do so in makeall.sh.
2019-05-28 17:31:20 +02:00

29 lines
673 B
C++

#pragma once
#include <AK/NetworkOrdered.h>
#include <AK/Types.h>
class [[gnu::packed]] DNSRecord
{
public:
DNSRecord() {}
word name() const { return m_name; }
word type() const { return m_type; }
word record_class() const { return m_class; }
dword ttl() const { return m_ttl; }
word data_length() const { return m_data_length; }
void* data() { return this + 1; }
const void* data() const { return this + 1; }
private:
NetworkOrdered<word> m_name;
NetworkOrdered<word> m_type;
NetworkOrdered<word> m_class;
NetworkOrdered<dword> m_ttl;
NetworkOrdered<word> m_data_length;
};
static_assert(sizeof(DNSRecord) == 12);