From 716635ccb147793c75c5c47b2ed28cb191d0f9c0 Mon Sep 17 00:00:00 2001 From: Apple Date: Fri, 19 Dec 2003 22:43:23 +0000 Subject: [PATCH] mDNSResponder-58.1.tar.gz --- Makefile | 6 +- mDNSCore/mDNS.c | 74 +++-- mDNSCore/mDNSClientAPI.h | 202 +++++++++++++- mDNSCore/mDNSDebug.h | 2 + mDNSCore/mDNSPlatformFunctions.h | 112 +------- mDNSMacOS9/CarbonResource.r | 2 + mDNSMacOS9/Mac OS Test Responder.c | 2 + mDNSMacOS9/Mac OS Test Searcher.c | 2 + mDNSMacOS9/mDNSMacOS9.c | 2 + mDNSMacOS9/mDNSMacOS9.h | 2 + mDNSMacOS9/mDNSPrefixCarbon.h | 2 + mDNSMacOS9/mDNSPrefixCarbonDebug.h | 2 + mDNSMacOS9/mDNSPrefixClassic.h | 2 + .../DNSServiceBrowser/BrowserController.h | 2 + .../DNSServiceBrowser/BrowserController.m | 2 + .../Applications/DNSServiceBrowser/main.m | 2 + .../RegistrationController.h | 2 + .../RegistrationController.m | 2 + .../DNSServiceRegistration/main.m | 2 + .../HAAutomounter/HAAutomounter.h | 2 + .../HAAutomounter/HAAutomounter.m | 2 + mDNSMacOSX/Applications/HAAutomounter/main.m | 2 + mDNSMacOSX/CFSocket.c | 2 + mDNSMacOSX/CFSocketPuma.c | 2 + mDNSMacOSX/DNSServiceDiscoveryDefines.h | 2 + mDNSMacOSX/DNSServiceDiscoveryReply.defs | 2 + mDNSMacOSX/DNSServiceDiscoveryRequest.defs | 2 + mDNSMacOSX/SampleUDSClient.c | 2 + mDNSMacOSX/SamplemDNSClient.c | 2 + mDNSMacOSX/daemon.c | 33 ++- mDNSMacOSX/dns_sd.h | 2 + mDNSMacOSX/dnssd_clientstub.c | 2 + mDNSMacOSX/dnssd_ipc.c | 2 + mDNSMacOSX/dnssd_ipc.h | 2 + mDNSMacOSX/mDNSMacOSX.h | 2 + .../mDNSResponder.pbproj/project.pbxproj | 32 ++- mDNSMacOSX/uds_daemon.c | 35 ++- mDNSPosix/Client.c | 15 +- mDNSPosix/ExampleClientApp.c | 2 + mDNSPosix/ExampleClientApp.h | 2 + mDNSPosix/Identify.c | 27 +- mDNSPosix/NetMonitor.c | 22 +- mDNSPosix/ProxyResponder.c | 42 +-- mDNSPosix/Responder.c | 2 + mDNSPosix/mDNSPosix.c | 7 +- mDNSPosix/mDNSPosix.h | 6 + mDNSPosix/mDNSUNP.c | 2 + mDNSPosix/mDNSUNP.h | 2 + mDNSPosix/parselog.py | 259 +++++++++++++++++ mDNSVxWorks/mDNSVxWorks.c | 2 + mDNSVxWorks/mDNSVxWorks.h | 2 + ...{Application.sln => ApplicationVS2002.sln} | 9 +- ...cation.vcproj => ApplicationVS2002.vcproj} | 2 +- .../Windows/ApplicationVS2003.sln | 24 ++ .../Windows/ApplicationVS2003.vcproj | 264 ++++++++++++++++++ .../Windows/Sources/AboutDialog.cpp | 2 + .../Windows/Sources/AboutDialog.h | 2 + .../Windows/Sources/Application.cpp | 2 + .../Windows/Sources/Application.h | 2 + .../Windows/Sources/ChooserDialog.cpp | 2 + .../Windows/Sources/ChooserDialog.h | 2 + .../Windows/Sources/StdAfx.cpp | 2 + .../Windows/Sources/StdAfx.h | 2 + .../WindowsCE/Sources/Application.cpp | 2 + .../WindowsCE/Sources/Application.h | 2 + .../WindowsCE/Sources/BrowserDialog.cpp | 2 + .../WindowsCE/Sources/BrowserDialog.h | 2 + .../WindowsCE/Sources/StdAfx.cpp | 2 + .../WindowsCE/Sources/StdAfx.h | 2 + .../Applications/RendezvousTest/Tool.c | 2 + .../RendezvousTest/ToolPrefixWindows.h | 2 + .../RendezvousTest/ToolPrefixWindowsDebug.h | 2 + .../{ToolWin32.sln => ToolWin32VS2002.sln} | 9 +- ...oolWin32.vcproj => ToolWin32VS2002.vcproj} | 0 .../RendezvousTest/ToolWin32VS2003.sln | 24 ++ .../RendezvousTest/ToolWin32VS2003.vcproj | 205 ++++++++++++++ mDNSWindows/DNSServices/DNSServiceDiscovery.c | 2 + mDNSWindows/DNSServices/DNSServiceDiscovery.h | 2 + mDNSWindows/DNSServices/DNSServices.c | 2 + mDNSWindows/DNSServices/DNSServices.h | 2 + mDNSWindows/mDNSWin32.c | 2 + mDNSWindows/mDNSWin32.h | 2 + 82 files changed, 1307 insertions(+), 222 deletions(-) create mode 100755 mDNSPosix/parselog.py rename mDNSWindows/Applications/RendezvousBrowser/Windows/{Application.sln => ApplicationVS2002.sln} (74%) rename mDNSWindows/Applications/RendezvousBrowser/Windows/{Application.vcproj => ApplicationVS2002.vcproj} (99%) create mode 100644 mDNSWindows/Applications/RendezvousBrowser/Windows/ApplicationVS2003.sln create mode 100644 mDNSWindows/Applications/RendezvousBrowser/Windows/ApplicationVS2003.vcproj rename mDNSWindows/Applications/RendezvousTest/{ToolWin32.sln => ToolWin32VS2002.sln} (74%) rename mDNSWindows/Applications/RendezvousTest/{ToolWin32.vcproj => ToolWin32VS2002.vcproj} (100%) create mode 100644 mDNSWindows/Applications/RendezvousTest/ToolWin32VS2003.sln create mode 100644 mDNSWindows/Applications/RendezvousTest/ToolWin32VS2003.vcproj diff --git a/Makefile b/Makefile index 96298f8..0e843e9 100644 --- a/Makefile +++ b/Makefile @@ -16,15 +16,13 @@ include /Developer/Makefiles/pb_makefiles/platform.make -MVERS=58 +MVERS = "mDNSResponder-58.1" install: cd "$(SRCROOT)/mDNSMacOSX"; pbxbuild install OBJROOT=$(OBJROOT) SYMROOT=$(SYMROOT) DSTROOT=$(DSTROOT) MVERS=$(MVERS) installsrc: - ditto mDNSCore ${SRCROOT}/mDNSCore - ditto mDNSMacOSX ${SRCROOT}/mDNSMacOSX - ditto Makefile $(SRCROOT) + ditto . ${SRCROOT} installhdrs:: cd "$(SRCROOT)/mDNSMacOSX"; pbxbuild installhdrs OBJROOT=$(OBJROOT) SYMROOT=$(SYMROOT) DSTROOT=$(DSTROOT) MVERS=$(MVERS) diff --git a/mDNSCore/mDNS.c b/mDNSCore/mDNS.c index 748da6a..13ff2f0 100755 --- a/mDNSCore/mDNS.c +++ b/mDNSCore/mDNS.c @@ -3,6 +3,8 @@ * * @APPLE_LICENSE_HEADER_START@ * + * Copyright (c) 1999-2003 Apple Computer, Inc. All Rights Reserved. + * * This file contains Original Code and/or Modifications of Original Code * as defined in and that are subject to the Apple Public Source License * Version 2.0 (the 'License'). You may not use this file except in @@ -44,6 +46,9 @@ Change History (most recent first): $Log: mDNS.c,v $ +Revision 1.307.2.1 2003/12/03 11:20:27 cheshire +: Stop and start of a service uses old ip address (with old port number) + Revision 1.307 2003/09/09 20:13:30 cheshire Don't send a Goodbye record if we never announced it Ammend checkin 1.304: Off-by-one error: By this place in the function we've already decremented @@ -2001,6 +2006,7 @@ mDNSexport void IncrementLabelSuffix(domainlabel *name, mDNSBool RichText) #endif #define RRIsAddressType(RR) ((RR)->resrec.rrtype == kDNSType_A || (RR)->resrec.rrtype == kDNSType_AAAA) +#define RRTypeIsAddressType(T) ((T) == kDNSType_A || (T) == kDNSType_AAAA) #define ResourceRecordIsValidAnswer(RR) ( ((RR)-> resrec.RecordType & kDNSRecordTypeActiveMask) && \ ((RR)->Additional1 == mDNSNULL || ((RR)->Additional1->resrec.RecordType & kDNSRecordTypeActiveMask)) && \ @@ -3254,6 +3260,15 @@ mDNSlocal void DiscardDeregistrations(mDNS *const m) } } +mDNSlocal mDNSBool HaveSentEntireRRSet(const mDNS *const m, const AuthRecord *const rr, mDNSInterfaceID InterfaceID) + { + // Try to find another member of this set that we're still planning to send on this interface + const AuthRecord *a; + for (a = m->ResourceRecords; a; a=a->next) + if (a->SendRNow == InterfaceID && a != rr && SameResourceRecordSignature(&a->resrec, &rr->resrec)) break; + return (a == mDNSNULL); // If no more members of this set found, then we should set the cache flush bit + } + // Note about acceleration of announcements to facilitate automatic coalescing of // multiple independent threads of announcements into a single synchronized thread: // The announcements in the packet may be at different stages of maturity; @@ -3423,22 +3438,17 @@ mDNSlocal void SendResponses(mDNS *const m) } // Now try to see if we can fit the update in the same packet (not fatal if we can't) SetNewRData(&rr->resrec, rr->NewRData, rr->newrdlength); + if ((rr->resrec.RecordType & kDNSRecordTypeUniqueMask) && HaveSentEntireRRSet(m, rr, intf->InterfaceID)) + rr->resrec.rrclass |= kDNSClass_UniqueRRSet; // Temporarily set the cache flush bit so PutResourceRecord will set it newptr = PutResourceRecord(&response, responseptr, &response.h.numAnswers, &rr->resrec); + rr->resrec.rrclass &= ~kDNSClass_UniqueRRSet; // Make sure to clear cache flush bit back to normal state if (newptr) responseptr = newptr; SetNewRData(&rr->resrec, OldRData, oldrdlength); } else { - // If this record is supposed to be unique, see if we've sent its whole set - if (rr->resrec.RecordType & kDNSRecordTypeUniqueMask) - { - // Try to find another member of this set that we're still planning to send on this interface - const AuthRecord *a; - for (a = m->ResourceRecords; a; a=a->next) - if (a->SendRNow == intf->InterfaceID && a != rr && SameResourceRecordSignature(&a->resrec, &rr->resrec)) break; - if (a == mDNSNULL) // If no more members of this set found - rr->resrec.rrclass |= kDNSClass_UniqueRRSet; // Temporarily set the cache flush bit so PutResourceRecord will set it - } + if ((rr->resrec.RecordType & kDNSRecordTypeUniqueMask) && HaveSentEntireRRSet(m, rr, intf->InterfaceID)) + rr->resrec.rrclass |= kDNSClass_UniqueRRSet; // Temporarily set the cache flush bit so PutResourceRecord will set it newptr = PutResourceRecordTTL(&response, responseptr, &response.h.numAnswers, &rr->resrec, m->SleepState ? 0 : rr->resrec.rroriginalttl); rr->resrec.rrclass &= ~kDNSClass_UniqueRRSet; // Make sure to clear cache flush bit back to normal state if (!newptr && response.h.numAnswers) break; @@ -4208,6 +4218,8 @@ mDNSlocal void CheckCacheExpiration(mDNS *const m, mDNSu32 slot) rp = &rr->next; } } + if (m->rrcache_tail[slot] != rp) debugf("CheckCacheExpiration: Updating m->rrcache_tail[%d] from %p to %p", slot, m->rrcache_tail[slot], rp); + m->rrcache_tail[slot] = rp; m->lock_rrcache = 0; } @@ -4253,6 +4265,9 @@ mDNSlocal void AnswerNewQuestion(mDNS *const m) // MUST NOT dereference q again after calling AnswerQuestionWithResourceRecord() if (m->CurrentQuestion != q) break; // If callback deleted q, then we're finished here } + else if (RRTypeIsAddressType(rr->resrec.rrtype) && RRTypeIsAddressType(q->qtype)) + if (rr->resrec.namehash == q->qnamehash && SameDomainName(&rr->resrec.name, &q->qname)) + ShouldQueryImmediately = mDNSfalse; if (ShouldQueryImmediately && m->CurrentQuestion == q) { @@ -4371,23 +4386,24 @@ mDNSlocal CacheRecord *GetFreeCacheRR(mDNS *const m, mDNSu16 RDLength) mDNSu32 oldtotalused = m->rrcache_totalused; #endif mDNSu32 slot; - CacheRecord **rr; for (slot = 0; slot < CACHE_HASH_SLOTS; slot++) { - rr = &(m->rrcache_hash[slot]); - while (*rr) + CacheRecord **rp = &(m->rrcache_hash[slot]); + while (*rp) { // Records that answer still-active questions are not candidates for deletion - if ((*rr)->CRActiveQuestion) - rr=&(*rr)->next; + if ((*rp)->CRActiveQuestion) + rp=&(*rp)->next; else { - CacheRecord *r = *rr; - *rr = (*rr)->next; // Cut record from list + CacheRecord *rr = *rp; + *rp = (*rp)->next; // Cut record from list m->rrcache_used[slot]--; // Decrement counts - ReleaseCacheRR(m, r); + ReleaseCacheRR(m, rr); } } + if (m->rrcache_tail[slot] != rp) debugf("GetFreeCacheRR: Updating m->rrcache_tail[%d] from %p to %p", slot, m->rrcache_tail[slot], rp); + m->rrcache_tail[slot] = rp; } #if MDNS_DEBUGMSGS debugf("Clear unused records; m->rrcache_totalused was %lu; now %lu", oldtotalused, m->rrcache_totalused); @@ -5537,8 +5553,9 @@ mDNSlocal void mDNSCoreReceiveResponse(mDNS *const m, // If this is an oversized record with external storage allocated, copy rdata to external storage if (pkt.r.resrec.rdlength > InlineCacheRDSize) mDNSPlatformMemCopy(pkt.r.resrec.rdata, rr->resrec.rdata, sizeofRDataHeader + pkt.r.resrec.rdlength); - rr->next = m->rrcache_hash[slot]; - m->rrcache_hash[slot] = rr; + rr->next = mDNSNULL; // Clear 'next' pointer + *(m->rrcache_tail[slot]) = rr; // Append this record to tail of cache slot list + m->rrcache_tail[slot] = &(rr->next); // Advance tail pointer m->rrcache_used[slot]++; //debugf("Adding RR %##s to cache (%d)", pkt.r.name.c, m->rrcache_used); CacheRecordAdd(m, rr); @@ -6398,12 +6415,12 @@ mDNSexport mStatus mDNS_RegisterInterface(mDNS *const m, NetworkInterfaceInfo *s // even if we believe that we previously had an active representative of this interface. if ((m->KnownBugs & mDNS_KnownBug_PhantomInterfaces) || FirstOfType || set->InterfaceActive) { + DNSQuestion *q; + AuthRecord *rr; // Use a small amount of randomness: // In the case of a network administrator turning on an Ethernet hub so that all the connected machines establish link at // exactly the same time, we don't want them to all go and hit the network with identical queries at exactly the same moment. if (!m->SuppressSending) m->SuppressSending = m->timenow + (mDNSs32)mDNSRandom((mDNSu32)InitialQuestionInterval); - DNSQuestion *q; - AuthRecord *rr; for (q = m->Questions; q; q=q->next) // Scan our list of questions if (!q->InterfaceID || q->InterfaceID == set->InterfaceID) // If non-specific Q, or Q on this specific interface, { // then reactivate this question @@ -6855,7 +6872,7 @@ mDNSexport mStatus mDNS_Init(mDNS *const m, mDNS_PlatformSupport *const p, CacheRecord *rrcachestorage, mDNSu32 rrcachesize, mDNSBool AdvertiseLocalAddresses, mDNSCallback *Callback, void *Context) { - mDNSu32 i; + mDNSu32 slot; mDNSs32 timenow; mStatus result = mDNSPlatformTimeInit(&timenow); if (result != mStatus_NoError) return(result); @@ -6905,10 +6922,11 @@ mDNSexport mStatus mDNS_Init(mDNS *const m, mDNS_PlatformSupport *const p, m->rrcache_report = 10; m->rrcache_free = mDNSNULL; - for (i = 0; i < CACHE_HASH_SLOTS; i++) + for (slot = 0; slot < CACHE_HASH_SLOTS; slot++) { - m->rrcache_hash[i] = mDNSNULL; - m->rrcache_used[i] = 0; + m->rrcache_hash[slot] = mDNSNULL; + m->rrcache_tail[slot] = &m->rrcache_hash[slot]; + m->rrcache_used[slot] = 0; } mDNS_GrowCache(m, rrcachestorage, rrcachesize); @@ -6954,6 +6972,7 @@ mDNSexport void mDNS_Close(mDNS *const m) rrcache_totalused = m->rrcache_totalused; for (slot = 0; slot < CACHE_HASH_SLOTS; slot++) + { while (m->rrcache_hash[slot]) { CacheRecord *rr = m->rrcache_hash[slot]; @@ -6962,6 +6981,9 @@ mDNSexport void mDNS_Close(mDNS *const m) m->rrcache_used[slot]--; ReleaseCacheRR(m, rr); } + // Reset tail pointer back to empty state (not that it really matters on exit, but we'll do it anyway, for the sake of completeness) + m->rrcache_tail[slot] = &m->rrcache_hash[slot]; + } debugf("mDNS_Close: RR Cache was using %ld records, %d active", rrcache_totalused, rrcache_active); if (rrcache_active != m->rrcache_active) LogMsg("*** ERROR *** rrcache_active %lu != m->rrcache_active %lu", rrcache_active, m->rrcache_active); diff --git a/mDNSCore/mDNSClientAPI.h b/mDNSCore/mDNSClientAPI.h index 975d559..e7e56cf 100755 --- a/mDNSCore/mDNSClientAPI.h +++ b/mDNSCore/mDNSClientAPI.h @@ -3,6 +3,8 @@ * * @APPLE_LICENSE_HEADER_START@ * + * Copyright (c) 1999-2003 Apple Computer, Inc. All Rights Reserved. + * * This file contains Original Code and/or Modifications of Original Code * as defined in and that are subject to the Apple Public Source License * Version 2.0 (the 'License'). You may not use this file except in @@ -23,6 +25,15 @@ Change History (most recent first): $Log: mDNSClientAPI.h,v $ +Revision 1.114.2.3 2003/12/05 00:03:34 cheshire + Use buffer size MAX_ESCAPED_DOMAIN_NAME instead of 256 + +Revision 1.114.2.2 2003/12/04 23:30:00 cheshire +Add "#define MAX_ESCAPED_DOMAIN_NAME 1005", needed for Posix folder to build + +Revision 1.114.2.1 2003/12/03 11:07:58 cheshire +: Stop and start of a service uses old ip address (with old port number) + Revision 1.114 2003/08/29 19:44:15 cheshire Traffic reduction: Eliminate synchronized QUs when a new service appears 1. Use m->RandomQueryDelay to impose a random delay in the range 0-500ms on queries @@ -517,7 +528,11 @@ enum mStatus_Waiting = 1, mStatus_NoError = 0, - // mDNS Error codes are in the range FFFE FF00 (-65792) to FFFE FFFF (-65537) + // mDNS return values are in the range FFFE FF00 (-65792) to FFFE FFFF (-65537) + // The top end of the range (FFFE FFFF) is used for error codes; + // the bottom end of the range (FFFE FF00) is used for non-error values; + + // Error codes: mStatus_UnknownErr = -65537, // 0xFFFE FFFF mStatus_NoSuchNameErr = -65538, mStatus_NoMemoryErr = -65539, @@ -531,8 +546,14 @@ enum mStatus_AlreadyRegistered = -65547, mStatus_NameConflict = -65548, mStatus_Invalid = -65549, - mStatus_GrowCache = -65550, + // = -65550, mStatus_Incompatible = -65551, + mStatus_BadInterfaceErr = -65552, + + // -65553 - -65789 currently unused + + // Non-error values: + mStatus_GrowCache = -65790, mStatus_ConfigChanged = -65791, mStatus_MemFree = -65792 // 0xFFFE FF00 }; @@ -549,6 +570,21 @@ typedef struct { mDNSu8 c[256]; } domainname; // Up to 255 bytes of length-pref typedef struct { mDNSu8 c[256]; } UTF8str255; // Null-terminated C string +// The longest legal textual form of a DNS name is 1005 bytes, including the C-string terminating NULL at the end. +// Explanation: +// When a native domainname object is converted to printable textual form using ConvertDomainNameToCString(), +// non-printing characters are represented in the conventional DNS way, as '\ddd', where ddd is a three-digit decimal number. +// The longest legal domain name is 255 bytes, in the form of four labels as shown below: +// Length byte, 63 data bytes, length byte, 63 data bytes, length byte, 63 data bytes, length byte, 61 data bytes, zero byte. +// Each label is encoded textually as characters followed by a trailing dot. +// If every character has to be represented as a four-byte escape sequence, then this makes the maximum textual form four labels +// plus the C-string terminating NULL as shown below: +// 63*4+1 + 63*4+1 + 63*4+1 + 61*4+1 + 1 = 1005. +// Note that MAX_ESCAPED_DOMAIN_LABEL is not normally used: If you're only decoding a single label, escaping is usually not required. +// It is for domain names, where dots are used as label separators, that proper escaping is vital. +#define MAX_ESCAPED_DOMAIN_LABEL 254 +#define MAX_ESCAPED_DOMAIN_NAME 1005 + // *************************************************************************** #if 0 #pragma mark - Resource Record structures @@ -994,6 +1030,7 @@ struct mDNS_struct mDNSu32 rrcache_report; CacheRecord *rrcache_free; CacheRecord *rrcache_hash[CACHE_HASH_SLOTS]; + CacheRecord **rrcache_tail[CACHE_HASH_SLOTS]; mDNSu32 rrcache_used[CACHE_HASH_SLOTS]; // Fields below only required for mDNS Responder... @@ -1041,6 +1078,15 @@ extern const mDNSAddr AllDNSLinkGroup_v6; // Every client should call mDNS_Init, passing in storage for the mDNS object, mDNS_PlatformSupport object, and rrcache. // The rrcachesize parameter is the size of (i.e. number of entries in) the rrcache array passed in. +// Most clients use mDNS_Init_AdvertiseLocalAddresses. This causes mDNSCore to automatically +// create the correct address records for all the hosts interfaces. If you plan to advertise +// services being offered by the local machine, this is almost always what you want. +// There are two cases where you might use mDNS_Init_DontAdvertiseLocalAddresses: +// 1. A client-only device, that browses for services but doesn't advertise any of its own. +// 2. A proxy-registration service, that advertises services being offered by other machines, and takes +// the appropriate steps to manually create the correct address records for those other machines. +// In principle, a proxy-like registration service could manually create address records for its own machine too, +// but this would be pointless extra effort when using mDNS_Init_AdvertiseLocalAddresses does that for you. // When mDNS has finished setting up the client's callback is called // A client can also spin and poll the mDNSPlatformStatus field to see when it changes from mStatus_Waiting to mStatus_NoError // @@ -1055,13 +1101,12 @@ extern const mDNSAddr AllDNSLinkGroup_v6; // is received containing a record which matches the question, the DNSQuestion's mDNSAnswerCallback function will be called // Call mDNS_StopQuery when no more answers are required // -// The mDNS routines are intentionally not thread-safe -- adding locking operations would add overhead that may not -// be necessary or appropriate on every platform. Instead, code in a pre-emptive environment calling any mDNS routine -// (except mDNS_Init and mDNS_Close) is responsible for doing the necessary synchronization to ensure that mDNS code is -// not re-entered. This includes both client software above mDNS, and the platform support code below. For example, if -// the support code on a particular platform implements timer callbacks at interrupt time, then clients on that platform -// need to disable interrupts or do similar concurrency control to ensure that the mDNS code is not entered by an -// interrupt-time timer callback while in the middle of processing a client call. +// Care should be taken on multi-threaded or interrupt-driven environments. +// The main mDNS routines call mDNSPlatformLock() on entry and mDNSPlatformUnlock() on exit; +// each platform layer needs to implement these appropriately for its respective platform. +// For example, if the support code on a particular platform implements timer callbacks at interrupt time, then +// mDNSPlatformLock/Unlock need to disable interrupts or do similar concurrency control to ensure that the mDNS +// code is not entered by an interrupt-time timer callback while in the middle of processing a client call. extern mStatus mDNS_Init (mDNS *const m, mDNS_PlatformSupport *const p, CacheRecord *rrcachestorage, mDNSu32 rrcachesize, @@ -1069,10 +1114,12 @@ extern mStatus mDNS_Init (mDNS *const m, mDNS_PlatformSupport *const p, mDNSCallback *Callback, void *Context); #define mDNS_Init_NoCache mDNSNULL #define mDNS_Init_ZeroCacheSize 0 +// See notes above on use of Advertise/DontAdvertiseLocalAddresses #define mDNS_Init_AdvertiseLocalAddresses mDNStrue #define mDNS_Init_DontAdvertiseLocalAddresses mDNSfalse #define mDNS_Init_NoInitCallback mDNSNULL #define mDNS_Init_NoInitCallbackContext mDNSNULL + extern void mDNS_GrowCache (mDNS *const m, CacheRecord *storage, mDNSu32 numrecords); extern void mDNS_Close (mDNS *const m); extern mDNSs32 mDNS_Execute (mDNS *const m); @@ -1168,6 +1215,12 @@ extern mStatus mDNS_AdvertiseDomains(mDNS *const m, AuthRecord *rr, mDNS_DomainT // work with DNS's native length-prefixed strings. For convenience in C, the following utility functions // are provided for converting between C's null-terminated strings and DNS's length-prefixed strings. +// Assignment +// A simple C structure assignment of a domainname can cause a protection fault by accessing unmapped memory, +// because that object is defined to be 256 bytes long, but not all domainname objects are truly the full size. +// This macro uses mDNSPlatformMemCopy() to make sure it only touches the actual bytes that are valid. +#define AssignDomainName(DST, SRC) mDNSPlatformMemCopy((SRC).c, (DST).c, DomainNameLength(&(SRC))) + // Comparison functions extern mDNSBool SameDomainLabel(const mDNSu8 *a, const mDNSu8 *b); extern mDNSBool SameDomainName(const domainname *const d1, const domainname *const d2); @@ -1195,6 +1248,12 @@ extern mDNSBool MakeDomainLabelFromLiteralString(domainlabel *const label, const extern mDNSu8 *MakeDomainNameFromDNSNameString (domainname *const name, const char *cstr); // Convert native format domainlabel or domainname back to C string format +// IMPORTANT: +// When using ConvertDomainLabelToCString, the target buffer must be MAX_ESCAPED_DOMAIN_LABEL (254) bytes long +// to guarantee there will be no buffer overrun. It is only safe to use a buffer shorter than this in rare cases +// where the label is known to be constrained somehow (for example, if the label is known to be either "_tcp" or "_udp"). +// Similarly, when using ConvertDomainNameToCString, the target buffer must be MAX_ESCAPED_DOMAIN_NAME (1005) bytes long. +// See definitions of MAX_ESCAPED_DOMAIN_LABEL and MAX_ESCAPED_DOMAIN_NAME for more detailed explanation. extern char *ConvertDomainLabelToCString_withescape(const domainlabel *const name, char *cstr, char esc); #define ConvertDomainLabelToCString_unescaped(D,C) ConvertDomainLabelToCString_withescape((D), (C), 0) #define ConvertDomainLabelToCString(D,C) ConvertDomainLabelToCString_withescape((D), (C), '\\') @@ -1231,6 +1290,131 @@ extern char *GetRRDisplayString_rdb(mDNS *const m, const ResourceRecord *rr, RDa extern mDNSBool mDNSSameAddress(const mDNSAddr *ip1, const mDNSAddr *ip2); extern void IncrementLabelSuffix(domainlabel *name, mDNSBool RichText); +// *************************************************************************** +#if 0 +#pragma mark - PlatformSupport interface +#endif + +// This section defines the interface to the Platform Support layer. +// Normal client code should not use any of types defined here, or directly call any of the functions defined here. +// The definitions are placed here because sometimes clients do use these calls indirectly, via other supported client operations. +// For example, AssignDomainName is a macro defined using mDNSPlatformMemCopy() + +typedef struct + { + mDNSOpaque16 id; + mDNSOpaque16 flags; + mDNSu16 numQuestions; + mDNSu16 numAnswers; + mDNSu16 numAuthorities; + mDNSu16 numAdditionals; + } DNSMessageHeader; + +// We can send and receive packets up to 9000 bytes (Ethernet Jumbo Frame size, if that ever becomes widely used) +// However, in the normal case we try to limit packets to 1500 bytes so that we don't get IP fragmentation on standard Ethernet +// 40 (IPv6 header) + 8 (UDP header) + 12 (DNS message header) + 1440 (DNS message body) = 1500 total +#define AbsoluteMaxDNSMessageData 8940 +#define NormalMaxDNSMessageData 1440 +typedef struct + { + DNSMessageHeader h; // Note: Size 12 bytes + mDNSu8 data[AbsoluteMaxDNSMessageData]; // 40 (IPv6) + 8 (UDP) + 12 (DNS header) + 8940 (data) = 9000 + } DNSMessage; + +// Every platform support module must provide the following functions. +// mDNSPlatformInit() typically opens a communication endpoint, and starts listening for mDNS packets. +// When Setup is complete, the platform support layer calls mDNSCoreInitComplete(). +// mDNSPlatformSendUDP() sends one UDP packet +// When a packet is received, the PlatformSupport code calls mDNSCoreReceive() +// mDNSPlatformClose() tidies up on exit +// Note: mDNSPlatformMemAllocate/mDNSPlatformMemFree are only required for handling oversized resource records. +// If your target platform has a well-defined specialized application, and you know that all the records it uses +// are InlineCacheRDSize or less, then you can just make a simple mDNSPlatformMemAllocate() stub that always returns +// NULL. InlineCacheRDSize is a compile-time constant, which is set by default to 64. If you need to handle records +// a little larger than this and you don't want to have to implement run-time allocation and freeing, then you +// can raise the value of this constant to a suitable value (at the expense of increased memory usage). +extern mStatus mDNSPlatformInit (mDNS *const m); +extern void mDNSPlatformClose (mDNS *const m); +extern mStatus mDNSPlatformSendUDP(const mDNS *const m, const DNSMessage *const msg, const mDNSu8 *const end, + mDNSInterfaceID InterfaceID, mDNSIPPort srcport, const mDNSAddr *dst, mDNSIPPort dstport); + +extern void mDNSPlatformLock (const mDNS *const m); +extern void mDNSPlatformUnlock (const mDNS *const m); + +extern void mDNSPlatformStrCopy (const void *src, void *dst); +extern mDNSu32 mDNSPlatformStrLen (const void *src); +extern void mDNSPlatformMemCopy (const void *src, void *dst, mDNSu32 len); +extern mDNSBool mDNSPlatformMemSame (const void *src, const void *dst, mDNSu32 len); +extern void mDNSPlatformMemZero ( void *dst, mDNSu32 len); +extern void * mDNSPlatformMemAllocate (mDNSu32 len); +extern void mDNSPlatformMemFree (void *mem); +extern mStatus mDNSPlatformTimeInit (mDNSs32 *timenow); + +// The core mDNS code provides these functions, for the platform support code to call at appropriate times +// +// mDNS_GenerateFQDN() is called once on startup (typically from mDNSPlatformInit()) +// and then again on each subsequent change of the dot-local host name. +// +// mDNS_RegisterInterface() is used by the platform support layer to inform mDNSCore of what +// physical and/or logical interfaces are available for sending and receiving packets. +// Typically it is called on startup for each available interface, but register/deregister may be +// called again later, on multiple occasions, to inform the core of interface configuration changes. +// If set->Advertise is set non-zero, then mDNS_RegisterInterface() also registers the standard +// resource records that should be associated with every publicised IP address/interface: +// -- Name-to-address records (A/AAAA) +// -- Address-to-name records (PTR) +// -- Host information (HINFO) +// +// mDNSCoreInitComplete() is called when the platform support layer is finished. +// Typically this is at the end of mDNSPlatformInit(), but may be later +// (on platforms like OT that allow asynchronous initialization of the networking stack). +// +// mDNSCoreReceive() is called when a UDP packet is received +// +// mDNSCoreMachineSleep() is called when the machine sleeps or wakes +// (This refers to heavyweight laptop-style sleep/wake that disables network access, +// not lightweight second-by-second CPU power management modes.) + +extern void mDNS_GenerateFQDN(mDNS *const m); +extern mStatus mDNS_RegisterInterface (mDNS *const m, NetworkInterfaceInfo *set); +extern void mDNS_DeregisterInterface(mDNS *const m, NetworkInterfaceInfo *set); +extern void mDNSCoreInitComplete(mDNS *const m, mStatus result); +extern void mDNSCoreReceive(mDNS *const m, DNSMessage *const msg, const mDNSu8 *const end, + const mDNSAddr *const srcaddr, const mDNSIPPort srcport, + const mDNSAddr *const dstaddr, const mDNSIPPort dstport, const mDNSInterfaceID InterfaceID, mDNSu8 ttl); +extern void mDNSCoreMachineSleep(mDNS *const m, mDNSBool wake); + +// *************************************************************************** +#if 0 +#pragma mark - Compile-Time assertion checks +#endif + +// Some C compiler cleverness. We can make the compiler check certain things for +// us, and report compile-time errors if anything is wrong. The usual way to do +// this would be to use a run-time "if" statement, but then you don't find out +// what's wrong until you run the software. This way, if the assertion condition +// is false, the array size is negative, and the complier complains immediately. + +struct mDNS_CompileTimeAssertionChecks + { + // Check that the compiler generated our on-the-wire packet format structure definitions + // properly packed, without adding padding bytes to align fields on 32-bit or 64-bit boundaries. + char assert0[(sizeof(rdataSRV) == 262 ) ? 1 : -1]; + char assert1[(sizeof(DNSMessageHeader) == 12 ) ? 1 : -1]; + char assert2[(sizeof(DNSMessage) == 12+AbsoluteMaxDNSMessageData) ? 1 : -1]; + char assert3[(sizeof(mDNSs8) == 1 ) ? 1 : -1]; + char assert4[(sizeof(mDNSu8) == 1 ) ? 1 : -1]; + char assert5[(sizeof(mDNSs16) == 2 ) ? 1 : -1]; + char assert6[(sizeof(mDNSu16) == 2 ) ? 1 : -1]; + char assert7[(sizeof(mDNSs32) == 4 ) ? 1 : -1]; + char assert8[(sizeof(mDNSu32) == 4 ) ? 1 : -1]; + char assert9[(sizeof(mDNSOpaque16) == 2 ) ? 1 : -1]; + char assertA[(sizeof(mDNSOpaque32) == 4 ) ? 1 : -1]; + char assertB[(sizeof(mDNSOpaque128) == 16 ) ? 1 : -1]; + }; + +// *************************************************************************** + #ifdef __cplusplus } #endif diff --git a/mDNSCore/mDNSDebug.h b/mDNSCore/mDNSDebug.h index 65b6daf..0ac194f 100755 --- a/mDNSCore/mDNSDebug.h +++ b/mDNSCore/mDNSDebug.h @@ -3,6 +3,8 @@ * * @APPLE_LICENSE_HEADER_START@ * + * Copyright (c) 1999-2003 Apple Computer, Inc. All Rights Reserved. + * * This file contains Original Code and/or Modifications of Original Code * as defined in and that are subject to the Apple Public Source License * Version 2.0 (the 'License'). You may not use this file except in diff --git a/mDNSCore/mDNSPlatformFunctions.h b/mDNSCore/mDNSPlatformFunctions.h index beef207..71645b2 100755 --- a/mDNSCore/mDNSPlatformFunctions.h +++ b/mDNSCore/mDNSPlatformFunctions.h @@ -3,6 +3,8 @@ * * @APPLE_LICENSE_HEADER_START@ * + * Copyright (c) 1999-2003 Apple Computer, Inc. All Rights Reserved. + * * This file contains Original Code and/or Modifications of Original Code * as defined in and that are subject to the Apple Public Source License * Version 2.0 (the 'License'). You may not use this file except in @@ -23,6 +25,9 @@ Change History (most recent first): $Log: mDNSPlatformFunctions.h,v $ +Revision 1.22.2.1 2003/12/05 00:03:34 cheshire + Use buffer size MAX_ESCAPED_DOMAIN_NAME instead of 256 + Revision 1.22 2003/08/18 22:53:37 cheshire mDNSResponder divide by zero in mDNSPlatformTimeNow() @@ -77,109 +82,4 @@ Merge in license terms from Quinn's copy, in preparation for Darwin release */ -#ifndef __mDNSPlatformFunctions_h -#define __mDNSPlatformFunctions_h - -// *************************************************************************** -// Support functions which must be provided by each set of specific PlatformSupport files - -// mDNSPlatformInit() typically opens a communication endpoint, and starts listening for mDNS packets. -// When Setup is complete, the callback is called. -// mDNSPlatformSendUDP() sends one UDP packet -// When a packet is received, the PlatformSupport code calls mDNSCoreReceive() -// mDNSPlatformClose() tidies up on exit - -#ifdef __cplusplus - extern "C" { -#endif - -// *************************************************************************** -// DNS protocol message format - -typedef struct - { - mDNSOpaque16 id; - mDNSOpaque16 flags; - mDNSu16 numQuestions; - mDNSu16 numAnswers; - mDNSu16 numAuthorities; - mDNSu16 numAdditionals; - } DNSMessageHeader; - -// We can send and receive packets up to 9000 bytes (Ethernet Jumbo Frame size, if that ever becomes widely used) -// However, in the normal case we try to limit packets to 1500 bytes so that we don't get IP fragmentation on standard Ethernet -// 40 (IPv6 header) + 8 (UDP header) + 12 (DNS message header) + 1440 (DNS message body) = 1500 total -#define AbsoluteMaxDNSMessageData 8940 -#define NormalMaxDNSMessageData 1440 -typedef struct - { - DNSMessageHeader h; // Note: Size 12 bytes - mDNSu8 data[AbsoluteMaxDNSMessageData]; // 40 (IPv6) + 8 (UDP) + 12 (DNS header) + 8940 (data) = 9000 - } DNSMessage; - -// *************************************************************************** -// Functions - -// Every platform support module must provide the following functions. -// Note: mDNSPlatformMemAllocate/mDNSPlatformMemFree are only required for handling oversized resource records. -// If your target platform has a well-defined specialized application, and you know that all the records it uses -// are InlineCacheRDSize or less, then you can just make a simple mDNSPlatformMemAllocate() stub that always returns -// NULL. InlineCacheRDSize is a compile-time constant, which is set by default to 64. If you need to handle records -// a little larger than this and you don't want to have to implement run-time allocation and freeing, then you -// can raise the value of this constant to a suitable value (at the expense of increased memory usage). -extern mStatus mDNSPlatformInit (mDNS *const m); -extern void mDNSPlatformClose (mDNS *const m); -extern mStatus mDNSPlatformSendUDP(const mDNS *const m, const DNSMessage *const msg, const mDNSu8 *const end, - mDNSInterfaceID InterfaceID, mDNSIPPort srcport, const mDNSAddr *dst, mDNSIPPort dstport); - -extern void mDNSPlatformLock (const mDNS *const m); -extern void mDNSPlatformUnlock (const mDNS *const m); - -extern void mDNSPlatformStrCopy (const void *src, void *dst); -extern mDNSu32 mDNSPlatformStrLen (const void *src); -extern void mDNSPlatformMemCopy (const void *src, void *dst, mDNSu32 len); -extern mDNSBool mDNSPlatformMemSame (const void *src, const void *dst, mDNSu32 len); -extern void mDNSPlatformMemZero ( void *dst, mDNSu32 len); -extern void * mDNSPlatformMemAllocate (mDNSu32 len); -extern void mDNSPlatformMemFree (void *mem); -extern mStatus mDNSPlatformTimeInit (mDNSs32 *timenow); - -// The core mDNS code provides these functions, for the platform support code to call at appropriate times -// -// mDNS_GenerateFQDN() is called once on startup (typically from mDNSPlatformInit()) -// and then again on each subsequent dot-local host name change. -// -// mDNS_RegisterInterface() is used by the platform support layer to inform mDNSCore of what -// physical and/or logical interfaces are available for sending and receiving packets. -// Typically it is called on startup for each available interface, but register/deregister may be -// called again later, on multiple occasions, to inform the core of interface configuration changes. -// If set->Advertise is set non-zero, then mDNS_RegisterInterface() also registers the standard -// resource records that should be associated with every publicised IP address/interface: -// -- Name-to-address records (A/AAAA) -// -- Address-to-name records (PTR) -// -- Host information (HINFO) -// -// mDNSCoreInitComplete() is called when the platform support layer is finished. -// Typically this is at the end of mDNSPlatformInit(), but may be later -// (on platforms like OT that allow asynchronous initialization of the networking stack). -// -// mDNSCoreReceive() is called when a UDP packet is received -// -// mDNSCoreMachineSleep() is called when the machine sleeps or wakes -// (This refers to heavyweight laptop-style sleep/wake that disables network access, -// not lightweight second-by-second CPU power management modes.) - -extern void mDNS_GenerateFQDN(mDNS *const m); -extern mStatus mDNS_RegisterInterface (mDNS *const m, NetworkInterfaceInfo *set); -extern void mDNS_DeregisterInterface(mDNS *const m, NetworkInterfaceInfo *set); -extern void mDNSCoreInitComplete(mDNS *const m, mStatus result); -extern void mDNSCoreReceive(mDNS *const m, DNSMessage *const msg, const mDNSu8 *const end, - const mDNSAddr *const srcaddr, const mDNSIPPort srcport, - const mDNSAddr *const dstaddr, const mDNSIPPort dstport, const mDNSInterfaceID InterfaceID, mDNSu8 ttl); -extern void mDNSCoreMachineSleep(mDNS *const m, mDNSBool wake); - -#ifdef __cplusplus - } -#endif - -#endif +// Note: All moved to mDNSClientAPI.h diff --git a/mDNSMacOS9/CarbonResource.r b/mDNSMacOS9/CarbonResource.r index 105a398..853a4ac 100644 --- a/mDNSMacOS9/CarbonResource.r +++ b/mDNSMacOS9/CarbonResource.r @@ -3,6 +3,8 @@ * * @APPLE_LICENSE_HEADER_START@ * + * Copyright (c) 1999-2003 Apple Computer, Inc. All Rights Reserved. + * * This file contains Original Code and/or Modifications of Original Code * as defined in and that are subject to the Apple Public Source License * Version 2.0 (the 'License'). You may not use this file except in diff --git a/mDNSMacOS9/Mac OS Test Responder.c b/mDNSMacOS9/Mac OS Test Responder.c index 7c55ca3..bd8f376 100644 --- a/mDNSMacOS9/Mac OS Test Responder.c +++ b/mDNSMacOS9/Mac OS Test Responder.c @@ -3,6 +3,8 @@ * * @APPLE_LICENSE_HEADER_START@ * + * Copyright (c) 1999-2003 Apple Computer, Inc. All Rights Reserved. + * * This file contains Original Code and/or Modifications of Original Code * as defined in and that are subject to the Apple Public Source License * Version 2.0 (the 'License'). You may not use this file except in diff --git a/mDNSMacOS9/Mac OS Test Searcher.c b/mDNSMacOS9/Mac OS Test Searcher.c index d55dcd5..fc5d803 100644 --- a/mDNSMacOS9/Mac OS Test Searcher.c +++ b/mDNSMacOS9/Mac OS Test Searcher.c @@ -3,6 +3,8 @@ * * @APPLE_LICENSE_HEADER_START@ * + * Copyright (c) 1999-2003 Apple Computer, Inc. All Rights Reserved. + * * This file contains Original Code and/or Modifications of Original Code * as defined in and that are subject to the Apple Public Source License * Version 2.0 (the 'License'). You may not use this file except in diff --git a/mDNSMacOS9/mDNSMacOS9.c b/mDNSMacOS9/mDNSMacOS9.c index cdb49b3..efef8b8 100644 --- a/mDNSMacOS9/mDNSMacOS9.c +++ b/mDNSMacOS9/mDNSMacOS9.c @@ -3,6 +3,8 @@ * * @APPLE_LICENSE_HEADER_START@ * + * Copyright (c) 1999-2003 Apple Computer, Inc. All Rights Reserved. + * * This file contains Original Code and/or Modifications of Original Code * as defined in and that are subject to the Apple Public Source License * Version 2.0 (the 'License'). You may not use this file except in diff --git a/mDNSMacOS9/mDNSMacOS9.h b/mDNSMacOS9/mDNSMacOS9.h index d707f9f..1256183 100755 --- a/mDNSMacOS9/mDNSMacOS9.h +++ b/mDNSMacOS9/mDNSMacOS9.h @@ -3,6 +3,8 @@ * * @APPLE_LICENSE_HEADER_START@ * + * Copyright (c) 1999-2003 Apple Computer, Inc. All Rights Reserved. + * * This file contains Original Code and/or Modifications of Original Code * as defined in and that are subject to the Apple Public Source License * Version 2.0 (the 'License'). You may not use this file except in diff --git a/mDNSMacOS9/mDNSPrefixCarbon.h b/mDNSMacOS9/mDNSPrefixCarbon.h index 95f1a48..d05d257 100644 --- a/mDNSMacOS9/mDNSPrefixCarbon.h +++ b/mDNSMacOS9/mDNSPrefixCarbon.h @@ -3,6 +3,8 @@ * * @APPLE_LICENSE_HEADER_START@ * + * Copyright (c) 1999-2003 Apple Computer, Inc. All Rights Reserved. + * * This file contains Original Code and/or Modifications of Original Code * as defined in and that are subject to the Apple Public Source License * Version 2.0 (the 'License'). You may not use this file except in diff --git a/mDNSMacOS9/mDNSPrefixCarbonDebug.h b/mDNSMacOS9/mDNSPrefixCarbonDebug.h index 2c31a97..4824cc2 100644 --- a/mDNSMacOS9/mDNSPrefixCarbonDebug.h +++ b/mDNSMacOS9/mDNSPrefixCarbonDebug.h @@ -3,6 +3,8 @@ * * @APPLE_LICENSE_HEADER_START@ * + * Copyright (c) 1999-2003 Apple Computer, Inc. All Rights Reserved. + * * This file contains Original Code and/or Modifications of Original Code * as defined in and that are subject to the Apple Public Source License * Version 2.0 (the 'License'). You may not use this file except in diff --git a/mDNSMacOS9/mDNSPrefixClassic.h b/mDNSMacOS9/mDNSPrefixClassic.h index d275361..9cc2013 100644 --- a/mDNSMacOS9/mDNSPrefixClassic.h +++ b/mDNSMacOS9/mDNSPrefixClassic.h @@ -3,6 +3,8 @@ * * @APPLE_LICENSE_HEADER_START@ * + * Copyright (c) 1999-2003 Apple Computer, Inc. All Rights Reserved. + * * This file contains Original Code and/or Modifications of Original Code * as defined in and that are subject to the Apple Public Source License * Version 2.0 (the 'License'). You may not use this file except in diff --git a/mDNSMacOSX/Applications/DNSServiceBrowser/BrowserController.h b/mDNSMacOSX/Applications/DNSServiceBrowser/BrowserController.h index f58c914..8f81a9f 100755 --- a/mDNSMacOSX/Applications/DNSServiceBrowser/BrowserController.h +++ b/mDNSMacOSX/Applications/DNSServiceBrowser/BrowserController.h @@ -3,6 +3,8 @@ * * @APPLE_LICENSE_HEADER_START@ * + * Copyright (c) 1999-2003 Apple Computer, Inc. All Rights Reserved. + * * This file contains Original Code and/or Modifications of Original Code * as defined in and that are subject to the Apple Public Source License * Version 2.0 (the 'License'). You may not use this file except in diff --git a/mDNSMacOSX/Applications/DNSServiceBrowser/BrowserController.m b/mDNSMacOSX/Applications/DNSServiceBrowser/BrowserController.m index 1dbe2a4..a3e9cb0 100755 --- a/mDNSMacOSX/Applications/DNSServiceBrowser/BrowserController.m +++ b/mDNSMacOSX/Applications/DNSServiceBrowser/BrowserController.m @@ -3,6 +3,8 @@ * * @APPLE_LICENSE_HEADER_START@ * + * Copyright (c) 1999-2003 Apple Computer, Inc. All Rights Reserved. + * * This file contains Original Code and/or Modifications of Original Code * as defined in and that are subject to the Apple Public Source License * Version 2.0 (the 'License'). You may not use this file except in diff --git a/mDNSMacOSX/Applications/DNSServiceBrowser/main.m b/mDNSMacOSX/Applications/DNSServiceBrowser/main.m index c340509..492c5c2 100644 --- a/mDNSMacOSX/Applications/DNSServiceBrowser/main.m +++ b/mDNSMacOSX/Applications/DNSServiceBrowser/main.m @@ -3,6 +3,8 @@ * * @APPLE_LICENSE_HEADER_START@ * + * Copyright (c) 1999-2003 Apple Computer, Inc. All Rights Reserved. + * * This file contains Original Code and/or Modifications of Original Code * as defined in and that are subject to the Apple Public Source License * Version 2.0 (the 'License'). You may not use this file except in diff --git a/mDNSMacOSX/Applications/DNSServiceRegistration/RegistrationController.h b/mDNSMacOSX/Applications/DNSServiceRegistration/RegistrationController.h index ca53bf2..df059d8 100644 --- a/mDNSMacOSX/Applications/DNSServiceRegistration/RegistrationController.h +++ b/mDNSMacOSX/Applications/DNSServiceRegistration/RegistrationController.h @@ -3,6 +3,8 @@ * * @APPLE_LICENSE_HEADER_START@ * + * Copyright (c) 1999-2003 Apple Computer, Inc. All Rights Reserved. + * * This file contains Original Code and/or Modifications of Original Code * as defined in and that are subject to the Apple Public Source License * Version 2.0 (the 'License'). You may not use this file except in diff --git a/mDNSMacOSX/Applications/DNSServiceRegistration/RegistrationController.m b/mDNSMacOSX/Applications/DNSServiceRegistration/RegistrationController.m index 6255179..3b2226c 100644 --- a/mDNSMacOSX/Applications/DNSServiceRegistration/RegistrationController.m +++ b/mDNSMacOSX/Applications/DNSServiceRegistration/RegistrationController.m @@ -3,6 +3,8 @@ * * @APPLE_LICENSE_HEADER_START@ * + * Copyright (c) 1999-2003 Apple Computer, Inc. All Rights Reserved. + * * This file contains Original Code and/or Modifications of Original Code * as defined in and that are subject to the Apple Public Source License * Version 2.0 (the 'License'). You may not use this file except in diff --git a/mDNSMacOSX/Applications/DNSServiceRegistration/main.m b/mDNSMacOSX/Applications/DNSServiceRegistration/main.m index c340509..492c5c2 100644 --- a/mDNSMacOSX/Applications/DNSServiceRegistration/main.m +++ b/mDNSMacOSX/Applications/DNSServiceRegistration/main.m @@ -3,6 +3,8 @@ * * @APPLE_LICENSE_HEADER_START@ * + * Copyright (c) 1999-2003 Apple Computer, Inc. All Rights Reserved. + * * This file contains Original Code and/or Modifications of Original Code * as defined in and that are subject to the Apple Public Source License * Version 2.0 (the 'License'). You may not use this file except in diff --git a/mDNSMacOSX/Applications/HAAutomounter/HAAutomounter.h b/mDNSMacOSX/Applications/HAAutomounter/HAAutomounter.h index 7bb3e90..928cf02 100644 --- a/mDNSMacOSX/Applications/HAAutomounter/HAAutomounter.h +++ b/mDNSMacOSX/Applications/HAAutomounter/HAAutomounter.h @@ -3,6 +3,8 @@ * * @APPLE_LICENSE_HEADER_START@ * + * Copyright (c) 1999-2003 Apple Computer, Inc. All Rights Reserved. + * * This file contains Original Code and/or Modifications of Original Code * as defined in and that are subject to the Apple Public Source License * Version 2.0 (the 'License'). You may not use this file except in diff --git a/mDNSMacOSX/Applications/HAAutomounter/HAAutomounter.m b/mDNSMacOSX/Applications/HAAutomounter/HAAutomounter.m index 4aae5ed..9647f6f 100644 --- a/mDNSMacOSX/Applications/HAAutomounter/HAAutomounter.m +++ b/mDNSMacOSX/Applications/HAAutomounter/HAAutomounter.m @@ -3,6 +3,8 @@ * * @APPLE_LICENSE_HEADER_START@ * + * Copyright (c) 1999-2003 Apple Computer, Inc. All Rights Reserved. + * * This file contains Original Code and/or Modifications of Original Code * as defined in and that are subject to the Apple Public Source License * Version 2.0 (the 'License'). You may not use this file except in diff --git a/mDNSMacOSX/Applications/HAAutomounter/main.m b/mDNSMacOSX/Applications/HAAutomounter/main.m index 6ad4471..53b9e68 100644 --- a/mDNSMacOSX/Applications/HAAutomounter/main.m +++ b/mDNSMacOSX/Applications/HAAutomounter/main.m @@ -3,6 +3,8 @@ * * @APPLE_LICENSE_HEADER_START@ * + * Copyright (c) 1999-2003 Apple Computer, Inc. All Rights Reserved. + * * This file contains Original Code and/or Modifications of Original Code * as defined in and that are subject to the Apple Public Source License * Version 2.0 (the 'License'). You may not use this file except in diff --git a/mDNSMacOSX/CFSocket.c b/mDNSMacOSX/CFSocket.c index 519a899..0552040 100644 --- a/mDNSMacOSX/CFSocket.c +++ b/mDNSMacOSX/CFSocket.c @@ -3,6 +3,8 @@ * * @APPLE_LICENSE_HEADER_START@ * + * Copyright (c) 1999-2003 Apple Computer, Inc. All Rights Reserved. + * * This file contains Original Code and/or Modifications of Original Code * as defined in and that are subject to the Apple Public Source License * Version 2.0 (the 'License'). You may not use this file except in diff --git a/mDNSMacOSX/CFSocketPuma.c b/mDNSMacOSX/CFSocketPuma.c index e0cf87c..3a7e266 100644 --- a/mDNSMacOSX/CFSocketPuma.c +++ b/mDNSMacOSX/CFSocketPuma.c @@ -3,6 +3,8 @@ * * @APPLE_LICENSE_HEADER_START@ * + * Copyright (c) 1999-2003 Apple Computer, Inc. All Rights Reserved. + * * This file contains Original Code and/or Modifications of Original Code * as defined in and that are subject to the Apple Public Source License * Version 2.0 (the 'License'). You may not use this file except in diff --git a/mDNSMacOSX/DNSServiceDiscoveryDefines.h b/mDNSMacOSX/DNSServiceDiscoveryDefines.h index b6d3a9a..bd5b11b 100644 --- a/mDNSMacOSX/DNSServiceDiscoveryDefines.h +++ b/mDNSMacOSX/DNSServiceDiscoveryDefines.h @@ -3,6 +3,8 @@ * * @APPLE_LICENSE_HEADER_START@ * + * Copyright (c) 1999-2003 Apple Computer, Inc. All Rights Reserved. + * * This file contains Original Code and/or Modifications of Original Code * as defined in and that are subject to the Apple Public Source License * Version 2.0 (the 'License'). You may not use this file except in diff --git a/mDNSMacOSX/DNSServiceDiscoveryReply.defs b/mDNSMacOSX/DNSServiceDiscoveryReply.defs index 942fb6b..6ae6004 100644 --- a/mDNSMacOSX/DNSServiceDiscoveryReply.defs +++ b/mDNSMacOSX/DNSServiceDiscoveryReply.defs @@ -3,6 +3,8 @@ * * @APPLE_LICENSE_HEADER_START@ * + * Copyright (c) 1999-2003 Apple Computer, Inc. All Rights Reserved. + * * This file contains Original Code and/or Modifications of Original Code * as defined in and that are subject to the Apple Public Source License * Version 2.0 (the 'License'). You may not use this file except in diff --git a/mDNSMacOSX/DNSServiceDiscoveryRequest.defs b/mDNSMacOSX/DNSServiceDiscoveryRequest.defs index eb400b1..a4596af 100644 --- a/mDNSMacOSX/DNSServiceDiscoveryRequest.defs +++ b/mDNSMacOSX/DNSServiceDiscoveryRequest.defs @@ -3,6 +3,8 @@ * * @APPLE_LICENSE_HEADER_START@ * + * Copyright (c) 1999-2003 Apple Computer, Inc. All Rights Reserved. + * * This file contains Original Code and/or Modifications of Original Code * as defined in and that are subject to the Apple Public Source License * Version 2.0 (the 'License'). You may not use this file except in diff --git a/mDNSMacOSX/SampleUDSClient.c b/mDNSMacOSX/SampleUDSClient.c index 7838fc1..bca8eea 100755 --- a/mDNSMacOSX/SampleUDSClient.c +++ b/mDNSMacOSX/SampleUDSClient.c @@ -3,6 +3,8 @@ * * @APPLE_LICENSE_HEADER_START@ * + * Copyright (c) 1999-2003 Apple Computer, Inc. All Rights Reserved. + * * This file contains Original Code and/or Modifications of Original Code * as defined in and that are subject to the Apple Public Source License * Version 2.0 (the 'License'). You may not use this file except in diff --git a/mDNSMacOSX/SamplemDNSClient.c b/mDNSMacOSX/SamplemDNSClient.c index f905bd7..1b824dd 100644 --- a/mDNSMacOSX/SamplemDNSClient.c +++ b/mDNSMacOSX/SamplemDNSClient.c @@ -3,6 +3,8 @@ * * @APPLE_LICENSE_HEADER_START@ * + * Copyright (c) 1999-2003 Apple Computer, Inc. All Rights Reserved. + * * This file contains Original Code and/or Modifications of Original Code * as defined in and that are subject to the Apple Public Source License * Version 2.0 (the 'License'). You may not use this file except in diff --git a/mDNSMacOSX/daemon.c b/mDNSMacOSX/daemon.c index b6aa01e..d0af244 100644 --- a/mDNSMacOSX/daemon.c +++ b/mDNSMacOSX/daemon.c @@ -3,6 +3,8 @@ * * @APPLE_LICENSE_HEADER_START@ * + * Copyright (c) 1999-2003 Apple Computer, Inc. All Rights Reserved. + * * This file contains Original Code and/or Modifications of Original Code * as defined in and that are subject to the Apple Public Source License * Version 2.0 (the 'License'). You may not use this file except in @@ -36,6 +38,12 @@ Change History (most recent first): $Log: daemon.c,v $ +Revision 1.134.2.2 2003/12/05 00:03:35 cheshire + Use buffer size MAX_ESCAPED_DOMAIN_NAME instead of 256 + +Revision 1.134.2.1 2003/12/03 11:00:09 cheshire +Update "mDNSResponderVersion" mechanism to allow dots so we can do mDNSResponder-58.1 for SUPan + Revision 1.134 2003/08/21 20:01:37 cheshire Traffic reduction: Detect long-lived Resolve() calls, and report them in syslog @@ -264,7 +272,7 @@ struct DNSServiceBrowserResult_struct { DNSServiceBrowserResult *next; int resultType; - char name[256], type[256], dom[256]; + domainname result; }; typedef struct DNSServiceBrowser_struct DNSServiceBrowser; @@ -569,7 +577,7 @@ mDNSlocal void FoundDomain(mDNS *const m, DNSQuestion *question, const ResourceR { kern_return_t status; #pragma unused(m) - char buffer[256]; + char buffer[MAX_ESCAPED_DOMAIN_NAME]; DNSServiceDomainEnumerationReplyResultType rt; DNSServiceDomainEnumeration *x = (DNSServiceDomainEnumeration *)question->QuestionContext; @@ -667,9 +675,7 @@ mDNSlocal void FoundInstance(mDNS *const m, DNSQuestion *question, const Resourc if (!x) { LogMsg("FoundInstance: Failed to allocate memory for result %##s", answer->rdata->u.name.c); return; } verbosedebugf("FoundInstance: %s %##s", AddRecord ? "Add" : "Rmv", answer->rdata->u.name.c); - ConvertDomainLabelToCString_unescaped(&name, x->name); - ConvertDomainNameToCString(&type, x->type); - ConvertDomainNameToCString(&domain, x->dom); + AssignDomainName(x->result, answer->rdata->u.name); if (AddRecord) x->resultType = DNSServiceBrowserReplyAddInstance; else x->resultType = DNSServiceBrowserReplyRemoveInstance; @@ -1562,8 +1568,17 @@ mDNSlocal mDNSs32 mDNSDaemonIdle(void) while (x->results) { DNSServiceBrowserResult *const r = x->results; + domainlabel name; + domainname type, domain; + DeconstructServiceName(&r->result, &name, &type, &domain); // Don't need to check result; already validated in FoundInstance() + char cname[MAX_DOMAIN_LABEL+1]; // Unescaped name: up to 63 bytes plus C-string terminating NULL. + char ctype[MAX_ESCAPED_DOMAIN_NAME]; + char cdom [MAX_ESCAPED_DOMAIN_NAME]; + ConvertDomainLabelToCString_unescaped(&name, cname); + ConvertDomainNameToCString(&type, ctype); + ConvertDomainNameToCString(&domain, cdom); DNSServiceDiscoveryReplyFlags flags = (r->next) ? DNSServiceDiscoverReplyFlagsMoreComing : 0; - kern_return_t status = DNSServiceBrowserReply_rpc(x->ClientMachPort, r->resultType, r->name, r->type, r->dom, flags, 1); + kern_return_t status = DNSServiceBrowserReply_rpc(x->ClientMachPort, r->resultType, cname, ctype, cdom, flags, 1); // If we failed to send the mach message, try again in one second if (status == MACH_SEND_TIMED_OUT) { @@ -1694,8 +1709,4 @@ mDNSexport int main(int argc, char **argv) } // For convenience when using the "strings" command, this is the last thing in the file -#if mDNSResponderVersion > 1 -mDNSexport const char mDNSResponderVersionString[] = "mDNSResponder-" STRINGIFY(mDNSResponderVersion) " (" __DATE__ " " __TIME__ ")"; -#else -mDNSexport const char mDNSResponderVersionString[] = "mDNSResponder (Engineering Build) (" __DATE__ " " __TIME__ ")"; -#endif +mDNSexport const char mDNSResponderVersionString[] = STRINGIFY(mDNSResponderVersion) " (" __DATE__ " " __TIME__ ")"; diff --git a/mDNSMacOSX/dns_sd.h b/mDNSMacOSX/dns_sd.h index eaed335..9b9c037 100755 --- a/mDNSMacOSX/dns_sd.h +++ b/mDNSMacOSX/dns_sd.h @@ -3,6 +3,8 @@ * * @APPLE_LICENSE_HEADER_START@ * + * Copyright (c) 1999-2003 Apple Computer, Inc. All Rights Reserved. + * * This file contains Original Code and/or Modifications of Original Code * as defined in and that are subject to the Apple Public Source License * Version 2.0 (the 'License'). You may not use this file except in diff --git a/mDNSMacOSX/dnssd_clientstub.c b/mDNSMacOSX/dnssd_clientstub.c index 7277eda..a5b1ef7 100755 --- a/mDNSMacOSX/dnssd_clientstub.c +++ b/mDNSMacOSX/dnssd_clientstub.c @@ -3,6 +3,8 @@ * * @APPLE_LICENSE_HEADER_START@ * + * Copyright (c) 1999-2003 Apple Computer, Inc. All Rights Reserved. + * * This file contains Original Code and/or Modifications of Original Code * as defined in and that are subject to the Apple Public Source License * Version 2.0 (the 'License'). You may not use this file except in diff --git a/mDNSMacOSX/dnssd_ipc.c b/mDNSMacOSX/dnssd_ipc.c index 186f4d3..3ee14b5 100644 --- a/mDNSMacOSX/dnssd_ipc.c +++ b/mDNSMacOSX/dnssd_ipc.c @@ -3,6 +3,8 @@ * * @APPLE_LICENSE_HEADER_START@ * + * Copyright (c) 1999-2003 Apple Computer, Inc. All Rights Reserved. + * * This file contains Original Code and/or Modifications of Original Code * as defined in and that are subject to the Apple Public Source License * Version 2.0 (the 'License'). You may not use this file except in diff --git a/mDNSMacOSX/dnssd_ipc.h b/mDNSMacOSX/dnssd_ipc.h index 2b7b323..4585284 100644 --- a/mDNSMacOSX/dnssd_ipc.h +++ b/mDNSMacOSX/dnssd_ipc.h @@ -3,6 +3,8 @@ * * @APPLE_LICENSE_HEADER_START@ * + * Copyright (c) 1999-2003 Apple Computer, Inc. All Rights Reserved. + * * This file contains Original Code and/or Modifications of Original Code * as defined in and that are subject to the Apple Public Source License * Version 2.0 (the 'License'). You may not use this file except in diff --git a/mDNSMacOSX/mDNSMacOSX.h b/mDNSMacOSX/mDNSMacOSX.h index b255cd0..f5a7656 100644 --- a/mDNSMacOSX/mDNSMacOSX.h +++ b/mDNSMacOSX/mDNSMacOSX.h @@ -3,6 +3,8 @@ * * @APPLE_LICENSE_HEADER_START@ * + * Copyright (c) 1999-2003 Apple Computer, Inc. All Rights Reserved. + * * This file contains Original Code and/or Modifications of Original Code * as defined in and that are subject to the Apple Public Source License * Version 2.0 (the 'License'). You may not use this file except in diff --git a/mDNSMacOSX/mDNSResponder.pbproj/project.pbxproj b/mDNSMacOSX/mDNSResponder.pbproj/project.pbxproj index 2bd8d35..e1aad01 100644 --- a/mDNSMacOSX/mDNSResponder.pbproj/project.pbxproj +++ b/mDNSMacOSX/mDNSResponder.pbproj/project.pbxproj @@ -6,11 +6,13 @@ objectVersion = 38; objects = { 000753D303367C1C0CCA2C71 = { + fileEncoding = 4; isa = PBXFileReference; path = mDNSMacOSX.h; refType = 4; }; 0017390704CC75C30CCA2C71 = { + fileEncoding = 4; isa = PBXFileReference; path = SampleUDSClient.c; refType = 2; @@ -30,6 +32,7 @@ ); buildSettings = { GCC_TREAT_WARNINGS_AS_ERRORS = YES; + MACOSX_DEPLOYMENT_TARGET = 10.2; OTHER_CFLAGS = "-no-cpp-precomp -DmDNSResponderVersion=$(MVERS)"; OTHER_LDFLAGS = ""; OTHER_REZFLAGS = ""; @@ -45,7 +48,6 @@ name = "UDS API Test Tool"; productName = "UDS API Test Tool"; productReference = 0044D34F04CC73600CCA2C71; - shouldUseHeadermap = 0; }; 0044D34904CC73600CCA2C71 = { buildActionMask = 2147483647; @@ -84,6 +86,7 @@ refType = 3; }; 004EFB9604CC78130CCA2C71 = { + fileEncoding = 4; isa = PBXFileReference; path = dnssd_clientstub.c; refType = 2; @@ -104,6 +107,7 @@ GCC_TREAT_WARNINGS_AS_ERRORS = YES; HEADER_SEARCH_PATHS = "\"$(APPLE_INTERNAL_DEVELOPER_DIR)/Headers\""; LIBRARY_SEARCH_PATHS = ""; + MACOSX_DEPLOYMENT_TARGET = 10.2; OPTIMIZATION_CFLAGS = "-O0"; OTHER_CFLAGS = "-no-cpp-precomp -D__MACOSX__ -DMDNS_DEBUGMSGS=1 -DmDNSResponderVersion=$(MVERS)"; OTHER_LDFLAGS = ""; @@ -120,7 +124,6 @@ name = "mDNSResponder debug"; productName = mDNSResponder; productReference = 00AD62B8032D799A0CCA2C71; - shouldUseHeadermap = 1; }; 00AD62A4032D799A0CCA2C71 = { buildActionMask = 2147483647; @@ -148,9 +151,9 @@ 00AD62AE032D799A0CCA2C71, 00AD62AF032D799A0CCA2C71, 00AD62B0032D799A0CCA2C71, - 00AD62B1032D799A0CCA2C71, F5E11B5E04A28126019798ED, F525E72B04AA167A01F1CF4D, + 00AD62B1032D799A0CCA2C71, ); isa = PBXSourcesBuildPhase; runOnlyForDeploymentPostprocessing = 0; @@ -251,7 +254,6 @@ isa = PBXAggregateTarget; name = "Build All"; productName = "Build All"; - shouldUseHeadermap = 0; }; 00AD62BC032D7A160CCA2C71 = { isa = PBXTargetDependency; @@ -269,7 +271,7 @@ buildRules = ( ); buildSettings = { - MVERS = 1; + MVERS = "\"mDNSResponder (Engineering Build)\""; }; isa = PBXBuildStyle; name = Development; @@ -321,6 +323,7 @@ buildStyles = ( 00B2AB0C032D7B220CCA2C71, ); + hasScannedForEncodings = 1; isa = PBXProject; mainGroup = 08FB7794FE84155DC02AAC07; projectDirPath = ""; @@ -385,6 +388,7 @@ HEADER_SEARCH_PATHS = "\"$(APPLE_INTERNAL_DEVELOPER_DIR)/Headers\""; INSTALL_PATH = /usr/sbin; LIBRARY_SEARCH_PATHS = ""; + MACOSX_DEPLOYMENT_TARGET = 10.2; OTHER_CFLAGS = "-no-cpp-precomp -D__MACOSX__ -DmDNSResponderVersion=$(MVERS)"; OTHER_LDFLAGS = ""; OTHER_REZFLAGS = ""; @@ -401,7 +405,6 @@ productInstallPath = "$(HOME)/bin"; productName = mDNSResponder; productReference = 034768E2FF38A6DC11DB9C8B; - shouldUseHeadermap = 1; }; 08FB77A0FE84155DC02AAC07 = { buildActionMask = 2147483647; @@ -419,9 +422,9 @@ 6575FC0E022EB18700000109, 6575FBEA022EAF5A00000109, 6575FBED022EAF7200000109, - 6575FBEE022EAF7200000109, F5E11B5C04A28126019798ED, F525E72904AA167501F1CF4D, + 6575FBEE022EAF7200000109, ); isa = PBXSourcesBuildPhase; runOnlyForDeploymentPostprocessing = 0; @@ -497,18 +500,21 @@ //653 //654 654BE64F02B63B93000001D1 = { + fileEncoding = 4; isa = PBXFileReference; name = mDNSClientAPI.h; path = ../mDNSCore/mDNSClientAPI.h; refType = 4; }; 654BE65002B63B93000001D1 = { + fileEncoding = 4; isa = PBXFileReference; name = mDNSDebug.h; path = ../mDNSCore/mDNSDebug.h; refType = 4; }; 654BE65202B63B93000001D1 = { + fileEncoding = 4; isa = PBXFileReference; name = mDNSPlatformFunctions.h; path = ../mDNSCore/mDNSPlatformFunctions.h; @@ -527,6 +533,7 @@ }; }; 6575FBE9022EAF5A00000109 = { + fileEncoding = 4; indentWidth = 4; isa = PBXFileReference; name = mDNS.c; @@ -542,6 +549,7 @@ }; }; 6575FBEB022EAF7200000109 = { + fileEncoding = 4; indentWidth = 4; isa = PBXFileReference; path = CFSocket.c; @@ -550,6 +558,7 @@ usesTabs = 1; }; 6575FBEC022EAF7200000109 = { + fileEncoding = 4; indentWidth = 4; isa = PBXFileReference; path = daemon.c; @@ -580,16 +589,19 @@ refType = 4; }; 6575FBFF022EAFBA00000109 = { + fileEncoding = 4; isa = PBXFileReference; path = DNSServiceDiscoveryDefines.h; refType = 4; }; 6575FC00022EAFBA00000109 = { + fileEncoding = 4; isa = PBXFileReference; path = DNSServiceDiscoveryReply.defs; refType = 4; }; 6575FC01022EAFBA00000109 = { + fileEncoding = 4; isa = PBXFileReference; path = DNSServiceDiscoveryRequest.defs; refType = 4; @@ -659,6 +671,7 @@ buildSettings = { GCC_TREAT_WARNINGS_AS_ERRORS = YES; INSTALL_PATH = /usr/bin; + MACOSX_DEPLOYMENT_TARGET = 10.2; OTHER_CFLAGS = "-no-cpp-precomp -DmDNSResponderVersion=$(MVERS)"; OTHER_LDFLAGS = ""; OTHER_REZFLAGS = ""; @@ -675,7 +688,6 @@ productInstallPath = /usr/bin; productName = "Sample mDNS Client"; productReference = 6575FC1D022EB76000000109; - shouldUseHeadermap = 0; }; 6575FC1D022EB76000000109 = { isa = PBXExecutableFileReference; @@ -693,6 +705,7 @@ refType = 4; }; 6575FC20022EB7AA00000109 = { + fileEncoding = 4; indentWidth = 4; isa = PBXFileReference; path = SamplemDNSClient.c; @@ -753,6 +766,7 @@ }; }; F525E72804AA167501F1CF4D = { + fileEncoding = 4; isa = PBXFileReference; path = uds_daemon.c; refType = 4; @@ -770,11 +784,13 @@ }; }; F5E11B5A04A28126019798ED = { + fileEncoding = 4; isa = PBXFileReference; path = dnssd_ipc.c; refType = 4; }; F5E11B5B04A28126019798ED = { + fileEncoding = 4; isa = PBXFileReference; path = dnssd_ipc.h; refType = 4; diff --git a/mDNSMacOSX/uds_daemon.c b/mDNSMacOSX/uds_daemon.c index c7df012..9c5a653 100644 --- a/mDNSMacOSX/uds_daemon.c +++ b/mDNSMacOSX/uds_daemon.c @@ -3,6 +3,8 @@ * * @APPLE_LICENSE_HEADER_START@ * + * Copyright (c) 1999-2003 Apple Computer, Inc. All Rights Reserved. + * * This file contains Original Code and/or Modifications of Original Code * as defined in and that are subject to the Apple Public Source License * Version 2.0 (the 'License'). You may not use this file except in @@ -23,6 +25,9 @@ Change History (most recent first): $Log: uds_daemon.c,v $ +Revision 1.22.2.1 2003/12/05 00:03:35 cheshire + Use buffer size MAX_ESCAPED_DOMAIN_NAME instead of 256 + Revision 1.22 2003/08/19 16:03:55 ksekar Bug #: : ER: SIGINFO dump should include resolves started by DNSServiceQueryRecord Check termination_context for NULL before dereferencing. @@ -707,7 +712,7 @@ static void handle_resolve_request(request_state *rstate) { DNSServiceFlags flags; uint32_t interfaceIndex; - char name[256], regtype[256], domain[256]; + char name[256], regtype[MAX_ESCAPED_DOMAIN_NAME], domain[MAX_ESCAPED_DOMAIN_NAME]; char *ptr; // message data pointer domainname fqdn; resolve_t *srv, *txt; @@ -736,8 +741,8 @@ static void handle_resolve_request(request_state *rstate) mDNSInterfaceID InterfaceID = mDNSPlatformInterfaceIDfromInterfaceIndex(&mDNSStorage, interfaceIndex); if (interfaceIndex && !InterfaceID) goto bad_param; if (get_string(&ptr, name, 256) < 0 || - get_string(&ptr, regtype, 256) < 0 || - get_string(&ptr, domain, 256) < 0) + get_string(&ptr, regtype, MAX_ESCAPED_DOMAIN_NAME) < 0 || + get_string(&ptr, domain, MAX_ESCAPED_DOMAIN_NAME) < 0) goto bad_param; // free memory in rstate since we don't need it anymore @@ -843,7 +848,7 @@ static void resolve_termination_callback(void *context) static void resolve_result_callback(mDNS *const m, DNSQuestion *question, const ResourceRecord *const answer, mDNSBool AddRecord) { int len = 0; - char fullname[MAX_DOMAIN_NAME], target[MAX_DOMAIN_NAME]; + char fullname[MAX_ESCAPED_DOMAIN_NAME], target[MAX_ESCAPED_DOMAIN_NAME]; char *data; transfer_state result; reply_state *rep; @@ -939,7 +944,7 @@ static mStatus do_question(request_state *rstate, domainname *name, uint32_t ifi static void question_result_callback(mDNS *const m, DNSQuestion *question, const ResourceRecord *const answer, mDNSBool AddRecord) { char *data; - char name[256]; + char name[MAX_ESCAPED_DOMAIN_NAME]; request_state *req; reply_state *rep; int len; @@ -988,7 +993,7 @@ static void handle_browse_request(request_state *request) { DNSServiceFlags flags; uint32_t interfaceIndex; - char regtype[256], domain[256]; + char regtype[MAX_ESCAPED_DOMAIN_NAME], domain[MAX_ESCAPED_DOMAIN_NAME]; DNSQuestion *q; domainname typedn, domdn; char *ptr; @@ -1013,8 +1018,8 @@ static void handle_browse_request(request_state *request) ptr = request->msgdata; flags = get_flags(&ptr); interfaceIndex = get_long(&ptr); - if (get_string(&ptr, regtype, 256) < 0 || - get_string(&ptr, domain, 256) < 0) + if (get_string(&ptr, regtype, MAX_ESCAPED_DOMAIN_NAME) < 0 || + get_string(&ptr, domain, MAX_ESCAPED_DOMAIN_NAME) < 0) goto bad_param; freeL("handle_browse_request", request->msgbuf); @@ -1076,7 +1081,7 @@ static void handle_regservice_request(request_state *request) { DNSServiceFlags flags; uint32_t ifi; - char name[256], regtype[256], domain[256], host[256]; + char name[256], regtype[MAX_ESCAPED_DOMAIN_NAME], domain[MAX_ESCAPED_DOMAIN_NAME], host[MAX_ESCAPED_DOMAIN_NAME]; uint16_t txtlen; mDNSIPPort port; void *txtdata; @@ -1106,9 +1111,9 @@ static void handle_regservice_request(request_state *request) mDNSInterfaceID InterfaceID = mDNSPlatformInterfaceIDfromInterfaceIndex(&mDNSStorage, ifi); if (ifi && !InterfaceID) goto bad_param; if (get_string(&ptr, name, 256) < 0 || - get_string(&ptr, regtype, 256) < 0 || - get_string(&ptr, domain, 256) < 0 || - get_string(&ptr, host, 256) < 0) + get_string(&ptr, regtype, MAX_ESCAPED_DOMAIN_NAME) < 0 || + get_string(&ptr, domain, MAX_ESCAPED_DOMAIN_NAME) < 0 || + get_string(&ptr, host, MAX_ESCAPED_DOMAIN_NAME) < 0) goto bad_param; port.NotAnInteger = get_short(&ptr); @@ -1651,7 +1656,7 @@ static void handle_enum_request(request_state *rstate) static void enum_result_callback(mDNS *const m, DNSQuestion *question, const ResourceRecord *const answer, mDNSBool AddRecord) { - char domain[256]; + char domain[MAX_ESCAPED_DOMAIN_NAME]; domain_enum_t *de = question->QuestionContext; DNSServiceFlags flags = 0; reply_state *reply; @@ -1809,7 +1814,9 @@ static mStatus gen_rr_response(domainname *servicename, mDNSInterfaceID id, requ int len; domainlabel name; domainname type, dom; - char namestr[256], typestr[256], domstr[256]; + char namestr[MAX_DOMAIN_LABEL+1]; // Unescaped name: up to 63 bytes plus C-string terminating NULL. + char typestr[MAX_ESCAPED_DOMAIN_NAME]; + char domstr [MAX_ESCAPED_DOMAIN_NAME]; *rep = NULL; diff --git a/mDNSPosix/Client.c b/mDNSPosix/Client.c index f3f9801..193272d 100755 --- a/mDNSPosix/Client.c +++ b/mDNSPosix/Client.c @@ -3,6 +3,8 @@ * * @APPLE_LICENSE_HEADER_START@ * + * Copyright (c) 1999-2003 Apple Computer, Inc. All Rights Reserved. + * * This file contains Original Code and/or Modifications of Original Code * as defined in and that are subject to the Apple Public Source License * Version 2.0 (the 'License'). You may not use this file except in @@ -23,6 +25,13 @@ Change History (most recent first): $Log: Client.c,v $ +Revision 1.11 2003/11/17 20:14:32 cheshire +Typo: Wrote "domC" where it should have said "domainC" + +Revision 1.10 2003/11/14 21:27:09 cheshire +: Security: Crashing bug in mDNSResponder +Fix code that should use buffer size MAX_ESCAPED_DOMAIN_NAME (1005) instead of 256-byte buffers. + Revision 1.9 2003/08/14 02:19:55 cheshire Split generic ResourceRecord type into two separate types: AuthRecord and CacheRecord @@ -81,9 +90,9 @@ static void BrowseCallback(mDNS *const m, DNSQuestion *question, const ResourceR domainlabel name; domainname type; domainname domain; - char nameC[256]; - char typeC[256]; - char domainC[256]; + char nameC [MAX_DOMAIN_LABEL+1]; // Unescaped name: up to 63 bytes plus C-string terminating NULL. + char typeC [MAX_ESCAPED_DOMAIN_NAME]; + char domainC[MAX_ESCAPED_DOMAIN_NAME]; const char *state; (void)m; // Unused diff --git a/mDNSPosix/ExampleClientApp.c b/mDNSPosix/ExampleClientApp.c index a0531bc..8561388 100644 --- a/mDNSPosix/ExampleClientApp.c +++ b/mDNSPosix/ExampleClientApp.c @@ -3,6 +3,8 @@ * * @APPLE_LICENSE_HEADER_START@ * + * Copyright (c) 1999-2003 Apple Computer, Inc. All Rights Reserved. + * * This file contains Original Code and/or Modifications of Original Code * as defined in and that are subject to the Apple Public Source License * Version 2.0 (the 'License'). You may not use this file except in diff --git a/mDNSPosix/ExampleClientApp.h b/mDNSPosix/ExampleClientApp.h index 4274a46..d9b20c5 100644 --- a/mDNSPosix/ExampleClientApp.h +++ b/mDNSPosix/ExampleClientApp.h @@ -3,6 +3,8 @@ * * @APPLE_LICENSE_HEADER_START@ * + * Copyright (c) 1999-2003 Apple Computer, Inc. All Rights Reserved. + * * This file contains Original Code and/or Modifications of Original Code * as defined in and that are subject to the Apple Public Source License * Version 2.0 (the 'License'). You may not use this file except in diff --git a/mDNSPosix/Identify.c b/mDNSPosix/Identify.c index 228f0a6..f773796 100644 --- a/mDNSPosix/Identify.c +++ b/mDNSPosix/Identify.c @@ -3,6 +3,8 @@ * * @APPLE_LICENSE_HEADER_START@ * + * Copyright (c) 1999-2003 Apple Computer, Inc. All Rights Reserved. + * * This file contains Original Code and/or Modifications of Original Code * as defined in and that are subject to the Apple Public Source License * Version 2.0 (the 'License'). You may not use this file except in @@ -36,6 +38,13 @@ Change History (most recent first): $Log: Identify.c,v $ +Revision 1.12 2003/11/14 21:27:09 cheshire +: Security: Crashing bug in mDNSResponder +Fix code that should use buffer size MAX_ESCAPED_DOMAIN_NAME (1005) instead of 256-byte buffers. + +Revision 1.11 2003/10/30 19:26:38 cheshire +Fix warnings on certain compilers + Revision 1.10 2003/09/02 20:38:57 cheshire #include for Linux @@ -106,7 +115,7 @@ static CacheRecord gRRCache[RR_CACHE_SIZE]; static volatile int StopNow; // 0 means running, 1 means stop because we got an answer, 2 means stop because of Ctrl-C static volatile int NumAnswers, NumAddr, NumAAAA, NumHINFO; -static char hostname[256], hardware[256], software[256]; +static char hostname[MAX_ESCAPED_DOMAIN_NAME], hardware[256], software[256]; static mDNSOpaque16 lastid, id; //************************************************************************************************************* @@ -171,10 +180,10 @@ static void InfoCallback(mDNS *const m, DNSQuestion *question, const ResourceRec else if (answer->rrtype == kDNSType_HINFO) { mDNSu8 *p = answer->rdata->u.data; - strncpy(hardware, p+1, p[0]); + strncpy(hardware, (char*)(p+1), p[0]); hardware[p[0]] = 0; p += 1 + p[0]; - strncpy(software, p+1, p[0]); + strncpy(software, (char*)(p+1), p[0]); software[p[0]] = 0; NumAnswers++; NumHINFO++; @@ -248,7 +257,11 @@ mDNSlocal void HandleSIG(int signal) mDNSexport int main(int argc, char **argv) { mStatus status; - + struct in_addr s4; + struct in6_addr s6; + char buffer[256]; + DNSQuestion q; + if (argc < 2) goto usage; // Initialise the mDNS core. @@ -261,12 +274,6 @@ mDNSexport int main(int argc, char **argv) signal(SIGINT, HandleSIG); // SIGINT is what you get for a Ctrl-C signal(SIGTERM, HandleSIG); - struct in_addr s4; - struct in6_addr s6; - - char buffer[256]; - DNSQuestion q; - if (inet_pton(AF_INET, argv[1], &s4) == 1) { mDNSu8 *p = (mDNSu8 *)&s4; diff --git a/mDNSPosix/NetMonitor.c b/mDNSPosix/NetMonitor.c index b495d9a..3b7aff0 100644 --- a/mDNSPosix/NetMonitor.c +++ b/mDNSPosix/NetMonitor.c @@ -3,6 +3,8 @@ * * @APPLE_LICENSE_HEADER_START@ * + * Copyright (c) 1999-2003 Apple Computer, Inc. All Rights Reserved. + * * This file contains Original Code and/or Modifications of Original Code * as defined in and that are subject to the Apple Public Source License * Version 2.0 (the 'License'). You may not use this file except in @@ -36,6 +38,12 @@ Change History (most recent first): $Log: NetMonitor.c,v $ +Revision 1.49 2003/10/30 19:38:56 cheshire +Fix warning on certain compilers + +Revision 1.48 2003/10/30 19:30:00 cheshire +Fix warnings on certain compilers + Revision 1.47 2003/09/05 18:49:57 cheshire Add total packet size to display @@ -307,7 +315,7 @@ typedef enum HostPkt_L = 1, // Legacy Query HostPkt_R = 2, // Response HostPkt_B = 3, // Bad - HostPkt_NumTypes = 4, + HostPkt_NumTypes = 4 } HostPkt_Type; typedef struct @@ -629,12 +637,11 @@ mDNSlocal void DisplayQuery(mDNS *const m, const DNSMessage *const msg, const mD for (i=0; ih.numQuestions; i++) { DNSQuestion q; - mDNSu8 *p2; - const mDNSu8 *ep = ptr; - ptr = getQuestion(msg, ptr, end, InterfaceID, &q); - if (!ptr) { DisplayError(srcaddr, ep, end, "QUESTION"); return; } + mDNSu8 *p2 = (mDNSu8 *)getQuestion(msg, ptr, end, InterfaceID, &q); mDNSu16 ucbit = q.qclass & kDNSQClass_UnicastResponse; q.qclass &= ~kDNSQClass_UnicastResponse; + if (!p2) { DisplayError(srcaddr, ptr, end, "QUESTION"); return; } + ptr = p2; p2 = (mDNSu8 *)FindUpdate(m, msg, auth, end, &q, &pkt); if (p2) { @@ -748,12 +755,12 @@ mDNSexport void mDNSCoreReceive(mDNS *const m, DNSMessage *const msg, const mDNS const mDNSu8 StdQ = kDNSFlag0_QR_Query | kDNSFlag0_OP_StdQuery; const mDNSu8 StdR = kDNSFlag0_QR_Response | kDNSFlag0_OP_StdQuery; const mDNSu8 QR_OP = (mDNSu8)(msg->h.flags.b[0] & kDNSFlag0_QROP_Mask); + mDNSu8 *ptr = (mDNSu8 *)&msg->h.numQuestions; (void)dstaddr; // Unused (void)dstport; // Unused // Read the integer parts which are in IETF byte-order (MSB first, LSB second) - mDNSu8 *ptr = (mDNSu8 *)&msg->h.numQuestions; msg->h.numQuestions = (mDNSu16)((mDNSu16)ptr[0] << 8 | ptr[1]); msg->h.numAnswers = (mDNSu16)((mDNSu16)ptr[2] << 8 | ptr[3]); msg->h.numAuthorities = (mDNSu16)((mDNSu16)ptr[4] << 8 | ptr[5]); @@ -863,6 +870,7 @@ mDNSexport int main(int argc, char **argv) for (i=1; iFilterAddr = a; f->next = Filters; Filters = f; diff --git a/mDNSPosix/ProxyResponder.c b/mDNSPosix/ProxyResponder.c index 3bf4f11..193b082 100644 --- a/mDNSPosix/ProxyResponder.c +++ b/mDNSPosix/ProxyResponder.c @@ -3,6 +3,8 @@ * * @APPLE_LICENSE_HEADER_START@ * + * Copyright (c) 1999-2003 Apple Computer, Inc. All Rights Reserved. + * * This file contains Original Code and/or Modifications of Original Code * as defined in and that are subject to the Apple Public Source License * Version 2.0 (the 'License'). You may not use this file except in @@ -23,6 +25,13 @@ Change History (most recent first): $Log: ProxyResponder.c,v $ +Revision 1.24 2003/11/14 21:27:09 cheshire +: Security: Crashing bug in mDNSResponder +Fix code that should use buffer size MAX_ESCAPED_DOMAIN_NAME (1005) instead of 256-byte buffers. + +Revision 1.23 2003/10/30 19:39:28 cheshire +Fix warnings on certain compilers + Revision 1.22 2003/08/14 02:19:55 cheshire Split generic ResourceRecord type into two separate types: AuthRecord and CacheRecord @@ -151,17 +160,17 @@ mDNSlocal void ServiceCallback(mDNS *const m, ServiceRecordSet *const sr, mStatu if (result == mStatus_NoError) { - char buffer[256]; - ConvertDomainNameToCString_unescaped(&sr->RR_SRV.resrec.name, buffer); + char buffer[MAX_ESCAPED_DOMAIN_NAME]; + ConvertDomainNameToCString(&sr->RR_SRV.resrec.name, buffer); printf("Service %s now registered and active\n", buffer); } if (result == mStatus_NameConflict) { - char buffer1[256], buffer2[256]; - ConvertDomainNameToCString_unescaped(&sr->RR_SRV.resrec.name, buffer1); + char buffer1[MAX_ESCAPED_DOMAIN_NAME], buffer2[MAX_ESCAPED_DOMAIN_NAME]; + ConvertDomainNameToCString(&sr->RR_SRV.resrec.name, buffer1); mDNS_RenameAndReregisterService(m, sr, mDNSNULL); - ConvertDomainNameToCString_unescaped(&sr->RR_SRV.resrec.name, buffer2); + ConvertDomainNameToCString(&sr->RR_SRV.resrec.name, buffer2); printf("Name Conflict! %s renamed as %s\n", buffer1, buffer2); } } @@ -175,7 +184,8 @@ mDNSlocal void RegisterService(mDNS *m, ServiceRecordSet *recordset, domainlabel n; domainname t, d; mDNSIPPort port; - unsigned char buffer[1024], *bptr = buffer; + unsigned char txtbuffer[1024], *bptr = txtbuffer; + char buffer[MAX_ESCAPED_DOMAIN_NAME]; MakeDomainLabelFromLiteralString(&n, name); MakeDomainNameFromDNSNameString(&t, type); @@ -187,7 +197,7 @@ mDNSlocal void RegisterService(mDNS *m, ServiceRecordSet *recordset, int len = strlen(argv[0]); printf("STR: %s\n", argv[0]); bptr[0] = len; - strcpy(bptr+1, argv[0]); + strcpy((char*)(bptr+1), argv[0]); bptr += 1 + len; argc--; argv++; @@ -196,12 +206,12 @@ mDNSlocal void RegisterService(mDNS *m, ServiceRecordSet *recordset, mDNS_RegisterService(m, recordset, &n, &t, &d, // Name, type, domain host, port, // Host and port - buffer, bptr-buffer, // TXT data, length + txtbuffer, bptr-txtbuffer, // TXT data, length mDNSNULL, 0, // Subtypes mDNSInterface_Any, // Interace ID ServiceCallback, mDNSNULL); // Callback and context - ConvertDomainNameToCString_unescaped(&recordset->RR_SRV.resrec.name, buffer); + ConvertDomainNameToCString(&recordset->RR_SRV.resrec.name, buffer); printf("Made Service Records for %s\n", buffer); } @@ -226,8 +236,8 @@ mDNSlocal void NoSuchServiceCallback(mDNS *const m, AuthRecord *const rr, mStatu if (result == mStatus_NoError) { - char buffer[256]; - ConvertDomainNameToCString_unescaped(&rr->resrec.name, buffer); + char buffer[MAX_ESCAPED_DOMAIN_NAME]; + ConvertDomainNameToCString(&rr->resrec.name, buffer); printf("Non-existence assertion %s now registered and active\n", buffer); } @@ -235,12 +245,12 @@ mDNSlocal void NoSuchServiceCallback(mDNS *const m, AuthRecord *const rr, mStatu { domainlabel n; domainname t, d; - char buffer1[256], buffer2[256]; - ConvertDomainNameToCString_unescaped(&rr->resrec.name, buffer1); + char buffer1[MAX_ESCAPED_DOMAIN_NAME], buffer2[MAX_ESCAPED_DOMAIN_NAME]; + ConvertDomainNameToCString(&rr->resrec.name, buffer1); DeconstructServiceName(&rr->resrec.name, &n, &t, &d); IncrementLabelSuffix(&n, mDNStrue); mDNS_RegisterNoSuchService(m, rr, &n, &t, &d, proxyhostname, mDNSInterface_Any, NoSuchServiceCallback, mDNSNULL); - ConvertDomainNameToCString_unescaped(&rr->resrec.name, buffer2); + ConvertDomainNameToCString(&rr->resrec.name, buffer2); printf("Name Conflict! %s renamed as %s\n", buffer1, buffer2); } } @@ -250,12 +260,12 @@ mDNSlocal void RegisterNoSuchService(mDNS *m, AuthRecord *const rr, domainname * { domainlabel n; domainname t, d; - unsigned char buffer[256]; + char buffer[MAX_ESCAPED_DOMAIN_NAME]; MakeDomainLabelFromLiteralString(&n, name); MakeDomainNameFromDNSNameString(&t, type); MakeDomainNameFromDNSNameString(&d, domain); mDNS_RegisterNoSuchService(m, rr, &n, &t, &d, proxyhostname, mDNSInterface_Any, NoSuchServiceCallback, proxyhostname); - ConvertDomainNameToCString_unescaped(&rr->resrec.name, buffer); + ConvertDomainNameToCString(&rr->resrec.name, buffer); printf("Made Non-existence Record for %s\n", buffer); } diff --git a/mDNSPosix/Responder.c b/mDNSPosix/Responder.c index 6130e0c..d644675 100755 --- a/mDNSPosix/Responder.c +++ b/mDNSPosix/Responder.c @@ -3,6 +3,8 @@ * * @APPLE_LICENSE_HEADER_START@ * + * Copyright (c) 1999-2003 Apple Computer, Inc. All Rights Reserved. + * * This file contains Original Code and/or Modifications of Original Code * as defined in and that are subject to the Apple Public Source License * Version 2.0 (the 'License'). You may not use this file except in diff --git a/mDNSPosix/mDNSPosix.c b/mDNSPosix/mDNSPosix.c index 345b2f4..3d289e6 100755 --- a/mDNSPosix/mDNSPosix.c +++ b/mDNSPosix/mDNSPosix.c @@ -3,6 +3,8 @@ * * @APPLE_LICENSE_HEADER_START@ * + * Copyright (c) 1999-2003 Apple Computer, Inc. All Rights Reserved. + * * This file contains Original Code and/or Modifications of Original Code * as defined in and that are subject to the Apple Public Source License * Version 2.0 (the 'License'). You may not use this file except in @@ -36,6 +38,9 @@ Change History (most recent first): $Log: mDNSPosix.c,v $ +Revision 1.25 2003/10/30 19:25:49 cheshire +Fix signed/unsigned warning on certain compilers + Revision 1.24 2003/08/18 23:12:23 cheshire mDNSResponder divide by zero in mDNSPlatformTimeNow() @@ -412,7 +417,7 @@ mDNSlocal void GetUserSpecifiedFriendlyComputerName(domainlabel *const namelabel mDNSlocal void GetUserSpecifiedRFC1034ComputerName(domainlabel *const namelabel) { int len = 0; - gethostname(&namelabel->c[1], MAX_DOMAIN_LABEL); + gethostname((char *)(&namelabel->c[1]), MAX_DOMAIN_LABEL); while (len < MAX_DOMAIN_LABEL && namelabel->c[len+1] && namelabel->c[len+1] != '.') len++; namelabel->c[0] = len; } diff --git a/mDNSPosix/mDNSPosix.h b/mDNSPosix/mDNSPosix.h index 53f7fe9..915acb7 100755 --- a/mDNSPosix/mDNSPosix.h +++ b/mDNSPosix/mDNSPosix.h @@ -3,6 +3,8 @@ * * @APPLE_LICENSE_HEADER_START@ * + * Copyright (c) 1999-2003 Apple Computer, Inc. All Rights Reserved. + * * This file contains Original Code and/or Modifications of Original Code * as defined in and that are subject to the Apple Public Source License * Version 2.0 (the 'License'). You may not use this file except in @@ -23,6 +25,9 @@ Change History (most recent first): $Log: mDNSPosix.h,v $ +Revision 1.9 2003/10/30 19:25:19 cheshire +Fix warning on certain compilers + Revision 1.8 2003/08/12 19:56:26 cheshire Update to APSL 2.0 @@ -70,6 +75,7 @@ extern int gMDNSPlatformPosixVerboseLevel; struct mDNS_PlatformSupport_struct { // No additional data required for Posix at this time + long dummy[1]; // Some compilers don't like empty structures }; extern mStatus mDNSPlatformPosixRefreshInterfaceList(mDNS *const m); diff --git a/mDNSPosix/mDNSUNP.c b/mDNSPosix/mDNSUNP.c index fa9bda0..26699f0 100755 --- a/mDNSPosix/mDNSUNP.c +++ b/mDNSPosix/mDNSUNP.c @@ -3,6 +3,8 @@ * * @APPLE_LICENSE_HEADER_START@ * + * Copyright (c) 1999-2003 Apple Computer, Inc. All Rights Reserved. + * * This file contains Original Code and/or Modifications of Original Code * as defined in and that are subject to the Apple Public Source License * Version 2.0 (the 'License'). You may not use this file except in diff --git a/mDNSPosix/mDNSUNP.h b/mDNSPosix/mDNSUNP.h index 21d13f1..a764aa0 100755 --- a/mDNSPosix/mDNSUNP.h +++ b/mDNSPosix/mDNSUNP.h @@ -3,6 +3,8 @@ * * @APPLE_LICENSE_HEADER_START@ * + * Copyright (c) 1999-2003 Apple Computer, Inc. All Rights Reserved. + * * This file contains Original Code and/or Modifications of Original Code * as defined in and that are subject to the Apple Public Source License * Version 2.0 (the 'License'). You may not use this file except in diff --git a/mDNSPosix/parselog.py b/mDNSPosix/parselog.py new file mode 100755 index 0000000..ac14fc5 --- /dev/null +++ b/mDNSPosix/parselog.py @@ -0,0 +1,259 @@ +#!/usr/bin/python + +# parselog.py, written and contributed by Kevin Marks +# +# Copyright (c) 2002-2003 Apple Computer, Inc. All rights reserved. +# +# @APPLE_LICENSE_HEADER_START@ +# +# This file contains Original Code and/or Modifications of Original Code +# as defined in and that are subject to the Apple Public Source License +# Version 2.0 (the 'License'). You may not use this file except in +# compliance with the License. Please obtain a copy of the License at +# http://www.opensource.apple.com/apsl/ and read it before using this +# file. +# +# The Original Code and all software distributed under the License are +# distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER +# EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, +# INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. +# Please see the License for the specific language governing rights and +# limitations under the License. +# +# @APPLE_LICENSE_HEADER_END@ +# +# Requires OS X 10.3 Panther for Python and Core Graphics Python APIs +# Invoke from the command line with "parselog.py fname" where fname is a log file made by mDNSNetMonitor +# +# Caveats: +# It expects plain ASCII, and doesn't handle spaces in record names very well right now +# There's a procedure you can follow to 'sanitize' an mDNSNetMonitor log file to make it more paletable to parselog.py: +# 1. Run mDNSNetMonitor in a terminal window. +# When you have enough traffic, type Ctrl-C and save the content of the terminal window to disk. +# Alternatively, you can use "mDNSNetMonitor > logfile" to write the text directly to a file. +# You now have a UTF-8 text file. +# 2. Open the UTF-8 text file using BBEdit or some other text editor. +# (These instructions are for BBEdit, which I highly recommend you use when doing this.) +# 3. Make sure BBEdit correctly interprets the file as UTF-8. +# Either set your "Text Files Opening" preference to "UTF-8 no BOM", and drop the file onto BBEdit, +# or manually open the File using "File -> Open" and make sure the "Read As" setting is set to "UTF-8 no BOM" +# Check in the document pulldown menu in the window toolbar to make sure that it says "Encoding: UTF-8 no BOM" +# 4. Use "Tools -> Convert to ASCII" to replace all special characters with their seven-bit ascii equivalents. +# (e.g. curly quotes are converted to straight quotes) +# 5. Do a grep search and replace. (Cmd-F; make sure Grep checkbox is turned on.) +# Enter this search text : ^(.................\(................\S*) (.* -> .*)$ +# Enter this replacement text: \1-\2 +# Click "Replace All" +# Press Cmd-Opt-= repeatedly until there are no more instances to be replaced. +# You now have text file with all spaces in names changed to hyphens +# 6. Save the new file. You can save it as "UTF-8 no BOM", or as "Mac Roman". It really doesn't matter which -- +# the file now contains only seven-bit ascii, so it's all the same no matter how you save it. +# 7. Run "parselog.py fname" +# 8. Open the resulting fname.pdf file with a PDF viewer like Preview on OS X +# +# Key to what you see: +# Time is on the horizontal axis +# Individual machines are shown on the vertical axis +# Filled red circle: Normal query Hollow red circle: Query requesting unicast reply +# Filled orange circle: Probe (service starting) Hollow orange circle: First probe (requesting unicast reply) +# Filled green circle: Normal answer Hollow green circle: Goodbye message (record going away) +# Hollow blue circle: Legacy query (from old client) +# $Log: parselog.py,v $ +# Revision 1.2 2003/12/01 21:47:44 cheshire +# APSL +# +# Revision 1.1 2003/10/10 02:14:17 cheshire +# First checkin of parselog.py, a tool to create graphical representations of mDNSNetMonitor logs + +from CoreGraphics import * +import math # for pi + +import string +import sys, os +import re + +def parselog(inFile): + f = open(inFile) + hunt = 'getTime' + ipList = {} + querySource = {} + plotPoints = [] + maxTime=0 + minTime = 36*60*60 + spaceExp = re.compile(r'\s+') + print "Reading " + inFile + while 1: + lines = f.readlines(100000) + if not lines: + break + for line in lines: + if (hunt == 'skip'): + if (line == '\n' or line == '\r' or line ==''): + hunt = 'getTime' +# else: +# msg = ("skipped" , line) +# print msg + elif (hunt == 'getTime'): + if (line == "^C\n" ): + break + time = line.split(' ')[0].split(':') + if (len(time)<3): + #print "bad time, skipping",time + hunt = 'skip' + else: + hunt = 'getIP' + #print (("getTime:%s" % (line)), time) + elif (hunt == 'getIP'): + ip = line.split(' ',1) + ip = ip[0] + secs=0 + for t in time: + secs = secs*60 +float(t) + if (secs>maxTime): + maxTime=secs + if (secs" symbol and following rdata + #print qaList + if (qaList[0] == ip): + if (qaList[1] == '(QU)' or qaList[1] == '(LQ)' or qaList[1] == '(PU)'): + plotPoints.append([secs, ipList[ip][0], (qaList[1])[1:-1]]) + elif (qaList[1] == '(QM)'): + plotPoints.append([secs, ipList[ip][0], (qaList[1])[1:-1]]) + querySource[qaList[3]] = len(plotPoints)-1 + elif (qaList[1] == '(PM)'): + plotPoints.append([secs, ipList[ip][0], (qaList[1])[1:-1]]) + querySource[qaList[4]] = len(plotPoints)-1 + elif (qaList[1] == '(AN)' or qaList[1] == '(AN+)' or qaList[1] == '(DE)'): + plotPoints.append([secs, ipList[ip][0], (qaList[1])[1:-1]]) + try: + theQuery = querySource[qaList[4]] + theDelta = secs - plotPoints[theQuery][0] + if (theDelta < 1.0): + plotPoints[-1].append(querySource[qaList[4]]) + #print "Answer AN+ %s points to %d" % (qaList[4],querySource[qaList[4]]) + except: + #print "Couldn't find any preceeding question for", qaList + pass + elif (qaList[1] != '(KA)' and qaList[1] != '(AD)' and qaList[1] != '(AD+)'): + print "Operation unknown", qaList + + if (qaList[1] == '(AN)' or qaList[1] == '(AN+)' or qaList[1] == '(AD)' or qaList[1] == '(AD+)'): + if (qaList[2] == 'HINFO'): + ipList[ip][1] = qaList[4] + ipList[ip][2] = string.join(qaList[6:]) + #print ipList[ip][1] + elif (qaList[2] == 'AAAA'): + if (ipList[ip][1] == ""): + ipList[ip][1] = qaList[4] + ipList[ip][2] = "Panther" + elif (qaList[2] == 'Addr'): + if (ipList[ip][1] == ""): + ipList[ip][1] = qaList[4] + ipList[ip][2] = "Jaguar" + else: + if (line == '\n'): + hunt = 'getTime' + else: + hunt = 'skip' + f.close() + #print plotPoints + #print querySource + #width=20.0*(maxTime-minTime) + if (maxTime < minTime + 10.0): + maxTime = minTime + 10.0 + typesize = 12 + width=20.0*(maxTime-minTime) + pageHeight=(len(ipList)+1) * typesize + scale = width/(maxTime-minTime) + leftMargin = typesize * 60 + bottomMargin = typesize + pageRect = CGRectMake (-leftMargin, -bottomMargin, leftMargin + width, bottomMargin + pageHeight) # landscape + outFile = "%s.pdf" % (".".join(inFile.split('.')[:-1])) + c = CGPDFContextCreateWithFilename (outFile, pageRect) + print "Writing " + outFile + ourColourSpace = c.getColorSpace() + # QM/QU red solid/hollow + # PM/PU orange solid/hollow + # LQ blue hollow + # AN/DA green solid/hollow + #colourLookup = {"L":(0.0,0.0,.75), "Q":(.75,0.0,0.0), "P":(.75,0.5,0.0), "A":(0.0,0.75,0.0), "D":(0.0,0.75,0.0), "?":(.25,0.25,0.25)} + colourLookup = {"L":(0.0,0.0,1.0), "Q":(1.0,0.0,0.0), "P":(1.0,0.8,0.0), "A":(0.0,1.0,0.0), "D":(0.0,1.0,0.0), "?":(1.0,1.0,1.0)} + c.beginPage (pageRect) + c.setRGBFillColor(.75,0.0,0.0,1.0) + c.setRGBStrokeColor(.25,0.75,0.25,1.0) + c.setLineWidth(0.25) + for point in plotPoints: + #c.addArc((point[0]-minTime)*scale,point[1]*typesize+6,5,0,2*math.pi,1) + c.addArc((point[0]-minTime)*scale,point[1]*typesize+6,typesize/4,0,2*math.pi,1) + theColour = colourLookup[(point[2])[0]] + if (((point[2])[0]) != "L") and (((point[2])[0]) != "Q") and (((point[2])[0]) != "P") and (((point[2])[0]) != "A") and (((point[2])[0]) != "D"): + print "Unknown", point + if ((point[2])[-1] == "M" or (point[2])[0]== "A"): + c.setRGBFillColor(theColour[0],theColour[1],theColour[2],.5) + c.fillPath() + else: + c.setRGBStrokeColor(theColour[0],theColour[1],theColour[2],.5) + c.setLineWidth(1.0) + c.strokePath() + c.setRGBStrokeColor(.25,0.75,0.25,1.0) + c.setLineWidth(0.25) + for index in point[3:]: + c.beginPath() + c.moveToPoint((point[0]-minTime)*scale,point[1]*typesize+6) + c.addLineToPoint(((plotPoints[index])[0]-minTime)*scale,(plotPoints[index])[1]*typesize+6) + c.closePath() + c.strokePath() + c.setRGBFillColor (0,0,0, 1) + c.setTextDrawingMode (kCGTextFill) + c.setTextMatrix (CGAffineTransformIdentity) + c.selectFont ('Gill Sans', typesize, kCGEncodingMacRoman) + c.setRGBStrokeColor(0.25,0.0,0.0,1.0) + c.setLineWidth(0.1) + for ip,[height,hname,hinfo] in ipList.items(): + c.beginPath() + c.moveToPoint(pageRect.origin.x,height*typesize+6) + c.addLineToPoint(width,height*typesize+6) + c.closePath() + c.strokePath() + c.showTextAtPoint(pageRect.origin.x + 2, height*typesize + 2, ip, len(ip)) + c.showTextAtPoint(pageRect.origin.x + 2 + typesize*8, height*typesize + 2, hname, len(hname)) + c.showTextAtPoint(pageRect.origin.x + 2 + typesize*25, height*typesize + 2, hinfo, len(hinfo)) + for time in range (int(minTime),int(maxTime)+1): + c.beginPath() + c.moveToPoint((time-minTime)*scale,pageRect.origin.y) + c.addLineToPoint((time-minTime)*scale,pageHeight) + c.closePath() + if (int(time) % 10 == 0): + theHours = time/3600 + theMinutes = time/60 % 60 + theSeconds = time % 60 + theTimeString = '%d:%02d:%02d' % (theHours, theMinutes, theSeconds) + # Should measure string width, but don't know how to do that + theStringWidth = typesize * 3.5 + c.showTextAtPoint((time-minTime)*scale - theStringWidth/2, pageRect.origin.y + 2, theTimeString, len(theTimeString)) + c.setLineWidth(0.3) + else: + c.setLineWidth(0.1) + c.strokePath() + c.endPage() + c.finish() + + +for arg in sys.argv[1:]: + parselog(arg) diff --git a/mDNSVxWorks/mDNSVxWorks.c b/mDNSVxWorks/mDNSVxWorks.c index b482fb8..560c75f 100644 --- a/mDNSVxWorks/mDNSVxWorks.c +++ b/mDNSVxWorks/mDNSVxWorks.c @@ -3,6 +3,8 @@ * * @APPLE_LICENSE_HEADER_START@ * + * Copyright (c) 1999-2003 Apple Computer, Inc. All Rights Reserved. + * * This file contains Original Code and/or Modifications of Original Code * as defined in and that are subject to the Apple Public Source License * Version 2.0 (the 'License'). You may not use this file except in diff --git a/mDNSVxWorks/mDNSVxWorks.h b/mDNSVxWorks/mDNSVxWorks.h index de026a4..537c0ee 100644 --- a/mDNSVxWorks/mDNSVxWorks.h +++ b/mDNSVxWorks/mDNSVxWorks.h @@ -3,6 +3,8 @@ * * @APPLE_LICENSE_HEADER_START@ * + * Copyright (c) 1999-2003 Apple Computer, Inc. All Rights Reserved. + * * This file contains Original Code and/or Modifications of Original Code * as defined in and that are subject to the Apple Public Source License * Version 2.0 (the 'License'). You may not use this file except in diff --git a/mDNSWindows/Applications/RendezvousBrowser/Windows/Application.sln b/mDNSWindows/Applications/RendezvousBrowser/Windows/ApplicationVS2002.sln similarity index 74% rename from mDNSWindows/Applications/RendezvousBrowser/Windows/Application.sln rename to mDNSWindows/Applications/RendezvousBrowser/Windows/ApplicationVS2002.sln index f588af6..fe6ce77 100644 --- a/mDNSWindows/Applications/RendezvousBrowser/Windows/Application.sln +++ b/mDNSWindows/Applications/RendezvousBrowser/Windows/ApplicationVS2002.sln @@ -1,14 +1,17 @@ Microsoft Visual Studio Solution File, Format Version 7.00 -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Application", "Application.vcproj", "{EDE4B529-4CF5-4A49-9B6F-C10F0EA24278}" +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Application", "ApplicationVS2002.vcproj", "{EDE4B529-4CF5-4A49-9B6F-C10F0EA24278}" EndProject Global GlobalSection(SolutionConfiguration) = preSolution - ConfigName.0 = Debug - ConfigName.1 = Release + ConfigName.0 = All + ConfigName.1 = Debug + ConfigName.2 = Release EndGlobalSection GlobalSection(ProjectDependencies) = postSolution EndGlobalSection GlobalSection(ProjectConfiguration) = postSolution + {EDE4B529-4CF5-4A49-9B6F-C10F0EA24278}.All.ActiveCfg = All|Win32 + {EDE4B529-4CF5-4A49-9B6F-C10F0EA24278}.All.Build.0 = All|Win32 {EDE4B529-4CF5-4A49-9B6F-C10F0EA24278}.Debug.ActiveCfg = Debug|Win32 {EDE4B529-4CF5-4A49-9B6F-C10F0EA24278}.Debug.Build.0 = Debug|Win32 {EDE4B529-4CF5-4A49-9B6F-C10F0EA24278}.Release.ActiveCfg = Release|Win32 diff --git a/mDNSWindows/Applications/RendezvousBrowser/Windows/Application.vcproj b/mDNSWindows/Applications/RendezvousBrowser/Windows/ApplicationVS2002.vcproj similarity index 99% rename from mDNSWindows/Applications/RendezvousBrowser/Windows/Application.vcproj rename to mDNSWindows/Applications/RendezvousBrowser/Windows/ApplicationVS2002.vcproj index 3f64b2a..89316d2 100644 --- a/mDNSWindows/Applications/RendezvousBrowser/Windows/Application.vcproj +++ b/mDNSWindows/Applications/RendezvousBrowser/Windows/ApplicationVS2002.vcproj @@ -3,7 +3,7 @@ ProjectType="Visual C++" Version="7.00" Name="Application" - ProjectGUID="{EDE4B529-4CF5-4a49-9B6F-C10F0EA24278}" + ProjectGUID="{EDE4B529-4CF5-4A49-9B6F-C10F0EA24278}" Keyword="MFCProj"> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/mDNSWindows/Applications/RendezvousBrowser/Windows/Sources/AboutDialog.cpp b/mDNSWindows/Applications/RendezvousBrowser/Windows/Sources/AboutDialog.cpp index cd8cafb..6e23cf3 100644 --- a/mDNSWindows/Applications/RendezvousBrowser/Windows/Sources/AboutDialog.cpp +++ b/mDNSWindows/Applications/RendezvousBrowser/Windows/Sources/AboutDialog.cpp @@ -3,6 +3,8 @@ * * @APPLE_LICENSE_HEADER_START@ * + * Copyright (c) 1999-2003 Apple Computer, Inc. All Rights Reserved. + * * This file contains Original Code and/or Modifications of Original Code * as defined in and that are subject to the Apple Public Source License * Version 2.0 (the 'License'). You may not use this file except in diff --git a/mDNSWindows/Applications/RendezvousBrowser/Windows/Sources/AboutDialog.h b/mDNSWindows/Applications/RendezvousBrowser/Windows/Sources/AboutDialog.h index 11c9149..40256a0 100644 --- a/mDNSWindows/Applications/RendezvousBrowser/Windows/Sources/AboutDialog.h +++ b/mDNSWindows/Applications/RendezvousBrowser/Windows/Sources/AboutDialog.h @@ -3,6 +3,8 @@ * * @APPLE_LICENSE_HEADER_START@ * + * Copyright (c) 1999-2003 Apple Computer, Inc. All Rights Reserved. + * * This file contains Original Code and/or Modifications of Original Code * as defined in and that are subject to the Apple Public Source License * Version 2.0 (the 'License'). You may not use this file except in diff --git a/mDNSWindows/Applications/RendezvousBrowser/Windows/Sources/Application.cpp b/mDNSWindows/Applications/RendezvousBrowser/Windows/Sources/Application.cpp index 396b7e9..de05091 100644 --- a/mDNSWindows/Applications/RendezvousBrowser/Windows/Sources/Application.cpp +++ b/mDNSWindows/Applications/RendezvousBrowser/Windows/Sources/Application.cpp @@ -3,6 +3,8 @@ * * @APPLE_LICENSE_HEADER_START@ * + * Copyright (c) 1999-2003 Apple Computer, Inc. All Rights Reserved. + * * This file contains Original Code and/or Modifications of Original Code * as defined in and that are subject to the Apple Public Source License * Version 2.0 (the 'License'). You may not use this file except in diff --git a/mDNSWindows/Applications/RendezvousBrowser/Windows/Sources/Application.h b/mDNSWindows/Applications/RendezvousBrowser/Windows/Sources/Application.h index e174e4f..37df61a 100644 --- a/mDNSWindows/Applications/RendezvousBrowser/Windows/Sources/Application.h +++ b/mDNSWindows/Applications/RendezvousBrowser/Windows/Sources/Application.h @@ -3,6 +3,8 @@ * * @APPLE_LICENSE_HEADER_START@ * + * Copyright (c) 1999-2003 Apple Computer, Inc. All Rights Reserved. + * * This file contains Original Code and/or Modifications of Original Code * as defined in and that are subject to the Apple Public Source License * Version 2.0 (the 'License'). You may not use this file except in diff --git a/mDNSWindows/Applications/RendezvousBrowser/Windows/Sources/ChooserDialog.cpp b/mDNSWindows/Applications/RendezvousBrowser/Windows/Sources/ChooserDialog.cpp index ddd81f9..0dfbd5b 100644 --- a/mDNSWindows/Applications/RendezvousBrowser/Windows/Sources/ChooserDialog.cpp +++ b/mDNSWindows/Applications/RendezvousBrowser/Windows/Sources/ChooserDialog.cpp @@ -3,6 +3,8 @@ * * @APPLE_LICENSE_HEADER_START@ * + * Copyright (c) 1999-2003 Apple Computer, Inc. All Rights Reserved. + * * This file contains Original Code and/or Modifications of Original Code * as defined in and that are subject to the Apple Public Source License * Version 2.0 (the 'License'). You may not use this file except in diff --git a/mDNSWindows/Applications/RendezvousBrowser/Windows/Sources/ChooserDialog.h b/mDNSWindows/Applications/RendezvousBrowser/Windows/Sources/ChooserDialog.h index 7acb0b5..3a0cdb2 100644 --- a/mDNSWindows/Applications/RendezvousBrowser/Windows/Sources/ChooserDialog.h +++ b/mDNSWindows/Applications/RendezvousBrowser/Windows/Sources/ChooserDialog.h @@ -3,6 +3,8 @@ * * @APPLE_LICENSE_HEADER_START@ * + * Copyright (c) 1999-2003 Apple Computer, Inc. All Rights Reserved. + * * This file contains Original Code and/or Modifications of Original Code * as defined in and that are subject to the Apple Public Source License * Version 2.0 (the 'License'). You may not use this file except in diff --git a/mDNSWindows/Applications/RendezvousBrowser/Windows/Sources/StdAfx.cpp b/mDNSWindows/Applications/RendezvousBrowser/Windows/Sources/StdAfx.cpp index a26a1e7..e5dc4f7 100644 --- a/mDNSWindows/Applications/RendezvousBrowser/Windows/Sources/StdAfx.cpp +++ b/mDNSWindows/Applications/RendezvousBrowser/Windows/Sources/StdAfx.cpp @@ -3,6 +3,8 @@ * * @APPLE_LICENSE_HEADER_START@ * + * Copyright (c) 1999-2003 Apple Computer, Inc. All Rights Reserved. + * * This file contains Original Code and/or Modifications of Original Code * as defined in and that are subject to the Apple Public Source License * Version 2.0 (the 'License'). You may not use this file except in diff --git a/mDNSWindows/Applications/RendezvousBrowser/Windows/Sources/StdAfx.h b/mDNSWindows/Applications/RendezvousBrowser/Windows/Sources/StdAfx.h index 3c16ff7..73c2505 100644 --- a/mDNSWindows/Applications/RendezvousBrowser/Windows/Sources/StdAfx.h +++ b/mDNSWindows/Applications/RendezvousBrowser/Windows/Sources/StdAfx.h @@ -3,6 +3,8 @@ * * @APPLE_LICENSE_HEADER_START@ * + * Copyright (c) 1999-2003 Apple Computer, Inc. All Rights Reserved. + * * This file contains Original Code and/or Modifications of Original Code * as defined in and that are subject to the Apple Public Source License * Version 2.0 (the 'License'). You may not use this file except in diff --git a/mDNSWindows/Applications/RendezvousBrowser/WindowsCE/Sources/Application.cpp b/mDNSWindows/Applications/RendezvousBrowser/WindowsCE/Sources/Application.cpp index ba28f41..5bc823e 100644 --- a/mDNSWindows/Applications/RendezvousBrowser/WindowsCE/Sources/Application.cpp +++ b/mDNSWindows/Applications/RendezvousBrowser/WindowsCE/Sources/Application.cpp @@ -3,6 +3,8 @@ * * @APPLE_LICENSE_HEADER_START@ * + * Copyright (c) 1999-2003 Apple Computer, Inc. All Rights Reserved. + * * This file contains Original Code and/or Modifications of Original Code * as defined in and that are subject to the Apple Public Source License * Version 2.0 (the 'License'). You may not use this file except in diff --git a/mDNSWindows/Applications/RendezvousBrowser/WindowsCE/Sources/Application.h b/mDNSWindows/Applications/RendezvousBrowser/WindowsCE/Sources/Application.h index 1f4fe13..fb1437f 100644 --- a/mDNSWindows/Applications/RendezvousBrowser/WindowsCE/Sources/Application.h +++ b/mDNSWindows/Applications/RendezvousBrowser/WindowsCE/Sources/Application.h @@ -3,6 +3,8 @@ * * @APPLE_LICENSE_HEADER_START@ * + * Copyright (c) 1999-2003 Apple Computer, Inc. All Rights Reserved. + * * This file contains Original Code and/or Modifications of Original Code * as defined in and that are subject to the Apple Public Source License * Version 2.0 (the 'License'). You may not use this file except in diff --git a/mDNSWindows/Applications/RendezvousBrowser/WindowsCE/Sources/BrowserDialog.cpp b/mDNSWindows/Applications/RendezvousBrowser/WindowsCE/Sources/BrowserDialog.cpp index 991fc08..de86ab8 100644 --- a/mDNSWindows/Applications/RendezvousBrowser/WindowsCE/Sources/BrowserDialog.cpp +++ b/mDNSWindows/Applications/RendezvousBrowser/WindowsCE/Sources/BrowserDialog.cpp @@ -3,6 +3,8 @@ * * @APPLE_LICENSE_HEADER_START@ * + * Copyright (c) 1999-2003 Apple Computer, Inc. All Rights Reserved. + * * This file contains Original Code and/or Modifications of Original Code * as defined in and that are subject to the Apple Public Source License * Version 2.0 (the 'License'). You may not use this file except in diff --git a/mDNSWindows/Applications/RendezvousBrowser/WindowsCE/Sources/BrowserDialog.h b/mDNSWindows/Applications/RendezvousBrowser/WindowsCE/Sources/BrowserDialog.h index 7777510..43f3e6d 100644 --- a/mDNSWindows/Applications/RendezvousBrowser/WindowsCE/Sources/BrowserDialog.h +++ b/mDNSWindows/Applications/RendezvousBrowser/WindowsCE/Sources/BrowserDialog.h @@ -3,6 +3,8 @@ * * @APPLE_LICENSE_HEADER_START@ * + * Copyright (c) 1999-2003 Apple Computer, Inc. All Rights Reserved. + * * This file contains Original Code and/or Modifications of Original Code * as defined in and that are subject to the Apple Public Source License * Version 2.0 (the 'License'). You may not use this file except in diff --git a/mDNSWindows/Applications/RendezvousBrowser/WindowsCE/Sources/StdAfx.cpp b/mDNSWindows/Applications/RendezvousBrowser/WindowsCE/Sources/StdAfx.cpp index 6622a5d..506a6be 100644 --- a/mDNSWindows/Applications/RendezvousBrowser/WindowsCE/Sources/StdAfx.cpp +++ b/mDNSWindows/Applications/RendezvousBrowser/WindowsCE/Sources/StdAfx.cpp @@ -3,6 +3,8 @@ * * @APPLE_LICENSE_HEADER_START@ * + * Copyright (c) 1999-2003 Apple Computer, Inc. All Rights Reserved. + * * This file contains Original Code and/or Modifications of Original Code * as defined in and that are subject to the Apple Public Source License * Version 2.0 (the 'License'). You may not use this file except in diff --git a/mDNSWindows/Applications/RendezvousBrowser/WindowsCE/Sources/StdAfx.h b/mDNSWindows/Applications/RendezvousBrowser/WindowsCE/Sources/StdAfx.h index 3672152..fb4331e 100644 --- a/mDNSWindows/Applications/RendezvousBrowser/WindowsCE/Sources/StdAfx.h +++ b/mDNSWindows/Applications/RendezvousBrowser/WindowsCE/Sources/StdAfx.h @@ -3,6 +3,8 @@ * * @APPLE_LICENSE_HEADER_START@ * + * Copyright (c) 1999-2003 Apple Computer, Inc. All Rights Reserved. + * * This file contains Original Code and/or Modifications of Original Code * as defined in and that are subject to the Apple Public Source License * Version 2.0 (the 'License'). You may not use this file except in diff --git a/mDNSWindows/Applications/RendezvousTest/Tool.c b/mDNSWindows/Applications/RendezvousTest/Tool.c index 7e49566..beda066 100644 --- a/mDNSWindows/Applications/RendezvousTest/Tool.c +++ b/mDNSWindows/Applications/RendezvousTest/Tool.c @@ -3,6 +3,8 @@ * * @APPLE_LICENSE_HEADER_START@ * + * Copyright (c) 1999-2003 Apple Computer, Inc. All Rights Reserved. + * * This file contains Original Code and/or Modifications of Original Code * as defined in and that are subject to the Apple Public Source License * Version 2.0 (the 'License'). You may not use this file except in diff --git a/mDNSWindows/Applications/RendezvousTest/ToolPrefixWindows.h b/mDNSWindows/Applications/RendezvousTest/ToolPrefixWindows.h index eaa6a70..af1135d 100644 --- a/mDNSWindows/Applications/RendezvousTest/ToolPrefixWindows.h +++ b/mDNSWindows/Applications/RendezvousTest/ToolPrefixWindows.h @@ -3,6 +3,8 @@ * * @APPLE_LICENSE_HEADER_START@ * + * Copyright (c) 1999-2003 Apple Computer, Inc. All Rights Reserved. + * * This file contains Original Code and/or Modifications of Original Code * as defined in and that are subject to the Apple Public Source License * Version 2.0 (the 'License'). You may not use this file except in diff --git a/mDNSWindows/Applications/RendezvousTest/ToolPrefixWindowsDebug.h b/mDNSWindows/Applications/RendezvousTest/ToolPrefixWindowsDebug.h index 1f76fc2..41f56e8 100644 --- a/mDNSWindows/Applications/RendezvousTest/ToolPrefixWindowsDebug.h +++ b/mDNSWindows/Applications/RendezvousTest/ToolPrefixWindowsDebug.h @@ -3,6 +3,8 @@ * * @APPLE_LICENSE_HEADER_START@ * + * Copyright (c) 1999-2003 Apple Computer, Inc. All Rights Reserved. + * * This file contains Original Code and/or Modifications of Original Code * as defined in and that are subject to the Apple Public Source License * Version 2.0 (the 'License'). You may not use this file except in diff --git a/mDNSWindows/Applications/RendezvousTest/ToolWin32.sln b/mDNSWindows/Applications/RendezvousTest/ToolWin32VS2002.sln similarity index 74% rename from mDNSWindows/Applications/RendezvousTest/ToolWin32.sln rename to mDNSWindows/Applications/RendezvousTest/ToolWin32VS2002.sln index 495d5df..bc86b75 100644 --- a/mDNSWindows/Applications/RendezvousTest/ToolWin32.sln +++ b/mDNSWindows/Applications/RendezvousTest/ToolWin32VS2002.sln @@ -1,14 +1,17 @@ Microsoft Visual Studio Solution File, Format Version 7.00 -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Tool", "ToolWin32.vcproj", "{F66EFE7E-50A6-44D4-87C7-742B303BA852}" +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Tool", "ToolWin32VS2002.vcproj", "{F66EFE7E-50A6-44D4-87C7-742B303BA852}" EndProject Global GlobalSection(SolutionConfiguration) = preSolution - ConfigName.0 = Debug - ConfigName.1 = Release + ConfigName.0 = all + ConfigName.1 = Debug + ConfigName.2 = Release EndGlobalSection GlobalSection(ProjectDependencies) = postSolution EndGlobalSection GlobalSection(ProjectConfiguration) = postSolution + {F66EFE7E-50A6-44D4-87C7-742B303BA852}.all.ActiveCfg = all|Win32 + {F66EFE7E-50A6-44D4-87C7-742B303BA852}.all.Build.0 = all|Win32 {F66EFE7E-50A6-44D4-87C7-742B303BA852}.Debug.ActiveCfg = Debug|Win32 {F66EFE7E-50A6-44D4-87C7-742B303BA852}.Debug.Build.0 = Debug|Win32 {F66EFE7E-50A6-44D4-87C7-742B303BA852}.Release.ActiveCfg = Release|Win32 diff --git a/mDNSWindows/Applications/RendezvousTest/ToolWin32.vcproj b/mDNSWindows/Applications/RendezvousTest/ToolWin32VS2002.vcproj similarity index 100% rename from mDNSWindows/Applications/RendezvousTest/ToolWin32.vcproj rename to mDNSWindows/Applications/RendezvousTest/ToolWin32VS2002.vcproj diff --git a/mDNSWindows/Applications/RendezvousTest/ToolWin32VS2003.sln b/mDNSWindows/Applications/RendezvousTest/ToolWin32VS2003.sln new file mode 100644 index 0000000..53a2ba2 --- /dev/null +++ b/mDNSWindows/Applications/RendezvousTest/ToolWin32VS2003.sln @@ -0,0 +1,24 @@ +Microsoft Visual Studio Solution File, Format Version 8.00 +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Tool", "ToolWin32VS2003.vcproj", "{F66EFE7E-50A6-44D4-87C7-742B303BA852}" + ProjectSection(ProjectDependencies) = postProject + EndProjectSection +EndProject +Global + GlobalSection(SolutionConfiguration) = preSolution + all = all + Debug = Debug + Release = Release + EndGlobalSection + GlobalSection(ProjectConfiguration) = postSolution + {F66EFE7E-50A6-44D4-87C7-742B303BA852}.all.ActiveCfg = all|Win32 + {F66EFE7E-50A6-44D4-87C7-742B303BA852}.all.Build.0 = all|Win32 + {F66EFE7E-50A6-44D4-87C7-742B303BA852}.Debug.ActiveCfg = Debug|Win32 + {F66EFE7E-50A6-44D4-87C7-742B303BA852}.Debug.Build.0 = Debug|Win32 + {F66EFE7E-50A6-44D4-87C7-742B303BA852}.Release.ActiveCfg = Release|Win32 + {F66EFE7E-50A6-44D4-87C7-742B303BA852}.Release.Build.0 = Release|Win32 + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + EndGlobalSection + GlobalSection(ExtensibilityAddIns) = postSolution + EndGlobalSection +EndGlobal diff --git a/mDNSWindows/Applications/RendezvousTest/ToolWin32VS2003.vcproj b/mDNSWindows/Applications/RendezvousTest/ToolWin32VS2003.vcproj new file mode 100644 index 0000000..2349cb9 --- /dev/null +++ b/mDNSWindows/Applications/RendezvousTest/ToolWin32VS2003.vcproj @@ -0,0 +1,205 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/mDNSWindows/DNSServices/DNSServiceDiscovery.c b/mDNSWindows/DNSServices/DNSServiceDiscovery.c index 77e3dcb..0fa57f3 100644 --- a/mDNSWindows/DNSServices/DNSServiceDiscovery.c +++ b/mDNSWindows/DNSServices/DNSServiceDiscovery.c @@ -3,6 +3,8 @@ * * @APPLE_LICENSE_HEADER_START@ * + * Copyright (c) 1999-2003 Apple Computer, Inc. All Rights Reserved. + * * This file contains Original Code and/or Modifications of Original Code * as defined in and that are subject to the Apple Public Source License * Version 2.0 (the 'License'). You may not use this file except in diff --git a/mDNSWindows/DNSServices/DNSServiceDiscovery.h b/mDNSWindows/DNSServices/DNSServiceDiscovery.h index 618bbb3..d132300 100644 --- a/mDNSWindows/DNSServices/DNSServiceDiscovery.h +++ b/mDNSWindows/DNSServices/DNSServiceDiscovery.h @@ -3,6 +3,8 @@ * * @APPLE_LICENSE_HEADER_START@ * + * Copyright (c) 1999-2003 Apple Computer, Inc. All Rights Reserved. + * * This file contains Original Code and/or Modifications of Original Code * as defined in and that are subject to the Apple Public Source License * Version 2.0 (the 'License'). You may not use this file except in diff --git a/mDNSWindows/DNSServices/DNSServices.c b/mDNSWindows/DNSServices/DNSServices.c index ca84436..edb7047 100755 --- a/mDNSWindows/DNSServices/DNSServices.c +++ b/mDNSWindows/DNSServices/DNSServices.c @@ -3,6 +3,8 @@ * * @APPLE_LICENSE_HEADER_START@ * + * Copyright (c) 1999-2003 Apple Computer, Inc. All Rights Reserved. + * * This file contains Original Code and/or Modifications of Original Code * as defined in and that are subject to the Apple Public Source License * Version 2.0 (the 'License'). You may not use this file except in diff --git a/mDNSWindows/DNSServices/DNSServices.h b/mDNSWindows/DNSServices/DNSServices.h index f5be4aa..d1fb039 100755 --- a/mDNSWindows/DNSServices/DNSServices.h +++ b/mDNSWindows/DNSServices/DNSServices.h @@ -3,6 +3,8 @@ * * @APPLE_LICENSE_HEADER_START@ * + * Copyright (c) 1999-2003 Apple Computer, Inc. All Rights Reserved. + * * This file contains Original Code and/or Modifications of Original Code * as defined in and that are subject to the Apple Public Source License * Version 2.0 (the 'License'). You may not use this file except in diff --git a/mDNSWindows/mDNSWin32.c b/mDNSWindows/mDNSWin32.c index 161e635..e1f012e 100755 --- a/mDNSWindows/mDNSWin32.c +++ b/mDNSWindows/mDNSWin32.c @@ -3,6 +3,8 @@ * * @APPLE_LICENSE_HEADER_START@ * + * Copyright (c) 1999-2003 Apple Computer, Inc. All Rights Reserved. + * * This file contains Original Code and/or Modifications of Original Code * as defined in and that are subject to the Apple Public Source License * Version 2.0 (the 'License'). You may not use this file except in diff --git a/mDNSWindows/mDNSWin32.h b/mDNSWindows/mDNSWin32.h index 2bf5ddd..492dbb6 100755 --- a/mDNSWindows/mDNSWin32.h +++ b/mDNSWindows/mDNSWin32.h @@ -3,6 +3,8 @@ * * @APPLE_LICENSE_HEADER_START@ * + * Copyright (c) 1999-2003 Apple Computer, Inc. All Rights Reserved. + * * This file contains Original Code and/or Modifications of Original Code * as defined in and that are subject to the Apple Public Source License * Version 2.0 (the 'License'). You may not use this file except in -- 2.45.2