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.

459 lines
8.8 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. IN BOOLEAN Restricted
  109. );
  110. DWORD
  111. ClusnetDeregisterNetwork(
  112. IN HANDLE ControlChannel,
  113. IN CL_NETWORK_ID NetworkId
  114. );
  115. DWORD
  116. ClusnetRegisterInterface(
  117. IN HANDLE ControlChannel,
  118. IN CL_NODE_ID NodeId,
  119. IN CL_NETWORK_ID NetworkId,
  120. IN ULONG Priority,
  121. IN PWSTR AdapterId,
  122. IN ULONG AdapterIdLength,
  123. IN PVOID TdiAddress,
  124. IN ULONG TdiAddressLength,
  125. OUT PULONG MediaStatus
  126. );
  127. DWORD
  128. ClusnetDeregisterInterface(
  129. IN HANDLE ControlChannel,
  130. IN CL_NODE_ID NodeId,
  131. IN CL_NETWORK_ID NetworkId
  132. );
  133. DWORD
  134. ClusnetOnlineNodeComm(
  135. IN HANDLE ControlChannel,
  136. IN CL_NODE_ID NodeId
  137. );
  138. DWORD
  139. ClusnetOfflineNodeComm(
  140. IN HANDLE ControlChannel,
  141. IN CL_NODE_ID NodeId
  142. );
  143. DWORD
  144. ClusnetOnlineNetwork(
  145. IN HANDLE ControlChannel,
  146. IN CL_NETWORK_ID NetworkId,
  147. IN PWCHAR TdiProviderName,
  148. IN PVOID TdiBindAddress,
  149. IN ULONG TdiBindAddressLength,
  150. IN LPWSTR AdapterName,
  151. OUT PVOID TdiBindAddressInfo,
  152. IN PULONG TdiBindAddressInfoLength
  153. );
  154. DWORD
  155. ClusnetOfflineNetwork(
  156. IN HANDLE ControlChannel,
  157. IN CL_NETWORK_ID NetworkId
  158. );
  159. DWORD
  160. ClusnetSetNetworkRestriction(
  161. IN HANDLE ControlChannel,
  162. IN CL_NETWORK_ID NetworkId,
  163. IN BOOLEAN Restricted,
  164. IN ULONG NewPriority
  165. );
  166. DWORD
  167. ClusnetGetNetworkPriority(
  168. IN HANDLE ControlChannel,
  169. IN CL_NETWORK_ID NetworkId,
  170. OUT PULONG Priority
  171. );
  172. DWORD
  173. ClusnetSetNetworkPriority(
  174. IN HANDLE ControlChannel,
  175. IN CL_NETWORK_ID NetworkId,
  176. IN ULONG Priority
  177. );
  178. DWORD
  179. ClusnetGetInterfacePriority(
  180. IN HANDLE ControlChannel,
  181. IN CL_NODE_ID NodeId,
  182. IN CL_NETWORK_ID NetworkId,
  183. OUT PULONG InterfacePriority,
  184. OUT PULONG NetworkPriority
  185. );
  186. DWORD
  187. ClusnetSetInterfacePriority(
  188. IN HANDLE ControlChannel,
  189. IN CL_NODE_ID NodeId,
  190. IN CL_NETWORK_ID NetworkId,
  191. IN ULONG Priority
  192. );
  193. DWORD
  194. ClusnetGetNodeCommState(
  195. IN HANDLE ControlChannel,
  196. IN CL_NODE_ID NodeId,
  197. OUT PCLUSNET_NODE_COMM_STATE State
  198. );
  199. DWORD
  200. ClusnetGetNetworkState(
  201. IN HANDLE ControlChannel,
  202. IN CL_NETWORK_ID NetworkId,
  203. OUT PCLUSNET_NETWORK_STATE State
  204. );
  205. DWORD
  206. ClusnetGetInterfaceState(
  207. IN HANDLE ControlChannel,
  208. IN CL_NODE_ID NodeId,
  209. IN CL_NETWORK_ID NetworkId,
  210. OUT PCLUSNET_INTERFACE_STATE State
  211. );
  212. #ifdef MM_IN_CLUSNET
  213. DWORD
  214. ClusnetFormCluster(
  215. IN HANDLE ControlChannel,
  216. IN ULONG ClockPeriod,
  217. IN ULONG SendHBRate,
  218. IN ULONG RecvHBRate
  219. );
  220. DWORD
  221. ClusnetJoinCluster(
  222. IN HANDLE ControlChannel,
  223. IN CL_NODE_ID JoiningNodeId,
  224. IN CLUSNET_JOIN_PHASE Phase,
  225. IN ULONG JoinTimeout,
  226. IN OUT PVOID * MessageToSend,
  227. OUT PULONG MessageLength,
  228. OUT PULONG DestNodeMask
  229. );
  230. VOID
  231. ClusnetEndJoinCluster(
  232. IN HANDLE ControlChannel,
  233. IN PVOID LastSentMessage
  234. );
  235. DWORD
  236. ClusnetDeliverJoinMessage(
  237. IN HANDLE ControlChannel,
  238. IN PVOID Message,
  239. IN ULONG MessageLength
  240. );
  241. DWORD
  242. ClusnetLeaveCluster(
  243. IN HANDLE ControlChannel
  244. );
  245. DWORD
  246. ClusnetEvictNode(
  247. IN HANDLE ControlChannel,
  248. IN ULONG NodeId
  249. );
  250. #endif // MM_IN_CLUSNET
  251. DWORD
  252. ClusnetGetNodeMembershipState(
  253. IN HANDLE ControlChannel,
  254. IN ULONG NodeId,
  255. OUT CLUSNET_NODE_STATE * State
  256. );
  257. DWORD
  258. ClusnetSetNodeMembershipState(
  259. IN HANDLE ControlChannel,
  260. IN ULONG NodeId,
  261. IN CLUSNET_NODE_STATE State
  262. );
  263. DWORD
  264. ClusnetSetEventMask(
  265. IN HANDLE ControlChannel,
  266. IN CLUSNET_EVENT_TYPE EventMask
  267. );
  268. DWORD
  269. ClusnetGetNextEvent(
  270. IN HANDLE ControlChannel,
  271. OUT PCLUSNET_EVENT Event,
  272. IN LPOVERLAPPED Overlapped OPTIONAL
  273. );
  274. DWORD
  275. ClusnetHalt(
  276. IN HANDLE ControlChannel
  277. );
  278. DWORD
  279. ClusnetSetMemLogging(
  280. IN HANDLE ControlChannel,
  281. IN ULONG NumberOfEntires
  282. );
  283. DWORD
  284. ClusnetSendPoisonPacket(
  285. IN HANDLE ControlChannel,
  286. IN CL_NODE_ID NodeId
  287. );
  288. DWORD
  289. ClusnetSetOuterscreen(
  290. IN HANDLE ControlChannel,
  291. IN ULONG Outerscreen
  292. );
  293. DWORD
  294. ClusnetRegroupFinished(
  295. IN HANDLE ControlChannel,
  296. IN ULONG NewEpoch
  297. );
  298. DWORD
  299. ClusnetImportSecurityContexts(
  300. IN HANDLE ControlChannel,
  301. IN CL_NODE_ID JoiningNodeId,
  302. IN PWCHAR PackageName,
  303. IN ULONG SignatureSize,
  304. IN PVOID ServerContext,
  305. IN PVOID ClientContext
  306. );
  307. DWORD
  308. ClusnetReserveEndpoint(
  309. IN HANDLE ControlChannel,
  310. IN PWSTR EndpointString
  311. );
  312. DWORD
  313. ClusnetConfigureMulticast(
  314. IN HANDLE ControlChannel,
  315. IN CL_NETWORK_ID NetworkId,
  316. IN ULONG MulticastNetworkBrand,
  317. IN PVOID MulticastAddress,
  318. IN ULONG MulticastAddressLength,
  319. IN PVOID Key,
  320. IN ULONG KeyLength,
  321. IN PVOID Salt,
  322. IN ULONG SaltLength
  323. );
  324. DWORD
  325. ClusnetGetMulticastReachableSet(
  326. IN HANDLE ControlChannel,
  327. IN CL_NETWORK_ID NetworkId,
  328. OUT ULONG * NodeScreen
  329. );
  330. #if DBG
  331. //
  332. // Test routines - available in debug builds only.
  333. //
  334. DWORD
  335. ClusnetSetDebugMask(
  336. IN HANDLE ControlChannel,
  337. ULONG Mask
  338. );
  339. DWORD
  340. ClusnetOnlinePendingInterface(
  341. IN HANDLE ControlChannel,
  342. IN CL_NODE_ID NodeId,
  343. IN CL_NETWORK_ID NetworkId
  344. );
  345. DWORD
  346. ClusnetOnlineInterface(
  347. IN HANDLE ControlChannel,
  348. IN CL_NODE_ID NodeId,
  349. IN CL_NETWORK_ID NetworkId
  350. );
  351. DWORD
  352. ClusnetOfflineInterface(
  353. IN HANDLE ControlChannel,
  354. IN CL_NODE_ID NodeId,
  355. IN CL_NETWORK_ID NetworkId
  356. );
  357. DWORD
  358. ClusnetFailInterface(
  359. IN HANDLE ControlChannel,
  360. IN CL_NODE_ID NodeId,
  361. IN CL_NETWORK_ID NetworkId
  362. );
  363. DWORD
  364. ClusnetSendMmMsg(
  365. IN HANDLE ControlChannel,
  366. IN CL_NODE_ID NodeId,
  367. IN ULONG Pattern
  368. );
  369. #endif // DBG
  370. #ifdef __cplusplus
  371. }
  372. #endif // __cplusplus
  373. #endif // ndef _CNETAPI_INCLUDED
  374.