Skip to content

File SolidSyslogLwipRawDnsResolver.h

FileList > Interface > SolidSyslogLwipRawDnsResolver.h

Go to the source code of this file

A by-name DNS resolver for lwIP Raw targets — a superset of the numeric resolver (literals, DNS-cache hits, and local-hostlist entries also resolve). More...

  • #include "ExternC.h"
  • #include "SolidSyslogSleep.h"

Classes

Type Name
struct SolidSyslogLwipRawDnsResolverConfig
Tunes SolidSyslogLwipRawDnsResolver's bounded async-resolve spin.

Public Functions

Type Name
struct SolidSyslogResolver * SolidSyslogLwipRawDnsResolver_Create (const struct SolidSyslogLwipRawDnsResolverConfig * config)
Draw a resolver from the pool; the config's Sleep drives the bounded spin (deadline SOLIDSYSLOG_DNS_RESOLVE_TIMEOUT_MS, poll SOLIDSYSLOG_LWIP_RAW_DNS_RESOLVE_POLL_MS).
void SolidSyslogLwipRawDnsResolver_Destroy (struct SolidSyslogResolver * base)
Release the pool slot.

Detailed Description

Resolve wraps lwIP's asynchronous dns_gethostbyname, which touches lwIP core state and so runs under the SolidSyslogLwipRaw_Marshal hop (unlike the numeric resolver's pure ipaddr_aton parse). It bridges that async call to the synchronous Resolve contract on the caller's thread:

  • An ERR_OK synchronous hit (numeric literal, DNS cache, local hostlist) resolves immediately.
  • An ERR_INPROGRESS queued query spins on the caller's thread — sleeping via the config's Sleep so lwIP's DNS timer / RX paths get cycles — until the dns_found_callback fires or the deadline passes. The authoritative address read then runs back under the marshal hop (the thread the callback wrote on), never off the volatile completion flag.
  • Any other immediate rejection, or the deadline elapsing, fails the Resolve so the caller's unresolved-host error path runs.

The transport is ignored. Requires LWIP_DNS=1. See docs/integrating-lwip.md.

Public Functions Documentation

function SolidSyslogLwipRawDnsResolver_Create

Draw a resolver from the pool; the config's Sleep drives the bounded spin (deadline SOLIDSYSLOG_DNS_RESOLVE_TIMEOUT_MS, poll SOLIDSYSLOG_LWIP_RAW_DNS_RESOLVE_POLL_MS).

struct SolidSyslogResolver * SolidSyslogLwipRawDnsResolver_Create (
    const struct SolidSyslogLwipRawDnsResolverConfig * config
) 

A NULL config, a NULL Sleep, or an exhausted pool falls back to the shared NullResolver.


function SolidSyslogLwipRawDnsResolver_Destroy

Release the pool slot.

void SolidSyslogLwipRawDnsResolver_Destroy (
    struct SolidSyslogResolver * base
) 



The documentation for this class was generated from the following file Platform/LwipRaw/Interface/SolidSyslogLwipRawDnsResolver.h