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.

419 lines
7.7 KiB

  1. /*++
  2. Copyright (c) 1997 Microsoft Corporation
  3. Module Name:
  4. cnetapi.h
  5. Abstract:
  6. Cluster Network driver control APIs
  7. Author:
  8. Mike Massa (mikemas) 14-Feb-1997
  9. Environment:
  10. User Mode.
  11. Revision History:
  12. --*/
  13. #ifndef _CNETAPI_INCLUDED
  14. #define _CNETAPI_INCLUDED
  15. #ifdef __cplusplus
  16. extern "C" {
  17. #endif // __cplusplus
  18. //
  19. // Join Phases
  20. //
  21. typedef enum {
  22. ClusnetJoinPhase1 = 1,
  23. ClusnetJoinPhase2 = 2,
  24. ClusnetJoinPhase3 = 3,
  25. ClusnetJoinPhase4 = 4,
  26. ClusnetJoinPhaseAbort = 0xFFFFFFFF
  27. } CLUSNET_JOIN_PHASE;
  28. //
  29. // Event Handler Routines.
  30. //
  31. typedef
  32. VOID
  33. (*CLUSNET_NODE_UP_ROUTINE)(
  34. IN CL_NODE_ID NodeId
  35. );
  36. typedef
  37. VOID
  38. (*CLUSNET_NODE_DOWN_ROUTINE)(
  39. IN CL_NODE_ID NodeId
  40. );
  41. typedef
  42. BOOL
  43. (*CLUSNET_CHECK_QUORUM_ROUTINE)(
  44. VOID
  45. );
  46. typedef
  47. VOID
  48. (*CLUSNET_HOLD_IO_ROUTINE)(
  49. VOID
  50. );
  51. typedef
  52. VOID
  53. (*CLUSNET_RESUME_IO_ROUTINE)(
  54. VOID
  55. );
  56. typedef
  57. VOID
  58. (*CLUSNET_HALT_ROUTINE)(
  59. IN DWORD HaltCode
  60. );
  61. //
  62. // Routines
  63. //
  64. HANDLE
  65. ClusnetOpenControlChannel(
  66. IN ULONG ShareAccess
  67. );
  68. #define ClusnetCloseControlChannel(_handle) CloseHandle(_handle)
  69. DWORD
  70. ClusnetEnableShutdownOnClose(
  71. IN HANDLE ControlChannel
  72. );
  73. DWORD
  74. ClusnetDisableShutdownOnClose(
  75. IN HANDLE ControlChannel
  76. );
  77. DWORD
  78. ClusnetInitialize(
  79. IN HANDLE ControlChannel,
  80. IN CL_NODE_ID LocalNodeId,
  81. IN ULONG MaxNodes,
  82. IN CLUSNET_NODE_UP_ROUTINE NodeUpRoutine,
  83. IN CLUSNET_NODE_DOWN_ROUTINE NodeDownRoutine,
  84. IN CLUSNET_CHECK_QUORUM_ROUTINE CheckQuorumRoutine,
  85. IN CLUSNET_HOLD_IO_ROUTINE HoldIoRoutine,
  86. IN CLUSNET_RESUME_IO_ROUTINE ResumeIoRoutine,
  87. IN CLUSNET_HALT_ROUTINE HaltRoutine
  88. );
  89. DWORD
  90. ClusnetShutdown(
  91. IN HANDLE ControlChannel
  92. );
  93. DWORD
  94. ClusnetRegisterNode(
  95. IN HANDLE ControlChannel,
  96. IN CL_NODE_ID NodeId
  97. );
  98. DWORD
  99. ClusnetDeregisterNode(
  100. IN HANDLE ControlChannel,
  101. IN CL_NODE_ID NodeId
  102. );
  103. DWORD
  104. ClusnetRegisterNetwork(
  105. IN HANDLE ControlChannel,
  106. IN CL_NETWORK_ID NetworkId,
  107. IN ULONG Priority
  108. );
  109. DWORD
  110. ClusnetDeregisterNetwork(
  111. IN HANDLE ControlChannel,
  112. IN CL_NETWORK_ID NetworkId
  113. );
  114. DWORD
  115. ClusnetRegisterInterface(
  116. IN HANDLE ControlChannel,
  117. IN CL_NODE_ID NodeId,
  118. IN CL_NETWORK_ID NetworkId,
  119. IN ULONG Priority,
  120. IN PVOID TdiAddress,
  121. IN ULONG TdiAddressLength
  122. );
  123. DWORD
  124. ClusnetDeregisterInterface(
  125. IN HANDLE ControlChannel,
  126. IN CL_NODE_ID NodeId,
  127. IN CL_NETWORK_ID NetworkId
  128. );
  129. DWORD
  130. ClusnetOnlineNodeComm(
  131. IN HANDLE ControlChannel,
  132. IN CL_NODE_ID NodeId
  133. );
  134. DWORD
  135. ClusnetOfflineNodeComm(
  136. IN HANDLE ControlChannel,
  137. IN CL_NODE_ID NodeId
  138. );
  139. DWORD
  140. ClusnetOnlineNetwork(
  141. IN HANDLE ControlChannel,
  142. IN CL_NETWORK_ID NetworkId,
  143. IN PWCHAR TdiProviderName,
  144. IN PVOID TdiBindAddress,
  145. IN ULONG TdiBindAddressLength,
  146. IN LPWSTR AdapterName
  147. );
  148. DWORD
  149. ClusnetOfflineNetwork(
  150. IN HANDLE ControlChannel,
  151. IN CL_NETWORK_ID NetworkId
  152. );
  153. DWORD
  154. ClusnetGetNetworkPriority(
  155. IN HANDLE ControlChannel,
  156. IN CL_NETWORK_ID NetworkId,
  157. OUT PULONG Priority
  158. );
  159. DWORD
  160. ClusnetSetNetworkPriority(
  161. IN HANDLE ControlChannel,
  162. IN CL_NETWORK_ID NetworkId,
  163. IN ULONG Priority
  164. );
  165. DWORD
  166. ClusnetGetInterfacePriority(
  167. IN HANDLE ControlChannel,
  168. IN CL_NODE_ID NodeId,
  169. IN CL_NETWORK_ID NetworkId,
  170. OUT PULONG InterfacePriority,
  171. OUT PULONG NetworkPriority
  172. );
  173. DWORD
  174. ClusnetSetInterfacePriority(
  175. IN HANDLE ControlChannel,
  176. IN CL_NODE_ID NodeId,
  177. IN CL_NETWORK_ID NetworkId,
  178. IN ULONG Priority
  179. );
  180. DWORD
  181. ClusnetGetNodeCommState(
  182. IN HANDLE ControlChannel,
  183. IN CL_NODE_ID NodeId,
  184. OUT PCLUSNET_NODE_COMM_STATE State
  185. );
  186. DWORD
  187. ClusnetGetNetworkState(
  188. IN HANDLE ControlChannel,
  189. IN CL_NETWORK_ID NetworkId,
  190. OUT PCLUSNET_NETWORK_STATE State
  191. );
  192. DWORD
  193. ClusnetGetInterfaceState(
  194. IN HANDLE ControlChannel,
  195. IN CL_NODE_ID NodeId,
  196. IN CL_NETWORK_ID NetworkId,
  197. OUT PCLUSNET_INTERFACE_STATE State
  198. );
  199. #ifdef MM_IN_CLUSNET
  200. DWORD
  201. ClusnetFormCluster(
  202. IN HANDLE ControlChannel,
  203. IN ULONG ClockPeriod,
  204. IN ULONG SendHBRate,
  205. IN ULONG RecvHBRate
  206. );
  207. DWORD
  208. ClusnetJoinCluster(
  209. IN HANDLE ControlChannel,
  210. IN CL_NODE_ID JoiningNodeId,
  211. IN CLUSNET_JOIN_PHASE Phase,
  212. IN ULONG JoinTimeout,
  213. IN OUT PVOID * MessageToSend,
  214. OUT PULONG MessageLength,
  215. OUT PULONG DestNodeMask
  216. );
  217. VOID
  218. ClusnetEndJoinCluster(
  219. IN HANDLE ControlChannel,
  220. IN PVOID LastSentMessage
  221. );
  222. DWORD
  223. ClusnetDeliverJoinMessage(
  224. IN HANDLE ControlChannel,
  225. IN PVOID Message,
  226. IN ULONG MessageLength
  227. );
  228. DWORD
  229. ClusnetLeaveCluster(
  230. IN HANDLE ControlChannel
  231. );
  232. DWORD
  233. ClusnetEvictNode(
  234. IN HANDLE ControlChannel,
  235. IN ULONG NodeId
  236. );
  237. #endif // MM_IN_CLUSNET
  238. DWORD
  239. ClusnetGetNodeMembershipState(
  240. IN HANDLE ControlChannel,
  241. IN ULONG NodeId,
  242. OUT CLUSNET_NODE_STATE * State
  243. );
  244. DWORD
  245. ClusnetSetNodeMembershipState(
  246. IN HANDLE ControlChannel,
  247. IN ULONG NodeId,
  248. IN CLUSNET_NODE_STATE State
  249. );
  250. DWORD
  251. ClusnetSetEventMask(
  252. IN HANDLE ControlChannel,
  253. IN CLUSNET_EVENT_TYPE EventMask
  254. );
  255. DWORD
  256. ClusnetGetNextEvent(
  257. IN HANDLE ControlChannel,
  258. OUT PCLUSNET_EVENT Event,
  259. IN LPOVERLAPPED Overlapped OPTIONAL
  260. );
  261. DWORD
  262. ClusnetHalt(
  263. IN HANDLE ControlChannel
  264. );
  265. DWORD
  266. ClusnetSetMemLogging(
  267. IN HANDLE ControlChannel,
  268. IN ULONG NumberOfEntires
  269. );
  270. DWORD
  271. ClusnetSendPoisonPacket(
  272. IN HANDLE ControlChannel,
  273. IN CL_NODE_ID NodeId
  274. );
  275. DWORD
  276. ClusnetSetOuterscreen(
  277. IN HANDLE ControlChannel,
  278. IN ULONG Outerscreen
  279. );
  280. DWORD
  281. ClusnetRegroupFinished(
  282. IN HANDLE ControlChannel,
  283. IN ULONG NewEpoch
  284. );
  285. DWORD
  286. ClusnetImportSecurityContexts(
  287. IN HANDLE ControlChannel,
  288. IN CL_NODE_ID JoiningNodeId,
  289. IN PWCHAR PackageName,
  290. IN ULONG SignatureSize,
  291. IN PVOID ServerContext,
  292. IN PVOID ClientContext
  293. );
  294. #if DBG
  295. //
  296. // Test routines - available in debug builds only.
  297. //
  298. DWORD
  299. ClusnetSetDebugMask(
  300. IN HANDLE ControlChannel,
  301. ULONG Mask
  302. );
  303. DWORD
  304. ClusnetOnlinePendingInterface(
  305. IN HANDLE ControlChannel,
  306. IN CL_NODE_ID NodeId,
  307. IN CL_NETWORK_ID NetworkId
  308. );
  309. DWORD
  310. ClusnetOnlineInterface(
  311. IN HANDLE ControlChannel,
  312. IN CL_NODE_ID NodeId,
  313. IN CL_NETWORK_ID NetworkId
  314. );
  315. DWORD
  316. ClusnetOfflineInterface(
  317. IN HANDLE ControlChannel,
  318. IN CL_NODE_ID NodeId,
  319. IN CL_NETWORK_ID NetworkId
  320. );
  321. DWORD
  322. ClusnetFailInterface(
  323. IN HANDLE ControlChannel,
  324. IN CL_NODE_ID NodeId,
  325. IN CL_NETWORK_ID NetworkId
  326. );
  327. DWORD
  328. ClusnetSendMmMsg(
  329. IN HANDLE ControlChannel,
  330. IN CL_NODE_ID NodeId,
  331. IN ULONG Pattern
  332. );
  333. #endif // DBG
  334. #ifdef __cplusplus
  335. }
  336. #endif // __cplusplus
  337. #endif // ndef _CNETAPI_INCLUDED