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.

148 lines
3.6 KiB

  1. /*++
  2. Copyright (C) Microsoft Corporation, 1997 - 1999
  3. Module Name:
  4. httptran.hxx
  5. Abstract:
  6. HTTP transport-specific constants and types.
  7. Author:
  8. GopalP 06-25-97 Cloned from EdwardR's NT 4.0 RPC version.
  9. Revision History:
  10. --*/
  11. #ifndef __HTTPTRAN_HXX__
  12. #define __HTTPTRAN_HXX__
  13. //
  14. // Constants
  15. //
  16. #define HTTP_PROTSEQ_STR_ANSI "ncacn_http"
  17. #define HTTP_PROTSEQ_STR RPC_CONST_STRING("ncacn_http")
  18. #define HTTP_PROTSEQ_STR_SIZE 10*sizeof(RPC_CHAR)
  19. #define HTTP_ENDPOINT_MAPPER_EP "593"
  20. #define HTTP_TRANSPORTID 0x1F
  21. #define HTTP_TRANSPORTHOSTID 0x20
  22. #define MAX_HTTP_CHAT_BUFFER_SIZE 1024
  23. #define MAX_HTTP_COMPUTERNAME_SIZE 256
  24. #define MAX_HTTP_PORTSTRING_SIZE 64
  25. #define MAX_NETWORK_OPTIONS_SIZE 256
  26. #define MAX_HTTP_ENDPOINT_LEN 5
  27. //
  28. // HTTP<Major.Minor><Space><3-digit Status><Space>
  29. // 4+3+1+3+1 = 12
  30. //
  31. #define HTTP_RESPONSE_HEADER_LENGTH 12
  32. #define MAX_HTTP_MESSAGE_LENGTH 256
  33. #define DEF_HTTP_PORT "80"
  34. #define DEF_HTTP_SSL_PORT "443"
  35. #define RPC_PROXY_OPTION_STR "RpcProxy"
  36. #define HTTP_PROXY_OPTION_STR "HttpProxy"
  37. #define LOCAL_ADDRESSES_STR "<local>"
  38. #define HTTP_EQUALS_STR "http="
  39. #define HTTPS_EQUALS_STR "https="
  40. #define REG_PROXY_PATH_STR RPC_CONST_SSTRING("Software\\Microsoft\\Windows\\CurrentVersion\\Internet Settings")
  41. #define REG_PROXY_ENABLE_STR RPC_CONST_SSTRING("ProxyEnable")
  42. #define REG_PROXY_SERVER_STR "ProxyServer"
  43. #define REG_PROXY_OVERRIDE_STR "ProxyOverride"
  44. #define EQUALS_STR "="
  45. #define SEMICOLON_STR ";"
  46. #define CHAR_SPACE ' '
  47. #define CHAR_SEMICOLON ';'
  48. #define CHAR_COMMA ','
  49. #define CHAR_EQ '='
  50. #define CHAR_TAB '\t'
  51. #define CHAR_NL '\n'
  52. #define CHAR_CR 0x0D // ASCII 13
  53. #define CHAR_LF 0x0A // ASCII 10
  54. #define CHAR_0 '0'
  55. #define CHAR_9 '9'
  56. #define CHAR_NUL 0
  57. //
  58. // HTTP RPC server ID string (to be sent to the client after accept()'ing
  59. // a new ncacn_http TCP/IP connection.
  60. //
  61. #define HTTP_SERVER_ID_STR "ncacn_http/1.0"
  62. #define HTTP_SERVER_ID_STR_LEN 14
  63. typedef enum tagRPCProxyAccessType
  64. {
  65. rpcpatUnknown = 0,
  66. rpcpatDirect,
  67. rpcpatHTTPProxy
  68. } RPCProxyAccessType;
  69. //
  70. // Functions
  71. //
  72. extern unsigned int
  73. HttpMessageLength(
  74. IN char *pBuffer
  75. );
  76. extern DWORD
  77. HttpParseResponse(
  78. IN char *pBuffer
  79. );
  80. extern BOOL
  81. HttpCheckRegistry(
  82. IN char *pszServer,
  83. IN BOOL UseSSLProxyPortAsDefault,
  84. OUT char **ppszHttpProxy,
  85. OUT char **ppszHttpProxyPort,
  86. OUT RPCProxyAccessType *AccessType
  87. );
  88. extern BOOL
  89. HttpParseNetworkOptions(
  90. IN RPC_CHAR *pNetworkOptions,
  91. IN char *pszDefaultServerName,
  92. OUT char **pszRpcProxy,
  93. OUT char **pszRpcProxyPort,
  94. IN BOOL UseSSLProxyPortAsDefault,
  95. OUT char **pszHttpProxy,
  96. OUT char **pszHttpProxyPort,
  97. OUT RPCProxyAccessType *AccessType,
  98. OUT DWORD *pdwStatus
  99. );
  100. extern BOOL
  101. HttpTunnelToRpcProxy(
  102. SOCKET Socket,
  103. char *pszRpcProxy,
  104. char *pszRpcProxyPort
  105. );
  106. extern BOOL
  107. HttpTunnelToRpcServer(
  108. SOCKET Socket,
  109. char *pszRpcServer,
  110. char *pszRpcServerPort
  111. );
  112. #endif // __HTTPTRAN_HXX__