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.

164 lines
3.2 KiB

  1. /*++
  2. Copyright (c) 1997 Microsoft Corporation
  3. Module Name:
  4. iisbind.hxx
  5. Abstract:
  6. This include file contains the declaration of the IIS_SERVER_BINDING
  7. class. An IIS_SERVER_BINDING corresponds to a server instance binding
  8. point. Each binding point is defined by a binding descriptor. Each
  9. descriptor includes the IP port number, an optional IP address, an
  10. optional DNS host name, and a pointer to the appropriate IIS_ENDPOINT
  11. object.
  12. IIS_SERVER_BINDINGs are represented in the metabase as an array of
  13. strings descriptors (MULTISZ_METADATA). Each string describes a single
  14. IIS_SERVER_BINDING. These strings have the following format:
  15. "ip_address:ip_port:host_name"
  16. Where:
  17. ip_address - The IP address (optional).
  18. ip_port - The IP port (required).
  19. host_name - The host name (optinal).
  20. Examples:
  21. ":80:" -> Any IP address, port 80, any host name.
  22. ":80:foo.com" -> Any IP address, port 80, host "foo.com".
  23. "1.2.3.4:80:" -> IP address 1.2.3.4, port 80, any host name.
  24. "1.2.3.4:80:foo.com" -> IP address 1.2.3.4, port 80, host "foo.com".
  25. Author:
  26. Keith Moore (keithmo) 16-Jan-1997
  27. Revision History:
  28. --*/
  29. #ifndef _IISBIND_HXX_
  30. #define _IISBIND_HXX_
  31. //
  32. // Get the dependent include files.
  33. //
  34. #include <iistypes.hxx>
  35. #include <iisendp.hxx>
  36. class IIS_SERVER_BINDING {
  37. public:
  38. //
  39. // Usual constructor/destructor stuff.
  40. //
  41. dllexp
  42. IIS_SERVER_BINDING(
  43. IN DWORD IpAddress,
  44. IN USHORT IpPort,
  45. IN const CHAR * HostName,
  46. IN PIIS_ENDPOINT Endpoint
  47. );
  48. dllexp
  49. ~IIS_SERVER_BINDING();
  50. //
  51. // This static function parses a binding descriptor string into its
  52. // individual components.
  53. //
  54. static
  55. dllexp
  56. DWORD
  57. ParseDescriptor(
  58. IN const CHAR * Descriptor,
  59. OUT LPDWORD IpAddress,
  60. OUT PUSHORT IpPort,
  61. OUT const CHAR ** HostName
  62. );
  63. //
  64. // Routines to compare the current binding with either a parsed or
  65. // unparsed descriptor.
  66. //
  67. dllexp
  68. DWORD
  69. Compare(
  70. IN const CHAR * Descriptor,
  71. OUT LPBOOL Result
  72. );
  73. dllexp
  74. BOOL
  75. Compare(
  76. IN DWORD IpAddress,
  77. IN USHORT IpPort,
  78. IN const CHAR * HostName
  79. );
  80. //
  81. // Data accessors.
  82. //
  83. dllexp
  84. DWORD
  85. QueryIpAddress() {
  86. return m_IpAddress;
  87. }
  88. dllexp
  89. USHORT
  90. QueryIpPort() {
  91. return m_IpPort;
  92. }
  93. dllexp
  94. const CHAR *
  95. QueryHostName() {
  96. return m_HostName.QueryStr();
  97. }
  98. dllexp
  99. PIIS_ENDPOINT
  100. QueryEndpoint() {
  101. return m_Endpoint;
  102. }
  103. //
  104. // Linkage onto the per-instance binding list.
  105. //
  106. LIST_ENTRY m_BindingListEntry;
  107. private:
  108. //
  109. // Private data.
  110. //
  111. DWORD m_IpAddress;
  112. USHORT m_IpPort;
  113. STR m_HostName;
  114. PIIS_ENDPOINT m_Endpoint;
  115. }; // IIS_SERVER_BINDING
  116. typedef IIS_SERVER_BINDING *PIIS_SERVER_BINDING;
  117. #endif // _IISBIND_HXX_