#include "lwip/dns.h"
#include "lwip/ip_addr.h"
#include "lwip/err.h"
#include "pico/time.h"
#include <cstring>
#include "framework_config.h"
#include "DebugTrace.h"
Go to the source code of this file.
Functions | |
TRACE_INIT (LwipDnsResolver) | |
static void | dns_callback (const char *name, const ip_addr_t *ipaddr, void *callback_arg) |
bool | resolveHostnameBlocking (const char *hostname, ip_addr_t *result, uint32_t timeout_ms=5000) |
Blocking DNS resolution using lwIP. | |
Variables | |
static volatile bool | dns_done = false |
static ip_addr_t | resolved_ip |
|
static |
Definition at line 13 of file lwip_dns_resolver.cpp.
References dns_done, and resolved_ip.
Referenced by resolveHostnameBlocking().
bool resolveHostnameBlocking | ( | const char * | hostname, |
ip_addr_t * | result, | ||
uint32_t | timeout_ms = 5000 |
||
) |
Resolve hostname to IP address using lwIP DNS (blocking).
hostname | The host to resolve. |
result | Pointer to an ip_addr_t to store the result. |
timeout_ms | Max time to wait for resolution. |
Definition at line 29 of file lwip_dns_resolver.cpp.
References dns_callback(), dns_done, resolved_ip, and TRACE.
Referenced by Tcp::connect().
TRACE_INIT | ( | LwipDnsResolver | ) |
|
static |
Definition at line 10 of file lwip_dns_resolver.cpp.
Referenced by dns_callback(), and resolveHostnameBlocking().
|
static |
Definition at line 11 of file lwip_dns_resolver.cpp.
Referenced by dns_callback(), and resolveHostnameBlocking().