1/* -*- Mode: C; tab-width: 4 -*-
2 *
3 * Copyright (c) 2009 Apple Computer, Inc. All rights reserved.
4 *
5 * Licensed under the Apache License, Version 2.0 (the "License");
6 * you may not use this file except in compliance with the License.
7 * You may obtain a copy of the License at
8 *
9 *     http://www.apache.org/licenses/LICENSE-2.0
10 *
11 * Unless required by applicable law or agreed to in writing, software
12 * distributed under the License is distributed on an "AS IS" BASIS,
13 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 * See the License for the specific language governing permissions and
15 * limitations under the License.
16 */
17
18
19
20// This file will be processed by the MIDL tool to
21
22// produce the type library (DLLComponent.tlb) and marshalling code.
23
24
25
26typedef [ uuid(4085DD59-D0E1-4efe-B6EE-DDBF7631B9C0) ]
27
28enum DNSSDFlags
29
30{
31
32	kDNSSDFlagsMoreComing			= 0x0001,
33
34	kDNSSDFlagsDefault				= 0x0004,
35
36	kDNSSDFlagsNoAutoRename			= 0x0008,
37
38	kDNSSDFlagsShared				= 0x0010,
39
40	kDNSSDFlagsUnique				= 0x0020,
41
42	kDNSSDFlagsBrowseDomains		= 0x0040,
43
44	kDNSSDFlagsRegistrationDomains	= 0x0080,
45
46	kDNSSDFlagsLongLivedQuery		= 0x0100,
47
48	kDNSSDFlagsAllowRemoteQuery		= 0x0200,
49
50	kDNSSDFlagsForceMulticast		= 0x0400,
51
52	kDNSSDFlagsForce				= 0x0800,
53
54	kDNSSDFlagsReturnIntermediates	= 0x1000,
55
56	kDNSSDFlagsNonBrowsable			= 0x2000
57
58} DNSSDFlags;
59
60
61
62
63
64typedef [ uuid(30CDF335-CA52-4b17-AFF2-E83C64C450D4) ]
65
66enum DNSSDAddressFamily
67
68{
69
70	kDNSSDAddressFamily_IPv4 = 0x1,
71
72	kDNSSDAddressFamily_IPv6 = 0x2
73
74} DNSSDAddressFamily;
75
76
77
78
79
80typedef [ uuid(98FB4702-7374-4b16-A8DB-AD35BFB8364D) ]
81
82enum DNSSDProtocol
83
84{
85
86	kDNSSDProtocol_UDP	= 0x10,
87
88	kDNSSDProtocol_TCP	= 0x20
89
90} DNSSDProtocol;
91
92
93
94
95
96typedef [ uuid(72BF3EC3-19BC-47e5-8D95-3B73FF37D893) ]
97
98enum DNSSDRRClass
99
100{
101
102	kDNSSDClass_IN = 1
103
104} DNSSDRRClass;
105
106
107
108
109
110typedef [ uuid(08E362DF-5468-4c9a-AC66-FD4747B917BD) ]
111
112enum DNSSDRRType
113
114{
115
116	kDNSSDType_A         = 1,
117    kDNSSDType_NS        = 2,
118    kDNSSDType_MD        = 3,
119    kDNSSDType_MF        = 4,
120    kDNSSDType_CNAME     = 5,
121    kDNSSDType_SOA       = 6,
122    kDNSSDType_MB        = 7,
123    kDNSSDType_MG        = 8,
124    kDNSSDType_MR        = 9,
125    kDNSSDType_NULL      = 10,
126    kDNSSDType_WKS       = 11,
127    kDNSSDType_PTR       = 12,
128    kDNSSDType_HINFO     = 13,
129    kDNSSDType_MINFO     = 14,
130    kDNSSDType_MX        = 15,
131    kDNSSDType_TXT       = 16,
132    kDNSSDType_RP        = 17,
133    kDNSSDType_AFSDB     = 18,
134    kDNSSDType_X25       = 19,
135    kDNSSDType_ISDN      = 20,
136    kDNSSDType_RT        = 21,
137    kDNSSDType_NSAP      = 22,
138    kDNSSDType_NSAP_PTR  = 23,
139    kDNSSDType_SIG       = 24,
140    kDNSSDType_KEY       = 25,
141    kDNSSDType_PX        = 26,
142    kDNSSDType_GPOS      = 27,
143    kDNSSDType_AAAA      = 28,
144    kDNSSDType_LOC       = 29,
145    kDNSSDType_NXT       = 30,
146    kDNSSDType_EID       = 31,
147    kDNSSDType_NIMLOC    = 32,
148    kDNSSDType_SRV       = 33,
149    kDNSSDType_ATMA      = 34,
150    kDNSSDType_NAPTR     = 35,
151    kDNSSDType_KX        = 36,
152    kDNSSDType_CERT      = 37,
153    kDNSSDType_A6        = 38,
154    kDNSSDType_DNAME     = 39,
155    kDNSSDType_SINK      = 40,
156    kDNSSDType_OPT       = 41,
157    kDNSSDType_APL       = 42,
158    kDNSSDType_DS        = 43,
159    kDNSSDType_SSHFP     = 44,
160    kDNSSDType_IPSECKEY  = 45,
161    kDNSSDType_RRSIG     = 46,
162    kDNSSDType_NSEC      = 47,
163    kDNSSDType_DNSKEY    = 48,
164    kDNSSDType_DHCID     = 49,
165    kDNSSDType_NSEC3     = 50,
166    kDNSSDType_NSEC3PARAM= 51,
167    kDNSSDType_HIP       = 55,
168    kDNSSDType_SPF       = 99,
169    kDNSSDType_UINFO     = 100,
170    kDNSSDType_UID       = 101,
171    kDNSSDType_GID       = 102,
172    kDNSSDType_UNSPEC    = 103,
173    kDNSSDType_TKEY      = 249,
174    kDNSSDType_TSIG      = 250,
175    kDNSSDType_IXFR      = 251,
176    kDNSSDType_AXFR      = 252,
177    kDNSSDType_MAILB     = 253,
178    kDNSSDType_MAILA     = 254,
179    kDNSSDType_ANY       = 255
180
181} DNSSDRRType;
182
183
184
185
186
187typedef [ uuid(3B0059E7-5297-4301-9AAB-1522F31EC8A7) ]
188
189enum DNSSDError
190{
191	kDNSSDError_NoError                   = 0,
192	kDNSSDError_Unknown                   = -65537,
193	kDNSSDError_NoSuchName                = -65538,
194    kDNSSDError_NoMemory                  = -65539,
195    kDNSSDError_BadParam                  = -65540,
196    kDNSSDError_BadReference              = -65541,
197    kDNSSDError_BadState                  = -65542,
198    kDNSSDError_BadFlags                  = -65543,
199    kDNSSDError_Unsupported               = -65544,
200    kDNSSDError_NotInitialized            = -65545,
201    kDNSSDError_AlreadyRegistered         = -65547,
202    kDNSSDError_NameConflict              = -65548,
203    kDNSSDError_Invalid                   = -65549,
204    kDNSSDError_Firewall                  = -65550,
205    kDNSSDError_Incompatible              = -65551,
206    kDNSSDError_BadInterfaceIndex         = -65552,
207    kDNSSDError_Refused                   = -65553,
208    kDNSSDError_NoSuchRecord              = -65554,
209    kDNSSDError_NoAuth                    = -65555,
210    kDNSSDError_NoSuchKey                 = -65556,
211    kDNSSDError_NATTraversal              = -65557,
212    kDNSSDError_DoubleNAT                 = -65558,
213    kDNSSDError_BadTime                   = -65559,
214    kDNSSDError_BadSig                    = -65560,
215    kDNSSDError_BadKey                    = -65561,
216    kDNSSDError_Transient                 = -65562,
217    kDNSSDError_ServiceNotRunning         = -65563,  /* Background daemon not running */
218    kDNSSDError_NATPortMappingUnsupported = -65564,  /* NAT doesn't support NAT-PMP or UPnP */
219    kDNSSDError_NATPortMappingDisabled    = -65565,  /* NAT supports NAT-PMP or UPnP but it's disabled by the administrator */
220    kDNSSDError_NoRouter                  = -65566,  /* No router currently configured (probably no network connectivity) */
221    kDNSSDError_PollingMode               = -65567
222} DNSSDError;
223
224
225
226import "oaidl.idl";
227
228import "ocidl.idl";
229
230
231
232
233
234[
235
236	object,
237
238	uuid(8FA0889C-5973-4FC9-970B-EC15C925D0CE),
239
240	dual,
241
242	nonextensible,
243
244	helpstring("ITXTRecord Interface"),
245
246	pointer_default(unique)
247
248]
249
250interface ITXTRecord : IDispatch{
251
252	[id(1), helpstring("method SetValue")] HRESULT SetValue([in] BSTR key, [in] VARIANT value);
253
254	[id(2), helpstring("method RemoveValue")] HRESULT RemoveValue([in] BSTR key);
255
256	[id(3), helpstring("method ContainsKey")] HRESULT ContainsKey([in] BSTR key, [out,retval] VARIANT_BOOL* retval);
257
258	[id(4), helpstring("method GetValueForKey")] HRESULT GetValueForKey([in] BSTR key, [out,retval] VARIANT* value);
259
260	[id(5), helpstring("method GetCount")] HRESULT GetCount([out,retval] ULONG* count);
261
262	[id(6), helpstring("method GetKeyAtIndex")] HRESULT GetKeyAtIndex([in] ULONG index, [out,retval] BSTR* retval);
263
264	[id(7), helpstring("method GetValueAtIndex")] HRESULT GetValueAtIndex([in] ULONG index, [out,retval] VARIANT* retval);
265
266};
267
268[
269
270	object,
271
272	uuid(9CE603A0-3365-4DA0-86D1-3F780ECBA110),
273
274	dual,
275
276	nonextensible,
277
278	helpstring("IDNSSDRecord Interface"),
279
280	pointer_default(unique)
281
282]
283
284interface IDNSSDRecord : IDispatch{
285
286	[id(1), helpstring("method Update")] HRESULT Update([in] DNSSDFlags flags, [in] VARIANT rdata, [in] ULONG ttl);
287
288	[id(2), helpstring("method Remove")] HRESULT Remove([in] DNSSDFlags flags);
289
290};
291
292[
293
294	object,
295
296	uuid(7FD72324-63E1-45AD-B337-4D525BD98DAD),
297
298	dual,
299
300	nonextensible,
301
302	helpstring("IDNSSDEventManager Interface"),
303
304	pointer_default(unique)
305
306]
307
308interface IDNSSDEventManager : IDispatch{
309
310};
311
312[
313
314	object,
315
316	uuid(29DE265F-8402-474F-833A-D4653B23458F),
317
318	dual,
319
320	nonextensible,
321
322	helpstring("IDNSSDService Interface"),
323
324	pointer_default(unique)
325
326]
327
328interface IDNSSDService : IDispatch{
329
330	[id(1), helpstring("method EnumerateDomains")] HRESULT EnumerateDomains([in] DNSSDFlags flags, [in] ULONG ifIndex, [in] IDNSSDEventManager* eventManager, [out,retval] IDNSSDService** service);
331
332	[id(2), helpstring("method Browse"), local] HRESULT Browse([in] DNSSDFlags flags, [in] ULONG interfaceIndex, [in] BSTR regtype, [in] BSTR domain, [in] IDNSSDEventManager* eventManager, [out,retval] IDNSSDService** sdref);
333
334	[id(3), helpstring("method Resolve")] HRESULT Resolve([in] DNSSDFlags flags, [in] ULONG ifIndex, [in] BSTR serviceName, [in] BSTR regType, [in] BSTR domain, [in] IDNSSDEventManager* eventManager, [out,retval] IDNSSDService** service);
335
336	[id(4), helpstring("method Register")] HRESULT Register([in] DNSSDFlags flags, [in] ULONG ifIndex, [in] BSTR name, [in] BSTR regType, [in] BSTR domain, [in] BSTR host, [in] USHORT port, [in] ITXTRecord* record, [in] IDNSSDEventManager* eventManager, [out,retval] IDNSSDService** service);
337
338	[id(5), helpstring("method QueryRecord")] HRESULT QueryRecord([in] DNSSDFlags flags, [in] ULONG ifIndex, [in] BSTR fullname, [in] DNSSDRRType rrtype, [in] DNSSDRRClass rrclass, [in] IDNSSDEventManager* eventManager, [out,retval] IDNSSDService** service);
339
340	[id(6), helpstring("method RegisterRecord")] HRESULT RegisterRecord([in] DNSSDFlags flags, [in] ULONG ifIndex, [in] BSTR fullname, [in] DNSSDRRType rrtype, [in] DNSSDRRClass rrclass, [in] VARIANT rdata, [in] ULONG ttl, [in] IDNSSDEventManager* eventManager, [out,retval] IDNSSDRecord** record);
341
342	[id(7), helpstring("method AddRecord")] HRESULT AddRecord([in] DNSSDFlags flags, [in] DNSSDRRType rrtype, [in] VARIANT rdata, [in] ULONG ttl, [out,retval] IDNSSDRecord** record);
343
344	[id(8), helpstring("method ReconfirmRecord")] HRESULT ReconfirmRecord([in] DNSSDFlags flags, [in] ULONG ifIndex, [in] BSTR fullname, [in] DNSSDRRType rrtype, [in] DNSSDRRClass rrclass, [in] VARIANT rdata);
345
346	[id(9), helpstring("method GetProperty")] HRESULT GetProperty([in] BSTR prop, [in,out] VARIANT * value );
347
348	[id(10), helpstring("method GetAddrInfo")] HRESULT GetAddrInfo([in] DNSSDFlags flags, [in] ULONG ifIndex, [in] DNSSDAddressFamily addressFamily, [in] BSTR hostname, [in] IDNSSDEventManager* eventManager, [out,retval] IDNSSDService** service);
349
350	[id(11), helpstring("method NATPortMappingCreate")] HRESULT NATPortMappingCreate([in] DNSSDFlags flags, [in] ULONG ifIndex, [in] DNSSDAddressFamily addressFamily, [in] DNSSDProtocol protocol, [in] USHORT internalPort, [in] USHORT externalPort, [in] ULONG ttl, [in] IDNSSDEventManager* eventManager, [out,retval] IDNSSDService** service);
351
352	[id(12), helpstring("method Stop"), local] HRESULT Stop(void);
353
354};
355
356[
357
358	uuid(18FBED6D-F2B7-4EC8-A4A4-46282E635308),
359
360	version(1.0),
361
362	helpstring("Apple Bonjour Library 1.0")
363
364]
365
366library Bonjour
367
368{
369
370	importlib("stdole2.tlb");
371
372	[
373
374		uuid(21AE8D7F-D5FE-45cf-B632-CFA2C2C6B498),
375
376		helpstring("_IDNSSDEvents Interface")
377
378	]
379
380	dispinterface _IDNSSDEvents
381
382	{
383
384		properties:
385
386		methods:
387
388		[id(1), helpstring("method DomainFound")] void DomainFound([in] IDNSSDService* service, [in] DNSSDFlags flags, [in] ULONG ifIndex, [in] BSTR domain);
389
390		[id(2), helpstring("method DomainLost")] void DomainLost([in] IDNSSDService* service, [in] DNSSDFlags flags, [in] ULONG ifIndex, [in] BSTR domain);
391
392		[id(3), helpstring("method ServiceFound")] void ServiceFound([in] IDNSSDService* browser, [in] DNSSDFlags flags, [in] ULONG ifIndex, [in] BSTR serviceName, [in] BSTR regType, [in] BSTR domain);
393
394		[id(4), helpstring("method ServiceLost")] void ServiceLost([in] IDNSSDService* browser, [in] DNSSDFlags flags, [in] ULONG ifIndex, [in] BSTR serviceName, [in] BSTR regType, [in] BSTR domain);
395
396		[id(5), helpstring("method ServiceResolved")] void ServiceResolved([in] IDNSSDService* service, [in] DNSSDFlags flags, [in] ULONG ifIndex, [in] BSTR fullName, [in] BSTR hostName, [in] USHORT port, [in] ITXTRecord* record);
397
398		[id(6), helpstring("method ServiceRegistered")] void ServiceRegistered([in] IDNSSDService* service, [in] DNSSDFlags flags, [in] BSTR name, [in] BSTR regType, [in] BSTR domain);
399
400		[id(7), helpstring("method QueryRecordAnswered")] void QueryRecordAnswered([in] IDNSSDService* service, [in] DNSSDFlags flags, [in] ULONG ifIndex, [in] BSTR fullName, [in] DNSSDRRType rrtype, [in] DNSSDRRClass rrclass, [in] VARIANT rdata, [in] ULONG ttl);
401
402		[id(8), helpstring("method RecordRegistered")] void RecordRegistered([in] IDNSSDRecord* record, [in] DNSSDFlags flags);
403
404		[id(9), helpstring("method AddressFound")] void AddressFound([in] IDNSSDService* service, [in] DNSSDFlags flags, [in] ULONG ifIndex, [in] BSTR hostname, [in] DNSSDAddressFamily addressFamily, [in] BSTR address, [in] ULONG ttl);
405
406		[id(10), helpstring("method MappingCreated")] void MappingCreated([in] IDNSSDService* service, [in] DNSSDFlags flags, [in] ULONG ifIndex, [in] ULONG externalAddress, [in] DNSSDAddressFamily addressFamily, [in] DNSSDProtocol protocol, [in] USHORT internalPort, [in] USHORT externalPort, [in] ULONG ttl);
407
408		[id(11), helpstring("method OperationFailed")] void OperationFailed([in] IDNSSDService* service, [in] DNSSDError error);
409
410	};
411
412	[
413
414		uuid(24CD4DE9-FF84-4701-9DC1-9B69E0D1090A),
415
416		helpstring("DNSSDService Class")
417
418	]
419
420	coclass DNSSDService
421
422	{
423
424		[default] interface IDNSSDService;
425
426	};
427
428	[
429
430		uuid(AFEE063C-05BA-4248-A26E-168477F49734),
431
432		helpstring("TXTRecord Class")
433
434	]
435
436	coclass TXTRecord
437
438	{
439
440		[default] interface ITXTRecord;
441
442	};
443
444	[
445
446		uuid(5E93C5A9-7516-4259-A67B-41A656F6E01C),
447
448		helpstring("DNSSDRecord Class")
449
450	]
451
452	coclass DNSSDRecord
453
454	{
455
456		[default] interface IDNSSDRecord;
457
458	};
459
460	[
461
462		uuid(BEEB932A-8D4A-4619-AEFE-A836F988B221),
463
464		helpstring("DNSSDEventManager Class")
465
466	]
467
468	coclass DNSSDEventManager
469
470	{
471
472		[default] interface IDNSSDEventManager;
473
474		[default, source] dispinterface _IDNSSDEvents;
475
476	};
477
478	enum DNSSDFlags;
479
480	enum DNSSDAddressFamily;
481
482	enum DNSSDProtocol;
483
484	enum DNSSDRRClass;
485
486	enum DNSSDRRType;
487
488	enum DNSSDError;
489
490};
491
492