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.

470 lines
9.5 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 EventEpoch,
  297. IN ULONG RegroupEpoch
  298. );
  299. DWORD
  300. ClusnetImportSecurityContexts(
  301. IN HANDLE ControlChannel,
  302. IN CL_NODE_ID JoiningNodeId,
  303. IN PWCHAR PackageName,
  304. IN ULONG SignatureSize,
  305. IN PVOID ServerContext,
  306. IN PVOID ClientContext
  307. );
  308. DWORD
  309. ClusnetReserveEndpoint(
  310. IN HANDLE ControlChannel,
  311. IN PWSTR EndpointString
  312. );
  313. DWORD
  314. ClusnetConfigureMulticast(
  315. IN HANDLE ControlChannel,
  316. IN CL_NETWORK_ID NetworkId,
  317. IN ULONG MulticastNetworkBrand,
  318. IN PVOID MulticastAddress,
  319. IN ULONG MulticastAddressLength,
  320. IN PVOID Key,
  321. IN ULONG KeyLength
  322. );
  323. DWORD
  324. ClusnetGetMulticastReachableSet(
  325. IN HANDLE ControlChannel,
  326. IN CL_NETWORK_ID NetworkId,
  327. OUT ULONG * NodeScreen
  328. );
  329. DWORD
  330. ClusnetSetIamaliveParam(
  331. IN HANDLE ControlChannel,
  332. IN ULONG TimeoutTicks,
  333. IN ClussvcHangAction Action
  334. );
  335. DWORD
  336. ClusnetIamalive(
  337. IN HANDLE ControlChannel
  338. );
  339. #if DBG
  340. //
  341. // Test routines - available in debug builds only.
  342. //
  343. DWORD
  344. ClusnetSetDebugMask(
  345. IN HANDLE ControlChannel,
  346. ULONG Mask
  347. );
  348. DWORD
  349. ClusnetOnlinePendingInterface(
  350. IN HANDLE ControlChannel,
  351. IN CL_NODE_ID NodeId,
  352. IN CL_NETWORK_ID NetworkId
  353. );
  354. DWORD
  355. ClusnetOnlineInterface(
  356. IN HANDLE ControlChannel,
  357. IN CL_NODE_ID NodeId,
  358. IN CL_NETWORK_ID NetworkId
  359. );
  360. DWORD
  361. ClusnetOfflineInterface(
  362. IN HANDLE ControlChannel,
  363. IN CL_NODE_ID NodeId,
  364. IN CL_NETWORK_ID NetworkId
  365. );
  366. DWORD
  367. ClusnetFailInterface(
  368. IN HANDLE ControlChannel,
  369. IN CL_NODE_ID NodeId,
  370. IN CL_NETWORK_ID NetworkId
  371. );
  372. DWORD
  373. ClusnetSendMmMsg(
  374. IN HANDLE ControlChannel,
  375. IN CL_NODE_ID NodeId,
  376. IN ULONG Pattern
  377. );
  378. #endif // DBG
  379. #ifdef __cplusplus
  380. }
  381. #endif // __cplusplus
  382. #endif // ndef _CNETAPI_INCLUDED