Infuse-IoT SDK API 0.0.1
A Scalable Open Source RTOS
Loading...
Searching...
No Matches
dns.h
Go to the documentation of this file.
1
9
10#ifndef INFUSE_SDK_INCLUDE_INFUSE_NET_DNS_H_
11#define INFUSE_SDK_INCLUDE_INFUSE_NET_DNS_H_
12
13#include <stdint.h>
14
15#include <zephyr/net/net_ip.h>
16
17#ifdef __cplusplus
18extern "C" {
19#endif
20
26
42int infuse_sync_dns(const char *host, uint16_t port, int family, int socktype,
43 struct sockaddr *addr, socklen_t *addrlen);
44
45/* One result for the DNS query (multiple results are possible) */
46#define INFUSE_ASYNC_DNS_RESULT 0
47/* DNS query has completed successfully */
48#define INFUSE_ASYNC_DNS_COMPLETE 1
49
51
60typedef void (*infuse_async_dns_cb)(int result, struct sockaddr *addr, socklen_t addrlen,
61 struct infuse_async_dns_context *cb_ctx);
62
65 /* Callback to run on events */
67 /* DNS query ID (Internal use) */
68 uint16_t _dns_id;
69 /* Arbitarary user context */
70 void *user_data;
71};
72
85int infuse_async_dns(const char *host, int family, struct infuse_async_dns_context *context,
86 int32_t timeout_ms);
87
91
92#ifdef __cplusplus
93}
94#endif
95
96#endif /* INFUSE_SDK_INCLUDE_INFUSE_NET_DNS_H_ */
int infuse_sync_dns(const char *host, uint16_t port, int family, int socktype, struct sockaddr *addr, socklen_t *addrlen)
Perform a DNS query for a host.
void(* infuse_async_dns_cb)(int result, struct sockaddr *addr, socklen_t addrlen, struct infuse_async_dns_context *cb_ctx)
Callback when DNS results are received.
Definition dns.h:60
int infuse_async_dns(const char *host, int family, struct infuse_async_dns_context *context, int32_t timeout_ms)
Perform an asynchronous DNS query for a host.
Async query context for infuse_async_dns.
Definition dns.h:64
void * user_data
Definition dns.h:70
infuse_async_dns_cb cb
Definition dns.h:66