2 * Copyright (c) 2002-2004 Apple Computer, Inc. All rights reserved.
4 * @APPLE_LICENSE_HEADER_START@
6 * Copyright (c) 1999-2003 Apple Computer, Inc. All Rights Reserved.
8 * This file contains Original Code and/or Modifications of Original Code
9 * as defined in and that are subject to the Apple Public Source License
10 * Version 2.0 (the 'License'). You may not use this file except in
11 * compliance with the License. Please obtain a copy of the License at
12 * http://www.opensource.apple.com/apsl/ and read it before using this
15 * The Original Code and all software distributed under the License are
16 * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
17 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
18 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
19 * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
20 * Please see the License for the specific language governing rights and
21 * limitations under the License.
23 * @APPLE_LICENSE_HEADER_END@
25 Change History (most recent first):
28 Revision 1.11 2004/01/30 02:44:32 bradley
29 Added support for IPv6 (v4 & v6, v4-only, v6-only, AAAA over v4, etc.). Added support for DNS-SD
30 InterfaceID<->Interface Index mappings. Added support for loopback usage when no other interfaces
31 are available. Updated unlock signaling to no longer require timenow - NextScheduledTime to be >= 0
32 (it no longer is). Added unicast-capable detection to avoid using unicast when there is other mDNS
33 software running on the same machine. Removed unneeded sock_XtoY routines. Added support for
34 reporting HINFO records with the Windows and mDNSResponder version information.
36 Revision 1.10 2003/10/24 23:23:02 bradley
37 Removed legacy port 53 support as it is no longer needed.
39 Revision 1.9 2003/08/20 06:21:25 bradley
40 Updated to latest internal version of the Rendezvous for Windows platform plugin: Added support
41 for Windows CE/PocketPC 2003; re-did interface-related code to emulate getifaddrs/freeifaddrs for
42 restricting usage to only active, multicast-capable, and non-point-to-point interfaces and to ease
43 the addition of IPv6 support in the future; Changed init code to serialize thread initialization to
44 enable ThreadID improvement to wakeup notification; Define platform support structure locally to
45 allow portable mDNS_Init usage; Removed dependence on modified mDNSCore: define interface ID<->name
46 structures/prototypes locally; Changed to use _beginthreadex()/_endthreadex() on non-Windows CE
47 platforms (re-mapped to CreateThread on Window CE) to avoid a leak in the Microsoft C runtime;
48 Added IPv4/IPv6 string<->address conversion routines; Cleaned up some code and added HeaderDoc.
50 Revision 1.8 2003/08/12 19:56:27 cheshire
53 Revision 1.7 2003/07/23 02:23:01 cheshire
54 Updated mDNSPlatformUnlock() to work correctly, now that <rdar://problem/3160248>
55 "ScheduleNextTask needs to be smarter" has refined the way m->NextScheduledEvent is set
57 Revision 1.6 2003/07/02 21:20:04 cheshire
58 <rdar://problem/3313413> Update copyright notices, etc., in source code comments
60 Revision 1.5 2003/04/29 00:06:09 cheshire
61 <rdar://problem/3242673> mDNSWindows needs a wakeupEvent object to signal the main thread
63 Revision 1.4 2003/03/22 02:57:44 cheshire
64 Updated mDNSWindows to use new "mDNS_Execute" model (see "mDNSCore/Implementer Notes.txt")
66 Revision 1.3 2002/09/21 20:44:54 zarzycki
69 Revision 1.2 2002/09/20 05:55:16 bradley
70 Multicast DNS platform plugin for Win32
74 #ifndef __MDNS_WIN32__
75 #define __MDNS_WIN32__
77 #include "CommonServices.h"
79 #if( !defined( _WIN32_WCE ) )
83 #include "mDNSClientAPI.h"
89 //---------------------------------------------------------------------------------------------------------------------------
90 /*! @struct mDNSInterfaceData
92 @abstract Structure containing interface-specific data.
95 typedef struct mDNSInterfaceData mDNSInterfaceData
;
96 struct mDNSInterfaceData
98 mDNSInterfaceData
* next
;
103 #if( !defined( _WIN32_WCE ) )
104 LPFN_WSARECVMSG wsaRecvMsgFunctionPtr
;
106 HANDLE readPendingEvent
;
107 NetworkInterfaceInfo interfaceInfo
;
108 mDNSAddr defaultAddr
;
109 mDNSBool hostRegistered
;
112 //---------------------------------------------------------------------------------------------------------------------------
113 /*! @struct mDNS_PlatformSupport_struct
115 @abstract Structure containing platform-specific data.
118 struct mDNS_PlatformSupport_struct
120 CRITICAL_SECTION lock
;
121 mDNSBool lockInitialized
;
124 HANDLE interfaceListChangedEvent
;
128 SocketRef interfaceListChangedSocket
;
130 mDNSInterfaceData
* interfaceList
;
134 //---------------------------------------------------------------------------------------------------------------------------
137 @abstract Interface information
142 struct ifaddrs
* ifa_next
;
145 struct sockaddr
* ifa_addr
;
146 struct sockaddr
* ifa_netmask
;
147 struct sockaddr
* ifa_broadaddr
;
148 struct sockaddr
* ifa_dstaddr
;
158 //---------------------------------------------------------------------------------------------------------------------------
159 /*! @function getifaddrs
161 @abstract Builds a linked list of interfaces. Caller must free using freeifaddrs if successful.
164 int getifaddrs( struct ifaddrs
**outAddrs
);
166 //---------------------------------------------------------------------------------------------------------------------------
167 /*! @function freeifaddrs
169 @abstract Frees a linked list of interfaces built with getifaddrs.
172 void freeifaddrs( struct ifaddrs
*inAddrs
);
178 #endif // __MDNS_WIN32__