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.

242 lines
7.2 KiB

  1. /*++
  2. Copyright (c) 1996 Microsoft Corporation
  3. Module Name:
  4. ep.h
  5. Abstract:
  6. Header file for definitions and structure for the Event Processor
  7. component of the Cluster Service portion of the Windows NT Cluster project.
  8. Author:
  9. Rod Gamache (rodga) 28-Feb-1996
  10. Revision History:
  11. --*/
  12. #ifndef _EVENT_PROCESSOR_
  13. #define _EVENT_PROCESSOR_
  14. //***********************************
  15. //
  16. // Global Cluster Service definitions
  17. //
  18. //***********************************
  19. typedef DWORDLONG CLUSTER_EVENT;
  20. typedef CLUSTER_EVENT *PCLUSTER_EVENT;
  21. //
  22. // Event flags. These indicate what should be done with the Context once
  23. // the event has been dispatched.
  24. //
  25. //
  26. #define EP_DEREF_CONTEXT 0x00000001 // OmDereferenceObject(Context)
  27. #define EP_FREE_CONTEXT 0x00000002 // LocalFree(Context)
  28. #define EP_CONTEXT_VALID 0x00000004
  29. typedef
  30. DWORD
  31. (WINAPI *PEVENT_ROUTINE) (
  32. IN CLUSTER_EVENT Event,
  33. IN PVOID Context
  34. );
  35. DWORD
  36. WINAPI
  37. EpInitialize(
  38. VOID
  39. );
  40. DWORD EpInitPhase1();
  41. DWORD EpIfnitPhase1();
  42. VOID
  43. EpShutdown(
  44. VOID
  45. );
  46. DWORD
  47. WINAPI
  48. EpPostEvent(
  49. IN CLUSTER_EVENT Event,
  50. IN DWORD Flags,
  51. IN PVOID Context
  52. );
  53. DWORD
  54. WINAPI
  55. EpPostSyncEvent(
  56. IN CLUSTER_EVENT Event,
  57. IN DWORD Flags,
  58. IN PVOID Context
  59. );
  60. DWORD
  61. WINAPI
  62. EpRegisterSyncEventHandler(
  63. IN CLUSTER_EVENT EventMask,
  64. IN PEVENT_ROUTINE EventRoutine
  65. );
  66. DWORD
  67. WINAPI
  68. EpRegisterEventHandler(
  69. IN CLUSTER_EVENT EventMask,
  70. IN PEVENT_ROUTINE EventRoutine
  71. );
  72. DWORD
  73. WINAPI
  74. EpClusterWidePostEvent(
  75. IN CLUSTER_EVENT Event,
  76. IN DWORD dwFlags,
  77. IN PVOID Context,
  78. IN DWORD ContextSize
  79. );
  80. #define ClusterEvent(Event, pObject) EpPostEvent(Event, 0, pObject)
  81. #define ClusterEventEx(Event, Flags, Context) \
  82. EpPostEvent(Event, Flags, Context)
  83. #define ClusterSyncEventEx(Event, Flags, Context) \
  84. EpPostSyncEvent(Event, Flags, Context)
  85. #define ClusterWideEvent(Event, pObject) \
  86. EpClusterWidePostEvent(Event, 0, pObject, 0)
  87. //if you pass in a cluster wide object pass 0 as the context
  88. //if you pass a pointer to some other data pass EP_CONTEXT_VALID
  89. //You will be responsible for cleaning up the memory for that context
  90. //i.e EP_FREE_CONTEXT is automatically added to the flag bits since this
  91. //request is GUM'ed around to different nodes and each node makes a copy
  92. //of this context and calls the local EpPostEvent. EpEventHandler then
  93. //frees that memory
  94. #define ClusterWideEventEx(Event, Flags, Context, ContextSize) \
  95. EpClusterWidePostEvent(Event, Flags, Context, ContextSize)
  96. //
  97. // Define Cluster Service states
  98. //
  99. typedef enum _CLUSTER_SERVICE_STATE {
  100. ClusterOffline,
  101. ClusterOnline,
  102. ClusterPaused
  103. } CLUSTER_SERVICE_STATE;
  104. //
  105. // Definitions for Cluster Events. These events are used both as masks and as
  106. // event identifiers within the Cluster Service. Cluster Service components
  107. // register to receive multiple events, but can deliver notification of only
  108. // one event at a time. This mask should be a CLUSTER_EVENT type. We get 64
  109. // unique event masks.
  110. //
  111. // Cluster Service Events
  112. #define CLUSTER_EVENT_ONLINE 0x0000000000000001
  113. #define CLUSTER_EVENT_SHUTDOWN 0x0000000000000002
  114. // Node Events
  115. #define CLUSTER_EVENT_NODE_UP 0x0000000000000004
  116. #define CLUSTER_EVENT_NODE_DOWN 0x0000000000000008
  117. // state change
  118. #define CLUSTER_EVENT_NODE_CHANGE 0x0000000000000010
  119. #define CLUSTER_EVENT_NODE_ADDED 0x0000000000000020
  120. #define CLUSTER_EVENT_NODE_DELETED 0x0000000000000040
  121. #define CLUSTER_EVENT_NODE_PROPERTY_CHANGE 0x0000000000000080
  122. #define CLUSTER_EVENT_NODE_JOIN 0x0000000000000100
  123. // Group Events
  124. #define CLUSTER_EVENT_GROUP_ONLINE 0x0000000000000200
  125. #define CLUSTER_EVENT_GROUP_OFFLINE 0x0000000000000400
  126. #define CLUSTER_EVENT_GROUP_FAILED 0x0000000000000800
  127. // state change
  128. #define CLUSTER_EVENT_GROUP_CHANGE 0x0000000000001000
  129. #define CLUSTER_EVENT_GROUP_ADDED 0x0000000000002000
  130. #define CLUSTER_EVENT_GROUP_DELETED 0x0000000000004000
  131. #define CLUSTER_EVENT_GROUP_PROPERTY_CHANGE 0x0000000000008000
  132. // Resource Events
  133. #define CLUSTER_EVENT_RESOURCE_ONLINE 0x0000000000010000
  134. #define CLUSTER_EVENT_RESOURCE_OFFLINE 0x0000000000020000
  135. #define CLUSTER_EVENT_RESOURCE_FAILED 0x0000000000040000
  136. // state change
  137. #define CLUSTER_EVENT_RESOURCE_CHANGE 0x0000000000080000
  138. #define CLUSTER_EVENT_RESOURCE_ADDED 0x0000000000100000
  139. #define CLUSTER_EVENT_RESOURCE_DELETED 0x0000000000200000
  140. #define CLUSTER_EVENT_RESOURCE_PROPERTY_CHANGE 0x0000000000400000
  141. // Resource Type Events
  142. #define CLUSTER_EVENT_RESTYPE_ADDED 0x0000000000800000
  143. #define CLUSTER_EVENT_RESTYPE_DELETED 0x0000000001000000
  144. #define CLUSTER_EVENT_PROPERTY_CHANGE 0x0000000002000000
  145. #define CLUSTER_EVENT_NETWORK_UNAVAILABLE 0x0000000004000000
  146. #define CLUSTER_EVENT_NETWORK_DOWN 0x0000000008000000
  147. #define CLUSTER_EVENT_NETWORK_PARTITIONED 0x0000000010000000
  148. #define CLUSTER_EVENT_NETWORK_UP 0x0000000020000000
  149. #define CLUSTER_EVENT_NETWORK_PROPERTY_CHANGE 0x0000000040000000
  150. #define CLUSTER_EVENT_NETWORK_ADDED 0x0000000080000000
  151. #define CLUSTER_EVENT_NETWORK_DELETED 0x0000000100000000
  152. #define CLUSTER_EVENT_NETINTERFACE_UNAVAILABLE 0x0000000200000000
  153. #define CLUSTER_EVENT_NETINTERFACE_FAILED 0x0000000400000000
  154. #define CLUSTER_EVENT_NETINTERFACE_UNREACHABLE 0x0000000800000000
  155. #define CLUSTER_EVENT_NETINTERFACE_UP 0x0000001000000000
  156. #define CLUSTER_EVENT_NETINTERFACE_PROPERTY_CHANGE 0x0000002000000000
  157. #define CLUSTER_EVENT_NETINTERFACE_ADDED 0x0000004000000000
  158. #define CLUSTER_EVENT_NETINTERFACE_DELETED 0x0000008000000000
  159. #define CLUSTER_EVENT_NODE_DOWN_EX 0x0000010000000000
  160. #define CLUSTER_EVENT_API_NODE_UP 0x0000020000000000
  161. #define CLUSTER_EVENT_API_NODE_SHUTTINGDOWN 0x0000040000000000
  162. #define CLUSTER_EVENT_RESTYPE_PROPERTY_CHANGE 0x0000080000000000
  163. // all events
  164. #define CLUSTER_EVENT_ALL 0x00000FFFFFFFFFFF
  165. //**********************************
  166. //
  167. // Local Event Processor definitions
  168. //
  169. //**********************************
  170. //
  171. // Define Event Processor states
  172. //
  173. typedef enum _EVENT_PROCESSOR_STATE {
  174. EventProcessorStateIniting,
  175. EventProcessorStateOnline,
  176. EventProcessorStateExiting
  177. } EVENT_PROCESS_STATE;
  178. //
  179. // Event Processor Dispatch Table for dispatching events
  180. //
  181. typedef struct _EVENT_DISPATCH_TABLE {
  182. CLUSTER_EVENT EventMask;
  183. PEVENT_ROUTINE EventRoutine;
  184. } EVENT_DISPATCH_TABLE, *PEVENT_DISPATCH_TABLE;
  185. #endif // _EVENT_PROCESSOR_
  186.