DNS-SD Server
This module includes APIs for DNS-SD server.
Classes |
|
| struct | otDnssdServiceInstanceInfo |
|
This structure represents information of a discovered service instance for a DNS-SD query.
|
|
| struct | otDnssdHostInfo |
|
This structure represents information of a discovered host for a DNS-SD query.
|
|
| struct | otDnssdCounters |
|
This structure contains the counters of DNS-SD server.
|
|
Typedefs |
|
| typedef void(* | otDnssdQuerySubscribeCallback ) (void *aContext, const char *aFullName) |
|
This function is called when a DNS-SD query subscribes one of:
|
|
| typedef void(* | otDnssdQueryUnsubscribeCallback ) (void *aContext, const char *aFullName) |
|
This function is called when a DNS-SD query unsubscribes one of:
|
|
| typedef void | otDnssdQuery |
|
This opaque type represents a DNS-SD query.
|
|
| typedef struct otDnssdServiceInstanceInfo | otDnssdServiceInstanceInfo |
|
This structure represents information of a discovered service instance for a DNS-SD query.
|
|
| typedef struct otDnssdHostInfo | otDnssdHostInfo |
|
This structure represents information of a discovered host for a DNS-SD query.
|
|
| typedef struct otDnssdCounters | otDnssdCounters |
|
This structure contains the counters of DNS-SD server.
|
|
Enumerations |
|
| enum |
otDnssdQueryType
{
OT_DNSSD_QUERY_TYPE_NONE = 0, OT_DNSSD_QUERY_TYPE_BROWSE = 1, OT_DNSSD_QUERY_TYPE_RESOLVE = 2, OT_DNSSD_QUERY_TYPE_RESOLVE_HOST = 3 } |
|
This enumeration specifies a DNS-SD query type.
|
|
Functions |
|
| void | otDnssdQuerySetCallbacks ( otInstance *aInstance, otDnssdQuerySubscribeCallback aSubscribe, otDnssdQueryUnsubscribeCallback aUnsubscribe, void *aContext) |
|
This function sets DNS-SD server query callbacks.
|
|
| void | otDnssdQueryHandleDiscoveredServiceInstance ( otInstance *aInstance, const char *aServiceFullName, otDnssdServiceInstanceInfo *aInstanceInfo) |
|
This function notifies a discovered service instance.
|
|
| void | otDnssdQueryHandleDiscoveredHost ( otInstance *aInstance, const char *aHostFullName, otDnssdHostInfo *aHostInfo) |
|
This function notifies a discovered host.
|
|
| const otDnssdQuery * | otDnssdGetNextQuery ( otInstance *aInstance, const otDnssdQuery *aQuery) |
|
This function acquires the next query in the DNS-SD server.
|
|
| otDnssdQueryType | otDnssdGetQueryTypeAndName (const otDnssdQuery *aQuery, char(*aNameOutput)[ OT_DNS_MAX_NAME_SIZE ]) |
|
This function acquires the DNS-SD query type and name for a specific query.
|
|
| const otDnssdCounters * | otDnssdGetCounters ( otInstance *aInstance) |
|
This function returns the counters of the DNS-SD server.
|
|
Detailed Description
This module includes APIs for DNS-SD server.
Typedef Documentation
◆ otDnssdQuerySubscribeCallback
| typedef void(* otDnssdQuerySubscribeCallback) (void *aContext, const char *aFullName) |
This function 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
.
- Note
-
There can be multiple subscription to the same name. DNS-SD query implementation should record the number of active subscriptions and stop notifying when there is no active subscription for
aFullName.
- Parameters
-
[in] aContextA pointer to the application-specific context. [in] aFullNameThe null-terminated full service name (e.g. "_ipps._tcp.default.service.arpa."), or full service instance name (e.g. "OpenThread._ipps._tcp.default.service.arpa."), or full host name (e.g. "ot-host.default.service.arpa.").
◆ otDnssdQueryUnsubscribeCallback
| typedef void(* otDnssdQueryUnsubscribeCallback) (void *aContext, const char *aFullName) |
This function 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.
- Note
-
There can be multiple subscription to the same name. DNS-SD query implementation should record the number of active subscriptions and stop notifying when there is no active subscription for
aFullName.
- Parameters
-
[in] aContextA pointer to the application-specific context. [in] aFullNameThe null-terminated full service name (e.g. "_ipps._tcp.default.service.arpa."), or full service instance name (e.g. "OpenThread._ipps._tcp.default.service.arpa.").
Enumeration Type Documentation
◆ otDnssdQueryType
| enum otDnssdQueryType |
Function Documentation
◆ otDnssdGetCounters()
| const otDnssdCounters * otDnssdGetCounters | ( | otInstance * |
aInstance
|
) |
This function returns the counters of the DNS-SD server.
- Parameters
-
[in] aInstanceThe OpenThread instance structure.
- Returns
- A pointer to the counters of the DNS-SD server.
◆ otDnssdGetNextQuery()
| const otDnssdQuery * otDnssdGetNextQuery | ( | otInstance * |
aInstance,
|
| const otDnssdQuery * |
aQuery
|
||
| ) |
This function acquires the next query in the DNS-SD server.
- Parameters
-
[in] aInstanceThe OpenThread instance structure. [in] aQueryThe query pointer. Pass NULL to get the first query.
- 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]
|
||
| ) |
This function acquires the DNS-SD query type and name for a specific query.
- Parameters
-
[in] aQueryThe query pointer acquired from otDnssdGetNextQuery.[out] aNameOutputThe name output buffer, which should be OT_DNS_MAX_NAME_SIZEbytes long.
- Returns
- The DNS-SD query type.
◆ otDnssdQueryHandleDiscoveredHost()
| void otDnssdQueryHandleDiscoveredHost | ( | otInstance * |
aInstance,
|
| const char * |
aHostFullName,
|
||
| otDnssdHostInfo * |
aHostInfo
|
||
| ) |
This function notifies a discovered host.
The external query resolver (e.g. Discovery Proxy) should call this function to notify OpenThread core of the subscribed hosts.
- Note
-
aHostInfomust not contain unspecified or link-local or loop-back or multicast IP addresses.
- Parameters
-
[in] aInstanceThe OpenThread instance structure. [in] aHostFullNameThe null-terminated full host name. [in] aHostInfoA pointer to the discovered service instance information.
◆ otDnssdQueryHandleDiscoveredServiceInstance()
| void otDnssdQueryHandleDiscoveredServiceInstance | ( | otInstance * |
aInstance,
|
| const char * |
aServiceFullName,
|
||
| otDnssdServiceInstanceInfo * |
aInstanceInfo
|
||
| ) |
This function 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.
- Note
-
aInstanceInfomust not contain unspecified or link-local or loop-back or multicast IP addresses.
- Parameters
-
[in] aInstanceThe OpenThread instance structure. [in] aServiceFullNameThe null-terminated full service name. [in] aInstanceInfoA pointer to the discovered service instance information.
◆ otDnssdQuerySetCallbacks()
| void otDnssdQuerySetCallbacks | ( | otInstance * |
aInstance,
|
| otDnssdQuerySubscribeCallback |
aSubscribe,
|
||
| otDnssdQueryUnsubscribeCallback |
aUnsubscribe,
|
||
| void * |
aContext
|
||
| ) |
This function 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.
- Note
-
aSubscribeandaUnsubscribemust be both set or unset.
- Parameters
-
[in] aInstanceThe OpenThread instance structure. [in] aSubscribeA pointer to the callback function to subscribe a service or service instance. [in] aUnsubscribeA pointer to the callback function to unsubscribe a service or service instance. [in] aContextA pointer to the application-specific context.