home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Garbo
/
Garbo.cdr
/
mac
/
source
/
netnwscd.sit
/
tcp.diffs
< prev
next >
Wrap
Text File
|
1990-10-22
|
7KB
|
303 lines
AddressXlation.h
*** before/AddressXlation.h Mon Oct 22 13:43:10 1990
--- after/AddressXlation.h Mon Oct 22 13:43:55 1990
***************
*** 5,16 ****
Copyright Apple Computer, Inc. 1988
All rights reserved
! */
#define NUM_ALT_ADDRS 4
typedef struct hostInfo {
! int rtnCode;
char cname[255];
unsigned long addr[NUM_ALT_ADDRS];
};
--- 5,19 ----
Copyright Apple Computer, Inc. 1988
All rights reserved
! */
+ #define _H_AddressXlation
+
+
#define NUM_ALT_ADDRS 4
typedef struct hostInfo {
! long rtnCode;
char cname[255];
unsigned long addr[NUM_ALT_ADDRS];
};
***************
*** 33,41 ****
--- 36,50 ----
} rdata;
};
+ #ifdef notdef
typedef pascal void (*EnumResultProcPtr)(struct cacheEntryRecord *cacheEntryRecordPtr, char *userDataPtr);
typedef pascal void (*ResultProcPtr)(struct hostInfo *hostInfoPtr, char *userDataPtr);
+ #else
+ typedef void (*EnumResultProcPtr)(struct cacheEntryRecord *cacheEntryRecordPtr, char *userDataPtr);
+
+ typedef void (*ResultProcPtr)(struct hostInfo *hostInfoPtr, char *userDataPtr);
+ #endif
extern OSErr OpenResolver(char *fileName);
GetMyIPAddr.h
*** before/GetMyIPAddr.h Mon Oct 22 13:43:10 1990
--- after/GetMyIPAddr.h Mon Oct 22 13:43:55 1990
***************
*** 7,12 ****
--- 7,14 ----
*/
+ #define _H_GetMyIPAddr
+
#define ipctlGetAddr 15 /* csCode to get our IP address */
#define ParamBlockHeader \
MacTCPCommonTypes.h
*** before/MacTCPCommonTypes.h Mon Oct 22 13:43:11 1990
--- after/MacTCPCommonTypes.h Mon Oct 22 13:43:55 1990
***************
*** 7,15 ****
*/
! #ifndef __TYPES__
! #include <Types.h>
! #endif /* __TYPES__ */
/* MacTCP return Codes in the range -23000 through -23049 */
#define inProgress 1 /* I/O in progress */
--- 7,13 ----
*/
! #define _H_MacTCPCommonTypes
/* MacTCP return Codes in the range -23000 through -23049 */
#define inProgress 1 /* I/O in progress */
TCPPB.h
*** before/TCPPB.h Mon Oct 22 13:43:11 1990
--- after/TCPPB.h Mon Oct 22 13:43:55 1990
***************
*** 7,13 ****
--- 7,15 ----
*/
+ #define _H_TCPPB
+
/* Command codes */
#define TCPCreate 30
***************
*** 46,51 ****
--- 48,54 ----
lastReason = 65535
};
+ #ifdef MPW
typedef pascal void (*TCPNotifyProc) (
StreamPtr tcpStream,
unsigned short eventCode,
***************
*** 52,57 ****
--- 55,68 ----
Ptr userDataPtr,
unsigned short terminReason,
struct ICMPReport *icmpMsg);
+ #else
+ typedef void (*TCPNotifyProc) (
+ StreamPtr tcpStream,
+ unsigned short eventCode,
+ Ptr userDataPtr,
+ unsigned short terminReason,
+ struct ICMPReport *icmpMsg);
+ #endif
typedef void (*TCPIOCompletionProc) (struct TCPiopb *iopb);
dnr.c
*** before/dnr.c Mon Oct 22 13:43:11 1990
--- after/dnr.c Mon Oct 22 13:43:55 1990
***************
*** 4,29 ****
*/
! /* #define MPW3.0 */
! #include <OSUtils.h>
! #include <Errors.h>
! #include <Files.h>
! #include <Resources.h>
! #ifdef MPW3.0
! #include <Memory.h>
! #endif
- #define OPENRESOLVER 1
- #define CLOSERESOLVER 2
- #define STRTOADDR 3
- #define ADDRTOSTR 4
- #define ENUMCACHE 5
- #define ADDRTONAME 6
Handle codeHndl = nil;
- typedef OSErr (*OSErrProcPtr)();
OSErrProcPtr dnr = nil;
--- 4,26 ----
*/
! #include <MacTCPCommonTypes.h>
! #include <GetMyIPAddr.h>
! #include <AddressXlation.h>
! #define nil 0L
! #define NULL 0L
+ #define OPENRESOLVER 1L
+ #define CLOSERESOLVER 2L
+ #define STRTOADDR 3L
+ #define ADDRTOSTR 4L
+ #define ENUMCACHE 5L
+ #define ADDRTONAME 6L
+
Handle codeHndl = nil;
OSErrProcPtr dnr = nil;
***************
*** 34,44 ****
SysEnvRec info;
HParamBlockRec fi;
Str255 filename;
SysEnvirons(1, &info);
fi.fileParam.ioCompletion = nil;
! fi.fileParam.ioNamePtr = &filename;
fi.fileParam.ioVRefNum = info.sysVRefNum;
fi.fileParam.ioDirID = 0;
fi.fileParam.ioFDirIndex = 1;
--- 31,44 ----
SysEnvRec info;
HParamBlockRec fi;
Str255 filename;
+ short curVRefNum;
+ WDPBRec pb;
+ int status;
SysEnvirons(1, &info);
fi.fileParam.ioCompletion = nil;
! fi.fileParam.ioNamePtr = filename;
fi.fileParam.ioVRefNum = info.sysVRefNum;
fi.fileParam.ioDirID = 0;
fi.fileParam.ioFDirIndex = 1;
***************
*** 48,58 ****
if (fi.fileParam.ioFlFndrInfo.fdType == 'cdev' &&
fi.fileParam.ioFlFndrInfo.fdCreator == 'mtcp') {
/* found the MacTCP driver file */
! #ifdef MPW3.0
! return(OpenResFile(&filename));
#else
! return(OPENRESFILE(&filename));
#endif
}
/* check next file in system folder */
fi.fileParam.ioFDirIndex++;
--- 48,72 ----
if (fi.fileParam.ioFlFndrInfo.fdType == 'cdev' &&
fi.fileParam.ioFlFndrInfo.fdCreator == 'mtcp') {
/* found the MacTCP driver file */
!
! /* save current volume (or working directory) */
! pb.ioNamePtr = 0L;
! if (PBHGetVol(&pb,false) != noErr)
! return(-1);
! curVRefNum = pb.ioVRefNum;
!
! /* move to system folder */
! if (SetVol(NULL,info.sysVRefNum) != noErr)
! return(-1);
! #ifndef OLD_MPW3
! status = OpenResFile(&filename);
#else
! status = OPENRESFILE(&filename);
#endif
+ /* back to orignal volume */
+ SetVol(NULL,curVRefNum);
+
+ return(status);
}
/* check next file in system folder */
fi.fileParam.ioFDirIndex++;
***************
*** 126,132 ****
OSErr StrToAddr(hostName, rtnStruct, resultproc, userDataPtr)
char *hostName;
struct hostInfo *rtnStruct;
! long resultproc;
char *userDataPtr;
{
if (dnr == nil)
--- 140,146 ----
OSErr StrToAddr(hostName, rtnStruct, resultproc, userDataPtr)
char *hostName;
struct hostInfo *rtnStruct;
! ResultProcPtr resultproc;
char *userDataPtr;
{
if (dnr == nil)
***************
*** 149,155 ****
}
OSErr EnumCache(resultproc, userDataPtr)
! long resultproc;
char *userDataPtr;
{
if (dnr == nil)
--- 163,169 ----
}
OSErr EnumCache(resultproc, userDataPtr)
! ResultProcPtr resultproc;
char *userDataPtr;
{
if (dnr == nil)
***************
*** 163,169 ****
OSErr AddrToName(addr, rtnStruct, resultproc, userDataPtr)
unsigned long addr;
struct hostInfo *rtnStruct;
! long resultproc;
char *userDataPtr;
{
if (dnr == nil)
--- 177,183 ----
OSErr AddrToName(addr, rtnStruct, resultproc, userDataPtr)
unsigned long addr;
struct hostInfo *rtnStruct;
! ResultProcPtr resultproc;
char *userDataPtr;
{
if (dnr == nil)