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.

340 lines
7.5 KiB

  1. /**********************************************************************/
  2. /** Microsoft Windows NT **/
  3. /** Copyright(c) Microsoft Corp., 1993 **/
  4. /**********************************************************************/
  5. /*
  6. ftpdata.c
  7. Constant data structures for the FTP Server's counter objects &
  8. counters.
  9. FILE HISTORY:
  10. KeithMo 07-Jun-1993 Created.
  11. */
  12. #include <windows.h>
  13. #include <winperf.h>
  14. #include <ftpctrs.h>
  15. #include <ftpdata.h>
  16. //
  17. // Initialize the constant portitions of these data structure.
  18. // Certain parts (especially the name/help indices) will be
  19. // updated at initialization time.
  20. //
  21. FTPD_DATA_DEFINITION FtpdDataDefinition =
  22. {
  23. { // FtpdObjectType
  24. sizeof(FTPD_DATA_DEFINITION) + sizeof( FTPD_COUNTER_BLOCK) ,
  25. sizeof(FTPD_DATA_DEFINITION),
  26. sizeof(PERF_OBJECT_TYPE),
  27. FTPD_COUNTER_OBJECT,
  28. 0,
  29. FTPD_COUNTER_OBJECT,
  30. 0,
  31. PERF_DETAIL_ADVANCED,
  32. NUMBER_OF_FTPD_COUNTERS,
  33. 2, // Default = Bytes Total/sec
  34. PERF_NO_INSTANCES,
  35. 0,
  36. { 0, 0 },
  37. { 0, 0 }
  38. },
  39. { // FtpdBytesSent
  40. sizeof(PERF_COUNTER_DEFINITION),
  41. FTPD_BYTES_SENT_COUNTER,
  42. 0,
  43. FTPD_BYTES_SENT_COUNTER,
  44. 0,
  45. -4,
  46. PERF_DETAIL_ADVANCED,
  47. PERF_COUNTER_BULK_COUNT,
  48. sizeof(LARGE_INTEGER),
  49. 0
  50. },
  51. { // FtpdBytesReceived
  52. sizeof(PERF_COUNTER_DEFINITION),
  53. FTPD_BYTES_RECEIVED_COUNTER,
  54. 0,
  55. FTPD_BYTES_RECEIVED_COUNTER,
  56. 0,
  57. -4,
  58. PERF_DETAIL_ADVANCED,
  59. PERF_COUNTER_BULK_COUNT,
  60. sizeof(LARGE_INTEGER),
  61. 0
  62. },
  63. { // FtpdBytesTotal
  64. sizeof(PERF_COUNTER_DEFINITION),
  65. FTPD_BYTES_TOTAL_COUNTER,
  66. 0,
  67. FTPD_BYTES_TOTAL_COUNTER,
  68. 0,
  69. -4,
  70. PERF_DETAIL_ADVANCED,
  71. PERF_COUNTER_BULK_COUNT,
  72. sizeof(LARGE_INTEGER),
  73. 0
  74. },
  75. { // FtpdFilesSent
  76. sizeof(PERF_COUNTER_DEFINITION),
  77. FTPD_FILES_SENT_COUNTER,
  78. 0,
  79. FTPD_FILES_SENT_COUNTER,
  80. 0,
  81. 0,
  82. PERF_DETAIL_ADVANCED,
  83. PERF_COUNTER_RAWCOUNT,
  84. sizeof(DWORD),
  85. 0
  86. },
  87. { // FtpdFilesReceived
  88. sizeof(PERF_COUNTER_DEFINITION),
  89. FTPD_FILES_RECEIVED_COUNTER,
  90. 0,
  91. FTPD_FILES_RECEIVED_COUNTER,
  92. 0,
  93. 0,
  94. PERF_DETAIL_ADVANCED,
  95. PERF_COUNTER_RAWCOUNT,
  96. sizeof(DWORD),
  97. 0
  98. },
  99. { // FtpdFilesTotal
  100. sizeof(PERF_COUNTER_DEFINITION),
  101. FTPD_FILES_TOTAL_COUNTER,
  102. 0,
  103. FTPD_FILES_TOTAL_COUNTER,
  104. 0,
  105. 0,
  106. PERF_DETAIL_ADVANCED,
  107. PERF_COUNTER_RAWCOUNT,
  108. sizeof(DWORD),
  109. 0
  110. },
  111. { // FptdCurrentAnonymous
  112. sizeof(PERF_COUNTER_DEFINITION),
  113. FTPD_CURRENT_ANONYMOUS_COUNTER,
  114. 0,
  115. FTPD_CURRENT_ANONYMOUS_COUNTER,
  116. 0,
  117. 0,
  118. PERF_DETAIL_ADVANCED,
  119. PERF_COUNTER_RAWCOUNT,
  120. sizeof(DWORD),
  121. 0
  122. },
  123. { // FptdCurrentNonAnonymous
  124. sizeof(PERF_COUNTER_DEFINITION),
  125. FTPD_CURRENT_NONANONYMOUS_COUNTER,
  126. 0,
  127. FTPD_CURRENT_NONANONYMOUS_COUNTER,
  128. 0,
  129. 0,
  130. PERF_DETAIL_ADVANCED,
  131. PERF_COUNTER_RAWCOUNT,
  132. sizeof(DWORD),
  133. 0
  134. },
  135. { // FptdTotalAnonymous
  136. sizeof(PERF_COUNTER_DEFINITION),
  137. FTPD_TOTAL_ANONYMOUS_COUNTER,
  138. 0,
  139. FTPD_TOTAL_ANONYMOUS_COUNTER,
  140. 0,
  141. 0,
  142. PERF_DETAIL_ADVANCED,
  143. PERF_COUNTER_RAWCOUNT,
  144. sizeof(DWORD),
  145. 0
  146. },
  147. { // FptdTotalNonAnonymous
  148. sizeof(PERF_COUNTER_DEFINITION),
  149. FTPD_TOTAL_NONANONYMOUS_COUNTER,
  150. 0,
  151. FTPD_TOTAL_NONANONYMOUS_COUNTER,
  152. 0,
  153. 0,
  154. PERF_DETAIL_ADVANCED,
  155. PERF_COUNTER_RAWCOUNT,
  156. sizeof(DWORD),
  157. 0
  158. },
  159. { // FptdMaxAnonymous
  160. sizeof(PERF_COUNTER_DEFINITION),
  161. FTPD_MAX_ANONYMOUS_COUNTER,
  162. 0,
  163. FTPD_MAX_ANONYMOUS_COUNTER,
  164. 0,
  165. 0,
  166. PERF_DETAIL_ADVANCED,
  167. PERF_COUNTER_RAWCOUNT,
  168. sizeof(DWORD),
  169. 0
  170. },
  171. { // FptdMaxNonAnonymous
  172. sizeof(PERF_COUNTER_DEFINITION),
  173. FTPD_MAX_NONANONYMOUS_COUNTER,
  174. 0,
  175. FTPD_MAX_NONANONYMOUS_COUNTER,
  176. 0,
  177. 0,
  178. PERF_DETAIL_ADVANCED,
  179. PERF_COUNTER_RAWCOUNT,
  180. sizeof(DWORD),
  181. 0
  182. },
  183. { // FptdCurrentConnections
  184. sizeof(PERF_COUNTER_DEFINITION),
  185. FTPD_CURRENT_CONNECTIONS_COUNTER,
  186. 0,
  187. FTPD_CURRENT_CONNECTIONS_COUNTER,
  188. 0,
  189. 0,
  190. PERF_DETAIL_ADVANCED,
  191. PERF_COUNTER_RAWCOUNT,
  192. sizeof(DWORD),
  193. 0
  194. },
  195. { // FptdMaxConnections
  196. sizeof(PERF_COUNTER_DEFINITION),
  197. FTPD_MAX_CONNECTIONS_COUNTER,
  198. 0,
  199. FTPD_MAX_CONNECTIONS_COUNTER,
  200. 0,
  201. 0,
  202. PERF_DETAIL_ADVANCED,
  203. PERF_COUNTER_RAWCOUNT,
  204. sizeof(DWORD),
  205. 0
  206. },
  207. { // FptdConnectionAttempts
  208. sizeof(PERF_COUNTER_DEFINITION),
  209. FTPD_CONNECTION_ATTEMPTS_COUNTER,
  210. 0,
  211. FTPD_CONNECTION_ATTEMPTS_COUNTER,
  212. 0,
  213. 0,
  214. PERF_DETAIL_ADVANCED,
  215. PERF_COUNTER_RAWCOUNT,
  216. sizeof(DWORD),
  217. 0
  218. },
  219. { // FptdLogonAttempts
  220. sizeof(PERF_COUNTER_DEFINITION),
  221. FTPD_LOGON_ATTEMPTS_COUNTER,
  222. 0,
  223. FTPD_LOGON_ATTEMPTS_COUNTER,
  224. 0,
  225. 0,
  226. PERF_DETAIL_ADVANCED,
  227. PERF_COUNTER_RAWCOUNT,
  228. sizeof(DWORD),
  229. 0
  230. },
  231. { // FptdServiceUptime
  232. sizeof(PERF_COUNTER_DEFINITION),
  233. FTPD_SERVICE_UPTIME_COUNTER,
  234. 0,
  235. FTPD_SERVICE_UPTIME_COUNTER,
  236. 0,
  237. 0,
  238. PERF_DETAIL_ADVANCED,
  239. PERF_COUNTER_RAWCOUNT,
  240. sizeof(DWORD),
  241. 0
  242. },
  243. // These counters are currently meaningless, but should be restored if we
  244. // ever enable per-FTP-instance bandwidth throttling.
  245. /*
  246. { // FtpdTotalAllowedRequests
  247. sizeof(PERF_COUNTER_DEFINITION),
  248. FTPD_TOTAL_ALLOWED_REQUESTS_COUNTER,
  249. 0,
  250. FTPD_TOTAL_ALLOWED_REQUESTS_COUNTER,
  251. 0,
  252. 0,
  253. PERF_DETAIL_ADVANCED,
  254. PERF_COUNTER_RAWCOUNT,
  255. sizeof(DWORD),
  256. 0
  257. },
  258. { // FtpdTotalRejectedRequests
  259. sizeof(PERF_COUNTER_DEFINITION),
  260. FTPD_TOTAL_REJECTED_REQUESTS_COUNTER,
  261. 0,
  262. FTPD_TOTAL_REJECTED_REQUESTS_COUNTER,
  263. 0,
  264. 0,
  265. PERF_DETAIL_ADVANCED,
  266. PERF_COUNTER_RAWCOUNT,
  267. sizeof(DWORD),
  268. 0
  269. },
  270. { // FtpdTotalBlockedRequests
  271. sizeof(PERF_COUNTER_DEFINITION),
  272. FTPD_TOTAL_BLOCKED_REQUESTS_COUNTER,
  273. 0,
  274. FTPD_TOTAL_BLOCKED_REQUESTS_COUNTER,
  275. 0,
  276. 0,
  277. PERF_DETAIL_ADVANCED,
  278. PERF_COUNTER_RAWCOUNT,
  279. sizeof(DWORD),
  280. 0
  281. },
  282. { // FptdCurrentBlockedRequests
  283. sizeof(PERF_COUNTER_DEFINITION),
  284. FTPD_CURRENT_BLOCKED_REQUESTS_COUNTER,
  285. 0,
  286. FTPD_CURRENT_BLOCKED_REQUESTS_COUNTER,
  287. 0,
  288. 0,
  289. PERF_DETAIL_ADVANCED,
  290. PERF_COUNTER_RAWCOUNT,
  291. sizeof(DWORD),
  292. 0
  293. },
  294. { // FptdMeasuredBandwidth
  295. sizeof(PERF_COUNTER_DEFINITION),
  296. FTPD_MEASURED_BANDWIDTH_COUNTER,
  297. 0,
  298. FTPD_MEASURED_BANDWIDTH_COUNTER,
  299. 0,
  300. 0,
  301. PERF_DETAIL_ADVANCED,
  302. PERF_COUNTER_RAWCOUNT,
  303. sizeof(DWORD),
  304. 0
  305. },
  306. */
  307. };