DNS Service Discovery Library Functions
DNSServiceResolve(3DNS_SD)
NAME
DNSServiceResolve - resolve service instances with DNS
SYNOPSIS
cc [ flag ... ] file ... -ldns_sd [ library ... ]
#include
DNSServiceErrorType DNSServiceResolve(DNSServiceRef *sdRef,
DNSServiceFlags flags, uint32_t interfaceIndex, const char *name,
const char *regtype, const char *domain, DNSServiceServiceResolveReply callBack, void *context);typedef void(*DNSServiceResolveReply)(DNSServiceRef sdRef,
DNSServiceFlags flags, uint32_t interfaceIndex,
DNSServiceErrorType errorCode, const char *fullname,const char *hosttarget, uint16_t port, uint16_t txtLen,
const char *txtRecord, void *context);DESCRIPTION
The DNSServiceResolve() function is used to resolve a ser-
vice name returned by DNSServiceBrowse() to host IP address,port number, and TXT record. The DNSServiceResolve() func-
tion returns results asynchronously. A DNSServiceResolve()
call to resolve service name can be ended by calling DNSSer-
viceRefDeallocate(). The callback argument points to a func-
tion of type DNSServiceResolveReply as listed above. The
callback function is invoked on finding a result or when theasynch resolve call fails. The sdRef argument to DNSServi-
ceResolve() points to an uninitialized DNSServiceRef. If thecall to DNSServiceResolve() succeeds, sdRef is initialized
and kDNSServiceErr_NoError is returned.
The flags argument to DNSServiceResolve() is currently
unused and reserved for future use. The interfaceIndex argu-
ment indicates the interface on which to resolve the ser-
vice. If the DNSServiceResolve() call is the result of an
earlier DNSServiceBrowse() operation, pass the interfaceIn-
dex to perform a resolve on all interfaces. See the section"Constants for specifying an interface index" in
for more details. The name parameter is the service instance name to be resolved, as returned from a DNSServiceBrowse() call. The regtype holds the service type and the domain parameter indicates the domain in which the service instance was found. The context parameter points to a value that is passed to the callback function.SunOS 5.11 Last change: 20 Aug 2007 1
DNS Service Discovery Library FunctionsDNSServiceResolve(3DNS_SD)
The sdRef argument passed to the callback function is ini-
tialized by DNSServiceResolve() call. The flags parameter in
the callback function is currently unused and reserved for future use. The errorCode parameter iskDNSServiceErr_NoError on success. Otherwise, it will hold
the error defined in
undefined when errorCode is nonzero. The fullname parameter in the callback holds the full service domain name in the formatand other parameters are . . . The full service domain name is escaped to follow standard DNS rules. The hosttarget parameter holds the target hostname of the machine providing the service. The port parameter indicates the port in network byte order on which the service accepts connections. The txtLen and txtRecord parameters hold the length and the TXT record of the service's primary TXT record. The context parameter points to the value that was passed as context to the DNSServiceResolve() call.
RETURN VALUES
The DNSServiceResolve function returns
kDNSServiceErr_NoError on success. Otherwise, an error code
defined in
is returned to indicate an error has occurred. When an error is returned by DNSServiceResolve,
the callback function is not invoked and the DNSServiceRef argument is not initialized.ATTRIBUTES
See attributes(5) for description of the following attri-
butes:____________________________________________________________
| ATTRIBUTE TYPE | ATTRIBUTE VALUE |
|_____________________________|_____________________________|
| Interface Stability | Committed ||_____________________________|_____________________________|
| MT-Level | Safe |
|_____________________________|_____________________________|
SEE ALSO
DNSServiceBrowse(3DNS_SD), DNSServiceRefDeallocate(3DNS_SD),
attributes(5)SunOS 5.11 Last change: 20 Aug 2007 2
DNS Service Discovery Library FunctionsDNSServiceResolve(3DNS_SD)
SunOS 5.11 Last change: 20 Aug 2007 3