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.

1567 lines
37 KiB

  1. /*++
  2. Copyright (c) 1998-2001 Microsoft Corporation
  3. Module Name:
  4. httpdef.h
  5. Abstract:
  6. This module contains basic HTTP protocol stack type definitions
  7. shared between the user- and kernel-mode components.
  8. Author:
  9. Keith Moore (keithmo) 29-Jul-1998
  10. Revision History:
  11. Paul McDaniel (paulmcd) 15-Mar-1999
  12. Added new response flags.
  13. Chun Ye (chunye) 27-Sep-2000
  14. Renamed UL_* to HTTP_*.
  15. --*/
  16. #ifndef _HTTPDEF_H_
  17. #define _HTTPDEF_H_
  18. #ifdef __cplusplus
  19. extern "C" {
  20. #endif // __cplusplus
  21. //
  22. // Forward references.
  23. //
  24. typedef struct _HTTP_RESPONSE *PHTTP_RESPONSE;
  25. typedef struct _HTTP_DATA_CHUNK *PHTTP_DATA_CHUNK;
  26. typedef struct _HTTP_SSL_INFO *PHTTP_SSL_INFO;
  27. //
  28. // Generic option flags. These apply to control channels and application
  29. // pools.
  30. //
  31. // HTTP_OPTION_OVERLAPPED - Opens the object for asynchronous I/O.
  32. //
  33. // HTTP_OPTION_CONTROLLER - Opens the object that doesn't read data.
  34. //
  35. #define HTTP_OPTION_OVERLAPPED 0x00000001
  36. #define HTTP_OPTION_CONTROLLER 0x00000002
  37. #define HTTP_OPTION_VALID 0x00000003
  38. //
  39. // Flags for HttpReceiveHttpRequest().
  40. //
  41. // HTTP_RECEIVE_REQUEST_FLAG_COPY_BODY - Specifies that the caller would like
  42. // any available entity body to be copied along with the protocol headers
  43. //
  44. #define HTTP_RECEIVE_REQUEST_FLAG_COPY_BODY 0x00000001
  45. #define HTTP_RECEIVE_REQUEST_FLAG_FLUSH_BODY 0x00000002
  46. #define HTTP_RECEIVE_REQUEST_FLAG_VALID 0x00000003
  47. //
  48. // Flags for HttpSendHttpResponse() and HttpSendEntityBody().
  49. //
  50. // HTTP_SEND_RESPONSE_FLAG_DISCONNECT - Specifies that the network connection
  51. // should be disconnected immediately after sending the response, overriding
  52. // the HTTP protocol's persistent connection features.
  53. //
  54. // HTTP_SEND_RESPONSE_FLAG_MORE_DATA - Specifies that additional entity body
  55. // data will be sent by the caller.
  56. //
  57. // HTTP_SEND_REPONSE_RAW_HEADER - Specifies that a caller of
  58. // HttpSendEntityBody is intentionally omitting a call to
  59. // HttpSendHttpResponse in order to bypass normal header processing. The
  60. // actual HTTP header will be generated by the application and sent
  61. // as entity body. This flag should be passed on the first call to
  62. // HttpSendEntityBody, and not after.
  63. //
  64. #define HTTP_SEND_RESPONSE_FLAG_DISCONNECT 0x00000001
  65. #define HTTP_SEND_RESPONSE_FLAG_MORE_DATA 0x00000002
  66. #define HTTP_SEND_RESPONSE_FLAG_RAW_HEADER 0x00000004
  67. #define HTTP_SEND_RESPONSE_FLAG_VALID 0x00000007
  68. //
  69. // Flags for HttpFlushResponseCache().
  70. //
  71. // HTTP_FLUSH_RESPONSE_FLAG_RECURSIVE - Flushes the specified URL and all
  72. // heirarchally related sub-URLs from the response cache.
  73. //
  74. #define HTTP_FLUSH_RESPONSE_FLAG_RECURSIVE 0x00000001
  75. #define HTTP_FLUSH_RESPONSE_FLAG_VALID 0x00000001
  76. //
  77. // Flags for HttpReceiveClientCertificate
  78. //
  79. // HTTP_RECEIVE_CLIENT_CERT_FLAG_MAP - Maps the client certificate to a token.
  80. //
  81. #define HTTP_RECEIVE_CLIENT_CERT_FLAG_MAP 0x00000001
  82. #define HTTP_RECEIVE_CLIENT_CERT_FLAG_VALID 0x00000001
  83. //
  84. // Opaque identifiers for various kernel objects.
  85. //
  86. typedef ULONGLONG HTTP_OPAQUE_ID, *PHTTP_OPAQUE_ID;
  87. typedef HTTP_OPAQUE_ID HTTP_REQUEST_ID, *PHTTP_REQUEST_ID;
  88. typedef HTTP_OPAQUE_ID HTTP_CONNECTION_ID, *PHTTP_CONNECTION_ID;
  89. typedef HTTP_OPAQUE_ID HTTP_CONFIG_GROUP_ID, *PHTTP_CONFIG_GROUP_ID;
  90. typedef HTTP_OPAQUE_ID HTTP_RAW_CONNECTION_ID, *PHTTP_RAW_CONNECTION_ID;
  91. #define HTTP_NULL_ID 0
  92. #define HTTP_IS_NULL_ID(pid) (*(pid) == 0)
  93. #define HTTP_SET_NULL_ID(pid) (*(pid) = 0)
  94. //
  95. // An opaque context for URLs in an configuration group.
  96. //
  97. typedef ULONGLONG HTTP_URL_CONTEXT;
  98. //
  99. // Network QOS stuff.
  100. //
  101. typedef ULONG HTTP_BANDWIDTH_LIMIT, *PHTTP_BANDWIDTH_LIMIT;
  102. typedef ULONG HTTP_CONNECTION_LIMIT, *PHTTP_CONNECTION_LIMIT;
  103. //
  104. // Distinguished value for bandwidth and connection limits indicating
  105. // "no limit".
  106. //
  107. #define HTTP_LIMIT_INFINITE (ULONG)-1L
  108. //
  109. // Enabled states. Used for configuration groups and the control channel.
  110. //
  111. typedef enum _HTTP_ENABLED_STATE
  112. {
  113. HttpEnabledStateActive,
  114. HttpEnabledStateInactive,
  115. HttpEnabledStateMaximum
  116. } HTTP_ENABLED_STATE, *PHTTP_ENABLED_STATE;
  117. //
  118. // UTF8 Logging
  119. //
  120. typedef BOOLEAN HTTP_CONTROL_CHANNEL_UTF8_LOGGING, *PHTTP_CONTROL_CHANNEL_UTF8_LOGGING;
  121. //
  122. // Control channel query/set information classes used for the
  123. // HttpQueryControlChannelInformation() and HttpSetControlChannelInformation()
  124. // APIs.
  125. //
  126. typedef enum _HTTP_CONTROL_CHANNEL_INFORMATION_CLASS
  127. {
  128. //
  129. // Query/set the master state.
  130. //
  131. // pControlChannelInformation points to a HTTP_ENABLED_STATE enum.
  132. //
  133. HttpControlChannelStateInformation,
  134. //
  135. // Query/set the default network bandwidth limit.
  136. //
  137. // pControlChannelInformation points to a HTTP_BANDWIDTH_LIMIT value.
  138. //
  139. HttpControlChannelBandwidthInformation,
  140. //
  141. // Query/set the default network connections limit.
  142. //
  143. // pControlChannelInformation points to a HTTP_CONNECTION_LIMIT value.
  144. //
  145. HttpControlChannelConnectionInformation,
  146. //
  147. // Set the HTTP response to be sent with either HTTP has been deactivated
  148. // or in critically bad situations in which it is impossible to even
  149. // determine which process should receive the request.
  150. //
  151. // pControlChannelInformation points to a HTTP_AUTO_RESPONSE structure.
  152. //
  153. // Note this cannot be queried.
  154. //
  155. HttpControlChannelAutoResponseInformation,
  156. //
  157. // Set the handle used to communicate with the Filter/SSL process.
  158. //
  159. // Note this cannot be queried.
  160. //
  161. HttpControlChannelFilterInformation,
  162. //
  163. // Set the global Connection Timeout information
  164. //
  165. // pControlChannelInformation points to a HTTP_CONTROL_CHANNEL_TIMEOUT_LIMIT structure.
  166. //
  167. HttpControlChannelTimeoutInformation,
  168. //
  169. // Set the UTF8 Logging property for all sites
  170. //
  171. // pControlChannelInformation points to a HTTP_CONTROL_CHANNEL_UTF8_LOGGING structure.
  172. //
  173. HttpControlChannelUTF8Logging,
  174. HttpControlChannelMaximumInformation
  175. } HTTP_CONTROL_CHANNEL_INFORMATION_CLASS, *PHTTP_CONTROL_CHANNEL_INFORMATION_CLASS;
  176. //
  177. // Default control channel property values.
  178. //
  179. #define HTTP_CONTROL_CHANNEL_STATE_DEFAULT HttpEnabledStateInactive
  180. #define HTTP_CONTROL_CHANNEL_MAX_BANDWIDTH_DEFAULT HTTP_LIMIT_INFINITE
  181. #define HTTP_CONTROL_CHANNEL_MAX_CONNECTIONS_DEFAULT HTTP_LIMIT_INFINITE
  182. #define HTTP_CONTROL_CHANNEL_AUTO_RESPONSE_DEFAULT NULL
  183. //
  184. // Connection Timeout Limits structure for HttpControlChannelTimeoutInformation
  185. //
  186. typedef struct _HTTP_CONTROL_CHANNEL_TIMEOUT_LIMIT
  187. {
  188. ULONG ConnectionTimeout; // Seconds
  189. ULONG HeaderWaitTimeout; // Seconds
  190. ULONG MinFileKbSec; // Bytes/Seconds
  191. } HTTP_CONTROL_CHANNEL_TIMEOUT_LIMIT, *PHTTP_CONTROL_CHANNEL_TIMEOUT_LIMIT;
  192. //
  193. // Application pool query/set information classes used for the
  194. // HttpQueryAppPoolInformation() and HttpSetAppPoolInforamtion()
  195. // APIs.
  196. //
  197. typedef enum _HTTP_APP_POOL_INFORMATION_CLASS
  198. {
  199. //
  200. // Query/set the maximum number of processes for the specified
  201. // application group. This value is typically 1 in the normal case
  202. // and greater than 1 for Web Gardens.
  203. //
  204. // pAppPoolInformation points to a ULONG containing the maximum
  205. // number of processes.
  206. //
  207. // NOTE: not used.
  208. HttpAppPoolDemandStartInformation,
  209. //
  210. // Clears the demand start flag. This is part of the demand start
  211. // handshake protocol used between the user- and kernel-mode
  212. // components.
  213. //
  214. // pAppPoolInformation is unused.
  215. //
  216. // NOTE: not used.
  217. HttpAppPoolDemandStartFlagInformation,
  218. //
  219. // Query/set the maximum number of queued new requests on
  220. // the application pool.
  221. //
  222. // pAppPoolInformation points to a LONG containing the maximum
  223. // number of queued requests.
  224. //
  225. HttpAppPoolQueueLengthInformation,
  226. //
  227. // Query/set the active state of the application pool.
  228. //
  229. // pAppPoolInformation points to a HTTP_ENABLED_STATE enum.
  230. //
  231. HttpAppPoolStateInformation,
  232. HttpAppPoolMaximumInformation
  233. } HTTP_APP_POOL_INFORMATION_CLASS, *PHTTP_APP_POOL_INFORMATION_CLASS;
  234. //
  235. // Configuration group query/set information classes use for the
  236. // HttpQueryConfigGroupInformation() and HttpSetConfigGroupInformation()
  237. // APIs.
  238. //
  239. typedef enum _HTTP_CONFIG_GROUP_INFORMATION_CLASS
  240. {
  241. //
  242. // Query/set the current state of the configuration group.
  243. //
  244. // pConfigGroupInformation points to a HTTP_CONFIG_GROUP_STATE structure
  245. // that receives the current state.
  246. //
  247. HttpConfigGroupStateInformation,
  248. //
  249. // Query/set the maximum network bandwidth allowed for the configuration
  250. // group.
  251. //
  252. // pConfigGroupInformation points to a HTTP_CONFIG_GROUP_MAX_BANDWIDTH
  253. // structure specifying the maximum bytes per second allowed for the
  254. // contiainer.
  255. //
  256. HttpConfigGroupBandwidthInformation,
  257. //
  258. // Query/set the maximum network connections allowed for the
  259. // configuration group.
  260. //
  261. // pConfigGroupInformation points to a HTTP_CONFIG_GROUP_MAX_CONNECTIONS
  262. // structure containing the maximum number of network connections
  263. // allowed for the container.
  264. //
  265. HttpConfigGroupConnectionInformation,
  266. //
  267. // Set the response to be sent when the configuration group is
  268. // in a nonresponsive state.
  269. //
  270. // pConfigGroupInformation points to a HTTP_AUTO_RESPONSE
  271. // structure.
  272. //
  273. // Note this cannot be queried.
  274. //
  275. HttpConfigGroupAutoResponseInformation,
  276. //
  277. // Set the application pool associated with the configuration
  278. // group.
  279. //
  280. // pConfigGroupInformation points to a HTTP_CONFIG_GROUP_APP_POOL
  281. // structure containing the HANDLE of the application pool to
  282. // associate.
  283. //
  284. HttpConfigGroupAppPoolInformation,
  285. //
  286. // Set the cache size associated with the configuration
  287. // group.
  288. //
  289. // pConfigGroupInformation points to a HTTP_CONFIG_GROUP_APP_POOL
  290. // structure containing the HANDLE of the application pool to
  291. // associate.
  292. //
  293. HttpConfigGroupCacheSizeInformation,
  294. //
  295. // Set the security descriptor associated with the configuration
  296. // group. This security descriptor is used to control the
  297. // creation of transient URL registrations beneath the
  298. // configuration group.
  299. //
  300. // pConfigGroupInformation points to a HTTP_CONFIG_GROUP_SECURITY
  301. // structure.
  302. //
  303. // Note this cannot be queried.
  304. //
  305. HttpConfigGroupSecurityInformation,
  306. //
  307. // Set the logging related config settings.
  308. // This allows WAS to supply logging config as a config group
  309. // setting group.
  310. //
  311. // pConfigGroupInformation points to a HTTP_CONFIG_GROUP_LOGGING
  312. // structure.
  313. //
  314. // Note this cannot be queried.
  315. //
  316. HttpConfigGroupLogInformation,
  317. //
  318. // Set this information only on the root config object for the
  319. // site.
  320. //
  321. // pConfigGroupInformation points to a HTTP_CONFIG_GROUP_SITE
  322. // structure.
  323. //
  324. HttpConfigGroupSiteInformation,
  325. //
  326. // Set this information only on the root config object for the
  327. // site.
  328. //
  329. // pConfigGroupInformation points to a DWORD that contains
  330. // the ConnectionTimeout value (in seconds)
  331. //
  332. HttpConfigGroupConnectionTimeoutInformation,
  333. #if DBG
  334. //
  335. // Private for dev testing only.
  336. //
  337. HttpConfigGroupGetUrlInfo,
  338. HttpConfigGroupFreeUrlInfo,
  339. HttpConfigGroupUrlStaleTest,
  340. //
  341. // End private dev testing only.
  342. //
  343. #endif
  344. HttpConfigGroupMaximumInformation
  345. } HTTP_CONFIG_GROUP_INFORMATION_CLASS, *PHTTP_CONFIG_GROUP_INFORMATION_CLASS;
  346. //
  347. // Generic configuration group property flags. Each structure defining a
  348. // property value must contain an element of this type.
  349. //
  350. typedef struct _HTTP_PROPERTY_FLAGS
  351. {
  352. ULONG_PTR Present:1;
  353. } HTTP_PROPERTY_FLAGS, *PHTTP_PROPERTY_FLAGS;
  354. //
  355. // Individual property values.
  356. //
  357. typedef struct _HTTP_CONFIG_GROUP_STATE
  358. {
  359. HTTP_PROPERTY_FLAGS Flags;
  360. HTTP_ENABLED_STATE State;
  361. } HTTP_CONFIG_GROUP_STATE, *PHTTP_CONFIG_GROUP_STATE;
  362. typedef struct _HTTP_CONFIG_GROUP_MAX_BANDWIDTH
  363. {
  364. HTTP_PROPERTY_FLAGS Flags;
  365. HTTP_BANDWIDTH_LIMIT MaxBandwidth;
  366. } HTTP_CONFIG_GROUP_MAX_BANDWIDTH, *PHTTP_CONFIG_GROUP_MAX_BANDWIDTH;
  367. typedef struct _HTTP_CONFIG_GROUP_MAX_CONNECTIONS
  368. {
  369. HTTP_PROPERTY_FLAGS Flags;
  370. HTTP_CONNECTION_LIMIT MaxConnections;
  371. } HTTP_CONFIG_GROUP_MAX_CONNECTIONS, *PHTTP_CONFIG_GROUP_MAX_CONNECTIONS;
  372. typedef struct _HTTP_AUTO_RESPONSE
  373. {
  374. HTTP_PROPERTY_FLAGS Flags;
  375. PHTTP_RESPONSE pResponse;
  376. ULONG EntityChunkCount;
  377. PHTTP_DATA_CHUNK pEntityChunks;
  378. } HTTP_AUTO_RESPONSE, *PHTTP_AUTO_RESPONSE;
  379. typedef struct _HTTP_CONTROL_CHANNEL_FILTER
  380. {
  381. HTTP_PROPERTY_FLAGS Flags;
  382. HANDLE FilterHandle;
  383. BOOLEAN FilterOnlySsl;
  384. } HTTP_CONTROL_CHANNEL_FILTER, *PHTTP_CONTROL_CHANNEL_FILTER;
  385. typedef struct _HTTP_CONFIG_GROUP_APP_POOL
  386. {
  387. HTTP_PROPERTY_FLAGS Flags;
  388. HANDLE AppPoolHandle;
  389. } HTTP_CONFIG_GROUP_APP_POOL, *PHTTP_CONFIG_GROUP_APP_POOL;
  390. typedef struct _HTTP_CONFIG_GROUP_CACHE_SIZE
  391. {
  392. HTTP_PROPERTY_FLAGS Flags;
  393. ULONG CacheSize;
  394. } HTTP_CONFIG_GROUP_CACHE_SIZE, *PHTTP_CONFIG_GROUP_CACHE_SIZE;
  395. typedef struct _HTTP_CONFIG_GROUP_SECURITY
  396. {
  397. HTTP_PROPERTY_FLAGS Flags;
  398. PSECURITY_DESCRIPTOR pSecurityDescriptor;
  399. } HTTP_CONFIG_GROUP_SECURITY, *PHTTP_CONFIG_GROUP_SECURITY;
  400. typedef enum _HTTP_LOGGING_TYPE
  401. {
  402. HttpLoggingTypeW3C,
  403. HttpLoggingTypeIIS,
  404. HttpLoggingTypeNCSA,
  405. HttpLoggingTypeMaximum
  406. } HTTP_LOGGING_TYPE, *PHTTP_LOGGING_TYPE;
  407. typedef enum _HTTP_LOGGING_PERIOD
  408. {
  409. HttpLoggingPeriodMaxSize = 0,
  410. HttpLoggingPeriodDaily = 1,
  411. HttpLoggingPeriodWeekly = 2,
  412. HttpLoggingPeriodMonthly = 3,
  413. HttpLoggingPeriodHourly = 4,
  414. HttpLoggingPeriodMaximum
  415. } HTTP_LOGGING_PERIOD, *PHTTP_LOGGING_PERIOD;
  416. typedef struct _HTTP_CONFIG_GROUP_LOGGING
  417. {
  418. //
  419. // To indicate if this property exist or not
  420. // in the config group
  421. //
  422. HTTP_PROPERTY_FLAGS Flags;
  423. //
  424. // This is field?s counterpart in the metabase is
  425. // LogType
  426. //
  427. BOOLEAN LoggingEnabled;
  428. //
  429. // Indicates the Logging Format
  430. //
  431. HTTP_LOGGING_TYPE LogFormat;
  432. //
  433. // Indicates the exact directory where the log file
  434. // will be written to for a site.
  435. //
  436. UNICODE_STRING LogFileDir;
  437. //
  438. // HTTP does not keep the site name information.
  439. // WAS should pass down this. E.g. "W3SVC1"
  440. //
  441. UNICODE_STRING SiteName;
  442. //
  443. // Log Period in terms of
  444. // 0 = MAX SIZE, 1 = DAILY, 2 = WEEKLY,
  445. // 3 = MONTHLY, 4 = HOURLY
  446. //
  447. ULONG LogPeriod;
  448. //
  449. // Indicates the max size,in bytes,after which the
  450. // log file should be rotated. A value of -1
  451. // (HTTP_LIMIT_INFINITE) indicates unlimited size.
  452. //
  453. ULONG LogFileTruncateSize;
  454. //
  455. // A bit mask indicating which fields to log when
  456. // LogFormat is set to W3C Extended
  457. //
  458. ULONG LogExtFileFlags;
  459. //
  460. // If this has been set then we recycle log files
  461. // based on the local time for this site. Default
  462. // should be FALSE.
  463. //
  464. BOOLEAN LocaltimeRollover;
  465. } HTTP_CONFIG_GROUP_LOGGING, *PHTTP_CONFIG_GROUP_LOGGING;
  466. //
  467. // HTTP_CONFIG_GROUP_SITE
  468. //
  469. typedef struct _HTTP_CONFIG_GROUP_SITE
  470. {
  471. ULONG SiteId;
  472. } HTTP_CONFIG_GROUP_SITE, *PHTTP_CONFIG_GROUP_SITE;
  473. //
  474. // This structure holds all the necessary Logging Info,
  475. // And pushed down by User (Worker Process) with
  476. // Sendresponse or SendEntityBody Ioctls.
  477. //
  478. typedef struct _HTTP_LOG_FIELDS_DATA
  479. {
  480. USHORT UserNameLength;
  481. USHORT UriStemLength;
  482. USHORT ClientIpLength;
  483. USHORT ServerNameLength;
  484. USHORT ServiceNameLength;
  485. USHORT ServerIpLength;
  486. USHORT MethodLength;
  487. USHORT UriQueryLength;
  488. USHORT HostLength;
  489. USHORT UserAgentLength;
  490. USHORT CookieLength;
  491. USHORT ReferrerLength;
  492. PWSTR UserName;
  493. PWSTR UriStem;
  494. PSTR ClientIp;
  495. PSTR ServerName;
  496. PSTR ServiceName;
  497. PSTR ServerIp;
  498. PSTR Method;
  499. PSTR UriQuery;
  500. PSTR Host;
  501. PSTR UserAgent;
  502. PSTR Cookie;
  503. PSTR Referrer;
  504. ULONG ServerPort;
  505. ULONG ProtocolStatus;
  506. ULONG Win32Status;
  507. } HTTP_LOG_FIELDS_DATA, *PHTTP_LOG_FIELDS_DATA;
  508. #if DBG
  509. //
  510. // Private for dev testing only.
  511. //
  512. typedef struct _HTTP_CONFIG_GROUP_DBG_URL_INFO
  513. {
  514. UNICODE_STRING Url; // IN
  515. HTTP_ENABLED_STATE CurrentState; // OUT
  516. HTTP_BANDWIDTH_LIMIT MaxBandwidth; // OUT
  517. HTTP_CONNECTION_LIMIT MaxConnections; // OUT
  518. HTTP_URL_CONTEXT UrlContext; // OUT
  519. PVOID pReserved; // OUT
  520. BOOLEAN Stale; // OUT
  521. } HTTP_CONFIG_GROUP_DBG_URL_INFO, *PHTTP_CONFIG_GROUP_DBG_URL_INFO;
  522. //
  523. // End private dev testing only.
  524. //
  525. #endif
  526. //
  527. // This structure defines a file byte range.
  528. //
  529. // If the StartingOffset field is HTTP_BYTE_RANGE_TO_EOF (see below) then
  530. // the last Length bytes of the file are sent.
  531. //
  532. // If the Length field is HTTP_BYTE_RANGE_TO_EOF then the remainder of the
  533. // file (everything after StartingOffset) is sent.
  534. //
  535. typedef struct _HTTP_BYTE_RANGE
  536. {
  537. LARGE_INTEGER StartingOffset;
  538. LARGE_INTEGER Length;
  539. } HTTP_BYTE_RANGE, *PHTTP_BYTE_RANGE;
  540. #define HTTP_BYTE_RANGE_TO_EOF ((ULONGLONG)-1)
  541. //
  542. // The type for version numbers.
  543. //
  544. typedef struct _HTTP_VERSION
  545. {
  546. USHORT MajorVersion;
  547. USHORT MinorVersion;
  548. } HTTP_VERSION, *PHTTP_VERSION;
  549. //
  550. // Some useful macros for version manipulation.
  551. //
  552. #define HTTP_VERSION_UNKNOWN { 0, 0 }
  553. #define HTTP_VERSION_0_9 { 0, 9 }
  554. #define HTTP_VERSION_1_0 { 1, 0 }
  555. #define HTTP_VERSION_1_1 { 1, 1 }
  556. #define HTTP_SET_VERSION(version, major, minor) \
  557. { \
  558. (version).MajorVersion = (major); \
  559. (version).MinorVersion = (minor); \
  560. }
  561. #define HTTP_EQUAL_VERSION(version, major, minor) \
  562. ((version).MajorVersion == (major) && \
  563. (version).MinorVersion == (minor))
  564. #define HTTP_GREATER_VERSION(version, major, minor) \
  565. ((version).MajorVersion > (major) || \
  566. ((version).MajorVersion == (major) && \
  567. (version).MinorVersion > (minor)))
  568. #define HTTP_LESS_VERSION(version, major, minor) \
  569. ((version).MajorVersion < (major) || \
  570. ((version).MajorVersion == (major) && \
  571. (version).MinorVersion < (minor)))
  572. #define HTTP_NOT_EQUAL_VERSION(version, major, minor) \
  573. (!HTTP_EQUAL_VERSION(version, major, minor))
  574. #define HTTP_GREATER_EQUAL_VERSION(version, major, minor) \
  575. (!HTTP_LESS_VERSION(version, major, minor))
  576. #define HTTP_LESS_EQUAL_VERSION(version, major, minor) \
  577. (!HTTP_GREATER_VERSION(version, major, minor))
  578. //
  579. // The enum type for HTTP verbs.
  580. //
  581. typedef enum _HTTP_VERB
  582. {
  583. HttpVerbUnparsed,
  584. HttpVerbUnknown,
  585. HttpVerbInvalid,
  586. HttpVerbOPTIONS,
  587. HttpVerbGET,
  588. HttpVerbHEAD,
  589. HttpVerbPOST,
  590. HttpVerbPUT,
  591. HttpVerbDELETE,
  592. HttpVerbTRACE,
  593. HttpVerbCONNECT,
  594. HttpVerbTRACK, // used by wolf-pack for a non-logged trace
  595. HttpVerbMOVE,
  596. HttpVerbCOPY,
  597. HttpVerbPROPFIND,
  598. HttpVerbPROPPATCH,
  599. HttpVerbMKCOL,
  600. HttpVerbLOCK,
  601. HttpVerbUNLOCK,
  602. HttpVerbSEARCH,
  603. HttpVerbMaximum
  604. } HTTP_VERB, *PHTTP_VERB;
  605. //
  606. // Symbols for all HTTP/1.1 headers and other tokens. Notice request +
  607. // response values overlap. Make sure you know which type of header array
  608. // you are indexing.
  609. //
  610. // These values are used as offsets into arrays and as token values in
  611. // HTTP_KNOWN_HEADER.
  612. //
  613. typedef enum _HTTP_HEADER_ID
  614. {
  615. HttpHeaderCacheControl = 0, // general-header [section 4.5]
  616. HttpHeaderConnection , // general-header [section 4.5]
  617. HttpHeaderDate , // general-header [section 4.5]
  618. HttpHeaderKeepAlive , // general-header [not in rfc]
  619. HttpHeaderPragma , // general-header [section 4.5]
  620. HttpHeaderTrailer , // general-header [section 4.5]
  621. HttpHeaderTransferEncoding , // general-header [section 4.5]
  622. HttpHeaderUpgrade , // general-header [section 4.5]
  623. HttpHeaderVia , // general-header [section 4.5]
  624. HttpHeaderWarning = 9, // general-header [section 4.5]
  625. HttpHeaderAllow = 10, // entity-header [section 7.1]
  626. HttpHeaderContentLength , // entity-header [section 7.1]
  627. HttpHeaderContentType , // entity-header [section 7.1]
  628. HttpHeaderContentEncoding , // entity-header [section 7.1]
  629. HttpHeaderContentLanguage , // entity-header [section 7.1]
  630. HttpHeaderContentLocation , // entity-header [section 7.1]
  631. HttpHeaderContentMd5 , // entity-header [section 7.1]
  632. HttpHeaderContentRange , // entity-header [section 7.1]
  633. HttpHeaderExpires , // entity-header [section 7.1]
  634. HttpHeaderLastModified = 19, // entity-header [section 7.1]
  635. HttpHeaderAccept = 20, // request-header [section 5.3]
  636. HttpHeaderAcceptCharset , // request-header [section 5.3]
  637. HttpHeaderAcceptEncoding , // request-header [section 5.3]
  638. HttpHeaderAcceptLanguage , // request-header [section 5.3]
  639. HttpHeaderAuthorization , // request-header [section 5.3]
  640. HttpHeaderCookie , // request-header [not in rfc] // 25
  641. HttpHeaderExpect , // request-header [section 5.3]
  642. HttpHeaderFrom , // request-header [section 5.3]
  643. HttpHeaderHost , // request-header [section 5.3]
  644. HttpHeaderIfMatch , // request-header [section 5.3]
  645. HttpHeaderIfModifiedSince , // request-header [section 5.3] // 30
  646. HttpHeaderIfNoneMatch , // request-header [section 5.3]
  647. HttpHeaderIfRange , // request-header [section 5.3]
  648. HttpHeaderIfUnmodifiedSince , // request-header [section 5.3]
  649. HttpHeaderMaxForwards , // request-header [section 5.3]
  650. HttpHeaderProxyAuthorization , // request-header [section 5.3] // 35
  651. HttpHeaderReferer , // request-header [section 5.3]
  652. HttpHeaderRange , // request-header [section 5.3]
  653. HttpHeaderTe , // request-header [section 5.3]
  654. HttpHeaderTranslate , // request-header [webDAV, not in rfc 2518]
  655. HttpHeaderUserAgent = 40, // request-header [section 5.3] // 40
  656. HttpHeaderRequestMaximum = 41,
  657. HttpHeaderAcceptRanges = 20, // response-header [section 6.2]
  658. HttpHeaderAge , // response-header [section 6.2]
  659. HttpHeaderEtag , // response-header [section 6.2]
  660. HttpHeaderLocation , // response-header [section 6.2]
  661. HttpHeaderProxyAuthenticate , // response-header [section 6.2]
  662. HttpHeaderRetryAfter , // response-header [section 6.2]
  663. HttpHeaderServer , // response-header [section 6.2]
  664. HttpHeaderSetCookie , // response-header [not in rfc]
  665. HttpHeaderVary , // response-header [section 6.2]
  666. HttpHeaderWwwAuthenticate = 29, // response-header [section 6.2]
  667. HttpHeaderResponseMaximum = 30,
  668. HttpHeaderMaximum = 41
  669. } HTTP_HEADER_ID, *PHTTP_HEADER_ID;
  670. //
  671. // Structure defining format of known header.
  672. //
  673. typedef struct _HTTP_KNOWN_HEADER
  674. {
  675. //
  676. // raw value
  677. //
  678. USHORT RawValueLength; // in bytes not including the NULL
  679. PSTR pRawValue;
  680. } HTTP_KNOWN_HEADER, *PHTTP_KNOWN_HEADER;
  681. //
  682. // Structure defining format of unknown header.
  683. //
  684. typedef struct _HTTP_UNKNOWN_HEADER
  685. {
  686. USHORT NameLength; // in bytes not including the NULL
  687. USHORT RawValueLength; // in bytes not including the NULL
  688. //
  689. // The header name (minus the ':' character)
  690. //
  691. PSTR pName;
  692. //
  693. // The header value
  694. //
  695. PSTR pRawValue;
  696. } HTTP_UNKNOWN_HEADER, *PHTTP_UNKNOWN_HEADER;
  697. //
  698. // This enum defines a data source for a particular chunk of data.
  699. //
  700. typedef enum _HTTP_DATA_CHUNK_TYPE
  701. {
  702. HttpDataChunkFromMemory,
  703. HttpDataChunkFromFileName,
  704. HttpDataChunkFromFileHandle,
  705. HttpDataChunkMaximum
  706. } HTTP_DATA_CHUNK_TYPE, *PHTTP_DATA_CHUNK_TYPE;
  707. //
  708. // This structure describes an individual data chunk.
  709. //
  710. typedef struct _HTTP_DATA_CHUNK
  711. {
  712. //
  713. // The type of this data chunk.
  714. //
  715. HTTP_DATA_CHUNK_TYPE DataChunkType;
  716. //
  717. // The data chunk structures, one per supported data chunk type.
  718. //
  719. union
  720. {
  721. //
  722. // From memory data chunk.
  723. //
  724. struct
  725. {
  726. PVOID pBuffer;
  727. ULONG BufferLength;
  728. } FromMemory;
  729. //
  730. // From filename data chunk.
  731. //
  732. struct
  733. {
  734. HTTP_BYTE_RANGE ByteRange;
  735. USHORT FileNameLength; // in bytes not including the NULL
  736. PCWSTR pFileName;
  737. } FromFileName;
  738. //
  739. // From file handle data chunk.
  740. //
  741. struct
  742. {
  743. HTTP_BYTE_RANGE ByteRange;
  744. HANDLE FileHandle;
  745. } FromFileHandle;
  746. };
  747. } HTTP_DATA_CHUNK, *PHTTP_DATA_CHUNK;
  748. //
  749. // The enum type for HTTP request reasons.
  750. //
  751. typedef enum _HTTP_REQUEST_REASON
  752. {
  753. HttpReasonResponseCacheMiss,
  754. HttpReasonFileHandleCacheMiss,
  755. HttpReasonCachePolicy,
  756. HttpReasonCacheSecurity,
  757. HttpReasonClientDisconnect,
  758. HttpReasonMaximum
  759. } HTTP_REQUEST_REASON, *PHTTP_REQUEST_REASON;
  760. //
  761. // Structure defining format of request headers.
  762. //
  763. typedef struct _HTTP_REQUEST_HEADERS
  764. {
  765. //
  766. // The array of unknown HTTP headers and the number of
  767. // entries in the array.
  768. //
  769. ULONG UnknownHeaderCount;
  770. PHTTP_UNKNOWN_HEADER pUnknownHeaders;
  771. //
  772. // Known headers.
  773. //
  774. HTTP_KNOWN_HEADER pKnownHeaders[HttpHeaderRequestMaximum];
  775. } HTTP_REQUEST_HEADERS, *PHTTP_REQUEST_HEADERS;
  776. //
  777. // Structure defining format of request headers.
  778. //
  779. typedef struct _HTTP_RESPONSE_HEADERS
  780. {
  781. //
  782. // The array of unknown HTTP headers and the number of
  783. // entries in the array.
  784. //
  785. ULONG UnknownHeaderCount;
  786. PHTTP_UNKNOWN_HEADER pUnknownHeaders;
  787. //
  788. // Known headers.
  789. //
  790. HTTP_KNOWN_HEADER pKnownHeaders[HttpHeaderResponseMaximum];
  791. } HTTP_RESPONSE_HEADERS, *PHTTP_RESPONSE_HEADERS;
  792. //
  793. // Network address definitions.
  794. //
  795. #define HTTP_NETWORK_ADDRESS_TYPE_IPV4 0
  796. typedef struct _HTTP_NETWORK_ADDRESS_IPV4
  797. {
  798. ULONG IpAddress;
  799. USHORT Port;
  800. USHORT Spare; // for alignment
  801. } HTTP_NETWORK_ADDRESS_IPV4, *PHTTP_NETWORK_ADDRESS_IPV4;
  802. //
  803. // Structure defining format of transport address.
  804. //
  805. typedef struct _HTTP_TRANSPORT_ADDRESS
  806. {
  807. USHORT RemoteAddressLength; // sizeof(HTTP_NETWORK_ADDRESS_xxx)
  808. USHORT RemoteAddressType; // HTTP_NETWORK_ADDRESS_TYPE_xxx
  809. USHORT LocalAddressLength; // sizeof(HTTP_NETWORK_ADDRESS_xxx)
  810. USHORT LocalAddressType; // HTTP_NETWORK_ADDRESS_TYPE_xxx
  811. PVOID pRemoteAddress; // points to a HTTP_NETWORK_ADDRESS_xxx
  812. PVOID pLocalAddress; // points to a HTTP_NETWORK_ADDRESS_xxx
  813. } HTTP_TRANSPORT_ADDRESS, *PHTTP_TRANSPORT_ADDRESS;
  814. //
  815. // Structure defining format of cooked URL.
  816. //
  817. typedef struct _HTTP_COOKED_URL
  818. {
  819. //
  820. // Pointers overlap and point into pFullUrl. NULL if not present.
  821. //
  822. USHORT FullUrlLength; // in bytes not including the NULL
  823. USHORT HostLength; // in bytes not including the NULL
  824. USHORT AbsPathLength; // in bytes not including the NULL
  825. USHORT QueryStringLength; // in bytes not including the NULL
  826. PWSTR pFullUrl; // points to "http://...."
  827. PWSTR pHost; // points to the first char in the hostname
  828. PWSTR pAbsPath; // Points to the 3rd '/' char
  829. PWSTR pQueryString; // Points to the 1st '?' char
  830. } HTTP_COOKED_URL, *PHTTP_COOKED_URL;
  831. //
  832. // The structure of an HTTP request.
  833. //
  834. typedef struct _HTTP_REQUEST
  835. {
  836. //
  837. // An opaque request identifier. These values are used by the driver
  838. // to correlate outgoing responses with incoming requests.
  839. //
  840. HTTP_CONNECTION_ID ConnectionId;
  841. HTTP_REQUEST_ID RequestId;
  842. //
  843. // The context associated with the URL prefix.
  844. //
  845. HTTP_URL_CONTEXT UrlContext;
  846. //
  847. // The HTTP version number.
  848. //
  849. HTTP_VERSION Version;
  850. //
  851. // The request verb.
  852. //
  853. HTTP_VERB Verb;
  854. //
  855. // An indication of the reason the request was issued to/from user-mode.
  856. //
  857. HTTP_REQUEST_REASON Reason;
  858. //
  859. // The pointer and length of the verb string if the Verb field is
  860. // HttpVerbUnknown.
  861. //
  862. //
  863. // The pointer and length of the raw URL.
  864. //
  865. USHORT UnknownVerbLength; // in bytes not including the NULL
  866. USHORT RawUrlLength; // in bytes not including the NULL
  867. PSTR pUnknownVerb;
  868. PSTR pRawUrl;
  869. //
  870. // The pointers and length of the canonicalized URL and parts.
  871. //
  872. HTTP_COOKED_URL CookedUrl;
  873. //
  874. // Transport addresses for the connection.
  875. //
  876. HTTP_TRANSPORT_ADDRESS Address;
  877. //
  878. // The request headers.
  879. //
  880. HTTP_REQUEST_HEADERS Headers;
  881. //
  882. // The total number of bytes received from network for this request.
  883. //
  884. ULONGLONG BytesReceived;
  885. //
  886. // 1 if there is more entity body to be read or written for this request.
  887. // 0 if there is no entity body or all of the entity body was copied into
  888. // pEntityChunks.
  889. //
  890. ULONG MoreEntityBodyExists:1;
  891. //
  892. // The pointer and length of any copied entity body. Entity body is only
  893. // copied if HTTP_RECEIVE_REQUEST_FLAG_COPY_BODY is passed to receive.
  894. //
  895. ULONG EntityChunkCount;
  896. PHTTP_DATA_CHUNK pEntityChunks;
  897. //
  898. // SSL connection information.
  899. //
  900. HTTP_RAW_CONNECTION_ID RawConnectionId;
  901. PHTTP_SSL_INFO pSslInfo;
  902. } HTTP_REQUEST, *PHTTP_REQUEST;
  903. //
  904. // This structure describes an HTTP response.
  905. //
  906. typedef struct _HTTP_RESPONSE
  907. {
  908. //
  909. // Response flags (see HTTP_RESPONSE_FLAG_* definitions below).
  910. //
  911. USHORT Flags;
  912. //
  913. // The raw HTTP version number. Used by client side API only.
  914. //
  915. HTTP_VERSION Version;
  916. //
  917. // The HTTP status code (e.g. 200).
  918. //
  919. USHORT StatusCode;
  920. //
  921. // The HTTP reason (e.g. "OK") . This is a unicode string for convenience,
  922. // but MUST not contain non-ascii characters.
  923. //
  924. ULONG ReasonLength; // in bytes not including the NULL
  925. PSTR pReason;
  926. //
  927. // The response headers.
  928. //
  929. HTTP_RESPONSE_HEADERS Headers;
  930. //
  931. // 1 if there is more entity body to be read or written for this response.
  932. // 0 if there is no entity body or all of the entity body was copied into
  933. // pEntityChunks.
  934. //
  935. ULONG MoreEntityBodyExists:1;
  936. //
  937. // The pointer and length of any entity body.
  938. //
  939. ULONG EntityChunkCount;
  940. PHTTP_DATA_CHUNK pEntityChunks;
  941. } HTTP_RESPONSE, *PHTTP_RESPONSE;
  942. //
  943. // Flags for HTTP_RESPONSE_FLAGS.
  944. //
  945. // HTTP_RESPONSE_FLAG_CALC_CONTENT_LENGTH - The content length is
  946. // calculated by summing the length of all entity body data chunks.
  947. //
  948. // HTTP_RESPONSE_FLAG_CALC_ETAG - An entity tag is calculated for
  949. // the reponse based on the memory and file data chunks representing the
  950. // entity data.
  951. //
  952. // HTTP_RESPONSE_FLAG_CALC_LAST_MODIFIED - The last modified time is
  953. // calculated by examining the file data chunks within the entity body.
  954. //
  955. #define HTTP_RESPONSE_FLAG_CALC_CONTENT_LENGTH 0x00000001
  956. #define HTTP_RESPONSE_FLAG_CALC_ETAG 0x00000002
  957. #define HTTP_RESPONSE_FLAG_CALC_LAST_MODIFIED 0x00000004
  958. #define HTTP_RESPONSE_FLAG_VALID 0x00000007
  959. //
  960. // Cache control.
  961. //
  962. //
  963. // This enum defines the available cache policies.
  964. //
  965. typedef enum _HTTP_CACHE_POLICY_TYPE
  966. {
  967. HttpCachePolicyNocache,
  968. HttpCachePolicyUserInvalidates,
  969. HttpCachePolicyTimeToLive,
  970. HttpCachePolicyMaximum
  971. } HTTP_CACHE_POLICY_TYPE, *PHTTP_CACHE_POLICY_TYPE;
  972. //
  973. // o Only cache GET's + HEAD's.
  974. // o Don't cache if VARY is present.
  975. //
  976. typedef struct _HTTP_CACHE_POLICY
  977. {
  978. HTTP_CACHE_POLICY_TYPE Policy;
  979. ULONG SecondsToLive;
  980. } HTTP_CACHE_POLICY, *PHTTP_CACHE_POLICY;
  981. //
  982. // Filters and SSL.
  983. //
  984. //
  985. // Data associated with raw transport connections.
  986. //
  987. typedef struct _HTTP_RAW_CONNECTION_INFO
  988. {
  989. //
  990. // Connection ID.
  991. //
  992. HTTP_RAW_CONNECTION_ID ConnectionId;
  993. //
  994. // Transport address info.
  995. //
  996. HTTP_TRANSPORT_ADDRESS Address;
  997. //
  998. // Used by client APIs only
  999. //
  1000. ULONG ServerNameLength; // Length of server name (in bytes)
  1001. PWSTR pServerName; // Name of remote server
  1002. //
  1003. // Initial data.
  1004. //
  1005. ULONG InitialDataSize; // size of initial data
  1006. PVOID pInitialData; // pointer to initial data
  1007. } HTTP_RAW_CONNECTION_INFO, *PHTTP_RAW_CONNECTION_INFO;
  1008. //
  1009. // Client certificate information.
  1010. //
  1011. typedef struct _HTTP_SSL_CLIENT_CERT_INFO
  1012. {
  1013. ULONG CertFlags;
  1014. ULONG CertEncodedSize;
  1015. PUCHAR pCertEncoded;
  1016. HANDLE Token;
  1017. ULONG CertDeniedByMapper:1;
  1018. } HTTP_SSL_CLIENT_CERT_INFO, *PHTTP_SSL_CLIENT_CERT_INFO;
  1019. //
  1020. // Data computed during SSL handshake.
  1021. //
  1022. typedef struct _HTTP_SSL_INFO
  1023. {
  1024. USHORT ServerCertKeySize;
  1025. USHORT ConnectionKeySize;
  1026. ULONG ServerCertIssuerSize;
  1027. ULONG ServerCertSubjectSize;
  1028. PSTR pServerCertIssuer;
  1029. PSTR pServerCertSubject;
  1030. PHTTP_SSL_CLIENT_CERT_INFO pClientCertInfo;
  1031. } HTTP_SSL_INFO, *PHTTP_SSL_INFO;
  1032. //
  1033. // For transfers between filters and upper levels.
  1034. //
  1035. typedef enum _HTTP_FILTER_BUFFER_TYPE
  1036. {
  1037. HttpFilterBufferHttpStream, // both directions
  1038. HttpFilterBufferSslInitInfo, // filter -> app
  1039. HttpFilterBufferSslClientCert, // filter -> app
  1040. HttpFilterBufferSslClientCertAndMap, // filter -> app
  1041. HttpFilterBufferSslRenegotiate, // app -> filter
  1042. HttpFilterBufferSslRenegotiateAndMap, // app -> filter
  1043. HttpFilterBufferCloseConnection, // app -> filter
  1044. HttpFilterBufferMaximum
  1045. } HTTP_FILTER_BUFFER_TYPE;
  1046. //
  1047. // The buffer transferred between filters and upper levels.
  1048. //
  1049. typedef struct _HTTP_FILTER_BUFFER
  1050. {
  1051. HTTP_FILTER_BUFFER_TYPE BufferType;
  1052. ULONG BufferSize;
  1053. PUCHAR pBuffer;
  1054. ULONGLONG Reserved;
  1055. } HTTP_FILTER_BUFFER, *PHTTP_FILTER_BUFFER;
  1056. //
  1057. // Counter Group.
  1058. //
  1059. //
  1060. // Counter property description.
  1061. //
  1062. typedef struct _HTTP_PROP_DESC
  1063. {
  1064. ULONG Size;
  1065. ULONG Offset;
  1066. BOOLEAN WPZeros;
  1067. } HTTP_PROP_DESC, *PHTTP_PROP_DESC;
  1068. //
  1069. // This enum defines the available couter groups.
  1070. //
  1071. typedef enum _HTTP_COUNTER_GROUP
  1072. {
  1073. HttpCounterGroupSite,
  1074. HttpCounterGroupGlobal,
  1075. HttpCounterGroupMaximum
  1076. } HTTP_COUNTER_GROUP;
  1077. //
  1078. // This enum defines the type of global couters.
  1079. //
  1080. typedef enum _HTTP_GLOBAL_COUNTER_ID
  1081. {
  1082. HttpGlobalCounterCurrentUrisCached,
  1083. HttpGlobalCounterTotalUrisCached,
  1084. HttpGlobalCounterUriCacheHits,
  1085. HttpGlobalCounterUriCacheMisses,
  1086. HttpGlobalCounterUriCacheFlushes,
  1087. HttpGlobalCounterTotalFlushedUris,
  1088. HttpGlobalCounterMaximum
  1089. } HTTP_GLOBAL_COUNTER_ID;
  1090. //
  1091. // Global couters.
  1092. //
  1093. typedef struct _HTTP_GLOBAL_COUNTERS
  1094. {
  1095. ULONG CurrentUrisCached;
  1096. ULONG TotalUrisCached;
  1097. ULONG UriCacheHits;
  1098. ULONG UriCacheMisses;
  1099. ULONG UriCacheFlushes;
  1100. ULONG TotalFlushedUris;
  1101. } HTTP_GLOBAL_COUNTERS, *PHTTP_GLOBAL_COUNTERS;
  1102. //
  1103. // This enum defines the type of site couters.
  1104. //
  1105. typedef enum _HTTP_SITE_COUNTER_ID
  1106. {
  1107. HttpSiteCounterBytesSent,
  1108. HttpSiteCounterBytesReceived,
  1109. HttpSiteCounterBytesTransfered,
  1110. HttpSiteCounterCurrentConns,
  1111. HttpSiteCounterMaxConnections,
  1112. HttpSiteCounterConnAttempts,
  1113. HttpSiteCounterGetReqs,
  1114. HttpSiteCounterHeadReqs,
  1115. HttpSiteCounterAllReqs,
  1116. HttpSiteCounterMeasuredIoBandwidthUsage,
  1117. HttpSiteCounterCurrentBlockedBandwidthBytes,
  1118. HttpSiteCounterTotalBlockedBandwidthBytes,
  1119. HttpSiteCounterMaximum
  1120. } HTTP_SITE_COUNTER_ID;
  1121. //
  1122. // Site couters.
  1123. //
  1124. typedef struct _HTTP_SITE_COUNTERS
  1125. {
  1126. ULONG SiteId;
  1127. ULONGLONG BytesSent;
  1128. ULONGLONG BytesReceived;
  1129. ULONGLONG BytesTransfered;
  1130. ULONG CurrentConns;
  1131. ULONG MaxConnections;
  1132. ULONG ConnAttempts;
  1133. ULONG GetReqs;
  1134. ULONG HeadReqs;
  1135. ULONG AllReqs;
  1136. ULONG MeasuredIoBandwidthUsage;
  1137. ULONG CurrentBlockedBandwidthBytes;
  1138. ULONG TotalBlockedBandwidthBytes;
  1139. } HTTP_SITE_COUNTERS, *PHTTP_SITE_COUNTERS;
  1140. #ifdef __cplusplus
  1141. } // extern "C"
  1142. #endif // __cplusplus
  1143. #endif // _HTTPDEF_H_