Language
- Objective-C
Language
DNSServiceGetPropertyGets the specified property of a service.
DNSServiceProcessResultReads a reply from the daemon, calling the appropriate application callback.
DNSServiceRefDeallocateTerminates a connection with the daemon and frees memory associated with the DNSServiceRef.
DNSServiceRefSockFDAccesses underlying Unix domain socket for an initialized DNSServiceRef.
DNSServiceGetAddrInfoQueries for the IP address of a hostname by using either Multicast or Unicast DNS.
A typical calling sequence for TXT record parsing is something like:
Receive TXT record data in DNSServiceResolve callback
if (TXTRecordContainsKey(txtLen, txtRecord, "key")) then do something
val1ptr = TXTRecordGetValuePtr(txtLen, txtRecord, "key1", &len1);
val2ptr = TXTRecordGetValuePtr(txtLen, txtRecord, "key2", &len2);
...
memcpy(myval1, val1ptr, len1);
memcpy(myval2, val2ptr, len2);
...
return;
If you wish to retain the values after return from the DNSServiceResolve callback, then you need to copy the data to your own storage using memcpy() or similar, as shown in the example above.
If for some reason you need to parse a TXT record you built yourself using the TXT record construction functions above, then you can do that using TXTRecordGetLength and TXTRecordGetBytesPtr calls: TXTRecordGetValue(TXTRecordGetLength(x), TXTRecordGetBytesPtr(x), key, &len);
Most applications only fetch keys they know about from a TXT record and ignore the rest. However, some debugging tools wish to fetch and display all keys. To do that, use the TXTRecordGetCount() and TXTRecordGetItemAtIndex() calls.
DNSServiceCreateDelegateConnectionCreate a delegate connection to the daemon allowing efficient registration of multiple individual records.
DNSServiceSetDispatchQueueAllows you to schedule a DNSServiceRef on a serial dispatch queue for receiving asynchronous callbacks.
TXTRecordContainsKeyAllows you to determine if a given TXT Record contains a specified key.
TXTRecordGetCountReturns the number of keys stored in the TXT Record.
TXTRecordGetItemAtIndexAllows you to retrieve a key name and value pointer, given an index into a TXT Record.
TXTRecordGetValuePtrAllows you to retrieve the value for a given key from a TXT Record.
TXTRecordCreateCreates a new empty TXTRecordRef referencing the specified storage.
TXTRecordDeallocateReleases resources associated with a TXT record.
TXTRecordGetBytesPtrAllows you to retrieve a pointer to the raw bytes within a TXTRecordRef.
TXTRecordGetLengthAllows you to determine the length of the raw bytes within a TXTRecordRef.
TXTRecordRemoveValueRemoves a key from a TXTRecordRef.
TXTRecordSetValueAdds a key (optionally with value) to a TXTRecordRef.
DNSServiceCreateConnection, DNSServiceRegisterRecord, DNSServiceReconfirmRecord (most applications will not use these)
DNSServiceCreateConnectionCreates a connection to the daemon, allowing efficient registration of multiple individual records.
DNSServiceReconfirmRecordInstructs the daemon to verify the validity of a resource record that appears to be out of date (for example, because TCP connection to a service's target failed).
DNSServiceRegisterRecordRegisters an individual resource record on a connected DNSServiceRef.
PeerConnectionReleaseReleases P2P connection resources associated with the service instance.
DNSServiceAddRecordAdds a record to a registered service.
DNSServiceRegisterRegisters a service.
DNSServiceRemoveRecordRemoves a record previously added to a service record set via DNSServiceAddRecord, or deregister an record registered individually via DNSServiceRegisterRecord.
DNSServiceUpdateRecordUpdates a registered resource record.
DNSServiceBrowseBrowses for available services.
DNSServiceQueryRecordQuery for an arbitrary DNS record.
DNSServiceNATPortMappingCreateRequests a port mapping in the NAT gateway, which maps a port on the local machine to an external port on the NAT.
DNSServiceConstructFullNameConcatenates a three-part domain name (as returned by the above callbacks) into a properly-escaped full domain name.
DNSServiceEnumerateDomainsEnumerates domains that are recommended for registration and browsing.
See the Overview section above for header-level documentation.
DNSServiceCreateConnection, DNSServiceRegisterRecord, DNSServiceReconfirmRecord (most applications will not use these)
DNSServiceGetAddrInfoReplyCallback for handling the results of a previous call to DNSServiceGetAddrInfo.
DNSServiceRegisterRecordReplyCallback for handling the results of a previous call to DNSServiceRegisterRecord.
DNSServiceRegisterReplyHandler for the results from a previous call to DNSServiceRegister.
DNSServiceBrowseReplyCallback for handling the results of previous calls to DNSServiceBrowse.
DNSServiceQueryRecordReplyCallback for handling the results of a previous call to DNSServiceQueryRecord.
DNSServiceNATPortMappingReplyCallback for handling the reply from a previous call to DNSServiceNATPortMappingReply.
DNSServiceDomainEnumReplyCallback for handling the results of a previous call to DNSServiceEnumerateDomains.
See the Overview section above for header-level documentation.
TXTRecordRefOpaque internal data type that represents a DNS-SD TXT record.
See the Overview section above for header-level documentation.