eve.core.linux.dns

DNS resolution management for Linux event loop.

This module manages DNS resolution state, including hostname storage, result caching, and slot allocation. It is internal to eve.core.linux and provides a free-list-based allocation strategy for DNS slots.

Types 2

structDnsData

DNS resolution data.

Stores hostname, resolved addresses, error state, and free-list linkage.

Fields
char[256] hostnameNull-terminated hostname (max 255 chars + null terminator).
IpAddress[16] resultsResolved IP addresses (up to 16 results).
ubyte resultCountNumber of valid entries in results array.
DnsError errorDNS resolution error code.
uint nextFreeNext free slot index (used in free list).

DNS slot manager.

Manages allocation and deallocation of DNS resolution slots using a free-list strategy. Each slot holds hostname and result data for one active DNS resolution.

Fields
private DnsData[] _slotsDNS data slots.
private uint _freeHeadHead of free-list (uint.max = empty).
Methods
void initialize(size_t capacity) @trusted nothrowInitialize the DNS manager with the specified capacity.
void rebuildFreeList() @safe nothrow @nogcRebuild the free list for all DNS slots.
uint allocate() @safe nothrow @nogcAllocate a DNS slot.
void release(uint index) @safe nothrow @nogcRelease a DNS slot back to the free list.
DnsData * opIndex(uint index) @safe nothrow @nogc returnGet a pointer to DNS data at the specified index.
size_t length() @property const @safe nothrow @nogcGet the number of allocated slots.