home *** CD-ROM | disk | FTP | other *** search
Text File | 1995-01-06 | 21.6 KB | 772 lines | [TEXT/MMCC] |
- //
- // CTCPResolverCall.cp
- //
- // TurboTCP library
- // TCP resolver call class
- //
- // Copyright © 1993-95, FrostByte Design / Eric Scouten
- // Some portions adapted from file “dnr.c” Copyright © 1988 by Apple Computer. All rights reserved.
- //
-
- #include "CTCPResolverCall.h"
-
- #include <Folders.h>
- #include <GestaltEqu.h>
- #include <Traps.h>
-
-
- //***********************************************************
- //
- // Procedure code numbers for DNR code segment
- //
-
- #define OPENRESOLVER 1L
- #define CLOSERESOLVER 2L
- #define STRTOADDR 3L
- #define ADDRTOSTR 4L
- #define ENUMCACHE 5L
- #define ADDRTONAME 6L
- #define HINFO 7L
- #define MXINFO 8L
-
-
- //***********************************************************
- //
- // Class variables
- //
-
- Handle CTCPResolverCall::macDNRcode = nil;
- UniversalProcPtr CTCPResolverCall::macDNRentry = nil;
- #if TurboTCP_CFM
- ResultUPP CTCPResolverCall::StrToAddrUPP = NewResultProc(CTCPResolverCall::PostponeStrToAddr);
- ResultUPP CTCPResolverCall::AddrToNameUPP = NewResultProc(CTCPResolverCall::PostponeAddrToName);
- Result2UPP CTCPResolverCall::HInfoUPP = NewResult2Proc(CTCPResolverCall::PostponeHInfo);
- Result2UPP CTCPResolverCall::MXInfoUPP = NewResult2Proc(CTCPResolverCall::PostponeMXInfo);
- #endif
-
-
- //***********************************************************
- //
- // Interfaces to TCP DNR (adapted from latest <dnr.c>)
- //
- //
-
- // NOTE: The dnr.c file created for Universal Headers contained an error. All of the selectors
- // are treated by the DNR as long values, not short. This has been corrected in TurboTCP.
-
- extern "C" {
- typedef OSErr (*OpenResolverProcPtr)(long selector, char* fileName);
- typedef OSErr (*CloseResolverProcPtr)(long selector);
- typedef OSErr (*StrToAddrProcPtr)(long selector, char* hostName, struct hostInfo* rtnStruct,
- long resultProc, char* userData);
- typedef OSErr (*AddrToStrProcPtr)(long selector, long address, char* hostName);
- typedef OSErr (*AddrToNameProcPtr)(long selector, unsigned long addr, struct hostInfo* rtnStruct,
- long resultProc, char* userData);
- typedef OSErr (*HInfoProcPtr)(long selector, char* hostName, struct returnRec* returnRecPtr,
- long resultProc, char* userData);
- typedef OSErr (*MXInfoProcPtr)(long selector, char* hostName, struct returnRec* returnRecPtr,
- long resultProc, char* userData);
- }
-
- #if TurboTCP_CFM
-
- enum {
- uppOpenResolverProcInfo = kCStackBased
- | RESULT_SIZE(SIZE_CODE(sizeof(short)))
- | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(long)))
- | STACK_ROUTINE_PARAMETER(2, SIZE_CODE(sizeof(char*)))
- };
- enum {
- uppCloseResolverProcInfo = kCStackBased
- | RESULT_SIZE(SIZE_CODE(sizeof(short)))
- | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(long)))
- };
- enum {
- uppStrToAddrProcInfo = kCStackBased
- | RESULT_SIZE(SIZE_CODE(sizeof(short)))
- | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(long)))
- | STACK_ROUTINE_PARAMETER(2, SIZE_CODE(sizeof(char*)))
- | STACK_ROUTINE_PARAMETER(3, SIZE_CODE(sizeof(struct hostInfo*)))
- | STACK_ROUTINE_PARAMETER(4, SIZE_CODE(sizeof(long)))
- | STACK_ROUTINE_PARAMETER(5, SIZE_CODE(sizeof(char*)))
- };
- enum {
- uppAddrToStrProcInfo = kCStackBased
- | RESULT_SIZE(SIZE_CODE(sizeof(short)))
- | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(long)))
- | STACK_ROUTINE_PARAMETER(2, SIZE_CODE(sizeof(unsigned long)))
- | STACK_ROUTINE_PARAMETER(3, SIZE_CODE(sizeof(char*)))
- };
- enum {
- uppAddrToNameProcInfo = kCStackBased
- | RESULT_SIZE(SIZE_CODE(sizeof(short)))
- | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(long)))
- | STACK_ROUTINE_PARAMETER(2, SIZE_CODE(sizeof(unsigned long)))
- | STACK_ROUTINE_PARAMETER(3, SIZE_CODE(sizeof(struct hostInfo*)))
- | STACK_ROUTINE_PARAMETER(4, SIZE_CODE(sizeof(long)))
- | STACK_ROUTINE_PARAMETER(5, SIZE_CODE(sizeof(char*)))
-
- };
- enum {
- uppHInfoProcInfo = kCStackBased
- | RESULT_SIZE(SIZE_CODE(sizeof(short)))
- | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(long)))
- | STACK_ROUTINE_PARAMETER(2, SIZE_CODE(sizeof(char*)))
- | STACK_ROUTINE_PARAMETER(3, SIZE_CODE(sizeof(struct returnRec*)))
- | STACK_ROUTINE_PARAMETER(4, SIZE_CODE(sizeof(long)))
- | STACK_ROUTINE_PARAMETER(5, SIZE_CODE(sizeof(char*)))
-
- };
- enum {
- uppMXInfoProcInfo = kCStackBased
- | RESULT_SIZE(SIZE_CODE(sizeof(short)))
- | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(long)))
- | STACK_ROUTINE_PARAMETER(2, SIZE_CODE(sizeof(char*)))
- | STACK_ROUTINE_PARAMETER(3, SIZE_CODE(sizeof(struct returnRec*)))
- | STACK_ROUTINE_PARAMETER(4, SIZE_CODE(sizeof(long)))
- | STACK_ROUTINE_PARAMETER(5, SIZE_CODE(sizeof(char*)))
-
- };
-
- typedef UniversalProcPtr OpenResolverUPP;
- typedef UniversalProcPtr CloseResolverUPP;
- typedef UniversalProcPtr StrToAddrUPP;
- typedef UniversalProcPtr AddrToStrUPP;
- typedef UniversalProcPtr AddrToNameUPP;
- typedef UniversalProcPtr HInfoUPP;
- typedef UniversalProcPtr MXInfoUPP;
-
- #define CallOpenResolverProc(userRoutine, selector, filename) \
- CallUniversalProc(userRoutine, uppOpenResolverProcInfo, selector, filename)
- #define CallCloseResolverProc(userRoutine, selector) \
- CallUniversalProc(userRoutine, uppCloseResolverProcInfo, selector)
- #define CallStrToAddrProc(userRoutine, selector, hostName, rtnStruct, resultProc, userData) \
- CallUniversalProc(userRoutine, uppStrToAddrProcInfo, selector, hostName, rtnStruct, resultProc, userData)
- #define CallAddrToStrProc(userRoutine, selector, address, hostName) \
- CallUniversalProc(userRoutine, uppAddrToStrProcInfo, selector, address, hostName)
- #define CallAddrToNameProc(userRoutine, selector, addr, rtnStruct, resultProc, userData) \
- CallUniversalProc(userRoutine, uppAddrToNameProcInfo, selector, addr, rtnStruct, resultProc, userData)
- #define CallHInfoProc(userRoutine, selector, hostName, returnRecPtr, resultProc, userData) \
- CallUniversalProc(userRoutine, uppHInfoProcInfo, selector, hostName, returnRecPtr, resultProc, userData)
- #define CallMXInfoProc(userRoutine, selector, hostName, returnRecPtr, resultProc, userData) \
- CallUniversalProc(userRoutine, selector, hostName, returnRecPtr, resultProc, userData)
-
- #else // #if TurboTCP_CFM
-
- typedef OpenResolverProcPtr OpenResolverUPP;
- typedef CloseResolverProcPtr CloseResolverUPP;
- typedef StrToAddrProcPtr StrToAddrUPP;
- typedef AddrToStrProcPtr AddrToStrUPP;
- typedef AddrToNameProcPtr AddrToNameUPP;
- typedef HInfoProcPtr HInfoUPP;
- typedef MXInfoProcPtr MXInfoUPP;
-
- #define CallOpenResolverProc(userRoutine, selector, filename) \
- (*((OpenResolverProcPtr) userRoutine))(selector, filename)
- #define CallCloseResolverProc(userRoutine, selector) \
- (*((CloseResolverProcPtr) userRoutine))(selector)
- #define CallStrToAddrProc(userRoutine, selector, hostName, rtnStruct, resultProc, userData) \
- (*((StrToAddrProcPtr) userRoutine))(selector, hostName, rtnStruct, resultProc, userData)
- #define CallAddrToStrProc(userRoutine, selector, address, hostName) \
- (*((AddrToStrProcPtr) userRoutine))(selector, address, hostName)
- #define CallAddrToNameProc(userRoutine, selector, addr, rtnStruct, resultProc, userData) \
- (*((AddrToNameProcPtr) userRoutine))(selector, addr, rtnStruct, resultProc, userData)
- #define CallHInfoProc(userRoutine, selector, hostName, returnRecPtr, resultProc, userData) \
- (*((HInfoProcPtr) userRoutine))(selector, hostName, returnRecPtr, resultProc, userData)
- #define CallMXInfoProc(userRoutine, selector, hostName, returnRecPtr, resultProc, userData) \
- (*((MXInfoProcPtr) userRoutine))(selector, hostName, returnRecPtr, resultProc, userData)
-
- #endif // #if TurboTCP_CFM … else
-
-
- //***********************************************************
-
- CTCPResolverCall::CTCPResolverCall
- (CTCPEndpoint& theEndpoint) // the endpoint that is attached to this resolver
-
- : itsEndpoint(&theEndpoint), qEntry(this)
-
- {
- inUse = false;
- disposeOnCompletion = false;
- pendingNotify = notifNone;
- qEntry.qType = resolverCall;
- }
-
-
- //***********************************************************
-
- void CTCPResolverCall::Dispose()
-
- // Get rid of the resolver object. If a resolver operation is in progress, will dispose of
- // itself when the current resolver operation is completed. Use Dispose() instead of
- // the destructor since the object may need to remain around for a while.
-
- {
- if (inUse)
- disposeOnCompletion = true;
- else
- delete this;
- }
-
-
- // -- request resolver calls --
-
- //***********************************************************
-
- void CTCPResolverCall::DoStrToAddr
- (char* theHostName) // whose IP address do we need?
-
- // Get the IP address of a host named by a DNS or dotted decimal string.
- // Completion is handled by HandleStrToAddr.
-
- {
- OSErr theResult;
-
- if (inUse)
- ThrowOSErr_(resolverInUse);
- if (!(CTCPDriver::gTCPDriver)->CheckResolver())
- ThrowOSErr_(noResolverErr);
-
- inUse = true;
- (CTCPDriver::gTCPDriver)->RegisterActiveResolver(this);
- ::BlockMoveData(theHostName, &hostName, 255);
-
- #if TurboTCP_CFM // seems to be buggy here…
- theResult = CallStrToAddrProc(macDNRentry, STRTOADDR, (char*) &hostName, &theHostInfo,
- (long) StrToAddrUPP, (char*) this);
- #else
- theResult = CallStrToAddrProc(macDNRentry, STRTOADDR, (char*) &hostName, &theHostInfo,
- (long) &PostponeStrToAddr, (char*) this);
- #endif
-
-
- // if call was completed immediately (with error or not), process it immediately
-
- if (theResult != cacheFault) {
- inUse = false;
- (CTCPDriver::gTCPDriver)->RemoveActiveResolver(this);
- HandleStrToAddr();
- }
- }
-
-
- //***********************************************************
-
- void CTCPResolverCall::DoAddrToStr // static method
- (ip_addr theIPaddr, // the address to convert
- char* theString) // buffer for the completed string (min. 16 chars)
-
- // Convert an IP address to dotted decimal notation. This call can be used while the
- // resolver object is otherwise in use, and is completed immediately.
-
- {
- if (!(CTCPDriver::gTCPDriver)->CheckResolver())
- ThrowOSErr_(noResolverErr);
- CallAddrToStrProc(macDNRentry, ADDRTOSTR, theIPaddr, theString);
- }
-
-
- //***********************************************************
-
- void CTCPResolverCall::DoAddrToName
- (ip_addr theIPaddr) // the IP address to query
-
- // Get the canonical name of a host as specified by IP address. Completion is handled by
- // HandleAddrToName method.
-
- {
- OSErr theResult;
-
- if (inUse)
- ThrowOSErr_(resolverInUse);
- if (!(CTCPDriver::gTCPDriver)->CheckResolver())
- ThrowOSErr_(noResolverErr);
-
- inUse = true;
- (CTCPDriver::gTCPDriver)->RegisterActiveResolver(this);
-
- #if TurboTCP_CFM // seems to be buggy here…
- theResult = CallAddrToNameProc(macDNRentry, ADDRTONAME, theIPaddr, &theHostInfo,
- (long) AddrToNameUPP, (char*) this);
- #else
- theResult = CallAddrToNameProc(macDNRentry, ADDRTONAME, theIPaddr, &theHostInfo,
- (long) &PostponeAddrToName, (char*) this);
- #endif
-
-
- // if call was completed immediately (with error or not), process it immediately
-
- if (theResult != cacheFault) {
- inUse = false;
- (CTCPDriver::gTCPDriver)->RemoveActiveResolver(this);
- HandleAddrToName();
- }
- }
-
-
- //***********************************************************
-
- void CTCPResolverCall::DoHInfo
- (char* theHostName) // who we askin’ ‘bout anyway?
-
- // Get the CPU type and operating system type of a remote host. Completion is handled by
- // HandleHInfo.
-
- {
- OSErr theResult;
-
- if (inUse)
- ThrowOSErr_(resolverInUse);
- if (!(CTCPDriver::gTCPDriver)->CheckResolver())
- ThrowOSErr_(noResolverErr);
-
- inUse = true;
- (CTCPDriver::gTCPDriver)->RegisterActiveResolver(this);
- ::BlockMoveData(theHostName, &hostName, 255);
-
- #if TurbTCP_CFM // seems to be buggy here…
- theResult = CallHInfoProc(macDNRentry, HINFO, (char*) &hostName, &theHMXInfo,
- (long) HInfoUPP, (char*) this);
- #else
- theResult = CallHInfoProc(macDNRentry, HINFO, (char*) &hostName, &theHMXInfo,
- (long) &PostponeHInfo, (char*) this);
- #endif
-
-
- // if call was completed immediately (with error or not), process it immediately
-
- if (theResult != cacheFault) {
- inUse = false;
- (CTCPDriver::gTCPDriver)->RemoveActiveResolver(this);
- HandleHInfo();
- }
- }
-
-
- //***********************************************************
-
- void CTCPResolverCall::DoMXInfo
- (char* theHostName) // who we askin’ ‘bout anyway?
-
- // Get the mailbox exchange (MX) info of a remote host. Completion is handled by
- // HandleMXInfo.
-
- {
- OSErr theResult;
-
- if (inUse)
- ThrowOSErr_(resolverInUse);
- if (!(CTCPDriver::gTCPDriver)->CheckResolver())
- ThrowOSErr_(noResolverErr);
-
- inUse = true;
- (CTCPDriver::gTCPDriver)->RegisterActiveResolver(this);
- ::BlockMoveData(theHostName, &hostName, 255);
- #if TurboTCP_CFM // seems to be buggy here…
- theResult = CallMXInfoProc(macDNRentry, MXINFO, (char*) &hostName, &theHMXInfo,
- (long) MXInfoUPP, (char*) this);
- #else
- theResult = CallMXInfoProc(macDNRentry, MXINFO, (char*) &hostName, &theHMXInfo,
- (long) &PostponeMXInfo, (char*) this);
- #endif
-
-
- // if call was completed immediately (with error or not), process it immediately
-
- if (theResult != cacheFault) {
- inUse = false;
- (CTCPDriver::gTCPDriver)->RemoveActiveResolver(this);
- HandleMXInfo();
- }
- }
-
-
- // -- respond to completion of resolver calls --
-
- //***********************************************************
-
- void CTCPResolverCall::ProcessNotify() // private method
-
- // Handles any notifications passed to the resolver. This routine is free of interrupt-level
- // constraints.
-
- {
- // free this resolver object for future use
-
- (CTCPDriver::gTCPDriver)->RemoveActiveResolver(this);
- inUse = false;
-
-
- // dispatch notification to appropriate routine
-
- switch (pendingNotify) {
- case notifStrToAddr:
- HandleStrToAddr();
- break;
-
- case notifAddrToName:
- HandleAddrToName();
- break;
-
- case notifHInfo:
- HandleHInfo();
- break;
-
- case notifMXInfo:
- HandleMXInfo();
- }
-
-
- // if someone attempted to dispose this earlier, do it now
-
- if (disposeOnCompletion)
- delete this;
-
- }
-
-
- // -- open/close TCP resolver --
-
- //***********************************************************
-
- void CTCPResolverCall::OpenResolver() // private static method
-
- // Find the MacTCP DNR code resource and read it. Save the location of the resolver resource
- // for later use.
-
- {
- short vRefNum;
- short refnum;
- long dirID;
- short fRef;
- OSErr rc;
-
-
- // is the resolver already there?
-
- if (macDNRentry)
- return;
-
-
- // open the MacTCP driver to get DNR resources
-
- Try_ {
- refnum = OpenTheDNR();
- }
- Catch_(err) {
- DontThrowSame_; // ignore failures since the resource may
- // have been installed in the System file
- // (if running on a Mac 512Ke)
- }
- EndCatch_;
-
-
- // load the DNR resource package
-
- macDNRcode = ::GetIndResource('dnrp', 1);
- ThrowIfNil_(macDNRcode);
- ::DetachResource(macDNRcode);
-
- if (refnum != -1)
- ::CloseResFile(refnum);
-
-
- // lock the DNR resource since it cannot be relocated while opened
-
- ::MoveHHi(macDNRcode);
- ::HLock(macDNRcode);
- macDNRentry = (UniversalProcPtr) *macDNRcode;
-
-
- // check for “hosts” file in System Folder (BRB)
-
- GetSystemFolder(&vRefNum, &dirID);
- rc = ::HOpen(vRefNum, dirID, "\pHosts", fsRdPerm, &fRef);
- switch (rc) {
- case noErr:
- ::FSClose(fRef);
- break;
-
- case fnfErr:
- if ((rc = ::HCreate(vRefNum, dirID, "\pHosts", 'ttxt', 'TEXT')) != noErr)
- #if TurboTCP_TCL
- ErrorAlert(rc, SpecifyMsg(1001, 1));
- #else
- (void) 0; //! TEMPORARY: punt
- #endif
- break;
-
- default:
- break;
- }
-
-
- // ask the DNR resource to open the resolver
-
- rc = CallOpenResolverProc(macDNRentry, OPENRESOLVER, nil);
- // send it a null hosts file name
- if (rc != noErr) {
- ::HUnlock(macDNRcode); // problem with open resolver, flush DNR resource
- ::DisposeHandle(macDNRcode);
- macDNRcode = nil;
- macDNRentry = nil;
- ThrowOSErr_(rc); // signal failure of DNR
- }
-
- }
-
-
- //***********************************************************
-
- void CTCPResolverCall::CloseResolver() // private static method
-
- // Shut down the DNR code resource. Does nothing if the resolver was never loaded.
-
- {
-
- // ensure that we had a resolver to begin with
-
- if (macDNRentry == nil)
- return;
-
-
- // call CloseResolver function in DNR
-
- CallCloseResolverProc(macDNRentry, CLOSERESOLVER);
-
-
- // release the DNR code resource
-
- ::HUnlock(macDNRcode);
- ::DisposeHandle(macDNRcode);
- macDNRcode = nil;
- macDNRentry = nil;
-
- }
-
-
- //***********************************************************
-
- short CTCPResolverCall::OpenTheDNR() // private static method
-
- // Search in several places for the MacTCP DNR code resource. Tries the Control Panels
- // folder and the System folder.
-
- // Returns the reference number to resource file.
-
- {
- short refnum;
- short vRefNum;
- long dirID;
-
-
- // first search Control Panels for MacTCP 1.1.x
-
- GetCPanelFolder(&vRefNum, &dirID);
- refnum = SearchFolderForDNRP('cdev', 'ztcp', vRefNum, dirID);
- if (refnum != -1)
- return refnum;
-
-
- // next search System Folder for MacTCP 1.0.x
-
- GetSystemFolder(&vRefNum, &dirID);
- refnum = SearchFolderForDNRP('cdev', 'mtcp', vRefNum, dirID);
- if (refnum != -1)
- return refnum;
-
-
- // finally, search Control Panels for MacTCP 1.0.x
-
- GetCPanelFolder(&vRefNum, &dirID);
- refnum = SearchFolderForDNRP('cdev', 'mtcp', vRefNum, dirID);
- if (refnum != -1)
- return refnum;
-
- return -1;
-
- }
-
-
- //***********************************************************
-
- short CTCPResolverCall::SearchFolderForDNRP // private static method
- (long targetType, // file type that we’re looking for
- long targetCreator, // file creator
- short vRefNum, // volume ID
- long dirID) // directory ID
-
- // Search a folder for files that might contain the 'dnrp' resource.
- // Returns the refnum of the file if found, -1 if not found.
-
- {
- HParamBlockRec fi;
- Str255 filename;
- short refnum;
-
-
- // initialize our search mechanism
-
- fi.fileParam.ioCompletion = nil;
- fi.fileParam.ioNamePtr = filename;
- fi.fileParam.ioVRefNum = vRefNum;
- fi.fileParam.ioDirID = dirID;
- fi.fileParam.ioFDirIndex = 1;
-
-
- // keep looking till we run out of files
-
- while (::PBHGetFInfoSync(&fi) == noErr) {
-
- // scan the folder for files that match our type & creator
-
- if (fi.fileParam.ioFlFndrInfo.fdType == targetType &&
- fi.fileParam.ioFlFndrInfo.fdCreator == targetCreator) {
-
- // type/creator match, look for the resource
-
- refnum = ::HOpenResFile(vRefNum, dirID, filename, fsRdPerm);
- if (::GetIndResource('dnrp', 1) == nil)
- ::CloseResFile(refnum);
- else
- return refnum;
- }
-
- // no match or no resource, try next file in folder
-
- fi.fileParam.ioFDirIndex++;
- fi.fileParam.ioDirID = dirID; // PBHGetFInfo() clobbers ioDirID
- }
-
- return -1; // nothing found
-
- }
-
-
- //***********************************************************
-
- void CTCPResolverCall::GetSystemFolder // private static method
- (short* vRefNumP, // returns volume ID
- long* dirIDP) // returns directory ID
-
- // Get the ID of the current system folder.
-
- {
- SysEnvRec info;
- long wdProcID;
-
- ::SysEnvirons(1, &info);
- if (GetWDInfo(info.sysVRefNum, vRefNumP, dirIDP, &wdProcID) != noErr) {
- *vRefNumP = 0;
- *dirIDP = 0;
- }
- }
-
-
- //***********************************************************
-
- void CTCPResolverCall::GetCPanelFolder
- (short* vRefNumP, // returns volume ID
- long* dirIDP) // returns directory ID
-
- // Fetch the ID of the current “Control Panels” folder.
-
- {
- Boolean hasFolderMgr = false;
- long feature;
-
-
- // see if we have the Folder Manager available
-
- #if TurboTCP_TCL
- if (TrapAvailable(_Gestalt)) // PowerPlant guarantees system 7 & thus Gestalt
- #endif
- if (::Gestalt(gestaltFindFolderAttr, &feature) == noErr)
- hasFolderMgr = true;
-
-
- // if folder manager, use it; else return system folder
-
- if (!hasFolderMgr) {
- GetSystemFolder(vRefNumP, dirIDP);
- return;
- }
- else {
- if (::FindFolder(kOnSystemDisk, kControlPanelFolderType,
- kDontCreateFolder, vRefNumP, dirIDP) != noErr) {
- *vRefNumP = 0;
- *dirIDP = 0;
- }
- }
-
- }
-
-
- // -- interrupt-level methods: delay processing for non-interrupt status --
-
- #ifndef __MWERKS__
- //#pragma options(!profile)
- #else
- #pragma profile off
- #endif
-
-
- //***********************************************************
-
- void CTCPResolverCall::PostponeNotify // private static method
- (short theNotifType) // which resolver call was completed
-
- // Respond to notification that a DNR call was completed. Delays processing of notification
- // until the next net-event call. This method merely logs the kind of notification and adds this
- // resolver to the list of resolvers to be processed next time through the event loop.
-
- {
- pendingNotify = theNotifType;
- ::Enqueue((QElemPtr) &qEntry, &((CTCPDriver::gTCPDriver)->asyncQueue));
- }
-
-
- //***********************************************************
- //
- // Completion routines
- //
- // These methods respond to notification that various MacTCP DNS commands have
- // been completed. They merely call PostponeNotify and defer the processing until later.
- //
-
- pascal void CTCPResolverCall::PostponeStrToAddr // private static method
- (struct hostInfo* hostInfoPtr, // pointer to the DNR data structure (ignored)
- char* userDataPtr) // user data pointer
- {
- if (userDataPtr)
- ((CTCPResolverCall*) userDataPtr)->PostponeNotify(notifStrToAddr);
- }
-
-
- pascal void CTCPResolverCall::PostponeAddrToName // private static method
- (struct hostInfo* hostInfoPtr, // pointer to the DNR data structure (ignored)
- char* userDataPtr) // user data pointer
- {
- if (userDataPtr)
- ((CTCPResolverCall*) userDataPtr)->PostponeNotify(notifAddrToName);
- }
-
-
- pascal void CTCPResolverCall::PostponeHInfo // private static method
- (struct returnRec* returnRecPtr, // pointer to the DNR data structure (ignored)
- char* userDataPtr) // user data pointer
- {
- if (userDataPtr)
- ((CTCPResolverCall*) userDataPtr)->PostponeNotify(notifHInfo);
- }
-
-
- pascal void CTCPResolverCall::PostponeMXInfo // private static method
- (struct returnRec* returnRecPtr, // pointer to the DNR data structure (ignored)
- char* userDataPtr) // user data pointer
- {
- if (userDataPtr)
- ((CTCPResolverCall*) userDataPtr)->PostponeNotify(notifMXInfo);
- }
-