home *** CD-ROM | disk | FTP | other *** search
/ Garbo / Garbo.cdr / mac / source / netnwscd.sit / tcp.diffs < prev    next >
Text File  |  1990-10-22  |  7KB  |  303 lines

  1. AddressXlation.h
  2. *** before/AddressXlation.h    Mon Oct 22 13:43:10 1990
  3. --- after/AddressXlation.h    Mon Oct 22 13:43:55 1990
  4. ***************
  5. *** 5,16 ****
  6.       Copyright Apple Computer, Inc. 1988 
  7.       All rights reserved
  8.       
  9. ! */    
  10.   
  11.   #define NUM_ALT_ADDRS    4
  12.   
  13.   typedef struct hostInfo {
  14. !     int    rtnCode;
  15.       char cname[255];
  16.       unsigned long addr[NUM_ALT_ADDRS];
  17.   };
  18. --- 5,19 ----
  19.       Copyright Apple Computer, Inc. 1988 
  20.       All rights reserved
  21.       
  22. ! */
  23.   
  24. + #define _H_AddressXlation
  25.   #define NUM_ALT_ADDRS    4
  26.   
  27.   typedef struct hostInfo {
  28. !     long    rtnCode;
  29.       char cname[255];
  30.       unsigned long addr[NUM_ALT_ADDRS];
  31.   };
  32. ***************
  33. *** 33,41 ****
  34. --- 36,50 ----
  35.       } rdata;
  36.   };
  37.   
  38. + #ifdef notdef
  39.   typedef pascal void (*EnumResultProcPtr)(struct cacheEntryRecord *cacheEntryRecordPtr, char *userDataPtr);
  40.   
  41.   typedef pascal void (*ResultProcPtr)(struct hostInfo *hostInfoPtr, char *userDataPtr);
  42. + #else
  43. + typedef void (*EnumResultProcPtr)(struct cacheEntryRecord *cacheEntryRecordPtr, char *userDataPtr);
  44. + typedef void (*ResultProcPtr)(struct hostInfo *hostInfoPtr, char *userDataPtr);
  45. + #endif
  46.   
  47.   extern OSErr OpenResolver(char *fileName);
  48.   
  49. GetMyIPAddr.h
  50. *** before/GetMyIPAddr.h    Mon Oct 22 13:43:10 1990
  51. --- after/GetMyIPAddr.h    Mon Oct 22 13:43:55 1990
  52. ***************
  53. *** 7,12 ****
  54. --- 7,14 ----
  55.       
  56.   */
  57.   
  58. + #define _H_GetMyIPAddr
  59.   #define ipctlGetAddr        15            /* csCode to get our IP address */
  60.   
  61.   #define ParamBlockHeader     \
  62. MacTCPCommonTypes.h
  63. *** before/MacTCPCommonTypes.h    Mon Oct 22 13:43:11 1990
  64. --- after/MacTCPCommonTypes.h    Mon Oct 22 13:43:55 1990
  65. ***************
  66. *** 7,15 ****
  67.       
  68.   */
  69.   
  70. ! #ifndef __TYPES__
  71. ! #include <Types.h>
  72. ! #endif /* __TYPES__ */
  73.   
  74.   /* MacTCP return Codes in the range -23000 through -23049 */
  75.   #define inProgress                1                /* I/O in progress */
  76. --- 7,13 ----
  77.       
  78.   */
  79.   
  80. ! #define _H_MacTCPCommonTypes
  81.   
  82.   /* MacTCP return Codes in the range -23000 through -23049 */
  83.   #define inProgress                1                /* I/O in progress */
  84. TCPPB.h
  85. *** before/TCPPB.h    Mon Oct 22 13:43:11 1990
  86. --- after/TCPPB.h    Mon Oct 22 13:43:55 1990
  87. ***************
  88. *** 7,13 ****
  89. --- 7,15 ----
  90.       
  91.   */
  92.   
  93. + #define _H_TCPPB
  94.   
  95.   /* Command codes */
  96.   
  97.   #define TCPCreate            30
  98. ***************
  99. *** 46,51 ****
  100. --- 48,54 ----
  101.       lastReason = 65535
  102.   }; 
  103.   
  104. + #ifdef MPW
  105.   typedef pascal void (*TCPNotifyProc) (
  106.           StreamPtr tcpStream,
  107.           unsigned short eventCode,
  108. ***************
  109. *** 52,57 ****
  110. --- 55,68 ----
  111.           Ptr userDataPtr,
  112.           unsigned short terminReason,
  113.           struct ICMPReport *icmpMsg);
  114. + #else
  115. + typedef void (*TCPNotifyProc) (
  116. +         StreamPtr tcpStream,
  117. +         unsigned short eventCode,
  118. +         Ptr userDataPtr,
  119. +         unsigned short terminReason,
  120. +         struct ICMPReport *icmpMsg);
  121. + #endif
  122.   
  123.   typedef void (*TCPIOCompletionProc) (struct TCPiopb *iopb);
  124.   
  125. dnr.c
  126. *** before/dnr.c    Mon Oct 22 13:43:11 1990
  127. --- after/dnr.c    Mon Oct 22 13:43:55 1990
  128. ***************
  129. *** 4,29 ****
  130.       
  131.   */
  132.   
  133. ! /* #define MPW3.0 */
  134.   
  135. ! #include <OSUtils.h>
  136. ! #include <Errors.h>
  137. ! #include <Files.h>
  138. ! #include <Resources.h>
  139. ! #ifdef MPW3.0
  140. ! #include <Memory.h>
  141. ! #endif
  142.   
  143. - #define OPENRESOLVER    1
  144. - #define CLOSERESOLVER    2
  145. - #define STRTOADDR        3
  146. - #define    ADDRTOSTR        4
  147. - #define    ENUMCACHE        5
  148. - #define ADDRTONAME        6
  149.   
  150.   Handle codeHndl = nil;
  151.   
  152. - typedef OSErr (*OSErrProcPtr)();
  153.   OSErrProcPtr dnr = nil;
  154.   
  155.   
  156. --- 4,26 ----
  157.       
  158.   */
  159.   
  160. ! #include <MacTCPCommonTypes.h>
  161. ! #include <GetMyIPAddr.h>
  162. ! #include <AddressXlation.h>
  163.   
  164. ! #define    nil    0L
  165. ! #define    NULL    0L
  166.   
  167.   
  168. + #define OPENRESOLVER    1L
  169. + #define CLOSERESOLVER    2L
  170. + #define STRTOADDR        3L
  171. + #define    ADDRTOSTR        4L
  172. + #define    ENUMCACHE        5L
  173. + #define ADDRTONAME        6L
  174.   Handle codeHndl = nil;
  175.   
  176.   OSErrProcPtr dnr = nil;
  177.   
  178.   
  179. ***************
  180. *** 34,44 ****
  181.       SysEnvRec info;
  182.       HParamBlockRec fi;
  183.       Str255 filename;
  184.   
  185.       SysEnvirons(1, &info);
  186.   
  187.       fi.fileParam.ioCompletion = nil;
  188. !     fi.fileParam.ioNamePtr = &filename;
  189.       fi.fileParam.ioVRefNum = info.sysVRefNum;
  190.       fi.fileParam.ioDirID = 0;
  191.       fi.fileParam.ioFDirIndex = 1;
  192. --- 31,44 ----
  193.       SysEnvRec info;
  194.       HParamBlockRec fi;
  195.       Str255 filename;
  196. +     short curVRefNum;
  197. +     WDPBRec pb;
  198. +     int status;
  199.   
  200.       SysEnvirons(1, &info);
  201.   
  202.       fi.fileParam.ioCompletion = nil;
  203. !     fi.fileParam.ioNamePtr = filename;
  204.       fi.fileParam.ioVRefNum = info.sysVRefNum;
  205.       fi.fileParam.ioDirID = 0;
  206.       fi.fileParam.ioFDirIndex = 1;
  207. ***************
  208. *** 48,58 ****
  209.           if (fi.fileParam.ioFlFndrInfo.fdType == 'cdev' &&
  210.               fi.fileParam.ioFlFndrInfo.fdCreator == 'mtcp') {
  211.               /* found the MacTCP driver file */
  212. ! #ifdef MPW3.0
  213. !             return(OpenResFile(&filename));
  214.   #else
  215. !             return(OPENRESFILE(&filename));
  216.   #endif
  217.               }
  218.           /* check next file in system folder */
  219.           fi.fileParam.ioFDirIndex++;
  220. --- 48,72 ----
  221.           if (fi.fileParam.ioFlFndrInfo.fdType == 'cdev' &&
  222.               fi.fileParam.ioFlFndrInfo.fdCreator == 'mtcp') {
  223.               /* found the MacTCP driver file */
  224. !     
  225. !             /* save current volume (or working directory) */
  226. !             pb.ioNamePtr = 0L;
  227. !             if (PBHGetVol(&pb,false) != noErr)
  228. !                 return(-1);
  229. !             curVRefNum = pb.ioVRefNum;
  230. !                 
  231. !             /* move to system folder */
  232. !             if (SetVol(NULL,info.sysVRefNum) != noErr)
  233. !                 return(-1);
  234. ! #ifndef OLD_MPW3
  235. !             status = OpenResFile(&filename);
  236.   #else
  237. !             status = OPENRESFILE(&filename);
  238.   #endif
  239. +             /* back to orignal volume */
  240. +             SetVol(NULL,curVRefNum);
  241. +             
  242. +             return(status);
  243.               }
  244.           /* check next file in system folder */
  245.           fi.fileParam.ioFDirIndex++;
  246. ***************
  247. *** 126,132 ****
  248.   OSErr StrToAddr(hostName, rtnStruct, resultproc, userDataPtr)
  249.   char *hostName;
  250.   struct hostInfo *rtnStruct;
  251. ! long resultproc;
  252.   char *userDataPtr;
  253.   {
  254.       if (dnr == nil)
  255. --- 140,146 ----
  256.   OSErr StrToAddr(hostName, rtnStruct, resultproc, userDataPtr)
  257.   char *hostName;
  258.   struct hostInfo *rtnStruct;
  259. ! ResultProcPtr resultproc;
  260.   char *userDataPtr;
  261.   {
  262.       if (dnr == nil)
  263. ***************
  264. *** 149,155 ****
  265.       }
  266.       
  267.   OSErr EnumCache(resultproc, userDataPtr)
  268. ! long resultproc;
  269.   char *userDataPtr;
  270.   {
  271.       if (dnr == nil)
  272. --- 163,169 ----
  273.       }
  274.       
  275.   OSErr EnumCache(resultproc, userDataPtr)
  276. ! ResultProcPtr resultproc;
  277.   char *userDataPtr;
  278.   {
  279.       if (dnr == nil)
  280. ***************
  281. *** 163,169 ****
  282.   OSErr AddrToName(addr, rtnStruct, resultproc, userDataPtr)
  283.   unsigned long addr;
  284.   struct hostInfo *rtnStruct;
  285. ! long resultproc;
  286.   char *userDataPtr;                                    
  287.   {
  288.       if (dnr == nil)
  289. --- 177,183 ----
  290.   OSErr AddrToName(addr, rtnStruct, resultproc, userDataPtr)
  291.   unsigned long addr;
  292.   struct hostInfo *rtnStruct;
  293. ! ResultProcPtr resultproc;
  294.   char *userDataPtr;                                    
  295.   {
  296.       if (dnr == nil)
  297.