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
27
43int infuse_sync_dns(const char *host, uint16_t port, int family, int socktype,
44 struct net_sockaddr *addr, net_socklen_t *addrlen);
45
47#define INFUSE_ASYNC_DNS_RESULT 0
49#define INFUSE_ASYNC_DNS_COMPLETE 1
50
52
61typedef void (*infuse_async_dns_cb)(int result, struct net_sockaddr *addr, net_socklen_t addrlen,
62 struct infuse_async_dns_context *cb_ctx);
63
69 uint16_t _dns_id;
71 void *user_data;
72};
73
86int infuse_async_dns(const char *host, int family, struct infuse_async_dns_context *context,
87 int32_t timeout_ms);
88
92
93#ifdef __cplusplus
94}
95#endif
96
97#endif /* INFUSE_SDK_INCLUDE_INFUSE_NET_DNS_H_ */
int infuse_sync_dns(const char *host, uint16_t port, int family, int socktype, struct net_sockaddr *addr, net_socklen_t *addrlen)
Perform a DNS query for a host.
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.
void(* infuse_async_dns_cb)(int result, struct net_sockaddr *addr, net_socklen_t addrlen, struct infuse_async_dns_context *cb_ctx)
Callback when DNS results are received.
Definition dns.h:61
Async query context for infuse_async_dns.
Definition dns.h:65
void * user_data
Arbitrary user context.
Definition dns.h:71
infuse_async_dns_cb cb
Callback to run on events.
Definition dns.h:67