DNS-SD Server
This module includes APIs for DNS-SD server.
Summary
| Enumerations | |
|---|---|
| otDnssdQueryType{ | enum Specifies a DNS-SD query type.  | 
| Typedefs | |
|---|---|
| otDnssdCounters | typedef struct otDnssdCountersContains the counters of DNS-SD server.  | 
| otDnssdHostInfo | typedef struct otDnssdHostInfoRepresents information of a discovered host for a DNS-SD query.  | 
| otDnssdQuery | typedef voidThis opaque type represents a DNS-SD query.  | 
| otDnssdQuerySubscribeCallback)(void *aContext, const char *aFullName) | typedef void(*Is called when a DNS-SD query subscribes one of:  | 
| otDnssdQueryUnsubscribeCallback)(void *aContext, const char *aFullName) | typedef void(*Is called when a DNS-SD query unsubscribes one of:  | 
| otDnssdServiceInstanceInfo | typedef struct otDnssdServiceInstanceInfoRepresents information of a discovered service instance for a DNS-SD query.  | 
| otUpstreamDnsCounters | typedef struct otUpstreamDnsCountersRepresents the count of queries, responses, failures handled by upstream DNS server.  | 
| Functions | |
|---|---|
| otDnssdGetCounters(otInstance *aInstance) | const otDnssdCounters *Returns the counters of the DNS-SD server.  | 
| otDnssdGetNextQuery(otInstance *aInstance, const otDnssdQuery *aQuery) | const otDnssdQuery *Acquires the next query in the DNS-SD server.  | 
| otDnssdGetQueryTypeAndName(const otDnssdQuery *aQuery, char(*) aNameOutput[OT_DNS_MAX_NAME_SIZE]) | Acquires the DNS-SD query type and name for a specific query.  | 
| otDnssdQueryHandleDiscoveredHost(otInstance *aInstance, const char *aHostFullName, otDnssdHostInfo *aHostInfo) | voidNotifies a discovered host.  | 
| otDnssdQueryHandleDiscoveredServiceInstance(otInstance *aInstance, const char *aServiceFullName, otDnssdServiceInstanceInfo *aInstanceInfo) | voidNotifies a discovered service instance.  | 
| otDnssdQuerySetCallbacks(otInstance *aInstance, otDnssdQuerySubscribeCallback aSubscribe, otDnssdQueryUnsubscribeCallback aUnsubscribe, void *aContext) | voidSets DNS-SD server query callbacks.  | 
| otDnssdUpstreamQueryIsEnabled(otInstance *aInstance) | boolReturns whether the DNSSD server will forward DNS queries to the platform DNS upstream API.  | 
| otDnssdUpstreamQuerySetEnabled(otInstance *aInstance, bool aEnabled) | voidEnable or disable forwarding DNS queries to platform DNS upstream API.  | 
| Structs | |
|---|---|
| otDnssdCounters | Contains the counters of DNS-SD server. | 
| otDnssdHostInfo | Represents information of a discovered host for a DNS-SD query. | 
| otDnssdServiceInstanceInfo | Represents information of a discovered service instance for a DNS-SD query. | 
| otUpstreamDnsCounters | Represents the count of queries, responses, failures handled by upstream DNS server. | 
Enumerations
otDnssdQueryType
otDnssdQueryType
Typedefs
otDnssdHostInfo
struct otDnssdHostInfo otDnssdHostInfo
Represents information of a discovered host for a DNS-SD query.
otDnssdQuery
void otDnssdQuery
This opaque type represents a DNS-SD query.
otDnssdQuerySubscribeCallback
void(* otDnssdQuerySubscribeCallback)(void *aContext, const char *aFullName)
Is called when a DNS-SD query subscribes one of:
- a service name.
- a service instance name.
- a host name.
The DNS-SD query implementation is responsible for identifying what aFullName is. If aFullName is a service name or service instance name, the DNS-SD query implementation should discover corresponding service instance information and notify the DNS-SD server using otDnssdQueryHandleDiscoveredServiceInstance. If aFullName is a host name, the DNS-SD query implementation should discover the host information and notify the DNS-SD server using otDnssdQueryHandleDiscoveredHost.
| Details | |||||
|---|---|---|---|---|---|
| Parameters | 
 | 
otDnssdQueryHandleDiscoveredServiceInstance
otDnssdQueryHandleDiscoveredHost
otDnssdQueryUnsubscribeCallback
void(* otDnssdQueryUnsubscribeCallback)(void *aContext, const char *aFullName)
Is called when a DNS-SD query unsubscribes one of:
- a service name.
- a service instance name.
- a host name.
The DNS-SD query implementation is responsible for identifying what aFullName is.
| Details | |||||
|---|---|---|---|---|---|
| Parameters | 
 | 
otDnssdServiceInstanceInfo
struct otDnssdServiceInstanceInfo otDnssdServiceInstanceInfo
Represents information of a discovered service instance for a DNS-SD query.
otUpstreamDnsCounters
struct otUpstreamDnsCounters otUpstreamDnsCounters
Represents the count of queries, responses, failures handled by upstream DNS server.
Requires OPENTHREAD_CONFIG_DNS_UPSTREAM_QUERY_ENABLE. 
Functions
otDnssdGetCounters
const otDnssdCounters * otDnssdGetCounters( otInstance *aInstance )
Returns the counters of the DNS-SD server.
| Details | |||
|---|---|---|---|
| Parameters | 
 | ||
| Returns | A pointer to the counters of the DNS-SD server.  | 
otDnssdGetNextQuery
const otDnssdQuery * otDnssdGetNextQuery( otInstance *aInstance, const otDnssdQuery *aQuery )
Acquires the next query in the DNS-SD server.
| Details | |||||
|---|---|---|---|---|---|
| Parameters | 
 | ||||
| Returns | A pointer to the query or NULL if no more queries.  | 
otDnssdGetQueryTypeAndName
otDnssdQueryType otDnssdGetQueryTypeAndName( const otDnssdQuery *aQuery, char(*) aNameOutput[OT_DNS_MAX_NAME_SIZE] )
Acquires the DNS-SD query type and name for a specific query.
| Details | |||||
|---|---|---|---|---|---|
| Parameters | 
 | ||||
| Returns | The DNS-SD query type.  | 
otDnssdQueryHandleDiscoveredHost
void otDnssdQueryHandleDiscoveredHost( otInstance *aInstance, const char *aHostFullName, otDnssdHostInfo *aHostInfo )
Notifies a discovered host.
The external query resolver (e.g. Discovery Proxy) should call this function to notify OpenThread core of the subscribed hosts.
| Details | |||||||
|---|---|---|---|---|---|---|---|
| Parameters | 
 | 
otDnssdQueryHandleDiscoveredServiceInstance
void otDnssdQueryHandleDiscoveredServiceInstance( otInstance *aInstance, const char *aServiceFullName, otDnssdServiceInstanceInfo *aInstanceInfo )
Notifies a discovered service instance.
The external query resolver (e.g. Discovery Proxy) should call this function to notify OpenThread core of the subscribed services or service instances.
| Details | |||||||
|---|---|---|---|---|---|---|---|
| Parameters | 
 | 
otDnssdQuerySetCallbacks
void otDnssdQuerySetCallbacks( otInstance *aInstance, otDnssdQuerySubscribeCallback aSubscribe, otDnssdQueryUnsubscribeCallback aUnsubscribe, void *aContext )
Sets DNS-SD server query callbacks.
The DNS-SD server calls aSubscribe to subscribe to a service or service instance to resolve a DNS-SD query and aUnsubscribe to unsubscribe when the query is resolved or timeout.
| Details | |||||||||
|---|---|---|---|---|---|---|---|---|---|
| Parameters | 
 | 
otDnssdUpstreamQueryIsEnabled
bool otDnssdUpstreamQueryIsEnabled( otInstance *aInstance )
Returns whether the DNSSD server will forward DNS queries to the platform DNS upstream API.
Available when OPENTHREAD_CONFIG_DNS_UPSTREAM_QUERY_ENABLE is enabled.
| Details | |||||
|---|---|---|---|---|---|
| Parameters | 
 | ||||
| Return Values | 
 | 
otDnssdUpstreamQuerySetEnabled
otDnssdUpstreamQuerySetEnabled
void otDnssdUpstreamQuerySetEnabled( otInstance *aInstance, bool aEnabled )
Enable or disable forwarding DNS queries to platform DNS upstream API.
Available when OPENTHREAD_CONFIG_DNS_UPSTREAM_QUERY_ENABLE is enabled.
| Details | |||||
|---|---|---|---|---|---|
| Parameters | 
 | 
otPlatDnsStartUpstreamQuery
otPlatDnsCancelUpstreamQuery
otPlatDnsUpstreamQueryDone
Resources
OpenThread API Reference topics originate from the source code, available on GitHub. For more information, or to contribute to our documentation, refer to Resources.