X-Git-Url: https://git.saurik.com/apple/mdnsresponder.git/blobdiff_plain/8e92c31c9a45a66732f5bc7afbc9f5596c17e91d..67c8f8a10700c05d2460d60f5927f23cb5cb9241:/mDNSWindows/mDNSWin32.h diff --git a/mDNSWindows/mDNSWin32.h b/mDNSWindows/mDNSWin32.h index 946fd7e..04be2ce 100755 --- a/mDNSWindows/mDNSWin32.h +++ b/mDNSWindows/mDNSWin32.h @@ -1,30 +1,74 @@ -/* +/* -*- Mode: C; tab-width: 4 -*- + * * Copyright (c) 2002-2004 Apple Computer, Inc. All rights reserved. * - * @APPLE_LICENSE_HEADER_START@ - * - * Copyright (c) 1999-2003 Apple Computer, Inc. All Rights Reserved. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at * - * This file contains Original Code and/or Modifications of Original Code - * as defined in and that are subject to the Apple Public Source License - * Version 2.0 (the 'License'). You may not use this file except in - * compliance with the License. Please obtain a copy of the License at - * http://www.opensource.apple.com/apsl/ and read it before using this - * file. + * http://www.apache.org/licenses/LICENSE-2.0 * - * The Original Code and all software distributed under the License are - * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER - * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, - * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. - * Please see the License for the specific language governing rights and + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and * limitations under the License. - * - * @APPLE_LICENSE_HEADER_END@ Change History (most recent first): $Log: mDNSWin32.h,v $ +Revision 1.26 2006/08/14 23:25:21 cheshire +Re-licensed mDNSResponder daemon source code under Apache License, Version 2.0 + +Revision 1.25 2006/07/06 00:05:44 cheshire +"dDNS.h" renamed to "uDNS.h" + +Revision 1.24 2006/02/26 19:31:04 herscher + Bonjour For Windows takes 90 seconds to start. This was caused by a bad interaction between the VirtualPC check, and the removal of the WMI dependency. The problem was fixed by: 1) checking to see if WMI is running before trying to talk to it. 2) Retrying the VirtualPC check every 10 seconds upon failure, stopping after 10 unsuccessful tries. + +Revision 1.23 2005/10/05 20:55:14 herscher + Don't call SetLLRoute on loopback interface + +Revision 1.22 2005/03/04 22:44:53 shersche + mDNSResponder did not notice changes to DNS server config + +Revision 1.21 2005/03/03 02:29:00 shersche +Use the RegNames.h header file for registry key names + +Revision 1.20 2005/01/25 08:12:52 shersche + Enable Unicast and add Dynamic DNS support. +Bug #: 3947417 + +Revision 1.19 2004/12/15 07:34:45 shersche +Add platform support for IPv4 and IPv6 unicast sockets + +Revision 1.18 2004/10/11 21:53:15 shersche + Change GetWindowsVersionString link scoping from static to non-static so that it can be accessed from other compilation units. The information returned in this function will be used to determine what service dependencies to use when calling CreateService(). +Bug #: 3832450 + +Revision 1.17 2004/09/17 01:08:57 cheshire +Renamed mDNSClientAPI.h to mDNSEmbeddedAPI.h + The name "mDNSClientAPI.h" is misleading to new developers looking at this code. The interfaces + declared in that file are ONLY appropriate to single-address-space embedded applications. + For clients on general-purpose computers, the interfaces defined in dns_sd.h should be used. + +Revision 1.16 2004/08/05 05:43:01 shersche + Add HostDescriptionChangedCallback so callers can choose to handle it when mDNSWin32 core detects that the computer description string has changed +Bug #: 3751566 + +Revision 1.15 2004/07/26 05:42:50 shersche +use "Computer Description" for nicename if available, track dynamic changes to "Computer Description" + +Revision 1.14 2004/07/13 21:24:25 rpantos +Fix for . + +Revision 1.13 2004/06/24 15:23:24 shersche +Add InterfaceListChanged callback. This callback is used in Service.c to add link local routes to the routing table +Submitted by: herscher + +Revision 1.12 2004/06/18 05:22:16 rpantos +Integrate Scott's changes + Revision 1.11 2004/01/30 02:44:32 bradley Added support for IPv6 (v4 & v6, v4-only, v6-only, AAAA over v4, etc.). Added support for DNS-SD InterfaceID<->Interface Index mappings. Added support for loopback usage when no other interfaces @@ -37,7 +81,7 @@ Revision 1.10 2003/10/24 23:23:02 bradley Removed legacy port 53 support as it is no longer needed. Revision 1.9 2003/08/20 06:21:25 bradley -Updated to latest internal version of the Rendezvous for Windows platform plugin: Added support +Updated to latest internal version of the mDNSWindows platform layer: Added support for Windows CE/PocketPC 2003; re-did interface-related code to emulate getifaddrs/freeifaddrs for restricting usage to only active, multicast-capable, and non-point-to-point interfaces and to ease the addition of IPv6 support in the future; Changed init code to serialize thread initialization to @@ -80,7 +124,8 @@ Multicast DNS platform plugin for Win32 #include #endif -#include "mDNSClientAPI.h" +#include "mDNSEmbeddedAPI.h" +#include "uDNS.h" #ifdef __cplusplus extern "C" { @@ -109,6 +154,35 @@ struct mDNSInterfaceData mDNSBool hostRegistered; }; +//--------------------------------------------------------------------------------------------------------------------------- +/*! @typedef IdleThreadCallback + + @abstract mDNSWin32 core will call out through this function pointer + after calling mDNS_Execute +*/ +typedef mDNSs32 (*IdleThreadCallback)(mDNS * const inMDNS, mDNSs32 interval); +//--------------------------------------------------------------------------------------------------------------------------- + +//--------------------------------------------------------------------------------------------------------------------------- +/*! @typedef InterfaceListChangedCallback + + @abstract mDNSWin32 core will call out through this function pointer + after detecting an interface list changed event +*/ +typedef void (*InterfaceListChangedCallback)(mDNS * const inMDNS); +//--------------------------------------------------------------------------------------------------------------------------- + + +//--------------------------------------------------------------------------------------------------------------------------- +/*! @typedef HostDescriptionChangedCallback + + @abstract mDNSWin32 core will call out through this function pointer + after detecting that the computer description has changed +*/ +typedef void (*HostDescriptionChangedCallback)(mDNS * const inMDNS); +//--------------------------------------------------------------------------------------------------------------------------- + + //--------------------------------------------------------------------------------------------------------------------------- /*! @struct mDNS_PlatformSupport_struct @@ -122,13 +196,40 @@ struct mDNS_PlatformSupport_struct HANDLE cancelEvent; HANDLE quitEvent; HANDLE interfaceListChangedEvent; + HANDLE descChangedEvent; // Computer description changed event + HANDLE tcpipChangedEvent; // TCP/IP config changed + HANDLE ddnsChangedEvent; // DynDNS config changed HANDLE wakeupEvent; HANDLE initEvent; + HANDLE vpcCheckEvent; // Timer handle to check if we're running in Virtual PC + int vpcCheckCount; + HKEY descKey; + HKEY tcpipKey; + HKEY ddnsKey; mStatus initStatus; + mDNSBool inVirtualPC; + int timersCount; + mDNSBool registeredLoopback4; SocketRef interfaceListChangedSocket; int interfaceCount; mDNSInterfaceData * interfaceList; + mDNSInterfaceData * inactiveInterfaceList; DWORD threadID; + IdleThreadCallback idleThreadCallback; + InterfaceListChangedCallback interfaceListChangedCallback; + HostDescriptionChangedCallback hostDescriptionChangedCallback; + SocketRef unicastSock4; + HANDLE unicastSock4ReadEvent; + mDNSAddr unicastSock4DestAddr; +#if( !defined( _WIN32_WCE ) ) + LPFN_WSARECVMSG unicastSock4RecvMsgPtr; +#endif + SocketRef unicastSock6; + HANDLE unicastSock6ReadEvent; + mDNSAddr unicastSock6DestAddr; +#if( !defined( _WIN32_WCE ) ) + LPFN_WSARECVMSG unicastSock6RecvMsgPtr; +#endif }; //--------------------------------------------------------------------------------------------------------------------------- @@ -155,6 +256,16 @@ struct ifaddrs } ifa_extra; }; + +//--------------------------------------------------------------------------------------------------------------------------- +/*! @function GetWindowsVersionString + + @abstract Stores Windows version information in the string passed in (inBuffer) +*/ + +OSStatus GetWindowsVersionString( char *inBuffer, size_t inBufferSize ); + + //--------------------------------------------------------------------------------------------------------------------------- /*! @function getifaddrs @@ -171,6 +282,7 @@ int getifaddrs( struct ifaddrs **outAddrs ); void freeifaddrs( struct ifaddrs *inAddrs ); + #ifdef __cplusplus } #endif