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.

235 lines
6.5 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. #define ClusterWideEventEx(Event, Flags, Context, ContextSize) \
  88. EpClusterWidePostEvent(Event, Flags, Context, ContextSize)
  89. //
  90. // Define Cluster Service states
  91. //
  92. typedef enum _CLUSTER_SERVICE_STATE {
  93. ClusterOffline,
  94. ClusterOnline,
  95. ClusterPaused
  96. } CLUSTER_SERVICE_STATE;
  97. //
  98. // Definitions for Cluster Events. These events are used both as masks and as
  99. // event identifiers within the Cluster Service. Cluster Service components
  100. // register to receive multiple events, but can deliver notification of only
  101. // one event at a time. This mask should be a CLUSTER_EVENT type. We get 64
  102. // unique event masks.
  103. //
  104. // Cluster Service Events
  105. #define CLUSTER_EVENT_ONLINE 0x0000000000000001
  106. #define CLUSTER_EVENT_SHUTDOWN 0x0000000000000002
  107. // Node Events
  108. #define CLUSTER_EVENT_NODE_UP 0x0000000000000004
  109. #define CLUSTER_EVENT_NODE_DOWN 0x0000000000000008
  110. // state change
  111. #define CLUSTER_EVENT_NODE_CHANGE 0x0000000000000010
  112. #define CLUSTER_EVENT_NODE_ADDED 0x0000000000000020
  113. #define CLUSTER_EVENT_NODE_DELETED 0x0000000000000040
  114. #define CLUSTER_EVENT_NODE_PROPERTY_CHANGE 0x0000000000000080
  115. #define CLUSTER_EVENT_NODE_JOIN 0x0000000000000100
  116. // Group Events
  117. #define CLUSTER_EVENT_GROUP_ONLINE 0x0000000000000200
  118. #define CLUSTER_EVENT_GROUP_OFFLINE 0x0000000000000400
  119. #define CLUSTER_EVENT_GROUP_FAILED 0x0000000000000800
  120. // state change
  121. #define CLUSTER_EVENT_GROUP_CHANGE 0x0000000000001000
  122. #define CLUSTER_EVENT_GROUP_ADDED 0x0000000000002000
  123. #define CLUSTER_EVENT_GROUP_DELETED 0x0000000000004000
  124. #define CLUSTER_EVENT_GROUP_PROPERTY_CHANGE 0x0000000000008000
  125. // Resource Events
  126. #define CLUSTER_EVENT_RESOURCE_ONLINE 0x0000000000010000
  127. #define CLUSTER_EVENT_RESOURCE_OFFLINE 0x0000000000020000
  128. #define CLUSTER_EVENT_RESOURCE_FAILED 0x0000000000040000
  129. // state change
  130. #define CLUSTER_EVENT_RESOURCE_CHANGE 0x0000000000080000
  131. #define CLUSTER_EVENT_RESOURCE_ADDED 0x0000000000100000
  132. #define CLUSTER_EVENT_RESOURCE_DELETED 0x0000000000200000
  133. #define CLUSTER_EVENT_RESOURCE_PROPERTY_CHANGE 0x0000000000400000
  134. // Resource Type Events
  135. #define CLUSTER_EVENT_RESTYPE_ADDED 0x0000000000800000
  136. #define CLUSTER_EVENT_RESTYPE_DELETED 0x0000000001000000
  137. #define CLUSTER_EVENT_PROPERTY_CHANGE 0x0000000002000000
  138. #define CLUSTER_EVENT_NETWORK_UNAVAILABLE 0x0000000004000000
  139. #define CLUSTER_EVENT_NETWORK_DOWN 0x0000000008000000
  140. #define CLUSTER_EVENT_NETWORK_PARTITIONED 0x0000000010000000
  141. #define CLUSTER_EVENT_NETWORK_UP 0x0000000020000000
  142. #define CLUSTER_EVENT_NETWORK_PROPERTY_CHANGE 0x0000000040000000
  143. #define CLUSTER_EVENT_NETWORK_ADDED 0x0000000080000000
  144. #define CLUSTER_EVENT_NETWORK_DELETED 0x0000000100000000
  145. #define CLUSTER_EVENT_NETINTERFACE_UNAVAILABLE 0x0000000200000000
  146. #define CLUSTER_EVENT_NETINTERFACE_FAILED 0x0000000400000000
  147. #define CLUSTER_EVENT_NETINTERFACE_UNREACHABLE 0x0000000800000000
  148. #define CLUSTER_EVENT_NETINTERFACE_UP 0x0000001000000000
  149. #define CLUSTER_EVENT_NETINTERFACE_PROPERTY_CHANGE 0x0000002000000000
  150. #define CLUSTER_EVENT_NETINTERFACE_ADDED 0x0000004000000000
  151. #define CLUSTER_EVENT_NETINTERFACE_DELETED 0x0000008000000000
  152. #define CLUSTER_EVENT_NODE_DOWN_EX 0x0000010000000000
  153. #define CLUSTER_EVENT_API_NODE_UP 0x0000020000000000
  154. #define CLUSTER_EVENT_API_NODE_SHUTTINGDOWN 0x0000040000000000
  155. #define CLUSTER_EVENT_RESTYPE_PROPERTY_CHANGE 0x0000080000000000
  156. // all events
  157. #define CLUSTER_EVENT_ALL 0x00000FFFFFFFFFFF
  158. //**********************************
  159. //
  160. // Local Event Processor definitions
  161. //
  162. //**********************************
  163. //
  164. // Define Event Processor states
  165. //
  166. typedef enum _EVENT_PROCESSOR_STATE {
  167. EventProcessorStateIniting,
  168. EventProcessorStateOnline,
  169. EventProcessorStateExiting
  170. } EVENT_PROCESS_STATE;
  171. //
  172. // Event Processor Dispatch Table for dispatching events
  173. //
  174. typedef struct _EVENT_DISPATCH_TABLE {
  175. CLUSTER_EVENT EventMask;
  176. PEVENT_ROUTINE EventRoutine;
  177. } EVENT_DISPATCH_TABLE, *PEVENT_DISPATCH_TABLE;
  178. #endif // _EVENT_PROCESSOR_
  179.