DNS Service Discovery Library Functions
DNSServiceEnumerateDomains(3DNS_SD)
NAME
DNSServiceEnumerateDomains - enumerate recommended domains
SYNOPSIS
cc [ flag ... ] file ... -ldns_sd [ library ... ]
#include
DNSServiceErrorType DNSServiceEnumerateDomains(DNSServiceRef *sdRef,
DNSServiceFlags flags, uint32_t interfaceIndex,
DNSServiceDomainEnumReply callBack, void *context); typedef void(*DNSServiceDomainEnumReply)(DNSServiceRef sdRef,DNSServiceFlags flags, uint31_t interfaceIndex,
DNSServiceErrorType errorCode, const char *replyDomain, void *context);DESCRIPTION
The DNSServiceEnumerateDomains() function allows applica-
tions to determine recommended browsing and registration domains for performing service discovery DNS queries. The callback argument points to a function to be called toreturn results or if the asynchronous call to DNSServi-
ceEnumerateDomains() fails. The callback function should point to a function of type DNSServiceDomainEnumReply listed above. A pointer to an uninitialized DNSServiceRef, sdRef must bepassed to DNSServiceEnumerateDomains(). If the call
succeeds, sdRef is initialized and kDNSServiceErr_NoError is
returned. The enumeration call runs indefinitely until the client terminates the call. The enumeration call must be terminated by passing the DNSServiceRef initialized by the enumeration call to DNSServiceRefDeallocate() when no more domains are to be found.The value of flags is constructed by a bitwise-inclusive-OR
of the flags used in DNSService functions and defined inceEnumerateDomains() call are: kDNSServiceFlagsBrowseDomains
. Possible values for flags to the DNSServi- and kDNSServiceFlagsRegistrationDomains. The kDNSServi-
ceFlagsBrowseDomains value is passed to enumerate domainsrecommended for browsing. The kDNSServiceFlagsRegistration-
Domains value is passed to enumerate domains recommended forregistration. Possible values of flags returned in the call-
back function are: kDNSServiceFlagsMoreComing, kDNSServi-
ceFlagsAdd, and kDNSServiceFlagsDefault.SunOS 5.11 Last change: 20 Aug 2007 1
DNS Service Discovery Library FunctionsDNSServiceEnumerateDomains(3DNS_SD)
The interfaceIndex parameter to the enumeration call speci-
fies the interface index searched for domains. Most applica-
tions pass 0 to enumerate domains on all interfaces. See the section "Constants for specifying an interface index" inNULL and is passed to the enumeration callback function. The interfaceIndex value passed to the callback specifies the interface on which the domain exists.
for more details. The context parameter can be RETURN VALUES
The DNSServiceEnumerateDomains() function returns
kDNSServiceErr_NoError on success. Otherwise, the function
returns an error code defined in
not invoked on error and the DNSServiceRef that is passed is. The callback is not initialized. Upon a successful call to DNSServi-
ceEnumerateDomains(), subsequent asynchronous errors are delivered to the callback.ATTRIBUTES
See attributes(5) for description of the following attri-
butes:____________________________________________________________
| ATTRIBUTE TYPE | ATTRIBUTE VALUE |
|_____________________________|_____________________________|
| Interface Stability | Committed ||_____________________________|_____________________________|
| MT-Level | Safe |
|_____________________________|_____________________________|
SEE ALSO
DNSServiceRefDeallocate(3DNS_SD), attributes(5)
SunOS 5.11 Last change: 20 Aug 2007 2
DNS Service Discovery Library FunctionsDNSServiceEnumerateDomains(3DNS_SD)
SunOS 5.11 Last change: 20 Aug 2007 3