dnsserviceenumeratedomains(3dnssd) [opensolaris man page]
DNSServiceEnumerateDomains(3DNS_SD) DNS Service Discovery Library Functions DNSServiceEnumerateDomains(3DNS_SD)NAME
DNSServiceEnumerateDomains - enumerate recommended domains
SYNOPSIS
cc [ flag ... ] file ... -ldns_sd [ library ... ]
#include <dns_sd.h>
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 applications to determine recommended browsing and registration domains for performing
service discovery DNS queries. The callback argument points to a function to be called to return results or if the asynchronous call to
DNSServiceEnumerateDomains() fails. The callback function should point to a function of type DNSServiceDomainEnumReply listed above.
A pointer to an uninitialized DNSServiceRef, sdRef must be passed to DNSServiceEnumerateDomains(). If the call succeeds, sdRef is initial-
ized 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 in <dns_sd.h>. Possible
values for flags to the DNSServiceEnumerateDomains() call are: kDNSServiceFlagsBrowseDomains and kDNSServiceFlagsRegistrationDomains. The
kDNSServiceFlagsBrowseDomains value is passed to enumerate domains recommended for browsing. The kDNSServiceFlagsRegistrationDomains value
is passed to enumerate domains recommended for registration. Possible values of flags returned in the callback function are: kDNSService-
FlagsMoreComing, kDNSServiceFlagsAdd, and kDNSServiceFlagsDefault.
The interfaceIndex parameter to the enumeration call specifies the interface index searched for domains. Most applications pass 0 to enu-
merate domains on all interfaces. See the section "Constants for specifying an interface index" in <dns_sd.h> for more details. The context
parameter can be NULL and is passed to the enumeration callback function. The interfaceIndex value passed to the callback specifies the
interface on which the domain exists.
RETURN VALUES
The DNSServiceEnumerateDomains() function returns kDNSServiceErr_NoError on success. Otherwise, the function returns an error code defined
in <dns_sd.h>. The callback is not invoked on error and the DNSServiceRef that is passed is not initialized. Upon a successful call to
DNSServiceEnumerateDomains(), subsequent asynchronous errors are delivered to the callback.
ATTRIBUTES
See attributes(5) for description of the following attributes:
+-----------------------------+-----------------------------+
| ATTRIBUTE TYPE | ATTRIBUTE VALUE |
+-----------------------------+-----------------------------+
|Interface Stability |Committed |
+-----------------------------+-----------------------------+
|MT-Level |Safe |
+-----------------------------+-----------------------------+
SEE ALSO DNSServiceRefDeallocate(3DNS_SD), attributes(5)SunOS 5.11 20 Aug 2007 DNSServiceEnumerateDomains(3DNS_SD)
Check Out this Related Man Page
DNSServiceCreateConnection(3DNS_SD) DNS Service Discovery Library Functions DNSServiceCreateConnection(3DNS_SD)NAME
DNSServiceCreateConnection, DNSServiceRegisterRecord, DNSServiceAddRecord, DNSServiceUpdateRecord, DNSServiceRemoveRecord - registering
multiple records
SYNOPSIS
cc [ flag ... ] file ... -ldns_sd [ library ... ]
#include <dns_sd.h>
DNSServiceErrorType DNSServiceCreateConnection(DNSServiceRef *sdRef);
DNSServiceErrorType DNSServiceRegisterRecord(DNSServiceRef sdRef,
DNSRecordRef *RecordRef, DNSServiceFlags flags,
uint32_t interfaceIndex, const char *fullname,
uint16_t rrtype, uint16_t rrclass, uint16_t rdlen,
const void *rdata, uint32_t ttl,
DNSServiceServiceRegisterRecordReply callBack,
void *context);
typedef void(*DNSServiceRegisterRecordReply)(DNSServiceRef sdRef,
DNSServiceRecordRef RecordRef, DNSServiceFlags flags,
DNSServiceErrorType errorCode, void *context);
DNSServiceErrorType DNSServiceAddRecord(DNSServiceRef sdRef,
DNSRecordRef *RecordRef, DNSServiceFlags flags,
uint16_t rrtype, uint16_t rdlen, const void *rdata,
uint32_t ttl);
DNSServiceErrorType DNSServiceUpdateRecord(DNSServiceRef sdRef,
DNSRecordRef RecordRef, DNSServiceFlags flags,
uint16_t rdlen, const void *rdata,
uint32_t ttl);
DNSServiceErrorType DNSServiceRemoveRecord(DNSServiceRef sdRef,
DNSRecordRef RecordRef, DNSServiceFlags flags);
DESCRIPTION
The DNSServiceCreateConnection() function allows the creation of a connection to the mDNS daemon in order to register multiple individual
records.
The DNSServiceRegisterRecord() function uses the connection created by DNSServiceCreateConnection() to register a record. Name conflicts
that occur from this function should be handled by the client in the callback.
The DNSServiceAddRecord() call adds a DNS record to a registered service. The name of the record is the same as registered service name.
The RecordRef argument to DNSServiceAddRecord() points to an uninitialized DNSRecordRef. After successful completion of DNSServiceAd-
dRecord(), the DNS record can be updated or deregistered by passing the DNSRecordRef initialized by DNSServiceAddRecord() to DNSServiceUp-
dateRecord() or to DNSServiceRemoveRecord().
The DNSServiceUpdateRecords() call updates the DNS record of the registered service. The DNS record must be the primary resource record
registered using DNSServiceRegister() or a record added to a registered service using DNSServiceAddRecord() or an individual record added
via DNSServiceRegisterRecord().
The DNSServiceRemoveRecord() call removes a record that was added using DNSServiceAddRecord() or DNSServiceRegisterRecord().
The sdRef argument points to DNSServiceRef initialized from a call to DNSServiceRegister(). If the sdRef argument is passed to DNSSer-
viceRefDeallocate() and the service is deregistered DNS records added via DNSServiceAddRecord() are invalidated and cannot be further used.
The flags argument is currently ignored and reserved for future use. The rrtype parameter value indicates the type of the DNS record. Suit-
able values for the rrtype parameter are defined in <dns_sd.h>: kDNSServiceType_TXT, for example. The rdata argument points to the raw
rdata to be contained in the resource record. The ttl value indicates the time to live of the resource record in seconds. A ttl value of 0
should be passed to use a default value.
RETURN VALUES
The DNSServiceCreateConnection function returns kDNSServiceErr_NoError on success. Otherwise, an error code defined in <dns_sd.h> is
returned to indicate the specific failure that occurred.
ATTRIBUTES
See attributes(5) for description of the following attributes:
+-----------------------------+-----------------------------+
| ATTRIBUTE TYPE | ATTRIBUTE VALUE |
+-----------------------------+-----------------------------+
|Interface Stability |Committed |
+-----------------------------+-----------------------------+
|MT-Level |Safe |
+-----------------------------+-----------------------------+
SEE ALSO DNSServiceRefDeallocate(3DNS_SD), DNSServiceRegister(3DNS_SD), attributes(5)SunOS 5.11 20 Aug 2007 DNSServiceCreateConnection(3DNS_SD)