Framework
- dnssd
Framework
DNSService Get PropertyGets the specified property of a service.
DNSService Process ResultReads a reply from the daemon, calling the appropriate application callback.
DNSService Ref DeallocateTerminates a connection with the daemon and frees memory associated with the DNSServiceRef.
DNSService Ref Sock FDAccesses underlying Unix domain socket for an initialized DNSServiceRef.
DNSService Get Addr InfoQueries 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 DNSService 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 DNSService 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.
DNSService Create Delegate ConnectionCreate a delegate connection to the daemon allowing efficient registration of multiple individual records.
DNSService Set Dispatch QueueAllows you to schedule a DNSServiceRef on a serial dispatch queue for receiving asynchronous callbacks.
TXTRecord Contains KeyAllows you to determine if a given TXT Record contains a specified key.
TXTRecord Get CountReturns the number of keys stored in the TXT Record.
TXTRecord Get Item At IndexAllows you to retrieve a key name and value pointer, given an index into a TXT Record.
TXTRecord Get Value PtrAllows you to retrieve the value for a given key from a TXT Record.
TXTRecord CreateCreates a new empty TXTRecordRef referencing the specified storage.
TXTRecord DeallocateReleases resources associated with a TXT record.
TXTRecord Get Bytes PtrAllows you to retrieve a pointer to the raw bytes within a TXTRecordRef.
TXTRecord Get LengthAllows you to determine the length of the raw bytes within a TXTRecordRef.
TXTRecord Remove ValueRemoves a key from a TXTRecordRef.
TXTRecord Set ValueAdds a key (optionally with value) to a TXTRecordRef.
DNSService, DNSService, DNSService (most applications will not use these)
DNSService Create ConnectionCreates a connection to the daemon, allowing efficient registration of multiple individual records.
DNSService Reconfirm RecordInstructs 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).
DNSService Register RecordRegisters an individual resource record on a connected DNSServiceRef.
Peer Connection ReleaseReleases P2P connection resources associated with the service instance.
DNSService Add RecordAdds a record to a registered service.
DNSService RegisterRegisters a service.
DNSService Remove RecordRemoves a record previously added to a service record set via DNSService, or deregister an record registered individually via DNSService.
DNSService Update RecordUpdates a registered resource record.
DNSService BrowseBrowses for available services.
DNSService Query RecordQuery for an arbitrary DNS record.
DNSService NATPort Mapping CreateRequests a port mapping in the NAT gateway, which maps a port on the local machine to an external port on the NAT.
DNSService Construct Full NameConcatenates a three-part domain name (as returned by the above callbacks) into a properly-escaped full domain name.
DNSService Enumerate DomainsEnumerates domains that are recommended for registration and browsing.
See the Overview section above for header-level documentation.
DNSService, DNSService, DNSService (most applications will not use these)
DNSService Get Addr Info ReplyCallback for handling the results of a previous call to DNSService.
DNSService Register Record ReplyCallback for handling the results of a previous call to DNSService.
DNSService Register ReplyHandler for the results from a previous call to DNSService.
DNSService Browse ReplyCallback for handling the results of previous calls to DNSServiceBrowse.
DNSService Query Record ReplyCallback for handling the results of a previous call to DNSService.
DNSService NATPort Mapping ReplyCallback for handling the reply from a previous call to DNSService.
DNSService Domain Enum ReplyCallback for handling the results of a previous call to DNSService.
See the Overview section above for header-level documentation.
TXTRecord RefOpaque internal data type that represents a DNS-SD TXT record.
See the Overview section above for header-level documentation.