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.

252 lines
6.4 KiB

  1. /*++
  2. Copyright (c) 1999-2002 Microsoft Corporation
  3. Module Name:
  4. control.h
  5. Abstract:
  6. This module contains public declarations for the UL control channel.
  7. Author:
  8. Keith Moore (keithmo) 09-Feb-1999
  9. Revision History:
  10. --*/
  11. #ifndef _CONTROL_H_
  12. #define _CONTROL_H_
  13. //
  14. // The control channel
  15. //
  16. #define IS_VALID_CONTROL_CHANNEL(pControlChannel) \
  17. HAS_VALID_SIGNATURE(pControlChannel, UL_CONTROL_CHANNEL_POOL_TAG)
  18. #define IS_ACTIVE_CONTROL_CHANNEL(pControlChannel) \
  19. ( (pControlChannel) != NULL && \
  20. (pControlChannel)->InCleanUp == FALSE && \
  21. (pControlChannel)->Signature == UL_CONTROL_CHANNEL_POOL_TAG \
  22. )
  23. typedef struct _UL_CONTROL_CHANNEL
  24. {
  25. //
  26. // UL_CONTROL_CHANNEL_POOL_TAG
  27. //
  28. ULONG Signature;
  29. //
  30. // RefCounting for cgroups
  31. //
  32. LONG RefCount;
  33. //
  34. // For list of control channels.
  35. //
  36. LIST_ENTRY ControlChannelListEntry;
  37. //
  38. // Shows if this control channel is about to get closed.
  39. //
  40. BOOLEAN InCleanUp;
  41. //
  42. // All of the config groups created off this control channel
  43. //
  44. UL_NOTIFY_HEAD ConfigGroupHead;
  45. //
  46. // NOTE: The Site Counter members are protected by g_SiteCounterListMutex
  47. // All site counter blocks created off this control channel
  48. //
  49. LIST_ENTRY SiteCounterHead;
  50. //
  51. // Number of Site Counters on list
  52. //
  53. LONG SiteCounterCount;
  54. //
  55. // The current state
  56. //
  57. HTTP_ENABLED_STATE State;
  58. //
  59. // Demand Start Threshold -- limit the completion of demand start
  60. // Irps if the number of UL_APP_POOL_PROCESSes exceed this limit
  61. //
  62. ULONG DemandStartThreshold;
  63. //
  64. // The current count of non-Controller App Pool Processes associated
  65. // with this control channel.
  66. //
  67. ULONG AppPoolProcessCount;
  68. //
  69. // The global Bandwidth throttling limit (if it exists)
  70. //
  71. HTTP_BANDWIDTH_LIMIT MaxBandwidth;
  72. //
  73. // All of the qos flows created off this control channel.
  74. //
  75. LIST_ENTRY FlowListHead;
  76. //
  77. // Shows if Utf8 Logging is on or off
  78. //
  79. HTTP_CONTROL_CHANNEL_UTF8_LOGGING UTF8Logging;
  80. //
  81. // Logging config for binary format
  82. //
  83. HTTP_CONTROL_CHANNEL_BINARY_LOGGING BinaryLoggingConfig;
  84. //
  85. // Corresponding global binary log file entry
  86. //
  87. PUL_BINARY_LOG_FILE_ENTRY pBinaryLogEntry;
  88. //
  89. // Note, filter channel information is stored in a separate data
  90. // structure instead of here so that ultdi can query it when it
  91. // creates new endpoints.
  92. //
  93. } UL_CONTROL_CHANNEL, *PUL_CONTROL_CHANNEL;
  94. VOID
  95. UlReferenceControlChannel(
  96. IN PUL_CONTROL_CHANNEL pControlChannel
  97. REFERENCE_DEBUG_FORMAL_PARAMS
  98. );
  99. #define REFERENCE_CONTROL_CHANNEL( pControlChannel ) \
  100. UlReferenceControlChannel( \
  101. (pControlChannel) \
  102. REFERENCE_DEBUG_ACTUAL_PARAMS \
  103. )
  104. VOID
  105. UlDereferenceControlChannel(
  106. IN PUL_CONTROL_CHANNEL pControlChannel
  107. REFERENCE_DEBUG_FORMAL_PARAMS
  108. );
  109. #define DEREFERENCE_CONTROL_CHANNEL( pControlChannel ) \
  110. UlDereferenceControlChannel( \
  111. (pControlChannel) \
  112. REFERENCE_DEBUG_ACTUAL_PARAMS \
  113. )
  114. //
  115. // Initialize/terminate functions.
  116. //
  117. NTSTATUS
  118. UlInitializeControlChannel(
  119. VOID
  120. );
  121. VOID
  122. UlTerminateControlChannel(
  123. VOID
  124. );
  125. //
  126. // Open a new control channel.
  127. //
  128. NTSTATUS
  129. UlCreateControlChannel(
  130. OUT PUL_CONTROL_CHANNEL *ppControlChannel
  131. );
  132. VOID
  133. UlCleanUpControlChannel(
  134. IN PUL_CONTROL_CHANNEL pControlChannel
  135. );
  136. VOID
  137. UlCloseControlChannel(
  138. IN PUL_CONTROL_CHANNEL pControlChannel
  139. );
  140. NTSTATUS
  141. UlSetControlChannelInformation(
  142. IN PUL_CONTROL_CHANNEL pControlChannel,
  143. IN HTTP_CONTROL_CHANNEL_INFORMATION_CLASS InformationClass,
  144. IN PVOID pControlChannelInformation,
  145. IN ULONG Length,
  146. IN KPROCESSOR_MODE RequestorMode
  147. );
  148. NTSTATUS
  149. UlGetControlChannelInformation(
  150. IN KPROCESSOR_MODE RequestorMode,
  151. IN PUL_CONTROL_CHANNEL pControlChannel,
  152. IN HTTP_CONTROL_CHANNEL_INFORMATION_CLASS InformationClass,
  153. IN PVOID pControlChannelInformation,
  154. IN ULONG Length,
  155. OUT PULONG pReturnLength
  156. );
  157. NTSTATUS
  158. UlGetControlChannelFromHandle(
  159. IN HANDLE ControlChannel,
  160. IN KPROCESSOR_MODE AccessMode,
  161. OUT PUL_CONTROL_CHANNEL * ppControlChannel
  162. );
  163. /***************************************************************************++
  164. Routine Description:
  165. Small utility to check whether binary logging is disabled or not
  166. on the control channel.
  167. --***************************************************************************/
  168. __inline
  169. BOOLEAN
  170. UlBinaryLoggingEnabled(
  171. IN PUL_CONTROL_CHANNEL pControlChannel
  172. )
  173. {
  174. if (pControlChannel &&
  175. pControlChannel->BinaryLoggingConfig.Flags.Present &&
  176. pControlChannel->BinaryLoggingConfig.LoggingEnabled &&
  177. pControlChannel->pBinaryLogEntry)
  178. {
  179. ASSERT(IS_VALID_CONTROL_CHANNEL(pControlChannel));
  180. ASSERT(IS_VALID_BINARY_LOG_FILE_ENTRY(
  181. pControlChannel->pBinaryLogEntry));
  182. return TRUE;
  183. }
  184. else
  185. {
  186. return FALSE;
  187. }
  188. }
  189. #define BWT_ENABLED_FOR_CONTROL_CHANNEL(pControlChannel) \
  190. ((pControlChannel) != NULL && \
  191. (pControlChannel)->MaxBandwidth != HTTP_LIMIT_INFINITE)
  192. #endif // _CONTROL_H_