25 #if defined(LWS_WITH_UDP) && defined(LWS_WITH_NETWORK)
27 typedef enum dns_query_type {
28 LWS_ADNS_RECORD_A = 0x01,
29 LWS_ADNS_RECORD_CNAME = 0x05,
30 LWS_ADNS_RECORD_MX = 0x0f,
31 LWS_ADNS_RECORD_AAAA = 0x1c,
35 LADNS_RET_FAILED_WSI_CLOSED = -4,
36 LADNS_RET_NXDOMAIN = -3,
37 LADNS_RET_TIMEDOUT = -2,
38 LADNS_RET_FAILED = -1,
41 } lws_async_dns_retcode_t;
43 #define LWS_ADNS_SYNTHETIC 0x10000
48 typedef struct lws * (*lws_async_dns_cb_t)(
struct lws *wsi,
const char *ads,
49 const struct addrinfo *result,
int n,
void *opaque);
76 lws_async_dns_query(
struct lws_context *context,
int tsi,
const char *name,
77 adns_query_type_t qtype, lws_async_dns_cb_t cb,
78 struct lws *wsi,
void *opaque,
struct lws_adns_q **pq);
91 lws_async_dns_freeaddrinfo(
const struct addrinfo **ai);
104 lws_async_dns_server_add(
struct lws_context *cx,
const lws_sockaddr46 *sa46);
118 lws_async_dns_server_remove(
struct lws_context *cx,
const lws_sockaddr46 *sa46);
123 lws_adns_get_tid(
struct lws_adns_q *q);
125 lws_adns_get_async_dns(
struct lws_adns_q *q);
128 lws_adns_parse_udp(
struct lws_async_dns *dns,
const uint8_t *pkt,
size_t len);