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.

315 lines
11 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_CONN_TO_3RDIP_A "EnableDataConnTo3rdIP"
  84. #define FTPD_ENABLE_CONN_TO_3RDIP_W L"EnableDataConnTo3rdIP"
  85. #define FTPD_ENABLE_PASV_FROM_3RDIP_A "EnablePasvConnFrom3rdIP"
  86. #define FTPD_ENABLE_PASV_FROM_3RDIP_W L"EnablePasvConnFrom3rdIP"
  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. #define FTPD_DS_CACHE_REFRESH_A "DsCacheRefreshSecs"
  94. #define FTPD_DS_CACHE_REFRESH_W L"DsCacheRefreshSecs"
  95. #define FTPD_MAX_ACCEPT_EVENTS_A "MaxPassiveAcceptEvents"
  96. #define FTPD_MAX_ACCEPT_EVENTS_W L"MaxPassiveAcceptEvents"
  97. //
  98. // Name of the LSA Secret Object containing the password for
  99. // anonymous logon and virtual UNC roots
  100. //
  101. #define FTPD_ANONYMOUS_SECRET_A "FTPD_ANONYMOUS_DATA"
  102. #define FTPD_ANONYMOUS_SECRET_W L"FTPD_ANONYMOUS_DATA"
  103. #define FTPD_ROOT_SECRET_A "FTPD_ROOT_DATA"
  104. #define FTPD_ROOT_SECRET_W L"FTPD_ROOT_DATA"
  105. //
  106. // Handle ANSI/UNICODE sensitivity.
  107. //
  108. #ifdef UNICODE
  109. #define FTPD_ANNOTATION_FILE FTPD_ANNOTATION_FILE_W
  110. #define FTPD_PARAMETERS_KEY FTPD_PARAMETERS_KEY_W
  111. #define FTPD_PERFORMANCE_KEY FTPD_PERFORMANCE_KEY_W
  112. #define FTPD_ACCESS_KEY FTPD_ACCESS_KEY_W
  113. #define FTPD_ALLOW_ANONYMOUS FTPD_ALLOW_ANONYMOUS_W
  114. #define FTPD_ALLOW_GUEST_ACCESS FTPD_ALLOW_GUEST_ACCESS_W
  115. #define FTPD_ANONYMOUS_ONLY FTPD_ANONYMOUS_ONLY_W
  116. #define FTPD_MSDOS_DIR_OUTPUT FTPD_MSDOS_DIR_OUTPUT_W
  117. #define FTPD_SHOW_4_DIGIT_YEAR FTPD_SHOW_4_DIGIT_YEAR_W
  118. #define FTPD_GREETING_MESSAGE FTPD_GREETING_MESSAGE_W
  119. #define FTPD_EXIT_MESSAGE FTPD_EXIT_MESSAGE_W
  120. #define FTPD_MAX_CLIENTS_MSG FTPD_MAX_CLIENTS_MSG_W
  121. #define FTPD_DEBUG_FLAGS FTPD_DEBUG_FLAGS_W
  122. #define FTPD_ANNOTATE_DIRS FTPD_ANNOTATE_DIRS_W
  123. #define FTPD_ANONYMOUS_SECRET FTPD_ANONYMOUS_SECRET_W
  124. #define FTPD_LOWERCASE_FILES FTPD_LOWERCASE_FILES_W
  125. #define FTPD_LISTEN_BACKLOG FTPD_LISTEN_BACKLOG_W
  126. #define FTPD_ENABLE_LICENSING FTPD_ENABLE_LICENSING_W
  127. #define FTPD_DEFAULT_LOGON_DOMAIN FTPD_DEFAULT_LOGON_DOMAIN_W
  128. #define FTPD_NO_EXTENDED_FILENAME FTPD_NO_EXTENDED_FILENAME_W
  129. #define FTPD_ENABLE_CONN_TO_3RDIP FTPD_ENABLE_CONN_TO_3RDIP_W
  130. #define FTPD_ENABLE_PASV_FROM_3RDIP FTPD_ENABLE_PASV_FROM_3RDIP_W
  131. #define FTPD_BANNER_MESSAGE FTPD_BANNER_MESSAGE_W
  132. #define FTPD_USER_ISOLATION FTPD_USER_ISOLATION_W
  133. #define FTPD_LOG_IN_UTF_8 FTPD_LOG_IN_UTF_8_W
  134. #define FTPD_DS_CACHE_REFRESH FTPD_DS_CACHE_REFRESH_W
  135. #define FTPD_MAX_ACCEPT_EVENTS FTPD_MAX_ACCEPT_EVENTS_W
  136. #else // !UNICODE
  137. #define FTPD_ANNOTATION_FILE FTPD_ANNOTATION_FILE_A
  138. #define FTPD_PARAMETERS_KEY FTPD_PARAMETERS_KEY_A
  139. #define FTPD_PERFORMANCE_KEY FTPD_PERFORMANCE_KEY_A
  140. #define FTPD_ACCESS_KEY FTPD_ACCESS_KEY_A
  141. #define FTPD_ANONYMOUS_ONLY FTPD_ANONYMOUS_ONLY_A
  142. #define FTPD_ALLOW_ANONYMOUS FTPD_ALLOW_ANONYMOUS_A
  143. #define FTPD_ALLOW_GUEST_ACCESS FTPD_ALLOW_GUEST_ACCESS_A
  144. #define FTPD_MSDOS_DIR_OUTPUT FTPD_MSDOS_DIR_OUTPUT_A
  145. #define FTPD_SHOW_4_DIGIT_YEAR FTPD_SHOW_4_DIGIT_YEAR_A
  146. #define FTPD_GREETING_MESSAGE FTPD_GREETING_MESSAGE_A
  147. #define FTPD_EXIT_MESSAGE FTPD_EXIT_MESSAGE_A
  148. #define FTPD_MAX_CLIENTS_MSG FTPD_MAX_CLIENTS_MSG_A
  149. #define FTPD_DEBUG_FLAGS FTPD_DEBUG_FLAGS_A
  150. #define FTPD_ANNOTATE_DIRS FTPD_ANNOTATE_DIRS_A
  151. #define FTPD_ANONYMOUS_SECRET FTPD_ANONYMOUS_SECRET_A
  152. #define FTPD_LOWERCASE_FILES FTPD_LOWERCASE_FILES_A
  153. #define FTPD_LISTEN_BACKLOG FTPD_LISTEN_BACKLOG_A
  154. #define FTPD_ENABLE_LICENSING FTPD_ENABLE_LICENSING_A
  155. #define FTPD_DEFAULT_LOGON_DOMAIN FTPD_DEFAULT_LOGON_DOMAIN_A
  156. #define FTPD_NO_EXTENDED_FILENAME FTPD_NO_EXTENDED_FILENAME_A
  157. #define FTPD_ENABLE_CONN_TO_3RDIP FTPD_ENABLE_CONN_TO_3RDIP_A
  158. #define FTPD_ENABLE_PASV_FROM_3RDIP FTPD_ENABLE_PASV_FROM_3RDIP_A
  159. #define FTPD_BANNER_MESSAGE FTPD_BANNER_MESSAGE_A
  160. #define FTPD_USER_ISOLATION FTPD_USER_ISOLATION_A
  161. #define FTPD_LOG_IN_UTF_8 FTPD_LOG_IN_UTF_8_A
  162. #define FTPD_DS_CACHE_REFRESH FTPD_DS_CACHE_REFRESH_A
  163. #define FTPD_MAX_ACCEPT_EVENTS FTPD_MAX_ACCEPT_EVENTS_A
  164. #endif // UNICODE
  165. //
  166. // Structures for APIs
  167. //
  168. typedef struct _FTP_USER_INFO
  169. {
  170. DWORD idUser; // User id
  171. LPWSTR pszUser; // User name
  172. BOOL fAnonymous; // TRUE if the user is logged on as
  173. // Anonymous, FALSE otherwise
  174. DWORD inetHost; // Host Address
  175. DWORD tConnect; // User Connection Time (elapsed seconds)
  176. } FTP_USER_INFO, * LPFTP_USER_INFO;
  177. typedef struct _FTP_STATISTICS_0
  178. {
  179. LARGE_INTEGER TotalBytesSent;
  180. LARGE_INTEGER TotalBytesReceived;
  181. DWORD TotalFilesSent;
  182. DWORD TotalFilesReceived;
  183. DWORD CurrentAnonymousUsers;
  184. DWORD CurrentNonAnonymousUsers;
  185. DWORD TotalAnonymousUsers;
  186. DWORD TotalNonAnonymousUsers;
  187. DWORD MaxAnonymousUsers;
  188. DWORD MaxNonAnonymousUsers;
  189. DWORD CurrentConnections;
  190. DWORD MaxConnections;
  191. DWORD ConnectionAttempts;
  192. DWORD LogonAttempts;
  193. DWORD ServiceUptime;
  194. DWORD TotalAllowedRequests;
  195. DWORD TotalRejectedRequests;
  196. DWORD TotalBlockedRequests;
  197. DWORD CurrentBlockedRequests;
  198. DWORD MeasuredBandwidth;
  199. DWORD TimeOfLastClear;
  200. } FTP_STATISTICS_0, * LPFTP_STATISTICS_0;
  201. //
  202. // API Prototypes
  203. //
  204. NET_API_STATUS
  205. I_FtpEnumerateUsers(
  206. IN LPWSTR pszServer OPTIONAL,
  207. OUT LPDWORD lpdwEntriesRead,
  208. OUT LPFTP_USER_INFO * Buffer
  209. );
  210. NET_API_STATUS
  211. I_FtpDisconnectUser(
  212. IN LPWSTR pszServer OPTIONAL,
  213. IN DWORD idUser
  214. );
  215. NET_API_STATUS
  216. I_FtpQueryVolumeSecurity(
  217. IN LPWSTR pszServer OPTIONAL,
  218. OUT LPDWORD lpdwReadAccess,
  219. OUT LPDWORD lpdwWriteAccess
  220. );
  221. NET_API_STATUS
  222. I_FtpSetVolumeSecurity(
  223. IN LPWSTR pszServer OPTIONAL,
  224. IN DWORD dwReadAccess,
  225. IN DWORD dwWriteAccess
  226. );
  227. NET_API_STATUS
  228. I_FtpQueryStatistics(
  229. IN LPWSTR pszServer OPTIONAL,
  230. IN DWORD Level,
  231. OUT LPBYTE * Buffer
  232. );
  233. NET_API_STATUS
  234. I_FtpClearStatistics(
  235. IN LPWSTR pszServer OPTIONAL
  236. );
  237. #ifdef __cplusplus
  238. }
  239. #endif // _cplusplus
  240. #endif // _FTPD_H_