1 /* -*- Mode: C; tab-width: 4 -*-
3 * Copyright (c) 2002-2004 Apple Computer, Inc. All rights reserved.
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
9 * http://www.apache.org/licenses/LICENSE-2.0
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.
18 #ifndef __MDNS_WIN32__
19 #define __MDNS_WIN32__
21 #include "CommonServices.h"
23 #if( !defined( _WIN32_WCE ) )
27 #include "mDNSEmbeddedAPI.h"
35 typedef void ( *TCPUserCallback
)();
37 struct TCPSocket_struct
39 TCPSocketFlags flags
; // MUST BE FIRST FIELD -- mDNSCore expects every TCPSocket_struct to begin with TCPSocketFlags flags
42 TCPUserCallback userCallback
;
49 struct UDPSocket_struct
51 mDNSIPPort port
; // MUST BE FIRST FIELD -- mDNSCoreReceive expects every UDPSocket_struct to begin with mDNSIPPort port
52 mDNSAddr addr
; // This is initialized by our code. If we don't get the
53 // dstAddr from WSARecvMsg we use this value instead.
55 LPFN_WSARECVMSG recvMsgPtr
;
57 struct mDNSInterfaceData
*ifd
;
63 //---------------------------------------------------------------------------------------------------------------------------
64 /*! @struct mDNSInterfaceData
66 @abstract Structure containing interface-specific data.
69 typedef struct mDNSInterfaceData mDNSInterfaceData
;
70 struct mDNSInterfaceData
75 struct UDPSocket_struct sock
;
76 NetworkInterfaceInfo interfaceInfo
;
77 mDNSBool hostRegistered
;
78 mDNSInterfaceData
* next
;
82 //---------------------------------------------------------------------------------------------------------------------------
83 /*! @typedef ReportStatusFunc
85 typedef void (*ReportStatusFunc
)(int inType
, const char *inFormat
, ...);
88 //---------------------------------------------------------------------------------------------------------------------------
89 /*! @struct mDNS_PlatformSupport_struct
91 @abstract Structure containing platform-specific data.
94 struct mDNS_PlatformSupport_struct
97 HANDLE checkFileSharesTimer
;
98 mDNSs32 checkFileSharesTimeout
;
99 ReportStatusFunc reportStatusFunc
;
100 time_t nextDHCPLeaseExpires
;
103 mDNSBool smbFileSharing
;
104 mDNSBool smbPrintSharing
;
105 ServiceRecordSet smbSRS
;
106 AuthRecord smbSubTypes
[ 2 ];
107 mDNSBool registeredLoopback4
;
109 mDNSInterfaceData
* interfaceList
;
110 mDNSInterfaceData
* inactiveInterfaceList
;
111 struct UDPSocket_struct unicastSock4
;
112 struct UDPSocket_struct unicastSock6
;
113 DWORD osMajorVersion
;
114 DWORD osMinorVersion
;
117 //---------------------------------------------------------------------------------------------------------------------------
120 @abstract Interface information
125 struct ifaddrs
* ifa_next
;
128 struct sockaddr
* ifa_addr
;
129 struct sockaddr
* ifa_netmask
;
130 struct sockaddr
* ifa_broadaddr
;
131 struct sockaddr
* ifa_dstaddr
;
132 BYTE ifa_physaddr
[6];
133 BOOL ifa_dhcpEnabled
;
134 time_t ifa_dhcpLeaseExpires
;
146 extern void InterfaceListDidChange( mDNS
* const inMDNS
);
147 extern void ComputerDescriptionDidChange( mDNS
* const inMDNS
);
148 extern void TCPIPConfigDidChange( mDNS
* const inMDNS
);
149 extern void DynDNSConfigDidChange( mDNS
* const inMDNS
);
150 extern void FileSharingDidChange( mDNS
* const inMDNS
);
151 extern void FirewallDidChange( mDNS
* const inMDNS
);
152 extern mStatus
TCPAddSocket( mDNS
* const inMDNS
, TCPSocket
*sock
);
153 extern mStatus
SetupInterfaceList( mDNS
* const inMDNS
);
154 extern mStatus
TearDownInterfaceList( mDNS
* const inMDNS
);
155 extern BOOL
IsWOMPEnabled();
156 extern void DispatchSocketEvents( mDNS
* const inMDNS
);
163 #endif // __MDNS_WIN32__