Leaked source code of windows server 2003
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.

142 lines
5.3 KiB

  1. /* Zmodem.h -- exported constants, variables and functions for zmodem
  2. *
  3. * Copyright 1990 by Hilgraeve Inc. -- Monroe, MI
  4. * All rights reserved
  5. *
  6. * $Revision: 2 $
  7. * $Date: 8/27/01 9:14a $
  8. */
  9. /*
  10. * Z M O D E M . H Manifest constants for ZMODEM
  11. * application to application file transfer protocol
  12. * 05-23-87 Chuck Forsberg Omen Technology Inc
  13. */
  14. #define ZPAD '*' /* 052 Padding character begins frames */
  15. #define ZDLE 030 /* Ctrl-X Zmodem escape - `ala BISYNC DLE */
  16. #define ZDLEE (ZDLE^0100) /* Escaped ZDLE as transmitted */
  17. #define ZBIN 'A' /* Binary frame indicator */
  18. #define ZHEX 'B' /* HEX frame indicator */
  19. #define ZBIN32 'C' /* Binary frame with 32 bit FCS */
  20. /* Frame types (see array "frametypes" in zm.c) */
  21. #define ZRQINIT 0 /* Request receive init */
  22. #define ZRINIT 1 /* Receive init */
  23. #define ZSINIT 2 /* Send init sequence (optional) */
  24. #define ZACK 3 /* ACK to above */
  25. #define ZFILE 4 /* File name from sender */
  26. #define ZSKIP 5 /* To sender: skip this file */
  27. #define ZNAK 6 /* Last packet was garbled */
  28. #define ZABORT 7 /* Abort batch transfers */
  29. #define ZFIN 8 /* Finish session */
  30. #define ZRPOS 9 /* Resume data trans at this position */
  31. #define ZDATA 10 /* Data packet(s) follow */
  32. #define ZEOF 11 /* End of file */
  33. #define ZFERR 12 /* Fatal Read or Write error Detected */
  34. #define ZCRC 13 /* Request for file CRC and response */
  35. #define ZCHALLENGE 14 /* Receiver's Challenge */
  36. #define ZCOMPL 15 /* Request is complete */
  37. #define ZCAN 16 /* Other end canned session with CAN*5 */
  38. #define ZFREECNT 17 /* Request for free bytes on filesystem */
  39. #define ZCOMMAND 18 /* Command from sending program */
  40. #define ZSTDERR 19 /* Output to standard error, data follows */
  41. #define ZBADFMT 20 /* Data packed format error */
  42. #define ZMDM_ACKED 21
  43. #define ZMDM_VIRUS 22
  44. #define ZMDM_REFUSE 23 /* File was unconditinally refused */
  45. #define ZMDM_OLDER 24 /* File refused because it was older */
  46. #define ZMDM_INUSE 25 /* File is currently in use */
  47. #define ZMDM_CARRIER_LOST 26 /* Lost carrier */
  48. /* ZDLE sequences */
  49. #define ZCRCE 'h' /* CRC next, frame ends, header packet follows */
  50. #define ZCRCG 'i' /* CRC next, frame continues nonstop */
  51. #define ZCRCQ 'j' /* CRC next, frame continues, ZACK expected */
  52. #define ZCRCW 'k' /* CRC next, ZACK expected, end of frame */
  53. #define ZRUB0 'l' /* Translate to rubout 0177 */
  54. #define ZRUB1 'm' /* Translate to rubout 0377 */
  55. /* zdlread return values (internal) */
  56. /* -1 is general error, -2 is timeout */
  57. #define GOTOR 0400
  58. #define GOTCRCE (ZCRCE|GOTOR) /* ZDLE-ZCRCE received */
  59. #define GOTCRCG (ZCRCG|GOTOR) /* ZDLE-ZCRCG received */
  60. #define GOTCRCQ (ZCRCQ|GOTOR) /* ZDLE-ZCRCQ received */
  61. #define GOTCRCW (ZCRCW|GOTOR) /* ZDLE-ZCRCW received */
  62. #define GOTCAN (GOTOR|030) /* CAN*5 seen */
  63. /* Byte positions within header array */
  64. #define ZF0 3 /* First flags byte */
  65. #define ZF1 2
  66. #define ZF2 1
  67. #define ZF3 0
  68. #define ZP0 0 /* Low order 8 bits of position */
  69. #define ZP1 1
  70. #define ZP2 2
  71. #define ZP3 3 /* High order 8 bits of file position */
  72. /* Bit Masks for ZRINIT flags byte ZF0 */
  73. #define CANFDX 01 /* Rx can send and receive true FDX */
  74. #define CANOVIO 02 /* Rx can receive data during disk I/O */
  75. #define CANBRK 04 /* Rx can send a break signal */
  76. #define CANCRY 010 /* Receiver can decrypt */
  77. #define CANLZW 020 /* Receiver can uncompress */
  78. #define CANFC32 040 /* Receiver can use 32 bit Frame Check */
  79. #define ESCCTL 0100 /* Receiver expects ctl chars to be escaped */
  80. #define ESC8 0200 /* Receiver expects 8th bit to be escaped */
  81. /* Bit Masks for ZSINIT flags byte ZF0 */
  82. #define TESCCTL 0100 /* Transmitter expects ctl chars to be escaped */
  83. #define TESC8 0200 /* Transmitter expects 8th bit to be escaped */
  84. /* Parameters for ZFILE frame */
  85. /* Conversion options one of these in ZF0 */
  86. #define ZCBIN 1 /* Binary transfer - inhibit conversion */
  87. #define ZCNL 2 /* Convert NL to local end of line convention */
  88. #define ZCRESUM 3 /* Resume interrupted file transfer */
  89. #define ZCRECOV 3 /* Some of the documentation uses this name */
  90. /* Management include options, one of these ored in ZF1 */
  91. #define ZMSKNOLOC 0200 /* Skip file if not present at rx */
  92. /* Management options, one of these ored in ZF1 */
  93. #define ZMMASK 037 /* Mask for the choices below */
  94. #define ZMNEWL 1 /* Transfer if source newer or longer */
  95. #define ZMCRC 2 /* Transfer if different file CRC or length */
  96. #define ZMAPND 3 /* Append contents to existing file (if any) */
  97. #define ZMCLOB 4 /* Replace existing file */
  98. #define ZMNEW 5 /* Transfer if source newer */
  99. /* Number 5 is alive ... */
  100. #define ZMDIFF 6 /* Transfer if dates or lengths different */
  101. #define ZMPROT 7 /* Protect destination file */
  102. /* Transport options, one of these in ZF2 */
  103. #define ZTLZW 1 /* Lempel-Ziv compression */
  104. #define ZTCRYPT 2 /* Encryption */
  105. #define ZTRLE 3 /* Run Length encoding */
  106. /* Extended options for ZF3, bit encoded */
  107. #define ZXSPARS 64 /* Encoding for sparse file operations */
  108. /* Parameters for ZCOMMAND frame ZF0 (otherwise 0) */
  109. #define ZCACK1 1 /* Acknowledge, then do command */
  110. #define DEFBYTL 2000000000L
  111. /* Function prototypes */
  112. USHORT zmdm_snd(HSESSION h, int method, int attended, unsigned nfiles, long nbytes);
  113. USHORT zmdm_rcv(HSESSION h, int method, int attended, int single_file);
  114. /* End of ZMODEM.H */