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.

146 lines
3.4 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 REG_PROXY_PATH_STR RPC_CONST_SSTRING("Software\\Microsoft\\Windows\\CurrentVersion\\Internet Settings")
  40. #define REG_PROXY_ENABLE_STR RPC_CONST_SSTRING("ProxyEnable")
  41. #define REG_PROXY_SERVER_STR "ProxyServer"
  42. #define REG_PROXY_OVERRIDE_STR "ProxyOverride"
  43. #define EQUALS_STR "="
  44. #define SEMICOLON_STR ";"
  45. #define CHAR_SPACE ' '
  46. #define CHAR_SEMICOLON ';'
  47. #define CHAR_COMMA ','
  48. #define CHAR_EQ '='
  49. #define CHAR_TAB '\t'
  50. #define CHAR_NL '\n'
  51. #define CHAR_CR 0x0D // ASCII 13
  52. #define CHAR_LF 0x0A // ASCII 10
  53. #define CHAR_0 '0'
  54. #define CHAR_9 '9'
  55. #define CHAR_NUL 0
  56. //
  57. // HTTP RPC server ID string (to be sent to the client after accept()'ing
  58. // a new ncacn_http TCP/IP connection.
  59. //
  60. #define HTTP_SERVER_ID_STR "ncacn_http/1.0"
  61. #define HTTP_SERVER_ID_STR_LEN 14
  62. typedef enum tagRPCProxyAccessType
  63. {
  64. rpcpatUnknown = 0,
  65. rpcpatDirect,
  66. rpcpatHTTPProxy
  67. } RPCProxyAccessType;
  68. //
  69. // Functions
  70. //
  71. extern unsigned int
  72. HttpMessageLength(
  73. IN char *pBuffer
  74. );
  75. extern DWORD
  76. HttpParseResponse(
  77. IN char *pBuffer
  78. );
  79. extern BOOL
  80. HttpCheckRegistry(
  81. IN char *pszServer,
  82. OUT char **ppszHttpProxy,
  83. OUT char **ppszHttpProxyPort,
  84. OUT RPCProxyAccessType *AccessType
  85. );
  86. extern BOOL
  87. HttpParseNetworkOptions(
  88. IN RPC_CHAR *pNetworkOptions,
  89. IN char *pszDefaultServerName,
  90. OUT char **pszRpcProxy,
  91. OUT char **pszRpcProxyPort,
  92. IN BOOL UseSSLProxyPortAsDefault,
  93. OUT char **pszHttpProxy,
  94. OUT char **pszHttpProxyPort,
  95. OUT RPCProxyAccessType *AccessType,
  96. OUT DWORD *pdwStatus
  97. );
  98. extern BOOL
  99. HttpTunnelToRpcProxy(
  100. SOCKET Socket,
  101. char *pszRpcProxy,
  102. char *pszRpcProxyPort
  103. );
  104. extern BOOL
  105. HttpTunnelToRpcServer(
  106. SOCKET Socket,
  107. char *pszRpcServer,
  108. char *pszRpcServerPort
  109. );
  110. #endif // __HTTPTRAN_HXX__