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.

148 lines
2.6 KiB

  1. /*++
  2. Copyright (c) 1998 Microsoft Corporation
  3. Module Name:
  4. iislbs.hxx
  5. Abstract:
  6. Definition of Load balancing structures
  7. Author:
  8. Philippe Choquier (phillich)
  9. --*/
  10. #if !defined( _IISLBS_HXX )
  11. #define _IISLBS_HXX
  12. #include <iislbh.hxx>
  13. #define PERFMON_SLEEP_TIME (10*1000)
  14. #define USER_TO_KERNEL_INTERVAL (60*1000)
  15. #define STOP_PERFMON_THREAD_TIMEOUT (140*1000)
  16. class CPerfmonThreadControlBlock {
  17. public:
  18. CAllocString m_ServerName;
  19. HANDLE m_hStopEvent;
  20. };
  21. class CKernelIpMapHelper : public CKernelIpMapMinHelper {
  22. public:
  23. CKernelIpMapHelper();
  24. BOOL Init();
  25. LPWSTR GetServerName( UINT i )
  26. { return m_ServerNames.GetEntry( i ); }
  27. BOOL
  28. SetPublicIpList(
  29. CIPMap* pIpMap
  30. );
  31. BOOL
  32. StringToIpEndpoint(
  33. LPWSTR pNew,
  34. CKernelIpEndpoint* pIp
  35. );
  36. BOOL
  37. IpEndpointToString(
  38. CKernelIpEndpoint* pIp,
  39. LPWSTR pAddr,
  40. DWORD cAddr
  41. );
  42. BOOL
  43. AddServer(
  44. LPWSTR pNew
  45. );
  46. BOOL
  47. RemoveServer(
  48. UINT i
  49. );
  50. BOOL
  51. StopServerThread(
  52. DWORD iServer,
  53. DWORD dwTimeOut
  54. );
  55. BOOL
  56. StartServerThread(
  57. DWORD iServer
  58. );
  59. // private IP list management
  60. BOOL
  61. CheckAndAddPrivateIp(
  62. CKernelIpEndpoint* pEndpoint,
  63. BOOL fAddIfNotPresent,
  64. LPUINT piFound
  65. );
  66. VOID
  67. ResetPrivateIpList()
  68. { m_PrivateIpList.Reset(); }
  69. DWORD
  70. PrivateIpListCount()
  71. { return m_PrivateIpList.GetUsed() / sizeof(CKernelIpEndpoint); }
  72. BOOL
  73. EnumPrivateIpList(
  74. UINT iIndex,
  75. CKernelIpEndpoint** ppEndpoint
  76. );
  77. private:
  78. CStrPtrXBF m_ServerNames;
  79. CPtrXBF m_PerfmonThreadHandle;
  80. CPtrXBF m_PerfmonThreadStopEvent;
  81. CStoreXBF m_PrivateIpList;
  82. } ;
  83. // list of computers , load
  84. // list of public IP addresses
  85. // list of counters : as CComputerPerfCounters
  86. // array (computers)(public IP addresses->private IP address | load )
  87. // one thread per computer to query perfmon counters, wait on stop event
  88. // control block : ptr to computer name, array
  89. BOOL
  90. KernelConfigToIpList(
  91. XBF* pxbf
  92. );
  93. BOOL
  94. IpListToKernelConfig(
  95. CIPMap* pIpMap
  96. );
  97. BOOL
  98. KernelConfigToPerfmonCounters(
  99. XBF* pxbf
  100. );
  101. BOOL
  102. PerfmonCountersToKernelConfig(
  103. CComputerPerfCounters* pPerfmonCounters
  104. );
  105. extern "C" DWORD WINAPI
  106. PermonThread(
  107. LPVOID pV
  108. );
  109. extern "C" DWORD WINAPI
  110. UserToKernelThread(
  111. LPVOID pV
  112. );
  113. #endif