|
Infuse-IoT SDK API 0.0.1
A Scalable Open Source RTOS
|
Infuse DNS API. More...
Data Structures | |
| struct | infuse_async_dns_context |
| Async query context for infuse_async_dns. More... | |
Macros | |
| #define | INFUSE_ASYNC_DNS_RESULT 0 |
| #define | INFUSE_ASYNC_DNS_COMPLETE 1 |
Typedefs | |
| typedef 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. | |
Functions | |
| 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. | |
| 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. | |
Infuse DNS API.
| #define INFUSE_ASYNC_DNS_COMPLETE 1 |
| #define INFUSE_ASYNC_DNS_RESULT 0 |
| typedef void(* infuse_async_dns_cb) (int result, struct sockaddr *addr, socklen_t addrlen, struct infuse_async_dns_context *cb_ctx) |
#include </__w/infuse-sdk/infuse-sdk/infuse-sdk/include/infuse/net/dns.h>
Callback when DNS results are received.
| result | INFUSE_ASYNC_DNS_RESULT, INFUSE_ASYNC_DNS_COMPLETE, or negative errno |
| addr | For INFUSE_ASYNC_DNS_RESULT, the address associated with the query |
| addrlen | For INFUSE_ASYNC_DNS_RESULT, the length of the address |
| cb_ctx | infuse_async_dns_context provided to infuse_async_dns |
| int infuse_async_dns | ( | const char * | host, |
| int | family, | ||
| struct infuse_async_dns_context * | context, | ||
| int32_t | timeout_ms ) |
#include </__w/infuse-sdk/infuse-sdk/infuse-sdk/include/infuse/net/dns.h>
Perform an asynchronous DNS query for a host.
| host | Host to lookup |
| family | Protocol family hint |
| context | Context package for callbacks. Must remain valid until either INFUSE_ASYNC_DNS_COMPLETE or error callback. |
| timeout_ms | Timeout for query in milliseconds |
| 0 | if query successfully started |
| -errno | other return value from dns_get_addr_info |
| int infuse_sync_dns | ( | const char * | host, |
| uint16_t | port, | ||
| int | family, | ||
| int | socktype, | ||
| struct sockaddr * | addr, | ||
| socklen_t * | addrlen ) |
#include </__w/infuse-sdk/infuse-sdk/infuse-sdk/include/infuse/net/dns.h>
Perform a DNS query for a host.
| host | Host to lookup |
| port | Port number of host |
| family | Protocol family hint |
| socktype | Socket type hint |
| addr | Output storage for host address |
| addrlen | Output length of address |
| 0 | on success |
| -errno | on failure |