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.

147 lines
4.4 KiB

  1. /*++
  2. Copyright (c) 1994 Microsoft Corporation
  3. Module Name:
  4. headers.h
  5. Abstract:
  6. This file contains the well-known HTTP/MIME request/response headers.
  7. For each header, two manifests are defined. HTTP_*_SZ contains the header
  8. name, immediatly followed by a colon. HTTP_*_LEN is the strlen of the
  9. corresponding HTTP_*_SZ, which does not include the terminating '\0'.
  10. Author:
  11. Keith Moore (keithmo) 16-Nov-1994
  12. Revision History:
  13. --*/
  14. #define CSTRLEN(str) (sizeof(str)-1)
  15. #ifndef _HEADERS_H_
  16. #define _HEADERS_H_
  17. struct KnownHeaderType {
  18. LPSTR Text;
  19. INT Length;
  20. DWORD Flags;
  21. DWORD HashVal;
  22. };
  23. #define MAX_HEADER_HASH_SIZE 153
  24. #define HEADER_HASH_SEED 1291949
  25. extern const BYTE GlobalHeaderHashs[];
  26. extern const struct KnownHeaderType GlobalKnownHeaders[];
  27. DWORD
  28. FASTCALL
  29. CalculateHashNoCase(
  30. IN LPCSTR lpszString,
  31. IN DWORD dwStringLength
  32. );
  33. //
  34. // Various other header defines for different HTTP headers.
  35. //
  36. #define HTTP_ACCEPT_RANGES_SZ "Accept-Ranges:"
  37. #define HTTP_ACCEPT_RANGES_LEN CSTRLEN(HTTP_ACCEPT_RANGES_SZ)
  38. #define HTTP_DATE_SZ "Date:"
  39. #define HTTP_DATE_LEN (sizeof(HTTP_DATE_SZ) - 1)
  40. #define HTTP_EXPIRES_SZ "Expires:"
  41. #define HTTP_EXPIRES_LEN (sizeof(HTTP_EXPIRES_SZ) - 1)
  42. #define HTTP_CONTENT_DISPOSITION_SZ "Content-Disposition:"
  43. #define HTTP_CONTENT_DISPOSITION_LEN (sizeof(HTTP_CONTENT_DISPOSITION_SZ) - 1)
  44. #define HTTP_LAST_MODIFIED_SZ "Last-Modified:"
  45. #define HTTP_LAST_MODIFIED_LEN (sizeof(HTTP_LAST_MODIFIED_SZ) - 1)
  46. // nuke?
  47. #define HTTP_UNLESS_MODIFIED_SINCE_SZ "Unless-Modified-Since:"
  48. #define HTTP_UNLESS_MODIFIED_SINCE_LEN CSTRLEN(HTTP_UNLESS_MODIFIED_SINCE_SZ)
  49. #define HTTP_SERVER_SZ "Server:"
  50. #define HTTP_SERVER_LEN (sizeof(HTTP_SERVER_SZ) - 1)
  51. #define HTTP_CONNECTION_SZ "Connection:"
  52. #define HTTP_CONNECTION_LEN (sizeof(HTTP_CONNECTION_SZ) - 1)
  53. #define HTTP_PROXY_CONNECTION_SZ "Proxy-Connection:"
  54. #define HTTP_PROXY_CONNECTION_LEN (sizeof(HTTP_PROXY_CONNECTION_SZ) - 1)
  55. #define HTTP_SET_COOKIE_SZ "Set-Cookie:"
  56. #define HTTP_SET_COOKIE_LEN (sizeof(HTTP_SET_COOKIE_SZ)-1)
  57. //
  58. // Miscellaneous header goodies.
  59. //
  60. #define CHUNKED_SZ "chunked"
  61. #define CHUNKED_LEN (sizeof(CHUNKED_SZ) - 1)
  62. #define KEEP_ALIVE_SZ "Keep-Alive"
  63. #define KEEP_ALIVE_LEN (sizeof(KEEP_ALIVE_SZ) - 1)
  64. #define CLOSE_SZ "Close"
  65. #define CLOSE_LEN (sizeof(CLOSE_SZ) - 1)
  66. #define BYTES_SZ "bytes"
  67. #define BYTES_LEN CSTRLEN(BYTES_SZ)
  68. #define HTTP_VIA_SZ "Via:"
  69. #define HTTP_VIA_LEN (sizeof(HTTP_VIA_SZ) - 1)
  70. #define HTTP_DATE_SIZE 40
  71. // Cache control defines:
  72. #define HTTP_CACHE_CONTROL_SZ "Cache-Control:"
  73. #define HTTP_CACHE_CONTROL_LEN CSTRLEN(HTTP_CACHE_CONTROL_SZ)
  74. #define HTTP_AGE_SZ "Age:"
  75. #define HTTP_AGE_LEN (sizeof(HTTP_AGE_SZ)-1)
  76. #define HTTP_VARY_SZ "Vary:"
  77. #define HTTP_VARY_LEN (sizeof(HTTP_VARY_SZ)-1)
  78. #define NO_CACHE_SZ "no-cache"
  79. #define NO_CACHE_LEN (sizeof(NO_CACHE_SZ) -1)
  80. #define NO_STORE_SZ "no-store"
  81. #define NO_STORE_LEN (sizeof(NO_STORE_SZ) -1)
  82. #define MUST_REVALIDATE_SZ "must-revalidate"
  83. #define MUST_REVALIDATE_LEN (sizeof(MUST_REVALIDATE_SZ) -1)
  84. #define MAX_AGE_SZ "max-age"
  85. #define MAX_AGE_LEN (sizeof(MAX_AGE_SZ) -1)
  86. #define PRIVATE_SZ "private"
  87. #define PRIVATE_LEN (sizeof(PRIVATE_SZ) - 1)
  88. #define POSTCHECK_SZ "post-check"
  89. #define POSTCHECK_LEN (sizeof(POSTCHECK_SZ) -1)
  90. #define PRECHECK_SZ "pre-check"
  91. #define PRECHECK_LEN (sizeof(PRECHECK_SZ) -1)
  92. #define FILENAME_SZ "filename"
  93. #define FILENAME_LEN (sizeof(FILENAME_SZ) - 1)
  94. #define USER_AGENT_SZ "user-agent"
  95. #define USER_AGENT_LEN (sizeof(USER_AGENT_SZ) - 1)
  96. #endif // _HEADERS_H_