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.

364 lines
6.0 KiB

  1. /*++
  2. Copyright (c) 1996 Microsoft Corporation
  3. Module Name:
  4. nm.h
  5. Abstract:
  6. Public interface definitions for the Node Manager component.
  7. Author:
  8. Mike Massa (mikemas) 12-Mar-1996
  9. Revision History:
  10. --*/
  11. #ifndef _NM_INCLUDED
  12. #define _NM_INCLUDED
  13. //
  14. // Types
  15. //
  16. typedef struct _NM_NODE *PNM_NODE;
  17. typedef struct _NM_NETWORK *PNM_NETWORK;
  18. typedef struct _NM_INTERFACE *PNM_INTERFACE;
  19. //the callback registered for object notifications
  20. typedef DWORD (WINAPI *NM_FIXUP_NOTIFYCB)(
  21. IN DWORD dwFixupType,
  22. OUT PVOID *ppPropertyList,
  23. OUT LPDWORD pdwPropertyListSize,
  24. OUT LPWSTR * szKeyName
  25. );
  26. //
  27. // Data
  28. //
  29. #define NM_DEFAULT_NODE_LIMIT 2 // This is the default if
  30. // MaxNodesInCluster is not set
  31. #define NM_FORM_FIXUP 1
  32. #define NM_JOIN_FIXUP 2
  33. extern ULONG NmMaxNodes;
  34. extern CL_NODE_ID NmMaxNodeId;
  35. extern CL_NODE_ID NmLocalNodeId;
  36. extern PNM_NODE NmLocalNode;
  37. extern WCHAR NmLocalNodeName[];
  38. extern WCHAR NmLocalNodeIdString[];
  39. extern HANDLE NmClusnetHandle;
  40. extern BOOL NmLocalNodeVersionChanged;
  41. extern RESUTIL_PROPERTY_ITEM NmJoinFixupSDProperties[];
  42. extern RESUTIL_PROPERTY_ITEM NmJoinFixupWINSProperties[];
  43. extern RESUTIL_PROPERTY_ITEM NmJoinFixupDHCPProperties[];
  44. extern RESUTIL_PROPERTY_ITEM NmJoinFixupSMTPProperties[];
  45. extern RESUTIL_PROPERTY_ITEM NmJoinFixupNNTPProperties[];
  46. extern RESUTIL_PROPERTY_ITEM NmJoinFixupIISProperties[];
  47. extern RESUTIL_PROPERTY_ITEM NmJoinFixupNewMSMQProperties[];
  48. extern RESUTIL_PROPERTY_ITEM NmJoinFixupMSDTCProperties[];
  49. extern RESUTIL_PROPERTY_ITEM NmFixupVersionInfo[];
  50. extern RESUTIL_PROPERTY_ITEM NmFixupClusterProperties[];
  51. //
  52. // Macros
  53. //
  54. #define NmIsValidNodeId(_id) ( ((_id) >= ClusterMinNodeId) && \
  55. ((_id) <= NmMaxNodeId) )
  56. //
  57. // Init/Shutdown Routines
  58. //
  59. DWORD
  60. NmInitialize(
  61. VOID
  62. );
  63. VOID
  64. NmShutdown(
  65. VOID
  66. );
  67. DWORD
  68. NmFormNewCluster(
  69. VOID
  70. );
  71. DWORD
  72. NmJoinCluster(
  73. IN RPC_BINDING_HANDLE SponsorBinding
  74. );
  75. DWORD
  76. NmJoinComplete(
  77. OUT DWORD *EndSeq
  78. );
  79. VOID
  80. NmLeaveCluster(
  81. VOID
  82. );
  83. DWORD
  84. NmCreateNodeBindings(
  85. IN LPCWSTR lpszNodeId,
  86. IN LPCWSTR SponsorNetworkId
  87. );
  88. BOOL
  89. NmCreateActiveNodeBindingsCallback(
  90. IN PVOID Context1,
  91. IN PVOID Context2,
  92. IN PVOID Object,
  93. IN LPCWSTR Name
  94. );
  95. DWORD
  96. NmJoinNodeToCluster(
  97. CL_NODE_ID JoiningNodeId
  98. );
  99. VOID
  100. NmTimerTick(
  101. IN DWORD MsTickInterval
  102. );
  103. DWORD
  104. NmGetJoinSequence(
  105. VOID
  106. );
  107. DWORD NmGetClusterOperationalVersion(
  108. OUT LPDWORD pdwClusterHighestVersion,
  109. OUT LPDWORD pdwClusterLowestVersion,
  110. OUT LPDWORD pdwFlags
  111. );
  112. //
  113. // Node Object Management Routines
  114. //
  115. PNM_NODE
  116. NmReferenceNodeById(
  117. IN DWORD NodeId
  118. );
  119. CLUSTER_NODE_STATE
  120. NmGetNodeState(
  121. IN PNM_NODE Node
  122. );
  123. DWORD
  124. NmPauseNode(
  125. IN PNM_NODE Node
  126. );
  127. DWORD
  128. NmResumeNode(
  129. IN PNM_NODE Node
  130. );
  131. DWORD
  132. NmEvictNode(
  133. IN PNM_NODE Node
  134. );
  135. VOID
  136. NmAdviseNodeFailure(
  137. IN DWORD NodeId,
  138. IN DWORD ErrorCode
  139. );
  140. DWORD
  141. NmEnumNodeInterfaces(
  142. IN PNM_NODE Node,
  143. OUT LPDWORD InterfaceCount,
  144. OUT PNM_INTERFACE * InterfaceList[]
  145. );
  146. DWORD
  147. NmGetNodeId(
  148. IN PNM_NODE Node
  149. );
  150. DWORD
  151. NmGetCurrentNumberOfNodes(
  152. void
  153. );
  154. DWORD
  155. NmGetMaxNodeId(
  156. );
  157. PNM_NODE
  158. NmReferenceJoinerNode(
  159. IN DWORD JoinerSequence,
  160. IN CL_NODE_ID NodeId
  161. );
  162. VOID
  163. NmDereferenceJoinerNode(
  164. PNM_NODE JoinerNode
  165. );
  166. DWORD
  167. WINAPI
  168. NmNodeControl(
  169. IN PNM_NODE Node,
  170. IN PNM_NODE HostNode OPTIONAL,
  171. IN DWORD ControlCode,
  172. IN PUCHAR InBuffer,
  173. IN DWORD InBufferSize,
  174. OUT PUCHAR OutBuffer,
  175. IN DWORD OutBufferSize,
  176. OUT LPDWORD BytesReturned,
  177. OUT LPDWORD Required
  178. );
  179. //
  180. // Network Object Management Routines
  181. //
  182. CLUSTER_NETWORK_STATE
  183. NmGetNetworkState(
  184. IN PNM_NETWORK Network
  185. );
  186. DWORD
  187. NmSetNetworkName(
  188. IN PNM_NETWORK Network,
  189. IN LPCWSTR Name
  190. );
  191. DWORD
  192. NmSetNetworkPriorityOrder(
  193. IN DWORD NetworkCount,
  194. IN LPWSTR * NetworkIdList
  195. );
  196. DWORD
  197. NmEnumInternalNetworks(
  198. OUT LPDWORD NetworkCount,
  199. OUT PNM_NETWORK * NetworkList[]
  200. );
  201. DWORD
  202. NmEnumNetworkInterfaces(
  203. IN PNM_NETWORK Network,
  204. OUT LPDWORD InterfaceCount,
  205. OUT PNM_INTERFACE * InterfaceList[]
  206. );
  207. DWORD
  208. WINAPI
  209. NmNetworkControl(
  210. IN PNM_NETWORK Network,
  211. IN PNM_NODE HostNode OPTIONAL,
  212. IN DWORD ControlCode,
  213. IN PUCHAR InBuffer,
  214. IN DWORD InBufferSize,
  215. OUT PUCHAR OutBuffer,
  216. IN DWORD OutBufferSize,
  217. OUT LPDWORD BytesReturned,
  218. OUT LPDWORD Required
  219. );
  220. //
  221. // Interface Object Management Routines
  222. //
  223. CLUSTER_NETINTERFACE_STATE
  224. NmGetInterfaceState(
  225. IN PNM_INTERFACE Interface
  226. );
  227. DWORD
  228. NmGetInterfaceForNodeAndNetwork(
  229. IN LPCWSTR NodeName,
  230. IN LPCWSTR NetworkName,
  231. OUT LPWSTR * InterfaceName
  232. );
  233. DWORD
  234. WINAPI
  235. NmInterfaceControl(
  236. IN PNM_INTERFACE Interface,
  237. IN PNM_NODE HostNode OPTIONAL,
  238. IN DWORD ControlCode,
  239. IN PUCHAR InBuffer,
  240. IN DWORD InBufferSize,
  241. OUT PUCHAR OutBuffer,
  242. IN DWORD OutBufferSize,
  243. OUT LPDWORD BytesReturned,
  244. OUT LPDWORD Required
  245. );
  246. DWORD NmPerformFixups(
  247. IN DWORD dwFixupType
  248. );
  249. DWORD
  250. NmFixupNotifyCb(VOID);
  251. //
  252. // PnP Routines
  253. //
  254. VOID
  255. NmPostPnpEvent(
  256. IN CLUSNET_EVENT_TYPE EventType,
  257. IN DWORD Context1,
  258. IN DWORD Context2
  259. );
  260. //
  261. // Connectoid related routines
  262. //
  263. VOID
  264. NmCloseConnectoidAdviseSink(
  265. VOID
  266. );
  267. DWORD
  268. NmGetNodeHighestVersion(
  269. IN PNM_NODE Node
  270. );
  271. DWORD
  272. NmSetExtendedNodeState(
  273. IN CLUSTER_NODE_STATE State
  274. );
  275. CLUSTER_NODE_STATE
  276. NmGetExtendedNodeState(
  277. IN PNM_NODE Node
  278. );
  279. //
  280. // Intracluster RPC Monitoring and cancellation routines
  281. //
  282. VOID NmStartRpc(
  283. IN DWORD NodeId
  284. );
  285. VOID NmEndRpc(
  286. IN DWORD NodeId
  287. );
  288. // RPC ext error info dumping routine
  289. VOID NmDumpRpcExtErrorInfo(
  290. RPC_STATUS status
  291. );
  292. #endif // _NM_INCLUDED
  293.