mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-09-20 09:49:15 +03:00
27f699ef0c
These types can be picked up by including <AK/Types.h>: * u8, u16, u32, u64 (unsigned) * i8, i16, i32, i64 (signed)
29 lines
661 B
C++
29 lines
661 B
C++
#pragma once
|
|
|
|
#include <AK/NetworkOrdered.h>
|
|
#include <AK/Types.h>
|
|
|
|
class [[gnu::packed]] DNSRecord
|
|
{
|
|
public:
|
|
DNSRecord() {}
|
|
|
|
u16 name() const { return m_name; }
|
|
u16 type() const { return m_type; }
|
|
u16 record_class() const { return m_class; }
|
|
u32 ttl() const { return m_ttl; }
|
|
u16 data_length() const { return m_data_length; }
|
|
|
|
void* data() { return this + 1; }
|
|
const void* data() const { return this + 1; }
|
|
|
|
private:
|
|
NetworkOrdered<u16> m_name;
|
|
NetworkOrdered<u16> m_type;
|
|
NetworkOrdered<u16> m_class;
|
|
NetworkOrdered<u32> m_ttl;
|
|
NetworkOrdered<u16> m_data_length;
|
|
};
|
|
|
|
static_assert(sizeof(DNSRecord) == 12);
|