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.

151 lines
2.4 KiB

  1. /*++
  2. Copyright (c) 1998-2001 Microsoft Corporation
  3. Module Name:
  4. parse.h
  5. Abstract:
  6. Contains all of the public definitions for the HTTP parsing code.
  7. Author:
  8. Henry Sanders (henrysa) 04-May-1998
  9. Revision History:
  10. Paul McDaniel (paulmcd) 14-Apr-1999
  11. --*/
  12. #ifndef _PARSE_H_
  13. #define _PARSE_H_
  14. #ifdef __cplusplus
  15. extern "C" {
  16. #endif
  17. //
  18. // Size of a Date: header value.
  19. //
  20. #define DATE_HDR_LENGTH (sizeof("Mon, 05 May 1975 00:05:00 GMT") - sizeof(CHAR))
  21. //
  22. // The initialization routine.
  23. //
  24. NTSTATUS InitializeParser(VOID);
  25. //
  26. // The main HTTP parse routine(s).
  27. //
  28. NTSTATUS
  29. UlParseHttp(
  30. IN PUL_INTERNAL_REQUEST pRequest,
  31. IN PUCHAR pHttpRequest,
  32. IN ULONG HttpRequestLength,
  33. OUT ULONG *pBytesTaken
  34. );
  35. NTSTATUS
  36. UlParseChunkLength(
  37. IN PUL_INTERNAL_REQUEST pRequest,
  38. IN PUCHAR pBuffer,
  39. IN ULONG BufferLength,
  40. OUT PULONG pBytesTaken,
  41. OUT PULONGLONG pChunkLength
  42. );
  43. //
  44. // Date header cache.
  45. //
  46. NTSTATUS
  47. UlInitializeDateCache(
  48. VOID
  49. );
  50. VOID
  51. UlTerminateDateCache(
  52. VOID
  53. );
  54. //
  55. // Utility tokenizing routine.
  56. //
  57. PUCHAR
  58. FindWSToken(
  59. IN PUCHAR pBuffer,
  60. IN ULONG BufferLength,
  61. OUT ULONG *TokenLength
  62. );
  63. NTSTATUS
  64. UlComputeFixedHeaderSize(
  65. IN HTTP_VERSION Version,
  66. IN PHTTP_RESPONSE pUserResponse,
  67. OUT PULONG pHeaderLength
  68. );
  69. ULONG
  70. UlComputeVariableHeaderSize(
  71. IN PUL_INTERNAL_REQUEST pRequest,
  72. IN BOOLEAN ForceDisconnect,
  73. IN PUCHAR pContentLengthString,
  74. IN ULONG ContentLengthStringLength,
  75. OUT PUL_CONN_HDR pConnHeader
  76. );
  77. ULONG
  78. UlComputeMaxVariableHeaderSize(
  79. VOID
  80. );
  81. NTSTATUS
  82. UlGenerateFixedHeaders(
  83. IN HTTP_VERSION Version,
  84. IN PHTTP_RESPONSE pUserResponse,
  85. IN ULONG BufferLength,
  86. OUT PUCHAR pBuffer,
  87. OUT PULONG pBytesCopied
  88. );
  89. VOID
  90. UlGenerateVariableHeaders(
  91. IN UL_CONN_HDR ConnHeader,
  92. IN PUCHAR pContentLengthString,
  93. IN ULONG ContentLengthStringLength,
  94. OUT PUCHAR pBuffer,
  95. OUT PULONG pBytesCopied,
  96. OUT PLARGE_INTEGER pDateTime
  97. );
  98. ULONG
  99. _MultiByteToWideChar(
  100. ULONG uCodePage,
  101. ULONG dwFlags,
  102. PCSTR lpMultiByteStr,
  103. int cchMultiByte,
  104. PWSTR lpWideCharStr,
  105. int cchWideChar
  106. );
  107. ULONG
  108. GenerateDateHeader(
  109. OUT PUCHAR pBuffer,
  110. OUT PLARGE_INTEGER pSystemTime
  111. );
  112. #ifdef __cplusplus
  113. }; // extern "C"
  114. #endif
  115. #endif // _PARSE_H_