Source code of Windows XP (NT5)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

191 lines
8.1 KiB

  1. /*===========================================================================*/
  2. /* Copyright (c) 1987 - 1988, Future Soft Engineering, Inc. */
  3. /* Houston, Texas */
  4. /*===========================================================================*/
  5. BOOL bKermitTaskRemote; /* slc nova 110 */
  6. INT gKermitTaskCMD; /* slc nova 110 */
  7. LPSTR glpKermitTaskParm1; /* slc nova 110 */
  8. LPSTR glpKermitTaskParm2; /* slc nova 110 */
  9. /* basic file transfer packet types */
  10. #define KER_ACK 'Y'
  11. #define KER_NACK 'N'
  12. #define KER_SEND 'S'
  13. #define KER_INIT 'I'
  14. #define KER_FILE 'F'
  15. #define KER_TEXT 'X'
  16. #define KER_ATTRIB 'A'
  17. #define KER_DATA 'D'
  18. #define KER_EOF 'Z'
  19. #define KER_BREAK 'B'
  20. #define KER_ERROR 'E'
  21. #define KER_RCV 'R'
  22. #define KER_COMMAND 'C'
  23. #define KER_KERMIT 'K'
  24. #define KER_TIMEOUT 'T'
  25. #define KER_ERRCHK 'Q'
  26. #define KER_CMPLT 'C'
  27. #define KER_ABORT 'A'
  28. #define KER_GENERIC 'G'
  29. /* generic packet types */
  30. #define KER_LOGIN 'I'
  31. #define KER_CHDIR 'C'
  32. #define KER_LOGOUT 'L'
  33. #define KER_FINISH 'F'
  34. #define KER_DIR 'D'
  35. #define KER_FREE 'U'
  36. #define KER_DEL 'E'
  37. #define KER_TYPE 'T'
  38. #define KER_REN 'R'
  39. #define KER_COPY 'K'
  40. #define KER_WHO 'W'
  41. #define KER_MESSAGE 'M'
  42. #define KER_HELP 'H'
  43. #define KER_STATUS 'Q'
  44. #define KER_PROGRAM 'P'
  45. #define KER_JOURNAL 'J'
  46. #define KER_VAR 'V'
  47. #define KER_NOPARITY '\0'
  48. #define KER_ODDPARITY 'o'
  49. #define KER_EVENPARITY 'e'
  50. #define KER_MARKPARITY 'm'
  51. #define KER_SPACEPARITY 's'
  52. /* initialization packet subscripts and values */
  53. #define KER_INIT_MAXL 0
  54. #define KER_INIT_TIME 1
  55. #define KER_INIT_NPAD 2
  56. #define KER_INIT_PADC 3
  57. #define KER_INIT_EOL 4
  58. #define KER_INIT_QCTL 5
  59. #define KER_INIT_QBIN 6
  60. #define KER_INIT_CHKT 7
  61. #define KER_INIT_REPT 8
  62. #define KER_MAXPACKSIZE 94 /* Maximum packet size */
  63. #define KER_RCVTIMEOUT 13 /* Seconds for receive time out */
  64. #define KER_SNDTIMEOUT 8 /* Seconds for send time out */
  65. #define KER_MAXTIMEOUT 60 /* Maximum timeout interval */
  66. #define KER_MINTIMEOUT 2 /* Minumum timeout interval */
  67. #define KER_NPAD 0 /* Number of padding characters I will need */
  68. #define KER_PADCHAR 0 /* Padding character I need (NULL) */
  69. #define KER_EOL 0x0D /* End-Of-Packet character */
  70. #define KER_QUOTE '#' /* Control prefix character */
  71. #define KER_8BITPREFIX '&' /* Eighth bit prefix character */
  72. #define KER_BLOCKCHK1 '1' /* Block check type (1 byte) */
  73. #define KER_BLOCKCHK2 '2' /* Block check type (2 byte) */
  74. #define KER_BLOCKCHK3 '3' /* Block check type (3 byte) */
  75. /* other kermit session constants */
  76. #define KER_MAXRETRY 5 /* Times to retry a packet */
  77. /* myh swat: set the buffer size for the number of bytes read in from file at a time */
  78. #define BUFFSIZE 512
  79. INT KER_bytetran; /* myh swat: number of bytes transfered from the buffer */
  80. INT KER_buffsiz; /* myh swat: the buffer size read from the file; usually is */
  81. /* BUFFSIZE, but the last buffer size can be smaller */
  82. BYTE KER_buffer[BUFFSIZE]; /* myh swat: the buffer storing read in chars from file */
  83. INT KER_debug;
  84. BYTE KER_rem8bit;
  85. typedef
  86. struct {
  87. INT KER_spsiz; /* Maximum send packet size */
  88. INT KER_timint; /* Timeout for foreign host on sends */
  89. INT KER_pad; /* How much padding to send */
  90. BYTE KER_padchar; /* Padding character to send */
  91. BYTE KER_eol; /* End-Of-Line character to send */
  92. BYTE KER_quote; /* Quote character in incoming data */
  93. BYTE KER_select8; /* 8th bit quote character to send either 'Y' or '&'*/
  94. } KERPACKETSTRUCT;
  95. typedef
  96. struct {
  97. INT KER_size; /* Size of present data */
  98. INT KER_rpsiz; /* Maximum receive packet size */
  99. INT KER_spsiz; /* Maximum send packet size */
  100. INT KER_pad; /* How much padding to send */
  101. INT KER_timint; /* Timeout for foreign host on sends */
  102. INT KER_n; /* Packet number */
  103. INT KER_numtry; /* Times this packet retried */
  104. INT KER_oldtry; /* Times previous packet retried */
  105. INT ttyfd; /* File descriptor of tty for I/O, 0 if remote */
  106. INT KER_remote; /* -1 means we're a remote kermit */
  107. INT KER_image; /* -1 means 8-bit mode */
  108. INT KER_parflg; /* TRUE means use parity specified */
  109. INT KER_turn; /* TRUE means look for turnaround char (XON) */
  110. INT KER_lecho; /* TRUE for locally echo chars in connect mode */
  111. INT KER_8flag; /* TRUE means 8th bit quoting is done */
  112. INT KER_pktdeb; /* TRUE means log all packet to a file */
  113. INT KER_filnamcnv; /* -1 means do file name case conversions */
  114. INT KER_filecount; /* Number of files left to send */
  115. INT KER_timeout; /* TRUE means a timeout has occurred. */
  116. BYTE KER_state; /* Present state of the automaton */
  117. BYTE KER_cchksum; /* Our (computed) checksum */
  118. BYTE KER_padchar; /* Padding character to send */
  119. BYTE KER_eol; /* End-Of-Line character to send */
  120. BYTE KER_escchr; /* Connect command escape character */
  121. BYTE KER_quote; /* Quote character in incoming data */
  122. BYTE KER_select8; /* 8th bit quote character to send either 'Y' or '&'*/
  123. BYTE KER_firstfile;
  124. BYTE KER_getflag;
  125. BYTE **KER_filelist; /* List of files to be sent */
  126. BYTE *KER_filnam; /* Current file name */
  127. BYTE recpkt[KER_MAXPACKSIZE]; /* Receive packet buffer */
  128. BYTE packet[KER_MAXPACKSIZE]; /* Packet buffer */
  129. BYTE KER_buff[KER_MAXPACKSIZE]; /* buffer for translations */
  130. BYTE outstr[80]; /*output string for debugging and translations */
  131. BYTE KERRCVFLAG; /* direct recieved buffers to screen, file or buffer*/
  132. LONG KER_bytes; /* number of bytes received */
  133. } KERMITSTRUCT;
  134. BOOL FAR KER_Receive(BOOL);
  135. BYTE NEAR KER_ReceiveInit();
  136. BYTE NEAR KER_ReceiveFile();
  137. BYTE NEAR KER_ReceiveData();
  138. BOOL FAR KER_Send();
  139. BYTE NEAR KER_SendInit();
  140. BYTE NEAR KER_SendFile();
  141. BYTE NEAR KER_SendData();
  142. BYTE NEAR KER_SendGeneric(BYTE lKER_state);
  143. VOID NEAR KER_Init(BYTE state);
  144. INT NEAR KER_GetParity();
  145. INT NEAR KER_GetTurnAroundTime();
  146. INT NEAR KER_GetLocalEcho();
  147. BYTE NEAR KER_Abort(WORD msgID);
  148. BYTE NEAR KER_DoParity (BYTE ch);
  149. VOID NEAR KER_SndPacket(BYTE type, INT num, INT len, BYTE *data);
  150. BYTE NEAR KER_RcvPacket(INT*, INT*, BYTE*);
  151. BYTE NEAR KER_CInChar();
  152. BYTE NEAR KER_InChar();
  153. INT NEAR KER_ModemWait();
  154. INT NEAR KER_BufferFill(BYTE*);
  155. VOID NEAR KER_BufferEmpty(BYTE buffer[],INT len,BYTE flag);
  156. BOOL NEAR KER_GetNextFile();
  157. BYTE NEAR KER_PrintErrPacket(BYTE*);
  158. VOID NEAR KER_RcvPacketInit(BYTE*);
  159. VOID NEAR KER_SndPacketInit(BYTE*);
  160. VOID FAR KER_Answer();
  161. VOID FAR KER_Server(BYTE, INT, INT);
  162. VOID NEAR KER_DoGenericPack(BYTE*, INT, INT);
  163. BOOL NEAR KER_DoDir(BYTE*);
  164. INT_PTR APIENTRY dbKerRemote(HWND, UINT, WPARAM, LPARAM);
  165. BOOL NEAR KER_RemoteParamsOK(HWND, INT);
  166. VOID NEAR KER_DoRemoteShow(HWND, INT);
  167. VOID NEAR KER_Remote(HWND, INT);
  168. BYTE NEAR KER_Tinit();
  169. INT NEAR KER_Encode(BYTE*, BYTE*, INT);
  170. VOID NEAR KER_Pack(HWND, BYTE, INT, INT);
  171. VOID NEAR KER_HandleTrans();
  172. VOID NEAR KER_PutScreenStr(BYTE*);
  173. VOID NEAR KER_bSetUp(BYTE state);
  174. BYTE NEAR KER_AutoPar(); /* tge gold 01 */
  175. VOID NEAR KER_ResetFromRemote(); /* tge gold 01 */