|
Zephyr Project API 4.4.99
A Scalable Open Source RTOS
|
Result callbacks. More...
#include <dns_resolve.h>
Data Fields | |
| struct k_work_delayable | timer |
| Timeout timer. | |
| struct dns_resolve_context * | ctx |
| Back pointer to ctx, needed in timeout handler. | |
| dns_resolve_cb_t | cb |
| Result callback. | |
| void * | user_data |
| User data. | |
| const char * | query |
| String containing the thing to resolve like www.example.com. | |
| enum dns_query_type | query_type |
| Query type. | |
| uint16_t | id |
| DNS id of this query. | |
| uint16_t | query_hash |
| Hash of the DNS name + query type we are querying. | |
| uint8_t | additional_queries |
| bool | cb_called |
| Flag to indicate that the callback has been called at least once. | |
| k_timepoint_t | deadline |
| Query deadline used to keep server fallback within the original timeout. | |
| struct { | |
| atomic_t sent | |
| Bitset of servers that have already been queried. More... | |
| atomic_t pending | |
| Bitset of servers currently awaiting a reply. More... | |
| atomic_t failed | |
| Bitset of servers that already failed this query. More... | |
| } | servers |
| Per-query state for configured DNS servers. | |
| enum dns_resolve_status | last_status |
| Most recent terminal status reported by an attempted server. | |
Result callbacks.
We have multiple callbacks here so that it is possible to do multiple queries at the same time.
Contents of this structure can be inspected and changed only when the lock is held.
| uint8_t dns_resolve_context::dns_pending_query::additional_queries |
| dns_resolve_cb_t dns_resolve_context::dns_pending_query::cb |
Result callback.
A null value indicates the slot is not in use.
| bool dns_resolve_context::dns_pending_query::cb_called |
Flag to indicate that the callback has been called at least once.
| struct dns_resolve_context* dns_resolve_context::dns_pending_query::ctx |
Back pointer to ctx, needed in timeout handler.
| k_timepoint_t dns_resolve_context::dns_pending_query::deadline |
Query deadline used to keep server fallback within the original timeout.
| atomic_t dns_resolve_context::dns_pending_query::failed |
Bitset of servers that already failed this query.
| uint16_t dns_resolve_context::dns_pending_query::id |
DNS id of this query.
| enum dns_resolve_status dns_resolve_context::dns_pending_query::last_status |
Most recent terminal status reported by an attempted server.
| atomic_t dns_resolve_context::dns_pending_query::pending |
Bitset of servers currently awaiting a reply.
| const char* dns_resolve_context::dns_pending_query::query |
String containing the thing to resolve like www.example.com.
This is set to a non-null value when the query is started, and is not used thereafter.
If the query completed at a point where the work item was still pending the pointer is cleared to indicate that the query is complete, but release of the query slot will be deferred until a request for a slot determines that the work item has been released.
| uint16_t dns_resolve_context::dns_pending_query::query_hash |
Hash of the DNS name + query type we are querying.
This hash is calculated so we can match the response that we are receiving. This is needed mainly for mDNS which is setting the DNS id to 0, which means that the id alone cannot be used to find correct pending query.
| enum dns_query_type dns_resolve_context::dns_pending_query::query_type |
Query type.
| atomic_t dns_resolve_context::dns_pending_query::sent |
Bitset of servers that have already been queried.
| struct { ... } dns_resolve_context::dns_pending_query::servers |
Per-query state for configured DNS servers.
| struct k_work_delayable dns_resolve_context::dns_pending_query::timer |
Timeout timer.
| void* dns_resolve_context::dns_pending_query::user_data |
User data.