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.

188 lines
5.1 KiB

  1. /* File: D:\WACKER\xfer\xfer.hh (Created: 16-Dec-1993)
  2. *
  3. * Copyright 1994 by Hilgraeve Inc. -- Monroe, MI
  4. * All rights reserved
  5. *
  6. * $Revision: 2 $
  7. * $Date: 7/12/02 8:12a $
  8. */
  9. #define FULL_HUNKS(n, s) ((n) / (s))
  10. #define PART_HUNKS(n, s) ((long)(n) == 0L ? 0L : ((long)(n) - 1L) / (long)(s) + 1L)
  11. /* XMODEM and YMODEM specific functions and data structures */
  12. struct stXandYmodemParams
  13. { /* nSize MUST BE THE FIRST ITEM */
  14. int nSize; /* the size of this data block */
  15. #define XP_ECP_AUTOMATIC 1
  16. #define XP_ECP_CRC 2
  17. #define XP_ECP_CHECKSUM 3
  18. int nErrCheckType; /* XMODEM - what type of error check */
  19. int nPacketWait; /* 1 to 60 seconds */
  20. int nByteWait; /* 1 to 60 seconds */
  21. int nNumRetries; /* 1 - 25 retries */
  22. };
  23. typedef struct stXandYmodemParams XFR_XY_PARAMS;
  24. extern int xfrInitializeXandYmodem(const HSESSION hSession,
  25. VOID **ppData);
  26. extern BOOL CALLBACK XandYmodemParamsDlg(HWND hDlg,
  27. UINT wMsg,
  28. WPARAM wPar,
  29. LPARAM lPar);
  30. extern int xfrModifyXmodem(const HSESSION hSession,
  31. const HWND hwnd,
  32. VOID *pData);
  33. extern int xfrModifyYmodem(const HSESSION hSession,
  34. const HWND hwnd,
  35. VOID *pData);
  36. /* ZMODEM specific functions and data structures */
  37. struct stZmodemParams
  38. { /* nSize MUST BE THE FIRST ITEM */
  39. int nSize; /* the size of this data block */
  40. int nAutostartOK; /* TRUE if we allow autostarts */
  41. int nFileExists; /* defines follow */
  42. #define ZP_FE_SENDER 1 /* Follow sender A/O options */
  43. #define ZP_FE_DLG 2 /* Follow dialog box options */
  44. int nCrashRecRecv; /* defines follow */
  45. #define ZP_CRR_NEG 1 /* Negotiate */
  46. #define ZP_CRR_NEVER 2 /* Never recover */
  47. #define ZP_CRR_ALWAYS 3 /* Always recover */
  48. int nOverwriteOpt; /* defines follow */
  49. #define ZP_OO_NONE 1 /* None */
  50. #define ZP_OO_N_L 2 /* Newer or longer */
  51. #define ZP_OO_CRC 3 /* CRC differs */
  52. #define ZP_OO_APPEND 4 /* Append to file */
  53. #define ZP_OO_ALWAYS 5 /* Overwrite always */
  54. #define ZP_OO_NEWER 6 /* Newer */
  55. #define ZP_OO_L_D 7 /* Length or date differ */
  56. #define ZP_OO_NEVER 8 /* Never overwrite */
  57. int nCrashRecSend; /* defines follow */
  58. #define ZP_CRS_NEG 1 /* Negotiate */
  59. #define ZP_CRS_ONCE 2 /* One time */
  60. #define ZP_CRS_ALWAYS 3 /* Always */
  61. int nXferMthd; /* defines follow */
  62. #define ZP_XM_STREAM 1 /* Streaming mode */
  63. #define ZP_XM_WINDOW 2 /* Windowed mode */
  64. int nWinSize; /* Window size 1K to 32K */
  65. /* TODO: check and document the format */
  66. #if defined(UPPER_FEATURES)
  67. int nBlkSize; /* Block size 32 - 1024 bytes */
  68. /* TODO: check and document the format */
  69. #endif // defined(UPPER_FEATURES)
  70. int nCrcType; /* defines follow */
  71. #define ZP_CRC_16 1
  72. #define ZP_CRC_32 2
  73. int nRetryWait; /* integer between 5 and 100 seconds */
  74. int nEolConvert; /* EOL conversion TRUE or FALSE */
  75. int nEscCtrlCodes; /* escape control codes, T or F */
  76. };
  77. typedef struct stZmodemParams XFR_Z_PARAMS;
  78. extern int xfrInitializeZmodem(const HSESSION hSession,
  79. int nProtocol,
  80. VOID **ppData);
  81. extern BOOL CALLBACK ZmodemParamsDlg(HWND hDlg,
  82. UINT wMsg,
  83. WPARAM wPar,
  84. LPARAM lPar);
  85. extern int xfrModifyZmodem(const HSESSION hSession,
  86. const HWND hwnd,
  87. VOID *pData);
  88. /* HyperProtocol specific functions and data structures */
  89. struct stHyperProtocolParams
  90. { /* nSize MUST BE THE FIRST ITEM */
  91. int nSize; /* the size of this data block */
  92. #define HP_CT_CHECKSUM 1
  93. #define HP_CT_CRC 2
  94. int nCheckType; /* the check type */
  95. int nBlockSize; /* 128 - 16384 bytes */
  96. int nResyncTimeout; /* 3-60 seconds */
  97. };
  98. typedef struct stHyperProtocolParams XFR_HP_PARAMS;
  99. extern int xfrInitializeHyperProtocol(const HSESSION hSession,
  100. VOID **ppData);
  101. extern BOOL CALLBACK HyperProtocolParamsDlg(HWND hDlg,
  102. UINT wMsg,
  103. WPARAM wPar,
  104. LPARAM lPar);
  105. extern int xfrModifyHyperProtocol(const HSESSION hSession,
  106. const HWND hwnd,
  107. VOID *pData);
  108. /* Kermit specific functions and data structures */
  109. struct stKermitParams
  110. { /* nSize MUST BE THE FIRST ITEM */
  111. int nSize; /* the size of this data block */
  112. int nBytesPerPacket; /* you can guess */
  113. int nSecondsWaitPacket;
  114. int nErrorCheckSize;
  115. int nRetryCount;
  116. int nPacketStartChar;
  117. int nPacketEndChar;
  118. int nNumberPadChars;
  119. int nPadChar;
  120. };
  121. typedef struct stKermitParams XFR_KR_PARAMS;
  122. extern int xfrInitializeKermit(const HSESSION hSession,
  123. VOID **ppData);
  124. extern BOOL CALLBACK KermitParamsDlg(HWND hDlg,
  125. UINT wMsg,
  126. WPARAM wPar,
  127. LPARAM lPar);
  128. extern int xfrModifyKermit(const HSESSION hSession,
  129. const HWND hwnd,
  130. VOID *pData);
  131. /* Generic functions */
  132. extern int xfrInitializeParams(const HSESSION hSession,
  133. const int nProtocol,
  134. VOID **ppData);
  135. extern int xfrModifyParams(const HSESSION hSession,
  136. const int nProtocol,
  137. const HWND hwnd,
  138. VOID *pData);