From 9449f151d0ccf3ac755d5f2bd9b4057ae2b03157 Mon Sep 17 00:00:00 2001 From: Sebastian Huber Date: Thu, 30 Jan 2014 13:52:13 +0100 Subject: mDNS: Import The sources can be obtained via: http://opensource.apple.com/tarballs/mDNSResponder/mDNSResponder-544.tar.gz --- .../Clients/BonjourExample/BonjourExample.cpp | 199 + .../Clients/BonjourExample/BonjourExample.sln | 21 + .../Clients/BonjourExample/BonjourExample.vcproj | 156 + mDNSResponder/Clients/BonjourExample/stdafx.cpp | 20 + mDNSResponder/Clients/BonjourExample/stdafx.h | 30 + mDNSResponder/Clients/ClientCommon.c | 75 + mDNSResponder/Clients/ClientCommon.h | 41 + .../Clients/DNS-SD.VisualStudio/DNS-SD.manifest | 12 + .../Clients/DNS-SD.VisualStudio/DNS-SD64.manifest | 12 + .../Clients/DNS-SD.VisualStudio/dns-sd.rc | 103 + .../Clients/DNS-SD.VisualStudio/dns-sd.sdk.rc | 102 + .../Clients/DNS-SD.VisualStudio/dns-sd.sdk.vcproj | 408 + .../Clients/DNS-SD.VisualStudio/dns-sd.vcproj | 408 + .../Clients/DNS-SD.VisualStudio/dns-sd.vcxproj | 272 + .../DNS-SD.VisualStudio/dns-sd.vcxproj.filters | 38 + .../Clients/DNS-SD.VisualStudio/resource.h | 14 + .../Clients/DNS-SD.xcodeproj/project.pbxproj | 737 + mDNSResponder/Clients/DNSServiceBrowser-Info.plist | 30 + .../Clients/DNSServiceBrowser.NET/App.ico | Bin 0 -> 1078 bytes .../Clients/DNSServiceBrowser.NET/AssemblyInfo.cs | 75 + .../DNSServiceBrowser.NET.csproj | 119 + .../DNSServiceBrowser.NET/DNSServiceBrowser.cs | 734 + .../DNSServiceBrowser.NET/DNSServiceBrowser.resx | 102 + .../DNSServiceBrowser.Designer.vb | 206 + .../DNSServiceBrowser.VB.vbproj | 121 + .../DNSServiceBrowser.VB/DNSServiceBrowser.resx | 120 + .../DNSServiceBrowser.VB/DNSServiceBrowser.vb | 196 + .../My Project/Application.Designer.vb | 38 + .../My Project/Application.myapp | 10 + .../My Project/AssemblyInfo.vb | 35 + .../My Project/Resources.Designer.vb | 62 + .../DNSServiceBrowser.VB/My Project/Resources.resx | 117 + .../My Project/Settings.Designer.vb | 73 + .../My Project/Settings.settings | 7 + mDNSResponder/Clients/DNSServiceBrowser.m | 679 + .../Clients/DNSServiceBrowser.nib/classes.nib | 37 + .../Clients/DNSServiceBrowser.nib/info.nib | 22 + .../Clients/DNSServiceBrowser.nib/objects.nib | Bin 0 -> 9008 bytes mDNSResponder/Clients/DNSServiceReg-Info.plist | 30 + mDNSResponder/Clients/DNSServiceReg.m | 274 + .../Clients/DNSServiceReg.nib/classes.nib | 30 + mDNSResponder/Clients/DNSServiceReg.nib/info.nib | 22 + .../Clients/DNSServiceReg.nib/objects.nib | Bin 0 -> 9113 bytes mDNSResponder/Clients/ExplorerPlugin/About.cpp | 90 + mDNSResponder/Clients/ExplorerPlugin/About.h | 28 + .../Clients/ExplorerPlugin/ClassFactory.cpp | 177 + .../Clients/ExplorerPlugin/ClassFactory.h | 51 + .../Clients/ExplorerPlugin/ExplorerBar.cpp | 659 + mDNSResponder/Clients/ExplorerPlugin/ExplorerBar.h | 104 + .../Clients/ExplorerPlugin/ExplorerBarWindow.cpp | 794 + .../Clients/ExplorerPlugin/ExplorerBarWindow.h | 264 + .../Clients/ExplorerPlugin/ExplorerPlugin.cpp | 600 + .../Clients/ExplorerPlugin/ExplorerPlugin.def | 24 + .../Clients/ExplorerPlugin/ExplorerPlugin.h | 47 + .../Clients/ExplorerPlugin/ExplorerPlugin.rc | 122 + .../Clients/ExplorerPlugin/ExplorerPlugin.vcproj | 595 + .../Clients/ExplorerPlugin/ExplorerPlugin.vcxproj | 402 + .../ExplorerPlugin/ExplorerPlugin.vcxproj.filters | 106 + .../Clients/ExplorerPlugin/ExplorerPluginLocRes.rc | 213 + .../ExplorerPlugin/ExplorerPluginLocRes.vcproj | 487 + .../ExplorerPlugin/ExplorerPluginLocRes.vcxproj | 397 + .../ExplorerPluginLocRes.vcxproj.filters | 23 + .../Clients/ExplorerPlugin/ExplorerPluginRes.rc | 140 + .../ExplorerPlugin/ExplorerPluginRes.vcproj | 518 + .../ExplorerPlugin/ExplorerPluginRes.vcxproj | 399 + .../ExplorerPluginRes.vcxproj.filters | 52 + .../Clients/ExplorerPlugin/LoginDialog.cpp | 111 + mDNSResponder/Clients/ExplorerPlugin/LoginDialog.h | 53 + mDNSResponder/Clients/ExplorerPlugin/ReadMe.txt | 9 + mDNSResponder/Clients/ExplorerPlugin/Resource.h | 28 + mDNSResponder/Clients/ExplorerPlugin/StdAfx.cpp | 18 + mDNSResponder/Clients/ExplorerPlugin/StdAfx.h | 41 + .../ExplorerPlugin/res/ExplorerPlugin.manifest | 22 + .../ExplorerPlugin/res/ExplorerPlugin64.manifest | 22 + mDNSResponder/Clients/ExplorerPlugin/res/about.bmp | Bin 0 -> 137944 bytes .../Clients/ExplorerPlugin/res/button-2k.ico | Bin 0 -> 10342 bytes .../Clients/ExplorerPlugin/res/button-xp.ico | Bin 0 -> 5342 bytes mDNSResponder/Clients/ExplorerPlugin/res/cold.ico | Bin 0 -> 10342 bytes mDNSResponder/Clients/ExplorerPlugin/res/hot.ico | Bin 0 -> 10342 bytes mDNSResponder/Clients/ExplorerPlugin/res/logo.bmp | Bin 0 -> 822 bytes .../Clients/ExplorerPlugin/resource_dll.h | 26 + .../Clients/ExplorerPlugin/resource_loc_res.h | 32 + .../Clients/ExplorerPlugin/resource_res.h | 30 + .../Clients/FirefoxExtension/CDNSSDService.cpp | 394 + .../Clients/FirefoxExtension/CDNSSDService.h | 104 + .../FirefoxExtension/CDNSSDServiceModule.cpp | 37 + .../Clients/FirefoxExtension/DNSSDService.sln | 20 + .../Clients/FirefoxExtension/FirefoxExtension.rc | 102 + .../FirefoxExtension/FirefoxExtension.vcproj | 282 + .../FirefoxExtension/FirefoxExtension.vcxproj | 179 + .../FirefoxExtension.vcxproj.filters | 47 + .../Clients/FirefoxExtension/IDNSSDService.h | 263 + .../Clients/FirefoxExtension/IDNSSDService.idl | 50 + .../FirefoxExtension/extension/chrome.manifest | 6 + .../extension/components/IDNSSDService.xpt | Bin 0 -> 376 bytes .../content/_internal_bonjour4firefox.png | Bin 0 -> 1589 bytes .../extension/content/_internal_listImage.png | Bin 0 -> 3417 bytes .../extension/content/bonjour4firefox.css | 16 + .../extension/content/bonjour4firefox.xul | 222 + .../extension/content/browserOverlay.xul | 32 + .../FirefoxExtension/extension/content/overlay.js | 21 + .../defaults/preferences/bonjour4firefox.js | 2 + .../Clients/FirefoxExtension/extension/install.rdf | 19 + .../extension/locale/en-US/bonjour4firefox.dtd | 6 + .../locale/en-US/bonjour4firefox.properties | 4 + .../Clients/FirefoxExtension/extension/readme.txt | 21 + .../skin-darwin/_internal_toobar-button.png | Bin 0 -> 6798 bytes .../extension/skin-darwin/overlay.css | 17 + .../extension/skin/_internal_toobar-button.png | Bin 0 -> 5022 bytes .../FirefoxExtension/extension/skin/overlay.css | 21 + mDNSResponder/Clients/FirefoxExtension/readme.txt | 16 + mDNSResponder/Clients/FirefoxExtension/resource.h | 27 + mDNSResponder/Clients/Java/BrowserApp.java | 420 + mDNSResponder/Clients/Java/BrowserApp.manifest | 2 + mDNSResponder/Clients/Java/DNSSDUnitTest.java | 334 + mDNSResponder/Clients/Java/JavaSamples.vcproj | 111 + mDNSResponder/Clients/Java/JavaSamples.vcxproj | 116 + mDNSResponder/Clients/Java/SimpleChat.java | 333 + mDNSResponder/Clients/Java/SimpleChat.manifest | 2 + .../Clients/Java/SwingBrowseListener.java | 124 + .../Clients/Java/SwingDomainListener.java | 116 + mDNSResponder/Clients/Java/SwingQueryListener.java | 108 + mDNSResponder/Clients/Java/nmakefile | 109 + mDNSResponder/Clients/Makefile | 54 + mDNSResponder/Clients/PrinterSetupWizard/About.cpp | 31 + mDNSResponder/Clients/PrinterSetupWizard/About.h | 21 + .../Clients/PrinterSetupWizard/FirstPage.cpp | 98 + .../Clients/PrinterSetupWizard/FirstPage.h | 50 + .../Clients/PrinterSetupWizard/FourthPage.cpp | 212 + .../Clients/PrinterSetupWizard/FourthPage.h | 61 + .../Clients/PrinterSetupWizard/Logger.cpp | 85 + mDNSResponder/Clients/PrinterSetupWizard/Logger.h | 63 + .../PrinterSetupWizard/PrinterSetupWizard.ncb | 1 + .../PrinterSetupWizard/PrinterSetupWizard.rc | 157 + .../PrinterSetupWizard/PrinterSetupWizard.vcproj | 638 + .../PrinterSetupWizard/PrinterSetupWizard.vcxproj | 365 + .../PrinterSetupWizard.vcxproj.filters | 145 + .../PrinterSetupWizard/PrinterSetupWizardApp.cpp | 172 + .../PrinterSetupWizard/PrinterSetupWizardApp.h | 48 + .../PrinterSetupWizard/PrinterSetupWizardLocRes.rc | 310 + .../PrinterSetupWizardLocRes.vcproj | 441 + .../PrinterSetupWizardLocRes.vcxproj | 345 + .../PrinterSetupWizardLocRes.vcxproj.filters | 29 + .../PrinterSetupWizard/PrinterSetupWizardRes.rc | 173 + .../PrinterSetupWizardRes.vcproj | 465 + .../PrinterSetupWizardRes.vcxproj | 347 + .../PrinterSetupWizardRes.vcxproj.filters | 47 + .../PrinterSetupWizard/PrinterSetupWizardSheet.cpp | 1949 +++ .../PrinterSetupWizard/PrinterSetupWizardSheet.h | 352 + .../Clients/PrinterSetupWizard/ReadMe.txt | 94 + .../Clients/PrinterSetupWizard/SecondPage.cpp | 513 + .../Clients/PrinterSetupWizard/SecondPage.h | 105 + .../Clients/PrinterSetupWizard/ThirdPage.cpp | 1583 ++ .../Clients/PrinterSetupWizard/ThirdPage.h | 159 + .../Clients/PrinterSetupWizard/UtilTypes.h | 280 + .../Clients/PrinterSetupWizard/res/Info.ico | Bin 0 -> 23558 bytes .../PrinterSetupWizard/res/NetworkPrinter.ico | Bin 0 -> 287934 bytes .../Clients/PrinterSetupWizard/res/Print.ico | Bin 0 -> 82726 bytes .../PrinterSetupWizard/res/PrinterSetupWizard.ico | Bin 0 -> 77214 bytes .../res/PrinterSetupWizard.manifest | 17 + .../PrinterSetupWizard/res/PrinterSetupWizard.rc2 | 13 + .../res/PrinterSetupWizard64.manifest | 17 + .../res/PrinterSetupWizardLocRes.rc2 | 13 + .../res/PrinterSetupWizardRes.rc2 | 13 + .../Clients/PrinterSetupWizard/res/Thumbs.db | Bin 0 -> 6144 bytes .../Clients/PrinterSetupWizard/res/about.bmp | Bin 0 -> 254802 bytes .../Clients/PrinterSetupWizard/res/banner_icon.bmp | Bin 0 -> 7308 bytes .../Clients/PrinterSetupWizard/res/watermark.bmp | Bin 0 -> 162908 bytes .../Clients/PrinterSetupWizard/resource.h | 29 + .../Clients/PrinterSetupWizard/resource_exe.h | 94 + .../Clients/PrinterSetupWizard/resource_loc_res.h | 95 + .../Clients/PrinterSetupWizard/resource_res.h | 94 + .../Clients/PrinterSetupWizard/stdafx.cpp | 20 + mDNSResponder/Clients/PrinterSetupWizard/stdafx.h | 61 + mDNSResponder/Clients/PrinterSetupWizard/tcpxcv.h | 107 + mDNSResponder/Clients/ReadMe.txt | 25 + mDNSResponder/Clients/SimpleChat.NET/App.ico | Bin 0 -> 1078 bytes .../Clients/SimpleChat.NET/AssemblyInfo.cs | 75 + .../Clients/SimpleChat.NET/SimpleChat.NET.csproj | 116 + mDNSResponder/Clients/SimpleChat.NET/SimpleChat.cs | 601 + .../Clients/SimpleChat.NET/SimpleChat.resx | 102 + .../My Project/Application.Designer.vb | 38 + .../SimpleChat.VB/My Project/Application.myapp | 10 + .../SimpleChat.VB/My Project/AssemblyInfo.vb | 35 + .../SimpleChat.VB/My Project/Resources.Designer.vb | 63 + .../SimpleChat.VB/My Project/Resources.resx | 117 + .../SimpleChat.VB/My Project/Settings.Designer.vb | 73 + .../SimpleChat.VB/My Project/Settings.settings | 7 + .../Clients/SimpleChat.VB/SimpleChat.Designer.vb | 102 + .../Clients/SimpleChat.VB/SimpleChat.VB.vbproj | 121 + .../Clients/SimpleChat.VB/SimpleChat.resx | 120 + mDNSResponder/Clients/SimpleChat.VB/SimpleChat.vb | 157 + mDNSResponder/Clients/dns-sd.c | 1815 +++ mDNSResponder/Clients/dnsctl.c | 177 + .../mDNSNetMonitor.manifest | 12 + .../mDNSNetMonitor.VisualStudio/mDNSNetMonitor.rc | 103 + .../mDNSNetMonitor.vcproj | 296 + .../mDNSNetMonitor.vcxproj | 241 + .../mDNSNetMonitor.vcxproj.filters | 110 + .../Clients/mDNSNetMonitor.VisualStudio/resource.h | 14 + mDNSResponder/LICENSE | 13 + mDNSResponder/Makefile | 49 + mDNSResponder/PrivateDNS.txt | 275 + mDNSResponder/README.txt | 166 + mDNSResponder/mDNSCore/CryptoAlg.c | 280 + mDNSResponder/mDNSCore/CryptoAlg.h | 61 + mDNSResponder/mDNSCore/DNSCommon.c | 4319 ++++++ mDNSResponder/mDNSCore/DNSCommon.h | 315 + mDNSResponder/mDNSCore/DNSDigest.c | 1567 ++ mDNSResponder/mDNSCore/Implementer Notes.txt | 66 + mDNSResponder/mDNSCore/anonymous.c | 597 + mDNSResponder/mDNSCore/anonymous.h | 31 + mDNSResponder/mDNSCore/dnsproxy.c | 836 ++ mDNSResponder/mDNSCore/dnsproxy.h | 30 + mDNSResponder/mDNSCore/dnssec.c | 4111 +++++ mDNSResponder/mDNSCore/dnssec.h | 157 + mDNSResponder/mDNSCore/mDNS.c | 15034 +++++++++++++++++++ mDNSResponder/mDNSCore/mDNSDebug.h | 166 + mDNSResponder/mDNSCore/mDNSEmbeddedAPI.h | 3586 +++++ mDNSResponder/mDNSCore/nsec.c | 1266 ++ mDNSResponder/mDNSCore/nsec.h | 33 + mDNSResponder/mDNSCore/nsec3.c | 769 + mDNSResponder/mDNSCore/nsec3.h | 28 + mDNSResponder/mDNSCore/uDNS.c | 5995 ++++++++ mDNSResponder/mDNSCore/uDNS.h | 151 + mDNSResponder/mDNSMacOS9/CarbonResource.r | 18 + mDNSResponder/mDNSMacOS9/Mac OS Test Responder.c | 227 + mDNSResponder/mDNSMacOS9/Mac OS Test Searcher.c | 243 + mDNSResponder/mDNSMacOS9/README.txt | 48 + mDNSResponder/mDNSMacOS9/Responder.c | 183 + mDNSResponder/mDNSMacOS9/Searcher.c | 240 + mDNSResponder/mDNSMacOS9/ShowInitIcon.c | 160 + mDNSResponder/mDNSMacOS9/ShowInitIcon.h | 20 + mDNSResponder/mDNSMacOS9/SubTypeTester.c | 217 + mDNSResponder/mDNSMacOS9/mDNS.mcp | Bin 0 -> 1002330 bytes mDNSResponder/mDNSMacOS9/mDNSLibrary.c | 63 + mDNSResponder/mDNSMacOS9/mDNSLibraryLoader.c | 68 + mDNSResponder/mDNSMacOS9/mDNSLibraryResources.r | 197 + mDNSResponder/mDNSMacOS9/mDNSMacOS9.c | 687 + mDNSResponder/mDNSMacOS9/mDNSMacOS9.h | 58 + mDNSResponder/mDNSMacOS9/mDNSPrefix.h | 64 + mDNSResponder/mDNSMacOSX/BonjourEvents-Info.plist | 49 + mDNSResponder/mDNSMacOSX/BonjourEvents.c | 991 ++ mDNSResponder/mDNSMacOSX/CUPolicy.c | 91 + mDNSResponder/mDNSMacOSX/CryptoSupport.c | 738 + mDNSResponder/mDNSMacOSX/CryptoSupport.h | 22 + mDNSResponder/mDNSMacOSX/DNSProxySupport.c | 543 + mDNSResponder/mDNSMacOSX/DNSSECSupport.c | 645 + mDNSResponder/mDNSMacOSX/DNSSECSupport.h | 24 + mDNSResponder/mDNSMacOSX/DNSServiceDiscovery.c | 674 + mDNSResponder/mDNSMacOSX/DNSServiceDiscovery.h | 314 + .../mDNSMacOSX/DNSServiceDiscoveryDefines.h | 31 + .../mDNSMacOSX/DNSServiceDiscoveryReply.defs | 60 + .../mDNSMacOSX/DNSServiceDiscoveryRequest.defs | 80 + .../mDNSMacOSX/LaunchDaemonInfo-Tiger.helper.plist | 18 + .../mDNSMacOSX/LaunchDaemonInfo-Tiger.plist | 17 + .../mDNSMacOSX/LaunchDaemonInfo.dnsextd.plist | 17 + .../mDNSMacOSX/LaunchDaemonInfo.helper.plist | 25 + mDNSResponder/mDNSMacOSX/LaunchDaemonInfo.plist | 45 + mDNSResponder/mDNSMacOSX/LegacyNATTraversal.c | 933 ++ mDNSResponder/mDNSMacOSX/P2PPacketFilter.c | 298 + mDNSResponder/mDNSMacOSX/P2PPacketFilter.h | 31 + .../PreferencePane/Artwork/add_idle.tiff | Bin 0 -> 728 bytes .../PreferencePane/Artwork/add_pressed.tiff | Bin 0 -> 688 bytes .../mDNSMacOSX/PreferencePane/Artwork/failure.tiff | Bin 0 -> 638 bytes .../PreferencePane/Artwork/inprogress.tiff | Bin 0 -> 644 bytes .../PreferencePane/Artwork/remove_disabled.tiff | Bin 0 -> 698 bytes .../PreferencePane/Artwork/remove_idle.tiff | Bin 0 -> 694 bytes .../PreferencePane/Artwork/remove_pressed.tiff | Bin 0 -> 656 bytes .../mDNSMacOSX/PreferencePane/Artwork/success.tiff | Bin 0 -> 676 bytes .../mDNSMacOSX/PreferencePane/BonjourPref.icns | Bin 0 -> 39193 bytes .../mDNSMacOSX/PreferencePane/BonjourPref.tiff | Bin 0 -> 2430 bytes .../PreferencePane/ConfigurationAuthority.c | 180 + .../PreferencePane/ConfigurationAuthority.h | 52 + .../PreferencePane/ConfigurationRights.h | 49 + .../PreferencePane/DNSServiceDiscoveryPref.h | 170 + .../PreferencePane/DNSServiceDiscoveryPref.m | 1194 ++ .../DNSServiceDiscoveryPref.nib/classes.nib | 59 + .../DNSServiceDiscoveryPref.nib/info.nib | 18 + .../DNSServiceDiscoveryPref.nib/keyedobjects.nib | Bin 0 -> 21082 bytes .../PreferencePane/English.lproj/InfoPlist.strings | Bin 0 -> 484 bytes .../PreferencePane/Info-PreferencePane.plist | 36 + .../PreferencePane/PrivilegedOperations.c | 230 + .../PreferencePane/PrivilegedOperations.h | 70 + .../mDNSMacOSX/PreferencePane/ddnswriteconfig.m | 442 + .../mDNSMacOSX/PreferencePane/installtool | 94 + mDNSResponder/mDNSMacOSX/Private/dns_services.c | 212 + mDNSResponder/mDNSMacOSX/Private/dns_services.h | 124 + mDNSResponder/mDNSMacOSX/Private/dns_xpc.h | 33 + mDNSResponder/mDNSMacOSX/Private/xpc_services.c | 255 + mDNSResponder/mDNSMacOSX/Private/xpc_services.h | 21 + mDNSResponder/mDNSMacOSX/README.privsep | 40 + mDNSResponder/mDNSMacOSX/VPNService.c | 35 + .../mDNSMacOSX/com.apple.networking.mDNSResponder | 1 + mDNSResponder/mDNSMacOSX/daemon.c | 3052 ++++ mDNSResponder/mDNSMacOSX/dnsctl-entitlements.plist | 8 + mDNSResponder/mDNSMacOSX/helper-entitlements.plist | 12 + mDNSResponder/mDNSMacOSX/helper-error.h | 49 + mDNSResponder/mDNSMacOSX/helper-main.c | 298 + mDNSResponder/mDNSMacOSX/helper-server.h | 31 + mDNSResponder/mDNSMacOSX/helper-stubs.c | 496 + mDNSResponder/mDNSMacOSX/helper.c | 2867 ++++ mDNSResponder/mDNSMacOSX/helper.h | 84 + mDNSResponder/mDNSMacOSX/helpermsg-types.h | 30 + mDNSResponder/mDNSMacOSX/helpermsg.defs | 143 + mDNSResponder/mDNSMacOSX/ipsec_strerror.h | 78 + mDNSResponder/mDNSMacOSX/libpfkey.h | 105 + mDNSResponder/mDNSMacOSX/mDNSMacOSX.c | 10442 +++++++++++++ mDNSResponder/mDNSMacOSX/mDNSMacOSX.h | 295 + .../Resources/English.lproj/Localizable.strings | 13 + .../Resources/French.lproj/Localizable.strings | 13 + .../mDNSMacOSX/mDNSResponder-entitlements.plist | 24 + mDNSResponder/mDNSMacOSX/mDNSResponder.order | 314 + .../mDNSResponder.pbproj/project.pbxproj | 2338 +++ mDNSResponder/mDNSMacOSX/mDNSResponder.plist | 31 + mDNSResponder/mDNSMacOSX/mDNSResponder.sb | 151 + mDNSResponder/mDNSMacOSX/mDNSResponder.txt | 55 + .../mDNSResponder.xcodeproj/project.pbxproj | 3137 ++++ mDNSResponder/mDNSMacOSX/mDNSResponderHelper.8 | 54 + mDNSResponder/mDNSMacOSX/mDNSResponderHelper.plist | 13 + .../mDNSMacOSX/mDNSResponderLogging.mobileconfig | 57 + mDNSResponder/mDNSMacOSX/pfkey.c | 2138 +++ mDNSResponder/mDNSPosix/Client.c | 223 + mDNSResponder/mDNSPosix/ExampleClientApp.c | 91 + mDNSResponder/mDNSPosix/ExampleClientApp.h | 18 + mDNSResponder/mDNSPosix/Identify.c | 376 + mDNSResponder/mDNSPosix/Makefile | 523 + mDNSResponder/mDNSPosix/NetMonitor.c | 1003 ++ mDNSResponder/mDNSPosix/PosixDaemon.c | 258 + mDNSResponder/mDNSPosix/ProxyResponder.c | 300 + mDNSResponder/mDNSPosix/ReadMe.txt | 314 + mDNSResponder/mDNSPosix/Responder.c | 788 + mDNSResponder/mDNSPosix/Services.txt | 36 + mDNSResponder/mDNSPosix/libnss_mdns.8 | 148 + mDNSResponder/mDNSPosix/mDNSPosix.c | 1789 +++ mDNSResponder/mDNSPosix/mDNSPosix.h | 85 + mDNSResponder/mDNSPosix/mDNSUNP.c | 719 + mDNSResponder/mDNSPosix/mDNSUNP.h | 130 + mDNSResponder/mDNSPosix/mdnsd.sh | 73 + mDNSResponder/mDNSPosix/nss_ReadMe.txt | 125 + mDNSResponder/mDNSPosix/nss_mdns.c | 2723 ++++ mDNSResponder/mDNSPosix/nss_mdns.conf | 13 + mDNSResponder/mDNSPosix/nss_mdns.conf.5 | 135 + mDNSResponder/mDNSPosix/parselog.py | 247 + mDNSResponder/mDNSResponder.sln | 361 + mDNSResponder/mDNSShared/CommonServices.h | 1537 ++ mDNSResponder/mDNSShared/DebugServices.c | 3075 ++++ mDNSResponder/mDNSShared/DebugServices.h | 1607 ++ mDNSResponder/mDNSShared/GenLinkedList.c | 319 + mDNSResponder/mDNSShared/GenLinkedList.h | 90 + mDNSResponder/mDNSShared/Java/BaseListener.java | 36 + mDNSResponder/mDNSShared/Java/BrowseListener.java | 73 + mDNSResponder/mDNSShared/Java/DNSRecord.java | 52 + mDNSResponder/mDNSShared/Java/DNSSD.java | 860 ++ mDNSResponder/mDNSShared/Java/DNSSDException.java | 64 + .../mDNSShared/Java/DNSSDRecordRegistrar.java | 64 + .../mDNSShared/Java/DNSSDRegistration.java | 60 + mDNSResponder/mDNSShared/Java/DNSSDService.java | 37 + mDNSResponder/mDNSShared/Java/DomainListener.java | 60 + mDNSResponder/mDNSShared/Java/JNISupport.c | 1072 ++ mDNSResponder/mDNSShared/Java/QueryListener.java | 59 + .../mDNSShared/Java/RegisterListener.java | 49 + .../mDNSShared/Java/RegisterRecordListener.java | 37 + mDNSResponder/mDNSShared/Java/ResolveListener.java | 56 + mDNSResponder/mDNSShared/Java/TXTRecord.java | 290 + mDNSResponder/mDNSShared/PlatformCommon.c | 199 + mDNSResponder/mDNSShared/PlatformCommon.h | 18 + mDNSResponder/mDNSShared/dns-sd.1 | 266 + mDNSResponder/mDNSShared/dns_sd.h | 2657 ++++ mDNSResponder/mDNSShared/dnsextd.8 | 69 + mDNSResponder/mDNSShared/dnsextd.c | 3150 ++++ mDNSResponder/mDNSShared/dnsextd.conf | 60 + mDNSResponder/mDNSShared/dnsextd.h | 163 + mDNSResponder/mDNSShared/dnsextd_lexer.l | 84 + mDNSResponder/mDNSShared/dnsextd_parser.y | 585 + mDNSResponder/mDNSShared/dnssd_clientlib.c | 366 + mDNSResponder/mDNSShared/dnssd_clientshim.c | 811 + mDNSResponder/mDNSShared/dnssd_clientstub.c | 2363 +++ mDNSResponder/mDNSShared/dnssd_ipc.c | 161 + mDNSResponder/mDNSShared/dnssd_ipc.h | 221 + mDNSResponder/mDNSShared/mDNSDebug.c | 95 + mDNSResponder/mDNSShared/mDNSResponder.8 | 116 + mDNSResponder/mDNSShared/uds_daemon.c | 6103 ++++++++ mDNSResponder/mDNSShared/uds_daemon.h | 90 + mDNSResponder/mDNSVxWorks/README.txt | 8 + mDNSResponder/mDNSVxWorks/mDNSVxWorks.c | 2147 +++ mDNSResponder/mDNSVxWorks/mDNSVxWorks.h | 122 + mDNSResponder/mDNSVxWorks/mDNSVxWorksIPv4Only.c | 2088 +++ mDNSResponder/mDNSVxWorks/mDNSVxWorksIPv4Only.h | 129 + .../mDNSWindows/ControlPanel/BrowsingPage.cpp | 441 + .../mDNSWindows/ControlPanel/BrowsingPage.h | 156 + .../mDNSWindows/ControlPanel/ConfigDialog.cpp | 59 + .../mDNSWindows/ControlPanel/ConfigDialog.h | 48 + .../ControlPanel/ConfigPropertySheet.cpp | 301 + .../mDNSWindows/ControlPanel/ConfigPropertySheet.h | 105 + .../mDNSWindows/ControlPanel/ControlPanel.cpp | 380 + .../mDNSWindows/ControlPanel/ControlPanel.def | 20 + .../mDNSWindows/ControlPanel/ControlPanel.h | 84 + .../mDNSWindows/ControlPanel/ControlPanel.rc | 141 + .../mDNSWindows/ControlPanel/ControlPanel.vcproj | 727 + .../mDNSWindows/ControlPanel/ControlPanel.vcxproj | 385 + .../ControlPanel/ControlPanel.vcxproj.filters | 130 + .../mDNSWindows/ControlPanel/ControlPanelDll.rc | 123 + .../mDNSWindows/ControlPanel/ControlPanelExe.cpp | 373 + .../mDNSWindows/ControlPanel/ControlPanelExe.h | 48 + .../mDNSWindows/ControlPanel/ControlPanelExe.rc | 123 + .../ControlPanel/ControlPanelExe.vcproj | 764 + .../mDNSWindows/ControlPanel/ControlPanelLocRes.rc | 270 + .../ControlPanel/ControlPanelLocRes.vcproj | 487 + .../ControlPanel/ControlPanelLocRes.vcxproj | 382 + .../ControlPanelLocRes.vcxproj.filters | 23 + .../mDNSWindows/ControlPanel/ControlPanelRes.rc | 134 + .../ControlPanel/ControlPanelRes.vcproj | 518 + .../ControlPanel/ControlPanelRes.vcxproj | 393 + .../ControlPanel/ControlPanelRes.vcxproj.filters | 52 + .../mDNSWindows/ControlPanel/FourthPage.cpp | 197 + .../mDNSWindows/ControlPanel/FourthPage.h | 87 + .../mDNSWindows/ControlPanel/RegistrationPage.cpp | 387 + .../mDNSWindows/ControlPanel/RegistrationPage.h | 75 + .../mDNSWindows/ControlPanel/SecondPage.cpp | 544 + .../mDNSWindows/ControlPanel/SecondPage.h | 107 + .../mDNSWindows/ControlPanel/ServicesPage.cpp | 273 + .../mDNSWindows/ControlPanel/ServicesPage.h | 123 + .../mDNSWindows/ControlPanel/SharedSecret.cpp | 115 + .../mDNSWindows/ControlPanel/SharedSecret.h | 54 + .../ControlPanel/res/ControlPanel.dll.manifest | 10 + .../ControlPanel/res/ControlPanel.exe.manifest | 17 + .../ControlPanel/res/ControlPanel.manifest | 17 + .../mDNSWindows/ControlPanel/res/ControlPanel.rc2 | 13 + .../ControlPanel/res/ControlPanel64.manifest | 17 + .../mDNSWindows/ControlPanel/res/EnergySaver.ico | Bin 0 -> 16958 bytes .../mDNSWindows/ControlPanel/res/controlpanel.ico | Bin 0 -> 1434518 bytes .../mDNSWindows/ControlPanel/res/failure.ico | Bin 0 -> 894 bytes .../mDNSWindows/ControlPanel/res/success.ico | Bin 0 -> 894 bytes mDNSResponder/mDNSWindows/ControlPanel/resource.h | 56 + mDNSResponder/mDNSWindows/ControlPanel/stdafx.cpp | 20 + mDNSResponder/mDNSWindows/ControlPanel/stdafx.h | 64 + mDNSResponder/mDNSWindows/DLL.NET/AssemblyInfo.cpp | 84 + mDNSResponder/mDNSWindows/DLL.NET/PString.h | 70 + mDNSResponder/mDNSWindows/DLL.NET/Stdafx.cpp | 22 + mDNSResponder/mDNSWindows/DLL.NET/Stdafx.h | 33 + mDNSResponder/mDNSWindows/DLL.NET/dnssd_NET.cpp | 1234 ++ mDNSResponder/mDNSWindows/DLL.NET/dnssd_NET.h | 1392 ++ mDNSResponder/mDNSWindows/DLL.NET/dnssd_NET.ico | Bin 0 -> 1078 bytes mDNSResponder/mDNSWindows/DLL.NET/dnssd_NET.rc | 113 + mDNSResponder/mDNSWindows/DLL.NET/dnssd_NET.vcproj | 446 + mDNSResponder/mDNSWindows/DLL.NET/resource.h | 3 + mDNSResponder/mDNSWindows/DLL/dll.aps | Bin 0 -> 18692 bytes mDNSResponder/mDNSWindows/DLL/dll.rc | 102 + mDNSResponder/mDNSWindows/DLL/dllmain.c | 113 + mDNSResponder/mDNSWindows/DLL/dnssd.def | 48 + mDNSResponder/mDNSWindows/DLL/dnssd.vcproj | 472 + mDNSResponder/mDNSWindows/DLL/dnssd.vcxproj | 287 + .../mDNSWindows/DLL/dnssd.vcxproj.filters | 67 + mDNSResponder/mDNSWindows/DLL/resource.h | 27 + mDNSResponder/mDNSWindows/DLLStub/DLLStub.cpp | 693 + mDNSResponder/mDNSWindows/DLLStub/DLLStub.h | 52 + mDNSResponder/mDNSWindows/DLLStub/DLLStub.vcproj | 324 + mDNSResponder/mDNSWindows/DLLStub/DLLStub.vcxproj | 188 + .../mDNSWindows/DLLStub/DLLStub.vcxproj.filters | 30 + mDNSResponder/mDNSWindows/DLLX/DLLX.cpp | 208 + mDNSResponder/mDNSWindows/DLLX/DLLX.def | 35 + mDNSResponder/mDNSWindows/DLLX/DLLX.idl | 491 + mDNSResponder/mDNSWindows/DLLX/DLLX.rc | 126 + mDNSResponder/mDNSWindows/DLLX/DLLX.rgs | 11 + mDNSResponder/mDNSWindows/DLLX/DLLX.vcproj | 625 + mDNSResponder/mDNSWindows/DLLX/DLLX.vcxproj | 328 + .../mDNSWindows/DLLX/DLLX.vcxproj.filters | 121 + mDNSResponder/mDNSWindows/DLLX/DNSSD.cpp | 892 ++ .../mDNSWindows/DLLX/DNSSDEventManager.cpp | 31 + mDNSResponder/mDNSWindows/DLLX/DNSSDEventManager.h | 133 + .../mDNSWindows/DLLX/DNSSDEventManager.rgs | 27 + mDNSResponder/mDNSWindows/DLLX/DNSSDRecord.cpp | 101 + mDNSResponder/mDNSWindows/DLLX/DNSSDRecord.h | 185 + mDNSResponder/mDNSWindows/DLLX/DNSSDRecord.rgs | 27 + mDNSResponder/mDNSWindows/DLLX/DNSSDService.cpp | 2095 +++ mDNSResponder/mDNSWindows/DLLX/DNSSDService.h | 429 + mDNSResponder/mDNSWindows/DLLX/DNSSDService.rgs | 27 + mDNSResponder/mDNSWindows/DLLX/StringServices.cpp | 344 + mDNSResponder/mDNSWindows/DLLX/StringServices.h | 102 + mDNSResponder/mDNSWindows/DLLX/TXTRecord.cpp | 382 + mDNSResponder/mDNSWindows/DLLX/TXTRecord.h | 203 + mDNSResponder/mDNSWindows/DLLX/TXTRecord.rgs | 27 + mDNSResponder/mDNSWindows/DLLX/_IDNSSDEvents_CP.h | 358 + mDNSResponder/mDNSWindows/DLLX/dlldatax.c | 51 + mDNSResponder/mDNSWindows/DLLX/dlldatax.h | 49 + mDNSResponder/mDNSWindows/DLLX/resource.h | 30 + mDNSResponder/mDNSWindows/DLLX/stdafx.h | 88 + .../Windows/ApplicationVS2002.sln | 21 + .../Windows/ApplicationVS2002.vcproj | 253 + .../Windows/ApplicationVS2003.sln | 21 + .../Windows/ApplicationVS2003.vcproj | 267 + .../Windows/Resources/Application.ico | Bin 0 -> 3638 bytes .../Windows/Resources/Application.rc | 323 + .../Windows/Resources/Application.rc2 | 20 + .../DNSServiceBrowser/Windows/Resources/Resource.h | 53 + .../Windows/Sources/AboutDialog.cpp | 71 + .../Windows/Sources/AboutDialog.h | 62 + .../Windows/Sources/Application.cpp | 111 + .../Windows/Sources/Application.h | 68 + .../Windows/Sources/ChooserDialog.cpp | 1426 ++ .../Windows/Sources/ChooserDialog.h | 131 + .../Windows/Sources/LoginDialog.cpp | 109 + .../Windows/Sources/LoginDialog.h | 53 + .../DNSServiceBrowser/Windows/Sources/StdAfx.cpp | 18 + .../DNSServiceBrowser/Windows/Sources/StdAfx.h | 48 + .../DNSServiceBrowser/WindowsCE/Application.vcc | 37 + .../DNSServiceBrowser/WindowsCE/Application.vcp | 868 ++ .../DNSServiceBrowser/WindowsCE/Application.vcw | 29 + .../WindowsCE/Resources/Application.ico | Bin 0 -> 1406 bytes .../WindowsCE/Resources/Application.rc | 194 + .../WindowsCE/Resources/Application.rc2 | 13 + .../DNSServiceBrowser/WindowsCE/Resources/newres.h | 28 + .../WindowsCE/Resources/resource.h | 22 + .../WindowsCE/Sources/Application.cpp | 92 + .../WindowsCE/Sources/Application.h | 57 + .../WindowsCE/Sources/BrowserDialog.cpp | 394 + .../WindowsCE/Sources/BrowserDialog.h | 84 + .../DNSServiceBrowser/WindowsCE/Sources/StdAfx.cpp | 18 + .../DNSServiceBrowser/WindowsCE/Sources/StdAfx.h | 46 + mDNSResponder/mDNSWindows/Java/Java.vcproj | 111 + mDNSResponder/mDNSWindows/Java/Java.vcxproj | 116 + mDNSResponder/mDNSWindows/Java/jdns_sd.rc | 62 + mDNSResponder/mDNSWindows/Java/makefile | 143 + mDNSResponder/mDNSWindows/Java/makefile64 | 143 + mDNSResponder/mDNSWindows/NSPTool/NSPTool.aps | Bin 0 -> 34296 bytes mDNSResponder/mDNSWindows/NSPTool/NSPTool.c | 581 + mDNSResponder/mDNSWindows/NSPTool/NSPTool.rc | 103 + mDNSResponder/mDNSWindows/NSPTool/NSPTool.vcproj | 409 + mDNSResponder/mDNSWindows/NSPTool/NSPTool.vcxproj | 214 + .../mDNSWindows/NSPTool/NSPTool.vcxproj.filters | 41 + mDNSResponder/mDNSWindows/NSPTool/Prefix.h | 28 + mDNSResponder/mDNSWindows/NSPTool/resource.h | 27 + mDNSResponder/mDNSWindows/Poll.c | 728 + mDNSResponder/mDNSWindows/Poll.h | 61 + mDNSResponder/mDNSWindows/PosixCompat.c | 128 + mDNSResponder/mDNSWindows/PosixCompat.h | 70 + mDNSResponder/mDNSWindows/README.txt | 85 + mDNSResponder/mDNSWindows/RegNames.h | 57 + mDNSResponder/mDNSWindows/Secret.c | 338 + mDNSResponder/mDNSWindows/Secret.h | 42 + .../mDNSWindows/SystemService/EventLog.mc | 11 + .../mDNSWindows/SystemService/EventLogMessages.bin | Bin 0 -> 28 bytes .../mDNSWindows/SystemService/Firewall.cpp | 484 + mDNSResponder/mDNSWindows/SystemService/Firewall.h | 79 + mDNSResponder/mDNSWindows/SystemService/Prefix.h | 30 + .../mDNSWindows/SystemService/Service.aps | Bin 0 -> 3388 bytes mDNSResponder/mDNSWindows/SystemService/Service.c | 2616 ++++ mDNSResponder/mDNSWindows/SystemService/Service.h | 30 + .../mDNSWindows/SystemService/Service.mcp | Bin 0 -> 126095 bytes mDNSResponder/mDNSWindows/SystemService/Service.rc | 114 + .../mDNSWindows/SystemService/Service.vcproj | 570 + .../mDNSWindows/SystemService/Service.vcxproj | 311 + .../SystemService/Service.vcxproj.filters | 133 + mDNSResponder/mDNSWindows/SystemService/main.c | 32 + .../SystemService/res/mDNSResponder.manifest | 12 + .../SystemService/res/mDNSResponder64.manifest | 12 + mDNSResponder/mDNSWindows/SystemService/resource.h | 17 + mDNSResponder/mDNSWindows/SystemService/resrc1.h | 15 + mDNSResponder/mDNSWindows/VPCDetect.cpp | 165 + mDNSResponder/mDNSWindows/VPCDetect.h | 36 + mDNSResponder/mDNSWindows/WinServices.cpp | 93 + mDNSResponder/mDNSWindows/WinServices.h | 34 + mDNSResponder/mDNSWindows/WinVersRes.h | 35 + mDNSResponder/mDNSWindows/isocode.h | 135 + mDNSResponder/mDNSWindows/loclibrary.c | 268 + mDNSResponder/mDNSWindows/loclibrary.h | 54 + mDNSResponder/mDNSWindows/mDNSWin32.c | 5197 +++++++ mDNSResponder/mDNSWindows/mDNSWin32.h | 163 + mDNSResponder/mDNSWindows/mdnsNSP/ReadMe.txt | 15 + mDNSResponder/mDNSWindows/mdnsNSP/mdnsNSP.aps | Bin 0 -> 34332 bytes mDNSResponder/mDNSWindows/mdnsNSP/mdnsNSP.c | 2430 +++ mDNSResponder/mDNSWindows/mdnsNSP/mdnsNSP.def | 24 + mDNSResponder/mDNSWindows/mdnsNSP/mdnsNSP.rc | 104 + mDNSResponder/mDNSWindows/mdnsNSP/mdnsNSP.vcproj | 457 + mDNSResponder/mDNSWindows/mdnsNSP/mdnsNSP.vcxproj | 276 + .../mDNSWindows/mdnsNSP/mdnsNSP.vcxproj.filters | 55 + mDNSResponder/mDNSWindows/mdnsNSP/resource.h | 27 + 578 files changed, 195006 insertions(+) create mode 100644 mDNSResponder/Clients/BonjourExample/BonjourExample.cpp create mode 100644 mDNSResponder/Clients/BonjourExample/BonjourExample.sln create mode 100644 mDNSResponder/Clients/BonjourExample/BonjourExample.vcproj create mode 100644 mDNSResponder/Clients/BonjourExample/stdafx.cpp create mode 100644 mDNSResponder/Clients/BonjourExample/stdafx.h create mode 100644 mDNSResponder/Clients/ClientCommon.c create mode 100644 mDNSResponder/Clients/ClientCommon.h create mode 100644 mDNSResponder/Clients/DNS-SD.VisualStudio/DNS-SD.manifest create mode 100644 mDNSResponder/Clients/DNS-SD.VisualStudio/DNS-SD64.manifest create mode 100755 mDNSResponder/Clients/DNS-SD.VisualStudio/dns-sd.rc create mode 100755 mDNSResponder/Clients/DNS-SD.VisualStudio/dns-sd.sdk.rc create mode 100755 mDNSResponder/Clients/DNS-SD.VisualStudio/dns-sd.sdk.vcproj create mode 100755 mDNSResponder/Clients/DNS-SD.VisualStudio/dns-sd.vcproj create mode 100755 mDNSResponder/Clients/DNS-SD.VisualStudio/dns-sd.vcxproj create mode 100755 mDNSResponder/Clients/DNS-SD.VisualStudio/dns-sd.vcxproj.filters create mode 100755 mDNSResponder/Clients/DNS-SD.VisualStudio/resource.h create mode 100644 mDNSResponder/Clients/DNS-SD.xcodeproj/project.pbxproj create mode 100644 mDNSResponder/Clients/DNSServiceBrowser-Info.plist create mode 100755 mDNSResponder/Clients/DNSServiceBrowser.NET/App.ico create mode 100755 mDNSResponder/Clients/DNSServiceBrowser.NET/AssemblyInfo.cs create mode 100755 mDNSResponder/Clients/DNSServiceBrowser.NET/DNSServiceBrowser.NET.csproj create mode 100755 mDNSResponder/Clients/DNSServiceBrowser.NET/DNSServiceBrowser.cs create mode 100755 mDNSResponder/Clients/DNSServiceBrowser.NET/DNSServiceBrowser.resx create mode 100644 mDNSResponder/Clients/DNSServiceBrowser.VB/DNSServiceBrowser.Designer.vb create mode 100644 mDNSResponder/Clients/DNSServiceBrowser.VB/DNSServiceBrowser.VB.vbproj create mode 100644 mDNSResponder/Clients/DNSServiceBrowser.VB/DNSServiceBrowser.resx create mode 100644 mDNSResponder/Clients/DNSServiceBrowser.VB/DNSServiceBrowser.vb create mode 100644 mDNSResponder/Clients/DNSServiceBrowser.VB/My Project/Application.Designer.vb create mode 100644 mDNSResponder/Clients/DNSServiceBrowser.VB/My Project/Application.myapp create mode 100644 mDNSResponder/Clients/DNSServiceBrowser.VB/My Project/AssemblyInfo.vb create mode 100644 mDNSResponder/Clients/DNSServiceBrowser.VB/My Project/Resources.Designer.vb create mode 100644 mDNSResponder/Clients/DNSServiceBrowser.VB/My Project/Resources.resx create mode 100644 mDNSResponder/Clients/DNSServiceBrowser.VB/My Project/Settings.Designer.vb create mode 100644 mDNSResponder/Clients/DNSServiceBrowser.VB/My Project/Settings.settings create mode 100755 mDNSResponder/Clients/DNSServiceBrowser.m create mode 100644 mDNSResponder/Clients/DNSServiceBrowser.nib/classes.nib create mode 100644 mDNSResponder/Clients/DNSServiceBrowser.nib/info.nib create mode 100644 mDNSResponder/Clients/DNSServiceBrowser.nib/objects.nib create mode 100644 mDNSResponder/Clients/DNSServiceReg-Info.plist create mode 100644 mDNSResponder/Clients/DNSServiceReg.m create mode 100644 mDNSResponder/Clients/DNSServiceReg.nib/classes.nib create mode 100644 mDNSResponder/Clients/DNSServiceReg.nib/info.nib create mode 100644 mDNSResponder/Clients/DNSServiceReg.nib/objects.nib create mode 100644 mDNSResponder/Clients/ExplorerPlugin/About.cpp create mode 100644 mDNSResponder/Clients/ExplorerPlugin/About.h create mode 100644 mDNSResponder/Clients/ExplorerPlugin/ClassFactory.cpp create mode 100644 mDNSResponder/Clients/ExplorerPlugin/ClassFactory.h create mode 100644 mDNSResponder/Clients/ExplorerPlugin/ExplorerBar.cpp create mode 100644 mDNSResponder/Clients/ExplorerPlugin/ExplorerBar.h create mode 100644 mDNSResponder/Clients/ExplorerPlugin/ExplorerBarWindow.cpp create mode 100644 mDNSResponder/Clients/ExplorerPlugin/ExplorerBarWindow.h create mode 100644 mDNSResponder/Clients/ExplorerPlugin/ExplorerPlugin.cpp create mode 100644 mDNSResponder/Clients/ExplorerPlugin/ExplorerPlugin.def create mode 100644 mDNSResponder/Clients/ExplorerPlugin/ExplorerPlugin.h create mode 100644 mDNSResponder/Clients/ExplorerPlugin/ExplorerPlugin.rc create mode 100644 mDNSResponder/Clients/ExplorerPlugin/ExplorerPlugin.vcproj create mode 100755 mDNSResponder/Clients/ExplorerPlugin/ExplorerPlugin.vcxproj create mode 100755 mDNSResponder/Clients/ExplorerPlugin/ExplorerPlugin.vcxproj.filters create mode 100755 mDNSResponder/Clients/ExplorerPlugin/ExplorerPluginLocRes.rc create mode 100755 mDNSResponder/Clients/ExplorerPlugin/ExplorerPluginLocRes.vcproj create mode 100755 mDNSResponder/Clients/ExplorerPlugin/ExplorerPluginLocRes.vcxproj create mode 100755 mDNSResponder/Clients/ExplorerPlugin/ExplorerPluginLocRes.vcxproj.filters create mode 100755 mDNSResponder/Clients/ExplorerPlugin/ExplorerPluginRes.rc create mode 100755 mDNSResponder/Clients/ExplorerPlugin/ExplorerPluginRes.vcproj create mode 100755 mDNSResponder/Clients/ExplorerPlugin/ExplorerPluginRes.vcxproj create mode 100755 mDNSResponder/Clients/ExplorerPlugin/ExplorerPluginRes.vcxproj.filters create mode 100644 mDNSResponder/Clients/ExplorerPlugin/LoginDialog.cpp create mode 100644 mDNSResponder/Clients/ExplorerPlugin/LoginDialog.h create mode 100644 mDNSResponder/Clients/ExplorerPlugin/ReadMe.txt create mode 100644 mDNSResponder/Clients/ExplorerPlugin/Resource.h create mode 100644 mDNSResponder/Clients/ExplorerPlugin/StdAfx.cpp create mode 100644 mDNSResponder/Clients/ExplorerPlugin/StdAfx.h create mode 100644 mDNSResponder/Clients/ExplorerPlugin/res/ExplorerPlugin.manifest create mode 100644 mDNSResponder/Clients/ExplorerPlugin/res/ExplorerPlugin64.manifest create mode 100644 mDNSResponder/Clients/ExplorerPlugin/res/about.bmp create mode 100755 mDNSResponder/Clients/ExplorerPlugin/res/button-2k.ico create mode 100755 mDNSResponder/Clients/ExplorerPlugin/res/button-xp.ico create mode 100644 mDNSResponder/Clients/ExplorerPlugin/res/cold.ico create mode 100644 mDNSResponder/Clients/ExplorerPlugin/res/hot.ico create mode 100644 mDNSResponder/Clients/ExplorerPlugin/res/logo.bmp create mode 100755 mDNSResponder/Clients/ExplorerPlugin/resource_dll.h create mode 100755 mDNSResponder/Clients/ExplorerPlugin/resource_loc_res.h create mode 100755 mDNSResponder/Clients/ExplorerPlugin/resource_res.h create mode 100755 mDNSResponder/Clients/FirefoxExtension/CDNSSDService.cpp create mode 100755 mDNSResponder/Clients/FirefoxExtension/CDNSSDService.h create mode 100755 mDNSResponder/Clients/FirefoxExtension/CDNSSDServiceModule.cpp create mode 100755 mDNSResponder/Clients/FirefoxExtension/DNSSDService.sln create mode 100644 mDNSResponder/Clients/FirefoxExtension/FirefoxExtension.rc create mode 100755 mDNSResponder/Clients/FirefoxExtension/FirefoxExtension.vcproj create mode 100755 mDNSResponder/Clients/FirefoxExtension/FirefoxExtension.vcxproj create mode 100755 mDNSResponder/Clients/FirefoxExtension/FirefoxExtension.vcxproj.filters create mode 100755 mDNSResponder/Clients/FirefoxExtension/IDNSSDService.h create mode 100755 mDNSResponder/Clients/FirefoxExtension/IDNSSDService.idl create mode 100755 mDNSResponder/Clients/FirefoxExtension/extension/chrome.manifest create mode 100755 mDNSResponder/Clients/FirefoxExtension/extension/components/IDNSSDService.xpt create mode 100755 mDNSResponder/Clients/FirefoxExtension/extension/content/_internal_bonjour4firefox.png create mode 100755 mDNSResponder/Clients/FirefoxExtension/extension/content/_internal_listImage.png create mode 100755 mDNSResponder/Clients/FirefoxExtension/extension/content/bonjour4firefox.css create mode 100755 mDNSResponder/Clients/FirefoxExtension/extension/content/bonjour4firefox.xul create mode 100755 mDNSResponder/Clients/FirefoxExtension/extension/content/browserOverlay.xul create mode 100755 mDNSResponder/Clients/FirefoxExtension/extension/content/overlay.js create mode 100755 mDNSResponder/Clients/FirefoxExtension/extension/defaults/preferences/bonjour4firefox.js create mode 100755 mDNSResponder/Clients/FirefoxExtension/extension/install.rdf create mode 100755 mDNSResponder/Clients/FirefoxExtension/extension/locale/en-US/bonjour4firefox.dtd create mode 100755 mDNSResponder/Clients/FirefoxExtension/extension/locale/en-US/bonjour4firefox.properties create mode 100755 mDNSResponder/Clients/FirefoxExtension/extension/readme.txt create mode 100644 mDNSResponder/Clients/FirefoxExtension/extension/skin-darwin/_internal_toobar-button.png create mode 100644 mDNSResponder/Clients/FirefoxExtension/extension/skin-darwin/overlay.css create mode 100755 mDNSResponder/Clients/FirefoxExtension/extension/skin/_internal_toobar-button.png create mode 100755 mDNSResponder/Clients/FirefoxExtension/extension/skin/overlay.css create mode 100644 mDNSResponder/Clients/FirefoxExtension/readme.txt create mode 100644 mDNSResponder/Clients/FirefoxExtension/resource.h create mode 100644 mDNSResponder/Clients/Java/BrowserApp.java create mode 100644 mDNSResponder/Clients/Java/BrowserApp.manifest create mode 100644 mDNSResponder/Clients/Java/DNSSDUnitTest.java create mode 100755 mDNSResponder/Clients/Java/JavaSamples.vcproj create mode 100755 mDNSResponder/Clients/Java/JavaSamples.vcxproj create mode 100644 mDNSResponder/Clients/Java/SimpleChat.java create mode 100644 mDNSResponder/Clients/Java/SimpleChat.manifest create mode 100644 mDNSResponder/Clients/Java/SwingBrowseListener.java create mode 100644 mDNSResponder/Clients/Java/SwingDomainListener.java create mode 100644 mDNSResponder/Clients/Java/SwingQueryListener.java create mode 100644 mDNSResponder/Clients/Java/nmakefile create mode 100755 mDNSResponder/Clients/Makefile create mode 100644 mDNSResponder/Clients/PrinterSetupWizard/About.cpp create mode 100644 mDNSResponder/Clients/PrinterSetupWizard/About.h create mode 100644 mDNSResponder/Clients/PrinterSetupWizard/FirstPage.cpp create mode 100644 mDNSResponder/Clients/PrinterSetupWizard/FirstPage.h create mode 100644 mDNSResponder/Clients/PrinterSetupWizard/FourthPage.cpp create mode 100644 mDNSResponder/Clients/PrinterSetupWizard/FourthPage.h create mode 100644 mDNSResponder/Clients/PrinterSetupWizard/Logger.cpp create mode 100644 mDNSResponder/Clients/PrinterSetupWizard/Logger.h create mode 100644 mDNSResponder/Clients/PrinterSetupWizard/PrinterSetupWizard.ncb create mode 100644 mDNSResponder/Clients/PrinterSetupWizard/PrinterSetupWizard.rc create mode 100644 mDNSResponder/Clients/PrinterSetupWizard/PrinterSetupWizard.vcproj create mode 100755 mDNSResponder/Clients/PrinterSetupWizard/PrinterSetupWizard.vcxproj create mode 100755 mDNSResponder/Clients/PrinterSetupWizard/PrinterSetupWizard.vcxproj.filters create mode 100644 mDNSResponder/Clients/PrinterSetupWizard/PrinterSetupWizardApp.cpp create mode 100644 mDNSResponder/Clients/PrinterSetupWizard/PrinterSetupWizardApp.h create mode 100755 mDNSResponder/Clients/PrinterSetupWizard/PrinterSetupWizardLocRes.rc create mode 100755 mDNSResponder/Clients/PrinterSetupWizard/PrinterSetupWizardLocRes.vcproj create mode 100755 mDNSResponder/Clients/PrinterSetupWizard/PrinterSetupWizardLocRes.vcxproj create mode 100755 mDNSResponder/Clients/PrinterSetupWizard/PrinterSetupWizardLocRes.vcxproj.filters create mode 100755 mDNSResponder/Clients/PrinterSetupWizard/PrinterSetupWizardRes.rc create mode 100755 mDNSResponder/Clients/PrinterSetupWizard/PrinterSetupWizardRes.vcproj create mode 100755 mDNSResponder/Clients/PrinterSetupWizard/PrinterSetupWizardRes.vcxproj create mode 100755 mDNSResponder/Clients/PrinterSetupWizard/PrinterSetupWizardRes.vcxproj.filters create mode 100644 mDNSResponder/Clients/PrinterSetupWizard/PrinterSetupWizardSheet.cpp create mode 100644 mDNSResponder/Clients/PrinterSetupWizard/PrinterSetupWizardSheet.h create mode 100644 mDNSResponder/Clients/PrinterSetupWizard/ReadMe.txt create mode 100644 mDNSResponder/Clients/PrinterSetupWizard/SecondPage.cpp create mode 100644 mDNSResponder/Clients/PrinterSetupWizard/SecondPage.h create mode 100644 mDNSResponder/Clients/PrinterSetupWizard/ThirdPage.cpp create mode 100644 mDNSResponder/Clients/PrinterSetupWizard/ThirdPage.h create mode 100644 mDNSResponder/Clients/PrinterSetupWizard/UtilTypes.h create mode 100644 mDNSResponder/Clients/PrinterSetupWizard/res/Info.ico create mode 100644 mDNSResponder/Clients/PrinterSetupWizard/res/NetworkPrinter.ico create mode 100644 mDNSResponder/Clients/PrinterSetupWizard/res/Print.ico create mode 100644 mDNSResponder/Clients/PrinterSetupWizard/res/PrinterSetupWizard.ico create mode 100644 mDNSResponder/Clients/PrinterSetupWizard/res/PrinterSetupWizard.manifest create mode 100644 mDNSResponder/Clients/PrinterSetupWizard/res/PrinterSetupWizard.rc2 create mode 100644 mDNSResponder/Clients/PrinterSetupWizard/res/PrinterSetupWizard64.manifest create mode 100755 mDNSResponder/Clients/PrinterSetupWizard/res/PrinterSetupWizardLocRes.rc2 create mode 100755 mDNSResponder/Clients/PrinterSetupWizard/res/PrinterSetupWizardRes.rc2 create mode 100644 mDNSResponder/Clients/PrinterSetupWizard/res/Thumbs.db create mode 100644 mDNSResponder/Clients/PrinterSetupWizard/res/about.bmp create mode 100644 mDNSResponder/Clients/PrinterSetupWizard/res/banner_icon.bmp create mode 100644 mDNSResponder/Clients/PrinterSetupWizard/res/watermark.bmp create mode 100644 mDNSResponder/Clients/PrinterSetupWizard/resource.h create mode 100755 mDNSResponder/Clients/PrinterSetupWizard/resource_exe.h create mode 100755 mDNSResponder/Clients/PrinterSetupWizard/resource_loc_res.h create mode 100755 mDNSResponder/Clients/PrinterSetupWizard/resource_res.h create mode 100644 mDNSResponder/Clients/PrinterSetupWizard/stdafx.cpp create mode 100644 mDNSResponder/Clients/PrinterSetupWizard/stdafx.h create mode 100755 mDNSResponder/Clients/PrinterSetupWizard/tcpxcv.h create mode 100644 mDNSResponder/Clients/ReadMe.txt create mode 100755 mDNSResponder/Clients/SimpleChat.NET/App.ico create mode 100755 mDNSResponder/Clients/SimpleChat.NET/AssemblyInfo.cs create mode 100755 mDNSResponder/Clients/SimpleChat.NET/SimpleChat.NET.csproj create mode 100755 mDNSResponder/Clients/SimpleChat.NET/SimpleChat.cs create mode 100755 mDNSResponder/Clients/SimpleChat.NET/SimpleChat.resx create mode 100644 mDNSResponder/Clients/SimpleChat.VB/My Project/Application.Designer.vb create mode 100644 mDNSResponder/Clients/SimpleChat.VB/My Project/Application.myapp create mode 100644 mDNSResponder/Clients/SimpleChat.VB/My Project/AssemblyInfo.vb create mode 100644 mDNSResponder/Clients/SimpleChat.VB/My Project/Resources.Designer.vb create mode 100644 mDNSResponder/Clients/SimpleChat.VB/My Project/Resources.resx create mode 100644 mDNSResponder/Clients/SimpleChat.VB/My Project/Settings.Designer.vb create mode 100644 mDNSResponder/Clients/SimpleChat.VB/My Project/Settings.settings create mode 100644 mDNSResponder/Clients/SimpleChat.VB/SimpleChat.Designer.vb create mode 100644 mDNSResponder/Clients/SimpleChat.VB/SimpleChat.VB.vbproj create mode 100644 mDNSResponder/Clients/SimpleChat.VB/SimpleChat.resx create mode 100644 mDNSResponder/Clients/SimpleChat.VB/SimpleChat.vb create mode 100644 mDNSResponder/Clients/dns-sd.c create mode 100644 mDNSResponder/Clients/dnsctl.c create mode 100755 mDNSResponder/Clients/mDNSNetMonitor.VisualStudio/mDNSNetMonitor.manifest create mode 100644 mDNSResponder/Clients/mDNSNetMonitor.VisualStudio/mDNSNetMonitor.rc create mode 100755 mDNSResponder/Clients/mDNSNetMonitor.VisualStudio/mDNSNetMonitor.vcproj create mode 100755 mDNSResponder/Clients/mDNSNetMonitor.VisualStudio/mDNSNetMonitor.vcxproj create mode 100755 mDNSResponder/Clients/mDNSNetMonitor.VisualStudio/mDNSNetMonitor.vcxproj.filters create mode 100644 mDNSResponder/Clients/mDNSNetMonitor.VisualStudio/resource.h create mode 100644 mDNSResponder/LICENSE create mode 100644 mDNSResponder/Makefile create mode 100644 mDNSResponder/PrivateDNS.txt create mode 100644 mDNSResponder/README.txt create mode 100644 mDNSResponder/mDNSCore/CryptoAlg.c create mode 100644 mDNSResponder/mDNSCore/CryptoAlg.h create mode 100644 mDNSResponder/mDNSCore/DNSCommon.c create mode 100644 mDNSResponder/mDNSCore/DNSCommon.h create mode 100644 mDNSResponder/mDNSCore/DNSDigest.c create mode 100644 mDNSResponder/mDNSCore/Implementer Notes.txt create mode 100644 mDNSResponder/mDNSCore/anonymous.c create mode 100644 mDNSResponder/mDNSCore/anonymous.h create mode 100644 mDNSResponder/mDNSCore/dnsproxy.c create mode 100644 mDNSResponder/mDNSCore/dnsproxy.h create mode 100644 mDNSResponder/mDNSCore/dnssec.c create mode 100644 mDNSResponder/mDNSCore/dnssec.h create mode 100755 mDNSResponder/mDNSCore/mDNS.c create mode 100755 mDNSResponder/mDNSCore/mDNSDebug.h create mode 100755 mDNSResponder/mDNSCore/mDNSEmbeddedAPI.h create mode 100644 mDNSResponder/mDNSCore/nsec.c create mode 100644 mDNSResponder/mDNSCore/nsec.h create mode 100644 mDNSResponder/mDNSCore/nsec3.c create mode 100644 mDNSResponder/mDNSCore/nsec3.h create mode 100755 mDNSResponder/mDNSCore/uDNS.c create mode 100755 mDNSResponder/mDNSCore/uDNS.h create mode 100644 mDNSResponder/mDNSMacOS9/CarbonResource.r create mode 100644 mDNSResponder/mDNSMacOS9/Mac OS Test Responder.c create mode 100644 mDNSResponder/mDNSMacOS9/Mac OS Test Searcher.c create mode 100644 mDNSResponder/mDNSMacOS9/README.txt create mode 100644 mDNSResponder/mDNSMacOS9/Responder.c create mode 100644 mDNSResponder/mDNSMacOS9/Searcher.c create mode 100755 mDNSResponder/mDNSMacOS9/ShowInitIcon.c create mode 100755 mDNSResponder/mDNSMacOS9/ShowInitIcon.h create mode 100644 mDNSResponder/mDNSMacOS9/SubTypeTester.c create mode 100644 mDNSResponder/mDNSMacOS9/mDNS.mcp create mode 100644 mDNSResponder/mDNSMacOS9/mDNSLibrary.c create mode 100644 mDNSResponder/mDNSMacOS9/mDNSLibraryLoader.c create mode 100644 mDNSResponder/mDNSMacOS9/mDNSLibraryResources.r create mode 100644 mDNSResponder/mDNSMacOS9/mDNSMacOS9.c create mode 100755 mDNSResponder/mDNSMacOS9/mDNSMacOS9.h create mode 100644 mDNSResponder/mDNSMacOS9/mDNSPrefix.h create mode 100644 mDNSResponder/mDNSMacOSX/BonjourEvents-Info.plist create mode 100644 mDNSResponder/mDNSMacOSX/BonjourEvents.c create mode 100644 mDNSResponder/mDNSMacOSX/CUPolicy.c create mode 100644 mDNSResponder/mDNSMacOSX/CryptoSupport.c create mode 100644 mDNSResponder/mDNSMacOSX/CryptoSupport.h create mode 100644 mDNSResponder/mDNSMacOSX/DNSProxySupport.c create mode 100644 mDNSResponder/mDNSMacOSX/DNSSECSupport.c create mode 100644 mDNSResponder/mDNSMacOSX/DNSSECSupport.h create mode 100644 mDNSResponder/mDNSMacOSX/DNSServiceDiscovery.c create mode 100644 mDNSResponder/mDNSMacOSX/DNSServiceDiscovery.h create mode 100644 mDNSResponder/mDNSMacOSX/DNSServiceDiscoveryDefines.h create mode 100644 mDNSResponder/mDNSMacOSX/DNSServiceDiscoveryReply.defs create mode 100644 mDNSResponder/mDNSMacOSX/DNSServiceDiscoveryRequest.defs create mode 100644 mDNSResponder/mDNSMacOSX/LaunchDaemonInfo-Tiger.helper.plist create mode 100644 mDNSResponder/mDNSMacOSX/LaunchDaemonInfo-Tiger.plist create mode 100644 mDNSResponder/mDNSMacOSX/LaunchDaemonInfo.dnsextd.plist create mode 100644 mDNSResponder/mDNSMacOSX/LaunchDaemonInfo.helper.plist create mode 100644 mDNSResponder/mDNSMacOSX/LaunchDaemonInfo.plist create mode 100644 mDNSResponder/mDNSMacOSX/LegacyNATTraversal.c create mode 100644 mDNSResponder/mDNSMacOSX/P2PPacketFilter.c create mode 100644 mDNSResponder/mDNSMacOSX/P2PPacketFilter.h create mode 100644 mDNSResponder/mDNSMacOSX/PreferencePane/Artwork/add_idle.tiff create mode 100644 mDNSResponder/mDNSMacOSX/PreferencePane/Artwork/add_pressed.tiff create mode 100644 mDNSResponder/mDNSMacOSX/PreferencePane/Artwork/failure.tiff create mode 100644 mDNSResponder/mDNSMacOSX/PreferencePane/Artwork/inprogress.tiff create mode 100644 mDNSResponder/mDNSMacOSX/PreferencePane/Artwork/remove_disabled.tiff create mode 100644 mDNSResponder/mDNSMacOSX/PreferencePane/Artwork/remove_idle.tiff create mode 100644 mDNSResponder/mDNSMacOSX/PreferencePane/Artwork/remove_pressed.tiff create mode 100644 mDNSResponder/mDNSMacOSX/PreferencePane/Artwork/success.tiff create mode 100644 mDNSResponder/mDNSMacOSX/PreferencePane/BonjourPref.icns create mode 100644 mDNSResponder/mDNSMacOSX/PreferencePane/BonjourPref.tiff create mode 100644 mDNSResponder/mDNSMacOSX/PreferencePane/ConfigurationAuthority.c create mode 100644 mDNSResponder/mDNSMacOSX/PreferencePane/ConfigurationAuthority.h create mode 100644 mDNSResponder/mDNSMacOSX/PreferencePane/ConfigurationRights.h create mode 100644 mDNSResponder/mDNSMacOSX/PreferencePane/DNSServiceDiscoveryPref.h create mode 100644 mDNSResponder/mDNSMacOSX/PreferencePane/DNSServiceDiscoveryPref.m create mode 100644 mDNSResponder/mDNSMacOSX/PreferencePane/English.lproj/DNSServiceDiscoveryPref.nib/classes.nib create mode 100644 mDNSResponder/mDNSMacOSX/PreferencePane/English.lproj/DNSServiceDiscoveryPref.nib/info.nib create mode 100644 mDNSResponder/mDNSMacOSX/PreferencePane/English.lproj/DNSServiceDiscoveryPref.nib/keyedobjects.nib create mode 100644 mDNSResponder/mDNSMacOSX/PreferencePane/English.lproj/InfoPlist.strings create mode 100644 mDNSResponder/mDNSMacOSX/PreferencePane/Info-PreferencePane.plist create mode 100644 mDNSResponder/mDNSMacOSX/PreferencePane/PrivilegedOperations.c create mode 100644 mDNSResponder/mDNSMacOSX/PreferencePane/PrivilegedOperations.h create mode 100644 mDNSResponder/mDNSMacOSX/PreferencePane/ddnswriteconfig.m create mode 100755 mDNSResponder/mDNSMacOSX/PreferencePane/installtool create mode 100644 mDNSResponder/mDNSMacOSX/Private/dns_services.c create mode 100644 mDNSResponder/mDNSMacOSX/Private/dns_services.h create mode 100644 mDNSResponder/mDNSMacOSX/Private/dns_xpc.h create mode 100644 mDNSResponder/mDNSMacOSX/Private/xpc_services.c create mode 100644 mDNSResponder/mDNSMacOSX/Private/xpc_services.h create mode 100644 mDNSResponder/mDNSMacOSX/README.privsep create mode 100644 mDNSResponder/mDNSMacOSX/VPNService.c create mode 100644 mDNSResponder/mDNSMacOSX/com.apple.networking.mDNSResponder create mode 100644 mDNSResponder/mDNSMacOSX/daemon.c create mode 100644 mDNSResponder/mDNSMacOSX/dnsctl-entitlements.plist create mode 100644 mDNSResponder/mDNSMacOSX/helper-entitlements.plist create mode 100644 mDNSResponder/mDNSMacOSX/helper-error.h create mode 100644 mDNSResponder/mDNSMacOSX/helper-main.c create mode 100644 mDNSResponder/mDNSMacOSX/helper-server.h create mode 100644 mDNSResponder/mDNSMacOSX/helper-stubs.c create mode 100644 mDNSResponder/mDNSMacOSX/helper.c create mode 100644 mDNSResponder/mDNSMacOSX/helper.h create mode 100644 mDNSResponder/mDNSMacOSX/helpermsg-types.h create mode 100644 mDNSResponder/mDNSMacOSX/helpermsg.defs create mode 100644 mDNSResponder/mDNSMacOSX/ipsec_strerror.h create mode 100644 mDNSResponder/mDNSMacOSX/libpfkey.h create mode 100644 mDNSResponder/mDNSMacOSX/mDNSMacOSX.c create mode 100644 mDNSResponder/mDNSMacOSX/mDNSMacOSX.h create mode 100644 mDNSResponder/mDNSMacOSX/mDNSResponder-bundle/Resources/English.lproj/Localizable.strings create mode 100644 mDNSResponder/mDNSMacOSX/mDNSResponder-bundle/Resources/French.lproj/Localizable.strings create mode 100644 mDNSResponder/mDNSMacOSX/mDNSResponder-entitlements.plist create mode 100644 mDNSResponder/mDNSMacOSX/mDNSResponder.order create mode 100644 mDNSResponder/mDNSMacOSX/mDNSResponder.pbproj/project.pbxproj create mode 100644 mDNSResponder/mDNSMacOSX/mDNSResponder.plist create mode 100644 mDNSResponder/mDNSMacOSX/mDNSResponder.sb create mode 100644 mDNSResponder/mDNSMacOSX/mDNSResponder.txt create mode 100644 mDNSResponder/mDNSMacOSX/mDNSResponder.xcodeproj/project.pbxproj create mode 100644 mDNSResponder/mDNSMacOSX/mDNSResponderHelper.8 create mode 100644 mDNSResponder/mDNSMacOSX/mDNSResponderHelper.plist create mode 100644 mDNSResponder/mDNSMacOSX/mDNSResponderLogging.mobileconfig create mode 100644 mDNSResponder/mDNSMacOSX/pfkey.c create mode 100755 mDNSResponder/mDNSPosix/Client.c create mode 100644 mDNSResponder/mDNSPosix/ExampleClientApp.c create mode 100644 mDNSResponder/mDNSPosix/ExampleClientApp.h create mode 100644 mDNSResponder/mDNSPosix/Identify.c create mode 100755 mDNSResponder/mDNSPosix/Makefile create mode 100644 mDNSResponder/mDNSPosix/NetMonitor.c create mode 100644 mDNSResponder/mDNSPosix/PosixDaemon.c create mode 100644 mDNSResponder/mDNSPosix/ProxyResponder.c create mode 100755 mDNSResponder/mDNSPosix/ReadMe.txt create mode 100755 mDNSResponder/mDNSPosix/Responder.c create mode 100755 mDNSResponder/mDNSPosix/Services.txt create mode 100755 mDNSResponder/mDNSPosix/libnss_mdns.8 create mode 100755 mDNSResponder/mDNSPosix/mDNSPosix.c create mode 100755 mDNSResponder/mDNSPosix/mDNSPosix.h create mode 100755 mDNSResponder/mDNSPosix/mDNSUNP.c create mode 100755 mDNSResponder/mDNSPosix/mDNSUNP.h create mode 100644 mDNSResponder/mDNSPosix/mdnsd.sh create mode 100755 mDNSResponder/mDNSPosix/nss_ReadMe.txt create mode 100755 mDNSResponder/mDNSPosix/nss_mdns.c create mode 100755 mDNSResponder/mDNSPosix/nss_mdns.conf create mode 100755 mDNSResponder/mDNSPosix/nss_mdns.conf.5 create mode 100755 mDNSResponder/mDNSPosix/parselog.py create mode 100755 mDNSResponder/mDNSResponder.sln create mode 100644 mDNSResponder/mDNSShared/CommonServices.h create mode 100644 mDNSResponder/mDNSShared/DebugServices.c create mode 100644 mDNSResponder/mDNSShared/DebugServices.h create mode 100644 mDNSResponder/mDNSShared/GenLinkedList.c create mode 100644 mDNSResponder/mDNSShared/GenLinkedList.h create mode 100644 mDNSResponder/mDNSShared/Java/BaseListener.java create mode 100644 mDNSResponder/mDNSShared/Java/BrowseListener.java create mode 100644 mDNSResponder/mDNSShared/Java/DNSRecord.java create mode 100644 mDNSResponder/mDNSShared/Java/DNSSD.java create mode 100644 mDNSResponder/mDNSShared/Java/DNSSDException.java create mode 100644 mDNSResponder/mDNSShared/Java/DNSSDRecordRegistrar.java create mode 100644 mDNSResponder/mDNSShared/Java/DNSSDRegistration.java create mode 100644 mDNSResponder/mDNSShared/Java/DNSSDService.java create mode 100644 mDNSResponder/mDNSShared/Java/DomainListener.java create mode 100644 mDNSResponder/mDNSShared/Java/JNISupport.c create mode 100644 mDNSResponder/mDNSShared/Java/QueryListener.java create mode 100644 mDNSResponder/mDNSShared/Java/RegisterListener.java create mode 100644 mDNSResponder/mDNSShared/Java/RegisterRecordListener.java create mode 100644 mDNSResponder/mDNSShared/Java/ResolveListener.java create mode 100644 mDNSResponder/mDNSShared/Java/TXTRecord.java create mode 100644 mDNSResponder/mDNSShared/PlatformCommon.c create mode 100644 mDNSResponder/mDNSShared/PlatformCommon.h create mode 100644 mDNSResponder/mDNSShared/dns-sd.1 create mode 100644 mDNSResponder/mDNSShared/dns_sd.h create mode 100644 mDNSResponder/mDNSShared/dnsextd.8 create mode 100644 mDNSResponder/mDNSShared/dnsextd.c create mode 100644 mDNSResponder/mDNSShared/dnsextd.conf create mode 100644 mDNSResponder/mDNSShared/dnsextd.h create mode 100644 mDNSResponder/mDNSShared/dnsextd_lexer.l create mode 100644 mDNSResponder/mDNSShared/dnsextd_parser.y create mode 100644 mDNSResponder/mDNSShared/dnssd_clientlib.c create mode 100644 mDNSResponder/mDNSShared/dnssd_clientshim.c create mode 100644 mDNSResponder/mDNSShared/dnssd_clientstub.c create mode 100644 mDNSResponder/mDNSShared/dnssd_ipc.c create mode 100644 mDNSResponder/mDNSShared/dnssd_ipc.h create mode 100644 mDNSResponder/mDNSShared/mDNSDebug.c create mode 100644 mDNSResponder/mDNSShared/mDNSResponder.8 create mode 100644 mDNSResponder/mDNSShared/uds_daemon.c create mode 100644 mDNSResponder/mDNSShared/uds_daemon.h create mode 100644 mDNSResponder/mDNSVxWorks/README.txt create mode 100644 mDNSResponder/mDNSVxWorks/mDNSVxWorks.c create mode 100644 mDNSResponder/mDNSVxWorks/mDNSVxWorks.h create mode 100644 mDNSResponder/mDNSVxWorks/mDNSVxWorksIPv4Only.c create mode 100644 mDNSResponder/mDNSVxWorks/mDNSVxWorksIPv4Only.h create mode 100755 mDNSResponder/mDNSWindows/ControlPanel/BrowsingPage.cpp create mode 100755 mDNSResponder/mDNSWindows/ControlPanel/BrowsingPage.h create mode 100755 mDNSResponder/mDNSWindows/ControlPanel/ConfigDialog.cpp create mode 100644 mDNSResponder/mDNSWindows/ControlPanel/ConfigDialog.h create mode 100755 mDNSResponder/mDNSWindows/ControlPanel/ConfigPropertySheet.cpp create mode 100755 mDNSResponder/mDNSWindows/ControlPanel/ConfigPropertySheet.h create mode 100755 mDNSResponder/mDNSWindows/ControlPanel/ControlPanel.cpp create mode 100644 mDNSResponder/mDNSWindows/ControlPanel/ControlPanel.def create mode 100644 mDNSResponder/mDNSWindows/ControlPanel/ControlPanel.h create mode 100644 mDNSResponder/mDNSWindows/ControlPanel/ControlPanel.rc create mode 100755 mDNSResponder/mDNSWindows/ControlPanel/ControlPanel.vcproj create mode 100755 mDNSResponder/mDNSWindows/ControlPanel/ControlPanel.vcxproj create mode 100755 mDNSResponder/mDNSWindows/ControlPanel/ControlPanel.vcxproj.filters create mode 100644 mDNSResponder/mDNSWindows/ControlPanel/ControlPanelDll.rc create mode 100755 mDNSResponder/mDNSWindows/ControlPanel/ControlPanelExe.cpp create mode 100644 mDNSResponder/mDNSWindows/ControlPanel/ControlPanelExe.h create mode 100644 mDNSResponder/mDNSWindows/ControlPanel/ControlPanelExe.rc create mode 100755 mDNSResponder/mDNSWindows/ControlPanel/ControlPanelExe.vcproj create mode 100755 mDNSResponder/mDNSWindows/ControlPanel/ControlPanelLocRes.rc create mode 100755 mDNSResponder/mDNSWindows/ControlPanel/ControlPanelLocRes.vcproj create mode 100755 mDNSResponder/mDNSWindows/ControlPanel/ControlPanelLocRes.vcxproj create mode 100755 mDNSResponder/mDNSWindows/ControlPanel/ControlPanelLocRes.vcxproj.filters create mode 100755 mDNSResponder/mDNSWindows/ControlPanel/ControlPanelRes.rc create mode 100755 mDNSResponder/mDNSWindows/ControlPanel/ControlPanelRes.vcproj create mode 100755 mDNSResponder/mDNSWindows/ControlPanel/ControlPanelRes.vcxproj create mode 100755 mDNSResponder/mDNSWindows/ControlPanel/ControlPanelRes.vcxproj.filters create mode 100755 mDNSResponder/mDNSWindows/ControlPanel/FourthPage.cpp create mode 100755 mDNSResponder/mDNSWindows/ControlPanel/FourthPage.h create mode 100755 mDNSResponder/mDNSWindows/ControlPanel/RegistrationPage.cpp create mode 100755 mDNSResponder/mDNSWindows/ControlPanel/RegistrationPage.h create mode 100755 mDNSResponder/mDNSWindows/ControlPanel/SecondPage.cpp create mode 100755 mDNSResponder/mDNSWindows/ControlPanel/SecondPage.h create mode 100755 mDNSResponder/mDNSWindows/ControlPanel/ServicesPage.cpp create mode 100755 mDNSResponder/mDNSWindows/ControlPanel/ServicesPage.h create mode 100644 mDNSResponder/mDNSWindows/ControlPanel/SharedSecret.cpp create mode 100644 mDNSResponder/mDNSWindows/ControlPanel/SharedSecret.h create mode 100644 mDNSResponder/mDNSWindows/ControlPanel/res/ControlPanel.dll.manifest create mode 100644 mDNSResponder/mDNSWindows/ControlPanel/res/ControlPanel.exe.manifest create mode 100644 mDNSResponder/mDNSWindows/ControlPanel/res/ControlPanel.manifest create mode 100755 mDNSResponder/mDNSWindows/ControlPanel/res/ControlPanel.rc2 create mode 100644 mDNSResponder/mDNSWindows/ControlPanel/res/ControlPanel64.manifest create mode 100755 mDNSResponder/mDNSWindows/ControlPanel/res/EnergySaver.ico create mode 100755 mDNSResponder/mDNSWindows/ControlPanel/res/controlpanel.ico create mode 100755 mDNSResponder/mDNSWindows/ControlPanel/res/failure.ico create mode 100755 mDNSResponder/mDNSWindows/ControlPanel/res/success.ico create mode 100644 mDNSResponder/mDNSWindows/ControlPanel/resource.h create mode 100755 mDNSResponder/mDNSWindows/ControlPanel/stdafx.cpp create mode 100755 mDNSResponder/mDNSWindows/ControlPanel/stdafx.h create mode 100755 mDNSResponder/mDNSWindows/DLL.NET/AssemblyInfo.cpp create mode 100755 mDNSResponder/mDNSWindows/DLL.NET/PString.h create mode 100755 mDNSResponder/mDNSWindows/DLL.NET/Stdafx.cpp create mode 100755 mDNSResponder/mDNSWindows/DLL.NET/Stdafx.h create mode 100755 mDNSResponder/mDNSWindows/DLL.NET/dnssd_NET.cpp create mode 100755 mDNSResponder/mDNSWindows/DLL.NET/dnssd_NET.h create mode 100755 mDNSResponder/mDNSWindows/DLL.NET/dnssd_NET.ico create mode 100755 mDNSResponder/mDNSWindows/DLL.NET/dnssd_NET.rc create mode 100755 mDNSResponder/mDNSWindows/DLL.NET/dnssd_NET.vcproj create mode 100755 mDNSResponder/mDNSWindows/DLL.NET/resource.h create mode 100644 mDNSResponder/mDNSWindows/DLL/dll.aps create mode 100644 mDNSResponder/mDNSWindows/DLL/dll.rc create mode 100644 mDNSResponder/mDNSWindows/DLL/dllmain.c create mode 100644 mDNSResponder/mDNSWindows/DLL/dnssd.def create mode 100644 mDNSResponder/mDNSWindows/DLL/dnssd.vcproj create mode 100755 mDNSResponder/mDNSWindows/DLL/dnssd.vcxproj create mode 100755 mDNSResponder/mDNSWindows/DLL/dnssd.vcxproj.filters create mode 100644 mDNSResponder/mDNSWindows/DLL/resource.h create mode 100755 mDNSResponder/mDNSWindows/DLLStub/DLLStub.cpp create mode 100755 mDNSResponder/mDNSWindows/DLLStub/DLLStub.h create mode 100755 mDNSResponder/mDNSWindows/DLLStub/DLLStub.vcproj create mode 100755 mDNSResponder/mDNSWindows/DLLStub/DLLStub.vcxproj create mode 100755 mDNSResponder/mDNSWindows/DLLStub/DLLStub.vcxproj.filters create mode 100755 mDNSResponder/mDNSWindows/DLLX/DLLX.cpp create mode 100755 mDNSResponder/mDNSWindows/DLLX/DLLX.def create mode 100755 mDNSResponder/mDNSWindows/DLLX/DLLX.idl create mode 100755 mDNSResponder/mDNSWindows/DLLX/DLLX.rc create mode 100755 mDNSResponder/mDNSWindows/DLLX/DLLX.rgs create mode 100755 mDNSResponder/mDNSWindows/DLLX/DLLX.vcproj create mode 100755 mDNSResponder/mDNSWindows/DLLX/DLLX.vcxproj create mode 100755 mDNSResponder/mDNSWindows/DLLX/DLLX.vcxproj.filters create mode 100755 mDNSResponder/mDNSWindows/DLLX/DNSSD.cpp create mode 100755 mDNSResponder/mDNSWindows/DLLX/DNSSDEventManager.cpp create mode 100755 mDNSResponder/mDNSWindows/DLLX/DNSSDEventManager.h create mode 100755 mDNSResponder/mDNSWindows/DLLX/DNSSDEventManager.rgs create mode 100755 mDNSResponder/mDNSWindows/DLLX/DNSSDRecord.cpp create mode 100755 mDNSResponder/mDNSWindows/DLLX/DNSSDRecord.h create mode 100755 mDNSResponder/mDNSWindows/DLLX/DNSSDRecord.rgs create mode 100755 mDNSResponder/mDNSWindows/DLLX/DNSSDService.cpp create mode 100755 mDNSResponder/mDNSWindows/DLLX/DNSSDService.h create mode 100755 mDNSResponder/mDNSWindows/DLLX/DNSSDService.rgs create mode 100755 mDNSResponder/mDNSWindows/DLLX/StringServices.cpp create mode 100755 mDNSResponder/mDNSWindows/DLLX/StringServices.h create mode 100755 mDNSResponder/mDNSWindows/DLLX/TXTRecord.cpp create mode 100755 mDNSResponder/mDNSWindows/DLLX/TXTRecord.h create mode 100755 mDNSResponder/mDNSWindows/DLLX/TXTRecord.rgs create mode 100755 mDNSResponder/mDNSWindows/DLLX/_IDNSSDEvents_CP.h create mode 100755 mDNSResponder/mDNSWindows/DLLX/dlldatax.c create mode 100755 mDNSResponder/mDNSWindows/DLLX/dlldatax.h create mode 100755 mDNSResponder/mDNSWindows/DLLX/resource.h create mode 100755 mDNSResponder/mDNSWindows/DLLX/stdafx.h create mode 100644 mDNSResponder/mDNSWindows/DNSServiceBrowser/Windows/ApplicationVS2002.sln create mode 100644 mDNSResponder/mDNSWindows/DNSServiceBrowser/Windows/ApplicationVS2002.vcproj create mode 100644 mDNSResponder/mDNSWindows/DNSServiceBrowser/Windows/ApplicationVS2003.sln create mode 100644 mDNSResponder/mDNSWindows/DNSServiceBrowser/Windows/ApplicationVS2003.vcproj create mode 100644 mDNSResponder/mDNSWindows/DNSServiceBrowser/Windows/Resources/Application.ico create mode 100644 mDNSResponder/mDNSWindows/DNSServiceBrowser/Windows/Resources/Application.rc create mode 100644 mDNSResponder/mDNSWindows/DNSServiceBrowser/Windows/Resources/Application.rc2 create mode 100644 mDNSResponder/mDNSWindows/DNSServiceBrowser/Windows/Resources/Resource.h create mode 100644 mDNSResponder/mDNSWindows/DNSServiceBrowser/Windows/Sources/AboutDialog.cpp create mode 100644 mDNSResponder/mDNSWindows/DNSServiceBrowser/Windows/Sources/AboutDialog.h create mode 100644 mDNSResponder/mDNSWindows/DNSServiceBrowser/Windows/Sources/Application.cpp create mode 100644 mDNSResponder/mDNSWindows/DNSServiceBrowser/Windows/Sources/Application.h create mode 100644 mDNSResponder/mDNSWindows/DNSServiceBrowser/Windows/Sources/ChooserDialog.cpp create mode 100644 mDNSResponder/mDNSWindows/DNSServiceBrowser/Windows/Sources/ChooserDialog.h create mode 100644 mDNSResponder/mDNSWindows/DNSServiceBrowser/Windows/Sources/LoginDialog.cpp create mode 100644 mDNSResponder/mDNSWindows/DNSServiceBrowser/Windows/Sources/LoginDialog.h create mode 100644 mDNSResponder/mDNSWindows/DNSServiceBrowser/Windows/Sources/StdAfx.cpp create mode 100644 mDNSResponder/mDNSWindows/DNSServiceBrowser/Windows/Sources/StdAfx.h create mode 100644 mDNSResponder/mDNSWindows/DNSServiceBrowser/WindowsCE/Application.vcc create mode 100644 mDNSResponder/mDNSWindows/DNSServiceBrowser/WindowsCE/Application.vcp create mode 100644 mDNSResponder/mDNSWindows/DNSServiceBrowser/WindowsCE/Application.vcw create mode 100644 mDNSResponder/mDNSWindows/DNSServiceBrowser/WindowsCE/Resources/Application.ico create mode 100644 mDNSResponder/mDNSWindows/DNSServiceBrowser/WindowsCE/Resources/Application.rc create mode 100644 mDNSResponder/mDNSWindows/DNSServiceBrowser/WindowsCE/Resources/Application.rc2 create mode 100644 mDNSResponder/mDNSWindows/DNSServiceBrowser/WindowsCE/Resources/newres.h create mode 100644 mDNSResponder/mDNSWindows/DNSServiceBrowser/WindowsCE/Resources/resource.h create mode 100644 mDNSResponder/mDNSWindows/DNSServiceBrowser/WindowsCE/Sources/Application.cpp create mode 100644 mDNSResponder/mDNSWindows/DNSServiceBrowser/WindowsCE/Sources/Application.h create mode 100644 mDNSResponder/mDNSWindows/DNSServiceBrowser/WindowsCE/Sources/BrowserDialog.cpp create mode 100644 mDNSResponder/mDNSWindows/DNSServiceBrowser/WindowsCE/Sources/BrowserDialog.h create mode 100644 mDNSResponder/mDNSWindows/DNSServiceBrowser/WindowsCE/Sources/StdAfx.cpp create mode 100644 mDNSResponder/mDNSWindows/DNSServiceBrowser/WindowsCE/Sources/StdAfx.h create mode 100755 mDNSResponder/mDNSWindows/Java/Java.vcproj create mode 100755 mDNSResponder/mDNSWindows/Java/Java.vcxproj create mode 100644 mDNSResponder/mDNSWindows/Java/jdns_sd.rc create mode 100644 mDNSResponder/mDNSWindows/Java/makefile create mode 100644 mDNSResponder/mDNSWindows/Java/makefile64 create mode 100644 mDNSResponder/mDNSWindows/NSPTool/NSPTool.aps create mode 100644 mDNSResponder/mDNSWindows/NSPTool/NSPTool.c create mode 100644 mDNSResponder/mDNSWindows/NSPTool/NSPTool.rc create mode 100644 mDNSResponder/mDNSWindows/NSPTool/NSPTool.vcproj create mode 100755 mDNSResponder/mDNSWindows/NSPTool/NSPTool.vcxproj create mode 100755 mDNSResponder/mDNSWindows/NSPTool/NSPTool.vcxproj.filters create mode 100644 mDNSResponder/mDNSWindows/NSPTool/Prefix.h create mode 100644 mDNSResponder/mDNSWindows/NSPTool/resource.h create mode 100755 mDNSResponder/mDNSWindows/Poll.c create mode 100755 mDNSResponder/mDNSWindows/Poll.h create mode 100755 mDNSResponder/mDNSWindows/PosixCompat.c create mode 100755 mDNSResponder/mDNSWindows/PosixCompat.h create mode 100644 mDNSResponder/mDNSWindows/README.txt create mode 100644 mDNSResponder/mDNSWindows/RegNames.h create mode 100644 mDNSResponder/mDNSWindows/Secret.c create mode 100644 mDNSResponder/mDNSWindows/Secret.h create mode 100644 mDNSResponder/mDNSWindows/SystemService/EventLog.mc create mode 100644 mDNSResponder/mDNSWindows/SystemService/EventLogMessages.bin create mode 100755 mDNSResponder/mDNSWindows/SystemService/Firewall.cpp create mode 100755 mDNSResponder/mDNSWindows/SystemService/Firewall.h create mode 100644 mDNSResponder/mDNSWindows/SystemService/Prefix.h create mode 100644 mDNSResponder/mDNSWindows/SystemService/Service.aps create mode 100644 mDNSResponder/mDNSWindows/SystemService/Service.c create mode 100755 mDNSResponder/mDNSWindows/SystemService/Service.h create mode 100644 mDNSResponder/mDNSWindows/SystemService/Service.mcp create mode 100644 mDNSResponder/mDNSWindows/SystemService/Service.rc create mode 100644 mDNSResponder/mDNSWindows/SystemService/Service.vcproj create mode 100755 mDNSResponder/mDNSWindows/SystemService/Service.vcxproj create mode 100755 mDNSResponder/mDNSWindows/SystemService/Service.vcxproj.filters create mode 100755 mDNSResponder/mDNSWindows/SystemService/main.c create mode 100644 mDNSResponder/mDNSWindows/SystemService/res/mDNSResponder.manifest create mode 100644 mDNSResponder/mDNSWindows/SystemService/res/mDNSResponder64.manifest create mode 100644 mDNSResponder/mDNSWindows/SystemService/resource.h create mode 100644 mDNSResponder/mDNSWindows/SystemService/resrc1.h create mode 100755 mDNSResponder/mDNSWindows/VPCDetect.cpp create mode 100644 mDNSResponder/mDNSWindows/VPCDetect.h create mode 100644 mDNSResponder/mDNSWindows/WinServices.cpp create mode 100644 mDNSResponder/mDNSWindows/WinServices.h create mode 100644 mDNSResponder/mDNSWindows/WinVersRes.h create mode 100755 mDNSResponder/mDNSWindows/isocode.h create mode 100755 mDNSResponder/mDNSWindows/loclibrary.c create mode 100755 mDNSResponder/mDNSWindows/loclibrary.h create mode 100755 mDNSResponder/mDNSWindows/mDNSWin32.c create mode 100755 mDNSResponder/mDNSWindows/mDNSWin32.h create mode 100644 mDNSResponder/mDNSWindows/mdnsNSP/ReadMe.txt create mode 100644 mDNSResponder/mDNSWindows/mdnsNSP/mdnsNSP.aps create mode 100644 mDNSResponder/mDNSWindows/mdnsNSP/mdnsNSP.c create mode 100644 mDNSResponder/mDNSWindows/mdnsNSP/mdnsNSP.def create mode 100644 mDNSResponder/mDNSWindows/mdnsNSP/mdnsNSP.rc create mode 100644 mDNSResponder/mDNSWindows/mdnsNSP/mdnsNSP.vcproj create mode 100755 mDNSResponder/mDNSWindows/mdnsNSP/mdnsNSP.vcxproj create mode 100755 mDNSResponder/mDNSWindows/mdnsNSP/mdnsNSP.vcxproj.filters create mode 100644 mDNSResponder/mDNSWindows/mdnsNSP/resource.h (limited to 'mDNSResponder') diff --git a/mDNSResponder/Clients/BonjourExample/BonjourExample.cpp b/mDNSResponder/Clients/BonjourExample/BonjourExample.cpp new file mode 100644 index 00000000..f517456c --- /dev/null +++ b/mDNSResponder/Clients/BonjourExample/BonjourExample.cpp @@ -0,0 +1,199 @@ +/* -*- Mode: C; tab-width: 4 -*- + * + * Copyright (c) 2005 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 + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * 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. + */ + +#include "stdafx.h" + +#include +#include + +#include "dns_sd.h" + +// Constants + +#define BONJOUR_EVENT ( WM_USER + 0x100 ) // Message sent to the Window when a Bonjour event occurs. + +// Prototypes + +static LRESULT CALLBACK WndProc( HWND inWindow, UINT inMsg, WPARAM inWParam, LPARAM inLParam ); + +static void DNSSD_API + BrowserCallBack( + DNSServiceRef inServiceRef, + DNSServiceFlags inFlags, + uint32_t inIFI, + DNSServiceErrorType inError, + const char * inName, + const char * inType, + const char * inDomain, + void * inContext ); + +// Globals + +DNSServiceRef gServiceRef = NULL; + +// Main entry point for application. + +int _tmain( int argc, _TCHAR *argv[] ) +{ + HINSTANCE instance; + WNDCLASSEX wcex; + HWND wind; + MSG msg; + DNSServiceErrorType err; + + (void) argc; // Unused + (void) argv; // Unused + + // Create the window. This window won't actually be shown, but it demonstrates how to use Bonjour + // with Windows GUI applications by having Bonjour events processed as messages to a Window. + + instance = GetModuleHandle( NULL ); + assert( instance ); + + wcex.cbSize = sizeof( wcex ); + wcex.style = 0; + wcex.lpfnWndProc = (WNDPROC) WndProc; + wcex.cbClsExtra = 0; + wcex.cbWndExtra = 0; + wcex.hInstance = instance; + wcex.hIcon = NULL; + wcex.hCursor = NULL; + wcex.hbrBackground = NULL; + wcex.lpszMenuName = NULL; + wcex.lpszClassName = TEXT( "BonjourExample" ); + wcex.hIconSm = NULL; + RegisterClassEx( &wcex ); + + wind = CreateWindow( wcex.lpszClassName, wcex.lpszClassName, 0, CW_USEDEFAULT, 0, CW_USEDEFAULT, + 0, NULL, NULL, instance, NULL ); + assert( wind ); + + // Start browsing for services and associate the Bonjour browser with our window using the + // WSAAsyncSelect mechanism. Whenever something related to the Bonjour browser occurs, our + // private Windows message will be sent to our window so we can give Bonjour a chance to + // process it. This allows Bonjour to avoid using a secondary thread (and all the issues + // with synchronization that would introduce), but still process everything asynchronously. + // This also simplifies app code because Bonjour will only run when we explicitly call it. + + err = DNSServiceBrowse( + &gServiceRef, // Receives reference to Bonjour browser object. + 0, // No flags. + kDNSServiceInterfaceIndexAny, // Browse on all network interfaces. + "_http._tcp", // Browse for HTTP service types. + NULL, // Browse on the default domain (e.g. local.). + BrowserCallBack, // Callback function when Bonjour events occur. + NULL ); // No callback context needed. + assert( err == kDNSServiceErr_NoError ); + + err = WSAAsyncSelect( (SOCKET) DNSServiceRefSockFD( gServiceRef ), wind, BONJOUR_EVENT, FD_READ | FD_CLOSE ); + assert( err == kDNSServiceErr_NoError ); + + fprintf( stderr, "Browsing for _http._tcp\n" ); + + // Main event loop for the application. All Bonjour events are dispatched while in this loop. + + while( GetMessage( &msg, NULL, 0, 0 ) ) + { + TranslateMessage( &msg ); + DispatchMessage( &msg ); + } + + // Clean up Bonjour. This is not strictly necessary since the normal process cleanup will + // close Bonjour socket(s) and release memory, but it's here to demonstrate how to do it. + + if( gServiceRef ) + { + WSAAsyncSelect( (SOCKET) DNSServiceRefSockFD( gServiceRef ), wind, BONJOUR_EVENT, 0 ); + DNSServiceRefDeallocate( gServiceRef ); + } + return( 0 ); +} + +// Callback for the Window. Bonjour events are delivered here. + +static LRESULT CALLBACK WndProc( HWND inWindow, UINT inMsg, WPARAM inWParam, LPARAM inLParam ) +{ + LRESULT result; + DNSServiceErrorType err; + + switch( inMsg ) + { + case BONJOUR_EVENT: + + // Process the Bonjour event. All Bonjour callbacks occur from within this function. + // If an error occurs while trying to process the result, it most likely means that + // something serious has gone wrong with Bonjour, such as it being terminated. This + // does not normally occur, but code should be prepared to handle it. If the error + // is ignored, the window will receive a constant stream of BONJOUR_EVENT messages so + // if an error occurs, we disassociate the DNSServiceRef from the window, deallocate + // it, and invalidate the reference so we don't try to deallocate it again on quit. + // Since this is a simple example app, if this error occurs, we quit the app too. + + err = DNSServiceProcessResult( gServiceRef ); + if( err != kDNSServiceErr_NoError ) + { + fprintf( stderr, "### ERROR! serious Bonjour error: %d\n", err ); + + WSAAsyncSelect( (SOCKET) DNSServiceRefSockFD( gServiceRef ), inWindow, BONJOUR_EVENT, 0 ); + DNSServiceRefDeallocate( gServiceRef ); + gServiceRef = NULL; + + PostQuitMessage( 0 ); + } + result = 0; + break; + + default: + result = DefWindowProc( inWindow, inMsg, inWParam, inLParam ); + break; + } + return( result ); +} + +// Callback for Bonjour browser events. Called when services are added or removed. + +static void DNSSD_API + BrowserCallBack( + DNSServiceRef inServiceRef, + DNSServiceFlags inFlags, + uint32_t inIFI, + DNSServiceErrorType inError, + const char * inName, + const char * inType, + const char * inDomain, + void * inContext ) +{ + (void) inServiceRef; // Unused + (void) inContext; // Unused + + if( inError == kDNSServiceErr_NoError ) + { + const char * action; + const char * more; + + if( inFlags & kDNSServiceFlagsAdd ) action = "ADD"; + else action = "RMV"; + if( inFlags & kDNSServiceFlagsMoreComing ) more = " (MORE)"; + else more = ""; + + fprintf( stderr, "%s %30s.%s%s on interface %d%s\n", action, inName, inType, inDomain, (int) inIFI, more ); + } + else + { + fprintf( stderr, "Bonjour browser error occurred: %d\n", inError ); + } +} diff --git a/mDNSResponder/Clients/BonjourExample/BonjourExample.sln b/mDNSResponder/Clients/BonjourExample/BonjourExample.sln new file mode 100644 index 00000000..fb803309 --- /dev/null +++ b/mDNSResponder/Clients/BonjourExample/BonjourExample.sln @@ -0,0 +1,21 @@ +Microsoft Visual Studio Solution File, Format Version 8.00 +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "BonjourExample", "BonjourExample.vcproj", "{0A842379-799E-414C-BF1F-BF11A8D3A8A8}" + ProjectSection(ProjectDependencies) = postProject + EndProjectSection +EndProject +Global + GlobalSection(SolutionConfiguration) = preSolution + Debug = Debug + Release = Release + EndGlobalSection + GlobalSection(ProjectConfiguration) = postSolution + {0A842379-799E-414C-BF1F-BF11A8D3A8A8}.Debug.ActiveCfg = Debug|Win32 + {0A842379-799E-414C-BF1F-BF11A8D3A8A8}.Debug.Build.0 = Debug|Win32 + {0A842379-799E-414C-BF1F-BF11A8D3A8A8}.Release.ActiveCfg = Release|Win32 + {0A842379-799E-414C-BF1F-BF11A8D3A8A8}.Release.Build.0 = Release|Win32 + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + EndGlobalSection + GlobalSection(ExtensibilityAddIns) = postSolution + EndGlobalSection +EndGlobal diff --git a/mDNSResponder/Clients/BonjourExample/BonjourExample.vcproj b/mDNSResponder/Clients/BonjourExample/BonjourExample.vcproj new file mode 100644 index 00000000..b58f3b16 --- /dev/null +++ b/mDNSResponder/Clients/BonjourExample/BonjourExample.vcproj @@ -0,0 +1,156 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/mDNSResponder/Clients/BonjourExample/stdafx.cpp b/mDNSResponder/Clients/BonjourExample/stdafx.cpp new file mode 100644 index 00000000..a28f2b5b --- /dev/null +++ b/mDNSResponder/Clients/BonjourExample/stdafx.cpp @@ -0,0 +1,20 @@ +/* -*- Mode: C; tab-width: 4 -*- + * + * Copyright (c) 2005 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 + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * 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. + */ + +// Standard source file to build the pre-compiled header. + +#include "stdafx.h" diff --git a/mDNSResponder/Clients/BonjourExample/stdafx.h b/mDNSResponder/Clients/BonjourExample/stdafx.h new file mode 100644 index 00000000..d820f4ab --- /dev/null +++ b/mDNSResponder/Clients/BonjourExample/stdafx.h @@ -0,0 +1,30 @@ +/* -*- Mode: C; tab-width: 4 -*- + * + * Copyright (c) 2005 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 + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * 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. + */ + +// Standard Windows pre-compiled header file. + +#pragma once + +#define WIN32_LEAN_AND_MEAN // Exclude rarely-used stuff from Windows headers + +#include +#include + +#include +#include +#include +#include diff --git a/mDNSResponder/Clients/ClientCommon.c b/mDNSResponder/Clients/ClientCommon.c new file mode 100644 index 00000000..68f354cc --- /dev/null +++ b/mDNSResponder/Clients/ClientCommon.c @@ -0,0 +1,75 @@ +/* -*- Mode: C; tab-width: 4 -*- + * + * Copyright (c) 2008 Apple Inc. All rights reserved. + * + * Disclaimer: IMPORTANT: This Apple software is supplied to you by Apple Computer, Inc. + * ("Apple") in consideration of your agreement to the following terms, and your + * use, installation, modification or redistribution of this Apple software + * constitutes acceptance of these terms. If you do not agree with these terms, + * please do not use, install, modify or redistribute this Apple software. + * + * In consideration of your agreement to abide by the following terms, and subject + * to these terms, Apple grants you a personal, non-exclusive license, under Apple's + * copyrights in this original Apple software (the "Apple Software"), to use, + * reproduce, modify and redistribute the Apple Software, with or without + * modifications, in source and/or binary forms; provided that if you redistribute + * the Apple Software in its entirety and without modifications, you must retain + * this notice and the following text and disclaimers in all such redistributions of + * the Apple Software. Neither the name, trademarks, service marks or logos of + * Apple Computer, Inc. may be used to endorse or promote products derived from the + * Apple Software without specific prior written permission from Apple. Except as + * expressly stated in this notice, no other rights or licenses, express or implied, + * are granted by Apple herein, including but not limited to any patent rights that + * may be infringed by your derivative works or by other works in which the Apple + * Software may be incorporated. + * + * The Apple Software is provided by Apple on an "AS IS" basis. APPLE MAKES NO + * WARRANTIES, EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION THE IMPLIED + * WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE, REGARDING THE APPLE SOFTWARE OR ITS USE AND OPERATION ALONE OR IN + * COMBINATION WITH YOUR PRODUCTS. + * + * IN NO EVENT SHALL APPLE BE LIABLE FOR ANY SPECIAL, INDIRECT, INCIDENTAL OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE + * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * ARISING IN ANY WAY OUT OF THE USE, REPRODUCTION, MODIFICATION AND/OR DISTRIBUTION + * OF THE APPLE SOFTWARE, HOWEVER CAUSED AND WHETHER UNDER THEORY OF CONTRACT, TORT + * (INCLUDING NEGLIGENCE), STRICT LIABILITY OR OTHERWISE, EVEN IF APPLE HAS BEEN + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include +#include // For stdout, stderr + +#include "ClientCommon.h" + +const char *GetNextLabel(const char *cstr, char label[64]) +{ + char *ptr = label; + while (*cstr && *cstr != '.') // While we have characters in the label... + { + char c = *cstr++; + if (c == '\\' && *cstr) // If we have a backslash, and it's not the last character of the string + { + c = *cstr++; + if (isdigit(cstr[-1]) && isdigit(cstr[0]) && isdigit(cstr[1])) + { + int v0 = cstr[-1] - '0'; // then interpret as three-digit decimal + int v1 = cstr[ 0] - '0'; + int v2 = cstr[ 1] - '0'; + int val = v0 * 100 + v1 * 10 + v2; + // If valid three-digit decimal value, use it + // Note that although ascii nuls are possible in DNS labels + // we're building a C string here so we have no way to represent that + if (val == 0) val = '-'; + if (val <= 255) { c = (char)val; cstr += 2; } + } + } + *ptr++ = c; + if (ptr >= label+64) { label[63] = 0; return(NULL); } // Illegal label more than 63 bytes + } + *ptr = 0; // Null-terminate label text + if (ptr == label) return(NULL); // Illegal empty label + if (*cstr) cstr++; // Skip over the trailing dot (if present) + return(cstr); +} diff --git a/mDNSResponder/Clients/ClientCommon.h b/mDNSResponder/Clients/ClientCommon.h new file mode 100644 index 00000000..afe5b7a5 --- /dev/null +++ b/mDNSResponder/Clients/ClientCommon.h @@ -0,0 +1,41 @@ +/* -*- Mode: C; tab-width: 4 -*- + * + * Copyright (c) 2008 Apple Inc. All rights reserved. + * + * Disclaimer: IMPORTANT: This Apple software is supplied to you by Apple Computer, Inc. + * ("Apple") in consideration of your agreement to the following terms, and your + * use, installation, modification or redistribution of this Apple software + * constitutes acceptance of these terms. If you do not agree with these terms, + * please do not use, install, modify or redistribute this Apple software. + * + * In consideration of your agreement to abide by the following terms, and subject + * to these terms, Apple grants you a personal, non-exclusive license, under Apple's + * copyrights in this original Apple software (the "Apple Software"), to use, + * reproduce, modify and redistribute the Apple Software, with or without + * modifications, in source and/or binary forms; provided that if you redistribute + * the Apple Software in its entirety and without modifications, you must retain + * this notice and the following text and disclaimers in all such redistributions of + * the Apple Software. Neither the name, trademarks, service marks or logos of + * Apple Computer, Inc. may be used to endorse or promote products derived from the + * Apple Software without specific prior written permission from Apple. Except as + * expressly stated in this notice, no other rights or licenses, express or implied, + * are granted by Apple herein, including but not limited to any patent rights that + * may be infringed by your derivative works or by other works in which the Apple + * Software may be incorporated. + * + * The Apple Software is provided by Apple on an "AS IS" basis. APPLE MAKES NO + * WARRANTIES, EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION THE IMPLIED + * WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE, REGARDING THE APPLE SOFTWARE OR ITS USE AND OPERATION ALONE OR IN + * COMBINATION WITH YOUR PRODUCTS. + * + * IN NO EVENT SHALL APPLE BE LIABLE FOR ANY SPECIAL, INDIRECT, INCIDENTAL OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE + * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * ARISING IN ANY WAY OUT OF THE USE, REPRODUCTION, MODIFICATION AND/OR DISTRIBUTION + * OF THE APPLE SOFTWARE, HOWEVER CAUSED AND WHETHER UNDER THEORY OF CONTRACT, TORT + * (INCLUDING NEGLIGENCE), STRICT LIABILITY OR OTHERWISE, EVEN IF APPLE HAS BEEN + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +extern const char *GetNextLabel(const char *cstr, char label[64]); diff --git a/mDNSResponder/Clients/DNS-SD.VisualStudio/DNS-SD.manifest b/mDNSResponder/Clients/DNS-SD.VisualStudio/DNS-SD.manifest new file mode 100644 index 00000000..9e0b08ae --- /dev/null +++ b/mDNSResponder/Clients/DNS-SD.VisualStudio/DNS-SD.manifest @@ -0,0 +1,12 @@ + + + + Command line utility. + + + + + + + + diff --git a/mDNSResponder/Clients/DNS-SD.VisualStudio/DNS-SD64.manifest b/mDNSResponder/Clients/DNS-SD.VisualStudio/DNS-SD64.manifest new file mode 100644 index 00000000..caa49dff --- /dev/null +++ b/mDNSResponder/Clients/DNS-SD.VisualStudio/DNS-SD64.manifest @@ -0,0 +1,12 @@ + + + + Command Line Utility + + + + + + + + diff --git a/mDNSResponder/Clients/DNS-SD.VisualStudio/dns-sd.rc b/mDNSResponder/Clients/DNS-SD.VisualStudio/dns-sd.rc new file mode 100755 index 00000000..79df1bac --- /dev/null +++ b/mDNSResponder/Clients/DNS-SD.VisualStudio/dns-sd.rc @@ -0,0 +1,103 @@ +// Microsoft Visual C++ generated resource script. +// +#include "resource.h" + +#define APSTUDIO_READONLY_SYMBOLS +///////////////////////////////////////////////////////////////////////////// +// +// Generated from the TEXTINCLUDE 2 resource. +// +#include "afxres.h" +#include "WinVersRes.h" + +///////////////////////////////////////////////////////////////////////////// +#undef APSTUDIO_READONLY_SYMBOLS + +///////////////////////////////////////////////////////////////////////////// +// English (U.S.) resources + +#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU) +#ifdef _WIN32 +LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US +#pragma code_page(1252) +#endif //_WIN32 + +#ifdef APSTUDIO_INVOKED +///////////////////////////////////////////////////////////////////////////// +// +// TEXTINCLUDE +// + +1 TEXTINCLUDE +BEGIN + "resource.h\0" +END + +2 TEXTINCLUDE +BEGIN + "#include ""afxres.h""\r\n" + "\0" +END + +3 TEXTINCLUDE +BEGIN + "\r\n" + "\0" +END + +#endif // APSTUDIO_INVOKED + + +///////////////////////////////////////////////////////////////////////////// +// +// Version +// + +VS_VERSION_INFO VERSIONINFO + FILEVERSION MASTER_PROD_VERS + PRODUCTVERSION MASTER_PROD_VERS + FILEFLAGSMASK 0x17L +#ifdef _DEBUG + FILEFLAGS 0x1L +#else + FILEFLAGS 0x0L +#endif + FILEOS 0x4L + FILETYPE 0x1L + FILESUBTYPE 0x0L +BEGIN + BLOCK "StringFileInfo" + BEGIN + BLOCK "040904b0" + BEGIN + VALUE "CompanyName", MASTER_COMPANY_NAME + VALUE "FileDescription", "Bonjour Console Utility" + VALUE "FileVersion", MASTER_PROD_VERS_STR + VALUE "InternalName", "dns-sd.exe" + VALUE "LegalCopyright", MASTER_LEGAL_COPYRIGHT + VALUE "OriginalFilename", "dns-sd.exe" + VALUE "ProductName", MASTER_PROD_NAME + VALUE "ProductVersion", MASTER_PROD_VERS_STR + END + END + BLOCK "VarFileInfo" + BEGIN + VALUE "Translation", 0x409, 1200 + END +END + +#endif // English (U.S.) resources +///////////////////////////////////////////////////////////////////////////// + + + +#ifndef APSTUDIO_INVOKED +///////////////////////////////////////////////////////////////////////////// +// +// Generated from the TEXTINCLUDE 3 resource. +// + + +///////////////////////////////////////////////////////////////////////////// +#endif // not APSTUDIO_INVOKED + diff --git a/mDNSResponder/Clients/DNS-SD.VisualStudio/dns-sd.sdk.rc b/mDNSResponder/Clients/DNS-SD.VisualStudio/dns-sd.sdk.rc new file mode 100755 index 00000000..9274716c --- /dev/null +++ b/mDNSResponder/Clients/DNS-SD.VisualStudio/dns-sd.sdk.rc @@ -0,0 +1,102 @@ +// Microsoft Visual C++ generated resource script. +// +#include "resource.h" + +#define APSTUDIO_READONLY_SYMBOLS +///////////////////////////////////////////////////////////////////////////// +// +// Generated from the TEXTINCLUDE 2 resource. +// +#include "afxres.h" + +///////////////////////////////////////////////////////////////////////////// +#undef APSTUDIO_READONLY_SYMBOLS + +///////////////////////////////////////////////////////////////////////////// +// English (U.S.) resources + +#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU) +#ifdef _WIN32 +LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US +#pragma code_page(1252) +#endif //_WIN32 + +#ifdef APSTUDIO_INVOKED +///////////////////////////////////////////////////////////////////////////// +// +// TEXTINCLUDE +// + +1 TEXTINCLUDE +BEGIN + "resource.h\0" +END + +2 TEXTINCLUDE +BEGIN + "#include ""afxres.h""\r\n" + "\0" +END + +3 TEXTINCLUDE +BEGIN + "\r\n" + "\0" +END + +#endif // APSTUDIO_INVOKED + + +///////////////////////////////////////////////////////////////////////////// +// +// Version +// + +VS_VERSION_INFO VERSIONINFO + FILEVERSION 1,0,0,0 + PRODUCTVERSION 1,0,0,0 + FILEFLAGSMASK 0x17L +#ifdef _DEBUG + FILEFLAGS 0x1L +#else + FILEFLAGS 0x0L +#endif + FILEOS 0x4L + FILETYPE 0x1L + FILESUBTYPE 0x0L +BEGIN + BLOCK "StringFileInfo" + BEGIN + BLOCK "040904b0" + BEGIN + VALUE "CompanyName", "Apple Inc." + VALUE "FileDescription", "Bonjour Console Utility" + VALUE "FileVersion", "1.0.0.0" + VALUE "InternalName", "dns-sd.exe" + VALUE "LegalCopyright", "Copyright (C) 2010 Apple Inc." + VALUE "OriginalFilename", "dns-sd.exe" + VALUE "ProductName", "Bonjour" + VALUE "ProductVersion", "1.0.0.0" + END + END + BLOCK "VarFileInfo" + BEGIN + VALUE "Translation", 0x409, 1200 + END +END + +#endif // English (U.S.) resources +///////////////////////////////////////////////////////////////////////////// + + + +#ifndef APSTUDIO_INVOKED +///////////////////////////////////////////////////////////////////////////// +// +// Generated from the TEXTINCLUDE 3 resource. +// + + +///////////////////////////////////////////////////////////////////////////// +#endif // not APSTUDIO_INVOKED + diff --git a/mDNSResponder/Clients/DNS-SD.VisualStudio/dns-sd.sdk.vcproj b/mDNSResponder/Clients/DNS-SD.VisualStudio/dns-sd.sdk.vcproj new file mode 100755 index 00000000..41daa815 --- /dev/null +++ b/mDNSResponder/Clients/DNS-SD.VisualStudio/dns-sd.sdk.vcproj @@ -0,0 +1,408 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/mDNSResponder/Clients/DNS-SD.VisualStudio/dns-sd.vcproj b/mDNSResponder/Clients/DNS-SD.VisualStudio/dns-sd.vcproj new file mode 100755 index 00000000..58e79e46 --- /dev/null +++ b/mDNSResponder/Clients/DNS-SD.VisualStudio/dns-sd.vcproj @@ -0,0 +1,408 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/mDNSResponder/Clients/DNS-SD.VisualStudio/dns-sd.vcxproj b/mDNSResponder/Clients/DNS-SD.VisualStudio/dns-sd.vcxproj new file mode 100755 index 00000000..8ed154a9 --- /dev/null +++ b/mDNSResponder/Clients/DNS-SD.VisualStudio/dns-sd.vcxproj @@ -0,0 +1,272 @@ + + + + + Debug + Win32 + + + Debug + x64 + + + Release + Win32 + + + Release + x64 + + + + {AA230639-E115-4A44-AA5A-44A61235BA50} + Win32Proj + + + + Application + MultiByte + + + Application + MultiByte + + + Application + MultiByte + + + Application + MultiByte + + + + + + + + + + + + + + + + + + + + + + + <_ProjectFileVersion>10.0.30319.1 + $(Platform)\$(Configuration)\ + $(Platform)\$(Configuration)\ + true + $(Platform)\$(Configuration)\ + $(Platform)\$(Configuration)\ + true + $(Platform)\$(Configuration)\ + $(Platform)\$(Configuration)\ + false + $(Platform)\$(Configuration)\ + $(Platform)\$(Configuration)\ + false + + + + Disabled + ../../mDNSShared;%(AdditionalIncludeDirectories) + WIN32;_WIN32;_DEBUG;_CONSOLE;NOT_HAVE_GETOPT;NOT_HAVE_SETLINEBUF;WIN32_LEAN_AND_MEAN;_CRT_SECURE_NO_DEPRECATE;_CRT_SECURE_CPP_OVERLOAD_STANDARD_NAMES=1;%(PreprocessorDefinitions) + true + EnableFastChecks + MultiThreadedDebug + + + $(IntDir) + Level3 + ProgramDatabase + + + ../../mDNSWindows;%(AdditionalIncludeDirectories) + + + /NXCOMPAT /DYNAMICBASE /SAFESEH %(AdditionalOptions) + ../../mDNSWindows/DLL/$(Platform)/$(Configuration)/dnssd.lib;ws2_32.lib;%(AdditionalDependencies) + $(OutDir)dns-sd.exe + true + $(OutDir)dns-sd.pdb + Console + MachineX86 + + + DNS-SD.manifest;%(AdditionalManifestFiles) + + + + + X64 + + + Disabled + ../../mDNSShared;%(AdditionalIncludeDirectories) + WIN32;_WIN32;_DEBUG;_CONSOLE;NOT_HAVE_GETOPT;NOT_HAVE_SETLINEBUF;WIN32_LEAN_AND_MEAN;_CRT_SECURE_NO_DEPRECATE;_CRT_SECURE_CPP_OVERLOAD_STANDARD_NAMES=1;%(PreprocessorDefinitions) + true + EnableFastChecks + MultiThreadedDebug + + + $(IntDir) + Level3 + ProgramDatabase + + + ../../mDNSWindows;%(AdditionalIncludeDirectories) + + + /NXCOMPAT /DYNAMICBASE %(AdditionalOptions) + ../../mDNSWindows/DLL/$(Platform)/$(Configuration)/dnssd.lib;ws2_32.lib;%(AdditionalDependencies) + $(OutDir)dns-sd.exe + true + $(OutDir)dns-sd.pdb + Console + MachineX64 + + + DNS-SD64.manifest;%(AdditionalManifestFiles) + + + + + MaxSpeed + OnlyExplicitInline + true + ../../mDNSShared;%(AdditionalIncludeDirectories) + WIN32;_WIN32;NDEBUG;_CONSOLE;NOT_HAVE_GETOPT;NOT_HAVE_SETLINEBUF;WIN32_LEAN_AND_MEAN;_CRT_SECURE_NO_DEPRECATE;_CRT_SECURE_CPP_OVERLOAD_STANDARD_NAMES=1;%(PreprocessorDefinitions) + true + MultiThreaded + true + + + $(IntDir) + Level3 + ProgramDatabase + + + ../../mDNSWindows;%(AdditionalIncludeDirectories) + + + /NXCOMPAT /DYNAMICBASE /SAFESEH %(AdditionalOptions) + ../../mDNSWindows/DLL/$(Platform)/$(Configuration)/dnssd.lib;ws2_32.lib;%(AdditionalDependencies) + $(OutDir)dns-sd.exe + true + Console + true + true + MachineX86 + + + DNS-SD.manifest;%(AdditionalManifestFiles) + + + if not "%RC_XBS%" == "YES" goto END +if not exist "$(DSTROOT)\WINDOWS\system32\$(Platform)" mkdir "$(DSTROOT)\WINDOWS\system32\$(Platform)" +if not exist "$(DSTROOT)\Program Files\Bonjour SDK\Samples\C" mkdir "$(DSTROOT)\Program Files\Bonjour SDK\Samples\C" +if not exist "$(DSTROOT)\Program Files\Bonjour SDK\Samples\CS" mkdir "$(DSTROOT)\Program Files\Bonjour SDK\Samples\CS" +if not exist "$(DSTROOT)\Program Files\Bonjour SDK\Samples\CS\DNSServiceBrowser" mkdir "$(DSTROOT)\Program Files\Bonjour SDK\Samples\CS\DNSServiceBrowser" +if not exist "$(DSTROOT)\Program Files\Bonjour SDK\Samples\CS\SimpleChat" mkdir "$(DSTROOT)\Program Files\Bonjour SDK\Samples\CS\SimpleChat" +if not exist "$(DSTROOT)\Program Files\Bonjour SDK\Samples\VB" mkdir "$(DSTROOT)\Program Files\Bonjour SDK\Samples\VB" +if not exist "$(DSTROOT)\Program Files\Bonjour SDK\Samples\VB\DNSServiceBrowser" mkdir "$(DSTROOT)\Program Files\Bonjour SDK\Samples\VB\DNSServiceBrowser" +if not exist "$(DSTROOT)\Program Files\Bonjour SDK\Samples\VB\DNSServiceBrowser\My Project" mkdir "$(DSTROOT)\Program Files\Bonjour SDK\Samples\VB\DNSServiceBrowser\My Project" +if not exist "$(DSTROOT)\Program Files\Bonjour SDK\Samples\VB\SimpleChat" mkdir "$(DSTROOT)\Program Files\Bonjour SDK\Samples\VB\SimpleChat" +xcopy /I/Y "$(TargetPath)" "$(DSTROOT)\WINDOWS\system32\$(Platform)" +xcopy /I/Y "$(ProjectDir)..\dns-sd.c" "$(DSTROOT)\Program Files\Bonjour SDK\Samples\C" +xcopy /I/Y "$(ProjectDir)..\ClientCommon.c" "$(DSTROOT)\Program Files\Bonjour SDK\Samples\C" +xcopy /I/Y "$(ProjectDir)..\ClientCommon.h" "$(DSTROOT)\Program Files\Bonjour SDK\Samples\C" +xcopy /I/Y "$(ProjectDir)resource.h" "$(DSTROOT)\Program Files\Bonjour SDK\Samples\C" +xcopy /I/Y "$(ProjectDir)DNS-SD.manifest" "$(DSTROOT)\Program Files\Bonjour SDK\Samples\C" +xcopy /I/Y "$(ProjectDir)DNS-SD64.manifest" "$(DSTROOT)\Program Files\Bonjour SDK\Samples\C" +xcopy /I/Y "$(ProjectDir)dns-sd.sdk.rc" "$(DSTROOT)\Program Files\Bonjour SDK\Samples\C" +move /Y "$(DSTROOT)\Program Files\Bonjour SDK\Samples\C\dns-sd.sdk.rc" "$(DSTROOT)\Program Files\Bonjour SDK\Samples\C\dns-sd.rc" +xcopy /I/Y "$(ProjectDir)dns-sd.sdk.vcproj" "$(DSTROOT)\Program Files\Bonjour SDK\Samples\C" +move /Y "$(DSTROOT)\Program Files\Bonjour SDK\Samples\C\dns-sd.sdk.vcproj" "$(DSTROOT)\Program Files\Bonjour SDK\Samples\C\dns-sd.vcproj" +xcopy /I/Y "$(ProjectDir)..\DNSServiceBrowser.NET\App.ico" "$(DSTROOT)\Program Files\Bonjour SDK\Samples\CS\DNSServiceBrowser" +xcopy /I/Y "$(ProjectDir)..\DNSServiceBrowser.NET\AssemblyInfo.cs" "$(DSTROOT)\Program Files\Bonjour SDK\Samples\CS\DNSServiceBrowser" +xcopy /I/Y "$(ProjectDir)..\DNSServiceBrowser.NET\DNSServiceBrowser.NET.csproj" "$(DSTROOT)\Program Files\Bonjour SDK\Samples\CS\DNSServiceBrowser" +xcopy /I/Y "$(ProjectDir)..\DNSServiceBrowser.NET\DNSServiceBrowser.cs" "$(DSTROOT)\Program Files\Bonjour SDK\Samples\CS\DNSServiceBrowser" +xcopy /I/Y "$(ProjectDir)..\DNSServiceBrowser.NET\DNSServiceBrowser.resx" "$(DSTROOT)\Program Files\Bonjour SDK\Samples\CS\DNSServiceBrowser" +xcopy /I/Y "$(ProjectDir)..\SimpleChat.NET\App.ico" "$(DSTROOT)\Program Files\Bonjour SDK\Samples\CS\SimpleChat" +xcopy /I/Y "$(ProjectDir)..\SimpleChat.NET\AssemblyInfo.cs" "$(DSTROOT)\Program Files\Bonjour SDK\Samples\CS\SimpleChat" +xcopy /I/Y "$(ProjectDir)..\SimpleChat.NET\SimpleChat.NET.csproj" "$(DSTROOT)\Program Files\Bonjour SDK\Samples\CS\SimpleChat" +xcopy /I/Y "$(ProjectDir)..\SimpleChat.NET\SimpleChat.cs" "$(DSTROOT)\Program Files\Bonjour SDK\Samples\CS\SimpleChat" +xcopy /I/Y "$(ProjectDir)..\SimpleChat.NET\SimpleChat.resx" "$(DSTROOT)\Program Files\Bonjour SDK\Samples\CS\SimpleChat" +xcopy /I/Y "$(ProjectDir)..\DNSServiceBrowser.VB\DNSServiceBrowser.Designer.vb" "$(DSTROOT)\Program Files\Bonjour SDK\Samples\VB\DNSServiceBrowser" +xcopy /I/Y "$(ProjectDir)..\DNSServiceBrowser.VB\DNSServiceBrowser.VB.vbproj" "$(DSTROOT)\Program Files\Bonjour SDK\Samples\VB\DNSServiceBrowser" +xcopy /I/Y "$(ProjectDir)..\DNSServiceBrowser.VB\DNSServiceBrowser.resx" "$(DSTROOT)\Program Files\Bonjour SDK\Samples\VB\DNSServiceBrowser" +xcopy /I/Y "$(ProjectDir)..\DNSServiceBrowser.VB\DNSServiceBrowser.vb" "$(DSTROOT)\Program Files\Bonjour SDK\Samples\VB\DNSServiceBrowser" +xcopy /E/Y "$(ProjectDir)..\DNSServiceBrowser.VB\My Project" "$(DSTROOT)\Program Files\Bonjour SDK\Samples\VB\DNSServiceBrowser\My Project" +xcopy /E/Y "$(ProjectDir)..\SimpleChat.VB" "$(DSTROOT)\Program Files\Bonjour SDK\Samples\VB\SimpleChat" +:END + + + + + + X64 + + + MaxSpeed + OnlyExplicitInline + true + ../../mDNSShared;%(AdditionalIncludeDirectories) + WIN32;_WIN32;NDEBUG;_CONSOLE;NOT_HAVE_GETOPT;NOT_HAVE_SETLINEBUF;WIN32_LEAN_AND_MEAN;_CRT_SECURE_NO_DEPRECATE;_CRT_SECURE_CPP_OVERLOAD_STANDARD_NAMES=1;%(PreprocessorDefinitions) + true + MultiThreaded + true + + + $(IntDir) + Level3 + ProgramDatabase + + + ../../mDNSWindows;%(AdditionalIncludeDirectories) + + + /NXCOMPAT /DYNAMICBASE %(AdditionalOptions) + ../../mDNSWindows/DLL/$(Platform)/$(Configuration)/dnssd.lib;ws2_32.lib;%(AdditionalDependencies) + $(OutDir)dns-sd.exe + true + Console + true + true + MachineX64 + + + DNS-SD64.manifest;%(AdditionalManifestFiles) + + + if not "%RC_XBS%" == "YES" goto END +if not exist "$(DSTROOT)\WINDOWS\system32\$(Platform)" mkdir "$(DSTROOT)\WINDOWS\system32\$(Platform)" +if not exist "$(DSTROOT)\Program Files\Bonjour SDK\Samples\C" mkdir "$(DSTROOT)\Program Files\Bonjour SDK\Samples\C" +xcopy /I/Y "$(TargetPath)" "$(DSTROOT)\WINDOWS\system32\$(Platform)" +:END + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/mDNSResponder/Clients/DNS-SD.VisualStudio/dns-sd.vcxproj.filters b/mDNSResponder/Clients/DNS-SD.VisualStudio/dns-sd.vcxproj.filters new file mode 100755 index 00000000..78299c04 --- /dev/null +++ b/mDNSResponder/Clients/DNS-SD.VisualStudio/dns-sd.vcxproj.filters @@ -0,0 +1,38 @@ + + + + + {663cbcf4-ce8e-49eb-9826-0676fba94350} + cpp;c;cxx;def;odl;idl;hpj;bat;asm + + + {f5fcca0d-918b-46ba-bb91-2f2f9d9ddbba} + h;hpp;hxx;hm;inl;inc + + + {a7d985ec-3f36-4554-a707-5256b2e719b6} + rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe + + + + + Source Files + + + Source Files + + + + + Header Files + + + Header Files + + + + + Resource Files + + + \ No newline at end of file diff --git a/mDNSResponder/Clients/DNS-SD.VisualStudio/resource.h b/mDNSResponder/Clients/DNS-SD.VisualStudio/resource.h new file mode 100755 index 00000000..593b5f9f --- /dev/null +++ b/mDNSResponder/Clients/DNS-SD.VisualStudio/resource.h @@ -0,0 +1,14 @@ +//{{NO_DEPENDENCIES}} +// Microsoft Visual C++ generated include file. +// Used by dns-sd.rc + +// Next default values for new objects +// +#ifdef APSTUDIO_INVOKED +#ifndef APSTUDIO_READONLY_SYMBOLS +#define _APS_NEXT_RESOURCE_VALUE 101 +#define _APS_NEXT_COMMAND_VALUE 40001 +#define _APS_NEXT_CONTROL_VALUE 1001 +#define _APS_NEXT_SYMED_VALUE 101 +#endif +#endif diff --git a/mDNSResponder/Clients/DNS-SD.xcodeproj/project.pbxproj b/mDNSResponder/Clients/DNS-SD.xcodeproj/project.pbxproj new file mode 100644 index 00000000..f2d54f04 --- /dev/null +++ b/mDNSResponder/Clients/DNS-SD.xcodeproj/project.pbxproj @@ -0,0 +1,737 @@ +// !$*UTF8*$! +{ + archiveVersion = 1; + classes = { + }; + objectVersion = 42; + objects = { + +/* Begin PBXAggregateTarget section */ + FFF520490671177900DA3D49 /* Build All */ = { + isa = PBXAggregateTarget; + buildConfigurationList = 21D91E890B12A03D003981D9 /* Build configuration list for PBXAggregateTarget "Build All" */; + buildPhases = ( + ); + dependencies = ( + FF383826067117F300FEF615 /* PBXTargetDependency */, + FF383828067117F600FEF615 /* PBXTargetDependency */, + FF1E351806711B6A003DD5BC /* PBXTargetDependency */, + ); + name = "Build All"; + productName = "Build All"; + }; +/* End PBXAggregateTarget section */ + +/* Begin PBXBuildFile section */ + 8DD76F770486A8DE00D96B5E /* dns-sd.c in Sources */ = {isa = PBXBuildFile; fileRef = 08FB7796FE84155DC02AAC07 /* dns-sd.c */; settings = {ATTRIBUTES = (); }; }; + FF1B6915067114AF002304DD /* DNSServiceBrowser.m in Sources */ = {isa = PBXBuildFile; fileRef = FF1B6914067114AF002304DD /* DNSServiceBrowser.m */; }; + FF1E351C06711BCF003DD5BC /* DNSServiceReg.m in Sources */ = {isa = PBXBuildFile; fileRef = FF1E351B06711BCF003DD5BC /* DNSServiceReg.m */; }; + FF1E352606711BD6003DD5BC /* DNSServiceReg.nib in Resources */ = {isa = PBXBuildFile; fileRef = FF1E352506711BD6003DD5BC /* DNSServiceReg.nib */; }; + FF2704F90F12A60900299571 /* ClientCommon.c in Sources */ = {isa = PBXBuildFile; fileRef = FF2704F80F12A60900299571 /* ClientCommon.c */; }; + FF964AA10671153B0099215A /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FF964AA00671153B0099215A /* Foundation.framework */; }; + FF964CAA0671155C0099215A /* AppKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FF964CA90671155C0099215A /* AppKit.framework */; }; + FF964DAC067115710099215A /* DNSServiceBrowser.nib in Resources */ = {isa = PBXBuildFile; fileRef = FF964DAB067115710099215A /* DNSServiceBrowser.nib */; }; +/* End PBXBuildFile section */ + +/* Begin PBXContainerItemProxy section */ + FF1E351706711B6A003DD5BC /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 08FB7793FE84155DC02AAC07 /* Project object */; + proxyType = 1; + remoteGlobalIDString = FF1E351206711B5C003DD5BC; + remoteInfo = DNSServiceReg; + }; + FF383825067117F300FEF615 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 08FB7793FE84155DC02AAC07 /* Project object */; + proxyType = 1; + remoteGlobalIDString = 8DD76F740486A8DE00D96B5E; + remoteInfo = "dns-sd"; + }; + FF383827067117F600FEF615 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 08FB7793FE84155DC02AAC07 /* Project object */; + proxyType = 1; + remoteGlobalIDString = FF1B691006711383002304DD; + remoteInfo = "DNS Service Browser"; + }; +/* End PBXContainerItemProxy section */ + +/* Begin PBXCopyFilesBuildPhase section */ + 8DD76F7B0486A8DE00D96B5E /* CopyFiles */ = { + isa = PBXCopyFilesBuildPhase; + buildActionMask = 8; + dstPath = /usr/share/man/man1/; + dstSubfolderSpec = 0; + files = ( + ); + runOnlyForDeploymentPostprocessing = 1; + }; +/* End PBXCopyFilesBuildPhase section */ + +/* Begin PBXFileReference section */ + 08FB7796FE84155DC02AAC07 /* dns-sd.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = "dns-sd.c"; sourceTree = ""; }; + 8DD76F7E0486A8DE00D96B5E /* dns-sd */ = {isa = PBXFileReference; includeInIndex = 0; lastKnownFileType = "compiled.mach-o.executable"; path = "dns-sd"; sourceTree = BUILT_PRODUCTS_DIR; }; + FF1B691106711383002304DD /* DNS Service Browser.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "DNS Service Browser.app"; sourceTree = BUILT_PRODUCTS_DIR; }; + FF1B6914067114AF002304DD /* DNSServiceBrowser.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = DNSServiceBrowser.m; sourceTree = ""; }; + FF1E351306711B5C003DD5BC /* DNS Service Registration.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "DNS Service Registration.app"; sourceTree = BUILT_PRODUCTS_DIR; }; + FF1E351B06711BCF003DD5BC /* DNSServiceReg.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = DNSServiceReg.m; sourceTree = ""; }; + FF1E352506711BD6003DD5BC /* DNSServiceReg.nib */ = {isa = PBXFileReference; lastKnownFileType = wrapper.nib; path = DNSServiceReg.nib; sourceTree = ""; }; + FF2704F80F12A60900299571 /* ClientCommon.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = ClientCommon.c; sourceTree = ""; }; + FF964AA00671153B0099215A /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = /System/Library/Frameworks/Foundation.framework; sourceTree = ""; }; + FF964CA90671155C0099215A /* AppKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AppKit.framework; path = /System/Library/Frameworks/AppKit.framework; sourceTree = ""; }; + FF964DAB067115710099215A /* DNSServiceBrowser.nib */ = {isa = PBXFileReference; lastKnownFileType = wrapper.nib; path = DNSServiceBrowser.nib; sourceTree = ""; }; +/* End PBXFileReference section */ + +/* Begin PBXFrameworksBuildPhase section */ + 8DD76F780486A8DE00D96B5E /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; + FF1B690F06711383002304DD /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + FF964AA10671153B0099215A /* Foundation.framework in Frameworks */, + FF964CAA0671155C0099215A /* AppKit.framework in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + FF1E351106711B5C003DD5BC /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXFrameworksBuildPhase section */ + +/* Begin PBXGroup section */ + 08FB7794FE84155DC02AAC07 /* mDNS */ = { + isa = PBXGroup; + children = ( + 08FB7795FE84155DC02AAC07 /* Source */, + 21D91EBD0B12A2B6003981D9 /* Resources */, + 08FB779DFE84155DC02AAC07 /* Frameworks */, + 19C28FBDFE9D53C911CA2CBB /* Products */, + ); + name = mDNS; + sourceTree = ""; + }; + 08FB7795FE84155DC02AAC07 /* Source */ = { + isa = PBXGroup; + children = ( + 08FB7796FE84155DC02AAC07 /* dns-sd.c */, + FF2704F80F12A60900299571 /* ClientCommon.c */, + FF1B6914067114AF002304DD /* DNSServiceBrowser.m */, + FF1E351B06711BCF003DD5BC /* DNSServiceReg.m */, + ); + name = Source; + sourceTree = ""; + }; + 08FB779DFE84155DC02AAC07 /* Frameworks */ = { + isa = PBXGroup; + children = ( + FF964CA90671155C0099215A /* AppKit.framework */, + FF964AA00671153B0099215A /* Foundation.framework */, + ); + name = Frameworks; + sourceTree = ""; + }; + 19C28FBDFE9D53C911CA2CBB /* Products */ = { + isa = PBXGroup; + children = ( + 8DD76F7E0486A8DE00D96B5E /* dns-sd */, + FF1B691106711383002304DD /* DNS Service Browser.app */, + FF1E351306711B5C003DD5BC /* DNS Service Registration.app */, + ); + name = Products; + sourceTree = ""; + }; + 21D91EBD0B12A2B6003981D9 /* Resources */ = { + isa = PBXGroup; + children = ( + FF964DAB067115710099215A /* DNSServiceBrowser.nib */, + FF1E352506711BD6003DD5BC /* DNSServiceReg.nib */, + ); + name = Resources; + sourceTree = ""; + }; +/* End PBXGroup section */ + +/* Begin PBXHeadersBuildPhase section */ + 8DD76F750486A8DE00D96B5E /* Headers */ = { + isa = PBXHeadersBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; + FF1B690C06711383002304DD /* Headers */ = { + isa = PBXHeadersBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; + FF1E350E06711B5C003DD5BC /* Headers */ = { + isa = PBXHeadersBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXHeadersBuildPhase section */ + +/* Begin PBXNativeTarget section */ + 8DD76F740486A8DE00D96B5E /* dns-sd */ = { + isa = PBXNativeTarget; + buildConfigurationList = 21D91E7D0B12A03D003981D9 /* Build configuration list for PBXNativeTarget "dns-sd" */; + buildPhases = ( + 8DD76F750486A8DE00D96B5E /* Headers */, + 8DD76F760486A8DE00D96B5E /* Sources */, + 8DD76F780486A8DE00D96B5E /* Frameworks */, + 8DD76F7A0486A8DE00D96B5E /* Rez */, + 8DD76F7B0486A8DE00D96B5E /* CopyFiles */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = "dns-sd"; + productInstallPath = "$(HOME)/bin"; + productName = mDNS; + productReference = 8DD76F7E0486A8DE00D96B5E /* dns-sd */; + productType = "com.apple.product-type.tool"; + }; + FF1B691006711383002304DD /* DNS Service Browser */ = { + isa = PBXNativeTarget; + buildConfigurationList = 21D91E810B12A03D003981D9 /* Build configuration list for PBXNativeTarget "DNS Service Browser" */; + buildPhases = ( + FF1B690C06711383002304DD /* Headers */, + FF1B690D06711383002304DD /* Resources */, + FF1B690E06711383002304DD /* Sources */, + FF1B690F06711383002304DD /* Frameworks */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = "DNS Service Browser"; + productName = "DNS Service Browser"; + productReference = FF1B691106711383002304DD /* DNS Service Browser.app */; + productType = "com.apple.product-type.application"; + }; + FF1E351206711B5C003DD5BC /* DNS Service Registration */ = { + isa = PBXNativeTarget; + buildConfigurationList = 21D91E850B12A03D003981D9 /* Build configuration list for PBXNativeTarget "DNS Service Registration" */; + buildPhases = ( + FF1E350E06711B5C003DD5BC /* Headers */, + FF1E350F06711B5C003DD5BC /* Resources */, + FF1E351006711B5C003DD5BC /* Sources */, + FF1E351106711B5C003DD5BC /* Frameworks */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = "DNS Service Registration"; + productName = "DNS Service Registration"; + productReference = FF1E351306711B5C003DD5BC /* DNS Service Registration.app */; + productType = "com.apple.product-type.application"; + }; +/* End PBXNativeTarget section */ + +/* Begin PBXProject section */ + 08FB7793FE84155DC02AAC07 /* Project object */ = { + isa = PBXProject; + buildConfigurationList = 21D91E8D0B12A03D003981D9 /* Build configuration list for PBXProject "DNS-SD" */; + hasScannedForEncodings = 1; + mainGroup = 08FB7794FE84155DC02AAC07 /* mDNS */; + projectDirPath = ""; + targets = ( + FFF520490671177900DA3D49 /* Build All */, + 8DD76F740486A8DE00D96B5E /* dns-sd */, + FF1B691006711383002304DD /* DNS Service Browser */, + FF1E351206711B5C003DD5BC /* DNS Service Registration */, + ); + }; +/* End PBXProject section */ + +/* Begin PBXResourcesBuildPhase section */ + FF1B690D06711383002304DD /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + FF964DAC067115710099215A /* DNSServiceBrowser.nib in Resources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + FF1E350F06711B5C003DD5BC /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + FF1E352606711BD6003DD5BC /* DNSServiceReg.nib in Resources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXResourcesBuildPhase section */ + +/* Begin PBXRezBuildPhase section */ + 8DD76F7A0486A8DE00D96B5E /* Rez */ = { + isa = PBXRezBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXRezBuildPhase section */ + +/* Begin PBXSourcesBuildPhase section */ + 8DD76F760486A8DE00D96B5E /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 8DD76F770486A8DE00D96B5E /* dns-sd.c in Sources */, + FF2704F90F12A60900299571 /* ClientCommon.c in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + FF1B690E06711383002304DD /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + FF1B6915067114AF002304DD /* DNSServiceBrowser.m in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + FF1E351006711B5C003DD5BC /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + FF1E351C06711BCF003DD5BC /* DNSServiceReg.m in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXSourcesBuildPhase section */ + +/* Begin PBXTargetDependency section */ + FF1E351806711B6A003DD5BC /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + target = FF1E351206711B5C003DD5BC /* DNS Service Registration */; + targetProxy = FF1E351706711B6A003DD5BC /* PBXContainerItemProxy */; + }; + FF383826067117F300FEF615 /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + target = 8DD76F740486A8DE00D96B5E /* dns-sd */; + targetProxy = FF383825067117F300FEF615 /* PBXContainerItemProxy */; + }; + FF383828067117F600FEF615 /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + target = FF1B691006711383002304DD /* DNS Service Browser */; + targetProxy = FF383827067117F600FEF615 /* PBXContainerItemProxy */; + }; +/* End PBXTargetDependency section */ + +/* Begin XCBuildConfiguration section */ + 21D91E7E0B12A03D003981D9 /* Development */ = { + isa = XCBuildConfiguration; + buildSettings = { + COPY_PHASE_STRIP = NO; + DEBUGGING_SYMBOLS = YES; + FRAMEWORK_SEARCH_PATHS = ""; + GCC_DYNAMIC_NO_PIC = NO; + GCC_ENABLE_FIX_AND_CONTINUE = YES; + GCC_ENABLE_TRIGRAPHS = NO; + GCC_GENERATE_DEBUGGING_SYMBOLS = YES; + GCC_OPTIMIZATION_LEVEL = 0; + GCC_PRECOMPILE_PREFIX_HEADER = NO; + GCC_WARN_ABOUT_MISSING_PROTOTYPES = NO; + GCC_WARN_FOUR_CHARACTER_CONSTANTS = NO; + GCC_WARN_UNKNOWN_PRAGMAS = NO; + HEADER_SEARCH_PATHS = ../mDNSShared; + INSTALL_PATH = "$(HOME)/bin"; + LIBRARY_SEARCH_PATHS = ""; + OPTIMIZATION_CFLAGS = "-O0"; + OTHER_CFLAGS = ""; + OTHER_LDFLAGS = ""; + OTHER_REZFLAGS = ""; + PRODUCT_NAME = "dns-sd"; + REZ_EXECUTABLE = YES; + SECTORDER_FLAGS = ""; + WARNING_CFLAGS = ( + "-Wmost", + "-Wno-four-char-constants", + "-Wno-unknown-pragmas", + ); + ZERO_LINK = NO; + }; + name = Development; + }; + 21D91E7F0B12A03D003981D9 /* Deployment */ = { + isa = XCBuildConfiguration; + buildSettings = { + COPY_PHASE_STRIP = YES; + FRAMEWORK_SEARCH_PATHS = ""; + GCC_ENABLE_FIX_AND_CONTINUE = NO; + GCC_ENABLE_TRIGRAPHS = NO; + GCC_GENERATE_DEBUGGING_SYMBOLS = NO; + GCC_PRECOMPILE_PREFIX_HEADER = NO; + GCC_WARN_ABOUT_MISSING_PROTOTYPES = NO; + GCC_WARN_FOUR_CHARACTER_CONSTANTS = NO; + GCC_WARN_UNKNOWN_PRAGMAS = NO; + HEADER_SEARCH_PATHS = ../mDNSShared; + INSTALL_PATH = "$(HOME)/bin"; + LIBRARY_SEARCH_PATHS = ""; + OTHER_CFLAGS = ""; + OTHER_LDFLAGS = ""; + OTHER_REZFLAGS = ""; + PRODUCT_NAME = "dns-sd"; + REZ_EXECUTABLE = YES; + SECTORDER_FLAGS = ""; + WARNING_CFLAGS = ( + "-Wmost", + "-Wno-four-char-constants", + "-Wno-unknown-pragmas", + ); + ZERO_LINK = NO; + }; + name = Deployment; + }; + 21D91E800B12A03D003981D9 /* Default */ = { + isa = XCBuildConfiguration; + buildSettings = { + FRAMEWORK_SEARCH_PATHS = ""; + GCC_ENABLE_TRIGRAPHS = NO; + GCC_GENERATE_DEBUGGING_SYMBOLS = NO; + GCC_PRECOMPILE_PREFIX_HEADER = NO; + GCC_WARN_ABOUT_MISSING_PROTOTYPES = NO; + GCC_WARN_FOUR_CHARACTER_CONSTANTS = NO; + GCC_WARN_UNKNOWN_PRAGMAS = NO; + HEADER_SEARCH_PATHS = ../mDNSShared; + INSTALL_PATH = "$(HOME)/bin"; + LIBRARY_SEARCH_PATHS = ""; + OTHER_CFLAGS = ""; + OTHER_LDFLAGS = ""; + OTHER_REZFLAGS = ""; + PRODUCT_NAME = "dns-sd"; + REZ_EXECUTABLE = YES; + SECTORDER_FLAGS = ""; + WARNING_CFLAGS = ( + "-Wmost", + "-Wno-four-char-constants", + "-Wno-unknown-pragmas", + ); + ZERO_LINK = NO; + }; + name = Default; + }; + 21D91E820B12A03D003981D9 /* Development */ = { + isa = XCBuildConfiguration; + buildSettings = { + COPY_PHASE_STRIP = NO; + DEBUGGING_SYMBOLS = YES; + GCC_DYNAMIC_NO_PIC = NO; + GCC_ENABLE_FIX_AND_CONTINUE = YES; + GCC_GENERATE_DEBUGGING_SYMBOLS = YES; + GCC_OPTIMIZATION_LEVEL = 0; + GCC_PRECOMPILE_PREFIX_HEADER = YES; + GCC_PREFIX_HEADER = "$(SYSTEM_LIBRARY_DIR)/Frameworks/AppKit.framework/Headers/AppKit.h"; + GCC_WARN_FOUR_CHARACTER_CONSTANTS = NO; + GCC_WARN_UNKNOWN_PRAGMAS = NO; + HEADER_SEARCH_PATHS = ../mDNSShared; + INFOPLIST_FILE = "DNSServiceBrowser-Info.plist"; + INSTALL_PATH = "$(USER_APPS_DIR)"; + OPTIMIZATION_CFLAGS = "-O0"; + OTHER_CFLAGS = ""; + OTHER_LDFLAGS = ( + "-framework", + Foundation, + "-framework", + AppKit, + ); + OTHER_REZFLAGS = ""; + PRODUCT_NAME = "DNS Service Browser"; + SECTORDER_FLAGS = ""; + WARNING_CFLAGS = "-Wmost"; + ZERO_LINK = NO; + }; + name = Development; + }; + 21D91E830B12A03D003981D9 /* Deployment */ = { + isa = XCBuildConfiguration; + buildSettings = { + COPY_PHASE_STRIP = YES; + GCC_ENABLE_FIX_AND_CONTINUE = NO; + GCC_PRECOMPILE_PREFIX_HEADER = YES; + GCC_PREFIX_HEADER = "$(SYSTEM_LIBRARY_DIR)/Frameworks/AppKit.framework/Headers/AppKit.h"; + GCC_WARN_FOUR_CHARACTER_CONSTANTS = NO; + GCC_WARN_UNKNOWN_PRAGMAS = NO; + HEADER_SEARCH_PATHS = ../mDNSShared; + INFOPLIST_FILE = "DNSServiceBrowser-Info.plist"; + INSTALL_PATH = "$(USER_APPS_DIR)"; + OTHER_CFLAGS = ""; + OTHER_LDFLAGS = ( + "-framework", + Foundation, + "-framework", + AppKit, + ); + OTHER_REZFLAGS = ""; + PRODUCT_NAME = "DNS Service Browser"; + SECTORDER_FLAGS = ""; + WARNING_CFLAGS = "-Wmost"; + ZERO_LINK = NO; + }; + name = Deployment; + }; + 21D91E840B12A03D003981D9 /* Default */ = { + isa = XCBuildConfiguration; + buildSettings = { + GCC_PRECOMPILE_PREFIX_HEADER = YES; + GCC_PREFIX_HEADER = "$(SYSTEM_LIBRARY_DIR)/Frameworks/AppKit.framework/Headers/AppKit.h"; + GCC_WARN_FOUR_CHARACTER_CONSTANTS = NO; + GCC_WARN_UNKNOWN_PRAGMAS = NO; + HEADER_SEARCH_PATHS = ../mDNSShared; + INFOPLIST_FILE = "DNSServiceBrowser-Info.plist"; + INSTALL_PATH = "$(USER_APPS_DIR)"; + OTHER_CFLAGS = ""; + OTHER_LDFLAGS = ( + "-framework", + Foundation, + "-framework", + AppKit, + ); + OTHER_REZFLAGS = ""; + PRODUCT_NAME = "DNS Service Browser"; + SECTORDER_FLAGS = ""; + WARNING_CFLAGS = "-Wmost"; + }; + name = Default; + }; + 21D91E860B12A03D003981D9 /* Development */ = { + isa = XCBuildConfiguration; + buildSettings = { + COPY_PHASE_STRIP = NO; + DEBUGGING_SYMBOLS = YES; + GCC_DYNAMIC_NO_PIC = NO; + GCC_ENABLE_FIX_AND_CONTINUE = YES; + GCC_GENERATE_DEBUGGING_SYMBOLS = YES; + GCC_OPTIMIZATION_LEVEL = 0; + GCC_PRECOMPILE_PREFIX_HEADER = YES; + GCC_PREFIX_HEADER = "$(SYSTEM_LIBRARY_DIR)/Frameworks/AppKit.framework/Headers/AppKit.h"; + GCC_WARN_FOUR_CHARACTER_CONSTANTS = NO; + GCC_WARN_UNKNOWN_PRAGMAS = NO; + HEADER_SEARCH_PATHS = ../mDNSShared; + INFOPLIST_FILE = "DNSServiceReg-Info.plist"; + INSTALL_PATH = "$(USER_APPS_DIR)"; + OPTIMIZATION_CFLAGS = "-O0"; + OTHER_CFLAGS = ""; + OTHER_LDFLAGS = ( + "-framework", + Foundation, + "-framework", + AppKit, + ); + OTHER_REZFLAGS = ""; + PRODUCT_NAME = "DNS Service Registration"; + SECTORDER_FLAGS = ""; + WARNING_CFLAGS = "-Wmost"; + ZERO_LINK = NO; + }; + name = Development; + }; + 21D91E870B12A03D003981D9 /* Deployment */ = { + isa = XCBuildConfiguration; + buildSettings = { + COPY_PHASE_STRIP = YES; + GCC_ENABLE_FIX_AND_CONTINUE = NO; + GCC_PRECOMPILE_PREFIX_HEADER = YES; + GCC_PREFIX_HEADER = "$(SYSTEM_LIBRARY_DIR)/Frameworks/AppKit.framework/Headers/AppKit.h"; + GCC_WARN_FOUR_CHARACTER_CONSTANTS = NO; + GCC_WARN_UNKNOWN_PRAGMAS = NO; + HEADER_SEARCH_PATHS = ../mDNSShared; + INFOPLIST_FILE = "DNSServiceReg-Info.plist"; + INSTALL_PATH = "$(USER_APPS_DIR)"; + OTHER_CFLAGS = ""; + OTHER_LDFLAGS = ( + "-framework", + Foundation, + "-framework", + AppKit, + ); + OTHER_REZFLAGS = ""; + PRODUCT_NAME = "DNS Service Registration"; + SECTORDER_FLAGS = ""; + WARNING_CFLAGS = "-Wmost"; + ZERO_LINK = NO; + }; + name = Deployment; + }; + 21D91E880B12A03D003981D9 /* Default */ = { + isa = XCBuildConfiguration; + buildSettings = { + GCC_PRECOMPILE_PREFIX_HEADER = YES; + GCC_PREFIX_HEADER = "$(SYSTEM_LIBRARY_DIR)/Frameworks/AppKit.framework/Headers/AppKit.h"; + GCC_WARN_FOUR_CHARACTER_CONSTANTS = NO; + GCC_WARN_UNKNOWN_PRAGMAS = NO; + HEADER_SEARCH_PATHS = ../mDNSShared; + INFOPLIST_FILE = "DNSServiceReg-Info.plist"; + INSTALL_PATH = "$(USER_APPS_DIR)"; + OTHER_CFLAGS = ""; + OTHER_LDFLAGS = ( + "-framework", + Foundation, + "-framework", + AppKit, + ); + OTHER_REZFLAGS = ""; + PRODUCT_NAME = "DNS Service Registration"; + SECTORDER_FLAGS = ""; + WARNING_CFLAGS = "-Wmost"; + }; + name = Default; + }; + 21D91E8A0B12A03D003981D9 /* Development */ = { + isa = XCBuildConfiguration; + buildSettings = { + COPY_PHASE_STRIP = NO; + DEBUGGING_SYMBOLS = YES; + GCC_DYNAMIC_NO_PIC = NO; + GCC_ENABLE_FIX_AND_CONTINUE = YES; + GCC_GENERATE_DEBUGGING_SYMBOLS = YES; + GCC_OPTIMIZATION_LEVEL = 0; + OPTIMIZATION_CFLAGS = "-O0"; + OTHER_CFLAGS = ""; + OTHER_LDFLAGS = ""; + OTHER_REZFLAGS = ""; + PRODUCT_NAME = "Build All"; + SECTORDER_FLAGS = ""; + WARNING_CFLAGS = ( + "-Wmost", + "-Wno-four-char-constants", + "-Wno-unknown-pragmas", + ); + ZERO_LINK = NO; + }; + name = Development; + }; + 21D91E8B0B12A03D003981D9 /* Deployment */ = { + isa = XCBuildConfiguration; + buildSettings = { + COPY_PHASE_STRIP = YES; + GCC_ENABLE_FIX_AND_CONTINUE = NO; + OTHER_CFLAGS = ""; + OTHER_LDFLAGS = ""; + OTHER_REZFLAGS = ""; + PRODUCT_NAME = "Build All"; + SECTORDER_FLAGS = ""; + WARNING_CFLAGS = ( + "-Wmost", + "-Wno-four-char-constants", + "-Wno-unknown-pragmas", + ); + ZERO_LINK = NO; + }; + name = Deployment; + }; + 21D91E8C0B12A03D003981D9 /* Default */ = { + isa = XCBuildConfiguration; + buildSettings = { + OTHER_CFLAGS = ""; + OTHER_LDFLAGS = ""; + OTHER_REZFLAGS = ""; + PRODUCT_NAME = "Build All"; + SECTORDER_FLAGS = ""; + WARNING_CFLAGS = ( + "-Wmost", + "-Wno-four-char-constants", + "-Wno-unknown-pragmas", + ); + }; + name = Default; + }; + 21D91E8E0B12A03D003981D9 /* Development */ = { + isa = XCBuildConfiguration; + buildSettings = { + PREBINDING = NO; + SDKROOT = /Developer/SDKs/MacOSX10.4u.sdk; + }; + name = Development; + }; + 21D91E8F0B12A03D003981D9 /* Deployment */ = { + isa = XCBuildConfiguration; + buildSettings = { + PREBINDING = NO; + SDKROOT = /Developer/SDKs/MacOSX10.4u.sdk; + }; + name = Deployment; + }; + 21D91E900B12A03D003981D9 /* Default */ = { + isa = XCBuildConfiguration; + buildSettings = { + PREBINDING = NO; + SDKROOT = /Developer/SDKs/MacOSX10.4u.sdk; + }; + name = Default; + }; +/* End XCBuildConfiguration section */ + +/* Begin XCConfigurationList section */ + 21D91E7D0B12A03D003981D9 /* Build configuration list for PBXNativeTarget "dns-sd" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 21D91E7E0B12A03D003981D9 /* Development */, + 21D91E7F0B12A03D003981D9 /* Deployment */, + 21D91E800B12A03D003981D9 /* Default */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Default; + }; + 21D91E810B12A03D003981D9 /* Build configuration list for PBXNativeTarget "DNS Service Browser" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 21D91E820B12A03D003981D9 /* Development */, + 21D91E830B12A03D003981D9 /* Deployment */, + 21D91E840B12A03D003981D9 /* Default */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Default; + }; + 21D91E850B12A03D003981D9 /* Build configuration list for PBXNativeTarget "DNS Service Registration" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 21D91E860B12A03D003981D9 /* Development */, + 21D91E870B12A03D003981D9 /* Deployment */, + 21D91E880B12A03D003981D9 /* Default */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Default; + }; + 21D91E890B12A03D003981D9 /* Build configuration list for PBXAggregateTarget "Build All" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 21D91E8A0B12A03D003981D9 /* Development */, + 21D91E8B0B12A03D003981D9 /* Deployment */, + 21D91E8C0B12A03D003981D9 /* Default */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Default; + }; + 21D91E8D0B12A03D003981D9 /* Build configuration list for PBXProject "DNS-SD" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 21D91E8E0B12A03D003981D9 /* Development */, + 21D91E8F0B12A03D003981D9 /* Deployment */, + 21D91E900B12A03D003981D9 /* Default */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Default; + }; +/* End XCConfigurationList section */ + }; + rootObject = 08FB7793FE84155DC02AAC07 /* Project object */; +} diff --git a/mDNSResponder/Clients/DNSServiceBrowser-Info.plist b/mDNSResponder/Clients/DNSServiceBrowser-Info.plist new file mode 100644 index 00000000..093d7b4d --- /dev/null +++ b/mDNSResponder/Clients/DNSServiceBrowser-Info.plist @@ -0,0 +1,30 @@ + + + + + CFBundleDevelopmentRegion + English + CFBundleExecutable + DNS Service Browser + CFBundleGetInfoString + + CFBundleIconFile + + CFBundleIdentifier + com.apple.DNSServiceBrowser + CFBundleInfoDictionaryVersion + 6.0 + CFBundlePackageType + APPL + CFBundleShortVersionString + + CFBundleSignature + ???? + CFBundleVersion + 1.0 + NSMainNibFile + DNSServiceBrowser + NSPrincipalClass + NSApplication + + diff --git a/mDNSResponder/Clients/DNSServiceBrowser.NET/App.ico b/mDNSResponder/Clients/DNSServiceBrowser.NET/App.ico new file mode 100755 index 00000000..3a5525fd Binary files /dev/null and b/mDNSResponder/Clients/DNSServiceBrowser.NET/App.ico differ diff --git a/mDNSResponder/Clients/DNSServiceBrowser.NET/AssemblyInfo.cs b/mDNSResponder/Clients/DNSServiceBrowser.NET/AssemblyInfo.cs new file mode 100755 index 00000000..da6a08c9 --- /dev/null +++ b/mDNSResponder/Clients/DNSServiceBrowser.NET/AssemblyInfo.cs @@ -0,0 +1,75 @@ +/* -*- Mode: C; tab-width: 4 -*- + * + * Copyright (c) 1997-2004 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 + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * 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. + */ + +using System.Reflection; +using System.Runtime.CompilerServices; + +// +// General Information about an assembly is controlled through the following +// set of attributes. Change these attribute values to modify the information +// associated with an assembly. +// +[assembly: AssemblyTitle("")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("")] +[assembly: AssemblyProduct("")] +[assembly: AssemblyCopyright("")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// +// Version information for an assembly consists of the following four values: +// +// Major Version +// Minor Version +// Build Number +// Revision +// +// You can specify all the values or you can default the Revision and Build Numbers +// by using the '*' as shown below: + +[assembly: AssemblyVersion("1.0.*")] + +// +// In order to sign your assembly you must specify a key to use. Refer to the +// Microsoft .NET Framework documentation for more information on assembly signing. +// +// Use the attributes below to control which key is used for signing. +// +// Notes: +// (*) If no key is specified, the assembly is not signed. +// (*) KeyName refers to a key that has been installed in the Crypto Service +// Provider (CSP) on your machine. KeyFile refers to a file which contains +// a key. +// (*) If the KeyFile and the KeyName values are both specified, the +// following processing occurs: +// (1) If the KeyName can be found in the CSP, that key is used. +// (2) If the KeyName does not exist and the KeyFile does exist, the key +// in the KeyFile is installed into the CSP and used. +// (*) In order to create a KeyFile, you can use the sn.exe (Strong Name) utility. +// When specifying the KeyFile, the location of the KeyFile should be +// relative to the project output directory which is +// %Project Directory%\obj\. For example, if your KeyFile is +// located in the project directory, you would specify the AssemblyKeyFile +// attribute as [assembly: AssemblyKeyFile("..\\..\\mykey.snk")] +// (*) Delay Signing is an advanced option - see the Microsoft .NET Framework +// documentation for more information on this. +// +[assembly: AssemblyDelaySign(false)] +[assembly: AssemblyKeyFile("")] +[assembly: AssemblyKeyName("")] diff --git a/mDNSResponder/Clients/DNSServiceBrowser.NET/DNSServiceBrowser.NET.csproj b/mDNSResponder/Clients/DNSServiceBrowser.NET/DNSServiceBrowser.NET.csproj new file mode 100755 index 00000000..c78e314a --- /dev/null +++ b/mDNSResponder/Clients/DNSServiceBrowser.NET/DNSServiceBrowser.NET.csproj @@ -0,0 +1,119 @@ + + + + Local + 8.0.50727 + 2.0 + {DE8DB97E-37A3-43ED-9A5E-CCC5F6DE9CB4} + Debug + AnyCPU + + + + + DNSServiceBrowser_NET + + + JScript + Grid + IE50 + false + WinExe + DNSServiceBrowser_NET + + + + + + + v2.0 + 2.0 + + + bin\Debug\ + false + 285212672 + false + + + DEBUG;TRACE + + + true + 4096 + false + false + false + false + 4 + full + prompt + + + bin\Release\ + false + 285212672 + false + + + TRACE + + + false + 4096 + true + false + false + false + 4 + none + prompt + + + + System + + + System.Data + + + System.Drawing + + + System.Windows.Forms + + + System.XML + + + + + + Code + + + Form + + + DNSServiceBrowser.cs + Designer + + + + + {18FBED6D-F2B7-4EC8-A4A4-46282E635308} + 1 + 0 + 0 + tlbimp + False + + + + + + + + + + \ No newline at end of file diff --git a/mDNSResponder/Clients/DNSServiceBrowser.NET/DNSServiceBrowser.cs b/mDNSResponder/Clients/DNSServiceBrowser.NET/DNSServiceBrowser.cs new file mode 100755 index 00000000..df880844 --- /dev/null +++ b/mDNSResponder/Clients/DNSServiceBrowser.NET/DNSServiceBrowser.cs @@ -0,0 +1,734 @@ +/* -*- Mode: C; tab-width: 4 -*- + * + * Copyright (c) 1997-2004 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 + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * 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. + */ + +using System; +using System.Drawing; +using System.Collections; +using System.ComponentModel; +using System.Windows.Forms; +using System.Data; +using System.Text; +using Bonjour; + +namespace DNSServiceBrowser_NET +{ + /// + /// Summary description for Form1. + /// + public class Form1 : System.Windows.Forms.Form + { + private System.Windows.Forms.ComboBox typeBox; + private System.Windows.Forms.ListBox browseList; + private Bonjour.DNSSDEventManager eventManager = null; + private Bonjour.DNSSDService service = null; + private Bonjour.DNSSDService browser = null; + private Bonjour.DNSSDService resolver = null; + /// + /// Required designer variable. + /// + private System.ComponentModel.Container components = null; + + private System.Windows.Forms.Label label1; + private System.Windows.Forms.Label label2; + private System.Windows.Forms.Label label3; + private System.Windows.Forms.Label label4; + private System.Windows.Forms.TextBox nameField; + private System.Windows.Forms.TextBox typeField; + private System.Windows.Forms.TextBox domainField; + private System.Windows.Forms.TextBox hostField; + private System.Windows.Forms.TextBox portField; + private System.Windows.Forms.Label label5; + private System.Windows.Forms.ListBox serviceTextField; + + public Form1() + { + // + // Required for Windows Form Designer support + // + InitializeComponent(); + + this.Load += new System.EventHandler(this.Form1_Load); + + // + // Create the DNSSDEventManager. You can then associate event handlers + // with the instance that will be invoked when the event occurs + // + // In this example, we're associating ServiceFound, ServiceLost, + // ServiceResolved, and OperationFailed event handlers with the + // event manager instance. + // + eventManager = new DNSSDEventManager(); + eventManager.ServiceFound += new _IDNSSDEvents_ServiceFoundEventHandler(this.ServiceFound); + eventManager.ServiceLost += new _IDNSSDEvents_ServiceLostEventHandler(this.ServiceLost); + eventManager.ServiceResolved += new _IDNSSDEvents_ServiceResolvedEventHandler(this.ServiceResolved); + eventManager.OperationFailed += new _IDNSSDEvents_OperationFailedEventHandler(this.OperationFailed); + + service = new DNSSDService(); + } + + private void Form1_Load(object sender, EventArgs e) + { + typeBox.SelectedItem = "_http._tcp"; + } + + + /// + /// Clean up any resources being used. + /// + protected override void Dispose( bool disposing ) + { + if( disposing ) + { + if (components != null) + { + components.Dispose(); + } + + // + // Clean up + // + if (resolver != null) + { + resolver.Stop(); + } + + if (browser != null) + { + browser.Stop(); + } + + if (service != null) + { + service.Stop(); + } + + eventManager.ServiceFound -= new _IDNSSDEvents_ServiceFoundEventHandler(this.ServiceFound); + eventManager.ServiceLost -= new _IDNSSDEvents_ServiceLostEventHandler(this.ServiceLost); + eventManager.ServiceResolved -= new _IDNSSDEvents_ServiceResolvedEventHandler(this.ServiceResolved); + eventManager.OperationFailed -= new _IDNSSDEvents_OperationFailedEventHandler(this.OperationFailed); + } + base.Dispose( disposing ); + } + + #region Windows Form Designer generated code + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + this.browseList = new System.Windows.Forms.ListBox(); + this.typeBox = new System.Windows.Forms.ComboBox(); + this.label1 = new System.Windows.Forms.Label(); + this.label2 = new System.Windows.Forms.Label(); + this.label3 = new System.Windows.Forms.Label(); + this.label4 = new System.Windows.Forms.Label(); + this.nameField = new System.Windows.Forms.TextBox(); + this.typeField = new System.Windows.Forms.TextBox(); + this.domainField = new System.Windows.Forms.TextBox(); + this.hostField = new System.Windows.Forms.TextBox(); + this.portField = new System.Windows.Forms.TextBox(); + this.label5 = new System.Windows.Forms.Label(); + this.serviceTextField = new System.Windows.Forms.ListBox(); + this.SuspendLayout(); + // + // browseList + // + this.browseList.Location = new System.Drawing.Point(8, 48); + this.browseList.Name = "browseList"; + this.browseList.Size = new System.Drawing.Size(488, 147); + this.browseList.TabIndex = 0; + this.browseList.SelectedIndexChanged += new System.EventHandler(this.listBox1_SelectedIndexChanged); + // + // typeBox + // + this.typeBox.Items.AddRange(new object[] + { + "_accessone._tcp", + "_accountedge._tcp", + "_actionitems._tcp", + "_addressbook._tcp", + "_aecoretech._tcp", + "_afpovertcp._tcp", + "_airport._tcp", + "_animolmd._tcp", + "_animobserver._tcp", + "_apple-sasl._tcp", + "_aquamon._tcp", + "_async._tcp", + "_auth._tcp", + "_beep._tcp", + "_bfagent._tcp", + "_bootps._udp", + "_bousg._tcp", + "_bsqdea._tcp", + "_cheat._tcp", + "_chess._tcp", + "_clipboard._tcp", + "_collection._tcp", + "_contactserver._tcp", + "_cvspserver._tcp", + "_cytv._tcp", + "_daap._tcp", + "_difi._tcp", + "_distcc._tcp", + "_dossier._tcp", + "_dpap._tcp", + "_earphoria._tcp", + "_ebms._tcp", + "_ebreg._tcp", + "_ecbyesfsgksc._tcp", + "_eheap._tcp", + "_embrace._tcp", + "_eppc._tcp", + "_eventserver._tcp", + "_exec._tcp", + "_facespan._tcp", + "_faxstfx._tcp", + "_fish._tcp", + "_fjork._tcp", + "_fmpro-internal._tcp", + "_ftp._tcp", + "_ftpcroco._tcp", + "_gbs-smp._tcp", + "_gbs-stp._tcp", + "_grillezvous._tcp", + "_h323._tcp", + "_http._tcp", + "_hotwayd._tcp", + "_hydra._tcp", + "_ica-networking._tcp", + "_ichalkboard._tcp", + "_ichat._tcp", + "_iconquer._tcp", + "_ifolder._tcp", + "_ilynx._tcp", + "_imap._tcp", + "_imidi._tcp", + "_ipbroadcaster._tcp", + "_ipp._tcp", + "_isparx._tcp", + "_ispq-vc._tcp", + "_ishare._tcp", + "_isticky._tcp", + "_istorm._tcp", + "_iwork._tcp", + "_lan2p._tcp", + "_ldap._tcp", + "_liaison._tcp", + "_login._tcp", + "_lontalk._tcp", + "_lonworks._tcp", + "_macfoh-remote._tcp", + "_macminder._tcp", + "_moneyworks._tcp", + "_mp3sushi._tcp", + "_mttp._tcp", + "_ncbroadcast._tcp", + "_ncdirect._tcp", + "_ncsyncserver._tcp", + "_net-assistant._tcp", + "_newton-dock._tcp", + "_nfs._udp", + "_nssocketport._tcp", + "_odabsharing._tcp", + "_omni-bookmark._tcp", + "_openbase._tcp", + "_p2pchat._udp", + "_pdl-datastream._tcp", + "_poch._tcp", + "_pop3._tcp", + "_postgresql._tcp", + "_presence._tcp", + "_printer._tcp", + "_ptp._tcp", + "_quinn._tcp", + "_raop._tcp", + "_rce._tcp", + "_realplayfavs._tcp", + "_riousbprint._tcp", + "_rfb._tcp", + "_rtsp._tcp", + "_safarimenu._tcp", + "_sallingclicker._tcp", + "_scone._tcp", + "_sdsharing._tcp", + "_see._tcp", + "_seeCard._tcp", + "_serendipd._tcp", + "_servermgr._tcp", + "_shell._tcp", + "_shout._tcp", + "_shoutcast._tcp", + "_soap._tcp", + "_spike._tcp", + "_spincrisis._tcp", + "_spl-itunes._tcp", + "_spr-itunes._tcp", + "_ssh._tcp", + "_ssscreenshare._tcp", + "_strateges._tcp", + "_sge-exec._tcp", + "_sge-qmaster._tcp", + "_stickynotes._tcp", + "_sxqdea._tcp", + "_sybase-tds._tcp", + "_teamlist._tcp", + "_teleport._udp", + "_telnet._tcp", + "_tftp._udp", + "_ticonnectmgr._tcp", + "_tinavigator._tcp", + "_tryst._tcp", + "_upnp._tcp", + "_utest._tcp", + "_vue4rendercow._tcp", + "_webdav._tcp", + "_whamb._tcp", + "_wired._tcp", + "_workstation._tcp", + "_wormhole._tcp", + "_workgroup._tcp", + "_ws._tcp", + "_xserveraid._tcp", + "_xsync._tcp", + "_xtshapro._tcp" + }); + + this.typeBox.Location = new System.Drawing.Point(8, 16); + this.typeBox.Name = "typeBox"; + this.typeBox.Size = new System.Drawing.Size(192, 21); + this.typeBox.Sorted = true; + this.typeBox.TabIndex = 3; + this.typeBox.SelectedIndexChanged += new System.EventHandler(this.typeBox_SelectedIndexChanged); + // + // label1 + // + this.label1.Location = new System.Drawing.Point(8, 208); + this.label1.Name = "label1"; + this.label1.Size = new System.Drawing.Size(48, 16); + this.label1.TabIndex = 4; + this.label1.Text = "Name:"; + this.label1.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; + // + // label2 + // + this.label2.Location = new System.Drawing.Point(8, 240); + this.label2.Name = "label2"; + this.label2.Size = new System.Drawing.Size(48, 16); + this.label2.TabIndex = 5; + this.label2.Text = "Type:"; + this.label2.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; + // + // label3 + // + this.label3.Location = new System.Drawing.Point(8, 272); + this.label3.Name = "label3"; + this.label3.Size = new System.Drawing.Size(48, 16); + this.label3.TabIndex = 6; + this.label3.Text = "Domain:"; + this.label3.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; + // + // label4 + // + this.label4.Location = new System.Drawing.Point(8, 304); + this.label4.Name = "label4"; + this.label4.Size = new System.Drawing.Size(48, 16); + this.label4.TabIndex = 7; + this.label4.Text = "Host:"; + this.label4.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; + // + // nameField + // + this.nameField.Location = new System.Drawing.Point(56, 208); + this.nameField.Name = "nameField"; + this.nameField.ReadOnly = true; + this.nameField.Size = new System.Drawing.Size(168, 20); + this.nameField.TabIndex = 8; + this.nameField.Text = ""; + // + // typeField + // + this.typeField.Location = new System.Drawing.Point(56, 240); + this.typeField.Name = "typeField"; + this.typeField.ReadOnly = true; + this.typeField.Size = new System.Drawing.Size(168, 20); + this.typeField.TabIndex = 9; + this.typeField.Text = ""; + // + // domainField + // + this.domainField.Location = new System.Drawing.Point(56, 272); + this.domainField.Name = "domainField"; + this.domainField.ReadOnly = true; + this.domainField.Size = new System.Drawing.Size(168, 20); + this.domainField.TabIndex = 10; + this.domainField.Text = ""; + // + // hostField + // + this.hostField.Location = new System.Drawing.Point(56, 304); + this.hostField.Name = "hostField"; + this.hostField.ReadOnly = true; + this.hostField.Size = new System.Drawing.Size(168, 20); + this.hostField.TabIndex = 11; + this.hostField.Text = ""; + + // + // portField + // + this.portField.Location = new System.Drawing.Point(56, 336); + this.portField.Name = "portField"; + this.portField.ReadOnly = true; + this.portField.Size = new System.Drawing.Size(168, 20); + this.portField.TabIndex = 12; + this.portField.Text = ""; + // + // label5 + // + this.label5.Location = new System.Drawing.Point(8, 336); + this.label5.Name = "label5"; + this.label5.Size = new System.Drawing.Size(48, 16); + this.label5.TabIndex = 14; + this.label5.Text = "Port:"; + this.label5.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; + // + // serviceTextField + // + this.serviceTextField.HorizontalScrollbar = true; + this.serviceTextField.Location = new System.Drawing.Point(264, 208); + this.serviceTextField.Name = "serviceTextField"; + this.serviceTextField.Size = new System.Drawing.Size(232, 147); + this.serviceTextField.TabIndex = 16; + // + // Form1 + // + this.AutoScaleBaseSize = new System.Drawing.Size(5, 13); + this.ClientSize = new System.Drawing.Size(512, 365); + this.Controls.AddRange(new System.Windows.Forms.Control[] { + this.serviceTextField, + this.label5, + this.portField, + this.hostField, + this.domainField, + this.typeField, + this.nameField, + this.label4, + this.label3, + this.label2, + this.label1, + this.typeBox, + this.browseList}); + this.Name = "Form1"; + this.Text = "DNSServices Browser"; + this.ResumeLayout(false); + + } + #endregion + + /// + /// The main entry point for the application. + /// + [STAThread] + static void Main() + { + Application.Run(new Form1()); + } + // + // BrowseData + // + // This class is used to store data associated + // with a DNSService.Browse() operation + // + public class BrowseData + { + public uint InterfaceIndex; + public String Name; + public String Type; + public String Domain; + public int Refs; + + public override String + ToString() + { + return Name; + } + + public override bool + Equals(object other) + { + bool result = false; + + if (other != null) + { + result = (this.Name == other.ToString()); + } + + return result; + } + + public override int + GetHashCode() + { + return Name.GetHashCode(); + } + }; + + + // + // ResolveData + // + // This class is used to store data associated + // with a DNSService.Resolve() operation + // + public class ResolveData + { + public uint InterfaceIndex; + public String FullName; + public String HostName; + public int Port; + public TXTRecord TxtRecord; + + public override String + ToString() + { + return FullName; + } + }; + + // + // Populate() + // + // Populate this form with data associated with a + // DNSService.Resolve() call + // + public void + Populate(BrowseData browseData, ResolveData resolveData) + { + nameField.Text = browseData.Name; + typeField.Text = browseData.Type; + domainField.Text = browseData.Domain; + hostField.Text = resolveData.HostName; + portField.Text = resolveData.Port.ToString(); + + serviceTextField.Items.Clear(); + + // + // When we print the text record, we're going to assume that every value + // is a string. + // + if (resolveData.TxtRecord != null) + { + for (uint idx = 0; idx < resolveData.TxtRecord.GetCount(); idx++) + { + String key; + Byte[] bytes; + + key = resolveData.TxtRecord.GetKeyAtIndex(idx); + bytes = (Byte[])resolveData.TxtRecord.GetValueAtIndex(idx); + + if (key.Length > 0) + { + String val = ""; + + if (bytes != null) + { + val = Encoding.ASCII.GetString(bytes, 0, bytes.Length); + } + + serviceTextField.Items.Add(key + "=" + val); + } + } + } + } + + // + // called when the type field changes + // + private void typeBox_SelectedIndexChanged(object sender, System.EventArgs e) + { + browseList.Items.Clear(); + + // + // Stop the current browse operation + // + if (browser != null) + { + browser.Stop(); + } + + nameField.Text = ""; + typeField.Text = ""; + domainField.Text = ""; + hostField.Text = ""; + portField.Text = ""; + serviceTextField.Items.Clear(); + + try + { + // + // Selecting a service type will start a new browse operation. + // + browser = service.Browse( 0, 0, typeBox.SelectedItem.ToString(), null, eventManager ); + } + catch + { + MessageBox.Show("Browse Failed", "Error"); + Application.Exit(); + } + } + + private void listBox1_SelectedIndexChanged(object sender, System.EventArgs e) + { + if (resolver != null) + { + resolver.Stop(); + resolver = null; + } + + if (browseList.SelectedItem != null) + { + try + { + BrowseData data = (BrowseData) browseList.SelectedItem; + + // + // Clicking on a service instance results in starting a resolve operation + // that will call us back with information about the service + // + resolver = service.Resolve(0, data.InterfaceIndex, data.Name, data.Type, data.Domain, eventManager); + } + catch + { + MessageBox.Show("Resolve Failed", "Error"); + Application.Exit(); + } + } + } + + // + // ServiceFound + // + // This call is invoked by the DNSService core. We create + // a BrowseData object and invoked the appropriate method + // in the GUI thread so we can update the UI + // + public void ServiceFound + ( + DNSSDService sref, + DNSSDFlags flags, + uint ifIndex, + String serviceName, + String regType, + String domain + ) + { + int index = browseList.Items.IndexOf(serviceName); + + // + // Check to see if we've seen this service before. If the machine has multiple + // interfaces, we could potentially get called back multiple times for the + // same service. Implementing a simple reference counting scheme will address + // the problem of the same service showing up more than once in the browse list. + // + if (index == -1) + { + BrowseData data = new BrowseData(); + + data.InterfaceIndex = ifIndex; + data.Name = serviceName; + data.Type = regType; + data.Domain = domain; + data.Refs = 1; + + browseList.Items.Add(data); + browseList.Invalidate(); + } + else + { + BrowseData data = (BrowseData) browseList.Items[index]; + data.Refs++; + } + } + + public void ServiceLost + ( + DNSSDService sref, + DNSSDFlags flags, + uint ifIndex, + String serviceName, + String regType, + String domain + ) + { + int index = browseList.Items.IndexOf(serviceName); + + // + // See above comment in ServiceFound about reference counting + // + if (index != -1) + { + BrowseData data = (BrowseData) browseList.Items[index]; + + data.Refs--; + + if (data.Refs == 0) + { + browseList.Items.Remove(data); + browseList.Invalidate(); + } + } + } + + public void ServiceResolved + ( + DNSSDService sref, + DNSSDFlags flags, + uint ifIndex, + String fullName, + String hostName, + ushort port, + TXTRecord txtRecord + ) + { + ResolveData data = new ResolveData(); + + data.InterfaceIndex = ifIndex; + data.FullName = fullName; + data.HostName = hostName; + data.Port = port; + data.TxtRecord = txtRecord; + + // + // Don't forget to stop the resolver. This eases the burden on the network + // + resolver.Stop(); + resolver = null; + + Populate((BrowseData) browseList.SelectedItem, data); + } + + public void OperationFailed + ( + DNSSDService sref, + DNSSDError error + ) + { + MessageBox.Show("Operation failed: error code: " + error, "Error"); + } + } +} diff --git a/mDNSResponder/Clients/DNSServiceBrowser.NET/DNSServiceBrowser.resx b/mDNSResponder/Clients/DNSServiceBrowser.NET/DNSServiceBrowser.resx new file mode 100755 index 00000000..e5b5a111 --- /dev/null +++ b/mDNSResponder/Clients/DNSServiceBrowser.NET/DNSServiceBrowser.resx @@ -0,0 +1,102 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 1.3 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=1.0.3300.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=1.0.3300.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + Form1 + + \ No newline at end of file diff --git a/mDNSResponder/Clients/DNSServiceBrowser.VB/DNSServiceBrowser.Designer.vb b/mDNSResponder/Clients/DNSServiceBrowser.VB/DNSServiceBrowser.Designer.vb new file mode 100644 index 00000000..0c6280b0 --- /dev/null +++ b/mDNSResponder/Clients/DNSServiceBrowser.VB/DNSServiceBrowser.Designer.vb @@ -0,0 +1,206 @@ + _ +Partial Class DNSServiceBrowser + Inherits System.Windows.Forms.Form + + 'Form overrides dispose to clean up the component list. + _ + Protected Overrides Sub Dispose(ByVal disposing As Boolean) + Try + If disposing AndAlso components IsNot Nothing Then + components.Dispose() + End If + Finally + MyBase.Dispose(disposing) + End Try + End Sub + + 'Required by the Windows Form Designer + Private components As System.ComponentModel.IContainer + + 'NOTE: The following procedure is required by the Windows Form Designer + 'It can be modified using the Windows Form Designer. + 'Do not modify it using the code editor. + _ + Private Sub InitializeComponent() + Me.ComboBox1 = New System.Windows.Forms.ComboBox + Me.ServiceNames = New System.Windows.Forms.ListBox + Me.Label1 = New System.Windows.Forms.Label + Me.Label2 = New System.Windows.Forms.Label + Me.Label3 = New System.Windows.Forms.Label + Me.Label4 = New System.Windows.Forms.Label + Me.Label5 = New System.Windows.Forms.Label + Me.NameField = New System.Windows.Forms.TextBox + Me.PortField = New System.Windows.Forms.TextBox + Me.HostField = New System.Windows.Forms.TextBox + Me.DomainField = New System.Windows.Forms.TextBox + Me.TypeField = New System.Windows.Forms.TextBox + Me.TextRecord = New System.Windows.Forms.ListBox + Me.SuspendLayout() + ' + 'ComboBox1 + ' + Me.ComboBox1.FormattingEnabled = True + Me.ComboBox1.Items.AddRange(New Object() {"_accessone._tcp", "_accountedge._tcp", "_actionitems._tcp", "_addressbook._tcp", "_aecoretech._tcp", "_afpovertcp._tcp", "_airport._tcp", "_animobserver._tcp", "_animolmd._tcp", "_apple-sasl._tcp", "_aquamon._tcp", "_async._tcp", "_auth._tcp", "_beep._tcp", "_bfagent._tcp", "_bootps._udp", "_bousg._tcp", "_bsqdea._tcp", "_cheat._tcp", "_chess._tcp", "_clipboard._tcp", "_collection._tcp", "_contactserver._tcp", "_cvspserver._tcp", "_cytv._tcp", "_daap._tcp", "_difi._tcp", "_distcc._tcp", "_dossier._tcp", "_dpap._tcp", "_earphoria._tcp", "_ebms._tcp", "_ebreg._tcp", "_ecbyesfsgksc._tcp", "_eheap._tcp", "_embrace._tcp", "_eppc._tcp", "_eventserver._tcp", "_exec._tcp", "_facespan._tcp", "_faxstfx._tcp", "_fish._tcp", "_fjork._tcp", "_fmpro-internal._tcp", "_ftp._tcp", "_ftpcroco._tcp", "_gbs-smp._tcp", "_gbs-stp._tcp", "_grillezvous._tcp", "_h323._tcp", "_hotwayd._tcp", "_http._tcp", "_hydra._tcp", "_ica-networking._tcp", "_ichalkboard._tcp", "_ichat._tcp", "_iconquer._tcp", "_ifolder._tcp", "_ilynx._tcp", "_imap._tcp", "_imidi._tcp", "_ipbroadcaster._tcp", "_ipp._tcp", "_ishare._tcp", "_isparx._tcp", "_ispq-vc._tcp", "_isticky._tcp", "_istorm._tcp", "_iwork._tcp", "_lan2p._tcp", "_ldap._tcp", "_liaison._tcp", "_login._tcp", "_lontalk._tcp", "_lonworks._tcp", "_macfoh-remote._tcp", "_macminder._tcp", "_moneyworks._tcp", "_mp3sushi._tcp", "_mttp._tcp", "_ncbroadcast._tcp", "_ncdirect._tcp", "_ncsyncserver._tcp", "_net-assistant._tcp", "_newton-dock._tcp", "_nfs._udp", "_nssocketport._tcp", "_odabsharing._tcp", "_omni-bookmark._tcp", "_openbase._tcp", "_p2pchat._udp", "_pdl-datastream._tcp", "_poch._tcp", "_pop3._tcp", "_postgresql._tcp", "_presence._tcp", "_printer._tcp", "_ptp._tcp", "_quinn._tcp", "_raop._tcp", "_rce._tcp", "_realplayfavs._tcp", "_rfb._tcp", "_riousbprint._tcp", "_rtsp._tcp", "_safarimenu._tcp", "_sallingclicker._tcp", "_scone._tcp", "_sdsharing._tcp", "_see._tcp", "_seeCard._tcp", "_serendipd._tcp", "_servermgr._tcp", "_sge-exec._tcp", "_sge-qmaster._tcp", "_shell._tcp", "_shout._tcp", "_shoutcast._tcp", "_soap._tcp", "_spike._tcp", "_spincrisis._tcp", "_spl-itunes._tcp", "_spr-itunes._tcp", "_ssh._tcp", "_ssscreenshare._tcp", "_stickynotes._tcp", "_strateges._tcp", "_sxqdea._tcp", "_sybase-tds._tcp", "_teamlist._tcp", "_teleport._udp", "_telnet._tcp", "_tftp._udp", "_ticonnectmgr._tcp", "_tinavigator._tcp", "_tryst._tcp", "_upnp._tcp", "_utest._tcp", "_vue4rendercow._tcp", "_webdav._tcp", "_whamb._tcp", "_wired._tcp", "_workgroup._tcp", "_workstation._tcp", "_wormhole._tcp", "_ws._tcp", "_xserveraid._tcp", "_xsync._tcp", "_xtshapro._tcp"}) + Me.ComboBox1.Location = New System.Drawing.Point(13, 13) + Me.ComboBox1.Name = "ComboBox1" + Me.ComboBox1.Size = New System.Drawing.Size(252, 21) + Me.ComboBox1.Sorted = True + Me.ComboBox1.TabIndex = 0 + ' + 'ServiceNames + ' + Me.ServiceNames.Anchor = CType((((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Bottom) _ + Or System.Windows.Forms.AnchorStyles.Left) _ + Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles) + Me.ServiceNames.FormattingEnabled = True + Me.ServiceNames.Location = New System.Drawing.Point(13, 41) + Me.ServiceNames.Name = "ServiceNames" + Me.ServiceNames.Size = New System.Drawing.Size(662, 251) + Me.ServiceNames.Sorted = True + Me.ServiceNames.TabIndex = 1 + ' + 'Label1 + ' + Me.Label1.Anchor = CType((System.Windows.Forms.AnchorStyles.Bottom Or System.Windows.Forms.AnchorStyles.Left), System.Windows.Forms.AnchorStyles) + Me.Label1.AutoSize = True + Me.Label1.Location = New System.Drawing.Point(16, 311) + Me.Label1.Name = "Label1" + Me.Label1.Size = New System.Drawing.Size(38, 13) + Me.Label1.TabIndex = 2 + Me.Label1.Text = "Name:" + ' + 'Label2 + ' + Me.Label2.Anchor = CType((System.Windows.Forms.AnchorStyles.Bottom Or System.Windows.Forms.AnchorStyles.Left), System.Windows.Forms.AnchorStyles) + Me.Label2.AutoSize = True + Me.Label2.Location = New System.Drawing.Point(16, 439) + Me.Label2.Name = "Label2" + Me.Label2.Size = New System.Drawing.Size(29, 13) + Me.Label2.TabIndex = 3 + Me.Label2.Text = "Port:" + ' + 'Label3 + ' + Me.Label3.Anchor = CType((System.Windows.Forms.AnchorStyles.Bottom Or System.Windows.Forms.AnchorStyles.Left), System.Windows.Forms.AnchorStyles) + Me.Label3.AutoSize = True + Me.Label3.Location = New System.Drawing.Point(16, 407) + Me.Label3.Name = "Label3" + Me.Label3.Size = New System.Drawing.Size(32, 13) + Me.Label3.TabIndex = 4 + Me.Label3.Text = "Host:" + ' + 'Label4 + ' + Me.Label4.Anchor = CType((System.Windows.Forms.AnchorStyles.Bottom Or System.Windows.Forms.AnchorStyles.Left), System.Windows.Forms.AnchorStyles) + Me.Label4.AutoSize = True + Me.Label4.Location = New System.Drawing.Point(16, 374) + Me.Label4.Name = "Label4" + Me.Label4.Size = New System.Drawing.Size(46, 13) + Me.Label4.TabIndex = 5 + Me.Label4.Text = "Domain:" + ' + 'Label5 + ' + Me.Label5.Anchor = CType((System.Windows.Forms.AnchorStyles.Bottom Or System.Windows.Forms.AnchorStyles.Left), System.Windows.Forms.AnchorStyles) + Me.Label5.AutoSize = True + Me.Label5.Location = New System.Drawing.Point(16, 342) + Me.Label5.Name = "Label5" + Me.Label5.Size = New System.Drawing.Size(34, 13) + Me.Label5.TabIndex = 6 + Me.Label5.Text = "Type:" + ' + 'NameField + ' + Me.NameField.Anchor = CType((System.Windows.Forms.AnchorStyles.Bottom Or System.Windows.Forms.AnchorStyles.Left), System.Windows.Forms.AnchorStyles) + Me.NameField.Location = New System.Drawing.Point(69, 309) + Me.NameField.Name = "NameField" + Me.NameField.ReadOnly = True + Me.NameField.Size = New System.Drawing.Size(195, 20) + Me.NameField.TabIndex = 7 + ' + 'PortField + ' + Me.PortField.Anchor = CType((System.Windows.Forms.AnchorStyles.Bottom Or System.Windows.Forms.AnchorStyles.Left), System.Windows.Forms.AnchorStyles) + Me.PortField.Location = New System.Drawing.Point(69, 436) + Me.PortField.Name = "PortField" + Me.PortField.ReadOnly = True + Me.PortField.Size = New System.Drawing.Size(195, 20) + Me.PortField.TabIndex = 8 + ' + 'HostField + ' + Me.HostField.Anchor = CType((System.Windows.Forms.AnchorStyles.Bottom Or System.Windows.Forms.AnchorStyles.Left), System.Windows.Forms.AnchorStyles) + Me.HostField.Location = New System.Drawing.Point(69, 403) + Me.HostField.Name = "HostField" + Me.HostField.ReadOnly = True + Me.HostField.Size = New System.Drawing.Size(195, 20) + Me.HostField.TabIndex = 9 + ' + 'DomainField + ' + Me.DomainField.Anchor = CType((System.Windows.Forms.AnchorStyles.Bottom Or System.Windows.Forms.AnchorStyles.Left), System.Windows.Forms.AnchorStyles) + Me.DomainField.Location = New System.Drawing.Point(69, 371) + Me.DomainField.Name = "DomainField" + Me.DomainField.ReadOnly = True + Me.DomainField.Size = New System.Drawing.Size(195, 20) + Me.DomainField.TabIndex = 10 + ' + 'TypeField + ' + Me.TypeField.Anchor = CType((System.Windows.Forms.AnchorStyles.Bottom Or System.Windows.Forms.AnchorStyles.Left), System.Windows.Forms.AnchorStyles) + Me.TypeField.Location = New System.Drawing.Point(69, 340) + Me.TypeField.Name = "TypeField" + Me.TypeField.ReadOnly = True + Me.TypeField.Size = New System.Drawing.Size(195, 20) + Me.TypeField.TabIndex = 11 + ' + 'TextRecord + ' + Me.TextRecord.Anchor = CType(((System.Windows.Forms.AnchorStyles.Bottom Or System.Windows.Forms.AnchorStyles.Left) _ + Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles) + Me.TextRecord.FormattingEnabled = True + Me.TextRecord.Location = New System.Drawing.Point(278, 309) + Me.TextRecord.Name = "TextRecord" + Me.TextRecord.SelectionMode = System.Windows.Forms.SelectionMode.None + Me.TextRecord.Size = New System.Drawing.Size(397, 147) + Me.TextRecord.TabIndex = 12 + ' + 'Form1 + ' + Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!) + Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font + Me.ClientSize = New System.Drawing.Size(690, 480) + Me.Controls.Add(Me.TextRecord) + Me.Controls.Add(Me.TypeField) + Me.Controls.Add(Me.DomainField) + Me.Controls.Add(Me.HostField) + Me.Controls.Add(Me.PortField) + Me.Controls.Add(Me.NameField) + Me.Controls.Add(Me.Label5) + Me.Controls.Add(Me.Label4) + Me.Controls.Add(Me.Label3) + Me.Controls.Add(Me.Label2) + Me.Controls.Add(Me.Label1) + Me.Controls.Add(Me.ServiceNames) + Me.Controls.Add(Me.ComboBox1) + Me.Name = "Form1" + Me.Text = "Bonjour Browser" + Me.ResumeLayout(False) + Me.PerformLayout() + + End Sub + Friend WithEvents ComboBox1 As System.Windows.Forms.ComboBox + Friend WithEvents ServiceNames As System.Windows.Forms.ListBox + Friend WithEvents Label1 As System.Windows.Forms.Label + Friend WithEvents Label2 As System.Windows.Forms.Label + Friend WithEvents Label3 As System.Windows.Forms.Label + Friend WithEvents Label4 As System.Windows.Forms.Label + Friend WithEvents Label5 As System.Windows.Forms.Label + Friend WithEvents NameField As System.Windows.Forms.TextBox + Friend WithEvents PortField As System.Windows.Forms.TextBox + Friend WithEvents HostField As System.Windows.Forms.TextBox + Friend WithEvents DomainField As System.Windows.Forms.TextBox + Friend WithEvents TypeField As System.Windows.Forms.TextBox + Friend WithEvents TextRecord As System.Windows.Forms.ListBox + +End Class diff --git a/mDNSResponder/Clients/DNSServiceBrowser.VB/DNSServiceBrowser.VB.vbproj b/mDNSResponder/Clients/DNSServiceBrowser.VB/DNSServiceBrowser.VB.vbproj new file mode 100644 index 00000000..52beedd4 --- /dev/null +++ b/mDNSResponder/Clients/DNSServiceBrowser.VB/DNSServiceBrowser.VB.vbproj @@ -0,0 +1,121 @@ + + + + Debug + AnyCPU + 8.0.50727 + 2.0 + {FB79E297-5703-435C-A829-51AA51CD71C2} + WinExe + DNSServiceBrowser.VB.My.MyApplication + DNSServiceBrowser.VB + DNSServiceBrowser.VB + WindowsForms + v2.0 + + + 2.0 + + + + true + full + true + true + bin\Debug\ + DNSServiceBrowser.VB.xml + 42016,41999,42017,42018,42019,42032,42036,42020,42021,42022,42353,42354,42355 + + + pdbonly + false + true + true + bin\Release\ + DNSServiceBrowser.VB.xml + 42016,41999,42017,42018,42019,42032,42036,42020,42021,42022,42353,42354,42355 + + + + + + + + + + + + + + + + + + + + + + Form + + + DNSServiceBrowser.vb + Form + + + + True + Application.myapp + + + True + True + Resources.resx + + + True + Settings.settings + True + + + + + Designer + DNSServiceBrowser.vb + + + VbMyResourcesResXFileCodeGenerator + Resources.Designer.vb + My.Resources + Designer + + + + + MyApplicationCodeGenerator + Application.Designer.vb + + + SettingsSingleFileGenerator + My + Settings.Designer.vb + + + + + {18FBED6D-F2B7-4EC8-A4A4-46282E635308} + 1 + 0 + 0 + tlbimp + False + + + + + \ No newline at end of file diff --git a/mDNSResponder/Clients/DNSServiceBrowser.VB/DNSServiceBrowser.resx b/mDNSResponder/Clients/DNSServiceBrowser.VB/DNSServiceBrowser.resx new file mode 100644 index 00000000..ff31a6db --- /dev/null +++ b/mDNSResponder/Clients/DNSServiceBrowser.VB/DNSServiceBrowser.resx @@ -0,0 +1,120 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/mDNSResponder/Clients/DNSServiceBrowser.VB/DNSServiceBrowser.vb b/mDNSResponder/Clients/DNSServiceBrowser.VB/DNSServiceBrowser.vb new file mode 100644 index 00000000..bb67adab --- /dev/null +++ b/mDNSResponder/Clients/DNSServiceBrowser.VB/DNSServiceBrowser.vb @@ -0,0 +1,196 @@ +' +' Copyright (c) 2010 Apple 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 +' +' http://www.apache.org/licenses/LICENSE-2.0 +' +' 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. +' + +Public Class DNSServiceBrowser + Public WithEvents MyEventManager As New Bonjour.DNSSDEventManager + + Private m_service As New Bonjour.DNSSDService + Private m_browser As Bonjour.DNSSDService + Private m_resolver As Bonjour.DNSSDService + + Public Sub New() + MyBase.New() + + 'This call is required by the Windows Form Designer. + InitializeComponent() + + ComboBox1.SelectedIndex = 0 + End Sub + + 'Called when a service is found as a result of a browse operation + Public Sub MyEventManager_ServiceFound(ByVal browser As Bonjour.DNSSDService, ByVal flags As Bonjour.DNSSDFlags, ByVal ifIndex As UInteger, ByVal serviceName As String, ByVal regtype As String, ByVal domain As String) Handles MyEventManager.ServiceFound + Dim index As Integer + index = ServiceNames.Items.IndexOf(serviceName) + ' + ' A simple reference counting scheme is implemented so that the same service + ' does not show up more than once in the browse list. This can happen + ' if the machine has more than one network interface. + ' + ' If we have not seen this service before, then it is added to the browse list + ' Otherwise it's reference count is bumped up. + ' + If index = -1 Then + Dim browseData As New BrowseData + browseData.ServiceName = serviceName + browseData.RegType = regtype + browseData.Domain = domain + browseData.Refs = 1 + ServiceNames.Items.Add(browseData) + Else + Dim browseData As BrowseData + browseData = ServiceNames.Items([index]) + browseData.Refs += 1 + End If + End Sub + + Public Sub MyEventManager_ServiceLost(ByVal browser As Bonjour.DNSSDService, ByVal flags As Bonjour.DNSSDFlags, ByVal ifIndex As UInteger, ByVal serviceName As String, ByVal regtype As String, ByVal domain As String) Handles MyEventManager.ServiceLost + Dim index As Integer + ' + ' See the above about reference counting + ' + index = ServiceNames.Items.IndexOf(serviceName) + If index <> -1 Then + Dim browseData As BrowseData + browseData = ServiceNames.Items([index]) + browseData.Refs -= 1 + If browseData.Refs = 0 Then + ServiceNames.Items.Remove(serviceName) + End If + End If + End Sub + + Public Sub MyEventManager_ServiceResolved(ByVal resolver As Bonjour.DNSSDService, ByVal flags As Bonjour.DNSSDFlags, ByVal ifIndex As UInteger, ByVal fullname As String, ByVal hostname As String, ByVal port As UShort, ByVal record As Bonjour.TXTRecord) Handles MyEventManager.ServiceResolved + ' + ' Once the service is resolved, the resolve operation is stopped. This reduces the burdne on the network + ' + m_resolver.Stop() + m_resolver = Nothing + Dim browseData As BrowseData = ServiceNames.Items.Item(ServiceNames.SelectedIndex) + NameField.Text = browseData.ServiceName + TypeField.Text = browseData.RegType + DomainField.Text = browseData.Domain + HostField.Text = hostname + PortField.Text = port + + ' + ' The values found in the text record are assumed to be human readable strings. + ' + If record IsNot Nothing Then + For i As UInteger = 0 To record.GetCount() - 1 + Dim key As String = record.GetKeyAtIndex(i) + If key.Length() > 0 Then + TextRecord.Items.Add(key + "=" + System.Text.Encoding.ASCII.GetString(record.GetValueAtIndex(i))) + End If + Next i + End If + End Sub + + Private Sub ClearServiceInfo() + TextRecord.Items.Clear() + NameField.Text = "" + TypeField.Text = "" + DomainField.Text = "" + HostField.Text = "" + PortField.Text = "" + End Sub + + Private Sub ServiceNames_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ServiceNames.SelectedIndexChanged + If m_resolver IsNot Nothing Then + m_resolver.Stop() + End If + Me.ClearServiceInfo() + Dim browseData As BrowseData = ServiceNames.Items.Item(ServiceNames.SelectedIndex) + + ' + ' Selecting a service instance starts a new resolve operation + ' + m_resolver = m_service.Resolve(0, 0, browseData.ServiceName, browseData.RegType, browseData.Domain, MyEventManager) + End Sub + + Private Sub ComboBox1_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ComboBox1.SelectedIndexChanged + If m_browser IsNot Nothing Then + m_browser.Stop() + End If + + ServiceNames.Items.Clear() + Me.ClearServiceInfo() + + ' + ' Selecting a service type start a new browse operation + ' + + m_browser = m_service.Browse(0, 0, ComboBox1.Items.Item(ComboBox1.SelectedIndex), "", MyEventManager) + End Sub + + Private Sub ListBox2_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TextRecord.SelectedIndexChanged + + End Sub +End Class +Public Class BrowseData + Private m_serviceName As String + Private m_regType As String + Private m_domain As String + Private m_refs As Integer + + Property ServiceName() As String + Get + Return m_serviceName + End Get + Set(ByVal Value As String) + m_serviceName = Value + End Set + End Property + + Property RegType() As String + Get + Return m_regType + End Get + Set(ByVal Value As String) + m_regType = Value + End Set + End Property + + Property Domain() As String + Get + Return m_domain + End Get + Set(ByVal Value As String) + m_domain = Value + End Set + End Property + + Property Refs As Integer + Get + Return m_refs + End Get + Set(ByVal Value As Integer) + m_refs = Value + End Set + End Property + + Public Overrides Function Equals(obj As Object) As Boolean + If obj Is Nothing Then + Return False + Else + Return m_serviceName.Equals(obj.ToString) + End If + End Function + + Public Overrides Function ToString() As String + Return m_serviceName + End Function + +End Class diff --git a/mDNSResponder/Clients/DNSServiceBrowser.VB/My Project/Application.Designer.vb b/mDNSResponder/Clients/DNSServiceBrowser.VB/My Project/Application.Designer.vb new file mode 100644 index 00000000..ad73d2ed --- /dev/null +++ b/mDNSResponder/Clients/DNSServiceBrowser.VB/My Project/Application.Designer.vb @@ -0,0 +1,38 @@ +'------------------------------------------------------------------------------ +' +' This code was generated by a tool. +' Runtime Version:2.0.50727.4918 +' +' Changes to this file may cause incorrect behavior and will be lost if +' the code is regenerated. +' +'------------------------------------------------------------------------------ + +Option Strict On +Option Explicit On + + +Namespace My + + 'NOTE: This file is auto-generated; do not modify it directly. To make changes, + ' or if you encounter build errors in this file, go to the Project Designer + ' (go to Project Properties or double-click the My Project node in + ' Solution Explorer), and make changes on the Application tab. + ' + Partial Friend Class MyApplication + + _ + Public Sub New() + MyBase.New(Global.Microsoft.VisualBasic.ApplicationServices.AuthenticationMode.Windows) + Me.IsSingleInstance = false + Me.EnableVisualStyles = true + Me.SaveMySettingsOnExit = true + Me.ShutDownStyle = Global.Microsoft.VisualBasic.ApplicationServices.ShutdownMode.AfterMainFormCloses + End Sub + + _ + Protected Overrides Sub OnCreateMainForm() + Me.MainForm = Global.DNSServiceBrowser.VB.DNSServiceBrowser + End Sub + End Class +End Namespace diff --git a/mDNSResponder/Clients/DNSServiceBrowser.VB/My Project/Application.myapp b/mDNSResponder/Clients/DNSServiceBrowser.VB/My Project/Application.myapp new file mode 100644 index 00000000..85cb2c94 --- /dev/null +++ b/mDNSResponder/Clients/DNSServiceBrowser.VB/My Project/Application.myapp @@ -0,0 +1,10 @@ + + + true + DNSServiceBrowser + false + 0 + true + 0 + true + \ No newline at end of file diff --git a/mDNSResponder/Clients/DNSServiceBrowser.VB/My Project/AssemblyInfo.vb b/mDNSResponder/Clients/DNSServiceBrowser.VB/My Project/AssemblyInfo.vb new file mode 100644 index 00000000..32fd3b78 --- /dev/null +++ b/mDNSResponder/Clients/DNSServiceBrowser.VB/My Project/AssemblyInfo.vb @@ -0,0 +1,35 @@ +Imports System +Imports System.Reflection +Imports System.Runtime.InteropServices + +' General Information about an assembly is controlled through the following +' set of attributes. Change these attribute values to modify the information +' associated with an assembly. + +' Review the values of the assembly attributes + + + + + + + + + + +'The following GUID is for the ID of the typelib if this project is exposed to COM + + +' Version information for an assembly consists of the following four values: +' +' Major Version +' Minor Version +' Build Number +' Revision +' +' You can specify all the values or you can default the Build and Revision Numbers +' by using the '*' as shown below: +' + + + diff --git a/mDNSResponder/Clients/DNSServiceBrowser.VB/My Project/Resources.Designer.vb b/mDNSResponder/Clients/DNSServiceBrowser.VB/My Project/Resources.Designer.vb new file mode 100644 index 00000000..1f3f960d --- /dev/null +++ b/mDNSResponder/Clients/DNSServiceBrowser.VB/My Project/Resources.Designer.vb @@ -0,0 +1,62 @@ +'------------------------------------------------------------------------------ +' +' This code was generated by a tool. +' Runtime Version:2.0.50727.3082 +' +' Changes to this file may cause incorrect behavior and will be lost if +' the code is regenerated. +' +'------------------------------------------------------------------------------ + +Option Strict On +Option Explicit On + + +Namespace My.Resources + + 'This class was auto-generated by the StronglyTypedResourceBuilder + 'class via a tool like ResGen or Visual Studio. + 'To add or remove a member, edit your .ResX file then rerun ResGen + 'with the /str option, or rebuild your VS project. + ' + ' A strongly-typed resource class, for looking up localized strings, etc. + ' + _ + Friend Module Resources + + Private resourceMan As Global.System.Resources.ResourceManager + + Private resourceCulture As Global.System.Globalization.CultureInfo + + ' + ' Returns the cached ResourceManager instance used by this class. + ' + _ + Friend ReadOnly Property ResourceManager() As Global.System.Resources.ResourceManager + Get + If Object.ReferenceEquals(resourceMan, Nothing) Then + Dim temp As Global.System.Resources.ResourceManager = New Global.System.Resources.ResourceManager("VBTester.Resources", GetType(Resources).Assembly) + resourceMan = temp + End If + Return resourceMan + End Get + End Property + + ' + ' Overrides the current thread's CurrentUICulture property for all + ' resource lookups using this strongly typed resource class. + ' + _ + Friend Property Culture() As Global.System.Globalization.CultureInfo + Get + Return resourceCulture + End Get + Set(ByVal value As Global.System.Globalization.CultureInfo) + resourceCulture = value + End Set + End Property + End Module +End Namespace diff --git a/mDNSResponder/Clients/DNSServiceBrowser.VB/My Project/Resources.resx b/mDNSResponder/Clients/DNSServiceBrowser.VB/My Project/Resources.resx new file mode 100644 index 00000000..ffecec85 --- /dev/null +++ b/mDNSResponder/Clients/DNSServiceBrowser.VB/My Project/Resources.resx @@ -0,0 +1,117 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/mDNSResponder/Clients/DNSServiceBrowser.VB/My Project/Settings.Designer.vb b/mDNSResponder/Clients/DNSServiceBrowser.VB/My Project/Settings.Designer.vb new file mode 100644 index 00000000..a8c15368 --- /dev/null +++ b/mDNSResponder/Clients/DNSServiceBrowser.VB/My Project/Settings.Designer.vb @@ -0,0 +1,73 @@ +'------------------------------------------------------------------------------ +' +' This code was generated by a tool. +' Runtime Version:2.0.50727.3082 +' +' Changes to this file may cause incorrect behavior and will be lost if +' the code is regenerated. +' +'------------------------------------------------------------------------------ + +Option Strict On +Option Explicit On + + +Namespace My + + _ + Partial Friend NotInheritable Class MySettings + Inherits Global.System.Configuration.ApplicationSettingsBase + + Private Shared defaultInstance As MySettings = CType(Global.System.Configuration.ApplicationSettingsBase.Synchronized(New MySettings), MySettings) + +#Region "My.Settings Auto-Save Functionality" +#If _MyType = "WindowsForms" Then + Private Shared addedHandler As Boolean + + Private Shared addedHandlerLockObject As New Object + + _ + Private Shared Sub AutoSaveSettings(ByVal sender As Global.System.Object, ByVal e As Global.System.EventArgs) + If My.Application.SaveMySettingsOnExit Then + My.Settings.Save() + End If + End Sub +#End If +#End Region + + Public Shared ReadOnly Property [Default]() As MySettings + Get + +#If _MyType = "WindowsForms" Then + If Not addedHandler Then + SyncLock addedHandlerLockObject + If Not addedHandler Then + AddHandler My.Application.Shutdown, AddressOf AutoSaveSettings + addedHandler = True + End If + End SyncLock + End If +#End If + Return defaultInstance + End Get + End Property + End Class +End Namespace + +Namespace My + + _ + Friend Module MySettingsProperty + + _ + Friend ReadOnly Property Settings() As Global.DNSServiceBrowser.VB.My.MySettings + Get + Return Global.DNSServiceBrowser.VB.My.MySettings.Default + End Get + End Property + End Module +End Namespace diff --git a/mDNSResponder/Clients/DNSServiceBrowser.VB/My Project/Settings.settings b/mDNSResponder/Clients/DNSServiceBrowser.VB/My Project/Settings.settings new file mode 100644 index 00000000..377f56d6 --- /dev/null +++ b/mDNSResponder/Clients/DNSServiceBrowser.VB/My Project/Settings.settings @@ -0,0 +1,7 @@ + + + + + + + diff --git a/mDNSResponder/Clients/DNSServiceBrowser.m b/mDNSResponder/Clients/DNSServiceBrowser.m new file mode 100755 index 00000000..b4e04140 --- /dev/null +++ b/mDNSResponder/Clients/DNSServiceBrowser.m @@ -0,0 +1,679 @@ +/* -*- Mode: C; tab-width: 4 -*- + * + * Copyright (c) 2002-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 + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * 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. + */ + +#import +#include +#include +#include +#include +#include +#include +#include +#include +#include + +@class ServiceController; // holds state corresponding to outstanding DNSServiceRef + +@interface BrowserController : NSObject +{ + IBOutlet id nameField; + IBOutlet id typeField; + + IBOutlet id serviceDisplayTable; + IBOutlet id typeColumn; + IBOutlet id nameColumn; + IBOutlet id serviceTypeField; + IBOutlet id serviceNameField; + + IBOutlet id hostField; + IBOutlet id ipAddressField; + IBOutlet id ip6AddressField; + IBOutlet id portField; + IBOutlet id interfaceField; + IBOutlet id textField; + + NSMutableArray *_srvtypeKeys; + NSMutableArray *_srvnameKeys; + NSMutableArray *_sortedServices; + NSMutableDictionary *_servicesDict; + + ServiceController *_serviceBrowser; + ServiceController *_serviceResolver; + ServiceController *_ipv4AddressResolver; + ServiceController *_ipv6AddressResolver; +} + +- (void)notifyTypeSelectionChange:(NSNotification*)note; +- (void)notifyNameSelectionChange:(NSNotification*)note; + +- (IBAction)connect:(id)sender; + +- (IBAction)handleTableClick:(id)sender; +- (IBAction)removeSelected:(id)sender; +- (IBAction)addNewService:(id)sender; + +- (IBAction)update:(NSString *)Type; + +- (void)updateBrowseWithName:(const char *)name type:(const char *)resulttype domain:(const char *)domain interface:(uint32_t)interface flags:(DNSServiceFlags)flags; +- (void)resolveClientWitHost:(NSString *)host port:(uint16_t)port interfaceIndex:(uint32_t)interface txtRecord:(const char*)txtRecord txtLen:(uint16_t)txtLen; +- (void)updateAddress:(uint16_t)rrtype addr:(const void *)buff addrLen:(uint16_t)addrLen host:(const char*)host interfaceIndex:(uint32_t)interface more:(boolean_t)moreToCome; + +- (void)_cancelPendingResolve; +- (void)_clearResolvedInfo; + +@end + +// The ServiceController manages cleanup of DNSServiceRef & runloop info for an outstanding request +@interface ServiceController : NSObject +{ + DNSServiceRef fServiceRef; + CFSocketRef fSocketRef; + CFRunLoopSourceRef fRunloopSrc; +} + +- (id)initWithServiceRef:(DNSServiceRef)ref; +- (void)addToCurrentRunLoop; +- (DNSServiceRef)serviceRef; +- (void)dealloc; + +@end // interface ServiceController + + +static void +ProcessSockData(CFSocketRef s, CFSocketCallBackType type, CFDataRef address, const void *data, void *info) +{ + DNSServiceRef serviceRef = (DNSServiceRef)info; + DNSServiceErrorType err = DNSServiceProcessResult(serviceRef); + if (err != kDNSServiceErr_NoError) { + printf("DNSServiceProcessResult() returned an error! %d\n", err); + } +} + + +static void +ServiceBrowseReply(DNSServiceRef sdRef, DNSServiceFlags servFlags, uint32_t interfaceIndex, DNSServiceErrorType errorCode, + const char *serviceName, const char *regtype, const char *replyDomain, void *context) +{ + if (errorCode == kDNSServiceErr_NoError) { + [(BrowserController*)context updateBrowseWithName:serviceName type:regtype domain:replyDomain interface:interfaceIndex flags:servFlags]; + } else { + printf("ServiceBrowseReply got an error! %d\n", errorCode); + } +} + + +static void +ServiceResolveReply(DNSServiceRef sdRef, DNSServiceFlags flags, uint32_t interfaceIndex, DNSServiceErrorType errorCode, + const char *fullname, const char *hosttarget, uint16_t port, uint16_t txtLen, const char *txtRecord, void *context) +{ + if (errorCode == kDNSServiceErr_NoError) { + [(BrowserController*)context resolveClientWitHost:[NSString stringWithUTF8String:hosttarget] port:port interfaceIndex:interfaceIndex txtRecord:txtRecord txtLen:txtLen]; + } else { + printf("ServiceResolveReply got an error! %d\n", errorCode); + } +} + + +static void +QueryRecordReply(DNSServiceRef DNSServiceRef, DNSServiceFlags flags, uint32_t interfaceIndex, DNSServiceErrorType errorCode, + const char *fullname, uint16_t rrtype, uint16_t rrclass, uint16_t rdlen, const void *rdata, uint32_t ttl, void *context) +{ + if (errorCode == kDNSServiceErr_NoError) { + [(BrowserController*)context updateAddress:rrtype addr:rdata addrLen:rdlen host:fullname interfaceIndex:interfaceIndex more:(flags & kDNSServiceFlagsMoreComing)]; + } else { + printf("QueryRecordReply got an error! %d\n", errorCode); + } +} + + +static void +InterfaceIndexToName(uint32_t interface, char *interfaceName) +{ + assert(interfaceName); + + if (interface == kDNSServiceInterfaceIndexAny) { + // All active network interfaces. + strlcpy(interfaceName, "all", IF_NAMESIZE); + } else if (interface == kDNSServiceInterfaceIndexLocalOnly) { + // Only available locally on this machine. + strlcpy(interfaceName, "local", IF_NAMESIZE); + } else if (interface == kDNSServiceInterfaceIndexP2P) { + // Peer-to-peer. + strlcpy(interfaceName, "p2p", IF_NAMESIZE); + } else { + // Converts interface index to interface name. + if_indextoname(interface, interfaceName); + } +} + + +@implementation BrowserController //Begin implementation of BrowserController methods + +- (void)registerDefaults +{ + NSMutableDictionary *regDict = [NSMutableDictionary dictionary]; + + NSArray *typeArray = [NSArray arrayWithObjects:@"_afpovertcp._tcp", + @"_smb._tcp", + @"_rfb._tcp", + @"_ssh._tcp", + @"_ftp._tcp", + @"_http._tcp", + @"_printer._tcp", + @"_ipp._tcp", + @"_airport._tcp", + @"_presence._tcp", + @"_daap._tcp", + @"_dpap._tcp", + nil]; + + NSArray *nameArray = [NSArray arrayWithObjects:@"AppleShare Servers", + @"Windows Sharing", + @"Screen Sharing", + @"Secure Shell", + @"FTP Servers", + @"Web Servers", + @"LPR Printers", + @"IPP Printers", + @"AirPort Base Stations", + @"iChat Buddies", + @"iTunes Libraries", + @"iPhoto Libraries", + nil]; + + [regDict setObject:typeArray forKey:@"SrvTypeKeys"]; + [regDict setObject:nameArray forKey:@"SrvNameKeys"]; + + [[NSUserDefaults standardUserDefaults] registerDefaults:regDict]; +} + + +- (id)init +{ + self = [super init]; + if (self) { + _srvtypeKeys = nil; + _srvnameKeys = nil; + _serviceBrowser = nil; + _serviceResolver = nil; + _ipv4AddressResolver = nil; + _ipv6AddressResolver = nil; + _sortedServices = [[NSMutableArray alloc] init]; + _servicesDict = [[NSMutableDictionary alloc] init]; + } + return self; +} + + +- (void)awakeFromNib +{ + [typeField sizeLastColumnToFit]; + [nameField sizeLastColumnToFit]; + [nameField setDoubleAction:@selector(connect:)]; + + [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(notifyTypeSelectionChange:) name:NSTableViewSelectionDidChangeNotification object:typeField]; + [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(notifyNameSelectionChange:) name:NSTableViewSelectionDidChangeNotification object:nameField]; + + _srvtypeKeys = [[[NSUserDefaults standardUserDefaults] arrayForKey:@"SrvTypeKeys"] mutableCopy]; + _srvnameKeys = [[[NSUserDefaults standardUserDefaults] arrayForKey:@"SrvNameKeys"] mutableCopy]; + + if (!_srvtypeKeys || !_srvnameKeys) { + [_srvtypeKeys release]; + [_srvnameKeys release]; + [self registerDefaults]; + _srvtypeKeys = [[[NSUserDefaults standardUserDefaults] arrayForKey:@"SrvTypeKeys"] mutableCopy]; + _srvnameKeys = [[[NSUserDefaults standardUserDefaults] arrayForKey:@"SrvNameKeys"] mutableCopy]; + } + + [typeField reloadData]; +} + + +- (void)dealloc +{ + [_srvtypeKeys release]; + [_srvnameKeys release]; + [_servicesDict release]; + [_sortedServices release]; + [super dealloc]; +} + + +-(void)tableView:(NSTableView *)theTableView setObjectValue:(id)object forTableColumn:(NSTableColumn *)tableColumn row:(int)row +{ + if (row < 0) return; +} + + +- (int)numberOfRowsInTableView:(NSTableView *)theTableView //Begin mandatory TableView methods +{ + if (theTableView == typeField) { + return [_srvnameKeys count]; + } + if (theTableView == nameField) { + return [_servicesDict count]; + } + if (theTableView == serviceDisplayTable) { + return [_srvnameKeys count]; + } + return 0; +} + + +- (id)tableView:(NSTableView *)theTableView objectValueForTableColumn:(NSTableColumn *)theColumn row:(int)rowIndex +{ + if (theTableView == typeField) { + return [_srvnameKeys objectAtIndex:rowIndex]; + } + if (theTableView == nameField) { + return [[_servicesDict objectForKey:[_sortedServices objectAtIndex:rowIndex]] name]; + } + if (theTableView == serviceDisplayTable) { + if (theColumn == typeColumn) { + return [_srvtypeKeys objectAtIndex:rowIndex]; + } + if (theColumn == nameColumn) { + return [_srvnameKeys objectAtIndex:rowIndex]; + } + return nil; + } + + return nil; +} + + +- (void)notifyTypeSelectionChange:(NSNotification*)note +{ + [self _cancelPendingResolve]; + + int index = [[note object] selectedRow]; + if (index != -1) { + [self update:[_srvtypeKeys objectAtIndex:index]]; + } else { + [self update:nil]; + } +} + + +- (void)notifyNameSelectionChange:(NSNotification*)note +{ + [self _cancelPendingResolve]; + + int index = [[note object] selectedRow]; + if (index == -1) { + return; + } + + // Get the currently selected service + NSNetService *service = [_servicesDict objectForKey:[_sortedServices objectAtIndex:index]]; + + DNSServiceRef serviceRef; + DNSServiceErrorType err = DNSServiceResolve(&serviceRef, + (DNSServiceFlags)0, + kDNSServiceInterfaceIndexAny, + (const char *)[[service name] UTF8String], + (const char *)[[service type] UTF8String], + (const char *)[[service domain] UTF8String], + (DNSServiceResolveReply)ServiceResolveReply, + self); + + if (kDNSServiceErr_NoError == err) { + _serviceResolver = [[ServiceController alloc] initWithServiceRef:serviceRef]; + [_serviceResolver addToCurrentRunLoop]; + } +} + + +- (IBAction)update:(NSString *)theType +{ + [_servicesDict removeAllObjects]; + [_sortedServices removeAllObjects]; + [nameField reloadData]; + + // get rid of the previous browser if one exists + if (_serviceBrowser != nil) { + [_serviceBrowser release]; + _serviceBrowser = nil; + } + + if (theType) { + DNSServiceRef serviceRef; + DNSServiceErrorType err = DNSServiceBrowse(&serviceRef, (DNSServiceFlags)0, 0, [theType UTF8String], NULL, ServiceBrowseReply, self); + if (kDNSServiceErr_NoError == err) { + _serviceBrowser = [[ServiceController alloc] initWithServiceRef:serviceRef]; + [_serviceBrowser addToCurrentRunLoop]; + } + } +} + + +- (BOOL)applicationShouldTerminateAfterLastWindowClosed:(NSApplication *)theApplication +{ + return YES; +} + + +- (void)updateBrowseWithName:(const char *)name type:(const char *)type domain:(const char *)domain interface:(uint32_t)interface flags:(DNSServiceFlags)flags +{ + NSString *key = [NSString stringWithFormat:@"%s.%s%s%d", name, type, domain, interface]; + NSNetService *service = [[NSNetService alloc] initWithDomain:[NSString stringWithUTF8String:domain] type:[NSString stringWithUTF8String:type] name:[NSString stringWithUTF8String:name]]; + + if (flags & kDNSServiceFlagsAdd) { + [_servicesDict setObject:service forKey:key]; + } else { + [_servicesDict removeObjectForKey:key]; + } + + // If not expecting any more data, then reload (redraw) TableView with newly found data + if (!(flags & kDNSServiceFlagsMoreComing)) { + + // Save the current TableView selection + int index = [nameField selectedRow]; + NSString *selected = (index != -1) ? [[_sortedServices objectAtIndex:index] copy] : nil; + + [_sortedServices release]; + _sortedServices = [[_servicesDict allKeys] mutableCopy]; + [_sortedServices sortUsingSelector:@selector(caseInsensitiveCompare:)]; + [nameField reloadData]; + + // Restore the previous TableView selection + index = selected ? [_sortedServices indexOfObject:selected] : NSNotFound; + if (index != NSNotFound) { + [nameField selectRowIndexes:[NSIndexSet indexSetWithIndex:index] byExtendingSelection:NO]; + [nameField scrollRowToVisible:index]; + } + + [selected release]; + } + + [service release]; + + return; +} + + +- (void)resolveClientWitHost:(NSString *)host port:(uint16_t)port interfaceIndex:(uint32_t)interface txtRecord:(const char*)txtRecord txtLen:(uint16_t)txtLen +{ + DNSServiceRef serviceRef; + + if (_ipv4AddressResolver) { + [_ipv4AddressResolver release]; + _ipv4AddressResolver = nil; + } + + if (_ipv6AddressResolver) { + [_ipv6AddressResolver release]; + _ipv6AddressResolver = nil; + } + + // Start an async lookup for IPv4 addresses + DNSServiceErrorType err = DNSServiceQueryRecord(&serviceRef, (DNSServiceFlags)0, interface, [host UTF8String], kDNSServiceType_A, kDNSServiceClass_IN, QueryRecordReply, self); + if (err == kDNSServiceErr_NoError) { + _ipv4AddressResolver = [[ServiceController alloc] initWithServiceRef:serviceRef]; + [_ipv4AddressResolver addToCurrentRunLoop]; + } + + // Start an async lookup for IPv6 addresses + err = DNSServiceQueryRecord(&serviceRef, (DNSServiceFlags)0, interface, [host UTF8String], kDNSServiceType_AAAA, kDNSServiceClass_IN, QueryRecordReply, self); + if (err == kDNSServiceErr_NoError) { + _ipv6AddressResolver = [[ServiceController alloc] initWithServiceRef:serviceRef]; + [_ipv6AddressResolver addToCurrentRunLoop]; + } + + char interfaceName[IF_NAMESIZE]; + InterfaceIndexToName(interface, interfaceName); + + [hostField setStringValue:host]; + [interfaceField setStringValue:[NSString stringWithUTF8String:interfaceName]]; + [portField setIntValue:ntohs(port)]; + + // kind of a hack: munge txtRecord so it's human-readable + if (txtLen > 0) { + char *readableText = (char*) malloc(txtLen); + if (readableText != nil) { + ByteCount index, subStrLen; + memcpy(readableText, txtRecord, txtLen); + for (index=0; index < txtLen - 1; index += subStrLen + 1) { + subStrLen = readableText[index]; + readableText[index] = ' '; + } + [textField setStringValue:[NSString stringWithCString:&readableText[1] length:txtLen - 1]]; + free(readableText); + } + } +} + + +- (void)updateAddress:(uint16_t)rrtype addr:(const void *)buff addrLen:(uint16_t)addrLen host:(const char*) host interfaceIndex:(uint32_t)interface more:(boolean_t)moreToCome +{ + char addrBuff[256]; + + if (rrtype == kDNSServiceType_A) { + inet_ntop(AF_INET, buff, addrBuff, sizeof(addrBuff)); + if ([[ipAddressField stringValue] length] > 0) { + [ipAddressField setStringValue:[NSString stringWithFormat:@"%@, ", [ipAddressField stringValue]]]; + } + [ipAddressField setStringValue:[NSString stringWithFormat:@"%@%s", [ipAddressField stringValue], addrBuff]]; + + if (!moreToCome) { + [_ipv4AddressResolver release]; + _ipv4AddressResolver = nil; + } + } else if (rrtype == kDNSServiceType_AAAA) { + inet_ntop(AF_INET6, buff, addrBuff, sizeof(addrBuff)); + if ([[ip6AddressField stringValue] length] > 0) { + [ip6AddressField setStringValue:[NSString stringWithFormat:@"%@, ", [ip6AddressField stringValue]]]; + } + [ip6AddressField setStringValue:[NSString stringWithFormat:@"%@%s", [ip6AddressField stringValue], addrBuff]]; + + if (!moreToCome) { + [_ipv6AddressResolver release]; + _ipv6AddressResolver = nil; + } + } +} + + +- (void)connect:(id)sender +{ + NSString *host = [hostField stringValue]; + NSString *txtRecord = [textField stringValue]; + int port = [portField intValue]; + + int index = [nameField selectedRow]; + NSString *selected = (index >= 0) ? [_sortedServices objectAtIndex:index] : nil; + NSString *type = [[_servicesDict objectForKey:selected] type]; + + if ([type isEqual:@"_http._tcp."]) { + NSString *pathDelim = @"path="; + NSRange where; + + // If the TXT record specifies a path, extract it. + where = [txtRecord rangeOfString:pathDelim options:NSCaseInsensitiveSearch]; + if (where.length) { + NSRange targetRange = { where.location + where.length, [txtRecord length] - where.location - where.length }; + NSRange endDelim = [txtRecord rangeOfString:@"\n" options:kNilOptions range:targetRange]; + + if (endDelim.length) // if a delimiter was found, truncate the target range + targetRange.length = endDelim.location - targetRange.location; + + NSString *path = [txtRecord substringWithRange:targetRange]; + [[NSWorkspace sharedWorkspace] openURL:[NSURL URLWithString:[NSString stringWithFormat:@"http://%@:%d%@", host, port, path]]]; + } else { + [[NSWorkspace sharedWorkspace] openURL:[NSURL URLWithString:[NSString stringWithFormat:@"http://%@:%d", host, port]]]; + } + } + else if ([type isEqual:@"_ftp._tcp."]) [[NSWorkspace sharedWorkspace] openURL:[NSURL URLWithString:[NSString stringWithFormat:@"ftp://%@:%d/", host, port]]]; + else if ([type isEqual:@"_ssh._tcp."]) [[NSWorkspace sharedWorkspace] openURL:[NSURL URLWithString:[NSString stringWithFormat:@"ssh://%@:%d/", host, port]]]; + else if ([type isEqual:@"_afpovertcp._tcp."]) [[NSWorkspace sharedWorkspace] openURL:[NSURL URLWithString:[NSString stringWithFormat:@"afp://%@:%d/", host, port]]]; + else if ([type isEqual:@"_smb._tcp."]) [[NSWorkspace sharedWorkspace] openURL:[NSURL URLWithString:[NSString stringWithFormat:@"smb://%@:%d/", host, port]]]; + else if ([type isEqual:@"_rfb._tcp."]) [[NSWorkspace sharedWorkspace] openURL:[NSURL URLWithString:[NSString stringWithFormat:@"vnc://%@:%d/", host, port]]]; + + return; +} + + +- (IBAction)handleTableClick:(id)sender +{ + //populate the text fields +} + + +- (IBAction)removeSelected:(id)sender +{ + // remove the selected row and force a refresh + + int selectedRow = [serviceDisplayTable selectedRow]; + + if (selectedRow) { + + [_srvtypeKeys removeObjectAtIndex:selectedRow]; + [_srvnameKeys removeObjectAtIndex:selectedRow]; + + [[NSUserDefaults standardUserDefaults] setObject:_srvtypeKeys forKey:@"SrvTypeKeys"]; + [[NSUserDefaults standardUserDefaults] setObject:_srvnameKeys forKey:@"SrvNameKeys"]; + + [typeField reloadData]; + [serviceDisplayTable reloadData]; + } +} + + +- (IBAction)addNewService:(id)sender +{ + // add new entries from the edit fields to the arrays for the defaults + NSString *newType = [serviceTypeField stringValue]; + NSString *newName = [serviceNameField stringValue]; + + // 3282283: trim trailing '.' from service type field + if ([newType length] && [newType hasSuffix:@"."]) + newType = [newType substringToIndex:[newType length] - 1]; + + if ([newType length] && [newName length]) { + [_srvtypeKeys addObject:newType]; + [_srvnameKeys addObject:newName]; + + [[NSUserDefaults standardUserDefaults] setObject:_srvtypeKeys forKey:@"SrvTypeKeys"]; + [[NSUserDefaults standardUserDefaults] setObject:_srvnameKeys forKey:@"SrvNameKeys"]; + + [typeField reloadData]; + [serviceDisplayTable reloadData]; + } +} + + +- (void)_cancelPendingResolve +{ + [_ipv4AddressResolver release]; + _ipv4AddressResolver = nil; + + [_ipv6AddressResolver release]; + _ipv6AddressResolver = nil; + + [_serviceResolver release]; + _serviceResolver = nil; + + [self _clearResolvedInfo]; +} + + +- (void)_clearResolvedInfo +{ + [hostField setStringValue:@""]; + [ipAddressField setStringValue:@""]; + [ip6AddressField setStringValue:@""]; + [portField setStringValue:@""]; + [interfaceField setStringValue:@""]; + [textField setStringValue:@""]; +} + +@end // implementation BrowserController + + +@implementation ServiceController : NSObject +{ + DNSServiceRef fServiceRef; + CFSocketRef fSocketRef; + CFRunLoopSourceRef fRunloopSrc; +} + + +- (id)initWithServiceRef:(DNSServiceRef)ref +{ + self = [super init]; + if (self) { + fServiceRef = ref; + fSocketRef = NULL; + fRunloopSrc = NULL; + } + return self; +} + + +- (void)addToCurrentRunLoop +{ + CFSocketContext context = { 0, (void*)fServiceRef, NULL, NULL, NULL }; + + fSocketRef = CFSocketCreateWithNative(kCFAllocatorDefault, DNSServiceRefSockFD(fServiceRef), kCFSocketReadCallBack, ProcessSockData, &context); + if (fSocketRef) { + // Prevent CFSocketInvalidate from closing DNSServiceRef's socket. + CFOptionFlags sockFlags = CFSocketGetSocketFlags(fSocketRef); + CFSocketSetSocketFlags(fSocketRef, sockFlags & (~kCFSocketCloseOnInvalidate)); + fRunloopSrc = CFSocketCreateRunLoopSource(kCFAllocatorDefault, fSocketRef, 0); + } + if (fRunloopSrc) { + CFRunLoopAddSource(CFRunLoopGetCurrent(), fRunloopSrc, kCFRunLoopDefaultMode); + } else { + printf("Could not listen to runloop socket\n"); + } +} + + +- (DNSServiceRef)serviceRef +{ + return fServiceRef; +} + + +- (void)dealloc +{ + if (fSocketRef) { + CFSocketInvalidate(fSocketRef); // Note: Also closes the underlying socket + CFRelease(fSocketRef); + + // Workaround that gives time to CFSocket's select thread so it can remove the socket from its + // FD set before we close the socket by calling DNSServiceRefDeallocate. + usleep(1000); + } + + if (fRunloopSrc) { + CFRunLoopRemoveSource(CFRunLoopGetCurrent(), fRunloopSrc, kCFRunLoopDefaultMode); + CFRelease(fRunloopSrc); + } + + DNSServiceRefDeallocate(fServiceRef); + + [super dealloc]; +} + + +@end // implementation ServiceController + +int main(int argc, const char *argv[]) +{ + return NSApplicationMain(argc, argv); +} diff --git a/mDNSResponder/Clients/DNSServiceBrowser.nib/classes.nib b/mDNSResponder/Clients/DNSServiceBrowser.nib/classes.nib new file mode 100644 index 00000000..482d0aa7 --- /dev/null +++ b/mDNSResponder/Clients/DNSServiceBrowser.nib/classes.nib @@ -0,0 +1,37 @@ +{ + IBClasses = ( + { + ACTIONS = { + addNewService = id; + connect = id; + handleDomainClick = id; + handleNameClick = id; + handleTableClick = id; + handleTypeClick = id; + loadDomains = id; + removeSelected = id; + }; + CLASS = BrowserController; + LANGUAGE = ObjC; + OUTLETS = { + domainField = id; + hostField = id; + interfaceField = id; + ip6AddressField = id; + ipAddressField = id; + nameColumn = id; + nameField = id; + portField = id; + serviceDisplayTable = id; + serviceNameField = id; + serviceTypeField = id; + textField = id; + typeColumn = id; + typeField = id; + }; + SUPERCLASS = NSObject; + }, + {CLASS = FirstResponder; LANGUAGE = ObjC; SUPERCLASS = NSObject; } + ); + IBVersion = 1; +} \ No newline at end of file diff --git a/mDNSResponder/Clients/DNSServiceBrowser.nib/info.nib b/mDNSResponder/Clients/DNSServiceBrowser.nib/info.nib new file mode 100644 index 00000000..34ca9f0e --- /dev/null +++ b/mDNSResponder/Clients/DNSServiceBrowser.nib/info.nib @@ -0,0 +1,22 @@ + + + + + IBDocumentLocation + 257 25 522 680 0 0 1280 1002 + IBEditorPositions + + 29 + 22 474 271 44 0 0 1152 746 + + IBFramework Version + 446.1 + IBOpenObjects + + 201 + 220 + + IBSystem Version + 8L2127 + + diff --git a/mDNSResponder/Clients/DNSServiceBrowser.nib/objects.nib b/mDNSResponder/Clients/DNSServiceBrowser.nib/objects.nib new file mode 100644 index 00000000..3f28e7a8 Binary files /dev/null and b/mDNSResponder/Clients/DNSServiceBrowser.nib/objects.nib differ diff --git a/mDNSResponder/Clients/DNSServiceReg-Info.plist b/mDNSResponder/Clients/DNSServiceReg-Info.plist new file mode 100644 index 00000000..25699685 --- /dev/null +++ b/mDNSResponder/Clients/DNSServiceReg-Info.plist @@ -0,0 +1,30 @@ + + + + + CFBundleDevelopmentRegion + English + CFBundleExecutable + DNS Service Registration + CFBundleGetInfoString + + CFBundleIconFile + + CFBundleIdentifier + com.apple.DNS_Service_Registration + CFBundleInfoDictionaryVersion + 6.0 + CFBundlePackageType + APPL + CFBundleShortVersionString + + CFBundleSignature + ???? + CFBundleVersion + 1.0.0d1 + NSMainNibFile + DNSServiceReg + NSPrincipalClass + NSApplication + + diff --git a/mDNSResponder/Clients/DNSServiceReg.m b/mDNSResponder/Clients/DNSServiceReg.m new file mode 100644 index 00000000..3f2620fe --- /dev/null +++ b/mDNSResponder/Clients/DNSServiceReg.m @@ -0,0 +1,274 @@ +/* -*- Mode: C; tab-width: 4 -*- + * + * Copyright (c) 2002-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 + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * 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. + */ + +#include "dns_sd.h" + +@interface RegistrationController : NSObject +{ + IBOutlet NSTableColumn *typeColumn; + IBOutlet NSTableColumn *nameColumn; + IBOutlet NSTableColumn *portColumn; + IBOutlet NSTableColumn *domainColumn; + IBOutlet NSTableColumn *textColumn; + + IBOutlet NSTableView *serviceDisplayTable; + + IBOutlet NSTextField *serviceTypeField; + IBOutlet NSTextField *serviceNameField; + IBOutlet NSTextField *servicePortField; + IBOutlet NSTextField *serviceDomainField; + IBOutlet NSTextField *serviceTextField; + + NSMutableArray *srvtypeKeys; + NSMutableArray *srvnameKeys; + NSMutableArray *srvportKeys; + NSMutableArray *srvdomainKeys; + NSMutableArray *srvtextKeys; + + NSMutableDictionary *registeredDict; +} + +- (IBAction)registerService:(id)sender; +- (IBAction)unregisterService:(id)sender; + +- (IBAction)addNewService:(id)sender; +- (IBAction)removeSelected:(id)sender; + +@end + +void reg_reply + ( + DNSServiceRef sdRef, + DNSServiceFlags flags, + DNSServiceErrorType errorCode, + const char *name, + const char *regtype, + const char *domain, + void *context + ) +{ + // registration reply + printf("Got a reply from the server with error %d\n", errorCode); + return; +} + +static void myCFSocketCallBack(CFSocketRef cfs, CFSocketCallBackType CallBackType, CFDataRef address, const void *data, void *context) + { + DNSServiceProcessResult((DNSServiceRef)context); + } + +static void addDNSServiceRefToRunLoop(DNSServiceRef ref) + { + int s = DNSServiceRefSockFD(ref); + CFSocketContext myCFSocketContext = { 0, ref, NULL, NULL, NULL }; + CFSocketRef c = CFSocketCreateWithNative(kCFAllocatorDefault, s, kCFSocketReadCallBack, myCFSocketCallBack, &myCFSocketContext); + CFRunLoopSourceRef rls = CFSocketCreateRunLoopSource(kCFAllocatorDefault, c, 0); + CFRunLoopAddSource(CFRunLoopGetCurrent(), rls, kCFRunLoopDefaultMode); + CFRelease(rls); + } + + +@implementation RegistrationController + +- (void)registerDefaults +{ + NSMutableDictionary *regDict = [NSMutableDictionary dictionary]; + + NSArray *typeArray = [NSArray arrayWithObjects:@"_ftp._tcp.", @"_ssh._tcp.", @"_tftp._tcp.", @"_http._tcp.", @"_printer._tcp.", @"_afpovertcp._tcp.", nil]; + NSArray *nameArray = [NSArray arrayWithObjects:@"My ftp Server", @"My Computer", @"Testing Boot Image", @"A Web Server", @"Steve's Printer", @"Company AppleShare Server", nil]; + NSArray *portArray = [NSArray arrayWithObjects:@"21", @"22", @"69", @"80", @"515", @"548", nil]; + NSArray *domainArray = [NSArray arrayWithObjects:@"", @"", @"", @"", @"", @"", nil]; + NSArray *textArray = [NSArray arrayWithObjects:@"", @"", @"image=mybootimage", @"path=/index.html", @"rn=lpt1", @"Vol=Public", nil]; + + [regDict setObject:typeArray forKey:@"SrvTypeKeys"]; + [regDict setObject:nameArray forKey:@"SrvNameKeys"]; + [regDict setObject:portArray forKey:@"SrvPortKeys"]; + [regDict setObject:domainArray forKey:@"SrvDomainKeys"]; + [regDict setObject:textArray forKey:@"SrvTextKeys"]; + + [[NSUserDefaults standardUserDefaults] registerDefaults:regDict]; +} + +- (id)init +{ + srvtypeKeys = [[NSMutableArray array] retain]; //Define arrays for Type, Domain, and Name + srvnameKeys = [[NSMutableArray array] retain]; + srvportKeys = [[NSMutableArray array] retain]; + srvdomainKeys = [[NSMutableArray array] retain]; + srvtextKeys = [[NSMutableArray array] retain]; + + registeredDict = [[NSMutableDictionary alloc] init]; + + [self registerDefaults]; + return [super init]; +} + +- (void)awakeFromNib //BrowserController startup procedure +{ + [srvtypeKeys addObjectsFromArray:[[NSUserDefaults standardUserDefaults] arrayForKey:@"SrvTypeKeys"]]; + [srvnameKeys addObjectsFromArray:[[NSUserDefaults standardUserDefaults] arrayForKey:@"SrvNameKeys"]]; + [srvportKeys addObjectsFromArray:[[NSUserDefaults standardUserDefaults] arrayForKey:@"SrvPortKeys"]]; + [srvdomainKeys addObjectsFromArray:[[NSUserDefaults standardUserDefaults] arrayForKey:@"SrvDomainKeys"]]; + [srvtextKeys addObjectsFromArray:[[NSUserDefaults standardUserDefaults] arrayForKey:@"SrvTextKeys"]]; + + [serviceDisplayTable reloadData]; //Reload (redraw) data in fields + +} + + + + - (IBAction)registerService:(id)sender +{ + int selectedRow = [serviceDisplayTable selectedRow]; + CFMachPortContext context; + DNSServiceRef dns_client; + + if (selectedRow < 0) { + return; + } + + NSString *key = [srvtypeKeys objectAtIndex:selectedRow]; + if ([registeredDict objectForKey:key]) { printf("Already registered\n"); return; } + + context.version = 1; + context.info = 0; + context.retain = NULL; + context.release = NULL; + context.copyDescription = NULL; + unsigned char txtbuffer[300]; + strncpy(txtbuffer+1, [[srvtextKeys objectAtIndex:selectedRow] UTF8String], sizeof(txtbuffer)-1); + txtbuffer[0] = strlen(txtbuffer+1); + + DNSServiceErrorType err = DNSServiceRegister + ( + &dns_client, 0, 0, + [[srvnameKeys objectAtIndex:selectedRow] UTF8String], + [key UTF8String], + [[srvdomainKeys objectAtIndex:selectedRow] UTF8String], + NULL, htons([[srvportKeys objectAtIndex:selectedRow] intValue]), + txtbuffer[0]+1, txtbuffer, + reg_reply, + nil + ); + if (err) + printf("DNSServiceRegister failed %d\n", err); + else + { + addDNSServiceRefToRunLoop(dns_client); + [registeredDict setObject:[NSNumber numberWithUnsignedInt:(unsigned int)dns_client] forKey:key]; + } +} + +- (IBAction)unregisterService:(id)sender +{ + int selectedRow = [serviceDisplayTable selectedRow]; + NSString *key = [srvtypeKeys objectAtIndex:selectedRow]; + + NSNumber *refPtr = [registeredDict objectForKey:key]; + DNSServiceRef ref = (DNSServiceRef)[refPtr unsignedIntValue]; + + if (ref) { + DNSServiceRefDeallocate(ref); + [registeredDict removeObjectForKey:key]; + } +} + +-(void)tableView:(NSTableView *)theTableView setObjectValue:(id)object forTableColumn:(NSTableColumn *)tableColumn row:(int)row +{ + if (row<0) return; +} + +- (int)numberOfRowsInTableView:(NSTableView *)theTableView //Begin mandatory TableView methods +{ + return [srvtypeKeys count]; +} + +- (id)tableView:(NSTableView *)theTableView objectValueForTableColumn:(NSTableColumn *)theColumn row:(int)rowIndex +{ + if (theColumn == typeColumn) { + return [srvtypeKeys objectAtIndex:rowIndex]; + } + if (theColumn == nameColumn) { + return [srvnameKeys objectAtIndex:rowIndex]; + } + if (theColumn == portColumn) { + return [srvportKeys objectAtIndex:rowIndex]; + } + if (theColumn == domainColumn) { + return [srvdomainKeys objectAtIndex:rowIndex]; + } + if (theColumn == textColumn) { + return [srvtextKeys objectAtIndex:rowIndex]; + } + + return(0); +} //End of mandatory TableView methods + +- (IBAction)removeSelected:(id)sender +{ + // remove the selected row and force a refresh + + int selectedRow = [serviceDisplayTable selectedRow]; + + if (selectedRow) { + + [srvtypeKeys removeObjectAtIndex:selectedRow]; + [srvnameKeys removeObjectAtIndex:selectedRow]; + [srvportKeys removeObjectAtIndex:selectedRow]; + [srvdomainKeys removeObjectAtIndex:selectedRow]; + [srvtextKeys removeObjectAtIndex:selectedRow]; + + [[NSUserDefaults standardUserDefaults] setObject:srvtypeKeys forKey:@"SrvTypeKeys"]; + [[NSUserDefaults standardUserDefaults] setObject:srvnameKeys forKey:@"SrvNameKeys"]; + [[NSUserDefaults standardUserDefaults] setObject:srvportKeys forKey:@"SrvPortKeys"]; + [[NSUserDefaults standardUserDefaults] setObject:srvdomainKeys forKey:@"SrvDomainKeys"]; + [[NSUserDefaults standardUserDefaults] setObject:srvtextKeys forKey:@"SrvTextKeys"]; + + [serviceDisplayTable reloadData]; + } +} + +- (IBAction)addNewService:(id)sender +{ + // add new entries from the edit fields to the arrays for the defaults + + if ([[serviceTypeField stringValue] length] && [[serviceNameField stringValue] length] && [[serviceDomainField stringValue] length]&& [[servicePortField stringValue] length]) { + [srvtypeKeys addObject:[serviceTypeField stringValue]]; + [srvnameKeys addObject:[serviceNameField stringValue]]; + [srvportKeys addObject:[servicePortField stringValue]]; + [srvdomainKeys addObject:[serviceDomainField stringValue]]; + [srvtextKeys addObject:[serviceTextField stringValue]]; + + [[NSUserDefaults standardUserDefaults] setObject:srvtypeKeys forKey:@"SrvTypeKeys"]; + [[NSUserDefaults standardUserDefaults] setObject:srvnameKeys forKey:@"SrvNameKeys"]; + [[NSUserDefaults standardUserDefaults] setObject:srvportKeys forKey:@"SrvPortKeys"]; + [[NSUserDefaults standardUserDefaults] setObject:srvdomainKeys forKey:@"SrvDomainKeys"]; + [[NSUserDefaults standardUserDefaults] setObject:srvtextKeys forKey:@"SrvTextKeys"]; + + [serviceDisplayTable reloadData]; + } else { + NSBeep(); + } + +} + +@end + +int main(int argc, const char *argv[]) +{ + return NSApplicationMain(argc, argv); +} diff --git a/mDNSResponder/Clients/DNSServiceReg.nib/classes.nib b/mDNSResponder/Clients/DNSServiceReg.nib/classes.nib new file mode 100644 index 00000000..46f466c7 --- /dev/null +++ b/mDNSResponder/Clients/DNSServiceReg.nib/classes.nib @@ -0,0 +1,30 @@ +{ + IBClasses = ( + {CLASS = FirstResponder; LANGUAGE = ObjC; SUPERCLASS = NSObject; }, + { + ACTIONS = { + addNewService = id; + registerService = id; + removeSelected = id; + unregisterService = id; + }; + CLASS = RegistrationController; + LANGUAGE = ObjC; + OUTLETS = { + domainColumn = NSTableColumn; + nameColumn = NSTableColumn; + portColumn = NSTableColumn; + serviceDisplayTable = NSTableView; + serviceDomainField = NSTextField; + serviceNameField = NSTextField; + servicePortField = NSTextField; + serviceTextField = NSTextField; + serviceTypeField = NSTextField; + textColumn = NSTableColumn; + typeColumn = NSTableColumn; + }; + SUPERCLASS = NSObject; + } + ); + IBVersion = 1; +} \ No newline at end of file diff --git a/mDNSResponder/Clients/DNSServiceReg.nib/info.nib b/mDNSResponder/Clients/DNSServiceReg.nib/info.nib new file mode 100644 index 00000000..9d2eb74f --- /dev/null +++ b/mDNSResponder/Clients/DNSServiceReg.nib/info.nib @@ -0,0 +1,22 @@ + + + + + IBDocumentLocation + 32 111 356 240 0 0 1152 746 + IBEditorPositions + + 29 + 103 609 252 44 0 0 1152 746 + + IBFramework Version + 273.0 + IBOpenObjects + + 243 + 21 + + IBSystem Version + 6C30 + + diff --git a/mDNSResponder/Clients/DNSServiceReg.nib/objects.nib b/mDNSResponder/Clients/DNSServiceReg.nib/objects.nib new file mode 100644 index 00000000..705e77d7 Binary files /dev/null and b/mDNSResponder/Clients/DNSServiceReg.nib/objects.nib differ diff --git a/mDNSResponder/Clients/ExplorerPlugin/About.cpp b/mDNSResponder/Clients/ExplorerPlugin/About.cpp new file mode 100644 index 00000000..4a63f2c2 --- /dev/null +++ b/mDNSResponder/Clients/ExplorerPlugin/About.cpp @@ -0,0 +1,90 @@ +// About.cpp : implementation file +// + +#include "stdafx.h" +#include "ExplorerPlugin.h" +#include "About.h" +#include "WinVersRes.h" +#include + + +// CAbout dialog + +IMPLEMENT_DYNAMIC(CAbout, CDialog) +CAbout::CAbout(CWnd* pParent /*=NULL*/) + : CDialog(CAbout::IDD, pParent) +{ + // Initialize brush with the desired background color + m_bkBrush.CreateSolidBrush(RGB(255, 255, 255)); +} + +CAbout::~CAbout() +{ +} + +void CAbout::DoDataExchange(CDataExchange* pDX) +{ + CDialog::DoDataExchange(pDX); + DDX_Control(pDX, IDC_COMPONENT, m_componentCtrl); + DDX_Control(pDX, IDC_LEGAL, m_legalCtrl); +} + + +BEGIN_MESSAGE_MAP(CAbout, CDialog) +ON_WM_CTLCOLOR() +END_MESSAGE_MAP() + + +// CAbout message handlers +BOOL +CAbout::OnInitDialog() +{ + BOOL b = CDialog::OnInitDialog(); + + CStatic * control = (CStatic*) GetDlgItem( IDC_ABOUT_BACKGROUND ); + check( control ); + + if ( control ) + { + control->SetBitmap( ::LoadBitmap( GetNonLocalizedResources(), MAKEINTRESOURCE( IDB_ABOUT ) ) ); + } + + control = ( CStatic* ) GetDlgItem( IDC_COMPONENT_VERSION ); + check( control ); + + if ( control ) + { + control->SetWindowText( TEXT( MASTER_PROD_VERS_STR2 ) ); + } + + return b; +} + + +HBRUSH CAbout::OnCtlColor(CDC* pDC, CWnd* pWnd, UINT nCtlColor) +{ + switch (nCtlColor) + { + case CTLCOLOR_STATIC: + + if ( pWnd->GetDlgCtrlID() == IDC_COMPONENT ) + { + pDC->SetTextColor(RGB(64, 64, 64)); + } + else + { + pDC->SetTextColor(RGB(0, 0, 0)); + } + + pDC->SetBkColor(RGB(255, 255, 255)); + return (HBRUSH)(m_bkBrush.GetSafeHandle()); + + case CTLCOLOR_DLG: + + return (HBRUSH)(m_bkBrush.GetSafeHandle()); + + default: + + return CDialog::OnCtlColor(pDC, pWnd, nCtlColor); + } +} diff --git a/mDNSResponder/Clients/ExplorerPlugin/About.h b/mDNSResponder/Clients/ExplorerPlugin/About.h new file mode 100644 index 00000000..494d1f1e --- /dev/null +++ b/mDNSResponder/Clients/ExplorerPlugin/About.h @@ -0,0 +1,28 @@ +#pragma once + +#include "Resource.h" +#include "afxwin.h" + +// CAbout dialog + +class CAbout : public CDialog +{ +DECLARE_DYNAMIC(CAbout) + +public: +CAbout(CWnd* pParent = NULL); // standard constructor +virtual ~CAbout(); + +// Dialog Data +enum { IDD = IDD_ABOUT }; + +protected: +virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support +virtual HBRUSH OnCtlColor(CDC* pDC, CWnd* pWnd, UINT nCtlColor); +virtual BOOL OnInitDialog(); +DECLARE_MESSAGE_MAP() +public: +CStatic m_componentCtrl; +CStatic m_legalCtrl; +CBrush m_bkBrush; +}; diff --git a/mDNSResponder/Clients/ExplorerPlugin/ClassFactory.cpp b/mDNSResponder/Clients/ExplorerPlugin/ClassFactory.cpp new file mode 100644 index 00000000..e578e239 --- /dev/null +++ b/mDNSResponder/Clients/ExplorerPlugin/ClassFactory.cpp @@ -0,0 +1,177 @@ +/* -*- Mode: C; tab-width: 4 -*- + * + * Copyright (c) 2003-2004 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 + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * 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. +*/ + +#include "StdAfx.h" + +#include "DebugServices.h" + +#include "ExplorerBar.h" +#include "ExplorerPlugin.h" + +#include "ClassFactory.h" + +// MFC Debugging + +#ifdef _DEBUG +#define new DEBUG_NEW +#undef THIS_FILE +static char THIS_FILE[] = __FILE__; +#endif + +//=========================================================================================================================== +// ClassFactory +//=========================================================================================================================== + +ClassFactory::ClassFactory( CLSID inCLSID ) +{ + mCLSIDObject = inCLSID; + mRefCount = 1; + ++gDLLRefCount; +} + +//=========================================================================================================================== +// ~ClassFactory +//=========================================================================================================================== + +ClassFactory::~ClassFactory( void ) +{ + check( gDLLRefCount > 0 ); + + --gDLLRefCount; +} + +#if 0 +#pragma mark - +#pragma mark == IUnknown methods == +#endif + +//=========================================================================================================================== +// QueryInterface +//=========================================================================================================================== + +STDMETHODIMP ClassFactory::QueryInterface( REFIID inID, LPVOID *outResult ) +{ + HRESULT err; + + check( outResult ); + + if( IsEqualIID( inID, IID_IUnknown ) ) + { + *outResult = this; + } + else if( IsEqualIID( inID, IID_IClassFactory ) ) + { + *outResult = (IClassFactory *) this; + } + else + { + *outResult = NULL; + err = E_NOINTERFACE; + goto exit; + } + + ( *( (LPUNKNOWN *) outResult ) )->AddRef(); + err = S_OK; + +exit: + return( err ); +} + +//=========================================================================================================================== +// AddRef +//=========================================================================================================================== + +STDMETHODIMP_( DWORD ) ClassFactory::AddRef( void ) +{ + return( ++mRefCount ); +} + +//=========================================================================================================================== +// Release +//=========================================================================================================================== + +STDMETHODIMP_( DWORD ) ClassFactory::Release( void ) +{ + DWORD count; + + count = --mRefCount; + if( count == 0 ) + { + delete this; + } + return( count ); +} + +#if 0 +#pragma mark - +#pragma mark == IClassFactory methods == +#endif + +//=========================================================================================================================== +// CreateInstance +//=========================================================================================================================== + +STDMETHODIMP ClassFactory::CreateInstance( LPUNKNOWN inUnknown, REFIID inID, LPVOID *outObject ) +{ + HRESULT err; + LPVOID obj; + + check( outObject ); + + obj = NULL; + *outObject = NULL; + require_action( !inUnknown, exit, err = CLASS_E_NOAGGREGATION ); + + // Create the object based on the CLSID. + + if( IsEqualCLSID( mCLSIDObject, CLSID_ExplorerBar ) ) + { + try + { + obj = new ExplorerBar(); + } + catch( ... ) + { + // Don't let exception escape. + } + require_action( obj, exit, err = E_OUTOFMEMORY ); + } + else + { + err = E_FAIL; + goto exit; + } + + // Query for the specified interface. Release the factory since QueryInterface retains it. + + err = ( (LPUNKNOWN ) obj )->QueryInterface( inID, outObject ); + ( (LPUNKNOWN ) obj )->Release(); + +exit: + return( err ); +} + +//=========================================================================================================================== +// LockServer +//=========================================================================================================================== + +STDMETHODIMP ClassFactory::LockServer( BOOL inLock ) +{ + DEBUG_UNUSED( inLock ); + + return( E_NOTIMPL ); +} diff --git a/mDNSResponder/Clients/ExplorerPlugin/ClassFactory.h b/mDNSResponder/Clients/ExplorerPlugin/ClassFactory.h new file mode 100644 index 00000000..cbf56302 --- /dev/null +++ b/mDNSResponder/Clients/ExplorerPlugin/ClassFactory.h @@ -0,0 +1,51 @@ +/* -*- Mode: C; tab-width: 4 -*- + * + * Copyright (c) 2003-2004 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 + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * 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. + */ + +#ifndef __CLASS_FACTORY__ +#define __CLASS_FACTORY__ + +#include "StdAfx.h" + +//=========================================================================================================================== +// ClassFactory +//=========================================================================================================================== + +class ClassFactory : public IClassFactory +{ +protected: + +DWORD mRefCount; +CLSID mCLSIDObject; + +public: + +ClassFactory( CLSID inCLSID ); +~ClassFactory( void ); + +// IUnknown methods + +STDMETHODIMP QueryInterface( REFIID inID, LPVOID *outResult ); +STDMETHODIMP_( DWORD ) AddRef( void ); +STDMETHODIMP_( DWORD ) Release( void ); + +// IClassFactory methods + +STDMETHODIMP CreateInstance( LPUNKNOWN inUnknown, REFIID inID, LPVOID *outObject ); +STDMETHODIMP LockServer( BOOL inLock ); +}; + +#endif // __CLASS_FACTORY__ diff --git a/mDNSResponder/Clients/ExplorerPlugin/ExplorerBar.cpp b/mDNSResponder/Clients/ExplorerPlugin/ExplorerBar.cpp new file mode 100644 index 00000000..644515fe --- /dev/null +++ b/mDNSResponder/Clients/ExplorerPlugin/ExplorerBar.cpp @@ -0,0 +1,659 @@ +/* -*- Mode: C; tab-width: 4 -*- + * + * Copyright (c) 2003-2004 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 + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * 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. + */ + +#include "StdAfx.h" + +#include "comutil.h" +#include "ShObjIdl.h" + +#include "DebugServices.h" + +#include "Resource.h" + +#include "ExplorerBar.h" + +#include "About.h" +// MFC Debugging + +#ifdef _DEBUG +#define new DEBUG_NEW +#undef THIS_FILE +static char THIS_FILE[] = __FILE__; +#endif + +//=========================================================================================================================== +// Constants +//=========================================================================================================================== +#define LENGTHOF(a) (sizeof(a) == sizeof(&*a)) ? 0 : (sizeof(a) / sizeof(*a)) +#define MIN_SIZE_X 10 +#define MIN_SIZE_Y 10 + +//=========================================================================================================================== +// ExplorerBar +//=========================================================================================================================== + +ExplorerBar::ExplorerBar( void ) +{ + ++gDLLRefCount; + + mRefCount = 1; + mSite = NULL; + mWebBrowser = NULL; + mParentWindow = NULL; + mFocus = FALSE; + mViewMode = 0; + mBandID = 0; +} + +//=========================================================================================================================== +// ~ExplorerBar +//=========================================================================================================================== + +ExplorerBar::~ExplorerBar( void ) +{ + if( mWebBrowser ) + { + mWebBrowser->Release(); + mWebBrowser = NULL; + } + if( mSite ) + { + mSite->Release(); + mSite = NULL; + } + + --gDLLRefCount; +} + +#if 0 +#pragma mark - +#pragma mark == IUnknown implementation == +#endif + +//=========================================================================================================================== +// QueryInterface +//=========================================================================================================================== + +STDMETHODIMP ExplorerBar::QueryInterface( REFIID inID, LPVOID *outResult ) +{ + HRESULT err; + + if( IsEqualIID( inID, IID_IUnknown ) ) // IUnknown + { + *outResult = this; + } + else if( IsEqualIID( inID, IID_IOleWindow ) ) // IOleWindow + { + *outResult = (IOleWindow *) this; + } + else if( IsEqualIID( inID, IID_IDockingWindow ) ) // IDockingWindow + { + *outResult = (IDockingWindow *) this; + } + else if( IsEqualIID( inID, IID_IDeskBand ) ) // IDeskBand + { + *outResult = (IDeskBand *) this; + } + else if( IsEqualIID( inID, IID_IInputObject ) ) // IInputObject + { + *outResult = (IInputObject *) this; + } + else if( IsEqualIID( inID, IID_IObjectWithSite ) ) // IObjectWithSite + { + *outResult = (IObjectWithSite *) this; + } + else if( IsEqualIID( inID, IID_IPersistStream ) ) // IPersistStream + { + *outResult = (IPersistStream *) this; + } + else if( IsEqualIID( inID, IID_IContextMenu ) ) // IContextMenu + { + *outResult = (IContextMenu *) this; + } + else + { + *outResult = NULL; + err = E_NOINTERFACE; + goto exit; + } + + ( *( (LPUNKNOWN *) outResult ) )->AddRef(); + err = S_OK; + +exit: + return( err ); +} + +//=========================================================================================================================== +// AddRef +//=========================================================================================================================== + +STDMETHODIMP_( DWORD ) ExplorerBar::AddRef( void ) +{ + return( ++mRefCount ); +} + +//=========================================================================================================================== +// Release +//=========================================================================================================================== + +STDMETHODIMP_( DWORD ) ExplorerBar::Release( void ) +{ + DWORD count; + + count = --mRefCount; + if( count == 0 ) + { + delete this; + } + return( count ); +} + +#if 0 +#pragma mark - +#pragma mark == IOleWindow implementation == +#endif + +//=========================================================================================================================== +// GetWindow +//=========================================================================================================================== + +STDMETHODIMP ExplorerBar::GetWindow( HWND *outWindow ) +{ + *outWindow = mWindow.GetSafeHwnd(); + return( S_OK ); +} + +//=========================================================================================================================== +// ContextSensitiveHelp +//=========================================================================================================================== + +STDMETHODIMP ExplorerBar::ContextSensitiveHelp( BOOL inEnterMode ) +{ + DEBUG_UNUSED( inEnterMode ); + + return( E_NOTIMPL ); +} + +#if 0 +#pragma mark - +#pragma mark == IDockingWindow implementation == +#endif + +//=========================================================================================================================== +// ShowDW +//=========================================================================================================================== + +STDMETHODIMP ExplorerBar::ShowDW( BOOL inShow ) +{ + if( mWindow.GetSafeHwnd() ) + { + mWindow.ShowWindow( inShow ? SW_SHOW : SW_HIDE ); + } + return( S_OK ); +} + +//=========================================================================================================================== +// CloseDW +//=========================================================================================================================== + +STDMETHODIMP ExplorerBar::CloseDW( DWORD inReserved ) +{ + DEBUG_UNUSED( inReserved ); + + ShowDW( FALSE ); + if( mWindow.GetSafeHwnd() ) + { + mWindow.SendMessage( WM_CLOSE ); + } + return( S_OK ); +} + +//=========================================================================================================================== +// ResizeBorderDW +//=========================================================================================================================== + +STDMETHODIMP ExplorerBar::ResizeBorderDW( LPCRECT inBorder, IUnknown *inPunkSite, BOOL inReserved ) +{ + DEBUG_UNUSED( inBorder ); + DEBUG_UNUSED( inPunkSite ); + DEBUG_UNUSED( inReserved ); + + return( E_NOTIMPL ); +} + +#if 0 +#pragma mark - +#pragma mark == IDeskBand implementation == +#endif + +//=========================================================================================================================== +// GetBandInfo +//=========================================================================================================================== + +STDMETHODIMP ExplorerBar::GetBandInfo( DWORD inBandID, DWORD inViewMode, DESKBANDINFO *outInfo ) +{ + HRESULT err; + + require_action( outInfo, exit, err = E_INVALIDARG ); + + mBandID = inBandID; + mViewMode = inViewMode; + + if( outInfo->dwMask & DBIM_MINSIZE ) + { + outInfo->ptMinSize.x = 100; + outInfo->ptMinSize.y = 100; + } + if( outInfo->dwMask & DBIM_MAXSIZE ) + { + // Unlimited max size. + + outInfo->ptMaxSize.x = -1; + outInfo->ptMaxSize.y = -1; + } + if( outInfo->dwMask & DBIM_INTEGRAL ) + { + outInfo->ptIntegral.x = 1; + outInfo->ptIntegral.y = 1; + } + if( outInfo->dwMask & DBIM_ACTUAL ) + { + outInfo->ptActual.x = 0; + outInfo->ptActual.y = 0; + } + if( outInfo->dwMask & DBIM_TITLE ) + { + CString s; + BOOL ok; + + ok = s.LoadString( IDS_NAME ); + require_action( ok, exit, err = kNoResourcesErr ); + + #ifdef UNICODE + lstrcpyn( outInfo->wszTitle, s, sizeof_array( outInfo->wszTitle ) ); + #else + DWORD nChars; + + nChars = MultiByteToWideChar( CP_ACP, 0, s, -1, outInfo->wszTitle, sizeof_array( outInfo->wszTitle ) ); + err = translate_errno( nChars > 0, (OSStatus) GetLastError(), kUnknownErr ); + require_noerr( err, exit ); + #endif + } + if( outInfo->dwMask & DBIM_MODEFLAGS ) + { + outInfo->dwModeFlags = DBIMF_NORMAL | DBIMF_VARIABLEHEIGHT; + } + + // Force the default background color. + + outInfo->dwMask &= ~DBIM_BKCOLOR; + err = S_OK; + +exit: + return( err ); +} + +#if 0 +#pragma mark - +#pragma mark == IInputObject implementation == +#endif + +//=========================================================================================================================== +// UIActivateIO +//=========================================================================================================================== + +STDMETHODIMP ExplorerBar::UIActivateIO( BOOL inActivate, LPMSG inMsg ) +{ + DEBUG_UNUSED( inMsg ); + + if( inActivate ) + { + mWindow.SetFocus(); + } + return( S_OK ); +} + +//=========================================================================================================================== +// HasFocusIO +//=========================================================================================================================== + +STDMETHODIMP ExplorerBar::HasFocusIO( void ) +{ + if( mWindow.GetFocus()->GetSafeHwnd() == mWindow.GetSafeHwnd() ) + { + return( S_OK ); + } + return( S_FALSE ); +} + +//=========================================================================================================================== +// TranslateAcceleratorIO +//=========================================================================================================================== + +STDMETHODIMP ExplorerBar::TranslateAcceleratorIO( LPMSG inMsg ) +{ + DEBUG_UNUSED( inMsg ); + + return( S_FALSE ); +} + +#if 0 +#pragma mark - +#pragma mark == IObjectWithSite implementation == +#endif + +//=========================================================================================================================== +// SetSite +//=========================================================================================================================== + +STDMETHODIMP ExplorerBar::SetSite( IUnknown *inPunkSite ) +{ + AFX_MANAGE_STATE( AfxGetStaticModuleState() ); + + HRESULT err; + + // Release the old interfaces. + + if( mWebBrowser ) + { + mWebBrowser->Release(); + mWebBrowser = NULL; + } + if( mSite ) + { + mSite->Release(); + mSite = NULL; + } + + // A non-NULL site means we're setting the site. Otherwise, the site is being released (done above). + + if( !inPunkSite ) + { + err = S_OK; + goto exit; + } + + // Get the parent window. + + IOleWindow * oleWindow; + + mParentWindow = NULL; + err = inPunkSite->QueryInterface( IID_IOleWindow, (LPVOID *) &oleWindow ); + require( SUCCEEDED( err ), exit ); + + err = oleWindow->GetWindow( &mParentWindow ); + oleWindow->Release(); + require_noerr( err, exit ); + require_action( mParentWindow, exit, err = E_FAIL ); + + // Get the IInputObject interface. + + err = inPunkSite->QueryInterface( IID_IInputObjectSite, (LPVOID *) &mSite ); + require( SUCCEEDED( err ), exit ); + check( mSite ); + + // Get the IWebBrowser2 interface. + + IOleCommandTarget * oleCommandTarget; + + err = inPunkSite->QueryInterface( IID_IOleCommandTarget, (LPVOID *) &oleCommandTarget ); + require( SUCCEEDED( err ), exit ); + + IServiceProvider * serviceProvider; + + err = oleCommandTarget->QueryInterface( IID_IServiceProvider, (LPVOID *) &serviceProvider ); + oleCommandTarget->Release(); + require( SUCCEEDED( err ), exit ); + + err = serviceProvider->QueryService( SID_SWebBrowserApp, IID_IWebBrowser2, (LPVOID *) &mWebBrowser ); + serviceProvider->Release(); + require( SUCCEEDED( err ), exit ); + + // Create the main window. + + err = SetupWindow(); + require_noerr( err, exit ); + +exit: + return( err ); +} + +//=========================================================================================================================== +// GetSite +//=========================================================================================================================== + +STDMETHODIMP ExplorerBar::GetSite( REFIID inID, LPVOID *outResult ) +{ + HRESULT err; + + *outResult = NULL; + require_action( mSite, exit, err = E_FAIL ); + + err = mSite->QueryInterface( inID, outResult ); + +exit: + return( err ); +} + +#if 0 +#pragma mark - +#pragma mark == IPersistStream implementation == +#endif + +// +// IPersistStream implementation +// +// This is only supported to allow the desk band to be dropped on the desktop and to prevent multiple instances of +// the desk band from showing up in the context menu. This desk band doesn't actually persist any data. +// + +//=========================================================================================================================== +// GetClassID +//=========================================================================================================================== + +STDMETHODIMP ExplorerBar::GetClassID( LPCLSID outClassID ) +{ + *outClassID = CLSID_ExplorerBar; + return( S_OK ); +} + +//=========================================================================================================================== +// IsDirty +//=========================================================================================================================== + +STDMETHODIMP ExplorerBar::IsDirty( void ) +{ + return( S_FALSE ); +} + +//=========================================================================================================================== +// Load +//=========================================================================================================================== + +STDMETHODIMP ExplorerBar::Load( LPSTREAM inStream ) +{ + DEBUG_UNUSED( inStream ); + + return( S_OK ); +} + +//=========================================================================================================================== +// Save +//=========================================================================================================================== + +STDMETHODIMP ExplorerBar::Save( LPSTREAM inStream, BOOL inClearDirty ) +{ + DEBUG_UNUSED( inStream ); + DEBUG_UNUSED( inClearDirty ); + + return( S_OK ); +} + +//=========================================================================================================================== +// GetSizeMax +//=========================================================================================================================== + +STDMETHODIMP ExplorerBar::GetSizeMax( ULARGE_INTEGER *outSizeMax ) +{ + DEBUG_UNUSED( outSizeMax ); + + return( E_NOTIMPL ); +} + + +//=========================================================================================================================== +// QueryContextMenu +//=========================================================================================================================== + +STDMETHODIMP ExplorerBar::QueryContextMenu(HMENU hShellContextMenu, UINT iContextMenuFirstItem, UINT idCmdFirst, UINT idCmdLast, UINT uFlags) +{ + DEBUG_UNUSED( idCmdLast ); + DEBUG_UNUSED( uFlags ); + + CMenu menubar; + + menubar.LoadMenu(IDR_CONTEXT_MENU); + CMenu * menu = menubar.GetSubMenu(0); + + CMenu shellmenu; + + shellmenu.Attach(hShellContextMenu); + + UINT iShellItem = iContextMenuFirstItem; //! remove plus one + UINT idShellCmd = idCmdFirst; + + int n = menu->GetMenuItemCount(); + + for (int i=0; iGetMenuItemInfo(i, &mii, TRUE); + + mii.wID = idShellCmd++; + + shellmenu.InsertMenuItem(iShellItem++, &mii, TRUE); + } + + shellmenu.Detach(); + + return n; +} + + +//=========================================================================================================================== +// GetCommandString +//=========================================================================================================================== + +// Not called for explorer bars +STDMETHODIMP ExplorerBar::GetCommandString(UINT_PTR idCmd, UINT uType, UINT* pwReserved, LPSTR pszName, UINT cchMax) +{ + DEBUG_UNUSED( idCmd ); + DEBUG_UNUSED( uType ); + DEBUG_UNUSED( pwReserved ); + DEBUG_UNUSED( pszName ); + DEBUG_UNUSED( cchMax ); + + return E_NOTIMPL; +} + +//=========================================================================================================================== +// InvokeCommand +//=========================================================================================================================== + +// The shell sends either strings or indexes +// IE never sends strings +// The indexes are into an array of my commands +// So the verb for the first command I added to the menu is always 0x0000 +// Here - because I don't have any submenus - +// I can treat the 'verb' as an menu item position +STDMETHODIMP ExplorerBar::InvokeCommand(LPCMINVOKECOMMANDINFO lpici) +{ + // IE doesn't send string commands + if (HIWORD(lpici->lpVerb) != 0) return 0; + + CAbout dlg; + + dlg.DoModal(); + + return S_OK; +} + +#if 0 +#pragma mark - +#pragma mark == Other == +#endif + +//=========================================================================================================================== +// SetupWindow +//=========================================================================================================================== + +OSStatus ExplorerBar::SetupWindow( void ) +{ + OSStatus err; + CWnd * window; + CRect rect; + CString s; + BOOL ok; + + window = CWnd::FromHandle( mParentWindow ); + check( window ); + window->GetClientRect( rect ); + + ok = s.LoadString( IDS_NAME ); + require_action( ok, exit, err = kNoResourcesErr ); + + ok = mWindow.Create( NULL, s, WS_CHILD | WS_VISIBLE, rect, window, 100 ) != 0; + require_action( ok, exit, err = kNoResourcesErr ); + + mWindow.SetOwner( this ); + err = kNoErr; + +exit: + return( err ); +} + +//=========================================================================================================================== +// GoToURL +//=========================================================================================================================== + +OSStatus ExplorerBar::GoToURL( const CString &inURL ) +{ + OSStatus err; + BSTR s; + VARIANT empty; + + s = inURL.AllocSysString(); + require_action( s, exit, err = kNoMemoryErr ); + + VariantInit( &empty ); + err = mWebBrowser->Navigate( s, &empty, &empty, &empty, &empty ); + SysFreeString( s ); + require_noerr( err, exit ); + +exit: + return( err ); +} diff --git a/mDNSResponder/Clients/ExplorerPlugin/ExplorerBar.h b/mDNSResponder/Clients/ExplorerPlugin/ExplorerBar.h new file mode 100644 index 00000000..01d1beee --- /dev/null +++ b/mDNSResponder/Clients/ExplorerPlugin/ExplorerBar.h @@ -0,0 +1,104 @@ +/* -*- Mode: C; tab-width: 4 -*- + * + * Copyright (c) 2003-2004 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 + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * 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. + */ + +#ifndef __EXPLORER_BAR__ +#define __EXPLORER_BAR__ + +#include "StdAfx.h" + +#include "ExplorerBarWindow.h" +#include "ExplorerPlugin.h" + +//=========================================================================================================================== +// ExplorerBar +//=========================================================================================================================== + +class ExplorerBar : public IDeskBand, + public IInputObject, + public IObjectWithSite, + public IPersistStream, + public IContextMenu +{ +protected: + +DWORD mRefCount; +IInputObjectSite * mSite; +IWebBrowser2 * mWebBrowser; +HWND mParentWindow; +BOOL mFocus; +DWORD mViewMode; +DWORD mBandID; +ExplorerBarWindow mWindow; + +public: + +ExplorerBar( void ); +~ExplorerBar( void ); + +// IUnknown methods + +STDMETHODIMP QueryInterface( REFIID inID, LPVOID *outResult ); +STDMETHODIMP_( DWORD ) AddRef( void ); +STDMETHODIMP_( DWORD ) Release( void ); + +// IOleWindow methods + +STDMETHOD( GetWindow ) ( HWND *outWindow ); +STDMETHOD( ContextSensitiveHelp ) ( BOOL inEnterMode ); + +// IDockingWindow methods + +STDMETHOD( ShowDW ) ( BOOL inShow ); +STDMETHOD( CloseDW ) ( DWORD inReserved ); +STDMETHOD( ResizeBorderDW ) ( LPCRECT inBorder, IUnknown *inPunkSite, BOOL inReserved ); + +// IDeskBand methods + +STDMETHOD( GetBandInfo ) ( DWORD inBandID, DWORD inViewMode, DESKBANDINFO *outInfo ); + +// IInputObject methods + +STDMETHOD( UIActivateIO ) ( BOOL inActivate, LPMSG inMsg ); +STDMETHOD( HasFocusIO ) ( void ); +STDMETHOD( TranslateAcceleratorIO ) ( LPMSG inMsg ); + +// IObjectWithSite methods + +STDMETHOD( SetSite ) ( IUnknown *inPunkSite ); +STDMETHOD( GetSite ) ( REFIID inID, LPVOID *outResult ); + +// IPersistStream methods + +STDMETHOD( GetClassID ) ( LPCLSID outClassID ); +STDMETHOD( IsDirty ) ( void ); +STDMETHOD( Load ) ( LPSTREAM inStream ); +STDMETHOD( Save ) ( LPSTREAM inStream, BOOL inClearDirty ); +STDMETHOD( GetSizeMax ) ( ULARGE_INTEGER *outSizeMax ); + +// IContextMenu methods + +STDMETHOD( QueryContextMenu ) ( HMENU hContextMenu, UINT iContextMenuFirstItem, UINT idCmdFirst, UINT idCmdLast, UINT uFlags ); +STDMETHOD( GetCommandString ) ( UINT_PTR idCmd, UINT uType, UINT* pwReserved, LPSTR pszName, UINT cchMax ); +STDMETHOD( InvokeCommand ) ( LPCMINVOKECOMMANDINFO lpici ); + +// Other + +OSStatus SetupWindow( void ); +OSStatus GoToURL( const CString &inURL ); +}; + +#endif // __EXPLORER_BAR__ diff --git a/mDNSResponder/Clients/ExplorerPlugin/ExplorerBarWindow.cpp b/mDNSResponder/Clients/ExplorerPlugin/ExplorerBarWindow.cpp new file mode 100644 index 00000000..5e0692aa --- /dev/null +++ b/mDNSResponder/Clients/ExplorerPlugin/ExplorerBarWindow.cpp @@ -0,0 +1,794 @@ +/* -*- Mode: C; tab-width: 4 -*- + * + * Copyright (c) 2003-2004 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 + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * 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. + */ + +#include "StdAfx.h" + +#include "CommonServices.h" +#include "DebugServices.h" +#include "WinServices.h" +#include "dns_sd.h" + +#include "ExplorerBar.h" +#include "LoginDialog.h" +#include "Resource.h" + +#include "ExplorerBarWindow.h" +#include "ExplorerPlugin.h" + +// MFC Debugging + +#ifdef _DEBUG +#define new DEBUG_NEW +#undef THIS_FILE +static char THIS_FILE[] = __FILE__; +#endif + +#if 0 +#pragma mark == Constants == +#endif + +//=========================================================================================================================== +// Constants +//=========================================================================================================================== + +// Control IDs + +#define IDC_EXPLORER_TREE 1234 + +// Private Messages + +#define WM_PRIVATE_SERVICE_EVENT ( WM_USER + 0x100 ) + +// TXT records + +#define kTXTRecordKeyPath "path" + +// IE Icon resource + +#define kIEIconResource 32529 + + +#if 0 +#pragma mark == Prototypes == +#endif + +//=========================================================================================================================== +// Prototypes +//=========================================================================================================================== + +DEBUG_LOCAL int FindServiceArrayIndex( const ServiceInfoArray &inArray, const ServiceInfo &inService, int &outIndex ); + +#if 0 +#pragma mark == Message Map == +#endif + +//=========================================================================================================================== +// Message Map +//=========================================================================================================================== + +BEGIN_MESSAGE_MAP( ExplorerBarWindow, CWnd ) + ON_WM_CREATE() + ON_WM_DESTROY() + ON_WM_SIZE() + ON_NOTIFY( NM_DBLCLK, IDC_EXPLORER_TREE, OnDoubleClick ) + ON_MESSAGE( WM_PRIVATE_SERVICE_EVENT, OnServiceEvent ) +END_MESSAGE_MAP() + +#if 0 +#pragma mark - +#endif + +//=========================================================================================================================== +// ExplorerBarWindow +//=========================================================================================================================== + +ExplorerBarWindow::ExplorerBarWindow( void ) +{ + mOwner = NULL; + mResolveServiceRef = NULL; +} + +//=========================================================================================================================== +// ~ExplorerBarWindow +//=========================================================================================================================== + +ExplorerBarWindow::~ExplorerBarWindow( void ) +{ + // +} + +#if 0 +#pragma mark - +#endif + +//=========================================================================================================================== +// OnCreate +//=========================================================================================================================== + +int ExplorerBarWindow::OnCreate( LPCREATESTRUCT inCreateStruct ) +{ + AFX_MANAGE_STATE( AfxGetStaticModuleState() ); + + HINSTANCE module = NULL; + OSStatus err; + CRect rect; + CBitmap bitmap; + CString s; + + err = CWnd::OnCreate( inCreateStruct ); + require_noerr( err, exit ); + + GetClientRect( rect ); + mTree.Create( WS_TABSTOP | WS_VISIBLE | WS_CHILD | TVS_HASBUTTONS | TVS_LINESATROOT | TVS_NOHSCROLL , rect, this, + IDC_EXPLORER_TREE ); + + ServiceHandlerEntry * e; + + s.LoadString( IDS_ABOUT ); + m_about = mTree.InsertItem( s, 0, 0 ); + + // Web Site Handler + + e = new ServiceHandlerEntry; + check( e ); + e->type = "_http._tcp"; + e->urlScheme = "http://"; + e->ref = NULL; + e->obj = this; + e->needsLogin = false; + mServiceHandlers.Add( e ); + + err = DNSServiceBrowse( &e->ref, 0, 0, e->type, NULL, BrowseCallBack, e ); + require_noerr( err, exit ); + + err = WSAAsyncSelect((SOCKET) DNSServiceRefSockFD(e->ref), m_hWnd, WM_PRIVATE_SERVICE_EVENT, FD_READ|FD_CLOSE); + require_noerr( err, exit ); + + m_serviceRefs.push_back(e->ref); + +#if defined( _BROWSE_FOR_HTTPS_ ) + e = new ServiceHandlerEntry; + check( e ); + e->type = "_https._tcp"; + e->urlScheme = "https://"; + e->ref = NULL; + e->obj = this; + e->needsLogin = false; + mServiceHandlers.Add( e ); + + err = DNSServiceBrowse( &e->ref, 0, 0, e->type, NULL, BrowseCallBack, e ); + require_noerr( err, exit ); + + err = WSAAsyncSelect((SOCKET) DNSServiceRefSockFD(e->ref), m_hWnd, WM_PRIVATE_SERVICE_EVENT, FD_READ|FD_CLOSE); + require_noerr( err, exit ); + + m_serviceRefs.push_back(e->ref); +#endif + + m_imageList.Create( 16, 16, ILC_MASK | ILC_COLOR16, 2, 0); + + bitmap.Attach( ::LoadBitmap( GetNonLocalizedResources(), MAKEINTRESOURCE( IDB_LOGO ) ) ); + m_imageList.Add( &bitmap, (CBitmap*) NULL ); + bitmap.Detach(); + + mTree.SetImageList(&m_imageList, TVSIL_NORMAL); + +exit: + + if ( module ) + { + FreeLibrary( module ); + module = NULL; + } + + // Cannot talk to the mDNSResponder service. Show the error message and exit (with kNoErr so they can see it). + if ( err ) + { + if ( err == kDNSServiceErr_Firewall ) + { + s.LoadString( IDS_FIREWALL ); + } + else + { + s.LoadString( IDS_MDNSRESPONDER_NOT_AVAILABLE ); + } + + mTree.DeleteAllItems(); + mTree.InsertItem( s, 0, 0, TVI_ROOT, TVI_LAST ); + + err = kNoErr; + } + + return( err ); +} + +//=========================================================================================================================== +// OnDestroy +//=========================================================================================================================== + +void ExplorerBarWindow::OnDestroy( void ) +{ + // Stop any resolves that may still be pending (shouldn't be any). + + StopResolve(); + + // Clean up the extant browses + while (m_serviceRefs.size() > 0) + { + // + // take the head of the list + // + DNSServiceRef ref = m_serviceRefs.front(); + + // + // Stop will remove it from the list + // + Stop( ref ); + } + + // Clean up the service handlers. + + int i; + int n; + + n = (int) mServiceHandlers.GetSize(); + for( i = 0; i < n; ++i ) + { + delete mServiceHandlers[ i ]; + } + + CWnd::OnDestroy(); +} + +//=========================================================================================================================== +// OnSize +//=========================================================================================================================== + +void ExplorerBarWindow::OnSize( UINT inType, int inX, int inY ) +{ + CWnd::OnSize( inType, inX, inY ); + mTree.MoveWindow( 0, 0, inX, inY ); +} + +//=========================================================================================================================== +// OnDoubleClick +//=========================================================================================================================== + +void ExplorerBarWindow::OnDoubleClick( NMHDR *inNMHDR, LRESULT *outResult ) +{ + HTREEITEM item; + ServiceInfo * service; + OSStatus err; + + DEBUG_UNUSED( inNMHDR ); + + item = mTree.GetSelectedItem(); + require( item, exit ); + + // Tell Internet Explorer to go to the URL if it's about item + + if ( item == m_about ) + { + CString url; + + check( mOwner ); + + url.LoadString( IDS_ABOUT_URL ); + mOwner->GoToURL( url ); + } + else + { + service = reinterpret_cast < ServiceInfo * > ( mTree.GetItemData( item ) ); + require_quiet( service, exit ); + + err = StartResolve( service ); + require_noerr( err, exit ); + } + +exit: + *outResult = 0; +} + + +//=========================================================================================================================== +// OnServiceEvent +//=========================================================================================================================== + +LRESULT +ExplorerBarWindow::OnServiceEvent(WPARAM inWParam, LPARAM inLParam) +{ + if (WSAGETSELECTERROR(inLParam) && !(HIWORD(inLParam))) + { + dlog( kDebugLevelError, "OnServiceEvent: window error\n" ); + } + else + { + SOCKET sock = (SOCKET) inWParam; + + // iterate thru list + ServiceRefList::iterator it; + + for (it = m_serviceRefs.begin(); it != m_serviceRefs.end(); it++) + { + DNSServiceRef ref = *it; + + check(ref != NULL); + + if ((SOCKET) DNSServiceRefSockFD(ref) == sock) + { + DNSServiceErrorType err; + + err = DNSServiceProcessResult(ref); + + if (err != 0) + { + CString s; + + s.LoadString( IDS_MDNSRESPONDER_NOT_AVAILABLE ); + mTree.DeleteAllItems(); + mTree.InsertItem( s, 0, 0, TVI_ROOT, TVI_LAST ); + + Stop(ref); + } + + break; + } + } + } + + return ( 0 ); +} + +#if 0 +#pragma mark - +#endif + +//=========================================================================================================================== +// BrowseCallBack +//=========================================================================================================================== + +void DNSSD_API + ExplorerBarWindow::BrowseCallBack( + DNSServiceRef inRef, + DNSServiceFlags inFlags, + uint32_t inInterfaceIndex, + DNSServiceErrorType inErrorCode, + const char * inName, + const char * inType, + const char * inDomain, + void * inContext ) +{ + ServiceHandlerEntry * obj; + ServiceInfo * service; + OSStatus err; + + DEBUG_UNUSED( inRef ); + + obj = NULL; + service = NULL; + + require_noerr( inErrorCode, exit ); + obj = reinterpret_cast < ServiceHandlerEntry * > ( inContext ); + check( obj ); + check( obj->obj ); + + // + // set the UI to hold off on updates + // + obj->obj->mTree.SetRedraw(FALSE); + + try + { + service = new ServiceInfo; + require_action( service, exit, err = kNoMemoryErr ); + + err = UTF8StringToStringObject( inName, service->displayName ); + check_noerr( err ); + + service->name = _strdup( inName ); + require_action( service->name, exit, err = kNoMemoryErr ); + + service->type = _strdup( inType ); + require_action( service->type, exit, err = kNoMemoryErr ); + + service->domain = _strdup( inDomain ); + require_action( service->domain, exit, err = kNoMemoryErr ); + + service->ifi = inInterfaceIndex; + service->handler = obj; + + service->refs = 1; + + if (inFlags & kDNSServiceFlagsAdd) obj->obj->OnServiceAdd (service); + else obj->obj->OnServiceRemove(service); + + service = NULL; + } + catch( ... ) + { + dlog( kDebugLevelError, "BrowseCallBack: exception thrown\n" ); + } + +exit: + // + // If no more coming, then update UI + // + if (obj && obj->obj && ((inFlags & kDNSServiceFlagsMoreComing) == 0)) + { + obj->obj->mTree.SetRedraw(TRUE); + obj->obj->mTree.Invalidate(); + } + + if( service ) + { + delete service; + } +} + +//=========================================================================================================================== +// OnServiceAdd +//=========================================================================================================================== + +LONG ExplorerBarWindow::OnServiceAdd( ServiceInfo * service ) +{ + ServiceHandlerEntry * handler; + int cmp; + int index; + + + check( service ); + handler = service->handler; + check( handler ); + + cmp = FindServiceArrayIndex( handler->array, *service, index ); + if( cmp == 0 ) + { + // Found a match so update the item. The index is index + 1 so subtract 1. + + index -= 1; + check( index < handler->array.GetSize() ); + + handler->array[ index ]->refs++; + + delete service; + } + else + { + HTREEITEM afterItem; + + // Insert the new item in sorted order. + + afterItem = ( index > 0 ) ? handler->array[ index - 1 ]->item : m_about; + handler->array.InsertAt( index, service ); + service->item = mTree.InsertItem( service->displayName, 0, 0, NULL, afterItem ); + mTree.SetItemData( service->item, (DWORD_PTR) service ); + } + return( 0 ); +} + +//=========================================================================================================================== +// OnServiceRemove +//=========================================================================================================================== + +LONG ExplorerBarWindow::OnServiceRemove( ServiceInfo * service ) +{ + ServiceHandlerEntry * handler; + int cmp; + int index; + + + check( service ); + handler = service->handler; + check( handler ); + + // Search to see if we know about this service instance. If so, remove it from the list. + + cmp = FindServiceArrayIndex( handler->array, *service, index ); + check( cmp == 0 ); + + if( cmp == 0 ) + { + // Possibly found a match remove the item. The index + // is index + 1 so subtract 1. + index -= 1; + check( index < handler->array.GetSize() ); + + if ( --handler->array[ index ]->refs == 0 ) + { + mTree.DeleteItem( handler->array[ index ]->item ); + delete handler->array[ index ]; + handler->array.RemoveAt( index ); + } + } + + delete service; + return( 0 ); +} + +#if 0 +#pragma mark - +#endif + +//=========================================================================================================================== +// StartResolve +//=========================================================================================================================== + +OSStatus ExplorerBarWindow::StartResolve( ServiceInfo *inService ) +{ + OSStatus err; + + check( inService ); + + // Stop any current resolve that may be in progress. + + StopResolve(); + + // Resolve the service. + err = DNSServiceResolve( &mResolveServiceRef, 0, 0, + inService->name, inService->type, inService->domain, (DNSServiceResolveReply) ResolveCallBack, inService->handler ); + require_noerr( err, exit ); + + err = WSAAsyncSelect((SOCKET) DNSServiceRefSockFD(mResolveServiceRef), m_hWnd, WM_PRIVATE_SERVICE_EVENT, FD_READ|FD_CLOSE); + require_noerr( err, exit ); + + m_serviceRefs.push_back(mResolveServiceRef); + +exit: + return( err ); +} + +//=========================================================================================================================== +// StopResolve +//=========================================================================================================================== + +void ExplorerBarWindow::StopResolve( void ) +{ + if( mResolveServiceRef ) + { + Stop( mResolveServiceRef ); + mResolveServiceRef = NULL; + } +} + +//=========================================================================================================================== +// ResolveCallBack +//=========================================================================================================================== + +void DNSSD_API + ExplorerBarWindow::ResolveCallBack( + DNSServiceRef inRef, + DNSServiceFlags inFlags, + uint32_t inInterfaceIndex, + DNSServiceErrorType inErrorCode, + const char * inFullName, + const char * inHostName, + uint16_t inPort, + uint16_t inTXTSize, + const char * inTXT, + void * inContext ) +{ + ExplorerBarWindow * obj; + ServiceHandlerEntry * handler; + OSStatus err; + + DEBUG_UNUSED( inRef ); + DEBUG_UNUSED( inFlags ); + DEBUG_UNUSED( inErrorCode ); + DEBUG_UNUSED( inFullName ); + + require_noerr( inErrorCode, exit ); + handler = (ServiceHandlerEntry *) inContext; + check( handler ); + obj = handler->obj; + check( obj ); + + try + { + ResolveInfo * resolve; + int idx; + + dlog( kDebugLevelNotice, "resolved %s on ifi %d to %s\n", inFullName, inInterfaceIndex, inHostName ); + + // Stop resolving after the first good result. + + obj->StopResolve(); + + // Post a message to the main thread so it can handle it since MFC is not thread safe. + + resolve = new ResolveInfo; + require_action( resolve, exit, err = kNoMemoryErr ); + + UTF8StringToStringObject( inHostName, resolve->host ); + + // rdar://problem/3841564 + // + // strip trailing dot from hostname because some flavors of Windows + // have trouble parsing it. + + idx = resolve->host.ReverseFind('.'); + + if ((idx > 1) && ((resolve->host.GetLength() - 1) == idx)) + { + resolve->host.Delete(idx, 1); + } + + resolve->port = ntohs( inPort ); + resolve->ifi = inInterfaceIndex; + resolve->handler = handler; + + err = resolve->txt.SetData( inTXT, inTXTSize ); + check_noerr( err ); + + obj->OnResolve(resolve); + } + catch( ... ) + { + dlog( kDebugLevelError, "ResolveCallBack: exception thrown\n" ); + } + +exit: + return; +} + +//=========================================================================================================================== +// OnResolve +//=========================================================================================================================== + +LONG ExplorerBarWindow::OnResolve( ResolveInfo * resolve ) +{ + CString url; + uint8_t * path; + uint8_t pathSize; + char * pathPrefix; + CString username; + CString password; + + + check( resolve ); + + // Get login info if needed. + + if( resolve->handler->needsLogin ) + { + LoginDialog dialog; + + if( !dialog.GetLogin( username, password ) ) + { + goto exit; + } + } + + // If the HTTP TXT record is a "path=" entry, use it as the resource path. Otherwise, use "/". + + pathPrefix = ""; + if( strcmp( resolve->handler->type, "_http._tcp" ) == 0 ) + { + uint8_t * txtData; + uint16_t txtLen; + + resolve->txt.GetData( &txtData, &txtLen ); + + path = (uint8_t*) TXTRecordGetValuePtr(txtLen, txtData, kTXTRecordKeyPath, &pathSize); + + if (path == NULL) + { + path = (uint8_t*) ""; + pathSize = 1; + } + } + else + { + path = (uint8_t *) ""; + pathSize = 1; + } + + // Build the URL in the following format: + // + // [[:]@][] + + url.AppendFormat( TEXT( "%S" ), resolve->handler->urlScheme ); // URL Scheme + if( username.GetLength() > 0 ) + { + url.AppendFormat( TEXT( "%s" ), username ); // Username + if( password.GetLength() > 0 ) + { + url.AppendFormat( TEXT( ":%s" ), password ); // Password + } + url.AppendFormat( TEXT( "@" ) ); + } + + url += resolve->host; // Host + url.AppendFormat( TEXT( ":%d" ), resolve->port ); // :Port + url.AppendFormat( TEXT( "%S" ), pathPrefix ); // Path Prefix ("/" or empty). + url.AppendFormat( TEXT( "%.*S" ), (int) pathSize, (char *) path ); // Path (possibly empty). + + // Tell Internet Explorer to go to the URL. + + check( mOwner ); + mOwner->GoToURL( url ); + +exit: + delete resolve; + return( 0 ); +} + +//=========================================================================================================================== +// Stop +//=========================================================================================================================== +void ExplorerBarWindow::Stop( DNSServiceRef ref ) +{ + m_serviceRefs.remove( ref ); + + WSAAsyncSelect(DNSServiceRefSockFD( ref ), m_hWnd, WM_PRIVATE_SERVICE_EVENT, 0); + + DNSServiceRefDeallocate( ref ); +} + + +#if 0 +#pragma mark - +#endif + +//=========================================================================================================================== +// FindServiceArrayIndex +//=========================================================================================================================== + +DEBUG_LOCAL int FindServiceArrayIndex( const ServiceInfoArray &inArray, const ServiceInfo &inService, int &outIndex ) +{ + int result; + int lo; + int hi; + int mid; + + result = -1; + mid = 0; + lo = 0; + hi = (int)( inArray.GetSize() - 1 ); + while( lo <= hi ) + { + mid = ( lo + hi ) / 2; + result = inService.displayName.CompareNoCase( inArray[ mid ]->displayName ); +#if 0 + if( result == 0 ) + { + result = ( (int) inService.ifi ) - ( (int) inArray[ mid ]->ifi ); + } +#endif + if( result == 0 ) + { + break; + } + else if( result < 0 ) + { + hi = mid - 1; + } + else + { + lo = mid + 1; + } + } + if( result == 0 ) + { + mid += 1; // Bump index so new item is inserted after matching item. + } + else if( result > 0 ) + { + mid += 1; + } + outIndex = mid; + return( result ); +} diff --git a/mDNSResponder/Clients/ExplorerPlugin/ExplorerBarWindow.h b/mDNSResponder/Clients/ExplorerPlugin/ExplorerBarWindow.h new file mode 100644 index 00000000..e8163181 --- /dev/null +++ b/mDNSResponder/Clients/ExplorerPlugin/ExplorerBarWindow.h @@ -0,0 +1,264 @@ +/* -*- Mode: C; tab-width: 4 -*- + * + * Copyright (c) 2003-2004 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 + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * 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. + */ + +#ifndef __EXPLORER_BAR_WINDOW__ +#define __EXPLORER_BAR_WINDOW__ + +#pragma once + +#include "afxtempl.h" + +#include "dns_sd.h" +#include + +//=========================================================================================================================== +// Structures +//=========================================================================================================================== + +// Forward Declarations + +struct ServiceHandlerEntry; +class ExplorerBarWindow; + +// ServiceInfo + +struct ServiceInfo +{ + CString displayName; + char * name; + char * type; + char * domain; + uint32_t ifi; + HTREEITEM item; + ServiceHandlerEntry * handler; + DWORD refs; + + ServiceInfo( void ) + { + item = NULL; + type = NULL; + domain = NULL; + handler = NULL; + } + + ~ServiceInfo( void ) + { + if( name ) + { + free( name ); + } + if( type ) + { + free( type ); + } + if( domain ) + { + free( domain ); + } + } +}; + +typedef CArray < ServiceInfo *, ServiceInfo * > ServiceInfoArray; + +// TextRecord + +struct TextRecord +{ + uint8_t * mData; + uint16_t mSize; + + TextRecord( void ) + { + mData = NULL; + mSize = 0; + } + + ~TextRecord( void ) + { + if( mData ) + { + free( mData ); + } + } + + void GetData( void *outData, uint16_t *outSize ) + { + if( outData ) + { + *( (void **) outData ) = mData; + } + if( outSize ) + { + *outSize = mSize; + } + } + + OSStatus SetData( const void *inData, uint16_t inSize ) + { + OSStatus err; + uint8_t * newData; + + newData = (uint8_t *) malloc( inSize ); + require_action( newData, exit, err = kNoMemoryErr ); + memcpy( newData, inData, inSize ); + + if( mData ) + { + free( mData ); + } + mData = newData; + mSize = inSize; + err = kNoErr; + +exit: + return( err ); + } +}; + +// ResolveInfo + +struct ResolveInfo +{ + CString host; + uint16_t port; + uint32_t ifi; + TextRecord txt; + ServiceHandlerEntry * handler; +}; + +// ServiceHandlerEntry + +struct ServiceHandlerEntry +{ + const char * type; + const char * urlScheme; + DNSServiceRef ref; + ServiceInfoArray array; + ExplorerBarWindow * obj; + bool needsLogin; + + ServiceHandlerEntry( void ) + { + type = NULL; + urlScheme = NULL; + ref = NULL; + obj = NULL; + needsLogin = false; + } + + ~ServiceHandlerEntry( void ) + { + int i; + int n; + + n = (int) array.GetSize(); + for( i = 0; i < n; ++i ) + { + delete array[ i ]; + } + } +}; + +typedef CArray < ServiceHandlerEntry *, ServiceHandlerEntry * > ServiceHandlerArray; + +//=========================================================================================================================== +// ExplorerBarWindow +//=========================================================================================================================== + +class ExplorerBar; // Forward Declaration + +class ExplorerBarWindow : public CWnd +{ +protected: + +ExplorerBar * mOwner; +CTreeCtrl mTree; + +ServiceHandlerArray mServiceHandlers; +DNSServiceRef mResolveServiceRef; + +public: + +ExplorerBarWindow( void ); +virtual ~ExplorerBarWindow( void ); + +protected: + +// General + +afx_msg int OnCreate( LPCREATESTRUCT inCreateStruct ); +afx_msg void OnDestroy( void ); +afx_msg void OnSize( UINT inType, int inX, int inY ); +afx_msg void OnDoubleClick( NMHDR *inNMHDR, LRESULT *outResult ); +afx_msg LRESULT OnServiceEvent( WPARAM inWParam, LPARAM inLParam ); + +// Browsing + +static void DNSSD_API +BrowseCallBack( + DNSServiceRef inRef, + DNSServiceFlags inFlags, + uint32_t inInterfaceIndex, + DNSServiceErrorType inErrorCode, + const char * inName, + const char * inType, + const char * inDomain, + void * inContext ); +LONG OnServiceAdd( ServiceInfo * service ); +LONG OnServiceRemove( ServiceInfo * service ); + +// Resolving + +OSStatus StartResolve( ServiceInfo *inService ); +void StopResolve( void ); + + +void Stop( DNSServiceRef ref ); + + +static void DNSSD_API +ResolveCallBack( + DNSServiceRef inRef, + DNSServiceFlags inFlags, + uint32_t inInterfaceIndex, + DNSServiceErrorType inErrorCode, + const char * inFullName, + const char * inHostName, + uint16_t inPort, + uint16_t inTXTSize, + const char * inTXT, + void * inContext ); +LONG OnResolve( ResolveInfo * resolve ); + +// Accessors + +public: + +ExplorerBar * GetOwner( void ) const { return( mOwner ); } +void SetOwner( ExplorerBar *inOwner ) { mOwner = inOwner; } + +DECLARE_MESSAGE_MAP() +private: + +typedef std::list< DNSServiceRef > ServiceRefList; + +HTREEITEM m_about; +ServiceRefList m_serviceRefs; +CImageList m_imageList; +}; + +#endif // __EXPLORER_BAR_WINDOW__ diff --git a/mDNSResponder/Clients/ExplorerPlugin/ExplorerPlugin.cpp b/mDNSResponder/Clients/ExplorerPlugin/ExplorerPlugin.cpp new file mode 100644 index 00000000..fb1b7c24 --- /dev/null +++ b/mDNSResponder/Clients/ExplorerPlugin/ExplorerPlugin.cpp @@ -0,0 +1,600 @@ +/* -*- Mode: C; tab-width: 4 -*- + * + * Copyright (c) 2003-2004 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 + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * 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. + */ + +#include "StdAfx.h" + +// The following 2 includes have to be in this order and INITGUID must be defined here, before including the file +// that specifies the GUID(s), and nowhere else. The reason for this is that initguid.h doesn't provide separate +// define and declare macros for GUIDs so you have to #define INITGUID in the single file where you want to define +// your GUID then in all the other files that just need the GUID declared, INITGUID must not be defined. + +#define INITGUID +#include +#include "ExplorerPlugin.h" + +#include +#include + +#include "CommonServices.h" +#include "DebugServices.h" + +#include "ClassFactory.h" +#include "Resource.h" + +#include "loclibrary.h" + +// MFC Debugging + +#ifdef _DEBUG +#define new DEBUG_NEW +#undef THIS_FILE +static char THIS_FILE[] = __FILE__; +#endif + +#if 0 +#pragma mark == Prototypes == +#endif + +//=========================================================================================================================== +// Prototypes +//=========================================================================================================================== + +// Utilities + +DEBUG_LOCAL OSStatus RegisterServer( HINSTANCE inInstance, CLSID inCLSID, LPCTSTR inName ); +DEBUG_LOCAL OSStatus RegisterCOMCategory( CLSID inCLSID, CATID inCategoryID, BOOL inRegister ); +DEBUG_LOCAL OSStatus UnregisterServer( CLSID inCLSID ); +DEBUG_LOCAL OSStatus MyRegDeleteKey( HKEY hKeyRoot, LPTSTR lpSubKey ); + +// Stash away pointers to our resource DLLs + +static HINSTANCE g_nonLocalizedResources = NULL; +static CString g_nonLocalizedResourcesName; +static HINSTANCE g_localizedResources = NULL; + +HINSTANCE +GetNonLocalizedResources() +{ + return g_nonLocalizedResources; +} + +HINSTANCE +GetLocalizedResources() +{ + return g_localizedResources; +} + +// This is the class GUID for an undocumented hook into IE that will allow us to register +// and have IE notice our new ExplorerBar without rebooting. +// {8C7461EF-2B13-11d2-BE35-3078302C2030} + +DEFINE_GUID(CLSID_CompCatCacheDaemon, +0x8C7461EF, 0x2b13, 0x11d2, 0xbe, 0x35, 0x30, 0x78, 0x30, 0x2c, 0x20, 0x30); + + +#if 0 +#pragma mark == Globals == +#endif + +//=========================================================================================================================== +// Globals +//=========================================================================================================================== + +HINSTANCE gInstance = NULL; +int gDLLRefCount = 0; +CExplorerPluginApp gApp; + +#if 0 +#pragma mark - +#pragma mark == DLL Exports == +#endif + +//=========================================================================================================================== +// CExplorerPluginApp::CExplorerPluginApp +//=========================================================================================================================== + +IMPLEMENT_DYNAMIC(CExplorerPluginApp, CWinApp); + +CExplorerPluginApp::CExplorerPluginApp() +{ +} + + +//=========================================================================================================================== +// CExplorerPluginApp::~CExplorerPluginApp +//=========================================================================================================================== + +CExplorerPluginApp::~CExplorerPluginApp() +{ +} + + +//=========================================================================================================================== +// CExplorerPluginApp::InitInstance +//=========================================================================================================================== + +BOOL +CExplorerPluginApp::InitInstance() +{ + wchar_t resource[MAX_PATH]; + OSStatus err; + int res; + HINSTANCE inInstance; + + inInstance = AfxGetInstanceHandle(); + gInstance = inInstance; + + debug_initialize( kDebugOutputTypeWindowsEventLog, "DNSServices Bar", inInstance ); + debug_set_property( kDebugPropertyTagPrintLevel, kDebugLevelTrace ); + dlog( kDebugLevelTrace, "\nCCPApp::InitInstance\n" ); + + res = PathForResource( inInstance, L"ExplorerPluginResources.dll", resource, MAX_PATH ); + + err = translate_errno( res != 0, kUnknownErr, kUnknownErr ); + require_noerr( err, exit ); + + g_nonLocalizedResources = LoadLibrary( resource ); + translate_errno( g_nonLocalizedResources, GetLastError(), kUnknownErr ); + require_noerr( err, exit ); + + g_nonLocalizedResourcesName = resource; + + res = PathForResource( inInstance, L"ExplorerPluginLocalized.dll", resource, MAX_PATH ); + err = translate_errno( res != 0, kUnknownErr, kUnknownErr ); + require_noerr( err, exit ); + + g_localizedResources = LoadLibrary( resource ); + translate_errno( g_localizedResources, GetLastError(), kUnknownErr ); + require_noerr( err, exit ); + + AfxSetResourceHandle( g_localizedResources ); + +exit: + + return TRUE; +} + + +//=========================================================================================================================== +// CExplorerPluginApp::ExitInstance +//=========================================================================================================================== + +int +CExplorerPluginApp::ExitInstance() +{ + return 0; +} + + + +//=========================================================================================================================== +// DllCanUnloadNow +//=========================================================================================================================== + +STDAPI DllCanUnloadNow( void ) +{ + dlog( kDebugLevelTrace, "DllCanUnloadNow (refCount=%d)\n", gDLLRefCount ); + + return( gDLLRefCount == 0 ); +} + +//=========================================================================================================================== +// DllGetClassObject +//=========================================================================================================================== + +STDAPI DllGetClassObject( REFCLSID inCLSID, REFIID inIID, LPVOID *outResult ) +{ + HRESULT err; + BOOL ok; + ClassFactory * factory; + + dlog( kDebugLevelTrace, "DllGetClassObject\n" ); + + *outResult = NULL; + + // Check if the class ID is supported. + + ok = IsEqualCLSID( inCLSID, CLSID_ExplorerBar ); + require_action_quiet( ok, exit, err = CLASS_E_CLASSNOTAVAILABLE ); + + // Create the ClassFactory object. + + factory = NULL; + try + { + factory = new ClassFactory( inCLSID ); + } + catch( ... ) + { + // Do not let exception escape. + } + require_action( factory, exit, err = E_OUTOFMEMORY ); + + // Query for the specified interface. Release the factory since QueryInterface retains it. + + err = factory->QueryInterface( inIID, outResult ); + factory->Release(); + +exit: + return( err ); +} + +//=========================================================================================================================== +// DllRegisterServer +//=========================================================================================================================== + +STDAPI DllRegisterServer( void ) +{ + IRunnableTask * pTask = NULL; + HRESULT err; + BOOL ok; + CString s; + + dlog( kDebugLevelTrace, "DllRegisterServer\n" ); + + ok = s.LoadString( IDS_NAME ); + require_action( ok, exit, err = E_UNEXPECTED ); + + err = RegisterServer( gInstance, CLSID_ExplorerBar, s ); + require_noerr( err, exit ); + + err = RegisterCOMCategory( CLSID_ExplorerBar, CATID_InfoBand, TRUE ); + require_noerr( err, exit ); + + // Clear IE cache so it will rebuild the cache when it runs next. This + // will allow us to install and not reboot + + err = CoCreateInstance(CLSID_CompCatCacheDaemon, NULL, CLSCTX_INPROC, IID_IRunnableTask, (void**) &pTask); + require_noerr( err, exit ); + + pTask->Run(); + pTask->Release(); + +exit: + return( err ); +} + +//=========================================================================================================================== +// DllUnregisterServer +//=========================================================================================================================== + +STDAPI DllUnregisterServer( void ) +{ + HRESULT err; + + dlog( kDebugLevelTrace, "DllUnregisterServer\n" ); + + err = RegisterCOMCategory( CLSID_ExplorerBar, CATID_InfoBand, FALSE ); + require_noerr( err, exit ); + + err = UnregisterServer( CLSID_ExplorerBar ); + require_noerr( err, exit ); + +exit: + return( err ); +} + + +#if 0 +#pragma mark - +#pragma mark == Utilities == +#endif + +//=========================================================================================================================== +// RegisterServer +//=========================================================================================================================== + +DEBUG_LOCAL OSStatus RegisterServer( HINSTANCE inInstance, CLSID inCLSID, LPCTSTR inName ) +{ + typedef struct RegistryBuilder RegistryBuilder; + struct RegistryBuilder + { + HKEY rootKey; + LPCTSTR subKey; + LPCTSTR valueName; + LPCTSTR data; + }; + + OSStatus err; + LPWSTR clsidWideString; + TCHAR clsidString[ 64 ]; + DWORD nChars; + size_t n; + size_t i; + HKEY key; + TCHAR keyName[ MAX_PATH ]; + TCHAR moduleName[ MAX_PATH ] = TEXT( "" ); + TCHAR data[ MAX_PATH ]; + RegistryBuilder entries[] = + { + { HKEY_CLASSES_ROOT, TEXT( "CLSID\\%s" ), NULL, inName }, + { HKEY_CLASSES_ROOT, TEXT( "CLSID\\%s\\InprocServer32" ), NULL, moduleName }, + { HKEY_CLASSES_ROOT, TEXT( "CLSID\\%s\\InprocServer32" ), TEXT( "ThreadingModel" ), TEXT( "Apartment" ) } + }; + DWORD size; + OSVERSIONINFO versionInfo; + + // Convert the CLSID to a string based on the encoding of this code (ANSI or Unicode). + + err = StringFromIID( inCLSID, &clsidWideString ); + require_noerr( err, exit ); + require_action( clsidWideString, exit, err = kNoMemoryErr ); + + #ifdef UNICODE + lstrcpyn( clsidString, clsidWideString, sizeof_array( clsidString ) ); + CoTaskMemFree( clsidWideString ); + #else + nChars = WideCharToMultiByte( CP_ACP, 0, clsidWideString, -1, clsidString, sizeof_array( clsidString ), NULL, NULL ); + err = translate_errno( nChars > 0, (OSStatus) GetLastError(), kUnknownErr ); + CoTaskMemFree( clsidWideString ); + require_noerr( err, exit ); + #endif + + // Register the CLSID entries. + + nChars = GetModuleFileName( inInstance, moduleName, sizeof_array( moduleName ) ); + err = translate_errno( nChars > 0, (OSStatus) GetLastError(), kUnknownErr ); + require_noerr( err, exit ); + + n = sizeof_array( entries ); + for( i = 0; i < n; ++i ) + { + wsprintf( keyName, entries[ i ].subKey, clsidString ); + err = RegCreateKeyEx( entries[ i ].rootKey, keyName, 0, NULL, REG_OPTION_NON_VOLATILE, KEY_WRITE, NULL, &key, NULL ); + require_noerr( err, exit ); + + size = (DWORD)( ( lstrlen( entries[ i ].data ) + 1 ) * sizeof( TCHAR ) ); + err = RegSetValueEx( key, entries[ i ].valueName, 0, REG_SZ, (LPBYTE) entries[ i ].data, size ); + RegCloseKey( key ); + require_noerr( err, exit ); + } + + // If running on NT, register the extension as approved. + + versionInfo.dwOSVersionInfoSize = sizeof( versionInfo ); + GetVersionEx( &versionInfo ); + if( versionInfo.dwPlatformId == VER_PLATFORM_WIN32_NT ) + { + lstrcpyn( keyName, TEXT( "SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Shell Extensions\\Approved" ), sizeof_array( keyName ) ); + err = RegCreateKeyEx( HKEY_LOCAL_MACHINE, keyName, 0, NULL, REG_OPTION_NON_VOLATILE, KEY_WRITE, NULL, &key, NULL ); + require_noerr( err, exit ); + + lstrcpyn( data, inName, sizeof_array( data ) ); + size = (DWORD)( ( lstrlen( data ) + 1 ) * sizeof( TCHAR ) ); + err = RegSetValueEx( key, clsidString, 0, REG_SZ, (LPBYTE) data, size ); + RegCloseKey( key ); + } + + // register toolbar button + lstrcpyn( keyName, TEXT( "SOFTWARE\\Microsoft\\Internet Explorer\\Extensions\\{7F9DB11C-E358-4ca6-A83D-ACC663939424}"), sizeof_array( keyName ) ); + err = RegCreateKeyEx( HKEY_LOCAL_MACHINE, keyName, 0, NULL, REG_OPTION_NON_VOLATILE, KEY_WRITE, NULL, &key, NULL ); + require_noerr( err, exit ); + + lstrcpyn( data, L"Yes", sizeof_array( data ) ); + size = (DWORD)( ( lstrlen( data ) + 1 ) * sizeof( TCHAR ) ); + RegSetValueEx( key, L"Default Visible", 0, REG_SZ, (LPBYTE) data, size ); + + lstrcpyn( data, inName, sizeof_array( data ) ); + size = (DWORD)( ( lstrlen( data ) + 1 ) * sizeof( TCHAR ) ); + RegSetValueEx( key, L"ButtonText", 0, REG_SZ, (LPBYTE) data, size ); + + lstrcpyn( data, L"{E0DD6CAB-2D10-11D2-8F1A-0000F87ABD16}", sizeof_array( data ) ); + size = (DWORD)( ( lstrlen( data ) + 1 ) * sizeof( TCHAR ) ); + RegSetValueEx( key, L"CLSID", 0, REG_SZ, (LPBYTE) data, size ); + + lstrcpyn( data, clsidString, sizeof_array( data ) ); + size = (DWORD)( ( lstrlen( data ) + 1 ) * sizeof( TCHAR ) ); + RegSetValueEx( key, L"BandCLSID", 0, REG_SZ, (LPBYTE) data, size ); + + // check if we're running XP or later + if ( ( versionInfo.dwPlatformId == VER_PLATFORM_WIN32_NT ) && + ( versionInfo.dwMajorVersion == 5 ) && + ( versionInfo.dwMinorVersion >= 1 ) ) + { + wsprintf( data, L"%s,%d", (LPCTSTR) g_nonLocalizedResourcesName, IDI_BUTTON_XP ); + size = (DWORD)( ( lstrlen( data ) + 1 ) * sizeof( TCHAR ) ); + RegSetValueEx( key, L"Icon", 0, REG_SZ, (LPBYTE) data, size); + + wsprintf( data, L"%s,%d", (LPCTSTR) g_nonLocalizedResourcesName, IDI_BUTTON_XP ); + size = (DWORD)( ( lstrlen( data ) + 1 ) * sizeof( TCHAR ) ); + RegSetValueEx( key, L"HotIcon", 0, REG_SZ, (LPBYTE) data, size); + } + else + { + wsprintf( data, L"%s,%d", (LPCTSTR) g_nonLocalizedResourcesName, IDI_BUTTON_2K ); + size = (DWORD)( ( lstrlen( data ) + 1 ) * sizeof( TCHAR ) ); + RegSetValueEx( key, L"Icon", 0, REG_SZ, (LPBYTE) data, size); + + wsprintf( data, L"%s,%d", (LPCTSTR) g_nonLocalizedResourcesName, IDI_BUTTON_2K ); + size = (DWORD)( ( lstrlen( data ) + 1 ) * sizeof( TCHAR ) ); + RegSetValueEx( key, L"HotIcon", 0, REG_SZ, (LPBYTE) data, size); + } + + RegCloseKey( key ); + +exit: + return( err ); +} + +//=========================================================================================================================== +// RegisterCOMCategory +//=========================================================================================================================== + +DEBUG_LOCAL OSStatus RegisterCOMCategory( CLSID inCLSID, CATID inCategoryID, BOOL inRegister ) +{ + HRESULT err; + ICatRegister * cat; + + err = CoInitialize( NULL ); + require( SUCCEEDED( err ), exit ); + + err = CoCreateInstance( CLSID_StdComponentCategoriesMgr, NULL, CLSCTX_INPROC_SERVER, IID_ICatRegister, (LPVOID *) &cat ); + check( SUCCEEDED( err ) ); + if( SUCCEEDED( err ) ) + { + if( inRegister ) + { + err = cat->RegisterClassImplCategories( inCLSID, 1, &inCategoryID ); + check_noerr( err ); + } + else + { + err = cat->UnRegisterClassImplCategories( inCLSID, 1, &inCategoryID ); + check_noerr( err ); + } + cat->Release(); + } + CoUninitialize(); + +exit: + return( err ); +} + + +//=========================================================================================================================== +// UnregisterServer +//=========================================================================================================================== + +DEBUG_LOCAL OSStatus UnregisterServer( CLSID inCLSID ) +{ + OSStatus err = 0; + LPWSTR clsidWideString; + TCHAR clsidString[ 64 ]; + HKEY key; + TCHAR keyName[ MAX_PATH * 2 ]; + OSVERSIONINFO versionInfo; + + // Convert the CLSID to a string based on the encoding of this code (ANSI or Unicode). + + err = StringFromIID( inCLSID, &clsidWideString ); + require_noerr( err, exit ); + require_action( clsidWideString, exit, err = kNoMemoryErr ); + + #ifdef UNICODE + lstrcpyn( clsidString, clsidWideString, sizeof_array( clsidString ) ); + CoTaskMemFree( clsidWideString ); + #else + nChars = WideCharToMultiByte( CP_ACP, 0, clsidWideString, -1, clsidString, sizeof_array( clsidString ), NULL, NULL ); + err = translate_errno( nChars > 0, (OSStatus) GetLastError(), kUnknownErr ); + CoTaskMemFree( clsidWideString ); + require_noerr( err, exit ); + #endif + + wsprintf( keyName, L"CLSID\\%s", clsidString ); + MyRegDeleteKey( HKEY_CLASSES_ROOT, keyName ); + + // If running on NT, de-register the extension as approved. + + versionInfo.dwOSVersionInfoSize = sizeof( versionInfo ); + GetVersionEx( &versionInfo ); + if( versionInfo.dwPlatformId == VER_PLATFORM_WIN32_NT ) + { + lstrcpyn( keyName, TEXT( "SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Shell Extensions\\Approved" ), sizeof_array( keyName ) ); + err = RegCreateKeyEx( HKEY_LOCAL_MACHINE, keyName, 0, NULL, REG_OPTION_NON_VOLATILE, KEY_WRITE, NULL, &key, NULL ); + require_noerr( err, exit ); + + RegDeleteValue( key, clsidString ); + + err = RegCloseKey( key ); + require_noerr( err, exit ); + } + + // de-register toolbar button + + lstrcpyn( keyName, TEXT( "SOFTWARE\\Microsoft\\Internet Explorer\\Extensions\\{7F9DB11C-E358-4ca6-A83D-ACC663939424}"), sizeof_array( keyName ) ); + MyRegDeleteKey( HKEY_LOCAL_MACHINE, keyName ); + +exit: + return( err ); +} + + + +//=========================================================================================================================== +// MyRegDeleteKey +//=========================================================================================================================== + +DEBUG_LOCAL OSStatus MyRegDeleteKey( HKEY hKeyRoot, LPTSTR lpSubKey ) +{ + LPTSTR lpEnd; + OSStatus err; + DWORD dwSize; + TCHAR szName[MAX_PATH]; + HKEY hKey; + FILETIME ftWrite; + + // First, see if we can delete the key without having to recurse. + + err = RegDeleteKey( hKeyRoot, lpSubKey ); + + if ( !err ) + { + goto exit; + } + + err = RegOpenKeyEx( hKeyRoot, lpSubKey, 0, KEY_READ, &hKey ); + require_noerr( err, exit ); + + // Check for an ending slash and add one if it is missing. + + lpEnd = lpSubKey + lstrlen(lpSubKey); + + if ( *( lpEnd - 1 ) != TEXT( '\\' ) ) + { + *lpEnd = TEXT('\\'); + lpEnd++; + *lpEnd = TEXT('\0'); + } + + // Enumerate the keys + + dwSize = MAX_PATH; + err = RegEnumKeyEx(hKey, 0, szName, &dwSize, NULL, NULL, NULL, &ftWrite); + + if ( !err ) + { + do + { + lstrcpy (lpEnd, szName); + + if ( !MyRegDeleteKey( hKeyRoot, lpSubKey ) ) + { + break; + } + + dwSize = MAX_PATH; + + err = RegEnumKeyEx( hKey, 0, szName, &dwSize, NULL, NULL, NULL, &ftWrite ); + + } + while ( !err ); + } + + lpEnd--; + *lpEnd = TEXT('\0'); + + RegCloseKey( hKey ); + + // Try again to delete the key. + + err = RegDeleteKey(hKeyRoot, lpSubKey); + require_noerr( err, exit ); + +exit: + + return err; +} diff --git a/mDNSResponder/Clients/ExplorerPlugin/ExplorerPlugin.def b/mDNSResponder/Clients/ExplorerPlugin/ExplorerPlugin.def new file mode 100644 index 00000000..8b931d10 --- /dev/null +++ b/mDNSResponder/Clients/ExplorerPlugin/ExplorerPlugin.def @@ -0,0 +1,24 @@ +; +; +; Copyright (c) 2003-2004 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 +; +; http://www.apache.org/licenses/LICENSE-2.0 +; +; 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. +; + +LIBRARY ExplorerPlugin + +EXPORTS + DllCanUnloadNow PRIVATE + DllGetClassObject PRIVATE + DllRegisterServer PRIVATE + DllUnregisterServer PRIVATE diff --git a/mDNSResponder/Clients/ExplorerPlugin/ExplorerPlugin.h b/mDNSResponder/Clients/ExplorerPlugin/ExplorerPlugin.h new file mode 100644 index 00000000..9fa56aea --- /dev/null +++ b/mDNSResponder/Clients/ExplorerPlugin/ExplorerPlugin.h @@ -0,0 +1,47 @@ +/* -*- Mode: C; tab-width: 4 -*- + * + * Copyright (c) 2003-2004 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 + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * 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. + */ + +#pragma once + +//=========================================================================================================================== +// Globals +//=========================================================================================================================== + +// {9999A076-A9E2-4c99-8A2B-632FC9429223} +DEFINE_GUID(CLSID_ExplorerBar, + 0x9999a076, 0xa9e2, 0x4c99, 0x8a, 0x2b, 0x63, 0x2f, 0xc9, 0x42, 0x92, 0x23); + +extern HINSTANCE gInstance; +extern int gDLLRefCount; +extern HINSTANCE GetNonLocalizedResources(); +extern HINSTANCE GetLocalizedResources(); + + +class CExplorerPluginApp : public CWinApp +{ +public: + +CExplorerPluginApp(); +virtual ~CExplorerPluginApp(); + +protected: + +virtual BOOL InitInstance(); +virtual int ExitInstance(); + +DECLARE_DYNAMIC(CExplorerPluginApp); +}; diff --git a/mDNSResponder/Clients/ExplorerPlugin/ExplorerPlugin.rc b/mDNSResponder/Clients/ExplorerPlugin/ExplorerPlugin.rc new file mode 100644 index 00000000..03320d5c --- /dev/null +++ b/mDNSResponder/Clients/ExplorerPlugin/ExplorerPlugin.rc @@ -0,0 +1,122 @@ +// Microsoft Visual C++ generated resource script. +// +#include "resource_dll.h" + +#define APSTUDIO_READONLY_SYMBOLS +///////////////////////////////////////////////////////////////////////////// +// +// Generated from the TEXTINCLUDE 2 resource. +// +#include "afxres.h" +#include "WinVersRes.h" + +///////////////////////////////////////////////////////////////////////////// +#undef APSTUDIO_READONLY_SYMBOLS + +///////////////////////////////////////////////////////////////////////////// +// English (U.S.) resources + +#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU) +#ifdef _WIN32 +LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US +#pragma code_page(1252) +#endif //_WIN32 + +#ifdef APSTUDIO_INVOKED +///////////////////////////////////////////////////////////////////////////// +// +// TEXTINCLUDE +// + +1 TEXTINCLUDE +BEGIN + "resource_dll.h\0" +END + +2 TEXTINCLUDE +BEGIN + "#include ""afxres.h""\r\n" + "#include ""WinVersRes.h""\r\n" + "\0" +END + +3 TEXTINCLUDE +BEGIN + "#define _AFX_NO_SPLITTER_RESOURCES\r\n" + "#define _AFX_NO_OLE_RESOURCES\r\n" + "#define _AFX_NO_TRACKER_RESOURCES\r\n" + "#define _AFX_NO_PROPERTY_RESOURCES\r\n" + "\r\n" + "#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU)\r\n" + "LANGUAGE 9, 1\r\n" + "#pragma code_page(1252)\r\n" + "#include ""afxres.rc"" // Standard components\r\n" + "#endif\r\n" + "\0" +END + +#endif // APSTUDIO_INVOKED + + +///////////////////////////////////////////////////////////////////////////// +// +// Version +// + +VS_VERSION_INFO VERSIONINFO + FILEVERSION MASTER_PROD_VERS + PRODUCTVERSION MASTER_PROD_VERS + FILEFLAGSMASK 0x3fL +#ifdef _DEBUG + FILEFLAGS 0x1L +#else + FILEFLAGS 0x0L +#endif + FILEOS 0x4L + FILETYPE 0x2L + FILESUBTYPE 0x0L +BEGIN + BLOCK "StringFileInfo" + BEGIN + BLOCK "040904b0" + BEGIN + VALUE "CompanyName", MASTER_COMPANY_NAME + VALUE "FileDescription", "Bonjour Explorer Bar" + VALUE "FileVersion", MASTER_PROD_VERS_STR + VALUE "InternalName", "ExplorerPlugin.dll" + VALUE "LegalCopyright", MASTER_LEGAL_COPYRIGHT + VALUE "OriginalFilename", "ExplorerPlugin.dll" + VALUE "ProductName", MASTER_PROD_NAME + VALUE "ProductVersion", MASTER_PROD_VERS_STR + END + END + BLOCK "VarFileInfo" + BEGIN + VALUE "Translation", 0x409, 1200 + END +END + +#endif // English (U.S.) resources +///////////////////////////////////////////////////////////////////////////// + + + +#ifndef APSTUDIO_INVOKED +///////////////////////////////////////////////////////////////////////////// +// +// Generated from the TEXTINCLUDE 3 resource. +// +#define _AFX_NO_SPLITTER_RESOURCES +#define _AFX_NO_OLE_RESOURCES +#define _AFX_NO_TRACKER_RESOURCES +#define _AFX_NO_PROPERTY_RESOURCES + +#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU) +LANGUAGE 9, 1 +#pragma code_page(1252) +#include "afxres.rc" // Standard components +#endif + +///////////////////////////////////////////////////////////////////////////// +#endif // not APSTUDIO_INVOKED + diff --git a/mDNSResponder/Clients/ExplorerPlugin/ExplorerPlugin.vcproj b/mDNSResponder/Clients/ExplorerPlugin/ExplorerPlugin.vcproj new file mode 100644 index 00000000..c157cfb2 --- /dev/null +++ b/mDNSResponder/Clients/ExplorerPlugin/ExplorerPlugin.vcproj @@ -0,0 +1,595 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/mDNSResponder/Clients/ExplorerPlugin/ExplorerPlugin.vcxproj b/mDNSResponder/Clients/ExplorerPlugin/ExplorerPlugin.vcxproj new file mode 100755 index 00000000..810c90e1 --- /dev/null +++ b/mDNSResponder/Clients/ExplorerPlugin/ExplorerPlugin.vcxproj @@ -0,0 +1,402 @@ + + + + + Debug + Win32 + + + Debug + x64 + + + Release + Win32 + + + Release + x64 + + + Template + Win32 + + + Template + x64 + + + + {BB8AC1B5-6587-4163-BDC6-788B157705CA} + + + + DynamicLibrary + Static + Unicode + + + DynamicLibrary + Static + Unicode + + + Application + + + DynamicLibrary + Static + Unicode + + + DynamicLibrary + Static + Unicode + + + + + + + + + + + + + + + + + + + + + + + + + + <_ProjectFileVersion>10.0.30319.1 + $(Platform)\$(Configuration)\ + $(Platform)\$(Configuration)\ + false + $(Platform)\$(Configuration)\ + $(Platform)\$(Configuration)\ + false + $(Platform)\$(Configuration)\ + $(Platform)\$(Configuration)\ + false + $(Platform)\$(Configuration)\ + $(Platform)\$(Configuration)\ + false + + + + + + + + %(Outputs) + + + _DEBUG;%(PreprocessorDefinitions) + true + true + Win32 + $(OutDir)$(ProjectName).tlb + + + Disabled + ..\..\mDNSShared;..\..\mDNSWindows;%(AdditionalIncludeDirectories) + _USRDLL;WIN32;_DEBUG;_WINDOWS;DEBUG=1;ENABLE_DOT_LOCAL_NAMES;WINVER=0x0501;_CRT_SECURE_NO_DEPRECATE;_CRT_SECURE_CPP_OVERLOAD_STANDARD_NAMES=1;%(PreprocessorDefinitions) + true + EnableFastChecks + MultiThreadedDebug + true + true + + + + + $(IntDir) + $(IntDir) + $(IntDir)vc80.pdb + true + Level4 + false + true + ProgramDatabase + StdCall + Default + + + _DEBUG;%(PreprocessorDefinitions) + 0x0409 + ../../mDNSWindows;%(AdditionalIncludeDirectories) + + + /MACHINE:I386 /IGNORE:4089 /NXCOMPAT /DYNAMICBASE /SAFESEH %(AdditionalOptions) + ../../mDNSWindows/DLLStub/$(Platform)/$(Configuration)/dnssdStatic.lib;uafxcwd.lib;ws2_32.lib;%(AdditionalDependencies) + $(OutDir)ExplorerPlugin.dll + true + uafxcwd.lib;%(IgnoreSpecificDefaultLibraries) + ./$(ProjectName).def + true + $(OutDir)$(ProjectName).pdb + Windows + $(OutDir)$(ProjectName).lib + + + res\ExplorerPlugin.manifest;%(AdditionalManifestFiles) + + + + + + + + + %(Outputs) + + + _DEBUG;%(PreprocessorDefinitions) + true + true + X64 + $(OutDir)$(ProjectName).tlb + + + Disabled + ..\..\mDNSShared;..\..\mDNSWindows;%(AdditionalIncludeDirectories) + _USRDLL;WIN32;_DEBUG;_WINDOWS;DEBUG=1;ENABLE_DOT_LOCAL_NAMES;WINVER=0x0501;_CRT_SECURE_NO_DEPRECATE;_CRT_SECURE_CPP_OVERLOAD_STANDARD_NAMES=1;%(PreprocessorDefinitions) + true + EnableFastChecks + MultiThreadedDebug + true + true + + + + + $(IntDir) + $(IntDir) + $(IntDir)vc80.pdb + true + Level4 + false + true + ProgramDatabase + StdCall + Default + + + _DEBUG;%(PreprocessorDefinitions) + 0x0409 + ../../mDNSWindows;%(AdditionalIncludeDirectories) + + + /IGNORE:4089 /NXCOMPAT /DYNAMICBASE %(AdditionalOptions) + ../../mDNSWindows/DLLStub/$(Platform)/$(Configuration)/dnssdStatic.lib;uafxcwd.lib;ws2_32.lib;%(AdditionalDependencies) + $(OutDir)ExplorerPlugin.dll + true + uafxcwd.lib;%(IgnoreSpecificDefaultLibraries) + ./$(ProjectName).def + true + $(OutDir)$(ProjectName).pdb + Windows + $(OutDir)$(ProjectName).lib + MachineX64 + + + res\ExplorerPlugin64.manifest;%(AdditionalManifestFiles) + + + + + + + + + NDEBUG;%(PreprocessorDefinitions) + true + true + Win32 + $(OutDir)$(ProjectName).tlb + + + MaxSpeed + AnySuitable + Size + true + ..\..\mDNSShared;..\..\mDNSWindows;%(AdditionalIncludeDirectories) + _USRDLL;WIN32;NDEBUG;_WINDOWS;WINVER=0x0501;_CRT_SECURE_NO_DEPRECATE;_CRT_SECURE_CPP_OVERLOAD_STANDARD_NAMES=1;%(PreprocessorDefinitions) + true + MultiThreaded + true + false + true + + + + + $(IntDir) + $(IntDir) + $(IntDir)vc80.pdb + true + Level4 + false + true + Default + + + NDEBUG;%(PreprocessorDefinitions) + 0x0409 + ../../mDNSWindows;%(AdditionalIncludeDirectories) + + + /MACHINE:I386 /IGNORE:4089 /NXCOMPAT /DYNAMICBASE /SAFESEH %(AdditionalOptions) + ../../mDNSWindows/DLLStub/$(Platform)/$(Configuration)/dnssdStatic.lib;ws2_32.lib;uafxcw.lib;%(AdditionalDependencies) + $(OutDir)$(ProjectName).dll + true + uafxcw.lib;%(IgnoreSpecificDefaultLibraries) + ./$(ProjectName).def + true + $(IntDir)$(ProjectName).pdb + Windows + + + + + $(IntDir)$(ProjectName).lib + + + res\ExplorerPlugin.manifest;%(AdditionalManifestFiles) + + + if not "%RC_XBS%" == "YES" goto END +if not exist "$(DSTROOT)\Program Files\Bonjour SDK\bin\$(Platform)" mkdir "$(DSTROOT)\Program Files\Bonjour SDK\bin\$(Platform)" +xcopy /I/Y "$(TargetPath)" "$(DSTROOT)\Program Files\Bonjour SDK\bin\$(Platform)" +:END + + + + + + + + + + NDEBUG;%(PreprocessorDefinitions) + true + true + X64 + $(OutDir)$(ProjectName).tlb + + + MaxSpeed + AnySuitable + Size + true + ..\..\mDNSShared;..\..\mDNSWindows;%(AdditionalIncludeDirectories) + _USRDLL;WIN32;NDEBUG;_WINDOWS;WINVER=0x0501;_CRT_SECURE_NO_DEPRECATE;_CRT_SECURE_CPP_OVERLOAD_STANDARD_NAMES=1;%(PreprocessorDefinitions) + true + MultiThreaded + true + false + true + + + + + $(IntDir) + $(IntDir) + $(IntDir)vc80.pdb + true + Level4 + false + true + Default + + + NDEBUG;%(PreprocessorDefinitions) + 0x0409 + ../../mDNSWindows;%(AdditionalIncludeDirectories) + + + /IGNORE:4089 /NXCOMPAT /DYNAMICBASE %(AdditionalOptions) + ../../mDNSWindows/DLLStub/$(Platform)/$(Configuration)/dnssdStatic.lib;ws2_32.lib;uafxcw.lib;%(AdditionalDependencies) + $(OutDir)$(ProjectName).dll + true + uafxcw.lib;%(IgnoreSpecificDefaultLibraries) + ./$(ProjectName).def + true + $(IntDir)$(ProjectName).pdb + Windows + + + + + $(IntDir)$(ProjectName).lib + MachineX64 + + + res\ExplorerPlugin64.manifest;%(AdditionalManifestFiles) + + + if not "%RC_XBS%" == "YES" goto END +if not exist "$(DSTROOT)\Program Files\Bonjour SDK\bin\$(Platform)" mkdir "$(DSTROOT)\Program Files\Bonjour SDK\bin\$(Platform)" +xcopy /I/Y "$(TargetPath)" "$(DSTROOT)\Program Files\Bonjour SDK\bin\$(Platform)" +:END + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + {3a2b6325-3053-4236-84bd-aa9be2e323e5} + false + + + + + + + + + + + \ No newline at end of file diff --git a/mDNSResponder/Clients/ExplorerPlugin/ExplorerPlugin.vcxproj.filters b/mDNSResponder/Clients/ExplorerPlugin/ExplorerPlugin.vcxproj.filters new file mode 100755 index 00000000..f86a9f56 --- /dev/null +++ b/mDNSResponder/Clients/ExplorerPlugin/ExplorerPlugin.vcxproj.filters @@ -0,0 +1,106 @@ + + + + + {b3978812-899a-4e8b-9f75-9458141da3b4} + + + {62896a08-c5fd-4a48-8f8b-33f3fc2f8b1f} + cpp;c;cxx;def;odl;idl;hpj;bat;asm + + + {8aded36a-5c99-4074-8892-31cb394d0eed} + h;hpp;hxx;hm;inl;inc + + + {31823db1-cc70-4c1b-990d-ad0e8f840b66} + rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;jpg;jpeg;jpe;manifest + + + + + Support + + + Support + + + Support + + + Support + + + Support + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + + + Support + + + Support + + + Support + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + + + Source Files + + + + + Resource Files + + + \ No newline at end of file diff --git a/mDNSResponder/Clients/ExplorerPlugin/ExplorerPluginLocRes.rc b/mDNSResponder/Clients/ExplorerPlugin/ExplorerPluginLocRes.rc new file mode 100755 index 00000000..9f4c4f5b --- /dev/null +++ b/mDNSResponder/Clients/ExplorerPlugin/ExplorerPluginLocRes.rc @@ -0,0 +1,213 @@ +// Microsoft Visual C++ generated resource script. +// +#include "resource_loc_res.h" + +#define APSTUDIO_READONLY_SYMBOLS +///////////////////////////////////////////////////////////////////////////// +// +// Generated from the TEXTINCLUDE 2 resource. +// +#include "afxres.h" +#include "WinVersRes.h" + +///////////////////////////////////////////////////////////////////////////// +#undef APSTUDIO_READONLY_SYMBOLS + +///////////////////////////////////////////////////////////////////////////// +// English (U.S.) resources + +#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU) +#ifdef _WIN32 +LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US +#pragma code_page(1252) +#endif //_WIN32 + +#ifdef APSTUDIO_INVOKED +///////////////////////////////////////////////////////////////////////////// +// +// TEXTINCLUDE +// + +1 TEXTINCLUDE +BEGIN + "resource_loc_res.h\0" +END + +2 TEXTINCLUDE +BEGIN + "#include ""afxres.h""\r\n" + "#include ""WinVersRes.h""\r\n" + "\0" +END + +3 TEXTINCLUDE +BEGIN + "#define _AFX_NO_SPLITTER_RESOURCES\r\n" + "#define _AFX_NO_OLE_RESOURCES\r\n" + "#define _AFX_NO_TRACKER_RESOURCES\r\n" + "#define _AFX_NO_PROPERTY_RESOURCES\r\n" + "\r\n" + "#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU)\r\n" + "LANGUAGE 9, 1\r\n" + "#pragma code_page(1252)\r\n" + "#include ""afxres.rc"" // Standard components\r\n" + "#endif\r\n" + "\0" +END + +#endif // APSTUDIO_INVOKED + + +///////////////////////////////////////////////////////////////////////////// +// +// Version +// + +VS_VERSION_INFO VERSIONINFO + FILEVERSION MASTER_PROD_VERS + PRODUCTVERSION MASTER_PROD_VERS + FILEFLAGSMASK 0x3fL +#ifdef _DEBUG + FILEFLAGS 0x1L +#else + FILEFLAGS 0x0L +#endif + FILEOS 0x4L + FILETYPE 0x2L + FILESUBTYPE 0x0L +BEGIN + BLOCK "StringFileInfo" + BEGIN + BLOCK "040904b0" + BEGIN + VALUE "CompanyName", MASTER_COMPANY_NAME + VALUE "FileDescription", "Bonjour Resource Module" + VALUE "FileVersion", MASTER_PROD_VERS_STR + VALUE "InternalName", "ExplorerPluginLocalized.dll" + VALUE "LegalCopyright", MASTER_LEGAL_COPYRIGHT + VALUE "OriginalFilename", "ExplorerPluginLocalized.dll" + VALUE "ProductName", MASTER_PROD_NAME + VALUE "ProductVersion", MASTER_PROD_VERS_STR + END + END + BLOCK "VarFileInfo" + BEGIN + VALUE "Translation", 0x409, 1200 + END +END + + +///////////////////////////////////////////////////////////////////////////// +// +// Dialog +// + +IDD_LOGIN DIALOGEX 0, 0, 180, 89 +STYLE DS_SETFONT | DS_MODALFRAME | DS_FIXEDSYS | WS_POPUP | WS_CAPTION +CAPTION "Login" +FONT 8, "MS Shell Dlg", 0, 0, 0x0 +BEGIN + LTEXT "Enter a username and password. Leave blank to use the default username and/or password.", + IDC_STATIC,8,8,156,16,NOT WS_GROUP + RTEXT "Username:",IDC_STATIC,10,34,36,8,NOT WS_GROUP + EDITTEXT IDC_LOGIN_USERNAME_TEXT,50,32,118,12,ES_AUTOHSCROLL + RTEXT "Password:",IDC_STATIC,10,50,36,8,NOT WS_GROUP + EDITTEXT IDC_LOGIN_PASSWORD_TEXT,50,48,118,12,ES_PASSWORD | + ES_AUTOHSCROLL + DEFPUSHBUTTON "OK",IDOK,129,70,44,14 + PUSHBUTTON "Cancel",IDCANCEL,77,70,44,14 +END + +IDD_ABOUT DIALOGEX 0, 0, 219, 87 +STYLE DS_SETFONT | DS_FIXEDSYS | WS_POPUP | WS_CAPTION | WS_SYSMENU +EXSTYLE WS_EX_RTLREADING | WS_EX_LEFTSCROLLBAR +CAPTION "About Bonjour" +FONT 8, "MS Shell Dlg", 400, 0, 0x1 +BEGIN + CONTROL "",IDC_ABOUT_BACKGROUND,"Static",SS_BITMAP | SS_REALSIZEIMAGE,0,0, + 220,86 + CONTROL "Explorer Plugin",IDC_COMPONENT,"Static", + SS_SIMPLE | WS_GROUP,92,10,122,8 + CONTROL "",IDC_COMPONENT_VERSION,"Static", + SS_SIMPLE | WS_GROUP,142,10,122,8 + LTEXT "Copyright (c) 2004-2007 Apple Inc. All rights reserved. Apple and the Apple logo are trademarks of Apple Inc., registered in the U.S. and other countries.", + IDC_LEGAL,92,31,123,50,0 +END + + +///////////////////////////////////////////////////////////////////////////// +// +// DESIGNINFO +// + +#ifdef APSTUDIO_INVOKED +GUIDELINES DESIGNINFO +BEGIN + IDD_LOGIN, DIALOG + BEGIN + BOTTOMMARGIN, 62 + END + + IDD_ABOUT, DIALOG + BEGIN + BOTTOMMARGIN, 132 + END +END +#endif // APSTUDIO_INVOKED + + +///////////////////////////////////////////////////////////////////////////// +// +// Menu +// + +IDR_CONTEXT_MENU MENU +BEGIN + POPUP "ContextMenu" + BEGIN + MENUITEM "About Bonjour...", ID_Menu + MENUITEM SEPARATOR + END +END + + +///////////////////////////////////////////////////////////////////////////// +// +// String Table +// + +STRINGTABLE +BEGIN + IDS_ABOUT "About Bonjour" + IDS_ABOUT_URL "http://www.apple.com/macosx/features/bonjour" + IDS_NAME "Bonjour" + IDS_WEB_SITES "Web Sites" + IDS_PRINTERS "Printers" + IDS_MDNSRESPONDER_NOT_AVAILABLE "Bonjour Service is not available." + IDS_FIREWALL "Check firewall settings" +END + +#endif // English (U.S.) resources +///////////////////////////////////////////////////////////////////////////// + + + +#ifndef APSTUDIO_INVOKED +///////////////////////////////////////////////////////////////////////////// +// +// Generated from the TEXTINCLUDE 3 resource. +// +#define _AFX_NO_SPLITTER_RESOURCES +#define _AFX_NO_OLE_RESOURCES +#define _AFX_NO_TRACKER_RESOURCES +#define _AFX_NO_PROPERTY_RESOURCES + +#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU) +LANGUAGE 9, 1 +#pragma code_page(1252) +#include "afxres.rc" // Standard components +#endif + +///////////////////////////////////////////////////////////////////////////// +#endif // not APSTUDIO_INVOKED + diff --git a/mDNSResponder/Clients/ExplorerPlugin/ExplorerPluginLocRes.vcproj b/mDNSResponder/Clients/ExplorerPlugin/ExplorerPluginLocRes.vcproj new file mode 100755 index 00000000..f354cf2a --- /dev/null +++ b/mDNSResponder/Clients/ExplorerPlugin/ExplorerPluginLocRes.vcproj @@ -0,0 +1,487 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/mDNSResponder/Clients/ExplorerPlugin/ExplorerPluginLocRes.vcxproj b/mDNSResponder/Clients/ExplorerPlugin/ExplorerPluginLocRes.vcxproj new file mode 100755 index 00000000..fb96fd3b --- /dev/null +++ b/mDNSResponder/Clients/ExplorerPlugin/ExplorerPluginLocRes.vcxproj @@ -0,0 +1,397 @@ + + + + + Debug + Win32 + + + Debug + x64 + + + Release + Win32 + + + Release + x64 + + + Template + Win32 + + + Template + x64 + + + + {1643427B-F226-4AD6-B413-97DA64D5C6B4} + ExplorerPluginLocRes + + + + DynamicLibrary + Static + Unicode + + + DynamicLibrary + Static + Unicode + + + Application + + + DynamicLibrary + Static + Unicode + + + DynamicLibrary + Static + Unicode + + + + + + + + + + + + + + + + + + + + + + + + + + <_ProjectFileVersion>10.0.30319.1 + $(Platform)\$(Configuration)\ExplorerPlugin.Resources\en.lproj\ + $(Platform)\$(Configuration)\ + false + $(Platform)\$(Configuration)\ExplorerPlugin.Resources\en.lproj\ + $(Platform)\$(Configuration)\ + false + $(Platform)\$(Configuration)\ExplorerPlugin.Resources\en.lproj\ + $(Platform)\$(Configuration)\ + false + $(Platform)\$(Configuration)\ExplorerPlugin.Resources\en.lproj\ + $(Platform)\$(Configuration)\ + false + ExplorerPluginLocalized + .dll + ExplorerPluginLocalized + .dll + ExplorerPluginLocalized + .dll + ExplorerPluginLocalized + .dll + ExplorerPluginLocalized + .dll + ExplorerPluginLocalized + .dll + $(Platform)\$(Configuration)\ExplorerPlugin.Resources\en.lproj\ + $(Platform)\$(Configuration)\ + $(Platform)\$(Configuration)\ExplorerPlugin.Resources\en.lproj\ + $(Platform)\$(Configuration)\ + + + + _DEBUG;%(PreprocessorDefinitions) + true + true + Win32 + $(OutDir)$(ProjectName).tlb + + + Disabled + ..\..\mDNSWindows;%(AdditionalIncludeDirectories) + WIN32;_DEBUG;_WINDOWS;DEBUG=1;ENABLE_DOT_LOCAL_NAMES;WINVER=0x0400;%(PreprocessorDefinitions) + true + EnableFastChecks + MultiThreadedDebug + true + + + + + .\Debug/ + .\Debug/ + .\Debug/ + true + Level4 + false + true + ProgramDatabase + StdCall + Default + + + _DEBUG;%(PreprocessorDefinitions) + 0x0409 + ../../mDNSWindows;%(AdditionalIncludeDirectories) + + + Building Output Directories + if not exist $(OutDir)ExplorerPlugin.Resources mkdir $(OutDir)ExplorerPlugin.Resources +if not exist $(OutDir)ExplorerPlugin.Resources\en.lproj mkdir $(OutDir)ExplorerPlugin.Resources\en.lproj + + + + /MACHINE:I386 /IGNORE:4089 %(AdditionalOptions) + %(AdditionalDependencies) + $(OutDir)ExplorerPluginLocalized.dll + true + %(IgnoreSpecificDefaultLibraries) + + + true + $(OutDir)$(ProjectName).pdb + Windows + true + $(OutDir)$(ProjectName).lib + + + + + _DEBUG;%(PreprocessorDefinitions) + true + true + X64 + $(OutDir)$(ProjectName).tlb + + + Disabled + ..\..\mDNSWindows;%(AdditionalIncludeDirectories) + WIN32;_DEBUG;_WINDOWS;DEBUG=1;ENABLE_DOT_LOCAL_NAMES;WINVER=0x0400;%(PreprocessorDefinitions) + true + EnableFastChecks + MultiThreadedDebug + true + + + + + .\Debug/ + .\Debug/ + .\Debug/ + true + Level4 + false + true + ProgramDatabase + StdCall + Default + + + _DEBUG;%(PreprocessorDefinitions) + 0x0409 + ../../mDNSWindows;%(AdditionalIncludeDirectories) + + + Building Output Directories + if not exist $(OutDir)ExplorerPlugin.Resources mkdir $(OutDir)ExplorerPlugin.Resources +if not exist $(OutDir)ExplorerPlugin.Resources\en.lproj mkdir $(OutDir)ExplorerPlugin.Resources\en.lproj + + + + /MACHINE:I386 /IGNORE:4089 %(AdditionalOptions) + %(AdditionalDependencies) + $(OutDir)ExplorerPluginLocalized.dll + true + %(IgnoreSpecificDefaultLibraries) + + + true + $(OutDir)$(ProjectName).pdb + Windows + true + $(OutDir)$(ProjectName).lib + MachineX64 + + + + + NDEBUG;%(PreprocessorDefinitions) + true + true + Win32 + $(OutDir)$(ProjectName).tlb + + + MaxSpeed + AnySuitable + Size + true + ..\..\mDNSWindows;%(AdditionalIncludeDirectories) + WIN32;NDEBUG;_WINDOWS;WINVER=0x0400;%(PreprocessorDefinitions) + true + MultiThreaded + false + false + true + + + + + .\Release/ + .\Release/ + .\Release/ + true + Level4 + false + true + Default + + + NDEBUG;%(PreprocessorDefinitions) + 0x0409 + ../../mDNSWindows;%(AdditionalIncludeDirectories) + + + Building Output Directories + if not exist $(OutDir)ExplorerPlugin.Resources mkdir $(OutDir)ExplorerPlugin.Resources +if not exist $(OutDir)ExplorerPlugin.Resources\en.lproj mkdir $(OutDir)ExplorerPlugin.Resources\en.lproj + + + + /MACHINE:I386 /IGNORE:4089 %(AdditionalOptions) + %(AdditionalDependencies) + $(OutDir)ExplorerPluginLocalized.dll + true + %(IgnoreSpecificDefaultLibraries) + + + + + Windows + + + + + true + $(IntDir)$(ProjectName).lib + + + if not "%RC_XBS%" == "YES" goto END +if not exist "$(DSTROOT)\Program Files\Bonjour SDK\bin\$(Platform)\ExplorerPlugin.Resources\en.lproj" mkdir "$(DSTROOT)\Program Files\Bonjour SDK\bin\$(Platform)\ExplorerPlugin.Resources\en.lproj" +xcopy /I/Y "$(TargetPath)" "$(DSTROOT)\Program Files\Bonjour SDK\bin\$(Platform)\ExplorerPlugin.Resources\en.lproj" +:END + + + + + + NDEBUG;%(PreprocessorDefinitions) + true + true + X64 + $(OutDir)$(ProjectName).tlb + + + MaxSpeed + AnySuitable + Size + true + ..\..\mDNSWindows;%(AdditionalIncludeDirectories) + WIN32;NDEBUG;_WINDOWS;WINVER=0x0400;%(PreprocessorDefinitions) + true + MultiThreaded + false + false + true + + + + + .\Release/ + .\Release/ + .\Release/ + true + Level4 + false + true + Default + + + NDEBUG;%(PreprocessorDefinitions) + 0x0409 + ../../mDNSWindows;%(AdditionalIncludeDirectories) + + + Building Output Directories + if not exist $(OutDir)ExplorerPlugin.Resources mkdir $(OutDir)ExplorerPlugin.Resources +if not exist $(OutDir)ExplorerPlugin.Resources\en.lproj mkdir $(OutDir)ExplorerPlugin.Resources\en.lproj + + + + /MACHINE:I386 /IGNORE:4089 %(AdditionalOptions) + %(AdditionalDependencies) + $(OutDir)ExplorerPluginLocalized.dll + true + %(IgnoreSpecificDefaultLibraries) + + + + + Windows + + + + + true + $(IntDir)$(ProjectName).lib + MachineX64 + + + if not "%RC_XBS%" == "YES" goto END +if not exist "$(DSTROOT)\Program Files\Bonjour SDK\bin\$(Platform)\ExplorerPlugin.Resources\en.lproj" mkdir "$(DSTROOT)\Program Files\Bonjour SDK\bin\$(Platform)\ExplorerPlugin.Resources\en.lproj" +xcopy /I/Y "$(TargetPath)" "$(DSTROOT)\Program Files\Bonjour SDK\bin\$(Platform)\ExplorerPlugin.Resources\en.lproj" +:END + + + + + + $(OutDir)ExplorerPluginLocalized.dll + + + + + $(OutDir)ExplorerPluginLocalized.dll + + + + + + + + + + + {ab581101-18f0-46f6-b56a-83a6b1ea657e} + false + + + + + + + + + + + \ No newline at end of file diff --git a/mDNSResponder/Clients/ExplorerPlugin/ExplorerPluginLocRes.vcxproj.filters b/mDNSResponder/Clients/ExplorerPlugin/ExplorerPluginLocRes.vcxproj.filters new file mode 100755 index 00000000..c2dd2ad9 --- /dev/null +++ b/mDNSResponder/Clients/ExplorerPlugin/ExplorerPluginLocRes.vcxproj.filters @@ -0,0 +1,23 @@ + + + + + {fdb2f45e-acf9-4bf2-87a1-fb0df2aca928} + h;hpp;hxx;hm;inl;inc + + + {ee265e77-1d8e-4a0c-8c10-27b123ab1232} + rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;jpg;jpeg;jpe;manifest + + + + + Header Files + + + + + Resource Files + + + \ No newline at end of file diff --git a/mDNSResponder/Clients/ExplorerPlugin/ExplorerPluginRes.rc b/mDNSResponder/Clients/ExplorerPlugin/ExplorerPluginRes.rc new file mode 100755 index 00000000..bf0d64ca --- /dev/null +++ b/mDNSResponder/Clients/ExplorerPlugin/ExplorerPluginRes.rc @@ -0,0 +1,140 @@ +// Microsoft Visual C++ generated resource script. +// +#include "resource_res.h" + +#define APSTUDIO_READONLY_SYMBOLS +///////////////////////////////////////////////////////////////////////////// +// +// Generated from the TEXTINCLUDE 2 resource. +// +#include "afxres.h" +#include "WinVersRes.h" + +///////////////////////////////////////////////////////////////////////////// +#undef APSTUDIO_READONLY_SYMBOLS + +///////////////////////////////////////////////////////////////////////////// +// English (U.S.) resources + +#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU) +#ifdef _WIN32 +LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US +#pragma code_page(1252) +#endif //_WIN32 + +#ifdef APSTUDIO_INVOKED +///////////////////////////////////////////////////////////////////////////// +// +// TEXTINCLUDE +// + +1 TEXTINCLUDE +BEGIN + "resource_res.h\0" +END + +2 TEXTINCLUDE +BEGIN + "#include ""afxres.h""\r\n" + "#include ""WinVersRes.h""\r\n" + "\0" +END + +3 TEXTINCLUDE +BEGIN + "#define _AFX_NO_SPLITTER_RESOURCES\r\n" + "#define _AFX_NO_OLE_RESOURCES\r\n" + "#define _AFX_NO_TRACKER_RESOURCES\r\n" + "#define _AFX_NO_PROPERTY_RESOURCES\r\n" + "\r\n" + "#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU)\r\n" + "LANGUAGE 9, 1\r\n" + "#pragma code_page(1252)\r\n" + "#include ""afxres.rc"" // Standard components\r\n" + "#endif\r\n" + "\0" +END + +#endif // APSTUDIO_INVOKED + + +///////////////////////////////////////////////////////////////////////////// +// +// Version +// + +VS_VERSION_INFO VERSIONINFO + FILEVERSION MASTER_PROD_VERS + PRODUCTVERSION MASTER_PROD_VERS + FILEFLAGSMASK 0x3fL +#ifdef _DEBUG + FILEFLAGS 0x1L +#else + FILEFLAGS 0x0L +#endif + FILEOS 0x4L + FILETYPE 0x2L + FILESUBTYPE 0x0L +BEGIN + BLOCK "StringFileInfo" + BEGIN + BLOCK "040904b0" + BEGIN + VALUE "CompanyName", MASTER_COMPANY_NAME + VALUE "FileDescription", "Bonjour Resource Module" + VALUE "FileVersion", MASTER_PROD_VERS_STR + VALUE "InternalName", "ExplorerPluginResources.dll" + VALUE "LegalCopyright", MASTER_LEGAL_COPYRIGHT + VALUE "OriginalFilename", "ExplorerPluginResources.dll" + VALUE "ProductName", MASTER_PROD_NAME + VALUE "ProductVersion", MASTER_PROD_VERS_STR + END + END + BLOCK "VarFileInfo" + BEGIN + VALUE "Translation", 0x409, 1200 + END +END + + +///////////////////////////////////////////////////////////////////////////// +// +// Bitmap +// + +IDB_LOGO BITMAP "res\\logo.bmp" +IDB_ABOUT BITMAP "res\\about.bmp" + +///////////////////////////////////////////////////////////////////////////// +// +// Icon +// + +// Icon with lowest ID value placed first to ensure application icon +// remains consistent on all systems. +IDI_BUTTON_2K ICON "res\\button-2k.ico" +IDI_BUTTON_XP ICON "res\\button-xp.ico" +#endif // English (U.S.) resources +///////////////////////////////////////////////////////////////////////////// + + + +#ifndef APSTUDIO_INVOKED +///////////////////////////////////////////////////////////////////////////// +// +// Generated from the TEXTINCLUDE 3 resource. +// +#define _AFX_NO_SPLITTER_RESOURCES +#define _AFX_NO_OLE_RESOURCES +#define _AFX_NO_TRACKER_RESOURCES +#define _AFX_NO_PROPERTY_RESOURCES + +#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU) +LANGUAGE 9, 1 +#pragma code_page(1252) +#include "afxres.rc" // Standard components +#endif + +///////////////////////////////////////////////////////////////////////////// +#endif // not APSTUDIO_INVOKED + diff --git a/mDNSResponder/Clients/ExplorerPlugin/ExplorerPluginRes.vcproj b/mDNSResponder/Clients/ExplorerPlugin/ExplorerPluginRes.vcproj new file mode 100755 index 00000000..6b940ac8 --- /dev/null +++ b/mDNSResponder/Clients/ExplorerPlugin/ExplorerPluginRes.vcproj @@ -0,0 +1,518 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/mDNSResponder/Clients/ExplorerPlugin/ExplorerPluginRes.vcxproj b/mDNSResponder/Clients/ExplorerPlugin/ExplorerPluginRes.vcxproj new file mode 100755 index 00000000..4fb64902 --- /dev/null +++ b/mDNSResponder/Clients/ExplorerPlugin/ExplorerPluginRes.vcxproj @@ -0,0 +1,399 @@ + + + + + Debug + Win32 + + + Debug + x64 + + + Release + Win32 + + + Release + x64 + + + Template + Win32 + + + Template + x64 + + + + {871B1492-B4A4-4B57-9237-FA798484D7D7} + + + + DynamicLibrary + Static + Unicode + + + DynamicLibrary + Static + Unicode + + + Application + + + DynamicLibrary + Static + Unicode + + + DynamicLibrary + Static + Unicode + + + + + + + + + + + + + + + + + + + + + + + + + + <_ProjectFileVersion>10.0.30319.1 + $(Platform)\$(Configuration)\ExplorerPlugin.Resources\ + $(Platform)\$(Configuration)\ + false + $(Platform)\$(Configuration)\ExplorerPlugin.Resources\ + $(Platform)\$(Configuration)\ + false + $(Platform)\$(Configuration)\ExplorerPlugin.Resources\ + $(Platform)\$(Configuration)\ + false + $(Platform)\$(Configuration)\ExplorerPlugin.Resources\ + $(Platform)\$(Configuration)\ + false + ExplorerPluginResources + .dll + ExplorerPluginResources + .dll + $(Platform)\$(Configuration)\ExplorerPlugin.Resources\ + $(Platform)\$(Configuration)\ + ExplorerPluginResources + .dll + ExplorerPluginResources + .dll + ExplorerPluginResources + .dll + $(Platform)\$(Configuration)\ExplorerPlugin.Resources\ + $(Platform)\$(Configuration)\ + ExplorerPluginResources + .dll + + + + _DEBUG;%(PreprocessorDefinitions) + true + true + Win32 + $(OutDir)$(ProjectName).tlb + + + Disabled + ..\..\mDNSWindows;%(AdditionalIncludeDirectories) + WIN32;_DEBUG;_WINDOWS;DEBUG=1;ENABLE_DOT_LOCAL_NAMES;WINVER=0x0400;%(PreprocessorDefinitions) + true + EnableFastChecks + MultiThreadedDebug + true + + + + + .\Debug/ + .\Debug/ + .\Debug/ + true + Level4 + false + true + ProgramDatabase + StdCall + Default + + + _DEBUG;%(PreprocessorDefinitions) + 0x0409 + ../../mDNSWindows;%(AdditionalIncludeDirectories) + + + Building Output Directories + if not exist Debug\ExplorerPlugin.Resources mkdir Debug\ExplorerPlugin.Resources + + + /MACHINE:I386 /IGNORE:4089 %(AdditionalOptions) + $(OutDir)ExplorerPluginResources.dll + true + %(IgnoreSpecificDefaultLibraries) + + + true + $(OutDir)$(ProjectName).pdb + Windows + true + $(OutDir)$(ProjectName).lib + + + + + _DEBUG;%(PreprocessorDefinitions) + true + true + X64 + $(OutDir)$(ProjectName).tlb + + + Disabled + ..\..\mDNSWindows;%(AdditionalIncludeDirectories) + WIN32;_DEBUG;_WINDOWS;DEBUG=1;ENABLE_DOT_LOCAL_NAMES;WINVER=0x0400;%(PreprocessorDefinitions) + true + EnableFastChecks + MultiThreadedDebug + true + + + + + .\Debug/ + .\Debug/ + .\Debug/ + true + Level4 + false + true + ProgramDatabase + StdCall + Default + + + _DEBUG;%(PreprocessorDefinitions) + 0x0409 + ../../mDNSWindows;%(AdditionalIncludeDirectories) + + + Building Output Directories + if not exist Debug\ExplorerPlugin.Resources mkdir Debug\ExplorerPlugin.Resources + + + /MACHINE:I386 /IGNORE:4089 %(AdditionalOptions) + $(OutDir)ExplorerPluginResources.dll + true + %(IgnoreSpecificDefaultLibraries) + + + true + $(OutDir)$(ProjectName).pdb + Windows + true + $(OutDir)$(ProjectName).lib + MachineX64 + + + + + NDEBUG;%(PreprocessorDefinitions) + true + true + Win32 + $(OutDir)$(ProjectName).tlb + + + MaxSpeed + AnySuitable + Size + true + ..\..\mDNSShared;..\..\mDNSWindows;%(AdditionalIncludeDirectories) + WIN32;NDEBUG;_WINDOWS;WINVER=0x0400;%(PreprocessorDefinitions) + true + MultiThreaded + false + false + true + + + + + .\Release/ + .\Release/ + .\Release/ + true + Level4 + false + true + Default + + + NDEBUG;%(PreprocessorDefinitions) + 0x0409 + ../../mDNSWindows;%(AdditionalIncludeDirectories) + + + Building Output Directories + if not exist Release mkdir Release +if not exist "Release\ExplorerPlugin.Resources" mkdir "Release\ExplorerPlugin.Resources" + + + + /MACHINE:I386 /IGNORE:4089 %(AdditionalOptions) + $(OutDir)ExplorerPluginResources.dll + true + %(IgnoreSpecificDefaultLibraries) + + + + + Windows + + + + + true + $(IntDir)$(ProjectName).lib + + + if not "%RC_XBS%" == "YES" goto END +if not exist "$(DSTROOT)\Program Files\Bonjour SDK\bin\$(Platform)\ExplorerPlugin.Resources" mkdir "$(DSTROOT)\Program Files\Bonjour SDK\bin\$(Platform)\ExplorerPlugin.Resources" +xcopy /I/Y "$(TargetPath)" "$(DSTROOT)\Program Files\Bonjour SDK\bin\$(Platform)\ExplorerPlugin.Resources" +:END + + + + + + NDEBUG;%(PreprocessorDefinitions) + true + true + X64 + $(OutDir)$(ProjectName).tlb + + + MaxSpeed + AnySuitable + Size + true + ..\..\mDNSShared;..\..\mDNSWindows;%(AdditionalIncludeDirectories) + WIN32;NDEBUG;_WINDOWS;WINVER=0x0400;%(PreprocessorDefinitions) + true + MultiThreaded + false + false + true + + + + + .\Release/ + .\Release/ + .\Release/ + true + Level4 + false + true + Default + + + NDEBUG;%(PreprocessorDefinitions) + 0x0409 + ../../mDNSWindows;%(AdditionalIncludeDirectories) + + + Building Output Directories + if not exist Release mkdir Release +if not exist "Release\ExplorerPlugin.Resources" mkdir "Release\ExplorerPlugin.Resources" + + + + /MACHINE:I386 /IGNORE:4089 %(AdditionalOptions) + $(OutDir)ExplorerPluginResources.dll + true + %(IgnoreSpecificDefaultLibraries) + + + + + Windows + + + + + true + $(IntDir)$(ProjectName).lib + MachineX64 + + + if not "%RC_XBS%" == "YES" goto END +if not exist "$(DSTROOT)\Program Files\Bonjour SDK\bin\$(Platform)\ExplorerPlugin.Resources" mkdir "$(DSTROOT)\Program Files\Bonjour SDK\bin\$(Platform)\ExplorerPlugin.Resources" +xcopy /I/Y "$(TargetPath)" "$(DSTROOT)\Program Files\Bonjour SDK\bin\$(Platform)\ExplorerPlugin.Resources" +:END + + + + + + $(OutDir)ExplorerPluginResources.dll + + + + + $(OutDir)ExplorerPluginResources.dll + + + + + + + + + + + + + + + + + + + + + + {ab581101-18f0-46f6-b56a-83a6b1ea657e} + false + + + + + + + + + + + \ No newline at end of file diff --git a/mDNSResponder/Clients/ExplorerPlugin/ExplorerPluginRes.vcxproj.filters b/mDNSResponder/Clients/ExplorerPlugin/ExplorerPluginRes.vcxproj.filters new file mode 100755 index 00000000..72a0998f --- /dev/null +++ b/mDNSResponder/Clients/ExplorerPlugin/ExplorerPluginRes.vcxproj.filters @@ -0,0 +1,52 @@ + + + + + {89aee21a-a42b-4f10-87db-f6d3b27eb612} + h;hpp;hxx;hm;inl;inc + + + {27ad7c9e-deb4-4963-8cf0-adf004ed2437} + rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;jpg;jpeg;jpe;manifest + + + + + Header Files + + + + + Resource Files + + + Resource Files + + + Resource Files + + + Resource Files + + + Resource Files + + + Resource Files + + + Resource Files + + + Resource Files + + + Resource Files + + + + + Resource Files + + + \ No newline at end of file diff --git a/mDNSResponder/Clients/ExplorerPlugin/LoginDialog.cpp b/mDNSResponder/Clients/ExplorerPlugin/LoginDialog.cpp new file mode 100644 index 00000000..a2cc89ef --- /dev/null +++ b/mDNSResponder/Clients/ExplorerPlugin/LoginDialog.cpp @@ -0,0 +1,111 @@ +/* -*- Mode: C; tab-width: 4 -*- + * + * Copyright (c) 2003-2004 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 + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * 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. + */ + +#include +#include + +#include "stdafx.h" + +#include "LoginDialog.h" + +// MFC Debugging + +#ifdef _DEBUG +#define new DEBUG_NEW +#undef THIS_FILE +static char THIS_FILE[] = __FILE__; +#endif + +//=========================================================================================================================== +// Message Map +//=========================================================================================================================== + +BEGIN_MESSAGE_MAP( LoginDialog, CDialog ) +END_MESSAGE_MAP() + +//=========================================================================================================================== +// LoginDialog +//=========================================================================================================================== + +LoginDialog::LoginDialog( CWnd *inParent ) + : CDialog( LoginDialog::IDD, inParent ) +{ + // +} + +//=========================================================================================================================== +// OnInitDialog +//=========================================================================================================================== + +BOOL LoginDialog::OnInitDialog( void ) +{ + CDialog::OnInitDialog(); + return( TRUE ); +} + +//=========================================================================================================================== +// DoDataExchange +//=========================================================================================================================== + +void LoginDialog::DoDataExchange( CDataExchange *inDX ) +{ + CDialog::DoDataExchange( inDX ); +} + +//=========================================================================================================================== +// OnOK +//=========================================================================================================================== + +void LoginDialog::OnOK( void ) +{ + const CWnd * control; + + // Username + + control = GetDlgItem( IDC_LOGIN_USERNAME_TEXT ); + assert( control ); + if( control ) + { + control->GetWindowText( mUsername ); + } + + // Password + + control = GetDlgItem( IDC_LOGIN_PASSWORD_TEXT ); + assert( control ); + if( control ) + { + control->GetWindowText( mPassword ); + } + + CDialog::OnOK(); +} + +//=========================================================================================================================== +// GetLogin +//=========================================================================================================================== + +BOOL LoginDialog::GetLogin( CString &outUsername, CString &outPassword ) +{ + if( DoModal() == IDOK ) + { + outUsername = mUsername; + outPassword = mPassword; + return( TRUE ); + } + return( FALSE ); +} diff --git a/mDNSResponder/Clients/ExplorerPlugin/LoginDialog.h b/mDNSResponder/Clients/ExplorerPlugin/LoginDialog.h new file mode 100644 index 00000000..3aeb6966 --- /dev/null +++ b/mDNSResponder/Clients/ExplorerPlugin/LoginDialog.h @@ -0,0 +1,53 @@ +/* -*- Mode: C; tab-width: 4 -*- + * + * Copyright (c) 2003-2004 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 + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * 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. + */ + +#ifndef __LOGIN_DIALOG__ +#define __LOGIN_DIALOG__ + +#pragma once + +#include "Resource.h" + +//=========================================================================================================================== +// LoginDialog +//=========================================================================================================================== + +class LoginDialog : public CDialog +{ +protected: + +CString mUsername; +CString mPassword; + +public: + +enum { IDD = IDD_LOGIN }; + +LoginDialog( CWnd *inParent = NULL ); + +virtual BOOL GetLogin( CString &outUsername, CString &outPassword ); + +protected: + +virtual BOOL OnInitDialog( void ); +virtual void DoDataExchange( CDataExchange *inDX ); +virtual void OnOK( void ); + +DECLARE_MESSAGE_MAP() +}; + +#endif // __LOGIN_DIALOG__ diff --git a/mDNSResponder/Clients/ExplorerPlugin/ReadMe.txt b/mDNSResponder/Clients/ExplorerPlugin/ReadMe.txt new file mode 100644 index 00000000..2fbe6660 --- /dev/null +++ b/mDNSResponder/Clients/ExplorerPlugin/ReadMe.txt @@ -0,0 +1,9 @@ +The DNSServices Explorer Plugin is a vertical Explorer bar. It lets you browse for DNS-SD advertised services directly within Internet Explorer. + +This DLL needs to be registered to work. The Visual Studio project automatically registers the DLL after each successful build. If you need to manually register the DLL for some reason, you can execute the following line from the DOS command line prompt ("" is the actual parent path of the DLL): + +regsvr32.exe /s /c \ExplorerPlugin.dll + +For more information, see the Band Objects topic in the Microsoft Platform SDK documentation and check the following URL: + + diff --git a/mDNSResponder/Clients/ExplorerPlugin/Resource.h b/mDNSResponder/Clients/ExplorerPlugin/Resource.h new file mode 100644 index 00000000..aff47a42 --- /dev/null +++ b/mDNSResponder/Clients/ExplorerPlugin/Resource.h @@ -0,0 +1,28 @@ +/* -*- Mode: C; tab-width: 4 -*- + * + * Copyright (c) 2003-2004 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 + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * 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. + */ + +// Include the core resources + +#include "resource_dll.h" + +// Include the non-localizable resources + +#include "resource_res.h" + +// Include the localizable resources + +#include "resource_loc_res.h" diff --git a/mDNSResponder/Clients/ExplorerPlugin/StdAfx.cpp b/mDNSResponder/Clients/ExplorerPlugin/StdAfx.cpp new file mode 100644 index 00000000..768fa3f9 --- /dev/null +++ b/mDNSResponder/Clients/ExplorerPlugin/StdAfx.cpp @@ -0,0 +1,18 @@ +/* -*- Mode: C; tab-width: 4 -*- + * + * Copyright (c) 2003-2004 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 + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * 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. + */ + +#include "StdAfx.h" diff --git a/mDNSResponder/Clients/ExplorerPlugin/StdAfx.h b/mDNSResponder/Clients/ExplorerPlugin/StdAfx.h new file mode 100644 index 00000000..29608927 --- /dev/null +++ b/mDNSResponder/Clients/ExplorerPlugin/StdAfx.h @@ -0,0 +1,41 @@ +/* -*- Mode: C; tab-width: 4 -*- + * + * Copyright (c) 2003-2004 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 + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * 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. + */ + +#ifndef __STDAFX__ +#define __STDAFX__ + +#pragma once + +#ifndef VC_EXTRALEAN +#define VC_EXTRALEAN // Exclude rarely-used stuff from Windows headers +#endif + +#if !defined(_WSPIAPI_COUNTOF) +# define _WSPIAPI_COUNTOF(_Array) (sizeof(_Array) / sizeof(_Array[0])) +#endif + +#include // MFC core and standard components +#include // MFC extensions +#include // MFC support for Internet Explorer 4 Common Controls +#ifndef _AFX_NO_AFXCMN_SUPPORT + #include // MFC support for Windows Common Controls +#endif + +#include +#include // MFC socket extensions + +#endif // __STDAFX__ diff --git a/mDNSResponder/Clients/ExplorerPlugin/res/ExplorerPlugin.manifest b/mDNSResponder/Clients/ExplorerPlugin/res/ExplorerPlugin.manifest new file mode 100644 index 00000000..90a067ee --- /dev/null +++ b/mDNSResponder/Clients/ExplorerPlugin/res/ExplorerPlugin.manifest @@ -0,0 +1,22 @@ + + + +Your app description here + + + + + + diff --git a/mDNSResponder/Clients/ExplorerPlugin/res/ExplorerPlugin64.manifest b/mDNSResponder/Clients/ExplorerPlugin/res/ExplorerPlugin64.manifest new file mode 100644 index 00000000..ddc54b59 --- /dev/null +++ b/mDNSResponder/Clients/ExplorerPlugin/res/ExplorerPlugin64.manifest @@ -0,0 +1,22 @@ + + + +Your app description here + + + + + + diff --git a/mDNSResponder/Clients/ExplorerPlugin/res/about.bmp b/mDNSResponder/Clients/ExplorerPlugin/res/about.bmp new file mode 100644 index 00000000..ab5e430b Binary files /dev/null and b/mDNSResponder/Clients/ExplorerPlugin/res/about.bmp differ diff --git a/mDNSResponder/Clients/ExplorerPlugin/res/button-2k.ico b/mDNSResponder/Clients/ExplorerPlugin/res/button-2k.ico new file mode 100755 index 00000000..3699b441 Binary files /dev/null and b/mDNSResponder/Clients/ExplorerPlugin/res/button-2k.ico differ diff --git a/mDNSResponder/Clients/ExplorerPlugin/res/button-xp.ico b/mDNSResponder/Clients/ExplorerPlugin/res/button-xp.ico new file mode 100755 index 00000000..5d6360ee Binary files /dev/null and b/mDNSResponder/Clients/ExplorerPlugin/res/button-xp.ico differ diff --git a/mDNSResponder/Clients/ExplorerPlugin/res/cold.ico b/mDNSResponder/Clients/ExplorerPlugin/res/cold.ico new file mode 100644 index 00000000..3699b441 Binary files /dev/null and b/mDNSResponder/Clients/ExplorerPlugin/res/cold.ico differ diff --git a/mDNSResponder/Clients/ExplorerPlugin/res/hot.ico b/mDNSResponder/Clients/ExplorerPlugin/res/hot.ico new file mode 100644 index 00000000..95b03d05 Binary files /dev/null and b/mDNSResponder/Clients/ExplorerPlugin/res/hot.ico differ diff --git a/mDNSResponder/Clients/ExplorerPlugin/res/logo.bmp b/mDNSResponder/Clients/ExplorerPlugin/res/logo.bmp new file mode 100644 index 00000000..f866bd79 Binary files /dev/null and b/mDNSResponder/Clients/ExplorerPlugin/res/logo.bmp differ diff --git a/mDNSResponder/Clients/ExplorerPlugin/resource_dll.h b/mDNSResponder/Clients/ExplorerPlugin/resource_dll.h new file mode 100755 index 00000000..fc3c0a99 --- /dev/null +++ b/mDNSResponder/Clients/ExplorerPlugin/resource_dll.h @@ -0,0 +1,26 @@ +//{{NO_DEPENDENCIES}} +// Microsoft Visual C++ generated include file. +// Used by ExplorerPlugin.rc +// +#define IDS_NAME 106 +#define IDS_WEB_SITES 107 +#define IDS_PRINTERS 109 +#define IDS_MDNSRESPONDER_NOT_AVAILABLE 110 +#define IDS_FIREWALL 111 +#define IDC_COMPONENT 1001 +#define IDC_LEGAL 1002 +#define IDC_COMPONENT_VERSION 1003 +#define IDC_LOGIN_USERNAME_TEXT 1182 +#define IDC_LOGIN_PASSWORD_TEXT 1183 +#define ID_Menu 40001 + +// Next default values for new objects +// +#ifdef APSTUDIO_INVOKED +#ifndef APSTUDIO_READONLY_SYMBOLS +#define _APS_NEXT_RESOURCE_VALUE 119 +#define _APS_NEXT_COMMAND_VALUE 40001 +#define _APS_NEXT_CONTROL_VALUE 1001 +#define _APS_NEXT_SYMED_VALUE 101 +#endif +#endif diff --git a/mDNSResponder/Clients/ExplorerPlugin/resource_loc_res.h b/mDNSResponder/Clients/ExplorerPlugin/resource_loc_res.h new file mode 100755 index 00000000..6fc2d09b --- /dev/null +++ b/mDNSResponder/Clients/ExplorerPlugin/resource_loc_res.h @@ -0,0 +1,32 @@ +//{{NO_DEPENDENCIES}} +// Microsoft Visual C++ generated include file. +// Used by ExplorerPluginLocRes.rc +// +#define IDS_NAME 106 +#define IDS_WEB_SITES 107 +#define IDS_PRINTERS 109 +#define IDS_MDNSRESPONDER_NOT_AVAILABLE 110 +#define IDS_FIREWALL 111 +#define IDD_ABOUT 118 +#define IDR_CONTEXT_MENU 120 +#define IDD_LOGIN 145 +#define IDC_ABOUT_BACKGROUND 146 +#define IDS_ABOUT 147 +#define IDS_ABOUT_URL 148 +#define IDC_COMPONENT 1001 +#define IDC_LEGAL 1002 +#define IDC_COMPONENT_VERSION 1003 +#define IDC_LOGIN_USERNAME_TEXT 1182 +#define IDC_LOGIN_PASSWORD_TEXT 1183 +#define ID_Menu 40001 + +// Next default values for new objects +// +#ifdef APSTUDIO_INVOKED +#ifndef APSTUDIO_READONLY_SYMBOLS +#define _APS_NEXT_RESOURCE_VALUE 119 +#define _APS_NEXT_COMMAND_VALUE 40001 +#define _APS_NEXT_CONTROL_VALUE 1001 +#define _APS_NEXT_SYMED_VALUE 101 +#endif +#endif diff --git a/mDNSResponder/Clients/ExplorerPlugin/resource_res.h b/mDNSResponder/Clients/ExplorerPlugin/resource_res.h new file mode 100755 index 00000000..f2d4abd4 --- /dev/null +++ b/mDNSResponder/Clients/ExplorerPlugin/resource_res.h @@ -0,0 +1,30 @@ +//{{NO_DEPENDENCIES}} +// Microsoft Visual C++ generated include file. +// Used by ExplorerPluginRes.rc +// +#define IDS_NAME 106 +#define IDS_WEB_SITES 107 +#define IDS_PRINTERS 109 +#define IDS_MDNSRESPONDER_NOT_AVAILABLE 110 +#define IDS_FIREWALL 111 +#define IDB_LOGO 115 +#define IDI_BUTTON_2K 115 +#define IDI_BUTTON_XP 118 +#define IDB_ABOUT 119 +#define IDC_COMPONENT 1001 +#define IDC_LEGAL 1002 +#define IDC_COMPONENT_VERSION 1003 +#define IDC_LOGIN_USERNAME_TEXT 1182 +#define IDC_LOGIN_PASSWORD_TEXT 1183 +#define ID_Menu 40001 + +// Next default values for new objects +// +#ifdef APSTUDIO_INVOKED +#ifndef APSTUDIO_READONLY_SYMBOLS +#define _APS_NEXT_RESOURCE_VALUE 119 +#define _APS_NEXT_COMMAND_VALUE 40001 +#define _APS_NEXT_CONTROL_VALUE 1001 +#define _APS_NEXT_SYMED_VALUE 101 +#endif +#endif diff --git a/mDNSResponder/Clients/FirefoxExtension/CDNSSDService.cpp b/mDNSResponder/Clients/FirefoxExtension/CDNSSDService.cpp new file mode 100755 index 00000000..ae57da94 --- /dev/null +++ b/mDNSResponder/Clients/FirefoxExtension/CDNSSDService.cpp @@ -0,0 +1,394 @@ +/* -*- Mode: C; tab-width: 4 -*- + * + * Copyright (c) 2009 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 + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * 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. + */ + +#include "CDNSSDService.h" +#include "nsThreadUtils.h" +#include "nsIEventTarget.h" +#include "private/pprio.h" +#include +#include + + +NS_IMPL_ISUPPORTS2(CDNSSDService, IDNSSDService, nsIRunnable) + +CDNSSDService::CDNSSDService() +: + m_master( 1 ), + m_threadPool( NULL ), + m_mainRef( NULL ), + m_subRef( NULL ), + m_listener( NULL ), + m_fileDesc( NULL ), + m_job( NULL ) +{ + nsresult err; + + if ( DNSServiceCreateConnection( &m_mainRef ) != kDNSServiceErr_NoError ) + { + err = NS_ERROR_FAILURE; + goto exit; + } + + if ( ( m_fileDesc = PR_ImportTCPSocket( DNSServiceRefSockFD( m_mainRef ) ) ) == NULL ) + { + err = NS_ERROR_FAILURE; + goto exit; + } + + if ( ( m_threadPool = PR_CreateThreadPool( 1, 1, 8192 ) ) == NULL ) + { + err = NS_ERROR_FAILURE; + goto exit; + } + + err = SetupNotifications(); + +exit: + + if ( err != NS_OK ) + { + Cleanup(); + } +} + + +CDNSSDService::CDNSSDService( DNSServiceRef ref, nsISupports * listener ) +: + m_master( 0 ), + m_threadPool( NULL ), + m_mainRef( ref ), + m_subRef( ref ), + m_listener( listener ), + m_fileDesc( NULL ), + m_job( NULL ) +{ +} + + +CDNSSDService::~CDNSSDService() +{ + Cleanup(); +} + + +void +CDNSSDService::Cleanup() +{ + if ( m_master ) + { + if ( m_job ) + { + PR_CancelJob( m_job ); + m_job = NULL; + } + + if ( m_threadPool != NULL ) + { + PR_ShutdownThreadPool( m_threadPool ); + m_threadPool = NULL; + } + + if ( m_fileDesc != NULL ) + { + PR_Close( m_fileDesc ); + m_fileDesc = NULL; + } + + if ( m_mainRef ) + { + DNSServiceRefDeallocate( m_mainRef ); + m_mainRef = NULL; + } + } + else + { + if ( m_subRef ) + { + DNSServiceRefDeallocate( m_subRef ); + m_subRef = NULL; + } + } +} + + +nsresult +CDNSSDService::SetupNotifications() +{ + NS_PRECONDITION( m_threadPool != NULL, "m_threadPool is NULL" ); + NS_PRECONDITION( m_fileDesc != NULL, "m_fileDesc is NULL" ); + NS_PRECONDITION( m_job == NULL, "m_job is not NULL" ); + + m_iod.socket = m_fileDesc; + m_iod.timeout = PR_INTERVAL_MAX; + m_job = PR_QueueJob_Read( m_threadPool, &m_iod, Read, this, PR_FALSE ); + return ( m_job ) ? NS_OK : NS_ERROR_FAILURE; +} + + +/* IDNSSDService browse (in long interfaceIndex, in AString regtype, in AString domain, in IDNSSDBrowseListener listener); */ +NS_IMETHODIMP +CDNSSDService::Browse(PRInt32 interfaceIndex, const nsAString & regtype, const nsAString & domain, IDNSSDBrowseListener *listener, IDNSSDService **_retval NS_OUTPARAM) +{ + CDNSSDService * service = NULL; + DNSServiceErrorType dnsErr = 0; + nsresult err = 0; + + *_retval = NULL; + + if ( !m_mainRef ) + { + err = NS_ERROR_NOT_AVAILABLE; + goto exit; + } + + try + { + service = new CDNSSDService( m_mainRef, listener ); + } + catch ( ... ) + { + service = NULL; + } + + if ( service == NULL ) + { + err = NS_ERROR_FAILURE; + goto exit; + } + + dnsErr = DNSServiceBrowse( &service->m_subRef, kDNSServiceFlagsShareConnection, interfaceIndex, NS_ConvertUTF16toUTF8( regtype ).get(), NS_ConvertUTF16toUTF8( domain ).get(), ( DNSServiceBrowseReply ) BrowseReply, service ); + + if ( dnsErr != kDNSServiceErr_NoError ) + { + err = NS_ERROR_FAILURE; + goto exit; + } + + listener->AddRef(); + service->AddRef(); + *_retval = service; + err = NS_OK; + +exit: + + if ( err && service ) + { + delete service; + service = NULL; + } + + return err; +} + + +/* IDNSSDService resolve (in long interfaceIndex, in AString name, in AString regtype, in AString domain, in IDNSSDResolveListener listener); */ +NS_IMETHODIMP +CDNSSDService::Resolve(PRInt32 interfaceIndex, const nsAString & name, const nsAString & regtype, const nsAString & domain, IDNSSDResolveListener *listener, IDNSSDService **_retval NS_OUTPARAM) +{ + CDNSSDService * service; + DNSServiceErrorType dnsErr; + nsresult err; + + *_retval = NULL; + + if ( !m_mainRef ) + { + err = NS_ERROR_NOT_AVAILABLE; + goto exit; + } + + try + { + service = new CDNSSDService( m_mainRef, listener ); + } + catch ( ... ) + { + service = NULL; + } + + if ( service == NULL ) + { + err = NS_ERROR_FAILURE; + goto exit; + } + + dnsErr = DNSServiceResolve( &service->m_subRef, kDNSServiceFlagsShareConnection, interfaceIndex, NS_ConvertUTF16toUTF8( name ).get(), NS_ConvertUTF16toUTF8( regtype ).get(), NS_ConvertUTF16toUTF8( domain ).get(), ( DNSServiceResolveReply ) ResolveReply, service ); + + if ( dnsErr != kDNSServiceErr_NoError ) + { + err = NS_ERROR_FAILURE; + goto exit; + } + + listener->AddRef(); + service->AddRef(); + *_retval = service; + err = NS_OK; + +exit: + + if ( err && service ) + { + delete service; + service = NULL; + } + + return err; +} + + +/* void stop (); */ +NS_IMETHODIMP +CDNSSDService::Stop() +{ + if ( m_subRef ) + { + DNSServiceRefDeallocate( m_subRef ); + m_subRef = NULL; + } + + return NS_OK; +} + + +void +CDNSSDService::Read( void * arg ) +{ + NS_PRECONDITION( arg != NULL, "arg is NULL" ); + + NS_DispatchToMainThread( ( CDNSSDService* ) arg ); +} + + +NS_IMETHODIMP +CDNSSDService::Run() +{ + nsresult err = NS_OK; + + NS_PRECONDITION( m_mainRef != NULL, "m_mainRef is NULL" ); + + m_job = NULL; + + if ( PR_Available( m_fileDesc ) > 0 ) + { + if ( DNSServiceProcessResult( m_mainRef ) != kDNSServiceErr_NoError ) + { + err = NS_ERROR_FAILURE; + } + } + + if ( !err ) + { + err = SetupNotifications(); + } + + return err; +} + + +void DNSSD_API +CDNSSDService::BrowseReply + ( + DNSServiceRef sdRef, + DNSServiceFlags flags, + uint32_t interfaceIndex, + DNSServiceErrorType errorCode, + const char * serviceName, + const char * regtype, + const char * replyDomain, + void * context + ) +{ + CDNSSDService * self = ( CDNSSDService* ) context; + + // This should never be NULL, but let's be defensive. + + if ( self != NULL ) + { + IDNSSDBrowseListener * listener = ( IDNSSDBrowseListener* ) self->m_listener; + + // Same for this + + if ( listener != NULL ) + { + listener->OnBrowse( self, ( flags & kDNSServiceFlagsAdd ) ? PR_TRUE : PR_FALSE, interfaceIndex, errorCode, NS_ConvertUTF8toUTF16( serviceName ), NS_ConvertUTF8toUTF16( regtype ), NS_ConvertUTF8toUTF16( replyDomain ) ); + } + } +} + + +void DNSSD_API +CDNSSDService::ResolveReply + ( + DNSServiceRef sdRef, + DNSServiceFlags flags, + uint32_t interfaceIndex, + DNSServiceErrorType errorCode, + const char * fullname, + const char * hosttarget, + uint16_t port, + uint16_t txtLen, + const unsigned char * txtRecord, + void * context + ) +{ + CDNSSDService * self = ( CDNSSDService* ) context; + + // This should never be NULL, but let's be defensive. + + if ( self != NULL ) + { + IDNSSDResolveListener * listener = ( IDNSSDResolveListener* ) self->m_listener; + + // Same for this + + if ( listener != NULL ) + { + std::string path = ""; + const void * value = NULL; + uint8_t valueLen = 0; + + value = TXTRecordGetValuePtr( txtLen, txtRecord, "path", &valueLen ); + + if ( value && valueLen ) + { + char * temp; + + temp = new char[ valueLen + 2 ]; + + if ( temp ) + { + char * dst = temp; + + memset( temp, 0, valueLen + 2 ); + + if ( ( ( char* ) value )[ 0 ] != '/' ) + { + *dst++ = '/'; + } + + memcpy( dst, value, valueLen ); + path = temp; + delete [] temp; + } + } + + listener->OnResolve( self, interfaceIndex, errorCode, NS_ConvertUTF8toUTF16( fullname ), NS_ConvertUTF8toUTF16( hosttarget ) , ntohs( port ), NS_ConvertUTF8toUTF16( path.c_str() ) ); + } + } +} + diff --git a/mDNSResponder/Clients/FirefoxExtension/CDNSSDService.h b/mDNSResponder/Clients/FirefoxExtension/CDNSSDService.h new file mode 100755 index 00000000..33eaa712 --- /dev/null +++ b/mDNSResponder/Clients/FirefoxExtension/CDNSSDService.h @@ -0,0 +1,104 @@ +/* -*- Mode: C; tab-width: 4 -*- + * + * Copyright (c) 2009 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 + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * 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. + */ + + +#ifndef _CDNSSDSERVICE_H +#define _CDNSSDSERVICE_H + +#include "IDNSSDService.h" +#include "nsCOMPtr.h" +#include "nsComponentManagerUtils.h" +#include "nsIThread.h" +#include "nsIRunnable.h" +#include "prtpool.h" +#include +#include +#include + + +#define CDNSSDSERVICE_CONTRACTID "@apple.com/DNSSDService;1" +#define CDNSSDSERVICE_CLASSNAME "CDNSSDService" +#define CDNSSDSERVICE_CID { 0x944ED267, 0x465A, 0x4989, { 0x82, 0x72, 0x7E, 0xE9, 0x28, 0x6C, 0x99, 0xA5 } } + + +/* Header file */ +class CDNSSDService : public IDNSSDService, nsIRunnable +{ +public: +NS_DECL_ISUPPORTS +NS_DECL_IDNSSDSERVICE +NS_DECL_NSIRUNNABLE + +CDNSSDService(); +CDNSSDService( DNSServiceRef mainRef, nsISupports * listener ); + +virtual ~CDNSSDService(); + +private: + +static void DNSSD_API +BrowseReply +( + DNSServiceRef sdRef, + DNSServiceFlags flags, + uint32_t interfaceIndex, + DNSServiceErrorType errorCode, + const char * serviceName, + const char * regtype, + const char * replyDomain, + void * context +); + +static void DNSSD_API +ResolveReply +( + DNSServiceRef sdRef, + DNSServiceFlags flags, + uint32_t interfaceIndex, + DNSServiceErrorType errorCode, + const char * fullname, + const char * hosttarget, + uint16_t port, + uint16_t txtLen, + const unsigned char * txtRecord, + void * context +); + +static void +Read +( + void * arg +); + +nsresult +SetupNotifications(); + +void +Cleanup(); + +char m_master; +PRThreadPool * m_threadPool; +DNSServiceRef m_mainRef; +DNSServiceRef m_subRef; +nsISupports * m_listener; +PRFileDesc * m_fileDesc; +PRJobIoDesc m_iod; +PRJob * m_job; +}; + + +#endif diff --git a/mDNSResponder/Clients/FirefoxExtension/CDNSSDServiceModule.cpp b/mDNSResponder/Clients/FirefoxExtension/CDNSSDServiceModule.cpp new file mode 100755 index 00000000..3833c5aa --- /dev/null +++ b/mDNSResponder/Clients/FirefoxExtension/CDNSSDServiceModule.cpp @@ -0,0 +1,37 @@ +/* -*- Mode: C; tab-width: 4 -*- + * + * Copyright (c) 2009 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 + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * 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. + */ + +#include "nsIGenericFactory.h" +#include "CDNSSDService.h" + +NS_COM_GLUE nsresult +NS_NewGenericModule2(nsModuleInfo const *info, nsIModule* *result); + +NS_GENERIC_FACTORY_CONSTRUCTOR(CDNSSDService) + +static nsModuleComponentInfo components[] = +{ + { + CDNSSDSERVICE_CLASSNAME, + CDNSSDSERVICE_CID, + CDNSSDSERVICE_CONTRACTID, + CDNSSDServiceConstructor, + } +}; + +NS_IMPL_NSGETMODULE("CDNSSDServiceModule", components) + diff --git a/mDNSResponder/Clients/FirefoxExtension/DNSSDService.sln b/mDNSResponder/Clients/FirefoxExtension/DNSSDService.sln new file mode 100755 index 00000000..68534f46 --- /dev/null +++ b/mDNSResponder/Clients/FirefoxExtension/DNSSDService.sln @@ -0,0 +1,20 @@ + +Microsoft Visual Studio Solution File, Format Version 9.00 +# Visual Studio 2005 +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "DNSSDService", "DNSSDService.vcproj", "{7826EA27-D4CC-4FAA-AD23-DF813823227B}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Win32 = Debug|Win32 + Release|Win32 = Release|Win32 + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {7826EA27-D4CC-4FAA-AD23-DF813823227B}.Debug|Win32.ActiveCfg = Debug|Win32 + {7826EA27-D4CC-4FAA-AD23-DF813823227B}.Debug|Win32.Build.0 = Debug|Win32 + {7826EA27-D4CC-4FAA-AD23-DF813823227B}.Release|Win32.ActiveCfg = Release|Win32 + {7826EA27-D4CC-4FAA-AD23-DF813823227B}.Release|Win32.Build.0 = Release|Win32 + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection +EndGlobal diff --git a/mDNSResponder/Clients/FirefoxExtension/FirefoxExtension.rc b/mDNSResponder/Clients/FirefoxExtension/FirefoxExtension.rc new file mode 100644 index 00000000..998e5e98 --- /dev/null +++ b/mDNSResponder/Clients/FirefoxExtension/FirefoxExtension.rc @@ -0,0 +1,102 @@ +// Microsoft Visual C++ generated resource script. +// +#include "resource.h" + +#define APSTUDIO_READONLY_SYMBOLS +///////////////////////////////////////////////////////////////////////////// +// +// Generated from the TEXTINCLUDE 2 resource. +// +#include "afxres.h" +#include "WinVersRes.h" +///////////////////////////////////////////////////////////////////////////// +#undef APSTUDIO_READONLY_SYMBOLS + +///////////////////////////////////////////////////////////////////////////// +// English (U.S.) resources + +#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU) +#ifdef _WIN32 +LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US +#pragma code_page(1252) +#endif //_WIN32 + +#ifdef APSTUDIO_INVOKED +///////////////////////////////////////////////////////////////////////////// +// +// TEXTINCLUDE +// + +1 TEXTINCLUDE +BEGIN + "resource.h\0" +END + +2 TEXTINCLUDE +BEGIN + "#include ""afxres.h""\r\n" + "#include ""WinVersRes.h""\0" +END + +3 TEXTINCLUDE +BEGIN + "\r\n" + "\0" +END + +#endif // APSTUDIO_INVOKED + + +///////////////////////////////////////////////////////////////////////////// +// +// Version +// + +VS_VERSION_INFO VERSIONINFO + FILEVERSION MASTER_PROD_VERS + PRODUCTVERSION MASTER_PROD_VERS + FILEFLAGSMASK 0x17L +#ifdef _DEBUG + FILEFLAGS 0x1L +#else + FILEFLAGS 0x0L +#endif + FILEOS 0x4L + FILETYPE 0x2L + FILESUBTYPE 0x0L +BEGIN + BLOCK "StringFileInfo" + BEGIN + BLOCK "040904b0" + BEGIN + VALUE "CompanyName", MASTER_COMPANY_NAME + VALUE "FileDescription", "Firefox Extension Library" + VALUE "FileVersion", MASTER_PROD_VERS_STR + VALUE "InternalName", "DNSSDService.dll" + VALUE "LegalCopyright", MASTER_LEGAL_COPYRIGHT + VALUE "OriginalFilename", "DNSSDService.dll" + VALUE "ProductName", MASTER_PROD_NAME + VALUE "ProductVersion", MASTER_PROD_VERS_STR + END + END + BLOCK "VarFileInfo" + BEGIN + VALUE "Translation", 0x409, 1200 + END +END + +#endif // English (U.S.) resources +///////////////////////////////////////////////////////////////////////////// + + + +#ifndef APSTUDIO_INVOKED +///////////////////////////////////////////////////////////////////////////// +// +// Generated from the TEXTINCLUDE 3 resource. +// + + +///////////////////////////////////////////////////////////////////////////// +#endif // not APSTUDIO_INVOKED + diff --git a/mDNSResponder/Clients/FirefoxExtension/FirefoxExtension.vcproj b/mDNSResponder/Clients/FirefoxExtension/FirefoxExtension.vcproj new file mode 100755 index 00000000..352fdd61 --- /dev/null +++ b/mDNSResponder/Clients/FirefoxExtension/FirefoxExtension.vcproj @@ -0,0 +1,282 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/mDNSResponder/Clients/FirefoxExtension/FirefoxExtension.vcxproj b/mDNSResponder/Clients/FirefoxExtension/FirefoxExtension.vcxproj new file mode 100755 index 00000000..1d02a4ec --- /dev/null +++ b/mDNSResponder/Clients/FirefoxExtension/FirefoxExtension.vcxproj @@ -0,0 +1,179 @@ + + + + + Debug + Win32 + + + Release + Win32 + + + + {7826EA27-D4CC-4FAA-AD23-DF813823227B} + + + + DynamicLibrary + false + MultiByte + + + DynamicLibrary + false + MultiByte + + + + + + + + + + + + + + + <_ProjectFileVersion>10.0.30319.1 + $(Platform)\$(Configuration)\ + $(Platform)\$(Configuration)\ + false + $(Platform)\$(Configuration)\ + $(Platform)\$(Configuration)\ + true + DNSSDService + DNSSDService + + + + NDEBUG;%(PreprocessorDefinitions) + true + true + Win32 + .\$(OutDir)DNSSDService.tlb + + + + + MaxSpeed + OnlyExplicitInline + ..\..\mDNSShared;$(SRCROOT)\AppleInternal\XULRunner\include\xpcom;$(SRCROOT)\AppleInternal\XULRunner\include\nspr;$(SRCROOT)\AppleInternal\XULRunner\include\string;$(SRCROOT)\AppleInternal\XULRunner\include\pref;$(SRCROOT)\AppleInternal\XULRunner\sdk\include;%(AdditionalIncludeDirectories) + NDEBUG;WIN32;_WINDOWS;_USRDLL;DNSSDSERVICE_EXPORTS;XP_WIN;XP_WIN32;%(PreprocessorDefinitions) + true + MultiThreaded + true + + + $(IntDir) + $(IntDir) + $(IntDir)vc80.pdb + Level3 + true + %(ForcedIncludeFiles) + + + NDEBUG;%(PreprocessorDefinitions) + 0x0409 + ../../mDNSWindows;%(AdditionalIncludeDirectories) + + + /NXCOMPAT /DYNAMICBASE /SAFESEH %(AdditionalOptions) + $(SRCROOT)\AppleInternal\XULRunner\lib\nspr4.lib;$(SRCROOT)\AppleInternal\XULRunner\lib\xpcom.lib;$(SRCROOT)\AppleInternal\XULRunner\lib\xpcomglue_s.lib;ws2_32.lib;../../mDNSWindows/DLLStub/$(Platform)/$(Configuration)/dnssdStatic.lib;%(AdditionalDependencies) + $(OutDir)DNSSDService.dll + true + %(AdditionalLibraryDirectories) + .\$(OutDir)DNSSDService.pdb + .\$(OutDir)DNSSDService.lib + MachineX86 + + + true + .\$(OutDir)DNSSDService.bsc + + + xcopy /I/Y $(Platform)\$(Configuration)\DNSSDService.dll extension\platform\WINNT\components +if not "%RC_XBS%" == "YES" goto END +if not exist "$(DSTROOT)\Program Files\Bonjour SDK\bin\$(Platform)\FirefoxExtension" mkdir "$(DSTROOT)\Program Files\Bonjour SDK\bin\$(Platform)\FirefoxExtension" +xcopy /E/I/Y "extension" "$(DSTROOT)\Program Files\Bonjour SDK\bin\$(Platform)\FirefoxExtension" +:END + + + + + + _DEBUG;%(PreprocessorDefinitions) + true + true + Win32 + .\$(OutDir)DNSSDService.tlb + + + + + Disabled + ..\..\mDNSShared;$(SRCROOT)\AppleInternal\XULRunner\include\xpcom;$(SRCROOT)\AppleInternal\XULRunner\include\nspr;$(SRCROOT)\AppleInternal\XULRunner\include\string;$(SRCROOT)\AppleInternal\XULRunner\include\pref;$(SRCROOT)\AppleInternal\XULRunner\sdk\include;%(AdditionalIncludeDirectories) + WIN32;_DEBUG;_WINDOWS;_USRDLL;DNSSDSERVICE_EXPORTS;XP_WIN;XP_WIN32;%(PreprocessorDefinitions) + true + EnableFastChecks + MultiThreadedDebug + + + $(IntDir) + $(IntDir) + $(IntDir)vc80.pdb + Level3 + true + ProgramDatabase + %(ForcedIncludeFiles) + + + _DEBUG;%(PreprocessorDefinitions) + 0x0409 + ../../mDNSWindows;%(AdditionalIncludeDirectories) + + + /NXCOMPAT /DYNAMICBASE /SAFESEH %(AdditionalOptions) + $(SRCROOT)\AppleInternal\XULRunner\lib\nspr4.lib;$(SRCROOT)\AppleInternal\XULRunner\lib\xpcom.lib;$(SRCROOT)\AppleInternal\XULRunner\lib\xpcomglue_s.lib;ws2_32.lib;../../mDNSWindows/DLLStub/$(Platform)/$(Configuration)/dnssdStatic.lib;%(AdditionalDependencies) + $(OutDir)DNSSDService.dll + true + %(AdditionalLibraryDirectories) + true + .\$(OutDir)DNSSDService.pdb + .\$(OutDir)DNSSDService.lib + MachineX86 + + + true + .\$(OutDir)DNSSDService.bsc + + + xcopy /I/Y $(Platform)\$(Configuration)\DNSSDService.dll extension\platform\WINNT\components + + + + + + + + + + + + + + + + + + + {3a2b6325-3053-4236-84bd-aa9be2e323e5} + false + + + + + + \ No newline at end of file diff --git a/mDNSResponder/Clients/FirefoxExtension/FirefoxExtension.vcxproj.filters b/mDNSResponder/Clients/FirefoxExtension/FirefoxExtension.vcxproj.filters new file mode 100755 index 00000000..02c1c55a --- /dev/null +++ b/mDNSResponder/Clients/FirefoxExtension/FirefoxExtension.vcxproj.filters @@ -0,0 +1,47 @@ + + + + + {89e57cc2-d6b1-4e68-ad57-71223df12d28} + cpp;c;cxx;rc;def;r;odl;idl;hpj;bat + + + {4d103fe8-9737-47c7-9190-6f7b5666ecf5} + h;hpp;hxx;hm;inl + + + {4dae44a8-3da8-43c0-a749-2d1e0610c66f} + idl + + + {ac7dbdd1-2fe3-416d-9cab-2d663c05f252} + ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe + + + + + Source Files + + + Source Files + + + + + Header Files + + + Header Files + + + + + Resource Files + + + + + IDL + + + \ No newline at end of file diff --git a/mDNSResponder/Clients/FirefoxExtension/IDNSSDService.h b/mDNSResponder/Clients/FirefoxExtension/IDNSSDService.h new file mode 100755 index 00000000..e4784d4d --- /dev/null +++ b/mDNSResponder/Clients/FirefoxExtension/IDNSSDService.h @@ -0,0 +1,263 @@ +/* + * DO NOT EDIT. THIS FILE IS GENERATED FROM IDNSSDService.idl + */ + +#ifndef __gen_IDNSSDService_h__ +#define __gen_IDNSSDService_h__ + + +#ifndef __gen_nsISupports_h__ +#include "nsISupports.h" +#endif + +/* For IDL files that don't want to include root IDL files. */ +#ifndef NS_NO_VTABLE +#define NS_NO_VTABLE +#endif +class IDNSSDService; /* forward declaration */ + + +/* starting interface: IDNSSDBrowseListener */ +#define IDNSSDBROWSELISTENER_IID_STR "27346495-a1ed-458a-a5bc-587df9a26b4f" + +#define IDNSSDBROWSELISTENER_IID \ + {0x27346495, 0xa1ed, 0x458a, \ + { 0xa5, 0xbc, 0x58, 0x7d, 0xf9, 0xa2, 0x6b, 0x4f }} + +class NS_NO_VTABLE NS_SCRIPTABLE IDNSSDBrowseListener : public nsISupports { +public: + +NS_DECLARE_STATIC_IID_ACCESSOR(IDNSSDBROWSELISTENER_IID) + +/* void onBrowse (in IDNSSDService service, in boolean add, in long interfaceIndex, in long error, in AString serviceName, in AString regtype, in AString domain); */ +NS_SCRIPTABLE NS_IMETHOD OnBrowse(IDNSSDService *service, PRBool add, PRInt32 interfaceIndex, PRInt32 error, const nsAString & serviceName, const nsAString & regtype, const nsAString & domain) = 0; + +}; + +NS_DEFINE_STATIC_IID_ACCESSOR(IDNSSDBrowseListener, IDNSSDBROWSELISTENER_IID) + +/* Use this macro when declaring classes that implement this interface. */ +#define NS_DECL_IDNSSDBROWSELISTENER \ + NS_SCRIPTABLE NS_IMETHOD OnBrowse(IDNSSDService *service, PRBool add, PRInt32 interfaceIndex, PRInt32 error, const nsAString &serviceName, const nsAString ®type, const nsAString &domain); + +/* Use this macro to declare functions that forward the behavior of this interface to another object. */ +#define NS_FORWARD_IDNSSDBROWSELISTENER(_to) \ + NS_SCRIPTABLE NS_IMETHOD OnBrowse(IDNSSDService *service, PRBool add, PRInt32 interfaceIndex, PRInt32 error, const nsAString &serviceName, const nsAString ®type, const nsAString &domain) { return _to OnBrowse(service, add, interfaceIndex, error, serviceName, regtype, domain); } + +/* Use this macro to declare functions that forward the behavior of this interface to another object in a safe way. */ +#define NS_FORWARD_SAFE_IDNSSDBROWSELISTENER(_to) \ + NS_SCRIPTABLE NS_IMETHOD OnBrowse(IDNSSDService *service, PRBool add, PRInt32 interfaceIndex, PRInt32 error, const nsAString &serviceName, const nsAString ®type, const nsAString &domain) { return !_to ? NS_ERROR_NULL_POINTER : _to->OnBrowse(service, add, interfaceIndex, error, serviceName, regtype, domain); } + +#if 0 +/* Use the code below as a template for the implementation class for this interface. */ + +/* Header file */ +class _MYCLASS_ : public IDNSSDBrowseListener +{ +public: +NS_DECL_ISUPPORTS +NS_DECL_IDNSSDBROWSELISTENER + +_MYCLASS_(); + +private: +~_MYCLASS_(); + +protected: +/* additional members */ +}; + +/* Implementation file */ +NS_IMPL_ISUPPORTS1(_MYCLASS_, IDNSSDBrowseListener) + +_MYCLASS_::_MYCLASS_() +{ + /* member initializers and constructor code */ +} + +_MYCLASS_::~_MYCLASS_() +{ + /* destructor code */ +} + +/* void onBrowse (in IDNSSDService service, in boolean add, in long interfaceIndex, in long error, in AString serviceName, in AString regtype, in AString domain); */ +NS_IMETHODIMP _MYCLASS_::OnBrowse(IDNSSDService *service, PRBool add, PRInt32 interfaceIndex, PRInt32 error, const nsAString & serviceName, const nsAString & regtype, const nsAString & domain) +{ + return NS_ERROR_NOT_IMPLEMENTED; +} + +/* End of implementation class template. */ +#endif + + +/* starting interface: IDNSSDResolveListener */ +#define IDNSSDRESOLVELISTENER_IID_STR "6620e18f-47f3-47c6-941f-126a5fd4fcf7" + +#define IDNSSDRESOLVELISTENER_IID \ + {0x6620e18f, 0x47f3, 0x47c6, \ + { 0x94, 0x1f, 0x12, 0x6a, 0x5f, 0xd4, 0xfc, 0xf7 }} + +class NS_NO_VTABLE NS_SCRIPTABLE IDNSSDResolveListener : public nsISupports { +public: + +NS_DECLARE_STATIC_IID_ACCESSOR(IDNSSDRESOLVELISTENER_IID) + +/* void onResolve (in IDNSSDService service, in long interfaceIndex, in long error, in AString fullname, in AString host, in short port, in AString path); */ +NS_SCRIPTABLE NS_IMETHOD OnResolve(IDNSSDService *service, PRInt32 interfaceIndex, PRInt32 error, const nsAString & fullname, const nsAString & host, PRInt16 port, const nsAString & path) = 0; + +}; + +NS_DEFINE_STATIC_IID_ACCESSOR(IDNSSDResolveListener, IDNSSDRESOLVELISTENER_IID) + +/* Use this macro when declaring classes that implement this interface. */ +#define NS_DECL_IDNSSDRESOLVELISTENER \ + NS_SCRIPTABLE NS_IMETHOD OnResolve(IDNSSDService *service, PRInt32 interfaceIndex, PRInt32 error, const nsAString &fullname, const nsAString &host, PRInt16 port, const nsAString &path); + +/* Use this macro to declare functions that forward the behavior of this interface to another object. */ +#define NS_FORWARD_IDNSSDRESOLVELISTENER(_to) \ + NS_SCRIPTABLE NS_IMETHOD OnResolve(IDNSSDService *service, PRInt32 interfaceIndex, PRInt32 error, const nsAString &fullname, const nsAString &host, PRInt16 port, const nsAString &path) { return _to OnResolve(service, interfaceIndex, error, fullname, host, port, path); } + +/* Use this macro to declare functions that forward the behavior of this interface to another object in a safe way. */ +#define NS_FORWARD_SAFE_IDNSSDRESOLVELISTENER(_to) \ + NS_SCRIPTABLE NS_IMETHOD OnResolve(IDNSSDService *service, PRInt32 interfaceIndex, PRInt32 error, const nsAString &fullname, const nsAString &host, PRInt16 port, const nsAString &path) { return !_to ? NS_ERROR_NULL_POINTER : _to->OnResolve(service, interfaceIndex, error, fullname, host, port, path); } + +#if 0 +/* Use the code below as a template for the implementation class for this interface. */ + +/* Header file */ +class _MYCLASS_ : public IDNSSDResolveListener +{ +public: +NS_DECL_ISUPPORTS +NS_DECL_IDNSSDRESOLVELISTENER + +_MYCLASS_(); + +private: +~_MYCLASS_(); + +protected: +/* additional members */ +}; + +/* Implementation file */ +NS_IMPL_ISUPPORTS1(_MYCLASS_, IDNSSDResolveListener) + +_MYCLASS_::_MYCLASS_() +{ + /* member initializers and constructor code */ +} + +_MYCLASS_::~_MYCLASS_() +{ + /* destructor code */ +} + +/* void onResolve (in IDNSSDService service, in long interfaceIndex, in long error, in AString fullname, in AString host, in short port, in AString path); */ +NS_IMETHODIMP _MYCLASS_::OnResolve(IDNSSDService *service, PRInt32 interfaceIndex, PRInt32 error, const nsAString & fullname, const nsAString & host, PRInt16 port, const nsAString & path) +{ + return NS_ERROR_NOT_IMPLEMENTED; +} + +/* End of implementation class template. */ +#endif + + +/* starting interface: IDNSSDService */ +#define IDNSSDSERVICE_IID_STR "3a3539ff-f8d8-40b4-8d02-5ea73c51fa12" + +#define IDNSSDSERVICE_IID \ + {0x3a3539ff, 0xf8d8, 0x40b4, \ + { 0x8d, 0x02, 0x5e, 0xa7, 0x3c, 0x51, 0xfa, 0x12 }} + +class NS_NO_VTABLE NS_SCRIPTABLE IDNSSDService : public nsISupports { +public: + +NS_DECLARE_STATIC_IID_ACCESSOR(IDNSSDSERVICE_IID) + +/* IDNSSDService browse (in long interfaceIndex, in AString regtype, in AString domain, in IDNSSDBrowseListener listener); */ +NS_SCRIPTABLE NS_IMETHOD Browse(PRInt32 interfaceIndex, const nsAString & regtype, const nsAString & domain, IDNSSDBrowseListener *listener, IDNSSDService **_retval NS_OUTPARAM) = 0; + +/* IDNSSDService resolve (in long interfaceIndex, in AString name, in AString regtype, in AString domain, in IDNSSDResolveListener listener); */ +NS_SCRIPTABLE NS_IMETHOD Resolve(PRInt32 interfaceIndex, const nsAString & name, const nsAString & regtype, const nsAString & domain, IDNSSDResolveListener *listener, IDNSSDService **_retval NS_OUTPARAM) = 0; + +/* void stop (); */ +NS_SCRIPTABLE NS_IMETHOD Stop(void) = 0; + +}; + +NS_DEFINE_STATIC_IID_ACCESSOR(IDNSSDService, IDNSSDSERVICE_IID) + +/* Use this macro when declaring classes that implement this interface. */ +#define NS_DECL_IDNSSDSERVICE \ + NS_SCRIPTABLE NS_IMETHOD Browse(PRInt32 interfaceIndex, const nsAString ®type, const nsAString &domain, IDNSSDBrowseListener *listener, IDNSSDService **_retval NS_OUTPARAM); \ + NS_SCRIPTABLE NS_IMETHOD Resolve(PRInt32 interfaceIndex, const nsAString &name, const nsAString ®type, const nsAString &domain, IDNSSDResolveListener *listener, IDNSSDService **_retval NS_OUTPARAM); \ + NS_SCRIPTABLE NS_IMETHOD Stop(void); + +/* Use this macro to declare functions that forward the behavior of this interface to another object. */ +#define NS_FORWARD_IDNSSDSERVICE(_to) \ + NS_SCRIPTABLE NS_IMETHOD Browse(PRInt32 interfaceIndex, const nsAString ®type, const nsAString &domain, IDNSSDBrowseListener *listener, IDNSSDService **_retval NS_OUTPARAM) { return _to Browse(interfaceIndex, regtype, domain, listener, _retval); } \ + NS_SCRIPTABLE NS_IMETHOD Resolve(PRInt32 interfaceIndex, const nsAString &name, const nsAString ®type, const nsAString &domain, IDNSSDResolveListener *listener, IDNSSDService **_retval NS_OUTPARAM) { return _to Resolve(interfaceIndex, name, regtype, domain, listener, _retval); } \ + NS_SCRIPTABLE NS_IMETHOD Stop(void) { return _to Stop(); } + +/* Use this macro to declare functions that forward the behavior of this interface to another object in a safe way. */ +#define NS_FORWARD_SAFE_IDNSSDSERVICE(_to) \ + NS_SCRIPTABLE NS_IMETHOD Browse(PRInt32 interfaceIndex, const nsAString ®type, const nsAString &domain, IDNSSDBrowseListener *listener, IDNSSDService **_retval NS_OUTPARAM) { return !_to ? NS_ERROR_NULL_POINTER : _to->Browse(interfaceIndex, regtype, domain, listener, _retval); } \ + NS_SCRIPTABLE NS_IMETHOD Resolve(PRInt32 interfaceIndex, const nsAString &name, const nsAString ®type, const nsAString &domain, IDNSSDResolveListener *listener, IDNSSDService **_retval NS_OUTPARAM) { return !_to ? NS_ERROR_NULL_POINTER : _to->Resolve(interfaceIndex, name, regtype, domain, listener, _retval); } \ + NS_SCRIPTABLE NS_IMETHOD Stop(void) { return !_to ? NS_ERROR_NULL_POINTER : _to->Stop(); } + +#if 0 +/* Use the code below as a template for the implementation class for this interface. */ + +/* Header file */ +class _MYCLASS_ : public IDNSSDService +{ +public: +NS_DECL_ISUPPORTS +NS_DECL_IDNSSDSERVICE + +_MYCLASS_(); + +private: +~_MYCLASS_(); + +protected: +/* additional members */ +}; + +/* Implementation file */ +NS_IMPL_ISUPPORTS1(_MYCLASS_, IDNSSDService) + +_MYCLASS_::_MYCLASS_() +{ + /* member initializers and constructor code */ +} + +_MYCLASS_::~_MYCLASS_() +{ + /* destructor code */ +} + +/* IDNSSDService browse (in long interfaceIndex, in AString regtype, in AString domain, in IDNSSDBrowseListener listener); */ +NS_IMETHODIMP _MYCLASS_::Browse(PRInt32 interfaceIndex, const nsAString & regtype, const nsAString & domain, IDNSSDBrowseListener *listener, IDNSSDService **_retval NS_OUTPARAM) +{ + return NS_ERROR_NOT_IMPLEMENTED; +} + +/* IDNSSDService resolve (in long interfaceIndex, in AString name, in AString regtype, in AString domain, in IDNSSDResolveListener listener); */ +NS_IMETHODIMP _MYCLASS_::Resolve(PRInt32 interfaceIndex, const nsAString & name, const nsAString & regtype, const nsAString & domain, IDNSSDResolveListener *listener, IDNSSDService **_retval NS_OUTPARAM) +{ + return NS_ERROR_NOT_IMPLEMENTED; +} + +/* void stop (); */ +NS_IMETHODIMP _MYCLASS_::Stop() +{ + return NS_ERROR_NOT_IMPLEMENTED; +} + +/* End of implementation class template. */ +#endif + + +#endif /* __gen_IDNSSDService_h__ */ diff --git a/mDNSResponder/Clients/FirefoxExtension/IDNSSDService.idl b/mDNSResponder/Clients/FirefoxExtension/IDNSSDService.idl new file mode 100755 index 00000000..d0f62c82 --- /dev/null +++ b/mDNSResponder/Clients/FirefoxExtension/IDNSSDService.idl @@ -0,0 +1,50 @@ +/* -*- Mode: C; tab-width: 4 -*- + * + * Copyright (c) 2009 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 + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * 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. + */ + +#include "nsISupports.idl" + +interface IDNSSDService; + + +[scriptable, function, uuid(27346495-A1ED-458A-A5BC-587DF9A26B4F)] +interface IDNSSDBrowseListener : nsISupports +{ + void + onBrowse( in IDNSSDService service, in boolean add, in long interfaceIndex, in long error, in AString serviceName, in AString regtype, in AString domain ); +}; + + +[scriptable, function, uuid(6620E18F-47F3-47C6-941F-126A5FD4FCF7)] +interface IDNSSDResolveListener : nsISupports +{ + void + onResolve( in IDNSSDService service, in long interfaceIndex, in long error, in AString fullname, in AString host, in short port, in AString path ); +}; + + +[scriptable, uuid(3A3539FF-F8D8-40B4-8D02-5EA73C51FA12)] +interface IDNSSDService : nsISupports +{ + IDNSSDService + browse( in long interfaceIndex, in AString regtype, in AString domain, in IDNSSDBrowseListener listener ); + + IDNSSDService + resolve( in long interfaceIndex, in AString name, in AString regtype, in AString domain, in IDNSSDResolveListener listener ); + + void + stop(); +}; diff --git a/mDNSResponder/Clients/FirefoxExtension/extension/chrome.manifest b/mDNSResponder/Clients/FirefoxExtension/extension/chrome.manifest new file mode 100755 index 00000000..f1daf86c --- /dev/null +++ b/mDNSResponder/Clients/FirefoxExtension/extension/chrome.manifest @@ -0,0 +1,6 @@ +content bonjour4firefox content/ +locale bonjour4firefox en-US locale/en-US/ +skin bonjour4firefox classic/1.0 skin/ +skin bonjour4firefox classic/1.0 skin-darwin/ os=darwin +overlay chrome://browser/content/browser.xul chrome://bonjour4firefox/content/browserOverlay.xul +style chrome://global/content/customizeToolbar.xul chrome://bonjour4firefox/skin/overlay.css diff --git a/mDNSResponder/Clients/FirefoxExtension/extension/components/IDNSSDService.xpt b/mDNSResponder/Clients/FirefoxExtension/extension/components/IDNSSDService.xpt new file mode 100755 index 00000000..bfda3e58 Binary files /dev/null and b/mDNSResponder/Clients/FirefoxExtension/extension/components/IDNSSDService.xpt differ diff --git a/mDNSResponder/Clients/FirefoxExtension/extension/content/_internal_bonjour4firefox.png b/mDNSResponder/Clients/FirefoxExtension/extension/content/_internal_bonjour4firefox.png new file mode 100755 index 00000000..baf8b215 Binary files /dev/null and b/mDNSResponder/Clients/FirefoxExtension/extension/content/_internal_bonjour4firefox.png differ diff --git a/mDNSResponder/Clients/FirefoxExtension/extension/content/_internal_listImage.png b/mDNSResponder/Clients/FirefoxExtension/extension/content/_internal_listImage.png new file mode 100755 index 00000000..278efe37 Binary files /dev/null and b/mDNSResponder/Clients/FirefoxExtension/extension/content/_internal_listImage.png differ diff --git a/mDNSResponder/Clients/FirefoxExtension/extension/content/bonjour4firefox.css b/mDNSResponder/Clients/FirefoxExtension/extension/content/bonjour4firefox.css new file mode 100755 index 00000000..2e7eb2c4 --- /dev/null +++ b/mDNSResponder/Clients/FirefoxExtension/extension/content/bonjour4firefox.css @@ -0,0 +1,16 @@ +tree.sidebar-placesTree treechildren::-moz-tree-row(selected) +{ + background-color: #6f81a9; + background-image: url("chrome://browser/skin/places/selected-gradient.png"); + background-repeat: repeat-x; + background-position: bottom left; + border-top: 1px solid #979797; +} + + +tree.sidebar-placesTree treechildren::-moz-tree-separator +{ + border-top: 1px solid #505d6d; + margin: 0 10px; +} + diff --git a/mDNSResponder/Clients/FirefoxExtension/extension/content/bonjour4firefox.xul b/mDNSResponder/Clients/FirefoxExtension/extension/content/bonjour4firefox.xul new file mode 100755 index 00000000..2be0c691 --- /dev/null +++ b/mDNSResponder/Clients/FirefoxExtension/extension/content/bonjour4firefox.xul @@ -0,0 +1,222 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/mDNSResponder/Clients/FirefoxExtension/extension/content/browserOverlay.xul b/mDNSResponder/Clients/FirefoxExtension/extension/content/browserOverlay.xul new file mode 100755 index 00000000..3b4d6683 --- /dev/null +++ b/mDNSResponder/Clients/FirefoxExtension/extension/content/browserOverlay.xul @@ -0,0 +1,32 @@ + + + + +