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.

306 lines
9.9 KiB

  1. /**********************************************************************/
  2. /** Microsoft Windows NT **/
  3. /** Copyright(c) Microsoft Corp., 1993 **/
  4. /**********************************************************************/
  5. /*
  6. ftpd.h
  7. This file contains constants & type definitions shared between the
  8. FTPD Service, Installer, and Administration UI.
  9. FILE HISTORY:
  10. KeithMo 10-Mar-1993 Created.
  11. MuraliK 23-Oct-1995 Imported for new ftp server
  12. MuraliK 14-Dec-1995 service name imported from inetinfo.h
  13. */
  14. #ifndef _FTPD_H_
  15. #define _FTPD_H_
  16. #ifdef __cplusplus
  17. extern "C"
  18. {
  19. #endif // _cplusplus
  20. # include <inetinfo.h>
  21. //
  22. // Name of directory annotation file. If this file exists
  23. // in the target directory of a CWD command, its contents
  24. // will be sent to the user as part of the CWD reply.
  25. //
  26. #define FTPD_ANNOTATION_FILE_A "~FTPSVC~.CKM"
  27. #define FTPD_ANNOTATION_FILE_W L"~FTPSVC~.CKM"
  28. //
  29. // Configuration parameters registry key.
  30. //
  31. # define FTPD_SERVICE_KEY_A \
  32. "System\\CurrentControlSet\\Services\\" ## FTPD_SERVICE_NAME_A
  33. # define FTPD_SERVICE_KEY_W \
  34. L"System\\CurrentControlSet\\Services\\" ## FTPD_SERVICE_NAME_W
  35. #define FTPD_PARAMETERS_KEY_A FTPD_SERVICE_KEY_A ## "\\Parameters"
  36. #define FTPD_PARAMETERS_KEY_W FTPD_SERVICE_KEY_W ## L"\\Parameters"
  37. //
  38. // Performance key.
  39. //
  40. #define FTPD_PERFORMANCE_KEY_A FTPD_SERVICE_KEY_A ## "\\Performance"
  41. #define FTPD_PERFORMANCE_KEY_W FTPD_SERVICE_KEY_W ## L"\\Performance"
  42. //
  43. // If this registry key exists under the Parameters key,
  44. // it is used to validate FTPSVC access. Basically, all new users
  45. // must have sufficient privilege to open this key before they
  46. // may access the FTP Server.
  47. //
  48. #define FTPD_ACCESS_KEY_A "AccessCheck"
  49. #define FTPD_ACCESS_KEY_W L"AccessCheck"
  50. //
  51. // Configuration value names.
  52. //
  53. #define FTPD_ALLOW_ANONYMOUS_A "AllowAnonymous"
  54. #define FTPD_ALLOW_ANONYMOUS_W L"AllowAnonymous"
  55. #define FTPD_ALLOW_GUEST_ACCESS_A "AllowGuestAccess"
  56. #define FTPD_ALLOW_GUEST_ACCESS_W L"AllowGuestAccess"
  57. #define FTPD_ANONYMOUS_ONLY_A "AnonymousOnly"
  58. #define FTPD_ANONYMOUS_ONLY_W L"AnonymousOnly"
  59. #define FTPD_MSDOS_DIR_OUTPUT_A "MsdosDirOutput"
  60. #define FTPD_MSDOS_DIR_OUTPUT_W L"MsdosDirOutput"
  61. #define FTPD_SHOW_4_DIGIT_YEAR_A "Show4DigitYear"
  62. #define FTPD_SHOW_4_DIGIT_YEAR_W L"Show4DigitYear"
  63. #define FTPD_GREETING_MESSAGE_A "GreetingMessage"
  64. #define FTPD_GREETING_MESSAGE_W L"GreetingMessage"
  65. #define FTPD_EXIT_MESSAGE_A "ExitMessage"
  66. #define FTPD_EXIT_MESSAGE_W L"ExitMessage"
  67. #define FTPD_MAX_CLIENTS_MSG_A "MaxClientsMessage"
  68. #define FTPD_MAX_CLIENTS_MSG_W L"MaxClientsMessage"
  69. #define FTPD_DEBUG_FLAGS_A "DebugFlags"
  70. #define FTPD_DEBUG_FLAGS_W L"DebugFlags"
  71. #define FTPD_ANNOTATE_DIRS_A "AnnotateDirectories"
  72. #define FTPD_ANNOTATE_DIRS_W L"AnnotateDirectories"
  73. #define FTPD_LOWERCASE_FILES_A "LowercaseFiles"
  74. #define FTPD_LOWERCASE_FILES_W L"LowercaseFiles"
  75. #define FTPD_LISTEN_BACKLOG_A "ListenBacklog"
  76. #define FTPD_LISTEN_BACKLOG_W L"ListenBacklog"
  77. #define FTPD_ENABLE_LICENSING_A "EnableLicensing"
  78. #define FTPD_ENABLE_LICENSING_W L"EnableLicensing"
  79. #define FTPD_DEFAULT_LOGON_DOMAIN_A "DefaultLogonDomain"
  80. #define FTPD_DEFAULT_LOGON_DOMAIN_W L"DefaultLogonDomain"
  81. #define FTPD_NO_EXTENDED_FILENAME_A "DisableExtendedCharFileNames"
  82. #define FTPD_NO_EXTENDED_FILENAME_W L"DisableExtendedCharFileNames"
  83. #define FTPD_ENABLE_PORT_ATTACK_A "EnablePortAttack"
  84. #define FTPD_ENABLE_PORT_ATTACK_W L"EnablePortAttack"
  85. #define FTPD_ENABLE_PASV_THEFT_A "EnablePasvTheft"
  86. #define FTPD_ENABLE_PASV_THEFT_W L"EnablePasvTheft"
  87. #define FTPD_BANNER_MESSAGE_A "BannerMessage"
  88. #define FTPD_BANNER_MESSAGE_W L"BannerMessage"
  89. #define FTPD_USER_ISOLATION_A "UserIsolationMode"
  90. #define FTPD_USER_ISOLATION_W L"UserIsolationMode"
  91. #define FTPD_LOG_IN_UTF_8_A "FtpLogInUtf8"
  92. #define FTPD_LOG_IN_UTF_8_W L"FtpLogInUtf8"
  93. //
  94. // Name of the LSA Secret Object containing the password for
  95. // anonymous logon and virtual UNC roots
  96. //
  97. #define FTPD_ANONYMOUS_SECRET_A "FTPD_ANONYMOUS_DATA"
  98. #define FTPD_ANONYMOUS_SECRET_W L"FTPD_ANONYMOUS_DATA"
  99. #define FTPD_ROOT_SECRET_A "FTPD_ROOT_DATA"
  100. #define FTPD_ROOT_SECRET_W L"FTPD_ROOT_DATA"
  101. //
  102. // Handle ANSI/UNICODE sensitivity.
  103. //
  104. #ifdef UNICODE
  105. #define FTPD_ANNOTATION_FILE FTPD_ANNOTATION_FILE_W
  106. #define FTPD_PARAMETERS_KEY FTPD_PARAMETERS_KEY_W
  107. #define FTPD_PERFORMANCE_KEY FTPD_PERFORMANCE_KEY_W
  108. #define FTPD_ACCESS_KEY FTPD_ACCESS_KEY_W
  109. #define FTPD_ALLOW_ANONYMOUS FTPD_ALLOW_ANONYMOUS_W
  110. #define FTPD_ALLOW_GUEST_ACCESS FTPD_ALLOW_GUEST_ACCESS_W
  111. #define FTPD_ANONYMOUS_ONLY FTPD_ANONYMOUS_ONLY_W
  112. #define FTPD_MSDOS_DIR_OUTPUT FTPD_MSDOS_DIR_OUTPUT_W
  113. #define FTPD_SHOW_4_DIGIT_YEAR FTPD_SHOW_4_DIGIT_YEAR_W
  114. #define FTPD_GREETING_MESSAGE FTPD_GREETING_MESSAGE_W
  115. #define FTPD_EXIT_MESSAGE FTPD_EXIT_MESSAGE_W
  116. #define FTPD_MAX_CLIENTS_MSG FTPD_MAX_CLIENTS_MSG_W
  117. #define FTPD_DEBUG_FLAGS FTPD_DEBUG_FLAGS_W
  118. #define FTPD_ANNOTATE_DIRS FTPD_ANNOTATE_DIRS_W
  119. #define FTPD_ANONYMOUS_SECRET FTPD_ANONYMOUS_SECRET_W
  120. #define FTPD_LOWERCASE_FILES FTPD_LOWERCASE_FILES_W
  121. #define FTPD_LISTEN_BACKLOG FTPD_LISTEN_BACKLOG_W
  122. #define FTPD_ENABLE_LICENSING FTPD_ENABLE_LICENSING_W
  123. #define FTPD_DEFAULT_LOGON_DOMAIN FTPD_DEFAULT_LOGON_DOMAIN_W
  124. #define FTPD_NO_EXTENDED_FILENAME FTPD_NO_EXTENDED_FILENAME_W
  125. #define FTPD_ENABLE_PORT_ATTACK FTPD_ENABLE_PORT_ATTACK_W
  126. #define FTPD_ENABLE_PASV_THEFT FTPD_ENABLE_PASV_THEFT_W
  127. #define FTPD_BANNER_MESSAGE FTPD_BANNER_MESSAGE_W
  128. #define FTPD_USER_ISOLATION FTPD_USER_ISOLATION_W
  129. #define FTPD_LOG_IN_UTF_8 FTPD_LOG_IN_UTF_8_W
  130. #else // !UNICODE
  131. #define FTPD_ANNOTATION_FILE FTPD_ANNOTATION_FILE_A
  132. #define FTPD_PARAMETERS_KEY FTPD_PARAMETERS_KEY_A
  133. #define FTPD_PERFORMANCE_KEY FTPD_PERFORMANCE_KEY_A
  134. #define FTPD_ACCESS_KEY FTPD_ACCESS_KEY_A
  135. #define FTPD_ANONYMOUS_ONLY FTPD_ANONYMOUS_ONLY_A
  136. #define FTPD_ALLOW_ANONYMOUS FTPD_ALLOW_ANONYMOUS_A
  137. #define FTPD_ALLOW_GUEST_ACCESS FTPD_ALLOW_GUEST_ACCESS_A
  138. #define FTPD_MSDOS_DIR_OUTPUT FTPD_MSDOS_DIR_OUTPUT_A
  139. #define FTPD_SHOW_4_DIGIT_YEAR FTPD_SHOW_4_DIGIT_YEAR_A
  140. #define FTPD_GREETING_MESSAGE FTPD_GREETING_MESSAGE_A
  141. #define FTPD_EXIT_MESSAGE FTPD_EXIT_MESSAGE_A
  142. #define FTPD_MAX_CLIENTS_MSG FTPD_MAX_CLIENTS_MSG_A
  143. #define FTPD_DEBUG_FLAGS FTPD_DEBUG_FLAGS_A
  144. #define FTPD_ANNOTATE_DIRS FTPD_ANNOTATE_DIRS_A
  145. #define FTPD_ANONYMOUS_SECRET FTPD_ANONYMOUS_SECRET_A
  146. #define FTPD_LOWERCASE_FILES FTPD_LOWERCASE_FILES_A
  147. #define FTPD_LISTEN_BACKLOG FTPD_LISTEN_BACKLOG_A
  148. #define FTPD_ENABLE_LICENSING FTPD_ENABLE_LICENSING_A
  149. #define FTPD_DEFAULT_LOGON_DOMAIN FTPD_DEFAULT_LOGON_DOMAIN_A
  150. #define FTPD_NO_EXTENDED_FILENAME FTPD_NO_EXTENDED_FILENAME_A
  151. #define FTPD_ENABLE_PORT_ATTACK FTPD_ENABLE_PORT_ATTACK_A
  152. #define FTPD_ENABLE_PASV_THEFT FTPD_ENABLE_PASV_THEFT_A
  153. #define FTPD_BANNER_MESSAGE FTPD_BANNER_MESSAGE_A
  154. #define FTPD_USER_ISOLATION FTPD_USER_ISOLATION_A
  155. #define FTPD_LOG_IN_UTF_8 FTPD_LOG_IN_UTF_8_A
  156. #endif // UNICODE
  157. //
  158. // Structures for APIs
  159. //
  160. typedef struct _FTP_USER_INFO
  161. {
  162. DWORD idUser; // User id
  163. LPWSTR pszUser; // User name
  164. BOOL fAnonymous; // TRUE if the user is logged on as
  165. // Anonymous, FALSE otherwise
  166. DWORD inetHost; // Host Address
  167. DWORD tConnect; // User Connection Time (elapsed seconds)
  168. } FTP_USER_INFO, * LPFTP_USER_INFO;
  169. typedef struct _FTP_STATISTICS_0
  170. {
  171. LARGE_INTEGER TotalBytesSent;
  172. LARGE_INTEGER TotalBytesReceived;
  173. DWORD TotalFilesSent;
  174. DWORD TotalFilesReceived;
  175. DWORD CurrentAnonymousUsers;
  176. DWORD CurrentNonAnonymousUsers;
  177. DWORD TotalAnonymousUsers;
  178. DWORD TotalNonAnonymousUsers;
  179. DWORD MaxAnonymousUsers;
  180. DWORD MaxNonAnonymousUsers;
  181. DWORD CurrentConnections;
  182. DWORD MaxConnections;
  183. DWORD ConnectionAttempts;
  184. DWORD LogonAttempts;
  185. DWORD ServiceUptime;
  186. DWORD TotalAllowedRequests;
  187. DWORD TotalRejectedRequests;
  188. DWORD TotalBlockedRequests;
  189. DWORD CurrentBlockedRequests;
  190. DWORD MeasuredBandwidth;
  191. DWORD TimeOfLastClear;
  192. } FTP_STATISTICS_0, * LPFTP_STATISTICS_0;
  193. //
  194. // API Prototypes
  195. //
  196. NET_API_STATUS
  197. I_FtpEnumerateUsers(
  198. IN LPWSTR pszServer OPTIONAL,
  199. OUT LPDWORD lpdwEntriesRead,
  200. OUT LPFTP_USER_INFO * Buffer
  201. );
  202. NET_API_STATUS
  203. I_FtpDisconnectUser(
  204. IN LPWSTR pszServer OPTIONAL,
  205. IN DWORD idUser
  206. );
  207. NET_API_STATUS
  208. I_FtpQueryVolumeSecurity(
  209. IN LPWSTR pszServer OPTIONAL,
  210. OUT LPDWORD lpdwReadAccess,
  211. OUT LPDWORD lpdwWriteAccess
  212. );
  213. NET_API_STATUS
  214. I_FtpSetVolumeSecurity(
  215. IN LPWSTR pszServer OPTIONAL,
  216. IN DWORD dwReadAccess,
  217. IN DWORD dwWriteAccess
  218. );
  219. NET_API_STATUS
  220. I_FtpQueryStatistics(
  221. IN LPWSTR pszServer OPTIONAL,
  222. IN DWORD Level,
  223. OUT LPBYTE * Buffer
  224. );
  225. NET_API_STATUS
  226. I_FtpClearStatistics(
  227. IN LPWSTR pszServer OPTIONAL
  228. );
  229. #ifdef __cplusplus
  230. }
  231. #endif // _cplusplus
  232. #endif // _FTPD_H_