Zephyr API Documentation 4.0.0
A Scalable Open Source RTOS
Loading...
Searching...
No Matches
dns_resolve_context::dns_pending_query Struct Reference

Result callbacks. More...

#include <dns_resolve.h>

Data Fields

struct k_work_delayable timer
 Timeout timer.
 
struct dns_resolve_contextctx
 Back pointer to ctx, needed in timeout handler.
 
dns_resolve_cb_t cb
 Result callback.
 
void * user_data
 User data.
 
k_timeout_t timeout
 TX timeout.
 
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.
 

Detailed Description

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.

Field Documentation

◆ cb

dns_resolve_cb_t dns_resolve_context::dns_pending_query::cb

Result callback.

A null value indicates the slot is not in use.

◆ ctx

struct dns_resolve_context* dns_resolve_context::dns_pending_query::ctx

Back pointer to ctx, needed in timeout handler.

◆ id

uint16_t dns_resolve_context::dns_pending_query::id

DNS id of this query.

◆ query

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.

◆ query_hash

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.

◆ query_type

enum dns_query_type dns_resolve_context::dns_pending_query::query_type

Query type.

◆ timeout

k_timeout_t dns_resolve_context::dns_pending_query::timeout

TX timeout.

◆ timer

struct k_work_delayable dns_resolve_context::dns_pending_query::timer

Timeout timer.

◆ user_data

void* dns_resolve_context::dns_pending_query::user_data

User data.


The documentation for this struct was generated from the following file: