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.

1790 lines
39 KiB

  1. /*++
  2. Copyright (c) 1996-1999 Microsoft Corporation
  3. Module Name:
  4. nmp.h
  5. Abstract:
  6. Private interface definitions for the Node Manager component.
  7. Author:
  8. Mike Massa (mikemas) 12-Mar-1996
  9. Revision History:
  10. --*/
  11. #ifndef _NMP_INCLUDED
  12. #define _NMP_INCLUDED
  13. #define UNICODE 1
  14. #include "service.h"
  15. #include <winsock2.h>
  16. #include <clnetcfg.h>
  17. #include <bitset.h>
  18. #include <madcapcl.h>
  19. #include <time.h>
  20. //
  21. // Constants
  22. //
  23. #define LOG_CURRENT_MODULE LOG_MODULE_NM
  24. #define NM_JOIN_TIMEOUT 60000 // 60 seconds
  25. #define NM_MM_JOIN_TIMEOUT 3000 // 3 seconds
  26. #define NM_CLOCK_PERIOD 300 // 300 milliseconds
  27. #define NM_SEND_HB_RATE 4
  28. #define NM_RECV_HB_RATE 3 // Changed 2=>3 to prolong min_stage_1 ticks from 8 to 12
  29. //
  30. // Common Object Flags
  31. //
  32. #define NM_FLAG_OM_INSERTED 0x10000000
  33. #define NM_FLAG_DELETE_PENDING 0x80000000
  34. //
  35. // Miscellaneous Macros
  36. //
  37. #define NM_WCSLEN(_string) ((lstrlenW(_string) + 1) * sizeof(WCHAR))
  38. //
  39. // Common Object Management Macros
  40. //
  41. #define NM_OM_INSERTED(obj) ((obj)->Flags & NM_FLAG_OM_INSERTED)
  42. #define NM_DELETE_PENDING(obj) ((obj)->Flags & NM_FLAG_DELETE_PENDING)
  43. #define NM_FREE_OBJECT_FIELD(_object, _field) \
  44. if ( (_object)->_field != NULL ) \
  45. LocalFree( (_object)->_field )
  46. #define NM_MIDL_FREE_OBJECT_FIELD(_object, _field) \
  47. if ( (_object)->_field != NULL ) { \
  48. MIDL_user_free( (_object)->_field ); \
  49. (_object)->_field = NULL; \
  50. }
  51. //
  52. // State of the NM component
  53. //
  54. // Note that the order is important. See NmpEnterApi().
  55. //
  56. typedef enum {
  57. NmStateOffline = 0,
  58. NmStateOfflinePending = 1,
  59. NmStateOnlinePending = 2,
  60. NmStateOnline = 3,
  61. } NM_STATE, *PNM_STATE;
  62. //
  63. // Node definitions
  64. //
  65. typedef struct {
  66. DWORD Status;
  67. DWORD LocalOnly;
  68. } NM_NODE_CREATE_CONTEXT, *PNM_NODE_CREATE_CONTEXT;
  69. typedef struct _NM_NODE {
  70. LIST_ENTRY Linkage;
  71. DWORD NodeId;
  72. CLUSTER_NODE_STATE State;
  73. CLUSTER_NODE_STATE ExtendedState;
  74. DWORD Flags;
  75. DWORD InterfaceCount;
  76. LIST_ENTRY InterfaceList;
  77. DWORD HighestVersion;
  78. DWORD LowestVersion;
  79. RPC_BINDING_HANDLE ReportRpcBinding; // for net connectivity reports
  80. RPC_BINDING_HANDLE IsolateRpcBinding; // for net failure isolation
  81. SUITE_TYPE ProductSuite;
  82. DWORD DefaultRpcBindingGeneration;
  83. } NM_NODE;
  84. #define NM_NODE_SIG 'edon'
  85. typedef struct _NM_NODE_AUX_INFO{
  86. DWORD dwSize;
  87. DWORD dwVer;
  88. SUITE_TYPE ProductSuite;
  89. }NM_NODE_AUX_INFO, *PNM_NODE_AUX_INFO;
  90. typedef struct {
  91. LPCWSTR NodeId;
  92. HLOCALXSACTION Xaction;
  93. DWORD Status;
  94. } NM_EVICTION_CONTEXT, *PNM_EVICTION_CONTEXT;
  95. #define NM_NODE_UP(node) \
  96. ( ( (node)->State == ClusterNodeUp ) || \
  97. ( (node)->State == ClusterNodePaused ) )
  98. //
  99. // Network definitions
  100. //
  101. typedef struct _NM_STATE_WORK_ENTRY {
  102. NM_STATE_ENTRY State;
  103. DWORD ReachableCount;
  104. } NM_STATE_WORK_ENTRY, *PNM_STATE_WORK_ENTRY;
  105. typedef PNM_STATE_WORK_ENTRY PNM_STATE_WORK_VECTOR;
  106. typedef PNM_STATE_ENTRY PNM_CONNECTIVITY_MATRIX;
  107. #define NM_SIZEOF_CONNECTIVITY_MATRIX(_VectorSize) \
  108. (sizeof(NM_STATE_ENTRY) * _VectorSize *_VectorSize)
  109. #define NM_NEXT_CONNECTIVITY_MATRIX_ROW(_CurrentRowPtr, _VectorSize) \
  110. (_CurrentRowPtr + (_VectorSize * sizeof(NM_STATE_ENTRY)))
  111. #define NM_GET_CONNECTIVITY_MATRIX_ROW(_MatrixPtr, _RowNumber, _VectorSize) \
  112. (_MatrixPtr + (_RowNumber * (_VectorSize * sizeof(NM_STATE_ENTRY))))
  113. #define NM_GET_CONNECTIVITY_MATRIX_ENTRY( \
  114. _MatrixPtr, \
  115. _RowNumber, \
  116. _ColNumber, \
  117. _VectorSize \
  118. ) \
  119. ( _MatrixPtr + \
  120. (_RowNumber * (_VectorSize * sizeof(NM_STATE_ENTRY))) + \
  121. (_ColNumber * sizeof(NM_STATE_ENTRY)) \
  122. )
  123. typedef struct _NM_NETWORK {
  124. LIST_ENTRY Linkage;
  125. CL_NETWORK_ID ShortId;
  126. CLUSTER_NETWORK_STATE State;
  127. DWORD Flags;
  128. CLUSTER_NETWORK_ROLE Role;
  129. DWORD Priority;
  130. LPWSTR Transport;
  131. LPWSTR Address;
  132. LPWSTR AddressMask;
  133. LPWSTR Description;
  134. LPWSTR MulticastAddress;
  135. PVOID MulticastKey;
  136. DWORD MulticastKeyLength;
  137. PVOID MulticastKeySalt;
  138. DWORD MulticastKeySaltLength;
  139. time_t MulticastLeaseObtained;
  140. time_t MulticastLeaseExpires;
  141. MCAST_CLIENT_UID MulticastLeaseRequestId;
  142. LPWSTR MulticastLeaseServer;
  143. DWORD InterfaceCount;
  144. PNM_INTERFACE LocalInterface;
  145. PNM_CONNECTIVITY_VECTOR ConnectivityVector;
  146. PNM_CONNECTIVITY_MATRIX ConnectivityMatrix;
  147. PNM_STATE_WORK_VECTOR StateWorkVector;
  148. DWORD ConnectivityReportTimer;
  149. DWORD StateRecalcTimer;
  150. DWORD FailureIsolationTimer;
  151. DWORD RegistrationRetryTimer;
  152. DWORD RegistrationRetryTimeout;
  153. DWORD McastAddressRenewTimer;
  154. DWORD McastAddressReleaseRetryTimer;
  155. DWORD McastAddressReconfigureRetryTimer;
  156. DWORD ConnectivityReportRetryCount;
  157. CLRTL_WORK_ITEM WorkItem;
  158. CLRTL_WORK_ITEM MadcapWorkItem;
  159. LIST_ENTRY McastAddressReleaseList;
  160. LIST_ENTRY InterfaceList;
  161. LIST_ENTRY InternalLinkage;
  162. } NM_NETWORK;
  163. #define NM_NETWORK_SIG 'ten'
  164. //
  165. // State flags
  166. //
  167. #define NM_FLAG_NET_WORKER_RUNNING 0x00000001
  168. #define NM_FLAG_NET_REGISTERED 0x00000002
  169. #define NM_FLAG_NET_MULTICAST_ENABLED 0x00000004
  170. #define NM_FLAG_NET_MADCAP_WORKER_RUNNING 0x00000008
  171. //
  172. // Work Flags
  173. //
  174. #define NM_FLAG_NET_REPORT_LOCAL_IF_UP 0x00000100
  175. #define NM_FLAG_NET_REPORT_CONNECTIVITY 0x00000200
  176. #define NM_FLAG_NET_RECALC_STATE 0x00000400
  177. #define NM_FLAG_NET_ISOLATE_FAILURE 0x00000800
  178. #define NM_FLAG_NET_NEED_TO_REGISTER 0x00002000
  179. #define NM_FLAG_NET_REPORT_LOCAL_IF_FAILED 0x00004000
  180. #define NM_FLAG_NET_RENEW_MCAST_ADDRESS 0x00008000
  181. #define NM_FLAG_NET_RELEASE_MCAST_ADDRESS 0x00010000
  182. #define NM_FLAG_NET_RECONFIGURE_MCAST 0x00020000
  183. #define NM_NET_WORK_FLAGS \
  184. (NM_FLAG_NET_ISOLATE_FAILURE | \
  185. NM_FLAG_NET_RECALC_STATE | \
  186. NM_FLAG_NET_NEED_TO_REGISTER)
  187. #define NM_NET_IF_WORK_FLAGS \
  188. (NM_FLAG_NET_REPORT_LOCAL_IF_UP | \
  189. NM_FLAG_NET_REPORT_LOCAL_IF_FAILED)
  190. #define NM_NET_MADCAP_WORK_FLAGS \
  191. (NM_FLAG_NET_RENEW_MCAST_ADDRESS | \
  192. NM_FLAG_NET_RELEASE_MCAST_ADDRESS | \
  193. NM_FLAG_NET_RECONFIGURE_MCAST)
  194. #define NmpIsNetworkRegistered(_network) \
  195. ((_network)->Flags & NM_FLAG_NET_REGISTERED)
  196. #define NmpIsNetworkForInternalUse(_network) \
  197. ((_network)->Role & ClusterNetworkRoleInternalUse)
  198. #define NmpIsNetworkForClientAccess(_network) \
  199. ((_network)->Role & ClusterNetworkRoleClientAccess)
  200. #define NmpIsNetworkForInternalAndClientUse(_network) \
  201. ((_network)->Role == ClusterNetworkRoleInternalAndClient)
  202. #define NmpIsNetworkDisabledForUse(_network) \
  203. ((_network)->Role == ClusterNetworkRoleNone)
  204. #define NmpIsNetworkEnabledForUse(_network) \
  205. ((_network)->Role != ClusterNetworkRoleNone)
  206. #define NmpIsNetworkMulticastEnabled(_network) \
  207. ((_network)->Flags & NM_FLAG_NET_MULTICAST_ENABLED)
  208. //
  209. // Network deferred-work timers.
  210. //
  211. // The timer fires every 300ms. One heartbeat (HB) period is 1200ms.
  212. //
  213. // An interface is declared unreachable by ClusNet after two missed HBs.
  214. // On average, an interface will fail in the middle of a ClusNet HB period.
  215. // So, the avg time for ClusNet to detect and report an interface failure
  216. // is 600 + 2400 = 3000ms. The worst case is 1200 + 2400 = 3600ms.
  217. // The best case is 2400ms.
  218. //
  219. // If there are >2 nodes active on a network, it is desirable to
  220. // aggregate interface failure reports when an entire network fails;
  221. // however, we do not know how long it took for ClusNet to make the first
  222. // report. Thus, we assume that the first interface failure was detected
  223. // in the avg time and wait the for the worst case time before reporting.
  224. //
  225. // In the 2 node case, there is no aggregation to be performed so we report
  226. // failures immediately. We always report InterfaceUp and InterfaceFailed
  227. // events immediately. We also report immediately after a NodeDown event.
  228. //
  229. // State recalculation should be performed only after all nodes have reported
  230. // their connectivity changes after a failure. There is spread of 1200ms
  231. // between the best and worst case reporting times. Arbitrary scheduling and
  232. // communication delays can widen the spread even more in the worst case.
  233. // The best we can do is make a good guess. Once in a while, we will
  234. // recalculate too soon. This isn't a disaster since the state calculation
  235. // algorithm will abort if it has partial information. Further, we wait an
  236. // additional period before trying to isolate any connectivity failures that
  237. // were detected. We do this in order to avoid inducing unnecessary
  238. // cluster resource failures.
  239. //
  240. // Note that since we invalidate the connectivity vectors for dead nodes
  241. // after regroup, we only need to delay long enough for each of the nodes
  242. // to process the node down event and fire off a connectivity report.
  243. //
  244. #define NM_NET_CONNECTIVITY_REPORT_TIMEOUT 600 // 3600 - 3000
  245. #define NM_NET_STATE_RECALC_TIMEOUT 2400 // 3600 - 2400 + 1200
  246. #define NM_NET_STATE_RECALC_TIMEOUT_AFTER_REGROUP 900
  247. #define NM_NET_STATE_FAILURE_ISOLATION_TIMEOUT 3600
  248. #define NM_NET_STATE_FAILURE_ISOLATION_POLL 60000 // Change Default to 1 min after testing
  249. #define NM_NET_STATE_INTERFACE_FAILURE_TIMEOUT 3600
  250. #define NmpIsNetworkWorkerRunning(_network) \
  251. ((_network)->Flags & NM_FLAG_NET_WORKER_RUNNING)
  252. #define NmpIsNetworkMadcapWorkerRunning(_network) \
  253. ((_network)->Flags & NM_FLAG_NET_MADCAP_WORKER_RUNNING)
  254. #define NM_CONNECTIVITY_REPORT_RETRY_LIMIT 20 // 10 seconds
  255. #define NM_NET_MIN_REGISTRATION_RETRY_TIMEOUT 500 // half a second
  256. #define NM_NET_MAX_REGISTRATION_RETRY_TIMEOUT (10*60*1000) // 10 minutes
  257. //
  258. // Network interface definitions
  259. //
  260. typedef struct _NM_INTERFACE {
  261. LIST_ENTRY Linkage;
  262. DWORD NetIndex;
  263. DWORD Flags;
  264. CLUSTER_NETINTERFACE_STATE State;
  265. PNM_NODE Node;
  266. PNM_NETWORK Network;
  267. LPWSTR AdapterName;
  268. LPWSTR AdapterId;
  269. LPWSTR Address;
  270. ULONG BinaryAddress;
  271. LPWSTR ClusnetEndpoint;
  272. LPWSTR Description;
  273. LIST_ENTRY NetworkLinkage;
  274. LIST_ENTRY NodeLinkage;
  275. } NM_INTERFACE;
  276. #define NM_INTERFACE_SIG ' fi'
  277. #define NM_FLAG_IF_REGISTERED 0x00000002
  278. #define NmpIsInterfaceRegistered(_interface) \
  279. ((_interface)->Flags & NM_FLAG_IF_REGISTERED)
  280. //
  281. // This structure is used to hook changes in the node leadership.
  282. //
  283. typedef struct _NM_LEADER_CHANGE_WAIT_ENTRY {
  284. LIST_ENTRY Linkage;
  285. HANDLE LeaderChangeEvent;
  286. } NM_LEADER_CHANGE_WAIT_ENTRY, *PNM_LEADER_CHANGE_WAIT_ENTRY;
  287. //
  288. // This structure is used for asynchronous network connectivity reports.
  289. //
  290. typedef struct _NM_CONNECTIVITY_REPORT_CONTEXT {
  291. NM_LEADER_CHANGE_WAIT_ENTRY LeaderChangeWaitEntry;
  292. HANDLE ConnectivityReportEvent;
  293. } NM_CONNECTIVITY_REPORT_CONTEXT, *PNM_CONNECTIVITY_REPORT_CONTEXT;
  294. // the fixup callback record stored by nm on behalf of other components to perform
  295. //form or join fixups.
  296. typedef struct _NM_FIXUP_CB_RECORD{
  297. NM_FIXUP_NOTIFYCB pfnFixupNotifyCb;
  298. DWORD dwFixupMask;
  299. }NM_FIXUP_CB_RECORD,*PNM_FIXUP_CB_RECORD;
  300. //the fixup callback functions for updating in-memory structure after
  301. //updatinbg the registry
  302. typedef DWORD (WINAPI *NM_POST_FIXUP_CB)(VOID);
  303. // fixup callback record used to pass argumnets to NmUpdatePerformFixups2
  304. // update type handler
  305. typedef struct _NM_FIXUP_CB_RECORD2{
  306. NM_FIXUP_NOTIFYCB pfnFixupNotifyCb; // pointer to fn that builds up the fixup property list
  307. DWORD dwFixupMask;
  308. PRESUTIL_PROPERTY_ITEM pPropertyTable; // Property table for this key
  309. } NM_FIXUP_CB_RECORD2,*PNM_FIXUP_CB_RECORD2;
  310. //
  311. // Global Data
  312. //
  313. extern CRITICAL_SECTION NmpLock;
  314. extern HANDLE NmpMutex;
  315. extern NM_STATE NmpState;
  316. extern DWORD NmpActiveThreadCount;
  317. extern HANDLE NmpShutdownEvent;
  318. extern LIST_ENTRY NmpNodeList;
  319. extern PNM_NODE * NmpIdArray;
  320. extern BOOLEAN NmpNodeCleanupOk;
  321. extern LIST_ENTRY NmpNetworkList;
  322. extern LIST_ENTRY NmpInternalNetworkList;
  323. extern LIST_ENTRY NmpDeletedNetworkList;
  324. extern DWORD NmpNetworkCount;
  325. extern DWORD NmpInternalNetworkCount;
  326. extern DWORD NmpClientNetworkCount;
  327. extern LIST_ENTRY NmpInterfaceList;
  328. extern LIST_ENTRY NmpDeletedInterfaceList;
  329. extern RESUTIL_PROPERTY_ITEM NmpNetworkProperties[];
  330. extern RESUTIL_PROPERTY_ITEM NmpInterfaceProperties[];
  331. extern CL_NODE_ID NmpJoinerNodeId;
  332. extern CL_NODE_ID NmpSponsorNodeId;
  333. extern DWORD NmpJoinTimer;
  334. extern BOOLEAN NmpJoinAbortPending;
  335. extern DWORD NmpJoinSequence;
  336. extern BOOLEAN NmpJoinerUp;
  337. extern BOOLEAN NmpJoinBeginInProgress;
  338. extern BOOLEAN NmpJoinerOutOfSynch;
  339. extern WCHAR NmpInvalidJoinerIdString[];
  340. extern WCHAR NmpUnknownString[];
  341. extern LPWSTR NmpClusnetEndpoint;
  342. extern NM_STATE NmpState;
  343. extern CL_NODE_ID NmpLeaderNodeId;
  344. extern BITSET NmpUpNodeSet;
  345. extern WCHAR NmpNullString[];
  346. extern CLUSTER_NETWORK_ROLE NmpDefaultNetworkRole;
  347. extern BOOL NmpCleanupIfJoinAborted;
  348. extern DWORD NmpAddNodeId;
  349. extern LIST_ENTRY NmpLeaderChangeWaitList;
  350. extern LIST_ENTRY * NmpIntraClusterRpcArr;
  351. extern CRITICAL_SECTION NmpRPCLock;
  352. extern BOOL NmpLastNodeEvicted;
  353. extern DWORD NmpNodeCount;
  354. extern BOOLEAN NmpIsNT5NodeInCluster;
  355. extern LPWSTR NmpClusterInstanceId;
  356. #if DBG
  357. extern DWORD NmpRpcTimer;
  358. #endif //DBG
  359. //
  360. // Synchronization macros
  361. //
  362. #define NmpAcquireLock() EnterCriticalSection(&NmpLock)
  363. #define NmpReleaseLock() LeaveCriticalSection(&NmpLock)
  364. #define NmpAcquireMutex() \
  365. { \
  366. DWORD _status = WaitForSingleObject(NmpMutex, INFINITE); \
  367. CL_ASSERT(_status == WAIT_OBJECT_0); \
  368. } \
  369. #define NmpReleaseMutex() ReleaseMutex(NmpMutex);
  370. //
  371. // Node Intracluster RPC record/cancellation routines.
  372. // Useful to terminate outstanding RPCs to failed nodes.
  373. //
  374. #define NM_RPC_TIMEOUT 45000 // 45 secs
  375. typedef struct _NM_INTRACLUSTER_RPC_THREAD {
  376. LIST_ENTRY Linkage;
  377. BOOLEAN Cancelled;
  378. HANDLE Thread;
  379. DWORD ThreadId;
  380. }NM_INTRACLUSTER_RPC_THREAD, *PNM_INTRACLUSTER_RPC_THREAD;
  381. #define NmpAcquireRPCLock() EnterCriticalSection(&NmpRPCLock);
  382. #define NmpReleaseRPCLock() LeaveCriticalSection(&NmpRPCLock);
  383. VOID
  384. NmpTerminateRpcsToNode(
  385. DWORD NodeId
  386. );
  387. VOID
  388. NmpRpcTimerTick(
  389. DWORD MsTickInterval
  390. );
  391. //
  392. // IsolationPollTimerValue read routine
  393. //
  394. DWORD
  395. NmpGetIsolationPollTimerValue(
  396. VOID
  397. );
  398. //
  399. // Miscellaneous Routines
  400. //
  401. BOOLEAN
  402. NmpLockedEnterApi(
  403. NM_STATE RequiredState
  404. );
  405. BOOLEAN
  406. NmpEnterApi(
  407. NM_STATE RequiredState
  408. );
  409. VOID
  410. NmpLeaveApi(
  411. VOID
  412. );
  413. VOID
  414. NmpLockedLeaveApi(
  415. VOID
  416. );
  417. LPWSTR
  418. NmpLoadString(
  419. IN UINT StringId
  420. );
  421. VOID
  422. NmpDbgPrint(
  423. IN ULONG LogLevel,
  424. IN PCHAR FormatString,
  425. ...
  426. );
  427. DWORD
  428. NmpCleanseRegistry(
  429. IN LPCWSTR NodeId,
  430. IN HLOCALXSACTION Xaction
  431. );
  432. DWORD
  433. NmpQueryString(
  434. IN HDMKEY Key,
  435. IN LPCWSTR ValueName,
  436. IN DWORD ValueType,
  437. IN LPWSTR *StringBuffer,
  438. IN OUT LPDWORD StringBufferSize,
  439. OUT LPDWORD StringSize
  440. );
  441. BOOL
  442. NmpCleanseResTypeCallback(
  443. IN PNM_EVICTION_CONTEXT Context,
  444. IN PVOID Context2,
  445. IN PFM_RESTYPE pResType,
  446. IN LPCWSTR pszResTypeName
  447. );
  448. BOOL
  449. NmpCleanseResourceCallback(
  450. IN PNM_EVICTION_CONTEXT Context,
  451. IN PVOID Context2,
  452. IN PFM_RESOURCE Resource,
  453. IN LPCWSTR ResourceName
  454. );
  455. BOOL
  456. NmpCleanseGroupCallback(
  457. IN PNM_EVICTION_CONTEXT Context,
  458. IN PVOID Context2,
  459. IN PFM_GROUP Group,
  460. IN LPCWSTR GroupName
  461. );
  462. VOID
  463. NmpIssueClusterPropertyChangeEvent(
  464. VOID
  465. );
  466. DWORD
  467. NmpMarshallObjectInfo(
  468. IN const PRESUTIL_PROPERTY_ITEM PropertyTable,
  469. IN PVOID ObjectInfo,
  470. OUT PVOID * PropertyList,
  471. OUT LPDWORD PropertyListSize
  472. );
  473. BOOLEAN
  474. NmpVerifyNodeConnectivity(
  475. PNM_NODE Node1,
  476. PNM_NODE Node2,
  477. PNM_NETWORK ExcludedNetwork
  478. );
  479. BOOLEAN
  480. NmpVerifyConnectivity(
  481. PNM_NETWORK ExcludedNetwork
  482. );
  483. BOOLEAN
  484. NmpVerifyJoinerConnectivity(
  485. IN PNM_NODE JoiningNode,
  486. OUT PNM_NODE * UnreachableNode
  487. );
  488. //
  489. // Node Management Routines
  490. //
  491. DWORD
  492. NmpInitNodes(
  493. VOID
  494. );
  495. VOID
  496. NmpCleanupNodes(
  497. VOID
  498. );
  499. DWORD
  500. NmpGetNodeDefinition(
  501. IN OUT PNM_NODE_INFO2 NodeInfo
  502. );
  503. DWORD
  504. NmpEnumNodeDefinitions(
  505. PNM_NODE_ENUM2 * NodeEnum
  506. );
  507. DWORD
  508. NmpCreateNodeObjects(
  509. IN PNM_NODE_ENUM2 NodeEnum2
  510. );
  511. DWORD NmpRefreshNodeObjects(
  512. );
  513. DWORD
  514. NmpCreateLocalNodeObject(
  515. IN PNM_NODE_INFO2 NodeInfo2
  516. );
  517. PNM_NODE
  518. NmpCreateNodeObject(
  519. IN PNM_NODE_INFO2 NodeInfo
  520. );
  521. DWORD
  522. NmpGetNodeObjectInfo(
  523. IN PNM_NODE Node,
  524. IN OUT PNM_NODE_INFO2 NodeInfo
  525. );
  526. VOID
  527. NmpDeleteNodeObject(
  528. IN PNM_NODE Node,
  529. IN BOOLEAN IssueEvent
  530. );
  531. BOOL
  532. NmpDestroyNodeObject(
  533. PNM_NODE Node
  534. );
  535. DWORD
  536. NmpEnumNodeObjects(
  537. PNM_NODE_ENUM2 * NodeEnum
  538. );
  539. VOID
  540. NmpNodeFailureHandler(
  541. CL_NODE_ID NodeId,
  542. LPVOID NodeFailureContext
  543. );
  544. DWORD
  545. NmpSetNodeInterfacePriority(
  546. IN PNM_NODE Node,
  547. IN DWORD Priority,
  548. IN PNM_INTERFACE TargetInterface OPTIONAL,
  549. IN DWORD TargetInterfacePriority OPTIONAL
  550. );
  551. DWORD
  552. NmpEnumNodeObjects(
  553. PNM_NODE_ENUM2 * NodeEnum2
  554. );
  555. DWORD
  556. NmpAddNode(
  557. IN LPCWSTR NewNodeName,
  558. IN DWORD NewNodeHighestVersion,
  559. IN DWORD NewNodeLowestVersion,
  560. IN DWORD NewNodeProductSuite,
  561. IN DWORD RegistryNodeLimit
  562. );
  563. BOOLEAN
  564. NmpIsAddNodeAllowed(
  565. IN DWORD NewNodeProductSuite,
  566. IN DWORD RegistryNodeLimit,
  567. OUT LPDWORD EffectiveNodeLimit OPTIONAL
  568. );
  569. VOID
  570. NmpAdviseNodeFailure(
  571. IN PNM_NODE Node,
  572. IN DWORD ErrorCode
  573. );
  574. //
  575. // PnP Management Routines
  576. //
  577. DWORD
  578. NmpInitializePnp(
  579. VOID
  580. );
  581. VOID
  582. NmpShutdownPnp(
  583. VOID
  584. );
  585. VOID
  586. NmpCleanupPnp(
  587. VOID
  588. );
  589. VOID
  590. NmpWatchForPnpEvents(
  591. VOID
  592. );
  593. DWORD
  594. NmpEnablePnpEvents(
  595. VOID
  596. );
  597. DWORD
  598. NmpPostPnpNotification(
  599. BOOLEAN IsPnpLockHeld
  600. );
  601. DWORD
  602. NmpConfigureNetworks(
  603. IN RPC_BINDING_HANDLE JoinSponsorBinding,
  604. IN LPWSTR LocalNodeId,
  605. IN LPWSTR LocalNodeName,
  606. IN PNM_NETWORK_ENUM * NetworkEnum,
  607. IN PNM_INTERFACE_ENUM2 * InterfaceEnum,
  608. IN LPWSTR DefaultEndpoint,
  609. IN OUT LPDWORD MatchedNetworkCount,
  610. IN OUT LPDWORD NewNetworkCount,
  611. IN BOOL RenameConnectoids
  612. );
  613. //
  614. // Network Management Routines
  615. //
  616. DWORD
  617. NmpInitializeNetworks(
  618. VOID
  619. );
  620. VOID
  621. NmpCleanupNetworks(
  622. VOID
  623. );
  624. DWORD
  625. NmpSetNetworkRole(
  626. PNM_NETWORK Network,
  627. CLUSTER_NETWORK_ROLE NewRole,
  628. HLOCALXSACTION Xaction,
  629. HDMKEY NetworkKey
  630. );
  631. DWORD
  632. NmpCreateNetwork(
  633. IN RPC_BINDING_HANDLE JoinSponsorBinding,
  634. IN PNM_NETWORK_INFO NetworkInfo,
  635. IN PNM_INTERFACE_INFO2 InterfaceInfo
  636. );
  637. DWORD
  638. NmpGlobalCreateNetwork(
  639. IN PNM_NETWORK_INFO NetworkInfo,
  640. IN PNM_INTERFACE_INFO2 InterfaceInfo
  641. );
  642. DWORD
  643. NmpCreateNetworkDefinition(
  644. IN PNM_NETWORK_INFO NetworkInfo,
  645. IN HLOCALXSACTION Xaction
  646. );
  647. DWORD
  648. NmpSetNetworkNameDefinition(
  649. IN PNM_NETWORK_INFO NetworkInfo,
  650. IN HLOCALXSACTION Xaction
  651. );
  652. DWORD
  653. NmpGetNetworkDefinition(
  654. IN LPWSTR NetworkId,
  655. OUT PNM_NETWORK_INFO NetworkInfo
  656. );
  657. DWORD
  658. NmpEnumNetworkDefinitions(
  659. OUT PNM_NETWORK_ENUM * NetworkEnum
  660. );
  661. DWORD
  662. NmpCreateNetworkObjects(
  663. IN PNM_NETWORK_ENUM NetworkEnum
  664. );
  665. PNM_NETWORK
  666. NmpCreateNetworkObject(
  667. IN PNM_NETWORK_INFO NetworkInfo
  668. );
  669. DWORD
  670. NmpGetNetworkObjectInfo(
  671. IN PNM_NETWORK Network,
  672. OUT PNM_NETWORK_INFO NetworkInfo
  673. );
  674. VOID
  675. NmpDeleteNetworkObject(
  676. IN PNM_NETWORK Network,
  677. IN BOOLEAN IssueEvent
  678. );
  679. BOOL
  680. NmpDestroyNetworkObject(
  681. PNM_NETWORK Network
  682. );
  683. DWORD
  684. NmpEnumNetworkObjects(
  685. OUT PNM_NETWORK_ENUM * NetworkEnum
  686. );
  687. DWORD
  688. NmpRegisterNetwork(
  689. IN PNM_NETWORK Network,
  690. IN BOOLEAN RetryOnFailure
  691. );
  692. VOID
  693. NmpDeregisterNetwork(
  694. IN PNM_NETWORK Network
  695. );
  696. VOID
  697. NmpInsertInternalNetwork(
  698. PNM_NETWORK Network
  699. );
  700. DWORD
  701. NmpValidateNetworkRoleChange(
  702. PNM_NETWORK Network,
  703. CLUSTER_NETWORK_ROLE NewRole
  704. );
  705. DWORD
  706. NmpNetworkValidateCommonProperties(
  707. IN PNM_NETWORK Network,
  708. IN PVOID InBuffer,
  709. IN DWORD InBufferSize,
  710. OUT PNM_NETWORK_INFO NetworkInfo OPTIONAL
  711. );
  712. DWORD
  713. NmpSetNetworkName(
  714. IN PNM_NETWORK_INFO NetworkInfo
  715. );
  716. DWORD
  717. NmpGlobalSetNetworkName(
  718. IN PNM_NETWORK_INFO NetworkInfo
  719. );
  720. VOID
  721. NmpRecomputeNT5NetworkAndInterfaceStates(
  722. VOID
  723. );
  724. BOOLEAN
  725. NmpComputeNetworkAndInterfaceStates(
  726. PNM_NETWORK Network,
  727. BOOLEAN IsolateFailure,
  728. CLUSTER_NETWORK_STATE * NewNetworkState
  729. );
  730. VOID
  731. NmpStartNetworkConnectivityReportTimer(
  732. PNM_NETWORK Network
  733. );
  734. VOID
  735. NmpStartNetworkStateRecalcTimer(
  736. PNM_NETWORK Network,
  737. DWORD Timeout
  738. );
  739. VOID
  740. NmpStartNetworkFailureIsolationTimer(
  741. PNM_NETWORK Network,
  742. DWORD Timeout
  743. );
  744. VOID
  745. NmpStartNetworkRegistrationRetryTimer(
  746. PNM_NETWORK Network
  747. );
  748. VOID
  749. NmpScheduleNetworkConnectivityReport(
  750. PNM_NETWORK Network
  751. );
  752. VOID
  753. NmpScheduleNetworkStateRecalc(
  754. PNM_NETWORK Network
  755. );
  756. VOID
  757. NmpScheduleNetworkRegistration(
  758. PNM_NETWORK Network
  759. );
  760. DWORD
  761. NmpScheduleConnectivityReportWorker(
  762. VOID
  763. );
  764. DWORD
  765. NmpScheduleNetworkWorker(
  766. PNM_NETWORK Network
  767. );
  768. VOID
  769. NmpConnectivityReportWorker(
  770. IN PCLRTL_WORK_ITEM WorkItem,
  771. IN DWORD Status,
  772. IN DWORD BytesTransferred,
  773. IN ULONG_PTR IoContext
  774. );
  775. VOID
  776. NmpNetworkWorker(
  777. IN PCLRTL_WORK_ITEM WorkItem,
  778. IN DWORD Status,
  779. IN DWORD BytesTransferred,
  780. IN ULONG_PTR IoContext
  781. );
  782. VOID
  783. NmpNetworkTimerTick(
  784. IN DWORD MsTickInterval
  785. );
  786. VOID
  787. NmpSetNetworkAndInterfaceStates(
  788. IN PNM_NETWORK Network,
  789. IN CLUSTER_NETWORK_STATE NewNetworkState,
  790. IN PNM_STATE_ENTRY InterfaceStateVector,
  791. IN DWORD VectorSize
  792. );
  793. VOID
  794. NmpUpdateNetworkConnectivityForDownNode(
  795. PNM_NODE Node
  796. );
  797. DWORD
  798. NmpEnumNetworkObjectStates(
  799. OUT PNM_NETWORK_STATE_ENUM * NetworkStateEnum
  800. );
  801. VOID
  802. NmpFreeNetworkStateEnum(
  803. PNM_NETWORK_STATE_ENUM NetworkStateEnum
  804. );
  805. DWORD
  806. NmpReportNetworkConnectivity(
  807. IN PNM_NETWORK Network
  808. );
  809. DWORD
  810. NmpGlobalSetNetworkAndInterfaceStates(
  811. PNM_NETWORK Network,
  812. CLUSTER_NETWORK_STATE NewNetworkState
  813. );
  814. VOID
  815. NmpReferenceNetwork(
  816. PNM_NETWORK Network
  817. );
  818. VOID
  819. NmpDereferenceNetwork(
  820. PNM_NETWORK Network
  821. );
  822. PNM_NETWORK
  823. NmpReferenceNetworkByAddress(
  824. LPWSTR NetworkAddress
  825. );
  826. DWORD
  827. NmpEnumInternalNetworks(
  828. OUT LPDWORD NetworkCount,
  829. OUT PNM_NETWORK * NetworkList[]
  830. );
  831. DWORD
  832. NmpSetNetworkPriorityOrder(
  833. IN DWORD NetworkCount,
  834. IN PNM_NETWORK * NetworkList,
  835. IN HLOCALXSACTION Xaction
  836. );
  837. DWORD
  838. NmpGetNetworkInterfaceFailureTimerValue(
  839. IN LPCWSTR NetworkId
  840. );
  841. BOOLEAN
  842. NmpCheckForNetwork(
  843. VOID
  844. );
  845. //
  846. // Network Multicast Management Routines
  847. //
  848. DWORD
  849. NmpCleanupMulticast(
  850. VOID
  851. );
  852. DWORD
  853. NmpRefreshMulticastConfiguration(
  854. IN PNM_NETWORK Network
  855. );
  856. DWORD
  857. NmpRefreshClusterMulticastConfiguration(
  858. VOID
  859. );
  860. DWORD
  861. NmpMulticastRegenerateKey(
  862. IN PNM_NETWORK Network
  863. );
  864. DWORD
  865. NmpMulticastValidatePrivateProperties(
  866. IN PNM_NETWORK Network,
  867. IN HDMKEY RegistryKey,
  868. IN PVOID InBuffer,
  869. IN DWORD InBufferSize
  870. );
  871. VOID
  872. NmpScheduleMulticastAddressRenewal(
  873. PNM_NETWORK Network
  874. );
  875. VOID
  876. NmpScheduleMulticastAddressRelease(
  877. PNM_NETWORK Network
  878. );
  879. VOID
  880. NmpFreeMulticastAddressReleaseList(
  881. IN PNM_NETWORK Network
  882. );
  883. DWORD
  884. NmpMulticastManualConfigChange(
  885. IN PNM_NETWORK Network,
  886. IN HDMKEY NetworkKey,
  887. IN HDMKEY NetworkParametersKey,
  888. IN PVOID InBuffer,
  889. IN DWORD InBufferSize,
  890. OUT BOOLEAN * SetProperties
  891. );
  892. DWORD
  893. NmpUpdateSetNetworkMulticastConfiguration(
  894. IN BOOL SourceNode,
  895. IN LPWSTR NetworkId,
  896. IN PVOID UpdateBuffer,
  897. IN PVOID PropBuffer,
  898. IN LPDWORD PropBufferSize
  899. );
  900. DWORD
  901. NmpStartMulticast(
  902. IN PNM_NETWORK Network OPTIONAL
  903. );
  904. DWORD
  905. NmpStopMulticast(
  906. IN PNM_NETWORK Network OPTIONAL
  907. );
  908. VOID
  909. NmpMulticastInitialize(
  910. VOID
  911. );
  912. BOOLEAN
  913. NmpIsClusterMulticastReady(
  914. IN BOOLEAN CheckNodeCount
  915. );
  916. VOID
  917. NmpMulticastProcessClusterVersionChange(
  918. VOID
  919. );
  920. //
  921. // Interface Management Routines
  922. //
  923. DWORD
  924. NmpInitializeInterfaces(
  925. VOID
  926. );
  927. VOID
  928. NmpCleanupInterfaces(
  929. VOID
  930. );
  931. DWORD
  932. NmpCreateInterface(
  933. IN RPC_BINDING_HANDLE JoinSponsorBinding,
  934. IN PNM_INTERFACE_INFO2 InterfaceInfo
  935. );
  936. DWORD
  937. NmpGlobalCreateInterface(
  938. IN PNM_INTERFACE_INFO2 InterfaceInfo
  939. );
  940. DWORD
  941. NmpSetInterfaceInfo(
  942. IN RPC_BINDING_HANDLE JoinSponsorBinding,
  943. IN PNM_INTERFACE_INFO2 InterfaceInfo
  944. );
  945. DWORD
  946. NmpLocalSetInterfaceInfo(
  947. IN PNM_INTERFACE Interface,
  948. IN PNM_INTERFACE_INFO2 InterfaceInfo,
  949. IN HLOCALXSACTION Xaction
  950. );
  951. DWORD
  952. NmpGlobalSetInterfaceInfo(
  953. IN PNM_INTERFACE_INFO2 InterfaceInfo
  954. );
  955. DWORD
  956. NmpDeleteInterface(
  957. IN RPC_BINDING_HANDLE JoinSponsorBinding,
  958. IN LPWSTR InterfaceId,
  959. IN LPWSTR NetworkId,
  960. IN OUT PBOOLEAN NetworkDeleted
  961. );
  962. DWORD
  963. NmpGlobalDeleteInterface(
  964. IN LPWSTR InterfaceId,
  965. IN OUT PBOOLEAN NetworkDeleted
  966. );
  967. DWORD
  968. NmpInterfaceValidateCommonProperties(
  969. IN PNM_INTERFACE Interface,
  970. IN PVOID InBuffer,
  971. IN DWORD InBufferSize,
  972. OUT PNM_INTERFACE_INFO2 InterfaceInfo OPTIONAL
  973. );
  974. DWORD
  975. NmpCreateInterfaceDefinition(
  976. IN PNM_INTERFACE_INFO2 InterfaceInfo,
  977. IN HLOCALXSACTION Xaction
  978. );
  979. DWORD
  980. NmpGetInterfaceDefinition(
  981. IN LPWSTR InterfaceId,
  982. OUT PNM_INTERFACE_INFO2 InterfaceInfo
  983. );
  984. DWORD
  985. NmpSetInterfaceDefinition(
  986. IN PNM_INTERFACE_INFO2 InterfaceInfo,
  987. IN HLOCALXSACTION Xaction
  988. );
  989. DWORD
  990. NmpEnumInterfaceDefinitions(
  991. OUT PNM_INTERFACE_ENUM2 * InterfaceEnum
  992. );
  993. DWORD
  994. NmpCreateInterfaceObjects(
  995. IN PNM_INTERFACE_ENUM2 InterfaceEnum
  996. );
  997. PNM_INTERFACE
  998. NmpCreateInterfaceObject(
  999. IN PNM_INTERFACE_INFO2 InterfaceInfo,
  1000. IN BOOLEAN RetryOnFailure
  1001. );
  1002. DWORD
  1003. NmpGetInterfaceObjectInfo1(
  1004. IN PNM_INTERFACE Interface,
  1005. IN OUT PNM_INTERFACE_INFO InterfaceInfo1
  1006. );
  1007. DWORD
  1008. NmpGetInterfaceObjectInfo(
  1009. IN PNM_INTERFACE Interface,
  1010. IN OUT PNM_INTERFACE_INFO2 InterfaceInfo
  1011. );
  1012. VOID
  1013. NmpDeleteInterfaceObject(
  1014. IN PNM_INTERFACE Interface,
  1015. IN BOOLEAN IssueEvent
  1016. );
  1017. BOOL
  1018. NmpDestroyInterfaceObject(
  1019. PNM_INTERFACE Interface
  1020. );
  1021. DWORD
  1022. NmpEnumInterfaceObjects1(
  1023. OUT PNM_INTERFACE_ENUM * InterfaceEnum1
  1024. );
  1025. DWORD
  1026. NmpEnumInterfaceObjects(
  1027. OUT PNM_INTERFACE_ENUM2 * InterfaceEnum
  1028. );
  1029. DWORD
  1030. NmpRegisterInterface(
  1031. IN PNM_INTERFACE Interface,
  1032. IN BOOLEAN RetryOnFailure
  1033. );
  1034. VOID
  1035. NmpDeregisterInterface(
  1036. IN PNM_INTERFACE Interface
  1037. );
  1038. DWORD
  1039. NmpPrepareToCreateInterface(
  1040. IN PNM_INTERFACE_INFO2 InterfaceInfo,
  1041. OUT PNM_NETWORK * Network,
  1042. OUT PNM_NODE * Node
  1043. );
  1044. PNM_INTERFACE
  1045. NmpGetInterfaceForNodeAndNetworkById(
  1046. IN CL_NODE_ID NodeId,
  1047. IN CL_NETWORK_ID NetworkId
  1048. );
  1049. VOID
  1050. NmpFreeInterfaceStateEnum(
  1051. PNM_INTERFACE_STATE_ENUM InterfaceStateEnum
  1052. );
  1053. DWORD
  1054. NmpEnumInterfaceObjectStates(
  1055. OUT PNM_INTERFACE_STATE_ENUM * InterfaceStateEnum
  1056. );
  1057. VOID
  1058. NmpProcessLocalInterfaceStateEvent(
  1059. IN PNM_INTERFACE Interface,
  1060. IN CLUSTER_NETINTERFACE_STATE NewState
  1061. );
  1062. DWORD
  1063. NmpReportInterfaceConnectivity(
  1064. IN RPC_BINDING_HANDLE RpcBinding,
  1065. IN LPWSTR InterfaceId,
  1066. IN PNM_CONNECTIVITY_VECTOR ConnectivityVector,
  1067. IN LPWSTR NetworkId
  1068. );
  1069. VOID
  1070. NmpProcessInterfaceConnectivityReport(
  1071. IN PNM_INTERFACE SourceInterface,
  1072. IN PNM_CONNECTIVITY_VECTOR ConnectivityVector
  1073. );
  1074. DWORD
  1075. NmpInterfaceCheckThread(
  1076. LPDWORD Context
  1077. );
  1078. VOID
  1079. NmpReportLocalInterfaceStateEvent(
  1080. IN CL_NODE_ID NodeId,
  1081. IN CL_NETWORK_ID NetworkId,
  1082. IN DWORD NewState
  1083. );
  1084. DWORD
  1085. NmpConvertPropertyListToInterfaceInfo(
  1086. IN PVOID InterfacePropertyList,
  1087. IN DWORD InterfacePropertyListSize,
  1088. PNM_INTERFACE_INFO2 InterfaceInfo
  1089. );
  1090. VOID
  1091. NmpSetInterfaceConnectivityData(
  1092. PNM_NETWORK Network,
  1093. DWORD InterfaceNetIndex,
  1094. CLUSTER_NETINTERFACE_STATE State
  1095. );
  1096. DWORD
  1097. NmpTestInterfaceConnectivity(
  1098. PNM_INTERFACE Interface1,
  1099. PBOOLEAN Interface1HasConnectivity,
  1100. PNM_INTERFACE Interface2,
  1101. PBOOLEAN Interfacet2HasConnectivity
  1102. );
  1103. DWORD
  1104. NmpBuildInterfaceOnlineAddressEnum(
  1105. PNM_INTERFACE Interface,
  1106. PNM_ADDRESS_ENUM * OnlineAddressEnum
  1107. );
  1108. DWORD
  1109. NmpBuildInterfacePingAddressEnum(
  1110. PNM_INTERFACE Interface,
  1111. PNM_ADDRESS_ENUM OnlineAddressEnum,
  1112. PNM_ADDRESS_ENUM * PingAddressEnum
  1113. );
  1114. BOOLEAN
  1115. NmpVerifyLocalInterfaceConnected(
  1116. IN PNM_INTERFACE Interface
  1117. );
  1118. //
  1119. // Membership Management Routines
  1120. //
  1121. DWORD
  1122. NmpMembershipInit(
  1123. VOID
  1124. );
  1125. VOID
  1126. NmpMembershipShutdown(
  1127. VOID
  1128. );
  1129. VOID
  1130. NmpMarkNodeUp(
  1131. CL_NODE_ID NodeId
  1132. );
  1133. VOID
  1134. NmpNodeUpEventHandler(
  1135. IN PNM_NODE Node
  1136. );
  1137. VOID
  1138. NmpNodeDownEventHandler(
  1139. IN PNM_NODE Node
  1140. );
  1141. DWORD
  1142. NmpMultiNodeDownEventHandler(
  1143. IN BITSET DownedNodeSet
  1144. );
  1145. DWORD
  1146. NmpNodeChange(
  1147. DWORD NodeId,
  1148. NODESTATUS newstatus
  1149. );
  1150. BOOL
  1151. NmpCheckQuorumEventHandler(
  1152. VOID
  1153. );
  1154. VOID
  1155. NmpHoldIoEventHandler(
  1156. VOID
  1157. );
  1158. VOID
  1159. NmpResumeIoEventHandler(
  1160. VOID
  1161. );
  1162. VOID
  1163. NmpHaltEventHandler(
  1164. IN DWORD HaltCode
  1165. );
  1166. VOID
  1167. NmpJoinAbort(
  1168. DWORD AbortStatus,
  1169. PNM_NODE JoinerNode
  1170. );
  1171. //
  1172. // Routines for joining nodes to a cluster
  1173. //
  1174. DWORD
  1175. NmpCreateJoinerRpcBindings(
  1176. IN PNM_NODE JoinerNode,
  1177. IN PNM_INTERFACE JoinerInterface
  1178. );
  1179. //
  1180. // Gum update message types.
  1181. //
  1182. // The first entries in this list are auto-marshalled through Gum...Ex.
  1183. // Any updates that are not auto-marshalled must come after NmUpdateMaxAuto
  1184. //
  1185. typedef enum {
  1186. NmUpdateCreateNode = 0,
  1187. NmUpdatePauseNode,
  1188. NmUpdateResumeNode,
  1189. NmUpdateEvictNode,
  1190. NmUpdateCreateNetwork,
  1191. NmUpdateSetNetworkName,
  1192. NmUpdateSetNetworkPriorityOrder,
  1193. NmUpdateSetNetworkCommonProperties,
  1194. NmUpdateCreateInterface,
  1195. NmUpdateSetInterfaceInfo,
  1196. NmUpdateSetInterfaceCommonProperties,
  1197. NmUpdateDeleteInterface,
  1198. NmUpdateJoinBegin,
  1199. NmUpdateJoinAbort,
  1200. //
  1201. // Version 2 (NT 5.0) extensions that are understood by
  1202. // NT4 SP4 4.
  1203. //
  1204. NmUpdateJoinBegin2,
  1205. NmUpdateSetNetworkAndInterfaceStates,
  1206. NmUpdatePerformFixups,
  1207. NmUpdatePerformFixups2,
  1208. //
  1209. // Version 2 (NT 5.0) extensions that are not understood
  1210. // by NT4 SP4. These may not be issued in a mixed NT4/NT5 cluster.
  1211. //
  1212. NmUpdateAddNode,
  1213. NmUpdateExtendedNodeState,
  1214. //
  1215. // NT 5.1 extensions that are not understood by NT5 and
  1216. // earlier. NT5 nodes will ignore these updates without
  1217. // error.
  1218. //
  1219. NmUpdateSetNetworkMulticastConfiguration,
  1220. //
  1221. // Max handled automatically by GUM
  1222. //
  1223. NmUpdateMaxAuto = 0x10000,
  1224. NmUpdateJoinComplete,
  1225. NmUpdateMaximum
  1226. } NM_GUM_MESSAGE_TYPES;
  1227. #pragma warning( disable: 4200 )
  1228. typedef struct _NM_JOIN_UPDATE {
  1229. DWORD JoinSequence;
  1230. DWORD IsPaused;
  1231. WCHAR NodeId[0];
  1232. } NM_JOIN_UPDATE, *PNM_JOIN_UPDATE;
  1233. #pragma warning( default: 4200 )
  1234. DWORD
  1235. NmpGumUpdateHandler(
  1236. IN DWORD Context,
  1237. IN BOOL SourceNode,
  1238. IN DWORD BufferLength,
  1239. IN PVOID Buffer
  1240. );
  1241. DWORD
  1242. NmpUpdateAddNode(
  1243. IN BOOL SourceNode,
  1244. IN LPDWORD NewNodeId,
  1245. IN LPCWSTR NewNodeName,
  1246. IN LPDWORD NewNodeHighestVersion,
  1247. IN LPDWORD NewNodeLowestVersion,
  1248. IN LPDWORD NewNodeProductSuite
  1249. );
  1250. DWORD
  1251. NmpUpdateCreateNode(
  1252. IN BOOL SourceNode,
  1253. IN LPDWORD NodeId
  1254. );
  1255. DWORD
  1256. NmpUpdatePauseNode(
  1257. IN BOOL SourceNode,
  1258. IN LPWSTR NodeName
  1259. );
  1260. DWORD
  1261. NmpUpdateResumeNode(
  1262. IN BOOL SourceNode,
  1263. IN LPWSTR NodeName
  1264. );
  1265. DWORD
  1266. NmpUpdateEvictNode(
  1267. IN BOOL SourceNode,
  1268. IN LPWSTR NodeName
  1269. );
  1270. DWORD
  1271. NmpUpdateCreateNetwork(
  1272. IN BOOL IsSourceNode,
  1273. IN PVOID NetworkPropertyList,
  1274. IN LPDWORD NetworkPropertyListSize,
  1275. IN PVOID InterfacePropertyList,
  1276. IN LPDWORD InterfacePropertyListSize
  1277. );
  1278. DWORD
  1279. NmpUpdateSetNetworkName(
  1280. IN BOOL IsSourceNode,
  1281. IN LPWSTR NetworkId,
  1282. IN LPWSTR Name
  1283. );
  1284. DWORD
  1285. NmpUpdateSetNetworkPriorityOrder(
  1286. IN BOOL IsSourceNode,
  1287. IN LPCWSTR NetworkIdList
  1288. );
  1289. DWORD
  1290. NmpUpdateSetNetworkCommonProperties(
  1291. IN BOOL IsSourceNode,
  1292. IN LPWSTR NetworkId,
  1293. IN UCHAR * PropertyList,
  1294. IN LPDWORD PropertyListLength
  1295. );
  1296. DWORD
  1297. NmpUpdateCreateInterface(
  1298. IN BOOL IsSourceNode,
  1299. IN PVOID InterfacePropertyList,
  1300. IN LPDWORD InterfacePropertyListSize
  1301. );
  1302. DWORD
  1303. NmpUpdateSetInterfaceInfo(
  1304. IN BOOL SourceNode,
  1305. IN PVOID InterfacePropertyList,
  1306. IN LPDWORD InterfacePropertyListSize
  1307. );
  1308. DWORD
  1309. NmpUpdateSetInterfaceCommonProperties(
  1310. IN BOOL IsSourceNode,
  1311. IN LPWSTR InterfaceId,
  1312. IN UCHAR * PropertyList,
  1313. IN LPDWORD PropertyListLength
  1314. );
  1315. DWORD
  1316. NmpUpdateDeleteInterface(
  1317. IN BOOL IsSourceNode,
  1318. IN LPWSTR InterfaceId
  1319. );
  1320. DWORD
  1321. NmpUpdateJoinBegin(
  1322. IN BOOL SourceNode,
  1323. IN LPWSTR JoinerNodeId,
  1324. IN LPWSTR JoinerNodeName,
  1325. IN LPWSTR SponsorNodeId
  1326. );
  1327. DWORD
  1328. NmpUpdateJoinComplete(
  1329. IN PNM_JOIN_UPDATE JoinUpdate
  1330. );
  1331. DWORD
  1332. NmpUpdateJoinAbort(
  1333. IN BOOL SourceNode,
  1334. IN LPDWORD JoinSequence,
  1335. IN LPWSTR JoinerNodeId
  1336. );
  1337. DWORD
  1338. NmpUpdateJoinBegin2(
  1339. IN BOOL SourceNode,
  1340. IN LPWSTR JoinerNodeId,
  1341. IN LPWSTR JoinerNodeName,
  1342. IN LPWSTR SponsorNodeId,
  1343. IN LPDWORD JoinerHighestVersion,
  1344. IN LPDWORD JoinerLowestVersion
  1345. );
  1346. DWORD
  1347. NmpUpdateSetNetworkAndInterfaceStates(
  1348. IN BOOL IsSourceNode,
  1349. IN LPWSTR NetworkId,
  1350. IN CLUSTER_NETWORK_STATE * NewNetworkState,
  1351. IN PNM_STATE_ENTRY InterfaceStateVector,
  1352. IN LPDWORD InterfaceStateVectorSize
  1353. );
  1354. DWORD
  1355. NmpDoInterfacePing(
  1356. IN PNM_INTERFACE Interface,
  1357. IN PNM_ADDRESS_ENUM PingAddressEnum,
  1358. OUT BOOLEAN * PingSucceeded
  1359. );
  1360. //versioning functions
  1361. VOID
  1362. NmpResetClusterVersion(
  1363. BOOL ProcessChanges
  1364. );
  1365. DWORD NmpValidateNodeVersion(
  1366. IN LPCWSTR NodeId,
  1367. IN DWORD dwHighestVersion,
  1368. IN DWORD dwLowestVersion
  1369. );
  1370. DWORD NmpFormFixupNodeVersion(
  1371. IN LPCWSTR NodeId,
  1372. IN DWORD dwHighestVersion,
  1373. IN DWORD dwLowestVersion
  1374. );
  1375. DWORD NmpJoinFixupNodeVersion(
  1376. IN HLOCALXSACTION hXsaction,
  1377. IN LPCWSTR NodeId,
  1378. IN DWORD dwHighestVersion,
  1379. IN DWORD dwLowestVersion
  1380. );
  1381. DWORD NmpIsNodeVersionAllowed(
  1382. IN DWORD dwExcludeNodeId,
  1383. IN DWORD NodeHighestVersion,
  1384. IN DWORD NodeLowestVersion,
  1385. IN BOOL bJoin
  1386. );
  1387. DWORD NmpCalcClusterVersion(
  1388. IN DWORD dwExcludeNodeId,
  1389. OUT LPDWORD pdwClusterHighestVersion,
  1390. OUT LPDWORD pdwClusterLowestVersion
  1391. );
  1392. DWORD NmpUpdatePerformFixups(
  1393. IN BOOL IsSourceNode,
  1394. IN PVOID PropertyList,
  1395. IN LPDWORD PropertyListSize
  1396. );
  1397. DWORD NmpUpdatePerformFixups2(
  1398. IN BOOL IsSourceNode,
  1399. IN PVOID PropertyList,
  1400. IN LPDWORD PropertyListSize,
  1401. IN LPDWORD lpdwFixupNum,
  1402. IN PVOID lpKeyName,
  1403. IN PVOID pPropertyBuffer
  1404. );
  1405. DWORD NmpUpdateExtendedNodeState(
  1406. IN BOOL SourceNode,
  1407. IN LPWSTR NodeId,
  1408. IN CLUSTER_NODE_STATE* ExtendedState
  1409. );
  1410. VOID
  1411. NmpProcessClusterVersionChange(
  1412. VOID
  1413. );
  1414. VOID
  1415. NmpResetClusterNodeLimit(
  1416. );
  1417. // Fixup routine for updating the node version info, used by nmperformfixups
  1418. DWORD
  1419. NmpBuildVersionInfo(
  1420. IN DWORD dwFixUpType,
  1421. OUT PVOID * ppPropertyList,
  1422. OUT LPDWORD pdwPropertyListSize,
  1423. OUT LPWSTR * lpszKeyName
  1424. );
  1425. //
  1426. // connectoid advise sink functions
  1427. //
  1428. HRESULT
  1429. NmpInitializeConnectoidAdviseSink(
  1430. VOID
  1431. );
  1432. //
  1433. // Routines that must be supplied by users of the ClNet package.
  1434. //
  1435. VOID
  1436. ClNetPrint(
  1437. IN ULONG LogLevel,
  1438. IN PCHAR FormatString,
  1439. ...
  1440. );
  1441. VOID
  1442. ClNetLogEvent(
  1443. IN DWORD LogLevel,
  1444. IN DWORD MessageId
  1445. );
  1446. VOID
  1447. ClNetLogEvent1(
  1448. IN DWORD LogLevel,
  1449. IN DWORD MessageId,
  1450. IN LPCWSTR Arg1
  1451. );
  1452. VOID
  1453. ClNetLogEvent2(
  1454. IN DWORD LogLevel,
  1455. IN DWORD MessageId,
  1456. IN LPCWSTR Arg1,
  1457. IN LPCWSTR Arg2
  1458. );
  1459. VOID
  1460. ClNetLogEvent3(
  1461. IN DWORD LogLevel,
  1462. IN DWORD MessageId,
  1463. IN LPCWSTR Arg1,
  1464. IN LPCWSTR Arg2,
  1465. IN LPCWSTR Arg3
  1466. );
  1467. //
  1468. // Shared key management routines.
  1469. //
  1470. DWORD
  1471. NmpGetClusterKey(
  1472. OUT PVOID KeyBuffer,
  1473. IN OUT DWORD * KeyBufferLength
  1474. );
  1475. DWORD
  1476. NmpRegenerateClusterKey(
  1477. VOID
  1478. );
  1479. VOID
  1480. NmpFreeClusterKey(
  1481. VOID
  1482. );
  1483. #endif // _NMP_INCLUDED
  1484.