1DNSServiceCreateConneDcNtSioSne(r3vDiNcSe_SDDi)scovery LiDbNrSaSreyrvFiucnecCtrieoantseConnection(3DNS_SD)
2
3
4
6 DNSServiceCreateConnection, DNSServiceRegisterRecord, DNSServiceAd‐
7 dRecord, DNSServiceUpdateRecord, DNSServiceRemoveRecord - registering
8 multiple records
9
11 cc [ flag ... ] file ... -ldns_sd [ library ... ]
12 #include <dns_sd.h>
13
14 DNSServiceErrorType DNSServiceCreateConnection(DNSServiceRef *sdRef);
15
16
17 DNSServiceErrorType DNSServiceRegisterRecord(DNSServiceRef sdRef,
18 DNSRecordRef *RecordRef, DNSServiceFlags flags,
19 uint32_t interfaceIndex, const char *fullname,
20 uint16_t rrtype, uint16_t rrclass, uint16_t rdlen,
21 const void *rdata, uint32_t ttl,
22 DNSServiceServiceRegisterRecordReply callBack,
23 void *context);
24
25
26 typedef void(*DNSServiceRegisterRecordReply)(DNSServiceRef sdRef,
27 DNSServiceRecordRef RecordRef, DNSServiceFlags flags,
28 DNSServiceErrorType errorCode, void *context);
29
30
31 DNSServiceErrorType DNSServiceAddRecord(DNSServiceRef sdRef,
32 DNSRecordRef *RecordRef, DNSServiceFlags flags,
33 uint16_t rrtype, uint16_t rdlen, const void *rdata,
34 uint32_t ttl);
35
36
37 DNSServiceErrorType DNSServiceUpdateRecord(DNSServiceRef sdRef,
38 DNSRecordRef RecordRef, DNSServiceFlags flags,
39 uint16_t rdlen, const void *rdata,
40 uint32_t ttl);
41
42
43 DNSServiceErrorType DNSServiceRemoveRecord(DNSServiceRef sdRef,
44 DNSRecordRef RecordRef, DNSServiceFlags flags);
45
46
48 The DNSServiceCreateConnection() function allows the creation of a con‐
49 nection to the mDNS daemon in order to register multiple individual
50 records.
51
52
53 The DNSServiceRegisterRecord() function uses the connection created by
54 DNSServiceCreateConnection() to register a record. Name conflicts that
55 occur from this function should be handled by the client in the call‐
56 back.
57
58
59 The DNSServiceAddRecord() call adds a DNS record to a registered ser‐
60 vice. The name of the record is the same as registered service name.
61 The RecordRef argument to DNSServiceAddRecord() points to an uninitial‐
62 ized DNSRecordRef. After successful completion of DNSServiceAd‐
63 dRecord(), the DNS record can be updated or deregistered by passing the
64 DNSRecordRef initialized by DNSServiceAddRecord() to DNSServiceUp‐
65 dateRecord() or to DNSServiceRemoveRecord().
66
67
68 The DNSServiceUpdateRecords() call updates the DNS record of the regis‐
69 tered service. The DNS record must be the primary resource record reg‐
70 istered using DNSServiceRegister() or a record added to a registered
71 service using DNSServiceAddRecord() or an individual record added via
72 DNSServiceRegisterRecord().
73
74
75 The DNSServiceRemoveRecord() call removes a record that was added using
76 DNSServiceAddRecord() or DNSServiceRegisterRecord().
77
78
79 The sdRef argument points to DNSServiceRef initialized from a call to
80 DNSServiceRegister(). If the sdRef argument is passed to DNSSer‐
81 viceRefDeallocate() and the service is deregistered DNS records added
82 via DNSServiceAddRecord() are invalidated and cannot be further used.
83 The flags argument is currently ignored and reserved for future use.
84 The rrtype parameter value indicates the type of the DNS record. Suit‐
85 able values for the rrtype parameter are defined in <dns_sd.h>:
86 kDNSServiceType_TXT, for example. The rdata argument points to the raw
87 rdata to be contained in the resource record. The ttl value indicates
88 the time to live of the resource record in seconds. A ttl value of 0
89 should be passed to use a default value.
90
92 The DNSServiceCreateConnection function returns kDNSServiceErr_NoError
93 on success. Otherwise, an error code defined in <dns_sd.h> is returned
94 to indicate the specific failure that occurred.
95
97 See attributes(5) for description of the following attributes:
98
99
100
101
102 ┌─────────────────────────────┬─────────────────────────────┐
103 │ ATTRIBUTE TYPE │ ATTRIBUTE VALUE │
104 ├─────────────────────────────┼─────────────────────────────┤
105 │Interface Stability │Committed │
106 ├─────────────────────────────┼─────────────────────────────┤
107 │MT-Level │Safe │
108 └─────────────────────────────┴─────────────────────────────┘
109
111 DNSServiceRefDeallocate(3DNS_SD), DNSServiceRegister(3DNS_SD),
112 attributes(5)
113
114
115
116SunOS 5.11 20 Aug 200D7NSServiceCreateConnection(3DNS_SD)