1DNSServiceResolve(3DNDSN_SSDS)ervice Discovery Library FunDcNtSiSoenrsviceResolve(3DNS_SD)
2
3
4
6 DNSServiceResolve - resolve service instances with DNS
7
9 cc [ flag ... ] file ... -ldns_sd [ library ... ]
10 #include <dns_sd.h>
11
12 DNSServiceErrorType DNSServiceResolve(DNSServiceRef *sdRef,
13 DNSServiceFlags flags, uint32_t interfaceIndex, const char *name,
14 const char *regtype, const char *domain,
15 DNSServiceServiceResolveReply callBack, void *context);
16
17
18 typedef void(*DNSServiceResolveReply)(DNSServiceRef sdRef,
19 DNSServiceFlags flags, uint32_t interfaceIndex,
20 DNSServiceErrorType errorCode, const char *fullname,
21 const char *hosttarget, uint16_t port, uint16_t txtLen,
22 const char *txtRecord, void *context);
23
24
26 The DNSServiceResolve() function is used to resolve a service name
27 returned by DNSServiceBrowse() to host IP address, port number, and TXT
28 record. The DNSServiceResolve() function returns results asyn‐
29 chronously. A DNSServiceResolve() call to resolve service name can be
30 ended by calling DNSServiceRefDeallocate(). The callback argument
31 points to a function of type DNSServiceResolveReply as listed above.
32 The callback function is invoked on finding a result or when the asynch
33 resolve call fails. The sdRef argument to DNSServiceResolve() points to
34 an uninitialized DNSServiceRef. If the call to DNSServiceResolve() suc‐
35 ceeds, sdRef is initialized and kDNSServiceErr_NoError is returned.
36
37
38 The flags argument to DNSServiceResolve() is currently unused and
39 reserved for future use. The interfaceIndex argument indicates the
40 interface on which to resolve the service. If the DNSServiceResolve()
41 call is the result of an earlier DNSServiceBrowse() operation, pass the
42 interfaceIndex to perform a resolve on all interfaces. See the section
43 "Constants for specifying an interface index" in <dns_sd.h> for more
44 details. The name parameter is the service instance name to be
45 resolved, as returned from a DNSServiceBrowse() call. The regtype holds
46 the service type and the domain parameter indicates the domain in which
47 the service instance was found. The context parameter points to a value
48 that is passed to the callback function.
49
50
51 The sdRef argument passed to the callback function is initialized by
52 DNSServiceResolve() call. The flags parameter in the callback function
53 is currently unused and reserved for future use. The errorCode parame‐
54 ter is kDNSServiceErr_NoError on success. Otherwise, it will hold the
55 error defined in <dns_sd.h> and other parameters are undefined when
56 errorCode is nonzero. The fullname parameter in the callback holds the
57 full service domain name in the format <servicename>.<proto‐
58 col>.<domain>. The full service domain name is escaped to follow stan‐
59 dard DNS rules. The hosttarget parameter holds the target hostname of
60 the machine providing the service. The port parameter indicates the
61 port in network byte order on which the service accepts connections.
62 The txtLen and txtRecord parameters hold the length and the TXT record
63 of the service's primary TXT record. The context parameter points to
64 the value that was passed as context to the DNSServiceResolve() call.
65
67 The DNSServiceResolve function returns kDNSServiceErr_NoError on suc‐
68 cess. Otherwise, an error code defined in <dns_sd.h> is returned to
69 indicate an error has occurred. When an error is returned by DNSSer‐
70 viceResolve, the callback function is not invoked and the DNSServiceRef
71 argument is not initialized.
72
74 See attributes(5) for description of the following attributes:
75
76
77
78
79 ┌─────────────────────────────┬─────────────────────────────┐
80 │ ATTRIBUTE TYPE │ ATTRIBUTE VALUE │
81 ├─────────────────────────────┼─────────────────────────────┤
82 │Interface Stability │Committed │
83 ├─────────────────────────────┼─────────────────────────────┤
84 │MT-Level │Safe │
85 └─────────────────────────────┴─────────────────────────────┘
86
88 DNSServiceBrowse(3DNS_SD), DNSServiceRefDeallocate(3DNS_SD),
89 attributes(5)
90
91
92
93SunOS 5.11 20 Aug 2007 DNSServiceResolve(3DNS_SD)